@prairielearn/sentry 2.0.10 → 2.0.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @prairielearn/sentry
2
2
 
3
+ ## 2.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 0e1aa6e: Upgrade all Sentry and OpenTelemetry packages
8
+ - 4a8b376: Upgrade all JavaScript dependencies
9
+
10
+ ## 2.0.11
11
+
12
+ ### Patch Changes
13
+
14
+ - 9d7d790: Upgrade all JavaScript dependencies
15
+
3
16
  ## 2.0.10
4
17
 
5
18
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -18,5 +18,5 @@ export declare function init(options: Sentry.NodeOptions): Promise<void>;
18
18
  * isolate requests and set request data for Sentry.
19
19
  */
20
20
  export declare function requestHandler(): (req: any, _res: any, next: any) => void;
21
- export { Breadcrumb, BreadcrumbHint, Event, EventHint, Exception, NodeOptions, PolymorphicRequest, Request, SdkInfo, Session, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, } from '@sentry/node';
21
+ export type { Breadcrumb, BreadcrumbHint, Event, EventHint, Exception, NodeOptions, PolymorphicRequest, Request, SdkInfo, Session, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, } from '@sentry/node';
22
22
  export { addBreadcrumb, addEventProcessor, addRequestDataToEvent, captureEvent, captureException, captureMessage, close, createTransport, defaultStackParser, expressErrorHandler, expressIntegration, extractRequestData, flush, getCurrentHub, getCurrentScope, getSentryRelease, makeNodeTransport, NodeClient, Scope, SDK_VERSION, SentryContextManager, setContext, setExtra, setExtras, setTag, setTags, setupExpressErrorHandler, setUser, startInactiveSpan, startSpan, startSpanManual, withIsolationScope, withScope, } from '@sentry/node';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MA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CAAC,CAAC,KAAK,EAAE,EAAE;YAClC,KAAK,CAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE,EAAE;gBAChC,kEAAkE;gBAClE,kEAAkE;gBAClE,oEAAoE;gBACpE,sBAAsB;gBACtB,IAAI,CAAC;oBACH,KAAK,CAAC,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;oBAC5C,OAAO,MAAM,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBAClD,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAwBD,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,KAAK,EACL,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,wBAAwB,EACxB,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,SAAS,GACV,MAAM,cAAc,CAAC","sourcesContent":["import * as Sentry from '@sentry/node';\nimport { stripUrlQueryAndFragment } from '@sentry/utils';\nimport { execa } from 'execa';\n\n/**\n * A thin wrapper around {@link Sentry.init} that automatically sets `release`\n * based on the current Git revision.\n */\nexport async function init(options: Sentry.NodeOptions) {\n let release = options.release;\n\n if (!release) {\n try {\n release = (await execa('git', ['rev-parse', 'HEAD'])).stdout.trim();\n } catch {\n // This most likely isn't running in an initialized git repository.\n // Default to not setting a release.\n }\n }\n\n Sentry.init({\n release,\n ...options,\n });\n}\n\n/**\n * Based on Sentry code that is not exported:\n * https://github.com/getsentry/sentry-javascript/blob/602703652959b581304a7849cb97117f296493bc/packages/utils/src/requestdata.ts#L102\n */\nfunction extractTransaction(req: any) {\n const method = req.method?.toUpperCase() || '';\n const path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n\n let name = '';\n if (method) {\n name += method;\n }\n if (method && path) {\n name += ' ';\n }\n if (path) {\n name += path;\n }\n\n return name;\n}\n\n/**\n * Sentry v8 switched from simple, manual instrumentation to \"automatic\"\n * instrumentation based on OpenTelemetry. However, this interferes with\n * the way that our applications asynchronously load their configuration,\n * specifically the Sentry DSN. Sentry's automatic request isolation and\n * request data extraction requires that `Sentry.init` be called before\n * any other code is loaded, but our application startup structure is such\n * that we import most of our own code before we can load the Sentry DSN.\n *\n * Rather than jumping through hoops to restructure our application to\n * support this, this small function can be added as Express middleware to\n * isolate requests and set request data for Sentry.\n */\nexport function requestHandler() {\n return (req: any, _res: any, next: any) => {\n Sentry.withIsolationScope((scope) => {\n scope.addEventProcessor((event) => {\n // If an event processor throws an error, Sentry will catch it and\n // retrigger the event processor, which infinitely recurses. We'll\n // treat our event processor as a best-effort operation and silently\n // swallow any errors.\n try {\n event.transaction = extractTransaction(req);\n return Sentry.addRequestDataToEvent(event, req);\n } catch {\n return event;\n }\n });\n\n next();\n });\n };\n}\n\n// We export every type and function from `@sentry/node` *except* for init,\n// which we replace with our own version up above.\n\nexport {\n Breadcrumb,\n BreadcrumbHint,\n Event,\n EventHint,\n Exception,\n NodeOptions,\n PolymorphicRequest,\n Request,\n SdkInfo,\n Session,\n SeverityLevel,\n Span,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n} from '@sentry/node';\n\nexport {\n addBreadcrumb,\n addEventProcessor,\n addRequestDataToEvent,\n captureEvent,\n captureException,\n captureMessage,\n close,\n createTransport,\n defaultStackParser,\n expressErrorHandler,\n expressIntegration,\n extractRequestData,\n flush,\n getCurrentHub,\n getCurrentScope,\n getSentryRelease,\n makeNodeTransport,\n NodeClient,\n Scope,\n SDK_VERSION,\n SentryContextManager,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setupExpressErrorHandler,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n withIsolationScope,\n withScope,\n} from '@sentry/node';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAA2B;IACpD,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAE9B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC;YACH,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACtE,CAAC;QAAC,MAAM,CAAC;YACP,mEAAmE;YACnE,oCAAoC;QACtC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAAI,CAAC;QACV,OAAO;QACP,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,kBAAkB,CAAC,GAAQ;IAClC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC/C,MAAM,IAAI,GAAG,wBAAwB,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IAExE,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,IAAI,MAAM,CAAC;IACjB,CAAC;IACD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;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QueryAndFragment } from '@sentry/utils';\nimport { execa } from 'execa';\n\n/**\n * A thin wrapper around {@link Sentry.init} that automatically sets `release`\n * based on the current Git revision.\n */\nexport async function init(options: Sentry.NodeOptions) {\n let release = options.release;\n\n if (!release) {\n try {\n release = (await execa('git', ['rev-parse', 'HEAD'])).stdout.trim();\n } catch {\n // This most likely isn't running in an initialized git repository.\n // Default to not setting a release.\n }\n }\n\n Sentry.init({\n release,\n ...options,\n });\n}\n\n/**\n * Based on Sentry code that is not exported:\n * https://github.com/getsentry/sentry-javascript/blob/602703652959b581304a7849cb97117f296493bc/packages/utils/src/requestdata.ts#L102\n */\nfunction extractTransaction(req: any) {\n const method = req.method?.toUpperCase() || '';\n const path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n\n let name = '';\n if (method) {\n name += method;\n }\n if (method && path) {\n name += ' ';\n }\n if (path) {\n name += path;\n }\n\n return name;\n}\n\n/**\n * Sentry v8 switched from simple, manual instrumentation to \"automatic\"\n * instrumentation based on OpenTelemetry. However, this interferes with\n * the way that our applications asynchronously load their configuration,\n * specifically the Sentry DSN. Sentry's automatic request isolation and\n * request data extraction requires that `Sentry.init` be called before\n * any other code is loaded, but our application startup structure is such\n * that we import most of our own code before we can load the Sentry DSN.\n *\n * Rather than jumping through hoops to restructure our application to\n * support this, this small function can be added as Express middleware to\n * isolate requests and set request data for Sentry.\n */\nexport function requestHandler() {\n return (req: any, _res: any, next: any) => {\n Sentry.withIsolationScope((scope) => {\n scope.addEventProcessor((event) => {\n // If an event processor throws an error, Sentry will catch it and\n // retrigger the event processor, which infinitely recurses. We'll\n // treat our event processor as a best-effort operation and silently\n // swallow any errors.\n try {\n event.transaction = extractTransaction(req);\n return Sentry.addRequestDataToEvent(event, req);\n } catch {\n return event;\n }\n });\n\n next();\n });\n };\n}\n\n// We export every type and function from `@sentry/node` *except* for init,\n// which we replace with our own version up above.\n\nexport type {\n Breadcrumb,\n BreadcrumbHint,\n Event,\n EventHint,\n Exception,\n NodeOptions,\n PolymorphicRequest,\n Request,\n SdkInfo,\n Session,\n SeverityLevel,\n Span,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n} from '@sentry/node';\n\nexport {\n addBreadcrumb,\n addEventProcessor,\n addRequestDataToEvent,\n captureEvent,\n captureException,\n captureMessage,\n close,\n createTransport,\n defaultStackParser,\n expressErrorHandler,\n expressIntegration,\n extractRequestData,\n flush,\n getCurrentHub,\n getCurrentScope,\n getSentryRelease,\n makeNodeTransport,\n NodeClient,\n Scope,\n SDK_VERSION,\n SentryContextManager,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setupExpressErrorHandler,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n withIsolationScope,\n withScope,\n} from '@sentry/node';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prairielearn/sentry",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -14,13 +14,13 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@prairielearn/tsconfig": "^0.0.0",
17
- "@types/node": "^20.17.9",
17
+ "@types/node": "^20.17.16",
18
18
  "tsx": "^4.19.2",
19
- "typescript": "^5.7.2"
19
+ "typescript": "^5.7.3"
20
20
  },
21
21
  "dependencies": {
22
- "@sentry/node": "^8.43.0",
23
- "@sentry/utils": "^8.43.0",
24
- "execa": "^9.5.1"
22
+ "@sentry/node": "^8.54.0",
23
+ "@sentry/utils": "^8.54.0",
24
+ "execa": "^9.5.2"
25
25
  }
26
26
  }
package/src/index.ts CHANGED
@@ -83,7 +83,7 @@ export function requestHandler() {
83
83
  // We export every type and function from `@sentry/node` *except* for init,
84
84
  // which we replace with our own version up above.
85
85
 
86
- export {
86
+ export type {
87
87
  Breadcrumb,
88
88
  BreadcrumbHint,
89
89
  Event,