@awsless/awsless 0.0.445 → 0.0.446
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/README.MD +350 -189
- package/dist/app.json +1 -1
- package/dist/bin.js +4112 -12800
- package/dist/build-json-schema.js +370 -532
- package/dist/client.js +0 -1
- package/dist/prebuild/rpc/HASH +1 -1
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/prebuild.js +4 -1
- package/dist/server.js +9 -10
- package/dist/stack.json +1 -1
- package/package.json +15 -15
- package/dist/bin.d.ts +0 -1
- package/dist/chunk-JSBRDJBE.js +0 -30
- package/dist/client.d.ts +0 -75
- package/dist/server.d.ts +0 -169
|
@@ -4,10 +4,10 @@ import { join as join2 } from "node:path";
|
|
|
4
4
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
5
5
|
|
|
6
6
|
// src/config/app.ts
|
|
7
|
-
import { z as
|
|
7
|
+
import { z as z19 } from "zod";
|
|
8
8
|
|
|
9
9
|
// src/feature/alert/schema.ts
|
|
10
|
-
import {
|
|
10
|
+
import { kebabCase } from "change-case";
|
|
11
11
|
import { z as z2 } from "zod";
|
|
12
12
|
|
|
13
13
|
// src/config/schema/email.ts
|
|
@@ -15,7 +15,7 @@ import { z } from "zod";
|
|
|
15
15
|
var EmailSchema = z.string().email();
|
|
16
16
|
|
|
17
17
|
// src/feature/alert/schema.ts
|
|
18
|
-
var AlertNameSchema = z2.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid alert name").transform((value) =>
|
|
18
|
+
var AlertNameSchema = z2.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid alert name").transform((value) => kebabCase(value)).describe("Define alert name.");
|
|
19
19
|
var AlertsDefaultSchema = z2.record(
|
|
20
20
|
AlertNameSchema,
|
|
21
21
|
z2.union([
|
|
@@ -26,22 +26,17 @@ var AlertsDefaultSchema = z2.record(
|
|
|
26
26
|
).optional().describe("Define the alerts in your app. Alerts are a way to send messages to one or more email addresses.");
|
|
27
27
|
|
|
28
28
|
// src/feature/auth/schema.ts
|
|
29
|
-
import { z as
|
|
29
|
+
import { z as z5 } from "zod";
|
|
30
30
|
|
|
31
31
|
// src/config/schema/resource-id.ts
|
|
32
|
-
import {
|
|
32
|
+
import { kebabCase as kebabCase2 } from "change-case";
|
|
33
33
|
import { z as z3 } from "zod";
|
|
34
|
-
var ResourceIdSchema = z3.string().min(3).max(24).regex(/^[a-z0-9\-]+$/i, "Invalid resource ID").transform((value) =>
|
|
35
|
-
|
|
36
|
-
// src/feature/function/schema.ts
|
|
37
|
-
import { days, minutes, seconds, toDays } from "@awsless/duration";
|
|
38
|
-
import { gibibytes, mebibytes } from "@awsless/size";
|
|
39
|
-
import { z as z7 } from "zod";
|
|
34
|
+
var ResourceIdSchema = z3.string().min(3).max(24).regex(/^[a-z0-9\-]+$/i, "Invalid resource ID").transform((value) => kebabCase2(value));
|
|
40
35
|
|
|
41
36
|
// src/config/schema/duration.ts
|
|
42
|
-
import { z as z4 } from "zod";
|
|
43
37
|
import { parse } from "@awsless/duration";
|
|
44
|
-
|
|
38
|
+
import { z as z4 } from "zod";
|
|
39
|
+
var DurationSchema = z4.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?|weeks?)$/, "Invalid duration").transform((v) => parse(v));
|
|
45
40
|
var durationMin = (min) => {
|
|
46
41
|
return (duration) => {
|
|
47
42
|
return duration.value >= min.value;
|
|
@@ -53,12 +48,85 @@ var durationMax = (max) => {
|
|
|
53
48
|
};
|
|
54
49
|
};
|
|
55
50
|
|
|
51
|
+
// src/feature/auth/schema.ts
|
|
52
|
+
var AuthDefaultSchema = z5.record(
|
|
53
|
+
ResourceIdSchema,
|
|
54
|
+
z5.object({
|
|
55
|
+
allowUserRegistration: z5.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
|
|
56
|
+
// messaging: z
|
|
57
|
+
// .object({
|
|
58
|
+
// fromEmail: EmailSchema.describe("Specifies the sender's email address."),
|
|
59
|
+
// fromName: z.string().optional().describe("Specifies the sender's name."),
|
|
60
|
+
// replyTo: EmailSchema.optional().describe(
|
|
61
|
+
// 'The destination to which the receiver of the email should reply.'
|
|
62
|
+
// ),
|
|
63
|
+
// })
|
|
64
|
+
// .optional()
|
|
65
|
+
// .describe('The email configuration for sending messages.'),
|
|
66
|
+
// secret: z.boolean().default(false).describe('Specifies whether you want to generate a client secret.'),
|
|
67
|
+
username: z5.object({
|
|
68
|
+
// emailAlias: z.boolean().default(true).describe('Allow the user email to be used as username.'),
|
|
69
|
+
caseSensitive: z5.boolean().default(false).describe(
|
|
70
|
+
"Specifies whether username case sensitivity will be enabled. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name."
|
|
71
|
+
)
|
|
72
|
+
}).default({}).describe("The username policy."),
|
|
73
|
+
password: z5.object({
|
|
74
|
+
minLength: z5.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
|
|
75
|
+
uppercase: z5.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
|
|
76
|
+
lowercase: z5.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
|
|
77
|
+
numbers: z5.boolean().default(true).describe("Required users to use at least one number in their password."),
|
|
78
|
+
symbols: z5.boolean().default(true).describe("Required users to use at least one symbol in their password."),
|
|
79
|
+
temporaryPasswordValidity: DurationSchema.default("7 days").describe(
|
|
80
|
+
"The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
|
|
81
|
+
)
|
|
82
|
+
}).default({}).describe("The password policy."),
|
|
83
|
+
validity: z5.object({
|
|
84
|
+
idToken: DurationSchema.default("1 hour").describe(
|
|
85
|
+
"The ID token time limit. After this limit expires, your user can't use their ID token."
|
|
86
|
+
),
|
|
87
|
+
accessToken: DurationSchema.default("1 hour").describe(
|
|
88
|
+
"The access token time limit. After this limit expires, your user can't use their access token."
|
|
89
|
+
),
|
|
90
|
+
refreshToken: DurationSchema.default("365 days").describe(
|
|
91
|
+
"The refresh token time limit. After this limit expires, your user can't use their refresh token."
|
|
92
|
+
)
|
|
93
|
+
}).default({}).describe("Specifies the validity duration for every JWT token.")
|
|
94
|
+
// triggers: TriggersSchema.optional(),
|
|
95
|
+
})
|
|
96
|
+
).default({}).describe("Define the authenticatable users in your app.");
|
|
97
|
+
|
|
98
|
+
// src/feature/domain/schema.ts
|
|
99
|
+
import { z as z6 } from "zod";
|
|
100
|
+
var DomainNameSchema = z6.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
101
|
+
"Enter a fully qualified domain name, for example, www.example.com. You can optionally include a trailing dot. If you omit the trailing dot, Amazon Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical."
|
|
102
|
+
);
|
|
103
|
+
var DNSTypeSchema = z6.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
104
|
+
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
105
|
+
var RecordsSchema = z6.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
106
|
+
var DomainsDefaultSchema = z6.record(
|
|
107
|
+
ResourceIdSchema,
|
|
108
|
+
z6.object({
|
|
109
|
+
domain: DomainNameSchema.describe("Define the domain name"),
|
|
110
|
+
dns: z6.object({
|
|
111
|
+
name: DomainNameSchema.optional(),
|
|
112
|
+
type: DNSTypeSchema,
|
|
113
|
+
ttl: TTLSchema,
|
|
114
|
+
records: RecordsSchema
|
|
115
|
+
}).array().optional().describe("Define the domain dns records")
|
|
116
|
+
})
|
|
117
|
+
).optional().describe("Define the domains for your application.");
|
|
118
|
+
|
|
119
|
+
// src/feature/function/schema.ts
|
|
120
|
+
import { days, minutes, seconds, toDays } from "@awsless/duration";
|
|
121
|
+
import { gibibytes, mebibytes } from "@awsless/size";
|
|
122
|
+
import { z as z9 } from "zod";
|
|
123
|
+
|
|
56
124
|
// src/config/schema/local-directory.ts
|
|
57
125
|
import { stat } from "fs/promises";
|
|
58
126
|
|
|
59
127
|
// src/config/schema/relative-path.ts
|
|
60
128
|
import { join } from "path";
|
|
61
|
-
import { z as
|
|
129
|
+
import { z as z7 } from "zod";
|
|
62
130
|
var basePath;
|
|
63
131
|
var resolvePath = (path) => {
|
|
64
132
|
if (path.startsWith(".") && basePath) {
|
|
@@ -66,7 +134,7 @@ var resolvePath = (path) => {
|
|
|
66
134
|
}
|
|
67
135
|
return path;
|
|
68
136
|
};
|
|
69
|
-
var RelativePathSchema =
|
|
137
|
+
var RelativePathSchema = z7.string().transform((path) => resolvePath(path));
|
|
70
138
|
|
|
71
139
|
// src/config/schema/local-directory.ts
|
|
72
140
|
var LocalDirectorySchema = RelativePathSchema.refine(async (path) => {
|
|
@@ -90,9 +158,9 @@ var LocalFileSchema = RelativePathSchema.refine(async (path) => {
|
|
|
90
158
|
}, `File doesn't exist`);
|
|
91
159
|
|
|
92
160
|
// src/config/schema/size.ts
|
|
93
|
-
import { z as z6 } from "zod";
|
|
94
161
|
import { parse as parse2 } from "@awsless/size";
|
|
95
|
-
|
|
162
|
+
import { z as z8 } from "zod";
|
|
163
|
+
var SizeSchema = z8.string().regex(/^[0-9]+ (B|KB|MB|GB|TB|PB)$/, "Invalid size").transform((v) => parse2(v));
|
|
96
164
|
var sizeMin = (min) => {
|
|
97
165
|
return (size) => {
|
|
98
166
|
return size.value >= min.value;
|
|
@@ -115,36 +183,36 @@ var EphemeralStorageSizeSchema = SizeSchema.refine(
|
|
|
115
183
|
sizeMin(mebibytes(512)),
|
|
116
184
|
"Minimum ephemeral storage size is 512 MB"
|
|
117
185
|
).refine(sizeMax(gibibytes(10)), "Minimum ephemeral storage size is 10 GB").describe("The size of the function's /tmp directory. You can specify a size value from 512 MB to 10 GB.");
|
|
118
|
-
var ReservedConcurrentExecutionsSchema =
|
|
119
|
-
var EnvironmentSchema =
|
|
120
|
-
var ArchitectureSchema =
|
|
121
|
-
var RetryAttemptsSchema =
|
|
186
|
+
var ReservedConcurrentExecutionsSchema = z9.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
|
|
187
|
+
var EnvironmentSchema = z9.record(z9.string(), z9.string()).optional().describe("Environment variable key-value pairs.");
|
|
188
|
+
var ArchitectureSchema = z9.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
189
|
+
var RetryAttemptsSchema = z9.number().int().min(0).max(2).describe(
|
|
122
190
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
123
191
|
);
|
|
124
|
-
var NodeRuntimeSchema =
|
|
125
|
-
var ContainerRuntimeSchema =
|
|
192
|
+
var NodeRuntimeSchema = z9.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]);
|
|
193
|
+
var ContainerRuntimeSchema = z9.literal("container");
|
|
126
194
|
var RuntimeSchema = NodeRuntimeSchema.or(ContainerRuntimeSchema).describe("The identifier of the function's runtime.");
|
|
127
|
-
var ActionSchema =
|
|
128
|
-
var ActionsSchema =
|
|
129
|
-
var ArnSchema =
|
|
130
|
-
var WildcardSchema =
|
|
131
|
-
var ResourceSchema =
|
|
132
|
-
var ResourcesSchema =
|
|
133
|
-
var PermissionSchema =
|
|
134
|
-
effect:
|
|
195
|
+
var ActionSchema = z9.string();
|
|
196
|
+
var ActionsSchema = z9.union([ActionSchema.transform((v) => [v]), ActionSchema.array()]);
|
|
197
|
+
var ArnSchema = z9.string().startsWith("arn:");
|
|
198
|
+
var WildcardSchema = z9.literal("*");
|
|
199
|
+
var ResourceSchema = z9.union([ArnSchema, WildcardSchema]);
|
|
200
|
+
var ResourcesSchema = z9.union([ResourceSchema.transform((v) => [v]), ResourceSchema.array()]);
|
|
201
|
+
var PermissionSchema = z9.object({
|
|
202
|
+
effect: z9.enum(["allow", "deny"]).default("allow"),
|
|
135
203
|
actions: ActionsSchema,
|
|
136
204
|
resources: ResourcesSchema
|
|
137
205
|
});
|
|
138
|
-
var PermissionsSchema =
|
|
139
|
-
var WarmSchema =
|
|
140
|
-
var VPCSchema =
|
|
141
|
-
var MinifySchema =
|
|
142
|
-
var HandlerSchema =
|
|
143
|
-
var DescriptionSchema =
|
|
206
|
+
var PermissionsSchema = z9.union([PermissionSchema.transform((v) => [v]), PermissionSchema.array()]).describe("Add IAM permissions to your function.");
|
|
207
|
+
var WarmSchema = z9.number().int().min(0).max(10).describe("Specify how many functions you want to warm up each 5 minutes. You can specify a number from 0 to 10.");
|
|
208
|
+
var VPCSchema = z9.boolean().describe("Put the function inside your global VPC.");
|
|
209
|
+
var MinifySchema = z9.boolean().describe("Minify the function code.");
|
|
210
|
+
var HandlerSchema = z9.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
|
|
211
|
+
var DescriptionSchema = z9.string().describe("A description of the function.");
|
|
144
212
|
var validLogRetentionDays = [
|
|
145
|
-
...[
|
|
146
|
-
...[
|
|
147
|
-
...[
|
|
213
|
+
...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
|
|
214
|
+
...[180, 365, 400, 545, 731, 1096, 1827, 2192],
|
|
215
|
+
...[2557, 2922, 3288, 3653]
|
|
148
216
|
];
|
|
149
217
|
var LogRetentionSchema = DurationSchema.refine(
|
|
150
218
|
durationMin(days(0)),
|
|
@@ -155,54 +223,43 @@ var LogRetentionSchema = DurationSchema.refine(
|
|
|
155
223
|
},
|
|
156
224
|
`Invalid log retention. Valid days are: ${validLogRetentionDays.map((days3) => `${days3}`).join(", ")}`
|
|
157
225
|
).describe("The log retention duration.");
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
file
|
|
161
|
-
})),
|
|
162
|
-
z7.object({
|
|
163
|
-
subscriber: LocalFileSchema,
|
|
164
|
-
filter: z7.string().optional()
|
|
165
|
-
})
|
|
166
|
-
]).describe(
|
|
167
|
-
"Log Subscription allow you to subscribe to a real-time stream of log events and have them delivered to a specific destination"
|
|
168
|
-
);
|
|
169
|
-
var LogSchema = z7.union([
|
|
170
|
-
z7.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
|
|
226
|
+
var LogSchema = z9.union([
|
|
227
|
+
z9.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
|
|
171
228
|
LogRetentionSchema.transform((retention) => ({ retention })),
|
|
172
|
-
|
|
173
|
-
subscription: LogSubscriptionSchema.optional(),
|
|
229
|
+
z9.object({
|
|
230
|
+
// subscription: LogSubscriptionSchema.optional(),
|
|
174
231
|
retention: LogRetentionSchema.optional(),
|
|
175
|
-
format:
|
|
232
|
+
format: z9.enum(["text", "json"]).describe(
|
|
176
233
|
`The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.`
|
|
177
234
|
).optional(),
|
|
178
|
-
system:
|
|
235
|
+
system: z9.enum(["debug", "info", "warn"]).describe(
|
|
179
236
|
"Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest."
|
|
180
237
|
).optional(),
|
|
181
|
-
level:
|
|
238
|
+
level: z9.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
|
|
182
239
|
"Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest."
|
|
183
240
|
).optional()
|
|
184
241
|
})
|
|
185
242
|
]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
|
|
186
|
-
var LayersSchema =
|
|
243
|
+
var LayersSchema = z9.string().array().describe(
|
|
187
244
|
// `A list of function layers to add to the function's execution environment..`
|
|
188
245
|
`A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.`
|
|
189
246
|
);
|
|
190
|
-
var FileCodeSchema =
|
|
247
|
+
var FileCodeSchema = z9.object({
|
|
191
248
|
file: LocalFileSchema.describe("The file path of the function code."),
|
|
192
249
|
minify: MinifySchema.optional().default(true),
|
|
193
|
-
external:
|
|
250
|
+
external: z9.string().array().optional().describe(`A list of external packages that won't be included in the bundle.`)
|
|
194
251
|
});
|
|
195
|
-
var BundleCodeSchema =
|
|
252
|
+
var BundleCodeSchema = z9.object({
|
|
196
253
|
bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
|
|
197
254
|
});
|
|
198
|
-
var CodeSchema =
|
|
255
|
+
var CodeSchema = z9.union([
|
|
199
256
|
LocalFileSchema.transform((file) => ({
|
|
200
257
|
file
|
|
201
258
|
})).pipe(FileCodeSchema),
|
|
202
259
|
FileCodeSchema,
|
|
203
260
|
BundleCodeSchema
|
|
204
261
|
]).describe("Specify the code of your function.");
|
|
205
|
-
var FnSchema =
|
|
262
|
+
var FnSchema = z9.object({
|
|
206
263
|
code: CodeSchema,
|
|
207
264
|
// node
|
|
208
265
|
handler: HandlerSchema.optional(),
|
|
@@ -225,14 +282,14 @@ var FnSchema = z7.object({
|
|
|
225
282
|
environment: EnvironmentSchema.optional(),
|
|
226
283
|
permissions: PermissionsSchema.optional()
|
|
227
284
|
});
|
|
228
|
-
var FunctionSchema =
|
|
285
|
+
var FunctionSchema = z9.union([
|
|
229
286
|
LocalFileSchema.transform((code) => ({
|
|
230
287
|
code
|
|
231
288
|
})).pipe(FnSchema),
|
|
232
289
|
FnSchema
|
|
233
290
|
]);
|
|
234
|
-
var FunctionsSchema =
|
|
235
|
-
var FunctionDefaultSchema =
|
|
291
|
+
var FunctionsSchema = z9.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
|
|
292
|
+
var FunctionDefaultSchema = z9.object({
|
|
236
293
|
runtime: RuntimeSchema.default("nodejs20.x"),
|
|
237
294
|
// node
|
|
238
295
|
handler: HandlerSchema.default("index.default"),
|
|
@@ -243,12 +300,12 @@ var FunctionDefaultSchema = z7.object({
|
|
|
243
300
|
// container
|
|
244
301
|
warm: WarmSchema.default(0),
|
|
245
302
|
vpc: VPCSchema.default(false),
|
|
246
|
-
log: LogSchema.default({
|
|
247
|
-
retention:
|
|
248
|
-
level: "error",
|
|
249
|
-
system: "warn",
|
|
250
|
-
format: "json"
|
|
251
|
-
}),
|
|
303
|
+
log: LogSchema.default(true).transform((log) => ({
|
|
304
|
+
retention: log.retention ?? days(7),
|
|
305
|
+
level: "level" in log ? log.level : "error",
|
|
306
|
+
system: "system" in log ? log.system : "warn",
|
|
307
|
+
format: "format" in log ? log.format : "json"
|
|
308
|
+
})),
|
|
252
309
|
timeout: TimeoutSchema.default("10 seconds"),
|
|
253
310
|
memorySize: MemorySizeSchema.default("128 MB"),
|
|
254
311
|
architecture: ArchitectureSchema.default("arm64"),
|
|
@@ -260,227 +317,26 @@ var FunctionDefaultSchema = z7.object({
|
|
|
260
317
|
permissions: PermissionsSchema.optional()
|
|
261
318
|
}).default({});
|
|
262
319
|
|
|
263
|
-
// src/feature/auth/schema.ts
|
|
264
|
-
var TriggersSchema = z8.object({
|
|
265
|
-
beforeToken: FunctionSchema.optional().describe("A pre jwt token generation AWS Lambda trigger."),
|
|
266
|
-
beforeLogin: FunctionSchema.optional().describe("A pre user login AWS Lambda trigger."),
|
|
267
|
-
afterLogin: FunctionSchema.optional().describe("A post user login AWS Lambda trigger."),
|
|
268
|
-
beforeRegister: FunctionSchema.optional().describe("A pre user register AWS Lambda trigger."),
|
|
269
|
-
afterRegister: FunctionSchema.optional().describe("A post user register AWS Lambda trigger."),
|
|
270
|
-
customMessage: FunctionSchema.optional().describe("A custom message AWS Lambda trigger."),
|
|
271
|
-
// /** A custom email sender AWS Lambda trigger */
|
|
272
|
-
// emailSender: FunctionSchema.optional(),
|
|
273
|
-
defineChallenge: FunctionSchema.optional().describe("Defines the authentication challenge."),
|
|
274
|
-
createChallenge: FunctionSchema.optional().describe("Creates an authentication challenge."),
|
|
275
|
-
verifyChallenge: FunctionSchema.optional().describe("Verifies the authentication challenge response.")
|
|
276
|
-
}).describe("Specifies the configuration for AWS Lambda triggers.");
|
|
277
|
-
var AuthSchema = z8.record(
|
|
278
|
-
ResourceIdSchema,
|
|
279
|
-
z8.object({
|
|
280
|
-
access: z8.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
|
|
281
|
-
triggers: TriggersSchema.optional()
|
|
282
|
-
})
|
|
283
|
-
).optional().describe("Define the auth triggers in your stack.");
|
|
284
|
-
var AuthDefaultSchema = z8.record(
|
|
285
|
-
ResourceIdSchema,
|
|
286
|
-
z8.object({
|
|
287
|
-
allowUserRegistration: z8.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
|
|
288
|
-
messaging: z8.object({
|
|
289
|
-
fromEmail: EmailSchema.describe("Specifies the sender's email address."),
|
|
290
|
-
fromName: z8.string().optional().describe("Specifies the sender's name."),
|
|
291
|
-
replyTo: EmailSchema.optional().describe(
|
|
292
|
-
"The destination to which the receiver of the email should reply."
|
|
293
|
-
)
|
|
294
|
-
}).optional().describe("The email configuration for sending messages."),
|
|
295
|
-
// secret: z.boolean().default(false).describe('Specifies whether you want to generate a client secret.'),
|
|
296
|
-
username: z8.object({
|
|
297
|
-
emailAlias: z8.boolean().default(true).describe("Allow the user email to be used as username."),
|
|
298
|
-
caseSensitive: z8.boolean().default(false).describe(
|
|
299
|
-
"Specifies whether username case sensitivity will be enabled. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name."
|
|
300
|
-
)
|
|
301
|
-
}).default({}).describe("The username policy."),
|
|
302
|
-
password: z8.object({
|
|
303
|
-
minLength: z8.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
|
|
304
|
-
uppercase: z8.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
|
|
305
|
-
lowercase: z8.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
|
|
306
|
-
numbers: z8.boolean().default(true).describe("Required users to use at least one number in their password."),
|
|
307
|
-
symbols: z8.boolean().default(true).describe("Required users to use at least one symbol in their password."),
|
|
308
|
-
temporaryPasswordValidity: DurationSchema.default("7 days").describe(
|
|
309
|
-
"The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
|
|
310
|
-
)
|
|
311
|
-
}).default({}).describe("The password policy."),
|
|
312
|
-
validity: z8.object({
|
|
313
|
-
idToken: DurationSchema.default("1 hour").describe(
|
|
314
|
-
"The ID token time limit. After this limit expires, your user can't use their ID token."
|
|
315
|
-
),
|
|
316
|
-
accessToken: DurationSchema.default("1 hour").describe(
|
|
317
|
-
"The access token time limit. After this limit expires, your user can't use their access token."
|
|
318
|
-
),
|
|
319
|
-
refreshToken: DurationSchema.default("365 days").describe(
|
|
320
|
-
"The refresh token time limit. After this limit expires, your user can't use their refresh token."
|
|
321
|
-
)
|
|
322
|
-
}).default({}).describe("Specifies the validity duration for every JWT token."),
|
|
323
|
-
triggers: TriggersSchema.optional()
|
|
324
|
-
})
|
|
325
|
-
).default({}).describe("Define the authenticatable users in your app.");
|
|
326
|
-
|
|
327
|
-
// src/feature/domain/schema.ts
|
|
328
|
-
import { z as z9 } from "zod";
|
|
329
|
-
var DomainNameSchema = z9.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
330
|
-
"Enter a fully qualified domain name, for example, www.example.com. You can optionally include a trailing dot. If you omit the trailing dot, Amazon Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical."
|
|
331
|
-
);
|
|
332
|
-
var DNSTypeSchema = z9.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
333
|
-
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
334
|
-
var RecordsSchema = z9.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
335
|
-
var DomainsDefaultSchema = z9.record(
|
|
336
|
-
ResourceIdSchema,
|
|
337
|
-
z9.object({
|
|
338
|
-
domain: DomainNameSchema.describe("Define the domain name"),
|
|
339
|
-
dns: z9.object({
|
|
340
|
-
name: DomainNameSchema.optional(),
|
|
341
|
-
type: DNSTypeSchema,
|
|
342
|
-
ttl: TTLSchema,
|
|
343
|
-
records: RecordsSchema
|
|
344
|
-
}).array().optional().describe("Define the domain dns records")
|
|
345
|
-
})
|
|
346
|
-
).optional().describe("Define the domains for your application.");
|
|
347
|
-
|
|
348
|
-
// src/feature/graphql/schema.ts
|
|
349
|
-
import { z as z10 } from "zod";
|
|
350
|
-
var AuthorizerTtl = DurationSchema.describe(
|
|
351
|
-
`The number of seconds a response should be cached for. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.`
|
|
352
|
-
);
|
|
353
|
-
var GraphQLDefaultSchema = z10.record(
|
|
354
|
-
ResourceIdSchema,
|
|
355
|
-
z10.object({
|
|
356
|
-
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
357
|
-
subDomain: z10.string().optional(),
|
|
358
|
-
auth: z10.union([
|
|
359
|
-
ResourceIdSchema,
|
|
360
|
-
z10.object({
|
|
361
|
-
authorizer: FunctionSchema,
|
|
362
|
-
ttl: AuthorizerTtl.default("1 hour")
|
|
363
|
-
})
|
|
364
|
-
]).optional(),
|
|
365
|
-
// authorization: z.object({
|
|
366
|
-
// authorizer: FunctionSchema,
|
|
367
|
-
// ttl: DurationSchema.default('1 hour'),
|
|
368
|
-
// }).optional(),
|
|
369
|
-
resolver: LocalFileSchema.optional()
|
|
370
|
-
})
|
|
371
|
-
).describe(`Define the global GraphQL API's.`).optional();
|
|
372
|
-
var GraphQLSchema = z10.record(
|
|
373
|
-
ResourceIdSchema,
|
|
374
|
-
z10.object({
|
|
375
|
-
// schema: z.union([LocalFileSchema.transform(v => [v]), z.array(LocalFileSchema).min(1)]).optional(),
|
|
376
|
-
schema: LocalFileSchema.describe("The graphql schema file."),
|
|
377
|
-
resolvers: z10.record(
|
|
378
|
-
// TypeName
|
|
379
|
-
z10.string(),
|
|
380
|
-
z10.record(
|
|
381
|
-
// FieldName
|
|
382
|
-
z10.string(),
|
|
383
|
-
z10.union([
|
|
384
|
-
FunctionSchema.transform((consumer) => ({
|
|
385
|
-
consumer
|
|
386
|
-
})),
|
|
387
|
-
z10.object({
|
|
388
|
-
consumer: FunctionSchema,
|
|
389
|
-
resolver: LocalFileSchema.optional()
|
|
390
|
-
})
|
|
391
|
-
])
|
|
392
|
-
)
|
|
393
|
-
).describe("The resolvers for your global GraphQL API.").optional()
|
|
394
|
-
})
|
|
395
|
-
).describe("Define the schema & resolvers in your stack for your global GraphQL API.").optional();
|
|
396
|
-
|
|
397
|
-
// src/feature/http/schema.ts
|
|
398
|
-
import { z as z11 } from "zod";
|
|
399
|
-
var RouteSchema = z11.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
|
|
400
|
-
var HttpDefaultSchema = z11.record(
|
|
401
|
-
ResourceIdSchema,
|
|
402
|
-
z11.object({
|
|
403
|
-
domain: ResourceIdSchema.describe("The domain id to link your API with."),
|
|
404
|
-
subDomain: z11.string().optional()
|
|
405
|
-
// auth: ResourceIdSchema.optional(),
|
|
406
|
-
})
|
|
407
|
-
).optional().describe("Define your global HTTP API's.");
|
|
408
|
-
var HttpSchema = z11.record(ResourceIdSchema, z11.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
|
|
409
|
-
|
|
410
|
-
// src/feature/instance/schema.ts
|
|
411
|
-
import { z as z12 } from "zod";
|
|
412
|
-
var ImageSchema = z12.string().regex(/^ami\-[0-9a-f]+/).describe("The ID of the AMI.");
|
|
413
|
-
var TypeSchema = z12.enum([
|
|
414
|
-
"t3.nano",
|
|
415
|
-
"t3.micro",
|
|
416
|
-
"t3.small",
|
|
417
|
-
"t3.medium",
|
|
418
|
-
"t3.large",
|
|
419
|
-
"t3.xlarge",
|
|
420
|
-
"t3.2xlarge",
|
|
421
|
-
"t4g.nano",
|
|
422
|
-
"t4g.micro",
|
|
423
|
-
"t4g.small",
|
|
424
|
-
"t4g.medium",
|
|
425
|
-
"t4g.large",
|
|
426
|
-
"t4g.xlarge",
|
|
427
|
-
"t4g.2xlarge",
|
|
428
|
-
"g4ad.xlarge",
|
|
429
|
-
"g4dn.xlarge"
|
|
430
|
-
]).describe(`The instance type.`);
|
|
431
|
-
var CommandSchema = z12.string().describe(`The script you want to execute when the instance starts up.`);
|
|
432
|
-
var CodeSchema2 = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
|
|
433
|
-
var ConnectSchema = z12.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
|
|
434
|
-
var EnvironmentSchema2 = z12.record(z12.string(), z12.string()).optional().describe("Environment variable key-value pairs.");
|
|
435
|
-
var ActionSchema2 = z12.string();
|
|
436
|
-
var ActionsSchema2 = z12.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
|
|
437
|
-
var ArnSchema2 = z12.string().startsWith("arn:");
|
|
438
|
-
var WildcardSchema2 = z12.literal("*");
|
|
439
|
-
var ResourceSchema2 = z12.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
|
|
440
|
-
var ResourcesSchema2 = z12.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
|
|
441
|
-
var PermissionSchema2 = z12.object({
|
|
442
|
-
effect: z12.enum(["allow", "deny"]).default("allow"),
|
|
443
|
-
actions: ActionsSchema2,
|
|
444
|
-
resources: ResourcesSchema2
|
|
445
|
-
});
|
|
446
|
-
var PermissionsSchema2 = z12.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
|
|
447
|
-
var InstanceDefaultSchema = z12.object({
|
|
448
|
-
connect: ConnectSchema.default(false)
|
|
449
|
-
}).default({}).describe("Define the default settings for all instances in your stacks.");
|
|
450
|
-
var InstancesSchema = z12.record(
|
|
451
|
-
ResourceIdSchema,
|
|
452
|
-
z12.object({
|
|
453
|
-
image: ImageSchema,
|
|
454
|
-
type: TypeSchema,
|
|
455
|
-
code: CodeSchema2,
|
|
456
|
-
user: z12.string().default("ec2-user"),
|
|
457
|
-
command: CommandSchema.optional(),
|
|
458
|
-
environment: EnvironmentSchema2.optional(),
|
|
459
|
-
permissions: PermissionsSchema2.optional(),
|
|
460
|
-
waitForTermination: z12.boolean().default(true)
|
|
461
|
-
})
|
|
462
|
-
).optional().describe("Define the instances in your stack.");
|
|
463
|
-
|
|
464
320
|
// src/feature/layer/schema.ts
|
|
465
|
-
import { z as
|
|
321
|
+
import { z as z11 } from "zod";
|
|
466
322
|
|
|
467
323
|
// src/config/schema/lambda.ts
|
|
468
|
-
import { z as
|
|
469
|
-
var ArchitectureSchema2 =
|
|
470
|
-
var NodeRuntimeSchema2 =
|
|
324
|
+
import { z as z10 } from "zod";
|
|
325
|
+
var ArchitectureSchema2 = z10.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
326
|
+
var NodeRuntimeSchema2 = z10.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).describe("The identifier of the function's runtime.");
|
|
471
327
|
|
|
472
328
|
// src/feature/layer/schema.ts
|
|
473
|
-
var Schema =
|
|
329
|
+
var Schema = z11.object({
|
|
474
330
|
file: LocalFileSchema,
|
|
475
331
|
runtimes: NodeRuntimeSchema2.array().optional(),
|
|
476
332
|
architecture: ArchitectureSchema2.optional(),
|
|
477
|
-
packages:
|
|
333
|
+
packages: z11.string().array().optional().describe(
|
|
478
334
|
"Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
|
|
479
335
|
)
|
|
480
336
|
});
|
|
481
|
-
var LayerSchema =
|
|
482
|
-
|
|
483
|
-
|
|
337
|
+
var LayerSchema = z11.record(
|
|
338
|
+
z11.string(),
|
|
339
|
+
z11.union([
|
|
484
340
|
LocalFileSchema.transform((file) => ({
|
|
485
341
|
file,
|
|
486
342
|
description: void 0
|
|
@@ -495,28 +351,28 @@ var OnFailureDefaultSchema = FunctionSchema.optional().describe(
|
|
|
495
351
|
);
|
|
496
352
|
|
|
497
353
|
// src/feature/on-log/schema.ts
|
|
498
|
-
import { z as
|
|
499
|
-
var FilterSchema =
|
|
500
|
-
var OnLogDefaultSchema =
|
|
354
|
+
import { z as z12 } from "zod";
|
|
355
|
+
var FilterSchema = z12.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
|
|
356
|
+
var OnLogDefaultSchema = z12.union([
|
|
501
357
|
FunctionSchema.transform((consumer) => ({
|
|
502
358
|
consumer,
|
|
503
359
|
filter: ["error", "fatal"]
|
|
504
360
|
})),
|
|
505
|
-
|
|
361
|
+
z12.object({
|
|
506
362
|
consumer: FunctionSchema,
|
|
507
363
|
filter: FilterSchema
|
|
508
364
|
})
|
|
509
365
|
]).optional().describe("Define a subscription on all Lambda functions logs.");
|
|
510
366
|
|
|
511
367
|
// src/feature/pubsub/schema.ts
|
|
512
|
-
import { z as
|
|
368
|
+
import { z as z13 } from "zod";
|
|
513
369
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
514
|
-
var PubSubDefaultSchema =
|
|
370
|
+
var PubSubDefaultSchema = z13.record(
|
|
515
371
|
ResourceIdSchema,
|
|
516
|
-
|
|
372
|
+
z13.object({
|
|
517
373
|
auth: FunctionSchema,
|
|
518
374
|
domain: DomainSchema.optional(),
|
|
519
|
-
subDomain:
|
|
375
|
+
subDomain: z13.string().optional()
|
|
520
376
|
// auth: z.union([
|
|
521
377
|
// ResourceIdSchema,
|
|
522
378
|
// z.object({
|
|
@@ -532,11 +388,11 @@ var PubSubDefaultSchema = z16.record(
|
|
|
532
388
|
// .optional(),
|
|
533
389
|
})
|
|
534
390
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
535
|
-
var PubSubSchema =
|
|
391
|
+
var PubSubSchema = z13.record(
|
|
536
392
|
ResourceIdSchema,
|
|
537
|
-
|
|
538
|
-
sql:
|
|
539
|
-
sqlVersion:
|
|
393
|
+
z13.object({
|
|
394
|
+
sql: z13.string().describe("The SQL statement used to query the IOT topic."),
|
|
395
|
+
sqlVersion: z13.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
|
|
540
396
|
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
541
397
|
})
|
|
542
398
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
@@ -544,7 +400,7 @@ var PubSubSchema = z16.record(
|
|
|
544
400
|
// src/feature/queue/schema.ts
|
|
545
401
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
546
402
|
import { kibibytes } from "@awsless/size";
|
|
547
|
-
import { z as
|
|
403
|
+
import { z as z14 } from "zod";
|
|
548
404
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
549
405
|
durationMin(minutes2(1)),
|
|
550
406
|
"Minimum retention period is 1 minute"
|
|
@@ -572,10 +428,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
572
428
|
var MaxMessageSizeSchema = SizeSchema.refine(sizeMin(kibibytes(1)), "Minimum max message size is 1 KB").refine(sizeMax(kibibytes(256)), "Maximum max message size is 256 KB").describe(
|
|
573
429
|
"The limit of how many bytes that a message can contain before Amazon SQS rejects it. You can specify an size from 1 KB to 256 KB."
|
|
574
430
|
);
|
|
575
|
-
var BatchSizeSchema =
|
|
431
|
+
var BatchSizeSchema = z14.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
576
432
|
"The maximum number of records in each batch that Lambda pulls from your queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB). You can specify an integer from 1 to 10000."
|
|
577
433
|
);
|
|
578
|
-
var MaxConcurrencySchema =
|
|
434
|
+
var MaxConcurrencySchema = z14.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
579
435
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
580
436
|
);
|
|
581
437
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -584,7 +440,7 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
584
440
|
).describe(
|
|
585
441
|
"The maximum amount of time, that Lambda spends gathering records before invoking the function. You can specify an duration from 0 seconds to 5 minutes."
|
|
586
442
|
);
|
|
587
|
-
var QueueDefaultSchema =
|
|
443
|
+
var QueueDefaultSchema = z14.object({
|
|
588
444
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
589
445
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
590
446
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -594,7 +450,7 @@ var QueueDefaultSchema = z17.object({
|
|
|
594
450
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
595
451
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
596
452
|
}).default({});
|
|
597
|
-
var QueueSchema =
|
|
453
|
+
var QueueSchema = z14.object({
|
|
598
454
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
599
455
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
600
456
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
@@ -605,9 +461,9 @@ var QueueSchema = z17.object({
|
|
|
605
461
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
606
462
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
607
463
|
});
|
|
608
|
-
var QueuesSchema =
|
|
464
|
+
var QueuesSchema = z14.record(
|
|
609
465
|
ResourceIdSchema,
|
|
610
|
-
|
|
466
|
+
z14.union([
|
|
611
467
|
LocalFileSchema.transform((consumer) => ({
|
|
612
468
|
consumer
|
|
613
469
|
})).pipe(QueueSchema),
|
|
@@ -616,143 +472,40 @@ var QueuesSchema = z17.record(
|
|
|
616
472
|
).optional().describe("Define the queues in your stack.");
|
|
617
473
|
|
|
618
474
|
// src/feature/rest/schema.ts
|
|
619
|
-
import { z as
|
|
475
|
+
import { z as z16 } from "zod";
|
|
620
476
|
|
|
621
477
|
// src/config/schema/route.ts
|
|
622
|
-
import { z as
|
|
623
|
-
var
|
|
624
|
-
|
|
625
|
-
|
|
478
|
+
import { z as z15 } from "zod";
|
|
479
|
+
var RouteSchema = z15.union([
|
|
480
|
+
z15.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
481
|
+
z15.literal("$default")
|
|
626
482
|
]);
|
|
627
483
|
|
|
628
484
|
// src/feature/rest/schema.ts
|
|
629
|
-
var RestDefaultSchema =
|
|
485
|
+
var RestDefaultSchema = z16.record(
|
|
630
486
|
ResourceIdSchema,
|
|
631
|
-
|
|
487
|
+
z16.object({
|
|
632
488
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
633
|
-
subDomain:
|
|
489
|
+
subDomain: z16.string().optional()
|
|
634
490
|
})
|
|
635
491
|
).optional().describe("Define your global REST API's.");
|
|
636
|
-
var RestSchema =
|
|
492
|
+
var RestSchema = z16.record(ResourceIdSchema, z16.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
637
493
|
|
|
638
494
|
// src/feature/rpc/schema.ts
|
|
639
|
-
import { z as
|
|
640
|
-
var RpcDefaultSchema =
|
|
495
|
+
import { z as z17 } from "zod";
|
|
496
|
+
var RpcDefaultSchema = z17.record(
|
|
641
497
|
ResourceIdSchema,
|
|
642
|
-
|
|
498
|
+
z17.object({
|
|
643
499
|
domain: ResourceIdSchema.describe("The domain id to link your RPC API with.").optional(),
|
|
644
|
-
subDomain:
|
|
500
|
+
subDomain: z17.string().optional(),
|
|
645
501
|
auth: FunctionSchema.optional(),
|
|
646
502
|
log: LogSchema.optional()
|
|
647
503
|
})
|
|
648
504
|
).describe(`Define the global RPC API's.`).optional();
|
|
649
|
-
var RpcSchema =
|
|
650
|
-
|
|
651
|
-
// src/feature/store/schema.ts
|
|
652
|
-
import { z as z21 } from "zod";
|
|
653
|
-
var DeletionProtectionSchema = z21.boolean().describe("Specifies if you want to protect the store from being deleted by awsless.");
|
|
654
|
-
var StoreDefaultSchema = z21.object({
|
|
655
|
-
deletionProtection: DeletionProtectionSchema.optional()
|
|
656
|
-
}).optional();
|
|
657
|
-
var StoresSchema = z21.union([
|
|
658
|
-
z21.array(ResourceIdSchema).transform((list) => {
|
|
659
|
-
const stores = {};
|
|
660
|
-
for (const key of list) {
|
|
661
|
-
stores[key] = {};
|
|
662
|
-
}
|
|
663
|
-
return stores;
|
|
664
|
-
}),
|
|
665
|
-
z21.record(
|
|
666
|
-
ResourceIdSchema,
|
|
667
|
-
z21.object({
|
|
668
|
-
// cors: CorsSchema,
|
|
669
|
-
deletionProtection: DeletionProtectionSchema.optional(),
|
|
670
|
-
versioning: z21.boolean().default(false).describe("Enable versioning of your store."),
|
|
671
|
-
events: z21.object({
|
|
672
|
-
// create
|
|
673
|
-
"created:*": FunctionSchema.optional().describe(
|
|
674
|
-
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
675
|
-
),
|
|
676
|
-
"created:put": FunctionSchema.optional().describe(
|
|
677
|
-
"Subscribe to notifications when an object is created using the PUT API operation."
|
|
678
|
-
),
|
|
679
|
-
"created:post": FunctionSchema.optional().describe(
|
|
680
|
-
"Subscribe to notifications when an object is created using the POST API operation."
|
|
681
|
-
),
|
|
682
|
-
"created:copy": FunctionSchema.optional().describe(
|
|
683
|
-
"Subscribe to notifications when an object is created using the COPY API operation."
|
|
684
|
-
),
|
|
685
|
-
"created:upload": FunctionSchema.optional().describe(
|
|
686
|
-
"Subscribe to notifications when an object multipart upload has been completed."
|
|
687
|
-
),
|
|
688
|
-
// remove
|
|
689
|
-
"removed:*": FunctionSchema.optional().describe(
|
|
690
|
-
"Subscribe to notifications when an object is deleted or a delete marker for a versioned object is created."
|
|
691
|
-
),
|
|
692
|
-
"removed:delete": FunctionSchema.optional().describe(
|
|
693
|
-
"Subscribe to notifications when an object is deleted"
|
|
694
|
-
),
|
|
695
|
-
"removed:marker": FunctionSchema.optional().describe(
|
|
696
|
-
"Subscribe to notifications when a delete marker for a versioned object is created."
|
|
697
|
-
)
|
|
698
|
-
}).optional().describe("Describes the store events you want to subscribe too.")
|
|
699
|
-
})
|
|
700
|
-
)
|
|
701
|
-
]).optional().describe("Define the stores in your stack.");
|
|
702
|
-
|
|
703
|
-
// src/feature/table/schema.ts
|
|
704
|
-
import { z as z22 } from "zod";
|
|
705
|
-
var KeySchema = z22.string().min(1).max(255);
|
|
706
|
-
var DeletionProtectionSchema2 = z22.boolean().describe("Specifies if you want to protect the table from being deleted by awsless.");
|
|
707
|
-
var TableDefaultSchema = z22.object({
|
|
708
|
-
deletionProtection: DeletionProtectionSchema2.optional()
|
|
709
|
-
}).optional();
|
|
710
|
-
var TablesSchema = z22.record(
|
|
711
|
-
ResourceIdSchema,
|
|
712
|
-
z22.object({
|
|
713
|
-
hash: KeySchema.describe(
|
|
714
|
-
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
715
|
-
),
|
|
716
|
-
sort: KeySchema.optional().describe(
|
|
717
|
-
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
718
|
-
),
|
|
719
|
-
fields: z22.record(z22.string(), z22.enum(["string", "number", "binary"])).optional().describe(
|
|
720
|
-
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
721
|
-
),
|
|
722
|
-
class: z22.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
723
|
-
pointInTimeRecovery: z22.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
724
|
-
timeToLiveAttribute: KeySchema.optional().describe(
|
|
725
|
-
"The name of the TTL attribute used to store the expiration time for items in the table. To update this property, you must first disable TTL and then enable TTL with the new attribute name."
|
|
726
|
-
),
|
|
727
|
-
deletionProtection: DeletionProtectionSchema2.optional(),
|
|
728
|
-
stream: z22.object({
|
|
729
|
-
type: z22.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
730
|
-
"When an item in the table is modified, stream.type determines what information is written to the stream for this table. Valid values are:\n- keys-only - Only the key attributes of the modified item are written to the stream.\n- new-image - The entire item, as it appears after it was modified, is written to the stream.\n- old-image - The entire item, as it appeared before it was modified, is written to the stream.\n- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
731
|
-
),
|
|
732
|
-
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
733
|
-
}).optional().describe(
|
|
734
|
-
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
735
|
-
),
|
|
736
|
-
indexes: z22.record(
|
|
737
|
-
z22.string(),
|
|
738
|
-
z22.object({
|
|
739
|
-
/** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
|
|
740
|
-
hash: KeySchema,
|
|
741
|
-
/** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
|
|
742
|
-
sort: KeySchema.optional(),
|
|
743
|
-
/** The set of attributes that are projected into the index:
|
|
744
|
-
* - all - All of the table attributes are projected into the index.
|
|
745
|
-
* - keys-only - Only the index and primary keys are projected into the index.
|
|
746
|
-
* @default 'all'
|
|
747
|
-
*/
|
|
748
|
-
projection: z22.enum(["all", "keys-only"]).default("all")
|
|
749
|
-
})
|
|
750
|
-
).optional().describe("Specifies the global secondary indexes to be created on the table.")
|
|
751
|
-
})
|
|
752
|
-
).optional().describe("Define the tables in your stack.");
|
|
505
|
+
var RpcSchema = z17.record(ResourceIdSchema, z17.record(z17.string(), FunctionSchema).describe("The queries for your global RPC API.")).describe("Define the schema in your stack for your global RPC API.").optional();
|
|
753
506
|
|
|
754
507
|
// src/config/schema/region.ts
|
|
755
|
-
import { z as
|
|
508
|
+
import { z as z18 } from "zod";
|
|
756
509
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
757
510
|
var AF = ["af-south-1"];
|
|
758
511
|
var AP = [
|
|
@@ -781,35 +534,44 @@ var EU = [
|
|
|
781
534
|
var ME = ["me-south-1", "me-central-1"];
|
|
782
535
|
var SA = ["sa-east-1"];
|
|
783
536
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
784
|
-
var RegionSchema =
|
|
537
|
+
var RegionSchema = z18.enum(regions);
|
|
785
538
|
|
|
786
539
|
// src/config/app.ts
|
|
787
|
-
var AppSchema =
|
|
788
|
-
$schema:
|
|
540
|
+
var AppSchema = z19.object({
|
|
541
|
+
$schema: z19.string().optional(),
|
|
789
542
|
name: ResourceIdSchema.describe("App name."),
|
|
790
543
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
791
|
-
profile:
|
|
544
|
+
profile: z19.string().describe("The AWS profile to deploy to."),
|
|
545
|
+
protect: z19.boolean().default(false).describe("Protect your app & stacks from being deleted."),
|
|
546
|
+
removal: z19.enum(["remove", "retain"]).default("remove").describe(
|
|
547
|
+
[
|
|
548
|
+
"Configure how your resources are handled when they have to be removed.",
|
|
549
|
+
"",
|
|
550
|
+
"remove: Removes the underlying resource.",
|
|
551
|
+
"retain: Retains resources like S3 stores and DynamoDB tables. Removes everything else."
|
|
552
|
+
].join("\n")
|
|
553
|
+
),
|
|
792
554
|
// stage: z
|
|
793
555
|
// .string()
|
|
794
556
|
// .regex(/^[a-z]+$/)
|
|
795
557
|
// .default('prod')
|
|
796
558
|
// .describe('The deployment stage.'),
|
|
797
559
|
// onFailure: OnFailureSchema,
|
|
798
|
-
defaults:
|
|
560
|
+
defaults: z19.object({
|
|
799
561
|
onFailure: OnFailureDefaultSchema,
|
|
800
562
|
onLog: OnLogDefaultSchema,
|
|
801
563
|
auth: AuthDefaultSchema,
|
|
802
564
|
domains: DomainsDefaultSchema,
|
|
803
565
|
function: FunctionDefaultSchema,
|
|
804
|
-
instance: InstanceDefaultSchema,
|
|
566
|
+
// instance: InstanceDefaultSchema,
|
|
805
567
|
queue: QueueDefaultSchema,
|
|
806
|
-
graphql: GraphQLDefaultSchema,
|
|
807
|
-
http: HttpDefaultSchema,
|
|
568
|
+
// graphql: GraphQLDefaultSchema,
|
|
569
|
+
// http: HttpDefaultSchema,
|
|
808
570
|
rest: RestDefaultSchema,
|
|
809
571
|
rpc: RpcDefaultSchema,
|
|
810
572
|
pubsub: PubSubDefaultSchema,
|
|
811
|
-
table: TableDefaultSchema,
|
|
812
|
-
store: StoreDefaultSchema,
|
|
573
|
+
// table: TableDefaultSchema,
|
|
574
|
+
// store: StoreDefaultSchema,
|
|
813
575
|
alerts: AlertsDefaultSchema,
|
|
814
576
|
layers: LayerSchema
|
|
815
577
|
// dataRetention: z.boolean().describe('Configure how your resources are handled on delete.').default(false),
|
|
@@ -817,11 +579,11 @@ var AppSchema = z24.object({
|
|
|
817
579
|
});
|
|
818
580
|
|
|
819
581
|
// src/config/stack.ts
|
|
820
|
-
import { z as
|
|
582
|
+
import { z as z32 } from "zod";
|
|
821
583
|
|
|
822
584
|
// src/feature/cache/schema.ts
|
|
823
|
-
import { z as
|
|
824
|
-
var
|
|
585
|
+
import { z as z20 } from "zod";
|
|
586
|
+
var TypeSchema = z20.enum([
|
|
825
587
|
"t4g.small",
|
|
826
588
|
"t4g.medium",
|
|
827
589
|
"r6g.large",
|
|
@@ -836,29 +598,29 @@ var TypeSchema2 = z25.enum([
|
|
|
836
598
|
"r6gd.4xlarge",
|
|
837
599
|
"r6gd.8xlarge"
|
|
838
600
|
]);
|
|
839
|
-
var PortSchema =
|
|
840
|
-
var ShardsSchema =
|
|
841
|
-
var ReplicasPerShardSchema =
|
|
842
|
-
var EngineSchema =
|
|
843
|
-
var CachesSchema =
|
|
601
|
+
var PortSchema = z20.number().int().min(1).max(5e4);
|
|
602
|
+
var ShardsSchema = z20.number().int().min(0).max(100);
|
|
603
|
+
var ReplicasPerShardSchema = z20.number().int().min(0).max(5);
|
|
604
|
+
var EngineSchema = z20.enum(["7.0", "6.2"]);
|
|
605
|
+
var CachesSchema = z20.record(
|
|
844
606
|
ResourceIdSchema,
|
|
845
|
-
|
|
846
|
-
type:
|
|
607
|
+
z20.object({
|
|
608
|
+
type: TypeSchema.default("t4g.small"),
|
|
847
609
|
port: PortSchema.default(6379),
|
|
848
610
|
shards: ShardsSchema.default(1),
|
|
849
611
|
replicasPerShard: ReplicasPerShardSchema.default(1),
|
|
850
612
|
engine: EngineSchema.default("7.0"),
|
|
851
|
-
dataTiering:
|
|
613
|
+
dataTiering: z20.boolean().default(false)
|
|
852
614
|
})
|
|
853
615
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
854
616
|
|
|
855
617
|
// src/feature/command/schema.ts
|
|
856
|
-
import { z as
|
|
857
|
-
var
|
|
858
|
-
|
|
618
|
+
import { z as z21 } from "zod";
|
|
619
|
+
var CommandSchema = z21.union([
|
|
620
|
+
z21.object({
|
|
859
621
|
file: LocalFileSchema,
|
|
860
|
-
handler:
|
|
861
|
-
description:
|
|
622
|
+
handler: z21.string().default("default").describe("The name of the handler that needs to run"),
|
|
623
|
+
description: z21.string().optional().describe("A description of the command")
|
|
862
624
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
863
625
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
864
626
|
}),
|
|
@@ -868,22 +630,22 @@ var CommandSchema2 = z26.union([
|
|
|
868
630
|
description: void 0
|
|
869
631
|
}))
|
|
870
632
|
]);
|
|
871
|
-
var CommandsSchema =
|
|
633
|
+
var CommandsSchema = z21.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
872
634
|
|
|
873
635
|
// src/feature/config/schema.ts
|
|
874
|
-
import { z as
|
|
875
|
-
var ConfigNameSchema =
|
|
876
|
-
var ConfigsSchema =
|
|
636
|
+
import { z as z22 } from "zod";
|
|
637
|
+
var ConfigNameSchema = z22.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
638
|
+
var ConfigsSchema = z22.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
877
639
|
|
|
878
640
|
// src/feature/cron/schema/index.ts
|
|
879
|
-
import { z as
|
|
641
|
+
import { z as z24 } from "zod";
|
|
880
642
|
|
|
881
643
|
// src/feature/cron/schema/schedule.ts
|
|
882
|
-
import { z as
|
|
644
|
+
import { z as z23 } from "zod";
|
|
883
645
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
884
|
-
var RateExpressionSchema =
|
|
646
|
+
var RateExpressionSchema = z23.custom(
|
|
885
647
|
(value) => {
|
|
886
|
-
return
|
|
648
|
+
return z23.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
887
649
|
const [str] = rate.split(" ");
|
|
888
650
|
const number = parseInt(str);
|
|
889
651
|
return number > 0;
|
|
@@ -899,9 +661,9 @@ var RateExpressionSchema = z28.custom(
|
|
|
899
661
|
}
|
|
900
662
|
return `rate(${rate})`;
|
|
901
663
|
});
|
|
902
|
-
var CronExpressionSchema =
|
|
664
|
+
var CronExpressionSchema = z23.custom(
|
|
903
665
|
(value) => {
|
|
904
|
-
return
|
|
666
|
+
return z23.string().safeParse(value).success;
|
|
905
667
|
},
|
|
906
668
|
{ message: "Invalid cron expression" }
|
|
907
669
|
).superRefine((value, ctx) => {
|
|
@@ -910,12 +672,12 @@ var CronExpressionSchema = z28.custom(
|
|
|
910
672
|
} catch (error) {
|
|
911
673
|
if (error instanceof Error) {
|
|
912
674
|
ctx.addIssue({
|
|
913
|
-
code:
|
|
675
|
+
code: z23.ZodIssueCode.custom,
|
|
914
676
|
message: `Invalid cron expression: ${error.message}`
|
|
915
677
|
});
|
|
916
678
|
} else {
|
|
917
679
|
ctx.addIssue({
|
|
918
|
-
code:
|
|
680
|
+
code: z23.ZodIssueCode.custom,
|
|
919
681
|
message: "Invalid cron expression"
|
|
920
682
|
});
|
|
921
683
|
}
|
|
@@ -926,23 +688,23 @@ var CronExpressionSchema = z28.custom(
|
|
|
926
688
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
927
689
|
|
|
928
690
|
// src/feature/cron/schema/index.ts
|
|
929
|
-
var CronsSchema =
|
|
691
|
+
var CronsSchema = z24.record(
|
|
930
692
|
ResourceIdSchema,
|
|
931
|
-
|
|
932
|
-
enabled:
|
|
693
|
+
z24.object({
|
|
694
|
+
enabled: z24.boolean().default(true).describe("If the cron is enabled."),
|
|
933
695
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
934
696
|
schedule: ScheduleExpressionSchema.describe(
|
|
935
697
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
936
698
|
),
|
|
937
|
-
payload:
|
|
699
|
+
payload: z24.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
938
700
|
})
|
|
939
701
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
940
702
|
|
|
941
703
|
// src/feature/search/schema.ts
|
|
942
704
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
943
|
-
import { z as
|
|
944
|
-
var VersionSchema =
|
|
945
|
-
var
|
|
705
|
+
import { z as z25 } from "zod";
|
|
706
|
+
var VersionSchema = z25.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
|
|
707
|
+
var TypeSchema2 = z25.enum([
|
|
946
708
|
"t3.small",
|
|
947
709
|
"t3.medium",
|
|
948
710
|
"m3.medium",
|
|
@@ -1017,11 +779,11 @@ var TypeSchema3 = z30.enum([
|
|
|
1017
779
|
"r6gd.16xlarge"
|
|
1018
780
|
]);
|
|
1019
781
|
var StorageSizeSchema = SizeSchema.refine(sizeMin(gibibytes2(10)), "Minimum storage size is 10 GB").refine(sizeMax(gibibytes2(100)), "Maximum storage size is 100 GB").describe("The size of the function's /tmp directory. You can specify a size value from 512 MB to 10 GiB.");
|
|
1020
|
-
var SearchsSchema =
|
|
782
|
+
var SearchsSchema = z25.record(
|
|
1021
783
|
ResourceIdSchema,
|
|
1022
|
-
|
|
1023
|
-
type:
|
|
1024
|
-
count:
|
|
784
|
+
z25.object({
|
|
785
|
+
type: TypeSchema2.default("t3.small"),
|
|
786
|
+
count: z25.number().int().min(1).default(1),
|
|
1025
787
|
version: VersionSchema.default("2.13"),
|
|
1026
788
|
storage: StorageSizeSchema.default("10 GB")
|
|
1027
789
|
// vpc: z.boolean().default(false),
|
|
@@ -1029,29 +791,29 @@ var SearchsSchema = z30.record(
|
|
|
1029
791
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
1030
792
|
|
|
1031
793
|
// src/feature/site/schema.ts
|
|
1032
|
-
import { z as
|
|
1033
|
-
var ErrorResponsePathSchema =
|
|
794
|
+
import { z as z26 } from "zod";
|
|
795
|
+
var ErrorResponsePathSchema = z26.string().describe(
|
|
1034
796
|
"The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.\n - We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable."
|
|
1035
797
|
);
|
|
1036
|
-
var StatusCodeSchema =
|
|
798
|
+
var StatusCodeSchema = z26.number().int().positive().optional().describe(
|
|
1037
799
|
"The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:\n- Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200, the response typically won't be intercepted.\n- If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors.\n- You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down."
|
|
1038
800
|
);
|
|
1039
801
|
var MinTTLSchema = DurationSchema.describe(
|
|
1040
802
|
"The minimum amount of time, that you want to cache the error response. When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available."
|
|
1041
803
|
);
|
|
1042
|
-
var ErrorResponseSchema =
|
|
804
|
+
var ErrorResponseSchema = z26.union([
|
|
1043
805
|
ErrorResponsePathSchema,
|
|
1044
|
-
|
|
806
|
+
z26.object({
|
|
1045
807
|
path: ErrorResponsePathSchema,
|
|
1046
808
|
statusCode: StatusCodeSchema.optional(),
|
|
1047
809
|
minTTL: MinTTLSchema.optional()
|
|
1048
810
|
})
|
|
1049
811
|
]).optional();
|
|
1050
|
-
var SitesSchema =
|
|
812
|
+
var SitesSchema = z26.record(
|
|
1051
813
|
ResourceIdSchema,
|
|
1052
|
-
|
|
814
|
+
z26.object({
|
|
1053
815
|
domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
|
|
1054
|
-
subDomain:
|
|
816
|
+
subDomain: z26.string().optional(),
|
|
1055
817
|
// bind: z
|
|
1056
818
|
// .object({
|
|
1057
819
|
// auth: z.array(ResourceIdSchema),
|
|
@@ -1060,11 +822,11 @@ var SitesSchema = z31.record(
|
|
|
1060
822
|
// // rest: z.array(ResourceIdSchema),
|
|
1061
823
|
// })
|
|
1062
824
|
// .optional(),
|
|
1063
|
-
static:
|
|
825
|
+
static: z26.union([LocalDirectorySchema, z26.boolean()]).optional().describe(
|
|
1064
826
|
"Specifies the path to the static files directory. Additionally you can also pass `true` when you don't have local static files, but still want to make an S3 bucket."
|
|
1065
827
|
),
|
|
1066
828
|
ssr: FunctionSchema.optional().describe("Specifies the ssr file."),
|
|
1067
|
-
origin:
|
|
829
|
+
origin: z26.enum(["ssr-first", "static-first"]).default("static-first").describe("Specifies the origin fallback ordering."),
|
|
1068
830
|
// bind: z.object({
|
|
1069
831
|
// auth:
|
|
1070
832
|
// h
|
|
@@ -1077,7 +839,11 @@ var SitesSchema = z31.record(
|
|
|
1077
839
|
// build: z.string().optional(),
|
|
1078
840
|
// }),
|
|
1079
841
|
// ]),
|
|
1080
|
-
|
|
842
|
+
geoRestrictions: z26.array(z26.string().length(2).toUpperCase()).default([]).describe("Specifies a list of countries that should be blocked."),
|
|
843
|
+
forwardHost: z26.boolean().default(false).describe(
|
|
844
|
+
"Specify if the host header will be forwarded to the SSR function. Keep in mind that this requires an extra CloudFront Function."
|
|
845
|
+
),
|
|
846
|
+
errors: z26.object({
|
|
1081
847
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
1082
848
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
1083
849
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -1090,16 +856,16 @@ var SitesSchema = z31.record(
|
|
|
1090
856
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
1091
857
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
1092
858
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
1093
|
-
cors:
|
|
1094
|
-
override:
|
|
859
|
+
cors: z26.object({
|
|
860
|
+
override: z26.boolean().default(false),
|
|
1095
861
|
maxAge: DurationSchema.default("365 days"),
|
|
1096
|
-
exposeHeaders:
|
|
1097
|
-
credentials:
|
|
1098
|
-
headers:
|
|
1099
|
-
origins:
|
|
1100
|
-
methods:
|
|
862
|
+
exposeHeaders: z26.string().array().optional(),
|
|
863
|
+
credentials: z26.boolean().default(false),
|
|
864
|
+
headers: z26.string().array().default(["*"]),
|
|
865
|
+
origins: z26.string().array().default(["*"]),
|
|
866
|
+
methods: z26.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
1101
867
|
}).optional().describe("Define the cors headers."),
|
|
1102
|
-
security:
|
|
868
|
+
security: z26.object({
|
|
1103
869
|
// contentSecurityPolicy: z.object({
|
|
1104
870
|
// override: z.boolean().default(false),
|
|
1105
871
|
// policy: z.string(),
|
|
@@ -1141,45 +907,117 @@ var SitesSchema = z31.record(
|
|
|
1141
907
|
// reportUri?: string
|
|
1142
908
|
// }
|
|
1143
909
|
}).optional().describe("Define the security policy."),
|
|
1144
|
-
cache:
|
|
1145
|
-
cookies:
|
|
1146
|
-
headers:
|
|
1147
|
-
queries:
|
|
910
|
+
cache: z26.object({
|
|
911
|
+
cookies: z26.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
912
|
+
headers: z26.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
913
|
+
queries: z26.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
1148
914
|
}).optional().describe(
|
|
1149
915
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
1150
916
|
)
|
|
1151
917
|
})
|
|
1152
918
|
).optional().describe("Define the sites in your stack.");
|
|
1153
919
|
|
|
1154
|
-
// src/feature/
|
|
1155
|
-
import { z as
|
|
1156
|
-
var
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
920
|
+
// src/feature/store/schema.ts
|
|
921
|
+
import { z as z27 } from "zod";
|
|
922
|
+
var StoresSchema = z27.union([
|
|
923
|
+
z27.array(ResourceIdSchema).transform((list) => {
|
|
924
|
+
const stores = {};
|
|
925
|
+
for (const key of list) {
|
|
926
|
+
stores[key] = {};
|
|
927
|
+
}
|
|
928
|
+
return stores;
|
|
929
|
+
}),
|
|
930
|
+
z27.record(
|
|
931
|
+
ResourceIdSchema,
|
|
932
|
+
z27.object({
|
|
933
|
+
// cors: CorsSchema,
|
|
934
|
+
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
935
|
+
versioning: z27.boolean().default(false).describe("Enable versioning of your store."),
|
|
936
|
+
events: z27.object({
|
|
937
|
+
// create
|
|
938
|
+
"created:*": FunctionSchema.optional().describe(
|
|
939
|
+
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
940
|
+
),
|
|
941
|
+
"created:put": FunctionSchema.optional().describe(
|
|
942
|
+
"Subscribe to notifications when an object is created using the PUT API operation."
|
|
943
|
+
),
|
|
944
|
+
"created:post": FunctionSchema.optional().describe(
|
|
945
|
+
"Subscribe to notifications when an object is created using the POST API operation."
|
|
946
|
+
),
|
|
947
|
+
"created:copy": FunctionSchema.optional().describe(
|
|
948
|
+
"Subscribe to notifications when an object is created using the COPY API operation."
|
|
949
|
+
),
|
|
950
|
+
"created:upload": FunctionSchema.optional().describe(
|
|
951
|
+
"Subscribe to notifications when an object multipart upload has been completed."
|
|
952
|
+
),
|
|
953
|
+
// remove
|
|
954
|
+
"removed:*": FunctionSchema.optional().describe(
|
|
955
|
+
"Subscribe to notifications when an object is deleted or a delete marker for a versioned object is created."
|
|
956
|
+
),
|
|
957
|
+
"removed:delete": FunctionSchema.optional().describe(
|
|
958
|
+
"Subscribe to notifications when an object is deleted"
|
|
959
|
+
),
|
|
960
|
+
"removed:marker": FunctionSchema.optional().describe(
|
|
961
|
+
"Subscribe to notifications when a delete marker for a versioned object is created."
|
|
962
|
+
)
|
|
963
|
+
}).optional().describe("Describes the store events you want to subscribe too.")
|
|
964
|
+
})
|
|
965
|
+
)
|
|
966
|
+
]).optional().describe("Define the stores in your stack.");
|
|
967
|
+
|
|
968
|
+
// src/feature/table/schema.ts
|
|
969
|
+
import { z as z28 } from "zod";
|
|
970
|
+
var KeySchema = z28.string().min(1).max(255);
|
|
971
|
+
var TablesSchema = z28.record(
|
|
1169
972
|
ResourceIdSchema,
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
973
|
+
z28.object({
|
|
974
|
+
hash: KeySchema.describe(
|
|
975
|
+
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
976
|
+
),
|
|
977
|
+
sort: KeySchema.optional().describe(
|
|
978
|
+
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
979
|
+
),
|
|
980
|
+
fields: z28.record(z28.string(), z28.enum(["string", "number", "binary"])).optional().describe(
|
|
981
|
+
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
982
|
+
),
|
|
983
|
+
class: z28.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
984
|
+
pointInTimeRecovery: z28.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
985
|
+
timeToLiveAttribute: KeySchema.optional().describe(
|
|
986
|
+
"The name of the TTL attribute used to store the expiration time for items in the table. To update this property, you must first disable TTL and then enable TTL with the new attribute name."
|
|
987
|
+
),
|
|
988
|
+
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
989
|
+
stream: z28.object({
|
|
990
|
+
type: z28.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
991
|
+
"When an item in the table is modified, stream.type determines what information is written to the stream for this table. Valid values are:\n- keys-only - Only the key attributes of the modified item are written to the stream.\n- new-image - The entire item, as it appears after it was modified, is written to the stream.\n- old-image - The entire item, as it appeared before it was modified, is written to the stream.\n- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
992
|
+
),
|
|
993
|
+
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
994
|
+
}).optional().describe(
|
|
995
|
+
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
996
|
+
),
|
|
997
|
+
indexes: z28.record(
|
|
998
|
+
z28.string(),
|
|
999
|
+
z28.object({
|
|
1000
|
+
/** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
|
|
1001
|
+
hash: KeySchema,
|
|
1002
|
+
/** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
|
|
1003
|
+
sort: KeySchema.optional(),
|
|
1004
|
+
/** The set of attributes that are projected into the index:
|
|
1005
|
+
* - all - All of the table attributes are projected into the index.
|
|
1006
|
+
* - keys-only - Only the index and primary keys are projected into the index.
|
|
1007
|
+
* @default 'all'
|
|
1008
|
+
*/
|
|
1009
|
+
projection: z28.enum(["all", "keys-only"]).default("all")
|
|
1010
|
+
})
|
|
1011
|
+
).optional().describe("Specifies the global secondary indexes to be created on the table.")
|
|
1174
1012
|
})
|
|
1175
|
-
).optional().describe("Define the
|
|
1013
|
+
).optional().describe("Define the tables in your stack.");
|
|
1176
1014
|
|
|
1177
1015
|
// src/feature/task/schema.ts
|
|
1178
|
-
import { z as
|
|
1179
|
-
var RetryAttemptsSchema2 =
|
|
1016
|
+
import { z as z29 } from "zod";
|
|
1017
|
+
var RetryAttemptsSchema2 = z29.number().int().min(0).max(2).describe(
|
|
1180
1018
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1181
1019
|
);
|
|
1182
|
-
var TaskSchema =
|
|
1020
|
+
var TaskSchema = z29.union([
|
|
1183
1021
|
LocalFileSchema.transform((file) => ({
|
|
1184
1022
|
consumer: {
|
|
1185
1023
|
code: {
|
|
@@ -1190,40 +1028,40 @@ var TaskSchema = z33.union([
|
|
|
1190
1028
|
},
|
|
1191
1029
|
retryAttempts: void 0
|
|
1192
1030
|
})),
|
|
1193
|
-
|
|
1031
|
+
z29.object({
|
|
1194
1032
|
consumer: FunctionSchema,
|
|
1195
1033
|
retryAttempts: RetryAttemptsSchema2.optional()
|
|
1196
1034
|
})
|
|
1197
1035
|
]);
|
|
1198
|
-
var TasksSchema =
|
|
1036
|
+
var TasksSchema = z29.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1199
1037
|
|
|
1200
1038
|
// src/feature/test/schema.ts
|
|
1201
|
-
import { z as
|
|
1202
|
-
var TestsSchema =
|
|
1039
|
+
import { z as z30 } from "zod";
|
|
1040
|
+
var TestsSchema = z30.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
1203
1041
|
|
|
1204
1042
|
// src/feature/topic/schema.ts
|
|
1205
|
-
import {
|
|
1206
|
-
import { z as
|
|
1207
|
-
var TopicNameSchema =
|
|
1208
|
-
var TopicsSchema =
|
|
1043
|
+
import { kebabCase as kebabCase3 } from "change-case";
|
|
1044
|
+
import { z as z31 } from "zod";
|
|
1045
|
+
var TopicNameSchema = z31.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
|
|
1046
|
+
var TopicsSchema = z31.array(TopicNameSchema).refine((topics) => {
|
|
1209
1047
|
return topics.length === new Set(topics).size;
|
|
1210
1048
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
1211
|
-
var SubscribersSchema =
|
|
1049
|
+
var SubscribersSchema = z31.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
1212
1050
|
|
|
1213
1051
|
// src/config/stack.ts
|
|
1214
1052
|
var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
|
|
1215
|
-
var NameSchema = ResourceIdSchema.refine((name) => !["base"].includes(name), {
|
|
1053
|
+
var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
|
|
1216
1054
|
message: `Stack name can't be a reserved name.`
|
|
1217
1055
|
}).describe("Stack name.");
|
|
1218
|
-
var StackSchema =
|
|
1219
|
-
$schema:
|
|
1056
|
+
var StackSchema = z32.object({
|
|
1057
|
+
$schema: z32.string().optional(),
|
|
1220
1058
|
name: NameSchema,
|
|
1221
1059
|
depends: DependsSchema,
|
|
1222
1060
|
commands: CommandsSchema,
|
|
1223
1061
|
// onFailure: OnFailureSchema,
|
|
1224
|
-
auth: AuthSchema,
|
|
1225
|
-
graphql: GraphQLSchema,
|
|
1226
|
-
http: HttpSchema,
|
|
1062
|
+
// auth: AuthSchema,
|
|
1063
|
+
// graphql: GraphQLSchema,
|
|
1064
|
+
// http: HttpSchema,
|
|
1227
1065
|
rest: RestSchema,
|
|
1228
1066
|
rpc: RpcSchema,
|
|
1229
1067
|
configs: ConfigsSchema,
|
|
@@ -1232,11 +1070,11 @@ var StackSchema = z36.object({
|
|
|
1232
1070
|
topics: TopicsSchema,
|
|
1233
1071
|
subscribers: SubscribersSchema,
|
|
1234
1072
|
functions: FunctionsSchema,
|
|
1235
|
-
instances: InstancesSchema,
|
|
1073
|
+
// instances: InstancesSchema,
|
|
1236
1074
|
tasks: TasksSchema,
|
|
1237
1075
|
tables: TablesSchema,
|
|
1238
1076
|
stores: StoresSchema,
|
|
1239
|
-
streams: StreamsSchema,
|
|
1077
|
+
// streams: StreamsSchema,
|
|
1240
1078
|
queues: QueuesSchema,
|
|
1241
1079
|
pubsub: PubSubSchema,
|
|
1242
1080
|
searchs: SearchsSchema,
|