@elyx-code/project-logic-tree 0.0.6158 → 0.0.6160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1242 -1170
- package/dist/index.umd.cjs +74 -74
- package/dist/tree/state/base.d.ts +6 -6
- package/dist/tree/state/types/index.d.ts +21 -4
- package/dist/tree/utils/index.d.ts +10 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EntityId, EntityType, EntityVersion, IGenericBase, Element, ElementTransfer, IGenericReference, ElementShallowTransfer, ElementGenerationTarget, Reference } from '../../definitions';
|
|
2
2
|
import { ZodError } from 'zod';
|
|
3
|
-
import { CallableEntityState, CallerEntityState, CanvasEntityState, EntityState, IChangeSet, InputMapState, ValueReadingEntityState, ValueWritingEntityState } from '.';
|
|
3
|
+
import { CallableEntityState, CallerEntityState, CanvasEntityState, EntityState, IChangeSet, InputMapState, UserManagedEntityState, ValueReadingEntityState, ValueWritingEntityState } from '.';
|
|
4
4
|
import { ProjectState } from './project/project';
|
|
5
5
|
import { EntityError } from './error';
|
|
6
6
|
import { LiteralValueState } from './literal-value';
|
|
@@ -58,11 +58,11 @@ export declare abstract class UserManagedEntityStateFunctionality {
|
|
|
58
58
|
abstract knownVersions: Map<EntityVersion, EntityState> | null;
|
|
59
59
|
abstract activeVersion: boolean;
|
|
60
60
|
abstract captureVersion(): UserManagedEntityStateFunctionality;
|
|
61
|
-
abstract recursiveCaptureUpstreamVersions(): IChangeSet<
|
|
62
|
-
abstract restoreVersion(version: EntityVersion): Promise<IChangeSet<
|
|
63
|
-
abstract hydrateAncestors(): IChangeSet<
|
|
64
|
-
abstract addSelfToProject(): IChangeSet<
|
|
65
|
-
abstract afterAllChildrenInitialized(): IChangeSet<
|
|
61
|
+
abstract recursiveCaptureUpstreamVersions(): IChangeSet<UserManagedEntityState>;
|
|
62
|
+
abstract restoreVersion(version: EntityVersion): Promise<IChangeSet<UserManagedEntityState>>;
|
|
63
|
+
abstract hydrateAncestors(): IChangeSet<UserManagedEntityState>;
|
|
64
|
+
abstract addSelfToProject(): IChangeSet<UserManagedEntityState>;
|
|
65
|
+
abstract afterAllChildrenInitialized(): IChangeSet<UserManagedEntityState>;
|
|
66
66
|
abstract sync(data: Partial<Element | ElementTransfer | ElementShallowTransfer>): SharedStateFunctionality;
|
|
67
67
|
abstract APICreate(options: IEntityPersistanceOptions): Promise<SharedStateFunctionality>;
|
|
68
68
|
abstract APIUpdate(options: IEntityPersistanceOptions): Promise<SharedStateFunctionality>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityId } from '../../../definitions';
|
|
1
|
+
import { EntityId, EntityType } from '../../../definitions';
|
|
2
2
|
import { ProjectState } from '../project';
|
|
3
3
|
import { EntityState } from './state';
|
|
4
4
|
|
|
@@ -8,23 +8,40 @@ export interface IModuleInjection {
|
|
|
8
8
|
id: string;
|
|
9
9
|
init(project: ProjectState): Promise<void> | void;
|
|
10
10
|
}
|
|
11
|
-
export interface IChangeSet<TSelf
|
|
11
|
+
export interface IChangeSet<TSelf extends {
|
|
12
|
+
id: string;
|
|
13
|
+
type: EntityType;
|
|
14
|
+
} = EntityState, TGeneric extends {
|
|
15
|
+
id: string;
|
|
16
|
+
type: EntityType;
|
|
17
|
+
} = EntityState> {
|
|
12
18
|
added: TGeneric[];
|
|
13
19
|
updated: TGeneric[];
|
|
14
20
|
removed: TGeneric[];
|
|
15
21
|
self: TSelf;
|
|
16
22
|
}
|
|
17
|
-
export interface IRecordChangeSet<TSelf
|
|
23
|
+
export interface IRecordChangeSet<TSelf extends {
|
|
24
|
+
id: string;
|
|
25
|
+
type: EntityType;
|
|
26
|
+
} = EntityState, TGeneric extends {
|
|
27
|
+
id: string;
|
|
28
|
+
type: EntityType;
|
|
29
|
+
} = EntityState> {
|
|
18
30
|
added: Record<EntityId, TGeneric>;
|
|
19
31
|
updated: Record<EntityId, TGeneric>;
|
|
20
32
|
removed: Set<EntityId>;
|
|
21
33
|
self: TSelf;
|
|
22
34
|
}
|
|
23
35
|
export declare enum EntityAction {
|
|
24
|
-
|
|
36
|
+
PersistChangeSet = "persist-change-set",
|
|
37
|
+
CreateSingle = "create-single",
|
|
38
|
+
CreateBulk = "create-bulk",
|
|
39
|
+
CreateSingleNested = "create-single-nested",
|
|
40
|
+
CreateBulkNested = "create-bulk-nested",
|
|
25
41
|
Update = "update",
|
|
26
42
|
Clone = "clone",
|
|
27
43
|
Delete = "delete",
|
|
28
44
|
Load = "load",
|
|
45
|
+
LoadNested = "load-nested",
|
|
29
46
|
LoadVersion = "load-version"
|
|
30
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseEntityNames, ElementGenerationTarget, ElementShallowTransfer, ElementTransfer, EntityType, Element, IGenericReference, EntityId, ValueReadingEntityTypesUnion, 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, InstalledProjectState, ExecutableEntityState, ValueDescriptorState, CallableEntityState, CallerEntityState, PassThroughCallableEntityState, PrimitiveEntityState, InternalCallState } from '../state';
|
|
2
|
+
import { DraggableCallableEntityState, CanvasEntityState, EntityState, EntityWithLogicScopeState, EntryPointEntityState, DraggableExecutableEntityState, DraggablePassThroughCallableEntityState, ValueReadingEntityState, ValueWritingEntityState, EntityWithValueState, VariableState, BuiltInBaseEntityState, TerminationState, InstalledProjectState, ExecutableEntityState, ValueDescriptorState, CallableEntityState, CallerEntityState, PassThroughCallableEntityState, PrimitiveEntityState, InternalCallState, DataTypeState, ActionDescriptorState, ContinueStatementState, BreakStatementState, LiteralValueState, IChangeSet, IRecordChangeSet } from '../state';
|
|
3
3
|
import { FunctionCallState } from '../state/function-call';
|
|
4
4
|
import { InputMapState } from '../state/input-map';
|
|
5
5
|
import { VariableDeclarationState } from '../state/variable-declaration';
|
|
@@ -8,6 +8,7 @@ import { ReturnDeclarationState } from '../state/return-declaration';
|
|
|
8
8
|
import { OutputMapState } from '../state/output-map';
|
|
9
9
|
import { ConditionState } from '../state/condition';
|
|
10
10
|
import { ReturnStatementState } from '../state/return-statement';
|
|
11
|
+
import { GlobalEventState } from '../state/global-event';
|
|
11
12
|
import { FunctionDeclarationState } from '../state/function-declaration';
|
|
12
13
|
import { ProjectState } from '../state/project/project';
|
|
13
14
|
import { PropertyState } from '../state/property';
|
|
@@ -272,3 +273,11 @@ export declare function resolvePrimaryKeyProperty(entity: DefinitionEntityState)
|
|
|
272
273
|
export declare function getColumnProperties(entity: DefinitionEntityState): PropertyState[];
|
|
273
274
|
export declare function getDatabaseEntity(entity: DefinitionEntityState): DefinitionEntityState | null;
|
|
274
275
|
export declare function resolveClonedEntityProject(newParent: EntityState | null, self: EntityState): ProjectState;
|
|
276
|
+
export declare function getStateClassFromType(entityType: EntityType): typeof BuiltInBaseEntityState | typeof ProjectState | typeof InstalledProjectState | typeof DefinitionEntityState | typeof FunctionDeclarationState | typeof GlobalEventState | typeof VariableInstanceState | typeof VariableDeclarationState | typeof InputMapState | typeof OutputMapState | typeof ConditionState | typeof OperationState | typeof FunctionCallState | typeof ReturnDeclarationState | typeof ArgumentDeclarationState | typeof PrimitiveEntityState | typeof DataTypeState | typeof PropertyState | typeof ActionDescriptorState | typeof ReturnStatementState | typeof ContinueStatementState | typeof BreakStatementState | typeof LoopState | typeof SearchState | typeof ValueDescriptorState | typeof InternalCallState | typeof LiteralValueState | null;
|
|
277
|
+
export declare function fromChangeSetToRecordChangeSet<TSelf extends {
|
|
278
|
+
id: string;
|
|
279
|
+
type: EntityType;
|
|
280
|
+
} = EntityState, TGeneric extends {
|
|
281
|
+
id: string;
|
|
282
|
+
type: EntityType;
|
|
283
|
+
} = EntityState>(changeSet: IChangeSet<TSelf, TGeneric>): IRecordChangeSet<TSelf, TGeneric>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyx-code/project-logic-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6160",
|
|
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",
|