@oxyhq/contracts 0.9.1 → 0.10.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/index.js +2 -4
- package/dist/cjs/userResponse.js +1 -23
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/userResponse.js +0 -22
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/deviceBoot.d.ts +2 -2
- package/dist/types/deviceSession.d.ts +24 -24
- package/dist/types/index.d.ts +2 -2
- package/dist/types/userResponse.d.ts +4 -356
- package/package.json +1 -1
|
@@ -169,13 +169,13 @@ export declare const tokenRefreshResponseSchema: z.ZodObject<{
|
|
|
169
169
|
sessionId: z.ZodString;
|
|
170
170
|
}, "strip", z.ZodTypeAny, {
|
|
171
171
|
expiresAt: string;
|
|
172
|
-
accessToken: string;
|
|
173
172
|
sessionId: string;
|
|
173
|
+
accessToken: string;
|
|
174
174
|
refreshToken: string;
|
|
175
175
|
}, {
|
|
176
176
|
expiresAt: string;
|
|
177
|
-
accessToken: string;
|
|
178
177
|
sessionId: string;
|
|
178
|
+
accessToken: string;
|
|
179
179
|
refreshToken: string;
|
|
180
180
|
}>;
|
|
181
181
|
export type TokenRefreshResponse = z.infer<typeof tokenRefreshResponseSchema>;
|
|
@@ -5,14 +5,14 @@ export declare const sessionAccountSchema: z.ZodObject<{
|
|
|
5
5
|
authuser: z.ZodNumber;
|
|
6
6
|
operatedByUserId: z.ZodOptional<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
authuser: number;
|
|
9
8
|
sessionId: string;
|
|
10
9
|
accountId: string;
|
|
10
|
+
authuser: number;
|
|
11
11
|
operatedByUserId?: string | undefined;
|
|
12
12
|
}, {
|
|
13
|
-
authuser: number;
|
|
14
13
|
sessionId: string;
|
|
15
14
|
accountId: string;
|
|
15
|
+
authuser: number;
|
|
16
16
|
operatedByUserId?: string | undefined;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const deviceSessionStateSchema: z.ZodObject<{
|
|
@@ -23,14 +23,14 @@ export declare const deviceSessionStateSchema: z.ZodObject<{
|
|
|
23
23
|
authuser: z.ZodNumber;
|
|
24
24
|
operatedByUserId: z.ZodOptional<z.ZodString>;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
authuser: number;
|
|
27
26
|
sessionId: string;
|
|
28
27
|
accountId: string;
|
|
28
|
+
authuser: number;
|
|
29
29
|
operatedByUserId?: string | undefined;
|
|
30
30
|
}, {
|
|
31
|
-
authuser: number;
|
|
32
31
|
sessionId: string;
|
|
33
32
|
accountId: string;
|
|
33
|
+
authuser: number;
|
|
34
34
|
operatedByUserId?: string | undefined;
|
|
35
35
|
}>, "many">;
|
|
36
36
|
activeAccountId: z.ZodNullable<z.ZodString>;
|
|
@@ -38,25 +38,25 @@ export declare const deviceSessionStateSchema: z.ZodObject<{
|
|
|
38
38
|
updatedAt: z.ZodNumber;
|
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
|
40
40
|
updatedAt: number;
|
|
41
|
+
deviceId: string;
|
|
42
|
+
activeAccountId: string | null;
|
|
41
43
|
accounts: {
|
|
42
|
-
authuser: number;
|
|
43
44
|
sessionId: string;
|
|
44
45
|
accountId: string;
|
|
46
|
+
authuser: number;
|
|
45
47
|
operatedByUserId?: string | undefined;
|
|
46
48
|
}[];
|
|
47
|
-
deviceId: string;
|
|
48
|
-
activeAccountId: string | null;
|
|
49
49
|
revision: number;
|
|
50
50
|
}, {
|
|
51
51
|
updatedAt: number;
|
|
52
|
+
deviceId: string;
|
|
53
|
+
activeAccountId: string | null;
|
|
52
54
|
accounts: {
|
|
53
|
-
authuser: number;
|
|
54
55
|
sessionId: string;
|
|
55
56
|
accountId: string;
|
|
57
|
+
authuser: number;
|
|
56
58
|
operatedByUserId?: string | undefined;
|
|
57
59
|
}[];
|
|
58
|
-
deviceId: string;
|
|
59
|
-
activeAccountId: string | null;
|
|
60
60
|
revision: number;
|
|
61
61
|
}>;
|
|
62
62
|
export declare const activeTokenSchema: z.ZodObject<{
|
|
@@ -78,14 +78,14 @@ export declare const deviceSessionSyncSchema: z.ZodObject<{
|
|
|
78
78
|
authuser: z.ZodNumber;
|
|
79
79
|
operatedByUserId: z.ZodOptional<z.ZodString>;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
|
-
authuser: number;
|
|
82
81
|
sessionId: string;
|
|
83
82
|
accountId: string;
|
|
83
|
+
authuser: number;
|
|
84
84
|
operatedByUserId?: string | undefined;
|
|
85
85
|
}, {
|
|
86
|
-
authuser: number;
|
|
87
86
|
sessionId: string;
|
|
88
87
|
accountId: string;
|
|
88
|
+
authuser: number;
|
|
89
89
|
operatedByUserId?: string | undefined;
|
|
90
90
|
}>, "many">;
|
|
91
91
|
activeAccountId: z.ZodNullable<z.ZodString>;
|
|
@@ -93,25 +93,25 @@ export declare const deviceSessionSyncSchema: z.ZodObject<{
|
|
|
93
93
|
updatedAt: z.ZodNumber;
|
|
94
94
|
}, "strip", z.ZodTypeAny, {
|
|
95
95
|
updatedAt: number;
|
|
96
|
+
deviceId: string;
|
|
97
|
+
activeAccountId: string | null;
|
|
96
98
|
accounts: {
|
|
97
|
-
authuser: number;
|
|
98
99
|
sessionId: string;
|
|
99
100
|
accountId: string;
|
|
101
|
+
authuser: number;
|
|
100
102
|
operatedByUserId?: string | undefined;
|
|
101
103
|
}[];
|
|
102
|
-
deviceId: string;
|
|
103
|
-
activeAccountId: string | null;
|
|
104
104
|
revision: number;
|
|
105
105
|
}, {
|
|
106
106
|
updatedAt: number;
|
|
107
|
+
deviceId: string;
|
|
108
|
+
activeAccountId: string | null;
|
|
107
109
|
accounts: {
|
|
108
|
-
authuser: number;
|
|
109
110
|
sessionId: string;
|
|
110
111
|
accountId: string;
|
|
112
|
+
authuser: number;
|
|
111
113
|
operatedByUserId?: string | undefined;
|
|
112
114
|
}[];
|
|
113
|
-
deviceId: string;
|
|
114
|
-
activeAccountId: string | null;
|
|
115
115
|
revision: number;
|
|
116
116
|
}>;
|
|
117
117
|
activeToken: z.ZodNullable<z.ZodObject<{
|
|
@@ -127,14 +127,14 @@ export declare const deviceSessionSyncSchema: z.ZodObject<{
|
|
|
127
127
|
}, "strip", z.ZodTypeAny, {
|
|
128
128
|
state: {
|
|
129
129
|
updatedAt: number;
|
|
130
|
+
deviceId: string;
|
|
131
|
+
activeAccountId: string | null;
|
|
130
132
|
accounts: {
|
|
131
|
-
authuser: number;
|
|
132
133
|
sessionId: string;
|
|
133
134
|
accountId: string;
|
|
135
|
+
authuser: number;
|
|
134
136
|
operatedByUserId?: string | undefined;
|
|
135
137
|
}[];
|
|
136
|
-
deviceId: string;
|
|
137
|
-
activeAccountId: string | null;
|
|
138
138
|
revision: number;
|
|
139
139
|
};
|
|
140
140
|
activeToken: {
|
|
@@ -144,14 +144,14 @@ export declare const deviceSessionSyncSchema: z.ZodObject<{
|
|
|
144
144
|
}, {
|
|
145
145
|
state: {
|
|
146
146
|
updatedAt: number;
|
|
147
|
+
deviceId: string;
|
|
148
|
+
activeAccountId: string | null;
|
|
147
149
|
accounts: {
|
|
148
|
-
authuser: number;
|
|
149
150
|
sessionId: string;
|
|
150
151
|
accountId: string;
|
|
152
|
+
authuser: number;
|
|
151
153
|
operatedByUserId?: string | undefined;
|
|
152
154
|
}[];
|
|
153
|
-
deviceId: string;
|
|
154
|
-
activeAccountId: string | null;
|
|
155
155
|
revision: number;
|
|
156
156
|
};
|
|
157
157
|
activeToken: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* Platform-agnostic — zod is the only runtime dependency. No react/react-native/
|
|
10
10
|
* expo, no `require()` in the ESM build.
|
|
11
11
|
*/
|
|
12
|
-
export { userNameSchema, userResponseSchema, userProfileUpdateSchema,
|
|
13
|
-
export type { UserNameResponse, UserResponse, UserProfileUpdate,
|
|
12
|
+
export { userNameSchema, userResponseSchema, userProfileUpdateSchema, currentUserResponseSchema, deviceSessionAccountSchema, deviceSessionsResponseSchema, resolveUserId, safeParseContract, } from './userResponse';
|
|
13
|
+
export type { UserNameResponse, UserResponse, UserProfileUpdate, CurrentUserResponseContract, DeviceSessionAccountResponse, DeviceSessionsResponseContract, } from './userResponse';
|
|
14
14
|
export { applicationTypeSchema, publicApplicationSchema, sessionStatusSchema, } from './sessionStatus';
|
|
15
15
|
export type { ApplicationTypeContract, PublicApplicationResponse, SessionStatusResponse, } from './sessionStatus';
|
|
16
16
|
export { fedcmTokenPayloadSchema, } from './fedcmToken';
|
|
@@ -314,358 +314,6 @@ export type UserProfileUpdate = z.infer<typeof userProfileUpdateSchema>;
|
|
|
314
314
|
* the `formatUserResponse` `id` field or the raw-document `_id` field.
|
|
315
315
|
*/
|
|
316
316
|
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
317
|
/**
|
|
670
318
|
* Wire shape of `GET /users/me` — the API success envelope (`{ data: <user> }`)
|
|
671
319
|
* wrapping the current-user DTO. Some older producers use `_id` instead of
|
|
@@ -902,6 +550,7 @@ export declare const deviceSessionAccountSchema: z.ZodObject<{
|
|
|
902
550
|
}, z.ZodTypeAny, "passthrough">>>>;
|
|
903
551
|
}, "strip", z.ZodTypeAny, {
|
|
904
552
|
sessionId: string;
|
|
553
|
+
isCurrent?: boolean | undefined;
|
|
905
554
|
user?: z.objectOutputType<{
|
|
906
555
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
907
556
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -932,9 +581,9 @@ export declare const deviceSessionAccountSchema: z.ZodObject<{
|
|
|
932
581
|
*/
|
|
933
582
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
934
583
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
935
|
-
isCurrent?: boolean | undefined;
|
|
936
584
|
}, {
|
|
937
585
|
sessionId: string;
|
|
586
|
+
isCurrent?: boolean | undefined;
|
|
938
587
|
user?: z.objectInputType<{
|
|
939
588
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
940
589
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -965,7 +614,6 @@ export declare const deviceSessionAccountSchema: z.ZodObject<{
|
|
|
965
614
|
*/
|
|
966
615
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
967
616
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
968
|
-
isCurrent?: boolean | undefined;
|
|
969
617
|
}>;
|
|
970
618
|
export type DeviceSessionAccountResponse = z.infer<typeof deviceSessionAccountSchema>;
|
|
971
619
|
/** Wire shape of `GET /session/device/sessions/:sessionId` (an array). */
|
|
@@ -1062,6 +710,7 @@ export declare const deviceSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
1062
710
|
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1063
711
|
}, "strip", z.ZodTypeAny, {
|
|
1064
712
|
sessionId: string;
|
|
713
|
+
isCurrent?: boolean | undefined;
|
|
1065
714
|
user?: z.objectOutputType<{
|
|
1066
715
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1067
716
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -1092,9 +741,9 @@ export declare const deviceSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
1092
741
|
*/
|
|
1093
742
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1094
743
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1095
|
-
isCurrent?: boolean | undefined;
|
|
1096
744
|
}, {
|
|
1097
745
|
sessionId: string;
|
|
746
|
+
isCurrent?: boolean | undefined;
|
|
1098
747
|
user?: z.objectInputType<{
|
|
1099
748
|
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1100
749
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -1125,7 +774,6 @@ export declare const deviceSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
1125
774
|
*/
|
|
1126
775
|
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1127
776
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1128
|
-
isCurrent?: boolean | undefined;
|
|
1129
777
|
}>, "many">;
|
|
1130
778
|
export type DeviceSessionsResponseContract = z.infer<typeof deviceSessionsResponseSchema>;
|
|
1131
779
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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",
|