@middy/warmup 7.0.3 → 7.1.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
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
- <h1>Middy warmup middleware</h1>
3
- <img alt="Middy logo" src="https://raw.githubusercontent.com/middyjs/middy/main/img/middy-logo.svg"/>
2
+ <h1>Middy `warmup` middleware</h1>
3
+ <img alt="Middy logo" src="https://raw.githubusercontent.com/middyjs/middy/main/docs/img/middy-logo.svg"/>
4
4
  <p><strong>Warmup middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda</strong></p>
5
5
  <p>
6
6
  <a href="https://github.com/middyjs/middy/actions/workflows/test-unit.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-unit.yml/badge.svg" alt="GitHub Actions unit test status"></a>
package/index.d.ts CHANGED
@@ -2,9 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import type middy from "@middy/core";
4
4
 
5
- interface Options {
5
+ export interface Options {
6
6
  isWarmingUp?: (event: any) => boolean;
7
- onWarmup?: (event: any) => void;
8
7
  }
9
8
 
10
9
  declare function warmup(options?: Options): middy.MiddlewareObj;
package/index.js CHANGED
@@ -4,8 +4,8 @@ const defaults = {
4
4
  isWarmingUp: (event) => event.source === "serverless-plugin-warmup",
5
5
  };
6
6
 
7
- const warmupMiddleware = (opt) => {
8
- const options = { ...defaults, ...opt };
7
+ const warmupMiddleware = (opts = {}) => {
8
+ const options = { ...defaults, ...opts };
9
9
 
10
10
  const warmupMiddlewareBefore = (request) => {
11
11
  if (options.isWarmingUp(request.event)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/warmup",
3
- "version": "7.0.3",
3
+ "version": "7.1.1",
4
4
  "description": "Warmup (cold start mitigation) middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -65,7 +65,8 @@
65
65
  "url": "https://github.com/sponsors/willfarrell"
66
66
  },
67
67
  "devDependencies": {
68
- "@middy/core": "7.0.3"
68
+ "@middy/core": "7.1.1",
69
+ "@types/aws-lambda": "^8.0.0"
69
70
  },
70
71
  "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
71
72
  }