@uipath/uipath-typescript 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.cjs +1 -1
- package/dist/assets/index.d.ts +2 -1
- package/dist/assets/index.mjs +1 -1
- package/dist/attachments/index.cjs +1944 -0
- package/dist/attachments/index.d.ts +399 -0
- package/dist/attachments/index.mjs +1941 -0
- package/dist/buckets/index.cjs +1 -1
- package/dist/buckets/index.d.ts +4 -2
- package/dist/buckets/index.mjs +1 -1
- package/dist/cases/index.cjs +95 -48
- package/dist/cases/index.d.ts +31 -2
- package/dist/cases/index.mjs +95 -48
- package/dist/conversational-agent/index.cjs +1 -1
- package/dist/conversational-agent/index.d.ts +10 -5
- package/dist/conversational-agent/index.mjs +1 -1
- package/dist/core/index.cjs +109 -17
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +109 -17
- package/dist/entities/index.cjs +1 -1
- package/dist/entities/index.d.ts +33 -21
- package/dist/entities/index.mjs +1 -1
- package/dist/index.cjs +569 -307
- package/dist/index.d.ts +468 -70
- package/dist/index.mjs +570 -308
- package/dist/index.umd.js +566 -304
- package/dist/jobs/index.cjs +2036 -0
- package/dist/jobs/index.d.ts +724 -0
- package/dist/jobs/index.mjs +2033 -0
- package/dist/maestro-processes/index.cjs +1 -1
- package/dist/maestro-processes/index.mjs +1 -1
- package/dist/processes/index.cjs +67 -1
- package/dist/processes/index.d.ts +80 -15
- package/dist/processes/index.mjs +68 -2
- package/dist/queues/index.cjs +1 -1
- package/dist/queues/index.d.ts +2 -1
- package/dist/queues/index.mjs +1 -1
- package/dist/tasks/index.cjs +1319 -1272
- package/dist/tasks/index.d.ts +331 -287
- package/dist/tasks/index.mjs +1319 -1272
- package/package.json +23 -2
package/dist/index.umd.js
CHANGED
|
@@ -4389,6 +4389,234 @@
|
|
|
4389
4389
|
};
|
|
4390
4390
|
}
|
|
4391
4391
|
|
|
4392
|
+
/**
|
|
4393
|
+
* Types of tasks available in Action Center.
|
|
4394
|
+
* Each type determines the task's behavior, UI rendering, and completion requirements.
|
|
4395
|
+
*/
|
|
4396
|
+
exports.TaskType = void 0;
|
|
4397
|
+
(function (TaskType) {
|
|
4398
|
+
/** A form-based task that renders a UiPath form layout for user input */
|
|
4399
|
+
TaskType["Form"] = "FormTask";
|
|
4400
|
+
/** An externally managed task handled outside of Action Center */
|
|
4401
|
+
TaskType["External"] = "ExternalTask";
|
|
4402
|
+
/** A task powered by a UiPath App */
|
|
4403
|
+
TaskType["App"] = "AppTask";
|
|
4404
|
+
/** A document validation task for reviewing and correcting extracted document data */
|
|
4405
|
+
TaskType["DocumentValidation"] = "DocumentValidationTask";
|
|
4406
|
+
/** A document classification task for categorizing documents */
|
|
4407
|
+
TaskType["DocumentClassification"] = "DocumentClassificationTask";
|
|
4408
|
+
/** A data labeling task for annotating training data */
|
|
4409
|
+
TaskType["DataLabeling"] = "DataLabelingTask";
|
|
4410
|
+
})(exports.TaskType || (exports.TaskType = {}));
|
|
4411
|
+
exports.TaskPriority = void 0;
|
|
4412
|
+
(function (TaskPriority) {
|
|
4413
|
+
TaskPriority["Low"] = "Low";
|
|
4414
|
+
TaskPriority["Medium"] = "Medium";
|
|
4415
|
+
TaskPriority["High"] = "High";
|
|
4416
|
+
TaskPriority["Critical"] = "Critical";
|
|
4417
|
+
})(exports.TaskPriority || (exports.TaskPriority = {}));
|
|
4418
|
+
exports.TaskStatus = void 0;
|
|
4419
|
+
(function (TaskStatus) {
|
|
4420
|
+
TaskStatus["Unassigned"] = "Unassigned";
|
|
4421
|
+
TaskStatus["Pending"] = "Pending";
|
|
4422
|
+
TaskStatus["Completed"] = "Completed";
|
|
4423
|
+
})(exports.TaskStatus || (exports.TaskStatus = {}));
|
|
4424
|
+
exports.TaskSlaCriteria = void 0;
|
|
4425
|
+
(function (TaskSlaCriteria) {
|
|
4426
|
+
TaskSlaCriteria["TaskCreated"] = "TaskCreated";
|
|
4427
|
+
TaskSlaCriteria["TaskAssigned"] = "TaskAssigned";
|
|
4428
|
+
TaskSlaCriteria["TaskCompleted"] = "TaskCompleted";
|
|
4429
|
+
})(exports.TaskSlaCriteria || (exports.TaskSlaCriteria = {}));
|
|
4430
|
+
exports.TaskSlaStatus = void 0;
|
|
4431
|
+
(function (TaskSlaStatus) {
|
|
4432
|
+
TaskSlaStatus["OverdueLater"] = "OverdueLater";
|
|
4433
|
+
TaskSlaStatus["OverdueSoon"] = "OverdueSoon";
|
|
4434
|
+
TaskSlaStatus["Overdue"] = "Overdue";
|
|
4435
|
+
TaskSlaStatus["CompletedInTime"] = "CompletedInTime";
|
|
4436
|
+
})(exports.TaskSlaStatus || (exports.TaskSlaStatus = {}));
|
|
4437
|
+
exports.TaskSourceName = void 0;
|
|
4438
|
+
(function (TaskSourceName) {
|
|
4439
|
+
TaskSourceName["Agent"] = "Agent";
|
|
4440
|
+
TaskSourceName["Workflow"] = "Workflow";
|
|
4441
|
+
TaskSourceName["Maestro"] = "Maestro";
|
|
4442
|
+
TaskSourceName["Default"] = "Default";
|
|
4443
|
+
})(exports.TaskSourceName || (exports.TaskSourceName = {}));
|
|
4444
|
+
/**
|
|
4445
|
+
* Task activity types
|
|
4446
|
+
*/
|
|
4447
|
+
exports.TaskActivityType = void 0;
|
|
4448
|
+
(function (TaskActivityType) {
|
|
4449
|
+
TaskActivityType["Created"] = "Created";
|
|
4450
|
+
TaskActivityType["Assigned"] = "Assigned";
|
|
4451
|
+
TaskActivityType["Reassigned"] = "Reassigned";
|
|
4452
|
+
TaskActivityType["Unassigned"] = "Unassigned";
|
|
4453
|
+
TaskActivityType["Saved"] = "Saved";
|
|
4454
|
+
TaskActivityType["Forwarded"] = "Forwarded";
|
|
4455
|
+
TaskActivityType["Completed"] = "Completed";
|
|
4456
|
+
TaskActivityType["Commented"] = "Commented";
|
|
4457
|
+
TaskActivityType["Deleted"] = "Deleted";
|
|
4458
|
+
TaskActivityType["BulkSaved"] = "BulkSaved";
|
|
4459
|
+
TaskActivityType["BulkCompleted"] = "BulkCompleted";
|
|
4460
|
+
TaskActivityType["FirstOpened"] = "FirstOpened";
|
|
4461
|
+
})(exports.TaskActivityType || (exports.TaskActivityType = {}));
|
|
4462
|
+
|
|
4463
|
+
/**
|
|
4464
|
+
* Base path constants for different services
|
|
4465
|
+
*/
|
|
4466
|
+
const ORCHESTRATOR_BASE = 'orchestrator_';
|
|
4467
|
+
const PIMS_BASE = 'pims_';
|
|
4468
|
+
const DATAFABRIC_BASE = 'datafabric_';
|
|
4469
|
+
const IDENTITY_BASE = 'identity_';
|
|
4470
|
+
|
|
4471
|
+
/**
|
|
4472
|
+
* Orchestrator Service Endpoints
|
|
4473
|
+
*/
|
|
4474
|
+
/**
|
|
4475
|
+
* Task Service (Action Center) Endpoints
|
|
4476
|
+
*/
|
|
4477
|
+
const TASK_ENDPOINTS = {
|
|
4478
|
+
CREATE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CreateTask`,
|
|
4479
|
+
GET_TASK_USERS: (folderId) => `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTaskUsers(organizationUnitId=${folderId})`,
|
|
4480
|
+
GET_TASKS_ACROSS_FOLDERS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders`,
|
|
4481
|
+
GET_TASKS_ACROSS_FOLDERS_ADMIN: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFoldersForAdmin`,
|
|
4482
|
+
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Tasks(${id})`,
|
|
4483
|
+
ASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.AssignTasks`,
|
|
4484
|
+
REASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.ReassignTasks`,
|
|
4485
|
+
UNASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.UnassignTasks`,
|
|
4486
|
+
COMPLETE_FORM_TASK: `${ORCHESTRATOR_BASE}/forms/TaskForms/CompleteTask`,
|
|
4487
|
+
COMPLETE_APP_TASK: `${ORCHESTRATOR_BASE}/tasks/AppTasks/CompleteAppTask`,
|
|
4488
|
+
COMPLETE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CompleteTask`,
|
|
4489
|
+
GET_TASK_FORM_BY_ID: `${ORCHESTRATOR_BASE}/forms/TaskForms/GetTaskFormById`,
|
|
4490
|
+
GET_GENERIC_TASK_BY_ID: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/GetTaskDataById`,
|
|
4491
|
+
GET_APP_TASK_BY_ID: `${ORCHESTRATOR_BASE}/tasks/AppTasks/GetAppTaskById`,
|
|
4492
|
+
};
|
|
4493
|
+
/**
|
|
4494
|
+
* Orchestrator Bucket Endpoints
|
|
4495
|
+
*/
|
|
4496
|
+
const BUCKET_ENDPOINTS = {
|
|
4497
|
+
GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Buckets`,
|
|
4498
|
+
GET_ALL: `${ORCHESTRATOR_BASE}/odata/Buckets/UiPath.Server.Configuration.OData.GetBucketsAcrossFolders`,
|
|
4499
|
+
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})`,
|
|
4500
|
+
GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
|
|
4501
|
+
GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
|
|
4502
|
+
GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
|
|
4503
|
+
};
|
|
4504
|
+
/**
|
|
4505
|
+
* Orchestrator Process Service Endpoints
|
|
4506
|
+
*/
|
|
4507
|
+
const PROCESS_ENDPOINTS = {
|
|
4508
|
+
GET_ALL: `${ORCHESTRATOR_BASE}/odata/Releases`,
|
|
4509
|
+
START_PROCESS: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs`,
|
|
4510
|
+
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Releases(${id})`,
|
|
4511
|
+
};
|
|
4512
|
+
/**
|
|
4513
|
+
* Orchestrator Queue Service Endpoints
|
|
4514
|
+
*/
|
|
4515
|
+
const QUEUE_ENDPOINTS = {
|
|
4516
|
+
GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions`,
|
|
4517
|
+
GET_ALL: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions/UiPath.Server.Configuration.OData.GetQueuesAcrossFolders`,
|
|
4518
|
+
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/QueueDefinitions(${id})`,
|
|
4519
|
+
};
|
|
4520
|
+
/**
|
|
4521
|
+
* Orchestrator Job Service Endpoints
|
|
4522
|
+
*/
|
|
4523
|
+
const JOB_ENDPOINTS = {
|
|
4524
|
+
GET_ALL: `${ORCHESTRATOR_BASE}/odata/Jobs`,
|
|
4525
|
+
};
|
|
4526
|
+
/**
|
|
4527
|
+
* Orchestrator Asset Service Endpoints
|
|
4528
|
+
*/
|
|
4529
|
+
const ASSET_ENDPOINTS = {
|
|
4530
|
+
GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered`,
|
|
4531
|
+
GET_ALL: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetAssetsAcrossFolders`,
|
|
4532
|
+
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Assets(${id})`,
|
|
4533
|
+
};
|
|
4534
|
+
/**
|
|
4535
|
+
* Orchestrator Attachment Service Endpoints
|
|
4536
|
+
*/
|
|
4537
|
+
const ORCHESTRATOR_ATTACHMENT_ENDPOINTS = {
|
|
4538
|
+
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Attachments(${id})`,
|
|
4539
|
+
};
|
|
4540
|
+
|
|
4541
|
+
/**
|
|
4542
|
+
* Maestro Service Endpoints
|
|
4543
|
+
*/
|
|
4544
|
+
/**
|
|
4545
|
+
* Maestro Process Service Endpoints
|
|
4546
|
+
*/
|
|
4547
|
+
const MAESTRO_ENDPOINTS = {
|
|
4548
|
+
PROCESSES: {
|
|
4549
|
+
GET_ALL: `${PIMS_BASE}/api/v1/processes/summary`,
|
|
4550
|
+
GET_SETTINGS: (processKey) => `${PIMS_BASE}/api/v1/processes/${processKey}/settings`,
|
|
4551
|
+
},
|
|
4552
|
+
INSTANCES: {
|
|
4553
|
+
GET_ALL: `${PIMS_BASE}/api/v1/instances`,
|
|
4554
|
+
GET_BY_ID: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}`,
|
|
4555
|
+
GET_EXECUTION_HISTORY: (instanceId) => `${PIMS_BASE}/api/v1/spans/${instanceId}`,
|
|
4556
|
+
GET_BPMN: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/bpmn`,
|
|
4557
|
+
GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
|
|
4558
|
+
CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
|
|
4559
|
+
PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
|
|
4560
|
+
RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
|
|
4561
|
+
},
|
|
4562
|
+
INCIDENTS: {
|
|
4563
|
+
GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
|
|
4564
|
+
GET_BY_PROCESS: (processKey) => `${PIMS_BASE}/api/v1/incidents/process/${processKey}`,
|
|
4565
|
+
GET_BY_INSTANCE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/incidents`,
|
|
4566
|
+
},
|
|
4567
|
+
CASES: {
|
|
4568
|
+
GET_CASE_JSON: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/case-json`,
|
|
4569
|
+
GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
|
|
4570
|
+
REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
|
|
4571
|
+
},
|
|
4572
|
+
};
|
|
4573
|
+
|
|
4574
|
+
/**
|
|
4575
|
+
* Data Fabric Service Endpoints
|
|
4576
|
+
*/
|
|
4577
|
+
/**
|
|
4578
|
+
* Data Fabric Entity Service Endpoints
|
|
4579
|
+
*/
|
|
4580
|
+
const DATA_FABRIC_ENDPOINTS = {
|
|
4581
|
+
ENTITY: {
|
|
4582
|
+
GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
|
|
4583
|
+
GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
|
|
4584
|
+
GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
|
|
4585
|
+
GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
|
|
4586
|
+
INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
|
|
4587
|
+
BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
|
|
4588
|
+
UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
|
|
4589
|
+
UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
|
|
4590
|
+
DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
|
|
4591
|
+
DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
|
|
4592
|
+
UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
|
|
4593
|
+
DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
|
|
4594
|
+
},
|
|
4595
|
+
CHOICESETS: {
|
|
4596
|
+
GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
|
|
4597
|
+
GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
|
|
4598
|
+
},
|
|
4599
|
+
};
|
|
4600
|
+
|
|
4601
|
+
/**
|
|
4602
|
+
* Identity/Authentication Endpoints
|
|
4603
|
+
*/
|
|
4604
|
+
/**
|
|
4605
|
+
* Identity Service Endpoints
|
|
4606
|
+
*/
|
|
4607
|
+
const IDENTITY_ENDPOINTS = {
|
|
4608
|
+
TOKEN: `${IDENTITY_BASE}/connect/token`,
|
|
4609
|
+
AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
|
|
4610
|
+
};
|
|
4611
|
+
|
|
4612
|
+
const TASK_TYPE_ENDPOINTS = {
|
|
4613
|
+
[exports.TaskType.Form]: TASK_ENDPOINTS.GET_TASK_FORM_BY_ID,
|
|
4614
|
+
[exports.TaskType.App]: TASK_ENDPOINTS.GET_APP_TASK_BY_ID,
|
|
4615
|
+
[exports.TaskType.DocumentValidation]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
|
|
4616
|
+
[exports.TaskType.DocumentClassification]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
|
|
4617
|
+
[exports.TaskType.External]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
|
|
4618
|
+
[exports.TaskType.DataLabeling]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
|
|
4619
|
+
};
|
|
4392
4620
|
var ActionCenterEventNames;
|
|
4393
4621
|
(function (ActionCenterEventNames) {
|
|
4394
4622
|
ActionCenterEventNames["TOKENREFRESHED"] = "AC.tokenRefreshed";
|
|
@@ -4699,207 +4927,72 @@
|
|
|
4699
4927
|
this.executionContext.set('tokenInfo', tokenInfo);
|
|
4700
4928
|
}
|
|
4701
4929
|
/**
|
|
4702
|
-
* Refreshes the access token using the stored refresh token.
|
|
4703
|
-
* This method only works for OAuth flow.
|
|
4704
|
-
* Uses a lock mechanism to prevent multiple simultaneous refreshes.
|
|
4705
|
-
* @returns A promise that resolves to the new AuthToken
|
|
4706
|
-
* @throws Error if not in OAuth flow, refresh token is missing, or the request fails
|
|
4707
|
-
*/
|
|
4708
|
-
async refreshAccessToken() {
|
|
4709
|
-
// If there's already a refresh in progress, return that promise
|
|
4710
|
-
if (this.refreshPromise) {
|
|
4711
|
-
return this.refreshPromise;
|
|
4712
|
-
}
|
|
4713
|
-
try {
|
|
4714
|
-
// Create new refresh promise
|
|
4715
|
-
this.refreshPromise = this._doRefreshToken();
|
|
4716
|
-
// Wait for refresh to complete
|
|
4717
|
-
const result = await this.refreshPromise;
|
|
4718
|
-
return result;
|
|
4719
|
-
}
|
|
4720
|
-
finally {
|
|
4721
|
-
// Clear the refresh promise when done (success or failure)
|
|
4722
|
-
this.refreshPromise = null;
|
|
4723
|
-
}
|
|
4724
|
-
}
|
|
4725
|
-
/**
|
|
4726
|
-
* Internal method to perform the actual token refresh
|
|
4727
|
-
*/
|
|
4728
|
-
async _doRefreshToken() {
|
|
4729
|
-
// Check if we're in OAuth flow
|
|
4730
|
-
if (!hasOAuthConfig(this.config)) {
|
|
4731
|
-
throw new Error('refreshAccessToken is only available in OAuth flow');
|
|
4732
|
-
}
|
|
4733
|
-
// Get current token info from token manager
|
|
4734
|
-
const tokenInfo = this.getTokenInfo();
|
|
4735
|
-
if (!tokenInfo?.refreshToken) {
|
|
4736
|
-
throw new Error('No refresh token available. User may need to re-authenticate.');
|
|
4737
|
-
}
|
|
4738
|
-
const orgName = this.config.orgName;
|
|
4739
|
-
const body = new URLSearchParams({
|
|
4740
|
-
grant_type: 'refresh_token',
|
|
4741
|
-
client_id: this.config.clientId,
|
|
4742
|
-
refresh_token: tokenInfo.refreshToken
|
|
4743
|
-
});
|
|
4744
|
-
const response = await fetch(`${this.config.baseUrl}/${orgName}/identity_/connect/token`, {
|
|
4745
|
-
method: 'POST',
|
|
4746
|
-
headers: {
|
|
4747
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
4748
|
-
},
|
|
4749
|
-
body: body.toString()
|
|
4750
|
-
});
|
|
4751
|
-
if (!response.ok) {
|
|
4752
|
-
const errorData = await response.json().catch(() => ({ message: response.statusText }));
|
|
4753
|
-
console.error("Token refresh error:", errorData);
|
|
4754
|
-
// Clear the invalid token to prevent further failed requests
|
|
4755
|
-
this.clearToken();
|
|
4756
|
-
throw new Error(`Failed to refresh access token: ${JSON.stringify(errorData)}`);
|
|
4757
|
-
}
|
|
4758
|
-
const token = await response.json();
|
|
4759
|
-
this.setToken({
|
|
4760
|
-
token: token.access_token,
|
|
4761
|
-
type: 'oauth',
|
|
4762
|
-
expiresAt: new Date(Date.now() + token.expires_in * 1000),
|
|
4763
|
-
refreshToken: token.refresh_token
|
|
4764
|
-
});
|
|
4765
|
-
return token;
|
|
4766
|
-
}
|
|
4767
|
-
}
|
|
4768
|
-
|
|
4769
|
-
/**
|
|
4770
|
-
* Base path constants for different services
|
|
4771
|
-
*/
|
|
4772
|
-
const ORCHESTRATOR_BASE = 'orchestrator_';
|
|
4773
|
-
const PIMS_BASE = 'pims_';
|
|
4774
|
-
const DATAFABRIC_BASE = 'datafabric_';
|
|
4775
|
-
const IDENTITY_BASE = 'identity_';
|
|
4776
|
-
|
|
4777
|
-
/**
|
|
4778
|
-
* Orchestrator Service Endpoints
|
|
4779
|
-
*/
|
|
4780
|
-
/**
|
|
4781
|
-
* Task Service (Action Center) Endpoints
|
|
4782
|
-
*/
|
|
4783
|
-
const TASK_ENDPOINTS = {
|
|
4784
|
-
CREATE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CreateTask`,
|
|
4785
|
-
GET_TASK_USERS: (folderId) => `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTaskUsers(organizationUnitId=${folderId})`,
|
|
4786
|
-
GET_TASKS_ACROSS_FOLDERS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders`,
|
|
4787
|
-
GET_TASKS_ACROSS_FOLDERS_ADMIN: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFoldersForAdmin`,
|
|
4788
|
-
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Tasks(${id})`,
|
|
4789
|
-
ASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.AssignTasks`,
|
|
4790
|
-
REASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.ReassignTasks`,
|
|
4791
|
-
UNASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.UnassignTasks`,
|
|
4792
|
-
COMPLETE_FORM_TASK: `${ORCHESTRATOR_BASE}/forms/TaskForms/CompleteTask`,
|
|
4793
|
-
COMPLETE_APP_TASK: `${ORCHESTRATOR_BASE}/tasks/AppTasks/CompleteAppTask`,
|
|
4794
|
-
COMPLETE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CompleteTask`,
|
|
4795
|
-
GET_TASK_FORM_BY_ID: `${ORCHESTRATOR_BASE}/forms/TaskForms/GetTaskFormById`,
|
|
4796
|
-
};
|
|
4797
|
-
/**
|
|
4798
|
-
* Orchestrator Bucket Endpoints
|
|
4799
|
-
*/
|
|
4800
|
-
const BUCKET_ENDPOINTS = {
|
|
4801
|
-
GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Buckets`,
|
|
4802
|
-
GET_ALL: `${ORCHESTRATOR_BASE}/odata/Buckets/UiPath.Server.Configuration.OData.GetBucketsAcrossFolders`,
|
|
4803
|
-
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})`,
|
|
4804
|
-
GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
|
|
4805
|
-
GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
|
|
4806
|
-
GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
|
|
4807
|
-
};
|
|
4808
|
-
/**
|
|
4809
|
-
* Orchestrator Process Service Endpoints
|
|
4810
|
-
*/
|
|
4811
|
-
const PROCESS_ENDPOINTS = {
|
|
4812
|
-
GET_ALL: `${ORCHESTRATOR_BASE}/odata/Releases`,
|
|
4813
|
-
START_PROCESS: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs`,
|
|
4814
|
-
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Releases(${id})`,
|
|
4815
|
-
};
|
|
4816
|
-
/**
|
|
4817
|
-
* Orchestrator Queue Service Endpoints
|
|
4818
|
-
*/
|
|
4819
|
-
const QUEUE_ENDPOINTS = {
|
|
4820
|
-
GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions`,
|
|
4821
|
-
GET_ALL: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions/UiPath.Server.Configuration.OData.GetQueuesAcrossFolders`,
|
|
4822
|
-
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/QueueDefinitions(${id})`,
|
|
4823
|
-
};
|
|
4824
|
-
/**
|
|
4825
|
-
* Orchestrator Asset Service Endpoints
|
|
4826
|
-
*/
|
|
4827
|
-
const ASSET_ENDPOINTS = {
|
|
4828
|
-
GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered`,
|
|
4829
|
-
GET_ALL: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetAssetsAcrossFolders`,
|
|
4830
|
-
GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Assets(${id})`,
|
|
4831
|
-
};
|
|
4832
|
-
|
|
4833
|
-
/**
|
|
4834
|
-
* Maestro Service Endpoints
|
|
4835
|
-
*/
|
|
4836
|
-
/**
|
|
4837
|
-
* Maestro Process Service Endpoints
|
|
4838
|
-
*/
|
|
4839
|
-
const MAESTRO_ENDPOINTS = {
|
|
4840
|
-
PROCESSES: {
|
|
4841
|
-
GET_ALL: `${PIMS_BASE}/api/v1/processes/summary`,
|
|
4842
|
-
GET_SETTINGS: (processKey) => `${PIMS_BASE}/api/v1/processes/${processKey}/settings`,
|
|
4843
|
-
},
|
|
4844
|
-
INSTANCES: {
|
|
4845
|
-
GET_ALL: `${PIMS_BASE}/api/v1/instances`,
|
|
4846
|
-
GET_BY_ID: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}`,
|
|
4847
|
-
GET_EXECUTION_HISTORY: (instanceId) => `${PIMS_BASE}/api/v1/spans/${instanceId}`,
|
|
4848
|
-
GET_BPMN: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/bpmn`,
|
|
4849
|
-
GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
|
|
4850
|
-
CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
|
|
4851
|
-
PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
|
|
4852
|
-
RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
|
|
4853
|
-
},
|
|
4854
|
-
INCIDENTS: {
|
|
4855
|
-
GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
|
|
4856
|
-
GET_BY_PROCESS: (processKey) => `${PIMS_BASE}/api/v1/incidents/process/${processKey}`,
|
|
4857
|
-
GET_BY_INSTANCE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/incidents`,
|
|
4858
|
-
},
|
|
4859
|
-
CASES: {
|
|
4860
|
-
GET_CASE_JSON: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/case-json`,
|
|
4861
|
-
GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
|
|
4862
|
-
REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
|
|
4863
|
-
},
|
|
4864
|
-
};
|
|
4865
|
-
|
|
4866
|
-
/**
|
|
4867
|
-
* Data Fabric Service Endpoints
|
|
4868
|
-
*/
|
|
4869
|
-
/**
|
|
4870
|
-
* Data Fabric Entity Service Endpoints
|
|
4871
|
-
*/
|
|
4872
|
-
const DATA_FABRIC_ENDPOINTS = {
|
|
4873
|
-
ENTITY: {
|
|
4874
|
-
GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
|
|
4875
|
-
GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
|
|
4876
|
-
GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
|
|
4877
|
-
GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
|
|
4878
|
-
INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
|
|
4879
|
-
BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
|
|
4880
|
-
UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
|
|
4881
|
-
UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
|
|
4882
|
-
DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
|
|
4883
|
-
DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
|
|
4884
|
-
UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
|
|
4885
|
-
DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
|
|
4886
|
-
},
|
|
4887
|
-
CHOICESETS: {
|
|
4888
|
-
GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
|
|
4889
|
-
GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
|
|
4890
|
-
},
|
|
4891
|
-
};
|
|
4892
|
-
|
|
4893
|
-
/**
|
|
4894
|
-
* Identity/Authentication Endpoints
|
|
4895
|
-
*/
|
|
4896
|
-
/**
|
|
4897
|
-
* Identity Service Endpoints
|
|
4898
|
-
*/
|
|
4899
|
-
const IDENTITY_ENDPOINTS = {
|
|
4900
|
-
TOKEN: `${IDENTITY_BASE}/connect/token`,
|
|
4901
|
-
AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
|
|
4902
|
-
};
|
|
4930
|
+
* Refreshes the access token using the stored refresh token.
|
|
4931
|
+
* This method only works for OAuth flow.
|
|
4932
|
+
* Uses a lock mechanism to prevent multiple simultaneous refreshes.
|
|
4933
|
+
* @returns A promise that resolves to the new AuthToken
|
|
4934
|
+
* @throws Error if not in OAuth flow, refresh token is missing, or the request fails
|
|
4935
|
+
*/
|
|
4936
|
+
async refreshAccessToken() {
|
|
4937
|
+
// If there's already a refresh in progress, return that promise
|
|
4938
|
+
if (this.refreshPromise) {
|
|
4939
|
+
return this.refreshPromise;
|
|
4940
|
+
}
|
|
4941
|
+
try {
|
|
4942
|
+
// Create new refresh promise
|
|
4943
|
+
this.refreshPromise = this._doRefreshToken();
|
|
4944
|
+
// Wait for refresh to complete
|
|
4945
|
+
const result = await this.refreshPromise;
|
|
4946
|
+
return result;
|
|
4947
|
+
}
|
|
4948
|
+
finally {
|
|
4949
|
+
// Clear the refresh promise when done (success or failure)
|
|
4950
|
+
this.refreshPromise = null;
|
|
4951
|
+
}
|
|
4952
|
+
}
|
|
4953
|
+
/**
|
|
4954
|
+
* Internal method to perform the actual token refresh
|
|
4955
|
+
*/
|
|
4956
|
+
async _doRefreshToken() {
|
|
4957
|
+
// Check if we're in OAuth flow
|
|
4958
|
+
if (!hasOAuthConfig(this.config)) {
|
|
4959
|
+
throw new Error('refreshAccessToken is only available in OAuth flow');
|
|
4960
|
+
}
|
|
4961
|
+
// Get current token info from token manager
|
|
4962
|
+
const tokenInfo = this.getTokenInfo();
|
|
4963
|
+
if (!tokenInfo?.refreshToken) {
|
|
4964
|
+
throw new Error('No refresh token available. User may need to re-authenticate.');
|
|
4965
|
+
}
|
|
4966
|
+
const orgName = this.config.orgName;
|
|
4967
|
+
const body = new URLSearchParams({
|
|
4968
|
+
grant_type: 'refresh_token',
|
|
4969
|
+
client_id: this.config.clientId,
|
|
4970
|
+
refresh_token: tokenInfo.refreshToken
|
|
4971
|
+
});
|
|
4972
|
+
const response = await fetch(`${this.config.baseUrl}/${orgName}/identity_/connect/token`, {
|
|
4973
|
+
method: 'POST',
|
|
4974
|
+
headers: {
|
|
4975
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
4976
|
+
},
|
|
4977
|
+
body: body.toString()
|
|
4978
|
+
});
|
|
4979
|
+
if (!response.ok) {
|
|
4980
|
+
const errorData = await response.json().catch(() => ({ message: response.statusText }));
|
|
4981
|
+
console.error("Token refresh error:", errorData);
|
|
4982
|
+
// Clear the invalid token to prevent further failed requests
|
|
4983
|
+
this.clearToken();
|
|
4984
|
+
throw new Error(`Failed to refresh access token: ${JSON.stringify(errorData)}`);
|
|
4985
|
+
}
|
|
4986
|
+
const token = await response.json();
|
|
4987
|
+
this.setToken({
|
|
4988
|
+
token: token.access_token,
|
|
4989
|
+
type: 'oauth',
|
|
4990
|
+
expiresAt: new Date(Date.now() + token.expires_in * 1000),
|
|
4991
|
+
refreshToken: token.refresh_token
|
|
4992
|
+
});
|
|
4993
|
+
return token;
|
|
4994
|
+
}
|
|
4995
|
+
}
|
|
4903
4996
|
|
|
4904
4997
|
class AuthService {
|
|
4905
4998
|
constructor(config, executionContext) {
|
|
@@ -9083,7 +9176,7 @@
|
|
|
9083
9176
|
// Connection string placeholder that will be replaced during build
|
|
9084
9177
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
9085
9178
|
// SDK Version placeholder
|
|
9086
|
-
const SDK_VERSION = "1.2.
|
|
9179
|
+
const SDK_VERSION = "1.2.2";
|
|
9087
9180
|
const VERSION = "Version";
|
|
9088
9181
|
const SERVICE = "Service";
|
|
9089
9182
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -13079,63 +13172,27 @@
|
|
|
13079
13172
|
*/
|
|
13080
13173
|
const CASE_INSTANCE_TASK_EXPAND = 'AssignedToUser,Activities';
|
|
13081
13174
|
|
|
13082
|
-
exports.TaskType = void 0;
|
|
13083
|
-
(function (TaskType) {
|
|
13084
|
-
TaskType["Form"] = "FormTask";
|
|
13085
|
-
TaskType["External"] = "ExternalTask";
|
|
13086
|
-
TaskType["App"] = "AppTask";
|
|
13087
|
-
})(exports.TaskType || (exports.TaskType = {}));
|
|
13088
|
-
exports.TaskPriority = void 0;
|
|
13089
|
-
(function (TaskPriority) {
|
|
13090
|
-
TaskPriority["Low"] = "Low";
|
|
13091
|
-
TaskPriority["Medium"] = "Medium";
|
|
13092
|
-
TaskPriority["High"] = "High";
|
|
13093
|
-
TaskPriority["Critical"] = "Critical";
|
|
13094
|
-
})(exports.TaskPriority || (exports.TaskPriority = {}));
|
|
13095
|
-
exports.TaskStatus = void 0;
|
|
13096
|
-
(function (TaskStatus) {
|
|
13097
|
-
TaskStatus["Unassigned"] = "Unassigned";
|
|
13098
|
-
TaskStatus["Pending"] = "Pending";
|
|
13099
|
-
TaskStatus["Completed"] = "Completed";
|
|
13100
|
-
})(exports.TaskStatus || (exports.TaskStatus = {}));
|
|
13101
|
-
exports.TaskSlaCriteria = void 0;
|
|
13102
|
-
(function (TaskSlaCriteria) {
|
|
13103
|
-
TaskSlaCriteria["TaskCreated"] = "TaskCreated";
|
|
13104
|
-
TaskSlaCriteria["TaskAssigned"] = "TaskAssigned";
|
|
13105
|
-
TaskSlaCriteria["TaskCompleted"] = "TaskCompleted";
|
|
13106
|
-
})(exports.TaskSlaCriteria || (exports.TaskSlaCriteria = {}));
|
|
13107
|
-
exports.TaskSlaStatus = void 0;
|
|
13108
|
-
(function (TaskSlaStatus) {
|
|
13109
|
-
TaskSlaStatus["OverdueLater"] = "OverdueLater";
|
|
13110
|
-
TaskSlaStatus["OverdueSoon"] = "OverdueSoon";
|
|
13111
|
-
TaskSlaStatus["Overdue"] = "Overdue";
|
|
13112
|
-
TaskSlaStatus["CompletedInTime"] = "CompletedInTime";
|
|
13113
|
-
})(exports.TaskSlaStatus || (exports.TaskSlaStatus = {}));
|
|
13114
|
-
exports.TaskSourceName = void 0;
|
|
13115
|
-
(function (TaskSourceName) {
|
|
13116
|
-
TaskSourceName["Agent"] = "Agent";
|
|
13117
|
-
TaskSourceName["Workflow"] = "Workflow";
|
|
13118
|
-
TaskSourceName["Maestro"] = "Maestro";
|
|
13119
|
-
TaskSourceName["Default"] = "Default";
|
|
13120
|
-
})(exports.TaskSourceName || (exports.TaskSourceName = {}));
|
|
13121
13175
|
/**
|
|
13122
|
-
*
|
|
13176
|
+
* Maps numeric TaskStatus values (from API) to TaskStatus enum values.
|
|
13177
|
+
* Extend this file with additional field mappings as needed.
|
|
13123
13178
|
*/
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13179
|
+
const TaskStatusMap = {
|
|
13180
|
+
0: exports.TaskStatus.Unassigned,
|
|
13181
|
+
1: exports.TaskStatus.Pending,
|
|
13182
|
+
2: exports.TaskStatus.Completed,
|
|
13183
|
+
};
|
|
13184
|
+
// Field mapping for time-related fields to ensure consistent naming
|
|
13185
|
+
const TaskMap = {
|
|
13186
|
+
completionTime: 'completedTime',
|
|
13187
|
+
deletionTime: 'deletedTime',
|
|
13188
|
+
lastModificationTime: 'lastModifiedTime',
|
|
13189
|
+
creationTime: 'createdTime',
|
|
13190
|
+
organizationUnitId: 'folderId'
|
|
13191
|
+
};
|
|
13192
|
+
/**
|
|
13193
|
+
* Default expand parameters
|
|
13194
|
+
*/
|
|
13195
|
+
const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
|
|
13139
13196
|
|
|
13140
13197
|
/**
|
|
13141
13198
|
* Creates methods for a task
|
|
@@ -13194,28 +13251,6 @@
|
|
|
13194
13251
|
return Object.assign({}, taskData, methods);
|
|
13195
13252
|
}
|
|
13196
13253
|
|
|
13197
|
-
/**
|
|
13198
|
-
* Maps numeric TaskStatus values (from API) to TaskStatus enum values.
|
|
13199
|
-
* Extend this file with additional field mappings as needed.
|
|
13200
|
-
*/
|
|
13201
|
-
const TaskStatusMap = {
|
|
13202
|
-
0: exports.TaskStatus.Unassigned,
|
|
13203
|
-
1: exports.TaskStatus.Pending,
|
|
13204
|
-
2: exports.TaskStatus.Completed,
|
|
13205
|
-
};
|
|
13206
|
-
// Field mapping for time-related fields to ensure consistent naming
|
|
13207
|
-
const TaskMap = {
|
|
13208
|
-
completionTime: 'completedTime',
|
|
13209
|
-
deletionTime: 'deletedTime',
|
|
13210
|
-
lastModificationTime: 'lastModifiedTime',
|
|
13211
|
-
creationTime: 'createdTime',
|
|
13212
|
-
organizationUnitId: 'folderId'
|
|
13213
|
-
};
|
|
13214
|
-
/**
|
|
13215
|
-
* Default expand parameters
|
|
13216
|
-
*/
|
|
13217
|
-
const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
|
|
13218
|
-
|
|
13219
13254
|
/**
|
|
13220
13255
|
* Service for interacting with UiPath Tasks API
|
|
13221
13256
|
*/
|
|
@@ -13410,29 +13445,38 @@
|
|
|
13410
13445
|
}
|
|
13411
13446
|
/**
|
|
13412
13447
|
* Gets a task by ID
|
|
13413
|
-
* IMPORTANT: For form tasks, folderId must be provided.
|
|
13414
|
-
*
|
|
13415
13448
|
* @param id - The ID of the task to retrieve
|
|
13416
|
-
* @param options - Optional query parameters
|
|
13417
|
-
* @param folderId - Optional folder ID (REQUIRED
|
|
13418
|
-
* @returns Promise resolving to the task
|
|
13419
|
-
*
|
|
13449
|
+
* @param options - Optional query parameters including taskType for faster retrieval {@link TaskGetByIdOptions}
|
|
13450
|
+
* @param folderId - Optional folder ID (REQUIRED when options.taskType is provided)
|
|
13451
|
+
* @returns Promise resolving to the task
|
|
13452
|
+
* {@link TaskGetResponse}
|
|
13420
13453
|
* @example
|
|
13421
13454
|
* ```typescript
|
|
13422
|
-
*
|
|
13455
|
+
* // Get a task by ID
|
|
13456
|
+
* const task = await tasks.getById(<taskId>);
|
|
13423
13457
|
*
|
|
13424
|
-
*
|
|
13458
|
+
* // Get a form task by ID
|
|
13459
|
+
* const formTask = await tasks.getById(<taskId>, {}, <folderId>);
|
|
13425
13460
|
*
|
|
13426
|
-
* //
|
|
13427
|
-
*
|
|
13461
|
+
* // Access form task properties
|
|
13462
|
+
* console.log(formTask.formLayout);
|
|
13428
13463
|
*
|
|
13429
|
-
* //
|
|
13464
|
+
* // Get a document validation task by ID (faster with taskType provided in the options)
|
|
13465
|
+
* const dvTask = await tasks.getById(<taskId>, { taskType: TaskType.DocumentValidation }, <folderId>);
|
|
13430
13466
|
* ```
|
|
13431
13467
|
*/
|
|
13432
13468
|
async getById(id, options = {}, folderId) {
|
|
13469
|
+
const { taskType, ...restOptions } = options;
|
|
13470
|
+
// If taskType is provided, skip the generic GET_BY_ID call and go directly to the type-specific endpoint
|
|
13471
|
+
if (taskType && taskType in TASK_TYPE_ENDPOINTS) {
|
|
13472
|
+
if (!folderId) {
|
|
13473
|
+
throw new ValidationError({ message: 'folderId is required when taskType is provided' });
|
|
13474
|
+
}
|
|
13475
|
+
return this.getByTaskType(id, folderId, taskType, restOptions);
|
|
13476
|
+
}
|
|
13433
13477
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
13434
13478
|
// Add default expand parameters
|
|
13435
|
-
const modifiedOptions = this.addDefaultExpand(
|
|
13479
|
+
const modifiedOptions = this.addDefaultExpand(restOptions);
|
|
13436
13480
|
// prefix all keys in options
|
|
13437
13481
|
const keysToPrefix = Object.keys(modifiedOptions);
|
|
13438
13482
|
const apiOptions = addPrefixToKeys(modifiedOptions, ODATA_PREFIX, keysToPrefix);
|
|
@@ -13442,10 +13486,10 @@
|
|
|
13442
13486
|
});
|
|
13443
13487
|
// Transform response from PascalCase to camelCase and normalize time fields
|
|
13444
13488
|
const transformedTask = transformData(pascalToCamelCaseKeys(response.data), TaskMap);
|
|
13445
|
-
//
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
return this.
|
|
13489
|
+
// Get task type from response and fetch type-specific data
|
|
13490
|
+
const resolvedFolderId = folderId || transformedTask.folderId;
|
|
13491
|
+
if (transformedTask.type in TASK_TYPE_ENDPOINTS) {
|
|
13492
|
+
return this.getByTaskType(id, resolvedFolderId, transformedTask.type, restOptions);
|
|
13449
13493
|
}
|
|
13450
13494
|
return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
|
|
13451
13495
|
}
|
|
@@ -13634,24 +13678,33 @@
|
|
|
13634
13678
|
};
|
|
13635
13679
|
}
|
|
13636
13680
|
/**
|
|
13637
|
-
*
|
|
13681
|
+
* Routes to the type-specific endpoint based on task type.
|
|
13682
|
+
*/
|
|
13683
|
+
getByTaskType(id, folderId, taskType, options = {}) {
|
|
13684
|
+
const endpoint = TASK_TYPE_ENDPOINTS[taskType];
|
|
13685
|
+
const extraParams = taskType === exports.TaskType.Form ? { expandOnFormLayout: true, ...options } : options;
|
|
13686
|
+
return this.getTaskByTypeEndpoint(id, folderId, endpoint, extraParams);
|
|
13687
|
+
}
|
|
13688
|
+
/**
|
|
13689
|
+
* Fetches a task from a type-specific endpoint.
|
|
13638
13690
|
*
|
|
13639
|
-
* @param id - The
|
|
13691
|
+
* @param id - The task ID
|
|
13640
13692
|
* @param folderId - Required folder ID
|
|
13641
|
-
* @param
|
|
13642
|
-
* @
|
|
13693
|
+
* @param endpoint - The type-specific endpoint to call
|
|
13694
|
+
* @param extraParams - Additional query parameters (e.g. form options)
|
|
13695
|
+
* @returns Promise resolving to the task
|
|
13643
13696
|
*/
|
|
13644
|
-
async
|
|
13697
|
+
async getTaskByTypeEndpoint(id, folderId, endpoint, extraParams = {}) {
|
|
13645
13698
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
13646
|
-
const response = await this.get(
|
|
13699
|
+
const response = await this.get(endpoint, {
|
|
13647
13700
|
params: {
|
|
13648
13701
|
taskId: id,
|
|
13649
|
-
...
|
|
13702
|
+
...extraParams
|
|
13650
13703
|
},
|
|
13651
13704
|
headers
|
|
13652
13705
|
});
|
|
13653
|
-
const
|
|
13654
|
-
return createTaskWithMethods(applyDataTransforms(
|
|
13706
|
+
const transformedTask = transformData(response.data, TaskMap);
|
|
13707
|
+
return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
|
|
13655
13708
|
}
|
|
13656
13709
|
/**
|
|
13657
13710
|
* Adds default expand parameters to options
|
|
@@ -14666,6 +14719,106 @@
|
|
|
14666
14719
|
BucketOptions["AccessDataThroughOrchestrator"] = "AccessDataThroughOrchestrator";
|
|
14667
14720
|
})(exports.BucketOptions || (exports.BucketOptions = {}));
|
|
14668
14721
|
|
|
14722
|
+
/**
|
|
14723
|
+
* Maps fields for Job entities to ensure consistent naming
|
|
14724
|
+
* Semantic renames only — case conversion handled by pascalToCamelCaseKeys()
|
|
14725
|
+
*/
|
|
14726
|
+
const JobMap = {
|
|
14727
|
+
creationTime: 'createdTime',
|
|
14728
|
+
lastModificationTime: 'lastModifiedTime',
|
|
14729
|
+
organizationUnitId: 'folderId',
|
|
14730
|
+
organizationUnitFullyQualifiedName: 'folderName',
|
|
14731
|
+
releaseName: 'processName',
|
|
14732
|
+
releaseVersionId: 'processVersionId',
|
|
14733
|
+
processType: 'packageType',
|
|
14734
|
+
release: 'process',
|
|
14735
|
+
};
|
|
14736
|
+
|
|
14737
|
+
/**
|
|
14738
|
+
* Service for interacting with UiPath Orchestrator Jobs API
|
|
14739
|
+
*/
|
|
14740
|
+
class JobService extends FolderScopedService {
|
|
14741
|
+
/**
|
|
14742
|
+
* Gets all jobs across folders with optional filtering
|
|
14743
|
+
*
|
|
14744
|
+
* @param options - Query options including optional folderId and pagination options
|
|
14745
|
+
* @returns Promise resolving to array of jobs or paginated response
|
|
14746
|
+
*
|
|
14747
|
+
* @example
|
|
14748
|
+
* ```typescript
|
|
14749
|
+
* import { Jobs } from '@uipath/uipath-typescript/jobs';
|
|
14750
|
+
*
|
|
14751
|
+
* const jobs = new Jobs(sdk);
|
|
14752
|
+
*
|
|
14753
|
+
* // Get all jobs
|
|
14754
|
+
* const allJobs = await jobs.getAll();
|
|
14755
|
+
*
|
|
14756
|
+
* // Get all jobs in a specific folder
|
|
14757
|
+
* const folderJobs = await jobs.getAll({ folderId: 123 });
|
|
14758
|
+
*
|
|
14759
|
+
* // With filtering
|
|
14760
|
+
* const runningJobs = await jobs.getAll({
|
|
14761
|
+
* filter: "state eq 'Running'"
|
|
14762
|
+
* });
|
|
14763
|
+
*
|
|
14764
|
+
* // First page with pagination
|
|
14765
|
+
* const page1 = await jobs.getAll({ pageSize: 10 });
|
|
14766
|
+
*
|
|
14767
|
+
* // Navigate using cursor
|
|
14768
|
+
* if (page1.hasNextPage) {
|
|
14769
|
+
* const page2 = await jobs.getAll({ cursor: page1.nextCursor });
|
|
14770
|
+
* }
|
|
14771
|
+
* ```
|
|
14772
|
+
*/
|
|
14773
|
+
async getAll(options) {
|
|
14774
|
+
const transformJobResponse = (job) => transformData(pascalToCamelCaseKeys(job), JobMap);
|
|
14775
|
+
return PaginationHelpers.getAll({
|
|
14776
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
14777
|
+
getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
|
|
14778
|
+
getByFolderEndpoint: JOB_ENDPOINTS.GET_ALL,
|
|
14779
|
+
transformFn: transformJobResponse,
|
|
14780
|
+
pagination: {
|
|
14781
|
+
paginationType: PaginationType.OFFSET,
|
|
14782
|
+
itemsField: ODATA_PAGINATION.ITEMS_FIELD,
|
|
14783
|
+
totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
|
|
14784
|
+
paginationParams: {
|
|
14785
|
+
pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
14786
|
+
offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
|
|
14787
|
+
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
|
|
14788
|
+
},
|
|
14789
|
+
},
|
|
14790
|
+
}, options);
|
|
14791
|
+
}
|
|
14792
|
+
}
|
|
14793
|
+
__decorate([
|
|
14794
|
+
track('Jobs.GetAll')
|
|
14795
|
+
], JobService.prototype, "getAll", null);
|
|
14796
|
+
|
|
14797
|
+
/**
|
|
14798
|
+
* Enum for job sub-state
|
|
14799
|
+
*/
|
|
14800
|
+
exports.JobSubState = void 0;
|
|
14801
|
+
(function (JobSubState) {
|
|
14802
|
+
JobSubState["WithFaults"] = "WITH_FAULTS";
|
|
14803
|
+
JobSubState["Manually"] = "MANUALLY";
|
|
14804
|
+
})(exports.JobSubState || (exports.JobSubState = {}));
|
|
14805
|
+
/**
|
|
14806
|
+
* Enum for serverless job type
|
|
14807
|
+
*/
|
|
14808
|
+
exports.ServerlessJobType = void 0;
|
|
14809
|
+
(function (ServerlessJobType) {
|
|
14810
|
+
ServerlessJobType["RobotJob"] = "RobotJob";
|
|
14811
|
+
ServerlessJobType["WebApp"] = "WebApp";
|
|
14812
|
+
ServerlessJobType["LoadTest"] = "LoadTest";
|
|
14813
|
+
ServerlessJobType["StudioWebDesigner"] = "StudioWebDesigner";
|
|
14814
|
+
ServerlessJobType["PublishStudioProject"] = "PublishStudioProject";
|
|
14815
|
+
ServerlessJobType["JsApi"] = "JsApi";
|
|
14816
|
+
ServerlessJobType["PythonCodedAgent"] = "PythonCodedAgent";
|
|
14817
|
+
ServerlessJobType["MCPServer"] = "MCPServer";
|
|
14818
|
+
ServerlessJobType["PythonCodedSystemAgent"] = "PythonCodedSystemAgent";
|
|
14819
|
+
ServerlessJobType["PythonAgent"] = "PythonAgent";
|
|
14820
|
+
})(exports.ServerlessJobType || (exports.ServerlessJobType = {}));
|
|
14821
|
+
|
|
14669
14822
|
/**
|
|
14670
14823
|
* Maps fields for Process entities to ensure consistent naming
|
|
14671
14824
|
*/
|
|
@@ -14848,6 +15001,9 @@
|
|
|
14848
15001
|
PackageType["Api"] = "Api";
|
|
14849
15002
|
PackageType["MCPServer"] = "MCPServer";
|
|
14850
15003
|
PackageType["BusinessRules"] = "BusinessRules";
|
|
15004
|
+
PackageType["CaseManagement"] = "CaseManagement";
|
|
15005
|
+
PackageType["Flow"] = "Flow";
|
|
15006
|
+
PackageType["Function"] = "Function";
|
|
14851
15007
|
})(exports.PackageType || (exports.PackageType = {}));
|
|
14852
15008
|
/**
|
|
14853
15009
|
* Enum for job priority
|
|
@@ -14926,6 +15082,36 @@
|
|
|
14926
15082
|
PackageSourceType["AgentHub"] = "AgentHub";
|
|
14927
15083
|
PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
|
|
14928
15084
|
})(exports.PackageSourceType || (exports.PackageSourceType = {}));
|
|
15085
|
+
/**
|
|
15086
|
+
* Enum for job source type
|
|
15087
|
+
*/
|
|
15088
|
+
exports.JobSourceType = void 0;
|
|
15089
|
+
(function (JobSourceType) {
|
|
15090
|
+
JobSourceType["Manual"] = "Manual";
|
|
15091
|
+
JobSourceType["Schedule"] = "Schedule";
|
|
15092
|
+
JobSourceType["Agent"] = "Agent";
|
|
15093
|
+
JobSourceType["Queue"] = "Queue";
|
|
15094
|
+
JobSourceType["StudioWeb"] = "StudioWeb";
|
|
15095
|
+
JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
|
|
15096
|
+
JobSourceType["StudioDesktop"] = "StudioDesktop";
|
|
15097
|
+
JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
|
|
15098
|
+
JobSourceType["Apps"] = "Apps";
|
|
15099
|
+
JobSourceType["SAP"] = "SAP";
|
|
15100
|
+
JobSourceType["HttpTrigger"] = "HttpTrigger";
|
|
15101
|
+
JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
|
|
15102
|
+
JobSourceType["RobotAPI"] = "RobotAPI";
|
|
15103
|
+
JobSourceType["CommandLine"] = "CommandLine";
|
|
15104
|
+
JobSourceType["RobotNetAPI"] = "RobotNetAPI";
|
|
15105
|
+
JobSourceType["Autopilot"] = "Autopilot";
|
|
15106
|
+
JobSourceType["TestManager"] = "TestManager";
|
|
15107
|
+
JobSourceType["AgentService"] = "AgentService";
|
|
15108
|
+
JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
|
|
15109
|
+
JobSourceType["PluginEcosystem"] = "PluginEcosystem";
|
|
15110
|
+
JobSourceType["PerformanceTesting"] = "PerformanceTesting";
|
|
15111
|
+
JobSourceType["AgentHub"] = "AgentHub";
|
|
15112
|
+
JobSourceType["ApiWorkflow"] = "ApiWorkflow";
|
|
15113
|
+
JobSourceType["CaseManagement"] = "CaseManagement";
|
|
15114
|
+
})(exports.JobSourceType || (exports.JobSourceType = {}));
|
|
14929
15115
|
/**
|
|
14930
15116
|
* Enum for stop strategy
|
|
14931
15117
|
*/
|
|
@@ -14934,6 +15120,39 @@
|
|
|
14934
15120
|
StopStrategy["SoftStop"] = "SoftStop";
|
|
14935
15121
|
StopStrategy["Kill"] = "Kill";
|
|
14936
15122
|
})(exports.StopStrategy || (exports.StopStrategy = {}));
|
|
15123
|
+
/**
|
|
15124
|
+
* Enum for runtime type
|
|
15125
|
+
*/
|
|
15126
|
+
exports.RuntimeType = void 0;
|
|
15127
|
+
(function (RuntimeType) {
|
|
15128
|
+
RuntimeType["NonProduction"] = "NonProduction";
|
|
15129
|
+
RuntimeType["Attended"] = "Attended";
|
|
15130
|
+
RuntimeType["Unattended"] = "Unattended";
|
|
15131
|
+
RuntimeType["Development"] = "Development";
|
|
15132
|
+
RuntimeType["Studio"] = "Studio";
|
|
15133
|
+
RuntimeType["RpaDeveloper"] = "RpaDeveloper";
|
|
15134
|
+
RuntimeType["StudioX"] = "StudioX";
|
|
15135
|
+
RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
|
|
15136
|
+
RuntimeType["Headless"] = "Headless";
|
|
15137
|
+
RuntimeType["StudioPro"] = "StudioPro";
|
|
15138
|
+
RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
|
|
15139
|
+
RuntimeType["TestAutomation"] = "TestAutomation";
|
|
15140
|
+
RuntimeType["AutomationCloud"] = "AutomationCloud";
|
|
15141
|
+
RuntimeType["Serverless"] = "Serverless";
|
|
15142
|
+
RuntimeType["AutomationKit"] = "AutomationKit";
|
|
15143
|
+
RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
|
|
15144
|
+
RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
|
|
15145
|
+
RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
|
|
15146
|
+
RuntimeType["Hosting"] = "Hosting";
|
|
15147
|
+
RuntimeType["AssistantWeb"] = "AssistantWeb";
|
|
15148
|
+
RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
|
|
15149
|
+
RuntimeType["AgentService"] = "AgentService";
|
|
15150
|
+
RuntimeType["AppTest"] = "AppTest";
|
|
15151
|
+
RuntimeType["PerformanceTest"] = "PerformanceTest";
|
|
15152
|
+
RuntimeType["BusinessRule"] = "BusinessRule";
|
|
15153
|
+
RuntimeType["CaseManagement"] = "CaseManagement";
|
|
15154
|
+
RuntimeType["Flow"] = "Flow";
|
|
15155
|
+
})(exports.RuntimeType || (exports.RuntimeType = {}));
|
|
14937
15156
|
/**
|
|
14938
15157
|
* Enum for job type
|
|
14939
15158
|
*/
|
|
@@ -15056,6 +15275,49 @@
|
|
|
15056
15275
|
track('Queues.GetById')
|
|
15057
15276
|
], QueueService.prototype, "getById", null);
|
|
15058
15277
|
|
|
15278
|
+
/**
|
|
15279
|
+
* Maps fields for Attachment entities to ensure consistent naming
|
|
15280
|
+
*/
|
|
15281
|
+
const AttachmentsMap = {
|
|
15282
|
+
creationTime: 'createdTime',
|
|
15283
|
+
lastModificationTime: 'lastModifiedTime'
|
|
15284
|
+
};
|
|
15285
|
+
|
|
15286
|
+
class AttachmentService extends BaseService {
|
|
15287
|
+
/**
|
|
15288
|
+
* Gets an attachment by ID
|
|
15289
|
+
* @param id - The UUID of the attachment to retrieve
|
|
15290
|
+
* @param options - Optional query parameters (expand, select)
|
|
15291
|
+
* @returns Promise resolving to the attachment
|
|
15292
|
+
*
|
|
15293
|
+
* @example
|
|
15294
|
+
* ```typescript
|
|
15295
|
+
* import { Attachments } from '@uipath/uipath-typescript/attachments';
|
|
15296
|
+
*
|
|
15297
|
+
* const attachments = new Attachments(sdk);
|
|
15298
|
+
* const attachment = await attachments.getById('12345678-1234-1234-1234-123456789abc');
|
|
15299
|
+
* ```
|
|
15300
|
+
*/
|
|
15301
|
+
async getById(id, options = {}) {
|
|
15302
|
+
if (!id) {
|
|
15303
|
+
throw new ValidationError({ message: 'id is required for getById' });
|
|
15304
|
+
}
|
|
15305
|
+
// Prefix all keys in options with $ for OData
|
|
15306
|
+
const keysToPrefix = Object.keys(options);
|
|
15307
|
+
const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
|
|
15308
|
+
const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
|
|
15309
|
+
params: apiOptions,
|
|
15310
|
+
});
|
|
15311
|
+
// Transform response from PascalCase to camelCase, then apply field maps
|
|
15312
|
+
const camelCased = pascalToCamelCaseKeys(response.data);
|
|
15313
|
+
camelCased.blobFileAccess = transformData(camelCased.blobFileAccess, BucketMap);
|
|
15314
|
+
return transformData(camelCased, AttachmentsMap);
|
|
15315
|
+
}
|
|
15316
|
+
}
|
|
15317
|
+
__decorate([
|
|
15318
|
+
track('Attachments.GetById')
|
|
15319
|
+
], AttachmentService.prototype, "getById", null);
|
|
15320
|
+
|
|
15059
15321
|
/**
|
|
15060
15322
|
* UiPath SDK - Legacy class providing all services through property getters.
|
|
15061
15323
|
*
|