grafast 0.0.1-0.2 → 0.0.1-0.21
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/LICENSES.txt +27 -0
- package/dist/args.d.ts +1 -1
- package/dist/config.d.ts +12 -2
- package/dist/constraints.d.ts +1 -1
- package/dist/engine/LayerPlan.d.ts +6 -4
- package/dist/engine/OperationPlan.d.ts +2 -4
- package/dist/engine/OutputPlan.d.ts +12 -12
- package/dist/engine/executeOutputPlan.d.ts +2 -2
- package/dist/envelop.js +54 -1
- package/dist/error.d.ts +9 -0
- package/dist/establishOperationPlan.d.ts +19 -3
- package/dist/execute.d.ts +2 -2
- package/dist/grafastGraphql.d.ts +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +8 -13
- package/dist/input.d.ts +1 -1
- package/dist/interfaces.d.ts +48 -44
- package/dist/makeGrafastSchema.d.ts +7 -7
- package/dist/polymorphic.d.ts +1 -1
- package/dist/prepare.d.ts +9 -2
- package/dist/step.d.ts +3 -3
- package/dist/steps/connection.d.ts +1 -1
- package/dist/steps/filter.d.ts +1 -1
- package/dist/steps/graphqlResolver.d.ts +12 -18
- package/dist/steps/groupBy.d.ts +1 -1
- package/dist/steps/index.d.ts +2 -3
- package/dist/steps/lambda.d.ts +4 -4
- package/dist/steps/list.d.ts +1 -1
- package/dist/steps/listTransform.d.ts +2 -2
- package/dist/steps/listen.d.ts +2 -2
- package/dist/steps/loadMany.d.ts +4 -3
- package/dist/steps/loadOne.d.ts +1 -1
- package/dist/steps/map.d.ts +1 -1
- package/dist/steps/node.d.ts +0 -1
- package/dist/steps/object.d.ts +3 -3
- package/dist/steps/proxy.d.ts +6 -0
- package/dist/stringifyPayload.d.ts +1 -1
- package/dist/subscribe.d.ts +1 -1
- package/dist/utils.d.ts +21 -17
- package/package.json +10 -4
package/dist/input.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { __InputDynamicScalarStep } from "./steps/__inputDynamicScalar.js";
|
|
|
4
4
|
import { __InputObjectStep } from "./steps/__inputObject.js";
|
|
5
5
|
import type { ConstantStep } from "./steps/index.js";
|
|
6
6
|
import { __InputListStep, __InputStaticLeafStep, __TrackedObjectStep } from "./steps/index.js";
|
|
7
|
-
export
|
|
7
|
+
export type InputStep = __TrackedObjectStep | __InputListStep | __InputStaticLeafStep | __InputDynamicScalarStep | __InputObjectStep | ConstantStep<undefined>;
|
|
8
8
|
export declare function assertInputStep(itemPlan: unknown): asserts itemPlan is InputStep;
|
|
9
9
|
export declare function graphqlGetTypeForNode(operationPlan: OperationPlan, node: NamedTypeNode | ListTypeNode | NonNullTypeNode): GraphQLType;
|
|
10
10
|
export declare function inputPlan(operationPlan: OperationPlan, inputType: GraphQLInputType, seenTypes: Set<GraphQLInputType>, rawInputValue: ValueNode | undefined, defaultValue?: ValueNode | undefined): InputStep;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -2,26 +2,29 @@ import type EventEmitter from "eventemitter3";
|
|
|
2
2
|
import type { PluginHook } from "graphile-config";
|
|
3
3
|
import type { ASTNode, ExecutionArgs, GraphQLArgument, GraphQLArgumentConfig, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLList, GraphQLNonNull, GraphQLOutputType, GraphQLScalarType, GraphQLSchema, GraphQLType } from "graphql";
|
|
4
4
|
import type { Bucket, RequestContext } from "./bucket.js";
|
|
5
|
-
import type { GrafastError } from "./error.js";
|
|
6
5
|
import type { InputStep } from "./input.js";
|
|
7
6
|
import type { ExecutableStep, ListCapableStep, ModifierStep } from "./step.js";
|
|
8
7
|
import type { GraphileInputObjectType, GraphileObjectType } from "./utils.js";
|
|
9
|
-
|
|
8
|
+
type PromiseOrValue<T> = T | Promise<T>;
|
|
10
9
|
export interface GrafastOptions {
|
|
11
|
-
context?: Record<string, any> | (<TContext extends Record<string, any>>(ctx:
|
|
10
|
+
context?: Record<string, any> | (<TContext extends Record<string, any>>(ctx: Partial<Grafast.RequestContext>, currentContext?: Partial<TContext>) => PromiseOrValue<Partial<TContext>>);
|
|
12
11
|
explain?: boolean | string[];
|
|
13
12
|
}
|
|
14
13
|
declare global {
|
|
15
|
-
namespace
|
|
16
|
-
interface
|
|
14
|
+
namespace Grafast {
|
|
15
|
+
interface RequestContext {
|
|
16
|
+
}
|
|
17
|
+
interface Context {
|
|
17
18
|
}
|
|
19
|
+
}
|
|
20
|
+
namespace GraphileConfig {
|
|
18
21
|
interface Preset {
|
|
19
22
|
grafast?: GrafastOptions;
|
|
20
23
|
}
|
|
21
24
|
interface GrafastHooks {
|
|
22
25
|
args: PluginHook<(event: {
|
|
23
26
|
args: ExecutionArgs;
|
|
24
|
-
ctx:
|
|
27
|
+
ctx: Grafast.RequestContext;
|
|
25
28
|
resolvedPreset: GraphileConfig.ResolvedPreset;
|
|
26
29
|
}) => PromiseOrValue<ExecutionArgs>>;
|
|
27
30
|
}
|
|
@@ -50,6 +53,7 @@ export interface GrafastInputFieldExtensions {
|
|
|
50
53
|
export interface GrafastObjectTypeExtensions {
|
|
51
54
|
Step?: {
|
|
52
55
|
new (...args: any[]): ExecutableStep;
|
|
56
|
+
displayName?: string;
|
|
53
57
|
};
|
|
54
58
|
}
|
|
55
59
|
export interface GrafastEnumTypeExtensions {
|
|
@@ -100,6 +104,7 @@ export declare const $$idempotent: unique symbol;
|
|
|
100
104
|
export declare const $$eventEmitter: unique symbol;
|
|
101
105
|
export declare const $$streamMore: unique symbol;
|
|
102
106
|
export declare const $$proxy: unique symbol;
|
|
107
|
+
export declare const $$safeError: unique symbol;
|
|
103
108
|
export interface PolymorphicData<TType extends string = string, TData = any> {
|
|
104
109
|
[$$concreteType]: TType;
|
|
105
110
|
[$$data]?: TData;
|
|
@@ -107,84 +112,83 @@ export interface PolymorphicData<TType extends string = string, TData = any> {
|
|
|
107
112
|
export interface IndexByListItemStepId {
|
|
108
113
|
[listItemStepId: number]: number;
|
|
109
114
|
}
|
|
110
|
-
export
|
|
111
|
-
export
|
|
112
|
-
export
|
|
113
|
-
export
|
|
114
|
-
export
|
|
115
|
-
export interface BaseGraphQLContext {
|
|
116
|
-
}
|
|
115
|
+
export type GrafastValuesList<T> = ReadonlyArray<T>;
|
|
116
|
+
export type PromiseOrDirect<T> = PromiseLike<T> | T;
|
|
117
|
+
export type GrafastResultsList<T> = ReadonlyArray<PromiseOrDirect<T>>;
|
|
118
|
+
export type GrafastResultStreamList<T> = ReadonlyArray<PromiseOrDirect<AsyncIterable<PromiseOrDirect<T>>> | PromiseLike<never>>;
|
|
119
|
+
export type BaseGraphQLRootValue = any;
|
|
117
120
|
export interface BaseGraphQLVariables {
|
|
118
121
|
[key: string]: unknown;
|
|
119
122
|
}
|
|
120
123
|
export interface BaseGraphQLArguments {
|
|
121
124
|
[key: string]: any;
|
|
122
125
|
}
|
|
123
|
-
export
|
|
126
|
+
export type BaseGraphQLInputObject = BaseGraphQLArguments;
|
|
127
|
+
export type TargetStepOrCallback = ExecutableStep | ModifierStep | ((indexOrFieldName: number | string) => TargetStepOrCallback);
|
|
124
128
|
export interface FieldArgs {
|
|
125
129
|
get(path?: string | string[]): ExecutableStep;
|
|
126
130
|
getRaw(path?: string | string[]): InputStep;
|
|
127
|
-
apply($target:
|
|
131
|
+
apply($target: TargetStepOrCallback, path?: string | string[]): void;
|
|
128
132
|
}
|
|
129
133
|
export interface FieldInfo {
|
|
130
134
|
field: GraphQLField<any, any, any>;
|
|
131
135
|
schema: GraphQLSchema;
|
|
132
136
|
}
|
|
133
|
-
export
|
|
134
|
-
export
|
|
137
|
+
export type FieldPlanResolver<_TArgs extends BaseGraphQLArguments, TParentStep extends ExecutableStep<any> | null, TResultStep extends ExecutableStep<any>> = ($parentPlan: TParentStep, args: FieldArgs, info: FieldInfo) => TResultStep | null;
|
|
138
|
+
export type InputObjectFieldInputPlanResolver<TResultStep extends ExecutableStep<any> = ExecutableStep<any>> = (input: FieldArgs, info: {
|
|
135
139
|
schema: GraphQLSchema;
|
|
136
140
|
entity: GraphQLInputField;
|
|
137
141
|
}) => TResultStep;
|
|
138
|
-
export
|
|
142
|
+
export type InputObjectFieldApplyPlanResolver<TFieldStep extends ExecutableStep<any> | ModifierStep<any> = ExecutableStep<any> | ModifierStep<any>, TResultStep extends ModifierStep<ExecutableStep<any> | ModifierStep<any>> | null | void = ModifierStep<ExecutableStep<any> | ModifierStep<any>> | null | void> = ($fieldPlan: TFieldStep, input: FieldArgs, info: {
|
|
139
143
|
schema: GraphQLSchema;
|
|
140
144
|
entity: GraphQLInputField;
|
|
141
145
|
}) => TResultStep;
|
|
142
|
-
export
|
|
146
|
+
export type InputObjectTypeInputPlanResolver = (input: FieldArgs, info: {
|
|
143
147
|
schema: GraphQLSchema;
|
|
144
148
|
type: GraphQLInputObjectType;
|
|
145
149
|
}) => ExecutableStep;
|
|
146
|
-
export
|
|
150
|
+
export type ArgumentInputPlanResolver<TParentStep extends ExecutableStep<any> = ExecutableStep<any>, TResultStep extends ExecutableStep<any> = ExecutableStep<any>> = ($parentPlan: TParentStep, input: FieldArgs, info: {
|
|
147
151
|
schema: GraphQLSchema;
|
|
148
152
|
entity: GraphQLArgument;
|
|
149
153
|
}) => TResultStep;
|
|
150
|
-
export
|
|
154
|
+
export type ArgumentApplyPlanResolver<TParentStep extends ExecutableStep<any> = ExecutableStep<any>, TFieldStep extends ExecutableStep<any> | ModifierStep<any> = ExecutableStep<any> | ModifierStep<any>, TResultStep extends ExecutableStep | ModifierStep<ExecutableStep | ModifierStep> | null | void = ExecutableStep | ModifierStep<ExecutableStep | ModifierStep> | null | void> = ($parentPlan: TParentStep, $fieldPlan: TFieldStep, input: FieldArgs, info: {
|
|
151
155
|
schema: GraphQLSchema;
|
|
152
156
|
entity: GraphQLArgument;
|
|
153
157
|
}) => TResultStep;
|
|
154
|
-
export
|
|
158
|
+
export type ScalarPlanResolver<TParentStep extends ExecutableStep<any> = ExecutableStep<any>, TResultStep extends ExecutableStep<any> = ExecutableStep<any>> = ($parentPlan: TParentStep, info: {
|
|
155
159
|
schema: GraphQLSchema;
|
|
156
160
|
}) => TResultStep;
|
|
157
|
-
export
|
|
161
|
+
export type ScalarInputPlanResolver<TResultStep extends ExecutableStep<any> = ExecutableStep<any>> = ($inputValue: InputStep, info: {
|
|
158
162
|
schema: GraphQLSchema;
|
|
159
163
|
type: GraphQLScalarType;
|
|
160
164
|
}) => TResultStep;
|
|
161
|
-
export
|
|
162
|
-
|
|
163
|
-
export
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
export
|
|
165
|
+
export type EnumValueApplyPlanResolver<TParentStep extends ExecutableStep | ModifierStep = ExecutableStep | ModifierStep> = ($parent: TParentStep) => ModifierStep | void;
|
|
166
|
+
type OutputPlanForNamedType<TType extends GraphQLType> = TType extends GraphileObjectType<any, infer TStep, any> ? TStep : ExecutableStep<any>;
|
|
167
|
+
export type OutputPlanForType<TType extends GraphQLOutputType> = TType extends GraphQLNonNull<GraphQLList<GraphQLNonNull<infer U>>> ? ListCapableStep<any, OutputPlanForNamedType<U>> : TType extends GraphQLNonNull<GraphQLList<infer U>> ? ListCapableStep<any, OutputPlanForNamedType<U>> : TType extends GraphQLList<GraphQLNonNull<infer U>> ? ListCapableStep<any, OutputPlanForNamedType<U>> : TType extends GraphQLList<infer U> ? ListCapableStep<any, OutputPlanForNamedType<U>> : TType extends GraphQLNonNull<infer U> ? OutputPlanForNamedType<U> : OutputPlanForNamedType<TType>;
|
|
168
|
+
type InputPlanForNamedType<TType extends GraphQLType> = TType extends GraphileInputObjectType<any, infer U, any> ? U : ModifierStep<any>;
|
|
169
|
+
type InputPlanForType<TType extends GraphQLInputType> = TType extends GraphQLNonNull<GraphQLList<GraphQLNonNull<infer U>>> ? InputPlanForNamedType<U> : TType extends GraphQLNonNull<GraphQLList<infer U>> ? InputPlanForNamedType<U> : TType extends GraphQLList<GraphQLNonNull<infer U>> ? InputPlanForNamedType<U> : TType extends GraphQLList<infer U> ? InputPlanForNamedType<U> : TType extends GraphQLNonNull<infer U> ? InputPlanForNamedType<U> : InputPlanForNamedType<TType>;
|
|
170
|
+
type InputTypeForNamedType<TType extends GraphQLType> = TType extends GraphQLScalarType<infer U> ? U : any;
|
|
171
|
+
type InputTypeFor<TType extends GraphQLInputType> = TType extends GraphQLNonNull<GraphQLList<GraphQLNonNull<infer U>>> ? InputTypeForNamedType<U> : TType extends GraphQLNonNull<GraphQLList<infer U>> ? InputTypeForNamedType<U> : TType extends GraphQLList<GraphQLNonNull<infer U>> ? InputTypeForNamedType<U> : TType extends GraphQLList<infer U> ? InputTypeForNamedType<U> : TType extends GraphQLNonNull<infer U> ? InputTypeForNamedType<U> : InputTypeForNamedType<TType>;
|
|
172
|
+
export type GraphileFieldConfig<TType extends GraphQLOutputType, TContext extends Grafast.Context, TParentStep extends ExecutableStep<any> | null, TFieldStep extends ExecutableStep<any>, TArgs extends BaseGraphQLArguments> = Omit<GraphQLFieldConfig<any, any>, "args" | "type"> & {
|
|
169
173
|
type: TType;
|
|
170
174
|
plan?: FieldPlanResolver<TArgs, TParentStep, TFieldStep>;
|
|
171
175
|
subscribePlan?: FieldPlanResolver<TArgs, TParentStep, TFieldStep>;
|
|
172
176
|
args?: GraphileFieldConfigArgumentMap<TType, TContext, TParentStep, TFieldStep>;
|
|
173
177
|
};
|
|
174
|
-
export
|
|
178
|
+
export type GraphileFieldConfigArgumentMap<_TType extends GraphQLOutputType, TContext extends Grafast.Context, TParentStep extends ExecutableStep<any> | null, TFieldStep extends ExecutableStep<any>> = {
|
|
175
179
|
[argName: string]: GraphileArgumentConfig<any, TContext, TParentStep, TFieldStep, any, any>;
|
|
176
180
|
};
|
|
177
|
-
export
|
|
181
|
+
export type GraphileArgumentConfig<TInputType extends GraphQLInputType, _TContext extends Grafast.Context, _TParentStep extends ExecutableStep<any> | null, TFieldStep extends ExecutableStep<any>, _TArgumentStep extends TFieldStep extends ExecutableStep<any> ? ModifierStep<TFieldStep> | null : null, _TInput extends InputTypeFor<TInputType>> = Omit<GraphQLArgumentConfig, "type"> & {
|
|
178
182
|
type: TInputType;
|
|
179
183
|
inputPlan?: ArgumentInputPlanResolver<any>;
|
|
180
184
|
applyPlan?: ArgumentApplyPlanResolver<any, any>;
|
|
181
185
|
};
|
|
182
|
-
export
|
|
186
|
+
export type GraphileInputFieldConfig<TInputType extends GraphQLInputType, _TContext extends Grafast.Context, _TParentStep extends ModifierStep<any>, _TResultStep extends InputPlanForType<TInputType>, _TInput extends InputTypeFor<TInputType>> = Omit<GraphQLInputFieldConfig, "type"> & {
|
|
183
187
|
type: TInputType;
|
|
184
188
|
inputPlan?: InputObjectFieldInputPlanResolver;
|
|
185
189
|
applyPlan?: InputObjectFieldApplyPlanResolver<any>;
|
|
186
190
|
};
|
|
187
|
-
export
|
|
191
|
+
export type TrackedArguments<TArgs extends BaseGraphQLArguments = BaseGraphQLArguments> = {
|
|
188
192
|
get<TKey extends keyof TArgs>(key: TKey): InputStep;
|
|
189
193
|
};
|
|
190
194
|
export interface StepStreamOptions {
|
|
@@ -196,18 +200,18 @@ export interface StepOptions {
|
|
|
196
200
|
export interface StepOptimizeOptions {
|
|
197
201
|
stream: StepStreamOptions | null;
|
|
198
202
|
}
|
|
199
|
-
export
|
|
203
|
+
export type GrafastSubscriber<TTopics extends {
|
|
200
204
|
[key: string]: any;
|
|
201
205
|
} = {
|
|
202
206
|
[key: string]: any;
|
|
203
207
|
}> = {
|
|
204
|
-
subscribe<TTopic extends keyof TTopics = keyof TTopics>(topic: TTopic): AsyncIterableIterator<TTopics[TTopic]
|
|
208
|
+
subscribe<TTopic extends keyof TTopics = keyof TTopics>(topic: TTopic): PromiseOrDirect<AsyncIterableIterator<TTopics[TTopic]>>;
|
|
205
209
|
};
|
|
206
210
|
export interface NodeIdCodec<T = any> {
|
|
207
211
|
encode(value: T): string | null;
|
|
208
212
|
decode(value: string): T;
|
|
209
213
|
}
|
|
210
|
-
export
|
|
214
|
+
export type NodeIdHandler<TCodecs extends {
|
|
211
215
|
[key: string]: NodeIdCodec<any>;
|
|
212
216
|
} = {
|
|
213
217
|
[key: string]: NodeIdCodec<any>;
|
|
@@ -220,9 +224,9 @@ export declare type NodeIdHandler<TCodecs extends {
|
|
|
220
224
|
get(spec: TSpec): TNodeStep;
|
|
221
225
|
deprecationReason?: string;
|
|
222
226
|
};
|
|
223
|
-
export
|
|
224
|
-
export
|
|
225
|
-
export
|
|
227
|
+
export type BaseEventMap = Record<string, any>;
|
|
228
|
+
export type EventMapKey<TEventMap extends BaseEventMap> = string & keyof TEventMap;
|
|
229
|
+
export type EventCallback<TPayload> = (params: TPayload) => void;
|
|
226
230
|
export interface TypedEventEmitter<TEventMap extends BaseEventMap> extends EventEmitter<any, any> {
|
|
227
231
|
addListener<TEventName extends EventMapKey<TEventMap>>(eventName: TEventName, callback: EventCallback<TEventMap[TEventName]>): this;
|
|
228
232
|
on<TEventName extends EventMapKey<TEventMap>>(eventName: TEventName, callback: EventCallback<TEventMap[TEventName]>): this;
|
|
@@ -231,7 +235,7 @@ export interface TypedEventEmitter<TEventMap extends BaseEventMap> extends Event
|
|
|
231
235
|
off<TEventName extends EventMapKey<TEventMap>>(eventName: TEventName, callback: EventCallback<TEventMap[TEventName]>): this;
|
|
232
236
|
emit<TEventName extends EventMapKey<TEventMap>>(eventName: TEventName, params: TEventMap[TEventName]): boolean;
|
|
233
237
|
}
|
|
234
|
-
export
|
|
238
|
+
export type ExecutionEventMap = {
|
|
235
239
|
explainOperation: {
|
|
236
240
|
operation: Record<string, any> & {
|
|
237
241
|
type: string;
|
|
@@ -239,7 +243,7 @@ export declare type ExecutionEventMap = {
|
|
|
239
243
|
};
|
|
240
244
|
};
|
|
241
245
|
};
|
|
242
|
-
export
|
|
246
|
+
export type ExecutionEventEmitter = TypedEventEmitter<ExecutionEventMap>;
|
|
243
247
|
export interface ExecutionExtra {
|
|
244
248
|
meta: Record<string, unknown>;
|
|
245
249
|
eventEmitter: ExecutionEventEmitter | undefined;
|
|
@@ -251,7 +255,7 @@ export interface LocationDetails {
|
|
|
251
255
|
parentTypeName: string | null;
|
|
252
256
|
fieldName: string | null;
|
|
253
257
|
}
|
|
254
|
-
export
|
|
258
|
+
export type JSONValue = boolean | number | string | null | JSONObject | JSONArray;
|
|
255
259
|
export interface JSONObject {
|
|
256
260
|
[key: string]: JSONValue;
|
|
257
261
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GraphQLFieldResolver, GraphQLScalarLiteralParser, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLSchema } from "graphql";
|
|
2
2
|
import type { ArgumentApplyPlanResolver, ArgumentInputPlanResolver, EnumValueApplyPlanResolver, FieldPlanResolver, InputObjectFieldApplyPlanResolver, InputObjectFieldInputPlanResolver, ScalarPlanResolver } from "./interfaces.js";
|
|
3
3
|
import type { ExecutableStep } from "./step.js";
|
|
4
|
-
export
|
|
4
|
+
export type FieldPlans = FieldPlanResolver<any, any, any> | {
|
|
5
5
|
plan?: FieldPlanResolver<any, any, any>;
|
|
6
6
|
subscribePlan?: FieldPlanResolver<any, any, any>;
|
|
7
7
|
resolve?: GraphQLFieldResolver<any, any>;
|
|
@@ -13,29 +13,29 @@ export declare type FieldPlans = FieldPlanResolver<any, any, any> | {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type ObjectPlans = {
|
|
17
17
|
__Step?: {
|
|
18
18
|
new (...args: any[]): ExecutableStep<any>;
|
|
19
19
|
};
|
|
20
20
|
} & {
|
|
21
21
|
[fieldName: string]: FieldPlans;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type InputObjectPlans = {
|
|
24
24
|
[fieldName: string]: {
|
|
25
25
|
input: InputObjectFieldInputPlanResolver;
|
|
26
26
|
apply: InputObjectFieldApplyPlanResolver;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type InterfaceOrUnionPlans = {
|
|
30
30
|
__resolveType?: (o: unknown) => string;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type ScalarPlans = {
|
|
33
33
|
serialize?: GraphQLScalarSerializer<any>;
|
|
34
34
|
parseValue?: GraphQLScalarValueParser<any>;
|
|
35
35
|
parseLiteral?: GraphQLScalarLiteralParser<any>;
|
|
36
36
|
plan?: ScalarPlanResolver<any, any>;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type EnumPlans = {
|
|
39
39
|
[enumValueName: string]: EnumValueApplyPlanResolver | string | number | boolean | {
|
|
40
40
|
value?: unknown;
|
|
41
41
|
apply?: EnumValueApplyPlanResolver;
|
|
@@ -47,6 +47,6 @@ export interface GrafastPlans {
|
|
|
47
47
|
export declare function makeGrafastSchema(details: {
|
|
48
48
|
typeDefs: string;
|
|
49
49
|
plans: GrafastPlans;
|
|
50
|
-
enableDeferStream
|
|
50
|
+
enableDeferStream?: boolean;
|
|
51
51
|
}): GraphQLSchema;
|
|
52
52
|
//# sourceMappingURL=makeGrafastSchema.d.ts.map
|
package/dist/polymorphic.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PolymorphicData } from "./interfaces.js";
|
|
2
2
|
export declare function isPolymorphicData(data: unknown): data is PolymorphicData;
|
|
3
3
|
export declare function assertPolymorphicData(data: unknown): asserts data is PolymorphicData;
|
|
4
|
-
export declare function polymorphicWrap<TType extends string>(type: TType, data?:
|
|
4
|
+
export declare function polymorphicWrap<TType extends string, TData>(type: TType, data?: TData): PolymorphicData<TType, TData>;
|
|
5
5
|
export declare function resolveType(o: unknown): string;
|
|
6
6
|
//# sourceMappingURL=polymorphic.d.ts.map
|
package/dist/prepare.d.ts
CHANGED
|
@@ -2,10 +2,17 @@ import type { ExecutionArgs } from "graphql";
|
|
|
2
2
|
import type { AsyncExecutionResult, ExecutionResult } from "graphql/execution/execute";
|
|
3
3
|
import type { OperationPlan } from "./index.js";
|
|
4
4
|
import type { PromiseOrDirect } from "./interfaces.js";
|
|
5
|
+
declare const $$contextPlanCache: unique symbol;
|
|
5
6
|
export interface GrafastPrepareOptions {
|
|
6
7
|
explain?: boolean | string[];
|
|
7
|
-
|
|
8
|
+
outputDataAsString?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function executePreemptive(operationPlan: OperationPlan, variableValues: any, context: any, rootValue: any, outputDataAsString: boolean): PromiseOrDirect<ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, void>>;
|
|
11
|
+
declare module "./engine/OperationPlan.js" {
|
|
12
|
+
interface OperationPlan {
|
|
13
|
+
[$$contextPlanCache]?: string;
|
|
14
|
+
}
|
|
8
15
|
}
|
|
9
|
-
export declare function executePreemptive(operationPlan: OperationPlan, variableValues: any, context: any, rootValue: any, asString: boolean): PromiseOrDirect<ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, void>>;
|
|
10
16
|
export declare function grafastPrepare(args: ExecutionArgs, options?: GrafastPrepareOptions): PromiseOrDirect<ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, void>>;
|
|
17
|
+
export {};
|
|
11
18
|
//# sourceMappingURL=prepare.d.ts.map
|
package/dist/step.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare abstract class UnbatchedExecutableStep<TData = any> extends Execu
|
|
|
61
61
|
export declare function isExecutableStep<TData = any>(step: unknown): step is ExecutableStep<TData>;
|
|
62
62
|
export declare function assertExecutableStep<TData>(step: BaseStep): asserts step is ExecutableStep<TData>;
|
|
63
63
|
export declare function isUnbatchedExecutableStep<TData = any>(step: unknown): step is UnbatchedExecutableStep<TData>;
|
|
64
|
-
export
|
|
64
|
+
export type ObjectLikeStep<TData extends {
|
|
65
65
|
[key: string]: ExecutableStep<any>;
|
|
66
66
|
} = {
|
|
67
67
|
[key: string]: ExecutableStep<any>;
|
|
@@ -75,13 +75,13 @@ export declare function isObjectLikeStep<TData extends {
|
|
|
75
75
|
} = {
|
|
76
76
|
[key: string]: ExecutableStep<any>;
|
|
77
77
|
}>(plan: ExecutableStep): plan is ObjectLikeStep<TData>;
|
|
78
|
-
export
|
|
78
|
+
export type StreamableStep<TData> = ExecutableStep<ReadonlyArray<TData>> & {
|
|
79
79
|
stream(values: ReadonlyArray<GrafastValuesList<any>>, extra: ExecutionExtra, streamOptions: {
|
|
80
80
|
initialCount: number;
|
|
81
81
|
}): PromiseOrDirect<GrafastResultStreamList<TData>>;
|
|
82
82
|
};
|
|
83
83
|
export declare function isStreamableStep<TData>(plan: ExecutableStep<ReadonlyArray<TData>>): plan is StreamableStep<TData>;
|
|
84
|
-
export
|
|
84
|
+
export type PolymorphicStep = ExecutableStep & {
|
|
85
85
|
planForType(objectType: GraphQLObjectType): ExecutableStep;
|
|
86
86
|
};
|
|
87
87
|
export declare function isPolymorphicStep(s: ExecutableStep): s is PolymorphicStep;
|
|
@@ -2,7 +2,7 @@ import type { InputStep } from "../input.js";
|
|
|
2
2
|
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
3
3
|
import type { ExecutableStep } from "../step.js";
|
|
4
4
|
import { UnbatchedExecutableStep } from "../step.js";
|
|
5
|
-
|
|
5
|
+
type ParametersExceptFirst<F> = F extends (arg0: any, ...rest: infer R) => any ? R : never[];
|
|
6
6
|
export interface PageInfoCapableStep extends ExecutableStep<any> {
|
|
7
7
|
hasNextPage(): ExecutableStep<boolean>;
|
|
8
8
|
hasPreviousPage(): ExecutableStep<boolean>;
|
package/dist/steps/filter.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExecutableStep, ListCapableStep } from "../step.js";
|
|
2
2
|
import type { __ItemStep } from "./__item.js";
|
|
3
3
|
import type { __ListTransformStep, ListTransformItemPlanCallback } from "./listTransform.js";
|
|
4
|
-
export
|
|
4
|
+
export type FilterPlanMemo = unknown[];
|
|
5
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
6
|
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { GraphQLFieldResolver, GraphQLNullableType, GraphQLOutputType, GraphQLResolveInfo } from "graphql";
|
|
2
2
|
import type { __ItemStep, ObjectStep } from "../index.js";
|
|
3
|
-
import type { ExecutionExtra, GrafastResultsList,
|
|
3
|
+
import type { ExecutionExtra, GrafastResultsList, GrafastResultStreamList, GrafastValuesList } from "../interfaces.js";
|
|
4
4
|
import type { PolymorphicStep } from "../step.js";
|
|
5
5
|
import { ExecutableStep, UnbatchedExecutableStep } from "../step.js";
|
|
6
|
-
|
|
6
|
+
type ResolveInfoBase = Omit<GraphQLResolveInfo, "path" | "rootValue" | "variableValues">;
|
|
7
7
|
export declare class GraphQLResolverStep extends UnbatchedExecutableStep {
|
|
8
8
|
private resolver;
|
|
9
|
+
private subscriber;
|
|
9
10
|
private resolveInfoBase;
|
|
10
11
|
private returnContextAndResolveInfo;
|
|
11
12
|
static $$export: {
|
|
@@ -20,24 +21,17 @@ export declare class GraphQLResolverStep extends UnbatchedExecutableStep {
|
|
|
20
21
|
private variableValuesDep;
|
|
21
22
|
private rootValueDep;
|
|
22
23
|
private isNotRoot;
|
|
23
|
-
constructor(resolver: GraphQLFieldResolver<any, any> & {
|
|
24
|
+
constructor(resolver: (GraphQLFieldResolver<any, any> & {
|
|
24
25
|
displayName?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
26
|
+
}) | null | undefined, subscriber: (GraphQLFieldResolver<any, any> & {
|
|
27
|
+
displayName?: string;
|
|
28
|
+
}) | null | undefined, $plan: ExecutableStep, $args: ObjectStep, resolveInfoBase: ResolveInfoBase, returnContextAndResolveInfo?: boolean);
|
|
29
|
+
toStringMeta(): string | null;
|
|
27
30
|
deduplicate(peers: GraphQLResolverStep[]): GraphQLResolverStep[];
|
|
28
31
|
unbatchedExecute(extra: ExecutionExtra, source: any, args: any, context: any, variableValues: any, rootValue: any): any;
|
|
32
|
+
unbatchedStream(extra: ExecutionExtra, source: any, args: any, context: any, variableValues: any, rootValue: any): any;
|
|
33
|
+
stream(values: ReadonlyArray<GrafastValuesList<any>>, extra: ExecutionExtra): Promise<GrafastResultStreamList<any>>;
|
|
29
34
|
}
|
|
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
35
|
export declare class GraphQLItemHandler extends ExecutableStep implements PolymorphicStep {
|
|
42
36
|
static $$export: {
|
|
43
37
|
moduleName: string;
|
|
@@ -47,7 +41,7 @@ export declare class GraphQLItemHandler extends ExecutableStep implements Polymo
|
|
|
47
41
|
private nullableInnerType;
|
|
48
42
|
isSyncAndSafe: boolean;
|
|
49
43
|
constructor($parent: ExecutableStep, nullableType: GraphQLNullableType & GraphQLOutputType);
|
|
50
|
-
planForType():
|
|
44
|
+
planForType(): this;
|
|
51
45
|
listItem($item: __ItemStep<any>): GraphQLItemHandler;
|
|
52
46
|
private figureOutTheTypeOf;
|
|
53
47
|
private actuallyWrapData;
|
|
@@ -60,6 +54,6 @@ export declare class GraphQLItemHandler extends ExecutableStep implements Polymo
|
|
|
60
54
|
execute(values: [GrafastValuesList<any>]): GrafastResultsList<any>;
|
|
61
55
|
}
|
|
62
56
|
export declare function graphqlItemHandler($item: ExecutableStep, nullableType: GraphQLNullableType & GraphQLOutputType): GraphQLItemHandler;
|
|
63
|
-
export declare function graphqlResolver(resolver: GraphQLFieldResolver<any, any
|
|
57
|
+
export declare function graphqlResolver(resolver: GraphQLFieldResolver<any, any> | null | undefined, subscriber: GraphQLFieldResolver<any, any> | null | undefined, $step: ExecutableStep, $args: ObjectStep, resolveInfoBase: ResolveInfoBase): ExecutableStep;
|
|
64
58
|
export {};
|
|
65
59
|
//# sourceMappingURL=graphqlResolver.d.ts.map
|
package/dist/steps/groupBy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExecutableStep } from "../step.js";
|
|
2
2
|
import type { __ListTransformStep, ListTransformItemPlanCallback } from "./listTransform.js";
|
|
3
|
-
export
|
|
3
|
+
export type GroupByPlanMemo = Map<unknown, unknown[]>;
|
|
4
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
5
|
//# sourceMappingURL=groupBy.d.ts.map
|
package/dist/steps/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { OperationPlan } from "../index.js";
|
|
2
|
-
import type { BaseGraphQLContext } from "../interfaces.js";
|
|
3
2
|
import type { __ValueStep } from "./__value.js";
|
|
4
3
|
export declare function operationPlan(): OperationPlan;
|
|
5
|
-
export declare function context<TContext extends
|
|
4
|
+
export declare function context<TContext extends Grafast.Context = Grafast.Context>(): __ValueStep<TContext>;
|
|
6
5
|
export declare function debugPlans<T>(callback: () => T): T;
|
|
7
6
|
export { access, AccessStep } from "./access.js";
|
|
8
7
|
export { connection, ConnectionCapableStep, ConnectionStep, EdgeCapableStep, EdgeStep, PageInfoCapableStep, } from "./connection.js";
|
|
@@ -30,7 +29,7 @@ export { __ItemStep } from "./__item.js";
|
|
|
30
29
|
export { __TrackedObjectStep } from "./__trackedObject.js";
|
|
31
30
|
export { __ValueStep } from "./__value.js";
|
|
32
31
|
export { deepEval, DeepEvalStep } from "./deepEval.js";
|
|
33
|
-
export { GraphQLItemHandler, graphqlItemHandler,
|
|
32
|
+
export { GraphQLItemHandler, graphqlItemHandler, graphqlResolver, GraphQLResolverStep, } from "./graphqlResolver.js";
|
|
34
33
|
export { loadMany, LoadManyCallback, loadManyCallback, LoadManyOptions, LoadManySingleRecordStep, LoadManyStep, } from "./loadMany.js";
|
|
35
34
|
export { loadOne, LoadOneCallback, loadOneCallback, LoadOneOptions, LoadOneStep, } from "./loadOne.js";
|
|
36
35
|
export { proxy, ProxyStep } from "./proxy.js";
|
package/dist/steps/lambda.d.ts
CHANGED
|
@@ -10,14 +10,14 @@ export declare class LambdaStep<TIn, TOut> extends UnbatchedExecutableStep<TOut>
|
|
|
10
10
|
isSyncAndSafe: boolean;
|
|
11
11
|
allowMultipleOptimizations: boolean;
|
|
12
12
|
private planDep;
|
|
13
|
-
constructor($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => TOut);
|
|
13
|
+
constructor($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => PromiseOrDirect<TOut>);
|
|
14
14
|
toStringMeta(): any;
|
|
15
15
|
deduplicate(peers: LambdaStep<any, any>[]): LambdaStep<TIn, TOut>[];
|
|
16
|
-
unbatchedExecute(
|
|
16
|
+
unbatchedExecute(_extra: ExecutionExtra, value: TIn): PromiseOrDirect<TOut>;
|
|
17
17
|
}
|
|
18
18
|
declare function lambda<TIn extends [...any[]], TOut>(plans: {
|
|
19
19
|
[Index in keyof TIn]: ExecutableStep<TIn[Index]>;
|
|
20
|
-
}, fn: (value: TIn) => TOut
|
|
21
|
-
declare function lambda<TIn, TOut>($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => TOut
|
|
20
|
+
}, fn: (value: TIn) => PromiseOrDirect<TOut>, isSyncAndSafe?: boolean): LambdaStep<TIn, TOut>;
|
|
21
|
+
declare function lambda<TIn, TOut>($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => PromiseOrDirect<TOut>, isSyncAndSafe?: boolean): LambdaStep<TIn, TOut>;
|
|
22
22
|
export { lambda };
|
|
23
23
|
//# sourceMappingURL=lambda.d.ts.map
|
package/dist/steps/list.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExecutionExtra } from "../interfaces.js";
|
|
2
2
|
import type { ExecutableStep } from "../step.js";
|
|
3
3
|
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
-
|
|
4
|
+
type UnwrapPlanTuple<TPlanTuple extends readonly ExecutableStep<any>[]> = [
|
|
5
5
|
...(TPlanTuple extends readonly ExecutableStep<infer U>[] ? readonly U[] : never)
|
|
6
6
|
];
|
|
7
7
|
export declare class ListStep<TPlanTuple extends readonly ExecutableStep<any>[]> extends UnbatchedExecutableStep<UnwrapPlanTuple<TPlanTuple>> {
|
|
@@ -5,8 +5,8 @@ import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../i
|
|
|
5
5
|
import type { ListCapableStep } from "../step.js";
|
|
6
6
|
import { $$deepDepSkip, ExecutableStep } from "../step.js";
|
|
7
7
|
import { __ItemStep } from "./__item.js";
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type ListTransformReduce<TMemo, TItemPlanData> = (memo: TMemo, entireItemValue: unknown, itemPlanData: TItemPlanData) => TMemo;
|
|
9
|
+
export type ListTransformItemPlanCallback<TListStep extends ExecutableStep<readonly any[]>, TDepsStep extends ExecutableStep> = (listItemPlan: TListStep extends ListCapableStep<any, any> ? ReturnType<TListStep["listItem"]> : __ItemStep<any>) => TDepsStep;
|
|
10
10
|
export interface ListTransformOptions<TListStep extends ExecutableStep<readonly any[]>, TDepsStep extends ExecutableStep, TMemo, TItemStep extends ExecutableStep | undefined = undefined> {
|
|
11
11
|
listPlan: TListStep;
|
|
12
12
|
itemPlanCallback: ListTransformItemPlanCallback<TListStep, TDepsStep>;
|
package/dist/steps/listen.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare class ListenStep<TTopics extends {
|
|
|
13
13
|
isSyncAndSafe: boolean;
|
|
14
14
|
private pubsubDep;
|
|
15
15
|
private topicDep;
|
|
16
|
-
constructor(pubsubOrPlan: ExecutableStep<GrafastSubscriber<TTopics
|
|
16
|
+
constructor(pubsubOrPlan: ExecutableStep<GrafastSubscriber<TTopics> | null> | GrafastSubscriber<TTopics> | null, topicOrPlan: ExecutableStep<TTopic> | string, itemPlan?: (itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep);
|
|
17
17
|
execute(): never;
|
|
18
18
|
stream(values: readonly [
|
|
19
19
|
GrafastValuesList<GrafastSubscriber<TTopics>>,
|
|
@@ -22,5 +22,5 @@ export declare class ListenStep<TTopics extends {
|
|
|
22
22
|
}
|
|
23
23
|
export declare function listen<TTopics extends {
|
|
24
24
|
[topic: string]: any;
|
|
25
|
-
}, TTopic extends keyof TTopics, TPayloadStep extends ExecutableStep>(pubsubOrPlan: ExecutableStep<GrafastSubscriber<TTopics
|
|
25
|
+
}, TTopic extends keyof TTopics, TPayloadStep extends ExecutableStep>(pubsubOrPlan: ExecutableStep<GrafastSubscriber<TTopics> | null> | GrafastSubscriber<TTopics> | null, topicOrPlan: ExecutableStep<TTopic> | string, itemPlan?: (itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep): ListenStep<TTopics, TTopic, TPayloadStep>;
|
|
26
26
|
//# sourceMappingURL=listen.d.ts.map
|
package/dist/steps/loadMany.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { __ItemStep } from "../index.js";
|
|
2
2
|
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList, PromiseOrDirect } from "../interfaces.js";
|
|
3
|
+
import type { ListCapableStep } from "../step.js";
|
|
3
4
|
import { ExecutableStep } from "../step.js";
|
|
4
5
|
export interface LoadManyOptions<TData, TParams extends Record<string, any>> {
|
|
5
6
|
attributes: ReadonlyArray<keyof TData> | null;
|
|
6
7
|
params: Partial<TParams>;
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
+
export type LoadManyCallback<TSpec, TData, TParams extends Record<string, any>> = {
|
|
9
10
|
(specs: ReadonlyArray<TSpec>, options: LoadManyOptions<TData, TParams>): PromiseOrDirect<ReadonlyArray<ReadonlyArray<TData>>>;
|
|
10
11
|
displayName?: string;
|
|
11
12
|
};
|
|
@@ -24,7 +25,7 @@ export declare class LoadManySingleRecordStep<TData> extends ExecutableStep<TDat
|
|
|
24
25
|
optimize(): ExecutableStep<any>;
|
|
25
26
|
execute([records]: [GrafastValuesList<TData>]): GrafastResultsList<TData>;
|
|
26
27
|
}
|
|
27
|
-
export declare class LoadManyStep<TSpec, TData, TParams extends Record<string, any>> extends ExecutableStep {
|
|
28
|
+
export declare class LoadManyStep<TSpec, TData, TParams extends Record<string, any>> extends ExecutableStep implements ListCapableStep<TData, LoadManySingleRecordStep<TData>> {
|
|
28
29
|
private load;
|
|
29
30
|
static $$export: {
|
|
30
31
|
moduleName: string;
|
|
@@ -36,7 +37,7 @@ export declare class LoadManyStep<TSpec, TData, TParams extends Record<string, a
|
|
|
36
37
|
params: Partial<TParams>;
|
|
37
38
|
constructor($spec: ExecutableStep<TSpec>, load: LoadManyCallback<TSpec, TData, TParams>);
|
|
38
39
|
toStringMeta(): string;
|
|
39
|
-
listItem($item: __ItemStep<
|
|
40
|
+
listItem($item: __ItemStep<this>): LoadManySingleRecordStep<TData>;
|
|
40
41
|
setParam<TParamKey extends keyof TParams>(paramKey: TParamKey, value: TParams[TParamKey]): void;
|
|
41
42
|
addAttributes(attributes: Set<keyof TData>): void;
|
|
42
43
|
finalize(): void;
|
package/dist/steps/loadOne.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface LoadOneOptions<TData, TParams extends Record<string, any>> {
|
|
|
4
4
|
attributes: ReadonlyArray<keyof TData> | null;
|
|
5
5
|
params: Partial<TParams>;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type LoadOneCallback<TSpec, TData, TParams extends Record<string, any>> = {
|
|
8
8
|
(specs: ReadonlyArray<TSpec>, options: LoadOneOptions<TData, TParams>): PromiseOrDirect<ReadonlyArray<TData>>;
|
|
9
9
|
displayName?: string;
|
|
10
10
|
};
|
package/dist/steps/map.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExecutionExtra, GrafastResultsList, GrafastValuesList } from "../interfaces.js";
|
|
2
2
|
import type { ExecutableStep } from "../step.js";
|
|
3
3
|
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
|
-
export
|
|
4
|
+
export type ActualKeyByDesiredKey = {
|
|
5
5
|
[desiredKey: string]: string;
|
|
6
6
|
};
|
|
7
7
|
export declare function makeMapper(actualKeyByDesiredKey: ActualKeyByDesiredKey): any;
|
package/dist/steps/node.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { UnbatchedExecutableStep } from "../step.js";
|
|
|
5
5
|
export declare class NodeStep<TCodecs extends {
|
|
6
6
|
[key: string]: NodeIdCodec<any>;
|
|
7
7
|
}> extends UnbatchedExecutableStep implements PolymorphicStep {
|
|
8
|
-
private codecs;
|
|
9
8
|
private possibleTypes;
|
|
10
9
|
static $$export: {
|
|
11
10
|
moduleName: string;
|
package/dist/steps/object.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import type { ExecutionExtra } from "../interfaces.js";
|
|
|
2
2
|
import type { ExecutableStep } from "../step.js";
|
|
3
3
|
import { UnbatchedExecutableStep } from "../step.js";
|
|
4
4
|
import type { SetterCapableStep } from "./setter.js";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type DataFromStep<TStep extends ExecutableStep<any>> = TStep extends ExecutableStep<infer TData> ? TData : never;
|
|
6
|
+
type DataFromPlans<TPlans extends {
|
|
7
7
|
[key: string]: ExecutableStep<any>;
|
|
8
8
|
}> = {
|
|
9
9
|
[key in keyof TPlans]: DataFromStep<TPlans[key]>;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type Results<TPlans extends {
|
|
12
12
|
[key: string]: ExecutableStep<any>;
|
|
13
13
|
}> = Array<[
|
|
14
14
|
Array<DataFromPlans<TPlans>[keyof TPlans]>,
|