@oxy.so/contracts 2.1.0 → 3.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 (57) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountEmail.js +79 -0
  3. package/dist/cjs/deviceBoot.js +2 -2
  4. package/dist/cjs/deviceSession.js +73 -16
  5. package/dist/cjs/identity.js +1 -3
  6. package/dist/cjs/identityLink.js +92 -0
  7. package/dist/cjs/identityProof.js +6 -29
  8. package/dist/cjs/index.js +82 -65
  9. package/dist/cjs/reputation.js +10 -55
  10. package/dist/cjs/signIn.js +304 -0
  11. package/dist/esm/.tsbuildinfo +1 -1
  12. package/dist/esm/accountEmail.js +76 -0
  13. package/dist/esm/deviceBoot.js +2 -2
  14. package/dist/esm/deviceSession.js +72 -15
  15. package/dist/esm/identity.js +1 -3
  16. package/dist/esm/identityLink.js +87 -0
  17. package/dist/esm/identityProof.js +6 -29
  18. package/dist/esm/index.js +13 -16
  19. package/dist/esm/reputation.js +9 -54
  20. package/dist/esm/signIn.js +299 -0
  21. package/dist/types/.tsbuildinfo +1 -1
  22. package/dist/types/accountEmail.d.ts +90 -0
  23. package/dist/types/agency.d.ts +2 -2
  24. package/dist/types/deviceBoot.d.ts +2 -2
  25. package/dist/types/deviceSession.d.ts +131 -19
  26. package/dist/types/externalIdentity.d.ts +4 -4
  27. package/dist/types/identity.d.ts +4 -8
  28. package/dist/types/identityLink.d.ts +146 -0
  29. package/dist/types/identityProof.d.ts +15 -42
  30. package/dist/types/index.d.ts +10 -12
  31. package/dist/types/inference/accountBilling.d.ts +2 -2
  32. package/dist/types/inference/embeddings.d.ts +16 -16
  33. package/dist/types/inference/entitlement.d.ts +2 -2
  34. package/dist/types/inference/errors.d.ts +8 -8
  35. package/dist/types/inference/inbox.d.ts +8 -8
  36. package/dist/types/inference/providerConnection.d.ts +20 -20
  37. package/dist/types/inference/request.d.ts +16 -16
  38. package/dist/types/inference/streamEvents.d.ts +20 -20
  39. package/dist/types/keyRecovery.d.ts +4 -4
  40. package/dist/types/oauth.d.ts +16 -16
  41. package/dist/types/reputation.d.ts +32 -127
  42. package/dist/types/sessionStatus.d.ts +2 -2
  43. package/dist/types/signIn.d.ts +717 -0
  44. package/dist/types/userResponse.d.ts +2 -2
  45. package/package.json +1 -1
  46. package/dist/cjs/identityMove.js +0 -156
  47. package/dist/cjs/identityRecovery.js +0 -51
  48. package/dist/cjs/webIdentityCarrier.js +0 -181
  49. package/dist/cjs/webauthn.js +0 -85
  50. package/dist/esm/identityMove.js +0 -148
  51. package/dist/esm/identityRecovery.js +0 -48
  52. package/dist/esm/webIdentityCarrier.js +0 -178
  53. package/dist/esm/webauthn.js +0 -82
  54. package/dist/types/identityMove.d.ts +0 -185
  55. package/dist/types/identityRecovery.d.ts +0 -246
  56. package/dist/types/webIdentityCarrier.d.ts +0 -1130
  57. package/dist/types/webauthn.d.ts +0 -285
@@ -1,285 +0,0 @@
1
- /**
2
- * WebAuthn / passkey ceremony contracts (Fase B/b1).
3
- *
4
- * These schemas describe ONLY the outer Oxy envelope that wraps a WebAuthn
5
- * ceremony request — the username the client is registering/authenticating as,
6
- * plus non-authoritative device metadata. The browser
7
- * `RegistrationResponseJSON` / `AuthenticationResponseJSON` payloads are NOT
8
- * mirrored here: they are validated by `@simplewebauthn/server` inside the route
9
- * (`verifyRegistrationResponse` / `verifyAuthenticationResponse`), which is the
10
- * single source of truth for their structure. Re-encoding them in Zod would just
11
- * create a second, drift-prone definition of a shape we do not own.
12
- */
13
- import { z } from 'zod';
14
- /**
15
- * `POST /webauthn/register/options` — request registration options. With a bearer
16
- * token the caller links a passkey to their signed-in account and `username` is
17
- * ignored; without one it is a prospective signup and `username` is the desired
18
- * (not-yet-created) handle.
19
- */
20
- export declare const webauthnRegisterOptionsRequestSchema: z.ZodObject<{
21
- username: z.ZodOptional<z.ZodString>;
22
- }, "strip", z.ZodTypeAny, {
23
- username?: string | undefined;
24
- }, {
25
- username?: string | undefined;
26
- }>;
27
- export type WebauthnRegisterOptionsRequest = z.infer<typeof webauthnRegisterOptionsRequestSchema>;
28
- /**
29
- * `POST /webauthn/login/options` — request authentication options. When
30
- * `username` is present the server scopes `allowCredentials` to that user's
31
- * passkeys (username-first); when omitted it returns an empty allow-list for the
32
- * usernameless / discoverable-credential flow (the default).
33
- */
34
- export declare const webauthnLoginOptionsRequestSchema: z.ZodObject<{
35
- username: z.ZodOptional<z.ZodString>;
36
- }, "strip", z.ZodTypeAny, {
37
- username?: string | undefined;
38
- }, {
39
- username?: string | undefined;
40
- }>;
41
- export type WebauthnLoginOptionsRequest = z.infer<typeof webauthnLoginOptionsRequestSchema>;
42
- /**
43
- * `POST /webauthn/register/verify` — the outer envelope. The browser
44
- * `RegistrationResponseJSON` travels alongside these fields under `response` and
45
- * is validated by `@simplewebauthn/server`, not here. `username` is required only
46
- * for the prospective-signup branch (no bearer); the linking branch ignores it.
47
- */
48
- export declare const webauthnRegisterVerifyRequestSchema: z.ZodObject<{
49
- deviceName: z.ZodOptional<z.ZodString>;
50
- deviceFingerprint: z.ZodOptional<z.ZodString>;
51
- username: z.ZodOptional<z.ZodString>;
52
- /**
53
- * Sign-up only (ADR 0024 D4): the account's root, created on the holder BEFORE
54
- * this request — sealed under the passkey being registered — and a root proof
55
- * (`enroll_identity`) whose challenge is the registration challenge. The
56
- * account, passkey, root and envelope are then created in one transaction.
57
- */
58
- identity: z.ZodOptional<z.ZodObject<{
59
- envelope: z.ZodEffects<z.ZodObject<{
60
- version: z.ZodLiteral<2>;
61
- algorithm: z.ZodLiteral<"xchacha20poly1305">;
62
- publicKey: z.ZodString;
63
- secretKind: z.ZodEnum<["mnemonic-entropy", "raw-private-key"]>;
64
- secretNonce: z.ZodString;
65
- sealedSecret: z.ZodString;
66
- wraps: z.ZodArray<z.ZodObject<{
67
- credentialId: z.ZodString;
68
- nonce: z.ZodString;
69
- wrappedKey: z.ZodString;
70
- createdAt: z.ZodString;
71
- rpId: z.ZodString;
72
- verifiedAt: z.ZodOptional<z.ZodString>;
73
- }, "strip", z.ZodTypeAny, {
74
- credentialId: string;
75
- createdAt: string;
76
- nonce: string;
77
- wrappedKey: string;
78
- rpId: string;
79
- verifiedAt?: string | undefined;
80
- }, {
81
- credentialId: string;
82
- createdAt: string;
83
- nonce: string;
84
- wrappedKey: string;
85
- rpId: string;
86
- verifiedAt?: string | undefined;
87
- }>, "many">;
88
- }, "strip", z.ZodTypeAny, {
89
- version: 2;
90
- publicKey: string;
91
- algorithm: "xchacha20poly1305";
92
- secretKind: "mnemonic-entropy" | "raw-private-key";
93
- secretNonce: string;
94
- sealedSecret: string;
95
- wraps: {
96
- credentialId: string;
97
- createdAt: string;
98
- nonce: string;
99
- wrappedKey: string;
100
- rpId: string;
101
- verifiedAt?: string | undefined;
102
- }[];
103
- }, {
104
- version: 2;
105
- publicKey: string;
106
- algorithm: "xchacha20poly1305";
107
- secretKind: "mnemonic-entropy" | "raw-private-key";
108
- secretNonce: string;
109
- sealedSecret: string;
110
- wraps: {
111
- credentialId: string;
112
- createdAt: string;
113
- nonce: string;
114
- wrappedKey: string;
115
- rpId: string;
116
- verifiedAt?: string | undefined;
117
- }[];
118
- }>, {
119
- version: 2;
120
- publicKey: string;
121
- algorithm: "xchacha20poly1305";
122
- secretKind: "mnemonic-entropy" | "raw-private-key";
123
- secretNonce: string;
124
- sealedSecret: string;
125
- wraps: {
126
- credentialId: string;
127
- createdAt: string;
128
- nonce: string;
129
- wrappedKey: string;
130
- rpId: string;
131
- verifiedAt?: string | undefined;
132
- }[];
133
- }, {
134
- version: 2;
135
- publicKey: string;
136
- algorithm: "xchacha20poly1305";
137
- secretKind: "mnemonic-entropy" | "raw-private-key";
138
- secretNonce: string;
139
- sealedSecret: string;
140
- wraps: {
141
- credentialId: string;
142
- createdAt: string;
143
- nonce: string;
144
- wrappedKey: string;
145
- rpId: string;
146
- verifiedAt?: string | undefined;
147
- }[];
148
- }>;
149
- proof: z.ZodObject<{
150
- v: z.ZodLiteral<2>;
151
- challenge: z.ZodString;
152
- expiresAt: z.ZodNumber;
153
- signature: z.ZodString;
154
- }, "strip", z.ZodTypeAny, {
155
- expiresAt: number;
156
- signature: string;
157
- v: 2;
158
- challenge: string;
159
- }, {
160
- expiresAt: number;
161
- signature: string;
162
- v: 2;
163
- challenge: string;
164
- }>;
165
- }, "strip", z.ZodTypeAny, {
166
- proof: {
167
- expiresAt: number;
168
- signature: string;
169
- v: 2;
170
- challenge: string;
171
- };
172
- envelope: {
173
- version: 2;
174
- publicKey: string;
175
- algorithm: "xchacha20poly1305";
176
- secretKind: "mnemonic-entropy" | "raw-private-key";
177
- secretNonce: string;
178
- sealedSecret: string;
179
- wraps: {
180
- credentialId: string;
181
- createdAt: string;
182
- nonce: string;
183
- wrappedKey: string;
184
- rpId: string;
185
- verifiedAt?: string | undefined;
186
- }[];
187
- };
188
- }, {
189
- proof: {
190
- expiresAt: number;
191
- signature: string;
192
- v: 2;
193
- challenge: string;
194
- };
195
- envelope: {
196
- version: 2;
197
- publicKey: string;
198
- algorithm: "xchacha20poly1305";
199
- secretKind: "mnemonic-entropy" | "raw-private-key";
200
- secretNonce: string;
201
- sealedSecret: string;
202
- wraps: {
203
- credentialId: string;
204
- createdAt: string;
205
- nonce: string;
206
- wrappedKey: string;
207
- rpId: string;
208
- verifiedAt?: string | undefined;
209
- }[];
210
- };
211
- }>>;
212
- }, "strip", z.ZodTypeAny, {
213
- username?: string | undefined;
214
- identity?: {
215
- proof: {
216
- expiresAt: number;
217
- signature: string;
218
- v: 2;
219
- challenge: string;
220
- };
221
- envelope: {
222
- version: 2;
223
- publicKey: string;
224
- algorithm: "xchacha20poly1305";
225
- secretKind: "mnemonic-entropy" | "raw-private-key";
226
- secretNonce: string;
227
- sealedSecret: string;
228
- wraps: {
229
- credentialId: string;
230
- createdAt: string;
231
- nonce: string;
232
- wrappedKey: string;
233
- rpId: string;
234
- verifiedAt?: string | undefined;
235
- }[];
236
- };
237
- } | undefined;
238
- deviceName?: string | undefined;
239
- deviceFingerprint?: string | undefined;
240
- }, {
241
- username?: string | undefined;
242
- identity?: {
243
- proof: {
244
- expiresAt: number;
245
- signature: string;
246
- v: 2;
247
- challenge: string;
248
- };
249
- envelope: {
250
- version: 2;
251
- publicKey: string;
252
- algorithm: "xchacha20poly1305";
253
- secretKind: "mnemonic-entropy" | "raw-private-key";
254
- secretNonce: string;
255
- sealedSecret: string;
256
- wraps: {
257
- credentialId: string;
258
- createdAt: string;
259
- nonce: string;
260
- wrappedKey: string;
261
- rpId: string;
262
- verifiedAt?: string | undefined;
263
- }[];
264
- };
265
- } | undefined;
266
- deviceName?: string | undefined;
267
- deviceFingerprint?: string | undefined;
268
- }>;
269
- export type WebauthnRegisterVerifyRequest = z.infer<typeof webauthnRegisterVerifyRequestSchema>;
270
- /**
271
- * `POST /webauthn/login/verify` — the outer envelope. The browser
272
- * `AuthenticationResponseJSON` travels alongside these fields under `response`
273
- * and is validated by `@simplewebauthn/server`, not here.
274
- */
275
- export declare const webauthnLoginVerifyRequestSchema: z.ZodObject<{
276
- deviceName: z.ZodOptional<z.ZodString>;
277
- deviceFingerprint: z.ZodOptional<z.ZodString>;
278
- }, "strip", z.ZodTypeAny, {
279
- deviceName?: string | undefined;
280
- deviceFingerprint?: string | undefined;
281
- }, {
282
- deviceName?: string | undefined;
283
- deviceFingerprint?: string | undefined;
284
- }>;
285
- export type WebauthnLoginVerifyRequest = z.infer<typeof webauthnLoginVerifyRequestSchema>;