@nocobase/plugin-workflow 1.7.0-beta.2 → 1.7.0-beta.21

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.
Files changed (76) hide show
  1. package/dist/client/3d24e559cfbba5d8.js +10 -0
  2. package/dist/client/90a4f6d29bd453a7.js +10 -0
  3. package/dist/client/WorkflowTasks.d.ts +11 -11
  4. package/dist/client/a2fc280565d1c746.js +10 -0
  5. package/dist/client/f4370978c40502d7.js +10 -0
  6. package/dist/client/index.d.ts +1 -0
  7. package/dist/client/index.js +1 -1
  8. package/dist/client/locale/index.d.ts +2 -1
  9. package/dist/client/schemas/executions.d.ts +126 -125
  10. package/dist/client/triggers/schedule/RepeatField.d.ts +2 -1
  11. package/dist/common/collections/executions.d.ts +136 -0
  12. package/dist/common/collections/executions.js +125 -0
  13. package/dist/common/collections/flow_nodes.d.ts +44 -0
  14. package/dist/common/collections/flow_nodes.js +88 -0
  15. package/dist/common/collections/jobs.d.ts +37 -0
  16. package/dist/common/collections/jobs.js +74 -0
  17. package/dist/common/collections/workflowStats.d.ts +37 -0
  18. package/dist/common/collections/workflowStats.js +59 -0
  19. package/dist/common/collections/workflowTasks.d.ts +10 -0
  20. package/dist/common/collections/workflowTasks.js +64 -0
  21. package/dist/common/collections/workflowVersionStats.d.ts +37 -0
  22. package/dist/common/collections/workflowVersionStats.js +59 -0
  23. package/dist/common/collections/workflows.d.ts +250 -0
  24. package/dist/common/collections/workflows.js +225 -0
  25. package/dist/common/constants.d.ts +9 -0
  26. package/dist/common/constants.js +36 -0
  27. package/dist/externalVersion.js +13 -13
  28. package/dist/locale/it-IT.json +123 -18
  29. package/dist/locale/zh-CN.json +4 -0
  30. package/dist/node_modules/cron-parser/package.json +1 -1
  31. package/dist/node_modules/lru-cache/package.json +1 -1
  32. package/dist/node_modules/nodejs-snowflake/LICENSE +201 -0
  33. package/dist/node_modules/nodejs-snowflake/nodejs_snowflake.d.ts +62 -0
  34. package/dist/node_modules/nodejs-snowflake/nodejs_snowflake.js +1 -0
  35. package/dist/node_modules/nodejs-snowflake/nodejs_snowflake_bg.wasm +0 -0
  36. package/dist/node_modules/nodejs-snowflake/package.json +1 -0
  37. package/dist/server/Dispatcher.d.ts +11 -0
  38. package/dist/server/Dispatcher.js +35 -0
  39. package/dist/server/Plugin.d.ts +8 -1
  40. package/dist/server/Plugin.js +118 -70
  41. package/dist/server/Processor.d.ts +4 -11
  42. package/dist/server/Processor.js +48 -45
  43. package/dist/server/actions/nodes.js +7 -5
  44. package/dist/server/actions/workflowTasks.js +4 -2
  45. package/dist/server/actions/workflows.js +5 -2
  46. package/dist/server/collections/executions.js +12 -44
  47. package/dist/server/collections/flow_nodes.js +12 -57
  48. package/dist/server/collections/jobs.js +12 -36
  49. package/dist/server/collections/workflowStats.d.ts +11 -0
  50. package/dist/server/collections/workflowStats.js +43 -0
  51. package/dist/server/collections/workflowTasks.d.ts +2 -1
  52. package/dist/server/collections/workflowTasks.js +12 -33
  53. package/dist/server/collections/workflowVersionStats.d.ts +11 -0
  54. package/dist/server/collections/workflowVersionStats.js +43 -0
  55. package/dist/server/collections/workflows.d.ts +2 -1
  56. package/dist/server/collections/workflows.js +12 -101
  57. package/dist/server/migrations/20250320223415-stats.d.ts +14 -0
  58. package/dist/server/migrations/20250320223415-stats.js +82 -0
  59. package/dist/server/migrations/20250409164913-remove-jobs-auto-increment.d.ts +14 -0
  60. package/dist/server/migrations/20250409164913-remove-jobs-auto-increment.js +57 -0
  61. package/dist/server/repositories/WorkflowRepository.js +1 -2
  62. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +5 -3
  63. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +39 -36
  64. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +4 -2
  65. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +26 -24
  66. package/dist/server/triggers/ScheduleTrigger/index.d.ts +2 -1
  67. package/dist/server/triggers/ScheduleTrigger/index.js +4 -8
  68. package/dist/server/triggers/index.d.ts +1 -1
  69. package/dist/server/types/Workflow.d.ts +0 -2
  70. package/dist/swagger/index.d.ts +0 -14
  71. package/dist/swagger/index.js +0 -14
  72. package/package.json +4 -3
  73. package/dist/client/4d75ef32f02d7285.js +0 -10
  74. package/dist/client/56ce448358002e64.js +0 -10
  75. package/dist/client/58bb427e05b600de.js +0 -10
  76. package/dist/client/739d458621edf81f.js +0 -10
@@ -78,14 +78,9 @@ class Processor {
78
78
  * @experimental
79
79
  */
80
80
  nodesMap = /* @__PURE__ */ new Map();
81
- /**
82
- * @experimental
83
- */
84
- jobsMap = /* @__PURE__ */ new Map();
85
- /**
86
- * @experimental
87
- */
88
81
  jobsMapByNodeKey = {};
82
+ jobResultsMapByNodeKey = {};
83
+ jobsToSave = /* @__PURE__ */ new Map();
89
84
  /**
90
85
  * @experimental
91
86
  */
@@ -107,9 +102,9 @@ class Processor {
107
102
  }
108
103
  makeJobs(jobs) {
109
104
  jobs.forEach((job) => {
110
- this.jobsMap.set(job.id, job);
111
105
  const node = this.nodesMap.get(job.nodeId);
112
- this.jobsMapByNodeKey[node.key] = job.result;
106
+ this.jobsMapByNodeKey[node.key] = job;
107
+ this.jobResultsMapByNodeKey[node.key] = job.result;
113
108
  });
114
109
  }
115
110
  async prepare() {
@@ -179,11 +174,10 @@ class Processor {
179
174
  }
180
175
  }
181
176
  if (!(job instanceof import_database.Model)) {
182
- job.upstreamId = prevJob instanceof import_database.Model ? prevJob.get("id") : null;
183
177
  job.nodeId = node.id;
184
178
  job.nodeKey = node.key;
185
179
  }
186
- const savedJob = await this.saveJob(job);
180
+ const savedJob = this.saveJob(job);
187
181
  this.logger.info(
188
182
  `execution (${this.execution.id}) run instruction [${node.type}] for node (${node.id}) finished as status: ${savedJob.status}`
189
183
  );
@@ -230,6 +224,30 @@ class Processor {
230
224
  return this.exec(instruction.resume.bind(instruction), node, job);
231
225
  }
232
226
  async exit(s) {
227
+ if (this.jobsToSave.size) {
228
+ const newJobs = [];
229
+ for (const job of this.jobsToSave.values()) {
230
+ if (job.isNewRecord) {
231
+ newJobs.push(job);
232
+ } else {
233
+ await job.save({ transaction: this.mainTransaction });
234
+ }
235
+ }
236
+ if (newJobs.length) {
237
+ const JobsModel = this.options.plugin.db.getModel("jobs");
238
+ await JobsModel.bulkCreate(
239
+ newJobs.map((job) => job.toJSON()),
240
+ {
241
+ transaction: this.mainTransaction,
242
+ returning: false
243
+ }
244
+ );
245
+ for (const job of newJobs) {
246
+ job.isNewRecord = false;
247
+ }
248
+ }
249
+ this.jobsToSave.clear();
250
+ }
233
251
  if (typeof s === "number") {
234
252
  const status = this.constructor.StatusMap[s] ?? Math.sign(s);
235
253
  await this.execution.update({ status }, { transaction: this.mainTransaction });
@@ -240,32 +258,29 @@ class Processor {
240
258
  this.logger.info(`execution (${this.execution.id}) exiting with status ${this.execution.status}`);
241
259
  return null;
242
260
  }
243
- // TODO(optimize)
244
261
  /**
245
262
  * @experimental
246
263
  */
247
- async saveJob(payload) {
264
+ saveJob(payload) {
248
265
  const { database } = this.execution.constructor;
249
- const { mainTransaction: transaction } = this;
250
266
  const { model } = database.getCollection("jobs");
251
267
  let job;
252
268
  if (payload instanceof model) {
253
- job = await payload.save({ transaction });
254
- } else if (payload.id) {
255
- job = await model.findByPk(payload.id, { transaction });
256
- await job.update(payload, { transaction });
269
+ job = payload;
270
+ job.set("updatedAt", /* @__PURE__ */ new Date());
257
271
  } else {
258
- job = await model.create(
259
- {
260
- ...payload,
261
- executionId: this.execution.id
262
- },
263
- { transaction }
264
- );
272
+ job = model.build({
273
+ ...payload,
274
+ id: this.options.plugin.snowflake.getUniqueID().toString(),
275
+ createdAt: /* @__PURE__ */ new Date(),
276
+ updatedAt: /* @__PURE__ */ new Date(),
277
+ executionId: this.execution.id
278
+ });
265
279
  }
266
- this.jobsMap.set(job.id, job);
280
+ this.jobsToSave.set(job.id, job);
267
281
  this.lastSavedJob = job;
268
- this.jobsMapByNodeKey[job.nodeKey] = job.result;
282
+ this.jobsMapByNodeKey[job.nodeKey] = job;
283
+ this.jobResultsMapByNodeKey[job.nodeKey] = job.result;
269
284
  return job;
270
285
  }
271
286
  /**
@@ -319,31 +334,19 @@ class Processor {
319
334
  * @experimental
320
335
  */
321
336
  findBranchParentJob(job, node) {
322
- for (let j = job; j; j = this.jobsMap.get(j.upstreamId)) {
323
- if (j.nodeId === node.id) {
324
- return j;
325
- }
326
- }
327
- return null;
337
+ return this.jobsMapByNodeKey[node.key];
328
338
  }
329
339
  /**
330
340
  * @experimental
331
341
  */
332
342
  findBranchLastJob(node, job) {
333
- const allJobs = Array.from(this.jobsMap.values());
343
+ const allJobs = Object.values(this.jobsMapByNodeKey);
334
344
  const branchJobs = [];
335
345
  for (let n = this.findBranchEndNode(node); n && n !== node.upstream; n = n.upstream) {
336
346
  branchJobs.push(...allJobs.filter((item) => item.nodeId === n.id));
337
347
  }
338
- branchJobs.sort((a, b) => a.createdAt.getTime() - b.createdAt.getTime());
339
- for (let i = branchJobs.length - 1; i >= 0; i -= 1) {
340
- for (let j = branchJobs[i]; j && j.id !== job.id; j = this.jobsMap.get(j.upstreamId)) {
341
- if (j.upstreamId === job.id) {
342
- return branchJobs[i];
343
- }
344
- }
345
- }
346
- return null;
348
+ branchJobs.sort((a, b) => a.updatedAt.getTime() - b.updatedAt.getTime());
349
+ return branchJobs[branchJobs.length - 1] || null;
347
350
  }
348
351
  /**
349
352
  * @experimental
@@ -362,12 +365,12 @@ class Processor {
362
365
  for (let n = includeSelfScope ? node : this.findBranchParentNode(node); n; n = this.findBranchParentNode(n)) {
363
366
  const instruction = this.options.plugin.instructions.get(n.type);
364
367
  if (typeof (instruction == null ? void 0 : instruction.getScope) === "function") {
365
- $scopes[n.id] = $scopes[n.key] = instruction.getScope(n, this.jobsMapByNodeKey[n.key], this);
368
+ $scopes[n.id] = $scopes[n.key] = instruction.getScope(n, this.jobResultsMapByNodeKey[n.key], this);
366
369
  }
367
370
  }
368
371
  return {
369
372
  $context: this.execution.context,
370
- $jobsMapByNodeKey: this.jobsMapByNodeKey,
373
+ $jobsMapByNodeKey: this.jobResultsMapByNodeKey,
371
374
  $system: systemFns,
372
375
  $scopes,
373
376
  $env: this.options.plugin.app.environment.getVariables()
@@ -51,7 +51,9 @@ async function create(context, next) {
51
51
  const { whitelist, blacklist, updateAssociationValues, values, associatedIndex: workflowId } = context.action.params;
52
52
  context.body = await db.sequelize.transaction(async (transaction) => {
53
53
  const workflow = await repository.getSourceModel(transaction);
54
- if (workflow.executed) {
54
+ workflow.versionStats = await workflow.getVersionStats({ transaction });
55
+ const { executed } = workflow.versionStats;
56
+ if (executed) {
55
57
  context.throw(400, "Node could not be created in executed workflow");
56
58
  }
57
59
  const instance = await repository.create({
@@ -143,9 +145,9 @@ async function destroy(context, next) {
143
145
  const instance = await repository.findOne({
144
146
  filterByTk,
145
147
  fields: [...fields, "workflowId"],
146
- appends: ["upstream", "downstream", "workflow"]
148
+ appends: ["upstream", "downstream", "workflow.versionStats.executed"]
147
149
  });
148
- if (instance.workflow.executed) {
150
+ if (instance.workflow.versionStats.executed) {
149
151
  context.throw(400, "Nodes in executed workflow could not be deleted");
150
152
  }
151
153
  await db.sequelize.transaction(async (transaction) => {
@@ -202,10 +204,10 @@ async function update(context, next) {
202
204
  context.body = await db.sequelize.transaction(async (transaction) => {
203
205
  const { workflow } = await repository.findOne({
204
206
  filterByTk,
205
- appends: ["workflow.executed"],
207
+ appends: ["workflow.versionStats.executed"],
206
208
  transaction
207
209
  });
208
- if (workflow.executed) {
210
+ if (workflow.versionStats.executed) {
209
211
  context.throw(400, "Nodes in executed workflow could not be reconfigured");
210
212
  }
211
213
  return repository.update({
@@ -29,15 +29,17 @@ __export(workflowTasks_exports, {
29
29
  countMine: () => countMine
30
30
  });
31
31
  module.exports = __toCommonJS(workflowTasks_exports);
32
+ var import_sequelize = require("sequelize");
32
33
  var import_actions = require("@nocobase/actions");
33
34
  async function countMine(context, next) {
34
35
  const repository = import_actions.utils.getRepositoryFromParams(context);
35
36
  context.body = await repository.countAll({
36
37
  where: {
37
- userId: context.state.currentUser.id
38
+ userId: context.state.currentUser.id,
39
+ workflowId: { [import_sequelize.Op.ne]: null }
38
40
  }
39
41
  }) || [];
40
- next();
42
+ await next();
41
43
  }
42
44
  // Annotate the CommonJS export names for ESM import in node:
43
45
  0 && (module.exports = {
@@ -53,8 +53,11 @@ async function update(context, next) {
53
53
  whitelist: ["title", "description", "enabled", "triggerTitle", "config", "options"]
54
54
  });
55
55
  if (Object.keys(values).includes("config")) {
56
- const workflow = await repository.findById(filterByTk);
57
- if (workflow.get("executed")) {
56
+ const workflow = await repository.findOne({
57
+ filterByTk,
58
+ appends: ["versionStats"]
59
+ });
60
+ if (workflow.versionStats.executed) {
58
61
  return context.throw(400, "config of executed workflow can not be updated");
59
62
  }
60
63
  }
@@ -7,9 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
+ var __create = Object.create;
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
13
15
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
16
  var __export = (target, all) => {
15
17
  for (var name in all)
@@ -23,53 +25,19 @@ var __copyProps = (to, from, except, desc) => {
23
25
  }
24
26
  return to;
25
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
+ ));
26
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
37
  var executions_exports = {};
28
38
  __export(executions_exports, {
29
39
  default: () => executions_default
30
40
  });
31
41
  module.exports = __toCommonJS(executions_exports);
32
- var executions_default = {
33
- dumpRules: {
34
- group: "log"
35
- },
36
- migrationRules: ["schema-only"],
37
- name: "executions",
38
- shared: true,
39
- fields: [
40
- {
41
- type: "belongsTo",
42
- name: "workflow"
43
- },
44
- {
45
- type: "string",
46
- name: "key"
47
- },
48
- {
49
- type: "string",
50
- name: "eventKey",
51
- unique: true
52
- },
53
- {
54
- type: "hasMany",
55
- name: "jobs",
56
- onDelete: "CASCADE"
57
- },
58
- {
59
- type: "json",
60
- name: "context"
61
- },
62
- {
63
- type: "integer",
64
- name: "status"
65
- },
66
- {
67
- type: "json",
68
- name: "stack"
69
- },
70
- {
71
- type: "json",
72
- name: "output"
73
- }
74
- ]
75
- };
42
+ var import_executions = __toESM(require("../../common/collections/executions"));
43
+ var executions_default = import_executions.default;
@@ -7,9 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
+ var __create = Object.create;
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
13
15
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
16
  var __export = (target, all) => {
15
17
  for (var name in all)
@@ -23,66 +25,19 @@ var __copyProps = (to, from, except, desc) => {
23
25
  }
24
26
  return to;
25
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
+ ));
26
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
37
  var flow_nodes_exports = {};
28
38
  __export(flow_nodes_exports, {
29
39
  default: () => flow_nodes_default
30
40
  });
31
41
  module.exports = __toCommonJS(flow_nodes_exports);
32
- var flow_nodes_default = {
33
- dumpRules: "required",
34
- migrationRules: ["overwrite", "schema-only"],
35
- name: "flow_nodes",
36
- shared: true,
37
- fields: [
38
- {
39
- type: "uid",
40
- name: "key"
41
- },
42
- {
43
- type: "string",
44
- name: "title"
45
- },
46
- // which workflow belongs to
47
- {
48
- name: "workflow",
49
- type: "belongsTo"
50
- },
51
- {
52
- name: "upstream",
53
- type: "belongsTo",
54
- target: "flow_nodes"
55
- },
56
- {
57
- name: "branches",
58
- type: "hasMany",
59
- target: "flow_nodes",
60
- sourceKey: "id",
61
- foreignKey: "upstreamId"
62
- },
63
- // only works when upstream node is branching type, such as condition and parallel.
64
- // put here because the design of flow-links model is not really necessary for now.
65
- // or it should be put into flow-links model.
66
- {
67
- name: "branchIndex",
68
- type: "integer"
69
- },
70
- // Note: for reasons:
71
- // 1. redirect type node to solve cycle flow.
72
- // 2. recognize as real next node after branches.
73
- {
74
- name: "downstream",
75
- type: "belongsTo",
76
- target: "flow_nodes"
77
- },
78
- {
79
- type: "string",
80
- name: "type"
81
- },
82
- {
83
- type: "json",
84
- name: "config",
85
- defaultValue: {}
86
- }
87
- ]
88
- };
42
+ var import_flow_nodes = __toESM(require("../../common/collections/flow_nodes"));
43
+ var flow_nodes_default = import_flow_nodes.default;
@@ -7,9 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
+ var __create = Object.create;
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
13
15
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
16
  var __export = (target, all) => {
15
17
  for (var name in all)
@@ -23,45 +25,19 @@ var __copyProps = (to, from, except, desc) => {
23
25
  }
24
26
  return to;
25
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
+ ));
26
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
37
  var jobs_exports = {};
28
38
  __export(jobs_exports, {
29
39
  default: () => jobs_default
30
40
  });
31
41
  module.exports = __toCommonJS(jobs_exports);
32
- var jobs_default = {
33
- dumpRules: {
34
- group: "log"
35
- },
36
- migrationRules: ["schema-only"],
37
- name: "jobs",
38
- shared: true,
39
- fields: [
40
- {
41
- type: "belongsTo",
42
- name: "execution"
43
- },
44
- {
45
- type: "belongsTo",
46
- name: "node",
47
- target: "flow_nodes"
48
- },
49
- {
50
- type: "string",
51
- name: "nodeKey"
52
- },
53
- {
54
- type: "belongsTo",
55
- name: "upstream",
56
- target: "jobs"
57
- },
58
- {
59
- type: "integer",
60
- name: "status"
61
- },
62
- {
63
- type: "json",
64
- name: "result"
65
- }
66
- ]
67
- };
42
+ var import_jobs = __toESM(require("../../common/collections/jobs"));
43
+ var jobs_default = import_jobs.default;
@@ -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 workflowStats_exports = {};
38
+ __export(workflowStats_exports, {
39
+ default: () => workflowStats_default
40
+ });
41
+ module.exports = __toCommonJS(workflowStats_exports);
42
+ var import_workflowStats = __toESM(require("../../common/collections/workflowStats"));
43
+ var workflowStats_default = import_workflowStats.default;
@@ -7,4 +7,5 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { CollectionOptions } from '@nocobase/database';
10
- export default function (): CollectionOptions;
10
+ declare const _default: CollectionOptions;
11
+ export default _default;
@@ -7,9 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
+ var __create = Object.create;
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
13
15
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
16
  var __export = (target, all) => {
15
17
  for (var name in all)
@@ -23,42 +25,19 @@ var __copyProps = (to, from, except, desc) => {
23
25
  }
24
26
  return to;
25
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
+ ));
26
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
37
  var workflowTasks_exports = {};
28
38
  __export(workflowTasks_exports, {
29
39
  default: () => workflowTasks_default
30
40
  });
31
41
  module.exports = __toCommonJS(workflowTasks_exports);
32
- function workflowTasks_default() {
33
- return {
34
- dumpRules: "required",
35
- migrationRules: ["overwrite", "schema-only"],
36
- name: "workflowTasks",
37
- shared: true,
38
- repository: "WorkflowTasksRepository",
39
- fields: [
40
- {
41
- name: "user",
42
- type: "belongsTo"
43
- },
44
- {
45
- name: "workflow",
46
- type: "belongsTo"
47
- },
48
- {
49
- type: "string",
50
- name: "type"
51
- },
52
- {
53
- type: "string",
54
- name: "key"
55
- }
56
- ],
57
- indexes: [
58
- {
59
- unique: true,
60
- fields: ["type", "key"]
61
- }
62
- ]
63
- };
64
- }
42
+ var import_workflowTasks = __toESM(require("../../common/collections/workflowTasks"));
43
+ var workflowTasks_default = import_workflowTasks.default;
@@ -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 workflowVersionStats_exports = {};
38
+ __export(workflowVersionStats_exports, {
39
+ default: () => workflowVersionStats_default
40
+ });
41
+ module.exports = __toCommonJS(workflowVersionStats_exports);
42
+ var import_workflowVersionStats = __toESM(require("../../common/collections/workflowVersionStats"));
43
+ var workflowVersionStats_default = import_workflowVersionStats.default;
@@ -7,4 +7,5 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { CollectionOptions } from '@nocobase/database';
10
- export default function (): CollectionOptions;
10
+ declare const _default: CollectionOptions;
11
+ export default _default;