surreal-zod 0.0.0-alpha.12 → 0.0.0-alpha.14
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/lib/data-types.d.ts +4 -0
- package/lib/data-types.js +6 -0
- package/lib/zod/core.d.ts +0 -5
- package/lib/zod/external.d.ts +2 -0
- package/lib/zod/external.js +2 -0
- package/lib/zod/index.d.ts +1 -0
- package/lib/zod/index.js +1 -0
- package/lib/zod/json-schema.js +1 -2
- package/lib/zod/schema.d.ts +147 -148
- package/lib/zod/schema.js +116 -10
- package/package.json +1 -1
- package/src/zod/core.ts +0 -9
- package/src/zod/external.ts +8 -0
- package/src/zod/index.ts +1 -0
- package/src/zod/json-schema.ts +1 -2
- package/src/zod/schema.ts +598 -992
package/src/zod/schema.ts
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from "surrealdb";
|
|
13
13
|
import * as core from "zod/v4/core";
|
|
14
14
|
import * as classic from "zod/v4";
|
|
15
|
-
import {} from "zod/v4/core";
|
|
16
15
|
import {
|
|
17
16
|
inferSurrealType,
|
|
18
17
|
inlineQueryParameters,
|
|
@@ -345,7 +344,7 @@ type UnwrapField<T> =
|
|
|
345
344
|
: T;
|
|
346
345
|
|
|
347
346
|
export interface ZodSurrealField<
|
|
348
|
-
T extends ZodSurrealType = ZodSurrealType,
|
|
347
|
+
T extends _core_.$ZodSurrealType = _core_.$ZodSurrealType,
|
|
349
348
|
O = core.output<T>,
|
|
350
349
|
I = core.input<T>,
|
|
351
350
|
DBO = _core_.dboutput<T>,
|
|
@@ -356,6 +355,7 @@ export interface ZodSurrealField<
|
|
|
356
355
|
I,
|
|
357
356
|
DBO,
|
|
358
357
|
DBI,
|
|
358
|
+
| ""
|
|
359
359
|
| "$default"
|
|
360
360
|
| "$prefault"
|
|
361
361
|
| "$defaultAlways"
|
|
@@ -371,10 +371,17 @@ export interface ZodSurrealField<
|
|
|
371
371
|
: {
|
|
372
372
|
dboptout?: "optional" | undefined;
|
|
373
373
|
})
|
|
374
|
-
: ZodSurrealFieldInternals<O, I, DBO, DBI> &
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
374
|
+
: ZodSurrealFieldInternals<O, I, DBO, DBI> &
|
|
375
|
+
(T["_zod"] extends { optin?: any }
|
|
376
|
+
? {
|
|
377
|
+
dboptin?: T["_zod"]["optin"];
|
|
378
|
+
}
|
|
379
|
+
: { dboptin: T["_zod"]["optin"] }) &
|
|
380
|
+
(T["_zod"] extends { optout?: any }
|
|
381
|
+
? {
|
|
382
|
+
dboptout?: T["_zod"]["optout"];
|
|
383
|
+
}
|
|
384
|
+
: { dboptout: T["_zod"]["optout"] })
|
|
378
385
|
>,
|
|
379
386
|
ZodSurrealFieldMethods<Options> {
|
|
380
387
|
// parsing/encoding/decoding
|
|
@@ -4843,7 +4850,7 @@ export interface ZodSurrealFunction<
|
|
|
4843
4850
|
> extends _ZodSurrealType<ZodSurrealFunctionInternals<Args, Returns>>,
|
|
4844
4851
|
ZodSurrealFieldMethods {
|
|
4845
4852
|
"~standard": core.ZodStandardSchemaWithJSON<this>;
|
|
4846
|
-
_def:
|
|
4853
|
+
_def: ZodSurrealFunctionDef<Args, Returns>;
|
|
4847
4854
|
_input: _core_.$InferInnerFunctionType<Args, Returns>;
|
|
4848
4855
|
_output: _core_.$InferOuterFunctionType<Args, Returns>;
|
|
4849
4856
|
_dbinput: _core_.$InferInnerFunctionDbType<Args, Returns>;
|
|
@@ -5219,7 +5226,12 @@ export function preprocess<A, U extends _core_.$SomeSurrealType, B = unknown>(
|
|
|
5219
5226
|
//////////////////////////////////////////////////
|
|
5220
5227
|
//////////////////////////////////////////////////
|
|
5221
5228
|
|
|
5222
|
-
export type ZodSurrealRecordIdValue = ZodSurrealType<
|
|
5229
|
+
export type ZodSurrealRecordIdValue = _core_.$ZodSurrealType<
|
|
5230
|
+
RecordIdValue | undefined,
|
|
5231
|
+
unknown,
|
|
5232
|
+
RecordIdValue,
|
|
5233
|
+
unknown
|
|
5234
|
+
>;
|
|
5223
5235
|
|
|
5224
5236
|
export type inferRecordIdValue<Id extends ZodSurrealRecordIdValue> =
|
|
5225
5237
|
Id extends {
|
|
@@ -5258,10 +5270,10 @@ export interface ZodSurrealRecordIdInternals<
|
|
|
5258
5270
|
Extras extends ZodSurrealRecordIdExtras = {},
|
|
5259
5271
|
> extends ZodSurrealTypeInternals<
|
|
5260
5272
|
// O
|
|
5261
|
-
| RecordId<Table, core.output<Id>>
|
|
5273
|
+
| RecordId<Table, Exclude<core.output<Id>, undefined>>
|
|
5262
5274
|
| (Extras extends { output: infer Output } ? Output : never),
|
|
5263
5275
|
// I
|
|
5264
|
-
| RecordId<Table, core.output<Id>>
|
|
5276
|
+
| RecordId<Table, Exclude<core.output<Id>, undefined>>
|
|
5265
5277
|
| StringRecordId
|
|
5266
5278
|
| (Extras extends { input: infer Input } ? Input : never),
|
|
5267
5279
|
// DBO
|
|
@@ -5275,984 +5287,460 @@ export interface ZodSurrealRecordIdInternals<
|
|
|
5275
5287
|
def: ZodSurrealRecordIdDef<Table, Id>;
|
|
5276
5288
|
}
|
|
5277
5289
|
|
|
5278
|
-
type
|
|
5290
|
+
type AnyTableRecordIdTrait<
|
|
5279
5291
|
Tb extends string,
|
|
5280
5292
|
Id extends ZodSurrealRecordIdValue,
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
>
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
table: NoInfer<OverrideTb>,
|
|
5371
|
-
id: NoInfer<OverrideId>,
|
|
5372
|
-
params?: ParseDbContext,
|
|
5373
|
-
): Promise<RecordId<OverrideTb, OverrideId>>;
|
|
5374
|
-
safeFromParts<
|
|
5375
|
-
OverrideTb extends string = Tb,
|
|
5376
|
-
OverrideId extends RecordIdValue = core.output<Id>,
|
|
5377
|
-
>(
|
|
5378
|
-
table: NoInfer<OverrideTb>,
|
|
5379
|
-
id: NoInfer<OverrideId>,
|
|
5380
|
-
params?: ParseDbContext,
|
|
5381
|
-
): classic.ZodSafeParseResult<RecordId<OverrideTb, OverrideId>>;
|
|
5382
|
-
safeFromPartsAsync<
|
|
5383
|
-
OverrideTb extends string = Tb,
|
|
5384
|
-
OverrideId extends RecordIdValue = core.output<Id>,
|
|
5385
|
-
>(
|
|
5386
|
-
table: NoInfer<OverrideTb>,
|
|
5387
|
-
id: NoInfer<OverrideId>,
|
|
5388
|
-
params?: ParseDbContext,
|
|
5389
|
-
): Promise<
|
|
5390
|
-
classic.ZodSafeParseResult<RecordId<OverrideTb, OverrideId>>
|
|
5391
|
-
>;
|
|
5293
|
+
> = {
|
|
5294
|
+
parse<Ctx extends ParseDbContext>(
|
|
5295
|
+
data: unknown,
|
|
5296
|
+
params?: Ctx,
|
|
5297
|
+
): RecordId<
|
|
5298
|
+
Tb,
|
|
5299
|
+
Ctx extends { db: any }
|
|
5300
|
+
? _core_.dboutput<Id>
|
|
5301
|
+
: Exclude<core.output<Id>, undefined>
|
|
5302
|
+
>;
|
|
5303
|
+
parseAsync<Ctx extends ParseDbContext>(
|
|
5304
|
+
data: unknown,
|
|
5305
|
+
params?: Ctx,
|
|
5306
|
+
): Promise<
|
|
5307
|
+
RecordId<
|
|
5308
|
+
Tb,
|
|
5309
|
+
Ctx extends { db: any }
|
|
5310
|
+
? _core_.dboutput<Id>
|
|
5311
|
+
: Exclude<core.output<Id>, undefined>
|
|
5312
|
+
>
|
|
5313
|
+
>;
|
|
5314
|
+
safeParse<Ctx extends ParseDbContext>(
|
|
5315
|
+
data: unknown,
|
|
5316
|
+
params?: Ctx,
|
|
5317
|
+
): classic.ZodSafeParseResult<
|
|
5318
|
+
RecordId<
|
|
5319
|
+
Tb,
|
|
5320
|
+
Ctx extends { db: any }
|
|
5321
|
+
? _core_.dboutput<Id>
|
|
5322
|
+
: Exclude<core.output<Id>, undefined>
|
|
5323
|
+
>
|
|
5324
|
+
>;
|
|
5325
|
+
safeParseAsync<Ctx extends ParseDbContext>(
|
|
5326
|
+
data: unknown,
|
|
5327
|
+
params?: Ctx,
|
|
5328
|
+
): Promise<
|
|
5329
|
+
classic.ZodSafeParseResult<
|
|
5330
|
+
RecordId<
|
|
5331
|
+
Tb,
|
|
5332
|
+
Ctx extends { db: any }
|
|
5333
|
+
? _core_.dboutput<Id>
|
|
5334
|
+
: Exclude<core.output<Id>, undefined>
|
|
5335
|
+
>
|
|
5336
|
+
>
|
|
5337
|
+
>;
|
|
5338
|
+
decode<Ctx extends ParseDbContext>(
|
|
5339
|
+
id: RecordId<Tb, Exclude<core.output<Id>, undefined>> | StringRecordId,
|
|
5340
|
+
params?: Ctx,
|
|
5341
|
+
): RecordId<
|
|
5342
|
+
Tb,
|
|
5343
|
+
Ctx extends { db: any }
|
|
5344
|
+
? _core_.dboutput<Id>
|
|
5345
|
+
: Exclude<core.output<Id>, undefined>
|
|
5346
|
+
>;
|
|
5347
|
+
decodeAsync<Ctx extends ParseDbContext>(
|
|
5348
|
+
id: RecordId<Tb, Exclude<core.output<Id>, undefined>> | StringRecordId,
|
|
5349
|
+
params?: Ctx,
|
|
5350
|
+
): Promise<
|
|
5351
|
+
RecordId<
|
|
5352
|
+
Tb,
|
|
5353
|
+
Ctx extends { db: any }
|
|
5354
|
+
? _core_.dboutput<Id>
|
|
5355
|
+
: Exclude<core.output<Id>, undefined>
|
|
5356
|
+
>
|
|
5357
|
+
>;
|
|
5358
|
+
safeDecode<Ctx extends ParseDbContext>(
|
|
5359
|
+
id: RecordId<Tb, Exclude<core.output<Id>, undefined>> | StringRecordId,
|
|
5360
|
+
params?: Ctx,
|
|
5361
|
+
): classic.ZodSafeParseResult<
|
|
5362
|
+
RecordId<
|
|
5363
|
+
Tb,
|
|
5364
|
+
Ctx extends { db: any }
|
|
5365
|
+
? _core_.dboutput<Id>
|
|
5366
|
+
: Exclude<core.output<Id>, undefined>
|
|
5367
|
+
>
|
|
5368
|
+
>;
|
|
5369
|
+
safeDecodeAsync<Ctx extends ParseDbContext>(
|
|
5370
|
+
id: RecordId<Tb, Exclude<core.output<Id>, undefined>> | StringRecordId,
|
|
5371
|
+
params?: Ctx,
|
|
5372
|
+
): Promise<
|
|
5373
|
+
classic.ZodSafeParseResult<
|
|
5374
|
+
RecordId<
|
|
5375
|
+
Tb,
|
|
5376
|
+
Ctx extends { db: any }
|
|
5377
|
+
? _core_.dboutput<Id>
|
|
5378
|
+
: Exclude<core.output<Id>, undefined>
|
|
5379
|
+
>
|
|
5380
|
+
>
|
|
5381
|
+
>;
|
|
5392
5382
|
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
Tb,
|
|
5403
|
-
core.output<Id>
|
|
5404
|
-
>,
|
|
5405
|
-
>(data: unknown, params?: ParseDbContext): Promise<Override>;
|
|
5406
|
-
safeParse<
|
|
5407
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5408
|
-
Tb,
|
|
5409
|
-
core.output<Id>
|
|
5410
|
-
>,
|
|
5411
|
-
>(
|
|
5412
|
-
data: unknown,
|
|
5413
|
-
params?: ParseDbContext,
|
|
5414
|
-
): classic.ZodSafeParseResult<Override>;
|
|
5415
|
-
safeParseAsync<
|
|
5416
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5417
|
-
Tb,
|
|
5418
|
-
core.output<Id>
|
|
5419
|
-
>,
|
|
5420
|
-
>(
|
|
5421
|
-
data: unknown,
|
|
5422
|
-
params?: ParseDbContext,
|
|
5423
|
-
): Promise<classic.ZodSafeParseResult<Override>>;
|
|
5424
|
-
decode<
|
|
5425
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5426
|
-
Tb,
|
|
5427
|
-
core.output<Id>
|
|
5428
|
-
>,
|
|
5429
|
-
>(
|
|
5430
|
-
id: NoInfer<Override> | StringRecordId,
|
|
5431
|
-
params?: ParseDbContext,
|
|
5432
|
-
): Override;
|
|
5433
|
-
decodeAsync<
|
|
5434
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5435
|
-
Tb,
|
|
5436
|
-
core.output<Id>
|
|
5437
|
-
>,
|
|
5438
|
-
>(
|
|
5439
|
-
id: NoInfer<Override> | StringRecordId,
|
|
5440
|
-
params?: ParseDbContext,
|
|
5441
|
-
): Promise<Override>;
|
|
5442
|
-
safeDecode<
|
|
5443
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5444
|
-
Tb,
|
|
5445
|
-
core.output<Id>
|
|
5446
|
-
>,
|
|
5447
|
-
>(
|
|
5448
|
-
id: NoInfer<Override> | StringRecordId,
|
|
5449
|
-
params?: ParseDbContext,
|
|
5450
|
-
): classic.ZodSafeParseResult<Override>;
|
|
5451
|
-
safeDecodeAsync<
|
|
5452
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5453
|
-
Tb,
|
|
5454
|
-
core.output<Id>
|
|
5455
|
-
>,
|
|
5456
|
-
>(
|
|
5457
|
-
id: NoInfer<Override> | StringRecordId,
|
|
5458
|
-
params?: ParseDbContext,
|
|
5459
|
-
): Promise<classic.ZodSafeParseResult<Override>>;
|
|
5460
|
-
|
|
5461
|
-
// From Parts - Single Parameter
|
|
5462
|
-
fromParts<
|
|
5463
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5383
|
+
fromParts<Ctx extends ParseDbContext>(
|
|
5384
|
+
table: Tb,
|
|
5385
|
+
id: Ctx extends { db: any }
|
|
5386
|
+
? core.output<Id>
|
|
5387
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5388
|
+
params?: Ctx,
|
|
5389
|
+
): undefined extends core.output<Id>
|
|
5390
|
+
?
|
|
5391
|
+
| RecordId<
|
|
5464
5392
|
Tb,
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5393
|
+
// @ts-expect-error: output intersected above
|
|
5394
|
+
Ctx extends { db: any }
|
|
5395
|
+
? _core_.dboutput<Id>
|
|
5396
|
+
: Exclude<core.output<Id>, undefined>
|
|
5397
|
+
>
|
|
5398
|
+
| undefined
|
|
5399
|
+
: RecordId<
|
|
5400
|
+
Tb,
|
|
5401
|
+
Ctx extends { db: any }
|
|
5402
|
+
? _core_.dboutput<Id>
|
|
5403
|
+
: Exclude<core.output<Id>, undefined>
|
|
5404
|
+
>;
|
|
5405
|
+
fromPartsAsync<Ctx extends ParseDbContext>(
|
|
5406
|
+
table: Tb,
|
|
5407
|
+
id: Ctx extends { db: any }
|
|
5408
|
+
? core.output<Id>
|
|
5409
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5410
|
+
params?: Ctx,
|
|
5411
|
+
): undefined extends core.output<Id>
|
|
5412
|
+
? Promise<
|
|
5413
|
+
| RecordId<
|
|
5474
5414
|
Tb,
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5415
|
+
// @ts-expect-error: output intersected above
|
|
5416
|
+
Ctx extends { db: any }
|
|
5417
|
+
? _core_.dboutput<Id>
|
|
5418
|
+
: Exclude<core.output<Id>, undefined>
|
|
5419
|
+
>
|
|
5420
|
+
| undefined
|
|
5421
|
+
>
|
|
5422
|
+
: Promise<
|
|
5423
|
+
RecordId<
|
|
5424
|
+
Tb,
|
|
5425
|
+
Ctx extends { db: any }
|
|
5426
|
+
? _core_.dboutput<Id>
|
|
5427
|
+
: Exclude<core.output<Id>, undefined>
|
|
5428
|
+
>
|
|
5429
|
+
>;
|
|
5430
|
+
safeFromParts<Ctx extends ParseDbContext>(
|
|
5431
|
+
table: Tb,
|
|
5432
|
+
id: Ctx extends { db: any }
|
|
5433
|
+
? core.output<Id>
|
|
5434
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5435
|
+
params?: Ctx,
|
|
5436
|
+
): undefined extends core.output<Id>
|
|
5437
|
+
? classic.ZodSafeParseResult<
|
|
5438
|
+
| RecordId<
|
|
5484
5439
|
Tb,
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5440
|
+
// @ts-expect-error: output intersected above
|
|
5441
|
+
Ctx extends { db: any }
|
|
5442
|
+
? _core_.dboutput<Id>
|
|
5443
|
+
: Exclude<core.output<Id>, undefined>
|
|
5444
|
+
>
|
|
5445
|
+
| undefined
|
|
5446
|
+
>
|
|
5447
|
+
: classic.ZodSafeParseResult<
|
|
5448
|
+
RecordId<
|
|
5449
|
+
Tb,
|
|
5450
|
+
Ctx extends { db: any }
|
|
5451
|
+
? _core_.dboutput<Id>
|
|
5452
|
+
: Exclude<core.output<Id>, undefined>
|
|
5453
|
+
>
|
|
5454
|
+
>;
|
|
5455
|
+
safeFromPartsAsync<Ctx extends ParseDbContext>(
|
|
5456
|
+
table: Tb,
|
|
5457
|
+
id: Ctx extends { db: any }
|
|
5458
|
+
? core.output<Id>
|
|
5459
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5460
|
+
params?: Ctx,
|
|
5461
|
+
): undefined extends core.output<Id>
|
|
5462
|
+
? Promise<
|
|
5463
|
+
classic.ZodSafeParseResult<
|
|
5464
|
+
| RecordId<
|
|
5465
|
+
Tb,
|
|
5466
|
+
// @ts-expect-error: output intersected above
|
|
5467
|
+
Ctx extends { db: any }
|
|
5468
|
+
? _core_.dboutput<Id>
|
|
5469
|
+
: Exclude<core.output<Id>, undefined>
|
|
5470
|
+
>
|
|
5471
|
+
| undefined
|
|
5472
|
+
>
|
|
5473
|
+
>
|
|
5474
|
+
: Promise<
|
|
5475
|
+
classic.ZodSafeParseResult<
|
|
5476
|
+
RecordId<
|
|
5494
5477
|
Tb,
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
}
|
|
5503
|
-
: // Any Table + Typed Value:
|
|
5504
|
-
{
|
|
5505
|
-
// Clone - Split Parameters
|
|
5506
|
-
parse<OverrideTb extends string = Tb>(
|
|
5507
|
-
data: unknown,
|
|
5508
|
-
params?: ParseDbContext,
|
|
5509
|
-
): RecordId<OverrideTb, core.output<Id>>;
|
|
5510
|
-
parseAsync<OverrideTb extends string = Tb>(
|
|
5511
|
-
data: unknown,
|
|
5512
|
-
params?: ParseDbContext,
|
|
5513
|
-
): Promise<RecordId<OverrideTb, core.output<Id>>>;
|
|
5514
|
-
safeParse<OverrideTb extends string = Tb>(
|
|
5515
|
-
data: unknown,
|
|
5516
|
-
params?: ParseDbContext,
|
|
5517
|
-
): classic.ZodSafeParseResult<RecordId<OverrideTb, core.output<Id>>>;
|
|
5518
|
-
safeParseAsync<OverrideTb extends string = Tb>(
|
|
5519
|
-
data: unknown,
|
|
5520
|
-
params?: ParseDbContext,
|
|
5521
|
-
): Promise<
|
|
5522
|
-
classic.ZodSafeParseResult<RecordId<OverrideTb, core.output<Id>>>
|
|
5523
|
-
>;
|
|
5524
|
-
decode<OverrideTb extends string = Tb>(
|
|
5525
|
-
data: RecordId<NoInfer<OverrideTb>, core.output<Id>> | StringRecordId,
|
|
5526
|
-
params?: ParseDbContext,
|
|
5527
|
-
): RecordId<OverrideTb, core.output<Id>>;
|
|
5528
|
-
decodeAsync<OverrideTb extends string = Tb>(
|
|
5529
|
-
data: RecordId<NoInfer<OverrideTb>, core.output<Id>> | StringRecordId,
|
|
5530
|
-
params?: ParseDbContext,
|
|
5531
|
-
): Promise<RecordId<OverrideTb, core.output<Id>>>;
|
|
5532
|
-
safeDecode<OverrideTb extends string = Tb>(
|
|
5533
|
-
data: RecordId<NoInfer<OverrideTb>, core.output<Id>> | StringRecordId,
|
|
5534
|
-
params?: ParseDbContext,
|
|
5535
|
-
): classic.ZodSafeParseResult<RecordId<OverrideTb, core.output<Id>>>;
|
|
5536
|
-
safeDecodeAsync<OverrideTb extends string = Tb>(
|
|
5537
|
-
data: RecordId<NoInfer<OverrideTb>, core.output<Id>> | StringRecordId,
|
|
5538
|
-
params?: ParseDbContext,
|
|
5539
|
-
): Promise<
|
|
5540
|
-
classic.ZodSafeParseResult<RecordId<OverrideTb, core.output<Id>>>
|
|
5541
|
-
>;
|
|
5478
|
+
Ctx extends { db: any }
|
|
5479
|
+
? _core_.dboutput<Id>
|
|
5480
|
+
: Exclude<core.output<Id>, undefined>
|
|
5481
|
+
>
|
|
5482
|
+
>
|
|
5483
|
+
>;
|
|
5484
|
+
};
|
|
5542
5485
|
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5486
|
+
type SpecificTableRecordIdTrait<
|
|
5487
|
+
Tb extends string,
|
|
5488
|
+
Id extends ZodSurrealRecordIdValue,
|
|
5489
|
+
> = {
|
|
5490
|
+
parse<Ctx extends ParseDbContext>(
|
|
5491
|
+
data: unknown,
|
|
5492
|
+
params?: Ctx,
|
|
5493
|
+
): RecordId<
|
|
5494
|
+
Tb,
|
|
5495
|
+
Ctx extends { db: any }
|
|
5496
|
+
? _core_.dboutput<Id>
|
|
5497
|
+
: Exclude<core.output<Id>, undefined>
|
|
5498
|
+
>;
|
|
5499
|
+
parseAsync<Ctx extends ParseDbContext>(
|
|
5500
|
+
data: unknown,
|
|
5501
|
+
params?: Ctx,
|
|
5502
|
+
): Promise<
|
|
5503
|
+
RecordId<
|
|
5504
|
+
Tb,
|
|
5505
|
+
Ctx extends { db: any }
|
|
5506
|
+
? _core_.dboutput<Id>
|
|
5507
|
+
: Exclude<core.output<Id>, undefined>
|
|
5508
|
+
>
|
|
5509
|
+
>;
|
|
5510
|
+
safeParse<Ctx extends ParseDbContext>(
|
|
5511
|
+
data: unknown,
|
|
5512
|
+
params?: Ctx,
|
|
5513
|
+
): classic.ZodSafeParseResult<
|
|
5514
|
+
RecordId<
|
|
5515
|
+
Tb,
|
|
5516
|
+
Ctx extends { db: any }
|
|
5517
|
+
? _core_.dboutput<Id>
|
|
5518
|
+
: Exclude<core.output<Id>, undefined>
|
|
5519
|
+
>
|
|
5520
|
+
>;
|
|
5521
|
+
safeParseAsync<Ctx extends ParseDbContext>(
|
|
5522
|
+
data: unknown,
|
|
5523
|
+
params?: Ctx,
|
|
5524
|
+
): Promise<
|
|
5525
|
+
classic.ZodSafeParseResult<
|
|
5526
|
+
RecordId<
|
|
5527
|
+
Tb,
|
|
5528
|
+
Ctx extends { db: any }
|
|
5529
|
+
? _core_.dboutput<Id>
|
|
5530
|
+
: Exclude<core.output<Id>, undefined>
|
|
5531
|
+
>
|
|
5532
|
+
>
|
|
5533
|
+
>;
|
|
5534
|
+
decode<Ctx extends ParseDbContext>(
|
|
5535
|
+
data: core.output<Id> | StringRecordId,
|
|
5536
|
+
params?: Ctx,
|
|
5537
|
+
): RecordId<
|
|
5538
|
+
Tb,
|
|
5539
|
+
Ctx extends { db: any }
|
|
5540
|
+
? _core_.dboutput<Id>
|
|
5541
|
+
: Exclude<core.output<Id>, undefined>
|
|
5542
|
+
>;
|
|
5543
|
+
decodeAsync<Ctx extends ParseDbContext>(
|
|
5544
|
+
data: core.output<Id> | StringRecordId,
|
|
5545
|
+
params?: Ctx,
|
|
5546
|
+
): Promise<
|
|
5547
|
+
RecordId<
|
|
5548
|
+
Tb,
|
|
5549
|
+
Ctx extends { db: any }
|
|
5550
|
+
? _core_.dboutput<Id>
|
|
5551
|
+
: Exclude<core.output<Id>, undefined>
|
|
5552
|
+
>
|
|
5553
|
+
>;
|
|
5554
|
+
safeDecode<Ctx extends ParseDbContext>(
|
|
5555
|
+
data: core.output<Id> | StringRecordId,
|
|
5556
|
+
params?: Ctx,
|
|
5557
|
+
): classic.ZodSafeParseResult<
|
|
5558
|
+
RecordId<
|
|
5559
|
+
Tb,
|
|
5560
|
+
Ctx extends { db: any }
|
|
5561
|
+
? _core_.dboutput<Id>
|
|
5562
|
+
: Exclude<core.output<Id>, undefined>
|
|
5563
|
+
>
|
|
5564
|
+
>;
|
|
5565
|
+
safeDecodeAsync<Ctx extends ParseDbContext>(
|
|
5566
|
+
data: core.output<Id> | StringRecordId,
|
|
5567
|
+
params?: Ctx,
|
|
5568
|
+
): Promise<
|
|
5569
|
+
classic.ZodSafeParseResult<
|
|
5570
|
+
RecordId<
|
|
5571
|
+
Tb,
|
|
5572
|
+
Ctx extends { db: any }
|
|
5573
|
+
? _core_.dboutput<Id>
|
|
5574
|
+
: Exclude<core.output<Id>, undefined>
|
|
5575
|
+
>
|
|
5576
|
+
>
|
|
5577
|
+
>;
|
|
5566
5578
|
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
): RecordId<Override["table"]["name"], core.output<Id>>;
|
|
5577
|
-
parseAsync<
|
|
5578
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5579
|
-
Tb,
|
|
5580
|
-
core.output<Id>
|
|
5581
|
-
>,
|
|
5582
|
-
>(
|
|
5583
|
-
data: unknown,
|
|
5584
|
-
params?: ParseDbContext,
|
|
5585
|
-
): Promise<RecordId<Override["table"]["name"], core.output<Id>>>;
|
|
5586
|
-
safeParse<
|
|
5587
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5588
|
-
Tb,
|
|
5589
|
-
core.output<Id>
|
|
5590
|
-
>,
|
|
5591
|
-
>(
|
|
5592
|
-
data: unknown,
|
|
5593
|
-
params?: ParseDbContext,
|
|
5594
|
-
): classic.ZodSafeParseResult<
|
|
5595
|
-
RecordId<Override["table"]["name"], core.output<Id>>
|
|
5596
|
-
>;
|
|
5597
|
-
safeParseAsync<
|
|
5598
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5579
|
+
fromParts<Ctx extends ParseDbContext>(
|
|
5580
|
+
table: Tb,
|
|
5581
|
+
id: Ctx extends { db: any }
|
|
5582
|
+
? core.output<Id>
|
|
5583
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5584
|
+
params?: Ctx,
|
|
5585
|
+
): undefined extends core.output<Id>
|
|
5586
|
+
?
|
|
5587
|
+
| RecordId<
|
|
5599
5588
|
Tb,
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
params?: ParseDbContext,
|
|
5605
|
-
): Promise<
|
|
5606
|
-
classic.ZodSafeParseResult<
|
|
5607
|
-
RecordId<Override["table"]["name"], core.output<Id>>
|
|
5589
|
+
// @ts-expect-error: output intersected above
|
|
5590
|
+
Ctx extends { db: any }
|
|
5591
|
+
? _core_.dboutput<Id>
|
|
5592
|
+
: Exclude<core.output<Id>, undefined>
|
|
5608
5593
|
>
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
>,
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
>,
|
|
5626
|
-
>(
|
|
5627
|
-
data:
|
|
5628
|
-
| RecordId<Override["table"]["name"], core.output<Id>>
|
|
5629
|
-
| StringRecordId,
|
|
5630
|
-
params?: ParseDbContext,
|
|
5631
|
-
): Promise<RecordId<Override["table"]["name"], core.output<Id>>>;
|
|
5632
|
-
safeDecode<
|
|
5633
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5634
|
-
Tb,
|
|
5635
|
-
core.output<Id>
|
|
5636
|
-
>,
|
|
5637
|
-
>(
|
|
5638
|
-
data:
|
|
5639
|
-
| RecordId<Override["table"]["name"], core.output<Id>>
|
|
5640
|
-
| StringRecordId,
|
|
5641
|
-
params?: ParseDbContext,
|
|
5642
|
-
): classic.ZodSafeParseResult<
|
|
5643
|
-
RecordId<Override["table"]["name"], core.output<Id>>
|
|
5644
|
-
>;
|
|
5645
|
-
safeDecodeAsync<
|
|
5646
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5594
|
+
| undefined
|
|
5595
|
+
: RecordId<
|
|
5596
|
+
Tb,
|
|
5597
|
+
Ctx extends { db: any }
|
|
5598
|
+
? _core_.dboutput<Id>
|
|
5599
|
+
: Exclude<core.output<Id>, undefined>
|
|
5600
|
+
>;
|
|
5601
|
+
fromPartsAsync<Ctx extends ParseDbContext>(
|
|
5602
|
+
table: Tb,
|
|
5603
|
+
id: Ctx extends { db: any }
|
|
5604
|
+
? core.output<Id>
|
|
5605
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5606
|
+
params?: Ctx,
|
|
5607
|
+
): undefined extends core.output<Id>
|
|
5608
|
+
? Promise<
|
|
5609
|
+
| RecordId<
|
|
5647
5610
|
Tb,
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
| RecordId<Override["table"]["name"], core.output<Id>>
|
|
5653
|
-
| StringRecordId,
|
|
5654
|
-
params?: ParseDbContext,
|
|
5655
|
-
): Promise<
|
|
5656
|
-
classic.ZodSafeParseResult<
|
|
5657
|
-
RecordId<Override["table"]["name"], core.output<Id>>
|
|
5611
|
+
// @ts-expect-error: output intersected above
|
|
5612
|
+
Ctx extends { db: any }
|
|
5613
|
+
? _core_.dboutput<Id>
|
|
5614
|
+
: Exclude<core.output<Id>, undefined>
|
|
5658
5615
|
>
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
>
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
table: NoInfer<Override["table"]["name"]>,
|
|
5679
|
-
id: NoInfer<core.output<Id>>,
|
|
5680
|
-
params?: ParseDbContext,
|
|
5681
|
-
): Promise<RecordId<Override["table"]["name"], core.output<Id>>>;
|
|
5682
|
-
safeFromParts<
|
|
5683
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5684
|
-
Tb,
|
|
5685
|
-
core.output<Id>
|
|
5686
|
-
>,
|
|
5687
|
-
>(
|
|
5688
|
-
table: NoInfer<Override["table"]["name"]>,
|
|
5689
|
-
id: NoInfer<core.output<Id>>,
|
|
5690
|
-
params?: ParseDbContext,
|
|
5691
|
-
): classic.ZodSafeParseResult<
|
|
5692
|
-
RecordId<Override["table"]["name"], core.output<Id>>
|
|
5693
|
-
>;
|
|
5694
|
-
safeFromPartsAsync<
|
|
5695
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5616
|
+
| undefined
|
|
5617
|
+
>
|
|
5618
|
+
: Promise<
|
|
5619
|
+
RecordId<
|
|
5620
|
+
Tb,
|
|
5621
|
+
Ctx extends { db: any }
|
|
5622
|
+
? _core_.dboutput<Id>
|
|
5623
|
+
: Exclude<core.output<Id>, undefined>
|
|
5624
|
+
>
|
|
5625
|
+
>;
|
|
5626
|
+
safeFromParts<Ctx extends ParseDbContext>(
|
|
5627
|
+
table: Tb,
|
|
5628
|
+
id: Ctx extends { db: any }
|
|
5629
|
+
? core.output<Id>
|
|
5630
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5631
|
+
params?: Ctx,
|
|
5632
|
+
): undefined extends core.output<Id>
|
|
5633
|
+
? classic.ZodSafeParseResult<
|
|
5634
|
+
| RecordId<
|
|
5696
5635
|
Tb,
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
id: NoInfer<core.output<Id>>,
|
|
5702
|
-
params?: ParseDbContext,
|
|
5703
|
-
): Promise<
|
|
5704
|
-
classic.ZodSafeParseResult<
|
|
5705
|
-
RecordId<Override["table"]["name"], core.output<Id>>
|
|
5636
|
+
// @ts-expect-error: output intersected above
|
|
5637
|
+
Ctx extends { db: any }
|
|
5638
|
+
? _core_.dboutput<Id>
|
|
5639
|
+
: Exclude<core.output<Id>, undefined>
|
|
5706
5640
|
>
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
safeParseAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5728
|
-
data: unknown,
|
|
5729
|
-
params?: ParseDbContext,
|
|
5730
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>>;
|
|
5731
|
-
decode<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5732
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
5733
|
-
params?: ParseDbContext,
|
|
5734
|
-
): RecordId<Tb, OverrideId>;
|
|
5735
|
-
decodeAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5736
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
5737
|
-
params?: ParseDbContext,
|
|
5738
|
-
): Promise<RecordId<Tb, OverrideId>>;
|
|
5739
|
-
safeDecode<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5740
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
5741
|
-
params?: ParseDbContext,
|
|
5742
|
-
): classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>;
|
|
5743
|
-
safeDecodeAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5744
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
5745
|
-
params?: ParseDbContext,
|
|
5746
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>>;
|
|
5747
|
-
|
|
5748
|
-
// From Parts - Split Parameters
|
|
5749
|
-
fromParts<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5750
|
-
table: NoInfer<Tb>,
|
|
5751
|
-
id: NoInfer<OverrideId>,
|
|
5752
|
-
params?: ParseDbContext,
|
|
5753
|
-
): RecordId<Tb, OverrideId>;
|
|
5754
|
-
fromPartsAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5755
|
-
table: NoInfer<Tb>,
|
|
5756
|
-
id: NoInfer<OverrideId>,
|
|
5757
|
-
params?: ParseDbContext,
|
|
5758
|
-
): Promise<RecordId<Tb, OverrideId>>;
|
|
5759
|
-
safeFromParts<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5760
|
-
table: NoInfer<Tb>,
|
|
5761
|
-
id: NoInfer<OverrideId>,
|
|
5762
|
-
params?: ParseDbContext,
|
|
5763
|
-
): classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>;
|
|
5764
|
-
safeFromPartsAsync<
|
|
5765
|
-
OverrideId extends RecordIdValue = core.output<Id>,
|
|
5766
|
-
>(
|
|
5767
|
-
table: NoInfer<Tb>,
|
|
5768
|
-
id: NoInfer<OverrideId>,
|
|
5769
|
-
params?: ParseDbContext,
|
|
5770
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>>;
|
|
5771
|
-
|
|
5772
|
-
// From Id - Split Parameters
|
|
5773
|
-
fromId<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5774
|
-
id: NoInfer<OverrideId>,
|
|
5775
|
-
params?: ParseDbContext,
|
|
5776
|
-
): RecordId<Tb, OverrideId>;
|
|
5777
|
-
fromIdAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5778
|
-
id: NoInfer<OverrideId>,
|
|
5779
|
-
params?: ParseDbContext,
|
|
5780
|
-
): Promise<RecordId<Tb, OverrideId>>;
|
|
5781
|
-
safeFromId<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5782
|
-
id: NoInfer<OverrideId>,
|
|
5783
|
-
params?: ParseDbContext,
|
|
5784
|
-
): classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>;
|
|
5785
|
-
safeFromIdAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
5786
|
-
id: NoInfer<OverrideId>,
|
|
5787
|
-
params?: ParseDbContext,
|
|
5788
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>>;
|
|
5789
|
-
|
|
5790
|
-
// Clone - Single Parameter
|
|
5791
|
-
parse<
|
|
5792
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5793
|
-
Tb,
|
|
5794
|
-
core.output<Id>
|
|
5795
|
-
>,
|
|
5796
|
-
>(
|
|
5797
|
-
data: unknown,
|
|
5798
|
-
params?: ParseDbContext,
|
|
5799
|
-
): RecordId<Tb, Override["id"]>;
|
|
5800
|
-
parseAsync<
|
|
5801
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5802
|
-
Tb,
|
|
5803
|
-
core.output<Id>
|
|
5804
|
-
>,
|
|
5805
|
-
>(
|
|
5806
|
-
data: unknown,
|
|
5807
|
-
params?: ParseDbContext,
|
|
5808
|
-
): Promise<RecordId<Tb, Override["id"]>>;
|
|
5809
|
-
safeParse<
|
|
5810
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5811
|
-
Tb,
|
|
5812
|
-
core.output<Id>
|
|
5813
|
-
>,
|
|
5814
|
-
>(
|
|
5815
|
-
data: unknown,
|
|
5816
|
-
params?: ParseDbContext,
|
|
5817
|
-
): classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>;
|
|
5818
|
-
safeParseAsync<
|
|
5819
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5820
|
-
Tb,
|
|
5821
|
-
core.output<Id>
|
|
5822
|
-
>,
|
|
5823
|
-
>(
|
|
5824
|
-
data: unknown,
|
|
5825
|
-
params?: ParseDbContext,
|
|
5826
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>>;
|
|
5827
|
-
decode<
|
|
5828
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5829
|
-
Tb,
|
|
5830
|
-
core.output<Id>
|
|
5831
|
-
>,
|
|
5832
|
-
>(
|
|
5833
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
5834
|
-
params?: ParseDbContext,
|
|
5835
|
-
): RecordId<Tb, Override["id"]>;
|
|
5836
|
-
decodeAsync<
|
|
5837
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5838
|
-
Tb,
|
|
5839
|
-
core.output<Id>
|
|
5840
|
-
>,
|
|
5841
|
-
>(
|
|
5842
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
5843
|
-
params?: ParseDbContext,
|
|
5844
|
-
): Promise<RecordId<Tb, Override["id"]>>;
|
|
5845
|
-
safeDecode<
|
|
5846
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5847
|
-
Tb,
|
|
5848
|
-
core.output<Id>
|
|
5849
|
-
>,
|
|
5850
|
-
>(
|
|
5851
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
5852
|
-
params?: ParseDbContext,
|
|
5853
|
-
): classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>;
|
|
5854
|
-
safeDecodeAsync<
|
|
5855
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5856
|
-
Tb,
|
|
5857
|
-
core.output<Id>
|
|
5858
|
-
>,
|
|
5859
|
-
>(
|
|
5860
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
5861
|
-
params?: ParseDbContext,
|
|
5862
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>>;
|
|
5863
|
-
|
|
5864
|
-
// From Parts - Single Parameter
|
|
5865
|
-
fromParts<
|
|
5866
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5867
|
-
Tb,
|
|
5868
|
-
core.output<Id>
|
|
5869
|
-
>,
|
|
5870
|
-
>(
|
|
5871
|
-
table: NoInfer<Tb>,
|
|
5872
|
-
id: NoInfer<Override["id"]>,
|
|
5873
|
-
params?: ParseDbContext,
|
|
5874
|
-
): RecordId<Tb, Override["id"]>;
|
|
5875
|
-
fromPartsAsync<
|
|
5876
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5877
|
-
Tb,
|
|
5878
|
-
core.output<Id>
|
|
5879
|
-
>,
|
|
5880
|
-
>(
|
|
5881
|
-
table: NoInfer<Tb>,
|
|
5882
|
-
id: NoInfer<Override["id"]>,
|
|
5883
|
-
params?: ParseDbContext,
|
|
5884
|
-
): Promise<RecordId<Tb, Override["id"]>>;
|
|
5885
|
-
safeFromParts<
|
|
5886
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5887
|
-
Tb,
|
|
5888
|
-
core.output<Id>
|
|
5889
|
-
>,
|
|
5890
|
-
>(
|
|
5891
|
-
table: NoInfer<Tb>,
|
|
5892
|
-
id: NoInfer<Override["id"]>,
|
|
5893
|
-
params?: ParseDbContext,
|
|
5894
|
-
): classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>;
|
|
5895
|
-
safeFromPartsAsync<
|
|
5896
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5897
|
-
Tb,
|
|
5898
|
-
core.output<Id>
|
|
5899
|
-
>,
|
|
5900
|
-
>(
|
|
5901
|
-
table: NoInfer<Tb>,
|
|
5902
|
-
id: NoInfer<Override["id"]>,
|
|
5903
|
-
params?: ParseDbContext,
|
|
5904
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>>;
|
|
5905
|
-
|
|
5906
|
-
// From Id - Single Parameter
|
|
5907
|
-
fromId<
|
|
5908
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5909
|
-
Tb,
|
|
5910
|
-
core.output<Id>
|
|
5911
|
-
>,
|
|
5912
|
-
>(
|
|
5913
|
-
id: NoInfer<Override["id"]>,
|
|
5914
|
-
params?: ParseDbContext,
|
|
5915
|
-
): RecordId<Tb, Override["id"]>;
|
|
5916
|
-
fromIdAsync<
|
|
5917
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5918
|
-
Tb,
|
|
5919
|
-
core.output<Id>
|
|
5920
|
-
>,
|
|
5921
|
-
>(
|
|
5922
|
-
id: NoInfer<Override["id"]>,
|
|
5923
|
-
params?: ParseDbContext,
|
|
5924
|
-
): Promise<RecordId<Tb, Override["id"]>>;
|
|
5925
|
-
safeFromId<
|
|
5926
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5927
|
-
Tb,
|
|
5928
|
-
core.output<Id>
|
|
5929
|
-
>,
|
|
5930
|
-
>(
|
|
5931
|
-
id: NoInfer<Override["id"]>,
|
|
5932
|
-
params?: ParseDbContext,
|
|
5933
|
-
): classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>;
|
|
5934
|
-
safeFromIdAsync<
|
|
5935
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5936
|
-
Tb,
|
|
5937
|
-
core.output<Id>
|
|
5938
|
-
>,
|
|
5939
|
-
>(
|
|
5940
|
-
id: NoInfer<Override["id"]>,
|
|
5941
|
-
params?: ParseDbContext,
|
|
5942
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>>;
|
|
5943
|
-
}
|
|
5944
|
-
: // Specific Table + Typed Value
|
|
5945
|
-
{
|
|
5946
|
-
// Clone - Non Overridable
|
|
5947
|
-
parse(
|
|
5948
|
-
data: unknown,
|
|
5949
|
-
params?: ParseDbContext,
|
|
5950
|
-
): RecordId<Tb, core.output<Id>>;
|
|
5951
|
-
parseAsync(
|
|
5952
|
-
data: unknown,
|
|
5953
|
-
params?: ParseDbContext,
|
|
5954
|
-
): Promise<RecordId<Tb, core.output<Id>>>;
|
|
5955
|
-
safeParse(
|
|
5956
|
-
data: unknown,
|
|
5957
|
-
params?: ParseDbContext,
|
|
5958
|
-
): classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>;
|
|
5959
|
-
safeParseAsync(
|
|
5960
|
-
data: unknown,
|
|
5961
|
-
params?: ParseDbContext,
|
|
5962
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>>;
|
|
5963
|
-
decode(
|
|
5964
|
-
data: RecordId<Tb, core.output<Id>> | StringRecordId,
|
|
5965
|
-
params?: ParseDbContext,
|
|
5966
|
-
): RecordId<Tb, core.output<Id>>;
|
|
5967
|
-
decodeAsync(
|
|
5968
|
-
data: RecordId<Tb, core.output<Id>> | StringRecordId,
|
|
5969
|
-
params?: ParseDbContext,
|
|
5970
|
-
): Promise<RecordId<Tb, core.output<Id>>>;
|
|
5971
|
-
safeDecode(
|
|
5972
|
-
data: RecordId<Tb, core.output<Id>> | StringRecordId,
|
|
5973
|
-
params?: ParseDbContext,
|
|
5974
|
-
): classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>;
|
|
5975
|
-
safeDecodeAsync(
|
|
5976
|
-
data: RecordId<Tb, core.output<Id>> | StringRecordId,
|
|
5977
|
-
params?: ParseDbContext,
|
|
5978
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>>;
|
|
5979
|
-
|
|
5980
|
-
// From Parts - Non Overridable
|
|
5981
|
-
fromParts(
|
|
5982
|
-
table: NoInfer<Tb>,
|
|
5983
|
-
id: NoInfer<core.output<Id>>,
|
|
5984
|
-
params?: ParseDbContext,
|
|
5985
|
-
): RecordId<Tb, core.output<Id>>;
|
|
5986
|
-
fromPartsAsync(
|
|
5987
|
-
table: NoInfer<Tb>,
|
|
5988
|
-
id: NoInfer<core.output<Id>>,
|
|
5989
|
-
params?: ParseDbContext,
|
|
5990
|
-
): Promise<RecordId<Tb, core.output<Id>>>;
|
|
5991
|
-
safeFromParts(
|
|
5992
|
-
table: NoInfer<Tb>,
|
|
5993
|
-
id: NoInfer<core.output<Id>>,
|
|
5994
|
-
params?: ParseDbContext,
|
|
5995
|
-
): classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>;
|
|
5996
|
-
safeFromPartsAsync(
|
|
5997
|
-
table: NoInfer<Tb>,
|
|
5998
|
-
id: NoInfer<core.output<Id>>,
|
|
5999
|
-
params?: ParseDbContext,
|
|
6000
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>>;
|
|
6001
|
-
|
|
6002
|
-
// From Id - Non Overridable
|
|
6003
|
-
fromId(
|
|
6004
|
-
id: NoInfer<core.output<Id>>,
|
|
6005
|
-
params?: ParseDbContext,
|
|
6006
|
-
): RecordId<Tb, core.output<Id>>;
|
|
6007
|
-
fromIdAsync(
|
|
6008
|
-
id: NoInfer<core.output<Id>>,
|
|
6009
|
-
params?: ParseDbContext,
|
|
6010
|
-
): Promise<RecordId<Tb, core.output<Id>>>;
|
|
6011
|
-
safeFromId(
|
|
6012
|
-
id: NoInfer<core.output<Id>>,
|
|
6013
|
-
params?: ParseDbContext,
|
|
6014
|
-
): classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>;
|
|
6015
|
-
safeFromIdAsync(
|
|
6016
|
-
id: NoInfer<core.output<Id>>,
|
|
6017
|
-
params?: ParseDbContext,
|
|
6018
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, core.output<Id>>>>;
|
|
6019
|
-
}
|
|
6020
|
-
: // Multiple Tables:
|
|
6021
|
-
ZodSurrealRecordIdValue extends Id
|
|
6022
|
-
? // Multiple Tables + Any Value:
|
|
6023
|
-
{
|
|
6024
|
-
// Clone - Split Parameters
|
|
6025
|
-
parse<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6026
|
-
data: unknown,
|
|
6027
|
-
params?: ParseDbContext,
|
|
6028
|
-
): RecordId<Tb, OverrideId>;
|
|
6029
|
-
parseAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6030
|
-
data: unknown,
|
|
6031
|
-
params?: ParseDbContext,
|
|
6032
|
-
): Promise<RecordId<Tb, OverrideId>>;
|
|
6033
|
-
safeParse<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6034
|
-
data: unknown,
|
|
6035
|
-
params?: ParseDbContext,
|
|
6036
|
-
): classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>;
|
|
6037
|
-
safeParseAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6038
|
-
data: unknown,
|
|
6039
|
-
params?: ParseDbContext,
|
|
6040
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>>;
|
|
6041
|
-
decode<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6042
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
6043
|
-
params?: ParseDbContext,
|
|
6044
|
-
): RecordId<Tb, OverrideId>;
|
|
6045
|
-
decodeAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6046
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
6047
|
-
params?: ParseDbContext,
|
|
6048
|
-
): Promise<RecordId<Tb, OverrideId>>;
|
|
6049
|
-
safeDecode<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6050
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
6051
|
-
params?: ParseDbContext,
|
|
6052
|
-
): classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>;
|
|
6053
|
-
safeDecodeAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6054
|
-
data: RecordId<Tb, NoInfer<OverrideId>> | StringRecordId,
|
|
6055
|
-
params?: ParseDbContext,
|
|
6056
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>>;
|
|
6057
|
-
|
|
6058
|
-
// From Parts - Split Parameters
|
|
6059
|
-
fromParts<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6060
|
-
table: NoInfer<Tb>,
|
|
6061
|
-
id: NoInfer<OverrideId>,
|
|
6062
|
-
params?: ParseDbContext,
|
|
6063
|
-
): RecordId<Tb, OverrideId>;
|
|
6064
|
-
fromPartsAsync<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6065
|
-
table: NoInfer<Tb>,
|
|
6066
|
-
id: NoInfer<OverrideId>,
|
|
6067
|
-
params?: ParseDbContext,
|
|
6068
|
-
): Promise<RecordId<Tb, OverrideId>>;
|
|
6069
|
-
safeFromParts<OverrideId extends RecordIdValue = core.output<Id>>(
|
|
6070
|
-
table: NoInfer<Tb>,
|
|
6071
|
-
id: NoInfer<OverrideId>,
|
|
6072
|
-
params?: ParseDbContext,
|
|
6073
|
-
): classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>;
|
|
6074
|
-
safeFromPartsAsync<
|
|
6075
|
-
OverrideId extends RecordIdValue = core.output<Id>,
|
|
6076
|
-
>(
|
|
6077
|
-
table: NoInfer<Tb>,
|
|
6078
|
-
id: NoInfer<OverrideId>,
|
|
6079
|
-
params?: ParseDbContext,
|
|
6080
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, OverrideId>>>;
|
|
6081
|
-
|
|
6082
|
-
// Clone - Single Parameter
|
|
6083
|
-
parse<
|
|
6084
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6085
|
-
Tb,
|
|
6086
|
-
core.output<Id>
|
|
6087
|
-
>,
|
|
6088
|
-
>(
|
|
6089
|
-
data: unknown,
|
|
6090
|
-
params?: ParseDbContext,
|
|
6091
|
-
): RecordId<Tb, Override["id"]>;
|
|
6092
|
-
parseAsync<
|
|
6093
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6094
|
-
Tb,
|
|
6095
|
-
core.output<Id>
|
|
6096
|
-
>,
|
|
6097
|
-
>(
|
|
6098
|
-
data: unknown,
|
|
6099
|
-
params?: ParseDbContext,
|
|
6100
|
-
): Promise<RecordId<Tb, Override["id"]>>;
|
|
6101
|
-
safeParse<
|
|
6102
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6103
|
-
Tb,
|
|
6104
|
-
core.output<Id>
|
|
6105
|
-
>,
|
|
6106
|
-
>(
|
|
6107
|
-
data: unknown,
|
|
6108
|
-
params?: ParseDbContext,
|
|
6109
|
-
): classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>;
|
|
6110
|
-
safeParseAsync<
|
|
6111
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6112
|
-
Tb,
|
|
6113
|
-
core.output<Id>
|
|
6114
|
-
>,
|
|
6115
|
-
>(
|
|
6116
|
-
data: unknown,
|
|
6117
|
-
params?: ParseDbContext,
|
|
6118
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>>;
|
|
6119
|
-
decode<
|
|
6120
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6121
|
-
Tb,
|
|
6122
|
-
core.output<Id>
|
|
6123
|
-
>,
|
|
6124
|
-
>(
|
|
6125
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
6126
|
-
params?: ParseDbContext,
|
|
6127
|
-
): RecordId<Tb, Override["id"]>;
|
|
6128
|
-
decodeAsync<
|
|
6129
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6130
|
-
Tb,
|
|
6131
|
-
core.output<Id>
|
|
6132
|
-
>,
|
|
6133
|
-
>(
|
|
6134
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
6135
|
-
params?: ParseDbContext,
|
|
6136
|
-
): Promise<RecordId<Tb, Override["id"]>>;
|
|
6137
|
-
safeDecode<
|
|
6138
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6139
|
-
Tb,
|
|
6140
|
-
core.output<Id>
|
|
6141
|
-
>,
|
|
6142
|
-
>(
|
|
6143
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
6144
|
-
params?: ParseDbContext,
|
|
6145
|
-
): classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>;
|
|
6146
|
-
safeDecodeAsync<
|
|
6147
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6148
|
-
Tb,
|
|
6149
|
-
core.output<Id>
|
|
6150
|
-
>,
|
|
6151
|
-
>(
|
|
6152
|
-
data: RecordId<Tb, Override["id"]> | StringRecordId,
|
|
6153
|
-
params?: ParseDbContext,
|
|
6154
|
-
): Promise<classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>>;
|
|
6155
|
-
|
|
6156
|
-
// From Parts - Single Parameter
|
|
6157
|
-
fromParts<
|
|
6158
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6159
|
-
Tb,
|
|
6160
|
-
core.output<Id>
|
|
6161
|
-
>,
|
|
6162
|
-
>(
|
|
6163
|
-
table: NoInfer<Tb>,
|
|
6164
|
-
id: NoInfer<Override["id"]>,
|
|
6165
|
-
params?: ParseDbContext,
|
|
6166
|
-
): RecordId<Tb, Override["id"]>;
|
|
6167
|
-
fromPartsAsync<
|
|
6168
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6169
|
-
Tb,
|
|
6170
|
-
core.output<Id>
|
|
6171
|
-
>,
|
|
6172
|
-
>(
|
|
6173
|
-
table: NoInfer<Tb>,
|
|
6174
|
-
id: NoInfer<Override["id"]>,
|
|
6175
|
-
params?: ParseDbContext,
|
|
6176
|
-
): Promise<RecordId<Tb, Override["id"]>>;
|
|
6177
|
-
safeFromParts<
|
|
6178
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
6179
|
-
Tb,
|
|
6180
|
-
core.output<Id>
|
|
6181
|
-
>,
|
|
6182
|
-
>(
|
|
6183
|
-
table: NoInfer<Tb>,
|
|
6184
|
-
id: NoInfer<Override["id"]>,
|
|
6185
|
-
params?: ParseDbContext,
|
|
6186
|
-
): classic.ZodSafeParseResult<RecordId<Tb, Override["id"]>>;
|
|
6187
|
-
safeFromPartsAsync<
|
|
6188
|
-
Override extends RecordId<string, RecordIdValue> = RecordId<
|
|
5641
|
+
| undefined
|
|
5642
|
+
>
|
|
5643
|
+
: classic.ZodSafeParseResult<
|
|
5644
|
+
RecordId<
|
|
5645
|
+
Tb,
|
|
5646
|
+
Ctx extends { db: any }
|
|
5647
|
+
? _core_.dboutput<Id>
|
|
5648
|
+
: Exclude<core.output<Id>, undefined>
|
|
5649
|
+
>
|
|
5650
|
+
>;
|
|
5651
|
+
safeFromPartsAsync<Ctx extends ParseDbContext>(
|
|
5652
|
+
table: Tb,
|
|
5653
|
+
id: Ctx extends { db: any }
|
|
5654
|
+
? core.output<Id>
|
|
5655
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5656
|
+
params?: Ctx,
|
|
5657
|
+
): undefined extends core.output<Id>
|
|
5658
|
+
? Promise<
|
|
5659
|
+
classic.ZodSafeParseResult<
|
|
5660
|
+
| RecordId<
|
|
6189
5661
|
Tb,
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
}
|
|
5662
|
+
// @ts-expect-error: output intersected above
|
|
5663
|
+
Ctx extends { db: any }
|
|
5664
|
+
? _core_.dboutput<Id>
|
|
5665
|
+
: Exclude<core.output<Id>, undefined>
|
|
5666
|
+
>
|
|
5667
|
+
| undefined
|
|
5668
|
+
>
|
|
5669
|
+
>
|
|
5670
|
+
: Promise<
|
|
5671
|
+
classic.ZodSafeParseResult<
|
|
5672
|
+
RecordId<
|
|
5673
|
+
Tb,
|
|
5674
|
+
Ctx extends { db: any }
|
|
5675
|
+
? _core_.dboutput<Id>
|
|
5676
|
+
: Exclude<core.output<Id>, undefined>
|
|
5677
|
+
>
|
|
5678
|
+
>
|
|
5679
|
+
>;
|
|
5680
|
+
|
|
5681
|
+
fromId<Ctx extends ParseDbContext>(
|
|
5682
|
+
id: Ctx extends { db: any }
|
|
5683
|
+
? core.output<Id>
|
|
5684
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5685
|
+
params?: Ctx,
|
|
5686
|
+
): RecordId<
|
|
5687
|
+
Tb,
|
|
5688
|
+
Ctx extends { db: any }
|
|
5689
|
+
? _core_.dboutput<Id>
|
|
5690
|
+
: Exclude<core.output<Id>, undefined>
|
|
5691
|
+
>;
|
|
5692
|
+
fromIdAsync<Ctx extends ParseDbContext>(
|
|
5693
|
+
id: Ctx extends { db: any }
|
|
5694
|
+
? core.output<Id>
|
|
5695
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5696
|
+
params?: Ctx,
|
|
5697
|
+
): Promise<
|
|
5698
|
+
RecordId<
|
|
5699
|
+
Tb,
|
|
5700
|
+
Ctx extends { db: any }
|
|
5701
|
+
? _core_.dboutput<Id>
|
|
5702
|
+
: Exclude<core.output<Id>, undefined>
|
|
5703
|
+
>
|
|
5704
|
+
>;
|
|
5705
|
+
safeFromId<Ctx extends ParseDbContext>(
|
|
5706
|
+
id: Ctx extends { db: any }
|
|
5707
|
+
? core.output<Id>
|
|
5708
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5709
|
+
params?: Ctx,
|
|
5710
|
+
): classic.ZodSafeParseResult<
|
|
5711
|
+
RecordId<
|
|
5712
|
+
Tb,
|
|
5713
|
+
Ctx extends { db: any }
|
|
5714
|
+
? _core_.dboutput<Id>
|
|
5715
|
+
: Exclude<core.output<Id>, undefined>
|
|
5716
|
+
>
|
|
5717
|
+
>;
|
|
5718
|
+
safeFromIdAsync<Ctx extends ParseDbContext>(
|
|
5719
|
+
id: Ctx extends { db: any }
|
|
5720
|
+
? core.output<Id>
|
|
5721
|
+
: Exclude<core.output<Id>, undefined>,
|
|
5722
|
+
params?: Ctx,
|
|
5723
|
+
): Promise<
|
|
5724
|
+
classic.ZodSafeParseResult<
|
|
5725
|
+
RecordId<
|
|
5726
|
+
Tb,
|
|
5727
|
+
Ctx extends { db: any }
|
|
5728
|
+
? _core_.dboutput<Id>
|
|
5729
|
+
: Exclude<core.output<Id>, undefined>
|
|
5730
|
+
>
|
|
5731
|
+
>
|
|
5732
|
+
>;
|
|
5733
|
+
};
|
|
5734
|
+
|
|
5735
|
+
type ZodSurrealRecordIdTrait<
|
|
5736
|
+
Tb extends string,
|
|
5737
|
+
Id extends ZodSurrealRecordIdValue,
|
|
5738
|
+
Extras extends ZodSurrealRecordIdExtras = {},
|
|
5739
|
+
> = string extends Tb
|
|
5740
|
+
? AnyTableRecordIdTrait<Tb, Id>
|
|
5741
|
+
: UnionToTuple<Tb> extends { length: 1 }
|
|
5742
|
+
? SpecificTableRecordIdTrait<Tb, Id>
|
|
5743
|
+
: AnyTableRecordIdTrait<Tb, Id>;
|
|
6256
5744
|
|
|
6257
5745
|
export type ZodSurrealdRecordId<
|
|
6258
5746
|
Table extends string = string,
|
|
@@ -6266,7 +5754,8 @@ export type ZodSurrealdRecordId<
|
|
|
6266
5754
|
| "nullish"
|
|
6267
5755
|
| "nonoptional"
|
|
6268
5756
|
> &
|
|
6269
|
-
ZodSurrealRecordIdTrait<Table, Id, Extras> &
|
|
5757
|
+
ZodSurrealRecordIdTrait<Table, Id, Extras> &
|
|
5758
|
+
ZodSurrealFieldMethods & {
|
|
6270
5759
|
anytable(): ZodSurrealdRecordId<string, Id, Extras>;
|
|
6271
5760
|
|
|
6272
5761
|
table<const NewTable extends string | string[]>(
|
|
@@ -6507,60 +5996,177 @@ export const ZodSurrealdRecordId: core.$constructor<ZodSurrealdRecordId> =
|
|
|
6507
5996
|
inst.value = inst.type;
|
|
6508
5997
|
|
|
6509
5998
|
// ------- Parsing/Encoding/Decoding -------
|
|
6510
|
-
|
|
6511
|
-
_inst.fromParts = (
|
|
5999
|
+
inst.fromParts = (
|
|
6512
6000
|
table: string,
|
|
6513
6001
|
id: RecordIdValue,
|
|
6514
|
-
params?:
|
|
6515
|
-
) =>
|
|
6002
|
+
params?: ParseDbContext,
|
|
6003
|
+
) => {
|
|
6004
|
+
const inner = def.innerType as core.$ZodType;
|
|
6005
|
+
if (id === undefined) {
|
|
6006
|
+
const res = core.safeDecode(inner, id, params);
|
|
6007
|
+
if (res.error) {
|
|
6008
|
+
for (const issue of res.error.issues) {
|
|
6009
|
+
issue.path.unshift("id");
|
|
6010
|
+
}
|
|
6011
|
+
throw res.error;
|
|
6012
|
+
}
|
|
6013
|
+
id = res.data as RecordIdValue;
|
|
6014
|
+
if (id === undefined) {
|
|
6015
|
+
return undefined;
|
|
6016
|
+
}
|
|
6017
|
+
}
|
|
6018
|
+
return inst.decode(new RecordId(table, id), params);
|
|
6019
|
+
};
|
|
6516
6020
|
|
|
6517
|
-
|
|
6021
|
+
inst.fromPartsAsync = async (
|
|
6518
6022
|
table: string,
|
|
6519
6023
|
id: RecordIdValue,
|
|
6520
6024
|
params?: core.ParseContext<core.$ZodIssue>,
|
|
6521
|
-
) =>
|
|
6025
|
+
) => {
|
|
6026
|
+
const inner = def.innerType as core.$ZodType;
|
|
6027
|
+
if (id === undefined) {
|
|
6028
|
+
const res = await core.safeDecodeAsync(inner, id, params);
|
|
6029
|
+
if (res.error) {
|
|
6030
|
+
for (const issue of res.error.issues) {
|
|
6031
|
+
issue.path.unshift("id");
|
|
6032
|
+
}
|
|
6033
|
+
throw res.error;
|
|
6034
|
+
}
|
|
6035
|
+
id = res.data as RecordIdValue;
|
|
6036
|
+
}
|
|
6522
6037
|
|
|
6523
|
-
|
|
6038
|
+
return inst.decodeAsync(new RecordId(table, id), params);
|
|
6039
|
+
};
|
|
6040
|
+
|
|
6041
|
+
inst.safeFromParts = (
|
|
6524
6042
|
table: string,
|
|
6525
6043
|
id: RecordIdValue,
|
|
6526
6044
|
params?: core.ParseContext<core.$ZodIssue>,
|
|
6527
|
-
) =>
|
|
6045
|
+
) => {
|
|
6046
|
+
const inner = def.innerType as core.$ZodType;
|
|
6047
|
+
if (id === undefined) {
|
|
6048
|
+
const res = core.safeDecode(inner, id, params);
|
|
6049
|
+
if (res.error) {
|
|
6050
|
+
for (const issue of res.error.issues) {
|
|
6051
|
+
issue.path.unshift("id");
|
|
6052
|
+
}
|
|
6053
|
+
throw res.error;
|
|
6054
|
+
}
|
|
6055
|
+
id = res.data as RecordIdValue;
|
|
6056
|
+
}
|
|
6528
6057
|
|
|
6529
|
-
|
|
6058
|
+
return inst.safeDecode(new RecordId(table, id), params);
|
|
6059
|
+
};
|
|
6060
|
+
|
|
6061
|
+
inst.safeFromPartsAsync = async (
|
|
6530
6062
|
table: string,
|
|
6531
6063
|
id: RecordIdValue,
|
|
6532
6064
|
params?: core.ParseContext<core.$ZodIssue>,
|
|
6533
|
-
) =>
|
|
6065
|
+
) => {
|
|
6066
|
+
const inner = def.innerType as core.$ZodType;
|
|
6067
|
+
if (id === undefined) {
|
|
6068
|
+
const res = await core.safeDecodeAsync(inner, id, params);
|
|
6069
|
+
if (res.error) {
|
|
6070
|
+
for (const issue of res.error.issues) {
|
|
6071
|
+
issue.path.unshift("id");
|
|
6072
|
+
}
|
|
6073
|
+
throw res.error;
|
|
6074
|
+
}
|
|
6075
|
+
id = res.data as RecordIdValue;
|
|
6076
|
+
}
|
|
6077
|
+
|
|
6078
|
+
return inst.safeDecodeAsync(new RecordId(table, id), params);
|
|
6079
|
+
};
|
|
6534
6080
|
|
|
6535
6081
|
if (normalized.table?.length === 1) {
|
|
6082
|
+
const _inst = inst as any;
|
|
6536
6083
|
_inst.fromId = (
|
|
6537
6084
|
id: RecordIdValue,
|
|
6538
6085
|
params?: core.ParseContext<core.$ZodIssue>,
|
|
6539
|
-
) =>
|
|
6086
|
+
) => {
|
|
6087
|
+
const inner = def.innerType as core.$ZodType;
|
|
6088
|
+
if (id === undefined) {
|
|
6089
|
+
const res = core.safeDecode(inner, id, params);
|
|
6090
|
+
if (res.error) {
|
|
6091
|
+
for (const issue of res.error.issues) {
|
|
6092
|
+
issue.path.unshift("id");
|
|
6093
|
+
}
|
|
6094
|
+
throw res.error;
|
|
6095
|
+
}
|
|
6096
|
+
id = res.data as RecordIdValue;
|
|
6097
|
+
}
|
|
6098
|
+
|
|
6099
|
+
return _inst.decode(
|
|
6100
|
+
new RecordId(normalized.table?.[0] ?? "", id),
|
|
6101
|
+
params,
|
|
6102
|
+
);
|
|
6103
|
+
};
|
|
6540
6104
|
|
|
6541
|
-
_inst.fromIdAsync = (
|
|
6105
|
+
_inst.fromIdAsync = async (
|
|
6542
6106
|
id: RecordIdValue,
|
|
6543
6107
|
params?: core.ParseContext<core.$ZodIssue>,
|
|
6544
|
-
) =>
|
|
6545
|
-
|
|
6108
|
+
) => {
|
|
6109
|
+
const inner = def.innerType as core.$ZodType;
|
|
6110
|
+
if (id === undefined) {
|
|
6111
|
+
const res = await core.safeDecodeAsync(inner, id, params);
|
|
6112
|
+
if (res.error) {
|
|
6113
|
+
for (const issue of res.error.issues) {
|
|
6114
|
+
issue.path.unshift("id");
|
|
6115
|
+
}
|
|
6116
|
+
throw res.error;
|
|
6117
|
+
}
|
|
6118
|
+
id = res.data as RecordIdValue;
|
|
6119
|
+
}
|
|
6120
|
+
|
|
6121
|
+
return _inst.decodeAsync(
|
|
6546
6122
|
new RecordId(normalized.table?.[0] ?? "", id),
|
|
6547
6123
|
params,
|
|
6548
6124
|
);
|
|
6125
|
+
};
|
|
6549
6126
|
|
|
6550
6127
|
_inst.safeFromId = (
|
|
6551
6128
|
id: RecordIdValue,
|
|
6552
6129
|
params?: core.ParseContext<core.$ZodIssue>,
|
|
6553
|
-
) =>
|
|
6554
|
-
|
|
6130
|
+
) => {
|
|
6131
|
+
const inner = def.innerType as core.$ZodType;
|
|
6132
|
+
if (id === undefined) {
|
|
6133
|
+
const res = core.safeDecode(inner, id, params);
|
|
6134
|
+
if (res.error) {
|
|
6135
|
+
for (const issue of res.error.issues) {
|
|
6136
|
+
issue.path.unshift("id");
|
|
6137
|
+
}
|
|
6138
|
+
throw res.error;
|
|
6139
|
+
}
|
|
6140
|
+
id = res.data as RecordIdValue;
|
|
6141
|
+
}
|
|
6142
|
+
|
|
6143
|
+
return _inst.safeDecode(
|
|
6144
|
+
new RecordId(normalized.table?.[0] ?? "", id),
|
|
6145
|
+
params,
|
|
6146
|
+
);
|
|
6147
|
+
};
|
|
6555
6148
|
|
|
6556
|
-
_inst.safeFromIdAsync = (
|
|
6149
|
+
_inst.safeFromIdAsync = async (
|
|
6557
6150
|
id: RecordIdValue,
|
|
6558
6151
|
params?: core.ParseContext<core.$ZodIssue>,
|
|
6559
|
-
) =>
|
|
6560
|
-
|
|
6152
|
+
) => {
|
|
6153
|
+
const inner = def.innerType as core.$ZodType;
|
|
6154
|
+
if (id === undefined) {
|
|
6155
|
+
const res = await core.safeDecodeAsync(inner, id, params);
|
|
6156
|
+
if (res.error) {
|
|
6157
|
+
for (const issue of res.error.issues) {
|
|
6158
|
+
issue.path.unshift("id");
|
|
6159
|
+
}
|
|
6160
|
+
throw res.error;
|
|
6161
|
+
}
|
|
6162
|
+
id = res.data as RecordIdValue;
|
|
6163
|
+
}
|
|
6164
|
+
|
|
6165
|
+
return _inst.safeDecodeAsync(
|
|
6561
6166
|
new RecordId(normalized.table?.[0] ?? "", id),
|
|
6562
6167
|
params,
|
|
6563
6168
|
);
|
|
6169
|
+
};
|
|
6564
6170
|
}
|
|
6565
6171
|
|
|
6566
6172
|
inst._zod.parse = (payload, ctx) => {
|