Skip to content

Commit

Permalink
4.8-preview fix (labring#1324)
Browse files Browse the repository at this point in the history
* feishu app release (labring#85)

* Revert "lafAccount add pat & re request when token invalid (labring#76)" (labring#77)

This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be.

* perf: workflow ux

* system config

* feat: feishu app release

* chore: sovle the conflicts files; fix the feishu entry

* fix: rename Feishu interface to FeishuType

* fix: fix type problem in app.ts

* fix: type problem

* fix: style problem

---------

Co-authored-by: Archer <[email protected]>

* perf: publish channel code

* change system variable position (labring#94)

* perf: workflow context

* perf: variable select

* hide publish

* perf: simple edit auto refresh

* perf: simple edit data refresh

* fix: target handle

---------

Co-authored-by: Finley Ge <[email protected]>
Co-authored-by: heheer <[email protected]>
  • Loading branch information
3 people authored Apr 29, 2024
1 parent 5ca4049 commit a0c1320
Show file tree
Hide file tree
Showing 89 changed files with 1,786 additions and 1,039 deletions.
6 changes: 4 additions & 2 deletions docSite/content/docs/development/upgrading/48.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ FastGPT workflow V2上线,支持更加简洁的工作流模式。
2. 新增 - 工作流 Debug 模式,可以调试单个节点或者逐步调试工作流。
3. 新增 - 定时执行应用。可轻松实现定时任务。
4. 新增 - 插件自定义输入优化,可以渲染输入组件。
5. 优化 - 工作流连线,可以四向连接,方便构建循环工作流。
6. 优化 - worker进程管理,并将计算 Token 任务分配给 worker 进程。
6. 优化 - 工作流连线,可以四向连接,方便构建循环工作流。
7. 优化 - 工作流上下文传递,性能🚀。
8. 优化 - 简易模式,更新配置后自动更新调试框内容,无需保存。
9. 优化 - worker进程管理,并将计算 Token 任务分配给 worker 进程。
1 change: 1 addition & 0 deletions packages/global/core/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const appWorkflow2Form = ({ nodes }: { nodes: StoreNodeItemType[] }) => {

defaultAppForm.selectedTools.push({
id: node.pluginId,
pluginId: node.pluginId,
name: node.name,
avatar: node.avatar,
intro: node.intro || '',
Expand Down
5 changes: 3 additions & 2 deletions packages/global/support/outLink/constant.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export enum OutLinkTypeEnum {
export enum PublishChannelEnum {
share = 'share',
iframe = 'iframe',
apikey = 'apikey'
apikey = 'apikey',
feishu = 'feishu'
}
60 changes: 54 additions & 6 deletions packages/global/support/outLink/type.d.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,79 @@
import { AppSchema } from 'core/app/type';
import { OutLinkTypeEnum } from './constant';
import { PublishChannelEnum } from './constant';

export type OutLinkSchema = {
// Feishu Config interface
export interface FeishuType {
appId: string;
appSecret: string;
// Encrypt config
// refer to: https://open.feishu.cn/document/server-docs/event-subscription-guide/event-subscription-configure-/configure-encrypt-key
encryptKey?: string; // no secret if null
// Token Verification
// refer to: https://open.feishu.cn/document/server-docs/event-subscription-guide/event-subscription-configure-/encrypt-key-encryption-configuration-case
verificationToken: string;
}

// TODO: Unused
export interface WecomType {
ReplyLimit: Boolean;
defaultResponse: string;
immediateResponse: boolean;
WXWORK_TOKEN: string;
WXWORK_AESKEY: string;
WXWORK_SECRET: string;
WXWORD_ID: string;
}

export type OutLinkSchema<T = void> = {
_id: string;
shareId: string;
teamId: string;
tmbId: string;
appId: string;
// teamId: Schema.Types.ObjectId;
// tmbId: Schema.Types.ObjectId;
// appId: Schema.Types.ObjectId;
name: string;
usagePoints: number;
lastTime: Date;
type: `${OutLinkTypeEnum}`;
type: PublishChannelEnum;

// whether the response content is detailed
responseDetail: boolean;

// response when request
immediateResponse?: string;
// response when error or other situation
defaultResponse?: string;

limit?: {
expiredTime?: Date;
// Questions per minute
QPM: number;
maxUsagePoints: number;
// Verification message hook url
hookUrl?: string;
};

app?: T;
};

// to handle MongoDB querying
export type OutLinkWithAppType = Omit<OutLinkSchema, 'appId'> & {
appId: AppSchema;
};

export type OutLinkEditType = {
// Edit the Outlink
export type OutLinkEditType<T = void> = {
_id?: string;
name: string;
responseDetail: OutLinkSchema['responseDetail'];
limit: OutLinkSchema['limit'];
responseDetail: OutLinkSchema<T>['responseDetail'];
// response when request
immediateResponse?: string;
// response when error or other situation
defaultResponse?: string;
limit?: OutLinkSchema<T>['limit'];

// config for specific platform
app?: T;
};
23 changes: 21 additions & 2 deletions packages/service/support/outLink/schema.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { connectionMongo, type Model } from '../../common/mongo';
const { Schema, model, models } = connectionMongo;
import { OutLinkSchema as SchemaType } from '@fastgpt/global/support/outLink/type';
import { OutLinkTypeEnum } from '@fastgpt/global/support/outLink/constant';
import {
TeamCollectionName,
TeamMemberCollectionName
Expand Down Expand Up @@ -30,7 +29,7 @@ const OutLinkSchema = new Schema({
},
type: {
type: String,
default: OutLinkTypeEnum.share
required: true
},
name: {
type: String,
Expand Down Expand Up @@ -62,6 +61,26 @@ const OutLinkSchema = new Schema({
hookUrl: {
type: String
}
},
app: {
appId: {
type: String
},
appSecret: {
type: String
},
encryptKey: {
type: String
},
verificationToken: {
type: String
}
},
immediateResponse: {
type: String
},
defaultResponse: {
type: String
}
});

Expand Down
1 change: 1 addition & 0 deletions packages/web/components/common/Icon/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const iconPaths = {
'core/app/headphones': () => import('./icons/core/app/headphones.svg'),
'core/app/logsLight': () => import('./icons/core/app/logsLight.svg'),
'core/app/markLight': () => import('./icons/core/app/markLight.svg'),
'core/app/publish/lark': () => import('./icons/core/app/publish/lark.svg'),
'core/app/questionGuide': () => import('./icons/core/app/questionGuide.svg'),
'core/app/schedulePlan': () => import('./icons/core/app/schedulePlan.svg'),
'core/app/simpleMode/ai': () => import('./icons/core/app/simpleMode/ai.svg'),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants';

export type EditorVariablePickerType = {
key: string;
label: string;
icon?: string;
valueType?: WorkflowIOValueTypeEnum;
};
4 changes: 2 additions & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"@chakra-ui/react": "2.8.1",
"@chakra-ui/styled-system": "2.9.1",
"@chakra-ui/system": "2.6.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@fastgpt/global": "workspace:*",
"@fingerprintjs/fingerprintjs": "^4.3.0",
"@lexical/react": "0.12.6",
Expand Down
31 changes: 26 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const nextConfig = {

return config;
},
transpilePackages: ['@fastgpt/*'],
transpilePackages: ['@fastgpt/*', 'ahooks'],
experimental: {
// 外部包独立打包
serverComponentsExternalPackages: ['mongoose', 'pg'],
Expand Down
14 changes: 8 additions & 6 deletions projects/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
"@chakra-ui/react": "2.8.1",
"@chakra-ui/styled-system": "2.9.1",
"@chakra-ui/system": "2.6.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@fastgpt/global": "workspace:*",
"@fastgpt/plugins": "workspace:*",
"@fastgpt/service": "workspace:*",
"@fastgpt/web": "workspace:*",
"@fortaine/fetch-event-source": "^3.0.6",
"@node-rs/jieba": "1.10.0",
"@tanstack/react-query": "^4.24.10",
"@types/nprogress": "^0.2.0",
"ahooks": "^3.7.11",
Expand All @@ -39,10 +40,11 @@
"js-yaml": "^4.1.0",
"jsonwebtoken": "^9.0.2",
"lodash": "^4.17.21",
"mermaid": "10.2.3",
"mermaid": "^10.2.3",
"nanoid": "^4.0.1",
"next": "13.5.2",
"next-i18next": "15.2.0",
"nextjs-node-loader": "^1.1.5",
"nprogress": "^0.2.0",
"react": "18.2.0",
"react-day-picker": "^8.7.1",
Expand All @@ -58,9 +60,8 @@
"remark-math": "^5.1.1",
"request-ip": "^3.3.0",
"sass": "^1.58.3",
"zustand": "^4.3.5",
"nextjs-node-loader": "^1.1.5",
"@node-rs/jieba": "1.10.0"
"use-context-selector": "^1.4.4",
"zustand": "^4.3.5"
},
"devDependencies": {
"@svgr/webpack": "^6.5.1",
Expand All @@ -76,6 +77,7 @@
"@types/request-ip": "^0.0.37",
"eslint": "8.34.0",
"eslint-config-next": "13.1.6",
"nextjs-node-loader": "^1.1.5",
"typescript": "4.9.5"
}
}
9 changes: 9 additions & 0 deletions projects/app/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
"Submit failed": "Submit failed",
"Submit success": "Update Success",
"Sync success": "",
"System Output": "System Output",
"System version": "System version",
"Team": "Team",
"Team Tags Set": "Team Tags",
Expand Down Expand Up @@ -280,6 +281,7 @@
"App intro": "App intro",
"App params config": "App Config",
"Auto Save time": "Auto-saved: {{time}}",
"Change to simple mode": "Switch easy mode",
"Chat Variable": "",
"Config schedule plan": "Config schedule config",
"Config whisper": "Config whisper",
Expand Down Expand Up @@ -374,6 +376,11 @@
"Show History": "Show History",
"Web Link": "Web Link"
},
"publish": {
"Fei Shu Bot Desc": "Access the Lark robot",
"Fei shu bot": "Lark",
"Fei shu bot publish": "Posted to Lark Robot"
},
"schedule": {
"Default prompt": "Default prompt",
"Default prompt placeholder": "Default problem when executing the application",
Expand Down Expand Up @@ -957,6 +964,7 @@
"anyInput": "Any input",
"chat history": "chat history",
"switch": "Trigger",
"system params": "System params",
"textEditor textarea": "Text edit",
"user question": "User question"
},
Expand Down Expand Up @@ -1108,6 +1116,7 @@
"Stop debug": "Stop",
"Success": "Running success",
"Value type": "Type",
"Variable outputs": "Variables",
"chat": {
"Quote prompt": "Quote prompt"
},
Expand Down
Loading

0 comments on commit a0c1320

Please sign in to comment.