@nocobase/plugin-flow-engine 2.1.0-beta.44 → 2.1.0-beta.45
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/client/index.js +1 -1
- 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/repository.d.ts +3 -0
- package/dist/server/repository.js +94 -27
- package/dist/server/template/contexts.d.ts +2 -0
- package/dist/server/template/contexts.js +34 -0
- package/dist/server/template/resolver.js +233 -22
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-flow-engine",["@nocobase/client"],t):"object"==typeof exports?exports["@nocobase/plugin-flow-engine"]=t(require("@nocobase/client")):e["@nocobase/plugin-flow-engine"]=t(e["@nocobase/client"])}(self,function(e){return function(){"use strict";var t={342:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.g.importScripts&&(o=r.g.location+"");var o,i=r.g.document;if(!o&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(o=i.currentScript.src),!o)){var u=i.getElementsByTagName("script");if(u.length)for(var c=u.length-1;c>-1&&(!o||!/^http(s?):/.test(o));)o=u[c--].src}if(!o)throw Error("Automatic publicPath is not supported in this browser");r.p=o.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var a={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-flow-engine/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-flow-engine",["@nocobase/client"],t):"object"==typeof exports?exports["@nocobase/plugin-flow-engine"]=t(require("@nocobase/client")):e["@nocobase/plugin-flow-engine"]=t(e["@nocobase/client"])}(self,function(e){return function(){"use strict";var t={342:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.g.importScripts&&(o=r.g.location+"");var o,i=r.g.document;if(!o&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(o=i.currentScript.src),!o)){var u=i.getElementsByTagName("script");if(u.length)for(var c=u.length-1;c>-1&&(!o||!/^http(s?):/.test(o));)o=u[c--].src}if(!o)throw Error("Automatic publicPath is not supported in this browser");r.p=o.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var a={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-flow-engine/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var u=window.location.pathname||"/",c=u.indexOf(i);e=c>=0?u.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-flow-engine/dist/client/"}r.p=e}(),!function(){r.r(a),r.d(a,{PluginFlowEngineClient:function(){return p}});var e=r(342);function t(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var u=e.apply(n,r);function c(e){t(u,o,i,c,a,"next",e)}function a(e){t(u,o,i,c,a,"throw",e)}c(void 0)})}}function o(e,t,n){return(o=l()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&u(o,n.prototype),o}).apply(null,arguments)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function f(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var p=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=i(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,l()?Reflect.construct(e,t||[],i(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&u(r,e),t=[{key:"afterAdd",value:function(){return n(function(){return f(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return n(function(){return f(this,function(e){return[2]})})()}},{key:"load",value:function(){return n(function(){return f(this,function(e){return[2]})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(c(e.Plugin));a.default=p}(),a}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.45",
|
|
12
12
|
"lodash": "4.18.1",
|
|
13
|
-
"@nocobase/database": "2.1.0-beta.
|
|
14
|
-
"@nocobase/data-source-manager": "2.1.0-beta.
|
|
15
|
-
"@nocobase/resourcer": "2.1.0-beta.
|
|
16
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
17
|
-
"@nocobase/cache": "2.1.0-beta.
|
|
18
|
-
"@nocobase/server": "2.1.0-beta.
|
|
19
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
13
|
+
"@nocobase/database": "2.1.0-beta.45",
|
|
14
|
+
"@nocobase/data-source-manager": "2.1.0-beta.45",
|
|
15
|
+
"@nocobase/resourcer": "2.1.0-beta.45",
|
|
16
|
+
"@nocobase/utils": "2.1.0-beta.45",
|
|
17
|
+
"@nocobase/cache": "2.1.0-beta.45",
|
|
18
|
+
"@nocobase/server": "2.1.0-beta.45",
|
|
19
|
+
"@nocobase/actions": "2.1.0-beta.45",
|
|
20
20
|
"sequelize": "6.35.2",
|
|
21
21
|
"@formily/json-schema": "2.3.7",
|
|
22
|
-
"@nocobase/ai": "2.1.0-beta.
|
|
22
|
+
"@nocobase/ai": "2.1.0-beta.45"
|
|
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-06-
|
|
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-08T04:32:04.197Z"}
|
|
@@ -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-
|
|
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-08T04:32:05.094Z"}
|
|
@@ -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-
|
|
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-08T04:32:05.515Z"}
|
|
@@ -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-
|
|
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-08T04:32:05.627Z"}
|
|
@@ -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-
|
|
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-08T04:32:04.705Z"}
|
|
@@ -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-
|
|
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-08T04:32:06.743Z"}
|
|
@@ -101,6 +101,9 @@ export declare class FlowModelRepository extends Repository {
|
|
|
101
101
|
private findSiblingInfo;
|
|
102
102
|
private findSiblingSortRows;
|
|
103
103
|
private writeSiblingSorts;
|
|
104
|
+
private normalizeSiblingSorts;
|
|
105
|
+
private isAncestorOf;
|
|
106
|
+
private updateModelParentOptions;
|
|
104
107
|
protected findNodeSchemaWithParent(uid: any, transaction: any): Promise<{
|
|
105
108
|
parentUid: string;
|
|
106
109
|
schema: any;
|
|
@@ -996,6 +996,51 @@ WHERE TreeTable.depth = 1 AND TreeTable.ancestor = :ancestor and TreeTable.sort
|
|
|
996
996
|
}
|
|
997
997
|
await this.clearXUidPathCache(parentUid, transaction2);
|
|
998
998
|
}
|
|
999
|
+
async normalizeSiblingSorts(info, transaction2) {
|
|
1000
|
+
if (!info) {
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
const siblingRows = await this.findSiblingSortRows(info.parentUid, info.type, transaction2);
|
|
1004
|
+
await this.writeSiblingSorts(
|
|
1005
|
+
info.parentUid,
|
|
1006
|
+
siblingRows.map((row) => row.uid),
|
|
1007
|
+
transaction2
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
async isAncestorOf(ancestorUid, descendantUid, transaction2) {
|
|
1011
|
+
const rows = await this.database.sequelize.query(
|
|
1012
|
+
this.sqlAdapter(`SELECT 1 as v
|
|
1013
|
+
FROM ${this.flowModelTreePathTableName}
|
|
1014
|
+
WHERE ancestor = :ancestorUid
|
|
1015
|
+
AND descendant = :descendantUid
|
|
1016
|
+
AND depth > 0
|
|
1017
|
+
LIMIT 1`),
|
|
1018
|
+
{
|
|
1019
|
+
type: "SELECT",
|
|
1020
|
+
replacements: { ancestorUid, descendantUid },
|
|
1021
|
+
transaction: transaction2
|
|
1022
|
+
}
|
|
1023
|
+
);
|
|
1024
|
+
return rows.length > 0;
|
|
1025
|
+
}
|
|
1026
|
+
async updateModelParentOptions(uid2, parentId, subKey, subType, transaction2) {
|
|
1027
|
+
const modelInstance = await this.model.findByPk(uid2, { transaction: transaction2 });
|
|
1028
|
+
if (!modelInstance) {
|
|
1029
|
+
throw new Error(`flowModels:move sourceId '${uid2}' not found`);
|
|
1030
|
+
}
|
|
1031
|
+
await modelInstance.update(
|
|
1032
|
+
{
|
|
1033
|
+
options: {
|
|
1034
|
+
...import_lodash.default.omit(_FlowModelRepository.optionsToJson(modelInstance.get("options") || {}), ["uid"]),
|
|
1035
|
+
parentId,
|
|
1036
|
+
parent: parentId,
|
|
1037
|
+
subKey,
|
|
1038
|
+
subType
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
{ transaction: transaction2, hooks: false }
|
|
1042
|
+
);
|
|
1043
|
+
}
|
|
999
1044
|
async findNodeSchemaWithParent(uid2, transaction2) {
|
|
1000
1045
|
const schema = await this.database.getRepository("flowModels").findOne({
|
|
1001
1046
|
filter: {
|
|
@@ -1538,40 +1583,62 @@ WHERE TreeTable.depth = 1 AND TreeTable.ancestor = :ancestor and TreeTable.sort
|
|
|
1538
1583
|
throw new Error("flowModels:move invalid position");
|
|
1539
1584
|
}
|
|
1540
1585
|
const transaction2 = transactionOptions == null ? void 0 : transactionOptions.transaction;
|
|
1586
|
+
const sourceInstance = await this.model.findByPk(sourceUid, { transaction: transaction2 });
|
|
1587
|
+
if (!sourceInstance) {
|
|
1588
|
+
throw new Error(`flowModels:move sourceId '${sourceUid}' not found`);
|
|
1589
|
+
}
|
|
1541
1590
|
if (sourceUid === targetUid) {
|
|
1542
|
-
|
|
1543
|
-
if (sourceInfo2) {
|
|
1544
|
-
const siblingRows2 = await this.findSiblingSortRows(sourceInfo2.parentUid, sourceInfo2.type, transaction2);
|
|
1545
|
-
await this.writeSiblingSorts(
|
|
1546
|
-
sourceInfo2.parentUid,
|
|
1547
|
-
siblingRows2.map((row) => row.uid),
|
|
1548
|
-
transaction2
|
|
1549
|
-
);
|
|
1550
|
-
}
|
|
1591
|
+
await this.normalizeSiblingSorts(await this.findSiblingInfo(sourceUid, transaction2), transaction2);
|
|
1551
1592
|
return null;
|
|
1552
1593
|
}
|
|
1553
1594
|
const sourceInfo = await this.findSiblingInfo(sourceUid, transaction2);
|
|
1554
1595
|
const targetInfo = await this.findSiblingInfo(targetUid, transaction2);
|
|
1555
|
-
if (!
|
|
1556
|
-
throw new Error("flowModels:move
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
if (
|
|
1565
|
-
|
|
1596
|
+
if (!targetInfo) {
|
|
1597
|
+
throw new Error("flowModels:move target is not attached to a parent");
|
|
1598
|
+
}
|
|
1599
|
+
const targetInstance = await this.model.findByPk(targetUid, { transaction: transaction2 });
|
|
1600
|
+
const targetOptions = _FlowModelRepository.optionsToJson((targetInstance == null ? void 0 : targetInstance.get("options")) || {});
|
|
1601
|
+
const targetSubType = targetOptions.subType === "object" ? "object" : "array";
|
|
1602
|
+
if (targetInfo.parentUid === sourceUid || await this.isAncestorOf(sourceUid, targetInfo.parentUid, transaction2)) {
|
|
1603
|
+
throw new Error("flowModels:move cycle detected");
|
|
1604
|
+
}
|
|
1605
|
+
if ((sourceInfo == null ? void 0 : sourceInfo.parentUid) === targetInfo.parentUid && sourceInfo.type === targetInfo.type) {
|
|
1606
|
+
const siblingRows = await this.findSiblingSortRows(sourceInfo.parentUid, sourceInfo.type, transaction2);
|
|
1607
|
+
const sourceRow = siblingRows.find((row) => row.uid === sourceUid);
|
|
1608
|
+
const targetIndex = siblingRows.findIndex((row) => row.uid === targetUid);
|
|
1609
|
+
if (!sourceRow || targetIndex === -1) {
|
|
1610
|
+
throw new Error("flowModels:move source and target must be sibling nodes under the same parent/subKey");
|
|
1611
|
+
}
|
|
1612
|
+
const rowsWithoutSource = siblingRows.filter((row) => row.uid !== sourceUid);
|
|
1613
|
+
const insertIndex = rowsWithoutSource.findIndex((row) => row.uid === targetUid);
|
|
1614
|
+
rowsWithoutSource.splice(position === "after" ? insertIndex + 1 : insertIndex, 0, sourceRow);
|
|
1615
|
+
await this.writeSiblingSorts(
|
|
1616
|
+
sourceInfo.parentUid,
|
|
1617
|
+
rowsWithoutSource.map((row) => row.uid),
|
|
1618
|
+
transaction2
|
|
1619
|
+
);
|
|
1620
|
+
return await this.findModelById(sourceUid, { transaction: transaction2 });
|
|
1566
1621
|
}
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
await this.
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1622
|
+
await this.normalizeSiblingSorts(sourceInfo, transaction2);
|
|
1623
|
+
await this.normalizeSiblingSorts(targetInfo, transaction2);
|
|
1624
|
+
await this.updateModelParentOptions(sourceUid, targetInfo.parentUid, targetInfo.type, targetSubType, transaction2);
|
|
1625
|
+
await this.insertSingleNode(
|
|
1626
|
+
{
|
|
1627
|
+
uid: sourceUid,
|
|
1628
|
+
name: sourceUid,
|
|
1629
|
+
childOptions: {
|
|
1630
|
+
parentUid: targetInfo.parentUid,
|
|
1631
|
+
type: targetInfo.type,
|
|
1632
|
+
position: {
|
|
1633
|
+
type: position,
|
|
1634
|
+
target: targetUid
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
{ transaction: transaction2, removeParentsIfNoChildren: false }
|
|
1574
1639
|
);
|
|
1640
|
+
await this.normalizeSiblingSorts(sourceInfo, transaction2);
|
|
1641
|
+
await this.normalizeSiblingSorts(await this.findSiblingInfo(sourceUid, transaction2), transaction2);
|
|
1575
1642
|
return await this.findModelById(sourceUid, { transaction: transaction2 });
|
|
1576
1643
|
}
|
|
1577
1644
|
};
|
|
@@ -50,6 +50,8 @@ export declare class ServerBaseContext {
|
|
|
50
50
|
delegate(ctx: ServerBaseContext): void;
|
|
51
51
|
/** 清空所有委托 */
|
|
52
52
|
clearDelegates(): void;
|
|
53
|
+
getSandboxKeys(): string[];
|
|
54
|
+
getSandboxValue(key: string, current?: ServerBaseContext): any;
|
|
53
55
|
/** 创建并返回代理对象(同一实例下保持稳定引用) */
|
|
54
56
|
createProxy(): any;
|
|
55
57
|
}
|
|
@@ -42,6 +42,10 @@ __export(contexts_exports, {
|
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(contexts_exports);
|
|
44
44
|
var import_lodash = __toESM(require("lodash"));
|
|
45
|
+
const BLOCKED_SANDBOX_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor", "then"]);
|
|
46
|
+
function isBlockedSandboxKey(key) {
|
|
47
|
+
return BLOCKED_SANDBOX_KEYS.has(key);
|
|
48
|
+
}
|
|
45
49
|
class ServerBaseContext {
|
|
46
50
|
_props = {};
|
|
47
51
|
_methods = {};
|
|
@@ -106,6 +110,36 @@ class ServerBaseContext {
|
|
|
106
110
|
clearDelegates() {
|
|
107
111
|
this._delegates = [];
|
|
108
112
|
}
|
|
113
|
+
getSandboxKeys() {
|
|
114
|
+
const keys = /* @__PURE__ */ new Set();
|
|
115
|
+
for (const key of Object.keys(this._props)) {
|
|
116
|
+
if (!isBlockedSandboxKey(key)) keys.add(key);
|
|
117
|
+
}
|
|
118
|
+
for (const key of Object.keys(this._methods)) {
|
|
119
|
+
if (!isBlockedSandboxKey(key)) keys.add(key);
|
|
120
|
+
}
|
|
121
|
+
for (const d of this._delegates) {
|
|
122
|
+
for (const key of d.getSandboxKeys()) {
|
|
123
|
+
if (!isBlockedSandboxKey(key)) keys.add(key);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return Array.from(keys);
|
|
127
|
+
}
|
|
128
|
+
getSandboxValue(key, current = this.createProxy()) {
|
|
129
|
+
if (isBlockedSandboxKey(key)) return void 0;
|
|
130
|
+
if (Object.prototype.hasOwnProperty.call(this._props, key)) {
|
|
131
|
+
return this._getOwn(key, current);
|
|
132
|
+
}
|
|
133
|
+
if (Object.prototype.hasOwnProperty.call(this._methods, key)) {
|
|
134
|
+
const fn = this._methods[key];
|
|
135
|
+
return typeof fn === "function" ? fn.bind(this) : fn;
|
|
136
|
+
}
|
|
137
|
+
for (const d of this._delegates) {
|
|
138
|
+
if (!d.getSandboxKeys().includes(key)) continue;
|
|
139
|
+
return d.getSandboxValue(key, current);
|
|
140
|
+
}
|
|
141
|
+
return void 0;
|
|
142
|
+
}
|
|
109
143
|
/** 创建并返回代理对象(同一实例下保持稳定引用) */
|
|
110
144
|
createProxy() {
|
|
111
145
|
if (this._proxy) return this._proxy;
|
|
@@ -42,6 +42,16 @@ __export(resolver_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(resolver_exports);
|
|
43
43
|
var import_ses = require("ses");
|
|
44
44
|
var import_lodash = __toESM(require("lodash"));
|
|
45
|
+
var import_utils = require("@nocobase/utils");
|
|
46
|
+
var import_contexts = require("./contexts");
|
|
47
|
+
const BLOCKED_SANDBOX_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
48
|
+
const sandboxProxyCache = /* @__PURE__ */ new WeakMap();
|
|
49
|
+
const sandboxProxyMeta = /* @__PURE__ */ new WeakMap();
|
|
50
|
+
const EMPTY_SANDBOX_CONTEXT = {
|
|
51
|
+
getSandboxKeys: () => [],
|
|
52
|
+
getSandboxValue: () => void 0
|
|
53
|
+
};
|
|
54
|
+
let resolverLockdownReady = false;
|
|
45
55
|
async function resolveJsonTemplate(template, ctx) {
|
|
46
56
|
const compile = async (source) => {
|
|
47
57
|
if (typeof source === "string" && /\{\{.*?\}\}/.test(source)) {
|
|
@@ -75,6 +85,210 @@ async function replacePlaceholders(input, ctx) {
|
|
|
75
85
|
}
|
|
76
86
|
return result;
|
|
77
87
|
}
|
|
88
|
+
function isObjectLike(value) {
|
|
89
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
90
|
+
}
|
|
91
|
+
function isTrustedPromise(value) {
|
|
92
|
+
return value instanceof Promise;
|
|
93
|
+
}
|
|
94
|
+
function isBlockedSandboxKey(key) {
|
|
95
|
+
return typeof key === "string" && BLOCKED_SANDBOX_KEYS.has(key);
|
|
96
|
+
}
|
|
97
|
+
function getSandboxDataDescriptor(source, key) {
|
|
98
|
+
if (isBlockedSandboxKey(key) || typeof key === "symbol") return void 0;
|
|
99
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(source, key);
|
|
100
|
+
if (!descriptor || !("value" in descriptor)) return void 0;
|
|
101
|
+
if (key === "then" && typeof descriptor.value === "function") return void 0;
|
|
102
|
+
return descriptor;
|
|
103
|
+
}
|
|
104
|
+
function getPrimitiveDataDescriptor(source, key) {
|
|
105
|
+
if (source == null || isObjectLike(source)) return void 0;
|
|
106
|
+
return getSandboxDataDescriptor(Object(source), key);
|
|
107
|
+
}
|
|
108
|
+
function isSandboxContextSource(value) {
|
|
109
|
+
return value === EMPTY_SANDBOX_CONTEXT || value instanceof import_contexts.ServerBaseContext;
|
|
110
|
+
}
|
|
111
|
+
function wrapSandboxValue(value) {
|
|
112
|
+
if (isTrustedPromise(value)) {
|
|
113
|
+
return Promise.prototype.then.call(value, (resolved) => wrapSandboxValue(resolved));
|
|
114
|
+
}
|
|
115
|
+
if (!isObjectLike(value)) return value;
|
|
116
|
+
if (sandboxProxyMeta.has(value)) return value;
|
|
117
|
+
const cached = sandboxProxyCache.get(value);
|
|
118
|
+
if (cached) return cached;
|
|
119
|
+
const kind = isSandboxContextSource(value) ? "context" : typeof value === "function" ? "function" : "data";
|
|
120
|
+
const proxy = kind === "context" ? createSandboxContextProxy(value) : kind === "function" ? createSandboxFunctionProxy(value) : createSandboxDataProxy(value);
|
|
121
|
+
sandboxProxyCache.set(value, proxy);
|
|
122
|
+
sandboxProxyMeta.set(proxy, { kind, source: value });
|
|
123
|
+
return proxy;
|
|
124
|
+
}
|
|
125
|
+
function wrapRootSandboxContext(ctx) {
|
|
126
|
+
return wrapSandboxValue(isSandboxContextSource(ctx) ? ctx : EMPTY_SANDBOX_CONTEXT);
|
|
127
|
+
}
|
|
128
|
+
function ensureResolverLockdown() {
|
|
129
|
+
if (resolverLockdownReady) return;
|
|
130
|
+
(0, import_utils.lockdownSes)({
|
|
131
|
+
consoleTaming: "unsafe",
|
|
132
|
+
errorTaming: "unsafe",
|
|
133
|
+
overrideTaming: "moderate",
|
|
134
|
+
stackFiltering: "verbose"
|
|
135
|
+
});
|
|
136
|
+
resolverLockdownReady = true;
|
|
137
|
+
}
|
|
138
|
+
function createSandboxContextProxy(source) {
|
|
139
|
+
return new Proxy(/* @__PURE__ */ Object.create(null), {
|
|
140
|
+
get: (_target, key) => {
|
|
141
|
+
if (isBlockedSandboxKey(key) || typeof key !== "string") return void 0;
|
|
142
|
+
if (!source.getSandboxKeys().includes(key)) return void 0;
|
|
143
|
+
return wrapSandboxValue(source.getSandboxValue(key));
|
|
144
|
+
},
|
|
145
|
+
has: (_target, key) => typeof key === "string" && source.getSandboxKeys().includes(key),
|
|
146
|
+
ownKeys: () => source.getSandboxKeys(),
|
|
147
|
+
getOwnPropertyDescriptor: (_target, key) => {
|
|
148
|
+
if (isBlockedSandboxKey(key) || typeof key !== "string" || !source.getSandboxKeys().includes(key)) {
|
|
149
|
+
return void 0;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
configurable: true,
|
|
153
|
+
enumerable: true,
|
|
154
|
+
value: wrapSandboxValue(source.getSandboxValue(key))
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
getPrototypeOf: () => null,
|
|
158
|
+
set: () => false,
|
|
159
|
+
defineProperty: () => false,
|
|
160
|
+
deleteProperty: () => false
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function createSandboxFunctionProxy(source) {
|
|
164
|
+
const callable = (...args) => Reflect.apply(source, void 0, args);
|
|
165
|
+
return new Proxy(callable, {
|
|
166
|
+
apply: (_target, _thisArg, argArray) => wrapSandboxValue(Reflect.apply(source, void 0, argArray)),
|
|
167
|
+
get: (_target, key) => {
|
|
168
|
+
if (key === "length" || key === "name") return Reflect.get(source, key);
|
|
169
|
+
return void 0;
|
|
170
|
+
},
|
|
171
|
+
has: (_target, key) => key === "length" || key === "name",
|
|
172
|
+
ownKeys: () => [],
|
|
173
|
+
getOwnPropertyDescriptor: () => void 0,
|
|
174
|
+
getPrototypeOf: () => null,
|
|
175
|
+
set: () => false,
|
|
176
|
+
defineProperty: () => false,
|
|
177
|
+
deleteProperty: () => false
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function createSandboxDataProxy(source) {
|
|
181
|
+
const target = Array.isArray(source) ? new Array(source.length) : /* @__PURE__ */ Object.create(null);
|
|
182
|
+
return new Proxy(target, {
|
|
183
|
+
get: (_target, key) => {
|
|
184
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
185
|
+
if (!descriptor) return void 0;
|
|
186
|
+
const value = descriptor.value;
|
|
187
|
+
return typeof value === "function" ? wrapSandboxValue(value.bind(source)) : wrapSandboxValue(value);
|
|
188
|
+
},
|
|
189
|
+
has: (_target, key) => {
|
|
190
|
+
if (isBlockedSandboxKey(key) || typeof key !== "string") return false;
|
|
191
|
+
return !!getSandboxDataDescriptor(source, key);
|
|
192
|
+
},
|
|
193
|
+
ownKeys: () => {
|
|
194
|
+
const keys = Reflect.ownKeys(source).filter((key) => {
|
|
195
|
+
if (typeof key !== "string" || isBlockedSandboxKey(key)) return false;
|
|
196
|
+
return !!getSandboxDataDescriptor(source, key);
|
|
197
|
+
});
|
|
198
|
+
if (Array.isArray(source) && !keys.includes("length")) keys.push("length");
|
|
199
|
+
return keys;
|
|
200
|
+
},
|
|
201
|
+
getOwnPropertyDescriptor: (proxyTarget, key) => {
|
|
202
|
+
if (isBlockedSandboxKey(key) || typeof key === "symbol") return void 0;
|
|
203
|
+
if (Array.isArray(source) && key === "length") {
|
|
204
|
+
return Reflect.getOwnPropertyDescriptor(proxyTarget, key);
|
|
205
|
+
}
|
|
206
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
207
|
+
if (!descriptor) return void 0;
|
|
208
|
+
return {
|
|
209
|
+
configurable: true,
|
|
210
|
+
enumerable: descriptor.enumerable,
|
|
211
|
+
writable: false,
|
|
212
|
+
value: wrapSandboxValue(descriptor.value)
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
getPrototypeOf: () => null,
|
|
216
|
+
set: () => false,
|
|
217
|
+
defineProperty: () => false,
|
|
218
|
+
deleteProperty: () => false
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
async function unwrapSandboxValue(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
222
|
+
const resolved = isTrustedPromise(value) ? await value : value;
|
|
223
|
+
if (!isObjectLike(resolved)) return resolved;
|
|
224
|
+
const meta = sandboxProxyMeta.get(resolved);
|
|
225
|
+
if ((meta == null ? void 0 : meta.kind) === "function" || typeof resolved === "function") return void 0;
|
|
226
|
+
const source = (meta == null ? void 0 : meta.source) ?? resolved;
|
|
227
|
+
if (!isObjectLike(source)) return source;
|
|
228
|
+
if (seen.has(source)) return seen.get(source);
|
|
229
|
+
if (isSandboxContextSource(source)) {
|
|
230
|
+
const out2 = {};
|
|
231
|
+
seen.set(source, out2);
|
|
232
|
+
for (const key of source.getSandboxKeys()) {
|
|
233
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) continue;
|
|
234
|
+
out2[key] = await unwrapSandboxValue(wrapSandboxValue(source.getSandboxValue(key)), seen);
|
|
235
|
+
}
|
|
236
|
+
return out2;
|
|
237
|
+
}
|
|
238
|
+
if (Array.isArray(source)) {
|
|
239
|
+
const out2 = [];
|
|
240
|
+
seen.set(source, out2);
|
|
241
|
+
const lengthDescriptor = Reflect.getOwnPropertyDescriptor(source, "length");
|
|
242
|
+
const length = typeof (lengthDescriptor == null ? void 0 : lengthDescriptor.value) === "number" ? lengthDescriptor.value : 0;
|
|
243
|
+
for (let index = 0; index < length; index++) {
|
|
244
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(source, String(index));
|
|
245
|
+
if (!descriptor || !("value" in descriptor)) continue;
|
|
246
|
+
out2.push(await unwrapSandboxValue(descriptor.value, seen));
|
|
247
|
+
}
|
|
248
|
+
return out2;
|
|
249
|
+
}
|
|
250
|
+
if (source instanceof Date) return source;
|
|
251
|
+
const out = {};
|
|
252
|
+
seen.set(source, out);
|
|
253
|
+
for (const key of Object.keys(source)) {
|
|
254
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) continue;
|
|
255
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
256
|
+
if (!descriptor) continue;
|
|
257
|
+
out[key] = await unwrapSandboxValue(descriptor.value, seen);
|
|
258
|
+
}
|
|
259
|
+
return out;
|
|
260
|
+
}
|
|
261
|
+
function getRootSandboxValue(ctx, key) {
|
|
262
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) return void 0;
|
|
263
|
+
if (isSandboxContextSource(ctx)) {
|
|
264
|
+
if (!ctx.getSandboxKeys().includes(key)) return void 0;
|
|
265
|
+
return wrapSandboxValue(ctx.getSandboxValue(key));
|
|
266
|
+
}
|
|
267
|
+
return void 0;
|
|
268
|
+
}
|
|
269
|
+
async function getSandboxProperty(value, key) {
|
|
270
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) return void 0;
|
|
271
|
+
const resolved = isTrustedPromise(value) ? await value : value;
|
|
272
|
+
if (resolved == null) return void 0;
|
|
273
|
+
const meta = isObjectLike(resolved) ? sandboxProxyMeta.get(resolved) : void 0;
|
|
274
|
+
const source = (meta == null ? void 0 : meta.source) ?? resolved;
|
|
275
|
+
if (isSandboxContextSource(source)) {
|
|
276
|
+
if (!source.getSandboxKeys().includes(key)) return void 0;
|
|
277
|
+
return wrapSandboxValue(source.getSandboxValue(key));
|
|
278
|
+
}
|
|
279
|
+
if (typeof source === "function") {
|
|
280
|
+
return key === "length" || key === "name" ? Reflect.get(source, key) : void 0;
|
|
281
|
+
}
|
|
282
|
+
if (!isObjectLike(source)) {
|
|
283
|
+
const descriptor2 = getPrimitiveDataDescriptor(source, key);
|
|
284
|
+
if (!descriptor2 || typeof descriptor2.value === "function") return void 0;
|
|
285
|
+
return wrapSandboxValue(descriptor2.value);
|
|
286
|
+
}
|
|
287
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
288
|
+
if (!descriptor) return void 0;
|
|
289
|
+
const current = descriptor.value;
|
|
290
|
+
return typeof current === "function" ? wrapSandboxValue(current.bind(source)) : wrapSandboxValue(current);
|
|
291
|
+
}
|
|
78
292
|
async function evaluate(expr, ctx) {
|
|
79
293
|
try {
|
|
80
294
|
const raw = expr.trim();
|
|
@@ -84,40 +298,36 @@ async function evaluate(expr, ctx) {
|
|
|
84
298
|
if (dotOnly) {
|
|
85
299
|
const first = dotOnly[1];
|
|
86
300
|
const rest = dotOnly[2];
|
|
87
|
-
const base =
|
|
88
|
-
if (!rest) return base;
|
|
301
|
+
const base = getRootSandboxValue(ctx, first);
|
|
302
|
+
if (!rest) return await unwrapSandboxValue(wrapSandboxValue(base));
|
|
89
303
|
const resolved = await asyncGetValuesByPath(base, rest);
|
|
90
304
|
if (typeof resolved !== "undefined" || !rest.includes("-")) {
|
|
91
|
-
return resolved;
|
|
305
|
+
return await unwrapSandboxValue(resolved);
|
|
92
306
|
}
|
|
93
307
|
}
|
|
94
308
|
const transformed = preprocessExpression(raw);
|
|
309
|
+
ensureResolverLockdown();
|
|
95
310
|
const compartment = new Compartment({
|
|
96
|
-
ctx,
|
|
97
|
-
__get: (varName, path) => getAtPath(ctx, varName, path)
|
|
98
|
-
console
|
|
311
|
+
ctx: wrapRootSandboxContext(ctx),
|
|
312
|
+
__get: wrapSandboxValue((varName, path) => getAtPath(ctx, varName, path))
|
|
99
313
|
});
|
|
100
314
|
const wrapped = `(async () => { try { return ${transformed}; } catch (e) { return undefined; } })()`;
|
|
101
|
-
return await compartment.evaluate(wrapped);
|
|
315
|
+
return await unwrapSandboxValue(await compartment.evaluate(wrapped));
|
|
102
316
|
} catch (_2) {
|
|
103
317
|
return void 0;
|
|
104
318
|
}
|
|
105
319
|
}
|
|
106
320
|
async function getAtPath(ctx, varName, path) {
|
|
107
321
|
try {
|
|
108
|
-
let current =
|
|
322
|
+
let current = getRootSandboxValue(ctx, varName);
|
|
109
323
|
if (!path) return current;
|
|
110
324
|
const norm = String(path || "").replace(/^\./, "");
|
|
111
325
|
const segments = import_lodash.default.toPath(norm);
|
|
112
326
|
for (const seg of segments) {
|
|
113
327
|
if (current == null) return void 0;
|
|
114
|
-
|
|
115
|
-
if (val && typeof val["then"] === "function") {
|
|
116
|
-
val = await val;
|
|
117
|
-
}
|
|
118
|
-
current = val;
|
|
328
|
+
current = await getSandboxProperty(current, seg);
|
|
119
329
|
}
|
|
120
|
-
return current;
|
|
330
|
+
return wrapSandboxValue(current);
|
|
121
331
|
} catch (_2) {
|
|
122
332
|
return void 0;
|
|
123
333
|
}
|
|
@@ -134,18 +344,19 @@ async function asyncGetValuesByPath(obj, path, defaultValue) {
|
|
|
134
344
|
if (Array.isArray(currentValue)) {
|
|
135
345
|
shouldReturnArray = true;
|
|
136
346
|
const rest = keys.slice(i).join(".");
|
|
137
|
-
const parts = await Promise.all(
|
|
347
|
+
const parts = await Promise.all(
|
|
348
|
+
Array.prototype.map.call(currentValue, (el) => asyncGetValuesByPath(el, rest, defaultValue))
|
|
349
|
+
);
|
|
138
350
|
for (const p of parts) {
|
|
139
|
-
if (Array.isArray(p))
|
|
140
|
-
|
|
351
|
+
if (Array.isArray(p)) {
|
|
352
|
+
for (let index = 0; index < p.length; index++) {
|
|
353
|
+
if (typeof p[index] !== "undefined") result.push(p[index]);
|
|
354
|
+
}
|
|
355
|
+
} else if (typeof p !== "undefined") result.push(p);
|
|
141
356
|
}
|
|
142
357
|
break;
|
|
143
358
|
}
|
|
144
|
-
|
|
145
|
-
if (val && typeof val.then === "function") {
|
|
146
|
-
val = await val;
|
|
147
|
-
}
|
|
148
|
-
currentValue = val;
|
|
359
|
+
currentValue = await getSandboxProperty(currentValue, key);
|
|
149
360
|
if (i === keys.length - 1) {
|
|
150
361
|
result.push(currentValue);
|
|
151
362
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "前端流引擎",
|
|
5
5
|
"description": "",
|
|
6
6
|
"description.zh-CN": "",
|
|
7
|
-
"version": "2.1.0-beta.
|
|
7
|
+
"version": "2.1.0-beta.45",
|
|
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": "42587115fc34c3eb01ef2b2549f1c998e5708318"
|
|
30
30
|
}
|