@uipath/uipath-typescript 1.3.2 → 1.3.4
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 +21 -8
- package/dist/assets/index.mjs +21 -8
- package/dist/attachments/index.cjs +21 -8
- package/dist/attachments/index.mjs +21 -8
- package/dist/buckets/index.cjs +21 -8
- package/dist/buckets/index.mjs +21 -8
- package/dist/cases/index.cjs +41 -13
- package/dist/cases/index.d.ts +15 -0
- package/dist/cases/index.mjs +41 -13
- package/dist/conversational-agent/index.cjs +39 -8
- package/dist/conversational-agent/index.d.ts +55 -2
- package/dist/conversational-agent/index.mjs +39 -8
- package/dist/core/index.cjs +16 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +16 -1
- package/dist/entities/index.cjs +55 -8
- package/dist/entities/index.d.ts +54 -0
- package/dist/entities/index.mjs +55 -8
- package/dist/feedback/index.cjs +1911 -0
- package/dist/feedback/index.d.ts +475 -0
- package/dist/feedback/index.mjs +1909 -0
- package/dist/index.cjs +451 -189
- package/dist/index.d.ts +388 -13
- package/dist/index.mjs +452 -190
- package/dist/index.umd.js +451 -189
- package/dist/jobs/index.cjs +384 -8
- package/dist/jobs/index.d.ts +220 -2
- package/dist/jobs/index.mjs +385 -9
- package/dist/maestro-processes/index.cjs +21 -8
- package/dist/maestro-processes/index.mjs +21 -8
- package/dist/processes/index.cjs +21 -8
- package/dist/processes/index.mjs +21 -8
- package/dist/queues/index.cjs +21 -8
- package/dist/queues/index.mjs +21 -8
- package/dist/tasks/index.cjs +41 -13
- package/dist/tasks/index.d.ts +25 -10
- package/dist/tasks/index.mjs +42 -14
- package/package.json +13 -2
|
@@ -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.4";
|
|
53
53
|
const VERSION = "Version";
|
|
54
54
|
const SERVICE = "Service";
|
|
55
55
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -779,6 +779,8 @@ class ErrorFactory {
|
|
|
779
779
|
}
|
|
780
780
|
|
|
781
781
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
782
|
+
const TRACEPARENT = 'traceparent';
|
|
783
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
782
784
|
/**
|
|
783
785
|
* Content type constants for HTTP requests/responses
|
|
784
786
|
*/
|
|
@@ -845,8 +847,13 @@ class ApiClient {
|
|
|
845
847
|
if (isFormData) {
|
|
846
848
|
delete defaultHeaders['Content-Type'];
|
|
847
849
|
}
|
|
850
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
851
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
852
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
848
853
|
const headers = {
|
|
849
854
|
...defaultHeaders,
|
|
855
|
+
[TRACEPARENT]: traceparentValue,
|
|
856
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
850
857
|
...options.headers
|
|
851
858
|
};
|
|
852
859
|
// Convert params to URLSearchParams
|
|
@@ -886,7 +893,11 @@ class ApiClient {
|
|
|
886
893
|
const text = await response.text();
|
|
887
894
|
return text;
|
|
888
895
|
}
|
|
889
|
-
|
|
896
|
+
const text = await response.text();
|
|
897
|
+
if (!text) {
|
|
898
|
+
return undefined;
|
|
899
|
+
}
|
|
900
|
+
return JSON.parse(text);
|
|
890
901
|
}
|
|
891
902
|
catch (error) {
|
|
892
903
|
// If it's already one of our errors, re-throw it
|
|
@@ -1542,8 +1553,9 @@ class PaginationHelpers {
|
|
|
1542
1553
|
});
|
|
1543
1554
|
}
|
|
1544
1555
|
// Extract and transform items from response
|
|
1545
|
-
|
|
1546
|
-
const
|
|
1556
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1557
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1558
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1547
1559
|
// Parse items - automatically handle JSON string responses
|
|
1548
1560
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1549
1561
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1794,7 +1806,7 @@ class BaseService {
|
|
|
1794
1806
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1795
1807
|
// Prepare request parameters based on pagination type
|
|
1796
1808
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1797
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1809
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1798
1810
|
if (method.toUpperCase() === 'POST') {
|
|
1799
1811
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1800
1812
|
options.body = {
|
|
@@ -1802,6 +1814,7 @@ class BaseService {
|
|
|
1802
1814
|
...options.params,
|
|
1803
1815
|
...requestParams
|
|
1804
1816
|
};
|
|
1817
|
+
options.params = undefined;
|
|
1805
1818
|
}
|
|
1806
1819
|
else {
|
|
1807
1820
|
// Merge pagination parameters with existing parameters
|
|
@@ -1842,7 +1855,6 @@ class BaseService {
|
|
|
1842
1855
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1843
1856
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1844
1857
|
}
|
|
1845
|
-
// Include total count for ODATA APIs
|
|
1846
1858
|
{
|
|
1847
1859
|
requestParams[countParam] = true;
|
|
1848
1860
|
}
|
|
@@ -1870,8 +1882,9 @@ class BaseService {
|
|
|
1870
1882
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1871
1883
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1872
1884
|
// Extract items and metadata
|
|
1873
|
-
|
|
1874
|
-
const
|
|
1885
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1886
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1887
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1875
1888
|
const continuationToken = response.data[continuationTokenField];
|
|
1876
1889
|
// Determine if there are more pages
|
|
1877
1890
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -6308,6 +6321,21 @@ class ConversationService extends BaseService {
|
|
|
6308
6321
|
onConnectionStatusChanged(handler) {
|
|
6309
6322
|
return this._sessionManager.onConnectionStatusChanged(handler);
|
|
6310
6323
|
}
|
|
6324
|
+
/**
|
|
6325
|
+
* Closes the WebSocket connection and releases all session resources.
|
|
6326
|
+
*
|
|
6327
|
+
* In Node.js the WebSocket keeps the event loop alive until disconnected,
|
|
6328
|
+
* so call this to allow the process to exit cleanly. In the browser the
|
|
6329
|
+
* runtime handles socket cleanup on page unload, so this is effectively a no-op.
|
|
6330
|
+
*
|
|
6331
|
+
* @example
|
|
6332
|
+
* ```typescript
|
|
6333
|
+
* conversationalAgent.conversations.disconnect();
|
|
6334
|
+
* ```
|
|
6335
|
+
*/
|
|
6336
|
+
disconnect() {
|
|
6337
|
+
this._sessionManager.disconnect();
|
|
6338
|
+
}
|
|
6311
6339
|
// ==================== Private Methods ====================
|
|
6312
6340
|
_getEvents() {
|
|
6313
6341
|
if (this._eventHelper === null) {
|
|
@@ -6343,6 +6371,9 @@ __decorate([
|
|
|
6343
6371
|
__decorate([
|
|
6344
6372
|
track('ConversationalAgent.Conversations.CreateAttachment')
|
|
6345
6373
|
], ConversationService.prototype, "getAttachmentUploadUri", null);
|
|
6374
|
+
__decorate([
|
|
6375
|
+
track('ConversationalAgent.Conversations.Disconnect')
|
|
6376
|
+
], ConversationService.prototype, "disconnect", null);
|
|
6346
6377
|
|
|
6347
6378
|
/**
|
|
6348
6379
|
* MessageService - Message operations for Conversations
|
package/dist/core/index.cjs
CHANGED
|
@@ -4366,6 +4366,21 @@ function getErrorDetails(error) {
|
|
|
4366
4366
|
};
|
|
4367
4367
|
}
|
|
4368
4368
|
|
|
4369
|
+
var TaskUserType;
|
|
4370
|
+
(function (TaskUserType) {
|
|
4371
|
+
/** A user of this type is supposed to be used by a human. */
|
|
4372
|
+
TaskUserType["User"] = "User";
|
|
4373
|
+
/** A user of this type is automatically created when adding a robot, is associated with Robot role and it is used by a robot when communicating with Orchestrator. */
|
|
4374
|
+
TaskUserType["Robot"] = "Robot";
|
|
4375
|
+
/** A user of type Directory User */
|
|
4376
|
+
TaskUserType["DirectoryUser"] = "DirectoryUser";
|
|
4377
|
+
/** A user of type Directory Group */
|
|
4378
|
+
TaskUserType["DirectoryGroup"] = "DirectoryGroup";
|
|
4379
|
+
/** A user of type Directory Robot Account */
|
|
4380
|
+
TaskUserType["DirectoryRobot"] = "DirectoryRobot";
|
|
4381
|
+
/** A user of type Directory External Application */
|
|
4382
|
+
TaskUserType["DirectoryExternalApplication"] = "DirectoryExternalApplication";
|
|
4383
|
+
})(TaskUserType || (TaskUserType = {}));
|
|
4369
4384
|
/**
|
|
4370
4385
|
* Types of tasks available in Action Center.
|
|
4371
4386
|
* Each type determines the task's behavior, UI rendering, and completion requirements.
|
|
@@ -5280,7 +5295,7 @@ function normalizeBaseUrl(url) {
|
|
|
5280
5295
|
// Connection string placeholder that will be replaced during build
|
|
5281
5296
|
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";
|
|
5282
5297
|
// SDK Version placeholder
|
|
5283
|
-
const SDK_VERSION = "1.3.
|
|
5298
|
+
const SDK_VERSION = "1.3.4";
|
|
5284
5299
|
const VERSION = "Version";
|
|
5285
5300
|
const SERVICE = "Service";
|
|
5286
5301
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/core/index.d.ts
CHANGED
|
@@ -519,7 +519,7 @@ declare const telemetryClient: TelemetryClient;
|
|
|
519
519
|
* SDK Telemetry constants
|
|
520
520
|
*/
|
|
521
521
|
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";
|
|
522
|
-
declare const SDK_VERSION = "1.3.
|
|
522
|
+
declare const SDK_VERSION = "1.3.4";
|
|
523
523
|
declare const VERSION = "Version";
|
|
524
524
|
declare const SERVICE = "Service";
|
|
525
525
|
declare const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/core/index.mjs
CHANGED
|
@@ -4364,6 +4364,21 @@ function getErrorDetails(error) {
|
|
|
4364
4364
|
};
|
|
4365
4365
|
}
|
|
4366
4366
|
|
|
4367
|
+
var TaskUserType;
|
|
4368
|
+
(function (TaskUserType) {
|
|
4369
|
+
/** A user of this type is supposed to be used by a human. */
|
|
4370
|
+
TaskUserType["User"] = "User";
|
|
4371
|
+
/** A user of this type is automatically created when adding a robot, is associated with Robot role and it is used by a robot when communicating with Orchestrator. */
|
|
4372
|
+
TaskUserType["Robot"] = "Robot";
|
|
4373
|
+
/** A user of type Directory User */
|
|
4374
|
+
TaskUserType["DirectoryUser"] = "DirectoryUser";
|
|
4375
|
+
/** A user of type Directory Group */
|
|
4376
|
+
TaskUserType["DirectoryGroup"] = "DirectoryGroup";
|
|
4377
|
+
/** A user of type Directory Robot Account */
|
|
4378
|
+
TaskUserType["DirectoryRobot"] = "DirectoryRobot";
|
|
4379
|
+
/** A user of type Directory External Application */
|
|
4380
|
+
TaskUserType["DirectoryExternalApplication"] = "DirectoryExternalApplication";
|
|
4381
|
+
})(TaskUserType || (TaskUserType = {}));
|
|
4367
4382
|
/**
|
|
4368
4383
|
* Types of tasks available in Action Center.
|
|
4369
4384
|
* Each type determines the task's behavior, UI rendering, and completion requirements.
|
|
@@ -5278,7 +5293,7 @@ function normalizeBaseUrl(url) {
|
|
|
5278
5293
|
// Connection string placeholder that will be replaced during build
|
|
5279
5294
|
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";
|
|
5280
5295
|
// SDK Version placeholder
|
|
5281
|
-
const SDK_VERSION = "1.3.
|
|
5296
|
+
const SDK_VERSION = "1.3.4";
|
|
5282
5297
|
const VERSION = "Version";
|
|
5283
5298
|
const SERVICE = "Service";
|
|
5284
5299
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/entities/index.cjs
CHANGED
|
@@ -506,6 +506,8 @@ class ErrorFactory {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
509
|
+
const TRACEPARENT = 'traceparent';
|
|
510
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
509
511
|
/**
|
|
510
512
|
* Content type constants for HTTP requests/responses
|
|
511
513
|
*/
|
|
@@ -559,8 +561,13 @@ class ApiClient {
|
|
|
559
561
|
if (isFormData) {
|
|
560
562
|
delete defaultHeaders['Content-Type'];
|
|
561
563
|
}
|
|
564
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
565
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
566
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
562
567
|
const headers = {
|
|
563
568
|
...defaultHeaders,
|
|
569
|
+
[TRACEPARENT]: traceparentValue,
|
|
570
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
564
571
|
...options.headers
|
|
565
572
|
};
|
|
566
573
|
// Convert params to URLSearchParams
|
|
@@ -600,7 +607,11 @@ class ApiClient {
|
|
|
600
607
|
const text = await response.text();
|
|
601
608
|
return text;
|
|
602
609
|
}
|
|
603
|
-
|
|
610
|
+
const text = await response.text();
|
|
611
|
+
if (!text) {
|
|
612
|
+
return undefined;
|
|
613
|
+
}
|
|
614
|
+
return JSON.parse(text);
|
|
604
615
|
}
|
|
605
616
|
catch (error) {
|
|
606
617
|
// If it's already one of our errors, re-throw it
|
|
@@ -1253,8 +1264,9 @@ class PaginationHelpers {
|
|
|
1253
1264
|
});
|
|
1254
1265
|
}
|
|
1255
1266
|
// Extract and transform items from response
|
|
1256
|
-
|
|
1257
|
-
const
|
|
1267
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1268
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1269
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1258
1270
|
// Parse items - automatically handle JSON string responses
|
|
1259
1271
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1260
1272
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1505,7 +1517,7 @@ class BaseService {
|
|
|
1505
1517
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1506
1518
|
// Prepare request parameters based on pagination type
|
|
1507
1519
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1508
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1520
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1509
1521
|
if (method.toUpperCase() === 'POST') {
|
|
1510
1522
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1511
1523
|
options.body = {
|
|
@@ -1513,6 +1525,7 @@ class BaseService {
|
|
|
1513
1525
|
...options.params,
|
|
1514
1526
|
...requestParams
|
|
1515
1527
|
};
|
|
1528
|
+
options.params = undefined;
|
|
1516
1529
|
}
|
|
1517
1530
|
else {
|
|
1518
1531
|
// Merge pagination parameters with existing parameters
|
|
@@ -1553,7 +1566,6 @@ class BaseService {
|
|
|
1553
1566
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1554
1567
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1555
1568
|
}
|
|
1556
|
-
// Include total count for ODATA APIs
|
|
1557
1569
|
{
|
|
1558
1570
|
requestParams[countParam] = true;
|
|
1559
1571
|
}
|
|
@@ -1581,8 +1593,9 @@ class BaseService {
|
|
|
1581
1593
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1582
1594
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1583
1595
|
// Extract items and metadata
|
|
1584
|
-
|
|
1585
|
-
const
|
|
1596
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1597
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1598
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1586
1599
|
const continuationToken = response.data[continuationTokenField];
|
|
1587
1600
|
// Determine if there are more pages
|
|
1588
1601
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1663,6 +1676,13 @@ function createEntityMethods(entityData, service) {
|
|
|
1663
1676
|
throw new Error('Entity ID is undefined');
|
|
1664
1677
|
return service.deleteRecordsById(entityData.id, recordIds, options);
|
|
1665
1678
|
},
|
|
1679
|
+
async deleteRecord(recordId) {
|
|
1680
|
+
if (!entityData.id)
|
|
1681
|
+
throw new Error('Entity ID is undefined');
|
|
1682
|
+
if (!recordId)
|
|
1683
|
+
throw new Error('Record ID is undefined');
|
|
1684
|
+
return service.deleteRecordById(entityData.id, recordId);
|
|
1685
|
+
},
|
|
1666
1686
|
async getAllRecords(options) {
|
|
1667
1687
|
if (!entityData.id)
|
|
1668
1688
|
throw new Error('Entity ID is undefined');
|
|
@@ -1857,6 +1877,7 @@ const DATA_FABRIC_ENDPOINTS = {
|
|
|
1857
1877
|
BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
|
|
1858
1878
|
UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
|
|
1859
1879
|
UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
|
|
1880
|
+
DELETE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete/${recordId}`,
|
|
1860
1881
|
DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
|
|
1861
1882
|
UPSERT: `${DATAFABRIC_BASE}/api/Entity`,
|
|
1862
1883
|
DELETE: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
|
|
@@ -1994,7 +2015,7 @@ const EntityFieldTypeMap = {
|
|
|
1994
2015
|
// Connection string placeholder that will be replaced during build
|
|
1995
2016
|
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";
|
|
1996
2017
|
// SDK Version placeholder
|
|
1997
|
-
const SDK_VERSION = "1.3.
|
|
2018
|
+
const SDK_VERSION = "1.3.4";
|
|
1998
2019
|
const VERSION = "Version";
|
|
1999
2020
|
const SERVICE = "Service";
|
|
2000
2021
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -2532,6 +2553,8 @@ class EntityService extends BaseService {
|
|
|
2532
2553
|
/**
|
|
2533
2554
|
* Deletes data from an entity by entity ID
|
|
2534
2555
|
*
|
|
2556
|
+
* Note: Records deleted using deleteRecordsById will not trigger Data Fabric trigger events. Use {@link deleteRecordById} if you need trigger events to fire for the deleted record.
|
|
2557
|
+
*
|
|
2535
2558
|
* @param entityId - UUID of the entity
|
|
2536
2559
|
* @param recordIds - Array of record UUIDs to delete
|
|
2537
2560
|
* @param options - Delete options
|
|
@@ -2559,6 +2582,27 @@ class EntityService extends BaseService {
|
|
|
2559
2582
|
});
|
|
2560
2583
|
return response.data;
|
|
2561
2584
|
}
|
|
2585
|
+
/**
|
|
2586
|
+
* Deletes a single record from an entity by entity ID and record ID
|
|
2587
|
+
*
|
|
2588
|
+
* Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
|
|
2589
|
+
* Use this method if you need trigger events to fire for the deleted record.
|
|
2590
|
+
*
|
|
2591
|
+
* @param entityId - UUID of the entity
|
|
2592
|
+
* @param recordId - UUID of the record to delete
|
|
2593
|
+
* @returns Promise resolving to void on success
|
|
2594
|
+
* @example
|
|
2595
|
+
* ```typescript
|
|
2596
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
2597
|
+
*
|
|
2598
|
+
* const entities = new Entities(sdk);
|
|
2599
|
+
*
|
|
2600
|
+
* await entities.deleteRecordById("<entityId>", "<recordId>");
|
|
2601
|
+
* ```
|
|
2602
|
+
*/
|
|
2603
|
+
async deleteRecordById(entityId, recordId) {
|
|
2604
|
+
await this.delete(DATA_FABRIC_ENDPOINTS.ENTITY.DELETE_RECORD_BY_ID(entityId, recordId));
|
|
2605
|
+
}
|
|
2562
2606
|
/**
|
|
2563
2607
|
* Gets all entities in the system
|
|
2564
2608
|
*
|
|
@@ -3111,6 +3155,9 @@ __decorate([
|
|
|
3111
3155
|
__decorate([
|
|
3112
3156
|
track('Entities.DeleteRecordsById')
|
|
3113
3157
|
], EntityService.prototype, "deleteRecordsById", null);
|
|
3158
|
+
__decorate([
|
|
3159
|
+
track('Entities.DeleteRecordById')
|
|
3160
|
+
], EntityService.prototype, "deleteRecordById", null);
|
|
3114
3161
|
__decorate([
|
|
3115
3162
|
track('Entities.GetAll')
|
|
3116
3163
|
], EntityService.prototype, "getAll", null);
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1122,6 +1122,8 @@ interface EntityServiceModel {
|
|
|
1122
1122
|
/**
|
|
1123
1123
|
* Deletes data from an entity by entity ID
|
|
1124
1124
|
*
|
|
1125
|
+
* Note: Records deleted using deleteRecordsById will not trigger Data Fabric trigger events. Use {@link deleteRecordById} if you need trigger events to fire for the deleted record.
|
|
1126
|
+
*
|
|
1125
1127
|
* @param id - UUID of the entity
|
|
1126
1128
|
* @param recordIds - Array of record UUIDs to delete
|
|
1127
1129
|
* @param options - Delete options
|
|
@@ -1136,6 +1138,25 @@ interface EntityServiceModel {
|
|
|
1136
1138
|
* ```
|
|
1137
1139
|
*/
|
|
1138
1140
|
deleteRecordsById(id: string, recordIds: string[], options?: EntityDeleteRecordsOptions): Promise<EntityDeleteResponse>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Deletes a single record from an entity by entity ID and record ID
|
|
1143
|
+
*
|
|
1144
|
+
* Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
|
|
1145
|
+
* Use this method if you need trigger events to fire for the deleted record.
|
|
1146
|
+
*
|
|
1147
|
+
* @param entityId - UUID of the entity
|
|
1148
|
+
* @param recordId - UUID of the record to delete
|
|
1149
|
+
* @returns Promise resolving to void on success
|
|
1150
|
+
* @example
|
|
1151
|
+
* ```typescript
|
|
1152
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
1153
|
+
*
|
|
1154
|
+
* const entities = new Entities(sdk);
|
|
1155
|
+
*
|
|
1156
|
+
* await entities.deleteRecordById("<entityId>", "<recordId>");
|
|
1157
|
+
* ```
|
|
1158
|
+
*/
|
|
1159
|
+
deleteRecordById(entityId: string, recordId: string): Promise<void>;
|
|
1139
1160
|
/**
|
|
1140
1161
|
* Queries entity records with filters, sorting, and SDK-managed pagination
|
|
1141
1162
|
*
|
|
@@ -1426,11 +1447,23 @@ interface EntityMethods {
|
|
|
1426
1447
|
/**
|
|
1427
1448
|
* Delete data from this entity
|
|
1428
1449
|
*
|
|
1450
|
+
* Note: Records deleted using deleteRecords will not trigger Data Fabric trigger events. Use {@link deleteRecord} if you need trigger events to fire for the deleted record.
|
|
1451
|
+
*
|
|
1429
1452
|
* @param recordIds - Array of record UUIDs to delete
|
|
1430
1453
|
* @param options - Delete options
|
|
1431
1454
|
* @returns Promise resolving to delete response
|
|
1432
1455
|
*/
|
|
1433
1456
|
deleteRecords(recordIds: string[], options?: EntityDeleteRecordsOptions): Promise<EntityDeleteResponse>;
|
|
1457
|
+
/**
|
|
1458
|
+
* Delete a single record from this entity
|
|
1459
|
+
*
|
|
1460
|
+
* Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
|
|
1461
|
+
* Use this method if you need trigger events to fire for the deleted record.
|
|
1462
|
+
*
|
|
1463
|
+
* @param recordId - UUID of the record to delete
|
|
1464
|
+
* @returns Promise resolving to void on success
|
|
1465
|
+
*/
|
|
1466
|
+
deleteRecord(recordId: string): Promise<void>;
|
|
1434
1467
|
/**
|
|
1435
1468
|
* Get all records from this entity
|
|
1436
1469
|
*
|
|
@@ -1764,6 +1797,8 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1764
1797
|
/**
|
|
1765
1798
|
* Deletes data from an entity by entity ID
|
|
1766
1799
|
*
|
|
1800
|
+
* Note: Records deleted using deleteRecordsById will not trigger Data Fabric trigger events. Use {@link deleteRecordById} if you need trigger events to fire for the deleted record.
|
|
1801
|
+
*
|
|
1767
1802
|
* @param entityId - UUID of the entity
|
|
1768
1803
|
* @param recordIds - Array of record UUIDs to delete
|
|
1769
1804
|
* @param options - Delete options
|
|
@@ -1782,6 +1817,25 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1782
1817
|
* ```
|
|
1783
1818
|
*/
|
|
1784
1819
|
deleteRecordsById(id: string, recordIds: string[], options?: EntityDeleteRecordsOptions): Promise<EntityDeleteResponse>;
|
|
1820
|
+
/**
|
|
1821
|
+
* Deletes a single record from an entity by entity ID and record ID
|
|
1822
|
+
*
|
|
1823
|
+
* Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
|
|
1824
|
+
* Use this method if you need trigger events to fire for the deleted record.
|
|
1825
|
+
*
|
|
1826
|
+
* @param entityId - UUID of the entity
|
|
1827
|
+
* @param recordId - UUID of the record to delete
|
|
1828
|
+
* @returns Promise resolving to void on success
|
|
1829
|
+
* @example
|
|
1830
|
+
* ```typescript
|
|
1831
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
1832
|
+
*
|
|
1833
|
+
* const entities = new Entities(sdk);
|
|
1834
|
+
*
|
|
1835
|
+
* await entities.deleteRecordById("<entityId>", "<recordId>");
|
|
1836
|
+
* ```
|
|
1837
|
+
*/
|
|
1838
|
+
deleteRecordById(entityId: string, recordId: string): Promise<void>;
|
|
1785
1839
|
/**
|
|
1786
1840
|
* Gets all entities in the system
|
|
1787
1841
|
*
|
package/dist/entities/index.mjs
CHANGED
|
@@ -504,6 +504,8 @@ class ErrorFactory {
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
507
|
+
const TRACEPARENT = 'traceparent';
|
|
508
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
507
509
|
/**
|
|
508
510
|
* Content type constants for HTTP requests/responses
|
|
509
511
|
*/
|
|
@@ -557,8 +559,13 @@ class ApiClient {
|
|
|
557
559
|
if (isFormData) {
|
|
558
560
|
delete defaultHeaders['Content-Type'];
|
|
559
561
|
}
|
|
562
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
563
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
564
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
560
565
|
const headers = {
|
|
561
566
|
...defaultHeaders,
|
|
567
|
+
[TRACEPARENT]: traceparentValue,
|
|
568
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
562
569
|
...options.headers
|
|
563
570
|
};
|
|
564
571
|
// Convert params to URLSearchParams
|
|
@@ -598,7 +605,11 @@ class ApiClient {
|
|
|
598
605
|
const text = await response.text();
|
|
599
606
|
return text;
|
|
600
607
|
}
|
|
601
|
-
|
|
608
|
+
const text = await response.text();
|
|
609
|
+
if (!text) {
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
return JSON.parse(text);
|
|
602
613
|
}
|
|
603
614
|
catch (error) {
|
|
604
615
|
// If it's already one of our errors, re-throw it
|
|
@@ -1251,8 +1262,9 @@ class PaginationHelpers {
|
|
|
1251
1262
|
});
|
|
1252
1263
|
}
|
|
1253
1264
|
// Extract and transform items from response
|
|
1254
|
-
|
|
1255
|
-
const
|
|
1265
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1266
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1267
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1256
1268
|
// Parse items - automatically handle JSON string responses
|
|
1257
1269
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1258
1270
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1503,7 +1515,7 @@ class BaseService {
|
|
|
1503
1515
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1504
1516
|
// Prepare request parameters based on pagination type
|
|
1505
1517
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1506
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1518
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1507
1519
|
if (method.toUpperCase() === 'POST') {
|
|
1508
1520
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1509
1521
|
options.body = {
|
|
@@ -1511,6 +1523,7 @@ class BaseService {
|
|
|
1511
1523
|
...options.params,
|
|
1512
1524
|
...requestParams
|
|
1513
1525
|
};
|
|
1526
|
+
options.params = undefined;
|
|
1514
1527
|
}
|
|
1515
1528
|
else {
|
|
1516
1529
|
// Merge pagination parameters with existing parameters
|
|
@@ -1551,7 +1564,6 @@ class BaseService {
|
|
|
1551
1564
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1552
1565
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1553
1566
|
}
|
|
1554
|
-
// Include total count for ODATA APIs
|
|
1555
1567
|
{
|
|
1556
1568
|
requestParams[countParam] = true;
|
|
1557
1569
|
}
|
|
@@ -1579,8 +1591,9 @@ class BaseService {
|
|
|
1579
1591
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1580
1592
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1581
1593
|
// Extract items and metadata
|
|
1582
|
-
|
|
1583
|
-
const
|
|
1594
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1595
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1596
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1584
1597
|
const continuationToken = response.data[continuationTokenField];
|
|
1585
1598
|
// Determine if there are more pages
|
|
1586
1599
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1661,6 +1674,13 @@ function createEntityMethods(entityData, service) {
|
|
|
1661
1674
|
throw new Error('Entity ID is undefined');
|
|
1662
1675
|
return service.deleteRecordsById(entityData.id, recordIds, options);
|
|
1663
1676
|
},
|
|
1677
|
+
async deleteRecord(recordId) {
|
|
1678
|
+
if (!entityData.id)
|
|
1679
|
+
throw new Error('Entity ID is undefined');
|
|
1680
|
+
if (!recordId)
|
|
1681
|
+
throw new Error('Record ID is undefined');
|
|
1682
|
+
return service.deleteRecordById(entityData.id, recordId);
|
|
1683
|
+
},
|
|
1664
1684
|
async getAllRecords(options) {
|
|
1665
1685
|
if (!entityData.id)
|
|
1666
1686
|
throw new Error('Entity ID is undefined');
|
|
@@ -1855,6 +1875,7 @@ const DATA_FABRIC_ENDPOINTS = {
|
|
|
1855
1875
|
BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
|
|
1856
1876
|
UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
|
|
1857
1877
|
UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
|
|
1878
|
+
DELETE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete/${recordId}`,
|
|
1858
1879
|
DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
|
|
1859
1880
|
UPSERT: `${DATAFABRIC_BASE}/api/Entity`,
|
|
1860
1881
|
DELETE: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
|
|
@@ -1992,7 +2013,7 @@ const EntityFieldTypeMap = {
|
|
|
1992
2013
|
// Connection string placeholder that will be replaced during build
|
|
1993
2014
|
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";
|
|
1994
2015
|
// SDK Version placeholder
|
|
1995
|
-
const SDK_VERSION = "1.3.
|
|
2016
|
+
const SDK_VERSION = "1.3.4";
|
|
1996
2017
|
const VERSION = "Version";
|
|
1997
2018
|
const SERVICE = "Service";
|
|
1998
2019
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -2530,6 +2551,8 @@ class EntityService extends BaseService {
|
|
|
2530
2551
|
/**
|
|
2531
2552
|
* Deletes data from an entity by entity ID
|
|
2532
2553
|
*
|
|
2554
|
+
* Note: Records deleted using deleteRecordsById will not trigger Data Fabric trigger events. Use {@link deleteRecordById} if you need trigger events to fire for the deleted record.
|
|
2555
|
+
*
|
|
2533
2556
|
* @param entityId - UUID of the entity
|
|
2534
2557
|
* @param recordIds - Array of record UUIDs to delete
|
|
2535
2558
|
* @param options - Delete options
|
|
@@ -2557,6 +2580,27 @@ class EntityService extends BaseService {
|
|
|
2557
2580
|
});
|
|
2558
2581
|
return response.data;
|
|
2559
2582
|
}
|
|
2583
|
+
/**
|
|
2584
|
+
* Deletes a single record from an entity by entity ID and record ID
|
|
2585
|
+
*
|
|
2586
|
+
* Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
|
|
2587
|
+
* Use this method if you need trigger events to fire for the deleted record.
|
|
2588
|
+
*
|
|
2589
|
+
* @param entityId - UUID of the entity
|
|
2590
|
+
* @param recordId - UUID of the record to delete
|
|
2591
|
+
* @returns Promise resolving to void on success
|
|
2592
|
+
* @example
|
|
2593
|
+
* ```typescript
|
|
2594
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
2595
|
+
*
|
|
2596
|
+
* const entities = new Entities(sdk);
|
|
2597
|
+
*
|
|
2598
|
+
* await entities.deleteRecordById("<entityId>", "<recordId>");
|
|
2599
|
+
* ```
|
|
2600
|
+
*/
|
|
2601
|
+
async deleteRecordById(entityId, recordId) {
|
|
2602
|
+
await this.delete(DATA_FABRIC_ENDPOINTS.ENTITY.DELETE_RECORD_BY_ID(entityId, recordId));
|
|
2603
|
+
}
|
|
2560
2604
|
/**
|
|
2561
2605
|
* Gets all entities in the system
|
|
2562
2606
|
*
|
|
@@ -3109,6 +3153,9 @@ __decorate([
|
|
|
3109
3153
|
__decorate([
|
|
3110
3154
|
track('Entities.DeleteRecordsById')
|
|
3111
3155
|
], EntityService.prototype, "deleteRecordsById", null);
|
|
3156
|
+
__decorate([
|
|
3157
|
+
track('Entities.DeleteRecordById')
|
|
3158
|
+
], EntityService.prototype, "deleteRecordById", null);
|
|
3112
3159
|
__decorate([
|
|
3113
3160
|
track('Entities.GetAll')
|
|
3114
3161
|
], EntityService.prototype, "getAll", null);
|