@oxy.so/contracts 6.19.0 → 6.20.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.
@@ -0,0 +1,272 @@
1
+ /**
2
+ * The Oxy Keychain's wire contract, without Zod (ADR 0063,
3
+ * `docs/identity/keychain.md`). Schemas: `../keychain.ts`.
4
+ *
5
+ * Oxy stores only ciphertext, public keys, signatures and counters. Every
6
+ * binary value is base64url WITHOUT padding, in its one canonical spelling
7
+ * (the unused low bits of the last character are zero), so no two strings name
8
+ * the same bytes.
9
+ *
10
+ * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
11
+ */
12
+ /** The platforms a member may name: a closed set, for display only (ADR 0063 D3). */
13
+ export declare const KEYCHAIN_PLATFORMS: readonly ["oxyos", "ios", "android", "macos", "windows", "linux", "web"];
14
+ export type KeychainPlatform = (typeof KEYCHAIN_PLATFORMS)[number];
15
+ /** The roster's operations (ADR 0063 D3). */
16
+ export declare const KEYCHAIN_ROSTER_OPS: readonly ["genesis", "add", "remove", "generation", "recovery"];
17
+ export type KeychainRosterOp = (typeof KEYCHAIN_ROSTER_OPS)[number];
18
+ /** An enrollment's states. An expired pending one is answered `410`, never served as pending. */
19
+ export declare const KEYCHAIN_ENROLLMENT_STATUSES: readonly ["pending", "approved", "denied"];
20
+ export type KeychainEnrollmentStatus = (typeof KEYCHAIN_ENROLLMENT_STATUSES)[number];
21
+ /**
22
+ * The recipient of the recovery wrap, and the signer named by a signature made
23
+ * with the recovery signing key.
24
+ */
25
+ export declare const KEYCHAIN_RECOVERY: "recovery";
26
+ /**
27
+ * Every domain string (ADR 0063 D8). Each signing input, AAD and derivation
28
+ * starts with one, so nothing signed or sealed as one kind can be replayed as
29
+ * another.
30
+ */
31
+ export declare const KEYCHAIN_DOMAINS: {
32
+ readonly roster: "oxy.keychain.roster.v1";
33
+ readonly wrap: "oxy.keychain.wrap.v1";
34
+ readonly item: "oxy.keychain.item.v1";
35
+ readonly seal: "oxy.keychain.seal.v1";
36
+ readonly enrollCommit: "oxy.keychain.enroll.commit.v1";
37
+ readonly enrollCode: "oxy.keychain.enroll.code.v1";
38
+ readonly recovery: "oxy.keychain.recovery.v1";
39
+ };
40
+ /** The server's limits (`docs/identity/keychain.md`). */
41
+ export declare const KEYCHAIN_LIMITS: {
42
+ /** Live (non-deleted) items in one vault. */
43
+ readonly maxLiveItems: 10000;
44
+ /** An item's or a wrap's ciphertext, in base64url characters (64 KiB). */
45
+ readonly maxCiphertextLength: 65536;
46
+ /** Entries in one roster, genesis included. */
47
+ readonly maxRosterEntries: 1000;
48
+ /** Members not removed. */
49
+ readonly maxLiveMembers: 32;
50
+ /** Unexpired pending enrollments per vault. */
51
+ readonly maxPendingEnrollments: 4;
52
+ /** How long an enrollment waits for its approval. */
53
+ readonly enrollmentTtlMs: number;
54
+ /** Items in one `GET /keychain/items` page. */
55
+ readonly maxItemsPage: 500;
56
+ /** Entries in one roster append. */
57
+ readonly maxEntriesPerAppend: 64;
58
+ /** One roster entry's `body`, in characters. */
59
+ readonly maxEntryBodyLength: 4096;
60
+ /** A member's display name, in bytes of UTF-8 (at least 1; any characters). */
61
+ readonly maxMemberNameBytes: 256;
62
+ };
63
+ /**
64
+ * Stable error codes the `/keychain` routes answer with (`error` in the API's
65
+ * error body). Clients map these through their localization, never the English
66
+ * message.
67
+ */
68
+ export declare const KEYCHAIN_ERROR_CODES: {
69
+ /** Not a personal account acting as itself. */
70
+ readonly notAvailable: "KEYCHAIN_NOT_AVAILABLE";
71
+ /** The bearer carries no device session, which a member is bound to. */
72
+ readonly deviceRequired: "KEYCHAIN_DEVICE_REQUIRED";
73
+ /** `POST /keychain`: the account already has a vault. */
74
+ readonly exists: "KEYCHAIN_EXISTS";
75
+ /** The account has no vault. */
76
+ readonly notFound: "KEYCHAIN_NOT_FOUND";
77
+ /** The caller's device session is bound to no live member of the vault. */
78
+ readonly notMember: "KEYCHAIN_NOT_MEMBER";
79
+ /** The caller's device session is already bound to a live member. */
80
+ readonly alreadyMember: "KEYCHAIN_ALREADY_MEMBER";
81
+ /** The entries do not continue the roster's head (a fork, a race, a stale head). */
82
+ readonly rosterConflict: "KEYCHAIN_ROSTER_CONFLICT";
83
+ /** An entry is malformed, non-canonical, badly signed, or breaks a roster rule. */
84
+ readonly rosterInvalid: "KEYCHAIN_ROSTER_INVALID";
85
+ /** A wrap is malformed, badly signed, or not the one the entries require. */
86
+ readonly wrapInvalid: "KEYCHAIN_WRAP_INVALID";
87
+ /**
88
+ * A `remove` without its `generation`, or a `generation` without a wrap at
89
+ * that generation for every remaining member and `recovery`.
90
+ */
91
+ readonly rotationIncomplete: "KEYCHAIN_ROTATION_INCOMPLETE";
92
+ /** A limit of `KEYCHAIN_LIMITS` would be exceeded. */
93
+ readonly limitReached: "KEYCHAIN_LIMIT_REACHED";
94
+ /** No such enrollment for this vault. */
95
+ readonly enrollmentNotFound: "KEYCHAIN_ENROLLMENT_NOT_FOUND";
96
+ /** The enrollment's ten minutes are over. */
97
+ readonly enrollmentExpired: "KEYCHAIN_ENROLLMENT_EXPIRED";
98
+ /** The enrollment is not at the step this request takes (or was decided). */
99
+ readonly enrollmentState: "KEYCHAIN_ENROLLMENT_STATE";
100
+ /** The revealed device nonce does not open the commitment; the enrollment is denied. */
101
+ readonly commitmentMismatch: "KEYCHAIN_COMMITMENT_MISMATCH";
102
+ /** No such item, or it is deleted. */
103
+ readonly itemNotFound: "KEYCHAIN_ITEM_NOT_FOUND";
104
+ /** `baseRevision` is not the item's stored revision: re-read, merge, retry. */
105
+ readonly itemConflict: "KEYCHAIN_ITEM_CONFLICT";
106
+ /** An item's generation is not between 1 and the vault's. */
107
+ readonly generationInvalid: "KEYCHAIN_GENERATION_INVALID";
108
+ /** `DELETE /keychain` on an account with a linked root: a root proof is required. */
109
+ readonly resetProofRequired: "KEYCHAIN_RESET_PROOF_REQUIRED";
110
+ };
111
+ export type KeychainErrorCode = (typeof KEYCHAIN_ERROR_CODES)[keyof typeof KEYCHAIN_ERROR_CODES];
112
+ /** A lowercase uuid in its 8-4-4-4-12 form, any version: vault, member, item and enrollment ids. */
113
+ export declare const KEYCHAIN_ID_PATTERN: RegExp;
114
+ /** A roster timestamp in its one spelling: UTC with milliseconds, as `Date#toISOString` writes it. */
115
+ export declare const KEYCHAIN_TIMESTAMP_PATTERN: RegExp;
116
+ /** 32 bytes, canonical base64url (43 characters): keys, enrollment nonces, commitments. */
117
+ export declare const KEYCHAIN_BYTES32_PATTERN: RegExp;
118
+ /** 24 bytes, base64url (32 characters): an XChaCha20-Poly1305 nonce. */
119
+ export declare const KEYCHAIN_NONCE_PATTERN: RegExp;
120
+ /** 64 bytes, canonical base64url (86 characters): an Ed25519 signature. */
121
+ export declare const KEYCHAIN_SIGNATURE_PATTERN: RegExp;
122
+ /** Any length of canonical base64url without padding. */
123
+ export declare const KEYCHAIN_BASE64URL_PATTERN: RegExp;
124
+ /** A roster entry's hash: lowercase hex SHA-256. */
125
+ export declare const KEYCHAIN_HASH_PATTERN: RegExp;
126
+ /** A device in the roster (ADR 0063 D3). `id` is a uuid the device chooses. */
127
+ export interface KeychainMember {
128
+ id: string;
129
+ name: string;
130
+ platform: KeychainPlatform;
131
+ /** Ed25519 public key. */
132
+ signingKey: string;
133
+ /** X25519 public key. */
134
+ boxKey: string;
135
+ }
136
+ /** The recovery key's public halves, derived from it (ADR 0063 D8). */
137
+ export interface KeychainRecoveryKeys {
138
+ signingKey: string;
139
+ boxKey: string;
140
+ }
141
+ interface KeychainRosterBodyBase {
142
+ v: 1;
143
+ vaultId: string;
144
+ seq: number;
145
+ /** The previous entry's hash; `null` only at seq 0. */
146
+ prev: string | null;
147
+ /** The writer's clock, ISO 8601 UTC. Informational. */
148
+ createdAt: string;
149
+ }
150
+ /**
151
+ * A roster entry without its signatures: what `body` holds, as JCS. Its
152
+ * signing input is `"oxy.keychain.roster.v1\n" ‖ body`; its hash is the hex
153
+ * SHA-256 of that input.
154
+ */
155
+ export type KeychainRosterBody = (KeychainRosterBodyBase & {
156
+ op: 'genesis';
157
+ member: KeychainMember;
158
+ recovery: KeychainRecoveryKeys;
159
+ }) | (KeychainRosterBodyBase & {
160
+ op: 'add';
161
+ member: KeychainMember;
162
+ }) | (KeychainRosterBodyBase & {
163
+ op: 'remove';
164
+ memberId: string;
165
+ }) | (KeychainRosterBodyBase & {
166
+ op: 'generation';
167
+ generation: number;
168
+ }) | (KeychainRosterBodyBase & {
169
+ op: 'recovery';
170
+ recovery: KeychainRecoveryKeys;
171
+ });
172
+ /** One signature on an entry: a member id, or `recovery`. */
173
+ export interface KeychainSignature {
174
+ signer: string;
175
+ signature: string;
176
+ }
177
+ /** A roster entry as it travels: the JCS body exactly as signed, and its signatures. */
178
+ export interface KeychainEntry {
179
+ body: string;
180
+ signatures: KeychainSignature[];
181
+ }
182
+ /**
183
+ * The keyring sealed to one recipient (a member id or `recovery`) and signed
184
+ * by its sealer over `"oxy.keychain.wrap.v1\n" ‖ JCS({ vaultId, recipient,
185
+ * generation, epk, nonce, ciphertext, signer })`.
186
+ */
187
+ export interface KeychainWrap {
188
+ recipient: string;
189
+ generation: number;
190
+ epk: string;
191
+ nonce: string;
192
+ ciphertext: string;
193
+ signer: string;
194
+ signature: string;
195
+ }
196
+ /** The vault's counters. */
197
+ export interface KeychainVaultSummary {
198
+ id: string;
199
+ genesisHash: string;
200
+ rosterSeq: number;
201
+ rosterHead: string;
202
+ generation: number;
203
+ revision: number;
204
+ }
205
+ /** What Oxy says about each member: whether its device session ended, whether it was removed. */
206
+ export interface KeychainMemberStatus {
207
+ id: string;
208
+ orphaned: boolean;
209
+ removed: boolean;
210
+ }
211
+ /**
212
+ * `GET /keychain` (and the answer of every roster write). No vault: `vault`
213
+ * and `self` are `null` and the lists empty.
214
+ */
215
+ export interface KeychainStateResponse {
216
+ vault: KeychainVaultSummary | null;
217
+ roster: KeychainEntry[];
218
+ members: KeychainMemberStatus[];
219
+ /** The live member bound to the caller's device session. */
220
+ self: string | null;
221
+ }
222
+ /** `GET /keychain/wrap`, `GET /keychain/recovery`. */
223
+ export interface KeychainWrapResponse {
224
+ wrap: KeychainWrap;
225
+ }
226
+ /** An enrollment (ADR 0063 D5). Timestamps are ISO 8601. */
227
+ export interface KeychainEnrollment {
228
+ id: string;
229
+ vaultId: string;
230
+ member: KeychainMember;
231
+ commitment: string;
232
+ approverNonce: string | null;
233
+ approverMemberId: string | null;
234
+ deviceNonce: string | null;
235
+ status: KeychainEnrollmentStatus;
236
+ expiresAt: string;
237
+ createdAt: string;
238
+ }
239
+ export interface KeychainEnrollmentResponse {
240
+ enrollment: KeychainEnrollment;
241
+ }
242
+ export interface KeychainEnrollmentsResponse {
243
+ enrollments: KeychainEnrollment[];
244
+ }
245
+ /** An item; a deleted one (tombstone) has `nonce`, `ciphertext` null and `deletedAt` set. */
246
+ export interface KeychainItem {
247
+ id: string;
248
+ revision: number;
249
+ generation: number;
250
+ nonce: string | null;
251
+ ciphertext: string | null;
252
+ deletedAt: string | null;
253
+ updatedAt: string;
254
+ }
255
+ export interface KeychainItemResponse {
256
+ item: KeychainItem;
257
+ }
258
+ /** `GET /keychain/items`: the changes after `since`, ascending, and the vault's revision. */
259
+ export interface KeychainItemsResponse {
260
+ items: KeychainItem[];
261
+ /** The vault's revision the page was read at. With `more: false`, the next `since`. */
262
+ revision: number;
263
+ /** More changes follow the last item: ask again with its revision. */
264
+ more: boolean;
265
+ }
266
+ export declare const keychainStateResponseCheck: import("./check").Check<KeychainStateResponse>;
267
+ export declare const keychainWrapResponseCheck: import("./check").Check<KeychainWrapResponse>;
268
+ export declare const keychainEnrollmentResponseCheck: import("./check").Check<KeychainEnrollmentResponse>;
269
+ export declare const keychainEnrollmentsResponseCheck: import("./check").Check<KeychainEnrollmentsResponse>;
270
+ export declare const keychainItemResponseCheck: import("./check").Check<KeychainItemResponse>;
271
+ export declare const keychainItemsResponseCheck: import("./check").Check<KeychainItemsResponse>;
272
+ export {};
@@ -54,7 +54,7 @@ export declare function isEmailSignInChooseAccount(result: EmailSignInStepResult
54
54
  * What a re-verification email code confirms. The code is bound to it: a code
55
55
  * asked for one change never authorises another, and the email names it.
56
56
  */
57
- export declare const REAUTH_ACTIONS: readonly ["change_password", "change_email", "totp", "link_commons", "delete_account", "credentials_manage", "supervision", "supervision_purchase"];
57
+ export declare const REAUTH_ACTIONS: readonly ["change_password", "change_email", "totp", "link_commons", "delete_account", "credentials_manage", "supervision", "supervision_purchase", "reset_keychain"];
58
58
  export type ReauthAction = (typeof REAUTH_ACTIONS)[number];
59
59
  /**
60
60
  * Stable error codes (`error.code` in the API error body). Clients map these
@@ -32,6 +32,7 @@ export declare const identityProofChallengeRequestSchema: z.ZodObject<{
32
32
  link_identity: "link_identity";
33
33
  organization_key_create: "organization_key_create";
34
34
  organization_key_replace: "organization_key_replace";
35
+ keychain_reset: "keychain_reset";
35
36
  }>;
36
37
  }, z.core.$strip>;
37
38
  export type IdentityProofChallengeRequest = z.infer<typeof identityProofChallengeRequestSchema>;
@@ -151,3 +151,4 @@ export type { CampaignAttribution } from './client/campaignAttribution';
151
151
  export { APPLICATION_ACCOUNT_REGISTRATION_BATCH_MAX, APPLICATION_ACCOUNT_TOTAL_MAX_AGE_SECONDS, applicationAccountRegistrationRequestSchema, applicationAccountRegistrationResponseSchema, applicationAccountTotalSchema, } from './applicationAccounts';
152
152
  export type { ApplicationAccountRegistrationRequest, ApplicationAccountRegistrationResponse, ApplicationAccountTotal, } from './applicationAccounts';
153
153
  export * from './postalAddresses';
154
+ export * from './keychain';
@@ -0,0 +1,307 @@
1
+ /**
2
+ * The Oxy Keychain's wire contract (ADR 0063, `docs/identity/keychain.md`).
3
+ *
4
+ * The API parses every `/keychain` request with these schemas and its answers
5
+ * with the response schemas; clients check answers with the Zod-free checks in
6
+ * `./client/keychain.ts` (`@oxy.so/contracts/client`), which mirror them.
7
+ *
8
+ * Every request object is STRICT (an unknown key is refused). Every binary
9
+ * value is canonical base64url without padding, with its length fixed where the
10
+ * bytes are (keys and enrollment nonces 32, AEAD nonces 24, signatures 64).
11
+ *
12
+ * The roster body schemas TRANSFORM NOTHING: the server requires an entry's
13
+ * `body` to equal the JCS of its own parse, so a parse that trimmed, defaulted
14
+ * or lower-cased a value would refuse a canonical body.
15
+ *
16
+ * Platform-agnostic — zod only, no react/react-native/expo. ESM-safe.
17
+ */
18
+ import { z } from 'zod';
19
+ import { type KeychainEnrollmentResponse, type KeychainEnrollmentsResponse, type KeychainItemResponse, type KeychainItemsResponse, type KeychainStateResponse, type KeychainWrapResponse } from './client/keychain';
20
+ export { KEYCHAIN_PLATFORMS, KEYCHAIN_ROSTER_OPS, KEYCHAIN_ENROLLMENT_STATUSES, KEYCHAIN_RECOVERY, KEYCHAIN_DOMAINS, KEYCHAIN_LIMITS, KEYCHAIN_ERROR_CODES, KEYCHAIN_ID_PATTERN, KEYCHAIN_BYTES32_PATTERN, KEYCHAIN_NONCE_PATTERN, KEYCHAIN_SIGNATURE_PATTERN, KEYCHAIN_BASE64URL_PATTERN, KEYCHAIN_HASH_PATTERN, KEYCHAIN_TIMESTAMP_PATTERN, } from './client/keychain';
21
+ export type { KeychainPlatform, KeychainRosterOp, KeychainEnrollmentStatus, KeychainErrorCode, KeychainMember, KeychainRecoveryKeys, KeychainRosterBody, KeychainSignature, KeychainEntry, KeychainWrap, KeychainVaultSummary, KeychainMemberStatus, KeychainStateResponse, KeychainWrapResponse, KeychainEnrollment, KeychainEnrollmentResponse, KeychainEnrollmentsResponse, KeychainItem, KeychainItemResponse, KeychainItemsResponse, } from './client/keychain';
22
+ /** A lowercase uuid: vault, member, item and enrollment ids. */
23
+ export declare const keychainIdSchema: z.ZodString;
24
+ /** A member id or `recovery`: a wrap's recipient, a signature's signer. */
25
+ export declare const keychainPrincipalSchema: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
26
+ /** 32 bytes as canonical base64url: an Ed25519 or X25519 public key, a 32-byte nonce, a commitment. */
27
+ export declare const keychainBytes32Schema: z.ZodString;
28
+ /** A 24-byte XChaCha20-Poly1305 nonce as base64url. */
29
+ export declare const keychainNonceSchema: z.ZodString;
30
+ /** A 64-byte Ed25519 signature as canonical base64url. */
31
+ export declare const keychainSignatureValueSchema: z.ZodString;
32
+ /** A ciphertext (tag included) as canonical base64url, at most 64 KiB of characters. */
33
+ export declare const keychainCiphertextSchema: z.ZodString;
34
+ export declare const keychainMemberSchema: z.ZodObject<{
35
+ id: z.ZodString;
36
+ name: z.ZodString;
37
+ platform: z.ZodEnum<{
38
+ web: "web";
39
+ android: "android";
40
+ ios: "ios";
41
+ oxyos: "oxyos";
42
+ macos: "macos";
43
+ windows: "windows";
44
+ linux: "linux";
45
+ }>;
46
+ signingKey: z.ZodString;
47
+ boxKey: z.ZodString;
48
+ }, z.core.$strict>;
49
+ export declare const keychainRecoveryKeysSchema: z.ZodObject<{
50
+ signingKey: z.ZodString;
51
+ boxKey: z.ZodString;
52
+ }, z.core.$strict>;
53
+ /**
54
+ * The parse of an entry's `body` (ADR 0063 D3). `seq`/`prev` continuity, the
55
+ * signatures and the signer rules are the server's and every device's
56
+ * verifier's, not the schema's; the schema only refuses a body that is not
57
+ * one of the five shapes exactly.
58
+ */
59
+ export declare const keychainRosterBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
60
+ op: z.ZodLiteral<"genesis">;
61
+ member: z.ZodObject<{
62
+ id: z.ZodString;
63
+ name: z.ZodString;
64
+ platform: z.ZodEnum<{
65
+ web: "web";
66
+ android: "android";
67
+ ios: "ios";
68
+ oxyos: "oxyos";
69
+ macos: "macos";
70
+ windows: "windows";
71
+ linux: "linux";
72
+ }>;
73
+ signingKey: z.ZodString;
74
+ boxKey: z.ZodString;
75
+ }, z.core.$strict>;
76
+ recovery: z.ZodObject<{
77
+ signingKey: z.ZodString;
78
+ boxKey: z.ZodString;
79
+ }, z.core.$strict>;
80
+ v: z.ZodLiteral<1>;
81
+ vaultId: z.ZodString;
82
+ seq: z.ZodNumber;
83
+ prev: z.ZodNullable<z.ZodString>;
84
+ createdAt: z.ZodString;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ op: z.ZodLiteral<"add">;
87
+ member: z.ZodObject<{
88
+ id: z.ZodString;
89
+ name: z.ZodString;
90
+ platform: z.ZodEnum<{
91
+ web: "web";
92
+ android: "android";
93
+ ios: "ios";
94
+ oxyos: "oxyos";
95
+ macos: "macos";
96
+ windows: "windows";
97
+ linux: "linux";
98
+ }>;
99
+ signingKey: z.ZodString;
100
+ boxKey: z.ZodString;
101
+ }, z.core.$strict>;
102
+ v: z.ZodLiteral<1>;
103
+ vaultId: z.ZodString;
104
+ seq: z.ZodNumber;
105
+ prev: z.ZodNullable<z.ZodString>;
106
+ createdAt: z.ZodString;
107
+ }, z.core.$strict>, z.ZodObject<{
108
+ op: z.ZodLiteral<"remove">;
109
+ memberId: z.ZodString;
110
+ v: z.ZodLiteral<1>;
111
+ vaultId: z.ZodString;
112
+ seq: z.ZodNumber;
113
+ prev: z.ZodNullable<z.ZodString>;
114
+ createdAt: z.ZodString;
115
+ }, z.core.$strict>, z.ZodObject<{
116
+ op: z.ZodLiteral<"generation">;
117
+ generation: z.ZodNumber;
118
+ v: z.ZodLiteral<1>;
119
+ vaultId: z.ZodString;
120
+ seq: z.ZodNumber;
121
+ prev: z.ZodNullable<z.ZodString>;
122
+ createdAt: z.ZodString;
123
+ }, z.core.$strict>, z.ZodObject<{
124
+ op: z.ZodLiteral<"recovery">;
125
+ recovery: z.ZodObject<{
126
+ signingKey: z.ZodString;
127
+ boxKey: z.ZodString;
128
+ }, z.core.$strict>;
129
+ v: z.ZodLiteral<1>;
130
+ vaultId: z.ZodString;
131
+ seq: z.ZodNumber;
132
+ prev: z.ZodNullable<z.ZodString>;
133
+ createdAt: z.ZodString;
134
+ }, z.core.$strict>], "op">;
135
+ export declare const keychainSignatureSchema: z.ZodObject<{
136
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
137
+ signature: z.ZodString;
138
+ }, z.core.$strict>;
139
+ /** A roster entry as it travels. One or two signatures (genesis has exactly two). */
140
+ export declare const keychainEntrySchema: z.ZodObject<{
141
+ body: z.ZodString;
142
+ signatures: z.ZodArray<z.ZodObject<{
143
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
144
+ signature: z.ZodString;
145
+ }, z.core.$strict>>;
146
+ }, z.core.$strict>;
147
+ export declare const keychainWrapSchema: z.ZodObject<{
148
+ recipient: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
149
+ generation: z.ZodNumber;
150
+ epk: z.ZodString;
151
+ nonce: z.ZodString;
152
+ ciphertext: z.ZodString;
153
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
154
+ signature: z.ZodString;
155
+ }, z.core.$strict>;
156
+ /** `POST /keychain`: the genesis entry, and the member's and the recovery wraps. */
157
+ export declare const keychainCreateRequestSchema: z.ZodObject<{
158
+ genesis: z.ZodObject<{
159
+ body: z.ZodString;
160
+ signatures: z.ZodArray<z.ZodObject<{
161
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
162
+ signature: z.ZodString;
163
+ }, z.core.$strict>>;
164
+ }, z.core.$strict>;
165
+ wraps: z.ZodArray<z.ZodObject<{
166
+ recipient: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
167
+ generation: z.ZodNumber;
168
+ epk: z.ZodString;
169
+ nonce: z.ZodString;
170
+ ciphertext: z.ZodString;
171
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
172
+ signature: z.ZodString;
173
+ }, z.core.$strict>>;
174
+ }, z.core.$strict>;
175
+ export type KeychainCreateRequest = z.infer<typeof keychainCreateRequestSchema>;
176
+ /** `POST /keychain/roster`: entries continuing the head, and the wraps they require. */
177
+ export declare const keychainRosterAppendRequestSchema: z.ZodObject<{
178
+ entries: z.ZodArray<z.ZodObject<{
179
+ body: z.ZodString;
180
+ signatures: z.ZodArray<z.ZodObject<{
181
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
182
+ signature: z.ZodString;
183
+ }, z.core.$strict>>;
184
+ }, z.core.$strict>>;
185
+ wraps: z.ZodDefault<z.ZodArray<z.ZodObject<{
186
+ recipient: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
187
+ generation: z.ZodNumber;
188
+ epk: z.ZodString;
189
+ nonce: z.ZodString;
190
+ ciphertext: z.ZodString;
191
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
192
+ signature: z.ZodString;
193
+ }, z.core.$strict>>>;
194
+ }, z.core.$strict>;
195
+ export type KeychainRosterAppendRequest = z.infer<typeof keychainRosterAppendRequestSchema>;
196
+ /** `POST /keychain/enrollments`: the new device's member and its commitment. */
197
+ export declare const keychainEnrollmentCreateRequestSchema: z.ZodObject<{
198
+ member: z.ZodObject<{
199
+ id: z.ZodString;
200
+ name: z.ZodString;
201
+ platform: z.ZodEnum<{
202
+ web: "web";
203
+ android: "android";
204
+ ios: "ios";
205
+ oxyos: "oxyos";
206
+ macos: "macos";
207
+ windows: "windows";
208
+ linux: "linux";
209
+ }>;
210
+ signingKey: z.ZodString;
211
+ boxKey: z.ZodString;
212
+ }, z.core.$strict>;
213
+ commitment: z.ZodString;
214
+ }, z.core.$strict>;
215
+ export type KeychainEnrollmentCreateRequest = z.infer<typeof keychainEnrollmentCreateRequestSchema>;
216
+ /** `POST /keychain/enrollments/:id/approver-nonce`. */
217
+ export declare const keychainApproverNonceRequestSchema: z.ZodObject<{
218
+ memberId: z.ZodString;
219
+ approverNonce: z.ZodString;
220
+ }, z.core.$strict>;
221
+ export type KeychainApproverNonceRequest = z.infer<typeof keychainApproverNonceRequestSchema>;
222
+ /** `POST /keychain/enrollments/:id/reveal`. */
223
+ export declare const keychainRevealRequestSchema: z.ZodObject<{
224
+ deviceNonce: z.ZodString;
225
+ }, z.core.$strict>;
226
+ export type KeychainRevealRequest = z.infer<typeof keychainRevealRequestSchema>;
227
+ /** `POST /keychain/enrollments/:id/approve`: the `add` entry and the new member's wrap. */
228
+ export declare const keychainApproveRequestSchema: z.ZodObject<{
229
+ entry: z.ZodObject<{
230
+ body: z.ZodString;
231
+ signatures: z.ZodArray<z.ZodObject<{
232
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
233
+ signature: z.ZodString;
234
+ }, z.core.$strict>>;
235
+ }, z.core.$strict>;
236
+ wrap: z.ZodObject<{
237
+ recipient: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
238
+ generation: z.ZodNumber;
239
+ epk: z.ZodString;
240
+ nonce: z.ZodString;
241
+ ciphertext: z.ZodString;
242
+ signer: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"recovery">]>;
243
+ signature: z.ZodString;
244
+ }, z.core.$strict>;
245
+ }, z.core.$strict>;
246
+ export type KeychainApproveRequest = z.infer<typeof keychainApproveRequestSchema>;
247
+ /** `PUT /keychain/items/:itemId`. `baseRevision` is `null` only for an item that never existed. */
248
+ export declare const keychainItemPutRequestSchema: z.ZodObject<{
249
+ baseRevision: z.ZodNullable<z.ZodNumber>;
250
+ generation: z.ZodNumber;
251
+ nonce: z.ZodString;
252
+ ciphertext: z.ZodString;
253
+ }, z.core.$strict>;
254
+ export type KeychainItemPutRequest = z.infer<typeof keychainItemPutRequestSchema>;
255
+ /** `DELETE /keychain/items/:itemId`. */
256
+ export declare const keychainItemDeleteRequestSchema: z.ZodObject<{
257
+ baseRevision: z.ZodNumber;
258
+ }, z.core.$strict>;
259
+ export type KeychainItemDeleteRequest = z.infer<typeof keychainItemDeleteRequestSchema>;
260
+ /** `GET /keychain/items?since=&limit=`. */
261
+ export declare const keychainItemsQuerySchema: z.ZodObject<{
262
+ since: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
263
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
264
+ }, z.core.$strict>;
265
+ export type KeychainItemsQuery = z.infer<typeof keychainItemsQuerySchema>;
266
+ export declare const keychainEnrollmentParamsSchema: z.ZodObject<{
267
+ id: z.ZodString;
268
+ }, z.core.$strict>;
269
+ export declare const keychainItemParamsSchema: z.ZodObject<{
270
+ itemId: z.ZodString;
271
+ }, z.core.$strict>;
272
+ /**
273
+ * `DELETE /keychain` — the reset (ADR 0063 D6), with a fresh re-verification.
274
+ *
275
+ * - An account WITHOUT a linked root: `reauth` for `reset_keychain` (ADR 0030:
276
+ * its email code, or its password when it has no email; plus its
277
+ * authenticator's code when it has one).
278
+ * - An account WITH a linked root (Commons, which has no email or password to
279
+ * re-verify with): `rootProof`, a root proof for the `keychain_reset` action
280
+ * over the payload `{ vaultId }` (ADR 0024 D7, challenge from
281
+ * `POST /identity/proof-challenge`), plus `totpCode` when it has an
282
+ * authenticator.
283
+ */
284
+ export declare const keychainResetRequestSchema: z.ZodObject<{
285
+ reauth: z.ZodOptional<z.ZodObject<{
286
+ password: z.ZodOptional<z.ZodString>;
287
+ emailCode: z.ZodOptional<z.ZodObject<{
288
+ verificationId: z.ZodString;
289
+ code: z.ZodString;
290
+ }, z.core.$strict>>;
291
+ totpCode: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strict>>;
293
+ rootProof: z.ZodOptional<z.ZodObject<{
294
+ v: z.ZodLiteral<2>;
295
+ challenge: z.ZodString;
296
+ expiresAt: z.ZodNumber;
297
+ signature: z.ZodString;
298
+ }, z.core.$strip>>;
299
+ totpCode: z.ZodOptional<z.ZodString>;
300
+ }, z.core.$strict>;
301
+ export type KeychainResetRequest = z.infer<typeof keychainResetRequestSchema>;
302
+ export declare const keychainStateResponseSchema: z.ZodType<KeychainStateResponse>;
303
+ export declare const keychainWrapResponseSchema: z.ZodType<KeychainWrapResponse>;
304
+ export declare const keychainEnrollmentResponseSchema: z.ZodType<KeychainEnrollmentResponse>;
305
+ export declare const keychainEnrollmentsResponseSchema: z.ZodType<KeychainEnrollmentsResponse>;
306
+ export declare const keychainItemResponseSchema: z.ZodType<KeychainItemResponse>;
307
+ export declare const keychainItemsResponseSchema: z.ZodType<KeychainItemsResponse>;
@@ -253,6 +253,7 @@ export declare const reauthEmailStartRequestSchema: z.ZodObject<{
253
253
  credentials_manage: "credentials_manage";
254
254
  supervision: "supervision";
255
255
  supervision_purchase: "supervision_purchase";
256
+ reset_keychain: "reset_keychain";
256
257
  }>;
257
258
  }, z.core.$strict>;
258
259
  export type ReauthEmailStartRequest = z.infer<typeof reauthEmailStartRequestSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "6.19.0",
3
+ "version": "6.20.0",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",