@uipath/uipath-typescript 1.4.1 → 1.5.0

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 (46) hide show
  1. package/dist/agent-memory/index.d.ts +4 -1
  2. package/dist/agents/index.cjs +341 -6
  3. package/dist/agents/index.d.ts +717 -16
  4. package/dist/agents/index.mjs +342 -7
  5. package/dist/assets/index.cjs +25 -9
  6. package/dist/assets/index.mjs +25 -9
  7. package/dist/attachments/index.cjs +25 -9
  8. package/dist/attachments/index.mjs +25 -9
  9. package/dist/buckets/index.cjs +25 -9
  10. package/dist/buckets/index.mjs +25 -9
  11. package/dist/cases/index.cjs +621 -524
  12. package/dist/cases/index.d.ts +186 -43
  13. package/dist/cases/index.mjs +621 -524
  14. package/dist/conversational-agent/index.cjs +25 -9
  15. package/dist/conversational-agent/index.mjs +25 -9
  16. package/dist/core/index.cjs +1 -1
  17. package/dist/core/index.mjs +1 -1
  18. package/dist/document-understanding/index.cjs +84 -84
  19. package/dist/document-understanding/index.d.ts +2 -1
  20. package/dist/document-understanding/index.mjs +1 -1
  21. package/dist/entities/index.cjs +25 -9
  22. package/dist/entities/index.mjs +25 -9
  23. package/dist/feedback/index.cjs +25 -9
  24. package/dist/feedback/index.mjs +25 -9
  25. package/dist/index.cjs +332 -62
  26. package/dist/index.d.ts +827 -89
  27. package/dist/index.mjs +333 -63
  28. package/dist/index.umd.js +332 -62
  29. package/dist/jobs/index.cjs +129 -14
  30. package/dist/jobs/index.d.ts +10 -5
  31. package/dist/jobs/index.mjs +129 -14
  32. package/dist/maestro-processes/index.cjs +198 -100
  33. package/dist/maestro-processes/index.d.ts +188 -43
  34. package/dist/maestro-processes/index.mjs +198 -100
  35. package/dist/processes/index.cjs +25 -9
  36. package/dist/processes/index.d.ts +6 -1
  37. package/dist/processes/index.mjs +25 -9
  38. package/dist/queues/index.cjs +25 -9
  39. package/dist/queues/index.mjs +25 -9
  40. package/dist/tasks/index.cjs +25 -9
  41. package/dist/tasks/index.d.ts +4 -1
  42. package/dist/tasks/index.mjs +25 -9
  43. package/dist/traces/index.cjs +2 -2
  44. package/dist/traces/index.d.ts +3 -3
  45. package/dist/traces/index.mjs +2 -2
  46. package/package.json +1 -1
@@ -966,7 +966,16 @@ const BUCKET_TOKEN_PARAMS = {
966
966
  * Returns the original value if parsing fails.
967
967
  */
968
968
  /**
969
- * Transforms data by mapping fields according to the provided field mapping
969
+ * Transforms data by renaming each key in `data` exactly once, using the
970
+ * mapping (`sourceField → targetField`). Keys not present in the mapping
971
+ * pass through unchanged. The original (pre-rename) key is dropped — the
972
+ * result contains only the renamed key.
973
+ *
974
+ * Each rename is independent. If the mapping happens to contain chained
975
+ * entries (`a → b` and `b → c`), they do NOT compose: a field named `a`
976
+ * in `data` becomes `b` (not `c`), because the renames are applied based
977
+ * on the original data's keys, not the running result.
978
+ *
970
979
  * @param data The source data to transform
971
980
  * @param fieldMapping Object mapping source field names to target field names
972
981
  * @returns Transformed data with mapped field names
@@ -989,21 +998,28 @@ const BUCKET_TOKEN_PARAMS = {
989
998
  * // { userId: '123', name: 'john' },
990
999
  * // { userId: '456', name: 'jane' }
991
1000
  * // ]
1001
+ *
1002
+ * // No chaining — `a → b` does not become `a → c` even if the map has `b → c`.
1003
+ * transformData({ a: 1 }, { a: 'b', b: 'c' });
1004
+ * // result = { b: 1 }
992
1005
  * ```
993
1006
  */
994
1007
  function transformData(data, fieldMapping) {
1008
+ // Pass null/undefined through unchanged — callers (e.g. AttachmentService.getById)
1009
+ // may invoke this on optional fields that an OData `select` excluded.
1010
+ if (data == null) {
1011
+ return data;
1012
+ }
995
1013
  // Handle array of objects
996
1014
  if (Array.isArray(data)) {
997
1015
  return data.map(item => transformData(item, fieldMapping));
998
1016
  }
999
- // Handle single object
1000
- const result = { ...data };
1001
- for (const [sourceField, targetField] of Object.entries(fieldMapping)) {
1002
- if (sourceField in result) {
1003
- const value = result[sourceField];
1004
- delete result[sourceField];
1005
- result[targetField] = value;
1006
- }
1017
+ // Walk the ORIGINAL data's keys, look up each in the mapping. One rename
1018
+ // per data key — no mutation of an in-progress result, so chains can't form.
1019
+ const result = {};
1020
+ for (const [key, value] of Object.entries(data)) {
1021
+ const renamedKey = fieldMapping[key] ?? key;
1022
+ result[renamedKey] = value;
1007
1023
  }
1008
1024
  return result;
1009
1025
  }
@@ -964,7 +964,16 @@ const BUCKET_TOKEN_PARAMS = {
964
964
  * Returns the original value if parsing fails.
965
965
  */
966
966
  /**
967
- * Transforms data by mapping fields according to the provided field mapping
967
+ * Transforms data by renaming each key in `data` exactly once, using the
968
+ * mapping (`sourceField → targetField`). Keys not present in the mapping
969
+ * pass through unchanged. The original (pre-rename) key is dropped — the
970
+ * result contains only the renamed key.
971
+ *
972
+ * Each rename is independent. If the mapping happens to contain chained
973
+ * entries (`a → b` and `b → c`), they do NOT compose: a field named `a`
974
+ * in `data` becomes `b` (not `c`), because the renames are applied based
975
+ * on the original data's keys, not the running result.
976
+ *
968
977
  * @param data The source data to transform
969
978
  * @param fieldMapping Object mapping source field names to target field names
970
979
  * @returns Transformed data with mapped field names
@@ -987,21 +996,28 @@ const BUCKET_TOKEN_PARAMS = {
987
996
  * // { userId: '123', name: 'john' },
988
997
  * // { userId: '456', name: 'jane' }
989
998
  * // ]
999
+ *
1000
+ * // No chaining — `a → b` does not become `a → c` even if the map has `b → c`.
1001
+ * transformData({ a: 1 }, { a: 'b', b: 'c' });
1002
+ * // result = { b: 1 }
990
1003
  * ```
991
1004
  */
992
1005
  function transformData(data, fieldMapping) {
1006
+ // Pass null/undefined through unchanged — callers (e.g. AttachmentService.getById)
1007
+ // may invoke this on optional fields that an OData `select` excluded.
1008
+ if (data == null) {
1009
+ return data;
1010
+ }
993
1011
  // Handle array of objects
994
1012
  if (Array.isArray(data)) {
995
1013
  return data.map(item => transformData(item, fieldMapping));
996
1014
  }
997
- // Handle single object
998
- const result = { ...data };
999
- for (const [sourceField, targetField] of Object.entries(fieldMapping)) {
1000
- if (sourceField in result) {
1001
- const value = result[sourceField];
1002
- delete result[sourceField];
1003
- result[targetField] = value;
1004
- }
1015
+ // Walk the ORIGINAL data's keys, look up each in the mapping. One rename
1016
+ // per data key — no mutation of an in-progress result, so chains can't form.
1017
+ const result = {};
1018
+ for (const [key, value] of Object.entries(data)) {
1019
+ const renamedKey = fieldMapping[key] ?? key;
1020
+ result[renamedKey] = value;
1005
1021
  }
1006
1022
  return result;
1007
1023
  }