@loopstack/core 0.1.2 → 0.2.0

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 (62) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/modules/common/services/document-helper.service.d.ts +60 -74
  3. package/dist/modules/common/services/value-parser.service.js.map +1 -1
  4. package/dist/modules/configuration/configuration.module.js.map +1 -1
  5. package/dist/modules/configuration/services/configuration.service.d.ts +0 -1
  6. package/dist/modules/configuration/services/configuration.service.js +8 -19
  7. package/dist/modules/configuration/services/configuration.service.js.map +1 -1
  8. package/dist/modules/configuration/services/dynamic-schema-generator.service.js +3 -1
  9. package/dist/modules/configuration/services/dynamic-schema-generator.service.js.map +1 -1
  10. package/dist/modules/configuration/services/service-registry.service.js +1 -1
  11. package/dist/modules/configuration/services/service-registry.service.js.map +1 -1
  12. package/dist/modules/persistence/services/document.service.d.ts +1 -1
  13. package/dist/modules/persistence/services/document.service.js +2 -2
  14. package/dist/modules/persistence/services/document.service.js.map +1 -1
  15. package/dist/modules/persistence/services/namespace.service.js.map +1 -1
  16. package/dist/modules/persistence/services/workflow.service.js.map +1 -1
  17. package/dist/modules/workflow-processor/services/index.d.ts +2 -0
  18. package/dist/modules/workflow-processor/services/index.js +2 -0
  19. package/dist/modules/workflow-processor/services/index.js.map +1 -1
  20. package/dist/modules/workflow-processor/services/pipeline-processor.service.d.ts +14 -8
  21. package/dist/modules/workflow-processor/services/pipeline-processor.service.js +122 -28
  22. package/dist/modules/workflow-processor/services/pipeline-processor.service.js.map +1 -1
  23. package/dist/modules/workflow-processor/services/root-processor.service.d.ts +12 -0
  24. package/dist/modules/workflow-processor/services/root-processor.service.js +48 -0
  25. package/dist/modules/workflow-processor/services/root-processor.service.js.map +1 -0
  26. package/dist/modules/workflow-processor/services/state-machine-processor.service.d.ts +3 -3
  27. package/dist/modules/workflow-processor/services/state-machine-processor.service.js +11 -12
  28. package/dist/modules/workflow-processor/services/state-machine-processor.service.js.map +1 -1
  29. package/dist/modules/workflow-processor/services/template-expression-evaluator.service.d.ts +1 -1
  30. package/dist/modules/workflow-processor/services/template-expression-evaluator.service.js +3 -3
  31. package/dist/modules/workflow-processor/services/template-expression-evaluator.service.js.map +1 -1
  32. package/dist/modules/workflow-processor/services/tool-execution.service.d.ts +2 -2
  33. package/dist/modules/workflow-processor/services/tool-execution.service.js +5 -5
  34. package/dist/modules/workflow-processor/services/tool-execution.service.js.map +1 -1
  35. package/dist/modules/workflow-processor/services/workflow-processor.service.d.ts +5 -26
  36. package/dist/modules/workflow-processor/services/workflow-processor.service.js +9 -179
  37. package/dist/modules/workflow-processor/services/workflow-processor.service.js.map +1 -1
  38. package/dist/modules/workflow-processor/services/workflow-state.service.d.ts +8 -0
  39. package/dist/modules/workflow-processor/services/workflow-state.service.js +49 -0
  40. package/dist/modules/workflow-processor/services/workflow-state.service.js.map +1 -0
  41. package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.d.ts +1 -1
  42. package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.js +3 -3
  43. package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.js.map +1 -1
  44. package/dist/modules/workflow-processor/tool-services/create-document.service.d.ts +61 -75
  45. package/dist/modules/workflow-processor/tool-services/create-document.service.js +10 -6
  46. package/dist/modules/workflow-processor/tool-services/create-document.service.js.map +1 -1
  47. package/dist/modules/workflow-processor/tool-services/load-document.service.d.ts +3 -3
  48. package/dist/modules/workflow-processor/tool-services/load-document.service.js +3 -3
  49. package/dist/modules/workflow-processor/tool-services/load-document.service.js.map +1 -1
  50. package/dist/modules/workflow-processor/tool-services/mock.service.js +1 -1
  51. package/dist/modules/workflow-processor/tool-services/mock.service.js.map +1 -1
  52. package/dist/modules/workflow-processor/tool-services/set-context.service.js.map +1 -1
  53. package/dist/modules/workflow-processor/tool-services/set-target-place.service.d.ts +1 -1
  54. package/dist/modules/workflow-processor/tool-services/set-target-place.service.js +5 -4
  55. package/dist/modules/workflow-processor/tool-services/set-target-place.service.js.map +1 -1
  56. package/dist/modules/workflow-processor/tool-services/update-document.service.d.ts +26 -33
  57. package/dist/modules/workflow-processor/workflow-processor.module.js +7 -1
  58. package/dist/modules/workflow-processor/workflow-processor.module.js.map +1 -1
  59. package/package.json +2 -2
  60. package/dist/modules/configuration/commands/generate-schemas.command.d.ts +0 -8
  61. package/dist/modules/configuration/commands/generate-schemas.command.js +0 -34
  62. package/dist/modules/configuration/commands/generate-schemas.command.js.map +0 -1
@@ -12,135 +12,21 @@ var WorkflowProcessorService_1;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.WorkflowProcessorService = void 0;
14
14
  const common_1 = require("@nestjs/common");
15
- const common_2 = require("../../common");
16
- const common_3 = require("../../common");
17
15
  const state_machine_processor_service_1 = require("./state-machine-processor.service");
18
- const configuration_1 = require("../../configuration");
19
- const persistence_1 = require("../../persistence");
20
- const namespace_processor_service_1 = require("./namespace-processor.service");
21
- const tool_execution_service_1 = require("./tool-execution.service");
16
+ const workflow_state_service_1 = require("./workflow-state.service");
22
17
  let WorkflowProcessorService = WorkflowProcessorService_1 = class WorkflowProcessorService {
23
- contextService;
24
- loopConfigService;
25
- valueParserService;
18
+ workflowConfigService;
26
19
  stateMachineProcessorService;
27
- workflowService;
28
- namespaceProcessorService;
29
- toolExecutionService;
30
20
  logger = new common_1.Logger(WorkflowProcessorService_1.name);
31
- stop = false;
32
- constructor(contextService, loopConfigService, valueParserService, stateMachineProcessorService, workflowService, namespaceProcessorService, toolExecutionService) {
33
- this.contextService = contextService;
34
- this.loopConfigService = loopConfigService;
35
- this.valueParserService = valueParserService;
21
+ constructor(workflowConfigService, stateMachineProcessorService) {
22
+ this.workflowConfigService = workflowConfigService;
36
23
  this.stateMachineProcessorService = stateMachineProcessorService;
37
- this.workflowService = workflowService;
38
- this.namespaceProcessorService = namespaceProcessorService;
39
- this.toolExecutionService = toolExecutionService;
40
- }
41
- workflowExists(name) {
42
- return this.loopConfigService.has('workflows', name);
43
- }
44
- createIndex(ltreeIndex, increment = 1) {
45
- const parts = ltreeIndex.split('.').map(Number);
46
- parts[parts.length - 1] += increment;
47
- return parts.map((part) => part.toString().padStart(4, '0')).join('.');
48
- }
49
- async runToolType(config, context) {
50
- const sequence = config.sequence;
51
- if (!sequence) {
52
- return context;
53
- }
54
- let workflow = await this.getWorkflow(config, context);
55
- let lastContext = this.contextService.create(context);
56
- for (let i = 0; i < sequence.length; i++) {
57
- const handler = sequence[i];
58
- const meta = {
59
- transition: 'tool',
60
- history: [],
61
- payload: null,
62
- };
63
- const result = await this.toolExecutionService.applyTool(handler, workflow, context, meta);
64
- workflow = this.toolExecutionService.commitServiceCallResult(workflow, 'default', handler.tool, handler.exportAs, result);
65
- if (result?.persist) {
66
- await this.workflowService.save(workflow);
67
- }
68
- }
69
- await this.workflowService.save(workflow);
70
- return lastContext;
71
- }
72
- async runSequenceType(sequenceConfig, context) {
73
- const sequence = sequenceConfig.sequence;
74
- const index = `${context.index}.0`;
75
- let lastContext = this.contextService.create(context);
76
- for (let i = 0; i < sequence.length; i++) {
77
- const item = sequence[i];
78
- const workflowName = typeof item === 'object' ? item.name : item;
79
- this.logger.debug(`Processing Sequence Item ${workflowName}`);
80
- const evaluatedItem = this.valueParserService.evalWithContext(item, { context: lastContext });
81
- if (evaluatedItem.condition === false) {
82
- continue;
83
- }
84
- lastContext.index = this.createIndex(index, i + 1);
85
- lastContext = await this.processChild(workflowName, lastContext);
86
- if (this.stop) {
87
- break;
88
- }
89
- }
90
- return lastContext;
91
- }
92
- async prepareAllContexts(context, factory, items) {
93
- const index = `${context.index}.0`;
94
- const contexts = [];
95
- for (let i = 0; i < items.length; i++) {
96
- const item = items[i];
97
- const label = factory.iterator.label
98
- ? this.valueParserService.evalWithContextAndItem(factory.iterator.label, {
99
- context,
100
- item,
101
- index: i + 1,
102
- })
103
- : item.toString();
104
- const metadata = factory.iterator.meta
105
- ? this.valueParserService.evalWithContextAndItem(factory.iterator.meta, {
106
- context,
107
- item,
108
- index: i + 1,
109
- })
110
- : undefined;
111
- const localContext = await this.namespaceProcessorService.createNamespace(context, {
112
- label,
113
- meta: metadata,
114
- });
115
- localContext.index = this.createIndex(index, i + 1);
116
- contexts.push(localContext);
117
- }
118
- return contexts;
119
- }
120
- async runFactoryType(factory, context) {
121
- const workflowName = factory.workflow;
122
- if (!this.workflowExists(factory.workflow)) {
123
- throw new Error(`Workflow ${workflowName} for factory does not exist.`);
124
- }
125
- const items = this.valueParserService.evalWithContext(factory.iterator.source, { context });
126
- if (!Array.isArray(items)) {
127
- throw new Error(`Iterator values in ${factory.iterator.source} must be array, got ${typeof items}`);
128
- }
129
- const preparedChildContexts = await this.prepareAllContexts(context, factory, items);
130
- await this.namespaceProcessorService.cleanupNamespace(context, preparedChildContexts);
131
- for (const childContext of preparedChildContexts) {
132
- await this.processChild(workflowName, childContext);
133
- if (this.stop) {
134
- break;
135
- }
136
- }
137
- return context;
138
24
  }
139
25
  async runStateMachineType(config, context) {
140
- const currentWorkflow = await this.getWorkflow(config, context);
26
+ const currentWorkflow = await this.workflowConfigService.getWorkflowState(config, context);
141
27
  const workflow = await this.stateMachineProcessorService.processStateMachine(context, currentWorkflow, config);
142
- if (workflow.place !== 'complete') {
143
- this.stop = true;
28
+ if (workflow.place !== 'end') {
29
+ context.stop = true;
144
30
  }
145
31
  else {
146
32
  if (workflow.contextUpdate) {
@@ -152,67 +38,11 @@ let WorkflowProcessorService = WorkflowProcessorService_1 = class WorkflowProces
152
38
  }
153
39
  return context;
154
40
  }
155
- async processWorkflow(workflowConfig, context) {
156
- if (workflowConfig.namespace) {
157
- context = await this.namespaceProcessorService.createNamespace(context, workflowConfig.namespace);
158
- }
159
- switch (workflowConfig.type) {
160
- case 'tool':
161
- return this.runToolType(workflowConfig, context);
162
- case 'pipeline':
163
- return this.runSequenceType(workflowConfig, context);
164
- case 'factory':
165
- return this.runFactoryType(workflowConfig, context);
166
- case 'stateMachine':
167
- return this.runStateMachineType(workflowConfig, context);
168
- }
169
- }
170
- async getWorkflow(workflowConfig, context) {
171
- const workflow = await this.workflowService
172
- .createFindQuery(context.namespace?.id, {
173
- name: workflowConfig.name,
174
- labels: context.labels,
175
- })
176
- .getOne();
177
- if (workflow) {
178
- return workflow;
179
- }
180
- return this.workflowService.create({
181
- createdBy: context.userId,
182
- labels: context.labels,
183
- namespace: context.namespace ?? undefined,
184
- pipelineId: context.pipelineId,
185
- name: workflowConfig.name,
186
- title: workflowConfig.title ?? workflowConfig.name,
187
- ui: workflowConfig.ui ?? null,
188
- index: context.index,
189
- });
190
- }
191
- async processChild(name, context) {
192
- const workflowConfig = this.loopConfigService.get('workflows', name);
193
- if (!workflowConfig) {
194
- throw new Error(`workflow with name "${name}" not found.`);
195
- }
196
- const newContext = await this.processWorkflow(workflowConfig, context);
197
- if (newContext && newContext.namespace.id === context.namespace.id) {
198
- return newContext;
199
- }
200
- return context;
201
- }
202
- start(entrypoint, context) {
203
- this.stop = false;
204
- return this.processChild(entrypoint, context);
205
- }
206
41
  };
207
42
  exports.WorkflowProcessorService = WorkflowProcessorService;
208
43
  exports.WorkflowProcessorService = WorkflowProcessorService = WorkflowProcessorService_1 = __decorate([
209
44
  (0, common_1.Injectable)(),
210
- __metadata("design:paramtypes", [common_2.ContextService,
211
- configuration_1.ConfigurationService,
212
- common_3.ValueParserService,
213
- state_machine_processor_service_1.StateMachineProcessorService,
214
- persistence_1.WorkflowService,
215
- namespace_processor_service_1.NamespaceProcessorService,
216
- tool_execution_service_1.ToolExecutionService])
45
+ __metadata("design:paramtypes", [workflow_state_service_1.WorkflowStateService,
46
+ state_machine_processor_service_1.StateMachineProcessorService])
217
47
  ], WorkflowProcessorService);
218
48
  //# sourceMappingURL=workflow-processor.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-processor.service.js","sourceRoot":"","sources":["../../../../src/modules/workflow-processor/services/workflow-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,yCAA8C;AAC9C,yCA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C7B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,IAAY,EACZ,OAAyB;QAEzB,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAC/C,WAAW,EACX,IAAI,CACL,CAAC;QACF,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,cAAc,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEvE,IAAI,UAAU,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;YACnE,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,UAAkB,EAAE,OAAyB;QACjD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;CACF,CAAA;AArTY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAMe,uBAAc;QACX,oCAAoB;QACnB,2BAAkB;QACR,8DAA4B;QACzC,6BAAe;QACL,uDAAyB;QAC9B,6CAAoB;GAXzC,wBAAwB,CAqTpC"}
1
+ {"version":3,"file":"workflow-processor.service.js","sourceRoot":"","sources":["../../../../src/modules/workflow-processor/services/workflow-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,uFAAiF;AAEjF,qEAAgE;AAGzD,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAIzB;IACA;IAJO,MAAM,GAAG,IAAI,eAAM,CAAC,0BAAwB,CAAC,IAAI,CAAC,CAAC;IAEpE,YACU,qBAA2C,EAC3C,4BAA0D;QAD1D,0BAAqB,GAArB,qBAAqB,CAAsB;QAC3C,iCAA4B,GAA5B,4BAA4B,CAA8B;IACjE,CAAC;IAEJ,KAAK,CAAC,mBAAmB,CAAC,MAAoB,EAAE,OAAyB;QAEvE,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CACvE,MAAM,EACN,OAAO,CACR,CAAC;QAEF,MAAM,QAAQ,GACZ,MAAM,IAAI,CAAC,4BAA4B,CAAC,mBAAmB,CACzD,OAAO,EACP,eAAe,EACf,MAAM,CACP,CAAC;QAEJ,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QACtB,CAAC;aAAM,CAAC;YAEN,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;gBAC3B,OAAO,CAAC,MAAM,GAAG;oBACf,GAAG,OAAO,CAAC,MAAM;oBACjB,GAAG,QAAQ,CAAC,aAAa;iBAC1B,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AApCY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAKsB,6CAAoB;QACb,8DAA4B;GALzD,wBAAwB,CAoCpC"}
@@ -0,0 +1,8 @@
1
+ import { WorkflowService } from '../../persistence';
2
+ import { ContextInterface, WorkflowEntity, WorkflowType } from '@loopstack/shared';
3
+ export declare class WorkflowStateService {
4
+ private workflowService;
5
+ private readonly logger;
6
+ constructor(workflowService: WorkflowService);
7
+ getWorkflowState(workflowConfig: WorkflowType, context: ContextInterface): Promise<WorkflowEntity>;
8
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var WorkflowStateService_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.WorkflowStateService = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const persistence_1 = require("../../persistence");
16
+ let WorkflowStateService = WorkflowStateService_1 = class WorkflowStateService {
17
+ workflowService;
18
+ logger = new common_1.Logger(WorkflowStateService_1.name);
19
+ constructor(workflowService) {
20
+ this.workflowService = workflowService;
21
+ }
22
+ async getWorkflowState(workflowConfig, context) {
23
+ const workflow = await this.workflowService
24
+ .createFindQuery(context.namespace?.id, {
25
+ name: workflowConfig.name,
26
+ labels: context.labels,
27
+ })
28
+ .getOne();
29
+ if (workflow) {
30
+ return workflow;
31
+ }
32
+ return this.workflowService.create({
33
+ createdBy: context.userId,
34
+ labels: context.labels,
35
+ namespace: context.namespace ?? undefined,
36
+ pipelineId: context.pipelineId,
37
+ name: workflowConfig.name,
38
+ title: workflowConfig.title ?? workflowConfig.name,
39
+ ui: workflowConfig.ui ?? null,
40
+ index: context.index,
41
+ });
42
+ }
43
+ };
44
+ exports.WorkflowStateService = WorkflowStateService;
45
+ exports.WorkflowStateService = WorkflowStateService = WorkflowStateService_1 = __decorate([
46
+ (0, common_1.Injectable)(),
47
+ __metadata("design:paramtypes", [persistence_1.WorkflowService])
48
+ ], WorkflowStateService);
49
+ //# sourceMappingURL=workflow-state.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-state.service.js","sourceRoot":"","sources":["../../../../src/modules/workflow-processor/services/workflow-state.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,mDAAoD;AAQ7C,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAGX;IAFH,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAExD,KAAK,CAAC,gBAAgB,CACpB,cAA4B,EAC5B,OAAyB;QAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe;aACxC,eAAe,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE;YACtC,IAAI,EAAE,cAAc,CAAC,IAAI;YACzB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC;aACD,MAAM,EAAE,CAAC;QAEZ,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;YACjC,SAAS,EAAE,OAAO,CAAC,MAAM;YACzB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,SAAS;YACzC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,IAAI,EAAE,cAAc,CAAC,IAAI;YACzB,KAAK,EAAE,cAAc,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI;YAClD,EAAE,EAAE,cAAc,CAAC,EAAE,IAAI,IAAI;YAC7B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA/BY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAI0B,6BAAe;GAHzC,oBAAoB,CA+BhC"}
@@ -28,6 +28,6 @@ export declare class BatchCreateDocumentsService implements ServiceInterface {
28
28
  private templateExpressionEvaluatorService;
29
29
  private readonly logger;
30
30
  constructor(actionHelperService: SchemaValidatorService, loopConfigService: ConfigurationService, documentService: DocumentService, templateExpressionEvaluatorService: TemplateExpressionEvaluatorService);
31
- apply(props: z.infer<typeof schema>, workflow: WorkflowEntity | undefined, context: ContextInterface, meta: TransitionMetadataInterface): Promise<ServiceCallResult>;
31
+ apply(props: z.infer<typeof schema>, workflow: WorkflowEntity | undefined, context: ContextInterface, transitionData: TransitionMetadataInterface): Promise<ServiceCallResult>;
32
32
  }
33
33
  export {};
@@ -47,7 +47,7 @@ let BatchCreateDocumentsService = BatchCreateDocumentsService_1 = class BatchCre
47
47
  this.documentService = documentService;
48
48
  this.templateExpressionEvaluatorService = templateExpressionEvaluatorService;
49
49
  }
50
- async apply(props, workflow, context, meta) {
50
+ async apply(props, workflow, context, transitionData) {
51
51
  if (!workflow) {
52
52
  throw new Error('Workflow is undefined');
53
53
  }
@@ -55,7 +55,7 @@ let BatchCreateDocumentsService = BatchCreateDocumentsService_1 = class BatchCre
55
55
  if (!template) {
56
56
  throw new Error(`Document template ${props.document} not found.`);
57
57
  }
58
- const evaluatedTemplate = this.templateExpressionEvaluatorService.evaluate(template, {}, context, workflow, meta);
58
+ const evaluatedTemplate = this.templateExpressionEvaluatorService.evaluate(template, {}, context, workflow, transitionData);
59
59
  const documents = [];
60
60
  for (let index = 0; index < props.items.length; index++) {
61
61
  const documentData = (0, lodash_1.merge)({}, evaluatedTemplate, props.items[index]);
@@ -67,7 +67,7 @@ let BatchCreateDocumentsService = BatchCreateDocumentsService_1 = class BatchCre
67
67
  }
68
68
  this.actionHelperService.validateDocument(documentData);
69
69
  this.logger.debug(`Create document "${documentData.name}".`);
70
- documents.push(this.documentService.create(workflow, context, meta, documentData));
70
+ documents.push(this.documentService.create(workflow, context, transitionData, documentData));
71
71
  }
72
72
  return {
73
73
  success: true,
@@ -1 +1 @@
1
- {"version":3,"file":"batch-create-documents.service.js","sourceRoot":"","sources":["../../../../src/modules/workflow-processor/tool-services/batch-create-documents.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAQ2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M,CACzB,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,YAAuC,CACxC,CACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,QAAQ;YACR,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,SAAS;SAChB,CAAC;IACJ,CAAC;CACF,CAAA;AAnEY,kEAA2B;sCAA3B,2BAA2B;IALvC,IAAA,mBAAU,GAAE;IACZ,IAAA,gBAAO,EAAC;QACP,MAAM;QACN,MAAM;KACP,CAAC;qCAK+B,+BAAsB;QACxB,oCAAoB;QACtB,6BAAe;QACI,6CAAkC;GAPrE,2BAA2B,CAmEvC"}
1
+ {"version":3,"file":"batch-create-documents.service.js","sourceRoot":"","sources":["../../../../src/modules/workflow-processor/tool-services/batch-create-documents.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAS2B;AAC3B,yCAAsD;AACtD,uDAA2D;AAE3D,6BAAwB;AAExB,mDAAoD;AACpD,mCAA+B;AAC/B,0CAAiE;AAEjE,MAAM,MAAM,GAAG,OAAC;KACb,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,yBAAgB,EAAE,4BAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjE,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,yBAAgB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9D,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,yBAAgB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;CACrD,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,MAAM,GAAG,OAAC;KACb,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,4BAAmB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YACxD,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,EAAE,EAAE,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,CAAC;YAED,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;gBACpB,YAAY,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACvC,CAAC;YAED,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CACvC,YAAuC,CACxC,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC;YAE7D,SAAS,CAAC,IAAI,CACZ,IAAI,CAAC,eAAe,CAAC,MAAM,CACzB,QAAQ,EACR,OAAO,EACP,cAAc,EACd,YAAuC,CACxC,CACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,QAAQ;YACR,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,SAAS;SAChB,CAAC;IACJ,CAAC;CACF,CAAA;AAvEY,kEAA2B;sCAA3B,2BAA2B;IALvC,IAAA,mBAAU,GAAE;IACZ,IAAA,gBAAO,EAAC;QACP,MAAM;QACN,MAAM;KACP,CAAC;qCAK+B,+BAAsB;QACxB,oCAAoB;QACtB,6BAAe;QACI,6CAAkC;GAPrE,2BAA2B,CAuEvC"}
@@ -18,59 +18,54 @@ declare const schema: z.ZodObject<{
18
18
  mimeType: z.ZodOptional<z.ZodEnum<["text/plain", "text/html", "text/css", "text/xml", "text/markdown", "application/javascript", "application/typescript", "application/json", "application/xml", "application/yaml"]>>;
19
19
  invalidate: z.ZodOptional<z.ZodBoolean>;
20
20
  level: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"debug">, z.ZodLiteral<"info">, z.ZodLiteral<"warning">, z.ZodLiteral<"error">]>>;
21
- enableTransitions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
21
  enableAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
22
  hideAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
23
  data: z.ZodOptional<z.ZodAny>;
25
24
  }, "strip", z.ZodTypeAny, {
26
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
27
25
  invalidate?: boolean | undefined;
28
- level?: "debug" | "info" | "warning" | "error" | undefined;
29
- enableTransitions?: string[] | undefined;
26
+ data?: any;
27
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
28
+ level?: "info" | "error" | "debug" | "warning" | undefined;
30
29
  enableAtPlaces?: string[] | undefined;
31
30
  hideAtPlaces?: string[] | undefined;
32
- data?: any;
33
31
  }, {
34
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
35
32
  invalidate?: boolean | undefined;
36
- level?: "debug" | "info" | "warning" | "error" | undefined;
37
- enableTransitions?: string[] | undefined;
33
+ data?: any;
34
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
35
+ level?: "info" | "error" | "debug" | "warning" | undefined;
38
36
  enableAtPlaces?: string[] | undefined;
39
37
  hideAtPlaces?: string[] | undefined;
40
- data?: any;
41
38
  }>>>;
42
39
  }, "strip", z.ZodTypeAny, {
43
40
  name?: string | undefined;
44
- description?: string | undefined;
45
- content?: any;
46
41
  schema?: any;
42
+ content?: any;
47
43
  ui?: any;
48
44
  tags?: string[] | undefined;
49
45
  meta?: {
50
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
51
46
  invalidate?: boolean | undefined;
52
- level?: "debug" | "info" | "warning" | "error" | undefined;
53
- enableTransitions?: string[] | undefined;
47
+ data?: any;
48
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
49
+ level?: "info" | "error" | "debug" | "warning" | undefined;
54
50
  enableAtPlaces?: string[] | undefined;
55
51
  hideAtPlaces?: string[] | undefined;
56
- data?: any;
57
52
  } | undefined;
53
+ description?: string | undefined;
58
54
  }, {
59
55
  name?: string | undefined;
60
- description?: string | undefined;
61
- content?: any;
62
56
  schema?: any;
57
+ content?: any;
63
58
  ui?: any;
64
59
  tags?: string[] | undefined;
65
60
  meta?: {
66
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
67
61
  invalidate?: boolean | undefined;
68
- level?: "debug" | "info" | "warning" | "error" | undefined;
69
- enableTransitions?: string[] | undefined;
62
+ data?: any;
63
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
64
+ level?: "info" | "error" | "debug" | "warning" | undefined;
70
65
  enableAtPlaces?: string[] | undefined;
71
66
  hideAtPlaces?: string[] | undefined;
72
- data?: any;
73
67
  } | undefined;
68
+ description?: string | undefined;
74
69
  }>>;
75
70
  create: z.ZodOptional<z.ZodObject<{
76
71
  name: z.ZodString;
@@ -83,130 +78,121 @@ declare const schema: z.ZodObject<{
83
78
  mimeType: z.ZodOptional<z.ZodEnum<["text/plain", "text/html", "text/css", "text/xml", "text/markdown", "application/javascript", "application/typescript", "application/json", "application/xml", "application/yaml"]>>;
84
79
  invalidate: z.ZodOptional<z.ZodBoolean>;
85
80
  level: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"debug">, z.ZodLiteral<"info">, z.ZodLiteral<"warning">, z.ZodLiteral<"error">]>>;
86
- enableTransitions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
87
81
  enableAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
88
82
  hideAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
89
83
  data: z.ZodOptional<z.ZodAny>;
90
84
  }, "strip", z.ZodTypeAny, {
91
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
92
85
  invalidate?: boolean | undefined;
93
- level?: "debug" | "info" | "warning" | "error" | undefined;
94
- enableTransitions?: string[] | undefined;
86
+ data?: any;
87
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
88
+ level?: "info" | "error" | "debug" | "warning" | undefined;
95
89
  enableAtPlaces?: string[] | undefined;
96
90
  hideAtPlaces?: string[] | undefined;
97
- data?: any;
98
91
  }, {
99
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
100
92
  invalidate?: boolean | undefined;
101
- level?: "debug" | "info" | "warning" | "error" | undefined;
102
- enableTransitions?: string[] | undefined;
93
+ data?: any;
94
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
95
+ level?: "info" | "error" | "debug" | "warning" | undefined;
103
96
  enableAtPlaces?: string[] | undefined;
104
97
  hideAtPlaces?: string[] | undefined;
105
- data?: any;
106
98
  }>>;
107
99
  }, "strip", z.ZodTypeAny, {
108
100
  name: string;
109
- description?: string | undefined;
110
- content?: any;
111
101
  schema?: any;
102
+ content?: any;
112
103
  ui?: any;
113
104
  tags?: string[] | undefined;
114
105
  meta?: {
115
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
116
106
  invalidate?: boolean | undefined;
117
- level?: "debug" | "info" | "warning" | "error" | undefined;
118
- enableTransitions?: string[] | undefined;
107
+ data?: any;
108
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
109
+ level?: "info" | "error" | "debug" | "warning" | undefined;
119
110
  enableAtPlaces?: string[] | undefined;
120
111
  hideAtPlaces?: string[] | undefined;
121
- data?: any;
122
112
  } | undefined;
113
+ description?: string | undefined;
123
114
  }, {
124
115
  name: string;
125
- description?: string | undefined;
126
- content?: any;
127
116
  schema?: any;
117
+ content?: any;
128
118
  ui?: any;
129
119
  tags?: string[] | undefined;
130
120
  meta?: {
131
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
132
121
  invalidate?: boolean | undefined;
133
- level?: "debug" | "info" | "warning" | "error" | undefined;
134
- enableTransitions?: string[] | undefined;
122
+ data?: any;
123
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
124
+ level?: "info" | "error" | "debug" | "warning" | undefined;
135
125
  enableAtPlaces?: string[] | undefined;
136
126
  hideAtPlaces?: string[] | undefined;
137
- data?: any;
138
127
  } | undefined;
128
+ description?: string | undefined;
139
129
  }>>;
140
130
  }, "strict", z.ZodTypeAny, {
141
- create?: {
142
- name: string;
143
- description?: string | undefined;
144
- content?: any;
131
+ update?: {
132
+ name?: string | undefined;
145
133
  schema?: any;
134
+ content?: any;
146
135
  ui?: any;
147
136
  tags?: string[] | undefined;
148
137
  meta?: {
149
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
150
138
  invalidate?: boolean | undefined;
151
- level?: "debug" | "info" | "warning" | "error" | undefined;
152
- enableTransitions?: string[] | undefined;
139
+ data?: any;
140
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
141
+ level?: "info" | "error" | "debug" | "warning" | undefined;
153
142
  enableAtPlaces?: string[] | undefined;
154
143
  hideAtPlaces?: string[] | undefined;
155
- data?: any;
156
144
  } | undefined;
157
- } | undefined;
158
- update?: {
159
- name?: string | undefined;
160
145
  description?: string | undefined;
161
- content?: any;
146
+ } | undefined;
147
+ create?: {
148
+ name: string;
162
149
  schema?: any;
150
+ content?: any;
163
151
  ui?: any;
164
152
  tags?: string[] | undefined;
165
153
  meta?: {
166
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
167
154
  invalidate?: boolean | undefined;
168
- level?: "debug" | "info" | "warning" | "error" | undefined;
169
- enableTransitions?: string[] | undefined;
155
+ data?: any;
156
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
157
+ level?: "info" | "error" | "debug" | "warning" | undefined;
170
158
  enableAtPlaces?: string[] | undefined;
171
159
  hideAtPlaces?: string[] | undefined;
172
- data?: any;
173
160
  } | undefined;
161
+ description?: string | undefined;
174
162
  } | undefined;
175
163
  document?: string | undefined;
176
164
  }, {
177
- create?: {
178
- name: string;
179
- description?: string | undefined;
180
- content?: any;
165
+ update?: {
166
+ name?: string | undefined;
181
167
  schema?: any;
168
+ content?: any;
182
169
  ui?: any;
183
170
  tags?: string[] | undefined;
184
171
  meta?: {
185
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
186
172
  invalidate?: boolean | undefined;
187
- level?: "debug" | "info" | "warning" | "error" | undefined;
188
- enableTransitions?: string[] | undefined;
173
+ data?: any;
174
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
175
+ level?: "info" | "error" | "debug" | "warning" | undefined;
189
176
  enableAtPlaces?: string[] | undefined;
190
177
  hideAtPlaces?: string[] | undefined;
191
- data?: any;
192
178
  } | undefined;
193
- } | undefined;
194
- update?: {
195
- name?: string | undefined;
196
179
  description?: string | undefined;
197
- content?: any;
180
+ } | undefined;
181
+ create?: {
182
+ name: string;
198
183
  schema?: any;
184
+ content?: any;
199
185
  ui?: any;
200
186
  tags?: string[] | undefined;
201
187
  meta?: {
202
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
203
188
  invalidate?: boolean | undefined;
204
- level?: "debug" | "info" | "warning" | "error" | undefined;
205
- enableTransitions?: string[] | undefined;
189
+ data?: any;
190
+ mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
191
+ level?: "info" | "error" | "debug" | "warning" | undefined;
206
192
  enableAtPlaces?: string[] | undefined;
207
193
  hideAtPlaces?: string[] | undefined;
208
- data?: any;
209
194
  } | undefined;
195
+ description?: string | undefined;
210
196
  } | undefined;
211
197
  document?: string | undefined;
212
198
  }>;
@@ -217,7 +203,7 @@ export declare class CreateDocumentService implements ServiceInterface {
217
203
  private templateExpressionEvaluatorService;
218
204
  private readonly logger;
219
205
  constructor(actionHelperService: SchemaValidatorService, loopConfigService: ConfigurationService, documentService: DocumentService, templateExpressionEvaluatorService: TemplateExpressionEvaluatorService);
220
- getDocumentTemplate(props: z.infer<typeof schema>, workflow: WorkflowEntity, context: ContextInterface, meta: TransitionMetadataInterface): {};
206
+ getDocumentTemplate(props: z.infer<typeof schema>, workflow: WorkflowEntity, context: ContextInterface, transitionData: TransitionMetadataInterface): {};
221
207
  apply(props: z.infer<typeof schema>, workflow: WorkflowEntity | undefined, context: ContextInterface, meta: TransitionMetadataInterface): Promise<ServiceCallResult>;
222
208
  }
223
209
  export {};