@uipath/conversational-tool 1.197.0 → 1.198.0-preview.80
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/tool.js +644 -177
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -34884,16 +34884,16 @@ function createHeaders2(headersObj) {
|
|
|
34884
34884
|
return headers;
|
|
34885
34885
|
}
|
|
34886
34886
|
function transformData2(data, fieldMapping) {
|
|
34887
|
+
if (data == null) {
|
|
34888
|
+
return data;
|
|
34889
|
+
}
|
|
34887
34890
|
if (Array.isArray(data)) {
|
|
34888
34891
|
return data.map((item) => transformData2(item, fieldMapping));
|
|
34889
34892
|
}
|
|
34890
|
-
const result = {
|
|
34891
|
-
for (const [
|
|
34892
|
-
|
|
34893
|
-
|
|
34894
|
-
delete result[sourceField];
|
|
34895
|
-
result[targetField] = value2;
|
|
34896
|
-
}
|
|
34893
|
+
const result = {};
|
|
34894
|
+
for (const [key, value2] of Object.entries(data)) {
|
|
34895
|
+
const renamedKey = fieldMapping[key] ?? key;
|
|
34896
|
+
result[renamedKey] = value2;
|
|
34897
34897
|
}
|
|
34898
34898
|
return result;
|
|
34899
34899
|
}
|
|
@@ -36717,6 +36717,7 @@ var init_conversational_agent = __esm(() => {
|
|
|
36717
36717
|
this.startEventMaybe = startEventMaybe;
|
|
36718
36718
|
this._endHandlers = new Array;
|
|
36719
36719
|
this._confirmHandlers = new Array;
|
|
36720
|
+
this._executingHandlers = new Array;
|
|
36720
36721
|
this.addStartEventTimestamp(startEventMaybe);
|
|
36721
36722
|
}
|
|
36722
36723
|
get startEvent() {
|
|
@@ -36765,6 +36766,14 @@ var init_conversational_agent = __esm(() => {
|
|
|
36765
36766
|
this.assertNotEnded();
|
|
36766
36767
|
this.emit({ confirmToolCall });
|
|
36767
36768
|
}
|
|
36769
|
+
onExecutingToolCall(cb) {
|
|
36770
|
+
this._executingHandlers.push(cb);
|
|
36771
|
+
return () => {
|
|
36772
|
+
const index = this._executingHandlers.indexOf(cb);
|
|
36773
|
+
if (index >= 0)
|
|
36774
|
+
this._executingHandlers.splice(index, 1);
|
|
36775
|
+
};
|
|
36776
|
+
}
|
|
36768
36777
|
sendErrorStart(args) {
|
|
36769
36778
|
this.assertNotEnded();
|
|
36770
36779
|
const { errorId: providedId, ...startError } = args;
|
|
@@ -36833,6 +36842,9 @@ var init_conversational_agent = __esm(() => {
|
|
|
36833
36842
|
if (toolCallEvent.confirmToolCall) {
|
|
36834
36843
|
this._confirmHandlers.forEach((cb) => cb(toolCallEvent.confirmToolCall));
|
|
36835
36844
|
}
|
|
36845
|
+
if (toolCallEvent.executingToolCall) {
|
|
36846
|
+
this._executingHandlers.forEach((cb) => cb(toolCallEvent.executingToolCall));
|
|
36847
|
+
}
|
|
36836
36848
|
if (toolCallEvent.endToolCall) {
|
|
36837
36849
|
this.setEnded();
|
|
36838
36850
|
this._endHandlers.forEach((cb) => cb(toolCallEvent.endToolCall));
|
|
@@ -38301,7 +38313,7 @@ var init_conversational_agent = __esm(() => {
|
|
|
38301
38313
|
var package_default = {
|
|
38302
38314
|
name: "@uipath/conversational-tool",
|
|
38303
38315
|
license: "MIT",
|
|
38304
|
-
version: "1.
|
|
38316
|
+
version: "1.198.0-preview.80",
|
|
38305
38317
|
description: "Handle conversations with deployed UiPath conversational processes.",
|
|
38306
38318
|
type: "module",
|
|
38307
38319
|
main: "./dist/tool.js",
|
|
@@ -38327,7 +38339,7 @@ var package_default = {
|
|
|
38327
38339
|
"@uipath/common": "workspace:*",
|
|
38328
38340
|
"@uipath/auth": "workspace:*",
|
|
38329
38341
|
"@uipath/filesystem": "workspace:*",
|
|
38330
|
-
"@uipath/uipath-typescript": "^1.
|
|
38342
|
+
"@uipath/uipath-typescript": "^1.5.2",
|
|
38331
38343
|
"@types/node": "^25.5.2",
|
|
38332
38344
|
typescript: "^6.0.2"
|
|
38333
38345
|
}
|
|
@@ -43394,6 +43406,7 @@ function getLogFilePath() {
|
|
|
43394
43406
|
// ../common/src/output-format-context.ts
|
|
43395
43407
|
var formatSlot = singleton("OutputFormat");
|
|
43396
43408
|
var formatExplicitSlot = singleton("OutputFormatExplicit");
|
|
43409
|
+
var helpRequestedSlot = singleton("HelpRequested");
|
|
43397
43410
|
var filterSlot = singleton("OutputFilter");
|
|
43398
43411
|
function getOutputFormat() {
|
|
43399
43412
|
return formatSlot.get("json");
|
|
@@ -44461,6 +44474,9 @@ var OutputFormatter;
|
|
|
44461
44474
|
if (opts?.warning) {
|
|
44462
44475
|
data.Warning = opts.warning;
|
|
44463
44476
|
}
|
|
44477
|
+
if (opts?.pagination) {
|
|
44478
|
+
data.Pagination = opts.pagination;
|
|
44479
|
+
}
|
|
44464
44480
|
success(data);
|
|
44465
44481
|
}
|
|
44466
44482
|
OutputFormatter.emitList = emitList;
|
|
@@ -44922,6 +44938,7 @@ var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
|
44922
44938
|
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
44923
44939
|
// ../common/src/interactivity-context.ts
|
|
44924
44940
|
var modeSlot = singleton("InteractivityMode");
|
|
44941
|
+
var interactiveFlagSlot = singleton("InteractiveFlag");
|
|
44925
44942
|
function getInteractivityMode() {
|
|
44926
44943
|
return modeSlot.get("auto") ?? "auto";
|
|
44927
44944
|
}
|
|
@@ -46177,6 +46194,10 @@ function normalizeTokenRefreshUnavailableFailure() {
|
|
|
46177
46194
|
function errorMessage(error) {
|
|
46178
46195
|
return error instanceof Error ? error.message : String(error);
|
|
46179
46196
|
}
|
|
46197
|
+
|
|
46198
|
+
// ../auth/src/index.ts
|
|
46199
|
+
init_constants();
|
|
46200
|
+
|
|
46180
46201
|
// ../auth/src/interactive.ts
|
|
46181
46202
|
init_src();
|
|
46182
46203
|
|
|
@@ -50165,7 +50186,8 @@ var MAESTRO_ENDPOINTS = {
|
|
|
50165
50186
|
GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
|
|
50166
50187
|
CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
|
|
50167
50188
|
PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
|
|
50168
|
-
RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume
|
|
50189
|
+
RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
|
|
50190
|
+
RETRY: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/retry`
|
|
50169
50191
|
},
|
|
50170
50192
|
INCIDENTS: {
|
|
50171
50193
|
GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
|
|
@@ -50188,7 +50210,9 @@ var MAESTRO_ENDPOINTS = {
|
|
|
50188
50210
|
TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
|
|
50189
50211
|
INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
|
|
50190
50212
|
TOP_PROCESSES_BY_DURATION: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByDuration`,
|
|
50191
|
-
|
|
50213
|
+
INSTANCE_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceCountByStatus`,
|
|
50214
|
+
ELEMENT_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/ElementCountByStatus`,
|
|
50215
|
+
INCIDENTS_BY_TIME_WINDOW: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/IncidentsByTimeWindow`
|
|
50192
50216
|
}
|
|
50193
50217
|
};
|
|
50194
50218
|
var DATA_FABRIC_TENANT_FOLDER_ID = "00000000-0000-0000-0000-000000000000";
|
|
@@ -50198,7 +50222,7 @@ var DATA_FABRIC_ENDPOINTS = {
|
|
|
50198
50222
|
GET_ALL_V2: `${DATAFABRIC_BASE}/api/v2/Entity`,
|
|
50199
50223
|
GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
|
|
50200
50224
|
GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
|
|
50201
|
-
GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
|
|
50225
|
+
GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/v2/EntityService/entity/${entityId}/read/${recordId}`,
|
|
50202
50226
|
INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
|
|
50203
50227
|
BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
|
|
50204
50228
|
UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
|
|
@@ -50223,6 +50247,14 @@ var DATA_FABRIC_ENDPOINTS = {
|
|
|
50223
50247
|
INSERT_BY_NAME: (choiceSetName) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/insert`,
|
|
50224
50248
|
UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
|
|
50225
50249
|
DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`
|
|
50250
|
+
},
|
|
50251
|
+
ROLES: {
|
|
50252
|
+
GET_ALL: `${DATAFABRIC_BASE}/api/v2/Role`
|
|
50253
|
+
},
|
|
50254
|
+
DIRECTORY: {
|
|
50255
|
+
GET_ALL: `${DATAFABRIC_BASE}/api/Directory`,
|
|
50256
|
+
ASSIGN_ROLES: `${DATAFABRIC_BASE}/api/Directory/Role`,
|
|
50257
|
+
REVOKE_ROLES: `${DATAFABRIC_BASE}/api/Directory/RevokeRole`
|
|
50226
50258
|
}
|
|
50227
50259
|
};
|
|
50228
50260
|
var IDENTITY_ENDPOINTS = {
|
|
@@ -50443,7 +50475,7 @@ class EmbeddedTokenManager {
|
|
|
50443
50475
|
this.cancelRefresh?.();
|
|
50444
50476
|
}
|
|
50445
50477
|
}
|
|
50446
|
-
var SDK_VERSION = "1.
|
|
50478
|
+
var SDK_VERSION = "1.5.2";
|
|
50447
50479
|
var CLOUD_ROLE_NAME = "uipath-ts-sdk";
|
|
50448
50480
|
var SDK_SERVICE_NAME = "UiPath.TypeScript.Sdk";
|
|
50449
50481
|
var SDK_LOGGER_NAME = "uipath-ts-sdk-telemetry";
|
|
@@ -51697,16 +51729,16 @@ function toISOUtc(value) {
|
|
|
51697
51729
|
return isNaN(date2.getTime()) ? value : date2.toISOString();
|
|
51698
51730
|
}
|
|
51699
51731
|
function transformData(data, fieldMapping) {
|
|
51732
|
+
if (data == null) {
|
|
51733
|
+
return data;
|
|
51734
|
+
}
|
|
51700
51735
|
if (Array.isArray(data)) {
|
|
51701
51736
|
return data.map((item) => transformData(item, fieldMapping));
|
|
51702
51737
|
}
|
|
51703
|
-
const result = {
|
|
51704
|
-
for (const [
|
|
51705
|
-
|
|
51706
|
-
|
|
51707
|
-
delete result[sourceField];
|
|
51708
|
-
result[targetField] = value;
|
|
51709
|
-
}
|
|
51738
|
+
const result = {};
|
|
51739
|
+
for (const [key, value] of Object.entries(data)) {
|
|
51740
|
+
const renamedKey = fieldMapping[key] ?? key;
|
|
51741
|
+
result[renamedKey] = value;
|
|
51710
51742
|
}
|
|
51711
51743
|
return result;
|
|
51712
51744
|
}
|
|
@@ -51791,6 +51823,26 @@ function transformRequest(data, responseMap) {
|
|
|
51791
51823
|
}
|
|
51792
51824
|
return result;
|
|
51793
51825
|
}
|
|
51826
|
+
var ODATA_FIELD_PARAM_KEYS = ["filter", "orderby", "select", "expand"];
|
|
51827
|
+
var ODATA_TOKEN_RE = /'(?:[^']|'')*'|[A-Za-z_][A-Za-z0-9_]*/g;
|
|
51828
|
+
function rewriteODataIdentifiers(expression, requestMap) {
|
|
51829
|
+
if (!expression)
|
|
51830
|
+
return expression;
|
|
51831
|
+
return expression.replace(ODATA_TOKEN_RE, (match) => match.startsWith("'") ? match : requestMap[match] ?? match);
|
|
51832
|
+
}
|
|
51833
|
+
function transformOptions(options, responseMap) {
|
|
51834
|
+
const requestMap = reverseMap(responseMap);
|
|
51835
|
+
if (Object.keys(requestMap).length === 0)
|
|
51836
|
+
return options;
|
|
51837
|
+
const result = { ...options };
|
|
51838
|
+
for (const key of ODATA_FIELD_PARAM_KEYS) {
|
|
51839
|
+
const value = result[key];
|
|
51840
|
+
if (typeof value === "string") {
|
|
51841
|
+
result[key] = rewriteODataIdentifiers(value, requestMap);
|
|
51842
|
+
}
|
|
51843
|
+
}
|
|
51844
|
+
return result;
|
|
51845
|
+
}
|
|
51794
51846
|
function arrayDictionaryToRecord(dictionary) {
|
|
51795
51847
|
if (!dictionary || !dictionary.keys || !dictionary.values) {
|
|
51796
51848
|
return {};
|
|
@@ -52276,6 +52328,7 @@ var EntityFieldDataType;
|
|
|
52276
52328
|
EntityFieldDataType2["BOOLEAN"] = "BOOLEAN";
|
|
52277
52329
|
EntityFieldDataType2["BIG_INTEGER"] = "BIG_INTEGER";
|
|
52278
52330
|
EntityFieldDataType2["MULTILINE_TEXT"] = "MULTILINE_TEXT";
|
|
52331
|
+
EntityFieldDataType2["MULTILINE_MAX"] = "MULTILINE_MAX";
|
|
52279
52332
|
EntityFieldDataType2["FILE"] = "FILE";
|
|
52280
52333
|
EntityFieldDataType2["CHOICE_SET_SINGLE"] = "CHOICE_SET_SINGLE";
|
|
52281
52334
|
EntityFieldDataType2["CHOICE_SET_MULTIPLE"] = "CHOICE_SET_MULTIPLE";
|
|
@@ -52369,10 +52422,12 @@ var SqlFieldType;
|
|
|
52369
52422
|
SqlFieldType2["BIT"] = "BIT";
|
|
52370
52423
|
SqlFieldType2["DECIMAL"] = "DECIMAL";
|
|
52371
52424
|
SqlFieldType2["MULTILINE"] = "MULTILINE";
|
|
52425
|
+
SqlFieldType2["MULTILINE_MAX"] = "MULTILINE_MAX";
|
|
52372
52426
|
})(SqlFieldType || (SqlFieldType = {}));
|
|
52373
52427
|
var ENTITY_TYPE_IDS = {
|
|
52374
52428
|
[EntityType.ChoiceSet]: 1
|
|
52375
52429
|
};
|
|
52430
|
+
var MAX_QUERY_JOINS = 3;
|
|
52376
52431
|
var EntityMap = {
|
|
52377
52432
|
createTime: "createdTime",
|
|
52378
52433
|
updateTime: "updatedTime",
|
|
@@ -52392,6 +52447,7 @@ var EntitySchemaFieldTypeMap = {
|
|
|
52392
52447
|
[EntityFieldDataType.BOOLEAN]: { sqlTypeName: SqlFieldType.BIT, fieldDisplayType: FieldDisplayType.Basic },
|
|
52393
52448
|
[EntityFieldDataType.BIG_INTEGER]: { sqlTypeName: SqlFieldType.BIGINT, fieldDisplayType: FieldDisplayType.Basic },
|
|
52394
52449
|
[EntityFieldDataType.MULTILINE_TEXT]: { sqlTypeName: SqlFieldType.MULTILINE, fieldDisplayType: FieldDisplayType.Basic },
|
|
52450
|
+
[EntityFieldDataType.MULTILINE_MAX]: { sqlTypeName: SqlFieldType.MULTILINE_MAX, fieldDisplayType: FieldDisplayType.Basic },
|
|
52395
52451
|
[EntityFieldDataType.FILE]: { sqlTypeName: SqlFieldType.UNIQUEIDENTIFIER, fieldDisplayType: FieldDisplayType.File },
|
|
52396
52452
|
[EntityFieldDataType.CHOICE_SET_SINGLE]: { sqlTypeName: SqlFieldType.INT, fieldDisplayType: FieldDisplayType.ChoiceSetSingle },
|
|
52397
52453
|
[EntityFieldDataType.CHOICE_SET_MULTIPLE]: { sqlTypeName: SqlFieldType.NVARCHAR, fieldDisplayType: FieldDisplayType.ChoiceSetMultiple },
|
|
@@ -52408,6 +52464,7 @@ var FieldDisplayTypeToDataType = {
|
|
|
52408
52464
|
var ENTITY_FIELD_CONSTRAINT_DEFAULTS = {
|
|
52409
52465
|
STRING_LENGTH_LIMIT: 200,
|
|
52410
52466
|
MULTILINE_TEXT_LENGTH_LIMIT: 200,
|
|
52467
|
+
MULTILINE_MAX_LENGTH_LIMIT: 128 * 1024,
|
|
52411
52468
|
DECIMAL_LENGTH_LIMIT: 1000,
|
|
52412
52469
|
DECIMAL_PRECISION: 2,
|
|
52413
52470
|
BOOLEAN_LENGTH_LIMIT: 100,
|
|
@@ -52424,6 +52481,9 @@ var ENTITY_FIELD_CONSTRAINT_SPEC = {
|
|
|
52424
52481
|
[EntityFieldDataType.MULTILINE_TEXT]: {
|
|
52425
52482
|
[EntityFieldConstraint.LengthLimit]: { min: 1, max: 1e4 }
|
|
52426
52483
|
},
|
|
52484
|
+
[EntityFieldDataType.MULTILINE_MAX]: {
|
|
52485
|
+
[EntityFieldConstraint.LengthLimit]: { min: 1, max: 128 * 1024 }
|
|
52486
|
+
},
|
|
52427
52487
|
[EntityFieldDataType.INTEGER]: {
|
|
52428
52488
|
[EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
|
|
52429
52489
|
[EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER }
|
|
@@ -52460,7 +52520,8 @@ var EntityFieldTypeMap = {
|
|
|
52460
52520
|
[SqlFieldType.DATE]: EntityFieldDataType.DATE,
|
|
52461
52521
|
[SqlFieldType.BIT]: EntityFieldDataType.BOOLEAN,
|
|
52462
52522
|
[SqlFieldType.DECIMAL]: EntityFieldDataType.DECIMAL,
|
|
52463
|
-
[SqlFieldType.MULTILINE]: EntityFieldDataType.MULTILINE_TEXT
|
|
52523
|
+
[SqlFieldType.MULTILINE]: EntityFieldDataType.MULTILINE_TEXT,
|
|
52524
|
+
[SqlFieldType.MULTILINE_MAX]: EntityFieldDataType.MULTILINE_MAX
|
|
52464
52525
|
};
|
|
52465
52526
|
|
|
52466
52527
|
class EntityService extends BaseService {
|
|
@@ -52563,6 +52624,11 @@ class EntityService extends BaseService {
|
|
|
52563
52624
|
return entities;
|
|
52564
52625
|
}
|
|
52565
52626
|
async queryRecordsById(id, options) {
|
|
52627
|
+
if (options?.joins && options.joins.length > MAX_QUERY_JOINS) {
|
|
52628
|
+
throw new ValidationError({
|
|
52629
|
+
message: `A maximum of ${MAX_QUERY_JOINS} joins is supported per query (received ${options.joins.length})`
|
|
52630
|
+
});
|
|
52631
|
+
}
|
|
52566
52632
|
const { folderKey, expansionLevel, ...rest } = options ?? {};
|
|
52567
52633
|
const downstreamOptions = options === undefined ? undefined : rest;
|
|
52568
52634
|
return PaginationHelpers.getAll({
|
|
@@ -52581,7 +52647,7 @@ class EntityService extends BaseService {
|
|
|
52581
52647
|
countParam: ENTITY_OFFSET_PARAMS.COUNT_PARAM
|
|
52582
52648
|
}
|
|
52583
52649
|
},
|
|
52584
|
-
excludeFromPrefix: ["filterGroup", "selectedFields", "sortOptions", "aggregates", "groupBy"]
|
|
52650
|
+
excludeFromPrefix: ["filterGroup", "selectedFields", "sortOptions", "aggregates", "groupBy", "joins"]
|
|
52585
52651
|
}, downstreamOptions);
|
|
52586
52652
|
}
|
|
52587
52653
|
async importRecordsById(id, file, options) {
|
|
@@ -52811,7 +52877,7 @@ class EntityService extends BaseService {
|
|
|
52811
52877
|
this.validateFieldConstraints(fieldType, field, field.fieldName);
|
|
52812
52878
|
const isRelationship = fieldType === EntityFieldDataType.RELATIONSHIP;
|
|
52813
52879
|
const isFile = fieldType === EntityFieldDataType.FILE;
|
|
52814
|
-
if (
|
|
52880
|
+
if (isRelationship && (!field.referenceEntityId || !field.referenceFieldId)) {
|
|
52815
52881
|
throw new ValidationError({
|
|
52816
52882
|
message: `Field '${field.fieldName}' of type ${fieldType} requires both referenceEntityId and referenceFieldId (UUIDs of the target entity and field).`
|
|
52817
52883
|
});
|
|
@@ -52837,9 +52903,9 @@ class EntityService extends BaseService {
|
|
|
52837
52903
|
...field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId },
|
|
52838
52904
|
...(isRelationship || isFile) && { isForeignKey: true },
|
|
52839
52905
|
...isRelationship && { referenceType: ReferenceType.ManyToOne },
|
|
52840
|
-
|
|
52906
|
+
...!isFile && referenceEntityBody !== undefined && { referenceEntity: referenceEntityBody },
|
|
52841
52907
|
...referenceChoiceSetBody !== undefined && { referenceChoiceSet: referenceChoiceSetBody },
|
|
52842
|
-
|
|
52908
|
+
...!isFile && field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }
|
|
52843
52909
|
};
|
|
52844
52910
|
}
|
|
52845
52911
|
resolveFieldDataType(f) {
|
|
@@ -52884,6 +52950,8 @@ class EntityService extends BaseService {
|
|
|
52884
52950
|
return { lengthLimit: field.lengthLimit ?? defaults.STRING_LENGTH_LIMIT };
|
|
52885
52951
|
case EntityFieldDataType.MULTILINE_TEXT:
|
|
52886
52952
|
return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_TEXT_LENGTH_LIMIT };
|
|
52953
|
+
case EntityFieldDataType.MULTILINE_MAX:
|
|
52954
|
+
return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_MAX_LENGTH_LIMIT };
|
|
52887
52955
|
case EntityFieldDataType.DECIMAL:
|
|
52888
52956
|
return {
|
|
52889
52957
|
lengthLimit: defaults.DECIMAL_LENGTH_LIMIT,
|
|
@@ -53090,143 +53158,300 @@ __decorate([
|
|
|
53090
53158
|
__decorate([
|
|
53091
53159
|
track("Choicesets.DeleteValuesById")
|
|
53092
53160
|
], ChoiceSetService.prototype, "deleteValuesById", null);
|
|
53093
|
-
|
|
53161
|
+
var DataFabricRoleType;
|
|
53162
|
+
(function(DataFabricRoleType2) {
|
|
53163
|
+
DataFabricRoleType2["System"] = "System";
|
|
53164
|
+
DataFabricRoleType2["UserDefined"] = "UserDefined";
|
|
53165
|
+
})(DataFabricRoleType || (DataFabricRoleType = {}));
|
|
53166
|
+
function isRecord$1(value) {
|
|
53167
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
53168
|
+
}
|
|
53169
|
+
function isDataFabricRole(value) {
|
|
53170
|
+
if (!isRecord$1(value)) {
|
|
53171
|
+
return false;
|
|
53172
|
+
}
|
|
53173
|
+
const { id, name, type, directoryEntityCount, folderId } = value;
|
|
53174
|
+
const hasValidDirectoryEntityCount = directoryEntityCount === undefined || directoryEntityCount === null || typeof directoryEntityCount === "number";
|
|
53175
|
+
const hasValidFolderId = folderId === undefined || typeof folderId === "string";
|
|
53176
|
+
return typeof id === "string" && typeof name === "string" && (type === DataFabricRoleType.System || type === DataFabricRoleType.UserDefined) && hasValidDirectoryEntityCount && hasValidFolderId;
|
|
53177
|
+
}
|
|
53178
|
+
function validateRolesResponse(data) {
|
|
53179
|
+
if (Array.isArray(data) && data.every(isDataFabricRole)) {
|
|
53180
|
+
return data;
|
|
53181
|
+
}
|
|
53182
|
+
throw new ServerError({
|
|
53183
|
+
message: "Invalid Data Fabric roles response format."
|
|
53184
|
+
});
|
|
53185
|
+
}
|
|
53186
|
+
|
|
53187
|
+
class DataFabricRoleService extends BaseService {
|
|
53188
|
+
async getAll(options = {}) {
|
|
53189
|
+
const params = createParams({
|
|
53190
|
+
stats: options.stats ?? true
|
|
53191
|
+
});
|
|
53192
|
+
const headers = createHeaders({ [FOLDER_KEY]: options.folderKey });
|
|
53193
|
+
const response = await this.get(DATA_FABRIC_ENDPOINTS.ROLES.GET_ALL, { params, headers });
|
|
53194
|
+
return validateRolesResponse(response.data);
|
|
53195
|
+
}
|
|
53196
|
+
}
|
|
53197
|
+
__decorate([
|
|
53198
|
+
track("DataFabricRoles.GetAll")
|
|
53199
|
+
], DataFabricRoleService.prototype, "getAll", null);
|
|
53200
|
+
var DataFabricDirectoryEntityType;
|
|
53201
|
+
(function(DataFabricDirectoryEntityType2) {
|
|
53202
|
+
DataFabricDirectoryEntityType2[DataFabricDirectoryEntityType2["User"] = 0] = "User";
|
|
53203
|
+
DataFabricDirectoryEntityType2[DataFabricDirectoryEntityType2["Group"] = 1] = "Group";
|
|
53204
|
+
DataFabricDirectoryEntityType2[DataFabricDirectoryEntityType2["Application"] = 2] = "Application";
|
|
53205
|
+
})(DataFabricDirectoryEntityType || (DataFabricDirectoryEntityType = {}));
|
|
53206
|
+
var DataFabricDirectoryEntityTypeName;
|
|
53207
|
+
(function(DataFabricDirectoryEntityTypeName2) {
|
|
53208
|
+
DataFabricDirectoryEntityTypeName2["User"] = "User";
|
|
53209
|
+
DataFabricDirectoryEntityTypeName2["Group"] = "Group";
|
|
53210
|
+
DataFabricDirectoryEntityTypeName2["Application"] = "Application";
|
|
53211
|
+
})(DataFabricDirectoryEntityTypeName || (DataFabricDirectoryEntityTypeName = {}));
|
|
53212
|
+
var DEFAULT_DIRECTORY_PAGE_SIZE = 100;
|
|
53213
|
+
var MAX_DIRECTORY_PAGE_SIZE = 100;
|
|
53214
|
+
function validateDirectoryListResponse(data) {
|
|
53215
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
53216
|
+
throw new ServerError({
|
|
53217
|
+
message: "Invalid Data Fabric directory response format."
|
|
53218
|
+
});
|
|
53219
|
+
}
|
|
53220
|
+
const response = data;
|
|
53221
|
+
if (typeof response.totalCount !== "number" || !Array.isArray(response.results)) {
|
|
53222
|
+
throw new ServerError({
|
|
53223
|
+
message: "Invalid Data Fabric directory response format."
|
|
53224
|
+
});
|
|
53225
|
+
}
|
|
53094
53226
|
return {
|
|
53095
|
-
|
|
53096
|
-
|
|
53097
|
-
throw new Error("Process key is undefined");
|
|
53098
|
-
if (!processData.folderKey)
|
|
53099
|
-
throw new Error("Folder key is undefined");
|
|
53100
|
-
return service.getIncidents(processData.processKey, processData.folderKey);
|
|
53101
|
-
},
|
|
53102
|
-
getElementStats(startTime, endTime, packageVersion) {
|
|
53103
|
-
if (!processData.processKey)
|
|
53104
|
-
throw new Error("Process key is undefined");
|
|
53105
|
-
if (!processData.packageId)
|
|
53106
|
-
throw new Error("Package ID is undefined");
|
|
53107
|
-
return service.getElementStats(processData.processKey, processData.packageId, startTime, endTime, packageVersion);
|
|
53108
|
-
}
|
|
53227
|
+
totalCount: response.totalCount,
|
|
53228
|
+
results: response.results
|
|
53109
53229
|
};
|
|
53110
53230
|
}
|
|
53111
|
-
function
|
|
53112
|
-
|
|
53113
|
-
return Object.assign({}, processData, methods);
|
|
53231
|
+
function isRecord2(value) {
|
|
53232
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
53114
53233
|
}
|
|
53115
|
-
function
|
|
53116
|
-
return
|
|
53117
|
-
|
|
53118
|
-
|
|
53119
|
-
|
|
53120
|
-
|
|
53121
|
-
|
|
53122
|
-
|
|
53123
|
-
|
|
53124
|
-
|
|
53234
|
+
function isDirectoryEntityTypeName(value) {
|
|
53235
|
+
return value === DataFabricDirectoryEntityTypeName.User || value === DataFabricDirectoryEntityTypeName.Group || value === DataFabricDirectoryEntityTypeName.Application;
|
|
53236
|
+
}
|
|
53237
|
+
function isDirectoryRole(value) {
|
|
53238
|
+
if (!isRecord2(value)) {
|
|
53239
|
+
return false;
|
|
53240
|
+
}
|
|
53241
|
+
return typeof value.id === "string" && typeof value.name === "string";
|
|
53242
|
+
}
|
|
53243
|
+
function normalizeDirectoryEntry(entry) {
|
|
53244
|
+
if (!isRecord2(entry) || typeof entry.externalId !== "string" || typeof entry.name !== "string" || !isDirectoryEntityTypeName(entry.type) || entry.email !== undefined && entry.email !== null && typeof entry.email !== "string" || entry.objectType !== undefined && entry.objectType !== null && typeof entry.objectType !== "string" || entry.isUIEnabled !== undefined && typeof entry.isUIEnabled !== "boolean" || entry.roles !== undefined && entry.roles !== null && (!Array.isArray(entry.roles) || !entry.roles.every(isDirectoryRole))) {
|
|
53245
|
+
throw new ServerError({
|
|
53246
|
+
message: "Invalid Data Fabric directory entry response format."
|
|
53247
|
+
});
|
|
53248
|
+
}
|
|
53249
|
+
const normalized = {
|
|
53250
|
+
externalId: entry.externalId,
|
|
53251
|
+
name: entry.name,
|
|
53252
|
+
type: entry.type,
|
|
53253
|
+
roles: entry.roles ?? [],
|
|
53254
|
+
isUIEnabled: entry.isUIEnabled ?? true
|
|
53125
53255
|
};
|
|
53256
|
+
if (entry.email !== undefined) {
|
|
53257
|
+
normalized.email = entry.email;
|
|
53258
|
+
}
|
|
53259
|
+
if (entry.objectType !== undefined) {
|
|
53260
|
+
normalized.objectType = entry.objectType;
|
|
53261
|
+
}
|
|
53262
|
+
return normalized;
|
|
53126
53263
|
}
|
|
53127
|
-
|
|
53128
|
-
const
|
|
53129
|
-
|
|
53130
|
-
startTime: startTime.getTime(),
|
|
53131
|
-
endTime: endTime.getTime(),
|
|
53132
|
-
isCaseManagement
|
|
53133
|
-
},
|
|
53134
|
-
timeSliceUnit: options?.groupBy,
|
|
53135
|
-
timezoneOffset: new Date().getTimezoneOffset() * -1
|
|
53136
|
-
});
|
|
53137
|
-
return response.data ?? [];
|
|
53264
|
+
function normalizePrincipalIds(principalIds) {
|
|
53265
|
+
const ids = Array.isArray(principalIds) ? principalIds : [principalIds];
|
|
53266
|
+
return [...new Set(ids.map((id) => id.trim()).filter(Boolean))];
|
|
53138
53267
|
}
|
|
53139
|
-
function
|
|
53140
|
-
return
|
|
53141
|
-
|
|
53142
|
-
|
|
53143
|
-
|
|
53144
|
-
|
|
53145
|
-
|
|
53146
|
-
version: packageVersion
|
|
53268
|
+
function normalizeRoleIds(roleIds) {
|
|
53269
|
+
return [...new Set(roleIds.map((id) => id.trim()).filter(Boolean))];
|
|
53270
|
+
}
|
|
53271
|
+
function normalizePrincipalType(type) {
|
|
53272
|
+
if (typeof type === "number") {
|
|
53273
|
+
if (type === DataFabricDirectoryEntityType.User || type === DataFabricDirectoryEntityType.Group || type === DataFabricDirectoryEntityType.Application) {
|
|
53274
|
+
return type;
|
|
53147
53275
|
}
|
|
53148
|
-
|
|
53276
|
+
throw new ValidationError({
|
|
53277
|
+
message: "Invalid Data Fabric principal type."
|
|
53278
|
+
});
|
|
53279
|
+
}
|
|
53280
|
+
switch (type) {
|
|
53281
|
+
case DataFabricDirectoryEntityTypeName.User:
|
|
53282
|
+
return DataFabricDirectoryEntityType.User;
|
|
53283
|
+
case DataFabricDirectoryEntityTypeName.Group:
|
|
53284
|
+
return DataFabricDirectoryEntityType.Group;
|
|
53285
|
+
case DataFabricDirectoryEntityTypeName.Application:
|
|
53286
|
+
return DataFabricDirectoryEntityType.Application;
|
|
53287
|
+
default:
|
|
53288
|
+
throw new ValidationError({
|
|
53289
|
+
message: "Invalid Data Fabric principal type."
|
|
53290
|
+
});
|
|
53291
|
+
}
|
|
53292
|
+
}
|
|
53293
|
+
function roleIdsFromEntry(entry) {
|
|
53294
|
+
if (!entry) {
|
|
53295
|
+
return [];
|
|
53296
|
+
}
|
|
53297
|
+
return normalizeRoleIds(entry.roles.map((role) => role.id));
|
|
53298
|
+
}
|
|
53299
|
+
function clampDirectoryPageSize(pageSize) {
|
|
53300
|
+
return Math.max(1, Math.min(pageSize ?? DEFAULT_DIRECTORY_PAGE_SIZE, MAX_DIRECTORY_PAGE_SIZE));
|
|
53149
53301
|
}
|
|
53150
|
-
var ProcessIncidentMap = {
|
|
53151
|
-
errorTimeUtc: "errorTime"
|
|
53152
|
-
};
|
|
53153
|
-
var ProcessIncidentSummaryMap = {
|
|
53154
|
-
firstTimeUtc: "firstOccuranceTime"
|
|
53155
|
-
};
|
|
53156
53302
|
|
|
53157
|
-
class
|
|
53158
|
-
|
|
53159
|
-
const
|
|
53160
|
-
|
|
53161
|
-
|
|
53162
|
-
|
|
53163
|
-
|
|
53164
|
-
|
|
53165
|
-
|
|
53166
|
-
|
|
53167
|
-
}
|
|
53168
|
-
const elementId = idMatch[1];
|
|
53169
|
-
const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
53170
|
-
const name = nameMatch ? nameMatch[1] : "";
|
|
53171
|
-
const activityType = this.formatActivityTypeForIncidents(elementType);
|
|
53172
|
-
const activityName = name || elementId;
|
|
53173
|
-
elementInfo[elementId] = {
|
|
53174
|
-
type: activityType,
|
|
53175
|
-
name: activityName
|
|
53176
|
-
};
|
|
53303
|
+
class DataFabricDirectoryService extends BaseService {
|
|
53304
|
+
async fetchAllEntries(options = {}) {
|
|
53305
|
+
const top = clampDirectoryPageSize(options.pageSize);
|
|
53306
|
+
const entries = [];
|
|
53307
|
+
let skip = 0;
|
|
53308
|
+
while (true) {
|
|
53309
|
+
const page = await this.list(skip === 0 ? { top } : { top, skip });
|
|
53310
|
+
entries.push(...page.results);
|
|
53311
|
+
if (page.results.length < top || page.totalCount !== undefined && entries.length >= page.totalCount) {
|
|
53312
|
+
return entries;
|
|
53177
53313
|
}
|
|
53178
|
-
|
|
53179
|
-
console.warn("Failed to parse BPMN XML for incidents:", error);
|
|
53314
|
+
skip += top;
|
|
53180
53315
|
}
|
|
53181
|
-
return elementInfo;
|
|
53182
|
-
}
|
|
53183
|
-
static formatActivityTypeForIncidents(elementType) {
|
|
53184
|
-
return elementType.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
53185
53316
|
}
|
|
53186
|
-
|
|
53187
|
-
const
|
|
53188
|
-
|
|
53189
|
-
|
|
53190
|
-
|
|
53191
|
-
|
|
53192
|
-
|
|
53193
|
-
|
|
53317
|
+
async list(options = {}) {
|
|
53318
|
+
const params = createParams({
|
|
53319
|
+
skip: options.skip,
|
|
53320
|
+
top: clampDirectoryPageSize(options.top)
|
|
53321
|
+
});
|
|
53322
|
+
const response = await this.get(DATA_FABRIC_ENDPOINTS.DIRECTORY.GET_ALL, { params });
|
|
53323
|
+
const data = validateDirectoryListResponse(response.data);
|
|
53324
|
+
const results = data.results.map(normalizeDirectoryEntry);
|
|
53325
|
+
return {
|
|
53326
|
+
totalCount: data.totalCount,
|
|
53327
|
+
results
|
|
53328
|
+
};
|
|
53194
53329
|
}
|
|
53195
|
-
|
|
53196
|
-
|
|
53197
|
-
const id = incident.instanceId || NO_INSTANCE;
|
|
53198
|
-
(acc[id] = acc[id] || []).push(incident);
|
|
53199
|
-
return acc;
|
|
53200
|
-
}, {});
|
|
53201
|
-
const results = await Promise.all(Object.entries(groups).map(async (entry) => {
|
|
53202
|
-
const [instanceId, groupIncidents] = entry;
|
|
53203
|
-
const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
|
|
53204
|
-
return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
53205
|
-
}));
|
|
53206
|
-
return results.flat();
|
|
53330
|
+
async getAll(options = {}) {
|
|
53331
|
+
return this.fetchAllEntries(options);
|
|
53207
53332
|
}
|
|
53208
|
-
|
|
53209
|
-
|
|
53210
|
-
|
|
53333
|
+
async assignRoles(principalIds, principalType, roleIds, options = {}) {
|
|
53334
|
+
const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
|
|
53335
|
+
const normalizedRoleIds = normalizeRoleIds(roleIds);
|
|
53336
|
+
if (normalizedPrincipalIds.length === 0) {
|
|
53337
|
+
throw new ValidationError({ message: "At least one principal ID is required." });
|
|
53211
53338
|
}
|
|
53212
|
-
|
|
53213
|
-
|
|
53214
|
-
return this.parseBpmnElementsForIncidents(bpmnXml);
|
|
53215
|
-
} catch (error) {
|
|
53216
|
-
console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
|
|
53217
|
-
return {};
|
|
53339
|
+
if (normalizedRoleIds.length === 0) {
|
|
53340
|
+
throw new ValidationError({ message: "At least one Data Fabric role ID is required." });
|
|
53218
53341
|
}
|
|
53342
|
+
const type = normalizePrincipalType(principalType);
|
|
53343
|
+
const preserveExisting = options.preserveExisting ?? true;
|
|
53344
|
+
const existingById = new Map;
|
|
53345
|
+
if (preserveExisting) {
|
|
53346
|
+
for (const entry of await this.fetchAllEntries()) {
|
|
53347
|
+
existingById.set(entry.externalId.toLowerCase(), entry);
|
|
53348
|
+
}
|
|
53349
|
+
}
|
|
53350
|
+
return Promise.all(normalizedPrincipalIds.map(async (principalId) => {
|
|
53351
|
+
const existing = existingById.get(principalId.toLowerCase());
|
|
53352
|
+
const mergedRoleIds = preserveExisting ? normalizeRoleIds([...roleIdsFromEntry(existing), ...normalizedRoleIds]) : normalizedRoleIds;
|
|
53353
|
+
const payload = {
|
|
53354
|
+
directoryEntities: [
|
|
53355
|
+
{
|
|
53356
|
+
externalId: principalId,
|
|
53357
|
+
type,
|
|
53358
|
+
resolved: true
|
|
53359
|
+
}
|
|
53360
|
+
],
|
|
53361
|
+
roles: mergedRoleIds,
|
|
53362
|
+
isUIEnabled: options.uiEnabled ?? true
|
|
53363
|
+
};
|
|
53364
|
+
await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.ASSIGN_ROLES, payload);
|
|
53365
|
+
return {
|
|
53366
|
+
principalId,
|
|
53367
|
+
roleIds: mergedRoleIds
|
|
53368
|
+
};
|
|
53369
|
+
}));
|
|
53219
53370
|
}
|
|
53220
|
-
|
|
53221
|
-
const
|
|
53222
|
-
|
|
53223
|
-
|
|
53224
|
-
|
|
53225
|
-
|
|
53226
|
-
|
|
53371
|
+
async revokeRoles(principalIds) {
|
|
53372
|
+
const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
|
|
53373
|
+
if (normalizedPrincipalIds.length === 0) {
|
|
53374
|
+
throw new ValidationError({ message: "At least one principal ID is required." });
|
|
53375
|
+
}
|
|
53376
|
+
const payload = {
|
|
53377
|
+
externalIds: normalizedPrincipalIds
|
|
53227
53378
|
};
|
|
53379
|
+
await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.REVOKE_ROLES, payload);
|
|
53228
53380
|
}
|
|
53229
53381
|
}
|
|
53382
|
+
__decorate([
|
|
53383
|
+
track("DataFabricDirectory.List")
|
|
53384
|
+
], DataFabricDirectoryService.prototype, "list", null);
|
|
53385
|
+
__decorate([
|
|
53386
|
+
track("DataFabricDirectory.GetAll")
|
|
53387
|
+
], DataFabricDirectoryService.prototype, "getAll", null);
|
|
53388
|
+
__decorate([
|
|
53389
|
+
track("DataFabricDirectory.AssignRoles")
|
|
53390
|
+
], DataFabricDirectoryService.prototype, "assignRoles", null);
|
|
53391
|
+
__decorate([
|
|
53392
|
+
track("DataFabricDirectory.RevokeRoles")
|
|
53393
|
+
], DataFabricDirectoryService.prototype, "revokeRoles", null);
|
|
53394
|
+
var InstanceStatsMap = {
|
|
53395
|
+
countOfAllInstances: "totalCount",
|
|
53396
|
+
countOfRunning: "runningCount",
|
|
53397
|
+
countOfTransitioning: "transitioningCount",
|
|
53398
|
+
countOfPaused: "pausedCount",
|
|
53399
|
+
countOfFaulted: "faultedCount",
|
|
53400
|
+
countOfCompleted: "completedCount",
|
|
53401
|
+
countOfCancelled: "cancelledCount",
|
|
53402
|
+
countOfDeleted: "deletedCount"
|
|
53403
|
+
};
|
|
53404
|
+
function createProcessMethods(processData, service) {
|
|
53405
|
+
return {
|
|
53406
|
+
async getIncidents() {
|
|
53407
|
+
if (!processData.processKey)
|
|
53408
|
+
throw new Error("Process key is undefined");
|
|
53409
|
+
if (!processData.folderKey)
|
|
53410
|
+
throw new Error("Folder key is undefined");
|
|
53411
|
+
return service.getIncidents(processData.processKey, processData.folderKey);
|
|
53412
|
+
},
|
|
53413
|
+
getElementStats(startTime, endTime, packageVersion) {
|
|
53414
|
+
if (!processData.processKey)
|
|
53415
|
+
throw new Error("Process key is undefined");
|
|
53416
|
+
if (!processData.packageId)
|
|
53417
|
+
throw new Error("Package ID is undefined");
|
|
53418
|
+
return service.getElementStats({
|
|
53419
|
+
processKey: processData.processKey,
|
|
53420
|
+
packageId: processData.packageId,
|
|
53421
|
+
packageVersion,
|
|
53422
|
+
startTime,
|
|
53423
|
+
endTime
|
|
53424
|
+
});
|
|
53425
|
+
},
|
|
53426
|
+
getInstanceStats(startTime, endTime, packageVersion) {
|
|
53427
|
+
if (!processData.processKey)
|
|
53428
|
+
throw new Error("Process key is undefined");
|
|
53429
|
+
if (!processData.packageId)
|
|
53430
|
+
throw new Error("Package ID is undefined");
|
|
53431
|
+
return service.getInstanceStats({
|
|
53432
|
+
processKey: processData.processKey,
|
|
53433
|
+
packageId: processData.packageId,
|
|
53434
|
+
packageVersion,
|
|
53435
|
+
startTime,
|
|
53436
|
+
endTime
|
|
53437
|
+
});
|
|
53438
|
+
},
|
|
53439
|
+
getInstanceStatusTimeline(startTime, endTime, options) {
|
|
53440
|
+
if (!processData.processKey)
|
|
53441
|
+
throw new Error("Process key is undefined");
|
|
53442
|
+
return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
|
|
53443
|
+
},
|
|
53444
|
+
getIncidentsTimeline(startTime, endTime, options) {
|
|
53445
|
+
if (!processData.processKey)
|
|
53446
|
+
throw new Error("Process key is undefined");
|
|
53447
|
+
return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
|
|
53448
|
+
}
|
|
53449
|
+
};
|
|
53450
|
+
}
|
|
53451
|
+
function createProcessWithMethods(processData, service) {
|
|
53452
|
+
const methods = createProcessMethods(processData, service);
|
|
53453
|
+
return Object.assign({}, processData, methods);
|
|
53454
|
+
}
|
|
53230
53455
|
function createProcessInstanceMethods(instanceData, service) {
|
|
53231
53456
|
return {
|
|
53232
53457
|
async cancel(options) {
|
|
@@ -53250,6 +53475,13 @@ function createProcessInstanceMethods(instanceData, service) {
|
|
|
53250
53475
|
throw new Error("Process instance folder key is undefined");
|
|
53251
53476
|
return service.resume(instanceData.instanceId, instanceData.folderKey, options);
|
|
53252
53477
|
},
|
|
53478
|
+
async retry(options) {
|
|
53479
|
+
if (!instanceData.instanceId)
|
|
53480
|
+
throw new Error("Process instance ID is undefined");
|
|
53481
|
+
if (!instanceData.folderKey)
|
|
53482
|
+
throw new Error("Process instance folder key is undefined");
|
|
53483
|
+
return service.retry(instanceData.instanceId, instanceData.folderKey, options);
|
|
53484
|
+
},
|
|
53253
53485
|
async getIncidents() {
|
|
53254
53486
|
if (!instanceData.instanceId)
|
|
53255
53487
|
throw new Error("Process instance ID is undefined");
|
|
@@ -53314,7 +53546,36 @@ function createCaseMethods(caseData, service) {
|
|
|
53314
53546
|
throw new Error("Process key is undefined");
|
|
53315
53547
|
if (!caseData.packageId)
|
|
53316
53548
|
throw new Error("Package ID is undefined");
|
|
53317
|
-
return service.getElementStats(
|
|
53549
|
+
return service.getElementStats({
|
|
53550
|
+
processKey: caseData.processKey,
|
|
53551
|
+
packageId: caseData.packageId,
|
|
53552
|
+
packageVersion,
|
|
53553
|
+
startTime,
|
|
53554
|
+
endTime
|
|
53555
|
+
});
|
|
53556
|
+
},
|
|
53557
|
+
getInstanceStats(startTime, endTime, packageVersion) {
|
|
53558
|
+
if (!caseData.processKey)
|
|
53559
|
+
throw new Error("Process key is undefined");
|
|
53560
|
+
if (!caseData.packageId)
|
|
53561
|
+
throw new Error("Package ID is undefined");
|
|
53562
|
+
return service.getInstanceStats({
|
|
53563
|
+
processKey: caseData.processKey,
|
|
53564
|
+
packageId: caseData.packageId,
|
|
53565
|
+
packageVersion,
|
|
53566
|
+
startTime,
|
|
53567
|
+
endTime
|
|
53568
|
+
});
|
|
53569
|
+
},
|
|
53570
|
+
getInstanceStatusTimeline(startTime, endTime, options) {
|
|
53571
|
+
if (!caseData.processKey)
|
|
53572
|
+
throw new Error("Process key is undefined");
|
|
53573
|
+
return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
|
|
53574
|
+
},
|
|
53575
|
+
getIncidentsTimeline(startTime, endTime, options) {
|
|
53576
|
+
if (!caseData.processKey)
|
|
53577
|
+
throw new Error("Process key is undefined");
|
|
53578
|
+
return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
|
|
53318
53579
|
}
|
|
53319
53580
|
};
|
|
53320
53581
|
}
|
|
@@ -53453,6 +53714,123 @@ var InstanceFinalStatus;
|
|
|
53453
53714
|
InstanceFinalStatus2["Faulted"] = "Faulted";
|
|
53454
53715
|
InstanceFinalStatus2["Cancelled"] = "Cancelled";
|
|
53455
53716
|
})(InstanceFinalStatus || (InstanceFinalStatus = {}));
|
|
53717
|
+
function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
|
|
53718
|
+
return {
|
|
53719
|
+
commonParams: {
|
|
53720
|
+
startTime: startTime.getTime(),
|
|
53721
|
+
endTime: endTime.getTime(),
|
|
53722
|
+
isCaseManagement,
|
|
53723
|
+
...options?.packageId ? { packageId: options.packageId } : {},
|
|
53724
|
+
...options?.processKey ? { processKey: options.processKey } : {},
|
|
53725
|
+
...options?.version ? { version: options.version } : {}
|
|
53726
|
+
}
|
|
53727
|
+
};
|
|
53728
|
+
}
|
|
53729
|
+
function buildInsightsTimelineBody(startTime, endTime, isCaseManagement, options) {
|
|
53730
|
+
return {
|
|
53731
|
+
commonParams: {
|
|
53732
|
+
startTime: startTime.getTime(),
|
|
53733
|
+
endTime: endTime.getTime(),
|
|
53734
|
+
isCaseManagement,
|
|
53735
|
+
...options?.packageId ? { packageId: options.packageId } : {},
|
|
53736
|
+
...options?.version ? { version: options.version } : {},
|
|
53737
|
+
...options?.processKeys ? { processKeys: options.processKeys } : {}
|
|
53738
|
+
},
|
|
53739
|
+
timeSliceUnit: options?.groupBy ?? TimeInterval.Day,
|
|
53740
|
+
timezoneOffset: new Date().getTimezoneOffset() * -1
|
|
53741
|
+
};
|
|
53742
|
+
}
|
|
53743
|
+
function buildInsightsCommonBody(request) {
|
|
53744
|
+
return {
|
|
53745
|
+
commonParams: {
|
|
53746
|
+
processKey: request.processKey,
|
|
53747
|
+
packageId: request.packageId,
|
|
53748
|
+
startTime: request.startTime.getTime(),
|
|
53749
|
+
endTime: request.endTime.getTime(),
|
|
53750
|
+
version: request.packageVersion
|
|
53751
|
+
}
|
|
53752
|
+
};
|
|
53753
|
+
}
|
|
53754
|
+
var ProcessIncidentMap = {
|
|
53755
|
+
errorTimeUtc: "errorTime"
|
|
53756
|
+
};
|
|
53757
|
+
var ProcessIncidentSummaryMap = {
|
|
53758
|
+
firstTimeUtc: "firstOccuranceTime"
|
|
53759
|
+
};
|
|
53760
|
+
|
|
53761
|
+
class BpmnHelpers {
|
|
53762
|
+
static parseBpmnElementsForIncidents(bpmnXml) {
|
|
53763
|
+
const elementInfo = {};
|
|
53764
|
+
try {
|
|
53765
|
+
const bpmnOpenTagRegex = /<bpmn:([A-Za-z][\w.-]*)\b[^>]*>/g;
|
|
53766
|
+
for (const tagMatch of bpmnXml.matchAll(bpmnOpenTagRegex)) {
|
|
53767
|
+
const [fullTag, elementType] = tagMatch;
|
|
53768
|
+
const idMatch = /\bid\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
53769
|
+
if (!idMatch) {
|
|
53770
|
+
continue;
|
|
53771
|
+
}
|
|
53772
|
+
const elementId = idMatch[1];
|
|
53773
|
+
const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
53774
|
+
const name = nameMatch ? nameMatch[1] : "";
|
|
53775
|
+
const activityType = this.formatActivityTypeForIncidents(elementType);
|
|
53776
|
+
const activityName = name || elementId;
|
|
53777
|
+
elementInfo[elementId] = {
|
|
53778
|
+
type: activityType,
|
|
53779
|
+
name: activityName
|
|
53780
|
+
};
|
|
53781
|
+
}
|
|
53782
|
+
} catch (error) {
|
|
53783
|
+
console.warn("Failed to parse BPMN XML for incidents:", error);
|
|
53784
|
+
}
|
|
53785
|
+
return elementInfo;
|
|
53786
|
+
}
|
|
53787
|
+
static formatActivityTypeForIncidents(elementType) {
|
|
53788
|
+
return elementType.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
53789
|
+
}
|
|
53790
|
+
static async enrichIncidentsWithBpmnData(incidents, folderKey, service) {
|
|
53791
|
+
const uniqueInstanceIds = [...new Set(incidents.map((i) => i.instanceId))];
|
|
53792
|
+
if (uniqueInstanceIds.length === 1) {
|
|
53793
|
+
const elementInfo = await this.getBpmnElementInfo(uniqueInstanceIds[0], folderKey, service);
|
|
53794
|
+
return incidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
53795
|
+
} else {
|
|
53796
|
+
return this.enrichMultipleInstanceIncidents(incidents, folderKey, service);
|
|
53797
|
+
}
|
|
53798
|
+
}
|
|
53799
|
+
static async enrichMultipleInstanceIncidents(incidents, folderKey, service) {
|
|
53800
|
+
const groups = incidents.reduce((acc, incident) => {
|
|
53801
|
+
const id = incident.instanceId || NO_INSTANCE;
|
|
53802
|
+
(acc[id] = acc[id] || []).push(incident);
|
|
53803
|
+
return acc;
|
|
53804
|
+
}, {});
|
|
53805
|
+
const results = await Promise.all(Object.entries(groups).map(async (entry) => {
|
|
53806
|
+
const [instanceId, groupIncidents] = entry;
|
|
53807
|
+
const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
|
|
53808
|
+
return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
53809
|
+
}));
|
|
53810
|
+
return results.flat();
|
|
53811
|
+
}
|
|
53812
|
+
static async getBpmnElementInfo(instanceId, folderKey, service) {
|
|
53813
|
+
if (!instanceId || instanceId === NO_INSTANCE) {
|
|
53814
|
+
return {};
|
|
53815
|
+
}
|
|
53816
|
+
try {
|
|
53817
|
+
const bpmnXml = await service.getBpmn(instanceId, folderKey);
|
|
53818
|
+
return this.parseBpmnElementsForIncidents(bpmnXml);
|
|
53819
|
+
} catch (error) {
|
|
53820
|
+
console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
|
|
53821
|
+
return {};
|
|
53822
|
+
}
|
|
53823
|
+
}
|
|
53824
|
+
static transformIncidentWithBpmn(incident, elementInfo) {
|
|
53825
|
+
const element = elementInfo[incident.elementId];
|
|
53826
|
+
const transformed = transformData(incident, ProcessIncidentMap);
|
|
53827
|
+
return {
|
|
53828
|
+
...transformed,
|
|
53829
|
+
incidentElementActivityType: element?.type || UNKNOWN2,
|
|
53830
|
+
incidentElementActivityName: element?.name || UNKNOWN2
|
|
53831
|
+
};
|
|
53832
|
+
}
|
|
53833
|
+
}
|
|
53456
53834
|
var ProcessInstanceMap = {
|
|
53457
53835
|
startedTimeUtc: "startedTime",
|
|
53458
53836
|
completedTimeUtc: "completedTime",
|
|
@@ -53564,6 +53942,15 @@ class ProcessInstancesService extends BaseService {
|
|
|
53564
53942
|
data: response.data
|
|
53565
53943
|
};
|
|
53566
53944
|
}
|
|
53945
|
+
async retry(instanceId, folderKey, options) {
|
|
53946
|
+
const response = await this.post(MAESTRO_ENDPOINTS.INSTANCES.RETRY(instanceId), options || {}, {
|
|
53947
|
+
headers: createHeaders({ [FOLDER_KEY]: folderKey })
|
|
53948
|
+
});
|
|
53949
|
+
return {
|
|
53950
|
+
success: true,
|
|
53951
|
+
data: response.data
|
|
53952
|
+
};
|
|
53953
|
+
}
|
|
53567
53954
|
parseBpmnVariables(bpmnXml) {
|
|
53568
53955
|
const variableMap = new Map;
|
|
53569
53956
|
const variableSourceMap = this.getVariableSource(bpmnXml);
|
|
@@ -53672,6 +54059,9 @@ __decorate([
|
|
|
53672
54059
|
__decorate([
|
|
53673
54060
|
track("ProcessInstances.Resume")
|
|
53674
54061
|
], ProcessInstancesService.prototype, "resume", null);
|
|
54062
|
+
__decorate([
|
|
54063
|
+
track("ProcessInstances.Retry")
|
|
54064
|
+
], ProcessInstancesService.prototype, "retry", null);
|
|
53675
54065
|
__decorate([
|
|
53676
54066
|
track("ProcessInstances.GetVariables")
|
|
53677
54067
|
], ProcessInstancesService.prototype, "getVariables", null);
|
|
@@ -53713,7 +54103,12 @@ class MaestroProcessesService extends BaseService {
|
|
|
53713
54103
|
}));
|
|
53714
54104
|
}
|
|
53715
54105
|
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
53716
|
-
|
|
54106
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, false, options));
|
|
54107
|
+
return data ?? [];
|
|
54108
|
+
}
|
|
54109
|
+
async getIncidentsTimeline(startTime, endTime, options) {
|
|
54110
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, false, options));
|
|
54111
|
+
return data?.dataPoints ?? [];
|
|
53717
54112
|
}
|
|
53718
54113
|
async getTopFaultedCount(startTime, endTime, options) {
|
|
53719
54114
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
|
|
@@ -53728,10 +54123,14 @@ class MaestroProcessesService extends BaseService {
|
|
|
53728
54123
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_DURATION, buildInsightsTopBody(startTime, endTime, false, options));
|
|
53729
54124
|
return (data ?? []).map((process10) => ({ ...process10, name: process10.packageId }));
|
|
53730
54125
|
}
|
|
53731
|
-
async getElementStats(
|
|
53732
|
-
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS,
|
|
54126
|
+
async getElementStats(request) {
|
|
54127
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
53733
54128
|
return data ?? [];
|
|
53734
54129
|
}
|
|
54130
|
+
async getInstanceStats(request) {
|
|
54131
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
54132
|
+
return transformData(data, InstanceStatsMap);
|
|
54133
|
+
}
|
|
53735
54134
|
}
|
|
53736
54135
|
__decorate([
|
|
53737
54136
|
track("MaestroProcesses.GetAll")
|
|
@@ -53748,6 +54147,9 @@ __decorate([
|
|
|
53748
54147
|
__decorate([
|
|
53749
54148
|
track("MaestroProcesses.GetInstanceStatusTimeline")
|
|
53750
54149
|
], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
|
|
54150
|
+
__decorate([
|
|
54151
|
+
track("MaestroProcesses.GetIncidentsTimeline")
|
|
54152
|
+
], MaestroProcessesService.prototype, "getIncidentsTimeline", null);
|
|
53751
54153
|
__decorate([
|
|
53752
54154
|
track("MaestroProcesses.GetTopFaultedCount")
|
|
53753
54155
|
], MaestroProcessesService.prototype, "getTopFaultedCount", null);
|
|
@@ -53757,6 +54159,9 @@ __decorate([
|
|
|
53757
54159
|
__decorate([
|
|
53758
54160
|
track("MaestroProcesses.GetElementStats")
|
|
53759
54161
|
], MaestroProcessesService.prototype, "getElementStats", null);
|
|
54162
|
+
__decorate([
|
|
54163
|
+
track("MaestroProcesses.GetInstanceStats")
|
|
54164
|
+
], MaestroProcessesService.prototype, "getInstanceStats", null);
|
|
53760
54165
|
|
|
53761
54166
|
class ProcessIncidentsService extends BaseService {
|
|
53762
54167
|
async getAll() {
|
|
@@ -53799,7 +54204,12 @@ class CasesService extends BaseService {
|
|
|
53799
54204
|
}));
|
|
53800
54205
|
}
|
|
53801
54206
|
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
53802
|
-
|
|
54207
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, true, options));
|
|
54208
|
+
return data ?? [];
|
|
54209
|
+
}
|
|
54210
|
+
async getIncidentsTimeline(startTime, endTime, options) {
|
|
54211
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, true, options));
|
|
54212
|
+
return data?.dataPoints ?? [];
|
|
53803
54213
|
}
|
|
53804
54214
|
async getTopFaultedCount(startTime, endTime, options) {
|
|
53805
54215
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
|
|
@@ -53814,10 +54224,14 @@ class CasesService extends BaseService {
|
|
|
53814
54224
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_DURATION, buildInsightsTopBody(startTime, endTime, true, options));
|
|
53815
54225
|
return (data ?? []).map((process10) => ({ ...process10, name: this.extractCaseName(process10.packageId) }));
|
|
53816
54226
|
}
|
|
53817
|
-
async getElementStats(
|
|
53818
|
-
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS,
|
|
54227
|
+
async getElementStats(request) {
|
|
54228
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
53819
54229
|
return data ?? [];
|
|
53820
54230
|
}
|
|
54231
|
+
async getInstanceStats(request) {
|
|
54232
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
54233
|
+
return transformData(data, InstanceStatsMap);
|
|
54234
|
+
}
|
|
53821
54235
|
extractCaseName(packageId) {
|
|
53822
54236
|
const caseManagementIndex = packageId.indexOf("CaseManagement.");
|
|
53823
54237
|
if (caseManagementIndex !== -1) {
|
|
@@ -53839,6 +54253,9 @@ __decorate([
|
|
|
53839
54253
|
__decorate([
|
|
53840
54254
|
track("Cases.GetInstanceStatusTimeline")
|
|
53841
54255
|
], CasesService.prototype, "getInstanceStatusTimeline", null);
|
|
54256
|
+
__decorate([
|
|
54257
|
+
track("Cases.GetIncidentsTimeline")
|
|
54258
|
+
], CasesService.prototype, "getIncidentsTimeline", null);
|
|
53842
54259
|
__decorate([
|
|
53843
54260
|
track("Cases.GetTopFaultedCount")
|
|
53844
54261
|
], CasesService.prototype, "getTopFaultedCount", null);
|
|
@@ -53848,6 +54265,9 @@ __decorate([
|
|
|
53848
54265
|
__decorate([
|
|
53849
54266
|
track("Cases.GetElementStats")
|
|
53850
54267
|
], CasesService.prototype, "getElementStats", null);
|
|
54268
|
+
__decorate([
|
|
54269
|
+
track("Cases.GetInstanceStats")
|
|
54270
|
+
], CasesService.prototype, "getInstanceStats", null);
|
|
53851
54271
|
var CaseInstanceMap = {
|
|
53852
54272
|
startedTimeUtc: "startedTime",
|
|
53853
54273
|
completedTimeUtc: "completedTime",
|
|
@@ -53980,6 +54400,7 @@ class TaskService extends BaseService {
|
|
|
53980
54400
|
const transformedTask = transformData(pascalToCamelCaseKeys(task), TaskMap);
|
|
53981
54401
|
return createTaskWithMethods(applyDataTransforms(transformedTask, { field: "status", valueMap: TaskStatusMap }), this);
|
|
53982
54402
|
};
|
|
54403
|
+
const apiOptions = options ? transformOptions(options, TaskMap) : options;
|
|
53983
54404
|
return PaginationHelpers.getAll({
|
|
53984
54405
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
53985
54406
|
getEndpoint: () => endpoint,
|
|
@@ -53996,7 +54417,7 @@ class TaskService extends BaseService {
|
|
|
53996
54417
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
53997
54418
|
}
|
|
53998
54419
|
}
|
|
53999
|
-
},
|
|
54420
|
+
}, apiOptions);
|
|
54000
54421
|
}
|
|
54001
54422
|
async getById(id, options = {}, folderId) {
|
|
54002
54423
|
const { taskType, ...restOptions } = options;
|
|
@@ -54008,8 +54429,8 @@ class TaskService extends BaseService {
|
|
|
54008
54429
|
}
|
|
54009
54430
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
54010
54431
|
const modifiedOptions = this.addDefaultExpand(restOptions);
|
|
54011
|
-
const
|
|
54012
|
-
const apiOptions = addPrefixToKeys(
|
|
54432
|
+
const apiFieldOptions = transformOptions(modifiedOptions, TaskMap);
|
|
54433
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
54013
54434
|
const response = await this.get(TASK_ENDPOINTS.GET_BY_ID(id), {
|
|
54014
54435
|
params: apiOptions,
|
|
54015
54436
|
headers
|
|
@@ -54474,7 +54895,7 @@ class FolderScopedService extends BaseService {
|
|
|
54474
54895
|
}
|
|
54475
54896
|
return response.data?.value;
|
|
54476
54897
|
}
|
|
54477
|
-
async getByNameLookup(resourceType, endpoint, name, options, transform2) {
|
|
54898
|
+
async getByNameLookup(resourceType, endpoint, name, options, transform2, responseFieldMap) {
|
|
54478
54899
|
const validatedName = validateName(resourceType, name);
|
|
54479
54900
|
const { folderId, folderKey, folderPath, ...queryOptions } = options;
|
|
54480
54901
|
const headers = resolveFolderHeaders({
|
|
@@ -54484,8 +54905,9 @@ class FolderScopedService extends BaseService {
|
|
|
54484
54905
|
resourceType: `${resourceType}.getByName`,
|
|
54485
54906
|
fallbackFolderKey: this.config.folderKey
|
|
54486
54907
|
});
|
|
54908
|
+
const apiFieldOptions = responseFieldMap ? transformOptions(queryOptions, responseFieldMap) : queryOptions;
|
|
54487
54909
|
const apiOptions = {
|
|
54488
|
-
...addPrefixToKeys(
|
|
54910
|
+
...addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions)),
|
|
54489
54911
|
$filter: `Name eq '${validatedName.replace(SINGLE_QUOTE_RE, "''")}'`,
|
|
54490
54912
|
$top: "1"
|
|
54491
54913
|
};
|
|
@@ -54535,6 +54957,7 @@ var AssetMap = {
|
|
|
54535
54957
|
class AssetService extends FolderScopedService {
|
|
54536
54958
|
async getAll(options) {
|
|
54537
54959
|
const transformAssetResponse = (asset) => transformData(pascalToCamelCaseKeys(asset), AssetMap);
|
|
54960
|
+
const apiOptions = options ? transformOptions(options, AssetMap) : options;
|
|
54538
54961
|
return PaginationHelpers.getAll({
|
|
54539
54962
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
54540
54963
|
getEndpoint: (folderId) => folderId ? ASSET_ENDPOINTS.GET_BY_FOLDER : ASSET_ENDPOINTS.GET_ALL,
|
|
@@ -54550,12 +54973,12 @@ class AssetService extends FolderScopedService {
|
|
|
54550
54973
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
54551
54974
|
}
|
|
54552
54975
|
}
|
|
54553
|
-
},
|
|
54976
|
+
}, apiOptions);
|
|
54554
54977
|
}
|
|
54555
54978
|
async getById(id, folderId, options = {}) {
|
|
54556
54979
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
54557
|
-
const
|
|
54558
|
-
const apiOptions = addPrefixToKeys(
|
|
54980
|
+
const apiFieldOptions = transformOptions(options, AssetMap);
|
|
54981
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
54559
54982
|
const response = await this.get(ASSET_ENDPOINTS.GET_BY_ID(id), {
|
|
54560
54983
|
headers,
|
|
54561
54984
|
params: apiOptions
|
|
@@ -54564,7 +54987,7 @@ class AssetService extends FolderScopedService {
|
|
|
54564
54987
|
return transformedAsset;
|
|
54565
54988
|
}
|
|
54566
54989
|
async getByName(name, options = {}) {
|
|
54567
|
-
return this.getByNameLookup("Asset", ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap));
|
|
54990
|
+
return this.getByNameLookup("Asset", ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap), AssetMap);
|
|
54568
54991
|
}
|
|
54569
54992
|
async updateValueById(id, newValue, options) {
|
|
54570
54993
|
if (!id) {
|
|
@@ -54703,6 +55126,7 @@ class BucketService extends FolderScopedService {
|
|
|
54703
55126
|
fallbackFolderKey: this.config.folderKey
|
|
54704
55127
|
});
|
|
54705
55128
|
const transformBlobItem = (item) => transformData(item, BucketMap);
|
|
55129
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
54706
55130
|
return PaginationHelpers.getAll({
|
|
54707
55131
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
54708
55132
|
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILE_META_DATA(bucketId),
|
|
@@ -54718,7 +55142,7 @@ class BucketService extends FolderScopedService {
|
|
|
54718
55142
|
},
|
|
54719
55143
|
excludeFromPrefix: ["prefix"],
|
|
54720
55144
|
headers
|
|
54721
|
-
},
|
|
55145
|
+
}, apiRestOptions);
|
|
54722
55146
|
}
|
|
54723
55147
|
async uploadFile(bucketIdOrOptions, path3, content, options) {
|
|
54724
55148
|
let bucketId;
|
|
@@ -54793,9 +55217,10 @@ class BucketService extends FolderScopedService {
|
|
|
54793
55217
|
resourceType: "Buckets.getReadUri",
|
|
54794
55218
|
fallbackFolderKey: this.config.folderKey
|
|
54795
55219
|
});
|
|
55220
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
54796
55221
|
const queryOptions = {
|
|
54797
55222
|
expiryInMinutes,
|
|
54798
|
-
...addPrefixToKeys(
|
|
55223
|
+
...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
|
|
54799
55224
|
};
|
|
54800
55225
|
return this._getUri(BUCKET_ENDPOINTS.GET_READ_URI(bucketId), bucketId, resolvedPath, headers, queryOptions);
|
|
54801
55226
|
}
|
|
@@ -54849,6 +55274,7 @@ class BucketService extends FolderScopedService {
|
|
|
54849
55274
|
fallbackFolderKey: this.config.folderKey
|
|
54850
55275
|
});
|
|
54851
55276
|
const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
|
|
55277
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
54852
55278
|
return PaginationHelpers.getAll({
|
|
54853
55279
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
54854
55280
|
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
|
|
@@ -54865,7 +55291,7 @@ class BucketService extends FolderScopedService {
|
|
|
54865
55291
|
},
|
|
54866
55292
|
excludeFromPrefix: ["directory", "recursive", "fileNameRegex"],
|
|
54867
55293
|
headers
|
|
54868
|
-
}, { ...
|
|
55294
|
+
}, { ...apiRestOptions, directory: "/", recursive: true });
|
|
54869
55295
|
}
|
|
54870
55296
|
async deleteFile(bucketId, path3, options) {
|
|
54871
55297
|
if (!bucketId) {
|
|
@@ -54888,9 +55314,10 @@ class BucketService extends FolderScopedService {
|
|
|
54888
55314
|
}
|
|
54889
55315
|
async _getWriteUri(options) {
|
|
54890
55316
|
const { bucketId, path: path3, expiryInMinutes, headers, ...restOptions } = options;
|
|
55317
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
54891
55318
|
const queryOptions = {
|
|
54892
55319
|
expiryInMinutes,
|
|
54893
|
-
...addPrefixToKeys(
|
|
55320
|
+
...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
|
|
54894
55321
|
};
|
|
54895
55322
|
return this._getUri(BUCKET_ENDPOINTS.GET_WRITE_URI(bucketId), bucketId, path3, headers, queryOptions);
|
|
54896
55323
|
}
|
|
@@ -54983,8 +55410,8 @@ class AttachmentService extends BaseService {
|
|
|
54983
55410
|
if (!id) {
|
|
54984
55411
|
throw new ValidationError({ message: "id is required for getById" });
|
|
54985
55412
|
}
|
|
54986
|
-
const
|
|
54987
|
-
const apiOptions = addPrefixToKeys(
|
|
55413
|
+
const apiFieldOptions = transformOptions(options, { ...AttachmentsMap, ...BucketMap });
|
|
55414
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
54988
55415
|
const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
|
|
54989
55416
|
params: apiOptions
|
|
54990
55417
|
});
|
|
@@ -55149,6 +55576,7 @@ class JobService extends FolderScopedService {
|
|
|
55149
55576
|
const rawJob = transformData(pascalToCamelCaseKeys(job), JobMap);
|
|
55150
55577
|
return createJobWithMethods(rawJob, this);
|
|
55151
55578
|
};
|
|
55579
|
+
const apiOptions = options ? transformOptions(options, JobMap) : options;
|
|
55152
55580
|
return PaginationHelpers.getAll({
|
|
55153
55581
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
55154
55582
|
getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
|
|
@@ -55164,7 +55592,7 @@ class JobService extends FolderScopedService {
|
|
|
55164
55592
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
55165
55593
|
}
|
|
55166
55594
|
}
|
|
55167
|
-
},
|
|
55595
|
+
}, apiOptions);
|
|
55168
55596
|
}
|
|
55169
55597
|
async getById(id, folderId, options) {
|
|
55170
55598
|
if (!id) {
|
|
@@ -55174,8 +55602,8 @@ class JobService extends FolderScopedService {
|
|
|
55174
55602
|
throw new ValidationError({ message: "folderId is required for getById" });
|
|
55175
55603
|
}
|
|
55176
55604
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
55177
|
-
const
|
|
55178
|
-
const apiOptions =
|
|
55605
|
+
const apiFieldOptions = options ? transformOptions(options, JobMap) : {};
|
|
55606
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
55179
55607
|
const response = await this.get(JOB_ENDPOINTS.GET_BY_KEY(id), {
|
|
55180
55608
|
params: apiOptions,
|
|
55181
55609
|
headers
|
|
@@ -55343,6 +55771,8 @@ var JobState;
|
|
|
55343
55771
|
JobState2["Stopped"] = "Stopped";
|
|
55344
55772
|
JobState2["Suspended"] = "Suspended";
|
|
55345
55773
|
JobState2["Resumed"] = "Resumed";
|
|
55774
|
+
JobState2["Cancelled"] = "Cancelled";
|
|
55775
|
+
JobState2["Unknown"] = "Unknown";
|
|
55346
55776
|
})(JobState || (JobState = {}));
|
|
55347
55777
|
var ProcessMap = {
|
|
55348
55778
|
lastModificationTime: "lastModifiedTime",
|
|
@@ -55361,6 +55791,7 @@ var ProcessMap = {
|
|
|
55361
55791
|
class ProcessService extends FolderScopedService {
|
|
55362
55792
|
async getAll(options) {
|
|
55363
55793
|
const transformProcessResponse = (process10) => transformData(pascalToCamelCaseKeys(process10), ProcessMap);
|
|
55794
|
+
const apiOptions = options ? transformOptions(options, ProcessMap) : options;
|
|
55364
55795
|
return PaginationHelpers.getAll({
|
|
55365
55796
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
55366
55797
|
getEndpoint: () => PROCESS_ENDPOINTS.GET_ALL,
|
|
@@ -55376,7 +55807,7 @@ class ProcessService extends FolderScopedService {
|
|
|
55376
55807
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
55377
55808
|
}
|
|
55378
55809
|
}
|
|
55379
|
-
},
|
|
55810
|
+
}, apiOptions);
|
|
55380
55811
|
}
|
|
55381
55812
|
async start(request, optionsOrFolderId, legacyOptions) {
|
|
55382
55813
|
let folderId;
|
|
@@ -55404,8 +55835,8 @@ class ProcessService extends FolderScopedService {
|
|
|
55404
55835
|
const requestBody = {
|
|
55405
55836
|
startInfo: apiRequest
|
|
55406
55837
|
};
|
|
55407
|
-
const
|
|
55408
|
-
const apiOptions = addPrefixToKeys(
|
|
55838
|
+
const apiFieldOptions = transformOptions(queryOptions, ProcessMap);
|
|
55839
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
55409
55840
|
const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
|
|
55410
55841
|
params: apiOptions,
|
|
55411
55842
|
headers
|
|
@@ -55415,8 +55846,8 @@ class ProcessService extends FolderScopedService {
|
|
|
55415
55846
|
}
|
|
55416
55847
|
async getById(id, folderId, options = {}) {
|
|
55417
55848
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
55418
|
-
const
|
|
55419
|
-
const apiOptions = addPrefixToKeys(
|
|
55849
|
+
const apiFieldOptions = transformOptions(options, ProcessMap);
|
|
55850
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
55420
55851
|
const response = await this.get(PROCESS_ENDPOINTS.GET_BY_ID(id), {
|
|
55421
55852
|
headers,
|
|
55422
55853
|
params: apiOptions
|
|
@@ -55425,7 +55856,7 @@ class ProcessService extends FolderScopedService {
|
|
|
55425
55856
|
return transformedProcess;
|
|
55426
55857
|
}
|
|
55427
55858
|
async getByName(name, options = {}) {
|
|
55428
|
-
return this.getByNameLookup("Process", PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap));
|
|
55859
|
+
return this.getByNameLookup("Process", PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap), ProcessMap);
|
|
55429
55860
|
}
|
|
55430
55861
|
}
|
|
55431
55862
|
__decorate([
|
|
@@ -55449,6 +55880,7 @@ var QueueMap = {
|
|
|
55449
55880
|
class QueueService extends FolderScopedService {
|
|
55450
55881
|
async getAll(options) {
|
|
55451
55882
|
const transformQueueResponse = (queue) => transformData(pascalToCamelCaseKeys(queue), QueueMap);
|
|
55883
|
+
const apiOptions = options ? transformOptions(options, QueueMap) : options;
|
|
55452
55884
|
return PaginationHelpers.getAll({
|
|
55453
55885
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
55454
55886
|
getEndpoint: (folderId) => folderId ? QUEUE_ENDPOINTS.GET_BY_FOLDER : QUEUE_ENDPOINTS.GET_ALL,
|
|
@@ -55464,12 +55896,12 @@ class QueueService extends FolderScopedService {
|
|
|
55464
55896
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
55465
55897
|
}
|
|
55466
55898
|
}
|
|
55467
|
-
},
|
|
55899
|
+
}, apiOptions);
|
|
55468
55900
|
}
|
|
55469
55901
|
async getById(id, folderId, options = {}) {
|
|
55470
55902
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
55471
|
-
const
|
|
55472
|
-
const apiOptions = addPrefixToKeys(
|
|
55903
|
+
const apiFieldOptions = transformOptions(options, QueueMap);
|
|
55904
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
55473
55905
|
const response = await this.get(QUEUE_ENDPOINTS.GET_BY_ID(id), {
|
|
55474
55906
|
headers,
|
|
55475
55907
|
params: apiOptions
|
|
@@ -55510,7 +55942,9 @@ class UiPath2 extends UiPath$1 {
|
|
|
55510
55942
|
}
|
|
55511
55943
|
get entities() {
|
|
55512
55944
|
return Object.assign(this.getService(EntityService), {
|
|
55513
|
-
choicesets: this.getService(ChoiceSetService)
|
|
55945
|
+
choicesets: this.getService(ChoiceSetService),
|
|
55946
|
+
roles: this.getService(DataFabricRoleService),
|
|
55947
|
+
directory: this.getService(DataFabricDirectoryService)
|
|
55514
55948
|
});
|
|
55515
55949
|
}
|
|
55516
55950
|
get tasks() {
|
|
@@ -55615,6 +56049,17 @@ var AgentErrorSortColumn;
|
|
|
55615
56049
|
AgentErrorSortColumn2["LastSeenFolderName"] = "LastSeenFolderName";
|
|
55616
56050
|
AgentErrorSortColumn2["LastSeenFolderPath"] = "LastSeenFolderPath";
|
|
55617
56051
|
})(AgentErrorSortColumn || (AgentErrorSortColumn = {}));
|
|
56052
|
+
var AgentType;
|
|
56053
|
+
(function(AgentType2) {
|
|
56054
|
+
AgentType2["Autonomous"] = "Autonomous";
|
|
56055
|
+
AgentType2["Conversational"] = "Conversational";
|
|
56056
|
+
AgentType2["Coded"] = "Coded";
|
|
56057
|
+
})(AgentType || (AgentType = {}));
|
|
56058
|
+
var AgentExecutionType;
|
|
56059
|
+
(function(AgentExecutionType2) {
|
|
56060
|
+
AgentExecutionType2["Debug"] = "Debug";
|
|
56061
|
+
AgentExecutionType2["Runtime"] = "Runtime";
|
|
56062
|
+
})(AgentExecutionType || (AgentExecutionType = {}));
|
|
55618
56063
|
var AgentMemoryExecutionType;
|
|
55619
56064
|
(function(AgentMemoryExecutionType2) {
|
|
55620
56065
|
AgentMemoryExecutionType2["Debug"] = "Debug";
|
|
@@ -55908,6 +56353,28 @@ var SpanAttachmentDirection;
|
|
|
55908
56353
|
SpanAttachmentDirection2["In"] = "In";
|
|
55909
56354
|
SpanAttachmentDirection2["Out"] = "Out";
|
|
55910
56355
|
})(SpanAttachmentDirection || (SpanAttachmentDirection = {}));
|
|
56356
|
+
var AgentGovernanceMode;
|
|
56357
|
+
(function(AgentGovernanceMode2) {
|
|
56358
|
+
AgentGovernanceMode2["Audit"] = "AUDIT";
|
|
56359
|
+
AgentGovernanceMode2["Enforce"] = "ENFORCE";
|
|
56360
|
+
AgentGovernanceMode2["Unknown"] = "Unknown";
|
|
56361
|
+
})(AgentGovernanceMode || (AgentGovernanceMode = {}));
|
|
56362
|
+
var AgentGovernanceVerdict;
|
|
56363
|
+
(function(AgentGovernanceVerdict2) {
|
|
56364
|
+
AgentGovernanceVerdict2["Allow"] = "ALLOW";
|
|
56365
|
+
AgentGovernanceVerdict2["Deny"] = "DENY";
|
|
56366
|
+
AgentGovernanceVerdict2["Unknown"] = "Unknown";
|
|
56367
|
+
})(AgentGovernanceVerdict || (AgentGovernanceVerdict = {}));
|
|
56368
|
+
var AgentGovernanceSection;
|
|
56369
|
+
(function(AgentGovernanceSection2) {
|
|
56370
|
+
AgentGovernanceSection2["Totals"] = "totals";
|
|
56371
|
+
AgentGovernanceSection2["Hook"] = "hook";
|
|
56372
|
+
AgentGovernanceSection2["Agent"] = "agent";
|
|
56373
|
+
AgentGovernanceSection2["Policy"] = "policy";
|
|
56374
|
+
AgentGovernanceSection2["Pack"] = "pack";
|
|
56375
|
+
AgentGovernanceSection2["Action"] = "action";
|
|
56376
|
+
AgentGovernanceSection2["Mode"] = "mode";
|
|
56377
|
+
})(AgentGovernanceSection || (AgentGovernanceSection = {}));
|
|
55911
56378
|
|
|
55912
56379
|
// src/api/create-sdk.ts
|
|
55913
56380
|
var createSdk = async () => {
|
|
@@ -56815,4 +57282,4 @@ export {
|
|
|
56815
57282
|
metadata
|
|
56816
57283
|
};
|
|
56817
57284
|
|
|
56818
|
-
//# debugId=
|
|
57285
|
+
//# debugId=2E2E89B96CEFA53B64756E2164756E21
|