sentry-vir 0.0.1 → 0.0.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.
@@ -1,11 +1,10 @@
1
- import { JsonCompatibleValue } from '@augment-vir/common';
2
1
  import { ScopeContext } from '@sentry/types';
3
2
  import { EventSeverityEnum } from './event-severity';
4
3
  /**
5
4
  * Used for all extra context types. While keys must be strings, values can be whatever but must be
6
5
  * JSON compatible.
7
6
  */
8
- export type EventExtraContext = Record<string, JsonCompatibleValue>;
7
+ export type EventExtraContext = Record<string, unknown>;
9
8
  /** Function that generates extra event context. */
10
9
  export type EventExtraContextCreator = () => EventExtraContext;
11
10
  /** Event details before getting sent to Sentry. */
@@ -5,7 +5,7 @@ import { EventDetails, EventExtraContext } from '../event-context/event-context'
5
5
  /** The bare minimum Sentry client needed for logging events. */
6
6
  export type SentryClientForLogging = Pick<SentryDep, 'captureMessage' | 'captureException' | 'captureEvent'>;
7
7
  /** An event that was triggered before setSentryClientForLogging was called. */
8
- export type PrematureEvent<EntryPointFunction extends AnyFunction> = {
8
+ export type PrematureEvent<EntryPointFunction extends AnyFunction = AnyFunction> = {
9
9
  entryPoint: EntryPointFunction;
10
10
  inputs: Parameters<EntryPointFunction>;
11
11
  };
@@ -13,7 +13,7 @@ export type PrematureEvent<EntryPointFunction extends AnyFunction> = {
13
13
  * Used to store events before the Sentry client is setup. This is exported for testing purposes
14
14
  * only, you don't need to do anything with this.
15
15
  */
16
- export declare const prematureSentryEvents: PrematureEvent<any>[];
16
+ export declare const prematureSentryEvents: PrematureEvent[];
17
17
  /**
18
18
  * Asynchronously set the Sentry client for logging. When this is called, any events that were
19
19
  * triggered beforehand are handled. Thus, this set can be done at any time, allowing for
@@ -77,7 +77,7 @@ function wrapLogWithSeverity(severity) {
77
77
  function sendLogToSentry(logInfo, eventDetails) {
78
78
  if (!sentryClientForLogging) {
79
79
  exports.prematureSentryEvents.push({
80
- entryPoint: 'sendLog',
80
+ entryPoint: sendLogToSentry,
81
81
  inputs: [
82
82
  logInfo,
83
83
  eventDetails,
@@ -72,7 +72,7 @@ function wrapLogWithSeverity(severity) {
72
72
  function sendLogToSentry(logInfo, eventDetails) {
73
73
  if (!sentryClientForLogging) {
74
74
  prematureSentryEvents.push({
75
- entryPoint: 'sendLog',
75
+ entryPoint: sendLogToSentry,
76
76
  inputs: [
77
77
  logInfo,
78
78
  eventDetails,
@@ -1,11 +1,10 @@
1
- import { JsonCompatibleValue } from '@augment-vir/common';
2
1
  import { ScopeContext } from '@sentry/types';
3
2
  import { EventSeverityEnum } from './event-severity';
4
3
  /**
5
4
  * Used for all extra context types. While keys must be strings, values can be whatever but must be
6
5
  * JSON compatible.
7
6
  */
8
- export type EventExtraContext = Record<string, JsonCompatibleValue>;
7
+ export type EventExtraContext = Record<string, unknown>;
9
8
  /** Function that generates extra event context. */
10
9
  export type EventExtraContextCreator = () => EventExtraContext;
11
10
  /** Event details before getting sent to Sentry. */
@@ -5,7 +5,7 @@ import { EventDetails, EventExtraContext } from '../event-context/event-context'
5
5
  /** The bare minimum Sentry client needed for logging events. */
6
6
  export type SentryClientForLogging = Pick<SentryDep, 'captureMessage' | 'captureException' | 'captureEvent'>;
7
7
  /** An event that was triggered before setSentryClientForLogging was called. */
8
- export type PrematureEvent<EntryPointFunction extends AnyFunction> = {
8
+ export type PrematureEvent<EntryPointFunction extends AnyFunction = AnyFunction> = {
9
9
  entryPoint: EntryPointFunction;
10
10
  inputs: Parameters<EntryPointFunction>;
11
11
  };
@@ -13,7 +13,7 @@ export type PrematureEvent<EntryPointFunction extends AnyFunction> = {
13
13
  * Used to store events before the Sentry client is setup. This is exported for testing purposes
14
14
  * only, you don't need to do anything with this.
15
15
  */
16
- export declare const prematureSentryEvents: PrematureEvent<any>[];
16
+ export declare const prematureSentryEvents: PrematureEvent[];
17
17
  /**
18
18
  * Asynchronously set the Sentry client for logging. When this is called, any events that were
19
19
  * triggered beforehand are handled. Thus, this set can be done at any time, allowing for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sentry-vir",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "keywords": [
5
5
  "config",
6
6
  "helper",
@@ -37,13 +37,13 @@
37
37
  "test:types": "tsc --noEmit"
38
38
  },
39
39
  "dependencies": {
40
- "@augment-vir/common": "^19.4.1",
40
+ "@augment-vir/common": "^19.4.2",
41
41
  "@sentry/browser": "^7.73.0",
42
42
  "@sentry/node": "^7.73.0",
43
43
  "type-fest": "^4.3.3"
44
44
  },
45
45
  "devDependencies": {
46
- "@augment-vir/browser-testing": "^19.4.1",
46
+ "@augment-vir/browser-testing": "^19.4.2",
47
47
  "@open-wc/testing": "^3.2.0",
48
48
  "@types/mocha": "^10.0.2",
49
49
  "@web/dev-server-esbuild": "^0.4.1",