@hot-updater/core 0.29.1 → 0.29.3

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/dist/types.d.cts DELETED
@@ -1,207 +0,0 @@
1
- //#region src/types.d.ts
2
- type Platform = "ios" | "android";
3
- type BundleMetadata = {
4
- app_version?: string;
5
- };
6
- interface Bundle {
7
- /**
8
- * The unique identifier for the bundle. uuidv7
9
- */
10
- id: string;
11
- /**
12
- * The platform the bundle is for.
13
- */
14
- platform: Platform;
15
- /**
16
- * Whether the bundle should force an update.
17
- */
18
- shouldForceUpdate: boolean;
19
- /**
20
- * Whether the bundle is enabled.
21
- */
22
- enabled: boolean;
23
- /**
24
- * The hash of the bundle.
25
- */
26
- fileHash: string;
27
- /**
28
- * The storage key of the bundle.
29
- * @example "s3://my-bucket/my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
30
- * @example "r2://my-bucket/my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
31
- * @example "firebase-storage://my-bucket/my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
32
- * @example "storage://my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
33
- */
34
- storageUri: string;
35
- /**
36
- * The git commit hash of the bundle.
37
- */
38
- gitCommitHash: string | null;
39
- /**
40
- * The message of the bundle.
41
- */
42
- message: string | null;
43
- /**
44
- * The name of the channel where the bundle is deployed.
45
- *
46
- * Examples:
47
- * - production: Production channel for end users
48
- * - development: Development channel for testing
49
- * - staging: Staging channel for quality assurance before production
50
- * - app-name: Channel for specific app instances (e.g., my-app, app-test)
51
- *
52
- * Different channel values can be used based on each app's requirements.
53
- */
54
- channel: string;
55
- /**
56
- * The target app version of the bundle.
57
- */
58
- targetAppVersion: string | null;
59
- /**
60
- * The fingerprint hash of the bundle.
61
- */
62
- fingerprintHash: string | null;
63
- /**
64
- * The metadata of the bundle.
65
- */
66
- metadata?: BundleMetadata;
67
- /**
68
- * Rollout cohort count (0-1000). Controls gradual rollout to numeric cohorts.
69
- * - 0: No cohorts receive this update
70
- * - 250: 25.0% of numeric cohorts receive this update
71
- * - 1000 or null: All numeric cohorts receive this update (full rollout)
72
- *
73
- * @default 1000
74
- */
75
- rolloutCohortCount?: number | null;
76
- /**
77
- * Target specific cohorts for this update.
78
- * If provided, only these cohorts will receive the update.
79
- * If empty/null, rolloutCohortCount-based rollout is used.
80
- *
81
- * NOTE: This field is stored in database but should NOT be returned to
82
- * update-check clients for security reasons. Server uses it for rollout
83
- * decisions only.
84
- */
85
- targetCohorts?: string[] | null;
86
- }
87
- type SnakeCase<S extends string> = S extends `${infer T}${infer U}` ? T extends "_" ? `_${SnakeCase<U>}` : T extends "-" ? `-${SnakeCase<U>}` : T extends Lowercase<T> ? `${T}${SnakeCase<U>}` : `_${Lowercase<T>}${SnakeCase<U>}` : S;
88
- type SnakeKeyObject<T> = T extends readonly (infer U)[] ? SnakeKeyObject<U>[] : T extends Record<string, any> ? { [K in keyof T as SnakeCase<Extract<K, string>>]: SnakeKeyObject<T[K]> } : T;
89
- type SnakeCaseBundle = SnakeKeyObject<Bundle>;
90
- type UpdateStatus = "ROLLBACK" | "UPDATE";
91
- /**
92
- * The update info for the database layer.
93
- * This is the update info that is used by the database.
94
- */
95
- interface UpdateInfo {
96
- id: string;
97
- shouldForceUpdate: boolean;
98
- message: string | null;
99
- status: UpdateStatus;
100
- storageUri: string | null;
101
- fileHash: string | null;
102
- /**
103
- * Rollout cohort count (0-1000). Controls gradual rollout to numeric cohorts.
104
- */
105
- rolloutCohortCount?: number | null;
106
- /**
107
- * Target specific cohorts for this update.
108
- * Used internally for rollout decisions.
109
- */
110
- targetCohorts?: string[] | null;
111
- }
112
- /**
113
- * The update info for the app layer.
114
- * This is the update info that is used by the app.
115
- */
116
- interface AppUpdateInfo extends Omit<UpdateInfo, "storageUri"> {
117
- fileUrl: string | null;
118
- /**
119
- * SHA256 hash of the bundle file, optionally with embedded signature.
120
- * Format when signed: "sig:<base64_signature>"
121
- * Format when unsigned: "<hex_hash>" (64-character lowercase hex)
122
- * The client parses this to extract signature for native verification.
123
- */
124
- fileHash: string | null;
125
- }
126
- type UpdateStrategy = "fingerprint" | "appVersion";
127
- type FingerprintGetBundlesArgs = {
128
- _updateStrategy: "fingerprint";
129
- platform: Platform;
130
- /**
131
- * The current bundle id of the app.
132
- */
133
- bundleId: string;
134
- /**
135
- * Minimum bundle id that should be used.
136
- * This value is generated at build time via getMinBundleId().
137
- *
138
- * @default "00000000-0000-0000-0000-000000000000"
139
- */
140
- minBundleId?: string;
141
- /**
142
- * The name of the channel where the bundle is deployed.
143
- *
144
- * @default "production"
145
- *
146
- * Examples:
147
- * - production: Production channel for end users
148
- * - development: Development channel for testing
149
- * - staging: Staging channel for quality assurance before production
150
- * - app-name: Channel for specific app instances (e.g., my-app, app-test)
151
- */
152
- channel?: string;
153
- /**
154
- * Cohort identifier used for server-side rollout decisions.
155
- */
156
- cohort?: string;
157
- /**
158
- * The fingerprint hash of the bundle.
159
- */
160
- fingerprintHash: string;
161
- };
162
- type AppVersionGetBundlesArgs = {
163
- _updateStrategy: "appVersion";
164
- platform: Platform;
165
- /**
166
- * The current bundle id of the app.
167
- */
168
- bundleId: string;
169
- /**
170
- * Minimum bundle id that should be used.
171
- * This value is generated at build time via getMinBundleId().
172
- *
173
- * @default "00000000-0000-0000-0000-000000000000"
174
- */
175
- minBundleId?: string;
176
- /**
177
- * The name of the channel where the bundle is deployed.
178
- *
179
- * @default "production"
180
- *
181
- * Examples:
182
- * - production: Production channel for end users
183
- * - development: Development channel for testing
184
- * - staging: Staging channel for quality assurance before production
185
- * - app-name: Channel for specific app instances (e.g., my-app, app-test)
186
- */
187
- channel?: string;
188
- /**
189
- * Cohort identifier used for server-side rollout decisions.
190
- */
191
- cohort?: string;
192
- /**
193
- * The current app version.
194
- */
195
- appVersion: string;
196
- };
197
- type GetBundlesArgs = FingerprintGetBundlesArgs | AppVersionGetBundlesArgs;
198
- type UpdateBundleParams = {
199
- platform: Platform;
200
- bundleId: string;
201
- minBundleId: string;
202
- channel: string;
203
- appVersion: string;
204
- fingerprintHash: string | null;
205
- };
206
- //#endregion
207
- export { AppUpdateInfo, AppVersionGetBundlesArgs, Bundle, BundleMetadata, FingerprintGetBundlesArgs, GetBundlesArgs, Platform, SnakeCaseBundle, UpdateBundleParams, UpdateInfo, UpdateStatus, UpdateStrategy };
package/dist/types.d.mts DELETED
@@ -1,207 +0,0 @@
1
- //#region src/types.d.ts
2
- type Platform = "ios" | "android";
3
- type BundleMetadata = {
4
- app_version?: string;
5
- };
6
- interface Bundle {
7
- /**
8
- * The unique identifier for the bundle. uuidv7
9
- */
10
- id: string;
11
- /**
12
- * The platform the bundle is for.
13
- */
14
- platform: Platform;
15
- /**
16
- * Whether the bundle should force an update.
17
- */
18
- shouldForceUpdate: boolean;
19
- /**
20
- * Whether the bundle is enabled.
21
- */
22
- enabled: boolean;
23
- /**
24
- * The hash of the bundle.
25
- */
26
- fileHash: string;
27
- /**
28
- * The storage key of the bundle.
29
- * @example "s3://my-bucket/my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
30
- * @example "r2://my-bucket/my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
31
- * @example "firebase-storage://my-bucket/my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
32
- * @example "storage://my-app/00000000-0000-0000-0000-000000000000/bundle.zip"
33
- */
34
- storageUri: string;
35
- /**
36
- * The git commit hash of the bundle.
37
- */
38
- gitCommitHash: string | null;
39
- /**
40
- * The message of the bundle.
41
- */
42
- message: string | null;
43
- /**
44
- * The name of the channel where the bundle is deployed.
45
- *
46
- * Examples:
47
- * - production: Production channel for end users
48
- * - development: Development channel for testing
49
- * - staging: Staging channel for quality assurance before production
50
- * - app-name: Channel for specific app instances (e.g., my-app, app-test)
51
- *
52
- * Different channel values can be used based on each app's requirements.
53
- */
54
- channel: string;
55
- /**
56
- * The target app version of the bundle.
57
- */
58
- targetAppVersion: string | null;
59
- /**
60
- * The fingerprint hash of the bundle.
61
- */
62
- fingerprintHash: string | null;
63
- /**
64
- * The metadata of the bundle.
65
- */
66
- metadata?: BundleMetadata;
67
- /**
68
- * Rollout cohort count (0-1000). Controls gradual rollout to numeric cohorts.
69
- * - 0: No cohorts receive this update
70
- * - 250: 25.0% of numeric cohorts receive this update
71
- * - 1000 or null: All numeric cohorts receive this update (full rollout)
72
- *
73
- * @default 1000
74
- */
75
- rolloutCohortCount?: number | null;
76
- /**
77
- * Target specific cohorts for this update.
78
- * If provided, only these cohorts will receive the update.
79
- * If empty/null, rolloutCohortCount-based rollout is used.
80
- *
81
- * NOTE: This field is stored in database but should NOT be returned to
82
- * update-check clients for security reasons. Server uses it for rollout
83
- * decisions only.
84
- */
85
- targetCohorts?: string[] | null;
86
- }
87
- type SnakeCase<S extends string> = S extends `${infer T}${infer U}` ? T extends "_" ? `_${SnakeCase<U>}` : T extends "-" ? `-${SnakeCase<U>}` : T extends Lowercase<T> ? `${T}${SnakeCase<U>}` : `_${Lowercase<T>}${SnakeCase<U>}` : S;
88
- type SnakeKeyObject<T> = T extends readonly (infer U)[] ? SnakeKeyObject<U>[] : T extends Record<string, any> ? { [K in keyof T as SnakeCase<Extract<K, string>>]: SnakeKeyObject<T[K]> } : T;
89
- type SnakeCaseBundle = SnakeKeyObject<Bundle>;
90
- type UpdateStatus = "ROLLBACK" | "UPDATE";
91
- /**
92
- * The update info for the database layer.
93
- * This is the update info that is used by the database.
94
- */
95
- interface UpdateInfo {
96
- id: string;
97
- shouldForceUpdate: boolean;
98
- message: string | null;
99
- status: UpdateStatus;
100
- storageUri: string | null;
101
- fileHash: string | null;
102
- /**
103
- * Rollout cohort count (0-1000). Controls gradual rollout to numeric cohorts.
104
- */
105
- rolloutCohortCount?: number | null;
106
- /**
107
- * Target specific cohorts for this update.
108
- * Used internally for rollout decisions.
109
- */
110
- targetCohorts?: string[] | null;
111
- }
112
- /**
113
- * The update info for the app layer.
114
- * This is the update info that is used by the app.
115
- */
116
- interface AppUpdateInfo extends Omit<UpdateInfo, "storageUri"> {
117
- fileUrl: string | null;
118
- /**
119
- * SHA256 hash of the bundle file, optionally with embedded signature.
120
- * Format when signed: "sig:<base64_signature>"
121
- * Format when unsigned: "<hex_hash>" (64-character lowercase hex)
122
- * The client parses this to extract signature for native verification.
123
- */
124
- fileHash: string | null;
125
- }
126
- type UpdateStrategy = "fingerprint" | "appVersion";
127
- type FingerprintGetBundlesArgs = {
128
- _updateStrategy: "fingerprint";
129
- platform: Platform;
130
- /**
131
- * The current bundle id of the app.
132
- */
133
- bundleId: string;
134
- /**
135
- * Minimum bundle id that should be used.
136
- * This value is generated at build time via getMinBundleId().
137
- *
138
- * @default "00000000-0000-0000-0000-000000000000"
139
- */
140
- minBundleId?: string;
141
- /**
142
- * The name of the channel where the bundle is deployed.
143
- *
144
- * @default "production"
145
- *
146
- * Examples:
147
- * - production: Production channel for end users
148
- * - development: Development channel for testing
149
- * - staging: Staging channel for quality assurance before production
150
- * - app-name: Channel for specific app instances (e.g., my-app, app-test)
151
- */
152
- channel?: string;
153
- /**
154
- * Cohort identifier used for server-side rollout decisions.
155
- */
156
- cohort?: string;
157
- /**
158
- * The fingerprint hash of the bundle.
159
- */
160
- fingerprintHash: string;
161
- };
162
- type AppVersionGetBundlesArgs = {
163
- _updateStrategy: "appVersion";
164
- platform: Platform;
165
- /**
166
- * The current bundle id of the app.
167
- */
168
- bundleId: string;
169
- /**
170
- * Minimum bundle id that should be used.
171
- * This value is generated at build time via getMinBundleId().
172
- *
173
- * @default "00000000-0000-0000-0000-000000000000"
174
- */
175
- minBundleId?: string;
176
- /**
177
- * The name of the channel where the bundle is deployed.
178
- *
179
- * @default "production"
180
- *
181
- * Examples:
182
- * - production: Production channel for end users
183
- * - development: Development channel for testing
184
- * - staging: Staging channel for quality assurance before production
185
- * - app-name: Channel for specific app instances (e.g., my-app, app-test)
186
- */
187
- channel?: string;
188
- /**
189
- * Cohort identifier used for server-side rollout decisions.
190
- */
191
- cohort?: string;
192
- /**
193
- * The current app version.
194
- */
195
- appVersion: string;
196
- };
197
- type GetBundlesArgs = FingerprintGetBundlesArgs | AppVersionGetBundlesArgs;
198
- type UpdateBundleParams = {
199
- platform: Platform;
200
- bundleId: string;
201
- minBundleId: string;
202
- channel: string;
203
- appVersion: string;
204
- fingerprintHash: string | null;
205
- };
206
- //#endregion
207
- export { AppUpdateInfo, AppVersionGetBundlesArgs, Bundle, BundleMetadata, FingerprintGetBundlesArgs, GetBundlesArgs, Platform, SnakeCaseBundle, UpdateBundleParams, UpdateInfo, UpdateStatus, UpdateStrategy };
package/dist/types.mjs DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/uuid.cjs DELETED
@@ -1,5 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/uuid.ts
3
- const NIL_UUID = "00000000-0000-0000-0000-000000000000";
4
- //#endregion
5
- exports.NIL_UUID = NIL_UUID;
package/dist/uuid.d.cts DELETED
@@ -1,4 +0,0 @@
1
- //#region src/uuid.d.ts
2
- declare const NIL_UUID = "00000000-0000-0000-0000-000000000000";
3
- //#endregion
4
- export { NIL_UUID };
package/dist/uuid.d.mts DELETED
@@ -1,4 +0,0 @@
1
- //#region src/uuid.d.ts
2
- declare const NIL_UUID = "00000000-0000-0000-0000-000000000000";
3
- //#endregion
4
- export { NIL_UUID };
package/dist/uuid.mjs DELETED
@@ -1,4 +0,0 @@
1
- //#region src/uuid.ts
2
- const NIL_UUID = "00000000-0000-0000-0000-000000000000";
3
- //#endregion
4
- export { NIL_UUID };