@awsless/awsless 0.0.461 → 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 CHANGED
@@ -2396,7 +2396,7 @@ var zipFiles = (files) => {
2396
2396
  };
2397
2397
 
2398
2398
  // src/feature/function/util.ts
2399
- import { days as days3, toDays as toDays3, toSeconds } from "@awsless/duration";
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 ?? days3(7))
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;
@@ -5258,6 +5259,16 @@ var validateFeatures = (props) => {
5258
5259
  }
5259
5260
  };
5260
5261
 
5262
+ // src/util/sound.ts
5263
+ import Player from "play-sound";
5264
+ var player = Player({});
5265
+ var playSuccessSound = () => {
5266
+ player.play("/System/Library/Sounds/Glass.aiff");
5267
+ };
5268
+ var playErrorSound = () => {
5269
+ player.play("/System/Library/Sounds/Bottle.aiff");
5270
+ };
5271
+
5261
5272
  // src/cli/ui/app.ts
5262
5273
  import { note } from "@clack/prompts";
5263
5274
  var logApp = (app, opt) => {
@@ -5515,6 +5526,7 @@ var layout = async (command, cb) => {
5515
5526
  });
5516
5527
  outro(result ?? void 0);
5517
5528
  } catch (error) {
5529
+ playErrorSound();
5518
5530
  logError(error);
5519
5531
  outro();
5520
5532
  process.exit(1);
@@ -6075,6 +6087,7 @@ var del2 = (program2) => {
6075
6087
  await pullRemoteState(app, state2);
6076
6088
  update("Done deleting the stacks to AWS.");
6077
6089
  });
6090
+ playSuccessSound();
6078
6091
  return "Your app has been deleted!";
6079
6092
  });
6080
6093
  });
@@ -6466,6 +6479,7 @@ var deploy = (program2) => {
6466
6479
  await pullRemoteState(app, state2);
6467
6480
  update("Done deploying the stacks to AWS.");
6468
6481
  });
6482
+ playSuccessSound();
6469
6483
  return "Your app is ready!";
6470
6484
  });
6471
6485
  });
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.461",
3
+ "version": "0.0.463",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,19 +28,19 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
+ "@awsless/dynamodb": "^0.1.5",
31
32
  "@awsless/iot": "^0.0.3",
32
33
  "@awsless/json": "^0.0.8",
33
- "@awsless/dynamodb": "^0.1.5",
34
- "@awsless/lambda": "^0.0.31",
34
+ "@awsless/lambda": "^0.0.32",
35
35
  "@awsless/mqtt": "^0.0.2",
36
36
  "@awsless/open-search": "^0.0.17",
37
- "@awsless/s3": "^0.0.20",
38
37
  "@awsless/redis": "^0.0.13",
39
- "@awsless/sns": "^0.0.10",
40
- "@awsless/ssm": "^0.0.7",
38
+ "@awsless/s3": "^0.0.20",
39
+ "@awsless/validate": "^0.0.19",
41
40
  "@awsless/sqs": "^0.0.8",
41
+ "@awsless/ssm": "^0.0.7",
42
42
  "@awsless/weak-cache": "^0.0.1",
43
- "@awsless/validate": "^0.0.19"
43
+ "@awsless/sns": "^0.0.10"
44
44
  },
45
45
  "dependencies": {
46
46
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -68,6 +68,7 @@
68
68
  "@types/folder-hash": "^4.0.4",
69
69
  "@types/mime-types": "^2.1.2",
70
70
  "@types/minimist": "^1.2.5",
71
+ "@types/play-sound": "^1.1.2",
71
72
  "@types/pretty-hrtime": "^1.0.1",
72
73
  "@types/promise-dag": "^1.0.4",
73
74
  "@types/rollup-plugin-natives": "^0.7.5",
@@ -98,6 +99,7 @@
98
99
  "node-docker-api": "^1.1.22",
99
100
  "parse-imports": "^1.1.2",
100
101
  "parse-static-imports": "^1.1.0",
102
+ "play-sound": "^1.1.6",
101
103
  "pretty-hrtime": "^1.0.3",
102
104
  "promise-dag": "^1.0.0",
103
105
  "promisify-child-process": "^4.1.2",
@@ -117,12 +119,12 @@
117
119
  "zod": "^3.24.2",
118
120
  "zod-to-json-schema": "^3.24.3",
119
121
  "@awsless/code": "^0.0.10",
120
- "@awsless/formation": "^0.0.70",
122
+ "@awsless/duration": "^0.0.3",
123
+ "@awsless/formation": "^0.0.71",
121
124
  "@awsless/graphql": "^0.0.9",
122
125
  "@awsless/json": "^0.0.8",
123
- "@awsless/size": "^0.0.2",
124
126
  "@awsless/ts-file-cache": "^0.0.12",
125
- "@awsless/duration": "^0.0.3",
127
+ "@awsless/size": "^0.0.2",
126
128
  "@awsless/validate": "^0.0.19"
127
129
  },
128
130
  "devDependencies": {