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