@ankhorage/contracts 25.0.0 → 25.1.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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/auth.d.ts +989 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +278 -0
- package/dist/auth.js.map +1 -1
- package/dist/structure/generated.d.ts +2 -2
- package/dist/structure/generated.js +2 -2
- package/dist/structure/generated.js.map +1 -1
- package/package.json +4 -7
- package/src/auth-schemas.test.ts +76 -0
- package/src/auth.ts +303 -0
- package/src/contracts.test.ts +1 -2
- package/src/structure/generated.ts +2 -2
package/dist/auth.d.ts
CHANGED
|
@@ -171,6 +171,644 @@ export interface VerifyOtpInput {
|
|
|
171
171
|
redirectTo?: string;
|
|
172
172
|
metadata?: Record<string, unknown>;
|
|
173
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Portable schema sources for the provider-neutral auth/session values and operation payloads.
|
|
176
|
+
*
|
|
177
|
+
* They describe the existing serializable contracts only. Auth execution, capability catalogs,
|
|
178
|
+
* adapter ports, and provider-specific configuration remain outside Contracts.
|
|
179
|
+
*/
|
|
180
|
+
export declare const AUTH_IDENTIFIER_SCHEMA: {
|
|
181
|
+
readonly type: "object";
|
|
182
|
+
readonly required: readonly ["kind", "value"];
|
|
183
|
+
readonly properties: {
|
|
184
|
+
readonly kind: {
|
|
185
|
+
readonly type: "string";
|
|
186
|
+
readonly enum: readonly ["email", "phone", "username"];
|
|
187
|
+
};
|
|
188
|
+
readonly value: {
|
|
189
|
+
readonly type: "string";
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
export declare const AUTH_USER_SCHEMA: {
|
|
194
|
+
readonly type: "object";
|
|
195
|
+
readonly required: readonly ["id"];
|
|
196
|
+
readonly properties: {
|
|
197
|
+
readonly id: {
|
|
198
|
+
readonly type: "string";
|
|
199
|
+
};
|
|
200
|
+
readonly email: {
|
|
201
|
+
readonly type: "string";
|
|
202
|
+
};
|
|
203
|
+
readonly phone: {
|
|
204
|
+
readonly type: "string";
|
|
205
|
+
};
|
|
206
|
+
readonly username: {
|
|
207
|
+
readonly type: "string";
|
|
208
|
+
};
|
|
209
|
+
readonly displayName: {
|
|
210
|
+
readonly type: "string";
|
|
211
|
+
};
|
|
212
|
+
readonly avatarUrl: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
};
|
|
215
|
+
readonly metadata: {
|
|
216
|
+
readonly type: "object";
|
|
217
|
+
readonly additionalProperties: {};
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
export declare const AUTH_SESSION_SCHEMA: {
|
|
222
|
+
readonly type: "object";
|
|
223
|
+
readonly required: readonly ["accessToken", "user"];
|
|
224
|
+
readonly properties: {
|
|
225
|
+
readonly accessToken: {
|
|
226
|
+
readonly type: "string";
|
|
227
|
+
};
|
|
228
|
+
readonly refreshToken: {
|
|
229
|
+
readonly type: "string";
|
|
230
|
+
};
|
|
231
|
+
readonly expiresAt: {
|
|
232
|
+
readonly type: "number";
|
|
233
|
+
};
|
|
234
|
+
readonly tokenType: {
|
|
235
|
+
readonly type: "string";
|
|
236
|
+
};
|
|
237
|
+
readonly user: {
|
|
238
|
+
readonly type: "object";
|
|
239
|
+
readonly required: readonly ["id"];
|
|
240
|
+
readonly properties: {
|
|
241
|
+
readonly id: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
};
|
|
244
|
+
readonly email: {
|
|
245
|
+
readonly type: "string";
|
|
246
|
+
};
|
|
247
|
+
readonly phone: {
|
|
248
|
+
readonly type: "string";
|
|
249
|
+
};
|
|
250
|
+
readonly username: {
|
|
251
|
+
readonly type: "string";
|
|
252
|
+
};
|
|
253
|
+
readonly displayName: {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
};
|
|
256
|
+
readonly avatarUrl: {
|
|
257
|
+
readonly type: "string";
|
|
258
|
+
};
|
|
259
|
+
readonly metadata: {
|
|
260
|
+
readonly type: "object";
|
|
261
|
+
readonly additionalProperties: {};
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
export declare const AUTH_ADAPTER_ERROR_SCHEMA: {
|
|
268
|
+
readonly type: "object";
|
|
269
|
+
readonly required: readonly ["code", "message"];
|
|
270
|
+
readonly properties: {
|
|
271
|
+
readonly code: {
|
|
272
|
+
readonly type: "string";
|
|
273
|
+
};
|
|
274
|
+
readonly message: {
|
|
275
|
+
readonly type: "string";
|
|
276
|
+
};
|
|
277
|
+
readonly cause: {};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
export declare const SIGN_IN_INPUT_SCHEMA: {
|
|
281
|
+
readonly type: "object";
|
|
282
|
+
readonly required: readonly ["identifier"];
|
|
283
|
+
readonly properties: {
|
|
284
|
+
readonly identifier: {
|
|
285
|
+
readonly type: "object";
|
|
286
|
+
readonly required: readonly ["kind", "value"];
|
|
287
|
+
readonly properties: {
|
|
288
|
+
readonly kind: {
|
|
289
|
+
readonly type: "string";
|
|
290
|
+
readonly enum: readonly ["email", "phone", "username"];
|
|
291
|
+
};
|
|
292
|
+
readonly value: {
|
|
293
|
+
readonly type: "string";
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
readonly password: {
|
|
298
|
+
readonly type: "string";
|
|
299
|
+
};
|
|
300
|
+
readonly otp: {
|
|
301
|
+
readonly type: "string";
|
|
302
|
+
};
|
|
303
|
+
readonly redirectTo: {
|
|
304
|
+
readonly type: "string";
|
|
305
|
+
};
|
|
306
|
+
readonly metadata: {
|
|
307
|
+
readonly type: "object";
|
|
308
|
+
readonly additionalProperties: {};
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
export declare const SIGN_UP_INPUT_SCHEMA: {
|
|
313
|
+
readonly type: "object";
|
|
314
|
+
readonly required: readonly ["identifier"];
|
|
315
|
+
readonly properties: {
|
|
316
|
+
readonly identifier: {
|
|
317
|
+
readonly type: "object";
|
|
318
|
+
readonly required: readonly ["kind", "value"];
|
|
319
|
+
readonly properties: {
|
|
320
|
+
readonly kind: {
|
|
321
|
+
readonly type: "string";
|
|
322
|
+
readonly enum: readonly ["email", "phone", "username"];
|
|
323
|
+
};
|
|
324
|
+
readonly value: {
|
|
325
|
+
readonly type: "string";
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
readonly password: {
|
|
330
|
+
readonly type: "string";
|
|
331
|
+
};
|
|
332
|
+
readonly profile: {
|
|
333
|
+
readonly type: "object";
|
|
334
|
+
readonly additionalProperties: {};
|
|
335
|
+
};
|
|
336
|
+
readonly redirectTo: {
|
|
337
|
+
readonly type: "string";
|
|
338
|
+
};
|
|
339
|
+
readonly metadata: {
|
|
340
|
+
readonly type: "object";
|
|
341
|
+
readonly additionalProperties: {};
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
export declare const SIGN_OUT_INPUT_SCHEMA: {
|
|
346
|
+
readonly type: "object";
|
|
347
|
+
readonly properties: {
|
|
348
|
+
readonly allDevices: {
|
|
349
|
+
readonly type: "boolean";
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
export declare const PASSWORD_RESET_INPUT_SCHEMA: {
|
|
354
|
+
readonly type: "object";
|
|
355
|
+
readonly required: readonly ["identifier"];
|
|
356
|
+
readonly properties: {
|
|
357
|
+
readonly identifier: {
|
|
358
|
+
readonly type: "object";
|
|
359
|
+
readonly required: readonly ["kind", "value"];
|
|
360
|
+
readonly properties: {
|
|
361
|
+
readonly kind: {
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
readonly enum: readonly ["email", "phone", "username"];
|
|
364
|
+
};
|
|
365
|
+
readonly value: {
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
readonly redirectTo: {
|
|
371
|
+
readonly type: "string";
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
export declare const VERIFY_OTP_INPUT_SCHEMA: {
|
|
376
|
+
readonly type: "object";
|
|
377
|
+
readonly required: readonly ["identifier", "token"];
|
|
378
|
+
readonly properties: {
|
|
379
|
+
readonly identifier: {
|
|
380
|
+
readonly type: "object";
|
|
381
|
+
readonly required: readonly ["kind", "value"];
|
|
382
|
+
readonly properties: {
|
|
383
|
+
readonly kind: {
|
|
384
|
+
readonly type: "string";
|
|
385
|
+
readonly enum: readonly ["email", "phone", "username"];
|
|
386
|
+
};
|
|
387
|
+
readonly value: {
|
|
388
|
+
readonly type: "string";
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
readonly token: {
|
|
393
|
+
readonly type: "string";
|
|
394
|
+
};
|
|
395
|
+
readonly redirectTo: {
|
|
396
|
+
readonly type: "string";
|
|
397
|
+
};
|
|
398
|
+
readonly metadata: {
|
|
399
|
+
readonly type: "object";
|
|
400
|
+
readonly additionalProperties: {};
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
export declare const AUTH_SUCCESS_SCHEMA: {
|
|
405
|
+
readonly type: "object";
|
|
406
|
+
readonly required: readonly ["ok"];
|
|
407
|
+
readonly properties: {
|
|
408
|
+
readonly ok: {
|
|
409
|
+
readonly const: true;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
export declare const AUTH_ERROR_RESULT_SCHEMA: {
|
|
414
|
+
readonly type: "object";
|
|
415
|
+
readonly required: readonly ["ok", "error"];
|
|
416
|
+
readonly properties: {
|
|
417
|
+
readonly ok: {
|
|
418
|
+
readonly const: false;
|
|
419
|
+
};
|
|
420
|
+
readonly error: {
|
|
421
|
+
readonly type: "object";
|
|
422
|
+
readonly required: readonly ["code", "message"];
|
|
423
|
+
readonly properties: {
|
|
424
|
+
readonly code: {
|
|
425
|
+
readonly type: "string";
|
|
426
|
+
};
|
|
427
|
+
readonly message: {
|
|
428
|
+
readonly type: "string";
|
|
429
|
+
};
|
|
430
|
+
readonly cause: {};
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
export declare const SIGN_IN_RESULT_SCHEMA: {
|
|
436
|
+
readonly oneOf: readonly [{
|
|
437
|
+
readonly properties: {
|
|
438
|
+
readonly data: {
|
|
439
|
+
readonly type: "object";
|
|
440
|
+
readonly required: readonly ["accessToken", "user"];
|
|
441
|
+
readonly properties: {
|
|
442
|
+
readonly accessToken: {
|
|
443
|
+
readonly type: "string";
|
|
444
|
+
};
|
|
445
|
+
readonly refreshToken: {
|
|
446
|
+
readonly type: "string";
|
|
447
|
+
};
|
|
448
|
+
readonly expiresAt: {
|
|
449
|
+
readonly type: "number";
|
|
450
|
+
};
|
|
451
|
+
readonly tokenType: {
|
|
452
|
+
readonly type: "string";
|
|
453
|
+
};
|
|
454
|
+
readonly user: {
|
|
455
|
+
readonly type: "object";
|
|
456
|
+
readonly required: readonly ["id"];
|
|
457
|
+
readonly properties: {
|
|
458
|
+
readonly id: {
|
|
459
|
+
readonly type: "string";
|
|
460
|
+
};
|
|
461
|
+
readonly email: {
|
|
462
|
+
readonly type: "string";
|
|
463
|
+
};
|
|
464
|
+
readonly phone: {
|
|
465
|
+
readonly type: "string";
|
|
466
|
+
};
|
|
467
|
+
readonly username: {
|
|
468
|
+
readonly type: "string";
|
|
469
|
+
};
|
|
470
|
+
readonly displayName: {
|
|
471
|
+
readonly type: "string";
|
|
472
|
+
};
|
|
473
|
+
readonly avatarUrl: {
|
|
474
|
+
readonly type: "string";
|
|
475
|
+
};
|
|
476
|
+
readonly metadata: {
|
|
477
|
+
readonly type: "object";
|
|
478
|
+
readonly additionalProperties: {};
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
readonly ok: {
|
|
485
|
+
readonly const: true;
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
readonly type: "object";
|
|
489
|
+
readonly required: readonly ["ok"];
|
|
490
|
+
}, {
|
|
491
|
+
readonly type: "object";
|
|
492
|
+
readonly required: readonly ["ok", "error"];
|
|
493
|
+
readonly properties: {
|
|
494
|
+
readonly ok: {
|
|
495
|
+
readonly const: false;
|
|
496
|
+
};
|
|
497
|
+
readonly error: {
|
|
498
|
+
readonly type: "object";
|
|
499
|
+
readonly required: readonly ["code", "message"];
|
|
500
|
+
readonly properties: {
|
|
501
|
+
readonly code: {
|
|
502
|
+
readonly type: "string";
|
|
503
|
+
};
|
|
504
|
+
readonly message: {
|
|
505
|
+
readonly type: "string";
|
|
506
|
+
};
|
|
507
|
+
readonly cause: {};
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
}];
|
|
512
|
+
};
|
|
513
|
+
export declare const SIGN_UP_RESULT_SCHEMA: {
|
|
514
|
+
readonly oneOf: readonly [{
|
|
515
|
+
readonly properties: {
|
|
516
|
+
readonly data: {
|
|
517
|
+
readonly oneOf: readonly [{
|
|
518
|
+
readonly type: "object";
|
|
519
|
+
readonly required: readonly ["accessToken", "user"];
|
|
520
|
+
readonly properties: {
|
|
521
|
+
readonly accessToken: {
|
|
522
|
+
readonly type: "string";
|
|
523
|
+
};
|
|
524
|
+
readonly refreshToken: {
|
|
525
|
+
readonly type: "string";
|
|
526
|
+
};
|
|
527
|
+
readonly expiresAt: {
|
|
528
|
+
readonly type: "number";
|
|
529
|
+
};
|
|
530
|
+
readonly tokenType: {
|
|
531
|
+
readonly type: "string";
|
|
532
|
+
};
|
|
533
|
+
readonly user: {
|
|
534
|
+
readonly type: "object";
|
|
535
|
+
readonly required: readonly ["id"];
|
|
536
|
+
readonly properties: {
|
|
537
|
+
readonly id: {
|
|
538
|
+
readonly type: "string";
|
|
539
|
+
};
|
|
540
|
+
readonly email: {
|
|
541
|
+
readonly type: "string";
|
|
542
|
+
};
|
|
543
|
+
readonly phone: {
|
|
544
|
+
readonly type: "string";
|
|
545
|
+
};
|
|
546
|
+
readonly username: {
|
|
547
|
+
readonly type: "string";
|
|
548
|
+
};
|
|
549
|
+
readonly displayName: {
|
|
550
|
+
readonly type: "string";
|
|
551
|
+
};
|
|
552
|
+
readonly avatarUrl: {
|
|
553
|
+
readonly type: "string";
|
|
554
|
+
};
|
|
555
|
+
readonly metadata: {
|
|
556
|
+
readonly type: "object";
|
|
557
|
+
readonly additionalProperties: {};
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
}, {
|
|
563
|
+
readonly type: "object";
|
|
564
|
+
readonly required: readonly ["id"];
|
|
565
|
+
readonly properties: {
|
|
566
|
+
readonly id: {
|
|
567
|
+
readonly type: "string";
|
|
568
|
+
};
|
|
569
|
+
readonly email: {
|
|
570
|
+
readonly type: "string";
|
|
571
|
+
};
|
|
572
|
+
readonly phone: {
|
|
573
|
+
readonly type: "string";
|
|
574
|
+
};
|
|
575
|
+
readonly username: {
|
|
576
|
+
readonly type: "string";
|
|
577
|
+
};
|
|
578
|
+
readonly displayName: {
|
|
579
|
+
readonly type: "string";
|
|
580
|
+
};
|
|
581
|
+
readonly avatarUrl: {
|
|
582
|
+
readonly type: "string";
|
|
583
|
+
};
|
|
584
|
+
readonly metadata: {
|
|
585
|
+
readonly type: "object";
|
|
586
|
+
readonly additionalProperties: {};
|
|
587
|
+
};
|
|
588
|
+
};
|
|
589
|
+
}];
|
|
590
|
+
};
|
|
591
|
+
readonly ok: {
|
|
592
|
+
readonly const: true;
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
readonly type: "object";
|
|
596
|
+
readonly required: readonly ["ok"];
|
|
597
|
+
}, {
|
|
598
|
+
readonly type: "object";
|
|
599
|
+
readonly required: readonly ["ok", "error"];
|
|
600
|
+
readonly properties: {
|
|
601
|
+
readonly ok: {
|
|
602
|
+
readonly const: false;
|
|
603
|
+
};
|
|
604
|
+
readonly error: {
|
|
605
|
+
readonly type: "object";
|
|
606
|
+
readonly required: readonly ["code", "message"];
|
|
607
|
+
readonly properties: {
|
|
608
|
+
readonly code: {
|
|
609
|
+
readonly type: "string";
|
|
610
|
+
};
|
|
611
|
+
readonly message: {
|
|
612
|
+
readonly type: "string";
|
|
613
|
+
};
|
|
614
|
+
readonly cause: {};
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
}];
|
|
619
|
+
};
|
|
620
|
+
export declare const AUTH_VOID_RESULT_SCHEMA: {
|
|
621
|
+
readonly oneOf: readonly [{
|
|
622
|
+
readonly type: "object";
|
|
623
|
+
readonly required: readonly ["ok"];
|
|
624
|
+
readonly properties: {
|
|
625
|
+
readonly ok: {
|
|
626
|
+
readonly const: true;
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
}, {
|
|
630
|
+
readonly type: "object";
|
|
631
|
+
readonly required: readonly ["ok", "error"];
|
|
632
|
+
readonly properties: {
|
|
633
|
+
readonly ok: {
|
|
634
|
+
readonly const: false;
|
|
635
|
+
};
|
|
636
|
+
readonly error: {
|
|
637
|
+
readonly type: "object";
|
|
638
|
+
readonly required: readonly ["code", "message"];
|
|
639
|
+
readonly properties: {
|
|
640
|
+
readonly code: {
|
|
641
|
+
readonly type: "string";
|
|
642
|
+
};
|
|
643
|
+
readonly message: {
|
|
644
|
+
readonly type: "string";
|
|
645
|
+
};
|
|
646
|
+
readonly cause: {};
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
}];
|
|
651
|
+
};
|
|
652
|
+
export declare const AUTH_SESSION_RESULT_SCHEMA: {
|
|
653
|
+
readonly oneOf: readonly [{
|
|
654
|
+
readonly properties: {
|
|
655
|
+
readonly data: {
|
|
656
|
+
readonly type: "object";
|
|
657
|
+
readonly required: readonly ["accessToken", "user"];
|
|
658
|
+
readonly properties: {
|
|
659
|
+
readonly accessToken: {
|
|
660
|
+
readonly type: "string";
|
|
661
|
+
};
|
|
662
|
+
readonly refreshToken: {
|
|
663
|
+
readonly type: "string";
|
|
664
|
+
};
|
|
665
|
+
readonly expiresAt: {
|
|
666
|
+
readonly type: "number";
|
|
667
|
+
};
|
|
668
|
+
readonly tokenType: {
|
|
669
|
+
readonly type: "string";
|
|
670
|
+
};
|
|
671
|
+
readonly user: {
|
|
672
|
+
readonly type: "object";
|
|
673
|
+
readonly required: readonly ["id"];
|
|
674
|
+
readonly properties: {
|
|
675
|
+
readonly id: {
|
|
676
|
+
readonly type: "string";
|
|
677
|
+
};
|
|
678
|
+
readonly email: {
|
|
679
|
+
readonly type: "string";
|
|
680
|
+
};
|
|
681
|
+
readonly phone: {
|
|
682
|
+
readonly type: "string";
|
|
683
|
+
};
|
|
684
|
+
readonly username: {
|
|
685
|
+
readonly type: "string";
|
|
686
|
+
};
|
|
687
|
+
readonly displayName: {
|
|
688
|
+
readonly type: "string";
|
|
689
|
+
};
|
|
690
|
+
readonly avatarUrl: {
|
|
691
|
+
readonly type: "string";
|
|
692
|
+
};
|
|
693
|
+
readonly metadata: {
|
|
694
|
+
readonly type: "object";
|
|
695
|
+
readonly additionalProperties: {};
|
|
696
|
+
};
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
};
|
|
701
|
+
readonly ok: {
|
|
702
|
+
readonly const: true;
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
readonly type: "object";
|
|
706
|
+
readonly required: readonly ["ok"];
|
|
707
|
+
}, {
|
|
708
|
+
readonly type: "object";
|
|
709
|
+
readonly required: readonly ["ok", "error"];
|
|
710
|
+
readonly properties: {
|
|
711
|
+
readonly ok: {
|
|
712
|
+
readonly const: false;
|
|
713
|
+
};
|
|
714
|
+
readonly error: {
|
|
715
|
+
readonly type: "object";
|
|
716
|
+
readonly required: readonly ["code", "message"];
|
|
717
|
+
readonly properties: {
|
|
718
|
+
readonly code: {
|
|
719
|
+
readonly type: "string";
|
|
720
|
+
};
|
|
721
|
+
readonly message: {
|
|
722
|
+
readonly type: "string";
|
|
723
|
+
};
|
|
724
|
+
readonly cause: {};
|
|
725
|
+
};
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
}];
|
|
729
|
+
};
|
|
730
|
+
export declare const AUTH_NULLABLE_SESSION_RESULT_SCHEMA: {
|
|
731
|
+
readonly oneOf: readonly [{
|
|
732
|
+
readonly properties: {
|
|
733
|
+
readonly data: {
|
|
734
|
+
readonly oneOf: readonly [{
|
|
735
|
+
readonly type: "object";
|
|
736
|
+
readonly required: readonly ["accessToken", "user"];
|
|
737
|
+
readonly properties: {
|
|
738
|
+
readonly accessToken: {
|
|
739
|
+
readonly type: "string";
|
|
740
|
+
};
|
|
741
|
+
readonly refreshToken: {
|
|
742
|
+
readonly type: "string";
|
|
743
|
+
};
|
|
744
|
+
readonly expiresAt: {
|
|
745
|
+
readonly type: "number";
|
|
746
|
+
};
|
|
747
|
+
readonly tokenType: {
|
|
748
|
+
readonly type: "string";
|
|
749
|
+
};
|
|
750
|
+
readonly user: {
|
|
751
|
+
readonly type: "object";
|
|
752
|
+
readonly required: readonly ["id"];
|
|
753
|
+
readonly properties: {
|
|
754
|
+
readonly id: {
|
|
755
|
+
readonly type: "string";
|
|
756
|
+
};
|
|
757
|
+
readonly email: {
|
|
758
|
+
readonly type: "string";
|
|
759
|
+
};
|
|
760
|
+
readonly phone: {
|
|
761
|
+
readonly type: "string";
|
|
762
|
+
};
|
|
763
|
+
readonly username: {
|
|
764
|
+
readonly type: "string";
|
|
765
|
+
};
|
|
766
|
+
readonly displayName: {
|
|
767
|
+
readonly type: "string";
|
|
768
|
+
};
|
|
769
|
+
readonly avatarUrl: {
|
|
770
|
+
readonly type: "string";
|
|
771
|
+
};
|
|
772
|
+
readonly metadata: {
|
|
773
|
+
readonly type: "object";
|
|
774
|
+
readonly additionalProperties: {};
|
|
775
|
+
};
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
}, {
|
|
780
|
+
readonly type: "null";
|
|
781
|
+
}];
|
|
782
|
+
};
|
|
783
|
+
readonly ok: {
|
|
784
|
+
readonly const: true;
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
readonly type: "object";
|
|
788
|
+
readonly required: readonly ["ok"];
|
|
789
|
+
}, {
|
|
790
|
+
readonly type: "object";
|
|
791
|
+
readonly required: readonly ["ok", "error"];
|
|
792
|
+
readonly properties: {
|
|
793
|
+
readonly ok: {
|
|
794
|
+
readonly const: false;
|
|
795
|
+
};
|
|
796
|
+
readonly error: {
|
|
797
|
+
readonly type: "object";
|
|
798
|
+
readonly required: readonly ["code", "message"];
|
|
799
|
+
readonly properties: {
|
|
800
|
+
readonly code: {
|
|
801
|
+
readonly type: "string";
|
|
802
|
+
};
|
|
803
|
+
readonly message: {
|
|
804
|
+
readonly type: "string";
|
|
805
|
+
};
|
|
806
|
+
readonly cause: {};
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
}];
|
|
811
|
+
};
|
|
174
812
|
export declare const AUTH_OAUTH_ERROR_STAGES: readonly ["start", "transport", "callback", "exchange", "session", "profile"];
|
|
175
813
|
export type AuthOAuthErrorStage = (typeof AUTH_OAUTH_ERROR_STAGES)[number];
|
|
176
814
|
export declare const AUTH_OAUTH_ERROR_CODES: readonly ["oauth_unavailable", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "authorization_failed", "authorization_attempt_not_found", "invalid_callback", "state_mismatch", "pkce_mismatch", "callback_already_completed", "code_exchange_failed", "network_error", "session_persistence_failed", "profile_creation_failed", "provider_error"];
|
|
@@ -225,6 +863,357 @@ export interface CompleteOAuthAuthorizationInput {
|
|
|
225
863
|
attemptId: string;
|
|
226
864
|
response: AuthOAuthAuthorizationResponse;
|
|
227
865
|
}
|
|
866
|
+
export declare const AUTH_EMPTY_INPUT_SCHEMA: {
|
|
867
|
+
readonly type: "object";
|
|
868
|
+
};
|
|
869
|
+
export declare const START_OAUTH_AUTHORIZATION_INPUT_SCHEMA: {
|
|
870
|
+
readonly type: "object";
|
|
871
|
+
readonly required: readonly ["provider", "redirectUri"];
|
|
872
|
+
readonly properties: {
|
|
873
|
+
readonly provider: {
|
|
874
|
+
readonly type: "string";
|
|
875
|
+
};
|
|
876
|
+
readonly redirectUri: {
|
|
877
|
+
readonly type: "string";
|
|
878
|
+
};
|
|
879
|
+
readonly scopes: {
|
|
880
|
+
readonly type: "array";
|
|
881
|
+
readonly items: {
|
|
882
|
+
readonly type: "string";
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
readonly queryParams: {
|
|
886
|
+
readonly type: "object";
|
|
887
|
+
readonly additionalProperties: {
|
|
888
|
+
readonly type: "string";
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
export declare const AUTH_OAUTH_AUTHORIZATION_REQUEST_SCHEMA: {
|
|
894
|
+
readonly type: "object";
|
|
895
|
+
readonly required: readonly ["attemptId", "provider", "authorizationUrl", "redirectUri"];
|
|
896
|
+
readonly properties: {
|
|
897
|
+
readonly attemptId: {
|
|
898
|
+
readonly type: "string";
|
|
899
|
+
};
|
|
900
|
+
readonly provider: {
|
|
901
|
+
readonly type: "string";
|
|
902
|
+
};
|
|
903
|
+
readonly authorizationUrl: {
|
|
904
|
+
readonly type: "string";
|
|
905
|
+
};
|
|
906
|
+
readonly redirectUri: {
|
|
907
|
+
readonly type: "string";
|
|
908
|
+
};
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
export declare const AUTH_OAUTH_ERROR_SCHEMA: {
|
|
912
|
+
readonly type: "object";
|
|
913
|
+
readonly required: readonly ["code", "message", "stage", "recoverable"];
|
|
914
|
+
readonly properties: {
|
|
915
|
+
readonly code: {
|
|
916
|
+
readonly type: "string";
|
|
917
|
+
readonly enum: readonly ["oauth_unavailable", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "authorization_failed", "authorization_attempt_not_found", "invalid_callback", "state_mismatch", "pkce_mismatch", "callback_already_completed", "code_exchange_failed", "network_error", "session_persistence_failed", "profile_creation_failed", "provider_error"];
|
|
918
|
+
};
|
|
919
|
+
readonly message: {
|
|
920
|
+
readonly type: "string";
|
|
921
|
+
};
|
|
922
|
+
readonly cause: {};
|
|
923
|
+
readonly stage: {
|
|
924
|
+
readonly type: "string";
|
|
925
|
+
readonly enum: readonly ["start", "transport", "callback", "exchange", "session", "profile"];
|
|
926
|
+
};
|
|
927
|
+
readonly provider: {
|
|
928
|
+
readonly type: "string";
|
|
929
|
+
};
|
|
930
|
+
readonly recoverable: {
|
|
931
|
+
readonly type: "boolean";
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
};
|
|
935
|
+
export declare const AUTH_OAUTH_START_RESULT_SCHEMA: {
|
|
936
|
+
readonly oneOf: readonly [{
|
|
937
|
+
readonly type: "object";
|
|
938
|
+
readonly required: readonly ["ok", "data"];
|
|
939
|
+
readonly properties: {
|
|
940
|
+
readonly ok: {
|
|
941
|
+
readonly const: true;
|
|
942
|
+
};
|
|
943
|
+
readonly data: {
|
|
944
|
+
readonly type: "object";
|
|
945
|
+
readonly required: readonly ["attemptId", "provider", "authorizationUrl", "redirectUri"];
|
|
946
|
+
readonly properties: {
|
|
947
|
+
readonly attemptId: {
|
|
948
|
+
readonly type: "string";
|
|
949
|
+
};
|
|
950
|
+
readonly provider: {
|
|
951
|
+
readonly type: "string";
|
|
952
|
+
};
|
|
953
|
+
readonly authorizationUrl: {
|
|
954
|
+
readonly type: "string";
|
|
955
|
+
};
|
|
956
|
+
readonly redirectUri: {
|
|
957
|
+
readonly type: "string";
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
}, {
|
|
963
|
+
readonly type: "object";
|
|
964
|
+
readonly required: readonly ["ok", "error"];
|
|
965
|
+
readonly properties: {
|
|
966
|
+
readonly ok: {
|
|
967
|
+
readonly const: false;
|
|
968
|
+
};
|
|
969
|
+
readonly error: {
|
|
970
|
+
readonly type: "object";
|
|
971
|
+
readonly required: readonly ["code", "message", "stage", "recoverable"];
|
|
972
|
+
readonly properties: {
|
|
973
|
+
readonly code: {
|
|
974
|
+
readonly type: "string";
|
|
975
|
+
readonly enum: readonly ["oauth_unavailable", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "authorization_failed", "authorization_attempt_not_found", "invalid_callback", "state_mismatch", "pkce_mismatch", "callback_already_completed", "code_exchange_failed", "network_error", "session_persistence_failed", "profile_creation_failed", "provider_error"];
|
|
976
|
+
};
|
|
977
|
+
readonly message: {
|
|
978
|
+
readonly type: "string";
|
|
979
|
+
};
|
|
980
|
+
readonly cause: {};
|
|
981
|
+
readonly stage: {
|
|
982
|
+
readonly type: "string";
|
|
983
|
+
readonly enum: readonly ["start", "transport", "callback", "exchange", "session", "profile"];
|
|
984
|
+
};
|
|
985
|
+
readonly provider: {
|
|
986
|
+
readonly type: "string";
|
|
987
|
+
};
|
|
988
|
+
readonly recoverable: {
|
|
989
|
+
readonly type: "boolean";
|
|
990
|
+
};
|
|
991
|
+
};
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
}];
|
|
995
|
+
};
|
|
996
|
+
export declare const AUTH_OAUTH_AUTHORIZATION_RESPONSE_SCHEMA: {
|
|
997
|
+
readonly oneOf: readonly [{
|
|
998
|
+
readonly type: "object";
|
|
999
|
+
readonly required: readonly ["type", "url"];
|
|
1000
|
+
readonly properties: {
|
|
1001
|
+
readonly type: {
|
|
1002
|
+
readonly const: "callback";
|
|
1003
|
+
};
|
|
1004
|
+
readonly url: {
|
|
1005
|
+
readonly type: "string";
|
|
1006
|
+
};
|
|
1007
|
+
};
|
|
1008
|
+
}, {
|
|
1009
|
+
readonly type: "object";
|
|
1010
|
+
readonly required: readonly ["type", "reason"];
|
|
1011
|
+
readonly properties: {
|
|
1012
|
+
readonly type: {
|
|
1013
|
+
readonly const: "cancelled";
|
|
1014
|
+
};
|
|
1015
|
+
readonly reason: {
|
|
1016
|
+
readonly type: "string";
|
|
1017
|
+
readonly enum: readonly ["user_cancelled", "browser_dismissed"];
|
|
1018
|
+
};
|
|
1019
|
+
};
|
|
1020
|
+
}, {
|
|
1021
|
+
readonly type: "object";
|
|
1022
|
+
readonly required: readonly ["type", "error"];
|
|
1023
|
+
readonly properties: {
|
|
1024
|
+
readonly type: {
|
|
1025
|
+
readonly const: "error";
|
|
1026
|
+
};
|
|
1027
|
+
readonly error: {
|
|
1028
|
+
readonly type: "object";
|
|
1029
|
+
readonly required: readonly ["code", "message"];
|
|
1030
|
+
readonly properties: {
|
|
1031
|
+
readonly code: {
|
|
1032
|
+
readonly type: "string";
|
|
1033
|
+
readonly enum: readonly ["browser_unavailable", "transport_failed"];
|
|
1034
|
+
};
|
|
1035
|
+
readonly message: {
|
|
1036
|
+
readonly type: "string";
|
|
1037
|
+
};
|
|
1038
|
+
readonly cause: {};
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
};
|
|
1042
|
+
}];
|
|
1043
|
+
};
|
|
1044
|
+
export declare const COMPLETE_OAUTH_AUTHORIZATION_INPUT_SCHEMA: {
|
|
1045
|
+
readonly type: "object";
|
|
1046
|
+
readonly required: readonly ["attemptId", "response"];
|
|
1047
|
+
readonly properties: {
|
|
1048
|
+
readonly attemptId: {
|
|
1049
|
+
readonly type: "string";
|
|
1050
|
+
};
|
|
1051
|
+
readonly response: {
|
|
1052
|
+
readonly oneOf: readonly [{
|
|
1053
|
+
readonly type: "object";
|
|
1054
|
+
readonly required: readonly ["type", "url"];
|
|
1055
|
+
readonly properties: {
|
|
1056
|
+
readonly type: {
|
|
1057
|
+
readonly const: "callback";
|
|
1058
|
+
};
|
|
1059
|
+
readonly url: {
|
|
1060
|
+
readonly type: "string";
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1063
|
+
}, {
|
|
1064
|
+
readonly type: "object";
|
|
1065
|
+
readonly required: readonly ["type", "reason"];
|
|
1066
|
+
readonly properties: {
|
|
1067
|
+
readonly type: {
|
|
1068
|
+
readonly const: "cancelled";
|
|
1069
|
+
};
|
|
1070
|
+
readonly reason: {
|
|
1071
|
+
readonly type: "string";
|
|
1072
|
+
readonly enum: readonly ["user_cancelled", "browser_dismissed"];
|
|
1073
|
+
};
|
|
1074
|
+
};
|
|
1075
|
+
}, {
|
|
1076
|
+
readonly type: "object";
|
|
1077
|
+
readonly required: readonly ["type", "error"];
|
|
1078
|
+
readonly properties: {
|
|
1079
|
+
readonly type: {
|
|
1080
|
+
readonly const: "error";
|
|
1081
|
+
};
|
|
1082
|
+
readonly error: {
|
|
1083
|
+
readonly type: "object";
|
|
1084
|
+
readonly required: readonly ["code", "message"];
|
|
1085
|
+
readonly properties: {
|
|
1086
|
+
readonly code: {
|
|
1087
|
+
readonly type: "string";
|
|
1088
|
+
readonly enum: readonly ["browser_unavailable", "transport_failed"];
|
|
1089
|
+
};
|
|
1090
|
+
readonly message: {
|
|
1091
|
+
readonly type: "string";
|
|
1092
|
+
};
|
|
1093
|
+
readonly cause: {};
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
1096
|
+
};
|
|
1097
|
+
}];
|
|
1098
|
+
};
|
|
1099
|
+
};
|
|
1100
|
+
};
|
|
1101
|
+
export declare const AUTH_OAUTH_COMPLETION_RESULT_SCHEMA: {
|
|
1102
|
+
readonly oneOf: readonly [{
|
|
1103
|
+
readonly type: "object";
|
|
1104
|
+
readonly required: readonly ["ok", "status", "provider", "session"];
|
|
1105
|
+
readonly properties: {
|
|
1106
|
+
readonly ok: {
|
|
1107
|
+
readonly const: true;
|
|
1108
|
+
};
|
|
1109
|
+
readonly status: {
|
|
1110
|
+
readonly const: "authenticated";
|
|
1111
|
+
};
|
|
1112
|
+
readonly provider: {
|
|
1113
|
+
readonly type: "string";
|
|
1114
|
+
};
|
|
1115
|
+
readonly session: {
|
|
1116
|
+
readonly type: "object";
|
|
1117
|
+
readonly required: readonly ["accessToken", "user"];
|
|
1118
|
+
readonly properties: {
|
|
1119
|
+
readonly accessToken: {
|
|
1120
|
+
readonly type: "string";
|
|
1121
|
+
};
|
|
1122
|
+
readonly refreshToken: {
|
|
1123
|
+
readonly type: "string";
|
|
1124
|
+
};
|
|
1125
|
+
readonly expiresAt: {
|
|
1126
|
+
readonly type: "number";
|
|
1127
|
+
};
|
|
1128
|
+
readonly tokenType: {
|
|
1129
|
+
readonly type: "string";
|
|
1130
|
+
};
|
|
1131
|
+
readonly user: {
|
|
1132
|
+
readonly type: "object";
|
|
1133
|
+
readonly required: readonly ["id"];
|
|
1134
|
+
readonly properties: {
|
|
1135
|
+
readonly id: {
|
|
1136
|
+
readonly type: "string";
|
|
1137
|
+
};
|
|
1138
|
+
readonly email: {
|
|
1139
|
+
readonly type: "string";
|
|
1140
|
+
};
|
|
1141
|
+
readonly phone: {
|
|
1142
|
+
readonly type: "string";
|
|
1143
|
+
};
|
|
1144
|
+
readonly username: {
|
|
1145
|
+
readonly type: "string";
|
|
1146
|
+
};
|
|
1147
|
+
readonly displayName: {
|
|
1148
|
+
readonly type: "string";
|
|
1149
|
+
};
|
|
1150
|
+
readonly avatarUrl: {
|
|
1151
|
+
readonly type: "string";
|
|
1152
|
+
};
|
|
1153
|
+
readonly metadata: {
|
|
1154
|
+
readonly type: "object";
|
|
1155
|
+
readonly additionalProperties: {};
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
};
|
|
1160
|
+
};
|
|
1161
|
+
};
|
|
1162
|
+
}, {
|
|
1163
|
+
readonly type: "object";
|
|
1164
|
+
readonly required: readonly ["ok", "status", "provider", "reason"];
|
|
1165
|
+
readonly properties: {
|
|
1166
|
+
readonly ok: {
|
|
1167
|
+
readonly const: false;
|
|
1168
|
+
};
|
|
1169
|
+
readonly status: {
|
|
1170
|
+
readonly const: "cancelled";
|
|
1171
|
+
};
|
|
1172
|
+
readonly provider: {
|
|
1173
|
+
readonly type: "string";
|
|
1174
|
+
};
|
|
1175
|
+
readonly reason: {
|
|
1176
|
+
readonly type: "string";
|
|
1177
|
+
readonly enum: readonly ["user_cancelled", "browser_dismissed", "provider_denied"];
|
|
1178
|
+
};
|
|
1179
|
+
};
|
|
1180
|
+
}, {
|
|
1181
|
+
readonly type: "object";
|
|
1182
|
+
readonly required: readonly ["ok", "status", "error"];
|
|
1183
|
+
readonly properties: {
|
|
1184
|
+
readonly ok: {
|
|
1185
|
+
readonly const: false;
|
|
1186
|
+
};
|
|
1187
|
+
readonly status: {
|
|
1188
|
+
readonly const: "error";
|
|
1189
|
+
};
|
|
1190
|
+
readonly error: {
|
|
1191
|
+
readonly type: "object";
|
|
1192
|
+
readonly required: readonly ["code", "message", "stage", "recoverable"];
|
|
1193
|
+
readonly properties: {
|
|
1194
|
+
readonly code: {
|
|
1195
|
+
readonly type: "string";
|
|
1196
|
+
readonly enum: readonly ["oauth_unavailable", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "authorization_failed", "authorization_attempt_not_found", "invalid_callback", "state_mismatch", "pkce_mismatch", "callback_already_completed", "code_exchange_failed", "network_error", "session_persistence_failed", "profile_creation_failed", "provider_error"];
|
|
1197
|
+
};
|
|
1198
|
+
readonly message: {
|
|
1199
|
+
readonly type: "string";
|
|
1200
|
+
};
|
|
1201
|
+
readonly cause: {};
|
|
1202
|
+
readonly stage: {
|
|
1203
|
+
readonly type: "string";
|
|
1204
|
+
readonly enum: readonly ["start", "transport", "callback", "exchange", "session", "profile"];
|
|
1205
|
+
};
|
|
1206
|
+
readonly provider: {
|
|
1207
|
+
readonly type: "string";
|
|
1208
|
+
};
|
|
1209
|
+
readonly recoverable: {
|
|
1210
|
+
readonly type: "boolean";
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
};
|
|
1214
|
+
};
|
|
1215
|
+
}];
|
|
1216
|
+
};
|
|
228
1217
|
export type AuthOAuthCompletionResult = {
|
|
229
1218
|
ok: true;
|
|
230
1219
|
status: 'authenticated';
|