@uipath/uipath-typescript 1.3.9 → 1.3.11

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 (39) hide show
  1. package/dist/assets/index.cjs +19 -6
  2. package/dist/assets/index.mjs +19 -6
  3. package/dist/attachments/index.cjs +19 -6
  4. package/dist/attachments/index.mjs +19 -6
  5. package/dist/buckets/index.cjs +141 -6
  6. package/dist/buckets/index.d.ts +164 -1
  7. package/dist/buckets/index.mjs +141 -6
  8. package/dist/cases/index.cjs +70 -6
  9. package/dist/cases/index.d.ts +91 -1
  10. package/dist/cases/index.mjs +70 -6
  11. package/dist/conversational-agent/index.cjs +19 -6
  12. package/dist/conversational-agent/index.mjs +19 -6
  13. package/dist/core/index.cjs +1 -1
  14. package/dist/core/index.mjs +1 -1
  15. package/dist/entities/index.cjs +239 -34
  16. package/dist/entities/index.d.ts +311 -12
  17. package/dist/entities/index.mjs +239 -34
  18. package/dist/feedback/index.cjs +19 -6
  19. package/dist/feedback/index.mjs +19 -6
  20. package/dist/index.cjs +490 -64
  21. package/dist/index.d.ts +714 -36
  22. package/dist/index.mjs +490 -64
  23. package/dist/index.umd.js +491 -65
  24. package/dist/jobs/index.cjs +19 -6
  25. package/dist/jobs/index.mjs +19 -6
  26. package/dist/maestro-processes/index.cjs +70 -6
  27. package/dist/maestro-processes/index.d.ts +91 -1
  28. package/dist/maestro-processes/index.mjs +70 -6
  29. package/dist/processes/index.cjs +47 -35
  30. package/dist/processes/index.d.ts +76 -26
  31. package/dist/processes/index.mjs +47 -35
  32. package/dist/queues/index.cjs +19 -6
  33. package/dist/queues/index.mjs +19 -6
  34. package/dist/tasks/index.cjs +19 -6
  35. package/dist/tasks/index.mjs +19 -6
  36. package/dist/traces/index.cjs +1902 -0
  37. package/dist/traces/index.d.ts +565 -0
  38. package/dist/traces/index.mjs +1900 -0
  39. package/package.json +12 -2
@@ -1157,9 +1157,9 @@ class PaginationHelpers {
1157
1157
  * @returns Promise resolving to a paginated result
1158
1158
  */
1159
1159
  static async getAllPaginated(params) {
1160
- const { serviceAccess, getEndpoint, folderId, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1160
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1161
1161
  const endpoint = getEndpoint(folderId);
1162
- const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
1162
+ const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
1163
1163
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
1164
1164
  headers,
1165
1165
  params: additionalParams,
@@ -1187,13 +1187,13 @@ class PaginationHelpers {
1187
1187
  * @returns Promise resolving to an object with data and totalCount
1188
1188
  */
1189
1189
  static async getAllNonPaginated(params) {
1190
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1190
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1191
1191
  // Set default field names
1192
1192
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
1193
1193
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
1194
1194
  // Determine endpoint and headers based on folderId
1195
1195
  const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
1196
- const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
1196
+ const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
1197
1197
  // Make the API call based on method
1198
1198
  let response;
1199
1199
  if (method === HTTP_METHODS.POST) {
@@ -1252,6 +1252,7 @@ class PaginationHelpers {
1252
1252
  serviceAccess: config.serviceAccess,
1253
1253
  getEndpoint: config.getEndpoint,
1254
1254
  folderId,
1255
+ headers: config.headers,
1255
1256
  paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
1256
1257
  additionalParams: prefixedOptions,
1257
1258
  transformFn: config.transformFn,
@@ -1269,6 +1270,7 @@ class PaginationHelpers {
1269
1270
  getAllEndpoint: config.getEndpoint(),
1270
1271
  getByFolderEndpoint: byFolderEndpoint,
1271
1272
  folderId,
1273
+ headers: config.headers,
1272
1274
  additionalParams: prefixedOptions,
1273
1275
  transformFn: config.transformFn,
1274
1276
  method: config.method,
@@ -1598,14 +1600,25 @@ class ApiClient {
1598
1600
  if (!text) {
1599
1601
  return undefined;
1600
1602
  }
1601
- return JSON.parse(text);
1603
+ try {
1604
+ return JSON.parse(text);
1605
+ }
1606
+ catch (error) {
1607
+ if (error instanceof SyntaxError) {
1608
+ throw new ServerError({
1609
+ message: `Server returned non-JSON response (${response.status} ${response.url}): ${error.message}`,
1610
+ statusCode: response.status,
1611
+ });
1612
+ }
1613
+ throw error;
1614
+ }
1602
1615
  }
1603
1616
  catch (error) {
1604
1617
  // If it's already one of our errors, re-throw it
1605
1618
  if (error.type && error.type.includes('Error')) {
1606
1619
  throw error;
1607
1620
  }
1608
- // Otherwise, it's likely a network error
1621
+ // Otherwise, it's a genuine network/fetch failure
1609
1622
  throw ErrorFactory.createNetworkError(error);
1610
1623
  }
1611
1624
  }