@coalescesoftware/coa 7.30.8 → 7.30.9

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/worker.node.js CHANGED
@@ -958,7 +958,7 @@ Body: "`+a+'"')})}};Xg.WorkflowAutomationApiResponseProcessor=c0t;var LBr=class{
958
958
  \f\u200B`,wordwrap:80};var SA=si(fM());var sPt=(r,e,t,a,...i)=>{let n=jm(),o={...e,area:r},u=d=>{if(typeof d=="object")try{return JSON.stringify(d)}catch(c){return n.error("Could not stringify argument.",{error:c}),""}else return String(d)},p=`${a} ${i.map(u).join(" ")}`;n.log(t,p,o)};var R0=class{valid=!1;failures;originalValue;constructor(e,t){this.originalValue=OQt(e),this.failures=t}get failureMessage(){return this.failures.map(e=>e.path.length>0?`${e.path}: ${e.message}`:e.message).join(`
959
959
  `)}},s8r=null,LM=class extends la{code;result;constructor(e,t,a=400){super(e,typeof t=="string"?t:t?.failureMessage),this.result=typeof t=="string"?void 0:t,this.code=a}statusCode(){return this.code}get validationResult(){return this.result}get failureDetails(){return this.result?`${this.message}: ${this.result.failureMessage}`:this.message}},KB=class{constructor(e){this.name=e}is(e){return this.validate(e).valid}assert(e,t){return this.doAssert(e,!0,t)}verify(e,t){let a=!!(t?.throwOnVerify??!1);return this.doAssert(e,a,t)}doAssert(e,t,a){let{logContext:i,logArea:n,failureLogLevel:o,successLogLevel:u,statusCode:p,errorMessage:d}=a||{},c=this.validate(e),g=a?.additionalValidation?.(e)||{valid:!0},l=g.valid?c:g;if(!l.valid){let y=typeof d=="function"?d(l):d??`Found ${l.failures.length} validation failure(s) for ${this.name}`,b=new LM(y,l,p);if(o!==s8r){let m=e;m&&typeof m=="object"&&(m=OQt(m)),sPt(n,i,o||"error",b,m)}if(t)throw b;return e}return u&&sPt(n,i,u,`${this.name} validation succeeded`,e),l.value}};var uPt=class extends KB{constructor(t,a){super(t);this.runtype=a;if(!a)throw new la(`Missing runtype for ${t} validator. Did you use a circular import?`)}validate(t){try{let a=this.runtype.validate(t);return a.success?{valid:!0,value:t}:this.createValidationFailedResult(a,t)}catch(a){return jm().error(`RuntypesValidator: Unable to validate ${this.name} value.
960
960
  Error: ${a}
961
- Value: ${t}`),new R0(t,[{path:"",message:"value triggered unknown runtypes error"}])}}createValidationFailedResult(t,a){let i=[],n=(o,u)=>{for(let[p,d]of Object.entries(u)){let c=o.concat(p);typeof d=="string"?i.push({path:c.join("."),message:d}):n(c,d)}};if(t.code==="TYPE_INCORRECT"||t.code==="CONSTRAINT_FAILED")i.push({path:"",message:t.message});else{let o=t.details;o&&n([],o)}return new R0(a,i)}},APt=(r,e)=>new uPt(r,e);var u8r=SA.Record({errorDetail:SA.String,errorString:SA.String}),f0i=SA.Record({error:u8r,runDetails:SA.Record({compiledSQL:SA.String}).nullable().optional(),validationDetails:SA.Record({id:SA.String,type:SA.String,value:SA.Unknown}).optional()}),I0i=APt("TRunErrorContents",u8r),A8r=APt("TRunError",f0i);var Lqn=fp("RUNNER_BACKEND"),zqn=fp("ERROR_OPERATIONS");var c8r=r=>{try{return A8r.is(r)}catch{return!1}};var r1=si(fM()),ALr=si(uLr()),q4n=(0,r1.Record)({version:r1.String,hash:r1.String}),hBi=()=>({version:"7.30.8",hash:"0c366216c76b65310993b36a0f0cfe3c9844933d"}),ew=hBi(),cLr=r=>{if(r===null)return null;let e=(0,ALr.parse)(r.version);if(!e)return null;let t=e.prerelease.slice(0,2).join(".").replace(/^aa-dev\.(\d+)/,".dev$1").replace(/^alpha\.(\d+)/,"a$1").replace(/^beta\.(\d+)/,"b$1").replace(/^rc\.(\d+)/,"rc$1"),a=e.prerelease.slice(2).join(".").replace(/[^a-zA-Z0-9]/g,"."),i=e.build.join(".").replace(/[^a-zA-Z0-9]/g,"."),n="";return a&&i?n=`+${a}.${i}`:a?n=`+${a}`:i&&(n=`+${i}`),`${e.major}.${e.minor}.${e.patch}${t}${n}`};var Ny=fp("RENDERER"),IBi=(r,e)=>e instanceof r.ffi.PyProxy&&e.type==="list"&&e instanceof r.ffi.PyIterable,SBi=(r,e)=>e instanceof r.ffi.PyProxy&&e.type==="dict"&&e instanceof r.ffi.PyIterable&&e instanceof r.ffi.PyDict,wPt=(r,e)=>{if(!(e instanceof r.ffi.PyProxy))return e;if(SBi(r,e)){let t={};for(let a of e){if(typeof a!="string")throw new Error("Object key was not a string!");t[a]=wPt(r,e.get(a))}return t}if(IBi(r,e)){let t=[];for(let a of e)t.push(wPt(r,a));return t}throw new Error(`Unhandled object type: ${e?.type}`)};var tw="/pystatic",EBi=r=>{if(process.env.PYTHON_WHEEL_URL)return process.env.PYTHON_WHEEL_URL;let e=cLr(ew)||"0.1.0";return`${r}/renderer-${e}-py3-none-any.whl`},pLr=async r=>{let e=l=>{Ny.alert("Python stderr:",l)},t=l=>{Ny.debug("Python stdout:",l)},{pyodideURL:a,emfs:i,postLoad:n}=r,o=i?`emfs:${tw}`:a,u=EBi(o),p;try{p=new URL(u)}catch{throw Ny.emerg("Could not form a valid renderer URL!",u),new la(`Could not form a valid renderer URL, trying to use ${u}`)}if(!p.pathname.endsWith(".whl"))throw Ny.emerg("Got an invalid renderer URL that did not end in '.whl'",p.pathname,"full URL:",u),new la(`Got an invalid renderer URL that did not end in whl (${u})`);let d=performance.now()/1e3;Ny.info("Loading, with pyodideUrl: ",a);let c=await CQt({indexURL:a,stderr:e,stdout:t,stdin:()=>{throw new Error("No stdin!")}});n&&await n(c);let g=performance.now()/1e3;return Ny.info("Pyodide initialization complete in ",g-d," seconds"),c},dLr=async(r,e)=>{let t,a=r.toPy({parameters:JSON.parse(JSON.stringify(e))}),i=new Date,n;try{return t=await r.runPythonAsync(`
961
+ Value: ${t}`),new R0(t,[{path:"",message:"value triggered unknown runtypes error"}])}}createValidationFailedResult(t,a){let i=[],n=(o,u)=>{for(let[p,d]of Object.entries(u)){let c=o.concat(p);typeof d=="string"?i.push({path:c.join("."),message:d}):n(c,d)}};if(t.code==="TYPE_INCORRECT"||t.code==="CONSTRAINT_FAILED")i.push({path:"",message:t.message});else{let o=t.details;o&&n([],o)}return new R0(a,i)}},APt=(r,e)=>new uPt(r,e);var u8r=SA.Record({errorDetail:SA.String,errorString:SA.String}),f0i=SA.Record({error:u8r,runDetails:SA.Record({compiledSQL:SA.String}).nullable().optional(),validationDetails:SA.Record({id:SA.String,type:SA.String,value:SA.Unknown}).optional()}),I0i=APt("TRunErrorContents",u8r),A8r=APt("TRunError",f0i);var Lqn=fp("RUNNER_BACKEND"),zqn=fp("ERROR_OPERATIONS");var c8r=r=>{try{return A8r.is(r)}catch{return!1}};var r1=si(fM()),ALr=si(uLr()),q4n=(0,r1.Record)({version:r1.String,hash:r1.String}),hBi=()=>({version:"7.30.9",hash:"97b6c0291c0182e1b1cd865525be1686aaab116b"}),ew=hBi(),cLr=r=>{if(r===null)return null;let e=(0,ALr.parse)(r.version);if(!e)return null;let t=e.prerelease.slice(0,2).join(".").replace(/^aa-dev\.(\d+)/,".dev$1").replace(/^alpha\.(\d+)/,"a$1").replace(/^beta\.(\d+)/,"b$1").replace(/^rc\.(\d+)/,"rc$1"),a=e.prerelease.slice(2).join(".").replace(/[^a-zA-Z0-9]/g,"."),i=e.build.join(".").replace(/[^a-zA-Z0-9]/g,"."),n="";return a&&i?n=`+${a}.${i}`:a?n=`+${a}`:i&&(n=`+${i}`),`${e.major}.${e.minor}.${e.patch}${t}${n}`};var Ny=fp("RENDERER"),IBi=(r,e)=>e instanceof r.ffi.PyProxy&&e.type==="list"&&e instanceof r.ffi.PyIterable,SBi=(r,e)=>e instanceof r.ffi.PyProxy&&e.type==="dict"&&e instanceof r.ffi.PyIterable&&e instanceof r.ffi.PyDict,wPt=(r,e)=>{if(!(e instanceof r.ffi.PyProxy))return e;if(SBi(r,e)){let t={};for(let a of e){if(typeof a!="string")throw new Error("Object key was not a string!");t[a]=wPt(r,e.get(a))}return t}if(IBi(r,e)){let t=[];for(let a of e)t.push(wPt(r,a));return t}throw new Error(`Unhandled object type: ${e?.type}`)};var tw="/pystatic",EBi=r=>{if(process.env.PYTHON_WHEEL_URL)return process.env.PYTHON_WHEEL_URL;let e=cLr(ew)||"0.1.0";return`${r}/renderer-${e}-py3-none-any.whl`},pLr=async r=>{let e=l=>{Ny.alert("Python stderr:",l)},t=l=>{Ny.debug("Python stdout:",l)},{pyodideURL:a,emfs:i,postLoad:n}=r,o=i?`emfs:${tw}`:a,u=EBi(o),p;try{p=new URL(u)}catch{throw Ny.emerg("Could not form a valid renderer URL!",u),new la(`Could not form a valid renderer URL, trying to use ${u}`)}if(!p.pathname.endsWith(".whl"))throw Ny.emerg("Got an invalid renderer URL that did not end in '.whl'",p.pathname,"full URL:",u),new la(`Got an invalid renderer URL that did not end in whl (${u})`);let d=performance.now()/1e3;Ny.info("Loading, with pyodideUrl: ",a);let c=await CQt({indexURL:a,stderr:e,stdout:t,stdin:()=>{throw new Error("No stdin!")}});n&&await n(c);let g=performance.now()/1e3;return Ny.info("Pyodide initialization complete in ",g-d," seconds"),c},dLr=async(r,e)=>{let t,a=r.toPy({parameters:JSON.parse(JSON.stringify(e))}),i=new Date,n;try{return t=await r.runPythonAsync(`
962
962
  from js import Array, Object
963
963
  from pyodide.ffi import to_js
964
964
  import os