@dynatrace/react-native-plugin 2.327.2 → 2.329.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/README.md +414 -163
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceConfigurationModule.kt +48 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +41 -8
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.kt +3 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRuntimeConfigurationStore.kt +14 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +103 -47
- package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +12 -4
- package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +15 -5
- package/files/default.config.js +7 -0
- package/files/plugin-runtime.gradle +7 -17
- package/files/plugin.gradle +1 -1
- package/instrumentation/DynatraceInstrumentation.js +1 -1
- package/instrumentation/libs/react-navigation/ReactNavigation.js +53 -18
- package/ios/ConfigurationSubscriber.h +15 -0
- package/ios/DynatraceRNBridge.h +4 -0
- package/ios/DynatraceRNBridge.mm +125 -29
- package/lib/core/Dynatrace.js +8 -11
- package/lib/core/configuration/ConfigurationHandler.js +3 -0
- package/lib/next/Dynatrace.js +14 -32
- package/lib/next/DynatraceEventBus.js +35 -0
- package/lib/next/appstart/AppStartObserver.js +2 -3
- package/lib/next/configuration/INativeRuntimeConfiguration.js +7 -0
- package/lib/next/configuration/RuntimeConfigurationObserver.js +40 -0
- package/lib/next/events/EventBuilderUtil.js +7 -0
- package/lib/next/events/EventData.js +28 -0
- package/lib/next/events/EventPipeline.js +5 -11
- package/lib/next/events/ExceptionEventData.js +26 -0
- package/lib/next/events/{HttpRequestEventBuilder.js → HttpRequestEventData.js} +28 -52
- package/lib/next/events/SessionPropertyEventData.js +22 -0
- package/lib/next/events/interface/IBaseEvent.js +2 -0
- package/lib/next/events/interface/IEventData.js +2 -0
- package/lib/next/events/interface/IExceptionEventData.js +2 -0
- package/lib/next/events/interface/IHttpRequestEventData.js +2 -0
- package/lib/next/events/interface/ISessionPropertyEventData.js +2 -0
- package/lib/next/events/modifier/BaseDataEventModifier.js +1 -3
- package/lib/next/events/modifier/EventModifierUtil.js +34 -41
- package/lib/next/events/modifier/ModifyEventValidation.js +118 -26
- package/lib/next/events/modifier/SendEventValidation.js +53 -22
- package/lib/next/events/modifier/StringLengthEventModifier.js +53 -0
- package/lib/next/events/spec/EventSpecContstants.js +9 -2
- package/package.json +8 -3
- package/public.js +9 -3
- package/react-native-dynatrace.podspec +1 -1
- package/scripts/Config.js +6 -2
- package/scripts/LineOffsetAnalyze.js +1 -4
- package/scripts/core/LineOffsetAnalyzeCall.js +39 -46
- package/src/lib/core/interface/NativeDynatraceBridge.ts +6 -2
- package/types.d.ts +388 -158
- package/lib/next/events/ViewInfoCreator.js +0 -27
- package/lib/next/events/modifier/EventLimitation.js +0 -69
- /package/lib/next/events/{IHttpRequestEventBuilder.js → interface/EventProperty.js} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createViewInfo = void 0;
|
|
4
|
-
const VIEW_ID_LENGTH = 16;
|
|
5
|
-
const MAX_HEXADECIMAL_VALUE = 16;
|
|
6
|
-
const ASCII_CODE_NUMERIC_0 = 48;
|
|
7
|
-
const ASCII_CODE_A = 65;
|
|
8
|
-
const NUMERICAL_CHARACTER_COUNT = 10;
|
|
9
|
-
const OFFSET_A = ASCII_CODE_A - NUMERICAL_CHARACTER_COUNT;
|
|
10
|
-
const createViewInfo = (name) => ({
|
|
11
|
-
["view.instance_id"]: createRandomHexString(VIEW_ID_LENGTH),
|
|
12
|
-
["view.name"]: name,
|
|
13
|
-
});
|
|
14
|
-
exports.createViewInfo = createViewInfo;
|
|
15
|
-
const createRandomHexString = (length) => createRandomString(length, MAX_HEXADECIMAL_VALUE);
|
|
16
|
-
const createRandomString = (length, maxRange) => {
|
|
17
|
-
const resultArray = Array(length);
|
|
18
|
-
for (let i = 0; i < length; i++) {
|
|
19
|
-
const randomInRange = Math.floor(Math.random() * maxRange);
|
|
20
|
-
const character = String.fromCharCode(randomInRange +
|
|
21
|
-
(randomInRange < NUMERICAL_CHARACTER_COUNT
|
|
22
|
-
? ASCII_CODE_NUMERIC_0
|
|
23
|
-
: OFFSET_A));
|
|
24
|
-
resultArray.push(character);
|
|
25
|
-
}
|
|
26
|
-
return resultArray.join('');
|
|
27
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventLimitation = void 0;
|
|
4
|
-
const ConsoleLogger_1 = require("../../../core/logging/ConsoleLogger");
|
|
5
|
-
const EventSpecContstants_1 = require("../spec/EventSpecContstants");
|
|
6
|
-
class EventLimitation {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.logger = new ConsoleLogger_1.ConsoleLogger('EventLimitation');
|
|
9
|
-
}
|
|
10
|
-
limitEventEntries(customEntries) {
|
|
11
|
-
const fieldEntries = customEntries.slice();
|
|
12
|
-
fieldEntries.forEach(this.restrictingValueSize, this);
|
|
13
|
-
const validEntries = fieldEntries
|
|
14
|
-
.filter(this.isNotObject, this)
|
|
15
|
-
.filter(this.doesNotExceedKeySize, this)
|
|
16
|
-
.filter(this.isKeySyntaxAllowed, this);
|
|
17
|
-
if (fieldEntries.length !== validEntries.length) {
|
|
18
|
-
return validEntries;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return fieldEntries;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
limitEventProperties(eventEntries) {
|
|
25
|
-
const allowedEntries = [];
|
|
26
|
-
let propertyCounter = 0;
|
|
27
|
-
for (const [key, value] of eventEntries) {
|
|
28
|
-
if (key.startsWith("event_properties") ||
|
|
29
|
-
key.startsWith("session_properties")) {
|
|
30
|
-
propertyCounter++;
|
|
31
|
-
if (propertyCounter > EventSpecContstants_1.MAX_CUSTOM_EVENT_FIELDS) {
|
|
32
|
-
this.logger.debug(`limitEventProperties(): Dropped ${key} because overall property limit is reached!`);
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
allowedEntries.push([key, value]);
|
|
37
|
-
}
|
|
38
|
-
return allowedEntries;
|
|
39
|
-
}
|
|
40
|
-
isKeySyntaxAllowed(entry) {
|
|
41
|
-
const [key] = entry;
|
|
42
|
-
const rV = EventSpecContstants_1.KEY_NAME_REGEX.test(key);
|
|
43
|
-
if (!rV) {
|
|
44
|
-
this.logger.debug(`isKeySyntaxAllowed(): Filtering key ${key} as it doesnt fulfill character rules!`);
|
|
45
|
-
}
|
|
46
|
-
return rV;
|
|
47
|
-
}
|
|
48
|
-
restrictingValueSize(entry) {
|
|
49
|
-
const [key, value] = entry;
|
|
50
|
-
if (typeof value === 'string' &&
|
|
51
|
-
value.length > EventSpecContstants_1.MAX_CUSTOM_EVENT_VALUE_LENGTH) {
|
|
52
|
-
this.logger.debug(`restrictingValueSize(): Limiting value of ${key} as maximum value length (${EventSpecContstants_1.MAX_CUSTOM_EVENT_VALUE_LENGTH}) is reached!`);
|
|
53
|
-
entry[1] = value.slice(0, EventSpecContstants_1.MAX_CUSTOM_EVENT_VALUE_LENGTH);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
doesNotExceedKeySize([key]) {
|
|
57
|
-
if (key.length <= EventSpecContstants_1.MAX_CUSTOM_EVENT_KEY_LENGTH) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
this.logger.debug(`doesNotExceedKeySize(): Dropping key ${key} as maximum key length (${EventSpecContstants_1.MAX_CUSTOM_EVENT_KEY_LENGTH}) is reached!`);
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
isNotObject([, val]) {
|
|
66
|
-
return typeof val !== 'object' || val === null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.EventLimitation = EventLimitation;
|
|
File without changes
|