@awsless/awsless 0.0.539 → 0.0.541
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/app.json +1 -1
- package/dist/bin.js +855 -298
- package/dist/build-json-schema.js +311 -160
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/rpc/HASH +1 -1
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/server.js +26 -10
- package/dist/stack.json +1 -1
- package/package.json +15 -14
|
@@ -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
|
|
7
|
+
import { z as z22 } from "zod";
|
|
8
8
|
|
|
9
9
|
// src/feature/alert/schema.ts
|
|
10
10
|
import { kebabCase } from "change-case";
|
|
@@ -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((
|
|
238
|
+
`Invalid log retention. Valid days are: ${validLogRetentionDays.map((days4) => `${days4}`).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) })),
|
|
@@ -540,8 +540,159 @@ var RpcDefaultSchema = z19.record(
|
|
|
540
540
|
).describe(`Define the global RPC API's.`).optional();
|
|
541
541
|
var RpcSchema = z19.record(ResourceIdSchema, z19.record(z19.string(), FunctionSchema).describe("The queries for your global RPC API.")).describe("Define the schema in your stack for your global RPC API.").optional();
|
|
542
542
|
|
|
543
|
-
// src/
|
|
543
|
+
// src/feature/instance/schema.ts
|
|
544
|
+
import { days as days3, toDays as toDays2 } from "@awsless/duration";
|
|
544
545
|
import { z as z20 } from "zod";
|
|
546
|
+
var CpuSizeSchema = z20.union([
|
|
547
|
+
z20.literal("0.25 vCPU"),
|
|
548
|
+
z20.literal("0.5 vCPU"),
|
|
549
|
+
z20.literal("1 vCPU"),
|
|
550
|
+
z20.literal("2 vCPU"),
|
|
551
|
+
z20.literal("4 vCPU"),
|
|
552
|
+
z20.literal("8 vCPU"),
|
|
553
|
+
z20.literal("16 vCPU")
|
|
554
|
+
]).describe(
|
|
555
|
+
"The number of vCPU units used by the task. For tasks using the Fargate launch type, this field is required. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
|
|
556
|
+
);
|
|
557
|
+
var MemorySizeSchema2 = z20.union([
|
|
558
|
+
// 0.25 vCPU
|
|
559
|
+
z20.literal(512),
|
|
560
|
+
z20.literal(1024),
|
|
561
|
+
z20.literal(2048),
|
|
562
|
+
// 0.5 vCPU
|
|
563
|
+
z20.literal(1024),
|
|
564
|
+
z20.literal(2048),
|
|
565
|
+
z20.literal(3072),
|
|
566
|
+
z20.literal(4096),
|
|
567
|
+
// 1 vCPU
|
|
568
|
+
z20.literal(2048),
|
|
569
|
+
z20.literal(3072),
|
|
570
|
+
z20.literal(4096),
|
|
571
|
+
z20.literal(5120),
|
|
572
|
+
z20.literal(6144),
|
|
573
|
+
z20.literal(7168),
|
|
574
|
+
z20.literal(8192),
|
|
575
|
+
// 2 vCPU
|
|
576
|
+
z20.literal(4096),
|
|
577
|
+
z20.literal(5120),
|
|
578
|
+
z20.literal(6144),
|
|
579
|
+
z20.literal(7168),
|
|
580
|
+
z20.literal(8192),
|
|
581
|
+
z20.literal(9216),
|
|
582
|
+
z20.literal(10240),
|
|
583
|
+
z20.literal(11264),
|
|
584
|
+
z20.literal(12288),
|
|
585
|
+
z20.literal(13312),
|
|
586
|
+
z20.literal(14336),
|
|
587
|
+
z20.literal(15360),
|
|
588
|
+
z20.literal(16384)
|
|
589
|
+
]).describe(
|
|
590
|
+
"The amount of memory (in MiB) used by the task. For tasks using the Fargate launch type, this field is required and must be compatible with the CPU value. Valid memory values depend on the CPU configuration."
|
|
591
|
+
);
|
|
592
|
+
var HealthCheckSchema = z20.object({
|
|
593
|
+
command: z20.union([z20.string(), z20.string().array()]).describe("The command that the container runs to determine if it is healthy."),
|
|
594
|
+
interval: DurationSchema.describe("The time period in seconds between each health check execution."),
|
|
595
|
+
retries: z20.number().int().min(1).max(10).describe(
|
|
596
|
+
"The number of times to retry a failed health check before the container is considered unhealthy."
|
|
597
|
+
),
|
|
598
|
+
startPeriod: DurationSchema.describe(
|
|
599
|
+
"The optional grace period to provide containers time to bootstrap before failed health checks count towards the maximum number of retries."
|
|
600
|
+
),
|
|
601
|
+
timeout: DurationSchema.describe(
|
|
602
|
+
"The time period in seconds to wait for a health check to succeed before it is considered a failure."
|
|
603
|
+
)
|
|
604
|
+
}).describe("The health check command and associated configuration parameters for the container.");
|
|
605
|
+
var RestartPolicySchema = z20.object({
|
|
606
|
+
enabled: z20.boolean().describe("Whether to enable the restart policy for the container."),
|
|
607
|
+
ignoredExitCodes: z20.number().int().array().optional().describe("A list of exit codes that Amazon ECS will ignore and not attempt a restart against."),
|
|
608
|
+
restartAttemptPeriod: z20.number().int().min(0).max(1800).optional().describe(
|
|
609
|
+
"A period of time (in seconds) that the container must run for before a restart can be attempted. A container can be restarted only once every restartAttemptPeriod seconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimum restartAttemptPeriod of 60 seconds and a maximum restartAttemptPeriod of 1800 seconds."
|
|
610
|
+
)
|
|
611
|
+
}).describe("The restart policy for the container. This parameter maps to the --restart option to docker run.");
|
|
612
|
+
var EnvironmentSchema2 = z20.record(z20.string(), z20.string()).optional().describe("Environment variable key-value pairs.");
|
|
613
|
+
var ArchitectureSchema3 = z20.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
614
|
+
var ActionSchema2 = z20.string();
|
|
615
|
+
var ActionsSchema2 = z20.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
|
|
616
|
+
var ArnSchema2 = z20.string().startsWith("arn:");
|
|
617
|
+
var WildcardSchema2 = z20.literal("*");
|
|
618
|
+
var ResourceSchema2 = z20.union([ArnSchema2, WildcardSchema2]);
|
|
619
|
+
var ResourcesSchema2 = z20.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
|
|
620
|
+
var PermissionSchema2 = z20.object({
|
|
621
|
+
effect: z20.enum(["allow", "deny"]).default("allow"),
|
|
622
|
+
actions: ActionsSchema2,
|
|
623
|
+
resources: ResourcesSchema2
|
|
624
|
+
});
|
|
625
|
+
var PermissionsSchema2 = z20.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your function.");
|
|
626
|
+
var MinifySchema2 = z20.boolean().describe("Minify the function code.");
|
|
627
|
+
var DescriptionSchema2 = z20.string().describe("A description of the function.");
|
|
628
|
+
var ImageSchema = z20.string().optional().describe("The URL of the container image to use.");
|
|
629
|
+
var validLogRetentionDays2 = [
|
|
630
|
+
...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
|
|
631
|
+
...[180, 365, 400, 545, 731, 1096, 1827, 2192],
|
|
632
|
+
...[2557, 2922, 3288, 3653]
|
|
633
|
+
];
|
|
634
|
+
var LogRetentionSchema2 = DurationSchema.refine(
|
|
635
|
+
durationMin(days3(0)),
|
|
636
|
+
"Minimum log retention is 0 day, which will disable logging."
|
|
637
|
+
).refine(
|
|
638
|
+
(duration) => {
|
|
639
|
+
return validLogRetentionDays2.includes(toDays2(duration));
|
|
640
|
+
},
|
|
641
|
+
`Invalid log retention. Valid days are: ${validLogRetentionDays2.map((days4) => `${days4}`).join(", ")}`
|
|
642
|
+
).describe("The log retention duration.");
|
|
643
|
+
var LogSchema2 = z20.union([
|
|
644
|
+
z20.boolean().transform((enabled) => ({ retention: enabled ? days3(7) : days3(0) })),
|
|
645
|
+
LogRetentionSchema2.transform((retention) => ({ retention })),
|
|
646
|
+
z20.object({
|
|
647
|
+
retention: LogRetentionSchema2.optional()
|
|
648
|
+
})
|
|
649
|
+
]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
|
|
650
|
+
var FileCodeSchema2 = z20.object({
|
|
651
|
+
file: LocalFileSchema.describe("The file path of the function code."),
|
|
652
|
+
minify: MinifySchema2.optional().default(true)
|
|
653
|
+
});
|
|
654
|
+
var CodeSchema2 = z20.union([
|
|
655
|
+
LocalFileSchema.transform((file) => ({
|
|
656
|
+
file
|
|
657
|
+
})).pipe(FileCodeSchema2),
|
|
658
|
+
FileCodeSchema2
|
|
659
|
+
]).describe("Specify the code of your instance.");
|
|
660
|
+
var ISchema = z20.object({
|
|
661
|
+
code: CodeSchema2,
|
|
662
|
+
description: DescriptionSchema2.optional(),
|
|
663
|
+
image: ImageSchema.optional(),
|
|
664
|
+
log: LogSchema2.optional(),
|
|
665
|
+
memorySize: MemorySizeSchema2.optional(),
|
|
666
|
+
cpuSize: CpuSizeSchema.optional(),
|
|
667
|
+
architecture: ArchitectureSchema3.optional(),
|
|
668
|
+
environment: EnvironmentSchema2.optional(),
|
|
669
|
+
permissions: PermissionsSchema2.optional(),
|
|
670
|
+
healthCheck: HealthCheckSchema.optional(),
|
|
671
|
+
restartPolicy: RestartPolicySchema.optional()
|
|
672
|
+
});
|
|
673
|
+
var InstanceSchema = z20.union([
|
|
674
|
+
LocalFileSchema.transform((code) => ({
|
|
675
|
+
code
|
|
676
|
+
})).pipe(ISchema),
|
|
677
|
+
ISchema
|
|
678
|
+
]);
|
|
679
|
+
var InstancesSchema = z20.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
|
|
680
|
+
var InstanceDefaultSchema = z20.object({
|
|
681
|
+
image: ImageSchema.default("public.ecr.aws/aws-cli/aws-cli:amd64"),
|
|
682
|
+
memorySize: MemorySizeSchema2.default(512),
|
|
683
|
+
cpuSize: CpuSizeSchema.default("0.25 vCPU"),
|
|
684
|
+
architecture: ArchitectureSchema3.default("arm64"),
|
|
685
|
+
environment: EnvironmentSchema2.optional(),
|
|
686
|
+
permissions: PermissionsSchema2.optional(),
|
|
687
|
+
healthCheck: HealthCheckSchema.optional(),
|
|
688
|
+
restartPolicy: RestartPolicySchema.default({ enabled: true }),
|
|
689
|
+
log: LogSchema2.default(true).transform((log) => ({
|
|
690
|
+
retention: log.retention ?? days3(7)
|
|
691
|
+
}))
|
|
692
|
+
}).default({});
|
|
693
|
+
|
|
694
|
+
// src/config/schema/region.ts
|
|
695
|
+
import { z as z21 } from "zod";
|
|
545
696
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
546
697
|
var AF = ["af-south-1"];
|
|
547
698
|
var AP = [
|
|
@@ -570,16 +721,16 @@ var EU = [
|
|
|
570
721
|
var ME = ["me-south-1", "me-central-1"];
|
|
571
722
|
var SA = ["sa-east-1"];
|
|
572
723
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
573
|
-
var RegionSchema =
|
|
724
|
+
var RegionSchema = z21.enum(regions);
|
|
574
725
|
|
|
575
726
|
// src/config/app.ts
|
|
576
|
-
var AppSchema =
|
|
577
|
-
$schema:
|
|
727
|
+
var AppSchema = z22.object({
|
|
728
|
+
$schema: z22.string().optional(),
|
|
578
729
|
name: ResourceIdSchema.describe("App name."),
|
|
579
730
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
580
|
-
profile:
|
|
581
|
-
protect:
|
|
582
|
-
removal:
|
|
731
|
+
profile: z22.string().describe("The AWS profile to deploy to."),
|
|
732
|
+
protect: z22.boolean().default(false).describe("Protect your app & stacks from being deleted."),
|
|
733
|
+
removal: z22.enum(["remove", "retain"]).default("remove").describe(
|
|
583
734
|
[
|
|
584
735
|
"Configure how your resources are handled when they have to be removed.",
|
|
585
736
|
"",
|
|
@@ -593,13 +744,13 @@ var AppSchema = z21.object({
|
|
|
593
744
|
// .default('prod')
|
|
594
745
|
// .describe('The deployment stage.'),
|
|
595
746
|
// onFailure: OnFailureSchema,
|
|
596
|
-
defaults:
|
|
747
|
+
defaults: z22.object({
|
|
597
748
|
onFailure: OnFailureDefaultSchema,
|
|
598
749
|
onLog: OnLogDefaultSchema,
|
|
599
750
|
auth: AuthDefaultSchema,
|
|
600
751
|
domains: DomainsDefaultSchema,
|
|
601
752
|
function: FunctionDefaultSchema,
|
|
602
|
-
|
|
753
|
+
instance: InstanceDefaultSchema,
|
|
603
754
|
queue: QueueDefaultSchema,
|
|
604
755
|
// graphql: GraphQLDefaultSchema,
|
|
605
756
|
// http: HttpDefaultSchema,
|
|
@@ -615,11 +766,11 @@ var AppSchema = z21.object({
|
|
|
615
766
|
});
|
|
616
767
|
|
|
617
768
|
// src/config/stack.ts
|
|
618
|
-
import { z as
|
|
769
|
+
import { z as z38 } from "zod";
|
|
619
770
|
|
|
620
771
|
// src/feature/cache/schema.ts
|
|
621
772
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
622
|
-
import { z as
|
|
773
|
+
import { z as z23 } from "zod";
|
|
623
774
|
var StorageSchema = SizeSchema.refine(sizeMin(gibibytes2(1)), "Minimum storage size is 1 GB").refine(
|
|
624
775
|
sizeMax(gibibytes2(5e3)),
|
|
625
776
|
"Maximum storage size is 5000 GB"
|
|
@@ -630,31 +781,31 @@ var MinimumStorageSchema = StorageSchema.describe(
|
|
|
630
781
|
var MaximumStorageSchema = StorageSchema.describe(
|
|
631
782
|
"The upper limit for data storage the cache is set to use. You can specify a size value from 1 GB to 5000 GB."
|
|
632
783
|
);
|
|
633
|
-
var EcpuSchema =
|
|
784
|
+
var EcpuSchema = z23.number().int().min(1e3).max(15e6);
|
|
634
785
|
var MinimumEcpuSchema = EcpuSchema.describe(
|
|
635
786
|
"The minimum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
636
787
|
);
|
|
637
788
|
var MaximumEcpuSchema = EcpuSchema.describe(
|
|
638
789
|
"The maximum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
639
790
|
);
|
|
640
|
-
var CachesSchema =
|
|
791
|
+
var CachesSchema = z23.record(
|
|
641
792
|
ResourceIdSchema,
|
|
642
|
-
|
|
793
|
+
z23.object({
|
|
643
794
|
minStorage: MinimumStorageSchema.optional(),
|
|
644
795
|
maxStorage: MaximumStorageSchema.optional(),
|
|
645
796
|
minECPU: MinimumEcpuSchema.optional(),
|
|
646
797
|
maxECPU: MaximumEcpuSchema.optional(),
|
|
647
|
-
snapshotRetentionLimit:
|
|
798
|
+
snapshotRetentionLimit: z23.number().int().positive().default(1)
|
|
648
799
|
})
|
|
649
800
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
650
801
|
|
|
651
802
|
// src/feature/command/schema.ts
|
|
652
|
-
import { z as
|
|
653
|
-
var CommandSchema =
|
|
654
|
-
|
|
803
|
+
import { z as z24 } from "zod";
|
|
804
|
+
var CommandSchema = z24.union([
|
|
805
|
+
z24.object({
|
|
655
806
|
file: LocalFileSchema,
|
|
656
|
-
handler:
|
|
657
|
-
description:
|
|
807
|
+
handler: z24.string().default("default").describe("The name of the handler that needs to run"),
|
|
808
|
+
description: z24.string().optional().describe("A description of the command")
|
|
658
809
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
659
810
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
660
811
|
}),
|
|
@@ -664,22 +815,22 @@ var CommandSchema = z23.union([
|
|
|
664
815
|
description: void 0
|
|
665
816
|
}))
|
|
666
817
|
]);
|
|
667
|
-
var CommandsSchema =
|
|
818
|
+
var CommandsSchema = z24.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
668
819
|
|
|
669
820
|
// src/feature/config/schema.ts
|
|
670
|
-
import { z as
|
|
671
|
-
var ConfigNameSchema =
|
|
672
|
-
var ConfigsSchema =
|
|
821
|
+
import { z as z25 } from "zod";
|
|
822
|
+
var ConfigNameSchema = z25.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
823
|
+
var ConfigsSchema = z25.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
673
824
|
|
|
674
825
|
// src/feature/cron/schema/index.ts
|
|
675
|
-
import { z as
|
|
826
|
+
import { z as z27 } from "zod";
|
|
676
827
|
|
|
677
828
|
// src/feature/cron/schema/schedule.ts
|
|
678
|
-
import { z as
|
|
829
|
+
import { z as z26 } from "zod";
|
|
679
830
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
680
|
-
var RateExpressionSchema =
|
|
831
|
+
var RateExpressionSchema = z26.custom(
|
|
681
832
|
(value) => {
|
|
682
|
-
return
|
|
833
|
+
return z26.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
683
834
|
const [str] = rate.split(" ");
|
|
684
835
|
const number = parseInt(str);
|
|
685
836
|
return number > 0;
|
|
@@ -695,9 +846,9 @@ var RateExpressionSchema = z25.custom(
|
|
|
695
846
|
}
|
|
696
847
|
return `rate(${rate})`;
|
|
697
848
|
});
|
|
698
|
-
var CronExpressionSchema =
|
|
849
|
+
var CronExpressionSchema = z26.custom(
|
|
699
850
|
(value) => {
|
|
700
|
-
return
|
|
851
|
+
return z26.string().safeParse(value).success;
|
|
701
852
|
},
|
|
702
853
|
{ message: "Invalid cron expression" }
|
|
703
854
|
).superRefine((value, ctx) => {
|
|
@@ -706,12 +857,12 @@ var CronExpressionSchema = z25.custom(
|
|
|
706
857
|
} catch (error) {
|
|
707
858
|
if (error instanceof Error) {
|
|
708
859
|
ctx.addIssue({
|
|
709
|
-
code:
|
|
860
|
+
code: z26.ZodIssueCode.custom,
|
|
710
861
|
message: `Invalid cron expression: ${error.message}`
|
|
711
862
|
});
|
|
712
863
|
} else {
|
|
713
864
|
ctx.addIssue({
|
|
714
|
-
code:
|
|
865
|
+
code: z26.ZodIssueCode.custom,
|
|
715
866
|
message: "Invalid cron expression"
|
|
716
867
|
});
|
|
717
868
|
}
|
|
@@ -722,28 +873,28 @@ var CronExpressionSchema = z25.custom(
|
|
|
722
873
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
723
874
|
|
|
724
875
|
// src/feature/cron/schema/index.ts
|
|
725
|
-
var CronsSchema =
|
|
876
|
+
var CronsSchema = z27.record(
|
|
726
877
|
ResourceIdSchema,
|
|
727
|
-
|
|
728
|
-
enabled:
|
|
878
|
+
z27.object({
|
|
879
|
+
enabled: z27.boolean().default(true).describe("If the cron is enabled."),
|
|
729
880
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
730
881
|
schedule: ScheduleExpressionSchema.describe(
|
|
731
882
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
732
883
|
),
|
|
733
|
-
payload:
|
|
884
|
+
payload: z27.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
734
885
|
})
|
|
735
886
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
736
887
|
|
|
737
888
|
// src/feature/search/schema.ts
|
|
738
889
|
import { gibibytes as gibibytes3 } from "@awsless/size";
|
|
739
|
-
import { z as
|
|
740
|
-
var VersionSchema =
|
|
890
|
+
import { z as z28 } from "zod";
|
|
891
|
+
var VersionSchema = z28.union([
|
|
741
892
|
//
|
|
742
|
-
|
|
743
|
-
|
|
893
|
+
z28.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
|
|
894
|
+
z28.string()
|
|
744
895
|
]).describe("Specify the OpenSearch engine version.");
|
|
745
|
-
var TypeSchema =
|
|
746
|
-
|
|
896
|
+
var TypeSchema = z28.union([
|
|
897
|
+
z28.enum([
|
|
747
898
|
"t3.small",
|
|
748
899
|
"t3.medium",
|
|
749
900
|
"m3.medium",
|
|
@@ -817,13 +968,13 @@ var TypeSchema = z27.union([
|
|
|
817
968
|
"r6gd.12xlarge",
|
|
818
969
|
"r6gd.16xlarge"
|
|
819
970
|
]),
|
|
820
|
-
|
|
971
|
+
z28.string()
|
|
821
972
|
]).describe("Instance type of data nodes in the cluster.");
|
|
822
|
-
var CountSchema =
|
|
973
|
+
var CountSchema = z28.number().int().min(1).describe("Number of instances in the cluster.");
|
|
823
974
|
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.");
|
|
824
|
-
var SearchsSchema =
|
|
975
|
+
var SearchsSchema = z28.record(
|
|
825
976
|
ResourceIdSchema,
|
|
826
|
-
|
|
977
|
+
z28.object({
|
|
827
978
|
type: TypeSchema.default("t3.small"),
|
|
828
979
|
count: CountSchema.default(1),
|
|
829
980
|
version: VersionSchema.default("2.13"),
|
|
@@ -834,12 +985,12 @@ var SearchsSchema = z27.record(
|
|
|
834
985
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
835
986
|
|
|
836
987
|
// src/feature/site/schema.ts
|
|
837
|
-
import { z as
|
|
988
|
+
import { z as z30 } from "zod";
|
|
838
989
|
|
|
839
990
|
// src/config/schema/local-entry.ts
|
|
840
991
|
import { stat as stat3 } from "fs/promises";
|
|
841
|
-
import { z as
|
|
842
|
-
var LocalEntrySchema =
|
|
992
|
+
import { z as z29 } from "zod";
|
|
993
|
+
var LocalEntrySchema = z29.union([
|
|
843
994
|
RelativePathSchema.refine(async (path) => {
|
|
844
995
|
try {
|
|
845
996
|
const s = await stat3(path);
|
|
@@ -848,7 +999,7 @@ var LocalEntrySchema = z28.union([
|
|
|
848
999
|
return false;
|
|
849
1000
|
}
|
|
850
1001
|
}, `File or directory doesn't exist`),
|
|
851
|
-
|
|
1002
|
+
z29.object({
|
|
852
1003
|
nocheck: RelativePathSchema.describe(
|
|
853
1004
|
"Specifies a local file or directory without checking if the file or directory exists."
|
|
854
1005
|
)
|
|
@@ -856,14 +1007,14 @@ var LocalEntrySchema = z28.union([
|
|
|
856
1007
|
]);
|
|
857
1008
|
|
|
858
1009
|
// src/feature/site/schema.ts
|
|
859
|
-
var ErrorResponsePathSchema =
|
|
1010
|
+
var ErrorResponsePathSchema = z30.string().describe(
|
|
860
1011
|
[
|
|
861
1012
|
"The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.",
|
|
862
1013
|
"- We recommend that you store custom error pages in an Amazon S3 bucket.",
|
|
863
1014
|
"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."
|
|
864
1015
|
].join("\n")
|
|
865
1016
|
);
|
|
866
|
-
var StatusCodeSchema =
|
|
1017
|
+
var StatusCodeSchema = z30.number().int().positive().optional().describe(
|
|
867
1018
|
[
|
|
868
1019
|
"The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.",
|
|
869
1020
|
"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:",
|
|
@@ -876,19 +1027,19 @@ var StatusCodeSchema = z29.number().int().positive().optional().describe(
|
|
|
876
1027
|
var MinTTLSchema = DurationSchema.describe(
|
|
877
1028
|
"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."
|
|
878
1029
|
);
|
|
879
|
-
var ErrorResponseSchema =
|
|
1030
|
+
var ErrorResponseSchema = z30.union([
|
|
880
1031
|
ErrorResponsePathSchema,
|
|
881
|
-
|
|
1032
|
+
z30.object({
|
|
882
1033
|
path: ErrorResponsePathSchema,
|
|
883
1034
|
statusCode: StatusCodeSchema.optional(),
|
|
884
1035
|
minTTL: MinTTLSchema.optional()
|
|
885
1036
|
})
|
|
886
1037
|
]).optional();
|
|
887
|
-
var SitesSchema =
|
|
1038
|
+
var SitesSchema = z30.record(
|
|
888
1039
|
ResourceIdSchema,
|
|
889
|
-
|
|
1040
|
+
z30.object({
|
|
890
1041
|
domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
|
|
891
|
-
subDomain:
|
|
1042
|
+
subDomain: z30.string().optional(),
|
|
892
1043
|
// bind: z
|
|
893
1044
|
// .object({
|
|
894
1045
|
// auth: z.array(ResourceIdSchema),
|
|
@@ -897,16 +1048,16 @@ var SitesSchema = z29.record(
|
|
|
897
1048
|
// // rest: z.array(ResourceIdSchema),
|
|
898
1049
|
// })
|
|
899
1050
|
// .optional(),
|
|
900
|
-
build:
|
|
901
|
-
command:
|
|
1051
|
+
build: z30.object({
|
|
1052
|
+
command: z30.string().describe(
|
|
902
1053
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
903
1054
|
),
|
|
904
|
-
cacheKey:
|
|
1055
|
+
cacheKey: z30.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
|
|
905
1056
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
906
1057
|
),
|
|
907
|
-
configs:
|
|
1058
|
+
configs: z30.string().array().describe("Define the config values for your build command.")
|
|
908
1059
|
}).optional().describe(`Specifies the build process for sites that need a build step.`),
|
|
909
|
-
static:
|
|
1060
|
+
static: z30.union([LocalDirectorySchema, z30.boolean()]).optional().describe(
|
|
910
1061
|
"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."
|
|
911
1062
|
),
|
|
912
1063
|
ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server."),
|
|
@@ -927,7 +1078,7 @@ var SitesSchema = z29.record(
|
|
|
927
1078
|
// build: z.string().optional(),
|
|
928
1079
|
// }),
|
|
929
1080
|
// ]),
|
|
930
|
-
geoRestrictions:
|
|
1081
|
+
geoRestrictions: z30.array(z30.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
|
|
931
1082
|
// forwardHost: z
|
|
932
1083
|
// .boolean()
|
|
933
1084
|
// .default(false)
|
|
@@ -938,7 +1089,7 @@ var SitesSchema = z29.record(
|
|
|
938
1089
|
// 'Keep in mind that this requires an extra CloudFront Function.',
|
|
939
1090
|
// ].join('\n')
|
|
940
1091
|
// ),
|
|
941
|
-
errors:
|
|
1092
|
+
errors: z30.object({
|
|
942
1093
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
943
1094
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
944
1095
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -951,20 +1102,20 @@ var SitesSchema = z29.record(
|
|
|
951
1102
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
952
1103
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
953
1104
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
954
|
-
cors:
|
|
955
|
-
override:
|
|
1105
|
+
cors: z30.object({
|
|
1106
|
+
override: z30.boolean().default(false),
|
|
956
1107
|
maxAge: DurationSchema.default("365 days"),
|
|
957
|
-
exposeHeaders:
|
|
958
|
-
credentials:
|
|
959
|
-
headers:
|
|
960
|
-
origins:
|
|
961
|
-
methods:
|
|
1108
|
+
exposeHeaders: z30.string().array().optional(),
|
|
1109
|
+
credentials: z30.boolean().default(false),
|
|
1110
|
+
headers: z30.string().array().default(["*"]),
|
|
1111
|
+
origins: z30.string().array().default(["*"]),
|
|
1112
|
+
methods: z30.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
962
1113
|
}).optional().describe("Specify the cors headers."),
|
|
963
|
-
auth:
|
|
964
|
-
username:
|
|
965
|
-
password:
|
|
1114
|
+
auth: z30.object({
|
|
1115
|
+
username: z30.string().describe("Basic auth username"),
|
|
1116
|
+
password: z30.string().describe("Basic auth password")
|
|
966
1117
|
}).optional().describe("Enable basic authentication for the site"),
|
|
967
|
-
security:
|
|
1118
|
+
security: z30.object({
|
|
968
1119
|
// contentSecurityPolicy: z.object({
|
|
969
1120
|
// override: z.boolean().default(false),
|
|
970
1121
|
// policy: z.string(),
|
|
@@ -1006,10 +1157,10 @@ var SitesSchema = z29.record(
|
|
|
1006
1157
|
// reportUri?: string
|
|
1007
1158
|
// }
|
|
1008
1159
|
}).optional().describe("Specify the security policy."),
|
|
1009
|
-
cache:
|
|
1010
|
-
cookies:
|
|
1011
|
-
headers:
|
|
1012
|
-
queries:
|
|
1160
|
+
cache: z30.object({
|
|
1161
|
+
cookies: z30.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
1162
|
+
headers: z30.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
1163
|
+
queries: z30.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
1013
1164
|
}).optional().describe(
|
|
1014
1165
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
1015
1166
|
)
|
|
@@ -1017,22 +1168,22 @@ var SitesSchema = z29.record(
|
|
|
1017
1168
|
).optional().describe("Define the sites in your stack.");
|
|
1018
1169
|
|
|
1019
1170
|
// src/feature/store/schema.ts
|
|
1020
|
-
import { z as
|
|
1021
|
-
var StoresSchema =
|
|
1022
|
-
|
|
1171
|
+
import { z as z31 } from "zod";
|
|
1172
|
+
var StoresSchema = z31.union([
|
|
1173
|
+
z31.array(ResourceIdSchema).transform((list) => {
|
|
1023
1174
|
const stores = {};
|
|
1024
1175
|
for (const key of list) {
|
|
1025
1176
|
stores[key] = {};
|
|
1026
1177
|
}
|
|
1027
1178
|
return stores;
|
|
1028
1179
|
}),
|
|
1029
|
-
|
|
1180
|
+
z31.record(
|
|
1030
1181
|
ResourceIdSchema,
|
|
1031
|
-
|
|
1182
|
+
z31.object({
|
|
1032
1183
|
// cors: CorsSchema,
|
|
1033
1184
|
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
1034
|
-
versioning:
|
|
1035
|
-
events:
|
|
1185
|
+
versioning: z31.boolean().default(false).describe("Enable versioning of your store."),
|
|
1186
|
+
events: z31.object({
|
|
1036
1187
|
// create
|
|
1037
1188
|
"created:*": FunctionSchema.optional().describe(
|
|
1038
1189
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
@@ -1065,58 +1216,58 @@ var StoresSchema = z30.union([
|
|
|
1065
1216
|
]).optional().describe("Define the stores in your stack.");
|
|
1066
1217
|
|
|
1067
1218
|
// src/feature/icon/schema.ts
|
|
1068
|
-
import { z as
|
|
1219
|
+
import { z as z32 } from "zod";
|
|
1069
1220
|
var staticOriginSchema = LocalDirectorySchema.describe(
|
|
1070
1221
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
1071
1222
|
);
|
|
1072
1223
|
var functionOriginSchema = FunctionSchema.describe(
|
|
1073
1224
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1074
1225
|
);
|
|
1075
|
-
var IconsSchema =
|
|
1226
|
+
var IconsSchema = z32.record(
|
|
1076
1227
|
ResourceIdSchema,
|
|
1077
|
-
|
|
1228
|
+
z32.object({
|
|
1078
1229
|
domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
|
|
1079
|
-
subDomain:
|
|
1230
|
+
subDomain: z32.string().optional(),
|
|
1080
1231
|
log: LogSchema.optional(),
|
|
1081
1232
|
cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
|
|
1082
|
-
preserveId:
|
|
1083
|
-
symbols:
|
|
1084
|
-
origin:
|
|
1085
|
-
|
|
1233
|
+
preserveId: z32.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
|
|
1234
|
+
symbols: z32.boolean().optional().default(false).describe("Use SVG symbols for icons."),
|
|
1235
|
+
origin: z32.union([
|
|
1236
|
+
z32.object({
|
|
1086
1237
|
static: staticOriginSchema,
|
|
1087
1238
|
function: functionOriginSchema.optional()
|
|
1088
1239
|
}),
|
|
1089
|
-
|
|
1240
|
+
z32.object({
|
|
1090
1241
|
static: staticOriginSchema.optional(),
|
|
1091
1242
|
function: functionOriginSchema
|
|
1092
1243
|
}),
|
|
1093
|
-
|
|
1244
|
+
z32.object({
|
|
1094
1245
|
static: staticOriginSchema,
|
|
1095
1246
|
function: functionOriginSchema
|
|
1096
1247
|
})
|
|
1097
1248
|
]).describe(
|
|
1098
1249
|
"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."
|
|
1099
1250
|
),
|
|
1100
|
-
cors:
|
|
1101
|
-
override:
|
|
1251
|
+
cors: z32.object({
|
|
1252
|
+
override: z32.boolean().default(true),
|
|
1102
1253
|
maxAge: DurationSchema.default("365 days"),
|
|
1103
|
-
exposeHeaders:
|
|
1104
|
-
credentials:
|
|
1105
|
-
headers:
|
|
1106
|
-
origins:
|
|
1254
|
+
exposeHeaders: z32.string().array().optional(),
|
|
1255
|
+
credentials: z32.boolean().default(false),
|
|
1256
|
+
headers: z32.string().array().default(["*"]),
|
|
1257
|
+
origins: z32.string().array().default(["*"])
|
|
1107
1258
|
}).optional().describe("Specify the cors headers.")
|
|
1108
1259
|
// version: z.number().int().min(1).optional().describe('Version of the icon configuration.'),
|
|
1109
1260
|
})
|
|
1110
1261
|
).optional().describe("Define an icon proxy in your stack. Store, optimize, and deliver icons at scale.");
|
|
1111
1262
|
|
|
1112
1263
|
// src/feature/image/schema.ts
|
|
1113
|
-
import { z as
|
|
1114
|
-
var transformationOptionsSchema =
|
|
1115
|
-
width:
|
|
1116
|
-
height:
|
|
1117
|
-
fit:
|
|
1118
|
-
position:
|
|
1119
|
-
quality:
|
|
1264
|
+
import { z as z33 } from "zod";
|
|
1265
|
+
var transformationOptionsSchema = z33.object({
|
|
1266
|
+
width: z33.number().int().positive().optional(),
|
|
1267
|
+
height: z33.number().int().positive().optional(),
|
|
1268
|
+
fit: z33.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
|
|
1269
|
+
position: z33.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
|
|
1270
|
+
quality: z33.number().int().min(1).max(100).optional()
|
|
1120
1271
|
});
|
|
1121
1272
|
var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
1122
1273
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
@@ -1124,68 +1275,68 @@ var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
|
1124
1275
|
var functionOriginSchema2 = FunctionSchema.describe(
|
|
1125
1276
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1126
1277
|
);
|
|
1127
|
-
var ImagesSchema =
|
|
1278
|
+
var ImagesSchema = z33.record(
|
|
1128
1279
|
ResourceIdSchema,
|
|
1129
|
-
|
|
1280
|
+
z33.object({
|
|
1130
1281
|
domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
|
|
1131
|
-
subDomain:
|
|
1282
|
+
subDomain: z33.string().optional(),
|
|
1132
1283
|
log: LogSchema.optional(),
|
|
1133
1284
|
cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
|
|
1134
|
-
presets:
|
|
1135
|
-
extensions:
|
|
1136
|
-
jpeg:
|
|
1137
|
-
mozjpeg:
|
|
1138
|
-
progressive:
|
|
1285
|
+
presets: z33.record(z33.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
|
|
1286
|
+
extensions: z33.object({
|
|
1287
|
+
jpeg: z33.object({
|
|
1288
|
+
mozjpeg: z33.boolean().optional(),
|
|
1289
|
+
progressive: z33.boolean().optional()
|
|
1139
1290
|
}).optional(),
|
|
1140
|
-
webp:
|
|
1141
|
-
effort:
|
|
1142
|
-
lossless:
|
|
1143
|
-
nearLossless:
|
|
1291
|
+
webp: z33.object({
|
|
1292
|
+
effort: z33.number().int().min(1).max(10).default(7).optional(),
|
|
1293
|
+
lossless: z33.boolean().optional(),
|
|
1294
|
+
nearLossless: z33.boolean().optional()
|
|
1144
1295
|
}).optional(),
|
|
1145
|
-
png:
|
|
1146
|
-
compressionLevel:
|
|
1296
|
+
png: z33.object({
|
|
1297
|
+
compressionLevel: z33.number().int().min(0).max(9).default(6).optional()
|
|
1147
1298
|
}).optional()
|
|
1148
1299
|
}).refine((data) => {
|
|
1149
1300
|
return Object.keys(data).length > 0;
|
|
1150
1301
|
}, "At least one extension must be defined.").describe("Specify the allowed extensions."),
|
|
1151
|
-
origin:
|
|
1152
|
-
|
|
1302
|
+
origin: z33.union([
|
|
1303
|
+
z33.object({
|
|
1153
1304
|
static: staticOriginSchema2,
|
|
1154
1305
|
function: functionOriginSchema2.optional()
|
|
1155
1306
|
}),
|
|
1156
|
-
|
|
1307
|
+
z33.object({
|
|
1157
1308
|
static: staticOriginSchema2.optional(),
|
|
1158
1309
|
function: functionOriginSchema2
|
|
1159
1310
|
}),
|
|
1160
|
-
|
|
1311
|
+
z33.object({
|
|
1161
1312
|
static: staticOriginSchema2,
|
|
1162
1313
|
function: functionOriginSchema2
|
|
1163
1314
|
})
|
|
1164
1315
|
]).describe(
|
|
1165
1316
|
"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."
|
|
1166
1317
|
),
|
|
1167
|
-
version:
|
|
1318
|
+
version: z33.number().int().min(1).optional().describe("Version of the image configuration.")
|
|
1168
1319
|
})
|
|
1169
1320
|
).optional().describe("Define an image proxy in your stack. Store, transform, optimize, and deliver images at scale.");
|
|
1170
1321
|
|
|
1171
1322
|
// src/feature/table/schema.ts
|
|
1172
1323
|
import { minutes as minutes4, seconds as seconds4 } from "@awsless/duration";
|
|
1173
|
-
import { z as
|
|
1174
|
-
var KeySchema =
|
|
1175
|
-
var TablesSchema =
|
|
1324
|
+
import { z as z34 } from "zod";
|
|
1325
|
+
var KeySchema = z34.string().min(1).max(255);
|
|
1326
|
+
var TablesSchema = z34.record(
|
|
1176
1327
|
ResourceIdSchema,
|
|
1177
|
-
|
|
1328
|
+
z34.object({
|
|
1178
1329
|
hash: KeySchema.describe(
|
|
1179
1330
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
1180
1331
|
),
|
|
1181
1332
|
sort: KeySchema.optional().describe(
|
|
1182
1333
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
1183
1334
|
),
|
|
1184
|
-
fields:
|
|
1335
|
+
fields: z34.record(z34.string(), z34.enum(["string", "number", "binary"])).optional().describe(
|
|
1185
1336
|
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
1186
1337
|
),
|
|
1187
|
-
class:
|
|
1188
|
-
pointInTimeRecovery:
|
|
1338
|
+
class: z34.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
1339
|
+
pointInTimeRecovery: z34.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
1189
1340
|
ttl: KeySchema.optional().describe(
|
|
1190
1341
|
[
|
|
1191
1342
|
"The name of the TTL attribute used to store the expiration time for items in the table.",
|
|
@@ -1193,8 +1344,8 @@ var TablesSchema = z33.record(
|
|
|
1193
1344
|
].join("\n")
|
|
1194
1345
|
),
|
|
1195
1346
|
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
1196
|
-
stream:
|
|
1197
|
-
type:
|
|
1347
|
+
stream: z34.object({
|
|
1348
|
+
type: z34.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
1198
1349
|
[
|
|
1199
1350
|
"When an item in the table is modified, you can determines what information is written to the stream for this table.",
|
|
1200
1351
|
"Valid values are:",
|
|
@@ -1204,7 +1355,7 @@ var TablesSchema = z33.record(
|
|
|
1204
1355
|
"- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
1205
1356
|
].join("\n")
|
|
1206
1357
|
),
|
|
1207
|
-
batchSize:
|
|
1358
|
+
batchSize: z34.number().min(1).max(1e4).default(1).describe(
|
|
1208
1359
|
[
|
|
1209
1360
|
"The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
|
|
1210
1361
|
"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).",
|
|
@@ -1234,7 +1385,7 @@ var TablesSchema = z33.record(
|
|
|
1234
1385
|
// 'You can specify a number from -1 to 10000.',
|
|
1235
1386
|
// ].join('\n')
|
|
1236
1387
|
// ),
|
|
1237
|
-
retryAttempts:
|
|
1388
|
+
retryAttempts: z34.number().min(-1).max(1e4).default(-1).describe(
|
|
1238
1389
|
[
|
|
1239
1390
|
"Discard records after the specified number of retries.",
|
|
1240
1391
|
"The default value is -1, which sets the maximum number of retries to infinite.",
|
|
@@ -1242,7 +1393,7 @@ var TablesSchema = z33.record(
|
|
|
1242
1393
|
"You can specify a number from -1 to 10000."
|
|
1243
1394
|
].join("\n")
|
|
1244
1395
|
),
|
|
1245
|
-
concurrencyPerShard:
|
|
1396
|
+
concurrencyPerShard: z34.number().min(1).max(10).default(1).describe(
|
|
1246
1397
|
[
|
|
1247
1398
|
"The number of batches to process concurrently from each shard.",
|
|
1248
1399
|
"You can specify a number from 1 to 10."
|
|
@@ -1252,16 +1403,16 @@ var TablesSchema = z33.record(
|
|
|
1252
1403
|
}).optional().describe(
|
|
1253
1404
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
1254
1405
|
),
|
|
1255
|
-
indexes:
|
|
1256
|
-
|
|
1257
|
-
|
|
1406
|
+
indexes: z34.record(
|
|
1407
|
+
z34.string(),
|
|
1408
|
+
z34.object({
|
|
1258
1409
|
hash: KeySchema.describe(
|
|
1259
1410
|
"Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
|
|
1260
1411
|
),
|
|
1261
1412
|
sort: KeySchema.optional().describe(
|
|
1262
1413
|
"Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
|
|
1263
1414
|
),
|
|
1264
|
-
projection:
|
|
1415
|
+
projection: z34.enum(["all", "keys-only"]).default("all").describe(
|
|
1265
1416
|
[
|
|
1266
1417
|
"The set of attributes that are projected into the index:",
|
|
1267
1418
|
"- all - All of the table attributes are projected into the index.",
|
|
@@ -1275,11 +1426,11 @@ var TablesSchema = z33.record(
|
|
|
1275
1426
|
).optional().describe("Define the tables in your stack.");
|
|
1276
1427
|
|
|
1277
1428
|
// src/feature/task/schema.ts
|
|
1278
|
-
import { z as
|
|
1279
|
-
var RetryAttemptsSchema2 =
|
|
1429
|
+
import { z as z35 } from "zod";
|
|
1430
|
+
var RetryAttemptsSchema2 = z35.number().int().min(0).max(2).describe(
|
|
1280
1431
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1281
1432
|
);
|
|
1282
|
-
var TaskSchema =
|
|
1433
|
+
var TaskSchema = z35.union([
|
|
1283
1434
|
LocalFileSchema.transform((file) => ({
|
|
1284
1435
|
consumer: {
|
|
1285
1436
|
code: {
|
|
@@ -1290,33 +1441,33 @@ var TaskSchema = z34.union([
|
|
|
1290
1441
|
},
|
|
1291
1442
|
retryAttempts: void 0
|
|
1292
1443
|
})),
|
|
1293
|
-
|
|
1444
|
+
z35.object({
|
|
1294
1445
|
consumer: FunctionSchema,
|
|
1295
1446
|
retryAttempts: RetryAttemptsSchema2.optional()
|
|
1296
1447
|
})
|
|
1297
1448
|
]);
|
|
1298
|
-
var TasksSchema =
|
|
1449
|
+
var TasksSchema = z35.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1299
1450
|
|
|
1300
1451
|
// src/feature/test/schema.ts
|
|
1301
|
-
import { z as
|
|
1302
|
-
var TestsSchema =
|
|
1452
|
+
import { z as z36 } from "zod";
|
|
1453
|
+
var TestsSchema = z36.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
1303
1454
|
|
|
1304
1455
|
// src/feature/topic/schema.ts
|
|
1305
1456
|
import { kebabCase as kebabCase3 } from "change-case";
|
|
1306
|
-
import { z as
|
|
1307
|
-
var TopicNameSchema =
|
|
1308
|
-
var TopicsSchema =
|
|
1457
|
+
import { z as z37 } from "zod";
|
|
1458
|
+
var TopicNameSchema = z37.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
|
|
1459
|
+
var TopicsSchema = z37.array(TopicNameSchema).refine((topics) => {
|
|
1309
1460
|
return topics.length === new Set(topics).size;
|
|
1310
1461
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
1311
|
-
var SubscribersSchema =
|
|
1462
|
+
var SubscribersSchema = z37.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
1312
1463
|
|
|
1313
1464
|
// src/config/stack.ts
|
|
1314
1465
|
var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
|
|
1315
1466
|
var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
|
|
1316
1467
|
message: `Stack name can't be a reserved name.`
|
|
1317
1468
|
}).describe("Stack name.");
|
|
1318
|
-
var StackSchema =
|
|
1319
|
-
$schema:
|
|
1469
|
+
var StackSchema = z38.object({
|
|
1470
|
+
$schema: z38.string().optional(),
|
|
1320
1471
|
name: NameSchema,
|
|
1321
1472
|
depends: DependsSchema,
|
|
1322
1473
|
commands: CommandsSchema,
|
|
@@ -1332,7 +1483,7 @@ var StackSchema = z37.object({
|
|
|
1332
1483
|
topics: TopicsSchema,
|
|
1333
1484
|
subscribers: SubscribersSchema,
|
|
1334
1485
|
functions: FunctionsSchema,
|
|
1335
|
-
|
|
1486
|
+
instances: InstancesSchema,
|
|
1336
1487
|
tasks: TasksSchema,
|
|
1337
1488
|
tables: TablesSchema,
|
|
1338
1489
|
stores: StoresSchema,
|