@elyx-code/project-logic-tree 0.0.6994 → 0.0.6995

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.cjs CHANGED
@@ -602,7 +602,7 @@ The only use for declaring global callable entities is for a 'variable-declarati
602
602
  Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,entity:s}));else{const i=tv(s);if(!i.reachable&&i.entryPoint){let r=`This '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" is not reachable from the project's closest entry point '${i.entryPoint.type}' "${le(i.entryPoint,s.project)}".`;r+=`
603
603
  This is because there are termination statements in the call chain before reaching this '${s.type}'.
604
604
  If a caller entity calls a termination statement, it will always prevent all other calls from executing.`;let a=`
605
- This '${s.type}' is blocked `;i.blocks.forEach((c,e)=>{const f=c.blockedByCaller,h=c.blockedByCalling;e===0?a+="by ":e===i.blocks.length-1&&(a+="and by "),a+=`its ancestor "${le(f,s.project)}" with id "${f.id}" that calls a '${h.type}' entity with id "${h.id}"`,e<i.blocks.length-1?a+=", ":a+="."}),u.push(new vi({id:`${s.id}--${we.UnreachableEntity}`,code:we.UnreachableEntity,severity:ve.Warning,message:`${r}${a}`,entity:s}))}}return Kt(s.errors,u)}function Wke(s){const u=[],i=Mt(s,s.project);if(i){if(i.type===d.Project)return u}else return u;if(s.type===d.Condition&&s.parent.type===d.Condition)return u;const r=i.getDataType(null),a=Wa(r,{removeDuplicates:!0}),c=a.find(f=>{var h;return((h=f==null?void 0:f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id}),e=a.every(f=>{var h;return f.isResolved&&((h=f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id});return!r||!c?u:((s.type===d.Condition||s.catchesError)&&!s.errorCalls.length&&e&&u.push(new vi({id:`${s.id}--${be.ParentScopeRequiresReturnCurrentCatchesErrorWithNoCalls}`,code:be.ParentScopeRequiresReturnCurrentCatchesErrorWithNoCalls,severity:ve.Error,message:`This '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" catches its errors, which terminates the branch, but its parent ${i.type} "${le(i,s.project)}" with id "${i.id}" requires a returned value.`,entity:s})),Kt(s.errors,u))}function ga(s){const u=[...Wke(s)],i=Mt(s,s.project);if(i){if(i.type===d.Project)return u}else return u;if(s.type===d.Condition&&s.parent.type===d.Condition||s.type===d.InternalCall&&!s.calledBy.length)return u;const r=i.getDataType(null),a=Wa(r,{removeDuplicates:!0}),c=a.find(f=>{var h;return((h=f==null?void 0:f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id}),e=a.every(f=>{var h;return f.isResolved&&((h=f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id});return!r||!c?u:(!s.successCalls.length&&e&&u.push(new vi({id:`${s.id}--${be.ParentScopeRequiresReturnCurrentHasNoSuccessCalls}`,code:be.ParentScopeRequiresReturnCurrentHasNoSuccessCalls,severity:ve.Error,message:`This '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" has no success calls, which terminates the branch, but its parent ${i.type} "${le(i,s.project)}" with id "${i.id}" requires a returned value.`,entity:s})),Kt(s.errors,u))}function wn(s){const u=[];if(s.type===d.InputMap&&Gt.includes(s.parent.type)&&s.parent.internalCalls.some(r=>!!r.calledBy.length))return u;const i=s.project.requestActiveDynamicValue(s,!0);if((i==null?void 0:i.type)===Ge.Missing){const r=Dt({id:`${s.id}--${be.MissingRequiredValue}`,message:`The '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" is missing its required value before it can be executed or published.`,severity:ve.Error,code:be.MissingRequiredValue,entity:s});u.push(r.error)}return u}function is(s){var i,r;const u=[];if(s.codeNativeValueValidation){const a=s.project.requestActiveDynamicValue(s,!0);if(a&&((i=a.value)!=null&&i.value)){const c=s.codeNativeValueValidation(s,(r=a.value)==null?void 0:r.value);u.push(...c.errors)}}return u}function vv(s){var u;return!!((u=wn(s))!=null&&u.find(i=>i.code===be.MissingRequiredValue))}function eb(s){const u=[];if(!s.internalCalls.length)return u;const i=s.internalCalls.some(r=>r.calledBy.length||r.successCalls.length||r.errorCalls.length||r.getUsedInputs().length||r.getUsedOutputs().length);if(s.readsValue&&i){const r=Dt({id:`${s.id}--${be.VariableReadsValueAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" reads a value. A variable with internal calls can't read a value.`,severity:ve.Error,code:be.VariableReadsValueAndInternalCall,entity:s});u.push(r.error)}if(s.writesValues.length&&i){const r=Dt({id:`${s.id}--${be.VariableWritesValuesAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" writes values. A variable with internal calls can't write a value.`,severity:ve.Error,code:be.VariableWritesValuesAndInternalCall,entity:s});u.push(r.error)}if(s.getUsedInputs().length&&i){const r=Dt({id:`${s.id}--${be.VariableHasInputsAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" has inputs. A variable with internal calls can't have inputs.`,severity:ve.Error,code:be.VariableHasInputsAndInternalCall,entity:s});u.push(r.error)}if(s.getUsedOutputs().length&&i){const r=Dt({id:`${s.id}--${be.VariableHasOutputsAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" has outputs. A variable with internal calls can't have outputs.`,severity:ve.Error,code:be.VariableHasOutputsAndInternalCall,entity:s});u.push(r.error)}if(s.calledBy.length&&i){const r=Dt({id:`${s.id}--${be.VariableIsCalledAndHasInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,severity:ve.Error,code:be.VariableIsCalledAndHasInternalCall,entity:s});u.push(r.error)}if([...s.successCalls,...s.errorCalls].length&&i){const r=Dt({id:`${s.id}--${be.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" calls other entities. A variable with internal calls can't call other entities.`,severity:ve.Error,code:be.VariableCallsOthersAndHasInternalCall,entity:s});u.push(r.error)}return u}function $Vi(s){const u=s.variableDeclarations,i=s.events.flatMap(e=>[e,...ft(e)]),r=s.functions.flatMap(e=>s.instancesList.find(f=>f.type===d.FunctionCall&&f.declaration.id===e.id)?[e,...ft(e)]:[]),a=s.entities.flatMap(e=>[e,...s.entities.reduce((f,h)=>[...f,...h.methods.flatMap(m=>[m,...ft(m)])],[])]);return wE([...u,...i,...r,...a].flatMap(e=>e.getErrors()))}function zke(s){var a,c,e,f;if(s.type!==d.InternalCall){if(!Ft.includes(s.parent.type))return!1;const h=s.parent;if(!!h.returnStatements.length)return!0;const E=((a=h.implements)==null?void 0:a.getDataType(null))||null;return!(!E||((c=E.entity)==null?void 0:c.id)===ie["primitive-entity"].void.id)}if(!Ft.includes(s.parent.parent.type))return!1;const u=s.parent.parent;if(!!u.returnStatements.length)return!0;const r=((e=u.implements)==null?void 0:e.getDataType(null))||null;return!(!r||((f=r.entity)==null?void 0:f.id)===ie["primitive-entity"].void.id)}function tb(s){const u=[],i=s.getDataType(null)||null,r=Wa(i,{removeDuplicates:!0}),a=r.find(m=>{var E;return((E=m==null?void 0:m.entity)==null?void 0:E.id)!==ie["primitive-entity"].void.id}),c=r.every(m=>{var E;return m.isResolved&&((E=m.entity)==null?void 0:E.id)!==ie["primitive-entity"].void.id});if(!i||!a)return u;const e=s.returnStatements.length;if(ft(s).filter(m=>Rt.includes(m.type)?!1:m.type===d.Condition?m.parent.type===d.Condition?!1:!m.successCalls.length||!m.errorCalls.length:!!((!m.successCalls.length||!m.errorCalls.length&&m.catchesError)&&m.calledBy.length)).length&&(c||e)){const m=Dt({id:`${s.id}--${be.LackingReturnStatementOnSomeBranches}`,message:`The '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" is missing the required return statement by its implementation on some branches.`,severity:ve.Error,code:be.LackingReturnStatementOnSomeBranches,entity:s});u.push(m.error)}return u}function Ia(s){const u=[];if(!rr.includes(s.type)||Rt.includes(s.type)||Ft.includes(s.type)||!zke(s))return u;if(!s.successCalls.length&&!s.errorCalls.length&&s.calledBy.length){const i=Dt({id:`${s.id}--${be.LastCalledEntityMustBeReturnEntity}`,message:`The '${s.type}' entity "${le(s,s.project)}" with id "${s.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:ve.Error,code:be.LastCalledEntityMustBeReturnEntity,entity:s});u.push(i.error)}return u}const Yke=["class","function","if","else","for","while","do","switch","case","default","break","continue","return","try","catch","finally","throw","import","export","as","from","in","instanceof","typeof","yield","await","async","this","new","delete","void","with","const","let","var","public","private","protected","static","get","set","constructor","extends","implements","interface","namespace","package","abstract","readonly","module"];function ib(s,u=[ir],i=[],r){const a=[],c=r??s.name;if(!c){const m=Dt({id:`${s.id}--${we.EmptyName}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" does not have a name. Entities of type ${s.type} must have valid names.`,severity:ve.Error,code:we.EmptyName,entity:s});return a.push(m.error),a}const e=c.trim(),f=!i.some(m=>m.name===c||m.name===e);if(!f){const m=Dt({id:`${s.id}--${we.NameNotUniqueInScope}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" does not have a unique name. Entities of type ${s.type} must have valid names among all other entities of its type.`,severity:ve.Error,code:we.NameNotUniqueInScope,entity:s});a.push(m.error)}if(u.forEach(m=>{const E=m(c);if(!!i.some(_=>m(_.name||"")===E)&&f){const _=Dt({id:`${s.id}--${we.NameAsResolvedCodeNameNotUniqueInScope}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" does not have a unique name once it is resolved as it will appear in code: "${E}". Entities of type ${s.type} must have valid names including their code name form.`,severity:ve.Error,code:we.NameAsResolvedCodeNameNotUniqueInScope,entity:s});a.push(_.error)}if(Yke.find(_=>_===E)){const _=Dt({id:`${s.id}--${we.NameIsForbiddenKeyword}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" has a name that is a forbidden keyword: "${E}". Entities of type ${s.type} must not use reserved keywords as names.`,severity:ve.Error,code:we.NameIsForbiddenKeyword,entity:s});a.push(_.error)}}),!/^[a-zA-Z_]/.test(c)){const m=Dt({id:`${s.id}--${we.NameMustStartWithLetterOrUnderscore}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" has a name that does not start with a letter or underscore.`,severity:ve.Error,code:we.NameMustStartWithLetterOrUnderscore,entity:s});a.push(m.error)}return a}async function Jke(s,u={}){var e,f;const i=J.YieldTracker.from(u),r=[];let a=[];if(s.entity&&a.push("entity"),s.andChildrenGroup&&a.push("andChildrenGroup"),s.orChildrenGroup&&a.push("orChildrenGroup"),s.foreignKeyRef&&a.push("foreignKeyRef"),s.foreignKeyAllowed&&a.push("foreignKeyAllowed"),a.length>1){const h=Dt({id:s.id+"--"+be.InvalidPropertiesCombination,message:`Data type with id "${s.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup', 'orChildrenGroup', 'foreignKeyRef' or 'foreignKeyAllowed'.
605
+ This '${s.type}' is blocked `;i.blocks.forEach((c,e)=>{const f=c.blockedByCaller,h=c.blockedByCalling;e===0?a+="by ":e===i.blocks.length-1&&(a+="and by "),a+=`its ancestor "${le(f,s.project)}" with id "${f.id}" that calls a '${h.type}' entity with id "${h.id}"`,e<i.blocks.length-1?a+=", ":a+="."}),u.push(new vi({id:`${s.id}--${we.UnreachableEntity}`,code:we.UnreachableEntity,severity:ve.Warning,message:`${r}${a}`,entity:s}))}}return Kt(s.errors,u)}function Wke(s){const u=[],i=Mt(s,s.project);if(i){if(i.type===d.Project)return u}else return u;if(s.type===d.Condition&&s.parent.type===d.Condition||s.type===d.InternalCall&&!s.calledBy.length)return u;const r=i.getDataType(null),a=Wa(r,{removeDuplicates:!0}),c=a.find(f=>{var h;return((h=f==null?void 0:f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id}),e=a.every(f=>{var h;return f.isResolved&&((h=f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id});return!r||!c?u:((s.type===d.Condition||s.catchesError)&&!s.errorCalls.length&&e&&u.push(new vi({id:`${s.id}--${be.ParentScopeRequiresReturnCurrentCatchesErrorWithNoCalls}`,code:be.ParentScopeRequiresReturnCurrentCatchesErrorWithNoCalls,severity:ve.Error,message:`This '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" catches its errors, which terminates the branch, but its parent ${i.type} "${le(i,s.project)}" with id "${i.id}" requires a returned value.`,entity:s})),Kt(s.errors,u))}function ga(s){const u=[...Wke(s)],i=Mt(s,s.project);if(i){if(i.type===d.Project)return u}else return u;if(s.type===d.Condition&&s.parent.type===d.Condition||s.type===d.InternalCall&&!s.calledBy.length)return u;const r=i.getDataType(null),a=Wa(r,{removeDuplicates:!0}),c=a.find(f=>{var h;return((h=f==null?void 0:f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id}),e=a.every(f=>{var h;return f.isResolved&&((h=f.entity)==null?void 0:h.id)!==ie["primitive-entity"].void.id});return!r||!c?u:(!s.successCalls.length&&e&&u.push(new vi({id:`${s.id}--${be.ParentScopeRequiresReturnCurrentHasNoSuccessCalls}`,code:be.ParentScopeRequiresReturnCurrentHasNoSuccessCalls,severity:ve.Error,message:`This '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" has no success calls, which terminates the branch, but its parent ${i.type} "${le(i,s.project)}" with id "${i.id}" requires a returned value.`,entity:s})),Kt(s.errors,u))}function wn(s){const u=[];if(s.type===d.InputMap&&Gt.includes(s.parent.type)&&s.parent.internalCalls.some(r=>!!r.calledBy.length))return u;const i=s.project.requestActiveDynamicValue(s,!0);if((i==null?void 0:i.type)===Ge.Missing){const r=Dt({id:`${s.id}--${be.MissingRequiredValue}`,message:`The '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" is missing its required value before it can be executed or published.`,severity:ve.Error,code:be.MissingRequiredValue,entity:s});u.push(r.error)}return u}function is(s){var i,r;const u=[];if(s.codeNativeValueValidation){const a=s.project.requestActiveDynamicValue(s,!0);if(a&&((i=a.value)!=null&&i.value)){const c=s.codeNativeValueValidation(s,(r=a.value)==null?void 0:r.value);u.push(...c.errors)}}return u}function vv(s){var u;return!!((u=wn(s))!=null&&u.find(i=>i.code===be.MissingRequiredValue))}function eb(s){const u=[];if(!s.internalCalls.length)return u;const i=s.internalCalls.some(r=>r.calledBy.length||r.successCalls.length||r.errorCalls.length||r.getUsedInputs().length||r.getUsedOutputs().length);if(s.readsValue&&i){const r=Dt({id:`${s.id}--${be.VariableReadsValueAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" reads a value. A variable with internal calls can't read a value.`,severity:ve.Error,code:be.VariableReadsValueAndInternalCall,entity:s});u.push(r.error)}if(s.writesValues.length&&i){const r=Dt({id:`${s.id}--${be.VariableWritesValuesAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" writes values. A variable with internal calls can't write a value.`,severity:ve.Error,code:be.VariableWritesValuesAndInternalCall,entity:s});u.push(r.error)}if(s.getUsedInputs().length&&i){const r=Dt({id:`${s.id}--${be.VariableHasInputsAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" has inputs. A variable with internal calls can't have inputs.`,severity:ve.Error,code:be.VariableHasInputsAndInternalCall,entity:s});u.push(r.error)}if(s.getUsedOutputs().length&&i){const r=Dt({id:`${s.id}--${be.VariableHasOutputsAndInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" has outputs. A variable with internal calls can't have outputs.`,severity:ve.Error,code:be.VariableHasOutputsAndInternalCall,entity:s});u.push(r.error)}if(s.calledBy.length&&i){const r=Dt({id:`${s.id}--${be.VariableIsCalledAndHasInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,severity:ve.Error,code:be.VariableIsCalledAndHasInternalCall,entity:s});u.push(r.error)}if([...s.successCalls,...s.errorCalls].length&&i){const r=Dt({id:`${s.id}--${be.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${le(s,s.project)}" with id "${s.id}" calls other entities. A variable with internal calls can't call other entities.`,severity:ve.Error,code:be.VariableCallsOthersAndHasInternalCall,entity:s});u.push(r.error)}return u}function $Vi(s){const u=s.variableDeclarations,i=s.events.flatMap(e=>[e,...ft(e)]),r=s.functions.flatMap(e=>s.instancesList.find(f=>f.type===d.FunctionCall&&f.declaration.id===e.id)?[e,...ft(e)]:[]),a=s.entities.flatMap(e=>[e,...s.entities.reduce((f,h)=>[...f,...h.methods.flatMap(m=>[m,...ft(m)])],[])]);return wE([...u,...i,...r,...a].flatMap(e=>e.getErrors()))}function zke(s){var a,c,e,f;if(s.type!==d.InternalCall){if(!Ft.includes(s.parent.type))return!1;const h=s.parent;if(!!h.returnStatements.length)return!0;const E=((a=h.implements)==null?void 0:a.getDataType(null))||null;return!(!E||((c=E.entity)==null?void 0:c.id)===ie["primitive-entity"].void.id)}if(!Ft.includes(s.parent.parent.type))return!1;const u=s.parent.parent;if(!!u.returnStatements.length)return!0;const r=((e=u.implements)==null?void 0:e.getDataType(null))||null;return!(!r||((f=r.entity)==null?void 0:f.id)===ie["primitive-entity"].void.id)}function tb(s){const u=[],i=s.getDataType(null)||null,r=Wa(i,{removeDuplicates:!0}),a=r.find(m=>{var E;return((E=m==null?void 0:m.entity)==null?void 0:E.id)!==ie["primitive-entity"].void.id}),c=r.every(m=>{var E;return m.isResolved&&((E=m.entity)==null?void 0:E.id)!==ie["primitive-entity"].void.id});if(!i||!a)return u;const e=s.returnStatements.length;if(ft(s).filter(m=>Rt.includes(m.type)?!1:m.type===d.Condition?m.parent.type===d.Condition?!1:!m.successCalls.length||!m.errorCalls.length:!!((!m.successCalls.length||!m.errorCalls.length&&m.catchesError)&&m.calledBy.length)).length&&(c||e)){const m=Dt({id:`${s.id}--${be.LackingReturnStatementOnSomeBranches}`,message:`The '${s.type}' entity "${le(s,s.project)}" with id "${s.id}" is missing the required return statement by its implementation on some branches.`,severity:ve.Error,code:be.LackingReturnStatementOnSomeBranches,entity:s});u.push(m.error)}return u}function Ia(s){const u=[];if(!rr.includes(s.type)||Rt.includes(s.type)||Ft.includes(s.type)||!zke(s))return u;if(!s.successCalls.length&&!s.errorCalls.length&&s.calledBy.length){const i=Dt({id:`${s.id}--${be.LastCalledEntityMustBeReturnEntity}`,message:`The '${s.type}' entity "${le(s,s.project)}" with id "${s.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:ve.Error,code:be.LastCalledEntityMustBeReturnEntity,entity:s});u.push(i.error)}return u}const Yke=["class","function","if","else","for","while","do","switch","case","default","break","continue","return","try","catch","finally","throw","import","export","as","from","in","instanceof","typeof","yield","await","async","this","new","delete","void","with","const","let","var","public","private","protected","static","get","set","constructor","extends","implements","interface","namespace","package","abstract","readonly","module"];function ib(s,u=[ir],i=[],r){const a=[],c=r??s.name;if(!c){const m=Dt({id:`${s.id}--${we.EmptyName}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" does not have a name. Entities of type ${s.type} must have valid names.`,severity:ve.Error,code:we.EmptyName,entity:s});return a.push(m.error),a}const e=c.trim(),f=!i.some(m=>m.name===c||m.name===e);if(!f){const m=Dt({id:`${s.id}--${we.NameNotUniqueInScope}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" does not have a unique name. Entities of type ${s.type} must have valid names among all other entities of its type.`,severity:ve.Error,code:we.NameNotUniqueInScope,entity:s});a.push(m.error)}if(u.forEach(m=>{const E=m(c);if(!!i.some(_=>m(_.name||"")===E)&&f){const _=Dt({id:`${s.id}--${we.NameAsResolvedCodeNameNotUniqueInScope}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" does not have a unique name once it is resolved as it will appear in code: "${E}". Entities of type ${s.type} must have valid names including their code name form.`,severity:ve.Error,code:we.NameAsResolvedCodeNameNotUniqueInScope,entity:s});a.push(_.error)}if(Yke.find(_=>_===E)){const _=Dt({id:`${s.id}--${we.NameIsForbiddenKeyword}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" has a name that is a forbidden keyword: "${E}". Entities of type ${s.type} must not use reserved keywords as names.`,severity:ve.Error,code:we.NameIsForbiddenKeyword,entity:s});a.push(_.error)}}),!/^[a-zA-Z_]/.test(c)){const m=Dt({id:`${s.id}--${we.NameMustStartWithLetterOrUnderscore}`,message:`${ys[s.type].singular} "${le(s,s.project)}" with id "${s.id}" has a name that does not start with a letter or underscore.`,severity:ve.Error,code:we.NameMustStartWithLetterOrUnderscore,entity:s});a.push(m.error)}return a}async function Jke(s,u={}){var e,f;const i=J.YieldTracker.from(u),r=[];let a=[];if(s.entity&&a.push("entity"),s.andChildrenGroup&&a.push("andChildrenGroup"),s.orChildrenGroup&&a.push("orChildrenGroup"),s.foreignKeyRef&&a.push("foreignKeyRef"),s.foreignKeyAllowed&&a.push("foreignKeyAllowed"),a.length>1){const h=Dt({id:s.id+"--"+be.InvalidPropertiesCombination,message:`Data type with id "${s.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup', 'orChildrenGroup', 'foreignKeyRef' or 'foreignKeyAllowed'.
606
606
 
607
607
  Currently present fields: "${At(a,'", "','" and "')}".`,severity:ve.Error,code:be.InvalidPropertiesCombination,entity:s});r.push(h.error)}if(((e=s.entity)==null?void 0:e.type)===d.PrimitiveEntity&&s.entity.id===ie["primitive-entity"].enum.id&&!((f=s.options)!=null&&f.length)){const h=Dt({id:s.id+"--"+be.MissingEnumOptions,message:`Data type with id "${s.id}" is an enum but has no options.`,severity:ve.Error,code:be.MissingEnumOptions,entity:s});r.push(h.error)}const c=Kt(s.errors,r);await i.tick();for(const h of s.andChildrenGroup||[])await h.validateAsync({tracker:i});for(const h of s.orChildrenGroup||[])await h.validateAsync({tracker:i});return c}function Qke(s){var r,a;const u=[];let i=[];if(s.entity&&i.push("entity"),s.andChildrenGroup&&i.push("andChildrenGroup"),s.orChildrenGroup&&i.push("orChildrenGroup"),s.foreignKeyRef&&i.push("foreignKeyRef"),s.foreignKeyAllowed&&i.push("foreignKeyAllowed"),i.length>1){const c=Dt({id:s.id+"--"+be.InvalidPropertiesCombination,message:`Data type with id "${s.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup', 'orChildrenGroup', 'foreignKeyRef' or 'foreignKeyAllowed'.
608
608
 
package/dist/index.js CHANGED
@@ -183249,7 +183249,7 @@ function BRi(s) {
183249
183249
  return u;
183250
183250
  } else
183251
183251
  return u;
183252
- if (s.type === d.Condition && s.parent.type === d.Condition)
183252
+ if (s.type === d.Condition && s.parent.type === d.Condition || s.type === d.InternalCall && !s.calledBy.length)
183253
183253
  return u;
183254
183254
  const r = i.getDataType(null), a = ps(r, {
183255
183255
  removeDuplicates: !0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyx-code/project-logic-tree",
3
- "version": "0.0.6994",
3
+ "version": "0.0.6995",
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",