@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.
- package/dist/core.js +57297 -45976
- package/dist/features/core/kernel/config/modules.config.d.ts +7 -7
- package/dist/features/core/kernel/endge.d.ts +9 -9
- package/dist/features/core/modules/auth/EndgeAuth_Module.d.ts +9 -1
- package/dist/features/core/modules/auth/domain/types/auth-profile.types.d.ts +17 -0
- package/dist/features/core/modules/auth/services/auth-facet-claims.d.ts +5 -0
- package/dist/features/core/modules/compiler/EndgeCompiler_Module.d.ts +9 -0
- package/dist/features/core/modules/computations/model/ComputationResource.d.ts +1 -0
- package/dist/features/core/modules/computations/model/ComputationResourceRegistry.d.ts +1 -0
- package/dist/features/core/modules/context/EndgeContext_Module.d.ts +1 -0
- package/dist/features/core/modules/context/domain/context-persistence.types.d.ts +1 -0
- package/dist/features/core/modules/document-import/services/parsers/GraphQLDocumentImportParser.d.ts +3 -2
- package/dist/features/core/modules/program/domain/types/program.types.d.ts +3 -1
- package/dist/features/core/modules/runtime/RuntimeHostBase.d.ts +5 -1
- package/dist/features/core/modules/runtime/adapters/QueryExecutor_Adapter.d.ts +42 -3
- package/dist/features/core/modules/runtime/domain/graphql-query-error.d.ts +73 -0
- package/dist/features/core/modules/runtime/domain/query-execution.types.d.ts +25 -1
- package/dist/features/core/modules/runtime/domain/runtime-host.types.d.ts +6 -5
- package/dist/features/core/modules/runtime/domain/stream-runtime.types.d.ts +8 -1
- package/dist/features/core/modules/runtime/execution/endge-data-view.d.ts +1 -1
- package/dist/features/core/modules/runtime/execution/endge-query.d.ts +19 -2
- package/dist/features/core/modules/runtime/helpers/raph-phases/runtime-boundary-update-phase.d.ts +5 -9
- package/dist/features/core/modules/runtime/hosts/ComponentSFCRuntimeHost.d.ts +0 -1
- package/dist/features/core/modules/runtime/hosts/CompositionRuntimeHost.d.ts +9 -0
- package/dist/features/core/modules/runtime/hosts/QueryRuntimeHost.d.ts +8 -1
- package/dist/features/core/modules/runtime/hosts/SimulationRuntimeHost.d.ts +1 -0
- package/dist/features/core/modules/runtime/hosts/StreamRuntimeHost.d.ts +30 -0
- package/dist/features/core/modules/runtime/services/simulation/prepare-simulation-overrides.d.ts +7 -5
- package/dist/features/core/modules/runtime/services/transports/BrowserGraphQLSseStreamTransportFactory.d.ts +24 -0
- package/dist/features/core/modules/runtime/services/transports/BrowserSseStreamTransportFactory.d.ts +13 -1
- package/dist/features/core/modules/source/EndgeSource_Module.d.ts +6 -0
- package/dist/features/core/modules/source/domain/types/composition-source.types.d.ts +4 -0
- package/dist/features/core/modules/source/domain/types/data-view-source.types.d.ts +5 -2
- package/dist/features/core/modules/source/domain/types/graphql-fragments.types.d.ts +17 -0
- package/dist/features/core/modules/source/domain/types/query-source.types.d.ts +4 -1
- package/dist/features/core/modules/source/domain/types/simulation-source.types.d.ts +8 -0
- package/dist/features/core/modules/source/domain/types/source-context.types.d.ts +6 -0
- package/dist/features/core/modules/source/domain/types/source-engine.types.d.ts +3 -0
- package/dist/features/core/modules/source/domain/types/source-expression.types.d.ts +3 -1
- package/dist/features/core/modules/source/domain/types/stream-source.types.d.ts +29 -1
- package/dist/features/core/modules/source/domain/types/type-source.types.d.ts +11 -6
- package/dist/features/core/modules/source/services/SimulationSourceResolver.d.ts +6 -0
- package/dist/features/core/modules/source/services/compilers/graphql-operation-compile.d.ts +52 -0
- package/dist/features/core/modules/source/services/compilers/source-expression-compile.d.ts +21 -0
- package/dist/features/core/modules/source/services/compilers/source-model-reference-compile.d.ts +11 -1
- package/dist/features/core/modules/source/services/composition-activation.d.ts +6 -1
- package/dist/features/core/modules/source/services/graphql-fragments.d.ts +23 -0
- package/dist/features/core/modules/source/services/graphql-schema.d.ts +37 -0
- package/dist/features/core/modules/source/services/simulation-response-contract.d.ts +23 -0
- package/dist/features/core/modules/source/services/source-context.d.ts +13 -0
- package/dist/features/core/modules/source/services/type-extends.d.ts +15 -0
- package/dist/features/core/modules/source/services/value-expression-language.d.ts +2 -0
- package/dist/features/core/modules/source/services/value-path.d.ts +14 -0
- package/dist/features/core/modules/ui/EndgeUIRegistry_Module.d.ts +5 -0
- package/dist/features/core/modules/ui/adapters/json/EndgeUIJsonRenderer.d.ts +57 -0
- package/dist/features/core/modules/ui/adapters/json/endge-ui-json-adapter.d.ts +16 -0
- package/dist/features/core/modules/ui/adapters/json/endge-ui-json-patch.d.ts +3 -0
- package/dist/features/core/modules/ui/adapters/json/endge-ui-json.schema.d.ts +371 -0
- package/dist/features/core/modules/ui/domain/types/endge-ui-json.types.d.ts +121 -0
- package/dist/features/core/modules/ui/registry/UIAdapterRegistry.d.ts +2 -0
- package/dist/features/federation/EndgeFederation.d.ts +1 -133
- package/dist/features/federation/EndgeModule.d.ts +1 -58
- package/dist/features/federation/constants/federation.constants.d.ts +1 -1
- package/dist/features/federation/tools/sort-endge-modules.d.ts +1 -9
- package/dist/features/federation/types/endge-modules.types.d.ts +1 -28
- package/dist/features/federation/types/federation.types.d.ts +1 -112
- package/dist/main.d.ts +10 -0
- package/package.json +6 -4
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import { CompositionActivationDescriptor } from '../domain/types/composition-source.types';
|
|
1
|
+
import { CompositionActivationDescriptor, CompositionScopeDescriptor } from '../domain/types/composition-source.types';
|
|
2
2
|
export declare function resolveCompositionActivation(invocationOverride: CompositionActivationDescriptor | null | undefined, targetRoot: CompositionActivationDescriptor | null | undefined, ownerScope: CompositionActivationDescriptor | null | undefined): CompositionActivationDescriptor;
|
|
3
|
+
/**
|
|
4
|
+
* Активация содержимого scope: `effectiveActivation` scope описывает его собственный запуск
|
|
5
|
+
* относительно владельца, а runtime внутри scope с `.activateWhen(...)` стартуют вместе с ним.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveScopeContentActivation(scope: Pick<CompositionScopeDescriptor, 'effectiveActivation' | 'activateWhen'> | null | undefined): CompositionActivationDescriptor | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
|
+
import { GraphQLDocumentFragments, GraphQLDocumentVariant } from '../domain/types/graphql-fragments.types';
|
|
3
|
+
import { GraphQLDocumentDiagnostic, GraphQLSchemaInput } from './graphql-schema';
|
|
4
|
+
export interface GraphQLDocumentUsage {
|
|
5
|
+
spreads: Set<string>;
|
|
6
|
+
variables: Set<string>;
|
|
7
|
+
}
|
|
8
|
+
export declare function collectGraphQLDocumentUsage(document: DocumentNode): GraphQLDocumentUsage;
|
|
9
|
+
/**
|
|
10
|
+
* Подставляет фрагменты в document operation: добавляются только фрагменты, достижимые из
|
|
11
|
+
* operation (в том числе через вложенные spread). `pick` выбирает текст фрагмента по имени.
|
|
12
|
+
*/
|
|
13
|
+
export declare function composeGraphQLDocument(operation: string, pick: (name: string) => string | undefined): string;
|
|
14
|
+
/**
|
|
15
|
+
* Возвращает document для каждого различимого сочетания фасетов: default и условие каждого
|
|
16
|
+
* case всех фрагментов. Одинаковые documents объединяются (остаётся первое сочетание).
|
|
17
|
+
*/
|
|
18
|
+
export declare function createGraphQLDocumentVariants(source: GraphQLDocumentFragments): GraphQLDocumentVariant[];
|
|
19
|
+
export interface GraphQLDocumentVariantValidation extends GraphQLDocumentVariant {
|
|
20
|
+
diagnostics: GraphQLDocumentDiagnostic[];
|
|
21
|
+
}
|
|
22
|
+
export declare function validateGraphQLDocumentVariants(schema: GraphQLSchemaInput, source: GraphQLDocumentFragments): GraphQLDocumentVariantValidation[];
|
|
23
|
+
export declare function readGraphQLFragmentDefinitions(document: DocumentNode): Set<string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IntrospectionOptions, IntrospectionQuery, GraphQLSchema } from 'graphql';
|
|
2
|
+
export type GraphQLIntrospectionResult = IntrospectionQuery | {
|
|
3
|
+
data?: IntrospectionQuery | null;
|
|
4
|
+
errors?: readonly unknown[];
|
|
5
|
+
};
|
|
6
|
+
export type GraphQLSchemaInput = string | GraphQLSchema | GraphQLIntrospectionResult;
|
|
7
|
+
export interface GraphQLDocumentDiagnostic {
|
|
8
|
+
severity: 'error' | 'warning';
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
line?: number;
|
|
12
|
+
column?: number;
|
|
13
|
+
endLine?: number;
|
|
14
|
+
endColumn?: number;
|
|
15
|
+
offset?: number;
|
|
16
|
+
length?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GraphQLSchemaLoadResult {
|
|
19
|
+
schema: GraphQLSchema | null;
|
|
20
|
+
format: 'schema' | 'sdl' | 'introspection' | null;
|
|
21
|
+
diagnostics: GraphQLDocumentDiagnostic[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Возвращает текст стандартного introspection-запроса для загрузки схемы с endpoint.
|
|
25
|
+
* По умолчанию запрашивает descriptions и не использует расширения, которые поддерживают не все серверы.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createGraphQLIntrospectionQuery(options?: IntrospectionOptions): string;
|
|
28
|
+
/**
|
|
29
|
+
* Строит GraphQLSchema из SDL или результата introspection без обращения к сети.
|
|
30
|
+
* Результат для одного и того же объекта (и последней строки) кэшируется.
|
|
31
|
+
*/
|
|
32
|
+
export declare function loadGraphQLSchema(input: GraphQLSchemaInput): GraphQLSchemaLoadResult;
|
|
33
|
+
/**
|
|
34
|
+
* Проверяет GraphQL document по сохранённой схеме: синтаксис и стандартные правила спецификации
|
|
35
|
+
* (поля, аргументы, типы и использование переменных, фрагменты). Сеть не используется.
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateGraphQLDocument(schema: GraphQLSchemaInput, source: string): GraphQLDocumentDiagnostic[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { QueryOutputSource } from '../domain/types/query-source.types';
|
|
2
|
+
import { SourceFieldDefinition } from '../domain/types/source-expression.types';
|
|
3
|
+
export interface SimulationResponseOutput {
|
|
4
|
+
source: QueryOutputSource;
|
|
5
|
+
transforms?: readonly unknown[];
|
|
6
|
+
dataViews?: readonly unknown[];
|
|
7
|
+
contract?: SourceFieldDefinition | null;
|
|
8
|
+
}
|
|
9
|
+
export type SimulationResponseContract = Pick<SourceFieldDefinition, 'type' | 'typeExpression' | 'array'>;
|
|
10
|
+
export type SimulationResponseContractResult = {
|
|
11
|
+
contract: SimulationResponseContract;
|
|
12
|
+
error?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
contract: null;
|
|
15
|
+
error: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Контракт ответа Query для mockRequest.
|
|
19
|
+
* REST и GraphQL: единственный корневой output().from(response()|data()).contract(field(Type)).
|
|
20
|
+
* GraphQL без корневого контракта: объект data операции собирается из выходов
|
|
21
|
+
* output().from(data('a.b')).contract(field(Type)) по их статическим путям.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveSimulationResponseContract(identity: string, outputs: readonly SimulationResponseOutput[], graphql: boolean): SimulationResponseContractResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EndgeBuildContext } from '../../configuration/domain/types/configuration.type';
|
|
2
|
+
import { SourceContextPattern, SourceContextValues } from '../domain/types/source-context.types';
|
|
3
|
+
export declare function runWithSourceContext<T>(context: SourceContextValues | undefined, run: () => T): T;
|
|
4
|
+
export declare function getSourceContext(): SourceContextValues | undefined;
|
|
5
|
+
export declare function createSourceContextValues(buildContext: EndgeBuildContext, knownFacets?: readonly string[]): SourceContextValues;
|
|
6
|
+
export declare function matchesContextPattern(pattern: SourceContextPattern, facets: Readonly<Record<string, string>>): boolean;
|
|
7
|
+
export declare function contextPatternsOverlap(left: SourceContextPattern, right: SourceContextPattern): boolean;
|
|
8
|
+
export declare function findAmbiguousContextCases(cases: readonly {
|
|
9
|
+
when: SourceContextPattern;
|
|
10
|
+
}[]): Array<[number, number]>;
|
|
11
|
+
export declare function selectContextCase(cases: readonly {
|
|
12
|
+
when: SourceContextPattern;
|
|
13
|
+
}[], facets: Readonly<Record<string, string>>): number | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProgramDiagnostic } from '../../program/domain/types/program.types';
|
|
2
|
+
import { TypeSourceDefinition } from '../domain/types/type-source.types';
|
|
3
|
+
type DiagnosticDraft = Omit<ProgramDiagnostic, 'entityRef'>;
|
|
4
|
+
export type TypeExtendsLookup = (identity: string) => TypeSourceDefinition | null | undefined;
|
|
5
|
+
export interface TypeExtendsResult {
|
|
6
|
+
definition: TypeSourceDefinition | null;
|
|
7
|
+
diagnostics: DiagnosticDraft[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Разворачивает `extends` object Type: поля базовой цепочки идут первыми (с `inheritedFrom`), собственные
|
|
11
|
+
* добавляются после; поле с тем же именем заменяет унаследованное на его месте, только если совместимо
|
|
12
|
+
* (тот же тип и array, optional → required допустимо). Циклы и не-object база диагностируются.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveTypeDefinitionExtends(definition: TypeSourceDefinition | null, lookup: TypeExtendsLookup, identity?: string): TypeExtendsResult;
|
|
15
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SourceLanguageCompletion } from '../domain/types/source-engine.types';
|
|
2
|
+
export declare const SOURCE_CONTEXT_FUNCTION_NAMES: string[];
|
|
3
|
+
export declare const SOURCE_CONTEXT_COMPLETIONS: SourceLanguageCompletion[];
|
|
2
4
|
export declare const VALUE_EXPRESSION_FUNCTION_NAMES: string[];
|
|
3
5
|
export declare const VALUE_EXPRESSION_METHOD_NAMES: string[];
|
|
4
6
|
export declare const VALUE_EXPRESSION_COMPLETIONS: SourceLanguageCompletion[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ValuePathIssueCode = 'value-path-invalid' | 'value-path-wildcard' | 'value-path-variable';
|
|
2
|
+
export interface ValuePathIssue {
|
|
3
|
+
code: ValuePathIssueCode;
|
|
4
|
+
message: string;
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ValuePathScope {
|
|
8
|
+
vars?: Readonly<Record<string, unknown>>;
|
|
9
|
+
warn?: (issue: ValuePathIssue) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function runWithValuePathScope<T>(scope: ValuePathScope, run: () => T): T;
|
|
12
|
+
export declare function readValuePath(source: unknown, path: string, scope?: ValuePathScope | undefined): unknown;
|
|
13
|
+
export declare function hasValuePath(source: unknown, path: string, scope?: ValuePathScope | undefined): boolean;
|
|
14
|
+
export declare function validateValuePath(path: string): ValuePathIssue | null;
|
|
@@ -20,6 +20,11 @@ export declare class EndgeUIRegistry_Module extends EndgeModule {
|
|
|
20
20
|
* Очищает registry и восстанавливает default UI definitions.
|
|
21
21
|
*/
|
|
22
22
|
reset(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Регистрирует встроенный JSON-адаптер `endge-ui-json` при каждом boot. Он не
|
|
25
|
+
* активируется: `mountEndgeUIJson` работает параллельно активному Vue/DOM adapter-у.
|
|
26
|
+
*/
|
|
27
|
+
setup(): void;
|
|
23
28
|
/**
|
|
24
29
|
* Возвращает snapshot зарегистрированных UI refs.
|
|
25
30
|
*/
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ComponentSFCRenderPort } from '../../../runtime/domain/component-sfc-render-port.types';
|
|
2
|
+
import { EndgeUIJsonSnapshot } from '../../domain/types/endge-ui-json.types';
|
|
3
|
+
export declare const ENDGE_UI_JSON_CONSUMER_SCOPE = "json";
|
|
4
|
+
export declare const ENDGE_UI_EDIT_EVENTS: readonly ["edit.begin", "edit.input", "edit.commit", "edit.cancel"];
|
|
5
|
+
type Handler = (payload: unknown) => Promise<void> | void;
|
|
6
|
+
export interface EndgeUIJsonRenderOptions {
|
|
7
|
+
locale?: string;
|
|
8
|
+
timezone?: string;
|
|
9
|
+
theme?: string;
|
|
10
|
+
tableWindows: ReadonlyMap<string, {
|
|
11
|
+
offset: number;
|
|
12
|
+
limit: number;
|
|
13
|
+
}>;
|
|
14
|
+
tableRowLimit: number;
|
|
15
|
+
}
|
|
16
|
+
export interface EndgeUIJsonRenderResult {
|
|
17
|
+
snapshot: Omit<EndgeUIJsonSnapshot, 'revision'>;
|
|
18
|
+
handlers: Map<string, Map<string, Handler>>;
|
|
19
|
+
consumerKeys: Set<string>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Один проход JSON-рендера: обходит IR так же, как DOM adapter, но вместо VNode строит
|
|
23
|
+
* сериализуемые узлы. Выражения исполняет общий evaluator Core, события идут в
|
|
24
|
+
* `ComponentSFCEventBoundary` host-а, Computation — в ресурсы host-а.
|
|
25
|
+
*/
|
|
26
|
+
export declare class EndgeUIJsonRenderer {
|
|
27
|
+
private readonly _host;
|
|
28
|
+
private readonly _options;
|
|
29
|
+
private readonly _handlers;
|
|
30
|
+
private readonly _consumerKeys;
|
|
31
|
+
private readonly _usedIds;
|
|
32
|
+
private readonly _markers;
|
|
33
|
+
constructor(_host: ComponentSFCRenderPort, _options: EndgeUIJsonRenderOptions);
|
|
34
|
+
render(props: Record<string, unknown>): EndgeUIJsonRenderResult;
|
|
35
|
+
private _result;
|
|
36
|
+
private _createRootContext;
|
|
37
|
+
private _evaluatePortLocals;
|
|
38
|
+
private _evaluate;
|
|
39
|
+
private _evaluateProps;
|
|
40
|
+
private _renderNodes;
|
|
41
|
+
private _renderValueNode;
|
|
42
|
+
private _renderElement;
|
|
43
|
+
private _renderOnce;
|
|
44
|
+
private _source;
|
|
45
|
+
private _registerEvents;
|
|
46
|
+
private _evaluateInteractionGroup;
|
|
47
|
+
private _registerEditable;
|
|
48
|
+
private _renderComponent;
|
|
49
|
+
private _renderTable;
|
|
50
|
+
private _resolveMenu;
|
|
51
|
+
private _menuAction;
|
|
52
|
+
private _addMenuHandler;
|
|
53
|
+
private _runMenuItem;
|
|
54
|
+
private _addHandler;
|
|
55
|
+
private _claimId;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentSFCRenderPort } from '../../../runtime/domain/component-sfc-render-port.types';
|
|
2
|
+
import { EndgeUIJsonMount, EndgeUIJsonMountOptions } from '../../domain/types/endge-ui-json.types';
|
|
3
|
+
import { UIRenderAdapter } from '../../domain/types/ui-render-adapter.type';
|
|
4
|
+
/**
|
|
5
|
+
* Монтирует JSON UI `endge-ui/v1` поверх Component SFC runtime host-а.
|
|
6
|
+
* Host владеет state, input и ресурсами; mount только проецирует IR в JSON.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mountEndgeUIJson(host: ComponentSFCRenderPort, options?: EndgeUIJsonMountOptions): EndgeUIJsonMount;
|
|
9
|
+
export interface EndgeUIJsonPrimitiveRenderer {
|
|
10
|
+
type: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renderer adapter протокола `endge-sfc` для JSON UI. Host регистрирует его в
|
|
14
|
+
* `Endge.uiRegistry.adapters` и получает точку входа `roots['sfc-runtime']`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const EndgeUIJsonAdapter: UIRenderAdapter<EndgeUIJsonPrimitiveRenderer>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EndgeUIJsonSnapshot, EndgeUIPatch } from '../../domain/types/endge-ui-json.types';
|
|
2
|
+
export declare function diffEndgeUIJsonSnapshots(previous: EndgeUIJsonSnapshot, next: EndgeUIJsonSnapshot): EndgeUIPatch;
|
|
3
|
+
export declare function applyEndgeUIPatch(snapshot: EndgeUIJsonSnapshot, patch: EndgeUIPatch): EndgeUIJsonSnapshot;
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Schema (draft 2020-12) формата `endge-ui/v1`: снимок и патч.
|
|
3
|
+
* `$defs.snapshot` и `$defs.patch` — корневые формы; корень схемы принимает любую из них.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENDGE_UI_JSON_SCHEMA: {
|
|
6
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
7
|
+
readonly $id: "https://endge.dev/schemas/endge-ui/v1.json";
|
|
8
|
+
readonly title: "Endge JSON UI endge-ui/v1";
|
|
9
|
+
readonly oneOf: readonly [{
|
|
10
|
+
readonly $ref: "#/$defs/snapshot";
|
|
11
|
+
}, {
|
|
12
|
+
readonly $ref: "#/$defs/patch";
|
|
13
|
+
}];
|
|
14
|
+
readonly $defs: {
|
|
15
|
+
readonly json: {};
|
|
16
|
+
readonly marker: {
|
|
17
|
+
readonly type: "object";
|
|
18
|
+
readonly required: readonly ["code", "severity", "message"];
|
|
19
|
+
readonly additionalProperties: false;
|
|
20
|
+
readonly properties: {
|
|
21
|
+
readonly code: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
};
|
|
24
|
+
readonly severity: {
|
|
25
|
+
readonly enum: readonly ["info", "warning", "error"];
|
|
26
|
+
};
|
|
27
|
+
readonly message: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly menu: {
|
|
33
|
+
readonly type: "object";
|
|
34
|
+
readonly required: readonly ["items"];
|
|
35
|
+
readonly additionalProperties: false;
|
|
36
|
+
readonly properties: {
|
|
37
|
+
readonly items: {
|
|
38
|
+
readonly type: "array";
|
|
39
|
+
readonly items: {
|
|
40
|
+
readonly oneOf: readonly [{
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly required: readonly ["kind", "id", "label", "action"];
|
|
43
|
+
readonly additionalProperties: false;
|
|
44
|
+
readonly properties: {
|
|
45
|
+
readonly kind: {
|
|
46
|
+
readonly const: "item";
|
|
47
|
+
};
|
|
48
|
+
readonly id: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
};
|
|
51
|
+
readonly label: {
|
|
52
|
+
readonly type: "string";
|
|
53
|
+
};
|
|
54
|
+
readonly action: {
|
|
55
|
+
readonly type: "string";
|
|
56
|
+
};
|
|
57
|
+
readonly icon: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
};
|
|
60
|
+
readonly disabled: {
|
|
61
|
+
readonly type: "boolean";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
readonly type: "object";
|
|
66
|
+
readonly required: readonly ["kind", "id"];
|
|
67
|
+
readonly additionalProperties: false;
|
|
68
|
+
readonly properties: {
|
|
69
|
+
readonly kind: {
|
|
70
|
+
readonly const: "separator";
|
|
71
|
+
};
|
|
72
|
+
readonly id: {
|
|
73
|
+
readonly type: "string";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
readonly editable: {
|
|
82
|
+
readonly type: "object";
|
|
83
|
+
readonly required: readonly ["active", "value", "triggers"];
|
|
84
|
+
readonly additionalProperties: false;
|
|
85
|
+
readonly properties: {
|
|
86
|
+
readonly active: {
|
|
87
|
+
readonly type: "boolean";
|
|
88
|
+
};
|
|
89
|
+
readonly value: {
|
|
90
|
+
readonly $ref: "#/$defs/json";
|
|
91
|
+
};
|
|
92
|
+
readonly draft: {
|
|
93
|
+
readonly $ref: "#/$defs/json";
|
|
94
|
+
};
|
|
95
|
+
readonly triggers: {
|
|
96
|
+
readonly type: "array";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly table: {
|
|
101
|
+
readonly type: "object";
|
|
102
|
+
readonly required: readonly ["rowKey", "columns", "rowCount", "offset", "limit"];
|
|
103
|
+
readonly additionalProperties: false;
|
|
104
|
+
readonly properties: {
|
|
105
|
+
readonly rowKey: {
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
};
|
|
108
|
+
readonly rowCount: {
|
|
109
|
+
readonly type: "integer";
|
|
110
|
+
readonly minimum: 0;
|
|
111
|
+
};
|
|
112
|
+
readonly offset: {
|
|
113
|
+
readonly type: "integer";
|
|
114
|
+
readonly minimum: 0;
|
|
115
|
+
};
|
|
116
|
+
readonly limit: {
|
|
117
|
+
readonly type: "integer";
|
|
118
|
+
readonly minimum: 1;
|
|
119
|
+
};
|
|
120
|
+
readonly columns: {
|
|
121
|
+
readonly type: "array";
|
|
122
|
+
readonly items: {
|
|
123
|
+
readonly type: "object";
|
|
124
|
+
readonly required: readonly ["key", "title"];
|
|
125
|
+
readonly additionalProperties: false;
|
|
126
|
+
readonly properties: {
|
|
127
|
+
readonly key: {
|
|
128
|
+
readonly type: "string";
|
|
129
|
+
};
|
|
130
|
+
readonly title: {
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
};
|
|
133
|
+
readonly width: {
|
|
134
|
+
readonly type: "number";
|
|
135
|
+
};
|
|
136
|
+
readonly align: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
};
|
|
139
|
+
readonly sortable: {
|
|
140
|
+
readonly type: "boolean";
|
|
141
|
+
};
|
|
142
|
+
readonly menu: {
|
|
143
|
+
readonly $ref: "#/$defs/menu";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
readonly node: {
|
|
151
|
+
readonly type: "object";
|
|
152
|
+
readonly required: readonly ["id", "type", "props", "children"];
|
|
153
|
+
readonly additionalProperties: false;
|
|
154
|
+
readonly properties: {
|
|
155
|
+
readonly id: {
|
|
156
|
+
readonly type: "string";
|
|
157
|
+
readonly minLength: 1;
|
|
158
|
+
};
|
|
159
|
+
readonly type: {
|
|
160
|
+
readonly enum: readonly ["Text", "DateTime", "Number", "Icon", "Badge", "Dot", "Box", "Flex", "Grid", "Divider", "Input", "Textarea", "Checkbox", "Select", "Tooltip", "TooltipTrigger", "TooltipContent", "Component", "Table", "Column", "Cell", "ColumnMenu", "CellMenu", "RowMenu", "MenuItem", "MenuSeparator", "Editable", "Variant", "#text", "#row", "#cell"];
|
|
161
|
+
};
|
|
162
|
+
readonly props: {
|
|
163
|
+
readonly type: "object";
|
|
164
|
+
};
|
|
165
|
+
readonly children: {
|
|
166
|
+
readonly type: "array";
|
|
167
|
+
readonly items: {
|
|
168
|
+
readonly $ref: "#/$defs/node";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
readonly text: {
|
|
172
|
+
readonly type: "string";
|
|
173
|
+
};
|
|
174
|
+
readonly events: {
|
|
175
|
+
readonly type: "array";
|
|
176
|
+
readonly items: {
|
|
177
|
+
readonly type: "string";
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
readonly classes: {
|
|
181
|
+
readonly type: "array";
|
|
182
|
+
readonly items: {
|
|
183
|
+
readonly type: "string";
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
readonly states: {
|
|
187
|
+
readonly type: "array";
|
|
188
|
+
readonly items: {
|
|
189
|
+
readonly type: "string";
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
readonly parts: {
|
|
193
|
+
readonly type: "array";
|
|
194
|
+
readonly items: {
|
|
195
|
+
readonly type: "string";
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
readonly style: {
|
|
199
|
+
readonly type: "object";
|
|
200
|
+
readonly additionalProperties: {
|
|
201
|
+
readonly type: "string";
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
readonly component: {
|
|
205
|
+
readonly type: "string";
|
|
206
|
+
};
|
|
207
|
+
readonly editable: {
|
|
208
|
+
readonly $ref: "#/$defs/editable";
|
|
209
|
+
};
|
|
210
|
+
readonly table: {
|
|
211
|
+
readonly $ref: "#/$defs/table";
|
|
212
|
+
};
|
|
213
|
+
readonly menu: {
|
|
214
|
+
readonly $ref: "#/$defs/menu";
|
|
215
|
+
};
|
|
216
|
+
readonly markers: {
|
|
217
|
+
readonly type: "array";
|
|
218
|
+
readonly items: {
|
|
219
|
+
readonly $ref: "#/$defs/marker";
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
readonly snapshot: {
|
|
225
|
+
readonly type: "object";
|
|
226
|
+
readonly required: readonly ["format", "revision", "component", "roots"];
|
|
227
|
+
readonly additionalProperties: false;
|
|
228
|
+
readonly properties: {
|
|
229
|
+
readonly format: {
|
|
230
|
+
readonly const: "endge-ui/v1";
|
|
231
|
+
};
|
|
232
|
+
readonly revision: {
|
|
233
|
+
readonly type: "integer";
|
|
234
|
+
readonly minimum: 1;
|
|
235
|
+
};
|
|
236
|
+
readonly component: {
|
|
237
|
+
readonly type: readonly ["string", "null"];
|
|
238
|
+
};
|
|
239
|
+
readonly roots: {
|
|
240
|
+
readonly type: "array";
|
|
241
|
+
readonly items: {
|
|
242
|
+
readonly $ref: "#/$defs/node";
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
readonly markers: {
|
|
246
|
+
readonly type: "array";
|
|
247
|
+
readonly items: {
|
|
248
|
+
readonly $ref: "#/$defs/marker";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
readonly patchOperation: {
|
|
254
|
+
readonly oneOf: readonly [{
|
|
255
|
+
readonly type: "object";
|
|
256
|
+
readonly required: readonly ["op", "id"];
|
|
257
|
+
readonly additionalProperties: false;
|
|
258
|
+
readonly properties: {
|
|
259
|
+
readonly op: {
|
|
260
|
+
readonly const: "update";
|
|
261
|
+
};
|
|
262
|
+
readonly id: {
|
|
263
|
+
readonly type: "string";
|
|
264
|
+
};
|
|
265
|
+
readonly set: {
|
|
266
|
+
readonly type: "object";
|
|
267
|
+
};
|
|
268
|
+
readonly unset: {
|
|
269
|
+
readonly type: "array";
|
|
270
|
+
readonly items: {
|
|
271
|
+
readonly type: "string";
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
}, {
|
|
276
|
+
readonly type: "object";
|
|
277
|
+
readonly required: readonly ["op", "id", "children"];
|
|
278
|
+
readonly additionalProperties: false;
|
|
279
|
+
readonly properties: {
|
|
280
|
+
readonly op: {
|
|
281
|
+
readonly const: "children";
|
|
282
|
+
};
|
|
283
|
+
readonly id: {
|
|
284
|
+
readonly type: readonly ["string", "null"];
|
|
285
|
+
};
|
|
286
|
+
readonly children: {
|
|
287
|
+
readonly type: "array";
|
|
288
|
+
readonly items: {
|
|
289
|
+
readonly oneOf: readonly [{
|
|
290
|
+
readonly $ref: "#/$defs/node";
|
|
291
|
+
}, {
|
|
292
|
+
readonly type: "object";
|
|
293
|
+
readonly required: readonly ["ref"];
|
|
294
|
+
readonly additionalProperties: false;
|
|
295
|
+
readonly properties: {
|
|
296
|
+
readonly ref: {
|
|
297
|
+
readonly type: "string";
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
}];
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
}, {
|
|
305
|
+
readonly type: "object";
|
|
306
|
+
readonly required: readonly ["op", "id", "node"];
|
|
307
|
+
readonly additionalProperties: false;
|
|
308
|
+
readonly properties: {
|
|
309
|
+
readonly op: {
|
|
310
|
+
readonly const: "replace";
|
|
311
|
+
};
|
|
312
|
+
readonly id: {
|
|
313
|
+
readonly type: "string";
|
|
314
|
+
};
|
|
315
|
+
readonly node: {
|
|
316
|
+
readonly $ref: "#/$defs/node";
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
}, {
|
|
320
|
+
readonly type: "object";
|
|
321
|
+
readonly required: readonly ["op", "markers"];
|
|
322
|
+
readonly additionalProperties: false;
|
|
323
|
+
readonly properties: {
|
|
324
|
+
readonly op: {
|
|
325
|
+
readonly const: "markers";
|
|
326
|
+
};
|
|
327
|
+
readonly markers: {
|
|
328
|
+
readonly type: "array";
|
|
329
|
+
readonly items: {
|
|
330
|
+
readonly $ref: "#/$defs/marker";
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
}];
|
|
335
|
+
};
|
|
336
|
+
readonly patch: {
|
|
337
|
+
readonly type: "object";
|
|
338
|
+
readonly required: readonly ["format", "baseRevision", "revision", "ops"];
|
|
339
|
+
readonly additionalProperties: false;
|
|
340
|
+
readonly properties: {
|
|
341
|
+
readonly format: {
|
|
342
|
+
readonly const: "endge-ui/v1";
|
|
343
|
+
};
|
|
344
|
+
readonly baseRevision: {
|
|
345
|
+
readonly type: "integer";
|
|
346
|
+
readonly minimum: 1;
|
|
347
|
+
};
|
|
348
|
+
readonly revision: {
|
|
349
|
+
readonly type: "integer";
|
|
350
|
+
readonly minimum: 1;
|
|
351
|
+
};
|
|
352
|
+
readonly ops: {
|
|
353
|
+
readonly type: "array";
|
|
354
|
+
readonly items: {
|
|
355
|
+
readonly $ref: "#/$defs/patchOperation";
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
export interface EndgeUIJsonSchemaIssue {
|
|
363
|
+
path: string;
|
|
364
|
+
message: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Проверяет значение по `ENDGE_UI_JSON_SCHEMA` (подмножество draft 2020-12, которое
|
|
368
|
+
* использует эта схема: type, enum, const, required, properties, additionalProperties,
|
|
369
|
+
* items, oneOf, $ref, minimum, minLength). Полноценный валидатор host может заменить на Ajv.
|
|
370
|
+
*/
|
|
371
|
+
export declare function validateEndgeUIJson(value: unknown, form?: 'snapshot' | 'patch' | 'any'): EndgeUIJsonSchemaIssue[];
|