@schemavaults/auth-common 0.24.0 → 0.25.1

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.
Files changed (69) hide show
  1. package/dist/audience-schema.d.ts +2 -2
  2. package/dist/audience-schema.js +0 -1
  3. package/dist/audience-schema.js.map +1 -1
  4. package/dist/auth_acquire_tokens_grant_types.d.ts +12 -42
  5. package/dist/auth_acquire_tokens_grant_types.js +1 -1
  6. package/dist/auth_acquire_tokens_grant_types.js.map +1 -1
  7. package/dist/authenticate_result.d.ts +29 -144
  8. package/dist/authenticate_result.js +2 -2
  9. package/dist/authenticate_result.js.map +1 -1
  10. package/dist/authorize-client-application-form-type.d.ts +2 -6
  11. package/dist/credentials/email_credentials.d.ts +3 -9
  12. package/dist/credentials/normalize-email.d.ts +1 -1
  13. package/dist/credentials/normalize-email.js +5 -1
  14. package/dist/credentials/normalize-email.js.map +1 -1
  15. package/dist/credentials/password_requirements.d.ts +1 -1
  16. package/dist/credentials/register_credentials.d.ts +6 -26
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/invite-code/invite-code-definition.d.ts +5 -17
  21. package/dist/invite-code/invite-code-definition.js +1 -1
  22. package/dist/invite-code/invite-code-definition.js.map +1 -1
  23. package/dist/mfa/mfa-challenge.d.ts +2 -8
  24. package/dist/mfa/mfa-challenge.js +1 -1
  25. package/dist/mfa/mfa-challenge.js.map +1 -1
  26. package/dist/mfa/mfa-factor-type.d.ts +4 -1
  27. package/dist/mfa/mfa-verify-body.d.ts +57 -315
  28. package/dist/mfa/mfa-verify-body.js +9 -9
  29. package/dist/mfa/mfa-verify-body.js.map +1 -1
  30. package/dist/mfa/webauthn.d.ts +21 -145
  31. package/dist/mfa/webauthn.js +3 -3
  32. package/dist/mfa/webauthn.js.map +1 -1
  33. package/dist/middleware/auth-middleware-error.d.ts +1 -1
  34. package/dist/middleware/middleware-rules.d.ts +11 -15
  35. package/dist/oidc/index.d.ts +2 -0
  36. package/dist/oidc/index.js +1 -0
  37. package/dist/oidc/index.js.map +1 -1
  38. package/dist/oidc/profile-claims.d.ts +34 -0
  39. package/dist/oidc/profile-claims.js +45 -0
  40. package/dist/oidc/profile-claims.js.map +1 -0
  41. package/dist/organizations/invite_member_form.d.ts +8 -21
  42. package/dist/organizations/invite_member_form.js +5 -5
  43. package/dist/organizations/invite_member_form.js.map +1 -1
  44. package/dist/organizations/organization-membership-role-type.d.ts +1 -1
  45. package/dist/organizations/organization_definition.d.ts +5 -15
  46. package/dist/organizations/organization_definition.js +1 -1
  47. package/dist/organizations/organization_definition.js.map +1 -1
  48. package/dist/organizations/organization_invitation.d.ts +21 -33
  49. package/dist/organizations/organization_invitation.js +5 -5
  50. package/dist/organizations/organization_invitation.js.map +1 -1
  51. package/dist/organizations/organization_membership_role_details.d.ts +6 -18
  52. package/dist/pagination.d.ts +1 -7
  53. package/dist/pkce/code_challenge.d.ts +5 -13
  54. package/dist/pkce/code_verifier.d.ts +6 -16
  55. package/dist/pkce/pkce.d.ts +11 -29
  56. package/dist/request_tokens_result.d.ts +58 -493
  57. package/dist/token-data/token-data.d.ts +23 -73
  58. package/dist/token-data/token-data.js +1 -1
  59. package/dist/token-data/token-data.js.map +1 -1
  60. package/dist/user_data/index.d.ts +1 -0
  61. package/dist/user_data/index.js +1 -0
  62. package/dist/user_data/index.js.map +1 -1
  63. package/dist/user_data/user_data.d.ts +11 -50
  64. package/dist/user_data/user_data.js +13 -3
  65. package/dist/user_data/user_data.js.map +1 -1
  66. package/dist/user_data/user_profile.d.ts +65 -0
  67. package/dist/user_data/user_profile.js +79 -0
  68. package/dist/user_data/user_profile.js.map +1 -0
  69. package/package.json +3 -3
@@ -1,511 +1,76 @@
1
1
  import type { z as zod } from "zod";
2
2
  import { type AudienceSchemaOverrides } from "./audience-schema";
3
3
  import { type SchemaVaultsAppEnvironment } from "@schemavaults/app-definitions";
4
- export declare function createSuccessfullyGeneratedTokensRecordSchema(z: typeof zod, environment?: SchemaVaultsAppEnvironment, overrides?: AudienceSchemaOverrides): zod.ZodEffects<zod.ZodEffects<zod.ZodObject<{
5
- access: zod.ZodOptional<zod.ZodRecord<zod.ZodUnion<[zod.ZodEffects<zod.ZodString, string, string>, zod.ZodEffects<zod.ZodEffects<zod.ZodEffects<zod.ZodString, string, string>, string, string>, string, string>]>, zod.ZodUnion<[zod.ZodObject<{
6
- uid: zod.ZodString;
7
- iat: zod.ZodNumber;
8
- exp: zod.ZodNumber;
9
- token: zod.ZodString;
10
- aud: zod.ZodString;
11
- jti: zod.ZodOptional<zod.ZodString>;
12
- } & {
4
+ export declare function createSuccessfullyGeneratedTokensRecordSchema(z: typeof zod, environment?: SchemaVaultsAppEnvironment, overrides?: AudienceSchemaOverrides): zod.ZodObject<{
5
+ access: zod.ZodOptional<zod.ZodRecord<zod.ZodUnion<readonly [zod.ZodURL & zod.ZodType<string, string, zod.core.$ZodTypeInternals<string, string>>, zod.ZodString]>, zod.ZodUnion<readonly [zod.ZodObject<{
6
+ uid: zod.ZodNonOptional<zod.ZodString>;
7
+ iat: zod.ZodNonOptional<zod.ZodNumber>;
8
+ exp: zod.ZodNonOptional<zod.ZodNumber>;
9
+ token: zod.ZodNonOptional<zod.ZodString>;
10
+ aud: zod.ZodNonOptional<zod.ZodString>;
11
+ jti: zod.ZodOptional<zod.ZodGUID>;
13
12
  type: zod.ZodLiteral<"access">;
14
- }, "strict", zod.ZodTypeAny, {
15
- type: "access";
16
- uid: string;
17
- iat: number;
18
- exp: number;
19
- token: string;
20
- aud: string;
21
- jti?: string | undefined;
22
- }, {
23
- type: "access";
24
- uid: string;
25
- iat: number;
26
- exp: number;
27
- token: string;
28
- aud: string;
29
- jti?: string | undefined;
30
- }>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>>;
31
- refresh: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{
32
- uid: zod.ZodString;
33
- iat: zod.ZodNumber;
34
- exp: zod.ZodNumber;
35
- token: zod.ZodString;
36
- aud: zod.ZodString;
37
- jti: zod.ZodOptional<zod.ZodString>;
38
- } & {
13
+ }, zod.core.$strict>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>>;
14
+ refresh: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
15
+ uid: zod.ZodNonOptional<zod.ZodString>;
16
+ iat: zod.ZodNonOptional<zod.ZodNumber>;
17
+ exp: zod.ZodNonOptional<zod.ZodNumber>;
18
+ token: zod.ZodNonOptional<zod.ZodString>;
19
+ aud: zod.ZodNonOptional<zod.ZodString>;
20
+ jti: zod.ZodOptional<zod.ZodGUID>;
39
21
  type: zod.ZodLiteral<"refresh">;
40
- }, "strict", zod.ZodTypeAny, {
41
- type: "refresh";
42
- uid: string;
43
- iat: number;
44
- exp: number;
45
- token: string;
46
- aud: string;
47
- jti?: string | undefined;
48
- }, {
49
- type: "refresh";
50
- uid: string;
51
- iat: number;
52
- exp: number;
53
- token: string;
54
- aud: string;
55
- jti?: string | undefined;
56
- }>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>;
22
+ }, zod.core.$strict>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>;
57
23
  refresh_token_expiry: zod.ZodOptional<zod.ZodNumber>;
58
- }, "strict", zod.ZodTypeAny, {
59
- refresh?: {
60
- type: "refresh";
61
- uid: string;
62
- iat: number;
63
- exp: number;
64
- token: string;
65
- aud: string;
66
- jti?: string | undefined;
67
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
68
- access?: Record<string, {
69
- type: "access";
70
- uid: string;
71
- iat: number;
72
- exp: number;
73
- token: string;
74
- aud: string;
75
- jti?: string | undefined;
76
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
77
- refresh_token_expiry?: number | undefined;
78
- }, {
79
- refresh?: {
80
- type: "refresh";
81
- uid: string;
82
- iat: number;
83
- exp: number;
84
- token: string;
85
- aud: string;
86
- jti?: string | undefined;
87
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
88
- access?: Record<string, {
89
- type: "access";
90
- uid: string;
91
- iat: number;
92
- exp: number;
93
- token: string;
94
- aud: string;
95
- jti?: string | undefined;
96
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
97
- refresh_token_expiry?: number | undefined;
98
- }>, {
99
- refresh?: {
100
- type: "refresh";
101
- uid: string;
102
- iat: number;
103
- exp: number;
104
- token: string;
105
- aud: string;
106
- jti?: string | undefined;
107
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
108
- access?: Record<string, {
109
- type: "access";
110
- uid: string;
111
- iat: number;
112
- exp: number;
113
- token: string;
114
- aud: string;
115
- jti?: string | undefined;
116
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
117
- refresh_token_expiry?: number | undefined;
118
- }, {
119
- refresh?: {
120
- type: "refresh";
121
- uid: string;
122
- iat: number;
123
- exp: number;
124
- token: string;
125
- aud: string;
126
- jti?: string | undefined;
127
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
128
- access?: Record<string, {
129
- type: "access";
130
- uid: string;
131
- iat: number;
132
- exp: number;
133
- token: string;
134
- aud: string;
135
- jti?: string | undefined;
136
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
137
- refresh_token_expiry?: number | undefined;
138
- }>, {
139
- refresh?: {
140
- type: "refresh";
141
- uid: string;
142
- iat: number;
143
- exp: number;
144
- token: string;
145
- aud: string;
146
- jti?: string | undefined;
147
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
148
- access?: Record<string, {
149
- type: "access";
150
- uid: string;
151
- iat: number;
152
- exp: number;
153
- token: string;
154
- aud: string;
155
- jti?: string | undefined;
156
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
157
- refresh_token_expiry?: number | undefined;
158
- }, {
159
- refresh?: {
160
- type: "refresh";
161
- uid: string;
162
- iat: number;
163
- exp: number;
164
- token: string;
165
- aud: string;
166
- jti?: string | undefined;
167
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
168
- access?: Record<string, {
169
- type: "access";
170
- uid: string;
171
- iat: number;
172
- exp: number;
173
- token: string;
174
- aud: string;
175
- jti?: string | undefined;
176
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
177
- refresh_token_expiry?: number | undefined;
178
- }>;
24
+ }, zod.core.$strict>;
179
25
  export type SuccessfullyGeneratedTokensRecord = zod.infer<ReturnType<typeof createSuccessfullyGeneratedTokensRecordSchema>>;
180
- export declare function createRequestTokensResultSchema(z: typeof zod, environment?: SchemaVaultsAppEnvironment, overrides?: AudienceSchemaOverrides): zod.ZodUnion<[zod.ZodObject<{
181
- message: zod.ZodString;
182
- success: zod.ZodLiteral<false>;
183
- error: zod.ZodLiteral<true>;
184
- }, "strict", zod.ZodTypeAny, {
185
- message: string;
186
- success: false;
187
- error: true;
188
- }, {
189
- message: string;
190
- success: false;
191
- error: true;
192
- }>, zod.ZodObject<{
193
- message: zod.ZodString;
194
- client_app_id: zod.ZodEffects<zod.ZodEffects<zod.ZodString, string, string>, string, string>;
195
- success: zod.ZodLiteral<true>;
196
- error: zod.ZodLiteral<false>;
197
- tokens: zod.ZodOptional<zod.ZodEffects<zod.ZodEffects<zod.ZodObject<{
198
- access: zod.ZodOptional<zod.ZodRecord<zod.ZodUnion<[zod.ZodEffects<zod.ZodString, string, string>, zod.ZodEffects<zod.ZodEffects<zod.ZodEffects<zod.ZodString, string, string>, string, string>, string, string>]>, zod.ZodUnion<[zod.ZodObject<{
199
- uid: zod.ZodString;
200
- iat: zod.ZodNumber;
201
- exp: zod.ZodNumber;
202
- token: zod.ZodString;
203
- aud: zod.ZodString;
204
- jti: zod.ZodOptional<zod.ZodString>;
205
- } & {
26
+ export declare function createRequestTokensResultSchema(z: typeof zod, environment?: SchemaVaultsAppEnvironment, overrides?: AudienceSchemaOverrides): zod.ZodUnion<readonly [zod.ZodObject<{
27
+ success: zod.ZodNonOptional<zod.ZodLiteral<false>>;
28
+ error: zod.ZodNonOptional<zod.ZodLiteral<true>>;
29
+ message: zod.ZodNonOptional<zod.ZodString>;
30
+ }, zod.core.$strict>, zod.ZodObject<{
31
+ success: zod.ZodNonOptional<zod.ZodLiteral<true>>;
32
+ error: zod.ZodNonOptional<zod.ZodLiteral<false>>;
33
+ message: zod.ZodNonOptional<zod.ZodString>;
34
+ client_app_id: zod.ZodNonOptional<zod.ZodString>;
35
+ tokens: zod.ZodOptional<zod.ZodObject<{
36
+ access: zod.ZodOptional<zod.ZodRecord<zod.ZodUnion<readonly [zod.ZodURL & zod.ZodType<string, string, zod.core.$ZodTypeInternals<string, string>>, zod.ZodString]>, zod.ZodUnion<readonly [zod.ZodObject<{
37
+ uid: zod.ZodNonOptional<zod.ZodString>;
38
+ iat: zod.ZodNonOptional<zod.ZodNumber>;
39
+ exp: zod.ZodNonOptional<zod.ZodNumber>;
40
+ token: zod.ZodNonOptional<zod.ZodString>;
41
+ aud: zod.ZodNonOptional<zod.ZodString>;
42
+ jti: zod.ZodOptional<zod.ZodGUID>;
206
43
  type: zod.ZodLiteral<"access">;
207
- }, "strict", zod.ZodTypeAny, {
208
- type: "access";
209
- uid: string;
210
- iat: number;
211
- exp: number;
212
- token: string;
213
- aud: string;
214
- jti?: string | undefined;
215
- }, {
216
- type: "access";
217
- uid: string;
218
- iat: number;
219
- exp: number;
220
- token: string;
221
- aud: string;
222
- jti?: string | undefined;
223
- }>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>>;
224
- refresh: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{
225
- uid: zod.ZodString;
226
- iat: zod.ZodNumber;
227
- exp: zod.ZodNumber;
228
- token: zod.ZodString;
229
- aud: zod.ZodString;
230
- jti: zod.ZodOptional<zod.ZodString>;
231
- } & {
44
+ }, zod.core.$strict>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>>;
45
+ refresh: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
46
+ uid: zod.ZodNonOptional<zod.ZodString>;
47
+ iat: zod.ZodNonOptional<zod.ZodNumber>;
48
+ exp: zod.ZodNonOptional<zod.ZodNumber>;
49
+ token: zod.ZodNonOptional<zod.ZodString>;
50
+ aud: zod.ZodNonOptional<zod.ZodString>;
51
+ jti: zod.ZodOptional<zod.ZodGUID>;
232
52
  type: zod.ZodLiteral<"refresh">;
233
- }, "strict", zod.ZodTypeAny, {
234
- type: "refresh";
235
- uid: string;
236
- iat: number;
237
- exp: number;
238
- token: string;
239
- aud: string;
240
- jti?: string | undefined;
241
- }, {
242
- type: "refresh";
243
- uid: string;
244
- iat: number;
245
- exp: number;
246
- token: string;
247
- aud: string;
248
- jti?: string | undefined;
249
- }>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>;
53
+ }, zod.core.$strict>, zod.ZodLiteral<"AS_HTTP_ONLY_COOKIE">]>>;
250
54
  refresh_token_expiry: zod.ZodOptional<zod.ZodNumber>;
251
- }, "strict", zod.ZodTypeAny, {
252
- refresh?: {
253
- type: "refresh";
254
- uid: string;
255
- iat: number;
256
- exp: number;
257
- token: string;
258
- aud: string;
259
- jti?: string | undefined;
260
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
261
- access?: Record<string, {
262
- type: "access";
263
- uid: string;
264
- iat: number;
265
- exp: number;
266
- token: string;
267
- aud: string;
268
- jti?: string | undefined;
269
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
270
- refresh_token_expiry?: number | undefined;
271
- }, {
272
- refresh?: {
273
- type: "refresh";
274
- uid: string;
275
- iat: number;
276
- exp: number;
277
- token: string;
278
- aud: string;
279
- jti?: string | undefined;
280
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
281
- access?: Record<string, {
282
- type: "access";
283
- uid: string;
284
- iat: number;
285
- exp: number;
286
- token: string;
287
- aud: string;
288
- jti?: string | undefined;
289
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
290
- refresh_token_expiry?: number | undefined;
291
- }>, {
292
- refresh?: {
293
- type: "refresh";
294
- uid: string;
295
- iat: number;
296
- exp: number;
297
- token: string;
298
- aud: string;
299
- jti?: string | undefined;
300
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
301
- access?: Record<string, {
302
- type: "access";
303
- uid: string;
304
- iat: number;
305
- exp: number;
306
- token: string;
307
- aud: string;
308
- jti?: string | undefined;
309
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
310
- refresh_token_expiry?: number | undefined;
311
- }, {
312
- refresh?: {
313
- type: "refresh";
314
- uid: string;
315
- iat: number;
316
- exp: number;
317
- token: string;
318
- aud: string;
319
- jti?: string | undefined;
320
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
321
- access?: Record<string, {
322
- type: "access";
323
- uid: string;
324
- iat: number;
325
- exp: number;
326
- token: string;
327
- aud: string;
328
- jti?: string | undefined;
329
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
330
- refresh_token_expiry?: number | undefined;
331
- }>, {
332
- refresh?: {
333
- type: "refresh";
334
- uid: string;
335
- iat: number;
336
- exp: number;
337
- token: string;
338
- aud: string;
339
- jti?: string | undefined;
340
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
341
- access?: Record<string, {
342
- type: "access";
343
- uid: string;
344
- iat: number;
345
- exp: number;
346
- token: string;
347
- aud: string;
348
- jti?: string | undefined;
349
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
350
- refresh_token_expiry?: number | undefined;
351
- }, {
352
- refresh?: {
353
- type: "refresh";
354
- uid: string;
355
- iat: number;
356
- exp: number;
357
- token: string;
358
- aud: string;
359
- jti?: string | undefined;
360
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
361
- access?: Record<string, {
362
- type: "access";
363
- uid: string;
364
- iat: number;
365
- exp: number;
366
- token: string;
367
- aud: string;
368
- jti?: string | undefined;
369
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
370
- refresh_token_expiry?: number | undefined;
371
- }>>;
372
- userData: zod.ZodOptional<zod.ZodEffects<zod.ZodObject<{
373
- uid: zod.ZodString;
374
- sub: zod.ZodString;
375
- email: zod.ZodString;
55
+ }, zod.core.$strict>>;
56
+ userData: zod.ZodOptional<zod.ZodObject<{
57
+ uid: zod.ZodNonOptional<zod.ZodGUID>;
58
+ sub: zod.ZodNonOptional<zod.ZodGUID>;
59
+ email: zod.ZodNonOptional<zod.ZodEmail>;
376
60
  email_verified: zod.ZodOptional<zod.ZodBoolean>;
61
+ username: zod.ZodOptional<zod.ZodString>;
62
+ first_name: zod.ZodOptional<zod.ZodString>;
63
+ middle_name: zod.ZodOptional<zod.ZodString>;
64
+ last_name: zod.ZodOptional<zod.ZodString>;
65
+ display_name: zod.ZodOptional<zod.ZodString>;
377
66
  admin: zod.ZodOptional<zod.ZodBoolean>;
378
67
  phone_number: zod.ZodOptional<zod.ZodString>;
379
68
  phone_verified: zod.ZodOptional<zod.ZodBoolean>;
380
69
  disabled: zod.ZodOptional<zod.ZodBoolean>;
381
- created_at: zod.ZodNumber;
70
+ created_at: zod.ZodNonOptional<zod.ZodNumber>;
382
71
  invite_code: zod.ZodOptional<zod.ZodString>;
383
- }, "strict", zod.ZodTypeAny, {
384
- uid: string;
385
- sub: string;
386
- email: string;
387
- created_at: number;
388
- email_verified?: boolean | undefined;
389
- admin?: boolean | undefined;
390
- phone_number?: string | undefined;
391
- phone_verified?: boolean | undefined;
392
- disabled?: boolean | undefined;
393
- invite_code?: string | undefined;
394
- }, {
395
- uid: string;
396
- sub: string;
397
- email: string;
398
- created_at: number;
399
- email_verified?: boolean | undefined;
400
- admin?: boolean | undefined;
401
- phone_number?: string | undefined;
402
- phone_verified?: boolean | undefined;
403
- disabled?: boolean | undefined;
404
- invite_code?: string | undefined;
405
- }>, {
406
- uid: string;
407
- sub: string;
408
- email: string;
409
- created_at: number;
410
- email_verified?: boolean | undefined;
411
- admin?: boolean | undefined;
412
- phone_number?: string | undefined;
413
- phone_verified?: boolean | undefined;
414
- disabled?: boolean | undefined;
415
- invite_code?: string | undefined;
416
- }, {
417
- uid: string;
418
- sub: string;
419
- email: string;
420
- created_at: number;
421
- email_verified?: boolean | undefined;
422
- admin?: boolean | undefined;
423
- phone_number?: string | undefined;
424
- phone_verified?: boolean | undefined;
425
- disabled?: boolean | undefined;
426
- invite_code?: string | undefined;
427
- }>>;
428
- userOrgs: zod.ZodOptional<zod.ZodArray<zod.ZodEffects<zod.ZodEffects<zod.ZodString, string, string>, string, string>, "many">>;
72
+ }, zod.core.$strict>>;
73
+ userOrgs: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
429
74
  nonce: zod.ZodOptional<zod.ZodString>;
430
- }, "strict", zod.ZodTypeAny, {
431
- message: string;
432
- client_app_id: string;
433
- success: true;
434
- error: false;
435
- tokens?: {
436
- refresh?: {
437
- type: "refresh";
438
- uid: string;
439
- iat: number;
440
- exp: number;
441
- token: string;
442
- aud: string;
443
- jti?: string | undefined;
444
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
445
- access?: Record<string, {
446
- type: "access";
447
- uid: string;
448
- iat: number;
449
- exp: number;
450
- token: string;
451
- aud: string;
452
- jti?: string | undefined;
453
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
454
- refresh_token_expiry?: number | undefined;
455
- } | undefined;
456
- userData?: {
457
- uid: string;
458
- sub: string;
459
- email: string;
460
- created_at: number;
461
- email_verified?: boolean | undefined;
462
- admin?: boolean | undefined;
463
- phone_number?: string | undefined;
464
- phone_verified?: boolean | undefined;
465
- disabled?: boolean | undefined;
466
- invite_code?: string | undefined;
467
- } | undefined;
468
- userOrgs?: string[] | undefined;
469
- nonce?: string | undefined;
470
- }, {
471
- message: string;
472
- client_app_id: string;
473
- success: true;
474
- error: false;
475
- tokens?: {
476
- refresh?: {
477
- type: "refresh";
478
- uid: string;
479
- iat: number;
480
- exp: number;
481
- token: string;
482
- aud: string;
483
- jti?: string | undefined;
484
- } | "AS_HTTP_ONLY_COOKIE" | undefined;
485
- access?: Record<string, {
486
- type: "access";
487
- uid: string;
488
- iat: number;
489
- exp: number;
490
- token: string;
491
- aud: string;
492
- jti?: string | undefined;
493
- } | "AS_HTTP_ONLY_COOKIE"> | undefined;
494
- refresh_token_expiry?: number | undefined;
495
- } | undefined;
496
- userData?: {
497
- uid: string;
498
- sub: string;
499
- email: string;
500
- created_at: number;
501
- email_verified?: boolean | undefined;
502
- admin?: boolean | undefined;
503
- phone_number?: string | undefined;
504
- phone_verified?: boolean | undefined;
505
- disabled?: boolean | undefined;
506
- invite_code?: string | undefined;
507
- } | undefined;
508
- userOrgs?: string[] | undefined;
509
- nonce?: string | undefined;
510
- }>]>;
75
+ }, zod.core.$strict>]>;
511
76
  export type RequestTokensResult = zod.infer<ReturnType<typeof createRequestTokensResultSchema>>;
@@ -1,31 +1,15 @@
1
1
  import { z } from "zod";
2
- declare const validTokenTypes: z.ZodUnion<[z.ZodLiteral<"refresh">, z.ZodLiteral<"access">]>;
2
+ declare const validTokenTypes: z.ZodUnion<readonly [z.ZodLiteral<"refresh">, z.ZodLiteral<"access">]>;
3
3
  export type AuthTokenTypes = z.infer<typeof validTokenTypes>;
4
4
  export declare const tokenDataSchema: z.ZodObject<{
5
- type: z.ZodUnion<[z.ZodLiteral<"refresh">, z.ZodLiteral<"access">]>;
6
- uid: z.ZodString;
7
- iat: z.ZodNumber;
8
- exp: z.ZodNumber;
9
- token: z.ZodString;
10
- aud: z.ZodString;
11
- jti: z.ZodOptional<z.ZodString>;
12
- }, "strict", z.ZodTypeAny, {
13
- type: "refresh" | "access";
14
- uid: string;
15
- iat: number;
16
- exp: number;
17
- token: string;
18
- aud: string;
19
- jti?: string | undefined;
20
- }, {
21
- type: "refresh" | "access";
22
- uid: string;
23
- iat: number;
24
- exp: number;
25
- token: string;
26
- aud: string;
27
- jti?: string | undefined;
28
- }>;
5
+ type: z.ZodNonOptional<z.ZodUnion<readonly [z.ZodLiteral<"refresh">, z.ZodLiteral<"access">]>>;
6
+ uid: z.ZodNonOptional<z.ZodString>;
7
+ iat: z.ZodNonOptional<z.ZodNumber>;
8
+ exp: z.ZodNonOptional<z.ZodNumber>;
9
+ token: z.ZodNonOptional<z.ZodString>;
10
+ aud: z.ZodNonOptional<z.ZodString>;
11
+ jti: z.ZodOptional<z.ZodGUID>;
12
+ }, z.core.$strict>;
29
13
  /**
30
14
  * @name AuthToken
31
15
  * @description An object which contains a JSON web token. Contains details about the token (e.g. expiry, audience).
@@ -34,57 +18,23 @@ export declare const tokenDataSchema: z.ZodObject<{
34
18
  */
35
19
  export type AuthToken = z.infer<typeof tokenDataSchema>;
36
20
  export declare const refreshTokenDataSchema: z.ZodObject<{
37
- uid: z.ZodString;
38
- iat: z.ZodNumber;
39
- exp: z.ZodNumber;
40
- token: z.ZodString;
41
- aud: z.ZodString;
42
- jti: z.ZodOptional<z.ZodString>;
43
- } & {
21
+ uid: z.ZodNonOptional<z.ZodString>;
22
+ iat: z.ZodNonOptional<z.ZodNumber>;
23
+ exp: z.ZodNonOptional<z.ZodNumber>;
24
+ token: z.ZodNonOptional<z.ZodString>;
25
+ aud: z.ZodNonOptional<z.ZodString>;
26
+ jti: z.ZodOptional<z.ZodGUID>;
44
27
  type: z.ZodLiteral<"refresh">;
45
- }, "strict", z.ZodTypeAny, {
46
- type: "refresh";
47
- uid: string;
48
- iat: number;
49
- exp: number;
50
- token: string;
51
- aud: string;
52
- jti?: string | undefined;
53
- }, {
54
- type: "refresh";
55
- uid: string;
56
- iat: number;
57
- exp: number;
58
- token: string;
59
- aud: string;
60
- jti?: string | undefined;
61
- }>;
28
+ }, z.core.$strict>;
62
29
  export declare const accessTokenDataSchema: z.ZodObject<{
63
- uid: z.ZodString;
64
- iat: z.ZodNumber;
65
- exp: z.ZodNumber;
66
- token: z.ZodString;
67
- aud: z.ZodString;
68
- jti: z.ZodOptional<z.ZodString>;
69
- } & {
30
+ uid: z.ZodNonOptional<z.ZodString>;
31
+ iat: z.ZodNonOptional<z.ZodNumber>;
32
+ exp: z.ZodNonOptional<z.ZodNumber>;
33
+ token: z.ZodNonOptional<z.ZodString>;
34
+ aud: z.ZodNonOptional<z.ZodString>;
35
+ jti: z.ZodOptional<z.ZodGUID>;
70
36
  type: z.ZodLiteral<"access">;
71
- }, "strict", z.ZodTypeAny, {
72
- type: "access";
73
- uid: string;
74
- iat: number;
75
- exp: number;
76
- token: string;
77
- aud: string;
78
- jti?: string | undefined;
79
- }, {
80
- type: "access";
81
- uid: string;
82
- iat: number;
83
- exp: number;
84
- token: string;
85
- aud: string;
86
- jti?: string | undefined;
87
- }>;
37
+ }, z.core.$strict>;
88
38
  /**
89
39
  * @name RefreshToken
90
40
  * @description An object which contains a refresh token. Also contains details about the token (e.g. expiry, audience)
@@ -8,7 +8,7 @@ export const tokenDataSchema = z
8
8
  exp: z.number(),
9
9
  token: z.string(),
10
10
  aud: z.string(),
11
- jti: z.string().uuid().optional(),
11
+ jti: z.guid().optional(),
12
12
  })
13
13
  .required({
14
14
  type: true,