@awsless/awsless 0.0.462 → 0.0.463
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 +13 -12
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/server.d.ts +3 -1
- package/dist/server.js +7 -0
- package/package.json +9 -9
package/dist/bin.js
CHANGED
|
@@ -2396,7 +2396,7 @@ var zipFiles = (files) => {
|
|
|
2396
2396
|
};
|
|
2397
2397
|
|
|
2398
2398
|
// src/feature/function/util.ts
|
|
2399
|
-
import {
|
|
2399
|
+
import { toDays as toDays3, toSeconds } from "@awsless/duration";
|
|
2400
2400
|
import { toMebibytes } from "@awsless/size";
|
|
2401
2401
|
import { pascalCase } from "change-case";
|
|
2402
2402
|
|
|
@@ -2644,6 +2644,12 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
|
|
|
2644
2644
|
});
|
|
2645
2645
|
let dependsOn = [];
|
|
2646
2646
|
if (props.vpc) {
|
|
2647
|
+
if (props.warm > 1) {
|
|
2648
|
+
throw new FileError(
|
|
2649
|
+
"stackConfig" in ctx ? ctx.stackConfig.file : "app.json",
|
|
2650
|
+
`We can't warm more then 1 lambda in a VPC.`
|
|
2651
|
+
);
|
|
2652
|
+
}
|
|
2647
2653
|
dependsOn.push(
|
|
2648
2654
|
new $3.aws.iam.RolePolicy(group, "vpc-policy", {
|
|
2649
2655
|
role: role.name,
|
|
@@ -2712,6 +2718,7 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
|
|
|
2712
2718
|
subnetIds: ctx.shared.get("vpc", "public-subnets")
|
|
2713
2719
|
} : void 0,
|
|
2714
2720
|
loggingConfig: {
|
|
2721
|
+
logGroup: `/aws/lambda/${name}`,
|
|
2715
2722
|
logFormat: logFormats[props.log.format],
|
|
2716
2723
|
applicationLogLevel: props.log.level?.toUpperCase(),
|
|
2717
2724
|
systemLogLevel: props.log.system?.toUpperCase()
|
|
@@ -2735,18 +2742,12 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
|
|
|
2735
2742
|
const logGroup = new $3.aws.cloudwatch.LogGroup(group, "log", {
|
|
2736
2743
|
// name: lambda.functionName.pipe(name => `/aws/lambda/${name}`),
|
|
2737
2744
|
name: `/aws/lambda/${name}`,
|
|
2738
|
-
retentionInDays: toDays3(props.log.retention
|
|
2745
|
+
retentionInDays: toDays3(props.log.retention)
|
|
2746
|
+
});
|
|
2747
|
+
addPermission({
|
|
2748
|
+
actions: ["logs:PutLogEvents", "logs:CreateLogStream"],
|
|
2749
|
+
resources: [logGroup.arn.pipe((arn) => `${arn}:*`)]
|
|
2739
2750
|
});
|
|
2740
|
-
addPermission(
|
|
2741
|
-
{
|
|
2742
|
-
actions: ["logs:CreateLogStream"],
|
|
2743
|
-
resources: [logGroup.arn]
|
|
2744
|
-
},
|
|
2745
|
-
{
|
|
2746
|
-
actions: ["logs:PutLogEvents"],
|
|
2747
|
-
resources: [logGroup.arn.pipe((arn) => `${arn}:*`)]
|
|
2748
|
-
}
|
|
2749
|
-
);
|
|
2750
2751
|
const onLogArn = getGlobalOnLog(ctx);
|
|
2751
2752
|
if (onLogArn && ctx.appConfig.defaults.onLog) {
|
|
2752
2753
|
const logFilter = ctx.appConfig.defaults.onLog.filter;
|
|
Binary file
|
package/dist/server.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ interface AlertMockResponse {
|
|
|
33
33
|
}
|
|
34
34
|
declare const mockAlert: (cb: (mock: AlertMock) => void) => AlertMockResponse;
|
|
35
35
|
|
|
36
|
+
declare const mockCache: () => void;
|
|
37
|
+
|
|
36
38
|
interface FunctionMock {
|
|
37
39
|
}
|
|
38
40
|
interface FunctionMockResponse {
|
|
@@ -166,4 +168,4 @@ declare const Topic: TopicResources;
|
|
|
166
168
|
declare const APP: "app";
|
|
167
169
|
declare const STACK: "stack";
|
|
168
170
|
|
|
169
|
-
export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, CommandOptions, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getFunctionName, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockFunction, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
|
|
171
|
+
export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, CommandOptions, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getFunctionName, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
|
package/dist/server.js
CHANGED
|
@@ -89,6 +89,12 @@ var mockAlert = (cb) => {
|
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
+
// src/lib/mock/cache.ts
|
|
93
|
+
import { mockRedis } from "@awsless/redis";
|
|
94
|
+
var mockCache = () => {
|
|
95
|
+
return mockRedis();
|
|
96
|
+
};
|
|
97
|
+
|
|
92
98
|
// src/lib/mock/function.ts
|
|
93
99
|
import { mockLambda } from "@awsless/lambda";
|
|
94
100
|
|
|
@@ -593,6 +599,7 @@ export {
|
|
|
593
599
|
getTaskName,
|
|
594
600
|
getTopicName,
|
|
595
601
|
mockAlert,
|
|
602
|
+
mockCache,
|
|
596
603
|
mockFunction,
|
|
597
604
|
mockPubSub,
|
|
598
605
|
mockQueue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.463",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"@awsless/dynamodb": "^0.1.5",
|
|
32
32
|
"@awsless/iot": "^0.0.3",
|
|
33
33
|
"@awsless/json": "^0.0.8",
|
|
34
|
-
"@awsless/lambda": "^0.0.
|
|
35
|
-
"@awsless/
|
|
34
|
+
"@awsless/lambda": "^0.0.32",
|
|
35
|
+
"@awsless/mqtt": "^0.0.2",
|
|
36
36
|
"@awsless/open-search": "^0.0.17",
|
|
37
|
+
"@awsless/redis": "^0.0.13",
|
|
37
38
|
"@awsless/s3": "^0.0.20",
|
|
38
|
-
"@awsless/
|
|
39
|
+
"@awsless/validate": "^0.0.19",
|
|
39
40
|
"@awsless/sqs": "^0.0.8",
|
|
40
|
-
"@awsless/mqtt": "^0.0.2",
|
|
41
41
|
"@awsless/ssm": "^0.0.7",
|
|
42
|
-
"@awsless/
|
|
43
|
-
"@awsless/
|
|
42
|
+
"@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",
|
|
@@ -119,12 +119,12 @@
|
|
|
119
119
|
"zod": "^3.24.2",
|
|
120
120
|
"zod-to-json-schema": "^3.24.3",
|
|
121
121
|
"@awsless/code": "^0.0.10",
|
|
122
|
-
"@awsless/formation": "^0.0.70",
|
|
123
122
|
"@awsless/duration": "^0.0.3",
|
|
123
|
+
"@awsless/formation": "^0.0.71",
|
|
124
124
|
"@awsless/graphql": "^0.0.9",
|
|
125
125
|
"@awsless/json": "^0.0.8",
|
|
126
|
-
"@awsless/size": "^0.0.2",
|
|
127
126
|
"@awsless/ts-file-cache": "^0.0.12",
|
|
127
|
+
"@awsless/size": "^0.0.2",
|
|
128
128
|
"@awsless/validate": "^0.0.19"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|