@awsless/awsless 0.0.427 → 0.0.428

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
@@ -8013,6 +8013,7 @@ var InstancesSchema = z13.record(
8013
8013
  ).optional().describe("Define the instances in your stack.");
8014
8014
 
8015
8015
  // src/feature/layer/schema.ts
8016
+ import { paramCase as paramCase3 } from "change-case";
8016
8017
  import { z as z15 } from "zod";
8017
8018
 
8018
8019
  // src/config/schema/lambda.ts
@@ -8025,16 +8026,18 @@ 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
  });
8034
+ var LayerIdSchema = z15.string().min(2).max(214).regex(/^[a-z0-9\-@.]+$/i, "Invalid layer ID").transform((value) => paramCase3(value));
8033
8035
  var LayerSchema = z15.record(
8034
- ResourceIdSchema,
8036
+ LayerIdSchema,
8035
8037
  z15.union([
8036
8038
  LocalFileSchema.transform((file) => ({
8037
- file
8039
+ file,
8040
+ description: void 0
8038
8041
  })),
8039
8042
  Schema
8040
8043
  ])
@@ -8748,9 +8751,9 @@ import { z as z35 } from "zod";
8748
8751
  var TestsSchema = z35.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
8749
8752
 
8750
8753
  // src/feature/topic/schema.ts
8751
- import { paramCase as paramCase3 } from "change-case";
8754
+ import { paramCase as paramCase4 } from "change-case";
8752
8755
  import { z as z36 } from "zod";
8753
- var TopicNameSchema = z36.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase3(value)).describe("Define event topic name.");
8756
+ var TopicNameSchema = z36.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase4(value)).describe("Define event topic name.");
8754
8757
  var TopicsSchema = z36.array(TopicNameSchema).refine((topics) => {
8755
8758
  return topics.length === new Set(topics).size;
8756
8759
  }, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
@@ -8997,7 +9000,7 @@ var TypeObject = class {
8997
9000
  };
8998
9001
 
8999
9002
  // src/util/name.ts
9000
- import { paramCase as paramCase4 } from "change-case";
9003
+ import { paramCase as paramCase5 } from "change-case";
9001
9004
  import { createHmac } from "crypto";
9002
9005
  var formatGlobalResourceName = (opt) => {
9003
9006
  return [
@@ -9007,7 +9010,7 @@ var formatGlobalResourceName = (opt) => {
9007
9010
  opt.resourceType,
9008
9011
  opt.resourceName,
9009
9012
  opt.postfix
9010
- ].filter((v) => typeof v === "string").map((v) => paramCase4(v) || v).join(opt.seperator ?? "--");
9013
+ ].filter((v) => typeof v === "string").map((v) => paramCase5(v) || v).join(opt.seperator ?? "--");
9011
9014
  };
9012
9015
  var formatLocalResourceName = (opt) => {
9013
9016
  return [
@@ -9018,7 +9021,7 @@ var formatLocalResourceName = (opt) => {
9018
9021
  opt.resourceType,
9019
9022
  opt.resourceName,
9020
9023
  opt.postfix
9021
- ].filter((v) => typeof v === "string").map((v) => paramCase4(v) || v).join(opt.seperator ?? "--");
9024
+ ].filter((v) => typeof v === "string").map((v) => paramCase5(v) || v).join(opt.seperator ?? "--");
9022
9025
  };
9023
9026
  var generateGlobalAppId = (opt) => {
9024
9027
  return createHmac("sha1", "awsless").update(opt.accountId).update(opt.region).update(opt.appName).digest("hex").substring(0, 8);
@@ -11094,7 +11097,7 @@ var commandFeature = defineFeature({
11094
11097
  });
11095
11098
 
11096
11099
  // src/feature/config/index.ts
11097
- import { paramCase as paramCase5 } from "change-case";
11100
+ import { paramCase as paramCase6 } from "change-case";
11098
11101
 
11099
11102
  // src/util/ssm.ts
11100
11103
  import {
@@ -11255,7 +11258,7 @@ var configFeature = defineFeature({
11255
11258
  resources: configs.map(
11256
11259
  (name) => `arn:aws:ssm:${ctx.appConfig.region}:${ctx.accountId}:parameter${configParameterPrefix(
11257
11260
  ctx.app.name
11258
- )}/${paramCase5(name)}`
11261
+ )}/${paramCase6(name)}`
11259
11262
  )
11260
11263
  });
11261
11264
  });
@@ -11530,7 +11533,7 @@ var functionFeature = defineFeature({
11530
11533
  });
11531
11534
 
11532
11535
  // src/feature/graphql/index.ts
11533
- import { constantCase as constantCase5, paramCase as paramCase6 } from "change-case";
11536
+ import { constantCase as constantCase5, paramCase as paramCase7 } from "change-case";
11534
11537
  import { generate } from "@awsless/graphql";
11535
11538
  import { mergeTypeDefs } from "@graphql-tools/merge";
11536
11539
  import { readFile as readFile5 } from "fs/promises";
@@ -11823,7 +11826,7 @@ var graphqlFeature = defineFeature({
11823
11826
  for (const [fieldName, props2] of Object.entries(fields ?? {})) {
11824
11827
  const name = `${typeName}__${fieldName}`;
11825
11828
  const resolverGroup = new Node7(group, "resolver", name);
11826
- const entryId = paramCase6(`${id}-${shortId(`${typeName}-${fieldName}`)}`);
11829
+ const entryId = paramCase7(`${id}-${shortId(`${typeName}-${fieldName}`)}`);
11827
11830
  const { lambda } = createLambdaFunction(resolverGroup, ctx, `graphql`, entryId, {
11828
11831
  ...props2.consumer,
11829
11832
  description: `${id} ${typeName}.${fieldName}`
@@ -12599,7 +12602,7 @@ var restFeature = defineFeature({
12599
12602
  });
12600
12603
 
12601
12604
  // src/feature/rpc/index.ts
12602
- import { camelCase as camelCase6, constantCase as constantCase10, paramCase as paramCase7 } from "change-case";
12605
+ import { camelCase as camelCase6, constantCase as constantCase10, paramCase as paramCase8 } from "change-case";
12603
12606
  import { Asset as Asset5, aws as aws17, Node as Node16 } from "@awsless/formation";
12604
12607
  import { mebibytes as mebibytes2 } from "@awsless/size";
12605
12608
  import { dirname as dirname10, join as join9, relative as relative5 } from "path";
@@ -12901,7 +12904,7 @@ var rpcFeature = defineFeature({
12901
12904
  const group = new Node16(ctx.stack, "rpc", id);
12902
12905
  for (const [name, props] of Object.entries(queries ?? {})) {
12903
12906
  const queryGroup = new Node16(group, "query", name);
12904
- const entryId = paramCase7(`${id}-${shortId(name)}`);
12907
+ const entryId = paramCase8(`${id}-${shortId(name)}`);
12905
12908
  createLambdaFunction(queryGroup, ctx, `rpc`, entryId, {
12906
12909
  ...props,
12907
12910
  description: `${id} ${name}`
@@ -13220,7 +13223,7 @@ var siteFeature = defineFeature({
13220
13223
 
13221
13224
  // src/feature/store/index.ts
13222
13225
  import { aws as aws20, Node as Node19 } from "@awsless/formation";
13223
- import { paramCase as paramCase8 } from "change-case";
13226
+ import { paramCase as paramCase9 } from "change-case";
13224
13227
  var typeGenCode5 = `
13225
13228
  import { Body, PutObjectProps, BodyStream } from '@awsless/s3'
13226
13229
 
@@ -13304,7 +13307,7 @@ var storeFeature = defineFeature({
13304
13307
  };
13305
13308
  for (const [event, funcProps] of Object.entries(props.events ?? {})) {
13306
13309
  const eventGroup = new Node19(group, "event", event);
13307
- const eventId = paramCase8(`${id}-${shortId(event)}`);
13310
+ const eventId = paramCase9(`${id}-${shortId(event)}`);
13308
13311
  const { lambda } = createAsyncLambdaFunction(eventGroup, ctx, `store`, eventId, {
13309
13312
  ...funcProps,
13310
13313
  description: `${id} event "${event}"`
@@ -13811,6 +13814,10 @@ import { Asset as Asset7, aws as aws26, Node as Node26 } from "@awsless/formatio
13811
13814
  var layerFeature = defineFeature({
13812
13815
  name: "layer",
13813
13816
  onBefore(ctx) {
13817
+ const layers = Object.entries(ctx.appConfig.defaults.layers ?? {});
13818
+ if (layers.length === 0) {
13819
+ return;
13820
+ }
13814
13821
  const group = new Node26(ctx.base, "layer", "asset");
13815
13822
  const bucket = new aws26.s3.Bucket(group, "bucket", {
13816
13823
  name: formatGlobalResourceName({
@@ -13831,7 +13838,7 @@ var layerFeature = defineFeature({
13831
13838
  }
13832
13839
  for (const [id, _props] of layers) {
13833
13840
  const props = _props;
13834
- const group = new Node26(ctx.base, "lambda-layer", id);
13841
+ const group = new Node26(ctx.base, "layer", id);
13835
13842
  const item = new aws26.s3.BucketObject(group, "code", {
13836
13843
  bucket: ctx.shared.get("layer-bucket-name"),
13837
13844
  key: `/layer/${id}.zip`,
@@ -13845,7 +13852,7 @@ var layerFeature = defineFeature({
13845
13852
  resourceName: id
13846
13853
  }),
13847
13854
  description: props.description,
13848
- architectures: props.architectures,
13855
+ architectures: props.architecture ? [props.architecture] : void 0,
13849
13856
  runtimes: props.runtimes,
13850
13857
  code: {
13851
13858
  bucket: item.bucket,
@@ -1143,6 +1143,7 @@ var DomainsDefaultSchema = z32.record(
1143
1143
  ).optional().describe("Define the domains for your application.");
1144
1144
 
1145
1145
  // src/feature/layer/schema.ts
1146
+ import { paramCase as paramCase4 } from "change-case";
1146
1147
  import { z as z34 } from "zod";
1147
1148
 
1148
1149
  // src/config/schema/lambda.ts
@@ -1155,16 +1156,18 @@ 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
  });
1164
+ var LayerIdSchema = z34.string().min(2).max(214).regex(/^[a-z0-9\-@.]+$/i, "Invalid layer ID").transform((value) => paramCase4(value));
1163
1165
  var LayerSchema = z34.record(
1164
- ResourceIdSchema,
1166
+ LayerIdSchema,
1165
1167
  z34.union([
1166
1168
  LocalFileSchema.transform((file) => ({
1167
- file
1169
+ file,
1170
+ description: void 0
1168
1171
  })),
1169
1172
  Schema
1170
1173
  ])
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.427",
3
+ "version": "0.0.428",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,18 +28,18 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
- "@awsless/dynamodb": "^0.1.5",
32
31
  "@awsless/json": "^0.0.6",
33
- "@awsless/lambda": "^0.0.30",
34
- "@awsless/s3": "^0.0.20",
35
- "@awsless/sns": "^0.0.10",
36
- "@awsless/sqs": "^0.0.8",
32
+ "@awsless/dynamodb": "^0.1.5",
37
33
  "@awsless/iot": "^0.0.3",
34
+ "@awsless/lambda": "^0.0.30",
38
35
  "@awsless/open-search": "^0.0.17",
39
36
  "@awsless/redis": "^0.0.13",
37
+ "@awsless/sns": "^0.0.10",
38
+ "@awsless/sqs": "^0.0.8",
40
39
  "@awsless/validate": "^0.0.17",
41
40
  "@awsless/ssm": "^0.0.7",
42
41
  "@awsless/weak-cache": "^0.0.1",
42
+ "@awsless/s3": "^0.0.20",
43
43
  "@awsless/mqtt": "^0.0.2"
44
44
  },
45
45
  "dependencies": {
@@ -116,14 +116,14 @@
116
116
  "zip-a-folder": "^3.1.6",
117
117
  "zod": "^3.21.4",
118
118
  "zod-to-json-schema": "^3.22.3",
119
- "@awsless/formation": "^0.0.59",
120
- "@awsless/graphql": "^0.0.9",
119
+ "@awsless/code": "^0.0.10",
121
120
  "@awsless/duration": "^0.0.1",
122
121
  "@awsless/json": "^0.0.6",
122
+ "@awsless/formation": "^0.0.59",
123
+ "@awsless/graphql": "^0.0.9",
123
124
  "@awsless/size": "^0.0.1",
124
125
  "@awsless/validate": "^0.0.17",
125
- "@awsless/ts-file-cache": "^0.0.10",
126
- "@awsless/code": "^0.0.10"
126
+ "@awsless/ts-file-cache": "^0.0.10"
127
127
  },
128
128
  "devDependencies": {
129
129
  "@node-rs/bcrypt": "^1.10.5"