V4.8.16 dev (#3431)

* feat: add feishu & yuque dataset (#3379)

* feat: add feishu & yuque dataset

* fix ts

* fix ts

* move type position

* fix

* fix: merge interface

* fix

* feat: dingtalk sso support (#3408)

* fix: optional sso state

* feat: dingtalk bot

* feat: dingtalk sso login

* chore: move i18n to user namespace

* feat: dingtalk bot integration (#3415)

* feat: dingtalk bot integration

* docs: config dingtalk bot

* feat:sear XNG服务 (#3413)

* feat:sear XNG服务

* 补充了courseUrl

* 添加了官方文档

* 错误时返回情况修正了一下

* Tracks (#3420)

* feat: node intro

* feat: add domain track

* dingding sso login

* perf: api dataset code and add doc

* feat: tracks

* feat: searXNG plugins

* fix: ts

* feat: delete node tracks (#3423)

* fix: dingtalk bot GET verification (#3424)

* 4.8.16 test: fix: plugin inputs render;fix: ui offset (#3426)

* fix: ui offset

* perf: dingding talk

* fix: plugin inputs render

* feat: menu all folder (#3429)

* fix: recall code

---------

Co-authored-by: heheer <heheer@sealos.io>
Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com>
Co-authored-by: Jiangween <145003935+Jiangween@users.noreply.github.com>
This commit is contained in:
Archer
2024-12-18 19:30:19 +08:00
committed by GitHub
parent 82871be054
commit bd79e7701f
154 changed files with 2519 additions and 300 deletions

View File

@@ -12,7 +12,8 @@ export enum DatasetErrEnum {
unLinkCollection = 'unLinkCollection',
invalidVectorModelOrQAModel = 'invalidVectorModelOrQAModel',
notSupportSync = 'notSupportSync',
sameApiCollection = 'sameApiCollection'
sameApiCollection = 'sameApiCollection',
noApiServer = 'noApiServer'
}
const datasetErr = [
{

View File

@@ -0,0 +1,7 @@
export enum TrackEnum {
login = 'login',
createApp = 'createApp',
useAppTemplate = 'useAppTemplate',
createDataset = 'createDataset',
appNodes = 'appNodes'
}

View File

@@ -0,0 +1,18 @@
import { TrackEnum } from './constants';
import { OAuthEnum } from '../../../support/user/constant';
import { AppTypeEnum } from '../../../core/app/constants';
export type PushTrackCommonType = {
uid: string;
teamId: string;
tmbId: string;
};
export type TrackSchemaType = {
event: TrackEnum;
createTime: Date;
uid?: string;
teamId?: string;
tmbId?: string;
data: Record<string, any>;
};

View File

@@ -63,6 +63,7 @@ export type FastGPTFeConfigsType = {
github?: string;
google?: string;
wechat?: string;
dingtalk?: string;
microsoft?: {
clientId?: string;
tenantId?: string;

View File

@@ -16,6 +16,7 @@ import { DatasetSearchModeEnum } from '../dataset/constants';
import { DispatchNodeResponseType } from '../workflow/runtime/type.d';
import { ChatBoxInputType } from '../../../../projects/app/src/components/core/chat/ChatContainer/ChatBox/type';
import { WorkflowInteractiveResponseType } from '../workflow/template/system/interactive/type';
import { FlowNodeInputItemType } from '../workflow/type/io';
export type ChatSchema = {
_id: string;
@@ -35,6 +36,7 @@ export type ChatSchema = {
variableList?: VariableItemType[];
welcomeText?: string;
variables: Record<string, any>;
pluginInputs?: FlowNodeInputItemType[];
metadata?: Record<string, any>;
};

View File

@@ -17,6 +17,8 @@ export type DatasetUpdateBody = {
externalReadUrl?: DatasetSchemaType['externalReadUrl'];
defaultPermission?: DatasetSchemaType['defaultPermission'];
apiServer?: DatasetSchemaType['apiServer'];
yuqueServer?: DatasetSchemaType['yuqueServer'];
feishuServer?: DatasetSchemaType['feishuServer'];
// sync schedule
autoSync?: boolean;

View File

@@ -22,3 +22,14 @@ export type APIFileContentResponse = {
export type APIFileReadResponse = {
url: string;
};
export type FeishuServer = {
appId: string;
appSecret: string;
folderToken: string;
};
export type YuqueServer = {
userId: string;
token: string;
};

View File

@@ -6,7 +6,9 @@ export enum DatasetTypeEnum {
dataset = 'dataset',
websiteDataset = 'websiteDataset', // depp link
externalFile = 'externalFile',
apiDataset = 'apiDataset'
apiDataset = 'apiDataset',
feishu = 'feishu',
yuque = 'yuque'
}
export const DatasetTypeMap = {
[DatasetTypeEnum.folder]: {
@@ -33,6 +35,16 @@ export const DatasetTypeMap = {
icon: 'core/dataset/externalDatasetOutline',
label: 'api_file',
collectionLabel: 'common.File'
},
[DatasetTypeEnum.feishu]: {
icon: 'core/dataset/feishuDatasetOutline',
label: 'feishu_dataset',
collectionLabel: 'common.File'
},
[DatasetTypeEnum.yuque]: {
icon: 'core/dataset/yuqueDatasetOutline',
label: 'yuque_dataset',
collectionLabel: 'common.File'
}
};

View File

@@ -10,7 +10,7 @@ import {
} from './constants';
import { DatasetPermission } from '../../support/permission/dataset/controller';
import { Permission } from '../../support/permission/controller';
import { APIFileServer } from './apiDataset';
import { APIFileServer, FeishuServer, YuqueServer } from './apiDataset';
export type DatasetSchemaType = {
_id: string;
@@ -33,6 +33,8 @@ export type DatasetSchemaType = {
};
inheritPermission: boolean;
apiServer?: APIFileServer;
feishuServer?: FeishuServer;
yuqueServer?: YuqueServer;
autoSync?: boolean;

View File

@@ -3,6 +3,7 @@ export enum PublishChannelEnum {
iframe = 'iframe',
apikey = 'apikey',
feishu = 'feishu',
dingtalk = 'dingtalk',
wecom = 'wecom',
officialAccount = 'official_account'
}

View File

@@ -14,6 +14,11 @@ export interface FeishuAppType {
verificationToken?: string;
}
export interface DingtalkAppType {
clientId: string;
clientSecret: string;
}
export interface WecomAppType {
AgentId: string;
CorpId: string;
@@ -36,7 +41,12 @@ export interface OffiAccountAppType {
// because we can not reply anything in 15s. Thus, the wechat server will treat this request as a failed request.
}
export type OutlinkAppType = FeishuAppType | WecomAppType | OffiAccountAppType | undefined;
export type OutlinkAppType =
| FeishuAppType
| WecomAppType
| OffiAccountAppType
| DingtalkAppType
| undefined;
export type OutLinkSchema<T extends OutlinkAppType = undefined> = {
_id: string;

View File

@@ -1,4 +1,5 @@
import { OAuthEnum } from './constant';
import { TrackRegisterParams } from './login/api';
export type PostLoginProps = {
username: string;
@@ -9,8 +10,7 @@ export type OauthLoginProps = {
type: `${OAuthEnum}`;
code: string;
callbackUrl: string;
inviterId?: string;
};
} & TrackRegisterParams;
export type WxLoginProps = {
inviterId?: string;

View File

@@ -16,5 +16,6 @@ export enum OAuthEnum {
google = 'google',
wechat = 'wechat',
microsoft = 'microsoft',
dingtalk = 'dingtalk',
sso = 'sso'
}

View File

@@ -2,3 +2,17 @@ export type GetWXLoginQRResponse = {
code: string;
codeUrl: string;
};
export type TrackRegisterParams = {
inviterId?: string;
bd_vid?: string;
fastgpt_sem?: {
keyword: string;
};
sourceDomain?: string;
};
export type AccountRegisterBody = {
username: string;
code: string;
password: string;
} & TrackRegisterParams;

View File

@@ -12,6 +12,7 @@ export type CreateTeamProps = {
avatar?: string;
defaultTeam?: boolean;
lafAccount?: LafAccountType;
memberName?: string;
};
export type UpdateTeamProps = {
name?: string;

View File

@@ -9,6 +9,7 @@ export enum UsageSourceEnum {
share = 'share',
wecom = 'wecom',
feishu = 'feishu',
dingtalk = 'dingtalk',
official_account = 'official_account'
}
@@ -39,5 +40,8 @@ export const UsageSourceMap = {
},
[UsageSourceEnum.wecom]: {
label: i18nT('user:usage.wecom')
},
[UsageSourceEnum.dingtalk]: {
label: i18nT('user:usage.dingtalk')
}
};

View File

@@ -37,6 +37,8 @@ export const getUsageSourceByPublishChannel = (publishchannel: PublishChannelEnu
return UsageSourceEnum.wecom;
case PublishChannelEnum.officialAccount:
return UsageSourceEnum.official_account;
case PublishChannelEnum.dingtalk:
return UsageSourceEnum.dingtalk;
default:
return UsageSourceEnum.fastgpt;
}