@oxy.so/contracts 1.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.
- package/LICENSE +202 -0
- package/NOTICE +16 -0
- package/dist/cjs/.tsbuildinfo +1 -0
- package/dist/cjs/accountGraph.js +489 -0
- package/dist/cjs/agency.js +439 -0
- package/dist/cjs/browserHub.js +215 -0
- package/dist/cjs/civic.js +163 -0
- package/dist/cjs/commonsSignIn.js +59 -0
- package/dist/cjs/deviceBoot.js +50 -0
- package/dist/cjs/deviceDirectory.js +189 -0
- package/dist/cjs/devicePairing.js +138 -0
- package/dist/cjs/deviceSession.js +164 -0
- package/dist/cjs/emailAgentContext.js +32 -0
- package/dist/cjs/followGraph.js +28 -0
- package/dist/cjs/identity.js +258 -0
- package/dist/cjs/inboxPush.js +24 -0
- package/dist/cjs/index.js +618 -0
- package/dist/cjs/inference/accountBilling.js +334 -0
- package/dist/cjs/inference/aliaModelRelease.js +262 -0
- package/dist/cjs/inference/attribution.js +106 -0
- package/dist/cjs/inference/catalogue.js +487 -0
- package/dist/cjs/inference/entitlement.js +217 -0
- package/dist/cjs/inference/errors.js +309 -0
- package/dist/cjs/inference/identifiers.js +224 -0
- package/dist/cjs/inference/inbox.js +105 -0
- package/dist/cjs/inference/modelDocumentation.js +433 -0
- package/dist/cjs/inference/money.js +188 -0
- package/dist/cjs/inference/priceVersion.js +110 -0
- package/dist/cjs/inference/providerConnection.js +455 -0
- package/dist/cjs/inference/request.js +477 -0
- package/dist/cjs/inference/routingPolicy.js +318 -0
- package/dist/cjs/inference/streamEvents.js +258 -0
- package/dist/cjs/inference/usage.js +329 -0
- package/dist/cjs/inference/version.js +105 -0
- package/dist/cjs/keyRecovery.js +91 -0
- package/dist/cjs/keyRotation.js +75 -0
- package/dist/cjs/links.js +68 -0
- package/dist/cjs/moderationReputation.js +298 -0
- package/dist/cjs/oauth.js +66 -0
- package/dist/cjs/oxyRecordTypes.js +71 -0
- package/dist/cjs/protocol.js +53 -0
- package/dist/cjs/recommendations.js +168 -0
- package/dist/cjs/reputation.js +297 -0
- package/dist/cjs/sessionStatus.js +121 -0
- package/dist/cjs/transparency.js +89 -0
- package/dist/cjs/updates.js +252 -0
- package/dist/cjs/userInvalidation.js +89 -0
- package/dist/cjs/userResponse.js +245 -0
- package/dist/cjs/username.js +290 -0
- package/dist/cjs/webauthn.js +71 -0
- package/dist/esm/.tsbuildinfo +1 -0
- package/dist/esm/accountGraph.js +480 -0
- package/dist/esm/agency.js +436 -0
- package/dist/esm/browserHub.js +212 -0
- package/dist/esm/civic.js +160 -0
- package/dist/esm/commonsSignIn.js +56 -0
- package/dist/esm/deviceBoot.js +47 -0
- package/dist/esm/deviceDirectory.js +186 -0
- package/dist/esm/devicePairing.js +135 -0
- package/dist/esm/deviceSession.js +161 -0
- package/dist/esm/emailAgentContext.js +29 -0
- package/dist/esm/followGraph.js +27 -0
- package/dist/esm/identity.js +255 -0
- package/dist/esm/inboxPush.js +21 -0
- package/dist/esm/index.js +172 -0
- package/dist/esm/inference/accountBilling.js +331 -0
- package/dist/esm/inference/aliaModelRelease.js +259 -0
- package/dist/esm/inference/attribution.js +103 -0
- package/dist/esm/inference/catalogue.js +484 -0
- package/dist/esm/inference/entitlement.js +214 -0
- package/dist/esm/inference/errors.js +306 -0
- package/dist/esm/inference/identifiers.js +221 -0
- package/dist/esm/inference/inbox.js +102 -0
- package/dist/esm/inference/modelDocumentation.js +430 -0
- package/dist/esm/inference/money.js +185 -0
- package/dist/esm/inference/priceVersion.js +107 -0
- package/dist/esm/inference/providerConnection.js +452 -0
- package/dist/esm/inference/request.js +474 -0
- package/dist/esm/inference/routingPolicy.js +315 -0
- package/dist/esm/inference/streamEvents.js +255 -0
- package/dist/esm/inference/usage.js +326 -0
- package/dist/esm/inference/version.js +102 -0
- package/dist/esm/keyRecovery.js +88 -0
- package/dist/esm/keyRotation.js +72 -0
- package/dist/esm/links.js +65 -0
- package/dist/esm/moderationReputation.js +295 -0
- package/dist/esm/oauth.js +63 -0
- package/dist/esm/oxyRecordTypes.js +68 -0
- package/dist/esm/protocol.js +50 -0
- package/dist/esm/recommendations.js +165 -0
- package/dist/esm/reputation.js +293 -0
- package/dist/esm/sessionStatus.js +118 -0
- package/dist/esm/transparency.js +86 -0
- package/dist/esm/updates.js +249 -0
- package/dist/esm/userInvalidation.js +85 -0
- package/dist/esm/userResponse.js +240 -0
- package/dist/esm/username.js +283 -0
- package/dist/esm/webauthn.js +68 -0
- package/dist/types/.tsbuildinfo +1 -0
- package/dist/types/accountGraph.d.ts +378 -0
- package/dist/types/agency.d.ts +2162 -0
- package/dist/types/browserHub.d.ts +856 -0
- package/dist/types/civic.d.ts +338 -0
- package/dist/types/commonsSignIn.d.ts +58 -0
- package/dist/types/deviceBoot.d.ts +74 -0
- package/dist/types/deviceDirectory.d.ts +1317 -0
- package/dist/types/devicePairing.d.ts +130 -0
- package/dist/types/deviceSession.d.ts +411 -0
- package/dist/types/emailAgentContext.d.ts +248 -0
- package/dist/types/followGraph.d.ts +150 -0
- package/dist/types/identity.d.ts +402 -0
- package/dist/types/inboxPush.d.ts +30 -0
- package/dist/types/index.d.ts +100 -0
- package/dist/types/inference/accountBilling.d.ts +738 -0
- package/dist/types/inference/aliaModelRelease.d.ts +609 -0
- package/dist/types/inference/attribution.d.ts +176 -0
- package/dist/types/inference/catalogue.d.ts +1618 -0
- package/dist/types/inference/entitlement.d.ts +519 -0
- package/dist/types/inference/errors.d.ts +242 -0
- package/dist/types/inference/identifiers.d.ts +182 -0
- package/dist/types/inference/inbox.d.ts +374 -0
- package/dist/types/inference/modelDocumentation.d.ts +1603 -0
- package/dist/types/inference/money.d.ts +185 -0
- package/dist/types/inference/priceVersion.d.ts +182 -0
- package/dist/types/inference/providerConnection.d.ts +968 -0
- package/dist/types/inference/request.d.ts +2800 -0
- package/dist/types/inference/routingPolicy.d.ts +616 -0
- package/dist/types/inference/streamEvents.d.ts +950 -0
- package/dist/types/inference/usage.d.ts +1164 -0
- package/dist/types/inference/version.d.ts +102 -0
- package/dist/types/keyRecovery.d.ts +138 -0
- package/dist/types/keyRotation.d.ts +103 -0
- package/dist/types/links.d.ts +96 -0
- package/dist/types/moderationReputation.d.ts +487 -0
- package/dist/types/oauth.d.ts +86 -0
- package/dist/types/oxyRecordTypes.d.ts +62 -0
- package/dist/types/protocol.d.ts +86 -0
- package/dist/types/recommendations.d.ts +542 -0
- package/dist/types/reputation.d.ts +457 -0
- package/dist/types/sessionStatus.d.ts +231 -0
- package/dist/types/transparency.d.ts +392 -0
- package/dist/types/updates.d.ts +545 -0
- package/dist/types/userInvalidation.d.ts +94 -0
- package/dist/types/userResponse.d.ts +1706 -0
- package/dist/types/username.d.ts +265 -0
- package/dist/types/webauthn.d.ts +77 -0
- package/package.json +87 -0
|
@@ -0,0 +1,545 @@
|
|
|
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 `@oxy.so/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
|
+
/** Base64 SHA-256 value required in the presigned PUT's checksum header. */
|
|
119
|
+
checksumSHA256: z.ZodString;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
sha256: string;
|
|
122
|
+
contentType: string;
|
|
123
|
+
uploadUrl: string;
|
|
124
|
+
storageKey: string;
|
|
125
|
+
cacheControl: string;
|
|
126
|
+
checksumSHA256: string;
|
|
127
|
+
}, {
|
|
128
|
+
sha256: string;
|
|
129
|
+
contentType: string;
|
|
130
|
+
uploadUrl: string;
|
|
131
|
+
storageKey: string;
|
|
132
|
+
cacheControl: string;
|
|
133
|
+
checksumSHA256: string;
|
|
134
|
+
}>;
|
|
135
|
+
export type AssetUploadTicket = z.infer<typeof assetUploadTicketSchema>;
|
|
136
|
+
/**
|
|
137
|
+
* `POST /updates/v1/assets/init` response. `missing` holds a presigned upload
|
|
138
|
+
* for each asset the server does not yet have; `existing` lists the sha256s it
|
|
139
|
+
* already holds (the client skips those).
|
|
140
|
+
*/
|
|
141
|
+
export declare const assetInitResponseSchema: z.ZodObject<{
|
|
142
|
+
missing: z.ZodArray<z.ZodObject<{
|
|
143
|
+
sha256: z.ZodString;
|
|
144
|
+
/** Presigned S3 PUT URL. The client PUTs the exact bytes here. */
|
|
145
|
+
uploadUrl: z.ZodString;
|
|
146
|
+
/** The S3 key the object will live at (`public/updates/assets/<sha256>`). */
|
|
147
|
+
storageKey: z.ZodString;
|
|
148
|
+
/** The Content-Type the presigned URL was signed for; echo it on the PUT. */
|
|
149
|
+
contentType: z.ZodString;
|
|
150
|
+
/**
|
|
151
|
+
* The Cache-Control the presigned URL was signed for; the client MUST send it
|
|
152
|
+
* verbatim on the PUT so the SigV4 signature matches and the stored object
|
|
153
|
+
* carries the long immutable cache header (assets are content-addressed).
|
|
154
|
+
*/
|
|
155
|
+
cacheControl: z.ZodString;
|
|
156
|
+
/** Base64 SHA-256 value required in the presigned PUT's checksum header. */
|
|
157
|
+
checksumSHA256: z.ZodString;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
sha256: string;
|
|
160
|
+
contentType: string;
|
|
161
|
+
uploadUrl: string;
|
|
162
|
+
storageKey: string;
|
|
163
|
+
cacheControl: string;
|
|
164
|
+
checksumSHA256: string;
|
|
165
|
+
}, {
|
|
166
|
+
sha256: string;
|
|
167
|
+
contentType: string;
|
|
168
|
+
uploadUrl: string;
|
|
169
|
+
storageKey: string;
|
|
170
|
+
cacheControl: string;
|
|
171
|
+
checksumSHA256: string;
|
|
172
|
+
}>, "many">;
|
|
173
|
+
existing: z.ZodArray<z.ZodString, "many">;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
missing: {
|
|
176
|
+
sha256: string;
|
|
177
|
+
contentType: string;
|
|
178
|
+
uploadUrl: string;
|
|
179
|
+
storageKey: string;
|
|
180
|
+
cacheControl: string;
|
|
181
|
+
checksumSHA256: string;
|
|
182
|
+
}[];
|
|
183
|
+
existing: string[];
|
|
184
|
+
}, {
|
|
185
|
+
missing: {
|
|
186
|
+
sha256: string;
|
|
187
|
+
contentType: string;
|
|
188
|
+
uploadUrl: string;
|
|
189
|
+
storageKey: string;
|
|
190
|
+
cacheControl: string;
|
|
191
|
+
checksumSHA256: string;
|
|
192
|
+
}[];
|
|
193
|
+
existing: string[];
|
|
194
|
+
}>;
|
|
195
|
+
export type AssetInitResponse = z.infer<typeof assetInitResponseSchema>;
|
|
196
|
+
/**
|
|
197
|
+
* `POST /updates/v1/assets/complete` request. Sent after the client has PUT
|
|
198
|
+
* every `missing` asset. The server HEADs each object and flips it to
|
|
199
|
+
* `uploaded`; an object that is absent or size-mismatched is rejected.
|
|
200
|
+
*/
|
|
201
|
+
export declare const assetCompleteRequestSchema: z.ZodObject<{
|
|
202
|
+
applicationId: z.ZodString;
|
|
203
|
+
sha256s: z.ZodArray<z.ZodString, "many">;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
applicationId: string;
|
|
206
|
+
sha256s: string[];
|
|
207
|
+
}, {
|
|
208
|
+
applicationId: string;
|
|
209
|
+
sha256s: string[];
|
|
210
|
+
}>;
|
|
211
|
+
export type AssetCompleteRequest = z.infer<typeof assetCompleteRequestSchema>;
|
|
212
|
+
/** Per-asset verification outcome from `assets/complete`. */
|
|
213
|
+
export declare const assetCompleteResultItemSchema: z.ZodObject<{
|
|
214
|
+
sha256: z.ZodString;
|
|
215
|
+
status: z.ZodEnum<["pending", "uploaded"]>;
|
|
216
|
+
size: z.ZodNumber;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
status: "pending" | "uploaded";
|
|
219
|
+
sha256: string;
|
|
220
|
+
size: number;
|
|
221
|
+
}, {
|
|
222
|
+
status: "pending" | "uploaded";
|
|
223
|
+
sha256: string;
|
|
224
|
+
size: number;
|
|
225
|
+
}>;
|
|
226
|
+
export type AssetCompleteResultItem = z.infer<typeof assetCompleteResultItemSchema>;
|
|
227
|
+
export declare const assetCompleteResponseSchema: z.ZodObject<{
|
|
228
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
229
|
+
sha256: z.ZodString;
|
|
230
|
+
status: z.ZodEnum<["pending", "uploaded"]>;
|
|
231
|
+
size: z.ZodNumber;
|
|
232
|
+
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
status: "pending" | "uploaded";
|
|
234
|
+
sha256: string;
|
|
235
|
+
size: number;
|
|
236
|
+
}, {
|
|
237
|
+
status: "pending" | "uploaded";
|
|
238
|
+
sha256: string;
|
|
239
|
+
size: number;
|
|
240
|
+
}>, "many">;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
assets: {
|
|
243
|
+
status: "pending" | "uploaded";
|
|
244
|
+
sha256: string;
|
|
245
|
+
size: number;
|
|
246
|
+
}[];
|
|
247
|
+
}, {
|
|
248
|
+
assets: {
|
|
249
|
+
status: "pending" | "uploaded";
|
|
250
|
+
sha256: string;
|
|
251
|
+
size: number;
|
|
252
|
+
}[];
|
|
253
|
+
}>;
|
|
254
|
+
export type AssetCompleteResponse = z.infer<typeof assetCompleteResponseSchema>;
|
|
255
|
+
/**
|
|
256
|
+
* A single asset reference inside a create-update request. `key` is the
|
|
257
|
+
* expo-export asset key (the md5-basename the client uses to look the asset up
|
|
258
|
+
* and skip embedded ones); `fileExtension` is the suggested on-disk extension.
|
|
259
|
+
*/
|
|
260
|
+
export declare const updateAssetRefSchema: z.ZodObject<{
|
|
261
|
+
sha256: z.ZodString;
|
|
262
|
+
/** expo-export asset key (md5 basename) — how app code references the asset. */
|
|
263
|
+
key: z.ZodString;
|
|
264
|
+
contentType: z.ZodString;
|
|
265
|
+
/** Suggested file extension including the leading dot (e.g. `.js`, `.png`). */
|
|
266
|
+
fileExtension: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
key: string;
|
|
269
|
+
sha256: string;
|
|
270
|
+
contentType: string;
|
|
271
|
+
fileExtension?: string | undefined;
|
|
272
|
+
}, {
|
|
273
|
+
key: string;
|
|
274
|
+
sha256: string;
|
|
275
|
+
contentType: string;
|
|
276
|
+
fileExtension?: string | undefined;
|
|
277
|
+
}>;
|
|
278
|
+
export type UpdateAssetRef = z.infer<typeof updateAssetRefSchema>;
|
|
279
|
+
/**
|
|
280
|
+
* `POST /updates/v1/updates` request. Publishes one bundle for one platform to a
|
|
281
|
+
* channel (the channel is created on demand — CI-friendly for `pr-<n>`). All
|
|
282
|
+
* referenced assets MUST already be `uploaded` (via init/complete). `extra`
|
|
283
|
+
* MUST carry `expoClient` so `Constants.expoConfig` works after an OTA update.
|
|
284
|
+
*/
|
|
285
|
+
export declare const createUpdateRequestSchema: z.ZodObject<{
|
|
286
|
+
applicationId: z.ZodString;
|
|
287
|
+
channel: z.ZodString;
|
|
288
|
+
runtimeVersion: z.ZodString;
|
|
289
|
+
platform: z.ZodEnum<["ios", "android"]>;
|
|
290
|
+
/** The launch (entry-point) asset — its `fileExtension` is ignored by clients. */
|
|
291
|
+
launchAsset: z.ZodObject<{
|
|
292
|
+
sha256: z.ZodString;
|
|
293
|
+
/** expo-export asset key (md5 basename) — how app code references the asset. */
|
|
294
|
+
key: z.ZodString;
|
|
295
|
+
contentType: z.ZodString;
|
|
296
|
+
/** Suggested file extension including the leading dot (e.g. `.js`, `.png`). */
|
|
297
|
+
fileExtension: z.ZodOptional<z.ZodString>;
|
|
298
|
+
}, "strip", z.ZodTypeAny, {
|
|
299
|
+
key: string;
|
|
300
|
+
sha256: string;
|
|
301
|
+
contentType: string;
|
|
302
|
+
fileExtension?: string | undefined;
|
|
303
|
+
}, {
|
|
304
|
+
key: string;
|
|
305
|
+
sha256: string;
|
|
306
|
+
contentType: string;
|
|
307
|
+
fileExtension?: string | undefined;
|
|
308
|
+
}>;
|
|
309
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
310
|
+
sha256: z.ZodString;
|
|
311
|
+
/** expo-export asset key (md5 basename) — how app code references the asset. */
|
|
312
|
+
key: z.ZodString;
|
|
313
|
+
contentType: z.ZodString;
|
|
314
|
+
/** Suggested file extension including the leading dot (e.g. `.js`, `.png`). */
|
|
315
|
+
fileExtension: z.ZodOptional<z.ZodString>;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
key: string;
|
|
318
|
+
sha256: string;
|
|
319
|
+
contentType: string;
|
|
320
|
+
fileExtension?: string | undefined;
|
|
321
|
+
}, {
|
|
322
|
+
key: string;
|
|
323
|
+
sha256: string;
|
|
324
|
+
contentType: string;
|
|
325
|
+
fileExtension?: string | undefined;
|
|
326
|
+
}>, "many">;
|
|
327
|
+
/**
|
|
328
|
+
* Opaque `extra` blob embedded verbatim in the signed manifest. MUST contain
|
|
329
|
+
* `expoClient` (the public expo config) so `Constants.expoConfig` resolves
|
|
330
|
+
* after an OTA update; MAY carry other third-party config.
|
|
331
|
+
*/
|
|
332
|
+
extra: z.ZodObject<{
|
|
333
|
+
expoClient: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
334
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
335
|
+
expoClient: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
336
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
337
|
+
expoClient: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
338
|
+
}, z.ZodUnknown, "strip">>;
|
|
339
|
+
/** String→string metadata dict; filtered client-side via manifest filters. */
|
|
340
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
341
|
+
/** Initial rollout percentage (default 100 — full rollout). */
|
|
342
|
+
rolloutPercent: z.ZodOptional<z.ZodNumber>;
|
|
343
|
+
/** Git commit the bundle was built from (audit / console display). */
|
|
344
|
+
gitCommit: z.ZodOptional<z.ZodString>;
|
|
345
|
+
/** Git branch the bundle was built from (audit / console display). */
|
|
346
|
+
gitBranch: z.ZodOptional<z.ZodString>;
|
|
347
|
+
/** Human-readable publish message (console display). */
|
|
348
|
+
message: z.ZodOptional<z.ZodString>;
|
|
349
|
+
}, "strip", z.ZodTypeAny, {
|
|
350
|
+
channel: string;
|
|
351
|
+
applicationId: string;
|
|
352
|
+
assets: {
|
|
353
|
+
key: string;
|
|
354
|
+
sha256: string;
|
|
355
|
+
contentType: string;
|
|
356
|
+
fileExtension?: string | undefined;
|
|
357
|
+
}[];
|
|
358
|
+
runtimeVersion: string;
|
|
359
|
+
platform: "ios" | "android";
|
|
360
|
+
launchAsset: {
|
|
361
|
+
key: string;
|
|
362
|
+
sha256: string;
|
|
363
|
+
contentType: string;
|
|
364
|
+
fileExtension?: string | undefined;
|
|
365
|
+
};
|
|
366
|
+
extra: {
|
|
367
|
+
expoClient: Record<string, unknown>;
|
|
368
|
+
} & {
|
|
369
|
+
[k: string]: unknown;
|
|
370
|
+
};
|
|
371
|
+
message?: string | undefined;
|
|
372
|
+
metadata?: Record<string, string> | undefined;
|
|
373
|
+
rolloutPercent?: number | undefined;
|
|
374
|
+
gitCommit?: string | undefined;
|
|
375
|
+
gitBranch?: string | undefined;
|
|
376
|
+
}, {
|
|
377
|
+
channel: string;
|
|
378
|
+
applicationId: string;
|
|
379
|
+
assets: {
|
|
380
|
+
key: string;
|
|
381
|
+
sha256: string;
|
|
382
|
+
contentType: string;
|
|
383
|
+
fileExtension?: string | undefined;
|
|
384
|
+
}[];
|
|
385
|
+
runtimeVersion: string;
|
|
386
|
+
platform: "ios" | "android";
|
|
387
|
+
launchAsset: {
|
|
388
|
+
key: string;
|
|
389
|
+
sha256: string;
|
|
390
|
+
contentType: string;
|
|
391
|
+
fileExtension?: string | undefined;
|
|
392
|
+
};
|
|
393
|
+
extra: {
|
|
394
|
+
expoClient: Record<string, unknown>;
|
|
395
|
+
} & {
|
|
396
|
+
[k: string]: unknown;
|
|
397
|
+
};
|
|
398
|
+
message?: string | undefined;
|
|
399
|
+
metadata?: Record<string, string> | undefined;
|
|
400
|
+
rolloutPercent?: number | undefined;
|
|
401
|
+
gitCommit?: string | undefined;
|
|
402
|
+
gitBranch?: string | undefined;
|
|
403
|
+
}>;
|
|
404
|
+
export type CreateUpdateRequest = z.infer<typeof createUpdateRequestSchema>;
|
|
405
|
+
/**
|
|
406
|
+
* A published update as returned by the read/admin endpoints. `id` is the
|
|
407
|
+
* update's UUIDv4 (the manifest `id`). Declared as an explicit interface (schema
|
|
408
|
+
* annotated `z.ZodType<Update>`) so the nested shape survives a consumer's
|
|
409
|
+
* `moduleResolution: "node"`, matching the convention in the other contracts.
|
|
410
|
+
*/
|
|
411
|
+
export interface Update {
|
|
412
|
+
id: string;
|
|
413
|
+
applicationId: string;
|
|
414
|
+
channel: string;
|
|
415
|
+
runtimeVersion: string;
|
|
416
|
+
platform: UpdatePlatform;
|
|
417
|
+
status: UpdateStatus;
|
|
418
|
+
rolloutPercent: number;
|
|
419
|
+
launchAssetSha256: string;
|
|
420
|
+
assetSha256s: string[];
|
|
421
|
+
gitCommit?: string;
|
|
422
|
+
gitBranch?: string;
|
|
423
|
+
message?: string;
|
|
424
|
+
/** The updateId this update was promoted from, when it is a promotion. */
|
|
425
|
+
promotedFromUpdateId?: string;
|
|
426
|
+
createdAt: string;
|
|
427
|
+
updatedAt: string;
|
|
428
|
+
}
|
|
429
|
+
export declare const updateSchema: z.ZodType<Update>;
|
|
430
|
+
export declare const createUpdateResponseSchema: z.ZodObject<{
|
|
431
|
+
update: z.ZodType<Update, z.ZodTypeDef, Update>;
|
|
432
|
+
}, "strip", z.ZodTypeAny, {
|
|
433
|
+
update: Update;
|
|
434
|
+
}, {
|
|
435
|
+
update: Update;
|
|
436
|
+
}>;
|
|
437
|
+
export type CreateUpdateResponse = z.infer<typeof createUpdateResponseSchema>;
|
|
438
|
+
/** One `rollBackToEmbedded` directive currently active on a channel. */
|
|
439
|
+
export interface RollbackToEmbeddedEntry {
|
|
440
|
+
runtimeVersion: string;
|
|
441
|
+
platform: UpdatePlatform;
|
|
442
|
+
/** ISO 8601 datetime; the client rolls back updates created before this. */
|
|
443
|
+
commitTime: string;
|
|
444
|
+
}
|
|
445
|
+
export declare const rollbackToEmbeddedEntrySchema: z.ZodType<RollbackToEmbeddedEntry>;
|
|
446
|
+
/** A release channel with its currently-active rollback-to-embedded directives. */
|
|
447
|
+
export interface Channel {
|
|
448
|
+
id: string;
|
|
449
|
+
applicationId: string;
|
|
450
|
+
name: string;
|
|
451
|
+
rollbacksToEmbedded: RollbackToEmbeddedEntry[];
|
|
452
|
+
createdAt: string;
|
|
453
|
+
updatedAt: string;
|
|
454
|
+
}
|
|
455
|
+
export declare const channelSchema: z.ZodType<Channel>;
|
|
456
|
+
export declare const channelListResponseSchema: z.ZodObject<{
|
|
457
|
+
channels: z.ZodArray<z.ZodType<Channel, z.ZodTypeDef, Channel>, "many">;
|
|
458
|
+
}, "strip", z.ZodTypeAny, {
|
|
459
|
+
channels: Channel[];
|
|
460
|
+
}, {
|
|
461
|
+
channels: Channel[];
|
|
462
|
+
}>;
|
|
463
|
+
export type ChannelListResponse = z.infer<typeof channelListResponseSchema>;
|
|
464
|
+
export declare const updateListResponseSchema: z.ZodObject<{
|
|
465
|
+
updates: z.ZodArray<z.ZodType<Update, z.ZodTypeDef, Update>, "many">;
|
|
466
|
+
}, "strip", z.ZodTypeAny, {
|
|
467
|
+
updates: Update[];
|
|
468
|
+
}, {
|
|
469
|
+
updates: Update[];
|
|
470
|
+
}>;
|
|
471
|
+
export type UpdateListResponse = z.infer<typeof updateListResponseSchema>;
|
|
472
|
+
/**
|
|
473
|
+
* `POST /updates/v1/channels/:channel/rollback` request. Marks the current head
|
|
474
|
+
* for `(runtimeVersion, platform)` `rolled_back` so the previous published
|
|
475
|
+
* update (if any) becomes head again. Nothing is deleted.
|
|
476
|
+
*/
|
|
477
|
+
export declare const rollbackRequestSchema: z.ZodObject<{
|
|
478
|
+
applicationId: z.ZodString;
|
|
479
|
+
runtimeVersion: z.ZodString;
|
|
480
|
+
platform: z.ZodEnum<["ios", "android"]>;
|
|
481
|
+
}, "strip", z.ZodTypeAny, {
|
|
482
|
+
applicationId: string;
|
|
483
|
+
runtimeVersion: string;
|
|
484
|
+
platform: "ios" | "android";
|
|
485
|
+
}, {
|
|
486
|
+
applicationId: string;
|
|
487
|
+
runtimeVersion: string;
|
|
488
|
+
platform: "ios" | "android";
|
|
489
|
+
}>;
|
|
490
|
+
export type RollbackRequest = z.infer<typeof rollbackRequestSchema>;
|
|
491
|
+
/**
|
|
492
|
+
* `POST /updates/v1/channels/:channel/rollback-to-embedded` request. Records a
|
|
493
|
+
* `rollBackToEmbedded` directive so clients on this `(runtimeVersion, platform)`
|
|
494
|
+
* fall back to the update embedded in their binary.
|
|
495
|
+
*/
|
|
496
|
+
export declare const rollbackToEmbeddedRequestSchema: z.ZodObject<{
|
|
497
|
+
applicationId: z.ZodString;
|
|
498
|
+
runtimeVersion: z.ZodString;
|
|
499
|
+
platform: z.ZodEnum<["ios", "android"]>;
|
|
500
|
+
}, "strip", z.ZodTypeAny, {
|
|
501
|
+
applicationId: string;
|
|
502
|
+
runtimeVersion: string;
|
|
503
|
+
platform: "ios" | "android";
|
|
504
|
+
}, {
|
|
505
|
+
applicationId: string;
|
|
506
|
+
runtimeVersion: string;
|
|
507
|
+
platform: "ios" | "android";
|
|
508
|
+
}>;
|
|
509
|
+
export type RollbackToEmbeddedRequest = z.infer<typeof rollbackToEmbeddedRequestSchema>;
|
|
510
|
+
/**
|
|
511
|
+
* `POST /updates/v1/channels/:channel/promote` request. Promotes an existing
|
|
512
|
+
* update (by `updateId`) into the target channel by creating a NEW update (new
|
|
513
|
+
* UUID) pointing at the SAME assets. `toChannel` defaults to the path channel.
|
|
514
|
+
*/
|
|
515
|
+
export declare const promoteRequestSchema: z.ZodObject<{
|
|
516
|
+
applicationId: z.ZodString;
|
|
517
|
+
updateId: z.ZodString;
|
|
518
|
+
/** Target channel to promote into. Defaults to the path `:channel`. */
|
|
519
|
+
toChannel: z.ZodOptional<z.ZodString>;
|
|
520
|
+
/** Rollout percentage for the promoted update (default 100). */
|
|
521
|
+
rolloutPercent: z.ZodOptional<z.ZodNumber>;
|
|
522
|
+
}, "strip", z.ZodTypeAny, {
|
|
523
|
+
applicationId: string;
|
|
524
|
+
updateId: string;
|
|
525
|
+
rolloutPercent?: number | undefined;
|
|
526
|
+
toChannel?: string | undefined;
|
|
527
|
+
}, {
|
|
528
|
+
applicationId: string;
|
|
529
|
+
updateId: string;
|
|
530
|
+
rolloutPercent?: number | undefined;
|
|
531
|
+
toChannel?: string | undefined;
|
|
532
|
+
}>;
|
|
533
|
+
export type PromoteRequest = z.infer<typeof promoteRequestSchema>;
|
|
534
|
+
/** `PATCH /updates/v1/updates/:updateId` request — adjust a rollout in place. */
|
|
535
|
+
export declare const updateRolloutPatchSchema: z.ZodObject<{
|
|
536
|
+
applicationId: z.ZodString;
|
|
537
|
+
rolloutPercent: z.ZodNumber;
|
|
538
|
+
}, "strip", z.ZodTypeAny, {
|
|
539
|
+
applicationId: string;
|
|
540
|
+
rolloutPercent: number;
|
|
541
|
+
}, {
|
|
542
|
+
applicationId: string;
|
|
543
|
+
rolloutPercent: number;
|
|
544
|
+
}>;
|
|
545
|
+
export type UpdateRolloutPatch = z.infer<typeof updateRolloutPatchSchema>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical contract for the Oxy user-invalidation broadcast.
|
|
3
|
+
*
|
|
4
|
+
* Oxy owns identity, but consumers cache it: Mention keeps a Redis summary per
|
|
5
|
+
* post author, and every backend using `@oxy.so/core` holds the SDK's own GET
|
|
6
|
+
* response cache. Both go stale the moment a profile is edited, and neither has
|
|
7
|
+
* any way to find out — the writer is a different process in a different repo.
|
|
8
|
+
* This is the signal that tells them.
|
|
9
|
+
*
|
|
10
|
+
* The channel name and the payload shape are wire contracts between oxy-api (the
|
|
11
|
+
* publisher) and every consuming backend (the subscribers), so they live here
|
|
12
|
+
* rather than in either side. A hand-typed copy of the channel name fails as
|
|
13
|
+
* "the invalidation never arrives" — silently, because pub/sub has no delivery
|
|
14
|
+
* receipt and a message nobody is listening for is indistinguishable from a
|
|
15
|
+
* message nobody sent.
|
|
16
|
+
*
|
|
17
|
+
* DELIVERY IS AT-MOST-ONCE, AND THAT IS THE DESIGN. Every consumer's cache still
|
|
18
|
+
* carries its own TTL, so a dropped message degrades to exactly the behaviour
|
|
19
|
+
* before this signal existed and never to something worse. That property is what
|
|
20
|
+
* makes a bare Redis PUBLISH sufficient here and an outbox, retries, delivery
|
|
21
|
+
* receipts and payload signatures unnecessary. Do not treat a received event as
|
|
22
|
+
* authoritative for anything except "re-read this user from Oxy".
|
|
23
|
+
*
|
|
24
|
+
* PRIVACY — the payload carries NO user data, only an id, a reason and a
|
|
25
|
+
* timestamp. The channel rides the shared Valkey that every Oxy backend can
|
|
26
|
+
* subscribe to, so anything placed on it is readable by every service in the
|
|
27
|
+
* ecosystem. Never add a name, handle, email, avatar or any profile field: a
|
|
28
|
+
* subscriber that wants the new values re-reads them from Oxy through its normal
|
|
29
|
+
* authenticated path, where the usual authorization applies.
|
|
30
|
+
*
|
|
31
|
+
* Platform-agnostic — zod only, no react/react-native/expo.
|
|
32
|
+
*/
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
/** Redis pub/sub channel carrying user-invalidation events. */
|
|
35
|
+
export declare const OXY_USER_INVALIDATION_CHANNEL = "oxy:user:invalidate";
|
|
36
|
+
/**
|
|
37
|
+
* Why a user record changed, as classified by the writer in oxy-api.
|
|
38
|
+
*
|
|
39
|
+
* - `profile` — anything a consumer renders or caches as IDENTITY: display name,
|
|
40
|
+
* username, avatar, bio, verification, federation fields, account status. This
|
|
41
|
+
* is the DEFAULT for every writer, so a site that forgets to classify itself
|
|
42
|
+
* over-invalidates (correct, marginally slower) rather than under-invalidates
|
|
43
|
+
* (silently wrong). Keep that asymmetry if you add a reason.
|
|
44
|
+
* - `graph` — follow-edge churn only (follower/following counts). High frequency,
|
|
45
|
+
* and bulk follow/unfollow moves up to 200 edges in one call. Nothing renders
|
|
46
|
+
* identity from it and a stale count is harmless to ranking, so it is NOT
|
|
47
|
+
* broadcast — see {@link OXY_PUBLISHED_USER_CHANGE_REASONS}.
|
|
48
|
+
*/
|
|
49
|
+
export declare const OXY_USER_CHANGE_REASONS: readonly ["profile", "graph"];
|
|
50
|
+
export type OxyUserChangeReason = (typeof OXY_USER_CHANGE_REASONS)[number];
|
|
51
|
+
/**
|
|
52
|
+
* The reasons that are actually put on the wire.
|
|
53
|
+
*
|
|
54
|
+
* A reason absent from this list is a local cache eviction in oxy-api and
|
|
55
|
+
* nothing more: no message is published at all, rather than a message every
|
|
56
|
+
* subscriber receives and discards. The distinction matters at bulk-follow
|
|
57
|
+
* scale, where the discarded variant is a 200-message burst on a channel every
|
|
58
|
+
* Oxy backend is subscribed to.
|
|
59
|
+
*
|
|
60
|
+
* This is deliberately a shared list rather than a check inside the publisher:
|
|
61
|
+
* a subscriber needs to know what it can receive, and the schema below rejects
|
|
62
|
+
* anything else, so publisher and subscriber cannot drift into disagreeing about
|
|
63
|
+
* which events exist. Adding a reason therefore forces an explicit decision about
|
|
64
|
+
* whether it broadcasts.
|
|
65
|
+
*/
|
|
66
|
+
export declare const OXY_PUBLISHED_USER_CHANGE_REASONS: readonly ["profile"];
|
|
67
|
+
export type PublishedOxyUserChangeReason = (typeof OXY_PUBLISHED_USER_CHANGE_REASONS)[number];
|
|
68
|
+
/** Whether a change of this kind is broadcast to consumers at all. */
|
|
69
|
+
export declare function isPublishedOxyUserChangeReason(reason: OxyUserChangeReason): reason is PublishedOxyUserChangeReason;
|
|
70
|
+
/**
|
|
71
|
+
* A single user-invalidation event.
|
|
72
|
+
*
|
|
73
|
+
* `at` is the publisher's epoch-ms clock, carried for diagnosis (measuring
|
|
74
|
+
* end-to-end propagation, spotting a wedged subscriber) — never for ordering or
|
|
75
|
+
* conflict resolution. Two Oxy tasks publish from unsynchronised clocks, and the
|
|
76
|
+
* event says only "re-read this user", which is idempotent and order-independent.
|
|
77
|
+
*/
|
|
78
|
+
export declare const oxyUserInvalidationEventSchema: z.ZodObject<{
|
|
79
|
+
/** The Oxy user whose record changed. */
|
|
80
|
+
userId: z.ZodString;
|
|
81
|
+
/** Why it changed. Only broadcast reasons appear on the wire. */
|
|
82
|
+
reason: z.ZodEnum<["profile"]>;
|
|
83
|
+
/** Publisher's epoch-ms timestamp. Diagnostic only. */
|
|
84
|
+
at: z.ZodNumber;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
at: number;
|
|
87
|
+
reason: "profile";
|
|
88
|
+
userId: string;
|
|
89
|
+
}, {
|
|
90
|
+
at: number;
|
|
91
|
+
reason: "profile";
|
|
92
|
+
userId: string;
|
|
93
|
+
}>;
|
|
94
|
+
export type OxyUserInvalidationEvent = z.infer<typeof oxyUserInvalidationEventSchema>;
|