@flowscripter/io-plugin-filesystem 2.0.0 → 2.0.1
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/bundle.js +1 -1
- package/package.json +6 -6
package/dist/bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var pr="@flowscripter/pluggable-io-framework/provider-factory";function fr(e){let t=e.getReader();return new ReadableStream({async pull(r){let{done:o,value:n}=await t.read();if(o){r.close();return}r.enqueue({payload:{kind:"js",data:n}})},cancel(r){return t.cancel(r)}})}import{chmod as Qa,cp as Rs,mkdir as rr,rename as eu,rm as Cs,utimes as tu}from"fs/promises";import{join as rt,resolve as ru}from"path";import{resolve as it,sep as dr}from"path";function E(e,t){if(e==="")return it(t);let r=it(e),o=it(r,t),n=r.endsWith(dr)?r:r+dr;if(o!==r&&!o.startsWith(n))throw Error(`Path "${t}" resolves outside provider root "${e}"`);return o}function ue(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function ct(e,t="|"){return e.map((r)=>lt(r)).join(t)}function le(e,t){if(typeof t==="bigint")return t.toString();return t}class mr{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Pe(e){return new mr(e)}function hr(e){return e===null||e===void 0}function ze(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function yr(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $e(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function J(e){return $e(e._zod.def)??e._zod.def.shape}function gr(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return j(this,t,o),o},enumerable:!0,configurable:!0})}function _r(e,t,r){if(t in e)j(e,t,r);else e[t]=r}function G(e,t,r,o){let n=J(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(n,i);if(!s.enumerable)continue;if(s.get)gr(e,i,()=>{let c=t._zod.def.shape[i];return o?o(c,i):c});else _r(e,i,o?o(s.value,i):s.value)}}function Ks(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)gr(e,r,()=>t[r]);else _r(e,r,o.value)}}function T(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function xr(e){return JSON.stringify(e)}function br(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var at="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var vr=Pe(()=>{if(A.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ee(e){if(ae(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ae(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ut(e){if(ee(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Pr=new Set(["string","number","symbol"]);function te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function y(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function lt(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function zr(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var we=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ls(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ke(e,t)),F(e,T(r,{shape:i,checks:[]}))}function ke(e,t){let r=J(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function js(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ke(e,t)),s={};return G(s,e,Reflect.ownKeys(J(e)).filter((c)=>!i.has(c))),F(e,T(r,{shape:s,checks:[]}))}function Fs(e,t){if(!ee(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=J(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,T(e._zod.def,{shape:$r(e,t)}))}function $r(e,t){let r={};return G(r,e,Reflect.ownKeys(J(e))),Ks(r,t),r}function Ms(e,t){if(!ee(t))throw Error("Invalid input to safeExtend: expected a plain object");return F(e,T(e._zod.def,{shape:$r(e,t)}))}function Us(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(J(e))),G(r,t,Reflect.ownKeys(J(t)));let o=T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,o)}function wr(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ke(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(J(t)),e&&((u,p)=>c&&!c.has(p)?u:new e({type:"optional",innerType:u}))),F(t,T(t._zod.def,{shape:a,checks:[]}))}function Js(e,t,r){let o=r?new Set(ke(t,r)):void 0,n={};return G(n,t,Reflect.ownKeys(J(t)),(i,s)=>o&&!o.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,T(t._zod.def,{shape:n}))}function M(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function kr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Se(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function ce(e){return typeof e==="string"?e:e?.message}function ft(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function V(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ce(e.inst?._zod.def?.error?.(e))??ce(i?.(e))??ce(t?.error?.(e))??ce(r.customError?.(e))??ce(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e)){if(a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__")continue;c[a]=e[a]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Bs=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!Bs.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Oe(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Sr(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function X(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function Zr(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else Ws(e,r,o.value)}}function B(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ie(e,t,r){return B(e,t,r,!1)}function Or(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,o(this))},set(n){B(this,r,n)}})}return t}function Ws(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(o){B(this,t,o)}})}function Vs(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var st,W=!1,Hs={configurable:!0,get(){W=!0;return}};function x(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&st!==e._zod){st=void 0;return}st=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,Hs);let n=W;W=!1;try{let i=r(this);if(W)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return W=W||n,i}catch(i){throw delete this[t],W=W||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function Gs(e,t,r,o){let n=Vs(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:i})}})}var Xs="~constantCatch";function Ir(e){let t=()=>e;return t[Xs]=!0,t}var Er;var dt={value:void 0,enumerable:!1},Tr="captureStackTrace"in Error?Error:null;function Ys(e){let t=Tr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Tr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,o){let n={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=n;let s=r,c=s&&new WeakSet;function a(d,m){if(!d._zod){dt.value=new i(m);try{Object.defineProperty(d,"_zod",dt)}finally{dt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),g=d._zod.constr.prototype,b=_;while(b&&b!==g)b=Object.getPrototypeOf(b);let K=b??_;if(!c.has(K))c.add(K),Zr(K,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let u=o?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function f(d){let m=o?.Parent?Ys(p):this;a(m,d);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(o?.Parent&&d instanceof o.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class U extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Er=globalThis).__zod_globalConfig??(Er.__zod_globalConfig={});var A=globalThis.__zod_globalConfig;function N(e){if(e)Object.assign(A,e);return A}function qs(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,le,2)),e.message}function Qs(e){this._zod.message=e}var ec={get:qs,set:Qs,enumerable:!0,configurable:!0},ht={value:void 0,enumerable:!1},Ar=new WeakSet([Object.prototype,Error.prototype]),Rr=(e,t)=>{e.name="$ZodError",ht.value=t,Object.defineProperty(e,"issues",ht),ht.value=void 0,Object.defineProperty(e,"message",ec);let r=Object.getPrototypeOf(e);if(!Ar.has(r))Ar.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},Cr=l("$ZodError",Rr),fl=l("$ZodError",Rr,void 0,{Parent:Error});function tc(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Nr(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)tc(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Dr(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>o({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let a=r,u=0;while(u<c.length){let p=c[u],f=u===c.length-1;if(p==="_errors"){if(f)a._errors.push(t(s));u++;continue}if(!Object.prototype.hasOwnProperty.call(a,p))Object.defineProperty(a,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=a[p];if(f)d._errors.push(t(s));a=d,u++}}}};return o(e),r}function Ee(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Te=(e)=>{let t=(r,o,n,i)=>{let s=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)throw new U;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Ae=(e)=>{let t=async(r,o,n,i)=>{let s=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Re=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new U;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};function Kr(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>V(n,r,N()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Ce=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};var rc=Symbol.for("zod.compile.invalid"),oc=Symbol.for("zod.compile.fallback"),yt=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==rc)return!0;if(o.definite===!0&&r===void 0)return!1}return nc(e,t,r)};function nc(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,i;if(n)o[oc]=!0,i=n({value:t,issues:[]},o);else i=e._zod.run({value:t,issues:[]},o);if(i instanceof Promise)throw new U;return i.issues.length===0}var gt=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},Lr=(e)=>{let t=Te(e),r=(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(o,n,c,Ee(r,s))};return r};var jr=(e)=>{let t=Te(e),r=(o,n,i,s)=>t(o,n,i,Ee(r,s));return r};var Fr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(o,n,c,Ee(r,s))};return r};var Mr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>await t(o,n,i,Ee(r,s));return r};var Ur=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Re(e)(t,r,n)};var Jr=(e)=>(t,r,o)=>Re(e)(t,r,o);var Br=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ce(e)(t,r,n)};var Wr=(e)=>async(t,r,o)=>Ce(e)(t,r,o);var Vr=/^[cC][0-9a-z]{6,}$/,Hr=/^[0-9a-z]+$/,Gr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xr=/^[0-9a-vA-V]{20}$/,Yr=/^[A-Za-z0-9]{27}$/,qr=/^[a-zA-Z0-9_-]{21}$/;function Qr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var to=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,xt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var ro=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ic="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function oo(){return new RegExp(ic,"u")}var no=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,io=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var so=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,co=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ao=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uo=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var lo=/^https?$/,po=/^\+[1-9]\d{6,14}$/;var fo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function sc(e){return new RegExp(`^${e}$`)}var mo=sc(fo);function _t(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function ho(e){return new RegExp(`^${_t(e)}$`)}function yo(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${_t({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${_t({precision:e.precision})}`:r;return new RegExp(`^${fo}T(?:${o})$`)}var go=/^[\s\S]{0,}$/;var bt=/^-?\d+(?:\.\d+)?$/;var _o=/^[^A-Z]*$/,xo=/^[^a-z]*$/;var O=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var vt=(e)=>{let t=e.value;return!hr(t)&&t.length!==void 0},Ne={number:"number",bigint:"bigint",object:"date"},Pt=l("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zt=l("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bo=l("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):yr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),vo=l("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=we[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(c<n)s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Po=l("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>t.maximum?Ze(n):i)<=t.maximum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zo=l("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>=t.minimum&&i<t.minimum*2?Ze(n):i)>=t.minimum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$o=l("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length,s=typeof n==="string"&&i>=t.length&&i<=t.length*2?Ze(n):i;if(s===t.length)return;let c=Oe(n),a=s>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),de=l("$ZodCheckStringFormat",(e,t)=>{var r,o;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),wo=l("$ZodCheckRegex",(e,t)=>{de.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ko=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_o),de.init(e,t)}),So=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xo),de.init(e,t)}),Zo=l("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=te(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Oo=l("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${te(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${te(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Eo=l("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class $t{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
2
|
+
var pr="@flowscripter/pluggable-io-framework/provider-factory";function fr(e){let t=e.getReader();return new ReadableStream({async pull(r){let{done:o,value:n}=await t.read();if(o){r.close();return}r.enqueue({payload:{kind:"js",data:n}})},cancel(r){return t.cancel(r)}})}import{chmod as Qa,cp as Rs,mkdir as rr,rename as eu,rm as Cs,utimes as tu}from"fs/promises";import{join as rt,resolve as ru}from"path";import{resolve as it,sep as dr}from"path";function E(e,t){if(e==="")return it(t);let r=it(e),o=it(r,t),n=r.endsWith(dr)?r:r+dr;if(o!==r&&!o.startsWith(n))throw Error(`Path "${t}" resolves outside provider root "${e}"`);return o}function ue(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function ct(e,t="|"){return e.map((r)=>lt(r)).join(t)}function le(e,t){if(typeof t==="bigint")return t.toString();return t}class mr{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Pe(e){return new mr(e)}function hr(e){return e===null||e===void 0}function ze(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function yr(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $e(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function J(e){return $e(e._zod.def)??e._zod.def.shape}function gr(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return j(this,t,o),o},enumerable:!0,configurable:!0})}function _r(e,t,r){if(t in e)j(e,t,r);else e[t]=r}function G(e,t,r,o){let n=J(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(n,i);if(!s.enumerable)continue;if(s.get)gr(e,i,()=>{let c=t._zod.def.shape[i];return o?o(c,i):c});else _r(e,i,o?o(s.value,i):s.value)}}function Ks(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)gr(e,r,()=>t[r]);else _r(e,r,o.value)}}function T(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function xr(e){return JSON.stringify(e)}function br(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var at="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var vr=Pe(()=>{if(A.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ee(e){if(ae(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ae(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ut(e){if(ee(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Pr=new Set(["string","number","symbol"]);function te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function y(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function lt(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function zr(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var we=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ls(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ke(e,t)),F(e,T(r,{shape:i,checks:[]}))}function ke(e,t){let r=J(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function js(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ke(e,t)),s={};return G(s,e,Reflect.ownKeys(J(e)).filter((c)=>!i.has(c))),F(e,T(r,{shape:s,checks:[]}))}function Fs(e,t){if(!ee(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=J(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,T(e._zod.def,{shape:$r(e,t)}))}function $r(e,t){let r={};return G(r,e,Reflect.ownKeys(J(e))),Ks(r,t),r}function Ms(e,t){if(!ee(t))throw Error("Invalid input to safeExtend: expected a plain object");return F(e,T(e._zod.def,{shape:$r(e,t)}))}function Us(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(J(e))),G(r,t,Reflect.ownKeys(J(t)));let o=T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,o)}function wr(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ke(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(J(t)),e&&((u,p)=>c&&!c.has(p)?u:new e({type:"optional",innerType:u}))),F(t,T(t._zod.def,{shape:a,checks:[]}))}function Js(e,t,r){let o=r?new Set(ke(t,r)):void 0,n={};return G(n,t,Reflect.ownKeys(J(t)),(i,s)=>o&&!o.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,T(t._zod.def,{shape:n}))}function M(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function kr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Se(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function ce(e){return typeof e==="string"?e:e?.message}function ft(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function V(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ce(e.inst?._zod.def?.error?.(e))??ce(i?.(e))??ce(t?.error?.(e))??ce(r.customError?.(e))??ce(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e)){if(a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__")continue;c[a]=e[a]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Bs=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!Bs.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Oe(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Sr(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function X(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function Zr(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else Ws(e,r,o.value)}}function B(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ie(e,t,r){return B(e,t,r,!1)}function Or(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,o(this))},set(n){B(this,r,n)}})}return t}function Ws(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(o){B(this,t,o)}})}function Vs(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var st,W=!1,Hs={configurable:!0,get(){W=!0;return}};function x(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&st!==e._zod){st=void 0;return}st=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,Hs);let n=W;W=!1;try{let i=r(this);if(W)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return W=W||n,i}catch(i){throw delete this[t],W=W||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function Gs(e,t,r,o){let n=Vs(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:i})}})}var Xs="~constantCatch";function Ir(e){let t=()=>e;return t[Xs]=!0,t}var Er;var dt={value:void 0,enumerable:!1},Tr="captureStackTrace"in Error?Error:null;function Ys(e){let t=Tr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Tr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,o){let n={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=n;let s=r,c=s&&new WeakSet;function a(d,m){if(!d._zod){dt.value=new i(m);try{Object.defineProperty(d,"_zod",dt)}finally{dt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),g=d._zod.constr.prototype,b=_;while(b&&b!==g)b=Object.getPrototypeOf(b);let K=b??_;if(!c.has(K))c.add(K),Zr(K,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let u=o?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function f(d){let m=o?.Parent?Ys(p):this;a(m,d);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(o?.Parent&&d instanceof o.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class U extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Er=globalThis).__zod_globalConfig??(Er.__zod_globalConfig={});var A=globalThis.__zod_globalConfig;function N(e){if(e)Object.assign(A,e);return A}function qs(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,le,2)),e.message}function Qs(e){this._zod.message=e}var ec={get:qs,set:Qs,enumerable:!0,configurable:!0},ht={value:void 0,enumerable:!1},Ar=new WeakSet([Object.prototype,Error.prototype]),Rr=(e,t)=>{e.name="$ZodError",ht.value=t,Object.defineProperty(e,"issues",ht),ht.value=void 0,Object.defineProperty(e,"message",ec);let r=Object.getPrototypeOf(e);if(!Ar.has(r))Ar.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},Cr=l("$ZodError",Rr),dl=l("$ZodError",Rr,void 0,{Parent:Error});function tc(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Nr(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)tc(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Dr(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>o({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let a=r,u=0;while(u<c.length){let p=c[u],f=u===c.length-1;if(p==="_errors"){if(f)a._errors.push(t(s));u++;continue}if(!Object.prototype.hasOwnProperty.call(a,p))Object.defineProperty(a,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=a[p];if(f)d._errors.push(t(s));a=d,u++}}}};return o(e),r}function Ee(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Te=(e)=>{let t=(r,o,n,i)=>{let s=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)throw new U;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Ae=(e)=>{let t=async(r,o,n,i)=>{let s=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Re=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new U;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};function Kr(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>V(n,r,N()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Ce=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};var rc=Symbol.for("zod.compile.invalid"),oc=Symbol.for("zod.compile.fallback"),yt=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==rc)return!0;if(o.definite===!0&&r===void 0)return!1}return nc(e,t,r)};function nc(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,i;if(n)o[oc]=!0,i=n({value:t,issues:[]},o);else i=e._zod.run({value:t,issues:[]},o);if(i instanceof Promise)throw new U;return i.issues.length===0}var gt=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},Lr=(e)=>{let t=Te(e),r=(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(o,n,c,Ee(r,s))};return r};var jr=(e)=>{let t=Te(e),r=(o,n,i,s)=>t(o,n,i,Ee(r,s));return r};var Fr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(o,n,c,Ee(r,s))};return r};var Mr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>await t(o,n,i,Ee(r,s));return r};var Ur=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Re(e)(t,r,n)};var Jr=(e)=>(t,r,o)=>Re(e)(t,r,o);var Br=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ce(e)(t,r,n)};var Wr=(e)=>async(t,r,o)=>Ce(e)(t,r,o);var Vr=/^[cC][0-9a-z]{6,}$/,Hr=/^[0-9a-z]+$/,Gr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xr=/^[0-9a-vA-V]{20}$/,Yr=/^[A-Za-z0-9]{27}$/,qr=/^[a-zA-Z0-9_-]{21}$/;function Qr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var to=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,xt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var ro=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ic="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function oo(){return new RegExp(ic,"u")}var no=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,io=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var so=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,co=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ao=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uo=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var lo=/^https?$/,po=/^\+[1-9]\d{6,14}$/;var fo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function sc(e){return new RegExp(`^${e}$`)}var mo=sc(fo);function _t(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function ho(e){return new RegExp(`^${_t(e)}$`)}function yo(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${_t({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${_t({precision:e.precision})}`:r;return new RegExp(`^${fo}T(?:${o})$`)}var go=/^[\s\S]{0,}$/;var bt=/^-?\d+(?:\.\d+)?$/;var _o=/^[^A-Z]*$/,xo=/^[^a-z]*$/;var O=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var vt=(e)=>{let t=e.value;return!hr(t)&&t.length!==void 0},Ne={number:"number",bigint:"bigint",object:"date"},Pt=l("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zt=l("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bo=l("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):yr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),vo=l("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=we[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(c<n)s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Po=l("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>t.maximum?Ze(n):i)<=t.maximum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zo=l("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>=t.minimum&&i<t.minimum*2?Ze(n):i)>=t.minimum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$o=l("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length,s=typeof n==="string"&&i>=t.length&&i<=t.length*2?Ze(n):i;if(s===t.length)return;let c=Oe(n),a=s>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),de=l("$ZodCheckStringFormat",(e,t)=>{var r,o;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),wo=l("$ZodCheckRegex",(e,t)=>{de.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ko=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_o),de.init(e,t)}),So=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xo),de.init(e,t)}),Zo=l("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=te(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Oo=l("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${te(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${te(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Eo=l("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class $t{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
3
|
`).filter((i)=>i),o=Math.min(...r.map((i)=>i.length-i.trimStart().length)),n=r.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
4
|
${t.join(`
|
|
5
5
|
`)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowscripter/io-plugin-filesystem",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Local filesystem source/sink plugin for https://github.com/flowscripter/pluggable-io-framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"test": "bun test"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flowscripter/pluggable-io-framework-api": "^3.
|
|
39
|
+
"@flowscripter/pluggable-io-framework-api": "^3.1.1",
|
|
40
40
|
"zod": "^4.6.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@flowscripter/dynamic-plugin-framework": "^2.2.
|
|
43
|
+
"@flowscripter/dynamic-plugin-framework": "^2.2.19",
|
|
44
44
|
"@types/bun": "^1.4.2",
|
|
45
|
-
"@types/node": "^26.6.
|
|
46
|
-
"oxfmt": "0.
|
|
47
|
-
"oxlint": "1.
|
|
45
|
+
"@types/node": "^26.6.4",
|
|
46
|
+
"oxfmt": "0.72.0",
|
|
47
|
+
"oxlint": "1.87.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@flowscripter/dynamic-plugin-framework": "*",
|