@hot-updater/standalone 1.0.0-rc.0 → 1.0.0-rc.14

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
@@ -102,9 +102,13 @@ const createBundleReads = (remote) => ({
102
102
  });
103
103
  if (remoteWindow) return remoteWindow.total;
104
104
  }
105
- return countDistinctRows(queryStandaloneRows(await loadRows(remote, "bundles"), { where }), input.distinct);
105
+ const rows = queryStandaloneRows(await loadRows(remote, "bundles"), { where });
106
+ return countDistinctRows(rows, input.distinct);
107
+ }
108
+ case "bundle_patches": {
109
+ const rows = queryStandaloneRows(await loadRows(remote, "bundle_patches"), { where: input.where });
110
+ return countDistinctRows(rows, input.distinct);
106
111
  }
107
- case "bundle_patches": return countDistinctRows(queryStandaloneRows(await loadRows(remote, "bundle_patches"), { where: input.where }), input.distinct);
108
112
  }
109
113
  },
110
114
  async findOne(input) {
@@ -199,9 +203,7 @@ const appendBundleWhere = (url, where) => {
199
203
  case "lt":
200
204
  parameter = "idLt";
201
205
  break;
202
- case "lte":
203
- parameter = "idLte";
204
- break;
206
+ case "lte": parameter = "idLte";
205
207
  }
206
208
  if (parameter && typeof condition.value === "string") {
207
209
  if (!setParameter(parameter, condition.value)) return false;
@@ -222,6 +224,8 @@ const appendBundleWhere = (url, where) => {
222
224
  //#endregion
223
225
  //#region src/standaloneHttp.ts
224
226
  var StandaloneDatabaseError = class extends Error {
227
+ code;
228
+ status;
225
229
  name = "StandaloneDatabaseError";
226
230
  constructor(code, message, status) {
227
231
  super(message);
@@ -398,8 +402,9 @@ const createStandaloneBundleRemote = (config) => {
398
402
  });
399
403
  const value = await http.parseJson(response);
400
404
  if (!isPaginatedResult(value)) throw new StandaloneDatabaseError("invalid-response", "Invalid bundle list response.", response.status);
405
+ const bundles = pageAligned ? value.data : value.data.slice(input.offset, input.offset + input.limit);
401
406
  return {
402
- rows: await bundlesToRows(pageAligned ? value.data : value.data.slice(input.offset, input.offset + input.limit)),
407
+ rows: await bundlesToRows(bundles),
403
408
  total: value.pagination.total
404
409
  };
405
410
  };
@@ -590,7 +595,7 @@ const toBundleWhere = (where) => {
590
595
  /**
591
596
  * Bundle-only HTTP repository used by the CLI for a self-hosted server.
592
597
  *
593
- * This is intentionally not a database plugin: analytics and access-key
598
+ * This is intentionally not a database plugin: insights and access-key
594
599
  * persistence belong to the server's database provider.
595
600
  */
596
601
  const standaloneRepository = (config) => {
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { BundleRepository, StorageDeleteInput, StorageExistsInput, StorageGetInput, StoragePutInput } from "@hot-updater/plugin-core";
2
-
3
2
  //#region src/standaloneRoutes.d.ts
4
3
  interface RouteConfig {
5
4
  readonly path: string;
@@ -32,7 +31,7 @@ declare class StandaloneDatabaseError extends Error {
32
31
  /**
33
32
  * Bundle-only HTTP repository used by the CLI for a self-hosted server.
34
33
  *
35
- * This is intentionally not a database plugin: analytics and access-key
34
+ * This is intentionally not a database plugin: insights and access-key
36
35
  * persistence belong to the server's database provider.
37
36
  */
38
37
  declare const standaloneRepository: (config: StandaloneRepositoryConfig) => BundleRepository;
@@ -54,27 +53,16 @@ interface StandaloneStorageConfig {
54
53
  declare const standaloneStorage: (config: StandaloneStorageConfig) => {
55
54
  readonly name: "standaloneStorage";
56
55
  readonly protocol: string;
57
- readonly put: ({
58
- key,
59
- body,
60
- contentType,
61
- contentLength
62
- }: StoragePutInput) => Promise<{
56
+ readonly put: ({ key, body, contentType, contentLength }: StoragePutInput) => Promise<{
63
57
  storageUri: string;
64
58
  }>;
65
- readonly get: ({
66
- storageUri
67
- }: StorageGetInput) => Promise<{
59
+ readonly get: ({ storageUri }: StorageGetInput) => Promise<{
68
60
  response: Response | null;
69
61
  }>;
70
- readonly exists: ({
71
- storageUri
72
- }: StorageExistsInput) => Promise<{
62
+ readonly exists: ({ storageUri }: StorageExistsInput) => Promise<{
73
63
  exists: boolean;
74
64
  }>;
75
- readonly delete: ({
76
- storageUri
77
- }: StorageDeleteInput) => Promise<{
65
+ readonly delete: ({ storageUri }: StorageDeleteInput) => Promise<{
78
66
  deleted: true;
79
67
  }>;
80
68
  };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { BundleRepository, StorageDeleteInput, StorageExistsInput, StorageGetInput, StoragePutInput } from "@hot-updater/plugin-core";
2
-
3
2
  //#region src/standaloneRoutes.d.ts
4
3
  interface RouteConfig {
5
4
  readonly path: string;
@@ -32,7 +31,7 @@ declare class StandaloneDatabaseError extends Error {
32
31
  /**
33
32
  * Bundle-only HTTP repository used by the CLI for a self-hosted server.
34
33
  *
35
- * This is intentionally not a database plugin: analytics and access-key
34
+ * This is intentionally not a database plugin: insights and access-key
36
35
  * persistence belong to the server's database provider.
37
36
  */
38
37
  declare const standaloneRepository: (config: StandaloneRepositoryConfig) => BundleRepository;
@@ -54,27 +53,16 @@ interface StandaloneStorageConfig {
54
53
  declare const standaloneStorage: (config: StandaloneStorageConfig) => {
55
54
  readonly name: "standaloneStorage";
56
55
  readonly protocol: string;
57
- readonly put: ({
58
- key,
59
- body,
60
- contentType,
61
- contentLength
62
- }: StoragePutInput) => Promise<{
56
+ readonly put: ({ key, body, contentType, contentLength }: StoragePutInput) => Promise<{
63
57
  storageUri: string;
64
58
  }>;
65
- readonly get: ({
66
- storageUri
67
- }: StorageGetInput) => Promise<{
59
+ readonly get: ({ storageUri }: StorageGetInput) => Promise<{
68
60
  response: Response | null;
69
61
  }>;
70
- readonly exists: ({
71
- storageUri
72
- }: StorageExistsInput) => Promise<{
62
+ readonly exists: ({ storageUri }: StorageExistsInput) => Promise<{
73
63
  exists: boolean;
74
64
  }>;
75
- readonly delete: ({
76
- storageUri
77
- }: StorageDeleteInput) => Promise<{
65
+ readonly delete: ({ storageUri }: StorageDeleteInput) => Promise<{
78
66
  deleted: true;
79
67
  }>;
80
68
  };
package/dist/index.mjs CHANGED
@@ -101,9 +101,13 @@ const createBundleReads = (remote) => ({
101
101
  });
102
102
  if (remoteWindow) return remoteWindow.total;
103
103
  }
104
- return countDistinctRows(queryStandaloneRows(await loadRows(remote, "bundles"), { where }), input.distinct);
104
+ const rows = queryStandaloneRows(await loadRows(remote, "bundles"), { where });
105
+ return countDistinctRows(rows, input.distinct);
106
+ }
107
+ case "bundle_patches": {
108
+ const rows = queryStandaloneRows(await loadRows(remote, "bundle_patches"), { where: input.where });
109
+ return countDistinctRows(rows, input.distinct);
105
110
  }
106
- case "bundle_patches": return countDistinctRows(queryStandaloneRows(await loadRows(remote, "bundle_patches"), { where: input.where }), input.distinct);
107
111
  }
108
112
  },
109
113
  async findOne(input) {
@@ -198,9 +202,7 @@ const appendBundleWhere = (url, where) => {
198
202
  case "lt":
199
203
  parameter = "idLt";
200
204
  break;
201
- case "lte":
202
- parameter = "idLte";
203
- break;
205
+ case "lte": parameter = "idLte";
204
206
  }
205
207
  if (parameter && typeof condition.value === "string") {
206
208
  if (!setParameter(parameter, condition.value)) return false;
@@ -221,6 +223,8 @@ const appendBundleWhere = (url, where) => {
221
223
  //#endregion
222
224
  //#region src/standaloneHttp.ts
223
225
  var StandaloneDatabaseError = class extends Error {
226
+ code;
227
+ status;
224
228
  name = "StandaloneDatabaseError";
225
229
  constructor(code, message, status) {
226
230
  super(message);
@@ -397,8 +401,9 @@ const createStandaloneBundleRemote = (config) => {
397
401
  });
398
402
  const value = await http.parseJson(response);
399
403
  if (!isPaginatedResult(value)) throw new StandaloneDatabaseError("invalid-response", "Invalid bundle list response.", response.status);
404
+ const bundles = pageAligned ? value.data : value.data.slice(input.offset, input.offset + input.limit);
400
405
  return {
401
- rows: await bundlesToRows(pageAligned ? value.data : value.data.slice(input.offset, input.offset + input.limit)),
406
+ rows: await bundlesToRows(bundles),
402
407
  total: value.pagination.total
403
408
  };
404
409
  };
@@ -589,7 +594,7 @@ const toBundleWhere = (where) => {
589
594
  /**
590
595
  * Bundle-only HTTP repository used by the CLI for a self-hosted server.
591
596
  *
592
- * This is intentionally not a database plugin: analytics and access-key
597
+ * This is intentionally not a database plugin: insights and access-key
593
598
  * persistence belong to the server's database provider.
594
599
  */
595
600
  const standaloneRepository = (config) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/standalone",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.14",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -42,15 +42,15 @@
42
42
  "access": "public"
43
43
  },
44
44
  "dependencies": {
45
- "@hot-updater/core": "1.0.0-rc.0",
46
- "@hot-updater/plugin-core": "1.0.0-rc.0"
45
+ "@hot-updater/core": "1.0.0-rc.14",
46
+ "@hot-updater/plugin-core": "1.0.0-rc.14"
47
47
  },
48
48
  "devDependencies": {
49
49
  "mime": "2.6.0",
50
50
  "@types/mime": "^2.0.3",
51
51
  "@types/node": "^20",
52
52
  "msw": "^2.7.0",
53
- "verkit": "0.3.2",
53
+ "verkit": "0.4.0",
54
54
  "vitest": "4.1.4"
55
55
  },
56
56
  "scripts": {