@tachybase/plugin-workflow-approval 0.23.8 → 0.23.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
2
  export declare const LauncherActionConfigComponent: () => React.JSX.Element;
3
3
  export declare const LauncherActionConfigReSubmit: () => React.JSX.Element;
4
+ export declare const LauncherActionConfigReminder: () => React.JSX.Element;
@@ -3,11 +3,7 @@ export declare const getSchemaBlockInitItem: (params: any) => {
3
3
  name: string;
4
4
  'x-uid': string;
5
5
  'x-decorator': any;
6
- 'x-decorator-props': {
7
- collection: any;
8
- params: any;
9
- action: any;
10
- };
6
+ 'x-decorator-props': any;
11
7
  'x-component': string;
12
8
  'x-designer': string;
13
9
  'x-toolbar': any;
@@ -16,6 +12,7 @@ export declare const getSchemaBlockInitItem: (params: any) => {
16
12
  block: {
17
13
  type: string;
18
14
  'x-component': any;
15
+ 'x-component-props': any;
19
16
  };
20
17
  };
21
18
  };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const FeatureCard: (props: any) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ featureCard: import("antd-style").SerializedStyles;
3
+ }>;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const FeatureList: () => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ featureList: import("antd-style").SerializedStyles;
3
+ }>;
@@ -0,0 +1,32 @@
1
+ export declare const getSchemaFeatureModal: (workflow: any) => {
2
+ type: string;
3
+ properties: {
4
+ [x: string]: {
5
+ type: string;
6
+ title: any;
7
+ 'x-decorator': string;
8
+ 'x-decorator-props': {
9
+ workflow: any;
10
+ };
11
+ 'x-component': string;
12
+ 'x-component-props': {
13
+ className: string;
14
+ };
15
+ properties: {
16
+ [x: number]: {
17
+ type: string;
18
+ 'x-decorator': string;
19
+ 'x-decorator-props': {
20
+ name: string;
21
+ dataSource: string;
22
+ };
23
+ 'x-component': string;
24
+ 'x-component-props': {
25
+ uid: any;
26
+ noForm: boolean;
27
+ };
28
+ };
29
+ };
30
+ };
31
+ };
32
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ViewFeatureModal: (props: any) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function useActionReminder(): {
2
+ run(): Promise<void>;
3
+ };
@@ -0,0 +1 @@
1
+ export declare const ProviderActionReminder: (props: any) => any;
@@ -0,0 +1 @@
1
+ export declare const NAMESPACE = "@tachybase/plugin-workflow-approval";
@@ -0,0 +1,27 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var constants_exports = {};
19
+ __export(constants_exports, {
20
+ NAMESPACE: () => NAMESPACE
21
+ });
22
+ module.exports = __toCommonJS(constants_exports);
23
+ const NAMESPACE = "@tachybase/plugin-workflow-approval";
24
+ // Annotate the CommonJS export names for ESM import in node:
25
+ 0 && (module.exports = {
26
+ NAMESPACE
27
+ });
@@ -1,19 +1,19 @@
1
1
  module.exports = {
2
- "@tachybase/client": "0.23.8",
3
- "@tachybase/module-workflow": "0.23.8",
4
- "@tachybase/server": "0.23.8",
2
+ "@tachybase/client": "0.23.14",
3
+ "@tachybase/module-workflow": "0.23.14",
4
+ "@tachybase/server": "0.23.14",
5
5
  "lodash": "4.17.21",
6
6
  "react": "18.3.1",
7
- "@tachybase/schema": "0.23.8",
7
+ "@tachybase/schema": "0.23.14",
8
8
  "@ant-design/icons": "5.3.7",
9
- "@tachybase/actions": "0.23.8",
10
- "@tachybase/database": "0.23.8",
11
- "@tachybase/data-source": "0.23.8",
12
- "@tachybase/module-ui-schema": "0.23.8",
13
- "@tachybase/utils": "0.23.8",
9
+ "@tachybase/actions": "0.23.14",
10
+ "@tachybase/database": "0.23.14",
11
+ "@tachybase/data-source": "0.23.14",
12
+ "@tachybase/module-ui-schema": "0.23.14",
13
+ "@tachybase/utils": "0.23.14",
14
14
  "sequelize": "6.37.5",
15
15
  "antd": "5.22.5",
16
16
  "ahooks": "3.8.4",
17
17
  "react-router-dom": "6.28.1",
18
- "@tachybase/components": "0.23.8"
18
+ "@tachybase/components": "0.23.14"
19
19
  };
@@ -180,6 +180,7 @@
180
180
  "My Pending Tasks": "My Pending Tasks",
181
181
  "Negotiation": "Negotiation",
182
182
  "Negotiation mode": "Negotiation mode",
183
+ "New Initiate Request": "New Initiate Request",
183
184
  "No end": "No end",
184
185
  "No limit": "No limit",
185
186
  "No repeat": "No repeat",
@@ -218,6 +219,8 @@
218
219
  "Reject": "Reject",
219
220
  "Rejected": "Rejected",
220
221
  "Related approvals": "Related approvals",
222
+ "Reminder": "Reminder",
223
+ "Reminder {{user}} successful": "Reminder {{user}} successful",
221
224
  "Repeat limit": "Repeat limit",
222
225
  "Repeat mode": "Repeat mode",
223
226
  "Resource": "Resource",
@@ -307,5 +310,6 @@
307
310
  "concat": "concat",
308
311
  "ms": "ms",
309
312
  "needAuthorization": "needAuthorization",
310
- "workflow loop!": "workflow loop!"
313
+ "workflow loop!": "workflow loop!",
314
+ "{{user}} reminder": "{{user}} reminder"
311
315
  }
@@ -221,6 +221,7 @@
221
221
  "My Pending Tasks": "我的待办",
222
222
  "Negotiation": "协商机制",
223
223
  "Negotiation mode": "协商模式",
224
+ "New Initiate Request": "发起申请(新)",
224
225
  "No data yet": "暂无数据",
225
226
  "No end": "不结束",
226
227
  "No limit": "不限",
@@ -264,6 +265,8 @@
264
265
  "Rejected": "否决",
265
266
  "Rejected from a manual node.": "被人工节点拒绝继续。",
266
267
  "Related approvals": "相关审批",
268
+ "Reminder": "催签",
269
+ "Reminder {{user}} successful": "催签 {{user}} 成功",
267
270
  "Repeat limit": "重复次数",
268
271
  "Repeat mode": "重复模式",
269
272
  "Resolved": "完成",
@@ -384,5 +387,6 @@
384
387
  "concat": "连接",
385
388
  "ms": "毫秒",
386
389
  "needAuthorization": "是否携带权限校验",
387
- "workflow loop!": "存在环形调用!"
390
+ "workflow loop!": "存在环形调用!",
391
+ "{{user}} reminder": "{{user}} 催签"
388
392
  }
@@ -5,4 +5,5 @@ export declare const approvals: {
5
5
  destroy(context: any, next: any): Promise<any>;
6
6
  withdraw(context: any, next: any): Promise<any>;
7
7
  listCentralized(context: any, next: any): Promise<void>;
8
+ reminder(context: any, next: any): Promise<any>;
8
9
  };
@@ -34,6 +34,7 @@ var import_actions = __toESM(require("@tachybase/actions"));
34
34
  var import_data_source = require("@tachybase/data-source");
35
35
  var import_database = require("@tachybase/database");
36
36
  var import_module_workflow = require("@tachybase/module-workflow");
37
+ var import_constants = require("../../common/constants");
37
38
  var import_status = require("../constants/status");
38
39
  var import_tools = require("../tools");
39
40
  const approvals = {
@@ -267,6 +268,45 @@ const approvals = {
267
268
  }
268
269
  });
269
270
  return await import_actions.default.list(context, next);
271
+ },
272
+ async reminder(context, next) {
273
+ var _a, _b, _c;
274
+ const { filterByTk } = context.action.params;
275
+ const repository = import_actions.utils.getRepositoryFromParams(context);
276
+ const approval = await repository.findOne({
277
+ filterByTk,
278
+ appends: ["records", "workflow", "createdBy.nickname"]
279
+ });
280
+ if (!approval) {
281
+ return context.throw(404);
282
+ }
283
+ if (approval.createdById !== ((_a = context.state.currentUser) == null ? void 0 : _a.id)) {
284
+ return context.throw(403);
285
+ }
286
+ if ([import_status.APPROVAL_STATUS.APPROVED, import_status.APPROVAL_STATUS.REJECTED, import_status.APPROVAL_STATUS.ERROR].includes(approval.status)) {
287
+ return context.throw(400);
288
+ }
289
+ if (((_b = approval.records) == null ? void 0 : _b.length) === 0) {
290
+ return context.throw(400);
291
+ }
292
+ const assignees = approval.records.map((record) => record.userId);
293
+ for (const userId of assignees) {
294
+ const message = {
295
+ userId,
296
+ title: `{{t("Approval", { ns: '${import_constants.NAMESPACE}' })}}`,
297
+ content: `{{t("{{user}} reminder", { ns: "${import_constants.NAMESPACE}", user: "${approval.createdBy.nickname}" })}}`,
298
+ collectionName: approval.collectionName,
299
+ jsonContent: approval.summary,
300
+ schemaName: (_c = approval.workflow) == null ? void 0 : _c.config.applyDetail
301
+ };
302
+ context.app.messageManager.sendMessage(+userId, message);
303
+ }
304
+ await next();
305
+ context.status = 200;
306
+ context.body = {
307
+ message: "reminder sent",
308
+ success: true
309
+ };
270
310
  }
271
311
  };
272
312
  // Annotate the CommonJS export names for ESM import in node:
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@tachybase/database").CollectionDef;
2
+ export default _default;
@@ -0,0 +1,38 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var workflows_exports = {};
19
+ __export(workflows_exports, {
20
+ default: () => workflows_default
21
+ });
22
+ module.exports = __toCommonJS(workflows_exports);
23
+ var import_database = require("@tachybase/database");
24
+ var workflows_default = (0, import_database.extendCollection)({
25
+ name: "workflows",
26
+ fields: [
27
+ {
28
+ name: "color",
29
+ type: "string",
30
+ interface: "color"
31
+ },
32
+ {
33
+ name: "icon",
34
+ type: "string",
35
+ interface: "icon"
36
+ }
37
+ ]
38
+ });
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-workflow-approval",
3
3
  "displayName": "Approval",
4
- "version": "0.23.8",
4
+ "version": "0.23.14",
5
5
  "description": "Approval base in Workflow",
6
6
  "keywords": [
7
7
  "Approval",
8
8
  "Workflow"
9
9
  ],
10
10
  "main": "dist/server/index.js",
11
- "dependencies": {
11
+ "dependencies": {},
12
+ "devDependencies": {
12
13
  "@ant-design/icons": "~5.3.7",
14
+ "@types/file-saver": "^2.0.7",
13
15
  "@types/lodash": "^4.17.13",
14
16
  "ahooks": "^3.8.4",
15
17
  "antd": "5.22.5",
@@ -22,20 +24,17 @@
22
24
  "react-router-dom": "6.28.1",
23
25
  "sequelize": "^6.37.5"
24
26
  },
25
- "devDependencies": {
26
- "@types/file-saver": "^2.0.7"
27
- },
28
27
  "peerDependencies": {
29
- "@tachybase/actions": "0.23.8",
30
- "@tachybase/client": "0.23.8",
31
- "@tachybase/database": "0.23.8",
32
- "@tachybase/server": "0.23.8",
33
- "@tachybase/module-workflow": "0.23.8",
34
- "@tachybase/test": "0.23.8",
35
- "@tachybase/components": "0.23.8",
36
- "@tachybase/data-source": "0.23.8",
37
- "@tachybase/utils": "0.23.8",
38
- "@tachybase/schema": "0.23.8"
28
+ "@tachybase/actions": "0.23.14",
29
+ "@tachybase/client": "0.23.14",
30
+ "@tachybase/components": "0.23.14",
31
+ "@tachybase/data-source": "0.23.14",
32
+ "@tachybase/database": "0.23.14",
33
+ "@tachybase/module-workflow": "0.23.14",
34
+ "@tachybase/schema": "0.23.14",
35
+ "@tachybase/server": "0.23.14",
36
+ "@tachybase/test": "0.23.14",
37
+ "@tachybase/utils": "0.23.14"
39
38
  },
40
39
  "description.zh-CN": "审批系统是一个强大的BPM工具,为业务流程自动化提供基础支持,同时具备高度灵活性和可扩展性,确保审批流程的效率和合规性,助力企业释放创新潜力。",
41
40
  "displayName.zh-CN": "审批",
@@ -1,14 +0,0 @@
1
-
2
- 
3
- > @tachybase/plugin-workflow-approval@0.23.7 build /Users/seal/Documents/projects/tachybase/packages/plugin-workflow-approval
4
- > tachybase-build --no-dts @tachybase/plugin-workflow-approval
5
-
6
- The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
7
- @tachybase/plugin-workflow-approval: plugin-workflow-approval build start
8
- @tachybase/plugin-workflow-approval: build plugin client
9
- @tachybase/plugin-workflow-approval: build plugin server source
10
- @tachybase/plugin-workflow-approval: delete server files
11
- @tachybase/plugin-workflow-approval: build plugin server dependencies
12
- @tachybase/plugin-workflow-approval: These packages @tachybase/module-workflow, @tachybase/server, lodash, @tachybase/actions, @tachybase/database, @tachybase/data-source, @tachybase/module-ui-schema, @tachybase/utils, sequelize will be exclude.
13
- @tachybase/plugin-workflow-approval: write external version
14
-