@nocobase/plugin-workflow-manual 2.3.0-alpha.1 → 2.3.0-beta.3

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.
@@ -29,7 +29,7 @@ __export(create_exports, {
29
29
  default: () => create_default
30
30
  });
31
31
  module.exports = __toCommonJS(create_exports);
32
- async function create_default(instance, { dataSource = "main", collection }, processor) {
32
+ async function create_default(instance, { dataSource = "main", collection }, transaction) {
33
33
  const repo = this.workflow.app.dataSourceManager.dataSources.get(dataSource).collectionManager.getRepository(collection);
34
34
  if (!repo) {
35
35
  throw new Error(`collection ${collection} for create data on manual node not found`);
@@ -43,8 +43,8 @@ async function create_default(instance, { dataSource = "main", collection }, pro
43
43
  updatedBy: instance.userId
44
44
  },
45
45
  context: {
46
- executionId: processor.execution.id
46
+ executionId: instance.executionId
47
47
  },
48
- transaction: processor.transaction
48
+ transaction
49
49
  });
50
50
  }
@@ -6,9 +6,9 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { Processor } from '@nocobase/plugin-workflow';
9
+ import type { Transaction } from '@nocobase/database';
10
10
  import ManualInstruction from '../ManualInstruction';
11
- export type FormHandler = (this: ManualInstruction, instance: any, formConfig: any, processor: Processor) => Promise<void>;
11
+ export type FormHandler = (this: ManualInstruction, instance: any, formConfig: any, transaction?: Transaction) => Promise<void>;
12
12
  export default function ({ formTypes }: {
13
13
  formTypes: any;
14
14
  }): void;
@@ -6,10 +6,10 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { Processor } from '@nocobase/plugin-workflow';
9
+ import type { Transaction } from '@nocobase/database';
10
10
  import ManualInstruction from '../ManualInstruction';
11
11
  export default function (this: ManualInstruction, instance: any, { dataSource, collection, filter }: {
12
12
  dataSource?: string;
13
13
  collection: any;
14
14
  filter?: {};
15
- }, processor: Processor): Promise<void>;
15
+ }, transaction?: Transaction): Promise<void>;
@@ -29,7 +29,7 @@ __export(update_exports, {
29
29
  default: () => update_default
30
30
  });
31
31
  module.exports = __toCommonJS(update_exports);
32
- async function update_default(instance, { dataSource = "main", collection, filter = {} }, processor) {
32
+ async function update_default(instance, { dataSource = "main", collection, filter = {} }, transaction) {
33
33
  const repo = this.workflow.app.dataSourceManager.dataSources.get(dataSource).collectionManager.getRepository(collection);
34
34
  if (!repo) {
35
35
  throw new Error(`collection ${collection} for update data on manual node not found`);
@@ -37,14 +37,14 @@ async function update_default(instance, { dataSource = "main", collection, filte
37
37
  const { _, ...form } = instance.result;
38
38
  const [values] = Object.values(form);
39
39
  await repo.update({
40
- filter: processor.getParsedValue(filter, instance.nodeId),
40
+ filter,
41
41
  values: {
42
42
  ...values ?? {},
43
43
  updatedBy: instance.userId
44
44
  },
45
45
  context: {
46
- executionId: processor.execution.id
46
+ executionId: instance.executionId
47
47
  },
48
- transaction: processor.transaction
48
+ transaction
49
49
  });
50
50
  }
@@ -0,0 +1,13 @@
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 { Migration } from '@nocobase/server';
10
+ export default class extends Migration {
11
+ on: string;
12
+ up(): Promise<void>;
13
+ }
@@ -0,0 +1,51 @@
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 rebuild_workflow_task_stats_exports = {};
38
+ __export(rebuild_workflow_task_stats_exports, {
39
+ default: () => rebuild_workflow_task_stats_default
40
+ });
41
+ module.exports = __toCommonJS(rebuild_workflow_task_stats_exports);
42
+ var import_plugin_workflow = __toESM(require("@nocobase/plugin-workflow"));
43
+ var import_server = require("@nocobase/server");
44
+ var import_constants = require("../../common/constants");
45
+ class rebuild_workflow_task_stats_default extends import_server.Migration {
46
+ on = "afterLoad";
47
+ async up() {
48
+ const workflowPlugin = this.pm.get(import_plugin_workflow.default);
49
+ await workflowPlugin.repairTaskStats({ types: [import_constants.TASK_TYPE_MANUAL], silent: true });
50
+ }
51
+ }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Could be used for workflows which some of decisions are made by users.",
7
7
  "description.ru-RU": "Может использоваться в рабочих процессах, где какие-то решения принимаются пользователями.",
8
8
  "description.zh-CN": "用于人工控制部分决策的流程。",
9
- "version": "2.3.0-alpha.1",
9
+ "version": "2.3.0-beta.3",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/workflow-manual",
@@ -37,7 +37,7 @@
37
37
  "@nocobase/test": "2.x",
38
38
  "@nocobase/utils": "2.x"
39
39
  },
40
- "gitHead": "2377df8ceb12549149017f7f14a61207bf6e49a2",
40
+ "gitHead": "f8cb6ec699b9aaffcf500fe68a55f1271b8a331c",
41
41
  "keywords": [
42
42
  "Workflow"
43
43
  ]