@uipath/robot
Advanced tools
+23
-6
@@ -58,15 +58,19 @@ "use strict"; | ||
| * Method to attach event handlers on the SDK. | ||
| * @param eventName Available SDK events are 'consent-prompt', 'missing-components'. | ||
| * @param eventHanlder Event handler callback function called when event occurs. | ||
| * @param eventName Available SDK events are 'consent-prompt', 'missing-components', 'open-uipath-protocol'. | ||
| * @param eventHandler Event handler callback function called when event occurs. | ||
| */ | ||
| this.on = function (eventName, eventHanlder) { | ||
| this.on = function (eventName, eventHandler) { | ||
| switch (eventName) { | ||
| case constants_1.Constants.CONSENT_PROMPT: { | ||
| _this.eventHandlers.on(constants_1.Constants.CONSENT_PROMPT, eventHanlder); | ||
| _this.eventHandlers.on(constants_1.Constants.CONSENT_PROMPT, eventHandler); | ||
| break; | ||
| } | ||
| case constants_1.Constants.MISSING_COMPONENTS: { | ||
| _this.eventHandlers.on(constants_1.Constants.MISSING_COMPONENTS, eventHanlder); | ||
| _this.eventHandlers.on(constants_1.Constants.MISSING_COMPONENTS, eventHandler); | ||
| break; | ||
| } | ||
| case constants_1.Constants.OPEN_UIPATH_PROTOCOL: { | ||
| _this.eventHandlers.on(constants_1.Constants.OPEN_UIPATH_PROTOCOL, eventHandler); | ||
| break; | ||
| } | ||
| default: { | ||
@@ -342,3 +346,3 @@ _this.trace(traceEvent_1.TraceEvent.Invalid_Event, {}); | ||
| _this.consentCode = utils_1.RandomUtil.getRandomNumber(); | ||
| utils_1.ProtocolUtil.openUiPathProtocol(_this.consentCode); | ||
| _this.openCustomProtocol(_this.consentCode); | ||
| _this.showConsentCode(_this.consentCode, isDomainAllowed); | ||
@@ -465,2 +469,15 @@ _this.pollForApprovedConsent(_this.getPort) | ||
| }; | ||
| /** | ||
| * Opens custom protocol handler to allow user to consent access. | ||
| * @param consentCode Randomly generated consent code | ||
| */ | ||
| this.openCustomProtocol = function (consentCode) { | ||
| if (_this.eventHandlers.has(constants_1.Constants.OPEN_UIPATH_PROTOCOL)) { | ||
| var protocolUrl = utils_1.ProtocolUtil.getUiPathProtocolUrl(consentCode); | ||
| _this.eventHandlers.dispatch(constants_1.Constants.OPEN_UIPATH_PROTOCOL, protocolUrl); | ||
| } | ||
| else { | ||
| utils_1.ProtocolUtil.openUiPathProtocol(consentCode); | ||
| } | ||
| }; | ||
| this.trace = function (event, properties) { | ||
@@ -467,0 +484,0 @@ if (!_this.settings.disableTelemetry) { |
@@ -24,2 +24,3 @@ export declare class Constants { | ||
| static readonly DOMAIN_ALLOWED = "X-UIPATH-DOMAIN-ALLOWED"; | ||
| static readonly OPEN_UIPATH_PROTOCOL = "open-uipath-protocol"; | ||
| } |
@@ -30,4 +30,5 @@ "use strict"; | ||
| Constants.DOMAIN_ALLOWED = 'X-UIPATH-DOMAIN-ALLOWED'; | ||
| Constants.OPEN_UIPATH_PROTOCOL = 'open-uipath-protocol'; | ||
| return Constants; | ||
| }()); | ||
| exports.Constants = Constants; |
| /** | ||
| * Protocol util to open consent window application | ||
| * Protocol util to generate custom protocol URL and open consent window application | ||
| */ | ||
| export declare class ProtocolUtil { | ||
| static getUiPathProtocolUrl: (consentCode: number) => string; | ||
| static openUiPathProtocol: (consentCode: number) => void; | ||
| } |
@@ -6,3 +6,3 @@ "use strict"; | ||
| /** | ||
| * Protocol util to open consent window application | ||
| * Protocol util to generate custom protocol URL and open consent window application | ||
| */ | ||
@@ -13,5 +13,7 @@ /* @uipath-internal */ | ||
| } | ||
| ProtocolUtil.getUiPathProtocolUrl = function (consentCode) { | ||
| return constants_1.Constants.UIPATH_PROTOCOL + "://localhost/showConsent?dontdelete=oldrobotnewbrowser&consentCode=" + encodeURIComponent(consentCode) + "&Origin=" + encodeURIComponent(window.location.origin); | ||
| }; | ||
| ProtocolUtil.openUiPathProtocol = function (consentCode) { | ||
| var url = constants_1.Constants.UIPATH_PROTOCOL + "://localhost/showConsent?dontdelete=oldrobotnewbrowser&consentCode=" + encodeURIComponent(consentCode) + "&Origin=" + encodeURIComponent(window.location.origin); | ||
| window.location.href = url; | ||
| window.location.href = ProtocolUtil.getUiPathProtocolUrl(consentCode); | ||
| }; | ||
@@ -18,0 +20,0 @@ return ProtocolUtil; |
@@ -1,1 +0,1 @@ | ||
| export declare const ROBOTJS_VERSION = "1.3.2"; | ||
| export declare const ROBOTJS_VERSION = "1.3.3"; |
+1
-1
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ROBOTJS_VERSION = void 0; | ||
| exports.ROBOTJS_VERSION = '1.3.2'; | ||
| exports.ROBOTJS_VERSION = '1.3.3'; |
+43
-43
| { | ||
| "name": "@uipath/robot", | ||
| "version": "1.3.2", | ||
| "description": "UiPath Robot javascript SDK enabling web pages to interact with UiPath Robots", | ||
| "scripts": { | ||
| "prebuild": "node genversion.js", | ||
| "build": "tsc && webpack --mode production --config webpack.config.js", | ||
| "clean": "tsc --build --clean", | ||
| "pack": "npm pack" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^8.0.14", | ||
| "@types/uuid": "^8.3.4", | ||
| "copy-webpack-plugin": "^12.0.2", | ||
| "style-loader": "^0.23.1", | ||
| "ts-loader": "^9.4.1", | ||
| "typescript": "^3.6.4", | ||
| "tslint": "^5.20.0", | ||
| "tslint-jasmine-rules": "^1.6.0", | ||
| "webpack": "^5.76.0", | ||
| "webpack-cli": "^5.1.4" | ||
| }, | ||
| "dependencies": { | ||
| "@microsoft/applicationinsights-web": "^2.5.9", | ||
| "async-mutex": "^0.3.2", | ||
| "uuid": "^8.3.2" | ||
| }, | ||
| "main": "dist/uipathRobot.js", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/UiPath/BrowserInvocation.git" | ||
| }, | ||
| "keywords": [ | ||
| "uipathrobot", | ||
| "robot-web", | ||
| "robot-sdk", | ||
| "robotjs", | ||
| "robot sdk", | ||
| "UiPath Robot" | ||
| ], | ||
| "maintainers": [ | ||
| "vnaren23" | ||
| ], | ||
| "license": "See license in LICENSE file" | ||
| "name": "@uipath/robot", | ||
| "version": "1.3.3", | ||
| "description": "UiPath Robot javascript SDK enabling web pages to interact with UiPath Robots", | ||
| "scripts": { | ||
| "prebuild": "node genversion.js", | ||
| "build": "tsc && webpack --mode production --config webpack.config.js", | ||
| "clean": "tsc --build --clean", | ||
| "pack": "npm pack" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^8.0.14", | ||
| "@types/uuid": "^8.3.4", | ||
| "copy-webpack-plugin": "^12.0.2", | ||
| "style-loader": "^0.23.1", | ||
| "ts-loader": "^9.4.1", | ||
| "typescript": "^3.6.4", | ||
| "tslint": "^5.20.0", | ||
| "tslint-jasmine-rules": "^1.6.0", | ||
| "webpack": "^5.76.0", | ||
| "webpack-cli": "^5.1.4" | ||
| }, | ||
| "dependencies": { | ||
| "@microsoft/applicationinsights-web": "^2.5.9", | ||
| "async-mutex": "^0.3.2", | ||
| "uuid": "^8.3.2" | ||
| }, | ||
| "main": "dist/uipathRobot.js", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/UiPath/BrowserInvocation.git" | ||
| }, | ||
| "keywords": [ | ||
| "uipathrobot", | ||
| "robot-web", | ||
| "robot-sdk", | ||
| "robotjs", | ||
| "robot sdk", | ||
| "UiPath Robot" | ||
| ], | ||
| "maintainers": [ | ||
| "vnaren23" | ||
| ], | ||
| "license": "See license in LICENSE file" | ||
| } |
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
552322
0.28%4097
0.54%