@awsless/awsless 0.0.471 → 0.0.473
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 +490 -374
- package/dist/build-json-schema.js +293 -202
- package/dist/prebuild/rpc/HASH +1 -1
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/prebuild.js +21 -24
- package/dist/stack.json +1 -1
- package/package.json +14 -14
package/dist/bin.js
CHANGED
|
@@ -414,7 +414,7 @@ var debug = (...parts) => {
|
|
|
414
414
|
};
|
|
415
415
|
|
|
416
416
|
// src/config/app.ts
|
|
417
|
-
import { z as
|
|
417
|
+
import { z as z21 } from "zod";
|
|
418
418
|
|
|
419
419
|
// src/feature/alert/schema.ts
|
|
420
420
|
import { kebabCase } from "change-case";
|
|
@@ -529,10 +529,11 @@ var DomainsDefaultSchema = z6.record(
|
|
|
529
529
|
// src/feature/function/schema.ts
|
|
530
530
|
import { days, minutes, seconds, toDays } from "@awsless/duration";
|
|
531
531
|
import { gibibytes, mebibytes } from "@awsless/size";
|
|
532
|
-
import { z as
|
|
532
|
+
import { z as z11 } from "zod";
|
|
533
533
|
|
|
534
534
|
// src/config/schema/local-directory.ts
|
|
535
535
|
import { stat } from "fs/promises";
|
|
536
|
+
import { z as z8 } from "zod";
|
|
536
537
|
|
|
537
538
|
// src/config/schema/relative-path.ts
|
|
538
539
|
import { join as join3 } from "path";
|
|
@@ -550,30 +551,41 @@ var resolvePath = (path) => {
|
|
|
550
551
|
var RelativePathSchema = z7.string().transform((path) => resolvePath(path));
|
|
551
552
|
|
|
552
553
|
// src/config/schema/local-directory.ts
|
|
553
|
-
var LocalDirectorySchema =
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
554
|
+
var LocalDirectorySchema = z8.union([
|
|
555
|
+
RelativePathSchema.refine(async (path) => {
|
|
556
|
+
try {
|
|
557
|
+
const s = await stat(path);
|
|
558
|
+
return s.isDirectory();
|
|
559
|
+
} catch (error) {
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
}, `Directory doesn't exist`),
|
|
563
|
+
z8.object({
|
|
564
|
+
nocheck: z8.string().describe("Specifies a local directory without checking if the directory exists.")
|
|
565
|
+
}).transform((v) => v.nocheck)
|
|
566
|
+
]);
|
|
561
567
|
|
|
562
568
|
// src/config/schema/local-file.ts
|
|
563
569
|
import { stat as stat2 } from "fs/promises";
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
import { z as z9 } from "zod";
|
|
571
|
+
var LocalFileSchema = z9.union([
|
|
572
|
+
RelativePathSchema.refine(async (path) => {
|
|
573
|
+
try {
|
|
574
|
+
const s = await stat2(path);
|
|
575
|
+
return s.isFile();
|
|
576
|
+
} catch (error) {
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
}, `File doesn't exist`),
|
|
580
|
+
z9.object({
|
|
581
|
+
nocheck: z9.string().describe("Specifies a local file without checking if the file exists.")
|
|
582
|
+
}).transform((v) => v.nocheck)
|
|
583
|
+
]);
|
|
572
584
|
|
|
573
585
|
// src/config/schema/size.ts
|
|
574
586
|
import { parse as parse2 } from "@awsless/size";
|
|
575
|
-
import { z as
|
|
576
|
-
var SizeSchema =
|
|
587
|
+
import { z as z10 } from "zod";
|
|
588
|
+
var SizeSchema = z10.string().regex(/^[0-9]+ (B|KB|MB|GB|TB|PB)$/, "Invalid size").transform((v) => parse2(v));
|
|
577
589
|
var sizeMin = (min) => {
|
|
578
590
|
return (size) => {
|
|
579
591
|
return size.value >= min.value;
|
|
@@ -596,32 +608,32 @@ var EphemeralStorageSizeSchema = SizeSchema.refine(
|
|
|
596
608
|
sizeMin(mebibytes(512)),
|
|
597
609
|
"Minimum ephemeral storage size is 512 MB"
|
|
598
610
|
).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.");
|
|
599
|
-
var ReservedConcurrentExecutionsSchema =
|
|
600
|
-
var EnvironmentSchema =
|
|
601
|
-
var ArchitectureSchema =
|
|
602
|
-
var RetryAttemptsSchema =
|
|
611
|
+
var ReservedConcurrentExecutionsSchema = z11.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
|
|
612
|
+
var EnvironmentSchema = z11.record(z11.string(), z11.string()).optional().describe("Environment variable key-value pairs.");
|
|
613
|
+
var ArchitectureSchema = z11.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
614
|
+
var RetryAttemptsSchema = z11.number().int().min(0).max(2).describe(
|
|
603
615
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
604
616
|
);
|
|
605
|
-
var NodeRuntimeSchema =
|
|
606
|
-
var ContainerRuntimeSchema =
|
|
617
|
+
var NodeRuntimeSchema = z11.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]);
|
|
618
|
+
var ContainerRuntimeSchema = z11.literal("container");
|
|
607
619
|
var RuntimeSchema = NodeRuntimeSchema.or(ContainerRuntimeSchema).describe("The identifier of the function's runtime.");
|
|
608
|
-
var ActionSchema =
|
|
609
|
-
var ActionsSchema =
|
|
610
|
-
var ArnSchema =
|
|
611
|
-
var WildcardSchema =
|
|
612
|
-
var ResourceSchema =
|
|
613
|
-
var ResourcesSchema =
|
|
614
|
-
var PermissionSchema =
|
|
615
|
-
effect:
|
|
620
|
+
var ActionSchema = z11.string();
|
|
621
|
+
var ActionsSchema = z11.union([ActionSchema.transform((v) => [v]), ActionSchema.array()]);
|
|
622
|
+
var ArnSchema = z11.string().startsWith("arn:");
|
|
623
|
+
var WildcardSchema = z11.literal("*");
|
|
624
|
+
var ResourceSchema = z11.union([ArnSchema, WildcardSchema]);
|
|
625
|
+
var ResourcesSchema = z11.union([ResourceSchema.transform((v) => [v]), ResourceSchema.array()]);
|
|
626
|
+
var PermissionSchema = z11.object({
|
|
627
|
+
effect: z11.enum(["allow", "deny"]).default("allow"),
|
|
616
628
|
actions: ActionsSchema,
|
|
617
629
|
resources: ResourcesSchema
|
|
618
630
|
});
|
|
619
|
-
var PermissionsSchema =
|
|
620
|
-
var WarmSchema =
|
|
621
|
-
var VPCSchema =
|
|
622
|
-
var MinifySchema =
|
|
623
|
-
var HandlerSchema =
|
|
624
|
-
var DescriptionSchema =
|
|
631
|
+
var PermissionsSchema = z11.union([PermissionSchema.transform((v) => [v]), PermissionSchema.array()]).describe("Add IAM permissions to your function.");
|
|
632
|
+
var WarmSchema = z11.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.");
|
|
633
|
+
var VPCSchema = z11.boolean().describe("Put the function inside your global VPC.");
|
|
634
|
+
var MinifySchema = z11.boolean().describe("Minify the function code.");
|
|
635
|
+
var HandlerSchema = z11.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
|
|
636
|
+
var DescriptionSchema = z11.string().describe("A description of the function.");
|
|
625
637
|
var validLogRetentionDays = [
|
|
626
638
|
...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
|
|
627
639
|
...[180, 365, 400, 545, 731, 1096, 1827, 2192],
|
|
@@ -636,43 +648,43 @@ var LogRetentionSchema = DurationSchema.refine(
|
|
|
636
648
|
},
|
|
637
649
|
`Invalid log retention. Valid days are: ${validLogRetentionDays.map((days6) => `${days6}`).join(", ")}`
|
|
638
650
|
).describe("The log retention duration.");
|
|
639
|
-
var LogSchema =
|
|
640
|
-
|
|
651
|
+
var LogSchema = z11.union([
|
|
652
|
+
z11.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
|
|
641
653
|
LogRetentionSchema.transform((retention) => ({ retention })),
|
|
642
|
-
|
|
654
|
+
z11.object({
|
|
643
655
|
// subscription: LogSubscriptionSchema.optional(),
|
|
644
656
|
retention: LogRetentionSchema.optional(),
|
|
645
|
-
format:
|
|
657
|
+
format: z11.enum(["text", "json"]).describe(
|
|
646
658
|
`The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.`
|
|
647
659
|
).optional(),
|
|
648
|
-
system:
|
|
660
|
+
system: z11.enum(["debug", "info", "warn"]).describe(
|
|
649
661
|
"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."
|
|
650
662
|
).optional(),
|
|
651
|
-
level:
|
|
663
|
+
level: z11.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
|
|
652
664
|
"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."
|
|
653
665
|
).optional()
|
|
654
666
|
})
|
|
655
667
|
]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
|
|
656
|
-
var LayersSchema =
|
|
668
|
+
var LayersSchema = z11.string().array().describe(
|
|
657
669
|
// `A list of function layers to add to the function's execution environment..`
|
|
658
670
|
`A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.`
|
|
659
671
|
);
|
|
660
|
-
var FileCodeSchema =
|
|
672
|
+
var FileCodeSchema = z11.object({
|
|
661
673
|
file: LocalFileSchema.describe("The file path of the function code."),
|
|
662
674
|
minify: MinifySchema.optional().default(true),
|
|
663
|
-
external:
|
|
675
|
+
external: z11.string().array().optional().describe(`A list of external packages that won't be included in the bundle.`)
|
|
664
676
|
});
|
|
665
|
-
var BundleCodeSchema =
|
|
677
|
+
var BundleCodeSchema = z11.object({
|
|
666
678
|
bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
|
|
667
679
|
});
|
|
668
|
-
var CodeSchema =
|
|
680
|
+
var CodeSchema = z11.union([
|
|
669
681
|
LocalFileSchema.transform((file) => ({
|
|
670
682
|
file
|
|
671
683
|
})).pipe(FileCodeSchema),
|
|
672
684
|
FileCodeSchema,
|
|
673
685
|
BundleCodeSchema
|
|
674
686
|
]).describe("Specify the code of your function.");
|
|
675
|
-
var FnSchema =
|
|
687
|
+
var FnSchema = z11.object({
|
|
676
688
|
code: CodeSchema,
|
|
677
689
|
// node
|
|
678
690
|
handler: HandlerSchema.optional(),
|
|
@@ -695,14 +707,14 @@ var FnSchema = z9.object({
|
|
|
695
707
|
environment: EnvironmentSchema.optional(),
|
|
696
708
|
permissions: PermissionsSchema.optional()
|
|
697
709
|
});
|
|
698
|
-
var FunctionSchema =
|
|
710
|
+
var FunctionSchema = z11.union([
|
|
699
711
|
LocalFileSchema.transform((code) => ({
|
|
700
712
|
code
|
|
701
713
|
})).pipe(FnSchema),
|
|
702
714
|
FnSchema
|
|
703
715
|
]);
|
|
704
|
-
var FunctionsSchema =
|
|
705
|
-
var FunctionDefaultSchema =
|
|
716
|
+
var FunctionsSchema = z11.record(ResourceIdSchema, FunctionSchema).optional().describe("Define the functions in your stack.");
|
|
717
|
+
var FunctionDefaultSchema = z11.object({
|
|
706
718
|
runtime: RuntimeSchema.default("nodejs20.x"),
|
|
707
719
|
// node
|
|
708
720
|
handler: HandlerSchema.default("index.default"),
|
|
@@ -731,25 +743,25 @@ var FunctionDefaultSchema = z9.object({
|
|
|
731
743
|
}).default({});
|
|
732
744
|
|
|
733
745
|
// src/feature/layer/schema.ts
|
|
734
|
-
import { z as
|
|
746
|
+
import { z as z13 } from "zod";
|
|
735
747
|
|
|
736
748
|
// src/config/schema/lambda.ts
|
|
737
|
-
import { z as
|
|
738
|
-
var ArchitectureSchema2 =
|
|
739
|
-
var NodeRuntimeSchema2 =
|
|
749
|
+
import { z as z12 } from "zod";
|
|
750
|
+
var ArchitectureSchema2 = z12.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
751
|
+
var NodeRuntimeSchema2 = z12.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).describe("The identifier of the function's runtime.");
|
|
740
752
|
|
|
741
753
|
// src/feature/layer/schema.ts
|
|
742
|
-
var Schema =
|
|
754
|
+
var Schema = z13.object({
|
|
743
755
|
file: LocalFileSchema,
|
|
744
756
|
runtimes: NodeRuntimeSchema2.array().optional(),
|
|
745
757
|
architecture: ArchitectureSchema2.optional(),
|
|
746
|
-
packages:
|
|
758
|
+
packages: z13.string().array().optional().describe(
|
|
747
759
|
"Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
|
|
748
760
|
)
|
|
749
761
|
});
|
|
750
|
-
var LayerSchema =
|
|
751
|
-
|
|
752
|
-
|
|
762
|
+
var LayerSchema = z13.record(
|
|
763
|
+
z13.string(),
|
|
764
|
+
z13.union([
|
|
753
765
|
LocalFileSchema.transform((file) => ({
|
|
754
766
|
file,
|
|
755
767
|
description: void 0
|
|
@@ -764,28 +776,28 @@ var OnFailureDefaultSchema = FunctionSchema.optional().describe(
|
|
|
764
776
|
);
|
|
765
777
|
|
|
766
778
|
// src/feature/on-log/schema.ts
|
|
767
|
-
import { z as
|
|
768
|
-
var FilterSchema =
|
|
769
|
-
var OnLogDefaultSchema =
|
|
779
|
+
import { z as z14 } from "zod";
|
|
780
|
+
var FilterSchema = z14.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
|
|
781
|
+
var OnLogDefaultSchema = z14.union([
|
|
770
782
|
FunctionSchema.transform((consumer) => ({
|
|
771
783
|
consumer,
|
|
772
784
|
filter: ["error", "fatal"]
|
|
773
785
|
})),
|
|
774
|
-
|
|
786
|
+
z14.object({
|
|
775
787
|
consumer: FunctionSchema,
|
|
776
788
|
filter: FilterSchema
|
|
777
789
|
})
|
|
778
790
|
]).optional().describe("Define a subscription on all Lambda functions logs.");
|
|
779
791
|
|
|
780
792
|
// src/feature/pubsub/schema.ts
|
|
781
|
-
import { z as
|
|
793
|
+
import { z as z15 } from "zod";
|
|
782
794
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
783
|
-
var PubSubDefaultSchema =
|
|
795
|
+
var PubSubDefaultSchema = z15.record(
|
|
784
796
|
ResourceIdSchema,
|
|
785
|
-
|
|
797
|
+
z15.object({
|
|
786
798
|
auth: FunctionSchema,
|
|
787
799
|
domain: DomainSchema.optional(),
|
|
788
|
-
subDomain:
|
|
800
|
+
subDomain: z15.string().optional()
|
|
789
801
|
// auth: z.union([
|
|
790
802
|
// ResourceIdSchema,
|
|
791
803
|
// z.object({
|
|
@@ -801,11 +813,11 @@ var PubSubDefaultSchema = z13.record(
|
|
|
801
813
|
// .optional(),
|
|
802
814
|
})
|
|
803
815
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
804
|
-
var PubSubSchema =
|
|
816
|
+
var PubSubSchema = z15.record(
|
|
805
817
|
ResourceIdSchema,
|
|
806
|
-
|
|
807
|
-
sql:
|
|
808
|
-
sqlVersion:
|
|
818
|
+
z15.object({
|
|
819
|
+
sql: z15.string().describe("The SQL statement used to query the IOT topic."),
|
|
820
|
+
sqlVersion: z15.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
|
|
809
821
|
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
810
822
|
})
|
|
811
823
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
@@ -813,7 +825,7 @@ var PubSubSchema = z13.record(
|
|
|
813
825
|
// src/feature/queue/schema.ts
|
|
814
826
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
815
827
|
import { kibibytes } from "@awsless/size";
|
|
816
|
-
import { z as
|
|
828
|
+
import { z as z16 } from "zod";
|
|
817
829
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
818
830
|
durationMin(minutes2(1)),
|
|
819
831
|
"Minimum retention period is 1 minute"
|
|
@@ -841,10 +853,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
841
853
|
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(
|
|
842
854
|
"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."
|
|
843
855
|
);
|
|
844
|
-
var BatchSizeSchema =
|
|
856
|
+
var BatchSizeSchema = z16.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
845
857
|
"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."
|
|
846
858
|
);
|
|
847
|
-
var MaxConcurrencySchema =
|
|
859
|
+
var MaxConcurrencySchema = z16.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
848
860
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
849
861
|
);
|
|
850
862
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -853,7 +865,7 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
853
865
|
).describe(
|
|
854
866
|
"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."
|
|
855
867
|
);
|
|
856
|
-
var QueueDefaultSchema =
|
|
868
|
+
var QueueDefaultSchema = z16.object({
|
|
857
869
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
858
870
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
859
871
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -863,7 +875,7 @@ var QueueDefaultSchema = z14.object({
|
|
|
863
875
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
864
876
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
865
877
|
}).default({});
|
|
866
|
-
var QueueSchema =
|
|
878
|
+
var QueueSchema = z16.object({
|
|
867
879
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
868
880
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
869
881
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
@@ -874,9 +886,9 @@ var QueueSchema = z14.object({
|
|
|
874
886
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
875
887
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
876
888
|
});
|
|
877
|
-
var QueuesSchema =
|
|
889
|
+
var QueuesSchema = z16.record(
|
|
878
890
|
ResourceIdSchema,
|
|
879
|
-
|
|
891
|
+
z16.union([
|
|
880
892
|
LocalFileSchema.transform((consumer) => ({
|
|
881
893
|
consumer
|
|
882
894
|
})).pipe(QueueSchema),
|
|
@@ -885,41 +897,50 @@ var QueuesSchema = z14.record(
|
|
|
885
897
|
).optional().describe("Define the queues in your stack.");
|
|
886
898
|
|
|
887
899
|
// src/feature/rest/schema.ts
|
|
888
|
-
import { z as
|
|
900
|
+
import { z as z18 } from "zod";
|
|
889
901
|
|
|
890
902
|
// src/config/schema/route.ts
|
|
891
|
-
import { z as
|
|
892
|
-
var RouteSchema =
|
|
893
|
-
|
|
894
|
-
|
|
903
|
+
import { z as z17 } from "zod";
|
|
904
|
+
var RouteSchema = z17.union([
|
|
905
|
+
z17.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
906
|
+
z17.literal("$default")
|
|
895
907
|
]);
|
|
896
908
|
|
|
897
909
|
// src/feature/rest/schema.ts
|
|
898
|
-
var RestDefaultSchema =
|
|
910
|
+
var RestDefaultSchema = z18.record(
|
|
899
911
|
ResourceIdSchema,
|
|
900
|
-
|
|
912
|
+
z18.object({
|
|
901
913
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
902
|
-
subDomain:
|
|
914
|
+
subDomain: z18.string().optional()
|
|
903
915
|
})
|
|
904
916
|
).optional().describe("Define your global REST API's.");
|
|
905
|
-
var RestSchema =
|
|
917
|
+
var RestSchema = z18.record(ResourceIdSchema, z18.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
906
918
|
|
|
907
919
|
// src/feature/rpc/schema.ts
|
|
908
|
-
import { z as
|
|
909
|
-
|
|
920
|
+
import { z as z19 } from "zod";
|
|
921
|
+
import { minutes as minutes3, seconds as seconds3 } from "@awsless/duration";
|
|
922
|
+
var TimeoutSchema2 = DurationSchema.refine(durationMin(seconds3(10)), "Minimum timeout duration is 10 seconds").refine(durationMax(minutes3(5)), "Maximum timeout duration is 5 minutes").describe(
|
|
923
|
+
[
|
|
924
|
+
"The amount of time that the RPC lambda is allowed run before stopping it.",
|
|
925
|
+
"You can specify a size value from 1 second to 5 minutes.",
|
|
926
|
+
"The timeouts of all inner RPC functions will be capped at 80% of this timeout."
|
|
927
|
+
].join(" ")
|
|
928
|
+
);
|
|
929
|
+
var RpcDefaultSchema = z19.record(
|
|
910
930
|
ResourceIdSchema,
|
|
911
|
-
|
|
931
|
+
z19.object({
|
|
912
932
|
domain: ResourceIdSchema.describe("The domain id to link your RPC API with.").optional(),
|
|
913
|
-
subDomain:
|
|
933
|
+
subDomain: z19.string().optional(),
|
|
914
934
|
auth: FunctionSchema.optional(),
|
|
915
935
|
log: LogSchema.optional(),
|
|
916
|
-
|
|
936
|
+
timeout: TimeoutSchema2.default("1 minutes"),
|
|
937
|
+
geoRestrictions: z19.array(z19.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked.")
|
|
917
938
|
})
|
|
918
939
|
).describe(`Define the global RPC API's.`).optional();
|
|
919
|
-
var RpcSchema =
|
|
940
|
+
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();
|
|
920
941
|
|
|
921
942
|
// src/config/schema/region.ts
|
|
922
|
-
import { z as
|
|
943
|
+
import { z as z20 } from "zod";
|
|
923
944
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
924
945
|
var AF = ["af-south-1"];
|
|
925
946
|
var AP = [
|
|
@@ -948,16 +969,16 @@ var EU = [
|
|
|
948
969
|
var ME = ["me-south-1", "me-central-1"];
|
|
949
970
|
var SA = ["sa-east-1"];
|
|
950
971
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
951
|
-
var RegionSchema =
|
|
972
|
+
var RegionSchema = z20.enum(regions);
|
|
952
973
|
|
|
953
974
|
// src/config/app.ts
|
|
954
|
-
var AppSchema =
|
|
955
|
-
$schema:
|
|
975
|
+
var AppSchema = z21.object({
|
|
976
|
+
$schema: z21.string().optional(),
|
|
956
977
|
name: ResourceIdSchema.describe("App name."),
|
|
957
978
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
958
|
-
profile:
|
|
959
|
-
protect:
|
|
960
|
-
removal:
|
|
979
|
+
profile: z21.string().describe("The AWS profile to deploy to."),
|
|
980
|
+
protect: z21.boolean().default(false).describe("Protect your app & stacks from being deleted."),
|
|
981
|
+
removal: z21.enum(["remove", "retain"]).default("remove").describe(
|
|
961
982
|
[
|
|
962
983
|
"Configure how your resources are handled when they have to be removed.",
|
|
963
984
|
"",
|
|
@@ -971,7 +992,7 @@ var AppSchema = z19.object({
|
|
|
971
992
|
// .default('prod')
|
|
972
993
|
// .describe('The deployment stage.'),
|
|
973
994
|
// onFailure: OnFailureSchema,
|
|
974
|
-
defaults:
|
|
995
|
+
defaults: z21.object({
|
|
975
996
|
onFailure: OnFailureDefaultSchema,
|
|
976
997
|
onLog: OnLogDefaultSchema,
|
|
977
998
|
auth: AuthDefaultSchema,
|
|
@@ -993,11 +1014,11 @@ var AppSchema = z19.object({
|
|
|
993
1014
|
});
|
|
994
1015
|
|
|
995
1016
|
// src/config/stack.ts
|
|
996
|
-
import { z as
|
|
1017
|
+
import { z as z34 } from "zod";
|
|
997
1018
|
|
|
998
1019
|
// src/feature/cache/schema.ts
|
|
999
1020
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
1000
|
-
import { z as
|
|
1021
|
+
import { z as z22 } from "zod";
|
|
1001
1022
|
var StorageSchema = SizeSchema.refine(sizeMin(gibibytes2(1)), "Minimum storage size is 1 GB").refine(
|
|
1002
1023
|
sizeMax(gibibytes2(5e3)),
|
|
1003
1024
|
"Maximum storage size is 5000 GB"
|
|
@@ -1008,31 +1029,31 @@ var MinimumStorageSchema = StorageSchema.describe(
|
|
|
1008
1029
|
var MaximumStorageSchema = StorageSchema.describe(
|
|
1009
1030
|
"The upper limit for data storage the cache is set to use. You can specify a size value from 1 GB to 5000 GB."
|
|
1010
1031
|
);
|
|
1011
|
-
var EcpuSchema =
|
|
1032
|
+
var EcpuSchema = z22.number().int().min(1e3).max(15e6);
|
|
1012
1033
|
var MinimumEcpuSchema = EcpuSchema.describe(
|
|
1013
1034
|
"The minimum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1014
1035
|
);
|
|
1015
1036
|
var MaximumEcpuSchema = EcpuSchema.describe(
|
|
1016
1037
|
"The maximum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1017
1038
|
);
|
|
1018
|
-
var CachesSchema =
|
|
1039
|
+
var CachesSchema = z22.record(
|
|
1019
1040
|
ResourceIdSchema,
|
|
1020
|
-
|
|
1041
|
+
z22.object({
|
|
1021
1042
|
minStorage: MinimumStorageSchema.optional(),
|
|
1022
1043
|
maxStorage: MaximumStorageSchema.optional(),
|
|
1023
1044
|
minECPU: MinimumEcpuSchema.optional(),
|
|
1024
1045
|
maxECPU: MaximumEcpuSchema.optional(),
|
|
1025
|
-
snapshotRetentionLimit:
|
|
1046
|
+
snapshotRetentionLimit: z22.number().int().positive().default(1)
|
|
1026
1047
|
})
|
|
1027
1048
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
1028
1049
|
|
|
1029
1050
|
// src/feature/command/schema.ts
|
|
1030
|
-
import { z as
|
|
1031
|
-
var CommandSchema =
|
|
1032
|
-
|
|
1051
|
+
import { z as z23 } from "zod";
|
|
1052
|
+
var CommandSchema = z23.union([
|
|
1053
|
+
z23.object({
|
|
1033
1054
|
file: LocalFileSchema,
|
|
1034
|
-
handler:
|
|
1035
|
-
description:
|
|
1055
|
+
handler: z23.string().default("default").describe("The name of the handler that needs to run"),
|
|
1056
|
+
description: z23.string().optional().describe("A description of the command")
|
|
1036
1057
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
1037
1058
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
1038
1059
|
}),
|
|
@@ -1042,22 +1063,22 @@ var CommandSchema = z21.union([
|
|
|
1042
1063
|
description: void 0
|
|
1043
1064
|
}))
|
|
1044
1065
|
]);
|
|
1045
|
-
var CommandsSchema =
|
|
1066
|
+
var CommandsSchema = z23.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
1046
1067
|
|
|
1047
1068
|
// src/feature/config/schema.ts
|
|
1048
|
-
import { z as
|
|
1049
|
-
var ConfigNameSchema =
|
|
1050
|
-
var ConfigsSchema =
|
|
1069
|
+
import { z as z24 } from "zod";
|
|
1070
|
+
var ConfigNameSchema = z24.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
1071
|
+
var ConfigsSchema = z24.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
1051
1072
|
|
|
1052
1073
|
// src/feature/cron/schema/index.ts
|
|
1053
|
-
import { z as
|
|
1074
|
+
import { z as z26 } from "zod";
|
|
1054
1075
|
|
|
1055
1076
|
// src/feature/cron/schema/schedule.ts
|
|
1056
|
-
import { z as
|
|
1077
|
+
import { z as z25 } from "zod";
|
|
1057
1078
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
1058
|
-
var RateExpressionSchema =
|
|
1079
|
+
var RateExpressionSchema = z25.custom(
|
|
1059
1080
|
(value) => {
|
|
1060
|
-
return
|
|
1081
|
+
return z25.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
1061
1082
|
const [str] = rate.split(" ");
|
|
1062
1083
|
const number = parseInt(str);
|
|
1063
1084
|
return number > 0;
|
|
@@ -1073,9 +1094,9 @@ var RateExpressionSchema = z23.custom(
|
|
|
1073
1094
|
}
|
|
1074
1095
|
return `rate(${rate})`;
|
|
1075
1096
|
});
|
|
1076
|
-
var CronExpressionSchema =
|
|
1097
|
+
var CronExpressionSchema = z25.custom(
|
|
1077
1098
|
(value) => {
|
|
1078
|
-
return
|
|
1099
|
+
return z25.string().safeParse(value).success;
|
|
1079
1100
|
},
|
|
1080
1101
|
{ message: "Invalid cron expression" }
|
|
1081
1102
|
).superRefine((value, ctx) => {
|
|
@@ -1084,12 +1105,12 @@ var CronExpressionSchema = z23.custom(
|
|
|
1084
1105
|
} catch (error) {
|
|
1085
1106
|
if (error instanceof Error) {
|
|
1086
1107
|
ctx.addIssue({
|
|
1087
|
-
code:
|
|
1108
|
+
code: z25.ZodIssueCode.custom,
|
|
1088
1109
|
message: `Invalid cron expression: ${error.message}`
|
|
1089
1110
|
});
|
|
1090
1111
|
} else {
|
|
1091
1112
|
ctx.addIssue({
|
|
1092
|
-
code:
|
|
1113
|
+
code: z25.ZodIssueCode.custom,
|
|
1093
1114
|
message: "Invalid cron expression"
|
|
1094
1115
|
});
|
|
1095
1116
|
}
|
|
@@ -1100,23 +1121,23 @@ var CronExpressionSchema = z23.custom(
|
|
|
1100
1121
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
1101
1122
|
|
|
1102
1123
|
// src/feature/cron/schema/index.ts
|
|
1103
|
-
var CronsSchema =
|
|
1124
|
+
var CronsSchema = z26.record(
|
|
1104
1125
|
ResourceIdSchema,
|
|
1105
|
-
|
|
1106
|
-
enabled:
|
|
1126
|
+
z26.object({
|
|
1127
|
+
enabled: z26.boolean().default(true).describe("If the cron is enabled."),
|
|
1107
1128
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
1108
1129
|
schedule: ScheduleExpressionSchema.describe(
|
|
1109
1130
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
1110
1131
|
),
|
|
1111
|
-
payload:
|
|
1132
|
+
payload: z26.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
1112
1133
|
})
|
|
1113
1134
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
1114
1135
|
|
|
1115
1136
|
// src/feature/search/schema.ts
|
|
1116
1137
|
import { gibibytes as gibibytes3 } from "@awsless/size";
|
|
1117
|
-
import { z as
|
|
1118
|
-
var VersionSchema =
|
|
1119
|
-
var TypeSchema =
|
|
1138
|
+
import { z as z27 } from "zod";
|
|
1139
|
+
var VersionSchema = z27.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
|
|
1140
|
+
var TypeSchema = z27.enum([
|
|
1120
1141
|
"t3.small",
|
|
1121
1142
|
"t3.medium",
|
|
1122
1143
|
"m3.medium",
|
|
@@ -1191,11 +1212,11 @@ var TypeSchema = z25.enum([
|
|
|
1191
1212
|
"r6gd.16xlarge"
|
|
1192
1213
|
]);
|
|
1193
1214
|
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.");
|
|
1194
|
-
var SearchsSchema =
|
|
1215
|
+
var SearchsSchema = z27.record(
|
|
1195
1216
|
ResourceIdSchema,
|
|
1196
|
-
|
|
1217
|
+
z27.object({
|
|
1197
1218
|
type: TypeSchema.default("t3.small"),
|
|
1198
|
-
count:
|
|
1219
|
+
count: z27.number().int().min(1).default(1),
|
|
1199
1220
|
version: VersionSchema.default("2.13"),
|
|
1200
1221
|
storage: StorageSizeSchema.default("10 GB")
|
|
1201
1222
|
// vpc: z.boolean().default(false),
|
|
@@ -1203,29 +1224,29 @@ var SearchsSchema = z25.record(
|
|
|
1203
1224
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
1204
1225
|
|
|
1205
1226
|
// src/feature/site/schema.ts
|
|
1206
|
-
import { z as
|
|
1207
|
-
var ErrorResponsePathSchema =
|
|
1227
|
+
import { z as z28 } from "zod";
|
|
1228
|
+
var ErrorResponsePathSchema = z28.string().describe(
|
|
1208
1229
|
"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."
|
|
1209
1230
|
);
|
|
1210
|
-
var StatusCodeSchema =
|
|
1231
|
+
var StatusCodeSchema = z28.number().int().positive().optional().describe(
|
|
1211
1232
|
"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."
|
|
1212
1233
|
);
|
|
1213
1234
|
var MinTTLSchema = DurationSchema.describe(
|
|
1214
1235
|
"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."
|
|
1215
1236
|
);
|
|
1216
|
-
var ErrorResponseSchema =
|
|
1237
|
+
var ErrorResponseSchema = z28.union([
|
|
1217
1238
|
ErrorResponsePathSchema,
|
|
1218
|
-
|
|
1239
|
+
z28.object({
|
|
1219
1240
|
path: ErrorResponsePathSchema,
|
|
1220
1241
|
statusCode: StatusCodeSchema.optional(),
|
|
1221
1242
|
minTTL: MinTTLSchema.optional()
|
|
1222
1243
|
})
|
|
1223
1244
|
]).optional();
|
|
1224
|
-
var SitesSchema =
|
|
1245
|
+
var SitesSchema = z28.record(
|
|
1225
1246
|
ResourceIdSchema,
|
|
1226
|
-
|
|
1247
|
+
z28.object({
|
|
1227
1248
|
domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
|
|
1228
|
-
subDomain:
|
|
1249
|
+
subDomain: z28.string().optional(),
|
|
1229
1250
|
// bind: z
|
|
1230
1251
|
// .object({
|
|
1231
1252
|
// auth: z.array(ResourceIdSchema),
|
|
@@ -1234,11 +1255,25 @@ var SitesSchema = z26.record(
|
|
|
1234
1255
|
// // rest: z.array(ResourceIdSchema),
|
|
1235
1256
|
// })
|
|
1236
1257
|
// .optional(),
|
|
1237
|
-
|
|
1258
|
+
build: z28.object({
|
|
1259
|
+
command: z28.string().describe(
|
|
1260
|
+
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1261
|
+
),
|
|
1262
|
+
cacheKey: z28.union([
|
|
1263
|
+
LocalFileSchema.transform((v) => [v]),
|
|
1264
|
+
LocalFileSchema.array(),
|
|
1265
|
+
LocalDirectorySchema.transform((v) => [v]),
|
|
1266
|
+
LocalDirectorySchema.array()
|
|
1267
|
+
]).describe(
|
|
1268
|
+
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1269
|
+
)
|
|
1270
|
+
}).optional().describe(`Specifies the build process for sites that need a build step.`),
|
|
1271
|
+
static: z28.union([LocalDirectorySchema, z28.boolean()]).optional().describe(
|
|
1238
1272
|
"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."
|
|
1239
1273
|
),
|
|
1240
|
-
ssr: FunctionSchema.optional().describe("Specifies the
|
|
1241
|
-
|
|
1274
|
+
ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server."),
|
|
1275
|
+
// envPrefix: z.string().optional().describe('Specifies a prefix for all '),
|
|
1276
|
+
origin: z28.enum(["ssr-first", "static-first"]).default("static-first").describe("Specifies the origin fallback ordering."),
|
|
1242
1277
|
// bind: z.object({
|
|
1243
1278
|
// auth:
|
|
1244
1279
|
// h
|
|
@@ -1251,11 +1286,11 @@ var SitesSchema = z26.record(
|
|
|
1251
1286
|
// build: z.string().optional(),
|
|
1252
1287
|
// }),
|
|
1253
1288
|
// ]),
|
|
1254
|
-
geoRestrictions:
|
|
1255
|
-
forwardHost:
|
|
1256
|
-
"Specify if the host header
|
|
1289
|
+
geoRestrictions: z28.array(z28.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
|
|
1290
|
+
forwardHost: z28.boolean().default(false).describe(
|
|
1291
|
+
"Specify if the host header should be forwarded to the SSR function. Keep in mind that this requires an extra CloudFront Function."
|
|
1257
1292
|
),
|
|
1258
|
-
errors:
|
|
1293
|
+
errors: z28.object({
|
|
1259
1294
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
1260
1295
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
1261
1296
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -1268,16 +1303,16 @@ var SitesSchema = z26.record(
|
|
|
1268
1303
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
1269
1304
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
1270
1305
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
1271
|
-
cors:
|
|
1272
|
-
override:
|
|
1306
|
+
cors: z28.object({
|
|
1307
|
+
override: z28.boolean().default(false),
|
|
1273
1308
|
maxAge: DurationSchema.default("365 days"),
|
|
1274
|
-
exposeHeaders:
|
|
1275
|
-
credentials:
|
|
1276
|
-
headers:
|
|
1277
|
-
origins:
|
|
1278
|
-
methods:
|
|
1309
|
+
exposeHeaders: z28.string().array().optional(),
|
|
1310
|
+
credentials: z28.boolean().default(false),
|
|
1311
|
+
headers: z28.string().array().default(["*"]),
|
|
1312
|
+
origins: z28.string().array().default(["*"]),
|
|
1313
|
+
methods: z28.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
1279
1314
|
}).optional().describe("Define the cors headers."),
|
|
1280
|
-
security:
|
|
1315
|
+
security: z28.object({
|
|
1281
1316
|
// contentSecurityPolicy: z.object({
|
|
1282
1317
|
// override: z.boolean().default(false),
|
|
1283
1318
|
// policy: z.string(),
|
|
@@ -1319,10 +1354,10 @@ var SitesSchema = z26.record(
|
|
|
1319
1354
|
// reportUri?: string
|
|
1320
1355
|
// }
|
|
1321
1356
|
}).optional().describe("Define the security policy."),
|
|
1322
|
-
cache:
|
|
1323
|
-
cookies:
|
|
1324
|
-
headers:
|
|
1325
|
-
queries:
|
|
1357
|
+
cache: z28.object({
|
|
1358
|
+
cookies: z28.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
1359
|
+
headers: z28.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
1360
|
+
queries: z28.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
1326
1361
|
}).optional().describe(
|
|
1327
1362
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
1328
1363
|
)
|
|
@@ -1330,22 +1365,22 @@ var SitesSchema = z26.record(
|
|
|
1330
1365
|
).optional().describe("Define the sites in your stack.");
|
|
1331
1366
|
|
|
1332
1367
|
// src/feature/store/schema.ts
|
|
1333
|
-
import { z as
|
|
1334
|
-
var StoresSchema =
|
|
1335
|
-
|
|
1368
|
+
import { z as z29 } from "zod";
|
|
1369
|
+
var StoresSchema = z29.union([
|
|
1370
|
+
z29.array(ResourceIdSchema).transform((list5) => {
|
|
1336
1371
|
const stores = {};
|
|
1337
1372
|
for (const key of list5) {
|
|
1338
1373
|
stores[key] = {};
|
|
1339
1374
|
}
|
|
1340
1375
|
return stores;
|
|
1341
1376
|
}),
|
|
1342
|
-
|
|
1377
|
+
z29.record(
|
|
1343
1378
|
ResourceIdSchema,
|
|
1344
|
-
|
|
1379
|
+
z29.object({
|
|
1345
1380
|
// cors: CorsSchema,
|
|
1346
1381
|
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
1347
|
-
versioning:
|
|
1348
|
-
events:
|
|
1382
|
+
versioning: z29.boolean().default(false).describe("Enable versioning of your store."),
|
|
1383
|
+
events: z29.object({
|
|
1349
1384
|
// create
|
|
1350
1385
|
"created:*": FunctionSchema.optional().describe(
|
|
1351
1386
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
@@ -1378,44 +1413,100 @@ var StoresSchema = z27.union([
|
|
|
1378
1413
|
]).optional().describe("Define the stores in your stack.");
|
|
1379
1414
|
|
|
1380
1415
|
// src/feature/table/schema.ts
|
|
1381
|
-
import {
|
|
1382
|
-
|
|
1383
|
-
var
|
|
1416
|
+
import { minutes as minutes4, seconds as seconds4 } from "@awsless/duration";
|
|
1417
|
+
import { z as z30 } from "zod";
|
|
1418
|
+
var KeySchema = z30.string().min(1).max(255);
|
|
1419
|
+
var TablesSchema = z30.record(
|
|
1384
1420
|
ResourceIdSchema,
|
|
1385
|
-
|
|
1421
|
+
z30.object({
|
|
1386
1422
|
hash: KeySchema.describe(
|
|
1387
1423
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
1388
1424
|
),
|
|
1389
1425
|
sort: KeySchema.optional().describe(
|
|
1390
1426
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
1391
1427
|
),
|
|
1392
|
-
fields:
|
|
1428
|
+
fields: z30.record(z30.string(), z30.enum(["string", "number", "binary"])).optional().describe(
|
|
1393
1429
|
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
1394
1430
|
),
|
|
1395
|
-
class:
|
|
1396
|
-
pointInTimeRecovery:
|
|
1397
|
-
|
|
1398
|
-
|
|
1431
|
+
class: z30.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
1432
|
+
pointInTimeRecovery: z30.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
1433
|
+
ttl: KeySchema.optional().describe(
|
|
1434
|
+
[
|
|
1435
|
+
"The name of the TTL attribute used to store the expiration time for items in the table.",
|
|
1436
|
+
"To update this property, you must first disable TTL and then enable TTL with the new attribute name."
|
|
1437
|
+
].join("\n")
|
|
1399
1438
|
),
|
|
1400
1439
|
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
1401
|
-
stream:
|
|
1402
|
-
type:
|
|
1403
|
-
|
|
1440
|
+
stream: z30.object({
|
|
1441
|
+
type: z30.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
1442
|
+
[
|
|
1443
|
+
"When an item in the table is modified, you can determines what information is written to the stream for this table.",
|
|
1444
|
+
"Valid values are:",
|
|
1445
|
+
"- keys-only - Only the key attributes of the modified item are written to the stream.",
|
|
1446
|
+
"- new-image - The entire item, as it appears after it was modified, is written to the stream.",
|
|
1447
|
+
"- old-image - The entire item, as it appeared before it was modified, is written to the stream.",
|
|
1448
|
+
"- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
1449
|
+
].join("\n")
|
|
1450
|
+
),
|
|
1451
|
+
batchSize: z30.number().min(1).max(1e4).default(1).describe(
|
|
1452
|
+
[
|
|
1453
|
+
"The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
|
|
1454
|
+
"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).",
|
|
1455
|
+
"You can specify a number from 1 to 10000."
|
|
1456
|
+
].join("\n")
|
|
1457
|
+
),
|
|
1458
|
+
batchWindow: DurationSchema.refine(
|
|
1459
|
+
durationMin(seconds4(1)),
|
|
1460
|
+
"Minimum batch window duration is 1 second"
|
|
1461
|
+
).refine(durationMax(minutes4(5)), "Maximum batch window duration is 5 minutes").optional().describe(
|
|
1462
|
+
[
|
|
1463
|
+
"The maximum amount of time that is spend gathering records before invoking the function.",
|
|
1464
|
+
"You can specify a duration from 1 seconds to 5 minutes."
|
|
1465
|
+
].join("\n")
|
|
1466
|
+
),
|
|
1467
|
+
// maxRecordAge: DurationSchema.refine(
|
|
1468
|
+
// durationMin(seconds(1)),
|
|
1469
|
+
// 'Minimum record age duration is 1 second'
|
|
1470
|
+
// )
|
|
1471
|
+
// .refine(durationMax(minutes(5)), 'Maximum batch window duration is 5 minutes')
|
|
1472
|
+
// .optional()
|
|
1473
|
+
// .describe(
|
|
1474
|
+
// [
|
|
1475
|
+
// 'Discard records after the specified number of retries.',
|
|
1476
|
+
// 'The default value is -1, which sets the maximum number of retries to infinite.',
|
|
1477
|
+
// 'When maxRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.',
|
|
1478
|
+
// 'You can specify a number from -1 to 10000.',
|
|
1479
|
+
// ].join('\n')
|
|
1480
|
+
// ),
|
|
1481
|
+
retryAttempts: z30.number().min(-1).max(1e4).default(-1).describe(
|
|
1482
|
+
[
|
|
1483
|
+
"Discard records after the specified number of retries.",
|
|
1484
|
+
"The default value is -1, which sets the maximum number of retries to infinite.",
|
|
1485
|
+
"When maxRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.",
|
|
1486
|
+
"You can specify a number from -1 to 10000."
|
|
1487
|
+
].join("\n")
|
|
1488
|
+
),
|
|
1489
|
+
concurrencyPerShard: z30.number().min(1).max(10).default(1).describe(
|
|
1490
|
+
[
|
|
1491
|
+
"The number of batches to process concurrently from each shard.",
|
|
1492
|
+
"The default value is 1.",
|
|
1493
|
+
"You can specify a number from 1 to 10."
|
|
1494
|
+
].join("\n")
|
|
1404
1495
|
),
|
|
1405
1496
|
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
1406
1497
|
}).optional().describe(
|
|
1407
1498
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
1408
1499
|
),
|
|
1409
|
-
indexes:
|
|
1410
|
-
|
|
1411
|
-
|
|
1500
|
+
indexes: z30.record(
|
|
1501
|
+
z30.string(),
|
|
1502
|
+
z30.object({
|
|
1412
1503
|
hash: KeySchema.describe(
|
|
1413
1504
|
"Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
|
|
1414
1505
|
),
|
|
1415
1506
|
sort: KeySchema.optional().describe(
|
|
1416
1507
|
"Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
|
|
1417
1508
|
),
|
|
1418
|
-
projection:
|
|
1509
|
+
projection: z30.enum(["all", "keys-only"]).default("all").describe(
|
|
1419
1510
|
[
|
|
1420
1511
|
"The set of attributes that are projected into the index:",
|
|
1421
1512
|
"- all - All of the table attributes are projected into the index.",
|
|
@@ -1429,11 +1520,11 @@ var TablesSchema = z28.record(
|
|
|
1429
1520
|
).optional().describe("Define the tables in your stack.");
|
|
1430
1521
|
|
|
1431
1522
|
// src/feature/task/schema.ts
|
|
1432
|
-
import { z as
|
|
1433
|
-
var RetryAttemptsSchema2 =
|
|
1523
|
+
import { z as z31 } from "zod";
|
|
1524
|
+
var RetryAttemptsSchema2 = z31.number().int().min(0).max(2).describe(
|
|
1434
1525
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1435
1526
|
);
|
|
1436
|
-
var TaskSchema =
|
|
1527
|
+
var TaskSchema = z31.union([
|
|
1437
1528
|
LocalFileSchema.transform((file) => ({
|
|
1438
1529
|
consumer: {
|
|
1439
1530
|
code: {
|
|
@@ -1444,33 +1535,33 @@ var TaskSchema = z29.union([
|
|
|
1444
1535
|
},
|
|
1445
1536
|
retryAttempts: void 0
|
|
1446
1537
|
})),
|
|
1447
|
-
|
|
1538
|
+
z31.object({
|
|
1448
1539
|
consumer: FunctionSchema,
|
|
1449
1540
|
retryAttempts: RetryAttemptsSchema2.optional()
|
|
1450
1541
|
})
|
|
1451
1542
|
]);
|
|
1452
|
-
var TasksSchema =
|
|
1543
|
+
var TasksSchema = z31.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1453
1544
|
|
|
1454
1545
|
// src/feature/test/schema.ts
|
|
1455
|
-
import { z as
|
|
1456
|
-
var TestsSchema =
|
|
1546
|
+
import { z as z32 } from "zod";
|
|
1547
|
+
var TestsSchema = z32.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
1457
1548
|
|
|
1458
1549
|
// src/feature/topic/schema.ts
|
|
1459
1550
|
import { kebabCase as kebabCase3 } from "change-case";
|
|
1460
|
-
import { z as
|
|
1461
|
-
var TopicNameSchema =
|
|
1462
|
-
var TopicsSchema =
|
|
1551
|
+
import { z as z33 } from "zod";
|
|
1552
|
+
var TopicNameSchema = z33.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
|
|
1553
|
+
var TopicsSchema = z33.array(TopicNameSchema).refine((topics) => {
|
|
1463
1554
|
return topics.length === new Set(topics).size;
|
|
1464
1555
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
1465
|
-
var SubscribersSchema =
|
|
1556
|
+
var SubscribersSchema = z33.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
1466
1557
|
|
|
1467
1558
|
// src/config/stack.ts
|
|
1468
1559
|
var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
|
|
1469
1560
|
var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
|
|
1470
1561
|
message: `Stack name can't be a reserved name.`
|
|
1471
1562
|
}).describe("Stack name.");
|
|
1472
|
-
var StackSchema =
|
|
1473
|
-
$schema:
|
|
1563
|
+
var StackSchema = z34.object({
|
|
1564
|
+
$schema: z34.string().optional(),
|
|
1474
1565
|
name: NameSchema,
|
|
1475
1566
|
depends: DependsSchema,
|
|
1476
1567
|
commands: CommandsSchema,
|
|
@@ -1537,13 +1628,13 @@ var readConfigWithStage = async (file, stage) => {
|
|
|
1537
1628
|
};
|
|
1538
1629
|
|
|
1539
1630
|
// src/config/load/validate.ts
|
|
1540
|
-
import { z as
|
|
1631
|
+
import { z as z35 } from "zod";
|
|
1541
1632
|
var validateConfig = async (schema, file, data) => {
|
|
1542
1633
|
try {
|
|
1543
1634
|
const result = await schema.parseAsync(data);
|
|
1544
1635
|
return result;
|
|
1545
1636
|
} catch (error) {
|
|
1546
|
-
if (error instanceof
|
|
1637
|
+
if (error instanceof z35.ZodError) {
|
|
1547
1638
|
throw new ConfigError(file, error, data);
|
|
1548
1639
|
}
|
|
1549
1640
|
throw error;
|
|
@@ -2294,90 +2385,6 @@ var getGlobalOnFailure = (ctx) => {
|
|
|
2294
2385
|
return ctx.appConfig.defaults.onFailure ? ctx.shared.get("on-failure", "queue-arn") : void 0;
|
|
2295
2386
|
};
|
|
2296
2387
|
|
|
2297
|
-
// src/feature/function/build/typescript/bundle.ts
|
|
2298
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
2299
|
-
import json from "@rollup/plugin-json";
|
|
2300
|
-
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
2301
|
-
import { createHash } from "crypto";
|
|
2302
|
-
import { dirname as dirname5 } from "path";
|
|
2303
|
-
import { rollup } from "rollup";
|
|
2304
|
-
import natives from "rollup-plugin-natives";
|
|
2305
|
-
import { swc, minify as swcMinify } from "rollup-plugin-swc3";
|
|
2306
|
-
var bundleTypeScript = async ({
|
|
2307
|
-
format: format2 = "esm",
|
|
2308
|
-
minify = true,
|
|
2309
|
-
file,
|
|
2310
|
-
nativeDir,
|
|
2311
|
-
external
|
|
2312
|
-
}) => {
|
|
2313
|
-
const bundle = await rollup({
|
|
2314
|
-
input: file,
|
|
2315
|
-
external: (importee) => {
|
|
2316
|
-
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
|
|
2317
|
-
},
|
|
2318
|
-
onwarn: (error) => {
|
|
2319
|
-
debugError(error.message);
|
|
2320
|
-
},
|
|
2321
|
-
treeshake: {
|
|
2322
|
-
preset: "smallest",
|
|
2323
|
-
moduleSideEffects: (id) => file === id
|
|
2324
|
-
},
|
|
2325
|
-
plugins: [
|
|
2326
|
-
commonjs({ sourceMap: true }),
|
|
2327
|
-
nodeResolve({ preferBuiltins: true }),
|
|
2328
|
-
// @ts-ignore
|
|
2329
|
-
nativeDir ? natives({
|
|
2330
|
-
copyTo: nativeDir,
|
|
2331
|
-
targetEsm: format2 === "esm",
|
|
2332
|
-
sourcemap: true
|
|
2333
|
-
}) : void 0,
|
|
2334
|
-
swc({
|
|
2335
|
-
// minify,
|
|
2336
|
-
// module: true,
|
|
2337
|
-
jsc: {
|
|
2338
|
-
baseUrl: dirname5(file),
|
|
2339
|
-
minify: { sourceMap: true }
|
|
2340
|
-
},
|
|
2341
|
-
sourceMaps: true
|
|
2342
|
-
}),
|
|
2343
|
-
minify ? swcMinify({
|
|
2344
|
-
module: format2 === "esm",
|
|
2345
|
-
sourceMap: true,
|
|
2346
|
-
compress: true
|
|
2347
|
-
}) : void 0,
|
|
2348
|
-
json()
|
|
2349
|
-
]
|
|
2350
|
-
});
|
|
2351
|
-
const ext = format2 === "esm" ? "mjs" : "js";
|
|
2352
|
-
const result = await bundle.generate({
|
|
2353
|
-
format: format2,
|
|
2354
|
-
sourcemap: "hidden",
|
|
2355
|
-
exports: "auto",
|
|
2356
|
-
manualChunks: {},
|
|
2357
|
-
entryFileNames: `index.${ext}`,
|
|
2358
|
-
chunkFileNames: `[name].${ext}`
|
|
2359
|
-
});
|
|
2360
|
-
const hash = createHash("sha1");
|
|
2361
|
-
const files = [];
|
|
2362
|
-
for (const item of result.output) {
|
|
2363
|
-
if (item.type !== "chunk") {
|
|
2364
|
-
continue;
|
|
2365
|
-
}
|
|
2366
|
-
const code = Buffer.from(item.code, "utf8");
|
|
2367
|
-
const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
|
|
2368
|
-
hash.update(code);
|
|
2369
|
-
files.push({
|
|
2370
|
-
name: item.fileName,
|
|
2371
|
-
code,
|
|
2372
|
-
map
|
|
2373
|
-
});
|
|
2374
|
-
}
|
|
2375
|
-
return {
|
|
2376
|
-
hash: hash.digest("hex"),
|
|
2377
|
-
files
|
|
2378
|
-
};
|
|
2379
|
-
};
|
|
2380
|
-
|
|
2381
2388
|
// src/feature/function/build/zip.ts
|
|
2382
2389
|
import { createReadStream } from "fs";
|
|
2383
2390
|
import JSZip from "jszip";
|
|
@@ -2404,6 +2411,44 @@ import { toDays as toDays3, toSeconds } from "@awsless/duration";
|
|
|
2404
2411
|
import { toMebibytes } from "@awsless/size";
|
|
2405
2412
|
import { pascalCase } from "change-case";
|
|
2406
2413
|
|
|
2414
|
+
// src/util/cache.ts
|
|
2415
|
+
import { createHash } from "node:crypto";
|
|
2416
|
+
import { createReadStream as createReadStream2 } from "node:fs";
|
|
2417
|
+
import { lstat as lstat2, readdir } from "node:fs/promises";
|
|
2418
|
+
import { join as join7 } from "node:path";
|
|
2419
|
+
var generateCacheKey = async (directories2) => {
|
|
2420
|
+
const files = await listAllFiles(directories2);
|
|
2421
|
+
const hashes = {};
|
|
2422
|
+
for (const file of files) {
|
|
2423
|
+
hashes[file] = await createHashFromFile(file);
|
|
2424
|
+
}
|
|
2425
|
+
return createHash("md5").update(JSON.stringify(hashes)).digest("hex");
|
|
2426
|
+
};
|
|
2427
|
+
var createHashFromFile = (file) => {
|
|
2428
|
+
return new Promise((resolve) => {
|
|
2429
|
+
const hash = createHash("md5");
|
|
2430
|
+
const stream = createReadStream2(file);
|
|
2431
|
+
stream.on("data", (data) => hash.update(data));
|
|
2432
|
+
stream.on("end", () => resolve(hash.digest("hex")));
|
|
2433
|
+
});
|
|
2434
|
+
};
|
|
2435
|
+
var listAllFiles = async (list5) => {
|
|
2436
|
+
const files = [];
|
|
2437
|
+
for (const entry of list5) {
|
|
2438
|
+
const stat4 = await lstat2(entry);
|
|
2439
|
+
if (stat4.isDirectory()) {
|
|
2440
|
+
const dirents = await readdir(entry, {
|
|
2441
|
+
recursive: true,
|
|
2442
|
+
withFileTypes: true
|
|
2443
|
+
});
|
|
2444
|
+
files.push(...dirents.filter((d) => d.isFile()).map((file) => join7(file.path, file.name)));
|
|
2445
|
+
} else if (stat4.isFile()) {
|
|
2446
|
+
files.push(entry);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
return files;
|
|
2450
|
+
};
|
|
2451
|
+
|
|
2407
2452
|
// src/util/id.ts
|
|
2408
2453
|
import { createHash as createHash2 } from "crypto";
|
|
2409
2454
|
var shortId = (ns) => {
|
|
@@ -2411,18 +2456,18 @@ var shortId = (ns) => {
|
|
|
2411
2456
|
};
|
|
2412
2457
|
|
|
2413
2458
|
// src/util/temp.ts
|
|
2414
|
-
import { mkdir as mkdir3, readdir, rm as rm2 } from "fs/promises";
|
|
2415
|
-
import { join as
|
|
2459
|
+
import { mkdir as mkdir3, readdir as readdir2, rm as rm2 } from "fs/promises";
|
|
2460
|
+
import { join as join8 } from "path";
|
|
2416
2461
|
var createTempFolder = async (name) => {
|
|
2417
|
-
const path =
|
|
2418
|
-
await mkdir3(
|
|
2462
|
+
const path = join8(directories.temp, name);
|
|
2463
|
+
await mkdir3(join8(directories.temp, name), { recursive: true });
|
|
2419
2464
|
process.on("SIGTERM", async () => {
|
|
2420
2465
|
await rm2(path, { recursive: true });
|
|
2421
2466
|
});
|
|
2422
2467
|
return {
|
|
2423
2468
|
path,
|
|
2424
2469
|
async files() {
|
|
2425
|
-
return
|
|
2470
|
+
return readdir2(path, { recursive: true });
|
|
2426
2471
|
},
|
|
2427
2472
|
async delete() {
|
|
2428
2473
|
await rm2(path, { recursive: true });
|
|
@@ -2443,20 +2488,20 @@ var formatFilterPattern = (filters) => {
|
|
|
2443
2488
|
|
|
2444
2489
|
// src/feature/function/build/bundle/bundle.ts
|
|
2445
2490
|
import JSZip2 from "jszip";
|
|
2446
|
-
import { createReadStream as
|
|
2447
|
-
import { readdir as
|
|
2448
|
-
import { join as
|
|
2491
|
+
import { createReadStream as createReadStream3 } from "node:fs";
|
|
2492
|
+
import { readdir as readdir3 } from "node:fs/promises";
|
|
2493
|
+
import { join as join9, relative as relative2 } from "node:path";
|
|
2449
2494
|
var zipBundle = async ({ directory }) => {
|
|
2450
2495
|
const zip = new JSZip2();
|
|
2451
|
-
const list5 = await
|
|
2496
|
+
const list5 = await readdir3(directory, {
|
|
2452
2497
|
recursive: true,
|
|
2453
2498
|
withFileTypes: true
|
|
2454
2499
|
});
|
|
2455
2500
|
for (const file of list5) {
|
|
2456
2501
|
if (file.isFile()) {
|
|
2457
|
-
const path =
|
|
2502
|
+
const path = join9(file.path, file.name);
|
|
2458
2503
|
const rel = relative2(directory, path);
|
|
2459
|
-
zip.file(rel,
|
|
2504
|
+
zip.file(rel, createReadStream3(path));
|
|
2460
2505
|
}
|
|
2461
2506
|
}
|
|
2462
2507
|
return zip.generateAsync({
|
|
@@ -2468,42 +2513,85 @@ var zipBundle = async ({ directory }) => {
|
|
|
2468
2513
|
});
|
|
2469
2514
|
};
|
|
2470
2515
|
|
|
2471
|
-
// src/feature/function/build/
|
|
2472
|
-
import
|
|
2473
|
-
import
|
|
2474
|
-
import {
|
|
2475
|
-
import {
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2516
|
+
// src/feature/function/build/typescript/rolldown.ts
|
|
2517
|
+
import json from "@rollup/plugin-json";
|
|
2518
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
2519
|
+
import { createHash as createHash3 } from "crypto";
|
|
2520
|
+
import { rolldown } from "rolldown";
|
|
2521
|
+
import natives from "rollup-plugin-natives";
|
|
2522
|
+
import { minify as swcMinify } from "rollup-plugin-swc3";
|
|
2523
|
+
var bundleTypeScriptWithRolldown = async ({
|
|
2524
|
+
format: format2 = "esm",
|
|
2525
|
+
minify = true,
|
|
2526
|
+
file,
|
|
2527
|
+
nativeDir,
|
|
2528
|
+
external
|
|
2529
|
+
}) => {
|
|
2530
|
+
const bundle = await rolldown({
|
|
2531
|
+
input: file,
|
|
2532
|
+
external: (importee) => {
|
|
2533
|
+
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
|
|
2534
|
+
},
|
|
2535
|
+
onwarn: (error) => {
|
|
2536
|
+
debugError(error.message);
|
|
2537
|
+
},
|
|
2538
|
+
treeshake: {
|
|
2539
|
+
// preset: 'smallest',
|
|
2540
|
+
moduleSideEffects: (id) => file === id
|
|
2541
|
+
},
|
|
2542
|
+
plugins: [
|
|
2543
|
+
// commonjs({ sourceMap: true }),
|
|
2544
|
+
nodeResolve({ preferBuiltins: true }),
|
|
2545
|
+
nativeDir ? natives({
|
|
2546
|
+
copyTo: nativeDir,
|
|
2547
|
+
targetEsm: format2 === "esm",
|
|
2548
|
+
sourcemap: true
|
|
2549
|
+
}) : void 0,
|
|
2550
|
+
// swc({
|
|
2551
|
+
// // minify,
|
|
2552
|
+
// // module: true,
|
|
2553
|
+
// jsc: {
|
|
2554
|
+
// baseUrl: dirname(file),
|
|
2555
|
+
// minify: { sourceMap: true },
|
|
2556
|
+
// },
|
|
2557
|
+
// sourceMaps: true,
|
|
2558
|
+
// }),
|
|
2559
|
+
minify ? swcMinify({
|
|
2560
|
+
module: format2 === "esm",
|
|
2561
|
+
sourceMap: true,
|
|
2562
|
+
compress: true
|
|
2563
|
+
}) : void 0,
|
|
2564
|
+
json()
|
|
2565
|
+
]
|
|
2490
2566
|
});
|
|
2491
|
-
|
|
2492
|
-
|
|
2567
|
+
const ext = format2 === "esm" ? "mjs" : "js";
|
|
2568
|
+
const result = await bundle.generate({
|
|
2569
|
+
format: format2,
|
|
2570
|
+
sourcemap: "hidden",
|
|
2571
|
+
exports: "auto",
|
|
2572
|
+
// manualChunks: {},
|
|
2573
|
+
entryFileNames: `index.${ext}`,
|
|
2574
|
+
chunkFileNames: `[name].${ext}`
|
|
2575
|
+
});
|
|
2576
|
+
const hash = createHash3("sha1");
|
|
2493
2577
|
const files = [];
|
|
2494
|
-
for (const
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
const dirents = await readdir3(entry, {
|
|
2498
|
-
recursive: true,
|
|
2499
|
-
withFileTypes: true
|
|
2500
|
-
});
|
|
2501
|
-
files.push(...dirents.filter((d) => d.isFile()).map((file) => join9(file.path, file.name)));
|
|
2502
|
-
} else if (stat4.isFile()) {
|
|
2503
|
-
files.push(entry);
|
|
2578
|
+
for (const item of result.output) {
|
|
2579
|
+
if (item.type !== "chunk") {
|
|
2580
|
+
continue;
|
|
2504
2581
|
}
|
|
2582
|
+
const code = Buffer.from(item.code, "utf8");
|
|
2583
|
+
const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
|
|
2584
|
+
hash.update(code);
|
|
2585
|
+
files.push({
|
|
2586
|
+
name: item.fileName,
|
|
2587
|
+
code,
|
|
2588
|
+
map
|
|
2589
|
+
});
|
|
2505
2590
|
}
|
|
2506
|
-
return
|
|
2591
|
+
return {
|
|
2592
|
+
hash: hash.digest("hex"),
|
|
2593
|
+
files
|
|
2594
|
+
};
|
|
2507
2595
|
};
|
|
2508
2596
|
|
|
2509
2597
|
// src/feature/function/util.ts
|
|
@@ -2542,10 +2630,10 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
|
|
|
2542
2630
|
} else if ("file" in local.code) {
|
|
2543
2631
|
const fileCode = local.code;
|
|
2544
2632
|
ctx.registerBuild("function", name, async (build3, { workspace }) => {
|
|
2545
|
-
const
|
|
2546
|
-
return build3(
|
|
2633
|
+
const fingerprint = await generateFileHash(workspace, fileCode.file);
|
|
2634
|
+
return build3(fingerprint, async (write) => {
|
|
2547
2635
|
const temp = await createTempFolder(`function--${name}`);
|
|
2548
|
-
const bundle = await
|
|
2636
|
+
const bundle = await bundleTypeScriptWithRolldown({
|
|
2549
2637
|
file: fileCode.file,
|
|
2550
2638
|
external: [
|
|
2551
2639
|
...fileCode.external ?? [],
|
|
@@ -2584,14 +2672,12 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
|
|
|
2584
2672
|
} else {
|
|
2585
2673
|
const bundleCode = local.code;
|
|
2586
2674
|
ctx.registerBuild("function", name, async (build3) => {
|
|
2587
|
-
const
|
|
2588
|
-
|
|
2589
|
-
});
|
|
2590
|
-
return build3(version, async (write) => {
|
|
2675
|
+
const fingerprint = await generateCacheKey([bundleCode.bundle]);
|
|
2676
|
+
return build3(fingerprint, async (write) => {
|
|
2591
2677
|
const bundle = await zipBundle({
|
|
2592
2678
|
directory: bundleCode.bundle
|
|
2593
2679
|
});
|
|
2594
|
-
await write("HASH",
|
|
2680
|
+
await write("HASH", fingerprint);
|
|
2595
2681
|
await write("bundle.zip", bundle);
|
|
2596
2682
|
return {
|
|
2597
2683
|
size: formatByteSize(bundle.byteLength)
|
|
@@ -2872,7 +2958,7 @@ var cronFeature = defineFeature({
|
|
|
2872
2958
|
});
|
|
2873
2959
|
|
|
2874
2960
|
// src/feature/domain/index.ts
|
|
2875
|
-
import { minutes as
|
|
2961
|
+
import { minutes as minutes5, toSeconds as toSeconds2 } from "@awsless/duration";
|
|
2876
2962
|
import { $ as $5, Group as Group5 } from "@awsless/formation";
|
|
2877
2963
|
var domainFeature = defineFeature({
|
|
2878
2964
|
name: "domain",
|
|
@@ -2910,7 +2996,7 @@ var domainFeature = defineFeature({
|
|
|
2910
2996
|
zoneId: zone.id,
|
|
2911
2997
|
name: option(certificate, 0).pipe((r) => r.resourceRecordName),
|
|
2912
2998
|
type: option(certificate, 0).pipe((r) => r.resourceRecordType),
|
|
2913
|
-
ttl: toSeconds2(
|
|
2999
|
+
ttl: toSeconds2(minutes5(5)),
|
|
2914
3000
|
records: [option(certificate, 0).pipe((r) => r.resourceRecordValue)],
|
|
2915
3001
|
allowOverwrite: true
|
|
2916
3002
|
});
|
|
@@ -2918,7 +3004,7 @@ var domainFeature = defineFeature({
|
|
|
2918
3004
|
zoneId: zone.id,
|
|
2919
3005
|
name: option(certificate, 1).pipe((r) => r.resourceRecordName),
|
|
2920
3006
|
type: option(certificate, 1).pipe((r) => r.resourceRecordType),
|
|
2921
|
-
ttl: toSeconds2(
|
|
3007
|
+
ttl: toSeconds2(minutes5(5)),
|
|
2922
3008
|
records: [option(certificate, 1).pipe((r) => r.resourceRecordValue)],
|
|
2923
3009
|
allowOverwrite: true
|
|
2924
3010
|
});
|
|
@@ -2946,7 +3032,7 @@ var domainFeature = defineFeature({
|
|
|
2946
3032
|
zoneId: zone.id,
|
|
2947
3033
|
name: option(globalCertificate, 0).pipe((r) => r.resourceRecordName),
|
|
2948
3034
|
type: option(globalCertificate, 0).pipe((r) => r.resourceRecordType),
|
|
2949
|
-
ttl: toSeconds2(
|
|
3035
|
+
ttl: toSeconds2(minutes5(5)),
|
|
2950
3036
|
records: [option(globalCertificate, 0).pipe((r) => r.resourceRecordValue)],
|
|
2951
3037
|
allowOverwrite: true
|
|
2952
3038
|
});
|
|
@@ -2954,7 +3040,7 @@ var domainFeature = defineFeature({
|
|
|
2954
3040
|
zoneId: zone.id,
|
|
2955
3041
|
name: option(globalCertificate, 1).pipe((r) => r.resourceRecordName),
|
|
2956
3042
|
type: option(globalCertificate, 1).pipe((r) => r.resourceRecordType),
|
|
2957
|
-
ttl: toSeconds2(
|
|
3043
|
+
ttl: toSeconds2(minutes5(5)),
|
|
2958
3044
|
records: [option(globalCertificate, 1).pipe((r) => r.resourceRecordValue)],
|
|
2959
3045
|
allowOverwrite: true
|
|
2960
3046
|
});
|
|
@@ -2980,7 +3066,7 @@ var domainFeature = defineFeature({
|
|
|
2980
3066
|
zoneId: zone.id,
|
|
2981
3067
|
name: `_amazonses.${props.domain}`,
|
|
2982
3068
|
type: "TXT",
|
|
2983
|
-
ttl: toSeconds2(
|
|
3069
|
+
ttl: toSeconds2(minutes5(5)),
|
|
2984
3070
|
records: [identity.verificationToken]
|
|
2985
3071
|
});
|
|
2986
3072
|
const dkim = new $5.aws.ses.DomainDkim(group2, "dkim", {
|
|
@@ -2991,7 +3077,7 @@ var domainFeature = defineFeature({
|
|
|
2991
3077
|
zoneId: zone.id,
|
|
2992
3078
|
type: "CNAME",
|
|
2993
3079
|
name: dkim.dkimTokens.pipe((t) => `${t.at(i)}._domainkey`),
|
|
2994
|
-
ttl: toSeconds2(
|
|
3080
|
+
ttl: toSeconds2(minutes5(5)),
|
|
2995
3081
|
records: [dkim.dkimTokens.pipe((t) => `${t.at(i)}.dkim.amazonses.com`)]
|
|
2996
3082
|
});
|
|
2997
3083
|
}
|
|
@@ -3004,21 +3090,21 @@ var domainFeature = defineFeature({
|
|
|
3004
3090
|
zoneId: zone.id,
|
|
3005
3091
|
name: mailFrom.mailFromDomain,
|
|
3006
3092
|
type: "MX",
|
|
3007
|
-
ttl: toSeconds2(
|
|
3093
|
+
ttl: toSeconds2(minutes5(5)),
|
|
3008
3094
|
records: [`10 feedback-smtp.${ctx.appConfig.region}.amazonses.com`]
|
|
3009
3095
|
});
|
|
3010
3096
|
new $5.aws.route53.Record(group2, `SPF`, {
|
|
3011
3097
|
zoneId: zone.id,
|
|
3012
3098
|
name: mailFrom.mailFromDomain,
|
|
3013
3099
|
type: "TXT",
|
|
3014
|
-
ttl: toSeconds2(
|
|
3100
|
+
ttl: toSeconds2(minutes5(5)),
|
|
3015
3101
|
records: ["v=spf1 include:amazonses.com -all"]
|
|
3016
3102
|
});
|
|
3017
3103
|
new $5.aws.route53.Record(group2, `DMARC`, {
|
|
3018
3104
|
zoneId: zone.id,
|
|
3019
3105
|
name: `_dmarc.${props.domain}`,
|
|
3020
3106
|
type: "TXT",
|
|
3021
|
-
ttl: toSeconds2(
|
|
3107
|
+
ttl: toSeconds2(minutes5(5)),
|
|
3022
3108
|
records: ["v=DMARC1; p=none;"]
|
|
3023
3109
|
});
|
|
3024
3110
|
const verification = new $5.aws.ses.DomainIdentityVerification(
|
|
@@ -3371,7 +3457,7 @@ import { $ as $10, Group as Group10 } from "@awsless/formation";
|
|
|
3371
3457
|
import { camelCase as camelCase4, constantCase as constantCase6 } from "change-case";
|
|
3372
3458
|
import deepmerge3 from "deepmerge";
|
|
3373
3459
|
import { relative as relative4 } from "path";
|
|
3374
|
-
import { seconds as
|
|
3460
|
+
import { seconds as seconds5, toSeconds as toSeconds3 } from "@awsless/duration";
|
|
3375
3461
|
import { toBytes } from "@awsless/size";
|
|
3376
3462
|
var typeGenCode3 = `
|
|
3377
3463
|
import { SendMessageOptions, SendMessageBatchOptions, BatchItem } from '@awsless/sqs'
|
|
@@ -3442,7 +3528,7 @@ var queueFeature = defineFeature({
|
|
|
3442
3528
|
name,
|
|
3443
3529
|
delaySeconds: toSeconds3(props.deliveryDelay),
|
|
3444
3530
|
visibilityTimeoutSeconds: toSeconds3(props.visibilityTimeout),
|
|
3445
|
-
receiveWaitTimeSeconds: toSeconds3(props.receiveMessageWaitTime ??
|
|
3531
|
+
receiveWaitTimeSeconds: toSeconds3(props.receiveMessageWaitTime ?? seconds5(0)),
|
|
3446
3532
|
messageRetentionSeconds: toSeconds3(props.retentionPeriod),
|
|
3447
3533
|
maxMessageSize: toBytes(props.maxMessageSize),
|
|
3448
3534
|
redrivePolicy: onFailure && onFailure.pipe(
|
|
@@ -3598,11 +3684,11 @@ var restFeature = defineFeature({
|
|
|
3598
3684
|
import { camelCase as camelCase5, constantCase as constantCase8, kebabCase as kebabCase6 } from "change-case";
|
|
3599
3685
|
import { $ as $13, Group as Group13 } from "@awsless/formation";
|
|
3600
3686
|
import { mebibytes as mebibytes3 } from "@awsless/size";
|
|
3601
|
-
import { dirname as
|
|
3687
|
+
import { dirname as dirname5, join as join10, relative as relative5 } from "path";
|
|
3602
3688
|
import { fileURLToPath } from "node:url";
|
|
3603
3689
|
|
|
3604
3690
|
// src/feature/function/prebuild.ts
|
|
3605
|
-
import { days as days3, seconds as
|
|
3691
|
+
import { days as days3, seconds as seconds6, toDays as toDays4, toSeconds as toSeconds4 } from "@awsless/duration";
|
|
3606
3692
|
import { $ as $12, Future as Future2, resolveInputs as resolveInputs2 } from "@awsless/formation";
|
|
3607
3693
|
import { mebibytes as mebibytes2, toMebibytes as toMebibytes2 } from "@awsless/size";
|
|
3608
3694
|
import { pascalCase as pascalCase2 } from "change-case";
|
|
@@ -3691,7 +3777,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
|
|
|
3691
3777
|
// runtime: props.runtime === 'container' ? undefined : props.runtime,
|
|
3692
3778
|
runtime: props.runtime,
|
|
3693
3779
|
handler: props.handler,
|
|
3694
|
-
timeout: toSeconds4(props.timeout ??
|
|
3780
|
+
timeout: toSeconds4(props.timeout ?? seconds6(10)),
|
|
3695
3781
|
memorySize: toMebibytes2(props.memorySize ?? mebibytes2(128)),
|
|
3696
3782
|
architectures: [props.architecture ?? "arm64"],
|
|
3697
3783
|
layers: props.layers?.map((id2) => ctx.shared.entry("layer", "arn", id2)),
|
|
@@ -3776,8 +3862,8 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
|
|
|
3776
3862
|
};
|
|
3777
3863
|
|
|
3778
3864
|
// src/feature/rpc/index.ts
|
|
3779
|
-
import { days as days4,
|
|
3780
|
-
var __dirname =
|
|
3865
|
+
import { days as days4, seconds as seconds7, toSeconds as toSeconds5 } from "@awsless/duration";
|
|
3866
|
+
var __dirname = dirname5(fileURLToPath(import.meta.url));
|
|
3781
3867
|
var rpcFeature = defineFeature({
|
|
3782
3868
|
name: "rpc",
|
|
3783
3869
|
async onTypeGen(ctx) {
|
|
@@ -3812,12 +3898,23 @@ var rpcFeature = defineFeature({
|
|
|
3812
3898
|
for (const stack of ctx.stackConfigs) {
|
|
3813
3899
|
for (const [id, queries] of Object.entries(stack.rpc ?? {})) {
|
|
3814
3900
|
const list5 = names[id];
|
|
3815
|
-
|
|
3901
|
+
if (!list5) {
|
|
3902
|
+
throw new FileError(stack.file, `The RPC API for "${id}" isn't defined on app level.`);
|
|
3903
|
+
}
|
|
3904
|
+
for (const [name, props] of Object.entries(queries ?? {})) {
|
|
3816
3905
|
if (list5.has(name)) {
|
|
3817
3906
|
throw new FileError(stack.file, `Duplicate RPC API function "${id}.${name}"`);
|
|
3818
3907
|
} else {
|
|
3819
3908
|
list5.add(name);
|
|
3820
3909
|
}
|
|
3910
|
+
const timeout = toSeconds5(props.timeout ?? ctx.appConfig.defaults.function.timeout);
|
|
3911
|
+
const maxTimeout = toSeconds5(ctx.appConfig.defaults.rpc[id].timeout) * 0.8;
|
|
3912
|
+
if (timeout > maxTimeout) {
|
|
3913
|
+
throw new FileError(
|
|
3914
|
+
stack.file,
|
|
3915
|
+
`Your RPC function "${id}.${name}" has a ${timeout} seconds timeout, the maximum is ${maxTimeout} seconds.`
|
|
3916
|
+
);
|
|
3917
|
+
}
|
|
3821
3918
|
}
|
|
3822
3919
|
}
|
|
3823
3920
|
}
|
|
@@ -3834,12 +3931,13 @@ var rpcFeature = defineFeature({
|
|
|
3834
3931
|
bundleFile: join10(__dirname, "/prebuild/rpc/bundle.zip"),
|
|
3835
3932
|
bundleHash: join10(__dirname, "/prebuild/rpc/HASH"),
|
|
3836
3933
|
memorySize: mebibytes3(256),
|
|
3837
|
-
timeout:
|
|
3934
|
+
timeout: props.timeout,
|
|
3838
3935
|
handler: "index.default",
|
|
3839
3936
|
runtime: "nodejs22.x",
|
|
3840
3937
|
warm: 3,
|
|
3841
3938
|
log: props.log
|
|
3842
3939
|
});
|
|
3940
|
+
result.setEnvironment("TIMEOUT", toSeconds5(props.timeout).toString());
|
|
3843
3941
|
const schemaTable = new $13.aws.dynamodb.Table(group, "schema", {
|
|
3844
3942
|
name: formatGlobalResourceName({
|
|
3845
3943
|
appName: ctx.app.name,
|
|
@@ -3929,7 +4027,7 @@ var rpcFeature = defineFeature({
|
|
|
3929
4027
|
const certificateArn = props.domain ? ctx.shared.entry("domain", `global-certificate-arn`, props.domain) : void 0;
|
|
3930
4028
|
const cache = new $13.aws.cloudfront.CachePolicy(group, "cache", {
|
|
3931
4029
|
name,
|
|
3932
|
-
minTtl: toSeconds5(
|
|
4030
|
+
minTtl: toSeconds5(seconds7(1)),
|
|
3933
4031
|
maxTtl: toSeconds5(days4(365)),
|
|
3934
4032
|
defaultTtl: toSeconds5(days4(1))
|
|
3935
4033
|
});
|
|
@@ -4141,10 +4239,10 @@ var searchFeature = defineFeature({
|
|
|
4141
4239
|
});
|
|
4142
4240
|
|
|
4143
4241
|
// src/feature/site/index.ts
|
|
4144
|
-
import { days as days5, seconds as
|
|
4242
|
+
import { days as days5, seconds as seconds8, toSeconds as toSeconds6 } from "@awsless/duration";
|
|
4145
4243
|
import { $ as $15, Group as Group15 } from "@awsless/formation";
|
|
4146
4244
|
import { glob as glob2 } from "glob";
|
|
4147
|
-
import { join as join11 } from "path";
|
|
4245
|
+
import { dirname as dirname6, join as join11 } from "path";
|
|
4148
4246
|
|
|
4149
4247
|
// src/feature/site/util.ts
|
|
4150
4248
|
import { contentType, lookup } from "mime-types";
|
|
@@ -4179,6 +4277,7 @@ var getForwardHostFunctionCode = () => {
|
|
|
4179
4277
|
|
|
4180
4278
|
// src/feature/site/index.ts
|
|
4181
4279
|
import { camelCase as camelCase6, constantCase as constantCase10 } from "change-case";
|
|
4280
|
+
import { exec } from "promisify-child-process";
|
|
4182
4281
|
var siteFeature = defineFeature({
|
|
4183
4282
|
name: "site",
|
|
4184
4283
|
onStack(ctx) {
|
|
@@ -4190,6 +4289,20 @@ var siteFeature = defineFeature({
|
|
|
4190
4289
|
resourceType: "site",
|
|
4191
4290
|
resourceName: id
|
|
4192
4291
|
});
|
|
4292
|
+
if (props.build) {
|
|
4293
|
+
const buildProps = props.build;
|
|
4294
|
+
ctx.registerBuild("site", name, async (build3) => {
|
|
4295
|
+
const fingerprint = await generateCacheKey(buildProps.cacheKey);
|
|
4296
|
+
return build3(fingerprint, async (write) => {
|
|
4297
|
+
const cwd = join11(directories.root, dirname6(ctx.stackConfig.file));
|
|
4298
|
+
await exec(buildProps.command, { cwd });
|
|
4299
|
+
await write("HASH", fingerprint);
|
|
4300
|
+
return {
|
|
4301
|
+
size: "n/a"
|
|
4302
|
+
};
|
|
4303
|
+
});
|
|
4304
|
+
});
|
|
4305
|
+
}
|
|
4193
4306
|
const origins = [];
|
|
4194
4307
|
const originGroups = [];
|
|
4195
4308
|
let bucket;
|
|
@@ -4316,7 +4429,7 @@ var siteFeature = defineFeature({
|
|
|
4316
4429
|
}
|
|
4317
4430
|
const cache = new $15.aws.cloudfront.CachePolicy(group, "cache", {
|
|
4318
4431
|
name,
|
|
4319
|
-
minTtl: toSeconds6(
|
|
4432
|
+
minTtl: toSeconds6(seconds8(1)),
|
|
4320
4433
|
maxTtl: toSeconds6(days5(365)),
|
|
4321
4434
|
defaultTtl: toSeconds6(days5(1)),
|
|
4322
4435
|
parametersInCacheKeyAndForwardedToOrigin: {
|
|
@@ -4671,6 +4784,7 @@ var storeFeature = defineFeature({
|
|
|
4671
4784
|
// src/feature/table/index.ts
|
|
4672
4785
|
import { $ as $17, Group as Group17 } from "@awsless/formation";
|
|
4673
4786
|
import { constantCase as constantCase11 } from "change-case";
|
|
4787
|
+
import { toSeconds as toSeconds7 } from "@awsless/duration";
|
|
4674
4788
|
var tableFeature = defineFeature({
|
|
4675
4789
|
name: "table",
|
|
4676
4790
|
async onTypeGen(ctx) {
|
|
@@ -4757,8 +4871,8 @@ var tableFeature = defineFeature({
|
|
|
4757
4871
|
rangeKey: props.sort,
|
|
4758
4872
|
attribute: attributeDefinitions(),
|
|
4759
4873
|
ttl: {
|
|
4760
|
-
attributeName: props.
|
|
4761
|
-
enabled: !!props.
|
|
4874
|
+
attributeName: props.ttl,
|
|
4875
|
+
enabled: !!props.ttl
|
|
4762
4876
|
},
|
|
4763
4877
|
pointInTimeRecovery: {
|
|
4764
4878
|
enabled: props.pointInTimeRecovery
|
|
@@ -4786,11 +4900,14 @@ var tableFeature = defineFeature({
|
|
|
4786
4900
|
{
|
|
4787
4901
|
functionName: result.lambda.functionName,
|
|
4788
4902
|
eventSourceArn: table2.streamArn,
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
//
|
|
4792
|
-
|
|
4793
|
-
|
|
4903
|
+
// tumblingWindowInSeconds
|
|
4904
|
+
// maximumRecordAgeInSeconds: props.stream.
|
|
4905
|
+
// bisectBatchOnFunctionError: true,
|
|
4906
|
+
batchSize: props.stream.batchSize,
|
|
4907
|
+
maximumBatchingWindowInSeconds: props.stream.batchWindow ? toSeconds7(props.stream.batchWindow) : void 0,
|
|
4908
|
+
maximumRetryAttempts: props.stream.retryAttempts,
|
|
4909
|
+
parallelizationFactor: props.stream.concurrencyPerShard,
|
|
4910
|
+
functionResponseTypes: ["ReportBatchItemFailures"],
|
|
4794
4911
|
startingPosition: "LATEST",
|
|
4795
4912
|
destinationConfig: {
|
|
4796
4913
|
onFailure: onFailure ? { destinationArn: onFailure } : void 0
|
|
@@ -5910,7 +6027,6 @@ var buildAssets = async (builders, stackFilters, showResult = false) => {
|
|
|
5910
6027
|
});
|
|
5911
6028
|
results.push({ ...builder, result });
|
|
5912
6029
|
} catch (error) {
|
|
5913
|
-
console.log(error);
|
|
5914
6030
|
logError(new Error(`Build failed for: ${builder.type} ${builder.name}`));
|
|
5915
6031
|
throw error;
|
|
5916
6032
|
}
|
|
@@ -6279,10 +6395,10 @@ var CustomReporter = class {
|
|
|
6279
6395
|
};
|
|
6280
6396
|
|
|
6281
6397
|
// src/test/start.ts
|
|
6282
|
-
import { swc
|
|
6398
|
+
import { swc } from "rollup-plugin-swc3";
|
|
6283
6399
|
import { configDefaults } from "vitest/config";
|
|
6284
6400
|
import { startVitest } from "vitest/node";
|
|
6285
|
-
import
|
|
6401
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
6286
6402
|
import nodeResolve2 from "@rollup/plugin-node-resolve";
|
|
6287
6403
|
import json2 from "@rollup/plugin-json";
|
|
6288
6404
|
import { dirname as dirname8, join as join13 } from "path";
|
|
@@ -6321,10 +6437,10 @@ var startTest = async (props) => {
|
|
|
6321
6437
|
{
|
|
6322
6438
|
plugins: [
|
|
6323
6439
|
// @ts-ignore
|
|
6324
|
-
|
|
6440
|
+
commonjs({ sourceMap: true }),
|
|
6325
6441
|
// @ts-ignore
|
|
6326
6442
|
nodeResolve2({ preferBuiltins: true }),
|
|
6327
|
-
|
|
6443
|
+
swc({
|
|
6328
6444
|
jsc: {
|
|
6329
6445
|
// baseUrl: dirname(input),
|
|
6330
6446
|
minify: { sourceMap: true }
|