@hot-updater/aws 1.0.0-rc.2 → 1.0.0-rc.21
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 +320 -1938
- package/dist/index.d.cts +734 -10
- package/dist/index.d.mts +734 -10
- package/dist/index.mjs +320 -1939
- package/dist/init/index.cjs +8536 -4
- package/dist/init/index.d.cts +124 -3
- package/dist/init/index.d.mts +124 -3
- package/dist/init/index.mjs +8523 -1
- package/dist/lambda/index.cjs +11617 -8579
- package/dist/lambda/index.d.cts +344 -1
- package/package.json +7 -13
- package/dist/iac/index.cjs +0 -10287
- package/dist/iac/index.d.cts +0 -19
- package/dist/iac/index.d.mts +0 -19
- package/dist/iac/index.mjs +0 -10280
package/dist/init/index.d.cts
CHANGED
|
@@ -1,10 +1,119 @@
|
|
|
1
|
+
import { RunInitOptions } from "@hot-updater/cli-tools";
|
|
2
|
+
//#region iac/dynamodb.d.ts
|
|
3
|
+
declare const buildDynamoDBCreateTableInput: (tableName: string) => {
|
|
4
|
+
AttributeDefinitions: {
|
|
5
|
+
AttributeName: string;
|
|
6
|
+
AttributeType: "S";
|
|
7
|
+
}[];
|
|
8
|
+
BillingMode: "PAY_PER_REQUEST";
|
|
9
|
+
DeletionProtectionEnabled: true;
|
|
10
|
+
KeySchema: ({
|
|
11
|
+
readonly AttributeName: "pk";
|
|
12
|
+
readonly KeyType: "HASH";
|
|
13
|
+
} | {
|
|
14
|
+
readonly AttributeName: "sk";
|
|
15
|
+
readonly KeyType: "RANGE";
|
|
16
|
+
})[];
|
|
17
|
+
OnDemandThroughput: {
|
|
18
|
+
readonly MaxReadRequestUnits: 4000;
|
|
19
|
+
readonly MaxWriteRequestUnits: 100;
|
|
20
|
+
};
|
|
21
|
+
TableName: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The schema settings items of core and the managed server's plugins, which
|
|
25
|
+
* the database checks before its first read, as one BatchWriteItem request:
|
|
26
|
+
* what `migrateDynamoDB` writes to a new table for those plugins.
|
|
27
|
+
*/
|
|
28
|
+
declare const buildDynamoDBSchemaSettingsInput: (tableName: string) => {
|
|
29
|
+
RequestItems: {
|
|
30
|
+
[x: string]: {
|
|
31
|
+
PutRequest: {
|
|
32
|
+
Item: {
|
|
33
|
+
pk: {
|
|
34
|
+
S: string;
|
|
35
|
+
};
|
|
36
|
+
sk: {
|
|
37
|
+
S: string;
|
|
38
|
+
};
|
|
39
|
+
key: {
|
|
40
|
+
S: string;
|
|
41
|
+
};
|
|
42
|
+
value: {
|
|
43
|
+
S: string;
|
|
44
|
+
};
|
|
45
|
+
_v: {
|
|
46
|
+
N: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
declare const buildDynamoDBBackupInput: (tableName: string) => {
|
|
54
|
+
PointInTimeRecoverySpecification: {
|
|
55
|
+
PointInTimeRecoveryEnabled: true;
|
|
56
|
+
};
|
|
57
|
+
TableName: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Turns on the table's TTL, which deletes expired items for free: the store
|
|
61
|
+
* writes `_ttl`, in epoch seconds, on every item of a row with retention.
|
|
62
|
+
*/
|
|
63
|
+
declare const buildDynamoDBTimeToLiveInput: (tableName: string) => {
|
|
64
|
+
TableName: string;
|
|
65
|
+
TimeToLiveSpecification: {
|
|
66
|
+
AttributeName: string;
|
|
67
|
+
Enabled: true;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region iac/iam.d.ts
|
|
72
|
+
declare const buildDynamoDBPolicy: (region: string, accountId: string, tableName: string) => {
|
|
73
|
+
Version: string;
|
|
74
|
+
Statement: {
|
|
75
|
+
Action: string[];
|
|
76
|
+
Condition: {
|
|
77
|
+
"ForAllValues:StringLike": {
|
|
78
|
+
"dynamodb:LeadingKeys": string[];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
Effect: string;
|
|
82
|
+
Resource: string[];
|
|
83
|
+
}[];
|
|
84
|
+
};
|
|
85
|
+
declare const buildS3Policy: (bucketName: string) => {
|
|
86
|
+
Version: string;
|
|
87
|
+
Statement: {
|
|
88
|
+
Action: string[];
|
|
89
|
+
Effect: string;
|
|
90
|
+
Resource: string[];
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
declare const buildSsmPolicy: (region: string, accountId: string, parameterName: string) => {
|
|
94
|
+
Version: string;
|
|
95
|
+
Statement: {
|
|
96
|
+
Effect: string;
|
|
97
|
+
Action: string[];
|
|
98
|
+
Resource: string;
|
|
99
|
+
}[];
|
|
100
|
+
};
|
|
101
|
+
declare const LAMBDA_EDGE_TRUST_POLICY: {
|
|
102
|
+
Version: string;
|
|
103
|
+
Statement: {
|
|
104
|
+
Effect: string;
|
|
105
|
+
Principal: {
|
|
106
|
+
Service: string[];
|
|
107
|
+
};
|
|
108
|
+
Action: string;
|
|
109
|
+
}[];
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
1
112
|
//#region iac/init/index.d.ts
|
|
2
113
|
declare const AWS_AUTH_MODES: readonly ["local-session", "shared-profile", "sso", "account"];
|
|
3
114
|
type AwsAuthMode = (typeof AWS_AUTH_MODES)[number];
|
|
4
|
-
declare const isAwsAuthMode: (value: string | undefined) => value is AwsAuthMode;
|
|
5
115
|
declare const AWS_REGION_VALUES: readonly ["af-south-1", "ap-east-1", "ap-east-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", "ap-southeast-5", "ap-southeast-6", "ap-southeast-7", "ca-central-1", "ca-west-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", "il-central-1", "me-central-1", "me-south-1", "mx-central-1", "sa-east-1", "us-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-1", "us-west-1", "us-west-2"];
|
|
6
116
|
type AwsRegionValue = (typeof AWS_REGION_VALUES)[number];
|
|
7
|
-
declare const isAwsRegionValue: (value: string | undefined) => value is AwsRegionValue;
|
|
8
117
|
declare const initProvider: {
|
|
9
118
|
readonly label: "AWS + Lambda@Edge";
|
|
10
119
|
readonly inputs: {
|
|
@@ -99,4 +208,16 @@ declare const initProvider: {
|
|
|
99
208
|
};
|
|
100
209
|
};
|
|
101
210
|
//#endregion
|
|
102
|
-
|
|
211
|
+
//#region iac/index.d.ts
|
|
212
|
+
declare const prepareDynamoDBDeployment: (input: {
|
|
213
|
+
readonly credentials: {
|
|
214
|
+
readonly accessKeyId: string;
|
|
215
|
+
readonly secretAccessKey: string;
|
|
216
|
+
readonly sessionToken?: string;
|
|
217
|
+
};
|
|
218
|
+
readonly region: string;
|
|
219
|
+
readonly tableName: string;
|
|
220
|
+
}) => Promise<void>;
|
|
221
|
+
declare const runInit: ({ build, envFile }: RunInitOptions) => Promise<void>;
|
|
222
|
+
//#endregion
|
|
223
|
+
export { LAMBDA_EDGE_TRUST_POLICY, buildDynamoDBBackupInput, buildDynamoDBCreateTableInput, buildDynamoDBPolicy, buildDynamoDBSchemaSettingsInput, buildDynamoDBTimeToLiveInput, buildS3Policy, buildSsmPolicy, initProvider, prepareDynamoDBDeployment, runInit };
|
package/dist/init/index.d.mts
CHANGED
|
@@ -1,10 +1,119 @@
|
|
|
1
|
+
import { InitError, RunInitOptions } from "@hot-updater/cli-tools";
|
|
2
|
+
//#region iac/dynamodb.d.ts
|
|
3
|
+
declare const buildDynamoDBCreateTableInput: (tableName: string) => {
|
|
4
|
+
AttributeDefinitions: {
|
|
5
|
+
AttributeName: string;
|
|
6
|
+
AttributeType: "S";
|
|
7
|
+
}[];
|
|
8
|
+
BillingMode: "PAY_PER_REQUEST";
|
|
9
|
+
DeletionProtectionEnabled: true;
|
|
10
|
+
KeySchema: ({
|
|
11
|
+
readonly AttributeName: "pk";
|
|
12
|
+
readonly KeyType: "HASH";
|
|
13
|
+
} | {
|
|
14
|
+
readonly AttributeName: "sk";
|
|
15
|
+
readonly KeyType: "RANGE";
|
|
16
|
+
})[];
|
|
17
|
+
OnDemandThroughput: {
|
|
18
|
+
readonly MaxReadRequestUnits: 4000;
|
|
19
|
+
readonly MaxWriteRequestUnits: 100;
|
|
20
|
+
};
|
|
21
|
+
TableName: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The schema settings items of core and the managed server's plugins, which
|
|
25
|
+
* the database checks before its first read, as one BatchWriteItem request:
|
|
26
|
+
* what `migrateDynamoDB` writes to a new table for those plugins.
|
|
27
|
+
*/
|
|
28
|
+
declare const buildDynamoDBSchemaSettingsInput: (tableName: string) => {
|
|
29
|
+
RequestItems: {
|
|
30
|
+
[x: string]: {
|
|
31
|
+
PutRequest: {
|
|
32
|
+
Item: {
|
|
33
|
+
pk: {
|
|
34
|
+
S: string;
|
|
35
|
+
};
|
|
36
|
+
sk: {
|
|
37
|
+
S: string;
|
|
38
|
+
};
|
|
39
|
+
key: {
|
|
40
|
+
S: string;
|
|
41
|
+
};
|
|
42
|
+
value: {
|
|
43
|
+
S: string;
|
|
44
|
+
};
|
|
45
|
+
_v: {
|
|
46
|
+
N: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
declare const buildDynamoDBBackupInput: (tableName: string) => {
|
|
54
|
+
PointInTimeRecoverySpecification: {
|
|
55
|
+
PointInTimeRecoveryEnabled: true;
|
|
56
|
+
};
|
|
57
|
+
TableName: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Turns on the table's TTL, which deletes expired items for free: the store
|
|
61
|
+
* writes `_ttl`, in epoch seconds, on every item of a row with retention.
|
|
62
|
+
*/
|
|
63
|
+
declare const buildDynamoDBTimeToLiveInput: (tableName: string) => {
|
|
64
|
+
TableName: string;
|
|
65
|
+
TimeToLiveSpecification: {
|
|
66
|
+
AttributeName: string;
|
|
67
|
+
Enabled: true;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region iac/iam.d.ts
|
|
72
|
+
declare const buildDynamoDBPolicy: (region: string, accountId: string, tableName: string) => {
|
|
73
|
+
Version: string;
|
|
74
|
+
Statement: {
|
|
75
|
+
Action: string[];
|
|
76
|
+
Condition: {
|
|
77
|
+
"ForAllValues:StringLike": {
|
|
78
|
+
"dynamodb:LeadingKeys": string[];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
Effect: string;
|
|
82
|
+
Resource: string[];
|
|
83
|
+
}[];
|
|
84
|
+
};
|
|
85
|
+
declare const buildS3Policy: (bucketName: string) => {
|
|
86
|
+
Version: string;
|
|
87
|
+
Statement: {
|
|
88
|
+
Action: string[];
|
|
89
|
+
Effect: string;
|
|
90
|
+
Resource: string[];
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
declare const buildSsmPolicy: (region: string, accountId: string, parameterName: string) => {
|
|
94
|
+
Version: string;
|
|
95
|
+
Statement: {
|
|
96
|
+
Effect: string;
|
|
97
|
+
Action: string[];
|
|
98
|
+
Resource: string;
|
|
99
|
+
}[];
|
|
100
|
+
};
|
|
101
|
+
declare const LAMBDA_EDGE_TRUST_POLICY: {
|
|
102
|
+
Version: string;
|
|
103
|
+
Statement: {
|
|
104
|
+
Effect: string;
|
|
105
|
+
Principal: {
|
|
106
|
+
Service: string[];
|
|
107
|
+
};
|
|
108
|
+
Action: string;
|
|
109
|
+
}[];
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
1
112
|
//#region iac/init/index.d.ts
|
|
2
113
|
declare const AWS_AUTH_MODES: readonly ["local-session", "shared-profile", "sso", "account"];
|
|
3
114
|
type AwsAuthMode = (typeof AWS_AUTH_MODES)[number];
|
|
4
|
-
declare const isAwsAuthMode: (value: string | undefined) => value is AwsAuthMode;
|
|
5
115
|
declare const AWS_REGION_VALUES: readonly ["af-south-1", "ap-east-1", "ap-east-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", "ap-southeast-5", "ap-southeast-6", "ap-southeast-7", "ca-central-1", "ca-west-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", "il-central-1", "me-central-1", "me-south-1", "mx-central-1", "sa-east-1", "us-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-1", "us-west-1", "us-west-2"];
|
|
6
116
|
type AwsRegionValue = (typeof AWS_REGION_VALUES)[number];
|
|
7
|
-
declare const isAwsRegionValue: (value: string | undefined) => value is AwsRegionValue;
|
|
8
117
|
declare const initProvider: {
|
|
9
118
|
readonly label: "AWS + Lambda@Edge";
|
|
10
119
|
readonly inputs: {
|
|
@@ -99,4 +208,16 @@ declare const initProvider: {
|
|
|
99
208
|
};
|
|
100
209
|
};
|
|
101
210
|
//#endregion
|
|
102
|
-
|
|
211
|
+
//#region iac/index.d.ts
|
|
212
|
+
declare const prepareDynamoDBDeployment: (input: {
|
|
213
|
+
readonly credentials: {
|
|
214
|
+
readonly accessKeyId: string;
|
|
215
|
+
readonly secretAccessKey: string;
|
|
216
|
+
readonly sessionToken?: string;
|
|
217
|
+
};
|
|
218
|
+
readonly region: string;
|
|
219
|
+
readonly tableName: string;
|
|
220
|
+
}) => Promise<void>;
|
|
221
|
+
declare const runInit: ({ build, envFile }: RunInitOptions) => Promise<void>;
|
|
222
|
+
//#endregion
|
|
223
|
+
export { LAMBDA_EDGE_TRUST_POLICY, buildDynamoDBBackupInput, buildDynamoDBCreateTableInput, buildDynamoDBPolicy, buildDynamoDBSchemaSettingsInput, buildDynamoDBTimeToLiveInput, buildS3Policy, buildSsmPolicy, initProvider, prepareDynamoDBDeployment, runInit };
|