@nocobase/plugin-flow-engine 2.1.37 → 2.1.38
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 +9 -9
- package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
- package/dist/node_modules/acorn/package.json +1 -1
- package/dist/node_modules/acorn-jsx/package.json +1 -1
- package/dist/node_modules/acorn-walk/package.json +1 -1
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/plugin.d.ts +1 -0
- package/dist/server/plugin.js +2 -0
- package/dist/server/repository.d.ts +4 -0
- package/dist/server/repository.js +10 -2
- package/dist/server/variables/allow-list.d.ts +1 -0
- package/dist/server/variables/allow-list.js +129 -11
- package/dist/server/variables/records.d.ts +3 -2
- package/dist/server/variables/records.js +40 -23
- package/dist/server/variables/resolve.d.ts +1 -0
- package/dist/server/variables/runjs-variable-dependencies.d.ts +3 -1
- package/dist/server/variables/runjs-variable-dependencies.js +6 -4
- package/dist/server/variables/selects.js +6 -3
- package/dist/server/variables/utils.js +1 -1
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.
|
|
11
|
+
"@nocobase/client": "2.1.38",
|
|
12
12
|
"lodash": "4.18.1",
|
|
13
|
-
"@nocobase/database": "2.1.
|
|
14
|
-
"@nocobase/data-source-manager": "2.1.
|
|
15
|
-
"@nocobase/resourcer": "2.1.
|
|
16
|
-
"@nocobase/server": "2.1.
|
|
17
|
-
"@nocobase/utils": "2.1.
|
|
18
|
-
"@nocobase/cache": "2.1.
|
|
19
|
-
"@nocobase/actions": "2.1.
|
|
13
|
+
"@nocobase/database": "2.1.38",
|
|
14
|
+
"@nocobase/data-source-manager": "2.1.38",
|
|
15
|
+
"@nocobase/resourcer": "2.1.38",
|
|
16
|
+
"@nocobase/server": "2.1.38",
|
|
17
|
+
"@nocobase/utils": "2.1.38",
|
|
18
|
+
"@nocobase/cache": "2.1.38",
|
|
19
|
+
"@nocobase/actions": "2.1.38",
|
|
20
20
|
"sequelize": "6.35.2",
|
|
21
21
|
"@formily/json-schema": "2.3.7",
|
|
22
|
-
"@nocobase/ai": "2.1.
|
|
22
|
+
"@nocobase/ai": "2.1.38"
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@ant-design/icons-svg","version":"4.3.1","sideEffects":false,"description":"Abstract nodes for ant design icons.","contributors":["HeskeyBaozi <hezhiyu233@foxmail.com>"],"homepage":"https://github.com/ant-design/ant-design-icons/","license":"MIT","main":"lib/index.js","module":"es/index.js","files":["lib","es","inline-svg","inline-namespaced-svg"],"repository":{"type":"git","url":"git+https://github.com/ant-design/ant-design-icons.git"},"scripts":{"g":"npm run generate","generate":"cross-env NODE_ENV=production gulp --require ts-node/register/transpile-only","type-check":"tsc --noEmit","build:es":"tsc --project tsconfig.build.json --module esnext --outDir es","build:lib":"tsc --project tsconfig.build.json --module commonjs --outDir lib","build":"cross-env NODE_ENV=production && npm run build:es && npm run build:lib","test":"cross-env NODE_ENV=test && npm run test:unit","test:unit":"jest","prepublishOnly":"npm run test && npm run g && npm run build && npm run type-check && npm run digest","digest":"node scripts/digest.js"},"bugs":{"url":"https://github.com/ant-design/ant-design-icons/issues"},"devDependencies":{"@babel/core":"^7.8.6","@babel/preset-env":"^7.8.6","@babel/preset-typescript":"^7.8.3","@rgrove/parse-xml":"^2.0.2","@types/gulp":"^4.0.6","@types/gulp-concat":"^0.0.32","@types/gulp-rename":"^0.0.33","@types/jest":"^25.1.3","@types/lodash.camelcase":"^4.3.6","@types/lodash.template":"^4.4.6","@types/lodash.upperfirst":"^4.3.6","@types/node":"^13.9.3","@types/ramda":"^0.26.43","@types/rgrove__parse-xml":"^1.1.0","@types/svgo":"^1.3.1","@types/through2":"^2.0.34","@typescript-eslint/eslint-plugin":"^2.21.0","@typescript-eslint/parser":"^2.21.0","babel-jest":"^25.1.0","cross-env":"^7.0.0","del":"^5.1.0","eslint":"^7.16.0","globby":"^11.0.0","gulp":"^4.0.2","gulp-clone":"^2.0.1","gulp-concat":"^2.6.1","gulp-header":"^2.0.9","gulp-rename":"^2.0.0","jest":"^25.1.0","lodash.camelcase":"^4.3.0","lodash.template":"^4.5.0","lodash.upperfirst":"^4.3.1","ramda":"^0.27.0","svgo":"^1.3.2","through2":"^3.0.1","ts-node":"^8.6.2","typescript":"^4.0.0","vinyl":"^2.2.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_lastModified":"2026-08-
|
|
1
|
+
{"name":"@ant-design/icons-svg","version":"4.3.1","sideEffects":false,"description":"Abstract nodes for ant design icons.","contributors":["HeskeyBaozi <hezhiyu233@foxmail.com>"],"homepage":"https://github.com/ant-design/ant-design-icons/","license":"MIT","main":"lib/index.js","module":"es/index.js","files":["lib","es","inline-svg","inline-namespaced-svg"],"repository":{"type":"git","url":"git+https://github.com/ant-design/ant-design-icons.git"},"scripts":{"g":"npm run generate","generate":"cross-env NODE_ENV=production gulp --require ts-node/register/transpile-only","type-check":"tsc --noEmit","build:es":"tsc --project tsconfig.build.json --module esnext --outDir es","build:lib":"tsc --project tsconfig.build.json --module commonjs --outDir lib","build":"cross-env NODE_ENV=production && npm run build:es && npm run build:lib","test":"cross-env NODE_ENV=test && npm run test:unit","test:unit":"jest","prepublishOnly":"npm run test && npm run g && npm run build && npm run type-check && npm run digest","digest":"node scripts/digest.js"},"bugs":{"url":"https://github.com/ant-design/ant-design-icons/issues"},"devDependencies":{"@babel/core":"^7.8.6","@babel/preset-env":"^7.8.6","@babel/preset-typescript":"^7.8.3","@rgrove/parse-xml":"^2.0.2","@types/gulp":"^4.0.6","@types/gulp-concat":"^0.0.32","@types/gulp-rename":"^0.0.33","@types/jest":"^25.1.3","@types/lodash.camelcase":"^4.3.6","@types/lodash.template":"^4.4.6","@types/lodash.upperfirst":"^4.3.6","@types/node":"^13.9.3","@types/ramda":"^0.26.43","@types/rgrove__parse-xml":"^1.1.0","@types/svgo":"^1.3.1","@types/through2":"^2.0.34","@typescript-eslint/eslint-plugin":"^2.21.0","@typescript-eslint/parser":"^2.21.0","babel-jest":"^25.1.0","cross-env":"^7.0.0","del":"^5.1.0","eslint":"^7.16.0","globby":"^11.0.0","gulp":"^4.0.2","gulp-clone":"^2.0.1","gulp-concat":"^2.6.1","gulp-header":"^2.0.9","gulp-rename":"^2.0.0","jest":"^25.1.0","lodash.camelcase":"^4.3.0","lodash.template":"^4.5.0","lodash.upperfirst":"^4.3.1","ramda":"^0.27.0","svgo":"^1.3.2","through2":"^3.0.1","ts-node":"^8.6.2","typescript":"^4.0.0","vinyl":"^2.2.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_lastModified":"2026-08-10T05:10:28.974Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"acorn","description":"ECMAScript parser","homepage":"https://github.com/acornjs/acorn","main":"dist/acorn.js","types":"dist/acorn.d.ts","module":"dist/acorn.mjs","exports":{".":[{"import":"./dist/acorn.mjs","require":"./dist/acorn.js","default":"./dist/acorn.js"},"./dist/acorn.js"],"./package.json":"./package.json"},"version":"8.11.2","engines":{"node":">=0.4.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"license":"MIT","scripts":{"prepare":"cd ..; npm run build:main"},"bin":{"acorn":"./bin/acorn"},"_lastModified":"2026-08-
|
|
1
|
+
{"name":"acorn","description":"ECMAScript parser","homepage":"https://github.com/acornjs/acorn","main":"dist/acorn.js","types":"dist/acorn.d.ts","module":"dist/acorn.mjs","exports":{".":[{"import":"./dist/acorn.mjs","require":"./dist/acorn.js","default":"./dist/acorn.js"},"./dist/acorn.js"],"./package.json":"./package.json"},"version":"8.11.2","engines":{"node":">=0.4.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"license":"MIT","scripts":{"prepare":"cd ..; npm run build:main"},"bin":{"acorn":"./bin/acorn"},"_lastModified":"2026-08-10T05:10:30.106Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"acorn-jsx","description":"Modern, fast React.js JSX parser","homepage":"https://github.com/acornjs/acorn-jsx","version":"5.3.2","maintainers":[{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"http://rreverser.com/"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn-jsx"},"license":"MIT","scripts":{"test":"node test/run.js"},"peerDependencies":{"acorn":"^6.0.0 || ^7.0.0 || ^8.0.0"},"devDependencies":{"acorn":"^8.0.1"},"_lastModified":"2026-08-
|
|
1
|
+
{"name":"acorn-jsx","description":"Modern, fast React.js JSX parser","homepage":"https://github.com/acornjs/acorn-jsx","version":"5.3.2","maintainers":[{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"http://rreverser.com/"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn-jsx"},"license":"MIT","scripts":{"test":"node test/run.js"},"peerDependencies":{"acorn":"^6.0.0 || ^7.0.0 || ^8.0.0"},"devDependencies":{"acorn":"^8.0.1"},"_lastModified":"2026-08-10T05:10:30.541Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"acorn-walk","description":"ECMAScript (ESTree) AST walker","homepage":"https://github.com/acornjs/acorn","main":"dist/walk.js","types":"dist/walk.d.ts","module":"dist/walk.mjs","exports":{".":[{"import":"./dist/walk.mjs","require":"./dist/walk.js","default":"./dist/walk.js"},"./dist/walk.js"],"./package.json":"./package.json"},"version":"8.3.4","engines":{"node":">=0.4.0"},"dependencies":{"acorn":"^8.11.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"scripts":{"prepare":"cd ..; npm run build:walk"},"license":"MIT","_lastModified":"2026-08-
|
|
1
|
+
{"name":"acorn-walk","description":"ECMAScript (ESTree) AST walker","homepage":"https://github.com/acornjs/acorn","main":"dist/walk.js","types":"dist/walk.d.ts","module":"dist/walk.mjs","exports":{".":[{"import":"./dist/walk.mjs","require":"./dist/walk.js","default":"./dist/walk.js"},"./dist/walk.js"],"./package.json":"./package.json"},"version":"8.3.4","engines":{"node":">=0.4.0"},"dependencies":{"acorn":"^8.11.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"scripts":{"prepare":"cd ..; npm run build:walk"},"license":"MIT","_lastModified":"2026-08-10T05:10:30.653Z"}
|
|
@@ -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-08-
|
|
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-08-10T05:10:29.646Z"}
|
|
@@ -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-08-
|
|
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-08-10T05:10:31.847Z"}
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare class PluginFlowEngineServer extends PluginUISchemaStorageServer
|
|
|
16
16
|
getDatabaseByDataSourceKey(dataSourceKey?: string): import("@nocobase/database").default;
|
|
17
17
|
runSQLByDataSourceKey(dataSourceKey: string | undefined, sql: string, options?: Record<string, unknown>): Promise<any>;
|
|
18
18
|
resolveFlowModelVariablesTemplate(ctx: ResourcerContext, options: {
|
|
19
|
+
contractRd?: string | number;
|
|
19
20
|
contextParams?: Record<string, unknown>;
|
|
20
21
|
rd?: string | number;
|
|
21
22
|
template: JSONValue;
|
package/dist/server/plugin.js
CHANGED
|
@@ -110,6 +110,7 @@ class PluginFlowEngineServer extends import_server.default {
|
|
|
110
110
|
for (const [index, item] of batchItems.entries()) {
|
|
111
111
|
const template2 = (item == null ? void 0 : item.template) ?? {};
|
|
112
112
|
const authorization2 = await (0, import_allow_list.authorizeVariablesResolve)(ctx, {
|
|
113
|
+
contractRd: item == null ? void 0 : item.contractRd,
|
|
113
114
|
contextParams: (item == null ? void 0 : item.contextParams) || {},
|
|
114
115
|
rd: item == null ? void 0 : item.rd,
|
|
115
116
|
template: template2
|
|
@@ -161,6 +162,7 @@ class PluginFlowEngineServer extends import_server.default {
|
|
|
161
162
|
const template = values.template;
|
|
162
163
|
const contextParams = (values == null ? void 0 : values.contextParams) || {};
|
|
163
164
|
const authorization = await (0, import_allow_list.authorizeVariablesResolve)(ctx, {
|
|
165
|
+
contractRd: values == null ? void 0 : values.contractRd,
|
|
164
166
|
contextParams,
|
|
165
167
|
rd: values == null ? void 0 : values.rd,
|
|
166
168
|
template
|
|
@@ -140,6 +140,10 @@ export declare class FlowModelRepository extends Repository {
|
|
|
140
140
|
upsertModel(model: any, options?: Transactionable): Promise<string>;
|
|
141
141
|
findModelById(uid: string, options?: GetJsonSchemaOptions): Promise<any>;
|
|
142
142
|
findModelNodeSnapshotById(uid: string, options?: Transactionable): Promise<FlowModelNodeSnapshot | null>;
|
|
143
|
+
private findModelUidByParentId;
|
|
144
|
+
findModelNodeSnapshotByParentId(parentUid: string, options?: Transactionable & {
|
|
145
|
+
subKey?: string;
|
|
146
|
+
}): Promise<FlowModelNodeSnapshot | null>;
|
|
143
147
|
findModelByParentId(parentUid: string, options?: GetJsonSchemaOptions & {
|
|
144
148
|
subKey?: string;
|
|
145
149
|
}): Promise<any>;
|
|
@@ -1440,7 +1440,7 @@ WHERE TreeTable.depth = 1 AND TreeTable.ancestor = :ancestor and TreeTable.sort
|
|
|
1440
1440
|
async: !!nodePath.get("async")
|
|
1441
1441
|
};
|
|
1442
1442
|
}
|
|
1443
|
-
async
|
|
1443
|
+
async findModelUidByParentId(parentUid, options) {
|
|
1444
1444
|
const r = this.database.getRepository("flowModelTreePath");
|
|
1445
1445
|
const treePaths = await r.model.findAll({
|
|
1446
1446
|
where: {
|
|
@@ -1462,10 +1462,18 @@ WHERE TreeTable.depth = 1 AND TreeTable.ancestor = :ancestor and TreeTable.sort
|
|
|
1462
1462
|
transaction: options == null ? void 0 : options.transaction
|
|
1463
1463
|
});
|
|
1464
1464
|
if (treePath == null ? void 0 : treePath["descendant"]) {
|
|
1465
|
-
return
|
|
1465
|
+
return treePath["descendant"];
|
|
1466
1466
|
}
|
|
1467
1467
|
return null;
|
|
1468
1468
|
}
|
|
1469
|
+
async findModelNodeSnapshotByParentId(parentUid, options) {
|
|
1470
|
+
const uid2 = await this.findModelUidByParentId(parentUid, options);
|
|
1471
|
+
return uid2 ? this.findModelNodeSnapshotById(uid2, options) : null;
|
|
1472
|
+
}
|
|
1473
|
+
async findModelByParentId(parentUid, options) {
|
|
1474
|
+
const uid2 = await this.findModelUidByParentId(parentUid, options);
|
|
1475
|
+
return uid2 ? this.findModelById(uid2, options) : null;
|
|
1476
|
+
}
|
|
1469
1477
|
async attach(uid2, attachOptions, options) {
|
|
1470
1478
|
const { transaction: transaction2 } = options || {};
|
|
1471
1479
|
const modelUid = String(uid2 || "").trim();
|
|
@@ -41,6 +41,7 @@ export declare function hasRecordContextParams(value: unknown): boolean;
|
|
|
41
41
|
export declare function sanitizeContextParams(value?: Record<string, unknown>): Record<string, unknown>;
|
|
42
42
|
export declare function resolveFlowModelNodeFromRequestRd(ctx: ResourcerContext, rd?: string | number): Promise<FlowModelNodeSnapshot>;
|
|
43
43
|
export declare function authorizeVariablesResolve(ctx: ResourcerContext, options: {
|
|
44
|
+
contractRd?: string | number;
|
|
44
45
|
contextParams?: Record<string, unknown>;
|
|
45
46
|
rd?: string | number;
|
|
46
47
|
template: JSONValue;
|
|
@@ -56,6 +56,53 @@ function clearVariableAllowListCache(app) {
|
|
|
56
56
|
function isObject(value) {
|
|
57
57
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
58
58
|
}
|
|
59
|
+
function readFormAssignRulesVariableSource(node) {
|
|
60
|
+
const stepParams = isObject(node.options.stepParams) ? node.options.stepParams : null;
|
|
61
|
+
const formModelSettings = stepParams && isObject(stepParams.formModelSettings) ? stepParams.formModelSettings : null;
|
|
62
|
+
return formModelSettings && Object.prototype.hasOwnProperty.call(formModelSettings, "assignRules") ? formModelSettings.assignRules : void 0;
|
|
63
|
+
}
|
|
64
|
+
function hasFlowModelUse(node) {
|
|
65
|
+
const use = node.options.use;
|
|
66
|
+
return typeof use === "string" && !!use.trim();
|
|
67
|
+
}
|
|
68
|
+
function matchesVariableContractType(node, type) {
|
|
69
|
+
const marker = node.options.variableContractType;
|
|
70
|
+
if (typeof marker === "undefined") return void 0;
|
|
71
|
+
return isObject(marker) && marker.type === type && marker.use === node.options.use;
|
|
72
|
+
}
|
|
73
|
+
function isFormGridNode(node) {
|
|
74
|
+
const use = node.options.use;
|
|
75
|
+
const markerMatches = matchesVariableContractType(node, "formGrid");
|
|
76
|
+
return node.subKey === "grid" && hasFlowModelUse(node) && (markerMatches === true || typeof markerMatches === "undefined" && typeof use === "string" && use.endsWith("GridModel"));
|
|
77
|
+
}
|
|
78
|
+
function getReferenceFormUseTemplate(node) {
|
|
79
|
+
const stepParams = isObject(node.options.stepParams) ? node.options.stepParams : null;
|
|
80
|
+
const referenceSettings = stepParams && isObject(stepParams.referenceSettings) ? stepParams.referenceSettings : null;
|
|
81
|
+
return referenceSettings && isObject(referenceSettings.useTemplate) ? referenceSettings.useTemplate : null;
|
|
82
|
+
}
|
|
83
|
+
function isReferenceFormGridNode(node) {
|
|
84
|
+
const use = node.options.use;
|
|
85
|
+
return isFormGridNode(node) && typeof use === "string" && use.endsWith("ReferenceFormGridModel");
|
|
86
|
+
}
|
|
87
|
+
function getReferenceFormGridTargetUid(node) {
|
|
88
|
+
const useTemplate = getReferenceFormUseTemplate(node);
|
|
89
|
+
const templateUid = useTemplate && typeof useTemplate.templateUid === "string" ? useTemplate.templateUid.trim() : "";
|
|
90
|
+
if (!useTemplate || !templateUid) return "";
|
|
91
|
+
const targetPath = typeof useTemplate.targetPath === "string" ? useTemplate.targetPath.trim() : "";
|
|
92
|
+
if (targetPath && targetPath !== "subModels.grid") return "";
|
|
93
|
+
return typeof useTemplate.targetUid === "string" ? useTemplate.targetUid.trim() : "";
|
|
94
|
+
}
|
|
95
|
+
function isFormAssignRulesOwnerNode(node) {
|
|
96
|
+
const use = node.options.use;
|
|
97
|
+
const markerMatches = matchesVariableContractType(node, "form");
|
|
98
|
+
return hasFlowModelUse(node) && (markerMatches === true || typeof markerMatches === "undefined" && typeof use === "string" && (use.endsWith("FormModel") || use.endsWith("FormBlockModel")));
|
|
99
|
+
}
|
|
100
|
+
function isFormAssignRulesContractPair(formNode, gridNode) {
|
|
101
|
+
return isFormAssignRulesOwnerNode(formNode) && isFormGridNode(gridNode) && gridNode.parentId === formNode.uid;
|
|
102
|
+
}
|
|
103
|
+
function isFormAssignRulesRunJsValuePath(pathTail) {
|
|
104
|
+
return pathTail.length === 3 && pathTail[0] === "value" && /^\d+$/.test(pathTail[1]) && pathTail[2] === "value";
|
|
105
|
+
}
|
|
59
106
|
function isRecordParams(value) {
|
|
60
107
|
return isObject(value) && typeof value.collection === "string" && Object.prototype.hasOwnProperty.call(value, "filterByTk") && (typeof value.dataSourceKey === "undefined" || typeof value.dataSourceKey === "string") && (typeof value.associationName === "undefined" || typeof value.associationName === "string") && (typeof value.fields === "undefined" || Array.isArray(value.fields) && value.fields.every((field) => typeof field === "string")) && (typeof value.appends === "undefined" || Array.isArray(value.appends) && value.appends.every((append) => typeof append === "string"));
|
|
61
108
|
}
|
|
@@ -110,6 +157,19 @@ async function getFlowModelNode(ctx, flowModelUid) {
|
|
|
110
157
|
cache.set(flowModelUid, model);
|
|
111
158
|
return model;
|
|
112
159
|
}
|
|
160
|
+
async function getFlowModelChildNode(ctx, parentUid, subKey) {
|
|
161
|
+
const state = getRequestState(ctx);
|
|
162
|
+
const cacheKey = "__variableResolveFlowModelChildCache";
|
|
163
|
+
const cache = state[cacheKey] || /* @__PURE__ */ new Map();
|
|
164
|
+
state[cacheKey] = cache;
|
|
165
|
+
const childCacheKey = JSON.stringify([parentUid, subKey]);
|
|
166
|
+
if (cache.has(childCacheKey)) return await cache.get(childCacheKey) || null;
|
|
167
|
+
const load = getFlowModelRepository(ctx).findModelNodeSnapshotByParentId(parentUid, { subKey });
|
|
168
|
+
cache.set(childCacheKey, load);
|
|
169
|
+
const child = await load;
|
|
170
|
+
cache.set(childCacheKey, child);
|
|
171
|
+
return child;
|
|
172
|
+
}
|
|
113
173
|
async function loadFlowModelAncestors(ctx, currentNode) {
|
|
114
174
|
const ancestors = [];
|
|
115
175
|
const seen = /* @__PURE__ */ new Set([currentNode.uid]);
|
|
@@ -126,6 +186,20 @@ async function loadFlowModelAncestors(ctx, currentNode) {
|
|
|
126
186
|
}
|
|
127
187
|
return Object.freeze(ancestors);
|
|
128
188
|
}
|
|
189
|
+
async function loadFlowModelAncestorUids(ctx, currentNode) {
|
|
190
|
+
try {
|
|
191
|
+
return new Set((await loadFlowModelAncestors(ctx, currentNode)).map((ancestor) => ancestor.uid));
|
|
192
|
+
} catch {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async function resolveFormAssignRulesVariableSource(ctx, contractNode) {
|
|
197
|
+
const fromGrid = readFormAssignRulesVariableSource(contractNode);
|
|
198
|
+
if (typeof fromGrid !== "undefined") return fromGrid;
|
|
199
|
+
if (!contractNode.parentId) return void 0;
|
|
200
|
+
const formNode = await getFlowModelNode(ctx, contractNode.parentId);
|
|
201
|
+
return formNode && isFormAssignRulesContractPair(formNode, contractNode) ? readFormAssignRulesVariableSource(formNode) : void 0;
|
|
202
|
+
}
|
|
129
203
|
function createRecordSlotCompilerOptions(ctx, currentNode) {
|
|
130
204
|
let ancestors;
|
|
131
205
|
return {
|
|
@@ -142,26 +216,29 @@ function createRecordSlotCompilerOptions(ctx, currentNode) {
|
|
|
142
216
|
} : void 0
|
|
143
217
|
};
|
|
144
218
|
}
|
|
145
|
-
async function getFlowModelVariableContract(ctx,
|
|
219
|
+
async function getFlowModelVariableContract(ctx, contractNode, runtimeNode, source) {
|
|
146
220
|
const state = getRequestState(ctx);
|
|
147
221
|
const cacheKey = "__variableResolveContractCache";
|
|
148
222
|
const cache = state[cacheKey] || /* @__PURE__ */ new Map();
|
|
149
223
|
state[cacheKey] = cache;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
224
|
+
const contractCacheKey = JSON.stringify([source, contractNode.uid, runtimeNode.uid]);
|
|
225
|
+
if (cache.has(contractCacheKey)) return await cache.get(contractCacheKey) || null;
|
|
226
|
+
const load = createFlowModelVariableContractFromNode(ctx, contractNode, runtimeNode, source);
|
|
227
|
+
cache.set(contractCacheKey, load);
|
|
153
228
|
const contract = await load;
|
|
154
|
-
cache.set(
|
|
229
|
+
cache.set(contractCacheKey, contract);
|
|
155
230
|
return contract;
|
|
156
231
|
}
|
|
157
|
-
async function createFlowModelVariableContractFromNode(ctx,
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
232
|
+
async function createFlowModelVariableContractFromNode(ctx, contractNode, runtimeNode, source) {
|
|
233
|
+
const variableSource = source === "formAssignRules" ? await resolveFormAssignRulesVariableSource(ctx, contractNode) ?? {} : contractNode.options;
|
|
234
|
+
const prepared = (0, import_runjs_variable_dependencies.prepareFlowModelVariableSource)(
|
|
235
|
+
variableSource,
|
|
236
|
+
source === "formAssignRules" ? { isRunJsValuePath: isFormAssignRulesRunJsValuePath } : void 0
|
|
237
|
+
);
|
|
161
238
|
const contractSource = prepared.ok ? prepared.runJsTemplates.length ? [prepared.templateSource, ...prepared.runJsTemplates] : prepared.templateSource : {};
|
|
162
239
|
const result = analyzeVariableTemplateSafely(contractSource, { mode: "flow-model" });
|
|
163
240
|
const analysis = result.ok ? result.analysis : (0, import_variable_expression.analyzeVariableTemplate)({}, { mode: "flow-model" });
|
|
164
|
-
return await (0, import_record_slot_policy.createFlowModelVariableContract)(analysis, createRecordSlotCompilerOptions(ctx,
|
|
241
|
+
return await (0, import_record_slot_policy.createFlowModelVariableContract)(analysis, createRecordSlotCompilerOptions(ctx, runtimeNode));
|
|
165
242
|
}
|
|
166
243
|
function getCurrentRoleNames(ctx) {
|
|
167
244
|
const state = ctx.state;
|
|
@@ -237,6 +314,36 @@ async function resolveFlowModelNodeFromRequestRd(ctx, rd) {
|
|
|
237
314
|
const flowModelUid = resolveFlowModelUidFromRequestRd(ctx, rd);
|
|
238
315
|
return flowModelUid ? getFlowModelNode(ctx, flowModelUid) : null;
|
|
239
316
|
}
|
|
317
|
+
async function resolveFormAssignRulesContractNode(ctx, runtimeNode, contractModelUid) {
|
|
318
|
+
const contractNode = await getFlowModelNode(ctx, contractModelUid);
|
|
319
|
+
if (!contractNode || !contractNode.parentId || !isFormGridNode(contractNode)) return null;
|
|
320
|
+
const formNode = await getFlowModelNode(ctx, contractNode.parentId);
|
|
321
|
+
if (!formNode || !isFormAssignRulesContractPair(formNode, contractNode)) return null;
|
|
322
|
+
if (isReferenceFormGridNode(contractNode)) {
|
|
323
|
+
const targetUid = getReferenceFormGridTargetUid(contractNode);
|
|
324
|
+
if (!targetUid) return null;
|
|
325
|
+
const targetFormNode = await getFlowModelNode(ctx, targetUid);
|
|
326
|
+
if (!targetFormNode) return null;
|
|
327
|
+
const targetGridNode = await getFlowModelChildNode(ctx, targetFormNode.uid, "grid");
|
|
328
|
+
if (!targetGridNode || !isFormAssignRulesContractPair(targetFormNode, targetGridNode) || isReferenceFormGridNode(targetGridNode)) {
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
const targetVariableSource = await resolveFormAssignRulesVariableSource(ctx, targetGridNode);
|
|
332
|
+
let contractSourceNode = targetGridNode;
|
|
333
|
+
if (typeof targetVariableSource === "undefined") {
|
|
334
|
+
if (typeof readFormAssignRulesVariableSource(formNode) === "undefined") return null;
|
|
335
|
+
contractSourceNode = formNode;
|
|
336
|
+
}
|
|
337
|
+
const directlyRelated = runtimeNode.uid === contractNode.uid || runtimeNode.uid === formNode.uid || runtimeNode.uid === targetGridNode.uid || runtimeNode.uid === targetFormNode.uid;
|
|
338
|
+
if (directlyRelated) return contractSourceNode;
|
|
339
|
+
const ancestorUids2 = await loadFlowModelAncestorUids(ctx, runtimeNode);
|
|
340
|
+
return (ancestorUids2 == null ? void 0 : ancestorUids2.has(contractNode.uid)) === true || (ancestorUids2 == null ? void 0 : ancestorUids2.has(targetGridNode.uid)) === true ? contractSourceNode : null;
|
|
341
|
+
}
|
|
342
|
+
if (typeof await resolveFormAssignRulesVariableSource(ctx, contractNode) === "undefined") return null;
|
|
343
|
+
if (runtimeNode.uid === contractNode.uid || runtimeNode.uid === formNode.uid) return contractNode;
|
|
344
|
+
const ancestorUids = await loadFlowModelAncestorUids(ctx, runtimeNode);
|
|
345
|
+
return (ancestorUids == null ? void 0 : ancestorUids.has(contractNode.uid)) === true ? contractNode : null;
|
|
346
|
+
}
|
|
240
347
|
function createPolicy(allowAll = false, allowedPaths = /* @__PURE__ */ new Set(), unrestrictedVariables = /* @__PURE__ */ new Set()) {
|
|
241
348
|
return { allowAll, allowedPaths, unrestrictedVariables };
|
|
242
349
|
}
|
|
@@ -253,6 +360,8 @@ async function authorizeVariablesResolve(ctx, options) {
|
|
|
253
360
|
var _a;
|
|
254
361
|
let contextParams = sanitizeContextParams(options.contextParams || {});
|
|
255
362
|
const flowModelUid = resolveFlowModelUidFromRequestRd(ctx, options.rd);
|
|
363
|
+
const hasContractRd = typeof options.contractRd !== "undefined";
|
|
364
|
+
const contractModelUid = hasContractRd ? resolveFlowModelUidFromRequestRd(ctx, options.contractRd) : flowModelUid;
|
|
256
365
|
const unrestrictedVariables = /* @__PURE__ */ new Set();
|
|
257
366
|
let policy = createPolicy(false, /* @__PURE__ */ new Set(), unrestrictedVariables);
|
|
258
367
|
let recordSlotPolicies = /* @__PURE__ */ new Map();
|
|
@@ -326,7 +435,16 @@ async function authorizeVariablesResolve(ctx, options) {
|
|
|
326
435
|
if (flowModelRequiredVars.size > 0 && !flowModelUid) {
|
|
327
436
|
return denied(analysis, bindingPlan.contextParams, policy, recordSlotPolicies);
|
|
328
437
|
}
|
|
329
|
-
|
|
438
|
+
let contractNode = currentNode;
|
|
439
|
+
let contractSource = "node";
|
|
440
|
+
if (hasContractRd) {
|
|
441
|
+
contractNode = currentNode && contractModelUid ? await resolveFormAssignRulesContractNode(ctx, currentNode, contractModelUid) : null;
|
|
442
|
+
contractSource = "formAssignRules";
|
|
443
|
+
if (!contractNode) {
|
|
444
|
+
return denied(analysis, bindingPlan.contextParams, policy, recordSlotPolicies, flowModelUid || void 0);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
const contract = contractNode && currentNode ? await getFlowModelVariableContract(ctx, contractNode, currentNode, contractSource) : null;
|
|
330
448
|
const allowedPaths = (contract == null ? void 0 : contract.allowedPaths) || null;
|
|
331
449
|
recordSlotPolicies = (contract == null ? void 0 : contract.recordSlots) || /* @__PURE__ */ new Map();
|
|
332
450
|
policy = createPolicy(false, allowedPaths || /* @__PURE__ */ new Set(), unrestrictedVariables);
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import type { Collection, RelationRepository, Repository } from '@nocobase/database';
|
|
10
|
+
import type { IRepository } from '@nocobase/data-source-manager';
|
|
10
11
|
import type { ResourcerContext } from '@nocobase/resourcer';
|
|
11
12
|
type FilterTargetKey = string | string[] | undefined;
|
|
12
|
-
type RecordRepository = Repository | RelationRepository;
|
|
13
|
+
type RecordRepository = IRepository | Repository | RelationRepository;
|
|
13
14
|
export type RecordParams = {
|
|
14
15
|
associationName?: string;
|
|
15
16
|
collection: string;
|
|
@@ -80,5 +81,5 @@ export declare function fetchRecordOrRecordsJson(repo: RecordRepository, params:
|
|
|
80
81
|
filterTargetKey?: FilterTargetKey;
|
|
81
82
|
pkAttr?: string;
|
|
82
83
|
pkIsValid?: boolean;
|
|
83
|
-
}): Promise<unknown>;
|
|
84
|
+
}, context: ResourcerContext): Promise<unknown>;
|
|
84
85
|
export {};
|
|
@@ -149,9 +149,10 @@ function isRecordParams(value) {
|
|
|
149
149
|
return !!value && typeof value === "object" && typeof value.collection === "string" && Object.prototype.hasOwnProperty.call(value, "filterByTk");
|
|
150
150
|
}
|
|
151
151
|
function resolveRecordTarget(koaCtx, params) {
|
|
152
|
-
var _a, _b;
|
|
152
|
+
var _a, _b, _c, _d, _e, _f;
|
|
153
153
|
const dataSourceKey = params.dataSourceKey || "main";
|
|
154
154
|
const usesAssociation = !!(params.associationName && typeof params.sourceId !== "undefined");
|
|
155
|
+
const associationSourceCollection = usesAssociation ? (_a = params.associationName) == null ? void 0 : _a.split(".")[0] : void 0;
|
|
155
156
|
const context = koaCtx;
|
|
156
157
|
if (!context.state) context.state = {};
|
|
157
158
|
const targets = context.state.__varResolveRecordTargets ??= /* @__PURE__ */ new Map();
|
|
@@ -164,26 +165,31 @@ function resolveRecordTarget(koaCtx, params) {
|
|
|
164
165
|
if (targets.has(requestKey)) return targets.get(requestKey);
|
|
165
166
|
const ds = koaCtx.app.dataSourceManager.get(dataSourceKey);
|
|
166
167
|
const cm = ds.collectionManager;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
let repository;
|
|
169
|
+
if (typeof cm.getRepository === "function") {
|
|
170
|
+
repository = usesAssociation ? cm.getRepository(params.associationName, params.sourceId) : cm.getRepository(params.collection);
|
|
171
|
+
} else if (typeof ((_b = cm.db) == null ? void 0 : _b.getRepository) === "function") {
|
|
172
|
+
repository = usesAssociation ? cm.db.getRepository(params.associationName, params.sourceId) : cm.db.getRepository(params.collection);
|
|
170
173
|
}
|
|
171
|
-
const repository = usesAssociation ? cm.db.getRepository(params.associationName, params.sourceId) : cm.db.getRepository(params.collection);
|
|
172
174
|
if (!repository) {
|
|
173
175
|
targets.set(requestKey, void 0);
|
|
174
176
|
return void 0;
|
|
175
177
|
}
|
|
176
|
-
const
|
|
178
|
+
const repositoryMetadata = repository;
|
|
179
|
+
let collection = repositoryMetadata.targetCollection || repositoryMetadata.collection;
|
|
180
|
+
if (!usesAssociation && !collection) {
|
|
181
|
+
collection = (typeof cm.getCollection === "function" ? cm.getCollection(params.collection) : (_d = (_c = cm.db) == null ? void 0 : _c.getCollection) == null ? void 0 : _d.call(_c, params.collection)) || { name: params.collection };
|
|
182
|
+
}
|
|
177
183
|
if (!collection) {
|
|
178
184
|
targets.set(requestKey, void 0);
|
|
179
185
|
return void 0;
|
|
180
186
|
}
|
|
181
|
-
if (usesAssociation && collection.name !== params.collection) {
|
|
187
|
+
if (usesAssociation && (!collection.name || collection.name !== params.collection && associationSourceCollection !== params.collection)) {
|
|
182
188
|
targets.set(requestKey, void 0);
|
|
183
189
|
return void 0;
|
|
184
190
|
}
|
|
185
|
-
const rawAttributes = (
|
|
186
|
-
const pkAttr = (
|
|
191
|
+
const rawAttributes = (_e = collection.model) == null ? void 0 : _e.rawAttributes;
|
|
192
|
+
const pkAttr = (_f = collection.model) == null ? void 0 : _f.primaryKeyAttribute;
|
|
187
193
|
const pkIsValid = !!(pkAttr && rawAttributes && Object.prototype.hasOwnProperty.call(rawAttributes, pkAttr));
|
|
188
194
|
const collectionName = collection.name || params.associationName || params.collection;
|
|
189
195
|
const target = {
|
|
@@ -283,7 +289,7 @@ async function fetchRecordWithRequestCache(koaCtx, params, fields, appends, stri
|
|
|
283
289
|
const cache = getRecordRequestCache(koaCtx);
|
|
284
290
|
const cached = findRecordRequestCacheValue(cache, query);
|
|
285
291
|
if (cached.hit) return cached.value;
|
|
286
|
-
const value = await fetchRecordOrRecordsJson(query.repository, query);
|
|
292
|
+
const value = await fetchRecordOrRecordsJson(query.repository, query, koaCtx);
|
|
287
293
|
setRecordRequestCache(cache, query, value);
|
|
288
294
|
return value;
|
|
289
295
|
} catch (error) {
|
|
@@ -316,11 +322,9 @@ function getExtraKeyFieldsForSelect(filterByTk, options) {
|
|
|
316
322
|
}
|
|
317
323
|
if (Array.isArray(filterByTk) && filterByTk.length > 0) {
|
|
318
324
|
const tkKeys = typeof options.filterTargetKey === "string" ? [options.filterTargetKey] : Array.isArray(options.filterTargetKey) ? options.filterTargetKey : [];
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
extra.push(k);
|
|
323
|
-
}
|
|
325
|
+
for (const k of tkKeys) {
|
|
326
|
+
if (k && (!options.rawAttributes || Object.prototype.hasOwnProperty.call(options.rawAttributes, k))) {
|
|
327
|
+
extra.push(k);
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
330
|
}
|
|
@@ -339,6 +343,20 @@ function toJsonArray(rows) {
|
|
|
339
343
|
if (!Array.isArray(rows)) return [];
|
|
340
344
|
return rows.map(toJsonRecord);
|
|
341
345
|
}
|
|
346
|
+
function createRecordRepositoryContext(context, params) {
|
|
347
|
+
var _a;
|
|
348
|
+
if (!((_a = context.action) == null ? void 0 : _a.params)) return context;
|
|
349
|
+
const repositoryContext = Object.create(context);
|
|
350
|
+
const repositoryAction = Object.create(context.action);
|
|
351
|
+
repositoryAction.params = {
|
|
352
|
+
...context.action.params,
|
|
353
|
+
filterByTk: params.filterByTk,
|
|
354
|
+
fields: params.fields,
|
|
355
|
+
appends: params.appends
|
|
356
|
+
};
|
|
357
|
+
repositoryContext.action = repositoryAction;
|
|
358
|
+
return repositoryContext;
|
|
359
|
+
}
|
|
342
360
|
function reorderRecordsByFilterByTk(records, filterByTk, options) {
|
|
343
361
|
if (!Array.isArray(filterByTk) || filterByTk.length === 0) return records;
|
|
344
362
|
if (!isPrimitiveTkArray(filterByTk)) return records;
|
|
@@ -369,19 +387,18 @@ function reorderRecordsByFilterByTk(records, filterByTk, options) {
|
|
|
369
387
|
}
|
|
370
388
|
return ordered;
|
|
371
389
|
}
|
|
372
|
-
async function fetchRecordOrRecordsJson(repo, params) {
|
|
390
|
+
async function fetchRecordOrRecordsJson(repo, params, context) {
|
|
373
391
|
const { filterByTk, preferFullRecord, fields, appends } = params;
|
|
392
|
+
if (Array.isArray(filterByTk) && filterByTk.length === 0) return [];
|
|
393
|
+
const query = preferFullRecord ? { filterByTk } : { filterByTk, fields, appends };
|
|
394
|
+
const repositoryContext = createRecordRepositoryContext(context, query);
|
|
395
|
+
const repositoryOptions = { ...query, context: repositoryContext };
|
|
374
396
|
if (Array.isArray(filterByTk)) {
|
|
375
|
-
|
|
376
|
-
const rows = await repo.find(
|
|
377
|
-
preferFullRecord ? { filterByTk } : { filterByTk, fields, appends }
|
|
378
|
-
);
|
|
397
|
+
const rows = await repo.find(repositoryOptions);
|
|
379
398
|
const jsonArr = toJsonArray(rows);
|
|
380
399
|
return reorderRecordsByFilterByTk(jsonArr, filterByTk, params);
|
|
381
400
|
}
|
|
382
|
-
const rec = await repo.findOne(
|
|
383
|
-
preferFullRecord ? { filterByTk } : { filterByTk, fields, appends }
|
|
384
|
-
);
|
|
401
|
+
const rec = await repo.findOne(repositoryOptions);
|
|
385
402
|
return rec ? toJsonRecord(rec) : void 0;
|
|
386
403
|
}
|
|
387
404
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -23,6 +23,7 @@ export type AnalyzedResolveBatchItem = ResolveBatchItem & {
|
|
|
23
23
|
export declare function resolveVariablesTemplate(ctx: ResourcerContext, template: JSONValue, contextParams?: Record<string, unknown>): Promise<any>;
|
|
24
24
|
export declare function isLegacyVariableTemplateSafe(template: JSONValue): boolean;
|
|
25
25
|
export declare function resolveFlowModelVariablesTemplate(ctx: ResourcerContext, options: {
|
|
26
|
+
contractRd?: string | number;
|
|
26
27
|
contextParams?: Record<string, unknown>;
|
|
27
28
|
rd?: string | number;
|
|
28
29
|
template: JSONValue;
|
|
@@ -17,5 +17,7 @@ export declare const MAX_FLOW_MODEL_VARIABLE_SOURCE_DEPTH = 128;
|
|
|
17
17
|
export declare const MAX_FLOW_MODEL_VARIABLE_SOURCE_NODES = 10000;
|
|
18
18
|
export declare const MAX_FLOW_MODEL_VARIABLE_STRING_LENGTH: number;
|
|
19
19
|
export declare const MAX_FLOW_MODEL_VARIABLE_TOTAL_STRING_LENGTH: number;
|
|
20
|
-
export declare function prepareFlowModelVariableSource(value: unknown
|
|
20
|
+
export declare function prepareFlowModelVariableSource(value: unknown, options?: Readonly<{
|
|
21
|
+
isRunJsValuePath?: (pathTail: readonly string[]) => boolean;
|
|
22
|
+
}>): PreparedFlowModelVariableSource;
|
|
21
23
|
export declare function collectPersistedRunJsVariableTemplates(value: unknown): string[];
|
|
@@ -73,7 +73,7 @@ function readPersistedRunJsValue(entries) {
|
|
|
73
73
|
return { code, version };
|
|
74
74
|
}
|
|
75
75
|
function isPersistedRunJsPath(pathTail) {
|
|
76
|
-
return RUNJS_PATH_SUFFIXES.has(pathTail.join("."));
|
|
76
|
+
return RUNJS_PATH_SUFFIXES.has(pathTail.slice(-3).join("."));
|
|
77
77
|
}
|
|
78
78
|
function createTraversalContainer(input, descriptors) {
|
|
79
79
|
var _a;
|
|
@@ -319,7 +319,7 @@ function extractStaticVariableTemplates(code) {
|
|
|
319
319
|
});
|
|
320
320
|
return Array.from(templates);
|
|
321
321
|
}
|
|
322
|
-
function prepareFlowModelVariableSource(value) {
|
|
322
|
+
function prepareFlowModelVariableSource(value, options = {}) {
|
|
323
323
|
var _a;
|
|
324
324
|
try {
|
|
325
325
|
const templates = /* @__PURE__ */ new Set();
|
|
@@ -353,7 +353,8 @@ function prepareFlowModelVariableSource(value) {
|
|
|
353
353
|
return { ok: false };
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
const
|
|
356
|
+
const runJsPath = options.isRunJsValuePath ? options.isRunJsValuePath(pathTail) : isPersistedRunJsPath(pathTail);
|
|
357
|
+
const runJs = !Array.isArray(input) && runJsPath ? readPersistedRunJsValue(entries) : void 0;
|
|
357
358
|
const output = createTraversalContainer(input, descriptors);
|
|
358
359
|
defineTraversalValue(parent, key, output);
|
|
359
360
|
if (runJs) {
|
|
@@ -376,12 +377,13 @@ function prepareFlowModelVariableSource(value) {
|
|
|
376
377
|
if (scheduledNodes > MAX_FLOW_MODEL_VARIABLE_SOURCE_NODES) return { ok: false };
|
|
377
378
|
for (let index = entries.length - 1; index >= 0; index -= 1) {
|
|
378
379
|
const [entryKey, entryValue] = entries[index];
|
|
380
|
+
const nextPath = [...pathTail, entryKey];
|
|
379
381
|
stack.push({
|
|
380
382
|
depth: depth + 1,
|
|
381
383
|
input: entryValue,
|
|
382
384
|
key: entryKey,
|
|
383
385
|
parent: output,
|
|
384
|
-
pathTail:
|
|
386
|
+
pathTail: options.isRunJsValuePath ? nextPath : nextPath.slice(-3)
|
|
385
387
|
});
|
|
386
388
|
}
|
|
387
389
|
}
|
|
@@ -30,12 +30,15 @@ __export(selects_exports, {
|
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(selects_exports);
|
|
32
32
|
function adjustSelectsForCollection(koaCtx, dataSourceKey, collection, fields, appends) {
|
|
33
|
-
var _a, _b, _c, _d;
|
|
33
|
+
var _a, _b, _c, _d, _e;
|
|
34
34
|
const ds = koaCtx.app.dataSourceManager.get(dataSourceKey || "main");
|
|
35
35
|
const cm = ds.collectionManager;
|
|
36
36
|
const coll = (_b = (_a = cm == null ? void 0 : cm.db) == null ? void 0 : _a.getCollection) == null ? void 0 : _b.call(_a, collection);
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
if (!((_c = coll == null ? void 0 : coll.model) == null ? void 0 : _c.rawAttributes)) {
|
|
38
|
+
return { fields, appends };
|
|
39
|
+
}
|
|
40
|
+
const assocKeys = Object.keys(((_d = coll == null ? void 0 : coll.model) == null ? void 0 : _d.associations) || {});
|
|
41
|
+
const rawAttrs = ((_e = coll == null ? void 0 : coll.model) == null ? void 0 : _e.rawAttributes) || {};
|
|
39
42
|
const toCamel = (s) => s.replace(/_([a-zA-Z0-9])/g, (_m, c) => String(c).toUpperCase());
|
|
40
43
|
const toSnake = (s) => s.replace(/([A-Z])/g, "_$1").toLowerCase().replace(/^_/, "");
|
|
41
44
|
const assocMap = /* @__PURE__ */ new Map();
|
|
@@ -81,7 +81,7 @@ async function prefetchRecordsForResolve(koaCtx, bindings) {
|
|
|
81
81
|
group.preferFullRecord
|
|
82
82
|
);
|
|
83
83
|
if ((0, import_records.findRecordRequestCacheValue)(cache, query).hit) continue;
|
|
84
|
-
(0, import_records.setRecordRequestCache)(cache, query, await (0, import_records.fetchRecordOrRecordsJson)(query.repository, query));
|
|
84
|
+
(0, import_records.setRecordRequestCache)(cache, query, await (0, import_records.fetchRecordOrRecordsJson)(query.repository, query, koaCtx));
|
|
85
85
|
} catch (error) {
|
|
86
86
|
log == null ? void 0 : log.debug("[variables.resolve] prefetch query error", {
|
|
87
87
|
...group.target.cacheIdentity,
|
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.
|
|
7
|
+
"version": "2.1.38",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"devDependencies": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"@nocobase/test": "2.x",
|
|
27
27
|
"@nocobase/utils": "2.x"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "cf73a1ede7f46029428d3ed143af2e5dc4f035e6"
|
|
30
30
|
}
|