@sentry/react-native 5.0.0-alpha.1 → 5.0.0-alpha.10

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 (161) hide show
  1. package/CHANGELOG.md +346 -1
  2. package/README.md +6 -0
  3. package/RNSentry.podspec +21 -4
  4. package/android/build.gradle +20 -2
  5. package/android/src/main/java/io/sentry/react/{RNSentryModule.java → RNSentryModuleImpl.java} +174 -114
  6. package/android/src/main/java/io/sentry/react/RNSentryPackage.java +35 -19
  7. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +119 -0
  8. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +119 -0
  9. package/dist/js/NativeRNSentry.d.ts +52 -0
  10. package/dist/js/NativeRNSentry.d.ts.map +1 -0
  11. package/dist/js/NativeRNSentry.js +4 -0
  12. package/dist/js/NativeRNSentry.js.map +1 -0
  13. package/dist/js/client.d.ts +17 -4
  14. package/dist/js/client.d.ts.map +1 -1
  15. package/dist/js/client.js +90 -16
  16. package/dist/js/client.js.map +1 -1
  17. package/dist/js/index.d.ts +3 -3
  18. package/dist/js/index.d.ts.map +1 -1
  19. package/dist/js/index.js +2 -2
  20. package/dist/js/index.js.map +1 -1
  21. package/dist/js/integrations/debugsymbolicator.d.ts +9 -0
  22. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  23. package/dist/js/integrations/debugsymbolicator.js +0 -2
  24. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  25. package/dist/js/integrations/index.d.ts +2 -0
  26. package/dist/js/integrations/index.d.ts.map +1 -1
  27. package/dist/js/integrations/index.js +2 -0
  28. package/dist/js/integrations/index.js.map +1 -1
  29. package/dist/js/integrations/modulesloader.d.ts +17 -0
  30. package/dist/js/integrations/modulesloader.d.ts.map +1 -0
  31. package/dist/js/integrations/modulesloader.js +33 -0
  32. package/dist/js/integrations/modulesloader.js.map +1 -0
  33. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  34. package/dist/js/integrations/reactnativeerrorhandlers.js +6 -4
  35. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  36. package/dist/js/integrations/reactnativeinfo.d.ts +23 -0
  37. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -0
  38. package/dist/js/integrations/reactnativeinfo.js +43 -0
  39. package/dist/js/integrations/reactnativeinfo.js.map +1 -0
  40. package/dist/js/integrations/screenshot.d.ts +23 -0
  41. package/dist/js/integrations/screenshot.d.ts.map +1 -0
  42. package/dist/js/integrations/screenshot.js +39 -0
  43. package/dist/js/integrations/screenshot.js.map +1 -0
  44. package/dist/js/integrations/sdkinfo.d.ts +4 -1
  45. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  46. package/dist/js/integrations/sdkinfo.js +13 -7
  47. package/dist/js/integrations/sdkinfo.js.map +1 -1
  48. package/dist/js/measurements.js +1 -1
  49. package/dist/js/measurements.js.map +1 -1
  50. package/dist/js/misc.d.ts +9 -0
  51. package/dist/js/misc.d.ts.map +1 -0
  52. package/dist/js/misc.js +17 -0
  53. package/dist/js/misc.js.map +1 -0
  54. package/dist/js/options.d.ts +45 -8
  55. package/dist/js/options.d.ts.map +1 -1
  56. package/dist/js/options.js.map +1 -1
  57. package/dist/js/scope.d.ts +10 -2
  58. package/dist/js/scope.d.ts.map +1 -1
  59. package/dist/js/scope.js +13 -1
  60. package/dist/js/scope.js.map +1 -1
  61. package/dist/js/sdk.d.ts +25 -0
  62. package/dist/js/sdk.d.ts.map +1 -1
  63. package/dist/js/sdk.js +85 -27
  64. package/dist/js/sdk.js.map +1 -1
  65. package/dist/js/tools/ModulesCollector.d.ts +17 -0
  66. package/dist/js/tools/ModulesCollector.d.ts.map +1 -0
  67. package/dist/js/tools/ModulesCollector.js +109 -0
  68. package/dist/js/tools/ModulesCollector.js.map +1 -0
  69. package/dist/js/tools/collectModules.d.ts +2 -0
  70. package/dist/js/tools/collectModules.d.ts.map +1 -0
  71. package/dist/js/tools/collectModules.js +11 -0
  72. package/dist/js/tools/collectModules.js.map +1 -0
  73. package/dist/js/touchevents.d.ts +4 -0
  74. package/dist/js/touchevents.d.ts.map +1 -1
  75. package/dist/js/touchevents.js.map +1 -1
  76. package/dist/js/tracing/nativeframes.js.map +1 -1
  77. package/dist/js/tracing/reactnativenavigation.d.ts +9 -0
  78. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  79. package/dist/js/tracing/reactnativenavigation.js +20 -12
  80. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  81. package/dist/js/tracing/reactnativetracing.d.ts +15 -6
  82. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  83. package/dist/js/tracing/reactnativetracing.js +16 -9
  84. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  85. package/dist/js/tracing/reactnavigation.d.ts +7 -1
  86. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  87. package/dist/js/tracing/reactnavigation.js +31 -23
  88. package/dist/js/tracing/reactnavigation.js.map +1 -1
  89. package/dist/js/tracing/reactnavigationv4.d.ts +9 -9
  90. package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
  91. package/dist/js/tracing/reactnavigationv4.js +27 -15
  92. package/dist/js/tracing/reactnavigationv4.js.map +1 -1
  93. package/dist/js/tracing/routingInstrumentation.d.ts +1 -1
  94. package/dist/js/tracing/routingInstrumentation.d.ts.map +1 -1
  95. package/dist/js/tracing/routingInstrumentation.js.map +1 -1
  96. package/dist/js/tracing/utils.d.ts +4 -3
  97. package/dist/js/tracing/utils.d.ts.map +1 -1
  98. package/dist/js/tracing/utils.js +7 -10
  99. package/dist/js/tracing/utils.js.map +1 -1
  100. package/dist/js/transports/TextEncoder.d.ts +3 -0
  101. package/dist/js/transports/TextEncoder.d.ts.map +1 -0
  102. package/dist/js/transports/TextEncoder.js +12 -0
  103. package/dist/js/transports/TextEncoder.js.map +1 -0
  104. package/dist/js/transports/native.d.ts +6 -1
  105. package/dist/js/transports/native.d.ts.map +1 -1
  106. package/dist/js/transports/native.js +6 -4
  107. package/dist/js/transports/native.js.map +1 -1
  108. package/dist/js/user.d.ts +6 -0
  109. package/dist/js/user.d.ts.map +1 -0
  110. package/dist/js/user.js +1 -0
  111. package/dist/js/user.js.map +1 -0
  112. package/dist/js/utils/envelope.d.ts +12 -0
  113. package/dist/js/utils/envelope.d.ts.map +1 -0
  114. package/dist/js/utils/envelope.js +21 -0
  115. package/dist/js/utils/envelope.js.map +1 -0
  116. package/dist/js/utils/environment.d.ts +7 -0
  117. package/dist/js/utils/environment.d.ts.map +1 -0
  118. package/dist/js/utils/environment.js +14 -0
  119. package/dist/js/utils/environment.js.map +1 -0
  120. package/dist/js/utils/outcome.d.ts +6 -0
  121. package/dist/js/utils/outcome.d.ts.map +1 -0
  122. package/dist/js/utils/outcome.js +19 -0
  123. package/dist/js/utils/outcome.js.map +1 -0
  124. package/dist/js/utils/safe.d.ts +18 -0
  125. package/dist/js/utils/safe.d.ts.map +1 -0
  126. package/dist/js/utils/safe.js +46 -0
  127. package/dist/js/utils/safe.js.map +1 -0
  128. package/dist/js/utils/worldwide.d.ts +13 -0
  129. package/dist/js/utils/worldwide.d.ts.map +1 -0
  130. package/dist/js/utils/worldwide.js +4 -0
  131. package/dist/js/utils/worldwide.js.map +1 -0
  132. package/dist/js/vendor/buffer/index.d.ts +2 -0
  133. package/dist/js/vendor/buffer/index.d.ts.map +1 -0
  134. package/dist/js/vendor/buffer/index.js +2 -0
  135. package/dist/js/vendor/buffer/index.js.map +1 -0
  136. package/dist/js/vendor/buffer/utf8ToBytes.d.ts +10 -0
  137. package/dist/js/vendor/buffer/utf8ToBytes.d.ts.map +1 -0
  138. package/dist/js/vendor/buffer/utf8ToBytes.js +82 -0
  139. package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -0
  140. package/dist/js/vendor/index.d.ts +2 -0
  141. package/dist/js/vendor/index.d.ts.map +1 -0
  142. package/dist/js/vendor/index.js +2 -0
  143. package/dist/js/vendor/index.js.map +1 -0
  144. package/dist/js/version.d.ts +2 -1
  145. package/dist/js/version.d.ts.map +1 -1
  146. package/dist/js/version.js +2 -1
  147. package/dist/js/version.js.map +1 -1
  148. package/dist/js/wrapper.d.ts +13 -4
  149. package/dist/js/wrapper.d.ts.map +1 -1
  150. package/dist/js/wrapper.js +126 -71
  151. package/dist/js/wrapper.js.map +1 -1
  152. package/ios/{RNSentry.m → RNSentry.mm} +98 -57
  153. package/package.json +31 -25
  154. package/sample-new-architecture/react-native.config.js +10 -0
  155. package/scripts/collect-modules.sh +43 -0
  156. package/sentry.gradle +57 -6
  157. package/src/js/NativeRNSentry.ts +66 -0
  158. package/dist/js/definitions.d.ts +0 -52
  159. package/dist/js/definitions.d.ts.map +0 -1
  160. package/dist/js/definitions.js +0 -1
  161. package/dist/js/definitions.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { makePromiseBuffer } from '@sentry/utils';
2
2
  import { NATIVE } from '../wrapper';
3
+ export const DEFAULT_BUFFER_SIZE = 30;
3
4
  /** Native Transport class implementation */
4
5
  export class NativeTransport {
5
- constructor() {
6
- /** A simple buffer holding all requests. */
7
- this._buffer = makePromiseBuffer(30);
6
+ constructor(options = {}) {
7
+ this._buffer = makePromiseBuffer(options.bufferSize || DEFAULT_BUFFER_SIZE);
8
8
  }
9
9
  /**
10
10
  * Sends the envelope to the Store endpoint in Sentry.
@@ -29,5 +29,7 @@ export class NativeTransport {
29
29
  /**
30
30
  * Creates a Native Transport.
31
31
  */
32
- export function makeReactNativeTransport() { return new NativeTransport(); }
32
+ export function makeReactNativeTransport(options = {}) {
33
+ return new NativeTransport(options);
34
+ }
33
35
  //# sourceMappingURL=native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QACE,4CAA4C;QACzB,YAAO,GAAwB,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAsB1E,CAAC;IApBC;;;;OAIG;IACI,IAAI,CAAC,QAAkB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,KAAsB,OAAO,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC","sourcesContent":["import { BaseTransportOptions, Envelope, Transport } from '@sentry/types';\nimport { makePromiseBuffer, PromiseBuffer } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\nexport type BaseNativeTransport = BaseTransportOptions\n\n/** Native Transport class implementation */\nexport class NativeTransport implements Transport {\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer<void> = makePromiseBuffer(30);\n\n /**\n * Sends the envelope to the Store endpoint in Sentry.\n *\n * @param envelope Envelope that should be sent to Sentry.\n */\n public send(envelope: Envelope): PromiseLike<void> {\n return this._buffer.add(() => NATIVE.sendEnvelope(envelope));\n }\n\n /**\n * Wait for all envelopes to be sent or the timeout to expire, whichever comes first.\n *\n * @param timeout Maximum time in ms the transport should wait for envelopes to be flushed. Omitting this parameter will\n * cause the transport to wait until all events are sent before resolving the promise.\n * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are\n * still events in the queue when the timeout is reached.\n */\n public flush(timeout?: number): PromiseLike<boolean> {\n return this._buffer.drain(timeout);\n }\n}\n\n/**\n * Creates a Native Transport.\n */\nexport function makeReactNativeTransport(): NativeTransport { return new NativeTransport(); }\n"]}
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAQtC,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAI1B,YAAmB,UAAsC,EAAE;QACzD,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,QAAkB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAsC,EAAE;IAC/E,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { BaseTransportOptions, Envelope, Transport } from '@sentry/types';\nimport { makePromiseBuffer, PromiseBuffer } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\nexport const DEFAULT_BUFFER_SIZE = 30;\n\nexport type BaseNativeTransport = BaseTransportOptions\n\nexport interface BaseNativeTransportOptions {\n bufferSize?: number;\n}\n\n/** Native Transport class implementation */\nexport class NativeTransport implements Transport {\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer<void>;\n\n public constructor(options: BaseNativeTransportOptions = {}) {\n this._buffer = makePromiseBuffer(options.bufferSize || DEFAULT_BUFFER_SIZE);\n }\n\n /**\n * Sends the envelope to the Store endpoint in Sentry.\n *\n * @param envelope Envelope that should be sent to Sentry.\n */\n public send(envelope: Envelope): PromiseLike<void> {\n return this._buffer.add(() => NATIVE.sendEnvelope(envelope));\n }\n\n /**\n * Wait for all envelopes to be sent or the timeout to expire, whichever comes first.\n *\n * @param timeout Maximum time in ms the transport should wait for envelopes to be flushed. Omitting this parameter will\n * cause the transport to wait until all events are sent before resolving the promise.\n * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are\n * still events in the queue when the timeout is reached.\n */\n public flush(timeout?: number): PromiseLike<boolean> {\n return this._buffer.drain(timeout);\n }\n}\n\n/**\n * Creates a Native Transport.\n */\nexport function makeReactNativeTransport(options: BaseNativeTransportOptions = {}): NativeTransport {\n return new NativeTransport(options);\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { User } from '@sentry/types';
2
+ /** Requires all the keys defined on User interface to be present on an object */
3
+ export declare type RequiredKeysUser = {
4
+ [P in keyof Required<User>]: User[P] | undefined;
5
+ };
6
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,iFAAiF;AACjF,oBAAY,gBAAgB,GAAG;KAAG,CAAC,IAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS;CAAG,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '@sentry/types';\n\n/** Requires all the keys defined on User interface to be present on an object */\nexport type RequiredKeysUser = { [P in keyof Required<User>]: User[P] | undefined; };\n"]}
@@ -0,0 +1,12 @@
1
+ import { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback } from '@sentry/types';
2
+ export declare const header = 0;
3
+ export declare const items = 1;
4
+ /**
5
+ * Creates an envelope from a user feedback.
6
+ */
7
+ export declare function createUserFeedbackEnvelope(feedback: UserFeedback, { metadata, tunnel, dsn, }: {
8
+ metadata: SdkMetadata | undefined;
9
+ tunnel: string | undefined;
10
+ dsn: DsnComponents | undefined;
11
+ }): EventEnvelope;
12
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EAEb,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,KAAK,IAAI,CAAC;AAEvB;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GACJ,EAAE;IACD,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;CAChC,GACA,aAAa,CAaf"}
@@ -0,0 +1,21 @@
1
+ import { createEnvelope, dsnToString } from '@sentry/utils';
2
+ export const header = 0;
3
+ export const items = 1;
4
+ /**
5
+ * Creates an envelope from a user feedback.
6
+ */
7
+ export function createUserFeedbackEnvelope(feedback, { metadata, tunnel, dsn, }) {
8
+ const headers = Object.assign(Object.assign({ event_id: feedback.event_id, sent_at: new Date().toISOString() }, (metadata && metadata.sdk && { sdk: {
9
+ name: metadata.sdk.name,
10
+ version: metadata.sdk.version,
11
+ } })), (!!tunnel && !!dsn && { dsn: dsnToString(dsn) }));
12
+ const item = createUserFeedbackEnvelopeItem(feedback);
13
+ return createEnvelope(headers, [item]);
14
+ }
15
+ function createUserFeedbackEnvelopeItem(feedback) {
16
+ const feedbackHeaders = {
17
+ type: 'user_report',
18
+ };
19
+ return [feedbackHeaders, feedback];
20
+ }
21
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC;AACxB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC;AAEvB;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAAsB,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GAKJ;IAED,MAAM,OAAO,iCACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IAC9B,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;YACrC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;YACvB,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;SAC9B,EAAC,CAAC,GACA,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CACpD,CAAC;IACF,MAAM,IAAI,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAEtD,OAAO,cAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,8BAA8B,CACrC,QAAsB;IAEtB,MAAM,eAAe,GAAwB;QAC3C,IAAI,EAAE,aAAa;KACpB,CAAC;IACF,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {\n DsnComponents,\n EventEnvelope,\n SdkMetadata,\n UserFeedback,\n UserFeedbackItem,\n} from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\nexport const header = 0;\nexport const items = 1;\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined,\n tunnel: string | undefined,\n dsn: DsnComponents | undefined,\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata && metadata.sdk && { sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n }}),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(\n feedback: UserFeedback\n): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /** Checks if the React Native Hermes engine is running */
2
+ export declare function isHermesEnabled(): boolean;
3
+ /** Checks if the React Native TurboModules are enabled */
4
+ export declare function isTurboModuleEnabled(): boolean;
5
+ /** Checks if the React Native Fabric renderer is running */
6
+ export declare function isFabricEnabled(): boolean;
7
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAEA,0DAA0D;AAC1D,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,0DAA0D;AAC1D,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
@@ -0,0 +1,14 @@
1
+ import { RN_GLOBAL_OBJ } from '../utils/worldwide';
2
+ /** Checks if the React Native Hermes engine is running */
3
+ export function isHermesEnabled() {
4
+ return !!RN_GLOBAL_OBJ.HermesInternal;
5
+ }
6
+ /** Checks if the React Native TurboModules are enabled */
7
+ export function isTurboModuleEnabled() {
8
+ return RN_GLOBAL_OBJ.__turboModuleProxy != null;
9
+ }
10
+ /** Checks if the React Native Fabric renderer is running */
11
+ export function isFabricEnabled() {
12
+ return RN_GLOBAL_OBJ.nativeFabricUIManager != null;
13
+ }
14
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC;AACxC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,oBAAoB;IAClC,OAAO,aAAa,CAAC,kBAAkB,IAAI,IAAI,CAAC;AAClD,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAC,qBAAqB,IAAI,IAAI,CAAC;AACrD,CAAC","sourcesContent":["import { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** Checks if the React Native Hermes engine is running */\nexport function isHermesEnabled(): boolean {\n return !!RN_GLOBAL_OBJ.HermesInternal;\n}\n\n/** Checks if the React Native TurboModules are enabled */\nexport function isTurboModuleEnabled(): boolean {\n return RN_GLOBAL_OBJ.__turboModuleProxy != null;\n}\n\n/** Checks if the React Native Fabric renderer is running */\nexport function isFabricEnabled(): boolean {\n return RN_GLOBAL_OBJ.nativeFabricUIManager != null;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Outcome } from '@sentry/types';
2
+ /**
3
+ * Merges buffer with new outcomes.
4
+ */
5
+ export declare function mergeOutcomes(...merge: Outcome[][]): Outcome[];
6
+ //# sourceMappingURL=outcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../../src/js/utils/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,CAgB9D"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Merges buffer with new outcomes.
3
+ */
4
+ export function mergeOutcomes(...merge) {
5
+ const map = new Map();
6
+ const process = (outcome) => {
7
+ const key = `${outcome.reason}:${outcome.category}`;
8
+ const existing = map.get(key);
9
+ if (existing) {
10
+ existing.quantity += outcome.quantity;
11
+ }
12
+ else {
13
+ map.set(key, outcome);
14
+ }
15
+ };
16
+ merge.forEach((outcomes) => outcomes.forEach(process));
17
+ return [...map.values()];
18
+ }
19
+ //# sourceMappingURL=outcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../../src/js/utils/outcome.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,KAAkB;IACjD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEvC,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAQ,EAAE;QACzC,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;SACvC;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;SACvB;IACH,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAEvD,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { Outcome } from '@sentry/types';\n\n/**\n * Merges buffer with new outcomes.\n */\nexport function mergeOutcomes(...merge: Outcome[][]): Outcome[] {\n const map = new Map<string, Outcome>();\n\n const process = (outcome: Outcome): void => {\n const key = `${outcome.reason}:${outcome.category}`;\n const existing = map.get(key);\n if (existing) {\n existing.quantity += outcome.quantity;\n } else {\n map.set(key, outcome);\n }\n };\n\n merge.forEach((outcomes) => outcomes.forEach(process));\n\n return [...map.values()];\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { ReactNativeOptions } from '../options';
2
+ declare type DangerTypesWithoutCallSignature = Object | null | undefined;
3
+ /**
4
+ * Returns callback factory wrapped with try/catch
5
+ * or the original passed value is it's not a function.
6
+ *
7
+ * If the factory fails original data are returned as it.
8
+ * They might be partially modified by the failed function.
9
+ */
10
+ export declare function safeFactory<A extends [R, ...unknown[]], R, T extends DangerTypesWithoutCallSignature>(danger: ((...args: A) => R) | T, options?: {
11
+ loggerMessage?: string;
12
+ }): ((...args: A) => R) | T;
13
+ /**
14
+ * Returns sage tracesSampler that returns 0 if the original failed.
15
+ */
16
+ export declare function safeTracesSampler(tracesSampler: ReactNativeOptions['tracesSampler']): ReactNativeOptions['tracesSampler'];
17
+ export {};
18
+ //# sourceMappingURL=safe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../src/js/utils/safe.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,aAAK,+BAA+B,GAEhC,MAAM,GACN,IAAI,GACJ,SAAS,CAAC;AAEd;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,+BAA+B,EACnG,MAAM,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAC/B,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,MAAM,CAAC;CACnB,GACL,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAkBzB;AAID;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,kBAAkB,CAAC,eAAe,CAAC,GACjD,kBAAkB,CAAC,eAAe,CAAC,CAerC"}
@@ -0,0 +1,46 @@
1
+ import { logger } from '@sentry/utils';
2
+ /**
3
+ * Returns callback factory wrapped with try/catch
4
+ * or the original passed value is it's not a function.
5
+ *
6
+ * If the factory fails original data are returned as it.
7
+ * They might be partially modified by the failed function.
8
+ */
9
+ export function safeFactory(danger, options = {}) {
10
+ if (typeof danger === 'function') {
11
+ return (...args) => {
12
+ try {
13
+ return danger(...args);
14
+ }
15
+ catch (error) {
16
+ logger.error(options.loggerMessage
17
+ ? options.loggerMessage
18
+ : `The ${danger.name} callback threw an error`, error);
19
+ return args[0];
20
+ }
21
+ };
22
+ }
23
+ else {
24
+ return danger;
25
+ }
26
+ }
27
+ /**
28
+ * Returns sage tracesSampler that returns 0 if the original failed.
29
+ */
30
+ export function safeTracesSampler(tracesSampler) {
31
+ if (tracesSampler) {
32
+ return (...args) => {
33
+ try {
34
+ return tracesSampler(...args);
35
+ }
36
+ catch (error) {
37
+ logger.error('The tracesSampler callback threw an error', error);
38
+ return 0;
39
+ }
40
+ };
41
+ }
42
+ else {
43
+ return tracesSampler;
44
+ }
45
+ }
46
+ //# sourceMappingURL=safe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe.js","sourceRoot":"","sources":["../../../src/js/utils/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAUvC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,MAA+B,EAC/B,UAEI,EAAE;IAEN,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;QAChC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE;YACjB,IAAI;gBACF,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;aACxB;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CACV,OAAO,CAAC,aAAa;oBACnB,CAAC,CAAC,OAAO,CAAC,aAAa;oBACvB,CAAC,CAAC,OAAO,MAAM,CAAC,IAAI,0BAA0B,EAChD,KAAK,CACN,CAAC;gBACF,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;aAChB;QACH,CAAC,CAAC;KACH;SAAM;QACL,OAAO,MAAM,CAAC;KACf;AACH,CAAC;AAID;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAAkD;IAElD,IAAI,aAAa,EAAE;QACjB,OAAO,CACL,GAAG,IAA+B,EACP,EAAE;YAC7B,IAAI;gBACF,OAAO,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;aAC/B;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,KAAK,CAAC,CAAC;gBACjE,OAAO,CAAC,CAAC;aACV;QACH,CAAC,CAAA;KACF;SAAM;QACL,OAAO,aAAa,CAAC;KACtB;AACH,CAAC","sourcesContent":["import { logger } from '@sentry/utils';\n\nimport { ReactNativeOptions } from '../options';\n\ntype DangerTypesWithoutCallSignature =\n// eslint-disable-next-line @typescript-eslint/ban-types\n | Object\n | null\n | undefined;\n\n/**\n * Returns callback factory wrapped with try/catch\n * or the original passed value is it's not a function.\n *\n * If the factory fails original data are returned as it.\n * They might be partially modified by the failed function.\n */\nexport function safeFactory<A extends [R, ...unknown[]], R, T extends DangerTypesWithoutCallSignature>(\n danger: ((...args: A) => R) | T,\n options: {\n loggerMessage?: string;\n } = {},\n): ((...args: A) => R) | T {\n if (typeof danger === 'function') {\n return (...args) => {\n try {\n return danger(...args);\n } catch (error) {\n logger.error(\n options.loggerMessage\n ? options.loggerMessage\n : `The ${danger.name} callback threw an error`,\n error,\n );\n return args[0];\n }\n };\n } else {\n return danger;\n }\n}\n\ntype TracesSampler = Required<ReactNativeOptions>['tracesSampler'];\n\n/**\n * Returns sage tracesSampler that returns 0 if the original failed.\n */\nexport function safeTracesSampler(\n tracesSampler: ReactNativeOptions['tracesSampler'],\n): ReactNativeOptions['tracesSampler'] {\n if (tracesSampler) {\n return (\n ...args: Parameters<TracesSampler>\n ): ReturnType<TracesSampler> => {\n try {\n return tracesSampler(...args);\n } catch (error) {\n logger.error('The tracesSampler callback threw an error', error);\n return 0;\n }\n }\n } else {\n return tracesSampler;\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { InternalGlobal } from '@sentry/utils';
2
+ /** Internal Global object interface with common and Sentry specific properties */
3
+ export interface ReactNativeInternalGlobal extends InternalGlobal {
4
+ __sentry_rn_v4_registered?: boolean;
5
+ __sentry_rn_v5_registered?: boolean;
6
+ HermesInternal: unknown;
7
+ Promise: unknown;
8
+ __turboModuleProxy: unknown;
9
+ nativeFabricUIManager: unknown;
10
+ }
11
+ /** Get's the global object for the current JavaScript runtime */
12
+ export declare const RN_GLOBAL_OBJ: ReactNativeInternalGlobal;
13
+ //# sourceMappingURL=worldwide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3D,kFAAkF;AAClF,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,2BAA0C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { GLOBAL_OBJ } from '@sentry/utils';
2
+ /** Get's the global object for the current JavaScript runtime */
3
+ export const RN_GLOBAL_OBJ = GLOBAL_OBJ;
4
+ //# sourceMappingURL=worldwide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,eAAe,CAAC;AAY3D,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,UAAuC,CAAC","sourcesContent":["import { GLOBAL_OBJ, InternalGlobal } from '@sentry/utils';\n\n/** Internal Global object interface with common and Sentry specific properties */\nexport interface ReactNativeInternalGlobal extends InternalGlobal {\n __sentry_rn_v4_registered?: boolean;\n __sentry_rn_v5_registered?: boolean;\n HermesInternal: unknown;\n Promise: unknown;\n __turboModuleProxy: unknown;\n nativeFabricUIManager: unknown;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const RN_GLOBAL_OBJ = GLOBAL_OBJ as ReactNativeInternalGlobal;\n"]}
@@ -0,0 +1,2 @@
1
+ export { utf8ToBytes, } from './utf8ToBytes';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/buffer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GACZ,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { utf8ToBytes, } from './utf8ToBytes';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/buffer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GACZ,MAAM,eAAe,CAAC","sourcesContent":["export {\n utf8ToBytes,\n} from './utf8ToBytes';\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Convert a string to a byte array
3
+ *
4
+ * This is a utf8ToBytes function from the buffer module (with added types)
5
+ * https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956
6
+ *
7
+ * License: MIT (https://github.com/feross/buffer)
8
+ */
9
+ export declare function utf8ToBytes(string: string, units?: number): number[];
10
+ //# sourceMappingURL=utf8ToBytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utf8ToBytes.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/buffer/utf8ToBytes.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CA8EpE"}
@@ -0,0 +1,82 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Convert a string to a byte array
4
+ *
5
+ * This is a utf8ToBytes function from the buffer module (with added types)
6
+ * https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956
7
+ *
8
+ * License: MIT (https://github.com/feross/buffer)
9
+ */
10
+ export function utf8ToBytes(string, units) {
11
+ units = units || Infinity;
12
+ let codePoint;
13
+ const length = string.length;
14
+ let leadSurrogate = null;
15
+ const bytes = [];
16
+ for (let i = 0; i < length; ++i) {
17
+ codePoint = string.charCodeAt(i);
18
+ // is surrogate component
19
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
20
+ // last char was a lead
21
+ if (!leadSurrogate) {
22
+ // no lead yet
23
+ if (codePoint > 0xDBFF) {
24
+ // unexpected trail
25
+ if ((units -= 3) > -1)
26
+ bytes.push(0xEF, 0xBF, 0xBD);
27
+ continue;
28
+ }
29
+ else if (i + 1 === length) {
30
+ // unpaired lead
31
+ if ((units -= 3) > -1)
32
+ bytes.push(0xEF, 0xBF, 0xBD);
33
+ continue;
34
+ }
35
+ // valid lead
36
+ leadSurrogate = codePoint;
37
+ continue;
38
+ }
39
+ // 2 leads in a row
40
+ if (codePoint < 0xDC00) {
41
+ if ((units -= 3) > -1)
42
+ bytes.push(0xEF, 0xBF, 0xBD);
43
+ leadSurrogate = codePoint;
44
+ continue;
45
+ }
46
+ // valid surrogate pair
47
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
48
+ }
49
+ else if (leadSurrogate) {
50
+ // valid bmp char, but last char was a lead
51
+ if ((units -= 3) > -1)
52
+ bytes.push(0xEF, 0xBF, 0xBD);
53
+ }
54
+ leadSurrogate = null;
55
+ // encode utf8
56
+ if (codePoint < 0x80) {
57
+ if ((units -= 1) < 0)
58
+ break;
59
+ bytes.push(codePoint);
60
+ }
61
+ else if (codePoint < 0x800) {
62
+ if ((units -= 2) < 0)
63
+ break;
64
+ bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
65
+ }
66
+ else if (codePoint < 0x10000) {
67
+ if ((units -= 3) < 0)
68
+ break;
69
+ bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
70
+ }
71
+ else if (codePoint < 0x110000) {
72
+ if ((units -= 4) < 0)
73
+ break;
74
+ bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
75
+ }
76
+ else {
77
+ throw new Error('Invalid code point');
78
+ }
79
+ }
80
+ return bytes;
81
+ }
82
+ //# sourceMappingURL=utf8ToBytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utf8ToBytes.js","sourceRoot":"","sources":["../../../../src/js/vendor/buffer/utf8ToBytes.ts"],"names":[],"mappings":"AAAA,oBAAoB;AAEpB;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,KAAc;IACxD,KAAK,GAAG,KAAK,IAAI,QAAQ,CAAA;IACzB,IAAI,SAAS,CAAA;IACb,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;IAC5B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AA;AACd,CAAC","sourcesContent":["/* eslint-disable */\n\n/**\n * Convert a string to a byte array\n *\n * This is a utf8ToBytes function from the buffer module (with added types)\n * https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956\n *\n * License: MIT (https://github.com/feross/buffer)\n */\nexport function utf8ToBytes(string: string, units?: number): number[] {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes: number[] = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { utf8ToBytes, } from './buffer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,GACZ,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { utf8ToBytes, } from './buffer';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,GACZ,MAAM,UAAU,CAAC","sourcesContent":["\nexport {\n utf8ToBytes,\n} from './buffer';\n"]}
@@ -1,3 +1,4 @@
1
+ export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
1
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
2
- export declare const SDK_VERSION = "5.0.0-alpha.1";
3
+ export declare const SDK_VERSION = "5.0.0-alpha.10";
3
4
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,kBAAkB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,mBAAmB,CAAC"}
@@ -1,3 +1,4 @@
1
+ export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
1
2
  export const SDK_NAME = 'sentry.javascript.react-native';
2
- export const SDK_VERSION = '5.0.0-alpha.1';
3
+ export const SDK_VERSION = '5.0.0-alpha.10';
3
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC","sourcesContent":["export const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.0.0-alpha.1';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.0.0-alpha.10';\n"]}
@@ -1,14 +1,19 @@
1
- import { AttachmentItem, Breadcrumb, ClientReportItem, Envelope, Event, EventItem, Package, SessionItem, SeverityLevel, User, UserFeedbackItem } from '@sentry/types';
1
+ import { Breadcrumb, Envelope, EnvelopeItem, Event, Package, SeverityLevel, User } from '@sentry/types';
2
2
  import { Platform } from 'react-native';
3
- import { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse, SentryNativeBridgeModule } from './definitions';
3
+ import { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse, Spec } from './NativeRNSentry';
4
4
  import { ReactNativeOptions } from './options';
5
+ export interface Screenshot {
6
+ data: Uint8Array;
7
+ contentType: string;
8
+ filename: string;
9
+ }
5
10
  interface SentryNativeWrapper {
6
11
  enableNative: boolean;
7
12
  nativeIsReady: boolean;
8
13
  platform: typeof Platform.OS;
9
14
  _NativeClientError: Error;
10
15
  _DisabledNativeError: Error;
11
- _getEvent(envelopeItem: EventItem | AttachmentItem | UserFeedbackItem | SessionItem | ClientReportItem): Event | undefined;
16
+ _processItem(envelopeItem: EnvelopeItem): EnvelopeItem;
12
17
  _processLevels(event: Event): Event;
13
18
  _processLevel(level: SeverityLevel): SeverityLevel;
14
19
  _serializeObject(data: {
@@ -16,17 +21,20 @@ interface SentryNativeWrapper {
16
21
  }): {
17
22
  [key: string]: string;
18
23
  };
19
- _isModuleLoaded(module: SentryNativeBridgeModule | undefined): module is SentryNativeBridgeModule;
24
+ _isModuleLoaded(module: Spec | undefined): module is Spec;
25
+ _getBreadcrumbs(event: Event): Breadcrumb[] | undefined;
20
26
  isNativeTransportAvailable(): boolean;
21
27
  initNativeSdk(options: ReactNativeOptions): PromiseLike<boolean>;
22
28
  closeNativeSdk(): PromiseLike<void>;
23
29
  sendEnvelope(envelope: Envelope): Promise<void>;
30
+ captureScreenshot(): Promise<Screenshot[] | null>;
24
31
  fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;
25
32
  fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse>;
26
33
  fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;
27
34
  fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;
28
35
  fetchNativeSdkInfo(): PromiseLike<Package | null>;
29
36
  disableNativeFramesTracking(): void;
37
+ enableNativeFramesTracking(): void;
30
38
  addBreadcrumb(breadcrumb: Breadcrumb): void;
31
39
  setContext(key: string, context: {
32
40
  [key: string]: unknown;
@@ -36,6 +44,7 @@ interface SentryNativeWrapper {
36
44
  setUser(user: User | null): void;
37
45
  setTag(key: string, value: string): void;
38
46
  nativeCrash(): void;
47
+ fetchModules(): Promise<Record<string, string> | null>;
39
48
  }
40
49
  /**
41
50
  * Our internal interface for calling native functions
@@ -1 +1 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