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