@fugood/bricks-cli 2.26.0-beta.0 → 2.26.0-beta.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.
package/lib/9320.js CHANGED
@@ -1,3 +1,3 @@
1
- export const __rspack_esm_id=9320;export const __rspack_esm_ids=[9320];export const __webpack_modules__={65650(e,t,r){e.exports=r(78942).Symbol},87379(e,t,r){var o=r(65650),n=r(8870),i=r(29005),s=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?n(e):i(e)}},86403(e,t,r){var o=r(62945),n=/^\s+/;e.exports=function(e){return e?e.slice(0,o(e)+1).replace(n,""):e}},74967(e){e.exports="object"==typeof global&&global&&global.Object===Object&&global},8870(e,t,r){var o=r(65650),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,a=o?o.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),r=e[a];try{e[a]=void 0;var o=!0}catch(e){}var n=s.call(e);return o&&(t?e[a]=r:delete e[a]),n}},29005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},78942(e,t,r){var o=r(74967),n="object"==typeof self&&self&&self.Object===Object&&self;e.exports=o||n||Function("return this")()},62945(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},12784(e,t,r){var o=r(41580),n=r(94495),i=r(6131),s=Math.max,a=Math.min;e.exports=function(e,t,r){var u,l,c,p,f,h,d=0,v=!1,y=!1,m=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var r=u,o=l;return u=l=void 0,d=t,p=e.apply(o,r)}function x(e){var r=e-h,o=e-d;return void 0===h||r>=t||r<0||y&&o>=c}function g(){var e,r,o,i=n();if(x(i))return _(i);f=setTimeout(g,(e=i-h,r=i-d,o=t-e,y?a(o,c-r):o))}function _(e){return(f=void 0,m&&u)?b(e):(u=l=void 0,p)}function w(){var e,r=n(),o=x(r);if(u=arguments,l=this,h=r,o){if(void 0===f)return d=e=h,f=setTimeout(g,t),v?b(e):p;if(y)return clearTimeout(f),f=setTimeout(g,t),b(h)}return void 0===f&&(f=setTimeout(g,t)),p}return t=i(t)||0,o(r)&&(v=!!r.leading,c=(y="maxWait"in r)?s(i(r.maxWait)||0,t):c,m="trailing"in r?!!r.trailing:m),w.cancel=function(){void 0!==f&&clearTimeout(f),d=0,u=h=l=f=void 0},w.flush=function(){return void 0===f?p:_(n())},w}},41580(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},80547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},51187(e,t,r){var o=r(87379),n=r(80547);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==o(e)}},94495(e,t,r){var o=r(78942);e.exports=function(){return o.Date.now()}},6131(e,t,r){var o=r(86403),n=r(41580),i=r(51187),s=0/0,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return s;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=o(e);var r=u.test(e);return r||l.test(e)?c(e.slice(2),r?2:8):a.test(e)?s:+e}},5018(e){e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},44668(e,t,r){var o=r(56347);function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},70604(e){e.exports=function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},90250(e,t,r){var o=r(3634),n=r(70604),i=r(78243),s=r(5523);e.exports=function(e){return o(e)||n(e)||i(e)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},23878(e,t,r){var o=r(14319).default;e.exports=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},56347(e,t,r){var o=r(14319).default,n=r(23878);e.exports=function(e){var t=n(e,"string");return"symbol"==o(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},14319(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},75720(e,t,r){r.d(t,{p:()=>p,sh:()=>d});var o,n,i=r(90250),s=r(99436),a=r(5018),u=r(44668),l=r(31421),c=r(73024),p=()=>{var e=process.argv[1];return e&&!(e.includes("$bunfs")||e.includes("~BUN"))&&(0,c.existsSync)(e)?[process.execPath,e]:[process.execPath]},f=u(function e(t){a(this,e),this._cwd=void 0,this._mode="default",this._throw=!0,this._env=void 0,this._promise=null,this.args=t},[{key:"cwd",value:function(e){return this._cwd=e,this}},{key:"quiet",value:function(){return this._mode="quiet",this}},{key:"nothrow",value:function(){return this._throw=!1,this}},{key:"env",value:function(e){return this._env={...this._env,...e},this}},{key:"text",value:(o=s(function*(){return"default"===this._mode&&(this._mode="text"),(yield this.run()).stdout.toString("utf8")}),function(){return o.apply(this,arguments)})},{key:"then",value:function(e,t){return this.run().then(e,t)}},{key:"run",value:function(){return this._promise||(this._promise=this.exec()),this._promise}},{key:"exec",value:(n=s(function*(){var e=i(this.args),t=e[0],r=(function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o})(e).slice(1);if(!t)throw Error("sh: empty command");var o="default"===this._mode?["inherit","pipe","pipe"]:"quiet"===this._mode?["ignore","pipe","pipe"]:["inherit","pipe","pipe"],n=this._env?{...process.env,...this._env}:void 0,s=(0,l.spawn)(t,r,{cwd:this._cwd,stdio:o,env:n}),a=[],u=[];s.stdout?.on("data",e=>{a.push(e),"default"===this._mode&&process.stdout.write(e)}),s.stderr?.on("data",e=>{u.push(e),"default"===this._mode&&process.stderr.write(e)});var c=yield new Promise((e,t)=>{s.on("error",t),s.on("close",t=>e(t??0))}),p=Buffer.concat(a),f=Buffer.concat(u);if(0!==c&&this._throw){var h=Error(`sh: command failed with exit ${c}: ${this.args.join(" ")}`);throw h.exitCode=c,h.stdout=p,h.stderr=f,h}return{exitCode:c,stdout:p,stderr:f}}),function(){return n.apply(this,arguments)})}]),h=/\s/;function d(e,...t){var r,o,n,i,s,a=(r=[],o="",n=!1,i=()=>{n&&(r.push(o),o="",n=!1)},s=e=>{o+=e,n=!0},(e.forEach((e,r)=>{for(var o=0;o<e.length;o++){var n=e[o];h.test(n)?i():s(n)}r<t.length&&(e=>{if(null!=e){if(Array.isArray(e))return e.forEach((e,t)=>{t>0&&i(),s(String(e))});s(String(e))}})(t[r])}),i(),r.length>=3&&"cd"===r[0]&&"&&"===r[2])?{tokens:r.slice(3),initialCwd:r[1]}:{tokens:r}),u=a.tokens,l=a.initialCwd,c=new f(u);return l&&c.cwd(l),c}},16749(e,t,r){r.d(t,{W:()=>s});var o=r(73024),n=r(76760),i=r(73136);function s(e){var t=(0,n.dirname)((0,i.fileURLToPath)(e)),r=[(0,n.join)(t,"simulator-main.mjs"),(0,n.join)(t,"..","simulator-main.mjs"),(0,n.join)((0,n.dirname)(process.execPath),"simulator-main.mjs")];for(var s of r)if((0,o.existsSync)(s))return s;throw Error(`Unable to locate the simulator entry (simulator-main.mjs). Probed paths:
1
+ export const __rspack_esm_id=9320;export const __rspack_esm_ids=[9320];export const __webpack_modules__={65650(e,t,r){e.exports=r(78942).Symbol},87379(e,t,r){var o=r(65650),n=r(8870),s=r(29005),i=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?n(e):s(e)}},86403(e,t,r){var o=r(62945),n=/^\s+/;e.exports=function(e){return e?e.slice(0,o(e)+1).replace(n,""):e}},74967(e){e.exports="object"==typeof global&&global&&global.Object===Object&&global},8870(e,t,r){var o=r(65650),n=Object.prototype,s=n.hasOwnProperty,i=n.toString,a=o?o.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),r=e[a];try{e[a]=void 0;var o=!0}catch(e){}var n=i.call(e);return o&&(t?e[a]=r:delete e[a]),n}},29005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},78942(e,t,r){var o=r(74967),n="object"==typeof self&&self&&self.Object===Object&&self;e.exports=o||n||Function("return this")()},62945(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},12784(e,t,r){var o=r(41580),n=r(94495),s=r(6131),i=Math.max,a=Math.min;e.exports=function(e,t,r){var c,u,l,p,h,d,f=0,v=!1,m=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function g(t){var r=c,o=u;return c=u=void 0,f=t,p=e.apply(o,r)}function b(e){var r=e-d,o=e-f;return void 0===d||r>=t||r<0||m&&o>=l}function _(){var e,r,o,s=n();if(b(s))return x(s);h=setTimeout(_,(e=s-d,r=s-f,o=t-e,m?a(o,l-r):o))}function x(e){return(h=void 0,y&&c)?g(e):(c=u=void 0,p)}function w(){var e,r=n(),o=b(r);if(c=arguments,u=this,d=r,o){if(void 0===h)return f=e=d,h=setTimeout(_,t),v?g(e):p;if(m)return clearTimeout(h),h=setTimeout(_,t),g(d)}return void 0===h&&(h=setTimeout(_,t)),p}return t=s(t)||0,o(r)&&(v=!!r.leading,l=(m="maxWait"in r)?i(s(r.maxWait)||0,t):l,y="trailing"in r?!!r.trailing:y),w.cancel=function(){void 0!==h&&clearTimeout(h),f=0,c=d=u=h=void 0},w.flush=function(){return void 0===h?p:x(n())},w}},41580(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},80547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},51187(e,t,r){var o=r(87379),n=r(80547);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==o(e)}},94495(e,t,r){var o=r(78942);e.exports=function(){return o.Date.now()}},6131(e,t,r){var o=r(86403),n=r(41580),s=r(51187),i=0/0,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(s(e))return i;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=o(e);var r=c.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):a.test(e)?i:+e}},70604(e){e.exports=function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},90250(e,t,r){var o=r(3634),n=r(70604),s=r(78243),i=r(5523);e.exports=function(e){return o(e)||n(e)||s(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},75720(e,t,r){r.d(t,{p:()=>a,sh:()=>l});var o=r(90250),n=r(99436),s=r(31421),i=r(73024),a=()=>{var e=process.argv[1];return e&&!(e.includes("$bunfs")||e.includes("~BUN"))&&(0,i.existsSync)(e)?[process.execPath,e]:[process.execPath]};class c{_cwd=void 0;_mode="default";_throw=!0;_env=void 0;_promise=null;constructor(e){this.args=e}cwd(e){return this._cwd=e,this}quiet(){return this._mode="quiet",this}nothrow(){return this._throw=!1,this}env(e){return this._env={...this._env,...e},this}text(){var e=this;return n(function*(){return"default"===e._mode&&(e._mode="text"),(yield e.run()).stdout.toString("utf8")})()}then(e,t){return this.run().then(e,t)}run(){return this._promise||(this._promise=this.exec()),this._promise}exec(){var e=this;return n(function*(){var t=o(e.args),r=t[0],n=(function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o})(t).slice(1);if(!r)throw Error("sh: empty command");var i="default"===e._mode?["inherit","pipe","pipe"]:"quiet"===e._mode?["ignore","pipe","pipe"]:["inherit","pipe","pipe"],a=e._env?{...process.env,...e._env}:void 0,c=(0,s.spawn)(r,n,{cwd:e._cwd,stdio:i,env:a}),u=[],l=[];c.stdout?.on("data",t=>{u.push(t),"default"===e._mode&&process.stdout.write(t)}),c.stderr?.on("data",t=>{l.push(t),"default"===e._mode&&process.stderr.write(t)});var p=yield new Promise((e,t)=>{c.on("error",t),c.on("close",t=>e(t??0))}),h=Buffer.concat(u),d=Buffer.concat(l);if(0!==p&&e._throw){var f=Error(`sh: command failed with exit ${p}: ${e.args.join(" ")}`);throw f.exitCode=p,f.stdout=h,f.stderr=d,f}return{exitCode:p,stdout:h,stderr:d}})()}}var u=/\s/;function l(e,...t){var r,o,n,s,i,a=(r=[],o="",n=!1,s=()=>{n&&(r.push(o),o="",n=!1)},i=e=>{o+=e,n=!0},(e.forEach((e,r)=>{for(var o=0;o<e.length;o++){var n=e[o];u.test(n)?s():i(n)}r<t.length&&(e=>{if(null!=e){if(Array.isArray(e))return e.forEach((e,t)=>{t>0&&s(),i(String(e))});i(String(e))}})(t[r])}),s(),r.length>=3&&"cd"===r[0]&&"&&"===r[2])?{tokens:r.slice(3),initialCwd:r[1]}:{tokens:r}),p=a.tokens,h=a.initialCwd,d=new c(p);return h&&d.cwd(h),d}},16749(e,t,r){r.d(t,{W:()=>i});var o=r(73024),n=r(76760),s=r(73136);function i(e){var t=(0,n.dirname)((0,s.fileURLToPath)(e)),r=[(0,n.join)(t,"simulator-main.mjs"),(0,n.join)(t,"..","simulator-main.mjs"),(0,n.join)((0,n.dirname)(process.execPath),"simulator-main.mjs")];for(var i of r)if((0,o.existsSync)(i))return i;throw Error(`Unable to locate the simulator entry (simulator-main.mjs). Probed paths:
2
2
  ${r.map(e=>` - ${e}`).join("\n")}
3
- If you installed the standalone bricks binary, re-run the installer to restore the simulator assets.`)}},7931(e,t,r){r.r(t),r.d(t,{simulator:()=>f});var o=r(99436),n=r(31421),i=r(51455),s=r(73024),a=r(80481),u=r(57975),l=r(12784),c=r(75720),p=r(16749);function f(){return h.apply(this,arguments)}function h(){return(h=o(function*(e=[]){var t,r=(0,u.parseArgs)({args:e,options:{"skip-typecheck":{type:"boolean"},"clear-cache":{type:"boolean"},screenshot:{type:"boolean"},"screenshot-delay":{type:"string"},"screenshot-width":{type:"string"},"screenshot-height":{type:"string"},"screenshot-path":{type:"string"},"screenshot-no-headless":{type:"boolean"},"show-menu":{type:"boolean"},"test-id":{type:"string"},"test-title-like":{type:"string"},"no-keep-open":{type:"boolean"},"cdp-port":{type:"string"},"no-cdp":{type:"boolean"},"capture-plan":{type:"string"}},strict:!0,allowPositionals:!0}).values,f=process.cwd(),h=JSON.parse((yield(0,i.readFile)(`${f}/application.json`,"utf8"))),d=[];r["clear-cache"]&&d.push("--clear-cache");var v=!0;if(r.screenshot&&(d.push("--take-screenshot"),d.push(JSON.stringify({delay:Number(r["screenshot-delay"])||1e3,width:Number(r["screenshot-width"])||600,height:Number(r["screenshot-height"])||480,path:r["screenshot-path"]||`${f}/screenshot.jpg`,noHeadless:r["screenshot-no-headless"]??!1})),v=!r["no-keep-open"]),r["capture-plan"]&&(d.push("--capture-plan",r["capture-plan"]),v=!1),r["show-menu"]&&d.push("--show-menu"),r["test-id"]&&d.push("--test-id",r["test-id"]),r["test-title-like"]&&d.push("--test-title-like",r["test-title-like"]),r["no-keep-open"]&&d.push("--no-keep-open"),!r["no-cdp"]){var y=parseInt(r["cdp-port"]||"",10)||19852;d.push("--cdp-port",String(y))}var m=!r["skip-typecheck"],b=(t=o(function*(){yield(0,c.sh)`${(0,c.p)()} ctor compile ${m?[]:["--no-check"]}`}),function(){return t.apply(this,arguments)});yield b();var x=null;if(v){var g=l(b,500);x=(0,s.watch)(`${f}/subspaces`,{recursive:!0},(e,t)=>{console.log(`Detected ${e} in ${t}`),g()})}var _=`${f}/.bricks/devtools.json`,w=()=>{try{(0,s.unlinkSync)(_)}catch{}};try{var k=JSON.parse((yield(0,i.readFile)(_,"utf8")));if(k.pid){try{process.kill(k.pid)}catch{}w()}}catch{}var S=(0,p.W)("file:///Users/jhen/workspace/mybigday-bricks/packages/bricks-cli/src/ctor/tools/simulator.js"),j=(0,n.spawn)("bunx",["--bun","electron",S,...d],{env:{...process.env,BRICKS_STAGE:h.stage||"production"},stdio:["inherit","pipe","inherit"]});(0,a.createInterface)({input:j.stdout}).on("line",e=>{if(e.startsWith("[TEST_RESULT_TOON]"))return void console.log(e.replace("[TEST_RESULT_TOON]",""));if(e){var t=e.match(/^CDP server: ws:\/\/localhost:(\d+)/);if(t){var r={port:parseInt(t[1],10),pid:j.pid,address:"localhost",name:`${h.name||"Unnamed"} (CTOR Simulator)`,startedAt:new Date().toISOString()};(0,i.writeFile)(_,JSON.stringify(r,null,2))}console.log(e)}}),yield new Promise(e=>{j.on("close",()=>e())}),w(),x&&x.close()})).apply(this,arguments)}}};
3
+ If you installed the standalone bricks binary, re-run the installer to restore the simulator assets.`)}},7931(e,t,r){r.r(t),r.d(t,{simulator:()=>h});var o=r(99436),n=r(31421),s=r(51455),i=r(73024),a=r(80481),c=r(57975),u=r(12784),l=r(75720),p=r(16749);function h(){return d.apply(this,arguments)}function d(){return(d=o(function*(e=[]){var t,r=(0,c.parseArgs)({args:e,options:{"skip-typecheck":{type:"boolean"},"clear-cache":{type:"boolean"},screenshot:{type:"boolean"},"screenshot-delay":{type:"string"},"screenshot-width":{type:"string"},"screenshot-height":{type:"string"},"screenshot-path":{type:"string"},"screenshot-no-headless":{type:"boolean"},"show-menu":{type:"boolean"},"test-id":{type:"string"},"test-title-like":{type:"string"},"no-keep-open":{type:"boolean"},"cdp-port":{type:"string"},"no-cdp":{type:"boolean"},"capture-plan":{type:"string"}},strict:!0,allowPositionals:!0}).values,h=process.cwd(),d=JSON.parse((yield(0,s.readFile)(`${h}/application.json`,"utf8"))),f=[];r["clear-cache"]&&f.push("--clear-cache");var v=!0;if(r.screenshot&&(f.push("--take-screenshot"),f.push(JSON.stringify({delay:Number(r["screenshot-delay"])||1e3,width:Number(r["screenshot-width"])||600,height:Number(r["screenshot-height"])||480,path:r["screenshot-path"]||`${h}/screenshot.jpg`,noHeadless:r["screenshot-no-headless"]??!1})),v=!r["no-keep-open"]),r["capture-plan"]&&(f.push("--capture-plan",r["capture-plan"]),v=!1),r["show-menu"]&&f.push("--show-menu"),r["test-id"]&&f.push("--test-id",r["test-id"]),r["test-title-like"]&&f.push("--test-title-like",r["test-title-like"]),r["no-keep-open"]&&f.push("--no-keep-open"),!r["no-cdp"]){var m=parseInt(r["cdp-port"]||"",10)||19852;f.push("--cdp-port",String(m))}var y=!r["skip-typecheck"],g=(t=o(function*(){yield(0,l.sh)`${(0,l.p)()} ctor compile ${y?[]:["--no-check"]}`}),function(){return t.apply(this,arguments)});yield g();var b=null;if(v){var _=u(g,500);b=(0,i.watch)(`${h}/subspaces`,{recursive:!0},(e,t)=>{console.log(`Detected ${e} in ${t}`),_()})}var x=`${h}/.bricks/devtools.json`,w=()=>{try{(0,i.unlinkSync)(x)}catch{}};try{var j=JSON.parse((yield(0,s.readFile)(x,"utf8")));if(j.pid){try{process.kill(j.pid)}catch{}w()}}catch{}var S=(0,p.W)("file:///Users/jhen/workspace/mybigday-bricks/packages/bricks-cli/src/ctor/tools/simulator.js"),k=(0,n.spawn)("bunx",["--bun","electron",S,...f],{env:{...process.env,BRICKS_STAGE:d.stage||"production"},stdio:["inherit","pipe","inherit"]});(0,a.createInterface)({input:k.stdout}).on("line",e=>{if(e.startsWith("[TEST_RESULT_TOON]"))return void console.log(e.replace("[TEST_RESULT_TOON]",""));if(e){var t=e.match(/^CDP server: ws:\/\/localhost:(\d+)/);if(t){var r={port:parseInt(t[1],10),pid:k.pid,address:"localhost",name:`${d.name||"Unnamed"} (CTOR Simulator)`,startedAt:new Date().toISOString()};(0,s.writeFile)(x,JSON.stringify(r,null,2))}console.log(e)}}),yield new Promise(e=>{k.on("close",()=>e())}),w(),b&&b.close()})).apply(this,arguments)}}};
package/lib/9387.js CHANGED
@@ -1,4 +1,4 @@
1
- export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export const __webpack_modules__={75149(t,r,e){e.d(r,{P:()=>i});var o=e(79657),a=e(64007);function i(t){var r=process.env.HTTPS_PROXY||process.env.https_proxy;if(!r||!t.startsWith("https://"))return o.Ay;var e=new a(r);return(t,r={})=>(0,o.Ay)(t,{...r,agent:e})}},30182(t,r,e){e.r(r),e.d(r,{BANK_PROPERTY_META_VALUES:()=>i.YC,createBankClient:()=>l,resolveBankEndpoint:()=>n,validateBankPropertyMeta:()=>i.jR});var o=e(99436),a=e(75149),i=e(31596),p={"https://display.bricks.tools":"https://bank.bricks.tools","https://display-beta.bricks.tools":"https://bank-beta.bricks.tools"},n=t=>{if(process.env.BRICKS_BANK_ENDPOINT)return process.env.BRICKS_BANK_ENDPOINT;var r=p[t];if(r)return r;try{var e=new URL(t).hostname;if("localhost"===e||"127.0.0.1"===e)return"http://localhost:8080"}catch{}throw Error(`Cannot derive the Data Bank endpoint from ${t}; set BRICKS_BANK_ENDPOINT to override`)},s=`
1
+ export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export const __webpack_modules__={75149(t,r,e){e.d(r,{P:()=>i});var a=e(79657),o=e(64007);function i(t){var r=process.env.HTTPS_PROXY||process.env.https_proxy;if(!r||!t.startsWith("https://"))return a.Ay;var e=new o(r);return(t,r={})=>(0,a.Ay)(t,{...r,agent:e})}},30182(t,r,e){e.r(r),e.d(r,{BANK_PROPERTY_META_VALUES:()=>i.YC,createBankClient:()=>c,resolveBankEndpoint:()=>n,validateBankPropertyMeta:()=>i.jR});var a=e(99436),o=e(75149),i=e(31596),p={"https://display.bricks.tools":"https://bank.bricks.tools","https://display-beta.bricks.tools":"https://bank-beta.bricks.tools"},n=t=>{if(process.env.BRICKS_BANK_ENDPOINT)return process.env.BRICKS_BANK_ENDPOINT;var r=p[t];if(r)return r;try{var e=new URL(t).hostname;if("localhost"===e||"127.0.0.1"===e)return"http://localhost:8080"}catch{}throw Error(`Cannot derive the Data Bank endpoint from ${t}; set BRICKS_BANK_ENDPOINT to override`)},s=`
2
2
  propertyId
3
3
  meta
4
4
  definition
@@ -9,7 +9,7 @@ export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export co
9
9
  lastUpdateKey
10
10
  createAt
11
11
  updateAt
12
- `,l=({endpoint:t,spacename:r,spacekey:e})=>{var p,n=`${t}/api/graphql`,l=(0,a.P)(t),d=(p=o(function*(t,o){var a,i=yield l(n,{method:"POST",headers:{"content-type":"application/json",SPACENAME:r,SPACEKEY:e},body:JSON.stringify({query:t,variables:o})}),p=yield i.text();try{a=JSON.parse(p)}catch{a=null}if(a?.errors?.length)throw Error(a.errors.map(({message:t})=>t).join("\n"));if(!i.ok){var s=Error(`Data Bank API error (${i.status}): ${p.trim()}`);throw 403===i.status&&(s.isBankAuthError=!0),s}return a?.data||{}}),function(t,r){return p.apply(this,arguments)});return{listProperties(){return o(function*({keyword:t,meta:r,ids:e}={}){return(0,i.jR)(r),(yield d(`#graphql
12
+ `,l={InSubspace:"IN_SUBSPACE",Global:"GLOBAL"},d={IN_SUBSPACE:"InSubspace",GLOBAL:"Global"},u=t=>void 0===t?void 0:JSON.stringify(t),y=t=>t&&d[t.meta]?{...t,meta:d[t.meta]}:t,c=({endpoint:t,spacename:r,spacekey:e})=>{var p,n=`${t}/api/graphql`,d=(0,o.P)(t),c=(p=a(function*(t,a){var o,i=yield d(n,{method:"POST",headers:{"content-type":"application/json",SPACENAME:r,SPACEKEY:e},body:JSON.stringify({query:t,variables:a})}),p=yield i.text();try{o=JSON.parse(p)}catch{o=null}if(o?.errors?.length)throw Error(o.errors.map(({message:t})=>t).join("\n"));if(!i.ok){var s=Error(`Data Bank API error (${i.status}): ${p.trim()}`);throw 403===i.status&&(s.isBankAuthError=!0),s}return o?.data||{}}),function(t,r){return p.apply(this,arguments)});return{listProperties(){return a(function*({keyword:t,meta:r,ids:e}={}){return(0,i.jR)(r),((yield c(`#graphql
13
13
  query(
14
14
  $filterUpdateHashes: [PropertyFilterUpdateHash!]
15
15
  $filterMeta: String
@@ -21,11 +21,11 @@ export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export co
21
21
  filterKeyword: $filterKeyword
22
22
  ) { ${s} }
23
23
  }
24
- `,{filterUpdateHashes:e?.map(t=>({propertyId:t,value:""})),filterMeta:r,filterKeyword:t})).properties||[]}).apply(this,arguments)},getProperty(t){var r=this;return o(function*(){return(yield r.listProperties({ids:[t]})).find(r=>r.propertyId===t)||null})()},updateProperties:(t,r)=>o(function*(){if(!t?.length)throw Error("No properties to update.");var e=t.map(t=>{var r=t.meta||"InSubspace";return(0,i.jR)(r),{propertyId:t.propertyId,meta:r,definition:t.definition,newDefinitionFallback:t.newDefinitionFallback,value:t.value,updateNote:t.updateNote||"Updated via bricks-cli",upsert:!1!==t.upsert,tags:t.tags}});return(yield d(`#graphql
24
+ `,{filterUpdateHashes:e?.map(t=>({propertyId:t,value:""})),filterMeta:r,filterKeyword:t})).properties||[]).map(y)}).apply(this,arguments)},getProperty(t){var r=this;return a(function*(){return(yield r.listProperties({ids:[t]})).find(r=>r.propertyId===t)||null})()},updateProperties:(t,r)=>a(function*(){if(!t?.length)throw Error("No properties to update.");var e=t.map(t=>{var r=t.meta||"InSubspace";return(0,i.jR)(r),{propertyId:t.propertyId,meta:l[r],definition:u(t.definition),newDefinitionFallback:u(t.newDefinitionFallback),value:u(t.value),updateNote:t.updateNote||"Updated via bricks-cli",upsert:!1!==t.upsert,tags:t.tags}});return((yield c(`#graphql
25
25
  mutation($properties: [PropertyInput!]!, $dontNotify: Boolean) {
26
26
  updateProperty(properties: $properties, dontNotify: $dontNotify) { ${s} }
27
27
  }
28
- `,{properties:e,dontNotify:r})).updateProperty||[]})(),removeProperty:t=>o(function*(){return(yield d(`#graphql
28
+ `,{properties:e,dontNotify:r})).updateProperty||[]).map(y)})(),removeProperty:t=>a(function*(){return(yield c(`#graphql
29
29
  mutation($propertyId: String!) {
30
30
  removeProperty(propertyId: $propertyId)
31
31
  }