@nocobase/plugin-flow-engine 2.1.0-beta.10 → 2.1.0-beta.12
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/dist/externalVersion.js +10 -10
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +7 -2
- package/dist/server/plugin.d.ts +0 -1
- package/dist/server/plugin.js +7 -34
- package/dist/server/repository.js +0 -5
- package/dist/server/variables/resolve.d.ts +21 -0
- package/dist/server/variables/resolve.js +79 -0
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.12",
|
|
12
12
|
"lodash": "4.17.21",
|
|
13
|
-
"@nocobase/database": "2.1.0-beta.
|
|
14
|
-
"@nocobase/data-source-manager": "2.1.0-beta.
|
|
15
|
-
"@nocobase/resourcer": "2.1.0-beta.
|
|
16
|
-
"@nocobase/
|
|
17
|
-
"@nocobase/
|
|
18
|
-
"@nocobase/
|
|
19
|
-
"@nocobase/
|
|
20
|
-
"@nocobase/ai": "2.1.0-beta.
|
|
21
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
13
|
+
"@nocobase/database": "2.1.0-beta.12",
|
|
14
|
+
"@nocobase/data-source-manager": "2.1.0-beta.12",
|
|
15
|
+
"@nocobase/resourcer": "2.1.0-beta.12",
|
|
16
|
+
"@nocobase/utils": "2.1.0-beta.12",
|
|
17
|
+
"@nocobase/cache": "2.1.0-beta.12",
|
|
18
|
+
"@nocobase/plugin-localization": "2.1.0-beta.12",
|
|
19
|
+
"@nocobase/server": "2.1.0-beta.12",
|
|
20
|
+
"@nocobase/ai": "2.1.0-beta.12",
|
|
21
|
+
"@nocobase/actions": "2.1.0-beta.12"
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ses","version":"1.14.0","description":"Hardened JavaScript for Fearless Cooperation","keywords":["lockdown","harden","Compartment","assert","security","confinement","isolation","object capabilities","ocaps","secure execution","third-party code","prototype pollution","supply-chain attack","plugin"],"author":"Agoric","license":"Apache-2.0","homepage":"https://github.com/Agoric/SES-shim/tree/master/packages/ses#readme","repository":{"type":"git","url":"git+https://github.com/endojs/endo.git","directory":"packages/ses"},"bugs":{"url":"https://github.com/endojs/endo/issues"},"type":"module","main":"./dist/ses.cjs","module":"./index.js","unpkg":"./dist/ses.umd.js","types":"./types.d.ts","exports":{".":{"import":{"types":"./types.d.ts","xs":"./src-xs/index.js","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./lockdown":{"import":{"types":"./types.d.ts","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./hermes":{"require":{"types":"./dist/types.d.cts","default":"./dist/ses-hermes.cjs"}},"./tools.js":"./tools.js","./assert-shim.js":"./assert-shim.js","./lockdown-shim.js":{"xs":"./src-xs/lockdown-shim.js","default":"./lockdown-shim.js"},"./compartment-shim.js":{"xs":"./src-xs/compartment-shim.js","default":"./compartment-shim.js"},"./console-shim.js":"./console-shim.js","./package.json":"./package.json"},"scripts":{"build:vanilla":"node scripts/bundle.js","build:hermes":"node scripts/bundle.js hermes","build":"yarn build:vanilla && yarn build:hermes","clean":"rm -rf dist","cover":"c8 ava","demo":"python3 -m http.server","lint":"yarn lint:types && yarn lint:eslint","lint-fix":"eslint --fix .","lint:eslint":"eslint .","lint:types":"tsc","prepare":"npm run clean && npm run build","qt":"ava","test":"tsd && ava","test:hermes":"./scripts/hermes-test.sh","test:xs":"xst dist/ses.umd.js test/_lockdown-safe.js && node scripts/generate-test-xs.js && xst tmp/test-xs.js && rm -rf tmp","postpack":"git clean -fX \"*.d.ts*\" \"*.d.cts*\" \"*.d.mts*\" \"*.tsbuildinfo\""},"dependencies":{"@endo/cache-map":"^1.1.0","@endo/env-options":"^1.1.11","@endo/immutable-arraybuffer":"^1.1.2"},"devDependencies":{"@babel/generator":"^7.26.3","@babel/parser":"~7.26.2","@babel/traverse":"~7.25.9","@babel/types":"~7.26.0","@endo/compartment-mapper":"^1.6.3","@endo/module-source":"^1.3.3","@endo/test262-runner":"^0.1.48","@types/babel__traverse":"^7.20.5","ava":"^6.1.3","babel-eslint":"^10.1.0","c8":"^7.14.0","core-js":"^3.31.0","eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.31.0","hermes-engine-cli":"^0.12.0","prettier":"^3.5.3","terser":"^5.16.6","tsd":"^0.31.2","typescript":"~5.8.3"},"files":["./*.d.ts","./*.js","./*.map","LICENSE*","SECURITY*","dist","lib","src","tools"],"publishConfig":{"access":"public"},"eslintConfig":{"extends":["plugin:@endo/ses"]},"ava":{"files":["test/**/*.test.*"],"timeout":"2m"},"typeCoverage":{"atLeast":81.17},"gitHead":"9815aea9541f241389d2135c6097a7442bdffa17","_lastModified":"2026-
|
|
1
|
+
{"name":"ses","version":"1.14.0","description":"Hardened JavaScript for Fearless Cooperation","keywords":["lockdown","harden","Compartment","assert","security","confinement","isolation","object capabilities","ocaps","secure execution","third-party code","prototype pollution","supply-chain attack","plugin"],"author":"Agoric","license":"Apache-2.0","homepage":"https://github.com/Agoric/SES-shim/tree/master/packages/ses#readme","repository":{"type":"git","url":"git+https://github.com/endojs/endo.git","directory":"packages/ses"},"bugs":{"url":"https://github.com/endojs/endo/issues"},"type":"module","main":"./dist/ses.cjs","module":"./index.js","unpkg":"./dist/ses.umd.js","types":"./types.d.ts","exports":{".":{"import":{"types":"./types.d.ts","xs":"./src-xs/index.js","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./lockdown":{"import":{"types":"./types.d.ts","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./hermes":{"require":{"types":"./dist/types.d.cts","default":"./dist/ses-hermes.cjs"}},"./tools.js":"./tools.js","./assert-shim.js":"./assert-shim.js","./lockdown-shim.js":{"xs":"./src-xs/lockdown-shim.js","default":"./lockdown-shim.js"},"./compartment-shim.js":{"xs":"./src-xs/compartment-shim.js","default":"./compartment-shim.js"},"./console-shim.js":"./console-shim.js","./package.json":"./package.json"},"scripts":{"build:vanilla":"node scripts/bundle.js","build:hermes":"node scripts/bundle.js hermes","build":"yarn build:vanilla && yarn build:hermes","clean":"rm -rf dist","cover":"c8 ava","demo":"python3 -m http.server","lint":"yarn lint:types && yarn lint:eslint","lint-fix":"eslint --fix .","lint:eslint":"eslint .","lint:types":"tsc","prepare":"npm run clean && npm run build","qt":"ava","test":"tsd && ava","test:hermes":"./scripts/hermes-test.sh","test:xs":"xst dist/ses.umd.js test/_lockdown-safe.js && node scripts/generate-test-xs.js && xst tmp/test-xs.js && rm -rf tmp","postpack":"git clean -fX \"*.d.ts*\" \"*.d.cts*\" \"*.d.mts*\" \"*.tsbuildinfo\""},"dependencies":{"@endo/cache-map":"^1.1.0","@endo/env-options":"^1.1.11","@endo/immutable-arraybuffer":"^1.1.2"},"devDependencies":{"@babel/generator":"^7.26.3","@babel/parser":"~7.26.2","@babel/traverse":"~7.25.9","@babel/types":"~7.26.0","@endo/compartment-mapper":"^1.6.3","@endo/module-source":"^1.3.3","@endo/test262-runner":"^0.1.48","@types/babel__traverse":"^7.20.5","ava":"^6.1.3","babel-eslint":"^10.1.0","c8":"^7.14.0","core-js":"^3.31.0","eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.31.0","hermes-engine-cli":"^0.12.0","prettier":"^3.5.3","terser":"^5.16.6","tsd":"^0.31.2","typescript":"~5.8.3"},"files":["./*.d.ts","./*.js","./*.map","LICENSE*","SECURITY*","dist","lib","src","tools"],"publishConfig":{"access":"public"},"eslintConfig":{"extends":["plugin:@endo/ses"]},"ava":{"files":["test/**/*.test.*"],"timeout":"2m"},"typeCoverage":{"atLeast":81.17},"gitHead":"9815aea9541f241389d2135c6097a7442bdffa17","_lastModified":"2026-04-08T08:15:40.312Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-
|
|
1
|
+
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-08T08:15:39.800Z"}
|
package/dist/server/index.d.ts
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -37,12 +37,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
37
37
|
var server_exports = {};
|
|
38
38
|
__export(server_exports, {
|
|
39
39
|
FlowModelRepository: () => import_repository.FlowModelRepository,
|
|
40
|
-
default: () => import_plugin.default
|
|
40
|
+
default: () => import_plugin.default,
|
|
41
|
+
resolveVariablesBatch: () => import_resolve.resolveVariablesBatch,
|
|
42
|
+
resolveVariablesTemplate: () => import_resolve.resolveVariablesTemplate
|
|
41
43
|
});
|
|
42
44
|
module.exports = __toCommonJS(server_exports);
|
|
43
45
|
var import_plugin = __toESM(require("./plugin"));
|
|
44
46
|
var import_repository = require("./repository");
|
|
47
|
+
var import_resolve = require("./variables/resolve");
|
|
45
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
49
|
0 && (module.exports = {
|
|
47
|
-
FlowModelRepository
|
|
50
|
+
FlowModelRepository,
|
|
51
|
+
resolveVariablesBatch,
|
|
52
|
+
resolveVariablesTemplate
|
|
48
53
|
});
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import PluginUISchemaStorageServer from './server';
|
|
10
10
|
export declare class PluginFlowEngineServer extends PluginUISchemaStorageServer {
|
|
11
|
-
private globalContext;
|
|
12
11
|
afterAdd(): Promise<void>;
|
|
13
12
|
beforeLoad(): Promise<void>;
|
|
14
13
|
getDatabaseByDataSourceKey(dataSourceKey?: string): import("@nocobase/database").default;
|
package/dist/server/plugin.js
CHANGED
|
@@ -41,13 +41,9 @@ __export(plugin_exports, {
|
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(plugin_exports);
|
|
43
43
|
var import_utils = require("@nocobase/utils");
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
var import_registry = require("./variables/registry");
|
|
48
|
-
var import_utils2 = require("./variables/utils");
|
|
49
|
-
class PluginFlowEngineServer extends import_server2.default {
|
|
50
|
-
globalContext;
|
|
44
|
+
var import_server = __toESM(require("./server"));
|
|
45
|
+
var import_resolve = require("./variables/resolve");
|
|
46
|
+
class PluginFlowEngineServer extends import_server.default {
|
|
51
47
|
async afterAdd() {
|
|
52
48
|
}
|
|
53
49
|
async beforeLoad() {
|
|
@@ -62,12 +58,10 @@ class PluginFlowEngineServer extends import_server2.default {
|
|
|
62
58
|
return cm.db;
|
|
63
59
|
}
|
|
64
60
|
async load() {
|
|
65
|
-
var _a, _b;
|
|
66
61
|
await super.load();
|
|
67
62
|
this.app.auditManager.registerAction("flowSql:save");
|
|
68
63
|
this.app.auditManager.registerAction("flowModels:save");
|
|
69
64
|
this.app.auditManager.registerAction("flowModels:duplicate");
|
|
70
|
-
this.globalContext = new import_contexts.GlobalContext((_b = (_a = this.app.environment) == null ? void 0 : _a.getVariables) == null ? void 0 : _b.call(_a));
|
|
71
65
|
this.app.acl.allow("flowSql", "runById", "loggedIn");
|
|
72
66
|
this.app.acl.allow("flowSql", "getBind", "loggedIn");
|
|
73
67
|
this.app.acl.allow("variables", "resolve", "loggedIn");
|
|
@@ -77,28 +71,12 @@ class PluginFlowEngineServer extends import_server2.default {
|
|
|
77
71
|
actions: {
|
|
78
72
|
// 解析 JSON 模板中的 ctx 变量
|
|
79
73
|
resolve: async (ctx, next) => {
|
|
80
|
-
var
|
|
81
|
-
const raw = ((
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const raw = ((_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values) ?? {};
|
|
82
76
|
const values = typeof (raw == null ? void 0 : raw.values) !== "undefined" ? raw.values : raw;
|
|
83
77
|
if (Array.isArray(values == null ? void 0 : values.batch)) {
|
|
84
78
|
const batchItems = values.batch;
|
|
85
|
-
await (0,
|
|
86
|
-
ctx,
|
|
87
|
-
batchItems.map((it) => ({
|
|
88
|
-
template: it.template,
|
|
89
|
-
contextParams: it.contextParams || {}
|
|
90
|
-
}))
|
|
91
|
-
);
|
|
92
|
-
const results = [];
|
|
93
|
-
for (const item of batchItems) {
|
|
94
|
-
const template2 = (item == null ? void 0 : item.template) ?? {};
|
|
95
|
-
const contextParams2 = (item == null ? void 0 : item.contextParams) || {};
|
|
96
|
-
const requestCtx2 = new import_contexts.HttpRequestContext(ctx);
|
|
97
|
-
requestCtx2.delegate(this.globalContext);
|
|
98
|
-
await import_registry.variables.attachUsedVariables(requestCtx2, ctx, template2, contextParams2);
|
|
99
|
-
const resolved2 = await (0, import_resolver.resolveJsonTemplate)(template2, requestCtx2);
|
|
100
|
-
results.push({ id: item == null ? void 0 : item.id, data: resolved2 });
|
|
101
|
-
}
|
|
79
|
+
const results = await (0, import_resolve.resolveVariablesBatch)(ctx, batchItems);
|
|
102
80
|
ctx.body = { results };
|
|
103
81
|
await next();
|
|
104
82
|
return;
|
|
@@ -111,12 +89,7 @@ class PluginFlowEngineServer extends import_server2.default {
|
|
|
111
89
|
}
|
|
112
90
|
const template = values.template;
|
|
113
91
|
const contextParams = (values == null ? void 0 : values.contextParams) || {};
|
|
114
|
-
await (0,
|
|
115
|
-
const requestCtx = new import_contexts.HttpRequestContext(ctx);
|
|
116
|
-
requestCtx.delegate(this.globalContext);
|
|
117
|
-
await import_registry.variables.attachUsedVariables(requestCtx, ctx, template, contextParams);
|
|
118
|
-
const resolved = await (0, import_resolver.resolveJsonTemplate)(template, requestCtx);
|
|
119
|
-
ctx.body = resolved;
|
|
92
|
+
ctx.body = await (0, import_resolve.resolveVariablesTemplate)(ctx, template, contextParams);
|
|
120
93
|
await next();
|
|
121
94
|
}
|
|
122
95
|
}
|
|
@@ -793,11 +793,6 @@ WHERE TreeTable.depth = 1 AND TreeTable.ancestor = :ancestor and TreeTable.sort
|
|
|
793
793
|
transaction: transaction2
|
|
794
794
|
});
|
|
795
795
|
if (oldParentUid !== null && oldParentUid !== parentUid) {
|
|
796
|
-
await this.database.emitAsync("uiSchemaMove", savedNode, {
|
|
797
|
-
transaction: transaction2,
|
|
798
|
-
oldParentUid,
|
|
799
|
-
parentUid
|
|
800
|
-
});
|
|
801
796
|
if (options.removeParentsIfNoChildren) {
|
|
802
797
|
await this.recursivelyRemoveIfNoChildren({
|
|
803
798
|
transaction: transaction2,
|
|
@@ -0,0 +1,21 @@
|
|
|
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 type { ResourcerContext } from '@nocobase/resourcer';
|
|
10
|
+
import { JSONValue } from '../template/resolver';
|
|
11
|
+
type ResolveBatchItem = {
|
|
12
|
+
id?: string | number;
|
|
13
|
+
template: JSONValue;
|
|
14
|
+
contextParams?: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
export declare function resolveVariablesTemplate(ctx: ResourcerContext, template: JSONValue, contextParams?: Record<string, unknown>): Promise<any>;
|
|
17
|
+
export declare function resolveVariablesBatch(ctx: ResourcerContext, items: ResolveBatchItem[]): Promise<{
|
|
18
|
+
id?: string | number;
|
|
19
|
+
data: unknown;
|
|
20
|
+
}[]>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
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 resolve_exports = {};
|
|
28
|
+
__export(resolve_exports, {
|
|
29
|
+
resolveVariablesBatch: () => resolveVariablesBatch,
|
|
30
|
+
resolveVariablesTemplate: () => resolveVariablesTemplate
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(resolve_exports);
|
|
33
|
+
var import_contexts = require("../template/contexts");
|
|
34
|
+
var import_resolver = require("../template/resolver");
|
|
35
|
+
var import_registry = require("./registry");
|
|
36
|
+
var import_utils = require("./utils");
|
|
37
|
+
const GLOBAL_CONTEXT_KEY = Symbol.for("nocobase.flow-engine.variables.global-context");
|
|
38
|
+
function getGlobalContext(ctx) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const app = ctx.app;
|
|
41
|
+
if (!app[GLOBAL_CONTEXT_KEY]) {
|
|
42
|
+
app[GLOBAL_CONTEXT_KEY] = new import_contexts.GlobalContext((_b = (_a = app.environment) == null ? void 0 : _a.getVariables) == null ? void 0 : _b.call(_a));
|
|
43
|
+
}
|
|
44
|
+
return app[GLOBAL_CONTEXT_KEY];
|
|
45
|
+
}
|
|
46
|
+
async function resolveVariablesTemplate(ctx, template, contextParams = {}) {
|
|
47
|
+
await (0, import_utils.prefetchRecordsForResolve)(ctx, [{ template, contextParams }]);
|
|
48
|
+
return resolveVariablesTemplateWithPrefetchedRecords(ctx, template, contextParams);
|
|
49
|
+
}
|
|
50
|
+
async function resolveVariablesTemplateWithPrefetchedRecords(ctx, template, contextParams = {}) {
|
|
51
|
+
const requestCtx = new import_contexts.HttpRequestContext(ctx);
|
|
52
|
+
requestCtx.delegate(getGlobalContext(ctx));
|
|
53
|
+
await import_registry.variables.attachUsedVariables(requestCtx, ctx, template, contextParams);
|
|
54
|
+
return (0, import_resolver.resolveJsonTemplate)(template, requestCtx);
|
|
55
|
+
}
|
|
56
|
+
async function resolveVariablesBatch(ctx, items) {
|
|
57
|
+
await (0, import_utils.prefetchRecordsForResolve)(
|
|
58
|
+
ctx,
|
|
59
|
+
items.map((item) => ({
|
|
60
|
+
template: (item == null ? void 0 : item.template) ?? {},
|
|
61
|
+
contextParams: (item == null ? void 0 : item.contextParams) || {}
|
|
62
|
+
}))
|
|
63
|
+
);
|
|
64
|
+
const results = [];
|
|
65
|
+
for (const item of items) {
|
|
66
|
+
const data = await resolveVariablesTemplateWithPrefetchedRecords(
|
|
67
|
+
ctx,
|
|
68
|
+
(item == null ? void 0 : item.template) ?? {},
|
|
69
|
+
(item == null ? void 0 : item.contextParams) || {}
|
|
70
|
+
);
|
|
71
|
+
results.push({ id: item == null ? void 0 : item.id, data });
|
|
72
|
+
}
|
|
73
|
+
return results;
|
|
74
|
+
}
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
resolveVariablesBatch,
|
|
78
|
+
resolveVariablesTemplate
|
|
79
|
+
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "前端流引擎",
|
|
5
5
|
"description": "",
|
|
6
6
|
"description.zh-CN": "",
|
|
7
|
-
"version": "2.1.0-beta.
|
|
7
|
+
"version": "2.1.0-beta.12",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"devDependencies": {
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@nocobase/test": "2.x",
|
|
25
25
|
"@nocobase/utils": "2.x"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "25cee9643f42f850afc4adc33c55a56850ac730d"
|
|
28
28
|
}
|