@hot-updater/firebase 0.36.1 → 0.36.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.
@@ -32,7 +32,7 @@ path = __toESM(path);
32
32
  let firebase_admin_storage = require("firebase-admin/storage");
33
33
  //#endregion
34
34
  //#region ../../packages/server/dist/version.mjs
35
- const HOT_UPDATER_SERVER_VERSION = "0.36.1";
35
+ const HOT_UPDATER_SERVER_VERSION = "0.36.3";
36
36
  //#endregion
37
37
  //#region ../../packages/server/dist/internalRouter.mjs
38
38
  const normalizePath = (path) => {
@@ -3629,6 +3629,13 @@ const createUniversalStoragePlugin = (options) => {
3629
3629
  };
3630
3630
  //#endregion
3631
3631
  //#region ../plugin-core/dist/parseStorageUri.mjs
3632
+ const decodeStorageObjectKey = (key) => {
3633
+ try {
3634
+ return decodeURIComponent(key);
3635
+ } catch {
3636
+ return key;
3637
+ }
3638
+ };
3632
3639
  /**
3633
3640
  * Parses a storage URI and validates the protocol.
3634
3641
  *
@@ -3652,7 +3659,7 @@ function parseStorageUri(storageUri, expectedProtocol) {
3652
3659
  return {
3653
3660
  protocol,
3654
3661
  bucket: url.hostname,
3655
- key: url.pathname.slice(1)
3662
+ key: decodeStorageObjectKey(url.pathname.slice(1))
3656
3663
  };
3657
3664
  } catch (error) {
3658
3665
  if (error instanceof TypeError) throw new Error(`Invalid storage URI format: ${storageUri}`);
@@ -4479,9 +4486,7 @@ const firebaseStorage = createUniversalStoragePlugin({
4479
4486
  }
4480
4487
  },
4481
4488
  async getDownloadUrl(storageUri) {
4482
- const u = new URL(storageUri);
4483
- if (u.protocol.replace(":", "") !== "gs") throw new Error("Invalid Firebase storage URI protocol");
4484
- const key = u.pathname.slice(1);
4489
+ const { key } = parseStorageUri(storageUri, "gs");
4485
4490
  if (!key) throw new Error("Invalid Firebase storage URI: missing key");
4486
4491
  const [signedUrl] = await bucket.file(key).getSignedUrl({
4487
4492
  action: "read",
package/dist/index.cjs CHANGED
@@ -353,9 +353,7 @@ const firebaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugi
353
353
  }
354
354
  },
355
355
  async getDownloadUrl(storageUri) {
356
- const u = new URL(storageUri);
357
- if (u.protocol.replace(":", "") !== "gs") throw new Error("Invalid Firebase storage URI protocol");
358
- const key = u.pathname.slice(1);
356
+ const { key } = (0, _hot_updater_plugin_core.parseStorageUri)(storageUri, "gs");
359
357
  if (!key) throw new Error("Invalid Firebase storage URI: missing key");
360
358
  const [signedUrl] = await bucket.file(key).getSignedUrl({
361
359
  action: "read",
package/dist/index.mjs CHANGED
@@ -328,9 +328,7 @@ const firebaseStorage = createUniversalStoragePlugin({
328
328
  }
329
329
  },
330
330
  async getDownloadUrl(storageUri) {
331
- const u = new URL(storageUri);
332
- if (u.protocol.replace(":", "") !== "gs") throw new Error("Invalid Firebase storage URI protocol");
333
- const key = u.pathname.slice(1);
331
+ const { key } = parseStorageUri(storageUri, "gs");
334
332
  if (!key) throw new Error("Invalid Firebase storage URI: missing key");
335
333
  const [signedUrl] = await bucket.file(key).getSignedUrl({
336
334
  action: "read",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/firebase",
3
3
  "type": "module",
4
- "version": "0.36.1",
4
+ "version": "0.36.3",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "types": "dist/index.d.cts",
@@ -43,10 +43,10 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "hono": "4.12.9",
46
- "@hot-updater/plugin-core": "0.36.1",
47
- "@hot-updater/core": "0.36.1",
48
- "@hot-updater/cli-tools": "0.36.1",
49
- "@hot-updater/server": "0.36.1"
46
+ "@hot-updater/cli-tools": "0.36.3",
47
+ "@hot-updater/plugin-core": "0.36.3",
48
+ "@hot-updater/core": "0.36.3",
49
+ "@hot-updater/server": "0.36.3"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
@@ -61,9 +61,9 @@
61
61
  "firebase-tools": "^13.32.0",
62
62
  "fkill": "^9.0.0",
63
63
  "mime": "^4.0.4",
64
- "@hot-updater/mock": "0.36.1",
65
- "@hot-updater/test-utils": "0.36.1",
66
- "@hot-updater/js": "0.36.1"
64
+ "@hot-updater/js": "0.36.3",
65
+ "@hot-updater/mock": "0.36.3",
66
+ "@hot-updater/test-utils": "0.36.3"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "firebase-admin": "*",