@awsless/awsless 0.0.440 → 0.0.442

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -7566,7 +7566,7 @@ var debug = (...parts) => {
7566
7566
  };
7567
7567
 
7568
7568
  // src/config/app.ts
7569
- import { z as z25 } from "zod";
7569
+ import { z as z24 } from "zod";
7570
7570
 
7571
7571
  // src/feature/alert/schema.ts
7572
7572
  import { paramCase } from "change-case";
@@ -7588,7 +7588,7 @@ var AlertsDefaultSchema = z2.record(
7588
7588
  ).optional().describe("Define the alerts in your app. Alerts are a way to send messages to one or more email addresses.");
7589
7589
 
7590
7590
  // src/feature/auth/schema.ts
7591
- import { z as z9 } from "zod";
7591
+ import { z as z8 } from "zod";
7592
7592
 
7593
7593
  // src/config/schema/resource-id.ts
7594
7594
  import { paramCase as paramCase2 } from "change-case";
@@ -7598,7 +7598,7 @@ var ResourceIdSchema = z3.string().min(3).max(24).regex(/^[a-z0-9\-]+$/i, "Inval
7598
7598
  // src/feature/function/schema.ts
7599
7599
  import { days, minutes as minutes2, seconds, toDays } from "@awsless/duration";
7600
7600
  import { gibibytes, mebibytes } from "@awsless/size";
7601
- import { z as z8 } from "zod";
7601
+ import { z as z7 } from "zod";
7602
7602
 
7603
7603
  // src/config/schema/duration.ts
7604
7604
  import { z as z4 } from "zod";
@@ -7616,11 +7616,9 @@ var durationMax = (max) => {
7616
7616
  };
7617
7617
 
7618
7618
  // src/config/schema/local-directory.ts
7619
- import { stat as stat2 } from "fs/promises";
7620
- import { z as z6 } from "zod";
7621
-
7622
- // src/config/schema/local-file.ts
7623
7619
  import { stat } from "fs/promises";
7620
+
7621
+ // src/config/schema/relative-path.ts
7624
7622
  import { join as join3 } from "path";
7625
7623
  import { z as z5 } from "zod";
7626
7624
  var basePath;
@@ -7631,31 +7629,35 @@ var resolvePath = (path) => {
7631
7629
  if (path.startsWith(".") && basePath) {
7632
7630
  return join3(basePath, path);
7633
7631
  }
7634
- return join3(directories.root, path);
7632
+ return path;
7635
7633
  };
7636
- var LocalFileSchema = z5.string().transform((path) => resolvePath(path)).refine(async (path) => {
7634
+ var RelativePathSchema = z5.string().transform((path) => resolvePath(path));
7635
+
7636
+ // src/config/schema/local-directory.ts
7637
+ var LocalDirectorySchema = RelativePathSchema.refine(async (path) => {
7637
7638
  try {
7638
7639
  const s = await stat(path);
7639
- return s.isFile();
7640
+ return s.isDirectory();
7640
7641
  } catch (error) {
7641
7642
  return false;
7642
7643
  }
7643
- }, `File doesn't exist`);
7644
+ }, `Directory doesn't exist`);
7644
7645
 
7645
- // src/config/schema/local-directory.ts
7646
- var LocalDirectorySchema = z6.string().transform((path) => resolvePath(path)).refine(async (path) => {
7646
+ // src/config/schema/local-file.ts
7647
+ import { stat as stat2 } from "fs/promises";
7648
+ var LocalFileSchema = RelativePathSchema.refine(async (path) => {
7647
7649
  try {
7648
7650
  const s = await stat2(path);
7649
- return s.isDirectory();
7651
+ return s.isFile();
7650
7652
  } catch (error) {
7651
7653
  return false;
7652
7654
  }
7653
- }, `Directory doesn't exist`);
7655
+ }, `File doesn't exist`);
7654
7656
 
7655
7657
  // src/config/schema/size.ts
7656
- import { z as z7 } from "zod";
7658
+ import { z as z6 } from "zod";
7657
7659
  import { parse as parse2 } from "@awsless/size";
7658
- var SizeSchema = z7.string().regex(/^[0-9]+ (B|KB|MB|GB|TB|PB)$/, "Invalid size").transform((v) => parse2(v));
7660
+ var SizeSchema = z6.string().regex(/^[0-9]+ (B|KB|MB|GB|TB|PB)$/, "Invalid size").transform((v) => parse2(v));
7659
7661
  var sizeMin = (min) => {
7660
7662
  return (size) => {
7661
7663
  return size.value >= min.value;
@@ -7678,32 +7680,32 @@ var EphemeralStorageSizeSchema = SizeSchema.refine(
7678
7680
  sizeMin(mebibytes(512)),
7679
7681
  "Minimum ephemeral storage size is 512 MB"
7680
7682
  ).refine(sizeMax(gibibytes(10)), "Minimum ephemeral storage size is 10 GB").describe("The size of the function's /tmp directory. You can specify a size value from 512 MB to 10 GB.");
7681
- var ReservedConcurrentExecutionsSchema = z8.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
7682
- var EnvironmentSchema = z8.record(z8.string(), z8.string()).optional().describe("Environment variable key-value pairs.");
7683
- var ArchitectureSchema = z8.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
7684
- var RetryAttemptsSchema = z8.number().int().min(0).max(2).describe(
7683
+ var ReservedConcurrentExecutionsSchema = z7.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
7684
+ var EnvironmentSchema = z7.record(z7.string(), z7.string()).optional().describe("Environment variable key-value pairs.");
7685
+ var ArchitectureSchema = z7.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
7686
+ var RetryAttemptsSchema = z7.number().int().min(0).max(2).describe(
7685
7687
  "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
7686
7688
  );
7687
- var NodeRuntimeSchema = z8.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]);
7688
- var ContainerRuntimeSchema = z8.literal("container");
7689
+ var NodeRuntimeSchema = z7.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]);
7690
+ var ContainerRuntimeSchema = z7.literal("container");
7689
7691
  var RuntimeSchema = NodeRuntimeSchema.or(ContainerRuntimeSchema).describe("The identifier of the function's runtime.");
7690
- var ActionSchema = z8.string();
7691
- var ActionsSchema = z8.union([ActionSchema.transform((v) => [v]), ActionSchema.array()]);
7692
- var ArnSchema = z8.string().startsWith("arn:").transform((v) => v);
7693
- var WildcardSchema = z8.literal("*");
7694
- var ResourceSchema = z8.union([ArnSchema, WildcardSchema]);
7695
- var ResourcesSchema = z8.union([ResourceSchema.transform((v) => [v]), ResourceSchema.array()]);
7696
- var PermissionSchema = z8.object({
7697
- effect: z8.enum(["allow", "deny"]).default("allow"),
7692
+ var ActionSchema = z7.string();
7693
+ var ActionsSchema = z7.union([ActionSchema.transform((v) => [v]), ActionSchema.array()]);
7694
+ var ArnSchema = z7.string().startsWith("arn:").transform((v) => v);
7695
+ var WildcardSchema = z7.literal("*");
7696
+ var ResourceSchema = z7.union([ArnSchema, WildcardSchema]);
7697
+ var ResourcesSchema = z7.union([ResourceSchema.transform((v) => [v]), ResourceSchema.array()]);
7698
+ var PermissionSchema = z7.object({
7699
+ effect: z7.enum(["allow", "deny"]).default("allow"),
7698
7700
  actions: ActionsSchema,
7699
7701
  resources: ResourcesSchema
7700
7702
  });
7701
- var PermissionsSchema = z8.union([PermissionSchema.transform((v) => [v]), PermissionSchema.array()]).describe("Add IAM permissions to your function.");
7702
- var WarmSchema = z8.number().int().min(0).max(10).describe("Specify how many functions you want to warm up each 5 minutes. You can specify a number from 0 to 10.");
7703
- var VPCSchema = z8.boolean().describe("Put the function inside your global VPC.");
7704
- var MinifySchema = z8.boolean().describe("Minify the function code.");
7705
- var HandlerSchema = z8.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
7706
- var DescriptionSchema = z8.string().describe("A description of the function.");
7703
+ var PermissionsSchema = z7.union([PermissionSchema.transform((v) => [v]), PermissionSchema.array()]).describe("Add IAM permissions to your function.");
7704
+ var WarmSchema = z7.number().int().min(0).max(10).describe("Specify how many functions you want to warm up each 5 minutes. You can specify a number from 0 to 10.");
7705
+ var VPCSchema = z7.boolean().describe("Put the function inside your global VPC.");
7706
+ var MinifySchema = z7.boolean().describe("Minify the function code.");
7707
+ var HandlerSchema = z7.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
7708
+ var DescriptionSchema = z7.string().describe("A description of the function.");
7707
7709
  var validLogRetentionDays = [
7708
7710
  ...[1n, 3n, 5n, 7n, 14n, 30n, 60n, 90n, 120n, 150n],
7709
7711
  ...[180n, 365n, 400n, 545n, 731n, 1096n, 1827n, 2192n],
@@ -7718,56 +7720,54 @@ var LogRetentionSchema = DurationSchema.refine(
7718
7720
  },
7719
7721
  `Invalid log retention. Valid days are: ${validLogRetentionDays.map((days7) => `${days7}`).join(", ")}`
7720
7722
  ).describe("The log retention duration.");
7721
- var LogSubscriptionSchema = z8.union([
7723
+ var LogSubscriptionSchema = z7.union([
7722
7724
  LocalFileSchema.transform((file) => ({
7723
7725
  file
7724
7726
  })),
7725
- z8.object({
7727
+ z7.object({
7726
7728
  subscriber: LocalFileSchema,
7727
- filter: z8.string().optional()
7729
+ filter: z7.string().optional()
7728
7730
  })
7729
7731
  ]).describe(
7730
7732
  "Log Subscription allow you to subscribe to a real-time stream of log events and have them delivered to a specific destination"
7731
7733
  );
7732
- var LogSchema = z8.union([
7733
- z8.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
7734
+ var LogSchema = z7.union([
7735
+ z7.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
7734
7736
  LogRetentionSchema.transform((retention) => ({ retention })),
7735
- z8.object({
7737
+ z7.object({
7736
7738
  subscription: LogSubscriptionSchema.optional(),
7737
7739
  retention: LogRetentionSchema.optional(),
7738
- format: z8.enum(["text", "json"]).describe(
7740
+ format: z7.enum(["text", "json"]).describe(
7739
7741
  `The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.`
7740
7742
  ).optional(),
7741
- system: z8.enum(["debug", "info", "warn"]).describe(
7743
+ system: z7.enum(["debug", "info", "warn"]).describe(
7742
7744
  "Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest."
7743
7745
  ).optional(),
7744
- level: z8.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
7746
+ level: z7.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
7745
7747
  "Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest."
7746
7748
  ).optional()
7747
7749
  })
7748
7750
  ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
7749
- var LayersSchema = z8.string().array().describe(
7751
+ var LayersSchema = z7.string().array().describe(
7750
7752
  // `A list of function layers to add to the function's execution environment..`
7751
7753
  `A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.`
7752
7754
  );
7753
- var FileCodeSchema = z8.object({
7755
+ var FileCodeSchema = z7.object({
7754
7756
  file: LocalFileSchema.describe("The file path of the function code."),
7755
7757
  minify: MinifySchema.optional().default(true),
7756
- external: z8.string().array().optional().describe(`A list of external packages that won't be included in the bundle.`)
7758
+ external: z7.string().array().optional().describe(`A list of external packages that won't be included in the bundle.`)
7757
7759
  });
7758
- var BundleCodeSchema = z8.object({
7760
+ var BundleCodeSchema = z7.object({
7759
7761
  bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
7760
7762
  });
7761
- var CodeSchema = z8.union([
7762
- LocalFileSchema.transform(
7763
- (file) => FileCodeSchema.parse({
7764
- file
7765
- })
7766
- ),
7763
+ var CodeSchema = z7.union([
7764
+ LocalFileSchema.transform((file) => ({
7765
+ file
7766
+ })).pipe(FileCodeSchema),
7767
7767
  FileCodeSchema,
7768
7768
  BundleCodeSchema
7769
7769
  ]).describe("Specify the code of your function.");
7770
- var FnSchema = z8.object({
7770
+ var FnSchema = z7.object({
7771
7771
  code: CodeSchema,
7772
7772
  // node
7773
7773
  handler: HandlerSchema.optional(),
@@ -7790,16 +7790,14 @@ var FnSchema = z8.object({
7790
7790
  environment: EnvironmentSchema.optional(),
7791
7791
  permissions: PermissionsSchema.optional()
7792
7792
  });
7793
- var FunctionSchema = z8.union([
7794
- LocalFileSchema.transform((file) => ({
7795
- code: FileCodeSchema.parse({
7796
- file
7797
- })
7798
- })),
7793
+ var FunctionSchema = z7.union([
7794
+ LocalFileSchema.transform((code) => ({
7795
+ code
7796
+ })).pipe(FnSchema),
7799
7797
  FnSchema
7800
7798
  ]);
7801
- var FunctionsSchema = z8.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
7802
- var FunctionDefaultSchema = z8.object({
7799
+ var FunctionsSchema = z7.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
7800
+ var FunctionDefaultSchema = z7.object({
7803
7801
  runtime: RuntimeSchema.default("nodejs20.x"),
7804
7802
  // node
7805
7803
  handler: HandlerSchema.default("index.default"),
@@ -7828,7 +7826,7 @@ var FunctionDefaultSchema = z8.object({
7828
7826
  }).default({});
7829
7827
 
7830
7828
  // src/feature/auth/schema.ts
7831
- var TriggersSchema = z9.object({
7829
+ var TriggersSchema = z8.object({
7832
7830
  beforeToken: FunctionSchema.optional().describe("A pre jwt token generation AWS Lambda trigger."),
7833
7831
  beforeLogin: FunctionSchema.optional().describe("A pre user login AWS Lambda trigger."),
7834
7832
  afterLogin: FunctionSchema.optional().describe("A post user login AWS Lambda trigger."),
@@ -7841,42 +7839,42 @@ var TriggersSchema = z9.object({
7841
7839
  createChallenge: FunctionSchema.optional().describe("Creates an authentication challenge."),
7842
7840
  verifyChallenge: FunctionSchema.optional().describe("Verifies the authentication challenge response.")
7843
7841
  }).describe("Specifies the configuration for AWS Lambda triggers.");
7844
- var AuthSchema = z9.record(
7842
+ var AuthSchema = z8.record(
7845
7843
  ResourceIdSchema,
7846
- z9.object({
7847
- access: z9.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
7844
+ z8.object({
7845
+ access: z8.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
7848
7846
  triggers: TriggersSchema.optional()
7849
7847
  })
7850
7848
  ).optional().describe("Define the auth triggers in your stack.");
7851
- var AuthDefaultSchema = z9.record(
7849
+ var AuthDefaultSchema = z8.record(
7852
7850
  ResourceIdSchema,
7853
- z9.object({
7854
- allowUserRegistration: z9.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
7855
- messaging: z9.object({
7851
+ z8.object({
7852
+ allowUserRegistration: z8.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
7853
+ messaging: z8.object({
7856
7854
  fromEmail: EmailSchema.describe("Specifies the sender's email address."),
7857
- fromName: z9.string().optional().describe("Specifies the sender's name."),
7855
+ fromName: z8.string().optional().describe("Specifies the sender's name."),
7858
7856
  replyTo: EmailSchema.optional().describe(
7859
7857
  "The destination to which the receiver of the email should reply."
7860
7858
  )
7861
7859
  }).optional().describe("The email configuration for sending messages."),
7862
7860
  // secret: z.boolean().default(false).describe('Specifies whether you want to generate a client secret.'),
7863
- username: z9.object({
7864
- emailAlias: z9.boolean().default(true).describe("Allow the user email to be used as username."),
7865
- caseSensitive: z9.boolean().default(false).describe(
7861
+ username: z8.object({
7862
+ emailAlias: z8.boolean().default(true).describe("Allow the user email to be used as username."),
7863
+ caseSensitive: z8.boolean().default(false).describe(
7866
7864
  "Specifies whether username case sensitivity will be enabled. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name."
7867
7865
  )
7868
7866
  }).default({}).describe("The username policy."),
7869
- password: z9.object({
7870
- minLength: z9.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
7871
- uppercase: z9.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
7872
- lowercase: z9.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
7873
- numbers: z9.boolean().default(true).describe("Required users to use at least one number in their password."),
7874
- symbols: z9.boolean().default(true).describe("Required users to use at least one symbol in their password."),
7867
+ password: z8.object({
7868
+ minLength: z8.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
7869
+ uppercase: z8.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
7870
+ lowercase: z8.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
7871
+ numbers: z8.boolean().default(true).describe("Required users to use at least one number in their password."),
7872
+ symbols: z8.boolean().default(true).describe("Required users to use at least one symbol in their password."),
7875
7873
  temporaryPasswordValidity: DurationSchema.default("7 days").describe(
7876
7874
  "The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
7877
7875
  )
7878
7876
  }).default({}).describe("The password policy."),
7879
- validity: z9.object({
7877
+ validity: z8.object({
7880
7878
  idToken: DurationSchema.default("1 hour").describe(
7881
7879
  "The ID token time limit. After this limit expires, your user can't use their ID token."
7882
7880
  ),
@@ -7892,18 +7890,18 @@ var AuthDefaultSchema = z9.record(
7892
7890
  ).default({}).describe("Define the authenticatable users in your app.");
7893
7891
 
7894
7892
  // src/feature/domain/schema.ts
7895
- import { z as z10 } from "zod";
7896
- var DomainNameSchema = z10.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
7893
+ import { z as z9 } from "zod";
7894
+ var DomainNameSchema = z9.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
7897
7895
  "Enter a fully qualified domain name, for example, www.example.com. You can optionally include a trailing dot. If you omit the trailing dot, Amazon Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical."
7898
7896
  );
7899
- var DNSTypeSchema = z10.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
7897
+ var DNSTypeSchema = z9.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
7900
7898
  var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
7901
- var RecordsSchema = z10.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
7902
- var DomainsDefaultSchema = z10.record(
7899
+ var RecordsSchema = z9.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
7900
+ var DomainsDefaultSchema = z9.record(
7903
7901
  ResourceIdSchema,
7904
- z10.object({
7902
+ z9.object({
7905
7903
  domain: DomainNameSchema.describe("Define the domain name"),
7906
- dns: z10.object({
7904
+ dns: z9.object({
7907
7905
  name: DomainNameSchema.optional(),
7908
7906
  type: DNSTypeSchema,
7909
7907
  ttl: TTLSchema,
@@ -7913,18 +7911,18 @@ var DomainsDefaultSchema = z10.record(
7913
7911
  ).optional().describe("Define the domains for your application.");
7914
7912
 
7915
7913
  // src/feature/graphql/schema.ts
7916
- import { z as z11 } from "zod";
7914
+ import { z as z10 } from "zod";
7917
7915
  var AuthorizerTtl = DurationSchema.describe(
7918
7916
  `The number of seconds a response should be cached for. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.`
7919
7917
  );
7920
- var GraphQLDefaultSchema = z11.record(
7918
+ var GraphQLDefaultSchema = z10.record(
7921
7919
  ResourceIdSchema,
7922
- z11.object({
7920
+ z10.object({
7923
7921
  domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
7924
- subDomain: z11.string().optional(),
7925
- auth: z11.union([
7922
+ subDomain: z10.string().optional(),
7923
+ auth: z10.union([
7926
7924
  ResourceIdSchema,
7927
- z11.object({
7925
+ z10.object({
7928
7926
  authorizer: FunctionSchema,
7929
7927
  ttl: AuthorizerTtl.default("1 hour")
7930
7928
  })
@@ -7936,22 +7934,22 @@ var GraphQLDefaultSchema = z11.record(
7936
7934
  resolver: LocalFileSchema.optional()
7937
7935
  })
7938
7936
  ).describe(`Define the global GraphQL API's.`).optional();
7939
- var GraphQLSchema = z11.record(
7937
+ var GraphQLSchema = z10.record(
7940
7938
  ResourceIdSchema,
7941
- z11.object({
7939
+ z10.object({
7942
7940
  // schema: z.union([LocalFileSchema.transform(v => [v]), z.array(LocalFileSchema).min(1)]).optional(),
7943
7941
  schema: LocalFileSchema.describe("The graphql schema file."),
7944
- resolvers: z11.record(
7942
+ resolvers: z10.record(
7945
7943
  // TypeName
7946
- z11.string(),
7947
- z11.record(
7944
+ z10.string(),
7945
+ z10.record(
7948
7946
  // FieldName
7949
- z11.string(),
7950
- z11.union([
7947
+ z10.string(),
7948
+ z10.union([
7951
7949
  FunctionSchema.transform((consumer) => ({
7952
7950
  consumer
7953
7951
  })),
7954
- z11.object({
7952
+ z10.object({
7955
7953
  consumer: FunctionSchema,
7956
7954
  resolver: LocalFileSchema.optional()
7957
7955
  })
@@ -7962,22 +7960,22 @@ var GraphQLSchema = z11.record(
7962
7960
  ).describe("Define the schema & resolvers in your stack for your global GraphQL API.").optional();
7963
7961
 
7964
7962
  // src/feature/http/schema.ts
7965
- import { z as z12 } from "zod";
7966
- var RouteSchema = z12.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
7967
- var HttpDefaultSchema = z12.record(
7963
+ import { z as z11 } from "zod";
7964
+ var RouteSchema = z11.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
7965
+ var HttpDefaultSchema = z11.record(
7968
7966
  ResourceIdSchema,
7969
- z12.object({
7967
+ z11.object({
7970
7968
  domain: ResourceIdSchema.describe("The domain id to link your API with."),
7971
- subDomain: z12.string().optional()
7969
+ subDomain: z11.string().optional()
7972
7970
  // auth: ResourceIdSchema.optional(),
7973
7971
  })
7974
7972
  ).optional().describe("Define your global HTTP API's.");
7975
- var HttpSchema = z12.record(ResourceIdSchema, z12.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
7973
+ var HttpSchema = z11.record(ResourceIdSchema, z11.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
7976
7974
 
7977
7975
  // src/feature/instance/schema.ts
7978
- import { z as z13 } from "zod";
7979
- var ImageSchema = z13.string().regex(/^ami\-[0-9a-f]+/).describe("The ID of the AMI.");
7980
- var TypeSchema = z13.enum([
7976
+ import { z as z12 } from "zod";
7977
+ var ImageSchema = z12.string().regex(/^ami\-[0-9a-f]+/).describe("The ID of the AMI.");
7978
+ var TypeSchema = z12.enum([
7981
7979
  "t3.nano",
7982
7980
  "t3.micro",
7983
7981
  "t3.small",
@@ -7995,59 +7993,59 @@ var TypeSchema = z13.enum([
7995
7993
  "g4ad.xlarge",
7996
7994
  "g4dn.xlarge"
7997
7995
  ]).describe(`The instance type.`);
7998
- var CommandSchema = z13.string().describe(`The script you want to execute when the instance starts up.`);
7996
+ var CommandSchema = z12.string().describe(`The script you want to execute when the instance starts up.`);
7999
7997
  var CodeSchema2 = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
8000
- var ConnectSchema = z13.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
8001
- var EnvironmentSchema2 = z13.record(z13.string(), z13.string()).optional().describe("Environment variable key-value pairs.");
8002
- var ActionSchema2 = z13.string();
8003
- var ActionsSchema2 = z13.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
8004
- var ArnSchema2 = z13.string().startsWith("arn:");
8005
- var WildcardSchema2 = z13.literal("*");
8006
- var ResourceSchema2 = z13.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
8007
- var ResourcesSchema2 = z13.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
8008
- var PermissionSchema2 = z13.object({
8009
- effect: z13.enum(["allow", "deny"]).default("allow"),
7998
+ var ConnectSchema = z12.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
7999
+ var EnvironmentSchema2 = z12.record(z12.string(), z12.string()).optional().describe("Environment variable key-value pairs.");
8000
+ var ActionSchema2 = z12.string();
8001
+ var ActionsSchema2 = z12.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
8002
+ var ArnSchema2 = z12.string().startsWith("arn:");
8003
+ var WildcardSchema2 = z12.literal("*");
8004
+ var ResourceSchema2 = z12.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
8005
+ var ResourcesSchema2 = z12.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
8006
+ var PermissionSchema2 = z12.object({
8007
+ effect: z12.enum(["allow", "deny"]).default("allow"),
8010
8008
  actions: ActionsSchema2,
8011
8009
  resources: ResourcesSchema2
8012
8010
  });
8013
- var PermissionsSchema2 = z13.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
8014
- var InstanceDefaultSchema = z13.object({
8011
+ var PermissionsSchema2 = z12.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
8012
+ var InstanceDefaultSchema = z12.object({
8015
8013
  connect: ConnectSchema.default(false)
8016
8014
  }).default({}).describe("Define the default settings for all instances in your stacks.");
8017
- var InstancesSchema = z13.record(
8015
+ var InstancesSchema = z12.record(
8018
8016
  ResourceIdSchema,
8019
- z13.object({
8017
+ z12.object({
8020
8018
  image: ImageSchema,
8021
8019
  type: TypeSchema,
8022
8020
  code: CodeSchema2,
8023
- user: z13.string().default("ec2-user"),
8021
+ user: z12.string().default("ec2-user"),
8024
8022
  command: CommandSchema.optional(),
8025
8023
  environment: EnvironmentSchema2.optional(),
8026
8024
  permissions: PermissionsSchema2.optional(),
8027
- waitForTermination: z13.boolean().default(true)
8025
+ waitForTermination: z12.boolean().default(true)
8028
8026
  })
8029
8027
  ).optional().describe("Define the instances in your stack.");
8030
8028
 
8031
8029
  // src/feature/layer/schema.ts
8032
- import { z as z15 } from "zod";
8030
+ import { z as z14 } from "zod";
8033
8031
 
8034
8032
  // src/config/schema/lambda.ts
8035
- import { z as z14 } from "zod";
8036
- var ArchitectureSchema2 = z14.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
8037
- var NodeRuntimeSchema2 = z14.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).describe("The identifier of the function's runtime.");
8033
+ import { z as z13 } from "zod";
8034
+ var ArchitectureSchema2 = z13.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
8035
+ var NodeRuntimeSchema2 = z13.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).describe("The identifier of the function's runtime.");
8038
8036
 
8039
8037
  // src/feature/layer/schema.ts
8040
- var Schema = z15.object({
8038
+ var Schema = z14.object({
8041
8039
  file: LocalFileSchema,
8042
8040
  runtimes: NodeRuntimeSchema2.array().optional(),
8043
8041
  architecture: ArchitectureSchema2.optional(),
8044
- packages: z15.string().array().optional().describe(
8042
+ packages: z14.string().array().optional().describe(
8045
8043
  "Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
8046
8044
  )
8047
8045
  });
8048
- var LayerSchema = z15.record(
8049
- z15.string(),
8050
- z15.union([
8046
+ var LayerSchema = z14.record(
8047
+ z14.string(),
8048
+ z14.union([
8051
8049
  LocalFileSchema.transform((file) => ({
8052
8050
  file,
8053
8051
  description: void 0
@@ -8062,28 +8060,28 @@ var OnFailureDefaultSchema = FunctionSchema.optional().describe(
8062
8060
  );
8063
8061
 
8064
8062
  // src/feature/on-log/schema.ts
8065
- import { z as z16 } from "zod";
8066
- var FilterSchema = z16.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
8067
- var OnLogDefaultSchema = z16.union([
8063
+ import { z as z15 } from "zod";
8064
+ var FilterSchema = z15.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
8065
+ var OnLogDefaultSchema = z15.union([
8068
8066
  FunctionSchema.transform((consumer) => ({
8069
8067
  consumer,
8070
8068
  filter: ["error", "fatal"]
8071
8069
  })),
8072
- z16.object({
8070
+ z15.object({
8073
8071
  consumer: FunctionSchema,
8074
8072
  filter: FilterSchema
8075
8073
  })
8076
8074
  ]).optional().describe("Define a subscription on all Lambda functions logs.");
8077
8075
 
8078
8076
  // src/feature/pubsub/schema.ts
8079
- import { z as z17 } from "zod";
8077
+ import { z as z16 } from "zod";
8080
8078
  var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
8081
- var PubSubDefaultSchema = z17.record(
8079
+ var PubSubDefaultSchema = z16.record(
8082
8080
  ResourceIdSchema,
8083
- z17.object({
8081
+ z16.object({
8084
8082
  auth: FunctionSchema,
8085
8083
  domain: DomainSchema.optional(),
8086
- subDomain: z17.string().optional()
8084
+ subDomain: z16.string().optional()
8087
8085
  // auth: z.union([
8088
8086
  // ResourceIdSchema,
8089
8087
  // z.object({
@@ -8099,11 +8097,11 @@ var PubSubDefaultSchema = z17.record(
8099
8097
  // .optional(),
8100
8098
  })
8101
8099
  ).optional().describe("Define the pubsub subscriber in your stack.");
8102
- var PubSubSchema = z17.record(
8100
+ var PubSubSchema = z16.record(
8103
8101
  ResourceIdSchema,
8104
- z17.object({
8105
- sql: z17.string().describe("The SQL statement used to query the IOT topic."),
8106
- sqlVersion: z17.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
8102
+ z16.object({
8103
+ sql: z16.string().describe("The SQL statement used to query the IOT topic."),
8104
+ sqlVersion: z16.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
8107
8105
  consumer: FunctionSchema.describe("The consuming lambda function properties.")
8108
8106
  })
8109
8107
  ).optional().describe("Define the pubsub subscriber in your stack.");
@@ -8111,7 +8109,7 @@ var PubSubSchema = z17.record(
8111
8109
  // src/feature/queue/schema.ts
8112
8110
  import { days as days2, hours, minutes as minutes3, seconds as seconds2 } from "@awsless/duration";
8113
8111
  import { kibibytes } from "@awsless/size";
8114
- import { z as z18 } from "zod";
8112
+ import { z as z17 } from "zod";
8115
8113
  var RetentionPeriodSchema = DurationSchema.refine(
8116
8114
  durationMin(minutes3(1)),
8117
8115
  "Minimum retention period is 1 minute"
@@ -8139,10 +8137,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
8139
8137
  var MaxMessageSizeSchema = SizeSchema.refine(sizeMin(kibibytes(1)), "Minimum max message size is 1 KB").refine(sizeMax(kibibytes(256)), "Maximum max message size is 256 KB").describe(
8140
8138
  "The limit of how many bytes that a message can contain before Amazon SQS rejects it. You can specify an size from 1 KB to 256 KB."
8141
8139
  );
8142
- var BatchSizeSchema = z18.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
8140
+ var BatchSizeSchema = z17.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
8143
8141
  "The maximum number of records in each batch that Lambda pulls from your queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB). You can specify an integer from 1 to 10000."
8144
8142
  );
8145
- var MaxConcurrencySchema = z18.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
8143
+ var MaxConcurrencySchema = z17.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
8146
8144
  "Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
8147
8145
  );
8148
8146
  var MaxBatchingWindow = DurationSchema.refine(
@@ -8151,7 +8149,7 @@ var MaxBatchingWindow = DurationSchema.refine(
8151
8149
  ).describe(
8152
8150
  "The maximum amount of time, that Lambda spends gathering records before invoking the function. You can specify an duration from 0 seconds to 5 minutes."
8153
8151
  );
8154
- var QueueDefaultSchema = z18.object({
8152
+ var QueueDefaultSchema = z17.object({
8155
8153
  retentionPeriod: RetentionPeriodSchema.default("7 days"),
8156
8154
  visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
8157
8155
  deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
@@ -8161,82 +8159,81 @@ var QueueDefaultSchema = z18.object({
8161
8159
  maxConcurrency: MaxConcurrencySchema.optional(),
8162
8160
  maxBatchingWindow: MaxBatchingWindow.optional()
8163
8161
  }).default({});
8164
- var QueuesSchema = z18.record(
8162
+ var QueueSchema = z17.object({
8163
+ consumer: FunctionSchema.describe("The consuming lambda function properties."),
8164
+ retentionPeriod: RetentionPeriodSchema.optional(),
8165
+ visibilityTimeout: VisibilityTimeoutSchema.optional(),
8166
+ deliveryDelay: DeliveryDelaySchema.optional(),
8167
+ receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
8168
+ maxMessageSize: MaxMessageSizeSchema.optional(),
8169
+ batchSize: BatchSizeSchema.optional(),
8170
+ maxConcurrency: MaxConcurrencySchema.optional(),
8171
+ maxBatchingWindow: MaxBatchingWindow.optional()
8172
+ });
8173
+ var QueuesSchema = z17.record(
8165
8174
  ResourceIdSchema,
8166
- z18.union([
8167
- LocalFileSchema.transform((code) => ({
8168
- consumer: FunctionSchema.parse({
8169
- code
8170
- })
8171
- })),
8172
- z18.object({
8173
- consumer: FunctionSchema.describe("The consuming lambda function properties."),
8174
- retentionPeriod: RetentionPeriodSchema.optional(),
8175
- visibilityTimeout: VisibilityTimeoutSchema.optional(),
8176
- deliveryDelay: DeliveryDelaySchema.optional(),
8177
- receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
8178
- maxMessageSize: MaxMessageSizeSchema.optional(),
8179
- batchSize: BatchSizeSchema.optional(),
8180
- maxConcurrency: MaxConcurrencySchema.optional(),
8181
- maxBatchingWindow: MaxBatchingWindow.optional()
8182
- })
8175
+ z17.union([
8176
+ LocalFileSchema.transform((consumer) => ({
8177
+ consumer
8178
+ })).pipe(QueueSchema),
8179
+ QueueSchema
8183
8180
  ])
8184
8181
  ).optional().describe("Define the queues in your stack.");
8185
8182
 
8186
8183
  // src/feature/rest/schema.ts
8187
- import { z as z20 } from "zod";
8184
+ import { z as z19 } from "zod";
8188
8185
 
8189
8186
  // src/config/schema/route.ts
8190
- import { z as z19 } from "zod";
8191
- var RouteSchema2 = z19.union([
8192
- z19.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
8193
- z19.literal("$default")
8187
+ import { z as z18 } from "zod";
8188
+ var RouteSchema2 = z18.union([
8189
+ z18.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
8190
+ z18.literal("$default")
8194
8191
  ]);
8195
8192
 
8196
8193
  // src/feature/rest/schema.ts
8197
- var RestDefaultSchema = z20.record(
8194
+ var RestDefaultSchema = z19.record(
8198
8195
  ResourceIdSchema,
8199
- z20.object({
8196
+ z19.object({
8200
8197
  domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
8201
- subDomain: z20.string().optional()
8198
+ subDomain: z19.string().optional()
8202
8199
  })
8203
8200
  ).optional().describe("Define your global REST API's.");
8204
- var RestSchema = z20.record(ResourceIdSchema, z20.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
8201
+ var RestSchema = z19.record(ResourceIdSchema, z19.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
8205
8202
 
8206
8203
  // src/feature/rpc/schema.ts
8207
- import { z as z21 } from "zod";
8208
- var RpcDefaultSchema = z21.record(
8204
+ import { z as z20 } from "zod";
8205
+ var RpcDefaultSchema = z20.record(
8209
8206
  ResourceIdSchema,
8210
- z21.object({
8207
+ z20.object({
8211
8208
  domain: ResourceIdSchema.describe("The domain id to link your RPC API with.").optional(),
8212
- subDomain: z21.string().optional(),
8209
+ subDomain: z20.string().optional(),
8213
8210
  auth: FunctionSchema.optional(),
8214
8211
  log: LogSchema.optional()
8215
8212
  })
8216
8213
  ).describe(`Define the global RPC API's.`).optional();
8217
- var RpcSchema = z21.record(ResourceIdSchema, z21.record(z21.string(), FunctionSchema).describe("The queries for your global RPC API.")).describe("Define the schema in your stack for your global RPC API.").optional();
8214
+ 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();
8218
8215
 
8219
8216
  // src/feature/store/schema.ts
8220
- import { z as z22 } from "zod";
8221
- var DeletionProtectionSchema = z22.boolean().describe("Specifies if you want to protect the store from being deleted by awsless.");
8222
- var StoreDefaultSchema = z22.object({
8217
+ import { z as z21 } from "zod";
8218
+ var DeletionProtectionSchema = z21.boolean().describe("Specifies if you want to protect the store from being deleted by awsless.");
8219
+ var StoreDefaultSchema = z21.object({
8223
8220
  deletionProtection: DeletionProtectionSchema.optional()
8224
8221
  }).optional();
8225
- var StoresSchema = z22.union([
8226
- z22.array(ResourceIdSchema).transform((list4) => {
8222
+ var StoresSchema = z21.union([
8223
+ z21.array(ResourceIdSchema).transform((list4) => {
8227
8224
  const stores = {};
8228
8225
  for (const key of list4) {
8229
8226
  stores[key] = {};
8230
8227
  }
8231
8228
  return stores;
8232
8229
  }),
8233
- z22.record(
8230
+ z21.record(
8234
8231
  ResourceIdSchema,
8235
- z22.object({
8232
+ z21.object({
8236
8233
  // cors: CorsSchema,
8237
8234
  deletionProtection: DeletionProtectionSchema.optional(),
8238
- versioning: z22.boolean().default(false).describe("Enable versioning of your store."),
8239
- events: z22.object({
8235
+ versioning: z21.boolean().default(false).describe("Enable versioning of your store."),
8236
+ events: z21.object({
8240
8237
  // create
8241
8238
  "created:*": FunctionSchema.optional().describe(
8242
8239
  "Subscribe to notifications regardless of the API that was used to create an object."
@@ -8269,41 +8266,41 @@ var StoresSchema = z22.union([
8269
8266
  ]).optional().describe("Define the stores in your stack.");
8270
8267
 
8271
8268
  // src/feature/table/schema.ts
8272
- import { z as z23 } from "zod";
8273
- var KeySchema = z23.string().min(1).max(255);
8274
- var DeletionProtectionSchema2 = z23.boolean().describe("Specifies if you want to protect the table from being deleted by awsless.");
8275
- var TableDefaultSchema = z23.object({
8269
+ import { z as z22 } from "zod";
8270
+ var KeySchema = z22.string().min(1).max(255);
8271
+ var DeletionProtectionSchema2 = z22.boolean().describe("Specifies if you want to protect the table from being deleted by awsless.");
8272
+ var TableDefaultSchema = z22.object({
8276
8273
  deletionProtection: DeletionProtectionSchema2.optional()
8277
8274
  }).optional();
8278
- var TablesSchema = z23.record(
8275
+ var TablesSchema = z22.record(
8279
8276
  ResourceIdSchema,
8280
- z23.object({
8277
+ z22.object({
8281
8278
  hash: KeySchema.describe(
8282
8279
  "Specifies the name of the partition / hash key that makes up the primary key for the table."
8283
8280
  ),
8284
8281
  sort: KeySchema.optional().describe(
8285
8282
  "Specifies the name of the range / sort key that makes up the primary key for the table."
8286
8283
  ),
8287
- fields: z23.record(z23.string(), z23.enum(["string", "number", "binary"])).optional().describe(
8284
+ fields: z22.record(z22.string(), z22.enum(["string", "number", "binary"])).optional().describe(
8288
8285
  'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
8289
8286
  ),
8290
- class: z23.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
8291
- pointInTimeRecovery: z23.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
8287
+ class: z22.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
8288
+ pointInTimeRecovery: z22.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
8292
8289
  timeToLiveAttribute: KeySchema.optional().describe(
8293
8290
  "The name of the TTL attribute used to store the expiration time for items in the table. To update this property, you must first disable TTL and then enable TTL with the new attribute name."
8294
8291
  ),
8295
8292
  deletionProtection: DeletionProtectionSchema2.optional(),
8296
- stream: z23.object({
8297
- type: z23.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
8293
+ stream: z22.object({
8294
+ type: z22.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
8298
8295
  "When an item in the table is modified, stream.type determines what information is written to the stream for this table. Valid values are:\n- keys-only - Only the key attributes of the modified item are written to the stream.\n- new-image - The entire item, as it appears after it was modified, is written to the stream.\n- old-image - The entire item, as it appeared before it was modified, is written to the stream.\n- new-and-old-images - Both the new and the old item images of the item are written to the stream."
8299
8296
  ),
8300
8297
  consumer: FunctionSchema.describe("The consuming lambda function for the stream")
8301
8298
  }).optional().describe(
8302
8299
  "The settings for the DynamoDB table stream, which capture changes to items stored in the table."
8303
8300
  ),
8304
- indexes: z23.record(
8305
- z23.string(),
8306
- z23.object({
8301
+ indexes: z22.record(
8302
+ z22.string(),
8303
+ z22.object({
8307
8304
  /** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
8308
8305
  hash: KeySchema,
8309
8306
  /** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
@@ -8313,14 +8310,14 @@ var TablesSchema = z23.record(
8313
8310
  * - keys-only - Only the index and primary keys are projected into the index.
8314
8311
  * @default 'all'
8315
8312
  */
8316
- projection: z23.enum(["all", "keys-only"]).default("all")
8313
+ projection: z22.enum(["all", "keys-only"]).default("all")
8317
8314
  })
8318
8315
  ).optional().describe("Specifies the global secondary indexes to be created on the table.")
8319
8316
  })
8320
8317
  ).optional().describe("Define the tables in your stack.");
8321
8318
 
8322
8319
  // src/config/schema/region.ts
8323
- import { z as z24 } from "zod";
8320
+ import { z as z23 } from "zod";
8324
8321
  var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
8325
8322
  var AF = ["af-south-1"];
8326
8323
  var AP = [
@@ -8349,21 +8346,21 @@ var EU = [
8349
8346
  var ME = ["me-south-1", "me-central-1"];
8350
8347
  var SA = ["sa-east-1"];
8351
8348
  var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
8352
- var RegionSchema = z24.enum(regions);
8349
+ var RegionSchema = z23.enum(regions);
8353
8350
 
8354
8351
  // src/config/app.ts
8355
- var AppSchema = z25.object({
8356
- $schema: z25.string().optional(),
8352
+ var AppSchema = z24.object({
8353
+ $schema: z24.string().optional(),
8357
8354
  name: ResourceIdSchema.describe("App name."),
8358
8355
  region: RegionSchema.describe("The AWS region to deploy to."),
8359
- profile: z25.string().describe("The AWS profile to deploy to."),
8356
+ profile: z24.string().describe("The AWS profile to deploy to."),
8360
8357
  // stage: z
8361
8358
  // .string()
8362
8359
  // .regex(/^[a-z]+$/)
8363
8360
  // .default('prod')
8364
8361
  // .describe('The deployment stage.'),
8365
8362
  // onFailure: OnFailureSchema,
8366
- defaults: z25.object({
8363
+ defaults: z24.object({
8367
8364
  onFailure: OnFailureDefaultSchema,
8368
8365
  onLog: OnLogDefaultSchema,
8369
8366
  auth: AuthDefaultSchema,
@@ -8385,11 +8382,11 @@ var AppSchema = z25.object({
8385
8382
  });
8386
8383
 
8387
8384
  // src/config/stack.ts
8388
- import { z as z37 } from "zod";
8385
+ import { z as z36 } from "zod";
8389
8386
 
8390
8387
  // src/feature/cache/schema.ts
8391
- import { z as z26 } from "zod";
8392
- var TypeSchema2 = z26.enum([
8388
+ import { z as z25 } from "zod";
8389
+ var TypeSchema2 = z25.enum([
8393
8390
  "t4g.small",
8394
8391
  "t4g.medium",
8395
8392
  "r6g.large",
@@ -8404,29 +8401,29 @@ var TypeSchema2 = z26.enum([
8404
8401
  "r6gd.4xlarge",
8405
8402
  "r6gd.8xlarge"
8406
8403
  ]);
8407
- var PortSchema = z26.number().int().min(1).max(5e4);
8408
- var ShardsSchema = z26.number().int().min(0).max(100);
8409
- var ReplicasPerShardSchema = z26.number().int().min(0).max(5);
8410
- var EngineSchema = z26.enum(["7.0", "6.2"]);
8411
- var CachesSchema = z26.record(
8404
+ var PortSchema = z25.number().int().min(1).max(5e4);
8405
+ var ShardsSchema = z25.number().int().min(0).max(100);
8406
+ var ReplicasPerShardSchema = z25.number().int().min(0).max(5);
8407
+ var EngineSchema = z25.enum(["7.0", "6.2"]);
8408
+ var CachesSchema = z25.record(
8412
8409
  ResourceIdSchema,
8413
- z26.object({
8410
+ z25.object({
8414
8411
  type: TypeSchema2.default("t4g.small"),
8415
8412
  port: PortSchema.default(6379),
8416
8413
  shards: ShardsSchema.default(1),
8417
8414
  replicasPerShard: ReplicasPerShardSchema.default(1),
8418
8415
  engine: EngineSchema.default("7.0"),
8419
- dataTiering: z26.boolean().default(false)
8416
+ dataTiering: z25.boolean().default(false)
8420
8417
  })
8421
8418
  ).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
8422
8419
 
8423
8420
  // src/feature/command/schema.ts
8424
- import { z as z27 } from "zod";
8425
- var CommandSchema2 = z27.union([
8426
- z27.object({
8421
+ import { z as z26 } from "zod";
8422
+ var CommandSchema2 = z26.union([
8423
+ z26.object({
8427
8424
  file: LocalFileSchema,
8428
- handler: z27.string().default("default").describe("The name of the handler that needs to run"),
8429
- description: z27.string().optional().describe("A description of the command")
8425
+ handler: z26.string().default("default").describe("The name of the handler that needs to run"),
8426
+ description: z26.string().optional().describe("A description of the command")
8430
8427
  // options: z.record(ResourceIdSchema, OptionSchema).optional(),
8431
8428
  // arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
8432
8429
  }),
@@ -8436,22 +8433,22 @@ var CommandSchema2 = z27.union([
8436
8433
  description: void 0
8437
8434
  }))
8438
8435
  ]);
8439
- var CommandsSchema = z27.record(ResourceIdSchema, CommandSchema2).optional().describe("Define the custom commands for your stack.");
8436
+ var CommandsSchema = z26.record(ResourceIdSchema, CommandSchema2).optional().describe("Define the custom commands for your stack.");
8440
8437
 
8441
8438
  // src/feature/config/schema.ts
8442
- import { z as z28 } from "zod";
8443
- var ConfigNameSchema = z28.string().regex(/[a-z0-9\-]/g, "Invalid config name");
8444
- var ConfigsSchema = z28.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
8439
+ import { z as z27 } from "zod";
8440
+ var ConfigNameSchema = z27.string().regex(/[a-z0-9\-]/g, "Invalid config name");
8441
+ var ConfigsSchema = z27.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
8445
8442
 
8446
8443
  // src/feature/cron/schema/index.ts
8447
- import { z as z30 } from "zod";
8444
+ import { z as z29 } from "zod";
8448
8445
 
8449
8446
  // src/feature/cron/schema/schedule.ts
8450
- import { z as z29 } from "zod";
8447
+ import { z as z28 } from "zod";
8451
8448
  import { awsCronExpressionValidator } from "aws-cron-expression-validator";
8452
- var RateExpressionSchema = z29.custom(
8449
+ var RateExpressionSchema = z28.custom(
8453
8450
  (value) => {
8454
- return z29.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
8451
+ return z28.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
8455
8452
  const [str] = rate.split(" ");
8456
8453
  const number = parseInt(str);
8457
8454
  return number > 0;
@@ -8467,9 +8464,9 @@ var RateExpressionSchema = z29.custom(
8467
8464
  }
8468
8465
  return `rate(${rate})`;
8469
8466
  });
8470
- var CronExpressionSchema = z29.custom(
8467
+ var CronExpressionSchema = z28.custom(
8471
8468
  (value) => {
8472
- return z29.string().safeParse(value).success;
8469
+ return z28.string().safeParse(value).success;
8473
8470
  },
8474
8471
  { message: "Invalid cron expression" }
8475
8472
  ).superRefine((value, ctx) => {
@@ -8478,12 +8475,12 @@ var CronExpressionSchema = z29.custom(
8478
8475
  } catch (error) {
8479
8476
  if (error instanceof Error) {
8480
8477
  ctx.addIssue({
8481
- code: z29.ZodIssueCode.custom,
8478
+ code: z28.ZodIssueCode.custom,
8482
8479
  message: `Invalid cron expression: ${error.message}`
8483
8480
  });
8484
8481
  } else {
8485
8482
  ctx.addIssue({
8486
- code: z29.ZodIssueCode.custom,
8483
+ code: z28.ZodIssueCode.custom,
8487
8484
  message: "Invalid cron expression"
8488
8485
  });
8489
8486
  }
@@ -8494,23 +8491,23 @@ var CronExpressionSchema = z29.custom(
8494
8491
  var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
8495
8492
 
8496
8493
  // src/feature/cron/schema/index.ts
8497
- var CronsSchema = z30.record(
8494
+ var CronsSchema = z29.record(
8498
8495
  ResourceIdSchema,
8499
- z30.object({
8500
- enabled: z30.boolean().default(true).describe("If the cron is enabled."),
8496
+ z29.object({
8497
+ enabled: z29.boolean().default(true).describe("If the cron is enabled."),
8501
8498
  consumer: FunctionSchema.describe("The consuming lambda function properties."),
8502
8499
  schedule: ScheduleExpressionSchema.describe(
8503
8500
  'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
8504
8501
  ),
8505
- payload: z30.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
8502
+ payload: z29.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
8506
8503
  })
8507
8504
  ).optional().describe(`Define the cron jobs in your stack.`);
8508
8505
 
8509
8506
  // src/feature/search/schema.ts
8510
8507
  import { gibibytes as gibibytes2 } from "@awsless/size";
8511
- import { z as z31 } from "zod";
8512
- var VersionSchema = z31.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
8513
- var TypeSchema3 = z31.enum([
8508
+ import { z as z30 } from "zod";
8509
+ var VersionSchema = z30.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
8510
+ var TypeSchema3 = z30.enum([
8514
8511
  "t3.small",
8515
8512
  "t3.medium",
8516
8513
  "m3.medium",
@@ -8585,11 +8582,11 @@ var TypeSchema3 = z31.enum([
8585
8582
  "r6gd.16xlarge"
8586
8583
  ]);
8587
8584
  var StorageSizeSchema = SizeSchema.refine(sizeMin(gibibytes2(10)), "Minimum storage size is 10 GB").refine(sizeMax(gibibytes2(100)), "Maximum storage size is 100 GB").describe("The size of the function's /tmp directory. You can specify a size value from 512 MB to 10 GiB.");
8588
- var SearchsSchema = z31.record(
8585
+ var SearchsSchema = z30.record(
8589
8586
  ResourceIdSchema,
8590
- z31.object({
8587
+ z30.object({
8591
8588
  type: TypeSchema3.default("t3.small"),
8592
- count: z31.number().int().min(1).default(1),
8589
+ count: z30.number().int().min(1).default(1),
8593
8590
  version: VersionSchema.default("2.13"),
8594
8591
  storage: StorageSizeSchema.default("10 GB")
8595
8592
  // vpc: z.boolean().default(false),
@@ -8597,29 +8594,29 @@ var SearchsSchema = z31.record(
8597
8594
  ).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
8598
8595
 
8599
8596
  // src/feature/site/schema.ts
8600
- import { z as z32 } from "zod";
8601
- var ErrorResponsePathSchema = z32.string().describe(
8597
+ import { z as z31 } from "zod";
8598
+ var ErrorResponsePathSchema = z31.string().describe(
8602
8599
  "The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.\n - We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable."
8603
8600
  );
8604
- var StatusCodeSchema = z32.number().int().positive().optional().describe(
8601
+ var StatusCodeSchema = z31.number().int().positive().optional().describe(
8605
8602
  "The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:\n- Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200, the response typically won't be intercepted.\n- If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors.\n- You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down."
8606
8603
  );
8607
8604
  var MinTTLSchema = DurationSchema.describe(
8608
8605
  "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."
8609
8606
  );
8610
- var ErrorResponseSchema = z32.union([
8607
+ var ErrorResponseSchema = z31.union([
8611
8608
  ErrorResponsePathSchema,
8612
- z32.object({
8609
+ z31.object({
8613
8610
  path: ErrorResponsePathSchema,
8614
8611
  statusCode: StatusCodeSchema.optional(),
8615
8612
  minTTL: MinTTLSchema.optional()
8616
8613
  })
8617
8614
  ]).optional();
8618
- var SitesSchema = z32.record(
8615
+ var SitesSchema = z31.record(
8619
8616
  ResourceIdSchema,
8620
- z32.object({
8617
+ z31.object({
8621
8618
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
8622
- subDomain: z32.string().optional(),
8619
+ subDomain: z31.string().optional(),
8623
8620
  // bind: z
8624
8621
  // .object({
8625
8622
  // auth: z.array(ResourceIdSchema),
@@ -8628,11 +8625,11 @@ var SitesSchema = z32.record(
8628
8625
  // // rest: z.array(ResourceIdSchema),
8629
8626
  // })
8630
8627
  // .optional(),
8631
- static: z32.union([LocalDirectorySchema, z32.boolean()]).optional().describe(
8628
+ static: z31.union([LocalDirectorySchema, z31.boolean()]).optional().describe(
8632
8629
  "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."
8633
8630
  ),
8634
8631
  ssr: FunctionSchema.optional().describe("Specifies the ssr file."),
8635
- origin: z32.enum(["ssr-first", "static-first"]).default("static-first").describe("Specifies the origin fallback ordering."),
8632
+ origin: z31.enum(["ssr-first", "static-first"]).default("static-first").describe("Specifies the origin fallback ordering."),
8636
8633
  // bind: z.object({
8637
8634
  // auth:
8638
8635
  // h
@@ -8645,7 +8642,7 @@ var SitesSchema = z32.record(
8645
8642
  // build: z.string().optional(),
8646
8643
  // }),
8647
8644
  // ]),
8648
- errors: z32.object({
8645
+ errors: z31.object({
8649
8646
  400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
8650
8647
  403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
8651
8648
  404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
@@ -8658,16 +8655,16 @@ var SitesSchema = z32.record(
8658
8655
  503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
8659
8656
  504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
8660
8657
  }).optional().describe("Customize the error responses for specific HTTP status codes."),
8661
- cors: z32.object({
8662
- override: z32.boolean().default(false),
8658
+ cors: z31.object({
8659
+ override: z31.boolean().default(false),
8663
8660
  maxAge: DurationSchema.default("365 days"),
8664
- exposeHeaders: z32.string().array().optional(),
8665
- credentials: z32.boolean().default(false),
8666
- headers: z32.string().array().default(["*"]),
8667
- origins: z32.string().array().default(["*"]),
8668
- methods: z32.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
8661
+ exposeHeaders: z31.string().array().optional(),
8662
+ credentials: z31.boolean().default(false),
8663
+ headers: z31.string().array().default(["*"]),
8664
+ origins: z31.string().array().default(["*"]),
8665
+ methods: z31.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
8669
8666
  }).optional().describe("Define the cors headers."),
8670
- security: z32.object({
8667
+ security: z31.object({
8671
8668
  // contentSecurityPolicy: z.object({
8672
8669
  // override: z.boolean().default(false),
8673
8670
  // policy: z.string(),
@@ -8709,10 +8706,10 @@ var SitesSchema = z32.record(
8709
8706
  // reportUri?: string
8710
8707
  // }
8711
8708
  }).optional().describe("Define the security policy."),
8712
- cache: z32.object({
8713
- cookies: z32.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
8714
- headers: z32.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
8715
- queries: z32.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
8709
+ cache: z31.object({
8710
+ cookies: z31.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
8711
+ headers: z31.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
8712
+ queries: z31.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
8716
8713
  }).optional().describe(
8717
8714
  "Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
8718
8715
  )
@@ -8720,22 +8717,22 @@ var SitesSchema = z32.record(
8720
8717
  ).optional().describe("Define the sites in your stack.");
8721
8718
 
8722
8719
  // src/feature/stream/schema.ts
8723
- import { z as z33 } from "zod";
8724
- var LatencyModeSchema = z33.enum(["low", "normal"]).describe(
8720
+ import { z as z32 } from "zod";
8721
+ var LatencyModeSchema = z32.enum(["low", "normal"]).describe(
8725
8722
  `Channel latency mode. Valid values:
8726
8723
  - normal: Use "normal" to broadcast and deliver live video up to Full HD.
8727
8724
  - low: Use "low" for near real-time interactions with viewers.`
8728
8725
  );
8729
- var TypeSchema4 = z33.enum(["standard", "basic", "advanced-sd", "advanced-hd"]).describe(`The channel type, which determines the allowable resolution and bitrate.
8726
+ var TypeSchema4 = z32.enum(["standard", "basic", "advanced-sd", "advanced-hd"]).describe(`The channel type, which determines the allowable resolution and bitrate.
8730
8727
  If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:
8731
8728
  - standard: Video is transcoded: multiple qualities are generated from the original input to automatically give viewers the best experience for their devices and network conditions. Transcoding allows higher playback quality across a range of download speeds. Resolution can be up to 1080p and bitrate can be up to 8.5 Mbps. Audio is transcoded only for renditions 360p and below; above that, audio is passed through.
8732
8729
  - basic: Video is transmuxed: Amazon IVS delivers the original input to viewers. The viewer's video-quality choice is limited to the original input. Resolution can be up to 1080p and bitrate can be up to 1.5 Mbps for 480p and up to 3.5 Mbps for resolutions between 480p and 1080p.
8733
8730
  - advanced-sd: Video is transcoded; multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Input resolution can be up to 1080p and bitrate can be up to 8.5 Mbps; output is capped at SD quality (480p). You can select an optional transcode preset (see below). Audio for all renditions is transcoded, and an audio-only rendition is available.
8734
8731
  - advanced-hd: Video is transcoded; multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Input resolution can be up to 1080p and bitrate can be up to 8.5 Mbps; output is capped at HD quality (720p). You can select an optional transcode preset (see below). Audio for all renditions is transcoded, and an audio-only rendition is available.
8735
8732
  `);
8736
- var StreamsSchema = z33.record(
8733
+ var StreamsSchema = z32.record(
8737
8734
  ResourceIdSchema,
8738
- z33.object({
8735
+ z32.object({
8739
8736
  type: TypeSchema4.default("standard"),
8740
8737
  // preset: PresetSchema.optional(),
8741
8738
  latencyMode: LatencyModeSchema.default("low")
@@ -8743,11 +8740,11 @@ var StreamsSchema = z33.record(
8743
8740
  ).optional().describe("Define the streams in your stack.");
8744
8741
 
8745
8742
  // src/feature/task/schema.ts
8746
- import { z as z34 } from "zod";
8747
- var RetryAttemptsSchema2 = z34.number().int().min(0).max(2).describe(
8743
+ import { z as z33 } from "zod";
8744
+ var RetryAttemptsSchema2 = z33.number().int().min(0).max(2).describe(
8748
8745
  "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
8749
8746
  );
8750
- var TaskSchema = z34.union([
8747
+ var TaskSchema = z33.union([
8751
8748
  LocalFileSchema.transform((file) => ({
8752
8749
  consumer: {
8753
8750
  code: {
@@ -8758,33 +8755,33 @@ var TaskSchema = z34.union([
8758
8755
  },
8759
8756
  retryAttempts: void 0
8760
8757
  })),
8761
- z34.object({
8758
+ z33.object({
8762
8759
  consumer: FunctionSchema,
8763
8760
  retryAttempts: RetryAttemptsSchema2.optional()
8764
8761
  })
8765
8762
  ]);
8766
- var TasksSchema = z34.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
8763
+ var TasksSchema = z33.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
8767
8764
 
8768
8765
  // src/feature/test/schema.ts
8769
- import { z as z35 } from "zod";
8770
- var TestsSchema = z35.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
8766
+ import { z as z34 } from "zod";
8767
+ var TestsSchema = z34.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
8771
8768
 
8772
8769
  // src/feature/topic/schema.ts
8773
8770
  import { paramCase as paramCase3 } from "change-case";
8774
- import { z as z36 } from "zod";
8775
- var TopicNameSchema = z36.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase3(value)).describe("Define event topic name.");
8776
- var TopicsSchema = z36.array(TopicNameSchema).refine((topics) => {
8771
+ import { z as z35 } from "zod";
8772
+ var TopicNameSchema = z35.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase3(value)).describe("Define event topic name.");
8773
+ var TopicsSchema = z35.array(TopicNameSchema).refine((topics) => {
8777
8774
  return topics.length === new Set(topics).size;
8778
8775
  }, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
8779
- var SubscribersSchema = z36.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
8776
+ var SubscribersSchema = z35.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
8780
8777
 
8781
8778
  // src/config/stack.ts
8782
8779
  var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
8783
8780
  var NameSchema = ResourceIdSchema.refine((name) => !["base"].includes(name), {
8784
8781
  message: `Stack name can't be a reserved name.`
8785
8782
  }).describe("Stack name.");
8786
- var StackSchema = z37.object({
8787
- $schema: z37.string().optional(),
8783
+ var StackSchema = z36.object({
8784
+ $schema: z36.string().optional(),
8788
8785
  name: NameSchema,
8789
8786
  depends: DependsSchema,
8790
8787
  commands: CommandsSchema,
@@ -8851,13 +8848,13 @@ var readConfigWithStage = async (file, stage) => {
8851
8848
  };
8852
8849
 
8853
8850
  // src/config/load/validate.ts
8854
- import { z as z38 } from "zod";
8851
+ import { z as z37 } from "zod";
8855
8852
  var validateConfig = async (schema, file, data) => {
8856
8853
  try {
8857
8854
  const result = await schema.parseAsync(data);
8858
8855
  return result;
8859
8856
  } catch (error) {
8860
- if (error instanceof z38.ZodError) {
8857
+ if (error instanceof z37.ZodError) {
8861
8858
  throw new ConfigError(file, error, data);
8862
8859
  }
8863
8860
  throw error;
@@ -10806,7 +10803,7 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
10806
10803
  file: fileCode.file,
10807
10804
  external: [
10808
10805
  ...fileCode.external ?? [],
10809
- ...(props.layers ?? []).flatMap((id2) => ctx.shared.get(`layer-${id2}-packages`))
10806
+ ...props.layers?.flatMap((id2) => ctx.shared.get(`layer-${id2}-packages`))
10810
10807
  ],
10811
10808
  minify: fileCode.minify,
10812
10809
  nativeDir: temp.path
@@ -10882,7 +10879,7 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
10882
10879
  role: role.arn,
10883
10880
  code,
10884
10881
  runtime: props.runtime === "container" ? void 0 : props.runtime,
10885
- layers: (props.layers ?? []).map((id2) => ctx.shared.get(`layer-${id2}-arn`)),
10882
+ layers: props.layers?.map((id2) => ctx.shared.get(`layer-${id2}-arn`)).filter((v) => !!v),
10886
10883
  // Remove conflicting props.
10887
10884
  vpc: void 0,
10888
10885
  log: props.log
@@ -12750,7 +12747,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, local2) => {
12750
12747
  }
12751
12748
  const props = {
12752
12749
  architecture: "arm64",
12753
- runtime: "nodejs20.x",
12750
+ runtime: "nodejs22.x",
12754
12751
  ...local2
12755
12752
  };
12756
12753
  const code = new aws16.s3.BucketObject(group, "code", {
@@ -13162,24 +13159,29 @@ var siteFeature = defineFeature({
13162
13159
  ctx.onBind((name2, value) => {
13163
13160
  lambda.addEnvironment(name2, value);
13164
13161
  });
13165
- new aws19.lambda.Permission(group, "permission", {
13166
- principal: "*",
13167
- // principal: 'cloudfront.amazonaws.com',
13168
- action: "lambda:InvokeFunctionUrl",
13169
- functionArn: lambda.arn,
13170
- urlAuthType: "none"
13171
- // urlAuthType: 'aws-iam',
13172
- // sourceArn: distribution.arn,
13173
- });
13174
13162
  const url = new aws19.lambda.Url(group, "url", {
13175
13163
  targetArn: lambda.arn,
13176
- authType: "none"
13177
- // authType: 'aws-iam',
13164
+ authType: "aws-iam"
13178
13165
  });
13166
+ const ssrAccessControl = new aws19.cloudFront.OriginAccessControl(group, `ssr-access`, {
13167
+ name,
13168
+ type: "lambda",
13169
+ behavior: "always",
13170
+ protocol: "sigv4"
13171
+ });
13172
+ new aws19.lambda.Permission(group, "ssr-permission", {
13173
+ principal: "cloudfront.amazonaws.com",
13174
+ action: "lambda:InvokeFunctionUrl",
13175
+ functionArn: lambda.arn,
13176
+ urlAuthType: "aws-iam",
13177
+ sourceArn: `arn:aws:cloudfront::${ctx.accountId}:distribution/*`
13178
+ });
13179
+ ssrAccessControl.deletionPolicy = "after-deployment";
13179
13180
  origins.push({
13180
13181
  id: "ssr",
13181
13182
  domainName: url.url.apply((url2) => url2.split("/")[2]),
13182
- protocol: "https-only"
13183
+ protocol: "https-only",
13184
+ originAccessControlId: ssrAccessControl.id
13183
13185
  });
13184
13186
  }
13185
13187
  if (props.static) {
@@ -13209,13 +13211,13 @@ var siteFeature = defineFeature({
13209
13211
  policy.addStatement(bucket.permissions);
13210
13212
  });
13211
13213
  bucket.deletionPolicy = "after-deployment";
13212
- const accessControl = new aws19.cloudFront.OriginAccessControl(group, `access`, {
13214
+ const s3AccessControl = new aws19.cloudFront.OriginAccessControl(group, `s3-access`, {
13213
13215
  name,
13214
13216
  type: "s3",
13215
13217
  behavior: "always",
13216
13218
  protocol: "sigv4"
13217
13219
  });
13218
- accessControl.deletionPolicy = "after-deployment";
13220
+ s3AccessControl.deletionPolicy = "after-deployment";
13219
13221
  if (typeof props.static === "string") {
13220
13222
  const files = glob2.sync("**", {
13221
13223
  cwd: props.static,
@@ -13236,7 +13238,7 @@ var siteFeature = defineFeature({
13236
13238
  origins.push({
13237
13239
  id: "static",
13238
13240
  domainName: bucket.regionalDomainName,
13239
- originAccessControlId: accessControl.id
13241
+ originAccessControlId: s3AccessControl.id
13240
13242
  });
13241
13243
  }
13242
13244
  if (props.ssr && props.static) {
@@ -13938,6 +13940,22 @@ var alertFeature = defineFeature({
13938
13940
 
13939
13941
  // src/feature/layer/index.ts
13940
13942
  import { Asset as Asset7, aws as aws26, Node as Node26 } from "@awsless/formation";
13943
+ var stackSearch = (stack, key) => {
13944
+ let found = [];
13945
+ function search(obj) {
13946
+ if (typeof obj !== "object" || obj === null) return;
13947
+ if (obj[key]) {
13948
+ found.push(obj[key]);
13949
+ }
13950
+ for (let k in obj) {
13951
+ if (typeof obj[k] === "object") {
13952
+ search(obj[k]);
13953
+ }
13954
+ }
13955
+ }
13956
+ search(stack);
13957
+ return found;
13958
+ };
13941
13959
  var layerFeature = defineFeature({
13942
13960
  name: "layer",
13943
13961
  onBefore(ctx) {
@@ -13958,6 +13976,17 @@ var layerFeature = defineFeature({
13958
13976
  });
13959
13977
  ctx.shared.set("layer-bucket-name", bucket.name);
13960
13978
  },
13979
+ onValidate(ctx) {
13980
+ const layers = Object.keys(ctx.appConfig.defaults.layers ?? []);
13981
+ for (const stack of ctx.stackConfigs) {
13982
+ const stackLayers = stackSearch(stack, "layers").flat();
13983
+ for (const layer of stackLayers) {
13984
+ if (!layers.includes(layer)) {
13985
+ throw new FileError(stack.file, `Layer "${layer}" is not defined in app.json`);
13986
+ }
13987
+ }
13988
+ }
13989
+ },
13961
13990
  onApp(ctx) {
13962
13991
  const layers = Object.entries(ctx.appConfig.defaults.layers ?? {});
13963
13992
  if (layers.length === 0) {
@@ -14158,6 +14187,9 @@ var format = (value) => {
14158
14187
  }
14159
14188
  return "";
14160
14189
  };
14190
+ var endType = (value) => {
14191
+ return typeof value !== "object";
14192
+ };
14161
14193
  var logConfigError = (error) => {
14162
14194
  for (const issue of error.error.errors) {
14163
14195
  const message = [color.error(issue.message), color.dim(error.file), "\n{"];
@@ -14167,19 +14199,24 @@ var logConfigError = (error) => {
14167
14199
  const end = ["}"];
14168
14200
  issue.path.forEach((path, i) => {
14169
14201
  const index = i + 1;
14170
- context = context[path];
14202
+ const entry = context[path];
14203
+ if (typeof entry !== "undefined") {
14204
+ context = entry;
14205
+ } else {
14206
+ return;
14207
+ }
14171
14208
  if (typeof path === "string") {
14172
14209
  const key = path + `: `;
14173
- if (index === length) {
14210
+ if (index === length || endType(entry)) {
14174
14211
  const space = " ".repeat(key.length);
14175
- const value = format(context);
14212
+ const value = format(entry);
14176
14213
  const error2 = icon.arrow.top.repeat(value.length);
14177
14214
  message.push(codeLine(key + color.warning(value), index));
14178
14215
  message.push(codeLine(space + color.error(error2), index));
14179
- } else if (Array.isArray(context)) {
14216
+ } else if (Array.isArray(entry)) {
14180
14217
  message.push(codeLine(key + "[", index));
14181
14218
  end.unshift(codeLine("]", index));
14182
- } else if (typeof context === "object") {
14219
+ } else if (typeof entry === "object") {
14183
14220
  if (inStack && index === 3) {
14184
14221
  const name = error.data.stacks[issue.path[1]].name;
14185
14222
  message.push(codeLine("name: " + color.info(`"${name}"`) + ",", index));
@@ -14187,12 +14224,12 @@ var logConfigError = (error) => {
14187
14224
  message.push(codeLine(key + "{", index));
14188
14225
  end.unshift(codeLine("}", index));
14189
14226
  }
14190
- } else if (typeof context === "object") {
14227
+ } else if (typeof entry === "object") {
14191
14228
  message.push(codeLine("{", index));
14192
14229
  end.unshift(codeLine("}", index));
14193
- } else if (typeof context === "string") {
14194
- message.push(codeLine(color.warning(`"${context}"`), index));
14195
- const error2 = icon.arrow.top.repeat(context.length + 2);
14230
+ } else if (typeof entry === "string") {
14231
+ message.push(codeLine(color.warning(`"${entry}"`), index));
14232
+ const error2 = icon.arrow.top.repeat(entry.length + 2);
14196
14233
  message.push(codeLine(color.error(error2), index));
14197
14234
  }
14198
14235
  });