serverless-offline 13.3.0 → 13.3.1

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/README.md CHANGED
@@ -835,7 +835,7 @@ For example:
835
835
  plugins:
836
836
  - serverless-middleware # modifies some of your handler based on configuration
837
837
  - serverless-webpack # package your javascript handlers using webpack
838
- - serverless-dynamodb-local # adds a local dynamo db
838
+ - serverless-dynamodb # adds a local dynamo db
839
839
  - serverless-offline # runs last so your code has been pre-processed and dynamo is ready
840
840
  ```
841
841
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dedicatedTo": "Blue, a great migrating bird.",
3
3
  "name": "serverless-offline",
4
- "version": "13.3.0",
4
+ "version": "13.3.1",
5
5
  "description": "Emulate AWS λ and API Gateway locally when developing your Serverless project",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -10,19 +10,13 @@
10
10
  },
11
11
  "type": "module",
12
12
  "scripts": {
13
- "format": "eslint . --fix",
14
13
  "lint": "eslint .",
15
- "lint:updated": "pipe-git-updated --ext=js -- eslint",
14
+ "lint:fix": "eslint . --fix",
16
15
  "list-contributors": "echo 'clone https://github.com/mgechev/github-contributors-list.git first, then run npm install' && cd ../github-contributors-list && node bin/githubcontrib --owner dherault --repo serverless-offline --sortBy contributions --showlogin true --sortOrder desc > contributors.md",
17
- "prepare": "husky install",
18
- "prepare-release": "standard-version && prettier --write CHANGELOG.md",
16
+ "prepare-release": "commit-and-tag-version && prettier --write CHANGELOG.md",
19
17
  "prepublishOnly": "npm run lint",
20
18
  "prettier": "prettier --check .",
21
19
  "prettier:fix": "prettier --write .",
22
- "prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
23
- "prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
24
- "prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
25
- "prettify:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
26
20
  "test": "mocha --require ./tests/mochaHooks.cjs",
27
21
  "test:cov": "NODE_OPTIONS='--experimental-loader @istanbuljs/esm-loader-hook' nyc --reporter=html npm test",
28
22
  "test:node": "TEST=unit mocha --require ./tests/mochaHooks.cjs",
@@ -54,7 +48,7 @@
54
48
  "engines": {
55
49
  "node": ">=18.12.0"
56
50
  },
57
- "standard-version": {
51
+ "commit-and-tag-version": {
58
52
  "skip": {
59
53
  "commit": true,
60
54
  "tag": true
@@ -79,7 +73,7 @@
79
73
  ]
80
74
  },
81
75
  "dependencies": {
82
- "@aws-sdk/client-lambda": "^3.452.0",
76
+ "@aws-sdk/client-lambda": "^3.468.0",
83
77
  "@hapi/boom": "^10.0.1",
84
78
  "@hapi/h2o2": "^10.0.4",
85
79
  "@hapi/hapi": "^21.3.2",
@@ -89,10 +83,10 @@
89
83
  "chalk": "^5.3.0",
90
84
  "desm": "^1.3.0",
91
85
  "execa": "^8.0.1",
92
- "fs-extra": "^11.1.1",
86
+ "fs-extra": "^11.2.0",
93
87
  "is-wsl": "^3.1.0",
94
88
  "java-invoke-local": "0.0.6",
95
- "jose": "^5.1.1",
89
+ "jose": "^5.1.2",
96
90
  "js-string-escape": "^1.0.1",
97
91
  "jsonpath-plus": "^7.2.0",
98
92
  "jsonschema": "^1.4.1",
@@ -107,20 +101,17 @@
107
101
  "devDependencies": {
108
102
  "@istanbuljs/esm-loader-hook": "^0.2.0",
109
103
  "archiver": "^6.0.1",
110
- "eslint": "^8.53.0",
104
+ "commit-and-tag-version": "^12.0.0",
105
+ "eslint": "^8.55.0",
111
106
  "eslint-config-airbnb-base": "^15.0.0",
112
- "eslint-config-prettier": "^9.0.0",
107
+ "eslint-config-prettier": "^9.1.0",
113
108
  "eslint-plugin-import": "^2.29.0",
114
109
  "eslint-plugin-prettier": "^5.0.1",
115
110
  "eslint-plugin-unicorn": "^49.0.0",
116
- "git-list-updated": "^1.2.1",
117
- "husky": "^8.0.3",
118
- "lint-staged": "^15.1.0",
119
111
  "mocha": "^10.2.0",
120
112
  "nyc": "^15.1.0",
121
113
  "prettier": "^3.1.0",
122
- "serverless": "^3.36.0",
123
- "standard-version": "^9.5.0"
114
+ "serverless": "^3.38.0"
124
115
  },
125
116
  "peerDependencies": {
126
117
  "serverless": "^3.2.0"
@@ -748,33 +748,34 @@ export default class HttpServer {
748
748
  // If there is a responseTemplate, we apply it to the result
749
749
  const { responseTemplates } = chosenResponse
750
750
 
751
- if (typeof responseTemplates === 'object') {
752
- if (keys(responseTemplates).length > 0) {
753
- // BAD IMPLEMENTATION: first key in responseTemplates
754
- const responseTemplate = responseTemplates[responseContentType]
755
-
756
- if (responseTemplate && responseTemplate !== '\n') {
757
- log.debug('_____ RESPONSE TEMPLATE PROCCESSING _____')
758
- log.debug(`Using responseTemplate '${responseContentType}'`)
759
-
760
- try {
761
- const reponseContext = new VelocityContext(
762
- request,
763
- stage,
764
- result,
765
- ).getContext()
766
-
767
- result = renderVelocityTemplateObject(
768
- {
769
- root: responseTemplate,
770
- },
771
- reponseContext,
772
- ).root
773
- } catch (error) {
774
- log.error(
775
- `Error while parsing responseTemplate '${responseContentType}' for lambda ${functionKey}:\n${error.stack}`,
776
- )
777
- }
751
+ if (
752
+ typeof responseTemplates === 'object' &&
753
+ keys(responseTemplates).length > 0
754
+ ) {
755
+ // BAD IMPLEMENTATION: first key in responseTemplates
756
+ const responseTemplate = responseTemplates[responseContentType]
757
+
758
+ if (responseTemplate && responseTemplate !== '\n') {
759
+ log.debug('_____ RESPONSE TEMPLATE PROCCESSING _____')
760
+ log.debug(`Using responseTemplate '${responseContentType}'`)
761
+
762
+ try {
763
+ const reponseContext = new VelocityContext(
764
+ request,
765
+ stage,
766
+ result,
767
+ ).getContext()
768
+
769
+ result = renderVelocityTemplateObject(
770
+ {
771
+ root: responseTemplate,
772
+ },
773
+ reponseContext,
774
+ ).root
775
+ } catch (error) {
776
+ log.error(
777
+ `Error while parsing responseTemplate '${responseContentType}' for lambda ${functionKey}:\n${error.stack}`,
778
+ )
778
779
  }
779
780
  }
780
781
  }
@@ -70,10 +70,8 @@ export default class InvocationsController {
70
70
  }
71
71
 
72
72
  // Checking if the result of the Lambda Invoke is a primitive string to wrap it. this is for future post-processing such as Step Functions Tasks
73
- if (result) {
74
- if (typeof result === 'string') {
75
- result = `"${result}"`
76
- }
73
+ if (result && typeof result === 'string') {
74
+ result = `"${result}"`
77
75
  }
78
76
 
79
77
  // result is actually the Payload.