@gaganref/confect-core 10.3.1-fork.5 → 10.3.1-fork.50
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/ActionCall.d.ts +18 -0
- package/dist/ActionCall.d.ts.map +1 -0
- package/dist/ActionCall.js +21 -0
- package/dist/ActionCall.js.map +1 -0
- package/dist/App.d.ts +13 -2
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +6 -3
- package/dist/App.js.map +1 -1
- package/dist/Auth.d.ts +31 -6
- package/dist/Auth.d.ts.map +1 -1
- package/dist/Auth.js +15 -1
- package/dist/Auth.js.map +1 -1
- package/dist/Callback.d.ts.map +1 -1
- package/dist/Callback.js +2 -2
- package/dist/Callback.js.map +1 -1
- package/dist/Component.d.ts.map +1 -1
- package/dist/Component.js +1 -1
- package/dist/Component.js.map +1 -1
- package/dist/FunctionSpec.d.ts +365 -2
- package/dist/FunctionSpec.d.ts.map +1 -1
- package/dist/FunctionSpec.js +66 -3
- package/dist/FunctionSpec.js.map +1 -1
- package/dist/GroupSpec.js +1 -1
- package/dist/Http.d.ts.map +1 -1
- package/dist/Http.js +2 -2
- package/dist/Http.js.map +1 -1
- package/dist/ManifestSection.d.ts +24 -0
- package/dist/ManifestSection.d.ts.map +1 -0
- package/dist/ManifestSection.js +7 -0
- package/dist/ManifestSection.js.map +1 -0
- package/dist/Profile.d.ts +95 -0
- package/dist/Profile.d.ts.map +1 -0
- package/dist/Profile.js +15 -0
- package/dist/Profile.js.map +1 -0
- package/dist/Ref.d.ts +4 -2
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +8 -4
- package/dist/Ref.js.map +1 -1
- package/dist/SchemaToValidator.d.ts +10 -1
- package/dist/SchemaToValidator.d.ts.map +1 -1
- package/dist/SchemaToValidator.js +19 -4
- package/dist/SchemaToValidator.js.map +1 -1
- package/dist/SystemFields.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -6
- package/dist/internal/scalarDocs.d.ts +5 -0
- package/dist/internal/scalarDocs.d.ts.map +1 -0
- package/dist/internal/scalarDocs.js +43 -0
- package/dist/internal/scalarDocs.js.map +1 -0
- package/package.json +3 -3
- package/src/ActionCall.ts +25 -0
- package/src/App.ts +19 -3
- package/src/Auth.ts +48 -6
- package/src/Callback.ts +1 -0
- package/src/Component.ts +2 -0
- package/src/FunctionSpec.ts +570 -5
- package/src/Http.ts +2 -5
- package/src/ManifestSection.ts +29 -0
- package/src/Profile.ts +141 -0
- package/src/Ref.ts +17 -4
- package/src/SchemaToValidator.ts +22 -1
- package/src/index.ts +3 -0
- package/src/internal/scalarDocs.ts +72 -0
package/dist/FunctionSpec.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type * as ManifestSection from "./ManifestSection.js";
|
|
1
2
|
import type * as MiddlewareAttachment from "./MiddlewareAttachment.js";
|
|
2
3
|
import type { DefaultFunctionArgs, FunctionType, FunctionVisibility, RegisteredAction, RegisteredMutation, RegisteredQuery } from "convex/server";
|
|
3
|
-
import
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
4
5
|
import * as FunctionProvenance from "./FunctionProvenance.js";
|
|
5
|
-
import
|
|
6
|
+
import * as MiddlewareSpec from "./MiddlewareSpec.js";
|
|
7
|
+
import type * as Profile from "./Profile.js";
|
|
6
8
|
import * as RuntimeAndFunctionType from "./RuntimeAndFunctionType.js";
|
|
7
9
|
export declare const TypeId = "~@confect/core/FunctionSpec";
|
|
8
10
|
export type TypeId = typeof TypeId;
|
|
@@ -12,6 +14,8 @@ export interface FunctionSpec<RuntimeAndFunctionType_ extends RuntimeAndFunction
|
|
|
12
14
|
readonly runtimeAndFunctionType: RuntimeAndFunctionType_;
|
|
13
15
|
readonly functionVisibility: FunctionVisibility_;
|
|
14
16
|
readonly name: Name_;
|
|
17
|
+
readonly reservedArgument?: string;
|
|
18
|
+
readonly manifestSections?: ReadonlyArray<ManifestSection.Entry>;
|
|
15
19
|
readonly functionProvenance: FunctionProvenance_;
|
|
16
20
|
readonly middlewareSpecs: ReadonlyArray<MiddlewareSpecs_>;
|
|
17
21
|
readonly middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment<MiddlewareSpecs_>>;
|
|
@@ -19,10 +23,24 @@ export interface FunctionSpec<RuntimeAndFunctionType_ extends RuntimeAndFunction
|
|
|
19
23
|
export interface Builder<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility, Name_ extends string, FunctionProvenance_ extends FunctionProvenance.FunctionProvenance, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never> extends FunctionSpec<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_> {
|
|
20
24
|
middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(middlewareSpec: MiddlewareSpec_ & MiddlewareSpec.ValidateFunctionAttach<MiddlewareSpec_, RuntimeAndFunctionType_, FunctionProvenance_, MiddlewareSpecs_>, ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>): Builder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_ | MiddlewareSpec_>;
|
|
21
25
|
}
|
|
26
|
+
export interface DescribedBuilder<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility, Name_ extends string, FunctionProvenance_ extends FunctionProvenance.FunctionProvenance, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never> extends Builder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_> {
|
|
27
|
+
readonly description?: string;
|
|
28
|
+
middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(middlewareSpec: MiddlewareSpec_ & MiddlewareSpec.ValidateFunctionAttach<MiddlewareSpec_, RuntimeAndFunctionType_, FunctionProvenance_, MiddlewareSpecs_>, ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>): DescribedBuilder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_ | MiddlewareSpec_>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A spec built through {@link extend}, keeping its fields through middleware.
|
|
32
|
+
*/
|
|
33
|
+
export interface ExtendedBuilder<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility, Name_ extends string, FunctionProvenance_ extends FunctionProvenance.FunctionProvenance, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Fields_> extends Builder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_> {
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
readonly fields: Profile.Info<Fields_>["fields"];
|
|
36
|
+
middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(middlewareSpec: MiddlewareSpec_ & MiddlewareSpec.ValidateFunctionAttach<MiddlewareSpec_, RuntimeAndFunctionType_, FunctionProvenance_, MiddlewareSpecs_>, ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>): ExtendedBuilder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_ | MiddlewareSpec_, Fields_>;
|
|
37
|
+
}
|
|
22
38
|
export interface Any {
|
|
23
39
|
readonly [TypeId]: TypeId;
|
|
24
40
|
}
|
|
25
41
|
export interface AnyWithProps extends FunctionSpec<RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility, string, FunctionProvenance.FunctionProvenance, MiddlewareSpec.AnyMiddlewareSpec> {
|
|
42
|
+
readonly description?: string;
|
|
43
|
+
readonly fields?: object;
|
|
26
44
|
}
|
|
27
45
|
export interface AnyConfect extends FunctionSpec<RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility, string, FunctionProvenance.AnyConfect, MiddlewareSpec.AnyMiddlewareSpec> {
|
|
28
46
|
}
|
|
@@ -128,7 +146,9 @@ type ForbidPaginationOpts<UserArgsFields extends FunctionProvenance.ArgsFields>
|
|
|
128
146
|
} : unknown;
|
|
129
147
|
export declare const publicQuery: {
|
|
130
148
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
149
|
+
reservedArgument?: never;
|
|
131
150
|
name: Name_;
|
|
151
|
+
description?: never;
|
|
132
152
|
args: () => ArgsFields_;
|
|
133
153
|
returns: () => Returns_;
|
|
134
154
|
error?: () => Error_;
|
|
@@ -137,7 +157,9 @@ export declare const publicQuery: {
|
|
|
137
157
|
readonly functionType: "query";
|
|
138
158
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
139
159
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
160
|
+
reservedArgument?: never;
|
|
140
161
|
name: Name_;
|
|
162
|
+
description?: never;
|
|
141
163
|
args?: never;
|
|
142
164
|
returns: () => Returns_;
|
|
143
165
|
error?: () => Error_;
|
|
@@ -145,10 +167,34 @@ export declare const publicQuery: {
|
|
|
145
167
|
readonly runtime: "Convex";
|
|
146
168
|
readonly functionType: "query";
|
|
147
169
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
170
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
171
|
+
reservedArgument?: never;
|
|
172
|
+
name: Name_;
|
|
173
|
+
description?: string;
|
|
174
|
+
args: () => ArgsFields_;
|
|
175
|
+
returns: () => Returns_;
|
|
176
|
+
error?: () => Error_;
|
|
177
|
+
}): DescribedBuilder<{
|
|
178
|
+
readonly runtime: "Convex";
|
|
179
|
+
readonly functionType: "query";
|
|
180
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
181
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
182
|
+
reservedArgument?: never;
|
|
183
|
+
name: Name_;
|
|
184
|
+
description?: string;
|
|
185
|
+
args?: never;
|
|
186
|
+
returns: () => Returns_;
|
|
187
|
+
error?: () => Error_;
|
|
188
|
+
}): DescribedBuilder<{
|
|
189
|
+
readonly runtime: "Convex";
|
|
190
|
+
readonly functionType: "query";
|
|
191
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
148
192
|
};
|
|
149
193
|
export declare const internalQuery: {
|
|
150
194
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
195
|
+
reservedArgument?: never;
|
|
151
196
|
name: Name_;
|
|
197
|
+
description?: never;
|
|
152
198
|
args: () => ArgsFields_;
|
|
153
199
|
returns: () => Returns_;
|
|
154
200
|
error?: () => Error_;
|
|
@@ -157,7 +203,9 @@ export declare const internalQuery: {
|
|
|
157
203
|
readonly functionType: "query";
|
|
158
204
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
159
205
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
206
|
+
reservedArgument?: never;
|
|
160
207
|
name: Name_;
|
|
208
|
+
description?: never;
|
|
161
209
|
args?: never;
|
|
162
210
|
returns: () => Returns_;
|
|
163
211
|
error?: () => Error_;
|
|
@@ -165,10 +213,33 @@ export declare const internalQuery: {
|
|
|
165
213
|
readonly runtime: "Convex";
|
|
166
214
|
readonly functionType: "query";
|
|
167
215
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
216
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
217
|
+
reservedArgument?: never;
|
|
218
|
+
name: Name_;
|
|
219
|
+
description?: never;
|
|
220
|
+
args: () => ArgsFields_;
|
|
221
|
+
returns: () => Returns_;
|
|
222
|
+
error?: () => Error_;
|
|
223
|
+
}): DescribedBuilder<{
|
|
224
|
+
readonly runtime: "Convex";
|
|
225
|
+
readonly functionType: "query";
|
|
226
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
227
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
228
|
+
reservedArgument?: never;
|
|
229
|
+
name: Name_;
|
|
230
|
+
description?: never;
|
|
231
|
+
args?: never;
|
|
232
|
+
returns: () => Returns_;
|
|
233
|
+
error?: () => Error_;
|
|
234
|
+
}): DescribedBuilder<{
|
|
235
|
+
readonly runtime: "Convex";
|
|
236
|
+
readonly functionType: "query";
|
|
237
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
168
238
|
};
|
|
169
239
|
export declare const publicPaginatedQuery: {
|
|
170
240
|
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
171
241
|
name: Name_;
|
|
242
|
+
description?: never;
|
|
172
243
|
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
173
244
|
item: () => Item_;
|
|
174
245
|
error?: () => Error_;
|
|
@@ -178,6 +249,7 @@ export declare const publicPaginatedQuery: {
|
|
|
178
249
|
}, "public", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
179
250
|
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
180
251
|
name: Name_;
|
|
252
|
+
description?: never;
|
|
181
253
|
args?: never;
|
|
182
254
|
item: () => Item_;
|
|
183
255
|
error?: () => Error_;
|
|
@@ -185,10 +257,31 @@ export declare const publicPaginatedQuery: {
|
|
|
185
257
|
readonly runtime: "Convex";
|
|
186
258
|
readonly functionType: "query";
|
|
187
259
|
}, "public", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
260
|
+
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
261
|
+
name: Name_;
|
|
262
|
+
description?: string;
|
|
263
|
+
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
264
|
+
item: () => Item_;
|
|
265
|
+
error?: () => Error_;
|
|
266
|
+
}): DescribedBuilder<{
|
|
267
|
+
readonly runtime: "Convex";
|
|
268
|
+
readonly functionType: "query";
|
|
269
|
+
}, "public", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
270
|
+
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
271
|
+
name: Name_;
|
|
272
|
+
description?: string;
|
|
273
|
+
args?: never;
|
|
274
|
+
item: () => Item_;
|
|
275
|
+
error?: () => Error_;
|
|
276
|
+
}): DescribedBuilder<{
|
|
277
|
+
readonly runtime: "Convex";
|
|
278
|
+
readonly functionType: "query";
|
|
279
|
+
}, "public", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
188
280
|
};
|
|
189
281
|
export declare const internalPaginatedQuery: {
|
|
190
282
|
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
191
283
|
name: Name_;
|
|
284
|
+
description?: never;
|
|
192
285
|
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
193
286
|
item: () => Item_;
|
|
194
287
|
error?: () => Error_;
|
|
@@ -198,6 +291,7 @@ export declare const internalPaginatedQuery: {
|
|
|
198
291
|
}, "internal", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
199
292
|
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
200
293
|
name: Name_;
|
|
294
|
+
description?: never;
|
|
201
295
|
args?: never;
|
|
202
296
|
item: () => Item_;
|
|
203
297
|
error?: () => Error_;
|
|
@@ -205,10 +299,32 @@ export declare const internalPaginatedQuery: {
|
|
|
205
299
|
readonly runtime: "Convex";
|
|
206
300
|
readonly functionType: "query";
|
|
207
301
|
}, "internal", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
302
|
+
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
303
|
+
name: Name_;
|
|
304
|
+
description?: never;
|
|
305
|
+
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
306
|
+
item: () => Item_;
|
|
307
|
+
error?: () => Error_;
|
|
308
|
+
}): DescribedBuilder<{
|
|
309
|
+
readonly runtime: "Convex";
|
|
310
|
+
readonly functionType: "query";
|
|
311
|
+
}, "internal", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
312
|
+
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
313
|
+
name: Name_;
|
|
314
|
+
description?: never;
|
|
315
|
+
args?: never;
|
|
316
|
+
item: () => Item_;
|
|
317
|
+
error?: () => Error_;
|
|
318
|
+
}): DescribedBuilder<{
|
|
319
|
+
readonly runtime: "Convex";
|
|
320
|
+
readonly functionType: "query";
|
|
321
|
+
}, "internal", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
208
322
|
};
|
|
209
323
|
export declare const publicMutation: {
|
|
210
324
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
325
|
+
reservedArgument?: string;
|
|
211
326
|
name: Name_;
|
|
327
|
+
description?: never;
|
|
212
328
|
args: () => ArgsFields_;
|
|
213
329
|
returns: () => Returns_;
|
|
214
330
|
error?: () => Error_;
|
|
@@ -217,7 +333,9 @@ export declare const publicMutation: {
|
|
|
217
333
|
readonly functionType: "mutation";
|
|
218
334
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
219
335
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
336
|
+
reservedArgument?: string;
|
|
220
337
|
name: Name_;
|
|
338
|
+
description?: never;
|
|
221
339
|
args?: never;
|
|
222
340
|
returns: () => Returns_;
|
|
223
341
|
error?: () => Error_;
|
|
@@ -225,10 +343,34 @@ export declare const publicMutation: {
|
|
|
225
343
|
readonly runtime: "Convex";
|
|
226
344
|
readonly functionType: "mutation";
|
|
227
345
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
346
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
347
|
+
reservedArgument?: string;
|
|
348
|
+
name: Name_;
|
|
349
|
+
description?: string;
|
|
350
|
+
args: () => ArgsFields_;
|
|
351
|
+
returns: () => Returns_;
|
|
352
|
+
error?: () => Error_;
|
|
353
|
+
}): DescribedBuilder<{
|
|
354
|
+
readonly runtime: "Convex";
|
|
355
|
+
readonly functionType: "mutation";
|
|
356
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
357
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
358
|
+
reservedArgument?: string;
|
|
359
|
+
name: Name_;
|
|
360
|
+
description?: string;
|
|
361
|
+
args?: never;
|
|
362
|
+
returns: () => Returns_;
|
|
363
|
+
error?: () => Error_;
|
|
364
|
+
}): DescribedBuilder<{
|
|
365
|
+
readonly runtime: "Convex";
|
|
366
|
+
readonly functionType: "mutation";
|
|
367
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
228
368
|
};
|
|
229
369
|
export declare const internalMutation: {
|
|
230
370
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
371
|
+
reservedArgument?: string;
|
|
231
372
|
name: Name_;
|
|
373
|
+
description?: never;
|
|
232
374
|
args: () => ArgsFields_;
|
|
233
375
|
returns: () => Returns_;
|
|
234
376
|
error?: () => Error_;
|
|
@@ -237,7 +379,9 @@ export declare const internalMutation: {
|
|
|
237
379
|
readonly functionType: "mutation";
|
|
238
380
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
239
381
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
382
|
+
reservedArgument?: string;
|
|
240
383
|
name: Name_;
|
|
384
|
+
description?: never;
|
|
241
385
|
args?: never;
|
|
242
386
|
returns: () => Returns_;
|
|
243
387
|
error?: () => Error_;
|
|
@@ -245,10 +389,34 @@ export declare const internalMutation: {
|
|
|
245
389
|
readonly runtime: "Convex";
|
|
246
390
|
readonly functionType: "mutation";
|
|
247
391
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
392
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
393
|
+
reservedArgument?: string;
|
|
394
|
+
name: Name_;
|
|
395
|
+
description?: never;
|
|
396
|
+
args: () => ArgsFields_;
|
|
397
|
+
returns: () => Returns_;
|
|
398
|
+
error?: () => Error_;
|
|
399
|
+
}): DescribedBuilder<{
|
|
400
|
+
readonly runtime: "Convex";
|
|
401
|
+
readonly functionType: "mutation";
|
|
402
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
403
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
404
|
+
reservedArgument?: string;
|
|
405
|
+
name: Name_;
|
|
406
|
+
description?: never;
|
|
407
|
+
args?: never;
|
|
408
|
+
returns: () => Returns_;
|
|
409
|
+
error?: () => Error_;
|
|
410
|
+
}): DescribedBuilder<{
|
|
411
|
+
readonly runtime: "Convex";
|
|
412
|
+
readonly functionType: "mutation";
|
|
413
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
248
414
|
};
|
|
249
415
|
export declare const publicAction: {
|
|
250
416
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
417
|
+
reservedArgument?: string;
|
|
251
418
|
name: Name_;
|
|
419
|
+
description?: never;
|
|
252
420
|
args: () => ArgsFields_;
|
|
253
421
|
returns: () => Returns_;
|
|
254
422
|
error?: () => Error_;
|
|
@@ -257,7 +425,9 @@ export declare const publicAction: {
|
|
|
257
425
|
readonly functionType: "action";
|
|
258
426
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
259
427
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
428
|
+
reservedArgument?: string;
|
|
260
429
|
name: Name_;
|
|
430
|
+
description?: never;
|
|
261
431
|
args?: never;
|
|
262
432
|
returns: () => Returns_;
|
|
263
433
|
error?: () => Error_;
|
|
@@ -265,10 +435,34 @@ export declare const publicAction: {
|
|
|
265
435
|
readonly runtime: "Convex";
|
|
266
436
|
readonly functionType: "action";
|
|
267
437
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
438
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
439
|
+
reservedArgument?: string;
|
|
440
|
+
name: Name_;
|
|
441
|
+
description?: string;
|
|
442
|
+
args: () => ArgsFields_;
|
|
443
|
+
returns: () => Returns_;
|
|
444
|
+
error?: () => Error_;
|
|
445
|
+
}): DescribedBuilder<{
|
|
446
|
+
readonly runtime: "Convex";
|
|
447
|
+
readonly functionType: "action";
|
|
448
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
449
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
450
|
+
reservedArgument?: string;
|
|
451
|
+
name: Name_;
|
|
452
|
+
description?: string;
|
|
453
|
+
args?: never;
|
|
454
|
+
returns: () => Returns_;
|
|
455
|
+
error?: () => Error_;
|
|
456
|
+
}): DescribedBuilder<{
|
|
457
|
+
readonly runtime: "Convex";
|
|
458
|
+
readonly functionType: "action";
|
|
459
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
268
460
|
};
|
|
269
461
|
export declare const internalAction: {
|
|
270
462
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
463
|
+
reservedArgument?: string;
|
|
271
464
|
name: Name_;
|
|
465
|
+
description?: never;
|
|
272
466
|
args: () => ArgsFields_;
|
|
273
467
|
returns: () => Returns_;
|
|
274
468
|
error?: () => Error_;
|
|
@@ -277,7 +471,9 @@ export declare const internalAction: {
|
|
|
277
471
|
readonly functionType: "action";
|
|
278
472
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
279
473
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
474
|
+
reservedArgument?: string;
|
|
280
475
|
name: Name_;
|
|
476
|
+
description?: never;
|
|
281
477
|
args?: never;
|
|
282
478
|
returns: () => Returns_;
|
|
283
479
|
error?: () => Error_;
|
|
@@ -285,10 +481,34 @@ export declare const internalAction: {
|
|
|
285
481
|
readonly runtime: "Convex";
|
|
286
482
|
readonly functionType: "action";
|
|
287
483
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
484
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
485
|
+
reservedArgument?: string;
|
|
486
|
+
name: Name_;
|
|
487
|
+
description?: never;
|
|
488
|
+
args: () => ArgsFields_;
|
|
489
|
+
returns: () => Returns_;
|
|
490
|
+
error?: () => Error_;
|
|
491
|
+
}): DescribedBuilder<{
|
|
492
|
+
readonly runtime: "Convex";
|
|
493
|
+
readonly functionType: "action";
|
|
494
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
495
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
496
|
+
reservedArgument?: string;
|
|
497
|
+
name: Name_;
|
|
498
|
+
description?: never;
|
|
499
|
+
args?: never;
|
|
500
|
+
returns: () => Returns_;
|
|
501
|
+
error?: () => Error_;
|
|
502
|
+
}): DescribedBuilder<{
|
|
503
|
+
readonly runtime: "Convex";
|
|
504
|
+
readonly functionType: "action";
|
|
505
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
288
506
|
};
|
|
289
507
|
export declare const publicNodeAction: {
|
|
290
508
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
509
|
+
reservedArgument?: string;
|
|
291
510
|
name: Name_;
|
|
511
|
+
description?: never;
|
|
292
512
|
args: () => ArgsFields_;
|
|
293
513
|
returns: () => Returns_;
|
|
294
514
|
error?: () => Error_;
|
|
@@ -297,7 +517,9 @@ export declare const publicNodeAction: {
|
|
|
297
517
|
readonly functionType: "action";
|
|
298
518
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
299
519
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
520
|
+
reservedArgument?: string;
|
|
300
521
|
name: Name_;
|
|
522
|
+
description?: never;
|
|
301
523
|
args?: never;
|
|
302
524
|
returns: () => Returns_;
|
|
303
525
|
error?: () => Error_;
|
|
@@ -305,10 +527,34 @@ export declare const publicNodeAction: {
|
|
|
305
527
|
readonly runtime: "Node";
|
|
306
528
|
readonly functionType: "action";
|
|
307
529
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
530
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
531
|
+
reservedArgument?: string;
|
|
532
|
+
name: Name_;
|
|
533
|
+
description?: string;
|
|
534
|
+
args: () => ArgsFields_;
|
|
535
|
+
returns: () => Returns_;
|
|
536
|
+
error?: () => Error_;
|
|
537
|
+
}): DescribedBuilder<{
|
|
538
|
+
readonly runtime: "Node";
|
|
539
|
+
readonly functionType: "action";
|
|
540
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
541
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
542
|
+
reservedArgument?: string;
|
|
543
|
+
name: Name_;
|
|
544
|
+
description?: string;
|
|
545
|
+
args?: never;
|
|
546
|
+
returns: () => Returns_;
|
|
547
|
+
error?: () => Error_;
|
|
548
|
+
}): DescribedBuilder<{
|
|
549
|
+
readonly runtime: "Node";
|
|
550
|
+
readonly functionType: "action";
|
|
551
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
308
552
|
};
|
|
309
553
|
export declare const internalNodeAction: {
|
|
310
554
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
555
|
+
reservedArgument?: string;
|
|
311
556
|
name: Name_;
|
|
557
|
+
description?: never;
|
|
312
558
|
args: () => ArgsFields_;
|
|
313
559
|
returns: () => Returns_;
|
|
314
560
|
error?: () => Error_;
|
|
@@ -317,7 +563,9 @@ export declare const internalNodeAction: {
|
|
|
317
563
|
readonly functionType: "action";
|
|
318
564
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
319
565
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
566
|
+
reservedArgument?: string;
|
|
320
567
|
name: Name_;
|
|
568
|
+
description?: never;
|
|
321
569
|
args?: never;
|
|
322
570
|
returns: () => Returns_;
|
|
323
571
|
error?: () => Error_;
|
|
@@ -325,7 +573,122 @@ export declare const internalNodeAction: {
|
|
|
325
573
|
readonly runtime: "Node";
|
|
326
574
|
readonly functionType: "action";
|
|
327
575
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
576
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
577
|
+
reservedArgument?: string;
|
|
578
|
+
name: Name_;
|
|
579
|
+
description?: never;
|
|
580
|
+
args: () => ArgsFields_;
|
|
581
|
+
returns: () => Returns_;
|
|
582
|
+
error?: () => Error_;
|
|
583
|
+
}): DescribedBuilder<{
|
|
584
|
+
readonly runtime: "Node";
|
|
585
|
+
readonly functionType: "action";
|
|
586
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
587
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
588
|
+
reservedArgument?: string;
|
|
589
|
+
name: Name_;
|
|
590
|
+
description?: never;
|
|
591
|
+
args?: never;
|
|
592
|
+
returns: () => Returns_;
|
|
593
|
+
error?: () => Error_;
|
|
594
|
+
}): DescribedBuilder<{
|
|
595
|
+
readonly runtime: "Node";
|
|
596
|
+
readonly functionType: "action";
|
|
597
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
598
|
+
};
|
|
599
|
+
type OptionlessMiddlewareSpec = MiddlewareSpec.AnyMiddlewareSpec & {
|
|
600
|
+
readonly "~Options": never;
|
|
601
|
+
};
|
|
602
|
+
type BuilderOption = "name" | "description" | "args" | "returns" | "item" | "error";
|
|
603
|
+
/**
|
|
604
|
+
* Only a required description string may name a builder option. The builder
|
|
605
|
+
* reads it as that option. The conditional keeps the mapped type out of a
|
|
606
|
+
* builder call's inference, which would otherwise widen the function's name to
|
|
607
|
+
* `string` when reporting the error.
|
|
608
|
+
*/
|
|
609
|
+
type OptionFree<Type> = [keyof Type & BuilderOption] extends [never] ? unknown : {
|
|
610
|
+
readonly [Option in keyof Type & BuilderOption as Option extends "description" ? Type[Option] extends string ? string extends Type[Option] ? never : Option : Option : Option]: never;
|
|
328
611
|
};
|
|
612
|
+
/**
|
|
613
|
+
* A function's fields, checked once applied, since a profile's field type can
|
|
614
|
+
* branch on the function's name.
|
|
615
|
+
*/
|
|
616
|
+
type CheckedFields<Type> = Type & OptionFree<Type>;
|
|
617
|
+
type NotRepeated<Middleware_, Inherited extends MiddlewareSpec.AnyMiddlewareSpec> = Middleware_ extends {
|
|
618
|
+
readonly key: infer Key extends MiddlewareSpec.Key<Inherited>;
|
|
619
|
+
} ? MiddlewareSpec.AttachmentError<`Middleware "${Key}" is already attached by this profile`> : Middleware_;
|
|
620
|
+
/**
|
|
621
|
+
* Refuses a middleware without options that an earlier layer attached, as it is
|
|
622
|
+
* attached at most once; one with options may repeat. Each member of an
|
|
623
|
+
* element's union is checked, so an array typed `(A | B)[]` is refused when
|
|
624
|
+
* either was attached.
|
|
625
|
+
*/
|
|
626
|
+
type NotInherited<Middleware_ extends ReadonlyArray<unknown>, Inherited extends MiddlewareSpec.AnyMiddlewareSpec> = {
|
|
627
|
+
readonly [Index in keyof Middleware_]: NotRepeated<Middleware_[Index], Inherited>;
|
|
628
|
+
};
|
|
629
|
+
/**
|
|
630
|
+
* A profile's middleware: a spec without options, or an attachment.
|
|
631
|
+
*/
|
|
632
|
+
type ProfileMiddleware<FieldsType> = OptionlessMiddlewareSpec | Profile.Attachment<MiddlewareSpec.AnyMiddlewareSpec, FieldsType>;
|
|
633
|
+
type SpecOf<Middleware_> = Middleware_ extends Profile.Attachment<infer MiddlewareSpec_, any> ? MiddlewareSpec_ : Extract<Middleware_, MiddlewareSpec.AnyMiddlewareSpec>;
|
|
634
|
+
/**
|
|
635
|
+
* `never` when a profile middleware does not declare the function type.
|
|
636
|
+
*/
|
|
637
|
+
type Declared<MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, FunctionType_ extends FunctionType, Make> = [
|
|
638
|
+
MiddlewareSpecs_ extends unknown ? FunctionType_ extends MiddlewareSpec.FunctionTypes<MiddlewareSpecs_> ? never : MiddlewareSpecs_ : never
|
|
639
|
+
] extends [never] ? Make : never;
|
|
640
|
+
type Wrapped<Layers extends ReadonlyArray<Profile.Transforms>, Key extends keyof Profile.Transforms, Input> = Layers extends readonly [
|
|
641
|
+
infer First extends Profile.Transforms,
|
|
642
|
+
...infer Rest extends ReadonlyArray<Profile.Transforms>
|
|
643
|
+
] ? Wrapped<Rest, Key, Key extends keyof First ? [Input] extends [never] ? Key extends "error" ? Profile.Transform<First[Key], typeof Schema.Never> : never : Profile.Transform<First[Key], Input> : Input> : Input;
|
|
644
|
+
type UserArgs<A> = [A] extends [never] ? {} : A;
|
|
645
|
+
type ExtendedMake<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, Fields_ extends Profile.Fields, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Layers extends ReadonlyArray<Profile.Transforms>> = Declared<MiddlewareSpecs_, RuntimeAndFunctionType_["functionType"], <const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields = never, Returns_ extends Schema.Codec<any, any> = never, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
646
|
+
readonly name: Name_;
|
|
647
|
+
readonly description?: string;
|
|
648
|
+
readonly args?: () => ArgsFields_;
|
|
649
|
+
readonly returns: () => Returns_;
|
|
650
|
+
readonly error?: () => Error_;
|
|
651
|
+
} & NoInfer<CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>>>) => ExtendedBuilder<RuntimeAndFunctionType_, "public", Name_, FunctionProvenance.Confect<UserArgs<Wrapped<Layers, "args", ArgsFields_>>, Wrapped<Layers, "returns", Returns_>, Wrapped<Layers, "error", Error_>>, MiddlewareSpecs_, Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>>>;
|
|
652
|
+
type ExtendedMakePaginated<Fields_ extends Profile.Fields, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Layers extends ReadonlyArray<Profile.Transforms>> = Declared<MiddlewareSpecs_, "query", <const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields = never, Item_ extends Schema.Codec<any, any> = never, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
653
|
+
readonly name: Name_;
|
|
654
|
+
readonly description?: string;
|
|
655
|
+
readonly args?: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
656
|
+
readonly item: () => Item_;
|
|
657
|
+
readonly error?: () => Error_;
|
|
658
|
+
} & NoInfer<CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>>>) => ExtendedBuilder<RuntimeAndFunctionType.ConvexQuery, "public", Name_, FunctionProvenance.ConfectPaginated<UserArgs<Wrapped<Layers, "args", UserArgsFields_>>, Wrapped<Layers, "item", Item_>, Wrapped<Layers, "error", Error_>>, MiddlewareSpecs_, Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>>>;
|
|
659
|
+
interface ExtendedRuntimes {
|
|
660
|
+
readonly publicQuery: RuntimeAndFunctionType.ConvexQuery;
|
|
661
|
+
readonly publicMutation: RuntimeAndFunctionType.ConvexMutation;
|
|
662
|
+
readonly publicAction: RuntimeAndFunctionType.ConvexAction;
|
|
663
|
+
readonly publicNodeAction: RuntimeAndFunctionType.NodeAction;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* A profile's five public builders and its own `extend`.
|
|
667
|
+
*/
|
|
668
|
+
export type Extended<Fields_ extends Profile.Fields, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Layers extends ReadonlyArray<Profile.Transforms> = []> = {
|
|
669
|
+
readonly [Builder_ in keyof ExtendedRuntimes]: ExtendedMake<ExtendedRuntimes[Builder_], Fields_, MiddlewareSpecs_, Layers>;
|
|
670
|
+
} & {
|
|
671
|
+
readonly publicPaginatedQuery: ExtendedMakePaginated<Fields_, MiddlewareSpecs_, Layers>;
|
|
672
|
+
/**
|
|
673
|
+
* Require more fields and attach more middleware after this profile's.
|
|
674
|
+
*/
|
|
675
|
+
extend<Extension extends Profile.Fields = Profile.NoFields, Transforms extends Profile.Transforms = {}>(): <const Middleware_ extends ReadonlyArray<ProfileMiddleware<Profile.Apply<Profile.Both<Fields_, Extension>, string, any>>>>(config: {
|
|
676
|
+
readonly manifest?: Readonly<Record<string, ManifestSection.ManifestSection>>;
|
|
677
|
+
readonly reservedArgument?: string;
|
|
678
|
+
readonly middleware: Middleware_ & NotInherited<Middleware_, MiddlewareSpecs_>;
|
|
679
|
+
} & OptionFree<Extension["Type"]> & Profile.SchemaConfig<Transforms, Profile.Apply<Profile.Both<Fields_, Extension>, string, any>>) => Extended<Profile.Both<Fields_, Extension>, MiddlewareSpecs_ | SpecOf<Middleware_[number]>, [
|
|
680
|
+
...Layers,
|
|
681
|
+
Transforms
|
|
682
|
+
]>;
|
|
683
|
+
};
|
|
684
|
+
/**
|
|
685
|
+
* Public builders whose specs require and keep `Fields_`, with `middleware`.
|
|
686
|
+
*/
|
|
687
|
+
export declare const extend: <Fields_ extends Profile.Fields = Profile.NoFields, Transforms extends Profile.Transforms = {}>() => <const Middleware_ extends ReadonlyArray<ProfileMiddleware<Profile.Apply<Fields_, string, any>>>>(config: {
|
|
688
|
+
readonly manifest?: Readonly<Record<string, ManifestSection.ManifestSection>>;
|
|
689
|
+
readonly reservedArgument?: string;
|
|
690
|
+
readonly middleware: Middleware_;
|
|
691
|
+
} & OptionFree<Fields_["Type"]> & Profile.SchemaConfig<Transforms, Profile.Apply<Fields_, string, any>>) => Extended<Fields_, SpecOf<Middleware_[number]>, [Transforms]>;
|
|
329
692
|
type MatchingRegisteredFunction<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility> = RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends "query" ? RegisteredQuery<FunctionVisibility_, any, any> : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends "mutation" ? RegisteredMutation<FunctionVisibility_, any, any> : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends "action" ? RegisteredAction<FunctionVisibility_, any, any> : never;
|
|
330
693
|
type ExtractArgs<F> = F extends RegisteredQuery<any, infer A extends DefaultFunctionArgs, any> ? A : F extends RegisteredMutation<any, infer A extends DefaultFunctionArgs, any> ? A : F extends RegisteredAction<any, infer A extends DefaultFunctionArgs, any> ? A : never;
|
|
331
694
|
type ExtractReturns<F> = F extends RegisteredQuery<any, any, infer R> ? R : F extends RegisteredMutation<any, any, infer R> ? R : F extends RegisteredAction<any, any, infer R> ? R : never;
|