@gasket/plugin-elastic-apm 7.0.0-next.53 → 7.0.0-next.55

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/lib/actions.js CHANGED
@@ -1,21 +1,21 @@
1
- /** @type {import('@gasket/core').HookHandler<'actions'>} */
2
- module.exports = function actions(gasket) {
3
- return {
4
- async getApmTransaction(req) {
5
- const apm = require('elastic-apm-node');
1
+ /** @type {import('@gasket/core').ActionHandler<'getApmTransaction'>} */
2
+ async function getApmTransaction(gasket, req) {
3
+ const apm = require('elastic-apm-node');
6
4
 
7
- if (!apm?.isStarted()) {
8
- return;
9
- }
5
+ if (!apm?.isStarted()) {
6
+ return;
7
+ }
10
8
 
11
- const transaction = apm.currentTransaction;
12
- if (!transaction) {
13
- return;
14
- }
9
+ const transaction = apm.currentTransaction;
10
+ if (!transaction) {
11
+ return;
12
+ }
15
13
 
16
- await gasket.exec('apmTransaction', transaction, { req });
14
+ await gasket.exec('apmTransaction', transaction, { req });
17
15
 
18
- return transaction;
19
- }
20
- };
16
+ return transaction;
17
+ }
18
+
19
+ module.exports = {
20
+ getApmTransaction
21
21
  };
package/lib/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import type { IncomingMessage, ServerResponse } from 'http';
2
- import type { AgentConfigOptions, Transaction, Payload } from 'elastic-apm-node';
3
- import type { MaybeAsync, GasketConfig, GasketRequest, Plugin } from '@gasket/core';
4
- import type { GasketData } from '@gasket/data';
1
+ import type { IncomingMessage } from 'http';
2
+ import type { AgentConfigOptions, Transaction, Payload, Agent } from 'elastic-apm-node';
3
+ import type { MaybeAsync, GasketConfig, Plugin } from '@gasket/core';
5
4
  import type { Request } from 'express';
6
5
 
7
6
  export function filterSensitiveCookies(config: GasketConfig): function(Payload): Payload;
package/lib/index.js CHANGED
@@ -16,8 +16,8 @@ const plugin = {
16
16
  name,
17
17
  version,
18
18
  description,
19
+ actions,
19
20
  hooks: {
20
- actions,
21
21
  configure,
22
22
  create,
23
23
  middleware,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gasket/plugin-elastic-apm",
3
- "version": "7.0.0-next.53",
3
+ "version": "7.0.0-next.55",
4
4
  "description": "Adds Elastic APM instrumentation to your application",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -10,10 +10,9 @@
10
10
  "scripts": {
11
11
  "lint": "eslint .",
12
12
  "lint:fix": "npm run lint -- --fix",
13
- "test": "npm run test:runner",
14
- "test:runner": "jest test/*.test.js",
15
- "test:watch": "npm run test:runner -- --watch",
16
- "test:coverage": "npm run test:runner -- --coverage --coverageReporters text",
13
+ "test": "cross-env NODE_OPTIONS='--unhandled-rejections=strict' jest",
14
+ "test:watch": "npm run test -- --watch",
15
+ "test:coverage": "npm run test -- --coverage",
17
16
  "posttest": "npm run lint && npm run typecheck",
18
17
  "typecheck": "tsc",
19
18
  "typecheck:watch": "tsc --watch"
@@ -41,7 +40,7 @@
41
40
  },
42
41
  "homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-plugin-elastic-apm",
43
42
  "devDependencies": {
44
- "@gasket/core": "7.0.0-next.53",
43
+ "@gasket/core": "7.0.0-next.55",
45
44
  "dotenv": "^16.4.5",
46
45
  "elastic-apm-node": "^4.4.1",
47
46
  "eslint": "^8.56.0",
@@ -70,5 +69,5 @@
70
69
  "jest": {
71
70
  "testEnvironment": "node"
72
71
  },
73
- "gitHead": "243aa1f948f88a5066d687a02631a388eed97abb"
72
+ "gitHead": "84a2654cf25651972e1bfbb0a54cb9f330ecb3ad"
74
73
  }