@uipath/uipath-typescript 1.3.9 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.cjs +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 +19 -6
- package/dist/cases/index.mjs +19 -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 +226 -7
- package/dist/entities/index.d.ts +305 -2
- package/dist/entities/index.mjs +226 -7
- package/dist/feedback/index.cjs +19 -6
- package/dist/feedback/index.mjs +19 -6
- package/dist/index.cjs +377 -37
- package/dist/index.d.ts +542 -26
- package/dist/index.mjs +377 -37
- package/dist/index.umd.js +377 -37
- package/dist/jobs/index.cjs +19 -6
- package/dist/jobs/index.mjs +19 -6
- package/dist/maestro-processes/index.cjs +19 -6
- package/dist/maestro-processes/index.mjs +19 -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/package.json +1 -1
package/dist/feedback/index.cjs
CHANGED
|
@@ -612,14 +612,25 @@ class ApiClient {
|
|
|
612
612
|
if (!text) {
|
|
613
613
|
return undefined;
|
|
614
614
|
}
|
|
615
|
-
|
|
615
|
+
try {
|
|
616
|
+
return JSON.parse(text);
|
|
617
|
+
}
|
|
618
|
+
catch (error) {
|
|
619
|
+
if (error instanceof SyntaxError) {
|
|
620
|
+
throw new ServerError({
|
|
621
|
+
message: `Server returned non-JSON response (${response.status} ${response.url}): ${error.message}`,
|
|
622
|
+
statusCode: response.status,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
throw error;
|
|
626
|
+
}
|
|
616
627
|
}
|
|
617
628
|
catch (error) {
|
|
618
629
|
// If it's already one of our errors, re-throw it
|
|
619
630
|
if (error.type && error.type.includes('Error')) {
|
|
620
631
|
throw error;
|
|
621
632
|
}
|
|
622
|
-
// Otherwise, it's
|
|
633
|
+
// Otherwise, it's a genuine network/fetch failure
|
|
623
634
|
throw ErrorFactory.createNetworkError(error);
|
|
624
635
|
}
|
|
625
636
|
}
|
|
@@ -1149,9 +1160,9 @@ class PaginationHelpers {
|
|
|
1149
1160
|
* @returns Promise resolving to a paginated result
|
|
1150
1161
|
*/
|
|
1151
1162
|
static async getAllPaginated(params) {
|
|
1152
|
-
const { serviceAccess, getEndpoint, folderId, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1163
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1153
1164
|
const endpoint = getEndpoint(folderId);
|
|
1154
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
1165
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1155
1166
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1156
1167
|
headers,
|
|
1157
1168
|
params: additionalParams,
|
|
@@ -1179,13 +1190,13 @@ class PaginationHelpers {
|
|
|
1179
1190
|
* @returns Promise resolving to an object with data and totalCount
|
|
1180
1191
|
*/
|
|
1181
1192
|
static async getAllNonPaginated(params) {
|
|
1182
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1193
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1183
1194
|
// Set default field names
|
|
1184
1195
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1185
1196
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
1186
1197
|
// Determine endpoint and headers based on folderId
|
|
1187
1198
|
const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
|
|
1188
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
1199
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1189
1200
|
// Make the API call based on method
|
|
1190
1201
|
let response;
|
|
1191
1202
|
if (method === HTTP_METHODS.POST) {
|
|
@@ -1244,6 +1255,7 @@ class PaginationHelpers {
|
|
|
1244
1255
|
serviceAccess: config.serviceAccess,
|
|
1245
1256
|
getEndpoint: config.getEndpoint,
|
|
1246
1257
|
folderId,
|
|
1258
|
+
headers: config.headers,
|
|
1247
1259
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1248
1260
|
additionalParams: prefixedOptions,
|
|
1249
1261
|
transformFn: config.transformFn,
|
|
@@ -1261,6 +1273,7 @@ class PaginationHelpers {
|
|
|
1261
1273
|
getAllEndpoint: config.getEndpoint(),
|
|
1262
1274
|
getByFolderEndpoint: byFolderEndpoint,
|
|
1263
1275
|
folderId,
|
|
1276
|
+
headers: config.headers,
|
|
1264
1277
|
additionalParams: prefixedOptions,
|
|
1265
1278
|
transformFn: config.transformFn,
|
|
1266
1279
|
method: config.method,
|
package/dist/feedback/index.mjs
CHANGED
|
@@ -610,14 +610,25 @@ class ApiClient {
|
|
|
610
610
|
if (!text) {
|
|
611
611
|
return undefined;
|
|
612
612
|
}
|
|
613
|
-
|
|
613
|
+
try {
|
|
614
|
+
return JSON.parse(text);
|
|
615
|
+
}
|
|
616
|
+
catch (error) {
|
|
617
|
+
if (error instanceof SyntaxError) {
|
|
618
|
+
throw new ServerError({
|
|
619
|
+
message: `Server returned non-JSON response (${response.status} ${response.url}): ${error.message}`,
|
|
620
|
+
statusCode: response.status,
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
throw error;
|
|
624
|
+
}
|
|
614
625
|
}
|
|
615
626
|
catch (error) {
|
|
616
627
|
// If it's already one of our errors, re-throw it
|
|
617
628
|
if (error.type && error.type.includes('Error')) {
|
|
618
629
|
throw error;
|
|
619
630
|
}
|
|
620
|
-
// Otherwise, it's
|
|
631
|
+
// Otherwise, it's a genuine network/fetch failure
|
|
621
632
|
throw ErrorFactory.createNetworkError(error);
|
|
622
633
|
}
|
|
623
634
|
}
|
|
@@ -1147,9 +1158,9 @@ class PaginationHelpers {
|
|
|
1147
1158
|
* @returns Promise resolving to a paginated result
|
|
1148
1159
|
*/
|
|
1149
1160
|
static async getAllPaginated(params) {
|
|
1150
|
-
const { serviceAccess, getEndpoint, folderId, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1161
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1151
1162
|
const endpoint = getEndpoint(folderId);
|
|
1152
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
1163
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1153
1164
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1154
1165
|
headers,
|
|
1155
1166
|
params: additionalParams,
|
|
@@ -1177,13 +1188,13 @@ class PaginationHelpers {
|
|
|
1177
1188
|
* @returns Promise resolving to an object with data and totalCount
|
|
1178
1189
|
*/
|
|
1179
1190
|
static async getAllNonPaginated(params) {
|
|
1180
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1191
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1181
1192
|
// Set default field names
|
|
1182
1193
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1183
1194
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
1184
1195
|
// Determine endpoint and headers based on folderId
|
|
1185
1196
|
const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
|
|
1186
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
1197
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1187
1198
|
// Make the API call based on method
|
|
1188
1199
|
let response;
|
|
1189
1200
|
if (method === HTTP_METHODS.POST) {
|
|
@@ -1242,6 +1253,7 @@ class PaginationHelpers {
|
|
|
1242
1253
|
serviceAccess: config.serviceAccess,
|
|
1243
1254
|
getEndpoint: config.getEndpoint,
|
|
1244
1255
|
folderId,
|
|
1256
|
+
headers: config.headers,
|
|
1245
1257
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1246
1258
|
additionalParams: prefixedOptions,
|
|
1247
1259
|
transformFn: config.transformFn,
|
|
@@ -1259,6 +1271,7 @@ class PaginationHelpers {
|
|
|
1259
1271
|
getAllEndpoint: config.getEndpoint(),
|
|
1260
1272
|
getByFolderEndpoint: byFolderEndpoint,
|
|
1261
1273
|
folderId,
|
|
1274
|
+
headers: config.headers,
|
|
1262
1275
|
additionalParams: prefixedOptions,
|
|
1263
1276
|
transformFn: config.transformFn,
|
|
1264
1277
|
method: config.method,
|
package/dist/index.cjs
CHANGED
|
@@ -4514,6 +4514,8 @@ const BUCKET_ENDPOINTS = {
|
|
|
4514
4514
|
GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
|
|
4515
4515
|
GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
|
|
4516
4516
|
GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
|
|
4517
|
+
DELETE_FILE: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.DeleteFile`,
|
|
4518
|
+
GET_FILES: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetFiles`,
|
|
4517
4519
|
};
|
|
4518
4520
|
/**
|
|
4519
4521
|
* Orchestrator Process Service Endpoints
|
|
@@ -4639,6 +4641,12 @@ const DATA_FABRIC_ENDPOINTS = {
|
|
|
4639
4641
|
CHOICESETS: {
|
|
4640
4642
|
GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
|
|
4641
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`,
|
|
4642
4650
|
},
|
|
4643
4651
|
};
|
|
4644
4652
|
|
|
@@ -5484,7 +5492,7 @@ function normalizeBaseUrl(url) {
|
|
|
5484
5492
|
* SDK's public API.
|
|
5485
5493
|
*/
|
|
5486
5494
|
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
5487
|
-
const SDK_VERSION = '1.3.
|
|
5495
|
+
const SDK_VERSION = '1.3.10';
|
|
5488
5496
|
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
5489
5497
|
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
5490
5498
|
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|
|
@@ -6210,14 +6218,25 @@ class ApiClient {
|
|
|
6210
6218
|
if (!text) {
|
|
6211
6219
|
return undefined;
|
|
6212
6220
|
}
|
|
6213
|
-
|
|
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
|
+
}
|
|
6214
6233
|
}
|
|
6215
6234
|
catch (error) {
|
|
6216
6235
|
// If it's already one of our errors, re-throw it
|
|
6217
6236
|
if (error.type && error.type.includes('Error')) {
|
|
6218
6237
|
throw error;
|
|
6219
6238
|
}
|
|
6220
|
-
// Otherwise, it's
|
|
6239
|
+
// Otherwise, it's a genuine network/fetch failure
|
|
6221
6240
|
throw ErrorFactory.createNetworkError(error);
|
|
6222
6241
|
}
|
|
6223
6242
|
}
|
|
@@ -7113,9 +7132,9 @@ class PaginationHelpers {
|
|
|
7113
7132
|
* @returns Promise resolving to a paginated result
|
|
7114
7133
|
*/
|
|
7115
7134
|
static async getAllPaginated(params) {
|
|
7116
|
-
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;
|
|
7117
7136
|
const endpoint = getEndpoint(folderId);
|
|
7118
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
7137
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
7119
7138
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
7120
7139
|
headers,
|
|
7121
7140
|
params: additionalParams,
|
|
@@ -7143,13 +7162,13 @@ class PaginationHelpers {
|
|
|
7143
7162
|
* @returns Promise resolving to an object with data and totalCount
|
|
7144
7163
|
*/
|
|
7145
7164
|
static async getAllNonPaginated(params) {
|
|
7146
|
-
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;
|
|
7147
7166
|
// Set default field names
|
|
7148
7167
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
7149
7168
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
7150
7169
|
// Determine endpoint and headers based on folderId
|
|
7151
7170
|
const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
|
|
7152
|
-
const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
|
|
7171
|
+
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
7153
7172
|
// Make the API call based on method
|
|
7154
7173
|
let response;
|
|
7155
7174
|
if (method === HTTP_METHODS.POST) {
|
|
@@ -7208,6 +7227,7 @@ class PaginationHelpers {
|
|
|
7208
7227
|
serviceAccess: config.serviceAccess,
|
|
7209
7228
|
getEndpoint: config.getEndpoint,
|
|
7210
7229
|
folderId,
|
|
7230
|
+
headers: config.headers,
|
|
7211
7231
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
7212
7232
|
additionalParams: prefixedOptions,
|
|
7213
7233
|
transformFn: config.transformFn,
|
|
@@ -7225,6 +7245,7 @@ class PaginationHelpers {
|
|
|
7225
7245
|
getAllEndpoint: config.getEndpoint(),
|
|
7226
7246
|
getByFolderEndpoint: byFolderEndpoint,
|
|
7227
7247
|
folderId,
|
|
7248
|
+
headers: config.headers,
|
|
7228
7249
|
additionalParams: prefixedOptions,
|
|
7229
7250
|
transformFn: config.transformFn,
|
|
7230
7251
|
method: config.method,
|
|
@@ -9012,7 +9033,7 @@ class ChoiceSetService extends BaseService {
|
|
|
9012
9033
|
*
|
|
9013
9034
|
* @example
|
|
9014
9035
|
* ```typescript
|
|
9015
|
-
* import { ChoiceSets } from '@uipath/uipath-typescript/
|
|
9036
|
+
* import { ChoiceSets } from '@uipath/uipath-typescript/entities';
|
|
9016
9037
|
*
|
|
9017
9038
|
* const choiceSets = new ChoiceSets(sdk);
|
|
9018
9039
|
*
|
|
@@ -9061,6 +9082,188 @@ class ChoiceSetService extends BaseService {
|
|
|
9061
9082
|
}
|
|
9062
9083
|
}, options);
|
|
9063
9084
|
}
|
|
9085
|
+
/**
|
|
9086
|
+
* Creates a new Data Fabric choice set
|
|
9087
|
+
*
|
|
9088
|
+
* @param name - Choice set name. Must start with a
|
|
9089
|
+
* letter, may contain only letters, numbers, and underscores, length
|
|
9090
|
+
* 3–100 characters (e.g., `"expenseTypes"`).
|
|
9091
|
+
* @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions})
|
|
9092
|
+
* @returns Promise resolving to the UUID of the created choice set
|
|
9093
|
+
*
|
|
9094
|
+
* @example
|
|
9095
|
+
* ```typescript
|
|
9096
|
+
* import { ChoiceSets } from '@uipath/uipath-typescript/entities';
|
|
9097
|
+
*
|
|
9098
|
+
* const choicesets = new ChoiceSets(sdk);
|
|
9099
|
+
*
|
|
9100
|
+
* // Minimal create
|
|
9101
|
+
* const expenseTypesId = await choicesets.create("expense_types");
|
|
9102
|
+
*
|
|
9103
|
+
* // With display name and description
|
|
9104
|
+
* const priorityLevelsId = await choicesets.create("priority_levels", {
|
|
9105
|
+
* displayName: "Priority Levels",
|
|
9106
|
+
* description: "Ticket priority categories",
|
|
9107
|
+
* });
|
|
9108
|
+
* ```
|
|
9109
|
+
* @internal
|
|
9110
|
+
*/
|
|
9111
|
+
async create(name, options) {
|
|
9112
|
+
const opts = options ?? {};
|
|
9113
|
+
const payload = {
|
|
9114
|
+
...(opts.description !== undefined && { description: opts.description }),
|
|
9115
|
+
...(opts.displayName !== undefined && { displayName: opts.displayName }),
|
|
9116
|
+
entityDefinition: {
|
|
9117
|
+
name,
|
|
9118
|
+
fields: [],
|
|
9119
|
+
folderId: opts.folderKey ?? DATA_FABRIC_TENANT_FOLDER_ID,
|
|
9120
|
+
},
|
|
9121
|
+
};
|
|
9122
|
+
const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.CREATE, payload);
|
|
9123
|
+
return response.data;
|
|
9124
|
+
}
|
|
9125
|
+
/**
|
|
9126
|
+
* Updates an existing choice set's metadata (display name and/or description).
|
|
9127
|
+
*
|
|
9128
|
+
* **At least one of `displayName` or `description` must be provided** —
|
|
9129
|
+
* the call throws `ValidationError` if both are omitted.
|
|
9130
|
+
*
|
|
9131
|
+
* @param choiceSetId - UUID of the choice set to update
|
|
9132
|
+
* @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions})
|
|
9133
|
+
* @returns Promise resolving when the update is complete
|
|
9134
|
+
*
|
|
9135
|
+
* @example
|
|
9136
|
+
* ```typescript
|
|
9137
|
+
* // First, get the choice set ID using getAll()
|
|
9138
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9139
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9140
|
+
*
|
|
9141
|
+
* await choicesets.updateById(expenseTypes.id, {
|
|
9142
|
+
* displayName: "Expense Categories",
|
|
9143
|
+
* description: "Updated description",
|
|
9144
|
+
* });
|
|
9145
|
+
* ```
|
|
9146
|
+
* @internal
|
|
9147
|
+
*/
|
|
9148
|
+
async updateById(choiceSetId, options) {
|
|
9149
|
+
if (options.displayName === undefined && options.description === undefined) {
|
|
9150
|
+
throw new ValidationError({
|
|
9151
|
+
message: 'updateById requires at least one of displayName or description.',
|
|
9152
|
+
});
|
|
9153
|
+
}
|
|
9154
|
+
await this.patch(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE(choiceSetId), {
|
|
9155
|
+
...(options.displayName !== undefined && { displayName: options.displayName }),
|
|
9156
|
+
...(options.description !== undefined && { description: options.description }),
|
|
9157
|
+
});
|
|
9158
|
+
}
|
|
9159
|
+
/**
|
|
9160
|
+
* Deletes a Data Fabric choice set and all its values.
|
|
9161
|
+
*
|
|
9162
|
+
* @param choiceSetId - UUID of the choice set to delete
|
|
9163
|
+
* @returns Promise resolving when the choice set is deleted
|
|
9164
|
+
*
|
|
9165
|
+
* @example
|
|
9166
|
+
* ```typescript
|
|
9167
|
+
* // First, get the choice set ID using getAll()
|
|
9168
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9169
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9170
|
+
*
|
|
9171
|
+
* await choicesets.deleteById(expenseTypes.id);
|
|
9172
|
+
* ```
|
|
9173
|
+
* @internal
|
|
9174
|
+
*/
|
|
9175
|
+
async deleteById(choiceSetId) {
|
|
9176
|
+
await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE(choiceSetId), {});
|
|
9177
|
+
}
|
|
9178
|
+
/**
|
|
9179
|
+
* Inserts a single value into a choice set.
|
|
9180
|
+
*
|
|
9181
|
+
* @param choiceSetId - UUID of the parent choice set
|
|
9182
|
+
* @param name - Identifier name of the new value (e.g., `"TRAVEL"`)
|
|
9183
|
+
* @param options - Optional fields ({@link ChoiceSetValueInsertOptions})
|
|
9184
|
+
* @returns Promise resolving to the inserted value ({@link ChoiceSetValueInsertResponse})
|
|
9185
|
+
*
|
|
9186
|
+
* @example
|
|
9187
|
+
* ```typescript
|
|
9188
|
+
* // First, get the choice set ID using getAll()
|
|
9189
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9190
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9191
|
+
*
|
|
9192
|
+
* const inserted = await choicesets.insertValueById(expenseTypes.id, 'TRAVEL', {
|
|
9193
|
+
* displayName: 'Travel',
|
|
9194
|
+
* });
|
|
9195
|
+
* console.log(inserted.id);
|
|
9196
|
+
* ```
|
|
9197
|
+
* @internal
|
|
9198
|
+
*/
|
|
9199
|
+
async insertValueById(choiceSetId, name, options) {
|
|
9200
|
+
const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
|
|
9201
|
+
const payload = {
|
|
9202
|
+
Name: name,
|
|
9203
|
+
...(options?.displayName !== undefined && { DisplayName: options.displayName }),
|
|
9204
|
+
};
|
|
9205
|
+
const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.INSERT_BY_NAME(choiceSetName), payload);
|
|
9206
|
+
const camelCased = pascalToCamelCaseKeys(response.data);
|
|
9207
|
+
return transformData(camelCased, EntityMap);
|
|
9208
|
+
}
|
|
9209
|
+
/**
|
|
9210
|
+
* Updates an existing choice-set value's display name.
|
|
9211
|
+
*
|
|
9212
|
+
* Only `displayName` is mutable; the value's `name` (identifier) is fixed at
|
|
9213
|
+
* insert time and cannot be changed.
|
|
9214
|
+
*
|
|
9215
|
+
* @param choiceSetId - UUID of the parent choice set
|
|
9216
|
+
* @param valueId - UUID of the value to update
|
|
9217
|
+
* @param displayName - New human-readable display name for the value
|
|
9218
|
+
* @returns Promise resolving to the updated value ({@link ChoiceSetValueUpdateResponse})
|
|
9219
|
+
*
|
|
9220
|
+
* @example
|
|
9221
|
+
* ```typescript
|
|
9222
|
+
* // Get the choice set ID from getAll() and the value ID from getById()
|
|
9223
|
+
* const allChoiceSets = await choicesets.getAll();
|
|
9224
|
+
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
9225
|
+
* const values = await choicesets.getById(expenseTypes.id);
|
|
9226
|
+
* const travel = values.items.find(v => v.name === 'TRAVEL');
|
|
9227
|
+
*
|
|
9228
|
+
* await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel');
|
|
9229
|
+
* ```
|
|
9230
|
+
* @internal
|
|
9231
|
+
*/
|
|
9232
|
+
async updateValueById(choiceSetId, valueId, displayName) {
|
|
9233
|
+
const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
|
|
9234
|
+
const payload = { DisplayName: displayName };
|
|
9235
|
+
const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE_BY_NAME(choiceSetName, valueId), payload);
|
|
9236
|
+
const camelCased = pascalToCamelCaseKeys(response.data);
|
|
9237
|
+
return transformData(camelCased, EntityMap);
|
|
9238
|
+
}
|
|
9239
|
+
/**
|
|
9240
|
+
* Deletes one or more values from a choice set.
|
|
9241
|
+
*
|
|
9242
|
+
* @param choiceSetId - UUID of the parent choice set
|
|
9243
|
+
* @param valueIds - Array of value UUIDs to delete
|
|
9244
|
+
* @returns Promise resolving when the values are deleted
|
|
9245
|
+
*
|
|
9246
|
+
* @example
|
|
9247
|
+
* ```typescript
|
|
9248
|
+
* // Get the value IDs from getById()
|
|
9249
|
+
* const values = await choicesets.getById('<choiceSetId>');
|
|
9250
|
+
* const idsToDelete = values.items.slice(0, 2).map(v => v.id);
|
|
9251
|
+
*
|
|
9252
|
+
* await choicesets.deleteValuesById('<choiceSetId>', idsToDelete);
|
|
9253
|
+
* ```
|
|
9254
|
+
* @internal
|
|
9255
|
+
*/
|
|
9256
|
+
async deleteValuesById(choiceSetId, valueIds) {
|
|
9257
|
+
await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE_BY_ID(choiceSetId), valueIds);
|
|
9258
|
+
}
|
|
9259
|
+
async resolveChoiceSetName(choiceSetId) {
|
|
9260
|
+
const all = await this.getAll();
|
|
9261
|
+
const match = all.find(cs => cs.id === choiceSetId);
|
|
9262
|
+
if (!match) {
|
|
9263
|
+
throw new NotFoundError({ message: `Choice set with id '${choiceSetId}' not found.` });
|
|
9264
|
+
}
|
|
9265
|
+
return match.name;
|
|
9266
|
+
}
|
|
9064
9267
|
}
|
|
9065
9268
|
__decorate([
|
|
9066
9269
|
track('Choicesets.GetAll')
|
|
@@ -9068,6 +9271,24 @@ __decorate([
|
|
|
9068
9271
|
__decorate([
|
|
9069
9272
|
track('Choicesets.GetById')
|
|
9070
9273
|
], ChoiceSetService.prototype, "getById", null);
|
|
9274
|
+
__decorate([
|
|
9275
|
+
track('Choicesets.Create')
|
|
9276
|
+
], ChoiceSetService.prototype, "create", null);
|
|
9277
|
+
__decorate([
|
|
9278
|
+
track('Choicesets.UpdateById')
|
|
9279
|
+
], ChoiceSetService.prototype, "updateById", null);
|
|
9280
|
+
__decorate([
|
|
9281
|
+
track('Choicesets.DeleteById')
|
|
9282
|
+
], ChoiceSetService.prototype, "deleteById", null);
|
|
9283
|
+
__decorate([
|
|
9284
|
+
track('Choicesets.InsertValueById')
|
|
9285
|
+
], ChoiceSetService.prototype, "insertValueById", null);
|
|
9286
|
+
__decorate([
|
|
9287
|
+
track('Choicesets.UpdateValueById')
|
|
9288
|
+
], ChoiceSetService.prototype, "updateValueById", null);
|
|
9289
|
+
__decorate([
|
|
9290
|
+
track('Choicesets.DeleteValuesById')
|
|
9291
|
+
], ChoiceSetService.prototype, "deleteValuesById", null);
|
|
9071
9292
|
|
|
9072
9293
|
/**
|
|
9073
9294
|
* Maestro Process Models
|
|
@@ -12321,6 +12542,120 @@ class BucketService extends FolderScopedService {
|
|
|
12321
12542
|
}
|
|
12322
12543
|
return transformedData;
|
|
12323
12544
|
}
|
|
12545
|
+
/**
|
|
12546
|
+
* Lists all files in a bucket.
|
|
12547
|
+
*
|
|
12548
|
+
* Returns a flat, recursive listing of all files in the bucket. Supports regex filtering
|
|
12549
|
+
* and filter / orderby / select / expand. {@link BucketFile} entries include
|
|
12550
|
+
* `isDirectory` so callers can distinguish folders from files.
|
|
12551
|
+
*
|
|
12552
|
+
* The method returns either:
|
|
12553
|
+
* - A NonPaginatedResponse with items array (when no pagination parameters are provided)
|
|
12554
|
+
* - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
|
|
12555
|
+
*
|
|
12556
|
+
* @param bucketId - The ID of the bucket
|
|
12557
|
+
* @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) and optional parameters for regex filtering, query options, and pagination
|
|
12558
|
+
* @returns Promise resolving to either an array of files NonPaginatedResponse<BucketFile> or a PaginatedResponse<BucketFile> when pagination options are used.
|
|
12559
|
+
*
|
|
12560
|
+
* @example
|
|
12561
|
+
* ```typescript
|
|
12562
|
+
* import { Buckets } from '@uipath/uipath-typescript/buckets';
|
|
12563
|
+
*
|
|
12564
|
+
* const buckets = new Buckets(sdk);
|
|
12565
|
+
*
|
|
12566
|
+
* // List all files in the bucket
|
|
12567
|
+
* const files = await buckets.getFiles(<bucketId>, { folderId: <folderId> });
|
|
12568
|
+
*
|
|
12569
|
+
* // Filter by regex pattern
|
|
12570
|
+
* const pdfs = await buckets.getFiles(<bucketId>, {
|
|
12571
|
+
* folderId: <folderId>,
|
|
12572
|
+
* fileNameRegex: '.*\\.pdf$'
|
|
12573
|
+
* });
|
|
12574
|
+
*
|
|
12575
|
+
* // First page with pagination
|
|
12576
|
+
* const page1 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, pageSize: 10 });
|
|
12577
|
+
*
|
|
12578
|
+
* // Navigate using cursor
|
|
12579
|
+
* if (page1.hasNextPage) {
|
|
12580
|
+
* const page2 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, cursor: page1.nextCursor });
|
|
12581
|
+
* }
|
|
12582
|
+
*
|
|
12583
|
+
* // Jump to specific page
|
|
12584
|
+
* const page5 = await buckets.getFiles(<bucketId>, {
|
|
12585
|
+
* folderId: <folderId>,
|
|
12586
|
+
* jumpToPage: 5,
|
|
12587
|
+
* pageSize: 10
|
|
12588
|
+
* });
|
|
12589
|
+
* ```
|
|
12590
|
+
*/
|
|
12591
|
+
async getFiles(bucketId, options) {
|
|
12592
|
+
if (!bucketId) {
|
|
12593
|
+
throw new ValidationError({ message: 'bucketId is required for getFiles' });
|
|
12594
|
+
}
|
|
12595
|
+
const { folderId, folderKey, folderPath, ...restOptions } = options ?? {};
|
|
12596
|
+
const headers = resolveFolderHeaders({
|
|
12597
|
+
folderId,
|
|
12598
|
+
folderKey,
|
|
12599
|
+
folderPath,
|
|
12600
|
+
resourceType: 'Buckets.getFiles',
|
|
12601
|
+
fallbackFolderKey: this.config.folderKey,
|
|
12602
|
+
});
|
|
12603
|
+
const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
|
|
12604
|
+
return PaginationHelpers.getAll({
|
|
12605
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
12606
|
+
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
|
|
12607
|
+
transformFn: transformBucketFile,
|
|
12608
|
+
pagination: {
|
|
12609
|
+
paginationType: PaginationType.OFFSET,
|
|
12610
|
+
itemsField: ODATA_PAGINATION.ITEMS_FIELD,
|
|
12611
|
+
totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
|
|
12612
|
+
paginationParams: {
|
|
12613
|
+
pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
12614
|
+
offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
|
|
12615
|
+
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
|
|
12616
|
+
},
|
|
12617
|
+
},
|
|
12618
|
+
excludeFromPrefix: ['directory', 'recursive', 'fileNameRegex'],
|
|
12619
|
+
headers,
|
|
12620
|
+
}, { ...restOptions, directory: '/', recursive: true });
|
|
12621
|
+
}
|
|
12622
|
+
/**
|
|
12623
|
+
* Deletes a file from a bucket
|
|
12624
|
+
*
|
|
12625
|
+
* @param bucketId - The ID of the bucket
|
|
12626
|
+
* @param path - The full path to the file to delete
|
|
12627
|
+
* @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`)
|
|
12628
|
+
* @returns Promise resolving when the file is deleted
|
|
12629
|
+
*
|
|
12630
|
+
* @example
|
|
12631
|
+
* ```typescript
|
|
12632
|
+
* import { Buckets } from '@uipath/uipath-typescript/buckets';
|
|
12633
|
+
*
|
|
12634
|
+
* const buckets = new Buckets(sdk);
|
|
12635
|
+
*
|
|
12636
|
+
* // Delete a file from a bucket
|
|
12637
|
+
* await buckets.deleteFile(<bucketId>, '/folder/file.pdf', { folderId: <folderId> });
|
|
12638
|
+
* ```
|
|
12639
|
+
*/
|
|
12640
|
+
async deleteFile(bucketId, path, options) {
|
|
12641
|
+
if (!bucketId) {
|
|
12642
|
+
throw new ValidationError({ message: 'bucketId is required for deleteFile' });
|
|
12643
|
+
}
|
|
12644
|
+
if (!path) {
|
|
12645
|
+
throw new ValidationError({ message: 'path is required for deleteFile' });
|
|
12646
|
+
}
|
|
12647
|
+
const headers = resolveFolderHeaders({
|
|
12648
|
+
folderId: options?.folderId,
|
|
12649
|
+
folderKey: options?.folderKey,
|
|
12650
|
+
folderPath: options?.folderPath,
|
|
12651
|
+
resourceType: 'Buckets.deleteFile',
|
|
12652
|
+
fallbackFolderKey: this.config.folderKey,
|
|
12653
|
+
});
|
|
12654
|
+
await this.delete(BUCKET_ENDPOINTS.DELETE_FILE(bucketId), {
|
|
12655
|
+
params: { path },
|
|
12656
|
+
headers,
|
|
12657
|
+
});
|
|
12658
|
+
}
|
|
12324
12659
|
/**
|
|
12325
12660
|
* Gets a direct upload URL for a file in the bucket
|
|
12326
12661
|
*
|
|
@@ -12354,6 +12689,12 @@ __decorate([
|
|
|
12354
12689
|
__decorate([
|
|
12355
12690
|
track('Buckets.GetReadUri')
|
|
12356
12691
|
], BucketService.prototype, "getReadUri", null);
|
|
12692
|
+
__decorate([
|
|
12693
|
+
track('Buckets.GetFiles')
|
|
12694
|
+
], BucketService.prototype, "getFiles", null);
|
|
12695
|
+
__decorate([
|
|
12696
|
+
track('Buckets.DeleteFile')
|
|
12697
|
+
], BucketService.prototype, "deleteFile", null);
|
|
12357
12698
|
|
|
12358
12699
|
exports.BucketOptions = void 0;
|
|
12359
12700
|
(function (BucketOptions) {
|
|
@@ -13151,33 +13492,32 @@ class ProcessService extends FolderScopedService {
|
|
|
13151
13492
|
}
|
|
13152
13493
|
}, options);
|
|
13153
13494
|
}
|
|
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
|
-
|
|
13179
|
-
|
|
13180
|
-
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
13495
|
+
async start(request, optionsOrFolderId, legacyOptions) {
|
|
13496
|
+
// Normalize the two overload forms into a single internal shape.
|
|
13497
|
+
let folderId;
|
|
13498
|
+
let folderKey;
|
|
13499
|
+
let folderPath;
|
|
13500
|
+
let queryOptions;
|
|
13501
|
+
if (typeof optionsOrFolderId === 'number') {
|
|
13502
|
+
// Deprecated positional form: start(request, folderId, options?)
|
|
13503
|
+
folderId = optionsOrFolderId;
|
|
13504
|
+
queryOptions = legacyOptions ?? {};
|
|
13505
|
+
}
|
|
13506
|
+
else {
|
|
13507
|
+
// Preferred form: start(request, options?)
|
|
13508
|
+
const { folderId: fid, folderKey: fkey, folderPath: fpath, ...rest } = optionsOrFolderId ?? {};
|
|
13509
|
+
folderId = fid;
|
|
13510
|
+
folderKey = fkey;
|
|
13511
|
+
folderPath = fpath;
|
|
13512
|
+
queryOptions = rest;
|
|
13513
|
+
}
|
|
13514
|
+
const headers = resolveFolderHeaders({
|
|
13515
|
+
folderId,
|
|
13516
|
+
folderKey,
|
|
13517
|
+
folderPath,
|
|
13518
|
+
resourceType: 'processes.start',
|
|
13519
|
+
fallbackFolderKey: this.config.folderKey,
|
|
13520
|
+
});
|
|
13181
13521
|
// Transform SDK field names to API field names (e.g., processKey → releaseKey)
|
|
13182
13522
|
const apiRequest = transformRequest(request, ProcessMap);
|
|
13183
13523
|
// Create the request object according to API spec
|
|
@@ -13185,8 +13525,8 @@ class ProcessService extends FolderScopedService {
|
|
|
13185
13525
|
startInfo: apiRequest
|
|
13186
13526
|
};
|
|
13187
13527
|
// Prefix all query parameter keys with '$' for OData
|
|
13188
|
-
const keysToPrefix = Object.keys(
|
|
13189
|
-
const apiOptions = addPrefixToKeys(
|
|
13528
|
+
const keysToPrefix = Object.keys(queryOptions);
|
|
13529
|
+
const apiOptions = addPrefixToKeys(queryOptions, ODATA_PREFIX, keysToPrefix);
|
|
13190
13530
|
const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
|
|
13191
13531
|
params: apiOptions,
|
|
13192
13532
|
headers
|