@oxyhq/contracts 0.14.1 → 0.15.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.
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * First-party login result contract.
3
3
  *
4
- * SINGLE SOURCE OF TRUTH for the first-party password login result (2FA arm vs.
5
- * session arm). The API validates its OUTPUT against this schema; every consumer
6
- * (`@oxyhq/core`'s auth mixin) validates its INPUT against the same definition,
7
- * so producer and consumers cannot drift.
4
+ * SINGLE SOURCE OF TRUTH for the first-party login result (the session arm). The
5
+ * API validates its OUTPUT against this schema; every consumer (`@oxyhq/core`'s
6
+ * auth mixin) validates its INPUT against the same definition, so producer and
7
+ * consumers cannot drift. Sign-in is passkey (WebAuthn) or Commons handoff —
8
+ * password and 2FA were removed, so the only outcome is a completed session.
8
9
  *
9
10
  * The device transport is `deviceId` + `deviceSecret` + `POST /session/device/token`
10
11
  * (see `deviceSession.ts`). The legacy cookie/bootstrap/refresh-family lanes were
@@ -39,18 +40,9 @@ export interface SecurityAlert {
39
40
  anomalies: SecurityAlertAnomaly[];
40
41
  }
41
42
  /**
42
- * `POST /auth/login` when the account has 2FA enabled: a short-lived login
43
- * token to be presented at the 2FA challenge, and no session yet.
44
- */
45
- export interface LoginTwoFactorRequired {
46
- twoFactorRequired: true;
47
- loginToken: string;
48
- }
49
- /**
50
- * `POST /auth/login` when authentication completed in one step. Matches the
51
- * API's `SessionAuthResponse` EXACTLY (`buildSessionAuthResponse`). `user` is the
52
- * truncated session-user shape the login endpoint emits (NOT the full
53
- * `userResponseSchema`).
43
+ * A successful sign-in. Matches the API's `SessionAuthResponse` EXACTLY
44
+ * (`buildSessionAuthResponse`). `user` is the truncated session-user shape the
45
+ * sign-in endpoints emit (NOT the full `userResponseSchema`).
54
46
  */
55
47
  export interface LoginSessionResult {
56
48
  sessionId: string;
@@ -77,6 +69,6 @@ export interface LoginSessionResult {
77
69
  avatar?: string;
78
70
  };
79
71
  }
80
- /** The discriminated outcome of `POST /auth/login`. */
81
- export type LoginResult = LoginTwoFactorRequired | LoginSessionResult;
72
+ /** The outcome of a successful sign-in — always a completed session. */
73
+ export type LoginResult = LoginSessionResult;
82
74
  export declare const loginResultSchema: z.ZodType<LoginResult>;
@@ -275,14 +275,19 @@ export declare const domainVerificationInstructionsSchema: z.ZodObject<{
275
275
  export type DomainVerificationInstructions = z.infer<typeof domainVerificationInstructionsSchema>;
276
276
  /**
277
277
  * One linked authentication method. Mirrors a `User.authMethods[]` entry.
278
- * `verificationMethodId` is present for `identity` methods (a key) and absent
279
- * for `password`/social methods, linking the auth method to its DID
280
- * verification-method fragment.
278
+ * `verificationMethodId` is present for `identity` methods (a key), linking the
279
+ * auth method to its DID verification-method fragment. For `webauthn` methods
280
+ * `credentialId` identifies the specific passkey (one entry per registered
281
+ * credential) and `name` is its user-facing label; a passkey is NOT a DID
282
+ * verification method, so it carries no `verificationMethodId` (a passkey-only
283
+ * account stays custodial).
281
284
  */
282
285
  export interface AuthMethodEntry {
283
- type: 'identity' | 'password' | 'google' | 'apple' | 'github';
286
+ type: 'identity' | 'webauthn';
284
287
  linkedAt: string | Date;
285
288
  verificationMethodId?: string;
289
+ credentialId?: string;
290
+ name?: string;
286
291
  }
287
292
  export declare const authMethodEntrySchema: z.ZodType<AuthMethodEntry>;
288
293
  /**
@@ -30,4 +30,8 @@ export type { LinkPreviewStatus, LinkPreview, LinkPreviewBatchRequest, LinkPrevi
30
30
  export { sessionAccountSchema, deviceSessionStateSchema, activeTokenSchema, deviceSessionSyncSchema, deviceTokenMintRequestSchema, deviceTokenMintResponseSchema, deviceHubTicketIssueRequestSchema, deviceHubTicketIssueResponseSchema, deviceHubTicketRedeemRequestSchema, deviceHubTicketRedeemResponseSchema, SESSION_ACCOUNTS_CHANGED_EVENT, sessionAccountsChangedReasonSchema, sessionAccountsChangedEventSchema, } from './deviceSession';
31
31
  export type { SessionAccount, DeviceSessionState, ActiveToken, DeviceSessionSync, DeviceTokenMintRequest, DeviceTokenMintResponse, DeviceHubTicketIssueRequest, DeviceHubTicketIssueResponse, DeviceHubTicketRedeemRequest, DeviceHubTicketRedeemResponse, SessionAccountsChangedReason, SessionAccountsChangedEvent, } from './deviceSession';
32
32
  export { loginResultSchema, } from './deviceBoot';
33
- export type { LoginTwoFactorRequired, LoginSessionResult, LoginResult, SecurityAlert, SecurityAlertAnomaly, } from './deviceBoot';
33
+ export type { LoginSessionResult, LoginResult, SecurityAlert, SecurityAlertAnomaly, } from './deviceBoot';
34
+ export { updatePlatformSchema, updateStatusSchema, updateAssetStatusSchema, sha256HexSchema, channelNameSchema, runtimeVersionSchema, rolloutPercentSchema, assetInitItemSchema, assetInitRequestSchema, assetUploadTicketSchema, assetInitResponseSchema, assetCompleteRequestSchema, assetCompleteResultItemSchema, assetCompleteResponseSchema, updateAssetRefSchema, createUpdateRequestSchema, updateSchema, createUpdateResponseSchema, rollbackToEmbeddedEntrySchema, channelSchema, channelListResponseSchema, updateListResponseSchema, rollbackRequestSchema, rollbackToEmbeddedRequestSchema, promoteRequestSchema, updateRolloutPatchSchema, } from './updates';
35
+ export type { UpdatePlatform, UpdateStatus, UpdateAssetStatus, AssetInitItem, AssetInitRequest, AssetUploadTicket, AssetInitResponse, AssetCompleteRequest, AssetCompleteResultItem, AssetCompleteResponse, UpdateAssetRef, CreateUpdateRequest, Update, CreateUpdateResponse, RollbackToEmbeddedEntry, Channel, ChannelListResponse, UpdateListResponse, RollbackRequest, RollbackToEmbeddedRequest, PromoteRequest, UpdateRolloutPatch, } from './updates';
36
+ export { webauthnRegisterOptionsRequestSchema, webauthnLoginOptionsRequestSchema, webauthnRegisterVerifyRequestSchema, webauthnLoginVerifyRequestSchema, } from './webauthn';
37
+ export type { WebauthnRegisterOptionsRequest, WebauthnLoginOptionsRequest, WebauthnRegisterVerifyRequest, WebauthnLoginVerifyRequest, } from './webauthn';
@@ -0,0 +1,535 @@
1
+ /**
2
+ * Oxy Updates (self-hosted expo-updates protocol) — publish/admin API contracts.
3
+ *
4
+ * SINGLE SOURCE OF TRUTH for the wire shape of the AUTHENTICATED publish/admin
5
+ * surface that the `oxy-ship` CLI and the console Updates tab call. The PUBLIC
6
+ * manifest endpoint (`GET /updates/v1/apps/:clientId/manifest`) speaks the
7
+ * expo-updates v1 protocol verbatim (multipart/mixed, signed) and is therefore
8
+ * NOT modelled here — its shape is dictated by the Expo spec, not by us.
9
+ *
10
+ * The API validates its OUTPUT against these schemas; every consumer (the ship
11
+ * CLI, the console hook) validates its INPUT against the same definitions, so
12
+ * producer and consumers cannot drift.
13
+ *
14
+ * Domain model (mirrors the Mongoose models in `@oxyhq/api`):
15
+ * - A `channel` (e.g. `production`, `preview`, `pr-123`) is a named release
16
+ * track for one application.
17
+ * - An `update` is one published bundle for a single `(channel, runtimeVersion,
18
+ * platform)`. Its `updateId` is a UUIDv4 (the client parses it as a UUID).
19
+ * The HEAD of a track is the newest `published` update for that tuple.
20
+ * - An `asset` is content-addressed by its `sha256`; assets are shared across
21
+ * updates and applications (an unchanged JS bundle is uploaded once).
22
+ *
23
+ * Platform-agnostic — zod only, no react/react-native/expo. ESM-safe (no
24
+ * `require()`).
25
+ */
26
+ import { z } from 'zod';
27
+ /** The two platforms the expo-updates protocol addresses. */
28
+ export declare const updatePlatformSchema: z.ZodEnum<["ios", "android"]>;
29
+ export type UpdatePlatform = z.infer<typeof updatePlatformSchema>;
30
+ /** Lifecycle of a single published update row. */
31
+ export declare const updateStatusSchema: z.ZodEnum<["published", "superseded", "rolled_back"]>;
32
+ export type UpdateStatus = z.infer<typeof updateStatusSchema>;
33
+ /** Upload lifecycle of a content-addressed asset. */
34
+ export declare const updateAssetStatusSchema: z.ZodEnum<["pending", "uploaded"]>;
35
+ export type UpdateAssetStatus = z.infer<typeof updateAssetStatusSchema>;
36
+ /** Lowercase-hex SHA-256 content hash (64 hex chars). */
37
+ export declare const sha256HexSchema: z.ZodString;
38
+ /**
39
+ * A channel name. Constrained to a URL/path-safe slug so it can appear in the
40
+ * `expo-channel-name` header and be used CI-friendly for `pr-<n>` tracks. No
41
+ * colon (BullMQ/id safety) and no slash (path safety).
42
+ */
43
+ export declare const channelNameSchema: z.ZodString;
44
+ /** A runtime version string (expo-updates `runtimeVersion`, e.g. an appVersion). */
45
+ export declare const runtimeVersionSchema: z.ZodString;
46
+ /** A rollout percentage: 0 rolls out to nobody, 100 to everybody. */
47
+ export declare const rolloutPercentSchema: z.ZodNumber;
48
+ /**
49
+ * One asset the client intends to upload as part of an update. `sha256` is the
50
+ * content hash (dedup key); `contentType` and `size` describe the object the
51
+ * server will accept at the presigned URL.
52
+ */
53
+ export declare const assetInitItemSchema: z.ZodObject<{
54
+ sha256: z.ZodString;
55
+ contentType: z.ZodString;
56
+ size: z.ZodNumber;
57
+ }, "strip", z.ZodTypeAny, {
58
+ sha256: string;
59
+ contentType: string;
60
+ size: number;
61
+ }, {
62
+ sha256: string;
63
+ contentType: string;
64
+ size: number;
65
+ }>;
66
+ export type AssetInitItem = z.infer<typeof assetInitItemSchema>;
67
+ /**
68
+ * `POST /updates/v1/assets/init` request. Declares the full asset set of an
69
+ * update; the server replies with a presigned PUT for every asset it does NOT
70
+ * already hold (content-addressed dedup — unchanged assets are never re-uploaded).
71
+ */
72
+ export declare const assetInitRequestSchema: z.ZodObject<{
73
+ applicationId: z.ZodString;
74
+ assets: z.ZodArray<z.ZodObject<{
75
+ sha256: z.ZodString;
76
+ contentType: z.ZodString;
77
+ size: z.ZodNumber;
78
+ }, "strip", z.ZodTypeAny, {
79
+ sha256: string;
80
+ contentType: string;
81
+ size: number;
82
+ }, {
83
+ sha256: string;
84
+ contentType: string;
85
+ size: number;
86
+ }>, "many">;
87
+ }, "strip", z.ZodTypeAny, {
88
+ applicationId: string;
89
+ assets: {
90
+ sha256: string;
91
+ contentType: string;
92
+ size: number;
93
+ }[];
94
+ }, {
95
+ applicationId: string;
96
+ assets: {
97
+ sha256: string;
98
+ contentType: string;
99
+ size: number;
100
+ }[];
101
+ }>;
102
+ export type AssetInitRequest = z.infer<typeof assetInitRequestSchema>;
103
+ /** One presigned upload the client must PUT its bytes to before completing. */
104
+ export declare const assetUploadTicketSchema: z.ZodObject<{
105
+ sha256: z.ZodString;
106
+ /** Presigned S3 PUT URL. The client PUTs the exact bytes here. */
107
+ uploadUrl: z.ZodString;
108
+ /** The S3 key the object will live at (`public/updates/assets/<sha256>`). */
109
+ storageKey: z.ZodString;
110
+ /** The Content-Type the presigned URL was signed for; echo it on the PUT. */
111
+ contentType: z.ZodString;
112
+ /**
113
+ * The Cache-Control the presigned URL was signed for; the client MUST send it
114
+ * verbatim on the PUT so the SigV4 signature matches and the stored object
115
+ * carries the long immutable cache header (assets are content-addressed).
116
+ */
117
+ cacheControl: z.ZodString;
118
+ }, "strip", z.ZodTypeAny, {
119
+ sha256: string;
120
+ contentType: string;
121
+ uploadUrl: string;
122
+ storageKey: string;
123
+ cacheControl: string;
124
+ }, {
125
+ sha256: string;
126
+ contentType: string;
127
+ uploadUrl: string;
128
+ storageKey: string;
129
+ cacheControl: string;
130
+ }>;
131
+ export type AssetUploadTicket = z.infer<typeof assetUploadTicketSchema>;
132
+ /**
133
+ * `POST /updates/v1/assets/init` response. `missing` holds a presigned upload
134
+ * for each asset the server does not yet have; `existing` lists the sha256s it
135
+ * already holds (the client skips those).
136
+ */
137
+ export declare const assetInitResponseSchema: z.ZodObject<{
138
+ missing: z.ZodArray<z.ZodObject<{
139
+ sha256: z.ZodString;
140
+ /** Presigned S3 PUT URL. The client PUTs the exact bytes here. */
141
+ uploadUrl: z.ZodString;
142
+ /** The S3 key the object will live at (`public/updates/assets/<sha256>`). */
143
+ storageKey: z.ZodString;
144
+ /** The Content-Type the presigned URL was signed for; echo it on the PUT. */
145
+ contentType: z.ZodString;
146
+ /**
147
+ * The Cache-Control the presigned URL was signed for; the client MUST send it
148
+ * verbatim on the PUT so the SigV4 signature matches and the stored object
149
+ * carries the long immutable cache header (assets are content-addressed).
150
+ */
151
+ cacheControl: z.ZodString;
152
+ }, "strip", z.ZodTypeAny, {
153
+ sha256: string;
154
+ contentType: string;
155
+ uploadUrl: string;
156
+ storageKey: string;
157
+ cacheControl: string;
158
+ }, {
159
+ sha256: string;
160
+ contentType: string;
161
+ uploadUrl: string;
162
+ storageKey: string;
163
+ cacheControl: string;
164
+ }>, "many">;
165
+ existing: z.ZodArray<z.ZodString, "many">;
166
+ }, "strip", z.ZodTypeAny, {
167
+ missing: {
168
+ sha256: string;
169
+ contentType: string;
170
+ uploadUrl: string;
171
+ storageKey: string;
172
+ cacheControl: string;
173
+ }[];
174
+ existing: string[];
175
+ }, {
176
+ missing: {
177
+ sha256: string;
178
+ contentType: string;
179
+ uploadUrl: string;
180
+ storageKey: string;
181
+ cacheControl: string;
182
+ }[];
183
+ existing: string[];
184
+ }>;
185
+ export type AssetInitResponse = z.infer<typeof assetInitResponseSchema>;
186
+ /**
187
+ * `POST /updates/v1/assets/complete` request. Sent after the client has PUT
188
+ * every `missing` asset. The server HEADs each object and flips it to
189
+ * `uploaded`; an object that is absent or size-mismatched is rejected.
190
+ */
191
+ export declare const assetCompleteRequestSchema: z.ZodObject<{
192
+ applicationId: z.ZodString;
193
+ sha256s: z.ZodArray<z.ZodString, "many">;
194
+ }, "strip", z.ZodTypeAny, {
195
+ applicationId: string;
196
+ sha256s: string[];
197
+ }, {
198
+ applicationId: string;
199
+ sha256s: string[];
200
+ }>;
201
+ export type AssetCompleteRequest = z.infer<typeof assetCompleteRequestSchema>;
202
+ /** Per-asset verification outcome from `assets/complete`. */
203
+ export declare const assetCompleteResultItemSchema: z.ZodObject<{
204
+ sha256: z.ZodString;
205
+ status: z.ZodEnum<["pending", "uploaded"]>;
206
+ size: z.ZodNumber;
207
+ }, "strip", z.ZodTypeAny, {
208
+ status: "pending" | "uploaded";
209
+ sha256: string;
210
+ size: number;
211
+ }, {
212
+ status: "pending" | "uploaded";
213
+ sha256: string;
214
+ size: number;
215
+ }>;
216
+ export type AssetCompleteResultItem = z.infer<typeof assetCompleteResultItemSchema>;
217
+ export declare const assetCompleteResponseSchema: z.ZodObject<{
218
+ assets: z.ZodArray<z.ZodObject<{
219
+ sha256: z.ZodString;
220
+ status: z.ZodEnum<["pending", "uploaded"]>;
221
+ size: z.ZodNumber;
222
+ }, "strip", z.ZodTypeAny, {
223
+ status: "pending" | "uploaded";
224
+ sha256: string;
225
+ size: number;
226
+ }, {
227
+ status: "pending" | "uploaded";
228
+ sha256: string;
229
+ size: number;
230
+ }>, "many">;
231
+ }, "strip", z.ZodTypeAny, {
232
+ assets: {
233
+ status: "pending" | "uploaded";
234
+ sha256: string;
235
+ size: number;
236
+ }[];
237
+ }, {
238
+ assets: {
239
+ status: "pending" | "uploaded";
240
+ sha256: string;
241
+ size: number;
242
+ }[];
243
+ }>;
244
+ export type AssetCompleteResponse = z.infer<typeof assetCompleteResponseSchema>;
245
+ /**
246
+ * A single asset reference inside a create-update request. `key` is the
247
+ * expo-export asset key (the md5-basename the client uses to look the asset up
248
+ * and skip embedded ones); `fileExtension` is the suggested on-disk extension.
249
+ */
250
+ export declare const updateAssetRefSchema: z.ZodObject<{
251
+ sha256: z.ZodString;
252
+ /** expo-export asset key (md5 basename) — how app code references the asset. */
253
+ key: z.ZodString;
254
+ contentType: z.ZodString;
255
+ /** Suggested file extension including the leading dot (e.g. `.js`, `.png`). */
256
+ fileExtension: z.ZodOptional<z.ZodString>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ sha256: string;
259
+ contentType: string;
260
+ key: string;
261
+ fileExtension?: string | undefined;
262
+ }, {
263
+ sha256: string;
264
+ contentType: string;
265
+ key: string;
266
+ fileExtension?: string | undefined;
267
+ }>;
268
+ export type UpdateAssetRef = z.infer<typeof updateAssetRefSchema>;
269
+ /**
270
+ * `POST /updates/v1/updates` request. Publishes one bundle for one platform to a
271
+ * channel (the channel is created on demand — CI-friendly for `pr-<n>`). All
272
+ * referenced assets MUST already be `uploaded` (via init/complete). `extra`
273
+ * MUST carry `expoClient` so `Constants.expoConfig` works after an OTA update.
274
+ */
275
+ export declare const createUpdateRequestSchema: z.ZodObject<{
276
+ applicationId: z.ZodString;
277
+ channel: z.ZodString;
278
+ runtimeVersion: z.ZodString;
279
+ platform: z.ZodEnum<["ios", "android"]>;
280
+ /** The launch (entry-point) asset — its `fileExtension` is ignored by clients. */
281
+ launchAsset: z.ZodObject<{
282
+ sha256: z.ZodString;
283
+ /** expo-export asset key (md5 basename) — how app code references the asset. */
284
+ key: z.ZodString;
285
+ contentType: z.ZodString;
286
+ /** Suggested file extension including the leading dot (e.g. `.js`, `.png`). */
287
+ fileExtension: z.ZodOptional<z.ZodString>;
288
+ }, "strip", z.ZodTypeAny, {
289
+ sha256: string;
290
+ contentType: string;
291
+ key: string;
292
+ fileExtension?: string | undefined;
293
+ }, {
294
+ sha256: string;
295
+ contentType: string;
296
+ key: string;
297
+ fileExtension?: string | undefined;
298
+ }>;
299
+ assets: z.ZodArray<z.ZodObject<{
300
+ sha256: z.ZodString;
301
+ /** expo-export asset key (md5 basename) — how app code references the asset. */
302
+ key: z.ZodString;
303
+ contentType: z.ZodString;
304
+ /** Suggested file extension including the leading dot (e.g. `.js`, `.png`). */
305
+ fileExtension: z.ZodOptional<z.ZodString>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ sha256: string;
308
+ contentType: string;
309
+ key: string;
310
+ fileExtension?: string | undefined;
311
+ }, {
312
+ sha256: string;
313
+ contentType: string;
314
+ key: string;
315
+ fileExtension?: string | undefined;
316
+ }>, "many">;
317
+ /**
318
+ * Opaque `extra` blob embedded verbatim in the signed manifest. MUST contain
319
+ * `expoClient` (the public expo config) so `Constants.expoConfig` resolves
320
+ * after an OTA update; MAY carry other third-party config.
321
+ */
322
+ extra: z.ZodObject<{
323
+ expoClient: z.ZodRecord<z.ZodString, z.ZodUnknown>;
324
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
325
+ expoClient: z.ZodRecord<z.ZodString, z.ZodUnknown>;
326
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
327
+ expoClient: z.ZodRecord<z.ZodString, z.ZodUnknown>;
328
+ }, z.ZodUnknown, "strip">>;
329
+ /** String→string metadata dict; filtered client-side via manifest filters. */
330
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
331
+ /** Initial rollout percentage (default 100 — full rollout). */
332
+ rolloutPercent: z.ZodOptional<z.ZodNumber>;
333
+ /** Git commit the bundle was built from (audit / console display). */
334
+ gitCommit: z.ZodOptional<z.ZodString>;
335
+ /** Git branch the bundle was built from (audit / console display). */
336
+ gitBranch: z.ZodOptional<z.ZodString>;
337
+ /** Human-readable publish message (console display). */
338
+ message: z.ZodOptional<z.ZodString>;
339
+ }, "strip", z.ZodTypeAny, {
340
+ applicationId: string;
341
+ assets: {
342
+ sha256: string;
343
+ contentType: string;
344
+ key: string;
345
+ fileExtension?: string | undefined;
346
+ }[];
347
+ channel: string;
348
+ runtimeVersion: string;
349
+ platform: "ios" | "android";
350
+ launchAsset: {
351
+ sha256: string;
352
+ contentType: string;
353
+ key: string;
354
+ fileExtension?: string | undefined;
355
+ };
356
+ extra: {
357
+ expoClient: Record<string, unknown>;
358
+ } & {
359
+ [k: string]: unknown;
360
+ };
361
+ message?: string | undefined;
362
+ metadata?: Record<string, string> | undefined;
363
+ rolloutPercent?: number | undefined;
364
+ gitCommit?: string | undefined;
365
+ gitBranch?: string | undefined;
366
+ }, {
367
+ applicationId: string;
368
+ assets: {
369
+ sha256: string;
370
+ contentType: string;
371
+ key: string;
372
+ fileExtension?: string | undefined;
373
+ }[];
374
+ channel: string;
375
+ runtimeVersion: string;
376
+ platform: "ios" | "android";
377
+ launchAsset: {
378
+ sha256: string;
379
+ contentType: string;
380
+ key: string;
381
+ fileExtension?: string | undefined;
382
+ };
383
+ extra: {
384
+ expoClient: Record<string, unknown>;
385
+ } & {
386
+ [k: string]: unknown;
387
+ };
388
+ message?: string | undefined;
389
+ metadata?: Record<string, string> | undefined;
390
+ rolloutPercent?: number | undefined;
391
+ gitCommit?: string | undefined;
392
+ gitBranch?: string | undefined;
393
+ }>;
394
+ export type CreateUpdateRequest = z.infer<typeof createUpdateRequestSchema>;
395
+ /**
396
+ * A published update as returned by the read/admin endpoints. `id` is the
397
+ * update's UUIDv4 (the manifest `id`). Declared as an explicit interface (schema
398
+ * annotated `z.ZodType<Update>`) so the nested shape survives a consumer's
399
+ * `moduleResolution: "node"`, matching the convention in the other contracts.
400
+ */
401
+ export interface Update {
402
+ id: string;
403
+ applicationId: string;
404
+ channel: string;
405
+ runtimeVersion: string;
406
+ platform: UpdatePlatform;
407
+ status: UpdateStatus;
408
+ rolloutPercent: number;
409
+ launchAssetSha256: string;
410
+ assetSha256s: string[];
411
+ gitCommit?: string;
412
+ gitBranch?: string;
413
+ message?: string;
414
+ /** The updateId this update was promoted from, when it is a promotion. */
415
+ promotedFromUpdateId?: string;
416
+ createdAt: string;
417
+ updatedAt: string;
418
+ }
419
+ export declare const updateSchema: z.ZodType<Update>;
420
+ export declare const createUpdateResponseSchema: z.ZodObject<{
421
+ update: z.ZodType<Update, z.ZodTypeDef, Update>;
422
+ }, "strip", z.ZodTypeAny, {
423
+ update: Update;
424
+ }, {
425
+ update: Update;
426
+ }>;
427
+ export type CreateUpdateResponse = z.infer<typeof createUpdateResponseSchema>;
428
+ /** One `rollBackToEmbedded` directive currently active on a channel. */
429
+ export interface RollbackToEmbeddedEntry {
430
+ runtimeVersion: string;
431
+ platform: UpdatePlatform;
432
+ /** ISO 8601 datetime; the client rolls back updates created before this. */
433
+ commitTime: string;
434
+ }
435
+ export declare const rollbackToEmbeddedEntrySchema: z.ZodType<RollbackToEmbeddedEntry>;
436
+ /** A release channel with its currently-active rollback-to-embedded directives. */
437
+ export interface Channel {
438
+ id: string;
439
+ applicationId: string;
440
+ name: string;
441
+ rollbacksToEmbedded: RollbackToEmbeddedEntry[];
442
+ createdAt: string;
443
+ updatedAt: string;
444
+ }
445
+ export declare const channelSchema: z.ZodType<Channel>;
446
+ export declare const channelListResponseSchema: z.ZodObject<{
447
+ channels: z.ZodArray<z.ZodType<Channel, z.ZodTypeDef, Channel>, "many">;
448
+ }, "strip", z.ZodTypeAny, {
449
+ channels: Channel[];
450
+ }, {
451
+ channels: Channel[];
452
+ }>;
453
+ export type ChannelListResponse = z.infer<typeof channelListResponseSchema>;
454
+ export declare const updateListResponseSchema: z.ZodObject<{
455
+ updates: z.ZodArray<z.ZodType<Update, z.ZodTypeDef, Update>, "many">;
456
+ }, "strip", z.ZodTypeAny, {
457
+ updates: Update[];
458
+ }, {
459
+ updates: Update[];
460
+ }>;
461
+ export type UpdateListResponse = z.infer<typeof updateListResponseSchema>;
462
+ /**
463
+ * `POST /updates/v1/channels/:channel/rollback` request. Marks the current head
464
+ * for `(runtimeVersion, platform)` `rolled_back` so the previous published
465
+ * update (if any) becomes head again. Nothing is deleted.
466
+ */
467
+ export declare const rollbackRequestSchema: z.ZodObject<{
468
+ applicationId: z.ZodString;
469
+ runtimeVersion: z.ZodString;
470
+ platform: z.ZodEnum<["ios", "android"]>;
471
+ }, "strip", z.ZodTypeAny, {
472
+ applicationId: string;
473
+ runtimeVersion: string;
474
+ platform: "ios" | "android";
475
+ }, {
476
+ applicationId: string;
477
+ runtimeVersion: string;
478
+ platform: "ios" | "android";
479
+ }>;
480
+ export type RollbackRequest = z.infer<typeof rollbackRequestSchema>;
481
+ /**
482
+ * `POST /updates/v1/channels/:channel/rollback-to-embedded` request. Records a
483
+ * `rollBackToEmbedded` directive so clients on this `(runtimeVersion, platform)`
484
+ * fall back to the update embedded in their binary.
485
+ */
486
+ export declare const rollbackToEmbeddedRequestSchema: z.ZodObject<{
487
+ applicationId: z.ZodString;
488
+ runtimeVersion: z.ZodString;
489
+ platform: z.ZodEnum<["ios", "android"]>;
490
+ }, "strip", z.ZodTypeAny, {
491
+ applicationId: string;
492
+ runtimeVersion: string;
493
+ platform: "ios" | "android";
494
+ }, {
495
+ applicationId: string;
496
+ runtimeVersion: string;
497
+ platform: "ios" | "android";
498
+ }>;
499
+ export type RollbackToEmbeddedRequest = z.infer<typeof rollbackToEmbeddedRequestSchema>;
500
+ /**
501
+ * `POST /updates/v1/channels/:channel/promote` request. Promotes an existing
502
+ * update (by `updateId`) into the target channel by creating a NEW update (new
503
+ * UUID) pointing at the SAME assets. `toChannel` defaults to the path channel.
504
+ */
505
+ export declare const promoteRequestSchema: z.ZodObject<{
506
+ applicationId: z.ZodString;
507
+ updateId: z.ZodString;
508
+ /** Target channel to promote into. Defaults to the path `:channel`. */
509
+ toChannel: z.ZodOptional<z.ZodString>;
510
+ /** Rollout percentage for the promoted update (default 100). */
511
+ rolloutPercent: z.ZodOptional<z.ZodNumber>;
512
+ }, "strip", z.ZodTypeAny, {
513
+ applicationId: string;
514
+ updateId: string;
515
+ rolloutPercent?: number | undefined;
516
+ toChannel?: string | undefined;
517
+ }, {
518
+ applicationId: string;
519
+ updateId: string;
520
+ rolloutPercent?: number | undefined;
521
+ toChannel?: string | undefined;
522
+ }>;
523
+ export type PromoteRequest = z.infer<typeof promoteRequestSchema>;
524
+ /** `PATCH /updates/v1/updates/:updateId` request — adjust a rollout in place. */
525
+ export declare const updateRolloutPatchSchema: z.ZodObject<{
526
+ applicationId: z.ZodString;
527
+ rolloutPercent: z.ZodNumber;
528
+ }, "strip", z.ZodTypeAny, {
529
+ applicationId: string;
530
+ rolloutPercent: number;
531
+ }, {
532
+ applicationId: string;
533
+ rolloutPercent: number;
534
+ }>;
535
+ export type UpdateRolloutPatch = z.infer<typeof updateRolloutPatchSchema>;