@awsless/awsless 0.0.17 → 0.0.18
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/bin.cjs +42 -17
- package/dist/bin.js +42 -17
- package/dist/index.cjs +5 -0
- package/dist/index.d.ts +413 -305
- package/dist/index.js +4 -0
- package/package.json +1 -4
package/dist/bin.cjs
CHANGED
|
@@ -1462,6 +1462,26 @@ var Table = class extends Resource {
|
|
|
1462
1462
|
resources: [this.arn]
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
|
+
attributeDefinitions() {
|
|
1466
|
+
const fields = this.props.fields || {};
|
|
1467
|
+
const attributes = new Set([
|
|
1468
|
+
this.props.hash,
|
|
1469
|
+
this.props.sort,
|
|
1470
|
+
...Object.values(this.props.indexes || {}).map((index) => [
|
|
1471
|
+
index.hash,
|
|
1472
|
+
index.sort
|
|
1473
|
+
])
|
|
1474
|
+
].flat().filter(Boolean));
|
|
1475
|
+
const types = {
|
|
1476
|
+
string: "S",
|
|
1477
|
+
number: "N",
|
|
1478
|
+
binary: "B"
|
|
1479
|
+
};
|
|
1480
|
+
return [...attributes].map((name) => ({
|
|
1481
|
+
AttributeName: name,
|
|
1482
|
+
AttributeType: types[fields[name] || "string"]
|
|
1483
|
+
}));
|
|
1484
|
+
}
|
|
1465
1485
|
properties() {
|
|
1466
1486
|
return {
|
|
1467
1487
|
TableName: this.name,
|
|
@@ -1474,10 +1494,7 @@ var Table = class extends Resource {
|
|
|
1474
1494
|
{ KeyType: "HASH", AttributeName: this.props.hash },
|
|
1475
1495
|
...this.props.sort ? [{ KeyType: "RANGE", AttributeName: this.props.sort }] : []
|
|
1476
1496
|
],
|
|
1477
|
-
AttributeDefinitions:
|
|
1478
|
-
AttributeName: name,
|
|
1479
|
-
AttributeType: type[0].toUpperCase()
|
|
1480
|
-
})),
|
|
1497
|
+
AttributeDefinitions: this.attributeDefinitions(),
|
|
1481
1498
|
...this.props.stream ? {
|
|
1482
1499
|
StreamSpecification: {
|
|
1483
1500
|
StreamViewType: (0, import_change_case4.constantCase)(this.props.stream)
|
|
@@ -1562,6 +1579,7 @@ var tablePlugin = definePlugin({
|
|
|
1562
1579
|
/** Specifies the name of the range / sort key that makes up the primary key for the table. */
|
|
1563
1580
|
sort: KeySchema.optional(),
|
|
1564
1581
|
/** A list of attributes that describe the key schema for the table and indexes.
|
|
1582
|
+
* If no attribute field is defined we default to 'string'.
|
|
1565
1583
|
* @example
|
|
1566
1584
|
* {
|
|
1567
1585
|
* fields: {
|
|
@@ -1569,7 +1587,10 @@ var tablePlugin = definePlugin({
|
|
|
1569
1587
|
* }
|
|
1570
1588
|
* }
|
|
1571
1589
|
*/
|
|
1572
|
-
fields: import_zod9.z.record(
|
|
1590
|
+
fields: import_zod9.z.record(
|
|
1591
|
+
import_zod9.z.string(),
|
|
1592
|
+
import_zod9.z.enum(["string", "number", "binary"])
|
|
1593
|
+
).optional(),
|
|
1573
1594
|
/** The table class of the table.
|
|
1574
1595
|
* @default 'standard'
|
|
1575
1596
|
*/
|
|
@@ -1618,18 +1639,22 @@ var tablePlugin = definePlugin({
|
|
|
1618
1639
|
*/
|
|
1619
1640
|
projection: import_zod9.z.enum(["all", "keys-only"]).default("all")
|
|
1620
1641
|
})).optional()
|
|
1621
|
-
})
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1642
|
+
})
|
|
1643
|
+
// .refine(props => {
|
|
1644
|
+
// return (
|
|
1645
|
+
// // Check the hash key
|
|
1646
|
+
// props.fields.hasOwnProperty(props.hash) &&
|
|
1647
|
+
// // Check the sort key
|
|
1648
|
+
// (!props.sort || props.fields.hasOwnProperty(props.sort)) &&
|
|
1649
|
+
// // Check all indexes
|
|
1650
|
+
// !Object.values(props.indexes || {}).map(index => (
|
|
1651
|
+
// // Check the index hash key
|
|
1652
|
+
// props.fields.hasOwnProperty(index.hash) &&
|
|
1653
|
+
// // Check the index sort key
|
|
1654
|
+
// (!index.sort || props.fields.hasOwnProperty(index.sort))
|
|
1655
|
+
// )).includes(false)
|
|
1656
|
+
// )
|
|
1657
|
+
// }, 'Hash & Sort keys must be defined inside the table fields')
|
|
1633
1658
|
).optional()
|
|
1634
1659
|
}).array()
|
|
1635
1660
|
}),
|
package/dist/bin.js
CHANGED
|
@@ -1439,6 +1439,26 @@ var Table = class extends Resource {
|
|
|
1439
1439
|
resources: [this.arn]
|
|
1440
1440
|
};
|
|
1441
1441
|
}
|
|
1442
|
+
attributeDefinitions() {
|
|
1443
|
+
const fields = this.props.fields || {};
|
|
1444
|
+
const attributes = new Set([
|
|
1445
|
+
this.props.hash,
|
|
1446
|
+
this.props.sort,
|
|
1447
|
+
...Object.values(this.props.indexes || {}).map((index) => [
|
|
1448
|
+
index.hash,
|
|
1449
|
+
index.sort
|
|
1450
|
+
])
|
|
1451
|
+
].flat().filter(Boolean));
|
|
1452
|
+
const types = {
|
|
1453
|
+
string: "S",
|
|
1454
|
+
number: "N",
|
|
1455
|
+
binary: "B"
|
|
1456
|
+
};
|
|
1457
|
+
return [...attributes].map((name) => ({
|
|
1458
|
+
AttributeName: name,
|
|
1459
|
+
AttributeType: types[fields[name] || "string"]
|
|
1460
|
+
}));
|
|
1461
|
+
}
|
|
1442
1462
|
properties() {
|
|
1443
1463
|
return {
|
|
1444
1464
|
TableName: this.name,
|
|
@@ -1451,10 +1471,7 @@ var Table = class extends Resource {
|
|
|
1451
1471
|
{ KeyType: "HASH", AttributeName: this.props.hash },
|
|
1452
1472
|
...this.props.sort ? [{ KeyType: "RANGE", AttributeName: this.props.sort }] : []
|
|
1453
1473
|
],
|
|
1454
|
-
AttributeDefinitions:
|
|
1455
|
-
AttributeName: name,
|
|
1456
|
-
AttributeType: type[0].toUpperCase()
|
|
1457
|
-
})),
|
|
1474
|
+
AttributeDefinitions: this.attributeDefinitions(),
|
|
1458
1475
|
...this.props.stream ? {
|
|
1459
1476
|
StreamSpecification: {
|
|
1460
1477
|
StreamViewType: constantCase2(this.props.stream)
|
|
@@ -1539,6 +1556,7 @@ var tablePlugin = definePlugin({
|
|
|
1539
1556
|
/** Specifies the name of the range / sort key that makes up the primary key for the table. */
|
|
1540
1557
|
sort: KeySchema.optional(),
|
|
1541
1558
|
/** A list of attributes that describe the key schema for the table and indexes.
|
|
1559
|
+
* If no attribute field is defined we default to 'string'.
|
|
1542
1560
|
* @example
|
|
1543
1561
|
* {
|
|
1544
1562
|
* fields: {
|
|
@@ -1546,7 +1564,10 @@ var tablePlugin = definePlugin({
|
|
|
1546
1564
|
* }
|
|
1547
1565
|
* }
|
|
1548
1566
|
*/
|
|
1549
|
-
fields: z9.record(
|
|
1567
|
+
fields: z9.record(
|
|
1568
|
+
z9.string(),
|
|
1569
|
+
z9.enum(["string", "number", "binary"])
|
|
1570
|
+
).optional(),
|
|
1550
1571
|
/** The table class of the table.
|
|
1551
1572
|
* @default 'standard'
|
|
1552
1573
|
*/
|
|
@@ -1595,18 +1616,22 @@ var tablePlugin = definePlugin({
|
|
|
1595
1616
|
*/
|
|
1596
1617
|
projection: z9.enum(["all", "keys-only"]).default("all")
|
|
1597
1618
|
})).optional()
|
|
1598
|
-
})
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1619
|
+
})
|
|
1620
|
+
// .refine(props => {
|
|
1621
|
+
// return (
|
|
1622
|
+
// // Check the hash key
|
|
1623
|
+
// props.fields.hasOwnProperty(props.hash) &&
|
|
1624
|
+
// // Check the sort key
|
|
1625
|
+
// (!props.sort || props.fields.hasOwnProperty(props.sort)) &&
|
|
1626
|
+
// // Check all indexes
|
|
1627
|
+
// !Object.values(props.indexes || {}).map(index => (
|
|
1628
|
+
// // Check the index hash key
|
|
1629
|
+
// props.fields.hasOwnProperty(index.hash) &&
|
|
1630
|
+
// // Check the index sort key
|
|
1631
|
+
// (!index.sort || props.fields.hasOwnProperty(index.sort))
|
|
1632
|
+
// )).includes(false)
|
|
1633
|
+
// )
|
|
1634
|
+
// }, 'Hash & Sort keys must be defined inside the table fields')
|
|
1610
1635
|
).optional()
|
|
1611
1636
|
}).array()
|
|
1612
1637
|
}),
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
defineAppConfig: () => defineAppConfig,
|
|
24
24
|
definePlugin: () => definePlugin,
|
|
25
|
+
defineStackConfig: () => defineStackConfig,
|
|
25
26
|
getFunctionName: () => getFunctionName,
|
|
26
27
|
getGlobalResourceName: () => getGlobalResourceName,
|
|
27
28
|
getLocalResourceName: () => getLocalResourceName,
|
|
@@ -51,6 +52,9 @@ var getQueueName = getLocalResourceName;
|
|
|
51
52
|
var getTopicName = getGlobalResourceName;
|
|
52
53
|
|
|
53
54
|
// src/index.ts
|
|
55
|
+
var defineStackConfig = (config) => {
|
|
56
|
+
return config;
|
|
57
|
+
};
|
|
54
58
|
var defineAppConfig = (config) => {
|
|
55
59
|
return config;
|
|
56
60
|
};
|
|
@@ -58,6 +62,7 @@ var defineAppConfig = (config) => {
|
|
|
58
62
|
0 && (module.exports = {
|
|
59
63
|
defineAppConfig,
|
|
60
64
|
definePlugin,
|
|
65
|
+
defineStackConfig,
|
|
61
66
|
getFunctionName,
|
|
62
67
|
getGlobalResourceName,
|
|
63
68
|
getLocalResourceName,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AwsCredentialIdentityProvider } from '@aws-sdk/types';
|
|
2
1
|
import * as zod from 'zod';
|
|
3
|
-
import {
|
|
2
|
+
import { z, AnyZodObject } from 'zod';
|
|
3
|
+
import { AwsCredentialIdentityProvider } from '@aws-sdk/types';
|
|
4
4
|
|
|
5
5
|
type ProgramOptions = {
|
|
6
6
|
configFile?: string;
|
|
@@ -18,229 +18,6 @@ type StackConfig$1 = {
|
|
|
18
18
|
depends?: Array<StackConfig$1>;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
declare const regions: readonly ["us-east-2", "us-east-1", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-2", "ap-southeast-3", "ap-southeast-4", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-south-2", "eu-north-1", "eu-central-2", "me-south-1", "me-central-1", "sa-east-1"];
|
|
22
|
-
type Region = typeof regions[number];
|
|
23
|
-
|
|
24
|
-
type AssetRead = (name: string) => Promise<Buffer>;
|
|
25
|
-
type AssetWrite = (name: string, data: string | Buffer) => Promise<void>;
|
|
26
|
-
type AssetPublish = (name: string, data: string | Buffer, hash: string) => Promise<{
|
|
27
|
-
bucket: string;
|
|
28
|
-
key: string;
|
|
29
|
-
version: string;
|
|
30
|
-
}>;
|
|
31
|
-
type BuildProps = {
|
|
32
|
-
write: AssetWrite;
|
|
33
|
-
};
|
|
34
|
-
type PublishProps = {
|
|
35
|
-
read: AssetRead;
|
|
36
|
-
publish: AssetPublish;
|
|
37
|
-
};
|
|
38
|
-
type Metadata = Record<string, string>;
|
|
39
|
-
declare class Asset {
|
|
40
|
-
readonly type: string;
|
|
41
|
-
readonly id: string;
|
|
42
|
-
constructor(type: string, id: string);
|
|
43
|
-
build?(opt: BuildProps): Promise<Metadata | void> | Metadata | void;
|
|
44
|
-
publish?(opt: PublishProps): Promise<Metadata | void> | Metadata | void;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
type Permission = {
|
|
48
|
-
effect?: 'Allow' | 'Deny';
|
|
49
|
-
actions: string[];
|
|
50
|
-
resources: string[];
|
|
51
|
-
};
|
|
52
|
-
interface Resource {
|
|
53
|
-
readonly permissions?: Permission | Permission[];
|
|
54
|
-
}
|
|
55
|
-
declare abstract class Resource {
|
|
56
|
-
readonly type: string;
|
|
57
|
-
readonly children: Array<Resource | Asset>;
|
|
58
|
-
readonly logicalId: string;
|
|
59
|
-
private deps;
|
|
60
|
-
constructor(type: string, logicalId: string, children?: Array<Resource | Asset>);
|
|
61
|
-
dependsOn(...dependencies: Resource[]): this;
|
|
62
|
-
protected attr(name: string, value: unknown): {
|
|
63
|
-
[x: string]: unknown;
|
|
64
|
-
};
|
|
65
|
-
toJSON(): {
|
|
66
|
-
[x: string]: {
|
|
67
|
-
Type: string;
|
|
68
|
-
DependsOn: string[];
|
|
69
|
-
Properties: object;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
abstract properties(): object;
|
|
73
|
-
}
|
|
74
|
-
declare class Group {
|
|
75
|
-
readonly children: Array<Resource | Asset>;
|
|
76
|
-
constructor(children: Array<Resource | Asset>);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
type ConstructorOf<C> = {
|
|
80
|
-
new (...args: any[]): C;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
declare class Stack {
|
|
84
|
-
readonly name: string;
|
|
85
|
-
readonly region: Region;
|
|
86
|
-
readonly exports: Map<string, string>;
|
|
87
|
-
readonly resources: Set<Resource>;
|
|
88
|
-
readonly tags: Map<string, string>;
|
|
89
|
-
readonly assets: Set<Asset>;
|
|
90
|
-
constructor(name: string, region: Region);
|
|
91
|
-
add(...resources: (Resource | Asset | Group)[]): this;
|
|
92
|
-
export(name: string, value: string): this;
|
|
93
|
-
get(name: string): string;
|
|
94
|
-
import(name: string): string;
|
|
95
|
-
tag(name: string, value: string): this;
|
|
96
|
-
find<T>(resourceType: ConstructorOf<T>): T[];
|
|
97
|
-
[Symbol.iterator](): IterableIterator<Resource>;
|
|
98
|
-
get size(): number;
|
|
99
|
-
toJSON(): {
|
|
100
|
-
Resources: {};
|
|
101
|
-
Outputs: {};
|
|
102
|
-
};
|
|
103
|
-
toString(pretty?: boolean): string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
declare class App {
|
|
107
|
-
readonly name: string;
|
|
108
|
-
private list;
|
|
109
|
-
constructor(name: string);
|
|
110
|
-
add(...stacks: Stack[]): this;
|
|
111
|
-
find<T>(resourceType: ConstructorOf<T>): T[];
|
|
112
|
-
[Symbol.iterator](): IterableIterator<Stack>;
|
|
113
|
-
get stacks(): Stack[];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
declare class Duration {
|
|
117
|
-
private value;
|
|
118
|
-
static milliseconds(value: number): Duration;
|
|
119
|
-
static seconds(value: number): Duration;
|
|
120
|
-
static minutes(value: number): Duration;
|
|
121
|
-
static hours(value: number): Duration;
|
|
122
|
-
static days(value: number): Duration;
|
|
123
|
-
constructor(value: number);
|
|
124
|
-
toMilliseconds(): number;
|
|
125
|
-
toSeconds(): number;
|
|
126
|
-
toMinutes(): number;
|
|
127
|
-
toHours(): number;
|
|
128
|
-
toDays(): number;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
declare class Size {
|
|
132
|
-
private bytes;
|
|
133
|
-
static bytes(value: number): Size;
|
|
134
|
-
static kiloBytes(value: number): Size;
|
|
135
|
-
static megaBytes(value: number): Size;
|
|
136
|
-
static gigaBytes(value: number): Size;
|
|
137
|
-
constructor(bytes: number);
|
|
138
|
-
toBytes(): number;
|
|
139
|
-
toKiloBytes(): number;
|
|
140
|
-
toMegaBytes(): number;
|
|
141
|
-
toGigaBytes(): number;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
interface ICode {
|
|
145
|
-
toCodeJson: () => {
|
|
146
|
-
Handler: string;
|
|
147
|
-
Code: {
|
|
148
|
-
S3Bucket: string;
|
|
149
|
-
S3Key: string;
|
|
150
|
-
S3ObjectVersion: string;
|
|
151
|
-
} | {
|
|
152
|
-
ZipFile: string;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
type FunctionProps = {
|
|
158
|
-
code: ICode;
|
|
159
|
-
name?: string;
|
|
160
|
-
description?: string;
|
|
161
|
-
runtime?: 'nodejs16.x' | 'nodejs18.x';
|
|
162
|
-
architecture?: 'arm64' | 'x86_64';
|
|
163
|
-
memorySize?: Size;
|
|
164
|
-
timeout?: Duration;
|
|
165
|
-
ephemeralStorageSize?: Size;
|
|
166
|
-
environment?: Record<string, string>;
|
|
167
|
-
};
|
|
168
|
-
declare class Function extends Resource {
|
|
169
|
-
private props;
|
|
170
|
-
readonly name: string;
|
|
171
|
-
private role;
|
|
172
|
-
private policy;
|
|
173
|
-
private environmentVariables;
|
|
174
|
-
constructor(logicalId: string, props: FunctionProps);
|
|
175
|
-
addPermissions(...permissions: (Permission | Permission[])[]): this;
|
|
176
|
-
addEnvironment(name: string, value: string): this;
|
|
177
|
-
get id(): string;
|
|
178
|
-
get arn(): string;
|
|
179
|
-
get permissions(): {
|
|
180
|
-
actions: string[];
|
|
181
|
-
resources: string[];
|
|
182
|
-
};
|
|
183
|
-
properties(): {
|
|
184
|
-
EphemeralStorage: {
|
|
185
|
-
Size: number;
|
|
186
|
-
};
|
|
187
|
-
Environment: {
|
|
188
|
-
Variables: Record<string, string>;
|
|
189
|
-
};
|
|
190
|
-
Handler: string;
|
|
191
|
-
Code: {
|
|
192
|
-
S3Bucket: string;
|
|
193
|
-
S3Key: string;
|
|
194
|
-
S3ObjectVersion: string;
|
|
195
|
-
} | {
|
|
196
|
-
ZipFile: string;
|
|
197
|
-
};
|
|
198
|
-
FunctionName: string;
|
|
199
|
-
MemorySize: number;
|
|
200
|
-
Runtime: "nodejs16.x" | "nodejs18.x";
|
|
201
|
-
Timeout: number;
|
|
202
|
-
Architectures: ("x86_64" | "arm64")[];
|
|
203
|
-
Role: string;
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
type Binding = (lambda: Function) => void;
|
|
208
|
-
|
|
209
|
-
type ExtendedConfigOutput<S extends AnyZodObject | undefined = undefined> = (S extends AnyZodObject ? BaseConfig & z.output<S> : BaseConfig);
|
|
210
|
-
type ExtendedConfigInput<S extends AnyZodObject | undefined = undefined> = (S extends AnyZodObject ? AppConfigInput & z.input<S> : AppConfigInput);
|
|
211
|
-
type ResourceContext<S extends AnyZodObject | undefined = undefined> = {
|
|
212
|
-
config: ExtendedConfigOutput<S>;
|
|
213
|
-
app: App;
|
|
214
|
-
stack: Stack;
|
|
215
|
-
bootstrap: Stack;
|
|
216
|
-
usEastBootstrap: Stack;
|
|
217
|
-
resource: Resource;
|
|
218
|
-
};
|
|
219
|
-
type StackContext<S extends AnyZodObject | undefined = undefined> = {
|
|
220
|
-
config: ExtendedConfigOutput<S>;
|
|
221
|
-
stack: Stack;
|
|
222
|
-
stackConfig: ExtendedConfigOutput<S>['stacks'][number];
|
|
223
|
-
bootstrap: Stack;
|
|
224
|
-
usEastBootstrap: Stack;
|
|
225
|
-
app: App;
|
|
226
|
-
bind: (cb: Binding) => void;
|
|
227
|
-
};
|
|
228
|
-
type AppContext<S extends AnyZodObject | undefined = undefined> = {
|
|
229
|
-
config: ExtendedConfigOutput<S>;
|
|
230
|
-
bootstrap: Stack;
|
|
231
|
-
usEastBootstrap: Stack;
|
|
232
|
-
app: App;
|
|
233
|
-
bind: (cb: Binding) => void;
|
|
234
|
-
};
|
|
235
|
-
type Plugin<S extends AnyZodObject | undefined = undefined> = {
|
|
236
|
-
name: string;
|
|
237
|
-
schema?: S;
|
|
238
|
-
onApp?: (context: AppContext<S>) => void;
|
|
239
|
-
onStack?: (context: StackContext<S>) => void;
|
|
240
|
-
onResource?: (context: ResourceContext<S>) => void;
|
|
241
|
-
};
|
|
242
|
-
declare const definePlugin: <S extends AnyZodObject | undefined = undefined>(plugin: Plugin<S>) => Plugin<S>;
|
|
243
|
-
|
|
244
21
|
declare const AppSchema: z.ZodObject<{
|
|
245
22
|
/** App name */
|
|
246
23
|
name: z.ZodString;
|
|
@@ -278,6 +55,34 @@ declare const AppSchema: z.ZodObject<{
|
|
|
278
55
|
type AppConfigInput = z.input<typeof AppSchema>;
|
|
279
56
|
type AppConfigOutput = z.output<typeof AppSchema>;
|
|
280
57
|
|
|
58
|
+
declare class Size {
|
|
59
|
+
private bytes;
|
|
60
|
+
static bytes(value: number): Size;
|
|
61
|
+
static kiloBytes(value: number): Size;
|
|
62
|
+
static megaBytes(value: number): Size;
|
|
63
|
+
static gigaBytes(value: number): Size;
|
|
64
|
+
constructor(bytes: number);
|
|
65
|
+
toBytes(): number;
|
|
66
|
+
toKiloBytes(): number;
|
|
67
|
+
toMegaBytes(): number;
|
|
68
|
+
toGigaBytes(): number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class Duration {
|
|
72
|
+
private value;
|
|
73
|
+
static milliseconds(value: number): Duration;
|
|
74
|
+
static seconds(value: number): Duration;
|
|
75
|
+
static minutes(value: number): Duration;
|
|
76
|
+
static hours(value: number): Duration;
|
|
77
|
+
static days(value: number): Duration;
|
|
78
|
+
constructor(value: number);
|
|
79
|
+
toMilliseconds(): number;
|
|
80
|
+
toSeconds(): number;
|
|
81
|
+
toMinutes(): number;
|
|
82
|
+
toHours(): number;
|
|
83
|
+
toDays(): number;
|
|
84
|
+
}
|
|
85
|
+
|
|
281
86
|
declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
282
87
|
extend: zod.ZodOptional<zod.ZodType<(ctx: AppContext<undefined>) => void, zod.ZodTypeDef, (ctx: AppContext<undefined>) => void>>;
|
|
283
88
|
stacks: zod.ZodArray<zod.ZodObject<{
|
|
@@ -881,10 +686,10 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
881
686
|
} | undefined;
|
|
882
687
|
}>> | Plugin<zod.ZodObject<{
|
|
883
688
|
stacks: zod.ZodArray<zod.ZodObject<{
|
|
884
|
-
tables: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.
|
|
689
|
+
tables: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
|
|
885
690
|
hash: zod.ZodString;
|
|
886
691
|
sort: zod.ZodOptional<zod.ZodString>;
|
|
887
|
-
fields: zod.ZodRecord<zod.ZodString, zod.ZodEnum<["string", "number", "binary"]
|
|
692
|
+
fields: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodEnum<["string", "number", "binary"]>>>;
|
|
888
693
|
class: zod.ZodDefault<zod.ZodEnum<["standard", "standard-infrequent-access"]>>;
|
|
889
694
|
pointInTimeRecovery: zod.ZodDefault<zod.ZodBoolean>;
|
|
890
695
|
timeToLiveAttribute: zod.ZodOptional<zod.ZodString>;
|
|
@@ -976,10 +781,10 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
976
781
|
}>>>;
|
|
977
782
|
}, "strip", zod.ZodTypeAny, {
|
|
978
783
|
hash: string;
|
|
979
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
980
784
|
class: "standard" | "standard-infrequent-access";
|
|
981
785
|
pointInTimeRecovery: boolean;
|
|
982
786
|
sort?: string | undefined;
|
|
787
|
+
fields?: Record<string, "string" | "number" | "binary"> | undefined;
|
|
983
788
|
timeToLiveAttribute?: string | undefined;
|
|
984
789
|
stream?: {
|
|
985
790
|
type: "keys-only" | "new-image" | "old-image" | "new-and-old-images";
|
|
@@ -1010,8 +815,8 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
1010
815
|
}> | undefined;
|
|
1011
816
|
}, {
|
|
1012
817
|
hash: string;
|
|
1013
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
1014
818
|
sort?: string | undefined;
|
|
819
|
+
fields?: Record<string, "string" | "number" | "binary"> | undefined;
|
|
1015
820
|
class?: "standard" | "standard-infrequent-access" | undefined;
|
|
1016
821
|
pointInTimeRecovery?: boolean | undefined;
|
|
1017
822
|
timeToLiveAttribute?: string | undefined;
|
|
@@ -1042,82 +847,14 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
1042
847
|
sort?: string | undefined;
|
|
1043
848
|
projection?: "keys-only" | "all" | undefined;
|
|
1044
849
|
}> | undefined;
|
|
1045
|
-
}
|
|
850
|
+
}>>>;
|
|
851
|
+
}, "strip", zod.ZodTypeAny, {
|
|
852
|
+
tables?: Record<string, {
|
|
1046
853
|
hash: string;
|
|
1047
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
1048
|
-
class: "standard" | "standard-infrequent-access";
|
|
1049
|
-
pointInTimeRecovery: boolean;
|
|
1050
|
-
sort?: string | undefined;
|
|
1051
|
-
timeToLiveAttribute?: string | undefined;
|
|
1052
|
-
stream?: {
|
|
1053
|
-
type: "keys-only" | "new-image" | "old-image" | "new-and-old-images";
|
|
1054
|
-
consumer: (string | {
|
|
1055
|
-
file: string;
|
|
1056
|
-
timeout?: Duration | undefined;
|
|
1057
|
-
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
1058
|
-
memorySize?: Size | undefined;
|
|
1059
|
-
architecture?: "x86_64" | "arm64" | undefined;
|
|
1060
|
-
ephemeralStorageSize?: Size | undefined;
|
|
1061
|
-
retryAttempts?: number | undefined;
|
|
1062
|
-
environment?: Record<string, string> | undefined;
|
|
1063
|
-
}) & (string | {
|
|
1064
|
-
file: string;
|
|
1065
|
-
timeout?: Duration | undefined;
|
|
1066
|
-
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
1067
|
-
memorySize?: Size | undefined;
|
|
1068
|
-
architecture?: "x86_64" | "arm64" | undefined;
|
|
1069
|
-
ephemeralStorageSize?: Size | undefined;
|
|
1070
|
-
retryAttempts?: number | undefined;
|
|
1071
|
-
environment?: Record<string, string> | undefined;
|
|
1072
|
-
} | undefined);
|
|
1073
|
-
} | undefined;
|
|
1074
|
-
indexes?: Record<string, {
|
|
1075
|
-
hash: string;
|
|
1076
|
-
projection: "keys-only" | "all";
|
|
1077
|
-
sort?: string | undefined;
|
|
1078
|
-
}> | undefined;
|
|
1079
|
-
}, {
|
|
1080
|
-
hash: string;
|
|
1081
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
1082
|
-
sort?: string | undefined;
|
|
1083
|
-
class?: "standard" | "standard-infrequent-access" | undefined;
|
|
1084
|
-
pointInTimeRecovery?: boolean | undefined;
|
|
1085
|
-
timeToLiveAttribute?: string | undefined;
|
|
1086
|
-
stream?: {
|
|
1087
|
-
type: "keys-only" | "new-image" | "old-image" | "new-and-old-images";
|
|
1088
|
-
consumer: (string | {
|
|
1089
|
-
file: string;
|
|
1090
|
-
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
1091
|
-
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
1092
|
-
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
1093
|
-
architecture?: "x86_64" | "arm64" | undefined;
|
|
1094
|
-
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
1095
|
-
retryAttempts?: number | undefined;
|
|
1096
|
-
environment?: Record<string, string> | undefined;
|
|
1097
|
-
}) & (string | {
|
|
1098
|
-
file: string;
|
|
1099
|
-
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
1100
|
-
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
1101
|
-
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
1102
|
-
architecture?: "x86_64" | "arm64" | undefined;
|
|
1103
|
-
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
1104
|
-
retryAttempts?: number | undefined;
|
|
1105
|
-
environment?: Record<string, string> | undefined;
|
|
1106
|
-
} | undefined);
|
|
1107
|
-
} | undefined;
|
|
1108
|
-
indexes?: Record<string, {
|
|
1109
|
-
hash: string;
|
|
1110
|
-
sort?: string | undefined;
|
|
1111
|
-
projection?: "keys-only" | "all" | undefined;
|
|
1112
|
-
}> | undefined;
|
|
1113
|
-
}>>>;
|
|
1114
|
-
}, "strip", zod.ZodTypeAny, {
|
|
1115
|
-
tables?: Record<string, {
|
|
1116
|
-
hash: string;
|
|
1117
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
1118
854
|
class: "standard" | "standard-infrequent-access";
|
|
1119
855
|
pointInTimeRecovery: boolean;
|
|
1120
856
|
sort?: string | undefined;
|
|
857
|
+
fields?: Record<string, "string" | "number" | "binary"> | undefined;
|
|
1121
858
|
timeToLiveAttribute?: string | undefined;
|
|
1122
859
|
stream?: {
|
|
1123
860
|
type: "keys-only" | "new-image" | "old-image" | "new-and-old-images";
|
|
@@ -1150,8 +887,8 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
1150
887
|
}, {
|
|
1151
888
|
tables?: Record<string, {
|
|
1152
889
|
hash: string;
|
|
1153
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
1154
890
|
sort?: string | undefined;
|
|
891
|
+
fields?: Record<string, "string" | "number" | "binary"> | undefined;
|
|
1155
892
|
class?: "standard" | "standard-infrequent-access" | undefined;
|
|
1156
893
|
pointInTimeRecovery?: boolean | undefined;
|
|
1157
894
|
timeToLiveAttribute?: string | undefined;
|
|
@@ -1188,10 +925,10 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
1188
925
|
stacks: {
|
|
1189
926
|
tables?: Record<string, {
|
|
1190
927
|
hash: string;
|
|
1191
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
1192
928
|
class: "standard" | "standard-infrequent-access";
|
|
1193
929
|
pointInTimeRecovery: boolean;
|
|
1194
930
|
sort?: string | undefined;
|
|
931
|
+
fields?: Record<string, "string" | "number" | "binary"> | undefined;
|
|
1195
932
|
timeToLiveAttribute?: string | undefined;
|
|
1196
933
|
stream?: {
|
|
1197
934
|
type: "keys-only" | "new-image" | "old-image" | "new-and-old-images";
|
|
@@ -1226,8 +963,8 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
1226
963
|
stacks: {
|
|
1227
964
|
tables?: Record<string, {
|
|
1228
965
|
hash: string;
|
|
1229
|
-
fields: Record<string, "string" | "number" | "binary">;
|
|
1230
966
|
sort?: string | undefined;
|
|
967
|
+
fields?: Record<string, "string" | "number" | "binary"> | undefined;
|
|
1231
968
|
class?: "standard" | "standard-infrequent-access" | undefined;
|
|
1232
969
|
pointInTimeRecovery?: boolean | undefined;
|
|
1233
970
|
timeToLiveAttribute?: string | undefined;
|
|
@@ -2146,6 +1883,201 @@ type BaseConfig = AppConfigOutput & {
|
|
|
2146
1883
|
};
|
|
2147
1884
|
type AppConfigFactory<C = AppConfigInput> = (options: ProgramOptions) => C | Promise<C>;
|
|
2148
1885
|
|
|
1886
|
+
declare const regions: readonly ["us-east-2", "us-east-1", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-2", "ap-southeast-3", "ap-southeast-4", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-south-2", "eu-north-1", "eu-central-2", "me-south-1", "me-central-1", "sa-east-1"];
|
|
1887
|
+
type Region = typeof regions[number];
|
|
1888
|
+
|
|
1889
|
+
type AssetRead = (name: string) => Promise<Buffer>;
|
|
1890
|
+
type AssetWrite = (name: string, data: string | Buffer) => Promise<void>;
|
|
1891
|
+
type AssetPublish = (name: string, data: string | Buffer, hash: string) => Promise<{
|
|
1892
|
+
bucket: string;
|
|
1893
|
+
key: string;
|
|
1894
|
+
version: string;
|
|
1895
|
+
}>;
|
|
1896
|
+
type BuildProps = {
|
|
1897
|
+
write: AssetWrite;
|
|
1898
|
+
};
|
|
1899
|
+
type PublishProps = {
|
|
1900
|
+
read: AssetRead;
|
|
1901
|
+
publish: AssetPublish;
|
|
1902
|
+
};
|
|
1903
|
+
type Metadata = Record<string, string>;
|
|
1904
|
+
declare class Asset {
|
|
1905
|
+
readonly type: string;
|
|
1906
|
+
readonly id: string;
|
|
1907
|
+
constructor(type: string, id: string);
|
|
1908
|
+
build?(opt: BuildProps): Promise<Metadata | void> | Metadata | void;
|
|
1909
|
+
publish?(opt: PublishProps): Promise<Metadata | void> | Metadata | void;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
type Permission = {
|
|
1913
|
+
effect?: 'Allow' | 'Deny';
|
|
1914
|
+
actions: string[];
|
|
1915
|
+
resources: string[];
|
|
1916
|
+
};
|
|
1917
|
+
interface Resource {
|
|
1918
|
+
readonly permissions?: Permission | Permission[];
|
|
1919
|
+
}
|
|
1920
|
+
declare abstract class Resource {
|
|
1921
|
+
readonly type: string;
|
|
1922
|
+
readonly children: Array<Resource | Asset>;
|
|
1923
|
+
readonly logicalId: string;
|
|
1924
|
+
private deps;
|
|
1925
|
+
constructor(type: string, logicalId: string, children?: Array<Resource | Asset>);
|
|
1926
|
+
dependsOn(...dependencies: Resource[]): this;
|
|
1927
|
+
protected attr(name: string, value: unknown): {
|
|
1928
|
+
[x: string]: unknown;
|
|
1929
|
+
};
|
|
1930
|
+
toJSON(): {
|
|
1931
|
+
[x: string]: {
|
|
1932
|
+
Type: string;
|
|
1933
|
+
DependsOn: string[];
|
|
1934
|
+
Properties: object;
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
abstract properties(): object;
|
|
1938
|
+
}
|
|
1939
|
+
declare class Group {
|
|
1940
|
+
readonly children: Array<Resource | Asset>;
|
|
1941
|
+
constructor(children: Array<Resource | Asset>);
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
type ConstructorOf<C> = {
|
|
1945
|
+
new (...args: any[]): C;
|
|
1946
|
+
};
|
|
1947
|
+
|
|
1948
|
+
declare class Stack {
|
|
1949
|
+
readonly name: string;
|
|
1950
|
+
readonly region: Region;
|
|
1951
|
+
readonly exports: Map<string, string>;
|
|
1952
|
+
readonly resources: Set<Resource>;
|
|
1953
|
+
readonly tags: Map<string, string>;
|
|
1954
|
+
readonly assets: Set<Asset>;
|
|
1955
|
+
constructor(name: string, region: Region);
|
|
1956
|
+
add(...resources: (Resource | Asset | Group)[]): this;
|
|
1957
|
+
export(name: string, value: string): this;
|
|
1958
|
+
get(name: string): string;
|
|
1959
|
+
import(name: string): string;
|
|
1960
|
+
tag(name: string, value: string): this;
|
|
1961
|
+
find<T>(resourceType: ConstructorOf<T>): T[];
|
|
1962
|
+
[Symbol.iterator](): IterableIterator<Resource>;
|
|
1963
|
+
get size(): number;
|
|
1964
|
+
toJSON(): {
|
|
1965
|
+
Resources: {};
|
|
1966
|
+
Outputs: {};
|
|
1967
|
+
};
|
|
1968
|
+
toString(pretty?: boolean): string;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
declare class App {
|
|
1972
|
+
readonly name: string;
|
|
1973
|
+
private list;
|
|
1974
|
+
constructor(name: string);
|
|
1975
|
+
add(...stacks: Stack[]): this;
|
|
1976
|
+
find<T>(resourceType: ConstructorOf<T>): T[];
|
|
1977
|
+
[Symbol.iterator](): IterableIterator<Stack>;
|
|
1978
|
+
get stacks(): Stack[];
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
interface ICode {
|
|
1982
|
+
toCodeJson: () => {
|
|
1983
|
+
Handler: string;
|
|
1984
|
+
Code: {
|
|
1985
|
+
S3Bucket: string;
|
|
1986
|
+
S3Key: string;
|
|
1987
|
+
S3ObjectVersion: string;
|
|
1988
|
+
} | {
|
|
1989
|
+
ZipFile: string;
|
|
1990
|
+
};
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
type FunctionProps = {
|
|
1995
|
+
code: ICode;
|
|
1996
|
+
name?: string;
|
|
1997
|
+
description?: string;
|
|
1998
|
+
runtime?: 'nodejs16.x' | 'nodejs18.x';
|
|
1999
|
+
architecture?: 'arm64' | 'x86_64';
|
|
2000
|
+
memorySize?: Size;
|
|
2001
|
+
timeout?: Duration;
|
|
2002
|
+
ephemeralStorageSize?: Size;
|
|
2003
|
+
environment?: Record<string, string>;
|
|
2004
|
+
};
|
|
2005
|
+
declare class Function extends Resource {
|
|
2006
|
+
private props;
|
|
2007
|
+
readonly name: string;
|
|
2008
|
+
private role;
|
|
2009
|
+
private policy;
|
|
2010
|
+
private environmentVariables;
|
|
2011
|
+
constructor(logicalId: string, props: FunctionProps);
|
|
2012
|
+
addPermissions(...permissions: (Permission | Permission[])[]): this;
|
|
2013
|
+
addEnvironment(name: string, value: string): this;
|
|
2014
|
+
get id(): string;
|
|
2015
|
+
get arn(): string;
|
|
2016
|
+
get permissions(): {
|
|
2017
|
+
actions: string[];
|
|
2018
|
+
resources: string[];
|
|
2019
|
+
};
|
|
2020
|
+
properties(): {
|
|
2021
|
+
EphemeralStorage: {
|
|
2022
|
+
Size: number;
|
|
2023
|
+
};
|
|
2024
|
+
Environment: {
|
|
2025
|
+
Variables: Record<string, string>;
|
|
2026
|
+
};
|
|
2027
|
+
Handler: string;
|
|
2028
|
+
Code: {
|
|
2029
|
+
S3Bucket: string;
|
|
2030
|
+
S3Key: string;
|
|
2031
|
+
S3ObjectVersion: string;
|
|
2032
|
+
} | {
|
|
2033
|
+
ZipFile: string;
|
|
2034
|
+
};
|
|
2035
|
+
FunctionName: string;
|
|
2036
|
+
MemorySize: number;
|
|
2037
|
+
Runtime: "nodejs16.x" | "nodejs18.x";
|
|
2038
|
+
Timeout: number;
|
|
2039
|
+
Architectures: ("x86_64" | "arm64")[];
|
|
2040
|
+
Role: string;
|
|
2041
|
+
};
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
type Binding = (lambda: Function) => void;
|
|
2045
|
+
|
|
2046
|
+
type ExtendedConfigOutput<S extends AnyZodObject | undefined = undefined> = (S extends AnyZodObject ? BaseConfig & z.output<S> : BaseConfig);
|
|
2047
|
+
type ExtendedConfigInput<S extends AnyZodObject | undefined = undefined> = (S extends AnyZodObject ? AppConfigInput & z.input<S> : AppConfigInput);
|
|
2048
|
+
type ResourceContext<S extends AnyZodObject | undefined = undefined> = {
|
|
2049
|
+
config: ExtendedConfigOutput<S>;
|
|
2050
|
+
app: App;
|
|
2051
|
+
stack: Stack;
|
|
2052
|
+
bootstrap: Stack;
|
|
2053
|
+
usEastBootstrap: Stack;
|
|
2054
|
+
resource: Resource;
|
|
2055
|
+
};
|
|
2056
|
+
type StackContext<S extends AnyZodObject | undefined = undefined> = {
|
|
2057
|
+
config: ExtendedConfigOutput<S>;
|
|
2058
|
+
stack: Stack;
|
|
2059
|
+
stackConfig: ExtendedConfigOutput<S>['stacks'][number];
|
|
2060
|
+
bootstrap: Stack;
|
|
2061
|
+
usEastBootstrap: Stack;
|
|
2062
|
+
app: App;
|
|
2063
|
+
bind: (cb: Binding) => void;
|
|
2064
|
+
};
|
|
2065
|
+
type AppContext<S extends AnyZodObject | undefined = undefined> = {
|
|
2066
|
+
config: ExtendedConfigOutput<S>;
|
|
2067
|
+
bootstrap: Stack;
|
|
2068
|
+
usEastBootstrap: Stack;
|
|
2069
|
+
app: App;
|
|
2070
|
+
bind: (cb: Binding) => void;
|
|
2071
|
+
};
|
|
2072
|
+
type Plugin<S extends AnyZodObject | undefined = undefined> = {
|
|
2073
|
+
name: string;
|
|
2074
|
+
schema?: S;
|
|
2075
|
+
onApp?: (context: AppContext<S>) => void;
|
|
2076
|
+
onStack?: (context: StackContext<S>) => void;
|
|
2077
|
+
onResource?: (context: ResourceContext<S>) => void;
|
|
2078
|
+
};
|
|
2079
|
+
declare const definePlugin: <S extends AnyZodObject | undefined = undefined>(plugin: Plugin<S>) => Plugin<S>;
|
|
2080
|
+
|
|
2149
2081
|
declare const getLocalResourceName: (id: string, stack?: string) => string;
|
|
2150
2082
|
declare const getGlobalResourceName: (id: string) => string;
|
|
2151
2083
|
declare const getFunctionName: (id: string, stack?: string) => string;
|
|
@@ -2156,6 +2088,182 @@ declare const getTopicName: (id: string) => string;
|
|
|
2156
2088
|
|
|
2157
2089
|
type AppConfig = CombinedDefaultPluginsConfigInput;
|
|
2158
2090
|
type StackConfig = CombinedDefaultPluginsConfigInput['stacks'][number];
|
|
2091
|
+
declare const defineStackConfig: (config: StackConfig) => StackConfig$1 | (StackConfig$1 & {
|
|
2092
|
+
extend?: ((ctx: StackContext<undefined>) => void) | undefined;
|
|
2093
|
+
}) | (StackConfig$1 & {
|
|
2094
|
+
functions?: Record<string, string | {
|
|
2095
|
+
file: string;
|
|
2096
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2097
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2098
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2099
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2100
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2101
|
+
retryAttempts?: number | undefined;
|
|
2102
|
+
environment?: Record<string, string> | undefined;
|
|
2103
|
+
}> | undefined;
|
|
2104
|
+
}) | (StackConfig$1 & {
|
|
2105
|
+
crons?: Record<string, {
|
|
2106
|
+
consumer: (string | {
|
|
2107
|
+
file: string;
|
|
2108
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2109
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2110
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2111
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2112
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2113
|
+
retryAttempts?: number | undefined;
|
|
2114
|
+
environment?: Record<string, string> | undefined;
|
|
2115
|
+
}) & (string | {
|
|
2116
|
+
file: string;
|
|
2117
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2118
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2119
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2120
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2121
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2122
|
+
retryAttempts?: number | undefined;
|
|
2123
|
+
environment?: Record<string, string> | undefined;
|
|
2124
|
+
} | undefined);
|
|
2125
|
+
schedule: (`rate(${number} second)` | `rate(${number} seconds)` | `rate(${number} minute)` | `rate(${number} minutes)` | `rate(${number} hour)` | `rate(${number} hours)` | `rate(${number} day)` | `rate(${number} days)` | `cron(${string} ${string} ${string} ${string} ${string} ${string})`) & (`rate(${number} second)` | `rate(${number} seconds)` | `rate(${number} minute)` | `rate(${number} minutes)` | `rate(${number} hour)` | `rate(${number} hours)` | `rate(${number} day)` | `rate(${number} days)` | `cron(${string} ${string} ${string} ${string} ${string} ${string})` | undefined);
|
|
2126
|
+
payload?: unknown;
|
|
2127
|
+
}> | undefined;
|
|
2128
|
+
}) | (StackConfig$1 & {
|
|
2129
|
+
queues?: Record<string, string | {
|
|
2130
|
+
consumer: (string | {
|
|
2131
|
+
file: string;
|
|
2132
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2133
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2134
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2135
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2136
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2137
|
+
retryAttempts?: number | undefined;
|
|
2138
|
+
environment?: Record<string, string> | undefined;
|
|
2139
|
+
}) & (string | {
|
|
2140
|
+
file: string;
|
|
2141
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2142
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2143
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2144
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2145
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2146
|
+
retryAttempts?: number | undefined;
|
|
2147
|
+
environment?: Record<string, string> | undefined;
|
|
2148
|
+
} | undefined);
|
|
2149
|
+
retentionPeriod?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2150
|
+
visibilityTimeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2151
|
+
deliveryDelay?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2152
|
+
receiveMessageWaitTime?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2153
|
+
maxMessageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2154
|
+
}> | undefined;
|
|
2155
|
+
}) | (StackConfig$1 & {
|
|
2156
|
+
tables?: Record<string, {
|
|
2157
|
+
hash: string;
|
|
2158
|
+
sort?: string | undefined;
|
|
2159
|
+
fields?: Record<string, "string" | "number" | "binary"> | undefined;
|
|
2160
|
+
class?: "standard" | "standard-infrequent-access" | undefined;
|
|
2161
|
+
pointInTimeRecovery?: boolean | undefined;
|
|
2162
|
+
timeToLiveAttribute?: string | undefined;
|
|
2163
|
+
stream?: {
|
|
2164
|
+
type: "keys-only" | "new-image" | "old-image" | "new-and-old-images";
|
|
2165
|
+
consumer: (string | {
|
|
2166
|
+
file: string;
|
|
2167
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2168
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2169
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2170
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2171
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2172
|
+
retryAttempts?: number | undefined;
|
|
2173
|
+
environment?: Record<string, string> | undefined;
|
|
2174
|
+
}) & (string | {
|
|
2175
|
+
file: string;
|
|
2176
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2177
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2178
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2179
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2180
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2181
|
+
retryAttempts?: number | undefined;
|
|
2182
|
+
environment?: Record<string, string> | undefined;
|
|
2183
|
+
} | undefined);
|
|
2184
|
+
} | undefined;
|
|
2185
|
+
indexes?: Record<string, {
|
|
2186
|
+
hash: string;
|
|
2187
|
+
sort?: string | undefined;
|
|
2188
|
+
projection?: "keys-only" | "all" | undefined;
|
|
2189
|
+
}> | undefined;
|
|
2190
|
+
}> | undefined;
|
|
2191
|
+
}) | (StackConfig$1 & {
|
|
2192
|
+
stores?: string[] | undefined;
|
|
2193
|
+
}) | (StackConfig$1 & {
|
|
2194
|
+
topics?: Record<string, string | {
|
|
2195
|
+
file: string;
|
|
2196
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2197
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2198
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2199
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2200
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2201
|
+
retryAttempts?: number | undefined;
|
|
2202
|
+
environment?: Record<string, string> | undefined;
|
|
2203
|
+
}> | undefined;
|
|
2204
|
+
}) | (StackConfig$1 & {
|
|
2205
|
+
pubsub?: Record<string, {
|
|
2206
|
+
consumer: (string | {
|
|
2207
|
+
file: string;
|
|
2208
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2209
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2210
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2211
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2212
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2213
|
+
retryAttempts?: number | undefined;
|
|
2214
|
+
environment?: Record<string, string> | undefined;
|
|
2215
|
+
}) & (string | {
|
|
2216
|
+
file: string;
|
|
2217
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2218
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2219
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2220
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2221
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2222
|
+
retryAttempts?: number | undefined;
|
|
2223
|
+
environment?: Record<string, string> | undefined;
|
|
2224
|
+
} | undefined);
|
|
2225
|
+
sql: string;
|
|
2226
|
+
sqlVersion?: "2015-10-08" | "2016-03-23" | "beta" | undefined;
|
|
2227
|
+
}> | undefined;
|
|
2228
|
+
}) | (StackConfig$1 & {
|
|
2229
|
+
searchs?: string[] | undefined;
|
|
2230
|
+
}) | (StackConfig$1 & {
|
|
2231
|
+
graphql?: Record<string, {
|
|
2232
|
+
schema?: string | string[] | undefined;
|
|
2233
|
+
resolvers?: Partial<Record<`${string} ${string}`, string | {
|
|
2234
|
+
file: string;
|
|
2235
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2236
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2237
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2238
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2239
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2240
|
+
retryAttempts?: number | undefined;
|
|
2241
|
+
environment?: Record<string, string> | undefined;
|
|
2242
|
+
}>> | undefined;
|
|
2243
|
+
}> | undefined;
|
|
2244
|
+
}) | (StackConfig$1 & {
|
|
2245
|
+
http?: Record<string, Partial<Record<`POST /${string}` | `GET /${string}` | `PUT /${string}` | `DELETE /${string}` | `HEAD /${string}` | `OPTIONS /${string}`, string | {
|
|
2246
|
+
file: string;
|
|
2247
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2248
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2249
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2250
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2251
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2252
|
+
retryAttempts?: number | undefined;
|
|
2253
|
+
environment?: Record<string, string> | undefined;
|
|
2254
|
+
}>>> | undefined;
|
|
2255
|
+
}) | (StackConfig$1 & {
|
|
2256
|
+
onFailure?: string | {
|
|
2257
|
+
file: string;
|
|
2258
|
+
timeout?: `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
2259
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
2260
|
+
memorySize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2261
|
+
architecture?: "x86_64" | "arm64" | undefined;
|
|
2262
|
+
ephemeralStorageSize?: `${number} KB` | `${number} MB` | `${number} GB` | undefined;
|
|
2263
|
+
retryAttempts?: number | undefined;
|
|
2264
|
+
environment?: Record<string, string> | undefined;
|
|
2265
|
+
} | undefined;
|
|
2266
|
+
});
|
|
2159
2267
|
declare const defineAppConfig: (config: AppConfig | AppConfigFactory<AppConfig>) => CombinedDefaultPluginsConfigInput | AppConfigFactory<CombinedDefaultPluginsConfigInput>;
|
|
2160
2268
|
|
|
2161
|
-
export { AppConfig, Plugin, StackConfig, defineAppConfig, definePlugin, getFunctionName, getGlobalResourceName, getLocalResourceName, getQueueName, getStoreName, getTableName, getTopicName };
|
|
2269
|
+
export { AppConfig, Plugin, StackConfig, defineAppConfig, definePlugin, defineStackConfig, getFunctionName, getGlobalResourceName, getLocalResourceName, getQueueName, getStoreName, getTableName, getTopicName };
|
package/dist/index.js
CHANGED
|
@@ -18,12 +18,16 @@ var getQueueName = getLocalResourceName;
|
|
|
18
18
|
var getTopicName = getGlobalResourceName;
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
+
var defineStackConfig = (config) => {
|
|
22
|
+
return config;
|
|
23
|
+
};
|
|
21
24
|
var defineAppConfig = (config) => {
|
|
22
25
|
return config;
|
|
23
26
|
};
|
|
24
27
|
export {
|
|
25
28
|
defineAppConfig,
|
|
26
29
|
definePlugin,
|
|
30
|
+
defineStackConfig,
|
|
27
31
|
getFunctionName,
|
|
28
32
|
getGlobalResourceName,
|
|
29
33
|
getLocalResourceName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -37,14 +37,11 @@
|
|
|
37
37
|
"@swc/core": "^1.3.70",
|
|
38
38
|
"@types/aws-lambda": "^8.10.110",
|
|
39
39
|
"@types/pretty-hrtime": "^1.0.1",
|
|
40
|
-
"aws-cdk-lib": "^2.87.0",
|
|
41
40
|
"aws-cron-expression-validator": "^1.0.5",
|
|
42
41
|
"aws-lambda": "^1.0.7",
|
|
43
42
|
"chalk": "^5.3.0",
|
|
44
43
|
"change-case": "^4.1.2",
|
|
45
44
|
"commander": "^9.4.1",
|
|
46
|
-
"constructs": "^10.1.246",
|
|
47
|
-
"esbuild": "^0.18.15",
|
|
48
45
|
"filesize": "^10.0.7",
|
|
49
46
|
"graphql": "^16.7.1",
|
|
50
47
|
"jszip": "^3.10.1",
|