@sentry/types 7.105.0 → 8.0.0-alpha.2

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.
Files changed (61) hide show
  1. package/package.json +2 -2
  2. package/types/attachment.d.ts +22 -1
  3. package/types/attachment.d.ts.map +1 -1
  4. package/types/breadcrumb.d.ts +2 -2
  5. package/types/breadcrumb.d.ts.map +1 -1
  6. package/types/client.d.ts +52 -64
  7. package/types/client.d.ts.map +1 -1
  8. package/types/datacategory.d.ts +1 -1
  9. package/types/datacategory.d.ts.map +1 -1
  10. package/types/envelope.d.ts +2 -13
  11. package/types/envelope.d.ts.map +1 -1
  12. package/types/event.d.ts +4 -14
  13. package/types/event.d.ts.map +1 -1
  14. package/types/hub.d.ts +3 -34
  15. package/types/hub.d.ts.map +1 -1
  16. package/types/index.d.ts +4 -5
  17. package/types/index.d.ts.map +1 -1
  18. package/types/integration.d.ts +2 -6
  19. package/types/integration.d.ts.map +1 -1
  20. package/types/options.d.ts +22 -22
  21. package/types/options.d.ts.map +1 -1
  22. package/types/scope.d.ts +10 -6
  23. package/types/scope.d.ts.map +1 -1
  24. package/types/severity.d.ts +0 -18
  25. package/types/severity.d.ts.map +1 -1
  26. package/types/span.d.ts +18 -201
  27. package/types/span.d.ts.map +1 -1
  28. package/types/spanStatus.d.ts +59 -0
  29. package/types/spanStatus.d.ts.map +1 -0
  30. package/types/startSpanOptions.d.ts +0 -14
  31. package/types/startSpanOptions.d.ts.map +1 -1
  32. package/types/transaction.d.ts +20 -40
  33. package/types/transaction.d.ts.map +1 -1
  34. package/types/transport.d.ts +1 -3
  35. package/types/transport.d.ts.map +1 -1
  36. package/types/user.d.ts +0 -4
  37. package/types/user.d.ts.map +1 -1
  38. package/types-ts3.8/attachment.d.ts +22 -1
  39. package/types-ts3.8/breadcrumb.d.ts +2 -2
  40. package/types-ts3.8/client.d.ts +52 -64
  41. package/types-ts3.8/datacategory.d.ts +1 -1
  42. package/types-ts3.8/envelope.d.ts +2 -13
  43. package/types-ts3.8/event.d.ts +4 -14
  44. package/types-ts3.8/hub.d.ts +3 -34
  45. package/types-ts3.8/index.d.ts +4 -5
  46. package/types-ts3.8/integration.d.ts +2 -6
  47. package/types-ts3.8/options.d.ts +22 -22
  48. package/types-ts3.8/scope.d.ts +10 -6
  49. package/types-ts3.8/severity.d.ts +0 -18
  50. package/types-ts3.8/span.d.ts +18 -201
  51. package/types-ts3.8/spanStatus.d.ts +59 -0
  52. package/types-ts3.8/startSpanOptions.d.ts +0 -14
  53. package/types-ts3.8/transaction.d.ts +20 -40
  54. package/types-ts3.8/transport.d.ts +1 -3
  55. package/types-ts3.8/user.d.ts +0 -4
  56. package/types/instrumenter.d.ts +0 -2
  57. package/types/instrumenter.d.ts.map +0 -1
  58. package/types/textencoder.d.ts +0 -15
  59. package/types/textencoder.d.ts.map +0 -1
  60. package/types-ts3.8/instrumenter.d.ts +0 -2
  61. package/types-ts3.8/textencoder.d.ts +0 -15
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanStatus.d.ts","sourceRoot":"","sources":["../../src/spanStatus.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc;AACjB,4CAA4C;AAC1C,IAAI;AACN,wDAAwD;GACtD,mBAAmB;AACrB,kFAAkF;GAChF,iBAAiB;AACnB,oBAAoB;GAClB,mBAAmB;AACrB,8EAA8E;GAC5E,WAAW;AACb,4BAA4B;GAC1B,oBAAoB;AACtB,iDAAiD;GAC/C,kBAAkB;AACpB,0BAA0B;GACxB,eAAe;AACjB,8BAA8B;GAC5B,aAAa;AACf,yBAAyB;GACvB,gBAAgB;AAClB,kDAAkD;GAChD,eAAe;AACjB,2DAA2D;GACzD,WAAW;AACb,2BAA2B;GACzB,gBAAgB;AAClB,+FAA+F;GAC7F,qBAAqB;AACvB,uEAAuE;GACrE,SAAS;AACX,oDAAoD;GAClD,cAAc;AAChB,4CAA4C;GAC1C,WAAW,CAAC;AAGhB,QAAA,MAAM,iBAAiB,IAAI,CAAC;AAC5B,QAAA,MAAM,cAAc,IAAI,CAAC;AACzB,QAAA,MAAM,iBAAiB,IAAI,CAAC;AAC5B,iCAAiC;AACjC,MAAM,MAAM,cAAc,GAAG,OAAO,iBAAiB,GAAG,OAAO,cAAc,GAAG,OAAO,iBAAiB,CAAC;AAEzG;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,IAAI,EAAE,cAAc,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;CACnC"}
@@ -1,4 +1,3 @@
1
- import type { Instrumenter } from './instrumenter';
2
1
  import type { Primitive } from './misc';
3
2
  import type { Scope } from './scope';
4
3
  import type { SpanAttributes, SpanOrigin, SpanTimeInput } from './span';
@@ -40,15 +39,6 @@ export interface StartSpanOptions extends TransactionContext {
40
39
  * @deprecated Use attributes or set data on scopes instead.
41
40
  */
42
41
  metadata?: Partial<TransactionMetadata>;
43
- /**
44
- * The name thingy.
45
- * @deprecated Use `name` instead.
46
- */
47
- description?: string;
48
- /**
49
- * @deprecated Use `span.setStatus()` instead.
50
- */
51
- status?: string;
52
42
  /**
53
43
  * @deprecated Use `scope` instead.
54
44
  */
@@ -89,9 +79,5 @@ export interface StartSpanOptions extends TransactionContext {
89
79
  * @deprecated Use `span.end()` instead.
90
80
  */
91
81
  endTimestamp?: number;
92
- /**
93
- * @deprecated You cannot set the instrumenter manually anymore.
94
- */
95
- instrumenter?: Instrumenter;
96
82
  }
97
83
  //# sourceMappingURL=startSpanOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"startSpanOptions.d.ts","sourceRoot":"","sources":["../../src/startSpanOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAA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YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAEpC;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -1,6 +1,5 @@
1
1
  import type { Context } from './context';
2
2
  import type { DynamicSamplingContext } from './envelope';
3
- import type { Instrumenter } from './instrumenter';
4
3
  import type { MeasurementUnit } from './measurement';
5
4
  import type { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc';
6
5
  import type { PolymorphicRequest } from './polymorphics';
@@ -33,16 +32,24 @@ export interface TransactionContext extends SpanContext {
33
32
  /**
34
33
  * Data pulled from a `sentry-trace` header
35
34
  */
36
- export type TraceparentData = Pick<TransactionContext, 'traceId' | 'parentSpanId' | 'parentSampled'>;
35
+ export interface TraceparentData {
36
+ /**
37
+ * Trace ID
38
+ */
39
+ traceId?: string | undefined;
40
+ /**
41
+ * Parent Span ID
42
+ */
43
+ parentSpanId?: string | undefined;
44
+ /**
45
+ * If this transaction has a parent, the parent's sampling decision
46
+ */
47
+ parentSampled?: boolean | undefined;
48
+ }
37
49
  /**
38
50
  * Transaction "Class", inherits Span only has `setName`
39
51
  */
40
- export interface Transaction extends TransactionContext, Omit<Span, 'setName' | 'name'> {
41
- /**
42
- * Human-readable identifier for the transaction.
43
- * @deprecated Use `spanToJSON(span).description` instead.
44
- */
45
- name: string;
52
+ export interface Transaction extends Omit<TransactionContext, 'name' | 'op'>, Span {
46
53
  /**
47
54
  * The ID of the transaction.
48
55
  * @deprecated Use `spanContext().spanId` instead.
@@ -86,18 +93,6 @@ export interface Transaction extends TransactionContext, Omit<Span, 'setName' |
86
93
  * @deprecated Use attributes or store data on the scope instead.
87
94
  */
88
95
  metadata: TransactionMetadata;
89
- /**
90
- * The instrumenter that created this transaction.
91
- *
92
- * @deprecated This field will be removed in v8.
93
- */
94
- instrumenter: Instrumenter;
95
- /**
96
- * Set the name of the transaction
97
- *
98
- * @deprecated Use `.updateName()` and `.setAttribute()` instead.
99
- */
100
- setName(name: string, source?: TransactionMetadata['source']): void;
101
96
  /**
102
97
  * Set the context of a transaction event.
103
98
  * @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.
@@ -118,11 +113,6 @@ export interface Transaction extends TransactionContext, Omit<Span, 'setName' |
118
113
  * @deprecated Use `toJSON()` or access the fields directly instead.
119
114
  */
120
115
  toContext(): TransactionContext;
121
- /**
122
- * Updates the current transaction with a new `TransactionContext`.
123
- * @deprecated Update the fields directly instead.
124
- */
125
- updateWithContext(transactionContext: TransactionContext): this;
126
116
  /**
127
117
  * Set metadata for this transaction.
128
118
  * @deprecated Use attributes or store data on the scope instead.
@@ -135,10 +125,12 @@ export interface Transaction extends TransactionContext, Omit<Span, 'setName' |
135
125
  */
136
126
  getDynamicSamplingContext(): Partial<DynamicSamplingContext>;
137
127
  /**
138
- * Get the profile id from the transaction
139
- * @deprecated Use `toJSON()` or access the fields directly instead.
128
+ * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
129
+ * Also the `sampled` decision will be inherited.
130
+ *
131
+ * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.
140
132
  */
141
- getProfileId(): string | undefined;
133
+ startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
142
134
  }
143
135
  /**
144
136
  * Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
@@ -183,21 +175,9 @@ export interface TransactionMetadata {
183
175
  dynamicSamplingContext?: Partial<DynamicSamplingContext>;
184
176
  /** For transactions tracing server-side request handling, the request being tracked. */
185
177
  request?: PolymorphicRequest;
186
- /** Compatibility shim for transitioning to the `RequestData` integration. The options passed to our Express request
187
- * handler controlling what request data is added to the event.
188
- * TODO (v8): This should go away
189
- */
190
- requestDataOptionsFromExpressHandler?: {
191
- [key: string]: unknown;
192
- };
193
178
  /** For transactions tracing server-side request handling, the path of the request being tracked. */
194
179
  /** TODO: If we rm -rf `instrumentServer`, this can go, too */
195
180
  requestPath?: string;
196
- /**
197
- * Information on how a transaction name was generated.
198
- * @deprecated Use `SEMANTIC_ATTRIBUTE_SENTRY_SOURCE` attribute instead.
199
- */
200
- source: TransactionSource;
201
181
  /**
202
182
  * Metadata for the transaction's spans, keyed by spanId.
203
183
  * @deprecated This will be removed in v8.
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;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ACpC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC5D;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEzD,wFAAwF;IACxF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B,oGAAoG;IACpG,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAA;KAAE,CAAC;CAChE;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB;AAC3B,wBAAwB;AACtB,QAAQ;AACV,kDAAkD;GAChD,KAAK;AACP,+BAA+B;GAC7B,OAAO;AACT,4CAA4C;GAC1C,MAAM;AACR,0EAA0E;GACxE,WAAW;AACb,qDAAqD;GACnD,MAAM,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import type { Client } from './client';
2
2
  import type { Envelope } from './envelope';
3
- import type { TextEncoderInternal } from './textencoder';
4
3
  export type TransportRequest = {
5
4
  body: string | Uint8Array;
6
5
  };
@@ -15,13 +14,12 @@ export type TransportMakeRequestResponse = {
15
14
  export interface InternalBaseTransportOptions {
16
15
  bufferSize?: number;
17
16
  recordDroppedEvent: Client['recordDroppedEvent'];
18
- textEncoder?: TextEncoderInternal;
19
17
  }
20
18
  export interface BaseTransportOptions extends InternalBaseTransportOptions {
21
19
  url: string;
22
20
  }
23
21
  export interface Transport {
24
- send(request: Envelope): PromiseLike<void | TransportMakeRequestResponse>;
22
+ send(request: Envelope): PromiseLike<TransportMakeRequestResponse>;
25
23
  flush(timeout?: number): PromiseLike<boolean>;
26
24
  }
27
25
  export type TransportRequestExecutor = (request: TransportRequest) => PromiseLike<TransportMakeRequestResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QAC7B,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;QACtC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,WAAW,oBAAqB,SAAQ,4BAA4B;IAIxE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IAExB,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,WAAW,CAAC,IAAI,GAAG,4BAA4B,CAAC,CAAC;IAC1E,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,WAAW,CAAC,4BAA4B,CAAC,CAAC"}
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QAC7B,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;QACtC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,oBAAqB,SAAQ,4BAA4B;IAIxE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;IACnE,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,WAAW,CAAC,4BAA4B,CAAC,CAAC"}
package/types/user.d.ts CHANGED
@@ -7,10 +7,6 @@ export interface User {
7
7
  ip_address?: string;
8
8
  email?: string;
9
9
  username?: string;
10
- /**
11
- * @deprecated Functonality for segment has been removed. Use a custom tag or context instead to capture this information.
12
- */
13
- segment?: string;
14
10
  }
15
11
  export interface UserFeedback {
16
12
  event_id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -1,7 +1,28 @@
1
+ /**
2
+ * An attachment to an event. This is used to upload arbitrary data to Sentry.
3
+ *
4
+ * Please take care to not add sensitive information in attachments.
5
+ *
6
+ * https://develop.sentry.dev/sdk/envelopes/#attachment
7
+ */
1
8
  export interface Attachment {
9
+ /**
10
+ * The attachment data. Can be a string or a binary data (byte array)
11
+ */
2
12
  data: string | Uint8Array;
13
+ /**
14
+ * The name of the uploaded file without a path component
15
+ */
3
16
  filename: string;
17
+ /**
18
+ * The content type of the attachment payload. Defaults to `application/octet-stream` if not specified.
19
+ *
20
+ * Any valid [media type](https://www.iana.org/assignments/media-types/media-types.xhtml) is allowed.
21
+ */
4
22
  contentType?: string;
5
- attachmentType?: string;
23
+ /**
24
+ * The type of the attachment. Defaults to `event.attachment` if not specified.
25
+ */
26
+ attachmentType?: 'event.attachment' | 'event.minidump' | 'event.applecrashreport' | 'unreal.context' | 'unreal.logs';
6
27
  }
7
28
  //# sourceMappingURL=attachment.d.ts.map
@@ -1,8 +1,8 @@
1
- import { Severity, SeverityLevel } from './severity';
1
+ import { SeverityLevel } from './severity';
2
2
  /** JSDoc */
3
3
  export interface Breadcrumb {
4
4
  type?: string;
5
- level?: Severity | SeverityLevel;
5
+ level?: SeverityLevel;
6
6
  event_id?: string;
7
7
  category?: string;
8
8
  message?: string;
@@ -8,13 +8,12 @@ import { Event, EventHint } from './event';
8
8
  import { EventProcessor } from './eventprocessor';
9
9
  import { FeedbackEvent } from './feedback';
10
10
  import { Integration, IntegrationClass } from './integration';
11
- import { MetricBucketItem } from './metrics';
12
11
  import { ClientOptions } from './options';
13
12
  import { ParameterizedString } from './parameterize';
14
13
  import { Scope } from './scope';
15
14
  import { SdkMetadata } from './sdkmetadata';
16
15
  import { Session, SessionAggregates } from './session';
17
- import { Severity, SeverityLevel } from './severity';
16
+ import { SeverityLevel } from './severity';
18
17
  import { StartSpanOptions } from './startSpanOptions';
19
18
  import { Transaction } from './transaction';
20
19
  import { Transport, TransportMakeRequestResponse } from './transport';
@@ -46,7 +45,7 @@ export interface Client<O extends ClientOptions = ClientOptions> {
46
45
  * @param scope An optional scope containing event metadata.
47
46
  * @returns The event id
48
47
  */
49
- captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint, scope?: Scope): string | undefined;
48
+ captureMessage(message: string, level?: SeverityLevel, hint?: EventHint, scope?: Scope): string | undefined;
50
49
  /**
51
50
  * Captures a manually created event and sends it to Sentry.
52
51
  *
@@ -61,7 +60,7 @@ export interface Client<O extends ClientOptions = ClientOptions> {
61
60
  *
62
61
  * @param session Session to be delivered
63
62
  */
64
- captureSession?(session: Session): void;
63
+ captureSession(session: Session): void;
65
64
  /**
66
65
  * Create a cron monitor check in and send it to Sentry. This method is not available on all clients.
67
66
  *
@@ -79,9 +78,8 @@ export interface Client<O extends ClientOptions = ClientOptions> {
79
78
  /**
80
79
  * @inheritdoc
81
80
  *
82
- * TODO (v8): Make this a required method.
83
81
  */
84
- getSdkMetadata?(): SdkMetadata | undefined;
82
+ getSdkMetadata(): SdkMetadata | undefined;
85
83
  /**
86
84
  * Returns the transport that is used by the client.
87
85
  * Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.
@@ -109,32 +107,27 @@ export interface Client<O extends ClientOptions = ClientOptions> {
109
107
  flush(timeout?: number): PromiseLike<boolean>;
110
108
  /**
111
109
  * Adds an event processor that applies to any event processed by this client.
112
- *
113
- * TODO (v8): Make this a required method.
114
110
  */
115
- addEventProcessor?(eventProcessor: EventProcessor): void;
111
+ addEventProcessor(eventProcessor: EventProcessor): void;
116
112
  /**
117
113
  * Get all added event processors for this client.
118
- *
119
- * TODO (v8): Make this a required method.
120
114
  */
121
- getEventProcessors?(): EventProcessor[];
115
+ getEventProcessors(): EventProcessor[];
122
116
  /**
123
117
  * Returns the client's instance of the given integration class, it any.
124
118
  * @deprecated Use `getIntegrationByName()` instead.
125
119
  */
126
120
  getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
127
121
  /** Get the instance of the integration with the given name on the client, if it was added. */
128
- getIntegrationByName?<T extends Integration = Integration>(name: string): T | undefined;
122
+ getIntegrationByName<T extends Integration = Integration>(name: string): T | undefined;
129
123
  /**
130
124
  * Add an integration to the client.
131
125
  * This can be used to e.g. lazy load integrations.
132
126
  * In most cases, this should not be necessary, and you're better off just passing the integrations via `integrations: []` at initialization time.
133
127
  * However, if you find the need to conditionally load & add an integration, you can use `addIntegration` to do so.
134
128
  *
135
- * TODO (v8): Make this a required method.
136
129
  * */
137
- addIntegration?(integration: Integration): void;
130
+ addIntegration(integration: Integration): void;
138
131
  /**
139
132
  * This is an internal function to setup all integrations that should run on the client.
140
133
  * @deprecated Use `client.init()` instead.
@@ -144,11 +137,11 @@ export interface Client<O extends ClientOptions = ClientOptions> {
144
137
  * Initialize this client.
145
138
  * Call this after the client was set on a scope.
146
139
  */
147
- init?(): void;
140
+ init(): void;
148
141
  /** Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. */
149
142
  eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
150
143
  /** Creates an {@link Event} from primitive inputs to `captureMessage`. */
151
- eventFromMessage(message: ParameterizedString, level?: Severity | SeverityLevel, hint?: EventHint): PromiseLike<Event>;
144
+ eventFromMessage(message: ParameterizedString, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
152
145
  /** Submits the event to Sentry */
153
146
  sendEvent(event: Event, hint?: EventHint): void;
154
147
  /** Submits the session to Sentry */
@@ -161,127 +154,122 @@ export interface Client<O extends ClientOptions = ClientOptions> {
161
154
  * @param event The dropped event.
162
155
  */
163
156
  recordDroppedEvent(reason: EventDropReason, dataCategory: DataCategory, event?: Event): void;
164
- /**
165
- * Captures serialized metrics and sends them to Sentry.
166
- *
167
- * @experimental This API is experimental and might experience breaking changes
168
- */
169
- captureAggregateMetrics?(metricBucketItems: Array<MetricBucketItem>): void;
170
157
  /**
171
158
  * Register a callback for transaction start.
172
159
  * Receives the transaction as argument.
173
160
  */
174
- on?(hook: 'startTransaction', callback: (transaction: Transaction) => void): void;
161
+ on(hook: 'startTransaction', callback: (transaction: Transaction) => void): void;
175
162
  /**
176
163
  * Register a callback for transaction finish.
177
164
  * Receives the transaction as argument.
178
165
  */
179
- on?(hook: 'finishTransaction', callback: (transaction: Transaction) => void): void;
166
+ on(hook: 'finishTransaction', callback: (transaction: Transaction) => void): void;
180
167
  /**
181
168
  * Register a callback for transaction start and finish.
182
169
  */
183
- on?(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;
170
+ on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;
184
171
  /**
185
172
  * Register a callback for before sending an event.
186
173
  * This is called right before an event is sent and should not be used to mutate the event.
187
174
  * Receives an Event & EventHint as arguments.
188
175
  */
189
- on?(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint | undefined) => void): void;
176
+ on(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint | undefined) => void): void;
190
177
  /**
191
178
  * Register a callback for preprocessing an event,
192
179
  * before it is passed to (global) event processors.
193
180
  * Receives an Event & EventHint as arguments.
194
181
  */
195
- on?(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint | undefined) => void): void;
182
+ on(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint | undefined) => void): void;
196
183
  /**
197
184
  * Register a callback for when an event has been sent.
198
185
  */
199
- on?(hook: 'afterSendEvent', callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void): void;
186
+ on(hook: 'afterSendEvent', callback: (event: Event, sendResponse: TransportMakeRequestResponse) => void): void;
200
187
  /**
201
188
  * Register a callback before a breadcrumb is added.
202
189
  */
203
- on?(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;
190
+ on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;
204
191
  /**
205
192
  * Register a callback when a DSC (Dynamic Sampling Context) is created.
206
193
  */
207
- on?(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;
208
- /**
209
- * Register a callback when an OpenTelemetry span is ended (in @sentry/opentelemetry-node).
210
- * The option argument may be mutated to drop the span.
211
- */
212
- on?(hook: 'otelSpanEnd', callback: (otelSpan: unknown, mutableOptions: {
213
- drop: boolean;
214
- }) => void): void;
194
+ on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;
215
195
  /**
216
196
  * Register a callback when a Feedback event has been prepared.
217
197
  * This should be used to mutate the event. The options argument can hint
218
198
  * about what kind of mutation it expects.
219
199
  */
220
- on?(hook: 'beforeSendFeedback', callback: (feedback: FeedbackEvent, options?: {
200
+ on(hook: 'beforeSendFeedback', callback: (feedback: FeedbackEvent, options?: {
221
201
  includeReplay?: boolean;
222
202
  }) => void): void;
223
203
  /**
224
- * A hook for BrowserTracing to trigger a span start for a page load.
204
+ * A hook for the browser tracing integrations to trigger a span start for a page load.
205
+ */
206
+ on(hook: 'startPageLoadSpan', callback: (options: StartSpanOptions) => void): void;
207
+ /**
208
+ * A hook for browser tracing integrations to trigger a span for a navigation.
225
209
  */
226
- on?(hook: 'startPageLoadSpan', callback: (options: StartSpanOptions) => void): void;
210
+ on(hook: 'startNavigationSpan', callback: (options: StartSpanOptions) => void): void;
227
211
  /**
228
- * A hook for BrowserTracing to trigger a span for a navigation.
212
+ * A hook that is called when the client is flushing
229
213
  */
230
- on?(hook: 'startNavigationSpan', callback: (options: StartSpanOptions) => void): void;
214
+ on(hook: 'flush', callback: () => void): void;
215
+ /**
216
+ * A hook that is called when the client is closing
217
+ */
218
+ on(hook: 'close', callback: () => void): void;
231
219
  /**
232
220
  * Fire a hook event for transaction start.
233
221
  * Expects to be given a transaction as the second argument.
234
222
  */
235
- emit?(hook: 'startTransaction', transaction: Transaction): void;
223
+ emit(hook: 'startTransaction', transaction: Transaction): void;
236
224
  /**
237
225
  * Fire a hook event for transaction finish.
238
226
  * Expects to be given a transaction as the second argument.
239
227
  */
240
- emit?(hook: 'finishTransaction', transaction: Transaction): void;
241
- emit?(hook: 'beforeEnvelope', envelope: Envelope): void;
228
+ emit(hook: 'finishTransaction', transaction: Transaction): void;
229
+ emit(hook: 'beforeEnvelope', envelope: Envelope): void;
242
230
  /**
243
231
  * Fire a hook event before sending an event.
244
232
  * This is called right before an event is sent and should not be used to mutate the event.
245
233
  * Expects to be given an Event & EventHint as the second/third argument.
246
234
  */
247
- emit?(hook: 'beforeSendEvent', event: Event, hint?: EventHint): void;
235
+ emit(hook: 'beforeSendEvent', event: Event, hint?: EventHint): void;
248
236
  /**
249
237
  * Fire a hook event to process events before they are passed to (global) event processors.
250
238
  * Expects to be given an Event & EventHint as the second/third argument.
251
239
  */
252
- emit?(hook: 'preprocessEvent', event: Event, hint?: EventHint): void;
253
- emit?(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;
240
+ emit(hook: 'preprocessEvent', event: Event, hint?: EventHint): void;
241
+ emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse): void;
254
242
  /**
255
243
  * Fire a hook for when a breadcrumb is added. Expects the breadcrumb as second argument.
256
244
  */
257
- emit?(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
245
+ emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
258
246
  /**
259
247
  * Fire a hook for when a DSC (Dynamic Sampling Context) is created. Expects the DSC as second argument.
260
248
  */
261
- emit?(hook: 'createDsc', dsc: DynamicSamplingContext): void;
262
- /**
263
- * Fire a hook for when an OpenTelemetry span is ended (in @sentry/opentelemetry-node).
264
- * Expects the OTEL span & as second argument, and an option object as third argument.
265
- * The option argument may be mutated to drop the span.
266
- */
267
- emit?(hook: 'otelSpanEnd', otelSpan: unknown, mutableOptions: {
268
- drop: boolean;
269
- }): void;
249
+ emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;
270
250
  /**
271
251
  * Fire a hook event for after preparing a feedback event. Events to be given
272
252
  * a feedback event as the second argument, and an optional options object as
273
253
  * third argument.
274
254
  */
275
- emit?(hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: {
255
+ emit(hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: {
276
256
  includeReplay?: boolean;
277
257
  }): void;
278
258
  /**
279
- * Emit a hook event for BrowserTracing to trigger a span start for a page load.
259
+ * Emit a hook event for browser tracing integrations to trigger a span start for a page load.
260
+ */
261
+ emit(hook: 'startPageLoadSpan', options: StartSpanOptions): void;
262
+ /**
263
+ * Emit a hook event for browser tracing integrations to trigger a span for a navigation.
264
+ */
265
+ emit(hook: 'startNavigationSpan', options: StartSpanOptions): void;
266
+ /**
267
+ * Emit a hook event for client flush
280
268
  */
281
- emit?(hook: 'startPageLoadSpan', options: StartSpanOptions): void;
269
+ emit(hook: 'flush'): void;
282
270
  /**
283
- * Emit a hook event for BrowserTracing to trigger a span for a navigation.
271
+ * Emit a hook event for client close
284
272
  */
285
- emit?(hook: 'startNavigationSpan', options: StartSpanOptions): void;
273
+ emit(hook: 'close'): void;
286
274
  }
287
275
  //# sourceMappingURL=client.d.ts.map
@@ -1,2 +1,2 @@
1
- export type DataCategory = 'default' | 'error' | 'transaction' | 'replay' | 'security' | 'attachment' | 'session' | 'internal' | 'profile' | 'monitor' | 'feedback' | 'unknown' | 'span';
1
+ export type DataCategory = 'default' | 'error' | 'transaction' | 'replay' | 'security' | 'attachment' | 'session' | 'internal' | 'profile' | 'monitor' | 'feedback' | 'unknown';
2
2
  //# sourceMappingURL=datacategory.d.ts.map
@@ -7,7 +7,6 @@ import { Profile } from './profiling';
7
7
  import { ReplayEvent, ReplayRecordingData } from './replay';
8
8
  import { SdkInfo } from './sdkinfo';
9
9
  import { SerializedSession, Session, SessionAggregates } from './session';
10
- import { Span } from './span';
11
10
  import { Transaction } from './transaction';
12
11
  import { UserFeedback } from './user';
13
12
  export type DynamicSamplingContext = {
@@ -17,14 +16,10 @@ export type DynamicSamplingContext = {
17
16
  release?: string;
18
17
  environment?: string;
19
18
  transaction?: string;
20
- /**
21
- * @deprecated Functonality for segment has been removed.
22
- */
23
- user_segment?: string;
24
19
  replay_id?: string;
25
20
  sampled?: string;
26
21
  };
27
- export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd' | 'span';
22
+ export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd';
28
23
  export type BaseEnvelopeHeaders = {
29
24
  [key: string]: unknown;
30
25
  dsn?: string;
@@ -85,9 +80,6 @@ type StatsdItemHeaders = {
85
80
  type ProfileItemHeaders = {
86
81
  type: 'profile';
87
82
  };
88
- type SpanItemHeaders = {
89
- type: 'span';
90
- };
91
83
  export type EventItem = BaseEnvelopeItem<EventItemHeaders, Event>;
92
84
  export type AttachmentItem = BaseEnvelopeItem<AttachmentItemHeaders, string | Uint8Array>;
93
85
  export type UserFeedbackItem = BaseEnvelopeItem<UserFeedbackItemHeaders, UserFeedback>;
@@ -99,7 +91,6 @@ type ReplayRecordingItem = BaseEnvelopeItem<ReplayRecordingItemHeaders, ReplayRe
99
91
  export type StatsdItem = BaseEnvelopeItem<StatsdItemHeaders, string>;
100
92
  export type FeedbackItem = BaseEnvelopeItem<FeedbackItemHeaders, FeedbackEvent>;
101
93
  export type ProfileItem = BaseEnvelopeItem<ProfileItemHeaders, Profile>;
102
- export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Span>;
103
94
  export type EventEnvelopeHeaders = {
104
95
  event_id: string;
105
96
  sent_at: string;
@@ -114,7 +105,6 @@ type CheckInEnvelopeHeaders = {
114
105
  type ClientReportEnvelopeHeaders = BaseEnvelopeHeaders;
115
106
  type ReplayEnvelopeHeaders = BaseEnvelopeHeaders;
116
107
  type StatsdEnvelopeHeaders = BaseEnvelopeHeaders;
117
- type SpanEnvelopeHeaders = BaseEnvelopeHeaders;
118
108
  export type EventEnvelope = BaseEnvelope<EventEnvelopeHeaders, EventItem | AttachmentItem | UserFeedbackItem | FeedbackItem | ProfileItem>;
119
109
  export type SessionEnvelope = BaseEnvelope<SessionEnvelopeHeaders, SessionItem>;
120
110
  export type ClientReportEnvelope = BaseEnvelope<ClientReportEnvelopeHeaders, ClientReportItem>;
@@ -127,8 +117,7 @@ export type ReplayEnvelope = [
127
117
  ];
128
118
  export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
129
119
  export type StatsdEnvelope = BaseEnvelope<StatsdEnvelopeHeaders, StatsdItem>;
130
- export type SpanEnvelope = BaseEnvelope<SpanEnvelopeHeaders, SpanItem>;
131
- export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope | SpanEnvelope;
120
+ export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope;
132
121
  export type EnvelopeItem = Envelope[1][number];
133
122
  export {};
134
123
  //# sourceMappingURL=envelope.d.ts.map
@@ -10,8 +10,8 @@ import { Primitive } from './misc';
10
10
  import { Request } from './request';
11
11
  import { CaptureContext } from './scope';
12
12
  import { SdkInfo } from './sdkinfo';
13
- import { Severity, SeverityLevel } from './severity';
14
- import { MetricSummary, Span, SpanJSON } from './span';
13
+ import { SeverityLevel } from './severity';
14
+ import { MetricSummary, SpanJSON } from './span';
15
15
  import { Thread } from './thread';
16
16
  import { TransactionSource } from './transaction';
17
17
  import { User } from './user';
@@ -25,7 +25,7 @@ export interface Event {
25
25
  };
26
26
  timestamp?: number;
27
27
  start_timestamp?: number;
28
- level?: Severity | SeverityLevel;
28
+ level?: SeverityLevel;
29
29
  platform?: string;
30
30
  logger?: string;
31
31
  server_name?: string;
@@ -50,7 +50,7 @@ export interface Event {
50
50
  extra?: Extras;
51
51
  user?: User;
52
52
  type?: EventType;
53
- spans?: Span[];
53
+ spans?: Partial<SpanJSON>[];
54
54
  measurements?: Measurements;
55
55
  debug_meta?: DebugMeta;
56
56
  sdkProcessingMetadata?: {
@@ -87,14 +87,4 @@ export interface EventHint {
87
87
  data?: any;
88
88
  integrations?: string[];
89
89
  }
90
- /**
91
- * Represents the event that's sent in an event envelope, omitting interfaces that are no longer representative after
92
- * event serialization.
93
- */
94
- export interface SerializedEvent extends Pick<Event, Exclude<keyof Event, 'spans'>> {
95
- /**
96
- * POJO objects of spans belonging to this event.
97
- */
98
- spans?: SpanJSON[];
99
- }
100
90
  //# sourceMappingURL=event.d.ts.map