@sentry/react-native 5.14.1 → 5.15.1
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 +36 -0
- package/RNSentry.podspec +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +3 -5
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +1 -1
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +1 -1
- package/dist/js/NativeRNSentry.d.ts +1 -1
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/index.d.ts +4 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts +25 -3
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +109 -70
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts +4 -0
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +10 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/tracing/index.d.ts +3 -2
- package/dist/js/tracing/index.d.ts.map +1 -1
- package/dist/js/tracing/index.js.map +1 -1
- package/dist/js/utils/error.d.ts +19 -0
- package/dist/js/utils/error.d.ts.map +1 -0
- package/dist/js/utils/error.js +30 -0
- package/dist/js/utils/error.js.map +1 -0
- package/dist/js/vendor/base64-js/fromByteArray.d.ts +5 -0
- package/dist/js/vendor/base64-js/fromByteArray.d.ts.map +1 -0
- package/dist/js/vendor/base64-js/fromByteArray.js +61 -0
- package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -0
- package/dist/js/vendor/base64-js/index.d.ts +2 -0
- package/dist/js/vendor/base64-js/index.d.ts.map +1 -0
- package/dist/js/vendor/base64-js/index.js +2 -0
- package/dist/js/vendor/base64-js/index.js.map +1 -0
- package/dist/js/vendor/index.d.ts +2 -0
- package/dist/js/vendor/index.d.ts.map +1 -1
- package/dist/js/vendor/index.js +2 -0
- package/dist/js/vendor/index.js.map +1 -1
- package/dist/js/vendor/react-native/index.d.ts +27 -0
- package/dist/js/vendor/react-native/index.d.ts.map +1 -0
- package/dist/js/vendor/react-native/index.js +3 -0
- package/dist/js/vendor/react-native/index.js.map +1 -0
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +18 -12
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +2 -6
- package/metro.d.ts +1 -0
- package/metro.js +1 -0
- package/package.json +5 -5
- package/{sample-new-architecture → samples/react-native}/react-native.config.js +1 -1
- package/scripts/sentry-xcode.sh +1 -1
- package/src/js/NativeRNSentry.ts +1 -1
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
- package/ts3.8/dist/js/index.d.ts +4 -3
- package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +25 -3
- package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +4 -0
- package/ts3.8/dist/js/tracing/index.d.ts +3 -2
- package/ts3.8/dist/js/utils/error.d.ts +19 -0
- package/ts3.8/dist/js/vendor/base64-js/fromByteArray.d.ts +5 -0
- package/ts3.8/dist/js/vendor/base64-js/index.d.ts +2 -0
- package/ts3.8/dist/js/vendor/index.d.ts +2 -0
- package/ts3.8/dist/js/vendor/react-native/index.d.ts +27 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,qBAAqB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, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, logger } from '@sentry/utils';\n\nimport type { ReactNativeClient } from '../client';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n const Promise = this._getPromisePolyfill();\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n\n /**\n * Single source of truth for the Promise implementation we want to use.\n * This is important for verifying that the rejected promise tracing will work as expected.\n */\n private _getPromisePolyfill(): unknown {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n return require('promise/setimmediate/es6-extensions');\n }\n\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking: {\n disable: () => void;\n enable: (arg: unknown) => void;\n // eslint-disable-next-line import/no-extraneous-dependencies,@typescript-eslint/no-var-requires\n } = require('promise/setimmediate/rejection-tracking');\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n },\n onHandled: id => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: Error) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // `promise` package is a dependency of react-native, therefore it is always available.\n // but it is possible that the user has installed a different version of promise\n // or dependency that uses a different version.\n // We have to check if the React Native Promise and the `promise` package Promise are using the same reference.\n // If they are not, likely there are multiple versions of the `promise` package installed.\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const ReactNativePromise = require('react-native/Libraries/Promise');\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const PromisePackagePromise = require('promise/setimmediate/es6-extensions');\n const UsedPromisePolyfill = this._getPromisePolyfill();\n\n if (ReactNativePromise !== PromisePackagePromise) {\n logger.warn(\n 'You appear to have multiple versions of the \"promise\" package installed. ' +\n 'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +\n 'Please install the `promise` package manually using the exact version as the React Native package. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n\n // This only make sense if the user disabled the integration Polyfill\n if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler && errorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n const scope = currentHub.getScope();\n\n if (!client) {\n logger.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const hint: EventHint = {\n originalException: error,\n attachments: scope?.getAttachments(),\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event, hint);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcnD,2CAA2C;AAC3C,MAAM,OAAO,wBAAwB;IAcnC,kBAAkB;IAClB,YAAmB,OAAkD;QATrE;;WAEG;QACI,SAAI,GAAW,wBAAwB,CAAC,EAAE,CAAC;QAOhD,IAAI,CAAC,QAAQ,mBACX,OAAO,EAAE,IAAI,EACb,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,IAAI,IACrB,OAAO,CACX,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,SAAS;QACd,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,IAAI,I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BAAL,KAAK,CAAE,cAAc,EAAE;iBACrC,CAAC;gBACF,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAE3D,IAAI,OAAO,EAAE;oBACX,KAAK,CAAC,KAAK,GAAG,OAAwB,CAAC;oBAEvC,qBAAqB,CAAC,KAAK,EAAE;wBAC3B,OAAO,EAAE,KAAK;wBACd,IAAI,EAAE,SAAS;qBAChB,CAAC,CAAC;iBACJ;gBAED,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAErC,IAAI,CAAC,OAAO,EAAE;oBACZ,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBAC3D,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBACjC,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,gFAAgF;oBAChF,mCAAmC;oBACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;iBAChC;YACH,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;IAED;;OAEG;IACK,sBAAsB;QAI5B,gGAAgG;QAChG,OAAO,OAAO,CAAC,yCAAyC,CAAC,CAAC;IAC5D,CAAC;;AA/OD;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { EventHint, Integration, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, logger } from '@sentry/utils';\n\nimport type { ReactNativeClient } from '../client';\nimport { createSyntheticError, isErrorLike } from '../utils/error';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n const Promise = this._getPromisePolyfill();\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n\n /**\n * Single source of truth for the Promise implementation we want to use.\n * This is important for verifying that the rejected promise tracing will work as expected.\n */\n private _getPromisePolyfill(): unknown {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n return require('promise/setimmediate/es6-extensions');\n }\n\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking = this._loadRejectionTracking();\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n },\n onHandled: id => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: unknown) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // `promise` package is a dependency of react-native, therefore it is always available.\n // but it is possible that the user has installed a different version of promise\n // or dependency that uses a different version.\n // We have to check if the React Native Promise and the `promise` package Promise are using the same reference.\n // If they are not, likely there are multiple versions of the `promise` package installed.\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const ReactNativePromise = require('react-native/Libraries/Promise');\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const PromisePackagePromise = require('promise/setimmediate/es6-extensions');\n const UsedPromisePolyfill = this._getPromisePolyfill();\n\n if (ReactNativePromise !== PromisePackagePromise) {\n logger.warn(\n 'You appear to have multiple versions of the \"promise\" package installed. ' +\n 'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +\n 'Please install the `promise` package manually using the exact version as the React Native package. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n\n // This only make sense if the user disabled the integration Polyfill\n if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler && errorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n const scope = currentHub.getScope();\n\n if (!client) {\n logger.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const hint: EventHint = {\n originalException: error,\n attachments: scope?.getAttachments(),\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event, hint);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n\n /**\n * Loads and returns rejection tracking module\n */\n private _loadRejectionTracking(): {\n disable: () => void;\n enable: (arg: unknown) => void;\n } {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n return require('promise/setimmediate/rejection-tracking');\n }\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { ReactNativeTracing } from './reactnativetracing';
|
|
2
|
-
export {
|
|
2
|
+
export type { RoutingInstrumentationInstance } from './routingInstrumentation';
|
|
3
|
+
export { RoutingInstrumentation } from './routingInstrumentation';
|
|
3
4
|
export { ReactNavigationInstrumentation, ReactNavigationV5Instrumentation, } from './reactnavigation';
|
|
4
5
|
export { ReactNavigationV4Instrumentation } from './reactnavigationv4';
|
|
5
6
|
export { ReactNativeNavigationInstrumentation } from './reactnativenavigation';
|
|
6
|
-
export { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
|
|
7
|
+
export type { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
|
|
7
8
|
export { ReactNativeProfiler } from './reactnativeprofiler';
|
|
8
9
|
export { sentryTraceGesture } from './gesturetracing';
|
|
9
10
|
export * from './ops';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,YAAY,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACL,8BAA8B,EAE9B,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEpH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,cAAc,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACL,8BAA8B;AAC9B,mDAAmD;AACnD,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAI/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,cAAc,OAAO,CAAC","sourcesContent":["export { ReactNativeTracing } from './reactnativetracing';\n\nexport type { RoutingInstrumentationInstance } from './routingInstrumentation';\nexport { RoutingInstrumentation } from './routingInstrumentation';\n\nexport {\n ReactNavigationInstrumentation,\n // eslint-disable-next-line deprecation/deprecation\n ReactNavigationV5Instrumentation,\n} from './reactnavigation';\nexport { ReactNavigationV4Instrumentation } from './reactnavigationv4';\nexport { ReactNativeNavigationInstrumentation } from './reactnativenavigation';\n\nexport type { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';\n\nexport { ReactNativeProfiler } from './reactnativeprofiler';\n\nexport { sentryTraceGesture } from './gesturetracing';\n\nexport * from './ops';\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ExtendedError extends Error {
|
|
2
|
+
framesToPop?: number | undefined;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Creates synthetic trace. By default pops 2 frames - `createSyntheticError` and the caller
|
|
6
|
+
*/
|
|
7
|
+
export declare function createSyntheticError(framesToPop?: number): ExtendedError;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the number of frames to pop from the stack trace.
|
|
10
|
+
* @param error ExtendedError
|
|
11
|
+
*/
|
|
12
|
+
export declare function getFramesToPop(error: ExtendedError): number;
|
|
13
|
+
/**
|
|
14
|
+
* Check if `potentialError` is an object with string stack property.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isErrorLike(potentialError: unknown): potentialError is {
|
|
17
|
+
stack: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/js/utils/error.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC1C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAQD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,GAAE,MAAU,GAAG,aAAa,CAI3E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,OAAO,GAAG,cAAc,IAAI;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAOxF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Sentry Stack Parser is skipping lines not frames
|
|
2
|
+
// https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23
|
|
3
|
+
// 1 for first line with the Error message
|
|
4
|
+
const SENTRY_STACK_PARSER_OFFSET = 1;
|
|
5
|
+
const REMOVE_ERROR_CREATION_FRAMES = 2 + SENTRY_STACK_PARSER_OFFSET;
|
|
6
|
+
/**
|
|
7
|
+
* Creates synthetic trace. By default pops 2 frames - `createSyntheticError` and the caller
|
|
8
|
+
*/
|
|
9
|
+
export function createSyntheticError(framesToPop = 0) {
|
|
10
|
+
const error = new Error();
|
|
11
|
+
error.framesToPop = framesToPop + REMOVE_ERROR_CREATION_FRAMES; // Skip createSyntheticError's own stack frame.
|
|
12
|
+
return error;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Returns the number of frames to pop from the stack trace.
|
|
16
|
+
* @param error ExtendedError
|
|
17
|
+
*/
|
|
18
|
+
export function getFramesToPop(error) {
|
|
19
|
+
return error.framesToPop !== undefined ? error.framesToPop : 0;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if `potentialError` is an object with string stack property.
|
|
23
|
+
*/
|
|
24
|
+
export function isErrorLike(potentialError) {
|
|
25
|
+
return (potentialError !== null &&
|
|
26
|
+
typeof potentialError === 'object' &&
|
|
27
|
+
'stack' in potentialError &&
|
|
28
|
+
typeof potentialError.stack === 'string');
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/js/utils/error.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,oIAAoI;AACpI,0CAA0C;AAC1C,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,4BAA4B,GAAG,CAAC,GAAG,0BAA0B,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,cAAsB,CAAC;IAC1D,MAAM,KAAK,GAAkB,IAAI,KAAK,EAAE,CAAC;IACzC,KAAK,CAAC,WAAW,GAAG,WAAW,GAAG,4BAA4B,CAAC,CAAC,+CAA+C;IAC/G,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAoB;IACjD,OAAO,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,cAAuB;IACjD,OAAO,CACL,cAAc,KAAK,IAAI;QACvB,OAAO,cAAc,KAAK,QAAQ;QAClC,OAAO,IAAI,cAAc;QACzB,OAAO,cAAc,CAAC,KAAK,KAAK,QAAQ,CACzC,CAAC;AACJ,CAAC","sourcesContent":["export interface ExtendedError extends Error {\n framesToPop?: number | undefined;\n}\n\n// Sentry Stack Parser is skipping lines not frames\n// https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n// 1 for first line with the Error message\nconst SENTRY_STACK_PARSER_OFFSET = 1;\nconst REMOVE_ERROR_CREATION_FRAMES = 2 + SENTRY_STACK_PARSER_OFFSET;\n\n/**\n * Creates synthetic trace. By default pops 2 frames - `createSyntheticError` and the caller\n */\nexport function createSyntheticError(framesToPop: number = 0): ExtendedError {\n const error: ExtendedError = new Error();\n error.framesToPop = framesToPop + REMOVE_ERROR_CREATION_FRAMES; // Skip createSyntheticError's own stack frame.\n return error;\n}\n\n/**\n * Returns the number of frames to pop from the stack trace.\n * @param error ExtendedError\n */\nexport function getFramesToPop(error: ExtendedError): number {\n return error.framesToPop !== undefined ? error.framesToPop : 0;\n}\n\n/**\n * Check if `potentialError` is an object with string stack property.\n */\nexport function isErrorLike(potentialError: unknown): potentialError is { stack: string } {\n return (\n potentialError !== null &&\n typeof potentialError === 'object' &&\n 'stack' in potentialError &&\n typeof potentialError.stack === 'string'\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromByteArray.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/fromByteArray.ts"],"names":[],"mappings":"AA+CA;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM,CAsB9E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// The MIT License (MIT)
|
|
3
|
+
// Copyright (c) 2014 Jameson Little
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
18
|
+
// THE SOFTWARE.
|
|
19
|
+
// Adapted from https://github.dev/beatgammit/base64-js/blob/88957c9943c7e2a0f03cdf73e71d579e433627d3/index.js#L119
|
|
20
|
+
const lookup = [];
|
|
21
|
+
const code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
22
|
+
for (let i = 0, len = code.length; i < len; ++i) {
|
|
23
|
+
lookup[i] = code[i];
|
|
24
|
+
}
|
|
25
|
+
function tripletToBase64(num) {
|
|
26
|
+
return lookup[(num >> 18) & 0x3f] + lookup[(num >> 12) & 0x3f] + lookup[(num >> 6) & 0x3f] + lookup[num & 0x3f];
|
|
27
|
+
}
|
|
28
|
+
function encodeChunk(uint8, start, end) {
|
|
29
|
+
let tmp;
|
|
30
|
+
const output = [];
|
|
31
|
+
for (let i = start; i < end; i += 3) {
|
|
32
|
+
tmp = ((uint8[i] << 16) & 0xff0000) + ((uint8[i + 1] << 8) & 0xff00) + (uint8[i + 2] & 0xff);
|
|
33
|
+
output.push(tripletToBase64(tmp));
|
|
34
|
+
}
|
|
35
|
+
return output.join('');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Converts a Uint8Array or Array of bytes into a string representation of base64.
|
|
39
|
+
*/
|
|
40
|
+
export function base64StringFromByteArray(uint8) {
|
|
41
|
+
let tmp;
|
|
42
|
+
const len = uint8.length;
|
|
43
|
+
const extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
|
|
44
|
+
const parts = [];
|
|
45
|
+
const maxChunkLength = 16383; // must be multiple of 3
|
|
46
|
+
// go through the array every three bytes, we'll deal with trailing stuff later
|
|
47
|
+
for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
48
|
+
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
|
|
49
|
+
}
|
|
50
|
+
// pad the end with zeros, but make sure to not forget the extra bytes
|
|
51
|
+
if (extraBytes === 1) {
|
|
52
|
+
tmp = uint8[len - 1];
|
|
53
|
+
parts.push(`${lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3f]}==`);
|
|
54
|
+
}
|
|
55
|
+
else if (extraBytes === 2) {
|
|
56
|
+
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
|
|
57
|
+
parts.push(`${lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3f] + lookup[(tmp << 2) & 0x3f]}=`);
|
|
58
|
+
}
|
|
59
|
+
return parts.join('');
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=fromByteArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromByteArray.js","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/fromByteArray.ts"],"names":[],"mappings":"AAAA,oBAAoB;AAEpB,wBAAwB;AAExB,oCAAoC;AAEpC,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,6EAA6E;AAC7E,sDAAsD;AAEtD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,4EAA4E;AAC5E,gBAAgB;AAEhB,mHAAmH;AAEnH,MAAM,MAAM,GAAa,EAAE,CAAC;AAE5B,MAAM,IAAI,GAAG,kEAAkE,CAAC;AAChF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;IAC/C,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CACrB;AAED,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,G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CAAC,EAAE,CAAC,GAAG,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC;KAC1F;IAED,sEAAsE;IACtE,IAAI,UAAU,KAAK,CAAC,EAAE;QACpB,GAAG,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;KACjE;SAAM,IAAI,UAAU,KAAK,CAAC,EAAE;QAC3B,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;KAC7F;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/* eslint-disable */\n\n// The MIT License (MIT)\n\n// Copyright (c) 2014 Jameson Little\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n// Adapted from https://github.dev/beatgammit/base64-js/blob/88957c9943c7e2a0f03cdf73e71d579e433627d3/index.js#L119\n\nconst lookup: string[] = [];\n\nconst code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nfor (let i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n}\n\nfunction tripletToBase64(num: number): string {\n return lookup[(num >> 18) & 0x3f] + lookup[(num >> 12) & 0x3f] + lookup[(num >> 6) & 0x3f] + lookup[num & 0x3f];\n}\n\nfunction encodeChunk(uint8: Uint8Array | number[], start: number, end: number): string {\n let tmp;\n const output = [];\n for (let i = start; i < end; i += 3) {\n tmp = ((uint8[i] << 16) & 0xff0000) + ((uint8[i + 1] << 8) & 0xff00) + (uint8[i + 2] & 0xff);\n output.push(tripletToBase64(tmp));\n }\n return output.join('');\n}\n\n/**\n * Converts a Uint8Array or Array of bytes into a string representation of base64.\n */\nexport function base64StringFromByteArray(uint8: Uint8Array | number[]): string {\n let tmp;\n const len = uint8.length;\n const extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n const parts = [];\n const maxChunkLength = 16383; // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(`${lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3f]}==`);\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(`${lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3f] + lookup[(tmp << 2) & 0x3f]}=`);\n }\n\n return parts.join('');\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { base64StringFromByteArray } from './fromByteArray';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/js/vendor/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { utf8ToBytes } from './buffer';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { utf8ToBytes } from './buffer';\nexport * from './react-native';\nexport { base64StringFromByteArray } from './base64-js';\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type StackFrame = {
|
|
2
|
+
column?: number;
|
|
3
|
+
file?: string;
|
|
4
|
+
lineNumber?: number;
|
|
5
|
+
methodName: string;
|
|
6
|
+
collapse?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type CodeFrame = Readonly<{
|
|
9
|
+
content: string;
|
|
10
|
+
location?: {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
row: number;
|
|
13
|
+
column: number;
|
|
14
|
+
};
|
|
15
|
+
fileName: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type SymbolicatedStackTrace = Readonly<{
|
|
18
|
+
stack: Array<StackFrame>;
|
|
19
|
+
codeFrame?: CodeFrame;
|
|
20
|
+
}>;
|
|
21
|
+
export type DevServerInfo = {
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
url: string;
|
|
24
|
+
fullBundleUrl?: string;
|
|
25
|
+
bundleLoadedFromServer: boolean;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/react-native/index.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAGF,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAGH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/react-native/index.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L17\nexport type StackFrame = {\n column?: number;\n file?: string;\n lineNumber?: number;\n methodName: string;\n collapse?: boolean;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L17\nexport type CodeFrame = Readonly<{\n content: string;\n location?: {\n [key: string]: unknown;\n row: number;\n column: number;\n };\n fileName: string;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L27\nexport type SymbolicatedStackTrace = Readonly<{\n stack: Array<StackFrame>;\n codeFrame?: CodeFrame;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/getDevServer.js#L17\nexport type DevServerInfo = {\n [key: string]: unknown;\n url: string;\n fullBundleUrl?: string;\n bundleLoadedFromServer: boolean;\n};\n"]}
|
package/dist/js/version.d.ts
CHANGED
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.
|
|
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,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.15.1';\n"]}
|
package/dist/js/wrapper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,aAAa,EACb,IAAI,EACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAiB,QAAQ,EAAuB,MAAM,cAAc,CAAC;AAG5E,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EAErB,iBAAiB,EACjB,IAAI,EACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,KAAK,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AASlE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,mBAAmB;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO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KAAE,GAAG,IAAI,CAAC;IAE9F,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACzF;AAID;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,mBAojBpB,CAAC"}
|
package/dist/js/wrapper.js
CHANGED
|
@@ -3,10 +3,11 @@ import { logger, normalize, SentryError } from '@sentry/utils';
|
|
|
3
3
|
import { NativeModules, Platform, TurboModuleRegistry } from 'react-native';
|
|
4
4
|
import { isHardCrash } from './misc';
|
|
5
5
|
import { isTurboModuleEnabled } from './utils/environment';
|
|
6
|
-
import { utf8ToBytes } from './vendor';
|
|
6
|
+
import { base64StringFromByteArray, utf8ToBytes } from './vendor';
|
|
7
7
|
const RNSentry = isTurboModuleEnabled()
|
|
8
8
|
? TurboModuleRegistry.get('RNSentry')
|
|
9
9
|
: NativeModules.RNSentry;
|
|
10
|
+
const EOL = utf8ToBytes('\n');
|
|
10
11
|
/**
|
|
11
12
|
* Our internal interface for calling native functions
|
|
12
13
|
*/
|
|
@@ -39,16 +40,17 @@ export const NATIVE = {
|
|
|
39
40
|
if (!this._isModuleLoaded(RNSentry)) {
|
|
40
41
|
throw this._NativeClientError;
|
|
41
42
|
}
|
|
42
|
-
const [EOL] = utf8ToBytes('\n');
|
|
43
43
|
const [envelopeHeader, envelopeItems] = envelope;
|
|
44
44
|
const headerString = JSON.stringify(envelopeHeader);
|
|
45
|
-
|
|
46
|
-
envelopeBytes.
|
|
45
|
+
const headerBytes = utf8ToBytes(headerString);
|
|
46
|
+
let envelopeBytes = new Uint8Array(headerBytes.length + EOL.length);
|
|
47
|
+
envelopeBytes.set(headerBytes);
|
|
48
|
+
envelopeBytes.set(EOL, headerBytes.length);
|
|
47
49
|
let hardCrashed = false;
|
|
48
50
|
for (const rawItem of envelopeItems) {
|
|
49
51
|
const [itemHeader, itemPayload] = this._processItem(rawItem);
|
|
50
52
|
let bytesContentType;
|
|
51
|
-
let bytesPayload
|
|
53
|
+
let bytesPayload;
|
|
52
54
|
if (typeof itemPayload === 'string') {
|
|
53
55
|
bytesContentType = 'text/plain';
|
|
54
56
|
bytesPayload = utf8ToBytes(itemPayload);
|
|
@@ -56,7 +58,7 @@ export const NATIVE = {
|
|
|
56
58
|
else if (itemPayload instanceof Uint8Array) {
|
|
57
59
|
bytesContentType =
|
|
58
60
|
typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';
|
|
59
|
-
bytesPayload =
|
|
61
|
+
bytesPayload = itemPayload;
|
|
60
62
|
}
|
|
61
63
|
else {
|
|
62
64
|
bytesContentType = 'application/json';
|
|
@@ -69,12 +71,16 @@ export const NATIVE = {
|
|
|
69
71
|
itemHeader.content_type = bytesContentType;
|
|
70
72
|
itemHeader.length = bytesPayload.length;
|
|
71
73
|
const serializedItemHeader = JSON.stringify(itemHeader);
|
|
72
|
-
|
|
73
|
-
envelopeBytes.
|
|
74
|
-
|
|
75
|
-
envelopeBytes.
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const bytesItemHeader = utf8ToBytes(serializedItemHeader);
|
|
75
|
+
const newBytes = new Uint8Array(envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length + EOL.length);
|
|
76
|
+
newBytes.set(envelopeBytes);
|
|
77
|
+
newBytes.set(bytesItemHeader, envelopeBytes.length);
|
|
78
|
+
newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length);
|
|
79
|
+
newBytes.set(bytesPayload, envelopeBytes.length + bytesItemHeader.length + EOL.length);
|
|
80
|
+
newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length);
|
|
81
|
+
envelopeBytes = newBytes;
|
|
82
|
+
}
|
|
83
|
+
yield RNSentry.captureEnvelope(base64StringFromByteArray(envelopeBytes), { store: hardCrashed });
|
|
78
84
|
});
|
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,KACb,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,IAC1E,CAAC,GACJ,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IAEH,aAAa,CAAC,KAAoB;QAChC,IAAI,KAAK,IAAK,KAAuB,EAAE;YACrC,OAAO,OAAwB,CAAC;SACjC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,MAAwB;QACtC,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IAED,oBAAoB,EAAE,IAAI,WAAW,CAAC,oBAAoB,CAAC;IAE3D,kBAAkB,EAAE,IAAI,WAAW,CAAC,wDAAwD,CAAC;IAE7F,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,QAAQ,CAAC,EAAE;CACtB,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport type {\n BaseEnvelopeItemHeaders,\n Breadcrumb,\n Envelope,\n EnvelopeItem,\n Event,\n Package,\n SeverityLevel,\n User,\n} from '@sentry/types';\nimport { logger, normalize, SentryError } from '@sentry/utils';\nimport { NativeModules, Platform, TurboModuleRegistry } from 'react-native';\n\nimport { isHardCrash } from './misc';\nimport type {\n NativeAppStartResponse,\n NativeDeviceContextsResponse,\n NativeFramesResponse,\n NativeReleaseResponse,\n NativeScreenshot,\n NativeStackFrames,\n Spec,\n} from './NativeRNSentry';\nimport type { ReactNativeClientOptions } from './options';\nimport type * as Hermes from './profiling/hermes';\nimport type { NativeProfileEvent } from './profiling/nativeTypes';\nimport type { RequiredKeysUser } from './user';\nimport { isTurboModuleEnabled } from './utils/environment';\nimport { utf8ToBytes } from './vendor';\n\nconst RNSentry: Spec | undefined = isTurboModuleEnabled()\n ? TurboModuleRegistry.get<Spec>('RNSentry')\n : NativeModules.RNSentry;\n\nexport interface Screenshot {\n data: Uint8Array;\n contentType: string;\n filename: string;\n}\n\ninterface SentryNativeWrapper {\n enableNative: boolean;\n nativeIsReady: boolean;\n platform: typeof Platform.OS;\n\n _NativeClientError: Error;\n _DisabledNativeError: Error;\n\n _processItem(envelopeItem: EnvelopeItem): EnvelopeItem;\n _processLevels(event: Event): Event;\n _processLevel(level: SeverityLevel): SeverityLevel;\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string };\n _isModuleLoaded(module: Spec | undefined): module is Spec;\n\n isNativeAvailable(): boolean;\n\n initNativeSdk(options: Partial<ReactNativeClientOptions>): PromiseLike<boolean>;\n closeNativeSdk(): PromiseLike<void>;\n\n sendEnvelope(envelope: Envelope): Promise<void>;\n captureScreenshot(): Promise<Screenshot[] | null>;\n\n fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;\n fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;\n fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;\n fetchNativeSdkInfo(): PromiseLike<Package | null>;\n\n disableNativeFramesTracking(): void;\n enableNativeFramesTracking(): void;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n setContext(key: string, context: { [key: string]: unknown } | null): void;\n clearBreadcrumbs(): void;\n setExtra(key: string, extra: unknown): void;\n setUser(user: User | null): void;\n setTag(key: string, value: string): void;\n\n nativeCrash(): void;\n\n fetchModules(): Promise<Record<string, string> | null>;\n fetchViewHierarchy(): PromiseLike<Uint8Array | null>;\n\n startProfiling(): boolean;\n stopProfiling(): { hermesProfile: Hermes.Profile; nativeProfile?: NativeProfileEvent } | null;\n\n fetchNativePackageName(): Promise<string | null>;\n\n /**\n * Fetches native stack frames and debug images for the instructions addresses.\n */\n fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | null>;\n}\n\n/**\n * Our internal interface for calling native functions\n */\nexport const NATIVE: SentryNativeWrapper = {\n async fetchModules(): Promise<Record<string, string> | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchModules();\n if (raw) {\n return JSON.parse(raw);\n }\n return null;\n },\n /**\n * Sending the envelope over the bridge to native\n * @param envelope Envelope\n */\n async sendEnvelope(envelope: Envelope): Promise<void> {\n if (!this.enableNative) {\n logger.warn('Event was skipped as native SDK is not enabled.');\n return;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const [EOL] = utf8ToBytes('\\n');\n\n const [envelopeHeader, envelopeItems] = envelope;\n\n const headerString = JSON.stringify(envelopeHeader);\n let envelopeBytes: number[] = utf8ToBytes(headerString);\n envelopeBytes.push(EOL);\n\n let hardCrashed: boolean = false;\n for (const rawItem of envelopeItems) {\n const [itemHeader, itemPayload] = this._processItem(rawItem);\n\n let bytesContentType: string;\n let bytesPayload: number[] = [];\n if (typeof itemPayload === 'string') {\n bytesContentType = 'text/plain';\n bytesPayload = utf8ToBytes(itemPayload);\n } else if (itemPayload instanceof Uint8Array) {\n bytesContentType =\n typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';\n bytesPayload = [...itemPayload];\n } else {\n bytesContentType = 'application/json';\n bytesPayload = utf8ToBytes(JSON.stringify(itemPayload));\n if (!hardCrashed) {\n hardCrashed = isHardCrash(itemPayload);\n }\n }\n\n // Content type is not inside BaseEnvelopeItemHeaders.\n (itemHeader as BaseEnvelopeItemHeaders).content_type = bytesContentType;\n (itemHeader as BaseEnvelopeItemHeaders).length = bytesPayload.length;\n const serializedItemHeader = JSON.stringify(itemHeader);\n\n envelopeBytes.push(...utf8ToBytes(serializedItemHeader));\n envelopeBytes.push(EOL);\n envelopeBytes = envelopeBytes.concat(bytesPayload);\n envelopeBytes.push(EOL);\n }\n\n await RNSentry.captureEnvelope(envelopeBytes, { store: hardCrashed });\n },\n\n /**\n * Starts native with the provided options.\n * @param options ReactNativeClientOptions\n */\n async initNativeSdk(originalOptions: Partial<ReactNativeClientOptions>): Promise<boolean> {\n const options: Partial<ReactNativeClientOptions> = {\n enableNative: true,\n autoInitializeNativeSdk: true,\n ...originalOptions,\n };\n\n if (!options.enableNative) {\n if (options.enableNativeNagger) {\n logger.warn('Note: Native Sentry SDK is disabled.');\n }\n this.enableNative = false;\n return false;\n }\n if (!options.autoInitializeNativeSdk) {\n if (options.enableNativeNagger) {\n logger.warn(\n 'Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false',\n );\n }\n this.enableNative = true;\n return false;\n }\n\n if (!options.dsn) {\n logger.warn(\n 'Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized.',\n );\n this.enableNative = false;\n return false;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // filter out all the options that would crash native.\n /* eslint-disable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const { beforeSend, beforeBreadcrumb, beforeSendTransaction, integrations, ...filteredOptions } = options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const nativeIsReady = await RNSentry.initNativeSdk(filteredOptions);\n\n this.nativeIsReady = nativeIsReady;\n this.enableNative = true;\n\n return nativeIsReady;\n },\n\n /**\n * Fetches the release from native\n */\n async fetchNativeRelease(): Promise<NativeReleaseResponse> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeRelease();\n },\n\n /**\n * Fetches the Sdk info for the native sdk.\n */\n async fetchNativeSdkInfo(): Promise<Package | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeSdkInfo();\n },\n\n /**\n * Fetches the device contexts. Not used on Android.\n */\n async fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeDeviceContexts();\n },\n\n async fetchNativeAppStart(): Promise<NativeAppStartResponse | null> {\n if (!this.enableNative) {\n logger.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n logger.error(this._NativeClientError);\n return null;\n }\n\n return RNSentry.fetchNativeAppStart();\n },\n\n async fetchNativeFrames(): Promise<NativeFramesResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeFrames();\n },\n\n /**\n * Triggers a native crash.\n * Use this only for testing purposes.\n */\n nativeCrash(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.crash();\n },\n\n /**\n * Sets the user in the native scope.\n * Passing null clears the user.\n */\n setUser(user: User | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // separate and serialize all non-default user keys.\n let userKeys = null;\n let userDataKeys = null;\n if (user) {\n const { id, ip_address, email, username, segment, ...otherKeys } = user;\n const requiredUser: RequiredKeysUser = {\n id,\n ip_address,\n email,\n username,\n segment,\n };\n userKeys = this._serializeObject(requiredUser);\n userDataKeys = this._serializeObject(otherKeys);\n }\n\n RNSentry.setUser(userKeys, userDataKeys);\n },\n\n /**\n * Sets a tag in the native module.\n * @param key string\n * @param value string\n */\n setTag(key: string, value: string): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = typeof value === 'string' ? value : JSON.stringify(value);\n\n RNSentry.setTag(key, stringifiedValue);\n },\n\n /**\n * Sets an extra in the native scope, will stringify\n * extra value if it isn't already a string.\n * @param key string\n * @param extra any\n */\n setExtra(key: string, extra: unknown): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // we stringify the extra as native only takes in strings.\n const stringifiedExtra = typeof extra === 'string' ? extra : JSON.stringify(extra);\n\n RNSentry.setExtra(key, stringifiedExtra);\n },\n\n /**\n * Adds breadcrumb to the native scope.\n * @param breadcrumb Breadcrumb\n */\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.addBreadcrumb({\n ...breadcrumb,\n // Process and convert deprecated levels\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n });\n },\n\n /**\n * Clears breadcrumbs on the native scope.\n */\n clearBreadcrumbs(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.clearBreadcrumbs();\n },\n\n /**\n * Sets context on the native scope. Not implemented in Android yet.\n * @param key string\n * @param context key-value map\n */\n setContext(key: string, context: { [key: string]: unknown } | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.setContext(key, context !== null ? normalize(context) : null);\n },\n\n /**\n * Closes the Native Layer SDK\n */\n async closeNativeSdk(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.closeNativeSdk().then(() => {\n this.enableNative = false;\n });\n },\n\n disableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.disableNativeFramesTracking();\n },\n\n enableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.enableNativeFramesTracking();\n },\n\n isNativeAvailable(): boolean {\n return this._isModuleLoaded(RNSentry);\n },\n\n async captureScreenshot(): Promise<Screenshot[] | null> {\n if (!this.enableNative) {\n logger.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n logger.error(this._NativeClientError);\n return null;\n }\n\n let raw: NativeScreenshot[] | null | undefined;\n try {\n raw = await RNSentry.captureScreenshot();\n } catch (e) {\n logger.warn('Failed to capture screenshot', e);\n }\n\n if (raw) {\n return raw.map((item: NativeScreenshot) => ({\n ...item,\n data: new Uint8Array(item.data),\n }));\n } else {\n return null;\n }\n },\n\n async fetchViewHierarchy(): Promise<Uint8Array | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchViewHierarchy();\n return raw ? new Uint8Array(raw) : null;\n },\n\n startProfiling(): boolean {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { started, error } = RNSentry.startProfiling();\n if (started) {\n logger.log('[NATIVE] Start Profiling');\n } else {\n logger.error('[NATIVE] Start Profiling Failed', error);\n }\n\n return !!started;\n },\n\n stopProfiling(): { hermesProfile: Hermes.Profile; nativeProfile?: NativeProfileEvent } | null {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { profile, nativeProfile, error } = RNSentry.stopProfiling();\n if (!profile || error) {\n logger.error('[NATIVE] Stop Profiling Failed', error);\n return null;\n }\n if (Platform.OS === 'ios' && !nativeProfile) {\n logger.warn('[NATIVE] Stop Profiling Failed: No Native Profile');\n }\n\n try {\n return {\n hermesProfile: JSON.parse(profile) as Hermes.Profile,\n nativeProfile: nativeProfile as NativeProfileEvent | undefined,\n };\n } catch (e) {\n logger.error('[NATIVE] Failed to parse Hermes Profile JSON', e);\n return null;\n }\n },\n\n async fetchNativePackageName(): Promise<string | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return (await RNSentry.fetchNativePackageName()) || null;\n },\n\n async fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return (await RNSentry.fetchNativeStackFramesBy(instructionsAddr)) || null;\n },\n\n /**\n * Gets the event from envelopeItem and applies the level filter to the selected event.\n * @param data An envelope item containing the event.\n * @returns The event from envelopeItem or undefined.\n */\n _processItem(item: EnvelopeItem): EnvelopeItem {\n const [itemHeader, itemPayload] = item;\n\n if (itemHeader.type == 'event' || itemHeader.type == 'transaction') {\n const event = this._processLevels(itemPayload as Event);\n\n if (NATIVE.platform === 'android') {\n if ('message' in event) {\n // @ts-expect-error Android still uses the old message object, without this the serialization of events will break.\n event.message = { message: event.message };\n }\n }\n\n return [itemHeader, event];\n }\n\n return item;\n },\n\n /**\n * Serializes all values of root-level keys into strings.\n * @param data key-value map.\n * @returns An object where all root-level values are strings.\n */\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string } {\n const serialized: { [key: string]: string } = {};\n\n Object.keys(data).forEach(dataKey => {\n const value = data[dataKey];\n serialized[dataKey] = typeof value === 'string' ? value : JSON.stringify(value);\n });\n\n return serialized;\n },\n\n /**\n * Convert js severity level in event.level and event.breadcrumbs to more widely supported levels.\n * @param event\n * @returns Event with more widely supported Severity level strings\n */\n\n _processLevels(event: Event): Event {\n const processed: Event = {\n ...event,\n level: event.level ? this._processLevel(event.level) : undefined,\n breadcrumbs: event.breadcrumbs?.map(breadcrumb => ({\n ...breadcrumb,\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n })),\n };\n\n return processed;\n },\n\n /**\n * Convert js severity level which has critical and log to more widely supported levels.\n * @param level\n * @returns More widely supported Severity level strings\n */\n\n _processLevel(level: SeverityLevel): SeverityLevel {\n if (level == ('log' as SeverityLevel)) {\n return 'debug' as SeverityLevel;\n }\n return level;\n },\n\n /**\n * Checks whether the RNSentry module is loaded.\n */\n _isModuleLoaded(module: Spec | undefined): module is Spec {\n return !!module;\n },\n\n _DisabledNativeError: new SentryError('Native is disabled'),\n\n _NativeClientError: new SentryError(\"Native Client is not available, can't start on native.\"),\n\n enableNative: true,\n nativeIsReady: false,\n platform: Platform.OS,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAcrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,QAAQ,GAAqB,oBAAoB,EAAE;IACvD,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAO,UAAU,CAAC;IAC3C,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC;AA8D3B,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAwB;IACnC,YAAY;;YAChB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACtB,MAAM,IAAI,CAAC,oBAAoB,CAAC;aACjC;YACD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE;gBACnC,MAAM,IAAI,CAAC,kBAAkB,CAAC;aAC/B;YAED,MAAM,GAAG,GAA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AE;YACrC,OAAO,OAAwB,CAAC;SACjC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,MAAwB;QACtC,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IAED,oBAAoB,EAAE,IAAI,WAAW,CAAC,oBAAoB,CAAC;IAE3D,kBAAkB,EAAE,IAAI,WAAW,CAAC,wDAAwD,CAAC;IAE7F,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,QAAQ,CAAC,EAAE;CACtB,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport type {\n BaseEnvelopeItemHeaders,\n Breadcrumb,\n Envelope,\n EnvelopeItem,\n Event,\n Package,\n SeverityLevel,\n User,\n} from '@sentry/types';\nimport { logger, normalize, SentryError } from '@sentry/utils';\nimport { NativeModules, Platform, TurboModuleRegistry } from 'react-native';\n\nimport { isHardCrash } from './misc';\nimport type {\n NativeAppStartResponse,\n NativeDeviceContextsResponse,\n NativeFramesResponse,\n NativeReleaseResponse,\n NativeScreenshot,\n NativeStackFrames,\n Spec,\n} from './NativeRNSentry';\nimport type { ReactNativeClientOptions } from './options';\nimport type * as Hermes from './profiling/hermes';\nimport type { NativeProfileEvent } from './profiling/nativeTypes';\nimport type { RequiredKeysUser } from './user';\nimport { isTurboModuleEnabled } from './utils/environment';\nimport { base64StringFromByteArray, utf8ToBytes } from './vendor';\n\nconst RNSentry: Spec | undefined = isTurboModuleEnabled()\n ? TurboModuleRegistry.get<Spec>('RNSentry')\n : NativeModules.RNSentry;\n\nexport interface Screenshot {\n data: Uint8Array;\n contentType: string;\n filename: string;\n}\n\ninterface SentryNativeWrapper {\n enableNative: boolean;\n nativeIsReady: boolean;\n platform: typeof Platform.OS;\n\n _NativeClientError: Error;\n _DisabledNativeError: Error;\n\n _processItem(envelopeItem: EnvelopeItem): EnvelopeItem;\n _processLevels(event: Event): Event;\n _processLevel(level: SeverityLevel): SeverityLevel;\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string };\n _isModuleLoaded(module: Spec | undefined): module is Spec;\n\n isNativeAvailable(): boolean;\n\n initNativeSdk(options: Partial<ReactNativeClientOptions>): PromiseLike<boolean>;\n closeNativeSdk(): PromiseLike<void>;\n\n sendEnvelope(envelope: Envelope): Promise<void>;\n captureScreenshot(): Promise<Screenshot[] | null>;\n\n fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;\n fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;\n fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;\n fetchNativeSdkInfo(): PromiseLike<Package | null>;\n\n disableNativeFramesTracking(): void;\n enableNativeFramesTracking(): void;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n setContext(key: string, context: { [key: string]: unknown } | null): void;\n clearBreadcrumbs(): void;\n setExtra(key: string, extra: unknown): void;\n setUser(user: User | null): void;\n setTag(key: string, value: string): void;\n\n nativeCrash(): void;\n\n fetchModules(): Promise<Record<string, string> | null>;\n fetchViewHierarchy(): PromiseLike<Uint8Array | null>;\n\n startProfiling(): boolean;\n stopProfiling(): { hermesProfile: Hermes.Profile; nativeProfile?: NativeProfileEvent } | null;\n\n fetchNativePackageName(): Promise<string | null>;\n\n /**\n * Fetches native stack frames and debug images for the instructions addresses.\n */\n fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | null>;\n}\n\nconst EOL = utf8ToBytes('\\n');\n\n/**\n * Our internal interface for calling native functions\n */\nexport const NATIVE: SentryNativeWrapper = {\n async fetchModules(): Promise<Record<string, string> | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchModules();\n if (raw) {\n return JSON.parse(raw);\n }\n return null;\n },\n /**\n * Sending the envelope over the bridge to native\n * @param envelope Envelope\n */\n async sendEnvelope(envelope: Envelope): Promise<void> {\n if (!this.enableNative) {\n logger.warn('Event was skipped as native SDK is not enabled.');\n return;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const [envelopeHeader, envelopeItems] = envelope;\n\n const headerString = JSON.stringify(envelopeHeader);\n const headerBytes = utf8ToBytes(headerString);\n let envelopeBytes: Uint8Array = new Uint8Array(headerBytes.length + EOL.length);\n envelopeBytes.set(headerBytes);\n envelopeBytes.set(EOL, headerBytes.length);\n\n let hardCrashed: boolean = false;\n for (const rawItem of envelopeItems) {\n const [itemHeader, itemPayload] = this._processItem(rawItem);\n\n let bytesContentType: string;\n let bytesPayload: number[] | Uint8Array | undefined;\n if (typeof itemPayload === 'string') {\n bytesContentType = 'text/plain';\n bytesPayload = utf8ToBytes(itemPayload);\n } else if (itemPayload instanceof Uint8Array) {\n bytesContentType =\n typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';\n bytesPayload = itemPayload;\n } else {\n bytesContentType = 'application/json';\n bytesPayload = utf8ToBytes(JSON.stringify(itemPayload));\n if (!hardCrashed) {\n hardCrashed = isHardCrash(itemPayload);\n }\n }\n\n // Content type is not inside BaseEnvelopeItemHeaders.\n (itemHeader as BaseEnvelopeItemHeaders).content_type = bytesContentType;\n (itemHeader as BaseEnvelopeItemHeaders).length = bytesPayload.length;\n const serializedItemHeader = JSON.stringify(itemHeader);\n\n const bytesItemHeader = utf8ToBytes(serializedItemHeader);\n const newBytes = new Uint8Array(\n envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length + EOL.length,\n );\n newBytes.set(envelopeBytes);\n newBytes.set(bytesItemHeader, envelopeBytes.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length);\n newBytes.set(bytesPayload, envelopeBytes.length + bytesItemHeader.length + EOL.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length);\n envelopeBytes = newBytes;\n }\n\n await RNSentry.captureEnvelope(base64StringFromByteArray(envelopeBytes), { store: hardCrashed });\n },\n\n /**\n * Starts native with the provided options.\n * @param options ReactNativeClientOptions\n */\n async initNativeSdk(originalOptions: Partial<ReactNativeClientOptions>): Promise<boolean> {\n const options: Partial<ReactNativeClientOptions> = {\n enableNative: true,\n autoInitializeNativeSdk: true,\n ...originalOptions,\n };\n\n if (!options.enableNative) {\n if (options.enableNativeNagger) {\n logger.warn('Note: Native Sentry SDK is disabled.');\n }\n this.enableNative = false;\n return false;\n }\n if (!options.autoInitializeNativeSdk) {\n if (options.enableNativeNagger) {\n logger.warn(\n 'Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false',\n );\n }\n this.enableNative = true;\n return false;\n }\n\n if (!options.dsn) {\n logger.warn(\n 'Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized.',\n );\n this.enableNative = false;\n return false;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // filter out all the options that would crash native.\n /* eslint-disable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const { beforeSend, beforeBreadcrumb, beforeSendTransaction, integrations, ...filteredOptions } = options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const nativeIsReady = await RNSentry.initNativeSdk(filteredOptions);\n\n this.nativeIsReady = nativeIsReady;\n this.enableNative = true;\n\n return nativeIsReady;\n },\n\n /**\n * Fetches the release from native\n */\n async fetchNativeRelease(): Promise<NativeReleaseResponse> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeRelease();\n },\n\n /**\n * Fetches the Sdk info for the native sdk.\n */\n async fetchNativeSdkInfo(): Promise<Package | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeSdkInfo();\n },\n\n /**\n * Fetches the device contexts. Not used on Android.\n */\n async fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeDeviceContexts();\n },\n\n async fetchNativeAppStart(): Promise<NativeAppStartResponse | null> {\n if (!this.enableNative) {\n logger.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n logger.error(this._NativeClientError);\n return null;\n }\n\n return RNSentry.fetchNativeAppStart();\n },\n\n async fetchNativeFrames(): Promise<NativeFramesResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeFrames();\n },\n\n /**\n * Triggers a native crash.\n * Use this only for testing purposes.\n */\n nativeCrash(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.crash();\n },\n\n /**\n * Sets the user in the native scope.\n * Passing null clears the user.\n */\n setUser(user: User | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // separate and serialize all non-default user keys.\n let userKeys = null;\n let userDataKeys = null;\n if (user) {\n const { id, ip_address, email, username, segment, ...otherKeys } = user;\n const requiredUser: RequiredKeysUser = {\n id,\n ip_address,\n email,\n username,\n segment,\n };\n userKeys = this._serializeObject(requiredUser);\n userDataKeys = this._serializeObject(otherKeys);\n }\n\n RNSentry.setUser(userKeys, userDataKeys);\n },\n\n /**\n * Sets a tag in the native module.\n * @param key string\n * @param value string\n */\n setTag(key: string, value: string): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = typeof value === 'string' ? value : JSON.stringify(value);\n\n RNSentry.setTag(key, stringifiedValue);\n },\n\n /**\n * Sets an extra in the native scope, will stringify\n * extra value if it isn't already a string.\n * @param key string\n * @param extra any\n */\n setExtra(key: string, extra: unknown): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // we stringify the extra as native only takes in strings.\n const stringifiedExtra = typeof extra === 'string' ? extra : JSON.stringify(extra);\n\n RNSentry.setExtra(key, stringifiedExtra);\n },\n\n /**\n * Adds breadcrumb to the native scope.\n * @param breadcrumb Breadcrumb\n */\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.addBreadcrumb({\n ...breadcrumb,\n // Process and convert deprecated levels\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n });\n },\n\n /**\n * Clears breadcrumbs on the native scope.\n */\n clearBreadcrumbs(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.clearBreadcrumbs();\n },\n\n /**\n * Sets context on the native scope. Not implemented in Android yet.\n * @param key string\n * @param context key-value map\n */\n setContext(key: string, context: { [key: string]: unknown } | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.setContext(key, context !== null ? normalize(context) : null);\n },\n\n /**\n * Closes the Native Layer SDK\n */\n async closeNativeSdk(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.closeNativeSdk().then(() => {\n this.enableNative = false;\n });\n },\n\n disableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.disableNativeFramesTracking();\n },\n\n enableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.enableNativeFramesTracking();\n },\n\n isNativeAvailable(): boolean {\n return this._isModuleLoaded(RNSentry);\n },\n\n async captureScreenshot(): Promise<Screenshot[] | null> {\n if (!this.enableNative) {\n logger.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n logger.error(this._NativeClientError);\n return null;\n }\n\n let raw: NativeScreenshot[] | null | undefined;\n try {\n raw = await RNSentry.captureScreenshot();\n } catch (e) {\n logger.warn('Failed to capture screenshot', e);\n }\n\n if (raw) {\n return raw.map((item: NativeScreenshot) => ({\n ...item,\n data: new Uint8Array(item.data),\n }));\n } else {\n return null;\n }\n },\n\n async fetchViewHierarchy(): Promise<Uint8Array | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchViewHierarchy();\n return raw ? new Uint8Array(raw) : null;\n },\n\n startProfiling(): boolean {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { started, error } = RNSentry.startProfiling();\n if (started) {\n logger.log('[NATIVE] Start Profiling');\n } else {\n logger.error('[NATIVE] Start Profiling Failed', error);\n }\n\n return !!started;\n },\n\n stopProfiling(): { hermesProfile: Hermes.Profile; nativeProfile?: NativeProfileEvent } | null {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { profile, nativeProfile, error } = RNSentry.stopProfiling();\n if (!profile || error) {\n logger.error('[NATIVE] Stop Profiling Failed', error);\n return null;\n }\n if (Platform.OS === 'ios' && !nativeProfile) {\n logger.warn('[NATIVE] Stop Profiling Failed: No Native Profile');\n }\n\n try {\n return {\n hermesProfile: JSON.parse(profile) as Hermes.Profile,\n nativeProfile: nativeProfile as NativeProfileEvent | undefined,\n };\n } catch (e) {\n logger.error('[NATIVE] Failed to parse Hermes Profile JSON', e);\n return null;\n }\n },\n\n async fetchNativePackageName(): Promise<string | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return (await RNSentry.fetchNativePackageName()) || null;\n },\n\n async fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return (await RNSentry.fetchNativeStackFramesBy(instructionsAddr)) || null;\n },\n\n /**\n * Gets the event from envelopeItem and applies the level filter to the selected event.\n * @param data An envelope item containing the event.\n * @returns The event from envelopeItem or undefined.\n */\n _processItem(item: EnvelopeItem): EnvelopeItem {\n const [itemHeader, itemPayload] = item;\n\n if (itemHeader.type == 'event' || itemHeader.type == 'transaction') {\n const event = this._processLevels(itemPayload as Event);\n\n if (NATIVE.platform === 'android') {\n if ('message' in event) {\n // @ts-expect-error Android still uses the old message object, without this the serialization of events will break.\n event.message = { message: event.message };\n }\n }\n\n return [itemHeader, event];\n }\n\n return item;\n },\n\n /**\n * Serializes all values of root-level keys into strings.\n * @param data key-value map.\n * @returns An object where all root-level values are strings.\n */\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string } {\n const serialized: { [key: string]: string } = {};\n\n Object.keys(data).forEach(dataKey => {\n const value = data[dataKey];\n serialized[dataKey] = typeof value === 'string' ? value : JSON.stringify(value);\n });\n\n return serialized;\n },\n\n /**\n * Convert js severity level in event.level and event.breadcrumbs to more widely supported levels.\n * @param event\n * @returns Event with more widely supported Severity level strings\n */\n\n _processLevels(event: Event): Event {\n const processed: Event = {\n ...event,\n level: event.level ? this._processLevel(event.level) : undefined,\n breadcrumbs: event.breadcrumbs?.map(breadcrumb => ({\n ...breadcrumb,\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n })),\n };\n\n return processed;\n },\n\n /**\n * Convert js severity level which has critical and log to more widely supported levels.\n * @param level\n * @returns More widely supported Severity level strings\n */\n\n _processLevel(level: SeverityLevel): SeverityLevel {\n if (level == ('log' as SeverityLevel)) {\n return 'debug' as SeverityLevel;\n }\n return level;\n },\n\n /**\n * Checks whether the RNSentry module is loaded.\n */\n _isModuleLoaded(module: Spec | undefined): module is Spec {\n return !!module;\n },\n\n _DisabledNativeError: new SentryError('Native is disabled'),\n\n _NativeClientError: new SentryError(\"Native Client is not available, can't start on native.\"),\n\n enableNative: true,\n nativeIsReady: false,\n platform: Platform.OS,\n};\n"]}
|