@elyx-code/project-logic-tree 0.0.6917 → 0.0.6918
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 +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4324 -4324
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Please provide a unique 'name' string.`,severity:Te.Error,code:Ce.NameNotUniqueI
|
|
|
3
3
|
Please provide a unique 'name' string.`,severity:Te.Error,code:Ce.NameNotUniqueInScope}))}return i}function Px(s,p){const i=[];s.name||i.push(new De({id:`${s.id}--${Ce.EmptyName}`,message:`Entity with id "${s.id}" and type "${s.type}" has an empty name. Please provide a 'name' string.`,severity:Te.Error,code:Ce.EmptyName}));const r=s.parent&&Ia(s.parent,p)||p;if(!r)i.push(new De({id:`${s.id}--parent-reference--${he.ReferencedEntityNotFound}`,message:`The entity with id '${s.parent}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:Te.Error,code:he.ReferencedEntityNotFound}));else{const c=Cx(r).filter(e=>e.name===s.name);c.length&&i.push(new De({id:`${s.id}--${Ce.NameNotUniqueInScope}`,message:`Entity with id "${s.id}" and type "${s.type}" has a name "${s.name}" that is not unique in its scope or higher scopes. Entity with id "${c[0].id}" has the same name.
|
|
4
4
|
Please provide a unique 'name' string.`,severity:Te.Error,code:Ce.NameNotUniqueInScope}))}return i}function Nx(s,p){const i=[];s.name||i.push(new De({id:`${s.id}--${Ce.EmptyName}`,message:`Entity with id "${s.id}" and type "${s.type}" has an empty name. Please provide a 'name' string.`,severity:Te.Error,code:Ce.EmptyName}));const r=te(s.parent);if(!r)i.push(new De({id:`${s.id}--parent-reference--${he.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${s.id}" and type "${s.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:Te.Error,code:he.InvalidReferenceObjectStructure}));else{const a=p.get(r);if(!a)i.push(new De({id:`${s.id}--parent-reference--${he.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:Te.Error,code:he.ReferencedEntityNotFound}));else{const e=a.properties.filter(f=>f.name===s.name);e.length&&i.push(new De({id:`${s.id}--${Ce.NameNotUniqueInScope}`,message:`Entity with id "${s.id}" and type "${s.type}" has a name "${s.name}" that is not unique among all properties in the parent entity. Entity with id "${e[0].id}" has the same name.
|
|
5
5
|
Please provide a unique 'name' string.`,severity:Te.Error,code:Ce.NameNotUniqueInScope}))}}return i}function xx(s,p){const i=[];s.name||i.push(new De({id:`${s.id}--${Ce.EmptyName}`,message:`Entity with id "${s.id}" and type "${s.type}" has an empty name. Please provide a 'name' string.`,severity:Te.Error,code:Ce.EmptyName}));const r=te(s.parent);if(!r)i.push(new De({id:`${s.id}--parent-reference--${he.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${s.id}" and type "${s.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:Te.Error,code:he.InvalidReferenceObjectStructure}));else{const a=p.get(r);if(!a)i.push(new De({id:`${s.id}--parent-reference--${he.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:Te.Error,code:he.ReferencedEntityNotFound}));else{const e=OL(a).filter(f=>f.name===s.name);e.length&&i.push(new De({id:`${s.id}--${Ce.NameNotUniqueInScope}`,message:`Entity with id "${s.id}" and type "${s.type}" has a name "${s.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${e[0].id}" has the same name.
|
|
6
|
-
Please provide a unique 'name' string.`,severity:Te.Error,code:Ce.NameNotUniqueInScope}))}}return i}function qAi(s,p){switch(s.type){case d.DefinitionEntity:return _x(s,p);case d.FunctionDeclaration:return Vx(s,p);case d.VariableDeclaration:return Px(s,p);case d.Property:return Nx(s,p);case d.ArgumentDeclaration:return xx(s,p);default:return[]}}function Tp(s,p){var r;const i=s;switch(s.type){case d.FunctionCall:case d.InternalCall:return Ia(s.declaration,p).codeName;case d.ActionDescriptor:case d.DefinitionEntity:case d.VariableDeclaration:case d.ValueDescriptor:case d.FunctionDeclaration:return s.codeName||null;case d.Property:case d.ArgumentDeclaration:{if(s.codeName)return s.codeName;if((r=s.implements)!=null&&r.length){const a=s.implements.find(c=>{const e=Ia(c,p);return!!(e!=null&&e.codeName)});if(a)return Ia(a,p).codeName||null}break}case d.InputMap:case d.OutputMap:case d.VariableInstance:{if(s.declaration){const a=Ia(s.declaration,p);return Tp(a,p)||""}break}}return i.codeName||null}function Rh(s,p){let i=s;if(!!p.some(a=>a.name===i)){const a=s.split(" "),c=a.pop()||"",e=parseInt(c);return!isNaN(e)?a.push(`${e+1}`):(a.push(c),a.push("1")),i=a.join(" "),Rh(i,p)}return i}function __e(s,p,i){const a=`${_g(s)}-${p}-id`;return i.instances[a]?x.UUID.uuid():a}function __(s,p){let i="",r=null;if(s.parent){const c=p.get(s.parent);c&&(r=c)}let a="";return r&&(a=`${_g(oe(r,p))}-`),i=`${a}${_g(oe(s,p))}-id`,p.instances[i]?x.UUID.uuid():i}function on(s,p,i="uuid"){return i==="semantic"?__e(oe(s,p),s.type,p):x.UUID.uuid()}const SAi=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function $x(s){return typeof s=="string"&&SAi.test(s)}const ZAi=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function V_(s){return typeof s=="string"&&ZAi.test(s)}function HAi(s){return s instanceof Error&&s.name==="ZodError"&&"issues"in s&&Array.isArray(s.issues)}var WAi=class extends Error{constructor(p,i){super(p,i);R(this,"name");R(this,"details");this.name="ZodValidationError",this.details=zAi(i)}toString(){return this.message}};function zAi(s){if(s){const p=s.cause;if(HAi(p))return p.issues}return[]}function YAi(s){return s.length!==0}function Fj(s){return s.description??""}var JAi=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function QAi(s){if(s.length===1){let p=s[0];return typeof p=="symbol"&&(p=Fj(p)),p.toString()||'""'}return s.reduce((p,i)=>{if(typeof i=="number")return p+"["+i.toString()+"]";if(typeof i=="symbol"&&(i=Fj(i)),i.includes('"'))return p+'["'+XAi(i)+'"]';if(!JAi.test(i))return p+'["'+i+'"]';const r=p.length===0?"":".";return p+r+i},"")}function XAi(s){return s.replace(/"/g,'\\"')}var egi="; ",tgi=99,V_e="Validation error",igi=": ",rgi=", or ";function ngi(s={}){const{issueSeparator:p=egi,unionSeparator:i=rgi,prefixSeparator:r=igi,prefix:a=V_e,includePath:c=!0,maxIssuesInMessage:e=tgi}=s;return f=>{const h=f.slice(0,e).map(m=>lg({issue:m,issueSeparator:p,unionSeparator:i,includePath:c})).join(p);return agi(h,a,r)}}function lg(s){const{issue:p,issueSeparator:i,unionSeparator:r,includePath:a}=s;if(p.code===ot.invalid_union)return p.unionErrors.reduce((c,e)=>{const f=e.issues.map(h=>lg({issue:h,issueSeparator:i,unionSeparator:r,includePath:a})).join(i);return c.includes(f)||c.push(f),c},[]).join(r);if(p.code===ot.invalid_arguments)return[p.message,...p.argumentsError.issues.map(c=>lg({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(p.code===ot.invalid_return_type)return[p.message,...p.returnTypeError.issues.map(c=>lg({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(a&&YAi(p.path)){if(p.path.length===1){const c=p.path[0];if(typeof c=="number")return`${p.message} at index ${c}`}return`${p.message} at "${QAi(p.path)}"`}return p.message}function agi(s,p,i){return p!==null?s.length>0?[p,s].join(i):p:s.length>0?s:V_e}function sgi(s,p={}){const r=lgi(p)([s]);return new WAi(r,{cause:new cd([s])})}function lgi(s){return"messageBuilder"in s?s.messageBuilder:ngi(s)}async function P_e(s,p={}){var c;const i=Y.YieldTracker.from(p),r=[...In(s),...Ja(s)];await i.tick();const a=Zt(s.errors,r);return await((c=s.dataType)==null?void 0:c.validateAsync({tracker:i})),a}function N_e(s){var i;(i=s.dataType)==null||i.validate();const p=[...In(s),...Ja(s)];return Zt(s.errors,p)}const ogi=Object.freeze(Object.defineProperty({__proto__:null,validate:N_e,validateAsync:P_e},Symbol.toStringTag,{value:"Module"}));function x_e(s){return s.listAdded.forEach(p=>{const i=s.project.get(p.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(oi.EXPLICIT_DEFINITION_ENTITY_ADDED,i,s),li(i,Ae.PERSISTED_ENTITY)?s.project.emit(oi.PERSISTED_DEFINITION_ENTITY_ADDED,i,s):li(i,Ae.RELATIONAL_DATABASE)&&s.project.emit(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,i,s))}),s.listUpdated.forEach(p=>{const i=s.project.get(p.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(oi.EXPLICIT_DEFINITION_ENTITY_UPDATED,i,s),li(i,Ae.PERSISTED_ENTITY)?s.project.emit(oi.PERSISTED_DEFINITION_ENTITY_UPDATED,i,s):li(i,Ae.RELATIONAL_DATABASE)&&s.project.emit(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,i,s))}),s.listRemoved.forEach(p=>{const i=s.project.get(p.id)||s.project.getDeleted(p.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(oi.EXPLICIT_DEFINITION_ENTITY_REMOVED,i,s),li(i,Ae.PERSISTED_ENTITY)?s.project.emit(oi.PERSISTED_DEFINITION_ENTITY_REMOVED,i,s):li(i,Ae.RELATIONAL_DATABASE)&&s.project.emit(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,i,s))}),s}async function $_e(s,p={}){const i=Y.YieldTracker.from(p),r=[];for(const a of s.listAdded){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(oi.EXPLICIT_DEFINITION_ENTITY_ADDED,c,s)),li(c,Ae.PERSISTED_ENTITY)?r.push(s.project.emitAsync(oi.PERSISTED_DEFINITION_ENTITY_ADDED,c,s)):li(c,Ae.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,c,s))),await i.tick()}for(const a of s.listUpdated){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(oi.EXPLICIT_DEFINITION_ENTITY_UPDATED,c,s)),li(c,Ae.PERSISTED_ENTITY)?r.push(s.project.emitAsync(oi.PERSISTED_DEFINITION_ENTITY_UPDATED,c,s)):li(c,Ae.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,c,s))),await i.tick()}for(const a of s.listRemoved){const c=s.project.get(a.id)||s.project.getDeleted(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(oi.EXPLICIT_DEFINITION_ENTITY_REMOVED,c,s)),li(c,Ae.PERSISTED_ENTITY)?r.push(s.project.emitAsync(oi.PERSISTED_DEFINITION_ENTITY_REMOVED,c,s)):li(c,Ae.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,c,s))),await i.tick()}return await Promise.all(r),s}var p1=(s=>(s.Manual="manual",s.Automatic="automatic",s))(p1||{}),W=(s=>(s.Added="added",s.Updated="updated",s.Removed="removed",s.Affected="affected",s))(W||{}),w=(s=>(s.AddSuccessCall="add-success-call",s.AddErrorCall="add-error-call",s.AddCall="add-call",s.SetParent="set-parent",s.SetStandaloneParent="set-standalone-parent",s.AfterAllChildrenInitialized="after-all-children-initialized",s.UpdateWithShallowTransfer="update-with-shallow-transfer",s.UpdateWithGenerationTarget="update-with-generation-target",s.RemoveFromParent="remove-from-parent",s.RemoveEntity="remove-entity",s.RestoreEntity="restore-entity",s.CloneEntity="clone-entity",s.AddInput="add-input",s.RemoveInput="remove-input",s.SetDataType="set-data-type",s.RemoveDataType="remove-data-type",s.SetAdditionalPropertiesDataType="set-additional-properties-data-type",s.RemoveAdditionalPropertiesDataType="remove-additional-properties-data-type",s.SetAllPropertiesImplement="set-all-properties-implement",s.RemoveAllPropertiesImplement="remove-all-properties-implement",s.RemoveValueReader="remove-value-reader",s.AddValueReader="add-value-reader",s.RemoveValueWriter="remove-value-writer",s.SetValueWriter="set-value-writer",s.AddEntryCaller="add-entry-caller",s.AddSuccessCaller="add-success-caller",s.AddErrorCaller="add-error-caller",s.RemoveCall="remove-call",s.RemoveCaller="remove-caller",s.RemoveChildGroup="remove-child-group",s.AddToAndGroup="add-to-and-group",s.AddToOrGroup="add-to-or-group",s.RemoveUnrecognizedInputs="remove-unrecognized-inputs",s.RemoveUnrecognizedOutputs="remove-unrecognized-outputs",s.SyncInputs="sync-inputs",s.SyncOutputs="sync-outputs",s.SetImplements="set-implements",s.SetExtends="set-extends",s.SetExtension="set-extension",s.AddImplementation="add-implementation",s.RemoveImplementation="remove-implementation",s.AddProperty="add-property",s.RemoveProperty="remove-property",s.AddMethod="add-method",s.RemoveMethod="remove-method",s.AddAbstractMethod="add-abstract-method",s.RemoveAbstractMethod="remove-abstract-method",s.SetValueAsTypeSingle="set-value-as-type-single",s.SetValueAsTypeList="set-value-as-type-list",s.SetValueAsType="set-value-as-type",s.RemoveErrorCatching="remove-error-catching",s.RemoveAllErrorCallers="remove-all-error-callers",s.RemoveAllSuccessCallers="remove-all-success-callers",s.RemoveAllCallers="remove-all-callers",s.RemoveAllErrorCalls="remove-all-error-calls",s.SetDataTypeEntityValue="set-data-type-entity-value",s.MergeDataTypes="merge-data-types",s.SetDataTypeForeignKeyRef="set-data-type-foreign-key-ref",s.SetErrorEntity="set-error-entity",s.AddValueAsTypeToList="add-value-as-type-to-list",s.RemoveValueAsTypeFromList="remove-value-as-type-from-list",s.CreateFromGenerationTarget="create-from-generation-target",s.ConnectExternalAccount="connect-external-account",s.ChangeExternalAccountConnectionUsed="change-external-account-connection-used",s.MoveInlineDefToCanvas="move-inline-def-to-canvas",s.CreateDefFromValue="create-def-from-value",s.PrettifyCanvas="prettify-canvas",s.SetPrimitiveDefaultValue="set-primitive-default-value",s.MakeArgRequired="make-argument-required",s.MakeArgNonRequired="make-argument-non-required",s.RecalculateArg="recalculate-arg",s.RenameArg="rename-argument",s.ChangeArgDescription="changed-argument-description",s.RemoveArgBaseImplementation="remove-argument-base-implementation",s.AddArgBaseImplementation="add-argument-base-implementation",s.ChangeArgDataType="change-argument-data-type",s.RecalculateCondition="recalculate-condition",s.ChangeTypeOfCondition="change-type-of-condition",s.RenameDefinition="rename-definition",s.RecalculateDef="recalculate-definition",s.ChangeDefDescription="changed-definition-description",s.RemoveDefBaseImplementation="remove-definition-base-implementation",s.AddDefBaseImplementation="add-definition-base-implementation",s.RemoveDefExtension="remove-definition-extension",s.SetDefExtends="set-definition-extension",s.MakeDefStatic="make-def-static",s.MakeDefNonStatic="make-def-non-static",s.MakeDefAbstract="make-def-abstract",s.MakeDefNonAbstract="make-def-non-abstract",s.RecalculateFuncCall="recalculate-function-call",s.ChangeFuncCallDeclaration="change-function-call-declaration",s.RenameFuncDecl="rename-function-declaration",s.ChangeFuncDeclDescription="changed-function-declaration-description",s.RecalculateFuncDecl="recalculate-function-declaration",s.SetFuncDeclBaseImplementation="set-function-declaration-base-implementation",s.ChangeFuncDeclOutputDataType="change-function-declaration-output-data-type",s.RecalculateGlobalEvent="recalculate-global-event",s.ChangeGlobalEventDescription="changed-global-event-description",s.ChangeGlobalEventType="changed-global-event-type",s.RecalculateInputMap="recalculate-input",s.ChangeInputMapDescription="changed-input-description",s.ChangeInputMapDataType="change-input-data-type",s.RecalculateLoop="recalculate-loop",s.ChangeLoopType="changed-loop-type",s.RecalculateOperation="recalculate-operation",s.ChangeOperationType="changed-operation-type",s.RecalculateOutputMap="recalculate-output",s.ChangeOutputMapDataType="change-output-data-type",s.RecalculateProperty="recalculate-property",s.MakePropertyRequired="make-property-required",s.MakePropertyNonRequired="make-property-non-required",s.MakePropertyConstant="make-property-constant",s.MakePropertyNonConstant="make-property-non-constant",s.MakePropertyUnique="make-property-unique",s.MakePropertyNonUnique="make-property-non-unique",s.MakePropertyStatic="make-property-static",s.MakePropertyNonStatic="make-property-non-static",s.MakePropertyAbstract="make-property-abstract",s.MakePropertyNonAbstract="make-property-non-abstract",s.RenameProperty="rename-property",s.ChangePropertyDescription="changed-property-description",s.RemovePropertyBaseImplementation="remove-property-base-implementation",s.AddPropertyBaseImplementation="add-property-base-implementation",s.ChangePropertyDataType="change-property-data-type",s.RecalculateSearch="recalculate-search",s.RenameSearch="rename-search",s.ChangeSearchDescription="changed-search-description",s.ChangeSearchQuery="changed-search-query",s.MakeValueDescriptorRequired="make-value-descriptor-required",s.MakeValueDescriptorNonRequired="make-value-descriptor-non-required",s.RenameValueDescriptor="rename-value-descriptor",s.ChangeValueDescriptorDescription="changed-value-descriptor-description",s.ChangeValueDescriptorDataType="change-value-descriptor-data-type",s.RecalculateVarDecl="recalculate-variable-declaration",s.MakeVarDeclConstant="make-variable-declaration-constant",s.MakeVarDeclNonConstant="make-variable-declaration-non-constant",s.RenameVarDecl="rename-variable-declaration",s.ChangeVarDeclDescription="changed-variable-declaration-description",s.ChangeVarDeclDataType="change-variable-declaration-data-type",s.RecalculateVarInst="recalculate-variable-instance",s.ChangeVarInstDeclaration="change-variable-instance-declaration",s.HideFuncDeclBody="hide-function-declaration-body",s.ShowFuncDeclBody="show-function-declaration-body",s.HideGlobalEventBody="hide-global-event-body",s.ShowGlobalEventBody="show-global-event-body",s.HideLoopBody="hide-loop-body",s.ShowLoopBody="show-loop-body",s.HideTriggerBody="hide-trigger-body",s.ShowTriggerBody="show-trigger-body",s.AddNestedAndCondition="add-nested-and-condition",s.AddInputToCondition="add-input-to-condition",s.RecalculateNode="recalculate-node",s.AddInputToFuncDecl="add-input-to-function-declaration",s.ChangeInternalCallToThrowErrors="change-internal-call-to-throw-errors",s.ChangeInternalCallToCatchErrors="change-internal-call-to-catch-errors",s.AddErrorOutputToInternalCall="add-error-output-to-internal-call",s.ChangeLoopToThrowErrors="change-loop-to-throw-errors",s.ChangeLoopToCatchErrors="change-loop-to-catch-errors",s.RecalculateLoopBody="recalculate-loop-body",s.RecalculateMethod="recalculate-method",s.AddArgToLoopBody="add-arg-to-loop-body",s.AddArgToMethod="add-arg-to-method",s.RecalculateNestedCondition="recalculate-nested-condition",s.ChangeNodeToThrowErrors="change-node-to-throw-errors",s.ChangeNodeToCatchErrors="change-node-to-catch-errors",s.ChangeOperationToThrowErrors="change-operation-to-throw-errors",s.ChangeOperationToCatchErrors="change-operation-to-catch-errors",s.ChangeFuncCallToThrowErrors="change-function-call-to-throw-errors",s.ChangeFuncCallToCatchErrors="change-function-call-to-catch-errors",s.ChangeSearchToThrowErrors="change-search-to-throw-errors",s.ChangeSearchToCatchErrors="change-search-to-catch-errors",s.ChangeVarDeclToThrowErrors="change-variable-declaration-to-throw-errors",s.ChangeVarDeclToCatchErrors="change-variable-declaration-to-catch-errors",s.ChangeVarInstToThrowErrors="change-variable-instance-to-throw-errors",s.ChangeVarInstToCatchErrors="change-variable-instance-to-catch-errors",s.AddErrorOutputToNode="add-error-output-to-node",s.AddErrorOutputToOperation="add-error-output-to-operation",s.AddErrorOutputToFuncCall="add-error-output-to-function-call",s.AddErrorOutputToSearch="add-error-output-to-search",s.AddErrorOutputToVarDecl="add-error-output-to-variable-declaration",s.AddErrorOutputToVarInst="add-error-output-to-variable-instance",s.AddInputToNode="add-input-to-node",s.AddInputToOperation="add-input-to-operation",s.AddInputToFuncCall="add-input-to-function-call",s.AddInputToSearch="add-input-to-search",s.AddPropertyToVarDecl="add-property-to-variable-declaration",s.AddPropertyToVarInst="add-property-to-variable-instance",s.AddMethodToDef="add-method-to-definition",s.ReSyncRowTransformer="re-sync-row-transformer",s.ManuallyAddRowTransformer="manually-add-row-transformer",s.AddPropertyToDef="add-property-to-definition",s.RestablishExternalAccountConnection="restablish-external-account-connection",s.AddThrownError="add-thrown-error",s.RecalculateTerminationStatement="recalculate-termination-statement",s.RecalculateReturnStmt="recalculate-return-statement",s.RecalculateContinueStmt="recalculate-continue-statement",s.RecalculateBreakStmt="recalculate-break-statement",s.AddPropertyToTerminationStatement="add-property-to-termination-statement",s.AddPropertyToReturnStmt="add-property-to-return-statement",s.AddPropertyToContinueStmt="add-property-to-continue-statement",s.AddPropertyToBreakStmt="add-property-to-break-statement",s.SetLiteralValueToExplicitlyEmpty="set-literal-value-to-explicitly-empty",s.ModifyLiteralValue="modify-literal-value",s.RemoveLiteralValue="remove-literal-value",s.ModifyLiteralValueAsType="modify-literal-value-as-type",s.UpdateProjectMetadata="update-project-metadata",s.RenameProject="rename-project",s.ChangeProjectDescription="change-project-description",s.RestoreNode="restore-node",s.RestoreDef="restore-definition",s.RestoreFuncDecl="restore-function-declaration",s.RestoreGlobalEvent="restore-global-event",s.RestoreSearch="restore-search",s.RestoreVarDecl="restore-variable-declaration",s.RestoreVarInst="restore-variable-instance",s.RestoreFuncCall="restore-function-call",s.RestoreOperation="restore-operation",s.RestoreCondition="restore-condition",s.RestoreReturnStmt="restore-return-statement",s.RestoreContinueStmt="restore-continue-statement",s.RestoreBreakStmt="restore-break-statement",s.RestoreInstalledProject="restore-installed-project",s.RestoreLoop="restore-loop",s.CreateNewDef="create-new-definition",s.CreateNewFuncDecl="create-new-function-declaration",s.CreateNewGlobalEvent="create-new-global-event",s.CreateNewSearch="create-new-search",s.CreateNewVarDecl="create-new-variable-declaration",s.CreateNewVarInst="create-new-variable-instance",s.CreateNewFuncCall="create-new-function-call",s.CreateNewOperation="create-new-operation",s.CreateNewCondition="create-new-condition",s.CreateNewReturnStmt="create-new-return-statement",s.CreateNewContinueStmt="create-new-continue-statement",s.CreateNewBreakStmt="create-new-break-statement",s.CreateNewInternalCall="create-new-internal-call",s.CreateNewLoop="create-new-loop",s.ImplementBuiltInFunctionalityAsDef="implement-built-in-functionality-as-definition",s.ImplementAbstractEntityAsDef="implement-abstract-entity-as-definition",s.ImplementNewHTTPEndpoint="implement-new-http-endpoint",s.ImplementNewScheduledTrigger="implement-new-scheduled-trigger",s.ImplementNewPersistedEntity="implement-new-persisted-entity",s.AddedNewRowTransformer="added-new-row-transformer",s.AddedSQLConnectionConfig="added-sql-connection-config",s.AddedNewSSLConnectionConfig="added-new-ssl-connection-config",s.AddedGoogleConnection="added-google-connection",s.AddedSlackConnection="added-slack-connection",s.AddedNewExternalAccountConnection="added-new-external-account-connection",s.AddedGoogleDriveConnection="added-google-drive-connection",s.AddedGoogleSheetsConnection="added-google-sheets-connection",s.AddedGoogleSlidesConnection="added-google-slides-connection",s.AddedGoogleMailConnection="added-gmail-connection",s.ManuallyCreateIndividualNode="manually-create-individual-node",s.UpdateNode="update-node",s.CreateNewProjectPublicationCompletedEvent="create-new-project-publication-completed-event",s.CreateNewCountedLoop="create-new-counted-loop",s.CreateNewListLoop="create-new-list-loop",s.CreateNewManualFlowLoop="create-new-manual-flow-loop",s.CreateNewObjectKeysLoop="create-new-object-keys-loop",s.CreateNewObjectValuesLoop="create-new-object-values-loop",s.CreateNewStringLoop="create-new-string-loop",s.CreateNewIsFalseCondition="create-new-is-false-condition",s.CreateNewIsTrueCondition="create-new-is-true-condition",s.CreateNewAndCondition="create-new-and-condition",s.CreateNewOrCondition="create-new-or-condition",s.DisconnectNodes="disconnect-nodes",s.DisconnectExecutions="disconnect-executions",s.DisconnectValues="disconnect-values",s.ConnectNodes="connect-nodes",s.ConnectExecution="connect-execution",s.ConnectValues="connect-values",s.ConnectValueToNewInput="connect-value-to-new-input",s.ConnectValueToNewOperationInput="connect-value-to-new-operation-input",s.ConnectValueToNewConditionInput="connect-value-to-new-condition-input",s.ConnectValueToNewSearchInput="connect-value-to-new-search-input",s.ConnectValueToNewVarDeclProperty="connect-value-to-new-variable-declaration-property",s.ConnectValueToNewVarInstProperty="connect-value-to-new-variable-instance-property",s.ConnectValueToNewReturnStmtProperty="connect-value-to-new-return-statement-property",s.ConnectValueToNewContinueStmtProperty="connect-value-to-new-continue-statement-property",s.ConnectValueToNewBreakStmtProperty="connect-value-to-new-break-statement-property",s.ConnectNewFuncDeclArgToValue="connect-new-function-argument-to-value",s.RemoveNodes="remove-nodes",s.RemoveNode="remove-node",s.InitialLoadAutomaticCanvasRefresh="initial-load-automatic-canvas-refresh",s.MoveNodes="move-nodes",s.MoveNode="move-node",s.CloneNodes="clone-nodes",s.CloneNode="clone-node",s.GenerateSQLMigrationOnPersistedEntityUpdate="generate-sql-migration-on-persisted-entity-update",s))(w||{}),Be=(s=>(s.ActionOwnerEntityNotEditable="action-owner-entity-not-editable",s.ActionCounterpartEntityNotEditable="action-counterpart-entity-not-editable",s.ActionOwnerEntityNonDeletable="action-owner-entity-non-deletable",s.GlobalVariableDeclarationCannnotCatchError="global-variable-declaration-cannot-catch-error",s.GlobalVariableDeclarationCannotReadValue="global-variable-declaration-cannot-read-value",s.GlobalVariableDeclarationCannotBeCalled="global-variable-declaration-cannot-be-called",s.GlobalVariableDeclarationCannotCallFromError="global-variable-declaration-cannot-call-from-error",s.ValueReadingOverridesConstantProperty="value-reading-overrides-constant-property",s.DefaultValueOverridesConstantProperty="default-value-overrides-constant-property",s.ValueReadingOverridesConstantVariable="value-reading-overrides-constant-variable",s.DefaultValueOverridesConstantVariable="default-value-overrides-constant-variable",s.CannotSuccessCallItself="cannot-success-call-itself",s.CannotErrorCallItself="cannot-error-call-itself",s.CannotEntryCallItself="cannot-entry-call-itself",s.CannotValueWriteItself="cannot-value-write-itself",s.CannotBeCalledBeforeDeclaration="cannot-be-called-before-declaration",s.CannotBeCalledInParallelBranchToDeclaration="cannot-be-called-in-parallel-branch-to-declaration",s.CannotBeHigherScopeThanDeclaration="cannot-be-higher-scope-than-declaration",s.InputsInGlobalVariableDeclarationsCannotReadValues="inputs-in-global-variable-declarations-cannot-read-values",s))(Be||{});class L_e{constructor({id:p,action:i,errorReason:r,owner:a,counterpart:c,rootAction:e},f){R(this,"id");R(this,"action");R(this,"errorReason");R(this,"owner",null);R(this,"counterpart",null);R(this,"rootAction",!1);R(this,"parent");this.id=p,this.action=i,this.errorReason=r||null,this.owner=a||null,this.counterpart=c||null,this.rootAction=e||!1,this.parent=f}}class S extends Y.Events{constructor(i,r,a,c,e=!1,f=""){super(f?f+"-cs-events":"anonymous-cs-events");R(this,"id",x.UUID.uuid());R(this,"seenEntities",[]);R(this,"added",{});R(this,"updated",{});R(this,"removed",{});R(this,"affected",{});R(this,"self",null);R(this,"author");R(this,"timestamp");R(this,"open",!0);R(this,"startedClose",!1);R(this,"dirty",!0);R(this,"submitting",!1);R(this,"lockedVersions",!1);R(this,"type","manual");R(this,"autoclose",!1);R(this,"actionName","");R(this,"project");R(this,"events",new Map);R(this,"ignoreNonEditable",!1);R(this,"ignoreNonDeletable",!1);R(this,"logger");if(this.project=i,this.author=r||x.sessionAuthor||"",this.timestamp=a,this.self=c,this.autoclose=e,this.actionName=f,this.logger=Y.Logger.module("cs:"+(this.actionName?this.actionName+":":"")+this.id),this.autoclose&&!this.actionName)throw new Error("Auto-close change-set must have an auto-close action name.")}get index(){const i=this.project.history.indexOf(this);return i===-1?null:i}get isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.updated).length===0&&Object.keys(this.removed).length===0}get isValid(){var i;return!(this.isEmpty&&this.self&&!this.affected[(i=this.self)==null?void 0:i.id])}get list(){return[...Object.values(this.added),...Object.values(this.updated),...Object.values(this.removed)]}get listAdded(){return Object.values(this.added)}get listUpdated(){return Object.values(this.updated)}get listRemoved(){return Object.values(this.removed)}get listAffected(){return Object.values(this.affected)}get addedIds(){return Object.keys(this.added)}get updatedIds(){return Object.keys(this.updated)}get removedIds(){return Object.keys(this.removed)}get affectedIds(){return Object.keys(this.affected)}event(i){this.logger.log(`ChangeSet Event: ${i.action} (${i.id})`);const r=new L_e(i,this);this.events.set(i.id,r),this.emit("change-set-event",r)}discardOrphans(){this.added[this.project.id]&&(this.updatedIds.forEach(e=>{const f=this.updated[e];this.added[e]=f,delete this.updated[e]}),this.removedIds.forEach(e=>{this.remove(e)}));const i=[...this.addedIds,...this.updatedIds],a=this.project.toFlatIds().filter(e=>!this.project.diggestedBuiltInBaseEntitiesIds.has(e));if(i.filter(e=>!a.includes(e)).forEach(e=>{const f=this.get(e);this.logger.warn(`[discardOrphans] Entity ${f==null?void 0:f.type} with id "${e}" present in change-set but not in project. Removing from change-set.`),this.remove(e)}),this.added[this.project.id]){const e=[...this.addedIds,...this.updatedIds];this.project.toFlatIds().filter(E=>!this.project.diggestedBuiltInBaseEntitiesIds.has(E)).filter(E=>!e.includes(E)).forEach(E=>{const b=this.project.get(E);this.add(b,"added")})}}async discardOrphansAsync(i={}){const r=Y.YieldTracker.from(i),a=this.project.toFlatIds();if(this.added[this.project.id]){for(const h of this.updatedIds){const m=this.updated[h];this.added[h]=m,delete this.updated[h],await r.tick()}for(const h of this.removedIds)this.remove(h),await r.tick()}const c=[...this.addedIds,...this.updatedIds],e=a.filter(h=>!this.project.diggestedBuiltInBaseEntitiesIds.has(h)),f=c.filter(h=>!e.includes(h));for(const h of f){const m=this.get(h);this.logger.warn(`[discardOrphansAsync] Entity ${m==null?void 0:m.type} with id "${h}" present in change-set but not in project. Removing from change-set.`),this.remove(h),await r.tick()}if(this.added[this.project.id]){const h=[...this.addedIds,...this.updatedIds],E=a.filter(b=>!this.project.diggestedBuiltInBaseEntitiesIds.has(b)).filter(b=>!h.includes(b));for(const b of E){const A=this.project.get(b);this.add(A,"added"),await r.tick()}}}captureAllChangesInVersionInstances(){[...this.addedIds,...this.updatedIds].forEach(r=>{const a=this.project.get(r);if(!a){const e=this.added[r],f=this.updated[r],h=e||f;throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${r}" was ${e?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()}),this.removedIds.forEach(r=>{const a=this.project.getDeleted(r);if(!a){const e=this.removed[r];throw new Error(`Entity ${(e==null?void 0:e.type)||"of unknown type"} with id "${r}" was removed but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()})}async captureAllChangesInVersionInstancesAsync(i={}){const r=Y.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds];for(const c of a){const e=this.project.get(c);if(!e){const h=this.added[c],m=this.updated[c],E=h||m;throw new Error(`Entity ${(E==null?void 0:E.type)||"of unknown type"} with id "${c}" was ${h?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}for(const c of this.removedIds){const e=this.project.getDeleted(c);if(!e){const h=this.removed[c];throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${c}" was removed but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}}async attemptAutocloseAsync(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&await this.closeAsync(),this}async closeAsync(i={}){const r=Y.YieldTracker.from(i),a={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;const c=i.awaitBeforeClose??!0,e=i.awaitExternalPersist??!0;return this.startedClose||(this.startedClose=!0,c?await this.beforeCloseAsync({tracker:r}):this.beforeCloseAsync({tracker:r})),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],await this.discardOrphansAsync({tracker:r}),await this.sanitizeAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r}),this.lockedVersions||(await this.captureAllChangesInVersionInstancesAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r})),this.open=!1,this.isEmpty?(this.logger.warn(`[ChangeSet.closeAsync] Empty change-set (${this.id}) discarded upon closing.`),this.dirty=!1,this.project.discardChangeSet(this),this.logger.log("[ChangeSet.closeAsync] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this):(this.project.emit(oi.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),e?a.persistType==="parallel"?await this.project.persistChangeSetInParallel(this):await this.project.persistChangeSetSequentially(this):a.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this)}attemptAutoclose(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&this.close(),this}recursiveCaptureUpstreamVersions(){if(this.lockedVersions)return;[...this.addedIds,...this.updatedIds,...this.removedIds].forEach(r=>{const a=this.get(r),{added:c,updated:e,removed:f,affected:h}=a.recursiveCaptureUpstreamVersions(this.timestamp);for(const m of c)this.add(m,"added");for(const m of e)this.add(m,"updated");for(const m of f)this.add(m,"removed");for(const m of h)this.add(m,"affected")})}async recursiveCaptureUpstreamVersionsAsync(i={}){if(this.lockedVersions)return;const r=Y.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds,...this.removedIds];for await(const c of a){const e=this.get(c),{added:f,updated:h,removed:m,affected:E}=e.recursiveCaptureUpstreamVersions(this.timestamp);for(const b of f)this.add(b,"added");for(const b of h)this.add(b,"updated");for(const b of m)this.add(b,"removed");for(const b of E)this.add(b,"affected");await r.tick()}}sanitize(){this.listAdded.forEach(i=>{i.previousVersion=null})}async sanitizeAsync(i={}){const r=Y.YieldTracker.from(i);for(const a of this.listAdded)a.previousVersion=null,await r.tick()}syncDependents(){return[...this.list,...this.listAffected].forEach(i=>{const r=this.project.get(i.id);!r||r.deleted||Ag(r,this.project)||r==null||r.syncDependents(this)}),this}async syncDependentsAsync(i={}){const r=Y.YieldTracker.from(i);for(const a of[...this.list,...this.listAffected]){const c=this.project.get(a.id);!c||c.deleted||Ag(c,this.project)||(c==null||c.syncDependents(this),await r.tick())}return this}async beforeCloseAsync(i={}){const r=Y.YieldTracker.from(i);await this.project.emitAsync(oi.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),await this.syncDependentsAsync({tracker:r}),await this.emitAsyncProjectSideEffects({tracker:r}),await this.project.emitAsync(oi.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}beforeClose(){this.project.emit(oi.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),this.syncDependents(),this.emitProjectSideEffects(),this.project.emit(oi.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}teardown(){this.destroy()}emitProjectSideEffects(){return x_e(this)}async emitAsyncProjectSideEffects(i={}){return $_e(this,i)}close(i={}){const r={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;if(this.startedClose||(this.startedClose=!0,this.beforeClose()),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],this.discardOrphans(),this.sanitize(),this.captureAllChangesInVersionInstances(),this.lockedVersions||(this.recursiveCaptureUpstreamVersions(),this.captureAllChangesInVersionInstances()),this.open=!1,this.isEmpty)return this.logger.warn(`[ChangeSet.close] Empty change-set (${this.id}) discarded upon closing.`),this.project.discardChangeSet(this),this.logger.log("[ChangeSet.close] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this;if(this.added[this.project.id]&&this.updatedIds.length)throw new Error("No 'updated' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(this.added[this.project.id]&&this.removedIds.length)throw new Error("No 'removed' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(!this.updated[this.project.id]&&!this.added[this.project.id])throw new Error("Change-set must also have the project entity as 'updated' or 'added'. All changes must propagate upstream until the root project entity.");return this.project.emit(oi.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),r.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this}addDependentsToAffected(i){Object.values(i.detachedDependents).forEach(r=>{const{entity:a,field:c}=r;this.has(a.id)||this.add(a,"affected")})}get(i){return this.added[i]?this.added[i]:this.updated[i]?this.updated[i]:this.removed[i]?this.removed[i]:null}remove(i){return this.has(i)&&(delete this.added[i],delete this.updated[i],delete this.removed[i],delete this.affected[i],this.seenEntities=this.seenEntities.filter(r=>r!==i)),this}add(i,r,a={preventRecursion:!1}){var e,f,h,m;if(!this.open||!this.dirty)return this;if(Ag(i,this.project))return this;if(this.seenEntities.indexOf(i.id)===-1&&this.seenEntities.push(i.id),r==="removed"){if(this.added[i.id])return delete this.added[i.id],delete this.affected[i.id],delete this.updated[i.id],this.seenEntities=this.seenEntities.filter(b=>b!==i.id),delete this.project.deletedInstances[i.id],this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasRemoved(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:_,affected:P}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const V of b)this.add(V,"added");for(const V of A)this.add(V,"updated");for(const V of _)this.add(V,"removed");for(const V of P)this.add(V,"affected")}i.captureVersion();const E=(e=i.knownVersions)==null?void 0:e.get(i.version);if(!E)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.removed[i.id]=E,this}if(r==="added"){if(this.removed[i.id])return this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasAdded(i.id)&&!this.lockedVersions&&!a.preventRecursion){const{added:b,updated:A,removed:_,affected:P}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const V of b)this.add(V,"added");for(const V of A)this.add(V,"updated");for(const V of _)this.add(V,"removed");for(const V of P)this.add(V,"affected")}i.previousVersion=null,i.captureVersion();const E=(f=i.knownVersions)==null?void 0:f.get(i.version);if(!E)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.added[i.id]=E,delete this.affected[i.id],this.addDependentsToAffected(i),this}if(r==="updated"){if(this.removed[i.id])return this;if(this.added[i.id])return i.captureVersion(),this.addDependentsToAffected(i),this;if(this.affected[i.id]&&delete this.affected[i.id],!this.hasUpdated(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:_,affected:P}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const V of b)this.add(V,"added");for(const V of A)this.add(V,"updated");for(const V of _)this.add(V,"removed");for(const V of P)this.add(V,"affected")}i.activeVersion=!0,i.captureVersion();const E=(h=i.knownVersions)==null?void 0:h.get(i.version);if(!E)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.updated[i.id]=E,this.addDependentsToAffected(i),this}if(r==="affected"){if(this.removed[i.id])return this;if(this.added[i.id])return this;if(this.updated[i.id])return this;if(this.affected[i.id]=i,!this.lockedVersions){const E=i.version+"--"+this.id,b=((m=i.knownVersions)==null?void 0:m.get(E))||i.snapshot();i.apply(b),i.knownVersions=i.knownVersions?i.knownVersions.set(E,b):new Map().set(E,b)}}return this}toJSON(){var f;const i={},r={},a={},c=new Set;for(const h of Object.values(this.added))i[h.id]=h.toShallowJSON();for(const h of Object.values(this.updated))r[h.id]=h.toShallowJSON();for(const h of Object.values(this.removed))a[h.id]=h.toShallowJSON();for(const h of Object.values(this.affected))c.add(h.id);const e=this.get(((f=this.self)==null?void 0:f.id)||"");return{added:i,updated:r,removed:a,affected:Array.from(c),self:e?e.toShallowJSON():null,seenEntities:this.seenEntities,actionName:this.actionName}}has(i){return!!this.added[i]||!!this.removed[i]||!!this.updated[i]||!!this.affected[i]}hasAdded(i){return!!this.added[i]}hasUpdated(i){return!!this.updated[i]}hasRemoved(i){return!!this.removed[i]}hasAffected(i){return!!this.affected[i]}}function dgi(s){return new Set([...Object.keys(s.added),...Object.keys(s.updated),...Object.keys(s.removed),...Array.from(s.affected)])}function P_(s,p,i){var f;const r=new Date().toISOString(),a=new S(i,x.sessionAuthor,r,i);if(a.lockedVersions=!0,s===p)throw Y.Logger.error("From: ",s),Y.Logger.error("To: ",p),new Error("Cannot generate transitional change set between the same two versions or change-sets");let c;if(s==="initial"?c=!0:p==="initial"?c=!1:B(s.timestamp).isBefore(B(p.timestamp))?c=!0:c=!1,Y.Logger.log("Transitioning from ",s==="initial"?"initial":s.index),Y.Logger.log("Transitioning to ",p==="initial"?"initial":p.index),Y.Logger.log("Is forward: ",c),c){const h=p,m=h.index,E=s==="initial"?0:s.index;Y.Logger.log("ownIndex: ",m),Y.Logger.log("startIndex: ",E),Y.Logger.log("CH ID: ",h.id);const b=m===E?[i.history[m]]:i.history.slice(E+1,m+1);if(b.sort((A,_)=>B(A.timestamp).isAfter(B(_.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");Y.Logger.log("REDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{N_(A,_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.version),P.addSelfToProject(a),a.timestamp=P.createdAt,a.add(P,W.Added,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.version),a.timestamp=P.createdAt,a.add(P,W.Updated,{preventRecursion:!0})},_=>{var k;const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.version),(k=P.removeFromParent)==null||k.call(P,a),P.unsubscribe(),P.unsubscribeFromDependencies(),i.subscribeDeletedInstance(P),a.timestamp=P.createdAt,a.add(P,W.Removed,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);const k=_.version+"--"+A.id;P.restoreVersion(k),a.timestamp=P.createdAt,a.add(P,W.Updated,{preventRecursion:!0})})})}else{const h=s,m=h.index,E=p==="initial"?0:p.index;Y.Logger.log("CH ID: ",h.id);const b=m===E?[i.history[m]]:i.history.slice(E+1,m+1);if(b.sort((A,_)=>B(_.timestamp).isAfter(B(A.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");Y.Logger.log("UNDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{N_(A,_=>{var k;const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);_.previousVersion&&(P.restoreVersion(_.previousVersion),(k=P.removeFromParent)==null||k.call(P,a),P.unsubscribe(),P.unsubscribeFromDependencies(),i.subscribeDeletedInstance(P)),a.timestamp=P.createdAt,a.add(P,W.Removed,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.previousVersion),a.timestamp=P.createdAt,a.add(P,W.Updated,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.previousVersion),P.addSelfToProject(a),a.timestamp=P.createdAt,a.add(P,W.Added,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(P.version),a.timestamp=P.createdAt,a.add(P,W.Affected,{preventRecursion:!0})})})}let e;if(p==="initial"){const h=Array.from(((f=i.knownVersions)==null?void 0:f.values())||[]).reduce((m,E)=>!m||B(E.createdAt).isBefore(B(m.createdAt))?E:m,null);if(!h)throw new Error("No oldest version found");e=h.createdAt}else e=p.timestamp;return a.open=!1,{transitionalChangeSet:a,transitionTime:r,timeOfOriginalTargetChanges:e}}function N_(s,p,i,r,a){var h;if(!(s!=null&&s.self))throw new Error("Change set must have a valid `self` entity state to be traversed");const c=((h=s.self)==null?void 0:h.type)===d.Project?s.self:s.self.project,e=new Un(s.self,{allBuiltInEntityIds:c.diggestedBuiltInBaseEntitiesIds});Y.Logger.log("changeSet.added: ",Object.keys(s.added).length),Y.Logger.log("changeSet.updated: ",Object.keys(s.updated).length),Y.Logger.log("changeSet.removed: ",Object.keys(s.removed).length);const f={...s.added,...s.updated,...s.removed,...s.affected};e.order=Object.keys(f),e.flatRecord=f,e.orderEntities(),Y.Logger.log("All entities: ",e.order.map((m,E)=>`${E+1}: ${f[m].type} - ${m}`).join(`,
|
|
6
|
+
Please provide a unique 'name' string.`,severity:Te.Error,code:Ce.NameNotUniqueInScope}))}}return i}function qAi(s,p){switch(s.type){case d.DefinitionEntity:return _x(s,p);case d.FunctionDeclaration:return Vx(s,p);case d.VariableDeclaration:return Px(s,p);case d.Property:return Nx(s,p);case d.ArgumentDeclaration:return xx(s,p);default:return[]}}function Tp(s,p){var r;const i=s;switch(s.type){case d.FunctionCall:case d.InternalCall:return Ia(s.declaration,p).codeName;case d.ActionDescriptor:case d.DefinitionEntity:case d.VariableDeclaration:case d.ValueDescriptor:case d.FunctionDeclaration:return s.codeName||null;case d.Property:case d.ArgumentDeclaration:{if(s.codeName)return s.codeName;if((r=s.implements)!=null&&r.length){const a=s.implements.find(c=>{const e=Ia(c,p);return!!(e!=null&&e.codeName)});if(a)return Ia(a,p).codeName||null}break}case d.InputMap:case d.OutputMap:case d.VariableInstance:{if(s.declaration){const a=Ia(s.declaration,p);return Tp(a,p)||""}break}}return i.codeName||null}function Rh(s,p){let i=s;if(!!p.some(a=>a.name===i)){const a=s.split(" "),c=a.pop()||"",e=parseInt(c);return!isNaN(e)?a.push(`${e+1}`):(a.push(c),a.push("1")),i=a.join(" "),Rh(i,p)}return i}function __e(s,p,i){const a=`${_g(s)}-${p}-id`;return i.instances[a]?x.UUID.uuid():a}function __(s,p){let i="",r=null;if(s.parent){const c=p.get(s.parent);c&&(r=c)}let a="";return r&&(a=`${_g(oe(r,p))}-`),i=`${a}${_g(oe(s,p))}-id`,p.instances[i]?x.UUID.uuid():i}function on(s,p,i="uuid"){return i==="semantic"?__e(oe(s,p),s.type,p):x.UUID.uuid()}const SAi=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function $x(s){return typeof s=="string"&&SAi.test(s)}const ZAi=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function V_(s){return typeof s=="string"&&ZAi.test(s)}function HAi(s){return s instanceof Error&&s.name==="ZodError"&&"issues"in s&&Array.isArray(s.issues)}var WAi=class extends Error{constructor(p,i){super(p,i);R(this,"name");R(this,"details");this.name="ZodValidationError",this.details=zAi(i)}toString(){return this.message}};function zAi(s){if(s){const p=s.cause;if(HAi(p))return p.issues}return[]}function YAi(s){return s.length!==0}function Fj(s){return s.description??""}var JAi=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function QAi(s){if(s.length===1){let p=s[0];return typeof p=="symbol"&&(p=Fj(p)),p.toString()||'""'}return s.reduce((p,i)=>{if(typeof i=="number")return p+"["+i.toString()+"]";if(typeof i=="symbol"&&(i=Fj(i)),i.includes('"'))return p+'["'+XAi(i)+'"]';if(!JAi.test(i))return p+'["'+i+'"]';const r=p.length===0?"":".";return p+r+i},"")}function XAi(s){return s.replace(/"/g,'\\"')}var egi="; ",tgi=99,V_e="Validation error",igi=": ",rgi=", or ";function ngi(s={}){const{issueSeparator:p=egi,unionSeparator:i=rgi,prefixSeparator:r=igi,prefix:a=V_e,includePath:c=!0,maxIssuesInMessage:e=tgi}=s;return f=>{const h=f.slice(0,e).map(m=>lg({issue:m,issueSeparator:p,unionSeparator:i,includePath:c})).join(p);return agi(h,a,r)}}function lg(s){const{issue:p,issueSeparator:i,unionSeparator:r,includePath:a}=s;if(p.code===ot.invalid_union)return p.unionErrors.reduce((c,e)=>{const f=e.issues.map(h=>lg({issue:h,issueSeparator:i,unionSeparator:r,includePath:a})).join(i);return c.includes(f)||c.push(f),c},[]).join(r);if(p.code===ot.invalid_arguments)return[p.message,...p.argumentsError.issues.map(c=>lg({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(p.code===ot.invalid_return_type)return[p.message,...p.returnTypeError.issues.map(c=>lg({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(a&&YAi(p.path)){if(p.path.length===1){const c=p.path[0];if(typeof c=="number")return`${p.message} at index ${c}`}return`${p.message} at "${QAi(p.path)}"`}return p.message}function agi(s,p,i){return p!==null?s.length>0?[p,s].join(i):p:s.length>0?s:V_e}function sgi(s,p={}){const r=lgi(p)([s]);return new WAi(r,{cause:new cd([s])})}function lgi(s){return"messageBuilder"in s?s.messageBuilder:ngi(s)}async function P_e(s,p={}){var c;const i=Y.YieldTracker.from(p),r=[...In(s),...Ja(s)];await i.tick();const a=Zt(s.errors,r);return await((c=s.dataType)==null?void 0:c.validateAsync({tracker:i})),a}function N_e(s){var i;(i=s.dataType)==null||i.validate();const p=[...In(s),...Ja(s)];return Zt(s.errors,p)}const ogi=Object.freeze(Object.defineProperty({__proto__:null,validate:N_e,validateAsync:P_e},Symbol.toStringTag,{value:"Module"}));function x_e(s){return s.listAdded.forEach(p=>{const i=s.project.get(p.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(oi.EXPLICIT_DEFINITION_ENTITY_ADDED,i,s),li(i,Ae.PERSISTED_ENTITY)?s.project.emit(oi.PERSISTED_DEFINITION_ENTITY_ADDED,i,s):li(i,Ae.RELATIONAL_DATABASE)&&s.project.emit(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,i,s))}),s.listUpdated.forEach(p=>{const i=s.project.get(p.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(oi.EXPLICIT_DEFINITION_ENTITY_UPDATED,i,s),li(i,Ae.PERSISTED_ENTITY)?s.project.emit(oi.PERSISTED_DEFINITION_ENTITY_UPDATED,i,s):li(i,Ae.RELATIONAL_DATABASE)&&s.project.emit(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,i,s))}),s.listRemoved.forEach(p=>{const i=s.project.get(p.id)||s.project.getDeleted(p.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(oi.EXPLICIT_DEFINITION_ENTITY_REMOVED,i,s),li(i,Ae.PERSISTED_ENTITY)?s.project.emit(oi.PERSISTED_DEFINITION_ENTITY_REMOVED,i,s):li(i,Ae.RELATIONAL_DATABASE)&&s.project.emit(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,i,s))}),s}async function $_e(s,p={}){const i=Y.YieldTracker.from(p),r=[];for(const a of s.listAdded){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(oi.EXPLICIT_DEFINITION_ENTITY_ADDED,c,s)),li(c,Ae.PERSISTED_ENTITY)?r.push(s.project.emitAsync(oi.PERSISTED_DEFINITION_ENTITY_ADDED,c,s)):li(c,Ae.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,c,s))),await i.tick()}for(const a of s.listUpdated){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(oi.EXPLICIT_DEFINITION_ENTITY_UPDATED,c,s)),li(c,Ae.PERSISTED_ENTITY)?r.push(s.project.emitAsync(oi.PERSISTED_DEFINITION_ENTITY_UPDATED,c,s)):li(c,Ae.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,c,s))),await i.tick()}for(const a of s.listRemoved){const c=s.project.get(a.id)||s.project.getDeleted(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(oi.EXPLICIT_DEFINITION_ENTITY_REMOVED,c,s)),li(c,Ae.PERSISTED_ENTITY)?r.push(s.project.emitAsync(oi.PERSISTED_DEFINITION_ENTITY_REMOVED,c,s)):li(c,Ae.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(oi.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,c,s))),await i.tick()}return await Promise.all(r),s}var p1=(s=>(s.Manual="manual",s.Automatic="automatic",s))(p1||{}),W=(s=>(s.Added="added",s.Updated="updated",s.Removed="removed",s.Affected="affected",s))(W||{}),w=(s=>(s.AddSuccessCall="add-success-call",s.AddErrorCall="add-error-call",s.AddCall="add-call",s.SetParent="set-parent",s.SetStandaloneParent="set-standalone-parent",s.AfterAllChildrenInitialized="after-all-children-initialized",s.UpdateWithShallowTransfer="update-with-shallow-transfer",s.UpdateWithGenerationTarget="update-with-generation-target",s.RemoveFromParent="remove-from-parent",s.RemoveEntity="remove-entity",s.RestoreEntity="restore-entity",s.CloneEntity="clone-entity",s.AddInput="add-input",s.RemoveInput="remove-input",s.SetDataType="set-data-type",s.RemoveDataType="remove-data-type",s.SetAdditionalPropertiesDataType="set-additional-properties-data-type",s.RemoveAdditionalPropertiesDataType="remove-additional-properties-data-type",s.SetAllPropertiesImplement="set-all-properties-implement",s.RemoveAllPropertiesImplement="remove-all-properties-implement",s.RemoveValueReader="remove-value-reader",s.AddValueReader="add-value-reader",s.RemoveValueWriter="remove-value-writer",s.SetValueWriter="set-value-writer",s.AddEntryCaller="add-entry-caller",s.AddSuccessCaller="add-success-caller",s.AddErrorCaller="add-error-caller",s.RemoveCall="remove-call",s.RemoveCaller="remove-caller",s.RemoveChildGroup="remove-child-group",s.AddToAndGroup="add-to-and-group",s.AddToOrGroup="add-to-or-group",s.RemoveUnrecognizedInputs="remove-unrecognized-inputs",s.RemoveUnrecognizedOutputs="remove-unrecognized-outputs",s.SyncInputs="sync-inputs",s.SyncOutputs="sync-outputs",s.SetImplements="set-implements",s.SetExtends="set-extends",s.SetExtension="set-extension",s.AddImplementation="add-implementation",s.RemoveImplementation="remove-implementation",s.AddProperty="add-property",s.RemoveProperty="remove-property",s.AddMethod="add-method",s.RemoveMethod="remove-method",s.AddAbstractMethod="add-abstract-method",s.RemoveAbstractMethod="remove-abstract-method",s.SetValueAsTypeSingle="set-value-as-type-single",s.SetValueAsTypeList="set-value-as-type-list",s.SetValueAsType="set-value-as-type",s.RemoveErrorCatching="remove-error-catching",s.RemoveAllErrorCallers="remove-all-error-callers",s.RemoveAllSuccessCallers="remove-all-success-callers",s.RemoveAllCallers="remove-all-callers",s.RemoveAllErrorCalls="remove-all-error-calls",s.SetDataTypeEntityValue="set-data-type-entity-value",s.MergeDataTypes="merge-data-types",s.SetDataTypeForeignKeyRef="set-data-type-foreign-key-ref",s.SetErrorEntity="set-error-entity",s.AddValueAsTypeToList="add-value-as-type-to-list",s.RemoveValueAsTypeFromList="remove-value-as-type-from-list",s.CreateFromGenerationTarget="create-from-generation-target",s.ConnectExternalAccount="connect-external-account",s.ChangeExternalAccountConnectionUsed="change-external-account-connection-used",s.MoveInlineDefToCanvas="move-inline-def-to-canvas",s.CreateDefFromValue="create-def-from-value",s.PrettifyCanvas="prettify-canvas",s.SetPrimitiveDefaultValue="set-primitive-default-value",s.MakeArgRequired="make-argument-required",s.MakeArgNonRequired="make-argument-non-required",s.RecalculateArg="recalculate-arg",s.RenameArg="rename-argument",s.ChangeArgDescription="changed-argument-description",s.RemoveArgBaseImplementation="remove-argument-base-implementation",s.AddArgBaseImplementation="add-argument-base-implementation",s.ChangeArgDataType="change-argument-data-type",s.RecalculateCondition="recalculate-condition",s.ChangeTypeOfCondition="change-type-of-condition",s.RenameDefinition="rename-definition",s.RecalculateDef="recalculate-definition",s.ChangeDefDescription="changed-definition-description",s.RemoveDefBaseImplementation="remove-definition-base-implementation",s.AddDefBaseImplementation="add-definition-base-implementation",s.RemoveDefExtension="remove-definition-extension",s.SetDefExtends="set-definition-extension",s.MakeDefStatic="make-def-static",s.MakeDefNonStatic="make-def-non-static",s.MakeDefAbstract="make-def-abstract",s.MakeDefNonAbstract="make-def-non-abstract",s.RecalculateFuncCall="recalculate-function-call",s.ChangeFuncCallDeclaration="change-function-call-declaration",s.RenameFuncDecl="rename-function-declaration",s.ChangeFuncDeclDescription="changed-function-declaration-description",s.RecalculateFuncDecl="recalculate-function-declaration",s.SetFuncDeclBaseImplementation="set-function-declaration-base-implementation",s.ChangeFuncDeclOutputDataType="change-function-declaration-output-data-type",s.RecalculateGlobalEvent="recalculate-global-event",s.ChangeGlobalEventDescription="changed-global-event-description",s.ChangeGlobalEventType="changed-global-event-type",s.RecalculateInputMap="recalculate-input",s.ChangeInputMapDescription="changed-input-description",s.ChangeInputMapDataType="change-input-data-type",s.RecalculateLoop="recalculate-loop",s.ChangeLoopType="changed-loop-type",s.RecalculateOperation="recalculate-operation",s.ChangeOperationType="changed-operation-type",s.RecalculateOutputMap="recalculate-output",s.ChangeOutputMapDataType="change-output-data-type",s.RecalculateProperty="recalculate-property",s.MakePropertyRequired="make-property-required",s.MakePropertyNonRequired="make-property-non-required",s.MakePropertyConstant="make-property-constant",s.MakePropertyNonConstant="make-property-non-constant",s.MakePropertyUnique="make-property-unique",s.MakePropertyNonUnique="make-property-non-unique",s.MakePropertyStatic="make-property-static",s.MakePropertyNonStatic="make-property-non-static",s.MakePropertyAbstract="make-property-abstract",s.MakePropertyNonAbstract="make-property-non-abstract",s.RenameProperty="rename-property",s.ChangePropertyDescription="changed-property-description",s.RemovePropertyBaseImplementation="remove-property-base-implementation",s.AddPropertyBaseImplementation="add-property-base-implementation",s.ChangePropertyDataType="change-property-data-type",s.RecalculateSearch="recalculate-search",s.RenameSearch="rename-search",s.ChangeSearchDescription="changed-search-description",s.ChangeSearchQuery="changed-search-query",s.MakeValueDescriptorRequired="make-value-descriptor-required",s.MakeSearchInputRequired="make-search-input-required",s.MakeValueDescriptorNonRequired="make-value-descriptor-non-required",s.MakeSearchInputNonRequired="make-search-input-non-required",s.RenameValueDescriptor="rename-value-descriptor",s.RenameSearchInput="rename-search-input",s.ChangeValueDescriptorDescription="changed-value-descriptor-description",s.ChangeSearchInputDescription="changed-search-input-description",s.ChangeValueDescriptorDataType="change-value-descriptor-data-type",s.RecalculateVarDecl="recalculate-variable-declaration",s.MakeVarDeclConstant="make-variable-declaration-constant",s.MakeVarDeclNonConstant="make-variable-declaration-non-constant",s.RenameVarDecl="rename-variable-declaration",s.ChangeVarDeclDescription="changed-variable-declaration-description",s.ChangeVarDeclDataType="change-variable-declaration-data-type",s.RecalculateVarInst="recalculate-variable-instance",s.ChangeVarInstDeclaration="change-variable-instance-declaration",s.HideFuncDeclBody="hide-function-declaration-body",s.ShowFuncDeclBody="show-function-declaration-body",s.HideGlobalEventBody="hide-global-event-body",s.ShowGlobalEventBody="show-global-event-body",s.HideLoopBody="hide-loop-body",s.ShowLoopBody="show-loop-body",s.HideTriggerBody="hide-trigger-body",s.ShowTriggerBody="show-trigger-body",s.AddNestedAndCondition="add-nested-and-condition",s.AddInputToCondition="add-input-to-condition",s.RecalculateNode="recalculate-node",s.AddInputToFuncDecl="add-input-to-function-declaration",s.ChangeInternalCallToThrowErrors="change-internal-call-to-throw-errors",s.ChangeInternalCallToCatchErrors="change-internal-call-to-catch-errors",s.AddErrorOutputToInternalCall="add-error-output-to-internal-call",s.ChangeLoopToThrowErrors="change-loop-to-throw-errors",s.ChangeLoopToCatchErrors="change-loop-to-catch-errors",s.RecalculateLoopBody="recalculate-loop-body",s.RecalculateMethod="recalculate-method",s.AddArgToLoopBody="add-arg-to-loop-body",s.AddArgToMethod="add-arg-to-method",s.RecalculateNestedCondition="recalculate-nested-condition",s.ChangeNodeToThrowErrors="change-node-to-throw-errors",s.ChangeNodeToCatchErrors="change-node-to-catch-errors",s.ChangeOperationToThrowErrors="change-operation-to-throw-errors",s.ChangeOperationToCatchErrors="change-operation-to-catch-errors",s.ChangeFuncCallToThrowErrors="change-function-call-to-throw-errors",s.ChangeFuncCallToCatchErrors="change-function-call-to-catch-errors",s.ChangeSearchToThrowErrors="change-search-to-throw-errors",s.ChangeSearchToCatchErrors="change-search-to-catch-errors",s.ChangeVarDeclToThrowErrors="change-variable-declaration-to-throw-errors",s.ChangeVarDeclToCatchErrors="change-variable-declaration-to-catch-errors",s.ChangeVarInstToThrowErrors="change-variable-instance-to-throw-errors",s.ChangeVarInstToCatchErrors="change-variable-instance-to-catch-errors",s.AddErrorOutputToNode="add-error-output-to-node",s.AddErrorOutputToOperation="add-error-output-to-operation",s.AddErrorOutputToFuncCall="add-error-output-to-function-call",s.AddErrorOutputToSearch="add-error-output-to-search",s.AddErrorOutputToVarDecl="add-error-output-to-variable-declaration",s.AddErrorOutputToVarInst="add-error-output-to-variable-instance",s.AddInputToNode="add-input-to-node",s.AddInputToOperation="add-input-to-operation",s.AddInputToFuncCall="add-input-to-function-call",s.AddInputToSearch="add-input-to-search",s.AddPropertyToVarDecl="add-property-to-variable-declaration",s.AddPropertyToVarInst="add-property-to-variable-instance",s.AddMethodToDef="add-method-to-definition",s.ReSyncRowTransformer="re-sync-row-transformer",s.ManuallyAddRowTransformer="manually-add-row-transformer",s.AddPropertyToDef="add-property-to-definition",s.RestablishExternalAccountConnection="restablish-external-account-connection",s.AddThrownError="add-thrown-error",s.RecalculateTerminationStatement="recalculate-termination-statement",s.RecalculateReturnStmt="recalculate-return-statement",s.RecalculateContinueStmt="recalculate-continue-statement",s.RecalculateBreakStmt="recalculate-break-statement",s.AddPropertyToTerminationStatement="add-property-to-termination-statement",s.AddPropertyToReturnStmt="add-property-to-return-statement",s.AddPropertyToContinueStmt="add-property-to-continue-statement",s.AddPropertyToBreakStmt="add-property-to-break-statement",s.SetLiteralValueToExplicitlyEmpty="set-literal-value-to-explicitly-empty",s.ModifyLiteralValue="modify-literal-value",s.RemoveLiteralValue="remove-literal-value",s.ModifyLiteralValueAsType="modify-literal-value-as-type",s.UpdateProjectMetadata="update-project-metadata",s.RenameProject="rename-project",s.ChangeProjectDescription="change-project-description",s.RestoreNode="restore-node",s.RestoreDef="restore-definition",s.RestoreFuncDecl="restore-function-declaration",s.RestoreGlobalEvent="restore-global-event",s.RestoreSearch="restore-search",s.RestoreVarDecl="restore-variable-declaration",s.RestoreVarInst="restore-variable-instance",s.RestoreFuncCall="restore-function-call",s.RestoreOperation="restore-operation",s.RestoreCondition="restore-condition",s.RestoreReturnStmt="restore-return-statement",s.RestoreContinueStmt="restore-continue-statement",s.RestoreBreakStmt="restore-break-statement",s.RestoreInstalledProject="restore-installed-project",s.RestoreLoop="restore-loop",s.CreateNewDef="create-new-definition",s.CreateNewFuncDecl="create-new-function-declaration",s.CreateNewGlobalEvent="create-new-global-event",s.CreateNewSearch="create-new-search",s.CreateNewVarDecl="create-new-variable-declaration",s.CreateNewVarInst="create-new-variable-instance",s.CreateNewFuncCall="create-new-function-call",s.CreateNewOperation="create-new-operation",s.CreateNewCondition="create-new-condition",s.CreateNewReturnStmt="create-new-return-statement",s.CreateNewContinueStmt="create-new-continue-statement",s.CreateNewBreakStmt="create-new-break-statement",s.CreateNewInternalCall="create-new-internal-call",s.CreateNewLoop="create-new-loop",s.ImplementBuiltInFunctionalityAsDef="implement-built-in-functionality-as-definition",s.ImplementAbstractEntityAsDef="implement-abstract-entity-as-definition",s.ImplementNewHTTPEndpoint="implement-new-http-endpoint",s.ImplementNewScheduledTrigger="implement-new-scheduled-trigger",s.ImplementNewPersistedEntity="implement-new-persisted-entity",s.AddedNewRowTransformer="added-new-row-transformer",s.AddedSQLConnectionConfig="added-sql-connection-config",s.AddedNewSSLConnectionConfig="added-new-ssl-connection-config",s.AddedGoogleConnection="added-google-connection",s.AddedSlackConnection="added-slack-connection",s.AddedNewExternalAccountConnection="added-new-external-account-connection",s.AddedGoogleDriveConnection="added-google-drive-connection",s.AddedGoogleSheetsConnection="added-google-sheets-connection",s.AddedGoogleSlidesConnection="added-google-slides-connection",s.AddedGoogleMailConnection="added-gmail-connection",s.ManuallyCreateIndividualNode="manually-create-individual-node",s.UpdateNode="update-node",s.CreateNewProjectPublicationCompletedEvent="create-new-project-publication-completed-event",s.CreateNewCountedLoop="create-new-counted-loop",s.CreateNewListLoop="create-new-list-loop",s.CreateNewManualFlowLoop="create-new-manual-flow-loop",s.CreateNewObjectKeysLoop="create-new-object-keys-loop",s.CreateNewObjectValuesLoop="create-new-object-values-loop",s.CreateNewStringLoop="create-new-string-loop",s.CreateNewIsFalseCondition="create-new-is-false-condition",s.CreateNewIsTrueCondition="create-new-is-true-condition",s.CreateNewAndCondition="create-new-and-condition",s.CreateNewOrCondition="create-new-or-condition",s.DisconnectNodes="disconnect-nodes",s.DisconnectExecutions="disconnect-executions",s.DisconnectValues="disconnect-values",s.ConnectNodes="connect-nodes",s.ConnectExecution="connect-execution",s.ConnectValues="connect-values",s.ConnectValueToNewInput="connect-value-to-new-input",s.ConnectValueToNewOperationInput="connect-value-to-new-operation-input",s.ConnectValueToNewConditionInput="connect-value-to-new-condition-input",s.ConnectValueToNewSearchInput="connect-value-to-new-search-input",s.ConnectValueToNewVarDeclProperty="connect-value-to-new-variable-declaration-property",s.ConnectValueToNewVarInstProperty="connect-value-to-new-variable-instance-property",s.ConnectValueToNewReturnStmtProperty="connect-value-to-new-return-statement-property",s.ConnectValueToNewContinueStmtProperty="connect-value-to-new-continue-statement-property",s.ConnectValueToNewBreakStmtProperty="connect-value-to-new-break-statement-property",s.ConnectNewFuncDeclArgToValue="connect-new-function-argument-to-value",s.RemoveNodes="remove-nodes",s.RemoveNode="remove-node",s.InitialLoadAutomaticCanvasRefresh="initial-load-automatic-canvas-refresh",s.MoveNodes="move-nodes",s.MoveNode="move-node",s.CloneNodes="clone-nodes",s.CloneNode="clone-node",s.GenerateSQLMigrationOnPersistedEntityUpdate="generate-sql-migration-on-persisted-entity-update",s))(w||{}),Be=(s=>(s.ActionOwnerEntityNotEditable="action-owner-entity-not-editable",s.ActionCounterpartEntityNotEditable="action-counterpart-entity-not-editable",s.ActionOwnerEntityNonDeletable="action-owner-entity-non-deletable",s.GlobalVariableDeclarationCannnotCatchError="global-variable-declaration-cannot-catch-error",s.GlobalVariableDeclarationCannotReadValue="global-variable-declaration-cannot-read-value",s.GlobalVariableDeclarationCannotBeCalled="global-variable-declaration-cannot-be-called",s.GlobalVariableDeclarationCannotCallFromError="global-variable-declaration-cannot-call-from-error",s.ValueReadingOverridesConstantProperty="value-reading-overrides-constant-property",s.DefaultValueOverridesConstantProperty="default-value-overrides-constant-property",s.ValueReadingOverridesConstantVariable="value-reading-overrides-constant-variable",s.DefaultValueOverridesConstantVariable="default-value-overrides-constant-variable",s.CannotSuccessCallItself="cannot-success-call-itself",s.CannotErrorCallItself="cannot-error-call-itself",s.CannotEntryCallItself="cannot-entry-call-itself",s.CannotValueWriteItself="cannot-value-write-itself",s.CannotBeCalledBeforeDeclaration="cannot-be-called-before-declaration",s.CannotBeCalledInParallelBranchToDeclaration="cannot-be-called-in-parallel-branch-to-declaration",s.CannotBeHigherScopeThanDeclaration="cannot-be-higher-scope-than-declaration",s.InputsInGlobalVariableDeclarationsCannotReadValues="inputs-in-global-variable-declarations-cannot-read-values",s))(Be||{});class L_e{constructor({id:p,action:i,errorReason:r,owner:a,counterpart:c,rootAction:e},f){R(this,"id");R(this,"action");R(this,"errorReason");R(this,"owner",null);R(this,"counterpart",null);R(this,"rootAction",!1);R(this,"parent");this.id=p,this.action=i,this.errorReason=r||null,this.owner=a||null,this.counterpart=c||null,this.rootAction=e||!1,this.parent=f}}class S extends Y.Events{constructor(i,r,a,c,e=!1,f=""){super(f?f+"-cs-events":"anonymous-cs-events");R(this,"id",x.UUID.uuid());R(this,"seenEntities",[]);R(this,"added",{});R(this,"updated",{});R(this,"removed",{});R(this,"affected",{});R(this,"self",null);R(this,"author");R(this,"timestamp");R(this,"open",!0);R(this,"startedClose",!1);R(this,"dirty",!0);R(this,"submitting",!1);R(this,"lockedVersions",!1);R(this,"type","manual");R(this,"autoclose",!1);R(this,"actionName","");R(this,"project");R(this,"events",new Map);R(this,"ignoreNonEditable",!1);R(this,"ignoreNonDeletable",!1);R(this,"logger");if(this.project=i,this.author=r||x.sessionAuthor||"",this.timestamp=a,this.self=c,this.autoclose=e,this.actionName=f,this.logger=Y.Logger.module("cs:"+(this.actionName?this.actionName+":":"")+this.id),this.autoclose&&!this.actionName)throw new Error("Auto-close change-set must have an auto-close action name.")}get index(){const i=this.project.history.indexOf(this);return i===-1?null:i}get isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.updated).length===0&&Object.keys(this.removed).length===0}get isValid(){var i;return!(this.isEmpty&&this.self&&!this.affected[(i=this.self)==null?void 0:i.id])}get list(){return[...Object.values(this.added),...Object.values(this.updated),...Object.values(this.removed)]}get listAdded(){return Object.values(this.added)}get listUpdated(){return Object.values(this.updated)}get listRemoved(){return Object.values(this.removed)}get listAffected(){return Object.values(this.affected)}get addedIds(){return Object.keys(this.added)}get updatedIds(){return Object.keys(this.updated)}get removedIds(){return Object.keys(this.removed)}get affectedIds(){return Object.keys(this.affected)}event(i){this.logger.log(`ChangeSet Event: ${i.action} (${i.id})`);const r=new L_e(i,this);this.events.set(i.id,r),this.emit("change-set-event",r)}discardOrphans(){this.added[this.project.id]&&(this.updatedIds.forEach(e=>{const f=this.updated[e];this.added[e]=f,delete this.updated[e]}),this.removedIds.forEach(e=>{this.remove(e)}));const i=[...this.addedIds,...this.updatedIds],a=this.project.toFlatIds().filter(e=>!this.project.diggestedBuiltInBaseEntitiesIds.has(e));if(i.filter(e=>!a.includes(e)).forEach(e=>{const f=this.get(e);this.logger.warn(`[discardOrphans] Entity ${f==null?void 0:f.type} with id "${e}" present in change-set but not in project. Removing from change-set.`),this.remove(e)}),this.added[this.project.id]){const e=[...this.addedIds,...this.updatedIds];this.project.toFlatIds().filter(E=>!this.project.diggestedBuiltInBaseEntitiesIds.has(E)).filter(E=>!e.includes(E)).forEach(E=>{const b=this.project.get(E);this.add(b,"added")})}}async discardOrphansAsync(i={}){const r=Y.YieldTracker.from(i),a=this.project.toFlatIds();if(this.added[this.project.id]){for(const h of this.updatedIds){const m=this.updated[h];this.added[h]=m,delete this.updated[h],await r.tick()}for(const h of this.removedIds)this.remove(h),await r.tick()}const c=[...this.addedIds,...this.updatedIds],e=a.filter(h=>!this.project.diggestedBuiltInBaseEntitiesIds.has(h)),f=c.filter(h=>!e.includes(h));for(const h of f){const m=this.get(h);this.logger.warn(`[discardOrphansAsync] Entity ${m==null?void 0:m.type} with id "${h}" present in change-set but not in project. Removing from change-set.`),this.remove(h),await r.tick()}if(this.added[this.project.id]){const h=[...this.addedIds,...this.updatedIds],E=a.filter(b=>!this.project.diggestedBuiltInBaseEntitiesIds.has(b)).filter(b=>!h.includes(b));for(const b of E){const A=this.project.get(b);this.add(A,"added"),await r.tick()}}}captureAllChangesInVersionInstances(){[...this.addedIds,...this.updatedIds].forEach(r=>{const a=this.project.get(r);if(!a){const e=this.added[r],f=this.updated[r],h=e||f;throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${r}" was ${e?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()}),this.removedIds.forEach(r=>{const a=this.project.getDeleted(r);if(!a){const e=this.removed[r];throw new Error(`Entity ${(e==null?void 0:e.type)||"of unknown type"} with id "${r}" was removed but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()})}async captureAllChangesInVersionInstancesAsync(i={}){const r=Y.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds];for(const c of a){const e=this.project.get(c);if(!e){const h=this.added[c],m=this.updated[c],E=h||m;throw new Error(`Entity ${(E==null?void 0:E.type)||"of unknown type"} with id "${c}" was ${h?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}for(const c of this.removedIds){const e=this.project.getDeleted(c);if(!e){const h=this.removed[c];throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${c}" was removed but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}}async attemptAutocloseAsync(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&await this.closeAsync(),this}async closeAsync(i={}){const r=Y.YieldTracker.from(i),a={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;const c=i.awaitBeforeClose??!0,e=i.awaitExternalPersist??!0;return this.startedClose||(this.startedClose=!0,c?await this.beforeCloseAsync({tracker:r}):this.beforeCloseAsync({tracker:r})),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],await this.discardOrphansAsync({tracker:r}),await this.sanitizeAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r}),this.lockedVersions||(await this.captureAllChangesInVersionInstancesAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r})),this.open=!1,this.isEmpty?(this.logger.warn(`[ChangeSet.closeAsync] Empty change-set (${this.id}) discarded upon closing.`),this.dirty=!1,this.project.discardChangeSet(this),this.logger.log("[ChangeSet.closeAsync] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this):(this.project.emit(oi.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),e?a.persistType==="parallel"?await this.project.persistChangeSetInParallel(this):await this.project.persistChangeSetSequentially(this):a.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this)}attemptAutoclose(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&this.close(),this}recursiveCaptureUpstreamVersions(){if(this.lockedVersions)return;[...this.addedIds,...this.updatedIds,...this.removedIds].forEach(r=>{const a=this.get(r),{added:c,updated:e,removed:f,affected:h}=a.recursiveCaptureUpstreamVersions(this.timestamp);for(const m of c)this.add(m,"added");for(const m of e)this.add(m,"updated");for(const m of f)this.add(m,"removed");for(const m of h)this.add(m,"affected")})}async recursiveCaptureUpstreamVersionsAsync(i={}){if(this.lockedVersions)return;const r=Y.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds,...this.removedIds];for await(const c of a){const e=this.get(c),{added:f,updated:h,removed:m,affected:E}=e.recursiveCaptureUpstreamVersions(this.timestamp);for(const b of f)this.add(b,"added");for(const b of h)this.add(b,"updated");for(const b of m)this.add(b,"removed");for(const b of E)this.add(b,"affected");await r.tick()}}sanitize(){this.listAdded.forEach(i=>{i.previousVersion=null})}async sanitizeAsync(i={}){const r=Y.YieldTracker.from(i);for(const a of this.listAdded)a.previousVersion=null,await r.tick()}syncDependents(){return[...this.list,...this.listAffected].forEach(i=>{const r=this.project.get(i.id);!r||r.deleted||Ag(r,this.project)||r==null||r.syncDependents(this)}),this}async syncDependentsAsync(i={}){const r=Y.YieldTracker.from(i);for(const a of[...this.list,...this.listAffected]){const c=this.project.get(a.id);!c||c.deleted||Ag(c,this.project)||(c==null||c.syncDependents(this),await r.tick())}return this}async beforeCloseAsync(i={}){const r=Y.YieldTracker.from(i);await this.project.emitAsync(oi.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),await this.syncDependentsAsync({tracker:r}),await this.emitAsyncProjectSideEffects({tracker:r}),await this.project.emitAsync(oi.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}beforeClose(){this.project.emit(oi.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),this.syncDependents(),this.emitProjectSideEffects(),this.project.emit(oi.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}teardown(){this.destroy()}emitProjectSideEffects(){return x_e(this)}async emitAsyncProjectSideEffects(i={}){return $_e(this,i)}close(i={}){const r={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;if(this.startedClose||(this.startedClose=!0,this.beforeClose()),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],this.discardOrphans(),this.sanitize(),this.captureAllChangesInVersionInstances(),this.lockedVersions||(this.recursiveCaptureUpstreamVersions(),this.captureAllChangesInVersionInstances()),this.open=!1,this.isEmpty)return this.logger.warn(`[ChangeSet.close] Empty change-set (${this.id}) discarded upon closing.`),this.project.discardChangeSet(this),this.logger.log("[ChangeSet.close] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this;if(this.added[this.project.id]&&this.updatedIds.length)throw new Error("No 'updated' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(this.added[this.project.id]&&this.removedIds.length)throw new Error("No 'removed' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(!this.updated[this.project.id]&&!this.added[this.project.id])throw new Error("Change-set must also have the project entity as 'updated' or 'added'. All changes must propagate upstream until the root project entity.");return this.project.emit(oi.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),r.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this}addDependentsToAffected(i){Object.values(i.detachedDependents).forEach(r=>{const{entity:a,field:c}=r;this.has(a.id)||this.add(a,"affected")})}get(i){return this.added[i]?this.added[i]:this.updated[i]?this.updated[i]:this.removed[i]?this.removed[i]:null}remove(i){return this.has(i)&&(delete this.added[i],delete this.updated[i],delete this.removed[i],delete this.affected[i],this.seenEntities=this.seenEntities.filter(r=>r!==i)),this}add(i,r,a={preventRecursion:!1}){var e,f,h,m;if(!this.open||!this.dirty)return this;if(Ag(i,this.project))return this;if(this.seenEntities.indexOf(i.id)===-1&&this.seenEntities.push(i.id),r==="removed"){if(this.added[i.id])return delete this.added[i.id],delete this.affected[i.id],delete this.updated[i.id],this.seenEntities=this.seenEntities.filter(b=>b!==i.id),delete this.project.deletedInstances[i.id],this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasRemoved(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:_,affected:P}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const V of b)this.add(V,"added");for(const V of A)this.add(V,"updated");for(const V of _)this.add(V,"removed");for(const V of P)this.add(V,"affected")}i.captureVersion();const E=(e=i.knownVersions)==null?void 0:e.get(i.version);if(!E)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.removed[i.id]=E,this}if(r==="added"){if(this.removed[i.id])return this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasAdded(i.id)&&!this.lockedVersions&&!a.preventRecursion){const{added:b,updated:A,removed:_,affected:P}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const V of b)this.add(V,"added");for(const V of A)this.add(V,"updated");for(const V of _)this.add(V,"removed");for(const V of P)this.add(V,"affected")}i.previousVersion=null,i.captureVersion();const E=(f=i.knownVersions)==null?void 0:f.get(i.version);if(!E)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.added[i.id]=E,delete this.affected[i.id],this.addDependentsToAffected(i),this}if(r==="updated"){if(this.removed[i.id])return this;if(this.added[i.id])return i.captureVersion(),this.addDependentsToAffected(i),this;if(this.affected[i.id]&&delete this.affected[i.id],!this.hasUpdated(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:_,affected:P}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const V of b)this.add(V,"added");for(const V of A)this.add(V,"updated");for(const V of _)this.add(V,"removed");for(const V of P)this.add(V,"affected")}i.activeVersion=!0,i.captureVersion();const E=(h=i.knownVersions)==null?void 0:h.get(i.version);if(!E)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.updated[i.id]=E,this.addDependentsToAffected(i),this}if(r==="affected"){if(this.removed[i.id])return this;if(this.added[i.id])return this;if(this.updated[i.id])return this;if(this.affected[i.id]=i,!this.lockedVersions){const E=i.version+"--"+this.id,b=((m=i.knownVersions)==null?void 0:m.get(E))||i.snapshot();i.apply(b),i.knownVersions=i.knownVersions?i.knownVersions.set(E,b):new Map().set(E,b)}}return this}toJSON(){var f;const i={},r={},a={},c=new Set;for(const h of Object.values(this.added))i[h.id]=h.toShallowJSON();for(const h of Object.values(this.updated))r[h.id]=h.toShallowJSON();for(const h of Object.values(this.removed))a[h.id]=h.toShallowJSON();for(const h of Object.values(this.affected))c.add(h.id);const e=this.get(((f=this.self)==null?void 0:f.id)||"");return{added:i,updated:r,removed:a,affected:Array.from(c),self:e?e.toShallowJSON():null,seenEntities:this.seenEntities,actionName:this.actionName}}has(i){return!!this.added[i]||!!this.removed[i]||!!this.updated[i]||!!this.affected[i]}hasAdded(i){return!!this.added[i]}hasUpdated(i){return!!this.updated[i]}hasRemoved(i){return!!this.removed[i]}hasAffected(i){return!!this.affected[i]}}function dgi(s){return new Set([...Object.keys(s.added),...Object.keys(s.updated),...Object.keys(s.removed),...Array.from(s.affected)])}function P_(s,p,i){var f;const r=new Date().toISOString(),a=new S(i,x.sessionAuthor,r,i);if(a.lockedVersions=!0,s===p)throw Y.Logger.error("From: ",s),Y.Logger.error("To: ",p),new Error("Cannot generate transitional change set between the same two versions or change-sets");let c;if(s==="initial"?c=!0:p==="initial"?c=!1:B(s.timestamp).isBefore(B(p.timestamp))?c=!0:c=!1,Y.Logger.log("Transitioning from ",s==="initial"?"initial":s.index),Y.Logger.log("Transitioning to ",p==="initial"?"initial":p.index),Y.Logger.log("Is forward: ",c),c){const h=p,m=h.index,E=s==="initial"?0:s.index;Y.Logger.log("ownIndex: ",m),Y.Logger.log("startIndex: ",E),Y.Logger.log("CH ID: ",h.id);const b=m===E?[i.history[m]]:i.history.slice(E+1,m+1);if(b.sort((A,_)=>B(A.timestamp).isAfter(B(_.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");Y.Logger.log("REDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{N_(A,_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.version),P.addSelfToProject(a),a.timestamp=P.createdAt,a.add(P,W.Added,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.version),a.timestamp=P.createdAt,a.add(P,W.Updated,{preventRecursion:!0})},_=>{var k;const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.version),(k=P.removeFromParent)==null||k.call(P,a),P.unsubscribe(),P.unsubscribeFromDependencies(),i.subscribeDeletedInstance(P),a.timestamp=P.createdAt,a.add(P,W.Removed,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);const k=_.version+"--"+A.id;P.restoreVersion(k),a.timestamp=P.createdAt,a.add(P,W.Updated,{preventRecursion:!0})})})}else{const h=s,m=h.index,E=p==="initial"?0:p.index;Y.Logger.log("CH ID: ",h.id);const b=m===E?[i.history[m]]:i.history.slice(E+1,m+1);if(b.sort((A,_)=>B(_.timestamp).isAfter(B(A.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");Y.Logger.log("UNDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{N_(A,_=>{var k;const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);_.previousVersion&&(P.restoreVersion(_.previousVersion),(k=P.removeFromParent)==null||k.call(P,a),P.unsubscribe(),P.unsubscribeFromDependencies(),i.subscribeDeletedInstance(P)),a.timestamp=P.createdAt,a.add(P,W.Removed,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.previousVersion),a.timestamp=P.createdAt,a.add(P,W.Updated,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(_.previousVersion),P.addSelfToProject(a),a.timestamp=P.createdAt,a.add(P,W.Added,{preventRecursion:!0})},_=>{const P=i.instances[_.id]||i.deletedInstances[_.id];let V="";try{V=oe(_,i)}catch{}if(!P)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" doesn't have an 'activeVersion' set.`);if(!P.knownVersions)throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value.`);if(!P.knownVersions.get(_.version))throw new Error(`Entity ${_.type} ${V?`"${V}" `:""}with id "${_.id}" has an active version instance missing the 'knownVersions' property value for version "${_.version}".`);P.restoreVersion(P.version),a.timestamp=P.createdAt,a.add(P,W.Affected,{preventRecursion:!0})})})}let e;if(p==="initial"){const h=Array.from(((f=i.knownVersions)==null?void 0:f.values())||[]).reduce((m,E)=>!m||B(E.createdAt).isBefore(B(m.createdAt))?E:m,null);if(!h)throw new Error("No oldest version found");e=h.createdAt}else e=p.timestamp;return a.open=!1,{transitionalChangeSet:a,transitionTime:r,timeOfOriginalTargetChanges:e}}function N_(s,p,i,r,a){var h;if(!(s!=null&&s.self))throw new Error("Change set must have a valid `self` entity state to be traversed");const c=((h=s.self)==null?void 0:h.type)===d.Project?s.self:s.self.project,e=new Un(s.self,{allBuiltInEntityIds:c.diggestedBuiltInBaseEntitiesIds});Y.Logger.log("changeSet.added: ",Object.keys(s.added).length),Y.Logger.log("changeSet.updated: ",Object.keys(s.updated).length),Y.Logger.log("changeSet.removed: ",Object.keys(s.removed).length);const f={...s.added,...s.updated,...s.removed,...s.affected};e.order=Object.keys(f),e.flatRecord=f,e.orderEntities(),Y.Logger.log("All entities: ",e.order.map((m,E)=>`${E+1}: ${f[m].type} - ${m}`).join(`,
|
|
7
7
|
`)),Y.Logger.log("Traversing additions"),e.visit(async m=>{if(s.added[m.id])try{p(m)}catch(E){Y.Logger.error("Error: ",E)}}),Y.Logger.log("Traversing updates"),e.visit(async m=>{if(s.updated[m.id])try{i(m)}catch(E){Y.Logger.error("Error: ",E)}}),Y.Logger.log("Traversing removals"),e.visit(async(m,E)=>{if(s.removed[m.id])try{r(m)}catch(b){Y.Logger.error("Error: ",b)}}),Y.Logger.log("Traversing affected"),e.visit(async(m,E)=>{if(s.affected[m.id])try{a(m)}catch(b){Y.Logger.error("Error: ",b)}})}function x_(s,p,i){const r=s+1;return p.splice(r,p.length-r,i),p.length-1}function ugi(s){[...s.listUpdated,...s.listAdded].forEach(p=>{const i=s.project.get(p.id);i.editable=!0})}function pgi(s){[...s.listUpdated,...s.listAdded].forEach(p=>{const i=s.project.get(p.id);i.deletable=!0})}function cgi(s){[...s.listUpdated,...s.listAdded].forEach(p=>{const i=s.project.get(p.id);i.editable=!0,i.deletable=!0})}function fgi(s){[...s.listUpdated,...s.listAdded].forEach(p=>{const i=s.project.get(p.id);i.editable=!1})}function ygi(s){[...s.listUpdated,...s.listAdded].forEach(p=>{const i=s.project.get(p.id);i.deletable=!1})}function hgi(s){[...s.listUpdated,...s.listAdded].forEach(p=>{const i=s.project.get(p.id);i.editable=!1,i.deletable=!1})}function mgi(s,p){p?s.metaSync({editable:!1,deletable:!1},p):(s.editable=!1,s.deletable=!1),Ue(s,new Set,{ignoreBuiltInBaseEntities:!0}).forEach(r=>{p?r.metaSync({editable:!1,deletable:!1},p):(r.editable=!1,r.deletable=!1)})}function Tgi(s,p){p?s.metaSync({editable:!0,deletable:!0},p):(s.editable=!0,s.deletable=!0),Ue(s,new Set,{ignoreBuiltInBaseEntities:!0}).forEach(r=>{p?r.metaSync({editable:!0,deletable:!0},p):(r.editable=!0,r.deletable=!0)})}function vgi(s){const{projectRecord:p,chain:i,projectId:r,sort:a,order:c}=s,e=a?(i||[]).sort((E,b)=>{const A=E.updated[r],_=b.updated[r];return B(A.createdAt).valueOf()-B(_.createdAt).valueOf()}):i||[],f={...p};e.forEach(E=>{Object.values(E.removed).forEach(A=>{delete f[A.id]}),Object.values(E.added).forEach(A=>{f[A.id]=A}),Object.values(E.updated).forEach(A=>{f[A.id]=A});const b=E.updated[r];f[r]=b});let h=null;if(c){const E=new Un;E.flatRecord=f,E.orderEntities(),h=E.order}return{project:f[r],record:f,order:h}}class Lx{constructor(p){R(this,"version");R(this,"previousVersion");R(this,"createdAt");R(this,"deleted",!1);R(this,"author");this.version=p.version,this.previousVersion=p.previousVersion,this.createdAt=B(p.createdAt).toISOString(),this.deleted=p.deleted,this.author=p.author}baseMetaSync(p,i,r){this.deleted=p.deleted!==void 0?p.deleted:this.deleted}}class dn extends Lx{constructor(i){super(i);R(this,"deletable",!0);R(this,"editable",!0);this.deletable=i.deletable,this.editable=i.editable}checkCanEditWithCounterpartAndSideEffects(i,r,a,c){var e,f;return!this.checkCanEdit(i,c)||!this.checkCanEdit(r,c)?(this.checkCanEdit(r,c)?(Y.Logger.warn(`[${a}] User is not allowed to edit this ${i.type} entity with id: ${i.id}`),c==null||c.event({id:`${a}-${i.id}--${r.id}--${Be.ActionOwnerEntityNotEditable}`,action:a,owner:i,counterpart:r,errorReason:Be.ActionOwnerEntityNotEditable,rootAction:((f=c==null?void 0:c.self)==null?void 0:f.id)===i.id&&(c==null?void 0:c.actionName)===a})):(Y.Logger.warn(`[${a}] User is not allowed to edit this ${i.type} entity with id: ${i.id} because its counterpart ${r.type} with id: ${r.id} is not editable`),c==null||c.event({id:`${a}-${i.id}--${r.id}--${Be.ActionCounterpartEntityNotEditable}`,action:a,owner:i,counterpart:r,errorReason:Be.ActionCounterpartEntityNotEditable,rootAction:((e=c==null?void 0:c.self)==null?void 0:e.id)===i.id&&(c==null?void 0:c.actionName)===a})),c==null||c.attemptAutoclose(a,i.id),!1):!0}checkCanEditFromScopeOwner(i,r){const a=Ut(i,i.project);return a?this.checkCanEdit(a,r):!0}checkCanEditFromScopeOwnerWithSideEffects(i,r,a){var e;const c=this.checkCanEditFromScopeOwner(i,a);return!c&&!(a!=null&&a.ignoreNonEditable)&&(Y.Logger.warn(`[${r}] User is not allowed to edit this ${i.type} entity with id: ${i.id}`),a==null||a.event({id:`${r}-${i.id}--${Be.ActionOwnerEntityNotEditable}`,action:r,owner:i,errorReason:Be.ActionOwnerEntityNotEditable,rootAction:((e=a==null?void 0:a.self)==null?void 0:e.id)===i.id&&(a==null?void 0:a.actionName)===r}),a==null||a.attemptAutoclose(r,i.id)),c}checkCanEdit(i,r){var a;return(a=i.project)!=null&&a.initialized?i.type===d.BuiltInBaseEntity||i.type===d.PrimitiveEntity?!1:i.initialized?!(i.project.diggestedBuiltInBaseEntitiesIds.has(i.id)||i.parent&&!(this.checkCanEdit(i.parent,r)&&i.editable)&&!(r!=null&&r.ignoreNonEditable)||!i.editable&&!(r!=null&&r.ignoreNonEditable)):!0:!0}checkCanDelete(i,r){var a;return i.type!==d.Project&&i.project.diggestedBuiltInBaseEntitiesIds.has(i.id)?!1:i.type===d.Project||(a=i.parent)!=null&&a.deleted?!0:!(!i.deletable&&!(r!=null&&r.ignoreNonDeletable))}baseMetaSync(i,r,a){this.deletable=i.deletable!==void 0?i.deletable:this.deletable,this.editable=i.editable!==void 0?i.editable:this.editable;const c={...i,deleted:this.checkCanDelete(r,a)?i.deleted:!1};super.baseMetaSync(c,r,a)}}var B_e=(s=>(s.ArgumentDataTypeEntityField="data-type-entity-field",s.ArgumentDataTypeField="data-type-field",s.ArgumentImplementsField="argument-implements-field",s))(B_e||{});const Ei=class Ei extends dn{constructor(i,r){super(i);R(this,"initialData");R(this,"id");R(this,"name");R(this,"codeName",null);R(this,"description",null);R(this,"index");R(this,"required");R(this,"constant",!0);R(this,"type",d.ArgumentDeclaration);R(this,"defaultValue",null);R(this,"dataType",null);R(this,"writesValues",[]);R(this,"implements",[]);R(this,"project");R(this,"errors",[]);R(this,"parent");R(this,"detachedDependents",{});R(this,"knownVersions",null);R(this,"activeVersion",!1);R(this,"initialized",!1);R(this,"startedInitialization",!1);R(this,"suggestion",!1);R(this,"_codeNativeValueValidation",null);this.initialData=i,this.project=r,this.id=i.id,this.index=i.index,this.name=i.name,this.description=i.description,this.codeName=i.codeName,this.required=i.required,this.constant=!0}static new(i=null){return{id:x.UUID.uuid(),version:x.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||B().toISOString(),author:(i==null?void 0:i.author)||x.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.ArgumentDeclaration,name:"",codeName:null,description:"",index:0,required:!1,constant:!0,implements:[],dataType:null,defaultValue:null,writesValues:[],parent:null}}static fromGenerationTarget(i,r,a){const c=a===void 0?r.addChangeSet(new S(r,x.sessionAuthor,B().toISOString(),r,!0,w.CreateFromGenerationTarget)):a,e=te(i.parent),f=r.get(e),h={id:i.id,version:x.UUID.uuid(),createdAt:(c==null?void 0:c.timestamp)||B().toISOString(),author:(c==null?void 0:c.author)||x.sessionAuthor,previousVersion:null,deleted:!1,name:i.name,deletable:!0,editable:!0,type:d.ArgumentDeclaration,index:f.inputs.length,defaultValue:null,codeName:i.codeName||null,description:i.description||null,required:i.required??!1,constant:!0,implements:[],dataType:null,writesValues:[],parent:f.toReference()},m=ge(h,r);return m.hydrateAncestors(),m.setParent(f,c),m.addSelfToProject(c),c==null||c.add(m,W.Added),m.initChildren(c),c||m.captureVersion(),m}static validateGenerationTarget(i,r){let a=JSON.parse(JSON.stringify(i));const c=[],e=[],f=Bn(a,{parent:{list:!1,types:[d.FunctionDeclaration,d.Search,d.Condition]}},r);c.push(...f.explanations),a=f.modifiedData;const h=xx(a,r);if(a.parent){const E=r.get(te(a.parent));if(E&&kt.includes(E.type)){const b=E.implements;if(b){const A=b.inputs.find(G=>G.name===a.name),_=b.inputs.filter(G=>!E.inputs.find(ne=>ne.type===d.ArgumentDeclaration&&ne.name===G.name)),P=E.inputs.filter(G=>G.type===d.ArgumentDeclaration),V=P.find(G=>G.name===a.name),k=P.length?`The parent entity already implements the following arguments: ${vt(P.map(G=>`'${G.id}' (${G.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",M=_.length?`The parent entity is still missing the following arguments in the implementation: ${vt(_.map(G=>`'${G.id}' (${G.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";A?V&&e.push(new De({id:`${a.id}--${Ce.NoOverlapWithImplementedSignature}`,code:Ce.NoOverlapWithImplementedSignature,severity:Te.Error,message:`Entity of type '${d.ArgumentDeclaration}' with id '${a.id}' should not exist in a parent entity of type '${E.type}' with id '${E.id}' that implements a ${d.ActionDescriptor} with fixed arguments.
|
|
8
8
|
Adding a new argument would make the implementation invalid. An argument with the same name already exists in the parent entity.
|
|
9
9
|
${k}
|
package/dist/index.d.ts
CHANGED
|
@@ -21787,6 +21787,7 @@ export declare enum BaseValueDescriptorIds {
|
|
|
21787
21787
|
removed: Record<EntityId, UserManagedElementShallowTransfer>;
|
|
21788
21788
|
affected: EntityId[];
|
|
21789
21789
|
actionName?: StateMutationAction | string;
|
|
21790
|
+
self: EntityId;
|
|
21790
21791
|
}
|
|
21791
21792
|
|
|
21792
21793
|
export declare interface IChannelConnections {
|
|
@@ -33512,9 +33513,13 @@ export declare enum BaseValueDescriptorIds {
|
|
|
33512
33513
|
ChangeSearchDescription = "changed-search-description",
|
|
33513
33514
|
ChangeSearchQuery = "changed-search-query",
|
|
33514
33515
|
MakeValueDescriptorRequired = "make-value-descriptor-required",
|
|
33516
|
+
MakeSearchInputRequired = "make-search-input-required",
|
|
33515
33517
|
MakeValueDescriptorNonRequired = "make-value-descriptor-non-required",
|
|
33518
|
+
MakeSearchInputNonRequired = "make-search-input-non-required",
|
|
33516
33519
|
RenameValueDescriptor = "rename-value-descriptor",
|
|
33520
|
+
RenameSearchInput = "rename-search-input",
|
|
33517
33521
|
ChangeValueDescriptorDescription = "changed-value-descriptor-description",
|
|
33522
|
+
ChangeSearchInputDescription = "changed-search-input-description",
|
|
33518
33523
|
ChangeValueDescriptorDataType = "change-value-descriptor-data-type",
|
|
33519
33524
|
RecalculateVarDecl = "recalculate-variable-declaration",
|
|
33520
33525
|
MakeVarDeclConstant = "make-variable-declaration-constant",
|