@oxy.so/contracts 6.16.0 → 6.18.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.
@@ -121,4 +121,18 @@ exports.IDENTITY_ERROR_CODES = {
121
121
  * was this account's root (security review R6-5).
122
122
  */
123
123
  keyNotProven: 'IDENTITY_KEY_NOT_PROVEN',
124
+ /**
125
+ * `POST /identity/backup`: the stored backup is one a key rotation
126
+ * superseded, and the upload did not acknowledge it with its locator
127
+ * (`replacesLookupId`, security review R7-2). It carries retired keys under
128
+ * the previous phrase, so it is never silently replaced.
129
+ */
130
+ backupSuperseded: 'IDENTITY_BACKUP_SUPERSEDED',
131
+ /**
132
+ * `POST /identity/backup`: the person deleted their encrypted backup, and
133
+ * the upload is not their explicit choice to create one again (`optIn`). A
134
+ * key rotation, a re-seal or another device never re-uploads a backup the
135
+ * person deleted (owner's decision, 2026-11-07).
136
+ */
137
+ backupOptedOut: 'IDENTITY_BACKUP_OPTED_OUT',
124
138
  };
@@ -104,6 +104,28 @@ exports.backupUploadRequestSchema = backupEnvelopeFields.extend({
104
104
  * DB dump therefore cannot recompute a locator to enumerate backups.
105
105
  */
106
106
  lookupId: exports.backupLookupIdSchema,
107
+ /**
108
+ * The raw locator of a SUPERSEDED backup this upload replaces (security
109
+ * review R7-2). A key rotation keeps the previous backup, marked superseded,
110
+ * because it carries the person's retired keys under the previous phrase; an
111
+ * upload replaces it only with this acknowledgement, which proves the client
112
+ * opened it (or carried its keys at the rotation): its sha256 must be the
113
+ * stored backup's. Without it, or with any other locator, an upload over a
114
+ * superseded backup is refused (409 `IDENTITY_BACKUP_SUPERSEDED`). Ignored
115
+ * when the stored backup is current or there is none.
116
+ */
117
+ replacesLookupId: exports.backupLookupIdSchema.optional(),
118
+ /**
119
+ * The person's explicit choice to have a backup (owner's decision,
120
+ * 2026-11-07). A person who deleted their backup (`status.optedOut`) gets a
121
+ * new one only with it: an upload without it is refused (409
122
+ * `IDENTITY_BACKUP_OPTED_OUT`), so a key rotation, a re-seal or another
123
+ * device never re-uploads silently. An accepted upload with it clears the
124
+ * deletion in the same transaction. Ignored when the person never deleted
125
+ * one. Clients send it only from a control the person pressed ("Create
126
+ * backup", or the rotation's "Create a backup" choice).
127
+ */
128
+ optIn: zod_1.z.boolean().optional(),
107
129
  });
108
130
  /**
109
131
  * Response of `GET /identity/backup/status` (and the write/delete acks): whether
@@ -112,6 +134,23 @@ exports.backupUploadRequestSchema = backupEnvelopeFields.extend({
112
134
  */
113
135
  exports.backupStatusResponseSchema = zod_1.z.object({
114
136
  exists: zod_1.z.boolean(),
137
+ /**
138
+ * `true` when the stored backup is one a key rotation SUPERSEDED (R6-8,
139
+ * R7-2): `exists` is `false` (the current key has no backup), and
140
+ * `publicKeyHint` / `createdAt` describe the superseded one. A new backup
141
+ * replaces it only with `replacesLookupId`. Absent otherwise.
142
+ */
143
+ superseded: zod_1.z.boolean().optional(),
144
+ /**
145
+ * `true` when the PERSON deleted their backup (`DELETE /identity/backup`)
146
+ * and has not chosen to create one since (owner's decision, 2026-11-07):
147
+ * `exists` is `false`. Told apart from "never had one" (absent) and from a
148
+ * rotation's `superseded`. Recorded on the account, so every device reads
149
+ * it: no client re-uploads a backup without the person's explicit opt-in
150
+ * (`optIn` on the upload). Without a backup, keys a rotation retired are
151
+ * recoverable off this phone only with their own recovery phrases.
152
+ */
153
+ optedOut: zod_1.z.boolean().optional(),
115
154
  publicKeyHint: zod_1.z.string().optional(),
116
155
  createdAt: zod_1.z.string().optional(),
117
156
  });
@@ -116,4 +116,18 @@ export const IDENTITY_ERROR_CODES = {
116
116
  * was this account's root (security review R6-5).
117
117
  */
118
118
  keyNotProven: 'IDENTITY_KEY_NOT_PROVEN',
119
+ /**
120
+ * `POST /identity/backup`: the stored backup is one a key rotation
121
+ * superseded, and the upload did not acknowledge it with its locator
122
+ * (`replacesLookupId`, security review R7-2). It carries retired keys under
123
+ * the previous phrase, so it is never silently replaced.
124
+ */
125
+ backupSuperseded: 'IDENTITY_BACKUP_SUPERSEDED',
126
+ /**
127
+ * `POST /identity/backup`: the person deleted their encrypted backup, and
128
+ * the upload is not their explicit choice to create one again (`optIn`). A
129
+ * key rotation, a re-seal or another device never re-uploads a backup the
130
+ * person deleted (owner's decision, 2026-11-07).
131
+ */
132
+ backupOptedOut: 'IDENTITY_BACKUP_OPTED_OUT',
119
133
  };
@@ -101,6 +101,28 @@ export const backupUploadRequestSchema = backupEnvelopeFields.extend({
101
101
  * DB dump therefore cannot recompute a locator to enumerate backups.
102
102
  */
103
103
  lookupId: backupLookupIdSchema,
104
+ /**
105
+ * The raw locator of a SUPERSEDED backup this upload replaces (security
106
+ * review R7-2). A key rotation keeps the previous backup, marked superseded,
107
+ * because it carries the person's retired keys under the previous phrase; an
108
+ * upload replaces it only with this acknowledgement, which proves the client
109
+ * opened it (or carried its keys at the rotation): its sha256 must be the
110
+ * stored backup's. Without it, or with any other locator, an upload over a
111
+ * superseded backup is refused (409 `IDENTITY_BACKUP_SUPERSEDED`). Ignored
112
+ * when the stored backup is current or there is none.
113
+ */
114
+ replacesLookupId: backupLookupIdSchema.optional(),
115
+ /**
116
+ * The person's explicit choice to have a backup (owner's decision,
117
+ * 2026-11-07). A person who deleted their backup (`status.optedOut`) gets a
118
+ * new one only with it: an upload without it is refused (409
119
+ * `IDENTITY_BACKUP_OPTED_OUT`), so a key rotation, a re-seal or another
120
+ * device never re-uploads silently. An accepted upload with it clears the
121
+ * deletion in the same transaction. Ignored when the person never deleted
122
+ * one. Clients send it only from a control the person pressed ("Create
123
+ * backup", or the rotation's "Create a backup" choice).
124
+ */
125
+ optIn: z.boolean().optional(),
104
126
  });
105
127
  /**
106
128
  * Response of `GET /identity/backup/status` (and the write/delete acks): whether
@@ -109,6 +131,23 @@ export const backupUploadRequestSchema = backupEnvelopeFields.extend({
109
131
  */
110
132
  export const backupStatusResponseSchema = z.object({
111
133
  exists: z.boolean(),
134
+ /**
135
+ * `true` when the stored backup is one a key rotation SUPERSEDED (R6-8,
136
+ * R7-2): `exists` is `false` (the current key has no backup), and
137
+ * `publicKeyHint` / `createdAt` describe the superseded one. A new backup
138
+ * replaces it only with `replacesLookupId`. Absent otherwise.
139
+ */
140
+ superseded: z.boolean().optional(),
141
+ /**
142
+ * `true` when the PERSON deleted their backup (`DELETE /identity/backup`)
143
+ * and has not chosen to create one since (owner's decision, 2026-11-07):
144
+ * `exists` is `false`. Told apart from "never had one" (absent) and from a
145
+ * rotation's `superseded`. Recorded on the account, so every device reads
146
+ * it: no client re-uploads a backup without the person's explicit opt-in
147
+ * (`optIn` on the upload). Without a backup, keys a rotation retired are
148
+ * recoverable off this phone only with their own recovery phrases.
149
+ */
150
+ optedOut: z.boolean().optional(),
112
151
  publicKeyHint: z.string().optional(),
113
152
  createdAt: z.string().optional(),
114
153
  });
@@ -84,5 +84,19 @@ export declare const IDENTITY_ERROR_CODES: {
84
84
  * was this account's root (security review R6-5).
85
85
  */
86
86
  readonly keyNotProven: "IDENTITY_KEY_NOT_PROVEN";
87
+ /**
88
+ * `POST /identity/backup`: the stored backup is one a key rotation
89
+ * superseded, and the upload did not acknowledge it with its locator
90
+ * (`replacesLookupId`, security review R7-2). It carries retired keys under
91
+ * the previous phrase, so it is never silently replaced.
92
+ */
93
+ readonly backupSuperseded: "IDENTITY_BACKUP_SUPERSEDED";
94
+ /**
95
+ * `POST /identity/backup`: the person deleted their encrypted backup, and
96
+ * the upload is not their explicit choice to create one again (`optIn`). A
97
+ * key rotation, a re-seal or another device never re-uploads a backup the
98
+ * person deleted (owner's decision, 2026-11-07).
99
+ */
100
+ readonly backupOptedOut: "IDENTITY_BACKUP_OPTED_OUT";
87
101
  };
88
102
  export type IdentityErrorCode = (typeof IDENTITY_ERROR_CODES)[keyof typeof IDENTITY_ERROR_CODES];
@@ -70,6 +70,8 @@ export declare const backupUploadRequestSchema: z.ZodObject<{
70
70
  createdAt: z.ZodString;
71
71
  version: z.ZodNumber;
72
72
  lookupId: z.ZodString;
73
+ replacesLookupId: z.ZodOptional<z.ZodString>;
74
+ optIn: z.ZodOptional<z.ZodBoolean>;
73
75
  }, z.core.$strip>;
74
76
  export type BackupUploadRequest = z.infer<typeof backupUploadRequestSchema>;
75
77
  /**
@@ -79,6 +81,8 @@ export type BackupUploadRequest = z.infer<typeof backupUploadRequestSchema>;
79
81
  */
80
82
  export declare const backupStatusResponseSchema: z.ZodObject<{
81
83
  exists: z.ZodBoolean;
84
+ superseded: z.ZodOptional<z.ZodBoolean>;
85
+ optedOut: z.ZodOptional<z.ZodBoolean>;
82
86
  publicKeyHint: z.ZodOptional<z.ZodString>;
83
87
  createdAt: z.ZodOptional<z.ZodString>;
84
88
  }, z.core.$strip>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "6.16.0",
3
+ "version": "6.18.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",