@hot-updater/server 0.21.11 → 0.21.13

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/db/index.cjs CHANGED
@@ -5,7 +5,7 @@ const require_types = require('./types.cjs');
5
5
 
6
6
  //#region src/db/index.ts
7
7
  function createHotUpdater(options) {
8
- const storagePlugins = (options?.storagePlugins ?? []).map((plugin) => typeof plugin === "function" ? plugin() : plugin);
8
+ const storagePlugins = (options?.storages ?? options?.storagePlugins ?? []).map((plugin) => typeof plugin === "function" ? plugin() : plugin);
9
9
  const resolveFileUrl = async (storageUri) => {
10
10
  if (!storageUri) return null;
11
11
  const protocol = new URL(storageUri).protocol.replace(":", "");
@@ -11,6 +11,13 @@ type HotUpdaterAPI = DatabaseAPI & {
11
11
  };
12
12
  interface HotUpdaterOptions {
13
13
  database: DatabaseAdapter;
14
+ /**
15
+ * Storage plugins for handling file uploads and downloads.
16
+ */
17
+ storages?: (StoragePlugin | StoragePluginFactory)[];
18
+ /**
19
+ * @deprecated Use `storages` instead. This field will be removed in a future version.
20
+ */
14
21
  storagePlugins?: (StoragePlugin | StoragePluginFactory)[];
15
22
  basePath?: string;
16
23
  cwd?: string;
@@ -11,6 +11,13 @@ type HotUpdaterAPI = DatabaseAPI & {
11
11
  };
12
12
  interface HotUpdaterOptions {
13
13
  database: DatabaseAdapter;
14
+ /**
15
+ * Storage plugins for handling file uploads and downloads.
16
+ */
17
+ storages?: (StoragePlugin | StoragePluginFactory)[];
18
+ /**
19
+ * @deprecated Use `storages` instead. This field will be removed in a future version.
20
+ */
14
21
  storagePlugins?: (StoragePlugin | StoragePluginFactory)[];
15
22
  basePath?: string;
16
23
  cwd?: string;
package/dist/db/index.js CHANGED
@@ -5,7 +5,7 @@ import { isDatabasePlugin, isDatabasePluginFactory } from "./types.js";
5
5
 
6
6
  //#region src/db/index.ts
7
7
  function createHotUpdater(options) {
8
- const storagePlugins = (options?.storagePlugins ?? []).map((plugin) => typeof plugin === "function" ? plugin() : plugin);
8
+ const storagePlugins = (options?.storages ?? options?.storagePlugins ?? []).map((plugin) => typeof plugin === "function" ? plugin() : plugin);
9
9
  const resolveFileUrl = async (storageUri) => {
10
10
  if (!storageUri) return null;
11
11
  const protocol = new URL(storageUri).protocol.replace(":", "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/server",
3
- "version": "0.21.11",
3
+ "version": "0.21.13",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -49,9 +49,9 @@
49
49
  "fumadb": "0.2.0",
50
50
  "rou3": "0.7.9",
51
51
  "semver": "^7.7.2",
52
- "@hot-updater/core": "0.21.11",
53
- "@hot-updater/js": "0.21.11",
54
- "@hot-updater/plugin-core": "0.21.11"
52
+ "@hot-updater/core": "0.21.13",
53
+ "@hot-updater/plugin-core": "0.21.13",
54
+ "@hot-updater/js": "0.21.13"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@electric-sql/pglite": "^0.2.17",
@@ -62,12 +62,12 @@
62
62
  "kysely-pglite-dialect": "^1.2.0",
63
63
  "msw": "^2.7.0",
64
64
  "uuidv7": "^1.0.2",
65
- "@hot-updater/aws": "0.21.11",
66
- "@hot-updater/cloudflare": "0.21.11",
67
- "@hot-updater/firebase": "0.21.11",
68
- "@hot-updater/standalone": "0.21.11",
69
- "@hot-updater/test-utils": "0.21.11",
70
- "@hot-updater/supabase": "0.21.11"
65
+ "@hot-updater/aws": "0.21.13",
66
+ "@hot-updater/cloudflare": "0.21.13",
67
+ "@hot-updater/firebase": "0.21.13",
68
+ "@hot-updater/standalone": "0.21.13",
69
+ "@hot-updater/supabase": "0.21.13",
70
+ "@hot-updater/test-utils": "0.21.13"
71
71
  },
72
72
  "scripts": {
73
73
  "build": "tsdown",
@@ -31,7 +31,7 @@ describe("server/db hotUpdater getUpdateInfo (PGlite + Kysely)", async () => {
31
31
  db: kysely,
32
32
  provider: "postgresql",
33
33
  }),
34
- storagePlugins: [
34
+ storages: [
35
35
  s3Storage({
36
36
  region: "us-east-1",
37
37
  credentials: {
package/src/db/index.ts CHANGED
@@ -30,6 +30,13 @@ export type HotUpdaterAPI = DatabaseAPI & {
30
30
 
31
31
  interface HotUpdaterOptions {
32
32
  database: DatabaseAdapter;
33
+ /**
34
+ * Storage plugins for handling file uploads and downloads.
35
+ */
36
+ storages?: (StoragePlugin | StoragePluginFactory)[];
37
+ /**
38
+ * @deprecated Use `storages` instead. This field will be removed in a future version.
39
+ */
33
40
  storagePlugins?: (StoragePlugin | StoragePluginFactory)[];
34
41
  basePath?: string;
35
42
  cwd?: string;
@@ -37,9 +44,11 @@ interface HotUpdaterOptions {
37
44
 
38
45
  export function createHotUpdater(options: HotUpdaterOptions): HotUpdaterAPI {
39
46
  // Initialize storage plugins - call factories if they are functions
40
- const storagePlugins = (options?.storagePlugins ?? []).map((plugin) =>
41
- typeof plugin === "function" ? plugin() : plugin,
42
- );
47
+ const storagePlugins = (
48
+ options?.storages ??
49
+ options?.storagePlugins ??
50
+ []
51
+ ).map((plugin) => (typeof plugin === "function" ? plugin() : plugin));
43
52
 
44
53
  const resolveFileUrl = async (
45
54
  storageUri: string | null,