@middy/warmup 3.0.1 → 3.0.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2022 Luciano Mammino, will Farrell and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
3
+ Copyright (c) 2017-2022 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell) and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -9,8 +9,8 @@
9
9
  <a href="https://packagephobia.com/result?p=@middy/warmup">
10
10
  <img src="https://packagephobia.com/badge?p=@middy/warmup" alt="npm install size" style="max-width:100%;">
11
11
  </a>
12
- <a href="https://github.com/middyjs/middy/actions">
13
- <img src="https://github.com/middyjs/middy/workflows/Tests/badge.svg" alt="GitHub Actions test status badge" style="max-width:100%;">
12
+ <a href="https://github.com/middyjs/middy/actions/workflows/tests.yml">
13
+ <img src="https://github.com/middyjs/middy/actions/workflows/tests.yml/badge.svg?branch=main&event=push" alt="GitHub Actions CI status badge" style="max-width:100%;">
14
14
  </a>
15
15
  <br/>
16
16
  <a href="https://standardjs.com/">
@@ -33,6 +33,7 @@
33
33
  <img src="https://img.shields.io/badge/StackOverflow-[middy]-yellow" alt="Ask questions on StackOverflow" style="max-width:100%;">
34
34
  </a>
35
35
  </p>
36
+ <p>You can read the documentation at: <a href="https://middy.js.org/docs/middlewares/warmup">https://middy.js.org/docs/middlewares/warmup</a></p>
36
37
  </div>
37
38
 
38
39
  Warmup middleware that helps to reduce the [cold-start issue](https://serverless.com/blog/keep-your-lambdas-warm/). Compatible by default with [`serverless-plugin-warmup`](https://www.npmjs.com/package/serverless-plugin-warmup), but it can be configured to suit your implementation.
@@ -91,7 +92,7 @@ Everyone is very welcome to contribute to this repository. Feel free to [raise i
91
92
 
92
93
  ## License
93
94
 
94
- Licensed under [MIT License](LICENSE). Copyright (c) 2017-2022 Luciano Mammino, will Farrell, and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
95
+ Licensed under [MIT License](LICENSE). Copyright (c) 2017-2022 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
95
96
 
96
97
  <a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
97
98
  <img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
package/index.cjs CHANGED
@@ -1,3 +1,27 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;const defaults={isWarmingUp:event=>event.source==="serverless-plugin-warmup"};const warmupMiddleware=opt=>{const options={...defaults,...opt};const warmupMiddlewareBefore=request=>{if(options.isWarmingUp(request.event)){return"warmup"}};return{before:warmupMiddlewareBefore}};var _default=warmupMiddleware;exports.default=_default
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ module.exports = void 0;
6
+ const defaults = {
7
+ isWarmingUp: (event)=>event.source === 'serverless-plugin-warmup'
8
+ };
9
+ const warmupMiddleware = (opt)=>{
10
+ const options = {
11
+ ...defaults,
12
+ ...opt
13
+ };
14
+ const warmupMiddlewareBefore = (request)=>{
15
+ if (options.isWarmingUp(request.event)) {
16
+ return 'warmup';
17
+ }
18
+ };
19
+ return {
20
+ before: warmupMiddlewareBefore
21
+ };
22
+ };
23
+ var _default = warmupMiddleware;
24
+ module.exports = _default;
25
+
2
26
 
3
27
  //# sourceMappingURL=index.cjs.map
package/index.js CHANGED
@@ -1,3 +1,21 @@
1
- const defaults={isWarmingUp:event=>event.source==="serverless-plugin-warmup"};const warmupMiddleware=opt=>{const options={...defaults,...opt};const warmupMiddlewareBefore=request=>{if(options.isWarmingUp(request.event)){return"warmup"}};return{before:warmupMiddlewareBefore}};export default warmupMiddleware
1
+ const defaults = {
2
+ isWarmingUp: (event)=>event.source === 'serverless-plugin-warmup'
3
+ };
4
+ const warmupMiddleware = (opt)=>{
5
+ const options = {
6
+ ...defaults,
7
+ ...opt
8
+ };
9
+ const warmupMiddlewareBefore = (request)=>{
10
+ if (options.isWarmingUp(request.event)) {
11
+ return 'warmup';
12
+ }
13
+ };
14
+ return {
15
+ before: warmupMiddlewareBefore
16
+ };
17
+ };
18
+ export default warmupMiddleware;
19
+
2
20
 
3
21
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/warmup",
3
- "version": "3.0.1",
3
+ "version": "3.0.4",
4
4
  "description": "Warmup (cold start mitigation) middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "homepage": "https://middy.js.org",
57
57
  "devDependencies": {
58
- "@middy/core": "^3.0.1"
58
+ "@middy/core": "3.0.4"
59
59
  },
60
- "gitHead": "797455e2c2be445867bc03597e0a2d5b0560c9de"
60
+ "gitHead": "3e9bc83e791f943c71cd7003fc27f0a3692d83a1"
61
61
  }