@nativescript-community/sentry 2.0.8 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +88 -4
- package/backend.d.ts +28 -0
- package/backend.js +18 -3
- package/backend.js.map +1 -1
- package/client.d.ts +8 -10
- package/client.js +11 -18
- package/client.js.map +1 -1
- package/index.d.ts +9 -4
- package/index.js +11 -5
- package/index.js.map +1 -1
- package/integrations/devicecontext.js +0 -1
- package/integrations/devicecontext.js.map +1 -1
- package/integrations/eventorigin.d.ts +16 -0
- package/integrations/eventorigin.js +26 -0
- package/integrations/eventorigin.js.map +1 -0
- package/integrations/nativescripterrorhandlers.js +0 -22
- package/integrations/nativescripterrorhandlers.js.map +1 -1
- package/integrations/release.js +24 -14
- package/integrations/release.js.map +1 -1
- package/integrations/sdkinfo.d.ts +17 -0
- package/integrations/sdkinfo.js +48 -0
- package/integrations/sdkinfo.js.map +1 -0
- package/nssentry.android.d.ts +20 -8
- package/nssentry.android.js +264 -202
- package/nssentry.android.js.map +1 -1
- package/nssentry.d.ts +25 -2
- package/nssentry.ios.d.ts +22 -5
- package/nssentry.ios.js +176 -72
- package/nssentry.ios.js.map +1 -1
- package/package.json +10 -9
- package/platforms/android/buildscript.gradle +1 -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/Info.plist +0 -0
- package/platforms/ios/src/NSSentry.h +11 -0
- package/platforms/ios/src/NSSentry.m +5 -0
- package/platforms/ios/src/module.modulemap +4 -0
- package/pnpm-lock.yaml +74 -43
- package/scope.d.ts +45 -0
- package/scope.js +72 -0
- package/scope.js.map +1 -0
- package/sdk.d.ts +9 -0
- package/sdk.js +46 -12
- package/sdk.js.map +1 -1
- package/tracing/index.d.ts +1 -0
- package/tracing/index.js +8 -0
- package/tracing/index.js.map +1 -0
- package/tracing/nstracing.d.ts +65 -0
- package/tracing/nstracing.js +92 -0
- package/tracing/nstracing.js.map +1 -0
- package/tracing/utils.d.ts +6 -0
- package/tracing/utils.js +21 -0
- package/tracing/utils.js.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,55 @@
|
|
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
|
+
## [3.0.2](https://github.com/nativescript-community/sentry/compare/v3.0.1...v3.0.2) (2022-01-24)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @nativescript-community/sentry
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [3.0.1](https://github.com/nativescript-community/sentry/compare/v3.0.0...v3.0.1) (2021-10-31)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* **android:** gradle 7.0 support ([23a60b4](https://github.com/nativescript-community/sentry/commit/23a60b49b6ac26c4930ef153d38026a2ceadf522))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
# [3.0.0](https://github.com/nativescript-community/sentry/compare/v2.1.1...v3.0.0) (2021-09-21)
|
26
|
+
|
27
|
+
**Note:** Version bump only for package @nativescript-community/sentry
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
## [2.1.1](https://github.com/nativescript-community/sentry/compare/v2.1.0...v2.1.1) (2021-09-21)
|
34
|
+
|
35
|
+
|
36
|
+
### Bug Fixes
|
37
|
+
|
38
|
+
* move to latest SDKs ([34e37fd](https://github.com/nativescript-community/sentry/commit/34e37fdea216741f76a99bf748c036b5319e3218))
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
# [2.1.0](https://github.com/nativescript-community/sentry/compare/v2.0.8...v2.1.0) (2021-02-24)
|
45
|
+
|
46
|
+
|
47
|
+
### Features
|
48
|
+
|
49
|
+
* update to latest SDKs REQUIRES Sentry 20.6.0 + ([b4db1a9](https://github.com/nativescript-community/sentry/commit/b4db1a95f0f265472512e1ee10ef39d965f94e44))
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
6
55
|
## [2.0.8](https://github.com/nativescript-community/sentry/compare/v2.0.7...v2.0.8) (2020-11-23)
|
7
56
|
|
8
57
|
**Note:** Version bump only for package @nativescript-community/sentry
|
package/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
[](https://www.npmjs.com/package/@nativescript-community/sentry)
|
2
|
+
[](https://www.npmjs.com/package/@nativescript-community/sentry)
|
3
3
|
[](https://github.com/nativescript-community/sentry/network)
|
4
4
|
[](https://github.com/nativescript-community/sentry/stargazers)
|
5
5
|
|
@@ -9,12 +9,96 @@
|
|
9
9
|
|
10
10
|
Be sure to run a new build after adding plugins to avoid any issues.
|
11
11
|
|
12
|
-
#
|
12
|
+
# Configuration
|
13
|
+
|
14
|
+
## Webpack
|
15
|
+
|
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
|
+
* `SOURCEMAP_REL_DIR`: i almost always set it to `../../sourcemaps`
|
18
|
+
* `SENTRY_PREFIX`: i almost always set it to `app:///`
|
19
|
+
```javascript
|
20
|
+
if (!!sentry && !!uploadSentry) {
|
21
|
+
config.devtool = false;
|
22
|
+
config.plugins.push(
|
23
|
+
new webpack.SourceMapDevToolPlugin({
|
24
|
+
append: `\n//# sourceMappingURL=${process.env.SENTRY_PREFIX}[name].js.map`,
|
25
|
+
filename: join(process.env.SOURCEMAP_REL_DIR, '[name].js.map')
|
26
|
+
})
|
27
|
+
);
|
28
|
+
let appVersion;
|
29
|
+
let buildNumber;
|
30
|
+
if (isAndroid) {
|
31
|
+
const gradlePath = `${appResourcesPath}/Android/app.gradle`;
|
32
|
+
const gradleData = readFileSync(gradlePath, 'utf8');
|
33
|
+
appVersion = gradleData.match(/versionName "((?:[0-9]+\.?)+)"/)[1];
|
34
|
+
buildNumber = gradleData.match(/versionCode ([0-9]+)/)[1];
|
35
|
+
} else if (isIOS) {
|
36
|
+
const plistPath = `${appResourcesPath}/iOS/Info.plist`;
|
37
|
+
const plistData = readFileSync(plistPath, 'utf8');
|
38
|
+
appVersion = plistData.match(/<key>CFBundleShortVersionString<\/key>[\s\n]*<string>(.*?)<\/string>/)[1];
|
39
|
+
buildNumber = plistData.match(/<key>CFBundleVersion<\/key>[\s\n]*<string>([0-9]*)<\/string>/)[1];
|
40
|
+
}
|
41
|
+
config.plugins.push(
|
42
|
+
new SentryCliPlugin({
|
43
|
+
release: appVersion,
|
44
|
+
urlPrefix: 'app:///',
|
45
|
+
rewrite: true,
|
46
|
+
release: `${nconfig.id}@${appVersion}+${buildNumber}`,
|
47
|
+
dist: `${buildNumber}.${platform}`,
|
48
|
+
ignoreFile: '.sentrycliignore',
|
49
|
+
include: [join(dist, process.env.SOURCEMAP_REL_DIR)]
|
50
|
+
})
|
51
|
+
);
|
52
|
+
}
|
53
|
+
```
|
54
|
+
|
55
|
+
## Fastlane
|
56
|
+
|
57
|
+
If you use fastlane you can use it to create release and upload dsyms
|
58
|
+
To do that you need to install it:
|
59
|
+
```sh
|
60
|
+
fastlane add_plugin sentry
|
61
|
+
```
|
62
|
+
Also for now you should install `nativescript-set-version` as it is needed to read app version, build number.
|
63
|
+
```sh
|
64
|
+
npm install -D nativescript-set-version
|
65
|
+
```
|
66
|
+
|
67
|
+
Now you can setup your `Fastfile`
|
68
|
+
* create release
|
69
|
+
```
|
70
|
+
version = ""
|
71
|
+
versionCode = ""
|
72
|
+
|
73
|
+
Dir.chdir("..") do
|
74
|
+
version = sh("./node_modules/.bin/get-version", platform, "version").gsub(/\n/,'')
|
75
|
+
versionCode = sh("./node_modules/.bin/get-version", platform, "code").gsub(/\n/,'')
|
76
|
+
end
|
77
|
+
sentry_create_release(
|
78
|
+
version: version, # release version to create
|
79
|
+
)
|
80
|
+
```
|
81
|
+
|
82
|
+
* upload dsyms
|
83
|
+
```
|
84
|
+
sentry_upload_dsym
|
85
|
+
```
|
86
|
+
|
87
|
+
# Usage in the app
|
13
88
|
|
14
89
|
```typescript
|
15
90
|
import * as Sentry from '@nativescript-community/sentry';
|
91
|
+
import { getBuildNumber } from '@nativescript-community/extendedinfo';
|
92
|
+
|
93
|
+
const buildNumber = await getBuildNumber();
|
94
|
+
// setting the platform in dist allows to have
|
95
|
+
// android and ios dist inside the same release
|
96
|
+
const dist = `${buildNumber}.${global.isAndroid ? 'android' : 'ios'}`;
|
16
97
|
Sentry.init({
|
17
|
-
dsn: "__DSN__"
|
98
|
+
dsn: "__DSN__",
|
99
|
+
// SENTRY_PREFIX is the same as the one you use in webpack config
|
100
|
+
appPrefix: SENTRY_PREFIX,
|
101
|
+
dist
|
18
102
|
});
|
19
103
|
```
|
20
104
|
|
package/backend.d.ts
CHANGED
@@ -22,6 +22,17 @@ export interface NativescriptOptions extends BrowserOptions {
|
|
22
22
|
enableNativeCrashHandling?: boolean;
|
23
23
|
/** Maximum time to wait to drain the request queue, before the process is allowed to exit. */
|
24
24
|
shutdownTimeout?: number;
|
25
|
+
sessionTrackingIntervalMillis?: number;
|
26
|
+
/** Enable scope sync from Java to NDK on Android */
|
27
|
+
enableNdkScopeSync?: boolean;
|
28
|
+
/** When enabled, all the threads are automatically attached to all logged events on Android */
|
29
|
+
attachThreads?: boolean;
|
30
|
+
/**
|
31
|
+
* When enabled, certain personally identifiable information (PII) is added by active integrations.
|
32
|
+
*
|
33
|
+
* @default false
|
34
|
+
* */
|
35
|
+
sendDefaultPii?: boolean;
|
25
36
|
/** Should the native nagger alert be shown or not. */
|
26
37
|
/**
|
27
38
|
* Optional prefix to add while rewriting frames
|
@@ -29,6 +40,17 @@ export interface NativescriptOptions extends BrowserOptions {
|
|
29
40
|
appPrefix?: string;
|
30
41
|
traceErrorHandler?: boolean;
|
31
42
|
uncaughtErrors?: boolean;
|
43
|
+
breadcrumbs?: {
|
44
|
+
console?: boolean;
|
45
|
+
dom?: boolean;
|
46
|
+
fetch?: boolean;
|
47
|
+
history?: boolean;
|
48
|
+
sentry?: boolean;
|
49
|
+
xhr?: boolean;
|
50
|
+
};
|
51
|
+
/** Enable auto performance tracking by default. */
|
52
|
+
enableAutoPerformanceTracking?: boolean;
|
53
|
+
flushSendEvent?: boolean;
|
32
54
|
}
|
33
55
|
/** The Sentry Nativescript SDK Backend. */
|
34
56
|
export declare class NativescriptBackend extends BaseBackend<BrowserOptions> {
|
@@ -58,3 +80,9 @@ export declare class NativescriptBackend extends BaseBackend<BrowserOptions> {
|
|
58
80
|
*/
|
59
81
|
eventFromMessage(message: string, level?: Severity, hint?: EventHint): SyncPromise<Event>;
|
60
82
|
}
|
83
|
+
/**
|
84
|
+
* Convert js severity level which has critical and log to more widely supported levels.
|
85
|
+
* @param level
|
86
|
+
* @returns More widely supported Severity level strings
|
87
|
+
*/
|
88
|
+
export declare function _processLevel(level: Severity): Severity;
|
package/backend.js
CHANGED
@@ -12,9 +12,10 @@ export class NativescriptBackend extends BaseBackend {
|
|
12
12
|
this._options = _options;
|
13
13
|
this._browserBackend = new BrowserBackend(_options);
|
14
14
|
if (_options.enableNative !== false) {
|
15
|
-
NSSentry.startWithDsnString(_options.dsn, _options)
|
16
|
-
|
17
|
-
|
15
|
+
NSSentry.startWithDsnString(_options.dsn, _options);
|
16
|
+
// .then(() => {
|
17
|
+
// // NSSentry.setLogLevel(_options.debug ? 2 : 1);
|
18
|
+
// });
|
18
19
|
}
|
19
20
|
else {
|
20
21
|
// if (__DEV__ && _options.enableNativeNagger) {
|
@@ -71,4 +72,18 @@ export class NativescriptBackend extends BaseBackend {
|
|
71
72
|
return this._browserBackend.eventFromMessage(message, level, hint);
|
72
73
|
}
|
73
74
|
}
|
75
|
+
/**
|
76
|
+
* Convert js severity level which has critical and log to more widely supported levels.
|
77
|
+
* @param level
|
78
|
+
* @returns More widely supported Severity level strings
|
79
|
+
*/
|
80
|
+
export function _processLevel(level) {
|
81
|
+
if (level === Severity.Critical) {
|
82
|
+
return Severity.Fatal;
|
83
|
+
}
|
84
|
+
if (level === Severity.Log) {
|
85
|
+
return Severity.Debug;
|
86
|
+
}
|
87
|
+
return level;
|
88
|
+
}
|
74
89
|
//# sourceMappingURL=backend.js.map
|
package/backend.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAoB,QAAQ,EAAa,MAAM,eAAe,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAoB,QAAQ,EAAa,MAAM,eAAe,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAoEtC,2CAA2C;AAC3C,MAAM,OAAO,mBAAoB,SAAQ,WAA2B;IAGhE,mDAAmD;IACnD,YAAsC,QAA6B;QAC/D,KAAK,CAAC,QAAQ,CAAC,CAAC;QADkB,aAAQ,GAAR,QAAQ,CAAqB;QAE/D,IAAI,CAAC,eAAe,GAAG,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,CAAC;IAC3E,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,OAAe,EAAE,QAAkB,QAAQ,CAAC,IAAI,EAAE,IAAgB;QACtF,OAAO,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAQ,CAAC;IAC9E,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAe;IACzC,IAAI,KAAK,KAAK,QAAQ,CAAC,QAAQ,EAAE;QAC7B,OAAO,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,IAAI,KAAK,KAAK,QAAQ,CAAC,GAAG,EAAE;QACxB,OAAO,QAAQ,CAAC,KAAK,CAAC;KACzB;IAED,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/client.d.ts
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
import { BaseClient
|
2
|
-
import { Event, EventHint } from '@sentry/types';
|
3
|
-
import { SyncPromise } from '@sentry/utils';
|
1
|
+
import { BaseClient } from '@sentry/core';
|
4
2
|
import { NativescriptBackend, NativescriptOptions } from './backend';
|
5
3
|
/**
|
6
4
|
* The Sentry React Native SDK Client.
|
@@ -15,12 +13,12 @@ export declare class NativescriptClient extends BaseClient<NativescriptBackend,
|
|
15
13
|
*/
|
16
14
|
constructor(options: NativescriptOptions);
|
17
15
|
/**
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
/**
|
22
|
-
* If native client is available it will trigger a native crash.
|
23
|
-
* Use this only for testing purposes.
|
24
|
-
*/
|
16
|
+
* If native client is available it will trigger a native crash.
|
17
|
+
* Use this only for testing purposes.
|
18
|
+
*/
|
25
19
|
nativeCrash(): void;
|
20
|
+
/**
|
21
|
+
* @inheritDoc
|
22
|
+
*/
|
23
|
+
close(): PromiseLike<boolean>;
|
26
24
|
}
|
package/client.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BaseClient } from '@sentry/core';
|
2
2
|
import { NativescriptBackend } from './backend';
|
3
|
-
import {
|
3
|
+
import { NSSentry } from './nssentry';
|
4
4
|
/**
|
5
5
|
* The Sentry React Native SDK Client.
|
6
6
|
*
|
@@ -16,25 +16,18 @@ export class NativescriptClient extends BaseClient {
|
|
16
16
|
super(NativescriptBackend, options);
|
17
17
|
}
|
18
18
|
/**
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
event.platform = event.platform || 'javascript';
|
23
|
-
event.sdk = Object.assign(Object.assign({}, event.sdk), { name: SDK_NAME, packages: [
|
24
|
-
...((event.sdk && event.sdk.packages) || []),
|
25
|
-
{
|
26
|
-
name: 'npm:@nativescript-community/sentry',
|
27
|
-
version: SDK_VERSION
|
28
|
-
}
|
29
|
-
], version: SDK_VERSION });
|
30
|
-
return super._prepareEvent(event, scope, hint);
|
31
|
-
}
|
32
|
-
/**
|
33
|
-
* If native client is available it will trigger a native crash.
|
34
|
-
* Use this only for testing purposes.
|
35
|
-
*/
|
19
|
+
* If native client is available it will trigger a native crash.
|
20
|
+
* Use this only for testing purposes.
|
21
|
+
*/
|
36
22
|
nativeCrash() {
|
37
23
|
this._getBackend().nativeCrash();
|
38
24
|
}
|
25
|
+
/**
|
26
|
+
* @inheritDoc
|
27
|
+
*/
|
28
|
+
close() {
|
29
|
+
// As super.close() flushes queued events, we wait for that to finish before closing the native SDK.
|
30
|
+
return super.close().then((result) => NSSentry.closeNativeSdk().then(() => result));
|
31
|
+
}
|
39
32
|
}
|
40
33
|
//# 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,EAAS,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAS,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAuB,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAoD;IACxF;;;OAGG;IACH,YAAmB,OAA4B;QAC3C,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;KAGC;IACM,WAAW;QACd,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;IAED;;KAEC;IACM,KAAK;QACZ,oGAAoG;QAChG,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,MAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAyB,CAAC,CAAC;IACzH,CAAC;CACJ"}
|
package/index.d.ts
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import '@sentry/tracing';
|
2
|
+
import * as Integrations from './integrations';
|
3
|
+
import { NSSentry } from './nssentry';
|
4
|
+
export { addBreadcrumb, addGlobalEventProcessor, captureEvent, captureException, captureMessage, configureScope, getCurrentHub, getHubFromCarrier, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope } from '@sentry/core';
|
5
|
+
export { Breadcrumb, Event, Exception, Request, Response, SdkInfo, Severity, StackFrame, Stacktrace, Status, Thread, User } from '@sentry/types';
|
3
6
|
export { NativescriptBackend, NativescriptOptions } from './backend';
|
4
7
|
export { NativescriptClient as NativescriptClient } from './client';
|
5
|
-
export { init, setDist, setRelease
|
8
|
+
export { init, nativeCrash, setDist, setRelease } from './sdk';
|
9
|
+
export { NSTracing } from './tracing';
|
6
10
|
export { SDK_NAME, SDK_VERSION } from './version';
|
7
|
-
import * as Integrations from './integrations';
|
8
11
|
export { Integrations };
|
12
|
+
export { captureUserFeedback };
|
13
|
+
declare const captureUserFeedback: typeof NSSentry.captureUserFeedback;
|
package/index.js
CHANGED
@@ -1,11 +1,17 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
// We need to import it so we patch the hub with global functions
|
2
|
+
// aka. this has side effects
|
3
|
+
import '@sentry/tracing';
|
4
|
+
import * as Integrations from './integrations';
|
5
|
+
import { NSSentry } from './nssentry';
|
6
|
+
// logger.disable(); // this crashes for {N} for now
|
7
|
+
export { addBreadcrumb, addGlobalEventProcessor, captureEvent, captureException, captureMessage, configureScope, getCurrentHub, getHubFromCarrier, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope } from '@sentry/core';
|
3
8
|
export { Severity, Status } from '@sentry/types';
|
4
|
-
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope } from '@sentry/core';
|
5
9
|
export { NativescriptBackend } from './backend';
|
6
10
|
export { NativescriptClient as NativescriptClient } from './client';
|
7
|
-
export { init, setDist, setRelease
|
11
|
+
export { init, nativeCrash, setDist, setRelease } from './sdk';
|
12
|
+
export { NSTracing } from './tracing';
|
8
13
|
export { SDK_NAME, SDK_VERSION } from './version';
|
9
|
-
import * as Integrations from './integrations';
|
10
14
|
export { Integrations };
|
15
|
+
export { captureUserFeedback };
|
16
|
+
const captureUserFeedback = NSSentry.captureUserFeedback;
|
11
17
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,6BAA6B;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,oDAAoD;AACpD,OAAO,EACH,aAAa,EAAE,uBAAuB,EACtC,YAAY,EAAE,gBAAgB,EAC9B,cAAc,EACd,cAAc,EACd,aAAa,EAAE,iBAAiB,EAChC,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAA4D,QAAQ,EAA0B,MAAM,EAAgB,MAAM,eAAe,CAAC;AACjJ,OAAO,EAAE,mBAAmB,EAAuB,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EACH,SAAS,EACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EACH,mBAAmB,EACtB,CAAC;AAEF,MAAM,mBAAmB,GAAG,QAAQ,CAAC,mBAAmB,CAAC"}
|
@@ -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,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,uCAAuC;AACvC,MAAM,OAAO,aAAa;IAA1B;QACI;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;
|
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,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,uCAAuC;AACvC,MAAM,OAAO,aAAa;IAA1B;QACI;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;IA0B3C,CAAC;IApBG;;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,cAAc,GAAG,MAAM,QAAQ,CAAC,cAAc,EAAE,CAAC;gBACvD,KAAK,CAAC,QAAQ,mCAAQ,cAAc,GAAK,KAAK,CAAC,QAAQ,CAAE,CAAC;aAC7D;YAAC,OAAO,GAAG,EAAE;gBACV,yCAAyC;aAC5C;YAED,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC;;AAxBD;;GAEG;AACW,gBAAE,GAAW,eAAe,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { EventProcessor, Integration } from "@sentry/types";
|
2
|
+
/** Default EventOrigin instrumentation */
|
3
|
+
export declare class EventOrigin implements Integration {
|
4
|
+
/**
|
5
|
+
* @inheritDoc
|
6
|
+
*/
|
7
|
+
static id: string;
|
8
|
+
/**
|
9
|
+
* @inheritDoc
|
10
|
+
*/
|
11
|
+
name: string;
|
12
|
+
/**
|
13
|
+
* @inheritDoc
|
14
|
+
*/
|
15
|
+
setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void;
|
16
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/** Default EventOrigin instrumentation */
|
2
|
+
export class EventOrigin {
|
3
|
+
constructor() {
|
4
|
+
/**
|
5
|
+
* @inheritDoc
|
6
|
+
*/
|
7
|
+
this.name = EventOrigin.id;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* @inheritDoc
|
11
|
+
*/
|
12
|
+
setupOnce(addGlobalEventProcessor) {
|
13
|
+
addGlobalEventProcessor((event) => {
|
14
|
+
var _a;
|
15
|
+
event.tags = (_a = event.tags) !== null && _a !== void 0 ? _a : {};
|
16
|
+
event.tags["event.origin"] = "javascript";
|
17
|
+
event.tags["event.environment"] = "javascript";
|
18
|
+
return event;
|
19
|
+
});
|
20
|
+
}
|
21
|
+
}
|
22
|
+
/**
|
23
|
+
* @inheritDoc
|
24
|
+
*/
|
25
|
+
EventOrigin.id = "EventOrigin";
|
26
|
+
//# sourceMappingURL=eventorigin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"eventorigin.js","sourceRoot":"","sources":["../../src/integrations/eventorigin.ts"],"names":[],"mappings":"AAEA,0CAA0C;AAC1C,MAAM,OAAO,WAAW;IAAxB;QAME;;WAEG;QACI,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAevC,CAAC;IAbC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,CAAC,KAAK,EAAE,EAAE;;YAChC,KAAK,CAAC,IAAI,SAAG,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;QACf,CAAC,CAAC,CAAC;IACL,CAAC;;AAtBD;;GAEG;AACW,cAAE,GAAW,aAAa,CAAC"}
|
@@ -45,20 +45,6 @@ export class NativescriptErrorHandlers {
|
|
45
45
|
this.globalHander(event.error);
|
46
46
|
}
|
47
47
|
globalHander(error, isFatal) {
|
48
|
-
// error.stack = error.stackTrace;
|
49
|
-
// We want to handle fatals, but only in production mode.
|
50
|
-
// const stackTrace = error.stackTrace;
|
51
|
-
// error.stackTrace = error.stack;
|
52
|
-
// error.stack = stackTrace;
|
53
|
-
// const shouldHandleFatal = isFatal && !global.__DEV__;
|
54
|
-
// let handlingFatal = false;
|
55
|
-
// if (shouldHandleFatal) {
|
56
|
-
// if (handlingFatal) {
|
57
|
-
// logger.log('Encountered multiple fatals in a row. The latest:', error);
|
58
|
-
// return;
|
59
|
-
// }
|
60
|
-
// handlingFatal = true;
|
61
|
-
// }
|
62
48
|
getCurrentHub().withScope(scope => {
|
63
49
|
if (isFatal) {
|
64
50
|
scope.setLevel(Severity.Fatal);
|
@@ -66,11 +52,6 @@ export class NativescriptErrorHandlers {
|
|
66
52
|
getCurrentHub().captureException(error, {
|
67
53
|
originalException: error
|
68
54
|
});
|
69
|
-
// const timeout = client.getOptions().shutdownTimeout || 2000;
|
70
|
-
// NSSentry.flush(timeout);
|
71
|
-
// getCurrentHub()
|
72
|
-
// .getClient()
|
73
|
-
// .flush(2000);
|
74
55
|
});
|
75
56
|
const client = getCurrentHub().getClient();
|
76
57
|
// If in dev, we call the default handler anyway and hope the error will be sent
|
@@ -79,9 +60,6 @@ export class NativescriptErrorHandlers {
|
|
79
60
|
const timeout = client.getOptions().shutdownTimeout || 2000;
|
80
61
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
81
62
|
client.flush(timeout)
|
82
|
-
.then(() => {
|
83
|
-
// defaultHandler(error, isFatal);
|
84
|
-
})
|
85
63
|
.catch(e => {
|
86
64
|
logger.error(e);
|
87
65
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nativescripterrorhandlers.js","sourceRoot":"","sources":["../../src/integrations/nativescripterrorhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAe,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvC,OAAO,EAAC,WAAW,EAAE,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAUtD,4CAA4C;AAC5C,MAAM,OAAO,yBAAyB;IAclC,kBAAkB;IAClB,YAAmB,OAA0C;QAd7D;;WAEG;QACI,SAAI,GAAW,yBAAyB,CAAC,EAAE,CAAC;QAY/C,IAAI,CAAC,QAAQ,mBACT,iBAAiB,EAAE,KAAK,EACxB,cAAc,EAAE,KAAK,IAClB,OAAO,CACb,CAAC;IACN,CAAC;IAED;;OAEG;IACI,SAAS;QACZ,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACK,0BAA0B;QAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,kBAAkB,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YAC7E,uEAAuE;YACvE,sBAAsB;YACtB,oBAAoB;YACpB,2BAA2B;YAC3B,yBAAyB;YACzB,2BAA2B;YAC3B,SAAS;YACT,8CAA8C;YAC9C,oDAAoD;YACpD,4BAA4B;YAC5B,uCAAuC;YACvC,cAAc;YACd,QAAQ;YACR,MAAM;SACT;IACL,CAAC;IAEO,iBAAiB,CAAC,KAAK;QAC3B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACO,YAAY,CAAC,KAAU,EAAE,OAAiB;QAC9C,
|
1
|
+
{"version":3,"file":"nativescripterrorhandlers.js","sourceRoot":"","sources":["../../src/integrations/nativescripterrorhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAe,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvC,OAAO,EAAC,WAAW,EAAE,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAUtD,4CAA4C;AAC5C,MAAM,OAAO,yBAAyB;IAclC,kBAAkB;IAClB,YAAmB,OAA0C;QAd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CAAC,eAAe,IAAI,IAAI,CAAC;YAC5D,4EAA4E;YAC3E,MAAM,CAAC,KAAK,CAAC,OAAO,CAAkB;iBAClC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACP,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;SACV;aAAM;YACH,+EAA+E;YAC/E,kCAAkC;SACrC;IACL,CAAC;IAED;;OAEG;IACK,cAAc;QAClB,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;YACjC,6BAA6B;YAC7B,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,mBAAmB,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YAE9E,KAAK,CAAC,eAAe,CAAC;gBAClB,YAAY,EAAE,IAAI,CAAC,YAAY;aAClC,CAAC,CAAC;YACH,uFAAuF;YAEvF,gCAAgC;SACnC;IACL,CAAC;;AA5FD;;GAEG;AACW,4BAAE,GAAW,2BAA2B,CAAC"}
|
package/integrations/release.js
CHANGED
@@ -13,31 +13,41 @@ export class Release {
|
|
13
13
|
*/
|
14
14
|
setupOnce() {
|
15
15
|
addGlobalEventProcessor(async (event) => {
|
16
|
+
var _a, _b, _c;
|
16
17
|
const self = getCurrentHub().getIntegration(Release);
|
17
18
|
if (!self) {
|
18
19
|
return event;
|
19
20
|
}
|
21
|
+
const options = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
|
22
|
+
/*
|
23
|
+
__sentry_release and __sentry_dist is set by the user with setRelease and setDist. If this is used then this is the strongest.
|
24
|
+
Otherwise we check for the release and dist in the options passed on init, as this is stronger than the release/dist from the native build.
|
25
|
+
*/
|
26
|
+
if (typeof ((_b = event.extra) === null || _b === void 0 ? void 0 : _b.__sentry_release) === 'string') {
|
27
|
+
event.release = `${event.extra.__sentry_release}`;
|
28
|
+
}
|
29
|
+
else if (typeof (options === null || options === void 0 ? void 0 : options.release) === 'string') {
|
30
|
+
event.release = options.release;
|
31
|
+
}
|
32
|
+
if (typeof ((_c = event.extra) === null || _c === void 0 ? void 0 : _c.__sentry_dist) === 'string') {
|
33
|
+
event.dist = `${event.extra.__sentry_dist}`;
|
34
|
+
}
|
35
|
+
else if (typeof (options === null || options === void 0 ? void 0 : options.dist) === 'string') {
|
36
|
+
event.dist = options.dist;
|
37
|
+
}
|
38
|
+
if (event.release && event.dist) {
|
39
|
+
return event;
|
40
|
+
}
|
20
41
|
try {
|
21
|
-
const release = (await NSSentry.
|
42
|
+
const release = (await NSSentry.fetchNativeRelease());
|
22
43
|
if (release) {
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
if (!event.dist) {
|
27
|
-
event.dist = `${release.build}`;
|
28
|
-
}
|
44
|
+
event.release = `${release.id}@${release.version}+${release.build}`;
|
45
|
+
event.dist = `${release.build}`;
|
29
46
|
}
|
30
47
|
}
|
31
48
|
catch (_Oo) {
|
32
49
|
// Something went wrong, we just continue
|
33
50
|
}
|
34
|
-
// If __sentry_release or __sentry_dist it should be stronger because the user set it
|
35
|
-
if (event.extra && event.extra.__sentry_release) {
|
36
|
-
event.release = `${event.extra.__sentry_release}`;
|
37
|
-
}
|
38
|
-
if (event.extra && event.extra.__sentry_dist) {
|
39
|
-
event.dist = `${event.extra.__sentry_dist}`;
|
40
|
-
}
|
41
51
|
return event;
|
42
52
|
});
|
43
53
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../src/integrations/release.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,iEAAiE;AACjE,MAAM,OAAO,OAAO;IAApB;QACI;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../src/integrations/release.ts"],"names":[],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OAAO,KAAK,CAAC;aAChB;YACD,IAAI;gBACA,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,kBAAkB,EAAE,CAInD,CAAC;gBACF,IAAI,OAAO,EAAE;oBACT,KAAK,CAAC,OAAO,GAAG,GAAG,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;oBACpE,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;iBACnC;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,yCAAyC;aAC5C;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC;;AAjDD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { EventProcessor, Integration } from "@sentry/types";
|
2
|
+
/** Default SdkInfo instrumentation */
|
3
|
+
export declare class SdkInfo implements Integration {
|
4
|
+
/**
|
5
|
+
* @inheritDoc
|
6
|
+
*/
|
7
|
+
static id: string;
|
8
|
+
/**
|
9
|
+
* @inheritDoc
|
10
|
+
*/
|
11
|
+
name: string;
|
12
|
+
private _nativeSdkInfo;
|
13
|
+
/**
|
14
|
+
* @inheritDoc
|
15
|
+
*/
|
16
|
+
setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void;
|
17
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { logger } from "@sentry/utils";
|
2
|
+
import { SDK_NAME, SDK_VERSION } from "../version";
|
3
|
+
import { NSSentry } from '../nssentry';
|
4
|
+
/** Default SdkInfo instrumentation */
|
5
|
+
export class SdkInfo {
|
6
|
+
constructor() {
|
7
|
+
/**
|
8
|
+
* @inheritDoc
|
9
|
+
*/
|
10
|
+
this.name = SdkInfo.id;
|
11
|
+
this._nativeSdkInfo = null;
|
12
|
+
}
|
13
|
+
/**
|
14
|
+
* @inheritDoc
|
15
|
+
*/
|
16
|
+
setupOnce(addGlobalEventProcessor) {
|
17
|
+
addGlobalEventProcessor(async (event) => {
|
18
|
+
var _a;
|
19
|
+
// The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.
|
20
|
+
// this._nativeSdkInfo should be defined a following time so this call won't always be awaited.
|
21
|
+
if (global.isIOS && this._nativeSdkInfo === null) {
|
22
|
+
try {
|
23
|
+
this._nativeSdkInfo = await NSSentry.fetchNativeSdkInfo();
|
24
|
+
}
|
25
|
+
catch (e) {
|
26
|
+
// If this fails, go ahead as usual as we would rather have the event be sent with a package missing.
|
27
|
+
logger.warn("[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:");
|
28
|
+
logger.warn(e);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
event.platform = event.platform || "javascript";
|
32
|
+
event.sdk = Object.assign(Object.assign({}, ((_a = event.sdk) !== null && _a !== void 0 ? _a : {})), { name: SDK_NAME, packages: [
|
33
|
+
...((event.sdk && event.sdk.packages) || []),
|
34
|
+
...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),
|
35
|
+
{
|
36
|
+
name: "npm:@nativescript-community/sentry",
|
37
|
+
version: SDK_VERSION,
|
38
|
+
},
|
39
|
+
], version: SDK_VERSION });
|
40
|
+
return event;
|
41
|
+
});
|
42
|
+
}
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* @inheritDoc
|
46
|
+
*/
|
47
|
+
SdkInfo.id = "SdkInfo";
|
48
|
+
//# sourceMappingURL=sdkinfo.js.map
|