@awsless/awsless 0.0.654 → 0.0.656

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.
@@ -4,7 +4,7 @@ import { join as join2 } from "node:path";
4
4
  import { zodToJsonSchema } from "zod-to-json-schema";
5
5
 
6
6
  // src/config/app.ts
7
- import { z as z24 } from "zod";
7
+ import { z as z26 } from "zod";
8
8
 
9
9
  // src/feature/alert/schema.ts
10
10
  import { kebabCase } from "change-case";
@@ -201,9 +201,6 @@ var EphemeralStorageSizeSchema = SizeSchema.refine(
201
201
  var ReservedConcurrentExecutionsSchema = z11.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
202
202
  var EnvironmentSchema = z11.record(z11.string(), z11.string()).optional().describe("Environment variable key-value pairs.");
203
203
  var ArchitectureSchema = z11.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
204
- var RetryAttemptsSchema = z11.number().int().min(0).max(2).describe(
205
- "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
206
- );
207
204
  var NodeRuntimeSchema = z11.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x", "nodejs24.x"]);
208
205
  var ContainerRuntimeSchema = z11.literal("container");
209
206
  var RuntimeSchema = NodeRuntimeSchema.or(ContainerRuntimeSchema).or(z11.string()).describe("The identifier of the function's runtime.");
@@ -296,7 +293,7 @@ var FnSchema = z11.object({
296
293
  memorySize: MemorySizeSchema.optional(),
297
294
  architecture: ArchitectureSchema.optional(),
298
295
  ephemeralStorageSize: EphemeralStorageSizeSchema.optional(),
299
- retryAttempts: RetryAttemptsSchema.optional(),
296
+ // retryAttempts: RetryAttemptsSchema.optional(),
300
297
  reserved: ReservedConcurrentExecutionsSchema.optional(),
301
298
  layers: LayersSchema.optional(),
302
299
  environment: EnvironmentSchema.optional(),
@@ -330,7 +327,7 @@ var FunctionDefaultSchema = z11.object({
330
327
  memorySize: MemorySizeSchema.default("128 MB"),
331
328
  architecture: ArchitectureSchema.default("arm64"),
332
329
  ephemeralStorageSize: EphemeralStorageSizeSchema.default("512 MB"),
333
- retryAttempts: RetryAttemptsSchema.default(2),
330
+ // retryAttempts: RetryAttemptsSchema.default(2),
334
331
  reserved: ReservedConcurrentExecutionsSchema.optional(),
335
332
  layers: LayersSchema.optional(),
336
333
  environment: EnvironmentSchema.optional(),
@@ -366,39 +363,56 @@ var LayerSchema = z13.record(
366
363
  ).optional().describe("Define the lambda layers in your stack.");
367
364
 
368
365
  // src/feature/on-failure/schema.ts
369
- var OnFailureDefaultSchema = FunctionSchema.optional().describe(
366
+ import { z as z14 } from "zod";
367
+ var NotifySchema = z14.union([
368
+ //
369
+ EmailSchema.transform((v) => [v]),
370
+ EmailSchema.array()
371
+ ]).describe("Receive an email notification when consuming failure entries goes wrong.");
372
+ var OnFailureDefaultSchema = z14.union([
373
+ FunctionSchema.transform((consumer) => ({
374
+ consumer,
375
+ notify: []
376
+ })),
377
+ z14.object({
378
+ consumer: FunctionSchema,
379
+ notify: NotifySchema.optional()
380
+ })
381
+ ]).optional().describe(
370
382
  [
371
383
  "Defining a onFailure handler will add a global onFailure handler for the following resources:",
372
- "- CloudWatch Scheduler",
373
- "- Async lambda functions",
374
- "- SQS queues",
375
- "- DynamoDB streams"
384
+ "- Tasks",
385
+ "- Crons",
386
+ "- Queues",
387
+ "- Topics",
388
+ "- Pubsub",
389
+ "- Table streams"
376
390
  ].join("\n")
377
391
  );
378
392
 
379
393
  // src/feature/on-log/schema.ts
380
- import { z as z14 } from "zod";
381
- var FilterSchema = z14.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
382
- var OnLogDefaultSchema = z14.union([
394
+ import { z as z15 } from "zod";
395
+ var FilterSchema = z15.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
396
+ var OnLogDefaultSchema = z15.union([
383
397
  FunctionSchema.transform((consumer) => ({
384
398
  consumer,
385
399
  filter: ["error", "fatal"]
386
400
  })),
387
- z14.object({
401
+ z15.object({
388
402
  consumer: FunctionSchema,
389
403
  filter: FilterSchema
390
404
  })
391
405
  ]).optional().describe("Define a subscription on all Lambda functions logs.");
392
406
 
393
407
  // src/feature/pubsub/schema.ts
394
- import { z as z15 } from "zod";
408
+ import { z as z16 } from "zod";
395
409
  var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
396
- var PubSubDefaultSchema = z15.record(
410
+ var PubSubDefaultSchema = z16.record(
397
411
  ResourceIdSchema,
398
- z15.object({
412
+ z16.object({
399
413
  auth: FunctionSchema,
400
414
  domain: DomainSchema.optional(),
401
- subDomain: z15.string().optional()
415
+ subDomain: z16.string().optional()
402
416
  // auth: z.union([
403
417
  // ResourceIdSchema,
404
418
  // z.object({
@@ -414,19 +428,23 @@ var PubSubDefaultSchema = z15.record(
414
428
  // .optional(),
415
429
  })
416
430
  ).optional().describe("Define the pubsub subscriber in your stack.");
417
- var PubSubSchema = z15.record(
431
+ var RetryAttemptsSchema = z16.number().int().min(0).max(2).describe(
432
+ "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
433
+ );
434
+ var PubSubSchema = z16.record(
418
435
  ResourceIdSchema,
419
- z15.object({
420
- sql: z15.string().describe("The SQL statement used to query the IOT topic."),
421
- sqlVersion: z15.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."),
422
- consumer: FunctionSchema.describe("The consuming lambda function properties.")
436
+ z16.object({
437
+ sql: z16.string().describe("The SQL statement used to query the IOT topic."),
438
+ 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."),
439
+ consumer: FunctionSchema.describe("The consuming lambda function properties."),
440
+ retryAttempts: RetryAttemptsSchema.default(2)
423
441
  })
424
442
  ).optional().describe("Define the pubsub subscriber in your stack.");
425
443
 
426
444
  // src/feature/queue/schema.ts
427
445
  import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
428
446
  import { kibibytes } from "@awsless/size";
429
- import { z as z16 } from "zod";
447
+ import { z as z17 } from "zod";
430
448
  var RetentionPeriodSchema = DurationSchema.refine(
431
449
  durationMin(minutes2(1)),
432
450
  "Minimum retention period is 1 minute"
@@ -454,10 +472,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
454
472
  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(
455
473
  "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."
456
474
  );
457
- var BatchSizeSchema = z16.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
475
+ var BatchSizeSchema = z17.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
458
476
  "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."
459
477
  );
460
- var MaxConcurrencySchema = z16.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
478
+ var MaxConcurrencySchema = z17.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
461
479
  "Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
462
480
  );
463
481
  var MaxBatchingWindow = DurationSchema.refine(
@@ -466,7 +484,10 @@ var MaxBatchingWindow = DurationSchema.refine(
466
484
  ).describe(
467
485
  "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."
468
486
  );
469
- var QueueDefaultSchema = z16.object({
487
+ var RetryAttemptsSchema2 = z17.number().int().min(0).max(999).describe(
488
+ "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 999."
489
+ );
490
+ var QueueDefaultSchema = z17.object({
470
491
  retentionPeriod: RetentionPeriodSchema.default("7 days"),
471
492
  visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
472
493
  deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
@@ -474,9 +495,10 @@ var QueueDefaultSchema = z16.object({
474
495
  maxMessageSize: MaxMessageSizeSchema.default("256 KB"),
475
496
  batchSize: BatchSizeSchema.default(10),
476
497
  maxConcurrency: MaxConcurrencySchema.optional(),
477
- maxBatchingWindow: MaxBatchingWindow.optional()
498
+ maxBatchingWindow: MaxBatchingWindow.optional(),
499
+ retryAttempts: RetryAttemptsSchema2.default(2)
478
500
  }).default({});
479
- var QueueSchema = z16.object({
501
+ var QueueSchema = z17.object({
480
502
  consumer: FunctionSchema.optional().describe("The consuming lambda function properties."),
481
503
  retentionPeriod: RetentionPeriodSchema.optional(),
482
504
  visibilityTimeout: VisibilityTimeoutSchema.optional(),
@@ -485,11 +507,12 @@ var QueueSchema = z16.object({
485
507
  maxMessageSize: MaxMessageSizeSchema.optional(),
486
508
  batchSize: BatchSizeSchema.optional(),
487
509
  maxConcurrency: MaxConcurrencySchema.optional(),
488
- maxBatchingWindow: MaxBatchingWindow.optional()
510
+ maxBatchingWindow: MaxBatchingWindow.optional(),
511
+ retryAttempts: RetryAttemptsSchema2.optional()
489
512
  });
490
- var QueuesSchema = z16.record(
513
+ var QueuesSchema = z17.record(
491
514
  ResourceIdSchema,
492
- z16.union([
515
+ z17.union([
493
516
  LocalFileSchema.transform((consumer) => ({
494
517
  consumer
495
518
  })).pipe(QueueSchema),
@@ -498,26 +521,26 @@ var QueuesSchema = z16.record(
498
521
  ).optional().describe("Define the queues in your stack.");
499
522
 
500
523
  // src/feature/rest/schema.ts
501
- import { z as z18 } from "zod";
524
+ import { z as z19 } from "zod";
502
525
 
503
526
  // src/config/schema/route.ts
504
- import { z as z17 } from "zod";
505
- var RouteSchema = z17.union([
506
- z17.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS|ANY)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
507
- z17.literal("$default")
527
+ import { z as z18 } from "zod";
528
+ var RouteSchema = z18.union([
529
+ z18.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS|ANY)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
530
+ z18.literal("$default")
508
531
  ]);
509
532
 
510
533
  // src/feature/rest/schema.ts
511
- var RestDefaultSchema = z18.record(
534
+ var RestDefaultSchema = z19.record(
512
535
  ResourceIdSchema,
513
- z18.object({
536
+ z19.object({
514
537
  domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
515
- subDomain: z18.string().optional()
538
+ subDomain: z19.string().optional()
516
539
  })
517
540
  ).optional().describe("Define your global REST API's.");
518
- var RestSchema = z18.record(
541
+ var RestSchema = z19.record(
519
542
  ResourceIdSchema,
520
- z18.record(
543
+ z19.record(
521
544
  RouteSchema.describe(
522
545
  [
523
546
  "The REST API route that is comprised by the http method and http path.",
@@ -531,19 +554,19 @@ var RestSchema = z18.record(
531
554
 
532
555
  // src/feature/rpc/schema.ts
533
556
  import { minutes as minutes4, seconds as seconds3 } from "@awsless/duration";
534
- import { z as z20 } from "zod";
557
+ import { z as z21 } from "zod";
535
558
 
536
559
  // src/feature/router/schema.ts
537
560
  import { days as days3, minutes as minutes3, parse as parse3 } from "@awsless/duration";
538
- import { z as z19 } from "zod";
539
- var ErrorResponsePathSchema = z19.string().describe(
561
+ import { z as z20 } from "zod";
562
+ var ErrorResponsePathSchema = z20.string().describe(
540
563
  [
541
564
  "The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.",
542
565
  "- We recommend that you store custom error pages in an Amazon S3 bucket.",
543
566
  "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."
544
567
  ].join("\n")
545
568
  );
546
- var StatusCodeSchema = z19.number().int().positive().optional().describe(
569
+ var StatusCodeSchema = z20.number().int().positive().optional().describe(
547
570
  [
548
571
  "The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.",
549
572
  "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:",
@@ -556,26 +579,26 @@ var StatusCodeSchema = z19.number().int().positive().optional().describe(
556
579
  var MinTTLSchema = DurationSchema.describe(
557
580
  "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."
558
581
  );
559
- var ErrorResponseSchema = z19.union([
582
+ var ErrorResponseSchema = z20.union([
560
583
  ErrorResponsePathSchema,
561
- z19.object({
584
+ z20.object({
562
585
  path: ErrorResponsePathSchema,
563
586
  statusCode: StatusCodeSchema.optional(),
564
587
  minTTL: MinTTLSchema.optional()
565
588
  })
566
589
  ]).optional();
567
- var RouteSchema2 = z19.string().regex(/^\//, "Route must start with a slash (/)");
568
- var VisibilitySchema = z19.boolean().default(false).describe("Whether to enable CloudWatch metrics for the WAF rule.");
569
- var WafSettingsSchema = z19.object({
570
- rateLimiter: z19.object({
571
- limit: z19.number().min(10).max(2e9).default(10).describe(
590
+ var RouteSchema2 = z20.string().regex(/^\//, "Route must start with a slash (/)");
591
+ var VisibilitySchema = z20.boolean().default(false).describe("Whether to enable CloudWatch metrics for the WAF rule.");
592
+ var WafSettingsSchema = z20.object({
593
+ rateLimiter: z20.object({
594
+ limit: z20.number().min(10).max(2e9).default(10).describe(
572
595
  "The limit on requests during the specified evaluation window for a single aggregation instance for the rate-based rule."
573
596
  ),
574
- window: z19.union([
575
- z19.literal("1 minute"),
576
- z19.literal("2 minutes"),
577
- z19.literal("5 minutes"),
578
- z19.literal("10 minutes")
597
+ window: z20.union([
598
+ z20.literal("1 minute"),
599
+ z20.literal("2 minutes"),
600
+ z20.literal("5 minutes"),
601
+ z20.literal("10 minutes")
579
602
  ]).default("5 minutes").transform((v) => parse3(v)).describe(
580
603
  "The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time."
581
604
  ),
@@ -583,18 +606,18 @@ var WafSettingsSchema = z19.object({
583
606
  }).optional().describe(
584
607
  "A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate."
585
608
  ),
586
- ddosProtection: z19.object({
587
- sensitivity: z19.object({
588
- challenge: z19.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for challenge requests."),
589
- block: z19.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for block requests.")
609
+ ddosProtection: z20.object({
610
+ sensitivity: z20.object({
611
+ challenge: z20.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for challenge requests."),
612
+ block: z20.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for block requests.")
590
613
  }),
591
- exemptUriRegex: z19.string().default("^$"),
614
+ exemptUriRegex: z20.string().default("^$"),
592
615
  visibility: VisibilitySchema
593
616
  }).optional().describe(
594
617
  "Provides protection against DDoS attacks targeting the application layer, also known as Layer 7 attacks. Uses 50 WCU."
595
618
  ),
596
- botProtection: z19.object({
597
- inspectionLevel: z19.enum(["common", "targeted"]).default("common").transform((v) => v.toUpperCase()),
619
+ botProtection: z20.object({
620
+ inspectionLevel: z20.enum(["common", "targeted"]).default("common").transform((v) => v.toUpperCase()),
598
621
  visibility: VisibilitySchema
599
622
  }).optional().describe(
600
623
  "Provides protection against automated bots that can consume excess resources, skew business metrics, cause downtime, or perform malicious activities. Bot Control provides additional visibility through Amazon CloudWatch and generates labels that you can use to control bot traffic to your applications. Uses 50 WCU."
@@ -608,14 +631,14 @@ var WafSettingsSchema = z19.object({
608
631
  }).describe(
609
632
  "WAF settings for the router. Each rule consumes Web ACL capacity units (WCUs). The total WCUs for a web ACL can't exceed 5000. Using over 1500 WCUs affects your costs."
610
633
  );
611
- var RouterDefaultSchema = z19.record(
634
+ var RouterDefaultSchema = z20.record(
612
635
  ResourceIdSchema,
613
- z19.object({
636
+ z20.object({
614
637
  domain: ResourceIdSchema.describe("The domain id to link your Router.").optional(),
615
- subDomain: z19.string().optional(),
638
+ subDomain: z20.string().optional(),
616
639
  waf: WafSettingsSchema.optional(),
617
- geoRestrictions: z19.array(z19.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
618
- errors: z19.object({
640
+ geoRestrictions: z20.array(z20.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
641
+ errors: z20.object({
619
642
  400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
620
643
  403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
621
644
  404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
@@ -628,19 +651,22 @@ var RouterDefaultSchema = z19.record(
628
651
  503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
629
652
  504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
630
653
  }).optional().describe("Customize the error responses for specific HTTP status codes."),
631
- cors: z19.object({
632
- override: z19.boolean().default(false),
654
+ cors: z20.object({
655
+ override: z20.boolean().default(false),
633
656
  maxAge: DurationSchema.default("365 days"),
634
- exposeHeaders: z19.string().array().optional(),
635
- credentials: z19.boolean().default(false),
636
- headers: z19.string().array().default(["*"]),
637
- origins: z19.string().array().default(["*"]),
638
- methods: z19.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
657
+ exposeHeaders: z20.string().array().optional(),
658
+ credentials: z20.boolean().default(false),
659
+ headers: z20.string().array().default(["*"]),
660
+ origins: z20.string().array().default(["*"]),
661
+ methods: z20.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
639
662
  }).optional().describe("Specify the cors headers."),
640
- basicAuth: z19.object({
641
- username: z19.string().describe("Basic auth username."),
642
- password: z19.string().describe("Basic auth password.")
643
- }).optional().describe("Enable basic authentication for the site."),
663
+ passwordAuth: z20.object({
664
+ password: z20.string().describe("Password.")
665
+ }).optional().describe("Enable password authentication for the router."),
666
+ basicAuth: z20.object({
667
+ username: z20.string().describe("Basic auth username."),
668
+ password: z20.string().describe("Basic auth password.")
669
+ }).optional().describe("Enable basic authentication for the router."),
644
670
  // security: z
645
671
  // .object({
646
672
  // contentSecurityPolicy: z.object({
@@ -686,10 +712,10 @@ var RouterDefaultSchema = z19.record(
686
712
  // })
687
713
  // .optional()
688
714
  // .describe('Specify the security policy.'),
689
- cache: z19.object({
690
- cookies: z19.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
691
- headers: z19.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
692
- queries: z19.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
715
+ cache: z20.object({
716
+ cookies: z20.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
717
+ headers: z20.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
718
+ queries: z20.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
693
719
  }).optional().describe(
694
720
  "Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
695
721
  )
@@ -704,9 +730,9 @@ var TimeoutSchema2 = DurationSchema.refine(durationMin(seconds3(10)), "Minimum t
704
730
  "The timeouts of all inner RPC functions will be capped at 80% of this timeout."
705
731
  ].join(" ")
706
732
  );
707
- var RpcDefaultSchema = z20.record(
733
+ var RpcDefaultSchema = z21.record(
708
734
  ResourceIdSchema,
709
- z20.object({
735
+ z21.object({
710
736
  // domain: ResourceIdSchema.describe('The domain id to link your RPC API with.').optional(),
711
737
  // subDomain: z.string().optional(),
712
738
  //
@@ -717,18 +743,18 @@ var RpcDefaultSchema = z20.record(
717
743
  timeout: TimeoutSchema2.default("1 minutes")
718
744
  })
719
745
  ).describe(`Define the global RPC API's.`).optional();
720
- var RpcSchema = z20.record(
746
+ var RpcSchema = z21.record(
721
747
  ResourceIdSchema,
722
- z20.record(
723
- z20.string(),
724
- z20.union([
748
+ z21.record(
749
+ z21.string(),
750
+ z21.union([
725
751
  FunctionSchema.transform((f) => ({
726
752
  function: f,
727
753
  lock: false
728
754
  })),
729
- z20.object({
755
+ z21.object({
730
756
  function: FunctionSchema.describe("The RPC function to execute."),
731
- lock: z20.boolean().describe(
757
+ lock: z21.boolean().describe(
732
758
  [
733
759
  "Specify if the function should be locked on the `lockKey` returned from the auth function.",
734
760
  "An example would be returning the user ID as `lockKey`."
@@ -742,8 +768,8 @@ var RpcSchema = z20.record(
742
768
  // src/feature/instance/schema.ts
743
769
  import { days as days4, toDays as toDays2 } from "@awsless/duration";
744
770
  import { toMebibytes } from "@awsless/size";
745
- import { z as z21 } from "zod";
746
- var CpuSchema = z21.union([z21.literal(0.25), z21.literal(0.5), z21.literal(1), z21.literal(2), z21.literal(4), z21.literal(8), z21.literal(16)]).transform((v) => `${v} vCPU`).describe(
771
+ import { z as z22 } from "zod";
772
+ var CpuSchema = z22.union([z22.literal(0.25), z22.literal(0.5), z22.literal(1), z22.literal(2), z22.literal(4), z22.literal(8), z22.literal(16)]).transform((v) => `${v} vCPU`).describe(
747
773
  "The number of virtual CPU units (vCPU) used by the instance. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
748
774
  );
749
775
  var validMemorySize = [
@@ -783,10 +809,10 @@ var MemorySizeSchema2 = SizeSchema.refine(
783
809
  (s) => validMemorySize.includes(toMebibytes(s)),
784
810
  `Invalid memory size. Allowed sizes: ${validMemorySize.join(", ")} MiB`
785
811
  ).describe("The amount of memory (in MiB) used by the instance. Valid memory values depend on the CPU configuration.");
786
- var HealthCheckSchema = z21.object({
787
- path: z21.string().describe("The path that the container runs to determine if it is healthy."),
812
+ var HealthCheckSchema = z22.object({
813
+ path: z22.string().describe("The path that the container runs to determine if it is healthy."),
788
814
  interval: DurationSchema.describe("The time period in seconds between each health check execution."),
789
- retries: z21.number().int().min(1).max(10).describe(
815
+ retries: z22.number().int().min(1).max(10).describe(
790
816
  "The number of times to retry a failed health check before the container is considered unhealthy."
791
817
  ),
792
818
  startPeriod: DurationSchema.describe(
@@ -796,22 +822,22 @@ var HealthCheckSchema = z21.object({
796
822
  "The time period in seconds to wait for a health check to succeed before it is considered a failure."
797
823
  )
798
824
  }).describe("The health check command and associated configuration parameters for the container.");
799
- var EnvironmentSchema2 = z21.record(z21.string(), z21.string()).optional().describe("Environment variable key-value pairs.");
800
- var ArchitectureSchema3 = z21.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
801
- var ActionSchema2 = z21.string();
802
- var ActionsSchema2 = z21.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
803
- var ArnSchema2 = z21.string().startsWith("arn:");
804
- var WildcardSchema2 = z21.literal("*");
805
- var ResourceSchema2 = z21.union([ArnSchema2, WildcardSchema2]);
806
- var ResourcesSchema2 = z21.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
807
- var PermissionSchema2 = z21.object({
808
- effect: z21.enum(["allow", "deny"]).default("allow"),
825
+ var EnvironmentSchema2 = z22.record(z22.string(), z22.string()).optional().describe("Environment variable key-value pairs.");
826
+ var ArchitectureSchema3 = z22.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
827
+ var ActionSchema2 = z22.string();
828
+ var ActionsSchema2 = z22.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
829
+ var ArnSchema2 = z22.string().startsWith("arn:");
830
+ var WildcardSchema2 = z22.literal("*");
831
+ var ResourceSchema2 = z22.union([ArnSchema2, WildcardSchema2]);
832
+ var ResourcesSchema2 = z22.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
833
+ var PermissionSchema2 = z22.object({
834
+ effect: z22.enum(["allow", "deny"]).default("allow"),
809
835
  actions: ActionsSchema2,
810
836
  resources: ResourcesSchema2
811
837
  });
812
- var PermissionsSchema2 = z21.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
813
- var DescriptionSchema2 = z21.string().describe("A description of the instance.");
814
- var ImageSchema = z21.string().optional().describe("The URL of the container image to use.");
838
+ var PermissionsSchema2 = z22.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
839
+ var DescriptionSchema2 = z22.string().describe("A description of the instance.");
840
+ var ImageSchema = z22.string().optional().describe("The URL of the container image to use.");
815
841
  var validLogRetentionDays2 = [
816
842
  ...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
817
843
  ...[180, 365, 400, 545, 731, 1096, 1827, 2192],
@@ -826,23 +852,23 @@ var LogRetentionSchema2 = DurationSchema.refine(
826
852
  },
827
853
  `Invalid log retention. Valid days are: ${validLogRetentionDays2.map((days5) => `${days5}`).join(", ")}`
828
854
  ).describe("The log retention duration.");
829
- var LogSchema2 = z21.union([
830
- z21.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
855
+ var LogSchema2 = z22.union([
856
+ z22.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
831
857
  LogRetentionSchema2.transform((retention) => ({ retention })),
832
- z21.object({
858
+ z22.object({
833
859
  retention: LogRetentionSchema2.optional()
834
860
  })
835
861
  ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
836
- var FileCodeSchema2 = z21.object({
862
+ var FileCodeSchema2 = z22.object({
837
863
  file: LocalFileSchema.describe("The file path of the instance code.")
838
864
  });
839
- var CodeSchema2 = z21.union([
865
+ var CodeSchema2 = z22.union([
840
866
  LocalFileSchema.transform((file) => ({
841
867
  file
842
868
  })).pipe(FileCodeSchema2),
843
869
  FileCodeSchema2
844
870
  ]).describe("Specify the code of your instance.");
845
- var ISchema = z21.object({
871
+ var ISchema = z22.object({
846
872
  code: CodeSchema2,
847
873
  description: DescriptionSchema2.optional(),
848
874
  image: ImageSchema.optional(),
@@ -855,14 +881,14 @@ var ISchema = z21.object({
855
881
  healthCheck: HealthCheckSchema.optional()
856
882
  // restartPolicy: RestartPolicySchema.optional(),
857
883
  });
858
- var InstanceSchema = z21.union([
884
+ var InstanceSchema = z22.union([
859
885
  LocalFileSchema.transform((code) => ({
860
886
  code
861
887
  })).pipe(ISchema),
862
888
  ISchema
863
889
  ]);
864
- var InstancesSchema = z21.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
865
- var InstanceDefaultSchema = z21.object({
890
+ var InstancesSchema = z22.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
891
+ var InstanceDefaultSchema = z22.object({
866
892
  image: ImageSchema.optional(),
867
893
  cpu: CpuSchema.default(0.25),
868
894
  memorySize: MemorySizeSchema2.default("512 MB"),
@@ -878,15 +904,34 @@ var InstanceDefaultSchema = z21.object({
878
904
 
879
905
  // src/feature/topic/schema.ts
880
906
  import { kebabCase as kebabCase3 } from "change-case";
881
- import { z as z22 } from "zod";
882
- var TopicNameSchema = z22.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
883
- var TopicsDefaultSchema = z22.array(TopicNameSchema).refine((topics) => {
907
+ import { z as z24 } from "zod";
908
+
909
+ // src/feature/task/schema.ts
910
+ import { z as z23 } from "zod";
911
+ var RetryAttemptsSchema3 = z23.number().int().min(0).max(2).describe(
912
+ "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
913
+ );
914
+ var TaskSchema = z23.union([
915
+ FunctionSchema.transform((consumer) => ({
916
+ consumer,
917
+ retryAttempts: 2
918
+ })),
919
+ z23.object({
920
+ consumer: FunctionSchema,
921
+ retryAttempts: RetryAttemptsSchema3.default(2)
922
+ })
923
+ ]);
924
+ var TasksSchema = z23.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
925
+
926
+ // src/feature/topic/schema.ts
927
+ var TopicNameSchema = z24.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
928
+ var TopicsDefaultSchema = z24.array(TopicNameSchema).refine((topics) => {
884
929
  return topics.length === new Set(topics).size;
885
930
  }, "Must be a list of unique topic names").optional().describe("Define the event topics for your app.");
886
- var SubscribersSchema = z22.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
931
+ var SubscribersSchema = z24.record(TopicNameSchema, TaskSchema).optional().describe("Define the event topics to subscribe too in your stack.");
887
932
 
888
933
  // src/config/schema/region.ts
889
- import { z as z23 } from "zod";
934
+ import { z as z25 } from "zod";
890
935
  var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
891
936
  var AF = ["af-south-1"];
892
937
  var AP = [
@@ -915,16 +960,16 @@ var EU = [
915
960
  var ME = ["me-south-1", "me-central-1"];
916
961
  var SA = ["sa-east-1"];
917
962
  var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
918
- var RegionSchema = z23.enum(regions);
963
+ var RegionSchema = z25.enum(regions);
919
964
 
920
965
  // src/config/app.ts
921
- var AppSchema = z24.object({
922
- $schema: z24.string().optional(),
966
+ var AppSchema = z26.object({
967
+ $schema: z26.string().optional(),
923
968
  name: ResourceIdSchema.describe("App name."),
924
969
  region: RegionSchema.describe("The AWS region to deploy to."),
925
- profile: z24.string().describe("The AWS profile to deploy to."),
926
- protect: z24.boolean().default(false).describe("Protect your app & stacks from being deleted."),
927
- removal: z24.enum(["remove", "retain"]).default("remove").describe(
970
+ profile: z26.string().describe("The AWS profile to deploy to."),
971
+ protect: z26.boolean().default(false).describe("Protect your app & stacks from being deleted."),
972
+ removal: z26.enum(["remove", "retain"]).default("remove").describe(
928
973
  [
929
974
  "Configure how your resources are handled when they have to be removed.",
930
975
  "",
@@ -938,7 +983,7 @@ var AppSchema = z24.object({
938
983
  // .default('prod')
939
984
  // .describe('The deployment stage.'),
940
985
  // onFailure: OnFailureSchema,
941
- defaults: z24.object({
986
+ defaults: z26.object({
942
987
  onFailure: OnFailureDefaultSchema,
943
988
  onLog: OnLogDefaultSchema,
944
989
  auth: AuthDefaultSchema,
@@ -1215,11 +1260,11 @@ var createStagePatchJsonSchema = (baseSchema, title) => {
1215
1260
  };
1216
1261
 
1217
1262
  // src/config/stack.ts
1218
- import { z as z40 } from "zod";
1263
+ import { z as z41 } from "zod";
1219
1264
 
1220
1265
  // src/feature/cache/schema.ts
1221
1266
  import { gibibytes as gibibytes2 } from "@awsless/size";
1222
- import { z as z25 } from "zod";
1267
+ import { z as z27 } from "zod";
1223
1268
  var StorageSchema = SizeSchema.refine(sizeMin(gibibytes2(1)), "Minimum storage size is 1 GB").refine(
1224
1269
  sizeMax(gibibytes2(5e3)),
1225
1270
  "Maximum storage size is 5000 GB"
@@ -1230,31 +1275,31 @@ var MinimumStorageSchema = StorageSchema.describe(
1230
1275
  var MaximumStorageSchema = StorageSchema.describe(
1231
1276
  "The upper limit for data storage the cache is set to use. You can specify a size value from 1 GB to 5000 GB."
1232
1277
  );
1233
- var EcpuSchema = z25.number().int().min(1e3).max(15e6);
1278
+ var EcpuSchema = z27.number().int().min(1e3).max(15e6);
1234
1279
  var MinimumEcpuSchema = EcpuSchema.describe(
1235
1280
  "The minimum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
1236
1281
  );
1237
1282
  var MaximumEcpuSchema = EcpuSchema.describe(
1238
1283
  "The maximum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
1239
1284
  );
1240
- var CachesSchema = z25.record(
1285
+ var CachesSchema = z27.record(
1241
1286
  ResourceIdSchema,
1242
- z25.object({
1287
+ z27.object({
1243
1288
  minStorage: MinimumStorageSchema.optional(),
1244
1289
  maxStorage: MaximumStorageSchema.optional(),
1245
1290
  minECPU: MinimumEcpuSchema.optional(),
1246
1291
  maxECPU: MaximumEcpuSchema.optional(),
1247
- snapshotRetentionLimit: z25.number().int().positive().default(1)
1292
+ snapshotRetentionLimit: z27.number().int().positive().default(1)
1248
1293
  })
1249
1294
  ).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
1250
1295
 
1251
1296
  // src/feature/command/schema.ts
1252
- import { z as z26 } from "zod";
1253
- var CommandSchema = z26.union([
1254
- z26.object({
1297
+ import { z as z28 } from "zod";
1298
+ var CommandSchema = z28.union([
1299
+ z28.object({
1255
1300
  file: LocalFileSchema,
1256
- handler: z26.string().default("default").describe("The name of the handler that needs to run"),
1257
- description: z26.string().optional().describe("A description of the command")
1301
+ handler: z28.string().default("default").describe("The name of the handler that needs to run"),
1302
+ description: z28.string().optional().describe("A description of the command")
1258
1303
  // options: z.record(ResourceIdSchema, OptionSchema).optional(),
1259
1304
  // arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
1260
1305
  }),
@@ -1264,22 +1309,22 @@ var CommandSchema = z26.union([
1264
1309
  description: void 0
1265
1310
  }))
1266
1311
  ]);
1267
- var CommandsSchema = z26.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
1312
+ var CommandsSchema = z28.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
1268
1313
 
1269
1314
  // src/feature/config/schema.ts
1270
- import { z as z27 } from "zod";
1271
- var ConfigNameSchema = z27.string().regex(/[a-z0-9\-]/g, "Invalid config name");
1272
- var ConfigsSchema = z27.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
1315
+ import { z as z29 } from "zod";
1316
+ var ConfigNameSchema = z29.string().regex(/[a-z0-9\-]/g, "Invalid config name");
1317
+ var ConfigsSchema = z29.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
1273
1318
 
1274
1319
  // src/feature/cron/schema/index.ts
1275
- import { z as z29 } from "zod";
1320
+ import { z as z31 } from "zod";
1276
1321
 
1277
1322
  // src/feature/cron/schema/schedule.ts
1278
- import { z as z28 } from "zod";
1323
+ import { z as z30 } from "zod";
1279
1324
  import { awsCronExpressionValidator } from "aws-cron-expression-validator";
1280
- var RateExpressionSchema = z28.custom(
1325
+ var RateExpressionSchema = z30.custom(
1281
1326
  (value) => {
1282
- return z28.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
1327
+ return z30.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
1283
1328
  const [str] = rate.split(" ");
1284
1329
  const number = parseInt(str);
1285
1330
  return number > 0;
@@ -1295,9 +1340,9 @@ var RateExpressionSchema = z28.custom(
1295
1340
  }
1296
1341
  return `rate(${rate})`;
1297
1342
  });
1298
- var CronExpressionSchema = z28.custom(
1343
+ var CronExpressionSchema = z30.custom(
1299
1344
  (value) => {
1300
- return z28.string().safeParse(value).success;
1345
+ return z30.string().safeParse(value).success;
1301
1346
  },
1302
1347
  { message: "Invalid cron expression" }
1303
1348
  ).superRefine((value, ctx) => {
@@ -1306,12 +1351,12 @@ var CronExpressionSchema = z28.custom(
1306
1351
  } catch (error) {
1307
1352
  if (error instanceof Error) {
1308
1353
  ctx.addIssue({
1309
- code: z28.ZodIssueCode.custom,
1354
+ code: z30.ZodIssueCode.custom,
1310
1355
  message: `Invalid cron expression: ${error.message}`
1311
1356
  });
1312
1357
  } else {
1313
1358
  ctx.addIssue({
1314
- code: z28.ZodIssueCode.custom,
1359
+ code: z30.ZodIssueCode.custom,
1315
1360
  message: "Invalid cron expression"
1316
1361
  });
1317
1362
  }
@@ -1322,28 +1367,32 @@ var CronExpressionSchema = z28.custom(
1322
1367
  var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
1323
1368
 
1324
1369
  // src/feature/cron/schema/index.ts
1325
- var CronsSchema = z29.record(
1370
+ var RetryAttemptsSchema4 = z31.number().int().min(0).max(2).describe(
1371
+ "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
1372
+ );
1373
+ var CronsSchema = z31.record(
1326
1374
  ResourceIdSchema,
1327
- z29.object({
1328
- enabled: z29.boolean().default(true).describe("If the cron is enabled."),
1375
+ z31.object({
1376
+ enabled: z31.boolean().default(true).describe("If the cron is enabled."),
1329
1377
  consumer: FunctionSchema.describe("The consuming lambda function properties."),
1330
1378
  schedule: ScheduleExpressionSchema.describe(
1331
1379
  'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
1332
1380
  ),
1333
- payload: z29.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
1381
+ payload: z31.unknown().optional().describe("The JSON payload that will be passed to the consumer."),
1382
+ retryAttempts: RetryAttemptsSchema4.default(2)
1334
1383
  })
1335
1384
  ).optional().describe(`Define the cron jobs in your stack.`);
1336
1385
 
1337
1386
  // src/feature/search/schema.ts
1338
1387
  import { gibibytes as gibibytes3 } from "@awsless/size";
1339
- import { z as z30 } from "zod";
1340
- var VersionSchema = z30.union([
1388
+ import { z as z32 } from "zod";
1389
+ var VersionSchema = z32.union([
1341
1390
  //
1342
- z30.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
1343
- z30.string()
1391
+ z32.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
1392
+ z32.string()
1344
1393
  ]).describe("Specify the OpenSearch engine version.");
1345
- var TypeSchema = z30.union([
1346
- z30.enum([
1394
+ var TypeSchema = z32.union([
1395
+ z32.enum([
1347
1396
  "t3.small",
1348
1397
  "t3.medium",
1349
1398
  "m3.medium",
@@ -1417,13 +1466,13 @@ var TypeSchema = z30.union([
1417
1466
  "r6gd.12xlarge",
1418
1467
  "r6gd.16xlarge"
1419
1468
  ]),
1420
- z30.string()
1469
+ z32.string()
1421
1470
  ]).describe("Instance type of data nodes in the cluster.");
1422
- var CountSchema = z30.number().int().min(1).describe("Number of instances in the cluster.");
1471
+ var CountSchema = z32.number().int().min(1).describe("Number of instances in the cluster.");
1423
1472
  var StorageSizeSchema = SizeSchema.refine(sizeMin(gibibytes3(10)), "Minimum storage size is 10 GB").refine(sizeMax(gibibytes3(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.");
1424
- var SearchsSchema = z30.record(
1473
+ var SearchsSchema = z32.record(
1425
1474
  ResourceIdSchema,
1426
- z30.object({
1475
+ z32.object({
1427
1476
  type: TypeSchema.default("t3.small"),
1428
1477
  count: CountSchema.default(1),
1429
1478
  version: VersionSchema.default("2.13"),
@@ -1434,12 +1483,12 @@ var SearchsSchema = z30.record(
1434
1483
  ).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
1435
1484
 
1436
1485
  // src/feature/site/schema.ts
1437
- import { z as z32 } from "zod";
1486
+ import { z as z34 } from "zod";
1438
1487
 
1439
1488
  // src/config/schema/local-entry.ts
1440
1489
  import { stat as stat3 } from "fs/promises";
1441
- import { z as z31 } from "zod";
1442
- var LocalEntrySchema = z31.union([
1490
+ import { z as z33 } from "zod";
1491
+ var LocalEntrySchema = z33.union([
1443
1492
  RelativePathSchema.refine(async (path) => {
1444
1493
  try {
1445
1494
  const s = await stat3(path);
@@ -1448,7 +1497,7 @@ var LocalEntrySchema = z31.union([
1448
1497
  return false;
1449
1498
  }
1450
1499
  }, `File or directory doesn't exist`),
1451
- z31.object({
1500
+ z33.object({
1452
1501
  nocheck: RelativePathSchema.describe(
1453
1502
  "Specifies a local file or directory without checking if the file or directory exists."
1454
1503
  )
@@ -1456,21 +1505,21 @@ var LocalEntrySchema = z31.union([
1456
1505
  ]);
1457
1506
 
1458
1507
  // src/feature/site/schema.ts
1459
- var SitesSchema = z32.record(
1508
+ var SitesSchema = z34.record(
1460
1509
  ResourceIdSchema,
1461
- z32.object({
1510
+ z34.object({
1462
1511
  router: ResourceIdSchema.describe("The router id to link your site with."),
1463
1512
  path: RouteSchema2.describe("The path inside the router to link your site to."),
1464
- build: z32.object({
1465
- command: z32.string().describe(
1513
+ build: z34.object({
1514
+ command: z34.string().describe(
1466
1515
  `Specifies the files and directories to generate the cache key for your custom build command.`
1467
1516
  ),
1468
- cacheKey: z32.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
1517
+ cacheKey: z34.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
1469
1518
  `Specifies the files and directories to generate the cache key for your custom build command.`
1470
1519
  ),
1471
- configs: z32.string().array().optional().describe("Define the config values for your build command.")
1520
+ configs: z34.string().array().optional().describe("Define the config values for your build command.")
1472
1521
  }).optional().describe(`Specifies the build process for sites that need a build step.`),
1473
- static: z32.union([LocalDirectorySchema, z32.boolean()]).optional().describe(
1522
+ static: z34.union([LocalDirectorySchema, z34.boolean()]).optional().describe(
1474
1523
  "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."
1475
1524
  ),
1476
1525
  ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server.")
@@ -1478,45 +1527,45 @@ var SitesSchema = z32.record(
1478
1527
  ).optional().describe("Define the sites in your stack.");
1479
1528
 
1480
1529
  // src/feature/store/schema.ts
1481
- import { z as z33 } from "zod";
1482
- var StoresSchema = z33.union([
1483
- z33.array(ResourceIdSchema).transform((list) => {
1530
+ import { z as z35 } from "zod";
1531
+ var StoresSchema = z35.union([
1532
+ z35.array(ResourceIdSchema).transform((list) => {
1484
1533
  const stores = {};
1485
1534
  for (const key of list) {
1486
1535
  stores[key] = {};
1487
1536
  }
1488
1537
  return stores;
1489
1538
  }),
1490
- z33.record(
1539
+ z35.record(
1491
1540
  ResourceIdSchema,
1492
- z33.object({
1541
+ z35.object({
1493
1542
  static: LocalDirectorySchema.optional().describe("Specifies the path to the static files directory."),
1494
- versioning: z33.boolean().default(false).describe("Enable versioning of your store."),
1495
- events: z33.object({
1543
+ versioning: z35.boolean().default(false).describe("Enable versioning of your store."),
1544
+ events: z35.object({
1496
1545
  // create
1497
- "created:*": FunctionSchema.optional().describe(
1546
+ "created:*": TaskSchema.optional().describe(
1498
1547
  "Subscribe to notifications regardless of the API that was used to create an object."
1499
1548
  ),
1500
- "created:put": FunctionSchema.optional().describe(
1549
+ "created:put": TaskSchema.optional().describe(
1501
1550
  "Subscribe to notifications when an object is created using the PUT API operation."
1502
1551
  ),
1503
- "created:post": FunctionSchema.optional().describe(
1552
+ "created:post": TaskSchema.optional().describe(
1504
1553
  "Subscribe to notifications when an object is created using the POST API operation."
1505
1554
  ),
1506
- "created:copy": FunctionSchema.optional().describe(
1555
+ "created:copy": TaskSchema.optional().describe(
1507
1556
  "Subscribe to notifications when an object is created using the COPY API operation."
1508
1557
  ),
1509
- "created:upload": FunctionSchema.optional().describe(
1558
+ "created:upload": TaskSchema.optional().describe(
1510
1559
  "Subscribe to notifications when an object multipart upload has been completed."
1511
1560
  ),
1512
1561
  // remove
1513
- "removed:*": FunctionSchema.optional().describe(
1562
+ "removed:*": TaskSchema.optional().describe(
1514
1563
  "Subscribe to notifications when an object is deleted or a delete marker for a versioned object is created."
1515
1564
  ),
1516
- "removed:delete": FunctionSchema.optional().describe(
1565
+ "removed:delete": TaskSchema.optional().describe(
1517
1566
  "Subscribe to notifications when an object is deleted"
1518
1567
  ),
1519
- "removed:marker": FunctionSchema.optional().describe(
1568
+ "removed:marker": TaskSchema.optional().describe(
1520
1569
  "Subscribe to notifications when a delete marker for a versioned object is created."
1521
1570
  )
1522
1571
  }).optional().describe("Describes the store events you want to subscribe too.")
@@ -1525,30 +1574,30 @@ var StoresSchema = z33.union([
1525
1574
  ]).optional().describe("Define the stores in your stack.");
1526
1575
 
1527
1576
  // src/feature/icon/schema.ts
1528
- import { z as z34 } from "zod";
1577
+ import { z as z36 } from "zod";
1529
1578
  var staticOriginSchema = LocalDirectorySchema.describe(
1530
1579
  "Specifies the path to a local image directory that will be uploaded in S3."
1531
1580
  );
1532
1581
  var functionOriginSchema = FunctionSchema.describe(
1533
1582
  "Specifies the file that will be called when an image isn't found in the (cache) bucket."
1534
1583
  );
1535
- var IconsSchema = z34.record(
1584
+ var IconsSchema = z36.record(
1536
1585
  ResourceIdSchema,
1537
- z34.object({
1586
+ z36.object({
1538
1587
  // domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
1539
1588
  // subDomain: z.string().optional(),
1540
1589
  router: ResourceIdSchema.describe("The router id to link your icon proxy."),
1541
1590
  path: RouteSchema2.describe("The path inside the router to link your icon proxy to."),
1542
1591
  log: LogSchema.optional(),
1543
1592
  cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
1544
- preserveIds: z34.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1545
- symbols: z34.boolean().optional().default(false).describe(`Convert the SVG's to SVG symbols.`),
1546
- origin: z34.union([
1547
- z34.object({
1593
+ preserveIds: z36.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1594
+ symbols: z36.boolean().optional().default(false).describe(`Convert the SVG's to SVG symbols.`),
1595
+ origin: z36.union([
1596
+ z36.object({
1548
1597
  static: staticOriginSchema,
1549
1598
  function: functionOriginSchema.optional()
1550
1599
  }),
1551
- z34.object({
1600
+ z36.object({
1552
1601
  static: staticOriginSchema.optional(),
1553
1602
  function: functionOriginSchema
1554
1603
  })
@@ -1575,13 +1624,13 @@ var IconsSchema = z34.record(
1575
1624
  ).optional().describe("Define an svg icon proxy in your stack. Store, optimize, and deliver svg icons at scale.");
1576
1625
 
1577
1626
  // src/feature/image/schema.ts
1578
- import { z as z35 } from "zod";
1579
- var transformationOptionsSchema = z35.object({
1580
- width: z35.number().int().positive().optional(),
1581
- height: z35.number().int().positive().optional(),
1582
- fit: z35.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
1583
- position: z35.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
1584
- quality: z35.number().int().min(1).max(100).optional()
1627
+ import { z as z37 } from "zod";
1628
+ var transformationOptionsSchema = z37.object({
1629
+ width: z37.number().int().positive().optional(),
1630
+ height: z37.number().int().positive().optional(),
1631
+ fit: z37.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
1632
+ position: z37.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
1633
+ quality: z37.number().int().min(1).max(100).optional()
1585
1634
  });
1586
1635
  var staticOriginSchema2 = LocalDirectorySchema.describe(
1587
1636
  "Specifies the path to a local image directory that will be uploaded in S3."
@@ -1589,38 +1638,38 @@ var staticOriginSchema2 = LocalDirectorySchema.describe(
1589
1638
  var functionOriginSchema2 = FunctionSchema.describe(
1590
1639
  "Specifies the file that will be called when an image isn't found in the (cache) bucket."
1591
1640
  );
1592
- var ImagesSchema = z35.record(
1641
+ var ImagesSchema = z37.record(
1593
1642
  ResourceIdSchema,
1594
- z35.object({
1643
+ z37.object({
1595
1644
  // domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
1596
1645
  // subDomain: z.string().optional(),
1597
1646
  router: ResourceIdSchema.describe("The router id to link your image proxy."),
1598
1647
  path: RouteSchema2.describe("The path inside the router to link your image proxy to."),
1599
1648
  log: LogSchema.optional(),
1600
1649
  cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
1601
- presets: z35.record(z35.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1602
- extensions: z35.object({
1603
- jpg: z35.object({
1604
- mozjpeg: z35.boolean().optional(),
1605
- progressive: z35.boolean().optional()
1650
+ presets: z37.record(z37.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1651
+ extensions: z37.object({
1652
+ jpg: z37.object({
1653
+ mozjpeg: z37.boolean().optional(),
1654
+ progressive: z37.boolean().optional()
1606
1655
  }).optional(),
1607
- webp: z35.object({
1608
- effort: z35.number().int().min(1).max(10).default(7).optional(),
1609
- lossless: z35.boolean().optional(),
1610
- nearLossless: z35.boolean().optional()
1656
+ webp: z37.object({
1657
+ effort: z37.number().int().min(1).max(10).default(7).optional(),
1658
+ lossless: z37.boolean().optional(),
1659
+ nearLossless: z37.boolean().optional()
1611
1660
  }).optional(),
1612
- png: z35.object({
1613
- compressionLevel: z35.number().int().min(0).max(9).default(6).optional()
1661
+ png: z37.object({
1662
+ compressionLevel: z37.number().int().min(0).max(9).default(6).optional()
1614
1663
  }).optional()
1615
1664
  }).refine((data) => {
1616
1665
  return Object.keys(data).length > 0;
1617
1666
  }, "At least one extension must be defined.").describe("Specify the allowed extensions."),
1618
- origin: z35.union([
1619
- z35.object({
1667
+ origin: z37.union([
1668
+ z37.object({
1620
1669
  static: staticOriginSchema2,
1621
1670
  function: functionOriginSchema2.optional()
1622
1671
  }),
1623
- z35.object({
1672
+ z37.object({
1624
1673
  static: staticOriginSchema2.optional(),
1625
1674
  function: functionOriginSchema2
1626
1675
  })
@@ -1635,7 +1684,7 @@ var ImagesSchema = z35.record(
1635
1684
  ).optional().describe("Define an image proxy in your stack. Store, transform, optimize, and deliver images at scale.");
1636
1685
 
1637
1686
  // src/feature/metric/schema.ts
1638
- import { z as z36 } from "zod";
1687
+ import { z as z38 } from "zod";
1639
1688
  var ops = {
1640
1689
  ">": "GreaterThanThreshold",
1641
1690
  ">=": "GreaterThanOrEqualToThreshold",
@@ -1649,15 +1698,15 @@ var stats = {
1649
1698
  min: "Minimum",
1650
1699
  max: "Maximum"
1651
1700
  };
1652
- var WhereSchema = z36.union([
1653
- z36.string().regex(/(count|avg|sum|min|max) (>|>=|<|<=) (\d)/, "Invalid where query").transform((where) => {
1701
+ var WhereSchema = z38.union([
1702
+ z38.string().regex(/(count|avg|sum|min|max) (>|>=|<|<=) (\d)/, "Invalid where query").transform((where) => {
1654
1703
  const [stat4, op, value] = where.split(" ");
1655
1704
  return { stat: stat4, op, value: parseFloat(value) };
1656
1705
  }),
1657
- z36.object({
1658
- stat: z36.enum(["count", "avg", "sum", "min", "max"]),
1659
- op: z36.enum([">", ">=", "<", "<="]),
1660
- value: z36.number()
1706
+ z38.object({
1707
+ stat: z38.enum(["count", "avg", "sum", "min", "max"]),
1708
+ op: z38.enum([">", ">=", "<", "<="]),
1709
+ value: z38.number()
1661
1710
  })
1662
1711
  ]).transform((where) => {
1663
1712
  return {
@@ -1666,39 +1715,39 @@ var WhereSchema = z36.union([
1666
1715
  value: where.value
1667
1716
  };
1668
1717
  });
1669
- var AlarmSchema = z36.object({
1670
- description: z36.string().optional(),
1718
+ var AlarmSchema = z38.object({
1719
+ description: z38.string().optional(),
1671
1720
  where: WhereSchema,
1672
1721
  period: DurationSchema,
1673
- minDataPoints: z36.number().int().default(1),
1674
- trigger: z36.union([EmailSchema.transform((v) => [v]), EmailSchema.array(), FunctionSchema])
1722
+ minDataPoints: z38.number().int().default(1),
1723
+ trigger: z38.union([EmailSchema.transform((v) => [v]), EmailSchema.array(), FunctionSchema])
1675
1724
  });
1676
- var MetricsSchema = z36.record(
1725
+ var MetricsSchema = z38.record(
1677
1726
  ResourceIdSchema,
1678
- z36.object({
1679
- type: z36.enum(["number", "size", "duration"]),
1727
+ z38.object({
1728
+ type: z38.enum(["number", "size", "duration"]),
1680
1729
  alarms: AlarmSchema.array().optional()
1681
1730
  })
1682
1731
  ).optional().describe("Define the metrics in your stack.");
1683
1732
 
1684
1733
  // src/feature/table/schema.ts
1685
1734
  import { minutes as minutes5, seconds as seconds4 } from "@awsless/duration";
1686
- import { z as z37 } from "zod";
1687
- var KeySchema = z37.string().min(1).max(255);
1688
- var TablesSchema = z37.record(
1735
+ import { z as z39 } from "zod";
1736
+ var KeySchema = z39.string().min(1).max(255);
1737
+ var TablesSchema = z39.record(
1689
1738
  ResourceIdSchema,
1690
- z37.object({
1739
+ z39.object({
1691
1740
  hash: KeySchema.describe(
1692
1741
  "Specifies the name of the partition / hash key that makes up the primary key for the table."
1693
1742
  ),
1694
1743
  sort: KeySchema.optional().describe(
1695
1744
  "Specifies the name of the range / sort key that makes up the primary key for the table."
1696
1745
  ),
1697
- fields: z37.record(z37.string(), z37.enum(["string", "number", "binary"])).optional().describe(
1746
+ fields: z39.record(z39.string(), z39.enum(["string", "number", "binary"])).optional().describe(
1698
1747
  'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
1699
1748
  ),
1700
- class: z37.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
1701
- pointInTimeRecovery: z37.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
1749
+ class: z39.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
1750
+ pointInTimeRecovery: z39.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
1702
1751
  ttl: KeySchema.optional().describe(
1703
1752
  [
1704
1753
  "The name of the TTL attribute used to store the expiration time for items in the table.",
@@ -1706,8 +1755,8 @@ var TablesSchema = z37.record(
1706
1755
  ].join("\n")
1707
1756
  ),
1708
1757
  // deletionProtection: DeletionProtectionSchema.optional(),
1709
- stream: z37.object({
1710
- type: z37.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
1758
+ stream: z39.object({
1759
+ type: z39.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
1711
1760
  [
1712
1761
  "When an item in the table is modified, you can determines what information is written to the stream for this table.",
1713
1762
  "Valid values are:",
@@ -1717,7 +1766,7 @@ var TablesSchema = z37.record(
1717
1766
  "- new-and-old-images - Both the new and the old item images of the item are written to the stream."
1718
1767
  ].join("\n")
1719
1768
  ),
1720
- batchSize: z37.number().min(1).max(1e4).default(1).describe(
1769
+ batchSize: z39.number().min(1).max(1e4).default(1).describe(
1721
1770
  [
1722
1771
  "The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
1723
1772
  "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).",
@@ -1733,29 +1782,26 @@ var TablesSchema = z37.record(
1733
1782
  "You can specify a duration from 1 seconds to 5 minutes."
1734
1783
  ].join("\n")
1735
1784
  ),
1736
- // maxRecordAge: DurationSchema.refine(
1737
- // durationMin(seconds(1)),
1738
- // 'Minimum record age duration is 1 second'
1739
- // )
1740
- // .refine(durationMax(minutes(5)), 'Maximum batch window duration is 5 minutes')
1741
- // .optional()
1742
- // .describe(
1743
- // [
1744
- // 'Discard records after the specified number of retries.',
1745
- // 'The default value is -1, which sets the maximum number of retries to infinite.',
1746
- // 'When maxRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.',
1747
- // 'You can specify a number from -1 to 10000.',
1748
- // ].join('\n')
1749
- // ),
1750
- retryAttempts: z37.number().min(-1).max(1e4).default(-1).describe(
1785
+ maxRecordAge: DurationSchema.refine(
1786
+ durationMin(seconds4(1)),
1787
+ "Minimum record age duration is 1 second"
1788
+ ).refine(durationMax(minutes5(1)), "Maximum record age duration is 1 minute").default("60 seconds").describe(
1789
+ [
1790
+ "Discard records older than the specified age.",
1791
+ "The maximum valid value for maximum record age is 60s.",
1792
+ "The default value is 60s"
1793
+ ].join("\n")
1794
+ ),
1795
+ retryAttempts: z39.number().min(-1).max(1e4).default(2).describe(
1751
1796
  [
1752
1797
  "Discard records after the specified number of retries.",
1753
- "The default value is -1, which sets the maximum number of retries to infinite.",
1798
+ "-1 will sets the maximum number of retries to infinite.",
1754
1799
  "When maxRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.",
1755
- "You can specify a number from -1 to 10000."
1800
+ "You can specify a number from -1 to 10000.",
1801
+ "The default value is 2"
1756
1802
  ].join("\n")
1757
1803
  ),
1758
- concurrencyPerShard: z37.number().min(1).max(10).default(1).describe(
1804
+ concurrencyPerShard: z39.number().min(1).max(10).default(1).describe(
1759
1805
  [
1760
1806
  "The number of batches to process concurrently from each shard.",
1761
1807
  "You can specify a number from 1 to 10."
@@ -1765,16 +1811,16 @@ var TablesSchema = z37.record(
1765
1811
  }).optional().describe(
1766
1812
  "The settings for the DynamoDB table stream, which capture changes to items stored in the table."
1767
1813
  ),
1768
- indexes: z37.record(
1769
- z37.string(),
1770
- z37.object({
1771
- hash: z37.union([KeySchema.transform((v) => [v]), KeySchema.array()]).describe(
1814
+ indexes: z39.record(
1815
+ z39.string(),
1816
+ z39.object({
1817
+ hash: z39.union([KeySchema.transform((v) => [v]), KeySchema.array()]).describe(
1772
1818
  "Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
1773
1819
  ),
1774
- sort: z37.union([KeySchema.transform((v) => [v]), KeySchema.array()]).optional().describe(
1820
+ sort: z39.union([KeySchema.transform((v) => [v]), KeySchema.array()]).optional().describe(
1775
1821
  "Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
1776
1822
  ),
1777
- projection: z37.enum(["all", "keys-only"]).default("all").describe(
1823
+ projection: z39.enum(["all", "keys-only"]).default("all").describe(
1778
1824
  [
1779
1825
  "The set of attributes that are projected into the index:",
1780
1826
  "- all - All of the table attributes are projected into the index.",
@@ -1787,36 +1833,13 @@ var TablesSchema = z37.record(
1787
1833
  })
1788
1834
  ).optional().describe("Define the tables in your stack.");
1789
1835
 
1790
- // src/feature/task/schema.ts
1791
- import { z as z38 } from "zod";
1792
- var RetryAttemptsSchema2 = z38.number().int().min(0).max(2).describe(
1793
- "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
1794
- );
1795
- var TaskSchema = z38.union([
1796
- LocalFileSchema.transform((file) => ({
1797
- consumer: {
1798
- code: {
1799
- file,
1800
- minify: true,
1801
- external: []
1802
- }
1803
- },
1804
- retryAttempts: void 0
1805
- })),
1806
- z38.object({
1807
- consumer: FunctionSchema,
1808
- retryAttempts: RetryAttemptsSchema2.optional()
1809
- })
1810
- ]);
1811
- var TasksSchema = z38.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
1812
-
1813
1836
  // src/feature/test/schema.ts
1814
- import { z as z39 } from "zod";
1815
- var TestsSchema = z39.union([
1837
+ import { z as z40 } from "zod";
1838
+ var TestsSchema = z40.union([
1816
1839
  //
1817
1840
  LocalDirectorySchema.transform((v) => [v]),
1818
1841
  LocalDirectorySchema.array(),
1819
- z39.literal(false)
1842
+ z40.literal(false)
1820
1843
  ]).describe("Define the location of your tests for your stack.").optional();
1821
1844
 
1822
1845
  // src/config/stack.ts
@@ -1824,8 +1847,8 @@ var DependsSchema = ResourceIdSchema.array().optional().describe("Define the sta
1824
1847
  var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
1825
1848
  message: `Stack name can't be a reserved name.`
1826
1849
  }).describe("Stack name.");
1827
- var StackSchema = z40.object({
1828
- $schema: z40.string().optional(),
1850
+ var StackSchema = z41.object({
1851
+ $schema: z41.string().optional(),
1829
1852
  name: NameSchema,
1830
1853
  depends: DependsSchema,
1831
1854
  commands: CommandsSchema,