@hot-updater/standalone 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.
package/dist/index.cjs CHANGED
@@ -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];
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  //#endregion
25
25
  let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
26
26
  let fs_promises = require("fs/promises");
27
- fs_promises = __toESM(fs_promises, 1);
27
+ fs_promises = __toESM(fs_promises);
28
28
  let path = require("path");
29
- path = __toESM(path, 1);
29
+ path = __toESM(path);
30
30
  //#region src/standaloneRepository.ts
31
31
  const defaultRoutes$1 = {
32
32
  create: () => ({ path: "/api/bundles" }),
@@ -1563,6 +1563,10 @@ const standaloneStorage = (config, hooks) => () => {
1563
1563
  await hooks?.onStorageUploaded?.();
1564
1564
  return { storageUri: result.storageUri };
1565
1565
  },
1566
+ async exists(storageUri) {
1567
+ const { fileUrl } = await getDownloadUrl(storageUri);
1568
+ return (await fetch(fileUrl, { method: "HEAD" })).ok;
1569
+ },
1566
1570
  async downloadFile(storageUri, filePath) {
1567
1571
  const { fileUrl } = await getDownloadUrl(storageUri);
1568
1572
  const response = await fetch(fileUrl);
package/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
1
2
  import { StoragePluginHooks, UniversalStoragePlugin } from "@hot-updater/plugin-core";
2
3
 
3
4
  //#region src/standaloneRepository.d.ts
@@ -18,7 +19,7 @@ interface StandaloneRepositoryConfig {
18
19
  commonHeaders?: Record<string, string>;
19
20
  routes?: Routes;
20
21
  }
21
- declare const standaloneRepository: (config: StandaloneRepositoryConfig, hooks?: import("@hot-updater/plugin-core").DatabasePluginHooks) => () => import("@hot-updater/plugin-core").DatabasePlugin<unknown>;
22
+ declare const standaloneRepository: (config: StandaloneRepositoryConfig, hooks?: _$_hot_updater_plugin_core0.DatabasePluginHooks) => () => _$_hot_updater_plugin_core0.DatabasePlugin<unknown>;
22
23
  //#endregion
23
24
  //#region src/standaloneStorage.d.ts
24
25
  interface StorageRoutes {
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
1
2
  import { StoragePluginHooks, UniversalStoragePlugin } from "@hot-updater/plugin-core";
2
3
 
3
4
  //#region src/standaloneRepository.d.ts
@@ -18,7 +19,7 @@ interface StandaloneRepositoryConfig {
18
19
  commonHeaders?: Record<string, string>;
19
20
  routes?: Routes;
20
21
  }
21
- declare const standaloneRepository: (config: StandaloneRepositoryConfig, hooks?: import("@hot-updater/plugin-core").DatabasePluginHooks) => () => import("@hot-updater/plugin-core").DatabasePlugin<unknown>;
22
+ declare const standaloneRepository: (config: StandaloneRepositoryConfig, hooks?: _$_hot_updater_plugin_core0.DatabasePluginHooks) => () => _$_hot_updater_plugin_core0.DatabasePlugin<unknown>;
22
23
  //#endregion
23
24
  //#region src/standaloneStorage.d.ts
24
25
  interface StorageRoutes {
package/dist/index.mjs CHANGED
@@ -8,7 +8,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
8
  var __getOwnPropNames = Object.getOwnPropertyNames;
9
9
  var __getProtoOf = Object.getPrototypeOf;
10
10
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
11
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
12
12
  var __copyProps = (to, from, except, desc) => {
13
13
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
14
  key = keys[i];
@@ -1560,6 +1560,10 @@ const standaloneStorage = (config, hooks) => () => {
1560
1560
  await hooks?.onStorageUploaded?.();
1561
1561
  return { storageUri: result.storageUri };
1562
1562
  },
1563
+ async exists(storageUri) {
1564
+ const { fileUrl } = await getDownloadUrl(storageUri);
1565
+ return (await fetch(fileUrl, { method: "HEAD" })).ok;
1566
+ },
1563
1567
  async downloadFile(storageUri, filePath) {
1564
1568
  const { fileUrl } = await getDownloadUrl(storageUri);
1565
1569
  const response = await fetch(fileUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/standalone",
3
- "version": "0.31.3",
3
+ "version": "0.32.0",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -39,8 +39,8 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@hot-updater/core": "0.31.3",
43
- "@hot-updater/plugin-core": "0.31.3"
42
+ "@hot-updater/core": "0.32.0",
43
+ "@hot-updater/plugin-core": "0.32.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "mime": "2.6.0",