@elyx-code/project-logic-tree 0.0.6440 → 0.0.6441
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/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -98652,7 +98652,7 @@ function hB(d) {
|
|
|
98652
98652
|
function ao(d) {
|
|
98653
98653
|
var i, a;
|
|
98654
98654
|
const u = [];
|
|
98655
|
-
if (yi.includes(d.type) || d.type === f.ReturnStatement || gt.includes(d.type) || d.type !== f.InternalCall && !gt.includes(d.parent.type) && !((i = d.parent.implements) != null && i.outputs.length) || d.type === f.InternalCall && !gt.includes(d.parent.parent.type) && !((a = d.parent.parent.implements) != null && a.outputs.length) || mt.includes(d.type) && d.internalCalls.some(
|
|
98655
|
+
if (!yi.includes(d.type) || d.type === f.ReturnStatement || gt.includes(d.type) || d.type !== f.InternalCall && !gt.includes(d.parent.type) && !((i = d.parent.implements) != null && i.outputs.length) || d.type === f.InternalCall && !gt.includes(d.parent.parent.type) && !((a = d.parent.parent.implements) != null && a.outputs.length) || mt.includes(d.type) && d.internalCalls.some(
|
|
98656
98656
|
(o) => !!o.calledBy.length
|
|
98657
98657
|
))
|
|
98658
98658
|
return u;
|
package/dist/index.umd.cjs
CHANGED
|
@@ -386,7 +386,7 @@ The only use for declaring global callable entities is for a 'variable-declarati
|
|
|
386
386
|
Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,entity:d}));else{const i=qp(d);if(!i.reachable){let a=`This '${d.type}' entity "${W(d,d.project)}" with id "${d.id}" is not reachable from the project's closest entry point '${i.entryPoint.type}' "${W(i.entryPoint,d.project)}".`;a+=`
|
|
387
387
|
This is because there are termination statements in the call chain before reaching this '${d.type}'.
|
|
388
388
|
If a caller entity calls a termination statement, it will always prevent all other calls from executing.`;let o=`
|
|
389
|
-
This '${d.type}' is blocked `;i.blocks.forEach((p,e)=>{const y=p.blockedByCaller,v=p.blockedByCalling;e===0?o+="by ":e===i.blocks.length-1&&(o+="and by "),o+=`its ancestor "${W(y,d.project)}" with id "${y.id}" that calls a '${v.type}' entity with id "${v.id}"`,e<i.blocks.length-1?o+=", ":o+="."}),u.push(new ar({id:`${d.id}--${ee.UnreachableEntity}`,code:ee.UnreachableEntity,severity:q.Warning,message:`${a}${o}`,entity:d}))}}return vr(d.errors,u)}function po(d){const u=[],i=d.project.requestActiveDynamicValue(d);if((i==null?void 0:i.type)===Ae.Missing){const a=lt({id:`${d.id}--${Q.MissingRequiredValue}`,message:`The '${d.type}' entity "${W(d,d.project)}" with id "${d.id}" is missing its required value before it can be executed or published.`,severity:q.Error,code:Q.MissingRequiredValue,entity:d});u.push(a.error)}return u}function ZA(d){const u=[];if(!d.internalCalls.length)return u;const i=d.internalCalls.some(a=>a.calledBy.length||a.successCalls.length||a.errorCalls.length||a.getUsedInputs().length||a.getUsedOutputs().length);if(d.readsValue&&i){const a=lt({id:`${d.id}--${Q.VariableReadsValueAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" reads a value. A variable with internal calls can't read a value.`,severity:q.Error,code:Q.VariableReadsValueAndInternalCall,entity:d});u.push(a.error)}if(d.writesValues.length&&i){const a=lt({id:`${d.id}--${Q.VariableWritesValuesAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" writes values. A variable with internal calls can't write a value.`,severity:q.Error,code:Q.VariableWritesValuesAndInternalCall,entity:d});u.push(a.error)}if(d.getUsedInputs().length&&i){const a=lt({id:`${d.id}--${Q.VariableHasInputsAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" has inputs. A variable with internal calls can't have inputs.`,severity:q.Error,code:Q.VariableHasInputsAndInternalCall,entity:d});u.push(a.error)}if(d.getUsedOutputs().length&&i){const a=lt({id:`${d.id}--${Q.VariableHasOutputsAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" has outputs. A variable with internal calls can't have outputs.`,severity:q.Error,code:Q.VariableHasOutputsAndInternalCall,entity:d});u.push(a.error)}if(d.calledBy.length&&i){const a=lt({id:`${d.id}--${Q.VariableIsCalledAndHasInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,severity:q.Error,code:Q.VariableIsCalledAndHasInternalCall,entity:d});u.push(a.error)}if([...d.successCalls,...d.errorCalls].length&&i){const a=lt({id:`${d.id}--${Q.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" calls other entities. A variable with internal calls can't call other entities.`,severity:q.Error,code:Q.VariableCallsOthersAndHasInternalCall,entity:d});u.push(a.error)}return u}function HTe(d){const u=d.variableDeclarations,i=d.events.flatMap(e=>[e,...bt(e)]),a=d.functions.flatMap(e=>d.instancesList.find(y=>y.type===f.FunctionCall&&y.declaration.id===e.id)?[e,...bt(e)]:[]),o=d.entities.flatMap(e=>[e,...d.entities.reduce((y,v)=>[...y,...v.methods.flatMap(E=>[E,...bt(E)])],[])]);return xT([...u,...i,...a,...o].flatMap(e=>e.getErrors()))}function HA(d){var a;const u=[];if(!((a=d.implements)!=null&&a.outputs.length))return u;if(bt(d).filter(o=>o.type!==f.ReturnStatement&&o.parent===d).length){const o=lt({id:`${d.id}--${Q.LackingReturnStatementOnSomeBranches}`,message:`The '${d.type}' entity "${W(d,d.project)}" with id "${d.id}" is missing the required return statement by its implementation on some branches.`,severity:q.Error,code:Q.LackingReturnStatementOnSomeBranches,entity:d});u.push(o.error)}return u}function Ca(d){var i,a;const u=[];if(li.includes(d.type)||d.type===f.ReturnStatement||Dt.includes(d.type)||d.type!==f.InternalCall&&!Dt.includes(d.parent.type)&&!((i=d.parent.implements)!=null&&i.outputs.length)||d.type===f.InternalCall&&!Dt.includes(d.parent.parent.type)&&!((a=d.parent.parent.implements)!=null&&a.outputs.length)||yt.includes(d.type)&&d.internalCalls.some(o=>!!o.calledBy.length))return u;if(!d.calledBySuccess.length&&!d.calledByError.length){const o=lt({id:`${d.id}--${Q.LastCalledEntityMustBeReturnEntity}`,message:`The '${d.type}' entity "${W(d,d.project)}" with id "${d.id}" cannot be the last entity of the branch. A return statement must be the last entity on all branches of its parent entry-point.`,severity:q.Error,code:Q.LastCalledEntityMustBeReturnEntity,entity:d});u.push(o.error)}return u}function y5(d){var a;d.inputs.forEach(o=>o.validate()),d.outputs.forEach(o=>o.validate()),(a=d.error)==null||a.validate();const i=[...Oa(d),...Ca(d)];return vr(d.errors,i)}const WTe=Object.freeze(Object.defineProperty({__proto__:null,validate:y5},Symbol.toStringTag,{value:"Module"}));var m5=(d=>(d.Parent="parent",d.Declaration="declaration",d))(m5||{});const Qt=class Qt extends Cr{constructor(i,a){super(i);g(this,"initialData");g(this,"id");g(this,"x");g(this,"y");g(this,"type",f.FunctionCall);g(this,"successCalls",[]);g(this,"errorCalls",[]);g(this,"process",null);g(this,"declaration");g(this,"inputs",[]);g(this,"outputs",[]);g(this,"calledBySuccess",[]);g(this,"calledByError",[]);g(this,"calledByEntry",[]);g(this,"error",null);g(this,"parent");g(this,"errors",[]);g(this,"project");g(this,"detachedDependents",{});g(this,"knownVersions",null);g(this,"activeVersion",!1);g(this,"initialized",!1);g(this,"startedInitialization",!1);this.initialData=i,this.project=a,this.id=i.id,this.x=i.x,this.y=i.y}static new(i=null){return{id:N.UUID.uuid(),version:N.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||L().toISOString(),author:(i==null?void 0:i.author)||N.sessionAuthor,previousVersion:null,deleted:!1,type:f.FunctionCall,declaration:null,inputs:[],outputs:[],process:null,error:null,parent:null,calledByEntry:[],calledBySuccess:[],calledByError:[],errorCalls:[],successCalls:[],x:0,y:0}}static fromGenerationTarget(i,a){let o=a;if(i.parent){const $=H(i.parent);o=a.get($)}const p=H(i.declaration),e=a.get(p),y=i.calledByEntry.map($=>{const V=H($);return a.get(V)}),v=i.calledBySuccess.map($=>{const V=H($);return a.get(V)}),E=i.calledByError.map($=>{const V=H($);return a.get(V)}),b={id:i.id,version:N.UUID.uuid(),createdAt:L().toISOString(),author:N.sessionAuthor,previousVersion:null,deleted:!1,type:f.FunctionCall,declaration:e.toReference(),calledByEntry:y,calledBySuccess:v,calledByError:E,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:o},A=ie(b,a);return A.setParent(o,null),A}static validateGenerationTarget(i,a){let o=JSON.parse(JSON.stringify(i));const p=[],e=ri(o,{parent:{list:!1,types:[...Nr,f.Project],optional:!0}},a);o=e.modifiedData,p.push(...e.errors,...Vr(o));const y=H(o.declaration);if(y){const v=p5(y,a);p.push(...v)}else{const v=a.functions.length?`
|
|
389
|
+
This '${d.type}' is blocked `;i.blocks.forEach((p,e)=>{const y=p.blockedByCaller,v=p.blockedByCalling;e===0?o+="by ":e===i.blocks.length-1&&(o+="and by "),o+=`its ancestor "${W(y,d.project)}" with id "${y.id}" that calls a '${v.type}' entity with id "${v.id}"`,e<i.blocks.length-1?o+=", ":o+="."}),u.push(new ar({id:`${d.id}--${ee.UnreachableEntity}`,code:ee.UnreachableEntity,severity:q.Warning,message:`${a}${o}`,entity:d}))}}return vr(d.errors,u)}function po(d){const u=[],i=d.project.requestActiveDynamicValue(d);if((i==null?void 0:i.type)===Ae.Missing){const a=lt({id:`${d.id}--${Q.MissingRequiredValue}`,message:`The '${d.type}' entity "${W(d,d.project)}" with id "${d.id}" is missing its required value before it can be executed or published.`,severity:q.Error,code:Q.MissingRequiredValue,entity:d});u.push(a.error)}return u}function ZA(d){const u=[];if(!d.internalCalls.length)return u;const i=d.internalCalls.some(a=>a.calledBy.length||a.successCalls.length||a.errorCalls.length||a.getUsedInputs().length||a.getUsedOutputs().length);if(d.readsValue&&i){const a=lt({id:`${d.id}--${Q.VariableReadsValueAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" reads a value. A variable with internal calls can't read a value.`,severity:q.Error,code:Q.VariableReadsValueAndInternalCall,entity:d});u.push(a.error)}if(d.writesValues.length&&i){const a=lt({id:`${d.id}--${Q.VariableWritesValuesAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" writes values. A variable with internal calls can't write a value.`,severity:q.Error,code:Q.VariableWritesValuesAndInternalCall,entity:d});u.push(a.error)}if(d.getUsedInputs().length&&i){const a=lt({id:`${d.id}--${Q.VariableHasInputsAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" has inputs. A variable with internal calls can't have inputs.`,severity:q.Error,code:Q.VariableHasInputsAndInternalCall,entity:d});u.push(a.error)}if(d.getUsedOutputs().length&&i){const a=lt({id:`${d.id}--${Q.VariableHasOutputsAndInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" has outputs. A variable with internal calls can't have outputs.`,severity:q.Error,code:Q.VariableHasOutputsAndInternalCall,entity:d});u.push(a.error)}if(d.calledBy.length&&i){const a=lt({id:`${d.id}--${Q.VariableIsCalledAndHasInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,severity:q.Error,code:Q.VariableIsCalledAndHasInternalCall,entity:d});u.push(a.error)}if([...d.successCalls,...d.errorCalls].length&&i){const a=lt({id:`${d.id}--${Q.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${W(d,d.project)}" with id "${d.id}" calls other entities. A variable with internal calls can't call other entities.`,severity:q.Error,code:Q.VariableCallsOthersAndHasInternalCall,entity:d});u.push(a.error)}return u}function HTe(d){const u=d.variableDeclarations,i=d.events.flatMap(e=>[e,...bt(e)]),a=d.functions.flatMap(e=>d.instancesList.find(y=>y.type===f.FunctionCall&&y.declaration.id===e.id)?[e,...bt(e)]:[]),o=d.entities.flatMap(e=>[e,...d.entities.reduce((y,v)=>[...y,...v.methods.flatMap(E=>[E,...bt(E)])],[])]);return xT([...u,...i,...a,...o].flatMap(e=>e.getErrors()))}function HA(d){var a;const u=[];if(!((a=d.implements)!=null&&a.outputs.length))return u;if(bt(d).filter(o=>o.type!==f.ReturnStatement&&o.parent===d).length){const o=lt({id:`${d.id}--${Q.LackingReturnStatementOnSomeBranches}`,message:`The '${d.type}' entity "${W(d,d.project)}" with id "${d.id}" is missing the required return statement by its implementation on some branches.`,severity:q.Error,code:Q.LackingReturnStatementOnSomeBranches,entity:d});u.push(o.error)}return u}function Ca(d){var i,a;const u=[];if(!li.includes(d.type)||d.type===f.ReturnStatement||Dt.includes(d.type)||d.type!==f.InternalCall&&!Dt.includes(d.parent.type)&&!((i=d.parent.implements)!=null&&i.outputs.length)||d.type===f.InternalCall&&!Dt.includes(d.parent.parent.type)&&!((a=d.parent.parent.implements)!=null&&a.outputs.length)||yt.includes(d.type)&&d.internalCalls.some(o=>!!o.calledBy.length))return u;if(!d.calledBySuccess.length&&!d.calledByError.length){const o=lt({id:`${d.id}--${Q.LastCalledEntityMustBeReturnEntity}`,message:`The '${d.type}' entity "${W(d,d.project)}" with id "${d.id}" cannot be the last entity of the branch. A return statement must be the last entity on all branches of its parent entry-point.`,severity:q.Error,code:Q.LastCalledEntityMustBeReturnEntity,entity:d});u.push(o.error)}return u}function y5(d){var a;d.inputs.forEach(o=>o.validate()),d.outputs.forEach(o=>o.validate()),(a=d.error)==null||a.validate();const i=[...Oa(d),...Ca(d)];return vr(d.errors,i)}const WTe=Object.freeze(Object.defineProperty({__proto__:null,validate:y5},Symbol.toStringTag,{value:"Module"}));var m5=(d=>(d.Parent="parent",d.Declaration="declaration",d))(m5||{});const Qt=class Qt extends Cr{constructor(i,a){super(i);g(this,"initialData");g(this,"id");g(this,"x");g(this,"y");g(this,"type",f.FunctionCall);g(this,"successCalls",[]);g(this,"errorCalls",[]);g(this,"process",null);g(this,"declaration");g(this,"inputs",[]);g(this,"outputs",[]);g(this,"calledBySuccess",[]);g(this,"calledByError",[]);g(this,"calledByEntry",[]);g(this,"error",null);g(this,"parent");g(this,"errors",[]);g(this,"project");g(this,"detachedDependents",{});g(this,"knownVersions",null);g(this,"activeVersion",!1);g(this,"initialized",!1);g(this,"startedInitialization",!1);this.initialData=i,this.project=a,this.id=i.id,this.x=i.x,this.y=i.y}static new(i=null){return{id:N.UUID.uuid(),version:N.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||L().toISOString(),author:(i==null?void 0:i.author)||N.sessionAuthor,previousVersion:null,deleted:!1,type:f.FunctionCall,declaration:null,inputs:[],outputs:[],process:null,error:null,parent:null,calledByEntry:[],calledBySuccess:[],calledByError:[],errorCalls:[],successCalls:[],x:0,y:0}}static fromGenerationTarget(i,a){let o=a;if(i.parent){const $=H(i.parent);o=a.get($)}const p=H(i.declaration),e=a.get(p),y=i.calledByEntry.map($=>{const V=H($);return a.get(V)}),v=i.calledBySuccess.map($=>{const V=H($);return a.get(V)}),E=i.calledByError.map($=>{const V=H($);return a.get(V)}),b={id:i.id,version:N.UUID.uuid(),createdAt:L().toISOString(),author:N.sessionAuthor,previousVersion:null,deleted:!1,type:f.FunctionCall,declaration:e.toReference(),calledByEntry:y,calledBySuccess:v,calledByError:E,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:o},A=ie(b,a);return A.setParent(o,null),A}static validateGenerationTarget(i,a){let o=JSON.parse(JSON.stringify(i));const p=[],e=ri(o,{parent:{list:!1,types:[...Nr,f.Project],optional:!0}},a);o=e.modifiedData,p.push(...e.errors,...Vr(o));const y=H(o.declaration);if(y){const v=p5(y,a);p.push(...v)}else{const v=a.functions.length?`
|
|
390
390
|
All global 'function-declaration' entity ids are:
|
|
391
391
|
- ${a.functions.map(E=>`${E.id} (${W(E,a)})`).join(`
|
|
392
392
|
- `)}.`:`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyx-code/project-logic-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6441",
|
|
4
4
|
"author": "Sergio Herrero",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",
|