@awsless/awsless 0.0.653 → 0.0.655
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/app.stage.json +1 -1
- package/dist/bin.js +961 -711
- package/dist/build-json-schema.js +288 -272
- package/dist/client.d.ts +2 -2
- package/dist/client.js +2 -2
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/HASH +1 -1
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/on-failure/HASH +1 -0
- package/dist/prebuild/on-failure/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/prebuild.js +2 -1
- package/dist/server.d.ts +4 -1
- package/dist/server.js +23 -5
- package/dist/stack.json +1 -1
- package/dist/stack.stage.json +1 -1
- package/package.json +12 -12
|
@@ -4,7 +4,7 @@ import { join as join2 } from "node:path";
|
|
|
4
4
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
5
5
|
|
|
6
6
|
// src/config/app.ts
|
|
7
|
-
import { z as
|
|
7
|
+
import { z as z25 } from "zod";
|
|
8
8
|
|
|
9
9
|
// src/feature/alert/schema.ts
|
|
10
10
|
import { kebabCase } from "change-case";
|
|
@@ -366,39 +366,50 @@ var LayerSchema = z13.record(
|
|
|
366
366
|
).optional().describe("Define the lambda layers in your stack.");
|
|
367
367
|
|
|
368
368
|
// src/feature/on-failure/schema.ts
|
|
369
|
-
|
|
369
|
+
import { z as z14 } from "zod";
|
|
370
|
+
var NotifySchema = z14.union([
|
|
371
|
+
//
|
|
372
|
+
EmailSchema.transform((v) => [v]),
|
|
373
|
+
EmailSchema.array()
|
|
374
|
+
]).describe("Receive an email notification when consuming failure entries goes wrong.");
|
|
375
|
+
var OnFailureDefaultSchema = z14.object({
|
|
376
|
+
consumer: FunctionSchema,
|
|
377
|
+
notify: NotifySchema.optional()
|
|
378
|
+
}).optional().describe(
|
|
370
379
|
[
|
|
371
380
|
"Defining a onFailure handler will add a global onFailure handler for the following resources:",
|
|
372
|
-
"-
|
|
373
|
-
"-
|
|
374
|
-
"-
|
|
375
|
-
"-
|
|
381
|
+
"- Tasks",
|
|
382
|
+
"- Crons",
|
|
383
|
+
"- Queues",
|
|
384
|
+
"- Topics",
|
|
385
|
+
"- Pubsub",
|
|
386
|
+
"- Table streams"
|
|
376
387
|
].join("\n")
|
|
377
388
|
);
|
|
378
389
|
|
|
379
390
|
// src/feature/on-log/schema.ts
|
|
380
|
-
import { z as
|
|
381
|
-
var FilterSchema =
|
|
382
|
-
var OnLogDefaultSchema =
|
|
391
|
+
import { z as z15 } from "zod";
|
|
392
|
+
var FilterSchema = z15.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
|
|
393
|
+
var OnLogDefaultSchema = z15.union([
|
|
383
394
|
FunctionSchema.transform((consumer) => ({
|
|
384
395
|
consumer,
|
|
385
396
|
filter: ["error", "fatal"]
|
|
386
397
|
})),
|
|
387
|
-
|
|
398
|
+
z15.object({
|
|
388
399
|
consumer: FunctionSchema,
|
|
389
400
|
filter: FilterSchema
|
|
390
401
|
})
|
|
391
402
|
]).optional().describe("Define a subscription on all Lambda functions logs.");
|
|
392
403
|
|
|
393
404
|
// src/feature/pubsub/schema.ts
|
|
394
|
-
import { z as
|
|
405
|
+
import { z as z16 } from "zod";
|
|
395
406
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
396
|
-
var PubSubDefaultSchema =
|
|
407
|
+
var PubSubDefaultSchema = z16.record(
|
|
397
408
|
ResourceIdSchema,
|
|
398
|
-
|
|
409
|
+
z16.object({
|
|
399
410
|
auth: FunctionSchema,
|
|
400
411
|
domain: DomainSchema.optional(),
|
|
401
|
-
subDomain:
|
|
412
|
+
subDomain: z16.string().optional()
|
|
402
413
|
// auth: z.union([
|
|
403
414
|
// ResourceIdSchema,
|
|
404
415
|
// z.object({
|
|
@@ -414,11 +425,11 @@ var PubSubDefaultSchema = z15.record(
|
|
|
414
425
|
// .optional(),
|
|
415
426
|
})
|
|
416
427
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
417
|
-
var PubSubSchema =
|
|
428
|
+
var PubSubSchema = z16.record(
|
|
418
429
|
ResourceIdSchema,
|
|
419
|
-
|
|
420
|
-
sql:
|
|
421
|
-
sqlVersion:
|
|
430
|
+
z16.object({
|
|
431
|
+
sql: z16.string().describe("The SQL statement used to query the IOT topic."),
|
|
432
|
+
sqlVersion: z16.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
|
|
422
433
|
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
423
434
|
})
|
|
424
435
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
@@ -426,7 +437,7 @@ var PubSubSchema = z15.record(
|
|
|
426
437
|
// src/feature/queue/schema.ts
|
|
427
438
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
428
439
|
import { kibibytes } from "@awsless/size";
|
|
429
|
-
import { z as
|
|
440
|
+
import { z as z17 } from "zod";
|
|
430
441
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
431
442
|
durationMin(minutes2(1)),
|
|
432
443
|
"Minimum retention period is 1 minute"
|
|
@@ -454,10 +465,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
454
465
|
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(
|
|
455
466
|
"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."
|
|
456
467
|
);
|
|
457
|
-
var BatchSizeSchema =
|
|
468
|
+
var BatchSizeSchema = z17.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
458
469
|
"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."
|
|
459
470
|
);
|
|
460
|
-
var MaxConcurrencySchema =
|
|
471
|
+
var MaxConcurrencySchema = z17.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
461
472
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
462
473
|
);
|
|
463
474
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -466,7 +477,10 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
466
477
|
).describe(
|
|
467
478
|
"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."
|
|
468
479
|
);
|
|
469
|
-
var
|
|
480
|
+
var RetryAttemptsSchema2 = z17.number().int().min(0).max(999).describe(
|
|
481
|
+
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 999."
|
|
482
|
+
);
|
|
483
|
+
var QueueDefaultSchema = z17.object({
|
|
470
484
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
471
485
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
472
486
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -474,9 +488,10 @@ var QueueDefaultSchema = z16.object({
|
|
|
474
488
|
maxMessageSize: MaxMessageSizeSchema.default("256 KB"),
|
|
475
489
|
batchSize: BatchSizeSchema.default(10),
|
|
476
490
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
477
|
-
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
491
|
+
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
492
|
+
retryAttempts: RetryAttemptsSchema2.default(2)
|
|
478
493
|
}).default({});
|
|
479
|
-
var QueueSchema =
|
|
494
|
+
var QueueSchema = z17.object({
|
|
480
495
|
consumer: FunctionSchema.optional().describe("The consuming lambda function properties."),
|
|
481
496
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
482
497
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
@@ -485,11 +500,12 @@ var QueueSchema = z16.object({
|
|
|
485
500
|
maxMessageSize: MaxMessageSizeSchema.optional(),
|
|
486
501
|
batchSize: BatchSizeSchema.optional(),
|
|
487
502
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
488
|
-
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
503
|
+
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
504
|
+
retryAttempts: RetryAttemptsSchema2.optional()
|
|
489
505
|
});
|
|
490
|
-
var QueuesSchema =
|
|
506
|
+
var QueuesSchema = z17.record(
|
|
491
507
|
ResourceIdSchema,
|
|
492
|
-
|
|
508
|
+
z17.union([
|
|
493
509
|
LocalFileSchema.transform((consumer) => ({
|
|
494
510
|
consumer
|
|
495
511
|
})).pipe(QueueSchema),
|
|
@@ -498,26 +514,26 @@ var QueuesSchema = z16.record(
|
|
|
498
514
|
).optional().describe("Define the queues in your stack.");
|
|
499
515
|
|
|
500
516
|
// src/feature/rest/schema.ts
|
|
501
|
-
import { z as
|
|
517
|
+
import { z as z19 } from "zod";
|
|
502
518
|
|
|
503
519
|
// src/config/schema/route.ts
|
|
504
|
-
import { z as
|
|
505
|
-
var RouteSchema =
|
|
506
|
-
|
|
507
|
-
|
|
520
|
+
import { z as z18 } from "zod";
|
|
521
|
+
var RouteSchema = z18.union([
|
|
522
|
+
z18.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS|ANY)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
523
|
+
z18.literal("$default")
|
|
508
524
|
]);
|
|
509
525
|
|
|
510
526
|
// src/feature/rest/schema.ts
|
|
511
|
-
var RestDefaultSchema =
|
|
527
|
+
var RestDefaultSchema = z19.record(
|
|
512
528
|
ResourceIdSchema,
|
|
513
|
-
|
|
529
|
+
z19.object({
|
|
514
530
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
515
|
-
subDomain:
|
|
531
|
+
subDomain: z19.string().optional()
|
|
516
532
|
})
|
|
517
533
|
).optional().describe("Define your global REST API's.");
|
|
518
|
-
var RestSchema =
|
|
534
|
+
var RestSchema = z19.record(
|
|
519
535
|
ResourceIdSchema,
|
|
520
|
-
|
|
536
|
+
z19.record(
|
|
521
537
|
RouteSchema.describe(
|
|
522
538
|
[
|
|
523
539
|
"The REST API route that is comprised by the http method and http path.",
|
|
@@ -531,19 +547,19 @@ var RestSchema = z18.record(
|
|
|
531
547
|
|
|
532
548
|
// src/feature/rpc/schema.ts
|
|
533
549
|
import { minutes as minutes4, seconds as seconds3 } from "@awsless/duration";
|
|
534
|
-
import { z as
|
|
550
|
+
import { z as z21 } from "zod";
|
|
535
551
|
|
|
536
552
|
// src/feature/router/schema.ts
|
|
537
553
|
import { days as days3, minutes as minutes3, parse as parse3 } from "@awsless/duration";
|
|
538
|
-
import { z as
|
|
539
|
-
var ErrorResponsePathSchema =
|
|
554
|
+
import { z as z20 } from "zod";
|
|
555
|
+
var ErrorResponsePathSchema = z20.string().describe(
|
|
540
556
|
[
|
|
541
557
|
"The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.",
|
|
542
558
|
"- We recommend that you store custom error pages in an Amazon S3 bucket.",
|
|
543
559
|
"If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable."
|
|
544
560
|
].join("\n")
|
|
545
561
|
);
|
|
546
|
-
var StatusCodeSchema =
|
|
562
|
+
var StatusCodeSchema = z20.number().int().positive().optional().describe(
|
|
547
563
|
[
|
|
548
564
|
"The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.",
|
|
549
565
|
"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:",
|
|
@@ -556,26 +572,26 @@ var StatusCodeSchema = z19.number().int().positive().optional().describe(
|
|
|
556
572
|
var MinTTLSchema = DurationSchema.describe(
|
|
557
573
|
"The minimum amount of time, that you want to cache the error response. When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available."
|
|
558
574
|
);
|
|
559
|
-
var ErrorResponseSchema =
|
|
575
|
+
var ErrorResponseSchema = z20.union([
|
|
560
576
|
ErrorResponsePathSchema,
|
|
561
|
-
|
|
577
|
+
z20.object({
|
|
562
578
|
path: ErrorResponsePathSchema,
|
|
563
579
|
statusCode: StatusCodeSchema.optional(),
|
|
564
580
|
minTTL: MinTTLSchema.optional()
|
|
565
581
|
})
|
|
566
582
|
]).optional();
|
|
567
|
-
var RouteSchema2 =
|
|
568
|
-
var VisibilitySchema =
|
|
569
|
-
var WafSettingsSchema =
|
|
570
|
-
rateLimiter:
|
|
571
|
-
limit:
|
|
583
|
+
var RouteSchema2 = z20.string().regex(/^\//, "Route must start with a slash (/)");
|
|
584
|
+
var VisibilitySchema = z20.boolean().default(false).describe("Whether to enable CloudWatch metrics for the WAF rule.");
|
|
585
|
+
var WafSettingsSchema = z20.object({
|
|
586
|
+
rateLimiter: z20.object({
|
|
587
|
+
limit: z20.number().min(10).max(2e9).default(10).describe(
|
|
572
588
|
"The limit on requests during the specified evaluation window for a single aggregation instance for the rate-based rule."
|
|
573
589
|
),
|
|
574
|
-
window:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
590
|
+
window: z20.union([
|
|
591
|
+
z20.literal("1 minute"),
|
|
592
|
+
z20.literal("2 minutes"),
|
|
593
|
+
z20.literal("5 minutes"),
|
|
594
|
+
z20.literal("10 minutes")
|
|
579
595
|
]).default("5 minutes").transform((v) => parse3(v)).describe(
|
|
580
596
|
"The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time."
|
|
581
597
|
),
|
|
@@ -583,18 +599,18 @@ var WafSettingsSchema = z19.object({
|
|
|
583
599
|
}).optional().describe(
|
|
584
600
|
"A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate."
|
|
585
601
|
),
|
|
586
|
-
ddosProtection:
|
|
587
|
-
sensitivity:
|
|
588
|
-
challenge:
|
|
589
|
-
block:
|
|
602
|
+
ddosProtection: z20.object({
|
|
603
|
+
sensitivity: z20.object({
|
|
604
|
+
challenge: z20.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for challenge requests."),
|
|
605
|
+
block: z20.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for block requests.")
|
|
590
606
|
}),
|
|
591
|
-
exemptUriRegex:
|
|
607
|
+
exemptUriRegex: z20.string().default("^$"),
|
|
592
608
|
visibility: VisibilitySchema
|
|
593
609
|
}).optional().describe(
|
|
594
610
|
"Provides protection against DDoS attacks targeting the application layer, also known as Layer 7 attacks. Uses 50 WCU."
|
|
595
611
|
),
|
|
596
|
-
botProtection:
|
|
597
|
-
inspectionLevel:
|
|
612
|
+
botProtection: z20.object({
|
|
613
|
+
inspectionLevel: z20.enum(["common", "targeted"]).default("common").transform((v) => v.toUpperCase()),
|
|
598
614
|
visibility: VisibilitySchema
|
|
599
615
|
}).optional().describe(
|
|
600
616
|
"Provides protection against automated bots that can consume excess resources, skew business metrics, cause downtime, or perform malicious activities. Bot Control provides additional visibility through Amazon CloudWatch and generates labels that you can use to control bot traffic to your applications. Uses 50 WCU."
|
|
@@ -608,14 +624,14 @@ var WafSettingsSchema = z19.object({
|
|
|
608
624
|
}).describe(
|
|
609
625
|
"WAF settings for the router. Each rule consumes Web ACL capacity units (WCUs). The total WCUs for a web ACL can't exceed 5000. Using over 1500 WCUs affects your costs."
|
|
610
626
|
);
|
|
611
|
-
var RouterDefaultSchema =
|
|
627
|
+
var RouterDefaultSchema = z20.record(
|
|
612
628
|
ResourceIdSchema,
|
|
613
|
-
|
|
629
|
+
z20.object({
|
|
614
630
|
domain: ResourceIdSchema.describe("The domain id to link your Router.").optional(),
|
|
615
|
-
subDomain:
|
|
631
|
+
subDomain: z20.string().optional(),
|
|
616
632
|
waf: WafSettingsSchema.optional(),
|
|
617
|
-
geoRestrictions:
|
|
618
|
-
errors:
|
|
633
|
+
geoRestrictions: z20.array(z20.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
|
|
634
|
+
errors: z20.object({
|
|
619
635
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
620
636
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
621
637
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -628,19 +644,22 @@ var RouterDefaultSchema = z19.record(
|
|
|
628
644
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
629
645
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
630
646
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
631
|
-
cors:
|
|
632
|
-
override:
|
|
647
|
+
cors: z20.object({
|
|
648
|
+
override: z20.boolean().default(false),
|
|
633
649
|
maxAge: DurationSchema.default("365 days"),
|
|
634
|
-
exposeHeaders:
|
|
635
|
-
credentials:
|
|
636
|
-
headers:
|
|
637
|
-
origins:
|
|
638
|
-
methods:
|
|
650
|
+
exposeHeaders: z20.string().array().optional(),
|
|
651
|
+
credentials: z20.boolean().default(false),
|
|
652
|
+
headers: z20.string().array().default(["*"]),
|
|
653
|
+
origins: z20.string().array().default(["*"]),
|
|
654
|
+
methods: z20.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
639
655
|
}).optional().describe("Specify the cors headers."),
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
656
|
+
passwordAuth: z20.object({
|
|
657
|
+
password: z20.string().describe("Password.")
|
|
658
|
+
}).optional().describe("Enable password authentication for the router."),
|
|
659
|
+
basicAuth: z20.object({
|
|
660
|
+
username: z20.string().describe("Basic auth username."),
|
|
661
|
+
password: z20.string().describe("Basic auth password.")
|
|
662
|
+
}).optional().describe("Enable basic authentication for the router."),
|
|
644
663
|
// security: z
|
|
645
664
|
// .object({
|
|
646
665
|
// contentSecurityPolicy: z.object({
|
|
@@ -686,10 +705,10 @@ var RouterDefaultSchema = z19.record(
|
|
|
686
705
|
// })
|
|
687
706
|
// .optional()
|
|
688
707
|
// .describe('Specify the security policy.'),
|
|
689
|
-
cache:
|
|
690
|
-
cookies:
|
|
691
|
-
headers:
|
|
692
|
-
queries:
|
|
708
|
+
cache: z20.object({
|
|
709
|
+
cookies: z20.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
710
|
+
headers: z20.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
711
|
+
queries: z20.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
693
712
|
}).optional().describe(
|
|
694
713
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
695
714
|
)
|
|
@@ -704,9 +723,9 @@ var TimeoutSchema2 = DurationSchema.refine(durationMin(seconds3(10)), "Minimum t
|
|
|
704
723
|
"The timeouts of all inner RPC functions will be capped at 80% of this timeout."
|
|
705
724
|
].join(" ")
|
|
706
725
|
);
|
|
707
|
-
var RpcDefaultSchema =
|
|
726
|
+
var RpcDefaultSchema = z21.record(
|
|
708
727
|
ResourceIdSchema,
|
|
709
|
-
|
|
728
|
+
z21.object({
|
|
710
729
|
// domain: ResourceIdSchema.describe('The domain id to link your RPC API with.').optional(),
|
|
711
730
|
// subDomain: z.string().optional(),
|
|
712
731
|
//
|
|
@@ -717,18 +736,18 @@ var RpcDefaultSchema = z20.record(
|
|
|
717
736
|
timeout: TimeoutSchema2.default("1 minutes")
|
|
718
737
|
})
|
|
719
738
|
).describe(`Define the global RPC API's.`).optional();
|
|
720
|
-
var RpcSchema =
|
|
739
|
+
var RpcSchema = z21.record(
|
|
721
740
|
ResourceIdSchema,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
741
|
+
z21.record(
|
|
742
|
+
z21.string(),
|
|
743
|
+
z21.union([
|
|
725
744
|
FunctionSchema.transform((f) => ({
|
|
726
745
|
function: f,
|
|
727
746
|
lock: false
|
|
728
747
|
})),
|
|
729
|
-
|
|
748
|
+
z21.object({
|
|
730
749
|
function: FunctionSchema.describe("The RPC function to execute."),
|
|
731
|
-
lock:
|
|
750
|
+
lock: z21.boolean().describe(
|
|
732
751
|
[
|
|
733
752
|
"Specify if the function should be locked on the `lockKey` returned from the auth function.",
|
|
734
753
|
"An example would be returning the user ID as `lockKey`."
|
|
@@ -742,8 +761,8 @@ var RpcSchema = z20.record(
|
|
|
742
761
|
// src/feature/instance/schema.ts
|
|
743
762
|
import { days as days4, toDays as toDays2 } from "@awsless/duration";
|
|
744
763
|
import { toMebibytes } from "@awsless/size";
|
|
745
|
-
import { z as
|
|
746
|
-
var CpuSchema =
|
|
764
|
+
import { z as z22 } from "zod";
|
|
765
|
+
var CpuSchema = z22.union([z22.literal(0.25), z22.literal(0.5), z22.literal(1), z22.literal(2), z22.literal(4), z22.literal(8), z22.literal(16)]).transform((v) => `${v} vCPU`).describe(
|
|
747
766
|
"The number of virtual CPU units (vCPU) used by the instance. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
|
|
748
767
|
);
|
|
749
768
|
var validMemorySize = [
|
|
@@ -783,10 +802,10 @@ var MemorySizeSchema2 = SizeSchema.refine(
|
|
|
783
802
|
(s) => validMemorySize.includes(toMebibytes(s)),
|
|
784
803
|
`Invalid memory size. Allowed sizes: ${validMemorySize.join(", ")} MiB`
|
|
785
804
|
).describe("The amount of memory (in MiB) used by the instance. Valid memory values depend on the CPU configuration.");
|
|
786
|
-
var HealthCheckSchema =
|
|
787
|
-
path:
|
|
805
|
+
var HealthCheckSchema = z22.object({
|
|
806
|
+
path: z22.string().describe("The path that the container runs to determine if it is healthy."),
|
|
788
807
|
interval: DurationSchema.describe("The time period in seconds between each health check execution."),
|
|
789
|
-
retries:
|
|
808
|
+
retries: z22.number().int().min(1).max(10).describe(
|
|
790
809
|
"The number of times to retry a failed health check before the container is considered unhealthy."
|
|
791
810
|
),
|
|
792
811
|
startPeriod: DurationSchema.describe(
|
|
@@ -796,22 +815,22 @@ var HealthCheckSchema = z21.object({
|
|
|
796
815
|
"The time period in seconds to wait for a health check to succeed before it is considered a failure."
|
|
797
816
|
)
|
|
798
817
|
}).describe("The health check command and associated configuration parameters for the container.");
|
|
799
|
-
var EnvironmentSchema2 =
|
|
800
|
-
var ArchitectureSchema3 =
|
|
801
|
-
var ActionSchema2 =
|
|
802
|
-
var ActionsSchema2 =
|
|
803
|
-
var ArnSchema2 =
|
|
804
|
-
var WildcardSchema2 =
|
|
805
|
-
var ResourceSchema2 =
|
|
806
|
-
var ResourcesSchema2 =
|
|
807
|
-
var PermissionSchema2 =
|
|
808
|
-
effect:
|
|
818
|
+
var EnvironmentSchema2 = z22.record(z22.string(), z22.string()).optional().describe("Environment variable key-value pairs.");
|
|
819
|
+
var ArchitectureSchema3 = z22.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
|
|
820
|
+
var ActionSchema2 = z22.string();
|
|
821
|
+
var ActionsSchema2 = z22.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
|
|
822
|
+
var ArnSchema2 = z22.string().startsWith("arn:");
|
|
823
|
+
var WildcardSchema2 = z22.literal("*");
|
|
824
|
+
var ResourceSchema2 = z22.union([ArnSchema2, WildcardSchema2]);
|
|
825
|
+
var ResourcesSchema2 = z22.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
|
|
826
|
+
var PermissionSchema2 = z22.object({
|
|
827
|
+
effect: z22.enum(["allow", "deny"]).default("allow"),
|
|
809
828
|
actions: ActionsSchema2,
|
|
810
829
|
resources: ResourcesSchema2
|
|
811
830
|
});
|
|
812
|
-
var PermissionsSchema2 =
|
|
813
|
-
var DescriptionSchema2 =
|
|
814
|
-
var ImageSchema =
|
|
831
|
+
var PermissionsSchema2 = z22.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
|
|
832
|
+
var DescriptionSchema2 = z22.string().describe("A description of the instance.");
|
|
833
|
+
var ImageSchema = z22.string().optional().describe("The URL of the container image to use.");
|
|
815
834
|
var validLogRetentionDays2 = [
|
|
816
835
|
...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
|
|
817
836
|
...[180, 365, 400, 545, 731, 1096, 1827, 2192],
|
|
@@ -826,23 +845,23 @@ var LogRetentionSchema2 = DurationSchema.refine(
|
|
|
826
845
|
},
|
|
827
846
|
`Invalid log retention. Valid days are: ${validLogRetentionDays2.map((days5) => `${days5}`).join(", ")}`
|
|
828
847
|
).describe("The log retention duration.");
|
|
829
|
-
var LogSchema2 =
|
|
830
|
-
|
|
848
|
+
var LogSchema2 = z22.union([
|
|
849
|
+
z22.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
|
|
831
850
|
LogRetentionSchema2.transform((retention) => ({ retention })),
|
|
832
|
-
|
|
851
|
+
z22.object({
|
|
833
852
|
retention: LogRetentionSchema2.optional()
|
|
834
853
|
})
|
|
835
854
|
]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
|
|
836
|
-
var FileCodeSchema2 =
|
|
855
|
+
var FileCodeSchema2 = z22.object({
|
|
837
856
|
file: LocalFileSchema.describe("The file path of the instance code.")
|
|
838
857
|
});
|
|
839
|
-
var CodeSchema2 =
|
|
858
|
+
var CodeSchema2 = z22.union([
|
|
840
859
|
LocalFileSchema.transform((file) => ({
|
|
841
860
|
file
|
|
842
861
|
})).pipe(FileCodeSchema2),
|
|
843
862
|
FileCodeSchema2
|
|
844
863
|
]).describe("Specify the code of your instance.");
|
|
845
|
-
var ISchema =
|
|
864
|
+
var ISchema = z22.object({
|
|
846
865
|
code: CodeSchema2,
|
|
847
866
|
description: DescriptionSchema2.optional(),
|
|
848
867
|
image: ImageSchema.optional(),
|
|
@@ -855,14 +874,14 @@ var ISchema = z21.object({
|
|
|
855
874
|
healthCheck: HealthCheckSchema.optional()
|
|
856
875
|
// restartPolicy: RestartPolicySchema.optional(),
|
|
857
876
|
});
|
|
858
|
-
var InstanceSchema =
|
|
877
|
+
var InstanceSchema = z22.union([
|
|
859
878
|
LocalFileSchema.transform((code) => ({
|
|
860
879
|
code
|
|
861
880
|
})).pipe(ISchema),
|
|
862
881
|
ISchema
|
|
863
882
|
]);
|
|
864
|
-
var InstancesSchema =
|
|
865
|
-
var InstanceDefaultSchema =
|
|
883
|
+
var InstancesSchema = z22.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
|
|
884
|
+
var InstanceDefaultSchema = z22.object({
|
|
866
885
|
image: ImageSchema.optional(),
|
|
867
886
|
cpu: CpuSchema.default(0.25),
|
|
868
887
|
memorySize: MemorySizeSchema2.default("512 MB"),
|
|
@@ -878,15 +897,15 @@ var InstanceDefaultSchema = z21.object({
|
|
|
878
897
|
|
|
879
898
|
// src/feature/topic/schema.ts
|
|
880
899
|
import { kebabCase as kebabCase3 } from "change-case";
|
|
881
|
-
import { z as
|
|
882
|
-
var TopicNameSchema =
|
|
883
|
-
var TopicsDefaultSchema =
|
|
900
|
+
import { z as z23 } from "zod";
|
|
901
|
+
var TopicNameSchema = z23.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
|
|
902
|
+
var TopicsDefaultSchema = z23.array(TopicNameSchema).refine((topics) => {
|
|
884
903
|
return topics.length === new Set(topics).size;
|
|
885
904
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics for your app.");
|
|
886
|
-
var SubscribersSchema =
|
|
905
|
+
var SubscribersSchema = z23.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
887
906
|
|
|
888
907
|
// src/config/schema/region.ts
|
|
889
|
-
import { z as
|
|
908
|
+
import { z as z24 } from "zod";
|
|
890
909
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
891
910
|
var AF = ["af-south-1"];
|
|
892
911
|
var AP = [
|
|
@@ -915,16 +934,16 @@ var EU = [
|
|
|
915
934
|
var ME = ["me-south-1", "me-central-1"];
|
|
916
935
|
var SA = ["sa-east-1"];
|
|
917
936
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
918
|
-
var RegionSchema =
|
|
937
|
+
var RegionSchema = z24.enum(regions);
|
|
919
938
|
|
|
920
939
|
// src/config/app.ts
|
|
921
|
-
var AppSchema =
|
|
922
|
-
$schema:
|
|
940
|
+
var AppSchema = z25.object({
|
|
941
|
+
$schema: z25.string().optional(),
|
|
923
942
|
name: ResourceIdSchema.describe("App name."),
|
|
924
943
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
925
|
-
profile:
|
|
926
|
-
protect:
|
|
927
|
-
removal:
|
|
944
|
+
profile: z25.string().describe("The AWS profile to deploy to."),
|
|
945
|
+
protect: z25.boolean().default(false).describe("Protect your app & stacks from being deleted."),
|
|
946
|
+
removal: z25.enum(["remove", "retain"]).default("remove").describe(
|
|
928
947
|
[
|
|
929
948
|
"Configure how your resources are handled when they have to be removed.",
|
|
930
949
|
"",
|
|
@@ -938,7 +957,7 @@ var AppSchema = z24.object({
|
|
|
938
957
|
// .default('prod')
|
|
939
958
|
// .describe('The deployment stage.'),
|
|
940
959
|
// onFailure: OnFailureSchema,
|
|
941
|
-
defaults:
|
|
960
|
+
defaults: z25.object({
|
|
942
961
|
onFailure: OnFailureDefaultSchema,
|
|
943
962
|
onLog: OnLogDefaultSchema,
|
|
944
963
|
auth: AuthDefaultSchema,
|
|
@@ -1215,11 +1234,11 @@ var createStagePatchJsonSchema = (baseSchema, title) => {
|
|
|
1215
1234
|
};
|
|
1216
1235
|
|
|
1217
1236
|
// src/config/stack.ts
|
|
1218
|
-
import { z as
|
|
1237
|
+
import { z as z41 } from "zod";
|
|
1219
1238
|
|
|
1220
1239
|
// src/feature/cache/schema.ts
|
|
1221
1240
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
1222
|
-
import { z as
|
|
1241
|
+
import { z as z26 } from "zod";
|
|
1223
1242
|
var StorageSchema = SizeSchema.refine(sizeMin(gibibytes2(1)), "Minimum storage size is 1 GB").refine(
|
|
1224
1243
|
sizeMax(gibibytes2(5e3)),
|
|
1225
1244
|
"Maximum storage size is 5000 GB"
|
|
@@ -1230,31 +1249,31 @@ var MinimumStorageSchema = StorageSchema.describe(
|
|
|
1230
1249
|
var MaximumStorageSchema = StorageSchema.describe(
|
|
1231
1250
|
"The upper limit for data storage the cache is set to use. You can specify a size value from 1 GB to 5000 GB."
|
|
1232
1251
|
);
|
|
1233
|
-
var EcpuSchema =
|
|
1252
|
+
var EcpuSchema = z26.number().int().min(1e3).max(15e6);
|
|
1234
1253
|
var MinimumEcpuSchema = EcpuSchema.describe(
|
|
1235
1254
|
"The minimum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1236
1255
|
);
|
|
1237
1256
|
var MaximumEcpuSchema = EcpuSchema.describe(
|
|
1238
1257
|
"The maximum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1239
1258
|
);
|
|
1240
|
-
var CachesSchema =
|
|
1259
|
+
var CachesSchema = z26.record(
|
|
1241
1260
|
ResourceIdSchema,
|
|
1242
|
-
|
|
1261
|
+
z26.object({
|
|
1243
1262
|
minStorage: MinimumStorageSchema.optional(),
|
|
1244
1263
|
maxStorage: MaximumStorageSchema.optional(),
|
|
1245
1264
|
minECPU: MinimumEcpuSchema.optional(),
|
|
1246
1265
|
maxECPU: MaximumEcpuSchema.optional(),
|
|
1247
|
-
snapshotRetentionLimit:
|
|
1266
|
+
snapshotRetentionLimit: z26.number().int().positive().default(1)
|
|
1248
1267
|
})
|
|
1249
1268
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
1250
1269
|
|
|
1251
1270
|
// src/feature/command/schema.ts
|
|
1252
|
-
import { z as
|
|
1253
|
-
var CommandSchema =
|
|
1254
|
-
|
|
1271
|
+
import { z as z27 } from "zod";
|
|
1272
|
+
var CommandSchema = z27.union([
|
|
1273
|
+
z27.object({
|
|
1255
1274
|
file: LocalFileSchema,
|
|
1256
|
-
handler:
|
|
1257
|
-
description:
|
|
1275
|
+
handler: z27.string().default("default").describe("The name of the handler that needs to run"),
|
|
1276
|
+
description: z27.string().optional().describe("A description of the command")
|
|
1258
1277
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
1259
1278
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
1260
1279
|
}),
|
|
@@ -1264,22 +1283,22 @@ var CommandSchema = z26.union([
|
|
|
1264
1283
|
description: void 0
|
|
1265
1284
|
}))
|
|
1266
1285
|
]);
|
|
1267
|
-
var CommandsSchema =
|
|
1286
|
+
var CommandsSchema = z27.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
1268
1287
|
|
|
1269
1288
|
// src/feature/config/schema.ts
|
|
1270
|
-
import { z as
|
|
1271
|
-
var ConfigNameSchema =
|
|
1272
|
-
var ConfigsSchema =
|
|
1289
|
+
import { z as z28 } from "zod";
|
|
1290
|
+
var ConfigNameSchema = z28.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
1291
|
+
var ConfigsSchema = z28.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
1273
1292
|
|
|
1274
1293
|
// src/feature/cron/schema/index.ts
|
|
1275
|
-
import { z as
|
|
1294
|
+
import { z as z30 } from "zod";
|
|
1276
1295
|
|
|
1277
1296
|
// src/feature/cron/schema/schedule.ts
|
|
1278
|
-
import { z as
|
|
1297
|
+
import { z as z29 } from "zod";
|
|
1279
1298
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
1280
|
-
var RateExpressionSchema =
|
|
1299
|
+
var RateExpressionSchema = z29.custom(
|
|
1281
1300
|
(value) => {
|
|
1282
|
-
return
|
|
1301
|
+
return z29.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
1283
1302
|
const [str] = rate.split(" ");
|
|
1284
1303
|
const number = parseInt(str);
|
|
1285
1304
|
return number > 0;
|
|
@@ -1295,9 +1314,9 @@ var RateExpressionSchema = z28.custom(
|
|
|
1295
1314
|
}
|
|
1296
1315
|
return `rate(${rate})`;
|
|
1297
1316
|
});
|
|
1298
|
-
var CronExpressionSchema =
|
|
1317
|
+
var CronExpressionSchema = z29.custom(
|
|
1299
1318
|
(value) => {
|
|
1300
|
-
return
|
|
1319
|
+
return z29.string().safeParse(value).success;
|
|
1301
1320
|
},
|
|
1302
1321
|
{ message: "Invalid cron expression" }
|
|
1303
1322
|
).superRefine((value, ctx) => {
|
|
@@ -1306,12 +1325,12 @@ var CronExpressionSchema = z28.custom(
|
|
|
1306
1325
|
} catch (error) {
|
|
1307
1326
|
if (error instanceof Error) {
|
|
1308
1327
|
ctx.addIssue({
|
|
1309
|
-
code:
|
|
1328
|
+
code: z29.ZodIssueCode.custom,
|
|
1310
1329
|
message: `Invalid cron expression: ${error.message}`
|
|
1311
1330
|
});
|
|
1312
1331
|
} else {
|
|
1313
1332
|
ctx.addIssue({
|
|
1314
|
-
code:
|
|
1333
|
+
code: z29.ZodIssueCode.custom,
|
|
1315
1334
|
message: "Invalid cron expression"
|
|
1316
1335
|
});
|
|
1317
1336
|
}
|
|
@@ -1322,28 +1341,28 @@ var CronExpressionSchema = z28.custom(
|
|
|
1322
1341
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
1323
1342
|
|
|
1324
1343
|
// src/feature/cron/schema/index.ts
|
|
1325
|
-
var CronsSchema =
|
|
1344
|
+
var CronsSchema = z30.record(
|
|
1326
1345
|
ResourceIdSchema,
|
|
1327
|
-
|
|
1328
|
-
enabled:
|
|
1346
|
+
z30.object({
|
|
1347
|
+
enabled: z30.boolean().default(true).describe("If the cron is enabled."),
|
|
1329
1348
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
1330
1349
|
schedule: ScheduleExpressionSchema.describe(
|
|
1331
1350
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
1332
1351
|
),
|
|
1333
|
-
payload:
|
|
1352
|
+
payload: z30.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
1334
1353
|
})
|
|
1335
1354
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
1336
1355
|
|
|
1337
1356
|
// src/feature/search/schema.ts
|
|
1338
1357
|
import { gibibytes as gibibytes3 } from "@awsless/size";
|
|
1339
|
-
import { z as
|
|
1340
|
-
var VersionSchema =
|
|
1358
|
+
import { z as z31 } from "zod";
|
|
1359
|
+
var VersionSchema = z31.union([
|
|
1341
1360
|
//
|
|
1342
|
-
|
|
1343
|
-
|
|
1361
|
+
z31.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
|
|
1362
|
+
z31.string()
|
|
1344
1363
|
]).describe("Specify the OpenSearch engine version.");
|
|
1345
|
-
var TypeSchema =
|
|
1346
|
-
|
|
1364
|
+
var TypeSchema = z31.union([
|
|
1365
|
+
z31.enum([
|
|
1347
1366
|
"t3.small",
|
|
1348
1367
|
"t3.medium",
|
|
1349
1368
|
"m3.medium",
|
|
@@ -1417,13 +1436,13 @@ var TypeSchema = z30.union([
|
|
|
1417
1436
|
"r6gd.12xlarge",
|
|
1418
1437
|
"r6gd.16xlarge"
|
|
1419
1438
|
]),
|
|
1420
|
-
|
|
1439
|
+
z31.string()
|
|
1421
1440
|
]).describe("Instance type of data nodes in the cluster.");
|
|
1422
|
-
var CountSchema =
|
|
1441
|
+
var CountSchema = z31.number().int().min(1).describe("Number of instances in the cluster.");
|
|
1423
1442
|
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.");
|
|
1424
|
-
var SearchsSchema =
|
|
1443
|
+
var SearchsSchema = z31.record(
|
|
1425
1444
|
ResourceIdSchema,
|
|
1426
|
-
|
|
1445
|
+
z31.object({
|
|
1427
1446
|
type: TypeSchema.default("t3.small"),
|
|
1428
1447
|
count: CountSchema.default(1),
|
|
1429
1448
|
version: VersionSchema.default("2.13"),
|
|
@@ -1434,12 +1453,12 @@ var SearchsSchema = z30.record(
|
|
|
1434
1453
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
1435
1454
|
|
|
1436
1455
|
// src/feature/site/schema.ts
|
|
1437
|
-
import { z as
|
|
1456
|
+
import { z as z33 } from "zod";
|
|
1438
1457
|
|
|
1439
1458
|
// src/config/schema/local-entry.ts
|
|
1440
1459
|
import { stat as stat3 } from "fs/promises";
|
|
1441
|
-
import { z as
|
|
1442
|
-
var LocalEntrySchema =
|
|
1460
|
+
import { z as z32 } from "zod";
|
|
1461
|
+
var LocalEntrySchema = z32.union([
|
|
1443
1462
|
RelativePathSchema.refine(async (path) => {
|
|
1444
1463
|
try {
|
|
1445
1464
|
const s = await stat3(path);
|
|
@@ -1448,7 +1467,7 @@ var LocalEntrySchema = z31.union([
|
|
|
1448
1467
|
return false;
|
|
1449
1468
|
}
|
|
1450
1469
|
}, `File or directory doesn't exist`),
|
|
1451
|
-
|
|
1470
|
+
z32.object({
|
|
1452
1471
|
nocheck: RelativePathSchema.describe(
|
|
1453
1472
|
"Specifies a local file or directory without checking if the file or directory exists."
|
|
1454
1473
|
)
|
|
@@ -1456,21 +1475,21 @@ var LocalEntrySchema = z31.union([
|
|
|
1456
1475
|
]);
|
|
1457
1476
|
|
|
1458
1477
|
// src/feature/site/schema.ts
|
|
1459
|
-
var SitesSchema =
|
|
1478
|
+
var SitesSchema = z33.record(
|
|
1460
1479
|
ResourceIdSchema,
|
|
1461
|
-
|
|
1480
|
+
z33.object({
|
|
1462
1481
|
router: ResourceIdSchema.describe("The router id to link your site with."),
|
|
1463
1482
|
path: RouteSchema2.describe("The path inside the router to link your site to."),
|
|
1464
|
-
build:
|
|
1465
|
-
command:
|
|
1483
|
+
build: z33.object({
|
|
1484
|
+
command: z33.string().describe(
|
|
1466
1485
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1467
1486
|
),
|
|
1468
|
-
cacheKey:
|
|
1487
|
+
cacheKey: z33.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
|
|
1469
1488
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1470
1489
|
),
|
|
1471
|
-
configs:
|
|
1490
|
+
configs: z33.string().array().optional().describe("Define the config values for your build command.")
|
|
1472
1491
|
}).optional().describe(`Specifies the build process for sites that need a build step.`),
|
|
1473
|
-
static:
|
|
1492
|
+
static: z33.union([LocalDirectorySchema, z33.boolean()]).optional().describe(
|
|
1474
1493
|
"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."
|
|
1475
1494
|
),
|
|
1476
1495
|
ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server.")
|
|
@@ -1478,21 +1497,21 @@ var SitesSchema = z32.record(
|
|
|
1478
1497
|
).optional().describe("Define the sites in your stack.");
|
|
1479
1498
|
|
|
1480
1499
|
// src/feature/store/schema.ts
|
|
1481
|
-
import { z as
|
|
1482
|
-
var StoresSchema =
|
|
1483
|
-
|
|
1500
|
+
import { z as z34 } from "zod";
|
|
1501
|
+
var StoresSchema = z34.union([
|
|
1502
|
+
z34.array(ResourceIdSchema).transform((list) => {
|
|
1484
1503
|
const stores = {};
|
|
1485
1504
|
for (const key of list) {
|
|
1486
1505
|
stores[key] = {};
|
|
1487
1506
|
}
|
|
1488
1507
|
return stores;
|
|
1489
1508
|
}),
|
|
1490
|
-
|
|
1509
|
+
z34.record(
|
|
1491
1510
|
ResourceIdSchema,
|
|
1492
|
-
|
|
1511
|
+
z34.object({
|
|
1493
1512
|
static: LocalDirectorySchema.optional().describe("Specifies the path to the static files directory."),
|
|
1494
|
-
versioning:
|
|
1495
|
-
events:
|
|
1513
|
+
versioning: z34.boolean().default(false).describe("Enable versioning of your store."),
|
|
1514
|
+
events: z34.object({
|
|
1496
1515
|
// create
|
|
1497
1516
|
"created:*": FunctionSchema.optional().describe(
|
|
1498
1517
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
@@ -1525,30 +1544,30 @@ var StoresSchema = z33.union([
|
|
|
1525
1544
|
]).optional().describe("Define the stores in your stack.");
|
|
1526
1545
|
|
|
1527
1546
|
// src/feature/icon/schema.ts
|
|
1528
|
-
import { z as
|
|
1547
|
+
import { z as z35 } from "zod";
|
|
1529
1548
|
var staticOriginSchema = LocalDirectorySchema.describe(
|
|
1530
1549
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
1531
1550
|
);
|
|
1532
1551
|
var functionOriginSchema = FunctionSchema.describe(
|
|
1533
1552
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1534
1553
|
);
|
|
1535
|
-
var IconsSchema =
|
|
1554
|
+
var IconsSchema = z35.record(
|
|
1536
1555
|
ResourceIdSchema,
|
|
1537
|
-
|
|
1556
|
+
z35.object({
|
|
1538
1557
|
// domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
|
|
1539
1558
|
// subDomain: z.string().optional(),
|
|
1540
1559
|
router: ResourceIdSchema.describe("The router id to link your icon proxy."),
|
|
1541
1560
|
path: RouteSchema2.describe("The path inside the router to link your icon proxy to."),
|
|
1542
1561
|
log: LogSchema.optional(),
|
|
1543
1562
|
cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
|
|
1544
|
-
preserveIds:
|
|
1545
|
-
symbols:
|
|
1546
|
-
origin:
|
|
1547
|
-
|
|
1563
|
+
preserveIds: z35.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
|
|
1564
|
+
symbols: z35.boolean().optional().default(false).describe(`Convert the SVG's to SVG symbols.`),
|
|
1565
|
+
origin: z35.union([
|
|
1566
|
+
z35.object({
|
|
1548
1567
|
static: staticOriginSchema,
|
|
1549
1568
|
function: functionOriginSchema.optional()
|
|
1550
1569
|
}),
|
|
1551
|
-
|
|
1570
|
+
z35.object({
|
|
1552
1571
|
static: staticOriginSchema.optional(),
|
|
1553
1572
|
function: functionOriginSchema
|
|
1554
1573
|
})
|
|
@@ -1575,13 +1594,13 @@ var IconsSchema = z34.record(
|
|
|
1575
1594
|
).optional().describe("Define an svg icon proxy in your stack. Store, optimize, and deliver svg icons at scale.");
|
|
1576
1595
|
|
|
1577
1596
|
// src/feature/image/schema.ts
|
|
1578
|
-
import { z as
|
|
1579
|
-
var transformationOptionsSchema =
|
|
1580
|
-
width:
|
|
1581
|
-
height:
|
|
1582
|
-
fit:
|
|
1583
|
-
position:
|
|
1584
|
-
quality:
|
|
1597
|
+
import { z as z36 } from "zod";
|
|
1598
|
+
var transformationOptionsSchema = z36.object({
|
|
1599
|
+
width: z36.number().int().positive().optional(),
|
|
1600
|
+
height: z36.number().int().positive().optional(),
|
|
1601
|
+
fit: z36.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
|
|
1602
|
+
position: z36.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
|
|
1603
|
+
quality: z36.number().int().min(1).max(100).optional()
|
|
1585
1604
|
});
|
|
1586
1605
|
var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
1587
1606
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
@@ -1589,38 +1608,38 @@ var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
|
1589
1608
|
var functionOriginSchema2 = FunctionSchema.describe(
|
|
1590
1609
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1591
1610
|
);
|
|
1592
|
-
var ImagesSchema =
|
|
1611
|
+
var ImagesSchema = z36.record(
|
|
1593
1612
|
ResourceIdSchema,
|
|
1594
|
-
|
|
1613
|
+
z36.object({
|
|
1595
1614
|
// domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
|
|
1596
1615
|
// subDomain: z.string().optional(),
|
|
1597
1616
|
router: ResourceIdSchema.describe("The router id to link your image proxy."),
|
|
1598
1617
|
path: RouteSchema2.describe("The path inside the router to link your image proxy to."),
|
|
1599
1618
|
log: LogSchema.optional(),
|
|
1600
1619
|
cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
|
|
1601
|
-
presets:
|
|
1602
|
-
extensions:
|
|
1603
|
-
jpg:
|
|
1604
|
-
mozjpeg:
|
|
1605
|
-
progressive:
|
|
1620
|
+
presets: z36.record(z36.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
|
|
1621
|
+
extensions: z36.object({
|
|
1622
|
+
jpg: z36.object({
|
|
1623
|
+
mozjpeg: z36.boolean().optional(),
|
|
1624
|
+
progressive: z36.boolean().optional()
|
|
1606
1625
|
}).optional(),
|
|
1607
|
-
webp:
|
|
1608
|
-
effort:
|
|
1609
|
-
lossless:
|
|
1610
|
-
nearLossless:
|
|
1626
|
+
webp: z36.object({
|
|
1627
|
+
effort: z36.number().int().min(1).max(10).default(7).optional(),
|
|
1628
|
+
lossless: z36.boolean().optional(),
|
|
1629
|
+
nearLossless: z36.boolean().optional()
|
|
1611
1630
|
}).optional(),
|
|
1612
|
-
png:
|
|
1613
|
-
compressionLevel:
|
|
1631
|
+
png: z36.object({
|
|
1632
|
+
compressionLevel: z36.number().int().min(0).max(9).default(6).optional()
|
|
1614
1633
|
}).optional()
|
|
1615
1634
|
}).refine((data) => {
|
|
1616
1635
|
return Object.keys(data).length > 0;
|
|
1617
1636
|
}, "At least one extension must be defined.").describe("Specify the allowed extensions."),
|
|
1618
|
-
origin:
|
|
1619
|
-
|
|
1637
|
+
origin: z36.union([
|
|
1638
|
+
z36.object({
|
|
1620
1639
|
static: staticOriginSchema2,
|
|
1621
1640
|
function: functionOriginSchema2.optional()
|
|
1622
1641
|
}),
|
|
1623
|
-
|
|
1642
|
+
z36.object({
|
|
1624
1643
|
static: staticOriginSchema2.optional(),
|
|
1625
1644
|
function: functionOriginSchema2
|
|
1626
1645
|
})
|
|
@@ -1635,7 +1654,7 @@ var ImagesSchema = z35.record(
|
|
|
1635
1654
|
).optional().describe("Define an image proxy in your stack. Store, transform, optimize, and deliver images at scale.");
|
|
1636
1655
|
|
|
1637
1656
|
// src/feature/metric/schema.ts
|
|
1638
|
-
import { z as
|
|
1657
|
+
import { z as z37 } from "zod";
|
|
1639
1658
|
var ops = {
|
|
1640
1659
|
">": "GreaterThanThreshold",
|
|
1641
1660
|
">=": "GreaterThanOrEqualToThreshold",
|
|
@@ -1649,15 +1668,15 @@ var stats = {
|
|
|
1649
1668
|
min: "Minimum",
|
|
1650
1669
|
max: "Maximum"
|
|
1651
1670
|
};
|
|
1652
|
-
var WhereSchema =
|
|
1653
|
-
|
|
1671
|
+
var WhereSchema = z37.union([
|
|
1672
|
+
z37.string().regex(/(count|avg|sum|min|max) (>|>=|<|<=) (\d)/, "Invalid where query").transform((where) => {
|
|
1654
1673
|
const [stat4, op, value] = where.split(" ");
|
|
1655
1674
|
return { stat: stat4, op, value: parseFloat(value) };
|
|
1656
1675
|
}),
|
|
1657
|
-
|
|
1658
|
-
stat:
|
|
1659
|
-
op:
|
|
1660
|
-
value:
|
|
1676
|
+
z37.object({
|
|
1677
|
+
stat: z37.enum(["count", "avg", "sum", "min", "max"]),
|
|
1678
|
+
op: z37.enum([">", ">=", "<", "<="]),
|
|
1679
|
+
value: z37.number()
|
|
1661
1680
|
})
|
|
1662
1681
|
]).transform((where) => {
|
|
1663
1682
|
return {
|
|
@@ -1666,39 +1685,39 @@ var WhereSchema = z36.union([
|
|
|
1666
1685
|
value: where.value
|
|
1667
1686
|
};
|
|
1668
1687
|
});
|
|
1669
|
-
var AlarmSchema =
|
|
1670
|
-
description:
|
|
1688
|
+
var AlarmSchema = z37.object({
|
|
1689
|
+
description: z37.string().optional(),
|
|
1671
1690
|
where: WhereSchema,
|
|
1672
1691
|
period: DurationSchema,
|
|
1673
|
-
minDataPoints:
|
|
1674
|
-
trigger:
|
|
1692
|
+
minDataPoints: z37.number().int().default(1),
|
|
1693
|
+
trigger: z37.union([EmailSchema.transform((v) => [v]), EmailSchema.array(), FunctionSchema])
|
|
1675
1694
|
});
|
|
1676
|
-
var MetricsSchema =
|
|
1695
|
+
var MetricsSchema = z37.record(
|
|
1677
1696
|
ResourceIdSchema,
|
|
1678
|
-
|
|
1679
|
-
type:
|
|
1697
|
+
z37.object({
|
|
1698
|
+
type: z37.enum(["number", "size", "duration"]),
|
|
1680
1699
|
alarms: AlarmSchema.array().optional()
|
|
1681
1700
|
})
|
|
1682
1701
|
).optional().describe("Define the metrics in your stack.");
|
|
1683
1702
|
|
|
1684
1703
|
// src/feature/table/schema.ts
|
|
1685
1704
|
import { minutes as minutes5, seconds as seconds4 } from "@awsless/duration";
|
|
1686
|
-
import { z as
|
|
1687
|
-
var KeySchema =
|
|
1688
|
-
var TablesSchema =
|
|
1705
|
+
import { z as z38 } from "zod";
|
|
1706
|
+
var KeySchema = z38.string().min(1).max(255);
|
|
1707
|
+
var TablesSchema = z38.record(
|
|
1689
1708
|
ResourceIdSchema,
|
|
1690
|
-
|
|
1709
|
+
z38.object({
|
|
1691
1710
|
hash: KeySchema.describe(
|
|
1692
1711
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
1693
1712
|
),
|
|
1694
1713
|
sort: KeySchema.optional().describe(
|
|
1695
1714
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
1696
1715
|
),
|
|
1697
|
-
fields:
|
|
1716
|
+
fields: z38.record(z38.string(), z38.enum(["string", "number", "binary"])).optional().describe(
|
|
1698
1717
|
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
1699
1718
|
),
|
|
1700
|
-
class:
|
|
1701
|
-
pointInTimeRecovery:
|
|
1719
|
+
class: z38.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
1720
|
+
pointInTimeRecovery: z38.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
1702
1721
|
ttl: KeySchema.optional().describe(
|
|
1703
1722
|
[
|
|
1704
1723
|
"The name of the TTL attribute used to store the expiration time for items in the table.",
|
|
@@ -1706,8 +1725,8 @@ var TablesSchema = z37.record(
|
|
|
1706
1725
|
].join("\n")
|
|
1707
1726
|
),
|
|
1708
1727
|
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
1709
|
-
stream:
|
|
1710
|
-
type:
|
|
1728
|
+
stream: z38.object({
|
|
1729
|
+
type: z38.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
1711
1730
|
[
|
|
1712
1731
|
"When an item in the table is modified, you can determines what information is written to the stream for this table.",
|
|
1713
1732
|
"Valid values are:",
|
|
@@ -1717,7 +1736,7 @@ var TablesSchema = z37.record(
|
|
|
1717
1736
|
"- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
1718
1737
|
].join("\n")
|
|
1719
1738
|
),
|
|
1720
|
-
batchSize:
|
|
1739
|
+
batchSize: z38.number().min(1).max(1e4).default(1).describe(
|
|
1721
1740
|
[
|
|
1722
1741
|
"The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
|
|
1723
1742
|
"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).",
|
|
@@ -1733,29 +1752,26 @@ var TablesSchema = z37.record(
|
|
|
1733
1752
|
"You can specify a duration from 1 seconds to 5 minutes."
|
|
1734
1753
|
].join("\n")
|
|
1735
1754
|
),
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
// 'You can specify a number from -1 to 10000.',
|
|
1748
|
-
// ].join('\n')
|
|
1749
|
-
// ),
|
|
1750
|
-
retryAttempts: z37.number().min(-1).max(1e4).default(-1).describe(
|
|
1755
|
+
maxRecordAge: DurationSchema.refine(
|
|
1756
|
+
durationMin(seconds4(1)),
|
|
1757
|
+
"Minimum record age duration is 1 second"
|
|
1758
|
+
).refine(durationMax(minutes5(1)), "Maximum record age duration is 1 minute").default("60 seconds").describe(
|
|
1759
|
+
[
|
|
1760
|
+
"Discard records older than the specified age.",
|
|
1761
|
+
"The maximum valid value for maximum record age is 60s.",
|
|
1762
|
+
"The default value is 60s"
|
|
1763
|
+
].join("\n")
|
|
1764
|
+
),
|
|
1765
|
+
retryAttempts: z38.number().min(-1).max(1e4).default(2).describe(
|
|
1751
1766
|
[
|
|
1752
1767
|
"Discard records after the specified number of retries.",
|
|
1753
|
-
"
|
|
1768
|
+
"-1 will sets the maximum number of retries to infinite.",
|
|
1754
1769
|
"When maxRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.",
|
|
1755
|
-
"You can specify a number from -1 to 10000."
|
|
1770
|
+
"You can specify a number from -1 to 10000.",
|
|
1771
|
+
"The default value is 2"
|
|
1756
1772
|
].join("\n")
|
|
1757
1773
|
),
|
|
1758
|
-
concurrencyPerShard:
|
|
1774
|
+
concurrencyPerShard: z38.number().min(1).max(10).default(1).describe(
|
|
1759
1775
|
[
|
|
1760
1776
|
"The number of batches to process concurrently from each shard.",
|
|
1761
1777
|
"You can specify a number from 1 to 10."
|
|
@@ -1765,16 +1781,16 @@ var TablesSchema = z37.record(
|
|
|
1765
1781
|
}).optional().describe(
|
|
1766
1782
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
1767
1783
|
),
|
|
1768
|
-
indexes:
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
hash:
|
|
1784
|
+
indexes: z38.record(
|
|
1785
|
+
z38.string(),
|
|
1786
|
+
z38.object({
|
|
1787
|
+
hash: z38.union([KeySchema.transform((v) => [v]), KeySchema.array()]).describe(
|
|
1772
1788
|
"Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
|
|
1773
1789
|
),
|
|
1774
|
-
sort:
|
|
1790
|
+
sort: z38.union([KeySchema.transform((v) => [v]), KeySchema.array()]).optional().describe(
|
|
1775
1791
|
"Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
|
|
1776
1792
|
),
|
|
1777
|
-
projection:
|
|
1793
|
+
projection: z38.enum(["all", "keys-only"]).default("all").describe(
|
|
1778
1794
|
[
|
|
1779
1795
|
"The set of attributes that are projected into the index:",
|
|
1780
1796
|
"- all - All of the table attributes are projected into the index.",
|
|
@@ -1788,11 +1804,11 @@ var TablesSchema = z37.record(
|
|
|
1788
1804
|
).optional().describe("Define the tables in your stack.");
|
|
1789
1805
|
|
|
1790
1806
|
// src/feature/task/schema.ts
|
|
1791
|
-
import { z as
|
|
1792
|
-
var
|
|
1807
|
+
import { z as z39 } from "zod";
|
|
1808
|
+
var RetryAttemptsSchema3 = z39.number().int().min(0).max(2).describe(
|
|
1793
1809
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1794
1810
|
);
|
|
1795
|
-
var TaskSchema =
|
|
1811
|
+
var TaskSchema = z39.union([
|
|
1796
1812
|
LocalFileSchema.transform((file) => ({
|
|
1797
1813
|
consumer: {
|
|
1798
1814
|
code: {
|
|
@@ -1803,20 +1819,20 @@ var TaskSchema = z38.union([
|
|
|
1803
1819
|
},
|
|
1804
1820
|
retryAttempts: void 0
|
|
1805
1821
|
})),
|
|
1806
|
-
|
|
1822
|
+
z39.object({
|
|
1807
1823
|
consumer: FunctionSchema,
|
|
1808
|
-
retryAttempts:
|
|
1824
|
+
retryAttempts: RetryAttemptsSchema3.optional()
|
|
1809
1825
|
})
|
|
1810
1826
|
]);
|
|
1811
|
-
var TasksSchema =
|
|
1827
|
+
var TasksSchema = z39.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1812
1828
|
|
|
1813
1829
|
// src/feature/test/schema.ts
|
|
1814
|
-
import { z as
|
|
1815
|
-
var TestsSchema =
|
|
1830
|
+
import { z as z40 } from "zod";
|
|
1831
|
+
var TestsSchema = z40.union([
|
|
1816
1832
|
//
|
|
1817
1833
|
LocalDirectorySchema.transform((v) => [v]),
|
|
1818
1834
|
LocalDirectorySchema.array(),
|
|
1819
|
-
|
|
1835
|
+
z40.literal(false)
|
|
1820
1836
|
]).describe("Define the location of your tests for your stack.").optional();
|
|
1821
1837
|
|
|
1822
1838
|
// src/config/stack.ts
|
|
@@ -1824,8 +1840,8 @@ var DependsSchema = ResourceIdSchema.array().optional().describe("Define the sta
|
|
|
1824
1840
|
var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
|
|
1825
1841
|
message: `Stack name can't be a reserved name.`
|
|
1826
1842
|
}).describe("Stack name.");
|
|
1827
|
-
var StackSchema =
|
|
1828
|
-
$schema:
|
|
1843
|
+
var StackSchema = z41.object({
|
|
1844
|
+
$schema: z41.string().optional(),
|
|
1829
1845
|
name: NameSchema,
|
|
1830
1846
|
depends: DependsSchema,
|
|
1831
1847
|
commands: CommandsSchema,
|