@elyx-code/project-logic-tree 0.0.6384 → 0.0.6385

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
@@ -2,11 +2,13 @@ import { BinaryExpr } from 'sql-parser-cst';
2
2
  import { CloudProviders } from '@elyx-code/definitions';
3
3
  import { default as default_2 } from 'zod';
4
4
  import { DTOAction } from '@elyx-code/definitions';
5
+ import { EventCallback } from '@elyx-code/common-ts-utils';
5
6
  import { Events } from '@elyx-code/common-ts-utils';
6
7
  import { Expr } from 'sql-parser-cst';
7
8
  import { ForSystemTimeAsOfExpr } from 'sql-parser-cst';
8
9
  import { FromClause } from 'sql-parser-cst';
9
10
  import { IDeploymentStepDefinition } from '@elyx-code/definitions';
11
+ import { IEventsBus } from '@elyx-code/common-ts-utils';
10
12
  import { IInfrastructureResource } from '@elyx-code/definitions';
11
13
  import { ILiveMessageDTO } from '@elyx-code/definitions';
12
14
  import { InfrastructureResourceDetails } from '@elyx-code/definitions';
@@ -1462,6 +1464,8 @@ export declare enum BuiltInFunctionIds {
1462
1464
  AbortExecution = "base-abort-execution"
1463
1465
  }
1464
1466
 
1467
+ export declare type BuiltInFunctionsImplementationModule = Record<BuiltInFunctionIds, (entity: InternalCallState, inputs: IDynamicValue[]) => Promise<IExecutionResult>>;
1468
+
1465
1469
  export declare type BuiltInSystemEntityState = PrimitiveEntityState | BuiltInBaseEntityState;
1466
1470
 
1467
1471
  export declare type BuiltInSystemEntityStateConstructor = typeof BuiltInBaseEntityState | typeof PrimitiveEntityState;
@@ -1771,7 +1775,7 @@ export declare const CHILDREN_TYPES: EntityType[];
1771
1775
 
1772
1776
  export declare function cloneProject(project: ProjectState, { enrich, }?: {
1773
1777
  enrich: boolean;
1774
- }): ProjectState;
1778
+ }, parentContext?: IProjectInstanceParentContext): ProjectState;
1775
1779
 
1776
1780
  declare class ColumnRef implements ISearchNode {
1777
1781
  owner: SearchStatementState;
@@ -2482,6 +2486,12 @@ export declare const dateValueAutogenerationSchema: z_2.ZodUnion<[z_2.ZodObject<
2482
2486
  rangeEnd: null;
2483
2487
  }>]>;
2484
2488
 
2489
+ export declare const DEFAULT_EXECUTION_INSTANCE_PARENT_CONTEXT: IExecutionInstanceParentContext;
2490
+
2491
+ export declare const DEFAULT_PROJECT_INSTANCE_PARENT_CONTEXT: IProjectInstanceParentContext;
2492
+
2493
+ export declare const DEFAULT_PROJECT_STATIC_PARENT_CONTEXT: IProjectStaticParentContext;
2494
+
2485
2495
  export declare const DEFAULT_UUID_MODULE: UUIDModule;
2486
2496
 
2487
2497
  export declare enum DefinitionEntityDependencyField {
@@ -2812,6 +2822,10 @@ export declare enum DynamicValueTypes {
2812
2822
 
2813
2823
  export declare const EDITABLE_PERSISTANCE_REPOSITORY_DEFAULTS: IEditableEntityPersistanceRepository;
2814
2824
 
2825
+ declare interface EditorContext extends ExtensionContextBase {
2826
+ logic: ProjectLogicContext;
2827
+ }
2828
+
2815
2829
  export declare class EfimeralValueStore implements IValueStoreClient {
2816
2830
  initialized: boolean;
2817
2831
  id: string;
@@ -3319,6 +3333,7 @@ export declare type ExecutableEntityTransfer = CallableEntityTransfer | EntryPoi
3319
3333
  export declare type ExecutableEntityTypesUnion = ExecutableEntity | ExecutableEntityTransfer | ExecutableEntityShallowTransfer | ExecutableEntityGenerationTarget;
3320
3334
 
3321
3335
  export declare class Execution extends Events {
3336
+ readonly parentContext: IExecutionInstanceParentContext;
3322
3337
  project: ProjectState;
3323
3338
  entryPoint: TestableEntityState;
3324
3339
  state: ExecutionState;
@@ -3337,25 +3352,8 @@ export declare class Execution extends Events {
3337
3352
  onRemoveFromSkippedListCallback: null | ((entity: TestableEntityState) => void);
3338
3353
  onAddEntityCallback: null | ((entity: TestableEntityState) => void);
3339
3354
  onRemoveEntityCallback: null | ((entity: TestableEntityState) => void);
3340
- static searchImplementation: (entity: SearchState, inputs: IDynamicValue[]) => Promise<{
3341
- data: {
3342
- [columnName: string]: any;
3343
- } | null | {
3344
- [columnName: string]: any;
3345
- }[];
3346
- error: string | null;
3347
- }>;
3348
- static builtInFunctionImplementations: Record<BuiltInFunctionIds, (entity: InternalCallState, inputs: IDynamicValue[]) => Promise<IExecutionResult>>;
3349
- constructor(project: ProjectState, entities: TestableEntityState[], entryPoint: TestableEntityState, parentExecution?: Execution | null);
3355
+ constructor(project: ProjectState, entities: TestableEntityState[], entryPoint: TestableEntityState, parentExecution?: Execution | null, parentContext?: IExecutionInstanceParentContext);
3350
3356
  get valueResolutionContext(): IValueResolutionContext;
3351
- static injectSearchImplementation(implementation: (entity: SearchState, inputs: IDynamicValue[]) => Promise<{
3352
- data: {
3353
- [columnName: string]: any;
3354
- } | null | {
3355
- [columnName: string]: any;
3356
- }[];
3357
- error: string | null;
3358
- }>): void;
3359
3357
  skip(entity: TestableEntityState): void;
3360
3358
  schedule(entity: TestableEntityState, inputs?: IDynamicValue[], client?: IExecutionClient): Promise<IExecutionResult | null>;
3361
3359
  mergeExernalValuesWithInternalInputs(externalValues: IDynamicValue[], entity: EntityState): IDynamicValue[];
@@ -3441,6 +3439,75 @@ export declare class ExplicitInfrastructureResource extends InfrastructureResour
3441
3439
  resolveDeterministicResourceId(): string;
3442
3440
  }
3443
3441
 
3442
+ declare type ExtensionContext = EditorContext;
3443
+
3444
+ declare class ExtensionContextBase implements IExtensionContextBase {
3445
+ readonly registry: ExtensionsRegistry;
3446
+ readonly contextType: ExtensionContextType;
3447
+ constructor(registry: ExtensionsRegistry, contextType: ExtensionContextType);
3448
+ on<Arguments extends any[]>(eventName: string, callback: EventCallback<Arguments>): void;
3449
+ emit<Arguments extends any[]>(eventName: string, ...args: Arguments): void;
3450
+ off<Arguments extends any[]>(eventName: string, callback?: EventCallback<Arguments>): void;
3451
+ }
3452
+
3453
+ declare enum ExtensionContextType {
3454
+ Logic = "logic",
3455
+ GUI = "gui",
3456
+ Editor = "editor",
3457
+ Compile = "compile"
3458
+ }
3459
+
3460
+ declare interface ExtensionManifest {
3461
+ id: string;
3462
+ version: string;
3463
+ description?: string;
3464
+ initPriority?: ExtentionPriority;
3465
+ permissions: ExtensionPermissions[];
3466
+ contexts: ExtensionContextType[];
3467
+ dependencies?: string[];
3468
+ }
3469
+
3470
+ declare type ExtensionModule<T extends object = {}> = T & ExtensionModuleCore;
3471
+
3472
+ declare interface ExtensionModuleCore {
3473
+ /** Called once on editor startup */
3474
+ init?(contexts: ExtensionContext[]): Promise<void> | void;
3475
+ /** Cleanup hook */
3476
+ destroy?(): Promise<void> | void;
3477
+ }
3478
+
3479
+ declare enum ExtensionPermissions {
3480
+ OnCompileBefore = "on:compile:before:DefinitionEntity",
3481
+ OnCompileDefault = "on:compile:default:DefinitionEntity",
3482
+ OnCompileAfter = "on:compile:after:DefinitionEntity",
3483
+ EmitCompile = "emit:compile:DefinitionEntity",
3484
+ DoEditorPublish = "do:editor:publish",
3485
+ PostGUICanvasSlotNewToolbarButton = "write:gui:canvas:slot:toolbar-button",
3486
+ ReadGUICanvasSlotToolbarButtons = "read:gui:canvas:slot:toolbar-buttons",
3487
+ UpdateGUIGlobalTheme = "update:gui:global:theme"
3488
+ }
3489
+
3490
+ declare class ExtensionsRegistry implements Omit<IEventsBus, 'destroy'> {
3491
+ private events;
3492
+ private extensions;
3493
+ constructor(events?: Events);
3494
+ get extensionInOrder(): RegisteredExtension[];
3495
+ private requestContext;
3496
+ requestModule<T>(moduleId: string): T;
3497
+ register(manifest: ExtensionManifest, module: ExtensionModule): void;
3498
+ initAll(): Promise<void>;
3499
+ destroyAll(): Promise<void>;
3500
+ on<Arguments extends any[]>(eventName: string, callback: EventCallback<Arguments>): void;
3501
+ emit<Arguments extends any[]>(eventName: string, ...args: Arguments): void;
3502
+ off<Arguments extends any[]>(eventName: string, callback?: EventCallback<Arguments>): void;
3503
+ }
3504
+
3505
+ declare enum ExtentionPriority {
3506
+ High = 1,
3507
+ Normal = 5,
3508
+ Low = 10
3509
+ }
3510
+
3444
3511
  export declare function filterOutDuplicateEntities(entities: (EntityState | Element_2 | ElementTransfer | ElementShallowTransfer | ElementGenerationTarget)[]): (Element_2 | ElementTransfer | ElementShallowTransfer | ElementGenerationTarget | EntityState)[];
3445
3512
 
3446
3513
  export declare function filterOutDuplicateErrors(errors: (EntityGenerationError | EntityError)[]): EntityGenerationError[] | EntityError[];
@@ -8781,6 +8848,10 @@ export declare interface IBaseEventTransfer extends IBaseEvent_meta {
8781
8848
  calls: (CallableEntity | CallableEntityTransfer)[];
8782
8849
  }
8783
8850
 
8851
+ declare interface IBaseExtensionsContext {
8852
+ onRequestModule: <T>(moduleId: string) => T;
8853
+ }
8854
+
8784
8855
  export declare interface IBaseVariable extends IBaseVariableTransfer, IChildEntity {
8785
8856
  defaultValue: ILiteralValue | null;
8786
8857
  dataType: IDataType | null;
@@ -9254,7 +9325,7 @@ export declare interface IEditableEntityPersistanceRepository extends IReadOnlyE
9254
9325
  APILoadVersion<T extends Array<any> = any[]>(entityId: EntityId, versionIdOrBeforeEqualDate: EntityVersion | Date, ...otherArgs: T): Promise<ElementShallowTransfer | null>;
9255
9326
  }
9256
9327
 
9257
- export declare interface IEditor extends IUndoableInterface, IValueResolutionContext {
9328
+ export declare interface IEditor extends IUndoableInterface, IValueResolutionContext, IProjectStaticParentContext, IProjectInstanceParentContext {
9258
9329
  ready: boolean;
9259
9330
  hasLoadedLogic: boolean;
9260
9331
  destroyed: boolean;
@@ -9271,6 +9342,7 @@ export declare interface IEditor extends IUndoableInterface, IValueResolutionCon
9271
9342
  socket: IWebsocketsClient;
9272
9343
  events: Events;
9273
9344
  publication: PublicationRun | null;
9345
+ extensions: ExtensionsRegistry;
9274
9346
  onProjectHeadLoadedCallback: null | ((projectState: ProjectState) => void);
9275
9347
  onLogicLoadingCompleteCallback: null | ((chunk: any) => void);
9276
9348
  onRenderedCallback: null | (() => void);
@@ -9309,6 +9381,7 @@ export declare interface IEditor extends IUndoableInterface, IValueResolutionCon
9309
9381
  resolveInitialChildrenPositions(parent: CanvasEntityState | null, children: CanvasEntityState[], changeSet: ChangeSet | null): CanvasEntityState[];
9310
9382
  publish(): Promise<void>;
9311
9383
  loadActivePublication(publicationId: string): Promise<IPublication>;
9384
+ requestModule<T = any>(moduleId: string): T | null;
9312
9385
  }
9313
9386
 
9314
9387
  export declare interface IEntityActionRequestPayload<P extends {
@@ -9376,6 +9449,9 @@ export declare interface IExecutionClient {
9376
9449
  onEntityExecuted?: (entity: TestableEntityState, result: IExecutionResult, context: IExecutionCallbackContext) => Promise<any>;
9377
9450
  }
9378
9451
 
9452
+ export declare interface IExecutionInstanceParentContext extends IBaseExtensionsContext {
9453
+ }
9454
+
9379
9455
  export declare interface IExecutionResult {
9380
9456
  value: ExecutionTerminationType;
9381
9457
  entity: TestableEntityState;
@@ -9383,6 +9459,10 @@ export declare interface IExecutionResult {
9383
9459
  results: IDynamicValue[];
9384
9460
  }
9385
9461
 
9462
+ declare interface IExtensionContextBase extends Omit<IEventsBus, 'destroy'> {
9463
+ registry: ExtensionsRegistry;
9464
+ }
9465
+
9386
9466
  export declare interface IFile extends IPrimitiveEntity {
9387
9467
  name: PrimitiveTypes.File;
9388
9468
  }
@@ -9829,16 +9909,16 @@ export declare enum InfrastructureResourceStatus {
9829
9909
  Deleted = "deleted"
9830
9910
  }
9831
9911
 
9832
- export declare function initBaseProjectEntity(data: IProjectTransfer): ProjectState;
9912
+ export declare function initBaseProjectEntity(data: IProjectTransfer, parentContext?: IProjectInstanceParentContext): ProjectState;
9833
9913
 
9834
9914
  export declare function initProject(data: IProjectTransfer, { enrich, }?: {
9835
9915
  enrich: boolean;
9836
- }): ProjectState;
9916
+ }, parentContext?: IProjectInstanceParentContext): ProjectState;
9837
9917
 
9838
9918
  export declare function initProjectFromFetchResult(result: IProjectFetchResult, options?: {
9839
9919
  enrich?: boolean;
9840
9920
  shallowErrors?: boolean;
9841
- }): ProjectState;
9921
+ }, parentContext?: IProjectInstanceParentContext): ProjectState;
9842
9922
 
9843
9923
  export declare enum InputMapDependencyField {
9844
9924
  Declaration = "declaration",
@@ -9925,7 +10005,7 @@ export declare class InputMapState extends VersionedState implements IInputMap,
9925
10005
  setParent(parent: PassThroughCallableEntityState, changeSet?: ChangeSet | null): InputMapState;
9926
10006
  setDataType(dataType: DataTypeState | null, changeSet?: ChangeSet | null): InputMapState;
9927
10007
  removeDataType(): InputMapState;
9928
- setDeclaration(declaration: ArgumentDeclarationState | PropertyState | ValueDescriptorState | null): InputMapState;
10008
+ setDeclaration(declaration: ArgumentDeclarationState | PropertyState | ValueDescriptorState | null, changeSet?: ChangeSet | null): InputMapState;
9929
10009
  initChildren(changeSet?: ChangeSet | null): InputMapState;
9930
10010
  setValueWriter(valueWriter: ValueWritingEntityState | null, changeSet?: ChangeSet | null): InputMapState;
9931
10011
  removeValueWriter(changeSet?: ChangeSet | null): InputMapState;
@@ -10524,6 +10604,11 @@ export declare interface IProjectFetchResult {
10524
10604
  export declare interface IProjectGenerationTarget extends IProject_base {
10525
10605
  }
10526
10606
 
10607
+ export declare interface IProjectInstanceParentContext extends IProjectStaticParentContext {
10608
+ onRequestActiveDynamicValue: (valueOwner: EntityWithValueState) => IDynamicValue | null;
10609
+ events: Events;
10610
+ }
10611
+
10527
10612
  export declare interface IProjectReference extends IGenericReference {
10528
10613
  entityType: EntityType.Project;
10529
10614
  }
@@ -10542,6 +10627,10 @@ export declare interface IProjectShallowTransfer extends IProject_meta {
10542
10627
  searches: ISearchReference[];
10543
10628
  }
10544
10629
 
10630
+ export declare interface IProjectStaticParentContext extends IBaseExtensionsContext {
10631
+ events: Events;
10632
+ }
10633
+
10545
10634
  export declare interface IProjectTransfer extends IProject_meta {
10546
10635
  projects: (IInstalledProject | IInstalledProjectTransfer)[];
10547
10636
  entities: (IDefinitionEntity | IDefinitionEntityTransfer)[];
@@ -12315,7 +12404,7 @@ export declare class OutputMapState extends VersionedState implements IOutputMap
12315
12404
  setParent(parent: PassThroughCallableEntityWithOutputsState, changeSet?: ChangeSet | null): OutputMapState;
12316
12405
  setDataType(dataType: DataTypeState | null, changeSet?: ChangeSet | null): OutputMapState;
12317
12406
  removeDataType(): OutputMapState;
12318
- setDeclaration(declaration: ReturnDeclarationState | PropertyState | ValueDescriptorState): OutputMapState;
12407
+ setDeclaration(declaration: ReturnDeclarationState | PropertyState | ValueDescriptorState, changeSet?: ChangeSet | null): OutputMapState;
12319
12408
  initChildren(changeSet?: ChangeSet | null): OutputMapState;
12320
12409
  subscribe(): OutputMapState;
12321
12410
  unsubscribe(): OutputMapState;
@@ -12619,11 +12708,155 @@ export declare type ProjectDomain = string;
12619
12708
 
12620
12709
  export declare type ProjectFetchResult = null | IProjectFetchResult;
12621
12710
 
12711
+ declare class ProjectLogicContext extends ExtensionContextBase implements IProject {
12712
+ private readonly _project;
12713
+ constructor(registry: ExtensionsRegistry, _project: ProjectState);
12714
+ readonly id: EntityId;
12715
+ get type(): EntityType.Project;
12716
+ get name(): string | null;
12717
+ get description(): string | null;
12718
+ get version(): string;
12719
+ get createdAt(): string;
12720
+ get previousVersion(): string | null;
12721
+ get author(): string;
12722
+ get deleted(): boolean;
12723
+ get entities(): DefinitionEntityState[];
12724
+ get projects(): InstalledProjectState[];
12725
+ get functions(): FunctionDeclarationState[];
12726
+ get events(): GlobalEventState[];
12727
+ get variableDeclarations(): VariableDeclarationState[];
12728
+ get variableInstances(): VariableInstanceState[];
12729
+ get conditions(): ConditionState[];
12730
+ get operations(): OperationState[];
12731
+ get functionCalls(): FunctionCallState[];
12732
+ get loops(): LoopState[];
12733
+ get searches(): SearchState[];
12734
+ get primitives(): PrimitiveEntityState[];
12735
+ get builtInBaseEntities(): BuiltInBaseEntityState[];
12736
+ get operationDeclarations(): ActionDescriptorState[];
12737
+ get globalEventActionDescriptors(): ActionDescriptorState[];
12738
+ get loopDeclarations(): ActionDescriptorState[];
12739
+ get loopDeclarationsBodies(): ActionDescriptorState[];
12740
+ get conditionDeclarations(): ActionDescriptorState[];
12741
+ get valueDescriptors(): ValueDescriptorState[];
12742
+ get dataTypes(): DataTypeState[];
12743
+ get errors(): EntityError[];
12744
+ get history(): ChangeSet[];
12745
+ get undoableStackValueIndex(): number;
12746
+ get knownVersions(): Map<string, EntityState> | null;
12747
+ get activeVersion(): boolean;
12748
+ get initialized(): boolean;
12749
+ get startedInitialization(): boolean;
12750
+ closePendingChangeSets(): Promise<void>;
12751
+ closeChangeSet(changeSet: ChangeSet): Promise<void>;
12752
+ toLatestChangeSet(author: string, timestamp: string, // ISO 8601 format
12753
+ self: UserManagedEntityState | null, autoclose?: boolean, autoCloseActionName?: string): ChangeSet;
12754
+ addChangeSet(changeSet: ChangeSet): ChangeSet;
12755
+ discardChangeSet(changeSet: ChangeSet | null): ProjectState;
12756
+ subscribeDependents(dependencies: {
12757
+ entity: UserManagedEntityState;
12758
+ field: string;
12759
+ }[]): UserManagedEntityState;
12760
+ unsubscribeDependents(dependencies: {
12761
+ entity: UserManagedEntityState;
12762
+ field: string;
12763
+ }[]): UserManagedEntityState;
12764
+ syncDependents(changeSet?: ChangeSet | null): IChangeSet<UserManagedEntityState>;
12765
+ onDetachedDependencyRemoved(_dependency: UserManagedEntityState, _field: string, _changeSet: ChangeSet | null): IChangeSet<UserManagedEntityState>;
12766
+ onDetachedDependencyRestored(_dependency: UserManagedEntityState, _field: string, _changeSet: ChangeSet | null): IChangeSet<UserManagedEntityState>;
12767
+ increaseVersion(sharedTimestamp: null | string): UserManagedEntityState;
12768
+ captureVersion(): ProjectState;
12769
+ restoreVersion(versionId: EntityVersion): Promise<IChangeSet<ProjectState>>;
12770
+ updateWithShallowTransfer(transfer: IProjectShallowTransfer, changeSet?: ChangeSet | null): ProjectState;
12771
+ hydrateAncestors(): IChangeSet<ProjectState>;
12772
+ afterAllChildrenInitialized(changeSet?: ChangeSet | null): IChangeSet<ProjectState>;
12773
+ addSelfToProject(_changeSet: ChangeSet | null): IChangeSet<ProjectState>;
12774
+ get instancesList(): EntityState[];
12775
+ isOperationDeclaration(entity: ActionDescriptorState): boolean;
12776
+ isGlobalEventActionDescriptor(entity: ActionDescriptorState): boolean;
12777
+ isLoopDeclaration(entity: ActionDescriptorState): boolean;
12778
+ isConditionDeclaration(entity: ActionDescriptorState): boolean;
12779
+ findSubscribedBuiltInInstance(entity: Element_2 | ElementTransfer): EntityState | null;
12780
+ get(entityId: EntityId): EntityState | null;
12781
+ getDeleted(entityId: EntityId): EntityState | null;
12782
+ getManaged(entityId: EntityId): EntityState | null;
12783
+ getBuiltIn(entityId: EntityId): EntityState | null;
12784
+ findSubscribedInstanceFromReference(entity: Reference): EntityState | null;
12785
+ findSubscribedBuiltInInstanceFromReference(entity: Reference): EntityState | null;
12786
+ metaSync(data: Partial<IProject_meta | IProject | IProjectTransfer | IProjectShallowTransfer>, changeSet?: ChangeSet | null): ProjectState;
12787
+ getAllBuiltInIds(): EntityId[];
12788
+ getAllBuiltIn(): EntityState[];
12789
+ toFlat(seenEntities?: Set<EntityId>): EntityState[];
12790
+ toFlatIds(seenEntities?: Set<EntityId>): EntityId[];
12791
+ toMeta(): IProject_meta;
12792
+ toJSON(seenEntities?: Set<EntityId>): IProjectTransfer | IProjectReference;
12793
+ toJSONClone(options?: IEntityJSONCloneOptions): IProjectTransfer;
12794
+ toReference(options?: IEntityRecursionOptions): IProjectReference;
12795
+ toShallowJSON(options?: IEntityRecursionOptions): IProjectShallowTransfer;
12796
+ toFlatJSON(seenEntities?: Set<EntityId>): ElementShallowTransfer[];
12797
+ toGenerationTarget(): IProjectGenerationTarget;
12798
+ toFlatGenerationTarget(seenEntities?: Set<EntityId>): ElementGenerationTarget[];
12799
+ clearErrors(): ProjectState;
12800
+ validate(): {
12801
+ success: boolean;
12802
+ error: ZodError | null;
12803
+ data: IProjectTransfer | null;
12804
+ };
12805
+ validateChildren(): void;
12806
+ getErrors(): EntityError[];
12807
+ getShallowErrors(): EntityError[];
12808
+ getDefinitionEntity(id: EntityId): DefinitionEntityState | null;
12809
+ addDefinitionEntity(entity: DefinitionEntityState): DefinitionEntityState;
12810
+ addFunctionDeclaration(func: FunctionDeclarationState): FunctionDeclarationState;
12811
+ addFunctionCall(func: FunctionCallState): FunctionCallState;
12812
+ addVariableDeclaration(variable: VariableDeclarationState): VariableDeclarationState;
12813
+ addVariableInstance(variable: VariableInstanceState): VariableInstanceState;
12814
+ addInstalledProject(project: InstalledProjectState): ProjectState;
12815
+ addGlobalEvent(event: GlobalEventState): ProjectState;
12816
+ addCondition(condition: ConditionState): ProjectState;
12817
+ addOperation(operation: OperationState): ProjectState;
12818
+ addLoop(loop: LoopState): ProjectState;
12819
+ addSearch(search: SearchState): ProjectState;
12820
+ removeDefinitionEntity(entity: IDefinitionEntity): DefinitionEntityState | null;
12821
+ removeCondition(condition: ICondition): ConditionState | null;
12822
+ removeOperation(operation: IOperation): OperationState | null;
12823
+ removeLoop(loop: ILoop): LoopState | null;
12824
+ removeSearch(search: ISearch): SearchState | null;
12825
+ removeFunctionCall(funcCall: IFunctionCall): FunctionCallState | null;
12826
+ removeVariableInstance(variable: IVariableInstance): VariableInstanceState | null;
12827
+ removeVariableDeclaration(variable: IVariableDeclaration): VariableDeclarationState | null;
12828
+ removeFunctionDeclaration(func: IFunctionDeclaration): FunctionDeclarationState | null;
12829
+ removeInstalledProject(project: IInstalledProject): InstalledProjectState | null;
12830
+ removeGlobalEvent(event: IGlobalEvent): GlobalEventState | null;
12831
+ removeTopLevelVariableDeclaration(variable: VariableDeclarationState): VariableDeclarationState | null;
12832
+ getEntryPoints(): EntryPointEntityState[];
12833
+ getTerminationStatements(): TerminationState[];
12834
+ getFunctionDeclaration(id: EntityId): FunctionDeclarationState | null;
12835
+ getConditions(): ConditionState[];
12836
+ getOperations(): OperationState[];
12837
+ getVariables(): VariableState[];
12838
+ getVariableInstances(): VariableInstanceState[];
12839
+ getVariableDeclarations(): VariableDeclarationState[];
12840
+ getLoops(): LoopState[];
12841
+ getSearches(): SearchState[];
12842
+ getBuiltInPersistedEntity(): BuiltInBaseEntityState | null;
12843
+ requestActiveDynamicValue(valueOwner: EntityWithValueState): IDynamicValue | null;
12844
+ undo(): IProjectVersionTransitionConfig;
12845
+ redo(): IProjectVersionTransitionConfig;
12846
+ applyExternalChangeSet(request: PersistChangeSetEntityActionRequestPayload): ChangeSet;
12847
+ toFullProjectTransfer(): {
12848
+ order: EntityId[];
12849
+ size: number;
12850
+ record: Record<EntityId, UserManagedElementShallowTransfer>;
12851
+ };
12852
+ }
12853
+
12622
12854
  export declare type ProjectPayloadUnion = ProjectState | ProjectTypesUnion;
12623
12855
 
12624
12856
  export declare const projectPublicationCompletedGlobalEvent: IActionDescriptorTransfer;
12625
12857
 
12626
12858
  export declare class ProjectState extends VersionedState implements IProject, UserManagedEntityStateTemplate, BaseState {
12859
+ readonly parentContext: IProjectInstanceParentContext;
12627
12860
  initialData: IProject | IProjectTransfer;
12628
12861
  readonly id: EntityId;
12629
12862
  type: EntityType.Project;
@@ -12673,17 +12906,14 @@ export declare class ProjectState extends VersionedState implements IProject, Us
12673
12906
  activeVersion: boolean;
12674
12907
  initialized: boolean;
12675
12908
  startedInitialization: boolean;
12676
- _eventsHub: Events;
12677
12909
  onCloseChangeSetCallback: ((changeSet: ChangeSet) => Promise<{
12678
12910
  success: boolean;
12679
12911
  }>) | null;
12680
12912
  onAddChangeSetCallback: ((changeSet: ChangeSet, undoableStackValueIndex: number) => void) | null;
12681
12913
  onDiscardChangeSetCallback: ((changeSet: ChangeSet) => void) | null;
12682
- onRequestActiveDynamicValueCallback: ((valueOwner: EntityWithValueState) => IDynamicValue | null) | null;
12683
- constructor(initialData: IProject | IProjectTransfer);
12684
- private static _UUIDModule;
12914
+ constructor(initialData: IProject | IProjectTransfer, parentContext?: IProjectInstanceParentContext);
12915
+ static parentContext: IProjectStaticParentContext;
12685
12916
  static get UUID(): UUIDModule;
12686
- static injectUUIDModule(module: UUIDModule): void;
12687
12917
  static sessionAuthor: string;
12688
12918
  static repository: IEditableEntityPersistanceRepository;
12689
12919
  static type: EntityType.Project;
@@ -12711,7 +12941,6 @@ export declare class ProjectState extends VersionedState implements IProject, Us
12711
12941
  get on(): Events['on'];
12712
12942
  get emit(): Events['emit'];
12713
12943
  closePendingChangeSets(): Promise<void>;
12714
- onRequestActiveDynamicValue(callback: (valueOwner: EntityWithValueState) => IDynamicValue | null): void;
12715
12944
  onCloseChangeSet(callback: (changeSet: ChangeSet) => Promise<{
12716
12945
  success: boolean;
12717
12946
  }>): Promise<void>;
@@ -12851,6 +13080,7 @@ export declare class ProjectState extends VersionedState implements IProject, Us
12851
13080
  attachOrphanReferences(): ProjectState;
12852
13081
  getBuiltInPersistedEntity(): BuiltInBaseEntityState | null;
12853
13082
  requestActiveDynamicValue(valueOwner: EntityWithValueState): IDynamicValue | null;
13083
+ requestModule<T = any>(moduleId: string): T | null;
12854
13084
  undo(): IProjectVersionTransitionConfig;
12855
13085
  redo(): IProjectVersionTransitionConfig;
12856
13086
  applyExternalChangeSet(request: PersistChangeSetEntityActionRequestPayload): ChangeSet;
@@ -13270,6 +13500,11 @@ export declare function rebaseStack<T = any>(undoableStackValueIndex: number, hi
13270
13500
 
13271
13501
  export declare type Reference = IGenericReference | IFunctionDeclarationReference | IInstalledProjectReference | IDataTypeReference | IVariableDeclarationReference | IVariableInstanceReference | IOperationReference | IDefinitionEntityReference | IPrimitiveEntityReference | IProjectReference | IGlobalEventReference | IFunctionDeclarationReference | IFunctionDeclarationReference | IPropertyReference | IFunctionCallReference | IArgumentDeclarationReference | IInputMapReference | IOutputMapReference | IReturnDeclarationReference | IConditionReference | IReturnStatementReference | IBreakStatementReference | IContinueStatementReference | ILoopReference | IActionDescriptorReference | ISearchReference | ILiteralValueReference | IBuiltInBaseEntityReference | IValueDescriptorReference | IInternalCallReference;
13272
13502
 
13503
+ declare interface RegisteredExtension<T extends object = {}> {
13504
+ manifest: ExtensionManifest;
13505
+ module: ExtensionModule<T>;
13506
+ }
13507
+
13273
13508
  export declare const relationalDatabaseBuiltInBaseEntity: IBuiltInBaseEntityTransfer;
13274
13509
 
13275
13510
  export declare const relationalDatabaseBuiltInBaseEntityAutoscalingProperty: IPropertyTransfer;
@@ -13738,6 +13973,17 @@ export declare enum SearchDependencyField {
13738
13973
  Parent = "parent"
13739
13974
  }
13740
13975
 
13976
+ export declare type SearchImplementationModule = {
13977
+ searchImplementation: (entity: SearchState, inputs: IDynamicValue[]) => Promise<{
13978
+ data: {
13979
+ [columnName: string]: any;
13980
+ } | null | {
13981
+ [columnName: string]: any;
13982
+ }[];
13983
+ error: string | null;
13984
+ }>;
13985
+ };
13986
+
13741
13987
  declare enum SearchLiteralValueType {
13742
13988
  String = "string",
13743
13989
  Number = "number",