@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.
- package/dist/agent-memory/index.d.ts +4 -1
- package/dist/agents/index.cjs +341 -6
- package/dist/agents/index.d.ts +717 -16
- package/dist/agents/index.mjs +342 -7
- package/dist/assets/index.cjs +25 -9
- package/dist/assets/index.mjs +25 -9
- package/dist/attachments/index.cjs +25 -9
- package/dist/attachments/index.mjs +25 -9
- package/dist/buckets/index.cjs +25 -9
- package/dist/buckets/index.mjs +25 -9
- package/dist/cases/index.cjs +621 -524
- package/dist/cases/index.d.ts +186 -43
- package/dist/cases/index.mjs +621 -524
- package/dist/conversational-agent/index.cjs +25 -9
- package/dist/conversational-agent/index.mjs +25 -9
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/document-understanding/index.cjs +84 -84
- package/dist/document-understanding/index.d.ts +2 -1
- package/dist/document-understanding/index.mjs +1 -1
- package/dist/entities/index.cjs +25 -9
- package/dist/entities/index.mjs +25 -9
- package/dist/feedback/index.cjs +25 -9
- package/dist/feedback/index.mjs +25 -9
- package/dist/index.cjs +332 -62
- package/dist/index.d.ts +827 -89
- package/dist/index.mjs +333 -63
- package/dist/index.umd.js +332 -62
- package/dist/jobs/index.cjs +129 -14
- package/dist/jobs/index.d.ts +10 -5
- package/dist/jobs/index.mjs +129 -14
- package/dist/maestro-processes/index.cjs +198 -100
- package/dist/maestro-processes/index.d.ts +188 -43
- package/dist/maestro-processes/index.mjs +198 -100
- package/dist/processes/index.cjs +25 -9
- package/dist/processes/index.d.ts +6 -1
- package/dist/processes/index.mjs +25 -9
- package/dist/queues/index.cjs +25 -9
- package/dist/queues/index.mjs +25 -9
- package/dist/tasks/index.cjs +25 -9
- package/dist/tasks/index.d.ts +4 -1
- package/dist/tasks/index.mjs +25 -9
- package/dist/traces/index.cjs +2 -2
- package/dist/traces/index.d.ts +3 -3
- package/dist/traces/index.mjs +2 -2
- package/package.json +1 -1
package/dist/buckets/index.cjs
CHANGED
|
@@ -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
|
|
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
|
-
//
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
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
|
}
|
package/dist/buckets/index.mjs
CHANGED
|
@@ -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
|
|
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
|
-
//
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
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
|
}
|