@uipath/uipath-typescript 1.3.9 → 1.3.11
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 +19 -6
- package/dist/assets/index.mjs +19 -6
- package/dist/attachments/index.cjs +19 -6
- package/dist/attachments/index.mjs +19 -6
- package/dist/buckets/index.cjs +141 -6
- package/dist/buckets/index.d.ts +164 -1
- package/dist/buckets/index.mjs +141 -6
- package/dist/cases/index.cjs +70 -6
- package/dist/cases/index.d.ts +91 -1
- package/dist/cases/index.mjs +70 -6
- package/dist/conversational-agent/index.cjs +19 -6
- package/dist/conversational-agent/index.mjs +19 -6
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +239 -34
- package/dist/entities/index.d.ts +311 -12
- package/dist/entities/index.mjs +239 -34
- package/dist/feedback/index.cjs +19 -6
- package/dist/feedback/index.mjs +19 -6
- package/dist/index.cjs +490 -64
- package/dist/index.d.ts +714 -36
- package/dist/index.mjs +490 -64
- package/dist/index.umd.js +491 -65
- package/dist/jobs/index.cjs +19 -6
- package/dist/jobs/index.mjs +19 -6
- package/dist/maestro-processes/index.cjs +70 -6
- package/dist/maestro-processes/index.d.ts +91 -1
- package/dist/maestro-processes/index.mjs +70 -6
- package/dist/processes/index.cjs +47 -35
- package/dist/processes/index.d.ts +76 -26
- package/dist/processes/index.mjs +47 -35
- package/dist/queues/index.cjs +19 -6
- package/dist/queues/index.mjs +19 -6
- package/dist/tasks/index.cjs +19 -6
- package/dist/tasks/index.mjs +19 -6
- package/dist/traces/index.cjs +1902 -0
- package/dist/traces/index.d.ts +565 -0
- package/dist/traces/index.mjs +1900 -0
- package/package.json +12 -2
package/dist/index.mjs
CHANGED
|
@@ -4512,6 +4512,8 @@ const BUCKET_ENDPOINTS = {
|
|
|
4512
4512
|
GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
|
|
4513
4513
|
GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
|
|
4514
4514
|
GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
|
|
4515
|
+
DELETE_FILE: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.DeleteFile`,
|
|
4516
|
+
GET_FILES: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetFiles`,
|
|
4515
4517
|
};
|
|
4516
4518
|
/**
|
|
4517
4519
|
* Orchestrator Process Service Endpoints
|
|
@@ -4594,6 +4596,8 @@ const MAESTRO_ENDPOINTS = {
|
|
|
4594
4596
|
TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
|
|
4595
4597
|
/** Top processes ranked by failure count */
|
|
4596
4598
|
TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
|
|
4599
|
+
/** Top elements ranked by failure count */
|
|
4600
|
+
TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
|
|
4597
4601
|
/** Instance status aggregated by date for time-series charts */
|
|
4598
4602
|
INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
|
|
4599
4603
|
/** Top processes ranked by total duration */
|
|
@@ -4637,6 +4641,12 @@ const DATA_FABRIC_ENDPOINTS = {
|
|
|
4637
4641
|
CHOICESETS: {
|
|
4638
4642
|
GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
|
|
4639
4643
|
GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
|
|
4644
|
+
CREATE: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
|
|
4645
|
+
UPDATE: (choiceSetId) => `${DATAFABRIC_BASE}/api/Entity/${choiceSetId}/metadata`,
|
|
4646
|
+
DELETE: (choiceSetId) => `${DATAFABRIC_BASE}/api/Entity/${choiceSetId}/delete`,
|
|
4647
|
+
INSERT_BY_NAME: (choiceSetName) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/insert`,
|
|
4648
|
+
UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
|
|
4649
|
+
DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`,
|
|
4640
4650
|
},
|
|
4641
4651
|
};
|
|
4642
4652
|
|
|
@@ -5482,7 +5492,7 @@ function normalizeBaseUrl(url) {
|
|
|
5482
5492
|
* SDK's public API.
|
|
5483
5493
|
*/
|
|
5484
5494
|
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
5485
|
-
const SDK_VERSION = '1.3.
|
|
5495
|
+
const SDK_VERSION = '1.3.11';
|
|
5486
5496
|
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
5487
5497
|
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
5488
5498
|
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|
|
@@ -6208,14 +6218,25 @@ class ApiClient {
|
|
|
6208
6218
|
if (!text) {
|
|
6209
6219
|
return undefined;
|
|
6210
6220
|
}
|
|
6211
|
-
|
|
6221
|
+
try {
|
|
6222
|
+
return JSON.parse(text);
|
|
6223
|
+
}
|
|
6224
|
+
catch (error) {
|
|
6225
|
+
if (error instanceof SyntaxError) {
|
|
6226
|
+
throw new ServerError({
|
|
6227
|
+
message: `Server returned non-JSON response (${response.status} ${response.url}): ${error.message}`,
|
|
6228
|
+
statusCode: response.status,
|
|
6229
|
+
});
|
|
6230
|
+
}
|
|
6231
|
+
throw error;
|
|
6232
|
+
}
|
|
6212
6233
|
}
|
|
6213
6234
|
catch (error) {
|
|
6214
6235
|
// If it's already one of our errors, re-throw it
|
|
6215
6236
|
if (error.type && error.type.includes('Error')) {
|
|
6216
6237
|
throw error;
|
|
6217
6238
|
}
|
|
6218
|
-
// Otherwise, it's
|
|
6239
|
+
// Otherwise, it's a genuine network/fetch failure
|
|
6219
6240
|
throw ErrorFactory.createNetworkError(error);
|
|
6220
6241
|
}
|
|
6221
6242
|
}
|
|
@@ -7111,9 +7132,9 @@ class PaginationHelpers {
|
|
|
7111
7132
|
* @returns Promise resolving to a paginated result
|
|
7112
7133
|
*/
|
|
7113
7134
|
static async getAllPaginated(params) {
|
|
7114
|
-
const { serviceAccess, getEndpoint, folderId, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
7135
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
7115
7136
|
const endpoint = getEndpoint(folderId);
|
|
7116
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
7137
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
7117
7138
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
7118
7139
|
headers,
|
|
7119
7140
|
params: additionalParams,
|
|
@@ -7141,13 +7162,13 @@ class PaginationHelpers {
|
|
|
7141
7162
|
* @returns Promise resolving to an object with data and totalCount
|
|
7142
7163
|
*/
|
|
7143
7164
|
static async getAllNonPaginated(params) {
|
|
7144
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
7165
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
7145
7166
|
// Set default field names
|
|
7146
7167
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
7147
7168
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
7148
7169
|
// Determine endpoint and headers based on folderId
|
|
7149
7170
|
const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
|
|
7150
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
7171
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
7151
7172
|
// Make the API call based on method
|
|
7152
7173
|
let response;
|
|
7153
7174
|
if (method === HTTP_METHODS.POST) {
|
|
@@ -7206,6 +7227,7 @@ class PaginationHelpers {
|
|
|
7206
7227
|
serviceAccess: config.serviceAccess,
|
|
7207
7228
|
getEndpoint: config.getEndpoint,
|
|
7208
7229
|
folderId,
|
|
7230
|
+
headers: config.headers,
|
|
7209
7231
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
7210
7232
|
additionalParams: prefixedOptions,
|
|
7211
7233
|
transformFn: config.transformFn,
|
|
@@ -7223,6 +7245,7 @@ class PaginationHelpers {
|
|
|
7223
7245
|
getAllEndpoint: config.getEndpoint(),
|
|
7224
7246
|
getByFolderEndpoint: byFolderEndpoint,
|
|
7225
7247
|
folderId,
|
|
7248
|
+
headers: config.headers,
|
|
7226
7249
|
additionalParams: prefixedOptions,
|
|
7227
7250
|
transformFn: config.transformFn,
|
|
7228
7251
|
method: config.method,
|
|
@@ -8515,10 +8538,6 @@ class EntityService extends BaseService {
|
|
|
8515
8538
|
* @internal
|
|
8516
8539
|
*/
|
|
8517
8540
|
async create(name, fields, options) {
|
|
8518
|
-
this.validateName(name, 'entity');
|
|
8519
|
-
for (const field of fields) {
|
|
8520
|
-
this.validateName(field.fieldName, 'field');
|
|
8521
|
-
}
|
|
8522
8541
|
const opts = options ?? {};
|
|
8523
8542
|
const payload = {
|
|
8524
8543
|
...(opts.description !== undefined && { description: opts.description }),
|
|
@@ -8661,6 +8680,7 @@ class EntityService extends BaseService {
|
|
|
8661
8680
|
...(update.isUnique !== undefined && { isUnique: update.isUnique }),
|
|
8662
8681
|
...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
|
|
8663
8682
|
...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
|
|
8683
|
+
...(update.isHiddenField !== undefined && { isHiddenField: update.isHiddenField }),
|
|
8664
8684
|
...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
|
|
8665
8685
|
...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
|
|
8666
8686
|
};
|
|
@@ -8669,9 +8689,6 @@ class EntityService extends BaseService {
|
|
|
8669
8689
|
// Build and append new fields
|
|
8670
8690
|
const newFields = [];
|
|
8671
8691
|
if (options.addFields?.length) {
|
|
8672
|
-
for (const field of options.addFields) {
|
|
8673
|
-
this.validateName(field.fieldName, 'field');
|
|
8674
|
-
}
|
|
8675
8692
|
newFields.push(...options.addFields.map(f => this.buildSchemaFieldPayload(f)));
|
|
8676
8693
|
}
|
|
8677
8694
|
await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPSERT, {
|
|
@@ -8772,9 +8789,15 @@ class EntityService extends BaseService {
|
|
|
8772
8789
|
}
|
|
8773
8790
|
/** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
|
|
8774
8791
|
buildSchemaFieldPayload(field) {
|
|
8775
|
-
this.validateName(field.fieldName, 'field');
|
|
8776
8792
|
const fieldType = field.type ?? EntityFieldDataType.STRING;
|
|
8777
8793
|
this.validateFieldConstraints(fieldType, field, field.fieldName);
|
|
8794
|
+
const isRelationship = fieldType === EntityFieldDataType.RELATIONSHIP;
|
|
8795
|
+
const isFile = fieldType === EntityFieldDataType.FILE;
|
|
8796
|
+
if ((isRelationship || isFile) && (!field.referenceEntityId || !field.referenceFieldId)) {
|
|
8797
|
+
throw new ValidationError({
|
|
8798
|
+
message: `Field '${field.fieldName}' of type ${fieldType} requires both referenceEntityId and referenceFieldId (UUIDs of the target entity and field).`,
|
|
8799
|
+
});
|
|
8800
|
+
}
|
|
8778
8801
|
const mapping = EntitySchemaFieldTypeMap[fieldType];
|
|
8779
8802
|
return {
|
|
8780
8803
|
name: field.fieldName,
|
|
@@ -8789,10 +8812,13 @@ class EntityService extends BaseService {
|
|
|
8789
8812
|
isUnique: field.isUnique ?? false,
|
|
8790
8813
|
isRbacEnabled: field.isRbacEnabled ?? false,
|
|
8791
8814
|
isEncrypted: field.isEncrypted ?? false,
|
|
8815
|
+
isHiddenField: field.isHiddenField ?? false,
|
|
8792
8816
|
...(field.defaultValue !== undefined && { defaultValue: field.defaultValue }),
|
|
8793
8817
|
...(field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId }),
|
|
8794
|
-
...(
|
|
8795
|
-
...(
|
|
8818
|
+
...((isRelationship || isFile) && { isForeignKey: true }),
|
|
8819
|
+
...(isRelationship && { referenceType: ReferenceType.ManyToOne }),
|
|
8820
|
+
...(field.referenceEntityId !== undefined && { referenceEntity: { id: field.referenceEntityId } }),
|
|
8821
|
+
...(field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }),
|
|
8796
8822
|
};
|
|
8797
8823
|
}
|
|
8798
8824
|
/**
|
|
@@ -8896,24 +8922,7 @@ class EntityService extends BaseService {
|
|
|
8896
8922
|
return {};
|
|
8897
8923
|
}
|
|
8898
8924
|
}
|
|
8899
|
-
validateName(name, context) {
|
|
8900
|
-
if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
|
|
8901
|
-
const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
|
|
8902
|
-
const defaultName = `My${context.charAt(0).toUpperCase() + context.slice(1)}`;
|
|
8903
|
-
throw new ValidationError({
|
|
8904
|
-
message: `Invalid ${context} name '${name}'. Must start with a letter, contain only letters, numbers, and underscores, 3–100 characters (e.g., "${suggestion || defaultName}").`
|
|
8905
|
-
});
|
|
8906
|
-
}
|
|
8907
|
-
if (context === 'field' && EntityService.RESERVED_FIELD_NAMES.has(name)) {
|
|
8908
|
-
throw new ValidationError({
|
|
8909
|
-
message: `Field name '${name}' is reserved. Reserved names: ${[...EntityService.RESERVED_FIELD_NAMES].join(', ')}.`
|
|
8910
|
-
});
|
|
8911
|
-
}
|
|
8912
|
-
}
|
|
8913
8925
|
}
|
|
8914
|
-
EntityService.RESERVED_FIELD_NAMES = new Set([
|
|
8915
|
-
'Id', 'CreatedBy', 'CreateTime', 'UpdatedBy', 'UpdateTime'
|
|
8916
|
-
]);
|
|
8917
8926
|
__decorate([
|
|
8918
8927
|
track('Entities.GetById')
|
|
8919
8928
|
], EntityService.prototype, "getById", null);
|
|
@@ -9010,7 +9019,7 @@ class ChoiceSetService extends BaseService {
|
|
|
9010
9019
|
*
|
|
9011
9020
|
* @example
|
|
9012
9021
|
* ```typescript
|
|
9013
|
-
* import { ChoiceSets } from '@uipath/uipath-typescript/
|
|
9022
|
+
* import { ChoiceSets } from '@uipath/uipath-typescript/entities';
|
|
9014
9023
|
*
|
|
9015
9024
|
* const choiceSets = new ChoiceSets(sdk);
|
|
9016
9025
|
*
|
|
@@ -9059,6 +9068,188 @@ class ChoiceSetService extends BaseService {
|
|
|
9059
9068
|
}
|
|
9060
9069
|
}, options);
|
|
9061
9070
|
}
|
|
9071
|
+
/**
|
|
9072
|
+
* Creates a new Data Fabric choice set
|
|
9073
|
+
*
|
|
9074
|
+
* @param name - Choice set name. Must start with a
|
|
9075
|
+
* letter, may contain only letters, numbers, and underscores, length
|
|
9076
|
+
* 3–100 characters (e.g., `"expenseTypes"`).
|
|
9077
|
+
* @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions})
|
|
9078
|
+
* @returns Promise resolving to the UUID of the created choice set
|
|
9079
|
+
*
|
|
9080
|
+
* @example
|
|
9081
|
+
* ```typescript
|
|
9082
|
+
* import { ChoiceSets } from '@uipath/uipath-typescript/entities';
|
|
9083
|
+
*
|
|
9084
|
+
* const choicesets = new ChoiceSets(sdk);
|
|
9085
|
+
*
|
|
9086
|
+
* // Minimal create
|
|
9087
|
+
* const expenseTypesId = await choicesets.create("expense_types");
|
|
9088
|
+
*
|
|
9089
|
+
* // With display name and description
|
|
9090
|
+
* const priorityLevelsId = await choicesets.create("priority_levels", {
|
|
9091
|
+
* displayName: "Priority Levels",
|
|
9092
|
+
* description: "Ticket priority categories",
|
|
9093
|
+
* });
|
|
9094
|
+
* ```
|
|
9095
|
+
* @internal
|
|
9096
|
+
*/
|
|
9097
|
+
async create(name, options) {
|
|
9098
|
+
const opts = options ?? {};
|
|
9099
|
+
const payload = {
|
|
9100
|
+
...(opts.description !== undefined && { description: opts.description }),
|
|
9101
|
+
...(opts.displayName !== undefined && { displayName: opts.displayName }),
|
|
9102
|
+
entityDefinition: {
|
|
9103
|
+
name,
|
|
9104
|
+
fields: [],
|
|
9105
|
+
folderId: opts.folderKey ?? DATA_FABRIC_TENANT_FOLDER_ID,
|
|
9106
|
+
},
|
|
9107
|
+
};
|
|
9108
|
+
const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.CREATE, payload);
|
|
9109
|
+
return response.data;
|
|
9110
|
+
}
|
|
9111
|
+
/**
|
|
9112
|
+
* Updates an existing choice set's metadata (display name and/or description).
|
|
9113
|
+
*
|
|
9114
|
+
* **At least one of `displayName` or `description` must be provided** —
|
|
9115
|
+
* the call throws `ValidationError` if both are omitted.
|
|
9116
|
+
*
|
|
9117
|
+
* @param choiceSetId - UUID of the choice set to update
|
|
9118
|
+
* @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions})
|
|
9119
|
+
* @returns Promise resolving when the update is complete
|
|
9120
|
+
*
|
|
9121
|
+
* @example
|
|
9122
|
+
* ```typescript
|
|
9123
|
+
* // First, get the choice set ID using getAll()
|
|
9124
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9125
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9126
|
+
*
|
|
9127
|
+
* await choicesets.updateById(expenseTypes.id, {
|
|
9128
|
+
* displayName: "Expense Categories",
|
|
9129
|
+
* description: "Updated description",
|
|
9130
|
+
* });
|
|
9131
|
+
* ```
|
|
9132
|
+
* @internal
|
|
9133
|
+
*/
|
|
9134
|
+
async updateById(choiceSetId, options) {
|
|
9135
|
+
if (options.displayName === undefined && options.description === undefined) {
|
|
9136
|
+
throw new ValidationError({
|
|
9137
|
+
message: 'updateById requires at least one of displayName or description.',
|
|
9138
|
+
});
|
|
9139
|
+
}
|
|
9140
|
+
await this.patch(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE(choiceSetId), {
|
|
9141
|
+
...(options.displayName !== undefined && { displayName: options.displayName }),
|
|
9142
|
+
...(options.description !== undefined && { description: options.description }),
|
|
9143
|
+
});
|
|
9144
|
+
}
|
|
9145
|
+
/**
|
|
9146
|
+
* Deletes a Data Fabric choice set and all its values.
|
|
9147
|
+
*
|
|
9148
|
+
* @param choiceSetId - UUID of the choice set to delete
|
|
9149
|
+
* @returns Promise resolving when the choice set is deleted
|
|
9150
|
+
*
|
|
9151
|
+
* @example
|
|
9152
|
+
* ```typescript
|
|
9153
|
+
* // First, get the choice set ID using getAll()
|
|
9154
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9155
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9156
|
+
*
|
|
9157
|
+
* await choicesets.deleteById(expenseTypes.id);
|
|
9158
|
+
* ```
|
|
9159
|
+
* @internal
|
|
9160
|
+
*/
|
|
9161
|
+
async deleteById(choiceSetId) {
|
|
9162
|
+
await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE(choiceSetId), {});
|
|
9163
|
+
}
|
|
9164
|
+
/**
|
|
9165
|
+
* Inserts a single value into a choice set.
|
|
9166
|
+
*
|
|
9167
|
+
* @param choiceSetId - UUID of the parent choice set
|
|
9168
|
+
* @param name - Identifier name of the new value (e.g., `"TRAVEL"`)
|
|
9169
|
+
* @param options - Optional fields ({@link ChoiceSetValueInsertOptions})
|
|
9170
|
+
* @returns Promise resolving to the inserted value ({@link ChoiceSetValueInsertResponse})
|
|
9171
|
+
*
|
|
9172
|
+
* @example
|
|
9173
|
+
* ```typescript
|
|
9174
|
+
* // First, get the choice set ID using getAll()
|
|
9175
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9176
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9177
|
+
*
|
|
9178
|
+
* const inserted = await choicesets.insertValueById(expenseTypes.id, 'TRAVEL', {
|
|
9179
|
+
* displayName: 'Travel',
|
|
9180
|
+
* });
|
|
9181
|
+
* console.log(inserted.id);
|
|
9182
|
+
* ```
|
|
9183
|
+
* @internal
|
|
9184
|
+
*/
|
|
9185
|
+
async insertValueById(choiceSetId, name, options) {
|
|
9186
|
+
const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
|
|
9187
|
+
const payload = {
|
|
9188
|
+
Name: name,
|
|
9189
|
+
...(options?.displayName !== undefined && { DisplayName: options.displayName }),
|
|
9190
|
+
};
|
|
9191
|
+
const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.INSERT_BY_NAME(choiceSetName), payload);
|
|
9192
|
+
const camelCased = pascalToCamelCaseKeys(response.data);
|
|
9193
|
+
return transformData(camelCased, EntityMap);
|
|
9194
|
+
}
|
|
9195
|
+
/**
|
|
9196
|
+
* Updates an existing choice-set value's display name.
|
|
9197
|
+
*
|
|
9198
|
+
* Only `displayName` is mutable; the value's `name` (identifier) is fixed at
|
|
9199
|
+
* insert time and cannot be changed.
|
|
9200
|
+
*
|
|
9201
|
+
* @param choiceSetId - UUID of the parent choice set
|
|
9202
|
+
* @param valueId - UUID of the value to update
|
|
9203
|
+
* @param displayName - New human-readable display name for the value
|
|
9204
|
+
* @returns Promise resolving to the updated value ({@link ChoiceSetValueUpdateResponse})
|
|
9205
|
+
*
|
|
9206
|
+
* @example
|
|
9207
|
+
* ```typescript
|
|
9208
|
+
* // Get the choice set ID from getAll() and the value ID from getById()
|
|
9209
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9210
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9211
|
+
* const values = await choicesets.getById(expenseTypes.id);
|
|
9212
|
+
* const travel = values.items.find(v => v.name === 'TRAVEL');
|
|
9213
|
+
*
|
|
9214
|
+
* await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel');
|
|
9215
|
+
* ```
|
|
9216
|
+
* @internal
|
|
9217
|
+
*/
|
|
9218
|
+
async updateValueById(choiceSetId, valueId, displayName) {
|
|
9219
|
+
const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
|
|
9220
|
+
const payload = { DisplayName: displayName };
|
|
9221
|
+
const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE_BY_NAME(choiceSetName, valueId), payload);
|
|
9222
|
+
const camelCased = pascalToCamelCaseKeys(response.data);
|
|
9223
|
+
return transformData(camelCased, EntityMap);
|
|
9224
|
+
}
|
|
9225
|
+
/**
|
|
9226
|
+
* Deletes one or more values from a choice set.
|
|
9227
|
+
*
|
|
9228
|
+
* @param choiceSetId - UUID of the parent choice set
|
|
9229
|
+
* @param valueIds - Array of value UUIDs to delete
|
|
9230
|
+
* @returns Promise resolving when the values are deleted
|
|
9231
|
+
*
|
|
9232
|
+
* @example
|
|
9233
|
+
* ```typescript
|
|
9234
|
+
* // Get the value IDs from getById()
|
|
9235
|
+
* const values = await choicesets.getById('<choiceSetId>');
|
|
9236
|
+
* const idsToDelete = values.items.slice(0, 2).map(v => v.id);
|
|
9237
|
+
*
|
|
9238
|
+
* await choicesets.deleteValuesById('<choiceSetId>', idsToDelete);
|
|
9239
|
+
* ```
|
|
9240
|
+
* @internal
|
|
9241
|
+
*/
|
|
9242
|
+
async deleteValuesById(choiceSetId, valueIds) {
|
|
9243
|
+
await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE_BY_ID(choiceSetId), valueIds);
|
|
9244
|
+
}
|
|
9245
|
+
async resolveChoiceSetName(choiceSetId) {
|
|
9246
|
+
const all = await this.getAll();
|
|
9247
|
+
const match = all.find(cs => cs.id === choiceSetId);
|
|
9248
|
+
if (!match) {
|
|
9249
|
+
throw new NotFoundError({ message: `Choice set with id '${choiceSetId}' not found.` });
|
|
9250
|
+
}
|
|
9251
|
+
return match.name;
|
|
9252
|
+
}
|
|
9062
9253
|
}
|
|
9063
9254
|
__decorate([
|
|
9064
9255
|
track('Choicesets.GetAll')
|
|
@@ -9066,6 +9257,24 @@ __decorate([
|
|
|
9066
9257
|
__decorate([
|
|
9067
9258
|
track('Choicesets.GetById')
|
|
9068
9259
|
], ChoiceSetService.prototype, "getById", null);
|
|
9260
|
+
__decorate([
|
|
9261
|
+
track('Choicesets.Create')
|
|
9262
|
+
], ChoiceSetService.prototype, "create", null);
|
|
9263
|
+
__decorate([
|
|
9264
|
+
track('Choicesets.UpdateById')
|
|
9265
|
+
], ChoiceSetService.prototype, "updateById", null);
|
|
9266
|
+
__decorate([
|
|
9267
|
+
track('Choicesets.DeleteById')
|
|
9268
|
+
], ChoiceSetService.prototype, "deleteById", null);
|
|
9269
|
+
__decorate([
|
|
9270
|
+
track('Choicesets.InsertValueById')
|
|
9271
|
+
], ChoiceSetService.prototype, "insertValueById", null);
|
|
9272
|
+
__decorate([
|
|
9273
|
+
track('Choicesets.UpdateValueById')
|
|
9274
|
+
], ChoiceSetService.prototype, "updateValueById", null);
|
|
9275
|
+
__decorate([
|
|
9276
|
+
track('Choicesets.DeleteValuesById')
|
|
9277
|
+
], ChoiceSetService.prototype, "deleteValuesById", null);
|
|
9069
9278
|
|
|
9070
9279
|
/**
|
|
9071
9280
|
* Maestro Process Models
|
|
@@ -9994,6 +10203,52 @@ class MaestroProcessesService extends BaseService {
|
|
|
9994
10203
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
|
|
9995
10204
|
return (data ?? []).map(process => ({ ...process, name: process.packageId }));
|
|
9996
10205
|
}
|
|
10206
|
+
/**
|
|
10207
|
+
* Get the top 10 BPMN elements ranked by failure count within a time range.
|
|
10208
|
+
*
|
|
10209
|
+
* Returns an array of up to 10 elements sorted by how many times they failed,
|
|
10210
|
+
* useful for identifying the most error-prone activities in processes.
|
|
10211
|
+
*
|
|
10212
|
+
* @param startTime - Start of the time range to query
|
|
10213
|
+
* @param endTime - End of the time range to query
|
|
10214
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
10215
|
+
* @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
|
|
10216
|
+
* @example
|
|
10217
|
+
* ```typescript
|
|
10218
|
+
* import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
|
|
10219
|
+
*
|
|
10220
|
+
* const maestroProcesses = new MaestroProcesses(sdk);
|
|
10221
|
+
*
|
|
10222
|
+
* // Get top failing elements for the last 7 days
|
|
10223
|
+
* const topFailing = await maestroProcesses.getTopElementFailedCount(
|
|
10224
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10225
|
+
* new Date()
|
|
10226
|
+
* );
|
|
10227
|
+
*
|
|
10228
|
+
* for (const element of topFailing) {
|
|
10229
|
+
* console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
|
|
10230
|
+
* }
|
|
10231
|
+
* ```
|
|
10232
|
+
*
|
|
10233
|
+
* @example
|
|
10234
|
+
* ```typescript
|
|
10235
|
+
* // Get top failing elements for a specific process
|
|
10236
|
+
* const filtered = await maestroProcesses.getTopElementFailedCount(
|
|
10237
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10238
|
+
* new Date(),
|
|
10239
|
+
* { processKey: '<processKey>' }
|
|
10240
|
+
* );
|
|
10241
|
+
* ```
|
|
10242
|
+
*/
|
|
10243
|
+
async getTopElementFailedCount(startTime, endTime, options) {
|
|
10244
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
|
|
10245
|
+
return (data ?? []).map(item => ({
|
|
10246
|
+
elementName: item.elementName,
|
|
10247
|
+
elementType: item.elementType,
|
|
10248
|
+
processKey: item.processKey,
|
|
10249
|
+
failedCount: item.count,
|
|
10250
|
+
}));
|
|
10251
|
+
}
|
|
9997
10252
|
/**
|
|
9998
10253
|
* Get all instances status counts aggregated by date for maestro processes.
|
|
9999
10254
|
*
|
|
@@ -10134,6 +10389,9 @@ __decorate([
|
|
|
10134
10389
|
__decorate([
|
|
10135
10390
|
track('MaestroProcesses.GetTopRunCount')
|
|
10136
10391
|
], MaestroProcessesService.prototype, "getTopRunCount", null);
|
|
10392
|
+
__decorate([
|
|
10393
|
+
track('MaestroProcesses.GetTopElementFailedCount')
|
|
10394
|
+
], MaestroProcessesService.prototype, "getTopElementFailedCount", null);
|
|
10137
10395
|
__decorate([
|
|
10138
10396
|
track('MaestroProcesses.GetInstanceStatusTimeline')
|
|
10139
10397
|
], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
|
|
@@ -10268,6 +10526,52 @@ class CasesService extends BaseService {
|
|
|
10268
10526
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, true, options));
|
|
10269
10527
|
return (data ?? []).map(process => ({ ...process, name: this.extractCaseName(process.packageId) }));
|
|
10270
10528
|
}
|
|
10529
|
+
/**
|
|
10530
|
+
* Get the top 10 BPMN elements ranked by failure count within a time range.
|
|
10531
|
+
*
|
|
10532
|
+
* Returns an array of up to 10 elements sorted by how many times they failed,
|
|
10533
|
+
* useful for identifying the most error-prone activities in case processes.
|
|
10534
|
+
*
|
|
10535
|
+
* @param startTime - Start of the time range to query
|
|
10536
|
+
* @param endTime - End of the time range to query
|
|
10537
|
+
* @param options - Optional filters (packageId, processKey, version)
|
|
10538
|
+
* @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
|
|
10539
|
+
* @example
|
|
10540
|
+
* ```typescript
|
|
10541
|
+
* import { Cases } from '@uipath/uipath-typescript/cases';
|
|
10542
|
+
*
|
|
10543
|
+
* const cases = new Cases(sdk);
|
|
10544
|
+
*
|
|
10545
|
+
* // Get top failing elements for the last 7 days
|
|
10546
|
+
* const topFailing = await cases.getTopElementFailedCount(
|
|
10547
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10548
|
+
* new Date()
|
|
10549
|
+
* );
|
|
10550
|
+
*
|
|
10551
|
+
* for (const element of topFailing) {
|
|
10552
|
+
* console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
|
|
10553
|
+
* }
|
|
10554
|
+
* ```
|
|
10555
|
+
*
|
|
10556
|
+
* @example
|
|
10557
|
+
* ```typescript
|
|
10558
|
+
* // Get top failing elements for a specific process
|
|
10559
|
+
* const filtered = await cases.getTopElementFailedCount(
|
|
10560
|
+
* new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
10561
|
+
* new Date(),
|
|
10562
|
+
* { processKey: '<processKey>' }
|
|
10563
|
+
* );
|
|
10564
|
+
* ```
|
|
10565
|
+
*/
|
|
10566
|
+
async getTopElementFailedCount(startTime, endTime, options) {
|
|
10567
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
|
|
10568
|
+
return (data ?? []).map(item => ({
|
|
10569
|
+
elementName: item.elementName,
|
|
10570
|
+
elementType: item.elementType,
|
|
10571
|
+
processKey: item.processKey,
|
|
10572
|
+
failedCount: item.count,
|
|
10573
|
+
}));
|
|
10574
|
+
}
|
|
10271
10575
|
/**
|
|
10272
10576
|
* Get all instances status counts aggregated by date for case management processes.
|
|
10273
10577
|
*
|
|
@@ -10423,6 +10727,9 @@ __decorate([
|
|
|
10423
10727
|
__decorate([
|
|
10424
10728
|
track('Cases.GetTopRunCount')
|
|
10425
10729
|
], CasesService.prototype, "getTopRunCount", null);
|
|
10730
|
+
__decorate([
|
|
10731
|
+
track('Cases.GetTopElementFailedCount')
|
|
10732
|
+
], CasesService.prototype, "getTopElementFailedCount", null);
|
|
10426
10733
|
__decorate([
|
|
10427
10734
|
track('Cases.GetInstanceStatusTimeline')
|
|
10428
10735
|
], CasesService.prototype, "getInstanceStatusTimeline", null);
|
|
@@ -12319,6 +12626,120 @@ class BucketService extends FolderScopedService {
|
|
|
12319
12626
|
}
|
|
12320
12627
|
return transformedData;
|
|
12321
12628
|
}
|
|
12629
|
+
/**
|
|
12630
|
+
* Lists all files in a bucket.
|
|
12631
|
+
*
|
|
12632
|
+
* Returns a flat, recursive listing of all files in the bucket. Supports regex filtering
|
|
12633
|
+
* and filter / orderby / select / expand. {@link BucketFile} entries include
|
|
12634
|
+
* `isDirectory` so callers can distinguish folders from files.
|
|
12635
|
+
*
|
|
12636
|
+
* The method returns either:
|
|
12637
|
+
* - A NonPaginatedResponse with items array (when no pagination parameters are provided)
|
|
12638
|
+
* - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
|
|
12639
|
+
*
|
|
12640
|
+
* @param bucketId - The ID of the bucket
|
|
12641
|
+
* @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) and optional parameters for regex filtering, query options, and pagination
|
|
12642
|
+
* @returns Promise resolving to either an array of files NonPaginatedResponse<BucketFile> or a PaginatedResponse<BucketFile> when pagination options are used.
|
|
12643
|
+
*
|
|
12644
|
+
* @example
|
|
12645
|
+
* ```typescript
|
|
12646
|
+
* import { Buckets } from '@uipath/uipath-typescript/buckets';
|
|
12647
|
+
*
|
|
12648
|
+
* const buckets = new Buckets(sdk);
|
|
12649
|
+
*
|
|
12650
|
+
* // List all files in the bucket
|
|
12651
|
+
* const files = await buckets.getFiles(<bucketId>, { folderId: <folderId> });
|
|
12652
|
+
*
|
|
12653
|
+
* // Filter by regex pattern
|
|
12654
|
+
* const pdfs = await buckets.getFiles(<bucketId>, {
|
|
12655
|
+
* folderId: <folderId>,
|
|
12656
|
+
* fileNameRegex: '.*\\.pdf$'
|
|
12657
|
+
* });
|
|
12658
|
+
*
|
|
12659
|
+
* // First page with pagination
|
|
12660
|
+
* const page1 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, pageSize: 10 });
|
|
12661
|
+
*
|
|
12662
|
+
* // Navigate using cursor
|
|
12663
|
+
* if (page1.hasNextPage) {
|
|
12664
|
+
* const page2 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, cursor: page1.nextCursor });
|
|
12665
|
+
* }
|
|
12666
|
+
*
|
|
12667
|
+
* // Jump to specific page
|
|
12668
|
+
* const page5 = await buckets.getFiles(<bucketId>, {
|
|
12669
|
+
* folderId: <folderId>,
|
|
12670
|
+
* jumpToPage: 5,
|
|
12671
|
+
* pageSize: 10
|
|
12672
|
+
* });
|
|
12673
|
+
* ```
|
|
12674
|
+
*/
|
|
12675
|
+
async getFiles(bucketId, options) {
|
|
12676
|
+
if (!bucketId) {
|
|
12677
|
+
throw new ValidationError({ message: 'bucketId is required for getFiles' });
|
|
12678
|
+
}
|
|
12679
|
+
const { folderId, folderKey, folderPath, ...restOptions } = options ?? {};
|
|
12680
|
+
const headers = resolveFolderHeaders({
|
|
12681
|
+
folderId,
|
|
12682
|
+
folderKey,
|
|
12683
|
+
folderPath,
|
|
12684
|
+
resourceType: 'Buckets.getFiles',
|
|
12685
|
+
fallbackFolderKey: this.config.folderKey,
|
|
12686
|
+
});
|
|
12687
|
+
const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
|
|
12688
|
+
return PaginationHelpers.getAll({
|
|
12689
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
12690
|
+
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
|
|
12691
|
+
transformFn: transformBucketFile,
|
|
12692
|
+
pagination: {
|
|
12693
|
+
paginationType: PaginationType.OFFSET,
|
|
12694
|
+
itemsField: ODATA_PAGINATION.ITEMS_FIELD,
|
|
12695
|
+
totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
|
|
12696
|
+
paginationParams: {
|
|
12697
|
+
pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
12698
|
+
offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
|
|
12699
|
+
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
|
|
12700
|
+
},
|
|
12701
|
+
},
|
|
12702
|
+
excludeFromPrefix: ['directory', 'recursive', 'fileNameRegex'],
|
|
12703
|
+
headers,
|
|
12704
|
+
}, { ...restOptions, directory: '/', recursive: true });
|
|
12705
|
+
}
|
|
12706
|
+
/**
|
|
12707
|
+
* Deletes a file from a bucket
|
|
12708
|
+
*
|
|
12709
|
+
* @param bucketId - The ID of the bucket
|
|
12710
|
+
* @param path - The full path to the file to delete
|
|
12711
|
+
* @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`)
|
|
12712
|
+
* @returns Promise resolving when the file is deleted
|
|
12713
|
+
*
|
|
12714
|
+
* @example
|
|
12715
|
+
* ```typescript
|
|
12716
|
+
* import { Buckets } from '@uipath/uipath-typescript/buckets';
|
|
12717
|
+
*
|
|
12718
|
+
* const buckets = new Buckets(sdk);
|
|
12719
|
+
*
|
|
12720
|
+
* // Delete a file from a bucket
|
|
12721
|
+
* await buckets.deleteFile(<bucketId>, '/folder/file.pdf', { folderId: <folderId> });
|
|
12722
|
+
* ```
|
|
12723
|
+
*/
|
|
12724
|
+
async deleteFile(bucketId, path, options) {
|
|
12725
|
+
if (!bucketId) {
|
|
12726
|
+
throw new ValidationError({ message: 'bucketId is required for deleteFile' });
|
|
12727
|
+
}
|
|
12728
|
+
if (!path) {
|
|
12729
|
+
throw new ValidationError({ message: 'path is required for deleteFile' });
|
|
12730
|
+
}
|
|
12731
|
+
const headers = resolveFolderHeaders({
|
|
12732
|
+
folderId: options?.folderId,
|
|
12733
|
+
folderKey: options?.folderKey,
|
|
12734
|
+
folderPath: options?.folderPath,
|
|
12735
|
+
resourceType: 'Buckets.deleteFile',
|
|
12736
|
+
fallbackFolderKey: this.config.folderKey,
|
|
12737
|
+
});
|
|
12738
|
+
await this.delete(BUCKET_ENDPOINTS.DELETE_FILE(bucketId), {
|
|
12739
|
+
params: { path },
|
|
12740
|
+
headers,
|
|
12741
|
+
});
|
|
12742
|
+
}
|
|
12322
12743
|
/**
|
|
12323
12744
|
* Gets a direct upload URL for a file in the bucket
|
|
12324
12745
|
*
|
|
@@ -12352,6 +12773,12 @@ __decorate([
|
|
|
12352
12773
|
__decorate([
|
|
12353
12774
|
track('Buckets.GetReadUri')
|
|
12354
12775
|
], BucketService.prototype, "getReadUri", null);
|
|
12776
|
+
__decorate([
|
|
12777
|
+
track('Buckets.GetFiles')
|
|
12778
|
+
], BucketService.prototype, "getFiles", null);
|
|
12779
|
+
__decorate([
|
|
12780
|
+
track('Buckets.DeleteFile')
|
|
12781
|
+
], BucketService.prototype, "deleteFile", null);
|
|
12355
12782
|
|
|
12356
12783
|
var BucketOptions;
|
|
12357
12784
|
(function (BucketOptions) {
|
|
@@ -13149,33 +13576,32 @@ class ProcessService extends FolderScopedService {
|
|
|
13149
13576
|
}
|
|
13150
13577
|
}, options);
|
|
13151
13578
|
}
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
13579
|
+
async start(request, optionsOrFolderId, legacyOptions) {
|
|
13580
|
+
// Normalize the two overload forms into a single internal shape.
|
|
13581
|
+
let folderId;
|
|
13582
|
+
let folderKey;
|
|
13583
|
+
let folderPath;
|
|
13584
|
+
let queryOptions;
|
|
13585
|
+
if (typeof optionsOrFolderId === 'number') {
|
|
13586
|
+
// Deprecated positional form: start(request, folderId, options?)
|
|
13587
|
+
folderId = optionsOrFolderId;
|
|
13588
|
+
queryOptions = legacyOptions ?? {};
|
|
13589
|
+
}
|
|
13590
|
+
else {
|
|
13591
|
+
// Preferred form: start(request, options?)
|
|
13592
|
+
const { folderId: fid, folderKey: fkey, folderPath: fpath, ...rest } = optionsOrFolderId ?? {};
|
|
13593
|
+
folderId = fid;
|
|
13594
|
+
folderKey = fkey;
|
|
13595
|
+
folderPath = fpath;
|
|
13596
|
+
queryOptions = rest;
|
|
13597
|
+
}
|
|
13598
|
+
const headers = resolveFolderHeaders({
|
|
13599
|
+
folderId,
|
|
13600
|
+
folderKey,
|
|
13601
|
+
folderPath,
|
|
13602
|
+
resourceType: 'processes.start',
|
|
13603
|
+
fallbackFolderKey: this.config.folderKey,
|
|
13604
|
+
});
|
|
13179
13605
|
// Transform SDK field names to API field names (e.g., processKey → releaseKey)
|
|
13180
13606
|
const apiRequest = transformRequest(request, ProcessMap);
|
|
13181
13607
|
// Create the request object according to API spec
|
|
@@ -13183,8 +13609,8 @@ class ProcessService extends FolderScopedService {
|
|
|
13183
13609
|
startInfo: apiRequest
|
|
13184
13610
|
};
|
|
13185
13611
|
// Prefix all query parameter keys with '$' for OData
|
|
13186
|
-
const keysToPrefix = Object.keys(
|
|
13187
|
-
const apiOptions = addPrefixToKeys(
|
|
13612
|
+
const keysToPrefix = Object.keys(queryOptions);
|
|
13613
|
+
const apiOptions = addPrefixToKeys(queryOptions, ODATA_PREFIX, keysToPrefix);
|
|
13188
13614
|
const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
|
|
13189
13615
|
params: apiOptions,
|
|
13190
13616
|
headers
|