@awsless/awsless 0.0.659 → 0.0.660
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 +131 -133
- package/dist/build-json-schema.js +131 -133
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/on-error-log/bundle.zip +0 -0
- package/dist/prebuild/on-failure/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/package.json +12 -12
|
@@ -362,24 +362,41 @@ var LayerSchema = z13.record(
|
|
|
362
362
|
])
|
|
363
363
|
).optional().describe("Define the lambda layers in your stack.");
|
|
364
364
|
|
|
365
|
+
// src/feature/task/schema.ts
|
|
366
|
+
import { z as z14 } from "zod";
|
|
367
|
+
var RetryAttemptsSchema = z14.number().int().min(0).max(2).describe(
|
|
368
|
+
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
369
|
+
);
|
|
370
|
+
var TaskSchema = z14.union([
|
|
371
|
+
FunctionSchema.transform((consumer) => ({
|
|
372
|
+
consumer,
|
|
373
|
+
retryAttempts: 2
|
|
374
|
+
})),
|
|
375
|
+
z14.object({
|
|
376
|
+
consumer: FunctionSchema,
|
|
377
|
+
retryAttempts: RetryAttemptsSchema.default(2)
|
|
378
|
+
})
|
|
379
|
+
]);
|
|
380
|
+
var TasksSchema = z14.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
381
|
+
|
|
365
382
|
// src/feature/on-error-log/schema.ts
|
|
366
|
-
var OnErrorLogDefaultSchema =
|
|
383
|
+
var OnErrorLogDefaultSchema = TaskSchema.optional().describe(
|
|
367
384
|
"Define a subscription on all Lambda functions logs."
|
|
368
385
|
);
|
|
369
386
|
|
|
370
387
|
// src/feature/on-failure/schema.ts
|
|
371
|
-
import { z as
|
|
372
|
-
var NotifySchema =
|
|
388
|
+
import { z as z15 } from "zod";
|
|
389
|
+
var NotifySchema = z15.union([
|
|
373
390
|
//
|
|
374
391
|
EmailSchema.transform((v) => [v]),
|
|
375
392
|
EmailSchema.array()
|
|
376
393
|
]).describe("Receive an email notification when consuming failure entries goes wrong.");
|
|
377
|
-
var OnFailureDefaultSchema =
|
|
394
|
+
var OnFailureDefaultSchema = z15.union([
|
|
378
395
|
FunctionSchema.transform((consumer) => ({
|
|
379
396
|
consumer,
|
|
380
397
|
notify: []
|
|
381
398
|
})),
|
|
382
|
-
|
|
399
|
+
z15.object({
|
|
383
400
|
consumer: FunctionSchema,
|
|
384
401
|
notify: NotifySchema.optional()
|
|
385
402
|
})
|
|
@@ -396,14 +413,14 @@ var OnFailureDefaultSchema = z14.union([
|
|
|
396
413
|
);
|
|
397
414
|
|
|
398
415
|
// src/feature/pubsub/schema.ts
|
|
399
|
-
import { z as
|
|
416
|
+
import { z as z16 } from "zod";
|
|
400
417
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
401
|
-
var PubSubDefaultSchema =
|
|
418
|
+
var PubSubDefaultSchema = z16.record(
|
|
402
419
|
ResourceIdSchema,
|
|
403
|
-
|
|
420
|
+
z16.object({
|
|
404
421
|
auth: FunctionSchema,
|
|
405
422
|
domain: DomainSchema.optional(),
|
|
406
|
-
subDomain:
|
|
423
|
+
subDomain: z16.string().optional()
|
|
407
424
|
// auth: z.union([
|
|
408
425
|
// ResourceIdSchema,
|
|
409
426
|
// z.object({
|
|
@@ -419,23 +436,23 @@ var PubSubDefaultSchema = z15.record(
|
|
|
419
436
|
// .optional(),
|
|
420
437
|
})
|
|
421
438
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
422
|
-
var
|
|
439
|
+
var RetryAttemptsSchema2 = z16.number().int().min(0).max(2).describe(
|
|
423
440
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
424
441
|
);
|
|
425
|
-
var PubSubSchema =
|
|
442
|
+
var PubSubSchema = z16.record(
|
|
426
443
|
ResourceIdSchema,
|
|
427
|
-
|
|
428
|
-
sql:
|
|
429
|
-
sqlVersion:
|
|
444
|
+
z16.object({
|
|
445
|
+
sql: z16.string().describe("The SQL statement used to query the IOT topic."),
|
|
446
|
+
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."),
|
|
430
447
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
431
|
-
retryAttempts:
|
|
448
|
+
retryAttempts: RetryAttemptsSchema2.default(2)
|
|
432
449
|
})
|
|
433
450
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
434
451
|
|
|
435
452
|
// src/feature/queue/schema.ts
|
|
436
453
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
437
454
|
import { kibibytes } from "@awsless/size";
|
|
438
|
-
import { z as
|
|
455
|
+
import { z as z17 } from "zod";
|
|
439
456
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
440
457
|
durationMin(minutes2(1)),
|
|
441
458
|
"Minimum retention period is 1 minute"
|
|
@@ -463,10 +480,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
463
480
|
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(
|
|
464
481
|
"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."
|
|
465
482
|
);
|
|
466
|
-
var BatchSizeSchema =
|
|
483
|
+
var BatchSizeSchema = z17.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
467
484
|
"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."
|
|
468
485
|
);
|
|
469
|
-
var MaxConcurrencySchema =
|
|
486
|
+
var MaxConcurrencySchema = z17.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
470
487
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
471
488
|
);
|
|
472
489
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -475,10 +492,10 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
475
492
|
).describe(
|
|
476
493
|
"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."
|
|
477
494
|
);
|
|
478
|
-
var
|
|
495
|
+
var RetryAttemptsSchema3 = z17.number().int().min(0).max(999).describe(
|
|
479
496
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 999."
|
|
480
497
|
);
|
|
481
|
-
var QueueDefaultSchema =
|
|
498
|
+
var QueueDefaultSchema = z17.object({
|
|
482
499
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
483
500
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
484
501
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -487,9 +504,9 @@ var QueueDefaultSchema = z16.object({
|
|
|
487
504
|
batchSize: BatchSizeSchema.default(10),
|
|
488
505
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
489
506
|
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
490
|
-
retryAttempts:
|
|
507
|
+
retryAttempts: RetryAttemptsSchema3.default(2)
|
|
491
508
|
}).default({});
|
|
492
|
-
var QueueSchema =
|
|
509
|
+
var QueueSchema = z17.object({
|
|
493
510
|
consumer: FunctionSchema.optional().describe("The consuming lambda function properties."),
|
|
494
511
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
495
512
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
@@ -499,11 +516,11 @@ var QueueSchema = z16.object({
|
|
|
499
516
|
batchSize: BatchSizeSchema.optional(),
|
|
500
517
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
501
518
|
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
502
|
-
retryAttempts:
|
|
519
|
+
retryAttempts: RetryAttemptsSchema3.optional()
|
|
503
520
|
});
|
|
504
|
-
var QueuesSchema =
|
|
521
|
+
var QueuesSchema = z17.record(
|
|
505
522
|
ResourceIdSchema,
|
|
506
|
-
|
|
523
|
+
z17.union([
|
|
507
524
|
LocalFileSchema.transform((consumer) => ({
|
|
508
525
|
consumer
|
|
509
526
|
})).pipe(QueueSchema),
|
|
@@ -512,26 +529,26 @@ var QueuesSchema = z16.record(
|
|
|
512
529
|
).optional().describe("Define the queues in your stack.");
|
|
513
530
|
|
|
514
531
|
// src/feature/rest/schema.ts
|
|
515
|
-
import { z as
|
|
532
|
+
import { z as z19 } from "zod";
|
|
516
533
|
|
|
517
534
|
// src/config/schema/route.ts
|
|
518
|
-
import { z as
|
|
519
|
-
var RouteSchema =
|
|
520
|
-
|
|
521
|
-
|
|
535
|
+
import { z as z18 } from "zod";
|
|
536
|
+
var RouteSchema = z18.union([
|
|
537
|
+
z18.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS|ANY)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
538
|
+
z18.literal("$default")
|
|
522
539
|
]);
|
|
523
540
|
|
|
524
541
|
// src/feature/rest/schema.ts
|
|
525
|
-
var RestDefaultSchema =
|
|
542
|
+
var RestDefaultSchema = z19.record(
|
|
526
543
|
ResourceIdSchema,
|
|
527
|
-
|
|
544
|
+
z19.object({
|
|
528
545
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
529
|
-
subDomain:
|
|
546
|
+
subDomain: z19.string().optional()
|
|
530
547
|
})
|
|
531
548
|
).optional().describe("Define your global REST API's.");
|
|
532
|
-
var RestSchema =
|
|
549
|
+
var RestSchema = z19.record(
|
|
533
550
|
ResourceIdSchema,
|
|
534
|
-
|
|
551
|
+
z19.record(
|
|
535
552
|
RouteSchema.describe(
|
|
536
553
|
[
|
|
537
554
|
"The REST API route that is comprised by the http method and http path.",
|
|
@@ -545,19 +562,19 @@ var RestSchema = z18.record(
|
|
|
545
562
|
|
|
546
563
|
// src/feature/rpc/schema.ts
|
|
547
564
|
import { minutes as minutes4, seconds as seconds3 } from "@awsless/duration";
|
|
548
|
-
import { z as
|
|
565
|
+
import { z as z21 } from "zod";
|
|
549
566
|
|
|
550
567
|
// src/feature/router/schema.ts
|
|
551
568
|
import { days as days3, minutes as minutes3, parse as parse3 } from "@awsless/duration";
|
|
552
|
-
import { z as
|
|
553
|
-
var ErrorResponsePathSchema =
|
|
569
|
+
import { z as z20 } from "zod";
|
|
570
|
+
var ErrorResponsePathSchema = z20.string().describe(
|
|
554
571
|
[
|
|
555
572
|
"The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.",
|
|
556
573
|
"- We recommend that you store custom error pages in an Amazon S3 bucket.",
|
|
557
574
|
"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."
|
|
558
575
|
].join("\n")
|
|
559
576
|
);
|
|
560
|
-
var StatusCodeSchema =
|
|
577
|
+
var StatusCodeSchema = z20.number().int().positive().optional().describe(
|
|
561
578
|
[
|
|
562
579
|
"The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.",
|
|
563
580
|
"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:",
|
|
@@ -570,26 +587,26 @@ var StatusCodeSchema = z19.number().int().positive().optional().describe(
|
|
|
570
587
|
var MinTTLSchema = DurationSchema.describe(
|
|
571
588
|
"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."
|
|
572
589
|
);
|
|
573
|
-
var ErrorResponseSchema =
|
|
590
|
+
var ErrorResponseSchema = z20.union([
|
|
574
591
|
ErrorResponsePathSchema,
|
|
575
|
-
|
|
592
|
+
z20.object({
|
|
576
593
|
path: ErrorResponsePathSchema,
|
|
577
594
|
statusCode: StatusCodeSchema.optional(),
|
|
578
595
|
minTTL: MinTTLSchema.optional()
|
|
579
596
|
})
|
|
580
597
|
]).optional();
|
|
581
|
-
var RouteSchema2 =
|
|
582
|
-
var VisibilitySchema =
|
|
583
|
-
var WafSettingsSchema =
|
|
584
|
-
rateLimiter:
|
|
585
|
-
limit:
|
|
598
|
+
var RouteSchema2 = z20.string().regex(/^\//, "Route must start with a slash (/)");
|
|
599
|
+
var VisibilitySchema = z20.boolean().default(false).describe("Whether to enable CloudWatch metrics for the WAF rule.");
|
|
600
|
+
var WafSettingsSchema = z20.object({
|
|
601
|
+
rateLimiter: z20.object({
|
|
602
|
+
limit: z20.number().min(10).max(2e9).default(10).describe(
|
|
586
603
|
"The limit on requests during the specified evaluation window for a single aggregation instance for the rate-based rule."
|
|
587
604
|
),
|
|
588
|
-
window:
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
605
|
+
window: z20.union([
|
|
606
|
+
z20.literal("1 minute"),
|
|
607
|
+
z20.literal("2 minutes"),
|
|
608
|
+
z20.literal("5 minutes"),
|
|
609
|
+
z20.literal("10 minutes")
|
|
593
610
|
]).default("5 minutes").transform((v) => parse3(v)).describe(
|
|
594
611
|
"The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time."
|
|
595
612
|
),
|
|
@@ -597,18 +614,18 @@ var WafSettingsSchema = z19.object({
|
|
|
597
614
|
}).optional().describe(
|
|
598
615
|
"A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate."
|
|
599
616
|
),
|
|
600
|
-
ddosProtection:
|
|
601
|
-
sensitivity:
|
|
602
|
-
challenge:
|
|
603
|
-
block:
|
|
617
|
+
ddosProtection: z20.object({
|
|
618
|
+
sensitivity: z20.object({
|
|
619
|
+
challenge: z20.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for challenge requests."),
|
|
620
|
+
block: z20.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for block requests.")
|
|
604
621
|
}),
|
|
605
|
-
exemptUriRegex:
|
|
622
|
+
exemptUriRegex: z20.string().default("^$"),
|
|
606
623
|
visibility: VisibilitySchema
|
|
607
624
|
}).optional().describe(
|
|
608
625
|
"Provides protection against DDoS attacks targeting the application layer, also known as Layer 7 attacks. Uses 50 WCU."
|
|
609
626
|
),
|
|
610
|
-
botProtection:
|
|
611
|
-
inspectionLevel:
|
|
627
|
+
botProtection: z20.object({
|
|
628
|
+
inspectionLevel: z20.enum(["common", "targeted"]).default("common").transform((v) => v.toUpperCase()),
|
|
612
629
|
visibility: VisibilitySchema
|
|
613
630
|
}).optional().describe(
|
|
614
631
|
"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."
|
|
@@ -622,14 +639,14 @@ var WafSettingsSchema = z19.object({
|
|
|
622
639
|
}).describe(
|
|
623
640
|
"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."
|
|
624
641
|
);
|
|
625
|
-
var RouterDefaultSchema =
|
|
642
|
+
var RouterDefaultSchema = z20.record(
|
|
626
643
|
ResourceIdSchema,
|
|
627
|
-
|
|
644
|
+
z20.object({
|
|
628
645
|
domain: ResourceIdSchema.describe("The domain id to link your Router.").optional(),
|
|
629
|
-
subDomain:
|
|
646
|
+
subDomain: z20.string().optional(),
|
|
630
647
|
waf: WafSettingsSchema.optional(),
|
|
631
|
-
geoRestrictions:
|
|
632
|
-
errors:
|
|
648
|
+
geoRestrictions: z20.array(z20.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
|
|
649
|
+
errors: z20.object({
|
|
633
650
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
634
651
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
635
652
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -642,21 +659,21 @@ var RouterDefaultSchema = z19.record(
|
|
|
642
659
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
643
660
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
644
661
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
645
|
-
cors:
|
|
646
|
-
override:
|
|
662
|
+
cors: z20.object({
|
|
663
|
+
override: z20.boolean().default(false),
|
|
647
664
|
maxAge: DurationSchema.default("365 days"),
|
|
648
|
-
exposeHeaders:
|
|
649
|
-
credentials:
|
|
650
|
-
headers:
|
|
651
|
-
origins:
|
|
652
|
-
methods:
|
|
665
|
+
exposeHeaders: z20.string().array().optional(),
|
|
666
|
+
credentials: z20.boolean().default(false),
|
|
667
|
+
headers: z20.string().array().default(["*"]),
|
|
668
|
+
origins: z20.string().array().default(["*"]),
|
|
669
|
+
methods: z20.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
653
670
|
}).optional().describe("Specify the cors headers."),
|
|
654
|
-
passwordAuth:
|
|
655
|
-
password:
|
|
671
|
+
passwordAuth: z20.object({
|
|
672
|
+
password: z20.string().describe("Password.")
|
|
656
673
|
}).optional().describe("Enable password authentication for the router."),
|
|
657
|
-
basicAuth:
|
|
658
|
-
username:
|
|
659
|
-
password:
|
|
674
|
+
basicAuth: z20.object({
|
|
675
|
+
username: z20.string().describe("Basic auth username."),
|
|
676
|
+
password: z20.string().describe("Basic auth password.")
|
|
660
677
|
}).optional().describe("Enable basic authentication for the router."),
|
|
661
678
|
// security: z
|
|
662
679
|
// .object({
|
|
@@ -703,10 +720,10 @@ var RouterDefaultSchema = z19.record(
|
|
|
703
720
|
// })
|
|
704
721
|
// .optional()
|
|
705
722
|
// .describe('Specify the security policy.'),
|
|
706
|
-
cache:
|
|
707
|
-
cookies:
|
|
708
|
-
headers:
|
|
709
|
-
queries:
|
|
723
|
+
cache: z20.object({
|
|
724
|
+
cookies: z20.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
725
|
+
headers: z20.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
726
|
+
queries: z20.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
710
727
|
}).optional().describe(
|
|
711
728
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
712
729
|
)
|
|
@@ -721,9 +738,9 @@ var TimeoutSchema2 = DurationSchema.refine(durationMin(seconds3(10)), "Minimum t
|
|
|
721
738
|
"The timeouts of all inner RPC functions will be capped at 80% of this timeout."
|
|
722
739
|
].join(" ")
|
|
723
740
|
);
|
|
724
|
-
var RpcDefaultSchema =
|
|
741
|
+
var RpcDefaultSchema = z21.record(
|
|
725
742
|
ResourceIdSchema,
|
|
726
|
-
|
|
743
|
+
z21.object({
|
|
727
744
|
// domain: ResourceIdSchema.describe('The domain id to link your RPC API with.').optional(),
|
|
728
745
|
// subDomain: z.string().optional(),
|
|
729
746
|
//
|
|
@@ -734,18 +751,18 @@ var RpcDefaultSchema = z20.record(
|
|
|
734
751
|
timeout: TimeoutSchema2.default("1 minutes")
|
|
735
752
|
})
|
|
736
753
|
).describe(`Define the global RPC API's.`).optional();
|
|
737
|
-
var RpcSchema =
|
|
754
|
+
var RpcSchema = z21.record(
|
|
738
755
|
ResourceIdSchema,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
756
|
+
z21.record(
|
|
757
|
+
z21.string(),
|
|
758
|
+
z21.union([
|
|
742
759
|
FunctionSchema.transform((f) => ({
|
|
743
760
|
function: f,
|
|
744
761
|
lock: false
|
|
745
762
|
})),
|
|
746
|
-
|
|
763
|
+
z21.object({
|
|
747
764
|
function: FunctionSchema.describe("The RPC function to execute."),
|
|
748
|
-
lock:
|
|
765
|
+
lock: z21.boolean().describe(
|
|
749
766
|
[
|
|
750
767
|
"Specify if the function should be locked on the `lockKey` returned from the auth function.",
|
|
751
768
|
"An example would be returning the user ID as `lockKey`."
|
|
@@ -759,8 +776,8 @@ var RpcSchema = z20.record(
|
|
|
759
776
|
// src/feature/instance/schema.ts
|
|
760
777
|
import { days as days4, toDays as toDays2 } from "@awsless/duration";
|
|
761
778
|
import { toMebibytes } from "@awsless/size";
|
|
762
|
-
import { z as
|
|
763
|
-
var CpuSchema =
|
|
779
|
+
import { z as z22 } from "zod";
|
|
780
|
+
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(
|
|
764
781
|
"The number of virtual CPU units (vCPU) used by the instance. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
|
|
765
782
|
);
|
|
766
783
|
var validMemorySize = [
|
|
@@ -800,10 +817,10 @@ var MemorySizeSchema2 = SizeSchema.refine(
|
|
|
800
817
|
(s) => validMemorySize.includes(toMebibytes(s)),
|
|
801
818
|
`Invalid memory size. Allowed sizes: ${validMemorySize.join(", ")} MiB`
|
|
802
819
|
).describe("The amount of memory (in MiB) used by the instance. Valid memory values depend on the CPU configuration.");
|
|
803
|
-
var HealthCheckSchema =
|
|
804
|
-
path:
|
|
820
|
+
var HealthCheckSchema = z22.object({
|
|
821
|
+
path: z22.string().describe("The path that the container runs to determine if it is healthy."),
|
|
805
822
|
interval: DurationSchema.describe("The time period in seconds between each health check execution."),
|
|
806
|
-
retries:
|
|
823
|
+
retries: z22.number().int().min(1).max(10).describe(
|
|
807
824
|
"The number of times to retry a failed health check before the container is considered unhealthy."
|
|
808
825
|
),
|
|
809
826
|
startPeriod: DurationSchema.describe(
|
|
@@ -813,22 +830,22 @@ var HealthCheckSchema = z21.object({
|
|
|
813
830
|
"The time period in seconds to wait for a health check to succeed before it is considered a failure."
|
|
814
831
|
)
|
|
815
832
|
}).describe("The health check command and associated configuration parameters for the container.");
|
|
816
|
-
var EnvironmentSchema2 =
|
|
817
|
-
var ArchitectureSchema3 =
|
|
818
|
-
var ActionSchema2 =
|
|
819
|
-
var ActionsSchema2 =
|
|
820
|
-
var ArnSchema2 =
|
|
821
|
-
var WildcardSchema2 =
|
|
822
|
-
var ResourceSchema2 =
|
|
823
|
-
var ResourcesSchema2 =
|
|
824
|
-
var PermissionSchema2 =
|
|
825
|
-
effect:
|
|
833
|
+
var EnvironmentSchema2 = z22.record(z22.string(), z22.string()).optional().describe("Environment variable key-value pairs.");
|
|
834
|
+
var ArchitectureSchema3 = z22.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
|
|
835
|
+
var ActionSchema2 = z22.string();
|
|
836
|
+
var ActionsSchema2 = z22.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
|
|
837
|
+
var ArnSchema2 = z22.string().startsWith("arn:");
|
|
838
|
+
var WildcardSchema2 = z22.literal("*");
|
|
839
|
+
var ResourceSchema2 = z22.union([ArnSchema2, WildcardSchema2]);
|
|
840
|
+
var ResourcesSchema2 = z22.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
|
|
841
|
+
var PermissionSchema2 = z22.object({
|
|
842
|
+
effect: z22.enum(["allow", "deny"]).default("allow"),
|
|
826
843
|
actions: ActionsSchema2,
|
|
827
844
|
resources: ResourcesSchema2
|
|
828
845
|
});
|
|
829
|
-
var PermissionsSchema2 =
|
|
830
|
-
var DescriptionSchema2 =
|
|
831
|
-
var ImageSchema =
|
|
846
|
+
var PermissionsSchema2 = z22.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
|
|
847
|
+
var DescriptionSchema2 = z22.string().describe("A description of the instance.");
|
|
848
|
+
var ImageSchema = z22.string().optional().describe("The URL of the container image to use.");
|
|
832
849
|
var validLogRetentionDays2 = [
|
|
833
850
|
...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
|
|
834
851
|
...[180, 365, 400, 545, 731, 1096, 1827, 2192],
|
|
@@ -843,23 +860,23 @@ var LogRetentionSchema2 = DurationSchema.refine(
|
|
|
843
860
|
},
|
|
844
861
|
`Invalid log retention. Valid days are: ${validLogRetentionDays2.map((days5) => `${days5}`).join(", ")}`
|
|
845
862
|
).describe("The log retention duration.");
|
|
846
|
-
var LogSchema2 =
|
|
847
|
-
|
|
863
|
+
var LogSchema2 = z22.union([
|
|
864
|
+
z22.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
|
|
848
865
|
LogRetentionSchema2.transform((retention) => ({ retention })),
|
|
849
|
-
|
|
866
|
+
z22.object({
|
|
850
867
|
retention: LogRetentionSchema2.optional()
|
|
851
868
|
})
|
|
852
869
|
]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
|
|
853
|
-
var FileCodeSchema2 =
|
|
870
|
+
var FileCodeSchema2 = z22.object({
|
|
854
871
|
file: LocalFileSchema.describe("The file path of the instance code.")
|
|
855
872
|
});
|
|
856
|
-
var CodeSchema2 =
|
|
873
|
+
var CodeSchema2 = z22.union([
|
|
857
874
|
LocalFileSchema.transform((file) => ({
|
|
858
875
|
file
|
|
859
876
|
})).pipe(FileCodeSchema2),
|
|
860
877
|
FileCodeSchema2
|
|
861
878
|
]).describe("Specify the code of your instance.");
|
|
862
|
-
var ISchema =
|
|
879
|
+
var ISchema = z22.object({
|
|
863
880
|
code: CodeSchema2,
|
|
864
881
|
description: DescriptionSchema2.optional(),
|
|
865
882
|
image: ImageSchema.optional(),
|
|
@@ -872,14 +889,14 @@ var ISchema = z21.object({
|
|
|
872
889
|
healthCheck: HealthCheckSchema.optional()
|
|
873
890
|
// restartPolicy: RestartPolicySchema.optional(),
|
|
874
891
|
});
|
|
875
|
-
var InstanceSchema =
|
|
892
|
+
var InstanceSchema = z22.union([
|
|
876
893
|
LocalFileSchema.transform((code) => ({
|
|
877
894
|
code
|
|
878
895
|
})).pipe(ISchema),
|
|
879
896
|
ISchema
|
|
880
897
|
]);
|
|
881
|
-
var InstancesSchema =
|
|
882
|
-
var InstanceDefaultSchema =
|
|
898
|
+
var InstancesSchema = z22.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
|
|
899
|
+
var InstanceDefaultSchema = z22.object({
|
|
883
900
|
image: ImageSchema.optional(),
|
|
884
901
|
cpu: CpuSchema.default(0.25),
|
|
885
902
|
memorySize: MemorySizeSchema2.default("512 MB"),
|
|
@@ -896,25 +913,6 @@ var InstanceDefaultSchema = z21.object({
|
|
|
896
913
|
// src/feature/topic/schema.ts
|
|
897
914
|
import { kebabCase as kebabCase3 } from "change-case";
|
|
898
915
|
import { z as z23 } from "zod";
|
|
899
|
-
|
|
900
|
-
// src/feature/task/schema.ts
|
|
901
|
-
import { z as z22 } from "zod";
|
|
902
|
-
var RetryAttemptsSchema3 = z22.number().int().min(0).max(2).describe(
|
|
903
|
-
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
904
|
-
);
|
|
905
|
-
var TaskSchema = z22.union([
|
|
906
|
-
FunctionSchema.transform((consumer) => ({
|
|
907
|
-
consumer,
|
|
908
|
-
retryAttempts: 2
|
|
909
|
-
})),
|
|
910
|
-
z22.object({
|
|
911
|
-
consumer: FunctionSchema,
|
|
912
|
-
retryAttempts: RetryAttemptsSchema3.default(2)
|
|
913
|
-
})
|
|
914
|
-
]);
|
|
915
|
-
var TasksSchema = z22.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
916
|
-
|
|
917
|
-
// src/feature/topic/schema.ts
|
|
918
916
|
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.");
|
|
919
917
|
var TopicsDefaultSchema = z23.array(TopicNameSchema).refine((topics) => {
|
|
920
918
|
return topics.length === new Set(topics).size;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.660",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@awsless/big-float": "^0.1.6",
|
|
37
36
|
"@awsless/cloudwatch": "^0.0.1",
|
|
38
|
-
"@awsless/duration": "^0.0.4",
|
|
39
|
-
"@awsless/clui": "^0.0.8",
|
|
40
37
|
"@awsless/dynamodb": "^0.3.20",
|
|
41
38
|
"@awsless/iot": "^0.0.5",
|
|
42
39
|
"@awsless/json": "^0.0.11",
|
|
43
40
|
"@awsless/lambda": "^0.0.42",
|
|
44
41
|
"@awsless/mqtt": "^0.0.5",
|
|
42
|
+
"@awsless/open-search": "^0.0.24",
|
|
43
|
+
"@awsless/clui": "^0.0.8",
|
|
44
|
+
"@awsless/duration": "^0.0.4",
|
|
45
|
+
"@awsless/big-float": "^0.1.6",
|
|
45
46
|
"@awsless/redis": "^0.0.16",
|
|
46
|
-
"@awsless/sns": "^0.0.10",
|
|
47
47
|
"@awsless/sqs": "^0.0.21",
|
|
48
|
-
"@awsless/
|
|
48
|
+
"@awsless/s3": "^0.0.21",
|
|
49
|
+
"@awsless/sns": "^0.0.10",
|
|
49
50
|
"@awsless/validate": "^0.1.7",
|
|
50
51
|
"@awsless/weak-cache": "^0.0.1",
|
|
51
|
-
"@awsless/s3": "^0.0.21",
|
|
52
52
|
"@awsless/ssm": "^0.0.7"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
@@ -114,15 +114,15 @@
|
|
|
114
114
|
"zip-a-folder": "^3.1.6",
|
|
115
115
|
"zod": "^3.24.2",
|
|
116
116
|
"zod-to-json-schema": "^3.24.3",
|
|
117
|
-
"@awsless/cloudwatch": "^0.0.1",
|
|
118
117
|
"@awsless/big-float": "^0.1.6",
|
|
119
|
-
"@awsless/
|
|
120
|
-
"@awsless/duration": "^0.0.4",
|
|
121
|
-
"@awsless/size": "^0.0.2",
|
|
118
|
+
"@awsless/cloudwatch": "^0.0.1",
|
|
122
119
|
"@awsless/scheduler": "^0.0.4",
|
|
120
|
+
"@awsless/size": "^0.0.2",
|
|
123
121
|
"@awsless/validate": "^0.1.7",
|
|
122
|
+
"@awsless/ts-file-cache": "^0.0.12",
|
|
123
|
+
"@awsless/clui": "^0.0.8",
|
|
124
124
|
"@awsless/json": "^0.0.11",
|
|
125
|
-
"@awsless/
|
|
125
|
+
"@awsless/duration": "^0.0.4"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"@hono/node-server": "1.19.9",
|