@nocobase/plugin-flow-engine 2.1.11 → 2.2.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/externalVersion.js +9 -9
  2. package/dist/locale/en-US.json +1 -0
  3. package/dist/locale/index.d.ts +2 -0
  4. package/dist/locale/zh-CN.json +1 -0
  5. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  6. package/dist/node_modules/acorn/package.json +1 -1
  7. package/dist/node_modules/acorn-jsx/package.json +1 -1
  8. package/dist/node_modules/acorn-walk/package.json +1 -1
  9. package/dist/node_modules/ses/package.json +1 -1
  10. package/dist/node_modules/zod/package.json +1 -1
  11. package/dist/server/flow-surfaces/runjs-authoring/rules.js +0 -2
  12. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.d.ts +0 -1
  13. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +11 -19
  14. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.d.ts +0 -12
  15. package/dist/server/flow-surfaces/runjs-authoring/scan/index.d.ts +0 -14
  16. package/dist/server/flow-surfaces/runjs-authoring/scan/index.js +1 -7
  17. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.d.ts +0 -14
  18. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.js +18 -73
  19. package/dist/server/flow-surfaces/runjs-authoring/types.d.ts +1 -1
  20. package/dist/server/flow-surfaces/runjs-authoring/validators/index.js +9 -53
  21. package/dist/server/flow-surfaces/service.d.ts +8 -0
  22. package/dist/server/flow-surfaces/service.js +126 -11
  23. package/package.json +2 -2
  24. package/dist/server/flow-surfaces/runjs-authoring/blocked-global-stop/index.d.ts +0 -10
  25. package/dist/server/flow-surfaces/runjs-authoring/blocked-global-stop/index.js +0 -40
@@ -8,16 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.11",
11
+ "@nocobase/client": "2.2.0-alpha.2",
12
12
  "lodash": "4.18.1",
13
- "@nocobase/database": "2.1.11",
14
- "@nocobase/data-source-manager": "2.1.11",
15
- "@nocobase/resourcer": "2.1.11",
16
- "@nocobase/utils": "2.1.11",
17
- "@nocobase/cache": "2.1.11",
18
- "@nocobase/server": "2.1.11",
19
- "@nocobase/actions": "2.1.11",
13
+ "@nocobase/database": "2.2.0-alpha.2",
14
+ "@nocobase/data-source-manager": "2.2.0-alpha.2",
15
+ "@nocobase/resourcer": "2.2.0-alpha.2",
16
+ "@nocobase/utils": "2.2.0-alpha.2",
17
+ "@nocobase/cache": "2.2.0-alpha.2",
18
+ "@nocobase/server": "2.2.0-alpha.2",
19
+ "@nocobase/actions": "2.2.0-alpha.2",
20
20
  "sequelize": "6.35.2",
21
21
  "@formily/json-schema": "2.3.7",
22
- "@nocobase/ai": "2.1.11"
22
+ "@nocobase/ai": "2.2.0-alpha.2"
23
23
  };
@@ -56,6 +56,7 @@
56
56
  "Replace current block with template?": "Replace current block with template?",
57
57
  "Replaced with template block": "Replaced with template block",
58
58
  "Render failed": "Render failed",
59
+ "Response record": "Response record",
59
60
  "Step configuration": "Step configuration",
60
61
  "Step parameter configuration": "Step parameter configuration",
61
62
  "Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
@@ -65,6 +65,7 @@ export declare const locales: {
65
65
  "Replace current block with template?": string;
66
66
  "Replaced with template block": string;
67
67
  "Render failed": string;
68
+ "Response record": string;
68
69
  "Step configuration": string;
69
70
  "Step parameter configuration": string;
70
71
  "Step with key {{stepKey}} not found": string;
@@ -150,6 +151,7 @@ export declare const locales: {
150
151
  "Other blocks": string;
151
152
  "Previous step": string;
152
153
  "Render failed": string;
154
+ "Response record": string;
153
155
  "Step configuration": string;
154
156
  "Step parameter configuration": string;
155
157
  "Step with key {{stepKey}} not found": string;
@@ -60,6 +60,7 @@
60
60
  "Other blocks": "其他区块",
61
61
  "Previous step": "上一步",
62
62
  "Render failed": "渲染失败",
63
+ "Response record": "响应结果记录",
63
64
  "Step configuration": "步骤配置",
64
65
  "Step parameter configuration": "步骤参数配置",
65
66
  "Step with key {{stepKey}} not found": "未找到key为 {{stepKey}} 的步骤",
@@ -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-06-24T23:37:46.076Z"}
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-06-26T03:50:08.512Z"}
@@ -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-06-24T23:37:46.957Z"}
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-06-26T03:50:09.501Z"}
@@ -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-06-24T23:37:47.378Z"}
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-06-26T03:50:09.958Z"}
@@ -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-06-24T23:37:47.491Z"}
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-06-26T03:50:10.072Z"}
@@ -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-06-24T23:37:46.570Z"}
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-06-26T03:50:09.069Z"}
@@ -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-06-24T23:37:48.595Z"}
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-06-26T03:50:11.249Z"}
@@ -32,7 +32,6 @@ __export(rules_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(rules_exports);
34
34
  var import_blocked_capability_reroute = require("./blocked-capability-reroute");
35
- var import_blocked_global_stop = require("./blocked-global-stop");
36
35
  var import_ctx_libs_member_mismatch_stop = require("./ctx-libs-member-mismatch-stop");
37
36
  var import_ctx_root_mismatch_stop = require("./ctx-root-mismatch-stop");
38
37
  var import_missing_top_level_return = require("./missing-top-level-return");
@@ -61,7 +60,6 @@ const RUNJS_AUTHORING_RULES = [
61
60
  import_replace_innerhtml_with_render.replaceInnerHtmlWithRenderRule,
62
61
  import_render_top_level_function_wrapper.renderTopLevelFunctionWrapperRule,
63
62
  import_render_unreachable_render_call.renderUnreachableRenderCallRule,
64
- import_blocked_global_stop.blockedGlobalStopRule,
65
63
  import_unknown_global_stop.unknownGlobalStopRule,
66
64
  import_blocked_capability_reroute.blockedCapabilityRerouteRule,
67
65
  import_react_runtime_contract_stop.reactRuntimeContractStopRule,
@@ -21,7 +21,6 @@ export declare const BLOCKED_CTX_CAPABILITIES: Record<string, {
21
21
  capability: string;
22
22
  reroute: string;
23
23
  }>;
24
- export declare const FORBIDDEN_BARE_GLOBALS: Set<string>;
25
24
  export declare const RUNJS_ALLOWED_BARE_GLOBALS: Set<string>;
26
25
  export declare const RUNJS_ALLOWED_BARE_GLOBALS_BY_MODEL_USE: Record<string, Set<string>>;
27
26
  export declare const NON_METHOD_CALL_KEYWORDS: Set<string>;
@@ -50,7 +50,6 @@ __export(constants_exports, {
50
50
  FLOW_RESOURCE_CLASS_NAMES: () => FLOW_RESOURCE_CLASS_NAMES,
51
51
  FLOW_RESOURCE_METHODS_BY_TYPE: () => FLOW_RESOURCE_METHODS_BY_TYPE,
52
52
  FLOW_RESOURCE_METHOD_SUGGESTIONS: () => FLOW_RESOURCE_METHOD_SUGGESTIONS,
53
- FORBIDDEN_BARE_GLOBALS: () => FORBIDDEN_BARE_GLOBALS,
54
53
  INIT_RESOURCE_CLASS_NAMES: () => INIT_RESOURCE_CLASS_NAMES,
55
54
  KNOWN_MODEL_USES: () => KNOWN_MODEL_USES,
56
55
  MAX_RUNJS_ERRORS_PER_SOURCE: () => MAX_RUNJS_ERRORS_PER_SOURCE,
@@ -224,7 +223,12 @@ const ALLOWED_CTX_ROOTS = /* @__PURE__ */ new Set([
224
223
  ]);
225
224
  const CHART_CTX_ROOTS = /* @__PURE__ */ new Set(["data"]);
226
225
  const BLOCKED_CTX_CAPABILITIES = {};
227
- const FORBIDDEN_BARE_GLOBALS = /* @__PURE__ */ new Set([
226
+ const RUNJS_ALLOWED_BARE_GLOBALS = /* @__PURE__ */ new Set([
227
+ "ctx",
228
+ "console",
229
+ "window",
230
+ "document",
231
+ "navigator",
228
232
  "fetch",
229
233
  "localStorage",
230
234
  "sessionStorage",
@@ -237,22 +241,6 @@ const FORBIDDEN_BARE_GLOBALS = /* @__PURE__ */ new Set([
237
241
  "EventSource",
238
242
  "indexedDB",
239
243
  "caches",
240
- "Function",
241
- "eval",
242
- "globalThis",
243
- "Intl",
244
- "process",
245
- "require",
246
- "module",
247
- "exports",
248
- "location"
249
- ]);
250
- const RUNJS_ALLOWED_BARE_GLOBALS = /* @__PURE__ */ new Set([
251
- "ctx",
252
- "console",
253
- "window",
254
- "document",
255
- "navigator",
256
244
  "setTimeout",
257
245
  "clearTimeout",
258
246
  "setInterval",
@@ -296,9 +284,14 @@ const RUNJS_ALLOWED_BARE_GLOBALS = /* @__PURE__ */ new Set([
296
284
  "WeakMap",
297
285
  "WeakRef",
298
286
  "WeakSet",
287
+ "Function",
288
+ "eval",
289
+ "globalThis",
290
+ "Intl",
299
291
  "JSON",
300
292
  "Blob",
301
293
  "URL",
294
+ "location",
302
295
  "decodeURI",
303
296
  "decodeURIComponent",
304
297
  "encodeURI",
@@ -714,7 +707,6 @@ function escapeRegExp(value) {
714
707
  FLOW_RESOURCE_CLASS_NAMES,
715
708
  FLOW_RESOURCE_METHODS_BY_TYPE,
716
709
  FLOW_RESOURCE_METHOD_SUGGESTIONS,
717
- FORBIDDEN_BARE_GLOBALS,
718
710
  INIT_RESOURCE_CLASS_NAMES,
719
711
  KNOWN_MODEL_USES,
720
712
  MAX_RUNJS_ERRORS_PER_SOURCE,
@@ -40,9 +40,6 @@ export type RunJsScanResult = RunJsAstInspection & {
40
40
  match: string;
41
41
  }>;
42
42
  dynamicCtxAccesses: IndexedEntry[];
43
- forbiddenBareGlobals: Array<IndexedEntry & {
44
- name: string;
45
- }>;
46
43
  functionRanges: SourceRange[];
47
44
  invalidCtxLibMemberAccesses: InvalidCtxLibMemberAccess[];
48
45
  invalidReactRuntimeBindings: InvalidReactRuntimeBinding[];
@@ -65,15 +62,6 @@ export type RunJsScanResult = RunJsAstInspection & {
65
62
  }>;
66
63
  topLevelReturns: IndexedEntry[];
67
64
  unboundReactCreateElementCalls: IndexedEntry[];
68
- windowDocumentNavigatorAliases: Array<{
69
- alias: string;
70
- index: number;
71
- root: string;
72
- }>;
73
- windowDocumentNavigatorUses: Array<IndexedEntry & {
74
- member: string;
75
- root: string;
76
- }>;
77
65
  };
78
66
  export type RunJsInspectionRuntime = {
79
67
  context: RunJsAuthoringContext;
@@ -149,16 +149,6 @@ export declare function scanJavaScriptSource(source: string, ast?: any, context?
149
149
  alias: string;
150
150
  index: number;
151
151
  }[];
152
- windowDocumentNavigatorUses: {
153
- root: string;
154
- member: string;
155
- index: number;
156
- }[];
157
- windowDocumentNavigatorAliases: {
158
- alias: string;
159
- root: string;
160
- index: number;
161
- }[];
162
152
  ctxAliases: {
163
153
  alias: string;
164
154
  index: number;
@@ -179,10 +169,6 @@ export declare function scanJavaScriptSource(source: string, ast?: any, context?
179
169
  ruleId: "runjs-ctx-member-not-callable";
180
170
  }[];
181
171
  invalidCtxLibMemberAccesses: import("../internal-types").InvalidCtxLibMemberAccess[];
182
- forbiddenBareGlobals: {
183
- name: string;
184
- index: number;
185
- }[];
186
172
  ctxMemberAccesses: {
187
173
  member: string;
188
174
  index: number;
@@ -71,10 +71,7 @@ function scanJavaScriptSource(source, ast, context = {}, modelUse = "") {
71
71
  const flowResourceAliases = (0, import_source_patterns.collectFlowResourceAliases)(masked, sourceBindings);
72
72
  const directDomWrites = (0, import_source_patterns.collectDirectDomWrites)(source, masked, sourceBindings);
73
73
  const directDomAliases = (0, import_source_patterns.collectDirectDomAliases)(masked, sourceBindings);
74
- const windowDocumentNavigatorUses = (0, import_source_patterns.collectWindowDocumentNavigatorUses)(source, masked, sourceBindings);
75
- const windowDocumentNavigatorAliases = (0, import_source_patterns.collectWindowDocumentNavigatorAliases)(masked, sourceBindings);
76
74
  const ctxAliases = (0, import_source_patterns.collectCtxAliases)(masked, sourceBindings);
77
- const forbiddenBareGlobals = (0, import_source_patterns.collectForbiddenBareGlobals)(masked, sourceBindings);
78
75
  return {
79
76
  source,
80
77
  masked,
@@ -126,14 +123,11 @@ function scanJavaScriptSource(source, ast, context = {}, modelUse = "") {
126
123
  ),
127
124
  directDomWrites,
128
125
  directDomAliases,
129
- windowDocumentNavigatorUses,
130
- windowDocumentNavigatorAliases,
131
126
  ctxAliases,
132
127
  ctxLibMemberCaseMismatches: (0, import_source_patterns.collectCtxLibMemberCaseMismatches)(source, masked, sourceBindings),
133
128
  invalidCtxApiMemberAccesses: (astInspection == null ? void 0 : astInspection.invalidCtxApiMemberAccesses) || [],
134
129
  invalidCtxNonFunctionCalls: (astInspection == null ? void 0 : astInspection.invalidCtxNonFunctionCalls) || [],
135
130
  invalidCtxLibMemberAccesses: (astInspection == null ? void 0 : astInspection.invalidCtxLibMemberAccesses) || [],
136
- forbiddenBareGlobals,
137
131
  ctxMemberAccesses: (0, import_source_patterns.collectCtxMemberAccesses)(masked, sourceBindings),
138
132
  dynamicCtxAccesses: (0, import_static_values.findUnboundCtxMatches)(masked, /\bctx\s*(?:\?\.\s*)?\[/g, sourceBindings),
139
133
  isTopLevelFunctionWrapper: (0, import_source_patterns.isTopLevelFunctionWrapper)(masked, functionRanges, topLevelReachableCtxRenderCalls)
@@ -159,7 +153,7 @@ function collectAstUnknownBareGlobalsFromAst(ast, identifierBindings, modelUse)
159
153
  if (!name) {
160
154
  return;
161
155
  }
162
- if (allowedGlobals.has(name) || import_constants.FORBIDDEN_BARE_GLOBALS.has(name)) {
156
+ if (allowedGlobals.has(name)) {
163
157
  return;
164
158
  }
165
159
  const index = typeof node.start === "number" ? node.start : 0;
@@ -7,10 +7,6 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import type { CtxLibMemberCaseMismatch, FlowResourceAlias, ReactComponentAlias, ResourceCallInReactHook, SourceBinding, SourceRange, StringLiteralBinding } from '../internal-types';
10
- export declare function collectForbiddenBareGlobals(masked: string, bindings: SourceBinding[]): {
11
- name: string;
12
- index: number;
13
- }[];
14
10
  export declare function collectInvalidApiResourceCalls(source: string, masked: string, bindings: SourceBinding[]): {
15
11
  index: number;
16
12
  match: string;
@@ -64,16 +60,6 @@ export declare function collectDirectDomWrites(source: string, masked: string, b
64
60
  index: number;
65
61
  match: string;
66
62
  }[];
67
- export declare function collectWindowDocumentNavigatorUses(source: string, masked: string, bindings: SourceBinding[]): {
68
- root: string;
69
- member: string;
70
- index: number;
71
- }[];
72
- export declare function collectWindowDocumentNavigatorAliases(masked: string, bindings: SourceBinding[]): {
73
- alias: string;
74
- root: string;
75
- index: number;
76
- }[];
77
63
  export declare function collectDirectDomAliases(masked: string, bindings: SourceBinding[]): {
78
64
  alias: string;
79
65
  index: number;
@@ -33,7 +33,6 @@ __export(source_patterns_exports, {
33
33
  collectDirectDomAliases: () => collectDirectDomAliases,
34
34
  collectDirectDomWrites: () => collectDirectDomWrites,
35
35
  collectFlowResourceAliases: () => collectFlowResourceAliases,
36
- collectForbiddenBareGlobals: () => collectForbiddenBareGlobals,
37
36
  collectInvalidApiResourceCalls: () => collectInvalidApiResourceCalls,
38
37
  collectInvalidFlowResourceListCalls: () => collectInvalidFlowResourceListCalls,
39
38
  collectInvalidResourceTypeCalls: () => collectInvalidResourceTypeCalls,
@@ -43,8 +42,6 @@ __export(source_patterns_exports, {
43
42
  collectReactHookCalls: () => collectReactHookCalls,
44
43
  collectResourceCallsInReactHooks: () => collectResourceCallsInReactHooks,
45
44
  collectUnboundReactCreateElementCalls: () => collectUnboundReactCreateElementCalls,
46
- collectWindowDocumentNavigatorAliases: () => collectWindowDocumentNavigatorAliases,
47
- collectWindowDocumentNavigatorUses: () => collectWindowDocumentNavigatorUses,
48
45
  getResourceLikeCtxRunjsEntrypoint: () => getResourceLikeCtxRunjsEntrypoint,
49
46
  isResourceLikeCtxRequest: () => isResourceLikeCtxRequest,
50
47
  isTopLevelFunctionWrapper: () => isTopLevelFunctionWrapper
@@ -53,18 +50,6 @@ module.exports = __toCommonJS(source_patterns_exports);
53
50
  var import_constants = require("../runtime/constants");
54
51
  var import_bindings = require("../ast/bindings");
55
52
  var import_source = require("../ast/source");
56
- function collectForbiddenBareGlobals(masked, bindings) {
57
- const entries = [];
58
- for (const name of import_constants.FORBIDDEN_BARE_GLOBALS) {
59
- const pattern = new RegExp(`(?<![.$\\w])${(0, import_source.escapeRegExp)(name)}\\b`, "g");
60
- for (const match of masked.matchAll(pattern)) {
61
- if (!(0, import_bindings.isNameBoundAtIndex)(bindings, name, match.index || 0) && !isObjectPropertyKey(masked, match.index || 0, name)) {
62
- entries.push({ name, index: match.index || 0 });
63
- }
64
- }
65
- }
66
- return entries.sort((left, right) => left.index - right.index);
67
- }
68
53
  function collectInvalidApiResourceCalls(source, masked, bindings) {
69
54
  var _a, _b, _c, _d, _e, _f, _g, _h;
70
55
  const resourceMethods = /* @__PURE__ */ new Set(["list", "get", "create", "update", "destroy"]);
@@ -618,6 +603,16 @@ function collectDirectDomWrites(source, masked, bindings) {
618
603
  }
619
604
  entries.push({ index, match: match[0].replace(/\s*(?:\?\.)?\($/, "") });
620
605
  }
606
+ for (const match of masked.matchAll(
607
+ /\b(document)\s*(?:\?\.|\.)\s*body\s*(?:\?\.|\.)\s*(innerHTML|insertAdjacentHTML)\b|(?<![.$\w])((window|globalThis)\s*(?:\?\.|\.)\s*document)\s*(?:\?\.|\.)\s*body\s*(?:\?\.|\.)\s*(innerHTML|insertAdjacentHTML)\b/g
608
+ )) {
609
+ const index = match.index || 0;
610
+ const root = match[1] || match[4];
611
+ if (root && (0, import_bindings.isNameBoundAtIndex)(bindings, root, index)) {
612
+ continue;
613
+ }
614
+ entries.push({ index, match: match[0] });
615
+ }
621
616
  for (const match of commentMasked.matchAll(
622
617
  /\b(ctx)\s*(?:\?\.|\.)\s*element\s*(?:\?\.\s*)?\[\s*(?:(['"])([A-Za-z_$][\w$]*)\2|([^\]]+))\s*\]/g
623
618
  )) {
@@ -639,71 +634,24 @@ function collectDirectDomWrites(source, masked, bindings) {
639
634
  }
640
635
  }
641
636
  for (const match of commentMasked.matchAll(
642
- /\b(element)\s*(?:\?\.\s*)?\[\s*(?:(['"])([A-Za-z_$][\w$]*)\2|([^\]]+))\s*\]/g
637
+ /(?<![.$\w])(window|globalThis)\s*(?:\?\.\s*)?\[\s*(['"])document\2\s*\]\s*(?:(?:\?\.|\.)\s*createElement|(?:\?\.\s*)?\[\s*(['"])createElement\3\s*\])/g
643
638
  )) {
644
639
  const index = match.index || 0;
645
- const member = match[3] || "";
646
- const dynamicMember = Boolean(match[4]);
647
- if (isCodeTokenAt(masked, index, match[1]) && !(0, import_bindings.isNameBoundAtIndex)(bindings, match[1], index) && (dynamicMember || isDirectDomMember(member))) {
640
+ if (isCodeTokenAt(masked, index, match[1]) && !(0, import_bindings.isNameBoundAtIndex)(bindings, match[1], index)) {
648
641
  entries.push({ index, match: match[0] });
649
642
  }
650
643
  }
651
- return entries;
652
- }
653
- function collectWindowDocumentNavigatorUses(source, masked, bindings) {
654
- const commentMasked = (0, import_source.maskJavaScriptComments)(source);
655
- const entries = [...masked.matchAll(/\b(window|document|navigator)\s*(?:\?\.|\.)\s*([A-Za-z_$][\w$]*)/g)].filter((match) => !(0, import_bindings.isNameBoundAtIndex)(bindings, match[1], match.index || 0)).map((match) => ({
656
- root: match[1],
657
- member: match[2],
658
- index: match.index || 0
659
- }));
660
644
  for (const match of commentMasked.matchAll(
661
- /\b(window|document|navigator)\s*(?:\?\.\s*)?\[\s*(?:(['"])([A-Za-z_$][\w$]*)\2|([^\]]+))\s*\]/g
645
+ /\b(element)\s*(?:\?\.\s*)?\[\s*(?:(['"])([A-Za-z_$][\w$]*)\2|([^\]]+))\s*\]/g
662
646
  )) {
663
647
  const index = match.index || 0;
664
- const root = match[1];
665
- if (!isCodeTokenAt(masked, index, root) || (0, import_bindings.isNameBoundAtIndex)(bindings, root, index)) {
666
- continue;
667
- }
668
- entries.push({
669
- root,
670
- member: match[3] || "[dynamic]",
671
- index
672
- });
673
- }
674
- return entries.sort((left, right) => left.index - right.index);
675
- }
676
- function collectWindowDocumentNavigatorAliases(masked, bindings) {
677
- const entries = [];
678
- collectAliasMatches(
679
- masked,
680
- [
681
- /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(window|document|navigator)\b/g,
682
- /(?<![.$\w])([A-Za-z_$][\w$]*)\s*=\s*(window|document|navigator)\b/g
683
- ],
684
- (match) => {
685
- const alias = match[1];
686
- const root = match[2];
687
- const rootIndex = (match.index || 0) + match[0].lastIndexOf(root);
688
- if (alias === root || (0, import_bindings.isNameBoundAtIndex)(bindings, root, rootIndex)) {
689
- return;
690
- }
691
- entries.push({ alias, root, index: rootIndex });
692
- }
693
- );
694
- for (const match of masked.matchAll(
695
- /\b(?:const|let|var)\s*\{([^}]*)\}\s*=\s*(window|document|navigator)\b(?!\s*(?:\.|\?\.))/g
696
- )) {
697
- const root = match[2];
698
- const rootIndex = (match.index || 0) + match[0].lastIndexOf(root);
699
- if ((0, import_bindings.isNameBoundAtIndex)(bindings, root, rootIndex)) {
700
- continue;
648
+ const member = match[3] || "";
649
+ const dynamicMember = Boolean(match[4]);
650
+ if (isCodeTokenAt(masked, index, match[1]) && !(0, import_bindings.isNameBoundAtIndex)(bindings, match[1], index) && (dynamicMember || isDirectDomMember(member))) {
651
+ entries.push({ index, match: match[0] });
701
652
  }
702
- collectObjectBindingAliases(match[1]).forEach((alias) => {
703
- entries.push({ alias, root, index: rootIndex });
704
- });
705
653
  }
706
- return dedupeAliasEntries(entries);
654
+ return entries;
707
655
  }
708
656
  function collectDirectDomAliases(masked, bindings) {
709
657
  const entries = [];
@@ -871,7 +819,6 @@ function isResourceLikeRunjsEntrypointExpression(value) {
871
819
  collectDirectDomAliases,
872
820
  collectDirectDomWrites,
873
821
  collectFlowResourceAliases,
874
- collectForbiddenBareGlobals,
875
822
  collectInvalidApiResourceCalls,
876
823
  collectInvalidFlowResourceListCalls,
877
824
  collectInvalidResourceTypeCalls,
@@ -881,8 +828,6 @@ function isResourceLikeRunjsEntrypointExpression(value) {
881
828
  collectReactHookCalls,
882
829
  collectResourceCallsInReactHooks,
883
830
  collectUnboundReactCreateElementCalls,
884
- collectWindowDocumentNavigatorAliases,
885
- collectWindowDocumentNavigatorUses,
886
831
  getResourceLikeCtxRunjsEntrypoint,
887
832
  isResourceLikeCtxRequest,
888
833
  isTopLevelFunctionWrapper
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export type RunJsAuthoringRepairClass = 'syntax-stop' | 'nested-runjs-stop' | 'source-limit-stop' | 'switch-to-resource-api' | 'missing-top-level-return' | 'value-surface-forbids-render' | 'unknown-surface-stop' | 'unknown-model-stop' | 'replace-innerhtml-with-render' | 'render-top-level-function-wrapper' | 'render-unreachable-render-call' | 'blocked-global-stop' | 'unknown-global-stop' | 'blocked-capability-reroute' | 'react-runtime-contract-stop' | 'resource-runtime-contract-stop' | 'ctx-libs-member-mismatch-stop' | 'ctx-root-mismatch-stop';
9
+ export type RunJsAuthoringRepairClass = 'syntax-stop' | 'nested-runjs-stop' | 'source-limit-stop' | 'switch-to-resource-api' | 'missing-top-level-return' | 'value-surface-forbids-render' | 'unknown-surface-stop' | 'unknown-model-stop' | 'replace-innerhtml-with-render' | 'render-top-level-function-wrapper' | 'render-unreachable-render-call' | 'unknown-global-stop' | 'blocked-capability-reroute' | 'react-runtime-contract-stop' | 'resource-runtime-contract-stop' | 'ctx-libs-member-mismatch-stop' | 'ctx-root-mismatch-stop';
10
10
  export type RunJsAuthoringSurfaceStyle = 'render' | 'value' | 'action';
11
11
  export interface RunJsAuthoringRuleDefinition {
12
12
  repairClass: RunJsAuthoringRepairClass;
@@ -310,58 +310,7 @@ function collectDirectDomErrors(path, source, scan, modelUse, surface, errors) {
310
310
  );
311
311
  });
312
312
  }
313
- function collectGlobalErrors(path, source, scan, modelUse, surface, errors) {
314
- scan.windowDocumentNavigatorAliases.forEach((entry) => {
315
- errors.push(
316
- (0, import_errors.buildRunJsAuthoringError)({
317
- path,
318
- repairClass: "blocked-global-stop",
319
- message: `flowSurfaces authoring ${path} cannot alias forbidden global ${entry.root}`,
320
- modelUse,
321
- surface,
322
- index: entry.index,
323
- source,
324
- details: {
325
- global: entry.root,
326
- alias: entry.alias
327
- }
328
- })
329
- );
330
- });
331
- scan.windowDocumentNavigatorUses.forEach((entry) => {
332
- errors.push(
333
- (0, import_errors.buildRunJsAuthoringError)({
334
- path,
335
- repairClass: "blocked-global-stop",
336
- ruleId: `runjs-${entry.root}-property-blocked`,
337
- message: `flowSurfaces authoring ${path} cannot access ${entry.root}.${entry.member} in RunJS`,
338
- modelUse,
339
- surface,
340
- index: entry.index,
341
- source,
342
- details: {
343
- global: entry.root,
344
- member: entry.member
345
- }
346
- })
347
- );
348
- });
349
- scan.forbiddenBareGlobals.forEach((entry) => {
350
- errors.push(
351
- (0, import_errors.buildRunJsAuthoringError)({
352
- path,
353
- repairClass: "blocked-global-stop",
354
- message: `flowSurfaces authoring ${path} cannot access forbidden global ${entry.name}`,
355
- modelUse,
356
- surface,
357
- index: entry.index,
358
- source,
359
- details: {
360
- global: entry.name
361
- }
362
- })
363
- );
364
- });
313
+ function collectUnknownGlobalErrors(path, source, scan, modelUse, surface, errors) {
365
314
  scan.unknownBareGlobals.forEach((entry) => {
366
315
  const suggestion = entry.suggestedCapability ? `; use ${entry.suggestedCapability} or assign it to a local variable first` : "; declare or import it before using it";
367
316
  errors.push(
@@ -840,7 +789,14 @@ const RUNJS_INSPECTION_VALIDATORS = [
840
789
  ),
841
790
  createLegacyValidator("dom-global", (runtime, errors) => {
842
791
  collectDirectDomErrors(runtime.input.path, runtime.source, runtime.scan, runtime.modelUse, runtime.surface, errors);
843
- collectGlobalErrors(runtime.input.path, runtime.source, runtime.scan, runtime.modelUse, runtime.surface, errors);
792
+ collectUnknownGlobalErrors(
793
+ runtime.input.path,
794
+ runtime.source,
795
+ runtime.scan,
796
+ runtime.modelUse,
797
+ runtime.surface,
798
+ errors
799
+ );
844
800
  }),
845
801
  createLegacyValidator(
846
802
  "react-runtime",
@@ -82,6 +82,14 @@ export declare class FlowSurfacesService {
82
82
  private assertMenuRouteUpdatable;
83
83
  private assertMenuParentNotSelfOrDescendant;
84
84
  private buildMenuResult;
85
+ private hasDesktopRouteUiLayoutsRelation;
86
+ private normalizeDesktopRouteRelationId;
87
+ private readDesktopRouteUiLayoutUids;
88
+ private resolveDefaultDesktopRouteUiLayoutUids;
89
+ private resolveInheritedDesktopRouteUiLayoutUids;
90
+ private setDesktopRouteUiLayouts;
91
+ private attachDesktopRouteUiLayoutsToRouteAndChildren;
92
+ private ensureDesktopRouteUiLayouts;
85
93
  private isValidMenuIconName;
86
94
  private assertVisibleNavigationIcon;
87
95
  private assertVisibleNavigationRouteIconUpdate;
@@ -689,6 +689,7 @@ function assertNoFlowSurfaceIdTitleFieldSettings(value, options = {}) {
689
689
  };
690
690
  visit(value, options.basePath || []);
691
691
  }
692
+ const DEFAULT_ADMIN_UI_LAYOUT_UID = "admin-layout-model";
692
693
  class FlowSurfacesService {
693
694
  constructor(plugin) {
694
695
  this.plugin = plugin;
@@ -1030,6 +1031,101 @@ class FlowSurfacesService {
1030
1031
  ...extras
1031
1032
  };
1032
1033
  }
1034
+ hasDesktopRouteUiLayoutsRelation() {
1035
+ var _a, _b;
1036
+ try {
1037
+ return !!this.db.getCollection("uiLayouts") && !!((_b = (_a = this.db.getCollection("desktopRoutes")) == null ? void 0 : _a.getField) == null ? void 0 : _b.call(_a, "uiLayouts"));
1038
+ } catch (error) {
1039
+ return false;
1040
+ }
1041
+ }
1042
+ normalizeDesktopRouteRelationId(routeId) {
1043
+ return import_lodash.default.isNil(routeId) ? void 0 : routeId;
1044
+ }
1045
+ async readDesktopRouteUiLayoutUids(routeId, transaction) {
1046
+ const relationRouteId = this.normalizeDesktopRouteRelationId(routeId);
1047
+ if (import_lodash.default.isUndefined(relationRouteId) || !this.hasDesktopRouteUiLayoutsRelation()) {
1048
+ return [];
1049
+ }
1050
+ const uiLayouts = await this.db.getRepository("desktopRoutes.uiLayouts", relationRouteId).find({
1051
+ fields: ["uid"],
1052
+ transaction
1053
+ });
1054
+ return import_lodash.default.uniq(
1055
+ uiLayouts.map((uiLayout) => {
1056
+ var _a;
1057
+ return String(((_a = uiLayout == null ? void 0 : uiLayout.get) == null ? void 0 : _a.call(uiLayout, "uid")) || (uiLayout == null ? void 0 : uiLayout.uid) || "").trim();
1058
+ }).filter(Boolean)
1059
+ );
1060
+ }
1061
+ async resolveDefaultDesktopRouteUiLayoutUids(transaction) {
1062
+ if (!this.hasDesktopRouteUiLayoutsRelation()) {
1063
+ return [];
1064
+ }
1065
+ const defaultLayout = await this.db.getRepository("uiLayouts").findOne({
1066
+ filter: {
1067
+ uid: DEFAULT_ADMIN_UI_LAYOUT_UID,
1068
+ enabled: true
1069
+ },
1070
+ transaction
1071
+ });
1072
+ return defaultLayout ? [DEFAULT_ADMIN_UI_LAYOUT_UID] : [];
1073
+ }
1074
+ async resolveInheritedDesktopRouteUiLayoutUids(parentRoute, transaction) {
1075
+ const parentRouteId = this.readRouteField(parentRoute, "id");
1076
+ if (!import_lodash.default.isNil(parentRouteId)) {
1077
+ const parentLayoutUids = await this.readDesktopRouteUiLayoutUids(parentRouteId, transaction);
1078
+ if (parentLayoutUids.length) {
1079
+ return parentLayoutUids;
1080
+ }
1081
+ }
1082
+ return this.resolveDefaultDesktopRouteUiLayoutUids(transaction);
1083
+ }
1084
+ async setDesktopRouteUiLayouts(routeId, uiLayoutUids, transaction) {
1085
+ const relationRouteId = this.normalizeDesktopRouteRelationId(routeId);
1086
+ if (import_lodash.default.isUndefined(relationRouteId) || !uiLayoutUids.length || !this.hasDesktopRouteUiLayoutsRelation()) {
1087
+ return;
1088
+ }
1089
+ await this.db.getRepository("desktopRoutes.uiLayouts", relationRouteId).set({
1090
+ tk: uiLayoutUids,
1091
+ transaction
1092
+ });
1093
+ }
1094
+ async attachDesktopRouteUiLayoutsToRouteAndChildren(routeId, uiLayoutUids, transaction) {
1095
+ if (import_lodash.default.isNil(routeId) || !uiLayoutUids.length || !this.hasDesktopRouteUiLayoutsRelation()) {
1096
+ return;
1097
+ }
1098
+ await this.setDesktopRouteUiLayouts(routeId, uiLayoutUids, transaction);
1099
+ const children = await this.db.getRepository("desktopRoutes").find({
1100
+ fields: ["id"],
1101
+ filter: {
1102
+ parentId: routeId
1103
+ },
1104
+ transaction
1105
+ });
1106
+ for (const child of children) {
1107
+ await this.attachDesktopRouteUiLayoutsToRouteAndChildren(
1108
+ this.readRouteField(child, "id"),
1109
+ uiLayoutUids,
1110
+ transaction
1111
+ );
1112
+ }
1113
+ }
1114
+ async ensureDesktopRouteUiLayouts(route, transaction) {
1115
+ const routeId = this.readRouteField(route, "id");
1116
+ if (import_lodash.default.isNil(routeId) || !this.hasDesktopRouteUiLayoutsRelation()) {
1117
+ return [];
1118
+ }
1119
+ const existingLayoutUids = await this.readDesktopRouteUiLayoutUids(routeId, transaction);
1120
+ if (existingLayoutUids.length) {
1121
+ return existingLayoutUids;
1122
+ }
1123
+ const parentRouteId = this.readRouteField(route, "parentId");
1124
+ const parentRoute = import_lodash.default.isNil(parentRouteId) ? null : await this.findMenuRouteById(parentRouteId, transaction);
1125
+ const inheritedLayoutUids = await this.resolveInheritedDesktopRouteUiLayoutUids(parentRoute, transaction);
1126
+ await this.setDesktopRouteUiLayouts(routeId, inheritedLayoutUids, transaction);
1127
+ return inheritedLayoutUids;
1128
+ }
1033
1129
  isValidMenuIconName(value) {
1034
1130
  const normalized = String(value || "").trim();
1035
1131
  return !!normalized && ANT_DESIGN_ICON_NAMES.has(normalized);
@@ -1111,7 +1207,7 @@ class FlowSurfacesService {
1111
1207
  this.assertVisibleNavigationIcon("createMenu", "values", values);
1112
1208
  const schemaUid = values.schemaUid || (0, import_utils.uid)();
1113
1209
  const desktopRoutes = this.db.getRepository("desktopRoutes");
1114
- await desktopRoutes.create({
1210
+ const route = await desktopRoutes.create({
1115
1211
  values: {
1116
1212
  type: "group",
1117
1213
  sort: this.allocateRouteSortValue(),
@@ -1124,10 +1220,11 @@ class FlowSurfacesService {
1124
1220
  },
1125
1221
  transaction
1126
1222
  });
1127
- const route = await desktopRoutes.findOne({
1128
- filter: { schemaUid },
1223
+ await this.attachDesktopRouteUiLayoutsToRouteAndChildren(
1224
+ this.readRouteField(route, "id"),
1225
+ await this.resolveInheritedDesktopRouteUiLayoutUids(parentRoute, transaction),
1129
1226
  transaction
1130
- });
1227
+ );
1131
1228
  return this.buildMenuResult(route);
1132
1229
  }
1133
1230
  async createFlowMenuItem(values, transaction) {
@@ -1142,7 +1239,7 @@ class FlowSurfacesService {
1142
1239
  const title = values.title || pageSchemaUid;
1143
1240
  const tabTitle = values.tabTitle || "Untitled";
1144
1241
  const desktopRoutes = this.db.getRepository("desktopRoutes");
1145
- await desktopRoutes.create({
1242
+ const createdRoute = await desktopRoutes.create({
1146
1243
  values: {
1147
1244
  type: "flowPage",
1148
1245
  sort: this.allocateRouteSortValue(),
@@ -1177,6 +1274,11 @@ class FlowSurfacesService {
1177
1274
  },
1178
1275
  transaction
1179
1276
  });
1277
+ await this.attachDesktopRouteUiLayoutsToRouteAndChildren(
1278
+ this.readRouteField(createdRoute, "id"),
1279
+ await this.resolveInheritedDesktopRouteUiLayoutUids(parentRoute, transaction),
1280
+ transaction
1281
+ );
1180
1282
  const route = await desktopRoutes.findOne({
1181
1283
  filter: { schemaUid: pageSchemaUid },
1182
1284
  appends: ["children"],
@@ -5879,7 +5981,7 @@ class FlowSurfacesService {
5879
5981
  (0, import_errors.throwBadRequest)("flowSurfaces updateMenu requires menuRouteId");
5880
5982
  }
5881
5983
  const route = await this.assertMenuRouteUpdatable(menuRouteId, options.transaction);
5882
- await this.assertMenuParentIsGroup(values.parentMenuRouteId, options.transaction);
5984
+ const nextParentRoute = await this.assertMenuParentIsGroup(values.parentMenuRouteId, options.transaction);
5883
5985
  await this.assertMenuParentNotSelfOrDescendant(route, values.parentMenuRouteId, options.transaction);
5884
5986
  const nextOptions = { ...this.readRouteOptions(route) };
5885
5987
  const updateValues = {};
@@ -5910,6 +6012,13 @@ class FlowSurfacesService {
5910
6012
  });
5911
6013
  }
5912
6014
  const updated = await this.findMenuRouteById(menuRouteId, options.transaction);
6015
+ if (updated && Object.prototype.hasOwnProperty.call(values, "parentMenuRouteId")) {
6016
+ await this.attachDesktopRouteUiLayoutsToRouteAndChildren(
6017
+ this.readRouteField(updated, "id"),
6018
+ await this.resolveInheritedDesktopRouteUiLayoutUids(nextParentRoute, options.transaction),
6019
+ options.transaction
6020
+ );
6021
+ }
5913
6022
  return this.buildMenuResult(updated);
5914
6023
  }
5915
6024
  async initializeFlowPageForRoute(route, values, transaction) {
@@ -5917,6 +6026,7 @@ class FlowSurfacesService {
5917
6026
  const pageSchemaUid = this.readRouteField(route, "schemaUid");
5918
6027
  const structure = await this.loadRouteBackedPageStructure(route, transaction);
5919
6028
  let tabRoute = structure.tabRoutes[0];
6029
+ const routeUiLayoutUids = await this.ensureDesktopRouteUiLayouts(route, transaction);
5920
6030
  const routeOptions = this.readRouteOptions(route);
5921
6031
  if (!routeOptions[FLOW_SURFACE_MENU_BINDABLE_OPTION_KEY]) {
5922
6032
  (0, import_errors.throwBadRequest)(`flowSurfaces createPage only accepts a bindable menu route created by createMenu(type="item")`);
@@ -5938,7 +6048,7 @@ class FlowSurfacesService {
5938
6048
  const tabSchemaUid2 = values.tabSchemaUid || (0, import_utils.uid)();
5939
6049
  const tabSchemaName2 = values.tabSchemaName || (0, import_utils.uid)();
5940
6050
  const tabTitle = values.tabTitle || "Untitled";
5941
- await this.db.getRepository("desktopRoutes").create({
6051
+ tabRoute = await this.db.getRepository("desktopRoutes").create({
5942
6052
  values: {
5943
6053
  type: "tabs",
5944
6054
  sort: this.allocateRouteSortValue(1),
@@ -5955,10 +6065,7 @@ class FlowSurfacesService {
5955
6065
  },
5956
6066
  transaction
5957
6067
  });
5958
- tabRoute = await this.db.getRepository("desktopRoutes").findOne({
5959
- filter: { schemaUid: tabSchemaUid2 },
5960
- transaction
5961
- });
6068
+ await this.setDesktopRouteUiLayouts(this.readRouteField(tabRoute, "id"), routeUiLayoutUids, transaction);
5962
6069
  } else {
5963
6070
  await this.db.getRepository("desktopRoutes").update({
5964
6071
  filterByTk: String(this.readRouteField(tabRoute, "id")),
@@ -5982,6 +6089,9 @@ class FlowSurfacesService {
5982
6089
  transaction
5983
6090
  });
5984
6091
  }
6092
+ if (tabRoute) {
6093
+ await this.setDesktopRouteUiLayouts(this.readRouteField(tabRoute, "id"), routeUiLayoutUids, transaction);
6094
+ }
5985
6095
  await this.ensureFlowRoutePageSchemaShell(pageSchemaUid, transaction);
5986
6096
  await this.db.getRepository("desktopRoutes").update({
5987
6097
  filterByTk: String(routeId),
@@ -6121,6 +6231,11 @@ class FlowSurfacesService {
6121
6231
  },
6122
6232
  transaction: options.transaction
6123
6233
  });
6234
+ await this.setDesktopRouteUiLayouts(
6235
+ route.get("id"),
6236
+ await this.ensureDesktopRouteUiLayouts(pageRoute, options.transaction),
6237
+ options.transaction
6238
+ );
6124
6239
  const gridUid = await this.ensureGridChild(tabSchemaUid, "BlockGridModel", options.transaction);
6125
6240
  const result = {
6126
6241
  pageUid: pageTarget.uid,
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.11",
7
+ "version": "2.2.0-alpha.2",
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": "1ccf891d837e21089f65f84b892407b34a0a0cb9"
29
+ "gitHead": "9dd5224bb8f6c1ac12d766b9f175bdc29bddd845"
30
30
  }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import type { RunJsAuthoringRuleDefinition } from '../types';
10
- export declare const blockedGlobalStopRule: RunJsAuthoringRuleDefinition;
@@ -1,40 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- 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 blocked_global_stop_exports = {};
28
- __export(blocked_global_stop_exports, {
29
- blockedGlobalStopRule: () => blockedGlobalStopRule
30
- });
31
- module.exports = __toCommonJS(blocked_global_stop_exports);
32
- const blockedGlobalStopRule = {
33
- repairClass: "blocked-global-stop",
34
- defaultRuleId: "runjs-global-blocked",
35
- suggestedAction: "Replace forbidden browser/runtime globals with supported ctx APIs."
36
- };
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- blockedGlobalStopRule
40
- });