@uipath/uipath-typescript 1.3.7 → 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 +40 -5
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.mjs +40 -5
- package/dist/attachments/index.cjs +40 -5
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +40 -5
- package/dist/buckets/index.cjs +40 -5
- package/dist/buckets/index.d.ts +1 -0
- package/dist/buckets/index.mjs +40 -5
- package/dist/cases/index.cjs +178 -5
- package/dist/cases/index.d.ts +158 -3
- package/dist/cases/index.mjs +179 -6
- package/dist/conversational-agent/index.cjs +40 -5
- package/dist/conversational-agent/index.d.ts +1 -0
- package/dist/conversational-agent/index.mjs +40 -5
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +40 -5
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.mjs +40 -5
- package/dist/feedback/index.cjs +291 -9
- package/dist/feedback/index.d.ts +418 -12
- package/dist/feedback/index.mjs +291 -9
- package/dist/index.cjs +178 -5
- package/dist/index.d.ts +413 -10
- package/dist/index.mjs +179 -6
- package/dist/index.umd.js +178 -5
- package/dist/jobs/index.cjs +40 -5
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +40 -5
- package/dist/maestro-processes/index.cjs +77 -5
- package/dist/maestro-processes/index.d.ts +1 -0
- package/dist/maestro-processes/index.mjs +77 -5
- package/dist/processes/index.cjs +40 -5
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +40 -5
- package/dist/queues/index.cjs +40 -5
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +40 -5
- package/dist/tasks/index.cjs +40 -5
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.mjs +40 -5
- package/package.json +1 -1
package/dist/cases/index.mjs
CHANGED
|
@@ -662,6 +662,27 @@ var PaginationType;
|
|
|
662
662
|
/**
|
|
663
663
|
* Collection of utility functions for working with objects
|
|
664
664
|
*/
|
|
665
|
+
/**
|
|
666
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
667
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
668
|
+
* Direct key match takes priority over nested traversal.
|
|
669
|
+
*/
|
|
670
|
+
function resolveNestedField(data, fieldPath) {
|
|
671
|
+
if (!data) {
|
|
672
|
+
return undefined;
|
|
673
|
+
}
|
|
674
|
+
if (fieldPath in data) {
|
|
675
|
+
return data[fieldPath];
|
|
676
|
+
}
|
|
677
|
+
if (!fieldPath.includes('.')) {
|
|
678
|
+
return undefined;
|
|
679
|
+
}
|
|
680
|
+
let value = data;
|
|
681
|
+
for (const part of fieldPath.split('.')) {
|
|
682
|
+
value = value?.[part];
|
|
683
|
+
}
|
|
684
|
+
return value;
|
|
685
|
+
}
|
|
665
686
|
/**
|
|
666
687
|
* Filters out undefined values from an object
|
|
667
688
|
* @param obj The source object
|
|
@@ -900,6 +921,26 @@ const ODATA_PAGINATION = {
|
|
|
900
921
|
/** Default field name for total count in a paginated OData response */
|
|
901
922
|
TOTAL_COUNT_FIELD: '@odata.count'
|
|
902
923
|
};
|
|
924
|
+
/**
|
|
925
|
+
* SLA Summary pagination constants for page-number-based pagination
|
|
926
|
+
*/
|
|
927
|
+
const SLA_SUMMARY_PAGINATION = {
|
|
928
|
+
/** Field name for items in SLA summary response */
|
|
929
|
+
ITEMS_FIELD: 'data',
|
|
930
|
+
/** Dot-notation path for total count in nested pagination object */
|
|
931
|
+
TOTAL_COUNT_FIELD: 'pagination.totalCount'
|
|
932
|
+
};
|
|
933
|
+
/**
|
|
934
|
+
* SLA Summary OFFSET pagination parameter names (page-number style, no skip conversion)
|
|
935
|
+
*/
|
|
936
|
+
const SLA_SUMMARY_OFFSET_PARAMS = {
|
|
937
|
+
/** Page size parameter name */
|
|
938
|
+
PAGE_SIZE_PARAM: 'PageSize',
|
|
939
|
+
/** Page number parameter name (sent directly, not converted to skip) */
|
|
940
|
+
OFFSET_PARAM: 'PageNumber',
|
|
941
|
+
/** No count param needed */
|
|
942
|
+
COUNT_PARAM: undefined
|
|
943
|
+
};
|
|
903
944
|
/**
|
|
904
945
|
* Process Instance pagination constants for token-based pagination
|
|
905
946
|
*/
|
|
@@ -939,6 +980,14 @@ const PROCESS_INSTANCE_TOKEN_PARAMS = {
|
|
|
939
980
|
TOKEN_PARAM: 'nextPage'
|
|
940
981
|
};
|
|
941
982
|
|
|
983
|
+
/**
|
|
984
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
985
|
+
* Returns the original value if parsing fails.
|
|
986
|
+
*/
|
|
987
|
+
function toISOUtc(value) {
|
|
988
|
+
const date = new Date(value + ' UTC');
|
|
989
|
+
return isNaN(date.getTime()) ? value : date.toISOString();
|
|
990
|
+
}
|
|
942
991
|
/**
|
|
943
992
|
* Transforms data by mapping fields according to the provided field mapping
|
|
944
993
|
* @param data The source data to transform
|
|
@@ -1398,7 +1447,8 @@ class PaginationHelpers {
|
|
|
1398
1447
|
// Extract and transform items from response
|
|
1399
1448
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1400
1449
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1401
|
-
const
|
|
1450
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1451
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1402
1452
|
// Parse items - automatically handle JSON string responses
|
|
1403
1453
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1404
1454
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1695,9 +1745,17 @@ class BaseService {
|
|
|
1695
1745
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1696
1746
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1697
1747
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1748
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1749
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1750
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1698
1751
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1699
|
-
if (
|
|
1700
|
-
|
|
1752
|
+
if (convertToSkip) {
|
|
1753
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1754
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
else {
|
|
1758
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1701
1759
|
}
|
|
1702
1760
|
{
|
|
1703
1761
|
requestParams[countParam] = true;
|
|
@@ -1728,7 +1786,8 @@ class BaseService {
|
|
|
1728
1786
|
// Extract items and metadata
|
|
1729
1787
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1730
1788
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1731
|
-
const
|
|
1789
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1790
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1732
1791
|
const continuationToken = response.data[continuationTokenField];
|
|
1733
1792
|
// Determine if there are more pages
|
|
1734
1793
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1778,6 +1837,7 @@ _BaseService_apiClient = new WeakMap();
|
|
|
1778
1837
|
*/
|
|
1779
1838
|
const ORCHESTRATOR_BASE = 'orchestrator_';
|
|
1780
1839
|
const PIMS_BASE = 'pims_';
|
|
1840
|
+
const INSIGHTS_RTM_BASE = 'insightsrtm_';
|
|
1781
1841
|
|
|
1782
1842
|
/**
|
|
1783
1843
|
* Orchestrator Service Endpoints
|
|
@@ -1833,6 +1893,10 @@ const MAESTRO_ENDPOINTS = {
|
|
|
1833
1893
|
GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
|
|
1834
1894
|
REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
|
|
1835
1895
|
},
|
|
1896
|
+
INSIGHTS: {
|
|
1897
|
+
/** SLA summary for case instances */
|
|
1898
|
+
SLA_SUMMARY: `${INSIGHTS_RTM_BASE}/caseManagement/slaSummary`,
|
|
1899
|
+
},
|
|
1836
1900
|
};
|
|
1837
1901
|
|
|
1838
1902
|
/**
|
|
@@ -1841,7 +1905,7 @@ const MAESTRO_ENDPOINTS = {
|
|
|
1841
1905
|
// Connection string placeholder that will be replaced during build
|
|
1842
1906
|
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";
|
|
1843
1907
|
// SDK Version placeholder
|
|
1844
|
-
const SDK_VERSION = "1.3.
|
|
1908
|
+
const SDK_VERSION = "1.3.8";
|
|
1845
1909
|
const VERSION = "Version";
|
|
1846
1910
|
const SERVICE = "Service";
|
|
1847
1911
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -2242,6 +2306,41 @@ var DebugMode;
|
|
|
2242
2306
|
* Case Instance Types
|
|
2243
2307
|
* Types and interfaces for Maestro case instance management
|
|
2244
2308
|
*/
|
|
2309
|
+
/**
|
|
2310
|
+
* SLA status for a case instance
|
|
2311
|
+
*/
|
|
2312
|
+
var SlaSummaryStatus;
|
|
2313
|
+
(function (SlaSummaryStatus) {
|
|
2314
|
+
/** Case is within SLA deadline */
|
|
2315
|
+
SlaSummaryStatus["ON_TRACK"] = "On Track";
|
|
2316
|
+
/** Case is approaching SLA deadline based on at-risk percentage threshold */
|
|
2317
|
+
SlaSummaryStatus["AT_RISK"] = "At Risk";
|
|
2318
|
+
/** Case has exceeded SLA deadline */
|
|
2319
|
+
SlaSummaryStatus["OVERDUE"] = "Overdue";
|
|
2320
|
+
/** Case instance has completed */
|
|
2321
|
+
SlaSummaryStatus["COMPLETED"] = "Completed";
|
|
2322
|
+
/** SLA status cannot be determined (no SLA deadline defined) */
|
|
2323
|
+
SlaSummaryStatus["UNKNOWN"] = "Unknown";
|
|
2324
|
+
})(SlaSummaryStatus || (SlaSummaryStatus = {}));
|
|
2325
|
+
/**
|
|
2326
|
+
* Instance status values for case instances and process instances
|
|
2327
|
+
*/
|
|
2328
|
+
var InstanceStatus;
|
|
2329
|
+
(function (InstanceStatus) {
|
|
2330
|
+
/** Instance status not yet populated by the backend */
|
|
2331
|
+
InstanceStatus["UNKNOWN"] = "";
|
|
2332
|
+
InstanceStatus["CANCELLED"] = "Cancelled";
|
|
2333
|
+
InstanceStatus["CANCELING"] = "Canceling";
|
|
2334
|
+
InstanceStatus["COMPLETED"] = "Completed";
|
|
2335
|
+
InstanceStatus["FAULTED"] = "Faulted";
|
|
2336
|
+
InstanceStatus["PAUSED"] = "Paused";
|
|
2337
|
+
InstanceStatus["PAUSING"] = "Pausing";
|
|
2338
|
+
InstanceStatus["PENDING"] = "Pending";
|
|
2339
|
+
InstanceStatus["RESUMING"] = "Resuming";
|
|
2340
|
+
InstanceStatus["RETRYING"] = "Retrying";
|
|
2341
|
+
InstanceStatus["RUNNING"] = "Running";
|
|
2342
|
+
InstanceStatus["UPGRADING"] = "Upgrading";
|
|
2343
|
+
})(InstanceStatus || (InstanceStatus = {}));
|
|
2245
2344
|
/**
|
|
2246
2345
|
* Case stage task type
|
|
2247
2346
|
*/
|
|
@@ -2276,6 +2375,8 @@ var EscalationTriggerType;
|
|
|
2276
2375
|
(function (EscalationTriggerType) {
|
|
2277
2376
|
EscalationTriggerType["SLA_BREACHED"] = "sla-breached";
|
|
2278
2377
|
EscalationTriggerType["AT_RISK"] = "at-risk";
|
|
2378
|
+
/** Default value when no escalation rule is defined */
|
|
2379
|
+
EscalationTriggerType["NONE"] = "None";
|
|
2279
2380
|
})(EscalationTriggerType || (EscalationTriggerType = {}));
|
|
2280
2381
|
/**
|
|
2281
2382
|
* SLA duration unit
|
|
@@ -2343,6 +2444,11 @@ function createCaseInstanceMethods(instanceData, service) {
|
|
|
2343
2444
|
if (!instanceData.instanceId)
|
|
2344
2445
|
throw new Error('Case instance ID is undefined');
|
|
2345
2446
|
return service.getActionTasks(instanceData.instanceId, options);
|
|
2447
|
+
},
|
|
2448
|
+
async getSlaSummary(options) {
|
|
2449
|
+
if (!instanceData.instanceId)
|
|
2450
|
+
throw new Error('Case instance ID is undefined');
|
|
2451
|
+
return service.getSlaSummary({ ...options, caseInstanceId: instanceData.instanceId });
|
|
2346
2452
|
}
|
|
2347
2453
|
};
|
|
2348
2454
|
}
|
|
@@ -3508,6 +3614,70 @@ class CaseInstancesService extends BaseService {
|
|
|
3508
3614
|
};
|
|
3509
3615
|
return await this.taskService.getAll(enhancedOptions);
|
|
3510
3616
|
}
|
|
3617
|
+
/**
|
|
3618
|
+
* Get SLA summary for all case instances across folders.
|
|
3619
|
+
*
|
|
3620
|
+
* Returns SLA status, due times, escalation info, and instance metadata for each case instance.
|
|
3621
|
+
* The default page size is 50, so only the top 50 items are returned when no pagination options are provided.
|
|
3622
|
+
*
|
|
3623
|
+
* @param options - Optional filtering and pagination options
|
|
3624
|
+
* @returns Promise resolving to {@link SlaSummaryResponse}, paginated or non-paginated based on options
|
|
3625
|
+
* @example
|
|
3626
|
+
* ```typescript
|
|
3627
|
+
* // Non-paginated (returns top 50 items by default)
|
|
3628
|
+
* const summary = await caseInstances.getSlaSummary();
|
|
3629
|
+
* console.log(`Found ${summary.totalCount} cases`);
|
|
3630
|
+
*
|
|
3631
|
+
* // Filter by case instance ID
|
|
3632
|
+
* const filtered = await caseInstances.getSlaSummary({
|
|
3633
|
+
* caseInstanceId: '<caseInstanceId>'
|
|
3634
|
+
* });
|
|
3635
|
+
*
|
|
3636
|
+
* // Filter by time range
|
|
3637
|
+
* const timeFiltered = await caseInstances.getSlaSummary({
|
|
3638
|
+
* startTimeUtc: new Date('2026-01-01'),
|
|
3639
|
+
* endTimeUtc: new Date('2026-01-31')
|
|
3640
|
+
* });
|
|
3641
|
+
*
|
|
3642
|
+
* // With pagination
|
|
3643
|
+
* const page1 = await caseInstances.getSlaSummary({ pageSize: 25 });
|
|
3644
|
+
* if (page1.hasNextPage) {
|
|
3645
|
+
* const page2 = await caseInstances.getSlaSummary({ cursor: page1.nextCursor });
|
|
3646
|
+
* }
|
|
3647
|
+
*
|
|
3648
|
+
* // Jump to specific page
|
|
3649
|
+
* const page3 = await caseInstances.getSlaSummary({ jumpToPage: 3, pageSize: 25 });
|
|
3650
|
+
* ```
|
|
3651
|
+
*/
|
|
3652
|
+
async getSlaSummary(options) {
|
|
3653
|
+
const apiOptions = options ? {
|
|
3654
|
+
...options,
|
|
3655
|
+
startTimeUtc: options.startTimeUtc?.toISOString(),
|
|
3656
|
+
endTimeUtc: options.endTimeUtc?.toISOString()
|
|
3657
|
+
} : undefined;
|
|
3658
|
+
return PaginationHelpers.getAll({
|
|
3659
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
3660
|
+
getEndpoint: () => MAESTRO_ENDPOINTS.INSIGHTS.SLA_SUMMARY,
|
|
3661
|
+
method: HTTP_METHODS.POST,
|
|
3662
|
+
excludeFromPrefix: ['caseInstanceId', 'startTimeUtc', 'endTimeUtc'],
|
|
3663
|
+
transformFn: (item) => ({
|
|
3664
|
+
...item,
|
|
3665
|
+
slaDueTime: toISOUtc(item.slaDueTime),
|
|
3666
|
+
lastModifiedTime: toISOUtc(item.lastModifiedTime)
|
|
3667
|
+
}),
|
|
3668
|
+
pagination: {
|
|
3669
|
+
paginationType: PaginationType.OFFSET,
|
|
3670
|
+
itemsField: SLA_SUMMARY_PAGINATION.ITEMS_FIELD,
|
|
3671
|
+
totalCountField: SLA_SUMMARY_PAGINATION.TOTAL_COUNT_FIELD,
|
|
3672
|
+
paginationParams: {
|
|
3673
|
+
pageSizeParam: SLA_SUMMARY_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
3674
|
+
offsetParam: SLA_SUMMARY_OFFSET_PARAMS.OFFSET_PARAM,
|
|
3675
|
+
countParam: SLA_SUMMARY_OFFSET_PARAMS.COUNT_PARAM,
|
|
3676
|
+
convertToSkip: false
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
}, apiOptions);
|
|
3680
|
+
}
|
|
3511
3681
|
}
|
|
3512
3682
|
__decorate([
|
|
3513
3683
|
track('CaseInstances.GetAll')
|
|
@@ -3536,5 +3706,8 @@ __decorate([
|
|
|
3536
3706
|
__decorate([
|
|
3537
3707
|
track('CaseInstances.GetActionTasks')
|
|
3538
3708
|
], CaseInstancesService.prototype, "getActionTasks", null);
|
|
3709
|
+
__decorate([
|
|
3710
|
+
track('CaseInstances.GetSlaSummary')
|
|
3711
|
+
], CaseInstancesService.prototype, "getSlaSummary", null);
|
|
3539
3712
|
|
|
3540
|
-
export { CaseInstancesService as CaseInstances, CaseInstancesService, CasesService as Cases, CasesService, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, SLADurationUnit, StageTaskType, createCaseInstanceWithMethods };
|
|
3713
|
+
export { CaseInstancesService as CaseInstances, CaseInstancesService, CasesService as Cases, CasesService, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, InstanceStatus, SLADurationUnit, SlaSummaryStatus, StageTaskType, createCaseInstanceWithMethods };
|
|
@@ -51,7 +51,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
51
51
|
// Connection string placeholder that will be replaced during build
|
|
52
52
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
53
53
|
// SDK Version placeholder
|
|
54
|
-
const SDK_VERSION = "1.3.
|
|
54
|
+
const SDK_VERSION = "1.3.8";
|
|
55
55
|
const VERSION = "Version";
|
|
56
56
|
const SERVICE = "Service";
|
|
57
57
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -956,6 +956,27 @@ var PaginationType;
|
|
|
956
956
|
/**
|
|
957
957
|
* Collection of utility functions for working with objects
|
|
958
958
|
*/
|
|
959
|
+
/**
|
|
960
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
961
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
962
|
+
* Direct key match takes priority over nested traversal.
|
|
963
|
+
*/
|
|
964
|
+
function resolveNestedField(data, fieldPath) {
|
|
965
|
+
if (!data) {
|
|
966
|
+
return undefined;
|
|
967
|
+
}
|
|
968
|
+
if (fieldPath in data) {
|
|
969
|
+
return data[fieldPath];
|
|
970
|
+
}
|
|
971
|
+
if (!fieldPath.includes('.')) {
|
|
972
|
+
return undefined;
|
|
973
|
+
}
|
|
974
|
+
let value = data;
|
|
975
|
+
for (const part of fieldPath.split('.')) {
|
|
976
|
+
value = value?.[part];
|
|
977
|
+
}
|
|
978
|
+
return value;
|
|
979
|
+
}
|
|
959
980
|
/**
|
|
960
981
|
* Filters out undefined values from an object
|
|
961
982
|
* @param obj The source object
|
|
@@ -1205,6 +1226,10 @@ const CONVERSATIONAL_TOKEN_PARAMS = {
|
|
|
1205
1226
|
TOKEN_PARAM: 'cursor'
|
|
1206
1227
|
};
|
|
1207
1228
|
|
|
1229
|
+
/**
|
|
1230
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
1231
|
+
* Returns the original value if parsing fails.
|
|
1232
|
+
*/
|
|
1208
1233
|
/**
|
|
1209
1234
|
* Transforms data by mapping fields according to the provided field mapping
|
|
1210
1235
|
* @param data The source data to transform
|
|
@@ -1574,7 +1599,8 @@ class PaginationHelpers {
|
|
|
1574
1599
|
// Extract and transform items from response
|
|
1575
1600
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1576
1601
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1577
|
-
const
|
|
1602
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1603
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1578
1604
|
// Parse items - automatically handle JSON string responses
|
|
1579
1605
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1580
1606
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1871,9 +1897,17 @@ class BaseService {
|
|
|
1871
1897
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1872
1898
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1873
1899
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1900
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1901
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1902
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1874
1903
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1875
|
-
if (
|
|
1876
|
-
|
|
1904
|
+
if (convertToSkip) {
|
|
1905
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1906
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
else {
|
|
1910
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1877
1911
|
}
|
|
1878
1912
|
{
|
|
1879
1913
|
requestParams[countParam] = true;
|
|
@@ -1904,7 +1938,8 @@ class BaseService {
|
|
|
1904
1938
|
// Extract items and metadata
|
|
1905
1939
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1906
1940
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1907
|
-
const
|
|
1941
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1942
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1908
1943
|
const continuationToken = response.data[continuationTokenField];
|
|
1909
1944
|
// Determine if there are more pages
|
|
1910
1945
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -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";
|
|
@@ -954,6 +954,27 @@ var PaginationType;
|
|
|
954
954
|
/**
|
|
955
955
|
* Collection of utility functions for working with objects
|
|
956
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
|
+
}
|
|
957
978
|
/**
|
|
958
979
|
* Filters out undefined values from an object
|
|
959
980
|
* @param obj The source object
|
|
@@ -1203,6 +1224,10 @@ const CONVERSATIONAL_TOKEN_PARAMS = {
|
|
|
1203
1224
|
TOKEN_PARAM: 'cursor'
|
|
1204
1225
|
};
|
|
1205
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
|
+
*/
|
|
1206
1231
|
/**
|
|
1207
1232
|
* Transforms data by mapping fields according to the provided field mapping
|
|
1208
1233
|
* @param data The source data to transform
|
|
@@ -1572,7 +1597,8 @@ class PaginationHelpers {
|
|
|
1572
1597
|
// Extract and transform items from response
|
|
1573
1598
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1574
1599
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1575
|
-
const
|
|
1600
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1601
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1576
1602
|
// Parse items - automatically handle JSON string responses
|
|
1577
1603
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1578
1604
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1869,9 +1895,17 @@ class BaseService {
|
|
|
1869
1895
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1870
1896
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1871
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;
|
|
1872
1901
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1873
|
-
if (
|
|
1874
|
-
|
|
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;
|
|
1875
1909
|
}
|
|
1876
1910
|
{
|
|
1877
1911
|
requestParams[countParam] = true;
|
|
@@ -1902,7 +1936,8 @@ class BaseService {
|
|
|
1902
1936
|
// Extract items and metadata
|
|
1903
1937
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1904
1938
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1905
|
-
const
|
|
1939
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1940
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1906
1941
|
const continuationToken = response.data[continuationTokenField];
|
|
1907
1942
|
// Determine if there are more pages
|
|
1908
1943
|
const hasMore = this.determineHasMorePages(paginationType, {
|
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";
|
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";
|
package/dist/core/index.mjs
CHANGED
|
@@ -5305,7 +5305,7 @@ function normalizeBaseUrl(url) {
|
|
|
5305
5305
|
// Connection string placeholder that will be replaced during build
|
|
5306
5306
|
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";
|
|
5307
5307
|
// SDK Version placeholder
|
|
5308
|
-
const SDK_VERSION = "1.3.
|
|
5308
|
+
const SDK_VERSION = "1.3.8";
|
|
5309
5309
|
const VERSION = "Version";
|
|
5310
5310
|
const SERVICE = "Service";
|
|
5311
5311
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/entities/index.cjs
CHANGED
|
@@ -651,6 +651,27 @@ var PaginationType;
|
|
|
651
651
|
/**
|
|
652
652
|
* Collection of utility functions for working with objects
|
|
653
653
|
*/
|
|
654
|
+
/**
|
|
655
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
656
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
657
|
+
* Direct key match takes priority over nested traversal.
|
|
658
|
+
*/
|
|
659
|
+
function resolveNestedField(data, fieldPath) {
|
|
660
|
+
if (!data) {
|
|
661
|
+
return undefined;
|
|
662
|
+
}
|
|
663
|
+
if (fieldPath in data) {
|
|
664
|
+
return data[fieldPath];
|
|
665
|
+
}
|
|
666
|
+
if (!fieldPath.includes('.')) {
|
|
667
|
+
return undefined;
|
|
668
|
+
}
|
|
669
|
+
let value = data;
|
|
670
|
+
for (const part of fieldPath.split('.')) {
|
|
671
|
+
value = value?.[part];
|
|
672
|
+
}
|
|
673
|
+
return value;
|
|
674
|
+
}
|
|
654
675
|
/**
|
|
655
676
|
* Filters out undefined values from an object
|
|
656
677
|
* @param obj The source object
|
|
@@ -912,6 +933,10 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
912
933
|
TOKEN_PARAM: 'continuationToken'
|
|
913
934
|
};
|
|
914
935
|
|
|
936
|
+
/**
|
|
937
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
938
|
+
* Returns the original value if parsing fails.
|
|
939
|
+
*/
|
|
915
940
|
/**
|
|
916
941
|
* Transforms data by mapping fields according to the provided field mapping
|
|
917
942
|
* @param data The source data to transform
|
|
@@ -1266,7 +1291,8 @@ class PaginationHelpers {
|
|
|
1266
1291
|
// Extract and transform items from response
|
|
1267
1292
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1268
1293
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1269
|
-
const
|
|
1294
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1295
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1270
1296
|
// Parse items - automatically handle JSON string responses
|
|
1271
1297
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1272
1298
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1563,9 +1589,17 @@ class BaseService {
|
|
|
1563
1589
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1564
1590
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1565
1591
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1592
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1593
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1594
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1566
1595
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1567
|
-
if (
|
|
1568
|
-
|
|
1596
|
+
if (convertToSkip) {
|
|
1597
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1598
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
else {
|
|
1602
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1569
1603
|
}
|
|
1570
1604
|
{
|
|
1571
1605
|
requestParams[countParam] = true;
|
|
@@ -1596,7 +1630,8 @@ class BaseService {
|
|
|
1596
1630
|
// Extract items and metadata
|
|
1597
1631
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1598
1632
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1599
|
-
const
|
|
1633
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1634
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1600
1635
|
const continuationToken = response.data[continuationTokenField];
|
|
1601
1636
|
// Determine if there are more pages
|
|
1602
1637
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -2105,7 +2140,7 @@ const EntityFieldTypeMap = {
|
|
|
2105
2140
|
// Connection string placeholder that will be replaced during build
|
|
2106
2141
|
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";
|
|
2107
2142
|
// SDK Version placeholder
|
|
2108
|
-
const SDK_VERSION = "1.3.
|
|
2143
|
+
const SDK_VERSION = "1.3.8";
|
|
2109
2144
|
const VERSION = "Version";
|
|
2110
2145
|
const SERVICE = "Service";
|
|
2111
2146
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|