@nocobase/plugin-workflow 1.7.0-beta.30 → 1.7.0-beta.32

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.
@@ -0,0 +1,54 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var userWorkflowTasks_exports = {};
38
+ __export(userWorkflowTasks_exports, {
39
+ listMine: () => listMine
40
+ });
41
+ module.exports = __toCommonJS(userWorkflowTasks_exports);
42
+ var import_actions = __toESM(require("@nocobase/actions"));
43
+ async function listMine(context, next) {
44
+ context.action.mergeParams({
45
+ filter: {
46
+ userId: context.state.currentUser.id
47
+ }
48
+ });
49
+ return import_actions.default.list(context, next);
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ listMine
54
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { CollectionOptions } from '@nocobase/database';
10
+ declare const _default: CollectionOptions;
11
+ export default _default;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var userWorkflowTasks_exports = {};
38
+ __export(userWorkflowTasks_exports, {
39
+ default: () => userWorkflowTasks_default
40
+ });
41
+ module.exports = __toCommonJS(userWorkflowTasks_exports);
42
+ var import_userWorkflowTasks = __toESM(require("../../common/collections/userWorkflowTasks"));
43
+ var userWorkflowTasks_default = import_userWorkflowTasks.default;
@@ -65,6 +65,7 @@ class WorkflowRepository extends import_database.Repository {
65
65
  values: {
66
66
  title: `${origin.title} copy`,
67
67
  description: origin.description,
68
+ options: origin.options,
68
69
  ...revisionData,
69
70
  sync: origin.sync,
70
71
  type: origin.type,
@@ -67,7 +67,8 @@ function getFieldRawName(collection, name) {
67
67
  class CollectionTrigger extends import__.default {
68
68
  events = /* @__PURE__ */ new Map();
69
69
  // async function, should return promise
70
- static async handler(workflow, data, options) {
70
+ static async handler(workflowId, data, options) {
71
+ const workflow = this.workflow.enabledCache.get(workflowId);
71
72
  const { skipWorkflow = false, stack } = options.context ?? {};
72
73
  if (skipWorkflow) {
73
74
  return;
@@ -161,7 +162,7 @@ class CollectionTrigger extends import__.default {
161
162
  const name = getHookId(workflow, `${collection}.${type}`);
162
163
  if (mode & key) {
163
164
  if (!this.events.has(name)) {
164
- const listener = this.constructor.handler.bind(this, workflow);
165
+ const listener = this.constructor.handler.bind(this, workflow.id);
165
166
  this.events.set(name, listener);
166
167
  db.on(event, listener);
167
168
  }
package/package.json CHANGED
@@ -4,13 +4,13 @@
4
4
  "displayName.zh-CN": "工作流",
5
5
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
6
6
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
7
- "version": "1.7.0-beta.30",
7
+ "version": "1.7.0-beta.32",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/workflow",
11
11
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow",
12
12
  "dependencies": {
13
- "@nocobase/plugin-workflow-test": "1.7.0-beta.30"
13
+ "@nocobase/plugin-workflow-test": "1.7.0-beta.32"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@ant-design/icons": "5.x",
@@ -46,7 +46,7 @@
46
46
  "@nocobase/test": "1.x",
47
47
  "@nocobase/utils": "1.x"
48
48
  },
49
- "gitHead": "d83e6ab1ebfb90a97e021127ee632f38869e5ea1",
49
+ "gitHead": "d78ca2740143209c6a16002e0c36e3256ed5fd88",
50
50
  "keywords": [
51
51
  "Workflow"
52
52
  ]
@@ -1,31 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { Instruction } from '.';
10
- import { WorkflowVariableInput } from '../variable';
11
- export default class extends Instruction {
12
- title: string;
13
- type: string;
14
- group: string;
15
- description: string;
16
- fieldset: {
17
- result: {
18
- type: string;
19
- title: string;
20
- 'x-decorator': string;
21
- 'x-component': string;
22
- 'x-component-props': {
23
- useTypedConstant: boolean;
24
- };
25
- required: boolean;
26
- };
27
- };
28
- components: {
29
- WorkflowVariableInput: typeof WorkflowVariableInput;
30
- };
31
- }