@elyx-code/project-logic-tree 0.0.6432 → 0.0.6434

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.d.ts CHANGED
@@ -2124,8 +2124,8 @@ export declare class ConditionState extends VersionedState implements ICondition
2124
2124
  getErrors(): EntityError[];
2125
2125
  getShallowErrors(): EntityError[];
2126
2126
  clone(changeSet?: ChangeSet | null, parent?: EntryPointEntityState | ProjectState | ConditionState | null, newId?: string | null, subscribe?: boolean): ConditionState;
2127
- addToAndGroup(child: ConditionState): ConditionState;
2128
- addToOrGroup(child: ConditionState): ConditionState;
2127
+ addToAndGroup(child: ConditionState, changeSet?: ChangeSet | null): ConditionState;
2128
+ addToOrGroup(child: ConditionState, changeSet?: ChangeSet | null): ConditionState;
2129
2129
  removeUnrecognizedInputs(changeSet?: ChangeSet | null): IChangeSet<ConditionState>;
2130
2130
  syncInputs(changeSet?: ChangeSet | null): IChangeSet<ConditionState>;
2131
2131
  getUnusedInputs(): ActionInputMapState[];
@@ -2587,8 +2587,8 @@ export declare class DataTypeState extends VersionedState implements IDataType,
2587
2587
  getShallowErrors(): EntityError[];
2588
2588
  clone(changeSet?: ChangeSet | null, parent?: PropertyState | VariableDeclarationState | ArgumentDeclarationState | ReturnDeclarationState | ValueDescriptorState | InputMapState | OutputMapState | DataTypeState | null, newId?: string | null, subscribe?: boolean): DataTypeState;
2589
2589
  merge(sourceEntity: DataTypeState, changeSet?: ChangeSet | null): IChangeSet<DataTypeState>;
2590
- addToAndGroup(child: DataTypeState): DataTypeState;
2591
- addToOrGroup(child: DataTypeState): DataTypeState;
2590
+ addToAndGroup(child: DataTypeState, changeSet?: ChangeSet | null): DataTypeState;
2591
+ addToOrGroup(child: DataTypeState, changeSet?: ChangeSet | null): DataTypeState;
2592
2592
  setEntity(entity: DefinitionEntityState | PrimitiveEntityState | ActionDescriptorState | BuiltInBaseEntityState | LiteralValueState | null, changeSet?: ChangeSet | null): DataTypeState;
2593
2593
  isObject(): boolean;
2594
2594
  canBeObject(): boolean;
package/dist/index.js CHANGED
@@ -35275,21 +35275,38 @@ Alternatively you can update the entity with 'update' action. Or replace it by f
35275
35275
  "update-with-shallow-transfer"
35276
35276
  )
35277
35277
  )) {
35278
+ var o, p;
35278
35279
  if (this.metaSync(i, a), this.version = i.version, this.createdAt = i.createdAt, this.author = i.author, this.deleted = i.deleted, this.previousVersion = i.previousVersion, this.unsubscribeFromDependencies(), i.parent) {
35279
- const o = Z(i.parent), p = this.project.get(o), e = this.parent;
35280
- if (e && e.id !== (p == null ? void 0 : p.id) && this.removeFromParent(a), p)
35281
- this.setParent(p, a);
35280
+ const e = Z(i.parent), y = this.project.get(e), v = this.parent;
35281
+ if (v && v.id !== (y == null ? void 0 : y.id) && this.removeFromParent(a), y)
35282
+ this.setParent(y, a), this.addSelfToProject(a);
35282
35283
  else
35283
35284
  throw a == null || a.attemptAutoclose("update-with-shallow-transfer", this.id), new Error(
35284
- `${this.type} with id '${this.id}' has a 'parent' reference '${o}' that isn't found in the project`
35285
+ `${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`
35285
35286
  );
35286
35287
  } else
35287
35288
  throw a == null || a.attemptAutoclose("update-with-shallow-transfer", this.id), new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
35288
35289
  if (i.entity) {
35289
- const o = Z(i.entity), p = this.project.get(o);
35290
- p && (p.type === f.DefinitionEntity && p.parent === this || this.setEntity(p, null));
35290
+ const e = Z(i.entity), y = this.project.get(e);
35291
+ y && (y.type === f.DefinitionEntity && y.parent === this || this.setEntity(y, null));
35291
35292
  }
35292
- return this.captureVersion(), this.subscribeToDependencies(), a == null || a.attemptAutoclose("update-with-shallow-transfer", this.id), this;
35293
+ return (o = i.andChildrenGroup) == null || o.forEach((e) => {
35294
+ const y = Z(e), v = this.project.get(y);
35295
+ v && (this.addToAndGroup(v, a), v.setParent(this, a));
35296
+ }), [...this.andChildrenGroup || []].forEach((e) => {
35297
+ var v;
35298
+ ((v = i.andChildrenGroup) == null ? void 0 : v.find(
35299
+ (E) => Z(E) === e.id
35300
+ )) || (this.removeChildGroup(e, a), e.removeFromParent(a));
35301
+ }), (p = i.orChildrenGroup) == null || p.forEach((e) => {
35302
+ const y = Z(e), v = this.project.get(y);
35303
+ v && (this.addToOrGroup(v, a), v.setParent(this, a));
35304
+ }), [...this.orChildrenGroup || []].forEach((e) => {
35305
+ var v;
35306
+ ((v = i.orChildrenGroup) == null ? void 0 : v.find(
35307
+ (E) => Z(E) === e.id
35308
+ )) || (this.removeChildGroup(e, a), e.removeFromParent(a));
35309
+ }), this.captureVersion(), this.subscribeToDependencies(), a == null || a.attemptAutoclose("update-with-shallow-transfer", this.id), this;
35293
35310
  }
35294
35311
  hydrateAncestors() {
35295
35312
  const i = [], a = [], o = [], p = [];
@@ -35354,7 +35371,7 @@ Alternatively you can update the entity with 'update' action. Or replace it by f
35354
35371
  )
35355
35372
  )) {
35356
35373
  const a = [this], o = [], p = [], e = [];
35357
- return this.parent.type === f.DataType ? this.parentRelationType === wi.AndDataTypeGroup ? this.parent.addToAndGroup(this) : this.parentRelationType === wi.OrDataTypeGroup && this.parent.addToOrGroup(this) : this.parent.setDataType(this, i), e.push(this.parent), this.subscribe(), this.subscribeToDependencies(), i == null || i.attemptAutoclose("add-self-to-project", this.id), {
35374
+ return this.parent.type === f.DataType ? this.parentRelationType === wi.AndDataTypeGroup ? this.parent.addToAndGroup(this, i) : this.parentRelationType === wi.OrDataTypeGroup && this.parent.addToOrGroup(this, i) : this.parent.setDataType(this, i), e.push(this.parent), this.subscribe(), this.subscribeToDependencies(), i == null || i.attemptAutoclose("add-self-to-project", this.id), {
35358
35375
  updated: _(a),
35359
35376
  added: _(o),
35360
35377
  removed: _(p),
@@ -36030,12 +36047,30 @@ Alternatively you can update the entity with 'update' action. Or replace it by f
36030
36047
  };
36031
36048
  }
36032
36049
  // Add a child to the 'and' group
36033
- addToAndGroup(i) {
36034
- return this.andChildrenGroup || (this.andChildrenGroup = []), this.andChildrenGroup.includes(i) || this.andChildrenGroup.push(i), this;
36050
+ addToAndGroup(i, a = this.project.addChangeSet(
36051
+ new j(
36052
+ this.project,
36053
+ P.sessionAuthor,
36054
+ N().toISOString(),
36055
+ this,
36056
+ !0,
36057
+ "add-to-and-group"
36058
+ )
36059
+ )) {
36060
+ return this.andChildrenGroup || (this.andChildrenGroup = []), this.andChildrenGroup.includes(i) || (this.andChildrenGroup.push(i), a == null || a.add(i, F.Affected)), a == null || a.attemptAutoclose("add-to-and-group", this.id), this;
36035
36061
  }
36036
36062
  // Add a child to the 'or' group
36037
- addToOrGroup(i) {
36038
- return this.orChildrenGroup || (this.orChildrenGroup = []), this.orChildrenGroup.includes(i) || this.orChildrenGroup.push(i), this;
36063
+ addToOrGroup(i, a = this.project.addChangeSet(
36064
+ new j(
36065
+ this.project,
36066
+ P.sessionAuthor,
36067
+ N().toISOString(),
36068
+ this,
36069
+ !0,
36070
+ "add-to-or-group"
36071
+ )
36072
+ )) {
36073
+ return this.orChildrenGroup || (this.orChildrenGroup = []), this.orChildrenGroup.includes(i) || (this.orChildrenGroup.push(i), a == null || a.add(i, F.Affected)), a == null || a.attemptAutoclose("add-to-or-group", this.id), this;
36039
36074
  }
36040
36075
  setEntity(i, a = this.project.addChangeSet(
36041
36076
  new j(
@@ -47466,49 +47501,66 @@ If an entity is called by another, they must be in the same scope, which means t
47466
47501
  "update-with-shallow-transfer"
47467
47502
  )
47468
47503
  )) {
47504
+ var o, p;
47469
47505
  if (this.metaSync(i, a), this.version = i.version, this.createdAt = i.createdAt, this.author = i.author, this.deleted = i.deleted, this.previousVersion = i.previousVersion, i.parent) {
47470
- const o = Z(i.parent), p = this.project.get(o), e = this.parent;
47471
- if (e && e.id !== (p == null ? void 0 : p.id) && this.removeFromParent(a), p)
47472
- this.setParent(p, a);
47506
+ const e = Z(i.parent), y = this.project.get(e), v = this.parent;
47507
+ if (v && v.id !== (y == null ? void 0 : y.id) && this.removeFromParent(a), y)
47508
+ this.setParent(y, a), this.addSelfToProject(a);
47473
47509
  else
47474
47510
  throw a == null || a.attemptAutoclose("update-with-shallow-transfer", this.id), new Error(
47475
- `${this.type} with id '${this.id}' has a 'parent' reference '${o}' that isn't found in the project`
47511
+ `${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`
47476
47512
  );
47477
47513
  } else
47478
47514
  throw a == null || a.attemptAutoclose("update-with-shallow-transfer", this.id), new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
47479
47515
  if (i.declaration) {
47480
- const o = Z(
47516
+ const e = Z(
47481
47517
  i.declaration
47482
- ), p = this.project.get(
47483
- o
47518
+ ), y = this.project.get(
47519
+ e
47484
47520
  );
47485
- p && this.setDeclaration(p);
47521
+ y && this.setDeclaration(y);
47486
47522
  }
47487
- return i.calledByEntry.forEach((o) => {
47488
- const p = Z(o), e = this.project.get(p);
47489
- e && (this.addEntryCaller(e, a), e.addCall(this, a));
47490
- }), [...this.calledByEntry].forEach((o) => {
47523
+ return (o = i.andChildrenGroup) == null || o.forEach((e) => {
47524
+ const y = Z(e), v = this.project.get(y);
47525
+ v && (this.addToAndGroup(v, a), v.setParent(this, a));
47526
+ }), [...this.andChildrenGroup || []].forEach((e) => {
47527
+ var v;
47528
+ ((v = i.andChildrenGroup) == null ? void 0 : v.find(
47529
+ (E) => Z(E) === e.id
47530
+ )) || (this.removeChildGroup(e, a), e.removeFromParent(a));
47531
+ }), (p = i.orChildrenGroup) == null || p.forEach((e) => {
47532
+ const y = Z(e), v = this.project.get(y);
47533
+ v && (this.addToOrGroup(v, a), v.setParent(this, a));
47534
+ }), [...this.orChildrenGroup || []].forEach((e) => {
47535
+ var v;
47536
+ ((v = i.orChildrenGroup) == null ? void 0 : v.find(
47537
+ (E) => Z(E) === e.id
47538
+ )) || (this.removeChildGroup(e, a), e.removeFromParent(a));
47539
+ }), i.calledByEntry.forEach((e) => {
47540
+ const y = Z(e), v = this.project.get(y);
47541
+ v && (this.addEntryCaller(v, a), v.addCall(this, a));
47542
+ }), [...this.calledByEntry].forEach((e) => {
47491
47543
  i.calledByEntry.find(
47492
- (e) => Z(e) === o.id
47493
- ) || (this.removeCaller(o, a), o.removeCall(this, a));
47494
- }), i.calledBySuccess.forEach((o) => {
47495
- const p = Z(o), e = this.project.get(
47496
- p
47544
+ (v) => Z(v) === e.id
47545
+ ) || (this.removeCaller(e, a), e.removeCall(this, a));
47546
+ }), i.calledBySuccess.forEach((e) => {
47547
+ const y = Z(e), v = this.project.get(
47548
+ y
47497
47549
  );
47498
- e && (this.addSuccessCaller(e, a), e.addSuccessCall(this, a));
47499
- }), [...this.calledBySuccess].forEach((o) => {
47550
+ v && (this.addSuccessCaller(v, a), v.addSuccessCall(this, a));
47551
+ }), [...this.calledBySuccess].forEach((e) => {
47500
47552
  i.calledBySuccess.find(
47501
- (e) => Z(e) === o.id
47502
- ) || (this.removeCaller(o, a), o.removeCall(this, a));
47503
- }), i.calledByError.forEach((o) => {
47504
- const p = Z(o), e = this.project.get(
47505
- p
47553
+ (v) => Z(v) === e.id
47554
+ ) || (this.removeCaller(e, a), e.removeCall(this, a));
47555
+ }), i.calledByError.forEach((e) => {
47556
+ const y = Z(e), v = this.project.get(
47557
+ y
47506
47558
  );
47507
- e && (this.addErrorCaller(e, a), e.addErrorCall(this, a));
47508
- }), [...this.calledBySuccess].forEach((o) => {
47559
+ v && (this.addErrorCaller(v, a), v.addErrorCall(this, a));
47560
+ }), [...this.calledBySuccess].forEach((e) => {
47509
47561
  i.calledBySuccess.find(
47510
- (e) => Z(e) === o.id
47511
- ) || (this.removeCaller(o, a), o.removeCall(this, a));
47562
+ (v) => Z(v) === e.id
47563
+ ) || (this.removeCaller(e, a), e.removeCall(this, a));
47512
47564
  }), this.captureVersion(), this.subscribeToDependencies(), a == null || a.attemptAutoclose("update-with-shallow-transfer", this.id), this;
47513
47565
  }
47514
47566
  hydrateAncestors() {
@@ -47595,7 +47647,7 @@ If an entity is called by another, they must be in the same scope, which means t
47595
47647
  )
47596
47648
  )) {
47597
47649
  const a = [this], o = [], p = [], e = [];
47598
- return this.parent === this.project ? this.project.addCondition(this) : this.parent.type === f.Condition && (this.parent.declaration.id === Br.And ? this.parent.addToAndGroup(this) : this.parent.declaration.id === Br.Or && this.parent.addToOrGroup(this)), this.successCalls.forEach((y) => {
47650
+ return this.parent === this.project ? this.project.addCondition(this) : this.parent.type === f.Condition && (this.parent.declaration.id === Br.And ? this.parent.addToAndGroup(this, i) : this.parent.declaration.id === Br.Or && this.parent.addToOrGroup(this, i)), this.successCalls.forEach((y) => {
47599
47651
  y.addSuccessCaller(this, i), a.push(y);
47600
47652
  }), this.errorCalls.forEach((y) => {
47601
47653
  y.addErrorCaller(this, i), a.push(y);
@@ -48363,12 +48415,30 @@ If an entity is called by another, they must be in the same scope, which means t
48363
48415
  return A.inputs = x, i == null || i.attemptAutoclose("clone-entity", this.id), A;
48364
48416
  }
48365
48417
  // Add a child to the 'and' group
48366
- addToAndGroup(i) {
48367
- return this.andChildrenGroup || (this.andChildrenGroup = []), this.andChildrenGroup.includes(i) || this.andChildrenGroup.push(i), this;
48418
+ addToAndGroup(i, a = this.project.addChangeSet(
48419
+ new j(
48420
+ this.project,
48421
+ P.sessionAuthor,
48422
+ N().toISOString(),
48423
+ this,
48424
+ !0,
48425
+ "add-to-and-group"
48426
+ )
48427
+ )) {
48428
+ return this.andChildrenGroup || (this.andChildrenGroup = []), this.andChildrenGroup.includes(i) || (this.andChildrenGroup.push(i), a == null || a.add(i, F.Affected)), a == null || a.attemptAutoclose("add-to-and-group", this.id), this;
48368
48429
  }
48369
48430
  // Add a child to the 'or' group
48370
- addToOrGroup(i) {
48371
- return this.orChildrenGroup || (this.orChildrenGroup = []), this.orChildrenGroup.includes(i) || this.orChildrenGroup.push(i), this;
48431
+ addToOrGroup(i, a = this.project.addChangeSet(
48432
+ new j(
48433
+ this.project,
48434
+ P.sessionAuthor,
48435
+ N().toISOString(),
48436
+ this,
48437
+ !0,
48438
+ "add-to-or-group"
48439
+ )
48440
+ )) {
48441
+ return this.orChildrenGroup || (this.orChildrenGroup = []), this.orChildrenGroup.includes(i) || (this.orChildrenGroup.push(i), a == null || a.add(i, F.Affected)), a == null || a.attemptAutoclose("add-to-or-group", this.id), this;
48372
48442
  }
48373
48443
  removeUnrecognizedInputs(i = this.project.addChangeSet(
48374
48444
  new j(