@awsless/awsless 0.0.583 → 0.0.585

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