@awsless/awsless 0.0.582 → 0.0.584

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 z23 } from "zod";
7
+ import { z as z24 } from "zod";
8
8
 
9
9
  // src/feature/alert/schema.ts
10
10
  import { kebabCase } from "change-case";
@@ -203,7 +203,7 @@ var ArchitectureSchema = z11.enum(["x86_64", "arm64"]).describe("The instruction
203
203
  var RetryAttemptsSchema = z11.number().int().min(0).max(2).describe(
204
204
  "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
205
205
  );
206
- var NodeRuntimeSchema = z11.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]);
206
+ var NodeRuntimeSchema = z11.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x", "nodejs24.x"]);
207
207
  var ContainerRuntimeSchema = z11.literal("container");
208
208
  var RuntimeSchema = NodeRuntimeSchema.or(ContainerRuntimeSchema).or(z11.string()).describe("The identifier of the function's runtime.");
209
209
  var ActionSchema = z11.string();
@@ -235,7 +235,7 @@ var LogRetentionSchema = DurationSchema.refine(
235
235
  (duration) => {
236
236
  return validLogRetentionDays.includes(toDays(duration));
237
237
  },
238
- `Invalid log retention. Valid days are: ${validLogRetentionDays.map((days4) => `${days4}`).join(", ")}`
238
+ `Invalid log retention. Valid days are: ${validLogRetentionDays.map((days5) => `${days5}`).join(", ")}`
239
239
  ).describe("The log retention duration.");
240
240
  var LogSchema = z11.union([
241
241
  z11.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
@@ -309,7 +309,7 @@ var FunctionSchema = z11.union([
309
309
  ]);
310
310
  var FunctionsSchema = z11.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
311
311
  var FunctionDefaultSchema = z11.object({
312
- runtime: RuntimeSchema.default("nodejs20.x"),
312
+ runtime: RuntimeSchema.default("nodejs24.x"),
313
313
  // node
314
314
  handler: HandlerSchema.default("index.default"),
315
315
  // build: BuildSchema.default({
@@ -530,33 +530,200 @@ var RestSchema = z18.record(
530
530
  ).optional().describe("Define routes in your stack for your global REST API.");
531
531
 
532
532
  // src/feature/rpc/schema.ts
533
+ import { minutes as minutes4, seconds as seconds3 } from "@awsless/duration";
534
+ import { z as z20 } from "zod";
535
+
536
+ // src/feature/router/schema.ts
537
+ import { days as days3, minutes as minutes3, parse as parse3 } from "@awsless/duration";
533
538
  import { z as z19 } from "zod";
534
- import { minutes as minutes3, seconds as seconds3 } from "@awsless/duration";
535
- var TimeoutSchema2 = DurationSchema.refine(durationMin(seconds3(10)), "Minimum timeout duration is 10 seconds").refine(durationMax(minutes3(5)), "Maximum timeout duration is 5 minutes").describe(
539
+ var ErrorResponsePathSchema = z19.string().describe(
540
+ [
541
+ "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
+ "- We recommend that you store custom error pages in an Amazon S3 bucket.",
543
+ "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
+ ].join("\n")
545
+ );
546
+ var StatusCodeSchema = z19.number().int().positive().optional().describe(
547
+ [
548
+ "The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.",
549
+ "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:",
550
+ "- 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.",
551
+ "If you substitute 200, the response typically won't be intercepted.",
552
+ `- 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.`,
553
+ `- You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down.`
554
+ ].join("\n")
555
+ );
556
+ var MinTTLSchema = DurationSchema.describe(
557
+ "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
+ );
559
+ var ErrorResponseSchema = z19.union([
560
+ ErrorResponsePathSchema,
561
+ z19.object({
562
+ path: ErrorResponsePathSchema,
563
+ statusCode: StatusCodeSchema.optional(),
564
+ minTTL: MinTTLSchema.optional()
565
+ })
566
+ ]).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(
572
+ "The limit on requests during the specified evaluation window for a single aggregation instance for the rate-based rule."
573
+ ),
574
+ window: z19.union([
575
+ z19.literal("1 minute"),
576
+ z19.literal("2 minutes"),
577
+ z19.literal("5 minutes"),
578
+ z19.literal("10 minutes")
579
+ ]).default("5 minutes").transform((v) => parse3(v)).describe(
580
+ "The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time."
581
+ ),
582
+ visibility: VisibilitySchema
583
+ }).optional().describe(
584
+ "A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate."
585
+ ),
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.")
590
+ }),
591
+ exemptUriRegex: z19.string().default("^$"),
592
+ visibility: VisibilitySchema
593
+ }).optional().describe(
594
+ "Provides protection against DDoS attacks targeting the application layer, also known as Layer 7 attacks. Uses 50 WCU."
595
+ ),
596
+ botProtection: z19.object({
597
+ inspectionLevel: z19.enum(["common", "targeted"]).default("common").transform((v) => v.toUpperCase()),
598
+ visibility: VisibilitySchema
599
+ }).optional().describe(
600
+ "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."
601
+ ),
602
+ captchaImmunityTime: DurationSchema.refine(durationMin(minutes3(1)), "Minimum timeout duration is 1 minute").refine(durationMax(days3(3)), "Maximum timeout duration is 3 days").default("5 minutes").describe(
603
+ "The amount of time that a CAPTCHA timestamp is considered valid by AWS WAF. The default setting is 5 minutes."
604
+ ),
605
+ challengeImmunityTime: DurationSchema.refine(durationMin(minutes3(1)), "Minimum timeout duration is 1 minute").refine(durationMax(days3(3)), "Maximum timeout duration is 3 days").default("5 minutes").describe(
606
+ "The amount of time that a challenge timestamp is considered valid by AWS WAF. The default setting is 5 minutes."
607
+ )
608
+ }).describe(
609
+ "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
+ );
611
+ var RouterDefaultSchema = z19.record(
612
+ ResourceIdSchema,
613
+ z19.object({
614
+ domain: ResourceIdSchema.describe("The domain id to link your Router.").optional(),
615
+ subDomain: z19.string().optional(),
616
+ 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({
619
+ 400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
620
+ 403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
621
+ 404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
622
+ 405: ErrorResponseSchema.describe("Customize a `405 Method Not Allowed` response."),
623
+ 414: ErrorResponseSchema.describe("Customize a `414 Request-URI` response."),
624
+ 416: ErrorResponseSchema.describe("Customize a `416 Range Not` response."),
625
+ 500: ErrorResponseSchema.describe("Customize a `500 Internal Server` response."),
626
+ 501: ErrorResponseSchema.describe("Customize a `501 Not Implemented` response."),
627
+ 502: ErrorResponseSchema.describe("Customize a `502 Bad Gateway` response."),
628
+ 503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
629
+ 504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
630
+ }).optional().describe("Customize the error responses for specific HTTP status codes."),
631
+ cors: z19.object({
632
+ override: z19.boolean().default(false),
633
+ 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"])
639
+ }).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."),
644
+ // security: z
645
+ // .object({
646
+ // contentSecurityPolicy: z.object({
647
+ // override: z.boolean().default(false),
648
+ // policy: z.string(),
649
+ // })
650
+ // contentSecurityPolicy?: {
651
+ // override?: boolean
652
+ // contentSecurityPolicy: string
653
+ // }
654
+ // contentTypeOptions?: {
655
+ // override?: boolean
656
+ // }
657
+ // frameOptions?: {
658
+ // override?: boolean
659
+ // frameOption?: 'deny' | 'same-origin'
660
+ // }
661
+ // referrerPolicy?: {
662
+ // override?: boolean
663
+ // referrerPolicy?: (
664
+ // 'no-referrer' |
665
+ // 'no-referrer-when-downgrade' |
666
+ // 'origin' |
667
+ // 'origin-when-cross-origin' |
668
+ // 'same-origin' |
669
+ // 'strict-origin' |
670
+ // 'strict-origin-when-cross-origin' |
671
+ // 'unsafe-url'
672
+ // )
673
+ // }
674
+ // strictTransportSecurity?: {
675
+ // maxAge?: Duration
676
+ // includeSubdomains?: boolean
677
+ // override?: boolean
678
+ // preload?: boolean
679
+ // }
680
+ // xssProtection?: {
681
+ // override?: boolean
682
+ // enable?: boolean
683
+ // modeBlock?: boolean
684
+ // reportUri?: string
685
+ // }
686
+ // })
687
+ // .optional()
688
+ // .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.")
693
+ }).optional().describe(
694
+ "Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
695
+ )
696
+ })
697
+ ).optional().describe(`Define the global Router. Backed by AWS CloudFront.`);
698
+
699
+ // src/feature/rpc/schema.ts
700
+ var TimeoutSchema2 = DurationSchema.refine(durationMin(seconds3(10)), "Minimum timeout duration is 10 seconds").refine(durationMax(minutes4(5)), "Maximum timeout duration is 5 minutes").describe(
536
701
  [
537
702
  "The amount of time that the RPC lambda is allowed run before stopping it.",
538
- "You can specify a size value from 1 second to 5 minutes.",
703
+ "You can specify a timeout from 10 second to 5 minutes.",
539
704
  "The timeouts of all inner RPC functions will be capped at 80% of this timeout."
540
705
  ].join(" ")
541
706
  );
542
- var RpcDefaultSchema = z19.record(
707
+ var RpcDefaultSchema = z20.record(
543
708
  ResourceIdSchema,
544
- z19.object({
545
- domain: ResourceIdSchema.describe("The domain id to link your RPC API with.").optional(),
546
- subDomain: z19.string().optional(),
547
- auth: FunctionSchema.optional(),
709
+ z20.object({
710
+ // domain: ResourceIdSchema.describe('The domain id to link your RPC API with.').optional(),
711
+ // subDomain: z.string().optional(),
712
+ //
713
+ router: ResourceIdSchema.describe("The router id to link your RPC API with."),
714
+ path: RouteSchema2.describe("The path inside the router to link your RPC API to."),
715
+ auth: FunctionSchema.optional().describe("The authentication handler for your RPC API."),
548
716
  log: LogSchema.optional(),
549
- timeout: TimeoutSchema2.default("1 minutes"),
550
- geoRestrictions: z19.array(z19.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked.")
717
+ timeout: TimeoutSchema2.default("1 minutes")
551
718
  })
552
719
  ).describe(`Define the global RPC API's.`).optional();
553
- var RpcSchema = z19.record(ResourceIdSchema, z19.record(z19.string(), FunctionSchema).describe("The queries for your global RPC API.")).describe("Define the schema in your stack for your global RPC API.").optional();
720
+ 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();
554
721
 
555
722
  // src/feature/instance/schema.ts
556
- import { days as days3, toDays as toDays2 } from "@awsless/duration";
723
+ import { days as days4, toDays as toDays2 } from "@awsless/duration";
557
724
  import { toMebibytes } from "@awsless/size";
558
- import { z as z20 } from "zod";
559
- var CpuSchema = z20.union([z20.literal(0.25), z20.literal(0.5), z20.literal(1), z20.literal(2), z20.literal(4), z20.literal(8), z20.literal(16)]).transform((v) => `${v} vCPU`).describe(
725
+ import { z as z21 } from "zod";
726
+ 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(
560
727
  "The number of virtual CPU units (vCPU) used by the instance. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
561
728
  );
562
729
  var validMemorySize = [
@@ -596,10 +763,10 @@ var MemorySizeSchema2 = SizeSchema.refine(
596
763
  (s) => validMemorySize.includes(toMebibytes(s)),
597
764
  `Invalid memory size. Allowed sizes: ${validMemorySize.join(", ")} MiB`
598
765
  ).describe("The amount of memory (in MiB) used by the instance. Valid memory values depend on the CPU configuration.");
599
- var HealthCheckSchema = z20.object({
600
- path: z20.string().describe("The path that the container runs to determine if it is healthy."),
766
+ var HealthCheckSchema = z21.object({
767
+ path: z21.string().describe("The path that the container runs to determine if it is healthy."),
601
768
  interval: DurationSchema.describe("The time period in seconds between each health check execution."),
602
- retries: z20.number().int().min(1).max(10).describe(
769
+ retries: z21.number().int().min(1).max(10).describe(
603
770
  "The number of times to retry a failed health check before the container is considered unhealthy."
604
771
  ),
605
772
  startPeriod: DurationSchema.describe(
@@ -609,53 +776,53 @@ var HealthCheckSchema = z20.object({
609
776
  "The time period in seconds to wait for a health check to succeed before it is considered a failure."
610
777
  )
611
778
  }).describe("The health check command and associated configuration parameters for the container.");
612
- var EnvironmentSchema2 = z20.record(z20.string(), z20.string()).optional().describe("Environment variable key-value pairs.");
613
- var ArchitectureSchema3 = z20.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
614
- var ActionSchema2 = z20.string();
615
- var ActionsSchema2 = z20.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
616
- var ArnSchema2 = z20.string().startsWith("arn:");
617
- var WildcardSchema2 = z20.literal("*");
618
- var ResourceSchema2 = z20.union([ArnSchema2, WildcardSchema2]);
619
- var ResourcesSchema2 = z20.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
620
- var PermissionSchema2 = z20.object({
621
- effect: z20.enum(["allow", "deny"]).default("allow"),
779
+ var EnvironmentSchema2 = z21.record(z21.string(), z21.string()).optional().describe("Environment variable key-value pairs.");
780
+ var ArchitectureSchema3 = z21.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
781
+ var ActionSchema2 = z21.string();
782
+ var ActionsSchema2 = z21.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
783
+ var ArnSchema2 = z21.string().startsWith("arn:");
784
+ var WildcardSchema2 = z21.literal("*");
785
+ var ResourceSchema2 = z21.union([ArnSchema2, WildcardSchema2]);
786
+ var ResourcesSchema2 = z21.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
787
+ var PermissionSchema2 = z21.object({
788
+ effect: z21.enum(["allow", "deny"]).default("allow"),
622
789
  actions: ActionsSchema2,
623
790
  resources: ResourcesSchema2
624
791
  });
625
- var PermissionsSchema2 = z20.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
626
- var DescriptionSchema2 = z20.string().describe("A description of the instance.");
627
- var ImageSchema = z20.string().optional().describe("The URL of the container image to use.");
792
+ var PermissionsSchema2 = z21.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
793
+ var DescriptionSchema2 = z21.string().describe("A description of the instance.");
794
+ var ImageSchema = z21.string().optional().describe("The URL of the container image to use.");
628
795
  var validLogRetentionDays2 = [
629
796
  ...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
630
797
  ...[180, 365, 400, 545, 731, 1096, 1827, 2192],
631
798
  ...[2557, 2922, 3288, 3653]
632
799
  ];
633
800
  var LogRetentionSchema2 = DurationSchema.refine(
634
- durationMin(days3(0)),
801
+ durationMin(days4(0)),
635
802
  "Minimum log retention is 0 day, which will disable logging."
636
803
  ).refine(
637
804
  (duration) => {
638
805
  return validLogRetentionDays2.includes(toDays2(duration));
639
806
  },
640
- `Invalid log retention. Valid days are: ${validLogRetentionDays2.map((days4) => `${days4}`).join(", ")}`
807
+ `Invalid log retention. Valid days are: ${validLogRetentionDays2.map((days5) => `${days5}`).join(", ")}`
641
808
  ).describe("The log retention duration.");
642
- var LogSchema2 = z20.union([
643
- z20.boolean().transform((enabled) => ({ retention: enabled ? days3(7) : days3(0) })),
809
+ var LogSchema2 = z21.union([
810
+ z21.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
644
811
  LogRetentionSchema2.transform((retention) => ({ retention })),
645
- z20.object({
812
+ z21.object({
646
813
  retention: LogRetentionSchema2.optional()
647
814
  })
648
815
  ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
649
- var FileCodeSchema2 = z20.object({
816
+ var FileCodeSchema2 = z21.object({
650
817
  file: LocalFileSchema.describe("The file path of the instance code.")
651
818
  });
652
- var CodeSchema2 = z20.union([
819
+ var CodeSchema2 = z21.union([
653
820
  LocalFileSchema.transform((file) => ({
654
821
  file
655
822
  })).pipe(FileCodeSchema2),
656
823
  FileCodeSchema2
657
824
  ]).describe("Specify the code of your instance.");
658
- var ISchema = z20.object({
825
+ var ISchema = z21.object({
659
826
  code: CodeSchema2,
660
827
  description: DescriptionSchema2.optional(),
661
828
  image: ImageSchema.optional(),
@@ -668,14 +835,14 @@ var ISchema = z20.object({
668
835
  healthCheck: HealthCheckSchema.optional()
669
836
  // restartPolicy: RestartPolicySchema.optional(),
670
837
  });
671
- var InstanceSchema = z20.union([
838
+ var InstanceSchema = z21.union([
672
839
  LocalFileSchema.transform((code) => ({
673
840
  code
674
841
  })).pipe(ISchema),
675
842
  ISchema
676
843
  ]);
677
- var InstancesSchema = z20.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
678
- var InstanceDefaultSchema = z20.object({
844
+ var InstancesSchema = z21.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
845
+ var InstanceDefaultSchema = z21.object({
679
846
  image: ImageSchema.optional(),
680
847
  cpu: CpuSchema.default(0.25),
681
848
  memorySize: MemorySizeSchema2.default("512 MB"),
@@ -685,21 +852,21 @@ var InstanceDefaultSchema = z20.object({
685
852
  healthCheck: HealthCheckSchema.optional(),
686
853
  // restartPolicy: RestartPolicySchema.default({ enabled: true }),
687
854
  log: LogSchema2.default(true).transform((log) => ({
688
- retention: log.retention ?? days3(7)
855
+ retention: log.retention ?? days4(7)
689
856
  }))
690
857
  }).default({});
691
858
 
692
859
  // src/feature/topic/schema.ts
693
860
  import { kebabCase as kebabCase3 } from "change-case";
694
- import { z as z21 } from "zod";
695
- var TopicNameSchema = z21.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
696
- var TopicsDefaultSchema = z21.array(TopicNameSchema).refine((topics) => {
861
+ import { z as z22 } from "zod";
862
+ 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.");
863
+ var TopicsDefaultSchema = z22.array(TopicNameSchema).refine((topics) => {
697
864
  return topics.length === new Set(topics).size;
698
865
  }, "Must be a list of unique topic names").optional().describe("Define the event topics for your app.");
699
- var SubscribersSchema = z21.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
866
+ var SubscribersSchema = z22.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
700
867
 
701
868
  // src/config/schema/region.ts
702
- import { z as z22 } from "zod";
869
+ import { z as z23 } from "zod";
703
870
  var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
704
871
  var AF = ["af-south-1"];
705
872
  var AP = [
@@ -728,16 +895,16 @@ var EU = [
728
895
  var ME = ["me-south-1", "me-central-1"];
729
896
  var SA = ["sa-east-1"];
730
897
  var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
731
- var RegionSchema = z22.enum(regions);
898
+ var RegionSchema = z23.enum(regions);
732
899
 
733
900
  // src/config/app.ts
734
- var AppSchema = z23.object({
735
- $schema: z23.string().optional(),
901
+ var AppSchema = z24.object({
902
+ $schema: z24.string().optional(),
736
903
  name: ResourceIdSchema.describe("App name."),
737
904
  region: RegionSchema.describe("The AWS region to deploy to."),
738
- profile: z23.string().describe("The AWS profile to deploy to."),
739
- protect: z23.boolean().default(false).describe("Protect your app & stacks from being deleted."),
740
- removal: z23.enum(["remove", "retain"]).default("remove").describe(
905
+ profile: z24.string().describe("The AWS profile to deploy to."),
906
+ protect: z24.boolean().default(false).describe("Protect your app & stacks from being deleted."),
907
+ removal: z24.enum(["remove", "retain"]).default("remove").describe(
741
908
  [
742
909
  "Configure how your resources are handled when they have to be removed.",
743
910
  "",
@@ -751,7 +918,7 @@ var AppSchema = z23.object({
751
918
  // .default('prod')
752
919
  // .describe('The deployment stage.'),
753
920
  // onFailure: OnFailureSchema,
754
- defaults: z23.object({
921
+ defaults: z24.object({
755
922
  onFailure: OnFailureDefaultSchema,
756
923
  onLog: OnLogDefaultSchema,
757
924
  auth: AuthDefaultSchema,
@@ -768,17 +935,18 @@ var AppSchema = z23.object({
768
935
  // store: StoreDefaultSchema,
769
936
  alerts: AlertsDefaultSchema,
770
937
  topics: TopicsDefaultSchema,
771
- layers: LayerSchema
938
+ layers: LayerSchema,
939
+ router: RouterDefaultSchema
772
940
  // dataRetention: z.boolean().describe('Configure how your resources are handled on delete.').default(false),
773
941
  }).default({}).describe("Default properties")
774
942
  });
775
943
 
776
944
  // src/config/stack.ts
777
- import { z as z39 } from "zod";
945
+ import { z as z40 } from "zod";
778
946
 
779
947
  // src/feature/cache/schema.ts
780
948
  import { gibibytes as gibibytes2 } from "@awsless/size";
781
- import { z as z24 } from "zod";
949
+ import { z as z25 } from "zod";
782
950
  var StorageSchema = SizeSchema.refine(sizeMin(gibibytes2(1)), "Minimum storage size is 1 GB").refine(
783
951
  sizeMax(gibibytes2(5e3)),
784
952
  "Maximum storage size is 5000 GB"
@@ -789,31 +957,31 @@ var MinimumStorageSchema = StorageSchema.describe(
789
957
  var MaximumStorageSchema = StorageSchema.describe(
790
958
  "The upper limit for data storage the cache is set to use. You can specify a size value from 1 GB to 5000 GB."
791
959
  );
792
- var EcpuSchema = z24.number().int().min(1e3).max(15e6);
960
+ var EcpuSchema = z25.number().int().min(1e3).max(15e6);
793
961
  var MinimumEcpuSchema = EcpuSchema.describe(
794
962
  "The minimum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
795
963
  );
796
964
  var MaximumEcpuSchema = EcpuSchema.describe(
797
965
  "The maximum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
798
966
  );
799
- var CachesSchema = z24.record(
967
+ var CachesSchema = z25.record(
800
968
  ResourceIdSchema,
801
- z24.object({
969
+ z25.object({
802
970
  minStorage: MinimumStorageSchema.optional(),
803
971
  maxStorage: MaximumStorageSchema.optional(),
804
972
  minECPU: MinimumEcpuSchema.optional(),
805
973
  maxECPU: MaximumEcpuSchema.optional(),
806
- snapshotRetentionLimit: z24.number().int().positive().default(1)
974
+ snapshotRetentionLimit: z25.number().int().positive().default(1)
807
975
  })
808
976
  ).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
809
977
 
810
978
  // src/feature/command/schema.ts
811
- import { z as z25 } from "zod";
812
- var CommandSchema = z25.union([
813
- z25.object({
979
+ import { z as z26 } from "zod";
980
+ var CommandSchema = z26.union([
981
+ z26.object({
814
982
  file: LocalFileSchema,
815
- handler: z25.string().default("default").describe("The name of the handler that needs to run"),
816
- description: z25.string().optional().describe("A description of the command")
983
+ handler: z26.string().default("default").describe("The name of the handler that needs to run"),
984
+ description: z26.string().optional().describe("A description of the command")
817
985
  // options: z.record(ResourceIdSchema, OptionSchema).optional(),
818
986
  // arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
819
987
  }),
@@ -823,22 +991,22 @@ var CommandSchema = z25.union([
823
991
  description: void 0
824
992
  }))
825
993
  ]);
826
- var CommandsSchema = z25.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
994
+ var CommandsSchema = z26.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
827
995
 
828
996
  // src/feature/config/schema.ts
829
- import { z as z26 } from "zod";
830
- var ConfigNameSchema = z26.string().regex(/[a-z0-9\-]/g, "Invalid config name");
831
- var ConfigsSchema = z26.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
997
+ import { z as z27 } from "zod";
998
+ var ConfigNameSchema = z27.string().regex(/[a-z0-9\-]/g, "Invalid config name");
999
+ var ConfigsSchema = z27.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
832
1000
 
833
1001
  // src/feature/cron/schema/index.ts
834
- import { z as z28 } from "zod";
1002
+ import { z as z29 } from "zod";
835
1003
 
836
1004
  // src/feature/cron/schema/schedule.ts
837
- import { z as z27 } from "zod";
1005
+ import { z as z28 } from "zod";
838
1006
  import { awsCronExpressionValidator } from "aws-cron-expression-validator";
839
- var RateExpressionSchema = z27.custom(
1007
+ var RateExpressionSchema = z28.custom(
840
1008
  (value) => {
841
- return z27.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
1009
+ return z28.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
842
1010
  const [str] = rate.split(" ");
843
1011
  const number = parseInt(str);
844
1012
  return number > 0;
@@ -854,9 +1022,9 @@ var RateExpressionSchema = z27.custom(
854
1022
  }
855
1023
  return `rate(${rate})`;
856
1024
  });
857
- var CronExpressionSchema = z27.custom(
1025
+ var CronExpressionSchema = z28.custom(
858
1026
  (value) => {
859
- return z27.string().safeParse(value).success;
1027
+ return z28.string().safeParse(value).success;
860
1028
  },
861
1029
  { message: "Invalid cron expression" }
862
1030
  ).superRefine((value, ctx) => {
@@ -865,12 +1033,12 @@ var CronExpressionSchema = z27.custom(
865
1033
  } catch (error) {
866
1034
  if (error instanceof Error) {
867
1035
  ctx.addIssue({
868
- code: z27.ZodIssueCode.custom,
1036
+ code: z28.ZodIssueCode.custom,
869
1037
  message: `Invalid cron expression: ${error.message}`
870
1038
  });
871
1039
  } else {
872
1040
  ctx.addIssue({
873
- code: z27.ZodIssueCode.custom,
1041
+ code: z28.ZodIssueCode.custom,
874
1042
  message: "Invalid cron expression"
875
1043
  });
876
1044
  }
@@ -881,28 +1049,28 @@ var CronExpressionSchema = z27.custom(
881
1049
  var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
882
1050
 
883
1051
  // src/feature/cron/schema/index.ts
884
- var CronsSchema = z28.record(
1052
+ var CronsSchema = z29.record(
885
1053
  ResourceIdSchema,
886
- z28.object({
887
- enabled: z28.boolean().default(true).describe("If the cron is enabled."),
1054
+ z29.object({
1055
+ enabled: z29.boolean().default(true).describe("If the cron is enabled."),
888
1056
  consumer: FunctionSchema.describe("The consuming lambda function properties."),
889
1057
  schedule: ScheduleExpressionSchema.describe(
890
1058
  'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
891
1059
  ),
892
- payload: z28.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
1060
+ payload: z29.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
893
1061
  })
894
1062
  ).optional().describe(`Define the cron jobs in your stack.`);
895
1063
 
896
1064
  // src/feature/search/schema.ts
897
1065
  import { gibibytes as gibibytes3 } from "@awsless/size";
898
- import { z as z29 } from "zod";
899
- var VersionSchema = z29.union([
1066
+ import { z as z30 } from "zod";
1067
+ var VersionSchema = z30.union([
900
1068
  //
901
- z29.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
902
- z29.string()
1069
+ z30.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
1070
+ z30.string()
903
1071
  ]).describe("Specify the OpenSearch engine version.");
904
- var TypeSchema = z29.union([
905
- z29.enum([
1072
+ var TypeSchema = z30.union([
1073
+ z30.enum([
906
1074
  "t3.small",
907
1075
  "t3.medium",
908
1076
  "m3.medium",
@@ -976,13 +1144,13 @@ var TypeSchema = z29.union([
976
1144
  "r6gd.12xlarge",
977
1145
  "r6gd.16xlarge"
978
1146
  ]),
979
- z29.string()
1147
+ z30.string()
980
1148
  ]).describe("Instance type of data nodes in the cluster.");
981
- var CountSchema = z29.number().int().min(1).describe("Number of instances in the cluster.");
1149
+ var CountSchema = z30.number().int().min(1).describe("Number of instances in the cluster.");
982
1150
  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.");
983
- var SearchsSchema = z29.record(
1151
+ var SearchsSchema = z30.record(
984
1152
  ResourceIdSchema,
985
- z29.object({
1153
+ z30.object({
986
1154
  type: TypeSchema.default("t3.small"),
987
1155
  count: CountSchema.default(1),
988
1156
  version: VersionSchema.default("2.13"),
@@ -993,12 +1161,12 @@ var SearchsSchema = z29.record(
993
1161
  ).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
994
1162
 
995
1163
  // src/feature/site/schema.ts
996
- import { z as z31 } from "zod";
1164
+ import { z as z32 } from "zod";
997
1165
 
998
1166
  // src/config/schema/local-entry.ts
999
1167
  import { stat as stat3 } from "fs/promises";
1000
- import { z as z30 } from "zod";
1001
- var LocalEntrySchema = z30.union([
1168
+ import { z as z31 } from "zod";
1169
+ var LocalEntrySchema = z31.union([
1002
1170
  RelativePathSchema.refine(async (path) => {
1003
1171
  try {
1004
1172
  const s = await stat3(path);
@@ -1007,7 +1175,7 @@ var LocalEntrySchema = z30.union([
1007
1175
  return false;
1008
1176
  }
1009
1177
  }, `File or directory doesn't exist`),
1010
- z30.object({
1178
+ z31.object({
1011
1179
  nocheck: RelativePathSchema.describe(
1012
1180
  "Specifies a local file or directory without checking if the file or directory exists."
1013
1181
  )
@@ -1015,182 +1183,43 @@ var LocalEntrySchema = z30.union([
1015
1183
  ]);
1016
1184
 
1017
1185
  // src/feature/site/schema.ts
1018
- var ErrorResponsePathSchema = z31.string().describe(
1019
- [
1020
- "The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.",
1021
- "- We recommend that you store custom error pages in an Amazon S3 bucket.",
1022
- "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."
1023
- ].join("\n")
1024
- );
1025
- var StatusCodeSchema = z31.number().int().positive().optional().describe(
1026
- [
1027
- "The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.",
1028
- "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:",
1029
- "- 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.",
1030
- "If you substitute 200, the response typically won't be intercepted.",
1031
- `- 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.`,
1032
- `- You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down.`
1033
- ].join("\n")
1034
- );
1035
- var MinTTLSchema = DurationSchema.describe(
1036
- "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."
1037
- );
1038
- var ErrorResponseSchema = z31.union([
1039
- ErrorResponsePathSchema,
1040
- z31.object({
1041
- path: ErrorResponsePathSchema,
1042
- statusCode: StatusCodeSchema.optional(),
1043
- minTTL: MinTTLSchema.optional()
1044
- })
1045
- ]).optional();
1046
- var SitesSchema = z31.record(
1186
+ var SitesSchema = z32.record(
1047
1187
  ResourceIdSchema,
1048
- z31.object({
1049
- domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1050
- subDomain: z31.string().optional(),
1051
- // bind: z
1052
- // .object({
1053
- // auth: z.array(ResourceIdSchema),
1054
- // graphql: z.array(ResourceIdSchema),
1055
- // // http: z.array(ResourceIdSchema),
1056
- // // rest: z.array(ResourceIdSchema),
1057
- // })
1058
- // .optional(),
1059
- build: z31.object({
1060
- command: z31.string().describe(
1188
+ z32.object({
1189
+ router: ResourceIdSchema.describe("The router id to link your site with."),
1190
+ path: RouteSchema2.describe("The path inside the router to link your site to."),
1191
+ build: z32.object({
1192
+ command: z32.string().describe(
1061
1193
  `Specifies the files and directories to generate the cache key for your custom build command.`
1062
1194
  ),
1063
- cacheKey: z31.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
1195
+ cacheKey: z32.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
1064
1196
  `Specifies the files and directories to generate the cache key for your custom build command.`
1065
1197
  ),
1066
- configs: z31.string().array().optional().describe("Define the config values for your build command.")
1198
+ configs: z32.string().array().optional().describe("Define the config values for your build command.")
1067
1199
  }).optional().describe(`Specifies the build process for sites that need a build step.`),
1068
- static: z31.union([LocalDirectorySchema, z31.boolean()]).optional().describe(
1200
+ static: z32.union([LocalDirectorySchema, z32.boolean()]).optional().describe(
1069
1201
  "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."
1070
1202
  ),
1071
- ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server."),
1072
- // envPrefix: z.string().optional().describe('Specifies a prefix for all '),
1073
- // origin: z
1074
- // .enum(['ssr-first', 'static-first'])
1075
- // .default('static-first')
1076
- // .describe('Specifies the origin fallback ordering.'),
1077
- // bind: z.object({
1078
- // auth:
1079
- // h
1080
- // }).optional(),
1081
- // ssr: z.union([
1082
- // FunctionSchema.optional(),
1083
- // z.object({
1084
- // consumer: FunctionSchema.optional(),
1085
- // responseStreaming: z.boolean().default(false),
1086
- // build: z.string().optional(),
1087
- // }),
1088
- // ]),
1089
- geoRestrictions: z31.array(z31.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
1090
- // forwardHost: z
1091
- // .boolean()
1092
- // .default(false)
1093
- // .describe(
1094
- // [
1095
- // 'Specify if the original `host` header should be forwarded to the SSR function.',
1096
- // 'The original `host` header will be forwarded as `x-forwarded-host`.',
1097
- // 'Keep in mind that this requires an extra CloudFront Function.',
1098
- // ].join('\n')
1099
- // ),
1100
- errors: z31.object({
1101
- 400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
1102
- 403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
1103
- 404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
1104
- 405: ErrorResponseSchema.describe("Customize a `405 Method Not Allowed` response."),
1105
- 414: ErrorResponseSchema.describe("Customize a `414 Request-URI` response."),
1106
- 416: ErrorResponseSchema.describe("Customize a `416 Range Not` response."),
1107
- 500: ErrorResponseSchema.describe("Customize a `500 Internal Server` response."),
1108
- 501: ErrorResponseSchema.describe("Customize a `501 Not Implemented` response."),
1109
- 502: ErrorResponseSchema.describe("Customize a `502 Bad Gateway` response."),
1110
- 503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
1111
- 504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
1112
- }).optional().describe("Customize the error responses for specific HTTP status codes."),
1113
- cors: z31.object({
1114
- override: z31.boolean().default(false),
1115
- maxAge: DurationSchema.default("365 days"),
1116
- exposeHeaders: z31.string().array().optional(),
1117
- credentials: z31.boolean().default(false),
1118
- headers: z31.string().array().default(["*"]),
1119
- origins: z31.string().array().default(["*"]),
1120
- methods: z31.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
1121
- }).optional().describe("Specify the cors headers."),
1122
- basicAuth: z31.object({
1123
- username: z31.string().describe("Basic auth username."),
1124
- password: z31.string().describe("Basic auth password.")
1125
- }).optional().describe("Enable basic authentication for the site."),
1126
- security: z31.object({
1127
- // contentSecurityPolicy: z.object({
1128
- // override: z.boolean().default(false),
1129
- // policy: z.string(),
1130
- // })
1131
- // contentSecurityPolicy?: {
1132
- // override?: boolean
1133
- // contentSecurityPolicy: string
1134
- // }
1135
- // contentTypeOptions?: {
1136
- // override?: boolean
1137
- // }
1138
- // frameOptions?: {
1139
- // override?: boolean
1140
- // frameOption?: 'deny' | 'same-origin'
1141
- // }
1142
- // referrerPolicy?: {
1143
- // override?: boolean
1144
- // referrerPolicy?: (
1145
- // 'no-referrer' |
1146
- // 'no-referrer-when-downgrade' |
1147
- // 'origin' |
1148
- // 'origin-when-cross-origin' |
1149
- // 'same-origin' |
1150
- // 'strict-origin' |
1151
- // 'strict-origin-when-cross-origin' |
1152
- // 'unsafe-url'
1153
- // )
1154
- // }
1155
- // strictTransportSecurity?: {
1156
- // maxAge?: Duration
1157
- // includeSubdomains?: boolean
1158
- // override?: boolean
1159
- // preload?: boolean
1160
- // }
1161
- // xssProtection?: {
1162
- // override?: boolean
1163
- // enable?: boolean
1164
- // modeBlock?: boolean
1165
- // reportUri?: string
1166
- // }
1167
- }).optional().describe("Specify the security policy."),
1168
- cache: z31.object({
1169
- cookies: z31.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
1170
- headers: z31.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
1171
- queries: z31.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
1172
- }).optional().describe(
1173
- "Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
1174
- )
1203
+ ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server.")
1175
1204
  })
1176
1205
  ).optional().describe("Define the sites in your stack.");
1177
1206
 
1178
1207
  // src/feature/store/schema.ts
1179
- import { z as z32 } from "zod";
1180
- var StoresSchema = z32.union([
1181
- z32.array(ResourceIdSchema).transform((list) => {
1208
+ import { z as z33 } from "zod";
1209
+ var StoresSchema = z33.union([
1210
+ z33.array(ResourceIdSchema).transform((list) => {
1182
1211
  const stores = {};
1183
1212
  for (const key of list) {
1184
1213
  stores[key] = {};
1185
1214
  }
1186
1215
  return stores;
1187
1216
  }),
1188
- z32.record(
1217
+ z33.record(
1189
1218
  ResourceIdSchema,
1190
- z32.object({
1219
+ z33.object({
1191
1220
  static: LocalDirectorySchema.optional().describe("Specifies the path to the static files directory."),
1192
- versioning: z32.boolean().default(false).describe("Enable versioning of your store."),
1193
- events: z32.object({
1221
+ versioning: z33.boolean().default(false).describe("Enable versioning of your store."),
1222
+ events: z33.object({
1194
1223
  // create
1195
1224
  "created:*": FunctionSchema.optional().describe(
1196
1225
  "Subscribe to notifications regardless of the API that was used to create an object."
@@ -1223,28 +1252,30 @@ var StoresSchema = z32.union([
1223
1252
  ]).optional().describe("Define the stores in your stack.");
1224
1253
 
1225
1254
  // src/feature/icon/schema.ts
1226
- import { z as z33 } from "zod";
1255
+ import { z as z34 } from "zod";
1227
1256
  var staticOriginSchema = LocalDirectorySchema.describe(
1228
1257
  "Specifies the path to a local image directory that will be uploaded in S3."
1229
1258
  );
1230
1259
  var functionOriginSchema = FunctionSchema.describe(
1231
1260
  "Specifies the file that will be called when an image isn't found in the (cache) bucket."
1232
1261
  );
1233
- var IconsSchema = z33.record(
1262
+ var IconsSchema = z34.record(
1234
1263
  ResourceIdSchema,
1235
- z33.object({
1236
- domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1237
- subDomain: z33.string().optional(),
1264
+ z34.object({
1265
+ // domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
1266
+ // subDomain: z.string().optional(),
1267
+ router: ResourceIdSchema.describe("The router id to link your icon proxy."),
1268
+ path: RouteSchema2.describe("The path inside the router to link your icon proxy to."),
1238
1269
  log: LogSchema.optional(),
1239
1270
  cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
1240
- preserveIds: z33.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1241
- symbols: z33.boolean().optional().default(false).describe(`Convert the SVG's to SVG symbols.`),
1242
- origin: z33.union([
1243
- z33.object({
1271
+ preserveIds: z34.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1272
+ symbols: z34.boolean().optional().default(false).describe(`Convert the SVG's to SVG symbols.`),
1273
+ origin: z34.union([
1274
+ z34.object({
1244
1275
  static: staticOriginSchema,
1245
1276
  function: functionOriginSchema.optional()
1246
1277
  }),
1247
- z33.object({
1278
+ z34.object({
1248
1279
  static: staticOriginSchema.optional(),
1249
1280
  function: functionOriginSchema
1250
1281
  })
@@ -1254,27 +1285,30 @@ var IconsSchema = z33.record(
1254
1285
  // }),
1255
1286
  ]).describe(
1256
1287
  "Image transformation will be applied from a base image. Base images orginates from a local directory that will be uploaded to S3 or from a lambda function."
1257
- ),
1258
- cors: z33.object({
1259
- override: z33.boolean().default(true),
1260
- maxAge: DurationSchema.default("365 days"),
1261
- exposeHeaders: z33.string().array().optional(),
1262
- credentials: z33.boolean().default(false),
1263
- headers: z33.string().array().default(["*"]),
1264
- origins: z33.string().array().default(["*"])
1265
- }).optional().describe("Specify the cors headers.")
1288
+ )
1289
+ // cors: z
1290
+ // .object({
1291
+ // override: z.boolean().default(true),
1292
+ // maxAge: DurationSchema.default('365 days'),
1293
+ // exposeHeaders: z.string().array().optional(),
1294
+ // credentials: z.boolean().default(false),
1295
+ // headers: z.string().array().default(['*']),
1296
+ // origins: z.string().array().default(['*']),
1297
+ // })
1298
+ // .optional()
1299
+ // .describe('Specify the cors headers.'),
1266
1300
  // version: z.number().int().min(1).optional().describe('Version of the icon configuration.'),
1267
1301
  })
1268
- ).optional().describe("Define an icon proxy in your stack. Store, optimize, and deliver icons at scale.");
1302
+ ).optional().describe("Define an svg icon proxy in your stack. Store, optimize, and deliver svg icons at scale.");
1269
1303
 
1270
1304
  // src/feature/image/schema.ts
1271
- import { z as z34 } from "zod";
1272
- var transformationOptionsSchema = z34.object({
1273
- width: z34.number().int().positive().optional(),
1274
- height: z34.number().int().positive().optional(),
1275
- fit: z34.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
1276
- position: z34.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
1277
- quality: z34.number().int().min(1).max(100).optional()
1305
+ import { z as z35 } from "zod";
1306
+ var transformationOptionsSchema = z35.object({
1307
+ width: z35.number().int().positive().optional(),
1308
+ height: z35.number().int().positive().optional(),
1309
+ fit: z35.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
1310
+ position: z35.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
1311
+ quality: z35.number().int().min(1).max(100).optional()
1278
1312
  });
1279
1313
  var staticOriginSchema2 = LocalDirectorySchema.describe(
1280
1314
  "Specifies the path to a local image directory that will be uploaded in S3."
@@ -1282,36 +1316,38 @@ var staticOriginSchema2 = LocalDirectorySchema.describe(
1282
1316
  var functionOriginSchema2 = FunctionSchema.describe(
1283
1317
  "Specifies the file that will be called when an image isn't found in the (cache) bucket."
1284
1318
  );
1285
- var ImagesSchema = z34.record(
1319
+ var ImagesSchema = z35.record(
1286
1320
  ResourceIdSchema,
1287
- z34.object({
1288
- domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1289
- subDomain: z34.string().optional(),
1321
+ z35.object({
1322
+ // domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
1323
+ // subDomain: z.string().optional(),
1324
+ router: ResourceIdSchema.describe("The router id to link your image proxy."),
1325
+ path: RouteSchema2.describe("The path inside the router to link your image proxy to."),
1290
1326
  log: LogSchema.optional(),
1291
1327
  cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
1292
- presets: z34.record(z34.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1293
- extensions: z34.object({
1294
- jpeg: z34.object({
1295
- mozjpeg: z34.boolean().optional(),
1296
- progressive: z34.boolean().optional()
1328
+ presets: z35.record(z35.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1329
+ extensions: z35.object({
1330
+ jpg: z35.object({
1331
+ mozjpeg: z35.boolean().optional(),
1332
+ progressive: z35.boolean().optional()
1297
1333
  }).optional(),
1298
- webp: z34.object({
1299
- effort: z34.number().int().min(1).max(10).default(7).optional(),
1300
- lossless: z34.boolean().optional(),
1301
- nearLossless: z34.boolean().optional()
1334
+ webp: z35.object({
1335
+ effort: z35.number().int().min(1).max(10).default(7).optional(),
1336
+ lossless: z35.boolean().optional(),
1337
+ nearLossless: z35.boolean().optional()
1302
1338
  }).optional(),
1303
- png: z34.object({
1304
- compressionLevel: z34.number().int().min(0).max(9).default(6).optional()
1339
+ png: z35.object({
1340
+ compressionLevel: z35.number().int().min(0).max(9).default(6).optional()
1305
1341
  }).optional()
1306
1342
  }).refine((data) => {
1307
1343
  return Object.keys(data).length > 0;
1308
1344
  }, "At least one extension must be defined.").describe("Specify the allowed extensions."),
1309
- origin: z34.union([
1310
- z34.object({
1345
+ origin: z35.union([
1346
+ z35.object({
1311
1347
  static: staticOriginSchema2,
1312
1348
  function: functionOriginSchema2.optional()
1313
1349
  }),
1314
- z34.object({
1350
+ z35.object({
1315
1351
  static: staticOriginSchema2.optional(),
1316
1352
  function: functionOriginSchema2
1317
1353
  })
@@ -1321,13 +1357,12 @@ var ImagesSchema = z34.record(
1321
1357
  // }),
1322
1358
  ]).describe(
1323
1359
  "Specify the origin of your images. Image transformation will be applied from a base image. Base images can be loaded from a S3 bucket (that is synced from a local directory) or dynamicly from a lambda function."
1324
- ),
1325
- version: z34.number().int().min(1).optional().describe("Version of the image configuration.")
1360
+ )
1326
1361
  })
1327
1362
  ).optional().describe("Define an image proxy in your stack. Store, transform, optimize, and deliver images at scale.");
1328
1363
 
1329
1364
  // src/feature/metric/schema.ts
1330
- import { z as z35 } from "zod";
1365
+ import { z as z36 } from "zod";
1331
1366
  var ops = {
1332
1367
  ">": "GreaterThanThreshold",
1333
1368
  ">=": "GreaterThanOrEqualToThreshold",
@@ -1341,15 +1376,15 @@ var stats = {
1341
1376
  min: "Minimum",
1342
1377
  max: "Maximum"
1343
1378
  };
1344
- var WhereSchema = z35.union([
1345
- z35.string().regex(/(count|avg|sum|min|max) (>|>=|<|<=) (\d)/, "Invalid where query").transform((where) => {
1379
+ var WhereSchema = z36.union([
1380
+ z36.string().regex(/(count|avg|sum|min|max) (>|>=|<|<=) (\d)/, "Invalid where query").transform((where) => {
1346
1381
  const [stat4, op, value] = where.split(" ");
1347
1382
  return { stat: stat4, op, value: parseFloat(value) };
1348
1383
  }),
1349
- z35.object({
1350
- stat: z35.enum(["count", "avg", "sum", "min", "max"]),
1351
- op: z35.enum([">", ">=", "<", "<="]),
1352
- value: z35.number()
1384
+ z36.object({
1385
+ stat: z36.enum(["count", "avg", "sum", "min", "max"]),
1386
+ op: z36.enum([">", ">=", "<", "<="]),
1387
+ value: z36.number()
1353
1388
  })
1354
1389
  ]).transform((where) => {
1355
1390
  return {
@@ -1358,39 +1393,39 @@ var WhereSchema = z35.union([
1358
1393
  value: where.value
1359
1394
  };
1360
1395
  });
1361
- var AlarmSchema = z35.object({
1362
- description: z35.string().optional(),
1396
+ var AlarmSchema = z36.object({
1397
+ description: z36.string().optional(),
1363
1398
  where: WhereSchema,
1364
1399
  period: DurationSchema,
1365
- minDataPoints: z35.number().int().default(1),
1366
- trigger: z35.union([EmailSchema.transform((v) => [v]), EmailSchema.array(), FunctionSchema])
1400
+ minDataPoints: z36.number().int().default(1),
1401
+ trigger: z36.union([EmailSchema.transform((v) => [v]), EmailSchema.array(), FunctionSchema])
1367
1402
  });
1368
- var MetricsSchema = z35.record(
1403
+ var MetricsSchema = z36.record(
1369
1404
  ResourceIdSchema,
1370
- z35.object({
1371
- type: z35.enum(["number", "size", "duration"]),
1405
+ z36.object({
1406
+ type: z36.enum(["number", "size", "duration"]),
1372
1407
  alarms: AlarmSchema.array().optional()
1373
1408
  })
1374
1409
  ).optional().describe("Define the metrics in your stack.");
1375
1410
 
1376
1411
  // src/feature/table/schema.ts
1377
- import { minutes as minutes4, seconds as seconds4 } from "@awsless/duration";
1378
- import { z as z36 } from "zod";
1379
- var KeySchema = z36.string().min(1).max(255);
1380
- var TablesSchema = z36.record(
1412
+ import { minutes as minutes5, seconds as seconds4 } from "@awsless/duration";
1413
+ import { z as z37 } from "zod";
1414
+ var KeySchema = z37.string().min(1).max(255);
1415
+ var TablesSchema = z37.record(
1381
1416
  ResourceIdSchema,
1382
- z36.object({
1417
+ z37.object({
1383
1418
  hash: KeySchema.describe(
1384
1419
  "Specifies the name of the partition / hash key that makes up the primary key for the table."
1385
1420
  ),
1386
1421
  sort: KeySchema.optional().describe(
1387
1422
  "Specifies the name of the range / sort key that makes up the primary key for the table."
1388
1423
  ),
1389
- fields: z36.record(z36.string(), z36.enum(["string", "number", "binary"])).optional().describe(
1424
+ fields: z37.record(z37.string(), z37.enum(["string", "number", "binary"])).optional().describe(
1390
1425
  'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
1391
1426
  ),
1392
- class: z36.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
1393
- pointInTimeRecovery: z36.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
1427
+ class: z37.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
1428
+ pointInTimeRecovery: z37.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
1394
1429
  ttl: KeySchema.optional().describe(
1395
1430
  [
1396
1431
  "The name of the TTL attribute used to store the expiration time for items in the table.",
@@ -1398,8 +1433,8 @@ var TablesSchema = z36.record(
1398
1433
  ].join("\n")
1399
1434
  ),
1400
1435
  // deletionProtection: DeletionProtectionSchema.optional(),
1401
- stream: z36.object({
1402
- type: z36.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
1436
+ stream: z37.object({
1437
+ type: z37.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
1403
1438
  [
1404
1439
  "When an item in the table is modified, you can determines what information is written to the stream for this table.",
1405
1440
  "Valid values are:",
@@ -1409,7 +1444,7 @@ var TablesSchema = z36.record(
1409
1444
  "- new-and-old-images - Both the new and the old item images of the item are written to the stream."
1410
1445
  ].join("\n")
1411
1446
  ),
1412
- batchSize: z36.number().min(1).max(1e4).default(1).describe(
1447
+ batchSize: z37.number().min(1).max(1e4).default(1).describe(
1413
1448
  [
1414
1449
  "The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
1415
1450
  "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).",
@@ -1419,7 +1454,7 @@ var TablesSchema = z36.record(
1419
1454
  batchWindow: DurationSchema.refine(
1420
1455
  durationMin(seconds4(1)),
1421
1456
  "Minimum batch window duration is 1 second"
1422
- ).refine(durationMax(minutes4(5)), "Maximum batch window duration is 5 minutes").optional().describe(
1457
+ ).refine(durationMax(minutes5(5)), "Maximum batch window duration is 5 minutes").optional().describe(
1423
1458
  [
1424
1459
  "The maximum amount of time that is spend gathering records before invoking the function.",
1425
1460
  "You can specify a duration from 1 seconds to 5 minutes."
@@ -1439,7 +1474,7 @@ var TablesSchema = z36.record(
1439
1474
  // 'You can specify a number from -1 to 10000.',
1440
1475
  // ].join('\n')
1441
1476
  // ),
1442
- retryAttempts: z36.number().min(-1).max(1e4).default(-1).describe(
1477
+ retryAttempts: z37.number().min(-1).max(1e4).default(-1).describe(
1443
1478
  [
1444
1479
  "Discard records after the specified number of retries.",
1445
1480
  "The default value is -1, which sets the maximum number of retries to infinite.",
@@ -1447,7 +1482,7 @@ var TablesSchema = z36.record(
1447
1482
  "You can specify a number from -1 to 10000."
1448
1483
  ].join("\n")
1449
1484
  ),
1450
- concurrencyPerShard: z36.number().min(1).max(10).default(1).describe(
1485
+ concurrencyPerShard: z37.number().min(1).max(10).default(1).describe(
1451
1486
  [
1452
1487
  "The number of batches to process concurrently from each shard.",
1453
1488
  "You can specify a number from 1 to 10."
@@ -1457,16 +1492,16 @@ var TablesSchema = z36.record(
1457
1492
  }).optional().describe(
1458
1493
  "The settings for the DynamoDB table stream, which capture changes to items stored in the table."
1459
1494
  ),
1460
- indexes: z36.record(
1461
- z36.string(),
1462
- z36.object({
1495
+ indexes: z37.record(
1496
+ z37.string(),
1497
+ z37.object({
1463
1498
  hash: KeySchema.describe(
1464
1499
  "Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
1465
1500
  ),
1466
1501
  sort: KeySchema.optional().describe(
1467
1502
  "Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
1468
1503
  ),
1469
- projection: z36.enum(["all", "keys-only"]).default("all").describe(
1504
+ projection: z37.enum(["all", "keys-only"]).default("all").describe(
1470
1505
  [
1471
1506
  "The set of attributes that are projected into the index:",
1472
1507
  "- all - All of the table attributes are projected into the index.",
@@ -1480,11 +1515,11 @@ var TablesSchema = z36.record(
1480
1515
  ).optional().describe("Define the tables in your stack.");
1481
1516
 
1482
1517
  // src/feature/task/schema.ts
1483
- import { z as z37 } from "zod";
1484
- var RetryAttemptsSchema2 = z37.number().int().min(0).max(2).describe(
1518
+ import { z as z38 } from "zod";
1519
+ var RetryAttemptsSchema2 = z38.number().int().min(0).max(2).describe(
1485
1520
  "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
1486
1521
  );
1487
- var TaskSchema = z37.union([
1522
+ var TaskSchema = z38.union([
1488
1523
  LocalFileSchema.transform((file) => ({
1489
1524
  consumer: {
1490
1525
  code: {
@@ -1495,20 +1530,20 @@ var TaskSchema = z37.union([
1495
1530
  },
1496
1531
  retryAttempts: void 0
1497
1532
  })),
1498
- z37.object({
1533
+ z38.object({
1499
1534
  consumer: FunctionSchema,
1500
1535
  retryAttempts: RetryAttemptsSchema2.optional()
1501
1536
  })
1502
1537
  ]);
1503
- var TasksSchema = z37.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
1538
+ var TasksSchema = z38.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
1504
1539
 
1505
1540
  // src/feature/test/schema.ts
1506
- import { z as z38 } from "zod";
1507
- var TestsSchema = z38.union([
1541
+ import { z as z39 } from "zod";
1542
+ var TestsSchema = z39.union([
1508
1543
  //
1509
1544
  LocalDirectorySchema.transform((v) => [v]),
1510
1545
  LocalDirectorySchema.array(),
1511
- z38.literal(false)
1546
+ z39.literal(false)
1512
1547
  ]).describe("Define the location of your tests for your stack.").optional();
1513
1548
 
1514
1549
  // src/config/stack.ts
@@ -1516,8 +1551,8 @@ var DependsSchema = ResourceIdSchema.array().optional().describe("Define the sta
1516
1551
  var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
1517
1552
  message: `Stack name can't be a reserved name.`
1518
1553
  }).describe("Stack name.");
1519
- var StackSchema = z39.object({
1520
- $schema: z39.string().optional(),
1554
+ var StackSchema = z40.object({
1555
+ $schema: z40.string().optional(),
1521
1556
  name: NameSchema,
1522
1557
  depends: DependsSchema,
1523
1558
  commands: CommandsSchema,