@nocobase/plugin-workflow 0.13.0-alpha.3 → 0.13.0-alpha.5

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 (72) hide show
  1. package/dist/client/index.js +132 -9332
  2. package/dist/index.js +37 -16
  3. package/dist/locale/en-US.js +22 -4
  4. package/dist/locale/es-ES.js +22 -4
  5. package/dist/locale/fr-FR.js +22 -4
  6. package/dist/locale/ja-JP.js +22 -4
  7. package/dist/locale/pt-BR.js +22 -4
  8. package/dist/locale/ru-RU.js +22 -4
  9. package/dist/locale/tr-TR.js +22 -4
  10. package/dist/locale/zh-CN.js +22 -4
  11. package/dist/node_modules/cron-parser/lib/parser.js +1 -1
  12. package/dist/node_modules/cron-parser/package.json +1 -1
  13. package/dist/node_modules/lru-cache/index-cjs.js +1 -1
  14. package/dist/node_modules/lru-cache/package.json +1 -1
  15. package/dist/server/Plugin.js +70 -55
  16. package/dist/server/Processor.js +42 -25
  17. package/dist/server/actions/executions.js +41 -14
  18. package/dist/server/actions/index.js +39 -34
  19. package/dist/server/actions/nodes.js +48 -28
  20. package/dist/server/actions/workflows.js +50 -20
  21. package/dist/server/collections/executions.js +22 -4
  22. package/dist/server/collections/flow_nodes.js +22 -4
  23. package/dist/server/collections/jobs.js +22 -4
  24. package/dist/server/collections/workflows.js +22 -4
  25. package/dist/server/constants.js +30 -6
  26. package/dist/server/fields/expression-field.js +29 -8
  27. package/dist/server/fields/index.js +24 -7
  28. package/dist/server/functions/index.js +22 -4
  29. package/dist/server/index.js +45 -39
  30. package/dist/server/instructions/aggregate.js +30 -13
  31. package/dist/server/instructions/calculation.js +30 -13
  32. package/dist/server/instructions/condition.js +36 -17
  33. package/dist/server/instructions/create.js +26 -9
  34. package/dist/server/instructions/delay.js +27 -10
  35. package/dist/server/instructions/destroy.js +24 -7
  36. package/dist/server/instructions/index.js +35 -12
  37. package/dist/server/instructions/loop.js +27 -10
  38. package/dist/server/instructions/manual/actions.js +31 -10
  39. package/dist/server/instructions/manual/collecions/jobs.js +22 -4
  40. package/dist/server/instructions/manual/collecions/users.js +22 -4
  41. package/dist/server/instructions/manual/collecions/users_jobs.js +22 -4
  42. package/dist/server/instructions/manual/forms/create.js +22 -4
  43. package/dist/server/instructions/manual/forms/index.js +36 -14
  44. package/dist/server/instructions/manual/forms/update.js +22 -4
  45. package/dist/server/instructions/manual/index.js +60 -41
  46. package/dist/server/instructions/parallel.js +47 -28
  47. package/dist/server/instructions/query.js +31 -14
  48. package/dist/server/instructions/request.js +39 -16
  49. package/dist/server/instructions/sql.js +25 -8
  50. package/dist/server/instructions/update.js +24 -7
  51. package/dist/server/migrations/20221129153547-calculation-variables.js +24 -7
  52. package/dist/server/migrations/20230221032941-change-request-body-type.js +28 -7
  53. package/dist/server/migrations/20230221071831-calculation-expression.js +24 -7
  54. package/dist/server/migrations/20230221121203-condition-calculation.js +62 -7
  55. package/dist/server/migrations/20230221162902-jsonb-to-json.js +29 -12
  56. package/dist/server/migrations/20230411034722-manual-multi-form.js +38 -15
  57. package/dist/server/migrations/20230612021134-manual-collection-block.js +26 -9
  58. package/dist/server/migrations/20230710115902-manual-action-values.js +24 -7
  59. package/dist/server/migrations/20230809113132-workflow-options.js +24 -7
  60. package/dist/server/triggers/collection.js +26 -9
  61. package/dist/server/triggers/form.js +28 -11
  62. package/dist/server/triggers/index.js +42 -17
  63. package/dist/server/triggers/schedule.js +56 -31
  64. package/dist/server/types/Execution.js +24 -7
  65. package/dist/server/types/FlowNode.js +24 -7
  66. package/dist/server/types/Job.js +24 -7
  67. package/dist/server/types/Workflow.js +24 -7
  68. package/dist/server/types/index.js +15 -2
  69. package/dist/server/utils.js +26 -4
  70. package/dist/swagger/index.d.ts +103 -53
  71. package/dist/swagger/index.js +144 -71
  72. package/package.json +2 -2
@@ -1,5 +1,25 @@
1
- 'use strict';
2
-
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var swagger_exports = {};
19
+ __export(swagger_exports, {
20
+ default: () => swagger_default
21
+ });
22
+ module.exports = __toCommonJS(swagger_exports);
3
23
  var swagger_default = {
4
24
  openapi: "3.0.2",
5
25
  info: {
@@ -11,18 +31,21 @@ var swagger_default = {
11
31
  get: {
12
32
  tags: ["workflows"],
13
33
  description: "",
14
- parameters: [],
34
+ parameters: [
35
+ {
36
+ $ref: "#/components/schemas/workflow/filter"
37
+ }
38
+ ],
15
39
  responses: {
16
40
  200: {
17
41
  description: "OK",
18
42
  content: {
19
43
  "application/json": {
20
44
  schema: {
21
- allOf: [
22
- {
23
- $ref: "#/components/schemas/workflow"
24
- }
25
- ]
45
+ type: "array",
46
+ items: {
47
+ $ref: "#/components/schemas/workflow/model"
48
+ }
26
49
  }
27
50
  }
28
51
  }
@@ -34,7 +57,14 @@ var swagger_default = {
34
57
  get: {
35
58
  tags: ["workflows"],
36
59
  description: "Get single workflow",
37
- parameters: [],
60
+ parameters: [
61
+ {
62
+ $ref: "#/components/schemas/workflow/filterByTk"
63
+ },
64
+ {
65
+ $ref: "#/components/schemas/workflow/filter"
66
+ }
67
+ ],
38
68
  responses: {
39
69
  200: {
40
70
  description: "OK",
@@ -43,7 +73,7 @@ var swagger_default = {
43
73
  schema: {
44
74
  allOf: [
45
75
  {
46
- $ref: "#/components/schemas/workflow"
76
+ $ref: "#/components/schemas/workflow/model"
47
77
  },
48
78
  {
49
79
  type: "object",
@@ -76,13 +106,13 @@ var swagger_default = {
76
106
  type: "object",
77
107
  properties: {
78
108
  title: {
79
- $ref: "#/components/schemas/workflow/properties/title"
109
+ $ref: "#/components/schemas/workflow/model/properties/title"
80
110
  },
81
111
  type: {
82
- $ref: "#/components/schemas/workflow/properties/type"
112
+ $ref: "#/components/schemas/workflow/model/properties/type"
83
113
  },
84
114
  description: {
85
- $ref: "#/components/schemas/workflow/properties/description"
115
+ $ref: "#/components/schemas/workflow/model/properties/description"
86
116
  }
87
117
  }
88
118
  }
@@ -119,16 +149,16 @@ var swagger_default = {
119
149
  type: "object",
120
150
  properties: {
121
151
  title: {
122
- $ref: "#/components/schemas/workflow/properties/title"
152
+ $ref: "#/components/schemas/workflow/model/properties/title"
123
153
  },
124
154
  enabled: {
125
- $ref: "#/components/schemas/workflow/properties/enabled"
155
+ $ref: "#/components/schemas/workflow/model/properties/enabled"
126
156
  },
127
157
  description: {
128
- $ref: "#/components/schemas/workflow/properties/description"
158
+ $ref: "#/components/schemas/workflow/model/properties/description"
129
159
  },
130
160
  config: {
131
- $ref: "#/components/schemas/workflow/properties/config"
161
+ $ref: "#/components/schemas/workflow/model/properties/config"
132
162
  }
133
163
  }
134
164
  }
@@ -222,7 +252,7 @@ var swagger_default = {
222
252
  {
223
253
  name: "triggerWorkflows",
224
254
  in: "query",
225
- description: "A combined string to describe workflows to trigger and context data to use. e.g. `?triggerWorkflows=1,2!category`",
255
+ description: "A combined string to describe workflows to trigger and context data to use. e.g. `?triggerWorkflows=1,2!category`. Each comma separated part is a trigger pair, as `1` and `2!category`. The number part is the ID of workflow, exclamation means the path of association to use in form data. If ignored, will trigger with the full form data object.",
226
256
  schema: {
227
257
  type: "string"
228
258
  }
@@ -512,60 +542,105 @@ var swagger_default = {
512
542
  components: {
513
543
  schemas: {
514
544
  workflow: {
515
- type: "object",
516
- description: "Workflow",
517
- properties: {
518
- id: {
545
+ model: {
546
+ type: "object",
547
+ description: "Workflow",
548
+ properties: {
549
+ id: {
550
+ type: "integer",
551
+ description: "ID"
552
+ },
553
+ key: {
554
+ type: "string",
555
+ description: "Key. Variant versions of the same workflow share the same key."
556
+ },
557
+ title: {
558
+ type: "string",
559
+ description: "Title"
560
+ },
561
+ description: {
562
+ type: "string",
563
+ description: "Description"
564
+ },
565
+ current: {
566
+ type: "boolean",
567
+ description: "Current version"
568
+ },
569
+ enabled: {
570
+ type: "boolean",
571
+ description: "Enabled"
572
+ },
573
+ type: {
574
+ type: "string",
575
+ description: "Event type"
576
+ },
577
+ config: {
578
+ type: "object",
579
+ description: "Configuration JSON object"
580
+ },
581
+ nodes: {
582
+ type: "array",
583
+ description: "Workflow nodes"
584
+ },
585
+ executions: {
586
+ type: "array",
587
+ description: "Executions"
588
+ },
589
+ revisions: {
590
+ type: "array",
591
+ description: "Revisions"
592
+ },
593
+ executed: {
594
+ type: "integer",
595
+ description: "Executed count for a single version"
596
+ },
597
+ allExecuted: {
598
+ type: "integer",
599
+ description: "Executed count for all versions of the same workflow"
600
+ }
601
+ }
602
+ },
603
+ filterByTk: {
604
+ name: "filterByTk",
605
+ in: "query",
606
+ description: "Primary key of a record",
607
+ schema: {
519
608
  type: "integer",
520
609
  description: "ID"
521
- },
522
- key: {
523
- type: "string",
524
- description: "Key. Variant versions of the same workflow share the same key."
525
- },
526
- title: {
527
- type: "string",
528
- description: "Title"
529
- },
530
- description: {
531
- type: "string",
532
- description: "Description"
533
- },
534
- current: {
535
- type: "boolean",
536
- description: "Current version"
537
- },
538
- enabled: {
539
- type: "boolean",
540
- description: "Enabled"
541
- },
542
- type: {
543
- type: "string",
544
- description: "Event type"
545
- },
546
- config: {
610
+ }
611
+ },
612
+ filter: {
613
+ name: "filter",
614
+ in: "query",
615
+ description: "Filter parameters in JSON format",
616
+ schema: {
547
617
  type: "object",
548
- description: "Configuration JSON object"
549
- },
550
- nodes: {
551
- type: "array",
552
- description: "Workflow nodes"
553
- },
554
- executions: {
555
- type: "array",
556
- description: "Executions"
557
- },
558
- revisions: {
559
- type: "array",
560
- description: "Revisions"
561
- },
562
- executed: {
563
- type: "integer",
564
- description: "Executed count for a single version"
565
- },
566
- allExecuted: {
567
- type: "integer",
568
- description: "Executed count for all versions of the same workflow"
618
+ properties: {
619
+ id: {
620
+ $ref: "#/components/schemas/workflow/model/properties/id"
621
+ },
622
+ title: {
623
+ $ref: "#/components/schemas/workflow/model/properties/title"
624
+ },
625
+ type: {
626
+ $ref: "#/components/schemas/workflow/model/properties/type"
627
+ },
628
+ enabled: {
629
+ $ref: "#/components/schemas/workflow/model/properties/enabled"
630
+ },
631
+ current: {
632
+ $ref: "#/components/schemas/workflow/model/properties/current"
633
+ },
634
+ key: {
635
+ $ref: "#/components/schemas/workflow/model/properties/key"
636
+ },
637
+ executed: {
638
+ $ref: "#/components/schemas/workflow/model/properties/executed"
639
+ },
640
+ allExecuted: {
641
+ $ref: "#/components/schemas/workflow/model/properties/allExecuted"
642
+ }
643
+ }
569
644
  }
570
645
  }
571
646
  },
@@ -721,5 +796,3 @@ var swagger_default = {
721
796
  }
722
797
  }
723
798
  };
724
-
725
- module.exports = swagger_default;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "工作流",
5
5
  "description": "A powerful workflow plugin designed to support business process management and automation.",
6
6
  "description.zh-CN": "工作流插件,为业务流程管理和自动化提供支持。",
7
- "version": "0.13.0-alpha.3",
7
+ "version": "0.13.0-alpha.5",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "devDependencies": {
@@ -42,5 +42,5 @@
42
42
  "@nocobase/test": "0.x",
43
43
  "@nocobase/utils": "0.x"
44
44
  },
45
- "gitHead": "4a9e3b3d49222c58a40025dab4a1522a035ec664"
45
+ "gitHead": "9eabe607b4a20c356fdb2fd95e40fa476986dcb0"
46
46
  }