@elyx-code/project-logic-tree 0.0.6270 → 0.0.6271

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.
@@ -1,4 +1,5 @@
1
- import { ActionDescriptorState, DefinitionEntityState, DataTypeState, InputMapState, OperationState, OutputMapState, ProjectState, IChangeSet, ChangeSet } from '../../../state';
1
+ import { ActionDescriptorState, DefinitionEntityState, DataTypeState, InputMapState, OperationState, OutputMapState, ProjectState } from '../../../state';
2
+ import { IChangeSet, ChangeSet } from '../../../state/change-set';
2
3
 
3
4
  export declare class ValidateDataOperation extends ActionDescriptorState {
4
5
  readonly autoexecutable = true;
@@ -1,6 +1,6 @@
1
- import { EntityId, EntityType, UserManagedElementShallowTransfer } from '../../definitions';
2
- import { UserManagedEntityState } from './types';
3
- import { ProjectState } from './project';
1
+ import { EntityId, EntityType, UserManagedElementShallowTransfer } from '../../../definitions';
2
+ import { UserManagedEntityState } from '../types';
3
+ import { ProjectState } from '../project';
4
4
 
5
5
  export interface IChangeSet<TSelf extends {
6
6
  id: string;
@@ -75,6 +75,8 @@ export declare class ChangeSet {
75
75
  attemptAutoclose(knownAutoCloseActionName: string, closingEntityId: EntityId): ChangeSet;
76
76
  recursiveCaptureUpstreamVersions(): void;
77
77
  sanitize(): void;
78
+ beforeClose(): void;
79
+ emitSideEffects(): void;
78
80
  close(): ChangeSet;
79
81
  addDependentsToAffected(entity: UserManagedEntityState): void;
80
82
  get(entityId: EntityId): UserManagedEntityState | null;
@@ -0,0 +1,3 @@
1
+ import { ChangeSet } from '.';
2
+
3
+ export declare function emitSideEffects(changeSet: ChangeSet): ChangeSet;
@@ -1,4 +1,4 @@
1
- import { EntityId, EntityType, IProject, IDefinitionEntity, IFunctionDeclaration, IGlobalEvent, Element, IProjectTransfer, IGenericReference, ElementTransfer, Reference, IProjectReference, IFunctionCallTransfer, IDefinitionEntityTransfer, IFunctionDeclarationTransfer, IInstalledProjectTransfer, IVariableDeclarationTransfer, IProjectShallowTransfer, ElementShallowTransfer, ElementGenerationTarget, IProjectGenerationTarget, IConditionTransfer, IOperationTransfer, ProjectTypesUnion, EntityVersion, IProject_meta } from '../../../definitions';
1
+ import { EntityId, EntityType, IProject, IDefinitionEntity, IFunctionDeclaration, IGlobalEvent, Element, IProjectTransfer, IGenericReference, ElementTransfer, Reference, IProjectReference, IFunctionDeclarationTransfer, IProjectShallowTransfer, ElementShallowTransfer, ElementGenerationTarget, IProjectGenerationTarget, ProjectTypesUnion, EntityVersion, IProject_meta } from '../../../definitions';
2
2
  import { ZodError } from 'zod';
3
3
  import { BaseState, IEntityPersistanceOptions, IEditableEntityPersistanceRepository, UserManagedEntityStateTemplate, IEntityJSONCloneOptions, IEntityRecursionOptions } from '../base';
4
4
  import { FunctionDeclarationState } from '../function-declaration';
@@ -9,7 +9,11 @@ import { VariableDeclarationState } from '../variable-declaration';
9
9
  import { ConditionState } from '../condition';
10
10
  import { FunctionCallState } from '../function-call';
11
11
  import { OperationState } from '../operation';
12
- import { ChangeSet, DataTypeState, EntityState, EntryPointEntityState, IChangeSet, LiteralValueState, PrimitiveEntityState, VariableState } from '..';
12
+ import { PrimitiveEntityState } from '../primitive-entity';
13
+ import { DataTypeState } from '../data-type';
14
+ import { LiteralValueState } from '../literal-value';
15
+ import { EntityState, EntryPointEntityState, VariableState, EntityWithValueState, IModuleInjection, TerminationState, UserManagedEntityState } from '../types';
16
+ import { ChangeSet, IChangeSet } from '../change-set';
13
17
  import { LoopState } from '../loop';
14
18
  import { SearchState } from '../search';
15
19
  import { VariableInstanceState } from '../variable-instance';
@@ -17,7 +21,6 @@ import { BuiltInBaseEntityState } from '../built-in-base-entity';
17
21
  import { EntityError, EntityGenerationError } from '../error';
18
22
  import { ActionDescriptorState } from '../action-descriptor';
19
23
  import { ValueDescriptorState } from '../value-descriptor';
20
- import { EntityWithValueState, IModuleInjection, TerminationState, UserManagedEntityState } from '../types';
21
24
  import { VersionedState } from '../version';
22
25
  import { Events } from '../../../events';
23
26
 
@@ -27,7 +30,15 @@ export interface UUIDModule {
27
30
  fromUUID: (uuid: string) => string;
28
31
  }
29
32
  export declare enum ProjectStateEvents {
30
- REQUEST_ACTIVE_VALUE = "request-active-value"
33
+ DEFINITION_ENTITY_ADDED = "definition-entity-added",
34
+ DEFINITION_ENTITY_REMOVED = "definition-entity-removed",
35
+ DEFINITION_ENTITY_UPDATED = "definition-entity-updated",
36
+ PERSISTED_DEFINITION_ENTITY_ADDED = "persisted-definition-entity-added",
37
+ PERSISTED_DEFINITION_ENTITY_REMOVED = "persisted-definition-entity-removed",
38
+ PERSISTED_DEFINITION_ENTITY_UPDATED = "persisted-definition-entity-updated",
39
+ RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED = "relational-database-definition-entity-added",
40
+ RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED = "relational-database-definition-entity-removed",
41
+ RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED = "relational-database-definition-entity-updated"
31
42
  }
32
43
  declare class CombinedVersionedEvents extends VersionedState {
33
44
  constructor(...args: ConstructorParameters<typeof VersionedState>);
@@ -216,27 +227,17 @@ export declare class ProjectState extends CombinedVersionedEvents implements IPr
216
227
  getShallowErrors(): EntityError[];
217
228
  clone(): ProjectState;
218
229
  getDefinitionEntity(id: EntityId): DefinitionEntityState | null;
219
- addDefinitionEntityFromTransfer(entity: IDefinitionEntityTransfer): DefinitionEntityState;
220
230
  addDefinitionEntity(entity: DefinitionEntityState): DefinitionEntityState;
221
231
  addFunctionDeclarationFromTransfer(func: IFunctionDeclarationTransfer): FunctionDeclarationState;
222
232
  addFunctionDeclaration(func: FunctionDeclarationState): FunctionDeclarationState;
223
- addFunctionCallFromTransfer(func: IFunctionCallTransfer): FunctionCallState;
224
233
  addFunctionCall(func: FunctionCallState): FunctionCallState;
225
- addVariableDeclarationFromTransfer(variable: IVariableDeclarationTransfer): VariableDeclarationState;
226
234
  addVariableDeclaration(variable: VariableDeclarationState): VariableDeclarationState;
227
- addVariableInstanceFromTransfer(variable: IVariableDeclarationTransfer): VariableInstanceState;
228
235
  addVariableInstance(variable: VariableInstanceState): VariableInstanceState;
229
- addInstalledProjectFromTransfer(project: IInstalledProjectTransfer): ProjectState;
230
236
  addInstalledProject(project: InstalledProjectState): ProjectState;
231
- addGlobalEventFromTransfer(event: IGlobalEvent): ProjectState;
232
237
  addGlobalEvent(event: GlobalEventState): ProjectState;
233
- addConditionFromTransfer(condition: IConditionTransfer): ProjectState;
234
238
  addCondition(condition: ConditionState): ProjectState;
235
- addOperationFromTransfer(operation: IOperationTransfer): ProjectState;
236
239
  addOperation(operation: OperationState): ProjectState;
237
- addLoopFromTransfer(loop: LoopState): ProjectState;
238
240
  addLoop(loop: LoopState): ProjectState;
239
- addSearchFromTransfer(search: IConditionTransfer): ProjectState;
240
241
  addSearch(search: SearchState): ProjectState;
241
242
  removeDefinitionEntity(entity: IDefinitionEntity): DefinitionEntityState | null;
242
243
  removeFunctionDeclaration(func: IFunctionDeclaration): FunctionDeclarationState | null;
@@ -9,6 +9,7 @@ import { EntityError, EntityGenerationError } from '../../state/error';
9
9
  import { ValueDescriptorState } from '../value-descriptor';
10
10
  import { VersionedState } from '../version';
11
11
  import { ChangeSet, IChangeSet } from '../change-set';
12
+ import { DefinitionEntityState } from '../definition-entity';
12
13
 
13
14
  export declare enum SearchDependencyField {
14
15
  Parent = "parent"
@@ -68,6 +69,10 @@ export declare class SearchState extends VersionedState implements ISearch, Base
68
69
  modifiedData: ISearchGenerationTarget;
69
70
  };
70
71
  get resultsAsList(): boolean;
72
+ onPersistedEntityAdded(_newEntity: DefinitionEntityState, changeSet?: ChangeSet | null): SearchState;
73
+ onPersistedEntityRemoved(_removedEntity: DefinitionEntityState, changeSet?: ChangeSet | null): SearchState;
74
+ onRelationalDatabaseEntityAdded(_newEntity: DefinitionEntityState, changeSet?: ChangeSet | null): SearchState;
75
+ onRelationalDatabaseEntityRemoved(_removedEntity: DefinitionEntityState, changeSet?: ChangeSet | null): SearchState;
71
76
  validateGeneratedUpdate(data: Partial<ISearchGenerationTarget>): {
72
77
  errors: EntityGenerationError[];
73
78
  modifiedData: Partial<ISearchGenerationTarget>;
@@ -1,5 +1,6 @@
1
1
  import { BaseEntityNames, ElementGenerationTarget, ElementShallowTransfer, ElementTransfer, EntityType, Element, IGenericReference, EntityId, ValueReadingEntity, IActionDescriptor, IActionDescriptorTransfer, IArgumentDeclaration, IArgumentDeclarationTransfer, DraggableElement, Reference, IBreakStatement, IBreakStatementTransfer, IBuiltInBaseEntity, IBuiltInBaseEntityTransfer, ICondition, IConditionTransfer, IContinueStatement, IContinueStatementTransfer, CallableEntity, CallableEntityTransfer, CallerEntity, CallerEntityTransfer, IDefinitionEntity, IDefinitionEntityTransfer, IDataType, IDataTypeTransfer, IFunctionCall, IFunctionCallTransfer, IFunctionDeclaration, IFunctionDeclarationTransfer, IGlobalEvent, IGlobalEventTransfer, IInputMap, IInputMapTransfer, IInstalledProject, IInstalledProjectTransfer, IInternalCall, IInternalCallTransfer, ILiteralValue, ILiteralValueTransfer, ILoop, ILoopTransfer, IOperation, IOperationTransfer, IOutputMap, IOutputMapTransfer, IPrimitiveEntity, IPrimitiveEntityTransfer, IProject, IProjectTransfer, IProperty, IPropertyTransfer, IReturnDeclaration, IReturnDeclarationTransfer, IReturnStatement, IReturnStatementTransfer, ISearch, ISearchTransfer, IValueDescriptor, IValueDescriptorTransfer, IVariableDeclarationTransfer, IVariableDeclaration, IVariableInstance, IVariableInstanceTransfer, DraggableElementTransfer, ValueReadingEntityTransfer, IActionDescriptorShallowTransfer, IDataTypeShallowTransfer, IDefinitionEntityShallowTransfer, IFunctionDeclarationShallowTransfer, IInstalledProjectShallowTransfer, ILoopShallowTransfer, IOperationShallowTransfer, ILiteralValueShallowTransfer, IPrimitiveEntityShallowTransfer, IProjectShallowTransfer, IPropertyShallowTransfer, IReturnDeclarationShallowTransfer, IReturnStatementShallowTransfer, ISearchShallowTransfer, IValueDescriptorShallowTransfer, IVariableDeclarationShallowTransfer, IVariableInstanceShallowTransfer, IFunctionCallShallowTransfer, IGlobalEventShallowTransfer, IInputMapShallowTransfer, IInternalCallShallowTransfer, CallableEntityShallowTransfer, IOutputMapShallowTransfer, IConditionShallowTransfer, IContinueStatementShallowTransfer, IBreakStatementShallowTransfer, IArgumentDeclarationShallowTransfer, IBuiltInBaseEntityShallowTransfer, DraggableElementShallowTransfer } from '../../definitions';
2
- import { DraggableCallableEntityState, CanvasEntityState, EntityState, EntityWithLogicScopeState, EntryPointEntityState, DraggableExecutableEntityState, DraggablePassThroughCallableEntityState, ValueReadingEntityState, ValueWritingEntityState, EntityWithValueState, VariableState, BuiltInBaseEntityState, TerminationState, ExecutableEntityState, ValueDescriptorState, CallableEntityState, CallerEntityState, PassThroughCallableEntityState, PrimitiveEntityState, InternalCallState, IChangeSet, IRecordChangeSet, ChangeSet } from '../state';
2
+ import { DraggableCallableEntityState, CanvasEntityState, EntityState, EntityWithLogicScopeState, EntryPointEntityState, DraggableExecutableEntityState, DraggablePassThroughCallableEntityState, ValueReadingEntityState, ValueWritingEntityState, EntityWithValueState, VariableState, BuiltInBaseEntityState, TerminationState, ExecutableEntityState, ValueDescriptorState, CallableEntityState, CallerEntityState, PassThroughCallableEntityState, PrimitiveEntityState, InternalCallState } from '../state';
3
+ import { IChangeSet, IRecordChangeSet, ChangeSet } from '../state/change-set';
3
4
  import { FunctionCallState } from '../state/function-call';
4
5
  import { InputMapState } from '../state/input-map';
5
6
  import { VariableDeclarationState } from '../state/variable-declaration';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyx-code/project-logic-tree",
3
- "version": "0.0.6270",
3
+ "version": "0.0.6271",
4
4
  "author": "Sergio Herrero",
5
5
  "license": "UNLICENSED",
6
6
  "description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",