@awsless/awsless 0.0.208 → 0.0.209
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/README.MD +34 -20
- package/dist/app.json +1 -1
- package/dist/bin.js +214 -105
- package/dist/build-json-schema.js +125 -105
- package/dist/stack.json +1 -1
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
3
|
|
|
4
4
|
// src/config/stack.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z25 } from "zod";
|
|
6
6
|
|
|
7
7
|
// src/config/schema/resource-id.ts
|
|
8
8
|
import { paramCase } from "change-case";
|
|
@@ -397,13 +397,33 @@ var PubSubSchema = z11.record(
|
|
|
397
397
|
})
|
|
398
398
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
399
399
|
|
|
400
|
-
// src/feature/
|
|
400
|
+
// src/feature/rest/schema.ts
|
|
401
401
|
import { z as z13 } from "zod";
|
|
402
402
|
|
|
403
|
+
// src/config/schema/route.ts
|
|
404
|
+
import { z as z12 } from "zod";
|
|
405
|
+
var RouteSchema = z12.union([
|
|
406
|
+
z12.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
407
|
+
z12.literal("$default")
|
|
408
|
+
]);
|
|
409
|
+
|
|
410
|
+
// src/feature/rest/schema.ts
|
|
411
|
+
var RestDefaultSchema = z13.record(
|
|
412
|
+
ResourceIdSchema,
|
|
413
|
+
z13.object({
|
|
414
|
+
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
415
|
+
subDomain: z13.string().optional()
|
|
416
|
+
})
|
|
417
|
+
).optional().describe("Define your global REST API's.");
|
|
418
|
+
var RestSchema = z13.record(ResourceIdSchema, z13.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
419
|
+
|
|
420
|
+
// src/feature/test/schema.ts
|
|
421
|
+
import { z as z15 } from "zod";
|
|
422
|
+
|
|
403
423
|
// src/config/schema/local-directory.ts
|
|
404
424
|
import { stat as stat2 } from "fs/promises";
|
|
405
|
-
import { z as
|
|
406
|
-
var LocalDirectorySchema =
|
|
425
|
+
import { z as z14 } from "zod";
|
|
426
|
+
var LocalDirectorySchema = z14.string().transform((path) => resolvePath(path)).refine(async (path) => {
|
|
407
427
|
try {
|
|
408
428
|
const s = await stat2(path);
|
|
409
429
|
return s.isDirectory();
|
|
@@ -413,32 +433,32 @@ var LocalDirectorySchema = z12.string().transform((path) => resolvePath(path)).r
|
|
|
413
433
|
}, `Directory doesn't exist`);
|
|
414
434
|
|
|
415
435
|
// src/feature/test/schema.ts
|
|
416
|
-
var TestsSchema =
|
|
436
|
+
var TestsSchema = z15.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
417
437
|
|
|
418
438
|
// src/feature/topic/schema.ts
|
|
419
439
|
import { paramCase as paramCase2 } from "change-case";
|
|
420
|
-
import { z as
|
|
440
|
+
import { z as z17 } from "zod";
|
|
421
441
|
|
|
422
442
|
// src/config/schema/email.ts
|
|
423
|
-
import { z as
|
|
424
|
-
var EmailSchema =
|
|
443
|
+
import { z as z16 } from "zod";
|
|
444
|
+
var EmailSchema = z16.string().email();
|
|
425
445
|
|
|
426
446
|
// src/feature/topic/schema.ts
|
|
427
|
-
var TopicNameSchema =
|
|
428
|
-
var TopicsSchema =
|
|
447
|
+
var TopicNameSchema = z17.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase2(value)).describe("Define event topic name.");
|
|
448
|
+
var TopicsSchema = z17.array(TopicNameSchema).refine((topics) => {
|
|
429
449
|
return topics.length === new Set(topics).size;
|
|
430
450
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
431
|
-
var SubscribersSchema =
|
|
451
|
+
var SubscribersSchema = z17.record(TopicNameSchema, z17.union([EmailSchema, FunctionSchema])).optional().describe("Define the events to subscribe too in your stack.");
|
|
432
452
|
|
|
433
453
|
// src/feature/cron/schema/index.ts
|
|
434
|
-
import { z as
|
|
454
|
+
import { z as z19 } from "zod";
|
|
435
455
|
|
|
436
456
|
// src/feature/cron/schema/schedule.ts
|
|
437
|
-
import { z as
|
|
457
|
+
import { z as z18 } from "zod";
|
|
438
458
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
439
|
-
var RateExpressionSchema =
|
|
459
|
+
var RateExpressionSchema = z18.custom(
|
|
440
460
|
(value) => {
|
|
441
|
-
return
|
|
461
|
+
return z18.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
442
462
|
const [str] = rate.split(" ");
|
|
443
463
|
const number = parseInt(str);
|
|
444
464
|
return number > 0;
|
|
@@ -454,9 +474,9 @@ var RateExpressionSchema = z16.custom(
|
|
|
454
474
|
}
|
|
455
475
|
return `rate(${rate})`;
|
|
456
476
|
});
|
|
457
|
-
var CronExpressionSchema =
|
|
477
|
+
var CronExpressionSchema = z18.custom(
|
|
458
478
|
(value) => {
|
|
459
|
-
return
|
|
479
|
+
return z18.string().safeParse(value).success;
|
|
460
480
|
},
|
|
461
481
|
{ message: "Invalid cron expression" }
|
|
462
482
|
).superRefine((value, ctx) => {
|
|
@@ -465,12 +485,12 @@ var CronExpressionSchema = z16.custom(
|
|
|
465
485
|
} catch (error) {
|
|
466
486
|
if (error instanceof Error) {
|
|
467
487
|
ctx.addIssue({
|
|
468
|
-
code:
|
|
488
|
+
code: z18.ZodIssueCode.custom,
|
|
469
489
|
message: `Invalid cron expression: ${error.message}`
|
|
470
490
|
});
|
|
471
491
|
} else {
|
|
472
492
|
ctx.addIssue({
|
|
473
|
-
code:
|
|
493
|
+
code: z18.ZodIssueCode.custom,
|
|
474
494
|
message: "Invalid cron expression"
|
|
475
495
|
});
|
|
476
496
|
}
|
|
@@ -481,21 +501,21 @@ var CronExpressionSchema = z16.custom(
|
|
|
481
501
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
482
502
|
|
|
483
503
|
// src/feature/cron/schema/index.ts
|
|
484
|
-
var CronsSchema =
|
|
504
|
+
var CronsSchema = z19.record(
|
|
485
505
|
ResourceIdSchema,
|
|
486
|
-
|
|
487
|
-
enabled:
|
|
506
|
+
z19.object({
|
|
507
|
+
enabled: z19.boolean().default(true).describe("If the cron is enabled."),
|
|
488
508
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
489
509
|
schedule: ScheduleExpressionSchema.describe(
|
|
490
510
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
491
511
|
),
|
|
492
|
-
payload:
|
|
512
|
+
payload: z19.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
493
513
|
})
|
|
494
514
|
).optional();
|
|
495
515
|
|
|
496
516
|
// src/feature/cache/schema.ts
|
|
497
|
-
import { z as
|
|
498
|
-
var TypeSchema =
|
|
517
|
+
import { z as z20 } from "zod";
|
|
518
|
+
var TypeSchema = z20.enum([
|
|
499
519
|
"t4g.small",
|
|
500
520
|
"t4g.medium",
|
|
501
521
|
"r6g.large",
|
|
@@ -510,25 +530,25 @@ var TypeSchema = z18.enum([
|
|
|
510
530
|
"r6gd.4xlarge",
|
|
511
531
|
"r6gd.8xlarge"
|
|
512
532
|
]);
|
|
513
|
-
var PortSchema =
|
|
514
|
-
var ShardsSchema =
|
|
515
|
-
var ReplicasPerShardSchema =
|
|
516
|
-
var EngineSchema =
|
|
517
|
-
var CachesSchema =
|
|
533
|
+
var PortSchema = z20.number().int().min(1).max(5e4);
|
|
534
|
+
var ShardsSchema = z20.number().int().min(0).max(100);
|
|
535
|
+
var ReplicasPerShardSchema = z20.number().int().min(0).max(5);
|
|
536
|
+
var EngineSchema = z20.enum(["7.0", "6.2"]);
|
|
537
|
+
var CachesSchema = z20.record(
|
|
518
538
|
ResourceIdSchema,
|
|
519
|
-
|
|
539
|
+
z20.object({
|
|
520
540
|
type: TypeSchema.default("t4g.small"),
|
|
521
541
|
port: PortSchema.default(6379),
|
|
522
542
|
shards: ShardsSchema.default(1),
|
|
523
543
|
replicasPerShard: ReplicasPerShardSchema.default(1),
|
|
524
544
|
engine: EngineSchema.default("7.0"),
|
|
525
|
-
dataTiering:
|
|
545
|
+
dataTiering: z20.boolean().default(false)
|
|
526
546
|
})
|
|
527
547
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
528
548
|
|
|
529
549
|
// src/feature/auth/schema.ts
|
|
530
|
-
import { z as
|
|
531
|
-
var TriggersSchema =
|
|
550
|
+
import { z as z21 } from "zod";
|
|
551
|
+
var TriggersSchema = z21.object({
|
|
532
552
|
beforeToken: FunctionSchema.optional().describe("A pre jwt token generation AWS Lambda trigger."),
|
|
533
553
|
beforeLogin: FunctionSchema.optional().describe("A pre user login AWS Lambda trigger."),
|
|
534
554
|
afterLogin: FunctionSchema.optional().describe("A post user login AWS Lambda trigger."),
|
|
@@ -541,42 +561,42 @@ var TriggersSchema = z19.object({
|
|
|
541
561
|
createChallenge: FunctionSchema.optional().describe("Creates an authentication challenge."),
|
|
542
562
|
verifyChallenge: FunctionSchema.optional().describe("Verifies the authentication challenge response.")
|
|
543
563
|
}).describe("Specifies the configuration for AWS Lambda triggers.");
|
|
544
|
-
var AuthSchema =
|
|
564
|
+
var AuthSchema = z21.record(
|
|
545
565
|
ResourceIdSchema,
|
|
546
|
-
|
|
547
|
-
access:
|
|
566
|
+
z21.object({
|
|
567
|
+
access: z21.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
|
|
548
568
|
triggers: TriggersSchema.optional()
|
|
549
569
|
})
|
|
550
570
|
).optional().describe("Define the auth triggers in your stack.");
|
|
551
|
-
var AuthDefaultSchema =
|
|
571
|
+
var AuthDefaultSchema = z21.record(
|
|
552
572
|
ResourceIdSchema,
|
|
553
|
-
|
|
554
|
-
allowUserRegistration:
|
|
555
|
-
messaging:
|
|
573
|
+
z21.object({
|
|
574
|
+
allowUserRegistration: z21.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
|
|
575
|
+
messaging: z21.object({
|
|
556
576
|
fromEmail: EmailSchema.describe("Specifies the sender's email address."),
|
|
557
|
-
fromName:
|
|
577
|
+
fromName: z21.string().optional().describe("Specifies the sender's name."),
|
|
558
578
|
replyTo: EmailSchema.optional().describe(
|
|
559
579
|
"The destination to which the receiver of the email should reply."
|
|
560
580
|
)
|
|
561
581
|
}).optional().describe("The email configuration for sending messages."),
|
|
562
582
|
// secret: z.boolean().default(false).describe('Specifies whether you want to generate a client secret.'),
|
|
563
|
-
username:
|
|
564
|
-
emailAlias:
|
|
565
|
-
caseSensitive:
|
|
583
|
+
username: z21.object({
|
|
584
|
+
emailAlias: z21.boolean().default(true).describe("Allow the user email to be used as username."),
|
|
585
|
+
caseSensitive: z21.boolean().default(false).describe(
|
|
566
586
|
"Specifies whether username case sensitivity will be enabled. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name."
|
|
567
587
|
)
|
|
568
588
|
}).default({}).describe("The username policy."),
|
|
569
|
-
password:
|
|
570
|
-
minLength:
|
|
571
|
-
uppercase:
|
|
572
|
-
lowercase:
|
|
573
|
-
numbers:
|
|
574
|
-
symbols:
|
|
589
|
+
password: z21.object({
|
|
590
|
+
minLength: z21.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
|
|
591
|
+
uppercase: z21.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
|
|
592
|
+
lowercase: z21.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
|
|
593
|
+
numbers: z21.boolean().default(true).describe("Required users to use at least one number in their password."),
|
|
594
|
+
symbols: z21.boolean().default(true).describe("Required users to use at least one symbol in their password."),
|
|
575
595
|
temporaryPasswordValidity: DurationSchema.default("7 days").describe(
|
|
576
596
|
"The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
|
|
577
597
|
)
|
|
578
598
|
}).default({}).describe("The password policy."),
|
|
579
|
-
validity:
|
|
599
|
+
validity: z21.object({
|
|
580
600
|
idToken: DurationSchema.default("1 hour").describe(
|
|
581
601
|
"The ID token time limit. After this limit expires, your user can't use their ID token."
|
|
582
602
|
),
|
|
@@ -592,23 +612,23 @@ var AuthDefaultSchema = z19.record(
|
|
|
592
612
|
).default({}).describe("Define the authenticatable users in your app.");
|
|
593
613
|
|
|
594
614
|
// src/feature/http/schema.ts
|
|
595
|
-
import { z as
|
|
596
|
-
var
|
|
597
|
-
var HttpDefaultSchema =
|
|
615
|
+
import { z as z22 } from "zod";
|
|
616
|
+
var RouteSchema2 = z22.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
|
|
617
|
+
var HttpDefaultSchema = z22.record(
|
|
598
618
|
ResourceIdSchema,
|
|
599
|
-
|
|
619
|
+
z22.object({
|
|
600
620
|
domain: ResourceIdSchema.describe("The domain id to link your API with."),
|
|
601
|
-
subDomain:
|
|
621
|
+
subDomain: z22.string().optional()
|
|
602
622
|
// auth: ResourceIdSchema.optional(),
|
|
603
623
|
})
|
|
604
624
|
).optional().describe("Define your global HTTP API's.");
|
|
605
|
-
var HttpSchema =
|
|
625
|
+
var HttpSchema = z22.record(ResourceIdSchema, z22.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
|
|
606
626
|
|
|
607
627
|
// src/feature/search/schema.ts
|
|
608
|
-
import { z as
|
|
628
|
+
import { z as z23 } from "zod";
|
|
609
629
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
610
|
-
var VersionSchema =
|
|
611
|
-
var TypeSchema2 =
|
|
630
|
+
var VersionSchema = z23.enum(["2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
|
|
631
|
+
var TypeSchema2 = z23.enum([
|
|
612
632
|
"t3.small",
|
|
613
633
|
"t3.medium",
|
|
614
634
|
"t3.large",
|
|
@@ -709,41 +729,41 @@ var TypeSchema2 = z21.enum([
|
|
|
709
729
|
"r6gd.16xlarge"
|
|
710
730
|
]);
|
|
711
731
|
var StorageSizeSchema = SizeSchema.refine(sizeMin(gibibytes2(10)), "Minimum storage size is 10 GB").refine(sizeMax(gibibytes2(100)), "Maximum storage size is 100 GB").describe("The size of the function's /tmp directory. You can specify a size value from 512 MB to 10 GiB.");
|
|
712
|
-
var SearchsSchema =
|
|
732
|
+
var SearchsSchema = z23.record(
|
|
713
733
|
ResourceIdSchema,
|
|
714
|
-
|
|
734
|
+
z23.object({
|
|
715
735
|
type: TypeSchema2.default("t3.small"),
|
|
716
|
-
count:
|
|
736
|
+
count: z23.number().int().min(1).default(1),
|
|
717
737
|
version: VersionSchema.default("2.11"),
|
|
718
738
|
storage: StorageSizeSchema.default("10 GB"),
|
|
719
|
-
vpc:
|
|
739
|
+
vpc: z23.boolean().default(false)
|
|
720
740
|
})
|
|
721
741
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
722
742
|
|
|
723
743
|
// src/feature/site/schema.ts
|
|
724
|
-
import { z as
|
|
725
|
-
var ErrorResponsePathSchema =
|
|
744
|
+
import { z as z24 } from "zod";
|
|
745
|
+
var ErrorResponsePathSchema = z24.string().describe(
|
|
726
746
|
"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."
|
|
727
747
|
);
|
|
728
|
-
var StatusCodeSchema =
|
|
748
|
+
var StatusCodeSchema = z24.number().int().positive().optional().describe(
|
|
729
749
|
"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."
|
|
730
750
|
);
|
|
731
751
|
var MinTTLSchema = DurationSchema.describe(
|
|
732
752
|
"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."
|
|
733
753
|
);
|
|
734
|
-
var ErrorResponseSchema =
|
|
754
|
+
var ErrorResponseSchema = z24.union([
|
|
735
755
|
ErrorResponsePathSchema,
|
|
736
|
-
|
|
756
|
+
z24.object({
|
|
737
757
|
path: ErrorResponsePathSchema,
|
|
738
758
|
statusCode: StatusCodeSchema.optional(),
|
|
739
759
|
minTTL: MinTTLSchema.optional()
|
|
740
760
|
})
|
|
741
761
|
]).optional();
|
|
742
|
-
var SitesSchema =
|
|
762
|
+
var SitesSchema = z24.record(
|
|
743
763
|
ResourceIdSchema,
|
|
744
|
-
|
|
764
|
+
z24.object({
|
|
745
765
|
domain: ResourceIdSchema.describe("The domain id to link your site with."),
|
|
746
|
-
subDomain:
|
|
766
|
+
subDomain: z24.string().optional(),
|
|
747
767
|
static: LocalDirectorySchema.optional().describe("Specifies the path to the static files directory."),
|
|
748
768
|
ssr: FunctionSchema.optional().describe("Specifies the ssr file."),
|
|
749
769
|
// bind: z.object({
|
|
@@ -758,7 +778,7 @@ var SitesSchema = z22.record(
|
|
|
758
778
|
// build: z.string().optional(),
|
|
759
779
|
// }),
|
|
760
780
|
// ]),
|
|
761
|
-
errors:
|
|
781
|
+
errors: z24.object({
|
|
762
782
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
763
783
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
764
784
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -771,16 +791,16 @@ var SitesSchema = z22.record(
|
|
|
771
791
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
772
792
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
773
793
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
774
|
-
cors:
|
|
775
|
-
override:
|
|
794
|
+
cors: z24.object({
|
|
795
|
+
override: z24.boolean().default(false),
|
|
776
796
|
maxAge: DurationSchema.default("365 days"),
|
|
777
|
-
exposeHeaders:
|
|
778
|
-
credentials:
|
|
779
|
-
headers:
|
|
780
|
-
origins:
|
|
781
|
-
methods:
|
|
797
|
+
exposeHeaders: z24.string().array().optional(),
|
|
798
|
+
credentials: z24.boolean().default(false),
|
|
799
|
+
headers: z24.string().array().default(["*"]),
|
|
800
|
+
origins: z24.string().array().default(["*"]),
|
|
801
|
+
methods: z24.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
782
802
|
}).optional().describe("Define the cors headers."),
|
|
783
|
-
security:
|
|
803
|
+
security: z24.object({
|
|
784
804
|
// contentSecurityPolicy: z.object({
|
|
785
805
|
// override: z.boolean().default(false),
|
|
786
806
|
// policy: z.string(),
|
|
@@ -822,10 +842,10 @@ var SitesSchema = z22.record(
|
|
|
822
842
|
// reportUri?: string
|
|
823
843
|
// }
|
|
824
844
|
}).optional().describe("Define the security policy."),
|
|
825
|
-
cache:
|
|
826
|
-
cookies:
|
|
827
|
-
headers:
|
|
828
|
-
queries:
|
|
845
|
+
cache: z24.object({
|
|
846
|
+
cookies: z24.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
847
|
+
headers: z24.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
848
|
+
queries: z24.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
829
849
|
}).optional().describe(
|
|
830
850
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
831
851
|
)
|
|
@@ -837,15 +857,15 @@ var DependsSchema = ResourceIdSchema.array().optional().describe("Define the sta
|
|
|
837
857
|
var NameSchema = ResourceIdSchema.refine((name) => !["base"].includes(name), {
|
|
838
858
|
message: `Stack name can't be a reserved name.`
|
|
839
859
|
}).describe("Stack name.");
|
|
840
|
-
var StackSchema =
|
|
841
|
-
$schema:
|
|
860
|
+
var StackSchema = z25.object({
|
|
861
|
+
$schema: z25.string().optional(),
|
|
842
862
|
name: NameSchema,
|
|
843
863
|
depends: DependsSchema,
|
|
844
864
|
onFailure: OnFailureSchema,
|
|
845
865
|
auth: AuthSchema,
|
|
846
866
|
graphql: GraphQLSchema,
|
|
847
867
|
http: HttpSchema,
|
|
848
|
-
|
|
868
|
+
rest: RestSchema,
|
|
849
869
|
configs: ConfigsSchema,
|
|
850
870
|
crons: CronsSchema,
|
|
851
871
|
caches: CachesSchema,
|
|
@@ -862,10 +882,10 @@ var StackSchema = z23.object({
|
|
|
862
882
|
});
|
|
863
883
|
|
|
864
884
|
// src/config/app.ts
|
|
865
|
-
import { z as
|
|
885
|
+
import { z as z28 } from "zod";
|
|
866
886
|
|
|
867
887
|
// src/config/schema/region.ts
|
|
868
|
-
import { z as
|
|
888
|
+
import { z as z26 } from "zod";
|
|
869
889
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
870
890
|
var AF = ["af-south-1"];
|
|
871
891
|
var AP = [
|
|
@@ -894,21 +914,21 @@ var EU = [
|
|
|
894
914
|
var ME = ["me-south-1", "me-central-1"];
|
|
895
915
|
var SA = ["sa-east-1"];
|
|
896
916
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
897
|
-
var RegionSchema =
|
|
917
|
+
var RegionSchema = z26.enum(regions);
|
|
898
918
|
|
|
899
919
|
// src/feature/domain/schema.ts
|
|
900
|
-
import { z as
|
|
901
|
-
var DomainNameSchema =
|
|
920
|
+
import { z as z27 } from "zod";
|
|
921
|
+
var DomainNameSchema = z27.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
902
922
|
"Enter a fully qualified domain name, for example, www.example.com. You can optionally include a trailing dot. If you omit the trailing dot, Amazon Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical."
|
|
903
923
|
);
|
|
904
|
-
var DNSTypeSchema =
|
|
924
|
+
var DNSTypeSchema = z27.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
905
925
|
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
906
|
-
var RecordsSchema =
|
|
907
|
-
var DomainsDefaultSchema =
|
|
926
|
+
var RecordsSchema = z27.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
927
|
+
var DomainsDefaultSchema = z27.record(
|
|
908
928
|
ResourceIdSchema,
|
|
909
|
-
|
|
929
|
+
z27.object({
|
|
910
930
|
domain: DomainNameSchema.describe("Define the domain name"),
|
|
911
|
-
dns:
|
|
931
|
+
dns: z27.object({
|
|
912
932
|
name: DomainNameSchema.optional(),
|
|
913
933
|
type: DNSTypeSchema,
|
|
914
934
|
ttl: TTLSchema,
|
|
@@ -918,24 +938,24 @@ var DomainsDefaultSchema = z25.record(
|
|
|
918
938
|
).optional().describe("Define the domains for your application.");
|
|
919
939
|
|
|
920
940
|
// src/config/app.ts
|
|
921
|
-
var AppSchema =
|
|
922
|
-
$schema:
|
|
941
|
+
var AppSchema = z28.object({
|
|
942
|
+
$schema: z28.string().optional(),
|
|
923
943
|
name: ResourceIdSchema.describe("App name."),
|
|
924
944
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
925
|
-
profile:
|
|
945
|
+
profile: z28.string().describe("The AWS profile to deploy to."),
|
|
926
946
|
// stage: z
|
|
927
947
|
// .string()
|
|
928
948
|
// .regex(/^[a-z]+$/)
|
|
929
949
|
// .default('prod')
|
|
930
950
|
// .describe('The deployment stage.'),
|
|
931
|
-
defaults:
|
|
951
|
+
defaults: z28.object({
|
|
932
952
|
auth: AuthDefaultSchema,
|
|
933
953
|
domains: DomainsDefaultSchema,
|
|
934
954
|
function: FunctionDefaultSchema,
|
|
935
955
|
queue: QueueDefaultSchema,
|
|
936
956
|
graphql: GraphQLDefaultSchema,
|
|
937
|
-
http: HttpDefaultSchema
|
|
938
|
-
|
|
957
|
+
http: HttpDefaultSchema,
|
|
958
|
+
rest: RestDefaultSchema
|
|
939
959
|
}).default({}).describe("Default properties")
|
|
940
960
|
});
|
|
941
961
|
|