@awsless/awsless 0.0.439 → 0.0.440
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 +31 -29
- package/dist/build-json-schema.js +12 -14
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/package.json +8 -8
package/dist/bin.js
CHANGED
|
@@ -7759,11 +7759,11 @@ var BundleCodeSchema = z8.object({
|
|
|
7759
7759
|
bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
|
|
7760
7760
|
});
|
|
7761
7761
|
var CodeSchema = z8.union([
|
|
7762
|
-
LocalFileSchema.transform(
|
|
7763
|
-
file
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7762
|
+
LocalFileSchema.transform(
|
|
7763
|
+
(file) => FileCodeSchema.parse({
|
|
7764
|
+
file
|
|
7765
|
+
})
|
|
7766
|
+
),
|
|
7767
7767
|
FileCodeSchema,
|
|
7768
7768
|
BundleCodeSchema
|
|
7769
7769
|
]).describe("Specify the code of your function.");
|
|
@@ -7792,11 +7792,9 @@ var FnSchema = z8.object({
|
|
|
7792
7792
|
});
|
|
7793
7793
|
var FunctionSchema = z8.union([
|
|
7794
7794
|
LocalFileSchema.transform((file) => ({
|
|
7795
|
-
code: {
|
|
7796
|
-
file
|
|
7797
|
-
|
|
7798
|
-
external: []
|
|
7799
|
-
}
|
|
7795
|
+
code: FileCodeSchema.parse({
|
|
7796
|
+
file
|
|
7797
|
+
})
|
|
7800
7798
|
})),
|
|
7801
7799
|
FnSchema
|
|
7802
7800
|
]);
|
|
@@ -8166,10 +8164,10 @@ var QueueDefaultSchema = z18.object({
|
|
|
8166
8164
|
var QueuesSchema = z18.record(
|
|
8167
8165
|
ResourceIdSchema,
|
|
8168
8166
|
z18.union([
|
|
8169
|
-
LocalFileSchema.transform((
|
|
8170
|
-
consumer: {
|
|
8171
|
-
|
|
8172
|
-
}
|
|
8167
|
+
LocalFileSchema.transform((code) => ({
|
|
8168
|
+
consumer: FunctionSchema.parse({
|
|
8169
|
+
code
|
|
8170
|
+
})
|
|
8173
8171
|
})),
|
|
8174
8172
|
z18.object({
|
|
8175
8173
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
@@ -12041,11 +12039,12 @@ var httpFeature = defineFeature({
|
|
|
12041
12039
|
if (!(id in api)) api[id] = {};
|
|
12042
12040
|
for (const [route, props] of Object.entries(routes)) {
|
|
12043
12041
|
const { path, method } = parseRoute(route);
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12042
|
+
if (props && "file" in props.code) {
|
|
12043
|
+
if (!(method in api[id])) {
|
|
12044
|
+
api[id][method] = {};
|
|
12045
|
+
}
|
|
12046
|
+
api[id][method][path] = props.code.file;
|
|
12047
12047
|
}
|
|
12048
|
-
api[id][method][path] = file;
|
|
12049
12048
|
}
|
|
12050
12049
|
}
|
|
12051
12050
|
}
|
|
@@ -12570,7 +12569,7 @@ var queueFeature = defineFeature({
|
|
|
12570
12569
|
const resource2 = new TypeObject(2);
|
|
12571
12570
|
const mock = new TypeObject(2);
|
|
12572
12571
|
const mockResponse = new TypeObject(2);
|
|
12573
|
-
for (const [name,
|
|
12572
|
+
for (const [name, props] of Object.entries(stack.queues || {})) {
|
|
12574
12573
|
const varName = camelCase5(`${stack.name}-${name}`);
|
|
12575
12574
|
const queueName = formatLocalResourceName({
|
|
12576
12575
|
appName: ctx.appConfig.name,
|
|
@@ -12578,12 +12577,13 @@ var queueFeature = defineFeature({
|
|
|
12578
12577
|
resourceType: "queue",
|
|
12579
12578
|
resourceName: name
|
|
12580
12579
|
});
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12580
|
+
if ("file" in props.consumer.code) {
|
|
12581
|
+
const relFile = relative5(directories.types, props.consumer.code.file);
|
|
12582
|
+
gen.addImport(varName, relFile);
|
|
12583
|
+
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
12584
|
+
resource2.addType(name, `Send<'${queueName}', typeof ${varName}>`);
|
|
12585
|
+
mockResponse.addType(name, `MockObject<typeof ${varName}>`);
|
|
12586
|
+
}
|
|
12587
12587
|
}
|
|
12588
12588
|
mocks.addType(stack.name, mock);
|
|
12589
12589
|
resources.addType(stack.name, resource2);
|
|
@@ -12886,10 +12886,12 @@ var rpcFeature = defineFeature({
|
|
|
12886
12886
|
const schema = new TypeObject(2);
|
|
12887
12887
|
for (const stack of ctx.stackConfigs) {
|
|
12888
12888
|
for (const [name, props] of Object.entries(stack.rpc?.[id] ?? {})) {
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12889
|
+
if ("file" in props.code) {
|
|
12890
|
+
const relFile = relative6(directories.types, props.code.file);
|
|
12891
|
+
const varName = camelCase6(`${stack.name}-${name}`);
|
|
12892
|
+
types2.addImport(varName, relFile);
|
|
12893
|
+
schema.addType(name, `Handle<typeof ${varName}>`);
|
|
12894
|
+
}
|
|
12893
12895
|
}
|
|
12894
12896
|
}
|
|
12895
12897
|
schemas.addType(id, schema);
|
|
@@ -206,11 +206,11 @@ var BundleCodeSchema = z6.object({
|
|
|
206
206
|
bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
|
|
207
207
|
});
|
|
208
208
|
var CodeSchema = z6.union([
|
|
209
|
-
LocalFileSchema.transform(
|
|
210
|
-
file
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
LocalFileSchema.transform(
|
|
210
|
+
(file) => FileCodeSchema.parse({
|
|
211
|
+
file
|
|
212
|
+
})
|
|
213
|
+
),
|
|
214
214
|
FileCodeSchema,
|
|
215
215
|
BundleCodeSchema
|
|
216
216
|
]).describe("Specify the code of your function.");
|
|
@@ -239,11 +239,9 @@ var FnSchema = z6.object({
|
|
|
239
239
|
});
|
|
240
240
|
var FunctionSchema = z6.union([
|
|
241
241
|
LocalFileSchema.transform((file) => ({
|
|
242
|
-
code: {
|
|
243
|
-
file
|
|
244
|
-
|
|
245
|
-
external: []
|
|
246
|
-
}
|
|
242
|
+
code: FileCodeSchema.parse({
|
|
243
|
+
file
|
|
244
|
+
})
|
|
247
245
|
})),
|
|
248
246
|
FnSchema
|
|
249
247
|
]);
|
|
@@ -668,10 +666,10 @@ var QueueDefaultSchema = z18.object({
|
|
|
668
666
|
var QueuesSchema = z18.record(
|
|
669
667
|
ResourceIdSchema,
|
|
670
668
|
z18.union([
|
|
671
|
-
LocalFileSchema.transform((
|
|
672
|
-
consumer: {
|
|
673
|
-
|
|
674
|
-
}
|
|
669
|
+
LocalFileSchema.transform((code) => ({
|
|
670
|
+
consumer: FunctionSchema.parse({
|
|
671
|
+
code
|
|
672
|
+
})
|
|
675
673
|
})),
|
|
676
674
|
z18.object({
|
|
677
675
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.440",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@awsless/dynamodb": "^0.1.5",
|
|
32
32
|
"@awsless/json": "^0.0.7",
|
|
33
|
-
"@awsless/
|
|
33
|
+
"@awsless/iot": "^0.0.3",
|
|
34
34
|
"@awsless/open-search": "^0.0.17",
|
|
35
35
|
"@awsless/redis": "^0.0.13",
|
|
36
36
|
"@awsless/s3": "^0.0.20",
|
|
37
|
-
"@awsless/ssm": "^0.0.7",
|
|
38
37
|
"@awsless/sqs": "^0.0.8",
|
|
39
|
-
"@awsless/
|
|
38
|
+
"@awsless/ssm": "^0.0.7",
|
|
40
39
|
"@awsless/sns": "^0.0.10",
|
|
40
|
+
"@awsless/validate": "^0.0.17",
|
|
41
41
|
"@awsless/weak-cache": "^0.0.1",
|
|
42
|
-
"@awsless/
|
|
42
|
+
"@awsless/lambda": "^0.0.30",
|
|
43
43
|
"@awsless/mqtt": "^0.0.2"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
@@ -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/duration": "^0.0.1",
|
|
120
121
|
"@awsless/graphql": "^0.0.9",
|
|
121
122
|
"@awsless/formation": "^0.0.59",
|
|
122
|
-
"@awsless/duration": "^0.0.1",
|
|
123
123
|
"@awsless/json": "^0.0.7",
|
|
124
124
|
"@awsless/validate": "^0.0.17",
|
|
125
|
-
"@awsless/
|
|
126
|
-
"@awsless/
|
|
125
|
+
"@awsless/size": "^0.0.1",
|
|
126
|
+
"@awsless/ts-file-cache": "^0.0.12"
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
129
|
"@node-rs/bcrypt": "^1.10.5"
|