@nocobase/plugin-workflow-request-interceptor 2.1.0-alpha.12 → 2.1.0-alpha.13

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.
@@ -8,13 +8,13 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.12",
12
- "@nocobase/plugin-workflow": "2.1.0-alpha.12",
11
+ "@nocobase/client": "2.1.0-alpha.13",
12
+ "@nocobase/plugin-workflow": "2.1.0-alpha.13",
13
13
  "@formily/react": "2.3.7",
14
14
  "react": "18.2.0",
15
- "@nocobase/flow-engine": "2.1.0-alpha.12",
16
- "@nocobase/server": "2.1.0-alpha.12",
15
+ "@nocobase/flow-engine": "2.1.0-alpha.13",
16
+ "@nocobase/server": "2.1.0-alpha.13",
17
17
  "lodash": "4.17.21",
18
- "@nocobase/plugin-error-handler": "2.1.0-alpha.12",
19
- "@nocobase/data-source-manager": "2.1.0-alpha.12"
18
+ "@nocobase/plugin-error-handler": "2.1.0-alpha.13",
19
+ "@nocobase/data-source-manager": "2.1.0-alpha.13"
20
20
  };
@@ -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-03-25T14:13:24.016Z"}
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-03-27T05:56:20.460Z"}
@@ -56,7 +56,20 @@ class RequestInterceptionError extends Error {
56
56
  class RequestInterceptionTrigger extends import_plugin_workflow.Trigger {
57
57
  static TYPE = "request-interception";
58
58
  configSchema = import_joi.default.object({
59
- collection: import_joi.default.string().required()
59
+ collection: import_joi.default.string().required(),
60
+ global: import_joi.default.boolean().optional(),
61
+ actions: import_joi.default.when("global", {
62
+ is: true,
63
+ then: import_joi.default.array().items(
64
+ import_joi.default.string().valid(
65
+ import_constants.INTERCEPTABLE_ACTIONS.CREATE,
66
+ import_constants.INTERCEPTABLE_ACTIONS.UPDATE,
67
+ import_constants.INTERCEPTABLE_ACTIONS.UPSERT,
68
+ import_constants.INTERCEPTABLE_ACTIONS.DESTROY
69
+ )
70
+ ).min(1).required().messages({ "array.min": "At least one action is required in global mode" }),
71
+ otherwise: import_joi.default.array().items(import_joi.default.string()).optional()
72
+ })
60
73
  });
61
74
  validateConfig(config) {
62
75
  const errors = super.validateConfig(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-workflow-request-interceptor",
3
- "version": "2.1.0-alpha.12",
3
+ "version": "2.1.0-alpha.13",
4
4
  "displayName": "Workflow: Pre-action event",
5
5
  "displayName.zh-CN": "工作流:操作前事件",
6
6
  "description": "Triggered before the execution of a request initiated through an action button or API, such as before adding, updating, or deleting data. Suitable for data validation and logic judgment before action, and the request could be rejected by using the \"End process\" node.",
@@ -30,6 +30,6 @@
30
30
  "keywords": [
31
31
  "Workflow"
32
32
  ],
33
- "gitHead": "f12c4a75470590b1670ce54510b96ef94c2cd7a2",
33
+ "gitHead": "2807a8948412d9c235115a31a81a66f7c82dd173",
34
34
  "license": "Apache-2.0"
35
35
  }