@nocobase/plugin-workflow 2.2.0-alpha.8 → 2.2.0-alpha.9

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 (52) hide show
  1. package/dist/client/509.88792f5bd054b2af.js +10 -0
  2. package/dist/client/67.56a3d15a55ab7d5c.js +10 -0
  3. package/dist/client/719.f011fde3ad54571e.js +10 -0
  4. package/dist/client/782.47792ce10fc0d5fb.js +10 -0
  5. package/dist/client/{828.78ff0c90212276c0.js → 828.6880ab21513b1968.js} +1 -1
  6. package/dist/client/972.dd7f074d5f12e171.js +10 -0
  7. package/dist/client/index.js +1 -1
  8. package/dist/client-v2/{387.20ffad90130780e6.js → 387.5e61d648d16dbf1b.js} +1 -1
  9. package/dist/client-v2/513.617697f74783a611.js +10 -0
  10. package/dist/client-v2/677.7382807126d9621a.js +10 -0
  11. package/dist/client-v2/canvas/WorkflowTypedVariableInput.d.ts +1 -1
  12. package/dist/client-v2/index.js +1 -1
  13. package/dist/client-v2/pages/WorkflowFormDrawer.d.ts +1 -0
  14. package/dist/common/collections/workflows.d.ts +1 -3
  15. package/dist/common/collections/workflows.js +3 -3
  16. package/dist/externalVersion.js +13 -13
  17. package/dist/locale/de-DE.json +1 -0
  18. package/dist/locale/en-US.json +2 -0
  19. package/dist/locale/es-ES.json +1 -0
  20. package/dist/locale/fr-FR.json +1 -0
  21. package/dist/locale/hu-HU.json +1 -0
  22. package/dist/locale/id-ID.json +1 -0
  23. package/dist/locale/it-IT.json +1 -0
  24. package/dist/locale/ja-JP.json +1 -0
  25. package/dist/locale/ko-KR.json +1 -0
  26. package/dist/locale/nl-NL.json +1 -0
  27. package/dist/locale/pt-BR.json +1 -0
  28. package/dist/locale/ru-RU.json +1 -0
  29. package/dist/locale/tr-TR.json +1 -0
  30. package/dist/locale/uk-UA.json +1 -0
  31. package/dist/locale/vi-VN.json +1 -0
  32. package/dist/locale/zh-CN.json +2 -0
  33. package/dist/locale/zh-TW.json +1 -0
  34. package/dist/node_modules/cron-parser/package.json +1 -1
  35. package/dist/node_modules/joi/package.json +1 -1
  36. package/dist/node_modules/lru-cache/package.json +1 -1
  37. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  38. package/dist/server/actions/workflows.js +6 -2
  39. package/dist/server/migrations/20260713000000-remove-workflow-validation.d.ts +13 -0
  40. package/dist/server/migrations/20260713000000-remove-workflow-validation.js +56 -0
  41. package/dist/server/triggers/CollectionTrigger.d.ts +1 -1
  42. package/dist/server/types/Workflow.d.ts +1 -1
  43. package/dist/server/utils.d.ts +1 -1
  44. package/dist/server/utils.js +14 -1
  45. package/package.json +2 -2
  46. package/dist/client/509.8a85abc526e8cfe0.js +0 -10
  47. package/dist/client/67.c206df2fb7e32468.js +0 -10
  48. package/dist/client/719.79871d3000b54948.js +0 -10
  49. package/dist/client/782.e058403fcb6b1750.js +0 -10
  50. package/dist/client/972.5df5193573fe04e5.js +0 -10
  51. package/dist/client-v2/513.19fe2e75d7cb18f8.js +0 -10
  52. package/dist/client-v2/677.36a6fe395279deeb.js +0 -10
@@ -19,6 +19,7 @@ export type WorkflowRecord = {
19
19
  sync?: boolean;
20
20
  description?: string;
21
21
  enabled?: boolean;
22
+ invalid?: boolean;
22
23
  config?: Record<string, any>;
23
24
  options?: Record<string, any>;
24
25
  categories?: Array<{
@@ -191,9 +191,7 @@ declare const _default: {
191
191
  } | {
192
192
  type: string;
193
193
  name: string;
194
- defaultValue: {
195
- timeout?: undefined;
196
- };
194
+ defaultValue: boolean;
197
195
  primaryKey?: undefined;
198
196
  allowNull?: undefined;
199
197
  interface?: undefined;
@@ -121,9 +121,9 @@ var workflows_default = {
121
121
  defaultValue: {}
122
122
  },
123
123
  {
124
- type: "jsonb",
125
- name: "validation",
126
- defaultValue: {}
124
+ type: "boolean",
125
+ name: "invalid",
126
+ defaultValue: false
127
127
  },
128
128
  {
129
129
  type: "hasMany",
@@ -11,33 +11,33 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "@formily/core": "2.3.7",
13
13
  "@formily/react": "2.3.7",
14
- "@nocobase/client": "2.2.0-alpha.8",
15
- "@nocobase/utils": "2.2.0-alpha.8",
14
+ "@nocobase/client": "2.2.0-alpha.9",
15
+ "@nocobase/utils": "2.2.0-alpha.9",
16
16
  "antd": "5.24.2",
17
17
  "@ant-design/icons": "5.6.1",
18
- "@nocobase/flow-engine": "2.2.0-alpha.8",
18
+ "@nocobase/flow-engine": "2.2.0-alpha.9",
19
19
  "ahooks": "3.7.8",
20
20
  "react-router-dom": "6.30.1",
21
21
  "react-i18next": "11.18.6",
22
22
  "lodash": "4.18.1",
23
23
  "@dnd-kit/core": "6.1.0",
24
24
  "@formily/shared": "2.3.7",
25
- "@nocobase/plugin-mobile": "2.2.0-alpha.8",
26
- "@nocobase/client-v2": "2.2.0-alpha.8",
25
+ "@nocobase/plugin-mobile": "2.2.0-alpha.9",
26
+ "@nocobase/client-v2": "2.2.0-alpha.9",
27
27
  "sequelize": "6.35.2",
28
- "@nocobase/server": "2.2.0-alpha.8",
29
- "@nocobase/database": "2.2.0-alpha.8",
30
- "@nocobase/data-source-manager": "2.2.0-alpha.8",
31
- "@nocobase/logger": "2.2.0-alpha.8",
32
- "@nocobase/evaluators": "2.2.0-alpha.8",
28
+ "@nocobase/server": "2.2.0-alpha.9",
29
+ "@nocobase/database": "2.2.0-alpha.9",
30
+ "@nocobase/data-source-manager": "2.2.0-alpha.9",
31
+ "@nocobase/logger": "2.2.0-alpha.9",
32
+ "@nocobase/evaluators": "2.2.0-alpha.9",
33
33
  "@formily/antd-v5": "1.2.3",
34
34
  "@formily/reactive": "2.3.7",
35
35
  "@emotion/css": "11.13.0",
36
36
  "@formily/json-schema": "2.3.7",
37
37
  "antd-style": "3.7.1",
38
38
  "dayjs": "1.11.13",
39
- "@nocobase/actions": "2.2.0-alpha.8",
40
- "@nocobase/plugin-workflow-test": "2.2.0-alpha.8",
41
- "@nocobase/test": "2.2.0-alpha.8",
39
+ "@nocobase/actions": "2.2.0-alpha.9",
40
+ "@nocobase/plugin-workflow-test": "2.2.0-alpha.9",
41
+ "@nocobase/test": "2.2.0-alpha.9",
42
42
  "@dnd-kit/sortable": "7.0.2"
43
43
  };
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Wird im Hintergrund als Aufgabe in der Warteschlange ausgeführt.",
256
256
  "Workflow": "Workflow",
257
+ "Workflow not executed": "Workflow nicht ausgeführt",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow ausgeführt, der Ergebnisstatus ist <1>{{statusText}}</1><2>Ausführung anzeigen</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Der Workflow wurde nicht ausgelöst, weil die aktuelle Anfrage die Auslöseanforderungen nicht erfüllt.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -279,8 +279,10 @@
279
279
  "When no condition matches": "When no condition matches",
280
280
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
281
281
  "Workflow": "Workflow",
282
+ "This workflow has configuration issues and may not work properly.": "This workflow has configuration issues and may not work properly.",
282
283
  "Workflow title": "Workflow title",
283
284
  "Workflow canvas editor is being migrated to the new UI.": "Workflow canvas editor is being migrated to the new UI.",
285
+ "Workflow not executed": "Workflow not executed",
284
286
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
285
287
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Workflow was not triggered because the current request did not meet the trigger requirements.",
286
288
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
256
  "Workflow": "Flujo de trabajo",
257
+ "Workflow not executed": "Flujo de trabajo no ejecutado",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "El flujo de trabajo no se activó porque la solicitud actual no cumplió los requisitos del desencadenador.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
256
  "Workflow": "Workflow",
257
+ "Workflow not executed": "Workflow non exécuté",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Le workflow n’a pas été déclenché, car la requête actuelle ne répond pas aux exigences du déclencheur.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "A háttérben sorba állított feladatként kerül végrehajtásra.",
256
256
  "Workflow": "Munkafolyamat",
257
+ "Workflow not executed": "A munkafolyamat nem lett végrehajtva",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Munkafolyamat végrehajtva, az eredmény állapota: <1>{{statusText}}</1><2>Végrehajtás megtekintése</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "A munkafolyamat nem indult el, mert az aktuális kérés nem felelt meg az indítási feltételeknek.",
259
260
  "Workflow is not exists": "Workflow is not exists",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Akan dieksekusi di latar belakang sebagai tugas antrean.",
256
256
  "Workflow": "Alur kerja",
257
+ "Workflow not executed": "Alur kerja tidak dieksekusi",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Alur kerja dieksekusi, status hasilnya adalah <1>{{statusText}}</1><2>Lihat eksekusi</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Alur kerja tidak dipicu karena permintaan saat ini tidak memenuhi persyaratan pemicu.",
259
260
  "Workflow is not exists": "Workflow is not exists",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Verrà eseguito in background come attività in coda.",
256
256
  "Workflow": "Workflow",
257
+ "Workflow not executed": "Workflow non eseguito",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow eseguito, lo stato del risultato è <1>{{statusText}}</1><2>Visualizza l'esecuzione</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Il workflow non è stato attivato perché la richiesta corrente non soddisfa i requisiti del trigger.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -256,6 +256,7 @@
256
256
  "When no condition matches": "When no condition matches",
257
257
  "Will be executed in the background as a queued task.": "キュータスクとしてバックグラウンドで実行されます。",
258
258
  "Workflow": "ワークフロー",
259
+ "Workflow not executed": "ワークフローは実行されませんでした",
259
260
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "ワークフローが実行されました。結果ステータス: <1>{{statusText}}</1><2>実行詳細を表示</2>",
260
261
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "現在のリクエストがトリガー要件を満たしていないため、ワークフローはトリガーされませんでした。",
261
262
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -272,6 +272,7 @@
272
272
  "When no condition matches": "When no condition matches",
273
273
  "Will be executed in the background as a queued task.": "백그라운드에서 대기 작업으로 실행됩니다.",
274
274
  "Workflow": "워크플로우",
275
+ "Workflow not executed": "워크플로우가 실행되지 않았습니다",
275
276
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "워크플로우가 실행되었습니다. 결과 상태는 <1>{{statusText}}</1><2>실행 보기</2>",
276
277
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "현재 요청이 트리거 요구 사항을 충족하지 않아 워크플로우가 트리거되지 않았습니다.",
277
278
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
256
  "Workflow": "Workflow",
257
+ "Workflow not executed": "Workflow niet uitgevoerd",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "De workflow is niet geactiveerd omdat de huidige aanvraag niet aan de triggervereisten voldoet.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
256
  "Workflow": "Fluxo de trabalho",
257
+ "Workflow not executed": "Fluxo de trabalho não executado",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "O workflow não foi acionado porque a solicitação atual não atende aos requisitos do gatilho.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Будет выполнен в фоновом режиме как задача в очереди.",
256
256
  "Workflow": "Рабочий процесс",
257
+ "Workflow not executed": "Рабочий процесс не выполнен",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Рабочий процесс выполнен, статус результата: <1>{{statusText}}</1><2>Посмотреть выполнение</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Рабочий процесс не был запущен, так как текущий запрос не соответствует требованиям триггера.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
256
  "Workflow": "İş Akışı",
257
+ "Workflow not executed": "İş akışı yürütülmedi",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Geçerli istek tetikleme gereksinimlerini karşılamadığı için iş akışı tetiklenmedi.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
256
  "Workflow": "Workflow",
257
+ "Workflow not executed": "Робочий процес не виконано",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Робочий процес не було запущено, оскільки поточний запит не відповідає вимогам тригера.",
259
260
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -254,6 +254,7 @@
254
254
  "When no condition matches": "When no condition matches",
255
255
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
256
  "Workflow": "Workflow",
257
+ "Workflow not executed": "Quy trình làm việc chưa được thực thi",
257
258
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
259
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "Quy trình làm việc không được kích hoạt vì yêu cầu hiện tại không đáp ứng các điều kiện kích hoạt.",
259
260
  "Workflow is not exists": "Workflow is not exists",
@@ -287,8 +287,10 @@
287
287
  "When no condition matches": "未满足任何条件时",
288
288
  "Will be executed in the background as a queued task.": "将作为队列任务在后台执行。",
289
289
  "Workflow": "工作流",
290
+ "This workflow has configuration issues and may not work properly.": "该工作流配置存在问题,可能无法正常使用",
290
291
  "Workflow title": "工作流名称",
291
292
  "Workflow canvas editor is being migrated to the new UI.": "工作流画布编辑器正在迁移到新版界面。",
293
+ "Workflow not executed": "工作流未执行",
292
294
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "工作流已执行,结果状态为 <1>{{statusText}}</1><2>查看执行详情</2>",
293
295
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "当前请求未满足触发要求,工作流未触发。",
294
296
  "Workflow of execution is not existed": "执行计划对应的工作流不存在",
@@ -257,6 +257,7 @@
257
257
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
258
258
  "Workflow": "Workflow",
259
259
  "Workflow title": "工作流名稱",
260
+ "Workflow not executed": "工作流未執行",
260
261
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
261
262
  "Workflow was not triggered because the current request did not meet the trigger requirements.": "目前請求未滿足觸發要求,工作流未觸發。",
262
263
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -1 +1 @@
1
- {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-07-12T22:53:42.833Z"}
1
+ {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-07-16T13:02:54.958Z"}
@@ -1 +1 @@
1
- {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-07-12T22:53:42.560Z"}
1
+ {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-07-16T13:02:54.726Z"}
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-07-12T22:53:41.826Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-07-16T13:02:53.977Z"}
@@ -1 +1 @@
1
- {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-07-12T22:53:41.660Z"}
1
+ {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-07-16T13:02:53.838Z"}
@@ -78,7 +78,9 @@ async function list(context, next) {
78
78
  }
79
79
  async function create(context, next) {
80
80
  const plugin = context.app.pm.get(import_Plugin.default);
81
- const { values } = context.action.params;
81
+ const values = { ...context.action.params.values || {} };
82
+ delete values.invalid;
83
+ context.action.mergeParams({ values }, { values: "overwrite" });
82
84
  validateWorkflow(context, plugin, values);
83
85
  return import_actions.default.create(context, next);
84
86
  }
@@ -143,10 +145,12 @@ async function destroy(context, next) {
143
145
  async function revision(context, next) {
144
146
  const repository = import_actions.utils.getRepositoryFromParams(context);
145
147
  const { filterByTk, filter = {}, values = {} } = context.action.params;
148
+ const revisionValues = { ...values };
149
+ delete revisionValues.invalid;
146
150
  context.body = await repository.revision({
147
151
  filterByTk,
148
152
  filter,
149
- values,
153
+ values: revisionValues,
150
154
  context
151
155
  });
152
156
  await next();
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Migration } from '@nocobase/server';
10
+ export default class extends Migration {
11
+ on: string;
12
+ up(): Promise<void>;
13
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var remove_workflow_validation_exports = {};
28
+ __export(remove_workflow_validation_exports, {
29
+ default: () => remove_workflow_validation_default
30
+ });
31
+ module.exports = __toCommonJS(remove_workflow_validation_exports);
32
+ var import_server = require("@nocobase/server");
33
+ class remove_workflow_validation_default extends import_server.Migration {
34
+ on = "afterSync";
35
+ async up() {
36
+ const { db } = this.context;
37
+ const workflows = db.getCollection("workflows");
38
+ const tableInfo = workflows.getTableNameWithSchema();
39
+ await db.sequelize.transaction(async (transaction) => {
40
+ const tableExists = await this.queryInterface.tableExists(tableInfo, { transaction });
41
+ if (!tableExists) {
42
+ return;
43
+ }
44
+ const describeTable = this.queryInterface.describeTable.bind(this.queryInterface);
45
+ const columns = await describeTable(tableInfo, { transaction });
46
+ if (!columns.validation) {
47
+ return;
48
+ }
49
+ await this.queryInterface.removeColumn(tableInfo, "validation", { transaction });
50
+ if (db.sequelize.getDialect() === "sqlite") {
51
+ const syncOptions = { hooks: false, transaction };
52
+ await workflows.model.sync(syncOptions);
53
+ }
54
+ });
55
+ }
56
+ }
@@ -30,7 +30,7 @@ export default class CollectionTrigger extends Trigger {
30
30
  code?: string;
31
31
  };
32
32
  prepare(workflow: WorkflowModel, data: Model | Record<string, any> | string | number, options: any): Promise<{
33
- data: any;
33
+ data: string | number | Record<string, any> | Model<any, any>;
34
34
  }>;
35
35
  on(workflow: WorkflowModel): void;
36
36
  off(workflow: WorkflowModel): void;
@@ -19,7 +19,7 @@ export default class WorkflowModel extends Model {
19
19
  description?: string;
20
20
  type: string;
21
21
  config: any;
22
- validation?: Record<string, any>;
22
+ invalid: boolean;
23
23
  options: {
24
24
  timeout?: number;
25
25
  stackLimit?: number;
@@ -32,5 +32,5 @@ export declare function getWorkflowExecutionLogMeta(workflow: WorkflowModel, pro
32
32
  lastJobStatus: number;
33
33
  };
34
34
  export declare function abortExecution(plugin: PluginWorkflowServer, execution: ExecutionModel, options?: AbortOptions): Promise<boolean>;
35
- export declare function toJSON(data: any): any;
35
+ export declare function toJSON<T>(data: T): T;
36
36
  export {};
@@ -164,6 +164,16 @@ async function abortExecution(plugin, execution, options = {}) {
164
164
  throw error;
165
165
  }
166
166
  }
167
+ function getHiddenFieldNames(model) {
168
+ const { collection } = model.constructor;
169
+ if (!(collection == null ? void 0 : collection.fields)) {
170
+ return [];
171
+ }
172
+ return Array.from(collection.fields.values()).filter((field) => {
173
+ var _a;
174
+ return (_a = field == null ? void 0 : field.options) == null ? void 0 : _a.hidden;
175
+ }).map((field) => field.options.name).filter((name) => typeof name === "string");
176
+ }
167
177
  function toJSON(data) {
168
178
  if (Array.isArray(data)) {
169
179
  return data.map(toJSON);
@@ -171,7 +181,10 @@ function toJSON(data) {
171
181
  if (!(data instanceof import_database.Model) || !data) {
172
182
  return data;
173
183
  }
174
- const result = data.get();
184
+ const result = { ...data.get() };
185
+ for (const fieldName of getHiddenFieldNames(data)) {
186
+ delete result[fieldName];
187
+ }
175
188
  Object.keys(data.constructor.associations).forEach((key) => {
176
189
  if (result[key] != null && typeof result[key] === "object") {
177
190
  result[key] = toJSON(result[key]);
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
7
7
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
8
8
  "description.ru-RU": "Мощный инструмент BPM, обеспечивающий базовую поддержку автоматизации бизнес-процессов с возможностью неограниченного расширения триггеров и узлов.",
9
- "version": "2.2.0-alpha.8",
9
+ "version": "2.2.0-alpha.9",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/workflow",
@@ -51,7 +51,7 @@
51
51
  "@nocobase/test": "2.x",
52
52
  "@nocobase/utils": "2.x"
53
53
  },
54
- "gitHead": "810c81e5963966bda7ec03b6453a3a80fe60e027",
54
+ "gitHead": "4949bf5ebcd92d77a3a0a718ed578c270e4bd570",
55
55
  "keywords": [
56
56
  "Workflow"
57
57
  ]
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["509"],{5764:function(e,t,n){n.r(t),n.d(t,{default:function(){return eo}});var r=n(7375),o=n(3485),l=n(5477),a=n(7694),i=n(2625),u=n(2059),c=n(9155),s=n.n(c),d=n(5827),f=n(7541),m=n(5927),p=n(7001),y=n(9488),b=n(8743),v=n(1652),g=n(5953);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){w(l,r,o,a,i,"next",e)}function i(e){w(l,r,o,a,i,"throw",e)}a(void 0)})}}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||k(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}}function C(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var x=["red","magenta","volcano","orange","gold","lime","green","cyan","blue","geekblue","purple","default"];function F(e){var t=(0,g.useTranslation)().t,n=x.map(function(e){return{value:e,label:s().createElement(u.Tag,{color:"default"===e?void 0:e},t(e.charAt(0).toUpperCase()+e.slice(1)))}});return s().createElement(u.Select,{allowClear:!0,value:e.value,options:n,onChange:e.onChange})}function A(e){var t=e.activeKey,n=e.onChange,r=e.categories,l=e.refreshCategories,d=e.className,f=(0,y.ec)().t,m=(0,y.kj)(),p=(0,a.useFlowContext)(),b=u.App.useApp().modal,v=p.api.resource("workflowCategories"),g=S((0,c.useState)(null),2),w=g[0],x=g[1],A=S((0,c.useState)(!1),2),O=A[0],T=A[1],I=S((0,c.useState)(!1),2),j=I[0],M=I[1],P=S(u.Form.useForm(),1)[0],z=(0,c.useMemo)(function(){return((function(e){if(Array.isArray(e))return h(e)})(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||k(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,t){var n,r;return(null!=(n=e.sort)?n:0)-(null!=(r=t.sort)?r:0)}).map(function(e){return{id:e.id,label:m(e.title),color:e.color}})},[r,m]),D=(0,i.useMemoizedFn)(function(e){return r.find(function(t){return String(t.id)===String(e)})}),L=(0,i.useMemoizedFn)(function(){x(null),P.resetFields(),T(!0)}),B=(0,i.useMemoizedFn)(function(e){var t=D(e);t&&(x(t),P.setFieldsValue({title:t.title,color:t.color}),T(!0))}),R=(0,i.useMemoizedFn)(function(e){var r=D(e);r&&b.confirm({title:f("Delete category"),content:f("Are you sure you want to delete it?"),onOk:function(){return E(function(){return C(this,function(e){switch(e.label){case 0:return[4,v.destroy({filterByTk:r.id})];case 1:return e.sent(),String(r.id)===t&&n("all"),l(),[2]}})})()}})}),W=(0,i.useMemoizedFn)(function(e,t){return E(function(){return C(this,function(n){switch(n.label){case 0:return[4,v.move({sourceId:e,targetId:t})];case 1:return n.sent(),l(),[2]}})})()}),N=(0,i.useMemoizedFn)(function(){return E(function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,P.validateFields()];case 1:e=t.sent(),M(!0),t.label=2;case 2:if(t.trys.push([2,,7,8]),!w)return[3,4];return[4,v.update({filterByTk:w.id,values:e})];case 3:return t.sent(),[3,6];case 4:return[4,v.create({values:e})];case 5:t.sent(),t.label=6;case 6:return T(!1),l(),[3,8];case 7:return M(!1),[7];case 8:return[2]}})})()});return s().createElement(s().Fragment,null,s().createElement(o.SortableCategoryTabs,{className:d,activeKey:t,onChange:n,allTab:{key:"all",label:f("All")},categories:z,onAdd:L,onEdit:B,onDelete:R,onSort:W,menuLabels:{edit:f("Edit category"),delete:f("Delete category")}}),s().createElement(u.Modal,{title:w?f("Edit category"):f("Add category"),open:O,confirmLoading:j,onOk:N,onCancel:function(){return T(!1)},okText:f("Submit"),cancelText:f("Cancel"),destroyOnClose:!0},s().createElement(u.Form,{form:P,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:f("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"color",label:f("Color")},s().createElement(F,null)))))}var O=n(9239);function T(e){var t=e.value,n=e.onChange,o=e.disabled,l=(0,y.ec)().t,a=[{value:!1,label:l("Asynchronously"),tooltip:l("Will be executed in the background as a queued task.")},{value:!0,label:l("Synchronously"),tooltip:l("For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.")}];return s().createElement(u.Radio.Group,{value:t,disabled:o,onChange:function(e){return null==n?void 0:n(e.target.value)}},a.map(function(e){return s().createElement(u.Radio,{key:String(e.value),value:e.value},s().createElement(u.Space,{size:"small"},e.label,s().createElement(u.Tooltip,{title:e.tooltip},s().createElement(r.QuestionCircleOutlined,null))))}))}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=[{value:1e3,label:"Seconds"},{value:6e4,label:"Minutes"},{value:36e5,label:"Hours"},{value:864e5,label:"Days"}];function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15552e6;return Math.min(Math.max(e,0),t)}function P(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4;return e&&null!=(t=null==(n=j.findLast(function(t){return e%t.value==0}))?void 0:n.value)?t:r}function z(e){var t,n=e.value,r=e.onChange,o=(0,y.ec)().t,l=M(Number(null!=n?n:0)),a=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(function(){return P(l)}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return I(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return I(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],d=a[1];(0,c.useEffect)(function(){0!==l&&d(function(e){return P(l,e)})},[l]);var f=0===l?0:l/i,m=15552e6/i;return s().createElement(u.Space.Compact,{style:{width:"50%"}},s().createElement(u.InputNumber,{min:0,max:m,precision:0,value:f,onChange:function(e){return null==r?void 0:r(M(Number(e)||0,m)*i)},style:{width:"70%"}}),s().createElement(u.Select,{value:i,style:{width:"30%"},options:j.map(function(e){return{value:e.value,label:o(e.label)}}),onChange:function(e){var t=M(Number(null!=n?n:0)),o=0===t?0:t/i;d(e),null==r||r(M(o*e))}}))}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){var t,n=e.mode,r=e.plugin,l=e.record,d=e.categoryOptions,f=e.onSubmitted,m=(0,y.ec)().t,p=(0,y.kj)(),b=(0,a.useFlowContext)(),v=u.theme.useToken().token,g=b.api.resource("workflows"),h=B(u.Form.useForm(),1)[0],w=B((0,c.useState)(!1),2),E=w[0],S=w[1],k=(0,c.useMemo)(function(){var e=Array.from(r.triggers.getEntities()).map(function(e){var t=B(e,2),n=t[0],r=t[1];return{value:n,label:(null==r?void 0:r.title)?p(r.title):String(n),description:(null==r?void 0:r.description)?p(r.description):void 0}});return"edit"===n&&(null==l?void 0:l.type)&&!e.some(function(e){return e.value===l.type})&&e.push({value:l.type,label:l.type,description:void 0}),e.sort(function(e,t){return String(e.label).localeCompare(String(t.label))})},[r,p,n,l]),C=(0,c.useMemo)(function(){return O.hi.filter(function(e){return!!e.value}).map(function(e){return{value:e.value,label:p(e.label),color:e.color,description:e.description?p(e.description):void 0}})},[p]),x=(0,c.useMemo)(function(){if("edit"===n){var t,r,o;return{title:null==l?void 0:l.title,type:null==l?void 0:l.type,sync:null!=(t=null==l?void 0:l.sync)&&t,description:null==l?void 0:l.description,categories:(null!=(r=null==l?void 0:l.categories)?r:[]).map(function(e){return e.id}),options:null!=(o=null==l?void 0:l.options)?o:{}}}return{type:e.type,sync:!1,options:{},config:{}}},[n,l,e.type]);(0,c.useEffect)(function(){h.setFieldsValue(x)},[h,x]);var F=null!=(t=u.Form.useWatch("type",h))?t:e.type,A=(0,c.useMemo)(function(){return r.getTriggerOptions(F)},[r,F]),I=(null==A?void 0:A.sync)!=null;(0,c.useEffect)(function(){I&&h.setFieldValue("sync",A.sync)},[I,A,h]);var j=(0,c.useMemo)(function(){if("create"!==n)return null;var e=null==A?void 0:A.PresetFieldsetLoader;return e?(0,c.lazy)(e):null},[n,A]),M=(0,i.useMemoizedFn)(function(){h.setFieldValue("config",{})}),P=(0,i.useMemoizedFn)(function(){var e;return(e=function(){var e,t,r,o,a,i;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:return[4,h.validateFields()];case 1:e=u.sent(),S(!0),u.label=2;case 2:if(u.trys.push([2,,7,8]),"create"!==n)return[3,4];return[4,g.create({values:{title:e.title,type:e.type,sync:!!e.sync,current:!0,config:null!=(t=e.config)?t:{},description:e.description,categories:null!=(r=e.categories)?r:[],options:null!=(o=e.options)?o:{}}})];case 3:return u.sent(),[3,6];case 4:return[4,g.update({filterByTk:l.id,values:{title:e.title,sync:!!e.sync,description:e.description,categories:null!=(a=e.categories)?a:[],options:null!=(i=e.options)?i:{}}})];case 5:u.sent(),u.label=6;case 6:return f(),[3,8];case 7:return S(!1),[7];case 8:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){L(l,r,o,a,i,"next",e)}function i(e){L(l,r,o,a,i,"throw",e)}a(void 0)})})()});return s().createElement(o.DrawerFormLayout,{title:m("create"===n?"Add new":"Edit"),onSubmit:P,submitting:E,submitText:m("Submit"),cancelText:m("Cancel")},s().createElement(u.Form,{form:h,layout:"vertical",initialValues:x},s().createElement(u.Form.Item,{name:"title",label:m("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"type",label:m("Trigger type"),rules:[{required:!0}]},s().createElement(u.Select,{options:k,disabled:"edit"===n,onChange:M,showSearch:!0,optionFilterProp:"label",popupMatchSelectWidth:!0,optionRender:function(e){var t,n;return s().createElement(u.Space,{direction:"vertical"},s().createElement(u.Tag,{color:"gold"},null==(t=e.data)?void 0:t.label),(null==(n=e.data)?void 0:n.description)?s().createElement(u.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},e.data.description):null)}})),j?s().createElement("div",{style:{marginBottom:v.marginLG}},s().createElement("div",{style:{marginBottom:v.marginXS,fontWeight:600}},"".concat(m("Trigger configuration"),":")),s().createElement("div",{style:{padding:v.padding,border:"".concat(v.lineWidth,"px solid ").concat(v.colorBorderSecondary),borderRadius:v.borderRadiusLG}},s().createElement(c.Suspense,{fallback:s().createElement(u.Spin,null)},s().createElement(j,null)))):null,s().createElement(u.Form.Item,{name:"sync",label:m("Execute mode"),extra:m("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.")},s().createElement(T,{disabled:I||"edit"===n})),s().createElement(u.Form.Item,{name:"categories",label:m("Category")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:d,optionFilterProp:"label"})),s().createElement(u.Form.Item,{name:"description",label:m("Description")},s().createElement(u.Input.TextArea,{autoSize:{minRows:2}})),s().createElement(u.Form.Item,{label:m("Advance options")},s().createElement(u.Card,{size:"small"},s().createElement(u.Form.Item,{name:["options","timeout"],label:m("Timeout settings"),extra:m("0 means unlimited. If you set any other value and the execution is still not completed when the timeout is reached, the execution plan will be terminated and the remaining nodes will not be executed. Time spent in queue is not counted; timing starts only after it first enters a processor."),initialValue:0},s().createElement(z,null)),s().createElement(u.Form.Item,{name:["options","stackLimit"],label:m("Maximum number of cycling triggers"),extra:m("The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution."),initialValue:1},s().createElement(u.InputNumber,{min:1,precision:0,style:{width:"50%"}})),s().createElement(u.Form.Item,{name:["options","deleteExecutionOnStatus"],label:m("Auto delete history when execution is on end status")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:C,optionFilterProp:"label",optionRender:function(e){var t,n,r;return s().createElement(u.Space,null,s().createElement(u.Tag,{color:null==(t=e.data)?void 0:t.color},null==(n=e.data)?void 0:n.label),(null==(r=e.data)?void 0:r.description)?s().createElement("span",null,e.data.description):null)},tagRender:function(e){var t,n=e.value,r=e.label,o=e.closable,l=e.onClose;return s().createElement(u.Tag,{color:null==(t=O.m2[String(n)])?void 0:t.color,closable:o,onClose:l,onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},r)}}))))))}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function G(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){N(l,r,o,a,i,"next",e)}function i(e){N(l,r,o,a,i,"throw",e)}a(void 0)})}}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function V(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||U(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function K(e){return function(e){if(Array.isArray(e))return W(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}}function X(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function H(){var e=_(["\n background: ",";\n padding: 0;\n "]);return H=function(){return e},e}function Q(){var e=_(["\n margin-left: -1px;\n background: ",";\n\n .ant-tabs {\n margin-bottom: 0;\n }\n\n .ant-tabs-nav {\n margin-bottom: 0;\n }\n\n .ant-tabs-content-holder {\n display: none;\n }\n "]);return Q=function(){return e},e}function Z(){var e=_(["\n margin: 0;\n padding: ","px;\n background: ",";\n border-radius: 0 ","px ","px ","px;\n "]);return Z=function(){return e},e}var J=["id","description","categories"];function Y(e){var t=e.notices;if(!t.length)return null;var n=function(e){switch(e){case"error":return s().createElement(r.CloseCircleOutlined,null);case"info":return s().createElement(r.InfoCircleOutlined,null);case"success":return s().createElement(r.CheckCircleOutlined,null);default:return s().createElement(r.ExclamationCircleOutlined,null)}},o=function(e){switch(e){case"error":case"success":case"warning":return e;case"info":return"blue";default:return"warning"}};return s().createElement(s().Fragment,null,t.map(function(e,t){return s().createElement(u.Tooltip,{key:"".concat(e.key,"-").concat(t),title:e.description},s().createElement(u.Tag,{color:o(e.type),icon:n(e.type||"warning")},e.message))}))}function ee(e){var t=e.maxWidth,n=e.notices,r=e.title;return s().createElement("span",{style:{display:"inline-block",width:"max-content",maxWidth:t,overflowWrap:"anywhere",whiteSpace:"normal",wordBreak:"break-word"}},r,n.length?s().createElement("span",{style:{display:"inline-flex",flexWrap:"wrap",gap:"4px 8px",marginInlineStart:8}},s().createElement(Y,{notices:n})):null)}function et(e){var t=e.record,n=e.resource,r=e.onChanged,o=(0,y.ec)().t,l=u.App.useApp().message,a=$((0,c.useState)(!1),2),d=a[0],f=a[1],m=(0,i.useMemoizedFn)(function(e){return G(function(){return X(this,function(a){switch(a.label){case 0:if((null==t?void 0:t.id)==null)return[2];f(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,n.update({filterByTk:t.id,values:{enabled:e}})];case 2:return a.sent(),setTimeout(function(){return r()},0),[3,5];case 3:return a.sent(),l.error(o("Operation failed")),[3,5];case 4:return f(!1),[7];case 5:return[2]}})})()});return s().createElement(u.Switch,{checked:!!(null==t?void 0:t.enabled),size:"small",disabled:d,loading:d,onClick:function(e,t){var n;return null==t||null==(n=t.stopPropagation)?void 0:n.call(t)},onChange:m})}function en(e){var t=e.record,n=e.resource,r=e.onSubmitted,l=(0,y.ec)().t,a=$(u.Form.useForm(),1)[0],d=$((0,c.useState)(!1),2),f=d[0],m=d[1],p=(0,i.useMemoizedFn)(function(){return G(function(){var e;return X(this,function(o){switch(o.label){case 0:return[4,a.validateFields()];case 1:e=o.sent(),m(!0),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,n.revision({filterByTk:t.id,values:e})];case 3:return o.sent(),r(),[3,5];case 4:return m(!1),[7];case 5:return[2]}})})()});return s().createElement(o.DialogFormLayout,{title:l("Duplicate to new workflow"),onSubmit:p,submitting:f,submitText:l("Submit"),cancelText:l("Cancel")},s().createElement(u.Form,{form:a,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:l("Title")},s().createElement(u.Input,null))))}function er(){var e,t=(0,y.ec)().t,n=(0,y.kj)(),d=(0,a.useFlowContext)(),g=(0,p.TD)().getWorkflowCanvasPath,h=u.theme.useToken().token,w=h.screenXS-3*h.paddingXL,E=w+2*h.padding,S=u.App.useApp(),k=S.modal,C=S.message,x=d.api.resource("workflows"),F=d.app.pm.get(b.A),O=(0,l.css)(H(),h.colorBgLayout),T=(0,l.css)(Q(),h.colorBgLayout),I=(0,l.css)(Z(),h.paddingLG,h.colorBgContainer,h.borderRadiusLG,h.borderRadiusLG,h.borderRadiusLG),j=(0,c.useMemo)(function(){var e,t,n,r;return null==(r=d.dataSourceManager)||null==(n=r.getDataSource)||null==(t=n.call(r,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"workflows")},[d]),M=$((0,c.useState)("all"),2),P=M[0],z=M[1],D=$((0,c.useState)(1),2),L=D[0],B=D[1],W=$((0,c.useState)(o.DEFAULT_PAGE_SIZE),2),N=W[0],q=W[1],V=$((0,c.useState)([]),2),_=V[0],U=V[1],Y=$((0,c.useState)(void 0),2),er=Y[0],eo=Y[1],el=$((0,c.useState)({}),2),ea=el[0],ei=el[1],eu=(0,i.useMemoizedFn)(function(e){eo(e),B(1)}),ec=(0,i.useRequest)(function(){return G(function(){var e,t,n;return X(this,function(r){switch(r.label){case 0:return[4,d.api.resource("workflowCategories").list({paginate:!1,sort:["sort"]})];case 1:return[2,null!=(e=null==(n=r.sent())||null==(t=n.data)?void 0:t.data)?e:[]]}})})()}),es=ec.data,ed=ec.refresh,ef=(0,c.useMemo)(function(){return es||[]},[es]),em=(0,c.useMemo)(function(){return ef.map(function(e){var t;return{value:e.id,label:n(null!=(t=e.title)?t:"")}})},[ef,n]),ep=(0,i.useRequest)(function(){return G(function(){var e,t;return X(this,function(n){switch(n.label){case 0:return e={current:!0},"all"!==P&&(e["categories.id"]=P),t=er?{$and:[e,er]}:e,[4,x.list({page:L,pageSize:N,sort:["-createdAt"],appends:["categories","stats"],except:["config"],filter:t})];case 1:var r,o,l,a,i;return[2,{records:a=Array.isArray(l=null==(o=null==(r=n.sent())?void 0:r.data)?void 0:o.data)?l:Array.isArray(null==l?void 0:l.data)?l.data:[],total:(i=(null==o?void 0:o.meta)||(null==l?void 0:l.meta)||{}).count||i.total||a.length}]}})})()},{refreshDeps:[L,N,P,er]}),ey=ep.data,eb=ep.loading,ev=ep.refresh,eg=(0,c.useMemo)(function(){return(null==ey?void 0:ey.records)||[]},[null==ey?void 0:ey.records]);(0,c.useEffect)(function(){var e=!1;return G(function(){var t;return X(this,function(n){switch(n.label){case 0:if(!eg.length)return ei({}),[2];return ei({}),[4,F.loadWorkflowListNotices({api:d.api,surface:"workflow-list-row",workflows:eg})];case 1:return t=n.sent(),e||ei(t),[2]}})})().catch(function(){e||ei({})}),function(){e=!0}},[d.api,F,eg]);var eh=(0,i.useMemoizedFn)(function(e,t){if(t!==N){q(t),B(1);return}B(e)}),ew=(0,i.useMemoizedFn)(function(e){var t=e?F.getTriggerOptions(e):void 0;return(null==t?void 0:t.title)?n(t.title):e}),eE=(0,i.useMemoizedFn)(function(e,t){d.viewer.drawer({width:"50%",closable:!0,content:function(){return s().createElement(R,{mode:e,plugin:F,record:t,categoryOptions:em,onSubmitted:function(){return ev()}})}})}),eS=(0,i.useMemoizedFn)(function(e){d.viewer.dialog({width:520,closable:!0,content:function(){return s().createElement(en,{record:e,resource:x,onSubmitted:function(){return ev()}})}})}),ek=(0,i.useMemoizedFn)(function(e){d.router.navigate(g(e.id))}),eC=(0,i.useMemoizedFn)(function(e){d.viewer.drawer({width:"60%",closable:!0,title:t("Execution history"),content:function(){return s().createElement(v.S,{workflowKey:e.key})}})}),ex=(0,i.useMemoizedFn)(function(e){k.confirm({title:t("Delete record"),content:t("Are you sure you want to delete it?"),onOk:function(){return G(function(){return X(this,function(t){switch(t.label){case 0:return[4,x.destroy({filterByTk:e})];case 1:return t.sent(),U([]),ev(),[2]}})})()}})}),eF=(0,i.useMemoizedFn)(function(){return G(function(){return X(this,function(e){switch(e.label){case 0:return[4,x.sync()];case 1:return e.sent(),C.success(t("Operation succeeded")),ev(),[2]}})})()}),eA=!!((null==(e=d.app)?void 0:e.name)&&"main"!==d.app.name||d.app.pm.get("multi-app-share-collection")),eO=(0,c.useMemo)(function(){return[{title:t("Title"),dataIndex:"title",width:1,onHeaderCell:function(){return{style:{maxWidth:E,whiteSpace:"nowrap"}}},onCell:function(){return{style:{maxWidth:E,overflowWrap:"anywhere",whiteSpace:"normal",wordBreak:"break-word"}}},render:function(e,t){var n=F.getWorkflowNotices({surface:"workflow-list-row",workflow:t}),r=ea[String(t.id)]||[],o=K(n).concat(K(r));return s().createElement(ee,{title:e,notices:o,maxWidth:w})}},{title:t("Category"),dataIndex:"categories",render:function(e){return s().createElement(u.Space,{size:[0,4],wrap:!0},(null!=e?e:[]).map(function(e){return s().createElement(u.Tag,{key:e.id,color:"default"===e.color?void 0:e.color},n(e.title))}))}},{title:t("Trigger type"),dataIndex:"type",render:function(e){return e?s().createElement(u.Tag,{color:"gold"},ew(e)):null}},{title:t("Execute mode"),dataIndex:"sync",width:140,render:function(e){return s().createElement(m.t,{value:e})}},{title:t("Enabled"),dataIndex:"enabled",width:100,render:function(e,t){return s().createElement(et,{record:t,resource:x,onChanged:ev})}},{title:t("Executed"),dataIndex:["stats","executed"],width:100,render:function(e,t){var n,r;return s().createElement("a",{"aria-label":"executed-".concat(t.title),onClick:function(){return eC(t)}},null!=(n=null==(r=t.stats)?void 0:r.executed)?n:0)}},{title:t("Actions"),width:260,render:function(e,n){return s().createElement(u.Space,{size:"middle",wrap:!1,style:{whiteSpace:"nowrap"}},s().createElement("a",{onClick:function(){return ek(n)}},t("Configure")),s().createElement("a",{onClick:function(){return eE("edit",n)}},t("Edit")),s().createElement("a",{onClick:function(){return eS(n)}},t("Duplicate")),s().createElement("a",{onClick:function(){return ex(n.id)}},t("Delete")))}}]},[ex,ek,eS,eC,eE,F,ev,x,t,ew,E,w,ea]);return s().createElement("div",{className:O},s().createElement(A,{className:T,activeKey:P,onChange:function(e){z(e),B(1)},categories:ef,refreshCategories:ed}),s().createElement("div",{className:I},s().createElement(u.Flex,{justify:"space-between",align:"center",style:{marginBottom:h.margin}},s().createElement(o.CollectionFilter,{collection:j,defaultValue:f.d,nonfilterableFieldNames:J,onChange:eu,t:n}),s().createElement(u.Space,null,s().createElement(u.Button,{icon:s().createElement(r.ReloadOutlined,null),onClick:function(){return ev()}},t("Refresh")),eA?s().createElement(u.Tooltip,{title:t("Sync enabled status of all workflows from database")},s().createElement(u.Button,{icon:s().createElement(r.SyncOutlined,null),onClick:eF},t("Sync"))):null,s().createElement(u.Button,{icon:s().createElement(r.DeleteOutlined,null),disabled:!_.length,onClick:function(){return ex(_)}},t("Delete")),s().createElement(u.Button,{type:"primary",icon:s().createElement(r.PlusOutlined,null),onClick:function(){return eE("create")}},t("Add new")))),s().createElement(o.Table,{rowKey:"id",loading:eb,columns:eO,dataSource:(null==ey?void 0:ey.records)||[],rowSelection:{selectedRowKeys:_,onChange:U},pagination:{current:L,pageSize:N,total:(null==ey?void 0:ey.total)||0,onChange:eh},tableLayout:"auto"})))}function eo(){var e=(0,y.kj)(),t=(0,a.useFlowContext)().app.pm.get(b.A),n=(0,c.useMemo)(function(){var n=Array.from(t.triggers.getEntities()).map(function(t){var n=$(t,2),r=n[0],o=n[1];return{value:r,label:(null==o?void 0:o.title)?e(o.title):String(r)}}).sort(function(e,t){return String(e.label).localeCompare(String(t.label))});return[V(q({},d.A),{hidden:!0,fields:d.A.fields.map(function(e){return(null==e?void 0:e.name)==="type"&&e.uiSchema?V(q({},e),{uiSchema:V(q({},e.uiSchema),{enum:n})}):e})})]},[t,e]);return s().createElement(o.ExtendCollectionsProvider,{collections:n},s().createElement(er,null))}},7541:function(e,t,n){n.d(t,{d:function(){return r}});var r={$and:[{title:{$includes:""}},{type:{$eq:void 0}}]}}}]);