@ironcode/vas-lib 1.14.0 → 1.17.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 (86) hide show
  1. package/cjs/lib/entity/index.d.ts +11 -1
  2. package/cjs/lib/entity/index.d.ts.map +1 -1
  3. package/cjs/lib/entity/index.js +11 -1
  4. package/cjs/lib/entity/index.js.map +1 -1
  5. package/cjs/lib/entity/step-model.factory.d.ts +11 -0
  6. package/cjs/lib/entity/step-model.factory.d.ts.map +1 -0
  7. package/cjs/lib/entity/step-model.factory.js +41 -0
  8. package/cjs/lib/entity/step-model.factory.js.map +1 -0
  9. package/cjs/lib/entity/vas-account.dto.d.ts +1 -1
  10. package/cjs/lib/entity/vas-account.dto.d.ts.map +1 -1
  11. package/cjs/lib/entity/vas-account.dto.js.map +1 -1
  12. package/cjs/lib/entity/vas-invitation.d.ts +1 -1
  13. package/cjs/lib/entity/vas-invitation.d.ts.map +1 -1
  14. package/cjs/lib/entity/vas-invitation.js.map +1 -1
  15. package/cjs/lib/entity/vas-job-action-controls-step.model.d.ts +34 -0
  16. package/cjs/lib/entity/vas-job-action-controls-step.model.d.ts.map +1 -0
  17. package/cjs/lib/entity/vas-job-action-controls-step.model.js +58 -0
  18. package/cjs/lib/entity/vas-job-action-controls-step.model.js.map +1 -0
  19. package/cjs/lib/entity/vas-job-action-email-form-step.model.d.ts +42 -0
  20. package/cjs/lib/entity/vas-job-action-email-form-step.model.d.ts.map +1 -0
  21. package/cjs/lib/entity/vas-job-action-email-form-step.model.js +66 -0
  22. package/cjs/lib/entity/vas-job-action-email-form-step.model.js.map +1 -0
  23. package/cjs/lib/entity/vas-job-action-instruction-step.model.d.ts +35 -0
  24. package/cjs/lib/entity/vas-job-action-instruction-step.model.d.ts.map +1 -0
  25. package/cjs/lib/entity/vas-job-action-instruction-step.model.js +60 -0
  26. package/cjs/lib/entity/vas-job-action-instruction-step.model.js.map +1 -0
  27. package/cjs/lib/entity/vas-job-action-note-prompt-step.model.d.ts +33 -0
  28. package/cjs/lib/entity/vas-job-action-note-prompt-step.model.d.ts.map +1 -0
  29. package/cjs/lib/entity/vas-job-action-note-prompt-step.model.js +56 -0
  30. package/cjs/lib/entity/vas-job-action-note-prompt-step.model.js.map +1 -0
  31. package/cjs/lib/entity/vas-job-action-set-datetime-step.model.d.ts +35 -0
  32. package/cjs/lib/entity/vas-job-action-set-datetime-step.model.d.ts.map +1 -0
  33. package/cjs/lib/entity/vas-job-action-set-datetime-step.model.js +60 -0
  34. package/cjs/lib/entity/vas-job-action-set-datetime-step.model.js.map +1 -0
  35. package/cjs/lib/entity/vas-job-action-set-job-status-step.model.d.ts +34 -0
  36. package/cjs/lib/entity/vas-job-action-set-job-status-step.model.d.ts.map +1 -0
  37. package/cjs/lib/entity/vas-job-action-set-job-status-step.model.js +58 -0
  38. package/cjs/lib/entity/vas-job-action-set-job-status-step.model.js.map +1 -0
  39. package/cjs/lib/entity/vas-job-action-set-value-step.model.d.ts +35 -0
  40. package/cjs/lib/entity/vas-job-action-set-value-step.model.d.ts.map +1 -0
  41. package/cjs/lib/entity/vas-job-action-set-value-step.model.js +60 -0
  42. package/cjs/lib/entity/vas-job-action-set-value-step.model.js.map +1 -0
  43. package/cjs/lib/entity/vas-job-action-step.model.d.ts +21 -0
  44. package/cjs/lib/entity/vas-job-action-step.model.d.ts.map +1 -0
  45. package/cjs/lib/entity/vas-job-action-step.model.js +25 -0
  46. package/cjs/lib/entity/vas-job-action-step.model.js.map +1 -0
  47. package/cjs/lib/entity/vas-job-action-webhook-step.model.d.ts +35 -0
  48. package/cjs/lib/entity/vas-job-action-webhook-step.model.d.ts.map +1 -0
  49. package/cjs/lib/entity/vas-job-action-webhook-step.model.js +60 -0
  50. package/cjs/lib/entity/vas-job-action-webhook-step.model.js.map +1 -0
  51. package/cjs/lib/entity/vas-job-action.dto.d.ts +31 -15
  52. package/cjs/lib/entity/vas-job-action.dto.d.ts.map +1 -1
  53. package/cjs/lib/entity/vas-job-action.dto.js +14 -1
  54. package/cjs/lib/entity/vas-job-action.dto.js.map +1 -1
  55. package/cjs/lib/entity/vas-job-action.model.d.ts +37 -0
  56. package/cjs/lib/entity/vas-job-action.model.d.ts.map +1 -0
  57. package/cjs/lib/entity/vas-job-action.model.js +63 -0
  58. package/cjs/lib/entity/vas-job-action.model.js.map +1 -0
  59. package/cjs/lib/entity/vas-job-status.d.ts +28 -0
  60. package/cjs/lib/entity/vas-job-status.d.ts.map +1 -0
  61. package/cjs/lib/entity/vas-job-status.js +46 -0
  62. package/cjs/lib/entity/vas-job-status.js.map +1 -0
  63. package/fesm2022/ironcode-vas-lib.mjs +769 -36
  64. package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
  65. package/lib/entity/index.d.ts +11 -1
  66. package/lib/entity/step-model.factory.d.ts +10 -0
  67. package/lib/entity/vas-account.dto.d.ts +1 -1
  68. package/lib/entity/vas-invitation.d.ts +1 -1
  69. package/lib/entity/vas-job-action-controls-step.model.d.ts +33 -0
  70. package/lib/entity/vas-job-action-email-form-step.model.d.ts +41 -0
  71. package/lib/entity/vas-job-action-instruction-step.model.d.ts +34 -0
  72. package/lib/entity/vas-job-action-note-prompt-step.model.d.ts +32 -0
  73. package/lib/entity/vas-job-action-set-datetime-step.model.d.ts +34 -0
  74. package/lib/entity/vas-job-action-set-job-status-step.model.d.ts +33 -0
  75. package/lib/entity/vas-job-action-set-value-step.model.d.ts +34 -0
  76. package/lib/entity/vas-job-action-step.model.d.ts +20 -0
  77. package/lib/entity/vas-job-action-webhook-step.model.d.ts +34 -0
  78. package/lib/entity/vas-job-action.dto.d.ts +31 -15
  79. package/lib/entity/vas-job-action.model.d.ts +36 -0
  80. package/lib/entity/vas-job-status.d.ts +27 -0
  81. package/package.json +1 -1
  82. package/cjs/lib/entity/vas-job-status.dto.d.ts +0 -8
  83. package/cjs/lib/entity/vas-job-status.dto.d.ts.map +0 -1
  84. package/cjs/lib/entity/vas-job-status.dto.js +0 -3
  85. package/cjs/lib/entity/vas-job-status.dto.js.map +0 -1
  86. package/lib/entity/vas-job-status.dto.d.ts +0 -7
@@ -17,10 +17,516 @@ var VasControlConfigDirection;
17
17
  VasControlConfigDirection[VasControlConfigDirection["COLUMN"] = 1] = "COLUMN";
18
18
  })(VasControlConfigDirection || (VasControlConfigDirection = {}));
19
19
 
20
+ /**
21
+ *
22
+ * @param step
23
+ * @deprecated use isJobWebhookStep
24
+ */
25
+ const isJobAutomationStep = (step) => {
26
+ return step && step.type === 'automation';
27
+ };
28
+ const isJobControlsStep = (step) => {
29
+ return step && step.type === 'controls';
30
+ };
31
+ const isJobEmailFormStep = (step) => {
32
+ return step && step.type === 'email-form';
33
+ };
34
+ const isJobInstructionStep = (step) => {
35
+ return step && step.type === 'instruction';
36
+ };
37
+ const isJobNotePromptStep = (step) => {
38
+ return step && step.type === 'note-prompt';
39
+ };
40
+ const isJobSetDatetimeStep = (step) => {
41
+ return step && step.type === 'set-datetime';
42
+ };
43
+ const isJobSetJobStatusStep = (step) => {
44
+ return step && step.type === 'set-job-status';
45
+ };
46
+ const isJobSetValueStep = (step) => {
47
+ return step && step.type === 'set-value';
48
+ };
49
+ const isJobWebhookStep = (step) => {
50
+ return step && step.type === 'webhook';
51
+ };
52
+
20
53
  /**
21
54
  * BaseEntityModel
22
55
  */
23
- class VasBaseModel {
56
+ class VasBaseModel {
57
+ id;
58
+ created;
59
+ serverCreated;
60
+ createdBy;
61
+ modified;
62
+ serverModified;
63
+ modifiedBy;
64
+ createdByName;
65
+ modifiedByName;
66
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName) {
67
+ this.id = id;
68
+ this.created = created;
69
+ this.serverCreated = serverCreated;
70
+ this.createdBy = createdBy;
71
+ this.modified = modified;
72
+ this.serverModified = serverModified;
73
+ this.modifiedBy = modifiedBy;
74
+ this.createdByName = createdByName;
75
+ this.modifiedByName = modifiedByName;
76
+ }
77
+ static fromDto(dto) {
78
+ return new VasBaseModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '');
79
+ }
80
+ static create(user, values = {}) {
81
+ return this.fromDto({
82
+ id: UUID.UUID(),
83
+ created: moment().toISOString(),
84
+ modified: moment().toISOString(),
85
+ createdBy: user?.id || '',
86
+ createdByName: user?.name || '',
87
+ modifiedBy: user?.id || '',
88
+ modifiedByName: user?.name || '',
89
+ ...values,
90
+ });
91
+ }
92
+ }
93
+
94
+ /**
95
+ * VasJobActionBaseStepModel
96
+ */
97
+ class VasJobActionStepModel extends VasBaseModel {
98
+ id;
99
+ created;
100
+ serverCreated;
101
+ createdBy;
102
+ modified;
103
+ serverModified;
104
+ modifiedBy;
105
+ createdByName;
106
+ modifiedByName;
107
+ type;
108
+ stage;
109
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage) {
110
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
111
+ this.id = id;
112
+ this.created = created;
113
+ this.serverCreated = serverCreated;
114
+ this.createdBy = createdBy;
115
+ this.modified = modified;
116
+ this.serverModified = serverModified;
117
+ this.modifiedBy = modifiedBy;
118
+ this.createdByName = createdByName;
119
+ this.modifiedByName = modifiedByName;
120
+ this.type = type;
121
+ this.stage = stage;
122
+ }
123
+ }
124
+
125
+ /**
126
+ * VasJobActionControlsStepModel
127
+ */
128
+ class VasJobActionControlsStepModel extends VasJobActionStepModel {
129
+ id;
130
+ created;
131
+ serverCreated;
132
+ createdBy;
133
+ modified;
134
+ serverModified;
135
+ modifiedBy;
136
+ createdByName;
137
+ modifiedByName;
138
+ type;
139
+ stage;
140
+ controlNames;
141
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage, controlNames) {
142
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage);
143
+ this.id = id;
144
+ this.created = created;
145
+ this.serverCreated = serverCreated;
146
+ this.createdBy = createdBy;
147
+ this.modified = modified;
148
+ this.serverModified = serverModified;
149
+ this.modifiedBy = modifiedBy;
150
+ this.createdByName = createdByName;
151
+ this.modifiedByName = modifiedByName;
152
+ this.type = type;
153
+ this.stage = stage;
154
+ this.controlNames = controlNames;
155
+ }
156
+ /**
157
+ * @return {VasJobActionControlsStepModel}
158
+ */
159
+ static empty() {
160
+ return new VasJobActionControlsStepModel('', '', '', '', '', '', '', '', '', 'controls', 'initializing', []);
161
+ }
162
+ /**
163
+ * @param {VasJobActionControlsStepDto} dto
164
+ * @return {VasJobActionControlsStepModel}
165
+ */
166
+ static fromDto(dto) {
167
+ return new VasJobActionControlsStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'controls', dto.stage || 'initializing', dto.controlNames || []);
168
+ }
169
+ /**
170
+ * @return {VasJobActionControlsStepDto}
171
+ */
172
+ toDto() {
173
+ return {
174
+ id: this.id,
175
+ created: this.created,
176
+ serverCreated: this.serverCreated,
177
+ createdBy: this.createdBy,
178
+ modified: this.modified,
179
+ serverModified: this.serverModified,
180
+ modifiedBy: this.modifiedBy,
181
+ createdByName: this.createdByName,
182
+ modifiedByName: this.modifiedByName,
183
+ type: this.type,
184
+ stage: this.stage,
185
+ controlNames: this.controlNames
186
+ };
187
+ }
188
+ }
189
+
190
+ /**
191
+ * VasJobActionEmailFormStepModel
192
+ */
193
+ class VasJobActionEmailFormStepModel extends VasJobActionStepModel {
194
+ id;
195
+ created;
196
+ serverCreated;
197
+ createdBy;
198
+ modified;
199
+ serverModified;
200
+ modifiedBy;
201
+ createdByName;
202
+ modifiedByName;
203
+ type;
204
+ stage;
205
+ params;
206
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage, params) {
207
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage);
208
+ this.id = id;
209
+ this.created = created;
210
+ this.serverCreated = serverCreated;
211
+ this.createdBy = createdBy;
212
+ this.modified = modified;
213
+ this.serverModified = serverModified;
214
+ this.modifiedBy = modifiedBy;
215
+ this.createdByName = createdByName;
216
+ this.modifiedByName = modifiedByName;
217
+ this.type = type;
218
+ this.stage = stage;
219
+ this.params = params;
220
+ }
221
+ /**
222
+ * @return {VasJobActionEmailFormStepModel}
223
+ */
224
+ static empty() {
225
+ return new VasJobActionEmailFormStepModel('', '', '', '', '', '', '', '', '', 'email-form', 'initializing', {
226
+ $recipients: [],
227
+ $subject: '',
228
+ $body: []
229
+ });
230
+ }
231
+ /**
232
+ * @param {VasJobActionEmailFormStepDto} dto
233
+ * @return {VasJobActionEmailFormStepModel}
234
+ */
235
+ static fromDto(dto) {
236
+ return new VasJobActionEmailFormStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'email-form', dto.stage || 'initializing', dto.params || {
237
+ $recipients: [],
238
+ $subject: '',
239
+ $body: []
240
+ });
241
+ }
242
+ /**
243
+ * @return {VasJobActionEmailFormStepDto}
244
+ */
245
+ toDto() {
246
+ return {
247
+ id: this.id,
248
+ created: this.created,
249
+ serverCreated: this.serverCreated,
250
+ createdBy: this.createdBy,
251
+ modified: this.modified,
252
+ serverModified: this.serverModified,
253
+ modifiedBy: this.modifiedBy,
254
+ createdByName: this.createdByName,
255
+ modifiedByName: this.modifiedByName,
256
+ type: this.type,
257
+ stage: this.stage,
258
+ params: this.params
259
+ };
260
+ }
261
+ }
262
+
263
+ /**
264
+ * VasJobActionInstructionStepModel
265
+ */
266
+ class VasJobActionInstructionStepModel extends VasJobActionStepModel {
267
+ id;
268
+ created;
269
+ serverCreated;
270
+ createdBy;
271
+ modified;
272
+ serverModified;
273
+ modifiedBy;
274
+ createdByName;
275
+ modifiedByName;
276
+ type;
277
+ stage;
278
+ instructionProviderId;
279
+ linkControl;
280
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage, instructionProviderId, linkControl) {
281
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage);
282
+ this.id = id;
283
+ this.created = created;
284
+ this.serverCreated = serverCreated;
285
+ this.createdBy = createdBy;
286
+ this.modified = modified;
287
+ this.serverModified = serverModified;
288
+ this.modifiedBy = modifiedBy;
289
+ this.createdByName = createdByName;
290
+ this.modifiedByName = modifiedByName;
291
+ this.type = type;
292
+ this.stage = stage;
293
+ this.instructionProviderId = instructionProviderId;
294
+ this.linkControl = linkControl;
295
+ }
296
+ /**
297
+ * @return {VasJobActionInstructionStepModel}
298
+ */
299
+ static empty() {
300
+ return new VasJobActionInstructionStepModel('', '', '', '', '', '', '', '', '', 'instruction', 'initializing', '', '');
301
+ }
302
+ /**
303
+ * @param {VasJobActionInstructionStepDto} dto
304
+ * @return {VasJobActionInstructionStepModel}
305
+ */
306
+ static fromDto(dto) {
307
+ return new VasJobActionInstructionStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'instruction', dto.stage || 'initializing', dto.instructionProviderId || '', dto.linkControl || '');
308
+ }
309
+ /**
310
+ * @return {VasJobActionInstructionStepDto}
311
+ */
312
+ toDto() {
313
+ return {
314
+ id: this.id,
315
+ created: this.created,
316
+ serverCreated: this.serverCreated,
317
+ createdBy: this.createdBy,
318
+ modified: this.modified,
319
+ serverModified: this.serverModified,
320
+ modifiedBy: this.modifiedBy,
321
+ createdByName: this.createdByName,
322
+ modifiedByName: this.modifiedByName,
323
+ type: this.type,
324
+ stage: this.stage,
325
+ instructionProviderId: this.instructionProviderId,
326
+ linkControl: this.linkControl
327
+ };
328
+ }
329
+ }
330
+
331
+ /**
332
+ * VasJobActionNotePromptStepModel
333
+ */
334
+ class VasJobActionNotePromptStepModel extends VasJobActionStepModel {
335
+ id;
336
+ created;
337
+ serverCreated;
338
+ createdBy;
339
+ modified;
340
+ serverModified;
341
+ modifiedBy;
342
+ createdByName;
343
+ modifiedByName;
344
+ type;
345
+ stage;
346
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage) {
347
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage);
348
+ this.id = id;
349
+ this.created = created;
350
+ this.serverCreated = serverCreated;
351
+ this.createdBy = createdBy;
352
+ this.modified = modified;
353
+ this.serverModified = serverModified;
354
+ this.modifiedBy = modifiedBy;
355
+ this.createdByName = createdByName;
356
+ this.modifiedByName = modifiedByName;
357
+ this.type = type;
358
+ this.stage = stage;
359
+ }
360
+ /**
361
+ * @return {VasJobActionNotePromptStepModel}
362
+ */
363
+ static empty() {
364
+ return new VasJobActionNotePromptStepModel('', '', '', '', '', '', '', '', '', 'note-prompt', 'initializing');
365
+ }
366
+ /**
367
+ * @param {VasJobActionNotePromptStepDto} dto
368
+ * @return {VasJobActionNotePromptStepModel}
369
+ */
370
+ static fromDto(dto) {
371
+ return new VasJobActionNotePromptStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'note-prompt', dto.stage || 'initializing');
372
+ }
373
+ /**
374
+ * @return {VasJobActionNotePromptStepDto}
375
+ */
376
+ toDto() {
377
+ return {
378
+ id: this.id,
379
+ created: this.created,
380
+ serverCreated: this.serverCreated,
381
+ createdBy: this.createdBy,
382
+ modified: this.modified,
383
+ serverModified: this.serverModified,
384
+ modifiedBy: this.modifiedBy,
385
+ createdByName: this.createdByName,
386
+ modifiedByName: this.modifiedByName,
387
+ type: this.type,
388
+ stage: this.stage
389
+ };
390
+ }
391
+ }
392
+
393
+ /**
394
+ * VasJobActionSetDatetimeStepModel
395
+ */
396
+ class VasJobActionSetDatetimeStepModel extends VasJobActionStepModel {
397
+ id;
398
+ created;
399
+ serverCreated;
400
+ createdBy;
401
+ modified;
402
+ serverModified;
403
+ modifiedBy;
404
+ createdByName;
405
+ modifiedByName;
406
+ type;
407
+ stage;
408
+ value;
409
+ controlName;
410
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage, value, controlName) {
411
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage);
412
+ this.id = id;
413
+ this.created = created;
414
+ this.serverCreated = serverCreated;
415
+ this.createdBy = createdBy;
416
+ this.modified = modified;
417
+ this.serverModified = serverModified;
418
+ this.modifiedBy = modifiedBy;
419
+ this.createdByName = createdByName;
420
+ this.modifiedByName = modifiedByName;
421
+ this.type = type;
422
+ this.stage = stage;
423
+ this.value = value;
424
+ this.controlName = controlName;
425
+ }
426
+ /**
427
+ * @return {VasJobActionSetDatetimeStepModel}
428
+ */
429
+ static empty() {
430
+ return new VasJobActionSetDatetimeStepModel('', '', '', '', '', '', '', '', '', 'set-datetime', 'initializing', '', '');
431
+ }
432
+ /**
433
+ * @param {VasJobActionSetDatetimeStepDto} dto
434
+ * @return {VasJobActionSetDatetimeStepModel}
435
+ */
436
+ static fromDto(dto) {
437
+ return new VasJobActionSetDatetimeStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'set-datetime', dto.stage || 'initializing', dto.value || '', dto.controlName || '');
438
+ }
439
+ /**
440
+ * @return {VasJobActionSetDatetimeStepDto}
441
+ */
442
+ toDto() {
443
+ return {
444
+ id: this.id,
445
+ created: this.created,
446
+ serverCreated: this.serverCreated,
447
+ createdBy: this.createdBy,
448
+ modified: this.modified,
449
+ serverModified: this.serverModified,
450
+ modifiedBy: this.modifiedBy,
451
+ createdByName: this.createdByName,
452
+ modifiedByName: this.modifiedByName,
453
+ type: this.type,
454
+ stage: this.stage,
455
+ value: this.value,
456
+ controlName: this.controlName
457
+ };
458
+ }
459
+ }
460
+
461
+ /**
462
+ * VasJobActionSetJobStatusStepModel
463
+ */
464
+ class VasJobActionSetJobStatusStepModel extends VasJobActionStepModel {
465
+ id;
466
+ created;
467
+ serverCreated;
468
+ createdBy;
469
+ modified;
470
+ serverModified;
471
+ modifiedBy;
472
+ createdByName;
473
+ modifiedByName;
474
+ type;
475
+ stage;
476
+ value;
477
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage, value) {
478
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage);
479
+ this.id = id;
480
+ this.created = created;
481
+ this.serverCreated = serverCreated;
482
+ this.createdBy = createdBy;
483
+ this.modified = modified;
484
+ this.serverModified = serverModified;
485
+ this.modifiedBy = modifiedBy;
486
+ this.createdByName = createdByName;
487
+ this.modifiedByName = modifiedByName;
488
+ this.type = type;
489
+ this.stage = stage;
490
+ this.value = value;
491
+ }
492
+ /**
493
+ * @return {VasJobActionSetJobStatusStepModel}
494
+ */
495
+ static empty() {
496
+ return new VasJobActionSetJobStatusStepModel('', '', '', '', '', '', '', '', '', 'set-job-status', 'initializing', '');
497
+ }
498
+ /**
499
+ * @param {VasJobActionSetJobStatusStepDto} dto
500
+ * @return {VasJobActionSetJobStatusStepModel}
501
+ */
502
+ static fromDto(dto) {
503
+ return new VasJobActionSetJobStatusStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'set-job-status', dto.stage || 'initializing', dto.value || '');
504
+ }
505
+ /**
506
+ * @return {VasJobActionSetJobStatusStepDto}
507
+ */
508
+ toDto() {
509
+ return {
510
+ id: this.id,
511
+ created: this.created,
512
+ serverCreated: this.serverCreated,
513
+ createdBy: this.createdBy,
514
+ modified: this.modified,
515
+ serverModified: this.serverModified,
516
+ modifiedBy: this.modifiedBy,
517
+ createdByName: this.createdByName,
518
+ modifiedByName: this.modifiedByName,
519
+ type: this.type,
520
+ stage: this.stage,
521
+ value: this.value
522
+ };
523
+ }
524
+ }
525
+
526
+ /**
527
+ * VasJobActionSetValueStepModel
528
+ */
529
+ class VasJobActionSetValueStepModel extends VasJobActionStepModel {
24
530
  id;
25
531
  created;
26
532
  serverCreated;
@@ -30,7 +536,12 @@ class VasBaseModel {
30
536
  modifiedBy;
31
537
  createdByName;
32
538
  modifiedByName;
33
- constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName) {
539
+ type;
540
+ stage;
541
+ value;
542
+ controlName;
543
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage, value, controlName) {
544
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage);
34
545
  this.id = id;
35
546
  this.created = created;
36
547
  this.serverCreated = serverCreated;
@@ -40,24 +551,142 @@ class VasBaseModel {
40
551
  this.modifiedBy = modifiedBy;
41
552
  this.createdByName = createdByName;
42
553
  this.modifiedByName = modifiedByName;
554
+ this.type = type;
555
+ this.stage = stage;
556
+ this.value = value;
557
+ this.controlName = controlName;
43
558
  }
559
+ /**
560
+ * @return {VasJobActionSetValueStepModel}
561
+ */
562
+ static empty() {
563
+ return new VasJobActionSetValueStepModel('', '', '', '', '', '', '', '', '', 'set-value', 'initializing', '', '');
564
+ }
565
+ /**
566
+ * @param {VasJobActionSetValueStepDto} dto
567
+ * @return {VasJobActionSetValueStepModel}
568
+ */
44
569
  static fromDto(dto) {
45
- return new VasBaseModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '');
570
+ return new VasJobActionSetValueStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'set-value', dto.stage || 'initializing', dto.value || '', dto.controlName || '');
46
571
  }
47
- static create(user, values = {}) {
48
- return this.fromDto({
49
- id: UUID.UUID(),
50
- created: moment().toISOString(),
51
- modified: moment().toISOString(),
52
- createdBy: user?.id || '',
53
- createdByName: user?.name || '',
54
- modifiedBy: user?.id || '',
55
- modifiedByName: user?.name || '',
56
- ...values,
57
- });
572
+ /**
573
+ * @return {VasJobActionSetValueStepDto}
574
+ */
575
+ toDto() {
576
+ return {
577
+ id: this.id,
578
+ created: this.created,
579
+ serverCreated: this.serverCreated,
580
+ createdBy: this.createdBy,
581
+ modified: this.modified,
582
+ serverModified: this.serverModified,
583
+ modifiedBy: this.modifiedBy,
584
+ createdByName: this.createdByName,
585
+ modifiedByName: this.modifiedByName,
586
+ type: this.type,
587
+ stage: this.stage,
588
+ value: this.value,
589
+ controlName: this.controlName
590
+ };
591
+ }
592
+ }
593
+
594
+ /**
595
+ * VasJobActionWebhookStepModel
596
+ */
597
+ class VasJobActionWebhookStepModel extends VasBaseModel {
598
+ id;
599
+ created;
600
+ serverCreated;
601
+ createdBy;
602
+ modified;
603
+ serverModified;
604
+ modifiedBy;
605
+ createdByName;
606
+ modifiedByName;
607
+ type;
608
+ stage;
609
+ url;
610
+ params;
611
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, type, stage, url, params) {
612
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
613
+ this.id = id;
614
+ this.created = created;
615
+ this.serverCreated = serverCreated;
616
+ this.createdBy = createdBy;
617
+ this.modified = modified;
618
+ this.serverModified = serverModified;
619
+ this.modifiedBy = modifiedBy;
620
+ this.createdByName = createdByName;
621
+ this.modifiedByName = modifiedByName;
622
+ this.type = type;
623
+ this.stage = stage;
624
+ this.url = url;
625
+ this.params = params;
626
+ }
627
+ /**
628
+ * @return {VasJobActionWebhookStepModel}
629
+ */
630
+ static empty() {
631
+ return new VasJobActionWebhookStepModel('', '', '', '', '', '', '', '', '', 'webhook', 'running', '', {});
632
+ }
633
+ /**
634
+ * @param {VasJobActionWebhookStepDto} dto
635
+ * @return {VasJobActionWebhookStepModel}
636
+ */
637
+ static fromDto(dto) {
638
+ return new VasJobActionWebhookStepModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', 'webhook', dto.stage || 'running', dto.url || '', dto.params || {});
639
+ }
640
+ /**
641
+ * @return {VasJobActionWebhookStepDto}
642
+ */
643
+ toDto() {
644
+ return {
645
+ id: this.id,
646
+ created: this.created,
647
+ serverCreated: this.serverCreated,
648
+ createdBy: this.createdBy,
649
+ modified: this.modified,
650
+ serverModified: this.serverModified,
651
+ modifiedBy: this.modifiedBy,
652
+ createdByName: this.createdByName,
653
+ modifiedByName: this.modifiedByName,
654
+ type: this.type,
655
+ stage: this.stage,
656
+ url: this.url,
657
+ params: this.params
658
+ };
58
659
  }
59
660
  }
60
661
 
662
+ const stepModelFactory = (dto) => {
663
+ if (isJobControlsStep(dto)) {
664
+ return VasJobActionControlsStepModel.fromDto(dto);
665
+ }
666
+ if (isJobEmailFormStep(dto)) {
667
+ return VasJobActionEmailFormStepModel.fromDto(dto);
668
+ }
669
+ if (isJobInstructionStep(dto)) {
670
+ return VasJobActionInstructionStepModel.fromDto(dto);
671
+ }
672
+ if (isJobNotePromptStep(dto)) {
673
+ return VasJobActionNotePromptStepModel.fromDto(dto);
674
+ }
675
+ if (isJobSetDatetimeStep(dto)) {
676
+ return VasJobActionSetDatetimeStepModel.fromDto(dto);
677
+ }
678
+ if (isJobSetJobStatusStep(dto)) {
679
+ return VasJobActionSetJobStatusStepModel.fromDto(dto);
680
+ }
681
+ if (isJobSetValueStep(dto)) {
682
+ return VasJobActionSetValueStepModel.fromDto(dto);
683
+ }
684
+ if (isJobWebhookStep(dto)) {
685
+ return VasJobActionWebhookStepModel.fromDto(dto);
686
+ }
687
+ throw new Error(`Unknown step type: ${dto.type}`);
688
+ };
689
+
61
690
  class VasAccountObjectModel extends VasBaseModel {
62
691
  id;
63
692
  created;
@@ -2095,27 +2724,76 @@ class VasInvitationModel extends VasAccountObjectModel {
2095
2724
  }
2096
2725
  }
2097
2726
 
2098
- const isJobAutomationStep = (step) => {
2099
- return step && step.type === 'automation';
2100
- };
2101
- const isJobControlsStep = (step) => {
2102
- return step && step.type === 'controls';
2103
- };
2104
- const isJobEmailFormStep = (step) => {
2105
- return step && step.type === 'email-form';
2106
- };
2107
- const isJobNotePromptStep = (step) => {
2108
- return step && step.type === 'note-prompt';
2109
- };
2110
- const isJobSetDatetimeStep = (step) => {
2111
- return step && step.type === 'set-datetime';
2112
- };
2113
- const isJobSetJobStatusStep = (step) => {
2114
- return step && step.type === 'set-job-status';
2115
- };
2116
- const isJobSetValueStep = (step) => {
2117
- return step && step.type === 'set-value';
2118
- };
2727
+ /**
2728
+ * VasJobActionModel
2729
+ */
2730
+ class VasJobActionModel extends VasBaseModel {
2731
+ id;
2732
+ created;
2733
+ serverCreated;
2734
+ createdBy;
2735
+ modified;
2736
+ serverModified;
2737
+ modifiedBy;
2738
+ createdByName;
2739
+ modifiedByName;
2740
+ title;
2741
+ steps;
2742
+ succeededControl;
2743
+ jobStatuses;
2744
+ context;
2745
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, title, steps, succeededControl, jobStatuses, context = 'job-form') {
2746
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
2747
+ this.id = id;
2748
+ this.created = created;
2749
+ this.serverCreated = serverCreated;
2750
+ this.createdBy = createdBy;
2751
+ this.modified = modified;
2752
+ this.serverModified = serverModified;
2753
+ this.modifiedBy = modifiedBy;
2754
+ this.createdByName = createdByName;
2755
+ this.modifiedByName = modifiedByName;
2756
+ this.title = title;
2757
+ this.steps = steps;
2758
+ this.succeededControl = succeededControl;
2759
+ this.jobStatuses = jobStatuses;
2760
+ this.context = context;
2761
+ }
2762
+ /**
2763
+ * @return {VasJobActionModel}
2764
+ */
2765
+ static empty() {
2766
+ return new VasJobActionModel('', '', '', '', '', '', '', '', '', '', [], undefined, [], 'job-form');
2767
+ }
2768
+ /**
2769
+ * @param {VasJobActionDto} dto
2770
+ * @return {VasJobActionModel}
2771
+ */
2772
+ static fromDto(dto) {
2773
+ return new VasJobActionModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.title || '', (dto.steps || []).map(dto => stepModelFactory(dto)), dto.succeededControl, dto.jobStatuses || [], dto.context || 'job-form');
2774
+ }
2775
+ /**
2776
+ * @return {VasJobActionDto}
2777
+ */
2778
+ toDto() {
2779
+ return {
2780
+ id: this.id,
2781
+ created: this.created,
2782
+ serverCreated: this.serverCreated,
2783
+ createdBy: this.createdBy,
2784
+ modified: this.modified,
2785
+ serverModified: this.serverModified,
2786
+ modifiedBy: this.modifiedBy,
2787
+ createdByName: this.createdByName,
2788
+ modifiedByName: this.modifiedByName,
2789
+ title: this.title,
2790
+ steps: this.steps.map(m => m.toDto()),
2791
+ succeededControl: this.succeededControl,
2792
+ jobStatuses: this.jobStatuses,
2793
+ context: this.context
2794
+ };
2795
+ }
2796
+ }
2119
2797
 
2120
2798
  class VasJobCopyModel {
2121
2799
  accessGroup;
@@ -2269,6 +2947,61 @@ class VasJobEmailModel extends VasJobDataModel {
2269
2947
  }
2270
2948
  }
2271
2949
 
2950
+ class VasJobStatusModel extends VasAccountObjectModel {
2951
+ id;
2952
+ created;
2953
+ serverCreated;
2954
+ createdBy;
2955
+ modified;
2956
+ serverModified;
2957
+ modifiedBy;
2958
+ createdByName;
2959
+ modifiedByName;
2960
+ account;
2961
+ title;
2962
+ sequence;
2963
+ categoryGroups;
2964
+ closed;
2965
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, title, sequence, categoryGroups, closed) {
2966
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account);
2967
+ this.id = id;
2968
+ this.created = created;
2969
+ this.serverCreated = serverCreated;
2970
+ this.createdBy = createdBy;
2971
+ this.modified = modified;
2972
+ this.serverModified = serverModified;
2973
+ this.modifiedBy = modifiedBy;
2974
+ this.createdByName = createdByName;
2975
+ this.modifiedByName = modifiedByName;
2976
+ this.account = account;
2977
+ this.title = title;
2978
+ this.sequence = sequence;
2979
+ this.categoryGroups = categoryGroups;
2980
+ this.closed = closed;
2981
+ }
2982
+ static fromDto(dto) {
2983
+ return new VasJobStatusModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.title || '', dto.sequence || 0, dto.categoryGroups || [], dto.closed || false);
2984
+ }
2985
+ toDto() {
2986
+ return {
2987
+ id: this.id,
2988
+ created: this.created,
2989
+ serverCreated: this.serverCreated,
2990
+ createdBy: this.createdBy,
2991
+ modified: this.modified,
2992
+ serverModified: this.serverModified,
2993
+ modifiedBy: this.modifiedBy,
2994
+ createdByName: this.createdByName,
2995
+ modifiedByName: this.modifiedByName,
2996
+ account: this.account,
2997
+ title: this.title,
2998
+ sequence: this.sequence,
2999
+ categoryGroups: this.categoryGroups,
3000
+ closed: this.closed,
3001
+ };
3002
+ }
3003
+ }
3004
+
2272
3005
  /**
2273
3006
  * A non sophisticated way to get values from the job via paths. For example:
2274
3007
  *
@@ -3340,5 +4073,5 @@ class VasVehicleModel extends VasAccountObjectModel {
3340
4073
  * Generated bundle index. Do not edit.
3341
4074
  */
3342
4075
 
3343
- export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobCopyModel, VasJobDataModel, VasJobEmailModel, VasJobModel, VasLookupModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto, isJobAutomationStep, isJobControlsStep, isJobEmailFormStep, isJobNotePromptStep, isJobSetDatetimeStep, isJobSetJobStatusStep, isJobSetValueStep, prepareFieldApiValue };
4076
+ export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobActionControlsStepModel, VasJobActionEmailFormStepModel, VasJobActionInstructionStepModel, VasJobActionModel, VasJobActionNotePromptStepModel, VasJobActionSetDatetimeStepModel, VasJobActionSetJobStatusStepModel, VasJobActionSetValueStepModel, VasJobActionWebhookStepModel, VasJobCopyModel, VasJobDataModel, VasJobEmailModel, VasJobModel, VasJobStatusModel, VasLookupModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto, isJobAutomationStep, isJobControlsStep, isJobEmailFormStep, isJobInstructionStep, isJobNotePromptStep, isJobSetDatetimeStep, isJobSetJobStatusStep, isJobSetValueStep, isJobWebhookStep, prepareFieldApiValue, stepModelFactory };
3344
4077
  //# sourceMappingURL=ironcode-vas-lib.mjs.map