@awsless/awsless 0.0.432 → 0.0.433

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
@@ -88,17 +88,17 @@ var require_visit = __commonJS({
88
88
  visit.BREAK = BREAK;
89
89
  visit.SKIP = SKIP;
90
90
  visit.REMOVE = REMOVE;
91
- function visit_(key, node, visitor, path) {
92
- const ctrl = callVisitor(key, node, visitor, path);
91
+ function visit_(key, node, visitor, path2) {
92
+ const ctrl = callVisitor(key, node, visitor, path2);
93
93
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
94
- replaceNode(key, path, ctrl);
95
- return visit_(key, ctrl, visitor, path);
94
+ replaceNode(key, path2, ctrl);
95
+ return visit_(key, ctrl, visitor, path2);
96
96
  }
97
97
  if (typeof ctrl !== "symbol") {
98
98
  if (identity.isCollection(node)) {
99
- path = Object.freeze(path.concat(node));
99
+ path2 = Object.freeze(path2.concat(node));
100
100
  for (let i = 0; i < node.items.length; ++i) {
101
- const ci = visit_(i, node.items[i], visitor, path);
101
+ const ci = visit_(i, node.items[i], visitor, path2);
102
102
  if (typeof ci === "number")
103
103
  i = ci - 1;
104
104
  else if (ci === BREAK)
@@ -109,13 +109,13 @@ var require_visit = __commonJS({
109
109
  }
110
110
  }
111
111
  } else if (identity.isPair(node)) {
112
- path = Object.freeze(path.concat(node));
113
- const ck = visit_("key", node.key, visitor, path);
112
+ path2 = Object.freeze(path2.concat(node));
113
+ const ck = visit_("key", node.key, visitor, path2);
114
114
  if (ck === BREAK)
115
115
  return BREAK;
116
116
  else if (ck === REMOVE)
117
117
  node.key = null;
118
- const cv = visit_("value", node.value, visitor, path);
118
+ const cv = visit_("value", node.value, visitor, path2);
119
119
  if (cv === BREAK)
120
120
  return BREAK;
121
121
  else if (cv === REMOVE)
@@ -136,17 +136,17 @@ var require_visit = __commonJS({
136
136
  visitAsync.BREAK = BREAK;
137
137
  visitAsync.SKIP = SKIP;
138
138
  visitAsync.REMOVE = REMOVE;
139
- async function visitAsync_(key, node, visitor, path) {
140
- const ctrl = await callVisitor(key, node, visitor, path);
139
+ async function visitAsync_(key, node, visitor, path2) {
140
+ const ctrl = await callVisitor(key, node, visitor, path2);
141
141
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
142
- replaceNode(key, path, ctrl);
143
- return visitAsync_(key, ctrl, visitor, path);
142
+ replaceNode(key, path2, ctrl);
143
+ return visitAsync_(key, ctrl, visitor, path2);
144
144
  }
145
145
  if (typeof ctrl !== "symbol") {
146
146
  if (identity.isCollection(node)) {
147
- path = Object.freeze(path.concat(node));
147
+ path2 = Object.freeze(path2.concat(node));
148
148
  for (let i = 0; i < node.items.length; ++i) {
149
- const ci = await visitAsync_(i, node.items[i], visitor, path);
149
+ const ci = await visitAsync_(i, node.items[i], visitor, path2);
150
150
  if (typeof ci === "number")
151
151
  i = ci - 1;
152
152
  else if (ci === BREAK)
@@ -157,13 +157,13 @@ var require_visit = __commonJS({
157
157
  }
158
158
  }
159
159
  } else if (identity.isPair(node)) {
160
- path = Object.freeze(path.concat(node));
161
- const ck = await visitAsync_("key", node.key, visitor, path);
160
+ path2 = Object.freeze(path2.concat(node));
161
+ const ck = await visitAsync_("key", node.key, visitor, path2);
162
162
  if (ck === BREAK)
163
163
  return BREAK;
164
164
  else if (ck === REMOVE)
165
165
  node.key = null;
166
- const cv = await visitAsync_("value", node.value, visitor, path);
166
+ const cv = await visitAsync_("value", node.value, visitor, path2);
167
167
  if (cv === BREAK)
168
168
  return BREAK;
169
169
  else if (cv === REMOVE)
@@ -190,23 +190,23 @@ var require_visit = __commonJS({
190
190
  }
191
191
  return visitor;
192
192
  }
193
- function callVisitor(key, node, visitor, path) {
193
+ function callVisitor(key, node, visitor, path2) {
194
194
  if (typeof visitor === "function")
195
- return visitor(key, node, path);
195
+ return visitor(key, node, path2);
196
196
  if (identity.isMap(node))
197
- return visitor.Map?.(key, node, path);
197
+ return visitor.Map?.(key, node, path2);
198
198
  if (identity.isSeq(node))
199
- return visitor.Seq?.(key, node, path);
199
+ return visitor.Seq?.(key, node, path2);
200
200
  if (identity.isPair(node))
201
- return visitor.Pair?.(key, node, path);
201
+ return visitor.Pair?.(key, node, path2);
202
202
  if (identity.isScalar(node))
203
- return visitor.Scalar?.(key, node, path);
203
+ return visitor.Scalar?.(key, node, path2);
204
204
  if (identity.isAlias(node))
205
- return visitor.Alias?.(key, node, path);
205
+ return visitor.Alias?.(key, node, path2);
206
206
  return void 0;
207
207
  }
208
- function replaceNode(key, path, node) {
209
- const parent = path[path.length - 1];
208
+ function replaceNode(key, path2, node) {
209
+ const parent = path2[path2.length - 1];
210
210
  if (identity.isCollection(parent)) {
211
211
  parent.items[key] = node;
212
212
  } else if (identity.isPair(parent)) {
@@ -804,10 +804,10 @@ var require_Collection = __commonJS({
804
804
  var createNode = require_createNode();
805
805
  var identity = require_identity();
806
806
  var Node27 = require_Node();
807
- function collectionFromPath(schema, path, value) {
807
+ function collectionFromPath(schema, path2, value) {
808
808
  let v = value;
809
- for (let i = path.length - 1; i >= 0; --i) {
810
- const k = path[i];
809
+ for (let i = path2.length - 1; i >= 0; --i) {
810
+ const k = path2[i];
811
811
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
812
812
  const a = [];
813
813
  a[k] = v;
@@ -826,7 +826,7 @@ var require_Collection = __commonJS({
826
826
  sourceObjects: /* @__PURE__ */ new Map()
827
827
  });
828
828
  }
829
- var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done;
829
+ var isEmptyPath = (path2) => path2 == null || typeof path2 === "object" && !!path2[Symbol.iterator]().next().done;
830
830
  var Collection = class extends Node27.NodeBase {
831
831
  constructor(type, schema) {
832
832
  super(type);
@@ -856,11 +856,11 @@ var require_Collection = __commonJS({
856
856
  * be a Pair instance or a `{ key, value }` object, which may not have a key
857
857
  * that already exists in the map.
858
858
  */
859
- addIn(path, value) {
860
- if (isEmptyPath(path))
859
+ addIn(path2, value) {
860
+ if (isEmptyPath(path2))
861
861
  this.add(value);
862
862
  else {
863
- const [key, ...rest] = path;
863
+ const [key, ...rest] = path2;
864
864
  const node = this.get(key, true);
865
865
  if (identity.isCollection(node))
866
866
  node.addIn(rest, value);
@@ -874,8 +874,8 @@ var require_Collection = __commonJS({
874
874
  * Removes a value from the collection.
875
875
  * @returns `true` if the item was found and removed.
876
876
  */
877
- deleteIn(path) {
878
- const [key, ...rest] = path;
877
+ deleteIn(path2) {
878
+ const [key, ...rest] = path2;
879
879
  if (rest.length === 0)
880
880
  return this.delete(key);
881
881
  const node = this.get(key, true);
@@ -889,8 +889,8 @@ var require_Collection = __commonJS({
889
889
  * scalar values from their surrounding node; to disable set `keepScalar` to
890
890
  * `true` (collections are always returned intact).
891
891
  */
892
- getIn(path, keepScalar) {
893
- const [key, ...rest] = path;
892
+ getIn(path2, keepScalar) {
893
+ const [key, ...rest] = path2;
894
894
  const node = this.get(key, true);
895
895
  if (rest.length === 0)
896
896
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -908,8 +908,8 @@ var require_Collection = __commonJS({
908
908
  /**
909
909
  * Checks if the collection includes a value with the key `key`.
910
910
  */
911
- hasIn(path) {
912
- const [key, ...rest] = path;
911
+ hasIn(path2) {
912
+ const [key, ...rest] = path2;
913
913
  if (rest.length === 0)
914
914
  return this.has(key);
915
915
  const node = this.get(key, true);
@@ -919,8 +919,8 @@ var require_Collection = __commonJS({
919
919
  * Sets a value in this collection. For `!!set`, `value` needs to be a
920
920
  * boolean to add/remove the item from the set.
921
921
  */
922
- setIn(path, value) {
923
- const [key, ...rest] = path;
922
+ setIn(path2, value) {
923
+ const [key, ...rest] = path2;
924
924
  if (rest.length === 0) {
925
925
  this.set(key, value);
926
926
  } else {
@@ -3369,9 +3369,9 @@ var require_Document = __commonJS({
3369
3369
  this.contents.add(value);
3370
3370
  }
3371
3371
  /** Adds a value to the document. */
3372
- addIn(path, value) {
3372
+ addIn(path2, value) {
3373
3373
  if (assertCollection(this.contents))
3374
- this.contents.addIn(path, value);
3374
+ this.contents.addIn(path2, value);
3375
3375
  }
3376
3376
  /**
3377
3377
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -3446,14 +3446,14 @@ var require_Document = __commonJS({
3446
3446
  * Removes a value from the document.
3447
3447
  * @returns `true` if the item was found and removed.
3448
3448
  */
3449
- deleteIn(path) {
3450
- if (Collection.isEmptyPath(path)) {
3449
+ deleteIn(path2) {
3450
+ if (Collection.isEmptyPath(path2)) {
3451
3451
  if (this.contents == null)
3452
3452
  return false;
3453
3453
  this.contents = null;
3454
3454
  return true;
3455
3455
  }
3456
- return assertCollection(this.contents) ? this.contents.deleteIn(path) : false;
3456
+ return assertCollection(this.contents) ? this.contents.deleteIn(path2) : false;
3457
3457
  }
3458
3458
  /**
3459
3459
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -3468,10 +3468,10 @@ var require_Document = __commonJS({
3468
3468
  * scalar values from their surrounding node; to disable set `keepScalar` to
3469
3469
  * `true` (collections are always returned intact).
3470
3470
  */
3471
- getIn(path, keepScalar) {
3472
- if (Collection.isEmptyPath(path))
3471
+ getIn(path2, keepScalar) {
3472
+ if (Collection.isEmptyPath(path2))
3473
3473
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
3474
- return identity.isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : void 0;
3474
+ return identity.isCollection(this.contents) ? this.contents.getIn(path2, keepScalar) : void 0;
3475
3475
  }
3476
3476
  /**
3477
3477
  * Checks if the document includes a value with the key `key`.
@@ -3482,10 +3482,10 @@ var require_Document = __commonJS({
3482
3482
  /**
3483
3483
  * Checks if the document includes a value at `path`.
3484
3484
  */
3485
- hasIn(path) {
3486
- if (Collection.isEmptyPath(path))
3485
+ hasIn(path2) {
3486
+ if (Collection.isEmptyPath(path2))
3487
3487
  return this.contents !== void 0;
3488
- return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;
3488
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path2) : false;
3489
3489
  }
3490
3490
  /**
3491
3491
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -3502,13 +3502,13 @@ var require_Document = __commonJS({
3502
3502
  * Sets a value in this document. For `!!set`, `value` needs to be a
3503
3503
  * boolean to add/remove the item from the set.
3504
3504
  */
3505
- setIn(path, value) {
3506
- if (Collection.isEmptyPath(path)) {
3505
+ setIn(path2, value) {
3506
+ if (Collection.isEmptyPath(path2)) {
3507
3507
  this.contents = value;
3508
3508
  } else if (this.contents == null) {
3509
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);
3509
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path2), value);
3510
3510
  } else if (assertCollection(this.contents)) {
3511
- this.contents.setIn(path, value);
3511
+ this.contents.setIn(path2, value);
3512
3512
  }
3513
3513
  }
3514
3514
  /**
@@ -5437,9 +5437,9 @@ var require_cst_visit = __commonJS({
5437
5437
  visit.BREAK = BREAK;
5438
5438
  visit.SKIP = SKIP;
5439
5439
  visit.REMOVE = REMOVE;
5440
- visit.itemAtPath = (cst, path) => {
5440
+ visit.itemAtPath = (cst, path2) => {
5441
5441
  let item = cst;
5442
- for (const [field, index] of path) {
5442
+ for (const [field, index] of path2) {
5443
5443
  const tok = item?.[field];
5444
5444
  if (tok && "items" in tok) {
5445
5445
  item = tok.items[index];
@@ -5448,23 +5448,23 @@ var require_cst_visit = __commonJS({
5448
5448
  }
5449
5449
  return item;
5450
5450
  };
5451
- visit.parentCollection = (cst, path) => {
5452
- const parent = visit.itemAtPath(cst, path.slice(0, -1));
5453
- const field = path[path.length - 1][0];
5451
+ visit.parentCollection = (cst, path2) => {
5452
+ const parent = visit.itemAtPath(cst, path2.slice(0, -1));
5453
+ const field = path2[path2.length - 1][0];
5454
5454
  const coll = parent?.[field];
5455
5455
  if (coll && "items" in coll)
5456
5456
  return coll;
5457
5457
  throw new Error("Parent collection not found");
5458
5458
  };
5459
- function _visit(path, item, visitor) {
5460
- let ctrl = visitor(item, path);
5459
+ function _visit(path2, item, visitor) {
5460
+ let ctrl = visitor(item, path2);
5461
5461
  if (typeof ctrl === "symbol")
5462
5462
  return ctrl;
5463
5463
  for (const field of ["key", "value"]) {
5464
5464
  const token = item[field];
5465
5465
  if (token && "items" in token) {
5466
5466
  for (let i = 0; i < token.items.length; ++i) {
5467
- const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
5467
+ const ci = _visit(Object.freeze(path2.concat([[field, i]])), token.items[i], visitor);
5468
5468
  if (typeof ci === "number")
5469
5469
  i = ci - 1;
5470
5470
  else if (ci === BREAK)
@@ -5475,10 +5475,10 @@ var require_cst_visit = __commonJS({
5475
5475
  }
5476
5476
  }
5477
5477
  if (typeof ctrl === "function" && field === "key")
5478
- ctrl = ctrl(item, path);
5478
+ ctrl = ctrl(item, path2);
5479
5479
  }
5480
5480
  }
5481
- return typeof ctrl === "function" ? ctrl(item, path) : ctrl;
5481
+ return typeof ctrl === "function" ? ctrl(item, path2) : ctrl;
5482
5482
  }
5483
5483
  exports.visit = visit;
5484
5484
  }
@@ -7262,21 +7262,21 @@ var directories = {
7262
7262
  return join(this.output, "test");
7263
7263
  }
7264
7264
  };
7265
- var setRoot = (path = root) => {
7266
- directories.root = path;
7265
+ var setRoot = (path2 = root) => {
7266
+ directories.root = path2;
7267
7267
  };
7268
- var findRootDir = async (path, configFiles, level = 5) => {
7268
+ var findRootDir = async (path2, configFiles, level = 5) => {
7269
7269
  if (!level) {
7270
7270
  throw new TypeError("No awsless project found");
7271
7271
  }
7272
7272
  for (const configFile of configFiles) {
7273
- const file = join(path, configFile);
7273
+ const file = join(path2, configFile);
7274
7274
  const exists = await fileExist(file);
7275
7275
  if (exists) {
7276
- return [file, path];
7276
+ return [file, path2];
7277
7277
  }
7278
7278
  }
7279
- return findRootDir(normalize(join(path, "..")), configFiles, level - 1);
7279
+ return findRootDir(normalize(join(path2, "..")), configFiles, level - 1);
7280
7280
  };
7281
7281
  var fileExist = async (file) => {
7282
7282
  try {
@@ -7620,18 +7620,18 @@ import { stat } from "fs/promises";
7620
7620
  import { join as join3 } from "path";
7621
7621
  import { z as z5 } from "zod";
7622
7622
  var basePath;
7623
- var setLocalBasePath = (path) => {
7624
- basePath = path;
7623
+ var setLocalBasePath = (path2) => {
7624
+ basePath = path2;
7625
7625
  };
7626
- var resolvePath = (path) => {
7627
- if (path.startsWith(".") && basePath) {
7628
- return join3(basePath, path);
7626
+ var resolvePath = (path2) => {
7627
+ if (path2.startsWith(".") && basePath) {
7628
+ return join3(basePath, path2);
7629
7629
  }
7630
- return join3(directories.root, path);
7630
+ return join3(directories.root, path2);
7631
7631
  };
7632
- var LocalFileSchema = z5.string().transform((path) => resolvePath(path)).refine(async (path) => {
7632
+ var LocalFileSchema = z5.string().transform((path2) => resolvePath(path2)).refine(async (path2) => {
7633
7633
  try {
7634
- const s = await stat(path);
7634
+ const s = await stat(path2);
7635
7635
  return s.isFile();
7636
7636
  } catch (error) {
7637
7637
  return false;
@@ -7950,9 +7950,9 @@ import { z as z13 } from "zod";
7950
7950
  // src/config/schema/local-directory.ts
7951
7951
  import { stat as stat2 } from "fs/promises";
7952
7952
  import { z as z12 } from "zod";
7953
- var LocalDirectorySchema = z12.string().transform((path) => resolvePath(path)).refine(async (path) => {
7953
+ var LocalDirectorySchema = z12.string().transform((path2) => resolvePath(path2)).refine(async (path2) => {
7954
7954
  try {
7955
- const s = await stat2(path);
7955
+ const s = await stat2(path2);
7956
7956
  return s.isDirectory();
7957
7957
  } catch (error) {
7958
7958
  return false;
@@ -8023,7 +8023,6 @@ var NodeRuntimeSchema2 = z14.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).de
8023
8023
  // src/feature/layer/schema.ts
8024
8024
  var Schema = z15.object({
8025
8025
  file: LocalFileSchema,
8026
- description: z15.string().optional().describe("A description of the lambda layer."),
8027
8026
  runtimes: NodeRuntimeSchema2.array().optional(),
8028
8027
  architecture: ArchitectureSchema2.optional(),
8029
8028
  packages: z15.string().array().optional().describe(
@@ -8899,8 +8898,8 @@ var TypeFile = class {
8899
8898
  codes = /* @__PURE__ */ new Set();
8900
8899
  interfaces = /* @__PURE__ */ new Map();
8901
8900
  imports = /* @__PURE__ */ new Map();
8902
- addImport(varName, path) {
8903
- this.imports.set(varName, path);
8901
+ addImport(varName, path2) {
8902
+ this.imports.set(varName, path2);
8904
8903
  return this;
8905
8904
  }
8906
8905
  addCode(code) {
@@ -8923,11 +8922,11 @@ var TypeFile = class {
8923
8922
  lines.push(
8924
8923
  ...[
8925
8924
  "// Imports",
8926
- ...Array.from(this.imports.entries()).map(([varName, path]) => {
8925
+ ...Array.from(this.imports.entries()).map(([varName, path2]) => {
8927
8926
  if (typeof varName === "string") {
8928
- return `import ${camelCase(varName)} from '${path}'`;
8927
+ return `import ${camelCase(varName)} from '${path2}'`;
8929
8928
  }
8930
- return `import { ${Object.entries(varName).map(([key, alias]) => `${key} as ${camelCase(alias)}`).join(", ")} } from '${path}'`;
8929
+ return `import { ${Object.entries(varName).map(([key, alias]) => `${key} as ${camelCase(alias)}`).join(", ")} } from '${path2}'`;
8931
8930
  }),
8932
8931
  ""
8933
8932
  ]
@@ -10466,10 +10465,10 @@ var build = (type, name, builder, props) => {
10466
10465
  }
10467
10466
  const time = createTimer();
10468
10467
  const meta = await callback(async (file, data2) => {
10469
- const path = getBuildPath(type, name, file);
10470
- const base2 = dirname5(path);
10468
+ const path2 = getBuildPath(type, name, file);
10469
+ const base2 = dirname5(path2);
10471
10470
  await mkdir2(base2, { recursive: true });
10472
- await writeFile2(path, data2);
10471
+ await writeFile2(path2, data2);
10473
10472
  });
10474
10473
  const data = { ...meta, buildTime: time() };
10475
10474
  await writeCache(cacheFile, version, data);
@@ -10604,18 +10603,18 @@ import { hashElement } from "folder-hash";
10604
10603
  import { mkdir as mkdir3, readdir, rm as rm2 } from "fs/promises";
10605
10604
  import { join as join8 } from "path";
10606
10605
  var createTempFolder = async (name) => {
10607
- const path = join8(directories.temp, name);
10606
+ const path2 = join8(directories.temp, name);
10608
10607
  await mkdir3(join8(directories.temp, name), { recursive: true });
10609
10608
  process.on("SIGTERM", async () => {
10610
- await rm2(path, { recursive: true });
10609
+ await rm2(path2, { recursive: true });
10611
10610
  });
10612
10611
  return {
10613
- path,
10612
+ path: path2,
10614
10613
  async files() {
10615
- return readdir(path, { recursive: true });
10614
+ return readdir(path2, { recursive: true });
10616
10615
  },
10617
10616
  async delete() {
10618
- await rm2(path, { recursive: true });
10617
+ await rm2(path2, { recursive: true });
10619
10618
  }
10620
10619
  };
10621
10620
  };
@@ -11178,13 +11177,13 @@ var SsmStore = class {
11178
11177
  }
11179
11178
  async list() {
11180
11179
  debug("Load remote config values");
11181
- const path = configParameterPrefix(this.props.appConfig.name);
11180
+ const path2 = configParameterPrefix(this.props.appConfig.name);
11182
11181
  const values = {};
11183
11182
  let token;
11184
11183
  while (true) {
11185
11184
  const result = await this.client.send(
11186
11185
  new GetParametersByPathCommand({
11187
- Path: path,
11186
+ Path: path2,
11188
11187
  WithDecryption: true,
11189
11188
  MaxResults: 10,
11190
11189
  Recursive: true,
@@ -11894,8 +11893,8 @@ import { camelCase as camelCase4, constantCase as constantCase6 } from "change-c
11894
11893
  import { relative as relative3 } from "path";
11895
11894
  var parseRoute = (route) => {
11896
11895
  const [method, ...paths] = route.split(" ");
11897
- const path = paths.join(" ");
11898
- return { method, path };
11896
+ const path2 = paths.join(" ");
11897
+ return { method, path: path2 };
11899
11898
  };
11900
11899
  var strToInt = (str) => {
11901
11900
  return parseInt(Buffer.from(str, "utf8").toString("hex"), 16);
@@ -11916,12 +11915,12 @@ var httpFeature = defineFeature({
11916
11915
  for (const [id, routes] of Object.entries(stack.http ?? {})) {
11917
11916
  if (!(id in api)) api[id] = {};
11918
11917
  for (const [route, props] of Object.entries(routes)) {
11919
- const { path, method } = parseRoute(route);
11918
+ const { path: path2, method } = parseRoute(route);
11920
11919
  const file = typeof props === "string" ? props : props.file;
11921
11920
  if (!(method in api[id])) {
11922
11921
  api[id][method] = {};
11923
11922
  }
11924
- api[id][method][path] = file;
11923
+ api[id][method][path2] = file;
11925
11924
  }
11926
11925
  }
11927
11926
  }
@@ -11929,15 +11928,15 @@ var httpFeature = defineFeature({
11929
11928
  const idType = new TypeObject(2);
11930
11929
  for (const [method, paths] of Object.entries(routes)) {
11931
11930
  const methodType = new TypeObject(3);
11932
- for (const [path, file] of Object.entries(paths)) {
11931
+ for (const [path2, file] of Object.entries(paths)) {
11933
11932
  const paramType = new TypeObject(4);
11934
- for (const param of path.matchAll(/{([a-z0-9]+)}/g)) {
11933
+ for (const param of path2.matchAll(/{([a-z0-9]+)}/g)) {
11935
11934
  paramType.addType(param[0], "string | number");
11936
11935
  }
11937
- const varName = camelCase4(`${id}-${path}-${method}`);
11936
+ const varName = camelCase4(`${id}-${path2}-${method}`);
11938
11937
  const relFile = relative3(directories.types, file);
11939
11938
  types2.addImport(varName, relFile);
11940
- methodType.add(`'${path}'`, `Route<typeof ${varName}, ${paramType.toString() || "never"}>`);
11939
+ methodType.add(`'${path2}'`, `Route<typeof ${varName}, ${paramType.toString() || "never"}>`);
11941
11940
  }
11942
11941
  idType.addConst(method, methodType);
11943
11942
  }
@@ -12031,7 +12030,7 @@ var httpFeature = defineFeature({
12031
12030
  const group = new Node8(ctx.stack, "http", id);
12032
12031
  for (const [routeKey, routeProps] of Object.entries(routes)) {
12033
12032
  const routeGroup = new Node8(group, "route", routeKey);
12034
- const { method, path } = parseRoute(routeKey);
12033
+ const { method, path: path2 } = parseRoute(routeKey);
12035
12034
  const routeId = shortId(routeKey);
12036
12035
  const { lambda } = createLambdaFunction(routeGroup, ctx, "http", `${id}-${routeId}`, {
12037
12036
  ...routeProps,
@@ -12059,7 +12058,7 @@ var httpFeature = defineFeature({
12059
12058
  priority: generatePriority(ctx.stackConfig.name, routeKey),
12060
12059
  conditions: [
12061
12060
  aws9.elb.ListenerCondition.httpRequestMethods([method]),
12062
- aws9.elb.ListenerCondition.pathPatterns([path])
12061
+ aws9.elb.ListenerCondition.pathPatterns([path2])
12063
12062
  ],
12064
12063
  actions: [aws9.elb.ListenerAction.forward([target.arn])]
12065
12064
  }).dependsOn(target);
@@ -13809,6 +13808,7 @@ var alertFeature = defineFeature({
13809
13808
 
13810
13809
  // src/feature/layer/index.ts
13811
13810
  import { Asset as Asset7, aws as aws26, Node as Node26 } from "@awsless/formation";
13811
+ import path from "path";
13812
13812
  var layerFeature = defineFeature({
13813
13813
  name: "layer",
13814
13814
  onBefore(ctx) {
@@ -13849,7 +13849,7 @@ var layerFeature = defineFeature({
13849
13849
  resourceType: "layer",
13850
13850
  resourceName: id
13851
13851
  }),
13852
- description: props.description,
13852
+ description: `${id} (${path.parse(props.file).name}.${path.parse(props.file).ext})`,
13853
13853
  architectures: props.architecture ? [props.architecture] : void 0,
13854
13854
  runtimes: props.runtimes,
13855
13855
  code: {
@@ -14036,11 +14036,11 @@ var logConfigError = (error) => {
14036
14036
  const inStack = issue.path[0] === "stacks" && typeof issue.path[1] === "number";
14037
14037
  const length = issue.path.length;
14038
14038
  const end = ["}"];
14039
- issue.path.forEach((path, i) => {
14039
+ issue.path.forEach((path2, i) => {
14040
14040
  const index = i + 1;
14041
- context = context[path];
14042
- if (typeof path === "string") {
14043
- const key = path + `: `;
14041
+ context = context[path2];
14042
+ if (typeof path2 === "string") {
14043
+ const key = path2 + `: `;
14044
14044
  if (index === length) {
14045
14045
  const space = " ".repeat(key.length);
14046
14046
  const value = format(context);
@@ -14988,8 +14988,8 @@ var runTests = async (tests, stackFilters = [], testFilters = []) => {
14988
14988
  continue;
14989
14989
  }
14990
14990
  }
14991
- for (const path of test2.paths) {
14992
- const result = await runTest(test2.name, path, testFilters);
14991
+ for (const path2 of test2.paths) {
14992
+ const result = await runTest(test2.name, path2, testFilters);
14993
14993
  if (!result) {
14994
14994
  return false;
14995
14995
  }
@@ -15257,13 +15257,13 @@ var generateTypes = async (props) => {
15257
15257
  ...props,
15258
15258
  async write(file, data, include = false) {
15259
15259
  const code = data?.toString("utf8");
15260
- const path = join14(directories.types, file);
15260
+ const path2 = join14(directories.types, file);
15261
15261
  if (code) {
15262
15262
  if (include) {
15263
- files.push(relative7(directories.root, path));
15263
+ files.push(relative7(directories.root, path2));
15264
15264
  }
15265
- await mkdir6(dirname13(path), { recursive: true });
15266
- await writeFile4(path, code);
15265
+ await mkdir6(dirname13(path2), { recursive: true });
15266
+ await writeFile4(path2, code);
15267
15267
  }
15268
15268
  }
15269
15269
  });
@@ -1153,7 +1153,6 @@ var NodeRuntimeSchema2 = z33.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x"]).de
1153
1153
  // src/feature/layer/schema.ts
1154
1154
  var Schema = z34.object({
1155
1155
  file: LocalFileSchema,
1156
- description: z34.string().optional().describe("A description of the lambda layer."),
1157
1156
  runtimes: NodeRuntimeSchema2.array().optional(),
1158
1157
  architecture: ArchitectureSchema2.optional(),
1159
1158
  packages: z34.string().array().optional().describe(
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.432",
3
+ "version": "0.0.433",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -29,18 +29,18 @@
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@awsless/dynamodb": "^0.1.5",
32
- "@awsless/json": "^0.0.6",
33
32
  "@awsless/iot": "^0.0.3",
33
+ "@awsless/json": "^0.0.6",
34
34
  "@awsless/lambda": "^0.0.30",
35
- "@awsless/s3": "^0.0.20",
36
35
  "@awsless/open-search": "^0.0.17",
37
36
  "@awsless/redis": "^0.0.13",
37
+ "@awsless/s3": "^0.0.20",
38
+ "@awsless/validate": "^0.0.17",
38
39
  "@awsless/sqs": "^0.0.8",
39
40
  "@awsless/ssm": "^0.0.7",
40
- "@awsless/validate": "^0.0.17",
41
- "@awsless/sns": "^0.0.10",
41
+ "@awsless/weak-cache": "^0.0.1",
42
42
  "@awsless/mqtt": "^0.0.2",
43
- "@awsless/weak-cache": "^0.0.1"
43
+ "@awsless/sns": "^0.0.10"
44
44
  },
45
45
  "dependencies": {
46
46
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -117,13 +117,13 @@
117
117
  "zod": "^3.21.4",
118
118
  "zod-to-json-schema": "^3.22.3",
119
119
  "@awsless/code": "^0.0.10",
120
- "@awsless/formation": "^0.0.59",
121
120
  "@awsless/duration": "^0.0.1",
122
- "@awsless/json": "^0.0.6",
121
+ "@awsless/formation": "^0.0.59",
123
122
  "@awsless/graphql": "^0.0.9",
123
+ "@awsless/json": "^0.0.6",
124
124
  "@awsless/size": "^0.0.1",
125
- "@awsless/ts-file-cache": "^0.0.10",
126
- "@awsless/validate": "^0.0.17"
125
+ "@awsless/validate": "^0.0.17",
126
+ "@awsless/ts-file-cache": "^0.0.10"
127
127
  },
128
128
  "devDependencies": {
129
129
  "@node-rs/bcrypt": "^1.10.5"