@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.
@@ -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 z30 } from "zod";
5
+ import { z as z29 } from "zod";
6
6
 
7
7
  // src/feature/auth/schema.ts
8
- import { z as z8 } from "zod";
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 z6 } from "zod";
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/local-file.ts
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 join2(basePath, path);
44
+ return join(basePath, path);
80
45
  }
81
- return join2(directories.root, path);
46
+ return path;
82
47
  };
83
- var LocalFileSchema = z3.string().transform((path) => resolvePath(path)).refine(async (path) => {
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.isFile();
54
+ return s.isDirectory();
87
55
  } catch (error) {
88
56
  return false;
89
57
  }
90
- }, `File doesn't exist`);
58
+ }, `Directory doesn't exist`);
91
59
 
92
- // src/config/schema/local-directory.ts
93
- var LocalDirectorySchema = z4.string().transform((path) => resolvePath(path)).refine(async (path) => {
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.isDirectory();
65
+ return s.isFile();
97
66
  } catch (error) {
98
67
  return false;
99
68
  }
100
- }, `Directory doesn't exist`);
69
+ }, `File doesn't exist`);
101
70
 
102
71
  // src/config/schema/size.ts
103
- import { z as z5 } from "zod";
72
+ import { z as z4 } from "zod";
104
73
  import { parse as parse2 } from "@awsless/size";
105
- var SizeSchema = z5.string().regex(/^[0-9]+ (B|KB|MB|GB|TB|PB)$/, "Invalid size").transform((v) => parse2(v));
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 = z6.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
129
- var EnvironmentSchema = z6.record(z6.string(), z6.string()).optional().describe("Environment variable key-value pairs.");
130
- var ArchitectureSchema = z6.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
131
- var RetryAttemptsSchema = z6.number().int().min(0).max(2).describe(
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 = z6.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]);
135
- var ContainerRuntimeSchema = z6.literal("container");
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 = z6.string();
138
- var ActionsSchema = z6.union([ActionSchema.transform((v) => [v]), ActionSchema.array()]);
139
- var ArnSchema = z6.string().startsWith("arn:").transform((v) => v);
140
- var WildcardSchema = z6.literal("*");
141
- var ResourceSchema = z6.union([ArnSchema, WildcardSchema]);
142
- var ResourcesSchema = z6.union([ResourceSchema.transform((v) => [v]), ResourceSchema.array()]);
143
- var PermissionSchema = z6.object({
144
- effect: z6.enum(["allow", "deny"]).default("allow"),
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 = z6.union([PermissionSchema.transform((v) => [v]), PermissionSchema.array()]).describe("Add IAM permissions to your function.");
149
- var WarmSchema = z6.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.");
150
- var VPCSchema = z6.boolean().describe("Put the function inside your global VPC.");
151
- var MinifySchema = z6.boolean().describe("Minify the function code.");
152
- var HandlerSchema = z6.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
153
- var DescriptionSchema = z6.string().describe("A description of the function.");
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 = z6.union([
137
+ var LogSubscriptionSchema = z5.union([
169
138
  LocalFileSchema.transform((file) => ({
170
139
  file
171
140
  })),
172
- z6.object({
141
+ z5.object({
173
142
  subscriber: LocalFileSchema,
174
- filter: z6.string().optional()
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 = z6.union([
180
- z6.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
148
+ var LogSchema = z5.union([
149
+ z5.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
181
150
  LogRetentionSchema.transform((retention) => ({ retention })),
182
- z6.object({
151
+ z5.object({
183
152
  subscription: LogSubscriptionSchema.optional(),
184
153
  retention: LogRetentionSchema.optional(),
185
- format: z6.enum(["text", "json"]).describe(
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: z6.enum(["debug", "info", "warn"]).describe(
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: z6.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
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 = z6.string().array().describe(
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 = z6.object({
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: z6.string().array().optional().describe(`A list of external packages that won't be included in the bundle.`)
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 = z6.object({
174
+ var BundleCodeSchema = z5.object({
206
175
  bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
207
176
  });
208
- var CodeSchema = z6.union([
209
- LocalFileSchema.transform(
210
- (file) => FileCodeSchema.parse({
211
- file
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 = z6.object({
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 = z6.union([
241
- LocalFileSchema.transform((file) => ({
242
- code: FileCodeSchema.parse({
243
- file
244
- })
245
- })),
207
+ var FunctionSchema = z5.union([
208
+ LocalFileSchema.transform((code) => ({
209
+ code
210
+ })).pipe(FnSchema),
246
211
  FnSchema
247
212
  ]);
248
- var FunctionsSchema = z6.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
249
- var FunctionDefaultSchema = z6.object({
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 z7 } from "zod";
279
- var EmailSchema = z7.string().email();
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 = z8.object({
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 = z8.record(
260
+ var AuthSchema = z7.record(
296
261
  ResourceIdSchema,
297
- z8.object({
298
- access: z8.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
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 = z8.record(
267
+ var AuthDefaultSchema = z7.record(
303
268
  ResourceIdSchema,
304
- z8.object({
305
- allowUserRegistration: z8.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
306
- messaging: z8.object({
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: z8.string().optional().describe("Specifies the sender's name."),
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: z8.object({
315
- emailAlias: z8.boolean().default(true).describe("Allow the user email to be used as username."),
316
- caseSensitive: z8.boolean().default(false).describe(
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: z8.object({
321
- minLength: z8.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
322
- uppercase: z8.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
323
- lowercase: z8.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
324
- numbers: z8.boolean().default(true).describe("Required users to use at least one number in their password."),
325
- symbols: z8.boolean().default(true).describe("Required users to use at least one symbol in their password."),
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: z8.object({
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 z9 } from "zod";
347
- var TypeSchema = z9.enum([
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 = z9.number().int().min(1).max(5e4);
363
- var ShardsSchema = z9.number().int().min(0).max(100);
364
- var ReplicasPerShardSchema = z9.number().int().min(0).max(5);
365
- var EngineSchema = z9.enum(["7.0", "6.2"]);
366
- var CachesSchema = z9.record(
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
- z9.object({
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: z9.boolean().default(false)
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 z10 } from "zod";
380
- var CommandSchema = z10.union([
381
- z10.object({
344
+ import { z as z9 } from "zod";
345
+ var CommandSchema = z9.union([
346
+ z9.object({
382
347
  file: LocalFileSchema,
383
- handler: z10.string().default("default").describe("The name of the handler that needs to run"),
384
- description: z10.string().optional().describe("A description of the command")
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 = z10.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
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 z11 } from "zod";
398
- var ConfigNameSchema = z11.string().regex(/[a-z0-9\-]/g, "Invalid config name");
399
- var ConfigsSchema = z11.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
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 z13 } from "zod";
367
+ import { z as z12 } from "zod";
403
368
 
404
369
  // src/feature/cron/schema/schedule.ts
405
- import { z as z12 } from "zod";
370
+ import { z as z11 } from "zod";
406
371
  import { awsCronExpressionValidator } from "aws-cron-expression-validator";
407
- var RateExpressionSchema = z12.custom(
372
+ var RateExpressionSchema = z11.custom(
408
373
  (value) => {
409
- return z12.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
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 = z12.custom(
390
+ var CronExpressionSchema = z11.custom(
426
391
  (value) => {
427
- return z12.string().safeParse(value).success;
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: z12.ZodIssueCode.custom,
401
+ code: z11.ZodIssueCode.custom,
437
402
  message: `Invalid cron expression: ${error.message}`
438
403
  });
439
404
  } else {
440
405
  ctx.addIssue({
441
- code: z12.ZodIssueCode.custom,
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 = z13.record(
417
+ var CronsSchema = z12.record(
453
418
  ResourceIdSchema,
454
- z13.object({
455
- enabled: z13.boolean().default(true).describe("If the cron is 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: z13.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
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 z14 } from "zod";
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 = z14.record(
434
+ var GraphQLDefaultSchema = z13.record(
470
435
  ResourceIdSchema,
471
- z14.object({
436
+ z13.object({
472
437
  domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
473
- subDomain: z14.string().optional(),
474
- auth: z14.union([
438
+ subDomain: z13.string().optional(),
439
+ auth: z13.union([
475
440
  ResourceIdSchema,
476
- z14.object({
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 = z14.record(
453
+ var GraphQLSchema = z13.record(
489
454
  ResourceIdSchema,
490
- z14.object({
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: z14.record(
458
+ resolvers: z13.record(
494
459
  // TypeName
495
- z14.string(),
496
- z14.record(
460
+ z13.string(),
461
+ z13.record(
497
462
  // FieldName
498
- z14.string(),
499
- z14.union([
463
+ z13.string(),
464
+ z13.union([
500
465
  FunctionSchema.transform((consumer) => ({
501
466
  consumer
502
467
  })),
503
- z14.object({
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 z15 } from "zod";
515
- var RouteSchema = z15.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
516
- var HttpDefaultSchema = z15.record(
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
- z15.object({
483
+ z14.object({
519
484
  domain: ResourceIdSchema.describe("The domain id to link your API with."),
520
- subDomain: z15.string().optional()
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 = z15.record(ResourceIdSchema, z15.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
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 z16 } from "zod";
528
- var ImageSchema = z16.string().regex(/^ami\-[0-9a-f]+/).describe("The ID of the AMI.");
529
- var TypeSchema2 = z16.enum([
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 = z16.string().describe(`The script you want to execute when the instance starts up.`);
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 = z16.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
550
- var EnvironmentSchema2 = z16.record(z16.string(), z16.string()).optional().describe("Environment variable key-value pairs.");
551
- var ActionSchema2 = z16.string();
552
- var ActionsSchema2 = z16.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
553
- var ArnSchema2 = z16.string().startsWith("arn:");
554
- var WildcardSchema2 = z16.literal("*");
555
- var ResourceSchema2 = z16.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
556
- var ResourcesSchema2 = z16.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
557
- var PermissionSchema2 = z16.object({
558
- effect: z16.enum(["allow", "deny"]).default("allow"),
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 = z16.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
563
- var InstanceDefaultSchema = z16.object({
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 = z16.record(
531
+ var InstancesSchema = z15.record(
567
532
  ResourceIdSchema,
568
- z16.object({
533
+ z15.object({
569
534
  image: ImageSchema,
570
535
  type: TypeSchema2,
571
536
  code: CodeSchema2,
572
- user: z16.string().default("ec2-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: z16.boolean().default(true)
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 z17 } from "zod";
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 = z17.record(
548
+ var PubSubDefaultSchema = z16.record(
584
549
  ResourceIdSchema,
585
- z17.object({
550
+ z16.object({
586
551
  auth: FunctionSchema,
587
552
  domain: DomainSchema.optional(),
588
- subDomain: z17.string().optional()
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 = z17.record(
569
+ var PubSubSchema = z16.record(
605
570
  ResourceIdSchema,
606
- z17.object({
607
- sql: z17.string().describe("The SQL statement used to query the IOT topic."),
608
- sqlVersion: z17.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."),
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 z18 } from "zod";
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 = z18.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
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 = z18.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
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 = z18.object({
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 QueuesSchema = z18.record(
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
- z18.union([
669
- LocalFileSchema.transform((code) => ({
670
- consumer: FunctionSchema.parse({
671
- code
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 z20 } from "zod";
653
+ import { z as z19 } from "zod";
690
654
 
691
655
  // src/config/schema/route.ts
692
- import { z as z19 } from "zod";
693
- var RouteSchema2 = z19.union([
694
- z19.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
695
- z19.literal("$default")
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 = z20.record(
663
+ var RestDefaultSchema = z19.record(
700
664
  ResourceIdSchema,
701
- z20.object({
665
+ z19.object({
702
666
  domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
703
- subDomain: z20.string().optional()
667
+ subDomain: z19.string().optional()
704
668
  })
705
669
  ).optional().describe("Define your global REST API's.");
706
- var RestSchema = z20.record(ResourceIdSchema, z20.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
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 z21 } from "zod";
710
- var RpcDefaultSchema = z21.record(
673
+ import { z as z20 } from "zod";
674
+ var RpcDefaultSchema = z20.record(
711
675
  ResourceIdSchema,
712
- z21.object({
676
+ z20.object({
713
677
  domain: ResourceIdSchema.describe("The domain id to link your RPC API with.").optional(),
714
- subDomain: z21.string().optional(),
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 = z21.record(ResourceIdSchema, z21.record(z21.string(), FunctionSchema).describe("The queries for your global RPC API.")).describe("Define the schema in your stack for your global RPC API.").optional();
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 z22 } from "zod";
724
- var VersionSchema = z22.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
725
- var TypeSchema3 = z22.enum([
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 = z22.record(
764
+ var SearchsSchema = z21.record(
801
765
  ResourceIdSchema,
802
- z22.object({
766
+ z21.object({
803
767
  type: TypeSchema3.default("t3.small"),
804
- count: z22.number().int().min(1).default(1),
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 z23 } from "zod";
813
- var ErrorResponsePathSchema = z23.string().describe(
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 = z23.number().int().positive().optional().describe(
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 = z23.union([
786
+ var ErrorResponseSchema = z22.union([
823
787
  ErrorResponsePathSchema,
824
- z23.object({
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 = z23.record(
794
+ var SitesSchema = z22.record(
831
795
  ResourceIdSchema,
832
- z23.object({
796
+ z22.object({
833
797
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
834
- subDomain: z23.string().optional(),
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: z23.union([LocalDirectorySchema, z23.boolean()]).optional().describe(
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: z23.enum(["ssr-first", "static-first"]).default("static-first").describe("Specifies the origin fallback ordering."),
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: z23.object({
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: z23.object({
874
- override: z23.boolean().default(false),
837
+ cors: z22.object({
838
+ override: z22.boolean().default(false),
875
839
  maxAge: DurationSchema.default("365 days"),
876
- exposeHeaders: z23.string().array().optional(),
877
- credentials: z23.boolean().default(false),
878
- headers: z23.string().array().default(["*"]),
879
- origins: z23.string().array().default(["*"]),
880
- methods: z23.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
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: z23.object({
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: z23.object({
925
- cookies: z23.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
926
- headers: z23.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
927
- queries: z23.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
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 z24 } from "zod";
936
- var DeletionProtectionSchema = z24.boolean().describe("Specifies if you want to protect the store from being deleted by awsless.");
937
- var StoreDefaultSchema = z24.object({
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 = z24.union([
941
- z24.array(ResourceIdSchema).transform((list) => {
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
- z24.record(
912
+ z23.record(
949
913
  ResourceIdSchema,
950
- z24.object({
914
+ z23.object({
951
915
  // cors: CorsSchema,
952
916
  deletionProtection: DeletionProtectionSchema.optional(),
953
- versioning: z24.boolean().default(false).describe("Enable versioning of your store."),
954
- events: z24.object({
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 z25 } from "zod";
988
- var LatencyModeSchema = z25.enum(["low", "normal"]).describe(
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 = z25.enum(["standard", "basic", "advanced-sd", "advanced-hd"]).describe(`The channel type, which determines the allowable resolution and bitrate.
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 = z25.record(
964
+ var StreamsSchema = z24.record(
1001
965
  ResourceIdSchema,
1002
- z25.object({
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 z26 } from "zod";
1011
- var KeySchema = z26.string().min(1).max(255);
1012
- var DeletionProtectionSchema2 = z26.boolean().describe("Specifies if you want to protect the table from being deleted by awsless.");
1013
- var TableDefaultSchema = z26.object({
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 = z26.record(
980
+ var TablesSchema = z25.record(
1017
981
  ResourceIdSchema,
1018
- z26.object({
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: z26.record(z26.string(), z26.enum(["string", "number", "binary"])).optional().describe(
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: z26.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
1029
- pointInTimeRecovery: z26.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
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: z26.object({
1035
- type: z26.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
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: z26.record(
1043
- z26.string(),
1044
- z26.object({
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: z26.enum(["all", "keys-only"]).default("all")
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 z27 } from "zod";
1062
- var RetryAttemptsSchema2 = z27.number().int().min(0).max(2).describe(
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 = z27.union([
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
- z27.object({
1040
+ z26.object({
1077
1041
  consumer: FunctionSchema,
1078
1042
  retryAttempts: RetryAttemptsSchema2.optional()
1079
1043
  })
1080
1044
  ]);
1081
- var TasksSchema = z27.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
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 z28 } from "zod";
1085
- var TestsSchema = z28.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
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 z29 } from "zod";
1090
- var TopicNameSchema = z29.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase2(value)).describe("Define event topic name.");
1091
- var TopicsSchema = z29.array(TopicNameSchema).refine((topics) => {
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 = z29.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
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 = z30.object({
1102
- $schema: z30.string().optional(),
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 z37 } from "zod";
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 z31 } from "zod";
1136
- var AlertNameSchema = z31.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid alert name").transform((value) => paramCase3(value)).describe("Define event topic name.");
1137
- var AlertsDefaultSchema = z31.record(
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
- z31.union([
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 z32 } from "zod";
1148
- var DomainNameSchema = z32.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
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 = z32.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
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 = z32.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
1154
- var DomainsDefaultSchema = z32.record(
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
- z32.object({
1120
+ z31.object({
1157
1121
  domain: DomainNameSchema.describe("Define the domain name"),
1158
- dns: z32.object({
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 z34 } from "zod";
1132
+ import { z as z33 } from "zod";
1169
1133
 
1170
1134
  // src/config/schema/lambda.ts
1171
- import { z as z33 } from "zod";
1172
- var ArchitectureSchema2 = z33.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
1173
- var NodeRuntimeSchema2 = z33.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).describe("The identifier of the function's runtime.");
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 = z34.object({
1140
+ var Schema = z33.object({
1177
1141
  file: LocalFileSchema,
1178
1142
  runtimes: NodeRuntimeSchema2.array().optional(),
1179
1143
  architecture: ArchitectureSchema2.optional(),
1180
- packages: z34.string().array().optional().describe(
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 = z34.record(
1185
- z34.string(),
1186
- z34.union([
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 z35 } from "zod";
1202
- var FilterSchema = z35.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
1203
- var OnLogDefaultSchema = z35.union([
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
- z35.object({
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 z36 } from "zod";
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 = z36.enum(regions);
1208
+ var RegionSchema = z35.enum(regions);
1245
1209
 
1246
1210
  // src/config/app.ts
1247
- var AppSchema = z37.object({
1248
- $schema: z37.string().optional(),
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: z37.string().describe("The AWS profile to deploy to."),
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: z37.object({
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 join3 } from "node:path";
1245
+ import { join as join2 } from "node:path";
1282
1246
  var generateJsonSchema = (props) => {
1283
- const file = join3(process.cwd(), `dist/${props.name}.json`);
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,