@awsless/awsless 0.0.440 → 0.0.441
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/app.json +1 -1
- package/dist/bin.js +313 -308
- package/dist/build-json-schema.js +303 -339
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/stack.json +1 -1
- package/package.json +12 -12
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
3
|
|
|
4
4
|
// src/config/stack.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z29 } from "zod";
|
|
6
6
|
|
|
7
7
|
// src/feature/auth/schema.ts
|
|
8
|
-
import { z as
|
|
8
|
+
import { z as z7 } from "zod";
|
|
9
9
|
|
|
10
10
|
// src/config/schema/resource-id.ts
|
|
11
11
|
import { paramCase } from "change-case";
|
|
@@ -15,7 +15,7 @@ var ResourceIdSchema = z.string().min(3).max(24).regex(/^[a-z0-9\-]+$/i, "Invali
|
|
|
15
15
|
// src/feature/function/schema.ts
|
|
16
16
|
import { days, minutes, seconds, toDays } from "@awsless/duration";
|
|
17
17
|
import { gibibytes, mebibytes } from "@awsless/size";
|
|
18
|
-
import { z as
|
|
18
|
+
import { z as z5 } from "zod";
|
|
19
19
|
|
|
20
20
|
// src/config/schema/duration.ts
|
|
21
21
|
import { z as z2 } from "zod";
|
|
@@ -33,76 +33,45 @@ var durationMax = (max) => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// src/config/schema/local-directory.ts
|
|
36
|
-
import { stat as stat2 } from "fs/promises";
|
|
37
|
-
import { z as z4 } from "zod";
|
|
38
|
-
|
|
39
|
-
// src/config/schema/local-file.ts
|
|
40
36
|
import { stat } from "fs/promises";
|
|
41
|
-
import { join as join2 } from "path";
|
|
42
|
-
import { z as z3 } from "zod";
|
|
43
|
-
|
|
44
|
-
// src/util/path.ts
|
|
45
|
-
import { join, normalize } from "path";
|
|
46
|
-
var root = process.cwd();
|
|
47
|
-
var directories = {
|
|
48
|
-
root,
|
|
49
|
-
get output() {
|
|
50
|
-
return join(this.root, ".awsless");
|
|
51
|
-
},
|
|
52
|
-
get cache() {
|
|
53
|
-
return join(this.output, "cache");
|
|
54
|
-
},
|
|
55
|
-
get state() {
|
|
56
|
-
return join(this.output, "state");
|
|
57
|
-
},
|
|
58
|
-
get build() {
|
|
59
|
-
return join(this.output, "build");
|
|
60
|
-
},
|
|
61
|
-
get types() {
|
|
62
|
-
return join(this.output, "types");
|
|
63
|
-
},
|
|
64
|
-
get temp() {
|
|
65
|
-
return join(this.output, "temp");
|
|
66
|
-
},
|
|
67
|
-
// get template() {
|
|
68
|
-
// return join(this.output, 'template')
|
|
69
|
-
// },
|
|
70
|
-
get test() {
|
|
71
|
-
return join(this.output, "test");
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
37
|
|
|
75
|
-
// src/config/schema/
|
|
38
|
+
// src/config/schema/relative-path.ts
|
|
39
|
+
import { join } from "path";
|
|
40
|
+
import { z as z3 } from "zod";
|
|
76
41
|
var basePath;
|
|
77
42
|
var resolvePath = (path) => {
|
|
78
43
|
if (path.startsWith(".") && basePath) {
|
|
79
|
-
return
|
|
44
|
+
return join(basePath, path);
|
|
80
45
|
}
|
|
81
|
-
return
|
|
46
|
+
return path;
|
|
82
47
|
};
|
|
83
|
-
var
|
|
48
|
+
var RelativePathSchema = z3.string().transform((path) => resolvePath(path));
|
|
49
|
+
|
|
50
|
+
// src/config/schema/local-directory.ts
|
|
51
|
+
var LocalDirectorySchema = RelativePathSchema.refine(async (path) => {
|
|
84
52
|
try {
|
|
85
53
|
const s = await stat(path);
|
|
86
|
-
return s.
|
|
54
|
+
return s.isDirectory();
|
|
87
55
|
} catch (error) {
|
|
88
56
|
return false;
|
|
89
57
|
}
|
|
90
|
-
}, `
|
|
58
|
+
}, `Directory doesn't exist`);
|
|
91
59
|
|
|
92
|
-
// src/config/schema/local-
|
|
93
|
-
|
|
60
|
+
// src/config/schema/local-file.ts
|
|
61
|
+
import { stat as stat2 } from "fs/promises";
|
|
62
|
+
var LocalFileSchema = RelativePathSchema.refine(async (path) => {
|
|
94
63
|
try {
|
|
95
64
|
const s = await stat2(path);
|
|
96
|
-
return s.
|
|
65
|
+
return s.isFile();
|
|
97
66
|
} catch (error) {
|
|
98
67
|
return false;
|
|
99
68
|
}
|
|
100
|
-
}, `
|
|
69
|
+
}, `File doesn't exist`);
|
|
101
70
|
|
|
102
71
|
// src/config/schema/size.ts
|
|
103
|
-
import { z as
|
|
72
|
+
import { z as z4 } from "zod";
|
|
104
73
|
import { parse as parse2 } from "@awsless/size";
|
|
105
|
-
var SizeSchema =
|
|
74
|
+
var SizeSchema = z4.string().regex(/^[0-9]+ (B|KB|MB|GB|TB|PB)$/, "Invalid size").transform((v) => parse2(v));
|
|
106
75
|
var sizeMin = (min) => {
|
|
107
76
|
return (size) => {
|
|
108
77
|
return size.value >= min.value;
|
|
@@ -125,32 +94,32 @@ var EphemeralStorageSizeSchema = SizeSchema.refine(
|
|
|
125
94
|
sizeMin(mebibytes(512)),
|
|
126
95
|
"Minimum ephemeral storage size is 512 MB"
|
|
127
96
|
).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.");
|
|
128
|
-
var ReservedConcurrentExecutionsSchema =
|
|
129
|
-
var EnvironmentSchema =
|
|
130
|
-
var ArchitectureSchema =
|
|
131
|
-
var RetryAttemptsSchema =
|
|
97
|
+
var ReservedConcurrentExecutionsSchema = z5.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
|
|
98
|
+
var EnvironmentSchema = z5.record(z5.string(), z5.string()).optional().describe("Environment variable key-value pairs.");
|
|
99
|
+
var ArchitectureSchema = z5.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
100
|
+
var RetryAttemptsSchema = z5.number().int().min(0).max(2).describe(
|
|
132
101
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
133
102
|
);
|
|
134
|
-
var NodeRuntimeSchema =
|
|
135
|
-
var ContainerRuntimeSchema =
|
|
103
|
+
var NodeRuntimeSchema = z5.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]);
|
|
104
|
+
var ContainerRuntimeSchema = z5.literal("container");
|
|
136
105
|
var RuntimeSchema = NodeRuntimeSchema.or(ContainerRuntimeSchema).describe("The identifier of the function's runtime.");
|
|
137
|
-
var ActionSchema =
|
|
138
|
-
var ActionsSchema =
|
|
139
|
-
var ArnSchema =
|
|
140
|
-
var WildcardSchema =
|
|
141
|
-
var ResourceSchema =
|
|
142
|
-
var ResourcesSchema =
|
|
143
|
-
var PermissionSchema =
|
|
144
|
-
effect:
|
|
106
|
+
var ActionSchema = z5.string();
|
|
107
|
+
var ActionsSchema = z5.union([ActionSchema.transform((v) => [v]), ActionSchema.array()]);
|
|
108
|
+
var ArnSchema = z5.string().startsWith("arn:").transform((v) => v);
|
|
109
|
+
var WildcardSchema = z5.literal("*");
|
|
110
|
+
var ResourceSchema = z5.union([ArnSchema, WildcardSchema]);
|
|
111
|
+
var ResourcesSchema = z5.union([ResourceSchema.transform((v) => [v]), ResourceSchema.array()]);
|
|
112
|
+
var PermissionSchema = z5.object({
|
|
113
|
+
effect: z5.enum(["allow", "deny"]).default("allow"),
|
|
145
114
|
actions: ActionsSchema,
|
|
146
115
|
resources: ResourcesSchema
|
|
147
116
|
});
|
|
148
|
-
var PermissionsSchema =
|
|
149
|
-
var WarmSchema =
|
|
150
|
-
var VPCSchema =
|
|
151
|
-
var MinifySchema =
|
|
152
|
-
var HandlerSchema =
|
|
153
|
-
var DescriptionSchema =
|
|
117
|
+
var PermissionsSchema = z5.union([PermissionSchema.transform((v) => [v]), PermissionSchema.array()]).describe("Add IAM permissions to your function.");
|
|
118
|
+
var WarmSchema = z5.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.");
|
|
119
|
+
var VPCSchema = z5.boolean().describe("Put the function inside your global VPC.");
|
|
120
|
+
var MinifySchema = z5.boolean().describe("Minify the function code.");
|
|
121
|
+
var HandlerSchema = z5.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
|
|
122
|
+
var DescriptionSchema = z5.string().describe("A description of the function.");
|
|
154
123
|
var validLogRetentionDays = [
|
|
155
124
|
...[1n, 3n, 5n, 7n, 14n, 30n, 60n, 90n, 120n, 150n],
|
|
156
125
|
...[180n, 365n, 400n, 545n, 731n, 1096n, 1827n, 2192n],
|
|
@@ -165,56 +134,54 @@ var LogRetentionSchema = DurationSchema.refine(
|
|
|
165
134
|
},
|
|
166
135
|
`Invalid log retention. Valid days are: ${validLogRetentionDays.map((days3) => `${days3}`).join(", ")}`
|
|
167
136
|
).describe("The log retention duration.");
|
|
168
|
-
var LogSubscriptionSchema =
|
|
137
|
+
var LogSubscriptionSchema = z5.union([
|
|
169
138
|
LocalFileSchema.transform((file) => ({
|
|
170
139
|
file
|
|
171
140
|
})),
|
|
172
|
-
|
|
141
|
+
z5.object({
|
|
173
142
|
subscriber: LocalFileSchema,
|
|
174
|
-
filter:
|
|
143
|
+
filter: z5.string().optional()
|
|
175
144
|
})
|
|
176
145
|
]).describe(
|
|
177
146
|
"Log Subscription allow you to subscribe to a real-time stream of log events and have them delivered to a specific destination"
|
|
178
147
|
);
|
|
179
|
-
var LogSchema =
|
|
180
|
-
|
|
148
|
+
var LogSchema = z5.union([
|
|
149
|
+
z5.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
|
|
181
150
|
LogRetentionSchema.transform((retention) => ({ retention })),
|
|
182
|
-
|
|
151
|
+
z5.object({
|
|
183
152
|
subscription: LogSubscriptionSchema.optional(),
|
|
184
153
|
retention: LogRetentionSchema.optional(),
|
|
185
|
-
format:
|
|
154
|
+
format: z5.enum(["text", "json"]).describe(
|
|
186
155
|
`The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.`
|
|
187
156
|
).optional(),
|
|
188
|
-
system:
|
|
157
|
+
system: z5.enum(["debug", "info", "warn"]).describe(
|
|
189
158
|
"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."
|
|
190
159
|
).optional(),
|
|
191
|
-
level:
|
|
160
|
+
level: z5.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
|
|
192
161
|
"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."
|
|
193
162
|
).optional()
|
|
194
163
|
})
|
|
195
164
|
]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
|
|
196
|
-
var LayersSchema =
|
|
165
|
+
var LayersSchema = z5.string().array().describe(
|
|
197
166
|
// `A list of function layers to add to the function's execution environment..`
|
|
198
167
|
`A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.`
|
|
199
168
|
);
|
|
200
|
-
var FileCodeSchema =
|
|
169
|
+
var FileCodeSchema = z5.object({
|
|
201
170
|
file: LocalFileSchema.describe("The file path of the function code."),
|
|
202
171
|
minify: MinifySchema.optional().default(true),
|
|
203
|
-
external:
|
|
172
|
+
external: z5.string().array().optional().describe(`A list of external packages that won't be included in the bundle.`)
|
|
204
173
|
});
|
|
205
|
-
var BundleCodeSchema =
|
|
174
|
+
var BundleCodeSchema = z5.object({
|
|
206
175
|
bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
|
|
207
176
|
});
|
|
208
|
-
var CodeSchema =
|
|
209
|
-
LocalFileSchema.transform(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
})
|
|
213
|
-
),
|
|
177
|
+
var CodeSchema = z5.union([
|
|
178
|
+
LocalFileSchema.transform((file) => ({
|
|
179
|
+
file
|
|
180
|
+
})).pipe(FileCodeSchema),
|
|
214
181
|
FileCodeSchema,
|
|
215
182
|
BundleCodeSchema
|
|
216
183
|
]).describe("Specify the code of your function.");
|
|
217
|
-
var FnSchema =
|
|
184
|
+
var FnSchema = z5.object({
|
|
218
185
|
code: CodeSchema,
|
|
219
186
|
// node
|
|
220
187
|
handler: HandlerSchema.optional(),
|
|
@@ -237,16 +204,14 @@ var FnSchema = z6.object({
|
|
|
237
204
|
environment: EnvironmentSchema.optional(),
|
|
238
205
|
permissions: PermissionsSchema.optional()
|
|
239
206
|
});
|
|
240
|
-
var FunctionSchema =
|
|
241
|
-
LocalFileSchema.transform((
|
|
242
|
-
code
|
|
243
|
-
|
|
244
|
-
})
|
|
245
|
-
})),
|
|
207
|
+
var FunctionSchema = z5.union([
|
|
208
|
+
LocalFileSchema.transform((code) => ({
|
|
209
|
+
code
|
|
210
|
+
})).pipe(FnSchema),
|
|
246
211
|
FnSchema
|
|
247
212
|
]);
|
|
248
|
-
var FunctionsSchema =
|
|
249
|
-
var FunctionDefaultSchema =
|
|
213
|
+
var FunctionsSchema = z5.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
|
|
214
|
+
var FunctionDefaultSchema = z5.object({
|
|
250
215
|
runtime: RuntimeSchema.default("nodejs20.x"),
|
|
251
216
|
// node
|
|
252
217
|
handler: HandlerSchema.default("index.default"),
|
|
@@ -275,11 +240,11 @@ var FunctionDefaultSchema = z6.object({
|
|
|
275
240
|
}).default({});
|
|
276
241
|
|
|
277
242
|
// src/config/schema/email.ts
|
|
278
|
-
import { z as
|
|
279
|
-
var EmailSchema =
|
|
243
|
+
import { z as z6 } from "zod";
|
|
244
|
+
var EmailSchema = z6.string().email();
|
|
280
245
|
|
|
281
246
|
// src/feature/auth/schema.ts
|
|
282
|
-
var TriggersSchema =
|
|
247
|
+
var TriggersSchema = z7.object({
|
|
283
248
|
beforeToken: FunctionSchema.optional().describe("A pre jwt token generation AWS Lambda trigger."),
|
|
284
249
|
beforeLogin: FunctionSchema.optional().describe("A pre user login AWS Lambda trigger."),
|
|
285
250
|
afterLogin: FunctionSchema.optional().describe("A post user login AWS Lambda trigger."),
|
|
@@ -292,42 +257,42 @@ var TriggersSchema = z8.object({
|
|
|
292
257
|
createChallenge: FunctionSchema.optional().describe("Creates an authentication challenge."),
|
|
293
258
|
verifyChallenge: FunctionSchema.optional().describe("Verifies the authentication challenge response.")
|
|
294
259
|
}).describe("Specifies the configuration for AWS Lambda triggers.");
|
|
295
|
-
var AuthSchema =
|
|
260
|
+
var AuthSchema = z7.record(
|
|
296
261
|
ResourceIdSchema,
|
|
297
|
-
|
|
298
|
-
access:
|
|
262
|
+
z7.object({
|
|
263
|
+
access: z7.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
|
|
299
264
|
triggers: TriggersSchema.optional()
|
|
300
265
|
})
|
|
301
266
|
).optional().describe("Define the auth triggers in your stack.");
|
|
302
|
-
var AuthDefaultSchema =
|
|
267
|
+
var AuthDefaultSchema = z7.record(
|
|
303
268
|
ResourceIdSchema,
|
|
304
|
-
|
|
305
|
-
allowUserRegistration:
|
|
306
|
-
messaging:
|
|
269
|
+
z7.object({
|
|
270
|
+
allowUserRegistration: z7.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
|
|
271
|
+
messaging: z7.object({
|
|
307
272
|
fromEmail: EmailSchema.describe("Specifies the sender's email address."),
|
|
308
|
-
fromName:
|
|
273
|
+
fromName: z7.string().optional().describe("Specifies the sender's name."),
|
|
309
274
|
replyTo: EmailSchema.optional().describe(
|
|
310
275
|
"The destination to which the receiver of the email should reply."
|
|
311
276
|
)
|
|
312
277
|
}).optional().describe("The email configuration for sending messages."),
|
|
313
278
|
// secret: z.boolean().default(false).describe('Specifies whether you want to generate a client secret.'),
|
|
314
|
-
username:
|
|
315
|
-
emailAlias:
|
|
316
|
-
caseSensitive:
|
|
279
|
+
username: z7.object({
|
|
280
|
+
emailAlias: z7.boolean().default(true).describe("Allow the user email to be used as username."),
|
|
281
|
+
caseSensitive: z7.boolean().default(false).describe(
|
|
317
282
|
"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."
|
|
318
283
|
)
|
|
319
284
|
}).default({}).describe("The username policy."),
|
|
320
|
-
password:
|
|
321
|
-
minLength:
|
|
322
|
-
uppercase:
|
|
323
|
-
lowercase:
|
|
324
|
-
numbers:
|
|
325
|
-
symbols:
|
|
285
|
+
password: z7.object({
|
|
286
|
+
minLength: z7.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
|
|
287
|
+
uppercase: z7.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
|
|
288
|
+
lowercase: z7.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
|
|
289
|
+
numbers: z7.boolean().default(true).describe("Required users to use at least one number in their password."),
|
|
290
|
+
symbols: z7.boolean().default(true).describe("Required users to use at least one symbol in their password."),
|
|
326
291
|
temporaryPasswordValidity: DurationSchema.default("7 days").describe(
|
|
327
292
|
"The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
|
|
328
293
|
)
|
|
329
294
|
}).default({}).describe("The password policy."),
|
|
330
|
-
validity:
|
|
295
|
+
validity: z7.object({
|
|
331
296
|
idToken: DurationSchema.default("1 hour").describe(
|
|
332
297
|
"The ID token time limit. After this limit expires, your user can't use their ID token."
|
|
333
298
|
),
|
|
@@ -343,8 +308,8 @@ var AuthDefaultSchema = z8.record(
|
|
|
343
308
|
).default({}).describe("Define the authenticatable users in your app.");
|
|
344
309
|
|
|
345
310
|
// src/feature/cache/schema.ts
|
|
346
|
-
import { z as
|
|
347
|
-
var TypeSchema =
|
|
311
|
+
import { z as z8 } from "zod";
|
|
312
|
+
var TypeSchema = z8.enum([
|
|
348
313
|
"t4g.small",
|
|
349
314
|
"t4g.medium",
|
|
350
315
|
"r6g.large",
|
|
@@ -359,29 +324,29 @@ var TypeSchema = z9.enum([
|
|
|
359
324
|
"r6gd.4xlarge",
|
|
360
325
|
"r6gd.8xlarge"
|
|
361
326
|
]);
|
|
362
|
-
var PortSchema =
|
|
363
|
-
var ShardsSchema =
|
|
364
|
-
var ReplicasPerShardSchema =
|
|
365
|
-
var EngineSchema =
|
|
366
|
-
var CachesSchema =
|
|
327
|
+
var PortSchema = z8.number().int().min(1).max(5e4);
|
|
328
|
+
var ShardsSchema = z8.number().int().min(0).max(100);
|
|
329
|
+
var ReplicasPerShardSchema = z8.number().int().min(0).max(5);
|
|
330
|
+
var EngineSchema = z8.enum(["7.0", "6.2"]);
|
|
331
|
+
var CachesSchema = z8.record(
|
|
367
332
|
ResourceIdSchema,
|
|
368
|
-
|
|
333
|
+
z8.object({
|
|
369
334
|
type: TypeSchema.default("t4g.small"),
|
|
370
335
|
port: PortSchema.default(6379),
|
|
371
336
|
shards: ShardsSchema.default(1),
|
|
372
337
|
replicasPerShard: ReplicasPerShardSchema.default(1),
|
|
373
338
|
engine: EngineSchema.default("7.0"),
|
|
374
|
-
dataTiering:
|
|
339
|
+
dataTiering: z8.boolean().default(false)
|
|
375
340
|
})
|
|
376
341
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
377
342
|
|
|
378
343
|
// src/feature/command/schema.ts
|
|
379
|
-
import { z as
|
|
380
|
-
var CommandSchema =
|
|
381
|
-
|
|
344
|
+
import { z as z9 } from "zod";
|
|
345
|
+
var CommandSchema = z9.union([
|
|
346
|
+
z9.object({
|
|
382
347
|
file: LocalFileSchema,
|
|
383
|
-
handler:
|
|
384
|
-
description:
|
|
348
|
+
handler: z9.string().default("default").describe("The name of the handler that needs to run"),
|
|
349
|
+
description: z9.string().optional().describe("A description of the command")
|
|
385
350
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
386
351
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
387
352
|
}),
|
|
@@ -391,22 +356,22 @@ var CommandSchema = z10.union([
|
|
|
391
356
|
description: void 0
|
|
392
357
|
}))
|
|
393
358
|
]);
|
|
394
|
-
var CommandsSchema =
|
|
359
|
+
var CommandsSchema = z9.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
395
360
|
|
|
396
361
|
// src/feature/config/schema.ts
|
|
397
|
-
import { z as
|
|
398
|
-
var ConfigNameSchema =
|
|
399
|
-
var ConfigsSchema =
|
|
362
|
+
import { z as z10 } from "zod";
|
|
363
|
+
var ConfigNameSchema = z10.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
364
|
+
var ConfigsSchema = z10.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
400
365
|
|
|
401
366
|
// src/feature/cron/schema/index.ts
|
|
402
|
-
import { z as
|
|
367
|
+
import { z as z12 } from "zod";
|
|
403
368
|
|
|
404
369
|
// src/feature/cron/schema/schedule.ts
|
|
405
|
-
import { z as
|
|
370
|
+
import { z as z11 } from "zod";
|
|
406
371
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
407
|
-
var RateExpressionSchema =
|
|
372
|
+
var RateExpressionSchema = z11.custom(
|
|
408
373
|
(value) => {
|
|
409
|
-
return
|
|
374
|
+
return z11.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
410
375
|
const [str] = rate.split(" ");
|
|
411
376
|
const number = parseInt(str);
|
|
412
377
|
return number > 0;
|
|
@@ -422,9 +387,9 @@ var RateExpressionSchema = z12.custom(
|
|
|
422
387
|
}
|
|
423
388
|
return `rate(${rate})`;
|
|
424
389
|
});
|
|
425
|
-
var CronExpressionSchema =
|
|
390
|
+
var CronExpressionSchema = z11.custom(
|
|
426
391
|
(value) => {
|
|
427
|
-
return
|
|
392
|
+
return z11.string().safeParse(value).success;
|
|
428
393
|
},
|
|
429
394
|
{ message: "Invalid cron expression" }
|
|
430
395
|
).superRefine((value, ctx) => {
|
|
@@ -433,12 +398,12 @@ var CronExpressionSchema = z12.custom(
|
|
|
433
398
|
} catch (error) {
|
|
434
399
|
if (error instanceof Error) {
|
|
435
400
|
ctx.addIssue({
|
|
436
|
-
code:
|
|
401
|
+
code: z11.ZodIssueCode.custom,
|
|
437
402
|
message: `Invalid cron expression: ${error.message}`
|
|
438
403
|
});
|
|
439
404
|
} else {
|
|
440
405
|
ctx.addIssue({
|
|
441
|
-
code:
|
|
406
|
+
code: z11.ZodIssueCode.custom,
|
|
442
407
|
message: "Invalid cron expression"
|
|
443
408
|
});
|
|
444
409
|
}
|
|
@@ -449,31 +414,31 @@ var CronExpressionSchema = z12.custom(
|
|
|
449
414
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
450
415
|
|
|
451
416
|
// src/feature/cron/schema/index.ts
|
|
452
|
-
var CronsSchema =
|
|
417
|
+
var CronsSchema = z12.record(
|
|
453
418
|
ResourceIdSchema,
|
|
454
|
-
|
|
455
|
-
enabled:
|
|
419
|
+
z12.object({
|
|
420
|
+
enabled: z12.boolean().default(true).describe("If the cron is enabled."),
|
|
456
421
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
457
422
|
schedule: ScheduleExpressionSchema.describe(
|
|
458
423
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
459
424
|
),
|
|
460
|
-
payload:
|
|
425
|
+
payload: z12.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
461
426
|
})
|
|
462
427
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
463
428
|
|
|
464
429
|
// src/feature/graphql/schema.ts
|
|
465
|
-
import { z as
|
|
430
|
+
import { z as z13 } from "zod";
|
|
466
431
|
var AuthorizerTtl = DurationSchema.describe(
|
|
467
432
|
`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.`
|
|
468
433
|
);
|
|
469
|
-
var GraphQLDefaultSchema =
|
|
434
|
+
var GraphQLDefaultSchema = z13.record(
|
|
470
435
|
ResourceIdSchema,
|
|
471
|
-
|
|
436
|
+
z13.object({
|
|
472
437
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
473
|
-
subDomain:
|
|
474
|
-
auth:
|
|
438
|
+
subDomain: z13.string().optional(),
|
|
439
|
+
auth: z13.union([
|
|
475
440
|
ResourceIdSchema,
|
|
476
|
-
|
|
441
|
+
z13.object({
|
|
477
442
|
authorizer: FunctionSchema,
|
|
478
443
|
ttl: AuthorizerTtl.default("1 hour")
|
|
479
444
|
})
|
|
@@ -485,22 +450,22 @@ var GraphQLDefaultSchema = z14.record(
|
|
|
485
450
|
resolver: LocalFileSchema.optional()
|
|
486
451
|
})
|
|
487
452
|
).describe(`Define the global GraphQL API's.`).optional();
|
|
488
|
-
var GraphQLSchema =
|
|
453
|
+
var GraphQLSchema = z13.record(
|
|
489
454
|
ResourceIdSchema,
|
|
490
|
-
|
|
455
|
+
z13.object({
|
|
491
456
|
// schema: z.union([LocalFileSchema.transform(v => [v]), z.array(LocalFileSchema).min(1)]).optional(),
|
|
492
457
|
schema: LocalFileSchema.describe("The graphql schema file."),
|
|
493
|
-
resolvers:
|
|
458
|
+
resolvers: z13.record(
|
|
494
459
|
// TypeName
|
|
495
|
-
|
|
496
|
-
|
|
460
|
+
z13.string(),
|
|
461
|
+
z13.record(
|
|
497
462
|
// FieldName
|
|
498
|
-
|
|
499
|
-
|
|
463
|
+
z13.string(),
|
|
464
|
+
z13.union([
|
|
500
465
|
FunctionSchema.transform((consumer) => ({
|
|
501
466
|
consumer
|
|
502
467
|
})),
|
|
503
|
-
|
|
468
|
+
z13.object({
|
|
504
469
|
consumer: FunctionSchema,
|
|
505
470
|
resolver: LocalFileSchema.optional()
|
|
506
471
|
})
|
|
@@ -511,22 +476,22 @@ var GraphQLSchema = z14.record(
|
|
|
511
476
|
).describe("Define the schema & resolvers in your stack for your global GraphQL API.").optional();
|
|
512
477
|
|
|
513
478
|
// src/feature/http/schema.ts
|
|
514
|
-
import { z as
|
|
515
|
-
var RouteSchema =
|
|
516
|
-
var HttpDefaultSchema =
|
|
479
|
+
import { z as z14 } from "zod";
|
|
480
|
+
var RouteSchema = z14.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
|
|
481
|
+
var HttpDefaultSchema = z14.record(
|
|
517
482
|
ResourceIdSchema,
|
|
518
|
-
|
|
483
|
+
z14.object({
|
|
519
484
|
domain: ResourceIdSchema.describe("The domain id to link your API with."),
|
|
520
|
-
subDomain:
|
|
485
|
+
subDomain: z14.string().optional()
|
|
521
486
|
// auth: ResourceIdSchema.optional(),
|
|
522
487
|
})
|
|
523
488
|
).optional().describe("Define your global HTTP API's.");
|
|
524
|
-
var HttpSchema =
|
|
489
|
+
var HttpSchema = z14.record(ResourceIdSchema, z14.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
|
|
525
490
|
|
|
526
491
|
// src/feature/instance/schema.ts
|
|
527
|
-
import { z as
|
|
528
|
-
var ImageSchema =
|
|
529
|
-
var TypeSchema2 =
|
|
492
|
+
import { z as z15 } from "zod";
|
|
493
|
+
var ImageSchema = z15.string().regex(/^ami\-[0-9a-f]+/).describe("The ID of the AMI.");
|
|
494
|
+
var TypeSchema2 = z15.enum([
|
|
530
495
|
"t3.nano",
|
|
531
496
|
"t3.micro",
|
|
532
497
|
"t3.small",
|
|
@@ -544,48 +509,48 @@ var TypeSchema2 = z16.enum([
|
|
|
544
509
|
"g4ad.xlarge",
|
|
545
510
|
"g4dn.xlarge"
|
|
546
511
|
]).describe(`The instance type.`);
|
|
547
|
-
var CommandSchema2 =
|
|
512
|
+
var CommandSchema2 = z15.string().describe(`The script you want to execute when the instance starts up.`);
|
|
548
513
|
var CodeSchema2 = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
|
|
549
|
-
var ConnectSchema =
|
|
550
|
-
var EnvironmentSchema2 =
|
|
551
|
-
var ActionSchema2 =
|
|
552
|
-
var ActionsSchema2 =
|
|
553
|
-
var ArnSchema2 =
|
|
554
|
-
var WildcardSchema2 =
|
|
555
|
-
var ResourceSchema2 =
|
|
556
|
-
var ResourcesSchema2 =
|
|
557
|
-
var PermissionSchema2 =
|
|
558
|
-
effect:
|
|
514
|
+
var ConnectSchema = z15.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
|
|
515
|
+
var EnvironmentSchema2 = z15.record(z15.string(), z15.string()).optional().describe("Environment variable key-value pairs.");
|
|
516
|
+
var ActionSchema2 = z15.string();
|
|
517
|
+
var ActionsSchema2 = z15.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
|
|
518
|
+
var ArnSchema2 = z15.string().startsWith("arn:");
|
|
519
|
+
var WildcardSchema2 = z15.literal("*");
|
|
520
|
+
var ResourceSchema2 = z15.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
|
|
521
|
+
var ResourcesSchema2 = z15.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
|
|
522
|
+
var PermissionSchema2 = z15.object({
|
|
523
|
+
effect: z15.enum(["allow", "deny"]).default("allow"),
|
|
559
524
|
actions: ActionsSchema2,
|
|
560
525
|
resources: ResourcesSchema2
|
|
561
526
|
});
|
|
562
|
-
var PermissionsSchema2 =
|
|
563
|
-
var InstanceDefaultSchema =
|
|
527
|
+
var PermissionsSchema2 = z15.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
|
|
528
|
+
var InstanceDefaultSchema = z15.object({
|
|
564
529
|
connect: ConnectSchema.default(false)
|
|
565
530
|
}).default({}).describe("Define the default settings for all instances in your stacks.");
|
|
566
|
-
var InstancesSchema =
|
|
531
|
+
var InstancesSchema = z15.record(
|
|
567
532
|
ResourceIdSchema,
|
|
568
|
-
|
|
533
|
+
z15.object({
|
|
569
534
|
image: ImageSchema,
|
|
570
535
|
type: TypeSchema2,
|
|
571
536
|
code: CodeSchema2,
|
|
572
|
-
user:
|
|
537
|
+
user: z15.string().default("ec2-user"),
|
|
573
538
|
command: CommandSchema2.optional(),
|
|
574
539
|
environment: EnvironmentSchema2.optional(),
|
|
575
540
|
permissions: PermissionsSchema2.optional(),
|
|
576
|
-
waitForTermination:
|
|
541
|
+
waitForTermination: z15.boolean().default(true)
|
|
577
542
|
})
|
|
578
543
|
).optional().describe("Define the instances in your stack.");
|
|
579
544
|
|
|
580
545
|
// src/feature/pubsub/schema.ts
|
|
581
|
-
import { z as
|
|
546
|
+
import { z as z16 } from "zod";
|
|
582
547
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
583
|
-
var PubSubDefaultSchema =
|
|
548
|
+
var PubSubDefaultSchema = z16.record(
|
|
584
549
|
ResourceIdSchema,
|
|
585
|
-
|
|
550
|
+
z16.object({
|
|
586
551
|
auth: FunctionSchema,
|
|
587
552
|
domain: DomainSchema.optional(),
|
|
588
|
-
subDomain:
|
|
553
|
+
subDomain: z16.string().optional()
|
|
589
554
|
// auth: z.union([
|
|
590
555
|
// ResourceIdSchema,
|
|
591
556
|
// z.object({
|
|
@@ -601,11 +566,11 @@ var PubSubDefaultSchema = z17.record(
|
|
|
601
566
|
// .optional(),
|
|
602
567
|
})
|
|
603
568
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
604
|
-
var PubSubSchema =
|
|
569
|
+
var PubSubSchema = z16.record(
|
|
605
570
|
ResourceIdSchema,
|
|
606
|
-
|
|
607
|
-
sql:
|
|
608
|
-
sqlVersion:
|
|
571
|
+
z16.object({
|
|
572
|
+
sql: z16.string().describe("The SQL statement used to query the IOT topic."),
|
|
573
|
+
sqlVersion: z16.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."),
|
|
609
574
|
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
610
575
|
})
|
|
611
576
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
@@ -613,7 +578,7 @@ var PubSubSchema = z17.record(
|
|
|
613
578
|
// src/feature/queue/schema.ts
|
|
614
579
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
615
580
|
import { kibibytes } from "@awsless/size";
|
|
616
|
-
import { z as
|
|
581
|
+
import { z as z17 } from "zod";
|
|
617
582
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
618
583
|
durationMin(minutes2(1)),
|
|
619
584
|
"Minimum retention period is 1 minute"
|
|
@@ -641,10 +606,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
641
606
|
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(
|
|
642
607
|
"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."
|
|
643
608
|
);
|
|
644
|
-
var BatchSizeSchema =
|
|
609
|
+
var BatchSizeSchema = z17.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
645
610
|
"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."
|
|
646
611
|
);
|
|
647
|
-
var MaxConcurrencySchema =
|
|
612
|
+
var MaxConcurrencySchema = z17.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
648
613
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
649
614
|
);
|
|
650
615
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -653,7 +618,7 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
653
618
|
).describe(
|
|
654
619
|
"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."
|
|
655
620
|
);
|
|
656
|
-
var QueueDefaultSchema =
|
|
621
|
+
var QueueDefaultSchema = z17.object({
|
|
657
622
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
658
623
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
659
624
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -663,66 +628,65 @@ var QueueDefaultSchema = z18.object({
|
|
|
663
628
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
664
629
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
665
630
|
}).default({});
|
|
666
|
-
var
|
|
631
|
+
var QueueSchema = z17.object({
|
|
632
|
+
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
633
|
+
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
634
|
+
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
635
|
+
deliveryDelay: DeliveryDelaySchema.optional(),
|
|
636
|
+
receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
|
|
637
|
+
maxMessageSize: MaxMessageSizeSchema.optional(),
|
|
638
|
+
batchSize: BatchSizeSchema.optional(),
|
|
639
|
+
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
640
|
+
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
641
|
+
});
|
|
642
|
+
var QueuesSchema = z17.record(
|
|
667
643
|
ResourceIdSchema,
|
|
668
|
-
|
|
669
|
-
LocalFileSchema.transform((
|
|
670
|
-
consumer
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
})),
|
|
674
|
-
z18.object({
|
|
675
|
-
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
676
|
-
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
677
|
-
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
678
|
-
deliveryDelay: DeliveryDelaySchema.optional(),
|
|
679
|
-
receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
|
|
680
|
-
maxMessageSize: MaxMessageSizeSchema.optional(),
|
|
681
|
-
batchSize: BatchSizeSchema.optional(),
|
|
682
|
-
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
683
|
-
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
684
|
-
})
|
|
644
|
+
z17.union([
|
|
645
|
+
LocalFileSchema.transform((consumer) => ({
|
|
646
|
+
consumer
|
|
647
|
+
})).pipe(QueueSchema),
|
|
648
|
+
QueueSchema
|
|
685
649
|
])
|
|
686
650
|
).optional().describe("Define the queues in your stack.");
|
|
687
651
|
|
|
688
652
|
// src/feature/rest/schema.ts
|
|
689
|
-
import { z as
|
|
653
|
+
import { z as z19 } from "zod";
|
|
690
654
|
|
|
691
655
|
// src/config/schema/route.ts
|
|
692
|
-
import { z as
|
|
693
|
-
var RouteSchema2 =
|
|
694
|
-
|
|
695
|
-
|
|
656
|
+
import { z as z18 } from "zod";
|
|
657
|
+
var RouteSchema2 = z18.union([
|
|
658
|
+
z18.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
659
|
+
z18.literal("$default")
|
|
696
660
|
]);
|
|
697
661
|
|
|
698
662
|
// src/feature/rest/schema.ts
|
|
699
|
-
var RestDefaultSchema =
|
|
663
|
+
var RestDefaultSchema = z19.record(
|
|
700
664
|
ResourceIdSchema,
|
|
701
|
-
|
|
665
|
+
z19.object({
|
|
702
666
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
703
|
-
subDomain:
|
|
667
|
+
subDomain: z19.string().optional()
|
|
704
668
|
})
|
|
705
669
|
).optional().describe("Define your global REST API's.");
|
|
706
|
-
var RestSchema =
|
|
670
|
+
var RestSchema = z19.record(ResourceIdSchema, z19.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
707
671
|
|
|
708
672
|
// src/feature/rpc/schema.ts
|
|
709
|
-
import { z as
|
|
710
|
-
var RpcDefaultSchema =
|
|
673
|
+
import { z as z20 } from "zod";
|
|
674
|
+
var RpcDefaultSchema = z20.record(
|
|
711
675
|
ResourceIdSchema,
|
|
712
|
-
|
|
676
|
+
z20.object({
|
|
713
677
|
domain: ResourceIdSchema.describe("The domain id to link your RPC API with.").optional(),
|
|
714
|
-
subDomain:
|
|
678
|
+
subDomain: z20.string().optional(),
|
|
715
679
|
auth: FunctionSchema.optional(),
|
|
716
680
|
log: LogSchema.optional()
|
|
717
681
|
})
|
|
718
682
|
).describe(`Define the global RPC API's.`).optional();
|
|
719
|
-
var RpcSchema =
|
|
683
|
+
var RpcSchema = z20.record(ResourceIdSchema, z20.record(z20.string(), FunctionSchema).describe("The queries for your global RPC API.")).describe("Define the schema in your stack for your global RPC API.").optional();
|
|
720
684
|
|
|
721
685
|
// src/feature/search/schema.ts
|
|
722
686
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
723
|
-
import { z as
|
|
724
|
-
var VersionSchema =
|
|
725
|
-
var TypeSchema3 =
|
|
687
|
+
import { z as z21 } from "zod";
|
|
688
|
+
var VersionSchema = z21.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
|
|
689
|
+
var TypeSchema3 = z21.enum([
|
|
726
690
|
"t3.small",
|
|
727
691
|
"t3.medium",
|
|
728
692
|
"m3.medium",
|
|
@@ -797,11 +761,11 @@ var TypeSchema3 = z22.enum([
|
|
|
797
761
|
"r6gd.16xlarge"
|
|
798
762
|
]);
|
|
799
763
|
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.");
|
|
800
|
-
var SearchsSchema =
|
|
764
|
+
var SearchsSchema = z21.record(
|
|
801
765
|
ResourceIdSchema,
|
|
802
|
-
|
|
766
|
+
z21.object({
|
|
803
767
|
type: TypeSchema3.default("t3.small"),
|
|
804
|
-
count:
|
|
768
|
+
count: z21.number().int().min(1).default(1),
|
|
805
769
|
version: VersionSchema.default("2.13"),
|
|
806
770
|
storage: StorageSizeSchema.default("10 GB")
|
|
807
771
|
// vpc: z.boolean().default(false),
|
|
@@ -809,29 +773,29 @@ var SearchsSchema = z22.record(
|
|
|
809
773
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
810
774
|
|
|
811
775
|
// src/feature/site/schema.ts
|
|
812
|
-
import { z as
|
|
813
|
-
var ErrorResponsePathSchema =
|
|
776
|
+
import { z as z22 } from "zod";
|
|
777
|
+
var ErrorResponsePathSchema = z22.string().describe(
|
|
814
778
|
"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."
|
|
815
779
|
);
|
|
816
|
-
var StatusCodeSchema =
|
|
780
|
+
var StatusCodeSchema = z22.number().int().positive().optional().describe(
|
|
817
781
|
"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."
|
|
818
782
|
);
|
|
819
783
|
var MinTTLSchema = DurationSchema.describe(
|
|
820
784
|
"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."
|
|
821
785
|
);
|
|
822
|
-
var ErrorResponseSchema =
|
|
786
|
+
var ErrorResponseSchema = z22.union([
|
|
823
787
|
ErrorResponsePathSchema,
|
|
824
|
-
|
|
788
|
+
z22.object({
|
|
825
789
|
path: ErrorResponsePathSchema,
|
|
826
790
|
statusCode: StatusCodeSchema.optional(),
|
|
827
791
|
minTTL: MinTTLSchema.optional()
|
|
828
792
|
})
|
|
829
793
|
]).optional();
|
|
830
|
-
var SitesSchema =
|
|
794
|
+
var SitesSchema = z22.record(
|
|
831
795
|
ResourceIdSchema,
|
|
832
|
-
|
|
796
|
+
z22.object({
|
|
833
797
|
domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
|
|
834
|
-
subDomain:
|
|
798
|
+
subDomain: z22.string().optional(),
|
|
835
799
|
// bind: z
|
|
836
800
|
// .object({
|
|
837
801
|
// auth: z.array(ResourceIdSchema),
|
|
@@ -840,11 +804,11 @@ var SitesSchema = z23.record(
|
|
|
840
804
|
// // rest: z.array(ResourceIdSchema),
|
|
841
805
|
// })
|
|
842
806
|
// .optional(),
|
|
843
|
-
static:
|
|
807
|
+
static: z22.union([LocalDirectorySchema, z22.boolean()]).optional().describe(
|
|
844
808
|
"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."
|
|
845
809
|
),
|
|
846
810
|
ssr: FunctionSchema.optional().describe("Specifies the ssr file."),
|
|
847
|
-
origin:
|
|
811
|
+
origin: z22.enum(["ssr-first", "static-first"]).default("static-first").describe("Specifies the origin fallback ordering."),
|
|
848
812
|
// bind: z.object({
|
|
849
813
|
// auth:
|
|
850
814
|
// h
|
|
@@ -857,7 +821,7 @@ var SitesSchema = z23.record(
|
|
|
857
821
|
// build: z.string().optional(),
|
|
858
822
|
// }),
|
|
859
823
|
// ]),
|
|
860
|
-
errors:
|
|
824
|
+
errors: z22.object({
|
|
861
825
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
862
826
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
863
827
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -870,16 +834,16 @@ var SitesSchema = z23.record(
|
|
|
870
834
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
871
835
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
872
836
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
873
|
-
cors:
|
|
874
|
-
override:
|
|
837
|
+
cors: z22.object({
|
|
838
|
+
override: z22.boolean().default(false),
|
|
875
839
|
maxAge: DurationSchema.default("365 days"),
|
|
876
|
-
exposeHeaders:
|
|
877
|
-
credentials:
|
|
878
|
-
headers:
|
|
879
|
-
origins:
|
|
880
|
-
methods:
|
|
840
|
+
exposeHeaders: z22.string().array().optional(),
|
|
841
|
+
credentials: z22.boolean().default(false),
|
|
842
|
+
headers: z22.string().array().default(["*"]),
|
|
843
|
+
origins: z22.string().array().default(["*"]),
|
|
844
|
+
methods: z22.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
881
845
|
}).optional().describe("Define the cors headers."),
|
|
882
|
-
security:
|
|
846
|
+
security: z22.object({
|
|
883
847
|
// contentSecurityPolicy: z.object({
|
|
884
848
|
// override: z.boolean().default(false),
|
|
885
849
|
// policy: z.string(),
|
|
@@ -921,10 +885,10 @@ var SitesSchema = z23.record(
|
|
|
921
885
|
// reportUri?: string
|
|
922
886
|
// }
|
|
923
887
|
}).optional().describe("Define the security policy."),
|
|
924
|
-
cache:
|
|
925
|
-
cookies:
|
|
926
|
-
headers:
|
|
927
|
-
queries:
|
|
888
|
+
cache: z22.object({
|
|
889
|
+
cookies: z22.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
890
|
+
headers: z22.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
891
|
+
queries: z22.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
928
892
|
}).optional().describe(
|
|
929
893
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
930
894
|
)
|
|
@@ -932,26 +896,26 @@ var SitesSchema = z23.record(
|
|
|
932
896
|
).optional().describe("Define the sites in your stack.");
|
|
933
897
|
|
|
934
898
|
// src/feature/store/schema.ts
|
|
935
|
-
import { z as
|
|
936
|
-
var DeletionProtectionSchema =
|
|
937
|
-
var StoreDefaultSchema =
|
|
899
|
+
import { z as z23 } from "zod";
|
|
900
|
+
var DeletionProtectionSchema = z23.boolean().describe("Specifies if you want to protect the store from being deleted by awsless.");
|
|
901
|
+
var StoreDefaultSchema = z23.object({
|
|
938
902
|
deletionProtection: DeletionProtectionSchema.optional()
|
|
939
903
|
}).optional();
|
|
940
|
-
var StoresSchema =
|
|
941
|
-
|
|
904
|
+
var StoresSchema = z23.union([
|
|
905
|
+
z23.array(ResourceIdSchema).transform((list) => {
|
|
942
906
|
const stores = {};
|
|
943
907
|
for (const key of list) {
|
|
944
908
|
stores[key] = {};
|
|
945
909
|
}
|
|
946
910
|
return stores;
|
|
947
911
|
}),
|
|
948
|
-
|
|
912
|
+
z23.record(
|
|
949
913
|
ResourceIdSchema,
|
|
950
|
-
|
|
914
|
+
z23.object({
|
|
951
915
|
// cors: CorsSchema,
|
|
952
916
|
deletionProtection: DeletionProtectionSchema.optional(),
|
|
953
|
-
versioning:
|
|
954
|
-
events:
|
|
917
|
+
versioning: z23.boolean().default(false).describe("Enable versioning of your store."),
|
|
918
|
+
events: z23.object({
|
|
955
919
|
// create
|
|
956
920
|
"created:*": FunctionSchema.optional().describe(
|
|
957
921
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
@@ -984,22 +948,22 @@ var StoresSchema = z24.union([
|
|
|
984
948
|
]).optional().describe("Define the stores in your stack.");
|
|
985
949
|
|
|
986
950
|
// src/feature/stream/schema.ts
|
|
987
|
-
import { z as
|
|
988
|
-
var LatencyModeSchema =
|
|
951
|
+
import { z as z24 } from "zod";
|
|
952
|
+
var LatencyModeSchema = z24.enum(["low", "normal"]).describe(
|
|
989
953
|
`Channel latency mode. Valid values:
|
|
990
954
|
- normal: Use "normal" to broadcast and deliver live video up to Full HD.
|
|
991
955
|
- low: Use "low" for near real-time interactions with viewers.`
|
|
992
956
|
);
|
|
993
|
-
var TypeSchema4 =
|
|
957
|
+
var TypeSchema4 = z24.enum(["standard", "basic", "advanced-sd", "advanced-hd"]).describe(`The channel type, which determines the allowable resolution and bitrate.
|
|
994
958
|
If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:
|
|
995
959
|
- standard: Video is transcoded: multiple qualities are generated from the original input to automatically give viewers the best experience for their devices and network conditions. Transcoding allows higher playback quality across a range of download speeds. Resolution can be up to 1080p and bitrate can be up to 8.5 Mbps. Audio is transcoded only for renditions 360p and below; above that, audio is passed through.
|
|
996
960
|
- basic: Video is transmuxed: Amazon IVS delivers the original input to viewers. The viewer's video-quality choice is limited to the original input. Resolution can be up to 1080p and bitrate can be up to 1.5 Mbps for 480p and up to 3.5 Mbps for resolutions between 480p and 1080p.
|
|
997
961
|
- advanced-sd: Video is transcoded; multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Input resolution can be up to 1080p and bitrate can be up to 8.5 Mbps; output is capped at SD quality (480p). You can select an optional transcode preset (see below). Audio for all renditions is transcoded, and an audio-only rendition is available.
|
|
998
962
|
- advanced-hd: Video is transcoded; multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Input resolution can be up to 1080p and bitrate can be up to 8.5 Mbps; output is capped at HD quality (720p). You can select an optional transcode preset (see below). Audio for all renditions is transcoded, and an audio-only rendition is available.
|
|
999
963
|
`);
|
|
1000
|
-
var StreamsSchema =
|
|
964
|
+
var StreamsSchema = z24.record(
|
|
1001
965
|
ResourceIdSchema,
|
|
1002
|
-
|
|
966
|
+
z24.object({
|
|
1003
967
|
type: TypeSchema4.default("standard"),
|
|
1004
968
|
// preset: PresetSchema.optional(),
|
|
1005
969
|
latencyMode: LatencyModeSchema.default("low")
|
|
@@ -1007,41 +971,41 @@ var StreamsSchema = z25.record(
|
|
|
1007
971
|
).optional().describe("Define the streams in your stack.");
|
|
1008
972
|
|
|
1009
973
|
// src/feature/table/schema.ts
|
|
1010
|
-
import { z as
|
|
1011
|
-
var KeySchema =
|
|
1012
|
-
var DeletionProtectionSchema2 =
|
|
1013
|
-
var TableDefaultSchema =
|
|
974
|
+
import { z as z25 } from "zod";
|
|
975
|
+
var KeySchema = z25.string().min(1).max(255);
|
|
976
|
+
var DeletionProtectionSchema2 = z25.boolean().describe("Specifies if you want to protect the table from being deleted by awsless.");
|
|
977
|
+
var TableDefaultSchema = z25.object({
|
|
1014
978
|
deletionProtection: DeletionProtectionSchema2.optional()
|
|
1015
979
|
}).optional();
|
|
1016
|
-
var TablesSchema =
|
|
980
|
+
var TablesSchema = z25.record(
|
|
1017
981
|
ResourceIdSchema,
|
|
1018
|
-
|
|
982
|
+
z25.object({
|
|
1019
983
|
hash: KeySchema.describe(
|
|
1020
984
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
1021
985
|
),
|
|
1022
986
|
sort: KeySchema.optional().describe(
|
|
1023
987
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
1024
988
|
),
|
|
1025
|
-
fields:
|
|
989
|
+
fields: z25.record(z25.string(), z25.enum(["string", "number", "binary"])).optional().describe(
|
|
1026
990
|
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
1027
991
|
),
|
|
1028
|
-
class:
|
|
1029
|
-
pointInTimeRecovery:
|
|
992
|
+
class: z25.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
993
|
+
pointInTimeRecovery: z25.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
1030
994
|
timeToLiveAttribute: KeySchema.optional().describe(
|
|
1031
995
|
"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."
|
|
1032
996
|
),
|
|
1033
997
|
deletionProtection: DeletionProtectionSchema2.optional(),
|
|
1034
|
-
stream:
|
|
1035
|
-
type:
|
|
998
|
+
stream: z25.object({
|
|
999
|
+
type: z25.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
1036
1000
|
"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."
|
|
1037
1001
|
),
|
|
1038
1002
|
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
1039
1003
|
}).optional().describe(
|
|
1040
1004
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
1041
1005
|
),
|
|
1042
|
-
indexes:
|
|
1043
|
-
|
|
1044
|
-
|
|
1006
|
+
indexes: z25.record(
|
|
1007
|
+
z25.string(),
|
|
1008
|
+
z25.object({
|
|
1045
1009
|
/** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
|
|
1046
1010
|
hash: KeySchema,
|
|
1047
1011
|
/** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
|
|
@@ -1051,18 +1015,18 @@ var TablesSchema = z26.record(
|
|
|
1051
1015
|
* - keys-only - Only the index and primary keys are projected into the index.
|
|
1052
1016
|
* @default 'all'
|
|
1053
1017
|
*/
|
|
1054
|
-
projection:
|
|
1018
|
+
projection: z25.enum(["all", "keys-only"]).default("all")
|
|
1055
1019
|
})
|
|
1056
1020
|
).optional().describe("Specifies the global secondary indexes to be created on the table.")
|
|
1057
1021
|
})
|
|
1058
1022
|
).optional().describe("Define the tables in your stack.");
|
|
1059
1023
|
|
|
1060
1024
|
// src/feature/task/schema.ts
|
|
1061
|
-
import { z as
|
|
1062
|
-
var RetryAttemptsSchema2 =
|
|
1025
|
+
import { z as z26 } from "zod";
|
|
1026
|
+
var RetryAttemptsSchema2 = z26.number().int().min(0).max(2).describe(
|
|
1063
1027
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1064
1028
|
);
|
|
1065
|
-
var TaskSchema =
|
|
1029
|
+
var TaskSchema = z26.union([
|
|
1066
1030
|
LocalFileSchema.transform((file) => ({
|
|
1067
1031
|
consumer: {
|
|
1068
1032
|
code: {
|
|
@@ -1073,33 +1037,33 @@ var TaskSchema = z27.union([
|
|
|
1073
1037
|
},
|
|
1074
1038
|
retryAttempts: void 0
|
|
1075
1039
|
})),
|
|
1076
|
-
|
|
1040
|
+
z26.object({
|
|
1077
1041
|
consumer: FunctionSchema,
|
|
1078
1042
|
retryAttempts: RetryAttemptsSchema2.optional()
|
|
1079
1043
|
})
|
|
1080
1044
|
]);
|
|
1081
|
-
var TasksSchema =
|
|
1045
|
+
var TasksSchema = z26.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1082
1046
|
|
|
1083
1047
|
// src/feature/test/schema.ts
|
|
1084
|
-
import { z as
|
|
1085
|
-
var TestsSchema =
|
|
1048
|
+
import { z as z27 } from "zod";
|
|
1049
|
+
var TestsSchema = z27.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
1086
1050
|
|
|
1087
1051
|
// src/feature/topic/schema.ts
|
|
1088
1052
|
import { paramCase as paramCase2 } from "change-case";
|
|
1089
|
-
import { z as
|
|
1090
|
-
var TopicNameSchema =
|
|
1091
|
-
var TopicsSchema =
|
|
1053
|
+
import { z as z28 } from "zod";
|
|
1054
|
+
var TopicNameSchema = z28.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase2(value)).describe("Define event topic name.");
|
|
1055
|
+
var TopicsSchema = z28.array(TopicNameSchema).refine((topics) => {
|
|
1092
1056
|
return topics.length === new Set(topics).size;
|
|
1093
1057
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
1094
|
-
var SubscribersSchema =
|
|
1058
|
+
var SubscribersSchema = z28.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
1095
1059
|
|
|
1096
1060
|
// src/config/stack.ts
|
|
1097
1061
|
var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
|
|
1098
1062
|
var NameSchema = ResourceIdSchema.refine((name) => !["base"].includes(name), {
|
|
1099
1063
|
message: `Stack name can't be a reserved name.`
|
|
1100
1064
|
}).describe("Stack name.");
|
|
1101
|
-
var StackSchema =
|
|
1102
|
-
$schema:
|
|
1065
|
+
var StackSchema = z29.object({
|
|
1066
|
+
$schema: z29.string().optional(),
|
|
1103
1067
|
name: NameSchema,
|
|
1104
1068
|
depends: DependsSchema,
|
|
1105
1069
|
commands: CommandsSchema,
|
|
@@ -1128,15 +1092,15 @@ var StackSchema = z30.object({
|
|
|
1128
1092
|
});
|
|
1129
1093
|
|
|
1130
1094
|
// src/config/app.ts
|
|
1131
|
-
import { z as
|
|
1095
|
+
import { z as z36 } from "zod";
|
|
1132
1096
|
|
|
1133
1097
|
// src/feature/alert/schema.ts
|
|
1134
1098
|
import { paramCase as paramCase3 } from "change-case";
|
|
1135
|
-
import { z as
|
|
1136
|
-
var AlertNameSchema =
|
|
1137
|
-
var AlertsDefaultSchema =
|
|
1099
|
+
import { z as z30 } from "zod";
|
|
1100
|
+
var AlertNameSchema = z30.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid alert name").transform((value) => paramCase3(value)).describe("Define event topic name.");
|
|
1101
|
+
var AlertsDefaultSchema = z30.record(
|
|
1138
1102
|
AlertNameSchema,
|
|
1139
|
-
|
|
1103
|
+
z30.union([
|
|
1140
1104
|
//
|
|
1141
1105
|
EmailSchema.transform((v) => [v]),
|
|
1142
1106
|
EmailSchema.array()
|
|
@@ -1144,18 +1108,18 @@ var AlertsDefaultSchema = z31.record(
|
|
|
1144
1108
|
).optional().describe("Define the alerts in your app. Alerts are a way to send messages to one or more email addresses.");
|
|
1145
1109
|
|
|
1146
1110
|
// src/feature/domain/schema.ts
|
|
1147
|
-
import { z as
|
|
1148
|
-
var DomainNameSchema =
|
|
1111
|
+
import { z as z31 } from "zod";
|
|
1112
|
+
var DomainNameSchema = z31.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
1149
1113
|
"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."
|
|
1150
1114
|
);
|
|
1151
|
-
var DNSTypeSchema =
|
|
1115
|
+
var DNSTypeSchema = z31.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
1152
1116
|
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
1153
|
-
var RecordsSchema =
|
|
1154
|
-
var DomainsDefaultSchema =
|
|
1117
|
+
var RecordsSchema = z31.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
1118
|
+
var DomainsDefaultSchema = z31.record(
|
|
1155
1119
|
ResourceIdSchema,
|
|
1156
|
-
|
|
1120
|
+
z31.object({
|
|
1157
1121
|
domain: DomainNameSchema.describe("Define the domain name"),
|
|
1158
|
-
dns:
|
|
1122
|
+
dns: z31.object({
|
|
1159
1123
|
name: DomainNameSchema.optional(),
|
|
1160
1124
|
type: DNSTypeSchema,
|
|
1161
1125
|
ttl: TTLSchema,
|
|
@@ -1165,25 +1129,25 @@ var DomainsDefaultSchema = z32.record(
|
|
|
1165
1129
|
).optional().describe("Define the domains for your application.");
|
|
1166
1130
|
|
|
1167
1131
|
// src/feature/layer/schema.ts
|
|
1168
|
-
import { z as
|
|
1132
|
+
import { z as z33 } from "zod";
|
|
1169
1133
|
|
|
1170
1134
|
// src/config/schema/lambda.ts
|
|
1171
|
-
import { z as
|
|
1172
|
-
var ArchitectureSchema2 =
|
|
1173
|
-
var NodeRuntimeSchema2 =
|
|
1135
|
+
import { z as z32 } from "zod";
|
|
1136
|
+
var ArchitectureSchema2 = z32.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
1137
|
+
var NodeRuntimeSchema2 = z32.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).describe("The identifier of the function's runtime.");
|
|
1174
1138
|
|
|
1175
1139
|
// src/feature/layer/schema.ts
|
|
1176
|
-
var Schema =
|
|
1140
|
+
var Schema = z33.object({
|
|
1177
1141
|
file: LocalFileSchema,
|
|
1178
1142
|
runtimes: NodeRuntimeSchema2.array().optional(),
|
|
1179
1143
|
architecture: ArchitectureSchema2.optional(),
|
|
1180
|
-
packages:
|
|
1144
|
+
packages: z33.string().array().optional().describe(
|
|
1181
1145
|
"Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
|
|
1182
1146
|
)
|
|
1183
1147
|
});
|
|
1184
|
-
var LayerSchema =
|
|
1185
|
-
|
|
1186
|
-
|
|
1148
|
+
var LayerSchema = z33.record(
|
|
1149
|
+
z33.string(),
|
|
1150
|
+
z33.union([
|
|
1187
1151
|
LocalFileSchema.transform((file) => ({
|
|
1188
1152
|
file,
|
|
1189
1153
|
description: void 0
|
|
@@ -1198,21 +1162,21 @@ var OnFailureDefaultSchema = FunctionSchema.optional().describe(
|
|
|
1198
1162
|
);
|
|
1199
1163
|
|
|
1200
1164
|
// src/feature/on-log/schema.ts
|
|
1201
|
-
import { z as
|
|
1202
|
-
var FilterSchema =
|
|
1203
|
-
var OnLogDefaultSchema =
|
|
1165
|
+
import { z as z34 } from "zod";
|
|
1166
|
+
var FilterSchema = z34.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
|
|
1167
|
+
var OnLogDefaultSchema = z34.union([
|
|
1204
1168
|
FunctionSchema.transform((consumer) => ({
|
|
1205
1169
|
consumer,
|
|
1206
1170
|
filter: ["error", "fatal"]
|
|
1207
1171
|
})),
|
|
1208
|
-
|
|
1172
|
+
z34.object({
|
|
1209
1173
|
consumer: FunctionSchema,
|
|
1210
1174
|
filter: FilterSchema
|
|
1211
1175
|
})
|
|
1212
1176
|
]).optional().describe("Define a subscription on all Lambda functions logs.");
|
|
1213
1177
|
|
|
1214
1178
|
// src/config/schema/region.ts
|
|
1215
|
-
import { z as
|
|
1179
|
+
import { z as z35 } from "zod";
|
|
1216
1180
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
1217
1181
|
var AF = ["af-south-1"];
|
|
1218
1182
|
var AP = [
|
|
@@ -1241,21 +1205,21 @@ var EU = [
|
|
|
1241
1205
|
var ME = ["me-south-1", "me-central-1"];
|
|
1242
1206
|
var SA = ["sa-east-1"];
|
|
1243
1207
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
1244
|
-
var RegionSchema =
|
|
1208
|
+
var RegionSchema = z35.enum(regions);
|
|
1245
1209
|
|
|
1246
1210
|
// src/config/app.ts
|
|
1247
|
-
var AppSchema =
|
|
1248
|
-
$schema:
|
|
1211
|
+
var AppSchema = z36.object({
|
|
1212
|
+
$schema: z36.string().optional(),
|
|
1249
1213
|
name: ResourceIdSchema.describe("App name."),
|
|
1250
1214
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
1251
|
-
profile:
|
|
1215
|
+
profile: z36.string().describe("The AWS profile to deploy to."),
|
|
1252
1216
|
// stage: z
|
|
1253
1217
|
// .string()
|
|
1254
1218
|
// .regex(/^[a-z]+$/)
|
|
1255
1219
|
// .default('prod')
|
|
1256
1220
|
// .describe('The deployment stage.'),
|
|
1257
1221
|
// onFailure: OnFailureSchema,
|
|
1258
|
-
defaults:
|
|
1222
|
+
defaults: z36.object({
|
|
1259
1223
|
onFailure: OnFailureDefaultSchema,
|
|
1260
1224
|
onLog: OnLogDefaultSchema,
|
|
1261
1225
|
auth: AuthDefaultSchema,
|
|
@@ -1278,9 +1242,9 @@ var AppSchema = z37.object({
|
|
|
1278
1242
|
|
|
1279
1243
|
// cli/build-json-schema.ts
|
|
1280
1244
|
import { writeFileSync } from "node:fs";
|
|
1281
|
-
import { join as
|
|
1245
|
+
import { join as join2 } from "node:path";
|
|
1282
1246
|
var generateJsonSchema = (props) => {
|
|
1283
|
-
const file =
|
|
1247
|
+
const file = join2(process.cwd(), `dist/${props.name}.json`);
|
|
1284
1248
|
const schema = zodToJsonSchema(props.schema, {
|
|
1285
1249
|
name: props.name,
|
|
1286
1250
|
// errorMessages: true,
|