serverless-vpc-discovery 4.0.1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,39 +5,36 @@ class Globals {
5
5
  Globals.serverless.cli.log(`${prefix} ${message}`, Globals.pluginName);
6
6
  }
7
7
  /**
8
- * Logs info message
9
- * @param message: message to be printed
10
- * @param debug: if true then show log only if SLS_DEBUG enabled on else anytime.
11
- * By default debug mode off and a message printed for each call.
8
+ * Logs error message
12
9
  */
13
- static logInfo(message, debug = false) {
14
- const canLog = (debug && process.env.SLS_DEBUG) || !debug;
15
- if (canLog) {
16
- Globals.cliLog("Info:", message);
10
+ static logError(message) {
11
+ if (Globals.v3Utils) {
12
+ Globals.v3Utils.log.error(message);
13
+ }
14
+ else {
15
+ Globals.cliLog("[Error]", message);
17
16
  }
18
17
  }
19
18
  /**
20
- * Logs warning message
21
- * @param message: message to be printed
22
- * @param debug: if true then show log only if SLS_DEBUG enabled on else anytime.
23
- * By default debug mode off and a message printed for each call.
19
+ * Logs info message
24
20
  */
25
- static logWarning(message, debug = false) {
26
- const canLog = (debug && process.env.SLS_DEBUG) || !debug;
27
- if (canLog) {
28
- Globals.cliLog("WARNING:", message);
21
+ static logInfo(message) {
22
+ if (Globals.v3Utils) {
23
+ Globals.v3Utils.log.verbose(message);
24
+ }
25
+ else {
26
+ Globals.cliLog("[Info]", message);
29
27
  }
30
28
  }
31
29
  /**
32
- * Logs error message
33
- * @param message: message to be printed
34
- * @param debug: if true then show log only if SLS_DEBUG enabled on else anytime.
35
- * By default debug mode off and a message printed for each call.
30
+ * Logs warning message
36
31
  */
37
- static logError(message, debug = false) {
38
- const canLog = (debug && process.env.SLS_DEBUG) || !debug;
39
- if (canLog) {
40
- Globals.cliLog("Error:", message);
32
+ static logWarning(message) {
33
+ if (Globals.v3Utils) {
34
+ Globals.v3Utils.log.warning(message);
35
+ }
36
+ else {
37
+ Globals.cliLog("[WARNING]", message);
41
38
  }
42
39
  }
43
40
  }
package/dist/src/index.js CHANGED
@@ -16,9 +16,12 @@ const globals_1 = __importDefault(require("./globals"));
16
16
  const validation_1 = require("./validation");
17
17
  const schema_1 = require("./schema");
18
18
  class VPCPlugin {
19
- constructor(serverless) {
19
+ constructor(serverless, options, v3Utils) {
20
20
  this.serverless = serverless;
21
21
  globals_1.default.serverless = serverless;
22
+ if (v3Utils) {
23
+ globals_1.default.v3Utils = v3Utils;
24
+ }
22
25
  /* hooks are the actual code that will run when called */
23
26
  this.hooks = {
24
27
  "before:package:initialize": this.hookWrapper.bind(this, this.updateFunctionsVpcConfig)
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "serverless-vpc-discovery",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "engines": {
5
- "node": ">=12"
5
+ "node": ">=14"
6
6
  },
7
7
  "description": "Serverless Plugin to modify VPC values",
8
8
  "author": "Amplify Education Inc",
@@ -48,33 +48,33 @@
48
48
  ]
49
49
  },
50
50
  "devDependencies": {
51
- "@types/mocha": "^9.0.0",
52
- "@types/node": "^16.7.10",
53
- "@typescript-eslint/eslint-plugin": "^4.30.0",
54
- "@typescript-eslint/parser": "^4.30.0",
55
- "aws-sdk-mock": "^5.2.2",
56
- "chai": "^4.3.4",
51
+ "@types/mocha": "^9.1.1",
52
+ "@types/node": "^16.18.14",
53
+ "@typescript-eslint/eslint-plugin": "^4.33.0",
54
+ "@typescript-eslint/parser": "^4.33.0",
55
+ "aws-sdk-mock": "^5.8.0",
56
+ "chai": "^4.3.7",
57
57
  "chai-spies": "^1.0.0",
58
58
  "eslint": "^7.32.0",
59
59
  "eslint-config-airbnb": "^18.2.1",
60
60
  "eslint-config-standard": "^16.0.3",
61
- "eslint-plugin-import": "^2.24.2",
61
+ "eslint-plugin-import": "^2.27.5",
62
62
  "eslint-plugin-jsx-a11y": "6.4.1",
63
63
  "eslint-plugin-node": "^11.1.0",
64
- "eslint-plugin-promise": "^5.1.0",
65
- "eslint-plugin-react": "^7.25.1",
66
- "eslint-plugin-react-hooks": "^4.2.0",
64
+ "eslint-plugin-promise": "^5.2.0",
65
+ "eslint-plugin-react": "^7.32.2",
66
+ "eslint-plugin-react-hooks": "^4.6.0",
67
67
  "js-yaml": "^4.1.0",
68
- "mocha": "^9.1.1",
68
+ "mocha": "^9.2.2",
69
69
  "mocha-param": "^2.0.1",
70
70
  "nyc": "^15.1.0",
71
- "randomstring": "^1.2.1",
72
- "serverless": "^3.12.0",
73
- "shelljs": "^0.8.4",
74
- "ts-node": "^10.2.1",
71
+ "randomstring": "^1.2.3",
72
+ "serverless": "^3.28.1",
73
+ "shelljs": "^0.8.5",
74
+ "ts-node": "^10.9.1",
75
75
  "typescript": "~4.3.5"
76
76
  },
77
77
  "dependencies": {
78
- "aws-sdk": "^2.980.0 "
78
+ "aws-sdk": "^2.1331.0"
79
79
  }
80
80
  }
package/CHANGELOG.md DELETED
@@ -1,67 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
- and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
-
7
- ## [4.0.1] - 2022-04-08
8
- ### Changed
9
- - Fixed audit issues. Added dependabot config.
10
-
11
- ## [4.0.0] - 2022-04-08
12
- ### Changed
13
- - Added compability with serverless 3
14
-
15
- ## [3.1.2] - 2021-09-01
16
- ### Changed
17
- - Fixed y18n vulnerability
18
-
19
- ## [3.1.1] - 2021-09-01
20
- ### Changed
21
- - Added serverless schema validation. Thank you @ROSeaboyer ([53](https://github.com/amplify-education/serverless-vpc-discovery/pull/53))
22
-
23
- ## [3.1.0] - 2021-09-01
24
- ### Changed
25
- - Dropped support of node versions < 12
26
- - Replaced Travis pipeline items with GitHub workflow
27
-
28
- ## [3.0.0] - 2020-12-24
29
- ### Added
30
- - Support for getting subnets and security groups by any tag key/value
31
- ### Changed
32
- - ***Important!*** The `subnetNames` and `securityGroupNames` options have been deprecated and will be removed in the next major release. The new options are `subnets` and `securityGroups`.
33
- - ***Important!*** Drop `vpc` option support. The new option is `vpcDiscovery`.
34
-
35
- ## [2.3.0] - 2020-12-11
36
- ### Changed
37
- - Allow usage of wildcards in subnet and security group names. Thank you @RLRabinowitz ([#41](https://github.com/amplify-education/serverless-vpc-discovery/pull/41))
38
-
39
- ## [2.2.1] - 2020-12-02
40
- ### Changed
41
- - Fixed travis build
42
-
43
- ## [2.2.0] - 2020-12-02
44
- ### Changed
45
- - Set `custom.vpcDiscovery` optional.
46
- - Update travis config for github release tagging
47
-
48
- ## [2.1.0] - 2020-11-17
49
- ### Changed
50
- - ***Important!*** The `vpc` option has been deprecated but it still will work for a while. The new option is `vpcDiscovery`.
51
- - The VPC config applies to each function instead of the provider option.
52
- - Fixed logic for checking missing subnets and security groups.
53
- ### Added
54
- - A possibility to specify custom config for each function by specifying `function.vpcDiscovery` config
55
- - Added `warning` and `info` messages
56
-
57
- ## [2.0.0] - 2020-11-13
58
- ### Changed
59
- - The code rewritten to TypeScript. Added improvements. Updated travis config, lint and test scripts.
60
-
61
- ## [1.0.13] - 2018-10-10
62
- ### Added
63
- - Added our own configuration for AWS SDK's built in retry mechanism, increasing it from 3 retries to 20 so that this plugin is more easily used in an automated environment.
64
-
65
- ## [1.0.12] - 2018-08-01
66
- ### Added
67
- - This CHANGELOG file to make it easier for future updates to be documented. Sadly, will not be going back to document changes made for previous versions.