serverless-offline 13.2.0 → 13.3.0

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/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.2.0",
4
+ "version": "13.3.0",
5
5
  "description": "Emulate AWS λ and API Gateway locally when developing your Serverless project",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -79,7 +79,7 @@
79
79
  ]
80
80
  },
81
81
  "dependencies": {
82
- "@aws-sdk/client-lambda": "^3.423.0",
82
+ "@aws-sdk/client-lambda": "^3.452.0",
83
83
  "@hapi/boom": "^10.0.1",
84
84
  "@hapi/h2o2": "^10.0.4",
85
85
  "@hapi/hapi": "^21.3.2",
@@ -92,12 +92,12 @@
92
92
  "fs-extra": "^11.1.1",
93
93
  "is-wsl": "^3.1.0",
94
94
  "java-invoke-local": "0.0.6",
95
- "jose": "^4.15.1",
95
+ "jose": "^5.1.1",
96
96
  "js-string-escape": "^1.0.1",
97
97
  "jsonpath-plus": "^7.2.0",
98
98
  "jsonschema": "^1.4.1",
99
99
  "jszip": "^3.10.1",
100
- "luxon": "^3.2.0",
100
+ "luxon": "^3.4.4",
101
101
  "node-schedule": "^2.1.1",
102
102
  "p-memoize": "^7.1.1",
103
103
  "p-retry": "^6.1.0",
@@ -107,19 +107,19 @@
107
107
  "devDependencies": {
108
108
  "@istanbuljs/esm-loader-hook": "^0.2.0",
109
109
  "archiver": "^6.0.1",
110
- "eslint": "^8.50.0",
110
+ "eslint": "^8.53.0",
111
111
  "eslint-config-airbnb-base": "^15.0.0",
112
112
  "eslint-config-prettier": "^9.0.0",
113
- "eslint-plugin-import": "^2.28.1",
114
- "eslint-plugin-prettier": "^5.0.0",
115
- "eslint-plugin-unicorn": "^48.0.1",
113
+ "eslint-plugin-import": "^2.29.0",
114
+ "eslint-plugin-prettier": "^5.0.1",
115
+ "eslint-plugin-unicorn": "^49.0.0",
116
116
  "git-list-updated": "^1.2.1",
117
117
  "husky": "^8.0.3",
118
- "lint-staged": "^14.0.1",
118
+ "lint-staged": "^15.1.0",
119
119
  "mocha": "^10.2.0",
120
120
  "nyc": "^15.1.0",
121
- "prettier": "^3.0.3",
122
- "serverless": "^3.35.2",
121
+ "prettier": "^3.1.0",
122
+ "serverless": "^3.36.0",
123
123
  "standard-version": "^9.5.0"
124
124
  },
125
125
  "peerDependencies": {
@@ -17,6 +17,7 @@ export const supportedNodejs = new Set([
17
17
  'nodejs14.x',
18
18
  'nodejs16.x',
19
19
  'nodejs18.x',
20
+ 'nodejs20.x',
20
21
  ])
21
22
 
22
23
  // PROVIDED
@@ -50,5 +51,6 @@ export const unsupportedDockerRuntimes = new Set([
50
51
  'nodejs14.x',
51
52
  'nodejs16.x',
52
53
  'nodejs18.x',
54
+ 'nodejs20.x',
53
55
  'python3.9',
54
56
  ])
@@ -46,11 +46,7 @@ export default class WebSocketAuthorizerEvent {
46
46
 
47
47
  return {
48
48
  headers,
49
- methodArn: `arn:aws:execute-api:${this.#provider.region}:${
50
- requestContext.accountId
51
- }:${requestContext.apiId}/${requestContext.stage}/${
52
- requestContext.routeKey
53
- }`,
49
+ methodArn: `arn:aws:execute-api:${this.#provider.region}:${requestContext.accountId}:${requestContext.apiId}/${requestContext.stage}/${requestContext.routeKey}`,
54
50
  multiValueHeaders,
55
51
  // NOTE: multiValueQueryStringParameters and queryStringParameters
56
52
  // properties are only defined if they have values
@@ -71,7 +71,7 @@ export default class LambdaFunction {
71
71
  // TEMP options.location, for compatibility with serverless-webpack:
72
72
  // https://github.com/dherault/serverless-offline/issues/787
73
73
  // TODO FIXME look into better way to work with serverless-webpack
74
- const servicepath = resolve(servicePath, options.location || '')
74
+ const servicepath = resolve(servicePath, options.location ?? '')
75
75
 
76
76
  const { handler, name, package: functionPackage = {} } = functionDefinition
77
77
 
@@ -81,8 +81,8 @@ export default class LambdaFunction {
81
81
  this.#handler = handler
82
82
 
83
83
  this.#memorySize =
84
- functionDefinition.memorySize ||
85
- provider.memorySize ||
84
+ functionDefinition.memorySize ??
85
+ provider.memorySize ??
86
86
  DEFAULT_LAMBDA_MEMORY_SIZE
87
87
 
88
88
  this.#noTimeout = options.noTimeout
@@ -90,11 +90,11 @@ export default class LambdaFunction {
90
90
  this.#region = provider.region
91
91
 
92
92
  this.#runtime =
93
- functionDefinition.runtime || provider.runtime || DEFAULT_LAMBDA_RUNTIME
93
+ functionDefinition.runtime ?? provider.runtime ?? DEFAULT_LAMBDA_RUNTIME
94
94
 
95
95
  this.#timeout =
96
- (functionDefinition.timeout ||
97
- provider.timeout ||
96
+ (functionDefinition.timeout ??
97
+ provider.timeout ??
98
98
  DEFAULT_LAMBDA_TIMEOUT) * 1000
99
99
 
100
100
  this.#verifySupportedRuntime()
@@ -176,9 +176,7 @@ export default class LambdaFunction {
176
176
  if (!supportedRuntimes.has(this.#runtime)) {
177
177
  log.warning()
178
178
  log.warning(
179
- `Warning: found unsupported runtime '${this.#runtime}' for function '${
180
- this.#functionKey
181
- }'`,
179
+ `Warning: found unsupported runtime '${this.#runtime}' for function '${this.#functionKey}'`,
182
180
  )
183
181
  }
184
182
  }
@@ -138,9 +138,7 @@ export default class DockerContainer {
138
138
  dockerArgs.push('-v', `${layerDir}:/opt:ro,delegated`)
139
139
  } else {
140
140
  log.warning(
141
- `Provider ${
142
- this.#provider.name
143
- } is Unsupported. Layers are only supported on aws.`,
141
+ `Provider ${this.#provider.name} is Unsupported. Layers are only supported on aws.`,
144
142
  )
145
143
  }
146
144
  }
@@ -255,9 +253,7 @@ export default class DockerContainer {
255
253
  !layer.CompatibleRuntimes.includes(this.#runtime)
256
254
  ) {
257
255
  log.warning(
258
- `[${layerName}] Layer is not compatible with ${
259
- this.#runtime
260
- } runtime`,
256
+ `[${layerName}] Layer is not compatible with ${this.#runtime} runtime`,
261
257
  )
262
258
 
263
259
  return
@@ -349,9 +345,7 @@ export default class DockerContainer {
349
345
  }
350
346
 
351
347
  async #ping() {
352
- const url = `http://${this.#dockerOptions.host}:${
353
- this.#port
354
- }/2018-06-01/ping`
348
+ const url = `http://${this.#dockerOptions.host}:${this.#port}/2018-06-01/ping`
355
349
  const res = await fetch(url)
356
350
 
357
351
  if (!res.ok) {
@@ -362,9 +356,7 @@ export default class DockerContainer {
362
356
  }
363
357
 
364
358
  async request(event) {
365
- const url = `http://${this.#dockerOptions.host}:${
366
- this.#port
367
- }/2015-03-31/functions/${this.#functionKey}/invocations`
359
+ const url = `http://${this.#dockerOptions.host}:${this.#port}/2015-03-31/functions/${this.#functionKey}/invocations`
368
360
 
369
361
  const res = await fetch(url, {
370
362
  body: stringify(event),