@uipath/uipath-typescript 1.3.10 → 1.4.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.cjs +1765 -0
- package/dist/agent-memory/index.d.ts +588 -0
- package/dist/agent-memory/index.mjs +1763 -0
- package/dist/agents/index.cjs +1726 -0
- package/dist/agents/index.d.ts +502 -0
- package/dist/agents/index.mjs +1724 -0
- package/dist/assets/index.cjs +155 -30
- package/dist/assets/index.d.ts +84 -5
- package/dist/assets/index.mjs +155 -30
- package/dist/attachments/index.cjs +37 -6
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +37 -6
- package/dist/buckets/index.cjs +37 -6
- package/dist/buckets/index.d.ts +1 -0
- package/dist/buckets/index.mjs +37 -6
- package/dist/cases/index.cjs +192 -10
- package/dist/cases/index.d.ts +208 -7
- package/dist/cases/index.mjs +192 -11
- package/dist/conversational-agent/index.cjs +124 -57
- package/dist/conversational-agent/index.d.ts +190 -122
- package/dist/conversational-agent/index.mjs +124 -57
- package/dist/core/index.cjs +413 -105
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.mjs +413 -105
- package/dist/entities/index.cjs +135 -70
- package/dist/entities/index.d.ts +146 -45
- package/dist/entities/index.mjs +135 -70
- package/dist/feedback/index.cjs +37 -6
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.mjs +37 -6
- package/dist/governance/index.cjs +1782 -0
- package/dist/governance/index.d.ts +598 -0
- package/dist/governance/index.mjs +1780 -0
- package/dist/index.cjs +1050 -291
- package/dist/index.d.ts +1313 -134
- package/dist/index.mjs +1050 -292
- package/dist/index.umd.js +4546 -3770
- package/dist/jobs/index.cjs +37 -6
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +37 -6
- package/dist/maestro-processes/index.cjs +224 -18
- package/dist/maestro-processes/index.d.ts +221 -9
- package/dist/maestro-processes/index.mjs +224 -18
- package/dist/processes/index.cjs +37 -6
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +37 -6
- package/dist/queues/index.cjs +37 -6
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +37 -6
- package/dist/tasks/index.cjs +37 -6
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.mjs +37 -6
- package/dist/traces/index.cjs +1933 -0
- package/dist/traces/index.d.ts +566 -0
- package/dist/traces/index.mjs +1931 -0
- package/package.json +42 -2
|
@@ -777,6 +777,32 @@ function filterUndefined(obj) {
|
|
|
777
777
|
*/
|
|
778
778
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
779
779
|
isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
|
|
780
|
+
const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
|
|
781
|
+
/**
|
|
782
|
+
* True when the coded app has been loaded inside a host frame that explicitly
|
|
783
|
+
* opted into token delegation by adding `?host=embed` to the iframe src URL.
|
|
784
|
+
*/
|
|
785
|
+
const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
|
|
786
|
+
/**
|
|
787
|
+
* The validated parent origin, read from the `?basedomain=` query param set
|
|
788
|
+
* by the embedding host in the iframe src URL.
|
|
789
|
+
* Mirrors the same mechanism used by ActionCenterTokenManager.
|
|
790
|
+
* Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
|
|
791
|
+
*/
|
|
792
|
+
(() => {
|
|
793
|
+
if (!isHostEmbedded)
|
|
794
|
+
return null;
|
|
795
|
+
const basedomain = _params?.get('basedomain');
|
|
796
|
+
if (!basedomain)
|
|
797
|
+
return null;
|
|
798
|
+
try {
|
|
799
|
+
return new URL(basedomain).origin;
|
|
800
|
+
}
|
|
801
|
+
catch {
|
|
802
|
+
console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
|
|
803
|
+
return null;
|
|
804
|
+
}
|
|
805
|
+
})();
|
|
780
806
|
|
|
781
807
|
/**
|
|
782
808
|
* Base64 encoding/decoding
|
|
@@ -1361,8 +1387,9 @@ class PaginationHelpers {
|
|
|
1361
1387
|
});
|
|
1362
1388
|
}
|
|
1363
1389
|
// Extract and transform items from response
|
|
1364
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1365
|
-
|
|
1390
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1391
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1392
|
+
const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
|
|
1366
1393
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1367
1394
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1368
1395
|
// Parse items - automatically handle JSON string responses
|
|
@@ -1408,7 +1435,7 @@ class PaginationHelpers {
|
|
|
1408
1435
|
getEndpoint: config.getEndpoint,
|
|
1409
1436
|
folderId,
|
|
1410
1437
|
headers: config.headers,
|
|
1411
|
-
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1438
|
+
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1412
1439
|
additionalParams: prefixedOptions,
|
|
1413
1440
|
transformFn: config.transformFn,
|
|
1414
1441
|
method: config.method,
|
|
@@ -1666,6 +1693,8 @@ class BaseService {
|
|
|
1666
1693
|
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1667
1694
|
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1668
1695
|
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1696
|
+
// When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
|
|
1697
|
+
const zeroBased = paginationParams?.zeroBased ?? false;
|
|
1669
1698
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1670
1699
|
if (convertToSkip) {
|
|
1671
1700
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
@@ -1673,7 +1702,8 @@ class BaseService {
|
|
|
1673
1702
|
}
|
|
1674
1703
|
}
|
|
1675
1704
|
else {
|
|
1676
|
-
|
|
1705
|
+
const sdkPageNumber = params.pageNumber || 1;
|
|
1706
|
+
requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
|
|
1677
1707
|
}
|
|
1678
1708
|
{
|
|
1679
1709
|
requestParams[countParam] = true;
|
|
@@ -1702,8 +1732,9 @@ class BaseService {
|
|
|
1702
1732
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1703
1733
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1704
1734
|
// Extract items and metadata
|
|
1705
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1706
|
-
|
|
1735
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1736
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1737
|
+
const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
|
|
1707
1738
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1708
1739
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1709
1740
|
const continuationToken = response.data[continuationTokenField];
|
|
@@ -4945,37 +4976,58 @@ class ExchangeService extends BaseService {
|
|
|
4945
4976
|
super(instance, buildConversationalAgentHeaders(options));
|
|
4946
4977
|
}
|
|
4947
4978
|
/**
|
|
4948
|
-
* Gets
|
|
4979
|
+
* Gets exchanges for a conversation with pagination and optional sort parameters
|
|
4949
4980
|
*
|
|
4950
|
-
*
|
|
4951
|
-
*
|
|
4952
|
-
*
|
|
4981
|
+
* Returns a paginated response. When called without `pageSize`/`cursor`, the
|
|
4982
|
+
* backend applies its default page size — inspect `hasNextPage`/`nextCursor`
|
|
4983
|
+
* to navigate further pages.
|
|
4953
4984
|
*
|
|
4954
4985
|
* @param conversationId - The conversation ID to get exchanges for
|
|
4955
4986
|
* @param options - Options for querying exchanges including optional pagination parameters
|
|
4956
|
-
* @returns Promise resolving to
|
|
4987
|
+
* @returns Promise resolving to a {@link PaginatedResponse}<{@link ExchangeGetResponse}>
|
|
4957
4988
|
*
|
|
4958
|
-
* @example
|
|
4989
|
+
* @example Basic usage - default page size and sort order
|
|
4959
4990
|
* ```typescript
|
|
4960
|
-
* //
|
|
4961
|
-
* const
|
|
4962
|
-
*
|
|
4963
|
-
* // First page with pagination
|
|
4964
|
-
* const firstPageOfExchanges = await exchanges.getAll(conversationId, { pageSize: 10 });
|
|
4991
|
+
* // First page
|
|
4992
|
+
* const firstPage = await exchanges.getAll(conversationId);
|
|
4965
4993
|
*
|
|
4966
4994
|
* // Navigate using cursor
|
|
4967
|
-
* if (
|
|
4968
|
-
* const
|
|
4995
|
+
* if (firstPage.hasNextPage) {
|
|
4996
|
+
* const nextPage = await exchanges.getAll(conversationId, { cursor: firstPage.nextCursor });
|
|
4997
|
+
* }
|
|
4998
|
+
* ```
|
|
4999
|
+
*
|
|
5000
|
+
* @example With explicit page size and exchange/message sort orders
|
|
5001
|
+
* ```typescript
|
|
5002
|
+
* import { SortOrder } from '@uipath/uipath-typescript/conversational-agent';
|
|
5003
|
+
*
|
|
5004
|
+
* const firstPage = await exchanges.getAll(conversationId, {
|
|
5005
|
+
* pageSize: 10,
|
|
5006
|
+
* exchangeSort: SortOrder.Descending,
|
|
5007
|
+
* messageSort: SortOrder.Ascending
|
|
5008
|
+
* });
|
|
5009
|
+
*
|
|
5010
|
+
* // Navigate using cursor and same parameters
|
|
5011
|
+
* if (firstPage.hasNextPage) {
|
|
5012
|
+
* const nextPage = await exchanges.getAll(conversationId, {
|
|
5013
|
+
* pageSize: 10,
|
|
5014
|
+
* exchangeSort: SortOrder.Descending,
|
|
5015
|
+
* messageSort: SortOrder.Ascending,
|
|
5016
|
+
* cursor: firstPage.nextCursor
|
|
5017
|
+
* });
|
|
4969
5018
|
* }
|
|
4970
5019
|
* ```
|
|
4971
5020
|
*/
|
|
4972
5021
|
async getAll(conversationId, options) {
|
|
4973
|
-
const
|
|
4974
|
-
|
|
5022
|
+
const { pageSize, cursor, jumpToPage, ...additionalParams } = options ?? {};
|
|
5023
|
+
const paginationParams = cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize };
|
|
5024
|
+
return PaginationHelpers.getAllPaginated({
|
|
4975
5025
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
4976
5026
|
getEndpoint: () => EXCHANGE_ENDPOINTS.LIST(conversationId),
|
|
4977
|
-
|
|
4978
|
-
|
|
5027
|
+
paginationParams,
|
|
5028
|
+
additionalParams,
|
|
5029
|
+
transformFn: transformExchange,
|
|
5030
|
+
options: {
|
|
4979
5031
|
paginationType: PaginationType.TOKEN,
|
|
4980
5032
|
itemsField: CONVERSATIONAL_PAGINATION.ITEMS_FIELD,
|
|
4981
5033
|
continuationTokenField: CONVERSATIONAL_PAGINATION.CONTINUATION_TOKEN_FIELD,
|
|
@@ -4983,9 +5035,8 @@ class ExchangeService extends BaseService {
|
|
|
4983
5035
|
pageSizeParam: CONVERSATIONAL_TOKEN_PARAMS.PAGE_SIZE_PARAM,
|
|
4984
5036
|
tokenParam: CONVERSATIONAL_TOKEN_PARAMS.TOKEN_PARAM
|
|
4985
5037
|
}
|
|
4986
|
-
}
|
|
4987
|
-
|
|
4988
|
-
}, options);
|
|
5038
|
+
}
|
|
5039
|
+
});
|
|
4989
5040
|
}
|
|
4990
5041
|
/**
|
|
4991
5042
|
* Gets an exchange by ID with its messages
|
|
@@ -5967,28 +6018,23 @@ class ConversationService extends BaseService {
|
|
|
5967
6018
|
return createConversationWithMethods(transformedData, this, this, this._exchangeService);
|
|
5968
6019
|
}
|
|
5969
6020
|
/**
|
|
5970
|
-
* Gets
|
|
6021
|
+
* Gets conversations with pagination and optional sort/filter parameters
|
|
5971
6022
|
*
|
|
5972
|
-
*
|
|
5973
|
-
*
|
|
5974
|
-
*
|
|
6023
|
+
* Returns a paginated response. When called without `pageSize`/`cursor`, a
|
|
6024
|
+
* default page size is applied - inspect `hasNextPage`/`nextCursor`
|
|
6025
|
+
* to navigate further pages.
|
|
5975
6026
|
*
|
|
5976
|
-
* @param options - Options for querying conversations
|
|
5977
|
-
* @returns Promise resolving to
|
|
6027
|
+
* @param options - Options for querying conversations
|
|
6028
|
+
* @returns Promise resolving to a {@link PaginatedResponse}<{@link ConversationGetResponse}>
|
|
5978
6029
|
*
|
|
5979
|
-
* @example Basic usage -
|
|
6030
|
+
* @example Basic usage - default sort, pagination, and without filtering
|
|
5980
6031
|
* ```typescript
|
|
5981
|
-
*
|
|
6032
|
+
* // First page
|
|
6033
|
+
* const firstPage = await conversationalAgent.conversations.getAll();
|
|
5982
6034
|
*
|
|
5983
|
-
* for (const conversation of
|
|
6035
|
+
* for (const conversation of firstPage.items) {
|
|
5984
6036
|
* console.log(`${conversation.label} - created: ${conversation.createdTime}`);
|
|
5985
6037
|
* }
|
|
5986
|
-
* ```
|
|
5987
|
-
*
|
|
5988
|
-
* @example With pagination
|
|
5989
|
-
* ```typescript
|
|
5990
|
-
* // First page
|
|
5991
|
-
* const firstPage = await conversationalAgent.conversations.getAll({ pageSize: 10 });
|
|
5992
6038
|
*
|
|
5993
6039
|
* // Navigate using cursor
|
|
5994
6040
|
* if (firstPage.hasNextPage) {
|
|
@@ -5998,37 +6044,59 @@ class ConversationService extends BaseService {
|
|
|
5998
6044
|
* }
|
|
5999
6045
|
* ```
|
|
6000
6046
|
*
|
|
6001
|
-
* @example
|
|
6047
|
+
* @example With explicit page size and sort order (by last-activity timestamp)
|
|
6002
6048
|
* ```typescript
|
|
6003
|
-
*
|
|
6004
|
-
*
|
|
6005
|
-
*
|
|
6049
|
+
* import { SortOrder } from '@uipath/uipath-typescript/conversational-agent';
|
|
6050
|
+
*
|
|
6051
|
+
* // First page
|
|
6052
|
+
* const firstPage = await conversationalAgent.conversations.getAll({
|
|
6053
|
+
* pageSize: 10,
|
|
6054
|
+
* sort: SortOrder.Descending
|
|
6006
6055
|
* });
|
|
6056
|
+
*
|
|
6057
|
+
* // Navigate using cursor and same parameters
|
|
6058
|
+
* if (firstPage.hasNextPage) {
|
|
6059
|
+
* const nextPage = await conversationalAgent.conversations.getAll({
|
|
6060
|
+
* pageSize: 10,
|
|
6061
|
+
* sort: SortOrder.Descending,
|
|
6062
|
+
* cursor: firstPage.nextCursor
|
|
6063
|
+
* });
|
|
6064
|
+
* }
|
|
6007
6065
|
* ```
|
|
6008
6066
|
*
|
|
6009
|
-
* @example
|
|
6067
|
+
* @example With agent-filter and label-search
|
|
6010
6068
|
* ```typescript
|
|
6011
|
-
* const
|
|
6069
|
+
* const firstPage = await conversationalAgent.conversations.getAll({
|
|
6012
6070
|
* agentId: <agentId>,
|
|
6013
6071
|
* label: 'budget'
|
|
6014
6072
|
* });
|
|
6073
|
+
*
|
|
6074
|
+
* // Navigate using cursor and same parameters
|
|
6075
|
+
* if (firstPage.hasNextPage) {
|
|
6076
|
+
* const nextPage = await conversationalAgent.conversations.getAll({
|
|
6077
|
+
* agentId: <agentId>,
|
|
6078
|
+
* label: 'budget',
|
|
6079
|
+
* cursor: firstPage.nextCursor
|
|
6080
|
+
* });
|
|
6081
|
+
* }
|
|
6015
6082
|
* ```
|
|
6016
6083
|
*/
|
|
6017
6084
|
async getAll(options) {
|
|
6018
|
-
// Transform function to convert API timestamps to SDK naming convention and add methods
|
|
6019
6085
|
const transformFn = (conversation) => {
|
|
6020
6086
|
const transformedData = transformData(conversation, ConversationMap);
|
|
6021
6087
|
return createConversationWithMethods(transformedData, this, this, this._exchangeService);
|
|
6022
6088
|
};
|
|
6089
|
+
const { pageSize, cursor, jumpToPage, ...filterOptions } = options ?? {};
|
|
6023
6090
|
// Translate SDK filter names (agentKey/agentId/label) to backend names before forwarding
|
|
6024
|
-
const
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
return PaginationHelpers.getAll({
|
|
6091
|
+
const additionalParams = transformRequest(filterOptions, ConversationGetAllFilterMap);
|
|
6092
|
+
const paginationParams = cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize };
|
|
6093
|
+
return PaginationHelpers.getAllPaginated({
|
|
6028
6094
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
6029
6095
|
getEndpoint: () => CONVERSATION_ENDPOINTS.LIST,
|
|
6096
|
+
paginationParams,
|
|
6097
|
+
additionalParams,
|
|
6030
6098
|
transformFn,
|
|
6031
|
-
|
|
6099
|
+
options: {
|
|
6032
6100
|
paginationType: PaginationType.TOKEN,
|
|
6033
6101
|
itemsField: CONVERSATIONAL_PAGINATION.ITEMS_FIELD,
|
|
6034
6102
|
continuationTokenField: CONVERSATIONAL_PAGINATION.CONTINUATION_TOKEN_FIELD,
|
|
@@ -6036,9 +6104,8 @@ class ConversationService extends BaseService {
|
|
|
6036
6104
|
pageSizeParam: CONVERSATIONAL_TOKEN_PARAMS.PAGE_SIZE_PARAM,
|
|
6037
6105
|
tokenParam: CONVERSATIONAL_TOKEN_PARAMS.TOKEN_PARAM
|
|
6038
6106
|
}
|
|
6039
|
-
}
|
|
6040
|
-
|
|
6041
|
-
}, apiOptions);
|
|
6107
|
+
}
|
|
6108
|
+
});
|
|
6042
6109
|
}
|
|
6043
6110
|
/**
|
|
6044
6111
|
* Updates a conversation by ID
|
|
@@ -6072,7 +6139,7 @@ class ConversationService extends BaseService {
|
|
|
6072
6139
|
*/
|
|
6073
6140
|
async deleteById(id) {
|
|
6074
6141
|
const response = await this.delete(CONVERSATION_ENDPOINTS.DELETE(id));
|
|
6075
|
-
return response.data;
|
|
6142
|
+
return transformData(response.data, ConversationMap);
|
|
6076
6143
|
}
|
|
6077
6144
|
// ==================== Attachments ====================
|
|
6078
6145
|
/**
|