@endge/core 1.0.0-dev → 1.0.0-dev.12

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.
Files changed (68) hide show
  1. package/dist/core.js +57297 -45976
  2. package/dist/features/core/kernel/config/modules.config.d.ts +7 -7
  3. package/dist/features/core/kernel/endge.d.ts +9 -9
  4. package/dist/features/core/modules/auth/EndgeAuth_Module.d.ts +9 -1
  5. package/dist/features/core/modules/auth/domain/types/auth-profile.types.d.ts +17 -0
  6. package/dist/features/core/modules/auth/services/auth-facet-claims.d.ts +5 -0
  7. package/dist/features/core/modules/compiler/EndgeCompiler_Module.d.ts +9 -0
  8. package/dist/features/core/modules/computations/model/ComputationResource.d.ts +1 -0
  9. package/dist/features/core/modules/computations/model/ComputationResourceRegistry.d.ts +1 -0
  10. package/dist/features/core/modules/context/EndgeContext_Module.d.ts +1 -0
  11. package/dist/features/core/modules/context/domain/context-persistence.types.d.ts +1 -0
  12. package/dist/features/core/modules/document-import/services/parsers/GraphQLDocumentImportParser.d.ts +3 -2
  13. package/dist/features/core/modules/program/domain/types/program.types.d.ts +3 -1
  14. package/dist/features/core/modules/runtime/RuntimeHostBase.d.ts +5 -1
  15. package/dist/features/core/modules/runtime/adapters/QueryExecutor_Adapter.d.ts +42 -3
  16. package/dist/features/core/modules/runtime/domain/graphql-query-error.d.ts +73 -0
  17. package/dist/features/core/modules/runtime/domain/query-execution.types.d.ts +25 -1
  18. package/dist/features/core/modules/runtime/domain/runtime-host.types.d.ts +6 -5
  19. package/dist/features/core/modules/runtime/domain/stream-runtime.types.d.ts +8 -1
  20. package/dist/features/core/modules/runtime/execution/endge-data-view.d.ts +1 -1
  21. package/dist/features/core/modules/runtime/execution/endge-query.d.ts +19 -2
  22. package/dist/features/core/modules/runtime/helpers/raph-phases/runtime-boundary-update-phase.d.ts +5 -9
  23. package/dist/features/core/modules/runtime/hosts/ComponentSFCRuntimeHost.d.ts +0 -1
  24. package/dist/features/core/modules/runtime/hosts/CompositionRuntimeHost.d.ts +9 -0
  25. package/dist/features/core/modules/runtime/hosts/QueryRuntimeHost.d.ts +8 -1
  26. package/dist/features/core/modules/runtime/hosts/SimulationRuntimeHost.d.ts +1 -0
  27. package/dist/features/core/modules/runtime/hosts/StreamRuntimeHost.d.ts +30 -0
  28. package/dist/features/core/modules/runtime/services/simulation/prepare-simulation-overrides.d.ts +7 -5
  29. package/dist/features/core/modules/runtime/services/transports/BrowserGraphQLSseStreamTransportFactory.d.ts +24 -0
  30. package/dist/features/core/modules/runtime/services/transports/BrowserSseStreamTransportFactory.d.ts +13 -1
  31. package/dist/features/core/modules/source/EndgeSource_Module.d.ts +6 -0
  32. package/dist/features/core/modules/source/domain/types/composition-source.types.d.ts +4 -0
  33. package/dist/features/core/modules/source/domain/types/data-view-source.types.d.ts +5 -2
  34. package/dist/features/core/modules/source/domain/types/graphql-fragments.types.d.ts +17 -0
  35. package/dist/features/core/modules/source/domain/types/query-source.types.d.ts +4 -1
  36. package/dist/features/core/modules/source/domain/types/simulation-source.types.d.ts +8 -0
  37. package/dist/features/core/modules/source/domain/types/source-context.types.d.ts +6 -0
  38. package/dist/features/core/modules/source/domain/types/source-engine.types.d.ts +3 -0
  39. package/dist/features/core/modules/source/domain/types/source-expression.types.d.ts +3 -1
  40. package/dist/features/core/modules/source/domain/types/stream-source.types.d.ts +29 -1
  41. package/dist/features/core/modules/source/domain/types/type-source.types.d.ts +11 -6
  42. package/dist/features/core/modules/source/services/SimulationSourceResolver.d.ts +6 -0
  43. package/dist/features/core/modules/source/services/compilers/graphql-operation-compile.d.ts +52 -0
  44. package/dist/features/core/modules/source/services/compilers/source-expression-compile.d.ts +21 -0
  45. package/dist/features/core/modules/source/services/compilers/source-model-reference-compile.d.ts +11 -1
  46. package/dist/features/core/modules/source/services/composition-activation.d.ts +6 -1
  47. package/dist/features/core/modules/source/services/graphql-fragments.d.ts +23 -0
  48. package/dist/features/core/modules/source/services/graphql-schema.d.ts +37 -0
  49. package/dist/features/core/modules/source/services/simulation-response-contract.d.ts +23 -0
  50. package/dist/features/core/modules/source/services/source-context.d.ts +13 -0
  51. package/dist/features/core/modules/source/services/type-extends.d.ts +15 -0
  52. package/dist/features/core/modules/source/services/value-expression-language.d.ts +2 -0
  53. package/dist/features/core/modules/source/services/value-path.d.ts +14 -0
  54. package/dist/features/core/modules/ui/EndgeUIRegistry_Module.d.ts +5 -0
  55. package/dist/features/core/modules/ui/adapters/json/EndgeUIJsonRenderer.d.ts +57 -0
  56. package/dist/features/core/modules/ui/adapters/json/endge-ui-json-adapter.d.ts +16 -0
  57. package/dist/features/core/modules/ui/adapters/json/endge-ui-json-patch.d.ts +3 -0
  58. package/dist/features/core/modules/ui/adapters/json/endge-ui-json.schema.d.ts +371 -0
  59. package/dist/features/core/modules/ui/domain/types/endge-ui-json.types.d.ts +121 -0
  60. package/dist/features/core/modules/ui/registry/UIAdapterRegistry.d.ts +2 -0
  61. package/dist/features/federation/EndgeFederation.d.ts +1 -133
  62. package/dist/features/federation/EndgeModule.d.ts +1 -58
  63. package/dist/features/federation/constants/federation.constants.d.ts +1 -1
  64. package/dist/features/federation/tools/sort-endge-modules.d.ts +1 -9
  65. package/dist/features/federation/types/endge-modules.types.d.ts +1 -28
  66. package/dist/features/federation/types/federation.types.d.ts +1 -112
  67. package/dist/main.d.ts +10 -0
  68. package/package.json +6 -4
@@ -0,0 +1,121 @@
1
+ import { RComponentSFC_IR_Tag } from '../../../domain/types/component/sfc/ir.types';
2
+ import { RuntimeHostInputSource } from '../../../runtime/domain/runtime-host.types';
3
+ export declare const ENDGE_UI_JSON_FORMAT = "endge-ui/v1";
4
+ export declare const ENDGE_UI_JSON_ADAPTER_ID = "endge-ui-json";
5
+ export declare const ENDGE_UI_JSON_RENDERER = "json";
6
+ export type EndgeUIJsonValue = null | boolean | number | string | EndgeUIJsonValue[] | {
7
+ [key: string]: EndgeUIJsonValue;
8
+ };
9
+ export type EndgeUISyntheticNodeType = '#text' | '#row' | '#cell';
10
+ export type EndgeUINodeType = RComponentSFC_IR_Tag | EndgeUISyntheticNodeType;
11
+ export interface EndgeUIMarker {
12
+ code: string;
13
+ severity: 'info' | 'warning' | 'error';
14
+ message: string;
15
+ }
16
+ export interface EndgeUIEditableState {
17
+ active: boolean;
18
+ value: EndgeUIJsonValue;
19
+ draft?: EndgeUIJsonValue;
20
+ triggers: EndgeUIJsonValue[];
21
+ }
22
+ export interface EndgeUIMenuItem {
23
+ kind: 'item';
24
+ id: string;
25
+ label: string;
26
+ action: string;
27
+ icon?: string;
28
+ disabled?: boolean;
29
+ }
30
+ export interface EndgeUIMenuSeparator {
31
+ kind: 'separator';
32
+ id: string;
33
+ }
34
+ export interface EndgeUIMenu {
35
+ items: Array<EndgeUIMenuItem | EndgeUIMenuSeparator>;
36
+ }
37
+ export interface EndgeUITableColumn {
38
+ key: string;
39
+ title: string;
40
+ width?: number;
41
+ align?: string;
42
+ sortable?: boolean;
43
+ menu?: EndgeUIMenu;
44
+ }
45
+ export interface EndgeUITableState {
46
+ rowKey: string;
47
+ columns: EndgeUITableColumn[];
48
+ rowCount: number;
49
+ offset: number;
50
+ limit: number;
51
+ }
52
+ export interface EndgeUINode {
53
+ id: string;
54
+ type: EndgeUINodeType;
55
+ props: Record<string, EndgeUIJsonValue>;
56
+ children: EndgeUINode[];
57
+ text?: string;
58
+ events?: string[];
59
+ classes?: string[];
60
+ states?: string[];
61
+ parts?: string[];
62
+ style?: Record<string, string>;
63
+ component?: string;
64
+ editable?: EndgeUIEditableState;
65
+ table?: EndgeUITableState;
66
+ menu?: EndgeUIMenu;
67
+ markers?: EndgeUIMarker[];
68
+ }
69
+ export interface EndgeUIJsonSnapshot {
70
+ format: typeof ENDGE_UI_JSON_FORMAT;
71
+ revision: number;
72
+ component: string | null;
73
+ roots: EndgeUINode[];
74
+ markers?: EndgeUIMarker[];
75
+ }
76
+ export type EndgeUIChildEntry = EndgeUINode | {
77
+ ref: string;
78
+ };
79
+ export type EndgeUINodeField = Exclude<keyof EndgeUINode, 'id' | 'type' | 'children'>;
80
+ export type EndgeUIPatchOperation = {
81
+ op: 'update';
82
+ id: string;
83
+ set?: Partial<Pick<EndgeUINode, EndgeUINodeField>>;
84
+ unset?: EndgeUINodeField[];
85
+ } | {
86
+ op: 'children';
87
+ id: string | null;
88
+ children: EndgeUIChildEntry[];
89
+ } | {
90
+ op: 'replace';
91
+ id: string;
92
+ node: EndgeUINode;
93
+ } | {
94
+ op: 'markers';
95
+ markers: EndgeUIMarker[];
96
+ };
97
+ export interface EndgeUIPatch {
98
+ format: typeof ENDGE_UI_JSON_FORMAT;
99
+ baseRevision: number;
100
+ revision: number;
101
+ ops: EndgeUIPatchOperation[];
102
+ }
103
+ export interface EndgeUIDispatchResult {
104
+ handled: boolean;
105
+ reason?: 'unknown-node' | 'unknown-event' | 'unmounted';
106
+ }
107
+ export interface EndgeUIJsonMountOptions {
108
+ input?: RuntimeHostInputSource;
109
+ locale?: string;
110
+ timezone?: string;
111
+ theme?: string;
112
+ tableRowLimit?: number;
113
+ schedule?: 'microtask' | 'sync';
114
+ }
115
+ export interface EndgeUIJsonMount {
116
+ snapshot: () => EndgeUIJsonSnapshot;
117
+ subscribe: (listener: (patch: EndgeUIPatch) => void) => () => void;
118
+ dispatch: (nodeId: string, event: string, payload?: unknown) => Promise<EndgeUIDispatchResult>;
119
+ refresh: () => EndgeUIPatch | null;
120
+ unmount: () => void;
121
+ }
@@ -5,10 +5,12 @@ import { UIActiveRenderAdapterRequirement, UIRenderAdapter, UIRenderAdapterDescr
5
5
  export declare class UIAdapterRegistry {
6
6
  private readonly _onChange;
7
7
  private _adapters;
8
+ private _sources;
8
9
  private _activeAdapterId;
9
10
  constructor(_onChange?: () => void);
10
11
  /**
11
12
  * Регистрирует adapter и запрещает неявную замену implementation с тем же id.
13
+ * Повторная регистрация того же объекта возвращает уже зарегистрированный adapter.
12
14
  */
13
15
  register<TImplementation>(input: UIRenderAdapter<TImplementation>): UIRenderAdapter<TImplementation>;
14
16
  /**
@@ -1,133 +1 @@
1
- import { AnyEndgeModule, EndgeFederationContextOf, EndgeFederationModuleAccessors, EndgeModuleDefinition, EndgeModuleDefinitions, EndgeModuleDescriptor } from './types/endge-modules.types';
2
- import { AnyEndgeFederation, EndgeChildFederationDefinition, EndgeChildFederationDefinitions, EndgeFederationContext, EndgeFederationDefinition, EndgeFederationDiagnosticsSnapshot, EndgeFederationDiagnosticsSnapshotOptions, EndgeFederationHost, EndgeFederationState, EndgeLifecycleNodeDescriptor, EndgePlugin } from './types/federation.types';
3
- type EndgeFederationPhase = 'setup' | 'load' | 'build' | 'start';
4
- declare const ENDGE_FEDERATION_CONTROL_KEY: unique symbol;
5
- type UnionToIntersection<TValue> = (TValue extends unknown ? (value: TValue) => void : never) extends ((value: infer TResult) => void) ? TResult : never;
6
- type EndgeChildFederationContext<TFederation> = TFederation extends {
7
- boot: (ctx: infer TContext) => Promise<void>;
8
- } ? TContext : EndgeFederationContext;
9
- type EndgeChildFederationsContext<TDefinitions extends EndgeChildFederationDefinitions> = [TDefinitions[number]] extends [never] ? EndgeFederationContext : UnionToIntersection<EndgeChildFederationContext<TDefinitions[number]['federation']>> extends infer TContext extends EndgeFederationContext ? TContext : EndgeFederationContext;
10
- type EndgeFederationConstructor = abstract new (...args: any[]) => EndgeFederation;
11
- type EndgeFederationStatics = Omit<typeof EndgeFederation, 'prototype' | 'boot' | 'build'>;
12
- type EndgeFederationAccessors<TDefinitions extends EndgeChildFederationDefinitions> = {
13
- readonly [TDefinition in TDefinitions[number] as TDefinition['key']]: TDefinition['federation'];
14
- };
15
- export type DefinedEndgeFederation<TDefinitions extends EndgeModuleDefinitions, TFederations extends EndgeChildFederationDefinitions = readonly [], TContext extends EndgeFederationContext = EndgeFederationContextOf<TDefinitions> & EndgeChildFederationsContext<TFederations>> = EndgeFederationConstructor & EndgeFederationStatics & EndgeFederationModuleAccessors<TDefinitions> & EndgeFederationAccessors<TFederations> & {
16
- readonly prototype: EndgeFederation;
17
- boot: (ctx: TContext) => Promise<void>;
18
- build: (ctx?: TContext) => Promise<void>;
19
- };
20
- interface EndgeFederationControl {
21
- readonly id: string;
22
- attach: (parentFederationId: string) => void;
23
- createDiagnosticsSnapshot: (path: string[], options: EndgeFederationDiagnosticsSnapshotOptions) => EndgeFederationDiagnosticsSnapshot;
24
- configure: () => void;
25
- runPhase: (phase: EndgeFederationPhase, ctx: EndgeFederationContext) => Promise<void>;
26
- reset: () => Promise<void>;
27
- }
28
- /**
29
- * Общая статическая федерация lifecycle-узлов.
30
- * Хост федерации живёт в `globalThis`, поэтому один и тот же id
31
- * остаётся singleton даже при загрузке из разных пакетов/бандлов.
32
- */
33
- export declare abstract class EndgeFederation {
34
- protected static readonly federationId: string;
35
- protected static readonly federationDefinitionSignature: string | null;
36
- /**
37
- * Стабильная runtime identity Federation.
38
- */
39
- static get id(): string;
40
- /**
41
- * Создаёт Federation с ленивыми Modules и дочерними Federations.
42
- */
43
- static define<const TDefinitions extends EndgeModuleDefinitions, const TFederations extends EndgeChildFederationDefinitions = readonly []>(definition: EndgeFederationDefinition<TDefinitions, TFederations>): DefinedEndgeFederation<TDefinitions, TFederations>;
44
- static get isInitialized(): boolean;
45
- static get isConfigured(): boolean;
46
- static get state(): EndgeFederationState;
47
- static get lastError(): unknown | null;
48
- /**
49
- * Рекурсивно снимает диагностическое состояние явного Federation graph.
50
- */
51
- static createDiagnosticsSnapshot(options?: EndgeFederationDiagnosticsSnapshotOptions): EndgeFederationDiagnosticsSnapshot;
52
- /**
53
- * Хук одноразовой декларации собственных lifecycle-узлов Federation.
54
- */
55
- protected static configureFederation(): void;
56
- /**
57
- * Selects the lifecycle graph without creating a second owner for its nodes.
58
- */
59
- protected static selectLifecycleNodes(nodes: readonly EndgeLifecycleNodeDescriptor[], _ctx: EndgeFederationContext): readonly EndgeLifecycleNodeDescriptor[];
60
- /**
61
- * Запускает всё дерево Federation по pipeline `setup -> load -> build -> start`.
62
- */
63
- static boot(ctx: EndgeFederationContext): Promise<void>;
64
- private static _selectLifecycleNodes;
65
- private static _runBoot;
66
- /**
67
- * Регистрирует декларативное расширение до configuration Federation.
68
- */
69
- static use(plugin: EndgePlugin): void;
70
- /**
71
- * Декларирует уже созданный Module во время custom configuration.
72
- */
73
- static defineModule<T extends AnyEndgeModule>(descriptor: EndgeModuleDescriptor<T>): T;
74
- static defineModules(descriptors: readonly EndgeModuleDescriptor[]): void;
75
- /**
76
- * Декларирует лениво создаваемые Modules во время configuration.
77
- */
78
- protected static defineModuleDefinitions(definitions: readonly EndgeModuleDefinition[]): void;
79
- /**
80
- * Декларирует дочернюю Federation как composite lifecycle-узел.
81
- */
82
- static defineFederation(definition: EndgeChildFederationDefinition): void;
83
- static defineFederations(definitions: readonly EndgeChildFederationDefinition[]): void;
84
- protected static setup(ctx?: EndgeFederationContext, touchedNodes?: Set<EndgeLifecycleNodeDescriptor>): Promise<void>;
85
- protected static load(ctx?: EndgeFederationContext, touchedNodes?: Set<EndgeLifecycleNodeDescriptor>): Promise<void>;
86
- static build(ctx?: EndgeFederationContext): Promise<void>;
87
- protected static start(ctx?: EndgeFederationContext, touchedNodes?: Set<EndgeLifecycleNodeDescriptor>): Promise<void>;
88
- /**
89
- * Сбрасывает всё дерево в обратном dependency order.
90
- */
91
- static reset(): Promise<void>;
92
- private static _runReset;
93
- private static _buildPhase;
94
- private static _runPhase;
95
- private static _resetNodes;
96
- private static _finishBuild;
97
- private static _finishReset;
98
- static getModule<T extends AnyEndgeModule = AnyEndgeModule>(key: string): T;
99
- static tryGetModule<T extends AnyEndgeModule = AnyEndgeModule>(key: string): T | null;
100
- static hasModule(key: string): boolean;
101
- static getFederation<T extends AnyEndgeFederation = AnyEndgeFederation>(key: string): T;
102
- static tryGetFederation<T extends AnyEndgeFederation = AnyEndgeFederation>(key: string): T | null;
103
- static hasFederation(key: string): boolean;
104
- protected static get host(): EndgeFederationHost;
105
- private static _ensureConfigured;
106
- private static _getFederationId;
107
- private static _createHost;
108
- private static _getOrCreateHost;
109
- private static _normalizeHost;
110
- private static _normalizeModuleDefinitions;
111
- private static _normalizeFederationDefinitions;
112
- private static _normalizeNodeKey;
113
- private static _requireBootContext;
114
- private static _requireConfiguringHost;
115
- private static _assertNodeKeyAvailable;
116
- private static _validatePluginKeys;
117
- private static _installPlugins;
118
- private static _finalizeNodes;
119
- private static _defineAccessors;
120
- private static _defineHostAccessors;
121
- private static _assertAccessorAvailable;
122
- private static _defineAccessor;
123
- private static _createDefinitionSignature;
124
- private static _createPluginSignature;
125
- private static _getFederationControl;
126
- protected static [ENDGE_FEDERATION_CONTROL_KEY](): EndgeFederationControl;
127
- private static _createDiagnosticsSnapshot;
128
- private static _attachToParent;
129
- private static _runAttachedPhase;
130
- private static _resetAttached;
131
- private static _registry;
132
- }
133
- export {};
1
+ export * from '@typedworks/federation';
@@ -1,58 +1 @@
1
- import { EndgeFederationContext } from './types/federation.types';
2
- import { Subscribable } from '@endge/utils';
3
- /**
4
- * Базовый модуль федерации.
5
- * Все модули являются `Subscribable` и при необходимости могут уведомлять подписчиков через `notify()`.
6
- */
7
- export declare abstract class EndgeModule<TContext extends EndgeFederationContext = EndgeFederationContext> extends Subscribable {
8
- protected readonly _contextType: TContext;
9
- /**
10
- * Подготавливает модуль до загрузки данных.
11
- * Используется для настройки зависимостей, клиентов, registry и базовых опций.
12
- * Метод можно не переопределять.
13
- */
14
- setup(_ctx: TContext): void | Promise<void>;
15
- /**
16
- * Участвует в загрузке данных движка.
17
- * Модуль выполняет только свою часть загрузки или принятия данных.
18
- * Метод можно не переопределять.
19
- */
20
- load(_ctx: TContext): void | Promise<void>;
21
- /**
22
- * Строит производные структуры из загруженных данных.
23
- * Здесь уместны normalize, validate, index и compile.
24
- * Метод можно не переопределять.
25
- */
26
- build(_ctx: TContext): void | Promise<void>;
27
- /**
28
- * Запускает живую инфраструктуру модуля после `load/build`.
29
- * Здесь уместны subscriptions, runtime phases, watchers, adapters и debug hooks.
30
- * Метод можно не переопределять.
31
- */
32
- start(_ctx: TContext): void | Promise<void>;
33
- /**
34
- * Сбрасывает runtime-состояние модуля.
35
- * После `reset()` федерация может быть повторно инициализирована тем же набором модулей.
36
- * Метод можно не переопределять.
37
- */
38
- reset(): void | Promise<void>;
39
- /**
40
- * Возвращает состояние Module для общего диагностического snapshot.
41
- * По умолчанию используется persistence-проекция `serialize()`; Module может
42
- * переопределить метод более подробным или безопасным диагностическим представлением.
43
- * Снимки принадлежащих Module submodules явно включает их родитель.
44
- */
45
- createDiagnosticsSnapshot(): unknown;
46
- /**
47
- * Возвращает сериализуемый snapshot состояния модуля.
48
- * Конкретный persistent Module сам определяет storage contract и момент сохранения.
49
- * Если сохранять нечего, можно вернуть `undefined` или не переопределять метод.
50
- */
51
- serialize(): unknown;
52
- /**
53
- * Восстанавливает состояние модуля из snapshot, полученного его persistence owner.
54
- * `undefined` означает отсутствие сохранённого состояния и должен обрабатываться как дефолтный сценарий.
55
- * Метод можно не переопределять.
56
- */
57
- deserialize(_payload: unknown): void;
58
- }
1
+ export * from '@typedworks/federation';
@@ -1 +1 @@
1
- export declare const ENDGE_FEDERATION_REGISTRY_KEY: unique symbol;
1
+ export * from '@typedworks/federation';
@@ -1,9 +1 @@
1
- import { EndgeModuleDescriptor } from '../types/endge-modules.types';
2
- interface EndgeOrderedDescriptor {
3
- readonly key: string;
4
- readonly before?: string | readonly string[];
5
- readonly after?: string | readonly string[];
6
- }
7
- export declare function sortEndgeOrderedDescriptors<TDescriptor extends EndgeOrderedDescriptor>(descriptors: readonly TDescriptor[]): TDescriptor[];
8
- export declare function sortEndgeModuleDescriptors(descriptors: EndgeModuleDescriptor[]): EndgeModuleDescriptor[];
9
- export {};
1
+ export * from '@typedworks/federation';
@@ -1,28 +1 @@
1
- import { EndgeModule } from '../EndgeModule';
2
- import { EndgeFederationContext, EndgeFederationDiagnosticsSnapshot, EndgeFederationDiagnosticsSnapshotOptions } from './federation.types';
3
- export type AnyEndgeModule = EndgeModule<any>;
4
- export type EndgeModuleOrder = string | readonly string[];
5
- export interface EndgeModuleFactoryContext {
6
- getModule: <T extends AnyEndgeModule = AnyEndgeModule>(key: string) => T;
7
- createDiagnosticsSnapshot: (options?: EndgeFederationDiagnosticsSnapshotOptions) => EndgeFederationDiagnosticsSnapshot;
8
- }
9
- export interface EndgeModuleDefinition<TKey extends string = string, TModule extends AnyEndgeModule = AnyEndgeModule> {
10
- readonly key: TKey;
11
- readonly create: (context: EndgeModuleFactoryContext) => TModule;
12
- readonly before?: EndgeModuleOrder;
13
- readonly after?: EndgeModuleOrder;
14
- }
15
- export interface EndgeModuleDescriptor<T extends AnyEndgeModule = AnyEndgeModule> {
16
- key: string;
17
- module: T;
18
- before?: EndgeModuleOrder;
19
- after?: EndgeModuleOrder;
20
- }
21
- export type EndgeModuleDefinitions = readonly EndgeModuleDefinition[];
22
- export type EndgeModuleContext<TModule extends AnyEndgeModule> = TModule extends EndgeModule<infer TContext> ? TContext : never;
23
- type UnionToIntersection<TValue> = (TValue extends unknown ? (value: TValue) => void : never) extends ((value: infer TResult) => void) ? TResult : never;
24
- export type EndgeFederationContextOf<TDefinitions extends EndgeModuleDefinitions> = UnionToIntersection<EndgeModuleContext<ReturnType<TDefinitions[number]['create']>>> extends infer TContext extends EndgeFederationContext ? TContext : EndgeFederationContext;
25
- export type EndgeFederationModuleAccessors<TDefinitions extends EndgeModuleDefinitions> = {
26
- readonly [TDefinition in TDefinitions[number] as TDefinition['key']]: ReturnType<TDefinition['create']>;
27
- };
28
- export {};
1
+ export * from '@typedworks/federation';
@@ -1,112 +1 @@
1
- import { EndgeModule } from '../EndgeModule';
2
- import { AnyEndgeModule, EndgeModuleDefinitions, EndgeModuleDescriptor, EndgeModuleOrder } from './endge-modules.types';
3
- export interface EndgeFederationContext {
4
- signal?: AbortSignal;
5
- }
6
- export type EndgeFederationState = 'idle' | 'booting' | 'ready' | 'building' | 'resetting' | 'failed';
7
- export type EndgeModuleDiagnosticsSnapshotStatus = 'captured' | 'empty' | 'skipped' | 'failed' | 'referenced';
8
- export interface EndgeModuleDiagnosticsSnapshotReference {
9
- federationId: string;
10
- key: string;
11
- path: string[];
12
- moduleName: string;
13
- }
14
- export interface EndgeFederationDiagnosticsSnapshotOptions {
15
- shouldCaptureModule?: (module: EndgeModuleDiagnosticsSnapshotReference) => boolean;
16
- }
17
- export interface EndgeModuleDiagnosticsSnapshotNode extends EndgeModuleDiagnosticsSnapshotReference {
18
- kind: 'module';
19
- status: EndgeModuleDiagnosticsSnapshotStatus;
20
- snapshot?: unknown;
21
- snapshotRef?: string;
22
- error?: string;
23
- }
24
- export interface EndgeChildFederationDiagnosticsSnapshotNode {
25
- kind: 'federation';
26
- key: string;
27
- path: string[];
28
- status: 'captured' | 'failed';
29
- federation?: EndgeFederationDiagnosticsSnapshot;
30
- error?: string;
31
- }
32
- export type EndgeFederationDiagnosticsSnapshotNode = EndgeModuleDiagnosticsSnapshotNode | EndgeChildFederationDiagnosticsSnapshotNode;
33
- export interface EndgeFederationDiagnosticsSnapshot {
34
- id: string;
35
- name: string;
36
- path: string[];
37
- state: EndgeFederationState;
38
- plugins: string[];
39
- nodes: EndgeFederationDiagnosticsSnapshotNode[];
40
- }
41
- export interface EndgeFederationFacade<in TContext extends EndgeFederationContext = EndgeFederationContext> {
42
- readonly id: string;
43
- readonly isConfigured: boolean;
44
- readonly isInitialized: boolean;
45
- readonly lastError: unknown | null;
46
- readonly state: EndgeFederationState;
47
- createDiagnosticsSnapshot: (options?: EndgeFederationDiagnosticsSnapshotOptions) => EndgeFederationDiagnosticsSnapshot;
48
- boot: (ctx: TContext) => Promise<void>;
49
- build: (ctx?: TContext) => Promise<void>;
50
- reset: () => Promise<void>;
51
- }
52
- export type AnyEndgeFederation = EndgeFederationFacade<any>;
53
- export interface EndgeChildFederationDefinition<TKey extends string = string, TFederation extends AnyEndgeFederation = AnyEndgeFederation> {
54
- readonly key: TKey;
55
- readonly federation: TFederation;
56
- readonly before?: EndgeModuleOrder;
57
- readonly after?: EndgeModuleOrder;
58
- }
59
- export type EndgeChildFederationDefinitions = readonly EndgeChildFederationDefinition[];
60
- export interface EndgePlugin<TModules extends EndgeModuleDefinitions = EndgeModuleDefinitions, TFederations extends EndgeChildFederationDefinitions = EndgeChildFederationDefinitions> {
61
- readonly id: string;
62
- readonly modules?: TModules;
63
- readonly federations?: TFederations;
64
- readonly selectLifecycleNodes?: (nodes: readonly EndgeLifecycleNodeDescriptor[], ctx: EndgeFederationContext) => readonly EndgeLifecycleNodeDescriptor[];
65
- }
66
- export interface EndgeFederationDefinition<TDefinitions extends EndgeModuleDefinitions, TFederations extends EndgeChildFederationDefinitions = readonly []> {
67
- readonly id: string;
68
- readonly name?: string;
69
- readonly modules: TDefinitions;
70
- readonly federations?: TFederations;
71
- readonly selectLifecycleNodes?: (nodes: readonly EndgeLifecycleNodeDescriptor[], ctx: EndgeFederationContext) => readonly EndgeLifecycleNodeDescriptor[];
72
- }
73
- export type EndgeLifecycleNodeDescriptor = {
74
- readonly kind: 'module';
75
- readonly key: string;
76
- readonly module: AnyEndgeModule;
77
- readonly before?: EndgeModuleOrder;
78
- readonly after?: EndgeModuleOrder;
79
- } | {
80
- readonly kind: 'federation';
81
- readonly key: string;
82
- readonly federation: AnyEndgeFederation;
83
- readonly before?: EndgeModuleOrder;
84
- readonly after?: EndgeModuleOrder;
85
- };
86
- export interface EndgeFederationHost {
87
- definitionSignature: string | null;
88
- parentFederationId: string | null;
89
- isConfigured: boolean;
90
- isConfiguring: boolean;
91
- isSetup: boolean;
92
- isInitialized: boolean;
93
- state: EndgeFederationState;
94
- lastError: unknown | null;
95
- bootContext: EndgeFederationContext | null;
96
- lifecycleNodes: readonly EndgeLifecycleNodeDescriptor[] | null;
97
- bootPromise: Promise<void> | null;
98
- resetPromise: Promise<void> | null;
99
- buildQueue: Promise<void>;
100
- pendingBuilds: number;
101
- moduleDefinitions: EndgeModuleDefinitions[number][];
102
- federationDefinitions: EndgeChildFederationDefinition[];
103
- moduleDescriptors: EndgeModuleDescriptor[];
104
- nodes: EndgeLifecycleNodeDescriptor[];
105
- modules: Map<string, EndgeModule<any>>;
106
- federations: Map<string, AnyEndgeFederation>;
107
- facades: Set<AnyEndgeFederation>;
108
- plugins: EndgePlugin[];
109
- pluginSignatures: Map<string, string>;
110
- installedPluginIds: Set<string>;
111
- attachedTouchedNodes: Set<EndgeLifecycleNodeDescriptor>;
112
- }
1
+ export * from '@typedworks/federation';
package/dist/main.d.ts CHANGED
@@ -63,6 +63,7 @@ export * from './features/core/modules/diagnostics/domain/entities/DiagnosticsRe
63
63
  export * from './features/core/modules/diagnostics/domain/entities/DiagnosticsSpan';
64
64
  export * from './features/core/modules/auth/domain/types/auth-profile.types';
65
65
  export * from './features/core/modules/auth/services/auth-context';
66
+ export * from './features/core/modules/auth/services/auth-facet-claims';
66
67
  export * from './features/core/modules/domain/types/component/component-core.types';
67
68
  export * from './features/core/modules/domain/types/component/component.types';
68
69
  export * from './features/core/modules/domain/types/component/sfc/source.types';
@@ -118,6 +119,8 @@ export * from './features/core/modules/context/domain/context-persistence.types'
118
119
  export * from './features/core/modules/context/domain/context-events.types';
119
120
  export * from './features/core/modules/context/domain/context-state.types';
120
121
  export * from './features/core/modules/runtime/domain/execution-context.types';
122
+ export * from './features/core/modules/runtime/domain/graphql-query-error';
123
+ export { GraphQLSseHttpError } from './features/core/modules/runtime/services/transports/BrowserGraphQLSseStreamTransportFactory';
121
124
  export * from './features/core/modules/runtime/domain/query-execution.types';
122
125
  export * from './features/core/modules/runtime/domain/runtime-entity-map.types';
123
126
  export * from './features/core/modules/runtime/domain/runtime-host.types';
@@ -156,6 +159,10 @@ export * from './features/core/modules/ui/domain/types/ui-composition.types';
156
159
  export * from './features/core/modules/ui/domain/types/ui-render-adapter.type';
157
160
  export * from './features/core/modules/ui/domain/types/tooltip-markdown.types';
158
161
  export * from './features/core/modules/ui/domain/types/ui.types';
162
+ export * from './features/core/modules/ui/domain/types/endge-ui-json.types';
163
+ export * from './features/core/modules/ui/adapters/json/endge-ui-json-adapter';
164
+ export * from './features/core/modules/ui/adapters/json/endge-ui-json-patch';
165
+ export * from './features/core/modules/ui/adapters/json/endge-ui-json.schema';
159
166
  export * from './features/core/modules/i18n/domain/i18n.types';
160
167
  export * from './features/core/modules/domain/entities/RAction';
161
168
  export * from './features/core/modules/domain/entities/RComponent';
@@ -260,6 +267,9 @@ export * from './features/core/modules/source/services/filter-source-patch';
260
267
  export * from './features/core/modules/source/services/vocab-source-patch';
261
268
  export * from './features/core/modules/source/services/compilers/vocab-source-compile';
262
269
  export * from './features/core/modules/source/services/type-source-serialize';
270
+ export * from './features/core/modules/source/services/graphql-schema';
271
+ export * from './features/core/modules/source/services/graphql-fragments';
272
+ export * from './features/core/modules/source/domain/types/graphql-fragments.types';
263
273
  export * from './features/core/modules/source/services/configuration-source-patch';
264
274
  export * from './features/core/modules/source/services/typescript-type-source';
265
275
  export * from './features/core/modules/source/services/component-sfc/component-sfc-visual-projection';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@endge/core",
3
3
  "type": "module",
4
- "version": "1.0.0-dev",
4
+ "version": "1.0.0-dev.12",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@8.8.0",
7
7
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "lint-fix": "eslint . --fix --cache"
35
35
  },
36
36
  "peerDependencies": {
37
- "@raphy-js/raph": "1.0.0-dev.2",
37
+ "@raphy-js/raph": "1.0.0-dev.18 || 1.0.1-dev.25 || 1.0.1-dev.26 || 1.0.1-dev.54",
38
38
  "class-transformer": "^0.5.1",
39
39
  "class-validator": "^0.14.1",
40
40
  "reflect-metadata": "^0.2.2"
@@ -43,7 +43,8 @@
43
43
  "@babel/generator": "^7.29.7",
44
44
  "@babel/parser": "^7.27.2",
45
45
  "@babel/types": "^7.27.1",
46
- "@endge/utils": "1.0.0-dev",
46
+ "@endge/utils": "1.0.0-dev.6",
47
+ "@typedworks/federation": "1.0.0-dev.1",
47
48
  "@vue/compiler-dom": "^3.5.24",
48
49
  "@vue/compiler-sfc": "^3.5.24",
49
50
  "axios": "^1.13.2",
@@ -62,9 +63,10 @@
62
63
  },
63
64
  "devDependencies": {
64
65
  "@antfu/eslint-config": "9.3.0",
65
- "@raphy-js/raph": "1.0.0-dev.2",
66
+ "@raphy-js/raph": "1.0.1-dev.54",
66
67
  "@types/babel__generator": "^7.27.0",
67
68
  "@types/lodash": "^4.14.202",
69
+ "@vitest/coverage-v8": "2.1.9",
68
70
  "@vue/language-core": "^3.3.11",
69
71
  "eslint": "10.9.1",
70
72
  "rimraf": "^6.0.1",