@awsless/awsless 0.0.428 → 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/app.json +1 -1
- package/dist/bin.js +15 -16
- package/dist/build-json-schema.js +2 -3
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/stack.json +1 -1
- package/package.json +7 -7
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 =
|
|
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
|
);
|
|
@@ -8013,7 +8014,6 @@ var InstancesSchema = z13.record(
|
|
|
8013
8014
|
).optional().describe("Define the instances in your stack.");
|
|
8014
8015
|
|
|
8015
8016
|
// src/feature/layer/schema.ts
|
|
8016
|
-
import { paramCase as paramCase3 } from "change-case";
|
|
8017
8017
|
import { z as z15 } from "zod";
|
|
8018
8018
|
|
|
8019
8019
|
// src/config/schema/lambda.ts
|
|
@@ -8031,7 +8031,6 @@ var Schema = z15.object({
|
|
|
8031
8031
|
"Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
|
|
8032
8032
|
)
|
|
8033
8033
|
});
|
|
8034
|
-
var LayerIdSchema = z15.string().min(2).max(214).regex(/^[a-z0-9\-@.]+$/i, "Invalid layer ID").transform((value) => paramCase3(value));
|
|
8035
8034
|
var LayerSchema = z15.record(
|
|
8036
8035
|
LayerIdSchema,
|
|
8037
8036
|
z15.union([
|
|
@@ -8751,9 +8750,9 @@ import { z as z35 } from "zod";
|
|
|
8751
8750
|
var TestsSchema = z35.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
8752
8751
|
|
|
8753
8752
|
// src/feature/topic/schema.ts
|
|
8754
|
-
import { paramCase as
|
|
8753
|
+
import { paramCase as paramCase3 } from "change-case";
|
|
8755
8754
|
import { z as z36 } from "zod";
|
|
8756
|
-
var TopicNameSchema = z36.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) =>
|
|
8755
|
+
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.");
|
|
8757
8756
|
var TopicsSchema = z36.array(TopicNameSchema).refine((topics) => {
|
|
8758
8757
|
return topics.length === new Set(topics).size;
|
|
8759
8758
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
@@ -9000,7 +8999,7 @@ var TypeObject = class {
|
|
|
9000
8999
|
};
|
|
9001
9000
|
|
|
9002
9001
|
// src/util/name.ts
|
|
9003
|
-
import { paramCase as
|
|
9002
|
+
import { paramCase as paramCase4 } from "change-case";
|
|
9004
9003
|
import { createHmac } from "crypto";
|
|
9005
9004
|
var formatGlobalResourceName = (opt) => {
|
|
9006
9005
|
return [
|
|
@@ -9010,7 +9009,7 @@ var formatGlobalResourceName = (opt) => {
|
|
|
9010
9009
|
opt.resourceType,
|
|
9011
9010
|
opt.resourceName,
|
|
9012
9011
|
opt.postfix
|
|
9013
|
-
].filter((v) => typeof v === "string").map((v) =>
|
|
9012
|
+
].filter((v) => typeof v === "string").map((v) => paramCase4(v) || v).join(opt.seperator ?? "--");
|
|
9014
9013
|
};
|
|
9015
9014
|
var formatLocalResourceName = (opt) => {
|
|
9016
9015
|
return [
|
|
@@ -9021,7 +9020,7 @@ var formatLocalResourceName = (opt) => {
|
|
|
9021
9020
|
opt.resourceType,
|
|
9022
9021
|
opt.resourceName,
|
|
9023
9022
|
opt.postfix
|
|
9024
|
-
].filter((v) => typeof v === "string").map((v) =>
|
|
9023
|
+
].filter((v) => typeof v === "string").map((v) => paramCase4(v) || v).join(opt.seperator ?? "--");
|
|
9025
9024
|
};
|
|
9026
9025
|
var generateGlobalAppId = (opt) => {
|
|
9027
9026
|
return createHmac("sha1", "awsless").update(opt.accountId).update(opt.region).update(opt.appName).digest("hex").substring(0, 8);
|
|
@@ -11097,7 +11096,7 @@ var commandFeature = defineFeature({
|
|
|
11097
11096
|
});
|
|
11098
11097
|
|
|
11099
11098
|
// src/feature/config/index.ts
|
|
11100
|
-
import { paramCase as
|
|
11099
|
+
import { paramCase as paramCase5 } from "change-case";
|
|
11101
11100
|
|
|
11102
11101
|
// src/util/ssm.ts
|
|
11103
11102
|
import {
|
|
@@ -11258,7 +11257,7 @@ var configFeature = defineFeature({
|
|
|
11258
11257
|
resources: configs.map(
|
|
11259
11258
|
(name) => `arn:aws:ssm:${ctx.appConfig.region}:${ctx.accountId}:parameter${configParameterPrefix(
|
|
11260
11259
|
ctx.app.name
|
|
11261
|
-
)}/${
|
|
11260
|
+
)}/${paramCase5(name)}`
|
|
11262
11261
|
)
|
|
11263
11262
|
});
|
|
11264
11263
|
});
|
|
@@ -11533,7 +11532,7 @@ var functionFeature = defineFeature({
|
|
|
11533
11532
|
});
|
|
11534
11533
|
|
|
11535
11534
|
// src/feature/graphql/index.ts
|
|
11536
|
-
import { constantCase as constantCase5, paramCase as
|
|
11535
|
+
import { constantCase as constantCase5, paramCase as paramCase6 } from "change-case";
|
|
11537
11536
|
import { generate } from "@awsless/graphql";
|
|
11538
11537
|
import { mergeTypeDefs } from "@graphql-tools/merge";
|
|
11539
11538
|
import { readFile as readFile5 } from "fs/promises";
|
|
@@ -11826,7 +11825,7 @@ var graphqlFeature = defineFeature({
|
|
|
11826
11825
|
for (const [fieldName, props2] of Object.entries(fields ?? {})) {
|
|
11827
11826
|
const name = `${typeName}__${fieldName}`;
|
|
11828
11827
|
const resolverGroup = new Node7(group, "resolver", name);
|
|
11829
|
-
const entryId =
|
|
11828
|
+
const entryId = paramCase6(`${id}-${shortId(`${typeName}-${fieldName}`)}`);
|
|
11830
11829
|
const { lambda } = createLambdaFunction(resolverGroup, ctx, `graphql`, entryId, {
|
|
11831
11830
|
...props2.consumer,
|
|
11832
11831
|
description: `${id} ${typeName}.${fieldName}`
|
|
@@ -12602,7 +12601,7 @@ var restFeature = defineFeature({
|
|
|
12602
12601
|
});
|
|
12603
12602
|
|
|
12604
12603
|
// src/feature/rpc/index.ts
|
|
12605
|
-
import { camelCase as camelCase6, constantCase as constantCase10, paramCase as
|
|
12604
|
+
import { camelCase as camelCase6, constantCase as constantCase10, paramCase as paramCase7 } from "change-case";
|
|
12606
12605
|
import { Asset as Asset5, aws as aws17, Node as Node16 } from "@awsless/formation";
|
|
12607
12606
|
import { mebibytes as mebibytes2 } from "@awsless/size";
|
|
12608
12607
|
import { dirname as dirname10, join as join9, relative as relative5 } from "path";
|
|
@@ -12904,7 +12903,7 @@ var rpcFeature = defineFeature({
|
|
|
12904
12903
|
const group = new Node16(ctx.stack, "rpc", id);
|
|
12905
12904
|
for (const [name, props] of Object.entries(queries ?? {})) {
|
|
12906
12905
|
const queryGroup = new Node16(group, "query", name);
|
|
12907
|
-
const entryId =
|
|
12906
|
+
const entryId = paramCase7(`${id}-${shortId(name)}`);
|
|
12908
12907
|
createLambdaFunction(queryGroup, ctx, `rpc`, entryId, {
|
|
12909
12908
|
...props,
|
|
12910
12909
|
description: `${id} ${name}`
|
|
@@ -13223,7 +13222,7 @@ var siteFeature = defineFeature({
|
|
|
13223
13222
|
|
|
13224
13223
|
// src/feature/store/index.ts
|
|
13225
13224
|
import { aws as aws20, Node as Node19 } from "@awsless/formation";
|
|
13226
|
-
import { paramCase as
|
|
13225
|
+
import { paramCase as paramCase8 } from "change-case";
|
|
13227
13226
|
var typeGenCode5 = `
|
|
13228
13227
|
import { Body, PutObjectProps, BodyStream } from '@awsless/s3'
|
|
13229
13228
|
|
|
@@ -13307,7 +13306,7 @@ var storeFeature = defineFeature({
|
|
|
13307
13306
|
};
|
|
13308
13307
|
for (const [event, funcProps] of Object.entries(props.events ?? {})) {
|
|
13309
13308
|
const eventGroup = new Node19(group, "event", event);
|
|
13310
|
-
const eventId =
|
|
13309
|
+
const eventId = paramCase8(`${id}-${shortId(event)}`);
|
|
13311
13310
|
const { lambda } = createAsyncLambdaFunction(eventGroup, ctx, `store`, eventId, {
|
|
13312
13311
|
...funcProps,
|
|
13313
13312
|
description: `${id} event "${event}"`
|
|
@@ -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 =
|
|
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
|
);
|
|
@@ -1143,7 +1144,6 @@ var DomainsDefaultSchema = z32.record(
|
|
|
1143
1144
|
).optional().describe("Define the domains for your application.");
|
|
1144
1145
|
|
|
1145
1146
|
// src/feature/layer/schema.ts
|
|
1146
|
-
import { paramCase as paramCase4 } from "change-case";
|
|
1147
1147
|
import { z as z34 } from "zod";
|
|
1148
1148
|
|
|
1149
1149
|
// src/config/schema/lambda.ts
|
|
@@ -1161,7 +1161,6 @@ var Schema = z34.object({
|
|
|
1161
1161
|
"Define the package names that are available bundled in the layer. Those packages are not bundled while bundling the lambda."
|
|
1162
1162
|
)
|
|
1163
1163
|
});
|
|
1164
|
-
var LayerIdSchema = z34.string().min(2).max(214).regex(/^[a-z0-9\-@.]+$/i, "Invalid layer ID").transform((value) => paramCase4(value));
|
|
1165
1164
|
var LayerSchema = z34.record(
|
|
1166
1165
|
LayerIdSchema,
|
|
1167
1166
|
z34.union([
|
|
Binary file
|