@endge/core 1.0.0-dev.5 → 1.1.0-dev.13
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 +58140 -46613
- package/dist/features/core/kernel/config/kernel.config.d.ts +1 -1
- 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/compiler/tools/select-type-context.d.ts +1 -0
- package/dist/features/core/modules/computations/model/ComputationResource.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/domain/types/component/component-core.types.d.ts +4 -0
- package/dist/features/core/modules/program/EndgeProgram_Module.d.ts +4 -0
- package/dist/features/core/modules/program/domain/types/execution-bundle.types.d.ts +2 -0
- package/dist/features/core/modules/program/domain/types/program.types.d.ts +4 -1
- package/dist/features/core/modules/program/tools/startup-bundle.d.ts +2 -0
- 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/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/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,5 +1,6 @@
|
|
|
1
1
|
import { RQuery } from '../../domain/entities/RQuery';
|
|
2
2
|
import { QueryProgramPayload } from '../../program/domain/types/program.types';
|
|
3
|
+
import { QueryExecutionObserver } from '../domain/query-execution.types';
|
|
3
4
|
import { RuntimeArtifactReader, RuntimeHost, RuntimeHostContext, RuntimeHostUpdateContext } from '../domain/runtime-host.types';
|
|
4
5
|
import { RuntimeHostBase } from '../RuntimeHostBase';
|
|
5
6
|
/**
|
|
@@ -49,7 +50,13 @@ export declare class QueryRuntimeHost extends RuntimeHostBase<'query', RuntimeHo
|
|
|
49
50
|
setProps(patch: Record<string, unknown>): void;
|
|
50
51
|
getOutput(name: string): unknown;
|
|
51
52
|
getOutputs(): Readonly<Record<string, unknown>>;
|
|
52
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Ответ mockRequest: для GraphQL Query errors сценария (и пустые errors) проходят errorPolicy.
|
|
55
|
+
*/
|
|
56
|
+
private _readSimulatedResponse;
|
|
57
|
+
run(propsPatch?: Record<string, unknown>, options?: {
|
|
58
|
+
observer?: QueryExecutionObserver;
|
|
59
|
+
}): Promise<Record<string, unknown>>;
|
|
53
60
|
pause(): void;
|
|
54
61
|
stop(): void;
|
|
55
62
|
reconcile(): Promise<void>;
|
|
@@ -38,6 +38,7 @@ export declare class SimulationRuntimeHost extends RuntimeHostBase<'simulation',
|
|
|
38
38
|
*/
|
|
39
39
|
readResponse(host: RuntimeHost<any, any>): {
|
|
40
40
|
value: unknown;
|
|
41
|
+
errors?: readonly unknown[];
|
|
41
42
|
} | null;
|
|
42
43
|
streamOverride(host: RuntimeHost<any, any>): {
|
|
43
44
|
schema: Record<string, unknown>;
|
|
@@ -12,6 +12,8 @@ export declare class StreamRuntimeHost extends RuntimeHostBase<'stream', Runtime
|
|
|
12
12
|
private _closing;
|
|
13
13
|
private _contextOff;
|
|
14
14
|
private _dataMode;
|
|
15
|
+
private _props;
|
|
16
|
+
private _requestKey;
|
|
15
17
|
constructor(input: {
|
|
16
18
|
id: string;
|
|
17
19
|
model: RStream;
|
|
@@ -29,6 +31,14 @@ export declare class StreamRuntimeHost extends RuntimeHostBase<'stream', Runtime
|
|
|
29
31
|
artifacts: RuntimeArtifactReader;
|
|
30
32
|
transportFactory: StreamTransportFactory;
|
|
31
33
|
}): StreamRuntimeHost | null;
|
|
34
|
+
/**
|
|
35
|
+
* Текущие props Stream: literal defaults, поверх них значения владельца (Composition withProps).
|
|
36
|
+
*/
|
|
37
|
+
getProps(): Readonly<Record<string, unknown>>;
|
|
38
|
+
/**
|
|
39
|
+
* Обновляет props; активное live-соединение переоткрывается, если изменился вычисленный запрос.
|
|
40
|
+
*/
|
|
41
|
+
setProps(patch: Record<string, unknown>): void;
|
|
32
42
|
start(): void;
|
|
33
43
|
/**
|
|
34
44
|
* Generator сохраняет SSE на паузе; обычный transport закрывает соединение.
|
|
@@ -44,5 +54,25 @@ export declare class StreamRuntimeHost extends RuntimeHostBase<'stream', Runtime
|
|
|
44
54
|
private _closeConnection;
|
|
45
55
|
private _disposeConnection;
|
|
46
56
|
private _receive;
|
|
57
|
+
/**
|
|
58
|
+
* mockStream graphqlSse: каждый сгенерированный root — data события next (с errors сценария),
|
|
59
|
+
* дальше тот же путь, что у транспорта: errorPolicy, events.next (type/payloadFrom/eachFrom/match), Store.
|
|
60
|
+
*/
|
|
61
|
+
private _receiveSimulatedNext;
|
|
62
|
+
/**
|
|
63
|
+
* errorPolicy: 'all' — errors события next попадают в diagnostics, как у GraphQL Query.
|
|
64
|
+
*/
|
|
65
|
+
private _reportGraphQLErrors;
|
|
66
|
+
/**
|
|
67
|
+
* url транспорта: строка/token или выражение graphqlSse по текущим props.
|
|
68
|
+
*/
|
|
69
|
+
private _evaluateUrl;
|
|
70
|
+
/**
|
|
71
|
+
* Вычисляет variables, headers и extensions graphqlSse по props и env; другие transport запроса не имеют.
|
|
72
|
+
*/
|
|
73
|
+
private _evaluateRequest;
|
|
74
|
+
private _evaluate;
|
|
75
|
+
private _literalDefaults;
|
|
76
|
+
private _applyProps;
|
|
47
77
|
private _dispatch;
|
|
48
78
|
}
|
package/dist/features/core/modules/runtime/services/simulation/prepare-simulation-overrides.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { RuntimeArtifactReader } from '../../domain/runtime-host.types';
|
|
2
|
-
import { SimulationMockStream, SimulationSourceArtifact } from '../../../source/domain/types/simulation-source.types';
|
|
2
|
+
import { SimulationGraphQLError, SimulationMockStream, SimulationSourceArtifact } from '../../../source/domain/types/simulation-source.types';
|
|
3
|
+
export interface SimulationRequestOverride {
|
|
4
|
+
schema: Record<string, unknown>;
|
|
5
|
+
seed: string;
|
|
6
|
+
errors?: SimulationGraphQLError[];
|
|
7
|
+
}
|
|
3
8
|
export interface SimulationOverrides {
|
|
4
|
-
requests: ReadonlyMap<string,
|
|
5
|
-
schema: Record<string, unknown>;
|
|
6
|
-
seed: string;
|
|
7
|
-
}>;
|
|
9
|
+
requests: ReadonlyMap<string, SimulationRequestOverride>;
|
|
8
10
|
streams: ReadonlyMap<string, {
|
|
9
11
|
schema: Record<string, unknown>;
|
|
10
12
|
options: SimulationMockStream;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StreamTransportConnection, StreamTransportFactory } from '../../domain/stream-runtime.types';
|
|
2
|
+
import { ResolveAuthSession } from './BrowserSseStreamTransportFactory';
|
|
3
|
+
/**
|
|
4
|
+
* HTTP 4xx ответа graphql-sse: подписка остановлена без переподключения.
|
|
5
|
+
*/
|
|
6
|
+
export declare class GraphQLSseHttpError extends Error {
|
|
7
|
+
readonly status: number;
|
|
8
|
+
readonly url: string;
|
|
9
|
+
constructor(status: number, url: string, cause?: unknown);
|
|
10
|
+
}
|
|
11
|
+
export declare function readSseHttpStatus(error: unknown): number | null;
|
|
12
|
+
/**
|
|
13
|
+
* GraphQL subscription по протоколу graphql-sse, режим distinct connections:
|
|
14
|
+
* одно fetch-соединение на подписку, события next (ExecutionResult) и complete.
|
|
15
|
+
* Событие next публикует data результата; complete закрывает соединение без переподключения.
|
|
16
|
+
* Обрыв без complete, сетевые ошибки, HTTP 5xx, 408 и 429 переподключаются через reconnectDelayMs.
|
|
17
|
+
* Остальные HTTP 4xx останавливают подписку с ошибкой; 401 при auth — один повтор с обновлённым
|
|
18
|
+
* токеном (счётчик сбрасывается после успешного открытия).
|
|
19
|
+
*/
|
|
20
|
+
export declare class BrowserGraphQLSseStreamTransportFactory implements StreamTransportFactory {
|
|
21
|
+
private readonly _resolveAuthSession;
|
|
22
|
+
constructor(_resolveAuthSession: ResolveAuthSession);
|
|
23
|
+
open(artifact: Parameters<StreamTransportFactory['open']>[0], callbacks: Parameters<StreamTransportFactory['open']>[1], request?: Parameters<StreamTransportFactory['open']>[2]): StreamTransportConnection;
|
|
24
|
+
}
|
package/dist/features/core/modules/runtime/services/transports/BrowserSseStreamTransportFactory.d.ts
CHANGED
|
@@ -2,10 +2,22 @@ import { AuthRequestPolicy, AuthResolvedSession, AuthResolveOptions } from '../.
|
|
|
2
2
|
import { StreamTransportConnection, StreamTransportFactory } from '../../domain/stream-runtime.types';
|
|
3
3
|
export type ResolveAuthSession = (policy: AuthRequestPolicy, options?: AuthResolveOptions) => Promise<AuthResolvedSession>;
|
|
4
4
|
/**
|
|
5
|
-
* Браузерный
|
|
5
|
+
* Браузерный адаптер SSE: без авторизации владеет нативным EventSource, с авторизацией —
|
|
6
|
+
* fetch-соединением SSEManager с Bearer token; оба сохраняют имена событий.
|
|
6
7
|
*/
|
|
7
8
|
export declare class BrowserSseStreamTransportFactory implements StreamTransportFactory {
|
|
8
9
|
private readonly _resolveAuthSession;
|
|
9
10
|
constructor(_resolveAuthSession: ResolveAuthSession);
|
|
10
11
|
open(artifact: Parameters<StreamTransportFactory['open']>[0], callbacks: Parameters<StreamTransportFactory['open']>[1]): StreamTransportConnection;
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Получает access token AuthProfile для SSE-запроса; после 401/403 следующий запрос
|
|
15
|
+
* принудительно обновляет сессию.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createSseAuthTokenProvider(resolveAuthSession: ResolveAuthSession, transport: {
|
|
18
|
+
authMode: 'inherit' | 'profile' | 'none';
|
|
19
|
+
authProfileIdentity: string | null;
|
|
20
|
+
}): {
|
|
21
|
+
getToken: () => Promise<string>;
|
|
22
|
+
onError: (error: unknown) => void;
|
|
23
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SourceContextValues } from './domain/types/source-context.types';
|
|
1
2
|
import { SourceDocumentReference, SourceEngineCompileContext, SourceEngineCompileResult, SourceEngineGenerateResult, SourceEngineStrategy, SourceKind, SourceLanguageCompletion, SourceLanguageContext, SourceLanguageInlineHint, SourceLanguageSemanticHighlight, SourceLanguageSignatureHelp, SourceLanguageStrategy, SourceLanguageValidationResult, SourceParseResult, SourcePatchResult, SourcePatchStrategy } from './domain/types/source-engine.types';
|
|
2
3
|
import { EndgeModule } from '../../../federation/EndgeModule';
|
|
3
4
|
/**
|
|
@@ -75,6 +76,11 @@ export declare class EndgeSource_Module extends EndgeModule {
|
|
|
75
76
|
* Валидирует source указанного source-kind для editor-facing сценариев.
|
|
76
77
|
*/
|
|
77
78
|
validate(sourceKind: SourceKind | string, source: string, context?: Omit<SourceLanguageContext, 'source'>): SourceLanguageValidationResult;
|
|
79
|
+
/**
|
|
80
|
+
* Возвращает фасеты и Configuration текущего boot для проверки Source в редакторе;
|
|
81
|
+
* null, пока configuration не разрешена.
|
|
82
|
+
*/
|
|
83
|
+
currentSourceContext(): SourceContextValues | null;
|
|
78
84
|
/**
|
|
79
85
|
* Возвращает editor-facing completion items для указанного source-kind.
|
|
80
86
|
*/
|
|
@@ -59,6 +59,8 @@ export interface CompositionScopeDescriptor {
|
|
|
59
59
|
parentPath: string | null;
|
|
60
60
|
activationOverride: CompositionActivationDescriptor | null;
|
|
61
61
|
effectiveActivation: CompositionActivationDescriptor;
|
|
62
|
+
enabledWhen?: Readonly<Record<string, string>>;
|
|
63
|
+
activateWhen?: CompositionBindingValue;
|
|
62
64
|
data?: string[];
|
|
63
65
|
resources: string[];
|
|
64
66
|
runtimes: string[];
|
|
@@ -165,6 +167,8 @@ export interface CompositionRuntimeDescriptor {
|
|
|
165
167
|
};
|
|
166
168
|
activationOverride: CompositionActivationDescriptor | null;
|
|
167
169
|
effectiveActivation: CompositionActivationDescriptor;
|
|
170
|
+
enabledWhen?: Readonly<Record<string, string>>;
|
|
171
|
+
activateWhen?: CompositionBindingValue;
|
|
168
172
|
fields?: string[];
|
|
169
173
|
controls?: Record<string, FilterViewControlDefinition>;
|
|
170
174
|
componentIdentity?: string;
|
|
@@ -56,11 +56,14 @@ export interface DataViewFromStep {
|
|
|
56
56
|
dataViews?: DataViewRef[];
|
|
57
57
|
}
|
|
58
58
|
export type DataViewRef = DataViewExternalRef | DataViewInlineRef | DataViewLocalRef;
|
|
59
|
-
export interface
|
|
59
|
+
export interface DataViewContextVariants {
|
|
60
|
+
contextVariants?: Array<DataViewExternalRef | DataViewInlineRef>;
|
|
61
|
+
}
|
|
62
|
+
export interface DataViewExternalRef extends DataViewContextVariants {
|
|
60
63
|
kind: 'external';
|
|
61
64
|
identity: string;
|
|
62
65
|
}
|
|
63
|
-
export interface DataViewInlineRef {
|
|
66
|
+
export interface DataViewInlineRef extends DataViewContextVariants {
|
|
64
67
|
kind: 'inline';
|
|
65
68
|
source: string;
|
|
66
69
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SourceContextPattern } from './source-context.types';
|
|
2
|
+
export interface GraphQLFragmentVariant {
|
|
3
|
+
when: SourceContextPattern | null;
|
|
4
|
+
document: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GraphQLFragmentSource {
|
|
7
|
+
variants: GraphQLFragmentVariant[];
|
|
8
|
+
selected: number;
|
|
9
|
+
}
|
|
10
|
+
export interface GraphQLDocumentFragments {
|
|
11
|
+
operation: string;
|
|
12
|
+
fragments: Record<string, GraphQLFragmentSource>;
|
|
13
|
+
}
|
|
14
|
+
export interface GraphQLDocumentVariant {
|
|
15
|
+
context: SourceContextPattern;
|
|
16
|
+
document: string;
|
|
17
|
+
}
|
|
@@ -2,10 +2,11 @@ import { RQueryAuth } from '../../../domain/types/document/query.types';
|
|
|
2
2
|
import { ProgramMetadataMap } from '../../../program/domain/types/program-metadata.types';
|
|
3
3
|
import { ProgramDiagnostic, QueryProgramPayload } from '../../../program/domain/types/program.types';
|
|
4
4
|
import { DataViewRef } from './data-view-source.types';
|
|
5
|
+
import { GraphQLDocumentFragments } from './graphql-fragments.types';
|
|
5
6
|
import { ResponseOutputTransform } from './response-output.types';
|
|
6
7
|
import { QueryProgramProp, SourceExpressionIR, SourceFieldDefinition } from './source-expression.types';
|
|
7
8
|
export type QuerySourceKind = 'rest' | 'graphql';
|
|
8
|
-
export type QueryGraphQLErrorPolicy = 'throw' | 'ignore';
|
|
9
|
+
export type QueryGraphQLErrorPolicy = 'throw' | 'ignore' | 'all';
|
|
9
10
|
export type QuerySourceRequestValue<T> = T | SourceExpressionIR;
|
|
10
11
|
export interface QuerySourceRestRequest {
|
|
11
12
|
endpoint: QuerySourceRequestValue<string>;
|
|
@@ -20,6 +21,7 @@ export interface QuerySourceRestRequest {
|
|
|
20
21
|
export interface QuerySourceGraphQLRequest {
|
|
21
22
|
endpoint: QuerySourceRequestValue<string>;
|
|
22
23
|
document: string;
|
|
24
|
+
fragments?: GraphQLDocumentFragments;
|
|
23
25
|
operationName?: string;
|
|
24
26
|
variables?: SourceExpressionIR | null;
|
|
25
27
|
headers: QuerySourceRequestValue<Record<string, string>>;
|
|
@@ -30,6 +32,7 @@ export interface QuerySourceGraphQLRequest {
|
|
|
30
32
|
export interface QuerySourceMock {
|
|
31
33
|
enabled: boolean;
|
|
32
34
|
data: unknown;
|
|
35
|
+
errors?: unknown[];
|
|
33
36
|
}
|
|
34
37
|
export type QueryOutputSource = {
|
|
35
38
|
type: 'response';
|
|
@@ -5,6 +5,7 @@ export interface SimulationMockRequest {
|
|
|
5
5
|
seed?: string;
|
|
6
6
|
useExamples?: boolean;
|
|
7
7
|
arrays: Record<string, number>;
|
|
8
|
+
errors?: SimulationGraphQLError[];
|
|
8
9
|
}
|
|
9
10
|
export interface SimulationFieldConstraints {
|
|
10
11
|
enum?: Array<string | number | boolean>;
|
|
@@ -19,6 +20,12 @@ export interface SimulationMockStream {
|
|
|
19
20
|
intervalMs: number;
|
|
20
21
|
itemsPerMessage: number;
|
|
21
22
|
fields: Record<string, SimulationFieldConstraints>;
|
|
23
|
+
errors?: SimulationGraphQLError[];
|
|
24
|
+
}
|
|
25
|
+
export interface SimulationGraphQLError {
|
|
26
|
+
message: string;
|
|
27
|
+
path?: Array<string | number>;
|
|
28
|
+
[key: string]: unknown;
|
|
22
29
|
}
|
|
23
30
|
export interface SimulationRuntimeOverride {
|
|
24
31
|
alias: string;
|
|
@@ -64,4 +71,5 @@ export interface SimulationSourceCatalog {
|
|
|
64
71
|
compositions: readonly SimulationSourceInput[];
|
|
65
72
|
queries: readonly SimulationSourceInput[];
|
|
66
73
|
types: readonly SimulationSourceInput[];
|
|
74
|
+
streams?: readonly SimulationSourceInput[];
|
|
67
75
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { I18nCatalogProvenance, I18nRuntimeCatalog } from '../../../i18n/domain/i18n.types';
|
|
2
|
+
import { SourceContextValues } from './source-context.types';
|
|
2
3
|
import { TypeSourceDefinition } from './type-source.types';
|
|
3
4
|
export type SourceKind = 'action' | 'query' | 'vocab' | 'data-view' | 'filter' | 'composition' | 'store' | 'stream' | 'simulation' | 'update' | 'computation' | 'style' | 'type' | 'configuration';
|
|
4
5
|
export interface SourceEngineCompileContext {
|
|
5
6
|
sourceVersion?: number;
|
|
6
7
|
executionContext?: Readonly<Record<string, string>>;
|
|
8
|
+
sourceContext?: SourceContextValues;
|
|
7
9
|
}
|
|
8
10
|
export type SourceLanguageCompletionKind = 'keyword' | 'function' | 'property' | 'value' | 'snippet';
|
|
9
11
|
export interface SourceLanguagePosition {
|
|
@@ -30,6 +32,7 @@ export interface SourceLanguageContext {
|
|
|
30
32
|
description?: string | null;
|
|
31
33
|
}>;
|
|
32
34
|
ownerIdentity?: string;
|
|
35
|
+
sourceContext?: SourceContextValues;
|
|
33
36
|
i18n?: SourceLanguageI18nContext;
|
|
34
37
|
}
|
|
35
38
|
export interface SourceLanguageI18nOccurrence {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProgramMetadataMap } from '../../../program/domain/types/program-metadata.types';
|
|
2
2
|
import { TypeSourceExpression } from './type-source.types';
|
|
3
3
|
export type SourceFieldType = 'String' | 'Number' | 'Boolean' | 'Date' | 'Time' | 'DateTime' | 'Object' | 'Any' | (string & {});
|
|
4
|
-
export type SourceExpressionReadKind = 'env' | 'prop' | 'value' | 'row' | 'response' | 'store' | 'current' | 'scope' | 'composition-output' | 'composition-outputs' | 'composition-data' | 'composition-store' | 'composition-filter-fields' | 'composition-runtime-metadata' | 'metadata' | 'computation-output' | 'update-input' | 'update-item' | 'update-parent' | 'update-data' | 'update-meta' | 'update-has-data' | 'update-has-meta';
|
|
4
|
+
export type SourceExpressionReadKind = 'env' | 'prop' | 'value' | 'row' | 'response' | 'graphql-errors' | 'store' | 'current' | 'scope' | 'composition-output' | 'composition-outputs' | 'composition-data' | 'composition-store' | 'composition-filter-fields' | 'composition-runtime-metadata' | 'metadata' | 'computation-output' | 'update-input' | 'update-item' | 'update-parent' | 'update-data' | 'update-meta' | 'update-has-data' | 'update-has-meta';
|
|
5
5
|
export type SourceExpressionOperation = 'merge' | 'compact' | 'get' | 'get-or' | 'has' | 'default-to' | 'pick' | 'omit' | 'defaults' | 'keys' | 'values' | 'entries' | 'map' | 'where' | 'reject' | 'find' | 'some' | 'every' | 'flat-map' | 'flatten' | 'uniq' | 'uniq-by' | 'concat' | 'take' | 'drop' | 'sort-by' | 'group-by' | 'key-by' | 'size' | 'sum' | 'sum-by' | 'min' | 'max' | 'min-by' | 'max-by' | 'trim' | 'lower-case' | 'upper-case' | 'split' | 'join' | 'match' | 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'includes' | 'or' | 'when' | 'not' | 'is-nil' | 'is-empty' | 'and' | 'between' | 'in-list' | 'in-array' | 'relative-date' | 'relative-date-time' | 'left-join' | 'full-join' | 'join-by' | 'join-by-any' | 'join-coalesce' | 'lookup-one' | 'lookup-many' | 'enrich' | 'coalesce' | 'choose' | 'lookup-value' | 'to-string' | 'to-number' | 'to-boolean' | 'type-of' | 'is-string' | 'is-number' | 'is-boolean' | 'is-array' | 'is-object' | 'is-date-time' | 'is-duration' | 'add' | 'subtract' | 'multiply' | 'divide' | 'modulo' | 'abs' | 'negate' | 'round' | 'floor' | 'ceil' | 'clamp' | 'average' | 'average-by' | 'starts-with' | 'ends-with' | 'replace' | 'replace-all' | 'slice' | 'pad-start' | 'pad-end' | 'normalize-whitespace' | 'set' | 'unset' | 'rename' | 'get-key' | 'from-entries' | 'first' | 'last' | 'at' | 'reverse' | 'sort-by-desc' | 'order-by' | 'chunk' | 'union' | 'intersection' | 'difference' | 'count-by' | 'date-time' | 'duration' | 'date-time-add' | 'date-time-subtract' | 'date-time-difference' | 'date-time-start-of' | 'date-time-end-of' | 'date-time-part' | 'duration-add' | 'duration-subtract' | 'duration-total' | 'contains-all' | 'contains-any';
|
|
6
6
|
export type SourceExpressionIR = {
|
|
7
7
|
type: 'literal';
|
|
@@ -41,6 +41,7 @@ export interface SourceFieldDefinition {
|
|
|
41
41
|
key: string;
|
|
42
42
|
type: SourceFieldType;
|
|
43
43
|
typeExpression?: TypeSourceExpression;
|
|
44
|
+
typeVariants?: TypeSourceExpression[];
|
|
44
45
|
optional: boolean;
|
|
45
46
|
array: boolean;
|
|
46
47
|
defaultValue?: SourceExpressionIR;
|
|
@@ -74,6 +75,7 @@ export interface SourceExpressionContext {
|
|
|
74
75
|
values?: Record<string, unknown>;
|
|
75
76
|
row?: unknown;
|
|
76
77
|
response?: unknown;
|
|
78
|
+
graphQLErrors?: readonly unknown[];
|
|
77
79
|
stores?: Record<string, unknown>;
|
|
78
80
|
current?: unknown;
|
|
79
81
|
scope?: unknown;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ProgramMetadataMap } from '../../../program/domain/types/program-metadata.types';
|
|
2
2
|
import { ProgramDiagnostic } from '../../../program/domain/types/program.types';
|
|
3
|
+
import { GraphQLResponseError } from '../../../runtime/domain/graphql-query-error';
|
|
4
|
+
import { GraphQLDocumentFragments } from './graphql-fragments.types';
|
|
5
|
+
import { QueryGraphQLErrorPolicy } from './query-source.types';
|
|
6
|
+
import { QueryProgramProp, SourceExpressionIR } from './source-expression.types';
|
|
3
7
|
export interface StreamSseTransportDescriptor {
|
|
4
8
|
kind: 'sse';
|
|
5
9
|
url: string;
|
|
@@ -15,7 +19,29 @@ export interface StreamWebSocketTransportDescriptor {
|
|
|
15
19
|
url: string;
|
|
16
20
|
onOpen: StreamJsonValue[];
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
/**
|
|
23
|
+
* GraphQL subscription по протоколу graphql-sse (distinct connections mode):
|
|
24
|
+
* одно HTTP-соединение на подписку, события next (ExecutionResult) и complete.
|
|
25
|
+
*/
|
|
26
|
+
export interface StreamGraphQLSseTransportDescriptor {
|
|
27
|
+
kind: 'graphql-sse';
|
|
28
|
+
url: string;
|
|
29
|
+
urlExpression?: SourceExpressionIR;
|
|
30
|
+
method: 'POST' | 'GET';
|
|
31
|
+
document: string;
|
|
32
|
+
fragments?: GraphQLDocumentFragments;
|
|
33
|
+
operationName?: string;
|
|
34
|
+
variables: SourceExpressionIR | null;
|
|
35
|
+
headers: SourceExpressionIR | null;
|
|
36
|
+
extensions?: SourceExpressionIR;
|
|
37
|
+
withCredentials: boolean;
|
|
38
|
+
authMode: 'inherit' | 'profile' | 'none';
|
|
39
|
+
authProfileIdentity: string | null;
|
|
40
|
+
errorPolicy: QueryGraphQLErrorPolicy;
|
|
41
|
+
reconnectDelayMs: number;
|
|
42
|
+
}
|
|
43
|
+
export type StreamTransportDescriptor = StreamSseTransportDescriptor | StreamWebSocketTransportDescriptor | StreamGraphQLSseTransportDescriptor;
|
|
44
|
+
export type StreamProgramProp = QueryProgramProp;
|
|
19
45
|
export interface StreamEventDescriptor {
|
|
20
46
|
sourceEvent: string;
|
|
21
47
|
type: string | null;
|
|
@@ -25,6 +51,7 @@ export interface StreamEventDescriptor {
|
|
|
25
51
|
eachFrom?: string;
|
|
26
52
|
}
|
|
27
53
|
export interface StreamSourceDocument {
|
|
54
|
+
props?: StreamProgramProp[];
|
|
28
55
|
transport: StreamTransportDescriptor;
|
|
29
56
|
events: StreamEventDescriptor[];
|
|
30
57
|
}
|
|
@@ -48,5 +75,6 @@ export interface StreamEventEnvelope {
|
|
|
48
75
|
source: string;
|
|
49
76
|
sourceEvent: string;
|
|
50
77
|
occurredAt: string;
|
|
78
|
+
graphQLErrors?: readonly GraphQLResponseError[];
|
|
51
79
|
};
|
|
52
80
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ProgramMetadataMap } from '../../../program/domain/types/program-metadata.types';
|
|
2
2
|
import { ProgramDiagnostic } from '../../../program/domain/types/program.types';
|
|
3
|
-
export interface
|
|
3
|
+
export interface TypeSourceContextVariants {
|
|
4
|
+
contextVariants?: TypeSourceExpression[];
|
|
5
|
+
}
|
|
6
|
+
export interface TypeSourceReference extends TypeSourceContextVariants {
|
|
4
7
|
kind: 'reference';
|
|
5
8
|
identity: string;
|
|
6
9
|
}
|
|
@@ -13,24 +16,26 @@ export interface TypeSourceField {
|
|
|
13
16
|
min?: number;
|
|
14
17
|
max?: number;
|
|
15
18
|
examples: unknown[];
|
|
19
|
+
inheritedFrom?: string;
|
|
16
20
|
}
|
|
17
|
-
export interface TypeSourceObjectDefinition {
|
|
21
|
+
export interface TypeSourceObjectDefinition extends TypeSourceContextVariants {
|
|
18
22
|
kind: 'object';
|
|
19
23
|
fields: TypeSourceField[];
|
|
24
|
+
extends?: TypeSourceReference;
|
|
20
25
|
}
|
|
21
|
-
export interface TypeSourceEnumDefinition {
|
|
26
|
+
export interface TypeSourceEnumDefinition extends TypeSourceContextVariants {
|
|
22
27
|
kind: 'enum';
|
|
23
28
|
values: Array<string | number | boolean>;
|
|
24
29
|
}
|
|
25
|
-
export interface TypeSourceUnionDefinition {
|
|
30
|
+
export interface TypeSourceUnionDefinition extends TypeSourceContextVariants {
|
|
26
31
|
kind: 'union';
|
|
27
32
|
variants: TypeSourceExpression[];
|
|
28
33
|
}
|
|
29
|
-
export interface TypeSourceArrayDefinition {
|
|
34
|
+
export interface TypeSourceArrayDefinition extends TypeSourceContextVariants {
|
|
30
35
|
kind: 'array';
|
|
31
36
|
items: TypeSourceExpression;
|
|
32
37
|
}
|
|
33
|
-
export interface TypeSourceRecordDefinition {
|
|
38
|
+
export interface TypeSourceRecordDefinition extends TypeSourceContextVariants {
|
|
34
39
|
kind: 'record';
|
|
35
40
|
values: TypeSourceExpression;
|
|
36
41
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ProgramDependency } from '../../program/domain/types/program.types';
|
|
2
2
|
import { CompositionSourceDocument } from '../domain/types/composition-source.types';
|
|
3
3
|
import { SimulationSourceCatalog, SimulationSourceCompileResult, SimulationSourceInput, SimulationTargetReference } from '../domain/types/simulation-source.types';
|
|
4
|
+
import { StreamTransportDescriptor } from '../domain/types/stream-source.types';
|
|
4
5
|
interface SimulationCompositionBranch {
|
|
5
6
|
owner: SimulationSourceInput;
|
|
6
7
|
document: CompositionSourceDocument;
|
|
@@ -16,6 +17,7 @@ interface QueryArrayContract {
|
|
|
16
17
|
paths: string[];
|
|
17
18
|
dependencies: ProgramDependency[];
|
|
18
19
|
errors: string[];
|
|
20
|
+
graphql?: boolean;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* Read-only разрешение aliases и контрактов; не создаёт RuntimeHost или generator payload.
|
|
@@ -31,6 +33,10 @@ export declare class SimulationSourceResolver {
|
|
|
31
33
|
children(branch: SimulationCompositionBranch): SimulationSourceTarget[];
|
|
32
34
|
target(reference: SimulationTargetReference, aliases: readonly string[]): SimulationSourceTarget | null;
|
|
33
35
|
queryContract(identity: string): QueryArrayContract;
|
|
36
|
+
/**
|
|
37
|
+
* Вид transport Stream из каталога; null — Stream отсутствует в каталоге или содержит ошибки Source.
|
|
38
|
+
*/
|
|
39
|
+
streamTransport(identity: string): StreamTransportDescriptor['kind'] | null;
|
|
34
40
|
analyze(result: SimulationSourceCompileResult): SimulationSourceCompileResult;
|
|
35
41
|
}
|
|
36
42
|
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ProgramDiagnostic } from '../../../program/domain/types/program.types';
|
|
2
|
+
import { GraphQLDocumentFragments, GraphQLFragmentVariant } from '../../domain/types/graphql-fragments.types';
|
|
3
|
+
import { SourceExpressionIR } from '../../domain/types/source-expression.types';
|
|
4
|
+
import * as t from '@babel/types';
|
|
5
|
+
type DiagnosticDraft = Omit<ProgramDiagnostic, 'entityRef'>;
|
|
6
|
+
export type GraphQLOperationKind = 'query' | 'mutation' | 'subscription';
|
|
7
|
+
export interface GraphQLOperationSourceOptions {
|
|
8
|
+
codePrefix: string;
|
|
9
|
+
sourcePathPrefix: string;
|
|
10
|
+
operations: readonly GraphQLOperationKind[];
|
|
11
|
+
unsupportedOperation: {
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function readGraphQLDocumentSource(node: t.Expression, diagnostics: DiagnosticDraft[], options: GraphQLOperationSourceOptions): string;
|
|
17
|
+
export declare function readGraphQLVariablesSource(node: t.Expression, diagnostics: DiagnosticDraft[], options: GraphQLOperationSourceOptions): SourceExpressionIR | null;
|
|
18
|
+
/**
|
|
19
|
+
* Проверяет синтаксис документа, вид operations и operationName.
|
|
20
|
+
* Возвращает итоговое имя operation: заданное или единственное в документе.
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateGraphQLOperationSource(document: string, requestedOperationName: string | undefined, diagnostics: DiagnosticDraft[], options: GraphQLOperationSourceOptions, node?: t.Node): string | undefined;
|
|
23
|
+
export declare function readStaticStringSource(node: t.Expression, diagnostics: DiagnosticDraft[], sourcePath: string, codePrefix: string): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Сверяет variables(...) с объявлениями переменных выбранной operation без схемы.
|
|
26
|
+
* Лишние ключи — warning, отсутствующие обязательные (`!` без default) — error.
|
|
27
|
+
* Проверка выполняется, только если variables(...) отсутствует или возвращает object literal:
|
|
28
|
+
* для вычисляемого объекта набор ключей статически неизвестен.
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateGraphQLVariablesSource(document: string, operationName: string | undefined, variablesNode: t.Node | undefined, variables: SourceExpressionIR | null, diagnostics: DiagnosticDraft[], options: GraphQLOperationSourceOptions, documentNode?: t.Node): void;
|
|
31
|
+
export interface GraphQLFragmentsSourceDraft {
|
|
32
|
+
node: t.Node;
|
|
33
|
+
entries: Map<string, {
|
|
34
|
+
variants: GraphQLFragmentVariant[];
|
|
35
|
+
selected: number;
|
|
36
|
+
node: t.Node;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Читает `fragments: { Имя: gql\`fragment Имя on Тип {...}\` | contextSwitch({...}) }`.
|
|
41
|
+
* Все ветки contextSwitch проверяются; выбирается ветка по фасетам сборки (вне сборки — default).
|
|
42
|
+
*/
|
|
43
|
+
export declare function readGraphQLFragmentsSource(node: t.Expression, diagnostics: DiagnosticDraft[], options: GraphQLOperationSourceOptions): GraphQLFragmentsSourceDraft;
|
|
44
|
+
/**
|
|
45
|
+
* Проверяет spread-ы и фрагменты относительно document operation и подставляет выбранные варианты.
|
|
46
|
+
* Без поля fragments проверяет только, что все spread document определены в нём самом.
|
|
47
|
+
*/
|
|
48
|
+
export declare function applyGraphQLFragmentsSource(document: string, operationName: string | undefined, draft: GraphQLFragmentsSourceDraft | null, diagnostics: DiagnosticDraft[], options: GraphQLOperationSourceOptions, documentNode?: t.Node): {
|
|
49
|
+
document: string;
|
|
50
|
+
fragments?: GraphQLDocumentFragments;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import { ProgramDiagnostic } from '../../../program/domain/types/program.types';
|
|
2
|
+
import { SourceContextPattern } from '../../domain/types/source-context.types';
|
|
2
3
|
import { SourceExpressionIR } from '../../domain/types/source-expression.types';
|
|
3
4
|
import * as t from '@babel/types';
|
|
4
5
|
type DiagnosticDraft = Omit<ProgramDiagnostic, 'entityRef'>;
|
|
5
6
|
export declare function compileSourceExpression(raw: t.Expression | null | undefined, diagnostics: DiagnosticDraft[], sourcePath: string): SourceExpressionIR | null;
|
|
7
|
+
export interface ContextSwitchNode<T> {
|
|
8
|
+
defaultValue: T;
|
|
9
|
+
branches: Array<{
|
|
10
|
+
when: SourceContextPattern;
|
|
11
|
+
value: T;
|
|
12
|
+
node: t.Node;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export declare function readContextSwitchNode<T>(node: t.CallExpression, diagnostics: DiagnosticDraft[], switchPath: string, readBranch: (node: t.Expression, diagnostics: DiagnosticDraft[], sourcePath: string) => T): ContextSwitchNode<T> | null;
|
|
16
|
+
export declare function selectContextSwitchNode<T>(node: t.CallExpression, diagnostics: DiagnosticDraft[], sourcePath: string, readBranch: (node: t.Expression, diagnostics: DiagnosticDraft[], sourcePath: string) => T | null): {
|
|
17
|
+
selected: T;
|
|
18
|
+
variants: T[];
|
|
19
|
+
} | null;
|
|
20
|
+
export declare function isContextSwitchCall(node: t.Node | null | undefined): boolean;
|
|
21
|
+
export declare function readContextPatternNode(node: t.ObjectExpression, diagnostics: DiagnosticDraft[], sourcePath: string, codes: {
|
|
22
|
+
entry: string;
|
|
23
|
+
duplicate: string;
|
|
24
|
+
}): Record<string, string>;
|
|
25
|
+
export declare function pushContextUnbound(name: string, diagnostics: DiagnosticDraft[], sourcePath: string, node: t.Node): void;
|
|
26
|
+
export declare function validateSourcePath(path: string, diagnostics: DiagnosticDraft[], sourcePath: string, node?: t.Node | null): void;
|
|
6
27
|
export declare const compileValueExpression: typeof compileSourceExpression;
|
|
7
28
|
export declare function compileSourceCallback(raw: t.CallExpression['arguments'][number] | undefined, diagnostics: DiagnosticDraft[], sourcePath: string): SourceExpressionIR | null;
|
|
8
29
|
export declare function unwrapExpression<T extends t.Node>(node: T): T;
|
package/dist/features/core/modules/source/services/compilers/source-model-reference-compile.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { ProgramDiagnostic } from '../../../program/domain/types/program.types';
|
|
2
|
+
import { DataViewExternalRef, DataViewInlineRef } from '../../domain/types/data-view-source.types';
|
|
1
3
|
import * as t from '@babel/types';
|
|
2
|
-
|
|
4
|
+
type DiagnosticDraft = Omit<ProgramDiagnostic, 'entityRef'>;
|
|
5
|
+
type ParsedSourceModelReferenceBranch = {
|
|
3
6
|
kind: 'external';
|
|
4
7
|
identity: string;
|
|
5
8
|
} | {
|
|
@@ -7,8 +10,15 @@ export type ParsedSourceModelReference = {
|
|
|
7
10
|
source: string;
|
|
8
11
|
definition: t.CallExpression;
|
|
9
12
|
};
|
|
13
|
+
export type ParsedSourceModelReference = ParsedSourceModelReferenceBranch & {
|
|
14
|
+
variants?: ParsedSourceModelReferenceBranch[];
|
|
15
|
+
};
|
|
16
|
+
export declare function toDataViewRef(reference: ParsedSourceModelReference): DataViewExternalRef | DataViewInlineRef;
|
|
10
17
|
export declare function readSourceModelIdentity(raw: t.CallExpression['arguments'][number] | undefined, referenceCall: string): string | null;
|
|
11
18
|
export declare function readSourceModelReference(raw: t.CallExpression['arguments'][number] | undefined, source: string, options: {
|
|
12
19
|
referenceCall: string;
|
|
13
20
|
defineCall: string;
|
|
21
|
+
diagnostics?: DiagnosticDraft[];
|
|
22
|
+
sourcePath?: string;
|
|
14
23
|
}): ParsedSourceModelReference | null;
|
|
24
|
+
export {};
|
|
@@ -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>;
|