@tachybase/module-workflow 1.3.21 → 1.3.23

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 (137) hide show
  1. package/dist/client/Plugin.d.ts +3 -3
  2. package/dist/client/features/dynamic-calculation/expression.d.ts +1 -0
  3. package/dist/client/features/interceptor/WorkflowTriggerInterceptor.d.ts +1 -1
  4. package/dist/client/features/js-parse/JSParse.instruction.d.ts +3 -3
  5. package/dist/client/features/json-parse/JSONParse.instruction.d.ts +3 -3
  6. package/dist/client/features/manual/instruction/SchemaConfig.d.ts +1 -1
  7. package/dist/client/features/manual/instruction/createManualFormBlockUISchema.d.ts +11 -11
  8. package/dist/client/features/notice/configuration/Notice.instruction.d.ts +2 -2
  9. package/dist/client/features/request/RequestInstruction.d.ts +2 -2
  10. package/dist/client/features/script/Script.instruction.d.ts +3 -3
  11. package/dist/client/index.js +52 -53
  12. package/dist/client/nodes/calculation.d.ts +2 -1
  13. package/dist/client/nodes/condition.d.ts +2 -2
  14. package/dist/client/nodes/create.d.ts +1 -1
  15. package/dist/client/nodes/query.d.ts +1 -1
  16. package/dist/client/triggers/collection.d.ts +1 -1
  17. package/dist/externalVersion.js +10 -16
  18. package/dist/node_modules/@babel/core/node_modules/.bin/json5 +2 -2
  19. package/dist/node_modules/@babel/core/node_modules/.bin/parser +2 -2
  20. package/dist/node_modules/@babel/core/node_modules/.bin/semver +2 -2
  21. package/dist/node_modules/@babel/core/package.json +1 -1
  22. package/dist/node_modules/@babel/preset-env/node_modules/.bin/semver +2 -2
  23. package/dist/node_modules/@babel/preset-env/package.json +1 -1
  24. package/dist/node_modules/@babel/preset-react/package.json +1 -1
  25. package/dist/node_modules/@babel/preset-typescript/package.json +1 -1
  26. package/dist/node_modules/cron-parser/package.json +1 -1
  27. package/dist/node_modules/form-data/package.json +1 -1
  28. package/dist/node_modules/jsonata/package.json +1 -1
  29. package/dist/node_modules/lru-cache/package.json +1 -1
  30. package/dist/node_modules/mime-types/index.js +3 -3
  31. package/dist/node_modules/mime-types/mimeScore.js +52 -0
  32. package/dist/node_modules/mime-types/package.json +1 -1
  33. package/dist/node_modules/qrcode/package.json +1 -1
  34. package/dist/server/Plugin.d.ts +1 -4
  35. package/dist/server/Plugin.js +8 -10
  36. package/dist/server/Processor.d.ts +1 -2
  37. package/dist/server/Processor.js +5 -7
  38. package/dist/server/actions/executions.d.ts +1 -1
  39. package/dist/server/actions/executions.js +4 -5
  40. package/dist/server/actions/nodes.d.ts +1 -1
  41. package/dist/server/actions/nodes.js +33 -25
  42. package/dist/server/actions/workflows.d.ts +1 -1
  43. package/dist/server/actions/workflows.js +11 -12
  44. package/dist/server/collections/1-users_jobs.d.ts +1 -1
  45. package/dist/server/collections/1-users_jobs.js +2 -2
  46. package/dist/server/collections/2-jobs.d.ts +1 -1
  47. package/dist/server/collections/2-jobs.js +2 -2
  48. package/dist/server/collections/3-users.d.ts +1 -1
  49. package/dist/server/collections/3-users.js +2 -2
  50. package/dist/server/collections/executions.d.ts +1 -1
  51. package/dist/server/collections/flow_nodes.d.ts +1 -1
  52. package/dist/server/collections/jobs.d.ts +1 -1
  53. package/dist/server/collections/workflowCategories.d.ts +1 -1
  54. package/dist/server/collections/workflows.d.ts +1 -1
  55. package/dist/server/features/_deprecated-js-parse/plugin.d.ts +1 -1
  56. package/dist/server/features/_deprecated-js-parse/plugin.js +1 -1
  57. package/dist/server/features/_deprecated-json-parse/plugin.d.ts +1 -1
  58. package/dist/server/features/_deprecated-json-parse/plugin.js +1 -1
  59. package/dist/server/features/aggregate/AggregateInstruction.js +4 -5
  60. package/dist/server/features/aggregate/Plugin.d.ts +1 -1
  61. package/dist/server/features/aggregate/Plugin.js +1 -1
  62. package/dist/server/features/delay/Plugin.d.ts +1 -1
  63. package/dist/server/features/delay/Plugin.js +1 -1
  64. package/dist/server/features/dynamic-calculation/DynamicCalculation.js +4 -15
  65. package/dist/server/features/dynamic-calculation/Plugin.d.ts +1 -1
  66. package/dist/server/features/dynamic-calculation/Plugin.js +1 -1
  67. package/dist/server/features/dynamic-calculation/expression-field.d.ts +1 -1
  68. package/dist/server/features/dynamic-calculation/expression-field.js +3 -3
  69. package/dist/server/features/interception/RequestInterceptionTrigger.d.ts +1 -1
  70. package/dist/server/features/interception/RequestInterceptionTrigger.js +2 -2
  71. package/dist/server/features/interception/index.d.ts +1 -1
  72. package/dist/server/features/interception/index.js +1 -1
  73. package/dist/server/features/loop/Plugin.d.ts +1 -1
  74. package/dist/server/features/loop/Plugin.js +1 -1
  75. package/dist/server/features/manual/ManualInstruction.d.ts +1 -1
  76. package/dist/server/features/manual/ManualInstruction.js +2 -2
  77. package/dist/server/features/manual/Plugin.d.ts +1 -1
  78. package/dist/server/features/manual/Plugin.js +4 -5
  79. package/dist/server/features/manual/actions.d.ts +1 -1
  80. package/dist/server/features/manual/actions.js +2 -2
  81. package/dist/server/features/notice/NoticeInstruction.js +2 -2
  82. package/dist/server/features/notice/actions.js +4 -14
  83. package/dist/server/features/notice/collections/workflowNotice.d.ts +1 -1
  84. package/dist/server/features/notice/collections/workflowNotice.js +2 -2
  85. package/dist/server/features/notice/plugin.d.ts +1 -1
  86. package/dist/server/features/notice/plugin.js +4 -4
  87. package/dist/server/features/omni-trigger/CustomActionTrigger.d.ts +1 -1
  88. package/dist/server/features/omni-trigger/CustomActionTrigger.js +6 -7
  89. package/dist/server/features/omni-trigger/Plugin.d.ts +1 -1
  90. package/dist/server/features/omni-trigger/Plugin.js +1 -1
  91. package/dist/server/features/parallel/Plugin.d.ts +1 -1
  92. package/dist/server/features/parallel/Plugin.js +1 -1
  93. package/dist/server/features/request/Plugin.d.ts +1 -1
  94. package/dist/server/features/request/Plugin.js +1 -1
  95. package/dist/server/features/request/RequestInstruction.js +10 -11
  96. package/dist/server/features/response/Plugin.d.ts +1 -1
  97. package/dist/server/features/response/Plugin.js +1 -1
  98. package/dist/server/features/script/plugin.d.ts +1 -1
  99. package/dist/server/features/script/plugin.js +1 -1
  100. package/dist/server/features/script/script.instruction.js +2 -2
  101. package/dist/server/features/sql/Plugin.d.ts +1 -1
  102. package/dist/server/features/sql/Plugin.js +1 -1
  103. package/dist/server/features/trigger-instruction/flownode-check.d.ts +1 -1
  104. package/dist/server/features/trigger-instruction/plugin.d.ts +1 -1
  105. package/dist/server/features/trigger-instruction/plugin.js +1 -1
  106. package/dist/server/features/variables/Plugin.d.ts +1 -1
  107. package/dist/server/features/variables/Plugin.js +1 -1
  108. package/dist/server/instructions/CalculationInstruction.js +3 -3
  109. package/dist/server/instructions/ConditionInstruction.d.ts +1 -1
  110. package/dist/server/instructions/ConditionInstruction.js +3 -4
  111. package/dist/server/instructions/CreateInstruction.js +7 -9
  112. package/dist/server/instructions/DestroyInstruction.js +2 -2
  113. package/dist/server/instructions/QueryInstruction.js +3 -4
  114. package/dist/server/instructions/UpdateInstruction.js +5 -7
  115. package/dist/server/instructions/UpdateOrCreateInstruction.js +7 -9
  116. package/dist/server/instructions/index.d.ts +1 -1
  117. package/dist/server/migrations/20241118104303-add-initAt.d.ts +1 -1
  118. package/dist/server/migrations/20241118104303-add-initAt.js +1 -1
  119. package/dist/server/migrations/20241206122842-add-createdBy.d.ts +1 -1
  120. package/dist/server/migrations/20241206122842-add-createdBy.js +1 -1
  121. package/dist/server/migrations/20241220001154-bigInt.d.ts +1 -1
  122. package/dist/server/migrations/20241220001154-bigInt.js +1 -1
  123. package/dist/server/triggers/CollectionTrigger.d.ts +1 -1
  124. package/dist/server/triggers/CollectionTrigger.js +4 -4
  125. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +2 -2
  126. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +12 -13
  127. package/dist/server/triggers/index.d.ts +1 -1
  128. package/dist/server/types/Execution.d.ts +1 -1
  129. package/dist/server/types/Execution.js +2 -2
  130. package/dist/server/types/FlowNode.d.ts +1 -1
  131. package/dist/server/types/FlowNode.js +2 -2
  132. package/dist/server/types/Job.d.ts +1 -1
  133. package/dist/server/types/Job.js +2 -2
  134. package/dist/server/types/Workflow.d.ts +1 -1
  135. package/dist/server/types/Workflow.js +2 -2
  136. package/dist/server/utils.js +2 -2
  137. package/package.json +17 -27
@@ -0,0 +1,52 @@
1
+ // 'mime-score' back-ported to CommonJS
2
+
3
+ // Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3)
4
+ var FACET_SCORES = {
5
+ 'prs.': 100,
6
+ 'x-': 200,
7
+ 'x.': 300,
8
+ 'vnd.': 400,
9
+ default: 900
10
+ }
11
+
12
+ // Score mime source (Logic originally from `jshttp/mime-types` module)
13
+ var SOURCE_SCORES = {
14
+ nginx: 10,
15
+ apache: 20,
16
+ iana: 40,
17
+ default: 30 // definitions added by `jshttp/mime-db` project?
18
+ }
19
+
20
+ var TYPE_SCORES = {
21
+ // prefer application/xml over text/xml
22
+ // prefer application/rtf over text/rtf
23
+ application: 1,
24
+
25
+ // prefer font/woff over application/font-woff
26
+ font: 2,
27
+
28
+ default: 0
29
+ }
30
+
31
+ /**
32
+ * Get each component of the score for a mime type. The sum of these is the
33
+ * total score. The higher the score, the more "official" the type.
34
+ */
35
+ module.exports = function mimeScore (mimeType, source = 'default') {
36
+ if (mimeType === 'application/octet-stream') {
37
+ return 0
38
+ }
39
+
40
+ const [type, subtype] = mimeType.split('/')
41
+
42
+ const facet = subtype.replace(/(\.|x-).*/, '$1')
43
+
44
+ const facetScore = FACET_SCORES[facet] || FACET_SCORES.default
45
+ const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default
46
+ const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default
47
+
48
+ // All else being equal prefer shorter types
49
+ const lengthScore = 1 - mimeType.length / 100
50
+
51
+ return facetScore + sourceScore + typeScore + lengthScore
52
+ }
@@ -1 +1 @@
1
- {"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"2.1.35","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"1.52.0"},"devDependencies":{"eslint":"7.32.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.25.4","eslint-plugin-markdown":"2.2.1","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"5.2.0","eslint-plugin-standard":"4.1.0","mocha":"9.2.2","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2025-07-25T05:53:51.091Z"}
1
+ {"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"3.0.1","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"^1.54.0"},"devDependencies":{"eslint":"8.33.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.27.5","eslint-plugin-markdown":"3.0.0","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"6.1.1","eslint-plugin-standard":"4.1.0","mocha":"10.2.0","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js","mimeScore.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2025-08-02T21:30:25.095Z"}
@@ -1 +1 @@
1
- {"name":"qrcode","description":"QRCode / 2d Barcode api with both server side and client side support using canvas","version":"1.5.4","author":"Ryan Day <soldair@gmail.com>","contributors":["Vincenzo Greco <greco.vincenzo@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>"],"keywords":["qr","code","canvas","qrcode"],"main":"./lib/index.js","browser":{"./lib/index.js":"./lib/browser.js","fs":false},"files":["bin","build","lib","helper"],"homepage":"http://github.com/soldair/node-qrcode","license":"MIT","scripts":{"lint":"standard","pretest":"npm run lint","test":"node --throw-deprecation test.js","build":"rollup -c","prepublish":"npm run build","browser":"node examples/clientsideserver.js"},"bin":{"qrcode":"./bin/qrcode"},"dependencies":{"dijkstrajs":"^1.0.1","pngjs":"^5.0.0","yargs":"^15.3.1"},"devDependencies":{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.1.0","@rollup/plugin-node-resolve":"^7.1.3","browserify":"^16.5.1","canvas":"^2.8.0","canvasutil":"0.0.4","colors":"^1.4.0","express":"^4.17.1","htmlparser2":"^4.1.0","rollup":"^2.6.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"^5.3.0","sinon":"^9.0.2","standard":"^16.0.4","tap":"^16.2.0"},"repository":{"type":"git","url":"git://github.com/soldair/node-qrcode.git"},"engines":{"node":">=10.13.0"},"standard":{"ignore":["build/","examples/vendors/","lib/core/regex.js"]},"_lastModified":"2025-07-25T05:53:51.502Z"}
1
+ {"name":"qrcode","description":"QRCode / 2d Barcode api with both server side and client side support using canvas","version":"1.5.4","author":"Ryan Day <soldair@gmail.com>","contributors":["Vincenzo Greco <greco.vincenzo@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>"],"keywords":["qr","code","canvas","qrcode"],"main":"./lib/index.js","browser":{"./lib/index.js":"./lib/browser.js","fs":false},"files":["bin","build","lib","helper"],"homepage":"http://github.com/soldair/node-qrcode","license":"MIT","scripts":{"lint":"standard","pretest":"npm run lint","test":"node --throw-deprecation test.js","build":"rollup -c","prepublish":"npm run build","browser":"node examples/clientsideserver.js"},"bin":{"qrcode":"./bin/qrcode"},"dependencies":{"dijkstrajs":"^1.0.1","pngjs":"^5.0.0","yargs":"^15.3.1"},"devDependencies":{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.1.0","@rollup/plugin-node-resolve":"^7.1.3","browserify":"^16.5.1","canvas":"^2.8.0","canvasutil":"0.0.4","colors":"^1.4.0","express":"^4.17.1","htmlparser2":"^4.1.0","rollup":"^2.6.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"^5.3.0","sinon":"^9.0.2","standard":"^16.0.4","tap":"^16.2.0"},"repository":{"type":"git","url":"git://github.com/soldair/node-qrcode.git"},"engines":{"node":">=10.13.0"},"standard":{"ignore":["build/","examples/vendors/","lib/core/regex.js"]},"_lastModified":"2025-08-02T21:30:25.544Z"}
@@ -1,7 +1,4 @@
1
- import { Transactionable } from '@tachybase/database';
2
- import { Logger } from '@tachybase/logger';
3
- import Application, { Plugin, PluginOptions } from '@tachybase/server';
4
- import { Registry } from '@tachybase/utils';
1
+ import { Application, Logger, Plugin, PluginOptions, Registry, Transactionable } from '@tego/server';
5
2
  import { CustomFunction } from './functions';
6
3
  import { InstructionInterface } from './instructions';
7
4
  import Processor from './Processor';
@@ -30,10 +30,8 @@ __export(Plugin_exports, {
30
30
  default: () => PluginWorkflowServer
31
31
  });
32
32
  module.exports = __toCommonJS(Plugin_exports);
33
- var import_path = __toESM(require("path"));
34
- var import_database = require("@tachybase/database");
35
- var import_server = require("@tachybase/server");
36
- var import_utils = require("@tachybase/utils");
33
+ var import_node_path = __toESM(require("node:path"));
34
+ var import_server = require("@tego/server");
37
35
  var import_lru_cache = require("lru-cache");
38
36
  var import_actions = __toESM(require("./actions"));
39
37
  var import_constants = require("./constants");
@@ -69,9 +67,9 @@ var import_ScheduleTrigger = __toESM(require("./triggers/ScheduleTrigger"));
69
67
  class PluginWorkflowServer extends import_server.Plugin {
70
68
  constructor(app, options) {
71
69
  super(app, options);
72
- this.instructions = new import_utils.Registry();
73
- this.triggers = new import_utils.Registry();
74
- this.functions = new import_utils.Registry();
70
+ this.instructions = new import_server.Registry();
71
+ this.triggers = new import_server.Registry();
72
+ this.functions = new import_server.Registry();
75
73
  this.enabledCache = /* @__PURE__ */ new Map();
76
74
  this.ready = false;
77
75
  this.executing = null;
@@ -102,7 +100,7 @@ class PluginWorkflowServer extends import_server.Plugin {
102
100
  key: instance.key,
103
101
  current: true,
104
102
  id: {
105
- [import_database.Op.ne]: instance.id
103
+ [import_server.Op.ne]: instance.id
106
104
  }
107
105
  },
108
106
  transaction: options.transaction
@@ -170,7 +168,7 @@ class PluginWorkflowServer extends import_server.Plugin {
170
168
  return this.loggerCache.get(key);
171
169
  }
172
170
  const logger = this.createLogger({
173
- dirname: import_path.default.join("workflows", date),
171
+ dirname: import_node_path.default.join("workflows", date),
174
172
  filename: `${workflowId}.log`,
175
173
  transports: process.env.APP_ENV !== "production" ? ["console"] : ["file"]
176
174
  });
@@ -441,7 +439,7 @@ class PluginWorkflowServer extends import_server.Plugin {
441
439
  status: import_constants.EXECUTION_STATUS.QUEUEING,
442
440
  "workflow.enabled": true,
443
441
  "workflow.id": {
444
- [import_database.Op.not]: null
442
+ [import_server.Op.not]: null
445
443
  }
446
444
  },
447
445
  appends: ["workflow"],
@@ -1,5 +1,4 @@
1
- import { Transaction, Transactionable } from '@tachybase/database';
2
- import { Logger } from '@tachybase/logger';
1
+ import { Logger, Transaction, Transactionable } from '@tego/server';
3
2
  import type Plugin from './Plugin';
4
3
  import type { ExecutionModel, FlowNodeModel, JobModel } from './types';
5
4
  export interface ProcessorOptions extends Transactionable {
@@ -20,9 +20,7 @@ __export(Processor_exports, {
20
20
  default: () => Processor
21
21
  });
22
22
  module.exports = __toCommonJS(Processor_exports);
23
- var import_database = require("@tachybase/database");
24
- var import_evaluators = require("@tachybase/evaluators");
25
- var import_utils = require("@tachybase/utils");
23
+ var import_server = require("@tego/server");
26
24
  var import_constants = require("./constants");
27
25
  class Processor {
28
26
  constructor(execution, options) {
@@ -120,8 +118,8 @@ class Processor {
120
118
  job = prevJob;
121
119
  }
122
120
  }
123
- if (!(job instanceof import_database.Model)) {
124
- job.upstreamId = prevJob instanceof import_database.Model ? prevJob.get("id") : null;
121
+ if (!(job instanceof import_server.Model)) {
122
+ job.upstreamId = prevJob instanceof import_server.Model ? prevJob.get("id") : null;
125
123
  job.nodeId = node.id;
126
124
  job.nodeKey = node.key;
127
125
  }
@@ -285,10 +283,10 @@ class Processor {
285
283
  };
286
284
  }
287
285
  getParsedValue(value, sourceNodeId, additionalScope) {
288
- const template = (0, import_utils.parse)(value);
286
+ const template = (0, import_server.parse)(value);
289
287
  const scope = Object.assign(this.getScope(sourceNodeId), additionalScope);
290
288
  template.parameters.forEach(({ key }) => {
291
- (0, import_evaluators.appendArrayColumn)(scope, key);
289
+ (0, import_server.appendArrayColumn)(scope, key);
292
290
  });
293
291
  return template(scope);
294
292
  }
@@ -1,4 +1,4 @@
1
- import { Context, Next } from '@tachybase/actions';
1
+ import { Context, Next } from '@tego/server';
2
2
  export declare function destroy(context: Context, next: any): Promise<void>;
3
3
  export declare function cancel(context: Context, next: any): Promise<never>;
4
4
  export declare function retry(context: Context, next: Next): Promise<void>;
@@ -32,19 +32,18 @@ __export(executions_exports, {
32
32
  retry: () => retry
33
33
  });
34
34
  module.exports = __toCommonJS(executions_exports);
35
- var import_actions = __toESM(require("@tachybase/actions"));
36
- var import_database = require("@tachybase/database");
35
+ var import_server = require("@tego/server");
37
36
  var import_constants = require("../constants");
38
37
  var import_Plugin = __toESM(require("../Plugin"));
39
38
  async function destroy(context, next) {
40
39
  context.action.mergeParams({
41
40
  filter: {
42
41
  status: {
43
- [import_database.Op.ne]: import_constants.EXECUTION_STATUS.STARTED
42
+ [import_server.Op.ne]: import_constants.EXECUTION_STATUS.STARTED
44
43
  }
45
44
  }
46
45
  });
47
- await import_actions.default.destroy(context, next);
46
+ await import_server.actions.destroy(context, next);
48
47
  }
49
48
  async function cancel(context, next) {
50
49
  const { filterByTk } = context.action.params;
@@ -88,7 +87,7 @@ async function cancel(context, next) {
88
87
  }
89
88
  async function retry(context, next) {
90
89
  const plugin = context.app.getPlugin(import_Plugin.default);
91
- const repository = import_actions.utils.getRepositoryFromParams(context);
90
+ const repository = import_server.utils.getRepositoryFromParams(context);
92
91
  const { filterByTk, filter = {}, values = {} } = context.action.params;
93
92
  const WorkflowRepo = context.db.getRepository("workflows");
94
93
  if (!context.state) {
@@ -1,4 +1,4 @@
1
- import { Context } from '@tachybase/actions';
1
+ import { Context } from '@tego/server';
2
2
  export declare function create(context: Context, next: any): Promise<void>;
3
3
  export declare function destroy(context: Context, next: any): Promise<void>;
4
4
  export declare function update(context: Context, next: any): Promise<void>;
@@ -24,11 +24,10 @@ __export(nodes_exports, {
24
24
  update: () => update
25
25
  });
26
26
  module.exports = __toCommonJS(nodes_exports);
27
- var import_actions = require("@tachybase/actions");
28
- var import_database = require("@tachybase/database");
27
+ var import_server = require("@tego/server");
29
28
  async function create(context, next) {
30
29
  const { db } = context;
31
- const repository = import_actions.utils.getRepositoryFromParams(context);
30
+ const repository = import_server.utils.getRepositoryFromParams(context);
32
31
  const { whitelist, blacklist, updateAssociationValues, values, associatedIndex: workflowId } = context.action.params;
33
32
  context.body = await db.sequelize.transaction(async (transaction) => {
34
33
  const workflow = await repository.getSourceModel(transaction);
@@ -79,7 +78,7 @@ async function create(context, next) {
79
78
  const [downstream] = await upstream.getBranches({
80
79
  where: {
81
80
  id: {
82
- [import_database.Op.ne]: instance.id
81
+ [import_server.Op.ne]: instance.id
83
82
  },
84
83
  branchIndex: instance.branchIndex
85
84
  },
@@ -118,7 +117,7 @@ function searchBranchDownstreams(nodes, from) {
118
117
  }
119
118
  async function destroy(context, next) {
120
119
  const { db } = context;
121
- const repository = import_actions.utils.getRepositoryFromParams(context);
120
+ const repository = import_server.utils.getRepositoryFromParams(context);
122
121
  const { filterByTk } = context.action.params;
123
122
  const fields = ["id", "upstreamId", "downstreamId", "branchIndex"];
124
123
  const instance = await repository.findOne({
@@ -178,7 +177,7 @@ async function destroy(context, next) {
178
177
  }
179
178
  async function update(context, next) {
180
179
  const { db } = context;
181
- const repository = import_actions.utils.getRepositoryFromParams(context);
180
+ const repository = import_server.utils.getRepositoryFromParams(context);
182
181
  const { filterByTk, values, whitelist, blacklist, filter, updateAssociationValues } = context.action.params;
183
182
  context.body = await db.sequelize.transaction(async (transaction) => {
184
183
  const { workflow } = await repository.findOne({
@@ -204,7 +203,7 @@ async function update(context, next) {
204
203
  }
205
204
  async function moveUp(context, next) {
206
205
  const { db } = context;
207
- const repository = import_actions.utils.getRepositoryFromParams(context);
206
+ const repository = import_server.utils.getRepositoryFromParams(context);
208
207
  const { filterByTk } = context.action.params;
209
208
  const fields = ["id", "upstreamId", "downstreamId", "branchIndex", "key"];
210
209
  const instance = await repository.findOne({
@@ -263,7 +262,7 @@ async function moveUp(context, next) {
263
262
  }
264
263
  async function moveDown(context, next) {
265
264
  const { db } = context;
266
- const repository = import_actions.utils.getRepositoryFromParams(context);
265
+ const repository = import_server.utils.getRepositoryFromParams(context);
267
266
  const { filterByTk } = context.action.params;
268
267
  const fields = ["id", "upstreamId", "downstreamId", "branchIndex", "key"];
269
268
  const instance = await repository.findOne({
@@ -281,24 +280,33 @@ async function moveDown(context, next) {
281
280
  context.throw(400, "Last node could not be moved up");
282
281
  }
283
282
  if (upstream) {
284
- await upstream.update({
285
- downstreamId: instance.downstreamId
286
- }, {
287
- transaction
288
- });
283
+ await upstream.update(
284
+ {
285
+ downstreamId: instance.downstreamId
286
+ },
287
+ {
288
+ transaction
289
+ }
290
+ );
289
291
  }
290
- await downstream.update({
291
- upstreamId: instance.upstreamId,
292
- downstreamId: instance.id
293
- }, {
294
- transaction
295
- });
296
- await instance.update({
297
- downstreamId: downDownstreamId,
298
- upstreamId: downstream.id
299
- }, {
300
- transaction
301
- });
292
+ await downstream.update(
293
+ {
294
+ upstreamId: instance.upstreamId,
295
+ downstreamId: instance.id
296
+ },
297
+ {
298
+ transaction
299
+ }
300
+ );
301
+ await instance.update(
302
+ {
303
+ downstreamId: downDownstreamId,
304
+ upstreamId: downstream.id
305
+ },
306
+ {
307
+ transaction
308
+ }
309
+ );
302
310
  if (downDownstreamId) {
303
311
  await repository.update({
304
312
  filterByTk: downDownstreamId,
@@ -1,4 +1,4 @@
1
- import { Context, Next } from '@tachybase/actions';
1
+ import { Context, Next } from '@tego/server';
2
2
  export declare function update(context: Context, next: any): Promise<void>;
3
3
  export declare function destroy(context: Context, next: any): Promise<void>;
4
4
  export declare function dump(context: Context, next: Next): Promise<void>;
@@ -39,11 +39,10 @@ __export(workflows_exports, {
39
39
  update: () => update
40
40
  });
41
41
  module.exports = __toCommonJS(workflows_exports);
42
- var import_actions = __toESM(require("@tachybase/actions"));
43
- var import_database = require("@tachybase/database");
42
+ var import_server = require("@tego/server");
44
43
  var import_Plugin = __toESM(require("../Plugin"));
45
44
  async function update(context, next) {
46
- const repository = import_actions.utils.getRepositoryFromParams(context);
45
+ const repository = import_server.utils.getRepositoryFromParams(context);
47
46
  const { filterByTk, values } = context.action.params;
48
47
  context.action.mergeParams({
49
48
  whitelist: [
@@ -67,10 +66,10 @@ async function update(context, next) {
67
66
  return context.throw(400, "config of executed workflow can not be updated");
68
67
  }
69
68
  }
70
- return import_actions.default.update(context, next);
69
+ return import_server.actions.update(context, next);
71
70
  }
72
71
  async function destroy(context, next) {
73
- const repository = import_actions.utils.getRepositoryFromParams(context);
72
+ const repository = import_server.utils.getRepositoryFromParams(context);
74
73
  const { filterByTk, filter } = context.action.params;
75
74
  await context.db.sequelize.transaction(async (transaction) => {
76
75
  const items = await repository.find({
@@ -84,7 +83,7 @@ async function destroy(context, next) {
84
83
  const revisions = await repository.find({
85
84
  filter: {
86
85
  key: Array.from(keysSet),
87
- current: { [import_database.Op.not]: true }
86
+ current: { [import_server.Op.not]: true }
88
87
  },
89
88
  fields: ["id"],
90
89
  transaction
@@ -99,7 +98,7 @@ async function destroy(context, next) {
99
98
  next();
100
99
  }
101
100
  async function dump(context, next) {
102
- const repository = import_actions.utils.getRepositoryFromParams(context);
101
+ const repository = import_server.utils.getRepositoryFromParams(context);
103
102
  const { filterByTk, filter = {}, values = {} } = context.action.params;
104
103
  context.body = await context.db.sequelize.transaction(async (transaction) => {
105
104
  const origin = await repository.findOne({
@@ -127,7 +126,7 @@ async function dump(context, next) {
127
126
  }
128
127
  async function load(context, next) {
129
128
  const plugin = context.app.getPlugin(import_Plugin.default);
130
- const repository = import_actions.utils.getRepositoryFromParams(context);
129
+ const repository = import_server.utils.getRepositoryFromParams(context);
131
130
  const { values = {} } = context.action.params;
132
131
  context.body = await context.db.sequelize.transaction(async (transaction) => {
133
132
  const origin = values.workflow;
@@ -184,7 +183,7 @@ async function load(context, next) {
184
183
  }
185
184
  async function test(context, next) {
186
185
  const plugin = context.app.getPlugin(import_Plugin.default);
187
- const repository = import_actions.utils.getRepositoryFromParams(context);
186
+ const repository = import_server.utils.getRepositoryFromParams(context);
188
187
  const { filterByTk, filter = {}, values = {} } = context.action.params;
189
188
  if (!context.state) {
190
189
  context.state = {};
@@ -212,7 +211,7 @@ async function test(context, next) {
212
211
  }
213
212
  async function revision(context, next) {
214
213
  const plugin = context.app.getPlugin(import_Plugin.default);
215
- const repository = import_actions.utils.getRepositoryFromParams(context);
214
+ const repository = import_server.utils.getRepositoryFromParams(context);
216
215
  const { filterByTk, filter = {}, values = {} } = context.action.params;
217
216
  context.body = await context.db.sequelize.transaction(async (transaction) => {
218
217
  const origin = await repository.findOne({
@@ -281,7 +280,7 @@ async function revision(context, next) {
281
280
  }
282
281
  async function retry(context, next) {
283
282
  const plugin = context.app.getPlugin(import_Plugin.default);
284
- const repository = import_actions.utils.getRepositoryFromParams(context);
283
+ const repository = import_server.utils.getRepositoryFromParams(context);
285
284
  const { filterByTk, filter = {}, values = {} } = context.action.params;
286
285
  const ExecutionRepo = context.db.getRepository("executions");
287
286
  if (!context.state) {
@@ -312,7 +311,7 @@ async function retry(context, next) {
312
311
  }
313
312
  async function sync(context, next) {
314
313
  const plugin = context.app.getPlugin(import_Plugin.default);
315
- const repository = import_actions.utils.getRepositoryFromParams(context);
314
+ const repository = import_server.utils.getRepositoryFromParams(context);
316
315
  const { filterByTk, filter = {} } = context.action.params;
317
316
  const workflows = await repository.find({
318
317
  filterByTk,
@@ -1,2 +1,2 @@
1
- declare const _default: import("@tachybase/database").CollectionOptions;
1
+ declare const _default: import("@tego/server").CollectionOptions;
2
2
  export default _default;
@@ -20,8 +20,8 @@ __export(users_jobs_exports, {
20
20
  default: () => users_jobs_default
21
21
  });
22
22
  module.exports = __toCommonJS(users_jobs_exports);
23
- var import_database = require("@tachybase/database");
24
- var users_jobs_default = (0, import_database.defineCollection)({
23
+ var import_server = require("@tego/server");
24
+ var users_jobs_default = (0, import_server.defineCollection)({
25
25
  name: "users_jobs",
26
26
  dumpRules: {
27
27
  group: "log"
@@ -1,2 +1,2 @@
1
- declare const _default: import("@tachybase/database").CollectionDef;
1
+ declare const _default: import("@tego/server").CollectionDef;
2
2
  export default _default;
@@ -20,8 +20,8 @@ __export(jobs_exports, {
20
20
  default: () => jobs_default
21
21
  });
22
22
  module.exports = __toCommonJS(jobs_exports);
23
- var import_database = require("@tachybase/database");
24
- var jobs_default = (0, import_database.extendCollection)({
23
+ var import_server = require("@tego/server");
24
+ var jobs_default = (0, import_server.extendCollection)({
25
25
  name: "jobs",
26
26
  fields: [
27
27
  {
@@ -1,2 +1,2 @@
1
- declare const _default: import("@tachybase/database").CollectionDef;
1
+ declare const _default: import("@tego/server").CollectionDef;
2
2
  export default _default;
@@ -20,8 +20,8 @@ __export(users_exports, {
20
20
  default: () => users_default
21
21
  });
22
22
  module.exports = __toCommonJS(users_exports);
23
- var import_database = require("@tachybase/database");
24
- var users_default = (0, import_database.extendCollection)({
23
+ var import_server = require("@tego/server");
24
+ var users_default = (0, import_server.extendCollection)({
25
25
  name: "users",
26
26
  fields: [
27
27
  {
@@ -1,3 +1,3 @@
1
- import { CollectionOptions } from '@tachybase/database';
1
+ import { CollectionOptions } from '@tego/server';
2
2
  declare const _default: CollectionOptions;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import { CollectionOptions } from '@tachybase/database';
1
+ import { CollectionOptions } from '@tego/server';
2
2
  declare const _default: CollectionOptions;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import { CollectionOptions } from '@tachybase/database';
1
+ import { CollectionOptions } from '@tego/server';
2
2
  declare const _default: CollectionOptions;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import { CollectionOptions } from '@tachybase/database';
1
+ import { CollectionOptions } from '@tego/server';
2
2
  declare const _default: CollectionOptions;
3
3
  export default _default;
@@ -1,2 +1,2 @@
1
- import { CollectionOptions } from '@tachybase/database';
1
+ import { CollectionOptions } from '@tego/server';
2
2
  export default function (): CollectionOptions;
@@ -1,4 +1,4 @@
1
- import { Plugin } from '@tachybase/server';
1
+ import { Plugin } from '@tego/server';
2
2
  export declare class PluginWorkflowJSParseServer extends Plugin {
3
3
  load(): Promise<void>;
4
4
  }
@@ -31,7 +31,7 @@ __export(plugin_exports, {
31
31
  default: () => plugin_default
32
32
  });
33
33
  module.exports = __toCommonJS(plugin_exports);
34
- var import_server = require("@tachybase/server");
34
+ var import_server = require("@tego/server");
35
35
  var import__ = __toESM(require("../.."));
36
36
  var import_constants = require("../../../common/constants");
37
37
  var import_JSParse = require("./JSParse.instruction");
@@ -1,4 +1,4 @@
1
- import { Plugin } from '@tachybase/server';
1
+ import { Plugin } from '@tego/server';
2
2
  export declare class PluginWorkflowJSONParseServer extends Plugin {
3
3
  load(): Promise<void>;
4
4
  }
@@ -31,7 +31,7 @@ __export(plugin_exports, {
31
31
  default: () => plugin_default
32
32
  });
33
33
  module.exports = __toCommonJS(plugin_exports);
34
- var import_server = require("@tachybase/server");
34
+ var import_server = require("@tego/server");
35
35
  var import__ = __toESM(require("../.."));
36
36
  var import_constants = require("../../../common/constants");
37
37
  var import_JSONParse = require("./JSONParse.instruction");
@@ -20,8 +20,7 @@ __export(AggregateInstruction_exports, {
20
20
  default: () => AggregateInstruction_default
21
21
  });
22
22
  module.exports = __toCommonJS(AggregateInstruction_exports);
23
- var import_data_source = require("@tachybase/data-source");
24
- var import_database = require("@tachybase/database");
23
+ var import_server = require("@tego/server");
25
24
  var import__ = require("../..");
26
25
  const aggregators = {
27
26
  count: "count",
@@ -34,14 +33,14 @@ class AggregateInstruction_default extends import__.Instruction {
34
33
  async run(node, input, processor) {
35
34
  const { aggregator, associated, collection, association = {}, params = {} } = node.config;
36
35
  const options = processor.getParsedValue(params, node.id);
37
- const [dataSourceName, collectionName] = (0, import_data_source.parseCollectionName)(collection);
36
+ const [dataSourceName, collectionName] = (0, import_server.parseCollectionName)(collection);
38
37
  const { collectionManager } = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName);
39
38
  const repo = associated ? collectionManager.getRepository(
40
39
  `${association == null ? void 0 : association.associatedCollection}.${association.name}`,
41
40
  processor.getParsedValue(association == null ? void 0 : association.associatedKey, node.id)
42
41
  ) : collectionManager.getRepository(collectionName);
43
42
  if (!options.dataType && aggregator === "avg") {
44
- options.dataType = import_database.DataTypes.DOUBLE;
43
+ options.dataType = import_server.DataTypes.DOUBLE;
45
44
  }
46
45
  const result = await repo.aggregate({
47
46
  ...options,
@@ -49,7 +48,7 @@ class AggregateInstruction_default extends import__.Instruction {
49
48
  // transaction: processor.transaction,
50
49
  });
51
50
  return {
52
- result: options.dataType === import_database.DataTypes.DOUBLE ? Number(result) : result,
51
+ result: options.dataType === import_server.DataTypes.DOUBLE ? Number(result) : result,
53
52
  status: import__.JOB_STATUS.RESOLVED
54
53
  };
55
54
  }
@@ -1,4 +1,4 @@
1
- import { Plugin } from '@tachybase/server';
1
+ import { Plugin } from '@tego/server';
2
2
  export declare class PluginAggregate extends Plugin {
3
3
  load(): Promise<void>;
4
4
  }
@@ -30,7 +30,7 @@ __export(Plugin_exports, {
30
30
  PluginAggregate: () => PluginAggregate
31
31
  });
32
32
  module.exports = __toCommonJS(Plugin_exports);
33
- var import_server = require("@tachybase/server");
33
+ var import_server = require("@tego/server");
34
34
  var import__ = __toESM(require("../.."));
35
35
  var import_AggregateInstruction = __toESM(require("./AggregateInstruction"));
36
36
  class PluginAggregate extends import_server.Plugin {
@@ -1,4 +1,4 @@
1
- import { Plugin } from '@tachybase/server';
1
+ import { Plugin } from '@tego/server';
2
2
  export declare class PluginDelay extends Plugin {
3
3
  load(): Promise<void>;
4
4
  }
@@ -30,7 +30,7 @@ __export(Plugin_exports, {
30
30
  PluginDelay: () => PluginDelay
31
31
  });
32
32
  module.exports = __toCommonJS(Plugin_exports);
33
- var import_server = require("@tachybase/server");
33
+ var import_server = require("@tego/server");
34
34
  var import__ = __toESM(require("../.."));
35
35
  var import_DelayInstruction = __toESM(require("./DelayInstruction"));
36
36
  class PluginDelay extends import_server.Plugin {