@hot-updater/cloudflare 0.36.7 → 1.0.0-rc.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/iac/index.cjs +988 -10
- package/dist/iac/index.mjs +991 -14
- package/dist/index.cjs +919 -6989
- package/dist/index.d.cts +11 -47
- package/dist/index.d.mts +11 -47
- package/dist/index.mjs +917 -7006
- package/dist/worker/index.cjs +898 -336
- package/dist/worker/index.d.cts +18 -33
- package/dist/worker/index.d.mts +18 -33
- package/dist/worker/index.mjs +899 -331
- package/package.json +7 -10
- package/sql/bundles.sql +183 -35
- package/src/d1Database.spec.ts +143 -392
- package/src/d1Database.ts +55 -650
- package/src/d1Implementation.spec.ts +252 -0
- package/src/d1Implementation.ts +742 -0
- package/src/d1Query.spec.ts +46 -0
- package/src/d1Query.ts +89 -0
- package/src/d1Rows.spec.ts +111 -0
- package/src/d1Rows.ts +326 -0
- package/src/d1Sql.spec.ts +30 -0
- package/src/d1Sql.ts +175 -0
- package/src/r2S3Storage.ts +93 -137
- package/src/r2Storage.spec.ts +120 -218
- package/src/r2Storage.ts +13 -61
- package/src/r2WorkerStorage.spec.ts +161 -50
- package/src/r2WorkerStorage.ts +85 -118
- package/src/worker/d1Database.spec.ts +33 -0
- package/src/worker/d1Database.ts +52 -0
- package/src/worker/index.ts +3 -31
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +5968 -4701
- package/worker/dist/index.js.map +4 -4
- package/worker/migrations/0001_hot-updater_1.0.0.sql +197 -0
- package/worker/migrations/0002_hot-updater_artifact_byte_sizes.sql +11 -0
- package/worker/src/databaseMigration.integration.spec.ts +114 -0
- package/worker/src/databasePlugins.integration.spec.ts +292 -0
- package/worker/src/index.integration.spec.ts +102 -294
- package/worker/src/index.ts +14 -66
- package/worker/src/storagePlugin.integration.spec.ts +59 -0
- package/worker/wrangler.json +5 -2
- package/src/cloudflareWorkerDatabase.spec.ts +0 -260
- package/src/cloudflareWorkerDatabase.ts +0 -651
- package/src/r2WranglerStorage.ts +0 -193
- package/worker/migrations/0001_hot-updater_init.sql +0 -16
- package/worker/migrations/0002_hot-updater_0.13.0.sql +0 -8
- package/worker/migrations/0003_hot-updater_0.18.0.sql +0 -38
- package/worker/migrations/0004_hot-updater_0.29.0.sql +0 -11
- package/worker/migrations/0005_hot-updater_0.31.0.sql +0 -24
package/dist/worker/index.d.cts
CHANGED
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
2
|
-
import {
|
|
3
|
-
import { verifyJwtSignedUrl } from "@hot-updater/js";
|
|
2
|
+
import { StoragePluginWith } from "@hot-updater/plugin-core";
|
|
4
3
|
|
|
5
|
-
//#region src/
|
|
6
|
-
type D1Result
|
|
7
|
-
results?:
|
|
4
|
+
//#region src/worker/d1Database.d.ts
|
|
5
|
+
type D1Result = {
|
|
6
|
+
readonly results?: readonly unknown[];
|
|
7
|
+
};
|
|
8
|
+
type D1BoundStatement = {
|
|
9
|
+
all: () => Promise<D1Result>;
|
|
8
10
|
};
|
|
9
11
|
type D1PreparedStatement = {
|
|
10
|
-
bind: (...values: unknown[]) =>
|
|
11
|
-
all: <T>() => Promise<D1Result<T>>;
|
|
12
|
-
first: <T>() => Promise<T | null>;
|
|
13
|
-
run: () => Promise<unknown>;
|
|
14
|
-
};
|
|
12
|
+
bind: (...values: readonly unknown[]) => D1BoundStatement;
|
|
15
13
|
};
|
|
16
14
|
type D1Like = {
|
|
17
|
-
prepare
|
|
15
|
+
prepare(sql: string): D1PreparedStatement;
|
|
16
|
+
batch(statements: D1BoundStatement[]): Promise<readonly D1Result[]>;
|
|
18
17
|
};
|
|
19
|
-
|
|
20
|
-
DB: D1Like;
|
|
21
|
-
}
|
|
18
|
+
declare const d1Database: (database: D1Like) => _$_hot_updater_plugin_core0.DatabasePlugin;
|
|
22
19
|
//#endregion
|
|
23
20
|
//#region src/r2WorkerStorage.d.ts
|
|
24
|
-
interface
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} | null>;
|
|
30
|
-
};
|
|
21
|
+
interface CloudflareWorkerStorageConfig {
|
|
22
|
+
readonly bucket: R2Bucket;
|
|
23
|
+
readonly bucketName: string;
|
|
24
|
+
readonly basePath?: string;
|
|
25
|
+
readonly downloadUrlSigningKey: string;
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
interface CloudflareWorkerStorageConfig<TContext extends RequestEnvContext$1<CloudflareWorkerStorageEnv>> {
|
|
34
|
-
jwtSecret?: string | ContextResolver<TContext, string>;
|
|
35
|
-
publicBaseUrl: string | ContextResolver<TContext, string>;
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/worker/index.d.ts
|
|
39
|
-
interface CloudflareWorkerRuntimeEnv extends CloudflareWorkerDatabaseEnv, CloudflareWorkerStorageEnv {}
|
|
40
|
-
type RequestEnvContext<TEnv = CloudflareWorkerRuntimeEnv> = RequestEnvContext$1<TEnv>;
|
|
41
|
-
declare const d1Database: <TContext extends RequestEnvContext<CloudflareWorkerRuntimeEnv> = RequestEnvContext<CloudflareWorkerRuntimeEnv>>() => () => _$_hot_updater_plugin_core0.DatabasePlugin<TContext>;
|
|
42
|
-
declare const r2Storage: <TContext extends RequestEnvContext<CloudflareWorkerRuntimeEnv> = RequestEnvContext<CloudflareWorkerRuntimeEnv>>(config: CloudflareWorkerStorageConfig<TContext>) => () => _$_hot_updater_plugin_core0.RuntimeStoragePlugin<TContext>;
|
|
27
|
+
declare const r2WorkerStorage: (config: CloudflareWorkerStorageConfig) => StoragePluginWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
43
28
|
//#endregion
|
|
44
|
-
export { type
|
|
29
|
+
export { type CloudflareWorkerStorageConfig, type D1Like, d1Database, r2WorkerStorage as r2Storage };
|
package/dist/worker/index.d.mts
CHANGED
|
@@ -1,44 +1,29 @@
|
|
|
1
|
-
import { verifyJwtSignedUrl } from "@hot-updater/js";
|
|
2
1
|
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
3
|
-
import {
|
|
2
|
+
import { StoragePluginWith } from "@hot-updater/plugin-core";
|
|
4
3
|
|
|
5
|
-
//#region src/
|
|
6
|
-
type D1Result
|
|
7
|
-
results?:
|
|
4
|
+
//#region src/worker/d1Database.d.ts
|
|
5
|
+
type D1Result = {
|
|
6
|
+
readonly results?: readonly unknown[];
|
|
7
|
+
};
|
|
8
|
+
type D1BoundStatement = {
|
|
9
|
+
all: () => Promise<D1Result>;
|
|
8
10
|
};
|
|
9
11
|
type D1PreparedStatement = {
|
|
10
|
-
bind: (...values: unknown[]) =>
|
|
11
|
-
all: <T>() => Promise<D1Result<T>>;
|
|
12
|
-
first: <T>() => Promise<T | null>;
|
|
13
|
-
run: () => Promise<unknown>;
|
|
14
|
-
};
|
|
12
|
+
bind: (...values: readonly unknown[]) => D1BoundStatement;
|
|
15
13
|
};
|
|
16
14
|
type D1Like = {
|
|
17
|
-
prepare
|
|
15
|
+
prepare(sql: string): D1PreparedStatement;
|
|
16
|
+
batch(statements: D1BoundStatement[]): Promise<readonly D1Result[]>;
|
|
18
17
|
};
|
|
19
|
-
|
|
20
|
-
DB: D1Like;
|
|
21
|
-
}
|
|
18
|
+
declare const d1Database: (database: D1Like) => _$_hot_updater_plugin_core0.DatabasePlugin;
|
|
22
19
|
//#endregion
|
|
23
20
|
//#region src/r2WorkerStorage.d.ts
|
|
24
|
-
interface
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} | null>;
|
|
30
|
-
};
|
|
21
|
+
interface CloudflareWorkerStorageConfig {
|
|
22
|
+
readonly bucket: R2Bucket;
|
|
23
|
+
readonly bucketName: string;
|
|
24
|
+
readonly basePath?: string;
|
|
25
|
+
readonly downloadUrlSigningKey: string;
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
interface CloudflareWorkerStorageConfig<TContext extends RequestEnvContext$1<CloudflareWorkerStorageEnv>> {
|
|
34
|
-
jwtSecret?: string | ContextResolver<TContext, string>;
|
|
35
|
-
publicBaseUrl: string | ContextResolver<TContext, string>;
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/worker/index.d.ts
|
|
39
|
-
interface CloudflareWorkerRuntimeEnv extends CloudflareWorkerDatabaseEnv, CloudflareWorkerStorageEnv {}
|
|
40
|
-
type RequestEnvContext<TEnv = CloudflareWorkerRuntimeEnv> = RequestEnvContext$1<TEnv>;
|
|
41
|
-
declare const d1Database: <TContext extends RequestEnvContext<CloudflareWorkerRuntimeEnv> = RequestEnvContext<CloudflareWorkerRuntimeEnv>>() => () => _$_hot_updater_plugin_core0.DatabasePlugin<TContext>;
|
|
42
|
-
declare const r2Storage: <TContext extends RequestEnvContext<CloudflareWorkerRuntimeEnv> = RequestEnvContext<CloudflareWorkerRuntimeEnv>>(config: CloudflareWorkerStorageConfig<TContext>) => () => _$_hot_updater_plugin_core0.RuntimeStoragePlugin<TContext>;
|
|
27
|
+
declare const r2WorkerStorage: (config: CloudflareWorkerStorageConfig) => StoragePluginWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
43
28
|
//#endregion
|
|
44
|
-
export { type
|
|
29
|
+
export { type CloudflareWorkerStorageConfig, type D1Like, d1Database, r2WorkerStorage as r2Storage };
|