@awsless/awsless 0.0.427 → 0.0.429

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/bin.js CHANGED
@@ -7594,6 +7594,7 @@ import { z as z8 } from "zod";
7594
7594
  import { paramCase as paramCase2 } from "change-case";
7595
7595
  import { z as z3 } from "zod";
7596
7596
  var ResourceIdSchema = z3.string().min(3).max(24).regex(/^[a-z0-9\-]+$/i, "Invalid resource ID").transform((value) => paramCase2(value));
7597
+ var LayerIdSchema = z3.string().min(2).max(214).transform((value) => paramCase2(value));
7597
7598
 
7598
7599
  // src/feature/function/schema.ts
7599
7600
  import { days, minutes as minutes2, seconds, toDays } from "@awsless/duration";
@@ -7733,7 +7734,7 @@ var LogSchema = z7.union([
7733
7734
  ).optional()
7734
7735
  })
7735
7736
  ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
7736
- var LayersSchema = ResourceIdSchema.array().describe(
7737
+ var LayersSchema = LayerIdSchema.array().describe(
7737
7738
  `A list of function layers to add to the function's execution environment.`
7738
7739
  // `A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.`
7739
7740
  );
@@ -8025,16 +8026,17 @@ var Schema = z15.object({
8025
8026
  file: LocalFileSchema,
8026
8027
  description: z15.string().optional().describe("A description of the lambda layer."),
8027
8028
  runtimes: NodeRuntimeSchema2.array().optional(),
8028
- architectures: ArchitectureSchema2.array().optional(),
8029
+ architecture: ArchitectureSchema2.optional(),
8029
8030
  packages: z15.string().array().optional().describe(
8030
8031
  "Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
8031
8032
  )
8032
8033
  });
8033
8034
  var LayerSchema = z15.record(
8034
- ResourceIdSchema,
8035
+ LayerIdSchema,
8035
8036
  z15.union([
8036
8037
  LocalFileSchema.transform((file) => ({
8037
- file
8038
+ file,
8039
+ description: void 0
8038
8040
  })),
8039
8041
  Schema
8040
8042
  ])
@@ -13811,6 +13813,10 @@ import { Asset as Asset7, aws as aws26, Node as Node26 } from "@awsless/formatio
13811
13813
  var layerFeature = defineFeature({
13812
13814
  name: "layer",
13813
13815
  onBefore(ctx) {
13816
+ const layers = Object.entries(ctx.appConfig.defaults.layers ?? {});
13817
+ if (layers.length === 0) {
13818
+ return;
13819
+ }
13814
13820
  const group = new Node26(ctx.base, "layer", "asset");
13815
13821
  const bucket = new aws26.s3.Bucket(group, "bucket", {
13816
13822
  name: formatGlobalResourceName({
@@ -13831,7 +13837,7 @@ var layerFeature = defineFeature({
13831
13837
  }
13832
13838
  for (const [id, _props] of layers) {
13833
13839
  const props = _props;
13834
- const group = new Node26(ctx.base, "lambda-layer", id);
13840
+ const group = new Node26(ctx.base, "layer", id);
13835
13841
  const item = new aws26.s3.BucketObject(group, "code", {
13836
13842
  bucket: ctx.shared.get("layer-bucket-name"),
13837
13843
  key: `/layer/${id}.zip`,
@@ -13845,7 +13851,7 @@ var layerFeature = defineFeature({
13845
13851
  resourceName: id
13846
13852
  }),
13847
13853
  description: props.description,
13848
- architectures: props.architectures,
13854
+ architectures: props.architecture ? [props.architecture] : void 0,
13849
13855
  runtimes: props.runtimes,
13850
13856
  code: {
13851
13857
  bucket: item.bucket,
@@ -11,6 +11,7 @@ import { z as z7 } from "zod";
11
11
  import { paramCase } from "change-case";
12
12
  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
+ var LayerIdSchema = z.string().min(2).max(214).transform((value) => paramCase(value));
14
15
 
15
16
  // src/feature/function/schema.ts
16
17
  import { days, minutes, seconds, toDays } from "@awsless/duration";
@@ -180,7 +181,7 @@ var LogSchema = z5.union([
180
181
  ).optional()
181
182
  })
182
183
  ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
183
- var LayersSchema = ResourceIdSchema.array().describe(
184
+ var LayersSchema = LayerIdSchema.array().describe(
184
185
  `A list of function layers to add to the function's execution environment.`
185
186
  // `A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.`
186
187
  );
@@ -1155,16 +1156,17 @@ var Schema = z34.object({
1155
1156
  file: LocalFileSchema,
1156
1157
  description: z34.string().optional().describe("A description of the lambda layer."),
1157
1158
  runtimes: NodeRuntimeSchema2.array().optional(),
1158
- architectures: ArchitectureSchema2.array().optional(),
1159
+ architecture: ArchitectureSchema2.optional(),
1159
1160
  packages: z34.string().array().optional().describe(
1160
1161
  "Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
1161
1162
  )
1162
1163
  });
1163
1164
  var LayerSchema = z34.record(
1164
- ResourceIdSchema,
1165
+ LayerIdSchema,
1165
1166
  z34.union([
1166
1167
  LocalFileSchema.transform((file) => ({
1167
- file
1168
+ file,
1169
+ description: void 0
1168
1170
  })),
1169
1171
  Schema
1170
1172
  ])
Binary file