@endge/core 2.0.2 → 2.0.4
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/ReadMe.md +23 -0
- package/dist/core.cjs +339 -315
- package/dist/core.js +23848 -22580
- package/dist/domain/entities/reflect/RConverter.d.ts +3 -3
- package/dist/domain/entities/reflect/RVocabs.d.ts +10 -2
- package/dist/domain/entities/runtime/ComponentSFCEventBoundary.d.ts +5 -3
- package/dist/domain/types/component/component-core.types.d.ts +2 -2
- package/dist/domain/types/component/sfc/ir.types.d.ts +17 -3
- package/dist/domain/types/component/sfc/ports.types.d.ts +40 -2
- package/dist/domain/types/component/sfc/tag-input-contract.types.d.ts +24 -1
- package/dist/domain/types/component/sfc/visual-projection.types.d.ts +11 -2
- package/dist/domain/types/program/program.types.d.ts +7 -1
- package/dist/domain/types/runtime/action.types.d.ts +27 -1
- package/dist/domain/types/source/query-source.types.d.ts +4 -0
- package/dist/domain/types/source/response-output.types.d.ts +10 -0
- package/dist/domain/types/source/source-engine.types.d.ts +1 -1
- package/dist/domain/types/source/vocab-source.types.d.ts +37 -0
- package/dist/domain/types/ui/context-menu.types.d.ts +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/model/modules/domain/endge-vocabs.d.ts +20 -1
- package/dist/model/modules/program/endge-compiler.d.ts +5 -1
- package/dist/model/modules/program/endge-program.d.ts +3 -0
- package/dist/model/modules/runtime/core/endge-bind.d.ts +1 -1
- package/dist/model/modules/runtime/execution/endge-data-view.d.ts +2 -0
- package/dist/model/modules/runtime/execution/endge-response-output.d.ts +5 -0
- package/dist/model/services/compiler/component-sfc/component-sfc-compile.d.ts +1 -1
- package/dist/model/services/compiler/component-sfc/component-sfc-interactions.d.ts +1 -1
- package/dist/model/services/compiler/component-sfc/component-sfc-ports.d.ts +2 -2
- package/dist/model/services/compiler/component-sfc/component-sfc-table-menu.d.ts +6 -2
- package/dist/model/services/compiler/component-sfc/component-sfc-template.d.ts +5 -1
- package/dist/model/services/query/QueryExecutor.d.ts +2 -0
- package/dist/model/services/source-engine/compilers/vocab-source-compile.d.ts +2 -0
- package/dist/model/services/source-engine/strategies/VocabSourceEngineStrategy.d.ts +8 -0
- package/dist/model/services/source-engine/strategies/VocabSourceLanguageStrategy.d.ts +11 -0
- package/dist/model/services/source-engine/strategies/VocabSourcePatchStrategy.d.ts +9 -0
- package/dist/model/services/source-engine/templates/vocab.default.source.d.ts +1 -0
- package/dist/model/services/source-engine/vocab-source-patch.d.ts +10 -0
- package/dist/test/model/modules/domain/endge-vocabs-source.test.d.ts +1 -0
- package/package.json +4 -4
|
@@ -5,6 +5,7 @@ import { StoreSourceArtifact } from '../../../domain/types/source/store-source.t
|
|
|
5
5
|
import { StreamSourceArtifact } from '../../../domain/types/source/stream-source.types';
|
|
6
6
|
import { UpdateSourceArtifact } from '../../../domain/types/source/update-source.types';
|
|
7
7
|
import { TypeProgramCatalogEntry, TypeProgramPayload } from '../../../domain/types/source/type-source.types';
|
|
8
|
+
import { VocabProgramPayload } from '../../../domain/types/source/vocab-source.types';
|
|
8
9
|
import { EndgeModule } from '../../../domain/entities/endge/EndgeModule';
|
|
9
10
|
import { DataViewProgramPayload, EndgeProgramSnapshot, ProgramArtifact, ProgramArtifactRef, ProgramArtifactStatus, ComponentSFCTagRegistryEntry, ComputationProgramPayload, ProgramDiagnostic, ProgramEntityType, QueryProgramPayload, EndgeStyleProgramPayload } from '../../../domain/types/program/program.types';
|
|
10
11
|
/**
|
|
@@ -61,6 +62,8 @@ export declare class EndgeProgram extends EndgeModule {
|
|
|
61
62
|
getActionFlow(idOrIdentity: string | number): ActionCompiledFlow | null;
|
|
62
63
|
/** Возвращает compiled query artifact по id или identity. */
|
|
63
64
|
getQueryArtifact(idOrIdentity: string | number): ProgramArtifact<QueryProgramPayload> | null;
|
|
65
|
+
/** Возвращает compiled Vocab artifact по id или identity. */
|
|
66
|
+
getVocabArtifact(idOrIdentity: string | number): ProgramArtifact<VocabProgramPayload> | null;
|
|
64
67
|
/** Returns a compiled Computation artifact by id or identity. */
|
|
65
68
|
getComputationArtifact(idOrIdentity: string | number): ProgramArtifact<ComputationProgramPayload> | null;
|
|
66
69
|
/** Возвращает compiled DataView artifact по id или identity. */
|
|
@@ -22,7 +22,7 @@ export declare class EndgeBind extends EndgeModule {
|
|
|
22
22
|
* @param handler - функция (value) => convertedValue
|
|
23
23
|
* @returns true, если конвертер найден и обработчик установлен
|
|
24
24
|
*/
|
|
25
|
-
converter(identity: string, handler: (v: any) => any): boolean;
|
|
25
|
+
converter(identity: string, handler: (v: any, options?: Record<string, unknown>) => any): boolean;
|
|
26
26
|
/**
|
|
27
27
|
* Привязывает обработчик runtime-step в контексте конкретного action.
|
|
28
28
|
* @deprecated Для полного Action используйте Endge.actions.override(); этот API оставлен только для legacy runtimeAction nodes.
|
|
@@ -45,6 +45,8 @@ export declare class EndgeDataView {
|
|
|
45
45
|
private _createTools;
|
|
46
46
|
/** Минимальные built-in converters для preview v1. */
|
|
47
47
|
private _convert;
|
|
48
|
+
/** Applies one registered Converter to the current value as a whole. */
|
|
49
|
+
convert(identity: string, value: unknown, options?: Record<string, unknown>): unknown;
|
|
48
50
|
/** Читает dot-path из object/array без выбрасывания ошибок. */
|
|
49
51
|
private _path;
|
|
50
52
|
/** Ищет локальный DataView artifact среди child artifacts, включая вложенные children. */
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ProgramArtifact } from '../../../../domain/types/program/program.types';
|
|
2
|
+
import { DataViewRef } from '../../../../domain/types/source/data-view-source.types';
|
|
3
|
+
import { ResponseOutputTransform } from '../../../../domain/types/source/response-output.types';
|
|
4
|
+
/** Applies ordered Query/Vocab transforms without implicit array mapping. */
|
|
5
|
+
export declare function runResponseOutputTransforms(transforms: readonly ResponseOutputTransform[] | undefined, legacyDataViews: readonly DataViewRef[], value: unknown, children?: readonly ProgramArtifact[]): unknown;
|
|
@@ -42,7 +42,7 @@ export interface ComponentSFCCompileOptions {
|
|
|
42
42
|
/** Проверяет существование статической identity из Component is. */
|
|
43
43
|
hasComponentIdentity?: (identity: string) => boolean;
|
|
44
44
|
/** Resolves and describes a default port provider for build-time validation. */
|
|
45
|
-
resolvePortProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action') => ComponentSFCPortProviderDescriptor | null;
|
|
45
|
+
resolvePortProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action' | 'query') => ComponentSFCPortProviderDescriptor | null;
|
|
46
46
|
/** Resolves the compiled public port manifest of a nested SFC component. */
|
|
47
47
|
resolveComponentPortManifest?: (identity: string) => ComponentSFCPortManifest | null;
|
|
48
48
|
/** Resolves explicit root variants of one nested custom component. */
|
|
@@ -9,4 +9,4 @@ export interface ComponentSFCInteractionCompileContext {
|
|
|
9
9
|
/** Detects statically invalid passive/prevent combinations in shared trigger descriptors. */
|
|
10
10
|
export declare function hasComponentSFCPassivePreventConflict(source: string, suffixes?: readonly RComponentSFC_IR_EventModifier[]): boolean;
|
|
11
11
|
/** Compiles one source-owned `:on` annotation into renderer-neutral rules. */
|
|
12
|
-
export declare function compileComponentSFCInteractionAnnotation(attribute: RComponentSFC_AST_Attribute, manifest: ComponentSFCPortManifest | null, context: ComponentSFCInteractionCompileContext, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[]): RComponentSFC_IR_InteractionGroup | null;
|
|
12
|
+
export declare function compileComponentSFCInteractionAnnotation(attribute: RComponentSFC_AST_Attribute, manifest: ComponentSFCPortManifest | null, context: ComponentSFCInteractionCompileContext, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[], ownerPorts?: ComponentSFCPortManifest | null): RComponentSFC_IR_InteractionGroup | null;
|
|
@@ -3,11 +3,11 @@ import { TypeSourceDefinition } from '../../../../domain/types/source/type-sourc
|
|
|
3
3
|
import { ComponentSFCEventAction, ComponentSFCPortManifest, ComponentSFCPortProviderDescriptor, RComponentSFC_IR_PortCall } from '../../../../domain/types/component/sfc/ports.types';
|
|
4
4
|
import { RComponentSFC_AST_Script } from '../../../../domain/types/component/sfc/ast.types';
|
|
5
5
|
export interface ComponentSFCPortAnalysisOptions {
|
|
6
|
-
resolveProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action') => ComponentSFCPortProviderDescriptor | null;
|
|
6
|
+
resolveProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action' | 'query') => ComponentSFCPortProviderDescriptor | null;
|
|
7
7
|
resolveTypeDefinition?: (identity: string) => TypeSourceDefinition | null;
|
|
8
8
|
}
|
|
9
9
|
/** Compiles the safe reaction grammar used by local `@event` template bindings. */
|
|
10
|
-
export declare function compileComponentSFCLocalEventAction(eventName: string, source: string, sourceOffset: number, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[]): ComponentSFCEventAction | null;
|
|
10
|
+
export declare function compileComponentSFCLocalEventAction(eventName: string, source: string, sourceOffset: number, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[], ownerPorts?: ComponentSFCPortManifest | null): ComponentSFCEventAction | null;
|
|
11
11
|
export interface ComponentSFCPortAnalysisResult {
|
|
12
12
|
manifest: ComponentSFCPortManifest;
|
|
13
13
|
calls: RComponentSFC_IR_PortCall[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentSFCTableColumnMenuDescriptor, ComponentSFCTableRowMenuDescriptor, RComponentSFC_IR_ElementNode } from '../../../../domain/types/component/sfc/ir.types';
|
|
1
|
+
import { ComponentSFCTableColumnMenuDescriptor, ComponentSFCTableCellMenuDescriptor, ComponentSFCTableRowMenuDescriptor, RComponentSFC_IR_ElementNode } from '../../../../domain/types/component/sfc/ir.types';
|
|
2
2
|
import { ComponentSFCActionPort } from '../../../../domain/types/component/sfc/ports.types';
|
|
3
3
|
export declare const SFC_TABLE_COLUMN_MENU_MODES: readonly ["default", "disabled"];
|
|
4
|
-
export type { ComponentSFCTableColumnMenuDescriptor, ComponentSFCTableColumnMenuMode, ComponentSFCTableMenuDescriptor, ComponentSFCTableMenuItemDescriptor, ComponentSFCTableMenuNodeDescriptor, ComponentSFCTableMenuSeparatorDescriptor, ComponentSFCTableRowMenuDescriptor, ComponentSFCTableRowMenuMode, } from '../../../../domain/types/component/sfc/ir.types';
|
|
4
|
+
export type { ComponentSFCTableCellMenuDescriptor, ComponentSFCTableCellMenuMode, ComponentSFCTableColumnMenuDescriptor, ComponentSFCTableColumnMenuMode, ComponentSFCTableMenuDescriptor, ComponentSFCTableMenuItemDescriptor, ComponentSFCTableMenuNodeDescriptor, ComponentSFCTableMenuSeparatorDescriptor, ComponentSFCTableRowMenuDescriptor, ComponentSFCTableRowMenuMode, } from '../../../../domain/types/component/sfc/ir.types';
|
|
5
5
|
interface NormalizeMenuOptions {
|
|
6
6
|
availableActions?: ComponentSFCActionPort[];
|
|
7
7
|
}
|
|
@@ -9,6 +9,10 @@ interface NormalizeMenuOptions {
|
|
|
9
9
|
export declare function normalizeComponentSFCTableColumnMenu(tableNode: RComponentSFC_IR_ElementNode, actionsOrOptions?: ComponentSFCActionPort[] | NormalizeMenuOptions): ComponentSFCTableColumnMenuDescriptor;
|
|
10
10
|
/** Normalizes one optional row menu. Cell-aware values remain expressions until a right click occurs. */
|
|
11
11
|
export declare function normalizeComponentSFCTableRowMenu(tableNode: RComponentSFC_IR_ElementNode, actionsOrOptions?: ComponentSFCActionPort[] | NormalizeMenuOptions): ComponentSFCTableRowMenuDescriptor;
|
|
12
|
+
/** Normalizes the canonical Table > CellMenu, falling back to legacy Table > RowMenu. */
|
|
13
|
+
export declare function normalizeComponentSFCTableCellMenu(tableNode: RComponentSFC_IR_ElementNode, actionsOrOptions?: ComponentSFCActionPort[] | NormalizeMenuOptions): ComponentSFCTableCellMenuDescriptor;
|
|
14
|
+
/** Normalizes an optional Column > CellMenu override; `cell-menu="none"` disables the default. */
|
|
15
|
+
export declare function normalizeComponentSFCColumnCellMenu(tableNode: RComponentSFC_IR_ElementNode, columnNode: RComponentSFC_IR_ElementNode, actionsOrOptions?: ComponentSFCActionPort[] | NormalizeMenuOptions): ComponentSFCTableCellMenuDescriptor | undefined;
|
|
12
16
|
/** Reads a compile-time MenuItem reference to one Action port. */
|
|
13
17
|
export declare function readComponentSFCTableMenuActionPortReference(source: string): {
|
|
14
18
|
name: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RComponentDependencies, RComponentDiagnostic } from '../../../../domain/types/component/component-core.types';
|
|
2
2
|
import { RComponentSFC_AST_Template } from '../../../../domain/types/component/sfc/ast.types';
|
|
3
3
|
import { RComponentSFC_IR_Template } from '../../../../domain/types/component/sfc/ir.types';
|
|
4
|
-
import { ComponentSFCComponentPort, ComponentSFCPortManifest } from '../../../../domain/types/component/sfc/ports.types';
|
|
4
|
+
import { ComponentSFCComponentPort, ComponentSFCPortProviderDescriptor, ComponentSFCRequiredPortKind, ComponentSFCPortManifest } from '../../../../domain/types/component/sfc/ports.types';
|
|
5
5
|
import { ProgramNodeMetadata } from '../../../../domain/types/program/program-metadata.types';
|
|
6
6
|
import { EndgeSFCEditingConfiguration } from '../../../../domain/types/configuration/configuration.type';
|
|
7
7
|
/** Контекст компиляции template в IR. */
|
|
@@ -12,12 +12,16 @@ export interface ComponentSFCTemplateCompileContext {
|
|
|
12
12
|
locals: string[];
|
|
13
13
|
/** Local component ports have priority over the global user tag registry. */
|
|
14
14
|
componentPorts?: ComponentSFCComponentPort[];
|
|
15
|
+
/** Required ports owned by the Component SFC currently being compiled. */
|
|
16
|
+
ownerPorts?: ComponentSFCPortManifest | null;
|
|
15
17
|
/** Разрешает зарегистрированный пользовательский tag в identity компонента. */
|
|
16
18
|
resolveComponentTag?: (tag: string) => string | null;
|
|
17
19
|
/** Проверяет статическую identity из Component is. */
|
|
18
20
|
hasComponentIdentity?: (identity: string) => boolean;
|
|
19
21
|
/** Resolves public Events of a nested user Component for local `@event` bindings. */
|
|
20
22
|
resolveComponentPortManifest?: (identity: string) => ComponentSFCPortManifest | null;
|
|
23
|
+
/** Resolves static providers used by flat child port bindings. */
|
|
24
|
+
resolvePortProvider?: (identity: string, expectedKind: ComponentSFCRequiredPortKind) => ComponentSFCPortProviderDescriptor | null;
|
|
21
25
|
/** Resolves explicit root Variant names of a nested custom component. */
|
|
22
26
|
resolveComponentVariants?: (identity: string) => string[] | null;
|
|
23
27
|
/** Effective defaults завершения edit session для текущего build context. */
|
|
@@ -16,6 +16,8 @@ export declare class QueryExecutor {
|
|
|
16
16
|
/** Выполняет REST artifact. */
|
|
17
17
|
private _runRest;
|
|
18
18
|
private _throwHttpError;
|
|
19
|
+
/** Пишет краткую transport-индикацию без request body, headers и response payload. */
|
|
20
|
+
private _writeRequestError;
|
|
19
21
|
/** Публикует runtime warning безопасного expression evaluator. */
|
|
20
22
|
private _writeExpressionWarning;
|
|
21
23
|
private _asRecord;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SourceEngineCompileResult, SourceEngineOperation, SourceEngineResult, SourceEngineStrategy, SourceKind } from '../../../../domain/types/source/source-engine.types';
|
|
2
|
+
export declare class VocabSourceEngineStrategy implements SourceEngineStrategy {
|
|
3
|
+
readonly id = "source:vocab";
|
|
4
|
+
readonly sourceKind: SourceKind;
|
|
5
|
+
supports(sourceKind: SourceKind | string): boolean;
|
|
6
|
+
execute(_operation: SourceEngineOperation): SourceEngineResult;
|
|
7
|
+
compile(source: string): SourceEngineCompileResult;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SourceKind, SourceLanguageCompletion, SourceLanguageContext, SourceLanguageStrategy, SourceLanguageValidationResult } from '../../../../domain/types/source/source-engine.types';
|
|
2
|
+
export declare class VocabSourceLanguageStrategy implements SourceLanguageStrategy {
|
|
3
|
+
readonly id = "source-language:vocab";
|
|
4
|
+
readonly sourceKind: SourceKind;
|
|
5
|
+
readonly syntax: import('../../../../domain/types/source/source-engine.types').SourceLanguageSyntaxDefinition;
|
|
6
|
+
supports(sourceKind: SourceKind | string): boolean;
|
|
7
|
+
createDefaultSource(): string;
|
|
8
|
+
validate(source: string): SourceLanguageValidationResult;
|
|
9
|
+
completions(_context: SourceLanguageContext): SourceLanguageCompletion[];
|
|
10
|
+
resolveReference(context: SourceLanguageContext): import('../../../../domain/types/source/source-engine.types').SourceDocumentReference | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VocabSourceDocument, VocabSourcePatch } from '../../../../domain/types/source/vocab-source.types';
|
|
2
|
+
import { SourceKind, SourceParseResult, SourcePatchResult, SourcePatchStrategy } from '../../../../domain/types/source/source-engine.types';
|
|
3
|
+
export declare class VocabSourcePatchStrategy implements SourcePatchStrategy<VocabSourcePatch, VocabSourceDocument> {
|
|
4
|
+
readonly id = "source-patch:vocab";
|
|
5
|
+
readonly sourceKind: SourceKind;
|
|
6
|
+
supports(sourceKind: SourceKind | string): boolean;
|
|
7
|
+
parse(source: string): SourceParseResult<VocabSourceDocument>;
|
|
8
|
+
patch(source: string, patch: VocabSourcePatch): SourcePatchResult<VocabSourceDocument>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VOCAB_DEFAULT_SOURCE = "defineVocab({\n outputs: {\n items: output()\n .from(response()),\n },\n})\n";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VocabSourceDocument, VocabSourcePatch } from '../../../domain/types/source/vocab-source.types';
|
|
2
|
+
import { SourcePatchResult } from '../../../domain/types/source/source-engine.types';
|
|
3
|
+
export declare function parseVocabSource(source: string): {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
ast: {} | undefined;
|
|
6
|
+
document: VocabSourceDocument | undefined;
|
|
7
|
+
diagnostics: Omit<import('../../../main').ProgramDiagnostic, "entityRef">[];
|
|
8
|
+
message: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare function patchVocabSource(source: string, patch: VocabSourcePatch): SourcePatchResult<VocabSourceDocument>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@endge/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/parser": "^7.27.2",
|
|
31
31
|
"@babel/types": "^7.27.1",
|
|
32
|
-
"@endge/utils": "^0.24.
|
|
32
|
+
"@endge/utils": "^0.24.12",
|
|
33
33
|
"@vue/compiler-dom": "^3.5.24",
|
|
34
34
|
"@vue/compiler-sfc": "^3.5.24",
|
|
35
35
|
"axios": "^1.13.2",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"yaml": "^2.8.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@endge/raph": "^3.0.
|
|
50
|
-
"@endge/utils": "^0.24.
|
|
49
|
+
"@endge/raph": "^3.0.10",
|
|
50
|
+
"@endge/utils": "^0.24.12",
|
|
51
51
|
"@primevue/themes": "^4.0.0-rc.1",
|
|
52
52
|
"class-transformer": "^0.5.1",
|
|
53
53
|
"class-validator": "^0.14.1",
|