@hot-updater/standalone 1.0.0-rc.1 → 1.0.0-rc.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.
- package/dist/index.cjs +11 -6
- package/dist/index.d.cts +4 -16
- package/dist/index.d.mts +4 -16
- package/dist/index.mjs +11 -6
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -102,9 +102,13 @@ const createBundleReads = (remote) => ({
|
|
|
102
102
|
});
|
|
103
103
|
if (remoteWindow) return remoteWindow.total;
|
|
104
104
|
}
|
|
105
|
-
|
|
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(
|
|
407
|
+
rows: await bundlesToRows(bundles),
|
|
403
408
|
total: value.pagination.total
|
|
404
409
|
};
|
|
405
410
|
};
|
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;
|
|
@@ -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;
|
|
@@ -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
|
-
|
|
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(
|
|
406
|
+
rows: await bundlesToRows(bundles),
|
|
402
407
|
total: value.pagination.total
|
|
403
408
|
};
|
|
404
409
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/standalone",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@hot-updater/core": "1.0.0-rc.0",
|
|
46
|
-
"@hot-updater/plugin-core": "1.0.0-rc.
|
|
46
|
+
"@hot-updater/plugin-core": "1.0.0-rc.3"
|
|
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.
|
|
53
|
+
"verkit": "0.4.0",
|
|
54
54
|
"vitest": "4.1.4"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|