@middy/cloudwatch-metrics 3.0.0-alpha.7 → 3.0.0-alpha.8
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/index.cjs +3 -0
- package/index.js +1 -1
- package/package.json +12 -5
package/index.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _awsEmbeddedMetrics=_interopRequireDefault(require("aws-embedded-metrics"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}const defaults={};const cloudwatchMetricsMiddleware=(opts={})=>{const options={...defaults,...opts};const cloudwatchMetricsBefore=request=>{const metrics=_awsEmbeddedMetrics.default.createMetricsLogger();if(options.namespace){metrics.setNamespace(options.namespace)}if(options.dimensions){metrics.setDimensions(...options.dimensions)}Object.assign(request.context,{metrics})};const cloudwatchMetricsAfter=async request=>{await request.context.metrics.flush()};return{before:cloudwatchMetricsBefore,after:cloudwatchMetricsAfter}};var _default=cloudwatchMetricsMiddleware;exports.default=_default
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=index.cjs.map
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import awsEmbeddedMetrics from
|
|
1
|
+
import awsEmbeddedMetrics from"aws-embedded-metrics";const defaults={};const cloudwatchMetricsMiddleware=(opts={})=>{const options={...defaults,...opts};const cloudwatchMetricsBefore=request=>{const metrics=awsEmbeddedMetrics.createMetricsLogger();if(options.namespace){metrics.setNamespace(options.namespace)}if(options.dimensions){metrics.setDimensions(...options.dimensions)}Object.assign(request.context,{metrics})};const cloudwatchMetricsAfter=async request=>{await request.context.metrics.flush()};return{before:cloudwatchMetricsBefore,after:cloudwatchMetricsAfter}};export default cloudwatchMetricsMiddleware
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/cloudwatch-metrics",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.8",
|
|
4
4
|
"description": "Embedded CloudWatch metrics middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -10,10 +10,17 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"exports":
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./index.js",
|
|
16
|
+
"require": "./index.cjs",
|
|
17
|
+
"types": "./index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
14
20
|
"types": "index.d.ts",
|
|
15
21
|
"files": [
|
|
16
22
|
"index.js",
|
|
23
|
+
"index.cjs",
|
|
17
24
|
"index.d.ts"
|
|
18
25
|
],
|
|
19
26
|
"scripts": {
|
|
@@ -49,12 +56,12 @@
|
|
|
49
56
|
"bugs": {
|
|
50
57
|
"url": "https://github.com/middyjs/middy/issues"
|
|
51
58
|
},
|
|
52
|
-
"homepage": "https://
|
|
59
|
+
"homepage": "https://middy.js.org",
|
|
53
60
|
"dependencies": {
|
|
54
61
|
"aws-embedded-metrics": "2.0.4"
|
|
55
62
|
},
|
|
56
63
|
"devDependencies": {
|
|
57
|
-
"@middy/core": "^3.0.0-alpha.
|
|
64
|
+
"@middy/core": "^3.0.0-alpha.8"
|
|
58
65
|
},
|
|
59
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "c04b3a0c2f326906b34973878d6f823778a5ea99"
|
|
60
67
|
}
|