@ankhorage/auth 0.0.0-stage → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,1391 @@
1
1
  {
2
2
  "name": "@ankhorage/auth",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.3",
4
+ "description": "Provider-neutral authentication ports and capability catalog for Ankhorage applications.",
5
+ "homepage": "https://github.com/ankhorage/auth#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/ankhorage/auth/issues"
8
+ },
9
+ "keywords": [
10
+ "ankhorage",
11
+ "authentication",
12
+ "capabilities",
13
+ "session"
14
+ ],
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "sideEffects": false,
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/ankhorage/auth.git"
22
+ },
23
+ "license": "MIT",
24
+ "files": [
25
+ "dist",
26
+ "src",
27
+ "package.json",
28
+ "LICENSE"
29
+ ],
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.js",
34
+ "default": "./dist/index.js"
35
+ },
36
+ "./capabilities": {
37
+ "types": "./dist/capabilities/index.d.ts",
38
+ "import": "./dist/capabilities/index.js",
39
+ "default": "./dist/capabilities/index.js"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "ankh": {
47
+ "category": "auth",
48
+ "provider": null,
49
+ "capabilities": [
50
+ {
51
+ "id": "auth.signIn",
52
+ "owner": "@ankhorage/auth",
53
+ "access": [
54
+ "invoke"
55
+ ],
56
+ "binding": {
57
+ "kind": "auth",
58
+ "bindableAs": [
59
+ "target"
60
+ ]
61
+ },
62
+ "input": {
63
+ "schema": {
64
+ "type": "object",
65
+ "required": [
66
+ "identifier"
67
+ ],
68
+ "properties": {
69
+ "identifier": {
70
+ "type": "object",
71
+ "required": [
72
+ "kind",
73
+ "value"
74
+ ],
75
+ "properties": {
76
+ "kind": {
77
+ "type": "string",
78
+ "enum": [
79
+ "email",
80
+ "phone",
81
+ "username"
82
+ ]
83
+ },
84
+ "value": {
85
+ "type": "string"
86
+ }
87
+ }
88
+ },
89
+ "password": {
90
+ "type": "string"
91
+ },
92
+ "otp": {
93
+ "type": "string"
94
+ },
95
+ "redirectTo": {
96
+ "type": "string"
97
+ },
98
+ "metadata": {
99
+ "type": "object",
100
+ "additionalProperties": {}
101
+ }
102
+ }
103
+ }
104
+ },
105
+ "output": {
106
+ "schema": {
107
+ "oneOf": [
108
+ {
109
+ "type": "object",
110
+ "required": [
111
+ "ok"
112
+ ],
113
+ "properties": {
114
+ "ok": {
115
+ "const": true
116
+ },
117
+ "data": {
118
+ "type": "object",
119
+ "required": [
120
+ "accessToken",
121
+ "user"
122
+ ],
123
+ "properties": {
124
+ "accessToken": {
125
+ "type": "string"
126
+ },
127
+ "refreshToken": {
128
+ "type": "string"
129
+ },
130
+ "expiresAt": {
131
+ "type": "number"
132
+ },
133
+ "tokenType": {
134
+ "type": "string"
135
+ },
136
+ "user": {
137
+ "type": "object",
138
+ "required": [
139
+ "id"
140
+ ],
141
+ "properties": {
142
+ "id": {
143
+ "type": "string"
144
+ },
145
+ "email": {
146
+ "type": "string"
147
+ },
148
+ "phone": {
149
+ "type": "string"
150
+ },
151
+ "username": {
152
+ "type": "string"
153
+ },
154
+ "displayName": {
155
+ "type": "string"
156
+ },
157
+ "avatarUrl": {
158
+ "type": "string"
159
+ },
160
+ "metadata": {
161
+ "type": "object",
162
+ "additionalProperties": {}
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ },
170
+ {
171
+ "type": "object",
172
+ "required": [
173
+ "ok",
174
+ "error"
175
+ ],
176
+ "properties": {
177
+ "ok": {
178
+ "const": false
179
+ },
180
+ "error": {
181
+ "type": "object",
182
+ "required": [
183
+ "code",
184
+ "message"
185
+ ],
186
+ "properties": {
187
+ "code": {
188
+ "type": "string"
189
+ },
190
+ "message": {
191
+ "type": "string"
192
+ },
193
+ "cause": {}
194
+ }
195
+ }
196
+ }
197
+ }
198
+ ]
199
+ }
200
+ }
201
+ },
202
+ {
203
+ "id": "auth.signUp",
204
+ "owner": "@ankhorage/auth",
205
+ "access": [
206
+ "invoke"
207
+ ],
208
+ "binding": {
209
+ "kind": "auth",
210
+ "bindableAs": [
211
+ "target"
212
+ ]
213
+ },
214
+ "input": {
215
+ "schema": {
216
+ "type": "object",
217
+ "required": [
218
+ "identifier"
219
+ ],
220
+ "properties": {
221
+ "identifier": {
222
+ "type": "object",
223
+ "required": [
224
+ "kind",
225
+ "value"
226
+ ],
227
+ "properties": {
228
+ "kind": {
229
+ "type": "string",
230
+ "enum": [
231
+ "email",
232
+ "phone",
233
+ "username"
234
+ ]
235
+ },
236
+ "value": {
237
+ "type": "string"
238
+ }
239
+ }
240
+ },
241
+ "password": {
242
+ "type": "string"
243
+ },
244
+ "profile": {
245
+ "type": "object",
246
+ "additionalProperties": {}
247
+ },
248
+ "redirectTo": {
249
+ "type": "string"
250
+ },
251
+ "metadata": {
252
+ "type": "object",
253
+ "additionalProperties": {}
254
+ }
255
+ }
256
+ }
257
+ },
258
+ "output": {
259
+ "schema": {
260
+ "oneOf": [
261
+ {
262
+ "type": "object",
263
+ "required": [
264
+ "ok"
265
+ ],
266
+ "properties": {
267
+ "ok": {
268
+ "const": true
269
+ },
270
+ "data": {
271
+ "oneOf": [
272
+ {
273
+ "type": "object",
274
+ "required": [
275
+ "accessToken",
276
+ "user"
277
+ ],
278
+ "properties": {
279
+ "accessToken": {
280
+ "type": "string"
281
+ },
282
+ "refreshToken": {
283
+ "type": "string"
284
+ },
285
+ "expiresAt": {
286
+ "type": "number"
287
+ },
288
+ "tokenType": {
289
+ "type": "string"
290
+ },
291
+ "user": {
292
+ "type": "object",
293
+ "required": [
294
+ "id"
295
+ ],
296
+ "properties": {
297
+ "id": {
298
+ "type": "string"
299
+ },
300
+ "email": {
301
+ "type": "string"
302
+ },
303
+ "phone": {
304
+ "type": "string"
305
+ },
306
+ "username": {
307
+ "type": "string"
308
+ },
309
+ "displayName": {
310
+ "type": "string"
311
+ },
312
+ "avatarUrl": {
313
+ "type": "string"
314
+ },
315
+ "metadata": {
316
+ "type": "object",
317
+ "additionalProperties": {}
318
+ }
319
+ }
320
+ }
321
+ }
322
+ },
323
+ {
324
+ "type": "object",
325
+ "required": [
326
+ "id"
327
+ ],
328
+ "properties": {
329
+ "id": {
330
+ "type": "string"
331
+ },
332
+ "email": {
333
+ "type": "string"
334
+ },
335
+ "phone": {
336
+ "type": "string"
337
+ },
338
+ "username": {
339
+ "type": "string"
340
+ },
341
+ "displayName": {
342
+ "type": "string"
343
+ },
344
+ "avatarUrl": {
345
+ "type": "string"
346
+ },
347
+ "metadata": {
348
+ "type": "object",
349
+ "additionalProperties": {}
350
+ }
351
+ }
352
+ }
353
+ ]
354
+ }
355
+ }
356
+ },
357
+ {
358
+ "type": "object",
359
+ "required": [
360
+ "ok",
361
+ "error"
362
+ ],
363
+ "properties": {
364
+ "ok": {
365
+ "const": false
366
+ },
367
+ "error": {
368
+ "type": "object",
369
+ "required": [
370
+ "code",
371
+ "message"
372
+ ],
373
+ "properties": {
374
+ "code": {
375
+ "type": "string"
376
+ },
377
+ "message": {
378
+ "type": "string"
379
+ },
380
+ "cause": {}
381
+ }
382
+ }
383
+ }
384
+ }
385
+ ]
386
+ }
387
+ }
388
+ },
389
+ {
390
+ "id": "auth.signOut",
391
+ "owner": "@ankhorage/auth",
392
+ "access": [
393
+ "invoke"
394
+ ],
395
+ "binding": {
396
+ "kind": "auth",
397
+ "bindableAs": [
398
+ "target"
399
+ ]
400
+ },
401
+ "input": {
402
+ "schema": {
403
+ "type": "object",
404
+ "properties": {
405
+ "allDevices": {
406
+ "type": "boolean"
407
+ }
408
+ }
409
+ }
410
+ },
411
+ "output": {
412
+ "schema": {
413
+ "oneOf": [
414
+ {
415
+ "type": "object",
416
+ "required": [
417
+ "ok"
418
+ ],
419
+ "properties": {
420
+ "ok": {
421
+ "const": true
422
+ }
423
+ }
424
+ },
425
+ {
426
+ "type": "object",
427
+ "required": [
428
+ "ok",
429
+ "error"
430
+ ],
431
+ "properties": {
432
+ "ok": {
433
+ "const": false
434
+ },
435
+ "error": {
436
+ "type": "object",
437
+ "required": [
438
+ "code",
439
+ "message"
440
+ ],
441
+ "properties": {
442
+ "code": {
443
+ "type": "string"
444
+ },
445
+ "message": {
446
+ "type": "string"
447
+ },
448
+ "cause": {}
449
+ }
450
+ }
451
+ }
452
+ }
453
+ ]
454
+ }
455
+ }
456
+ },
457
+ {
458
+ "id": "auth.getSession",
459
+ "owner": "@ankhorage/auth",
460
+ "access": [
461
+ "invoke"
462
+ ],
463
+ "binding": {
464
+ "kind": "auth",
465
+ "bindableAs": [
466
+ "target"
467
+ ]
468
+ },
469
+ "input": {
470
+ "schema": {
471
+ "type": "object"
472
+ }
473
+ },
474
+ "output": {
475
+ "schema": {
476
+ "oneOf": [
477
+ {
478
+ "type": "object",
479
+ "required": [
480
+ "ok"
481
+ ],
482
+ "properties": {
483
+ "ok": {
484
+ "const": true
485
+ },
486
+ "data": {
487
+ "oneOf": [
488
+ {
489
+ "type": "object",
490
+ "required": [
491
+ "accessToken",
492
+ "user"
493
+ ],
494
+ "properties": {
495
+ "accessToken": {
496
+ "type": "string"
497
+ },
498
+ "refreshToken": {
499
+ "type": "string"
500
+ },
501
+ "expiresAt": {
502
+ "type": "number"
503
+ },
504
+ "tokenType": {
505
+ "type": "string"
506
+ },
507
+ "user": {
508
+ "type": "object",
509
+ "required": [
510
+ "id"
511
+ ],
512
+ "properties": {
513
+ "id": {
514
+ "type": "string"
515
+ },
516
+ "email": {
517
+ "type": "string"
518
+ },
519
+ "phone": {
520
+ "type": "string"
521
+ },
522
+ "username": {
523
+ "type": "string"
524
+ },
525
+ "displayName": {
526
+ "type": "string"
527
+ },
528
+ "avatarUrl": {
529
+ "type": "string"
530
+ },
531
+ "metadata": {
532
+ "type": "object",
533
+ "additionalProperties": {}
534
+ }
535
+ }
536
+ }
537
+ }
538
+ },
539
+ {
540
+ "type": "null"
541
+ }
542
+ ]
543
+ }
544
+ }
545
+ },
546
+ {
547
+ "type": "object",
548
+ "required": [
549
+ "ok",
550
+ "error"
551
+ ],
552
+ "properties": {
553
+ "ok": {
554
+ "const": false
555
+ },
556
+ "error": {
557
+ "type": "object",
558
+ "required": [
559
+ "code",
560
+ "message"
561
+ ],
562
+ "properties": {
563
+ "code": {
564
+ "type": "string"
565
+ },
566
+ "message": {
567
+ "type": "string"
568
+ },
569
+ "cause": {}
570
+ }
571
+ }
572
+ }
573
+ }
574
+ ]
575
+ }
576
+ }
577
+ },
578
+ {
579
+ "id": "auth.refreshSession",
580
+ "owner": "@ankhorage/auth",
581
+ "access": [
582
+ "invoke"
583
+ ],
584
+ "binding": {
585
+ "kind": "auth",
586
+ "bindableAs": [
587
+ "target"
588
+ ]
589
+ },
590
+ "input": {
591
+ "schema": {
592
+ "type": "object"
593
+ }
594
+ },
595
+ "output": {
596
+ "schema": {
597
+ "oneOf": [
598
+ {
599
+ "type": "object",
600
+ "required": [
601
+ "ok"
602
+ ],
603
+ "properties": {
604
+ "ok": {
605
+ "const": true
606
+ },
607
+ "data": {
608
+ "oneOf": [
609
+ {
610
+ "type": "object",
611
+ "required": [
612
+ "accessToken",
613
+ "user"
614
+ ],
615
+ "properties": {
616
+ "accessToken": {
617
+ "type": "string"
618
+ },
619
+ "refreshToken": {
620
+ "type": "string"
621
+ },
622
+ "expiresAt": {
623
+ "type": "number"
624
+ },
625
+ "tokenType": {
626
+ "type": "string"
627
+ },
628
+ "user": {
629
+ "type": "object",
630
+ "required": [
631
+ "id"
632
+ ],
633
+ "properties": {
634
+ "id": {
635
+ "type": "string"
636
+ },
637
+ "email": {
638
+ "type": "string"
639
+ },
640
+ "phone": {
641
+ "type": "string"
642
+ },
643
+ "username": {
644
+ "type": "string"
645
+ },
646
+ "displayName": {
647
+ "type": "string"
648
+ },
649
+ "avatarUrl": {
650
+ "type": "string"
651
+ },
652
+ "metadata": {
653
+ "type": "object",
654
+ "additionalProperties": {}
655
+ }
656
+ }
657
+ }
658
+ }
659
+ },
660
+ {
661
+ "type": "null"
662
+ }
663
+ ]
664
+ }
665
+ }
666
+ },
667
+ {
668
+ "type": "object",
669
+ "required": [
670
+ "ok",
671
+ "error"
672
+ ],
673
+ "properties": {
674
+ "ok": {
675
+ "const": false
676
+ },
677
+ "error": {
678
+ "type": "object",
679
+ "required": [
680
+ "code",
681
+ "message"
682
+ ],
683
+ "properties": {
684
+ "code": {
685
+ "type": "string"
686
+ },
687
+ "message": {
688
+ "type": "string"
689
+ },
690
+ "cause": {}
691
+ }
692
+ }
693
+ }
694
+ }
695
+ ]
696
+ }
697
+ }
698
+ },
699
+ {
700
+ "id": "auth.requestPasswordReset",
701
+ "owner": "@ankhorage/auth",
702
+ "access": [
703
+ "invoke"
704
+ ],
705
+ "binding": {
706
+ "kind": "auth",
707
+ "bindableAs": [
708
+ "target"
709
+ ]
710
+ },
711
+ "input": {
712
+ "schema": {
713
+ "type": "object",
714
+ "required": [
715
+ "identifier"
716
+ ],
717
+ "properties": {
718
+ "identifier": {
719
+ "type": "object",
720
+ "required": [
721
+ "kind",
722
+ "value"
723
+ ],
724
+ "properties": {
725
+ "kind": {
726
+ "type": "string",
727
+ "enum": [
728
+ "email",
729
+ "phone",
730
+ "username"
731
+ ]
732
+ },
733
+ "value": {
734
+ "type": "string"
735
+ }
736
+ }
737
+ },
738
+ "redirectTo": {
739
+ "type": "string"
740
+ }
741
+ }
742
+ }
743
+ },
744
+ "output": {
745
+ "schema": {
746
+ "oneOf": [
747
+ {
748
+ "type": "object",
749
+ "required": [
750
+ "ok"
751
+ ],
752
+ "properties": {
753
+ "ok": {
754
+ "const": true
755
+ }
756
+ }
757
+ },
758
+ {
759
+ "type": "object",
760
+ "required": [
761
+ "ok",
762
+ "error"
763
+ ],
764
+ "properties": {
765
+ "ok": {
766
+ "const": false
767
+ },
768
+ "error": {
769
+ "type": "object",
770
+ "required": [
771
+ "code",
772
+ "message"
773
+ ],
774
+ "properties": {
775
+ "code": {
776
+ "type": "string"
777
+ },
778
+ "message": {
779
+ "type": "string"
780
+ },
781
+ "cause": {}
782
+ }
783
+ }
784
+ }
785
+ }
786
+ ]
787
+ }
788
+ }
789
+ },
790
+ {
791
+ "id": "auth.verifyOtp",
792
+ "owner": "@ankhorage/auth",
793
+ "access": [
794
+ "invoke"
795
+ ],
796
+ "binding": {
797
+ "kind": "auth",
798
+ "bindableAs": [
799
+ "target"
800
+ ]
801
+ },
802
+ "input": {
803
+ "schema": {
804
+ "type": "object",
805
+ "required": [
806
+ "identifier",
807
+ "token"
808
+ ],
809
+ "properties": {
810
+ "identifier": {
811
+ "type": "object",
812
+ "required": [
813
+ "kind",
814
+ "value"
815
+ ],
816
+ "properties": {
817
+ "kind": {
818
+ "type": "string",
819
+ "enum": [
820
+ "email",
821
+ "phone",
822
+ "username"
823
+ ]
824
+ },
825
+ "value": {
826
+ "type": "string"
827
+ }
828
+ }
829
+ },
830
+ "token": {
831
+ "type": "string"
832
+ },
833
+ "redirectTo": {
834
+ "type": "string"
835
+ },
836
+ "metadata": {
837
+ "type": "object",
838
+ "additionalProperties": {}
839
+ }
840
+ }
841
+ }
842
+ },
843
+ "output": {
844
+ "schema": {
845
+ "oneOf": [
846
+ {
847
+ "type": "object",
848
+ "required": [
849
+ "ok"
850
+ ],
851
+ "properties": {
852
+ "ok": {
853
+ "const": true
854
+ },
855
+ "data": {
856
+ "type": "object",
857
+ "required": [
858
+ "accessToken",
859
+ "user"
860
+ ],
861
+ "properties": {
862
+ "accessToken": {
863
+ "type": "string"
864
+ },
865
+ "refreshToken": {
866
+ "type": "string"
867
+ },
868
+ "expiresAt": {
869
+ "type": "number"
870
+ },
871
+ "tokenType": {
872
+ "type": "string"
873
+ },
874
+ "user": {
875
+ "type": "object",
876
+ "required": [
877
+ "id"
878
+ ],
879
+ "properties": {
880
+ "id": {
881
+ "type": "string"
882
+ },
883
+ "email": {
884
+ "type": "string"
885
+ },
886
+ "phone": {
887
+ "type": "string"
888
+ },
889
+ "username": {
890
+ "type": "string"
891
+ },
892
+ "displayName": {
893
+ "type": "string"
894
+ },
895
+ "avatarUrl": {
896
+ "type": "string"
897
+ },
898
+ "metadata": {
899
+ "type": "object",
900
+ "additionalProperties": {}
901
+ }
902
+ }
903
+ }
904
+ }
905
+ }
906
+ }
907
+ },
908
+ {
909
+ "type": "object",
910
+ "required": [
911
+ "ok",
912
+ "error"
913
+ ],
914
+ "properties": {
915
+ "ok": {
916
+ "const": false
917
+ },
918
+ "error": {
919
+ "type": "object",
920
+ "required": [
921
+ "code",
922
+ "message"
923
+ ],
924
+ "properties": {
925
+ "code": {
926
+ "type": "string"
927
+ },
928
+ "message": {
929
+ "type": "string"
930
+ },
931
+ "cause": {}
932
+ }
933
+ }
934
+ }
935
+ }
936
+ ]
937
+ }
938
+ }
939
+ },
940
+ {
941
+ "id": "auth.oauth.startAuthorization",
942
+ "owner": "@ankhorage/auth",
943
+ "access": [
944
+ "invoke"
945
+ ],
946
+ "binding": {
947
+ "kind": "auth",
948
+ "bindableAs": [
949
+ "target"
950
+ ]
951
+ },
952
+ "input": {
953
+ "schema": {
954
+ "type": "object",
955
+ "required": [
956
+ "provider",
957
+ "redirectUri"
958
+ ],
959
+ "properties": {
960
+ "provider": {
961
+ "type": "string"
962
+ },
963
+ "redirectUri": {
964
+ "type": "string"
965
+ },
966
+ "scopes": {
967
+ "type": "array",
968
+ "items": {
969
+ "type": "string"
970
+ }
971
+ },
972
+ "queryParams": {
973
+ "type": "object",
974
+ "additionalProperties": {
975
+ "type": "string"
976
+ }
977
+ }
978
+ }
979
+ }
980
+ },
981
+ "output": {
982
+ "schema": {
983
+ "oneOf": [
984
+ {
985
+ "type": "object",
986
+ "required": [
987
+ "ok",
988
+ "data"
989
+ ],
990
+ "properties": {
991
+ "ok": {
992
+ "const": true
993
+ },
994
+ "data": {
995
+ "type": "object",
996
+ "required": [
997
+ "attemptId",
998
+ "provider",
999
+ "authorizationUrl",
1000
+ "redirectUri"
1001
+ ],
1002
+ "properties": {
1003
+ "attemptId": {
1004
+ "type": "string"
1005
+ },
1006
+ "provider": {
1007
+ "type": "string"
1008
+ },
1009
+ "authorizationUrl": {
1010
+ "type": "string"
1011
+ },
1012
+ "redirectUri": {
1013
+ "type": "string"
1014
+ }
1015
+ }
1016
+ }
1017
+ }
1018
+ },
1019
+ {
1020
+ "type": "object",
1021
+ "required": [
1022
+ "ok",
1023
+ "error"
1024
+ ],
1025
+ "properties": {
1026
+ "ok": {
1027
+ "const": false
1028
+ },
1029
+ "error": {
1030
+ "type": "object",
1031
+ "required": [
1032
+ "code",
1033
+ "message",
1034
+ "stage",
1035
+ "recoverable"
1036
+ ],
1037
+ "properties": {
1038
+ "code": {
1039
+ "type": "string",
1040
+ "enum": [
1041
+ "oauth_unavailable",
1042
+ "provider_disabled",
1043
+ "provider_misconfigured",
1044
+ "invalid_redirect_uri",
1045
+ "authorization_failed",
1046
+ "authorization_attempt_not_found",
1047
+ "invalid_callback",
1048
+ "state_mismatch",
1049
+ "pkce_mismatch",
1050
+ "callback_already_completed",
1051
+ "code_exchange_failed",
1052
+ "network_error",
1053
+ "session_persistence_failed",
1054
+ "profile_creation_failed",
1055
+ "provider_error"
1056
+ ]
1057
+ },
1058
+ "message": {
1059
+ "type": "string"
1060
+ },
1061
+ "cause": {},
1062
+ "stage": {
1063
+ "type": "string",
1064
+ "enum": [
1065
+ "start",
1066
+ "transport",
1067
+ "callback",
1068
+ "exchange",
1069
+ "session",
1070
+ "profile"
1071
+ ]
1072
+ },
1073
+ "provider": {
1074
+ "type": "string"
1075
+ },
1076
+ "recoverable": {
1077
+ "type": "boolean"
1078
+ }
1079
+ }
1080
+ }
1081
+ }
1082
+ }
1083
+ ]
1084
+ }
1085
+ }
1086
+ },
1087
+ {
1088
+ "id": "auth.oauth.completeAuthorization",
1089
+ "owner": "@ankhorage/auth",
1090
+ "access": [
1091
+ "invoke"
1092
+ ],
1093
+ "binding": {
1094
+ "kind": "auth",
1095
+ "bindableAs": [
1096
+ "target"
1097
+ ]
1098
+ },
1099
+ "input": {
1100
+ "schema": {
1101
+ "type": "object",
1102
+ "required": [
1103
+ "attemptId",
1104
+ "response"
1105
+ ],
1106
+ "properties": {
1107
+ "attemptId": {
1108
+ "type": "string"
1109
+ },
1110
+ "response": {
1111
+ "oneOf": [
1112
+ {
1113
+ "type": "object",
1114
+ "required": [
1115
+ "type",
1116
+ "url"
1117
+ ],
1118
+ "properties": {
1119
+ "type": {
1120
+ "const": "callback"
1121
+ },
1122
+ "url": {
1123
+ "type": "string"
1124
+ }
1125
+ }
1126
+ },
1127
+ {
1128
+ "type": "object",
1129
+ "required": [
1130
+ "type",
1131
+ "reason"
1132
+ ],
1133
+ "properties": {
1134
+ "type": {
1135
+ "const": "cancelled"
1136
+ },
1137
+ "reason": {
1138
+ "type": "string",
1139
+ "enum": [
1140
+ "user_cancelled",
1141
+ "browser_dismissed"
1142
+ ]
1143
+ }
1144
+ }
1145
+ },
1146
+ {
1147
+ "type": "object",
1148
+ "required": [
1149
+ "type",
1150
+ "error"
1151
+ ],
1152
+ "properties": {
1153
+ "type": {
1154
+ "const": "error"
1155
+ },
1156
+ "error": {
1157
+ "type": "object",
1158
+ "required": [
1159
+ "code",
1160
+ "message"
1161
+ ],
1162
+ "properties": {
1163
+ "code": {
1164
+ "type": "string",
1165
+ "enum": [
1166
+ "browser_unavailable",
1167
+ "transport_failed"
1168
+ ]
1169
+ },
1170
+ "message": {
1171
+ "type": "string"
1172
+ },
1173
+ "cause": {}
1174
+ }
1175
+ }
1176
+ }
1177
+ }
1178
+ ]
1179
+ }
1180
+ }
1181
+ }
1182
+ },
1183
+ "output": {
1184
+ "schema": {
1185
+ "oneOf": [
1186
+ {
1187
+ "type": "object",
1188
+ "required": [
1189
+ "ok",
1190
+ "status",
1191
+ "provider",
1192
+ "session"
1193
+ ],
1194
+ "properties": {
1195
+ "ok": {
1196
+ "const": true
1197
+ },
1198
+ "status": {
1199
+ "const": "authenticated"
1200
+ },
1201
+ "provider": {
1202
+ "type": "string"
1203
+ },
1204
+ "session": {
1205
+ "type": "object",
1206
+ "required": [
1207
+ "accessToken",
1208
+ "user"
1209
+ ],
1210
+ "properties": {
1211
+ "accessToken": {
1212
+ "type": "string"
1213
+ },
1214
+ "refreshToken": {
1215
+ "type": "string"
1216
+ },
1217
+ "expiresAt": {
1218
+ "type": "number"
1219
+ },
1220
+ "tokenType": {
1221
+ "type": "string"
1222
+ },
1223
+ "user": {
1224
+ "type": "object",
1225
+ "required": [
1226
+ "id"
1227
+ ],
1228
+ "properties": {
1229
+ "id": {
1230
+ "type": "string"
1231
+ },
1232
+ "email": {
1233
+ "type": "string"
1234
+ },
1235
+ "phone": {
1236
+ "type": "string"
1237
+ },
1238
+ "username": {
1239
+ "type": "string"
1240
+ },
1241
+ "displayName": {
1242
+ "type": "string"
1243
+ },
1244
+ "avatarUrl": {
1245
+ "type": "string"
1246
+ },
1247
+ "metadata": {
1248
+ "type": "object",
1249
+ "additionalProperties": {}
1250
+ }
1251
+ }
1252
+ }
1253
+ }
1254
+ }
1255
+ }
1256
+ },
1257
+ {
1258
+ "type": "object",
1259
+ "required": [
1260
+ "ok",
1261
+ "status",
1262
+ "provider",
1263
+ "reason"
1264
+ ],
1265
+ "properties": {
1266
+ "ok": {
1267
+ "const": false
1268
+ },
1269
+ "status": {
1270
+ "const": "cancelled"
1271
+ },
1272
+ "provider": {
1273
+ "type": "string"
1274
+ },
1275
+ "reason": {
1276
+ "type": "string",
1277
+ "enum": [
1278
+ "user_cancelled",
1279
+ "browser_dismissed",
1280
+ "provider_denied"
1281
+ ]
1282
+ }
1283
+ }
1284
+ },
1285
+ {
1286
+ "type": "object",
1287
+ "required": [
1288
+ "ok",
1289
+ "status",
1290
+ "error"
1291
+ ],
1292
+ "properties": {
1293
+ "ok": {
1294
+ "const": false
1295
+ },
1296
+ "status": {
1297
+ "const": "error"
1298
+ },
1299
+ "error": {
1300
+ "type": "object",
1301
+ "required": [
1302
+ "code",
1303
+ "message",
1304
+ "stage",
1305
+ "recoverable"
1306
+ ],
1307
+ "properties": {
1308
+ "code": {
1309
+ "type": "string",
1310
+ "enum": [
1311
+ "oauth_unavailable",
1312
+ "provider_disabled",
1313
+ "provider_misconfigured",
1314
+ "invalid_redirect_uri",
1315
+ "authorization_failed",
1316
+ "authorization_attempt_not_found",
1317
+ "invalid_callback",
1318
+ "state_mismatch",
1319
+ "pkce_mismatch",
1320
+ "callback_already_completed",
1321
+ "code_exchange_failed",
1322
+ "network_error",
1323
+ "session_persistence_failed",
1324
+ "profile_creation_failed",
1325
+ "provider_error"
1326
+ ]
1327
+ },
1328
+ "message": {
1329
+ "type": "string"
1330
+ },
1331
+ "cause": {},
1332
+ "stage": {
1333
+ "type": "string",
1334
+ "enum": [
1335
+ "start",
1336
+ "transport",
1337
+ "callback",
1338
+ "exchange",
1339
+ "session",
1340
+ "profile"
1341
+ ]
1342
+ },
1343
+ "provider": {
1344
+ "type": "string"
1345
+ },
1346
+ "recoverable": {
1347
+ "type": "boolean"
1348
+ }
1349
+ }
1350
+ }
1351
+ }
1352
+ }
1353
+ ]
1354
+ }
1355
+ }
1356
+ }
1357
+ ]
1358
+ },
1359
+ "dependencies": {
1360
+ "@ankhorage/contracts": "26.0.0"
1361
+ },
1362
+ "scripts": {
1363
+ "build": "bun run package:sync && tsc -p tsconfig.build.json",
1364
+ "check-types": "tsc --noEmit -p tsconfig.json",
1365
+ "changeset": "ankhorage-changeset",
1366
+ "changeset:status": "ankhorage-changeset status --since=origin/main",
1367
+ "docs": "paradox",
1368
+ "doctor": "ankhorage-doctor validate .",
1369
+ "lint": "ankhorage-eslint . --max-warnings=0",
1370
+ "lint:fix": "ankhorage-eslint . --fix --max-warnings=0",
1371
+ "format": "ankhorage-prettier --write .",
1372
+ "format:check": "ankhorage-prettier --check .",
1373
+ "knip:check": "ankhorage-knip",
1374
+ "package:sync": "bun scripts/materializePackageCapabilities.ts",
1375
+ "prepack": "bun run build",
1376
+ "test": "bun test",
1377
+ "test:packed": "bun run build && bun test tests/packedConsumer.test.ts",
1378
+ "typecheck": "bun run check-types",
1379
+ "version-packages": "ankhorage-changeset version"
1380
+ },
1381
+ "devDependencies": {
1382
+ "@ankhorage/capability": "0.2.1",
1383
+ "@ankhorage/devtools": "^2.3.14",
1384
+ "@ankhorage/doctor": "0.14.13",
1385
+ "@ankhorage/paradox": "^0.3.3",
1386
+ "@types/bun": "^1.4.2",
1387
+ "@types/node": "^26.6.5",
1388
+ "typescript": "^6.0.3"
1389
+ },
1390
+ "packageManager": "bun@1.4.2"
1391
+ }