@nativescript-community/sentry 3.1.5 → 4.6.0
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 +17 -0
- package/README.md +2 -6
- package/client.d.ts +38 -3
- package/client.js +143 -5
- package/client.js.map +1 -1
- package/index.d.ts +7 -11
- package/index.js +28 -12
- package/index.js.map +1 -1
- package/integrations/debugsymbolicator.d.ts +4 -4
- package/integrations/debugsymbolicator.js +11 -22
- package/integrations/debugsymbolicator.js.map +1 -1
- package/integrations/devicecontext.js +22 -5
- package/integrations/devicecontext.js.map +1 -1
- package/integrations/eventorigin.d.ts +7 -7
- package/integrations/eventorigin.js +9 -9
- package/integrations/eventorigin.js.map +1 -1
- package/integrations/nativescripterrorhandlers.d.ts +15 -5
- package/integrations/nativescripterrorhandlers.js +55 -44
- package/integrations/nativescripterrorhandlers.js.map +1 -1
- package/integrations/release.js +10 -8
- package/integrations/release.js.map +1 -1
- package/integrations/sdkinfo.d.ts +4 -1
- package/integrations/sdkinfo.js +17 -10
- package/integrations/sdkinfo.js.map +1 -1
- package/measurement.d.ts +4 -0
- package/measurement.js +50 -0
- package/measurement.js.map +1 -0
- package/measurements.d.ts +4 -0
- package/measurements.js +50 -0
- package/measurements.js.map +1 -0
- package/misc.d.ts +8 -0
- package/misc.js +17 -0
- package/misc.js.map +1 -0
- package/options.d.ts +125 -0
- package/options.js +2 -0
- package/options.js.map +1 -0
- package/package.json +9 -12
- package/platforms/android/buildscript.gradle +6 -2
- package/platforms/android/include.gradle +1 -1
- package/platforms/android/sentry.aar +0 -0
- package/platforms/ios/Podfile +1 -1
- package/platforms/ios/src/NSSentry.h +8 -3
- package/platforms/ios/src/NSSentry.m +41 -0
- package/scope.d.ts +1 -45
- package/scope.js +90 -68
- package/scope.js.map +1 -1
- package/sdk.d.ts +27 -3
- package/sdk.js +105 -30
- package/sdk.js.map +1 -1
- package/tracing/index.d.ts +2 -1
- package/tracing/index.js +14 -6
- package/tracing/index.js.map +1 -1
- package/tracing/nativeframes.d.ts +68 -0
- package/tracing/nativeframes.js +175 -0
- package/tracing/nativeframes.js.map +1 -0
- package/tracing/nstracing.d.ts +98 -47
- package/tracing/nstracing.js +164 -44
- package/tracing/nstracing.js.map +1 -1
- package/tracing/routingInstrumentation.d.ts +46 -0
- package/tracing/routingInstrumentation.js +33 -0
- package/tracing/routingInstrumentation.js.map +1 -0
- package/tracing/stalltracking.d.ts +92 -0
- package/tracing/stalltracking.js +258 -0
- package/tracing/stalltracking.js.map +1 -0
- package/tracing/types.d.ts +13 -0
- package/tracing/types.js +2 -0
- package/tracing/types.js.map +1 -0
- package/tracing/utils.d.ts +22 -1
- package/tracing/utils.js +51 -2
- package/tracing/utils.js.map +1 -1
- package/transports/TextEncoder.d.ts +2 -0
- package/transports/TextEncoder.js +12 -0
- package/transports/TextEncoder.js.map +1 -0
- package/transports/native.d.ts +20 -8
- package/transports/native.js +21 -13
- package/transports/native.js.map +1 -1
- package/utils/envelope.d.ts +11 -0
- package/utils/envelope.js +21 -0
- package/utils/envelope.js.map +1 -0
- package/utils/outcome.d.ts +5 -0
- package/utils/outcome.js +19 -0
- package/utils/outcome.js.map +1 -0
- package/utils/safe.d.ts +17 -0
- package/utils/safe.js +46 -0
- package/utils/safe.js.map +1 -0
- package/vendor/buffer/index.d.ts +1 -0
- package/vendor/buffer/index.js +2 -0
- package/vendor/buffer/index.js.map +1 -0
- package/vendor/buffer/utf8ToBytes.d.ts +9 -0
- package/vendor/buffer/utf8ToBytes.js +81 -0
- package/vendor/buffer/utf8ToBytes.js.map +1 -0
- package/vendor/index.d.ts +1 -0
- package/vendor/index.js +2 -0
- package/vendor/index.js.map +1 -0
- package/version.d.ts +2 -1
- package/version.js +2 -1
- package/version.js.map +1 -1
- package/wrapper.android.d.ts +30 -0
- package/wrapper.android.js +952 -0
- package/wrapper.android.js.map +1 -0
- package/wrapper.d.ts +88 -0
- package/wrapper.ios.d.ts +34 -0
- package/wrapper.ios.js +497 -0
- package/wrapper.ios.js.map +1 -0
- package/pnpm-lock.yaml +0 -914
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,23 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [4.6.0](https://github.com/nativescript-community/sentry/compare/v3.1.5...v4.6.0) (2022-10-19)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **android:** use latest gradle plugin requiring gradle 7+ ([7a29368](https://github.com/nativescript-community/sentry/commit/7a29368cb533548cbf2d5aee02b9d869c3181be0))
|
12
|
+
* improving integration ([7e8be4e](https://github.com/nativescript-community/sentry/commit/7e8be4e2d37f29d07b155d9c0f2e028c858f1039))
|
13
|
+
|
14
|
+
|
15
|
+
### Features
|
16
|
+
|
17
|
+
* bump to latest JS/native SDKs ([d63d12a](https://github.com/nativescript-community/sentry/commit/d63d12a837c7b0da7ed170360716169d9d79d3e5))
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
6
23
|
## [3.1.5](https://github.com/nativescript-community/sentry/compare/v3.1.4...v3.1.5) (2022-05-12)
|
7
24
|
|
8
25
|
|
package/README.md
CHANGED
@@ -15,7 +15,7 @@ Be sure to run a new build after adding plugins to avoid any issues.
|
|
15
15
|
|
16
16
|
You will need to add something like this to your webpack config so that the source maps gets uploaded. I dont set `auth` or `project` in the options as i use a `.sentryclirc` config file.
|
17
17
|
* `SOURCEMAP_REL_DIR`: i almost always set it to `../../sourcemaps`
|
18
|
-
* `SENTRY_PREFIX`:
|
18
|
+
* `SENTRY_PREFIX`: the default is `app:///`
|
19
19
|
```javascript
|
20
20
|
if (!!sentry && !!uploadSentry) {
|
21
21
|
config.devtool = false;
|
@@ -98,7 +98,6 @@ sentry_upload_dsym
|
|
98
98
|
|
99
99
|
```typescript
|
100
100
|
import * as Sentry from '@nativescript-community/sentry';
|
101
|
-
import { getAppId, getBuildNumber, getVersionName } from 'nativescript-extendedinfo';
|
102
101
|
|
103
102
|
const buildNumber = await getBuildNumber();
|
104
103
|
const versionName = await getVersionName();
|
@@ -108,15 +107,12 @@ Sentry.init({
|
|
108
107
|
dsn: SENTRY_DSN,
|
109
108
|
debug: true,
|
110
109
|
enableAutoPerformanceTracking: true,
|
111
|
-
appPrefix: SENTRY_PREFIX,
|
112
|
-
release: `${appId}@${versionName}+${buildNumber}`,
|
113
|
-
dist: `${buildNumber}.${__ANDROID__ ? 'android' : 'ios'}`
|
114
110
|
});
|
115
111
|
```
|
116
112
|
|
117
113
|
## Reporting NativeScript errors
|
118
114
|
|
119
|
-
The `
|
115
|
+
The `onerror` method ensures all unhandled NativeScript errors will be caught by Sentry in production, using a [custom error handler](https://docs.nativescript.org/core-concepts/error-handling).
|
120
116
|
|
121
117
|
|
122
118
|
## Reporting handled errors
|
package/client.d.ts
CHANGED
@@ -1,17 +1,28 @@
|
|
1
1
|
import { BaseClient } from '@sentry/core';
|
2
|
-
import {
|
2
|
+
import { Envelope, Event, EventHint, SeverityLevel, UserFeedback } from '@sentry/types';
|
3
|
+
import { NativescriptClientOptions } from './options';
|
3
4
|
/**
|
4
5
|
* The Sentry React Native SDK Client.
|
5
6
|
*
|
6
7
|
* @see NativescriptOptions for documentation on configuration options.
|
7
8
|
* @see SentryClient for usage documentation.
|
8
9
|
*/
|
9
|
-
export declare class NativescriptClient extends BaseClient<
|
10
|
+
export declare class NativescriptClient extends BaseClient<NativescriptClientOptions> {
|
11
|
+
private _outcomesBuffer;
|
12
|
+
private readonly _browserClient;
|
10
13
|
/**
|
11
14
|
* Creates a new React Native SDK instance.
|
12
15
|
* @param options Configuration options for this SDK.
|
13
16
|
*/
|
14
|
-
constructor(options:
|
17
|
+
constructor(options: NativescriptClientOptions);
|
18
|
+
/**
|
19
|
+
* @inheritDoc
|
20
|
+
*/
|
21
|
+
eventFromException(_exception: unknown, _hint?: EventHint): PromiseLike<Event>;
|
22
|
+
/**
|
23
|
+
* @inheritDoc
|
24
|
+
*/
|
25
|
+
eventFromMessage(_message: string, _level?: SeverityLevel, _hint?: EventHint): PromiseLike<Event>;
|
15
26
|
/**
|
16
27
|
* If native client is available it will trigger a native crash.
|
17
28
|
* Use this only for testing purposes.
|
@@ -21,4 +32,28 @@ export declare class NativescriptClient extends BaseClient<NativescriptBackend,
|
|
21
32
|
* @inheritDoc
|
22
33
|
*/
|
23
34
|
close(): PromiseLike<boolean>;
|
35
|
+
flush(timeout?: number): Promise<boolean>;
|
36
|
+
/**
|
37
|
+
* Sends user feedback to Sentry.
|
38
|
+
*/
|
39
|
+
captureUserFeedback(feedback: UserFeedback): void;
|
40
|
+
/**
|
41
|
+
* @inheritDoc
|
42
|
+
*/
|
43
|
+
/**
|
44
|
+
* @inheritdoc
|
45
|
+
*/
|
46
|
+
protected _sendEnvelope(envelope: Envelope): void;
|
47
|
+
/**
|
48
|
+
* Starts native client with dsn and options
|
49
|
+
*/
|
50
|
+
private _initNativeSdk;
|
51
|
+
/**
|
52
|
+
* If the user is in development mode, and the native nagger is enabled then it will show an alert.
|
53
|
+
*/
|
54
|
+
private _showCannotConnectDialog;
|
55
|
+
/**
|
56
|
+
* Attaches a client report from outcomes to the envelope.
|
57
|
+
*/
|
58
|
+
private _attachClientReportTo;
|
24
59
|
}
|
package/client.js
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
+
import { BrowserClient, defaultStackParser, makeFetchTransport } from '@sentry/browser';
|
1
2
|
import { BaseClient } from '@sentry/core';
|
2
|
-
import {
|
3
|
-
import {
|
3
|
+
import { SentryError, dateTimestampInSeconds, logger } from '@sentry/utils';
|
4
|
+
import { defaultSdkInfo } from './integrations/sdkinfo';
|
5
|
+
import { NativeTransport } from './transports/native';
|
6
|
+
import { NATIVE } from './wrapper';
|
7
|
+
import { alert } from '@nativescript/core';
|
8
|
+
import { mergeOutcomes } from './utils/outcome';
|
9
|
+
import { createUserFeedbackEnvelope, items } from './utils/envelope';
|
4
10
|
/**
|
5
11
|
* The Sentry React Native SDK Client.
|
6
12
|
*
|
@@ -13,21 +19,153 @@ export class NativescriptClient extends BaseClient {
|
|
13
19
|
* @param options Configuration options for this SDK.
|
14
20
|
*/
|
15
21
|
constructor(options) {
|
16
|
-
|
22
|
+
if (!options.transport) {
|
23
|
+
options.transport = (options, nativeFetch) => {
|
24
|
+
if (NATIVE.isNativeTransportAvailable()) {
|
25
|
+
return new NativeTransport();
|
26
|
+
}
|
27
|
+
return makeFetchTransport(options, nativeFetch);
|
28
|
+
};
|
29
|
+
}
|
30
|
+
options._metadata = options._metadata || {};
|
31
|
+
options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;
|
32
|
+
super(options);
|
33
|
+
this._outcomesBuffer = [];
|
34
|
+
this._browserClient = new BrowserClient({
|
35
|
+
dsn: options.dsn,
|
36
|
+
transport: options.transport,
|
37
|
+
transportOptions: options.transportOptions,
|
38
|
+
stackParser: options.stackParser || defaultStackParser,
|
39
|
+
integrations: [],
|
40
|
+
_metadata: options._metadata,
|
41
|
+
});
|
42
|
+
this._initNativeSdk();
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* @inheritDoc
|
46
|
+
*/
|
47
|
+
eventFromException(_exception, _hint) {
|
48
|
+
return this._browserClient.eventFromException(_exception, _hint);
|
49
|
+
}
|
50
|
+
/**
|
51
|
+
* @inheritDoc
|
52
|
+
*/
|
53
|
+
eventFromMessage(_message, _level, _hint) {
|
54
|
+
return this._browserClient.eventFromMessage(_message, _level, _hint);
|
17
55
|
}
|
18
56
|
/**
|
19
57
|
* If native client is available it will trigger a native crash.
|
20
58
|
* Use this only for testing purposes.
|
21
59
|
*/
|
22
60
|
nativeCrash() {
|
23
|
-
|
61
|
+
NATIVE.nativeCrash();
|
24
62
|
}
|
25
63
|
/**
|
26
64
|
* @inheritDoc
|
27
65
|
*/
|
28
66
|
close() {
|
29
67
|
// As super.close() flushes queued events, we wait for that to finish before closing the native SDK.
|
30
|
-
return super.close().then((result) =>
|
68
|
+
return super.close().then((result) => NATIVE.closeNativeSdk().then(() => result));
|
69
|
+
}
|
70
|
+
async flush(timeout) {
|
71
|
+
const result = await super.flush(timeout);
|
72
|
+
NATIVE.flush(timeout);
|
73
|
+
return result;
|
74
|
+
}
|
75
|
+
/**
|
76
|
+
* Sends user feedback to Sentry.
|
77
|
+
*/
|
78
|
+
captureUserFeedback(feedback) {
|
79
|
+
const envelope = createUserFeedbackEnvelope(feedback, {
|
80
|
+
metadata: this._options._metadata,
|
81
|
+
dsn: this.getDsn(),
|
82
|
+
tunnel: this._options.tunnel,
|
83
|
+
});
|
84
|
+
this._sendEnvelope(envelope);
|
85
|
+
}
|
86
|
+
/**
|
87
|
+
* @inheritDoc
|
88
|
+
*/
|
89
|
+
// sendEvent(event: Event, hint = {}) {
|
90
|
+
// if (this._dsn) {
|
91
|
+
// if (NATIVE.sendEvent) {
|
92
|
+
// NATIVE.sendEvent(event, hint);
|
93
|
+
// } else {
|
94
|
+
// super.sendEvent(event, hint);
|
95
|
+
// }
|
96
|
+
// }
|
97
|
+
// }
|
98
|
+
/**
|
99
|
+
* @inheritdoc
|
100
|
+
*/
|
101
|
+
_sendEnvelope(envelope) {
|
102
|
+
const outcomes = this._clearOutcomes();
|
103
|
+
this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);
|
104
|
+
if (this._options.sendClientReports) {
|
105
|
+
this._attachClientReportTo(this._outcomesBuffer, envelope);
|
106
|
+
}
|
107
|
+
let shouldClearOutcomesBuffer = true;
|
108
|
+
if (this._transport && this._dsn) {
|
109
|
+
this._transport.send(envelope)
|
110
|
+
.then(null, reason => {
|
111
|
+
if (reason instanceof SentryError) { // SentryError is thrown by SyncPromise
|
112
|
+
shouldClearOutcomesBuffer = false;
|
113
|
+
// If this is called asynchronously we want the _outcomesBuffer to be cleared
|
114
|
+
logger.error('SentryError while sending event, keeping outcomes buffer:', reason);
|
115
|
+
}
|
116
|
+
else {
|
117
|
+
logger.error('Error while sending event:', reason);
|
118
|
+
}
|
119
|
+
});
|
120
|
+
}
|
121
|
+
else {
|
122
|
+
logger.error('Transport disabled');
|
123
|
+
}
|
124
|
+
if (shouldClearOutcomesBuffer) {
|
125
|
+
this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact
|
126
|
+
}
|
127
|
+
}
|
128
|
+
/**
|
129
|
+
* Starts native client with dsn and options
|
130
|
+
*/
|
131
|
+
async _initNativeSdk() {
|
132
|
+
var _a, _b, _c, _d;
|
133
|
+
let didCallNativeInit = false;
|
134
|
+
try {
|
135
|
+
didCallNativeInit = await NATIVE.initNativeSdk(this._options);
|
136
|
+
}
|
137
|
+
catch (_) {
|
138
|
+
this._showCannotConnectDialog();
|
139
|
+
(_b = (_a = this._options).onReady) === null || _b === void 0 ? void 0 : _b.call(_a, { didCallNativeInit: false });
|
140
|
+
return;
|
141
|
+
}
|
142
|
+
(_d = (_c = this._options).onReady) === null || _d === void 0 ? void 0 : _d.call(_c, { didCallNativeInit });
|
143
|
+
}
|
144
|
+
/**
|
145
|
+
* If the user is in development mode, and the native nagger is enabled then it will show an alert.
|
146
|
+
*/
|
147
|
+
_showCannotConnectDialog() {
|
148
|
+
if (__DEV__ && this._options.enableNativeNagger) {
|
149
|
+
alert({
|
150
|
+
title: 'Sentry',
|
151
|
+
message: 'Warning, could not connect to Sentry native SDK.\nIf you do not want to use the native component please pass `enableNative: false` in the options.\nVisit: https://docs.sentry.io/platforms/react-native/#linking for more details.'
|
152
|
+
});
|
153
|
+
}
|
154
|
+
}
|
155
|
+
/**
|
156
|
+
* Attaches a client report from outcomes to the envelope.
|
157
|
+
*/
|
158
|
+
_attachClientReportTo(outcomes, envelope) {
|
159
|
+
if (outcomes.length > 0) {
|
160
|
+
const clientReportItem = [
|
161
|
+
{ type: 'client_report' },
|
162
|
+
{
|
163
|
+
timestamp: dateTimestampInSeconds(),
|
164
|
+
discarded_events: outcomes,
|
165
|
+
},
|
166
|
+
];
|
167
|
+
envelope[items].push(clientReportItem);
|
168
|
+
}
|
31
169
|
}
|
32
170
|
}
|
33
171
|
//# sourceMappingURL=client.js.map
|
package/client.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAErE;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAqC;IAIzE;;;OAGG;IACH,YAAmB,OAAkC;QACjD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACpB,OAAO,CAAC,SAAS,GAAG,CAAC,OAAgC,EAAE,WAAuB,EAAa,EAAE;gBACzF,IAAI,MAAM,CAAC,0BAA0B,EAAE,EAAE;oBACrC,OAAO,IAAI,eAAe,EAAE,CAAC;iBAChC;gBACD,OAAO,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YACpD,CAAC,CAAC;SACL;QACD,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QAC5C,OAAO,CAAC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CACJ"}
|
package/index.d.ts
CHANGED
@@ -1,13 +1,9 @@
|
|
1
|
+
export { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
|
2
|
+
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, withScope, configureScope, setTag, setTags, setUser, startTransaction } from '@sentry/core';
|
1
3
|
import '@sentry/tracing';
|
2
4
|
import * as Integrations from './integrations';
|
3
|
-
import {
|
4
|
-
export {
|
5
|
-
export {
|
6
|
-
export {
|
7
|
-
export {
|
8
|
-
export { init, nativeCrash, setDist, setRelease } from './sdk';
|
9
|
-
export { NSTracing } from './tracing';
|
10
|
-
export { SDK_NAME, SDK_VERSION } from './version';
|
11
|
-
export { Integrations };
|
12
|
-
export { captureUserFeedback };
|
13
|
-
declare const captureUserFeedback: typeof NSSentry.captureUserFeedback;
|
5
|
+
import { SDK_NAME, SDK_VERSION } from './version';
|
6
|
+
export { NativescriptOptions } from './options';
|
7
|
+
export { NativescriptClient } from './client';
|
8
|
+
export { init, setDist, setRelease, nativeCrash, flush, close, } from './sdk';
|
9
|
+
export { Integrations, SDK_NAME, SDK_VERSION };
|
package/index.js
CHANGED
@@ -1,17 +1,33 @@
|
|
1
|
+
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, withScope, configureScope, setTag, setTags, setUser, startTransaction } from '@sentry/core';
|
1
2
|
// We need to import it so we patch the hub with global functions
|
2
3
|
// aka. this has side effects
|
3
4
|
import '@sentry/tracing';
|
5
|
+
// Add the React Native SDK's own tracing extensions, this needs to happen AFTER @sentry/tracing's
|
6
|
+
import { _addTracingExtensions } from './measurements';
|
7
|
+
_addTracingExtensions();
|
8
|
+
// export {
|
9
|
+
// Integrations as BrowserIntegrations,
|
10
|
+
// ErrorBoundary,
|
11
|
+
// withErrorBoundary,
|
12
|
+
// createReduxEnhancer,
|
13
|
+
// Profiler,
|
14
|
+
// useProfiler,
|
15
|
+
// withProfiler,
|
16
|
+
// } from '@sentry/react';
|
4
17
|
import * as Integrations from './integrations';
|
5
|
-
import {
|
6
|
-
|
7
|
-
export {
|
8
|
-
export {
|
9
|
-
export {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
18
|
+
import { SDK_NAME, SDK_VERSION } from './version';
|
19
|
+
export { NativescriptClient } from './client';
|
20
|
+
export { init, setDist, setRelease, nativeCrash, flush, close, } from './sdk';
|
21
|
+
// export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
|
22
|
+
// export {
|
23
|
+
// NativescriptTracing,
|
24
|
+
// ReactNavigationV4Instrumentation,
|
25
|
+
// // eslint-disable-next-line deprecation/deprecation
|
26
|
+
// ReactNavigationV5Instrumentation,
|
27
|
+
// ReactNavigationInstrumentation,
|
28
|
+
// NativescriptNavigationInstrumentation,
|
29
|
+
// RoutingInstrumentation,
|
30
|
+
// ReactNavigationTransactionContext,
|
31
|
+
// } from './tracing';
|
32
|
+
export { Integrations, SDK_NAME, SDK_VERSION };
|
17
33
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,SAAS,EACT,cAAc,EACd,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EACnB,MAAM,cAAc,CAAC;AAEtB,iEAAiE;AACjE,6BAA6B;AAC7B,OAAO,iBAAiB,CAAC;AAEzB,kGAAkG;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,qBAAqB,EAAE,CAAC;AAExB,WAAW;AACX,2CAA2C;AAC3C,qBAAqB;AACrB,yBAAyB;AACzB,2BAA2B;AAC3B,gBAAgB;AAChB,mBAAmB;AACnB,oBAAoB;AACpB,0BAA0B;AAE1B,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EACH,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,GACR,MAAM,OAAO,CAAC;AACf,8EAA8E;AAE9E,WAAW;AACX,2BAA2B;AAC3B,wCAAwC;AACxC,0DAA0D;AAC1D,wCAAwC;AACxC,sCAAsC;AACtC,6CAA6C;AAC7C,8BAA8B;AAC9B,yCAAyC;AACzC,sBAAsB;AAEtB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"}
|
@@ -17,7 +17,7 @@ declare type NativescriptError = Error & {
|
|
17
17
|
preventSymbolication?: boolean;
|
18
18
|
componentStack?: string;
|
19
19
|
};
|
20
|
-
export declare function parseErrorStack(e: NativescriptError):
|
20
|
+
export declare function parseErrorStack(e: NativescriptError): NativescriptFrame[];
|
21
21
|
/**
|
22
22
|
* Converts NativescriptFrames to frames in the Sentry format
|
23
23
|
* @param frames NativescriptFrame[]
|
@@ -38,9 +38,9 @@ export declare class DebugSymbolicator implements Integration {
|
|
38
38
|
*/
|
39
39
|
setupOnce(): void;
|
40
40
|
/**
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
* Symbolicates the stack on the device talking to local dev server.
|
42
|
+
* Mutates the passed event.
|
43
|
+
*/
|
44
44
|
private _symbolicate;
|
45
45
|
/**
|
46
46
|
* Replaces the frames in the exception of a error.
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
|
2
2
|
import { logger } from '@sentry/utils';
|
3
|
-
const INTERNAL_CALLSITES_REGEX = new RegExp(['/Libraries/Renderer/oss/NativescriptRenderer-dev\\.js$', '/Libraries/BatchedBridge/MessageQueue\\.js$'].join('|'));
|
4
3
|
// xport type ExtendedError = Error & {
|
5
4
|
// jsEngine?: string,
|
6
5
|
// preventSymbolication?: boolean,
|
@@ -63,36 +62,26 @@ export class DebugSymbolicator {
|
|
63
62
|
// const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');
|
64
63
|
const stack = parseErrorStack(error);
|
65
64
|
// Ideally this should go into contexts but android sdk doesn't support it
|
66
|
-
event.extra = Object.assign(Object.assign({}, event.extra), { componentStack: error.componentStack });
|
67
|
-
|
68
|
-
// await self._symbolicate(event, stack);
|
69
|
-
// }
|
70
|
-
// if (reactError.jsEngine === 'hermes') {
|
71
|
-
const convertedFrames = convertNativescriptFramesToSentryFrames(stack);
|
72
|
-
this._replaceFramesInEvent(event, convertedFrames);
|
73
|
-
// }
|
65
|
+
event.extra = Object.assign(Object.assign({}, event.extra), { componentStack: error.componentStack, jsEngine: error.jsEngine });
|
66
|
+
await self._symbolicate(event, stack);
|
74
67
|
event.platform = 'node'; // Setting platform node makes sure we do not show source maps errors
|
75
68
|
return event;
|
76
69
|
});
|
77
70
|
}
|
78
71
|
/**
|
79
|
-
|
80
|
-
|
81
|
-
|
72
|
+
* Symbolicates the stack on the device talking to local dev server.
|
73
|
+
* Mutates the passed event.
|
74
|
+
*/
|
82
75
|
async _symbolicate(event, stack) {
|
83
76
|
try {
|
84
|
-
//
|
85
|
-
|
86
|
-
|
87
|
-
// const stackWithoutInternalCallsites = prettyStack.filter((frame: any) => frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null);
|
88
|
-
// const symbolicatedFrames = this._convertNativescriptFramesToSentryFrames(stackWithoutInternalCallsites);
|
89
|
-
// this._replaceFramesInEvent(event, symbolicatedFrames);
|
90
|
-
// } else {
|
91
|
-
// logger.error('The stack is null');
|
92
|
-
// }
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
78
|
+
const convertedFrames = convertNativescriptFramesToSentryFrames(stack);
|
79
|
+
this._replaceFramesInEvent(event, convertedFrames);
|
93
80
|
}
|
94
81
|
catch (error) {
|
95
|
-
|
82
|
+
if (error instanceof Error) {
|
83
|
+
logger.warn(`Unable to symbolicate stack trace: ${error.message}`);
|
84
|
+
}
|
96
85
|
}
|
97
86
|
}
|
98
87
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"debugsymbolicator.js","sourceRoot":"","sources":["../../src/integrations/debugsymbolicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"debugsymbolicator.js","sourceRoot":"","sources":["../../src/integrations/debugsymbolicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAwBvC,uCAAuC;AACvC,uBAAuB;AACvB,oCAAoC;AACpC,6BAA6B;AAC7B,2BAA2B;AAC3B,gCAAgC;AAChC,QAAQ;AACR,KAAK;AAEL,MAAM,UAAU,eAAe,CAAC,CAAoB;IAChD,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;QAChB,OAAO,EAAE,CAAC;KACb;IACD,MAAM,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,CAAC,CAAC,KAAK,CAAC;KAClB;SA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C,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE;YAChH,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;SAClE;IACL,CAAC;;AA/DD;;GAEG;AACW,oBAAE,GAAW,mBAAmB,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
|
2
|
-
import {
|
2
|
+
import { logger } from '@sentry/utils';
|
3
|
+
import { NATIVE } from '../wrapper';
|
3
4
|
/** Load device context from native. */
|
4
5
|
export class DeviceContext {
|
5
6
|
constructor() {
|
@@ -13,16 +14,32 @@ export class DeviceContext {
|
|
13
14
|
*/
|
14
15
|
setupOnce() {
|
15
16
|
addGlobalEventProcessor(async (event) => {
|
17
|
+
var _a, _b, _c;
|
16
18
|
const self = getCurrentHub().getIntegration(DeviceContext);
|
17
19
|
if (!self) {
|
18
20
|
return event;
|
19
21
|
}
|
20
22
|
try {
|
21
|
-
const
|
22
|
-
|
23
|
+
const contexts = await NATIVE.fetchNativeDeviceContexts();
|
24
|
+
const context = (_a = contexts['context']) !== null && _a !== void 0 ? _a : {};
|
25
|
+
const user = (_b = contexts['user']) !== null && _b !== void 0 ? _b : {};
|
26
|
+
event.contexts = Object.assign(Object.assign({}, context), event.contexts);
|
27
|
+
const breadcrumbs = (_c = contexts['breadcrumbs']) !== null && _c !== void 0 ? _c : [];
|
28
|
+
if (breadcrumbs.length) {
|
29
|
+
event.breadcrumbs = event.breadcrumbs || [];
|
30
|
+
event.breadcrumbs.push(...breadcrumbs);
|
31
|
+
event.breadcrumbs = event.breadcrumbs.sort((a, b) => a.timestamp - b.timestamp);
|
32
|
+
}
|
33
|
+
if (contexts['extra']) {
|
34
|
+
event.extra = event.extra || {};
|
35
|
+
Object.assign(event.extra, contexts['extra']);
|
36
|
+
}
|
37
|
+
if (!event.user) {
|
38
|
+
event.user = Object.assign({}, user);
|
39
|
+
}
|
23
40
|
}
|
24
|
-
catch (
|
25
|
-
|
41
|
+
catch (e) {
|
42
|
+
logger.log(`Failed to get device context from native: ${e}`);
|
26
43
|
}
|
27
44
|
return event;
|
28
45
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"devicecontext.js","sourceRoot":"","sources":["../../src/integrations/devicecontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"devicecontext.js","sourceRoot":"","sources":["../../src/integrations/devicecontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,uCAAuC;AACvC,MAAM,OAAO,aAAa;IAA1B;QACI;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;IA4C3C,CAAC;IAtCG;;OAEG;IACI,SAAS;QACZ,uBAAuB,CAAC,KAAK,EAAE,KAAY,EAAE,EAAE;;YAC3C,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YAC3D,IAAI,CAAC,IAAI,EAAE;gBACP,OAAO,KAAK,CAAC;aAChB;YAED,IAAI;gBACA,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,yBAAyB,EAAE,CAAC;gBAE1D,MAAM,OAAO,GAAG,MAAA,QAAQ,CAAC,SAAS,CAAa,mCAAI,EAAE,CAAC;gBACtD,MAAM,IAAI,GAAG,MAAA,QAAQ,CAAC,MAAM,CAAC,mCAAI,EAAE,CAAC;gBAEpC,KAAK,CAAC,QAAQ,mCAAQ,OAAO,GAAK,KAAK,CAAC,QAAQ,CAAE,CAAC;gBACnD,MAAM,WAAW,GAAG,MAAA,QAAQ,CAAC,aAAa,CAAC,mCAAI,EAAE,CAAC;gBAClD,IAAI,WAAW,CAAC,MAAM,EAAE;oBACpB,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;oBAC5C,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;oBACvC,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;iBACnF;gBACD,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE;oBACnB,KAAK,CAAC,KAAK,GAAI,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;oBACjC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;iBACjD;gBAED,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;oBACb,KAAK,CAAC,IAAI,qBAAQ,IAAI,CAAE,CAAC;iBAC5B;aACJ;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,CAAC,GAAG,CAAC,6CAA6C,CAAC,EAAE,CAAC,CAAC;aAChE;YAED,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC;;AA1CD;;GAEG;AACW,gBAAE,GAAW,eAAe,CAAC"}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { EventProcessor, Integration } from
|
1
|
+
import { EventProcessor, Integration } from '@sentry/types';
|
2
2
|
/** Default EventOrigin instrumentation */
|
3
3
|
export declare class EventOrigin implements Integration {
|
4
4
|
/**
|
5
|
-
|
6
|
-
|
5
|
+
* @inheritDoc
|
6
|
+
*/
|
7
7
|
static id: string;
|
8
8
|
/**
|
9
|
-
|
10
|
-
|
9
|
+
* @inheritDoc
|
10
|
+
*/
|
11
11
|
name: string;
|
12
12
|
/**
|
13
|
-
|
14
|
-
|
13
|
+
* @inheritDoc
|
14
|
+
*/
|
15
15
|
setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void;
|
16
16
|
}
|
@@ -2,25 +2,25 @@
|
|
2
2
|
export class EventOrigin {
|
3
3
|
constructor() {
|
4
4
|
/**
|
5
|
-
|
6
|
-
|
5
|
+
* @inheritDoc
|
6
|
+
*/
|
7
7
|
this.name = EventOrigin.id;
|
8
8
|
}
|
9
9
|
/**
|
10
|
-
|
11
|
-
|
10
|
+
* @inheritDoc
|
11
|
+
*/
|
12
12
|
setupOnce(addGlobalEventProcessor) {
|
13
13
|
addGlobalEventProcessor((event) => {
|
14
14
|
var _a;
|
15
15
|
event.tags = (_a = event.tags) !== null && _a !== void 0 ? _a : {};
|
16
|
-
event.tags[
|
17
|
-
event.tags[
|
16
|
+
event.tags['event.origin'] = 'javascript';
|
17
|
+
event.tags['event.environment'] = 'javascript';
|
18
18
|
return event;
|
19
19
|
});
|
20
20
|
}
|
21
21
|
}
|
22
22
|
/**
|
23
|
-
|
24
|
-
|
25
|
-
EventOrigin.id =
|
23
|
+
* @inheritDoc
|
24
|
+
*/
|
25
|
+
EventOrigin.id = 'EventOrigin';
|
26
26
|
//# sourceMappingURL=eventorigin.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"eventorigin.js","sourceRoot":"","sources":["../../src/integrations/eventorigin.ts"],"names":[],"mappings":"AAEA,0CAA0C;AAC1C,MAAM,OAAO,WAAW;IAAxB;
|
1
|
+
{"version":3,"file":"eventorigin.js","sourceRoot":"","sources":["../../src/integrations/eventorigin.ts"],"names":[],"mappings":"AAEA,0CAA0C;AAC1C,MAAM,OAAO,WAAW;IAAxB;QAMI;;SAEC;QACM,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAezC,CAAC;IAbG;;KAEC;IACM,SAAS,CAAC,uBAAoD;QACjE,uBAAuB,CAAC,CAAC,KAAK,EAAE,EAAE;;YAC9B,KAAK,CAAC,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC;YAE9B,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YAC1C,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,YAAY,CAAC;YAE/C,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC;;AAtBD;;EAEC;AACa,cAAE,GAAW,aAAa,CAAC"}
|