@awsless/awsless 0.0.303 → 0.0.304

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.
@@ -13,6 +13,8 @@ import { z } from "zod";
13
13
  var ResourceIdSchema = z.string().min(3).max(24).regex(/^[a-z0-9\-]+$/i, "Invalid resource ID").transform((value) => paramCase(value));
14
14
 
15
15
  // src/feature/function/schema.ts
16
+ import { days, minutes, seconds } from "@awsless/duration";
17
+ import { gibibytes, mebibytes } from "@awsless/size";
16
18
  import { z as z5 } from "zod";
17
19
 
18
20
  // src/config/schema/duration.ts
@@ -96,8 +98,6 @@ var sizeMax = (max) => {
96
98
  };
97
99
 
98
100
  // src/feature/function/schema.ts
99
- import { days, minutes, seconds } from "@awsless/duration";
100
- import { gibibytes, mebibytes } from "@awsless/size";
101
101
  var MemorySizeSchema = SizeSchema.refine(sizeMin(mebibytes(128)), "Minimum memory size is 128 MB").refine(sizeMax(gibibytes(10)), "Maximum memory size is 10 GB").describe(
102
102
  "The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The value can be any multiple of 1 MB. You can specify a size value from 128 MB to 10 GB."
103
103
  );
@@ -108,9 +108,7 @@ var EphemeralStorageSizeSchema = SizeSchema.refine(
108
108
  sizeMin(mebibytes(512)),
109
109
  "Minimum ephemeral storage size is 512 MB"
110
110
  ).refine(sizeMax(gibibytes(10)), "Minimum ephemeral storage size is 10 GB").describe("The size of the function's /tmp directory. You can specify a size value from 512 MB to 10 GB.");
111
- var ReservedConcurrentExecutionsSchema = z5.number().int().min(0).describe(
112
- "The number of simultaneous executions to reserve for the function. You can specify a number from 0."
113
- );
111
+ var ReservedConcurrentExecutionsSchema = z5.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
114
112
  var EnvironmentSchema = z5.record(z5.string(), z5.string()).optional().describe("Environment variable key-value pairs.");
115
113
  var ArchitectureSchema = z5.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
116
114
  var RetryAttemptsSchema = z5.number().int().min(0).max(2).describe(
@@ -129,9 +127,7 @@ var PermissionSchema = z5.object({
129
127
  resources: ResourcesSchema
130
128
  });
131
129
  var PermissionsSchema = z5.union([PermissionSchema.transform((v) => [v]), PermissionSchema.array()]).describe("Add IAM permissions to your function.");
132
- var WarmSchema = z5.number().int().min(0).max(10).describe(
133
- "Specify how many functions you want to warm up each 5 minutes. You can specify a number from 0 to 10."
134
- );
130
+ var WarmSchema = z5.number().int().min(0).max(10).describe("Specify how many functions you want to warm up each 5 minutes. You can specify a number from 0 to 10.");
135
131
  var VPCSchema = z5.boolean().describe("Put the function inside your global VPC.");
136
132
  var MinifySchema = z5.boolean().describe("Minify the function code.");
137
133
  var HandlerSchema = z5.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
@@ -140,12 +136,12 @@ var DescriptionSchema = z5.string().describe("A description of the function.");
140
136
  var LogRetentionSchema = DurationSchema.refine(
141
137
  durationMin(days(0)),
142
138
  "Minimum log retention is 0 day, which will disable logging."
143
- );
139
+ ).describe("The log retention duration.");
144
140
  var LogSchema = z5.union([
145
141
  z5.boolean().transform((enabled) => ({ retention: enabled ? days(7) : days(0) })),
146
142
  LogRetentionSchema.transform((retention) => ({ retention })),
147
143
  z5.object({
148
- retention: LogRetentionSchema.describe("The log retention duration."),
144
+ retention: LogRetentionSchema.optional(),
149
145
  format: z5.enum(["text", "json"]).describe(
150
146
  `The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.`
151
147
  ).optional(),
@@ -156,9 +152,7 @@ var LogSchema = z5.union([
156
152
  "Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest."
157
153
  ).optional()
158
154
  })
159
- ]).describe(
160
- "Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time."
161
- );
155
+ ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
162
156
  var FunctionSchema = z5.union([
163
157
  LocalFileSchema.transform((file) => ({
164
158
  file