@uipath/uipath-typescript 1.3.8 → 1.3.9
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 +25 -270
- package/dist/assets/index.mjs +25 -270
- package/dist/attachments/index.cjs +23 -267
- package/dist/attachments/index.mjs +23 -267
- package/dist/buckets/index.cjs +54 -270
- package/dist/buckets/index.d.ts +50 -1
- package/dist/buckets/index.mjs +54 -270
- package/dist/cases/index.cjs +408 -337
- package/dist/cases/index.d.ts +534 -2
- package/dist/cases/index.mjs +409 -338
- package/dist/conversational-agent/index.cjs +71 -281
- package/dist/conversational-agent/index.d.ts +62 -12
- package/dist/conversational-agent/index.mjs +71 -282
- 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 +25 -270
- package/dist/entities/index.mjs +25 -270
- package/dist/feedback/index.cjs +23 -268
- package/dist/feedback/index.mjs +23 -268
- package/dist/index.cjs +600 -293
- package/dist/index.d.ts +1603 -722
- package/dist/index.mjs +600 -279
- package/dist/index.umd.js +789 -158
- package/dist/jobs/index.cjs +25 -270
- package/dist/jobs/index.mjs +25 -270
- package/dist/maestro-processes/index.cjs +1751 -1720
- package/dist/maestro-processes/index.d.ts +430 -2
- package/dist/maestro-processes/index.mjs +1752 -1721
- package/dist/processes/index.cjs +25 -270
- package/dist/processes/index.mjs +25 -270
- package/dist/queues/index.cjs +25 -270
- package/dist/queues/index.mjs +25 -270
- package/dist/tasks/index.cjs +25 -270
- package/dist/tasks/index.mjs +25 -270
- package/package.json +8 -10
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var coreTelemetry = require('@uipath/core-telemetry');
|
|
4
4
|
|
|
5
5
|
/******************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
@@ -4590,6 +4590,16 @@ const MAESTRO_ENDPOINTS = {
|
|
|
4590
4590
|
INSIGHTS: {
|
|
4591
4591
|
/** SLA summary for case instances */
|
|
4592
4592
|
SLA_SUMMARY: `${INSIGHTS_RTM_BASE}/caseManagement/slaSummary`,
|
|
4593
|
+
/** Stages summary for case instances */
|
|
4594
|
+
STAGES_SUMMARY: `${INSIGHTS_RTM_BASE}/caseManagement/stages`,
|
|
4595
|
+
/** Top processes ranked by run count */
|
|
4596
|
+
TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
|
|
4597
|
+
/** Top processes ranked by failure count */
|
|
4598
|
+
TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
|
|
4599
|
+
/** Instance status aggregated by date for time-series charts */
|
|
4600
|
+
INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
|
|
4601
|
+
/** Top processes ranked by total duration */
|
|
4602
|
+
TOP_PROCESSES_BY_DURATION: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByDuration`,
|
|
4593
4603
|
},
|
|
4594
4604
|
};
|
|
4595
4605
|
|
|
@@ -5464,284 +5474,49 @@ function normalizeBaseUrl(url) {
|
|
|
5464
5474
|
}
|
|
5465
5475
|
|
|
5466
5476
|
/**
|
|
5467
|
-
* SDK Telemetry constants
|
|
5468
|
-
*/
|
|
5469
|
-
// Connection string placeholder that will be replaced during build
|
|
5470
|
-
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";
|
|
5471
|
-
// SDK Version placeholder
|
|
5472
|
-
const SDK_VERSION = "1.3.8";
|
|
5473
|
-
const VERSION = "Version";
|
|
5474
|
-
const SERVICE = "Service";
|
|
5475
|
-
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
5476
|
-
const CLOUD_TENANT_NAME = "CloudTenantName";
|
|
5477
|
-
const CLOUD_URL = "CloudUrl";
|
|
5478
|
-
const CLOUD_CLIENT_ID = "CloudClientId";
|
|
5479
|
-
const CLOUD_REDIRECT_URI = "CloudRedirectUri";
|
|
5480
|
-
const APP_NAME = "ApplicationName";
|
|
5481
|
-
const CLOUD_ROLE_NAME = "uipath-ts-sdk";
|
|
5482
|
-
// Service and logger names
|
|
5483
|
-
const SDK_SERVICE_NAME = "UiPath.TypeScript.Sdk";
|
|
5484
|
-
const SDK_LOGGER_NAME = "uipath-ts-sdk-telemetry";
|
|
5485
|
-
// Event names
|
|
5486
|
-
const SDK_RUN_EVENT = "Sdk.Run";
|
|
5487
|
-
// Default value for unknown/empty attributes
|
|
5488
|
-
const UNKNOWN$1 = "";
|
|
5489
|
-
|
|
5490
|
-
/**
|
|
5491
|
-
* Log exporter that sends ALL logs as Application Insights custom events
|
|
5492
|
-
*/
|
|
5493
|
-
class ApplicationInsightsEventExporter {
|
|
5494
|
-
constructor(connectionString) {
|
|
5495
|
-
this.connectionString = connectionString;
|
|
5496
|
-
}
|
|
5497
|
-
export(logs, resultCallback) {
|
|
5498
|
-
try {
|
|
5499
|
-
logs.forEach(logRecord => {
|
|
5500
|
-
this.sendAsCustomEvent(logRecord);
|
|
5501
|
-
});
|
|
5502
|
-
resultCallback({ code: 0 });
|
|
5503
|
-
}
|
|
5504
|
-
catch (error) {
|
|
5505
|
-
console.debug('Failed to export logs to Application Insights:', error);
|
|
5506
|
-
resultCallback({ code: 2, error });
|
|
5507
|
-
}
|
|
5508
|
-
}
|
|
5509
|
-
shutdown() {
|
|
5510
|
-
return Promise.resolve();
|
|
5511
|
-
}
|
|
5512
|
-
sendAsCustomEvent(logRecord) {
|
|
5513
|
-
// Get event name from body or attributes
|
|
5514
|
-
const eventName = logRecord.body || SDK_RUN_EVENT;
|
|
5515
|
-
const payload = {
|
|
5516
|
-
name: 'Microsoft.ApplicationInsights.Event',
|
|
5517
|
-
time: new Date().toISOString(),
|
|
5518
|
-
iKey: this.extractInstrumentationKey(),
|
|
5519
|
-
data: {
|
|
5520
|
-
baseType: 'EventData',
|
|
5521
|
-
baseData: {
|
|
5522
|
-
ver: 2,
|
|
5523
|
-
name: eventName,
|
|
5524
|
-
properties: this.convertAttributesToProperties(logRecord.attributes || {})
|
|
5525
|
-
}
|
|
5526
|
-
},
|
|
5527
|
-
tags: {
|
|
5528
|
-
'ai.cloud.role': CLOUD_ROLE_NAME,
|
|
5529
|
-
'ai.cloud.roleInstance': SDK_VERSION
|
|
5530
|
-
}
|
|
5531
|
-
};
|
|
5532
|
-
this.sendToApplicationInsights(payload);
|
|
5533
|
-
}
|
|
5534
|
-
extractInstrumentationKey() {
|
|
5535
|
-
const match = this.connectionString.match(/InstrumentationKey=([^;]+)/);
|
|
5536
|
-
return match ? match[1] : '';
|
|
5537
|
-
}
|
|
5538
|
-
convertAttributesToProperties(attributes) {
|
|
5539
|
-
const properties = {};
|
|
5540
|
-
Object.entries(attributes || {}).forEach(([key, value]) => {
|
|
5541
|
-
properties[key] = String(value);
|
|
5542
|
-
});
|
|
5543
|
-
return properties;
|
|
5544
|
-
}
|
|
5545
|
-
async sendToApplicationInsights(payload) {
|
|
5546
|
-
try {
|
|
5547
|
-
const ingestionEndpoint = this.extractIngestionEndpoint();
|
|
5548
|
-
if (!ingestionEndpoint) {
|
|
5549
|
-
console.debug('No ingestion endpoint found in connection string');
|
|
5550
|
-
return;
|
|
5551
|
-
}
|
|
5552
|
-
const url = `${ingestionEndpoint}/v2/track`;
|
|
5553
|
-
const response = await fetch(url, {
|
|
5554
|
-
method: 'POST',
|
|
5555
|
-
headers: {
|
|
5556
|
-
'Content-Type': 'application/json',
|
|
5557
|
-
},
|
|
5558
|
-
body: JSON.stringify(payload)
|
|
5559
|
-
});
|
|
5560
|
-
if (!response.ok) {
|
|
5561
|
-
console.debug(`Failed to send event telemetry: ${response.status} ${response.statusText}`);
|
|
5562
|
-
}
|
|
5563
|
-
}
|
|
5564
|
-
catch (error) {
|
|
5565
|
-
console.debug('Error sending event telemetry to Application Insights:', error);
|
|
5566
|
-
}
|
|
5567
|
-
}
|
|
5568
|
-
extractIngestionEndpoint() {
|
|
5569
|
-
const match = this.connectionString.match(/IngestionEndpoint=([^;]+)/);
|
|
5570
|
-
return match ? match[1] : '';
|
|
5571
|
-
}
|
|
5572
|
-
}
|
|
5573
|
-
/**
|
|
5574
|
-
* Singleton telemetry client
|
|
5575
|
-
*/
|
|
5576
|
-
class TelemetryClient {
|
|
5577
|
-
constructor() {
|
|
5578
|
-
this.isInitialized = false;
|
|
5579
|
-
}
|
|
5580
|
-
static getInstance() {
|
|
5581
|
-
if (!TelemetryClient.instance) {
|
|
5582
|
-
TelemetryClient.instance = new TelemetryClient();
|
|
5583
|
-
}
|
|
5584
|
-
return TelemetryClient.instance;
|
|
5585
|
-
}
|
|
5586
|
-
/**
|
|
5587
|
-
* Initialize telemetry
|
|
5588
|
-
*/
|
|
5589
|
-
initialize(config) {
|
|
5590
|
-
if (this.isInitialized) {
|
|
5591
|
-
return;
|
|
5592
|
-
}
|
|
5593
|
-
this.isInitialized = true;
|
|
5594
|
-
if (config) {
|
|
5595
|
-
this.telemetryContext = config;
|
|
5596
|
-
}
|
|
5597
|
-
try {
|
|
5598
|
-
const connectionString = this.getConnectionString();
|
|
5599
|
-
if (!connectionString) {
|
|
5600
|
-
return;
|
|
5601
|
-
}
|
|
5602
|
-
this.setupTelemetryProvider(connectionString);
|
|
5603
|
-
}
|
|
5604
|
-
catch (error) {
|
|
5605
|
-
// Silent failure - telemetry errors shouldn't break functionality
|
|
5606
|
-
console.debug('Failed to initialize OpenTelemetry:', error);
|
|
5607
|
-
}
|
|
5608
|
-
}
|
|
5609
|
-
getConnectionString() {
|
|
5610
|
-
const connectionString = CONNECTION_STRING;
|
|
5611
|
-
return connectionString;
|
|
5612
|
-
}
|
|
5613
|
-
setupTelemetryProvider(connectionString) {
|
|
5614
|
-
const exporter = new ApplicationInsightsEventExporter(connectionString);
|
|
5615
|
-
const processor = new sdkLogs.BatchLogRecordProcessor(exporter);
|
|
5616
|
-
this.logProvider = new sdkLogs.LoggerProvider({
|
|
5617
|
-
processors: [processor]
|
|
5618
|
-
});
|
|
5619
|
-
this.logger = this.logProvider.getLogger(SDK_LOGGER_NAME);
|
|
5620
|
-
}
|
|
5621
|
-
/**
|
|
5622
|
-
* Track a telemetry event
|
|
5623
|
-
*/
|
|
5624
|
-
track(eventName, name, extraAttributes = {}) {
|
|
5625
|
-
try {
|
|
5626
|
-
// Skip if logger not initialized
|
|
5627
|
-
if (!this.logger) {
|
|
5628
|
-
return;
|
|
5629
|
-
}
|
|
5630
|
-
const finalDisplayName = name || eventName;
|
|
5631
|
-
const attributes = this.getEnrichedAttributes(extraAttributes, eventName);
|
|
5632
|
-
// Emit as log
|
|
5633
|
-
this.logger.emit({
|
|
5634
|
-
body: finalDisplayName,
|
|
5635
|
-
attributes: attributes,
|
|
5636
|
-
timestamp: Date.now(),
|
|
5637
|
-
});
|
|
5638
|
-
}
|
|
5639
|
-
catch (error) {
|
|
5640
|
-
// Silent failure
|
|
5641
|
-
console.debug('Failed to track telemetry event:', error);
|
|
5642
|
-
}
|
|
5643
|
-
}
|
|
5644
|
-
/**
|
|
5645
|
-
* Get enriched attributes for telemetry events
|
|
5646
|
-
*/
|
|
5647
|
-
getEnrichedAttributes(extraAttributes, eventName) {
|
|
5648
|
-
const attributes = {
|
|
5649
|
-
[APP_NAME]: SDK_SERVICE_NAME,
|
|
5650
|
-
[VERSION]: SDK_VERSION,
|
|
5651
|
-
[SERVICE]: eventName,
|
|
5652
|
-
[CLOUD_URL]: this.createCloudUrl(),
|
|
5653
|
-
[CLOUD_ORGANIZATION_NAME]: this.telemetryContext?.orgName || UNKNOWN$1,
|
|
5654
|
-
[CLOUD_TENANT_NAME]: this.telemetryContext?.tenantName || UNKNOWN$1,
|
|
5655
|
-
[CLOUD_REDIRECT_URI]: this.telemetryContext?.redirectUri || UNKNOWN$1,
|
|
5656
|
-
[CLOUD_CLIENT_ID]: this.telemetryContext?.clientId || UNKNOWN$1,
|
|
5657
|
-
...extraAttributes,
|
|
5658
|
-
};
|
|
5659
|
-
return attributes;
|
|
5660
|
-
}
|
|
5661
|
-
/**
|
|
5662
|
-
* Create cloud URL from base URL, organization ID, and tenant ID
|
|
5663
|
-
*/
|
|
5664
|
-
createCloudUrl() {
|
|
5665
|
-
const baseUrl = this.telemetryContext?.baseUrl;
|
|
5666
|
-
const orgId = this.telemetryContext?.orgName;
|
|
5667
|
-
const tenantId = this.telemetryContext?.tenantName;
|
|
5668
|
-
if (!baseUrl || !orgId || !tenantId) {
|
|
5669
|
-
return UNKNOWN$1;
|
|
5670
|
-
}
|
|
5671
|
-
return `${baseUrl}/${orgId}/${tenantId}`;
|
|
5672
|
-
}
|
|
5673
|
-
}
|
|
5674
|
-
// Export singleton instance
|
|
5675
|
-
const telemetryClient = TelemetryClient.getInstance();
|
|
5676
|
-
|
|
5677
|
-
/**
|
|
5678
|
-
* SDK Track decorator and function for telemetry
|
|
5679
|
-
*/
|
|
5680
|
-
/**
|
|
5681
|
-
* Common tracking logic shared between method and function decorators
|
|
5682
|
-
*/
|
|
5683
|
-
function createTrackedFunction(originalFunction, nameOrOptions, fallbackName, opts) {
|
|
5684
|
-
return function (...args) {
|
|
5685
|
-
// Determine if we should track this call
|
|
5686
|
-
let shouldTrack = true;
|
|
5687
|
-
if (opts.condition !== undefined) {
|
|
5688
|
-
if (typeof opts.condition === 'function') {
|
|
5689
|
-
shouldTrack = opts.condition.apply(this, args);
|
|
5690
|
-
}
|
|
5691
|
-
else {
|
|
5692
|
-
shouldTrack = opts.condition;
|
|
5693
|
-
}
|
|
5694
|
-
}
|
|
5695
|
-
// Track the event if enabled
|
|
5696
|
-
if (shouldTrack) {
|
|
5697
|
-
// Use the full name provided in the decorator (e.g., "Queue.GetAll")
|
|
5698
|
-
const serviceMethod = typeof nameOrOptions === 'string'
|
|
5699
|
-
? nameOrOptions
|
|
5700
|
-
: fallbackName;
|
|
5701
|
-
// Use 'Sdk.Run' as the name and serviceMethod as the service
|
|
5702
|
-
telemetryClient.track(serviceMethod, SDK_RUN_EVENT, opts.attributes);
|
|
5703
|
-
}
|
|
5704
|
-
// Execute the original function
|
|
5705
|
-
return originalFunction.apply(this, args);
|
|
5706
|
-
};
|
|
5707
|
-
}
|
|
5708
|
-
/**
|
|
5709
|
-
* Track decorator that can be used to automatically track function calls
|
|
5710
|
-
*
|
|
5711
|
-
* Usage:
|
|
5712
|
-
* @track("Service.Method")
|
|
5713
|
-
* function myFunction() { ... }
|
|
5714
|
-
*
|
|
5715
|
-
* @track("Queue.GetAll")
|
|
5716
|
-
* async getAll() { ... }
|
|
5717
|
-
*
|
|
5718
|
-
* @track("Tasks.Create")
|
|
5719
|
-
* async create() { ... }
|
|
5477
|
+
* SDK Telemetry constants.
|
|
5720
5478
|
*
|
|
5721
|
-
*
|
|
5722
|
-
*
|
|
5479
|
+
* Only the SDK's identity (version, service name, role name, …) lives
|
|
5480
|
+
* here. The Application Insights connection string is injected into
|
|
5481
|
+
* `@uipath/core-telemetry` itself at publish time, and the generic attribute
|
|
5482
|
+
* keys (`Version`, `Service`, `CloudOrganizationName`, …) are owned by
|
|
5483
|
+
* `@uipath/core-telemetry` and consumed there — they are not part of the
|
|
5484
|
+
* SDK's public API.
|
|
5485
|
+
*/
|
|
5486
|
+
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
5487
|
+
const SDK_VERSION = '1.3.9';
|
|
5488
|
+
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
5489
|
+
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
5490
|
+
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|
|
5491
|
+
const SDK_RUN_EVENT = 'Sdk.Run';
|
|
5492
|
+
|
|
5493
|
+
/**
|
|
5494
|
+
* UiPath TypeScript SDK Telemetry
|
|
5723
5495
|
*
|
|
5724
|
-
*
|
|
5725
|
-
*
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5496
|
+
* Constructs the SDK's own `TelemetryClient` and binds the SDK-local
|
|
5497
|
+
* `track` / `trackEvent` to it. Each consumer of `@uipath/core-telemetry`
|
|
5498
|
+
* does this independently, so events carry their own consumer's identity
|
|
5499
|
+
* and tenant context.
|
|
5500
|
+
*/
|
|
5501
|
+
// Keyed by `CLOUD_ROLE_NAME` so every SDK subpath bundle resolves to the
|
|
5502
|
+
// same `TelemetryClient` instance at runtime. A single `initialize(...)`
|
|
5503
|
+
// from the `UiPath` constructor therefore wires up `@track` decorators
|
|
5504
|
+
// across every subpath bundle (`assets`, `feedback`, `tasks`, …).
|
|
5505
|
+
const sdkClient = coreTelemetry.getOrCreateClient(CLOUD_ROLE_NAME);
|
|
5506
|
+
const track = coreTelemetry.createTrack(sdkClient);
|
|
5507
|
+
const trackEvent = coreTelemetry.createTrackEvent(sdkClient);
|
|
5508
|
+
const telemetryClient = {
|
|
5509
|
+
initialize(context) {
|
|
5510
|
+
sdkClient.initialize({
|
|
5511
|
+
sdkVersion: SDK_VERSION,
|
|
5512
|
+
serviceName: SDK_SERVICE_NAME,
|
|
5513
|
+
cloudRoleName: CLOUD_ROLE_NAME,
|
|
5514
|
+
loggerName: SDK_LOGGER_NAME,
|
|
5515
|
+
defaultEventName: SDK_RUN_EVENT,
|
|
5516
|
+
context,
|
|
5517
|
+
});
|
|
5518
|
+
},
|
|
5519
|
+
};
|
|
5745
5520
|
|
|
5746
5521
|
/**
|
|
5747
5522
|
* SDK Internals Registry - Internal registry for SDK instances
|
|
@@ -9328,6 +9103,53 @@ function createProcessWithMethods(processData, service) {
|
|
|
9328
9103
|
return Object.assign({}, processData, methods);
|
|
9329
9104
|
}
|
|
9330
9105
|
|
|
9106
|
+
/**
|
|
9107
|
+
* Builds the request body for Insights RTM "top" endpoints.
|
|
9108
|
+
*
|
|
9109
|
+
* @param startTime - Start of the time range to query
|
|
9110
|
+
* @param endTime - End of the time range to query
|
|
9111
|
+
* @param isCaseManagement - Whether to filter for case management processes
|
|
9112
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
9113
|
+
* @returns Request body for the Insights RTM endpoint
|
|
9114
|
+
* @internal
|
|
9115
|
+
*/
|
|
9116
|
+
function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
|
|
9117
|
+
return {
|
|
9118
|
+
commonParams: {
|
|
9119
|
+
startTime: startTime.getTime(),
|
|
9120
|
+
endTime: endTime.getTime(),
|
|
9121
|
+
isCaseManagement,
|
|
9122
|
+
...(options?.packageId ? { packageId: options.packageId } : {}),
|
|
9123
|
+
...(options?.processKey ? { processKey: options.processKey } : {}),
|
|
9124
|
+
...(options?.version ? { version: options.version } : {}),
|
|
9125
|
+
}
|
|
9126
|
+
};
|
|
9127
|
+
}
|
|
9128
|
+
/**
|
|
9129
|
+
* Fetches instance status timeline from the Insights API.
|
|
9130
|
+
* Shared implementation used by both MaestroProcessesService and CasesService.
|
|
9131
|
+
*
|
|
9132
|
+
* @param postFn - Bound post method from a BaseService subclass
|
|
9133
|
+
* @param startTime - Start of the time range to query
|
|
9134
|
+
* @param endTime - End of the time range to query
|
|
9135
|
+
* @param isCaseManagement - Whether to filter for case management processes
|
|
9136
|
+
* @param options - Optional settings for time bucketing granularity
|
|
9137
|
+
* @returns Promise resolving to an array of instance status timeline entries
|
|
9138
|
+
* @internal
|
|
9139
|
+
*/
|
|
9140
|
+
async function fetchInstanceStatusTimeline(postFn, startTime, endTime, isCaseManagement, options) {
|
|
9141
|
+
const response = await postFn(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, {
|
|
9142
|
+
commonParams: {
|
|
9143
|
+
startTime: startTime.getTime(),
|
|
9144
|
+
endTime: endTime.getTime(),
|
|
9145
|
+
isCaseManagement,
|
|
9146
|
+
},
|
|
9147
|
+
timeSliceUnit: options?.groupBy,
|
|
9148
|
+
timezoneOffset: new Date().getTimezoneOffset() * -1,
|
|
9149
|
+
});
|
|
9150
|
+
return response.data ?? [];
|
|
9151
|
+
}
|
|
9152
|
+
|
|
9331
9153
|
/**
|
|
9332
9154
|
* Maps fields for Incident entities
|
|
9333
9155
|
*/
|
|
@@ -9704,6 +9526,11 @@ function createCaseInstanceMethods(instanceData, service) {
|
|
|
9704
9526
|
if (!instanceData.instanceId)
|
|
9705
9527
|
throw new Error('Case instance ID is undefined');
|
|
9706
9528
|
return service.getSlaSummary({ ...options, caseInstanceId: instanceData.instanceId });
|
|
9529
|
+
},
|
|
9530
|
+
async getStagesSlaSummary() {
|
|
9531
|
+
if (!instanceData.instanceId)
|
|
9532
|
+
throw new Error('Case instance ID is undefined');
|
|
9533
|
+
return service.getStagesSlaSummary({ caseInstanceId: instanceData.instanceId });
|
|
9707
9534
|
}
|
|
9708
9535
|
};
|
|
9709
9536
|
}
|
|
@@ -9719,6 +9546,40 @@ function createCaseInstanceWithMethods(instanceData, service) {
|
|
|
9719
9546
|
return Object.assign({}, instanceData, methods);
|
|
9720
9547
|
}
|
|
9721
9548
|
|
|
9549
|
+
/**
|
|
9550
|
+
* Insights Types
|
|
9551
|
+
* Shared types for Maestro insights analytics endpoints
|
|
9552
|
+
*/
|
|
9553
|
+
/**
|
|
9554
|
+
* Time bucketing granularity for insights time-series queries.
|
|
9555
|
+
*
|
|
9556
|
+
* Controls how data points are grouped on the time axis.
|
|
9557
|
+
*/
|
|
9558
|
+
exports.TimeInterval = void 0;
|
|
9559
|
+
(function (TimeInterval) {
|
|
9560
|
+
/** Group data points by hour */
|
|
9561
|
+
TimeInterval["Hour"] = "HOUR";
|
|
9562
|
+
/** Group data points by day */
|
|
9563
|
+
TimeInterval["Day"] = "DAY";
|
|
9564
|
+
/** Group data points by week */
|
|
9565
|
+
TimeInterval["Week"] = "WEEK";
|
|
9566
|
+
})(exports.TimeInterval || (exports.TimeInterval = {}));
|
|
9567
|
+
/**
|
|
9568
|
+
* Final instance statuses returned by the instance status timeline endpoint.
|
|
9569
|
+
*
|
|
9570
|
+
* Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
|
|
9571
|
+
* Active statuses like Running or Paused are not included.
|
|
9572
|
+
*/
|
|
9573
|
+
exports.InstanceFinalStatus = void 0;
|
|
9574
|
+
(function (InstanceFinalStatus) {
|
|
9575
|
+
/** Instance completed successfully */
|
|
9576
|
+
InstanceFinalStatus["Completed"] = "Completed";
|
|
9577
|
+
/** Instance encountered an error */
|
|
9578
|
+
InstanceFinalStatus["Faulted"] = "Faulted";
|
|
9579
|
+
/** Instance was cancelled */
|
|
9580
|
+
InstanceFinalStatus["Cancelled"] = "Cancelled";
|
|
9581
|
+
})(exports.InstanceFinalStatus || (exports.InstanceFinalStatus = {}));
|
|
9582
|
+
|
|
9722
9583
|
/**
|
|
9723
9584
|
* Maps fields for Process Instance entities to ensure consistent naming
|
|
9724
9585
|
*/
|
|
@@ -10094,6 +9955,177 @@ class MaestroProcessesService extends BaseService {
|
|
|
10094
9955
|
// Fetch BPMN XML and add element name/type to each incident
|
|
10095
9956
|
return BpmnHelpers.enrichIncidentsWithBpmnData(rawResponse.data || [], folderKey, this.processInstancesService);
|
|
10096
9957
|
}
|
|
9958
|
+
/**
|
|
9959
|
+
* Get the top 5 processes ranked by run count within a time range.
|
|
9960
|
+
*
|
|
9961
|
+
* Returns an array of up to 5 processes sorted by how many times they were executed,
|
|
9962
|
+
* useful for identifying the most active processes in a given period.
|
|
9963
|
+
*
|
|
9964
|
+
* @param startTime - Start of the time range to query
|
|
9965
|
+
* @param endTime - End of the time range to query
|
|
9966
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
9967
|
+
* @returns Promise resolving to an array of {@link ProcessGetTopRunCountResponse}
|
|
9968
|
+
* @example
|
|
9969
|
+
* ```typescript
|
|
9970
|
+
* import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
|
|
9971
|
+
*
|
|
9972
|
+
* const maestroProcesses = new MaestroProcesses(sdk);
|
|
9973
|
+
*
|
|
9974
|
+
* // Get top processes by run count for the last 7 days
|
|
9975
|
+
* const topProcesses = await maestroProcesses.getTopRunCount(
|
|
9976
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
9977
|
+
* new Date()
|
|
9978
|
+
* );
|
|
9979
|
+
*
|
|
9980
|
+
* for (const process of topProcesses) {
|
|
9981
|
+
* console.log(`${process.packageId}: ${process.runCount} runs`);
|
|
9982
|
+
* }
|
|
9983
|
+
* ```
|
|
9984
|
+
*
|
|
9985
|
+
* @example
|
|
9986
|
+
* ```typescript
|
|
9987
|
+
* // Get top processes by run count for a specific package
|
|
9988
|
+
* const filtered = await maestroProcesses.getTopRunCount(
|
|
9989
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
9990
|
+
* new Date(),
|
|
9991
|
+
* { packageId: '<packageId>' }
|
|
9992
|
+
* );
|
|
9993
|
+
* ```
|
|
9994
|
+
*/
|
|
9995
|
+
async getTopRunCount(startTime, endTime, options) {
|
|
9996
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
|
|
9997
|
+
return (data ?? []).map(process => ({ ...process, name: process.packageId }));
|
|
9998
|
+
}
|
|
9999
|
+
/**
|
|
10000
|
+
* Get all instances status counts aggregated by date for maestro processes.
|
|
10001
|
+
*
|
|
10002
|
+
* Returns time-grouped counts of instances grouped by status (Completed, Faulted, Cancelled),
|
|
10003
|
+
* useful for rendering time-series charts. Use `groupBy` to control the time bucket size
|
|
10004
|
+
* (hour, day, or week) — defaults to day if not provided.
|
|
10005
|
+
*
|
|
10006
|
+
* @param startTime - Start of the time range to query
|
|
10007
|
+
* @param endTime - End of the time range to query
|
|
10008
|
+
* @param options - Optional settings for time bucketing granularity
|
|
10009
|
+
* @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
|
|
10010
|
+
*
|
|
10011
|
+
* @example
|
|
10012
|
+
* ```typescript
|
|
10013
|
+
* // Get daily instance status for the last 7 days
|
|
10014
|
+
* const now = new Date();
|
|
10015
|
+
* const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
|
10016
|
+
* const statuses = await maestroProcesses.getInstanceStatusTimeline(sevenDaysAgo, now);
|
|
10017
|
+
*
|
|
10018
|
+
* for (const entry of statuses) {
|
|
10019
|
+
* console.log(`${entry.startTime} — ${entry.status}: ${entry.count}`);
|
|
10020
|
+
* }
|
|
10021
|
+
* ```
|
|
10022
|
+
*
|
|
10023
|
+
* @example
|
|
10024
|
+
* ```typescript
|
|
10025
|
+
* import { TimeInterval } from '@uipath/uipath-typescript/maestro-processes';
|
|
10026
|
+
*
|
|
10027
|
+
* // Get hourly breakdown
|
|
10028
|
+
* const statuses = await maestroProcesses.getInstanceStatusTimeline(startTime, endTime, {
|
|
10029
|
+
* groupBy: TimeInterval.Hour,
|
|
10030
|
+
* });
|
|
10031
|
+
* ```
|
|
10032
|
+
*
|
|
10033
|
+
* @example
|
|
10034
|
+
* ```typescript
|
|
10035
|
+
* // Get all-time data (from Unix epoch to now)
|
|
10036
|
+
* const allTime = await maestroProcesses.getInstanceStatusTimeline(new Date(0), new Date());
|
|
10037
|
+
* ```
|
|
10038
|
+
*/
|
|
10039
|
+
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
10040
|
+
return fetchInstanceStatusTimeline(this.post.bind(this), startTime, endTime, false, options);
|
|
10041
|
+
}
|
|
10042
|
+
/**
|
|
10043
|
+
* Get the top 10 processes ranked by failure count within a time range.
|
|
10044
|
+
*
|
|
10045
|
+
* Returns an array of up to 10 processes sorted by how many instances faulted,
|
|
10046
|
+
* useful for identifying the most error-prone processes in a given period.
|
|
10047
|
+
*
|
|
10048
|
+
* @param startTime - Start of the time range to query
|
|
10049
|
+
* @param endTime - End of the time range to query
|
|
10050
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
10051
|
+
* @returns Promise resolving to an array of {@link ProcessGetTopFaultedCountResponse}
|
|
10052
|
+
* @example
|
|
10053
|
+
* ```typescript
|
|
10054
|
+
* import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
|
|
10055
|
+
*
|
|
10056
|
+
* const maestroProcesses = new MaestroProcesses(sdk);
|
|
10057
|
+
*
|
|
10058
|
+
* // Get top processes by faulted count for the last 7 days
|
|
10059
|
+
* const topFailing = await maestroProcesses.getTopFaultedCount(
|
|
10060
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10061
|
+
* new Date()
|
|
10062
|
+
* );
|
|
10063
|
+
*
|
|
10064
|
+
* for (const process of topFailing) {
|
|
10065
|
+
* console.log(`${process.packageId}: ${process.faultedCount} failures`);
|
|
10066
|
+
* }
|
|
10067
|
+
* ```
|
|
10068
|
+
*
|
|
10069
|
+
* @example
|
|
10070
|
+
* ```typescript
|
|
10071
|
+
* // Get top processes by faulted count for a specific package
|
|
10072
|
+
* const filtered = await maestroProcesses.getTopFaultedCount(
|
|
10073
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10074
|
+
* new Date(),
|
|
10075
|
+
* { packageId: '<packageId>' }
|
|
10076
|
+
* );
|
|
10077
|
+
* ```
|
|
10078
|
+
*/
|
|
10079
|
+
async getTopFaultedCount(startTime, endTime, options) {
|
|
10080
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
|
|
10081
|
+
return (data ?? []).map(item => ({
|
|
10082
|
+
packageId: item.packageId,
|
|
10083
|
+
processKey: item.processKey,
|
|
10084
|
+
faultedCount: item.runCount,
|
|
10085
|
+
name: item.packageId,
|
|
10086
|
+
}));
|
|
10087
|
+
}
|
|
10088
|
+
/**
|
|
10089
|
+
* Get the top 5 processes ranked by total duration within a time range.
|
|
10090
|
+
*
|
|
10091
|
+
* Returns an array of up to 5 processes sorted by their total execution time,
|
|
10092
|
+
* useful for identifying the longest-running processes in a given period.
|
|
10093
|
+
*
|
|
10094
|
+
* @param startTime - Start of the time range to query
|
|
10095
|
+
* @param endTime - End of the time range to query
|
|
10096
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
10097
|
+
* @returns Promise resolving to an array of {@link ProcessGetTopDurationResponse}
|
|
10098
|
+
* @example
|
|
10099
|
+
* ```typescript
|
|
10100
|
+
* import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
|
|
10101
|
+
*
|
|
10102
|
+
* const maestroProcesses = new MaestroProcesses(sdk);
|
|
10103
|
+
*
|
|
10104
|
+
* // Get top processes by duration for the last 7 days
|
|
10105
|
+
* const topProcesses = await maestroProcesses.getTopExecutionDuration(
|
|
10106
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10107
|
+
* new Date()
|
|
10108
|
+
* );
|
|
10109
|
+
*
|
|
10110
|
+
* for (const process of topProcesses) {
|
|
10111
|
+
* console.log(`${process.packageId}: ${process.duration}ms total`);
|
|
10112
|
+
* }
|
|
10113
|
+
* ```
|
|
10114
|
+
*
|
|
10115
|
+
* @example
|
|
10116
|
+
* ```typescript
|
|
10117
|
+
* // Get top processes by duration for a specific package
|
|
10118
|
+
* const filtered = await maestroProcesses.getTopExecutionDuration(
|
|
10119
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10120
|
+
* new Date(),
|
|
10121
|
+
* { packageId: '<packageId>' }
|
|
10122
|
+
* );
|
|
10123
|
+
* ```
|
|
10124
|
+
*/
|
|
10125
|
+
async getTopExecutionDuration(startTime, endTime, options) {
|
|
10126
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_DURATION, buildInsightsTopBody(startTime, endTime, false, options));
|
|
10127
|
+
return (data ?? []).map(process => ({ ...process, name: process.packageId }));
|
|
10128
|
+
}
|
|
10097
10129
|
}
|
|
10098
10130
|
__decorate([
|
|
10099
10131
|
track('MaestroProcesses.GetAll')
|
|
@@ -10101,6 +10133,18 @@ __decorate([
|
|
|
10101
10133
|
__decorate([
|
|
10102
10134
|
track('MaestroProcesses.GetIncidents')
|
|
10103
10135
|
], MaestroProcessesService.prototype, "getIncidents", null);
|
|
10136
|
+
__decorate([
|
|
10137
|
+
track('MaestroProcesses.GetTopRunCount')
|
|
10138
|
+
], MaestroProcessesService.prototype, "getTopRunCount", null);
|
|
10139
|
+
__decorate([
|
|
10140
|
+
track('MaestroProcesses.GetInstanceStatusTimeline')
|
|
10141
|
+
], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
|
|
10142
|
+
__decorate([
|
|
10143
|
+
track('MaestroProcesses.GetTopFaultedCount')
|
|
10144
|
+
], MaestroProcessesService.prototype, "getTopFaultedCount", null);
|
|
10145
|
+
__decorate([
|
|
10146
|
+
track('MaestroProcesses.GetTopExecutionDuration')
|
|
10147
|
+
], MaestroProcessesService.prototype, "getTopExecutionDuration", null);
|
|
10104
10148
|
|
|
10105
10149
|
/**
|
|
10106
10150
|
* Service class for Maestro Process Incidents
|
|
@@ -10185,6 +10229,177 @@ class CasesService extends BaseService {
|
|
|
10185
10229
|
name: this.extractCaseName(caseItem.packageId)
|
|
10186
10230
|
}));
|
|
10187
10231
|
}
|
|
10232
|
+
/**
|
|
10233
|
+
* Get the top 5 case processes ranked by run count within a time range.
|
|
10234
|
+
*
|
|
10235
|
+
* Returns an array of up to 5 case processes sorted by how many times they were executed,
|
|
10236
|
+
* useful for identifying the most active case processes in a given period.
|
|
10237
|
+
*
|
|
10238
|
+
* @param startTime - Start of the time range to query
|
|
10239
|
+
* @param endTime - End of the time range to query
|
|
10240
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
10241
|
+
* @returns Promise resolving to an array of {@link CaseGetTopRunCountResponse}
|
|
10242
|
+
* @example
|
|
10243
|
+
* ```typescript
|
|
10244
|
+
* import { Cases } from '@uipath/uipath-typescript/cases';
|
|
10245
|
+
*
|
|
10246
|
+
* const cases = new Cases(sdk);
|
|
10247
|
+
*
|
|
10248
|
+
* // Get top case processes by run count for the last 7 days
|
|
10249
|
+
* const topProcesses = await cases.getTopRunCount(
|
|
10250
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10251
|
+
* new Date()
|
|
10252
|
+
* );
|
|
10253
|
+
*
|
|
10254
|
+
* for (const process of topProcesses) {
|
|
10255
|
+
* console.log(`${process.packageId}: ${process.runCount} runs`);
|
|
10256
|
+
* }
|
|
10257
|
+
* ```
|
|
10258
|
+
*
|
|
10259
|
+
* @example
|
|
10260
|
+
* ```typescript
|
|
10261
|
+
* // Get top case processes by run count for a specific package
|
|
10262
|
+
* const filtered = await cases.getTopRunCount(
|
|
10263
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10264
|
+
* new Date(),
|
|
10265
|
+
* { packageId: '<packageId>' }
|
|
10266
|
+
* );
|
|
10267
|
+
* ```
|
|
10268
|
+
*/
|
|
10269
|
+
async getTopRunCount(startTime, endTime, options) {
|
|
10270
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, true, options));
|
|
10271
|
+
return (data ?? []).map(process => ({ ...process, name: this.extractCaseName(process.packageId) }));
|
|
10272
|
+
}
|
|
10273
|
+
/**
|
|
10274
|
+
* Get all instances status counts aggregated by date for case management processes.
|
|
10275
|
+
*
|
|
10276
|
+
* Returns time-grouped counts of case instances grouped by status (Completed, Faulted, Cancelled),
|
|
10277
|
+
* useful for rendering time-series charts. Use `groupBy` to control the time bucket size
|
|
10278
|
+
* (hour, day, or week) — defaults to day if not provided.
|
|
10279
|
+
*
|
|
10280
|
+
* @param startTime - Start of the time range to query
|
|
10281
|
+
* @param endTime - End of the time range to query
|
|
10282
|
+
* @param options - Optional settings for time bucketing granularity
|
|
10283
|
+
* @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
|
|
10284
|
+
*
|
|
10285
|
+
* @example
|
|
10286
|
+
* ```typescript
|
|
10287
|
+
* // Get daily instance status for the last 7 days
|
|
10288
|
+
* const now = new Date();
|
|
10289
|
+
* const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
|
10290
|
+
* const statuses = await cases.getInstanceStatusTimeline(sevenDaysAgo, now);
|
|
10291
|
+
*
|
|
10292
|
+
* for (const entry of statuses) {
|
|
10293
|
+
* console.log(`${entry.startTime} — ${entry.status}: ${entry.count}`);
|
|
10294
|
+
* }
|
|
10295
|
+
* ```
|
|
10296
|
+
*
|
|
10297
|
+
* @example
|
|
10298
|
+
* ```typescript
|
|
10299
|
+
* import { TimeInterval } from '@uipath/uipath-typescript/cases';
|
|
10300
|
+
*
|
|
10301
|
+
* // Get weekly breakdown
|
|
10302
|
+
* const statuses = await cases.getInstanceStatusTimeline(startTime, endTime, {
|
|
10303
|
+
* groupBy: TimeInterval.Week,
|
|
10304
|
+
* });
|
|
10305
|
+
* ```
|
|
10306
|
+
*
|
|
10307
|
+
* @example
|
|
10308
|
+
* ```typescript
|
|
10309
|
+
* // Get all-time data (from Unix epoch to now)
|
|
10310
|
+
* const allTime = await cases.getInstanceStatusTimeline(new Date(0), new Date());
|
|
10311
|
+
* ```
|
|
10312
|
+
*/
|
|
10313
|
+
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
10314
|
+
return fetchInstanceStatusTimeline(this.post.bind(this), startTime, endTime, true, options);
|
|
10315
|
+
}
|
|
10316
|
+
/**
|
|
10317
|
+
* Get the top 10 case processes ranked by failure count within a time range.
|
|
10318
|
+
*
|
|
10319
|
+
* Returns an array of up to 10 case processes sorted by how many instances faulted,
|
|
10320
|
+
* useful for identifying the most error-prone case processes in a given period.
|
|
10321
|
+
*
|
|
10322
|
+
* @param startTime - Start of the time range to query
|
|
10323
|
+
* @param endTime - End of the time range to query
|
|
10324
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
10325
|
+
* @returns Promise resolving to an array of {@link CaseGetTopFaultedCountResponse}
|
|
10326
|
+
* @example
|
|
10327
|
+
* ```typescript
|
|
10328
|
+
* import { Cases } from '@uipath/uipath-typescript/cases';
|
|
10329
|
+
*
|
|
10330
|
+
* const cases = new Cases(sdk);
|
|
10331
|
+
*
|
|
10332
|
+
* // Get top case processes by faulted count for the last 7 days
|
|
10333
|
+
* const topFailing = await cases.getTopFaultedCount(
|
|
10334
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10335
|
+
* new Date()
|
|
10336
|
+
* );
|
|
10337
|
+
*
|
|
10338
|
+
* for (const process of topFailing) {
|
|
10339
|
+
* console.log(`${process.packageId}: ${process.faultedCount} failures`);
|
|
10340
|
+
* }
|
|
10341
|
+
* ```
|
|
10342
|
+
*
|
|
10343
|
+
* @example
|
|
10344
|
+
* ```typescript
|
|
10345
|
+
* // Get top case processes by faulted count for a specific package
|
|
10346
|
+
* const filtered = await cases.getTopFaultedCount(
|
|
10347
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10348
|
+
* new Date(),
|
|
10349
|
+
* { packageId: '<packageId>' }
|
|
10350
|
+
* );
|
|
10351
|
+
* ```
|
|
10352
|
+
*/
|
|
10353
|
+
async getTopFaultedCount(startTime, endTime, options) {
|
|
10354
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
|
|
10355
|
+
return (data ?? []).map(item => ({
|
|
10356
|
+
packageId: item.packageId,
|
|
10357
|
+
processKey: item.processKey,
|
|
10358
|
+
faultedCount: item.runCount,
|
|
10359
|
+
name: this.extractCaseName(item.packageId),
|
|
10360
|
+
}));
|
|
10361
|
+
}
|
|
10362
|
+
/**
|
|
10363
|
+
* Get the top 5 case processes ranked by total duration within a time range.
|
|
10364
|
+
*
|
|
10365
|
+
* Returns an array of up to 5 case processes sorted by their total execution time,
|
|
10366
|
+
* useful for identifying the longest-running case processes in a given period.
|
|
10367
|
+
*
|
|
10368
|
+
* @param startTime - Start of the time range to query
|
|
10369
|
+
* @param endTime - End of the time range to query
|
|
10370
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
10371
|
+
* @returns Promise resolving to an array of {@link CaseGetTopDurationResponse}
|
|
10372
|
+
* @example
|
|
10373
|
+
* ```typescript
|
|
10374
|
+
* import { Cases } from '@uipath/uipath-typescript/cases';
|
|
10375
|
+
*
|
|
10376
|
+
* const cases = new Cases(sdk);
|
|
10377
|
+
*
|
|
10378
|
+
* // Get top case processes by duration for the last 7 days
|
|
10379
|
+
* const topProcesses = await cases.getTopExecutionDuration(
|
|
10380
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10381
|
+
* new Date()
|
|
10382
|
+
* );
|
|
10383
|
+
*
|
|
10384
|
+
* for (const process of topProcesses) {
|
|
10385
|
+
* console.log(`${process.packageId}: ${process.duration}ms total`);
|
|
10386
|
+
* }
|
|
10387
|
+
* ```
|
|
10388
|
+
*
|
|
10389
|
+
* @example
|
|
10390
|
+
* ```typescript
|
|
10391
|
+
* // Get top case processes by duration for a specific package
|
|
10392
|
+
* const filtered = await cases.getTopExecutionDuration(
|
|
10393
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10394
|
+
* new Date(),
|
|
10395
|
+
* { packageId: '<packageId>' }
|
|
10396
|
+
* );
|
|
10397
|
+
* ```
|
|
10398
|
+
*/
|
|
10399
|
+
async getTopExecutionDuration(startTime, endTime, options) {
|
|
10400
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_DURATION, buildInsightsTopBody(startTime, endTime, true, options));
|
|
10401
|
+
return (data ?? []).map(process => ({ ...process, name: this.extractCaseName(process.packageId) }));
|
|
10402
|
+
}
|
|
10188
10403
|
/**
|
|
10189
10404
|
* Extract a readable case name from the packageId
|
|
10190
10405
|
* @param packageId - The full package identifier
|
|
@@ -10207,6 +10422,18 @@ class CasesService extends BaseService {
|
|
|
10207
10422
|
__decorate([
|
|
10208
10423
|
track('Cases.GetAll')
|
|
10209
10424
|
], CasesService.prototype, "getAll", null);
|
|
10425
|
+
__decorate([
|
|
10426
|
+
track('Cases.GetTopRunCount')
|
|
10427
|
+
], CasesService.prototype, "getTopRunCount", null);
|
|
10428
|
+
__decorate([
|
|
10429
|
+
track('Cases.GetInstanceStatusTimeline')
|
|
10430
|
+
], CasesService.prototype, "getInstanceStatusTimeline", null);
|
|
10431
|
+
__decorate([
|
|
10432
|
+
track('Cases.GetTopFaultedCount')
|
|
10433
|
+
], CasesService.prototype, "getTopFaultedCount", null);
|
|
10434
|
+
__decorate([
|
|
10435
|
+
track('Cases.GetTopExecutionDuration')
|
|
10436
|
+
], CasesService.prototype, "getTopExecutionDuration", null);
|
|
10210
10437
|
|
|
10211
10438
|
/**
|
|
10212
10439
|
* Maps fields for Case Instance entities to ensure consistent naming
|
|
@@ -11322,6 +11549,40 @@ class CaseInstancesService extends BaseService {
|
|
|
11322
11549
|
}
|
|
11323
11550
|
}, apiOptions);
|
|
11324
11551
|
}
|
|
11552
|
+
/**
|
|
11553
|
+
* Get stages SLA summary for case instances across folders.
|
|
11554
|
+
*
|
|
11555
|
+
* Returns stage-level SLA status and escalation information for each case instance, aggregated from Insights Real-Time Monitoring.
|
|
11556
|
+
*
|
|
11557
|
+
* @param options - Optional filtering options
|
|
11558
|
+
* @returns Promise resolving to an array of {@link CaseInstanceStageSLAResponse}
|
|
11559
|
+
* @example
|
|
11560
|
+
* ```typescript
|
|
11561
|
+
* // Get stages SLA summary for all case instances
|
|
11562
|
+
* const stagesSla = await caseInstances.getStagesSlaSummary();
|
|
11563
|
+
* for (const item of stagesSla) {
|
|
11564
|
+
* console.log(`Instance: ${item.caseInstanceId}`);
|
|
11565
|
+
* for (const stage of item.stages) {
|
|
11566
|
+
* console.log(` Stage: ${stage.name} - SLA Status: ${stage.slaStatus}, Due: ${stage.slaDueTime}`);
|
|
11567
|
+
* }
|
|
11568
|
+
* }
|
|
11569
|
+
*
|
|
11570
|
+
* // Filter by case instance ID
|
|
11571
|
+
* const filtered = await caseInstances.getStagesSlaSummary({
|
|
11572
|
+
* caseInstanceId: '<caseInstanceId>'
|
|
11573
|
+
* });
|
|
11574
|
+
*
|
|
11575
|
+
* // Using bound method on a case instance
|
|
11576
|
+
* const instance = await caseInstances.getById('<instanceId>', '<folderKey>');
|
|
11577
|
+
* const stagesSla = await instance.getStagesSlaSummary();
|
|
11578
|
+
* ```
|
|
11579
|
+
*/
|
|
11580
|
+
async getStagesSlaSummary(options) {
|
|
11581
|
+
const response = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.STAGES_SUMMARY, {
|
|
11582
|
+
caseInstanceId: options?.caseInstanceId,
|
|
11583
|
+
});
|
|
11584
|
+
return response.data ?? [];
|
|
11585
|
+
}
|
|
11325
11586
|
}
|
|
11326
11587
|
__decorate([
|
|
11327
11588
|
track('CaseInstances.GetAll')
|
|
@@ -11353,6 +11614,9 @@ __decorate([
|
|
|
11353
11614
|
__decorate([
|
|
11354
11615
|
track('CaseInstances.GetSlaSummary')
|
|
11355
11616
|
], CaseInstancesService.prototype, "getSlaSummary", null);
|
|
11617
|
+
__decorate([
|
|
11618
|
+
track('CaseInstances.GetStagesSlaSummary')
|
|
11619
|
+
], CaseInstancesService.prototype, "getStagesSlaSummary", null);
|
|
11356
11620
|
|
|
11357
11621
|
/**
|
|
11358
11622
|
* Validates the `name` argument passed to a `getByName(name, ...)` method.
|
|
@@ -11760,6 +12024,32 @@ class BucketService extends FolderScopedService {
|
|
|
11760
12024
|
// Transform response from PascalCase to camelCase
|
|
11761
12025
|
return pascalToCamelCaseKeys(response.data);
|
|
11762
12026
|
}
|
|
12027
|
+
/**
|
|
12028
|
+
* Retrieves a single orchestrator storage bucket by name.
|
|
12029
|
+
*
|
|
12030
|
+
* @param name - Bucket name to search for
|
|
12031
|
+
* @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) and optional query parameters (`expand`, `select`)
|
|
12032
|
+
* @returns Promise resolving to a single bucket
|
|
12033
|
+
* {@link BucketGetResponse}
|
|
12034
|
+
* @example
|
|
12035
|
+
* ```typescript
|
|
12036
|
+
* import { Buckets } from '@uipath/uipath-typescript/buckets';
|
|
12037
|
+
*
|
|
12038
|
+
* const buckets = new Buckets(sdk);
|
|
12039
|
+
*
|
|
12040
|
+
* // By folder ID
|
|
12041
|
+
* await buckets.getByName('MyBucket', { folderId: <folderId> });
|
|
12042
|
+
*
|
|
12043
|
+
* // By folder key (GUID)
|
|
12044
|
+
* await buckets.getByName('MyBucket', { folderKey: '<folderKey>' });
|
|
12045
|
+
*
|
|
12046
|
+
* // By folder path
|
|
12047
|
+
* await buckets.getByName('MyBucket', { folderPath: '<folderPath>' });
|
|
12048
|
+
* ```
|
|
12049
|
+
*/
|
|
12050
|
+
async getByName(name, options = {}) {
|
|
12051
|
+
return this.getByNameLookup('Bucket', BUCKET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => pascalToCamelCaseKeys(raw));
|
|
12052
|
+
}
|
|
11763
12053
|
/**
|
|
11764
12054
|
* Gets all buckets across folders with optional filtering and folder scoping
|
|
11765
12055
|
*
|
|
@@ -12049,6 +12339,9 @@ class BucketService extends FolderScopedService {
|
|
|
12049
12339
|
__decorate([
|
|
12050
12340
|
track('Buckets.GetById')
|
|
12051
12341
|
], BucketService.prototype, "getById", null);
|
|
12342
|
+
__decorate([
|
|
12343
|
+
track('Buckets.GetByName')
|
|
12344
|
+
], BucketService.prototype, "getByName", null);
|
|
12052
12345
|
__decorate([
|
|
12053
12346
|
track('Buckets.GetAll')
|
|
12054
12347
|
], BucketService.prototype, "getAll", null);
|
|
@@ -13226,6 +13519,17 @@ const ConversationMap = {
|
|
|
13226
13519
|
lastActivityAt: 'lastActivityTime',
|
|
13227
13520
|
agentReleaseId: 'agentId'
|
|
13228
13521
|
};
|
|
13522
|
+
/**
|
|
13523
|
+
* Maps API filter param names (left) to SDK-facing names (right) for the conversation list endpoint.
|
|
13524
|
+
* Used by `getAll` to translate SDK filters to the field names the backend expects. Kept separate
|
|
13525
|
+
* from `ConversationMap` because `label`/`search` would otherwise collide with the `label` field
|
|
13526
|
+
* on create/update payloads.
|
|
13527
|
+
*/
|
|
13528
|
+
const ConversationGetAllFilterMap = {
|
|
13529
|
+
agentReleaseKey: 'agentKey',
|
|
13530
|
+
agentReleaseId: 'agentId',
|
|
13531
|
+
search: 'label'
|
|
13532
|
+
};
|
|
13229
13533
|
/**
|
|
13230
13534
|
* Maps fields for Exchange entity to ensure consistent SDK naming
|
|
13231
13535
|
*/
|
|
@@ -13585,8 +13889,8 @@ var WordGroupType;
|
|
|
13585
13889
|
// Auto-generated from the OpenAPI spec — do not edit manually.
|
|
13586
13890
|
var ModelKind;
|
|
13587
13891
|
(function (ModelKind) {
|
|
13588
|
-
ModelKind["Classifier"] = "Classifier";
|
|
13589
13892
|
ModelKind["Extractor"] = "Extractor";
|
|
13893
|
+
ModelKind["Classifier"] = "Classifier";
|
|
13590
13894
|
})(ModelKind || (ModelKind = {}));
|
|
13591
13895
|
var ModelType;
|
|
13592
13896
|
(function (ModelType) {
|
|
@@ -13595,6 +13899,14 @@ var ModelType;
|
|
|
13595
13899
|
ModelType["Predefined"] = "Predefined";
|
|
13596
13900
|
})(ModelType || (ModelType = {}));
|
|
13597
13901
|
|
|
13902
|
+
// Auto-generated from the OpenAPI spec — do not edit manually.
|
|
13903
|
+
var ErrorSeverity;
|
|
13904
|
+
(function (ErrorSeverity) {
|
|
13905
|
+
ErrorSeverity["Info"] = "Info";
|
|
13906
|
+
ErrorSeverity["Warning"] = "Warning";
|
|
13907
|
+
ErrorSeverity["Error"] = "Error";
|
|
13908
|
+
})(ErrorSeverity || (ErrorSeverity = {}));
|
|
13909
|
+
|
|
13598
13910
|
// Auto-generated from the OpenAPI spec — do not edit manually.
|
|
13599
13911
|
var ClassifierDocumentTypeType;
|
|
13600
13912
|
(function (ClassifierDocumentTypeType) {
|
|
@@ -13619,6 +13931,13 @@ var GptFieldType;
|
|
|
13619
13931
|
GptFieldType["Number"] = "Number";
|
|
13620
13932
|
GptFieldType["Text"] = "Text";
|
|
13621
13933
|
})(GptFieldType || (GptFieldType = {}));
|
|
13934
|
+
var JobStatus;
|
|
13935
|
+
(function (JobStatus) {
|
|
13936
|
+
JobStatus["Succeeded"] = "Succeeded";
|
|
13937
|
+
JobStatus["Failed"] = "Failed";
|
|
13938
|
+
JobStatus["Running"] = "Running";
|
|
13939
|
+
JobStatus["NotStarted"] = "NotStarted";
|
|
13940
|
+
})(JobStatus || (JobStatus = {}));
|
|
13622
13941
|
var ValidationDisplayMode;
|
|
13623
13942
|
(function (ValidationDisplayMode) {
|
|
13624
13943
|
ValidationDisplayMode["Classic"] = "Classic";
|
|
@@ -13705,8 +14024,10 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
13705
14024
|
get DocumentActionPriority () { return DocumentActionPriority; },
|
|
13706
14025
|
get DocumentActionStatus () { return DocumentActionStatus; },
|
|
13707
14026
|
get DocumentActionType () { return DocumentActionType; },
|
|
14027
|
+
get ErrorSeverity () { return ErrorSeverity; },
|
|
13708
14028
|
get FieldType () { return FieldType; },
|
|
13709
14029
|
get GptFieldType () { return GptFieldType; },
|
|
14030
|
+
get JobStatus () { return JobStatus; },
|
|
13710
14031
|
get LogicalOperator () { return LogicalOperator; },
|
|
13711
14032
|
get MarkupType () { return MarkupType; },
|
|
13712
14033
|
get ModelKind () { return ModelKind; },
|
|
@@ -13800,17 +14121,10 @@ function getAppBase() {
|
|
|
13800
14121
|
return getMetaTagContent(exports.UiPathMetaTags.APP_BASE) || '/';
|
|
13801
14122
|
}
|
|
13802
14123
|
|
|
13803
|
-
exports.APP_NAME = APP_NAME;
|
|
13804
14124
|
exports.AgentMap = AgentMap;
|
|
13805
14125
|
exports.AuthenticationError = AuthenticationError;
|
|
13806
14126
|
exports.AuthorizationError = AuthorizationError;
|
|
13807
|
-
exports.
|
|
13808
|
-
exports.CLOUD_ORGANIZATION_NAME = CLOUD_ORGANIZATION_NAME;
|
|
13809
|
-
exports.CLOUD_REDIRECT_URI = CLOUD_REDIRECT_URI;
|
|
13810
|
-
exports.CLOUD_ROLE_NAME = CLOUD_ROLE_NAME;
|
|
13811
|
-
exports.CLOUD_TENANT_NAME = CLOUD_TENANT_NAME;
|
|
13812
|
-
exports.CLOUD_URL = CLOUD_URL;
|
|
13813
|
-
exports.CONNECTION_STRING = CONNECTION_STRING;
|
|
14127
|
+
exports.ConversationGetAllFilterMap = ConversationGetAllFilterMap;
|
|
13814
14128
|
exports.ConversationMap = ConversationMap;
|
|
13815
14129
|
exports.DEFAULT_ITEMS_FIELD = DEFAULT_ITEMS_FIELD;
|
|
13816
14130
|
exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
|
|
@@ -13824,17 +14138,10 @@ exports.MessageMap = MessageMap;
|
|
|
13824
14138
|
exports.NetworkError = NetworkError;
|
|
13825
14139
|
exports.NotFoundError = NotFoundError;
|
|
13826
14140
|
exports.RateLimitError = RateLimitError;
|
|
13827
|
-
exports.SDK_LOGGER_NAME = SDK_LOGGER_NAME;
|
|
13828
|
-
exports.SDK_RUN_EVENT = SDK_RUN_EVENT;
|
|
13829
|
-
exports.SDK_SERVICE_NAME = SDK_SERVICE_NAME;
|
|
13830
|
-
exports.SDK_VERSION = SDK_VERSION;
|
|
13831
|
-
exports.SERVICE = SERVICE;
|
|
13832
14141
|
exports.ServerError = ServerError;
|
|
13833
|
-
exports.UNKNOWN = UNKNOWN$1;
|
|
13834
14142
|
exports.UiPath = UiPath;
|
|
13835
14143
|
exports.UiPathError = UiPathError;
|
|
13836
14144
|
exports.UserSettingsMap = UserSettingsMap;
|
|
13837
|
-
exports.VERSION = VERSION;
|
|
13838
14145
|
exports.ValidationError = ValidationError;
|
|
13839
14146
|
exports.createAgentWithMethods = createAgentWithMethods;
|
|
13840
14147
|
exports.createCaseInstanceWithMethods = createCaseInstanceWithMethods;
|