@hot-updater/aws 0.36.7 → 1.0.0-rc.1
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 +2670 -824
- package/dist/iac/index.d.cts +15 -1
- package/dist/iac/index.d.mts +15 -1
- package/dist/iac/index.mjs +2669 -825
- package/dist/index.cjs +1916 -1853
- package/dist/index.d.cts +37 -46
- package/dist/index.d.mts +39 -47
- package/dist/index.mjs +1916 -1828
- package/dist/init/index.cjs +13 -13
- package/dist/init/index.d.cts +13 -13
- package/dist/init/index.d.mts +13 -13
- package/dist/init/index.mjs +13 -13
- package/dist/lambda/index.cjs +6473 -4313
- package/dist/lambda/index.d.cts +4 -4
- package/package.json +9 -9
package/dist/index.d.cts
CHANGED
|
@@ -1,44 +1,19 @@
|
|
|
1
1
|
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
2
|
-
import {
|
|
2
|
+
import { StoragePlugin, StoragePluginWith } from "@hot-updater/plugin-core";
|
|
3
|
+
import { DynamoDBClientConfig } from "@aws-sdk/client-dynamodb";
|
|
3
4
|
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
|
4
5
|
|
|
5
|
-
//#region src/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* CloudFront distribution ID used for cache invalidation.
|
|
14
|
-
*
|
|
15
|
-
* If omitted or an empty string, CloudFront invalidation is skipped.
|
|
16
|
-
* This is useful for local development environments (e.g. Localstack)
|
|
17
|
-
* where CloudFront is not available.
|
|
18
|
-
*/
|
|
19
|
-
cloudfrontDistributionId?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Wait for CloudFront invalidations to reach `Completed` before finishing.
|
|
22
|
-
*
|
|
23
|
-
* When enabled, invalidation failures and timeouts are surfaced to callers
|
|
24
|
-
* instead of being logged and ignored.
|
|
25
|
-
*/
|
|
26
|
-
shouldWaitForInvalidation?: boolean;
|
|
27
|
-
apiBasePath?: string;
|
|
6
|
+
//#region src/dynamoDB.d.ts
|
|
7
|
+
declare const DYNAMODB_UPDATE_INDEX_NAME = "hot-updater-update-index";
|
|
8
|
+
interface DynamoDBConfig extends DynamoDBClientConfig {
|
|
9
|
+
readonly apiBasePath?: string;
|
|
10
|
+
readonly cloudfrontDistributionId?: string;
|
|
11
|
+
readonly shouldWaitForInvalidation?: boolean;
|
|
12
|
+
readonly tableName: string;
|
|
28
13
|
}
|
|
29
|
-
declare const
|
|
14
|
+
declare const dynamoDB: (config: DynamoDBConfig) => _$_hot_updater_plugin_core0.DatabasePlugin;
|
|
30
15
|
//#endregion
|
|
31
|
-
//#region src/
|
|
32
|
-
interface S3StorageConfig extends S3ClientConfig {
|
|
33
|
-
bucketName: string;
|
|
34
|
-
/**
|
|
35
|
-
* Base path where bundles will be stored in the bucket
|
|
36
|
-
*/
|
|
37
|
-
basePath?: string;
|
|
38
|
-
}
|
|
39
|
-
declare const s3Storage: (config: S3StorageConfig, hooks?: _$_hot_updater_plugin_core0.StoragePluginHooks) => () => _$_hot_updater_plugin_core0.UniversalStoragePlugin<unknown>;
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/withCloudFrontSignedUrl.d.ts
|
|
16
|
+
//#region src/cloudFrontDownloadUrl.d.ts
|
|
42
17
|
interface CloudFrontPrivateKeyFromGetter {
|
|
43
18
|
getPrivateKey: () => Promise<string>;
|
|
44
19
|
ssmParameterName?: never;
|
|
@@ -49,18 +24,34 @@ interface CloudFrontPrivateKeyFromSsm {
|
|
|
49
24
|
ssmParameterName: string;
|
|
50
25
|
ssmRegion: string;
|
|
51
26
|
}
|
|
52
|
-
type
|
|
53
|
-
type CloudFrontSignedUrlConfig = CloudFrontPrivateKeyFromGetter | CloudFrontPrivateKeyFromSsm;
|
|
54
|
-
type WithCloudFrontSignedUrlOptions<TContext = unknown> = CloudFrontSignedUrlConfig & {
|
|
27
|
+
type CloudFrontDownloadUrlOptions = (CloudFrontPrivateKeyFromGetter | CloudFrontPrivateKeyFromSsm) & {
|
|
55
28
|
keyPairId: string;
|
|
56
|
-
publicBaseUrl: string
|
|
29
|
+
publicBaseUrl: string;
|
|
57
30
|
expiresSeconds?: number;
|
|
58
31
|
};
|
|
59
|
-
declare const
|
|
32
|
+
declare const cloudFrontDownloadUrl: (config: CloudFrontDownloadUrlOptions) => ({
|
|
33
|
+
storageUri
|
|
34
|
+
}: {
|
|
35
|
+
storageUri: string;
|
|
36
|
+
}) => Promise<{
|
|
37
|
+
url: string;
|
|
38
|
+
}>;
|
|
60
39
|
//#endregion
|
|
61
|
-
//#region src/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
//#region src/s3Storage.d.ts
|
|
41
|
+
interface S3StorageConfig extends S3ClientConfig {
|
|
42
|
+
bucketName: string;
|
|
43
|
+
/** Base path where bundles will be stored in the bucket. */
|
|
44
|
+
basePath?: string;
|
|
45
|
+
downloadUrlSigningKey?: string;
|
|
46
|
+
getDownloadUrl?: StoragePlugin["getDownloadUrl"];
|
|
47
|
+
}
|
|
48
|
+
type S3StorageConfigWithDownloadUrl = S3StorageConfig & ({
|
|
49
|
+
downloadUrlSigningKey: string;
|
|
50
|
+
} | {
|
|
51
|
+
getDownloadUrl: NonNullable<StoragePlugin["getDownloadUrl"]>;
|
|
52
|
+
});
|
|
53
|
+
type S3StorageOperations = "put" | "get" | "exists" | "delete" | "listObjects" | "deleteObjects";
|
|
54
|
+
declare function s3Storage(config: S3StorageConfigWithDownloadUrl): StoragePluginWith<S3StorageOperations | "getDownloadUrl">;
|
|
55
|
+
declare function s3Storage(config: S3StorageConfig): StoragePluginWith<S3StorageOperations>;
|
|
65
56
|
//#endregion
|
|
66
|
-
export {
|
|
57
|
+
export { CloudFrontDownloadUrlOptions, DYNAMODB_UPDATE_INDEX_NAME, type DynamoDBConfig, S3StorageConfig, S3StorageConfigWithDownloadUrl, cloudFrontDownloadUrl, dynamoDB, s3Storage };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,44 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DynamoDBClientConfig } from "@aws-sdk/client-dynamodb";
|
|
2
|
+
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
|
|
2
3
|
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
3
|
-
import {
|
|
4
|
+
import { StoragePlugin, StoragePluginWith } from "@hot-updater/plugin-core";
|
|
5
|
+
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
|
4
6
|
|
|
5
|
-
//#region src/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* CloudFront distribution ID used for cache invalidation.
|
|
14
|
-
*
|
|
15
|
-
* If omitted or an empty string, CloudFront invalidation is skipped.
|
|
16
|
-
* This is useful for local development environments (e.g. Localstack)
|
|
17
|
-
* where CloudFront is not available.
|
|
18
|
-
*/
|
|
19
|
-
cloudfrontDistributionId?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Wait for CloudFront invalidations to reach `Completed` before finishing.
|
|
22
|
-
*
|
|
23
|
-
* When enabled, invalidation failures and timeouts are surfaced to callers
|
|
24
|
-
* instead of being logged and ignored.
|
|
25
|
-
*/
|
|
26
|
-
shouldWaitForInvalidation?: boolean;
|
|
27
|
-
apiBasePath?: string;
|
|
7
|
+
//#region src/dynamoDB.d.ts
|
|
8
|
+
declare const DYNAMODB_UPDATE_INDEX_NAME = "hot-updater-update-index";
|
|
9
|
+
interface DynamoDBConfig extends DynamoDBClientConfig {
|
|
10
|
+
readonly apiBasePath?: string;
|
|
11
|
+
readonly cloudfrontDistributionId?: string;
|
|
12
|
+
readonly shouldWaitForInvalidation?: boolean;
|
|
13
|
+
readonly tableName: string;
|
|
28
14
|
}
|
|
29
|
-
declare const
|
|
15
|
+
declare const dynamoDB: (config: DynamoDBConfig) => _$_hot_updater_plugin_core0.DatabasePlugin;
|
|
30
16
|
//#endregion
|
|
31
|
-
//#region src/
|
|
32
|
-
interface S3StorageConfig extends S3ClientConfig {
|
|
33
|
-
bucketName: string;
|
|
34
|
-
/**
|
|
35
|
-
* Base path where bundles will be stored in the bucket
|
|
36
|
-
*/
|
|
37
|
-
basePath?: string;
|
|
38
|
-
}
|
|
39
|
-
declare const s3Storage: (config: S3StorageConfig, hooks?: _$_hot_updater_plugin_core0.StoragePluginHooks) => () => _$_hot_updater_plugin_core0.UniversalStoragePlugin<unknown>;
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/withCloudFrontSignedUrl.d.ts
|
|
17
|
+
//#region src/cloudFrontDownloadUrl.d.ts
|
|
42
18
|
interface CloudFrontPrivateKeyFromGetter {
|
|
43
19
|
getPrivateKey: () => Promise<string>;
|
|
44
20
|
ssmParameterName?: never;
|
|
@@ -49,18 +25,34 @@ interface CloudFrontPrivateKeyFromSsm {
|
|
|
49
25
|
ssmParameterName: string;
|
|
50
26
|
ssmRegion: string;
|
|
51
27
|
}
|
|
52
|
-
type
|
|
53
|
-
type CloudFrontSignedUrlConfig = CloudFrontPrivateKeyFromGetter | CloudFrontPrivateKeyFromSsm;
|
|
54
|
-
type WithCloudFrontSignedUrlOptions<TContext = unknown> = CloudFrontSignedUrlConfig & {
|
|
28
|
+
type CloudFrontDownloadUrlOptions = (CloudFrontPrivateKeyFromGetter | CloudFrontPrivateKeyFromSsm) & {
|
|
55
29
|
keyPairId: string;
|
|
56
|
-
publicBaseUrl: string
|
|
30
|
+
publicBaseUrl: string;
|
|
57
31
|
expiresSeconds?: number;
|
|
58
32
|
};
|
|
59
|
-
declare const
|
|
33
|
+
declare const cloudFrontDownloadUrl: (config: CloudFrontDownloadUrlOptions) => ({
|
|
34
|
+
storageUri
|
|
35
|
+
}: {
|
|
36
|
+
storageUri: string;
|
|
37
|
+
}) => Promise<{
|
|
38
|
+
url: string;
|
|
39
|
+
}>;
|
|
60
40
|
//#endregion
|
|
61
|
-
//#region src/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
41
|
+
//#region src/s3Storage.d.ts
|
|
42
|
+
interface S3StorageConfig extends S3ClientConfig {
|
|
43
|
+
bucketName: string;
|
|
44
|
+
/** Base path where bundles will be stored in the bucket. */
|
|
45
|
+
basePath?: string;
|
|
46
|
+
downloadUrlSigningKey?: string;
|
|
47
|
+
getDownloadUrl?: StoragePlugin["getDownloadUrl"];
|
|
48
|
+
}
|
|
49
|
+
type S3StorageConfigWithDownloadUrl = S3StorageConfig & ({
|
|
50
|
+
downloadUrlSigningKey: string;
|
|
51
|
+
} | {
|
|
52
|
+
getDownloadUrl: NonNullable<StoragePlugin["getDownloadUrl"]>;
|
|
53
|
+
});
|
|
54
|
+
type S3StorageOperations = "put" | "get" | "exists" | "delete" | "listObjects" | "deleteObjects";
|
|
55
|
+
declare function s3Storage(config: S3StorageConfigWithDownloadUrl): StoragePluginWith<S3StorageOperations | "getDownloadUrl">;
|
|
56
|
+
declare function s3Storage(config: S3StorageConfig): StoragePluginWith<S3StorageOperations>;
|
|
65
57
|
//#endregion
|
|
66
|
-
export {
|
|
58
|
+
export { CloudFrontDownloadUrlOptions, DYNAMODB_UPDATE_INDEX_NAME, type DynamoDBConfig, S3StorageConfig, S3StorageConfigWithDownloadUrl, cloudFrontDownloadUrl, dynamoDB, s3Storage };
|