@dreamhorizonorg/pulse-react-native 0.0.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/LICENSE +20 -0
- package/PulseReactNativeOtel.podspec +21 -0
- package/README.md +900 -0
- package/android/build.gradle +97 -0
- package/android/gradle.properties +5 -0
- package/android/proguard-rules.pro +108 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/pulsereactnativeotel/PulseOtelConstants.kt +20 -0
- package/android/src/main/java/com/pulsereactnativeotel/PulseReactNativeOtelLogger.kt +73 -0
- package/android/src/main/java/com/pulsereactnativeotel/PulseReactNativeOtelModule.kt +85 -0
- package/android/src/main/java/com/pulsereactnativeotel/PulseReactNativeOtelPackage.kt +33 -0
- package/android/src/main/java/com/pulsereactnativeotel/PulseReactNativeOtelTracer.kt +127 -0
- package/ios/PulseReactNativeOtel.h +5 -0
- package/ios/PulseReactNativeOtel.mm +100 -0
- package/lib/module/NativePulseReactNativeOtel.js +5 -0
- package/lib/module/NativePulseReactNativeOtel.js.map +1 -0
- package/lib/module/config.js +55 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/errorBoundary.js +62 -0
- package/lib/module/errorBoundary.js.map +1 -0
- package/lib/module/errorHandler.js +112 -0
- package/lib/module/errorHandler.js.map +1 -0
- package/lib/module/events.js +14 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/global.d.js +4 -0
- package/lib/module/global.d.js.map +1 -0
- package/lib/module/globalAttributes.js +13 -0
- package/lib/module/globalAttributes.js.map +1 -0
- package/lib/module/index.js +27 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/initialization.js +18 -0
- package/lib/module/initialization.js.map +1 -0
- package/lib/module/network-interceptor/initialization.js +25 -0
- package/lib/module/network-interceptor/initialization.js.map +1 -0
- package/lib/module/network-interceptor/network.interface.js +2 -0
- package/lib/module/network-interceptor/network.interface.js.map +1 -0
- package/lib/module/network-interceptor/request-tracker-fetch.js +72 -0
- package/lib/module/network-interceptor/request-tracker-fetch.js.map +1 -0
- package/lib/module/network-interceptor/request-tracker-xhr.js +75 -0
- package/lib/module/network-interceptor/request-tracker-xhr.js.map +1 -0
- package/lib/module/network-interceptor/request-tracker.js +25 -0
- package/lib/module/network-interceptor/request-tracker.js.map +1 -0
- package/lib/module/network-interceptor/span-helpers.js +62 -0
- package/lib/module/network-interceptor/span-helpers.js.map +1 -0
- package/lib/module/network-interceptor/url-helper.js +127 -0
- package/lib/module/network-interceptor/url-helper.js.map +1 -0
- package/lib/module/pulse.interface.js +2 -0
- package/lib/module/pulse.interface.js.map +1 -0
- package/lib/module/reactNavigation.js +100 -0
- package/lib/module/reactNavigation.js.map +1 -0
- package/lib/module/trace.js +75 -0
- package/lib/module/trace.js.map +1 -0
- package/lib/module/user.js +23 -0
- package/lib/module/user.js.map +1 -0
- package/lib/module/utility.js +34 -0
- package/lib/module/utility.js.map +1 -0
- package/lib/typescript/src/NativePulseReactNativeOtel.d.ts +31 -0
- package/lib/typescript/src/NativePulseReactNativeOtel.d.ts.map +1 -0
- package/lib/typescript/src/config.d.ts +14 -0
- package/lib/typescript/src/config.d.ts.map +1 -0
- package/lib/typescript/src/errorBoundary.d.ts +26 -0
- package/lib/typescript/src/errorBoundary.d.ts.map +1 -0
- package/lib/typescript/src/errorHandler.d.ts +4 -0
- package/lib/typescript/src/errorHandler.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +3 -0
- package/lib/typescript/src/events.d.ts.map +1 -0
- package/lib/typescript/src/globalAttributes.d.ts +4 -0
- package/lib/typescript/src/globalAttributes.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +30 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/initialization.d.ts +3 -0
- package/lib/typescript/src/initialization.d.ts.map +1 -0
- package/lib/typescript/src/network-interceptor/initialization.d.ts +3 -0
- package/lib/typescript/src/network-interceptor/initialization.d.ts.map +1 -0
- package/lib/typescript/src/network-interceptor/network.interface.d.ts +29 -0
- package/lib/typescript/src/network-interceptor/network.interface.d.ts.map +1 -0
- package/lib/typescript/src/network-interceptor/request-tracker-fetch.d.ts +7 -0
- package/lib/typescript/src/network-interceptor/request-tracker-fetch.d.ts.map +1 -0
- package/lib/typescript/src/network-interceptor/request-tracker-xhr.d.ts +4 -0
- package/lib/typescript/src/network-interceptor/request-tracker-xhr.d.ts.map +1 -0
- package/lib/typescript/src/network-interceptor/request-tracker.d.ts +9 -0
- package/lib/typescript/src/network-interceptor/request-tracker.d.ts.map +1 -0
- package/lib/typescript/src/network-interceptor/span-helpers.d.ts +7 -0
- package/lib/typescript/src/network-interceptor/span-helpers.d.ts.map +1 -0
- package/lib/typescript/src/network-interceptor/url-helper.d.ts +38 -0
- package/lib/typescript/src/network-interceptor/url-helper.d.ts.map +1 -0
- package/lib/typescript/src/pulse.interface.d.ts +8 -0
- package/lib/typescript/src/pulse.interface.d.ts.map +1 -0
- package/lib/typescript/src/reactNavigation.d.ts +10 -0
- package/lib/typescript/src/reactNavigation.d.ts.map +1 -0
- package/lib/typescript/src/trace.d.ts +19 -0
- package/lib/typescript/src/trace.d.ts.map +1 -0
- package/lib/typescript/src/user.d.ts +5 -0
- package/lib/typescript/src/user.d.ts.map +1 -0
- package/lib/typescript/src/utility.d.ts +8 -0
- package/lib/typescript/src/utility.d.ts.map +1 -0
- package/package.json +165 -0
- package/src/NativePulseReactNativeOtel.ts +57 -0
- package/src/config.ts +75 -0
- package/src/errorBoundary.tsx +92 -0
- package/src/errorHandler.ts +169 -0
- package/src/events.ts +15 -0
- package/src/global.d.ts +9 -0
- package/src/globalAttributes.ts +16 -0
- package/src/index.tsx +35 -0
- package/src/initialization.ts +18 -0
- package/src/network-interceptor/initialization.ts +28 -0
- package/src/network-interceptor/network.interface.ts +36 -0
- package/src/network-interceptor/request-tracker-fetch.ts +96 -0
- package/src/network-interceptor/request-tracker-xhr.ts +108 -0
- package/src/network-interceptor/request-tracker.ts +31 -0
- package/src/network-interceptor/span-helpers.ts +84 -0
- package/src/network-interceptor/url-helper.ts +155 -0
- package/src/pulse.interface.ts +14 -0
- package/src/reactNavigation.tsx +146 -0
- package/src/trace.ts +108 -0
- package/src/user.ts +24 -0
- package/src/utility.ts +36 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { Pulse, SpanStatusCode } from "../index.js";
|
|
5
|
+
import { extractHttpAttributes } from "./url-helper.js";
|
|
6
|
+
export function setNetworkSpanAttributes(span, startContext, endContext) {
|
|
7
|
+
const method = startContext.method.toUpperCase();
|
|
8
|
+
let attributes = {
|
|
9
|
+
'http.method': method,
|
|
10
|
+
'http.url': startContext.url,
|
|
11
|
+
'pulse.type': `network.${endContext.status ?? 0}`,
|
|
12
|
+
'http.request.type': startContext.type,
|
|
13
|
+
'platform': Platform.OS
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// We had implemented our own URL parsing helper to avoid errors on RN < 0.80. Since this is not supported by React Native.
|
|
17
|
+
// Check here: https://github.com/facebook/react-native/blob/v0.79.0/packages/react-native/Libraries/Blob/URL.js
|
|
18
|
+
const urlAttributes = extractHttpAttributes(startContext.url);
|
|
19
|
+
attributes = {
|
|
20
|
+
...attributes,
|
|
21
|
+
...urlAttributes
|
|
22
|
+
};
|
|
23
|
+
if (endContext.status) {
|
|
24
|
+
attributes['http.status_code'] = endContext.status;
|
|
25
|
+
}
|
|
26
|
+
if (endContext.state === 'error' && endContext.error) {
|
|
27
|
+
attributes.error = true;
|
|
28
|
+
attributes['error.message'] = endContext.error.message || String(endContext.error);
|
|
29
|
+
if (endContext.error.stack) {
|
|
30
|
+
attributes['error.stack'] = endContext.error.stack;
|
|
31
|
+
}
|
|
32
|
+
span.recordException(endContext.error, attributes);
|
|
33
|
+
}
|
|
34
|
+
span.setAttributes(attributes);
|
|
35
|
+
return attributes;
|
|
36
|
+
}
|
|
37
|
+
export function createNetworkSpan(startContext, interceptorType) {
|
|
38
|
+
const method = startContext.method.toUpperCase();
|
|
39
|
+
const spanName = `HTTP ${method}`;
|
|
40
|
+
const span = Pulse.startSpan(spanName, {
|
|
41
|
+
attributes: {
|
|
42
|
+
'http.method': method,
|
|
43
|
+
'http.url': startContext.url,
|
|
44
|
+
'pulse.type': 'network',
|
|
45
|
+
'http.request.type': interceptorType
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return span;
|
|
49
|
+
}
|
|
50
|
+
export function completeNetworkSpan(span, startContext, endContext, isError) {
|
|
51
|
+
try {
|
|
52
|
+
const attributes = setNetworkSpanAttributes(span, startContext, endContext);
|
|
53
|
+
console.log('[Pulse] Network span completed', {
|
|
54
|
+
spanId: span.spanId,
|
|
55
|
+
spanAttributes: attributes
|
|
56
|
+
});
|
|
57
|
+
} catch (e) {
|
|
58
|
+
console.error('[Pulse] Failed to set span attributes:', e);
|
|
59
|
+
}
|
|
60
|
+
span.end(isError ? SpanStatusCode.ERROR : SpanStatusCode.UNSET);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=span-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","Pulse","SpanStatusCode","extractHttpAttributes","setNetworkSpanAttributes","span","startContext","endContext","method","toUpperCase","attributes","url","status","type","OS","urlAttributes","state","error","message","String","stack","recordException","setAttributes","createNetworkSpan","interceptorType","spanName","startSpan","completeNetworkSpan","isError","console","log","spanId","spanAttributes","e","end","ERROR","UNSET"],"sourceRoot":"../../../src","sources":["network-interceptor/span-helpers.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAMvC,SAASC,KAAK,EAAEC,cAAc,QAAQ,aAAU;AAEhD,SAASC,qBAAqB,QAAQ,iBAAc;AAEpD,OAAO,SAASC,wBAAwBA,CACtCC,IAAU,EACVC,YAAiC,EACjCC,UAA6B,EACZ;EACjB,MAAMC,MAAM,GAAGF,YAAY,CAACE,MAAM,CAACC,WAAW,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,EAAE;IACrCf,UAAU,EAAE;MACV,aAAa,EAAEF,MAAM;MACrB,UAAU,EAAEF,YAAY,CAACK,GAAG;MAC5B,YAAY,EAAE,SAAS;MACvB,mBAAmB,EAAEa;IACvB;EACF,CAAC,CAAC;EAEF,OAAOnB,IAAI;AACb;AAEA,OAAO,SAASsB,mBAAmBA,CACjCtB,IAAU,EACVC,YAAiC,EACjCC,UAA6B,EAC7BqB,OAAgB,EACV;EACN,IAAI;IACF,MAAMlB,UAAU,GAAGN,wBAAwB,CAACC,IAAI,EAAEC,YAAY,EAAEC,UAAU,CAAC;IAC3EsB,OAAO,CAACC,GAAG,CAAC,gCAAgC,EAAE;MAC5CC,MAAM,EAAE1B,IAAI,CAAC0B,MAAM;MACnBC,cAAc,EAAEtB;IAClB,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOuB,CAAC,EAAE;IACVJ,OAAO,CAACZ,KAAK,CAAC,wCAAwC,EAAEgB,CAAC,CAAC;EAC5D;EAEA5B,IAAI,CAAC6B,GAAG,CAACN,OAAO,GAAG1B,cAAc,CAACiC,KAAK,GAAGjC,cAAc,CAACkC,KAAK,CAAC;AACjE","ignoreList":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* URL parsing helper for React Native
|
|
5
|
+
* Provides consistent URL parsing across all RN versions
|
|
6
|
+
*
|
|
7
|
+
* React Native < 0.80 throws errors for URL properties like hostname, protocol, etc.
|
|
8
|
+
* This helper uses the same regex approach as RN 0.80+ to ensure compatibility.
|
|
9
|
+
*
|
|
10
|
+
* Based on: https://github.com/facebook/react-native/blob/v0.80.0/packages/react-native/Libraries/Blob/URL.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Safely extract a regex match group
|
|
15
|
+
* Returns empty string if match fails or group is undefined
|
|
16
|
+
*/
|
|
17
|
+
function safeMatch(text, regex, groupIndex = 1) {
|
|
18
|
+
try {
|
|
19
|
+
const match = text.match(regex);
|
|
20
|
+
return match && match[groupIndex] ? match[groupIndex] : '';
|
|
21
|
+
} catch (e) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Parse a URL string into its components
|
|
28
|
+
* Returns null if URL is invalid or cannot be parsed
|
|
29
|
+
*
|
|
30
|
+
* This function is defensive and will return empty strings for any component
|
|
31
|
+
* that cannot be extracted, rather than throwing errors.
|
|
32
|
+
*/
|
|
33
|
+
export function parseUrl(url) {
|
|
34
|
+
// Validate input
|
|
35
|
+
if (!url || typeof url !== 'string' || url.trim().length === 0) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Ensure URL has a protocol (required for proper parsing)
|
|
40
|
+
if (!url.match(/^[a-zA-Z][a-zA-Z\d+\-.]*:/)) {
|
|
41
|
+
// Not a valid absolute URL
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
// Protocol - e.g., "https:"
|
|
46
|
+
const protocol = safeMatch(url, /^([a-zA-Z][a-zA-Z\d+\-.]*):/);
|
|
47
|
+
const protocolWithColon = protocol ? `${protocol}:` : '';
|
|
48
|
+
|
|
49
|
+
// Hostname - e.g., "example.com"
|
|
50
|
+
const hostname = safeMatch(url, /^https?:\/\/(?:[^@]+@)?([^:/?#]+)/);
|
|
51
|
+
|
|
52
|
+
// Port - e.g., "8080"
|
|
53
|
+
const port = safeMatch(url, /:(\d+)(?=[/?#]|$)/);
|
|
54
|
+
|
|
55
|
+
// Host (hostname + port if present) - e.g., "example.com:8080"
|
|
56
|
+
const host = hostname ? port ? `${hostname}:${port}` : hostname : '';
|
|
57
|
+
|
|
58
|
+
// Pathname - e.g., "/api/users"
|
|
59
|
+
const pathMatch = url.match(/https?:\/\/[^/]+(\/[^?#]*)?/);
|
|
60
|
+
const pathname = pathMatch && pathMatch[1] ? pathMatch[1] : '/';
|
|
61
|
+
|
|
62
|
+
// Search - e.g., "?id=123"
|
|
63
|
+
const searchContent = safeMatch(url, /\?([^#]*)/);
|
|
64
|
+
const search = searchContent ? `?${searchContent}` : '';
|
|
65
|
+
|
|
66
|
+
// Hash - e.g., "#section"
|
|
67
|
+
const hashContent = safeMatch(url, /#([^/]*)/);
|
|
68
|
+
const hash = hashContent ? `#${hashContent}` : '';
|
|
69
|
+
return {
|
|
70
|
+
protocol: protocolWithColon,
|
|
71
|
+
hostname: hostname,
|
|
72
|
+
host: host,
|
|
73
|
+
port: port,
|
|
74
|
+
pathname: pathname,
|
|
75
|
+
search: search,
|
|
76
|
+
hash: hash,
|
|
77
|
+
href: url
|
|
78
|
+
};
|
|
79
|
+
} catch (e) {
|
|
80
|
+
// Any unexpected error during parsing - return null
|
|
81
|
+
console.warn('[Pulse] URL parsing failed:', e);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Extract HTTP attributes from a URL string for OpenTelemetry span attributes
|
|
88
|
+
*/
|
|
89
|
+
export function extractHttpAttributes(url) {
|
|
90
|
+
try {
|
|
91
|
+
const parsed = parseUrl(url);
|
|
92
|
+
if (!parsed) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
const attributes = {};
|
|
96
|
+
|
|
97
|
+
// http.scheme - protocol without colon (e.g., "https")
|
|
98
|
+
if (parsed.protocol && parsed.protocol.length > 0) {
|
|
99
|
+
attributes['http.scheme'] = parsed.protocol.replace(':', '');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// http.host and net.peer.name - hostname (e.g., "api.example.com")
|
|
103
|
+
if (parsed.hostname && parsed.hostname.length > 0) {
|
|
104
|
+
attributes['http.host'] = parsed.hostname;
|
|
105
|
+
attributes['net.peer.name'] = parsed.hostname;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// http.target - pathname + search (e.g., "/api/users?id=123")
|
|
109
|
+
if (parsed.pathname && parsed.pathname.length > 0) {
|
|
110
|
+
attributes['http.target'] = parsed.pathname + parsed.search;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// net.peer.port - port number (e.g., 8080)
|
|
114
|
+
if (parsed.port && parsed.port.length > 0) {
|
|
115
|
+
const portNum = parseInt(parsed.port, 10);
|
|
116
|
+
if (!isNaN(portNum) && portNum > 0 && portNum <= 65535) {
|
|
117
|
+
attributes['net.peer.port'] = portNum;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return attributes;
|
|
121
|
+
} catch (e) {
|
|
122
|
+
// Absolutely ensure this function never throws
|
|
123
|
+
console.warn('[Pulse] Failed to extract HTTP attributes from URL:', e);
|
|
124
|
+
return {};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=url-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["safeMatch","text","regex","groupIndex","match","e","parseUrl","url","trim","length","protocol","protocolWithColon","hostname","port","host","pathMatch","pathname","searchContent","search","hashContent","hash","href","console","warn","extractHttpAttributes","parsed","attributes","replace","portNum","parseInt","isNaN"],"sourceRoot":"../../../src","sources":["network-interceptor/url-helper.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA,SAASA,SAASA,CAChBC,IAAY,EACZC,KAAa,EACbC,UAAkB,GAAG,CAAC,EACd;EACR,IAAI;IACF,MAAMC,KAAK,GAAGH,IAAI,CAACG,KAAK,CAACF,KAAK,CAAC;IAC/B,OAAOE,KAAK,IAAIA,KAAK,CAACD,UAAU,CAAC,GAAGC,KAAK,CAACD,UAAU,CAAC,GAAG,EAAE;EAC5D,CAAC,CAAC,OAAOE,CAAC,EAAE;IACV,OAAO,EAAE;EACX;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAACC,GAAW,EAAoB;EACtD;EACA,IAA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Z,IAAI,EAAE,EAAE,CAAC;MACzC,IAAI,CAACiB,KAAK,CAACF,OAAO,CAAC,IAAIA,OAAO,GAAG,CAAC,IAAIA,OAAO,IAAI,KAAK,EAAE;QACtDF,UAAU,CAAC,eAAe,CAAC,GAAGE,OAAO;MACvC;IACF;IAEA,OAAOF,UAAU;EACnB,CAAC,CAAC,OAAOrB,CAAC,EAAE;IACV;IACAiB,OAAO,CAACC,IAAI,CAAC,qDAAqD,EAAElB,CAAC,CAAC;IACtE,OAAO,CAAC,CAAC;EACX;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["pulse.interface.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Pulse } from "./index.js";
|
|
4
|
+
const NAVIGATION_HISTORY_MAX_SIZE = 200;
|
|
5
|
+
export function createReactNavigationIntegration() {
|
|
6
|
+
let navigationContainer;
|
|
7
|
+
let latestRoute;
|
|
8
|
+
let recentRouteKeys = [];
|
|
9
|
+
let isInitialized = false;
|
|
10
|
+
let span;
|
|
11
|
+
const onNavigationDispatch = () => {
|
|
12
|
+
try {
|
|
13
|
+
span = Pulse.startSpan('Navigated', {
|
|
14
|
+
attributes: {
|
|
15
|
+
'pulse.type': 'screen_load',
|
|
16
|
+
'phase': 'start'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
console.log('[Pulse Navigation] Navigation dispatch span started', span);
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.warn('[Pulse Navigation] Error in onNavigationDispatch:', error);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const onStateChange = () => {
|
|
25
|
+
try {
|
|
26
|
+
if (!navigationContainer) {
|
|
27
|
+
console.warn('[Pulse Navigation] Navigation container not registered');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const currentRoute = navigationContainer.getCurrentRoute();
|
|
31
|
+
if (!currentRoute) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (!span) {
|
|
35
|
+
latestRoute = currentRoute;
|
|
36
|
+
pushRecentRouteKey(currentRoute.key);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const previousRoute = latestRoute;
|
|
40
|
+
if (previousRoute && previousRoute.key === currentRoute.key) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
latestRoute = currentRoute;
|
|
44
|
+
const routeHasBeenSeen = recentRouteKeys.includes(currentRoute.key);
|
|
45
|
+
pushRecentRouteKey(currentRoute.key);
|
|
46
|
+
span?.setAttributes({
|
|
47
|
+
'screen.name': currentRoute.name,
|
|
48
|
+
'last.screen.name': previousRoute?.name || undefined,
|
|
49
|
+
'routeHasBeenSeen': routeHasBeenSeen,
|
|
50
|
+
'routeKey': currentRoute.key
|
|
51
|
+
});
|
|
52
|
+
span?.end();
|
|
53
|
+
console.log('[Pulse Navigation] Navigation dispatch span ended', span);
|
|
54
|
+
span = undefined;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.warn('[Pulse Navigation] Error in onStateChange:', error);
|
|
57
|
+
span = undefined;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const registerNavigationContainer = maybeNavigationContainer => {
|
|
61
|
+
try {
|
|
62
|
+
let container;
|
|
63
|
+
if (typeof maybeNavigationContainer === 'object' && maybeNavigationContainer !== null && 'current' in maybeNavigationContainer) {
|
|
64
|
+
container = maybeNavigationContainer.current;
|
|
65
|
+
} else {
|
|
66
|
+
container = maybeNavigationContainer;
|
|
67
|
+
}
|
|
68
|
+
if (!container) {
|
|
69
|
+
console.warn('[Pulse Navigation] Invalid navigation container ref');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (isInitialized && navigationContainer === container) {
|
|
73
|
+
console.log('[Pulse Navigation] Container already registered');
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
navigationContainer = container;
|
|
77
|
+
navigationContainer.addListener('__unsafe_action__', onNavigationDispatch);
|
|
78
|
+
navigationContainer.addListener('state', onStateChange);
|
|
79
|
+
const currentRoute = navigationContainer.getCurrentRoute();
|
|
80
|
+
if (currentRoute) {
|
|
81
|
+
latestRoute = currentRoute;
|
|
82
|
+
pushRecentRouteKey(currentRoute.key);
|
|
83
|
+
}
|
|
84
|
+
isInitialized = true;
|
|
85
|
+
console.log('[Pulse Navigation] Integration initialized successfully');
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error('[Pulse Navigation] Error registering container:', error);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const pushRecentRouteKey = key => {
|
|
91
|
+
recentRouteKeys.push(key);
|
|
92
|
+
if (recentRouteKeys.length > NAVIGATION_HISTORY_MAX_SIZE) {
|
|
93
|
+
recentRouteKeys = recentRouteKeys.slice(recentRouteKeys.length - NAVIGATION_HISTORY_MAX_SIZE);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
registerNavigationContainer
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=reactNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Pulse","NAVIGATION_HISTORY_MAX_SIZE","createReactNavigationIntegration","navigationContainer","latestRoute","recentRouteKeys","isInitialized","span","onNavigationDispatch","startSpan","attributes","console","log","error","warn","onStateChange","currentRoute","getCurrentRoute","pushRecentRouteKey","key","previousRoute","routeHasBeenSeen","includes","setAttributes","name","undefined","end","registerNavigationContainer","maybeNavigationContainer","container","current","addListener","push","length","slice"],"sourceRoot":"../../src","sources":["reactNavigation.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAmB,YAAS;AAE1C,MAAMC,2BAA2B,GAAG,GAAG;AAavC,OAAO,SAASC,gCAAgCA,CAAA,EAAG;EACjD,IAAIC,mBAAoD;EACxD,IAAIC,WAAwC;EAC5C,IAAIC,eAAyB,GA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C,iDAAiD,EAAEA,KAAK,CAAC;IACzE;EACF,CAAC;EAED,MAAMK,kBAAkB,GAAIC,GAAW,IAAW;IAChDd,eAAe,CAAC2B,IAAI,CAACb,GAAG,CAAC;IAEzB,IAAId,eAAe,CAAC4B,MAAM,GAAGhC,2BAA2B,EAAE;MACxDI,eAAe,GAAGA,eAAe,CAAC6B,KAAK,CACrC7B,eAAe,CAAC4B,MAAM,GAAGhC,2BAC3B,CAAC;IACH;EACF,CAAC;EAED,OAAO;IACL0B;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import PulseReactNativeOtel from "./NativePulseReactNativeOtel.js";
|
|
4
|
+
import { isSupportedPlatform } from "./initialization.js";
|
|
5
|
+
import { mergeWithGlobalAttributes } from "./globalAttributes.js";
|
|
6
|
+
import { extractErrorDetails } from "./utility.js";
|
|
7
|
+
export let SpanStatusCode = /*#__PURE__*/function (SpanStatusCode) {
|
|
8
|
+
SpanStatusCode["OK"] = "OK";
|
|
9
|
+
SpanStatusCode["ERROR"] = "ERROR";
|
|
10
|
+
SpanStatusCode["UNSET"] = "UNSET";
|
|
11
|
+
return SpanStatusCode;
|
|
12
|
+
}({});
|
|
13
|
+
export function startSpan(name, options) {
|
|
14
|
+
if (!isSupportedPlatform()) {
|
|
15
|
+
return {
|
|
16
|
+
end: _statusCode => {},
|
|
17
|
+
addEvent: (_eventName, _eventAttributes) => {},
|
|
18
|
+
setAttributes: _attributes => {},
|
|
19
|
+
recordException: (_error, _attributes) => {},
|
|
20
|
+
spanId: undefined
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const mergedAttributes = mergeWithGlobalAttributes(options?.attributes || {});
|
|
24
|
+
const spanId = PulseReactNativeOtel.startSpan(name, mergedAttributes);
|
|
25
|
+
return {
|
|
26
|
+
end: statusCode => {
|
|
27
|
+
return endSpan(spanId, statusCode);
|
|
28
|
+
},
|
|
29
|
+
addEvent: (eventName, eventAttributes) => {
|
|
30
|
+
return addSpanEvent(spanId, eventName, eventAttributes);
|
|
31
|
+
},
|
|
32
|
+
setAttributes: spanAttributes => {
|
|
33
|
+
return setSpanAttributes(spanId, spanAttributes);
|
|
34
|
+
},
|
|
35
|
+
recordException: (error, attributes) => {
|
|
36
|
+
return recordSpanException(error, attributes);
|
|
37
|
+
},
|
|
38
|
+
spanId: spanId
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function trackSpan(name, options, fn) {
|
|
42
|
+
if (!isSupportedPlatform()) {
|
|
43
|
+
return fn();
|
|
44
|
+
}
|
|
45
|
+
const mergedAttributes = mergeWithGlobalAttributes(options?.attributes || {});
|
|
46
|
+
const spanId = PulseReactNativeOtel.startSpan(name, mergedAttributes);
|
|
47
|
+
const result = fn();
|
|
48
|
+
if (result && typeof result.then === 'function') {
|
|
49
|
+
return result.finally(() => {
|
|
50
|
+
endSpan(spanId, SpanStatusCode.UNSET);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
endSpan(spanId, SpanStatusCode.UNSET);
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
function endSpan(spanId, statusCode) {
|
|
57
|
+
PulseReactNativeOtel.endSpan(spanId, statusCode);
|
|
58
|
+
}
|
|
59
|
+
function addSpanEvent(spanId, name, attributes) {
|
|
60
|
+
PulseReactNativeOtel.addSpanEvent(spanId, name, attributes || undefined);
|
|
61
|
+
}
|
|
62
|
+
function setSpanAttributes(spanId, attributes) {
|
|
63
|
+
PulseReactNativeOtel.setSpanAttributes(spanId, attributes || undefined);
|
|
64
|
+
}
|
|
65
|
+
function recordSpanException(error, attributes) {
|
|
66
|
+
const {
|
|
67
|
+
message,
|
|
68
|
+
stackTrace,
|
|
69
|
+
errorType
|
|
70
|
+
} = extractErrorDetails(error);
|
|
71
|
+
const observedTimeMs = Date.now();
|
|
72
|
+
const mergedAttributes = mergeWithGlobalAttributes(attributes || {});
|
|
73
|
+
PulseReactNativeOtel.reportException(message, observedTimeMs, stackTrace || '', false, errorType, mergedAttributes);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PulseReactNativeOtel","isSupportedPlatform","mergeWithGlobalAttributes","extractErrorDetails","SpanStatusCode","startSpan","name","options","end","_statusCode","addEvent","_eventName","_eventAttributes","setAttributes","_attributes","recordException","_error","spanId","undefined","mergedAttributes","attributes","statusCode","endSpan","eventName","eventAttributes","addSpanEvent","spanAttributes","setSpanAttributes","error","recordSpanException","trackSpan","fn","result","then","finally","UNSET","message","stackTrace","errorType","observedTimeMs","Date","now","reportException"],"sourceRoot":"../../src","sources":["trace.ts"],"mappings":";;AAAA,OAAOA,oBAAoB,MAAM,iCAA8B;AAC/D,SAASC,mBAAmB,QAAQ,qBAAkB;AACtD,SAASC,yBAAyB,QAAQ,uBAAoB;AAC9D,SAASC,mBAAmB,QAAQ,cAAW;AAO/C,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAe1B,OAAO,SAASC,SAASA,CAACC,IAAY,EAAEC,OAAqB,EAAQ;EACnE,IAAI,CAACN,mBAAmB,CAAC,CAAC,EAAE;IAC1B,OAAO;MACLO,GAAG,EAAGC,WAA4B,IAAK,CAAC,CAAC;MACzCC,QAAQ,EAAEA,CAACC,UAAkB,EAAEC,gBAAkC,KAAK,CAAC,CAAC;MACxEC,aAAa,EAAGC,WAA6B,IAAK,CAAC,CAAC;MACpDC,eAAe,EAAEA,CAACC,MAAa,EAAEF,WAA6B,KAAK,CAAC,CAAC;MACrEG,MAAM,EAAEC;IACV,CAAC;EACH;EAEA,MAAMC,gBAAgB,GAAGjB,yBAAyB,CAACK,OAAO,EAAEa,UAAU,IAAI,CAAC,CAAC,CAAC;EAC7E,MAAMH,MAAM,GAAGjB,oBAAoB,CAACK,SAAS,CAACC,I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AAoB,CAACsB,OAAO,CAACL,MAAM,EAAEI,UAAU,CAAC;AAClD;AAEA,SAASI,YAAYA,CACnBR,MAAc,EACdX,IAAY,EACZc,UAA4B,EACtB;EACNpB,oBAAoB,CAACyB,YAAY,CAACR,MAAM,EAAEX,IAAI,EAAEc,UAAU,IAAIF,SAAS,CAAC;AAC1E;AAEA,SAASS,iBAAiBA,CAACV,MAAc,EAAEG,UAA4B,EAAQ;EAC7EpB,oBAAoB,CAAC2B,iBAAiB,CAACV,MAAM,EAAEG,UAAU,IAAIF,SAAS,CAAC;AACzE;AAEA,SAASW,mBAAmBA,CAACD,KAAY,EAAER,UAA4B,EAAQ;EAC7E,MAAM;IAAEgB,OAAO;IAAEC,UAAU;IAAEC;EAAU,CAAC,GAAGnC,mBAAmB,CAACyB,KAAK,CAAC;EACrE,MAAMW,cAAc,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EACjC,MAAMtB,gBAAgB,GAAGjB,yBAAyB,CAACkB,UAAU,IAAI,CAAC,CAAC,CAAC;EACpEpB,oBAAoB,CAAC0C,eAAe,CAClCN,OAAO,EACPG,cAAc,EACdF,UAAU,IAAI,EAAE,EAChB,KAAK,EACLC,SAAS,EACTnB,gBACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import PulseReactNativeOtel from "./NativePulseReactNativeOtel.js";
|
|
4
|
+
import { isSupportedPlatform } from "./initialization.js";
|
|
5
|
+
export function setUserId(id) {
|
|
6
|
+
if (!isSupportedPlatform()) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
PulseReactNativeOtel.setUserId(id);
|
|
10
|
+
}
|
|
11
|
+
export function setUserProperty(name, value) {
|
|
12
|
+
if (!isSupportedPlatform()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
PulseReactNativeOtel.setUserProperty(name, value);
|
|
16
|
+
}
|
|
17
|
+
export function setUserProperties(properties) {
|
|
18
|
+
if (!isSupportedPlatform()) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
PulseReactNativeOtel.setUserProperties(properties);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PulseReactNativeOtel","isSupportedPlatform","setUserId","id","setUserProperty","name","value","setUserProperties","properties"],"sourceRoot":"../../src","sources":["user.ts"],"mappings":";;AAAA,OAAOA,oBAAoB,MAAM,iCAA8B;AAC/D,SAASC,mBAAmB,QAAQ,qBAAkB;AAGtD,OAAO,SAASC,SAASA,CAACC,EAAiB,EAAQ;EACjD,IAAI,CAACF,mBAAmB,CAAC,CAAC,EAAE;IAC1B;EACF;EACAD,oBAAoB,CAACE,SAAS,CAACC,EAAE,CAAC;AACpC;AAEA,OAAO,SAASC,eAAeA,CAACC,IAAY,EAAEC,KAAoB,EAAQ;EACxE,IAAI,CAACL,mBAAmB,CAAC,CAAC,EAAE;IAC1B;EACF;EACAD,oBAAoB,CAACI,eAAe,CAACC,IAAI,EAAEC,KAAK,CAAC;AACnD;AAEA,OAAO,SAASC,iBAAiBA,CAACC,UAA2B,EAAQ;EACnE,IAAI,CAACP,mBAAmB,CAAC,CAAC,EAAE;IAC1B;EACF;EACAD,oBAAoB,CAACO,iBAAiB,CAACC,UAAU,CAAC;AACpD","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function nowMs() {
|
|
4
|
+
const perf = global.performance;
|
|
5
|
+
if (perf && typeof perf.now === 'function') return perf.now();
|
|
6
|
+
return Date.now();
|
|
7
|
+
}
|
|
8
|
+
export function getAbsoluteUrl(url, baseUrl) {
|
|
9
|
+
// if it looks like an absolute url do nothing
|
|
10
|
+
if (url.indexOf('https://') === 0 || url.indexOf('http://') === 0) return url;
|
|
11
|
+
try {
|
|
12
|
+
const absoluteUrl = new URL(url, baseUrl).href;
|
|
13
|
+
|
|
14
|
+
// if a trailing slash has been added inadvertently remove it
|
|
15
|
+
if (!url.endsWith('/') && absoluteUrl.endsWith('/')) {
|
|
16
|
+
return absoluteUrl.slice(0, -1);
|
|
17
|
+
}
|
|
18
|
+
return absoluteUrl;
|
|
19
|
+
} catch {
|
|
20
|
+
// not a valid URL for some reason - simply return it
|
|
21
|
+
return url;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function extractErrorDetails(error) {
|
|
25
|
+
const message = error.message || 'Unknown error';
|
|
26
|
+
const stackTrace = error.stack || '';
|
|
27
|
+
const errorType = error.name || '';
|
|
28
|
+
return {
|
|
29
|
+
message,
|
|
30
|
+
stackTrace,
|
|
31
|
+
errorType
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["nowMs","perf","global","performance","now","Date","getAbsoluteUrl","url","baseUrl","indexOf","absoluteUrl","URL","href","endsWith","slice","extractErrorDetails","error","message","stackTrace","stack","errorType","name"],"sourceRoot":"../../src","sources":["utility.ts"],"mappings":";;AAAA,OAAO,SAASA,KAAKA,CAAA,EAAW;EAC9B,MAAMC,IAAI,GAAGC,MAAM,CAACC,WAAW;EAC/B,IAAIF,IAAI,IAAI,OAAOA,IAAI,CAACG,GAAG,KAAK,UAAU,EAAE,OAAOH,IAAI,CAACG,GAAG,CAAC,CAAC;EAC7D,OAAOC,IAAI,CAACD,GAAG,CAAC,CAAC;AACnB;AAEA,OAAO,SAASE,cAAcA,CAACC,GAAW,EAAEC,OAAgB,EAAU;EACpE;EACA,IAAID,GAAG,CAACE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAIF,GAAG,CAACE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAOF,GAAG;EAE7E,IAAI;IACF,MAAMG,WAAW,GAAG,IAAIC,GAAG,CAACJ,GAAG,EAAEC,OAAO,CAAC,CAACI,IAAI;;IAE9C;IACA,IAAI,CAACL,GAAG,CAACM,QAAQ,CAAC,GAAG,CAAC,IAAIH,WAAW,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE;MACnD,OAAOH,WAAW,CAACI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjC;IAEA,OAAOJ,WAAW;EACpB,CAAC,CAAC,MAAM;IACN;IACA,OAAOH,GAAG;EACZ;AACF;AAEA,OAAO,SAASQ,mBAAmBA,CAACC,KAAY,EAI9C;EACA,MAAMC,OAAO,GAAGD,KAAK,CAACC,OAAO,IAAI,eAAe;EAChD,MAAMC,UAAU,GAAGF,KAAK,CAACG,KAAK,IAAI,EAAE;EACpC,MAAMC,SAAS,GAAGJ,KAAK,CAACK,IAAI,IAAI,EAAE;EAElC,OAAO;IAAEJ,OAAO;IAAEC,UAAU;IAAEE;EAAU,CAAC;AAC3C","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
/** Check if native SDK is initialized */
|
|
4
|
+
isInitialized(): boolean;
|
|
5
|
+
/** Track a custom event with properties. */
|
|
6
|
+
trackEvent(event: string, observedTimeMs: number, properties?: Object): boolean;
|
|
7
|
+
/** Report a JS exception (message + stack, with fatal flag). */
|
|
8
|
+
/** This function was made synchronous to attach current span context to the error event. Since span is created synchronously on mqt_js thread.*/
|
|
9
|
+
reportException(errorMessage: string, observedTimeMs: number, stackTrace: string, isFatal: boolean, errorType: string, attributes?: Object): boolean;
|
|
10
|
+
/** Start an active span; returns spanId (simplified). */
|
|
11
|
+
startSpan(name: string, attributes?: Object): string;
|
|
12
|
+
/** End a span with optional status code. */
|
|
13
|
+
endSpan(spanId: string, statusCode?: string): boolean;
|
|
14
|
+
/** Add an event to a span. */
|
|
15
|
+
addSpanEvent(spanId: string, name: string, attributes?: Object): boolean;
|
|
16
|
+
/** Batch set attributes on a span. */
|
|
17
|
+
setSpanAttributes(spanId: string, attributes?: Object): boolean;
|
|
18
|
+
/** Record an exception on a span. */
|
|
19
|
+
recordSpanException(spanId: string, errorMessage: string, stackTrace?: string): boolean;
|
|
20
|
+
/** Set user id for the session. Setting null will reset the id */
|
|
21
|
+
setUserId(id: string | null): void;
|
|
22
|
+
/** Set a single user property for this session */
|
|
23
|
+
setUserProperty(name: string, value: string | null): void;
|
|
24
|
+
/** Set multiple user properties for this session */
|
|
25
|
+
setUserProperties(properties: Object): void;
|
|
26
|
+
/** Trigger ANR test (freezes main thread for 6 seconds) */
|
|
27
|
+
triggerAnr(): void;
|
|
28
|
+
}
|
|
29
|
+
declare const _default: Spec;
|
|
30
|
+
export default _default;
|
|
31
|
+
//# sourceMappingURL=NativePulseReactNativeOtel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativePulseReactNativeOtel.d.ts","sourceRoot":"","sources":["../../../src/NativePulseReactNativeOtel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,yCAAyC;IACzC,aAAa,IAAI,OAAO,CAAC;IAEzB,4CAA4C;IAC5C,UAAU,CACR,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC;IAEX,gEAAgE;IAChE,iJAAiJ;IACjJ,eAAe,CACb,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC;IAEX,yDAAyD;IACzD,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAErD,4CAA4C;IAC5C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtD,8BAA8B;IAC9B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzE,sCAAsC;IACtC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEhE,qCAAqC;IACrC,mBAAmB,CACjB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC;IAEX,kEAAkE;IAClE,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAEnC,kDAAkD;IAClD,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1D,oDAAoD;IACpD,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5C,2DAA2D;IAC3D,UAAU,IAAI,IAAI,CAAC;CACpB;;AAED,wBAA8E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNavigationIntegration } from './reactNavigation';
|
|
2
|
+
export type PulseConfig = {
|
|
3
|
+
autoDetectExceptions?: boolean;
|
|
4
|
+
autoDetectNavigation?: boolean;
|
|
5
|
+
autoDetectNetwork?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type PulseStartOptions = {
|
|
8
|
+
autoDetectExceptions?: boolean;
|
|
9
|
+
autoDetectNavigation?: boolean;
|
|
10
|
+
autoDetectNetwork?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function start(options?: PulseStartOptions): void;
|
|
13
|
+
export declare function createNavigationIntegrationWithConfig(): ReactNavigationIntegration;
|
|
14
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,WAAW,GAAG;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAsBF,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAYvD;AAED,wBAAgB,qCAAqC,IAAI,0BAA0B,CAoBlF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const UNKNOWN_COMPONENT = "unknown";
|
|
3
|
+
export type FallbackRender = (errorData: {
|
|
4
|
+
error: unknown;
|
|
5
|
+
componentStack: string;
|
|
6
|
+
}) => React.ReactElement;
|
|
7
|
+
export type ErrorBoundaryProps = {
|
|
8
|
+
children?: React.ReactNode | (() => React.ReactNode);
|
|
9
|
+
fallback?: React.ReactElement | FallbackRender | undefined;
|
|
10
|
+
onError?: ((error: unknown, componentStack: string) => void) | undefined;
|
|
11
|
+
};
|
|
12
|
+
type ErrorBoundaryState = {
|
|
13
|
+
componentStack: null;
|
|
14
|
+
error: null;
|
|
15
|
+
} | {
|
|
16
|
+
componentStack: string;
|
|
17
|
+
error: unknown;
|
|
18
|
+
};
|
|
19
|
+
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
20
|
+
state: ErrorBoundaryState;
|
|
21
|
+
componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void;
|
|
22
|
+
render(): React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare function withErrorBoundary<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>, errorBoundaryOptions: ErrorBoundaryProps): React.FC<P>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=errorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorBoundary.d.ts","sourceRoot":"","sources":["../../../src/errorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAG3C,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB,KAAK,KAAK,CAAC,YAAY,CAAC;AAEzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,cAAc,GAAG,SAAS,CAAC;IAC3D,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC1E,CAAC;AAEF,KAAK,kBAAkB,GACnB;IACE,cAAc,EAAE,IAAI,CAAC;IACrB,KAAK,EAAE,IAAI,CAAC;CACb,GACD;IACE,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAON,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACjF,KAAK,EAAE,kBAAkB,CAAiB;IAE1C,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAiBnE,MAAM,IAAI,KAAK,CAAC,SAAS;CAsBjC;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7D,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACxC,oBAAoB,EAAE,kBAAkB,GACvC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAYb"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PulseAttributes } from './pulse.interface';
|
|
2
|
+
export declare function reportException(error: Error | string, isFatal?: boolean, attributes?: PulseAttributes): void;
|
|
3
|
+
export declare function setupErrorHandler(enableErrorHandler: boolean): void;
|
|
4
|
+
//# sourceMappingURL=errorHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../../src/errorHandler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA6DzD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,GAAG,MAAM,EACrB,OAAO,GAAE,OAAe,EACxB,UAAU,CAAC,EAAE,eAAe,GAC3B,IAAI,CA2BN;AAkED,wBAAgB,iBAAiB,CAAC,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAMnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,IAAI,CAS5E"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PulseAttributes, PulseAttributeValue } from './pulse.interface';
|
|
2
|
+
export declare function setGlobalAttribute(key: string, value: PulseAttributeValue): void;
|
|
3
|
+
export declare function mergeWithGlobalAttributes<T extends PulseAttributes>(attributes?: T): T & PulseAttributes;
|
|
4
|
+
//# sourceMappingURL=globalAttributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalAttributes.d.ts","sourceRoot":"","sources":["../../../src/globalAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAI9E,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,mBAAmB,GACzB,IAAI,CAEN;AAED,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,eAAe,EACjE,UAAU,CAAC,EAAE,CAAC,GACb,CAAC,GAAG,eAAe,CAErB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { startSpan, trackSpan } from './trace';
|
|
2
|
+
import { reportException } from './errorHandler';
|
|
3
|
+
import { trackEvent } from './events';
|
|
4
|
+
import { start, createNavigationIntegrationWithConfig } from './config';
|
|
5
|
+
import { isInitialized } from './initialization';
|
|
6
|
+
import { setGlobalAttribute } from './globalAttributes';
|
|
7
|
+
import { setUserId, setUserProperty, setUserProperties } from './user';
|
|
8
|
+
import { ErrorBoundary, withErrorBoundary } from './errorBoundary';
|
|
9
|
+
export type { Span } from './trace';
|
|
10
|
+
export type { PulseConfig, PulseStartOptions } from './config';
|
|
11
|
+
export type { PulseAttributes, PulseAttributeValue } from './pulse.interface';
|
|
12
|
+
export type { ReactNavigationIntegration, NavigationRoute, } from './reactNavigation';
|
|
13
|
+
export type { ErrorBoundaryProps, FallbackRender } from './errorBoundary';
|
|
14
|
+
export { SpanStatusCode } from './trace';
|
|
15
|
+
export declare const Pulse: {
|
|
16
|
+
start: typeof start;
|
|
17
|
+
isInitialized: typeof isInitialized;
|
|
18
|
+
createNavigationIntegration: typeof createNavigationIntegrationWithConfig;
|
|
19
|
+
trackEvent: typeof trackEvent;
|
|
20
|
+
reportException: typeof reportException;
|
|
21
|
+
trackSpan: typeof trackSpan;
|
|
22
|
+
startSpan: typeof startSpan;
|
|
23
|
+
setGlobalAttribute: typeof setGlobalAttribute;
|
|
24
|
+
setUserId: typeof setUserId;
|
|
25
|
+
setUserProperty: typeof setUserProperty;
|
|
26
|
+
setUserProperties: typeof setUserProperties;
|
|
27
|
+
ErrorBoundary: typeof ErrorBoundary;
|
|
28
|
+
withErrorBoundary: typeof withErrorBoundary;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,YAAY,EACV,0BAA0B,EAC1B,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;CAcjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialization.d.ts","sourceRoot":"","sources":["../../../src/initialization.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,IAAI,OAAO,CAQvC;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C"}
|