@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
@@ -26,7 +26,10 @@ declare enum JobState {
26
26
  Successful = "Successful",
27
27
  Stopped = "Stopped",
28
28
  Suspended = "Suspended",
29
- Resumed = "Resumed"
29
+ Resumed = "Resumed",
30
+ Cancelled = "Cancelled",
31
+ /** Server-side fallback for an unrecognized or missing job state. */
32
+ Unknown = "Unknown"
30
33
  }
31
34
  interface BaseOptions {
32
35
  expand?: string;
@@ -713,7 +713,16 @@ var PaginationType;
713
713
  * Returns the original value if parsing fails.
714
714
  */
715
715
  /**
716
- * Transforms data by mapping fields according to the provided field mapping
716
+ * Transforms data by renaming each key in `data` exactly once, using the
717
+ * mapping (`sourceField → targetField`). Keys not present in the mapping
718
+ * pass through unchanged. The original (pre-rename) key is dropped — the
719
+ * result contains only the renamed key.
720
+ *
721
+ * Each rename is independent. If the mapping happens to contain chained
722
+ * entries (`a → b` and `b → c`), they do NOT compose: a field named `a`
723
+ * in `data` becomes `b` (not `c`), because the renames are applied based
724
+ * on the original data's keys, not the running result.
725
+ *
717
726
  * @param data The source data to transform
718
727
  * @param fieldMapping Object mapping source field names to target field names
719
728
  * @returns Transformed data with mapped field names
@@ -736,21 +745,28 @@ var PaginationType;
736
745
  * // { userId: '123', name: 'john' },
737
746
  * // { userId: '456', name: 'jane' }
738
747
  * // ]
748
+ *
749
+ * // No chaining — `a → b` does not become `a → c` even if the map has `b → c`.
750
+ * transformData({ a: 1 }, { a: 'b', b: 'c' });
751
+ * // result = { b: 1 }
739
752
  * ```
740
753
  */
741
754
  function transformData(data, fieldMapping) {
755
+ // Pass null/undefined through unchanged — callers (e.g. AttachmentService.getById)
756
+ // may invoke this on optional fields that an OData `select` excluded.
757
+ if (data == null) {
758
+ return data;
759
+ }
742
760
  // Handle array of objects
743
761
  if (Array.isArray(data)) {
744
762
  return data.map(item => transformData(item, fieldMapping));
745
763
  }
746
- // Handle single object
747
- const result = { ...data };
748
- for (const [sourceField, targetField] of Object.entries(fieldMapping)) {
749
- if (sourceField in result) {
750
- const value = result[sourceField];
751
- delete result[sourceField];
752
- result[targetField] = value;
753
- }
764
+ // Walk the ORIGINAL data's keys, look up each in the mapping. One rename
765
+ // per data key — no mutation of an in-progress result, so chains can't form.
766
+ const result = {};
767
+ for (const [key, value] of Object.entries(data)) {
768
+ const renamedKey = fieldMapping[key] ?? key;
769
+ result[renamedKey] = value;
754
770
  }
755
771
  return result;
756
772
  }
@@ -1839,7 +1839,7 @@ const AGENT_TRACES_ENDPOINTS = {
1839
1839
  GET_ERRORS_TIMELINE: `${INSIGHTS_RTM_BASE}/Traceview/errorsTimeline`,
1840
1840
  /** Trace-level time-series of latency (decimal seconds per series). */
1841
1841
  GET_LATENCY_TIMELINE: `${INSIGHTS_RTM_BASE}/Traceview/latencyTimeline`,
1842
- /** Trace-level per-agent AGU/PLTU consumption totals. */
1842
+ /** Trace-level per-agent Agent Units and Platform Units consumption totals. */
1843
1843
  GET_UNIT_CONSUMPTION: `${INSIGHTS_RTM_BASE}/Traceview/unitConsumption`,
1844
1844
  /** All spans for a single trace (flat array, not paginated). */
1845
1845
  GET_SPANS_BY_TRACE_ID: (traceId) => `${INSIGHTS_RTM_BASE}/Traceview/spans/${traceId}`,
@@ -2078,7 +2078,7 @@ class AgentTracesService extends BaseService {
2078
2078
  * // Get per-agent unit consumption
2079
2079
  * const result = await trace.getUnitConsumption();
2080
2080
  * result.forEach((row) => {
2081
- * console.log(`${row.agentId}: ${row.agentUnitsConsumed} AGU, ${row.platformUnitsConsumed} PLTU`);
2081
+ * console.log(`${row.agentId}: ${row.agentUnitsConsumed} Agent Units, ${row.platformUnitsConsumed} Platform Units`);
2082
2082
  * });
2083
2083
  * ```
2084
2084
  * @example
@@ -633,7 +633,7 @@ interface AgentTraceGetLatencyTimelineOptions extends AgentTraceFilterOptions {
633
633
  }
634
634
  /**
635
635
  * Per-agent unit consumption totals over the requested window (trace-level) —
636
- * a flat per-(agent, version, folder) breakdown of AGU and PLTU consumed.
636
+ * a flat per-(agent, version, folder) breakdown of Agent Units and Platform Units consumed.
637
637
  */
638
638
  interface AgentTraceGetUnitConsumptionResponse {
639
639
  /** Agent ID these totals belong to. */
@@ -805,7 +805,7 @@ interface AgentTracesServiceModel {
805
805
  * // Get per-agent unit consumption
806
806
  * const result = await trace.getUnitConsumption();
807
807
  * result.forEach((row) => {
808
- * console.log(`${row.agentId}: ${row.agentUnitsConsumed} AGU, ${row.platformUnitsConsumed} PLTU`);
808
+ * console.log(`${row.agentId}: ${row.agentUnitsConsumed} Agent Units, ${row.platformUnitsConsumed} Platform Units`);
809
809
  * });
810
810
  * ```
811
811
  * @example
@@ -964,7 +964,7 @@ declare class AgentTracesService extends BaseService implements AgentTracesServi
964
964
  * // Get per-agent unit consumption
965
965
  * const result = await trace.getUnitConsumption();
966
966
  * result.forEach((row) => {
967
- * console.log(`${row.agentId}: ${row.agentUnitsConsumed} AGU, ${row.platformUnitsConsumed} PLTU`);
967
+ * console.log(`${row.agentId}: ${row.agentUnitsConsumed} Agent Units, ${row.platformUnitsConsumed} Platform Units`);
968
968
  * });
969
969
  * ```
970
970
  * @example
@@ -1837,7 +1837,7 @@ const AGENT_TRACES_ENDPOINTS = {
1837
1837
  GET_ERRORS_TIMELINE: `${INSIGHTS_RTM_BASE}/Traceview/errorsTimeline`,
1838
1838
  /** Trace-level time-series of latency (decimal seconds per series). */
1839
1839
  GET_LATENCY_TIMELINE: `${INSIGHTS_RTM_BASE}/Traceview/latencyTimeline`,
1840
- /** Trace-level per-agent AGU/PLTU consumption totals. */
1840
+ /** Trace-level per-agent Agent Units and Platform Units consumption totals. */
1841
1841
  GET_UNIT_CONSUMPTION: `${INSIGHTS_RTM_BASE}/Traceview/unitConsumption`,
1842
1842
  /** All spans for a single trace (flat array, not paginated). */
1843
1843
  GET_SPANS_BY_TRACE_ID: (traceId) => `${INSIGHTS_RTM_BASE}/Traceview/spans/${traceId}`,
@@ -2076,7 +2076,7 @@ class AgentTracesService extends BaseService {
2076
2076
  * // Get per-agent unit consumption
2077
2077
  * const result = await trace.getUnitConsumption();
2078
2078
  * result.forEach((row) => {
2079
- * console.log(`${row.agentId}: ${row.agentUnitsConsumed} AGU, ${row.platformUnitsConsumed} PLTU`);
2079
+ * console.log(`${row.agentId}: ${row.agentUnitsConsumed} Agent Units, ${row.platformUnitsConsumed} Platform Units`);
2080
2080
  * });
2081
2081
  * ```
2082
2082
  * @example
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/uipath-typescript",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "UiPath TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "keywords": [