@oxy.so/contracts 6.17.0 → 6.19.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.
@@ -128,4 +128,21 @@ exports.IDENTITY_ERROR_CODES = {
128
128
  * the previous phrase, so it is never silently replaced.
129
129
  */
130
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',
138
+ /**
139
+ * `POST /identity/backup`: the account has no backup on record (never made
140
+ * one, or deleted it before deletions were recorded) and the upload is not
141
+ * the person's explicit choice to create one (`optIn`). Only re-sealing a
142
+ * backup the account HAS (current or superseded) needs no opt-in, so a
143
+ * client too old to send it (Commons 1.12 or older) never creates one
144
+ * silently after a key rotation; the message asks the person to update
145
+ * Commons (owner's decision, 2026-11-07).
146
+ */
147
+ backupOptInRequired: 'IDENTITY_BACKUP_OPT_IN_REQUIRED',
131
148
  };
@@ -115,6 +115,21 @@ exports.backupUploadRequestSchema = backupEnvelopeFields.extend({
115
115
  * when the stored backup is current or there is none.
116
116
  */
117
117
  replacesLookupId: exports.backupLookupIdSchema.optional(),
118
+ /**
119
+ * The person's explicit choice to have a backup (owner's decision,
120
+ * 2026-11-07). Required whenever the account has NO backup row: a person
121
+ * who deleted theirs (`status.optedOut`; refused without it, 409
122
+ * `IDENTITY_BACKUP_OPTED_OUT`) and a person with none on record (never
123
+ * made one, or deleted it before deletions were recorded; 409
124
+ * `IDENTITY_BACKUP_OPT_IN_REQUIRED`), so a key rotation, a re-seal, another
125
+ * device or an older client never creates one silently. An accepted upload
126
+ * with it clears a recorded deletion in the same transaction. Not needed to
127
+ * re-seal a backup the account has (current, or superseded with
128
+ * `replacesLookupId`). Clients send it only from a control the person
129
+ * pressed ("Create backup", or the rotation's "Create an encrypted backup"
130
+ * choice).
131
+ */
132
+ optIn: zod_1.z.boolean().optional(),
118
133
  });
119
134
  /**
120
135
  * Response of `GET /identity/backup/status` (and the write/delete acks): whether
@@ -130,6 +145,16 @@ exports.backupStatusResponseSchema = zod_1.z.object({
130
145
  * replaces it only with `replacesLookupId`. Absent otherwise.
131
146
  */
132
147
  superseded: zod_1.z.boolean().optional(),
148
+ /**
149
+ * `true` when the PERSON deleted their backup (`DELETE /identity/backup`)
150
+ * and has not chosen to create one since (owner's decision, 2026-11-07):
151
+ * `exists` is `false`. Told apart from "never had one" (absent) and from a
152
+ * rotation's `superseded`. Recorded on the account, so every device reads
153
+ * it: no client re-uploads a backup without the person's explicit opt-in
154
+ * (`optIn` on the upload). Without a backup, keys a rotation retired are
155
+ * recoverable off this phone only with their own recovery phrases.
156
+ */
157
+ optedOut: zod_1.z.boolean().optional(),
133
158
  publicKeyHint: zod_1.z.string().optional(),
134
159
  createdAt: zod_1.z.string().optional(),
135
160
  });
@@ -123,4 +123,21 @@ export const IDENTITY_ERROR_CODES = {
123
123
  * the previous phrase, so it is never silently replaced.
124
124
  */
125
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',
133
+ /**
134
+ * `POST /identity/backup`: the account has no backup on record (never made
135
+ * one, or deleted it before deletions were recorded) and the upload is not
136
+ * the person's explicit choice to create one (`optIn`). Only re-sealing a
137
+ * backup the account HAS (current or superseded) needs no opt-in, so a
138
+ * client too old to send it (Commons 1.12 or older) never creates one
139
+ * silently after a key rotation; the message asks the person to update
140
+ * Commons (owner's decision, 2026-11-07).
141
+ */
142
+ backupOptInRequired: 'IDENTITY_BACKUP_OPT_IN_REQUIRED',
126
143
  };
@@ -112,6 +112,21 @@ export const backupUploadRequestSchema = backupEnvelopeFields.extend({
112
112
  * when the stored backup is current or there is none.
113
113
  */
114
114
  replacesLookupId: backupLookupIdSchema.optional(),
115
+ /**
116
+ * The person's explicit choice to have a backup (owner's decision,
117
+ * 2026-11-07). Required whenever the account has NO backup row: a person
118
+ * who deleted theirs (`status.optedOut`; refused without it, 409
119
+ * `IDENTITY_BACKUP_OPTED_OUT`) and a person with none on record (never
120
+ * made one, or deleted it before deletions were recorded; 409
121
+ * `IDENTITY_BACKUP_OPT_IN_REQUIRED`), so a key rotation, a re-seal, another
122
+ * device or an older client never creates one silently. An accepted upload
123
+ * with it clears a recorded deletion in the same transaction. Not needed to
124
+ * re-seal a backup the account has (current, or superseded with
125
+ * `replacesLookupId`). Clients send it only from a control the person
126
+ * pressed ("Create backup", or the rotation's "Create an encrypted backup"
127
+ * choice).
128
+ */
129
+ optIn: z.boolean().optional(),
115
130
  });
116
131
  /**
117
132
  * Response of `GET /identity/backup/status` (and the write/delete acks): whether
@@ -127,6 +142,16 @@ export const backupStatusResponseSchema = z.object({
127
142
  * replaces it only with `replacesLookupId`. Absent otherwise.
128
143
  */
129
144
  superseded: z.boolean().optional(),
145
+ /**
146
+ * `true` when the PERSON deleted their backup (`DELETE /identity/backup`)
147
+ * and has not chosen to create one since (owner's decision, 2026-11-07):
148
+ * `exists` is `false`. Told apart from "never had one" (absent) and from a
149
+ * rotation's `superseded`. Recorded on the account, so every device reads
150
+ * it: no client re-uploads a backup without the person's explicit opt-in
151
+ * (`optIn` on the upload). Without a backup, keys a rotation retired are
152
+ * recoverable off this phone only with their own recovery phrases.
153
+ */
154
+ optedOut: z.boolean().optional(),
130
155
  publicKeyHint: z.string().optional(),
131
156
  createdAt: z.string().optional(),
132
157
  });
@@ -91,5 +91,22 @@ export declare const IDENTITY_ERROR_CODES: {
91
91
  * the previous phrase, so it is never silently replaced.
92
92
  */
93
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";
101
+ /**
102
+ * `POST /identity/backup`: the account has no backup on record (never made
103
+ * one, or deleted it before deletions were recorded) and the upload is not
104
+ * the person's explicit choice to create one (`optIn`). Only re-sealing a
105
+ * backup the account HAS (current or superseded) needs no opt-in, so a
106
+ * client too old to send it (Commons 1.12 or older) never creates one
107
+ * silently after a key rotation; the message asks the person to update
108
+ * Commons (owner's decision, 2026-11-07).
109
+ */
110
+ readonly backupOptInRequired: "IDENTITY_BACKUP_OPT_IN_REQUIRED";
94
111
  };
95
112
  export type IdentityErrorCode = (typeof IDENTITY_ERROR_CODES)[keyof typeof IDENTITY_ERROR_CODES];
@@ -71,6 +71,7 @@ export declare const backupUploadRequestSchema: z.ZodObject<{
71
71
  version: z.ZodNumber;
72
72
  lookupId: z.ZodString;
73
73
  replacesLookupId: z.ZodOptional<z.ZodString>;
74
+ optIn: z.ZodOptional<z.ZodBoolean>;
74
75
  }, z.core.$strip>;
75
76
  export type BackupUploadRequest = z.infer<typeof backupUploadRequestSchema>;
76
77
  /**
@@ -81,6 +82,7 @@ export type BackupUploadRequest = z.infer<typeof backupUploadRequestSchema>;
81
82
  export declare const backupStatusResponseSchema: z.ZodObject<{
82
83
  exists: z.ZodBoolean;
83
84
  superseded: z.ZodOptional<z.ZodBoolean>;
85
+ optedOut: z.ZodOptional<z.ZodBoolean>;
84
86
  publicKeyHint: z.ZodOptional<z.ZodString>;
85
87
  createdAt: z.ZodOptional<z.ZodString>;
86
88
  }, z.core.$strip>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "6.17.0",
3
+ "version": "6.19.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",