@hot-updater/core 0.12.7 → 0.13.1

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 (2) hide show
  1. package/dist/types.d.ts +49 -7
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -20,10 +20,6 @@ export interface Bundle {
20
20
  * Whether the bundle is enabled.
21
21
  */
22
22
  enabled: boolean;
23
- /**
24
- * The file URL of the bundle.
25
- */
26
- fileUrl: string;
27
23
  /**
28
24
  * The hash of the bundle.
29
25
  */
@@ -36,24 +32,70 @@ export interface Bundle {
36
32
  * The message of the bundle.
37
33
  */
38
34
  message: string | null;
35
+ /**
36
+ * The name of the channel where the bundle is deployed.
37
+ *
38
+ * Examples:
39
+ * - production: Production channel for end users
40
+ * - development: Development channel for testing
41
+ * - staging: Staging channel for quality assurance before production
42
+ * - app-name: Channel for specific app instances (e.g., my-app, app-test)
43
+ *
44
+ * Different channel values can be used based on each app's requirements.
45
+ */
46
+ channel: string;
39
47
  }
40
48
  type SnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${Lowercase<T>}${SnakeCase<U>}` : S;
41
49
  type SnakeKeyObject<T> = T extends Record<string, any> ? {
42
50
  [K in keyof T as SnakeCase<Extract<K, string>>]: T[K] extends object ? SnakeKeyObject<T[K]> : T[K];
43
51
  } : T;
44
52
  export type SnakeCaseBundle = SnakeKeyObject<Bundle>;
45
- export type BundleArg = string | Bundle[] | (() => Promise<Bundle[]>) | (() => Bundle[]);
46
53
  export type UpdateStatus = "ROLLBACK" | "UPDATE";
54
+ /**
55
+ * The update info for the database layer.
56
+ * This is the update info that is used by the database.
57
+ */
47
58
  export interface UpdateInfo {
48
59
  id: string;
49
60
  shouldForceUpdate: boolean;
50
- fileUrl: string | null;
51
- fileHash: string | null;
61
+ message: string | null;
52
62
  status: UpdateStatus;
53
63
  }
64
+ /**
65
+ * The update info for the app layer.
66
+ * This is the update info that is used by the app.
67
+ */
68
+ export interface AppUpdateInfo extends UpdateInfo {
69
+ fileUrl: string | null;
70
+ }
54
71
  export interface GetBundlesArgs {
55
72
  platform: Platform;
73
+ /**
74
+ * The current bundle id of the app.
75
+ */
56
76
  bundleId: string;
77
+ /**
78
+ * The current app version.
79
+ */
57
80
  appVersion: string;
81
+ /**
82
+ * Minimum bundle id that should be used.
83
+ * This value is generated at build time via getMinBundleId().
84
+ *
85
+ * @default "00000000-0000-0000-0000-000000000000"
86
+ */
87
+ minBundleId?: string;
88
+ /**
89
+ * The name of the channel where the bundle is deployed.
90
+ *
91
+ * @default "production"
92
+ *
93
+ * Examples:
94
+ * - production: Production channel for end users
95
+ * - development: Development channel for testing
96
+ * - staging: Staging channel for quality assurance before production
97
+ * - app-name: Channel for specific app instances (e.g., my-app, app-test)
98
+ */
99
+ channel?: string;
58
100
  }
59
101
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/core",
3
- "version": "0.12.7",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,