@middy/cloudwatch-metrics 3.1.0 → 3.2.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.
Files changed (3) hide show
  1. package/index.cjs +6 -4
  2. package/index.d.ts +9 -1
  3. package/package.json +6 -4
package/index.cjs CHANGED
@@ -2,8 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- module.exports = void 0;
6
- var _awsEmbeddedMetrics = _interopRequireDefault(require("aws-embedded-metrics"));
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: ()=>_default
8
+ });
9
+ const _awsEmbeddedMetrics = _interopRequireDefault(require("aws-embedded-metrics"));
7
10
  function _interopRequireDefault(obj) {
8
11
  return obj && obj.__esModule ? obj : {
9
12
  default: obj
@@ -35,8 +38,7 @@ const cloudwatchMetricsMiddleware = (opts = {})=>{
35
38
  after: cloudwatchMetricsAfter
36
39
  };
37
40
  };
38
- var _default = cloudwatchMetricsMiddleware;
39
- module.exports = _default;
41
+ const _default = cloudwatchMetricsMiddleware;
40
42
 
41
43
 
42
44
  //# sourceMappingURL=index.cjs.map
package/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import middy from '@middy/core'
2
+ import { MetricsLogger } from 'aws-embedded-metrics'
3
+ import type { Context as LambdaContext } from 'aws-lambda'
2
4
  export { MetricsLogger } from 'aws-embedded-metrics'
3
5
 
4
6
  interface Options {
@@ -6,6 +8,12 @@ interface Options {
6
8
  dimensions?: Array<Record<string, string>>
7
9
  }
8
10
 
9
- declare function cloudwatchMetrics (options?: Options): middy.MiddlewareObj
11
+ export type Context = LambdaContext & {
12
+ metrics: MetricsLogger
13
+ }
14
+
15
+ declare function cloudwatchMetrics (
16
+ options?: Options
17
+ ): middy.MiddlewareObj<unknown, any, Error, Context>
10
18
 
11
19
  export default cloudwatchMetrics
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/cloudwatch-metrics",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "Embedded CloudWatch metrics middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -11,6 +11,7 @@
11
11
  "access": "public"
12
12
  },
13
13
  "main": "./index.cjs",
14
+ "module": "./index.js",
14
15
  "exports": {
15
16
  ".": {
16
17
  "import": {
@@ -64,10 +65,11 @@
64
65
  },
65
66
  "homepage": "https://middy.js.org",
66
67
  "dependencies": {
67
- "aws-embedded-metrics": "2.0.5"
68
+ "aws-embedded-metrics": "3.0.1"
68
69
  },
69
70
  "devDependencies": {
70
- "@middy/core": "3.1.0"
71
+ "@middy/core": "3.2.1",
72
+ "@types/aws-lambda": "^8.10.101"
71
73
  },
72
- "gitHead": "d5284fd11c175516c189b6061fee7312106d9709"
74
+ "gitHead": "b4169ec20b798650e934a7c25ee80ae98d11e03a"
73
75
  }