@hot-updater/firebase 0.31.3 → 0.32.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.
@@ -6,7 +6,7 @@ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames$1 = Object.getOwnPropertyNames;
7
7
  var __getProtoOf$1 = Object.getPrototypeOf;
8
8
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
9
- var __commonJSMin$1 = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
+ var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
10
10
  var __copyProps$1 = (to, from, except, desc) => {
11
11
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
12
12
  key = keys[i];
@@ -24,15 +24,15 @@ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(
24
24
  //#endregion
25
25
  let _hot_updater_server_runtime = require("@hot-updater/server/runtime");
26
26
  let firebase_admin = require("firebase-admin");
27
- firebase_admin = __toESM$1(firebase_admin, 1);
27
+ firebase_admin = __toESM$1(firebase_admin);
28
28
  let firebase_functions_v2_https = require("firebase-functions/v2/https");
29
29
  let hono = require("hono");
30
30
  let node_path = require("node:path");
31
- node_path = __toESM$1(node_path, 1);
31
+ node_path = __toESM$1(node_path);
32
32
  let fs_promises = require("fs/promises");
33
- fs_promises = __toESM$1(fs_promises, 1);
33
+ fs_promises = __toESM$1(fs_promises);
34
34
  let path = require("path");
35
- path = __toESM$1(path, 1);
35
+ path = __toESM$1(path);
36
36
  //#region ../../packages/core/dist/index.mjs
37
37
  const stripBundleArtifactMetadata = (metadata) => metadata;
38
38
  const getManifestStorageUri = (bundle) => bundle.manifestStorageUri ?? null;
@@ -2891,7 +2891,6 @@ var require_min_version$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =
2891
2891
  break;
2892
2892
  case "<":
2893
2893
  case "<=": break;
2894
- /* istanbul ignore next */
2895
2894
  default: throw new Error(`Unexpected operation: ${comparator.operator}`);
2896
2895
  }
2897
2896
  });
@@ -3199,7 +3198,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3199
3198
  var __getOwnPropNames = Object.getOwnPropertyNames;
3200
3199
  var __getProtoOf = Object.getPrototypeOf;
3201
3200
  var __hasOwnProp = Object.prototype.hasOwnProperty;
3202
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
3201
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3203
3202
  var __copyProps = (to, from, except, desc) => {
3204
3203
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
3205
3204
  key = keys[i];
@@ -4188,7 +4187,6 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4188
4187
  break;
4189
4188
  case "<":
4190
4189
  case "<=": break;
4191
- /* istanbul ignore next */
4192
4190
  default: throw new Error(`Unexpected operation: ${comparator.operator}`);
4193
4191
  }
4194
4192
  });
@@ -4633,6 +4631,9 @@ const createProfiledStoragePlugin = ({ createProfiles, name, profileShape, suppo
4633
4631
  async downloadFile(storageUri, filePath) {
4634
4632
  return requireNodeProfile().downloadFile(storageUri, filePath);
4635
4633
  },
4634
+ async exists(storageUri) {
4635
+ return requireNodeProfile().exists(storageUri);
4636
+ },
4636
4637
  async upload(key, filePath) {
4637
4638
  return requireNodeProfile().upload(key, filePath);
4638
4639
  }
@@ -5018,6 +5019,12 @@ const firebaseStorage = createUniversalStoragePlugin({
5018
5019
  throw error;
5019
5020
  }
5020
5021
  },
5022
+ async exists(storageUri) {
5023
+ const { bucket: bucketName, key } = parseStorageUri(storageUri, "gs");
5024
+ if (bucketName !== config.storageBucket) throw new Error(`Bucket name mismatch: expected "${config.storageBucket}", but found "${bucketName}".`);
5025
+ const [exists] = await bucket.file(key).exists();
5026
+ return exists;
5027
+ },
5021
5028
  async downloadFile(storageUri, filePath) {
5022
5029
  const { bucket: bucketName, key } = parseStorageUri(storageUri, "gs");
5023
5030
  if (bucketName !== config.storageBucket) throw new Error(`Bucket name mismatch: expected "${config.storageBucket}", but found "${bucketName}".`);
@@ -5102,7 +5109,6 @@ const hotUpdater = (0, _hot_updater_server_runtime.createHotUpdater)({
5102
5109
  basePath: HOT_UPDATER_BASE_PATH,
5103
5110
  routes: {
5104
5111
  updateCheck: true,
5105
- version: true,
5106
5112
  bundles: false
5107
5113
  }
5108
5114
  });
@@ -6,7 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
10
10
  var __copyProps = (to, from, except, desc) => {
11
11
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
12
  key = keys[i];
@@ -23,20 +23,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  }) : target, mod));
24
24
  //#endregion
25
25
  let fs = require("fs");
26
- fs = __toESM(fs, 1);
26
+ fs = __toESM(fs);
27
27
  let path = require("path");
28
- path = __toESM(path, 1);
28
+ path = __toESM(path);
29
29
  let _hot_updater_cli_tools = require("@hot-updater/cli-tools");
30
30
  let node_url = require("node:url");
31
31
  let node_child_process = require("node:child_process");
32
32
  let node_string_decoder = require("node:string_decoder");
33
33
  let node_util = require("node:util");
34
34
  let node_process = require("node:process");
35
- node_process = __toESM(node_process, 1);
35
+ node_process = __toESM(node_process);
36
36
  let node_tty = require("node:tty");
37
- node_tty = __toESM(node_tty, 1);
37
+ node_tty = __toESM(node_tty);
38
38
  let node_path = require("node:path");
39
- node_path = __toESM(node_path, 1);
39
+ node_path = __toESM(node_path);
40
40
  let node_timers_promises = require("node:timers/promises");
41
41
  let node_os = require("node:os");
42
42
  let node_events = require("node:events");
@@ -46,7 +46,7 @@ let node_stream_promises = require("node:stream/promises");
46
46
  let node_stream = require("node:stream");
47
47
  let node_buffer = require("node:buffer");
48
48
  let node_fs_promises = require("node:fs/promises");
49
- node_fs_promises = __toESM(node_fs_promises, 1);
49
+ node_fs_promises = __toESM(node_fs_promises);
50
50
  //#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/_internal/compareValues.mjs
51
51
  function compareValues(a, b, order) {
52
52
  if (a < b) return order === "asc" ? -1 : 1;
@@ -6622,10 +6622,6 @@ const initFirebaseUser = async (cwd) => {
6622
6622
  "--format=json"
6623
6623
  ], {
6624
6624
  shell: true,
6625
- /**
6626
- * API [firestore.googleapis.com] not enabled on project [xxx]. Would you
6627
- like to enable and retry (this will take a few minutes)? (y/N)?
6628
- */
6629
6625
  input: "N\n"
6630
6626
  });
6631
6627
  if (JSON.parse(databases.stdout).length === 0) {
@@ -25,7 +25,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
25
25
  var __getOwnPropNames = Object.getOwnPropertyNames;
26
26
  var __getProtoOf = Object.getPrototypeOf;
27
27
  var __hasOwnProp = Object.prototype.hasOwnProperty;
28
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
28
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
29
29
  var __copyProps = (to, from, except, desc) => {
30
30
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
31
31
  key = keys[i];
@@ -6617,10 +6617,6 @@ const initFirebaseUser = async (cwd) => {
6617
6617
  "--format=json"
6618
6618
  ], {
6619
6619
  shell: true,
6620
- /**
6621
- * API [firestore.googleapis.com] not enabled on project [xxx]. Would you
6622
- like to enable and retry (this will take a few minutes)? (y/N)?
6623
- */
6624
6620
  input: "N\n"
6625
6621
  });
6626
6622
  if (JSON.parse(databases.stdout).length === 0) {
package/dist/index.cjs CHANGED
@@ -24,11 +24,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  let _hot_updater_core = require("@hot-updater/core");
25
25
  let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
26
26
  let firebase_admin = require("firebase-admin");
27
- firebase_admin = __toESM(firebase_admin, 1);
27
+ firebase_admin = __toESM(firebase_admin);
28
28
  let fs_promises = require("fs/promises");
29
- fs_promises = __toESM(fs_promises, 1);
29
+ fs_promises = __toESM(fs_promises);
30
30
  let path = require("path");
31
- path = __toESM(path, 1);
31
+ path = __toESM(path);
32
32
  //#region src/firebaseDatabase.ts
33
33
  const bundleMatchesQueryWhere = (bundle, where) => {
34
34
  if (!where) return true;
@@ -322,6 +322,12 @@ const firebaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugi
322
322
  throw error;
323
323
  }
324
324
  },
325
+ async exists(storageUri) {
326
+ const { bucket: bucketName, key } = (0, _hot_updater_plugin_core.parseStorageUri)(storageUri, "gs");
327
+ if (bucketName !== config.storageBucket) throw new Error(`Bucket name mismatch: expected "${config.storageBucket}", but found "${bucketName}".`);
328
+ const [exists] = await bucket.file(key).exists();
329
+ return exists;
330
+ },
325
331
  async downloadFile(storageUri, filePath) {
326
332
  const { bucket: bucketName, key } = (0, _hot_updater_plugin_core.parseStorageUri)(storageUri, "gs");
327
333
  if (bucketName !== config.storageBucket) throw new Error(`Bucket name mismatch: expected "${config.storageBucket}", but found "${bucketName}".`);
package/dist/index.d.cts CHANGED
@@ -1,7 +1,8 @@
1
+ import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
1
2
  import admin from "firebase-admin";
2
3
 
3
4
  //#region src/firebaseDatabase.d.ts
4
- declare const firebaseDatabase: (config: admin.AppOptions, hooks?: import("@hot-updater/plugin-core").DatabasePluginHooks) => () => import("@hot-updater/plugin-core").DatabasePlugin<unknown>;
5
+ declare const firebaseDatabase: (config: admin.AppOptions, hooks?: _$_hot_updater_plugin_core0.DatabasePluginHooks) => () => _$_hot_updater_plugin_core0.DatabasePlugin<unknown>;
5
6
  //#endregion
6
7
  //#region src/firebaseStorage.d.ts
7
8
  interface FirebaseStorageConfig extends admin.AppOptions {
@@ -11,6 +12,6 @@ interface FirebaseStorageConfig extends admin.AppOptions {
11
12
  */
12
13
  basePath?: string;
13
14
  }
14
- declare const firebaseStorage: (config: FirebaseStorageConfig, hooks?: import("@hot-updater/plugin-core").StoragePluginHooks) => () => import("@hot-updater/plugin-core").UniversalStoragePlugin<unknown>;
15
+ declare const firebaseStorage: (config: FirebaseStorageConfig, hooks?: _$_hot_updater_plugin_core0.StoragePluginHooks) => () => _$_hot_updater_plugin_core0.UniversalStoragePlugin<unknown>;
15
16
  //#endregion
16
17
  export { FirebaseStorageConfig, firebaseDatabase, firebaseStorage };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
+ import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
1
2
  import admin from "firebase-admin";
2
3
 
3
4
  //#region src/firebaseDatabase.d.ts
4
- declare const firebaseDatabase: (config: admin.AppOptions, hooks?: import("@hot-updater/plugin-core").DatabasePluginHooks) => () => import("@hot-updater/plugin-core").DatabasePlugin<unknown>;
5
+ declare const firebaseDatabase: (config: admin.AppOptions, hooks?: _$_hot_updater_plugin_core0.DatabasePluginHooks) => () => _$_hot_updater_plugin_core0.DatabasePlugin<unknown>;
5
6
  //#endregion
6
7
  //#region src/firebaseStorage.d.ts
7
8
  interface FirebaseStorageConfig extends admin.AppOptions {
@@ -11,6 +12,6 @@ interface FirebaseStorageConfig extends admin.AppOptions {
11
12
  */
12
13
  basePath?: string;
13
14
  }
14
- declare const firebaseStorage: (config: FirebaseStorageConfig, hooks?: import("@hot-updater/plugin-core").StoragePluginHooks) => () => import("@hot-updater/plugin-core").UniversalStoragePlugin<unknown>;
15
+ declare const firebaseStorage: (config: FirebaseStorageConfig, hooks?: _$_hot_updater_plugin_core0.StoragePluginHooks) => () => _$_hot_updater_plugin_core0.UniversalStoragePlugin<unknown>;
15
16
  //#endregion
16
17
  export { FirebaseStorageConfig, firebaseDatabase, firebaseStorage };
package/dist/index.mjs CHANGED
@@ -296,6 +296,12 @@ const firebaseStorage = createUniversalStoragePlugin({
296
296
  throw error;
297
297
  }
298
298
  },
299
+ async exists(storageUri) {
300
+ const { bucket: bucketName, key } = parseStorageUri(storageUri, "gs");
301
+ if (bucketName !== config.storageBucket) throw new Error(`Bucket name mismatch: expected "${config.storageBucket}", but found "${bucketName}".`);
302
+ const [exists] = await bucket.file(key).exists();
303
+ return exists;
304
+ },
299
305
  async downloadFile(storageUri, filePath) {
300
306
  const { bucket: bucketName, key } = parseStorageUri(storageUri, "gs");
301
307
  if (bucketName !== config.storageBucket) throw new Error(`Bucket name mismatch: expected "${config.storageBucket}", but found "${bucketName}".`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/firebase",
3
3
  "type": "module",
4
- "version": "0.31.3",
4
+ "version": "0.32.0",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "types": "dist/index.d.cts",
@@ -36,10 +36,10 @@
36
36
  "dependencies": {
37
37
  "firebase": "^11.3.1",
38
38
  "hono": "4.12.9",
39
- "@hot-updater/cli-tools": "0.31.3",
40
- "@hot-updater/core": "0.31.3",
41
- "@hot-updater/server": "0.31.3",
42
- "@hot-updater/plugin-core": "0.31.3"
39
+ "@hot-updater/plugin-core": "0.32.0",
40
+ "@hot-updater/server": "0.32.0",
41
+ "@hot-updater/cli-tools": "0.32.0",
42
+ "@hot-updater/core": "0.32.0"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
@@ -54,9 +54,9 @@
54
54
  "firebase-tools": "^13.32.0",
55
55
  "fkill": "^9.0.0",
56
56
  "mime": "^4.0.4",
57
- "@hot-updater/js": "0.31.3",
58
- "@hot-updater/mock": "0.31.3",
59
- "@hot-updater/test-utils": "0.31.3"
57
+ "@hot-updater/js": "0.32.0",
58
+ "@hot-updater/mock": "0.32.0",
59
+ "@hot-updater/test-utils": "0.32.0"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "firebase-admin": "*",