@uipath/robot
Advanced tools
| export declare enum JobSource { | ||
| Apps = "Apps", | ||
| RobotAPI = "RobotAPI" | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobSource = void 0; | ||
| /* @uipath-public */ | ||
| var JobSource; | ||
| (function (JobSource) { | ||
| JobSource["Apps"] = "Apps"; | ||
| JobSource["RobotAPI"] = "RobotAPI"; | ||
| })(JobSource = exports.JobSource || (exports.JobSource = {})); |
| /** | ||
| * Job state enum | ||
| */ | ||
| export declare enum JobState { | ||
| Executing = 0, | ||
| Closed = 1, | ||
| Canceled = 2, | ||
| Faulted = 3 | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobState = void 0; | ||
| /** | ||
| * Job state enum | ||
| */ | ||
| /* @uipath-internal */ | ||
| var JobState; | ||
| (function (JobState) { | ||
| JobState[JobState["Executing"] = 0] = "Executing"; | ||
| JobState[JobState["Closed"] = 1] = "Closed"; | ||
| JobState[JobState["Canceled"] = 2] = "Canceled"; | ||
| JobState[JobState["Faulted"] = 3] = "Faulted"; | ||
| })(JobState = exports.JobState || (exports.JobState = {})); |
| export declare enum TraceEvent { | ||
| Invalid_Event = "InvalidEvent", | ||
| Get_Port = "GetPort", | ||
| Get_Processes = "GetProcesses", | ||
| Init = "Init", | ||
| Run_Robot = "RunRobot", | ||
| Job_Status_Poll = "JobStatusPoll", | ||
| User_Consent_Raised = "UserConsentRaised", | ||
| Missing_Components = "MissingComponents", | ||
| Consent_Timeout = "ConsentTimeout", | ||
| Stop_Process = "StopProcess", | ||
| Install_Process = "InstallProcess", | ||
| Send_Client_Message = "SendClientMessage" | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.TraceEvent = void 0; | ||
| /* @uipath-internal */ | ||
| var TraceEvent; | ||
| (function (TraceEvent) { | ||
| TraceEvent["Invalid_Event"] = "InvalidEvent"; | ||
| TraceEvent["Get_Port"] = "GetPort"; | ||
| TraceEvent["Get_Processes"] = "GetProcesses"; | ||
| TraceEvent["Init"] = "Init"; | ||
| TraceEvent["Run_Robot"] = "RunRobot"; | ||
| TraceEvent["Job_Status_Poll"] = "JobStatusPoll"; | ||
| TraceEvent["User_Consent_Raised"] = "UserConsentRaised"; | ||
| TraceEvent["Missing_Components"] = "MissingComponents"; | ||
| TraceEvent["Consent_Timeout"] = "ConsentTimeout"; | ||
| TraceEvent["Stop_Process"] = "StopProcess"; | ||
| TraceEvent["Install_Process"] = "InstallProcess"; | ||
| TraceEvent["Send_Client_Message"] = "SendClientMessage"; | ||
| })(TraceEvent = exports.TraceEvent || (exports.TraceEvent = {})); |
| /** | ||
| * Client message data model. | ||
| */ | ||
| export declare class ClientMessageData { | ||
| channelName: string; | ||
| payload: string; | ||
| /** | ||
| * Default constructor | ||
| * @param channelName Client message channel name | ||
| * @param payload Client message payload | ||
| */ | ||
| constructor(channelName: string, payload: string); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ClientMessageData = void 0; | ||
| /** | ||
| * Client message data model. | ||
| */ | ||
| /* @uipath-internal */ | ||
| var ClientMessageData = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param channelName Client message channel name | ||
| * @param payload Client message payload | ||
| */ | ||
| function ClientMessageData(channelName, payload) { | ||
| this.channelName = channelName; | ||
| this.payload = payload; | ||
| } | ||
| return ClientMessageData; | ||
| }()); | ||
| exports.ClientMessageData = ClientMessageData; |
| export * from './job'; | ||
| export * from './jobPromise'; | ||
| export * from './jobResult'; | ||
| export * from './jobStatus'; | ||
| export * from './response'; | ||
| export * from './robotProcess'; | ||
| export * from './settings'; | ||
| export * from './serverFeatures'; | ||
| export * from './portResponse'; | ||
| export * from './workflowEventData'; | ||
| export * from './inputArgumentSchema'; | ||
| export * from './installProcessResult'; | ||
| export * from './clientMessageData'; |
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| __exportStar(require("./job"), exports); | ||
| __exportStar(require("./jobPromise"), exports); | ||
| __exportStar(require("./jobResult"), exports); | ||
| __exportStar(require("./jobStatus"), exports); | ||
| __exportStar(require("./response"), exports); | ||
| __exportStar(require("./robotProcess"), exports); | ||
| __exportStar(require("./settings"), exports); | ||
| __exportStar(require("./serverFeatures"), exports); | ||
| __exportStar(require("./portResponse"), exports); | ||
| __exportStar(require("./workflowEventData"), exports); | ||
| __exportStar(require("./inputArgumentSchema"), exports); | ||
| __exportStar(require("./installProcessResult"), exports); | ||
| __exportStar(require("./clientMessageData"), exports); |
| /** | ||
| * InputArgumentSchema returned by the installProcess request. | ||
| */ | ||
| export declare class InputArgumentSchema { | ||
| name: string; | ||
| type: string; | ||
| isRequired: boolean; | ||
| hasDefault: boolean; | ||
| /** | ||
| * @param name Input argument name | ||
| * @param type Input argument type | ||
| * @param isRequired Input argument is required | ||
| * @param hasDefault Input argument has default | ||
| */ | ||
| constructor(name: string, type: string, isRequired: boolean, hasDefault: boolean); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.InputArgumentSchema = void 0; | ||
| /** | ||
| * InputArgumentSchema returned by the installProcess request. | ||
| */ | ||
| /* @uipath-public */ | ||
| var InputArgumentSchema = /** @class */ (function () { | ||
| /** | ||
| * @param name Input argument name | ||
| * @param type Input argument type | ||
| * @param isRequired Input argument is required | ||
| * @param hasDefault Input argument has default | ||
| */ | ||
| /* @uipath-internal */ | ||
| function InputArgumentSchema(name, type, isRequired, hasDefault) { | ||
| this.name = name; | ||
| this.type = type; | ||
| this.isRequired = isRequired; | ||
| this.hasDefault = hasDefault; | ||
| this.name = name; | ||
| this.type = type; | ||
| this.isRequired = isRequired; | ||
| this.hasDefault = hasDefault; | ||
| } | ||
| return InputArgumentSchema; | ||
| }()); | ||
| exports.InputArgumentSchema = InputArgumentSchema; |
| import { InputArgumentSchema } from "."; | ||
| /** | ||
| * InstallProcessResult returned by the installProcess request. | ||
| */ | ||
| export declare class InstallProcessResult { | ||
| inputArgumentsSchema: InputArgumentSchema[]; | ||
| /** | ||
| * @param inputArgumentsSchema Input arguments schema | ||
| */ | ||
| constructor(inputArgumentsSchema: InputArgumentSchema[]); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.InstallProcessResult = void 0; | ||
| /** | ||
| * InstallProcessResult returned by the installProcess request. | ||
| */ | ||
| /* @uipath-public */ | ||
| var InstallProcessResult = /** @class */ (function () { | ||
| /** | ||
| * @param inputArgumentsSchema Input arguments schema | ||
| */ | ||
| /* @uipath-internal */ | ||
| function InstallProcessResult(inputArgumentsSchema) { | ||
| this.inputArgumentsSchema = inputArgumentsSchema; | ||
| this.inputArgumentsSchema = inputArgumentsSchema || []; | ||
| } | ||
| return InstallProcessResult; | ||
| }()); | ||
| exports.InstallProcessResult = InstallProcessResult; |
| import { WorkflowEventData } from '.'; | ||
| /** | ||
| * Job model used to identify a running/completed Robot process | ||
| */ | ||
| export declare class Job { | ||
| processId: string; | ||
| argument?: any; | ||
| jobId: string; | ||
| internalArguments?: string; | ||
| private eventHandlers; | ||
| /** | ||
| * Default constructor | ||
| * @param processId Unique GUID of the robot process to run. | ||
| * @param argument In arguments to be passed to the robot process on execution. | ||
| */ | ||
| constructor(processId: string, argument?: any); | ||
| /** | ||
| * Method to attach event handler on the job. | ||
| * @param eventName Available job events are: 'status', 'workflow-event'. | ||
| * @param eventHanlder Event handler callback function called when event occurs. | ||
| */ | ||
| on(eventName: string, eventHanlder: (argument?: any) => void): void; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param status argument to pass along while event is dispatched. | ||
| */ | ||
| dispatch: (status: string) => void; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param event argument to pass along while event is dispatched. | ||
| */ | ||
| dispatchEvent: (eventData: WorkflowEventData) => void; | ||
| /** | ||
| * Send a message to a running job. | ||
| * @param channelName | ||
| * @param payload | ||
| * @returns | ||
| */ | ||
| sendClientMessage: (channelName: string, payload: string) => Promise<void>; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Job = void 0; | ||
| var utils_1 = require("../utils"); | ||
| var constants_1 = require("../utils/constants"); | ||
| var uuid_1 = require("uuid"); | ||
| var uipathRobot_1 = require("../uipathRobot"); | ||
| /** | ||
| * Job model used to identify a running/completed Robot process | ||
| */ | ||
| /* @uipath-public */ | ||
| var Job = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param processId Unique GUID of the robot process to run. | ||
| * @param argument In arguments to be passed to the robot process on execution. | ||
| */ | ||
| function Job(processId, argument) { | ||
| var _this = this; | ||
| this.processId = processId; | ||
| this.argument = argument; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param status argument to pass along while event is dispatched. | ||
| */ | ||
| /* @uipath-internal */ | ||
| this.dispatch = function (status) { return _this.eventHandlers.dispatch(constants_1.Constants.STATUS, status); }; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param event argument to pass along while event is dispatched. | ||
| */ | ||
| /* @uipath-internal */ | ||
| this.dispatchEvent = function (eventData) { return _this.eventHandlers.dispatch(constants_1.Constants.WORKFLOW_EVENT, eventData); }; | ||
| /** | ||
| * Send a message to a running job. | ||
| * @param channelName | ||
| * @param payload | ||
| * @returns | ||
| */ | ||
| this.sendClientMessage = function (channelName, payload) { return uipathRobot_1.UiPathRobot.sendClientMessage(_this, channelName, payload); }; | ||
| this.jobId = uuid_1.v4(); | ||
| this.processId = processId; | ||
| this.argument = argument; | ||
| this.eventHandlers = new utils_1.Dispatcher(); | ||
| } | ||
| /** | ||
| * Method to attach event handler on the job. | ||
| * @param eventName Available job events are: 'status', 'workflow-event'. | ||
| * @param eventHanlder Event handler callback function called when event occurs. | ||
| */ | ||
| Job.prototype.on = function (eventName, eventHanlder) { | ||
| switch (eventName) { | ||
| case constants_1.Constants.STATUS: { | ||
| this.eventHandlers.on(constants_1.Constants.STATUS, eventHanlder); | ||
| break; | ||
| } | ||
| case constants_1.Constants.WORKFLOW_EVENT: { | ||
| this.eventHandlers.on(constants_1.Constants.WORKFLOW_EVENT, eventHanlder); | ||
| break; | ||
| } | ||
| default: { | ||
| break; | ||
| } | ||
| } | ||
| }; | ||
| return Job; | ||
| }()); | ||
| exports.Job = Job; |
| import { JobSource } from "../enums/jobSource"; | ||
| /** | ||
| * JobArguments sent with the InvokeRobot Request. | ||
| */ | ||
| export declare class JobArguments { | ||
| inputArgs: any; | ||
| internalArgs?: string | undefined; | ||
| jobSource?: JobSource | undefined; | ||
| constructor(inputArgs: any, internalArgs?: string | undefined, jobSource?: JobSource | undefined); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobArguments = void 0; | ||
| /** | ||
| * JobArguments sent with the InvokeRobot Request. | ||
| */ | ||
| /* @uipath-internal */ | ||
| var JobArguments = /** @class */ (function () { | ||
| function JobArguments(inputArgs, internalArgs, jobSource) { | ||
| this.inputArgs = inputArgs; | ||
| this.internalArgs = internalArgs; | ||
| this.jobSource = jobSource; | ||
| } | ||
| return JobArguments; | ||
| }()); | ||
| exports.JobArguments = JobArguments; |
| import { Job, JobResult } from './index'; | ||
| import { WorkflowEventData } from './workflowEventData'; | ||
| /** | ||
| * Job promise model used for resolution and/or rejection of Promise<JobResult> | ||
| */ | ||
| export declare class JobPromise implements Promise<JobResult> { | ||
| job: Job; | ||
| [Symbol.toStringTag]: string; | ||
| private promise; | ||
| /** | ||
| * Default constructor | ||
| * @param job Job to be wrapped with promise | ||
| */ | ||
| constructor(job: Job); | ||
| then<TResult1 = JobResult, TResult2 = never>(onfulfilled?: ((value: JobResult) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>; | ||
| catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<JobResult | TResult>; | ||
| finally(onfinally?: (() => void) | null | undefined): Promise<JobResult>; | ||
| /** | ||
| * Method to attach job status event handlers. | ||
| * @param eventHanlder Attaches callback which is invoked on job status change. | ||
| */ | ||
| onStatus: (eventHanlder: (argument?: any) => void) => this; | ||
| /** | ||
| * Method to attach job workflow event handlers. | ||
| * @param eventHandler Attaches callback which is invoked on job workflow event. | ||
| */ | ||
| onWorkflowEvent: (eventHandler: (argument: WorkflowEventData) => void) => this; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobPromise = void 0; | ||
| var uipathRobot_1 = require("../uipathRobot"); | ||
| var constants_1 = require("../utils/constants"); | ||
| /** | ||
| * Job promise model used for resolution and/or rejection of Promise<JobResult> | ||
| */ | ||
| /* @uipath-public */ | ||
| var JobPromise = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param job Job to be wrapped with promise | ||
| */ | ||
| /* @uipath-internal */ | ||
| function JobPromise(job) { | ||
| var _this = this; | ||
| this.job = job; | ||
| /** | ||
| * Method to attach job status event handlers. | ||
| * @param eventHanlder Attaches callback which is invoked on job status change. | ||
| */ | ||
| this.onStatus = function (eventHanlder) { | ||
| _this.job.on(constants_1.Constants.STATUS, eventHanlder); | ||
| return _this; | ||
| }; | ||
| /** | ||
| * Method to attach job workflow event handlers. | ||
| * @param eventHandler Attaches callback which is invoked on job workflow event. | ||
| */ | ||
| this.onWorkflowEvent = function (eventHandler) { | ||
| _this.job.on(constants_1.Constants.WORKFLOW_EVENT, eventHandler); | ||
| return _this; | ||
| }; | ||
| this.promise = uipathRobot_1.UiPathRobot.startJob(this.job); | ||
| } | ||
| JobPromise.prototype.then = function (onfulfilled, onrejected) { | ||
| return this.promise.then(onfulfilled, onrejected); | ||
| }; | ||
| JobPromise.prototype.catch = function (onrejected) { | ||
| return this.promise.catch(onrejected); | ||
| }; | ||
| JobPromise.prototype.finally = function (onfinally) { | ||
| return this.promise.finally(onfinally); | ||
| }; | ||
| return JobPromise; | ||
| }()); | ||
| exports.JobPromise = JobPromise; |
| /** | ||
| * Job result model containing all output arguments from the process. | ||
| * Empty if there are no out arguments. | ||
| */ | ||
| export declare class JobResult { | ||
| [Key: string]: any; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobResult = void 0; | ||
| /** | ||
| * Job result model containing all output arguments from the process. | ||
| * Empty if there are no out arguments. | ||
| */ | ||
| /* @uipath-public */ | ||
| var JobResult = /** @class */ (function () { | ||
| function JobResult() { | ||
| } | ||
| return JobResult; | ||
| }()); | ||
| exports.JobResult = JobResult; |
| import { WorkflowEventData } from './workflowEventData'; | ||
| /** | ||
| * Job status model containing details of the executing job. | ||
| */ | ||
| export declare class JobStatus { | ||
| state: string; | ||
| status: string[]; | ||
| events: WorkflowEventData[]; | ||
| output: any; | ||
| exception: any; | ||
| /** | ||
| * | ||
| * @param state Current state of the job | ||
| * @param status Current status of the job | ||
| * @param events Workflow events sent by the job | ||
| * @param output Output of the job if any | ||
| * @param exception Exception from the job if any | ||
| */ | ||
| constructor(state: string, status: string[], events: WorkflowEventData[], output: any, exception: any); | ||
| get isExecuting(): boolean; | ||
| get isClosed(): boolean; | ||
| get errorResponse(): any; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobStatus = void 0; | ||
| /** | ||
| * Job status model containing details of the executing job. | ||
| */ | ||
| /* @uipath-internal */ | ||
| var JobStatus = /** @class */ (function () { | ||
| /** | ||
| * | ||
| * @param state Current state of the job | ||
| * @param status Current status of the job | ||
| * @param events Workflow events sent by the job | ||
| * @param output Output of the job if any | ||
| * @param exception Exception from the job if any | ||
| */ | ||
| function JobStatus(state, status, events, output, exception) { | ||
| this.state = state; | ||
| this.status = status; | ||
| this.events = events; | ||
| this.output = output; | ||
| this.exception = exception; | ||
| this.events = events || []; | ||
| this.output = output || undefined; | ||
| this.exception = exception || undefined; | ||
| } | ||
| Object.defineProperty(JobStatus.prototype, "isExecuting", { | ||
| get: function () { return this.state === 'Executing'; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(JobStatus.prototype, "isClosed", { | ||
| get: function () { return this.state === 'Closed'; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(JobStatus.prototype, "errorResponse", { | ||
| get: function () { | ||
| if (this.exception) { | ||
| this.exception.state = this.state; | ||
| } | ||
| else { | ||
| this.exception = { 'state': this.state }; | ||
| } | ||
| return this.exception; | ||
| }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| return JobStatus; | ||
| }()); | ||
| exports.JobStatus = JobStatus; |
| /** | ||
| * PortResponse returned by the getPort Request. | ||
| */ | ||
| export declare class PortResponse { | ||
| port: number; | ||
| serverFeatures: string[]; | ||
| constructor(); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.PortResponse = void 0; | ||
| /** | ||
| * PortResponse returned by the getPort Request. | ||
| */ | ||
| /* @uipath-internal */ | ||
| var PortResponse = /** @class */ (function () { | ||
| function PortResponse() { | ||
| this.port = 0; | ||
| this.serverFeatures = []; | ||
| } | ||
| return PortResponse; | ||
| }()); | ||
| exports.PortResponse = PortResponse; |
| import { Deferred } from '../utils'; | ||
| /** | ||
| * Generic response model | ||
| */ | ||
| export declare class Response<T> { | ||
| private httpStatus; | ||
| statusText: string; | ||
| isDomainAllowed: boolean; | ||
| data?: T | undefined; | ||
| error?: string | undefined; | ||
| /** | ||
| * | ||
| * @param httpStatus Http status of the response | ||
| * @param statusText Http status text of the response | ||
| * @param isDomainAllowed Flag returned by the Server, saying if the domain is allowed by configuration | ||
| * @param data Response data if any | ||
| * @param error Handled error response if any | ||
| */ | ||
| constructor(httpStatus: number, statusText: string, isDomainAllowed: boolean, data?: T | undefined, error?: string | undefined); | ||
| get isSuccess(): boolean; | ||
| get isUnauthorized(): boolean; | ||
| get isForbidden(): boolean; | ||
| get isEmpty(): boolean; | ||
| get isNotFound(): boolean; | ||
| /** | ||
| * Resolve promise if its a successful response. Throws error if response was unsuccessful. | ||
| * @param promise promise which will be resolved if response was successful. | ||
| */ | ||
| resolve: (promise: Deferred<T>) => void; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Response = void 0; | ||
| /** | ||
| * Generic response model | ||
| */ | ||
| /* @uipath-internal */ | ||
| var Response = /** @class */ (function () { | ||
| /** | ||
| * | ||
| * @param httpStatus Http status of the response | ||
| * @param statusText Http status text of the response | ||
| * @param isDomainAllowed Flag returned by the Server, saying if the domain is allowed by configuration | ||
| * @param data Response data if any | ||
| * @param error Handled error response if any | ||
| */ | ||
| function Response(httpStatus, statusText, isDomainAllowed, data, error) { | ||
| var _this = this; | ||
| this.httpStatus = httpStatus; | ||
| this.statusText = statusText; | ||
| this.isDomainAllowed = isDomainAllowed; | ||
| this.data = data; | ||
| this.error = error; | ||
| /** | ||
| * Resolve promise if its a successful response. Throws error if response was unsuccessful. | ||
| * @param promise promise which will be resolved if response was successful. | ||
| */ | ||
| this.resolve = function (promise) { | ||
| if (_this.isSuccess) { | ||
| promise.resolve(_this.data); | ||
| } | ||
| else { | ||
| promise.reject(new Error(_this.httpStatus + " - " + _this.error)); | ||
| } | ||
| }; | ||
| this.data = data || undefined; | ||
| } | ||
| Object.defineProperty(Response.prototype, "isSuccess", { | ||
| get: function () { return this.httpStatus >= 200 && this.httpStatus < 300; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isUnauthorized", { | ||
| get: function () { return this.httpStatus === 401; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isForbidden", { | ||
| get: function () { return this.httpStatus === 403; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isEmpty", { | ||
| get: function () { return this.httpStatus === 0; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isNotFound", { | ||
| get: function () { return this.httpStatus === 404; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| return Response; | ||
| }()); | ||
| exports.Response = Response; |
| import { JobPromise } from '../models'; | ||
| import { InstallProcessResult } from './installProcessResult'; | ||
| /** | ||
| * Robot process model containing details of the robot process available in current system | ||
| */ | ||
| export declare class RobotProcess { | ||
| id: string; | ||
| name: string; | ||
| description: string | undefined; | ||
| /** | ||
| * Default constructor | ||
| * @param id Unique id of the robot process | ||
| * @param name Robot Process name | ||
| * @param description Process Description | ||
| */ | ||
| constructor(id: string, name: string, description?: string | undefined); | ||
| /** | ||
| * Start the robot process | ||
| * @param inArguments JSON object. In arguments to be passed to the robot if any. | ||
| */ | ||
| start: (inArguments?: any) => JobPromise; | ||
| /** | ||
| * Install the robot process | ||
| */ | ||
| install: () => Promise<InstallProcessResult>; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.RobotProcess = void 0; | ||
| var uipathRobot_1 = require("../uipathRobot"); | ||
| var models_1 = require("../models"); | ||
| /** | ||
| * Robot process model containing details of the robot process available in current system | ||
| */ | ||
| /* @uipath-public */ | ||
| var RobotProcess = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param id Unique id of the robot process | ||
| * @param name Robot Process name | ||
| * @param description Process Description | ||
| */ | ||
| /* @uipath-internal */ | ||
| function RobotProcess(id, name, description) { | ||
| var _this = this; | ||
| if (description === void 0) { description = undefined; } | ||
| this.id = id; | ||
| this.name = name; | ||
| this.description = description; | ||
| /** | ||
| * Start the robot process | ||
| * @param inArguments JSON object. In arguments to be passed to the robot if any. | ||
| */ | ||
| this.start = function (inArguments) { return new models_1.JobPromise(new models_1.Job(_this.id, inArguments)); }; | ||
| /** | ||
| * Install the robot process | ||
| */ | ||
| this.install = function () { return uipathRobot_1.UiPathRobot.installProcess(_this.id); }; | ||
| } | ||
| return RobotProcess; | ||
| }()); | ||
| exports.RobotProcess = RobotProcess; |
| /** | ||
| * ServerFeatures class used to maintain compatibility between different versions of client and server | ||
| */ | ||
| export declare class ServerFeatures { | ||
| private serverFeatures; | ||
| jobStatusUsesLongPolling: boolean; | ||
| installProcess: boolean; | ||
| useGivenJobId: boolean; | ||
| internalArguments: boolean; | ||
| clientMessage: boolean; | ||
| /** | ||
| * Default constructor | ||
| */ | ||
| constructor(serverFeatures: string[]); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ServerFeatures = void 0; | ||
| /** | ||
| * ServerFeatures class used to maintain compatibility between different versions of client and server | ||
| */ | ||
| /* @uipath-internal */ | ||
| var ServerFeatures = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| */ | ||
| function ServerFeatures(serverFeatures) { | ||
| this.serverFeatures = serverFeatures; | ||
| this.jobStatusUsesLongPolling = this.serverFeatures.includes('JobStatus_LongPolling'); | ||
| this.installProcess = this.serverFeatures.includes('InstallProcess'); | ||
| this.useGivenJobId = this.serverFeatures.includes('UseGivenJobId'); | ||
| this.internalArguments = this.serverFeatures.includes('InternalArguments'); | ||
| this.clientMessage = this.serverFeatures.includes('ClientMessage'); | ||
| } | ||
| return ServerFeatures; | ||
| }()); | ||
| exports.ServerFeatures = ServerFeatures; |
| import { JobSource } from "../enums/jobSource"; | ||
| /** | ||
| * Settings class used to change default settings of Js SDK | ||
| */ | ||
| export declare class Settings { | ||
| portNumber: number; | ||
| pollTimeInterval: number; | ||
| disableTelemetry: boolean; | ||
| jobSource: JobSource; | ||
| appOrigin: string; | ||
| /** | ||
| * Default constructor | ||
| * @param portNumber Port number of the Http listener | ||
| * @param pollTimeInterval Poll interval time. | ||
| * @param disableTelemetry Flag to disable sending telemetry events | ||
| * @param jobSource JobSource for Telemetry; default value is RobotAPI; added in SDK version 1.2.10. | ||
| */ | ||
| constructor(portNumber: number, pollTimeInterval: number, disableTelemetry: boolean, jobSource: JobSource); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Settings = void 0; | ||
| /** | ||
| * Settings class used to change default settings of Js SDK | ||
| */ | ||
| /* @uipath-public */ | ||
| var Settings = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param portNumber Port number of the Http listener | ||
| * @param pollTimeInterval Poll interval time. | ||
| * @param disableTelemetry Flag to disable sending telemetry events | ||
| * @param jobSource JobSource for Telemetry; default value is RobotAPI; added in SDK version 1.2.10. | ||
| */ | ||
| /* @uipath-internal */ | ||
| function Settings(portNumber, pollTimeInterval, disableTelemetry, jobSource) { | ||
| this.portNumber = portNumber; | ||
| this.pollTimeInterval = pollTimeInterval; | ||
| this.disableTelemetry = disableTelemetry; | ||
| this.jobSource = jobSource; | ||
| this.appOrigin = window.location.origin; | ||
| } | ||
| return Settings; | ||
| }()); | ||
| exports.Settings = Settings; |
| /** | ||
| * Workflow event data model. | ||
| */ | ||
| export declare class WorkflowEventData { | ||
| name: string; | ||
| payload: string; | ||
| /** | ||
| * Default constructor | ||
| * @param name Workflow event name | ||
| * @param payload Workflow event payload | ||
| */ | ||
| constructor(name: string, payload: string); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.WorkflowEventData = void 0; | ||
| /** | ||
| * Workflow event data model. | ||
| */ | ||
| /* @uipath-public */ | ||
| var WorkflowEventData = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param name Workflow event name | ||
| * @param payload Workflow event payload | ||
| */ | ||
| /* @uipath-internal */ | ||
| function WorkflowEventData(name, payload) { | ||
| this.name = name; | ||
| this.payload = payload; | ||
| } | ||
| return WorkflowEventData; | ||
| }()); | ||
| exports.WorkflowEventData = WorkflowEventData; |
@@ -11,2 +11,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var ClientMessageRequest = /** @class */ (function () { | ||
@@ -13,0 +14,0 @@ /** |
@@ -11,2 +11,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var InstallProcessRequest = /** @class */ (function () { | ||
@@ -13,0 +14,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
| import { JobSource } from '../../Enums/jobSource'; | ||
| import { JobSource } from '../../enums/jobSource'; | ||
| import { Job, Response, ServerFeatures } from '../../models/index'; | ||
@@ -3,0 +3,0 @@ import { IRequest } from '../iRequest'; |
@@ -5,3 +5,3 @@ "use strict"; | ||
| var index_1 = require("../../models/index"); | ||
| var jobArguments_1 = require("../../Models/jobArguments"); | ||
| var jobArguments_1 = require("../../models/jobArguments"); | ||
| var utils_1 = require("../../utils"); | ||
@@ -12,2 +12,3 @@ var constants_1 = require("../../utils/constants"); | ||
| */ | ||
| /* @uipath-internal */ | ||
| var InvokeRobotRequest = /** @class */ (function () { | ||
@@ -14,0 +15,0 @@ /** |
@@ -12,2 +12,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var JobStatusRequest = /** @class */ (function () { | ||
@@ -14,0 +15,0 @@ /** |
@@ -10,2 +10,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var PortRequest = /** @class */ (function () { | ||
@@ -12,0 +13,0 @@ /** |
@@ -7,2 +7,3 @@ "use strict"; | ||
| var constants_1 = require("../../utils/constants"); | ||
| /* @uipath-internal */ | ||
| var RobotProcessRequest = /** @class */ (function () { | ||
@@ -9,0 +10,0 @@ /** |
@@ -10,2 +10,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var StopProcessRequest = /** @class */ (function () { | ||
@@ -12,0 +13,0 @@ /** |
@@ -48,6 +48,7 @@ "use strict"; | ||
| var async_mutex_1 = require("async-mutex"); | ||
| var jobSource_1 = require("../Enums/jobSource"); | ||
| var jobSource_1 = require("../enums/jobSource"); | ||
| /** | ||
| * Robot SDK class | ||
| */ | ||
| /* @uipath-internal */ | ||
| var RobotSDK = /** @class */ (function () { | ||
@@ -487,2 +488,3 @@ function RobotSDK() { | ||
| */ | ||
| /* @uipath-internal */ | ||
| var SDK = /** @class */ (function () { | ||
@@ -489,0 +491,0 @@ function SDK() { |
@@ -9,2 +9,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-public */ | ||
| var UiPathRobot; | ||
@@ -11,0 +12,0 @@ (function (UiPathRobot) { |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Constants = void 0; | ||
| /* @uipath-internal */ | ||
| var Constants = /** @class */ (function () { | ||
@@ -5,0 +6,0 @@ function Constants() { |
@@ -7,2 +7,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var Deferred = /** @class */ (function () { | ||
@@ -9,0 +10,0 @@ function Deferred() { |
@@ -7,2 +7,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var Dispatcher = /** @class */ (function () { | ||
@@ -9,0 +10,0 @@ function Dispatcher() { |
@@ -9,2 +9,3 @@ "use strict"; | ||
| var constants_1 = require("../utils/constants"); | ||
| /* @uipath-internal */ | ||
| var HttpUtil = /** @class */ (function () { | ||
@@ -11,0 +12,0 @@ function HttpUtil() { |
@@ -9,2 +9,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var AppInsightsLogger = /** @class */ (function () { | ||
@@ -11,0 +12,0 @@ function AppInsightsLogger(settings) { |
@@ -8,2 +8,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var PollUtil = /** @class */ (function () { | ||
@@ -10,0 +11,0 @@ function PollUtil() { |
@@ -8,2 +8,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var ProtocolUtil = /** @class */ (function () { | ||
@@ -10,0 +11,0 @@ function ProtocolUtil() { |
@@ -7,2 +7,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var RandomUtil = /** @class */ (function () { | ||
@@ -9,0 +10,0 @@ function RandomUtil() { |
@@ -7,2 +7,3 @@ "use strict"; | ||
| */ | ||
| /* @uipath-internal */ | ||
| var UrlUtil = /** @class */ (function () { | ||
@@ -9,0 +10,0 @@ function UrlUtil() { |
@@ -1,1 +0,1 @@ | ||
| export declare const ROBOTJS_VERSION = "1.3.0"; | ||
| export declare const ROBOTJS_VERSION = "1.3.1"; |
+1
-1
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ROBOTJS_VERSION = void 0; | ||
| exports.ROBOTJS_VERSION = '1.3.0'; | ||
| exports.ROBOTJS_VERSION = '1.3.1'; |
+1
-1
| { | ||
| "name": "@uipath/robot", | ||
| "version": "1.3.0", | ||
| "version": "1.3.1", | ||
| "description": "UiPath Robot javascript SDK enabling web pages to interact with UiPath Robots", | ||
@@ -5,0 +5,0 @@ "scripts": { |
| export declare enum JobSource { | ||
| Apps = "Apps", | ||
| RobotAPI = "RobotAPI" | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobSource = void 0; | ||
| var JobSource; | ||
| (function (JobSource) { | ||
| JobSource["Apps"] = "Apps"; | ||
| JobSource["RobotAPI"] = "RobotAPI"; | ||
| })(JobSource = exports.JobSource || (exports.JobSource = {})); |
| /** | ||
| * Job state enum | ||
| */ | ||
| export declare enum JobState { | ||
| Executing = 0, | ||
| Closed = 1, | ||
| Canceled = 2, | ||
| Faulted = 3 | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobState = void 0; | ||
| /** | ||
| * Job state enum | ||
| */ | ||
| var JobState; | ||
| (function (JobState) { | ||
| JobState[JobState["Executing"] = 0] = "Executing"; | ||
| JobState[JobState["Closed"] = 1] = "Closed"; | ||
| JobState[JobState["Canceled"] = 2] = "Canceled"; | ||
| JobState[JobState["Faulted"] = 3] = "Faulted"; | ||
| })(JobState = exports.JobState || (exports.JobState = {})); |
| export declare enum TraceEvent { | ||
| Invalid_Event = "InvalidEvent", | ||
| Get_Port = "GetPort", | ||
| Get_Processes = "GetProcesses", | ||
| Init = "Init", | ||
| Run_Robot = "RunRobot", | ||
| Job_Status_Poll = "JobStatusPoll", | ||
| User_Consent_Raised = "UserConsentRaised", | ||
| Missing_Components = "MissingComponents", | ||
| Consent_Timeout = "ConsentTimeout", | ||
| Stop_Process = "StopProcess", | ||
| Install_Process = "InstallProcess", | ||
| Send_Client_Message = "SendClientMessage" | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.TraceEvent = void 0; | ||
| var TraceEvent; | ||
| (function (TraceEvent) { | ||
| TraceEvent["Invalid_Event"] = "InvalidEvent"; | ||
| TraceEvent["Get_Port"] = "GetPort"; | ||
| TraceEvent["Get_Processes"] = "GetProcesses"; | ||
| TraceEvent["Init"] = "Init"; | ||
| TraceEvent["Run_Robot"] = "RunRobot"; | ||
| TraceEvent["Job_Status_Poll"] = "JobStatusPoll"; | ||
| TraceEvent["User_Consent_Raised"] = "UserConsentRaised"; | ||
| TraceEvent["Missing_Components"] = "MissingComponents"; | ||
| TraceEvent["Consent_Timeout"] = "ConsentTimeout"; | ||
| TraceEvent["Stop_Process"] = "StopProcess"; | ||
| TraceEvent["Install_Process"] = "InstallProcess"; | ||
| TraceEvent["Send_Client_Message"] = "SendClientMessage"; | ||
| })(TraceEvent = exports.TraceEvent || (exports.TraceEvent = {})); |
| /** | ||
| * Client message data model. | ||
| */ | ||
| export declare class ClientMessageData { | ||
| channelName: string; | ||
| payload: string; | ||
| /** | ||
| * Default constructor | ||
| * @param channelName Client message channel name | ||
| * @param payload Client message payload | ||
| */ | ||
| constructor(channelName: string, payload: string); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ClientMessageData = void 0; | ||
| /** | ||
| * Client message data model. | ||
| */ | ||
| var ClientMessageData = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param channelName Client message channel name | ||
| * @param payload Client message payload | ||
| */ | ||
| function ClientMessageData(channelName, payload) { | ||
| this.channelName = channelName; | ||
| this.payload = payload; | ||
| } | ||
| return ClientMessageData; | ||
| }()); | ||
| exports.ClientMessageData = ClientMessageData; |
| export * from './job'; | ||
| export * from './jobPromise'; | ||
| export * from './jobResult'; | ||
| export * from './jobStatus'; | ||
| export * from './response'; | ||
| export * from './robotProcess'; | ||
| export * from './settings'; | ||
| export * from './serverFeatures'; | ||
| export * from './portResponse'; | ||
| export * from './workflowEventData'; | ||
| export * from './inputArgumentSchema'; | ||
| export * from './installProcessResult'; | ||
| export * from './clientMessageData'; |
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| __exportStar(require("./job"), exports); | ||
| __exportStar(require("./jobPromise"), exports); | ||
| __exportStar(require("./jobResult"), exports); | ||
| __exportStar(require("./jobStatus"), exports); | ||
| __exportStar(require("./response"), exports); | ||
| __exportStar(require("./robotProcess"), exports); | ||
| __exportStar(require("./settings"), exports); | ||
| __exportStar(require("./serverFeatures"), exports); | ||
| __exportStar(require("./portResponse"), exports); | ||
| __exportStar(require("./workflowEventData"), exports); | ||
| __exportStar(require("./inputArgumentSchema"), exports); | ||
| __exportStar(require("./installProcessResult"), exports); | ||
| __exportStar(require("./clientMessageData"), exports); |
| /** | ||
| * InputArgumentSchema returned by the installProcess request. | ||
| */ | ||
| export declare class InputArgumentSchema { | ||
| name: string; | ||
| type: string; | ||
| isRequired: boolean; | ||
| hasDefault: boolean; | ||
| /** | ||
| * @param name Input argument name | ||
| * @param type Input argument type | ||
| * @param isRequired Input argument is required | ||
| * @param hasDefault Input argument has default | ||
| */ | ||
| constructor(name: string, type: string, isRequired: boolean, hasDefault: boolean); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.InputArgumentSchema = void 0; | ||
| /** | ||
| * InputArgumentSchema returned by the installProcess request. | ||
| */ | ||
| var InputArgumentSchema = /** @class */ (function () { | ||
| /** | ||
| * @param name Input argument name | ||
| * @param type Input argument type | ||
| * @param isRequired Input argument is required | ||
| * @param hasDefault Input argument has default | ||
| */ | ||
| function InputArgumentSchema(name, type, isRequired, hasDefault) { | ||
| this.name = name; | ||
| this.type = type; | ||
| this.isRequired = isRequired; | ||
| this.hasDefault = hasDefault; | ||
| this.name = name; | ||
| this.type = type; | ||
| this.isRequired = isRequired; | ||
| this.hasDefault = hasDefault; | ||
| } | ||
| return InputArgumentSchema; | ||
| }()); | ||
| exports.InputArgumentSchema = InputArgumentSchema; |
| import { InputArgumentSchema } from "."; | ||
| /** | ||
| * InstallProcessResult returned by the installProcess request. | ||
| */ | ||
| export declare class InstallProcessResult { | ||
| inputArgumentsSchema: InputArgumentSchema[]; | ||
| /** | ||
| * @param inputArgumentsSchema Input arguments schema | ||
| */ | ||
| constructor(inputArgumentsSchema: InputArgumentSchema[]); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.InstallProcessResult = void 0; | ||
| /** | ||
| * InstallProcessResult returned by the installProcess request. | ||
| */ | ||
| var InstallProcessResult = /** @class */ (function () { | ||
| /** | ||
| * @param inputArgumentsSchema Input arguments schema | ||
| */ | ||
| function InstallProcessResult(inputArgumentsSchema) { | ||
| this.inputArgumentsSchema = inputArgumentsSchema; | ||
| this.inputArgumentsSchema = inputArgumentsSchema || []; | ||
| } | ||
| return InstallProcessResult; | ||
| }()); | ||
| exports.InstallProcessResult = InstallProcessResult; |
| import { WorkflowEventData } from '.'; | ||
| /** | ||
| * Job model used to identify a running/completed Robot process | ||
| */ | ||
| export declare class Job { | ||
| processId: string; | ||
| argument?: any; | ||
| jobId: string; | ||
| internalArguments?: string; | ||
| private eventHandlers; | ||
| /** | ||
| * Default constructor | ||
| * @param processId Unique GUID of the robot process to run. | ||
| * @param argument In arguments to be passed to the robot process on execution. | ||
| */ | ||
| constructor(processId: string, argument?: any); | ||
| /** | ||
| * Method to attach event handler on the job. | ||
| * @param eventName Available job events are: 'status', 'workflow-event'. | ||
| * @param eventHanlder Event handler callback function called when event occurs. | ||
| */ | ||
| on(eventName: string, eventHanlder: (argument?: any) => void): void; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param status argument to pass along while event is dispatched. | ||
| */ | ||
| dispatch: (status: string) => void; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param event argument to pass along while event is dispatched. | ||
| */ | ||
| dispatchEvent: (eventData: WorkflowEventData) => void; | ||
| /** | ||
| * Send a message to a running job. | ||
| * @param channelName | ||
| * @param payload | ||
| * @returns | ||
| */ | ||
| sendClientMessage: (channelName: string, payload: string) => Promise<void>; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Job = void 0; | ||
| var utils_1 = require("../utils"); | ||
| var constants_1 = require("../utils/constants"); | ||
| var uuid_1 = require("uuid"); | ||
| var uipathRobot_1 = require("../uipathRobot"); | ||
| /** | ||
| * Job model used to identify a running/completed Robot process | ||
| */ | ||
| var Job = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param processId Unique GUID of the robot process to run. | ||
| * @param argument In arguments to be passed to the robot process on execution. | ||
| */ | ||
| function Job(processId, argument) { | ||
| var _this = this; | ||
| this.processId = processId; | ||
| this.argument = argument; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param status argument to pass along while event is dispatched. | ||
| */ | ||
| this.dispatch = function (status) { return _this.eventHandlers.dispatch(constants_1.Constants.STATUS, status); }; | ||
| /** | ||
| * Dispatch method to trigger events. | ||
| * @param event argument to pass along while event is dispatched. | ||
| */ | ||
| this.dispatchEvent = function (eventData) { return _this.eventHandlers.dispatch(constants_1.Constants.WORKFLOW_EVENT, eventData); }; | ||
| /** | ||
| * Send a message to a running job. | ||
| * @param channelName | ||
| * @param payload | ||
| * @returns | ||
| */ | ||
| this.sendClientMessage = function (channelName, payload) { return uipathRobot_1.UiPathRobot.sendClientMessage(_this, channelName, payload); }; | ||
| this.jobId = uuid_1.v4(); | ||
| this.processId = processId; | ||
| this.argument = argument; | ||
| this.eventHandlers = new utils_1.Dispatcher(); | ||
| } | ||
| /** | ||
| * Method to attach event handler on the job. | ||
| * @param eventName Available job events are: 'status', 'workflow-event'. | ||
| * @param eventHanlder Event handler callback function called when event occurs. | ||
| */ | ||
| Job.prototype.on = function (eventName, eventHanlder) { | ||
| switch (eventName) { | ||
| case constants_1.Constants.STATUS: { | ||
| this.eventHandlers.on(constants_1.Constants.STATUS, eventHanlder); | ||
| break; | ||
| } | ||
| case constants_1.Constants.WORKFLOW_EVENT: { | ||
| this.eventHandlers.on(constants_1.Constants.WORKFLOW_EVENT, eventHanlder); | ||
| break; | ||
| } | ||
| default: { | ||
| break; | ||
| } | ||
| } | ||
| }; | ||
| return Job; | ||
| }()); | ||
| exports.Job = Job; |
| import { JobSource } from "../Enums/jobSource"; | ||
| /** | ||
| * JobArguments sent with the InvokeRobot Request. | ||
| */ | ||
| export declare class JobArguments { | ||
| inputArgs: any; | ||
| internalArgs?: string | undefined; | ||
| jobSource?: JobSource | undefined; | ||
| constructor(inputArgs: any, internalArgs?: string | undefined, jobSource?: JobSource | undefined); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobArguments = void 0; | ||
| /** | ||
| * JobArguments sent with the InvokeRobot Request. | ||
| */ | ||
| var JobArguments = /** @class */ (function () { | ||
| function JobArguments(inputArgs, internalArgs, jobSource) { | ||
| this.inputArgs = inputArgs; | ||
| this.internalArgs = internalArgs; | ||
| this.jobSource = jobSource; | ||
| } | ||
| return JobArguments; | ||
| }()); | ||
| exports.JobArguments = JobArguments; |
| import { Job, JobResult } from './index'; | ||
| import { WorkflowEventData } from './workflowEventData'; | ||
| /** | ||
| * Job promise model used for resolution and/or rejection of Promise<JobResult> | ||
| */ | ||
| export declare class JobPromise implements Promise<JobResult> { | ||
| job: Job; | ||
| [Symbol.toStringTag]: string; | ||
| private promise; | ||
| /** | ||
| * Default constructor | ||
| * @param job Job to be wrapped with promise | ||
| */ | ||
| constructor(job: Job); | ||
| then<TResult1 = JobResult, TResult2 = never>(onfulfilled?: ((value: JobResult) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>; | ||
| catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<JobResult | TResult>; | ||
| finally(onfinally?: (() => void) | null | undefined): Promise<JobResult>; | ||
| /** | ||
| * Method to attach job status event handlers. | ||
| * @param eventHanlder Attaches callback which is invoked on job status change. | ||
| */ | ||
| onStatus: (eventHanlder: (argument?: any) => void) => this; | ||
| /** | ||
| * Method to attach job workflow event handlers. | ||
| * @param eventHandler Attaches callback which is invoked on job workflow event. | ||
| */ | ||
| onWorkflowEvent: (eventHandler: (argument: WorkflowEventData) => void) => this; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobPromise = void 0; | ||
| var uipathRobot_1 = require("../uipathRobot"); | ||
| var constants_1 = require("../utils/constants"); | ||
| /** | ||
| * Job promise model used for resolution and/or rejection of Promise<JobResult> | ||
| */ | ||
| var JobPromise = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param job Job to be wrapped with promise | ||
| */ | ||
| function JobPromise(job) { | ||
| var _this = this; | ||
| this.job = job; | ||
| /** | ||
| * Method to attach job status event handlers. | ||
| * @param eventHanlder Attaches callback which is invoked on job status change. | ||
| */ | ||
| this.onStatus = function (eventHanlder) { | ||
| _this.job.on(constants_1.Constants.STATUS, eventHanlder); | ||
| return _this; | ||
| }; | ||
| /** | ||
| * Method to attach job workflow event handlers. | ||
| * @param eventHandler Attaches callback which is invoked on job workflow event. | ||
| */ | ||
| this.onWorkflowEvent = function (eventHandler) { | ||
| _this.job.on(constants_1.Constants.WORKFLOW_EVENT, eventHandler); | ||
| return _this; | ||
| }; | ||
| this.promise = uipathRobot_1.UiPathRobot.startJob(this.job); | ||
| } | ||
| JobPromise.prototype.then = function (onfulfilled, onrejected) { | ||
| return this.promise.then(onfulfilled, onrejected); | ||
| }; | ||
| JobPromise.prototype.catch = function (onrejected) { | ||
| return this.promise.catch(onrejected); | ||
| }; | ||
| JobPromise.prototype.finally = function (onfinally) { | ||
| return this.promise.finally(onfinally); | ||
| }; | ||
| return JobPromise; | ||
| }()); | ||
| exports.JobPromise = JobPromise; |
| /** | ||
| * Job result model containing all output arguments from the process. | ||
| * Empty if there are no out arguments. | ||
| */ | ||
| export declare class JobResult { | ||
| [Key: string]: any; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobResult = void 0; | ||
| /** | ||
| * Job result model containing all output arguments from the process. | ||
| * Empty if there are no out arguments. | ||
| */ | ||
| var JobResult = /** @class */ (function () { | ||
| function JobResult() { | ||
| } | ||
| return JobResult; | ||
| }()); | ||
| exports.JobResult = JobResult; |
| import { WorkflowEventData } from './workflowEventData'; | ||
| /** | ||
| * Job status model containing details of the executing job. | ||
| */ | ||
| export declare class JobStatus { | ||
| state: string; | ||
| status: string[]; | ||
| events: WorkflowEventData[]; | ||
| output: any; | ||
| exception: any; | ||
| /** | ||
| * | ||
| * @param state Current state of the job | ||
| * @param status Current status of the job | ||
| * @param events Workflow events sent by the job | ||
| * @param output Output of the job if any | ||
| * @param exception Exception from the job if any | ||
| */ | ||
| constructor(state: string, status: string[], events: WorkflowEventData[], output: any, exception: any); | ||
| get isExecuting(): boolean; | ||
| get isClosed(): boolean; | ||
| get errorResponse(): any; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.JobStatus = void 0; | ||
| /** | ||
| * Job status model containing details of the executing job. | ||
| */ | ||
| var JobStatus = /** @class */ (function () { | ||
| /** | ||
| * | ||
| * @param state Current state of the job | ||
| * @param status Current status of the job | ||
| * @param events Workflow events sent by the job | ||
| * @param output Output of the job if any | ||
| * @param exception Exception from the job if any | ||
| */ | ||
| function JobStatus(state, status, events, output, exception) { | ||
| this.state = state; | ||
| this.status = status; | ||
| this.events = events; | ||
| this.output = output; | ||
| this.exception = exception; | ||
| this.events = events || []; | ||
| this.output = output || undefined; | ||
| this.exception = exception || undefined; | ||
| } | ||
| Object.defineProperty(JobStatus.prototype, "isExecuting", { | ||
| get: function () { return this.state === 'Executing'; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(JobStatus.prototype, "isClosed", { | ||
| get: function () { return this.state === 'Closed'; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(JobStatus.prototype, "errorResponse", { | ||
| get: function () { | ||
| if (this.exception) { | ||
| this.exception.state = this.state; | ||
| } | ||
| else { | ||
| this.exception = { 'state': this.state }; | ||
| } | ||
| return this.exception; | ||
| }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| return JobStatus; | ||
| }()); | ||
| exports.JobStatus = JobStatus; |
| /** | ||
| * PortResponse returned by the getPort Request. | ||
| */ | ||
| export declare class PortResponse { | ||
| port: number; | ||
| serverFeatures: string[]; | ||
| constructor(); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.PortResponse = void 0; | ||
| /** | ||
| * PortResponse returned by the getPort Request. | ||
| */ | ||
| var PortResponse = /** @class */ (function () { | ||
| function PortResponse() { | ||
| this.port = 0; | ||
| this.serverFeatures = []; | ||
| } | ||
| return PortResponse; | ||
| }()); | ||
| exports.PortResponse = PortResponse; |
| import { Deferred } from '../utils'; | ||
| /** | ||
| * Generic response model | ||
| */ | ||
| export declare class Response<T> { | ||
| private httpStatus; | ||
| statusText: string; | ||
| isDomainAllowed: boolean; | ||
| data?: T | undefined; | ||
| error?: string | undefined; | ||
| /** | ||
| * | ||
| * @param httpStatus Http status of the response | ||
| * @param statusText Http status text of the response | ||
| * @param isDomainAllowed Flag returned by the Server, saying if the domain is allowed by configuration | ||
| * @param data Response data if any | ||
| * @param error Handled error response if any | ||
| */ | ||
| constructor(httpStatus: number, statusText: string, isDomainAllowed: boolean, data?: T | undefined, error?: string | undefined); | ||
| get isSuccess(): boolean; | ||
| get isUnauthorized(): boolean; | ||
| get isForbidden(): boolean; | ||
| get isEmpty(): boolean; | ||
| get isNotFound(): boolean; | ||
| /** | ||
| * Resolve promise if its a successful response. Throws error if response was unsuccessful. | ||
| * @param promise promise which will be resolved if response was successful. | ||
| */ | ||
| resolve: (promise: Deferred<T>) => void; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Response = void 0; | ||
| /** | ||
| * Generic response model | ||
| */ | ||
| var Response = /** @class */ (function () { | ||
| /** | ||
| * | ||
| * @param httpStatus Http status of the response | ||
| * @param statusText Http status text of the response | ||
| * @param isDomainAllowed Flag returned by the Server, saying if the domain is allowed by configuration | ||
| * @param data Response data if any | ||
| * @param error Handled error response if any | ||
| */ | ||
| function Response(httpStatus, statusText, isDomainAllowed, data, error) { | ||
| var _this = this; | ||
| this.httpStatus = httpStatus; | ||
| this.statusText = statusText; | ||
| this.isDomainAllowed = isDomainAllowed; | ||
| this.data = data; | ||
| this.error = error; | ||
| /** | ||
| * Resolve promise if its a successful response. Throws error if response was unsuccessful. | ||
| * @param promise promise which will be resolved if response was successful. | ||
| */ | ||
| this.resolve = function (promise) { | ||
| if (_this.isSuccess) { | ||
| promise.resolve(_this.data); | ||
| } | ||
| else { | ||
| promise.reject(new Error(_this.httpStatus + " - " + _this.error)); | ||
| } | ||
| }; | ||
| this.data = data || undefined; | ||
| } | ||
| Object.defineProperty(Response.prototype, "isSuccess", { | ||
| get: function () { return this.httpStatus >= 200 && this.httpStatus < 300; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isUnauthorized", { | ||
| get: function () { return this.httpStatus === 401; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isForbidden", { | ||
| get: function () { return this.httpStatus === 403; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isEmpty", { | ||
| get: function () { return this.httpStatus === 0; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(Response.prototype, "isNotFound", { | ||
| get: function () { return this.httpStatus === 404; }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| return Response; | ||
| }()); | ||
| exports.Response = Response; |
| import { JobPromise } from '../models'; | ||
| import { InstallProcessResult } from './installProcessResult'; | ||
| /** | ||
| * Robot process model containing details of the robot process available in current system | ||
| */ | ||
| export declare class RobotProcess { | ||
| id: string; | ||
| name: string; | ||
| description: string | undefined; | ||
| /** | ||
| * Default constructor | ||
| * @param id Unique id of the robot process | ||
| * @param name Robot Process name | ||
| * @param description Process Description | ||
| */ | ||
| constructor(id: string, name: string, description?: string | undefined); | ||
| /** | ||
| * Start the robot process | ||
| * @param inArguments JSON object. In arguments to be passed to the robot if any. | ||
| */ | ||
| start: (inArguments?: any) => JobPromise; | ||
| /** | ||
| * Install the robot process | ||
| */ | ||
| install: () => Promise<InstallProcessResult>; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.RobotProcess = void 0; | ||
| var uipathRobot_1 = require("../uipathRobot"); | ||
| var models_1 = require("../models"); | ||
| /** | ||
| * Robot process model containing details of the robot process available in current system | ||
| */ | ||
| var RobotProcess = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param id Unique id of the robot process | ||
| * @param name Robot Process name | ||
| * @param description Process Description | ||
| */ | ||
| function RobotProcess(id, name, description) { | ||
| var _this = this; | ||
| if (description === void 0) { description = undefined; } | ||
| this.id = id; | ||
| this.name = name; | ||
| this.description = description; | ||
| /** | ||
| * Start the robot process | ||
| * @param inArguments JSON object. In arguments to be passed to the robot if any. | ||
| */ | ||
| this.start = function (inArguments) { return new models_1.JobPromise(new models_1.Job(_this.id, inArguments)); }; | ||
| /** | ||
| * Install the robot process | ||
| */ | ||
| this.install = function () { return uipathRobot_1.UiPathRobot.installProcess(_this.id); }; | ||
| } | ||
| return RobotProcess; | ||
| }()); | ||
| exports.RobotProcess = RobotProcess; |
| /** | ||
| * ServerFeatures class used to maintain compatibility between different versions of client and server | ||
| */ | ||
| export declare class ServerFeatures { | ||
| private serverFeatures; | ||
| jobStatusUsesLongPolling: boolean; | ||
| installProcess: boolean; | ||
| useGivenJobId: boolean; | ||
| internalArguments: boolean; | ||
| clientMessage: boolean; | ||
| /** | ||
| * Default constructor | ||
| */ | ||
| constructor(serverFeatures: string[]); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ServerFeatures = void 0; | ||
| /** | ||
| * ServerFeatures class used to maintain compatibility between different versions of client and server | ||
| */ | ||
| var ServerFeatures = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| */ | ||
| function ServerFeatures(serverFeatures) { | ||
| this.serverFeatures = serverFeatures; | ||
| this.jobStatusUsesLongPolling = this.serverFeatures.includes('JobStatus_LongPolling'); | ||
| this.installProcess = this.serverFeatures.includes('InstallProcess'); | ||
| this.useGivenJobId = this.serverFeatures.includes('UseGivenJobId'); | ||
| this.internalArguments = this.serverFeatures.includes('InternalArguments'); | ||
| this.clientMessage = this.serverFeatures.includes('ClientMessage'); | ||
| } | ||
| return ServerFeatures; | ||
| }()); | ||
| exports.ServerFeatures = ServerFeatures; |
| import { JobSource } from "../Enums/jobSource"; | ||
| /** | ||
| * Settings class used to change default settings of Js SDK | ||
| */ | ||
| export declare class Settings { | ||
| portNumber: number; | ||
| pollTimeInterval: number; | ||
| disableTelemetry: boolean; | ||
| jobSource: JobSource; | ||
| appOrigin: string; | ||
| /** | ||
| * Default constructor | ||
| * @param portNumber Port number of the Http listener | ||
| * @param pollTimeInterval Poll interval time. | ||
| * @param disableTelemetry Flag to disable sending telemetry events | ||
| * @param jobSource JobSource for Telemetry; default value is RobotAPI; added in SDK version 1.2.10. | ||
| */ | ||
| constructor(portNumber: number, pollTimeInterval: number, disableTelemetry: boolean, jobSource: JobSource); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Settings = void 0; | ||
| /** | ||
| * Settings class used to change default settings of Js SDK | ||
| */ | ||
| var Settings = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param portNumber Port number of the Http listener | ||
| * @param pollTimeInterval Poll interval time. | ||
| * @param disableTelemetry Flag to disable sending telemetry events | ||
| * @param jobSource JobSource for Telemetry; default value is RobotAPI; added in SDK version 1.2.10. | ||
| */ | ||
| function Settings(portNumber, pollTimeInterval, disableTelemetry, jobSource) { | ||
| this.portNumber = portNumber; | ||
| this.pollTimeInterval = pollTimeInterval; | ||
| this.disableTelemetry = disableTelemetry; | ||
| this.jobSource = jobSource; | ||
| this.appOrigin = window.location.origin; | ||
| } | ||
| return Settings; | ||
| }()); | ||
| exports.Settings = Settings; |
| /** | ||
| * Workflow event data model. | ||
| */ | ||
| export declare class WorkflowEventData { | ||
| name: string; | ||
| payload: string; | ||
| /** | ||
| * Default constructor | ||
| * @param name Workflow event name | ||
| * @param payload Workflow event payload | ||
| */ | ||
| constructor(name: string, payload: string); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.WorkflowEventData = void 0; | ||
| /** | ||
| * Workflow event data model. | ||
| */ | ||
| var WorkflowEventData = /** @class */ (function () { | ||
| /** | ||
| * Default constructor | ||
| * @param name Workflow event name | ||
| * @param payload Workflow event payload | ||
| */ | ||
| function WorkflowEventData(name, payload) { | ||
| this.name = name; | ||
| this.payload = payload; | ||
| } | ||
| return WorkflowEventData; | ||
| }()); | ||
| exports.WorkflowEventData = WorkflowEventData; |
Sorry, the diff of this file is too big to display
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.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
552782
0.2%4075
1.12%10
11.11%