@hot-updater/protocol 1.2.0-rc.3 → 1.2.0-rc.30

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.
@@ -22,7 +22,7 @@ declare class NativeArtifactError extends Error {
22
22
  * What can keep an artifact from being imported as a native build: the
23
23
  * codes `native-build import --json` reports.
24
24
  */
25
- type NativeArtifactProblemCode = "UNSUPPORTED_FILE" | "UNREADABLE" | "NO_BUILT_IN_BUNDLE" | "NO_MIN_BUNDLE_ID" | "AMBIGUOUS_MIN_BUNDLE_ID" | "NO_FINGERPRINT" | "AMBIGUOUS_FINGERPRINT" | "NO_APP_VERSION" | "INVALID_SCOPE" | "APP_ID_MISMATCH" | "ALREADY_IMPORTED";
25
+ type NativeArtifactProblemCode = "UNSUPPORTED_FILE" | "UNREADABLE" | "NO_BUILT_IN_BUNDLE" | "NO_MIN_BUNDLE_ID" | "AMBIGUOUS_MIN_BUNDLE_ID" | "NO_FINGERPRINT" | "AMBIGUOUS_FINGERPRINT" | "NO_APP_VERSION" | "INVALID_SCOPE" | "SANDBOX_MISMATCH" | "APP_ID_MISMATCH" | "ALREADY_IMPORTED";
26
26
  //#endregion
27
27
  //#region src/nativeArtifact/readNativeArtifact.d.ts
28
28
  /**
@@ -63,6 +63,23 @@ interface NativeArtifactInfo {
63
63
  * with fingerprint.json compiles its fingerprint in as one.
64
64
  */
65
65
  readonly fingerprintCandidates: readonly string[];
66
+ /**
67
+ * The sandbox layer in the artifact: `code` when the app's code holds its
68
+ * literal, and `declared` when the Info.plist or the manifest says so. A
69
+ * sandbox build has both, and a normal build neither.
70
+ */
71
+ readonly sandbox: {
72
+ readonly code: boolean;
73
+ readonly declared: boolean;
74
+ };
75
+ /**
76
+ * How the app is entered, which a sandbox build changes: its launcher
77
+ * components (empty on iOS), and the sandbox URL scheme it registers.
78
+ */
79
+ readonly entry: {
80
+ readonly launchers: readonly string[];
81
+ readonly sandboxUrlScheme: string | null;
82
+ };
66
83
  /** The JavaScript bundle the build packed, the built-in bundle. */
67
84
  readonly builtInBundle: {
68
85
  readonly path: string;
@@ -102,6 +119,10 @@ interface ImportableNativeBuild {
102
119
  readonly appVersion: string | null;
103
120
  /** The built-in bundle's entry in the archive. */
104
121
  readonly builtInBundlePath: string;
122
+ /** Whether the artifact holds the sandbox layer: a sandbox build. */
123
+ readonly sandbox: boolean;
124
+ /** The URL scheme a sandbox build registers; null for any other build. */
125
+ readonly sandboxUrlScheme: string | null;
105
126
  }
106
127
  type NativeArtifactCheck = ({
107
128
  readonly ok: true;
@@ -116,6 +137,11 @@ type NativeArtifactCheck = ({
116
137
  */
117
138
  readonly warnings: readonly NativeArtifactProblem[];
118
139
  };
140
+ /**
141
+ * Why an artifact can't register on `channel`: the sandbox layer must be whole
142
+ * or absent, and only a sandbox build registers on a `sandbox-*` channel.
143
+ */
144
+ declare const sandboxArtifactProblem: ({ kind, platform, sandbox, entry }: NativeArtifactInfo, channel: string) => NativeArtifactProblem | null;
119
145
  /**
120
146
  * Whether a read artifact can be imported as a native build, whose built-in
121
147
  * bundle OTAs patch from, and what it registers as. It refuses an artifact
@@ -142,6 +168,80 @@ declare const checkNativeArtifact: (info: NativeArtifactInfo, { updateStrategy,
142
168
  */
143
169
  declare const alreadyImportedProblem: (minBundleId: string, nativeBuildId: string | null) => NativeArtifactProblem;
144
170
  //#endregion
171
+ //#region src/nativeArtifact/iosInstall.d.ts
172
+ /**
173
+ * How an `.ipa`'s profile lets it install: on the devices it lists (`ad-hoc`,
174
+ * `development`), on any device of the team's company (`enterprise`), or only
175
+ * through a store, as an App Store export's has no device list (`store`).
176
+ */
177
+ type IpaDistribution = "ad-hoc" | "development" | "enterprise" | "store";
178
+ /** What installing an `.ipa` over the air needs to know, read from the `.ipa`. */
179
+ interface IpaInstallInfo {
180
+ /** `CFBundleIdentifier`. */
181
+ readonly bundleId: string;
182
+ /** `CFBundleVersion`. */
183
+ readonly bundleVersion: string;
184
+ /** The name an install shows: `CFBundleDisplayName`, or `CFBundleName`. */
185
+ readonly title: string;
186
+ readonly distribution: IpaDistribution;
187
+ /**
188
+ * The normalized UDIDs that every profile of the app lists, so a device
189
+ * here installs all of it. Empty for `enterprise` and `store`.
190
+ */
191
+ readonly devices: readonly string[];
192
+ /** When the first of the app's profiles expires, or null with none. */
193
+ readonly expiresAtMs: number | null;
194
+ /**
195
+ * The bundle ID of the app and of each extension with a profile of its own,
196
+ * the app's first: what signing a new `.ipa` needs a profile for.
197
+ */
198
+ readonly profileBundleIds: readonly string[];
199
+ /**
200
+ * The Apple Developer team the app's profile belongs to, its
201
+ * `TeamIdentifier`: null for an IPA with no profile.
202
+ */
203
+ readonly teamId: string | null;
204
+ }
205
+ /**
206
+ * The form two UDIDs compare in, or null for text that isn't one. Apple writes
207
+ * them in either case, and App Store Connect takes the device's own.
208
+ */
209
+ declare const normalizeIosUdid: (value: string) => string | null;
210
+ /**
211
+ * The UDID in a Profile Service answer's body, or null when it has no one
212
+ * well-formed UDID. It only finds the text: nothing here verifies the signature
213
+ * around it, so nothing automated may trust the result.
214
+ */
215
+ declare const readProfileServiceUdid: (body: Uint8Array) => string | null;
216
+ /** What a provisioning profile file says it is for and whom it lists. */
217
+ interface ProvisioningProfileInfo {
218
+ /** Its `UUID`, which Xcode names the file it saves after. */
219
+ readonly uuid: string | null;
220
+ readonly distribution: IpaDistribution;
221
+ /** The first of its `TeamIdentifier`s. */
222
+ readonly teamId: string | null;
223
+ /** Its `application-identifier` entitlement, such as `ABCDE12345.com.example.app`. */
224
+ readonly applicationIdentifier: string | null;
225
+ /** Whether Xcode made it and manages it: `IsXcodeManaged`. */
226
+ readonly xcodeManaged: boolean;
227
+ /** The normalized UDIDs it lists: empty for one that lists none. */
228
+ readonly devices: readonly string[];
229
+ readonly expiresAtMs: number | null;
230
+ }
231
+ /**
232
+ * What a provisioning profile's bytes (a `.mobileprovision`, a CMS message
233
+ * around a plist) say: the same reading an `.ipa`'s profiles get. It verifies
234
+ * no signature. Throws `NativeArtifactError` for one it can't read.
235
+ */
236
+ declare const readProvisioningProfile: (bytes: Uint8Array) => ProvisioningProfileInfo;
237
+ /**
238
+ * What an `.ipa` installs as, reading only its directory, its app's Info.plist
239
+ * and its provisioning profiles: a few requests of a remote file, whatever its
240
+ * size. The `.ipa` is untrusted, and each part is bounded before it is read.
241
+ * Throws `NativeArtifactError` for one it can't read.
242
+ */
243
+ declare const readIpaInstallInfo: (source: ByteSource) => Promise<IpaInstallInfo>;
244
+ //#endregion
145
245
  //#region src/nativeArtifact/zip.d.ts
146
246
  /** One file of a zip archive, from its central directory. */
147
247
  interface ZipEntry {
@@ -176,4 +276,120 @@ declare const openZipEntry: (source: ByteSource, entry: ZipEntry, { maxBytes }?:
176
276
  readonly maxBytes?: number;
177
277
  }) => Promise<ReadableStream<Uint8Array>>;
178
278
  //#endregion
179
- export { type ByteSource, type ImportableNativeBuild, type NativeArtifactCheck, NativeArtifactError, type NativeArtifactInfo, type NativeArtifactKind, type NativeArtifactProblem, type NativeArtifactProblemCode, type UnreadableValue, type ZipEntry, alreadyImportedProblem, blobSource, checkNativeArtifact, findZipEntry, openZipEntry, readNativeArtifact, readZipDirectory };
279
+ //#region src/nativeArtifact/sandbox.d.ts
280
+ /**
281
+ * The literal the sandbox layer's code holds, in `ios/HotUpdater/Sandbox` and
282
+ * `android/src/sandbox`: reading an artifact's strings finds it. Its length
283
+ * is its own among the lengths those reads keep.
284
+ */
285
+ declare const SANDBOX_CODE_MARKER = "HOT_UPDATER_SANDBOX_NATIVE_LAYER";
286
+ /** The Info.plist key an iOS sandbox build declares itself with. */
287
+ declare const SANDBOX_INFO_PLIST_KEY = "HOT_UPDATER_SANDBOX";
288
+ /**
289
+ * The Info.plist key that records the URL scheme an iOS sandbox build
290
+ * registers in its `SANDBOX_URL_TYPE_NAME` URL type: the build reads its own
291
+ * scheme from it, and a later patch knows which scheme is the sandbox's.
292
+ */
293
+ declare const SANDBOX_URL_SCHEME_INFO_PLIST_KEY = "HOT_UPDATER_SANDBOX_URL_SCHEME";
294
+ /**
295
+ * Whether a value is a URL scheme in lower-case ASCII, as written: what a
296
+ * build records, read before any lower-casing.
297
+ */
298
+ declare const isRecordedUrlSchemeSyntax: (value: unknown) => value is string;
299
+ /**
300
+ * The URL scheme an iOS sandbox build registers, by one rule its patch, its
301
+ * reader, and its own code apply alike. `recorded` is the Info.plist's
302
+ * `SANDBOX_URL_SCHEME_INFO_PLIST_KEY`, undefined when the key is absent, and
303
+ * `namedTypes` its URL types named `SANDBOX_URL_TYPE_NAME`.
304
+ * - Absent: a prerelease's build, which recorded none. Undefined: the caller
305
+ * reads it the way that build was read.
306
+ * - Present: a scheme in lower-case ASCII, as written, that the one URL type
307
+ * of the name holds alone. Anything else is null, with no fallback.
308
+ */
309
+ declare const recordedSandboxUrlScheme: (recorded: unknown, namedTypes: readonly unknown[]) => string | null | undefined;
310
+ /** The `<meta-data>` an Android sandbox build declares itself with. */
311
+ declare const SANDBOX_META_DATA = "com.hotupdater.SANDBOX";
312
+ /** The activity that takes an Android sandbox build's launcher entry and links. */
313
+ declare const SANDBOX_ACTIVITY = "com.hotupdater.HotUpdaterSandboxActivity";
314
+ /** The `applicationIdSuffix` an Android sandbox build appends. */
315
+ declare const SANDBOX_APPLICATION_ID_SUFFIX = ".sandbox";
316
+ /**
317
+ * The `CFBundleURLName` of the URL type an iOS sandbox build registers its URL
318
+ * scheme with, which the build reads its own scheme from.
319
+ */
320
+ declare const SANDBOX_URL_TYPE_NAME = "hot-updater-sandbox";
321
+ /**
322
+ * The `<meta-data>` of `SANDBOX_ACTIVITY` that names the URL scheme an Android
323
+ * sandbox build registers, which the build reads its own scheme from.
324
+ */
325
+ declare const SANDBOX_URL_SCHEME_META_DATA = "com.hotupdater.sandbox.URL_SCHEME";
326
+ /**
327
+ * The channel a scheme's sandbox build registers on. `sandbox-*` is reserved:
328
+ * only a sandbox build registers there, and the registry records `sandbox` on
329
+ * it.
330
+ */
331
+ declare const sandboxChannelOf: (scheme: string) => string;
332
+ /** Whether a channel is reserved for sandbox builds. */
333
+ declare const isSandboxChannel: (channel: string) => boolean;
334
+ /**
335
+ * The URL scheme a sandbox build registers when its scheme sets none, derived
336
+ * from the app's ID: the app's own scheme would ask which app to open beside
337
+ * the store app.
338
+ */
339
+ declare const sandboxUrlSchemeOf: (appId: string) => string;
340
+ /**
341
+ * Whether a URL scheme has the prefix of the derived one: how an artifact built
342
+ * before the URL scheme could be set is read, which registered no other.
343
+ */
344
+ declare const isSandboxUrlScheme: (scheme: string) => boolean;
345
+ /**
346
+ * Whether `sandbox: { urlScheme }` can name a URL scheme: lower case, a letter
347
+ * then up to 63 letters, digits, `+`, `.` or `-`, none the system or a browser
348
+ * owns, and neither `true` nor `false`, which Android's manifest can't hold as
349
+ * a string.
350
+ */
351
+ declare const isConfigurableSandboxUrlScheme: (urlScheme: string) => boolean;
352
+ /** The platform a preview link is for. */
353
+ type PreviewLinkPlatform = "ios" | "android";
354
+ /** What a preview link asks a sandbox build to run. */
355
+ interface PreviewLink {
356
+ /** The sandbox's URL scheme, in lower case. */
357
+ readonly urlScheme: string;
358
+ readonly channel: string;
359
+ /** The fingerprint the channel's bundles need; another build refuses them. */
360
+ readonly fingerprintHash: string;
361
+ /**
362
+ * The platform the link is for, absent from a link that names none: the
363
+ * other platform's sandbox build, which both can register the same scheme
364
+ * for, says which QR code to scan instead.
365
+ */
366
+ readonly platform?: PreviewLinkPlatform;
367
+ }
368
+ /**
369
+ * The link a preview QR holds. `urlScheme` is the one the sandbox build
370
+ * registered; without it, the one derived from `appId`, the scheme's
371
+ * `bundleIdentifier` or `packageName`: the ID before the Android sandbox's
372
+ * `.sandbox` suffix.
373
+ */
374
+ declare const createPreviewLink: ({ urlScheme, appId, channel, fingerprintHash, platform }: {
375
+ readonly channel: string;
376
+ readonly fingerprintHash: string;
377
+ readonly platform?: PreviewLinkPlatform;
378
+ } & ({
379
+ readonly urlScheme: string;
380
+ readonly appId?: string;
381
+ } | {
382
+ readonly urlScheme?: undefined;
383
+ readonly appId: string;
384
+ })) => string;
385
+ /**
386
+ * What a preview link says, or null for anything else: another shape, a
387
+ * repeated or missing parameter, or a channel no release can target. It takes
388
+ * any URL scheme: a sandbox build refuses a link of another scheme than its
389
+ * own. A `platform` other than `ios` or `android` reads as none. Native code
390
+ * parses it the same way before any JavaScript runs, in HotUpdaterSandboxLink,
391
+ * and shares the vectors in test-utils' `sandbox-preview-links.json`.
392
+ */
393
+ declare const parsePreviewLink: (link: string) => PreviewLink | null;
394
+ //#endregion
395
+ export { type ByteSource, type ImportableNativeBuild, type IpaDistribution, type IpaInstallInfo, type NativeArtifactCheck, NativeArtifactError, type NativeArtifactInfo, type NativeArtifactKind, type NativeArtifactProblem, type NativeArtifactProblemCode, type PreviewLink, type PreviewLinkPlatform, type ProvisioningProfileInfo, SANDBOX_ACTIVITY, SANDBOX_APPLICATION_ID_SUFFIX, SANDBOX_CODE_MARKER, SANDBOX_INFO_PLIST_KEY, SANDBOX_META_DATA, SANDBOX_URL_SCHEME_INFO_PLIST_KEY, SANDBOX_URL_SCHEME_META_DATA, SANDBOX_URL_TYPE_NAME, type UnreadableValue, type ZipEntry, alreadyImportedProblem, blobSource, checkNativeArtifact, createPreviewLink, findZipEntry, isConfigurableSandboxUrlScheme, isRecordedUrlSchemeSyntax, isSandboxChannel, isSandboxUrlScheme, normalizeIosUdid, openZipEntry, parsePreviewLink, readIpaInstallInfo, readNativeArtifact, readProfileServiceUdid, readProvisioningProfile, readZipDirectory, recordedSandboxUrlScheme, sandboxArtifactProblem, sandboxChannelOf, sandboxUrlSchemeOf };
@@ -22,7 +22,7 @@ declare class NativeArtifactError extends Error {
22
22
  * What can keep an artifact from being imported as a native build: the
23
23
  * codes `native-build import --json` reports.
24
24
  */
25
- type NativeArtifactProblemCode = "UNSUPPORTED_FILE" | "UNREADABLE" | "NO_BUILT_IN_BUNDLE" | "NO_MIN_BUNDLE_ID" | "AMBIGUOUS_MIN_BUNDLE_ID" | "NO_FINGERPRINT" | "AMBIGUOUS_FINGERPRINT" | "NO_APP_VERSION" | "INVALID_SCOPE" | "APP_ID_MISMATCH" | "ALREADY_IMPORTED";
25
+ type NativeArtifactProblemCode = "UNSUPPORTED_FILE" | "UNREADABLE" | "NO_BUILT_IN_BUNDLE" | "NO_MIN_BUNDLE_ID" | "AMBIGUOUS_MIN_BUNDLE_ID" | "NO_FINGERPRINT" | "AMBIGUOUS_FINGERPRINT" | "NO_APP_VERSION" | "INVALID_SCOPE" | "SANDBOX_MISMATCH" | "APP_ID_MISMATCH" | "ALREADY_IMPORTED";
26
26
  //#endregion
27
27
  //#region src/nativeArtifact/readNativeArtifact.d.ts
28
28
  /**
@@ -63,6 +63,23 @@ interface NativeArtifactInfo {
63
63
  * with fingerprint.json compiles its fingerprint in as one.
64
64
  */
65
65
  readonly fingerprintCandidates: readonly string[];
66
+ /**
67
+ * The sandbox layer in the artifact: `code` when the app's code holds its
68
+ * literal, and `declared` when the Info.plist or the manifest says so. A
69
+ * sandbox build has both, and a normal build neither.
70
+ */
71
+ readonly sandbox: {
72
+ readonly code: boolean;
73
+ readonly declared: boolean;
74
+ };
75
+ /**
76
+ * How the app is entered, which a sandbox build changes: its launcher
77
+ * components (empty on iOS), and the sandbox URL scheme it registers.
78
+ */
79
+ readonly entry: {
80
+ readonly launchers: readonly string[];
81
+ readonly sandboxUrlScheme: string | null;
82
+ };
66
83
  /** The JavaScript bundle the build packed, the built-in bundle. */
67
84
  readonly builtInBundle: {
68
85
  readonly path: string;
@@ -102,6 +119,10 @@ interface ImportableNativeBuild {
102
119
  readonly appVersion: string | null;
103
120
  /** The built-in bundle's entry in the archive. */
104
121
  readonly builtInBundlePath: string;
122
+ /** Whether the artifact holds the sandbox layer: a sandbox build. */
123
+ readonly sandbox: boolean;
124
+ /** The URL scheme a sandbox build registers; null for any other build. */
125
+ readonly sandboxUrlScheme: string | null;
105
126
  }
106
127
  type NativeArtifactCheck = ({
107
128
  readonly ok: true;
@@ -116,6 +137,11 @@ type NativeArtifactCheck = ({
116
137
  */
117
138
  readonly warnings: readonly NativeArtifactProblem[];
118
139
  };
140
+ /**
141
+ * Why an artifact can't register on `channel`: the sandbox layer must be whole
142
+ * or absent, and only a sandbox build registers on a `sandbox-*` channel.
143
+ */
144
+ declare const sandboxArtifactProblem: ({ kind, platform, sandbox, entry }: NativeArtifactInfo, channel: string) => NativeArtifactProblem | null;
119
145
  /**
120
146
  * Whether a read artifact can be imported as a native build, whose built-in
121
147
  * bundle OTAs patch from, and what it registers as. It refuses an artifact
@@ -142,6 +168,80 @@ declare const checkNativeArtifact: (info: NativeArtifactInfo, { updateStrategy,
142
168
  */
143
169
  declare const alreadyImportedProblem: (minBundleId: string, nativeBuildId: string | null) => NativeArtifactProblem;
144
170
  //#endregion
171
+ //#region src/nativeArtifact/iosInstall.d.ts
172
+ /**
173
+ * How an `.ipa`'s profile lets it install: on the devices it lists (`ad-hoc`,
174
+ * `development`), on any device of the team's company (`enterprise`), or only
175
+ * through a store, as an App Store export's has no device list (`store`).
176
+ */
177
+ type IpaDistribution = "ad-hoc" | "development" | "enterprise" | "store";
178
+ /** What installing an `.ipa` over the air needs to know, read from the `.ipa`. */
179
+ interface IpaInstallInfo {
180
+ /** `CFBundleIdentifier`. */
181
+ readonly bundleId: string;
182
+ /** `CFBundleVersion`. */
183
+ readonly bundleVersion: string;
184
+ /** The name an install shows: `CFBundleDisplayName`, or `CFBundleName`. */
185
+ readonly title: string;
186
+ readonly distribution: IpaDistribution;
187
+ /**
188
+ * The normalized UDIDs that every profile of the app lists, so a device
189
+ * here installs all of it. Empty for `enterprise` and `store`.
190
+ */
191
+ readonly devices: readonly string[];
192
+ /** When the first of the app's profiles expires, or null with none. */
193
+ readonly expiresAtMs: number | null;
194
+ /**
195
+ * The bundle ID of the app and of each extension with a profile of its own,
196
+ * the app's first: what signing a new `.ipa` needs a profile for.
197
+ */
198
+ readonly profileBundleIds: readonly string[];
199
+ /**
200
+ * The Apple Developer team the app's profile belongs to, its
201
+ * `TeamIdentifier`: null for an IPA with no profile.
202
+ */
203
+ readonly teamId: string | null;
204
+ }
205
+ /**
206
+ * The form two UDIDs compare in, or null for text that isn't one. Apple writes
207
+ * them in either case, and App Store Connect takes the device's own.
208
+ */
209
+ declare const normalizeIosUdid: (value: string) => string | null;
210
+ /**
211
+ * The UDID in a Profile Service answer's body, or null when it has no one
212
+ * well-formed UDID. It only finds the text: nothing here verifies the signature
213
+ * around it, so nothing automated may trust the result.
214
+ */
215
+ declare const readProfileServiceUdid: (body: Uint8Array) => string | null;
216
+ /** What a provisioning profile file says it is for and whom it lists. */
217
+ interface ProvisioningProfileInfo {
218
+ /** Its `UUID`, which Xcode names the file it saves after. */
219
+ readonly uuid: string | null;
220
+ readonly distribution: IpaDistribution;
221
+ /** The first of its `TeamIdentifier`s. */
222
+ readonly teamId: string | null;
223
+ /** Its `application-identifier` entitlement, such as `ABCDE12345.com.example.app`. */
224
+ readonly applicationIdentifier: string | null;
225
+ /** Whether Xcode made it and manages it: `IsXcodeManaged`. */
226
+ readonly xcodeManaged: boolean;
227
+ /** The normalized UDIDs it lists: empty for one that lists none. */
228
+ readonly devices: readonly string[];
229
+ readonly expiresAtMs: number | null;
230
+ }
231
+ /**
232
+ * What a provisioning profile's bytes (a `.mobileprovision`, a CMS message
233
+ * around a plist) say: the same reading an `.ipa`'s profiles get. It verifies
234
+ * no signature. Throws `NativeArtifactError` for one it can't read.
235
+ */
236
+ declare const readProvisioningProfile: (bytes: Uint8Array) => ProvisioningProfileInfo;
237
+ /**
238
+ * What an `.ipa` installs as, reading only its directory, its app's Info.plist
239
+ * and its provisioning profiles: a few requests of a remote file, whatever its
240
+ * size. The `.ipa` is untrusted, and each part is bounded before it is read.
241
+ * Throws `NativeArtifactError` for one it can't read.
242
+ */
243
+ declare const readIpaInstallInfo: (source: ByteSource) => Promise<IpaInstallInfo>;
244
+ //#endregion
145
245
  //#region src/nativeArtifact/zip.d.ts
146
246
  /** One file of a zip archive, from its central directory. */
147
247
  interface ZipEntry {
@@ -176,4 +276,120 @@ declare const openZipEntry: (source: ByteSource, entry: ZipEntry, { maxBytes }?:
176
276
  readonly maxBytes?: number;
177
277
  }) => Promise<ReadableStream<Uint8Array>>;
178
278
  //#endregion
179
- export { type ByteSource, type ImportableNativeBuild, type NativeArtifactCheck, NativeArtifactError, type NativeArtifactInfo, type NativeArtifactKind, type NativeArtifactProblem, type NativeArtifactProblemCode, type UnreadableValue, type ZipEntry, alreadyImportedProblem, blobSource, checkNativeArtifact, findZipEntry, openZipEntry, readNativeArtifact, readZipDirectory };
279
+ //#region src/nativeArtifact/sandbox.d.ts
280
+ /**
281
+ * The literal the sandbox layer's code holds, in `ios/HotUpdater/Sandbox` and
282
+ * `android/src/sandbox`: reading an artifact's strings finds it. Its length
283
+ * is its own among the lengths those reads keep.
284
+ */
285
+ declare const SANDBOX_CODE_MARKER = "HOT_UPDATER_SANDBOX_NATIVE_LAYER";
286
+ /** The Info.plist key an iOS sandbox build declares itself with. */
287
+ declare const SANDBOX_INFO_PLIST_KEY = "HOT_UPDATER_SANDBOX";
288
+ /**
289
+ * The Info.plist key that records the URL scheme an iOS sandbox build
290
+ * registers in its `SANDBOX_URL_TYPE_NAME` URL type: the build reads its own
291
+ * scheme from it, and a later patch knows which scheme is the sandbox's.
292
+ */
293
+ declare const SANDBOX_URL_SCHEME_INFO_PLIST_KEY = "HOT_UPDATER_SANDBOX_URL_SCHEME";
294
+ /**
295
+ * Whether a value is a URL scheme in lower-case ASCII, as written: what a
296
+ * build records, read before any lower-casing.
297
+ */
298
+ declare const isRecordedUrlSchemeSyntax: (value: unknown) => value is string;
299
+ /**
300
+ * The URL scheme an iOS sandbox build registers, by one rule its patch, its
301
+ * reader, and its own code apply alike. `recorded` is the Info.plist's
302
+ * `SANDBOX_URL_SCHEME_INFO_PLIST_KEY`, undefined when the key is absent, and
303
+ * `namedTypes` its URL types named `SANDBOX_URL_TYPE_NAME`.
304
+ * - Absent: a prerelease's build, which recorded none. Undefined: the caller
305
+ * reads it the way that build was read.
306
+ * - Present: a scheme in lower-case ASCII, as written, that the one URL type
307
+ * of the name holds alone. Anything else is null, with no fallback.
308
+ */
309
+ declare const recordedSandboxUrlScheme: (recorded: unknown, namedTypes: readonly unknown[]) => string | null | undefined;
310
+ /** The `<meta-data>` an Android sandbox build declares itself with. */
311
+ declare const SANDBOX_META_DATA = "com.hotupdater.SANDBOX";
312
+ /** The activity that takes an Android sandbox build's launcher entry and links. */
313
+ declare const SANDBOX_ACTIVITY = "com.hotupdater.HotUpdaterSandboxActivity";
314
+ /** The `applicationIdSuffix` an Android sandbox build appends. */
315
+ declare const SANDBOX_APPLICATION_ID_SUFFIX = ".sandbox";
316
+ /**
317
+ * The `CFBundleURLName` of the URL type an iOS sandbox build registers its URL
318
+ * scheme with, which the build reads its own scheme from.
319
+ */
320
+ declare const SANDBOX_URL_TYPE_NAME = "hot-updater-sandbox";
321
+ /**
322
+ * The `<meta-data>` of `SANDBOX_ACTIVITY` that names the URL scheme an Android
323
+ * sandbox build registers, which the build reads its own scheme from.
324
+ */
325
+ declare const SANDBOX_URL_SCHEME_META_DATA = "com.hotupdater.sandbox.URL_SCHEME";
326
+ /**
327
+ * The channel a scheme's sandbox build registers on. `sandbox-*` is reserved:
328
+ * only a sandbox build registers there, and the registry records `sandbox` on
329
+ * it.
330
+ */
331
+ declare const sandboxChannelOf: (scheme: string) => string;
332
+ /** Whether a channel is reserved for sandbox builds. */
333
+ declare const isSandboxChannel: (channel: string) => boolean;
334
+ /**
335
+ * The URL scheme a sandbox build registers when its scheme sets none, derived
336
+ * from the app's ID: the app's own scheme would ask which app to open beside
337
+ * the store app.
338
+ */
339
+ declare const sandboxUrlSchemeOf: (appId: string) => string;
340
+ /**
341
+ * Whether a URL scheme has the prefix of the derived one: how an artifact built
342
+ * before the URL scheme could be set is read, which registered no other.
343
+ */
344
+ declare const isSandboxUrlScheme: (scheme: string) => boolean;
345
+ /**
346
+ * Whether `sandbox: { urlScheme }` can name a URL scheme: lower case, a letter
347
+ * then up to 63 letters, digits, `+`, `.` or `-`, none the system or a browser
348
+ * owns, and neither `true` nor `false`, which Android's manifest can't hold as
349
+ * a string.
350
+ */
351
+ declare const isConfigurableSandboxUrlScheme: (urlScheme: string) => boolean;
352
+ /** The platform a preview link is for. */
353
+ type PreviewLinkPlatform = "ios" | "android";
354
+ /** What a preview link asks a sandbox build to run. */
355
+ interface PreviewLink {
356
+ /** The sandbox's URL scheme, in lower case. */
357
+ readonly urlScheme: string;
358
+ readonly channel: string;
359
+ /** The fingerprint the channel's bundles need; another build refuses them. */
360
+ readonly fingerprintHash: string;
361
+ /**
362
+ * The platform the link is for, absent from a link that names none: the
363
+ * other platform's sandbox build, which both can register the same scheme
364
+ * for, says which QR code to scan instead.
365
+ */
366
+ readonly platform?: PreviewLinkPlatform;
367
+ }
368
+ /**
369
+ * The link a preview QR holds. `urlScheme` is the one the sandbox build
370
+ * registered; without it, the one derived from `appId`, the scheme's
371
+ * `bundleIdentifier` or `packageName`: the ID before the Android sandbox's
372
+ * `.sandbox` suffix.
373
+ */
374
+ declare const createPreviewLink: ({ urlScheme, appId, channel, fingerprintHash, platform }: {
375
+ readonly channel: string;
376
+ readonly fingerprintHash: string;
377
+ readonly platform?: PreviewLinkPlatform;
378
+ } & ({
379
+ readonly urlScheme: string;
380
+ readonly appId?: string;
381
+ } | {
382
+ readonly urlScheme?: undefined;
383
+ readonly appId: string;
384
+ })) => string;
385
+ /**
386
+ * What a preview link says, or null for anything else: another shape, a
387
+ * repeated or missing parameter, or a channel no release can target. It takes
388
+ * any URL scheme: a sandbox build refuses a link of another scheme than its
389
+ * own. A `platform` other than `ios` or `android` reads as none. Native code
390
+ * parses it the same way before any JavaScript runs, in HotUpdaterSandboxLink,
391
+ * and shares the vectors in test-utils' `sandbox-preview-links.json`.
392
+ */
393
+ declare const parsePreviewLink: (link: string) => PreviewLink | null;
394
+ //#endregion
395
+ export { type ByteSource, type ImportableNativeBuild, type IpaDistribution, type IpaInstallInfo, type NativeArtifactCheck, NativeArtifactError, type NativeArtifactInfo, type NativeArtifactKind, type NativeArtifactProblem, type NativeArtifactProblemCode, type PreviewLink, type PreviewLinkPlatform, type ProvisioningProfileInfo, SANDBOX_ACTIVITY, SANDBOX_APPLICATION_ID_SUFFIX, SANDBOX_CODE_MARKER, SANDBOX_INFO_PLIST_KEY, SANDBOX_META_DATA, SANDBOX_URL_SCHEME_INFO_PLIST_KEY, SANDBOX_URL_SCHEME_META_DATA, SANDBOX_URL_TYPE_NAME, type UnreadableValue, type ZipEntry, alreadyImportedProblem, blobSource, checkNativeArtifact, createPreviewLink, findZipEntry, isConfigurableSandboxUrlScheme, isRecordedUrlSchemeSyntax, isSandboxChannel, isSandboxUrlScheme, normalizeIosUdid, openZipEntry, parsePreviewLink, readIpaInstallInfo, readNativeArtifact, readProfileServiceUdid, readProvisioningProfile, readZipDirectory, recordedSandboxUrlScheme, sandboxArtifactProblem, sandboxChannelOf, sandboxUrlSchemeOf };