@uipath/uipath-typescript 1.3.6 → 1.3.8
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/assets/index.cjs +243 -6
- package/dist/assets/index.d.ts +113 -13
- package/dist/assets/index.mjs +243 -6
- package/dist/attachments/index.cjs +42 -6
- package/dist/attachments/index.d.ts +8 -0
- package/dist/attachments/index.mjs +42 -6
- package/dist/buckets/index.cjs +211 -6
- package/dist/buckets/index.d.ts +57 -12
- package/dist/buckets/index.mjs +211 -6
- package/dist/cases/index.cjs +180 -6
- package/dist/cases/index.d.ts +165 -3
- package/dist/cases/index.mjs +181 -7
- package/dist/conversational-agent/index.cjs +235 -85
- package/dist/conversational-agent/index.d.ts +327 -80
- package/dist/conversational-agent/index.mjs +234 -84
- package/dist/core/index.cjs +18 -6
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +18 -6
- package/dist/entities/index.cjs +74 -10
- package/dist/entities/index.d.ts +102 -11
- package/dist/entities/index.mjs +75 -11
- package/dist/feedback/index.cjs +293 -10
- package/dist/feedback/index.d.ts +425 -12
- package/dist/feedback/index.mjs +293 -10
- package/dist/index.cjs +463 -17
- package/dist/index.d.ts +885 -39
- package/dist/index.mjs +464 -18
- package/dist/index.umd.js +463 -17
- package/dist/jobs/index.cjs +211 -6
- package/dist/jobs/index.d.ts +68 -23
- package/dist/jobs/index.mjs +211 -6
- package/dist/maestro-processes/index.cjs +79 -6
- package/dist/maestro-processes/index.d.ts +8 -0
- package/dist/maestro-processes/index.mjs +79 -6
- package/dist/processes/index.cjs +279 -7
- package/dist/processes/index.d.ts +125 -2
- package/dist/processes/index.mjs +279 -7
- package/dist/queues/index.cjs +211 -6
- package/dist/queues/index.d.ts +57 -12
- package/dist/queues/index.mjs +211 -6
- package/dist/tasks/index.cjs +42 -6
- package/dist/tasks/index.d.ts +8 -0
- package/dist/tasks/index.mjs +42 -6
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
51
51
|
// Connection string placeholder that will be replaced during build
|
|
52
52
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
53
53
|
// SDK Version placeholder
|
|
54
|
-
const SDK_VERSION = "1.3.
|
|
54
|
+
const SDK_VERSION = "1.3.8";
|
|
55
55
|
const VERSION = "Version";
|
|
56
56
|
const SERVICE = "Service";
|
|
57
57
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -805,6 +805,21 @@ const RESPONSE_TYPES = {
|
|
|
805
805
|
* in Conversational Agents Service)
|
|
806
806
|
*/
|
|
807
807
|
const EXTERNAL_USER_ID = 'x-uipath-external-user-id';
|
|
808
|
+
/**
|
|
809
|
+
* Optional identifier used in UiPath logs to identify the implementing service
|
|
810
|
+
* of requests. External consumers do not need to set it; the server logs
|
|
811
|
+
* missing values as "unknown".
|
|
812
|
+
*
|
|
813
|
+
* @internal
|
|
814
|
+
*/
|
|
815
|
+
const CONVERSATIONAL_SURFACE_NAME = 'x-uipath-conversational-surfacename';
|
|
816
|
+
/**
|
|
817
|
+
* Optional version of the implementing service of requests. Paired with
|
|
818
|
+
* `surfaceName` for internal telemetry.
|
|
819
|
+
*
|
|
820
|
+
* @internal
|
|
821
|
+
*/
|
|
822
|
+
const CONVERSATIONAL_SURFACE_VERSION = 'x-uipath-conversational-surfaceversion';
|
|
808
823
|
/**
|
|
809
824
|
* Query parameter keys sent during WebSocket connection
|
|
810
825
|
*/
|
|
@@ -812,6 +827,8 @@ const WEBSOCKET_QUERY_PARAMS = {
|
|
|
812
827
|
ORGANIZATION_ID: 'x-uipath-internal-accountid',
|
|
813
828
|
TENANT_ID: 'x-uipath-internal-tenantid',
|
|
814
829
|
EXTERNAL_USER_ID,
|
|
830
|
+
CONVERSATIONAL_SURFACE_NAME,
|
|
831
|
+
CONVERSATIONAL_SURFACE_VERSION,
|
|
815
832
|
};
|
|
816
833
|
|
|
817
834
|
class ApiClient {
|
|
@@ -939,6 +956,27 @@ var PaginationType;
|
|
|
939
956
|
/**
|
|
940
957
|
* Collection of utility functions for working with objects
|
|
941
958
|
*/
|
|
959
|
+
/**
|
|
960
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
961
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
962
|
+
* Direct key match takes priority over nested traversal.
|
|
963
|
+
*/
|
|
964
|
+
function resolveNestedField(data, fieldPath) {
|
|
965
|
+
if (!data) {
|
|
966
|
+
return undefined;
|
|
967
|
+
}
|
|
968
|
+
if (fieldPath in data) {
|
|
969
|
+
return data[fieldPath];
|
|
970
|
+
}
|
|
971
|
+
if (!fieldPath.includes('.')) {
|
|
972
|
+
return undefined;
|
|
973
|
+
}
|
|
974
|
+
let value = data;
|
|
975
|
+
for (const part of fieldPath.split('.')) {
|
|
976
|
+
value = value?.[part];
|
|
977
|
+
}
|
|
978
|
+
return value;
|
|
979
|
+
}
|
|
942
980
|
/**
|
|
943
981
|
* Filters out undefined values from an object
|
|
944
982
|
* @param obj The source object
|
|
@@ -1188,6 +1226,10 @@ const CONVERSATIONAL_TOKEN_PARAMS = {
|
|
|
1188
1226
|
TOKEN_PARAM: 'cursor'
|
|
1189
1227
|
};
|
|
1190
1228
|
|
|
1229
|
+
/**
|
|
1230
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
1231
|
+
* Returns the original value if parsing fails.
|
|
1232
|
+
*/
|
|
1191
1233
|
/**
|
|
1192
1234
|
* Transforms data by mapping fields according to the provided field mapping
|
|
1193
1235
|
* @param data The source data to transform
|
|
@@ -1557,7 +1599,8 @@ class PaginationHelpers {
|
|
|
1557
1599
|
// Extract and transform items from response
|
|
1558
1600
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1559
1601
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1560
|
-
const
|
|
1602
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1603
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1561
1604
|
// Parse items - automatically handle JSON string responses
|
|
1562
1605
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1563
1606
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1733,8 +1776,9 @@ class BaseService {
|
|
|
1733
1776
|
constructor(instance, headers) {
|
|
1734
1777
|
// Private field - not visible via Object.keys() or any reflection
|
|
1735
1778
|
_BaseService_apiClient.set(this, void 0);
|
|
1736
|
-
const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
|
|
1779
|
+
const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
|
|
1737
1780
|
__classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
|
|
1781
|
+
this.config = { folderKey };
|
|
1738
1782
|
}
|
|
1739
1783
|
/**
|
|
1740
1784
|
* Gets a valid authentication token, refreshing if necessary.
|
|
@@ -1853,9 +1897,17 @@ class BaseService {
|
|
|
1853
1897
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1854
1898
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1855
1899
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1900
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1901
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1902
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1856
1903
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1857
|
-
if (
|
|
1858
|
-
|
|
1904
|
+
if (convertToSkip) {
|
|
1905
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1906
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
else {
|
|
1910
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1859
1911
|
}
|
|
1860
1912
|
{
|
|
1861
1913
|
requestParams[countParam] = true;
|
|
@@ -1886,7 +1938,8 @@ class BaseService {
|
|
|
1886
1938
|
// Extract items and metadata
|
|
1887
1939
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1888
1940
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1889
|
-
const
|
|
1941
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1942
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1890
1943
|
const continuationToken = response.data[continuationTokenField];
|
|
1891
1944
|
// Determine if there are more pages
|
|
1892
1945
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -2180,7 +2233,7 @@ const AgentMap = {
|
|
|
2180
2233
|
};
|
|
2181
2234
|
|
|
2182
2235
|
/**
|
|
2183
|
-
* Constants for User Service
|
|
2236
|
+
* Constants for User Settings Service
|
|
2184
2237
|
*/
|
|
2185
2238
|
/**
|
|
2186
2239
|
* Maps fields for User Settings entities to ensure consistent SDK naming
|
|
@@ -2950,6 +3003,7 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
2950
3003
|
this.toolCallId = toolCallId;
|
|
2951
3004
|
this.startEventMaybe = startEventMaybe;
|
|
2952
3005
|
this._endHandlers = new Array();
|
|
3006
|
+
this._confirmHandlers = new Array();
|
|
2953
3007
|
this.addStartEventTimestamp(startEventMaybe);
|
|
2954
3008
|
}
|
|
2955
3009
|
/**
|
|
@@ -3011,6 +3065,29 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
3011
3065
|
onEndToolCall(cb) {
|
|
3012
3066
|
this.onToolCallEnd(cb);
|
|
3013
3067
|
}
|
|
3068
|
+
/**
|
|
3069
|
+
* Registers a handler for tool call confirmation events. Fired when the
|
|
3070
|
+
* peer responds to a tool call that was emitted with `requireConfirmation`.
|
|
3071
|
+
* @returns Cleanup function to remove the handler.
|
|
3072
|
+
*/
|
|
3073
|
+
onToolCallConfirm(callback) {
|
|
3074
|
+
this._confirmHandlers.push(callback);
|
|
3075
|
+
return () => {
|
|
3076
|
+
const index = this._confirmHandlers.indexOf(callback);
|
|
3077
|
+
if (index >= 0)
|
|
3078
|
+
this._confirmHandlers.splice(index, 1);
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3081
|
+
/**
|
|
3082
|
+
* Sends a tool call confirmation (approve/reject) for a tool call that was
|
|
3083
|
+
* emitted with `requireConfirmation: true`. Replaces the legacy
|
|
3084
|
+
* `sendInterruptEnd` flow for tool call confirmation.
|
|
3085
|
+
* @throws Error if tool call has already ended.
|
|
3086
|
+
*/
|
|
3087
|
+
sendToolCallConfirm(confirmToolCall) {
|
|
3088
|
+
this.assertNotEnded();
|
|
3089
|
+
this.emit({ confirmToolCall });
|
|
3090
|
+
}
|
|
3014
3091
|
/**
|
|
3015
3092
|
* Sends an error start event for this tool call.
|
|
3016
3093
|
*/
|
|
@@ -3086,6 +3163,10 @@ class ToolCallEventHelperImpl extends ToolCallEventHelper {
|
|
|
3086
3163
|
if (toolCallEvent.toolCallError?.endError) {
|
|
3087
3164
|
this.dispatchErrorEnd(toolCallEvent.toolCallError.errorId, toolCallEvent.toolCallError.endError);
|
|
3088
3165
|
}
|
|
3166
|
+
if (toolCallEvent.confirmToolCall) {
|
|
3167
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3168
|
+
this._confirmHandlers.forEach(cb => cb(toolCallEvent.confirmToolCall));
|
|
3169
|
+
}
|
|
3089
3170
|
if (toolCallEvent.endToolCall) {
|
|
3090
3171
|
this.setEnded();
|
|
3091
3172
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3129,6 +3210,7 @@ class MessageEventHelper extends ConversationEventHelperBase {
|
|
|
3129
3210
|
this._toolCallMap = new Map();
|
|
3130
3211
|
this._interruptStartHandlers = new Array();
|
|
3131
3212
|
this._interruptEndHandlers = new Array();
|
|
3213
|
+
this._toolCallConfirmHandlers = new Array();
|
|
3132
3214
|
this.addStartEventTimestamp(startEventMaybe);
|
|
3133
3215
|
}
|
|
3134
3216
|
/**
|
|
@@ -3367,6 +3449,25 @@ class MessageEventHelper extends ConversationEventHelperBase {
|
|
|
3367
3449
|
this._interruptEndHandlers.splice(index, 1);
|
|
3368
3450
|
};
|
|
3369
3451
|
}
|
|
3452
|
+
/**
|
|
3453
|
+
* Registers a handler for tool-call confirmation events. Fired when a peer
|
|
3454
|
+
* responds to a tool call that was emitted with `requireConfirmation: true`.
|
|
3455
|
+
*
|
|
3456
|
+
* Fires at the message level before the event is delegated to the per-tool-call
|
|
3457
|
+
* helper, so this handler runs even when no `ToolCallEventHelper` exists for the
|
|
3458
|
+
* confirmed tool call (e.g. on the agent side after the originating helper has
|
|
3459
|
+
* been cleaned up, or on the client side if no `onToolCallStart` is registered).
|
|
3460
|
+
*
|
|
3461
|
+
* @returns Cleanup function to remove the handler.
|
|
3462
|
+
*/
|
|
3463
|
+
onToolCallConfirm(callback) {
|
|
3464
|
+
this._toolCallConfirmHandlers.push(callback);
|
|
3465
|
+
return () => {
|
|
3466
|
+
const index = this._toolCallConfirmHandlers.indexOf(callback);
|
|
3467
|
+
if (index >= 0)
|
|
3468
|
+
this._toolCallConfirmHandlers.splice(index, 1);
|
|
3469
|
+
};
|
|
3470
|
+
}
|
|
3370
3471
|
/**
|
|
3371
3472
|
* Sends an interrupt start event.
|
|
3372
3473
|
*/
|
|
@@ -3494,6 +3595,16 @@ class MessageEventHelperImpl extends MessageEventHelper {
|
|
|
3494
3595
|
contentPartHelper.dispatch(messageEvent.contentPart);
|
|
3495
3596
|
}
|
|
3496
3597
|
if (messageEvent.toolCall) {
|
|
3598
|
+
// Dispatch confirmToolCall at the message level (flat dispatch) before delegating
|
|
3599
|
+
// to the per-tool-call helper. Needed because the tool-call helper may not exist
|
|
3600
|
+
// for this id on the receiving side.
|
|
3601
|
+
if (messageEvent.toolCall.confirmToolCall) {
|
|
3602
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3603
|
+
this._toolCallConfirmHandlers.forEach(cb => cb({
|
|
3604
|
+
toolCallId: messageEvent.toolCall.toolCallId,
|
|
3605
|
+
confirmEvent: messageEvent.toolCall.confirmToolCall
|
|
3606
|
+
}));
|
|
3607
|
+
}
|
|
3497
3608
|
let toolCallHelper = this._toolCallMap.get(messageEvent.toolCall.toolCallId);
|
|
3498
3609
|
if (!toolCallHelper && this._toolCallStartHandlers.length > 0) {
|
|
3499
3610
|
toolCallHelper = new ToolCallEventHelperImpl(this, messageEvent.toolCall.toolCallId, messageEvent.toolCall.startToolCall);
|
|
@@ -4994,6 +5105,27 @@ function transformMessage(message) {
|
|
|
4994
5105
|
};
|
|
4995
5106
|
}
|
|
4996
5107
|
|
|
5108
|
+
/**
|
|
5109
|
+
* Header builder for Conversational Agent Services
|
|
5110
|
+
*
|
|
5111
|
+
* Builds the default request headers shared across the Conversational Agent
|
|
5112
|
+
* service constructors (`ConversationalAgentService`, `ConversationService`,
|
|
5113
|
+
* `ExchangeService`, `MessageService`) from a single set of options.
|
|
5114
|
+
*/
|
|
5115
|
+
/**
|
|
5116
|
+
* Builds the default request headers for Conversational Agent service calls
|
|
5117
|
+
* from the provided options. Returns `undefined` when no headers apply, so
|
|
5118
|
+
* the SDK does not pass an empty `headers` bag down to the HTTP layer.
|
|
5119
|
+
*/
|
|
5120
|
+
function buildConversationalAgentHeaders(options) {
|
|
5121
|
+
const headers = createHeaders({
|
|
5122
|
+
[EXTERNAL_USER_ID]: options?.externalUserId,
|
|
5123
|
+
[CONVERSATIONAL_SURFACE_NAME]: options?.surfaceName,
|
|
5124
|
+
[CONVERSATIONAL_SURFACE_VERSION]: options?.surfaceVersion,
|
|
5125
|
+
});
|
|
5126
|
+
return Object.keys(headers).length > 0 ? headers : undefined;
|
|
5127
|
+
}
|
|
5128
|
+
|
|
4997
5129
|
/**
|
|
4998
5130
|
* ExchangeService - Exchange operations for Conversations
|
|
4999
5131
|
*
|
|
@@ -5033,7 +5165,7 @@ class ExchangeService extends BaseService {
|
|
|
5033
5165
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
5034
5166
|
*/
|
|
5035
5167
|
constructor(instance, options) {
|
|
5036
|
-
super(instance, options
|
|
5168
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
5037
5169
|
}
|
|
5038
5170
|
/**
|
|
5039
5171
|
* Gets all exchanges for a conversation with optional filtering and pagination
|
|
@@ -5696,6 +5828,8 @@ class WebSocketSession extends BaseWebSocket {
|
|
|
5696
5828
|
logLevel: options?.logLevel
|
|
5697
5829
|
}, context, tokenManager, WEBSOCKET_LOGGER_PREFIX);
|
|
5698
5830
|
this._externalUserId = options?.externalUserId;
|
|
5831
|
+
this._surfaceName = options?.surfaceName;
|
|
5832
|
+
this._surfaceVersion = options?.surfaceVersion;
|
|
5699
5833
|
}
|
|
5700
5834
|
/**
|
|
5701
5835
|
* Connects to WebSocket with organization and tenant headers
|
|
@@ -5714,6 +5848,12 @@ class WebSocketSession extends BaseWebSocket {
|
|
|
5714
5848
|
if (this._externalUserId) {
|
|
5715
5849
|
query[WEBSOCKET_QUERY_PARAMS.EXTERNAL_USER_ID] = this._externalUserId;
|
|
5716
5850
|
}
|
|
5851
|
+
if (this._surfaceName) {
|
|
5852
|
+
query[WEBSOCKET_QUERY_PARAMS.CONVERSATIONAL_SURFACE_NAME] = this._surfaceName;
|
|
5853
|
+
}
|
|
5854
|
+
if (this._surfaceVersion) {
|
|
5855
|
+
query[WEBSOCKET_QUERY_PARAMS.CONVERSATIONAL_SURFACE_VERSION] = this._surfaceVersion;
|
|
5856
|
+
}
|
|
5717
5857
|
this.connectWithOptions({ query });
|
|
5718
5858
|
}
|
|
5719
5859
|
/**
|
|
@@ -6010,7 +6150,7 @@ class ConversationService extends BaseService {
|
|
|
6010
6150
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6011
6151
|
*/
|
|
6012
6152
|
constructor(instance, options) {
|
|
6013
|
-
super(instance, options
|
|
6153
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
6014
6154
|
/** Event helper for conversation events */
|
|
6015
6155
|
this._eventHelper = null;
|
|
6016
6156
|
this._sessionManager = new SessionManager(instance, options);
|
|
@@ -6421,7 +6561,7 @@ class MessageService extends BaseService {
|
|
|
6421
6561
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6422
6562
|
*/
|
|
6423
6563
|
constructor(instance, options) {
|
|
6424
|
-
super(instance, options
|
|
6564
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
6425
6565
|
}
|
|
6426
6566
|
/**
|
|
6427
6567
|
* Gets a message by ID
|
|
@@ -6482,6 +6622,87 @@ __decorate([
|
|
|
6482
6622
|
track('ConversationalAgent.Messages.GetContentPartById')
|
|
6483
6623
|
], MessageService.prototype, "getContentPartById", null);
|
|
6484
6624
|
|
|
6625
|
+
/**
|
|
6626
|
+
* UserSettingsService - Service for managing user profile and context settings
|
|
6627
|
+
*/
|
|
6628
|
+
/**
|
|
6629
|
+
* Service for reading and updating the current user's profile and context settings.
|
|
6630
|
+
*
|
|
6631
|
+
* User settings are user-supplied profile fields (name, email, role, department, company,
|
|
6632
|
+
* country, timezone) that the SDK passes to a UiPath Conversational Agent on every conversation
|
|
6633
|
+
* so the agent can personalize its responses.
|
|
6634
|
+
*/
|
|
6635
|
+
class UserSettingsService extends BaseService {
|
|
6636
|
+
/**
|
|
6637
|
+
* Creates an instance of the UserSettingsService.
|
|
6638
|
+
*
|
|
6639
|
+
* @param instance - UiPath SDK instance providing authentication and configuration
|
|
6640
|
+
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6641
|
+
*/
|
|
6642
|
+
constructor(instance, options) {
|
|
6643
|
+
super(instance, options?.externalUserId ? { [EXTERNAL_USER_ID]: options.externalUserId } : undefined);
|
|
6644
|
+
}
|
|
6645
|
+
/**
|
|
6646
|
+
* Gets the current user's profile and context settings.
|
|
6647
|
+
*
|
|
6648
|
+
* Returns the full user settings record — profile fields the agent uses for personalization
|
|
6649
|
+
* (name, email, role, department, company, country, timezone) plus identifiers and timestamps.
|
|
6650
|
+
* Fields the user has not set are returned as `null`.
|
|
6651
|
+
*
|
|
6652
|
+
* @returns Promise resolving to the current user's settings
|
|
6653
|
+
* {@link UserSettingsGetResponse}
|
|
6654
|
+
*
|
|
6655
|
+
* @example
|
|
6656
|
+
* ```typescript
|
|
6657
|
+
* const settings = await conversationalAgent.user.getSettings();
|
|
6658
|
+
* console.log(settings.name); // e.g. 'John Doe' or null
|
|
6659
|
+
* console.log(settings.email); // e.g. 'john@example.com' or null
|
|
6660
|
+
* console.log(settings.timezone); // e.g. 'America/New_York' or null
|
|
6661
|
+
* ```
|
|
6662
|
+
*/
|
|
6663
|
+
async getSettings() {
|
|
6664
|
+
const response = await this.get(USER_ENDPOINTS.SETTINGS);
|
|
6665
|
+
return transformData(response.data, UserSettingsMap);
|
|
6666
|
+
}
|
|
6667
|
+
/**
|
|
6668
|
+
* Updates the current user's profile and context settings.
|
|
6669
|
+
*
|
|
6670
|
+
* Accepts a partial payload — only fields included in `options` are changed. Pass `null` to
|
|
6671
|
+
* explicitly clear a field. Omitting a field leaves it unchanged. Returns the full updated
|
|
6672
|
+
* settings record.
|
|
6673
|
+
*
|
|
6674
|
+
* @param options - Fields to update; omit fields to leave them unchanged, set to `null` to clear
|
|
6675
|
+
* @returns Promise resolving to the updated user settings
|
|
6676
|
+
* {@link UserSettingsUpdateResponse}
|
|
6677
|
+
*
|
|
6678
|
+
* @example Partial update
|
|
6679
|
+
* ```typescript
|
|
6680
|
+
* const updated = await conversationalAgent.user.updateSettings({
|
|
6681
|
+
* name: 'John Doe',
|
|
6682
|
+
* timezone: 'America/New_York'
|
|
6683
|
+
* });
|
|
6684
|
+
* ```
|
|
6685
|
+
*
|
|
6686
|
+
* @example Clear fields by setting to null
|
|
6687
|
+
* ```typescript
|
|
6688
|
+
* await conversationalAgent.user.updateSettings({
|
|
6689
|
+
* role: null,
|
|
6690
|
+
* department: null
|
|
6691
|
+
* });
|
|
6692
|
+
* ```
|
|
6693
|
+
*/
|
|
6694
|
+
async updateSettings(options) {
|
|
6695
|
+
const response = await this.patch(USER_ENDPOINTS.SETTINGS, options);
|
|
6696
|
+
return transformData(response.data, UserSettingsMap);
|
|
6697
|
+
}
|
|
6698
|
+
}
|
|
6699
|
+
__decorate([
|
|
6700
|
+
track('ConversationalAgent.UserSettings.GetSettings')
|
|
6701
|
+
], UserSettingsService.prototype, "getSettings", null);
|
|
6702
|
+
__decorate([
|
|
6703
|
+
track('ConversationalAgent.UserSettings.UpdateSettings')
|
|
6704
|
+
], UserSettingsService.prototype, "updateSettings", null);
|
|
6705
|
+
|
|
6485
6706
|
/**
|
|
6486
6707
|
* ConversationalAgentService - Main entry point for Conversational Agent functionality
|
|
6487
6708
|
*/
|
|
@@ -6496,9 +6717,10 @@ class ConversationalAgentService extends BaseService {
|
|
|
6496
6717
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6497
6718
|
*/
|
|
6498
6719
|
constructor(instance, options) {
|
|
6499
|
-
super(instance, options
|
|
6720
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
6500
6721
|
// Create conversation service with WebSocket support
|
|
6501
6722
|
this.conversations = new ConversationService(instance, options);
|
|
6723
|
+
this.user = new UserSettingsService(instance, options);
|
|
6502
6724
|
}
|
|
6503
6725
|
/**
|
|
6504
6726
|
* Registers a handler that is called whenever the WebSocket connection status changes.
|
|
@@ -6584,78 +6806,6 @@ __decorate([
|
|
|
6584
6806
|
track('ConversationalAgent.GetById')
|
|
6585
6807
|
], ConversationalAgentService.prototype, "getById", null);
|
|
6586
6808
|
|
|
6587
|
-
/**
|
|
6588
|
-
* UserService - Service for managing user profile and context settings
|
|
6589
|
-
*/
|
|
6590
|
-
/**
|
|
6591
|
-
* Service for managing user profile and context settings
|
|
6592
|
-
*
|
|
6593
|
-
* User settings are passed to the agent for all conversations
|
|
6594
|
-
* to provide user context (name, email, role, timezone, etc.).
|
|
6595
|
-
*
|
|
6596
|
-
* @internal
|
|
6597
|
-
*/
|
|
6598
|
-
class UserService extends BaseService {
|
|
6599
|
-
/**
|
|
6600
|
-
* Gets the current user's profile and context settings
|
|
6601
|
-
*
|
|
6602
|
-
* @returns Promise resolving to user settings object containing profile information
|
|
6603
|
-
*
|
|
6604
|
-
* @example
|
|
6605
|
-
* ```typescript
|
|
6606
|
-
* const userSettings = await userService.getSettings();
|
|
6607
|
-
* console.log(userSettings.name); // User's name
|
|
6608
|
-
* console.log(userSettings.email); // User's email
|
|
6609
|
-
* console.log(userSettings.timezone); // User's timezone
|
|
6610
|
-
* ```
|
|
6611
|
-
*/
|
|
6612
|
-
async getSettings() {
|
|
6613
|
-
const response = await this.get(USER_ENDPOINTS.SETTINGS);
|
|
6614
|
-
return transformData(response.data, UserSettingsMap);
|
|
6615
|
-
}
|
|
6616
|
-
/**
|
|
6617
|
-
* Updates the current user's profile and context settings
|
|
6618
|
-
*
|
|
6619
|
-
* All fields are optional - only send the fields you want to change.
|
|
6620
|
-
* Set fields to `null` to explicitly clear them.
|
|
6621
|
-
* Omitting fields means no change.
|
|
6622
|
-
*
|
|
6623
|
-
* @param options - Fields to update
|
|
6624
|
-
* @returns Promise resolving to updated user settings object
|
|
6625
|
-
*
|
|
6626
|
-
* @example
|
|
6627
|
-
* ```typescript
|
|
6628
|
-
* // Update specific fields
|
|
6629
|
-
* const updatedUserSettings = await userService.updateSettings({
|
|
6630
|
-
* name: 'John Doe',
|
|
6631
|
-
* email: 'john@example.com',
|
|
6632
|
-
* timezone: 'America/New_York'
|
|
6633
|
-
* });
|
|
6634
|
-
*
|
|
6635
|
-
* // Partial update - only change timezone
|
|
6636
|
-
* await userService.updateSettings({
|
|
6637
|
-
* timezone: 'Europe/London'
|
|
6638
|
-
* });
|
|
6639
|
-
*
|
|
6640
|
-
* // Clear fields by setting to null
|
|
6641
|
-
* await userService.updateSettings({
|
|
6642
|
-
* role: null,
|
|
6643
|
-
* department: null
|
|
6644
|
-
* });
|
|
6645
|
-
* ```
|
|
6646
|
-
*/
|
|
6647
|
-
async updateSettings(options) {
|
|
6648
|
-
const response = await this.patch(USER_ENDPOINTS.SETTINGS, options);
|
|
6649
|
-
return transformData(response.data, UserSettingsMap);
|
|
6650
|
-
}
|
|
6651
|
-
}
|
|
6652
|
-
__decorate([
|
|
6653
|
-
track('ConversationalAgent.User.GetSettings')
|
|
6654
|
-
], UserService.prototype, "getSettings", null);
|
|
6655
|
-
__decorate([
|
|
6656
|
-
track('ConversationalAgent.User.UpdateSettings')
|
|
6657
|
-
], UserService.prototype, "updateSettings", null);
|
|
6658
|
-
|
|
6659
6809
|
exports.AgentMap = AgentMap;
|
|
6660
6810
|
exports.AsyncInputStreamEventHelper = AsyncInputStreamEventHelper;
|
|
6661
6811
|
exports.AsyncInputStreamEventHelperImpl = AsyncInputStreamEventHelperImpl;
|
|
@@ -6686,9 +6836,9 @@ exports.SessionEventHelper = SessionEventHelper;
|
|
|
6686
6836
|
exports.SessionEventHelperImpl = SessionEventHelperImpl;
|
|
6687
6837
|
exports.ToolCallEventHelper = ToolCallEventHelper;
|
|
6688
6838
|
exports.ToolCallEventHelperImpl = ToolCallEventHelperImpl;
|
|
6689
|
-
exports.
|
|
6690
|
-
exports.UserService = UserService;
|
|
6839
|
+
exports.UserSettings = UserSettingsService;
|
|
6691
6840
|
exports.UserSettingsMap = UserSettingsMap;
|
|
6841
|
+
exports.UserSettingsService = UserSettingsService;
|
|
6692
6842
|
exports.assertCitationSourceMedia = assertCitationSourceMedia;
|
|
6693
6843
|
exports.assertCitationSourceUrl = assertCitationSourceUrl;
|
|
6694
6844
|
exports.assertExternalValue = assertExternalValue;
|