@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.
@@ -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 = FunctionSchema.optional().describe(
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 z14 } from "zod";
372
- var NotifySchema = z14.union([
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 = z14.union([
394
+ var OnFailureDefaultSchema = z15.union([
378
395
  FunctionSchema.transform((consumer) => ({
379
396
  consumer,
380
397
  notify: []
381
398
  })),
382
- z14.object({
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 z15 } from "zod";
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 = z15.record(
418
+ var PubSubDefaultSchema = z16.record(
402
419
  ResourceIdSchema,
403
- z15.object({
420
+ z16.object({
404
421
  auth: FunctionSchema,
405
422
  domain: DomainSchema.optional(),
406
- subDomain: z15.string().optional()
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 RetryAttemptsSchema = z15.number().int().min(0).max(2).describe(
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 = z15.record(
442
+ var PubSubSchema = z16.record(
426
443
  ResourceIdSchema,
427
- z15.object({
428
- sql: z15.string().describe("The SQL statement used to query the IOT topic."),
429
- sqlVersion: z15.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
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: RetryAttemptsSchema.default(2)
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 z16 } from "zod";
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 = z16.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
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 = z16.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
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 RetryAttemptsSchema2 = z16.number().int().min(0).max(999).describe(
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 = z16.object({
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: RetryAttemptsSchema2.default(2)
507
+ retryAttempts: RetryAttemptsSchema3.default(2)
491
508
  }).default({});
492
- var QueueSchema = z16.object({
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: RetryAttemptsSchema2.optional()
519
+ retryAttempts: RetryAttemptsSchema3.optional()
503
520
  });
504
- var QueuesSchema = z16.record(
521
+ var QueuesSchema = z17.record(
505
522
  ResourceIdSchema,
506
- z16.union([
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 z18 } from "zod";
532
+ import { z as z19 } from "zod";
516
533
 
517
534
  // src/config/schema/route.ts
518
- import { z as z17 } from "zod";
519
- var RouteSchema = z17.union([
520
- z17.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS|ANY)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
521
- z17.literal("$default")
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 = z18.record(
542
+ var RestDefaultSchema = z19.record(
526
543
  ResourceIdSchema,
527
- z18.object({
544
+ z19.object({
528
545
  domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
529
- subDomain: z18.string().optional()
546
+ subDomain: z19.string().optional()
530
547
  })
531
548
  ).optional().describe("Define your global REST API's.");
532
- var RestSchema = z18.record(
549
+ var RestSchema = z19.record(
533
550
  ResourceIdSchema,
534
- z18.record(
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 z20 } from "zod";
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 z19 } from "zod";
553
- var ErrorResponsePathSchema = z19.string().describe(
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 = z19.number().int().positive().optional().describe(
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 = z19.union([
590
+ var ErrorResponseSchema = z20.union([
574
591
  ErrorResponsePathSchema,
575
- z19.object({
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 = z19.string().regex(/^\//, "Route must start with a slash (/)");
582
- var VisibilitySchema = z19.boolean().default(false).describe("Whether to enable CloudWatch metrics for the WAF rule.");
583
- var WafSettingsSchema = z19.object({
584
- rateLimiter: z19.object({
585
- limit: z19.number().min(10).max(2e9).default(10).describe(
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: z19.union([
589
- z19.literal("1 minute"),
590
- z19.literal("2 minutes"),
591
- z19.literal("5 minutes"),
592
- z19.literal("10 minutes")
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: z19.object({
601
- sensitivity: z19.object({
602
- challenge: z19.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for challenge requests."),
603
- block: z19.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for block requests.")
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: z19.string().default("^$"),
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: z19.object({
611
- inspectionLevel: z19.enum(["common", "targeted"]).default("common").transform((v) => v.toUpperCase()),
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 = z19.record(
642
+ var RouterDefaultSchema = z20.record(
626
643
  ResourceIdSchema,
627
- z19.object({
644
+ z20.object({
628
645
  domain: ResourceIdSchema.describe("The domain id to link your Router.").optional(),
629
- subDomain: z19.string().optional(),
646
+ subDomain: z20.string().optional(),
630
647
  waf: WafSettingsSchema.optional(),
631
- geoRestrictions: z19.array(z19.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
632
- errors: z19.object({
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: z19.object({
646
- override: z19.boolean().default(false),
662
+ cors: z20.object({
663
+ override: z20.boolean().default(false),
647
664
  maxAge: DurationSchema.default("365 days"),
648
- exposeHeaders: z19.string().array().optional(),
649
- credentials: z19.boolean().default(false),
650
- headers: z19.string().array().default(["*"]),
651
- origins: z19.string().array().default(["*"]),
652
- methods: z19.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
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: z19.object({
655
- password: z19.string().describe("Password.")
671
+ passwordAuth: z20.object({
672
+ password: z20.string().describe("Password.")
656
673
  }).optional().describe("Enable password authentication for the router."),
657
- basicAuth: z19.object({
658
- username: z19.string().describe("Basic auth username."),
659
- password: z19.string().describe("Basic auth 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: z19.object({
707
- cookies: z19.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
708
- headers: z19.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
709
- queries: z19.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
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 = z20.record(
741
+ var RpcDefaultSchema = z21.record(
725
742
  ResourceIdSchema,
726
- z20.object({
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 = z20.record(
754
+ var RpcSchema = z21.record(
738
755
  ResourceIdSchema,
739
- z20.record(
740
- z20.string(),
741
- z20.union([
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
- z20.object({
763
+ z21.object({
747
764
  function: FunctionSchema.describe("The RPC function to execute."),
748
- lock: z20.boolean().describe(
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 z21 } from "zod";
763
- var CpuSchema = z21.union([z21.literal(0.25), z21.literal(0.5), z21.literal(1), z21.literal(2), z21.literal(4), z21.literal(8), z21.literal(16)]).transform((v) => `${v} vCPU`).describe(
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 = z21.object({
804
- path: z21.string().describe("The path that the container runs to determine if it is healthy."),
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: z21.number().int().min(1).max(10).describe(
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 = z21.record(z21.string(), z21.string()).optional().describe("Environment variable key-value pairs.");
817
- var ArchitectureSchema3 = z21.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
818
- var ActionSchema2 = z21.string();
819
- var ActionsSchema2 = z21.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
820
- var ArnSchema2 = z21.string().startsWith("arn:");
821
- var WildcardSchema2 = z21.literal("*");
822
- var ResourceSchema2 = z21.union([ArnSchema2, WildcardSchema2]);
823
- var ResourcesSchema2 = z21.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
824
- var PermissionSchema2 = z21.object({
825
- effect: z21.enum(["allow", "deny"]).default("allow"),
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 = z21.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
830
- var DescriptionSchema2 = z21.string().describe("A description of the instance.");
831
- var ImageSchema = z21.string().optional().describe("The URL of the container image to use.");
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 = z21.union([
847
- z21.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
863
+ var LogSchema2 = z22.union([
864
+ z22.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
848
865
  LogRetentionSchema2.transform((retention) => ({ retention })),
849
- z21.object({
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 = z21.object({
870
+ var FileCodeSchema2 = z22.object({
854
871
  file: LocalFileSchema.describe("The file path of the instance code.")
855
872
  });
856
- var CodeSchema2 = z21.union([
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 = z21.object({
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 = z21.union([
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 = z21.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
882
- var InstanceDefaultSchema = z21.object({
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.659",
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/open-search": "^0.0.24",
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/clui": "^0.0.8",
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/ts-file-cache": "^0.0.12"
125
+ "@awsless/duration": "^0.0.4"
126
126
  },
127
127
  "devDependencies": {
128
128
  "@hono/node-server": "1.19.9",