Socket
Socket
Sign inDemoInstall

@dynatrace/cordova-plugin

Package Overview
Dependencies
Maintainers
9
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dynatrace/cordova-plugin - npm Package Compare versions

Comparing version 1.233.1 to 1.247.0

scripts/Android.js

42

networking/MobileFirstNetworkInterceptor.js

@@ -13,9 +13,13 @@ "use strict";

var NativeNetworkInterceptorUtils = require(pluginId + '.native-network-interceptor-utils').NativeNetworkInterceptorUtils;
var origWLResourceRequest = undefined;
var dtrum;
var WLResourceRequest;
var WL;
var origWLResourceRequest;
var isNetworkIntercepted = false;
function tagSendRequest(request) {
if (request.getHeader("x-dynatrace") == undefined) {
var actionId = NativeNetworkInterceptorUtils.enterNativeRequestAction(request.getUrl(), "Mobile First");
var tagSendRequest = function (request) {
if (request.getHeader('x-dynatrace') === undefined) {
var actionId = NativeNetworkInterceptorUtils.enterNativeRequestAction(request.getUrl(), 'Mobile First');
var headers = NativeNetworkInterceptorUtils.getHeadersForNativeRequest(actionId);
for (var headerProp in headers) {
for (var _i = 0, headers_1 = headers; _i < headers_1.length; _i++) {
var headerProp = headers_1[_i];
request.setHeader(headerProp, headers[headerProp]);

@@ -28,17 +32,15 @@ }

}
}
};
exports.MobileFirstRequestInterceptor = {
isInterceptorEnabled: function () {
return isNetworkIntercepted;
},
isInterceptorEnabled: function () { return isNetworkIntercepted; },
enableInterceptor: function () {
if (typeof dT_ === "undefined" && typeof dtrum === "undefined") {
console.log("Missing Dynatrace Javascript Agent API! MFP Interceptor not enabled!");
if (typeof dT_ === 'undefined' && typeof dtrum === 'undefined') {
console.log('Missing Dynatrace Javascript Agent API! MFP Interceptor not enabled!');
}
if (typeof WLResourceRequest === "undefined" && typeof WL === "undefined") {
console.log("Missing Mobile First API! MFP Interceptor not enabled!");
if (typeof WLResourceRequest === 'undefined' && typeof WL === 'undefined') {
console.log('Missing Mobile First API! MFP Interceptor not enabled!');
return;
}
if (isNetworkIntercepted) {
console.log("MFP Interceptor already enabled!");
console.log('MFP Interceptor already enabled!');
return;

@@ -57,3 +59,3 @@ }

var actionId = tagSendRequest(this);
if (actionId != -1) {
if (actionId !== -1) {
return originalSend.apply(this, [content])

@@ -74,3 +76,3 @@ .then(function (response) {

var actionId = tagSendRequest(this);
if (actionId != -1) {
if (actionId !== -1) {
return originalSendFormParameters.apply(this, [json])

@@ -92,3 +94,3 @@ .then(function (response) {

for (var prop in origWLResourceRequest) {
if (origWLResourceRequest.hasOwnProperty(prop)) {
if (origWLResourceRequest.hasOwnProperty(prop) === true) {
WLResourceRequest[prop] = origWLResourceRequest[prop];

@@ -98,3 +100,3 @@ }

isNetworkIntercepted = true;
console.log("Enabled MFP HTTP Interceptor!");
console.log('Enabled MFP HTTP Interceptor!');
},

@@ -107,4 +109,4 @@ disableInterceptor: function () {

isNetworkIntercepted = false;
console.log("Disabled MFP HTTP Interceptor!");
}
console.log('Disabled MFP HTTP Interceptor!');
},
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NativeNetworkInterceptorUtils = void 0;
var sessionStoragePrefix = "_dt.";
function getDTC(actionId) {
var dtrum;
var sessionStoragePrefix = '_dt.';
var getDTC = function (actionId) {
var referer = getReferer(actionId);
var dtAdk = getCookieValue("dtAdk");
if (dtAdk == "") {
dtAdk = getLocalStorageValue("dtAdk");
var dtAdk = getCookieValue('dtAdk');
if (dtAdk === '') {
dtAdk = getLocalStorageValue('dtAdk');
}
return "sn=\"" + getCookieValue("dtCookie") + "\", pc=\"" + getCookieValue("dtPC") + "\", v=\"" + getCookieValue("rxVisitor") + "\", r=\"" + referer + "\", adk=\"" + dtAdk + "\"";
}
function getReferer(actionId) {
var referer = "";
if (typeof dT_ !== "undefined" && typeof dT_.gAR !== "undefined") {
return "sn=\"" + getCookieValue('dtCookie') + "\", pc=\"" + getCookieValue('dtPC') + "\""
+ (", v=\"" + getCookieValue('rxVisitor') + "\", r=\"" + referer + "\", adk=\"" + dtAdk + "\"");
};
var getReferer = function (actionId) {
var referer = '';
if (typeof dT_ !== 'undefined' && typeof dT_.gAR !== 'undefined') {
referer = dT_.gAR(actionId);
}
if (referer == "") {
if (referer === '') {
referer = location.href;
}
return referer;
}
function getCookieValue(cookieName) {
};
var getCookieValue = function (cookieName) {
var b = document.cookie.match('(^|[^;]+)\\s*' + cookieName + '\\s*=\\s*([^;]+)');
var cookie = b ? b.pop() : '';
if (cookie == undefined || cookie.length == 0) {
if (cookie === undefined || cookie.length === 0) {
return getSessionStorageValue(cookieName);
}
return cookie;
}
function getLocalStorageValue(key) {
if (typeof localStorage !== "undefined") {
};
var getLocalStorageValue = function (key) {
if (typeof localStorage !== 'undefined') {
var b = localStorage.getItem(key);
return b ? b : '';
return (b != null) ? b : '';
}
}
function getSessionStorageValue(key) {
if (typeof sessionStorage !== "undefined") {
};
var getSessionStorageValue = function (key) {
if (typeof sessionStorage !== 'undefined') {
var b = sessionStorage.getItem(sessionStoragePrefix + key);
return b ? b : '';
return (b != null) ? b : '';
}
}
};
exports.NativeNetworkInterceptorUtils = {
getHeadersForNativeRequest: function (actionId) {
var headers = {};
if (typeof dT_ === "undefined") {
console.log("Missing Dynatrace Javascript Agent API!");
if (typeof dT_ === 'undefined') {
console.log('Missing Dynatrace Javascript Agent API!');
return headers;
}
headers["x-dynatrace"] = "";
headers["x-dtc"] = getDTC(actionId);
headers['x-dynatrace'] = '';
headers['x-dtc'] = getDTC(actionId);
return headers;
},
enterNativeRequestAction: function (url, webRequestFrameworkName, actionNameFallback) {
if (typeof dtrum === "undefined") {
console.log("Missing Dynatrace Javascript Agent API!");
if (typeof dtrum === 'undefined') {
console.log('Missing Dynatrace Javascript Agent API!');
return -1;
}
webRequestFrameworkName = !webRequestFrameworkName
? "Native Web Request: " + url
? 'Native Web Request: ' + url
: webRequestFrameworkName;
actionNameFallback = !actionNameFallback
? "Request: " + url
actionNameFallback = (actionNameFallback == null)
? 'Request: ' + url
: actionNameFallback;
var actionId = dtrum.enterXhrAction(webRequestFrameworkName, 3, url);
if (actionId == 0) {
var userInput = dtrum.beginUserInput("Request", "click", url);
if (actionId === 0) {
var userInput = dtrum.beginUserInput('Request', 'click', url);
actionId = dtrum.enterXhrAction(actionNameFallback, 3, url);

@@ -75,4 +77,4 @@ dtrum.actionName(actionNameFallback);

leaveNativeRequestAction: function (actionId) {
if (typeof dtrum === "undefined") {
console.log("Missing Dynatrace Javascript Agent API!");
if (typeof dtrum === 'undefined') {
console.log('Missing Dynatrace Javascript Agent API!');
}

@@ -82,3 +84,3 @@ else {

}
}
},
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var exec = require('cordova/exec');
var emptyFunction = function () { };

@@ -8,30 +7,27 @@ var pluginId = module.id.slice(0, module.id.lastIndexOf('.'));

var NativeNetworkInterceptorUtils = require(pluginId + '.native-network-interceptor-utils').NativeNetworkInterceptorUtils;
var exec = require('cordova/exec');
module.exports = {
endVisit: function (success, error) {
success = success || emptyFunction;
error = error || emptyFunction;
exec(success, error, "DynatraceCordovaPlugin", "endVisit", []);
success = success !== null && success !== void 0 ? success : emptyFunction;
error = error !== null && error !== void 0 ? error : emptyFunction;
exec(success, error, 'DynatraceCordovaPlugin', 'endVisit', []);
},
getMobileFirstNetworkInterceptor: function () {
return MobileFirstRequestInterceptor;
},
getNativeNetworkInterceptorUtils: function () {
return NativeNetworkInterceptorUtils;
},
getMobileFirstNetworkInterceptor: function () { return MobileFirstRequestInterceptor; },
getNativeNetworkInterceptorUtils: function () { return NativeNetworkInterceptorUtils; },
getUserPrivacyOptions: function (success, error) {
success = success || emptyFunction;
error = error || emptyFunction;
exec(success, error, "DynatraceCordovaPlugin", "getUserPrivacyOptions", []);
success = success !== null && success !== void 0 ? success : emptyFunction;
error = error !== null && error !== void 0 ? error : emptyFunction;
exec(success, error, 'DynatraceCordovaPlugin', 'getUserPrivacyOptions', []);
},
applyUserPrivacyOptions: function (dataCollectionLevel, crashReportingOptedIn, success, error) {
if (crashReportingOptedIn != undefined && dataCollectionLevel != undefined) {
success = success || emptyFunction;
error = error || emptyFunction;
if (crashReportingOptedIn !== undefined && dataCollectionLevel !== undefined) {
success = success !== null && success !== void 0 ? success : emptyFunction;
error = error !== null && error !== void 0 ? error : emptyFunction;
var options = { dataCollectionLevel: dataCollectionLevel, crashReportingOptedIn: crashReportingOptedIn };
exec(success, error, "DynatraceCordovaPlugin", "applyUserPrivacyOptions", [options]);
exec(success, error, 'DynatraceCordovaPlugin', 'applyUserPrivacyOptions', [options]);
}
else if (error) {
error("UserPrivacyOptions missing properties.");
else if (error !== undefined) {
error('UserPrivacyOptions missing properties.');
}
}
},
};
{
"name": "@dynatrace/cordova-plugin",
"version": "1.233.1",
"version": "1.247.0",
"description": "This plugin gives you the ability to use the Dynatrace instrumentation in your hybrid application (Cordova, Ionic, ..). It uses the Mobile Agent, the JavaScript Agent. The Mobile Agent will give you all device specific values containing lifecycle information and the Javascript Agent will allow you to manually instrument your JavaScript/TypeScript code out of the box (Typescript definitions included). The JavaScript Agent will cover the network calls and will automatically detect them.",

@@ -17,4 +17,7 @@ "cordova": {

"tsc": "tsc",
"install": "if-env BUILD_PLUGIN=true && echo 'Skipping Install Script' || node ./scripts/installCap.js",
"uninstall": "if-env BUILD_PLUGIN=true && echo 'Skipping Uninstall Script' || node ./scripts/uninstallCap.js"
"tsc:prod": "tsc -p tsconfig-release.json",
"install": "node ./scripts/InstallCap.js",
"uninstall": "node ./scripts/UninstallCap.js",
"lint": "eslint --cache src/**/*.ts --ignore-pattern .gitignore",
"lint:spec": "eslint --cache tests/**/*.ts --cache-file tests/.eslintcache --ignore-pattern .gitignore"
},

@@ -35,7 +38,6 @@ "keywords": [

"dependencies": {
"axios": "^0.25.0",
"axios": "^0.27.2",
"cordova-common": "^4.0.2",
"if-env": "1.0.4",
"jsdom": "^19.0.0",
"plist": "^3.0.4"
"jsdom": "^20.0.0",
"plist": "^3.0.6"
},

@@ -49,13 +51,20 @@ "devDependencies": {

"@types/shelljs": "^0.8.9",
"@types/tar": "^4.0.5",
"cordova": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^38.0.6",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^41.0.1",
"cordova": "^11.0.0",
"fs-extra": "^10.0.0",
"jest": "^27.0.5",
"jest": "^27.5.1",
"mock-fs": "^4.14.0",
"npm-check-updates": "^12.0.2",
"npm-check-updates": "^12.5.8",
"prettier": "^2.6.1",
"shelljs": "^0.8.4",
"tar": "^6.1.11",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"typescript": "^3.7.5"
"typescript": "^3.8.3"
},

@@ -73,3 +82,7 @@ "files": [

"package.json"
]
],
"lint-staged": {
"*.ts": "eslint --cache --fix",
"**/*": "prettier --write"
}
}

@@ -14,6 +14,8 @@ [![N|Solid](https://assets.dynatrace.com/content/dam/dynatrace/misc/dynatrace_web.png)](https://dynatrace.com)

* For Linux users: Bash (Only a requirement if you are using Linux)
* For Android users: Minimum SDK version 15
* For Android users:
* SDK version 21+
* Gradle version 6.1.1+ ([How to update?](#updating-to-gradle-6))
* Android Gradle plugin version 4.0+
* For iOS users: Minimum iOS 9
* For JavaScript Agent: access to API of cluster
* Android: Gradle > 5.0 ([How to update?](#updating-to-gradle-5))
* Node: > 12.x

@@ -25,4 +27,4 @@

* iOS Agent: 8.233.1.1006
* Android Agent: 8.231.2.1007
* iOS Agent: 8.247.1.1007
* Android Agent: 8.247.1.1003
## Quick Setup

@@ -39,5 +41,8 @@

* [Cordova configuration](#cordova-configuration)
* [Debug property](#debug-property)
* [Content Security Policy url](#content-security-policy-url)
* [Cookie Proxy](#cookie-proxy)
* [Content Security Policy url](#content-security-policy-url)
* [Debug property](#debug-property)
* [JS Agent Path](#js-agent-path)
* [Gradle Path](#gradle-path)
* [Plist Path](#plist-path)
* [Mobile Agent configuration](#mobile-agent-configuration)

@@ -64,3 +69,3 @@ * [Hybrid related configuration](#hybrid-related-configuration)

* [Migration from old plugin](#migration-from-old-plugin)
* [Updating to Gradle 5](#updating-to-gradle-5)
* [Updating to Gradle 6](#updating-to-gradle-6)
* [MavenCentral in top level gradle file](#mavencentral-in-top-level-gradle-file)

@@ -124,8 +129,19 @@ * [Native OneAgent debug logs](#native-oneagent-debug-logs)

5. Run the following commands (replace `<platform>` with `ios` or `android`):
* For Capacitor version < 3.1 and Ionic CLI >= 6.x
* `ionic capacitor sync <platform>`
* `ionic capacitor build <platform>`
6. Run your application
* For Capacitor version >= 3.1 use any of the following commands for instrumentation:
* If using **Ionic CLI**:
* `ionic capacitor run <platform>`
* `ionic capacitor sync <platform> && ionic capacitor open <platform>`
* `ionic capacitor build <platform>`
* If using **Capacitor CLI**:
* `capacitor run <platform>`
* `capacitor sync <platform> && capacitor open <platform>`
6. Run your application (if you did not use the **run** command)
**Note:**
Capacitor 3 has the addition of the `ionic capacitor run <platform>` command. Unfortunately, we cannot support this as the ionic hook available will not allow for us to instrument html files properly. We will continue the requirement of step 4 to properly instrument a capacitor app.
Capacitor 3.1 added new hooks inside of their CLI. This allows us to instrument your application when using the `ionic capacitor run` or `capacitor run` commands.

@@ -135,2 +151,5 @@

**Note:**
If both [custom CLI arguments](#custom-arguments-for-instrumentation-script) and custom configuration arguments are used, custom CLI arguments will be used.
```js

@@ -141,3 +160,6 @@ module.exports = {

cspURL: "http://...",
cookieProxy: false
cookieProxy: false,
jsAgentPath: "/path/to/jsAgent.txt",
gradlePath: "/path/to/build.gradle",
plistPath: "/path/to/Info.plist"
},

@@ -147,2 +169,11 @@ ...

```
### Debug property
The default value is `false`. This property generates more log output and is sometimes necessary if you need to find the cause for a non-working plugin.
### Content Security Policy url
There is flag for updating the CSP (Content Security Policy). By default this value is `set` and the plugin will modify the CSP. The URL in the `cspURL` property will be placed into a CSP configuration (if available) in your index.html. This will allow/unblock connections to the Dynatrace server. If you don't want to use this feature, remove the cspURL property and the plugin will not modify the CSP configuration.
### Cookie Proxy

@@ -164,10 +195,16 @@

The `true` in the cookieProxy property will insert a `dt-cookie-proxy.js` script in the index.html.
### Content Security Policy url
There is flag for updating the CSP (Content Security Policy). By default this value is `set` and the plugin will modify the CSP. The URL in the `cspURL` property will be placed into a CSP configuration (if available) in your index.html. This will allow/unblock connections to the Dynatrace server. If you don't want to use this feature, remove the cspURL property and the plugin will not modify the CSP configuration.
### JS Agent Path
### Debug property
If you want to use a local script/text file that includes the JS Agent snippet downloaded from the WebUI or retrieved from using the Dynatrace API. Note that you can name the file whatever you want but the file and directory that you use needs to exist. The file downloaded from the WebUI will be named `jsSnippet.txt` by default.
The default value is `false`. This property generates more log output and is sometimes necessary if you need to find the cause for a non-working plugin.
### Gradle Path
If your top level build.gradle is not in the standard location or you want to use a specific build.gradle, you can specify a path to the desired file. We will assume that the other gradle file resides in `/app/build.gradle`. This will add all agent dependencies automatically for you and will update the configuration.
### Plist Path
Tell the script where your Info.plist file is. The plist file is used for updating the configuration for the iOS agent.
## Mobile Agent configuration

@@ -595,4 +632,5 @@

**Note:**
Custom arguments will not work with Capacitor based projects.
**Notes:**
* If both custom CLI arguments and [custom configuration arguments](#cordova-configuration) are used, custom CLI arguments will be used.
* Custom arguments will not work with Capacitor based projects.

@@ -602,3 +640,3 @@ Our scripts assumes that the usual cordova project structure is given. The following arguments can be specified for our instrumentation script if the project structure is different.

* `--gradle=C:\MyCordovaAndroidProject\platforms\android\build.gradle` - the location of the root build.gradle file. We will assume that the other gradle file resides in `/app/build.gradle`. This will add all agent dependencies automatically for you and will update the configuration.
* `--plist=C:\MyCordovaIOSProject\platforms\ios\projectName\projectName-Info.plist` - Tell the script where your info.plist file is. The plist file is used for updating the configuration for the agent.
* `--plist=C:\MyCordovaIOSProject\platforms\ios\projectName\projectName-Info.plist` - Tell the script where your Info.plist file is. The plist file is used for updating the configuration for the agent.
* `--config=C:\SpecialFolderForDynatrace\dynatrace.config.js` - Used for if you have not added your config file in the root folder of the Cordova project but somewhere else.

@@ -630,8 +668,8 @@ * `--jsagent=C:\MyCordovaProject\scripts\jsSnippet.txt` - If you want to use a local script/text file that includes the JS Agent snippet downloaded from the WebUI or retrieved from using the Dynatrace API. Note that you can name the file whatever you want but the file and directory that you use needs to exist. The file downloaded from the WebUI will be named `jsSnippet.txt` by default.

* The Android instrumentation is now executed via gradle. This makes the build way faster and more stable. The new plugin is now automatically modifying your gradle files.
* The plugin raised the requirements for Gradle to version 5. This can easily be [upgraded](#updating-to-gradle-5) in your project by changing one line.
* The plugin raised the requirements for Gradle to version 6. This can easily be [upgraded](#updating-to-gradle-6) in your project by changing one line.
* The format of the configuration changed from `dynatrace.config` to `dynatrace.config.js`. The new format can be downloaded via WebUI. If you had some custom settings in Android take a look in the detailed [documentation](#official-documentation). The format of iOS basically stayed the same.
## Updating to Gradle 5
## Updating to Gradle 6
Updating Gradle only affects your Android build. To Update your project to Gradle 5 you have to modify one file in your Android folder.
Updating Gradle only affects your Android build. To Update your project to Gradle 6 you have to modify one file in your Android folder.

@@ -644,6 +682,6 @@ - `ProjectFolder\android\cordova\lib\builders\ProjectBuilder.js` Contains the following line:

make sure you insert some other version like `5.4.1` here:
make sure you insert some other version like `6.1.1` here:
```
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-5.4.1-all.zip';
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-6.1.1-all.zip';
```

@@ -654,3 +692,3 @@

```
process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] = 'https\\://services.gradle.org/distributions/gradle-5.4.1-all.zip';
process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] = 'https\\://services.gradle.org/distributions/gradle-6.1.1-all.zip';
```

@@ -760,2 +798,9 @@

1.247.0
* Added support for [Capacitor run command](#capacitor-instrumentation) for Capacitor versions 3.1+
* Added option to specify paths for [jsAgent](#js-agent-path), [gradlePath](#gradle-path) and [plistPath](#plist-path) in `dynatrace.config.js` file
* Improved capacitor check for specific platforms logic
* Updated Android (8.247.1.1003) & iOS Agent (8.247.1.1007)
* Minimum Android SDK has been raised to SDK 21 and above
1.233.1

@@ -762,0 +807,0 @@ * Fixed issue where old static lib was referenced

@@ -24,10 +24,10 @@ "use strict";

Configuration.prototype.isJavaScriptAgentConfigurationAvailable = function () {
return this.javascriptAgentConfiguration != undefined;
return this.javascriptAgentConfiguration !== undefined;
};
Configuration.prototype.isAndroidConfigurationAvailable = function () {
return this.androidAgentConfiguration != undefined
return this.androidAgentConfiguration !== undefined
&& this.androidAgentConfiguration.isConfigurationAvailable();
};
Configuration.prototype.isIosConfigurationAvailable = function () {
return this.iOSAgentConfiguration != undefined &&
return this.iOSAgentConfiguration !== undefined &&
this.iOSAgentConfiguration.isConfigurationAvailable();

@@ -34,0 +34,0 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigurationReader = void 0;
var DownloadAgent_1 = require("../DownloadAgent");
var ConfigurationDefaults_1 = require("./ConfigurationDefaults");
var downloadAgent_1 = require("../downloadAgent");
var CordovaPluginConfigurationBuilder_1 = require("./cordova/CordovaPluginConfigurationBuilder");

@@ -14,2 +14,3 @@ var MobileAgentConfiguration_1 = require("./mobile/MobileAgentConfiguration");

ConfigurationReader.prototype.readConfiguration = function (pathToConfiguration) {
debugger;
var readConfig;

@@ -20,6 +21,6 @@ try {

catch (e) {
throw new downloadAgent_1.StopBuildError(ConfigurationDefaults_1.ERROR_CONFIG_NOT_AVAILABLE);
throw new DownloadAgent_1.StopBuildError(ConfigurationDefaults_1.ERROR_CONFIG_NOT_AVAILABLE);
}
if (readConfig === undefined) {
throw new downloadAgent_1.StopBuildError(ConfigurationDefaults_1.ERROR_CONFIG_NOT_AVAILABLE);
throw new DownloadAgent_1.StopBuildError(ConfigurationDefaults_1.ERROR_CONFIG_NOT_AVAILABLE);
}

@@ -37,6 +38,9 @@ return this.parseConfiguration(readConfig);

var cordovaConfigurationBuilder = new CordovaPluginConfigurationBuilder_1.CordovaPluginConfigurationBuilder();
if (rawConfig.cordova != undefined) {
if (rawConfig.cordova !== undefined) {
cordovaConfigurationBuilder.setDebugMode(Boolean(rawConfig.cordova.debug));
cordovaConfigurationBuilder.setCSPUrl(rawConfig.cordova.cspURL);
cordovaConfigurationBuilder.setCookieProxy(Boolean(rawConfig.cordova.cookieProxy));
cordovaConfigurationBuilder.setJsAgentPath(rawConfig.cordova.jsAgentPath);
cordovaConfigurationBuilder.setGradlePath(rawConfig.cordova.gradlePath);
cordovaConfigurationBuilder.setPlistPath(rawConfig.cordova.plistPath);
}

@@ -46,3 +50,5 @@ return cordovaConfigurationBuilder.build();

ConfigurationReader.prototype.parseAndroidConfiguration = function (rawConfig) {
if (rawConfig.android && rawConfig.android.config) {
var _a, _b;
if (((_b = (_a = rawConfig === null || rawConfig === void 0 ? void 0 : rawConfig.android) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.length) !== undefined
&& rawConfig.android.config.length > 0) {
return new MobileAgentConfiguration_1.MobileAgentConfiguration(rawConfig.android.config);

@@ -53,3 +59,4 @@ }

ConfigurationReader.prototype.parseIosConfiguration = function (rawConfig) {
if (rawConfig.ios && rawConfig.ios.config) {
var _a, _b, _c, _d;
if (((_b = (_a = rawConfig === null || rawConfig === void 0 ? void 0 : rawConfig.ios) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.length) !== undefined && ((_d = (_c = rawConfig === null || rawConfig === void 0 ? void 0 : rawConfig.ios) === null || _c === void 0 ? void 0 : _c.config) === null || _d === void 0 ? void 0 : _d.length) > 0) {
return new MobileAgentConfiguration_1.MobileAgentConfiguration(rawConfig.ios.config);

@@ -60,3 +67,4 @@ }

ConfigurationReader.prototype.parseJavaScriptConfiguration = function (rawConfig) {
if (rawConfig.js && rawConfig.js.url) {
var _a;
if (((_a = rawConfig === null || rawConfig === void 0 ? void 0 : rawConfig.js) === null || _a === void 0 ? void 0 : _a.url) != null) {
var javascriptConfigurationBuilder = new JavaScriptAgentConfigurationBuilder_1.JavaScriptAgentConfigurationBuilder(rawConfig.js.url);

@@ -63,0 +71,0 @@ javascriptConfigurationBuilder.setAgentMode(rawConfig.js.mode);

@@ -40,47 +40,31 @@ "use strict";

exports.checkConfiguration = void 0;
var fileHelper_1 = require("../helpers/fileHelper");
var FileHelper_1 = require("../helpers/FileHelper");
var Logger_1 = require("../logger/Logger");
var pathHelper_1 = require("../helpers/pathHelper");
function checkConfiguration() {
return __awaiter(this, void 0, void 0, function () {
var pathToDynatraceConfig, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
pathToDynatraceConfig = pathHelper_1.getConfigFilePath();
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 5]);
return [4, fileHelper_1.checkIfFileExists(pathToDynatraceConfig)];
case 2:
_a.sent();
return [3, 5];
case 3:
e_1 = _a.sent();
return [4, createNewConfiguration(pathToDynatraceConfig)];
case 4:
_a.sent();
return [3, 5];
case 5: return [2];
}
});
var PathHelper_1 = require("../helpers/PathHelper");
exports.checkConfiguration = function () { return __awaiter(void 0, void 0, void 0, function () {
var pathToDynatraceConfig, e_1, defaultConfigContent;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
pathToDynatraceConfig = PathHelper_1.getConfigFilePath();
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 6]);
return [4, FileHelper_1.checkIfFileExists(pathToDynatraceConfig)];
case 2:
_a.sent();
return [3, 6];
case 3:
e_1 = _a.sent();
return [4, FileHelper_1.readTextFromFile(PathHelper_1.getDefaultConfig())];
case 4:
defaultConfigContent = _a.sent();
return [4, FileHelper_1.writeTextToFile(pathToDynatraceConfig, defaultConfigContent)];
case 5:
_a.sent();
Logger_1.Logger.getInstance().logInfo('Created dynatrace.config.js - Please insert your configuration and update the file!');
return [3, 6];
case 6: return [2];
}
});
}
exports.checkConfiguration = checkConfiguration;
function createNewConfiguration(pathToDynatraceConfig) {
return __awaiter(this, void 0, void 0, function () {
var defaultConfigContent;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, fileHelper_1.readTextFromFile(pathHelper_1.getDefaultConfig())];
case 1:
defaultConfigContent = _a.sent();
return [4, fileHelper_1.writeTextToFile(pathToDynatraceConfig, defaultConfigContent)];
case 2:
_a.sent();
Logger_1.Logger.getInstance().logInfo("Created dynatrace.config.js - Please insert your configuration and update the file!");
return [2];
}
});
});
}
}); };

@@ -5,6 +5,9 @@ "use strict";

var CordovaPluginConfiguration = (function () {
function CordovaPluginConfiguration(debugEnabled, cookieProxy, cspUrl) {
function CordovaPluginConfiguration(debugEnabled, cookieProxy, cspUrl, jsAgentPath, gradlePath, plistPath) {
this.debugEnabled = debugEnabled;
this.cookieProxy = cookieProxy;
this.cspUrl = cspUrl;
this.jsAgentPath = jsAgentPath;
this.gradlePath = gradlePath;
this.plistPath = plistPath;
}

@@ -15,3 +18,3 @@ CordovaPluginConfiguration.prototype.isDebugEnabled = function () {

CordovaPluginConfiguration.prototype.isCSPUrlAvailable = function () {
return this.cspUrl != undefined;
return this.cspUrl !== undefined;
};

@@ -24,4 +27,22 @@ CordovaPluginConfiguration.prototype.getCSPUrl = function () {

};
CordovaPluginConfiguration.prototype.isJsAgentPathAvailable = function () {
return this.jsAgentPath !== undefined;
};
CordovaPluginConfiguration.prototype.getJsAgentPath = function () {
return this.jsAgentPath;
};
CordovaPluginConfiguration.prototype.isGradlePathAvailable = function () {
return this.gradlePath !== undefined;
};
CordovaPluginConfiguration.prototype.getGradlePath = function () {
return this.gradlePath;
};
CordovaPluginConfiguration.prototype.isPlistPathAvailable = function () {
return this.plistPath !== undefined;
};
CordovaPluginConfiguration.prototype.getPlistPath = function () {
return this.plistPath;
};
return CordovaPluginConfiguration;
}());
exports.CordovaPluginConfiguration = CordovaPluginConfiguration;

@@ -23,4 +23,16 @@ "use strict";

};
CordovaPluginConfigurationBuilder.prototype.setJsAgentPath = function (jsAgentPath) {
this.jsAgentPath = jsAgentPath;
return this;
};
CordovaPluginConfigurationBuilder.prototype.setGradlePath = function (gradlePath) {
this.gradlePath = gradlePath;
return this;
};
CordovaPluginConfigurationBuilder.prototype.setPlistPath = function (plistPath) {
this.plistPath = plistPath;
return this;
};
CordovaPluginConfigurationBuilder.prototype.build = function () {
return new CordovaPluginConfiguration_1.CordovaPluginConfiguration(this.debug, this.cookieProxy, this.cspUrl);
return new CordovaPluginConfiguration_1.CordovaPluginConfiguration(this.debug, this.cookieProxy, this.cspUrl, this.jsAgentPath, this.gradlePath, this.plistPath);
};

@@ -27,0 +39,0 @@ return CordovaPluginConfigurationBuilder;

@@ -21,7 +21,8 @@ "use strict";

JavaScriptAgentConfiguration.prototype.isAgentUrlValid = function () {
if (this.agentUrl == undefined || this.agentUrl.length == 0) {
if (this.agentUrl === undefined || this.agentUrl.length === 0) {
return false;
}
for (var i = 0; i < JavaScriptAgentMode_1.JAVA_SCRIPT_AGENT_MODE_NAMES.length; i++) {
if (this.agentUrl.indexOf(JavaScriptAgentMode_1.JAVA_SCRIPT_AGENT_MODE_NAMES[i]) >= 0) {
for (var _i = 0, JAVA_SCRIPT_AGENT_MODE_NAMES_1 = JavaScriptAgentMode_1.JAVA_SCRIPT_AGENT_MODE_NAMES; _i < JAVA_SCRIPT_AGENT_MODE_NAMES_1.length; _i++) {
var mode = JAVA_SCRIPT_AGENT_MODE_NAMES_1[_i];
if (this.agentUrl.indexOf(mode) >= 0) {
return true;

@@ -28,0 +29,0 @@ }

@@ -13,7 +13,4 @@ "use strict";

}
JavaScriptAgentConfigurationBuilder.prototype.patchIncorrectJSUrl = function (url) {
return url.replace("ApiToken=", "Api-Token=");
};
JavaScriptAgentConfigurationBuilder.prototype.setAgentMode = function (agentMode) {
if (agentMode != undefined && Number(agentMode) != NaN) {
if (agentMode !== undefined && !Number.isNaN(agentMode)) {
this.agentMode = JavaScriptAgentMode_1.parseNumberToMode(agentMode);

@@ -30,4 +27,7 @@ }

};
JavaScriptAgentConfigurationBuilder.prototype.patchIncorrectJSUrl = function (url) {
return url.replace('ApiToken=', 'Api-Token=');
};
return JavaScriptAgentConfigurationBuilder;
}());
exports.JavaScriptAgentConfigurationBuilder = JavaScriptAgentConfigurationBuilder;

@@ -6,26 +6,25 @@ "use strict";

(function (JavaScriptAgentMode) {
JavaScriptAgentMode[JavaScriptAgentMode["JS_INLINE_SCRIPT"] = 0] = "JS_INLINE_SCRIPT";
JavaScriptAgentMode[JavaScriptAgentMode["JS_TAG_COMPLETE"] = 1] = "JS_TAG_COMPLETE";
JavaScriptAgentMode[JavaScriptAgentMode["SYNC_CS"] = 2] = "SYNC_CS";
JavaScriptAgentMode[JavaScriptAgentMode["ASYNC_CS"] = 3] = "ASYNC_CS";
JavaScriptAgentMode[JavaScriptAgentMode["JS_TAG"] = 4] = "JS_TAG";
JavaScriptAgentMode[JavaScriptAgentMode["JsInlineScript"] = 0] = "JsInlineScript";
JavaScriptAgentMode[JavaScriptAgentMode["JsTagComplete"] = 1] = "JsTagComplete";
JavaScriptAgentMode[JavaScriptAgentMode["SyncCs"] = 2] = "SyncCs";
JavaScriptAgentMode[JavaScriptAgentMode["AsyncCs"] = 3] = "AsyncCs";
JavaScriptAgentMode[JavaScriptAgentMode["JsTag"] = 4] = "JsTag";
})(JavaScriptAgentMode = exports.JavaScriptAgentMode || (exports.JavaScriptAgentMode = {}));
exports.DEFAULT_JAVASCRIPT_AGENT_MODE = JavaScriptAgentMode.SYNC_CS;
exports.DEFAULT_JAVASCRIPT_AGENT_MODE = JavaScriptAgentMode.SyncCs;
exports.JAVA_SCRIPT_AGENT_MODE_NAMES = ['jsInlineScript', 'jsTagComplete', 'syncCS', 'asyncCS', 'jsTag'];
function parseNumberToMode(mode) {
exports.parseNumberToMode = function (mode) {
switch (mode) {
case 0:
return JavaScriptAgentMode.JS_INLINE_SCRIPT;
return JavaScriptAgentMode.JsInlineScript;
case 1:
return JavaScriptAgentMode.JS_TAG_COMPLETE;
return JavaScriptAgentMode.JsTagComplete;
case 2:
return JavaScriptAgentMode.SYNC_CS;
return JavaScriptAgentMode.SyncCs;
case 3:
return JavaScriptAgentMode.ASYNC_CS;
return JavaScriptAgentMode.AsyncCs;
case 4:
return JavaScriptAgentMode.JS_TAG;
return JavaScriptAgentMode.JsTag;
default:
return exports.DEFAULT_JAVASCRIPT_AGENT_MODE;
}
}
exports.parseNumberToMode = parseNumberToMode;
};

@@ -12,3 +12,3 @@ "use strict";

MobileAgentConfiguration.prototype.isConfigurationAvailable = function () {
return this.configuration != undefined;
return this.configuration !== undefined;
};

@@ -15,0 +15,0 @@ return MobileAgentConfiguration;

@@ -41,5 +41,5 @@ "use strict";

var Platform_1 = require("../model/Platform");
var Framework_1 = require("../model/Framework");
var FileHelper_1 = require("../helpers/FileHelper");
var DoctorConstants_1 = require("./DoctorConstants");
var Framework_1 = require("../model/Framework");
var fileHelper_1 = require("../helpers/fileHelper");
var Doctor = (function () {

@@ -54,11 +54,11 @@ function Doctor(platforms, framework, latestPluginVersion, packageJson, dynatraceConfiguration) {

Doctor.prototype.isCurrentPluginVersionAvailable = function () {
return this.getCurrentPluginVersion() != undefined;
return this.getCurrentPluginVersion() !== undefined;
};
Doctor.prototype.isLatestPluginVersionAvailable = function () {
return this.getLatestPluginVersion() != undefined;
return this.getLatestPluginVersion() !== undefined;
};
Doctor.prototype.isPluginUpToDate = function () {
if (this.isLatestPluginVersionAvailable() && this.isCurrentPluginVersionAvailable()) {
var currentArray = this.getCurrentPluginVersion().split(".");
var latestArray = this.getLatestPluginVersion().split(".");
var currentArray = this.getCurrentPluginVersion().split('.');
var latestArray = this.getLatestPluginVersion().split('.');
if (latestArray[0] === currentArray[0]) {

@@ -84,3 +84,3 @@ if (latestArray[1] === currentArray[1]) {

Doctor.prototype.isIosAvailable = function () {
return this.platforms.includes(Platform_1.Platform.iOS);
return this.platforms.includes(Platform_1.Platform.IOS);
};

@@ -91,9 +91,9 @@ Doctor.prototype.isAndroidAvailable = function () {

Doctor.prototype.isCordovaAvailable = function () {
return this.framework == Framework_1.Framework.Cordova;
return this.framework === Framework_1.Framework.Cordova;
};
Doctor.prototype.isIonicAvailable = function () {
return this.framework == Framework_1.Framework.Ionic;
return this.framework === Framework_1.Framework.Ionic;
};
Doctor.prototype.isCapacitorAvailable = function () {
return this.framework == Framework_1.Framework.Capacitor;
return this.framework === Framework_1.Framework.Capacitor;
};

@@ -103,5 +103,6 @@ Doctor.prototype.isNativeWebRequestFrameworkAvailable = function () {

if (this.packageJson) {
for (var i = 0; i < DoctorConstants_1.DEPENDENCY_LIST.length; i++) {
if (this.packageJson.isDependencyAvailable(DoctorConstants_1.DEPENDENCY_LIST[i])) {
dependenciesToCollect[DoctorConstants_1.DEPENDENCY_LIST[i]] = this.packageJson.getDependencyVersion(DoctorConstants_1.DEPENDENCY_LIST[i]);
for (var _i = 0, DEPENDENCY_LIST_1 = DoctorConstants_1.DEPENDENCY_LIST; _i < DEPENDENCY_LIST_1.length; _i++) {
var dependency = DEPENDENCY_LIST_1[_i];
if (this.packageJson.isDependencyAvailable(dependency)) {
dependenciesToCollect[dependency] = this.packageJson.getDependencyVersion(dependency);
}

@@ -121,4 +122,4 @@ }

var version = this.packageJson.getDependencyVersion(DoctorConstants_1.MFP_DEPENDENCY_NAME);
if (version != undefined) {
return version.startsWith("^") ? parseFloat(version.replace("^", "")) > 7 : parseFloat(version) > 7;
if (version !== undefined) {
return version.startsWith('^') ? parseFloat(version.replace('^', '')) > 7 : parseFloat(version) > 7;
}

@@ -135,3 +136,3 @@ }

Doctor.prototype.isDynatraceConfigurationAvailable = function () {
return this.dynatraceConfiguration != undefined;
return this.dynatraceConfiguration !== undefined;
};

@@ -141,3 +142,4 @@ Doctor.prototype.isAndroidUsingHybrid = function () {

if (this.dynatraceConfiguration.isAndroidConfigurationAvailable()
&& this.dynatraceConfiguration.getAndroidConfiguration().getConfiguration().includes("hybridWebView")) {
&& this.dynatraceConfiguration.getAndroidConfiguration().getConfiguration() !== undefined &&
this.dynatraceConfiguration.getAndroidConfiguration().getConfiguration().includes('hybridWebView')) {
return true;

@@ -151,3 +153,4 @@ }

if (this.dynatraceConfiguration.isIosConfigurationAvailable()
&& this.dynatraceConfiguration.getIosConfiguration().getConfiguration().includes("<key>DTXHybridApplication</key>")) {
&& this.dynatraceConfiguration.getIosConfiguration().getConfiguration() !== undefined &&
this.dynatraceConfiguration.getIosConfiguration().getConfiguration().includes('<key>DTXHybridApplication</key>')) {
return true;

@@ -161,3 +164,4 @@ }

if (this.dynatraceConfiguration.isIosConfigurationAvailable()
&& this.dynatraceConfiguration.getIosConfiguration().getConfiguration().includes("<key>DTXSetCookiesForDomain</key>")) {
&& this.dynatraceConfiguration.getIosConfiguration().getConfiguration() !== undefined &&
this.dynatraceConfiguration.getIosConfiguration().getConfiguration().includes('<key>DTXSetCookiesForDomain</key>')) {
return true;

@@ -178,4 +182,4 @@ }

_a.trys.push([1, 3, , 4]);
return [4, fileHelper_1.getPlistAsPath(this.isCapacitorAvailable())];
case 2: return [2, (_a.sent()) != undefined];
return [4, FileHelper_1.getPlistAsPath(this.isCapacitorAvailable())];
case 2: return [2, (_a.sent()) !== undefined];
case 3:

@@ -192,3 +196,3 @@ e_1 = _a.sent();

try {
return fileHelper_1.isGradleAvailable(this.isCapacitorAvailable());
return FileHelper_1.isGradleAvailable(this.isCapacitorAvailable());
}

@@ -202,9 +206,9 @@ catch (e) {

try {
if (this.isAndroidAvailable() && fileHelper_1.isGradleAvailable()) {
if (this.isAndroidAvailable() && FileHelper_1.isGradleAvailable()) {
if (this.isCapacitorAvailable()) {
return true;
}
var projectBuilderStr = fileHelper_1.getProjectBuilderAsString();
if (projectBuilderStr != undefined) {
return parseInt(projectBuilderStr.substring(projectBuilderStr.indexOf("distributions/gradle-") + 21, projectBuilderStr.indexOf("-all.zip"))) >= DoctorConstants_1.GRADLE_MIN_VERSION;
var projectBuilderStr = FileHelper_1.getProjectBuilderAsString();
if (projectBuilderStr !== undefined) {
return parseInt(projectBuilderStr.substring(projectBuilderStr.indexOf('distributions/gradle-') + 21, projectBuilderStr.indexOf('-all.zip')), 10) >= DoctorConstants_1.GRADLE_MIN_VERSION;
}

@@ -211,0 +215,0 @@ }

@@ -41,5 +41,5 @@ "use strict";

var Logger_1 = require("../logger/Logger");
var FileHelper_1 = require("../helpers/FileHelper");
var PathHelper_1 = require("../helpers/PathHelper");
var DoctorConstants_1 = require("./DoctorConstants");
var fileHelper_1 = require("../helpers/fileHelper");
var pathHelper_1 = require("../helpers/pathHelper");
var DoctorAnalyzer = (function () {

@@ -56,7 +56,7 @@ function DoctorAnalyzer(doctor) {

_c.trys.push([0, 2, , 3]);
if (!fileHelper_1.checkIfFileExistsSync(pathHelper_1.getLogPath())) {
fileHelper_1.createDirectorySync(pathHelper_1.getLogPath());
if (!FileHelper_1.checkIfFileExistsSync(PathHelper_1.getLogPath())) {
FileHelper_1.createDirectorySync(PathHelper_1.getLogPath());
}
_a = fileHelper_1.writeTextToFileSync;
_b = [pathHelper_1.getDoctorLogPath()];
_a = FileHelper_1.writeTextToFileSync;
_b = [PathHelper_1.getDoctorLogPath()];
return [4, this.toFullString()];

@@ -84,3 +84,3 @@ case 1:

stringBuilder += "\n" + DoctorConstants_1.DEPENDENCIES_HEADING + "\n";
stringBuilder += "" + JSON.stringify(this.doctor.getAllDependencies(), null, "\t");
stringBuilder += "" + JSON.stringify(this.doctor.getAllDependencies(), null, '\t');
return [2, stringBuilder];

@@ -98,3 +98,3 @@ }

stringBuilder = "" + DoctorConstants_1.DOCTOR_DYNATRACE_HEADING;
stringBuilder += "\n\n";
stringBuilder += '\n\n';
if (this.doctor.isCurrentPluginVersionAvailable()

@@ -108,6 +108,6 @@ && this.doctor.isLatestPluginVersionAvailable()) {

}
stringBuilder += "\n\n";
stringBuilder += '\n\n';
}
stringBuilder += this.getImportantDependencyList();
stringBuilder += "\n";
stringBuilder += '\n';
_a = stringBuilder;

@@ -117,3 +117,3 @@ return [4, this.getProblemsList()];

stringBuilder = _a + _b.sent();
stringBuilder += "\n";
stringBuilder += '\n';
stringBuilder += this.getImportantList();

@@ -141,3 +141,3 @@ return [2, stringBuilder];

var nativeWebRequestFrameworks = this.doctor.isNativeWebRequestFrameworkAvailable();
if (Object.keys(nativeWebRequestFrameworks).length == 0) {
if (Object.keys(nativeWebRequestFrameworks).length === 0) {
stringBuilder += DoctorConstants_1.NO_DEPENDENCIES + "\n";

@@ -150,3 +150,3 @@ }

}
return stringBuilder + "\n";
return stringBuilder + '\n';
};

@@ -159,3 +159,3 @@ DoctorAnalyzer.prototype.getProblemsList = function () {

case 0:
stringBuilder = "";
stringBuilder = '';
if (!this.doctor.isDynatraceConfigurationAvailable()) {

@@ -194,3 +194,3 @@ stringBuilder += DoctorConstants_1.MISSING_DYNATRACE_CONFIG;

}
if (stringBuilder.length == 0) {
if (stringBuilder.length === 0) {
stringBuilder += DoctorConstants_1.NO_PROBLEMS;

@@ -204,3 +204,3 @@ }

DoctorAnalyzer.prototype.getImportantList = function () {
var stringBuilder = "";
var stringBuilder = '';
if (this.doctor.isMobileFirstAvailable()) {

@@ -215,3 +215,3 @@ stringBuilder += DoctorConstants_1.MFP_REQ;

}
if (stringBuilder.length != 0) {
if (stringBuilder.length !== 0) {
stringBuilder = DoctorConstants_1.IMPORTANT_HEADING + stringBuilder;

@@ -218,0 +218,0 @@ }

@@ -12,5 +12,5 @@ "use strict";

DoctorBuilder.prototype.setLatestPluginVersion = function (version) {
if (version != undefined) {
if (version.startsWith("^")) {
this.latestPluginVersion = version.replace("^", "");
if (version !== undefined) {
if (version.startsWith('^')) {
this.latestPluginVersion = version.replace('^', '');
}

@@ -17,0 +17,0 @@ else {

@@ -40,47 +40,44 @@ "use strict";

exports.executeDoctor = void 0;
var DoctorBuilder_1 = require("./DoctorBuilder");
var DoctorAnalyzer_1 = require("./DoctorAnalyzer");
var DoctorHelper_1 = require("./DoctorHelper");
var PackageJsonReader_1 = require("../package/PackageJsonReader");
var pathHelper_1 = require("../helpers/pathHelper");
var PathHelper_1 = require("../helpers/PathHelper");
var Framework_1 = require("../model/Framework");
var ConfigurationReader_1 = require("../config/ConfigurationReader");
function executeDoctor() {
return __awaiter(this, void 0, void 0, function () {
var doctorBuilder, _a, _b, packageJsonReader, _c, _d, configurationReader, doctorAnalyzer, _e, _f;
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
doctorBuilder = new DoctorBuilder_1.DoctorBuilder();
_b = (_a = doctorBuilder).setLatestPluginVersion;
return [4, DoctorHelper_1.getLatestPluginVersion()];
case 1:
_b.apply(_a, [_g.sent()]);
doctorBuilder.setPlatforms(DoctorHelper_1.getAvailablePlatforms());
packageJsonReader = new PackageJsonReader_1.PackageJsonReader(pathHelper_1.getApplicationPackage());
_d = (_c = doctorBuilder).setPackageJson;
return [4, packageJsonReader.readPackageJson()];
case 2:
_d.apply(_c, [_g.sent()]);
if (pathHelper_1.isCapacitorApp()) {
doctorBuilder.setFramework(Framework_1.Framework.Capacitor);
}
else if (pathHelper_1.isIonic()) {
doctorBuilder.setFramework(Framework_1.Framework.Ionic);
}
configurationReader = new ConfigurationReader_1.ConfigurationReader();
doctorBuilder.setDynatraceConfigFile(configurationReader.readConfiguration(pathHelper_1.getConfigFilePath()));
doctorAnalyzer = new DoctorAnalyzer_1.DoctorAnalyzer(doctorBuilder.build());
_f = (_e = console).log;
return [4, doctorAnalyzer.toString()];
case 3:
_f.apply(_e, [_g.sent()]);
return [4, doctorAnalyzer.storeFullLogs()];
case 4:
_g.sent();
return [2];
}
});
var DoctorHelper_1 = require("./DoctorHelper");
var DoctorAnalyzer_1 = require("./DoctorAnalyzer");
var DoctorBuilder_1 = require("./DoctorBuilder");
exports.executeDoctor = function () { return __awaiter(void 0, void 0, void 0, function () {
var doctorBuilder, _a, _b, packageJsonReader, _c, _d, configurationReader, doctorAnalyzer, _e, _f;
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
doctorBuilder = new DoctorBuilder_1.DoctorBuilder();
_b = (_a = doctorBuilder).setLatestPluginVersion;
return [4, DoctorHelper_1.getLatestPluginVersion()];
case 1:
_b.apply(_a, [_g.sent()]);
doctorBuilder.setPlatforms(DoctorHelper_1.getAvailablePlatforms());
packageJsonReader = new PackageJsonReader_1.PackageJsonReader(PathHelper_1.getApplicationPackage());
_d = (_c = doctorBuilder).setPackageJson;
return [4, packageJsonReader.readPackageJson()];
case 2:
_d.apply(_c, [_g.sent()]);
if (PathHelper_1.isCapacitorApp()) {
doctorBuilder.setFramework(Framework_1.Framework.Capacitor);
}
else if (PathHelper_1.isIonic()) {
doctorBuilder.setFramework(Framework_1.Framework.Ionic);
}
configurationReader = new ConfigurationReader_1.ConfigurationReader();
doctorBuilder.setDynatraceConfigFile(configurationReader.readConfiguration(PathHelper_1.getConfigFilePath()));
doctorAnalyzer = new DoctorAnalyzer_1.DoctorAnalyzer(doctorBuilder.build());
_f = (_e = console).log;
return [4, doctorAnalyzer.toString()];
case 3:
_f.apply(_e, [_g.sent()]);
return [4, doctorAnalyzer.storeFullLogs()];
case 4:
_g.sent();
return [2];
}
});
}
exports.executeDoctor = executeDoctor;
}); };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PLUGIN_UPDATE_RECOMMEND = exports.PLUGIN_UP_TO_DATE = exports.PLUGIN_LATEST = exports.PLUGIN_CURRENT = exports.MISSING_GRADLE = exports.MISSING_PLIST = exports.MISSING_DYNATRACE_CONFIG = exports.MISSING_IOS_DOMAIN_PROP = exports.MISSING_IOS_HYBRID_PROP = exports.MISSING_ANDROID_HYBRID_BLOCK = exports.MFP_VERSION_NOT_SUPPORTED = exports.GRADLE_VERSION_NOT_SUPPORTED = exports.JSAGENT_REQ = exports.MFP_REQ = exports.NATIVE_REQ = exports.SEE_RESOLUTION = exports.MORE_INFO = exports.NATIVE_MFP_REQUESTS_REQ = exports.NO_PROBLEMS = exports.NO_DEPENDENCIES = exports.PLATFORM_ANDROID = exports.PLATFORM_IOS = exports.DEPENDENCIES_HEADING = exports.IMPORTANT_HEADING = exports.PROBLEMS_REC_HEADING = exports.NATIVE_DEPENDENCIES_HEADING = exports.BUILD_FRAMEWORK_HEADING = exports.PLUGIN_VERSION_HEADING = exports.DOCTOR_DYNATRACE_HEADING = exports.NPM_CHANGELOG_DOC = exports.NPM_GRADLE_DOC = exports.NPM_IOS_CORR_ISSUES_DOC = exports.NPM_NATIVE_WR_DOC = exports.NPM_MFP_DOC = exports.NPM_CUSTOM_ARGS_DOC = exports.NPM_HYBRID_CONFIG = exports.NPM_DYNATRACE_CONFIG_DOC = exports.GRADLE_MIN_VERSION = exports.MFP_MIN_VERSION = exports.DEPENDENCY_LIST = exports.MFP_DEPENDENCY_NAME = exports.RESET = exports.REVERSE = exports.UNDERLINED = exports.BOLD = exports.BG_CYAN = exports.CYAN_FONT = exports.YELLOW_FONT = exports.GREEN_FONT = exports.RED_FONT = exports.STAR = exports.ALERT = exports.WARN = exports.TADA = exports.RED_X = exports.GREEN_CHECK = exports.DYNATRACE_NPM_PACKAGE_NAME = exports.NPM_PACKAGE_INFO_API = void 0;
exports.NPM_PACKAGE_INFO_API = "https://registry.npmjs.org/@dynatrace/cordova-plugin/latest";
exports.DYNATRACE_NPM_PACKAGE_NAME = "@dynatrace/cordova-plugin";
exports.GREEN_CHECK = "✅";
exports.RED_X = "❌";
exports.TADA = "🎉";
exports.WARN = "❗️";
exports.ALERT = "🚨";
exports.STAR = "⭐️";
exports.RED_FONT = "\x1b[31m";
exports.GREEN_FONT = "\x1b[32m";
exports.YELLOW_FONT = "\x1b[33m";
exports.CYAN_FONT = "\x1b[36m";
exports.BG_CYAN = "\x1b[46m";
exports.BOLD = "\u001B[1m";
exports.UNDERLINED = "\x1b[4m";
exports.REVERSE = "\x1b[7m";
exports.RESET = "\x1b[0m";
exports.MFP_DEPENDENCY_NAME = "cordova-plugin-mfp";
exports.NPM_PACKAGE_INFO_API = 'https://registry.npmjs.org/@dynatrace/cordova-plugin/latest';
exports.DYNATRACE_NPM_PACKAGE_NAME = '@dynatrace/cordova-plugin';
exports.GREEN_CHECK = '✅';
exports.RED_X = '❌';
exports.TADA = '🎉';
exports.WARN = '❗️';
exports.ALERT = '🚨';
exports.STAR = '⭐️';
exports.RED_FONT = '\x1b[31m';
exports.GREEN_FONT = '\x1b[32m';
exports.YELLOW_FONT = '\x1b[33m';
exports.CYAN_FONT = '\x1b[36m';
exports.BG_CYAN = '\x1b[46m';
exports.BOLD = '\u001B[1m';
exports.UNDERLINED = '\x1b[4m';
exports.REVERSE = '\x1b[7m';
exports.RESET = '\x1b[0m';
exports.MFP_DEPENDENCY_NAME = 'cordova-plugin-mfp';
exports.DEPENDENCY_LIST = ['@ionic-native/http', 'cordova-plugin-advanced-http', exports.MFP_DEPENDENCY_NAME, 'cordova-plugin-okhttp'];
exports.MFP_MIN_VERSION = "8.0.0";
exports.MFP_MIN_VERSION = '8.0.0';
exports.GRADLE_MIN_VERSION = 5;

@@ -40,5 +40,5 @@ exports.NPM_DYNATRACE_CONFIG_DOC = exports.CYAN_FONT + "https://www.npmjs.com/package/@dynatrace/cordova-plugin#2-configuration-with-dynatrace" + exports.RESET + "\n";

exports.DEPENDENCIES_HEADING = exports.BOLD + "--------------------\n| All dependencies |\n--------------------" + exports.RESET;
exports.PLATFORM_IOS = "iOS";
exports.PLATFORM_ANDROID = "Android";
exports.NO_DEPENDENCIES = "None found";
exports.PLATFORM_IOS = 'iOS';
exports.PLATFORM_ANDROID = 'Android';
exports.NO_DEPENDENCIES = 'None found';
exports.NO_PROBLEMS = "\n" + exports.TADA + exports.GREEN_FONT + exports.BOLD + " No problems found! " + exports.RESET + exports.TADA + "\n";

@@ -59,5 +59,5 @@ exports.NATIVE_MFP_REQUESTS_REQ = "will require an instrumented webserver with version " + exports.GREEN_FONT + exports.BOLD + ">= 1.211.x." + exports.RESET;

exports.MISSING_GRADLE = "\n" + exports.RED_X + " Unable to find top-level build.gradle.\n--> " + exports.GREEN_CHECK + " If using a gradle file in a different location than the project's default, please use the custom CLI parameter --gradle=<locationOfTopLevel-build.gradle>\n\n\t" + exports.NPM_DYNATRACE_CONFIG_DOC;
exports.PLUGIN_CURRENT = "Current: ";
exports.PLUGIN_LATEST = "Latest: ";
exports.PLUGIN_CURRENT = 'Current: ';
exports.PLUGIN_LATEST = 'Latest: ';
exports.PLUGIN_UP_TO_DATE = "\n" + exports.TADA + exports.GREEN_FONT + exports.BOLD + " Up to date! " + exports.RESET + exports.TADA + "\n";
exports.PLUGIN_UPDATE_RECOMMEND = "\n" + exports.STAR + exports.BOLD + exports.GREEN_FONT + " A newer plugin version is available! " + exports.RESET + exports.STAR + "\n\nPlease see our changelog and update for our latest features and bugfixes.\n--> " + exports.NPM_CHANGELOG_DOC;

@@ -40,11 +40,11 @@ "use strict";

exports.getLatestPluginVersion = exports.getAvailablePlatforms = void 0;
var fs_1 = require("fs");
var axios_1 = require("axios");
var Platform_1 = require("../model/Platform");
var pathHelper_1 = require("../helpers/pathHelper");
var PathHelper_1 = require("../helpers/PathHelper");
var DoctorConstants_1 = require("./DoctorConstants");
var fs_1 = require("fs");
var axios_1 = require("axios");
function getAvailablePlatforms() {
exports.getAvailablePlatforms = function () {
var platforms = [];
try {
if (fs_1.existsSync(pathHelper_1.getAndroidPath())) {
if (fs_1.existsSync(PathHelper_1.getAndroidPath())) {
platforms.push(Platform_1.Platform.Android);

@@ -56,4 +56,4 @@ }

try {
if (fs_1.existsSync(pathHelper_1.getIosPath())) {
platforms.push(Platform_1.Platform.iOS);
if (fs_1.existsSync(PathHelper_1.getIosPath())) {
platforms.push(Platform_1.Platform.IOS);
}

@@ -64,24 +64,20 @@ }

return platforms;
}
exports.getAvailablePlatforms = getAvailablePlatforms;
function getLatestPluginVersion() {
return __awaiter(this, void 0, void 0, function () {
var response, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
axios_1.default.defaults.adapter = require('axios/lib/adapters/http');
return [4, axios_1.default.get(DoctorConstants_1.NPM_PACKAGE_INFO_API)];
case 1:
response = _a.sent();
return [2, response.data.version];
case 2:
e_1 = _a.sent();
return [2, undefined];
case 3: return [2];
}
});
};
exports.getLatestPluginVersion = function () { return __awaiter(void 0, void 0, void 0, function () {
var response, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
axios_1.default.defaults.adapter = require('axios/lib/adapters/http');
return [4, axios_1.default.get(DoctorConstants_1.NPM_PACKAGE_INFO_API)];
case 1:
response = _a.sent();
return [2, response.data.version];
case 2:
e_1 = _a.sent();
return [2, undefined];
case 3: return [2];
}
});
}
exports.getLatestPluginVersion = getLatestPluginVersion;
}); };

@@ -0,1 +1,2 @@

"use strict";
if (typeof window !== 'undefined') {

@@ -45,5 +46,3 @@ window.dtrum = window.dtrum || {

};
window.dtrum.endSession = function (success, error) {
return window.dynatraceMobile.endVisit(success, error);
};
window.dtrum.endSession = function (success, error) { return window.dynatraceMobile.endVisit(success, error); };
}

@@ -40,45 +40,43 @@ "use strict";

exports.createHTTPOptions = exports.createJSAgentHTTPRequest = void 0;
var https_1 = require("https");
var axios_1 = require("axios");
var https_1 = require("https");
var Logger_1 = require("../logger/Logger");
function createJSAgentHTTPRequest(configuration, finishMsg, errorMsg) {
return __awaiter(this, void 0, void 0, function () {
var axiosInstance, errorMessage, httpResponse, error_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
axiosInstance = axios_1.default.create({
httpsAgent: new https_1.Agent(createHTTPOptions(configuration))
});
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4, axiosInstance.get(configuration.getAgentUrl())];
case 2:
httpResponse = _a.sent();
if (httpResponse.status == 200) {
Logger_1.Logger.getInstance().logInfo(finishMsg);
return [2, httpResponse.data];
}
else {
errorMessage = errorMsg + httpResponse.statusText;
}
return [3, 4];
case 3:
error_1 = _a.sent();
exports.createJSAgentHTTPRequest = function (configuration, finishMsg, errorMsg) { return __awaiter(void 0, void 0, void 0, function () {
var axiosInstance, errorMessage, httpResponse, error_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
axiosInstance = axios_1.default.create({
httpsAgent: new https_1.Agent(exports.createHTTPOptions(configuration)),
});
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4, axiosInstance.get(configuration.getAgentUrl())];
case 2:
httpResponse = _a.sent();
if (httpResponse.status === 200) {
Logger_1.Logger.getInstance().logInfo(finishMsg);
return [2, httpResponse.data];
}
else {
errorMessage = errorMsg + httpResponse.statusText;
}
return [3, 4];
case 3:
error_1 = _a.sent();
if (error_1 instanceof Error) {
errorMessage = errorMsg + error_1.message;
return [3, 4];
case 4:
if (errorMessage) {
throw new Error(errorMessage);
}
return [2, ""];
}
});
}
return [3, 4];
case 4:
if (errorMessage != null) {
throw new Error(errorMessage);
}
return [2, ''];
}
});
}
exports.createJSAgentHTTPRequest = createJSAgentHTTPRequest;
function createHTTPOptions(configuration) {
return { rejectUnauthorized: !configuration.isAnyCertificateAllowed() };
}
exports.createHTTPOptions = createHTTPOptions;
}); };
exports.createHTTPOptions = function (configuration) {
return ({ rejectUnauthorized: !configuration.isAnyCertificateAllowed() });
};

@@ -17,7 +17,7 @@ "use strict";

exports.FileLogger = void 0;
var path_1 = require("path");
var FileHelper_1 = require("../helpers/FileHelper");
var PathHelper_1 = require("../helpers/PathHelper");
var BaseLogger_1 = require("./BaseLogger");
var fileHelper_1 = require("../helpers/fileHelper");
var pathHelper_1 = require("../helpers/pathHelper");
var LogUtil_1 = require("./LogUtil");
var path_1 = require("path");
var LogLevel_1 = require("./LogLevel");

@@ -42,6 +42,6 @@ var FileLogger = (function (_super) {

this.createLogPath();
fileHelper_1.appendFileSync(this.getFileLocation(), logMessage + "\r\n");
FileHelper_1.appendFileSync(this.getFileLocation(), logMessage + "\r\n");
}
catch (error) {
_super.prototype.log.call(this, "Could not log to File: " + pathHelper_1.getCurrentLogPath(), LogLevel_1.LogLevel.WARNING);
_super.prototype.log.call(this, "Could not log to File: " + PathHelper_1.getCurrentLogPath(), LogLevel_1.LogLevel.WARNING);
}

@@ -56,10 +56,10 @@ return logMessage;

FileLogger.prototype.getFileLocation = function () {
return pathHelper_1.getCurrentLogPath();
return PathHelper_1.getCurrentLogPath();
};
FileLogger.prototype.closeLogger = function () {
try {
fileHelper_1.checkIfFileExistsSync(pathHelper_1.getCurrentLogPath());
var logFileName = LogUtil_1.currentDate().split(":").join("-") + ".txt";
fileHelper_1.checkIfFileExistsSync(path_1.join(pathHelper_1.getLogPath(), logFileName));
fileHelper_1.renameFileSync(pathHelper_1.getCurrentLogPath(), path_1.join(pathHelper_1.getLogPath(), logFileName));
FileHelper_1.checkIfFileExistsSync(PathHelper_1.getCurrentLogPath());
var logFileName = LogUtil_1.currentDate().split(':').join('-') + '.txt';
FileHelper_1.checkIfFileExistsSync(path_1.join(PathHelper_1.getLogPath(), logFileName));
FileHelper_1.renameFileSync(PathHelper_1.getCurrentLogPath(), path_1.join(PathHelper_1.getLogPath(), logFileName));
}

@@ -71,6 +71,6 @@ catch (e) {

try {
fileHelper_1.checkIfFileExistsSync(pathHelper_1.getLogPath());
FileHelper_1.checkIfFileExistsSync(PathHelper_1.getLogPath());
}
catch (error) {
fileHelper_1.createDirectorySync(pathHelper_1.getLogPath());
FileHelper_1.createDirectorySync(PathHelper_1.getLogPath());
}

@@ -77,0 +77,0 @@ };

@@ -17,3 +17,3 @@ "use strict";

Logger.setType = function (loggerType, debug) {
if (loggerType == LoggerType_1.LoggerType.FileLogger) {
if (loggerType === LoggerType_1.LoggerType.FileLogger) {
this.instance = new FileLogger_1.FileLogger(debug);

@@ -20,0 +20,0 @@ }

@@ -21,3 +21,3 @@ "use strict";

var stringBuilder = "#" + this.logLevel.toString() + " ";
if (this.date == undefined) {
if (this.date === undefined) {
stringBuilder += "[" + LogUtil_1.currentDate() + "]: ";

@@ -24,0 +24,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.currentDate = exports.convertDateToString = void 0;
function convertDateToString(date) {
exports.convertDateToString = function (date) {
var localISOTime = date.toISOString().slice(0, -5);
return localISOTime.replace("T", " ");
}
exports.convertDateToString = convertDateToString;
function currentDate() {
return localISOTime.replace('T', ' ');
};
exports.currentDate = function () {
var tzoffset = (new Date()).getTimezoneOffset() * 60000;
return this.convertDateToString(new Date(Date.now() - tzoffset));
}
exports.currentDate = currentDate;
return exports.convertDateToString(new Date(Date.now() - tzoffset));
};

@@ -7,3 +7,3 @@ "use strict";

Platform["Android"] = "Android";
Platform["iOS"] = "iOS";
Platform["IOS"] = "iOS";
})(Platform = exports.Platform || (exports.Platform = {}));

@@ -13,4 +13,4 @@ "use strict";

var version = this.getDependencyVersion(DoctorConstants_1.DYNATRACE_NPM_PACKAGE_NAME);
if (version && version.startsWith("^")) {
return version.replace("^", "");
if ((version != null) && version.startsWith('^')) {
return version.replace('^', '');
}

@@ -33,3 +33,3 @@ return version;

var allDependencies = this.getAllDependencies();
return allDependencies[dependency] != undefined;
return allDependencies[dependency] !== undefined;
};

@@ -41,8 +41,9 @@ PackageJson.prototype.getDependencyVersion = function (dependency) {

PackageJson.prototype.isScriptAvailable = function (script) {
if (script == undefined) {
return this.scripts != undefined;
if (script === undefined) {
return false;
}
else {
return this.scripts && this.scripts[script] != undefined;
else if (this.scripts === undefined) {
return false;
}
return this.scripts[script] !== undefined;
};

@@ -49,0 +50,0 @@ PackageJson.prototype.getScripts = function () {

@@ -41,4 +41,4 @@ "use strict";

var Logger_1 = require("../logger/Logger");
var FileHelper_1 = require("../helpers/FileHelper");
var PackageJsonBuilder_1 = require("./PackageJsonBuilder");
var fileHelper_1 = require("../helpers/fileHelper");
var PackageJsonReader = (function () {

@@ -58,10 +58,10 @@ function PackageJsonReader(packageJsonPath) {

_a.trys.push([1, 3, , 4]);
return [4, fileHelper_1.readTextFromFile(this.packageJsonPath)];
return [4, FileHelper_1.readTextFromFile(this.packageJsonPath)];
case 2:
packageJson = _a.sent();
parsedPackageJson = JSON.parse(packageJson);
if (parsedPackageJson.dependencies != undefined) {
if (parsedPackageJson.dependencies !== undefined) {
packageJsonBuilder.setDependencies(parsedPackageJson.dependencies);
}
if (parsedPackageJson.devDependencies != undefined) {
if (parsedPackageJson.devDependencies !== undefined) {
packageJsonBuilder.setDevDependencies(parsedPackageJson.devDependencies);

@@ -68,0 +68,0 @@ }

@@ -1,24 +0,25 @@

var cookieList = ["dtCookie", "dtLatC", "dtPC", "dtSa", "dtValidationCookie", "rxVisitor", "rxvt", "dtAdk", "dtAdkSettings"];
var sessionStoragePrefix = "_dt.";
if (typeof Document !== "undefined") {
var cookieDesc = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie') ||
"use strict";
var cookieList = ['dtCookie', 'dtLatC', 'dtPC', 'dtSa', 'dtValidationCookie', 'rxVisitor', 'rxvt', 'dtAdk', 'dtAdkSettings'];
var sessionStoragePrefix = '_dt.';
if (typeof Document !== 'undefined') {
var cookieDesc_1 = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie') ||
Object.getOwnPropertyDescriptor(HTMLDocument.prototype, 'cookie');
if (cookieDesc && cookieDesc.configurable) {
if (cookieDesc_1 !== undefined && (cookieDesc_1.configurable === true)) {
Object.defineProperty(document, 'cookie', {
get: function () {
var cookies = cookieDesc.get.call(document);
var cookies = cookieDesc_1.get.call(document);
return patchCookies(cookies);
},
set: function (val) {
cookieDesc.set.call(document, val);
cookieDesc_1.set.call(document, val);
setCookie(val);
}
},
});
}
}
function setCookie(value) {
var setCookie = function (value) {
if (value !== undefined) {
var cookieParts = value.split(";");
var cookieParts = value.split(';');
var values = cookieParts[0].split(/=(.+)/);
if (values && values.length > 1 && isCookieImportant(values[0])) {
if (values.length > 1 && isCookieImportant(values[0])) {
if (values[0] !== undefined && values[1] !== undefined && sessionStorage !== undefined) {

@@ -29,4 +30,4 @@ sessionStorage.setItem(sessionStoragePrefix + values[0], values[1]);

}
}
function patchCookies(allCookies) {
};
var patchCookies = function (allCookies) {
if (allCookies === undefined || allCookies.length === 0) {

@@ -36,13 +37,14 @@ return getAllCookies();

return allCookies;
}
function getAllCookies() {
var cookieString = "";
for (var i = 0; i < cookieList.length; i++) {
var cookie = getCookie(cookieList[i]);
};
var getAllCookies = function () {
var cookieString = '';
for (var _i = 0, cookieList_1 = cookieList; _i < cookieList_1.length; _i++) {
var cookieName = cookieList_1[_i];
var cookie = getCookie(cookieName);
if (cookie !== undefined && cookie !== null) {
if (cookieString.length == 0) {
cookieString += cookieList[i] + "=" + cookie;
if (cookieString.length === 0) {
cookieString += cookieName + "=" + cookie;
}
else {
cookieString += "; " + cookieList[i] + "=" + cookie;
cookieString += "; " + cookieName + "=" + cookie;
}

@@ -52,9 +54,9 @@ }

return cookieString;
}
function getCookie(name) {
};
var getCookie = function (name) {
if (name !== undefined && sessionStorage !== undefined) {
return sessionStorage.getItem(sessionStoragePrefix + name);
}
}
function isCookieImportant(name) {
};
var isCookieImportant = function (name) {
if (name !== undefined && name.length > 0) {

@@ -64,4 +66,4 @@ return cookieList.includes(name);

return false;
}
if (typeof exports !== "undefined") {
};
if (typeof exports !== 'undefined') {
exports.setCookie = setCookie;

@@ -68,0 +70,0 @@ exports.patchCookies = patchCookies;

@@ -5,6 +5,9 @@ "use strict";

var Logger_1 = require("../logger/Logger");
function logPluginVersion(packageJson) {
(packageJson && packageJson.version) ? Logger_1.Logger.getInstance().logInfo("Dynatrace Cordova Plugin - Version " + packageJson.version)
: Logger_1.Logger.getInstance().logWarning("Dynatrace Cordova Plugin - Version NOT READABLE");
}
exports.logPluginVersion = logPluginVersion;
exports.logPluginVersion = function (packageJson) {
if (packageJson !== undefined && packageJson.version !== undefined) {
Logger_1.Logger.getInstance().logInfo('Dynatrace Cordova Plugin - Version ' + packageJson.version);
}
else {
Logger_1.Logger.getInstance().logWarning('Dynatrace Cordova Plugin - Version NOT READABLE');
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc