@hot-updater/plugin-core 0.36.7 → 1.0.0-rc.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.
Files changed (161) hide show
  1. package/dist/assetStorageLayout.cjs +36 -18
  2. package/dist/assetStorageLayout.d.cts +21 -6
  3. package/dist/assetStorageLayout.d.mts +21 -6
  4. package/dist/assetStorageLayout.mjs +36 -18
  5. package/dist/bundleStorageLayout.cjs +2 -3
  6. package/dist/bundleStorageLayout.mjs +2 -3
  7. package/dist/contentAddressedAssets.cjs +5 -0
  8. package/dist/contentAddressedAssets.d.cts +2 -1
  9. package/dist/contentAddressedAssets.d.mts +2 -1
  10. package/dist/contentAddressedAssets.mjs +5 -1
  11. package/dist/createDatabasePlugin.cjs +775 -284
  12. package/dist/createDatabasePlugin.d.cts +20 -64
  13. package/dist/createDatabasePlugin.d.mts +20 -64
  14. package/dist/createDatabasePlugin.mjs +773 -284
  15. package/dist/createStorageKeyBuilder.cjs +9 -2
  16. package/dist/createStorageKeyBuilder.mjs +9 -2
  17. package/dist/createStoragePlugin.cjs +6 -145
  18. package/dist/createStoragePlugin.d.cts +7 -52
  19. package/dist/createStoragePlugin.d.mts +7 -52
  20. package/dist/createStoragePlugin.mjs +5 -143
  21. package/dist/databaseClient.cjs +112 -0
  22. package/dist/databaseClient.d.cts +33 -0
  23. package/dist/databaseClient.d.mts +33 -0
  24. package/dist/databaseClient.mjs +110 -0
  25. package/dist/databaseClientReads.cjs +113 -0
  26. package/dist/databaseClientReads.mjs +112 -0
  27. package/dist/databaseClientUpdates.cjs +39 -0
  28. package/dist/databaseClientUpdates.d.cts +11 -0
  29. package/dist/databaseClientUpdates.d.mts +11 -0
  30. package/dist/databaseClientUpdates.mjs +36 -0
  31. package/dist/databaseJsonValue.cjs +37 -0
  32. package/dist/databaseJsonValue.d.cts +5 -0
  33. package/dist/databaseJsonValue.d.mts +5 -0
  34. package/dist/databaseJsonValue.mjs +37 -0
  35. package/dist/databaseMetadata.cjs +13 -0
  36. package/dist/databaseMetadata.mjs +12 -0
  37. package/dist/databasePluginCrud.cjs +86 -0
  38. package/dist/databasePluginCrud.d.cts +1 -0
  39. package/dist/databasePluginCrud.d.mts +1 -0
  40. package/dist/databasePluginCrud.mjs +86 -0
  41. package/dist/databasePluginCrudValidation.d.cts +1 -0
  42. package/dist/databasePluginCrudValidation.d.mts +1 -0
  43. package/dist/databasePluginCrudValidationErrors.cjs +10 -0
  44. package/dist/databasePluginCrudValidationErrors.d.cts +9 -0
  45. package/dist/databasePluginCrudValidationErrors.d.mts +9 -0
  46. package/dist/databasePluginCrudValidationErrors.mjs +10 -0
  47. package/dist/databasePluginCrudValidationFields.cjs +291 -0
  48. package/dist/databasePluginCrudValidationFields.d.cts +1 -0
  49. package/dist/databasePluginCrudValidationFields.d.mts +1 -0
  50. package/dist/databasePluginCrudValidationFields.mjs +281 -0
  51. package/dist/databasePluginCrudValidationMutations.cjs +88 -0
  52. package/dist/databasePluginCrudValidationMutations.d.cts +1 -0
  53. package/dist/databasePluginCrudValidationMutations.d.mts +1 -0
  54. package/dist/databasePluginCrudValidationMutations.mjs +82 -0
  55. package/dist/databasePluginCrudValidationQueries.cjs +103 -0
  56. package/dist/databasePluginCrudValidationQueries.d.cts +1 -0
  57. package/dist/databasePluginCrudValidationQueries.d.mts +1 -0
  58. package/dist/databasePluginCrudValidationQueries.mjs +97 -0
  59. package/dist/databasePluginCrudValidationRows.cjs +55 -0
  60. package/dist/databasePluginCrudValidationRows.d.cts +1 -0
  61. package/dist/databasePluginCrudValidationRows.d.mts +1 -0
  62. package/dist/databasePluginCrudValidationRows.mjs +53 -0
  63. package/dist/databasePluginTransaction.cjs +7 -0
  64. package/dist/databasePluginTransaction.mjs +7 -0
  65. package/dist/databaseRows.cjs +149 -0
  66. package/dist/databaseRows.d.cts +34 -0
  67. package/dist/databaseRows.d.mts +34 -0
  68. package/dist/databaseRows.mjs +141 -0
  69. package/dist/index.cjs +76 -24
  70. package/dist/index.d.cts +22 -12
  71. package/dist/index.d.mts +22 -12
  72. package/dist/index.mjs +21 -14
  73. package/dist/internal.cjs +6 -0
  74. package/dist/internal.d.cts +9 -0
  75. package/dist/internal.d.mts +9 -0
  76. package/dist/internal.mjs +3 -0
  77. package/dist/node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.cjs +345 -0
  78. package/dist/node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.mjs +341 -0
  79. package/dist/paginateBundles.d.cts +6 -4
  80. package/dist/paginateBundles.d.mts +6 -4
  81. package/dist/parseStorageUri.cjs +46 -30
  82. package/dist/parseStorageUri.d.cts +20 -17
  83. package/dist/parseStorageUri.d.mts +20 -17
  84. package/dist/parseStorageUri.mjs +46 -30
  85. package/dist/queryBundles.cjs +1 -7
  86. package/dist/queryBundles.d.cts +3 -1
  87. package/dist/queryBundles.d.mts +3 -1
  88. package/dist/queryBundles.mjs +1 -7
  89. package/dist/releaseCatalogCompiler.cjs +391 -0
  90. package/dist/releaseCatalogCompiler.d.cts +55 -0
  91. package/dist/releaseCatalogCompiler.d.mts +55 -0
  92. package/dist/releaseCatalogCompiler.mjs +386 -0
  93. package/dist/releaseCatalogMutation.cjs +303 -0
  94. package/dist/releaseCatalogMutation.d.cts +86 -0
  95. package/dist/releaseCatalogMutation.d.mts +86 -0
  96. package/dist/releaseCatalogMutation.mjs +297 -0
  97. package/dist/releaseManagement.cjs +231 -0
  98. package/dist/releaseManagement.d.cts +48 -0
  99. package/dist/releaseManagement.d.mts +48 -0
  100. package/dist/releaseManagement.mjs +224 -0
  101. package/dist/remoteBundleSigning.cjs +296 -0
  102. package/dist/remoteBundleSigning.d.cts +43 -0
  103. package/dist/remoteBundleSigning.d.mts +43 -0
  104. package/dist/remoteBundleSigning.mjs +291 -0
  105. package/dist/requestBundleCache.cjs +22 -0
  106. package/dist/requestBundleCache.d.cts +9 -0
  107. package/dist/requestBundleCache.d.mts +9 -0
  108. package/dist/requestBundleCache.mjs +22 -0
  109. package/dist/semverSatisfies.cjs +3 -4
  110. package/dist/semverSatisfies.mjs +1 -1
  111. package/dist/storageDownloadPath.cjs +48 -0
  112. package/dist/storageDownloadPath.d.cts +15 -0
  113. package/dist/storageDownloadPath.d.mts +15 -0
  114. package/dist/storageDownloadPath.mjs +46 -0
  115. package/dist/types/database.d.cts +4 -0
  116. package/dist/types/database.d.mts +4 -0
  117. package/dist/types/databaseFields.cjs +92 -0
  118. package/dist/types/databaseFields.d.cts +12 -0
  119. package/dist/types/databaseFields.d.mts +12 -0
  120. package/dist/types/databaseFields.mjs +92 -0
  121. package/dist/types/databaseOperations.d.cts +173 -0
  122. package/dist/types/databaseOperations.d.mts +173 -0
  123. package/dist/types/databasePlugin.d.cts +240 -0
  124. package/dist/types/databasePlugin.d.mts +240 -0
  125. package/dist/types/databaseQuery.d.cts +47 -0
  126. package/dist/types/databaseQuery.d.mts +47 -0
  127. package/dist/types/databaseRows.d.cts +120 -0
  128. package/dist/types/databaseRows.d.mts +120 -0
  129. package/dist/types/index.d.cts +120 -162
  130. package/dist/types/index.d.mts +120 -162
  131. package/dist/types/internal.d.cts +7 -0
  132. package/dist/types/internal.d.mts +7 -0
  133. package/dist/types/public.d.cts +3 -0
  134. package/dist/types/public.d.mts +3 -0
  135. package/dist/uuidv7.cjs +9 -0
  136. package/dist/uuidv7.d.cts +4 -1
  137. package/dist/uuidv7.d.mts +4 -1
  138. package/dist/uuidv7.mjs +8 -1
  139. package/package.json +10 -5
  140. package/dist/bundleUnitOfWork.cjs +0 -158
  141. package/dist/bundleUnitOfWork.mjs +0 -158
  142. package/dist/bundleUnitOfWorkStore.cjs +0 -15
  143. package/dist/bundleUnitOfWorkStore.mjs +0 -15
  144. package/dist/createBlobDatabasePlugin.cjs +0 -382
  145. package/dist/createBlobDatabasePlugin.d.cts +0 -29
  146. package/dist/createBlobDatabasePlugin.d.mts +0 -29
  147. package/dist/createBlobDatabasePlugin.mjs +0 -381
  148. package/dist/legacyAssetStorageLayout.cjs +0 -12
  149. package/dist/legacyAssetStorageLayout.mjs +0 -12
  150. package/dist/requestUpdateBundleState.cjs +0 -26
  151. package/dist/requestUpdateBundleState.d.cts +0 -12
  152. package/dist/requestUpdateBundleState.d.mts +0 -12
  153. package/dist/requestUpdateBundleState.mjs +0 -24
  154. package/dist/resolveUpdateInfoFromBundles.cjs +0 -14
  155. package/dist/resolveUpdateInfoFromBundles.d.cts +0 -16
  156. package/dist/resolveUpdateInfoFromBundles.d.mts +0 -16
  157. package/dist/resolveUpdateInfoFromBundles.mjs +0 -13
  158. package/dist/storageProfile.cjs +0 -15
  159. package/dist/storageProfile.d.cts +0 -9
  160. package/dist/storageProfile.d.mts +0 -9
  161. package/dist/storageProfile.mjs +0 -12
@@ -1,5 +1,8 @@
1
+ import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
2
+ import { AnalyticsModel, AnalyticsScanCursor, AnalyticsScanInput, ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, ReleaseCatalogModel, ReleaseModel } from "./databasePlugin.cjs";
3
+ import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
1
4
  import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./utils.cjs";
2
- import { AppVersionGetBundlesArgs, Bundle, Bundle as Bundle$1, FingerprintGetBundlesArgs, GetBundlesArgs, GetBundlesArgs as GetBundlesArgs$1, Platform, Platform as Platform$1, UpdateInfo, UpdateInfo as UpdateInfo$1 } from "@hot-updater/core";
5
+ import { Bundle, Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/core";
3
6
 
4
7
  //#region src/types/index.d.ts
5
8
  interface BasePluginArgs {
@@ -28,65 +31,53 @@ interface DatabaseBundleIdFilter {
28
31
  in?: string[];
29
32
  }
30
33
  interface DatabaseBundleQueryWhere {
31
- channel?: string;
32
34
  platform?: Platform;
33
- enabled?: boolean;
34
35
  id?: DatabaseBundleIdFilter;
35
- targetAppVersion?: string | null;
36
- targetAppVersionIn?: string[];
37
- targetAppVersionNotNull?: boolean;
38
- fingerprintHash?: string | null;
39
36
  }
40
37
  interface DatabaseBundleQueryOrder {
41
38
  field: "id";
42
39
  direction: "asc" | "desc";
43
40
  }
44
- interface DatabaseBundleCursor {
41
+ type DatabaseBundleCursor = {
45
42
  /**
46
43
  * Fetch the next window after this bundle ID.
47
44
  *
48
45
  * This is the preferred pagination mode for bundle-management queries.
49
46
  */
50
- after?: string;
47
+ after: string;
48
+ before?: never;
49
+ } | {
50
+ after?: never;
51
51
  /**
52
52
  * Fetch the previous window before this bundle ID.
53
53
  *
54
54
  * This is the preferred pagination mode for bundle-management queries.
55
55
  */
56
- before?: string;
57
- }
58
- interface DatabaseBundleQueryOptions {
59
- where?: DatabaseBundleQueryWhere;
60
- limit: number;
56
+ before: string;
57
+ };
58
+ type DatabaseBundlePaginationOptions = {
61
59
  /**
62
- * Optional page number used by management UIs to keep page boundaries stable
63
- * even when new bundles are inserted ahead of the current cursor window.
60
+ * Optional page number used by management UIs to keep page boundaries
61
+ * stable even when new bundles are inserted ahead of the current cursor
62
+ * window.
64
63
  */
65
64
  page?: number;
65
+ cursor?: never;
66
+ } | {
67
+ page?: never;
66
68
  /**
67
69
  * Preferred cursor-based pagination for bundle-management queries.
68
70
  */
69
71
  cursor?: DatabaseBundleCursor;
72
+ };
73
+ type DatabaseBundleQueryOptions = {
74
+ where?: DatabaseBundleQueryWhere;
75
+ limit: number;
70
76
  orderBy?: DatabaseBundleQueryOrder;
71
- }
77
+ } & DatabaseBundlePaginationOptions;
72
78
  interface BuildPluginConfig {
73
79
  outDir?: string;
74
80
  }
75
- interface DatabasePlugin<TContext = unknown> {
76
- getChannels: (context?: HotUpdaterContext<TContext>) => Promise<string[]>;
77
- getBundleById: (bundleId: string, context?: HotUpdaterContext<TContext>) => Promise<Bundle | null>;
78
- getUpdateInfo?: (args: GetBundlesArgs, context?: HotUpdaterContext<TContext>) => Promise<UpdateInfo | null>;
79
- getBundles: (options: DatabaseBundleQueryOptions, context?: HotUpdaterContext<TContext>) => Promise<Paginated<Bundle[]>>;
80
- updateBundle: (targetBundleId: string, newBundle: Partial<Bundle>, context?: HotUpdaterContext<TContext>) => Promise<void>;
81
- appendBundle: (insertBundle: Bundle, context?: HotUpdaterContext<TContext>) => Promise<void>;
82
- commitBundle: (context?: HotUpdaterContext<TContext>) => Promise<void>;
83
- onUnmount?: () => Promise<void>;
84
- name: string;
85
- deleteBundle: (deleteBundle: Bundle, context?: HotUpdaterContext<TContext>) => Promise<void>;
86
- }
87
- interface DatabasePluginHooks {
88
- onDatabaseUpdated?: () => Promise<void>;
89
- }
90
81
  interface BuildPlugin {
91
82
  nativeBuild?: {
92
83
  prebuild?: (args: {
@@ -239,16 +230,6 @@ interface PlatformConfig {
239
230
  * @example ["android/app/src/main/AndroidManifest.xml"]
240
231
  */
241
232
  androidManifestPaths?: string[];
242
- /**
243
- * Android string resource paths.
244
- *
245
- * @deprecated Android Hot Updater config is stored in AndroidManifest.xml.
246
- * This remains supported as a legacy read fallback.
247
- *
248
- * @default all strings.xml files in the android directory
249
- * @example ["android/app/src/main/res/values/strings.xml"]
250
- */
251
- stringResourcePaths?: string[];
252
233
  };
253
234
  /**
254
235
  * iOS platform configuration.
@@ -273,125 +254,115 @@ interface NativeBuildArgs {
273
254
  */
274
255
  ios?: Record<string, NativeBuildIosScheme>;
275
256
  }
276
- interface RequestEnvContext<TEnv = unknown> {
277
- request?: Request;
278
- env?: TEnv;
257
+ interface StoragePutInput {
258
+ /** Complete object key below the provider's configured base path. */
259
+ readonly key: string;
260
+ readonly body: ReadableStream<Uint8Array>;
261
+ readonly contentLength?: number;
262
+ readonly contentType: string;
279
263
  }
280
- type HotUpdaterContext<TContext = unknown> = TContext;
281
- type StorageResolveContext<TContext = unknown> = HotUpdaterContext<TContext>;
282
- interface StorageObject {
283
- /** Object key relative to the storage plugin's configured base path. */
284
- key: string;
285
- storageUri: string;
286
- size: number;
287
- lastModifiedAt?: Date;
264
+ interface StoragePutResult {
265
+ readonly storageUri: string;
288
266
  }
289
- interface NodeStorageProfile {
290
- upload: (key: string, filePath: string) => Promise<{
291
- storageUri: string;
292
- }>;
293
- /**
294
- * Returns true when the object can be safely reused by deploy without
295
- * uploading it again. Providers may validate more than physical existence
296
- * when runtime access needs an additional readiness check.
297
- */
298
- exists: (storageUri: string) => Promise<boolean>;
299
- delete: (storageUri: string) => Promise<void>;
300
- downloadFile: (storageUri: string, filePath: string) => Promise<void>;
301
- /**
302
- * Optional management capabilities used by storage garbage collection.
303
- * Object keys are relative to the configured storage base path.
304
- * `deleteObjects` must delete only the exact keys it receives.
305
- */
306
- listObjects?: (prefix?: string) => Promise<StorageObject[]>;
307
- deleteObjects?: (keys: readonly string[]) => Promise<void>;
267
+ interface StorageGetInput {
268
+ readonly storageUri: string;
308
269
  }
309
- interface RuntimeStorageProfile<TContext = unknown> {
310
- getDownloadUrl: (storageUri: string, context?: StorageResolveContext<TContext>) => Promise<{
311
- fileUrl: string;
312
- }>;
313
- readText: (storageUri: string, context?: StorageResolveContext<TContext>) => Promise<string | null>;
270
+ interface StorageGetResult {
271
+ readonly response: Response | null;
314
272
  }
315
- interface StoragePluginProfiles<TContext = unknown> {
316
- /**
317
- * Node/deploy/console profile.
318
- *
319
- * Use this profile when the caller can materialize storage objects to the
320
- * local filesystem.
321
- */
322
- node?: NodeStorageProfile;
323
- /**
324
- * Runtime update-check profile.
325
- *
326
- * Use this profile when the caller needs signed/public client URLs and direct
327
- * server-side reads for small control-plane text objects such as manifests.
328
- */
329
- runtime?: RuntimeStorageProfile<TContext>;
273
+ interface StorageExistsInput {
274
+ readonly storageUri: string;
330
275
  }
331
- interface StoragePlugin<TContext = unknown> {
332
- /**
333
- * Protocol this storage plugin can resolve.
334
- * @example "s3", "r2", "supabase-storage".
335
- */
336
- supportedProtocol: string;
337
- name: string;
338
- profiles: StoragePluginProfiles<TContext>;
276
+ interface StorageExistsResult {
277
+ readonly exists: boolean;
339
278
  }
340
- interface NodeStoragePlugin<TContext = unknown> extends StoragePlugin<TContext> {
341
- profiles: {
342
- node: NodeStorageProfile;
343
- runtime?: RuntimeStorageProfile<TContext>;
344
- };
279
+ interface StorageDeleteInput {
280
+ readonly storageUri: string;
345
281
  }
346
- interface RuntimeStoragePlugin<TContext = unknown> extends StoragePlugin<TContext> {
347
- profiles: {
348
- node?: NodeStorageProfile;
349
- runtime: RuntimeStorageProfile<TContext>;
350
- };
282
+ interface StorageDeleteResult {
283
+ readonly deleted: true;
351
284
  }
352
- interface UniversalStoragePlugin<TContext = unknown> extends StoragePlugin<TContext> {
353
- profiles: {
354
- node: NodeStorageProfile;
355
- runtime: RuntimeStorageProfile<TContext>;
356
- };
285
+ interface StorageObject {
286
+ /** Object key relative to the storage plugin's configured base path. */
287
+ readonly key: string;
288
+ readonly storageUri: string;
289
+ readonly size: number;
290
+ readonly lastModifiedAt?: Date;
357
291
  }
358
- interface StoragePluginHooks {
359
- onStorageUploaded?: () => Promise<void>;
292
+ interface StorageGetDownloadUrlInput {
293
+ readonly storageUri: string;
294
+ }
295
+ interface StorageGetDownloadUrlResult {
296
+ readonly url: string;
360
297
  }
361
298
  /**
362
- * Signing configuration type with conditional required fields.
363
- * When enabled is true, privateKeyPath is required.
364
- * When enabled is false, privateKeyPath is optional.
299
+ * Runtime-independent object storage contract.
300
+ *
301
+ * `storageUri` values are hierarchical identifiers in the form
302
+ * `protocol://bucket/slash-separated-encoded-key`.
303
+ *
304
+ * SDK clients, platform bindings, credentials, and local file I/O belong to
305
+ * provider implementations and consumers, never to this interface.
365
306
  */
366
- type SigningConfig = {
367
- /**
368
- * Enable bundle signing during deployment.
369
- * When false, signing is disabled and privateKeyPath is optional.
370
- */
371
- enabled: false;
372
- /**
373
- * Path to RSA private key file in PEM format (PKCS#8).
374
- * Optional when signing is disabled.
375
- */
376
- privateKeyPath?: string;
377
- } | {
307
+ interface StoragePlugin {
308
+ readonly name: string;
378
309
  /**
379
- * Enable bundle signing during deployment.
380
- * When true, bundles will be signed with privateKeyPath.
310
+ * Protocol this plugin resolves and stores in database storage URIs.
311
+ * @example "s3", "r2", "supabase-storage".
381
312
  */
382
- enabled: true;
313
+ readonly protocol: string;
314
+ readonly put?: (input: StoragePutInput) => Promise<StoragePutResult>;
315
+ readonly get?: (input: StorageGetInput) => Promise<StorageGetResult>;
316
+ /** Resolves the URL an update client uses to download the object. */
317
+ readonly getDownloadUrl?: (input: StorageGetDownloadUrlInput) => Promise<StorageGetDownloadUrlResult>;
318
+ /**
319
+ * Returns true when an object can be safely reused by deploy. Providers may
320
+ * validate more than physical existence when download readiness is required.
321
+ */
322
+ readonly exists?: (input: StorageExistsInput) => Promise<StorageExistsResult>;
323
+ /** Deletes exactly the object referenced by `storageUri`. */
324
+ readonly delete?: (input: StorageDeleteInput) => Promise<StorageDeleteResult>;
325
+ /** Lists objects below the optional base-path-relative prefix. */
326
+ readonly listObjects?: (prefix?: string) => Promise<StorageObject[]>;
327
+ /** Deletes only the exact base-path-relative keys supplied by the caller. */
328
+ readonly deleteObjects?: (keys: readonly string[]) => Promise<void>;
329
+ }
330
+ interface BundleSigningPlugin {
331
+ readonly name: string;
332
+ /** Path to the pinned RSA public key embedded in native builds. */
333
+ readonly publicKeyPath: string;
334
+ /** Returns the RSA public key used by this provider in SPKI PEM format. */
335
+ readonly getPublicKey: (input?: {
336
+ readonly cwd?: string;
337
+ }) => Promise<{
338
+ readonly publicKey: string;
339
+ }>;
383
340
  /**
384
- * Path to RSA private key file in PEM format (PKCS#8).
385
- * Generate with: npx hot-updater keys:generate
341
+ * Signs `message` with RSA PKCS#1 v1.5 SHA-256.
386
342
  *
387
- * Security: Never commit this key to version control!
388
- * Use secure storage (AWS Secrets Manager, etc.) for CI/CD.
389
- *
390
- * @example "./keys/private-key.pem"
391
- * @example "/secure/path/to/private-key.pem"
343
+ * Hot Updater passes the 32 raw bytes decoded from a SHA-256 file hash.
344
+ * Remote signing services must treat this value as the raw message, not as
345
+ * an already-computed digest.
392
346
  */
393
- privateKeyPath: string;
394
- };
347
+ readonly sign: (input: {
348
+ readonly message: Uint8Array;
349
+ readonly cwd?: string;
350
+ }) => Promise<{
351
+ readonly signature: Uint8Array;
352
+ }>;
353
+ }
354
+ /** Built-in local PEM signing, compatible with the v0 configuration. */
355
+ type LocalSigningConfig = {
356
+ /** Optional pinned RSA SPKI public key. Also enables public-key-only builds. */readonly publicKeyPath?: string;
357
+ } & ({
358
+ readonly enabled: true; /** Path to an RSA private key in PEM format. */
359
+ readonly privateKeyPath: string;
360
+ } | {
361
+ readonly enabled: false;
362
+ readonly privateKeyPath?: string;
363
+ });
364
+ /** Local config or signing plugin. Signing is disabled when omitted. */
365
+ type SigningConfig = BundleSigningPlugin | LocalSigningConfig;
395
366
  /**
396
367
  * Extra fingerprint sources.
397
368
  *
@@ -411,13 +382,6 @@ type ConfigInput = {
411
382
  * @default "node_modules/.hot-updater"
412
383
  */
413
384
  cacheDir?: string | null;
414
- /**
415
- * The channel used when building the native app.
416
- * Used to replace __HOT_UPDATER_CHANNEL at build time.
417
- *
418
- * @deprecated Use the `hot-updater channel create` command to create a channel.
419
- */
420
- releaseChannel?: string;
421
385
  /**
422
386
  * The strategy used to update the app.
423
387
  *
@@ -507,26 +471,20 @@ type ConfigInput = {
507
471
  * Code signing configuration for bundle verification.
508
472
  * Enables RSA-SHA256 cryptographic signatures for bundle integrity.
509
473
  *
510
- * @optional Feature is opt-in for backward compatibility
474
+ * @optional Feature is opt-in.
511
475
  *
512
476
  * @example
513
477
  * ```ts
514
- * // Signing enabled - privateKeyPath is required
515
478
  * signing: {
516
479
  * enabled: true,
517
- * privateKeyPath: './keys/private-key.pem'
518
- * }
519
- *
520
- * // Signing disabled - privateKeyPath is optional
521
- * signing: {
522
- * enabled: false
480
+ * privateKeyPath: './keys/private-key.pem',
523
481
  * }
524
482
  * ```
525
483
  */
526
484
  signing?: SigningConfig;
527
485
  build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
528
- storage: () => Promise<NodeStoragePlugin> | NodeStoragePlugin;
529
- database: () => Promise<DatabasePlugin> | DatabasePlugin;
486
+ storage: StoragePlugin;
487
+ database: BundleRepository;
530
488
  };
531
489
  interface NativeBuildOptions {
532
490
  outputPath?: string;
@@ -535,4 +493,4 @@ interface NativeBuildOptions {
535
493
  scheme?: string;
536
494
  }
537
495
  //#endregion
538
- export { type AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, type FingerprintGetBundlesArgs, type GetBundlesArgs$1 as GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StorageObject, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, type UpdateInfo$1 as UpdateInfo, supportedIosPlatforms };
496
+ export { ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, BundleSigningPlugin, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, FingerprintExtraSources, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, SigningConfig, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePlugin, StoragePutInput, StoragePutResult, supportedIosPlatforms };