@hot-updater/cloudflare 1.0.0-rc.5 → 1.0.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 +90 -924
- package/dist/index.d.cts +16 -6
- package/dist/index.d.mts +16 -6
- package/dist/index.mjs +91 -926
- package/dist/init/index.cjs +11777 -0
- package/dist/init/index.d.cts +5 -1
- package/dist/init/index.d.mts +5 -1
- package/dist/init/index.mjs +11771 -1
- package/dist/worker/index.cjs +117 -916
- package/dist/worker/index.d.cts +45 -11
- package/dist/worker/index.d.mts +45 -11
- package/dist/worker/index.mjs +118 -917
- package/package.json +9 -14
- package/sql/bundles.sql +121 -212
- package/src/d1Database.ts +58 -43
- package/src/d1Executor.ts +84 -0
- package/src/d1Schema.ts +26 -0
- package/src/presignR2Url.ts +103 -0
- package/src/r2S3Storage.ts +20 -19
- package/src/r2Storage.ts +5 -3
- package/src/r2WorkerStorage.ts +55 -17
- package/src/worker/d1Database.ts +21 -39
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +9859 -5696
- package/worker/dist/index.js.map +4 -4
- package/worker/migrations/0001_hot-updater_1.0.0.sql +121 -222
- package/worker/src/index.ts +15 -9
- package/worker/wrangler.json +1 -0
- package/dist/iac/index.cjs +0 -12687
- package/dist/iac/index.d.cts +0 -5
- package/dist/iac/index.d.mts +0 -5
- package/dist/iac/index.mjs +0 -12679
- package/src/d1Database.spec.ts +0 -277
- package/src/d1Implementation.spec.ts +0 -342
- package/src/d1Implementation.ts +0 -781
- package/src/d1Query.spec.ts +0 -46
- package/src/d1Query.ts +0 -92
- package/src/d1Rows.spec.ts +0 -143
- package/src/d1Rows.ts +0 -357
- package/src/d1Sql.spec.ts +0 -30
- package/src/d1Sql.ts +0 -175
- package/src/r2Storage.spec.ts +0 -346
- package/src/r2WorkerStorage.spec.ts +0 -184
- package/src/utils/createWrangler.spec.ts +0 -75
- package/src/worker/d1Database.spec.ts +0 -69
- package/worker/src/databaseMigration.integration.spec.ts +0 -191
- package/worker/src/databasePlugins.integration.spec.ts +0 -326
- package/worker/src/index.integration.spec.ts +0 -190
- package/worker/src/insightsMovement.integration.spec.ts +0 -73
- package/worker/src/storagePlugin.integration.spec.ts +0 -59
- package/worker/src/testWorker.ts +0 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StorageAdapterWith, ToolingDatabase } from "@hot-updater/plugin-core";
|
|
2
2
|
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
|
3
|
+
//#region src/d1Executor.d.ts
|
|
4
|
+
declare class D1ExecutionError extends Error {
|
|
5
|
+
readonly name = "D1ExecutionError";
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
3
9
|
//#region src/d1Database.d.ts
|
|
4
10
|
interface D1DatabaseConfig {
|
|
5
11
|
readonly databaseId: string;
|
|
6
12
|
readonly accountId: string;
|
|
7
13
|
readonly cloudflareApiToken: string;
|
|
8
14
|
}
|
|
9
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Hot Updater's database on D1 through the Cloudflare REST API, for the CLI
|
|
17
|
+
* and console. `hot-updater db generate` writes a D1 migration of the built-in
|
|
18
|
+
* tables and the server's plugin tables to `migrations`, and
|
|
19
|
+
* `hot-updater db migrate` applies them through the API.
|
|
20
|
+
*/
|
|
21
|
+
declare const d1Database: (config: D1DatabaseConfig) => ToolingDatabase;
|
|
10
22
|
//#endregion
|
|
11
23
|
//#region src/r2S3Storage.d.ts
|
|
12
24
|
interface R2S3StorageConfig extends S3ClientConfig {
|
|
@@ -15,12 +27,10 @@ interface R2S3StorageConfig extends S3ClientConfig {
|
|
|
15
27
|
credentials: NonNullable<S3ClientConfig["credentials"]>;
|
|
16
28
|
/** Base path where bundles will be stored in the bucket. */
|
|
17
29
|
basePath?: string;
|
|
18
|
-
/** Required when this storage serves downloads through createHotUpdater. */
|
|
19
|
-
downloadUrlSigningKey?: string;
|
|
20
30
|
}
|
|
21
31
|
//#endregion
|
|
22
32
|
//#region src/r2Storage.d.ts
|
|
23
33
|
type R2StorageConfig = R2S3StorageConfig;
|
|
24
|
-
declare const r2Storage: (config: R2S3StorageConfig) =>
|
|
34
|
+
declare const r2Storage: (config: R2S3StorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
25
35
|
//#endregion
|
|
26
|
-
export { D1DatabaseConfig, type R2S3StorageConfig, R2StorageConfig, d1Database, r2Storage };
|
|
36
|
+
export { D1DatabaseConfig, D1ExecutionError, type R2S3StorageConfig, R2StorageConfig, d1Database, r2Storage };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StorageAdapterWith, ToolingDatabase } from "@hot-updater/plugin-core";
|
|
2
2
|
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
|
3
|
+
//#region src/d1Executor.d.ts
|
|
4
|
+
declare class D1ExecutionError extends Error {
|
|
5
|
+
readonly name = "D1ExecutionError";
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
3
9
|
//#region src/d1Database.d.ts
|
|
4
10
|
interface D1DatabaseConfig {
|
|
5
11
|
readonly databaseId: string;
|
|
6
12
|
readonly accountId: string;
|
|
7
13
|
readonly cloudflareApiToken: string;
|
|
8
14
|
}
|
|
9
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Hot Updater's database on D1 through the Cloudflare REST API, for the CLI
|
|
17
|
+
* and console. `hot-updater db generate` writes a D1 migration of the built-in
|
|
18
|
+
* tables and the server's plugin tables to `migrations`, and
|
|
19
|
+
* `hot-updater db migrate` applies them through the API.
|
|
20
|
+
*/
|
|
21
|
+
declare const d1Database: (config: D1DatabaseConfig) => ToolingDatabase;
|
|
10
22
|
//#endregion
|
|
11
23
|
//#region src/r2S3Storage.d.ts
|
|
12
24
|
interface R2S3StorageConfig extends S3ClientConfig {
|
|
@@ -15,12 +27,10 @@ interface R2S3StorageConfig extends S3ClientConfig {
|
|
|
15
27
|
credentials: NonNullable<S3ClientConfig["credentials"]>;
|
|
16
28
|
/** Base path where bundles will be stored in the bucket. */
|
|
17
29
|
basePath?: string;
|
|
18
|
-
/** Required when this storage serves downloads through createHotUpdater. */
|
|
19
|
-
downloadUrlSigningKey?: string;
|
|
20
30
|
}
|
|
21
31
|
//#endregion
|
|
22
32
|
//#region src/r2Storage.d.ts
|
|
23
33
|
type R2StorageConfig = R2S3StorageConfig;
|
|
24
|
-
declare const r2Storage: (config: R2S3StorageConfig) =>
|
|
34
|
+
declare const r2Storage: (config: R2S3StorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
25
35
|
//#endregion
|
|
26
|
-
export { D1DatabaseConfig, type R2S3StorageConfig, R2StorageConfig, d1Database, r2Storage };
|
|
36
|
+
export { D1DatabaseConfig, D1ExecutionError, type R2S3StorageConfig, R2StorageConfig, d1Database, r2Storage };
|