@hot-updater/firebase 0.36.0 → 0.36.2

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.0";
35
+ const HOT_UPDATER_SERVER_VERSION = "0.36.2";
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",
@@ -6980,7 +6980,7 @@ const getConfigScaffold = (build) => {
6980
6980
  strategy: "preserve-existing",
6981
6981
  code: `
6982
6982
  // https://firebase.google.com/docs/admin/setup?hl=en#initialize_the_sdk_in_non-google_environments
6983
- // Check your .env file and add the credentials
6983
+ // Check your .env.hotupdater file and add the credentials
6984
6984
  // Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your credentials file path
6985
6985
  // Example: GOOGLE_APPLICATION_CREDENTIALS=./firebase-adminsdk-credentials.json
6986
6986
  const credential = applicationDefault();`.trim()
@@ -7213,7 +7213,7 @@ const SOURCE_TEMPLATE = `// add this to your App.tsx
7213
7213
  import { HotUpdater } from "@hot-updater/react-native";
7214
7214
 
7215
7215
  function App() {
7216
- return ...
7216
+ return null; // Replace with your app root
7217
7217
  }
7218
7218
 
7219
7219
  export default HotUpdater.wrap({
@@ -7482,7 +7482,7 @@ const runInit = async ({ build, envFile }) => {
7482
7482
  await printTemplate(initializeVariable.projectId, currentRegion, cliEnv);
7483
7483
  await removeTmpDir();
7484
7484
  _hot_updater_cli_tools.p.log.message(`Next step: ${(0, _hot_updater_cli_tools.link)("https://hot-updater.dev/docs/managed/firebase#step-3-generated-configurations")}`);
7485
- if (!applicationCredentials) _hot_updater_cli_tools.p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env file");
7485
+ if (!applicationCredentials) _hot_updater_cli_tools.p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env.hotupdater");
7486
7486
  _hot_updater_cli_tools.p.log.success("Done! 🎉");
7487
7487
  };
7488
7488
  //#endregion
@@ -6974,7 +6974,7 @@ const getConfigScaffold = (build) => {
6974
6974
  strategy: "preserve-existing",
6975
6975
  code: `
6976
6976
  // https://firebase.google.com/docs/admin/setup?hl=en#initialize_the_sdk_in_non-google_environments
6977
- // Check your .env file and add the credentials
6977
+ // Check your .env.hotupdater file and add the credentials
6978
6978
  // Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your credentials file path
6979
6979
  // Example: GOOGLE_APPLICATION_CREDENTIALS=./firebase-adminsdk-credentials.json
6980
6980
  const credential = applicationDefault();`.trim()
@@ -7207,7 +7207,7 @@ const SOURCE_TEMPLATE = `// add this to your App.tsx
7207
7207
  import { HotUpdater } from "@hot-updater/react-native";
7208
7208
 
7209
7209
  function App() {
7210
- return ...
7210
+ return null; // Replace with your app root
7211
7211
  }
7212
7212
 
7213
7213
  export default HotUpdater.wrap({
@@ -7476,7 +7476,7 @@ const runInit = async ({ build, envFile }) => {
7476
7476
  await printTemplate(initializeVariable.projectId, currentRegion, cliEnv);
7477
7477
  await removeTmpDir();
7478
7478
  p.log.message(`Next step: ${link("https://hot-updater.dev/docs/managed/firebase#step-3-generated-configurations")}`);
7479
- if (!applicationCredentials) p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env file");
7479
+ if (!applicationCredentials) p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env.hotupdater");
7480
7480
  p.log.success("Done! 🎉");
7481
7481
  };
7482
7482
  //#endregion
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.0",
4
+ "version": "0.36.2",
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/cli-tools": "0.36.0",
47
- "@hot-updater/core": "0.36.0",
48
- "@hot-updater/plugin-core": "0.36.0",
49
- "@hot-updater/server": "0.36.0"
46
+ "@hot-updater/cli-tools": "0.36.2",
47
+ "@hot-updater/core": "0.36.2",
48
+ "@hot-updater/plugin-core": "0.36.2",
49
+ "@hot-updater/server": "0.36.2"
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/js": "0.36.0",
65
- "@hot-updater/mock": "0.36.0",
66
- "@hot-updater/test-utils": "0.36.0"
64
+ "@hot-updater/js": "0.36.2",
65
+ "@hot-updater/mock": "0.36.2",
66
+ "@hot-updater/test-utils": "0.36.2"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "firebase-admin": "*",