@hot-updater/cloudflare 0.36.6 → 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 +989 -11
- package/dist/iac/index.mjs +992 -15
- 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/index.d.cts
CHANGED
|
@@ -1,64 +1,28 @@
|
|
|
1
1
|
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
2
|
-
import {
|
|
2
|
+
import { StoragePluginWith } from "@hot-updater/plugin-core";
|
|
3
3
|
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
|
4
4
|
|
|
5
5
|
//#region src/d1Database.d.ts
|
|
6
6
|
interface D1DatabaseConfig {
|
|
7
|
-
databaseId: string;
|
|
8
|
-
accountId: string;
|
|
9
|
-
cloudflareApiToken: string;
|
|
7
|
+
readonly databaseId: string;
|
|
8
|
+
readonly accountId: string;
|
|
9
|
+
readonly cloudflareApiToken: string;
|
|
10
10
|
}
|
|
11
|
-
declare const d1Database: (config: D1DatabaseConfig
|
|
11
|
+
declare const d1Database: (config: D1DatabaseConfig) => _$_hot_updater_plugin_core0.DatabasePlugin;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/r2S3Storage.d.ts
|
|
14
14
|
interface R2S3StorageConfig extends S3ClientConfig {
|
|
15
15
|
accountId: string;
|
|
16
16
|
bucketName: string;
|
|
17
17
|
credentials: NonNullable<S3ClientConfig["credentials"]>;
|
|
18
|
-
/**
|
|
19
|
-
* Base path where bundles will be stored in the bucket
|
|
20
|
-
*/
|
|
18
|
+
/** Base path where bundles will be stored in the bucket. */
|
|
21
19
|
basePath?: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//#region src/r2WranglerStorage.d.ts
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated `cloudflareApiToken` uses the Wrangler CLI for R2 operations,
|
|
27
|
-
* which is slower than direct S3-compatible API access. Create R2
|
|
28
|
-
* S3-compatible credentials in the Cloudflare dashboard and pass them with
|
|
29
|
-
* `r2Storage({ credentials })` instead.
|
|
30
|
-
*/
|
|
31
|
-
interface R2WranglerStorageConfig {
|
|
32
|
-
accountId: string;
|
|
33
|
-
bucketName: string;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated This token keeps R2 access on the slower Wrangler CLI path.
|
|
36
|
-
* Create R2 S3-compatible credentials in the Cloudflare dashboard and use
|
|
37
|
-
* `credentials` instead.
|
|
38
|
-
*/
|
|
39
|
-
cloudflareApiToken: string;
|
|
40
|
-
/**
|
|
41
|
-
* Base path where bundles will be stored in the bucket
|
|
42
|
-
*/
|
|
43
|
-
basePath?: string;
|
|
44
|
-
credentials?: never;
|
|
20
|
+
/** Required when this storage serves downloads through createHotUpdater. */
|
|
21
|
+
downloadUrlSigningKey?: string;
|
|
45
22
|
}
|
|
46
23
|
//#endregion
|
|
47
24
|
//#region src/r2Storage.d.ts
|
|
48
|
-
type R2StorageConfig = R2S3StorageConfig
|
|
49
|
-
|
|
50
|
-
* Cloudflare R2 storage plugin for Hot Updater.
|
|
51
|
-
*/
|
|
52
|
-
interface R2Storage {
|
|
53
|
-
(config: R2S3StorageConfig, hooks?: StoragePluginHooks): () => UniversalStoragePlugin;
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated `cloudflareApiToken` uses the Wrangler CLI for R2 operations,
|
|
56
|
-
* which is slower than direct S3-compatible API access. Create R2
|
|
57
|
-
* S3-compatible credentials in the Cloudflare dashboard and pass them with
|
|
58
|
-
* `r2Storage({ credentials })` instead.
|
|
59
|
-
*/
|
|
60
|
-
(config: R2WranglerStorageConfig, hooks?: StoragePluginHooks): () => UniversalStoragePlugin;
|
|
61
|
-
}
|
|
62
|
-
declare const r2Storage: R2Storage;
|
|
25
|
+
type R2StorageConfig = R2S3StorageConfig;
|
|
26
|
+
declare const r2Storage: (config: R2S3StorageConfig) => StoragePluginWith<"put" | "get" | "exists" | "delete">;
|
|
63
27
|
//#endregion
|
|
64
|
-
export { D1DatabaseConfig, type R2S3StorageConfig, R2StorageConfig,
|
|
28
|
+
export { D1DatabaseConfig, type R2S3StorageConfig, R2StorageConfig, d1Database, r2Storage };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,64 +1,28 @@
|
|
|
1
1
|
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
2
|
-
import {
|
|
2
|
+
import { StoragePluginWith } from "@hot-updater/plugin-core";
|
|
3
3
|
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
|
4
4
|
|
|
5
5
|
//#region src/d1Database.d.ts
|
|
6
6
|
interface D1DatabaseConfig {
|
|
7
|
-
databaseId: string;
|
|
8
|
-
accountId: string;
|
|
9
|
-
cloudflareApiToken: string;
|
|
7
|
+
readonly databaseId: string;
|
|
8
|
+
readonly accountId: string;
|
|
9
|
+
readonly cloudflareApiToken: string;
|
|
10
10
|
}
|
|
11
|
-
declare const d1Database: (config: D1DatabaseConfig
|
|
11
|
+
declare const d1Database: (config: D1DatabaseConfig) => _$_hot_updater_plugin_core0.DatabasePlugin;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/r2S3Storage.d.ts
|
|
14
14
|
interface R2S3StorageConfig extends S3ClientConfig {
|
|
15
15
|
accountId: string;
|
|
16
16
|
bucketName: string;
|
|
17
17
|
credentials: NonNullable<S3ClientConfig["credentials"]>;
|
|
18
|
-
/**
|
|
19
|
-
* Base path where bundles will be stored in the bucket
|
|
20
|
-
*/
|
|
18
|
+
/** Base path where bundles will be stored in the bucket. */
|
|
21
19
|
basePath?: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//#region src/r2WranglerStorage.d.ts
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated `cloudflareApiToken` uses the Wrangler CLI for R2 operations,
|
|
27
|
-
* which is slower than direct S3-compatible API access. Create R2
|
|
28
|
-
* S3-compatible credentials in the Cloudflare dashboard and pass them with
|
|
29
|
-
* `r2Storage({ credentials })` instead.
|
|
30
|
-
*/
|
|
31
|
-
interface R2WranglerStorageConfig {
|
|
32
|
-
accountId: string;
|
|
33
|
-
bucketName: string;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated This token keeps R2 access on the slower Wrangler CLI path.
|
|
36
|
-
* Create R2 S3-compatible credentials in the Cloudflare dashboard and use
|
|
37
|
-
* `credentials` instead.
|
|
38
|
-
*/
|
|
39
|
-
cloudflareApiToken: string;
|
|
40
|
-
/**
|
|
41
|
-
* Base path where bundles will be stored in the bucket
|
|
42
|
-
*/
|
|
43
|
-
basePath?: string;
|
|
44
|
-
credentials?: never;
|
|
20
|
+
/** Required when this storage serves downloads through createHotUpdater. */
|
|
21
|
+
downloadUrlSigningKey?: string;
|
|
45
22
|
}
|
|
46
23
|
//#endregion
|
|
47
24
|
//#region src/r2Storage.d.ts
|
|
48
|
-
type R2StorageConfig = R2S3StorageConfig
|
|
49
|
-
|
|
50
|
-
* Cloudflare R2 storage plugin for Hot Updater.
|
|
51
|
-
*/
|
|
52
|
-
interface R2Storage {
|
|
53
|
-
(config: R2S3StorageConfig, hooks?: StoragePluginHooks): () => UniversalStoragePlugin;
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated `cloudflareApiToken` uses the Wrangler CLI for R2 operations,
|
|
56
|
-
* which is slower than direct S3-compatible API access. Create R2
|
|
57
|
-
* S3-compatible credentials in the Cloudflare dashboard and pass them with
|
|
58
|
-
* `r2Storage({ credentials })` instead.
|
|
59
|
-
*/
|
|
60
|
-
(config: R2WranglerStorageConfig, hooks?: StoragePluginHooks): () => UniversalStoragePlugin;
|
|
61
|
-
}
|
|
62
|
-
declare const r2Storage: R2Storage;
|
|
25
|
+
type R2StorageConfig = R2S3StorageConfig;
|
|
26
|
+
declare const r2Storage: (config: R2S3StorageConfig) => StoragePluginWith<"put" | "get" | "exists" | "delete">;
|
|
63
27
|
//#endregion
|
|
64
|
-
export { D1DatabaseConfig, type R2S3StorageConfig, R2StorageConfig,
|
|
28
|
+
export { D1DatabaseConfig, type R2S3StorageConfig, R2StorageConfig, d1Database, r2Storage };
|