@uipath/uipath-typescript 1.3.2 → 1.3.4

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.
Files changed (38) hide show
  1. package/dist/assets/index.cjs +21 -8
  2. package/dist/assets/index.mjs +21 -8
  3. package/dist/attachments/index.cjs +21 -8
  4. package/dist/attachments/index.mjs +21 -8
  5. package/dist/buckets/index.cjs +21 -8
  6. package/dist/buckets/index.mjs +21 -8
  7. package/dist/cases/index.cjs +41 -13
  8. package/dist/cases/index.d.ts +15 -0
  9. package/dist/cases/index.mjs +41 -13
  10. package/dist/conversational-agent/index.cjs +39 -8
  11. package/dist/conversational-agent/index.d.ts +55 -2
  12. package/dist/conversational-agent/index.mjs +39 -8
  13. package/dist/core/index.cjs +16 -1
  14. package/dist/core/index.d.ts +1 -1
  15. package/dist/core/index.mjs +16 -1
  16. package/dist/entities/index.cjs +55 -8
  17. package/dist/entities/index.d.ts +54 -0
  18. package/dist/entities/index.mjs +55 -8
  19. package/dist/feedback/index.cjs +1911 -0
  20. package/dist/feedback/index.d.ts +475 -0
  21. package/dist/feedback/index.mjs +1909 -0
  22. package/dist/index.cjs +451 -189
  23. package/dist/index.d.ts +388 -13
  24. package/dist/index.mjs +452 -190
  25. package/dist/index.umd.js +451 -189
  26. package/dist/jobs/index.cjs +384 -8
  27. package/dist/jobs/index.d.ts +220 -2
  28. package/dist/jobs/index.mjs +385 -9
  29. package/dist/maestro-processes/index.cjs +21 -8
  30. package/dist/maestro-processes/index.mjs +21 -8
  31. package/dist/processes/index.cjs +21 -8
  32. package/dist/processes/index.mjs +21 -8
  33. package/dist/queues/index.cjs +21 -8
  34. package/dist/queues/index.mjs +21 -8
  35. package/dist/tasks/index.cjs +41 -13
  36. package/dist/tasks/index.d.ts +25 -10
  37. package/dist/tasks/index.mjs +42 -14
  38. package/package.json +13 -2
@@ -108,6 +108,20 @@ type HasPaginationOptions<T> = (T & {
108
108
  jumpToPage: number;
109
109
  });
110
110
 
111
+ declare enum TaskUserType {
112
+ /** A user of this type is supposed to be used by a human. */
113
+ User = "User",
114
+ /** A user of this type is automatically created when adding a robot, is associated with Robot role and it is used by a robot when communicating with Orchestrator. */
115
+ Robot = "Robot",
116
+ /** A user of type Directory User */
117
+ DirectoryUser = "DirectoryUser",
118
+ /** A user of type Directory Group */
119
+ DirectoryGroup = "DirectoryGroup",
120
+ /** A user of type Directory Robot Account */
121
+ DirectoryRobot = "DirectoryRobot",
122
+ /** A user of type Directory External Application */
123
+ DirectoryExternalApplication = "DirectoryExternalApplication"
124
+ }
111
125
  interface UserLoginInfo {
112
126
  name: string;
113
127
  surname: string;
@@ -115,6 +129,7 @@ interface UserLoginInfo {
115
129
  emailAddress: string;
116
130
  displayName: string;
117
131
  id: number;
132
+ type: TaskUserType;
118
133
  }
119
134
  /**
120
135
  * Types of tasks available in Action Center.
@@ -589,17 +604,17 @@ interface TaskServiceModel {
589
604
  */
590
605
  complete(options: TaskCompletionOptions, folderId: number): Promise<OperationResponse<TaskCompletionOptions>>;
591
606
  /**
592
- * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
607
+ * Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions
593
608
  * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
594
609
  * or a PaginatedResponse when any pagination parameter is provided
595
610
  *
596
- * @param folderId - The folder ID to get users from
611
+ * @param folderId - The folder ID to get task users from
597
612
  * @param options - Optional query and pagination parameters
598
- * @returns Promise resolving to either an array of users NonPaginatedResponse<UserLoginInfo> or a PaginatedResponse<UserLoginInfo> when pagination options are used.
613
+ * @returns Promise resolving to either an array of task users NonPaginatedResponse<UserLoginInfo> or a PaginatedResponse<UserLoginInfo> when pagination options are used.
599
614
  * {@link UserLoginInfo}
600
615
  * @example
601
616
  * ```typescript
602
- * // Get users from a folder
617
+ * // Get task users from a folder
603
618
  * const users = await tasks.getUsers(<folderId>);
604
619
  *
605
620
  * // Access user properties
@@ -898,15 +913,15 @@ declare class TaskService extends BaseService implements TaskServiceModel {
898
913
  */
899
914
  create(task: TaskCreateOptions, folderId: number): Promise<TaskCreateResponse>;
900
915
  /**
901
- * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
916
+ * Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions
902
917
  *
903
918
  * The method returns either:
904
- * - An array of users (when no pagination parameters are provided)
919
+ * - An array of task users (when no pagination parameters are provided)
905
920
  * - A paginated result with navigation cursors (when any pagination parameter is provided)
906
921
  *
907
- * @param folderId - The folder ID to get users from
922
+ * @param folderId - The folder ID to get task users from
908
923
  * @param options - Optional query and pagination parameters
909
- * @returns Promise resolving to an array of users or paginated result
924
+ * @returns Promise resolving to an array of task users or paginated result
910
925
  *
911
926
  * @example
912
927
  * ```typescript
@@ -917,7 +932,7 @@ declare class TaskService extends BaseService implements TaskServiceModel {
917
932
  * // Standard array return
918
933
  * const users = await tasks.getUsers(123);
919
934
  *
920
- * // Get users with filtering
935
+ * // Get task users with filtering
921
936
  * const users = await tasks.getUsers(123, {
922
937
  * filter: "name eq 'abc'"
923
938
  * });
@@ -1164,5 +1179,5 @@ declare class TaskService extends BaseService implements TaskServiceModel {
1164
1179
  private addDefaultExpand;
1165
1180
  }
1166
1181
 
1167
- export { TaskActivityType, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskService as Tasks, createTaskWithMethods };
1182
+ export { TaskActivityType, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TaskService as Tasks, createTaskWithMethods };
1168
1183
  export type { RawTaskCreateResponse, RawTaskGetResponse, Tag, TaskActivity, TaskAssignOptions, TaskAssignment, TaskAssignmentOptions, TaskAssignmentResponse, TaskBaseResponse, TaskCompleteOptions, TaskCompletionOptions, TaskCreateOptions, TaskCreateResponse, TaskGetAllOptions, TaskGetByIdOptions, TaskGetResponse, TaskGetUsersOptions, TaskMethods, TaskServiceModel, TaskSlaDetail, TaskSource, TasksUnassignOptions, UserLoginInfo };
@@ -276,7 +276,7 @@ class NetworkError extends UiPathError {
276
276
  // Connection string placeholder that will be replaced during build
277
277
  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";
278
278
  // SDK Version placeholder
279
- const SDK_VERSION = "1.3.2";
279
+ const SDK_VERSION = "1.3.4";
280
280
  const VERSION = "Version";
281
281
  const SERVICE = "Service";
282
282
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -544,6 +544,21 @@ function track(nameOrOptions, options) {
544
544
  };
545
545
  }
546
546
 
547
+ var TaskUserType;
548
+ (function (TaskUserType) {
549
+ /** A user of this type is supposed to be used by a human. */
550
+ TaskUserType["User"] = "User";
551
+ /** A user of this type is automatically created when adding a robot, is associated with Robot role and it is used by a robot when communicating with Orchestrator. */
552
+ TaskUserType["Robot"] = "Robot";
553
+ /** A user of type Directory User */
554
+ TaskUserType["DirectoryUser"] = "DirectoryUser";
555
+ /** A user of type Directory Group */
556
+ TaskUserType["DirectoryGroup"] = "DirectoryGroup";
557
+ /** A user of type Directory Robot Account */
558
+ TaskUserType["DirectoryRobot"] = "DirectoryRobot";
559
+ /** A user of type Directory External Application */
560
+ TaskUserType["DirectoryExternalApplication"] = "DirectoryExternalApplication";
561
+ })(TaskUserType || (TaskUserType = {}));
547
562
  /**
548
563
  * Types of tasks available in Action Center.
549
564
  * Each type determines the task's behavior, UI rendering, and completion requirements.
@@ -780,6 +795,8 @@ const BUCKET_TOKEN_PARAMS = {
780
795
  };
781
796
 
782
797
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
798
+ const TRACEPARENT = 'traceparent';
799
+ const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
783
800
  /**
784
801
  * Content type constants for HTTP requests/responses
785
802
  */
@@ -1409,8 +1426,9 @@ class PaginationHelpers {
1409
1426
  });
1410
1427
  }
1411
1428
  // Extract and transform items from response
1412
- const rawItems = response.data?.[itemsField];
1413
- const totalCount = response.data?.[totalCountField];
1429
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1430
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1431
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1414
1432
  // Parse items - automatically handle JSON string responses
1415
1433
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1416
1434
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1749,8 +1767,13 @@ class ApiClient {
1749
1767
  if (isFormData) {
1750
1768
  delete defaultHeaders['Content-Type'];
1751
1769
  }
1770
+ const traceId = crypto.randomUUID().replace(/-/g, '');
1771
+ const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
1772
+ const traceparentValue = `00-${traceId}-${spanId}-01`;
1752
1773
  const headers = {
1753
1774
  ...defaultHeaders,
1775
+ [TRACEPARENT]: traceparentValue,
1776
+ [UIPATH_TRACEPARENT_ID]: traceparentValue,
1754
1777
  ...options.headers
1755
1778
  };
1756
1779
  // Convert params to URLSearchParams
@@ -1790,7 +1813,11 @@ class ApiClient {
1790
1813
  const text = await response.text();
1791
1814
  return text;
1792
1815
  }
1793
- return response.json();
1816
+ const text = await response.text();
1817
+ if (!text) {
1818
+ return undefined;
1819
+ }
1820
+ return JSON.parse(text);
1794
1821
  }
1795
1822
  catch (error) {
1796
1823
  // If it's already one of our errors, re-throw it
@@ -2072,7 +2099,7 @@ class BaseService {
2072
2099
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
2073
2100
  // Prepare request parameters based on pagination type
2074
2101
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
2075
- // For POST requests, merge pagination params into body; for GET, use query params
2102
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
2076
2103
  if (method.toUpperCase() === 'POST') {
2077
2104
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
2078
2105
  options.body = {
@@ -2080,6 +2107,7 @@ class BaseService {
2080
2107
  ...options.params,
2081
2108
  ...requestParams
2082
2109
  };
2110
+ options.params = undefined;
2083
2111
  }
2084
2112
  else {
2085
2113
  // Merge pagination parameters with existing parameters
@@ -2120,7 +2148,6 @@ class BaseService {
2120
2148
  if (params.pageNumber && params.pageNumber > 1) {
2121
2149
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
2122
2150
  }
2123
- // Include total count for ODATA APIs
2124
2151
  {
2125
2152
  requestParams[countParam] = true;
2126
2153
  }
@@ -2148,8 +2175,9 @@ class BaseService {
2148
2175
  const totalCountField = fields.totalCountField || 'totalRecordCount';
2149
2176
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
2150
2177
  // Extract items and metadata
2151
- const items = response.data[itemsField] || [];
2152
- const totalCount = response.data[totalCountField];
2178
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
2179
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
2180
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
2153
2181
  const continuationToken = response.data[continuationTokenField];
2154
2182
  // Determine if there are more pages
2155
2183
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -2253,15 +2281,15 @@ class TaskService extends BaseService {
2253
2281
  return createTaskWithMethods(transformedData, this);
2254
2282
  }
2255
2283
  /**
2256
- * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
2284
+ * Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions
2257
2285
  *
2258
2286
  * The method returns either:
2259
- * - An array of users (when no pagination parameters are provided)
2287
+ * - An array of task users (when no pagination parameters are provided)
2260
2288
  * - A paginated result with navigation cursors (when any pagination parameter is provided)
2261
2289
  *
2262
- * @param folderId - The folder ID to get users from
2290
+ * @param folderId - The folder ID to get task users from
2263
2291
  * @param options - Optional query and pagination parameters
2264
- * @returns Promise resolving to an array of users or paginated result
2292
+ * @returns Promise resolving to an array of task users or paginated result
2265
2293
  *
2266
2294
  * @example
2267
2295
  * ```typescript
@@ -2272,7 +2300,7 @@ class TaskService extends BaseService {
2272
2300
  * // Standard array return
2273
2301
  * const users = await tasks.getUsers(123);
2274
2302
  *
2275
- * // Get users with filtering
2303
+ * // Get task users with filtering
2276
2304
  * const users = await tasks.getUsers(123, {
2277
2305
  * filter: "name eq 'abc'"
2278
2306
  * });
@@ -2688,4 +2716,4 @@ __decorate([
2688
2716
  track('Tasks.Complete')
2689
2717
  ], TaskService.prototype, "complete", null);
2690
2718
 
2691
- export { TaskActivityType, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskService as Tasks, createTaskWithMethods };
2719
+ export { TaskActivityType, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TaskService as Tasks, createTaskWithMethods };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/uipath-typescript",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "UiPath TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -145,6 +145,16 @@
145
145
  "types": "./dist/conversational-agent/index.d.ts",
146
146
  "default": "./dist/conversational-agent/index.cjs"
147
147
  }
148
+ },
149
+ "./feedback": {
150
+ "import": {
151
+ "types": "./dist/feedback/index.d.ts",
152
+ "default": "./dist/feedback/index.mjs"
153
+ },
154
+ "require": {
155
+ "types": "./dist/feedback/index.d.ts",
156
+ "default": "./dist/feedback/index.cjs"
157
+ }
148
158
  }
149
159
  },
150
160
  "files": [
@@ -195,8 +205,9 @@
195
205
  "dotenv": "^17.2.0",
196
206
  "oxlint": "^1.43.0",
197
207
  "rimraf": "^6.0.1",
198
- "rollup": "^4.59.1",
208
+ "rollup": "^4.60.2",
199
209
  "rollup-plugin-dts": "^6.1.0",
210
+ "tslib": "^2.8.1",
200
211
  "typedoc": "^0.28.13",
201
212
  "typedoc-plugin-markdown": "^4.8.1",
202
213
  "typescript": "^5.3.3",