@elyx-code/project-logic-tree 0.0.5998 → 0.0.5999
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
|
@@ -21668,7 +21668,7 @@ const pe = class pe {
|
|
|
21668
21668
|
// Meta
|
|
21669
21669
|
l(this, "initialized", !1);
|
|
21670
21670
|
l(this, "suggestion", !1);
|
|
21671
|
-
this.initialData = e, this.project = t, this.id = e.id, this.version = e.version, this.name = e.name, this.description = e.description, this.private = e.private, this.abstract = e.abstract, this.index = e.index, this.static = e.static, this.required = e.required || !1;
|
|
21671
|
+
this.initialData = e, this.project = t, this.id = e.id, this.version = e.version, this.name = e.name, this.description = e.description, this.private = e.private, this.abstract = e.abstract, this.index = e.index, this.static = e.static, this.required = e.required || !1, this.hidden = e.hidden || !1;
|
|
21672
21672
|
}
|
|
21673
21673
|
/*
|
|
21674
21674
|
Takes a bare-bones object generated by the AI,
|
package/dist/index.umd.cjs
CHANGED
|
@@ -17,7 +17,7 @@ Please provide a unique 'name' string.`,severity:f.Error,code:g.NameNotUniqueInS
|
|
|
17
17
|
Please provide a unique 'name' string.`,severity:f.Error,code:g.NameNotUniqueInScope,issue:null}))}}return t}function ld(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:g.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=Dd(a).filter(d=>d.name===n.name);o.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
|
|
18
18
|
Please provide a unique 'name' string.`,severity:f.Error,code:g.NameNotUniqueInScope,issue:null}))}}return t}function cd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:g.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=Ad(a).filter(d=>d.name===n.name);o.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all outputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
|
|
19
19
|
Please provide a unique 'name' string.`,severity:f.Error,code:g.NameNotUniqueInScope,issue:null}))}}return t}function q6(n,e){switch(n.type){case r.CustomEntity:return Ks(n,e);case r.FunctionDeclaration:return ad(n,e);case r.VariableDeclaration:return sd(n,e);case r.Property:return od(n,e);case r.ArgumentDeclaration:return ld(n,e);case r.ReturnDeclaration:return cd(n,e);default:return[]}}function Xt(n,e,t){const a=`${Xs(n)}-${e}-id`;return t.instances[a]?$.UUID.uuid():a}function dd(n,e){let t="",i=null;if(n.parent){const s=e.get(n.parent);s&&(i=s)}let a="";return i&&(a=`${Xs(A(i,e))}-`),t=`${a}${Xs(A(n,e))}-id`,e.instances[t]?$.UUID.uuid():t}function J6(n){var o;const e=T4(),t=n.toJSON();e.safeParse(t).success;const a=W6(n);(o=n.dataType)==null||o.validate();const s=[...a];if(n.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const d=j({id:`${n.id}--${S.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:S.PropertyImplementsNonAbstact,entity:n});s.push(d.error)}return s}function W6(n){const e=[];if(!n.implements)return e;const t=n.implements;if(!t.abstract){const a=j({id:`${n.id}--${S.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:S.PropertyImplementsNonAbstact,entity:n});e.push(a.error)}if(n.static&&!t.static){const a=j({id:`${n.id}--${S.NonStaticPropertyImplementsStatic}`,message:`Static property "${A(n,n.project)}" with id "${n.id}" implements a non-static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:S.NonStaticPropertyImplementsStatic,entity:n});e.push(a.error)}if(!n.static&&t.static){const a=j({id:`${n.id}--${S.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${A(n,n.project)}" with id "${n.id}" implements a static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:S.StaticPropertyImplementsNonStatic,entity:n});e.push(a.error)}if(!Ys(n.dataType,t.dataType)){const a=j({id:`${n.id}--${S.PropertyImplementsIncompatibleType}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a property "${A(t,n.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:f.Error,code:S.PropertyImplementsIncompatibleType,entity:n});e.push(a.error)}return X(n.errors,e)}function H6(n,e){const t=[];if(n.parent){const a=e.get(n.parent);if(!a)t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const s=Ir(a);if(s){const o=a!==s?`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${A(s,a.project)}) higher up in the tree.`:`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${n.id}--${y.InvalidBuiltInEntityReference}`,code:y.InvalidBuiltInEntityReference,severity:f.Error,message:o,issue:null}))}else if(![r.CustomEntity].includes(a.type))t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const d=Fn(a).filter(p=>!p.interactive);if(d.length){let p=d.length>1?`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(d.map(h=>A(h,h.project)),'", "','" and "')}").`:`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(d[0],d[0].project)}").`;p+=`
|
|
20
|
-
${Ln}`,t.push(new E({id:`${n.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:p,issue:null}))}else if(n.implements){const p=e.get(n.implements);if(n.id===n.implements)return t.push(new E({id:`${n.id}--${n.implements}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'implements'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;if(!p)t.push(new E({id:`${n.id}--${n.implements}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.implements}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const h=a.properties.find(T=>{var m;return((m=T.implements)==null?void 0:m.id)===n.implements});h?t.push(new E({id:`${n.id}--${g.PropertyOverwrite}`,code:g.PropertyOverwrite,severity:f.Error,message:`The property with id "${n.id}" is trying to implement the property with id "${n.implements}", but the parent entity already has a property with id '${h.id}' that implements the same base property.`,issue:null})):[r.Property].includes(p.type)?p.abstract||t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const i=Ge(n,{},e);return t.push(...i.errors),t}const he=class he{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"private");l(this,"abstract");l(this,"index");l(this,"static");l(this,"required");l(this,"type",r.Property);l(this,"hidden",!1);l(this,"dataType",null);l(this,"implements",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.implements){const p=D(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,hidden:!1,description:e.description,implements:s,dataType:null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=H6(i,t),o=od(i,t);return a.push(...s,...o,...De(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
20
|
+
${Ln}`,t.push(new E({id:`${n.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:p,issue:null}))}else if(n.implements){const p=e.get(n.implements);if(n.id===n.implements)return t.push(new E({id:`${n.id}--${n.implements}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'implements'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;if(!p)t.push(new E({id:`${n.id}--${n.implements}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.implements}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const h=a.properties.find(T=>{var m;return((m=T.implements)==null?void 0:m.id)===n.implements});h?t.push(new E({id:`${n.id}--${g.PropertyOverwrite}`,code:g.PropertyOverwrite,severity:f.Error,message:`The property with id "${n.id}" is trying to implement the property with id "${n.implements}", but the parent entity already has a property with id '${h.id}' that implements the same base property.`,issue:null})):[r.Property].includes(p.type)?p.abstract||t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const i=Ge(n,{},e);return t.push(...i.errors),t}const he=class he{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"private");l(this,"abstract");l(this,"index");l(this,"static");l(this,"required");l(this,"type",r.Property);l(this,"hidden",!1);l(this,"dataType",null);l(this,"implements",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1,this.hidden=e.hidden||!1}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.implements){const p=D(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,hidden:!1,description:e.description,implements:s,dataType:null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=H6(i,t),o=od(i,t);return a.push(...s,...o,...De(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
21
21
|
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),(e.readsValue||e.writesValue)&&t.push(new E({id:`${this.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
|
|
22
22
|
${ro}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addProperty(this),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType){const e=R(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.abstract=e.abstract||this.abstract,this.private=e.private||this.private,this.index=e.index||this.index,this.static=e.static||this.static,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return e||this.parent.type===r.CustomEntity&&(this.parent.removeProperty(this),i.push(this.parent)),{affected:O(i),removed:O(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return this.parent.type===r.CustomEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,abstract:this.abstract,hidden:this.hidden,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,implements:((t=this.implements)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,hidden:this.hidden,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,implements:((t=this.implements)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[],...((a=this.implements)==null?void 0:a.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,required:this.required,abstract:this.abstract,static:this.static,implements:((e=this.implements)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){return this.errors=J6(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,i=!0){var T;const a=t||Xt(A(this,this.project),r.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,d={hidden:!1,id:a,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:null,implements:null,parent:e||this.parent},p=fa(d,this.project);i&&p.subscribe();const h=((T=this.dataType)==null?void 0:T.clone(p,o+"-data-type-id",i))||null;if(h&&p.setDataType(h),this.implements){const m=this.implements.clone(e||this.parent.type===r.CustomEntity?e:null,o+"-implements-id",i);p.implements=m}return p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(he,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),l(he,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),l(he,"MUTABLE_META_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,"index"]),l(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),l(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),l(he,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(he,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),l(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let lr=he;function Y6(n){const e=Nx(),t=n.toJSON();e.safeParse(t).success;const a=z6(n),s=Z6(n),o=vt(n);n.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const d=[...a,...s];if(n.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=j({id:`${n.id}--${S.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:S.PropertyImplementsNonAbstact,entity:n});d.push(p.error)}return X(n.errors,d)}function z6(n){const e=[];if(!n.calls.length){const t=j({id:`${n.id}--${S.ScopeWithoutLogic}`,message:`Action "${A(n,n.project)}" with id "${n.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:f.Error,code:S.ScopeWithoutLogic,entity:n});e.push(t.error)}return X(n.errors,e)}function Z6(n){const e=[];return n.implements,X(n.errors,e)}const K=class K{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"private");l(this,"index",null);l(this,"type",r.FunctionDeclaration);l(this,"implements",null);l(this,"inputs",[]);l(this,"returnStatements",[]);l(this,"calls",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.collapsed=e.collapsed,this.x=e.x,this.y=e.y,this.index=e.index}static fromGenerationTarget(e,t){let i=t;if(e.parent){const d=D(e.parent);i=t.get(d)}let a=null;if(e.implements){const d=D(e.implements);a=t.get(d)}const s={id:e.id,version:1,name:e.name,type:r.FunctionDeclaration,index:i.type===r.CustomEntity?i.methods.length:null,description:e.description,collapsed:!1,private:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:i},o=R(s,t);return o.setParent(i),o.initChildren(),o}static validateGenerationTarget(e,t){var T;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.Project,r.InstalledProject,r.CustomEntity,r.Loop],optional:!0},implements:{list:!1,types:[r.ActionDescriptor],optional:!0}},t);i=s.modifiedData;const o=ad(i,t),d=i.parent?t.get(i.parent):null;if(d&&d.type===r.CustomEntity){const m=d,I=Fn(m).filter(B=>!B.interactive);if(I.length){let B=I.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(I.map(G=>A(G,G.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(I[0],I[0].project)}").`;B+=`
|
|
23
23
|
${Ln}`,a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:B,issue:null}))}else{const B=m.methods.find(jt=>{var Le;return((Le=jt.implements)==null?void 0:Le.id)===i.implements});B&&a.push(new E({id:`${i.id}--${g.MethodOverwrite}`,code:g.MethodOverwrite,severity:f.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${r.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity already has a ${r.FunctionDeclaration} with id '${B.id}' that implements the same base method.
|
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.5999",
|
|
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",
|