@hot-updater/cloudflare 0.29.2 → 0.29.4
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/iac/index.cjs +6 -6
- package/dist/iac/index.mjs +29 -29
- package/dist/index.cjs +7 -13
- package/dist/index.mjs +19 -25
- package/dist/worker/index.cjs +5 -10
- package/dist/worker/index.mjs +5 -10
- package/package.json +8 -8
- package/src/cloudflareWorkerDatabase.ts +3 -13
- package/src/d1Database.spec.ts +126 -1
- package/src/d1Database.ts +6 -10
- package/src/r2Storage.ts +2 -1
- package/src/r2WorkerStorage.ts +2 -2
- package/src/worker/index.ts +6 -6
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +59 -42
- package/worker/dist/index.js.map +3 -3
- package/worker/src/getUpdateInfo.ts +6 -12
- package/worker/src/index.integration.spec.ts +2 -1
- package/worker/src/index.ts +1 -0
|
@@ -67,8 +67,7 @@ const appVersionStrategy = async (
|
|
|
67
67
|
cohort,
|
|
68
68
|
}: AppVersionGetBundlesArgs,
|
|
69
69
|
) => {
|
|
70
|
-
const appVersionList = await DB.prepare(
|
|
71
|
-
/* sql */ `
|
|
70
|
+
const appVersionList = await DB.prepare(/* sql */ `
|
|
72
71
|
SELECT
|
|
73
72
|
target_app_version
|
|
74
73
|
FROM bundles
|
|
@@ -78,8 +77,7 @@ const appVersionStrategy = async (
|
|
|
78
77
|
AND id >= ?
|
|
79
78
|
AND target_app_version IS NOT NULL
|
|
80
79
|
GROUP BY target_app_version
|
|
81
|
-
|
|
82
|
-
)
|
|
80
|
+
`)
|
|
83
81
|
.bind(platform, channel, minBundleId)
|
|
84
82
|
.all<{ target_app_version: string; count: number }>();
|
|
85
83
|
|
|
@@ -101,8 +99,7 @@ const appVersionStrategy = async (
|
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
const placeholders = targetAppVersionList.map(() => "?").join(", ");
|
|
104
|
-
const rows = await DB.prepare(
|
|
105
|
-
/* sql */ `
|
|
102
|
+
const rows = await DB.prepare(/* sql */ `
|
|
106
103
|
SELECT
|
|
107
104
|
id,
|
|
108
105
|
platform,
|
|
@@ -123,8 +120,7 @@ const appVersionStrategy = async (
|
|
|
123
120
|
AND id >= ?
|
|
124
121
|
AND channel = ?
|
|
125
122
|
AND target_app_version IN (${placeholders})
|
|
126
|
-
|
|
127
|
-
)
|
|
123
|
+
`)
|
|
128
124
|
.bind(platform, minBundleId, channel, ...targetAppVersionList)
|
|
129
125
|
.all<BundleRow>();
|
|
130
126
|
|
|
@@ -150,8 +146,7 @@ export const fingerprintStrategy = async (
|
|
|
150
146
|
cohort,
|
|
151
147
|
}: FingerprintGetBundlesArgs,
|
|
152
148
|
) => {
|
|
153
|
-
const rows = await DB.prepare(
|
|
154
|
-
/* sql */ `
|
|
149
|
+
const rows = await DB.prepare(/* sql */ `
|
|
155
150
|
SELECT
|
|
156
151
|
id,
|
|
157
152
|
platform,
|
|
@@ -172,8 +167,7 @@ export const fingerprintStrategy = async (
|
|
|
172
167
|
AND id >= ?
|
|
173
168
|
AND channel = ?
|
|
174
169
|
AND fingerprint_hash = ?
|
|
175
|
-
|
|
176
|
-
)
|
|
170
|
+
`)
|
|
177
171
|
.bind(platform, minBundleId, channel, fingerprintHash)
|
|
178
172
|
.all<BundleRow>();
|
|
179
173
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { env } from "cloudflare:test";
|
|
2
1
|
import { type Bundle, type GetBundlesArgs, NIL_UUID } from "@hot-updater/core";
|
|
3
2
|
import { setupGetUpdateInfoTestSuite } from "@hot-updater/test-utils";
|
|
3
|
+
import { env } from "cloudflare:test";
|
|
4
4
|
import { beforeAll, beforeEach, describe, expect, inject, it } from "vitest";
|
|
5
|
+
|
|
5
6
|
import worker, { HOT_UPDATER_BASE_PATH } from "./index";
|
|
6
7
|
|
|
7
8
|
declare module "vitest" {
|