@oxyhq/contracts 0.9.1 → 0.11.0
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/fedcmToken.js +10 -0
- package/dist/cjs/index.js +4 -6
- package/dist/cjs/sessionStatus.js +10 -6
- package/dist/cjs/userResponse.js +5 -28
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/fedcmToken.js +10 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/sessionStatus.js +10 -6
- package/dist/esm/userResponse.js +4 -27
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/deviceBoot.d.ts +3 -3
- package/dist/types/deviceSession.d.ts +24 -24
- package/dist/types/fedcmToken.d.ts +10 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/sessionStatus.d.ts +24 -6
- package/dist/types/userResponse.d.ts +10 -363
- package/package.json +1 -1
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Faithful to the producers:
|
|
18
18
|
* - `packages/api/src/utils/userTransform.ts` `formatUserResponse` — the
|
|
19
|
-
* canonical serialization used by
|
|
19
|
+
* canonical serialization used by the device-first bootstrap/exchange
|
|
20
|
+
* endpoints (`deviceAuth.ts`), login/signup, device sessions, etc.
|
|
20
21
|
* Emits `id` (NOT `_id`), forwards `username` verbatim (may be absent), and
|
|
21
22
|
* emits `name` as the structured `{ first, last, full, displayName }`
|
|
22
23
|
* subdocument.
|
|
@@ -24,8 +25,6 @@
|
|
|
24
25
|
* `''`; `full` and `displayName` are Mongoose VIRTUALS. Formatted API
|
|
25
26
|
* responses compose both fields, while raw-document responses may omit the
|
|
26
27
|
* virtuals if the query did not materialise them.
|
|
27
|
-
* - The `/auth/refresh-all` handler in `packages/api/src/routes/auth.ts`, whose
|
|
28
|
-
* per-slot `authuser` is the numeric `oxy_rt_${authuser}` cookie slot.
|
|
29
28
|
*
|
|
30
29
|
* Platform-agnostic — zod only, no react/react-native/expo. ESM-safe (no
|
|
31
30
|
* `require()`).
|
|
@@ -314,358 +313,6 @@ export type UserProfileUpdate = z.infer<typeof userProfileUpdateSchema>;
|
|
|
314
313
|
* the `formatUserResponse` `id` field or the raw-document `_id` field.
|
|
315
314
|
*/
|
|
316
315
|
export declare function resolveUserId(user: UserResponse): string | undefined;
|
|
317
|
-
/**
|
|
318
|
-
* One rotated account entry from `POST /auth/refresh-all`.
|
|
319
|
-
*
|
|
320
|
-
* `authuser` is the device-local slot index (`0..N-1`). `user` is the canonical
|
|
321
|
-
* {@link userResponseSchema} shape (the handler projects a whitelist and runs it
|
|
322
|
-
* through `formatUserResponse`).
|
|
323
|
-
*/
|
|
324
|
-
export declare const refreshAllAccountSchema: z.ZodObject<{
|
|
325
|
-
authuser: z.ZodNumber;
|
|
326
|
-
accessToken: z.ZodString;
|
|
327
|
-
expiresAt: z.ZodString;
|
|
328
|
-
sessionId: z.ZodString;
|
|
329
|
-
user: z.ZodObject<{
|
|
330
|
-
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
331
|
-
id: z.ZodOptional<z.ZodString>;
|
|
332
|
-
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
333
|
-
_id: z.ZodOptional<z.ZodString>;
|
|
334
|
-
publicKey: z.ZodOptional<z.ZodString>;
|
|
335
|
-
username: z.ZodOptional<z.ZodString>;
|
|
336
|
-
email: z.ZodOptional<z.ZodString>;
|
|
337
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
338
|
-
address: z.ZodOptional<z.ZodString>;
|
|
339
|
-
birthday: z.ZodOptional<z.ZodString>;
|
|
340
|
-
/** Avatar file id (string) or null. */
|
|
341
|
-
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
|
-
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
343
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
344
|
-
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
345
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
-
language: z.ZodOptional<z.ZodString>;
|
|
347
|
-
/**
|
|
348
|
-
* The account's self-sovereign identifier
|
|
349
|
-
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
350
|
-
* virtual; present on formatted DTOs once the identity layer is live.
|
|
351
|
-
*/
|
|
352
|
-
did: z.ZodOptional<z.ZodString>;
|
|
353
|
-
/**
|
|
354
|
-
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
355
|
-
* entry; present only when the account has verified at least one domain.
|
|
356
|
-
*/
|
|
357
|
-
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
358
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
359
|
-
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
360
|
-
id: z.ZodOptional<z.ZodString>;
|
|
361
|
-
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
362
|
-
_id: z.ZodOptional<z.ZodString>;
|
|
363
|
-
publicKey: z.ZodOptional<z.ZodString>;
|
|
364
|
-
username: z.ZodOptional<z.ZodString>;
|
|
365
|
-
email: z.ZodOptional<z.ZodString>;
|
|
366
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
367
|
-
address: z.ZodOptional<z.ZodString>;
|
|
368
|
-
birthday: z.ZodOptional<z.ZodString>;
|
|
369
|
-
/** Avatar file id (string) or null. */
|
|
370
|
-
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
371
|
-
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
372
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
373
|
-
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
374
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
-
language: z.ZodOptional<z.ZodString>;
|
|
376
|
-
/**
|
|
377
|
-
* The account's self-sovereign identifier
|
|
378
|
-
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
379
|
-
* virtual; present on formatted DTOs once the identity layer is live.
|
|
380
|
-
*/
|
|
381
|
-
did: z.ZodOptional<z.ZodString>;
|
|
382
|
-
/**
|
|
383
|
-
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
384
|
-
* entry; present only when the account has verified at least one domain.
|
|
385
|
-
*/
|
|
386
|
-
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
387
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
388
|
-
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
389
|
-
id: z.ZodOptional<z.ZodString>;
|
|
390
|
-
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
391
|
-
_id: z.ZodOptional<z.ZodString>;
|
|
392
|
-
publicKey: z.ZodOptional<z.ZodString>;
|
|
393
|
-
username: z.ZodOptional<z.ZodString>;
|
|
394
|
-
email: z.ZodOptional<z.ZodString>;
|
|
395
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
396
|
-
address: z.ZodOptional<z.ZodString>;
|
|
397
|
-
birthday: z.ZodOptional<z.ZodString>;
|
|
398
|
-
/** Avatar file id (string) or null. */
|
|
399
|
-
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
400
|
-
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
401
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
402
|
-
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
403
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
404
|
-
language: z.ZodOptional<z.ZodString>;
|
|
405
|
-
/**
|
|
406
|
-
* The account's self-sovereign identifier
|
|
407
|
-
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
408
|
-
* virtual; present on formatted DTOs once the identity layer is live.
|
|
409
|
-
*/
|
|
410
|
-
did: z.ZodOptional<z.ZodString>;
|
|
411
|
-
/**
|
|
412
|
-
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
413
|
-
* entry; present only when the account has verified at least one domain.
|
|
414
|
-
*/
|
|
415
|
-
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
416
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
417
|
-
}, "strip", z.ZodTypeAny, {
|
|
418
|
-
expiresAt: string;
|
|
419
|
-
authuser: number;
|
|
420
|
-
accessToken: string;
|
|
421
|
-
sessionId: string;
|
|
422
|
-
user: {
|
|
423
|
-
name: UserNameResponse;
|
|
424
|
-
id?: string | undefined;
|
|
425
|
-
publicKey?: string | undefined;
|
|
426
|
-
did?: string | undefined;
|
|
427
|
-
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
428
|
-
verified?: boolean | undefined;
|
|
429
|
-
username?: string | undefined;
|
|
430
|
-
_id?: string | undefined;
|
|
431
|
-
email?: string | undefined;
|
|
432
|
-
phone?: string | undefined;
|
|
433
|
-
address?: string | undefined;
|
|
434
|
-
birthday?: string | undefined;
|
|
435
|
-
avatar?: string | null | undefined;
|
|
436
|
-
color?: string | null | undefined;
|
|
437
|
-
language?: string | undefined;
|
|
438
|
-
} & {
|
|
439
|
-
[k: string]: unknown;
|
|
440
|
-
};
|
|
441
|
-
}, {
|
|
442
|
-
expiresAt: string;
|
|
443
|
-
authuser: number;
|
|
444
|
-
accessToken: string;
|
|
445
|
-
sessionId: string;
|
|
446
|
-
user: {
|
|
447
|
-
name: UserNameResponse;
|
|
448
|
-
id?: string | undefined;
|
|
449
|
-
publicKey?: string | undefined;
|
|
450
|
-
did?: string | undefined;
|
|
451
|
-
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
452
|
-
verified?: boolean | undefined;
|
|
453
|
-
username?: string | undefined;
|
|
454
|
-
_id?: string | undefined;
|
|
455
|
-
email?: string | undefined;
|
|
456
|
-
phone?: string | undefined;
|
|
457
|
-
address?: string | undefined;
|
|
458
|
-
birthday?: string | undefined;
|
|
459
|
-
avatar?: string | null | undefined;
|
|
460
|
-
color?: string | null | undefined;
|
|
461
|
-
language?: string | undefined;
|
|
462
|
-
} & {
|
|
463
|
-
[k: string]: unknown;
|
|
464
|
-
};
|
|
465
|
-
}>;
|
|
466
|
-
export type RefreshAllAccountResponse = z.infer<typeof refreshAllAccountSchema>;
|
|
467
|
-
/**
|
|
468
|
-
* Wire shape of `POST /auth/refresh-all`: every valid device-local account,
|
|
469
|
-
* sorted by `authuser` ascending. An empty `accounts` array means "no signed-in
|
|
470
|
-
* accounts on this device" — the IdP must show the sign-in form.
|
|
471
|
-
*/
|
|
472
|
-
export declare const refreshAllResponseSchema: z.ZodObject<{
|
|
473
|
-
accounts: z.ZodArray<z.ZodObject<{
|
|
474
|
-
authuser: z.ZodNumber;
|
|
475
|
-
accessToken: z.ZodString;
|
|
476
|
-
expiresAt: z.ZodString;
|
|
477
|
-
sessionId: z.ZodString;
|
|
478
|
-
user: z.ZodObject<{
|
|
479
|
-
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
480
|
-
id: z.ZodOptional<z.ZodString>;
|
|
481
|
-
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
482
|
-
_id: z.ZodOptional<z.ZodString>;
|
|
483
|
-
publicKey: z.ZodOptional<z.ZodString>;
|
|
484
|
-
username: z.ZodOptional<z.ZodString>;
|
|
485
|
-
email: z.ZodOptional<z.ZodString>;
|
|
486
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
487
|
-
address: z.ZodOptional<z.ZodString>;
|
|
488
|
-
birthday: z.ZodOptional<z.ZodString>;
|
|
489
|
-
/** Avatar file id (string) or null. */
|
|
490
|
-
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
491
|
-
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
492
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
493
|
-
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
494
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
495
|
-
language: z.ZodOptional<z.ZodString>;
|
|
496
|
-
/**
|
|
497
|
-
* The account's self-sovereign identifier
|
|
498
|
-
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
499
|
-
* virtual; present on formatted DTOs once the identity layer is live.
|
|
500
|
-
*/
|
|
501
|
-
did: z.ZodOptional<z.ZodString>;
|
|
502
|
-
/**
|
|
503
|
-
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
504
|
-
* entry; present only when the account has verified at least one domain.
|
|
505
|
-
*/
|
|
506
|
-
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
507
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
508
|
-
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
509
|
-
id: z.ZodOptional<z.ZodString>;
|
|
510
|
-
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
511
|
-
_id: z.ZodOptional<z.ZodString>;
|
|
512
|
-
publicKey: z.ZodOptional<z.ZodString>;
|
|
513
|
-
username: z.ZodOptional<z.ZodString>;
|
|
514
|
-
email: z.ZodOptional<z.ZodString>;
|
|
515
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
516
|
-
address: z.ZodOptional<z.ZodString>;
|
|
517
|
-
birthday: z.ZodOptional<z.ZodString>;
|
|
518
|
-
/** Avatar file id (string) or null. */
|
|
519
|
-
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
520
|
-
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
521
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
522
|
-
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
523
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
524
|
-
language: z.ZodOptional<z.ZodString>;
|
|
525
|
-
/**
|
|
526
|
-
* The account's self-sovereign identifier
|
|
527
|
-
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
528
|
-
* virtual; present on formatted DTOs once the identity layer is live.
|
|
529
|
-
*/
|
|
530
|
-
did: z.ZodOptional<z.ZodString>;
|
|
531
|
-
/**
|
|
532
|
-
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
533
|
-
* entry; present only when the account has verified at least one domain.
|
|
534
|
-
*/
|
|
535
|
-
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
536
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
537
|
-
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
538
|
-
id: z.ZodOptional<z.ZodString>;
|
|
539
|
-
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
540
|
-
_id: z.ZodOptional<z.ZodString>;
|
|
541
|
-
publicKey: z.ZodOptional<z.ZodString>;
|
|
542
|
-
username: z.ZodOptional<z.ZodString>;
|
|
543
|
-
email: z.ZodOptional<z.ZodString>;
|
|
544
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
545
|
-
address: z.ZodOptional<z.ZodString>;
|
|
546
|
-
birthday: z.ZodOptional<z.ZodString>;
|
|
547
|
-
/** Avatar file id (string) or null. */
|
|
548
|
-
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
549
|
-
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
550
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
551
|
-
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
552
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
553
|
-
language: z.ZodOptional<z.ZodString>;
|
|
554
|
-
/**
|
|
555
|
-
* The account's self-sovereign identifier
|
|
556
|
-
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
557
|
-
* virtual; present on formatted DTOs once the identity layer is live.
|
|
558
|
-
*/
|
|
559
|
-
did: z.ZodOptional<z.ZodString>;
|
|
560
|
-
/**
|
|
561
|
-
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
562
|
-
* entry; present only when the account has verified at least one domain.
|
|
563
|
-
*/
|
|
564
|
-
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
565
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
566
|
-
}, "strip", z.ZodTypeAny, {
|
|
567
|
-
expiresAt: string;
|
|
568
|
-
authuser: number;
|
|
569
|
-
accessToken: string;
|
|
570
|
-
sessionId: string;
|
|
571
|
-
user: {
|
|
572
|
-
name: UserNameResponse;
|
|
573
|
-
id?: string | undefined;
|
|
574
|
-
publicKey?: string | undefined;
|
|
575
|
-
did?: string | undefined;
|
|
576
|
-
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
577
|
-
verified?: boolean | undefined;
|
|
578
|
-
username?: string | undefined;
|
|
579
|
-
_id?: string | undefined;
|
|
580
|
-
email?: string | undefined;
|
|
581
|
-
phone?: string | undefined;
|
|
582
|
-
address?: string | undefined;
|
|
583
|
-
birthday?: string | undefined;
|
|
584
|
-
avatar?: string | null | undefined;
|
|
585
|
-
color?: string | null | undefined;
|
|
586
|
-
language?: string | undefined;
|
|
587
|
-
} & {
|
|
588
|
-
[k: string]: unknown;
|
|
589
|
-
};
|
|
590
|
-
}, {
|
|
591
|
-
expiresAt: string;
|
|
592
|
-
authuser: number;
|
|
593
|
-
accessToken: string;
|
|
594
|
-
sessionId: string;
|
|
595
|
-
user: {
|
|
596
|
-
name: UserNameResponse;
|
|
597
|
-
id?: string | undefined;
|
|
598
|
-
publicKey?: string | undefined;
|
|
599
|
-
did?: string | undefined;
|
|
600
|
-
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
601
|
-
verified?: boolean | undefined;
|
|
602
|
-
username?: string | undefined;
|
|
603
|
-
_id?: string | undefined;
|
|
604
|
-
email?: string | undefined;
|
|
605
|
-
phone?: string | undefined;
|
|
606
|
-
address?: string | undefined;
|
|
607
|
-
birthday?: string | undefined;
|
|
608
|
-
avatar?: string | null | undefined;
|
|
609
|
-
color?: string | null | undefined;
|
|
610
|
-
language?: string | undefined;
|
|
611
|
-
} & {
|
|
612
|
-
[k: string]: unknown;
|
|
613
|
-
};
|
|
614
|
-
}>, "many">;
|
|
615
|
-
}, "strip", z.ZodTypeAny, {
|
|
616
|
-
accounts: {
|
|
617
|
-
expiresAt: string;
|
|
618
|
-
authuser: number;
|
|
619
|
-
accessToken: string;
|
|
620
|
-
sessionId: string;
|
|
621
|
-
user: {
|
|
622
|
-
name: UserNameResponse;
|
|
623
|
-
id?: string | undefined;
|
|
624
|
-
publicKey?: string | undefined;
|
|
625
|
-
did?: string | undefined;
|
|
626
|
-
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
627
|
-
verified?: boolean | undefined;
|
|
628
|
-
username?: string | undefined;
|
|
629
|
-
_id?: string | undefined;
|
|
630
|
-
email?: string | undefined;
|
|
631
|
-
phone?: string | undefined;
|
|
632
|
-
address?: string | undefined;
|
|
633
|
-
birthday?: string | undefined;
|
|
634
|
-
avatar?: string | null | undefined;
|
|
635
|
-
color?: string | null | undefined;
|
|
636
|
-
language?: string | undefined;
|
|
637
|
-
} & {
|
|
638
|
-
[k: string]: unknown;
|
|
639
|
-
};
|
|
640
|
-
}[];
|
|
641
|
-
}, {
|
|
642
|
-
accounts: {
|
|
643
|
-
expiresAt: string;
|
|
644
|
-
authuser: number;
|
|
645
|
-
accessToken: string;
|
|
646
|
-
sessionId: string;
|
|
647
|
-
user: {
|
|
648
|
-
name: UserNameResponse;
|
|
649
|
-
id?: string | undefined;
|
|
650
|
-
publicKey?: string | undefined;
|
|
651
|
-
did?: string | undefined;
|
|
652
|
-
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
653
|
-
verified?: boolean | undefined;
|
|
654
|
-
username?: string | undefined;
|
|
655
|
-
_id?: string | undefined;
|
|
656
|
-
email?: string | undefined;
|
|
657
|
-
phone?: string | undefined;
|
|
658
|
-
address?: string | undefined;
|
|
659
|
-
birthday?: string | undefined;
|
|
660
|
-
avatar?: string | null | undefined;
|
|
661
|
-
color?: string | null | undefined;
|
|
662
|
-
language?: string | undefined;
|
|
663
|
-
} & {
|
|
664
|
-
[k: string]: unknown;
|
|
665
|
-
};
|
|
666
|
-
}[];
|
|
667
|
-
}>;
|
|
668
|
-
export type RefreshAllResponseContract = z.infer<typeof refreshAllResponseSchema>;
|
|
669
316
|
/**
|
|
670
317
|
* Wire shape of `GET /users/me` — the API success envelope (`{ data: <user> }`)
|
|
671
318
|
* wrapping the current-user DTO. Some older producers use `_id` instead of
|
|
@@ -809,7 +456,7 @@ export type CurrentUserResponseContract = z.infer<typeof currentUserResponseSche
|
|
|
809
456
|
* session). Backs the multi-account chooser. The embedded user mirrors
|
|
810
457
|
* `formatUserResponse`; it is nullable on slots that lost their user document.
|
|
811
458
|
*/
|
|
812
|
-
export declare const
|
|
459
|
+
export declare const deviceLinkedSessionSchema: z.ZodObject<{
|
|
813
460
|
sessionId: z.ZodString;
|
|
814
461
|
isCurrent: z.ZodOptional<z.ZodBoolean>;
|
|
815
462
|
user: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -902,6 +549,7 @@ export declare const deviceSessionAccountSchema: z.ZodObject<{
|
|
|
902
549
|
}, z.ZodTypeAny, "passthrough">>>>;
|
|
903
550
|
}, "strip", z.ZodTypeAny, {
|
|
904
551
|
sessionId: string;
|
|
552
|
+
isCurrent?: boolean | undefined;
|
|
905
553
|
user?: z.objectOutputType<{
|
|
906
554
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
907
555
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -932,9 +580,9 @@ export declare const deviceSessionAccountSchema: z.ZodObject<{
|
|
|
932
580
|
*/
|
|
933
581
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
934
582
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
935
|
-
isCurrent?: boolean | undefined;
|
|
936
583
|
}, {
|
|
937
584
|
sessionId: string;
|
|
585
|
+
isCurrent?: boolean | undefined;
|
|
938
586
|
user?: z.objectInputType<{
|
|
939
587
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
940
588
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -965,11 +613,10 @@ export declare const deviceSessionAccountSchema: z.ZodObject<{
|
|
|
965
613
|
*/
|
|
966
614
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
967
615
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
968
|
-
isCurrent?: boolean | undefined;
|
|
969
616
|
}>;
|
|
970
|
-
export type
|
|
617
|
+
export type DeviceLinkedSessionResponse = z.infer<typeof deviceLinkedSessionSchema>;
|
|
971
618
|
/** Wire shape of `GET /session/device/sessions/:sessionId` (an array). */
|
|
972
|
-
export declare const
|
|
619
|
+
export declare const deviceLinkedSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
973
620
|
sessionId: z.ZodString;
|
|
974
621
|
isCurrent: z.ZodOptional<z.ZodBoolean>;
|
|
975
622
|
user: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -1062,6 +709,7 @@ export declare const deviceSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
1062
709
|
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1063
710
|
}, "strip", z.ZodTypeAny, {
|
|
1064
711
|
sessionId: string;
|
|
712
|
+
isCurrent?: boolean | undefined;
|
|
1065
713
|
user?: z.objectOutputType<{
|
|
1066
714
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1067
715
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -1092,9 +740,9 @@ export declare const deviceSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
1092
740
|
*/
|
|
1093
741
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1094
742
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1095
|
-
isCurrent?: boolean | undefined;
|
|
1096
743
|
}, {
|
|
1097
744
|
sessionId: string;
|
|
745
|
+
isCurrent?: boolean | undefined;
|
|
1098
746
|
user?: z.objectInputType<{
|
|
1099
747
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1100
748
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -1125,9 +773,8 @@ export declare const deviceSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
1125
773
|
*/
|
|
1126
774
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1127
775
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1128
|
-
isCurrent?: boolean | undefined;
|
|
1129
776
|
}>, "many">;
|
|
1130
|
-
export type
|
|
777
|
+
export type DeviceLinkedSessionsResponseContract = z.infer<typeof deviceLinkedSessionsResponseSchema>;
|
|
1131
778
|
/**
|
|
1132
779
|
* Safely parse a value against a contract schema. Returns the parsed (typed)
|
|
1133
780
|
* value, or `null` when validation fails — the same ergonomics the auth app's
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|