@sentry/node 8.0.0-alpha.1 → 8.0.0-alpha.3
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 +14 -93
- package/cjs/index.js +3665 -77
- package/cjs/index.js.map +1 -1
- package/esm/index.js +3614 -31
- package/esm/index.js.map +1 -1
- package/esm/integrations/anr/worker-script.js +2 -2
- package/esm/package.json +1 -0
- package/package.json +21 -6
- package/types/index.d.ts +6 -5
- package/types/index.d.ts.map +1 -1
- package/types/integrations/anr/index.d.ts.map +1 -1
- package/types/integrations/anr/worker-script.d.ts +1 -1
- package/types/integrations/anr/worker-script.d.ts.map +1 -1
- package/types/integrations/http.d.ts +4 -0
- package/types/integrations/http.d.ts.map +1 -1
- package/types/integrations/local-variables/common.d.ts +1 -0
- package/types/integrations/local-variables/common.d.ts.map +1 -1
- package/types/integrations/local-variables/local-variables-sync.d.ts +1 -0
- package/types/integrations/local-variables/local-variables-sync.d.ts.map +1 -1
- package/types/integrations/tracing/fastify.d.ts +9 -0
- package/types/integrations/tracing/fastify.d.ts.map +1 -1
- package/types/integrations/tracing/hapi/index.d.ts.map +1 -1
- package/types/integrations/tracing/prisma.d.ts.map +1 -1
- package/types/proxy/helpers.d.ts +2 -2
- package/types/proxy/helpers.d.ts.map +1 -1
- package/types/proxy/index.d.ts.map +1 -1
- package/types/sdk/hub.d.ts.map +1 -1
- package/types/sdk/init.d.ts.map +1 -1
- package/types/transports/http-module.d.ts +2 -2
- package/types/transports/http-module.d.ts.map +1 -1
- package/types/types.d.ts +12 -4
- package/types/types.d.ts.map +1 -1
- package/types-ts3.8/index.d.ts +6 -5
- package/types-ts3.8/integrations/anr/worker-script.d.ts +1 -1
- package/types-ts3.8/integrations/http.d.ts +4 -0
- package/types-ts3.8/integrations/local-variables/common.d.ts +1 -0
- package/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +1 -0
- package/types-ts3.8/integrations/tracing/fastify.d.ts +9 -0
- package/types-ts3.8/proxy/helpers.d.ts +2 -2
- package/types-ts3.8/transports/http-module.d.ts +2 -2
- package/types-ts3.8/types.d.ts +12 -4
- package/cjs/cron/common.js +0 -56
- package/cjs/cron/common.js.map +0 -1
- package/cjs/cron/cron.js +0 -102
- package/cjs/cron/cron.js.map +0 -1
- package/cjs/cron/index.js +0 -15
- package/cjs/cron/index.js.map +0 -1
- package/cjs/cron/node-cron.js +0 -61
- package/cjs/cron/node-cron.js.map +0 -1
- package/cjs/cron/node-schedule.js +0 -57
- package/cjs/cron/node-schedule.js.map +0 -1
- package/cjs/debug-build.js +0 -11
- package/cjs/debug-build.js.map +0 -1
- package/cjs/integrations/anr/index.js +0 -145
- package/cjs/integrations/anr/index.js.map +0 -1
- package/cjs/integrations/anr/worker-script.js +0 -2
- package/cjs/integrations/anr/worker-script.js.map +0 -1
- package/cjs/integrations/console.js +0 -40
- package/cjs/integrations/console.js.map +0 -1
- package/cjs/integrations/context.js +0 -435
- package/cjs/integrations/context.js.map +0 -1
- package/cjs/integrations/contextlines.js +0 -137
- package/cjs/integrations/contextlines.js.map +0 -1
- package/cjs/integrations/http.js +0 -137
- package/cjs/integrations/http.js.map +0 -1
- package/cjs/integrations/local-variables/common.js +0 -87
- package/cjs/integrations/local-variables/common.js.map +0 -1
- package/cjs/integrations/local-variables/index.js +0 -8
- package/cjs/integrations/local-variables/index.js.map +0 -1
- package/cjs/integrations/local-variables/local-variables-sync.js +0 -400
- package/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/cjs/integrations/modules.js +0 -99
- package/cjs/integrations/modules.js.map +0 -1
- package/cjs/integrations/node-fetch.js +0 -82
- package/cjs/integrations/node-fetch.js.map +0 -1
- package/cjs/integrations/onuncaughtexception.js +0 -137
- package/cjs/integrations/onuncaughtexception.js.map +0 -1
- package/cjs/integrations/onunhandledrejection.js +0 -90
- package/cjs/integrations/onunhandledrejection.js.map +0 -1
- package/cjs/integrations/spotlight.js +0 -109
- package/cjs/integrations/spotlight.js.map +0 -1
- package/cjs/integrations/tracing/express.js +0 -103
- package/cjs/integrations/tracing/express.js.map +0 -1
- package/cjs/integrations/tracing/fastify.js +0 -33
- package/cjs/integrations/tracing/fastify.js.map +0 -1
- package/cjs/integrations/tracing/graphql.js +0 -34
- package/cjs/integrations/tracing/graphql.js.map +0 -1
- package/cjs/integrations/tracing/hapi/index.js +0 -81
- package/cjs/integrations/tracing/hapi/index.js.map +0 -1
- package/cjs/integrations/tracing/index.js +0 -37
- package/cjs/integrations/tracing/index.js.map +0 -1
- package/cjs/integrations/tracing/koa.js +0 -21
- package/cjs/integrations/tracing/koa.js.map +0 -1
- package/cjs/integrations/tracing/mongo.js +0 -33
- package/cjs/integrations/tracing/mongo.js.map +0 -1
- package/cjs/integrations/tracing/mongoose.js +0 -33
- package/cjs/integrations/tracing/mongoose.js.map +0 -1
- package/cjs/integrations/tracing/mysql.js +0 -26
- package/cjs/integrations/tracing/mysql.js.map +0 -1
- package/cjs/integrations/tracing/mysql2.js +0 -33
- package/cjs/integrations/tracing/mysql2.js.map +0 -1
- package/cjs/integrations/tracing/nest.js +0 -26
- package/cjs/integrations/tracing/nest.js.map +0 -1
- package/cjs/integrations/tracing/postgres.js +0 -34
- package/cjs/integrations/tracing/postgres.js.map +0 -1
- package/cjs/integrations/tracing/prisma.js +0 -33
- package/cjs/integrations/tracing/prisma.js.map +0 -1
- package/cjs/nodeVersion.js +0 -12
- package/cjs/nodeVersion.js.map +0 -1
- package/cjs/otel/contextManager.js +0 -16
- package/cjs/otel/contextManager.js.map +0 -1
- package/cjs/proxy/base.js +0 -126
- package/cjs/proxy/base.js.map +0 -1
- package/cjs/proxy/index.js +0 -209
- package/cjs/proxy/index.js.map +0 -1
- package/cjs/proxy/parse-proxy-response.js +0 -104
- package/cjs/proxy/parse-proxy-response.js.map +0 -1
- package/cjs/sdk/api.js +0 -74
- package/cjs/sdk/api.js.map +0 -1
- package/cjs/sdk/client.js +0 -57
- package/cjs/sdk/client.js.map +0 -1
- package/cjs/sdk/hub.js +0 -104
- package/cjs/sdk/hub.js.map +0 -1
- package/cjs/sdk/init.js +0 -224
- package/cjs/sdk/init.js.map +0 -1
- package/cjs/sdk/initOtel.js +0 -70
- package/cjs/sdk/initOtel.js.map +0 -1
- package/cjs/sdk/scope.js +0 -18
- package/cjs/sdk/scope.js.map +0 -1
- package/cjs/transports/http.js +0 -160
- package/cjs/transports/http.js.map +0 -1
- package/cjs/utils/addOriginToSpan.js +0 -11
- package/cjs/utils/addOriginToSpan.js.map +0 -1
- package/cjs/utils/errorhandling.js +0 -44
- package/cjs/utils/errorhandling.js.map +0 -1
- package/cjs/utils/getRequestUrl.js +0 -18
- package/cjs/utils/getRequestUrl.js.map +0 -1
- package/cjs/utils/module.js +0 -62
- package/cjs/utils/module.js.map +0 -1
- package/esm/cron/common.js +0 -54
- package/esm/cron/common.js.map +0 -1
- package/esm/cron/cron.js +0 -100
- package/esm/cron/cron.js.map +0 -1
- package/esm/cron/index.js +0 -13
- package/esm/cron/index.js.map +0 -1
- package/esm/cron/node-cron.js +0 -56
- package/esm/cron/node-cron.js.map +0 -1
- package/esm/cron/node-schedule.js +0 -55
- package/esm/cron/node-schedule.js.map +0 -1
- package/esm/debug-build.js +0 -9
- package/esm/debug-build.js.map +0 -1
- package/esm/integrations/anr/index.js +0 -139
- package/esm/integrations/anr/index.js.map +0 -1
- package/esm/integrations/anr/worker-script.js.map +0 -1
- package/esm/integrations/console.js +0 -38
- package/esm/integrations/console.js.map +0 -1
- package/esm/integrations/context.js +0 -427
- package/esm/integrations/context.js.map +0 -1
- package/esm/integrations/contextlines.js +0 -131
- package/esm/integrations/contextlines.js.map +0 -1
- package/esm/integrations/http.js +0 -132
- package/esm/integrations/http.js.map +0 -1
- package/esm/integrations/local-variables/common.js +0 -81
- package/esm/integrations/local-variables/common.js.map +0 -1
- package/esm/integrations/local-variables/index.js +0 -6
- package/esm/integrations/local-variables/index.js.map +0 -1
- package/esm/integrations/local-variables/local-variables-sync.js +0 -394
- package/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/esm/integrations/modules.js +0 -97
- package/esm/integrations/modules.js.map +0 -1
- package/esm/integrations/node-fetch.js +0 -80
- package/esm/integrations/node-fetch.js.map +0 -1
- package/esm/integrations/onuncaughtexception.js +0 -134
- package/esm/integrations/onuncaughtexception.js.map +0 -1
- package/esm/integrations/onunhandledrejection.js +0 -87
- package/esm/integrations/onunhandledrejection.js.map +0 -1
- package/esm/integrations/spotlight.js +0 -106
- package/esm/integrations/spotlight.js.map +0 -1
- package/esm/integrations/tracing/express.js +0 -96
- package/esm/integrations/tracing/express.js.map +0 -1
- package/esm/integrations/tracing/fastify.js +0 -31
- package/esm/integrations/tracing/fastify.js.map +0 -1
- package/esm/integrations/tracing/graphql.js +0 -32
- package/esm/integrations/tracing/graphql.js.map +0 -1
- package/esm/integrations/tracing/hapi/index.js +0 -77
- package/esm/integrations/tracing/hapi/index.js.map +0 -1
- package/esm/integrations/tracing/index.js +0 -35
- package/esm/integrations/tracing/index.js.map +0 -1
- package/esm/integrations/tracing/koa.js +0 -19
- package/esm/integrations/tracing/koa.js.map +0 -1
- package/esm/integrations/tracing/mongo.js +0 -31
- package/esm/integrations/tracing/mongo.js.map +0 -1
- package/esm/integrations/tracing/mongoose.js +0 -31
- package/esm/integrations/tracing/mongoose.js.map +0 -1
- package/esm/integrations/tracing/mysql.js +0 -24
- package/esm/integrations/tracing/mysql.js.map +0 -1
- package/esm/integrations/tracing/mysql2.js +0 -31
- package/esm/integrations/tracing/mysql2.js.map +0 -1
- package/esm/integrations/tracing/nest.js +0 -24
- package/esm/integrations/tracing/nest.js.map +0 -1
- package/esm/integrations/tracing/postgres.js +0 -32
- package/esm/integrations/tracing/postgres.js.map +0 -1
- package/esm/integrations/tracing/prisma.js +0 -31
- package/esm/integrations/tracing/prisma.js.map +0 -1
- package/esm/nodeVersion.js +0 -9
- package/esm/nodeVersion.js.map +0 -1
- package/esm/otel/contextManager.js +0 -14
- package/esm/otel/contextManager.js.map +0 -1
- package/esm/proxy/base.js +0 -121
- package/esm/proxy/base.js.map +0 -1
- package/esm/proxy/index.js +0 -203
- package/esm/proxy/index.js.map +0 -1
- package/esm/proxy/parse-proxy-response.js +0 -102
- package/esm/proxy/parse-proxy-response.js.map +0 -1
- package/esm/sdk/api.js +0 -69
- package/esm/sdk/api.js.map +0 -1
- package/esm/sdk/client.js +0 -52
- package/esm/sdk/client.js.map +0 -1
- package/esm/sdk/hub.js +0 -102
- package/esm/sdk/hub.js.map +0 -1
- package/esm/sdk/init.js +0 -221
- package/esm/sdk/init.js.map +0 -1
- package/esm/sdk/initOtel.js +0 -67
- package/esm/sdk/initOtel.js.map +0 -1
- package/esm/sdk/scope.js +0 -16
- package/esm/sdk/scope.js.map +0 -1
- package/esm/transports/http.js +0 -155
- package/esm/transports/http.js.map +0 -1
- package/esm/utils/addOriginToSpan.js +0 -9
- package/esm/utils/addOriginToSpan.js.map +0 -1
- package/esm/utils/errorhandling.js +0 -42
- package/esm/utils/errorhandling.js.map +0 -1
- package/esm/utils/getRequestUrl.js +0 -16
- package/esm/utils/getRequestUrl.js.map +0 -1
- package/esm/utils/module.js +0 -60
- package/esm/utils/module.js.map +0 -1
- package/types/integrations/local-variables/local-variables-async.d.ts +0 -14
- package/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
- package/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -14
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addOriginToSpan.js","sources":["../../../src/utils/addOriginToSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { _INTERNAL } from '@sentry/opentelemetry';\nimport type { SpanOrigin } from '@sentry/types';\n\n/** Adds an origin to an OTEL Span. */\nexport function addOriginToSpan(span: Span, origin: SpanOrigin): void {\n _INTERNAL.addOriginToSpan(span, origin);\n}\n"],"names":[],"mappings":";;AAIA;AACO,SAAS,eAAe,CAAC,IAAI,EAAQ,MAAM,EAAoB;AACtE,EAAE,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AACzC;;;;"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { getClient } from '@sentry/core';
|
|
2
|
-
import { consoleSandbox, logger } from '@sentry/utils';
|
|
3
|
-
import { DEBUG_BUILD } from '../debug-build.js';
|
|
4
|
-
|
|
5
|
-
const DEFAULT_SHUTDOWN_TIMEOUT = 2000;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
function logAndExitProcess(error) {
|
|
11
|
-
consoleSandbox(() => {
|
|
12
|
-
// eslint-disable-next-line no-console
|
|
13
|
-
console.error(error);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const client = getClient();
|
|
17
|
-
|
|
18
|
-
if (client === undefined) {
|
|
19
|
-
DEBUG_BUILD && logger.warn('No NodeClient was defined, we are exiting the process now.');
|
|
20
|
-
global.process.exit(1);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const options = client.getOptions();
|
|
25
|
-
const timeout =
|
|
26
|
-
(options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||
|
|
27
|
-
DEFAULT_SHUTDOWN_TIMEOUT;
|
|
28
|
-
client.close(timeout).then(
|
|
29
|
-
(result) => {
|
|
30
|
-
if (!result) {
|
|
31
|
-
DEBUG_BUILD && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');
|
|
32
|
-
}
|
|
33
|
-
global.process.exit(1);
|
|
34
|
-
},
|
|
35
|
-
error => {
|
|
36
|
-
DEBUG_BUILD && logger.error(error);
|
|
37
|
-
},
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { logAndExitProcess };
|
|
42
|
-
//# sourceMappingURL=errorhandling.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorhandling.js","sources":["../../../src/utils/errorhandling.ts"],"sourcesContent":["import { getClient } from '@sentry/core';\nimport { consoleSandbox, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { NodeClient } from '../sdk/client';\n\nconst DEFAULT_SHUTDOWN_TIMEOUT = 2000;\n\n/**\n * @hidden\n */\nexport function logAndExitProcess(error: Error): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n const client = getClient<NodeClient>();\n\n if (client === undefined) {\n DEBUG_BUILD && logger.warn('No NodeClient was defined, we are exiting the process now.');\n global.process.exit(1);\n return;\n }\n\n const options = client.getOptions();\n const timeout =\n (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||\n DEFAULT_SHUTDOWN_TIMEOUT;\n client.close(timeout).then(\n (result: boolean) => {\n if (!result) {\n DEBUG_BUILD && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');\n }\n global.process.exit(1);\n },\n error => {\n DEBUG_BUILD && logger.error(error);\n },\n );\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,wBAAA,GAA2B,IAAI,CAAA;AACrC;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,KAAK,EAAe;AACtD,EAAE,cAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AACxB,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,MAAM,MAAA,GAAS,SAAS,EAAc,CAAA;AACxC;AACA,EAAE,IAAI,MAAO,KAAI,SAAS,EAAE;AAC5B,IAAI,eAAe,MAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAA;AAC5F,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAC1B,IAAI,OAAM;AACV,GAAE;AACF;AACA,EAAE,MAAM,OAAQ,GAAE,MAAM,CAAC,UAAU,EAAE,CAAA;AACrC,EAAE,MAAM,OAAQ;AAChB,IAAI,CAAC,OAAQ,IAAG,OAAO,CAAC,mBAAmB,OAAO,CAAC,eAAA,GAAkB,CAAE,IAAG,OAAO,CAAC,eAAe;AACjG,IAAI,wBAAwB,CAAA;AAC5B,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI;AAC5B,IAAI,CAAC,MAAM,KAAc;AACzB,MAAM,IAAI,CAAC,MAAM,EAAE;AACnB,QAAQ,eAAe,MAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAA;AAChH,OAAM;AACN,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAC5B,KAAK;AACL,IAAI,SAAS;AACb,MAAM,eAAe,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AACxC,KAAK;AACL,GAAG,CAAA;AACH;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** Build a full URL from request options. */
|
|
2
|
-
function getRequestUrl(requestOptions) {
|
|
3
|
-
const protocol = requestOptions.protocol || '';
|
|
4
|
-
const hostname = requestOptions.hostname || requestOptions.host || '';
|
|
5
|
-
// Don't log standard :80 (http) and :443 (https) ports to reduce the noise
|
|
6
|
-
// Also don't add port if the hostname already includes a port
|
|
7
|
-
const port =
|
|
8
|
-
!requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname)
|
|
9
|
-
? ''
|
|
10
|
-
: `:${requestOptions.port}`;
|
|
11
|
-
const path = requestOptions.path ? requestOptions.path : '/';
|
|
12
|
-
return `${protocol}//${hostname}${port}${path}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { getRequestUrl };
|
|
16
|
-
//# sourceMappingURL=getRequestUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestUrl.js","sources":["../../../src/utils/getRequestUrl.ts"],"sourcesContent":["import type { RequestOptions } from 'http';\n\n/** Build a full URL from request options. */\nexport function getRequestUrl(requestOptions: RequestOptions): string {\n const protocol = requestOptions.protocol || '';\n const hostname = requestOptions.hostname || requestOptions.host || '';\n // Don't log standard :80 (http) and :443 (https) ports to reduce the noise\n // Also don't add port if the hostname already includes a port\n const port =\n !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\\d+)$/.test(hostname)\n ? ''\n : `:${requestOptions.port}`;\n const path = requestOptions.path ? requestOptions.path : '/';\n return `${protocol}//${hostname}${port}${path}`;\n}\n"],"names":[],"mappings":"AAEA;AACO,SAAS,aAAa,CAAC,cAAc,EAA0B;AACtE,EAAE,MAAM,QAAS,GAAE,cAAc,CAAC,QAAA,IAAY,EAAE,CAAA;AAChD,EAAE,MAAM,QAAS,GAAE,cAAc,CAAC,QAAS,IAAG,cAAc,CAAC,IAAK,IAAG,EAAE,CAAA;AACvE;AACA;AACA,EAAE,MAAM,IAAK;AACb,IAAI,CAAC,cAAc,CAAC,IAAA,IAAQ,cAAc,CAAC,SAAS,EAAA,IAAM,cAAc,CAAC,SAAS,GAAA,IAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAA;AACrH,QAAQ,EAAA;AACR,QAAQ,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,cAAA,CAAA,IAAA,GAAA,cAAA,CAAA,IAAA,GAAA,GAAA,CAAA;AACA,EAAA,OAAA,CAAA,EAAA,QAAA,CAAA,EAAA,EAAA,QAAA,CAAA,EAAA,IAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;;;"}
|
package/esm/utils/module.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { posix, sep } from 'path';
|
|
2
|
-
import { dirname } from '@sentry/utils';
|
|
3
|
-
|
|
4
|
-
/** normalizes Windows paths */
|
|
5
|
-
function normalizeWindowsPath(path) {
|
|
6
|
-
return path
|
|
7
|
-
.replace(/^[A-Z]:/, '') // remove Windows-style prefix
|
|
8
|
-
.replace(/\\/g, '/'); // replace all `\` instances with `/`
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Creates a function that gets the module name from a filename */
|
|
12
|
-
function createGetModuleFromFilename(
|
|
13
|
-
basePath = process.argv[1] ? dirname(process.argv[1]) : process.cwd(),
|
|
14
|
-
isWindows = sep === '\\',
|
|
15
|
-
) {
|
|
16
|
-
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
17
|
-
|
|
18
|
-
return (filename) => {
|
|
19
|
-
if (!filename) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
24
|
-
|
|
25
|
-
// eslint-disable-next-line prefer-const
|
|
26
|
-
let { dir, base: file, ext } = posix.parse(normalizedFilename);
|
|
27
|
-
|
|
28
|
-
if (ext === '.js' || ext === '.mjs' || ext === '.cjs') {
|
|
29
|
-
file = file.slice(0, ext.length * -1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (!dir) {
|
|
33
|
-
// No dirname whatsoever
|
|
34
|
-
dir = '.';
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const n = dir.lastIndexOf('/node_modules');
|
|
38
|
-
if (n > -1) {
|
|
39
|
-
return `${dir.slice(n + 14).replace(/\//g, '.')}:${file}`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Let's see if it's a part of the main module
|
|
43
|
-
// To be a part of main module, it has to share the same base
|
|
44
|
-
if (dir.startsWith(normalizedBase)) {
|
|
45
|
-
let moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, '.');
|
|
46
|
-
|
|
47
|
-
if (moduleName) {
|
|
48
|
-
moduleName += ':';
|
|
49
|
-
}
|
|
50
|
-
moduleName += file;
|
|
51
|
-
|
|
52
|
-
return moduleName;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return file;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export { createGetModuleFromFilename };
|
|
60
|
-
//# sourceMappingURL=module.js.map
|
package/esm/utils/module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../src/utils/module.ts"],"sourcesContent":["import { posix, sep } from 'path';\nimport { dirname } from '@sentry/utils';\n\n/** normalizes Windows paths */\nfunction normalizeWindowsPath(path: string): string {\n return path\n .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n .replace(/\\\\/g, '/'); // replace all `\\` instances with `/`\n}\n\n/** Creates a function that gets the module name from a filename */\nexport function createGetModuleFromFilename(\n basePath: string = process.argv[1] ? dirname(process.argv[1]) : process.cwd(),\n isWindows: boolean = sep === '\\\\',\n): (filename: string | undefined) => string | undefined {\n const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;\n\n return (filename: string | undefined) => {\n if (!filename) {\n return;\n }\n\n const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;\n\n // eslint-disable-next-line prefer-const\n let { dir, base: file, ext } = posix.parse(normalizedFilename);\n\n if (ext === '.js' || ext === '.mjs' || ext === '.cjs') {\n file = file.slice(0, ext.length * -1);\n }\n\n if (!dir) {\n // No dirname whatsoever\n dir = '.';\n }\n\n const n = dir.lastIndexOf('/node_modules');\n if (n > -1) {\n return `${dir.slice(n + 14).replace(/\\//g, '.')}:${file}`;\n }\n\n // Let's see if it's a part of the main module\n // To be a part of main module, it has to share the same base\n if (dir.startsWith(normalizedBase)) {\n let moduleName = dir.slice(normalizedBase.length + 1).replace(/\\//g, '.');\n\n if (moduleName) {\n moduleName += ':';\n }\n moduleName += file;\n\n return moduleName;\n }\n\n return file;\n };\n}\n"],"names":[],"mappings":";;;AAGA;AACA,SAAS,oBAAoB,CAAC,IAAI,EAAkB;AACpD,EAAE,OAAO,IAAA;AACT,KAAK,OAAO,CAAC,SAAS,EAAE,EAAE,CAAA;AAC1B,KAAK,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACxB,CAAA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,QAAQ,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,GAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,GAAI,OAAO,CAAC,GAAG,EAAE;AAC/E,EAAE,SAAS,GAAY,GAAA,KAAQ,IAAI;AACnC,EAAwD;AACxD,EAAE,MAAM,cAAe,GAAE,SAAU,GAAE,oBAAoB,CAAC,QAAQ,CAAE,GAAE,QAAQ,CAAA;AAC9E;AACA,EAAE,OAAO,CAAC,QAAQ,KAAyB;AAC3C,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB,MAAM,OAAM;AACZ,KAAI;AACJ;AACA,IAAI,MAAM,kBAAmB,GAAE,SAAU,GAAE,oBAAoB,CAAC,QAAQ,CAAE,GAAE,QAAQ,CAAA;AACpF;AACA;AACA,IAAI,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAI,EAAA,GAAI,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;AAClE;AACA,IAAI,IAAI,GAAI,KAAI,KAAM,IAAG,GAAI,KAAI,MAAO,IAAG,GAAI,KAAI,MAAM,EAAE;AAC3D,MAAM,IAAK,GAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAA,GAAS,CAAC,CAAC,CAAC,CAAA;AAC3C,KAAI;AACJ;AACA,IAAI,IAAI,CAAC,GAAG,EAAE;AACd;AACA,MAAM,GAAA,GAAM,GAAG,CAAA;AACf,KAAI;AACJ;AACA,IAAI,MAAM,IAAI,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;AAC9C,IAAI,IAAI,CAAA,GAAI,CAAC,CAAC,EAAE;AAChB,MAAM,OAAO,CAAC,EAAA,GAAA,CAAA,KAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA;AACA;AACA,IAAA,IAAA,GAAA,CAAA,UAAA,CAAA,cAAA,CAAA,EAAA;AACA,MAAA,IAAA,UAAA,GAAA,GAAA,CAAA,KAAA,CAAA,cAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA,CAAA;AACA;AACA,MAAA,IAAA,UAAA,EAAA;AACA,QAAA,UAAA,IAAA,GAAA,CAAA;AACA,OAAA;AACA,MAAA,UAAA,IAAA,IAAA,CAAA;AACA;AACA,MAAA,OAAA,UAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Event, Integration, IntegrationClass } from '@sentry/types';
|
|
2
|
-
import type { NodeClient } from '../../sdk/client';
|
|
3
|
-
import type { LocalVariablesIntegrationOptions } from './common';
|
|
4
|
-
export declare const localVariablesAsyncIntegration: (options?: LocalVariablesIntegrationOptions | undefined) => import("@sentry/types").IntegrationFnResult;
|
|
5
|
-
/**
|
|
6
|
-
* Adds local variables to exception frames.
|
|
7
|
-
* @deprecated Use `localVariablesAsyncIntegration()` instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare const LocalVariablesAsync: IntegrationClass<Integration & {
|
|
10
|
-
processEvent: (event: Event) => Event;
|
|
11
|
-
setup: (client: NodeClient) => void;
|
|
12
|
-
}>;
|
|
13
|
-
export type LocalVariablesAsync = typeof LocalVariablesAsync;
|
|
14
|
-
//# sourceMappingURL=local-variables-async.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-variables-async.d.ts","sourceRoot":"","sources":["../../../../src/integrations/local-variables/local-variables-async.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAa,WAAW,EAAE,gBAAgB,EAA8B,MAAM,eAAe,CAAC;AAIjH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAEV,gCAAgC,EAIjC,MAAM,UAAU,CAAC;AAyPlB,eAAO,MAAM,8BAA8B,yGAAqD,CAAC;AAEjG;;;GAGG;AAEH,eAAO,MAAM,mBAAmB;0BAG4B,KAAK,KAAK,KAAK;oBAAkB,UAAU,KAAK,IAAI;EAAG,CAAC;AAGpH,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Event, Integration, IntegrationClass } from '@sentry/types';
|
|
2
|
-
import { NodeClient } from '../../sdk/client';
|
|
3
|
-
import { LocalVariablesIntegrationOptions } from './common';
|
|
4
|
-
export declare const localVariablesAsyncIntegration: (options?: LocalVariablesIntegrationOptions | undefined) => import("@sentry/types").IntegrationFnResult;
|
|
5
|
-
/**
|
|
6
|
-
* Adds local variables to exception frames.
|
|
7
|
-
* @deprecated Use `localVariablesAsyncIntegration()` instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare const LocalVariablesAsync: IntegrationClass<Integration & {
|
|
10
|
-
processEvent: (event: Event) => Event;
|
|
11
|
-
setup: (client: NodeClient) => void;
|
|
12
|
-
}>;
|
|
13
|
-
export type LocalVariablesAsync = typeof LocalVariablesAsync;
|
|
14
|
-
//# sourceMappingURL=local-variables-async.d.ts.map
|