@nocobase/plugin-workflow-request-interceptor 2.0.3
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.
- package/LICENSE +201 -0
- package/README.md +99 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/RequestInterceptionTrigger.d.ts +172 -0
- package/dist/client/index.d.ts +13 -0
- package/dist/client/index.js +10 -0
- package/dist/common/constants.d.ts +14 -0
- package/dist/common/constants.js +41 -0
- package/dist/externalVersion.js +20 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +42 -0
- package/dist/locale/de-DE.json +24 -0
- package/dist/locale/en-US.json +24 -0
- package/dist/locale/es-ES.json +24 -0
- package/dist/locale/fr-FR.json +24 -0
- package/dist/locale/hu-HU.json +24 -0
- package/dist/locale/id-ID.json +24 -0
- package/dist/locale/index.d.ts +10 -0
- package/dist/locale/index.js +42 -0
- package/dist/locale/it-IT.json +24 -0
- package/dist/locale/ja-JP.json +24 -0
- package/dist/locale/ko-KR.json +24 -0
- package/dist/locale/nl-NL.json +24 -0
- package/dist/locale/pt-BR.json +24 -0
- package/dist/locale/ru-RU.json +24 -0
- package/dist/locale/tr-TR.json +24 -0
- package/dist/locale/uk-UA.json +24 -0
- package/dist/locale/vi-VN.json +24 -0
- package/dist/locale/zh-CN.json +24 -0
- package/dist/locale/zh-TW.json +24 -0
- package/dist/server/Plugin.d.ts +13 -0
- package/dist/server/Plugin.js +56 -0
- package/dist/server/RequestInterceptionTrigger.d.ts +23 -0
- package/dist/server/RequestInterceptionTrigger.js +218 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +42 -0
- package/package.json +32 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var Plugin_exports = {};
|
|
38
|
+
__export(Plugin_exports, {
|
|
39
|
+
PluginWorkflowRequestInterceptorServer: () => PluginWorkflowRequestInterceptorServer,
|
|
40
|
+
default: () => Plugin_default
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(Plugin_exports);
|
|
43
|
+
var import_server = require("@nocobase/server");
|
|
44
|
+
var import_plugin_workflow = __toESM(require("@nocobase/plugin-workflow"));
|
|
45
|
+
var import_RequestInterceptionTrigger = __toESM(require("./RequestInterceptionTrigger"));
|
|
46
|
+
class PluginWorkflowRequestInterceptorServer extends import_server.Plugin {
|
|
47
|
+
async load() {
|
|
48
|
+
const workflowPlugin = this.app.pm.get(import_plugin_workflow.default);
|
|
49
|
+
workflowPlugin.registerTrigger("request-interception", import_RequestInterceptionTrigger.default);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var Plugin_default = PluginWorkflowRequestInterceptorServer;
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
PluginWorkflowRequestInterceptorServer
|
|
56
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { EventOptions, Trigger, WorkflowModel } from '@nocobase/plugin-workflow';
|
|
10
|
+
export default class RequestInterceptionTrigger extends Trigger {
|
|
11
|
+
static TYPE: string;
|
|
12
|
+
sync: boolean;
|
|
13
|
+
middleware: (context: any, next: any) => Promise<any>;
|
|
14
|
+
constructor(workflow: any);
|
|
15
|
+
validateContext(values: any): {
|
|
16
|
+
target: string;
|
|
17
|
+
userId?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
userId: string;
|
|
20
|
+
target?: undefined;
|
|
21
|
+
};
|
|
22
|
+
execute(workflow: WorkflowModel, values: any, options: EventOptions): Promise<void | import("@nocobase/plugin-workflow").Processor>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var RequestInterceptionTrigger_exports = {};
|
|
38
|
+
__export(RequestInterceptionTrigger_exports, {
|
|
39
|
+
default: () => RequestInterceptionTrigger
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(RequestInterceptionTrigger_exports);
|
|
42
|
+
var import_lodash = require("lodash");
|
|
43
|
+
var import_plugin_error_handler = __toESM(require("@nocobase/plugin-error-handler"));
|
|
44
|
+
var import_plugin_workflow = require("@nocobase/plugin-workflow");
|
|
45
|
+
var import_data_source_manager = require("@nocobase/data-source-manager");
|
|
46
|
+
var import_constants = require("../common/constants");
|
|
47
|
+
class RequestInterceptionError extends Error {
|
|
48
|
+
status = 400;
|
|
49
|
+
messages = [];
|
|
50
|
+
constructor(message) {
|
|
51
|
+
super(message);
|
|
52
|
+
this.name = "RequestInterceptionError";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class RequestInterceptionTrigger extends import_plugin_workflow.Trigger {
|
|
56
|
+
static TYPE = "request-interception";
|
|
57
|
+
sync = true;
|
|
58
|
+
middleware = async (context, next) => {
|
|
59
|
+
const {
|
|
60
|
+
resourceName,
|
|
61
|
+
actionName,
|
|
62
|
+
params: { filterByTk, filter, values, triggerWorkflows = "" }
|
|
63
|
+
} = context.action;
|
|
64
|
+
const dataSourceHeader = context.get("x-data-source") || "main";
|
|
65
|
+
const dataSource = context.app.dataSourceManager.dataSources.get(dataSourceHeader);
|
|
66
|
+
if (!dataSource) {
|
|
67
|
+
context.logger.warn(`[Workflow pre-action]: data source "${dataSourceHeader}" not found`);
|
|
68
|
+
return next();
|
|
69
|
+
}
|
|
70
|
+
const collection = dataSource.collectionManager.getCollection(resourceName);
|
|
71
|
+
if (!collection) {
|
|
72
|
+
context.logger.warn(`[Workflow pre-action]: collection "${resourceName}" not found`);
|
|
73
|
+
return next();
|
|
74
|
+
}
|
|
75
|
+
const fullCollectionName = (0, import_data_source_manager.joinCollectionName)(dataSourceHeader, collection.name);
|
|
76
|
+
const triggerWorkflowsMap = /* @__PURE__ */ new Map();
|
|
77
|
+
const triggerWorkflowsArray = [];
|
|
78
|
+
for (const trigger of triggerWorkflows.split(",")) {
|
|
79
|
+
const [key, path] = trigger.split("!");
|
|
80
|
+
triggerWorkflowsMap.set(key, path);
|
|
81
|
+
triggerWorkflowsArray.push(key);
|
|
82
|
+
}
|
|
83
|
+
const workflows = Array.from(this.workflow.enabledCache.values()).filter(
|
|
84
|
+
(item) => item.type === this.constructor.TYPE && item.config.collection === fullCollectionName
|
|
85
|
+
);
|
|
86
|
+
const globalWorkflows = workflows.filter((item) => {
|
|
87
|
+
var _a;
|
|
88
|
+
return item.config.global && ((_a = item.config.actions) == null ? void 0 : _a.includes(actionName));
|
|
89
|
+
}).sort((a, b) => a.id - b.id);
|
|
90
|
+
const localWorkflows = workflows.filter((item) => !item.config.global).sort((a, b) => {
|
|
91
|
+
const aIndex = triggerWorkflowsArray.indexOf(a.key);
|
|
92
|
+
const bIndex = triggerWorkflowsArray.indexOf(b.key);
|
|
93
|
+
if (aIndex === -1 && bIndex === -1) {
|
|
94
|
+
return a.id - b.id;
|
|
95
|
+
}
|
|
96
|
+
if (aIndex === -1) {
|
|
97
|
+
return 1;
|
|
98
|
+
}
|
|
99
|
+
if (bIndex === -1) {
|
|
100
|
+
return -1;
|
|
101
|
+
}
|
|
102
|
+
return aIndex - bIndex;
|
|
103
|
+
});
|
|
104
|
+
for (const workflow of localWorkflows.concat(globalWorkflows)) {
|
|
105
|
+
if (!workflow.config.global && !triggerWorkflowsMap.has(workflow.key)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const processor = await this.workflow.trigger(
|
|
109
|
+
workflow,
|
|
110
|
+
{
|
|
111
|
+
user: context.state.currentUser,
|
|
112
|
+
roleName: context.state.currentRole,
|
|
113
|
+
params: {
|
|
114
|
+
filterByTk,
|
|
115
|
+
filter,
|
|
116
|
+
values
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{ httpContext: context }
|
|
120
|
+
);
|
|
121
|
+
if (!processor) {
|
|
122
|
+
return context.throw(500);
|
|
123
|
+
}
|
|
124
|
+
const { lastSavedJob, nodesMap } = processor;
|
|
125
|
+
const lastNode = nodesMap.get(lastSavedJob == null ? void 0 : lastSavedJob.nodeId);
|
|
126
|
+
if (processor.execution.status === import_plugin_workflow.EXECUTION_STATUS.RESOLVED) {
|
|
127
|
+
if ((lastNode == null ? void 0 : lastNode.type) === "end") {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (processor.execution.status < import_plugin_workflow.EXECUTION_STATUS.STARTED) {
|
|
133
|
+
if ((lastNode == null ? void 0 : lastNode.type) !== "end") {
|
|
134
|
+
return context.throw(500, "Workflow on your action failed, please contact the administrator");
|
|
135
|
+
}
|
|
136
|
+
const err = new RequestInterceptionError("Request is intercepted by workflow");
|
|
137
|
+
err.status = 400;
|
|
138
|
+
err.messages = context.state.messages;
|
|
139
|
+
return context.throw(err.status, err);
|
|
140
|
+
}
|
|
141
|
+
return context.throw(500, "Workflow on your action hangs, please contact the administrator");
|
|
142
|
+
}
|
|
143
|
+
await next();
|
|
144
|
+
};
|
|
145
|
+
constructor(workflow) {
|
|
146
|
+
super(workflow);
|
|
147
|
+
workflow.app.dataSourceManager.use(this.middleware);
|
|
148
|
+
workflow.app.pm.get(import_plugin_error_handler.default).errorHandler.register(
|
|
149
|
+
(err) => err instanceof RequestInterceptionError || err.name === "RequestInterceptionError",
|
|
150
|
+
async (err, ctx, next) => {
|
|
151
|
+
ctx.body = {
|
|
152
|
+
errors: err.messages
|
|
153
|
+
};
|
|
154
|
+
ctx.status = err.status;
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
validateContext(values) {
|
|
159
|
+
if (!values.target) {
|
|
160
|
+
return {
|
|
161
|
+
target: "Target data or key is required"
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (!values.userId) {
|
|
165
|
+
return {
|
|
166
|
+
userId: "UserId is required"
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
async execute(workflow, values, options) {
|
|
172
|
+
var _a;
|
|
173
|
+
const [dataSourceName, collectionName] = (0, import_data_source_manager.parseCollectionName)(workflow.config.collection);
|
|
174
|
+
const dataSource = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName);
|
|
175
|
+
if (!dataSource) {
|
|
176
|
+
throw new Error(`Data source ${dataSourceName} not found`);
|
|
177
|
+
}
|
|
178
|
+
const collection = dataSource.collectionManager.getCollection(collectionName);
|
|
179
|
+
if (!collection) {
|
|
180
|
+
throw new Error(`Collection ${collectionName} not found`);
|
|
181
|
+
}
|
|
182
|
+
const { filterTargetKey, repository } = collection;
|
|
183
|
+
let { target } = values;
|
|
184
|
+
let filterByTk;
|
|
185
|
+
let loadNeeded = false;
|
|
186
|
+
if (target && typeof target === "object") {
|
|
187
|
+
filterByTk = Array.isArray(filterTargetKey) ? (0, import_lodash.pick)(target, filterTargetKey) : target[filterTargetKey];
|
|
188
|
+
} else {
|
|
189
|
+
filterByTk = target;
|
|
190
|
+
loadNeeded = true;
|
|
191
|
+
}
|
|
192
|
+
if (loadNeeded) {
|
|
193
|
+
target = await repository.findOne({
|
|
194
|
+
filterByTk
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
const params = values.action === import_constants.INTERCEPTABLE_ACTIONS.DESTROY ? { filterByTk } : { values: target };
|
|
198
|
+
const UserRepo = this.workflow.app.db.getRepository("users");
|
|
199
|
+
const actor = await UserRepo.findOne({
|
|
200
|
+
filterByTk: values.userId,
|
|
201
|
+
appends: ["roles"]
|
|
202
|
+
});
|
|
203
|
+
if (!actor) {
|
|
204
|
+
throw new Error("user not found");
|
|
205
|
+
}
|
|
206
|
+
const { roles, ...user } = actor.desensitize().get();
|
|
207
|
+
const roleName = values.roleName || ((_a = roles == null ? void 0 : roles[0]) == null ? void 0 : _a.name);
|
|
208
|
+
return this.workflow.trigger(
|
|
209
|
+
workflow,
|
|
210
|
+
{
|
|
211
|
+
params,
|
|
212
|
+
user,
|
|
213
|
+
roleName
|
|
214
|
+
},
|
|
215
|
+
options
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 program is offered under a commercial license.
|
|
7
|
+
* For more information, see <https://www.nocobase.com/agreement>
|
|
8
|
+
*/
|
|
9
|
+
export { default } from './Plugin';
|
|
@@ -0,0 +1,42 @@
|
|
|
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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var server_exports = {};
|
|
38
|
+
__export(server_exports, {
|
|
39
|
+
default: () => import_Plugin.default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(server_exports);
|
|
42
|
+
var import_Plugin = __toESM(require("./Plugin"));
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nocobase/plugin-workflow-request-interceptor",
|
|
3
|
+
"version": "2.0.3",
|
|
4
|
+
"displayName": "Workflow: Pre-action event",
|
|
5
|
+
"displayName.zh-CN": "工作流:操作前事件",
|
|
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.",
|
|
7
|
+
"description.zh-CN": "通过操作按钮或 API 发起请求并在执行前触发,比如新增、更新、删除数据之前。适用于在操作前进行数据验证、逻辑判断,并可通过“结束节点”来拦截请求。",
|
|
8
|
+
"main": "./dist/server/index.js",
|
|
9
|
+
"homepage": "https://docs.nocobase.com/handbook/workflow-request-interceptor",
|
|
10
|
+
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow-request-interceptor",
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@nocobase/client": "2.x",
|
|
13
|
+
"@nocobase/plugin-error-handler": "2.x",
|
|
14
|
+
"@nocobase/plugin-users": "2.x",
|
|
15
|
+
"@nocobase/plugin-workflow": ">= 0.19.0-alpha.3",
|
|
16
|
+
"@nocobase/server": "2.x",
|
|
17
|
+
"@nocobase/test": "2.x",
|
|
18
|
+
"@nocobase/utils": "2.x"
|
|
19
|
+
},
|
|
20
|
+
"nocobase": {
|
|
21
|
+
"supportedVersions": [
|
|
22
|
+
"1.x",
|
|
23
|
+
"2.x"
|
|
24
|
+
],
|
|
25
|
+
"editionLevel": 0
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"Workflow"
|
|
29
|
+
],
|
|
30
|
+
"gitHead": "5bcb42fc092f85adb9511c1a351b388bd7aaf66e",
|
|
31
|
+
"license": "Apache-2.0"
|
|
32
|
+
}
|
package/server.d.ts
ADDED
package/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/server/index.js');
|