@uipath/uipath-typescript 1.3.8 → 1.3.10
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 +44 -276
- package/dist/assets/index.mjs +44 -276
- package/dist/attachments/index.cjs +42 -273
- package/dist/attachments/index.mjs +42 -273
- package/dist/buckets/index.cjs +195 -276
- package/dist/buckets/index.d.ts +213 -1
- package/dist/buckets/index.mjs +195 -276
- package/dist/cases/index.cjs +427 -343
- package/dist/cases/index.d.ts +534 -2
- package/dist/cases/index.mjs +428 -344
- package/dist/conversational-agent/index.cjs +90 -287
- package/dist/conversational-agent/index.d.ts +62 -12
- package/dist/conversational-agent/index.mjs +90 -288
- package/dist/core/index.cjs +39 -289
- package/dist/core/index.d.ts +9 -98
- package/dist/core/index.mjs +40 -275
- package/dist/document-understanding/index.cjs +18 -1
- package/dist/document-understanding/index.d.ts +636 -610
- package/dist/document-understanding/index.mjs +18 -1
- package/dist/entities/index.cjs +251 -277
- package/dist/entities/index.d.ts +305 -2
- package/dist/entities/index.mjs +251 -277
- package/dist/feedback/index.cjs +42 -274
- package/dist/feedback/index.mjs +42 -274
- package/dist/index.cjs +998 -351
- package/dist/index.d.ts +2159 -762
- package/dist/index.mjs +998 -337
- package/dist/index.umd.js +1208 -237
- package/dist/jobs/index.cjs +44 -276
- package/dist/jobs/index.mjs +44 -276
- package/dist/maestro-processes/index.cjs +1761 -1717
- package/dist/maestro-processes/index.d.ts +430 -2
- package/dist/maestro-processes/index.mjs +1762 -1718
- package/dist/processes/index.cjs +72 -305
- package/dist/processes/index.d.ts +76 -26
- package/dist/processes/index.mjs +72 -305
- package/dist/queues/index.cjs +44 -276
- package/dist/queues/index.mjs +44 -276
- package/dist/tasks/index.cjs +44 -276
- package/dist/tasks/index.mjs +44 -276
- package/package.json +8 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var coreTelemetry = require('@uipath/core-telemetry');
|
|
4
4
|
var socket_ioClient = require('socket.io-client');
|
|
5
5
|
|
|
6
6
|
/******************************************************************************
|
|
@@ -46,278 +46,33 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* SDK Telemetry constants
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const CLOUD_CLIENT_ID = "CloudClientId";
|
|
61
|
-
const CLOUD_REDIRECT_URI = "CloudRedirectUri";
|
|
62
|
-
const APP_NAME = "ApplicationName";
|
|
63
|
-
const CLOUD_ROLE_NAME = "uipath-ts-sdk";
|
|
64
|
-
// Service and logger names
|
|
65
|
-
const SDK_SERVICE_NAME = "UiPath.TypeScript.Sdk";
|
|
66
|
-
const SDK_LOGGER_NAME = "uipath-ts-sdk-telemetry";
|
|
67
|
-
// Event names
|
|
68
|
-
const SDK_RUN_EVENT = "Sdk.Run";
|
|
69
|
-
// Default value for unknown/empty attributes
|
|
70
|
-
const UNKNOWN = "";
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Log exporter that sends ALL logs as Application Insights custom events
|
|
74
|
-
*/
|
|
75
|
-
class ApplicationInsightsEventExporter {
|
|
76
|
-
constructor(connectionString) {
|
|
77
|
-
this.connectionString = connectionString;
|
|
78
|
-
}
|
|
79
|
-
export(logs, resultCallback) {
|
|
80
|
-
try {
|
|
81
|
-
logs.forEach(logRecord => {
|
|
82
|
-
this.sendAsCustomEvent(logRecord);
|
|
83
|
-
});
|
|
84
|
-
resultCallback({ code: 0 });
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
console.debug('Failed to export logs to Application Insights:', error);
|
|
88
|
-
resultCallback({ code: 2, error });
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
shutdown() {
|
|
92
|
-
return Promise.resolve();
|
|
93
|
-
}
|
|
94
|
-
sendAsCustomEvent(logRecord) {
|
|
95
|
-
// Get event name from body or attributes
|
|
96
|
-
const eventName = logRecord.body || SDK_RUN_EVENT;
|
|
97
|
-
const payload = {
|
|
98
|
-
name: 'Microsoft.ApplicationInsights.Event',
|
|
99
|
-
time: new Date().toISOString(),
|
|
100
|
-
iKey: this.extractInstrumentationKey(),
|
|
101
|
-
data: {
|
|
102
|
-
baseType: 'EventData',
|
|
103
|
-
baseData: {
|
|
104
|
-
ver: 2,
|
|
105
|
-
name: eventName,
|
|
106
|
-
properties: this.convertAttributesToProperties(logRecord.attributes || {})
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
tags: {
|
|
110
|
-
'ai.cloud.role': CLOUD_ROLE_NAME,
|
|
111
|
-
'ai.cloud.roleInstance': SDK_VERSION
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
this.sendToApplicationInsights(payload);
|
|
115
|
-
}
|
|
116
|
-
extractInstrumentationKey() {
|
|
117
|
-
const match = this.connectionString.match(/InstrumentationKey=([^;]+)/);
|
|
118
|
-
return match ? match[1] : '';
|
|
119
|
-
}
|
|
120
|
-
convertAttributesToProperties(attributes) {
|
|
121
|
-
const properties = {};
|
|
122
|
-
Object.entries(attributes || {}).forEach(([key, value]) => {
|
|
123
|
-
properties[key] = String(value);
|
|
124
|
-
});
|
|
125
|
-
return properties;
|
|
126
|
-
}
|
|
127
|
-
async sendToApplicationInsights(payload) {
|
|
128
|
-
try {
|
|
129
|
-
const ingestionEndpoint = this.extractIngestionEndpoint();
|
|
130
|
-
if (!ingestionEndpoint) {
|
|
131
|
-
console.debug('No ingestion endpoint found in connection string');
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const url = `${ingestionEndpoint}/v2/track`;
|
|
135
|
-
const response = await fetch(url, {
|
|
136
|
-
method: 'POST',
|
|
137
|
-
headers: {
|
|
138
|
-
'Content-Type': 'application/json',
|
|
139
|
-
},
|
|
140
|
-
body: JSON.stringify(payload)
|
|
141
|
-
});
|
|
142
|
-
if (!response.ok) {
|
|
143
|
-
console.debug(`Failed to send event telemetry: ${response.status} ${response.statusText}`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.debug('Error sending event telemetry to Application Insights:', error);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
extractIngestionEndpoint() {
|
|
151
|
-
const match = this.connectionString.match(/IngestionEndpoint=([^;]+)/);
|
|
152
|
-
return match ? match[1] : '';
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Singleton telemetry client
|
|
157
|
-
*/
|
|
158
|
-
class TelemetryClient {
|
|
159
|
-
constructor() {
|
|
160
|
-
this.isInitialized = false;
|
|
161
|
-
}
|
|
162
|
-
static getInstance() {
|
|
163
|
-
if (!TelemetryClient.instance) {
|
|
164
|
-
TelemetryClient.instance = new TelemetryClient();
|
|
165
|
-
}
|
|
166
|
-
return TelemetryClient.instance;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Initialize telemetry
|
|
170
|
-
*/
|
|
171
|
-
initialize(config) {
|
|
172
|
-
if (this.isInitialized) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
this.isInitialized = true;
|
|
176
|
-
if (config) {
|
|
177
|
-
this.telemetryContext = config;
|
|
178
|
-
}
|
|
179
|
-
try {
|
|
180
|
-
const connectionString = this.getConnectionString();
|
|
181
|
-
if (!connectionString) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
this.setupTelemetryProvider(connectionString);
|
|
185
|
-
}
|
|
186
|
-
catch (error) {
|
|
187
|
-
// Silent failure - telemetry errors shouldn't break functionality
|
|
188
|
-
console.debug('Failed to initialize OpenTelemetry:', error);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
getConnectionString() {
|
|
192
|
-
const connectionString = CONNECTION_STRING;
|
|
193
|
-
return connectionString;
|
|
194
|
-
}
|
|
195
|
-
setupTelemetryProvider(connectionString) {
|
|
196
|
-
const exporter = new ApplicationInsightsEventExporter(connectionString);
|
|
197
|
-
const processor = new sdkLogs.BatchLogRecordProcessor(exporter);
|
|
198
|
-
this.logProvider = new sdkLogs.LoggerProvider({
|
|
199
|
-
processors: [processor]
|
|
200
|
-
});
|
|
201
|
-
this.logger = this.logProvider.getLogger(SDK_LOGGER_NAME);
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Track a telemetry event
|
|
205
|
-
*/
|
|
206
|
-
track(eventName, name, extraAttributes = {}) {
|
|
207
|
-
try {
|
|
208
|
-
// Skip if logger not initialized
|
|
209
|
-
if (!this.logger) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
const finalDisplayName = name || eventName;
|
|
213
|
-
const attributes = this.getEnrichedAttributes(extraAttributes, eventName);
|
|
214
|
-
// Emit as log
|
|
215
|
-
this.logger.emit({
|
|
216
|
-
body: finalDisplayName,
|
|
217
|
-
attributes: attributes,
|
|
218
|
-
timestamp: Date.now(),
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
// Silent failure
|
|
223
|
-
console.debug('Failed to track telemetry event:', error);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Get enriched attributes for telemetry events
|
|
228
|
-
*/
|
|
229
|
-
getEnrichedAttributes(extraAttributes, eventName) {
|
|
230
|
-
const attributes = {
|
|
231
|
-
[APP_NAME]: SDK_SERVICE_NAME,
|
|
232
|
-
[VERSION]: SDK_VERSION,
|
|
233
|
-
[SERVICE]: eventName,
|
|
234
|
-
[CLOUD_URL]: this.createCloudUrl(),
|
|
235
|
-
[CLOUD_ORGANIZATION_NAME]: this.telemetryContext?.orgName || UNKNOWN,
|
|
236
|
-
[CLOUD_TENANT_NAME]: this.telemetryContext?.tenantName || UNKNOWN,
|
|
237
|
-
[CLOUD_REDIRECT_URI]: this.telemetryContext?.redirectUri || UNKNOWN,
|
|
238
|
-
[CLOUD_CLIENT_ID]: this.telemetryContext?.clientId || UNKNOWN,
|
|
239
|
-
...extraAttributes,
|
|
240
|
-
};
|
|
241
|
-
return attributes;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Create cloud URL from base URL, organization ID, and tenant ID
|
|
245
|
-
*/
|
|
246
|
-
createCloudUrl() {
|
|
247
|
-
const baseUrl = this.telemetryContext?.baseUrl;
|
|
248
|
-
const orgId = this.telemetryContext?.orgName;
|
|
249
|
-
const tenantId = this.telemetryContext?.tenantName;
|
|
250
|
-
if (!baseUrl || !orgId || !tenantId) {
|
|
251
|
-
return UNKNOWN;
|
|
252
|
-
}
|
|
253
|
-
return `${baseUrl}/${orgId}/${tenantId}`;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
// Export singleton instance
|
|
257
|
-
const telemetryClient = TelemetryClient.getInstance();
|
|
49
|
+
* SDK Telemetry constants.
|
|
50
|
+
*
|
|
51
|
+
* Only the SDK's identity (version, service name, role name, …) lives
|
|
52
|
+
* here. The Application Insights connection string is injected into
|
|
53
|
+
* `@uipath/core-telemetry` itself at publish time, and the generic attribute
|
|
54
|
+
* keys (`Version`, `Service`, `CloudOrganizationName`, …) are owned by
|
|
55
|
+
* `@uipath/core-telemetry` and consumed there — they are not part of the
|
|
56
|
+
* SDK's public API.
|
|
57
|
+
*/
|
|
58
|
+
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
59
|
+
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
258
60
|
|
|
259
61
|
/**
|
|
260
|
-
*
|
|
261
|
-
*/
|
|
262
|
-
/**
|
|
263
|
-
* Common tracking logic shared between method and function decorators
|
|
264
|
-
*/
|
|
265
|
-
function createTrackedFunction(originalFunction, nameOrOptions, fallbackName, opts) {
|
|
266
|
-
return function (...args) {
|
|
267
|
-
// Determine if we should track this call
|
|
268
|
-
let shouldTrack = true;
|
|
269
|
-
if (opts.condition !== undefined) {
|
|
270
|
-
if (typeof opts.condition === 'function') {
|
|
271
|
-
shouldTrack = opts.condition.apply(this, args);
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
shouldTrack = opts.condition;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
// Track the event if enabled
|
|
278
|
-
if (shouldTrack) {
|
|
279
|
-
// Use the full name provided in the decorator (e.g., "Queue.GetAll")
|
|
280
|
-
const serviceMethod = typeof nameOrOptions === 'string'
|
|
281
|
-
? nameOrOptions
|
|
282
|
-
: fallbackName;
|
|
283
|
-
// Use 'Sdk.Run' as the name and serviceMethod as the service
|
|
284
|
-
telemetryClient.track(serviceMethod, SDK_RUN_EVENT, opts.attributes);
|
|
285
|
-
}
|
|
286
|
-
// Execute the original function
|
|
287
|
-
return originalFunction.apply(this, args);
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Track decorator that can be used to automatically track function calls
|
|
292
|
-
*
|
|
293
|
-
* Usage:
|
|
294
|
-
* @track("Service.Method")
|
|
295
|
-
* function myFunction() { ... }
|
|
296
|
-
*
|
|
297
|
-
* @track("Queue.GetAll")
|
|
298
|
-
* async getAll() { ... }
|
|
299
|
-
*
|
|
300
|
-
* @track("Tasks.Create")
|
|
301
|
-
* async create() { ... }
|
|
302
|
-
*
|
|
303
|
-
* @track("Assets.Update", { condition: false })
|
|
304
|
-
* function myFunction() { ... }
|
|
62
|
+
* UiPath TypeScript SDK Telemetry
|
|
305
63
|
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
return (originalFunction) => createTrackedFunction(originalFunction, nameOrOptions, originalFunction.name || 'unknown_function', opts);
|
|
319
|
-
};
|
|
320
|
-
}
|
|
64
|
+
* Constructs the SDK's own `TelemetryClient` and binds the SDK-local
|
|
65
|
+
* `track` / `trackEvent` to it. Each consumer of `@uipath/core-telemetry`
|
|
66
|
+
* does this independently, so events carry their own consumer's identity
|
|
67
|
+
* and tenant context.
|
|
68
|
+
*/
|
|
69
|
+
// Keyed by `CLOUD_ROLE_NAME` so every SDK subpath bundle resolves to the
|
|
70
|
+
// same `TelemetryClient` instance at runtime. A single `initialize(...)`
|
|
71
|
+
// from the `UiPath` constructor therefore wires up `@track` decorators
|
|
72
|
+
// across every subpath bundle (`assets`, `feedback`, `tasks`, …).
|
|
73
|
+
const sdkClient = coreTelemetry.getOrCreateClient(CLOUD_ROLE_NAME);
|
|
74
|
+
const track = coreTelemetry.createTrack(sdkClient);
|
|
75
|
+
coreTelemetry.createTrackEvent(sdkClient);
|
|
321
76
|
|
|
322
77
|
/**
|
|
323
78
|
* Type guards for error response types
|
|
@@ -916,14 +671,25 @@ class ApiClient {
|
|
|
916
671
|
if (!text) {
|
|
917
672
|
return undefined;
|
|
918
673
|
}
|
|
919
|
-
|
|
674
|
+
try {
|
|
675
|
+
return JSON.parse(text);
|
|
676
|
+
}
|
|
677
|
+
catch (error) {
|
|
678
|
+
if (error instanceof SyntaxError) {
|
|
679
|
+
throw new ServerError({
|
|
680
|
+
message: `Server returned non-JSON response (${response.status} ${response.url}): ${error.message}`,
|
|
681
|
+
statusCode: response.status,
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
throw error;
|
|
685
|
+
}
|
|
920
686
|
}
|
|
921
687
|
catch (error) {
|
|
922
688
|
// If it's already one of our errors, re-throw it
|
|
923
689
|
if (error.type && error.type.includes('Error')) {
|
|
924
690
|
throw error;
|
|
925
691
|
}
|
|
926
|
-
// Otherwise, it's
|
|
692
|
+
// Otherwise, it's a genuine network/fetch failure
|
|
927
693
|
throw ErrorFactory.createNetworkError(error);
|
|
928
694
|
}
|
|
929
695
|
}
|
|
@@ -1548,9 +1314,9 @@ class PaginationHelpers {
|
|
|
1548
1314
|
* @returns Promise resolving to a paginated result
|
|
1549
1315
|
*/
|
|
1550
1316
|
static async getAllPaginated(params) {
|
|
1551
|
-
const { serviceAccess, getEndpoint, folderId, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1317
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1552
1318
|
const endpoint = getEndpoint(folderId);
|
|
1553
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
1319
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1554
1320
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1555
1321
|
headers,
|
|
1556
1322
|
params: additionalParams,
|
|
@@ -1578,13 +1344,13 @@ class PaginationHelpers {
|
|
|
1578
1344
|
* @returns Promise resolving to an object with data and totalCount
|
|
1579
1345
|
*/
|
|
1580
1346
|
static async getAllNonPaginated(params) {
|
|
1581
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1347
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1582
1348
|
// Set default field names
|
|
1583
1349
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1584
1350
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
1585
1351
|
// Determine endpoint and headers based on folderId
|
|
1586
1352
|
const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
|
|
1587
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
1353
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1588
1354
|
// Make the API call based on method
|
|
1589
1355
|
let response;
|
|
1590
1356
|
if (method === HTTP_METHODS.POST) {
|
|
@@ -1643,6 +1409,7 @@ class PaginationHelpers {
|
|
|
1643
1409
|
serviceAccess: config.serviceAccess,
|
|
1644
1410
|
getEndpoint: config.getEndpoint,
|
|
1645
1411
|
folderId,
|
|
1412
|
+
headers: config.headers,
|
|
1646
1413
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1647
1414
|
additionalParams: prefixedOptions,
|
|
1648
1415
|
transformFn: config.transformFn,
|
|
@@ -1660,6 +1427,7 @@ class PaginationHelpers {
|
|
|
1660
1427
|
getAllEndpoint: config.getEndpoint(),
|
|
1661
1428
|
getByFolderEndpoint: byFolderEndpoint,
|
|
1662
1429
|
folderId,
|
|
1430
|
+
headers: config.headers,
|
|
1663
1431
|
additionalParams: prefixedOptions,
|
|
1664
1432
|
transformFn: config.transformFn,
|
|
1665
1433
|
method: config.method,
|
|
@@ -2010,6 +1778,17 @@ const ConversationMap = {
|
|
|
2010
1778
|
lastActivityAt: 'lastActivityTime',
|
|
2011
1779
|
agentReleaseId: 'agentId'
|
|
2012
1780
|
};
|
|
1781
|
+
/**
|
|
1782
|
+
* Maps API filter param names (left) to SDK-facing names (right) for the conversation list endpoint.
|
|
1783
|
+
* Used by `getAll` to translate SDK filters to the field names the backend expects. Kept separate
|
|
1784
|
+
* from `ConversationMap` because `label`/`search` would otherwise collide with the `label` field
|
|
1785
|
+
* on create/update payloads.
|
|
1786
|
+
*/
|
|
1787
|
+
const ConversationGetAllFilterMap = {
|
|
1788
|
+
agentReleaseKey: 'agentKey',
|
|
1789
|
+
agentReleaseId: 'agentId',
|
|
1790
|
+
search: 'label'
|
|
1791
|
+
};
|
|
2013
1792
|
/**
|
|
2014
1793
|
* Maps fields for Exchange entity to ensure consistent SDK naming
|
|
2015
1794
|
*/
|
|
@@ -6199,24 +5978,43 @@ class ConversationService extends BaseService {
|
|
|
6199
5978
|
* @param options - Options for querying conversations including optional pagination parameters
|
|
6200
5979
|
* @returns Promise resolving to either an array of conversations {@link NonPaginatedResponse}<{@link ConversationGetResponse}> or a {@link PaginatedResponse}<{@link ConversationGetResponse}> when pagination options are used
|
|
6201
5980
|
*
|
|
6202
|
-
* @example
|
|
5981
|
+
* @example Basic usage - get all conversations
|
|
6203
5982
|
* ```typescript
|
|
6204
|
-
* // Get all conversations (non-paginated)
|
|
6205
5983
|
* const allConversations = await conversationalAgent.conversations.getAll();
|
|
6206
5984
|
*
|
|
6207
|
-
*
|
|
6208
|
-
*
|
|
5985
|
+
* for (const conversation of allConversations.items) {
|
|
5986
|
+
* console.log(`${conversation.label} - created: ${conversation.createdTime}`);
|
|
5987
|
+
* }
|
|
5988
|
+
* ```
|
|
6209
5989
|
*
|
|
6210
|
-
*
|
|
6211
|
-
*
|
|
5990
|
+
* @example With pagination
|
|
5991
|
+
* ```typescript
|
|
5992
|
+
* // First page
|
|
5993
|
+
* const firstPage = await conversationalAgent.conversations.getAll({ pageSize: 10 });
|
|
6212
5994
|
*
|
|
6213
5995
|
* // Navigate using cursor
|
|
6214
|
-
* if (
|
|
6215
|
-
* const
|
|
6216
|
-
* cursor:
|
|
5996
|
+
* if (firstPage.hasNextPage) {
|
|
5997
|
+
* const nextPage = await conversationalAgent.conversations.getAll({
|
|
5998
|
+
* cursor: firstPage.nextCursor
|
|
6217
5999
|
* });
|
|
6218
6000
|
* }
|
|
6219
6001
|
* ```
|
|
6002
|
+
*
|
|
6003
|
+
* @example Sorted with limit
|
|
6004
|
+
* ```typescript
|
|
6005
|
+
* const result = await conversationalAgent.conversations.getAll({
|
|
6006
|
+
* sort: SortOrder.Descending,
|
|
6007
|
+
* pageSize: 20
|
|
6008
|
+
* });
|
|
6009
|
+
* ```
|
|
6010
|
+
*
|
|
6011
|
+
* @example Filter by agent and search by label
|
|
6012
|
+
* ```typescript
|
|
6013
|
+
* const filtered = await conversationalAgent.conversations.getAll({
|
|
6014
|
+
* agentId: <agentId>,
|
|
6015
|
+
* label: 'budget'
|
|
6016
|
+
* });
|
|
6017
|
+
* ```
|
|
6220
6018
|
*/
|
|
6221
6019
|
async getAll(options) {
|
|
6222
6020
|
// Transform function to convert API timestamps to SDK naming convention and add methods
|
|
@@ -6224,6 +6022,10 @@ class ConversationService extends BaseService {
|
|
|
6224
6022
|
const transformedData = transformData(conversation, ConversationMap);
|
|
6225
6023
|
return createConversationWithMethods(transformedData, this, this, this._exchangeService);
|
|
6226
6024
|
};
|
|
6025
|
+
// Translate SDK filter names (agentKey/agentId/label) to backend names before forwarding
|
|
6026
|
+
const apiOptions = options
|
|
6027
|
+
? transformRequest(options, ConversationGetAllFilterMap)
|
|
6028
|
+
: undefined;
|
|
6227
6029
|
return PaginationHelpers.getAll({
|
|
6228
6030
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
6229
6031
|
getEndpoint: () => CONVERSATION_ENDPOINTS.LIST,
|
|
@@ -6237,8 +6039,8 @@ class ConversationService extends BaseService {
|
|
|
6237
6039
|
tokenParam: CONVERSATIONAL_TOKEN_PARAMS.TOKEN_PARAM
|
|
6238
6040
|
}
|
|
6239
6041
|
},
|
|
6240
|
-
excludeFromPrefix: Object.keys(
|
|
6241
|
-
},
|
|
6042
|
+
excludeFromPrefix: Object.keys(apiOptions || {}) // Conversational params are not OData
|
|
6043
|
+
}, apiOptions);
|
|
6242
6044
|
}
|
|
6243
6045
|
/**
|
|
6244
6046
|
* Updates a conversation by ID
|
|
@@ -6819,6 +6621,7 @@ exports.ConversationEventHelperManager = ConversationEventHelperManager;
|
|
|
6819
6621
|
exports.ConversationEventHelperManagerImpl = ConversationEventHelperManagerImpl;
|
|
6820
6622
|
exports.ConversationEventInvalidOperationError = ConversationEventInvalidOperationError;
|
|
6821
6623
|
exports.ConversationEventValidationError = ConversationEventValidationError;
|
|
6624
|
+
exports.ConversationGetAllFilterMap = ConversationGetAllFilterMap;
|
|
6822
6625
|
exports.ConversationMap = ConversationMap;
|
|
6823
6626
|
exports.ConversationalAgent = ConversationalAgentService;
|
|
6824
6627
|
exports.ConversationalAgentService = ConversationalAgentService;
|
|
@@ -313,6 +313,15 @@ declare class BaseService {
|
|
|
313
313
|
declare const ConversationMap: {
|
|
314
314
|
[key: string]: string;
|
|
315
315
|
};
|
|
316
|
+
/**
|
|
317
|
+
* Maps API filter param names (left) to SDK-facing names (right) for the conversation list endpoint.
|
|
318
|
+
* Used by `getAll` to translate SDK filters to the field names the backend expects. Kept separate
|
|
319
|
+
* from `ConversationMap` because `label`/`search` would otherwise collide with the `label` field
|
|
320
|
+
* on create/update payloads.
|
|
321
|
+
*/
|
|
322
|
+
declare const ConversationGetAllFilterMap: {
|
|
323
|
+
[key: string]: string;
|
|
324
|
+
};
|
|
316
325
|
/**
|
|
317
326
|
* Maps fields for Exchange entity to ensure consistent SDK naming
|
|
318
327
|
*/
|
|
@@ -3876,8 +3885,12 @@ interface ConversationServiceModel {
|
|
|
3876
3885
|
/**
|
|
3877
3886
|
* Gets all conversations with optional filtering and pagination
|
|
3878
3887
|
*
|
|
3888
|
+
* The method returns either:
|
|
3889
|
+
* - A NonPaginatedResponse with items array (when no pagination parameters are provided)
|
|
3890
|
+
* - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
|
|
3891
|
+
*
|
|
3879
3892
|
* @param options - Options for querying conversations including optional pagination parameters
|
|
3880
|
-
* @returns Promise resolving to either an array of conversations NonPaginatedResponse<ConversationGetResponse> or a PaginatedResponse<ConversationGetResponse> when pagination options are used
|
|
3893
|
+
* @returns Promise resolving to either an array of conversations {@link NonPaginatedResponse}<{@link ConversationGetResponse}> or a {@link PaginatedResponse}<{@link ConversationGetResponse}> when pagination options are used
|
|
3881
3894
|
*
|
|
3882
3895
|
* @example Basic usage - get all conversations
|
|
3883
3896
|
* ```typescript
|
|
@@ -3908,6 +3921,14 @@ interface ConversationServiceModel {
|
|
|
3908
3921
|
* pageSize: 20
|
|
3909
3922
|
* });
|
|
3910
3923
|
* ```
|
|
3924
|
+
*
|
|
3925
|
+
* @example Filter by agent and search by label
|
|
3926
|
+
* ```typescript
|
|
3927
|
+
* const filtered = await conversationalAgent.conversations.getAll({
|
|
3928
|
+
* agentId: <agentId>,
|
|
3929
|
+
* label: 'budget'
|
|
3930
|
+
* });
|
|
3931
|
+
* ```
|
|
3911
3932
|
*/
|
|
3912
3933
|
getAll<T extends ConversationGetAllOptions = ConversationGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ConversationGetResponse> : NonPaginatedResponse<ConversationGetResponse>>;
|
|
3913
3934
|
/**
|
|
@@ -4300,6 +4321,14 @@ interface ConversationUpdateOptions {
|
|
|
4300
4321
|
type ConversationGetAllOptions = PaginationOptions & {
|
|
4301
4322
|
/** Sort order for conversations */
|
|
4302
4323
|
sort?: SortOrder;
|
|
4324
|
+
/** GUID key of the agent to filter conversations by. */
|
|
4325
|
+
agentKey?: string;
|
|
4326
|
+
/** Numeric ID of the agent to filter conversations by. */
|
|
4327
|
+
agentId?: number;
|
|
4328
|
+
/**
|
|
4329
|
+
* Case-insensitive substring filter applied to conversation labels (1–100 chars).
|
|
4330
|
+
*/
|
|
4331
|
+
label?: string;
|
|
4303
4332
|
};
|
|
4304
4333
|
/**
|
|
4305
4334
|
* File upload access details for uploading file content to blob storage
|
|
@@ -4445,8 +4474,10 @@ interface RawAgentGetResponse {
|
|
|
4445
4474
|
description: string;
|
|
4446
4475
|
/** Process version */
|
|
4447
4476
|
processVersion: string;
|
|
4448
|
-
/** Process key identifier */
|
|
4477
|
+
/** Process key identifier (a dotted-path string like `Solution.Package.Agent`) */
|
|
4449
4478
|
processKey: string;
|
|
4479
|
+
/** GUID key of the agent release */
|
|
4480
|
+
releaseKey?: string;
|
|
4450
4481
|
/** Folder ID */
|
|
4451
4482
|
folderId: number;
|
|
4452
4483
|
/** Feed ID */
|
|
@@ -6412,24 +6443,43 @@ declare class ConversationService extends BaseService implements ConversationSer
|
|
|
6412
6443
|
* @param options - Options for querying conversations including optional pagination parameters
|
|
6413
6444
|
* @returns Promise resolving to either an array of conversations {@link NonPaginatedResponse}<{@link ConversationGetResponse}> or a {@link PaginatedResponse}<{@link ConversationGetResponse}> when pagination options are used
|
|
6414
6445
|
*
|
|
6415
|
-
* @example
|
|
6446
|
+
* @example Basic usage - get all conversations
|
|
6416
6447
|
* ```typescript
|
|
6417
|
-
* // Get all conversations (non-paginated)
|
|
6418
6448
|
* const allConversations = await conversationalAgent.conversations.getAll();
|
|
6419
6449
|
*
|
|
6420
|
-
*
|
|
6421
|
-
*
|
|
6450
|
+
* for (const conversation of allConversations.items) {
|
|
6451
|
+
* console.log(`${conversation.label} - created: ${conversation.createdTime}`);
|
|
6452
|
+
* }
|
|
6453
|
+
* ```
|
|
6422
6454
|
*
|
|
6423
|
-
*
|
|
6424
|
-
*
|
|
6455
|
+
* @example With pagination
|
|
6456
|
+
* ```typescript
|
|
6457
|
+
* // First page
|
|
6458
|
+
* const firstPage = await conversationalAgent.conversations.getAll({ pageSize: 10 });
|
|
6425
6459
|
*
|
|
6426
6460
|
* // Navigate using cursor
|
|
6427
|
-
* if (
|
|
6428
|
-
* const
|
|
6429
|
-
* cursor:
|
|
6461
|
+
* if (firstPage.hasNextPage) {
|
|
6462
|
+
* const nextPage = await conversationalAgent.conversations.getAll({
|
|
6463
|
+
* cursor: firstPage.nextCursor
|
|
6430
6464
|
* });
|
|
6431
6465
|
* }
|
|
6432
6466
|
* ```
|
|
6467
|
+
*
|
|
6468
|
+
* @example Sorted with limit
|
|
6469
|
+
* ```typescript
|
|
6470
|
+
* const result = await conversationalAgent.conversations.getAll({
|
|
6471
|
+
* sort: SortOrder.Descending,
|
|
6472
|
+
* pageSize: 20
|
|
6473
|
+
* });
|
|
6474
|
+
* ```
|
|
6475
|
+
*
|
|
6476
|
+
* @example Filter by agent and search by label
|
|
6477
|
+
* ```typescript
|
|
6478
|
+
* const filtered = await conversationalAgent.conversations.getAll({
|
|
6479
|
+
* agentId: <agentId>,
|
|
6480
|
+
* label: 'budget'
|
|
6481
|
+
* });
|
|
6482
|
+
* ```
|
|
6433
6483
|
*/
|
|
6434
6484
|
getAll<T extends ConversationGetAllOptions = ConversationGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ConversationGetResponse> : NonPaginatedResponse<ConversationGetResponse>>;
|
|
6435
6485
|
/**
|
|
@@ -6963,5 +7013,5 @@ declare class ConversationalAgentService extends BaseService implements Conversa
|
|
|
6963
7013
|
getFeatureFlags(): Promise<FeatureFlags>;
|
|
6964
7014
|
}
|
|
6965
7015
|
|
|
6966
|
-
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, 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 };
|
|
7016
|
+
export { AgentMap, AsyncInputStreamEventHelper, AsyncInputStreamEventHelperImpl, AsyncToolCallEventHelper, AsyncToolCallEventHelperImpl, CitationErrorType, ContentPartEventHelper, ContentPartEventHelperImpl, ContentPartHelper, ConversationEventHelperBase, ConversationEventHelperManager, ConversationEventHelperManagerImpl, ConversationEventInvalidOperationError, ConversationEventValidationError, ConversationGetAllFilterMap, ConversationMap, ConversationalAgentService as ConversationalAgent, ConversationalAgentService, EventErrorId, ExchangeEventHelper, ExchangeEventHelperImpl, ExchangeMap, ExchangeService, ExchangeService as Exchanges, FeedbackRating, InputStreamSpeechSensitivity, InterruptType, 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 };
|
|
6967
7017
|
export type { AgentAppearance, AgentConversationServiceModel, AgentCreateConversationOptions, AgentGetByIdResponse, AgentGetResponse, AgentInput, AgentMethods, AgentStartingPrompt, AnyErrorEndHandler, AnyErrorEndHandlerArgs, AnyErrorStartHandler, AnyErrorStartHandlerArgs, AsyncInputStream, AsyncInputStreamChunkEvent, AsyncInputStreamChunkHandler, AsyncInputStreamEndEvent, AsyncInputStreamEndHandler, AsyncInputStreamEvent, AsyncInputStreamStartEvent, AsyncToolCallStartHandler, AsyncToolCallStartHandlerAsync, AsyncToolCallStream, ChunkHandler, Citation, CitationEndEvent, CitationError, CitationEvent, CitationOptions, CitationSource, CitationSourceBase, CitationSourceMedia, CitationSourceUrl, CitationStartEvent, CompletedContentPart, CompletedMessage, CompletedToolCall, ContentPart, ContentPartChunkEvent, ContentPartCompletedHandler, ContentPartData, ContentPartEndEvent, ContentPartEndHandler, ContentPartEvent, ContentPartGetResponse, ContentPartInterrupted, ContentPartStartEvent, ContentPartStartEventOptions, ContentPartStartEventWithData, ContentPartStartHandler, ContentPartStartHandlerAsync, ContentPartStartMetaData, ContentPartStream, ConversationAttachmentCreateResponse, ConversationAttachmentUploadResponse, ConversationCreateOptions, ConversationCreateResponse, ConversationDeleteResponse, ConversationEvent, ConversationEventEmitter, ConversationEventErrorSource, ConversationEventHandler, ConversationEventHelperManagerConfig, ConversationEventHelperProperties, ConversationExchangeServiceModel, ConversationGetAllOptions, ConversationGetResponse, ConversationJobStartOverrides, ConversationMethods, ConversationServiceModel, ConversationSessionMethods, ConversationSessionOptions, ConversationUpdateOptions, ConversationUpdateResponse, ConversationalAgentOptions, ConversationalAgentServiceModel, CreateFeedbackOptions, DeletedHandler, ErrorEndEvent, ErrorEndEventOptions, ErrorEndHandler, ErrorEndHandlerArgs, ErrorEvent, ErrorStartEvent, ErrorStartEventOptions, ErrorStartHandler, ErrorStartHandlerArgs, Exchange, ExchangeEndEvent, ExchangeEndHandler, ExchangeEvent, ExchangeGetAllOptions, ExchangeGetByIdOptions, ExchangeGetResponse, ExchangeServiceModel, ExchangeStartEvent, ExchangeStartEventOptions, ExchangeStartHandler, ExchangeStartHandlerAsync, ExchangeStream, ExternalValue, FeatureFlags, FeedbackCreateResponse, FileUploadAccess, GenericInterruptStartEvent, InlineOrExternalValue, InlineValue, InputStreamStartEventOptions, InputStreamStartHandler, Interrupt, InterruptCompletedHandler, InterruptCompletedHandlerArgs, InterruptEndEvent, InterruptEndHandler, InterruptEndHandlerArgs, InterruptEvent, InterruptStartEvent, InterruptStartHandler, InterruptStartHandlerArgs, JSONArray, JSONObject, JSONPrimitive, JSONValue, LabelUpdatedEvent, LabelUpdatedHandler, MakeOptional, MakeRequired, Message, MessageCompletedHandler, MessageEndEvent, MessageEndHandler, MessageEvent, MessageGetResponse, MessageServiceModel, MessageStartEvent, MessageStartEventOptions, MessageStartHandler, MessageStartHandlerAsync, MessageStream, MetaData, MetaEvent, MetaEventHandler, RawAgentGetByIdResponse, RawAgentGetResponse, RawConversationGetResponse, SendMessageWithContentPartOptions, SessionCapabilities, SessionEndEvent, SessionEndHandler, SessionEndingEvent, SessionEndingHandler, SessionStartEvent, SessionStartEventOptions, SessionStartHandler, SessionStartHandlerAsync, SessionStartedEvent, SessionStartedHandler, SessionStream, Simplify, ToolCall, ToolCallCompletedHandler, ToolCallConfirmHandler, ToolCallConfirmationEndValue, ToolCallConfirmationEvent, ToolCallConfirmationHandler, ToolCallConfirmationHandlerArgs, ToolCallConfirmationInterruptStartEvent, ToolCallConfirmationValue, ToolCallEndEvent, ToolCallEndHandler, ToolCallEvent, ToolCallInputValue, ToolCallOutputValue, ToolCallResult, ToolCallStartEvent, ToolCallStartEventWithId, ToolCallStartHandler, ToolCallStartHandlerAsync, ToolCallStream, UnhandledErrorEndHandler, UnhandledErrorEndHandlerArgs, UnhandledErrorStartHandler, UnhandledErrorStartHandlerArgs, UserSettingsGetResponse, UserSettingsServiceModel, UserSettingsUpdateOptions, UserSettingsUpdateResponse };
|