grafast 0.0.0 → 0.0.1-0.2
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/LICENSE.md +26 -0
- package/README.md +3 -1
- package/dist/LICENSES.txt +273 -0
- package/dist/args.d.ts +3 -0
- package/dist/assert.d.ts +3 -0
- package/dist/bucket.d.ts +24 -0
- package/dist/config.d.ts +9 -0
- package/dist/constraints.d.ts +30 -0
- package/dist/deferred.d.ts +6 -0
- package/dist/dev.d.ts +3 -0
- package/dist/engine/LayerPlan.d.ts +80 -0
- package/dist/engine/OperationPlan.d.ts +120 -0
- package/dist/engine/OutputPlan.d.ts +84 -0
- package/dist/engine/StepTracker.d.ts +35 -0
- package/dist/engine/executeBucket.d.ts +5 -0
- package/dist/engine/executeOutputPlan.d.ts +42 -0
- package/dist/engine/lib/withGlobalLayerPlan.d.ts +5 -0
- package/dist/envelop.d.ts +7 -0
- package/dist/envelop.js +1 -0
- package/dist/error.d.ts +13 -0
- package/dist/establishOperationPlan.d.ts +9 -0
- package/dist/execute.d.ts +5 -0
- package/dist/exportAs.d.ts +5 -0
- package/dist/global.d.ts +3 -0
- package/dist/grafastGraphql.d.ts +5 -0
- package/dist/grafastPrint.d.ts +5 -0
- package/dist/graphqlCollectFields.d.ts +12 -0
- package/dist/graphqlMergeSelectionSets.d.ts +4 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +169 -0
- package/dist/input.d.ts +11 -0
- package/dist/inspect.d.ts +4 -0
- package/dist/interfaces.d.ts +261 -0
- package/dist/makeGrafastSchema.d.ts +52 -0
- package/dist/mermaid.d.ts +15 -0
- package/dist/opPlan-input.d.ts +6 -0
- package/dist/polymorphic.d.ts +6 -0
- package/dist/prepare.d.ts +11 -0
- package/dist/step.d.ts +104 -0
- package/dist/steps/__inputDynamicScalar.d.ts +18 -0
- package/dist/steps/__inputList.d.ts +23 -0
- package/dist/steps/__inputObject.d.ts +24 -0
- package/dist/steps/__inputStaticLeaf.d.ts +15 -0
- package/dist/steps/__item.d.ts +19 -0
- package/dist/steps/__trackedObject.d.ts +28 -0
- package/dist/steps/__value.d.ts +16 -0
- package/dist/steps/access.d.ts +24 -0
- package/dist/steps/connection.d.ts +84 -0
- package/dist/steps/constant.d.ts +20 -0
- package/dist/steps/deepEval.d.ts +19 -0
- package/dist/steps/each.d.ts +5 -0
- package/dist/steps/error.d.ts +15 -0
- package/dist/steps/filter.d.ts +6 -0
- package/dist/steps/first.d.ts +18 -0
- package/dist/steps/graphqlResolver.d.ts +65 -0
- package/dist/steps/groupBy.d.ts +5 -0
- package/dist/steps/index.d.ts +37 -0
- package/dist/steps/lambda.d.ts +23 -0
- package/dist/steps/last.d.ts +17 -0
- package/dist/steps/list.d.ts +24 -0
- package/dist/steps/listTransform.d.ts +45 -0
- package/dist/steps/listen.d.ts +26 -0
- package/dist/steps/loadMany.d.ts +46 -0
- package/dist/steps/loadOne.d.ts +30 -0
- package/dist/steps/map.d.ts +26 -0
- package/dist/steps/node.d.ts +30 -0
- package/dist/steps/object.d.ts +49 -0
- package/dist/steps/partitionByIndex.d.ts +4 -0
- package/dist/steps/proxy.d.ts +22 -0
- package/dist/steps/reverse.d.ts +18 -0
- package/dist/steps/setter.d.ts +27 -0
- package/dist/stringifyPayload.d.ts +3 -0
- package/dist/stripAnsi.d.ts +3 -0
- package/dist/subscribe.d.ts +4 -0
- package/dist/utils.d.ts +60 -0
- package/package.json +60 -9
- package/index.js +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ExecutionExtra } from "../interfaces.js";
|
|
2
|
+
import type { ExecutableStep } from "../step.js";
|
|
3
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
+
export declare const expressionSymbol: unique symbol;
|
|
5
|
+
export declare class AccessStep<TData> extends UnbatchedExecutableStep<TData> {
|
|
6
|
+
readonly fallback?: any;
|
|
7
|
+
static $$export: {
|
|
8
|
+
moduleName: string;
|
|
9
|
+
exportName: string;
|
|
10
|
+
};
|
|
11
|
+
isSyncAndSafe: boolean;
|
|
12
|
+
allowMultipleOptimizations: boolean;
|
|
13
|
+
readonly path: (string | number | symbol)[];
|
|
14
|
+
constructor(parentPlan: ExecutableStep<unknown>, path: (string | number | symbol)[], fallback?: any);
|
|
15
|
+
toStringMeta(): string;
|
|
16
|
+
get<TAttr extends keyof TData>(attrName: TAttr): AccessStep<TData[TAttr]>;
|
|
17
|
+
at<TIndex extends keyof TData>(index: TIndex): AccessStep<TData[TIndex]>;
|
|
18
|
+
optimize(): AccessStep<TData>;
|
|
19
|
+
finalize(): void;
|
|
20
|
+
unbatchedExecute(_extra: ExecutionExtra, ..._values: any[]): any;
|
|
21
|
+
deduplicate(peers: AccessStep<unknown>[]): AccessStep<TData>[];
|
|
22
|
+
}
|
|
23
|
+
export declare function access<TData>(parentPlan: ExecutableStep<unknown>, path: (string | number | symbol)[] | string | number | symbol, fallback?: any): AccessStep<TData>;
|
|
24
|
+
//# sourceMappingURL=access.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { InputStep } from "../input.js";
|
|
2
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
3
|
+
import type { ExecutableStep } from "../step.js";
|
|
4
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
5
|
+
declare type ParametersExceptFirst<F> = F extends (arg0: any, ...rest: infer R) => any ? R : never[];
|
|
6
|
+
export interface PageInfoCapableStep extends ExecutableStep<any> {
|
|
7
|
+
hasNextPage(): ExecutableStep<boolean>;
|
|
8
|
+
hasPreviousPage(): ExecutableStep<boolean>;
|
|
9
|
+
startCursor(): ExecutableStep<string | null>;
|
|
10
|
+
endCursor(): ExecutableStep<string | null>;
|
|
11
|
+
}
|
|
12
|
+
export interface ConnectionCapableStep<TItemStep extends ExecutableStep<any>, TCursorStep extends ExecutableStep<any>> extends ExecutableStep<ReadonlyArray<TItemStep extends ExecutableStep<infer U> ? U : any>> {
|
|
13
|
+
connectionClone($connection: ConnectionStep<TItemStep, TCursorStep, any, any>, ...args: any[]): ConnectionCapableStep<TItemStep, TCursorStep>;
|
|
14
|
+
pageInfo($connection: ConnectionStep<TItemStep, TCursorStep, ConnectionCapableStep<TItemStep, TCursorStep>, any>): PageInfoCapableStep;
|
|
15
|
+
setFirst($plan: InputStep): void;
|
|
16
|
+
setLast($plan: InputStep): void;
|
|
17
|
+
setOffset($plan: InputStep): void;
|
|
18
|
+
parseCursor($plan: InputStep): TCursorStep | null | undefined;
|
|
19
|
+
setBefore($plan: TCursorStep): void;
|
|
20
|
+
setAfter($plan: TCursorStep): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class ConnectionStep<TItemStep extends ExecutableStep<any>, TCursorStep extends ExecutableStep<any>, TStep extends ConnectionCapableStep<TItemStep, TCursorStep>, TNodeStep extends ExecutableStep<any> = ExecutableStep<any>> extends UnbatchedExecutableStep<unknown> {
|
|
23
|
+
readonly itemPlan?: (($item: TItemStep) => TNodeStep) | undefined;
|
|
24
|
+
readonly cursorPlan?: (($item: TItemStep) => ExecutableStep<string | null> | undefined) | undefined;
|
|
25
|
+
static $$export: {
|
|
26
|
+
moduleName: string;
|
|
27
|
+
exportName: string;
|
|
28
|
+
};
|
|
29
|
+
isSyncAndSafe: boolean;
|
|
30
|
+
private subplanId;
|
|
31
|
+
private _firstDepId;
|
|
32
|
+
private _lastDepId;
|
|
33
|
+
private _offsetDepId;
|
|
34
|
+
private _beforeDepId;
|
|
35
|
+
private _afterDepId;
|
|
36
|
+
constructor(subplan: TStep, itemPlan?: (($item: TItemStep) => TNodeStep) | undefined, cursorPlan?: (($item: TItemStep) => ExecutableStep<string | null> | undefined) | undefined);
|
|
37
|
+
toStringMeta(): string;
|
|
38
|
+
getFirst(): InputStep | null;
|
|
39
|
+
setFirst($firstPlan: InputStep): void;
|
|
40
|
+
getLast(): InputStep | null;
|
|
41
|
+
setLast($lastPlan: InputStep): void;
|
|
42
|
+
getOffset(): InputStep | null;
|
|
43
|
+
setOffset($offsetPlan: InputStep): void;
|
|
44
|
+
getBefore(): TCursorStep | null;
|
|
45
|
+
setBefore($beforePlan: InputStep): void;
|
|
46
|
+
getAfter(): TCursorStep | null;
|
|
47
|
+
setAfter($afterPlan: InputStep): void;
|
|
48
|
+
getSubplan(): TStep;
|
|
49
|
+
cloneSubplanWithoutPagination(...args: ParametersExceptFirst<TStep["connectionClone"]>): TStep;
|
|
50
|
+
cloneSubplanWithPagination(...args: ParametersExceptFirst<TStep["connectionClone"]> | []): TStep;
|
|
51
|
+
edges(): TStep | import("./listTransform.js").__ListTransformStep<any, any, any, any>;
|
|
52
|
+
nodes(): TStep | import("./listTransform.js").__ListTransformStep<any, any, any, any>;
|
|
53
|
+
wrapEdge($edge: TItemStep): EdgeStep<TItemStep, TCursorStep, TStep, TNodeStep>;
|
|
54
|
+
pageInfo(): PageInfoCapableStep;
|
|
55
|
+
execute(values: Array<GrafastValuesList<any>>): GrafastResultsList<Record<string, never>>;
|
|
56
|
+
unbatchedExecute(): any;
|
|
57
|
+
}
|
|
58
|
+
export interface EdgeCapableStep<TNodeStep extends ExecutableStep<any>> extends ExecutableStep<any> {
|
|
59
|
+
node(): TNodeStep;
|
|
60
|
+
cursor(): ExecutableStep<string | null>;
|
|
61
|
+
}
|
|
62
|
+
export declare class EdgeStep<TItemStep extends ExecutableStep<any>, TCursorStep extends ExecutableStep<any>, TStep extends ConnectionCapableStep<TItemStep, TCursorStep>, TNodeStep extends ExecutableStep<any> = ExecutableStep<any>> extends UnbatchedExecutableStep implements EdgeCapableStep<TNodeStep> {
|
|
63
|
+
private skipCursor;
|
|
64
|
+
static $$export: {
|
|
65
|
+
moduleName: string;
|
|
66
|
+
exportName: string;
|
|
67
|
+
};
|
|
68
|
+
isSyncAndSafe: boolean;
|
|
69
|
+
private connectionDepId;
|
|
70
|
+
private readonly cursorDepId;
|
|
71
|
+
private needCursor;
|
|
72
|
+
constructor($connection: ConnectionStep<TItemStep, TCursorStep, TStep, TNodeStep>, $item: TItemStep, skipCursor?: boolean);
|
|
73
|
+
private getConnectionStep;
|
|
74
|
+
private getItemStep;
|
|
75
|
+
node(): TNodeStep;
|
|
76
|
+
cursor(): ExecutableStep<string | null>;
|
|
77
|
+
optimize(): EdgeStep<TItemStep, TCursorStep, TStep, TNodeStep>;
|
|
78
|
+
deduplicate(_peers: EdgeStep<any, any, any, any>[]): EdgeStep<TItemStep, TCursorStep, TStep, TNodeStep>[];
|
|
79
|
+
deduplicatedWith(replacement: EdgeStep<any, any, any, any>): void;
|
|
80
|
+
unbatchedExecute(extra: ExecutionExtra, record: any, cursor: any): any;
|
|
81
|
+
}
|
|
82
|
+
export declare function connection<TItemStep extends ExecutableStep<any>, TCursorStep extends ExecutableStep<any>, TStep extends ConnectionCapableStep<TItemStep, TCursorStep>, TNodeStep extends ExecutableStep<any> = ExecutableStep<any>>(step: TStep, itemPlan?: ($item: TItemStep) => TNodeStep, cursorPlan?: ($item: TItemStep) => ExecutableStep<string | null>): ConnectionStep<TItemStep, TCursorStep, TStep, TNodeStep>;
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { GrafastResultsList } from "../interfaces.js";
|
|
2
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
3
|
+
export declare class ConstantStep<TData> extends UnbatchedExecutableStep<TData> {
|
|
4
|
+
private data;
|
|
5
|
+
static $$export: {
|
|
6
|
+
moduleName: string;
|
|
7
|
+
exportName: string;
|
|
8
|
+
};
|
|
9
|
+
isSyncAndSafe: boolean;
|
|
10
|
+
constructor(data: TData);
|
|
11
|
+
execute(values: [[undefined]]): GrafastResultsList<TData>;
|
|
12
|
+
eval(): TData;
|
|
13
|
+
evalIs(value: any): boolean;
|
|
14
|
+
evalIsEmpty(): boolean;
|
|
15
|
+
unbatchedExecute(): TData;
|
|
16
|
+
isNull(): boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function constant(strings: TemplateStringsArray & [string]): ConstantStep<string>;
|
|
19
|
+
export declare function constant<TData>(data: TData): ConstantStep<TData>;
|
|
20
|
+
//# sourceMappingURL=constant.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LayerPlanReasonSubroutine } from "../engine/LayerPlan.js";
|
|
2
|
+
import { LayerPlan } from "../engine/LayerPlan.js";
|
|
3
|
+
import type { GrafastError } from "../error.js";
|
|
4
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
5
|
+
import type { ListCapableStep } from "../step.js";
|
|
6
|
+
import { ExecutableStep } from "../step.js";
|
|
7
|
+
export declare class DeepEvalStep extends ExecutableStep {
|
|
8
|
+
static $$export: {
|
|
9
|
+
moduleName: string;
|
|
10
|
+
exportName: string;
|
|
11
|
+
};
|
|
12
|
+
isSyncAndSafe: boolean;
|
|
13
|
+
itemStepId: number;
|
|
14
|
+
subroutineLayer: LayerPlan<LayerPlanReasonSubroutine>;
|
|
15
|
+
constructor(listPlan: ListCapableStep<any, any>);
|
|
16
|
+
execute(values: [GrafastValuesList<any[] | null | undefined | GrafastError>], extra: ExecutionExtra): Promise<GrafastResultsList<any[]>>;
|
|
17
|
+
}
|
|
18
|
+
export declare function deepEval($step: ExecutableStep): ExecutableStep<any>;
|
|
19
|
+
//# sourceMappingURL=deepEval.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ExecutableStep, ListCapableStep } from "../step.js";
|
|
2
|
+
import { __ItemStep } from "./__item.js";
|
|
3
|
+
import type { __ListTransformStep } from "./listTransform.js";
|
|
4
|
+
export declare function each<TListStep extends ExecutableStep<readonly any[]>, TResultItemStep extends ExecutableStep<any>>(listPlan: TListStep, mapper: (itemPlan: TListStep extends ListCapableStep<any, any> ? ReturnType<TListStep["listItem"]> : __ItemStep<any>) => TResultItemStep): __ListTransformStep<any, any, any, any>;
|
|
5
|
+
//# sourceMappingURL=each.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
2
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
3
|
+
export declare class ErrorStep<TError extends Error> extends UnbatchedExecutableStep<never> {
|
|
4
|
+
static $$export: {
|
|
5
|
+
moduleName: string;
|
|
6
|
+
exportName: string;
|
|
7
|
+
};
|
|
8
|
+
isSyncAndSafe: boolean;
|
|
9
|
+
error: TError;
|
|
10
|
+
constructor(error: TError);
|
|
11
|
+
execute(values: GrafastValuesList<any>): GrafastResultsList<any>;
|
|
12
|
+
unbatchedExecute(): any;
|
|
13
|
+
}
|
|
14
|
+
export declare function error<TError extends Error>(error: TError): ErrorStep<TError>;
|
|
15
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExecutableStep, ListCapableStep } from "../step.js";
|
|
2
|
+
import type { __ItemStep } from "./__item.js";
|
|
3
|
+
import type { __ListTransformStep, ListTransformItemPlanCallback } from "./listTransform.js";
|
|
4
|
+
export declare type FilterPlanMemo = unknown[];
|
|
5
|
+
export declare function filter<TListStep extends ExecutableStep<readonly any[]>, TItemStep extends ExecutableStep<boolean>>(listPlan: TListStep, filterCallback: ListTransformItemPlanCallback<TListStep, TItemStep>): __ListTransformStep<TListStep, TItemStep, FilterPlanMemo, TListStep extends ListCapableStep<any, any> ? ReturnType<TListStep["listItem"]> : __ItemStep<any>>;
|
|
6
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
2
|
+
import type { ExecutableStep } from "../step.js";
|
|
3
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
+
export declare class FirstStep<TData> extends UnbatchedExecutableStep<TData> {
|
|
5
|
+
static $$export: {
|
|
6
|
+
moduleName: string;
|
|
7
|
+
exportName: string;
|
|
8
|
+
};
|
|
9
|
+
isSyncAndSafe: boolean;
|
|
10
|
+
allowMultipleOptimizations: boolean;
|
|
11
|
+
constructor(parentPlan: ExecutableStep<ReadonlyArray<TData>>);
|
|
12
|
+
execute(values: GrafastValuesList<[ReadonlyArray<TData>]>): GrafastResultsList<TData>;
|
|
13
|
+
unbatchedExecute(extra: ExecutionExtra, list: any[]): any;
|
|
14
|
+
deduplicate(peers: FirstStep<TData>[]): FirstStep<TData>[];
|
|
15
|
+
optimize(): ExecutableStep<any> | this;
|
|
16
|
+
}
|
|
17
|
+
export declare function first<TData>(plan: ExecutableStep<ReadonlyArray<TData>>): FirstStep<TData>;
|
|
18
|
+
//# sourceMappingURL=first.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { GraphQLFieldResolver, GraphQLNullableType, GraphQLOutputType, GraphQLResolveInfo } from "graphql";
|
|
2
|
+
import type { __ItemStep, ObjectStep } from "../index.js";
|
|
3
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList, PolymorphicData } from "../interfaces.js";
|
|
4
|
+
import type { PolymorphicStep } from "../step.js";
|
|
5
|
+
import { ExecutableStep, UnbatchedExecutableStep } from "../step.js";
|
|
6
|
+
declare type ResolveInfoBase = Omit<GraphQLResolveInfo, "path" | "rootValue" | "variableValues">;
|
|
7
|
+
export declare class GraphQLResolverStep extends UnbatchedExecutableStep {
|
|
8
|
+
private resolver;
|
|
9
|
+
private resolveInfoBase;
|
|
10
|
+
private returnContextAndResolveInfo;
|
|
11
|
+
static $$export: {
|
|
12
|
+
moduleName: string;
|
|
13
|
+
exportName: string;
|
|
14
|
+
};
|
|
15
|
+
isSyncAndSafe: boolean;
|
|
16
|
+
allowMultipleOptimizations: boolean;
|
|
17
|
+
private planDep;
|
|
18
|
+
private argsDep;
|
|
19
|
+
private contextDep;
|
|
20
|
+
private variableValuesDep;
|
|
21
|
+
private rootValueDep;
|
|
22
|
+
private isNotRoot;
|
|
23
|
+
constructor(resolver: GraphQLFieldResolver<any, any> & {
|
|
24
|
+
displayName?: string;
|
|
25
|
+
}, $plan: ExecutableStep, $args: ObjectStep, resolveInfoBase: ResolveInfoBase, returnContextAndResolveInfo?: boolean);
|
|
26
|
+
toStringMeta(): string;
|
|
27
|
+
deduplicate(peers: GraphQLResolverStep[]): GraphQLResolverStep[];
|
|
28
|
+
unbatchedExecute(extra: ExecutionExtra, source: any, args: any, context: any, variableValues: any, rootValue: any): any;
|
|
29
|
+
}
|
|
30
|
+
export declare class GraphQLPolymorphicUnwrap extends UnbatchedExecutableStep {
|
|
31
|
+
static $$export: {
|
|
32
|
+
moduleName: string;
|
|
33
|
+
exportName: string;
|
|
34
|
+
};
|
|
35
|
+
isSyncAndSafe: boolean;
|
|
36
|
+
constructor($parent: ExecutableStep);
|
|
37
|
+
execute(values: [GrafastValuesList<PolymorphicData>]): any[];
|
|
38
|
+
unbatchedExecute(extra: ExecutionExtra, v: PolymorphicData): any;
|
|
39
|
+
}
|
|
40
|
+
export declare function graphqlPolymorphicUnwrap($parent: ExecutableStep): GraphQLPolymorphicUnwrap;
|
|
41
|
+
export declare class GraphQLItemHandler extends ExecutableStep implements PolymorphicStep {
|
|
42
|
+
static $$export: {
|
|
43
|
+
moduleName: string;
|
|
44
|
+
exportName: string;
|
|
45
|
+
};
|
|
46
|
+
private abstractType?;
|
|
47
|
+
private nullableInnerType;
|
|
48
|
+
isSyncAndSafe: boolean;
|
|
49
|
+
constructor($parent: ExecutableStep, nullableType: GraphQLNullableType & GraphQLOutputType);
|
|
50
|
+
planForType(): GraphQLPolymorphicUnwrap;
|
|
51
|
+
listItem($item: __ItemStep<any>): GraphQLItemHandler;
|
|
52
|
+
private figureOutTheTypeOf;
|
|
53
|
+
private actuallyWrapData;
|
|
54
|
+
private polymorphicWrapData;
|
|
55
|
+
wrapListData(data: unknown, context: unknown, resolveInfo: GraphQLResolveInfo): ({
|
|
56
|
+
data: {};
|
|
57
|
+
context: unknown;
|
|
58
|
+
resolveInfo: GraphQLResolveInfo;
|
|
59
|
+
} | null | undefined)[] | null;
|
|
60
|
+
execute(values: [GrafastValuesList<any>]): GrafastResultsList<any>;
|
|
61
|
+
}
|
|
62
|
+
export declare function graphqlItemHandler($item: ExecutableStep, nullableType: GraphQLNullableType & GraphQLOutputType): GraphQLItemHandler;
|
|
63
|
+
export declare function graphqlResolver(resolver: GraphQLFieldResolver<any, any>, $step: ExecutableStep, $args: ObjectStep, resolveInfoBase: ResolveInfoBase): ExecutableStep;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=graphqlResolver.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ExecutableStep } from "../step.js";
|
|
2
|
+
import type { __ListTransformStep, ListTransformItemPlanCallback } from "./listTransform.js";
|
|
3
|
+
export declare type GroupByPlanMemo = Map<unknown, unknown[]>;
|
|
4
|
+
export declare function groupBy<TListStep extends ExecutableStep<readonly any[]>, TItemStep extends ExecutableStep<number>>(listPlan: TListStep, mapper: ListTransformItemPlanCallback<TListStep, TItemStep>): __ListTransformStep<TListStep, TItemStep, GroupByPlanMemo, any>;
|
|
5
|
+
//# sourceMappingURL=groupBy.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { OperationPlan } from "../index.js";
|
|
2
|
+
import type { BaseGraphQLContext } from "../interfaces.js";
|
|
3
|
+
import type { __ValueStep } from "./__value.js";
|
|
4
|
+
export declare function operationPlan(): OperationPlan;
|
|
5
|
+
export declare function context<TContext extends BaseGraphQLContext = BaseGraphQLContext>(): __ValueStep<TContext>;
|
|
6
|
+
export declare function debugPlans<T>(callback: () => T): T;
|
|
7
|
+
export { access, AccessStep } from "./access.js";
|
|
8
|
+
export { connection, ConnectionCapableStep, ConnectionStep, EdgeCapableStep, EdgeStep, PageInfoCapableStep, } from "./connection.js";
|
|
9
|
+
export { constant, ConstantStep } from "./constant.js";
|
|
10
|
+
export { each } from "./each.js";
|
|
11
|
+
export { error, ErrorStep } from "./error.js";
|
|
12
|
+
export { filter, FilterPlanMemo } from "./filter.js";
|
|
13
|
+
export { first, FirstStep } from "./first.js";
|
|
14
|
+
export { groupBy, GroupByPlanMemo } from "./groupBy.js";
|
|
15
|
+
export { lambda, LambdaStep } from "./lambda.js";
|
|
16
|
+
export { last, LastStep } from "./last.js";
|
|
17
|
+
export { list, ListStep } from "./list.js";
|
|
18
|
+
export { listen, ListenStep } from "./listen.js";
|
|
19
|
+
export { __ListTransformStep, listTransform, ListTransformItemPlanCallback, ListTransformOptions, ListTransformReduce, } from "./listTransform.js";
|
|
20
|
+
export { ActualKeyByDesiredKey, makeMapper, map, MapStep } from "./map.js";
|
|
21
|
+
export { node, NodeStep, specFromNodeId } from "./node.js";
|
|
22
|
+
export { object, ObjectPlanMeta, ObjectStep } from "./object.js";
|
|
23
|
+
export { partitionByIndex } from "./partitionByIndex.js";
|
|
24
|
+
export { reverse, reverseArray, ReverseStep } from "./reverse.js";
|
|
25
|
+
export { setter, SetterCapableStep, SetterStep } from "./setter.js";
|
|
26
|
+
export { __InputListStep } from "./__inputList.js";
|
|
27
|
+
export { __InputObjectStep } from "./__inputObject.js";
|
|
28
|
+
export { __InputStaticLeafStep } from "./__inputStaticLeaf.js";
|
|
29
|
+
export { __ItemStep } from "./__item.js";
|
|
30
|
+
export { __TrackedObjectStep } from "./__trackedObject.js";
|
|
31
|
+
export { __ValueStep } from "./__value.js";
|
|
32
|
+
export { deepEval, DeepEvalStep } from "./deepEval.js";
|
|
33
|
+
export { GraphQLItemHandler, graphqlItemHandler, GraphQLPolymorphicUnwrap, graphqlPolymorphicUnwrap, graphqlResolver, GraphQLResolverStep, } from "./graphqlResolver.js";
|
|
34
|
+
export { loadMany, LoadManyCallback, loadManyCallback, LoadManyOptions, LoadManySingleRecordStep, LoadManyStep, } from "./loadMany.js";
|
|
35
|
+
export { loadOne, LoadOneCallback, loadOneCallback, LoadOneOptions, LoadOneStep, } from "./loadOne.js";
|
|
36
|
+
export { proxy, ProxyStep } from "./proxy.js";
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ExecutionExtra, PromiseOrDirect } from "../interfaces.js";
|
|
2
|
+
import type { ExecutableStep } from "../step.js";
|
|
3
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
+
export declare class LambdaStep<TIn, TOut> extends UnbatchedExecutableStep<TOut> {
|
|
5
|
+
private fn;
|
|
6
|
+
static $$export: {
|
|
7
|
+
moduleName: string;
|
|
8
|
+
exportName: string;
|
|
9
|
+
};
|
|
10
|
+
isSyncAndSafe: boolean;
|
|
11
|
+
allowMultipleOptimizations: boolean;
|
|
12
|
+
private planDep;
|
|
13
|
+
constructor($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => TOut);
|
|
14
|
+
toStringMeta(): any;
|
|
15
|
+
deduplicate(peers: LambdaStep<any, any>[]): LambdaStep<TIn, TOut>[];
|
|
16
|
+
unbatchedExecute(extra: ExecutionExtra, value: TIn): PromiseOrDirect<TOut>;
|
|
17
|
+
}
|
|
18
|
+
declare function lambda<TIn extends [...any[]], TOut>(plans: {
|
|
19
|
+
[Index in keyof TIn]: ExecutableStep<TIn[Index]>;
|
|
20
|
+
}, fn: (value: TIn) => TOut, isSyncAndSafe?: boolean): LambdaStep<TIn, TOut>;
|
|
21
|
+
declare function lambda<TIn, TOut>($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => TOut, isSyncAndSafe?: boolean): LambdaStep<TIn, TOut>;
|
|
22
|
+
export { lambda };
|
|
23
|
+
//# sourceMappingURL=lambda.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExecutionExtra } from "../interfaces.js";
|
|
2
|
+
import type { ExecutableStep } from "../step.js";
|
|
3
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
+
export declare class LastStep<TData> extends UnbatchedExecutableStep<TData> {
|
|
5
|
+
static $$export: {
|
|
6
|
+
moduleName: string;
|
|
7
|
+
exportName: string;
|
|
8
|
+
};
|
|
9
|
+
isSyncAndSafe: boolean;
|
|
10
|
+
allowMultipleOptimizations: boolean;
|
|
11
|
+
constructor(parentPlan: ExecutableStep<ReadonlyArray<TData>>);
|
|
12
|
+
unbatchedExecute: (extra: ExecutionExtra, list: ReadonlyArray<TData>) => TData;
|
|
13
|
+
deduplicate(peers: LastStep<TData>[]): LastStep<TData>[];
|
|
14
|
+
optimize(): ExecutableStep<any> | this;
|
|
15
|
+
}
|
|
16
|
+
export declare function last<TData>(plan: ExecutableStep<ReadonlyArray<TData>>): LastStep<TData>;
|
|
17
|
+
//# sourceMappingURL=last.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ExecutionExtra } from "../interfaces.js";
|
|
2
|
+
import type { ExecutableStep } from "../step.js";
|
|
3
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
+
declare type UnwrapPlanTuple<TPlanTuple extends readonly ExecutableStep<any>[]> = [
|
|
5
|
+
...(TPlanTuple extends readonly ExecutableStep<infer U>[] ? readonly U[] : never)
|
|
6
|
+
];
|
|
7
|
+
export declare class ListStep<TPlanTuple extends readonly ExecutableStep<any>[]> extends UnbatchedExecutableStep<UnwrapPlanTuple<TPlanTuple>> {
|
|
8
|
+
static $$export: {
|
|
9
|
+
moduleName: string;
|
|
10
|
+
exportName: string;
|
|
11
|
+
};
|
|
12
|
+
isSyncAndSafe: boolean;
|
|
13
|
+
allowMultipleOptimizations: boolean;
|
|
14
|
+
constructor(list: readonly [...TPlanTuple]);
|
|
15
|
+
toStringMeta(): string;
|
|
16
|
+
tupleToTuple(results: Array<UnwrapPlanTuple<TPlanTuple>>, tuple: UnwrapPlanTuple<TPlanTuple>): UnwrapPlanTuple<TPlanTuple>;
|
|
17
|
+
execute(values: any[][]): Array<UnwrapPlanTuple<TPlanTuple>>;
|
|
18
|
+
unbatchedExecute(extra: ExecutionExtra, ...values: any[]): UnwrapPlanTuple<TPlanTuple>;
|
|
19
|
+
deduplicate(peers: ListStep<TPlanTuple>[]): ListStep<TPlanTuple>[];
|
|
20
|
+
at<TIndex extends keyof TPlanTuple>(index: TIndex): TPlanTuple[TIndex];
|
|
21
|
+
}
|
|
22
|
+
export declare function list<TPlanTuple extends ExecutableStep<any>[]>(list: TPlanTuple): ListStep<TPlanTuple>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { LayerPlanReasonSubroutine } from "../engine/LayerPlan.js";
|
|
2
|
+
import { LayerPlan } from "../engine/LayerPlan.js";
|
|
3
|
+
import type { GrafastError } from "../error.js";
|
|
4
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
5
|
+
import type { ListCapableStep } from "../step.js";
|
|
6
|
+
import { $$deepDepSkip, ExecutableStep } from "../step.js";
|
|
7
|
+
import { __ItemStep } from "./__item.js";
|
|
8
|
+
export declare type ListTransformReduce<TMemo, TItemPlanData> = (memo: TMemo, entireItemValue: unknown, itemPlanData: TItemPlanData) => TMemo;
|
|
9
|
+
export declare type ListTransformItemPlanCallback<TListStep extends ExecutableStep<readonly any[]>, TDepsStep extends ExecutableStep> = (listItemPlan: TListStep extends ListCapableStep<any, any> ? ReturnType<TListStep["listItem"]> : __ItemStep<any>) => TDepsStep;
|
|
10
|
+
export interface ListTransformOptions<TListStep extends ExecutableStep<readonly any[]>, TDepsStep extends ExecutableStep, TMemo, TItemStep extends ExecutableStep | undefined = undefined> {
|
|
11
|
+
listPlan: TListStep;
|
|
12
|
+
itemPlanCallback: ListTransformItemPlanCallback<TListStep, TDepsStep>;
|
|
13
|
+
initialState(): TMemo;
|
|
14
|
+
reduceCallback: ListTransformReduce<TMemo, TDepsStep extends ExecutableStep<infer U> ? U : never>;
|
|
15
|
+
listItem?(itemPlan: ExecutableStep<any>): TItemStep;
|
|
16
|
+
finalizeCallback?(data: TMemo): TMemo;
|
|
17
|
+
meta?: string;
|
|
18
|
+
optimize?: (this: __ListTransformStep<TListStep, TDepsStep, TMemo, TItemStep>) => ExecutableStep;
|
|
19
|
+
}
|
|
20
|
+
export declare class __ListTransformStep<TListStep extends ExecutableStep<readonly any[]>, TDepsStep extends ExecutableStep, TMemo, TItemStep extends ExecutableStep | undefined = undefined> extends ExecutableStep<TMemo> {
|
|
21
|
+
static $$export: {
|
|
22
|
+
moduleName: string;
|
|
23
|
+
exportName: string;
|
|
24
|
+
};
|
|
25
|
+
isSyncAndSafe: boolean;
|
|
26
|
+
private listPlanDepId;
|
|
27
|
+
itemPlanCallback: ListTransformItemPlanCallback<TListStep, TDepsStep>;
|
|
28
|
+
initialState: () => TMemo;
|
|
29
|
+
reduceCallback: ListTransformReduce<TMemo, TDepsStep extends ExecutableStep<infer U> ? U : never>;
|
|
30
|
+
finalizeCallback?: (data: TMemo) => TMemo;
|
|
31
|
+
listItem?: (itemPlan: __ItemStep<this>) => TItemStep;
|
|
32
|
+
private meta;
|
|
33
|
+
itemStepId: number;
|
|
34
|
+
subroutineLayer: LayerPlan<LayerPlanReasonSubroutine>;
|
|
35
|
+
constructor(options: ListTransformOptions<TListStep, TDepsStep, TMemo, TItemStep>);
|
|
36
|
+
toStringMeta(): string | null;
|
|
37
|
+
getListStep(): TListStep;
|
|
38
|
+
[$$deepDepSkip](): TListStep;
|
|
39
|
+
dangerouslyGetListPlan(): TListStep;
|
|
40
|
+
deduplicate(peers: __ListTransformStep<any, any, any, any>[]): __ListTransformStep<TListStep, TDepsStep, TMemo, TItemStep>[];
|
|
41
|
+
optimize(): ExecutableStep;
|
|
42
|
+
execute(values: [GrafastValuesList<any[] | null | undefined | GrafastError>], extra: ExecutionExtra): Promise<GrafastResultsList<TMemo>>;
|
|
43
|
+
}
|
|
44
|
+
export declare function listTransform<TListStep extends ExecutableStep<readonly any[]>, TDepsStep extends ExecutableStep, TMemo, TItemStep extends ExecutableStep | undefined = undefined>(options: ListTransformOptions<TListStep, TDepsStep, TMemo, TItemStep>): __ListTransformStep<TListStep, TDepsStep, TMemo, TItemStep>;
|
|
45
|
+
//# sourceMappingURL=listTransform.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GrafastResultStreamList, GrafastSubscriber, GrafastValuesList } from "../interfaces.js";
|
|
2
|
+
import type { StreamableStep } from "../step.js";
|
|
3
|
+
import { ExecutableStep } from "../step.js";
|
|
4
|
+
import type { __ItemStep } from "./__item.js";
|
|
5
|
+
export declare class ListenStep<TTopics extends {
|
|
6
|
+
[topic: string]: any;
|
|
7
|
+
}, TTopic extends keyof TTopics, TPayloadStep extends ExecutableStep> extends ExecutableStep<TTopics[TTopic]> implements StreamableStep<TTopics[TTopic]> {
|
|
8
|
+
itemPlan: (itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep;
|
|
9
|
+
static $$export: {
|
|
10
|
+
moduleName: string;
|
|
11
|
+
exportName: string;
|
|
12
|
+
};
|
|
13
|
+
isSyncAndSafe: boolean;
|
|
14
|
+
private pubsubDep;
|
|
15
|
+
private topicDep;
|
|
16
|
+
constructor(pubsubOrPlan: ExecutableStep<GrafastSubscriber<TTopics>> | GrafastSubscriber<TTopics>, topicOrPlan: ExecutableStep<TTopic> | string, itemPlan: (itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep);
|
|
17
|
+
execute(): never;
|
|
18
|
+
stream(values: readonly [
|
|
19
|
+
GrafastValuesList<GrafastSubscriber<TTopics>>,
|
|
20
|
+
GrafastValuesList<TTopic>
|
|
21
|
+
]): GrafastResultStreamList<TTopics[TTopic]>;
|
|
22
|
+
}
|
|
23
|
+
export declare function listen<TTopics extends {
|
|
24
|
+
[topic: string]: any;
|
|
25
|
+
}, TTopic extends keyof TTopics, TPayloadStep extends ExecutableStep>(pubsubOrPlan: ExecutableStep<GrafastSubscriber<TTopics>> | GrafastSubscriber<TTopics>, topicOrPlan: ExecutableStep<TTopic> | string, itemPlan: (itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep): ListenStep<TTopics, TTopic, TPayloadStep>;
|
|
26
|
+
//# sourceMappingURL=listen.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { __ItemStep } from "../index.js";
|
|
2
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList, PromiseOrDirect } from "../interfaces.js";
|
|
3
|
+
import { ExecutableStep } from "../step.js";
|
|
4
|
+
export interface LoadManyOptions<TData, TParams extends Record<string, any>> {
|
|
5
|
+
attributes: ReadonlyArray<keyof TData> | null;
|
|
6
|
+
params: Partial<TParams>;
|
|
7
|
+
}
|
|
8
|
+
export declare type LoadManyCallback<TSpec, TData, TParams extends Record<string, any>> = {
|
|
9
|
+
(specs: ReadonlyArray<TSpec>, options: LoadManyOptions<TData, TParams>): PromiseOrDirect<ReadonlyArray<ReadonlyArray<TData>>>;
|
|
10
|
+
displayName?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function loadManyCallback<TSpec, TData, TParams extends Record<string, any>>(callback: LoadManyCallback<TSpec, TData, TParams>): LoadManyCallback<TSpec, TData, TParams>;
|
|
13
|
+
export declare class LoadManySingleRecordStep<TData> extends ExecutableStep<TData> {
|
|
14
|
+
private sourceDescription?;
|
|
15
|
+
static $$export: {
|
|
16
|
+
moduleName: string;
|
|
17
|
+
exportName: string;
|
|
18
|
+
};
|
|
19
|
+
isSyncAndSafe: boolean;
|
|
20
|
+
attributes: Set<keyof TData>;
|
|
21
|
+
constructor($data: ExecutableStep<TData>, sourceDescription?: string | undefined);
|
|
22
|
+
toStringMeta(): string | null;
|
|
23
|
+
get(attr: keyof TData & (string | number)): import("./access.js").AccessStep<unknown>;
|
|
24
|
+
optimize(): ExecutableStep<any>;
|
|
25
|
+
execute([records]: [GrafastValuesList<TData>]): GrafastResultsList<TData>;
|
|
26
|
+
}
|
|
27
|
+
export declare class LoadManyStep<TSpec, TData, TParams extends Record<string, any>> extends ExecutableStep {
|
|
28
|
+
private load;
|
|
29
|
+
static $$export: {
|
|
30
|
+
moduleName: string;
|
|
31
|
+
exportName: string;
|
|
32
|
+
};
|
|
33
|
+
loadOptions: LoadManyOptions<TData, TParams> | null;
|
|
34
|
+
loadOptionsKey: string;
|
|
35
|
+
attributes: Set<keyof TData>;
|
|
36
|
+
params: Partial<TParams>;
|
|
37
|
+
constructor($spec: ExecutableStep<TSpec>, load: LoadManyCallback<TSpec, TData, TParams>);
|
|
38
|
+
toStringMeta(): string;
|
|
39
|
+
listItem($item: __ItemStep<TData>): LoadManySingleRecordStep<unknown>;
|
|
40
|
+
setParam<TParamKey extends keyof TParams>(paramKey: TParamKey, value: TParams[TParamKey]): void;
|
|
41
|
+
addAttributes(attributes: Set<keyof TData>): void;
|
|
42
|
+
finalize(): void;
|
|
43
|
+
execute([specs]: [GrafastValuesList<TSpec>], extra: ExecutionExtra): PromiseOrDirect<GrafastResultsList<ReadonlyArray<TData>>>;
|
|
44
|
+
}
|
|
45
|
+
export declare function loadMany<TSpec, TData, TParams extends Record<string, any>>($spec: ExecutableStep<TSpec>, load: LoadManyCallback<TSpec, TData, TParams>): LoadManyStep<TSpec, TData, TParams>;
|
|
46
|
+
//# sourceMappingURL=loadMany.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList, PromiseOrDirect } from "../interfaces.js";
|
|
2
|
+
import { ExecutableStep } from "../step.js";
|
|
3
|
+
export interface LoadOneOptions<TData, TParams extends Record<string, any>> {
|
|
4
|
+
attributes: ReadonlyArray<keyof TData> | null;
|
|
5
|
+
params: Partial<TParams>;
|
|
6
|
+
}
|
|
7
|
+
export declare type LoadOneCallback<TSpec, TData, TParams extends Record<string, any>> = {
|
|
8
|
+
(specs: ReadonlyArray<TSpec>, options: LoadOneOptions<TData, TParams>): PromiseOrDirect<ReadonlyArray<TData>>;
|
|
9
|
+
displayName?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function loadOneCallback<TSpec, TData, TParams extends Record<string, any>>(callback: LoadOneCallback<TSpec, TData, TParams>): LoadOneCallback<TSpec, TData, TParams>;
|
|
12
|
+
export declare class LoadOneStep<TSpec, TData, TParams extends Record<string, any>> extends ExecutableStep {
|
|
13
|
+
private load;
|
|
14
|
+
static $$export: {
|
|
15
|
+
moduleName: string;
|
|
16
|
+
exportName: string;
|
|
17
|
+
};
|
|
18
|
+
loadOptions: LoadOneOptions<TData, TParams> | null;
|
|
19
|
+
loadOptionsKey: string;
|
|
20
|
+
attributes: Set<keyof TData>;
|
|
21
|
+
params: Partial<TParams>;
|
|
22
|
+
constructor($spec: ExecutableStep<TSpec>, load: LoadOneCallback<TSpec, TData, TParams>);
|
|
23
|
+
toStringMeta(): string;
|
|
24
|
+
get(attr: keyof TData & (string | number)): import("./access.js").AccessStep<unknown>;
|
|
25
|
+
setParam<TParamKey extends keyof TParams>(paramKey: TParamKey, value: TParams[TParamKey]): void;
|
|
26
|
+
finalize(): void;
|
|
27
|
+
execute([specs]: [GrafastValuesList<TSpec>], extra: ExecutionExtra): PromiseOrDirect<GrafastResultsList<TData>>;
|
|
28
|
+
}
|
|
29
|
+
export declare function loadOne<TSpec, TData, TParams extends Record<string, any>>($spec: ExecutableStep<TSpec>, load: LoadOneCallback<TSpec, TData, TParams>): LoadOneStep<TSpec, TData, TParams>;
|
|
30
|
+
//# sourceMappingURL=loadOne.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
2
|
+
import type { ExecutableStep } from "../step.js";
|
|
3
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
+
export declare type ActualKeyByDesiredKey = {
|
|
5
|
+
[desiredKey: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function makeMapper(actualKeyByDesiredKey: ActualKeyByDesiredKey): any;
|
|
8
|
+
export declare class MapStep extends UnbatchedExecutableStep {
|
|
9
|
+
private actualKeyByDesiredKey;
|
|
10
|
+
static $$export: {
|
|
11
|
+
moduleName: string;
|
|
12
|
+
exportName: string;
|
|
13
|
+
};
|
|
14
|
+
isSyncAndSafe: boolean;
|
|
15
|
+
allowMultipleOptimizations: boolean;
|
|
16
|
+
private mapper;
|
|
17
|
+
constructor($plan: ExecutableStep, actualKeyByDesiredKey: ActualKeyByDesiredKey);
|
|
18
|
+
toStringMeta(): string;
|
|
19
|
+
execute(values: GrafastValuesList<any[]>): GrafastResultsList<any>;
|
|
20
|
+
unbatchedExecute(extra: ExecutionExtra, value: any): any;
|
|
21
|
+
deduplicate(peers: MapStep[]): MapStep[];
|
|
22
|
+
}
|
|
23
|
+
export declare function map($step: ExecutableStep, actualKeyByDesiredKey: {
|
|
24
|
+
[desiredKey: string]: string;
|
|
25
|
+
}): MapStep;
|
|
26
|
+
//# sourceMappingURL=map.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { GraphQLObjectType } from "graphql";
|
|
2
|
+
import type { ExecutionExtra, NodeIdCodec, NodeIdHandler, PolymorphicData } from "../interfaces.js";
|
|
3
|
+
import type { ExecutableStep, PolymorphicStep } from "../step.js";
|
|
4
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
5
|
+
export declare class NodeStep<TCodecs extends {
|
|
6
|
+
[key: string]: NodeIdCodec<any>;
|
|
7
|
+
}> extends UnbatchedExecutableStep implements PolymorphicStep {
|
|
8
|
+
private codecs;
|
|
9
|
+
private possibleTypes;
|
|
10
|
+
static $$export: {
|
|
11
|
+
moduleName: string;
|
|
12
|
+
exportName: string;
|
|
13
|
+
};
|
|
14
|
+
isSyncAndSafe: boolean;
|
|
15
|
+
allowMultipleOptimizations: boolean;
|
|
16
|
+
private specPlanDep;
|
|
17
|
+
constructor(codecs: TCodecs, possibleTypes: {
|
|
18
|
+
[typeName: string]: NodeIdHandler<TCodecs>;
|
|
19
|
+
}, $id: ExecutableStep<string>);
|
|
20
|
+
planForType(type: GraphQLObjectType): ExecutableStep;
|
|
21
|
+
private getTypeNameFromSpecifier;
|
|
22
|
+
unbatchedExecute: (extra: ExecutionExtra, specifier: any) => PolymorphicData<string, ReadonlyArray<any>> | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function node<TCodecs extends {
|
|
25
|
+
[key: string]: NodeIdCodec<any>;
|
|
26
|
+
}>(codecs: TCodecs, possibleTypes: {
|
|
27
|
+
[typeName: string]: NodeIdHandler<TCodecs>;
|
|
28
|
+
}, $id: ExecutableStep<string>): NodeStep<TCodecs>;
|
|
29
|
+
export declare function specFromNodeId(codec: NodeIdCodec<any>, handler: NodeIdHandler<any>, $id: ExecutableStep<string>): any;
|
|
30
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ExecutionExtra } from "../interfaces.js";
|
|
2
|
+
import type { ExecutableStep } from "../step.js";
|
|
3
|
+
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
+
import type { SetterCapableStep } from "./setter.js";
|
|
5
|
+
declare type DataFromStep<TStep extends ExecutableStep<any>> = TStep extends ExecutableStep<infer TData> ? TData : never;
|
|
6
|
+
declare type DataFromPlans<TPlans extends {
|
|
7
|
+
[key: string]: ExecutableStep<any>;
|
|
8
|
+
}> = {
|
|
9
|
+
[key in keyof TPlans]: DataFromStep<TPlans[key]>;
|
|
10
|
+
};
|
|
11
|
+
declare type Results<TPlans extends {
|
|
12
|
+
[key: string]: ExecutableStep<any>;
|
|
13
|
+
}> = Array<[
|
|
14
|
+
Array<DataFromPlans<TPlans>[keyof TPlans]>,
|
|
15
|
+
DataFromPlans<TPlans>
|
|
16
|
+
]>;
|
|
17
|
+
export interface ObjectPlanMeta<TPlans extends {
|
|
18
|
+
[key: string]: ExecutableStep<any>;
|
|
19
|
+
}> {
|
|
20
|
+
results: Results<TPlans>;
|
|
21
|
+
}
|
|
22
|
+
export declare class ObjectStep<TPlans extends {
|
|
23
|
+
[key: string]: ExecutableStep<any>;
|
|
24
|
+
} = {
|
|
25
|
+
[key: string]: ExecutableStep<any>;
|
|
26
|
+
}> extends UnbatchedExecutableStep<DataFromPlans<TPlans>> implements SetterCapableStep<TPlans> {
|
|
27
|
+
static $$export: {
|
|
28
|
+
moduleName: string;
|
|
29
|
+
exportName: string;
|
|
30
|
+
};
|
|
31
|
+
isSyncAndSafe: boolean;
|
|
32
|
+
allowMultipleOptimizations: boolean;
|
|
33
|
+
private keys;
|
|
34
|
+
constructor(obj: TPlans);
|
|
35
|
+
set<TKey extends keyof TPlans>(key: TKey, plan: TPlans[TKey]): void;
|
|
36
|
+
getStepForKey<TKey extends keyof TPlans>(key: TKey, allowMissing?: boolean): TKey extends keyof TPlans ? TPlans[TKey] : null;
|
|
37
|
+
toStringMeta(): string;
|
|
38
|
+
tupleToObjectJIT(): (extra: ExecutionExtra, ...tuple: Array<DataFromPlans<TPlans>[keyof TPlans]>) => DataFromPlans<TPlans>;
|
|
39
|
+
finalize(): void;
|
|
40
|
+
execute(values: Array<Array<DataFromPlans<TPlans>[keyof TPlans]>>, extra: ExecutionExtra): Array<DataFromPlans<TPlans>>;
|
|
41
|
+
unbatchedExecute(_extra: ExecutionExtra, ..._values: any[]): any;
|
|
42
|
+
deduplicate(peers: ObjectStep<any>[]): ObjectStep<TPlans>[];
|
|
43
|
+
get<TKey extends keyof TPlans>(key: TKey): TPlans[TKey];
|
|
44
|
+
}
|
|
45
|
+
export declare function object<TPlans extends {
|
|
46
|
+
[key: string]: ExecutableStep<any>;
|
|
47
|
+
}>(obj: TPlans): ObjectStep<TPlans>;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=object.d.ts.map
|