@oxy.so/contracts 2.2.0 → 4.0.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.
Files changed (41) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountEmail.js +21 -25
  3. package/dist/cjs/deviceBoot.js +2 -2
  4. package/dist/cjs/deviceSession.js +73 -16
  5. package/dist/cjs/externalIdentity.js +9 -3
  6. package/dist/cjs/identity.js +1 -3
  7. package/dist/cjs/identityLink.js +22 -19
  8. package/dist/cjs/identityProof.js +2 -2
  9. package/dist/cjs/index.js +59 -28
  10. package/dist/cjs/reputation.js +10 -55
  11. package/dist/cjs/signIn.js +304 -0
  12. package/dist/esm/.tsbuildinfo +1 -1
  13. package/dist/esm/accountEmail.js +21 -25
  14. package/dist/esm/deviceBoot.js +2 -2
  15. package/dist/esm/deviceSession.js +72 -15
  16. package/dist/esm/externalIdentity.js +8 -2
  17. package/dist/esm/identity.js +1 -3
  18. package/dist/esm/identityLink.js +21 -18
  19. package/dist/esm/identityProof.js +2 -2
  20. package/dist/esm/index.js +11 -11
  21. package/dist/esm/reputation.js +9 -54
  22. package/dist/esm/signIn.js +299 -0
  23. package/dist/types/.tsbuildinfo +1 -1
  24. package/dist/types/accountEmail.d.ts +20 -28
  25. package/dist/types/accountGraph.d.ts +4 -4
  26. package/dist/types/deviceBoot.d.ts +2 -2
  27. package/dist/types/deviceSession.d.ts +127 -15
  28. package/dist/types/externalIdentity.d.ts +53 -46
  29. package/dist/types/identity.d.ts +4 -8
  30. package/dist/types/identityLink.d.ts +54 -118
  31. package/dist/types/identityProof.d.ts +3 -3
  32. package/dist/types/index.d.ts +8 -8
  33. package/dist/types/inference/entitlement.d.ts +2 -2
  34. package/dist/types/oauth.d.ts +16 -16
  35. package/dist/types/reputation.d.ts +32 -127
  36. package/dist/types/signIn.d.ts +717 -0
  37. package/dist/types/userResponse.d.ts +2 -2
  38. package/package.json +1 -1
  39. package/dist/cjs/webauthn.js +0 -114
  40. package/dist/esm/webauthn.js +0 -111
  41. package/dist/types/webauthn.d.ts +0 -173
@@ -1,22 +1,28 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * How Oxy observed an external account. `instagram-graph` is Meta's Graph API
4
+ * Business Discovery, a fallback transport for Business/Creator Instagram
5
+ * accounts when the ActivityPub bridge is unavailable.
6
+ */
7
+ export declare const externalIdentityProtocolSchema: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
2
8
  export declare const externalIdentityReferenceSchema: z.ZodObject<{
3
9
  canonicalAcct: z.ZodString;
4
10
  network: z.ZodString;
5
- protocol: z.ZodEnum<["activitypub", "atproto"]>;
11
+ protocol: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
6
12
  actorUri: z.ZodString;
7
13
  transportAcct: z.ZodString;
8
14
  sourceUserId: z.ZodString;
9
15
  }, "strip", z.ZodTypeAny, {
10
16
  canonicalAcct: string;
11
17
  network: string;
12
- protocol: "activitypub" | "atproto";
18
+ protocol: "activitypub" | "atproto" | "instagram-graph";
13
19
  actorUri: string;
14
20
  transportAcct: string;
15
21
  sourceUserId: string;
16
22
  }, {
17
23
  canonicalAcct: string;
18
24
  network: string;
19
- protocol: "activitypub" | "atproto";
25
+ protocol: "activitypub" | "atproto" | "instagram-graph";
20
26
  actorUri: string;
21
27
  transportAcct: string;
22
28
  sourceUserId: string;
@@ -25,24 +31,24 @@ export declare const resolveExternalIdentityRequestSchema: z.ZodEffects<z.ZodObj
25
31
  actorUri: z.ZodOptional<z.ZodString>;
26
32
  handle: z.ZodOptional<z.ZodString>;
27
33
  transportAcct: z.ZodOptional<z.ZodString>;
28
- protocol: z.ZodOptional<z.ZodEnum<["activitypub", "atproto"]>>;
34
+ protocol: z.ZodOptional<z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>>;
29
35
  }, "strip", z.ZodTypeAny, {
30
- protocol?: "activitypub" | "atproto" | undefined;
36
+ protocol?: "activitypub" | "atproto" | "instagram-graph" | undefined;
31
37
  actorUri?: string | undefined;
32
38
  transportAcct?: string | undefined;
33
39
  handle?: string | undefined;
34
40
  }, {
35
- protocol?: "activitypub" | "atproto" | undefined;
41
+ protocol?: "activitypub" | "atproto" | "instagram-graph" | undefined;
36
42
  actorUri?: string | undefined;
37
43
  transportAcct?: string | undefined;
38
44
  handle?: string | undefined;
39
45
  }>, {
40
- protocol?: "activitypub" | "atproto" | undefined;
46
+ protocol?: "activitypub" | "atproto" | "instagram-graph" | undefined;
41
47
  actorUri?: string | undefined;
42
48
  transportAcct?: string | undefined;
43
49
  handle?: string | undefined;
44
50
  }, {
45
- protocol?: "activitypub" | "atproto" | undefined;
51
+ protocol?: "activitypub" | "atproto" | "instagram-graph" | undefined;
46
52
  actorUri?: string | undefined;
47
53
  transportAcct?: string | undefined;
48
54
  handle?: string | undefined;
@@ -75,21 +81,21 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
75
81
  externalIdentities: z.ZodArray<z.ZodObject<{
76
82
  canonicalAcct: z.ZodString;
77
83
  network: z.ZodString;
78
- protocol: z.ZodEnum<["activitypub", "atproto"]>;
84
+ protocol: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
79
85
  actorUri: z.ZodString;
80
86
  transportAcct: z.ZodString;
81
87
  sourceUserId: z.ZodString;
82
88
  }, "strip", z.ZodTypeAny, {
83
89
  canonicalAcct: string;
84
90
  network: string;
85
- protocol: "activitypub" | "atproto";
91
+ protocol: "activitypub" | "atproto" | "instagram-graph";
86
92
  actorUri: string;
87
93
  transportAcct: string;
88
94
  sourceUserId: string;
89
95
  }, {
90
96
  canonicalAcct: string;
91
97
  network: string;
92
- protocol: "activitypub" | "atproto";
98
+ protocol: "activitypub" | "atproto" | "instagram-graph";
93
99
  actorUri: string;
94
100
  transportAcct: string;
95
101
  sourceUserId: string;
@@ -122,21 +128,21 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
122
128
  externalIdentities: z.ZodArray<z.ZodObject<{
123
129
  canonicalAcct: z.ZodString;
124
130
  network: z.ZodString;
125
- protocol: z.ZodEnum<["activitypub", "atproto"]>;
131
+ protocol: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
126
132
  actorUri: z.ZodString;
127
133
  transportAcct: z.ZodString;
128
134
  sourceUserId: z.ZodString;
129
135
  }, "strip", z.ZodTypeAny, {
130
136
  canonicalAcct: string;
131
137
  network: string;
132
- protocol: "activitypub" | "atproto";
138
+ protocol: "activitypub" | "atproto" | "instagram-graph";
133
139
  actorUri: string;
134
140
  transportAcct: string;
135
141
  sourceUserId: string;
136
142
  }, {
137
143
  canonicalAcct: string;
138
144
  network: string;
139
- protocol: "activitypub" | "atproto";
145
+ protocol: "activitypub" | "atproto" | "instagram-graph";
140
146
  actorUri: string;
141
147
  transportAcct: string;
142
148
  sourceUserId: string;
@@ -169,21 +175,21 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
169
175
  externalIdentities: z.ZodArray<z.ZodObject<{
170
176
  canonicalAcct: z.ZodString;
171
177
  network: z.ZodString;
172
- protocol: z.ZodEnum<["activitypub", "atproto"]>;
178
+ protocol: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
173
179
  actorUri: z.ZodString;
174
180
  transportAcct: z.ZodString;
175
181
  sourceUserId: z.ZodString;
176
182
  }, "strip", z.ZodTypeAny, {
177
183
  canonicalAcct: string;
178
184
  network: string;
179
- protocol: "activitypub" | "atproto";
185
+ protocol: "activitypub" | "atproto" | "instagram-graph";
180
186
  actorUri: string;
181
187
  transportAcct: string;
182
188
  sourceUserId: string;
183
189
  }, {
184
190
  canonicalAcct: string;
185
191
  network: string;
186
- protocol: "activitypub" | "atproto";
192
+ protocol: "activitypub" | "atproto" | "instagram-graph";
187
193
  actorUri: string;
188
194
  transportAcct: string;
189
195
  sourceUserId: string;
@@ -193,7 +199,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
193
199
  externalIdentity: z.ZodObject<{
194
200
  canonicalAcct: z.ZodString;
195
201
  network: z.ZodString;
196
- protocol: z.ZodEnum<["activitypub", "atproto"]>;
202
+ protocol: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
197
203
  actorUri: z.ZodString;
198
204
  transportAcct: z.ZodString;
199
205
  sourceUserId: z.ZodString;
@@ -203,7 +209,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
203
209
  userId: string;
204
210
  canonicalAcct: string;
205
211
  network: string;
206
- protocol: "activitypub" | "atproto";
212
+ protocol: "activitypub" | "atproto" | "instagram-graph";
207
213
  actorUri: string;
208
214
  transportAcct: string;
209
215
  sourceUserId: string;
@@ -211,7 +217,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
211
217
  userId: string;
212
218
  canonicalAcct: string;
213
219
  network: string;
214
- protocol: "activitypub" | "atproto";
220
+ protocol: "activitypub" | "atproto" | "instagram-graph";
215
221
  actorUri: string;
216
222
  transportAcct: string;
217
223
  sourceUserId: string;
@@ -219,21 +225,21 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
219
225
  externalIdentities: z.ZodArray<z.ZodObject<{
220
226
  canonicalAcct: z.ZodString;
221
227
  network: z.ZodString;
222
- protocol: z.ZodEnum<["activitypub", "atproto"]>;
228
+ protocol: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
223
229
  actorUri: z.ZodString;
224
230
  transportAcct: z.ZodString;
225
231
  sourceUserId: z.ZodString;
226
232
  }, "strip", z.ZodTypeAny, {
227
233
  canonicalAcct: string;
228
234
  network: string;
229
- protocol: "activitypub" | "atproto";
235
+ protocol: "activitypub" | "atproto" | "instagram-graph";
230
236
  actorUri: string;
231
237
  transportAcct: string;
232
238
  sourceUserId: string;
233
239
  }, {
234
240
  canonicalAcct: string;
235
241
  network: string;
236
- protocol: "activitypub" | "atproto";
242
+ protocol: "activitypub" | "atproto" | "instagram-graph";
237
243
  actorUri: string;
238
244
  transportAcct: string;
239
245
  sourceUserId: string;
@@ -247,7 +253,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
247
253
  externalIdentities: {
248
254
  canonicalAcct: string;
249
255
  network: string;
250
- protocol: "activitypub" | "atproto";
256
+ protocol: "activitypub" | "atproto" | "instagram-graph";
251
257
  actorUri: string;
252
258
  transportAcct: string;
253
259
  sourceUserId: string;
@@ -278,7 +284,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
278
284
  externalIdentities: {
279
285
  canonicalAcct: string;
280
286
  network: string;
281
- protocol: "activitypub" | "atproto";
287
+ protocol: "activitypub" | "atproto" | "instagram-graph";
282
288
  actorUri: string;
283
289
  transportAcct: string;
284
290
  sourceUserId: string;
@@ -288,7 +294,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
288
294
  userId: string;
289
295
  canonicalAcct: string;
290
296
  network: string;
291
- protocol: "activitypub" | "atproto";
297
+ protocol: "activitypub" | "atproto" | "instagram-graph";
292
298
  actorUri: string;
293
299
  transportAcct: string;
294
300
  sourceUserId: string;
@@ -301,7 +307,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
301
307
  externalIdentities: {
302
308
  canonicalAcct: string;
303
309
  network: string;
304
- protocol: "activitypub" | "atproto";
310
+ protocol: "activitypub" | "atproto" | "instagram-graph";
305
311
  actorUri: string;
306
312
  transportAcct: string;
307
313
  sourceUserId: string;
@@ -332,7 +338,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
332
338
  externalIdentities: {
333
339
  canonicalAcct: string;
334
340
  network: string;
335
- protocol: "activitypub" | "atproto";
341
+ protocol: "activitypub" | "atproto" | "instagram-graph";
336
342
  actorUri: string;
337
343
  transportAcct: string;
338
344
  sourceUserId: string;
@@ -342,7 +348,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
342
348
  userId: string;
343
349
  canonicalAcct: string;
344
350
  network: string;
345
- protocol: "activitypub" | "atproto";
351
+ protocol: "activitypub" | "atproto" | "instagram-graph";
346
352
  actorUri: string;
347
353
  transportAcct: string;
348
354
  sourceUserId: string;
@@ -355,7 +361,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
355
361
  externalIdentities: {
356
362
  canonicalAcct: string;
357
363
  network: string;
358
- protocol: "activitypub" | "atproto";
364
+ protocol: "activitypub" | "atproto" | "instagram-graph";
359
365
  actorUri: string;
360
366
  transportAcct: string;
361
367
  sourceUserId: string;
@@ -386,7 +392,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
386
392
  externalIdentities: {
387
393
  canonicalAcct: string;
388
394
  network: string;
389
- protocol: "activitypub" | "atproto";
395
+ protocol: "activitypub" | "atproto" | "instagram-graph";
390
396
  actorUri: string;
391
397
  transportAcct: string;
392
398
  sourceUserId: string;
@@ -396,7 +402,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
396
402
  userId: string;
397
403
  canonicalAcct: string;
398
404
  network: string;
399
- protocol: "activitypub" | "atproto";
405
+ protocol: "activitypub" | "atproto" | "instagram-graph";
400
406
  actorUri: string;
401
407
  transportAcct: string;
402
408
  sourceUserId: string;
@@ -409,7 +415,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
409
415
  externalIdentities: {
410
416
  canonicalAcct: string;
411
417
  network: string;
412
- protocol: "activitypub" | "atproto";
418
+ protocol: "activitypub" | "atproto" | "instagram-graph";
413
419
  actorUri: string;
414
420
  transportAcct: string;
415
421
  sourceUserId: string;
@@ -440,7 +446,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
440
446
  externalIdentities: {
441
447
  canonicalAcct: string;
442
448
  network: string;
443
- protocol: "activitypub" | "atproto";
449
+ protocol: "activitypub" | "atproto" | "instagram-graph";
444
450
  actorUri: string;
445
451
  transportAcct: string;
446
452
  sourceUserId: string;
@@ -450,7 +456,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodEffects<z.ZodOb
450
456
  userId: string;
451
457
  canonicalAcct: string;
452
458
  network: string;
453
- protocol: "activitypub" | "atproto";
459
+ protocol: "activitypub" | "atproto" | "instagram-graph";
454
460
  actorUri: string;
455
461
  transportAcct: string;
456
462
  sourceUserId: string;
@@ -470,80 +476,81 @@ export declare const lookupExternalIdentitiesResponseSchema: z.ZodObject<{
470
476
  externalIdentities: z.ZodArray<z.ZodObject<{
471
477
  canonicalAcct: z.ZodString;
472
478
  network: z.ZodString;
473
- protocol: z.ZodEnum<["activitypub", "atproto"]>;
479
+ protocol: z.ZodEnum<["activitypub", "atproto", "instagram-graph"]>;
474
480
  actorUri: z.ZodString;
475
481
  transportAcct: z.ZodString;
476
482
  sourceUserId: z.ZodString;
477
483
  }, "strip", z.ZodTypeAny, {
478
484
  canonicalAcct: string;
479
485
  network: string;
480
- protocol: "activitypub" | "atproto";
486
+ protocol: "activitypub" | "atproto" | "instagram-graph";
481
487
  actorUri: string;
482
488
  transportAcct: string;
483
489
  sourceUserId: string;
484
490
  }, {
485
491
  canonicalAcct: string;
486
492
  network: string;
487
- protocol: "activitypub" | "atproto";
493
+ protocol: "activitypub" | "atproto" | "instagram-graph";
488
494
  actorUri: string;
489
495
  transportAcct: string;
490
496
  sourceUserId: string;
491
497
  }>, "many">;
492
498
  redirectedUserIds: z.ZodArray<z.ZodString, "many">;
493
499
  }, "strip", z.ZodTypeAny, {
494
- identifier: string;
495
500
  userId: string | null;
496
501
  externalIdentities: {
497
502
  canonicalAcct: string;
498
503
  network: string;
499
- protocol: "activitypub" | "atproto";
504
+ protocol: "activitypub" | "atproto" | "instagram-graph";
500
505
  actorUri: string;
501
506
  transportAcct: string;
502
507
  sourceUserId: string;
503
508
  }[];
504
509
  redirectedUserIds: string[];
505
- }, {
506
510
  identifier: string;
511
+ }, {
507
512
  userId: string | null;
508
513
  externalIdentities: {
509
514
  canonicalAcct: string;
510
515
  network: string;
511
- protocol: "activitypub" | "atproto";
516
+ protocol: "activitypub" | "atproto" | "instagram-graph";
512
517
  actorUri: string;
513
518
  transportAcct: string;
514
519
  sourceUserId: string;
515
520
  }[];
516
521
  redirectedUserIds: string[];
522
+ identifier: string;
517
523
  }>, "many">;
518
524
  }, "strip", z.ZodTypeAny, {
519
525
  identities: {
520
- identifier: string;
521
526
  userId: string | null;
522
527
  externalIdentities: {
523
528
  canonicalAcct: string;
524
529
  network: string;
525
- protocol: "activitypub" | "atproto";
530
+ protocol: "activitypub" | "atproto" | "instagram-graph";
526
531
  actorUri: string;
527
532
  transportAcct: string;
528
533
  sourceUserId: string;
529
534
  }[];
530
535
  redirectedUserIds: string[];
536
+ identifier: string;
531
537
  }[];
532
538
  }, {
533
539
  identities: {
534
- identifier: string;
535
540
  userId: string | null;
536
541
  externalIdentities: {
537
542
  canonicalAcct: string;
538
543
  network: string;
539
- protocol: "activitypub" | "atproto";
544
+ protocol: "activitypub" | "atproto" | "instagram-graph";
540
545
  actorUri: string;
541
546
  transportAcct: string;
542
547
  sourceUserId: string;
543
548
  }[];
544
549
  redirectedUserIds: string[];
550
+ identifier: string;
545
551
  }[];
546
552
  }>;
553
+ export type ExternalIdentityProtocol = z.infer<typeof externalIdentityProtocolSchema>;
547
554
  export type ExternalIdentityReference = z.infer<typeof externalIdentityReferenceSchema>;
548
555
  export type ResolveExternalIdentityRequest = z.infer<typeof resolveExternalIdentityRequestSchema>;
549
556
  export type ResolveExternalIdentityResponse = z.infer<typeof resolveExternalIdentityResponseSchema>;
@@ -315,18 +315,14 @@ export type DomainVerificationInstructions = z.infer<typeof domainVerificationIn
315
315
  /**
316
316
  * One linked authentication method. Mirrors a `User.authMethods[]` entry.
317
317
  * `verificationMethodId` is present for `identity` methods (a key), linking the
318
- * auth method to its DID verification-method fragment. For `webauthn` methods
319
- * `credentialId` identifies the specific passkey (one entry per registered
320
- * credential) and `name` is its user-facing label; a passkey is NOT a DID
321
- * verification method, so it carries no `verificationMethodId` (a passkey-only
322
- * account stays custodial).
318
+ * auth method to its DID verification-method fragment. A key is the only
319
+ * linked method: an email, a password and an authenticator are sign-in
320
+ * factors of the account, not DID verification methods.
323
321
  */
324
322
  export interface AuthMethodEntry {
325
- type: 'identity' | 'webauthn';
323
+ type: 'identity';
326
324
  linkedAt: string | Date;
327
325
  verificationMethodId?: string;
328
- credentialId?: string;
329
- name?: string;
330
326
  }
331
327
  export declare const authMethodEntrySchema: z.ZodType<AuthMethodEntry>;
332
328
  /**
@@ -1,22 +1,25 @@
1
1
  /**
2
- * Linking Commons to a passkey account (ADR 0029 D3) — the two-device relay.
2
+ * Linking Commons to an account without a key (ADR 0029 D3) — the two-device
3
+ * relay.
3
4
  *
4
- * A passkey account links a Commons root once, and becomes self-custodied: its
5
- * recovery email is deleted and its phrase in Commons is how it gets back in.
6
- * The authority is the same as `POST /auth/link` (ADR 0024 D8): a root proof
7
- * (`link_identity`) by the key Commons holds, and a fresh assertion by one of
8
- * the account's passkeys over the SAME one-use challenge. Only the transport is
9
- * new, because the two factors live on two devices:
5
+ * An account without a key links a Commons root once, and becomes
6
+ * self-custodied: its email is deleted and its phrase in Commons is how it gets
7
+ * back in. The authority is the same as `POST /auth/link` (ADR 0024 D8): a root
8
+ * proof (`link_identity`) by the key Commons holds over a one-use challenge,
9
+ * and the account's own confirmation — a code just sent to its email (plus its
10
+ * authenticator code when it has one). Only the transport is new, because the
11
+ * two factors live on two devices:
10
12
  *
11
- * 1. auth.oxy.so (signed in) opens a link request → `{ linkId, challenge }`,
12
- * shown as a QR (`oxycommons://link?id=…&c=…`).
13
+ * 1. The signed-in account (the "Link Commons" panel of `@oxy.so/services`)
14
+ * opens a link request → `{ linkId, challenge }`, shown as a QR
15
+ * (`oxycommons://link?id=…&c=…`).
13
16
  * 2. Commons scans it, reads the request (the account's id and username),
14
17
  * signs the root proof over the challenge and posts it with its key.
15
18
  * 3. Both screens show the same 6-digit code, derived from the link id and
16
19
  * that key (`deriveIdentityLinkCode` in `@oxy.so/core`); the person checks
17
20
  * they match, so a photographed QR cannot slip another key in.
18
- * 4. auth.oxy.so asserts the passkey over the challenge and completes: the
19
- * account gains the root, loses the email, and Commons signs in with it.
21
+ * 4. The panel completes with the email code: the account gains the root,
22
+ * loses the email, and Commons signs in with it.
20
23
  *
21
24
  * The server stores only the challenge's hash; the challenge travels in the QR.
22
25
  */
@@ -92,119 +95,52 @@ export declare const identityLinkProofRequestSchema: z.ZodObject<{
92
95
  };
93
96
  }>;
94
97
  export type IdentityLinkProofRequest = z.infer<typeof identityLinkProofRequestSchema>;
95
- /** `POST /identity/link/:linkId/options` — WebAuthn request options over the challenge. */
96
- export declare const identityLinkOptionsRequestSchema: z.ZodObject<{
97
- challenge: z.ZodString;
98
- }, "strict", z.ZodTypeAny, {
99
- challenge: string;
100
- }, {
101
- challenge: string;
102
- }>;
103
- export type IdentityLinkOptionsRequest = z.infer<typeof identityLinkOptionsRequestSchema>;
104
- /** `POST /identity/link/:linkId/complete` — the passkey assertion over the challenge. */
98
+ /**
99
+ * `POST /identity/link/:linkId/complete` — the account's own confirmation: a
100
+ * code just sent to its email for this link (`reauth`, plus its authenticator
101
+ * code when it has one).
102
+ */
105
103
  export declare const identityLinkCompleteRequestSchema: z.ZodObject<{
106
- assertion: z.ZodObject<{
107
- id: z.ZodString;
108
- rawId: z.ZodString;
109
- type: z.ZodLiteral<"public-key">;
110
- response: z.ZodObject<{
111
- clientDataJSON: z.ZodString;
112
- authenticatorData: z.ZodString;
113
- signature: z.ZodString;
114
- userHandle: z.ZodOptional<z.ZodString>;
115
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
116
- clientDataJSON: z.ZodString;
117
- authenticatorData: z.ZodString;
118
- signature: z.ZodString;
119
- userHandle: z.ZodOptional<z.ZodString>;
120
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
121
- clientDataJSON: z.ZodString;
122
- authenticatorData: z.ZodString;
123
- signature: z.ZodString;
124
- userHandle: z.ZodOptional<z.ZodString>;
125
- }, z.ZodTypeAny, "passthrough">>;
126
- clientExtensionResults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
127
- authenticatorAttachment: z.ZodOptional<z.ZodString>;
128
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
129
- id: z.ZodString;
130
- rawId: z.ZodString;
131
- type: z.ZodLiteral<"public-key">;
132
- response: z.ZodObject<{
133
- clientDataJSON: z.ZodString;
134
- authenticatorData: z.ZodString;
135
- signature: z.ZodString;
136
- userHandle: z.ZodOptional<z.ZodString>;
137
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
138
- clientDataJSON: z.ZodString;
139
- authenticatorData: z.ZodString;
140
- signature: z.ZodString;
141
- userHandle: z.ZodOptional<z.ZodString>;
142
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
143
- clientDataJSON: z.ZodString;
144
- authenticatorData: z.ZodString;
145
- signature: z.ZodString;
146
- userHandle: z.ZodOptional<z.ZodString>;
147
- }, z.ZodTypeAny, "passthrough">>;
148
- clientExtensionResults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
149
- authenticatorAttachment: z.ZodOptional<z.ZodString>;
150
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
151
- id: z.ZodString;
152
- rawId: z.ZodString;
153
- type: z.ZodLiteral<"public-key">;
154
- response: z.ZodObject<{
155
- clientDataJSON: z.ZodString;
156
- authenticatorData: z.ZodString;
157
- signature: z.ZodString;
158
- userHandle: z.ZodOptional<z.ZodString>;
159
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
160
- clientDataJSON: z.ZodString;
161
- authenticatorData: z.ZodString;
162
- signature: z.ZodString;
163
- userHandle: z.ZodOptional<z.ZodString>;
164
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
165
- clientDataJSON: z.ZodString;
166
- authenticatorData: z.ZodString;
167
- signature: z.ZodString;
168
- userHandle: z.ZodOptional<z.ZodString>;
169
- }, z.ZodTypeAny, "passthrough">>;
170
- clientExtensionResults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
171
- authenticatorAttachment: z.ZodOptional<z.ZodString>;
172
- }, z.ZodTypeAny, "passthrough">>;
104
+ reauth: z.ZodObject<{
105
+ emailCode: z.ZodObject<{
106
+ verificationId: z.ZodString;
107
+ code: z.ZodString;
108
+ }, "strict", z.ZodTypeAny, {
109
+ code: string;
110
+ verificationId: string;
111
+ }, {
112
+ code: string;
113
+ verificationId: string;
114
+ }>;
115
+ totpCode: z.ZodOptional<z.ZodString>;
116
+ }, "strict", z.ZodTypeAny, {
117
+ emailCode: {
118
+ code: string;
119
+ verificationId: string;
120
+ };
121
+ totpCode?: string | undefined;
122
+ }, {
123
+ emailCode: {
124
+ code: string;
125
+ verificationId: string;
126
+ };
127
+ totpCode?: string | undefined;
128
+ }>;
173
129
  }, "strict", z.ZodTypeAny, {
174
- assertion: {
175
- type: "public-key";
176
- id: string;
177
- rawId: string;
178
- response: {
179
- signature: string;
180
- clientDataJSON: string;
181
- authenticatorData: string;
182
- userHandle?: string | undefined;
183
- } & {
184
- [k: string]: unknown;
130
+ reauth: {
131
+ emailCode: {
132
+ code: string;
133
+ verificationId: string;
185
134
  };
186
- clientExtensionResults?: Record<string, unknown> | undefined;
187
- authenticatorAttachment?: string | undefined;
188
- } & {
189
- [k: string]: unknown;
135
+ totpCode?: string | undefined;
190
136
  };
191
137
  }, {
192
- assertion: {
193
- type: "public-key";
194
- id: string;
195
- rawId: string;
196
- response: {
197
- signature: string;
198
- clientDataJSON: string;
199
- authenticatorData: string;
200
- userHandle?: string | undefined;
201
- } & {
202
- [k: string]: unknown;
138
+ reauth: {
139
+ emailCode: {
140
+ code: string;
141
+ verificationId: string;
203
142
  };
204
- clientExtensionResults?: Record<string, unknown> | undefined;
205
- authenticatorAttachment?: string | undefined;
206
- } & {
207
- [k: string]: unknown;
143
+ totpCode?: string | undefined;
208
144
  };
209
145
  }>;
210
146
  export type IdentityLinkCompleteRequest = z.infer<typeof identityLinkCompleteRequestSchema>;
@@ -28,8 +28,8 @@ export declare const IDENTITY_PROOF_CHALLENGE_TTL_MS: number;
28
28
  */
29
29
  export declare const IDENTITY_PROOF_ACTIONS: {
30
30
  /**
31
- * Link Commons' root to a passkey account that has none (`POST /auth/link`).
32
- * The account becomes self-custodied and its recovery email is deleted
31
+ * Link Commons' root to an account that has none (`POST /auth/link`).
32
+ * The account becomes self-custodied and its email is deleted
33
33
  * (ADR 0029 D3).
34
34
  */
35
35
  readonly link: "link_identity";
@@ -123,7 +123,7 @@ export type IdentityErrorCode = (typeof IDENTITY_ERROR_CODES)[keyof typeof IDENT
123
123
  export interface IdentityRootStatus {
124
124
  /** Whether Commons' root is linked: the account is self-custodied. */
125
125
  rootLinked: boolean;
126
- /** The recovery email of a passkey account; `null` once Commons is linked. */
126
+ /** The email of an account without a key; `null` once Commons is linked. */
127
127
  recoveryEmail: string | null;
128
128
  }
129
129
  export declare const identityRootStatusSchema: z.ZodType<IdentityRootStatus>;