@awsless/awsless 0.0.439 → 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 +331 -324
- package/dist/build-json-schema.js +302 -340
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/stack.json +1 -1
- package/package.json +14 -14
|
@@ -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 =
|
|
177
|
+
var CodeSchema = z5.union([
|
|
209
178
|
LocalFileSchema.transform((file) => ({
|
|
210
|
-
file
|
|
211
|
-
|
|
212
|
-
external: []
|
|
213
|
-
})),
|
|
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,18 +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
|
-
minify: true,
|
|
245
|
-
external: []
|
|
246
|
-
}
|
|
247
|
-
})),
|
|
207
|
+
var FunctionSchema = z5.union([
|
|
208
|
+
LocalFileSchema.transform((code) => ({
|
|
209
|
+
code
|
|
210
|
+
})).pipe(FnSchema),
|
|
248
211
|
FnSchema
|
|
249
212
|
]);
|
|
250
|
-
var FunctionsSchema =
|
|
251
|
-
var FunctionDefaultSchema =
|
|
213
|
+
var FunctionsSchema = z5.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
|
|
214
|
+
var FunctionDefaultSchema = z5.object({
|
|
252
215
|
runtime: RuntimeSchema.default("nodejs20.x"),
|
|
253
216
|
// node
|
|
254
217
|
handler: HandlerSchema.default("index.default"),
|
|
@@ -277,11 +240,11 @@ var FunctionDefaultSchema = z6.object({
|
|
|
277
240
|
}).default({});
|
|
278
241
|
|
|
279
242
|
// src/config/schema/email.ts
|
|
280
|
-
import { z as
|
|
281
|
-
var EmailSchema =
|
|
243
|
+
import { z as z6 } from "zod";
|
|
244
|
+
var EmailSchema = z6.string().email();
|
|
282
245
|
|
|
283
246
|
// src/feature/auth/schema.ts
|
|
284
|
-
var TriggersSchema =
|
|
247
|
+
var TriggersSchema = z7.object({
|
|
285
248
|
beforeToken: FunctionSchema.optional().describe("A pre jwt token generation AWS Lambda trigger."),
|
|
286
249
|
beforeLogin: FunctionSchema.optional().describe("A pre user login AWS Lambda trigger."),
|
|
287
250
|
afterLogin: FunctionSchema.optional().describe("A post user login AWS Lambda trigger."),
|
|
@@ -294,42 +257,42 @@ var TriggersSchema = z8.object({
|
|
|
294
257
|
createChallenge: FunctionSchema.optional().describe("Creates an authentication challenge."),
|
|
295
258
|
verifyChallenge: FunctionSchema.optional().describe("Verifies the authentication challenge response.")
|
|
296
259
|
}).describe("Specifies the configuration for AWS Lambda triggers.");
|
|
297
|
-
var AuthSchema =
|
|
260
|
+
var AuthSchema = z7.record(
|
|
298
261
|
ResourceIdSchema,
|
|
299
|
-
|
|
300
|
-
access:
|
|
262
|
+
z7.object({
|
|
263
|
+
access: z7.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
|
|
301
264
|
triggers: TriggersSchema.optional()
|
|
302
265
|
})
|
|
303
266
|
).optional().describe("Define the auth triggers in your stack.");
|
|
304
|
-
var AuthDefaultSchema =
|
|
267
|
+
var AuthDefaultSchema = z7.record(
|
|
305
268
|
ResourceIdSchema,
|
|
306
|
-
|
|
307
|
-
allowUserRegistration:
|
|
308
|
-
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({
|
|
309
272
|
fromEmail: EmailSchema.describe("Specifies the sender's email address."),
|
|
310
|
-
fromName:
|
|
273
|
+
fromName: z7.string().optional().describe("Specifies the sender's name."),
|
|
311
274
|
replyTo: EmailSchema.optional().describe(
|
|
312
275
|
"The destination to which the receiver of the email should reply."
|
|
313
276
|
)
|
|
314
277
|
}).optional().describe("The email configuration for sending messages."),
|
|
315
278
|
// secret: z.boolean().default(false).describe('Specifies whether you want to generate a client secret.'),
|
|
316
|
-
username:
|
|
317
|
-
emailAlias:
|
|
318
|
-
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(
|
|
319
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."
|
|
320
283
|
)
|
|
321
284
|
}).default({}).describe("The username policy."),
|
|
322
|
-
password:
|
|
323
|
-
minLength:
|
|
324
|
-
uppercase:
|
|
325
|
-
lowercase:
|
|
326
|
-
numbers:
|
|
327
|
-
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."),
|
|
328
291
|
temporaryPasswordValidity: DurationSchema.default("7 days").describe(
|
|
329
292
|
"The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
|
|
330
293
|
)
|
|
331
294
|
}).default({}).describe("The password policy."),
|
|
332
|
-
validity:
|
|
295
|
+
validity: z7.object({
|
|
333
296
|
idToken: DurationSchema.default("1 hour").describe(
|
|
334
297
|
"The ID token time limit. After this limit expires, your user can't use their ID token."
|
|
335
298
|
),
|
|
@@ -345,8 +308,8 @@ var AuthDefaultSchema = z8.record(
|
|
|
345
308
|
).default({}).describe("Define the authenticatable users in your app.");
|
|
346
309
|
|
|
347
310
|
// src/feature/cache/schema.ts
|
|
348
|
-
import { z as
|
|
349
|
-
var TypeSchema =
|
|
311
|
+
import { z as z8 } from "zod";
|
|
312
|
+
var TypeSchema = z8.enum([
|
|
350
313
|
"t4g.small",
|
|
351
314
|
"t4g.medium",
|
|
352
315
|
"r6g.large",
|
|
@@ -361,29 +324,29 @@ var TypeSchema = z9.enum([
|
|
|
361
324
|
"r6gd.4xlarge",
|
|
362
325
|
"r6gd.8xlarge"
|
|
363
326
|
]);
|
|
364
|
-
var PortSchema =
|
|
365
|
-
var ShardsSchema =
|
|
366
|
-
var ReplicasPerShardSchema =
|
|
367
|
-
var EngineSchema =
|
|
368
|
-
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(
|
|
369
332
|
ResourceIdSchema,
|
|
370
|
-
|
|
333
|
+
z8.object({
|
|
371
334
|
type: TypeSchema.default("t4g.small"),
|
|
372
335
|
port: PortSchema.default(6379),
|
|
373
336
|
shards: ShardsSchema.default(1),
|
|
374
337
|
replicasPerShard: ReplicasPerShardSchema.default(1),
|
|
375
338
|
engine: EngineSchema.default("7.0"),
|
|
376
|
-
dataTiering:
|
|
339
|
+
dataTiering: z8.boolean().default(false)
|
|
377
340
|
})
|
|
378
341
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
379
342
|
|
|
380
343
|
// src/feature/command/schema.ts
|
|
381
|
-
import { z as
|
|
382
|
-
var CommandSchema =
|
|
383
|
-
|
|
344
|
+
import { z as z9 } from "zod";
|
|
345
|
+
var CommandSchema = z9.union([
|
|
346
|
+
z9.object({
|
|
384
347
|
file: LocalFileSchema,
|
|
385
|
-
handler:
|
|
386
|
-
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")
|
|
387
350
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
388
351
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
389
352
|
}),
|
|
@@ -393,22 +356,22 @@ var CommandSchema = z10.union([
|
|
|
393
356
|
description: void 0
|
|
394
357
|
}))
|
|
395
358
|
]);
|
|
396
|
-
var CommandsSchema =
|
|
359
|
+
var CommandsSchema = z9.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
397
360
|
|
|
398
361
|
// src/feature/config/schema.ts
|
|
399
|
-
import { z as
|
|
400
|
-
var ConfigNameSchema =
|
|
401
|
-
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.");
|
|
402
365
|
|
|
403
366
|
// src/feature/cron/schema/index.ts
|
|
404
|
-
import { z as
|
|
367
|
+
import { z as z12 } from "zod";
|
|
405
368
|
|
|
406
369
|
// src/feature/cron/schema/schedule.ts
|
|
407
|
-
import { z as
|
|
370
|
+
import { z as z11 } from "zod";
|
|
408
371
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
409
|
-
var RateExpressionSchema =
|
|
372
|
+
var RateExpressionSchema = z11.custom(
|
|
410
373
|
(value) => {
|
|
411
|
-
return
|
|
374
|
+
return z11.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
412
375
|
const [str] = rate.split(" ");
|
|
413
376
|
const number = parseInt(str);
|
|
414
377
|
return number > 0;
|
|
@@ -424,9 +387,9 @@ var RateExpressionSchema = z12.custom(
|
|
|
424
387
|
}
|
|
425
388
|
return `rate(${rate})`;
|
|
426
389
|
});
|
|
427
|
-
var CronExpressionSchema =
|
|
390
|
+
var CronExpressionSchema = z11.custom(
|
|
428
391
|
(value) => {
|
|
429
|
-
return
|
|
392
|
+
return z11.string().safeParse(value).success;
|
|
430
393
|
},
|
|
431
394
|
{ message: "Invalid cron expression" }
|
|
432
395
|
).superRefine((value, ctx) => {
|
|
@@ -435,12 +398,12 @@ var CronExpressionSchema = z12.custom(
|
|
|
435
398
|
} catch (error) {
|
|
436
399
|
if (error instanceof Error) {
|
|
437
400
|
ctx.addIssue({
|
|
438
|
-
code:
|
|
401
|
+
code: z11.ZodIssueCode.custom,
|
|
439
402
|
message: `Invalid cron expression: ${error.message}`
|
|
440
403
|
});
|
|
441
404
|
} else {
|
|
442
405
|
ctx.addIssue({
|
|
443
|
-
code:
|
|
406
|
+
code: z11.ZodIssueCode.custom,
|
|
444
407
|
message: "Invalid cron expression"
|
|
445
408
|
});
|
|
446
409
|
}
|
|
@@ -451,31 +414,31 @@ var CronExpressionSchema = z12.custom(
|
|
|
451
414
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
452
415
|
|
|
453
416
|
// src/feature/cron/schema/index.ts
|
|
454
|
-
var CronsSchema =
|
|
417
|
+
var CronsSchema = z12.record(
|
|
455
418
|
ResourceIdSchema,
|
|
456
|
-
|
|
457
|
-
enabled:
|
|
419
|
+
z12.object({
|
|
420
|
+
enabled: z12.boolean().default(true).describe("If the cron is enabled."),
|
|
458
421
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
459
422
|
schedule: ScheduleExpressionSchema.describe(
|
|
460
423
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
461
424
|
),
|
|
462
|
-
payload:
|
|
425
|
+
payload: z12.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
463
426
|
})
|
|
464
427
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
465
428
|
|
|
466
429
|
// src/feature/graphql/schema.ts
|
|
467
|
-
import { z as
|
|
430
|
+
import { z as z13 } from "zod";
|
|
468
431
|
var AuthorizerTtl = DurationSchema.describe(
|
|
469
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.`
|
|
470
433
|
);
|
|
471
|
-
var GraphQLDefaultSchema =
|
|
434
|
+
var GraphQLDefaultSchema = z13.record(
|
|
472
435
|
ResourceIdSchema,
|
|
473
|
-
|
|
436
|
+
z13.object({
|
|
474
437
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
475
|
-
subDomain:
|
|
476
|
-
auth:
|
|
438
|
+
subDomain: z13.string().optional(),
|
|
439
|
+
auth: z13.union([
|
|
477
440
|
ResourceIdSchema,
|
|
478
|
-
|
|
441
|
+
z13.object({
|
|
479
442
|
authorizer: FunctionSchema,
|
|
480
443
|
ttl: AuthorizerTtl.default("1 hour")
|
|
481
444
|
})
|
|
@@ -487,22 +450,22 @@ var GraphQLDefaultSchema = z14.record(
|
|
|
487
450
|
resolver: LocalFileSchema.optional()
|
|
488
451
|
})
|
|
489
452
|
).describe(`Define the global GraphQL API's.`).optional();
|
|
490
|
-
var GraphQLSchema =
|
|
453
|
+
var GraphQLSchema = z13.record(
|
|
491
454
|
ResourceIdSchema,
|
|
492
|
-
|
|
455
|
+
z13.object({
|
|
493
456
|
// schema: z.union([LocalFileSchema.transform(v => [v]), z.array(LocalFileSchema).min(1)]).optional(),
|
|
494
457
|
schema: LocalFileSchema.describe("The graphql schema file."),
|
|
495
|
-
resolvers:
|
|
458
|
+
resolvers: z13.record(
|
|
496
459
|
// TypeName
|
|
497
|
-
|
|
498
|
-
|
|
460
|
+
z13.string(),
|
|
461
|
+
z13.record(
|
|
499
462
|
// FieldName
|
|
500
|
-
|
|
501
|
-
|
|
463
|
+
z13.string(),
|
|
464
|
+
z13.union([
|
|
502
465
|
FunctionSchema.transform((consumer) => ({
|
|
503
466
|
consumer
|
|
504
467
|
})),
|
|
505
|
-
|
|
468
|
+
z13.object({
|
|
506
469
|
consumer: FunctionSchema,
|
|
507
470
|
resolver: LocalFileSchema.optional()
|
|
508
471
|
})
|
|
@@ -513,22 +476,22 @@ var GraphQLSchema = z14.record(
|
|
|
513
476
|
).describe("Define the schema & resolvers in your stack for your global GraphQL API.").optional();
|
|
514
477
|
|
|
515
478
|
// src/feature/http/schema.ts
|
|
516
|
-
import { z as
|
|
517
|
-
var RouteSchema =
|
|
518
|
-
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(
|
|
519
482
|
ResourceIdSchema,
|
|
520
|
-
|
|
483
|
+
z14.object({
|
|
521
484
|
domain: ResourceIdSchema.describe("The domain id to link your API with."),
|
|
522
|
-
subDomain:
|
|
485
|
+
subDomain: z14.string().optional()
|
|
523
486
|
// auth: ResourceIdSchema.optional(),
|
|
524
487
|
})
|
|
525
488
|
).optional().describe("Define your global HTTP API's.");
|
|
526
|
-
var HttpSchema =
|
|
489
|
+
var HttpSchema = z14.record(ResourceIdSchema, z14.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
|
|
527
490
|
|
|
528
491
|
// src/feature/instance/schema.ts
|
|
529
|
-
import { z as
|
|
530
|
-
var ImageSchema =
|
|
531
|
-
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([
|
|
532
495
|
"t3.nano",
|
|
533
496
|
"t3.micro",
|
|
534
497
|
"t3.small",
|
|
@@ -546,48 +509,48 @@ var TypeSchema2 = z16.enum([
|
|
|
546
509
|
"g4ad.xlarge",
|
|
547
510
|
"g4dn.xlarge"
|
|
548
511
|
]).describe(`The instance type.`);
|
|
549
|
-
var CommandSchema2 =
|
|
512
|
+
var CommandSchema2 = z15.string().describe(`The script you want to execute when the instance starts up.`);
|
|
550
513
|
var CodeSchema2 = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
|
|
551
|
-
var ConnectSchema =
|
|
552
|
-
var EnvironmentSchema2 =
|
|
553
|
-
var ActionSchema2 =
|
|
554
|
-
var ActionsSchema2 =
|
|
555
|
-
var ArnSchema2 =
|
|
556
|
-
var WildcardSchema2 =
|
|
557
|
-
var ResourceSchema2 =
|
|
558
|
-
var ResourcesSchema2 =
|
|
559
|
-
var PermissionSchema2 =
|
|
560
|
-
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"),
|
|
561
524
|
actions: ActionsSchema2,
|
|
562
525
|
resources: ResourcesSchema2
|
|
563
526
|
});
|
|
564
|
-
var PermissionsSchema2 =
|
|
565
|
-
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({
|
|
566
529
|
connect: ConnectSchema.default(false)
|
|
567
530
|
}).default({}).describe("Define the default settings for all instances in your stacks.");
|
|
568
|
-
var InstancesSchema =
|
|
531
|
+
var InstancesSchema = z15.record(
|
|
569
532
|
ResourceIdSchema,
|
|
570
|
-
|
|
533
|
+
z15.object({
|
|
571
534
|
image: ImageSchema,
|
|
572
535
|
type: TypeSchema2,
|
|
573
536
|
code: CodeSchema2,
|
|
574
|
-
user:
|
|
537
|
+
user: z15.string().default("ec2-user"),
|
|
575
538
|
command: CommandSchema2.optional(),
|
|
576
539
|
environment: EnvironmentSchema2.optional(),
|
|
577
540
|
permissions: PermissionsSchema2.optional(),
|
|
578
|
-
waitForTermination:
|
|
541
|
+
waitForTermination: z15.boolean().default(true)
|
|
579
542
|
})
|
|
580
543
|
).optional().describe("Define the instances in your stack.");
|
|
581
544
|
|
|
582
545
|
// src/feature/pubsub/schema.ts
|
|
583
|
-
import { z as
|
|
546
|
+
import { z as z16 } from "zod";
|
|
584
547
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
585
|
-
var PubSubDefaultSchema =
|
|
548
|
+
var PubSubDefaultSchema = z16.record(
|
|
586
549
|
ResourceIdSchema,
|
|
587
|
-
|
|
550
|
+
z16.object({
|
|
588
551
|
auth: FunctionSchema,
|
|
589
552
|
domain: DomainSchema.optional(),
|
|
590
|
-
subDomain:
|
|
553
|
+
subDomain: z16.string().optional()
|
|
591
554
|
// auth: z.union([
|
|
592
555
|
// ResourceIdSchema,
|
|
593
556
|
// z.object({
|
|
@@ -603,11 +566,11 @@ var PubSubDefaultSchema = z17.record(
|
|
|
603
566
|
// .optional(),
|
|
604
567
|
})
|
|
605
568
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
606
|
-
var PubSubSchema =
|
|
569
|
+
var PubSubSchema = z16.record(
|
|
607
570
|
ResourceIdSchema,
|
|
608
|
-
|
|
609
|
-
sql:
|
|
610
|
-
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."),
|
|
611
574
|
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
612
575
|
})
|
|
613
576
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
@@ -615,7 +578,7 @@ var PubSubSchema = z17.record(
|
|
|
615
578
|
// src/feature/queue/schema.ts
|
|
616
579
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
617
580
|
import { kibibytes } from "@awsless/size";
|
|
618
|
-
import { z as
|
|
581
|
+
import { z as z17 } from "zod";
|
|
619
582
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
620
583
|
durationMin(minutes2(1)),
|
|
621
584
|
"Minimum retention period is 1 minute"
|
|
@@ -643,10 +606,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
643
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(
|
|
644
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."
|
|
645
608
|
);
|
|
646
|
-
var BatchSizeSchema =
|
|
609
|
+
var BatchSizeSchema = z17.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
647
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."
|
|
648
611
|
);
|
|
649
|
-
var MaxConcurrencySchema =
|
|
612
|
+
var MaxConcurrencySchema = z17.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
650
613
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
651
614
|
);
|
|
652
615
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -655,7 +618,7 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
655
618
|
).describe(
|
|
656
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."
|
|
657
620
|
);
|
|
658
|
-
var QueueDefaultSchema =
|
|
621
|
+
var QueueDefaultSchema = z17.object({
|
|
659
622
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
660
623
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
661
624
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -665,66 +628,65 @@ var QueueDefaultSchema = z18.object({
|
|
|
665
628
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
666
629
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
667
630
|
}).default({});
|
|
668
|
-
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(
|
|
669
643
|
ResourceIdSchema,
|
|
670
|
-
|
|
671
|
-
LocalFileSchema.transform((
|
|
672
|
-
consumer
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
})),
|
|
676
|
-
z18.object({
|
|
677
|
-
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
678
|
-
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
679
|
-
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
680
|
-
deliveryDelay: DeliveryDelaySchema.optional(),
|
|
681
|
-
receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
|
|
682
|
-
maxMessageSize: MaxMessageSizeSchema.optional(),
|
|
683
|
-
batchSize: BatchSizeSchema.optional(),
|
|
684
|
-
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
685
|
-
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
686
|
-
})
|
|
644
|
+
z17.union([
|
|
645
|
+
LocalFileSchema.transform((consumer) => ({
|
|
646
|
+
consumer
|
|
647
|
+
})).pipe(QueueSchema),
|
|
648
|
+
QueueSchema
|
|
687
649
|
])
|
|
688
650
|
).optional().describe("Define the queues in your stack.");
|
|
689
651
|
|
|
690
652
|
// src/feature/rest/schema.ts
|
|
691
|
-
import { z as
|
|
653
|
+
import { z as z19 } from "zod";
|
|
692
654
|
|
|
693
655
|
// src/config/schema/route.ts
|
|
694
|
-
import { z as
|
|
695
|
-
var RouteSchema2 =
|
|
696
|
-
|
|
697
|
-
|
|
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")
|
|
698
660
|
]);
|
|
699
661
|
|
|
700
662
|
// src/feature/rest/schema.ts
|
|
701
|
-
var RestDefaultSchema =
|
|
663
|
+
var RestDefaultSchema = z19.record(
|
|
702
664
|
ResourceIdSchema,
|
|
703
|
-
|
|
665
|
+
z19.object({
|
|
704
666
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
705
|
-
subDomain:
|
|
667
|
+
subDomain: z19.string().optional()
|
|
706
668
|
})
|
|
707
669
|
).optional().describe("Define your global REST API's.");
|
|
708
|
-
var RestSchema =
|
|
670
|
+
var RestSchema = z19.record(ResourceIdSchema, z19.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
709
671
|
|
|
710
672
|
// src/feature/rpc/schema.ts
|
|
711
|
-
import { z as
|
|
712
|
-
var RpcDefaultSchema =
|
|
673
|
+
import { z as z20 } from "zod";
|
|
674
|
+
var RpcDefaultSchema = z20.record(
|
|
713
675
|
ResourceIdSchema,
|
|
714
|
-
|
|
676
|
+
z20.object({
|
|
715
677
|
domain: ResourceIdSchema.describe("The domain id to link your RPC API with.").optional(),
|
|
716
|
-
subDomain:
|
|
678
|
+
subDomain: z20.string().optional(),
|
|
717
679
|
auth: FunctionSchema.optional(),
|
|
718
680
|
log: LogSchema.optional()
|
|
719
681
|
})
|
|
720
682
|
).describe(`Define the global RPC API's.`).optional();
|
|
721
|
-
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();
|
|
722
684
|
|
|
723
685
|
// src/feature/search/schema.ts
|
|
724
686
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
725
|
-
import { z as
|
|
726
|
-
var VersionSchema =
|
|
727
|
-
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([
|
|
728
690
|
"t3.small",
|
|
729
691
|
"t3.medium",
|
|
730
692
|
"m3.medium",
|
|
@@ -799,11 +761,11 @@ var TypeSchema3 = z22.enum([
|
|
|
799
761
|
"r6gd.16xlarge"
|
|
800
762
|
]);
|
|
801
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.");
|
|
802
|
-
var SearchsSchema =
|
|
764
|
+
var SearchsSchema = z21.record(
|
|
803
765
|
ResourceIdSchema,
|
|
804
|
-
|
|
766
|
+
z21.object({
|
|
805
767
|
type: TypeSchema3.default("t3.small"),
|
|
806
|
-
count:
|
|
768
|
+
count: z21.number().int().min(1).default(1),
|
|
807
769
|
version: VersionSchema.default("2.13"),
|
|
808
770
|
storage: StorageSizeSchema.default("10 GB")
|
|
809
771
|
// vpc: z.boolean().default(false),
|
|
@@ -811,29 +773,29 @@ var SearchsSchema = z22.record(
|
|
|
811
773
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
812
774
|
|
|
813
775
|
// src/feature/site/schema.ts
|
|
814
|
-
import { z as
|
|
815
|
-
var ErrorResponsePathSchema =
|
|
776
|
+
import { z as z22 } from "zod";
|
|
777
|
+
var ErrorResponsePathSchema = z22.string().describe(
|
|
816
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."
|
|
817
779
|
);
|
|
818
|
-
var StatusCodeSchema =
|
|
780
|
+
var StatusCodeSchema = z22.number().int().positive().optional().describe(
|
|
819
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."
|
|
820
782
|
);
|
|
821
783
|
var MinTTLSchema = DurationSchema.describe(
|
|
822
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."
|
|
823
785
|
);
|
|
824
|
-
var ErrorResponseSchema =
|
|
786
|
+
var ErrorResponseSchema = z22.union([
|
|
825
787
|
ErrorResponsePathSchema,
|
|
826
|
-
|
|
788
|
+
z22.object({
|
|
827
789
|
path: ErrorResponsePathSchema,
|
|
828
790
|
statusCode: StatusCodeSchema.optional(),
|
|
829
791
|
minTTL: MinTTLSchema.optional()
|
|
830
792
|
})
|
|
831
793
|
]).optional();
|
|
832
|
-
var SitesSchema =
|
|
794
|
+
var SitesSchema = z22.record(
|
|
833
795
|
ResourceIdSchema,
|
|
834
|
-
|
|
796
|
+
z22.object({
|
|
835
797
|
domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
|
|
836
|
-
subDomain:
|
|
798
|
+
subDomain: z22.string().optional(),
|
|
837
799
|
// bind: z
|
|
838
800
|
// .object({
|
|
839
801
|
// auth: z.array(ResourceIdSchema),
|
|
@@ -842,11 +804,11 @@ var SitesSchema = z23.record(
|
|
|
842
804
|
// // rest: z.array(ResourceIdSchema),
|
|
843
805
|
// })
|
|
844
806
|
// .optional(),
|
|
845
|
-
static:
|
|
807
|
+
static: z22.union([LocalDirectorySchema, z22.boolean()]).optional().describe(
|
|
846
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."
|
|
847
809
|
),
|
|
848
810
|
ssr: FunctionSchema.optional().describe("Specifies the ssr file."),
|
|
849
|
-
origin:
|
|
811
|
+
origin: z22.enum(["ssr-first", "static-first"]).default("static-first").describe("Specifies the origin fallback ordering."),
|
|
850
812
|
// bind: z.object({
|
|
851
813
|
// auth:
|
|
852
814
|
// h
|
|
@@ -859,7 +821,7 @@ var SitesSchema = z23.record(
|
|
|
859
821
|
// build: z.string().optional(),
|
|
860
822
|
// }),
|
|
861
823
|
// ]),
|
|
862
|
-
errors:
|
|
824
|
+
errors: z22.object({
|
|
863
825
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
864
826
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
865
827
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -872,16 +834,16 @@ var SitesSchema = z23.record(
|
|
|
872
834
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
873
835
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
874
836
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
875
|
-
cors:
|
|
876
|
-
override:
|
|
837
|
+
cors: z22.object({
|
|
838
|
+
override: z22.boolean().default(false),
|
|
877
839
|
maxAge: DurationSchema.default("365 days"),
|
|
878
|
-
exposeHeaders:
|
|
879
|
-
credentials:
|
|
880
|
-
headers:
|
|
881
|
-
origins:
|
|
882
|
-
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"])
|
|
883
845
|
}).optional().describe("Define the cors headers."),
|
|
884
|
-
security:
|
|
846
|
+
security: z22.object({
|
|
885
847
|
// contentSecurityPolicy: z.object({
|
|
886
848
|
// override: z.boolean().default(false),
|
|
887
849
|
// policy: z.string(),
|
|
@@ -923,10 +885,10 @@ var SitesSchema = z23.record(
|
|
|
923
885
|
// reportUri?: string
|
|
924
886
|
// }
|
|
925
887
|
}).optional().describe("Define the security policy."),
|
|
926
|
-
cache:
|
|
927
|
-
cookies:
|
|
928
|
-
headers:
|
|
929
|
-
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.")
|
|
930
892
|
}).optional().describe(
|
|
931
893
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
932
894
|
)
|
|
@@ -934,26 +896,26 @@ var SitesSchema = z23.record(
|
|
|
934
896
|
).optional().describe("Define the sites in your stack.");
|
|
935
897
|
|
|
936
898
|
// src/feature/store/schema.ts
|
|
937
|
-
import { z as
|
|
938
|
-
var DeletionProtectionSchema =
|
|
939
|
-
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({
|
|
940
902
|
deletionProtection: DeletionProtectionSchema.optional()
|
|
941
903
|
}).optional();
|
|
942
|
-
var StoresSchema =
|
|
943
|
-
|
|
904
|
+
var StoresSchema = z23.union([
|
|
905
|
+
z23.array(ResourceIdSchema).transform((list) => {
|
|
944
906
|
const stores = {};
|
|
945
907
|
for (const key of list) {
|
|
946
908
|
stores[key] = {};
|
|
947
909
|
}
|
|
948
910
|
return stores;
|
|
949
911
|
}),
|
|
950
|
-
|
|
912
|
+
z23.record(
|
|
951
913
|
ResourceIdSchema,
|
|
952
|
-
|
|
914
|
+
z23.object({
|
|
953
915
|
// cors: CorsSchema,
|
|
954
916
|
deletionProtection: DeletionProtectionSchema.optional(),
|
|
955
|
-
versioning:
|
|
956
|
-
events:
|
|
917
|
+
versioning: z23.boolean().default(false).describe("Enable versioning of your store."),
|
|
918
|
+
events: z23.object({
|
|
957
919
|
// create
|
|
958
920
|
"created:*": FunctionSchema.optional().describe(
|
|
959
921
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
@@ -986,22 +948,22 @@ var StoresSchema = z24.union([
|
|
|
986
948
|
]).optional().describe("Define the stores in your stack.");
|
|
987
949
|
|
|
988
950
|
// src/feature/stream/schema.ts
|
|
989
|
-
import { z as
|
|
990
|
-
var LatencyModeSchema =
|
|
951
|
+
import { z as z24 } from "zod";
|
|
952
|
+
var LatencyModeSchema = z24.enum(["low", "normal"]).describe(
|
|
991
953
|
`Channel latency mode. Valid values:
|
|
992
954
|
- normal: Use "normal" to broadcast and deliver live video up to Full HD.
|
|
993
955
|
- low: Use "low" for near real-time interactions with viewers.`
|
|
994
956
|
);
|
|
995
|
-
var TypeSchema4 =
|
|
957
|
+
var TypeSchema4 = z24.enum(["standard", "basic", "advanced-sd", "advanced-hd"]).describe(`The channel type, which determines the allowable resolution and bitrate.
|
|
996
958
|
If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:
|
|
997
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.
|
|
998
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.
|
|
999
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.
|
|
1000
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.
|
|
1001
963
|
`);
|
|
1002
|
-
var StreamsSchema =
|
|
964
|
+
var StreamsSchema = z24.record(
|
|
1003
965
|
ResourceIdSchema,
|
|
1004
|
-
|
|
966
|
+
z24.object({
|
|
1005
967
|
type: TypeSchema4.default("standard"),
|
|
1006
968
|
// preset: PresetSchema.optional(),
|
|
1007
969
|
latencyMode: LatencyModeSchema.default("low")
|
|
@@ -1009,41 +971,41 @@ var StreamsSchema = z25.record(
|
|
|
1009
971
|
).optional().describe("Define the streams in your stack.");
|
|
1010
972
|
|
|
1011
973
|
// src/feature/table/schema.ts
|
|
1012
|
-
import { z as
|
|
1013
|
-
var KeySchema =
|
|
1014
|
-
var DeletionProtectionSchema2 =
|
|
1015
|
-
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({
|
|
1016
978
|
deletionProtection: DeletionProtectionSchema2.optional()
|
|
1017
979
|
}).optional();
|
|
1018
|
-
var TablesSchema =
|
|
980
|
+
var TablesSchema = z25.record(
|
|
1019
981
|
ResourceIdSchema,
|
|
1020
|
-
|
|
982
|
+
z25.object({
|
|
1021
983
|
hash: KeySchema.describe(
|
|
1022
984
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
1023
985
|
),
|
|
1024
986
|
sort: KeySchema.optional().describe(
|
|
1025
987
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
1026
988
|
),
|
|
1027
|
-
fields:
|
|
989
|
+
fields: z25.record(z25.string(), z25.enum(["string", "number", "binary"])).optional().describe(
|
|
1028
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".'
|
|
1029
991
|
),
|
|
1030
|
-
class:
|
|
1031
|
-
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."),
|
|
1032
994
|
timeToLiveAttribute: KeySchema.optional().describe(
|
|
1033
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."
|
|
1034
996
|
),
|
|
1035
997
|
deletionProtection: DeletionProtectionSchema2.optional(),
|
|
1036
|
-
stream:
|
|
1037
|
-
type:
|
|
998
|
+
stream: z25.object({
|
|
999
|
+
type: z25.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
1038
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."
|
|
1039
1001
|
),
|
|
1040
1002
|
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
1041
1003
|
}).optional().describe(
|
|
1042
1004
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
1043
1005
|
),
|
|
1044
|
-
indexes:
|
|
1045
|
-
|
|
1046
|
-
|
|
1006
|
+
indexes: z25.record(
|
|
1007
|
+
z25.string(),
|
|
1008
|
+
z25.object({
|
|
1047
1009
|
/** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
|
|
1048
1010
|
hash: KeySchema,
|
|
1049
1011
|
/** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
|
|
@@ -1053,18 +1015,18 @@ var TablesSchema = z26.record(
|
|
|
1053
1015
|
* - keys-only - Only the index and primary keys are projected into the index.
|
|
1054
1016
|
* @default 'all'
|
|
1055
1017
|
*/
|
|
1056
|
-
projection:
|
|
1018
|
+
projection: z25.enum(["all", "keys-only"]).default("all")
|
|
1057
1019
|
})
|
|
1058
1020
|
).optional().describe("Specifies the global secondary indexes to be created on the table.")
|
|
1059
1021
|
})
|
|
1060
1022
|
).optional().describe("Define the tables in your stack.");
|
|
1061
1023
|
|
|
1062
1024
|
// src/feature/task/schema.ts
|
|
1063
|
-
import { z as
|
|
1064
|
-
var RetryAttemptsSchema2 =
|
|
1025
|
+
import { z as z26 } from "zod";
|
|
1026
|
+
var RetryAttemptsSchema2 = z26.number().int().min(0).max(2).describe(
|
|
1065
1027
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1066
1028
|
);
|
|
1067
|
-
var TaskSchema =
|
|
1029
|
+
var TaskSchema = z26.union([
|
|
1068
1030
|
LocalFileSchema.transform((file) => ({
|
|
1069
1031
|
consumer: {
|
|
1070
1032
|
code: {
|
|
@@ -1075,33 +1037,33 @@ var TaskSchema = z27.union([
|
|
|
1075
1037
|
},
|
|
1076
1038
|
retryAttempts: void 0
|
|
1077
1039
|
})),
|
|
1078
|
-
|
|
1040
|
+
z26.object({
|
|
1079
1041
|
consumer: FunctionSchema,
|
|
1080
1042
|
retryAttempts: RetryAttemptsSchema2.optional()
|
|
1081
1043
|
})
|
|
1082
1044
|
]);
|
|
1083
|
-
var TasksSchema =
|
|
1045
|
+
var TasksSchema = z26.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1084
1046
|
|
|
1085
1047
|
// src/feature/test/schema.ts
|
|
1086
|
-
import { z as
|
|
1087
|
-
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();
|
|
1088
1050
|
|
|
1089
1051
|
// src/feature/topic/schema.ts
|
|
1090
1052
|
import { paramCase as paramCase2 } from "change-case";
|
|
1091
|
-
import { z as
|
|
1092
|
-
var TopicNameSchema =
|
|
1093
|
-
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) => {
|
|
1094
1056
|
return topics.length === new Set(topics).size;
|
|
1095
1057
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
1096
|
-
var SubscribersSchema =
|
|
1058
|
+
var SubscribersSchema = z28.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
1097
1059
|
|
|
1098
1060
|
// src/config/stack.ts
|
|
1099
1061
|
var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
|
|
1100
1062
|
var NameSchema = ResourceIdSchema.refine((name) => !["base"].includes(name), {
|
|
1101
1063
|
message: `Stack name can't be a reserved name.`
|
|
1102
1064
|
}).describe("Stack name.");
|
|
1103
|
-
var StackSchema =
|
|
1104
|
-
$schema:
|
|
1065
|
+
var StackSchema = z29.object({
|
|
1066
|
+
$schema: z29.string().optional(),
|
|
1105
1067
|
name: NameSchema,
|
|
1106
1068
|
depends: DependsSchema,
|
|
1107
1069
|
commands: CommandsSchema,
|
|
@@ -1130,15 +1092,15 @@ var StackSchema = z30.object({
|
|
|
1130
1092
|
});
|
|
1131
1093
|
|
|
1132
1094
|
// src/config/app.ts
|
|
1133
|
-
import { z as
|
|
1095
|
+
import { z as z36 } from "zod";
|
|
1134
1096
|
|
|
1135
1097
|
// src/feature/alert/schema.ts
|
|
1136
1098
|
import { paramCase as paramCase3 } from "change-case";
|
|
1137
|
-
import { z as
|
|
1138
|
-
var AlertNameSchema =
|
|
1139
|
-
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(
|
|
1140
1102
|
AlertNameSchema,
|
|
1141
|
-
|
|
1103
|
+
z30.union([
|
|
1142
1104
|
//
|
|
1143
1105
|
EmailSchema.transform((v) => [v]),
|
|
1144
1106
|
EmailSchema.array()
|
|
@@ -1146,18 +1108,18 @@ var AlertsDefaultSchema = z31.record(
|
|
|
1146
1108
|
).optional().describe("Define the alerts in your app. Alerts are a way to send messages to one or more email addresses.");
|
|
1147
1109
|
|
|
1148
1110
|
// src/feature/domain/schema.ts
|
|
1149
|
-
import { z as
|
|
1150
|
-
var DomainNameSchema =
|
|
1111
|
+
import { z as z31 } from "zod";
|
|
1112
|
+
var DomainNameSchema = z31.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
1151
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."
|
|
1152
1114
|
);
|
|
1153
|
-
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.");
|
|
1154
1116
|
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
1155
|
-
var RecordsSchema =
|
|
1156
|
-
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(
|
|
1157
1119
|
ResourceIdSchema,
|
|
1158
|
-
|
|
1120
|
+
z31.object({
|
|
1159
1121
|
domain: DomainNameSchema.describe("Define the domain name"),
|
|
1160
|
-
dns:
|
|
1122
|
+
dns: z31.object({
|
|
1161
1123
|
name: DomainNameSchema.optional(),
|
|
1162
1124
|
type: DNSTypeSchema,
|
|
1163
1125
|
ttl: TTLSchema,
|
|
@@ -1167,25 +1129,25 @@ var DomainsDefaultSchema = z32.record(
|
|
|
1167
1129
|
).optional().describe("Define the domains for your application.");
|
|
1168
1130
|
|
|
1169
1131
|
// src/feature/layer/schema.ts
|
|
1170
|
-
import { z as
|
|
1132
|
+
import { z as z33 } from "zod";
|
|
1171
1133
|
|
|
1172
1134
|
// src/config/schema/lambda.ts
|
|
1173
|
-
import { z as
|
|
1174
|
-
var ArchitectureSchema2 =
|
|
1175
|
-
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.");
|
|
1176
1138
|
|
|
1177
1139
|
// src/feature/layer/schema.ts
|
|
1178
|
-
var Schema =
|
|
1140
|
+
var Schema = z33.object({
|
|
1179
1141
|
file: LocalFileSchema,
|
|
1180
1142
|
runtimes: NodeRuntimeSchema2.array().optional(),
|
|
1181
1143
|
architecture: ArchitectureSchema2.optional(),
|
|
1182
|
-
packages:
|
|
1144
|
+
packages: z33.string().array().optional().describe(
|
|
1183
1145
|
"Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
|
|
1184
1146
|
)
|
|
1185
1147
|
});
|
|
1186
|
-
var LayerSchema =
|
|
1187
|
-
|
|
1188
|
-
|
|
1148
|
+
var LayerSchema = z33.record(
|
|
1149
|
+
z33.string(),
|
|
1150
|
+
z33.union([
|
|
1189
1151
|
LocalFileSchema.transform((file) => ({
|
|
1190
1152
|
file,
|
|
1191
1153
|
description: void 0
|
|
@@ -1200,21 +1162,21 @@ var OnFailureDefaultSchema = FunctionSchema.optional().describe(
|
|
|
1200
1162
|
);
|
|
1201
1163
|
|
|
1202
1164
|
// src/feature/on-log/schema.ts
|
|
1203
|
-
import { z as
|
|
1204
|
-
var FilterSchema =
|
|
1205
|
-
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([
|
|
1206
1168
|
FunctionSchema.transform((consumer) => ({
|
|
1207
1169
|
consumer,
|
|
1208
1170
|
filter: ["error", "fatal"]
|
|
1209
1171
|
})),
|
|
1210
|
-
|
|
1172
|
+
z34.object({
|
|
1211
1173
|
consumer: FunctionSchema,
|
|
1212
1174
|
filter: FilterSchema
|
|
1213
1175
|
})
|
|
1214
1176
|
]).optional().describe("Define a subscription on all Lambda functions logs.");
|
|
1215
1177
|
|
|
1216
1178
|
// src/config/schema/region.ts
|
|
1217
|
-
import { z as
|
|
1179
|
+
import { z as z35 } from "zod";
|
|
1218
1180
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
1219
1181
|
var AF = ["af-south-1"];
|
|
1220
1182
|
var AP = [
|
|
@@ -1243,21 +1205,21 @@ var EU = [
|
|
|
1243
1205
|
var ME = ["me-south-1", "me-central-1"];
|
|
1244
1206
|
var SA = ["sa-east-1"];
|
|
1245
1207
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
1246
|
-
var RegionSchema =
|
|
1208
|
+
var RegionSchema = z35.enum(regions);
|
|
1247
1209
|
|
|
1248
1210
|
// src/config/app.ts
|
|
1249
|
-
var AppSchema =
|
|
1250
|
-
$schema:
|
|
1211
|
+
var AppSchema = z36.object({
|
|
1212
|
+
$schema: z36.string().optional(),
|
|
1251
1213
|
name: ResourceIdSchema.describe("App name."),
|
|
1252
1214
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
1253
|
-
profile:
|
|
1215
|
+
profile: z36.string().describe("The AWS profile to deploy to."),
|
|
1254
1216
|
// stage: z
|
|
1255
1217
|
// .string()
|
|
1256
1218
|
// .regex(/^[a-z]+$/)
|
|
1257
1219
|
// .default('prod')
|
|
1258
1220
|
// .describe('The deployment stage.'),
|
|
1259
1221
|
// onFailure: OnFailureSchema,
|
|
1260
|
-
defaults:
|
|
1222
|
+
defaults: z36.object({
|
|
1261
1223
|
onFailure: OnFailureDefaultSchema,
|
|
1262
1224
|
onLog: OnLogDefaultSchema,
|
|
1263
1225
|
auth: AuthDefaultSchema,
|
|
@@ -1280,9 +1242,9 @@ var AppSchema = z37.object({
|
|
|
1280
1242
|
|
|
1281
1243
|
// cli/build-json-schema.ts
|
|
1282
1244
|
import { writeFileSync } from "node:fs";
|
|
1283
|
-
import { join as
|
|
1245
|
+
import { join as join2 } from "node:path";
|
|
1284
1246
|
var generateJsonSchema = (props) => {
|
|
1285
|
-
const file =
|
|
1247
|
+
const file = join2(process.cwd(), `dist/${props.name}.json`);
|
|
1286
1248
|
const schema = zodToJsonSchema(props.schema, {
|
|
1287
1249
|
name: props.name,
|
|
1288
1250
|
// errorMessages: true,
|