@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
|
@@ -49,7 +49,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
49
49
|
// Connection string placeholder that will be replaced during build
|
|
50
50
|
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";
|
|
51
51
|
// SDK Version placeholder
|
|
52
|
-
const SDK_VERSION = "1.3.
|
|
52
|
+
const SDK_VERSION = "1.3.8";
|
|
53
53
|
const VERSION = "Version";
|
|
54
54
|
const SERVICE = "Service";
|
|
55
55
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -803,6 +803,21 @@ const RESPONSE_TYPES = {
|
|
|
803
803
|
* in Conversational Agents Service)
|
|
804
804
|
*/
|
|
805
805
|
const EXTERNAL_USER_ID = 'x-uipath-external-user-id';
|
|
806
|
+
/**
|
|
807
|
+
* Optional identifier used in UiPath logs to identify the implementing service
|
|
808
|
+
* of requests. External consumers do not need to set it; the server logs
|
|
809
|
+
* missing values as "unknown".
|
|
810
|
+
*
|
|
811
|
+
* @internal
|
|
812
|
+
*/
|
|
813
|
+
const CONVERSATIONAL_SURFACE_NAME = 'x-uipath-conversational-surfacename';
|
|
814
|
+
/**
|
|
815
|
+
* Optional version of the implementing service of requests. Paired with
|
|
816
|
+
* `surfaceName` for internal telemetry.
|
|
817
|
+
*
|
|
818
|
+
* @internal
|
|
819
|
+
*/
|
|
820
|
+
const CONVERSATIONAL_SURFACE_VERSION = 'x-uipath-conversational-surfaceversion';
|
|
806
821
|
/**
|
|
807
822
|
* Query parameter keys sent during WebSocket connection
|
|
808
823
|
*/
|
|
@@ -810,6 +825,8 @@ const WEBSOCKET_QUERY_PARAMS = {
|
|
|
810
825
|
ORGANIZATION_ID: 'x-uipath-internal-accountid',
|
|
811
826
|
TENANT_ID: 'x-uipath-internal-tenantid',
|
|
812
827
|
EXTERNAL_USER_ID,
|
|
828
|
+
CONVERSATIONAL_SURFACE_NAME,
|
|
829
|
+
CONVERSATIONAL_SURFACE_VERSION,
|
|
813
830
|
};
|
|
814
831
|
|
|
815
832
|
class ApiClient {
|
|
@@ -937,6 +954,27 @@ var PaginationType;
|
|
|
937
954
|
/**
|
|
938
955
|
* Collection of utility functions for working with objects
|
|
939
956
|
*/
|
|
957
|
+
/**
|
|
958
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
959
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
960
|
+
* Direct key match takes priority over nested traversal.
|
|
961
|
+
*/
|
|
962
|
+
function resolveNestedField(data, fieldPath) {
|
|
963
|
+
if (!data) {
|
|
964
|
+
return undefined;
|
|
965
|
+
}
|
|
966
|
+
if (fieldPath in data) {
|
|
967
|
+
return data[fieldPath];
|
|
968
|
+
}
|
|
969
|
+
if (!fieldPath.includes('.')) {
|
|
970
|
+
return undefined;
|
|
971
|
+
}
|
|
972
|
+
let value = data;
|
|
973
|
+
for (const part of fieldPath.split('.')) {
|
|
974
|
+
value = value?.[part];
|
|
975
|
+
}
|
|
976
|
+
return value;
|
|
977
|
+
}
|
|
940
978
|
/**
|
|
941
979
|
* Filters out undefined values from an object
|
|
942
980
|
* @param obj The source object
|
|
@@ -1186,6 +1224,10 @@ const CONVERSATIONAL_TOKEN_PARAMS = {
|
|
|
1186
1224
|
TOKEN_PARAM: 'cursor'
|
|
1187
1225
|
};
|
|
1188
1226
|
|
|
1227
|
+
/**
|
|
1228
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
1229
|
+
* Returns the original value if parsing fails.
|
|
1230
|
+
*/
|
|
1189
1231
|
/**
|
|
1190
1232
|
* Transforms data by mapping fields according to the provided field mapping
|
|
1191
1233
|
* @param data The source data to transform
|
|
@@ -1555,7 +1597,8 @@ class PaginationHelpers {
|
|
|
1555
1597
|
// Extract and transform items from response
|
|
1556
1598
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1557
1599
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1558
|
-
const
|
|
1600
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1601
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1559
1602
|
// Parse items - automatically handle JSON string responses
|
|
1560
1603
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1561
1604
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1731,8 +1774,9 @@ class BaseService {
|
|
|
1731
1774
|
constructor(instance, headers) {
|
|
1732
1775
|
// Private field - not visible via Object.keys() or any reflection
|
|
1733
1776
|
_BaseService_apiClient.set(this, void 0);
|
|
1734
|
-
const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
|
|
1777
|
+
const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
|
|
1735
1778
|
__classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
|
|
1779
|
+
this.config = { folderKey };
|
|
1736
1780
|
}
|
|
1737
1781
|
/**
|
|
1738
1782
|
* Gets a valid authentication token, refreshing if necessary.
|
|
@@ -1851,9 +1895,17 @@ class BaseService {
|
|
|
1851
1895
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1852
1896
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1853
1897
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1898
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1899
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1900
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1854
1901
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1855
|
-
if (
|
|
1856
|
-
|
|
1902
|
+
if (convertToSkip) {
|
|
1903
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1904
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
else {
|
|
1908
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1857
1909
|
}
|
|
1858
1910
|
{
|
|
1859
1911
|
requestParams[countParam] = true;
|
|
@@ -1884,7 +1936,8 @@ class BaseService {
|
|
|
1884
1936
|
// Extract items and metadata
|
|
1885
1937
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1886
1938
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1887
|
-
const
|
|
1939
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1940
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1888
1941
|
const continuationToken = response.data[continuationTokenField];
|
|
1889
1942
|
// Determine if there are more pages
|
|
1890
1943
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -2178,7 +2231,7 @@ const AgentMap = {
|
|
|
2178
2231
|
};
|
|
2179
2232
|
|
|
2180
2233
|
/**
|
|
2181
|
-
* Constants for User Service
|
|
2234
|
+
* Constants for User Settings Service
|
|
2182
2235
|
*/
|
|
2183
2236
|
/**
|
|
2184
2237
|
* Maps fields for User Settings entities to ensure consistent SDK naming
|
|
@@ -2948,6 +3001,7 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
2948
3001
|
this.toolCallId = toolCallId;
|
|
2949
3002
|
this.startEventMaybe = startEventMaybe;
|
|
2950
3003
|
this._endHandlers = new Array();
|
|
3004
|
+
this._confirmHandlers = new Array();
|
|
2951
3005
|
this.addStartEventTimestamp(startEventMaybe);
|
|
2952
3006
|
}
|
|
2953
3007
|
/**
|
|
@@ -3009,6 +3063,29 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
3009
3063
|
onEndToolCall(cb) {
|
|
3010
3064
|
this.onToolCallEnd(cb);
|
|
3011
3065
|
}
|
|
3066
|
+
/**
|
|
3067
|
+
* Registers a handler for tool call confirmation events. Fired when the
|
|
3068
|
+
* peer responds to a tool call that was emitted with `requireConfirmation`.
|
|
3069
|
+
* @returns Cleanup function to remove the handler.
|
|
3070
|
+
*/
|
|
3071
|
+
onToolCallConfirm(callback) {
|
|
3072
|
+
this._confirmHandlers.push(callback);
|
|
3073
|
+
return () => {
|
|
3074
|
+
const index = this._confirmHandlers.indexOf(callback);
|
|
3075
|
+
if (index >= 0)
|
|
3076
|
+
this._confirmHandlers.splice(index, 1);
|
|
3077
|
+
};
|
|
3078
|
+
}
|
|
3079
|
+
/**
|
|
3080
|
+
* Sends a tool call confirmation (approve/reject) for a tool call that was
|
|
3081
|
+
* emitted with `requireConfirmation: true`. Replaces the legacy
|
|
3082
|
+
* `sendInterruptEnd` flow for tool call confirmation.
|
|
3083
|
+
* @throws Error if tool call has already ended.
|
|
3084
|
+
*/
|
|
3085
|
+
sendToolCallConfirm(confirmToolCall) {
|
|
3086
|
+
this.assertNotEnded();
|
|
3087
|
+
this.emit({ confirmToolCall });
|
|
3088
|
+
}
|
|
3012
3089
|
/**
|
|
3013
3090
|
* Sends an error start event for this tool call.
|
|
3014
3091
|
*/
|
|
@@ -3084,6 +3161,10 @@ class ToolCallEventHelperImpl extends ToolCallEventHelper {
|
|
|
3084
3161
|
if (toolCallEvent.toolCallError?.endError) {
|
|
3085
3162
|
this.dispatchErrorEnd(toolCallEvent.toolCallError.errorId, toolCallEvent.toolCallError.endError);
|
|
3086
3163
|
}
|
|
3164
|
+
if (toolCallEvent.confirmToolCall) {
|
|
3165
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3166
|
+
this._confirmHandlers.forEach(cb => cb(toolCallEvent.confirmToolCall));
|
|
3167
|
+
}
|
|
3087
3168
|
if (toolCallEvent.endToolCall) {
|
|
3088
3169
|
this.setEnded();
|
|
3089
3170
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3127,6 +3208,7 @@ class MessageEventHelper extends ConversationEventHelperBase {
|
|
|
3127
3208
|
this._toolCallMap = new Map();
|
|
3128
3209
|
this._interruptStartHandlers = new Array();
|
|
3129
3210
|
this._interruptEndHandlers = new Array();
|
|
3211
|
+
this._toolCallConfirmHandlers = new Array();
|
|
3130
3212
|
this.addStartEventTimestamp(startEventMaybe);
|
|
3131
3213
|
}
|
|
3132
3214
|
/**
|
|
@@ -3365,6 +3447,25 @@ class MessageEventHelper extends ConversationEventHelperBase {
|
|
|
3365
3447
|
this._interruptEndHandlers.splice(index, 1);
|
|
3366
3448
|
};
|
|
3367
3449
|
}
|
|
3450
|
+
/**
|
|
3451
|
+
* Registers a handler for tool-call confirmation events. Fired when a peer
|
|
3452
|
+
* responds to a tool call that was emitted with `requireConfirmation: true`.
|
|
3453
|
+
*
|
|
3454
|
+
* Fires at the message level before the event is delegated to the per-tool-call
|
|
3455
|
+
* helper, so this handler runs even when no `ToolCallEventHelper` exists for the
|
|
3456
|
+
* confirmed tool call (e.g. on the agent side after the originating helper has
|
|
3457
|
+
* been cleaned up, or on the client side if no `onToolCallStart` is registered).
|
|
3458
|
+
*
|
|
3459
|
+
* @returns Cleanup function to remove the handler.
|
|
3460
|
+
*/
|
|
3461
|
+
onToolCallConfirm(callback) {
|
|
3462
|
+
this._toolCallConfirmHandlers.push(callback);
|
|
3463
|
+
return () => {
|
|
3464
|
+
const index = this._toolCallConfirmHandlers.indexOf(callback);
|
|
3465
|
+
if (index >= 0)
|
|
3466
|
+
this._toolCallConfirmHandlers.splice(index, 1);
|
|
3467
|
+
};
|
|
3468
|
+
}
|
|
3368
3469
|
/**
|
|
3369
3470
|
* Sends an interrupt start event.
|
|
3370
3471
|
*/
|
|
@@ -3492,6 +3593,16 @@ class MessageEventHelperImpl extends MessageEventHelper {
|
|
|
3492
3593
|
contentPartHelper.dispatch(messageEvent.contentPart);
|
|
3493
3594
|
}
|
|
3494
3595
|
if (messageEvent.toolCall) {
|
|
3596
|
+
// Dispatch confirmToolCall at the message level (flat dispatch) before delegating
|
|
3597
|
+
// to the per-tool-call helper. Needed because the tool-call helper may not exist
|
|
3598
|
+
// for this id on the receiving side.
|
|
3599
|
+
if (messageEvent.toolCall.confirmToolCall) {
|
|
3600
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3601
|
+
this._toolCallConfirmHandlers.forEach(cb => cb({
|
|
3602
|
+
toolCallId: messageEvent.toolCall.toolCallId,
|
|
3603
|
+
confirmEvent: messageEvent.toolCall.confirmToolCall
|
|
3604
|
+
}));
|
|
3605
|
+
}
|
|
3495
3606
|
let toolCallHelper = this._toolCallMap.get(messageEvent.toolCall.toolCallId);
|
|
3496
3607
|
if (!toolCallHelper && this._toolCallStartHandlers.length > 0) {
|
|
3497
3608
|
toolCallHelper = new ToolCallEventHelperImpl(this, messageEvent.toolCall.toolCallId, messageEvent.toolCall.startToolCall);
|
|
@@ -4992,6 +5103,27 @@ function transformMessage(message) {
|
|
|
4992
5103
|
};
|
|
4993
5104
|
}
|
|
4994
5105
|
|
|
5106
|
+
/**
|
|
5107
|
+
* Header builder for Conversational Agent Services
|
|
5108
|
+
*
|
|
5109
|
+
* Builds the default request headers shared across the Conversational Agent
|
|
5110
|
+
* service constructors (`ConversationalAgentService`, `ConversationService`,
|
|
5111
|
+
* `ExchangeService`, `MessageService`) from a single set of options.
|
|
5112
|
+
*/
|
|
5113
|
+
/**
|
|
5114
|
+
* Builds the default request headers for Conversational Agent service calls
|
|
5115
|
+
* from the provided options. Returns `undefined` when no headers apply, so
|
|
5116
|
+
* the SDK does not pass an empty `headers` bag down to the HTTP layer.
|
|
5117
|
+
*/
|
|
5118
|
+
function buildConversationalAgentHeaders(options) {
|
|
5119
|
+
const headers = createHeaders({
|
|
5120
|
+
[EXTERNAL_USER_ID]: options?.externalUserId,
|
|
5121
|
+
[CONVERSATIONAL_SURFACE_NAME]: options?.surfaceName,
|
|
5122
|
+
[CONVERSATIONAL_SURFACE_VERSION]: options?.surfaceVersion,
|
|
5123
|
+
});
|
|
5124
|
+
return Object.keys(headers).length > 0 ? headers : undefined;
|
|
5125
|
+
}
|
|
5126
|
+
|
|
4995
5127
|
/**
|
|
4996
5128
|
* ExchangeService - Exchange operations for Conversations
|
|
4997
5129
|
*
|
|
@@ -5031,7 +5163,7 @@ class ExchangeService extends BaseService {
|
|
|
5031
5163
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
5032
5164
|
*/
|
|
5033
5165
|
constructor(instance, options) {
|
|
5034
|
-
super(instance, options
|
|
5166
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
5035
5167
|
}
|
|
5036
5168
|
/**
|
|
5037
5169
|
* Gets all exchanges for a conversation with optional filtering and pagination
|
|
@@ -5694,6 +5826,8 @@ class WebSocketSession extends BaseWebSocket {
|
|
|
5694
5826
|
logLevel: options?.logLevel
|
|
5695
5827
|
}, context, tokenManager, WEBSOCKET_LOGGER_PREFIX);
|
|
5696
5828
|
this._externalUserId = options?.externalUserId;
|
|
5829
|
+
this._surfaceName = options?.surfaceName;
|
|
5830
|
+
this._surfaceVersion = options?.surfaceVersion;
|
|
5697
5831
|
}
|
|
5698
5832
|
/**
|
|
5699
5833
|
* Connects to WebSocket with organization and tenant headers
|
|
@@ -5712,6 +5846,12 @@ class WebSocketSession extends BaseWebSocket {
|
|
|
5712
5846
|
if (this._externalUserId) {
|
|
5713
5847
|
query[WEBSOCKET_QUERY_PARAMS.EXTERNAL_USER_ID] = this._externalUserId;
|
|
5714
5848
|
}
|
|
5849
|
+
if (this._surfaceName) {
|
|
5850
|
+
query[WEBSOCKET_QUERY_PARAMS.CONVERSATIONAL_SURFACE_NAME] = this._surfaceName;
|
|
5851
|
+
}
|
|
5852
|
+
if (this._surfaceVersion) {
|
|
5853
|
+
query[WEBSOCKET_QUERY_PARAMS.CONVERSATIONAL_SURFACE_VERSION] = this._surfaceVersion;
|
|
5854
|
+
}
|
|
5715
5855
|
this.connectWithOptions({ query });
|
|
5716
5856
|
}
|
|
5717
5857
|
/**
|
|
@@ -6008,7 +6148,7 @@ class ConversationService extends BaseService {
|
|
|
6008
6148
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6009
6149
|
*/
|
|
6010
6150
|
constructor(instance, options) {
|
|
6011
|
-
super(instance, options
|
|
6151
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
6012
6152
|
/** Event helper for conversation events */
|
|
6013
6153
|
this._eventHelper = null;
|
|
6014
6154
|
this._sessionManager = new SessionManager(instance, options);
|
|
@@ -6419,7 +6559,7 @@ class MessageService extends BaseService {
|
|
|
6419
6559
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6420
6560
|
*/
|
|
6421
6561
|
constructor(instance, options) {
|
|
6422
|
-
super(instance, options
|
|
6562
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
6423
6563
|
}
|
|
6424
6564
|
/**
|
|
6425
6565
|
* Gets a message by ID
|
|
@@ -6480,6 +6620,87 @@ __decorate([
|
|
|
6480
6620
|
track('ConversationalAgent.Messages.GetContentPartById')
|
|
6481
6621
|
], MessageService.prototype, "getContentPartById", null);
|
|
6482
6622
|
|
|
6623
|
+
/**
|
|
6624
|
+
* UserSettingsService - Service for managing user profile and context settings
|
|
6625
|
+
*/
|
|
6626
|
+
/**
|
|
6627
|
+
* Service for reading and updating the current user's profile and context settings.
|
|
6628
|
+
*
|
|
6629
|
+
* User settings are user-supplied profile fields (name, email, role, department, company,
|
|
6630
|
+
* country, timezone) that the SDK passes to a UiPath Conversational Agent on every conversation
|
|
6631
|
+
* so the agent can personalize its responses.
|
|
6632
|
+
*/
|
|
6633
|
+
class UserSettingsService extends BaseService {
|
|
6634
|
+
/**
|
|
6635
|
+
* Creates an instance of the UserSettingsService.
|
|
6636
|
+
*
|
|
6637
|
+
* @param instance - UiPath SDK instance providing authentication and configuration
|
|
6638
|
+
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6639
|
+
*/
|
|
6640
|
+
constructor(instance, options) {
|
|
6641
|
+
super(instance, options?.externalUserId ? { [EXTERNAL_USER_ID]: options.externalUserId } : undefined);
|
|
6642
|
+
}
|
|
6643
|
+
/**
|
|
6644
|
+
* Gets the current user's profile and context settings.
|
|
6645
|
+
*
|
|
6646
|
+
* Returns the full user settings record — profile fields the agent uses for personalization
|
|
6647
|
+
* (name, email, role, department, company, country, timezone) plus identifiers and timestamps.
|
|
6648
|
+
* Fields the user has not set are returned as `null`.
|
|
6649
|
+
*
|
|
6650
|
+
* @returns Promise resolving to the current user's settings
|
|
6651
|
+
* {@link UserSettingsGetResponse}
|
|
6652
|
+
*
|
|
6653
|
+
* @example
|
|
6654
|
+
* ```typescript
|
|
6655
|
+
* const settings = await conversationalAgent.user.getSettings();
|
|
6656
|
+
* console.log(settings.name); // e.g. 'John Doe' or null
|
|
6657
|
+
* console.log(settings.email); // e.g. 'john@example.com' or null
|
|
6658
|
+
* console.log(settings.timezone); // e.g. 'America/New_York' or null
|
|
6659
|
+
* ```
|
|
6660
|
+
*/
|
|
6661
|
+
async getSettings() {
|
|
6662
|
+
const response = await this.get(USER_ENDPOINTS.SETTINGS);
|
|
6663
|
+
return transformData(response.data, UserSettingsMap);
|
|
6664
|
+
}
|
|
6665
|
+
/**
|
|
6666
|
+
* Updates the current user's profile and context settings.
|
|
6667
|
+
*
|
|
6668
|
+
* Accepts a partial payload — only fields included in `options` are changed. Pass `null` to
|
|
6669
|
+
* explicitly clear a field. Omitting a field leaves it unchanged. Returns the full updated
|
|
6670
|
+
* settings record.
|
|
6671
|
+
*
|
|
6672
|
+
* @param options - Fields to update; omit fields to leave them unchanged, set to `null` to clear
|
|
6673
|
+
* @returns Promise resolving to the updated user settings
|
|
6674
|
+
* {@link UserSettingsUpdateResponse}
|
|
6675
|
+
*
|
|
6676
|
+
* @example Partial update
|
|
6677
|
+
* ```typescript
|
|
6678
|
+
* const updated = await conversationalAgent.user.updateSettings({
|
|
6679
|
+
* name: 'John Doe',
|
|
6680
|
+
* timezone: 'America/New_York'
|
|
6681
|
+
* });
|
|
6682
|
+
* ```
|
|
6683
|
+
*
|
|
6684
|
+
* @example Clear fields by setting to null
|
|
6685
|
+
* ```typescript
|
|
6686
|
+
* await conversationalAgent.user.updateSettings({
|
|
6687
|
+
* role: null,
|
|
6688
|
+
* department: null
|
|
6689
|
+
* });
|
|
6690
|
+
* ```
|
|
6691
|
+
*/
|
|
6692
|
+
async updateSettings(options) {
|
|
6693
|
+
const response = await this.patch(USER_ENDPOINTS.SETTINGS, options);
|
|
6694
|
+
return transformData(response.data, UserSettingsMap);
|
|
6695
|
+
}
|
|
6696
|
+
}
|
|
6697
|
+
__decorate([
|
|
6698
|
+
track('ConversationalAgent.UserSettings.GetSettings')
|
|
6699
|
+
], UserSettingsService.prototype, "getSettings", null);
|
|
6700
|
+
__decorate([
|
|
6701
|
+
track('ConversationalAgent.UserSettings.UpdateSettings')
|
|
6702
|
+
], UserSettingsService.prototype, "updateSettings", null);
|
|
6703
|
+
|
|
6483
6704
|
/**
|
|
6484
6705
|
* ConversationalAgentService - Main entry point for Conversational Agent functionality
|
|
6485
6706
|
*/
|
|
@@ -6494,9 +6715,10 @@ class ConversationalAgentService extends BaseService {
|
|
|
6494
6715
|
* @param options - Optional configuration (e.g. externalUserId for external app auth)
|
|
6495
6716
|
*/
|
|
6496
6717
|
constructor(instance, options) {
|
|
6497
|
-
super(instance, options
|
|
6718
|
+
super(instance, buildConversationalAgentHeaders(options));
|
|
6498
6719
|
// Create conversation service with WebSocket support
|
|
6499
6720
|
this.conversations = new ConversationService(instance, options);
|
|
6721
|
+
this.user = new UserSettingsService(instance, options);
|
|
6500
6722
|
}
|
|
6501
6723
|
/**
|
|
6502
6724
|
* Registers a handler that is called whenever the WebSocket connection status changes.
|
|
@@ -6582,76 +6804,4 @@ __decorate([
|
|
|
6582
6804
|
track('ConversationalAgent.GetById')
|
|
6583
6805
|
], ConversationalAgentService.prototype, "getById", null);
|
|
6584
6806
|
|
|
6585
|
-
|
|
6586
|
-
* UserService - Service for managing user profile and context settings
|
|
6587
|
-
*/
|
|
6588
|
-
/**
|
|
6589
|
-
* Service for managing user profile and context settings
|
|
6590
|
-
*
|
|
6591
|
-
* User settings are passed to the agent for all conversations
|
|
6592
|
-
* to provide user context (name, email, role, timezone, etc.).
|
|
6593
|
-
*
|
|
6594
|
-
* @internal
|
|
6595
|
-
*/
|
|
6596
|
-
class UserService extends BaseService {
|
|
6597
|
-
/**
|
|
6598
|
-
* Gets the current user's profile and context settings
|
|
6599
|
-
*
|
|
6600
|
-
* @returns Promise resolving to user settings object containing profile information
|
|
6601
|
-
*
|
|
6602
|
-
* @example
|
|
6603
|
-
* ```typescript
|
|
6604
|
-
* const userSettings = await userService.getSettings();
|
|
6605
|
-
* console.log(userSettings.name); // User's name
|
|
6606
|
-
* console.log(userSettings.email); // User's email
|
|
6607
|
-
* console.log(userSettings.timezone); // User's timezone
|
|
6608
|
-
* ```
|
|
6609
|
-
*/
|
|
6610
|
-
async getSettings() {
|
|
6611
|
-
const response = await this.get(USER_ENDPOINTS.SETTINGS);
|
|
6612
|
-
return transformData(response.data, UserSettingsMap);
|
|
6613
|
-
}
|
|
6614
|
-
/**
|
|
6615
|
-
* Updates the current user's profile and context settings
|
|
6616
|
-
*
|
|
6617
|
-
* All fields are optional - only send the fields you want to change.
|
|
6618
|
-
* Set fields to `null` to explicitly clear them.
|
|
6619
|
-
* Omitting fields means no change.
|
|
6620
|
-
*
|
|
6621
|
-
* @param options - Fields to update
|
|
6622
|
-
* @returns Promise resolving to updated user settings object
|
|
6623
|
-
*
|
|
6624
|
-
* @example
|
|
6625
|
-
* ```typescript
|
|
6626
|
-
* // Update specific fields
|
|
6627
|
-
* const updatedUserSettings = await userService.updateSettings({
|
|
6628
|
-
* name: 'John Doe',
|
|
6629
|
-
* email: 'john@example.com',
|
|
6630
|
-
* timezone: 'America/New_York'
|
|
6631
|
-
* });
|
|
6632
|
-
*
|
|
6633
|
-
* // Partial update - only change timezone
|
|
6634
|
-
* await userService.updateSettings({
|
|
6635
|
-
* timezone: 'Europe/London'
|
|
6636
|
-
* });
|
|
6637
|
-
*
|
|
6638
|
-
* // Clear fields by setting to null
|
|
6639
|
-
* await userService.updateSettings({
|
|
6640
|
-
* role: null,
|
|
6641
|
-
* department: null
|
|
6642
|
-
* });
|
|
6643
|
-
* ```
|
|
6644
|
-
*/
|
|
6645
|
-
async updateSettings(options) {
|
|
6646
|
-
const response = await this.patch(USER_ENDPOINTS.SETTINGS, options);
|
|
6647
|
-
return transformData(response.data, UserSettingsMap);
|
|
6648
|
-
}
|
|
6649
|
-
}
|
|
6650
|
-
__decorate([
|
|
6651
|
-
track('ConversationalAgent.User.GetSettings')
|
|
6652
|
-
], UserService.prototype, "getSettings", null);
|
|
6653
|
-
__decorate([
|
|
6654
|
-
track('ConversationalAgent.User.UpdateSettings')
|
|
6655
|
-
], UserService.prototype, "updateSettings", null);
|
|
6656
|
-
|
|
6657
|
-
export { AgentMap, AsyncInputStreamEventHelper, AsyncInputStreamEventHelperImpl, AsyncToolCallEventHelper, AsyncToolCallEventHelperImpl, CitationErrorType, ContentPartEventHelper, ContentPartEventHelperImpl, ContentPartHelper, ConversationEventHelperBase, ConversationEventHelperManager, ConversationEventHelperManagerImpl, ConversationEventInvalidOperationError, ConversationEventValidationError, ConversationMap, ConversationalAgentService as ConversationalAgent, ConversationalAgentService, EventErrorId, ExchangeEventHelper, ExchangeEventHelperImpl, ExchangeMap, ExchangeService, ExchangeService as Exchanges, FeedbackRating, InputStreamSpeechSensitivity, InterruptType, LogLevel, MessageEventHelper, MessageEventHelperImpl, MessageMap, MessageRole, MessageService, MessageService as Messages, SessionEventHelper, SessionEventHelperImpl, SortOrder, ToolCallEventHelper, ToolCallEventHelperImpl, UserService as User, UserService, UserSettingsMap, assertCitationSourceMedia, assertCitationSourceUrl, assertExternalValue, assertInlineValue, createAgentWithMethods, createConversationWithMethods, isCitationSourceMedia, isCitationSourceUrl, isExternalValue, isInlineValue, transformExchange, transformExchanges, transformMessage };
|
|
6807
|
+
export { AgentMap, AsyncInputStreamEventHelper, AsyncInputStreamEventHelperImpl, AsyncToolCallEventHelper, AsyncToolCallEventHelperImpl, CitationErrorType, ContentPartEventHelper, ContentPartEventHelperImpl, ContentPartHelper, ConversationEventHelperBase, ConversationEventHelperManager, ConversationEventHelperManagerImpl, ConversationEventInvalidOperationError, ConversationEventValidationError, ConversationMap, ConversationalAgentService as ConversationalAgent, ConversationalAgentService, EventErrorId, ExchangeEventHelper, ExchangeEventHelperImpl, ExchangeMap, ExchangeService, ExchangeService as Exchanges, FeedbackRating, InputStreamSpeechSensitivity, InterruptType, LogLevel, MessageEventHelper, MessageEventHelperImpl, MessageMap, MessageRole, MessageService, MessageService as Messages, SessionEventHelper, SessionEventHelperImpl, SortOrder, ToolCallEventHelper, ToolCallEventHelperImpl, UserSettingsService as UserSettings, UserSettingsMap, UserSettingsService, assertCitationSourceMedia, assertCitationSourceUrl, assertExternalValue, assertInlineValue, createAgentWithMethods, createConversationWithMethods, isCitationSourceMedia, isCitationSourceUrl, isExternalValue, isInlineValue, transformExchange, transformExchanges, transformMessage };
|
package/dist/core/index.cjs
CHANGED
|
@@ -5307,7 +5307,7 @@ function normalizeBaseUrl(url) {
|
|
|
5307
5307
|
// Connection string placeholder that will be replaced during build
|
|
5308
5308
|
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";
|
|
5309
5309
|
// SDK Version placeholder
|
|
5310
|
-
const SDK_VERSION = "1.3.
|
|
5310
|
+
const SDK_VERSION = "1.3.8";
|
|
5311
5311
|
const VERSION = "Version";
|
|
5312
5312
|
const SERVICE = "Service";
|
|
5313
5313
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -5654,6 +5654,8 @@ var UiPathMetaTags;
|
|
|
5654
5654
|
// Asset resolution and routing
|
|
5655
5655
|
UiPathMetaTags["CDN_BASE"] = "uipath:cdn-base";
|
|
5656
5656
|
UiPathMetaTags["APP_BASE"] = "uipath:app-base";
|
|
5657
|
+
// Folder context (injected during coded-app deployment)
|
|
5658
|
+
UiPathMetaTags["FOLDER_KEY"] = "uipath:folder-key";
|
|
5657
5659
|
})(UiPathMetaTags || (UiPathMetaTags = {}));
|
|
5658
5660
|
|
|
5659
5661
|
/**
|
|
@@ -5682,12 +5684,13 @@ function loadFromMetaTags() {
|
|
|
5682
5684
|
tenantName: getMetaTagContent(UiPathMetaTags.TENANT_NAME),
|
|
5683
5685
|
baseUrl: getMetaTagContent(UiPathMetaTags.BASE_URL),
|
|
5684
5686
|
redirectUri: getMetaTagContent(UiPathMetaTags.REDIRECT_URI),
|
|
5687
|
+
folderKey: getMetaTagContent(UiPathMetaTags.FOLDER_KEY),
|
|
5685
5688
|
};
|
|
5686
5689
|
const hasAnyValue = Object.values(config).some(Boolean);
|
|
5687
5690
|
return hasAnyValue ? config : null;
|
|
5688
5691
|
}
|
|
5689
5692
|
|
|
5690
|
-
var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_multiLogin, _UiPath_initializeWithConfig, _UiPath_loadConfig;
|
|
5693
|
+
var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_multiLogin, _UiPath_metaFolderKey, _UiPath_initializeWithConfig, _UiPath_loadConfig;
|
|
5691
5694
|
/**
|
|
5692
5695
|
* UiPath - Core SDK class for authentication and configuration management.
|
|
5693
5696
|
*
|
|
@@ -5728,8 +5731,13 @@ class UiPath {
|
|
|
5728
5731
|
_UiPath_initialized.set(this, false);
|
|
5729
5732
|
_UiPath_partialConfig.set(this, void 0);
|
|
5730
5733
|
_UiPath_multiLogin.set(this, false);
|
|
5734
|
+
// Folder key sourced only from `<meta name="uipath:folder-key">` (coded-app
|
|
5735
|
+
// deployments). Not accepted via the public constructor; lives here so the
|
|
5736
|
+
// SDK can flow it through to BaseService.config without polluting BaseConfig.
|
|
5737
|
+
_UiPath_metaFolderKey.set(this, void 0);
|
|
5731
5738
|
// Load configuration from meta tags
|
|
5732
5739
|
const configFromMetaTags = loadFromMetaTags();
|
|
5740
|
+
__classPrivateFieldSet(this, _UiPath_metaFolderKey, configFromMetaTags?.folderKey, "f");
|
|
5733
5741
|
// Merge configuration: constructor config overrides meta tags
|
|
5734
5742
|
const mergedConfig = config ? { ...configFromMetaTags, ...config } : configFromMetaTags;
|
|
5735
5743
|
if (mergedConfig && isCompleteConfig(mergedConfig)) {
|
|
@@ -5858,7 +5866,7 @@ class UiPath {
|
|
|
5858
5866
|
__classPrivateFieldGet(this, _UiPath_authService, "f")?.updateToken(tokenInfo);
|
|
5859
5867
|
}
|
|
5860
5868
|
}
|
|
5861
|
-
_UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap(), _UiPath_partialConfig = new WeakMap(), _UiPath_multiLogin = new WeakMap(), _UiPath_instances = new WeakSet(), _UiPath_initializeWithConfig = function _UiPath_initializeWithConfig(config) {
|
|
5869
|
+
_UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap(), _UiPath_partialConfig = new WeakMap(), _UiPath_multiLogin = new WeakMap(), _UiPath_metaFolderKey = new WeakMap(), _UiPath_instances = new WeakSet(), _UiPath_initializeWithConfig = function _UiPath_initializeWithConfig(config) {
|
|
5862
5870
|
// Validate and normalize the configuration
|
|
5863
5871
|
validateConfig(config);
|
|
5864
5872
|
const hasSecretAuth = hasSecretConfig(config);
|
|
@@ -5871,7 +5879,7 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
|
|
|
5871
5879
|
secret: hasSecretAuth ? config.secret : undefined,
|
|
5872
5880
|
clientId: hasOAuthAuth ? config.clientId : undefined,
|
|
5873
5881
|
redirectUri: hasOAuthAuth ? config.redirectUri : undefined,
|
|
5874
|
-
scope: hasOAuthAuth ? config.scope : undefined
|
|
5882
|
+
scope: hasOAuthAuth ? config.scope : undefined,
|
|
5875
5883
|
});
|
|
5876
5884
|
const executionContext = new ExecutionContext();
|
|
5877
5885
|
__classPrivateFieldSet(this, _UiPath_authService, new AuthService(internalConfig, executionContext), "f");
|
|
@@ -5879,11 +5887,14 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
|
|
|
5879
5887
|
__classPrivateFieldGet(this, _UiPath_authService, "f").setMultiLogin();
|
|
5880
5888
|
}
|
|
5881
5889
|
__classPrivateFieldSet(this, _UiPath_config, internalConfig, "f");
|
|
5882
|
-
// Store internals in SDKInternalsRegistry (not visible on instance)
|
|
5890
|
+
// Store internals in SDKInternalsRegistry (not visible on instance).
|
|
5891
|
+
// `folderKey` is meta-tag-only — kept off `UiPathConfig` (which mirrors
|
|
5892
|
+
// user-passed values) and lives here on the runtime registry instead.
|
|
5883
5893
|
SDKInternalsRegistry.set(this, {
|
|
5884
5894
|
config: internalConfig,
|
|
5885
5895
|
context: executionContext,
|
|
5886
|
-
tokenManager: __classPrivateFieldGet(this, _UiPath_authService, "f").getTokenManager()
|
|
5896
|
+
tokenManager: __classPrivateFieldGet(this, _UiPath_authService, "f").getTokenManager(),
|
|
5897
|
+
folderKey: __classPrivateFieldGet(this, _UiPath_metaFolderKey, "f"),
|
|
5887
5898
|
});
|
|
5888
5899
|
// Expose read-only config for user convenience
|
|
5889
5900
|
this.config = {
|
|
@@ -5911,6 +5922,7 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
|
|
|
5911
5922
|
}, _UiPath_loadConfig = function _UiPath_loadConfig() {
|
|
5912
5923
|
// Load from meta tags
|
|
5913
5924
|
const metaConfig = loadFromMetaTags();
|
|
5925
|
+
__classPrivateFieldSet(this, _UiPath_metaFolderKey, metaConfig?.folderKey, "f");
|
|
5914
5926
|
// Merge with any partial config from constructor (constructor overrides meta tags)
|
|
5915
5927
|
const merged = { ...metaConfig, ...__classPrivateFieldGet(this, _UiPath_partialConfig, "f") };
|
|
5916
5928
|
if (!isCompleteConfig(merged)) {
|
package/dist/core/index.d.ts
CHANGED
|
@@ -529,7 +529,7 @@ declare const telemetryClient: TelemetryClient;
|
|
|
529
529
|
* SDK Telemetry constants
|
|
530
530
|
*/
|
|
531
531
|
declare 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";
|
|
532
|
-
declare const SDK_VERSION = "1.3.
|
|
532
|
+
declare const SDK_VERSION = "1.3.8";
|
|
533
533
|
declare const VERSION = "Version";
|
|
534
534
|
declare const SERVICE = "Service";
|
|
535
535
|
declare const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|