@uipath/data-fabric-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 +674 -177
- package/package.json +2 -2
- package/src/commands/entities.ts +5 -4
- package/src/commands/records.ts +41 -0
package/dist/tool.js
CHANGED
|
@@ -27244,7 +27244,7 @@ var require_src6 = __commonJS((exports) => {
|
|
|
27244
27244
|
var package_default = {
|
|
27245
27245
|
name: "@uipath/data-fabric-tool",
|
|
27246
27246
|
license: "MIT",
|
|
27247
|
-
version: "1.
|
|
27247
|
+
version: "1.198.0-preview.80",
|
|
27248
27248
|
description: "Manage Data Fabric entities and records.",
|
|
27249
27249
|
type: "module",
|
|
27250
27250
|
main: "./dist/tool.js",
|
|
@@ -27267,7 +27267,7 @@ var package_default = {
|
|
|
27267
27267
|
"@uipath/common": "workspace:*",
|
|
27268
27268
|
"@uipath/auth": "workspace:*",
|
|
27269
27269
|
"@uipath/filesystem": "workspace:*",
|
|
27270
|
-
"@uipath/uipath-typescript": "^1.
|
|
27270
|
+
"@uipath/uipath-typescript": "^1.5.2",
|
|
27271
27271
|
"@types/node": "^25.5.2",
|
|
27272
27272
|
typescript: "^6.0.2"
|
|
27273
27273
|
}
|
|
@@ -27333,8 +27333,15 @@ var TLS_ERROR_CODES = new Set([
|
|
|
27333
27333
|
var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
|
|
27334
27334
|
var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
|
|
27335
27335
|
function describeConnectivityError(error) {
|
|
27336
|
-
|
|
27337
|
-
|
|
27336
|
+
const queue = [error];
|
|
27337
|
+
const seen = new Set;
|
|
27338
|
+
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
27339
|
+
const current = queue.shift();
|
|
27340
|
+
if (current === null || typeof current !== "object")
|
|
27341
|
+
continue;
|
|
27342
|
+
if (seen.has(current))
|
|
27343
|
+
continue;
|
|
27344
|
+
seen.add(current);
|
|
27338
27345
|
const cur = current;
|
|
27339
27346
|
const code = typeof cur.code === "string" ? cur.code : undefined;
|
|
27340
27347
|
const message = typeof cur.message === "string" ? cur.message : undefined;
|
|
@@ -27354,7 +27361,10 @@ function describeConnectivityError(error) {
|
|
|
27354
27361
|
instructions: NETWORK_INSTRUCTIONS
|
|
27355
27362
|
};
|
|
27356
27363
|
}
|
|
27357
|
-
|
|
27364
|
+
if (cur.cause !== undefined)
|
|
27365
|
+
queue.push(cur.cause);
|
|
27366
|
+
if (Array.isArray(cur.errors))
|
|
27367
|
+
queue.push(...cur.errors);
|
|
27358
27368
|
}
|
|
27359
27369
|
return;
|
|
27360
27370
|
}
|
|
@@ -32589,6 +32599,7 @@ function getLogFilePath() {
|
|
|
32589
32599
|
// ../common/src/output-format-context.ts
|
|
32590
32600
|
var formatSlot = singleton("OutputFormat");
|
|
32591
32601
|
var formatExplicitSlot = singleton("OutputFormatExplicit");
|
|
32602
|
+
var helpRequestedSlot = singleton("HelpRequested");
|
|
32592
32603
|
var filterSlot = singleton("OutputFilter");
|
|
32593
32604
|
function getOutputFormat() {
|
|
32594
32605
|
return formatSlot.get("json");
|
|
@@ -33656,6 +33667,9 @@ var OutputFormatter;
|
|
|
33656
33667
|
if (opts?.warning) {
|
|
33657
33668
|
data.Warning = opts.warning;
|
|
33658
33669
|
}
|
|
33670
|
+
if (opts?.pagination) {
|
|
33671
|
+
data.Pagination = opts.pagination;
|
|
33672
|
+
}
|
|
33659
33673
|
success(data);
|
|
33660
33674
|
}
|
|
33661
33675
|
OutputFormatter.emitList = emitList;
|
|
@@ -34117,6 +34131,7 @@ var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
|
34117
34131
|
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
34118
34132
|
// ../common/src/interactivity-context.ts
|
|
34119
34133
|
var modeSlot = singleton("InteractivityMode");
|
|
34134
|
+
var interactiveFlagSlot = singleton("InteractiveFlag");
|
|
34120
34135
|
// ../common/src/option-aliases.ts
|
|
34121
34136
|
function warnDeprecatedOptionAlias(deprecatedFlag, preferredFlag) {
|
|
34122
34137
|
getOutputSink().writeErr(`[WARN] ${deprecatedFlag} is deprecated. Use ${preferredFlag} instead.
|
|
@@ -35399,6 +35414,10 @@ function normalizeTokenRefreshUnavailableFailure() {
|
|
|
35399
35414
|
function errorMessage(error) {
|
|
35400
35415
|
return error instanceof Error ? error.message : String(error);
|
|
35401
35416
|
}
|
|
35417
|
+
|
|
35418
|
+
// ../auth/src/index.ts
|
|
35419
|
+
init_constants();
|
|
35420
|
+
|
|
35402
35421
|
// ../auth/src/interactive.ts
|
|
35403
35422
|
init_src();
|
|
35404
35423
|
|
|
@@ -39632,7 +39651,8 @@ var MAESTRO_ENDPOINTS = {
|
|
|
39632
39651
|
GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
|
|
39633
39652
|
CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
|
|
39634
39653
|
PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
|
|
39635
|
-
RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume
|
|
39654
|
+
RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
|
|
39655
|
+
RETRY: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/retry`
|
|
39636
39656
|
},
|
|
39637
39657
|
INCIDENTS: {
|
|
39638
39658
|
GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
|
|
@@ -39655,7 +39675,9 @@ var MAESTRO_ENDPOINTS = {
|
|
|
39655
39675
|
TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
|
|
39656
39676
|
INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
|
|
39657
39677
|
TOP_PROCESSES_BY_DURATION: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByDuration`,
|
|
39658
|
-
|
|
39678
|
+
INSTANCE_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceCountByStatus`,
|
|
39679
|
+
ELEMENT_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/ElementCountByStatus`,
|
|
39680
|
+
INCIDENTS_BY_TIME_WINDOW: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/IncidentsByTimeWindow`
|
|
39659
39681
|
}
|
|
39660
39682
|
};
|
|
39661
39683
|
var DATA_FABRIC_TENANT_FOLDER_ID = "00000000-0000-0000-0000-000000000000";
|
|
@@ -39665,7 +39687,7 @@ var DATA_FABRIC_ENDPOINTS = {
|
|
|
39665
39687
|
GET_ALL_V2: `${DATAFABRIC_BASE}/api/v2/Entity`,
|
|
39666
39688
|
GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
|
|
39667
39689
|
GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
|
|
39668
|
-
GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
|
|
39690
|
+
GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/v2/EntityService/entity/${entityId}/read/${recordId}`,
|
|
39669
39691
|
INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
|
|
39670
39692
|
BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
|
|
39671
39693
|
UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
|
|
@@ -39690,6 +39712,14 @@ var DATA_FABRIC_ENDPOINTS = {
|
|
|
39690
39712
|
INSERT_BY_NAME: (choiceSetName) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/insert`,
|
|
39691
39713
|
UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
|
|
39692
39714
|
DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`
|
|
39715
|
+
},
|
|
39716
|
+
ROLES: {
|
|
39717
|
+
GET_ALL: `${DATAFABRIC_BASE}/api/v2/Role`
|
|
39718
|
+
},
|
|
39719
|
+
DIRECTORY: {
|
|
39720
|
+
GET_ALL: `${DATAFABRIC_BASE}/api/Directory`,
|
|
39721
|
+
ASSIGN_ROLES: `${DATAFABRIC_BASE}/api/Directory/Role`,
|
|
39722
|
+
REVOKE_ROLES: `${DATAFABRIC_BASE}/api/Directory/RevokeRole`
|
|
39693
39723
|
}
|
|
39694
39724
|
};
|
|
39695
39725
|
var IDENTITY_ENDPOINTS = {
|
|
@@ -39910,7 +39940,7 @@ class EmbeddedTokenManager {
|
|
|
39910
39940
|
this.cancelRefresh?.();
|
|
39911
39941
|
}
|
|
39912
39942
|
}
|
|
39913
|
-
var SDK_VERSION = "1.
|
|
39943
|
+
var SDK_VERSION = "1.5.2";
|
|
39914
39944
|
var CLOUD_ROLE_NAME = "uipath-ts-sdk";
|
|
39915
39945
|
var SDK_SERVICE_NAME = "UiPath.TypeScript.Sdk";
|
|
39916
39946
|
var SDK_LOGGER_NAME = "uipath-ts-sdk-telemetry";
|
|
@@ -41164,16 +41194,16 @@ function toISOUtc(value) {
|
|
|
41164
41194
|
return isNaN(date2.getTime()) ? value : date2.toISOString();
|
|
41165
41195
|
}
|
|
41166
41196
|
function transformData(data, fieldMapping) {
|
|
41197
|
+
if (data == null) {
|
|
41198
|
+
return data;
|
|
41199
|
+
}
|
|
41167
41200
|
if (Array.isArray(data)) {
|
|
41168
41201
|
return data.map((item) => transformData(item, fieldMapping));
|
|
41169
41202
|
}
|
|
41170
|
-
const result = {
|
|
41171
|
-
for (const [
|
|
41172
|
-
|
|
41173
|
-
|
|
41174
|
-
delete result[sourceField];
|
|
41175
|
-
result[targetField] = value;
|
|
41176
|
-
}
|
|
41203
|
+
const result = {};
|
|
41204
|
+
for (const [key, value] of Object.entries(data)) {
|
|
41205
|
+
const renamedKey = fieldMapping[key] ?? key;
|
|
41206
|
+
result[renamedKey] = value;
|
|
41177
41207
|
}
|
|
41178
41208
|
return result;
|
|
41179
41209
|
}
|
|
@@ -41258,6 +41288,26 @@ function transformRequest(data, responseMap) {
|
|
|
41258
41288
|
}
|
|
41259
41289
|
return result;
|
|
41260
41290
|
}
|
|
41291
|
+
var ODATA_FIELD_PARAM_KEYS = ["filter", "orderby", "select", "expand"];
|
|
41292
|
+
var ODATA_TOKEN_RE = /'(?:[^']|'')*'|[A-Za-z_][A-Za-z0-9_]*/g;
|
|
41293
|
+
function rewriteODataIdentifiers(expression, requestMap) {
|
|
41294
|
+
if (!expression)
|
|
41295
|
+
return expression;
|
|
41296
|
+
return expression.replace(ODATA_TOKEN_RE, (match) => match.startsWith("'") ? match : requestMap[match] ?? match);
|
|
41297
|
+
}
|
|
41298
|
+
function transformOptions(options, responseMap) {
|
|
41299
|
+
const requestMap = reverseMap(responseMap);
|
|
41300
|
+
if (Object.keys(requestMap).length === 0)
|
|
41301
|
+
return options;
|
|
41302
|
+
const result = { ...options };
|
|
41303
|
+
for (const key of ODATA_FIELD_PARAM_KEYS) {
|
|
41304
|
+
const value = result[key];
|
|
41305
|
+
if (typeof value === "string") {
|
|
41306
|
+
result[key] = rewriteODataIdentifiers(value, requestMap);
|
|
41307
|
+
}
|
|
41308
|
+
}
|
|
41309
|
+
return result;
|
|
41310
|
+
}
|
|
41261
41311
|
function arrayDictionaryToRecord(dictionary) {
|
|
41262
41312
|
if (!dictionary || !dictionary.keys || !dictionary.values) {
|
|
41263
41313
|
return {};
|
|
@@ -41743,6 +41793,7 @@ var EntityFieldDataType;
|
|
|
41743
41793
|
EntityFieldDataType2["BOOLEAN"] = "BOOLEAN";
|
|
41744
41794
|
EntityFieldDataType2["BIG_INTEGER"] = "BIG_INTEGER";
|
|
41745
41795
|
EntityFieldDataType2["MULTILINE_TEXT"] = "MULTILINE_TEXT";
|
|
41796
|
+
EntityFieldDataType2["MULTILINE_MAX"] = "MULTILINE_MAX";
|
|
41746
41797
|
EntityFieldDataType2["FILE"] = "FILE";
|
|
41747
41798
|
EntityFieldDataType2["CHOICE_SET_SINGLE"] = "CHOICE_SET_SINGLE";
|
|
41748
41799
|
EntityFieldDataType2["CHOICE_SET_MULTIPLE"] = "CHOICE_SET_MULTIPLE";
|
|
@@ -41836,10 +41887,12 @@ var SqlFieldType;
|
|
|
41836
41887
|
SqlFieldType2["BIT"] = "BIT";
|
|
41837
41888
|
SqlFieldType2["DECIMAL"] = "DECIMAL";
|
|
41838
41889
|
SqlFieldType2["MULTILINE"] = "MULTILINE";
|
|
41890
|
+
SqlFieldType2["MULTILINE_MAX"] = "MULTILINE_MAX";
|
|
41839
41891
|
})(SqlFieldType || (SqlFieldType = {}));
|
|
41840
41892
|
var ENTITY_TYPE_IDS = {
|
|
41841
41893
|
[EntityType.ChoiceSet]: 1
|
|
41842
41894
|
};
|
|
41895
|
+
var MAX_QUERY_JOINS = 3;
|
|
41843
41896
|
var EntityMap = {
|
|
41844
41897
|
createTime: "createdTime",
|
|
41845
41898
|
updateTime: "updatedTime",
|
|
@@ -41859,6 +41912,7 @@ var EntitySchemaFieldTypeMap = {
|
|
|
41859
41912
|
[EntityFieldDataType.BOOLEAN]: { sqlTypeName: SqlFieldType.BIT, fieldDisplayType: FieldDisplayType.Basic },
|
|
41860
41913
|
[EntityFieldDataType.BIG_INTEGER]: { sqlTypeName: SqlFieldType.BIGINT, fieldDisplayType: FieldDisplayType.Basic },
|
|
41861
41914
|
[EntityFieldDataType.MULTILINE_TEXT]: { sqlTypeName: SqlFieldType.MULTILINE, fieldDisplayType: FieldDisplayType.Basic },
|
|
41915
|
+
[EntityFieldDataType.MULTILINE_MAX]: { sqlTypeName: SqlFieldType.MULTILINE_MAX, fieldDisplayType: FieldDisplayType.Basic },
|
|
41862
41916
|
[EntityFieldDataType.FILE]: { sqlTypeName: SqlFieldType.UNIQUEIDENTIFIER, fieldDisplayType: FieldDisplayType.File },
|
|
41863
41917
|
[EntityFieldDataType.CHOICE_SET_SINGLE]: { sqlTypeName: SqlFieldType.INT, fieldDisplayType: FieldDisplayType.ChoiceSetSingle },
|
|
41864
41918
|
[EntityFieldDataType.CHOICE_SET_MULTIPLE]: { sqlTypeName: SqlFieldType.NVARCHAR, fieldDisplayType: FieldDisplayType.ChoiceSetMultiple },
|
|
@@ -41875,6 +41929,7 @@ var FieldDisplayTypeToDataType = {
|
|
|
41875
41929
|
var ENTITY_FIELD_CONSTRAINT_DEFAULTS = {
|
|
41876
41930
|
STRING_LENGTH_LIMIT: 200,
|
|
41877
41931
|
MULTILINE_TEXT_LENGTH_LIMIT: 200,
|
|
41932
|
+
MULTILINE_MAX_LENGTH_LIMIT: 128 * 1024,
|
|
41878
41933
|
DECIMAL_LENGTH_LIMIT: 1000,
|
|
41879
41934
|
DECIMAL_PRECISION: 2,
|
|
41880
41935
|
BOOLEAN_LENGTH_LIMIT: 100,
|
|
@@ -41891,6 +41946,9 @@ var ENTITY_FIELD_CONSTRAINT_SPEC = {
|
|
|
41891
41946
|
[EntityFieldDataType.MULTILINE_TEXT]: {
|
|
41892
41947
|
[EntityFieldConstraint.LengthLimit]: { min: 1, max: 1e4 }
|
|
41893
41948
|
},
|
|
41949
|
+
[EntityFieldDataType.MULTILINE_MAX]: {
|
|
41950
|
+
[EntityFieldConstraint.LengthLimit]: { min: 1, max: 128 * 1024 }
|
|
41951
|
+
},
|
|
41894
41952
|
[EntityFieldDataType.INTEGER]: {
|
|
41895
41953
|
[EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
|
|
41896
41954
|
[EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER }
|
|
@@ -41927,7 +41985,8 @@ var EntityFieldTypeMap = {
|
|
|
41927
41985
|
[SqlFieldType.DATE]: EntityFieldDataType.DATE,
|
|
41928
41986
|
[SqlFieldType.BIT]: EntityFieldDataType.BOOLEAN,
|
|
41929
41987
|
[SqlFieldType.DECIMAL]: EntityFieldDataType.DECIMAL,
|
|
41930
|
-
[SqlFieldType.MULTILINE]: EntityFieldDataType.MULTILINE_TEXT
|
|
41988
|
+
[SqlFieldType.MULTILINE]: EntityFieldDataType.MULTILINE_TEXT,
|
|
41989
|
+
[SqlFieldType.MULTILINE_MAX]: EntityFieldDataType.MULTILINE_MAX
|
|
41931
41990
|
};
|
|
41932
41991
|
|
|
41933
41992
|
class EntityService extends BaseService {
|
|
@@ -42030,6 +42089,11 @@ class EntityService extends BaseService {
|
|
|
42030
42089
|
return entities;
|
|
42031
42090
|
}
|
|
42032
42091
|
async queryRecordsById(id, options) {
|
|
42092
|
+
if (options?.joins && options.joins.length > MAX_QUERY_JOINS) {
|
|
42093
|
+
throw new ValidationError({
|
|
42094
|
+
message: `A maximum of ${MAX_QUERY_JOINS} joins is supported per query (received ${options.joins.length})`
|
|
42095
|
+
});
|
|
42096
|
+
}
|
|
42033
42097
|
const { folderKey, expansionLevel, ...rest } = options ?? {};
|
|
42034
42098
|
const downstreamOptions = options === undefined ? undefined : rest;
|
|
42035
42099
|
return PaginationHelpers.getAll({
|
|
@@ -42048,7 +42112,7 @@ class EntityService extends BaseService {
|
|
|
42048
42112
|
countParam: ENTITY_OFFSET_PARAMS.COUNT_PARAM
|
|
42049
42113
|
}
|
|
42050
42114
|
},
|
|
42051
|
-
excludeFromPrefix: ["filterGroup", "selectedFields", "sortOptions", "aggregates", "groupBy"]
|
|
42115
|
+
excludeFromPrefix: ["filterGroup", "selectedFields", "sortOptions", "aggregates", "groupBy", "joins"]
|
|
42052
42116
|
}, downstreamOptions);
|
|
42053
42117
|
}
|
|
42054
42118
|
async importRecordsById(id, file, options) {
|
|
@@ -42278,7 +42342,7 @@ class EntityService extends BaseService {
|
|
|
42278
42342
|
this.validateFieldConstraints(fieldType, field, field.fieldName);
|
|
42279
42343
|
const isRelationship = fieldType === EntityFieldDataType.RELATIONSHIP;
|
|
42280
42344
|
const isFile = fieldType === EntityFieldDataType.FILE;
|
|
42281
|
-
if (
|
|
42345
|
+
if (isRelationship && (!field.referenceEntityId || !field.referenceFieldId)) {
|
|
42282
42346
|
throw new ValidationError({
|
|
42283
42347
|
message: `Field '${field.fieldName}' of type ${fieldType} requires both referenceEntityId and referenceFieldId (UUIDs of the target entity and field).`
|
|
42284
42348
|
});
|
|
@@ -42304,9 +42368,9 @@ class EntityService extends BaseService {
|
|
|
42304
42368
|
...field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId },
|
|
42305
42369
|
...(isRelationship || isFile) && { isForeignKey: true },
|
|
42306
42370
|
...isRelationship && { referenceType: ReferenceType.ManyToOne },
|
|
42307
|
-
|
|
42371
|
+
...!isFile && referenceEntityBody !== undefined && { referenceEntity: referenceEntityBody },
|
|
42308
42372
|
...referenceChoiceSetBody !== undefined && { referenceChoiceSet: referenceChoiceSetBody },
|
|
42309
|
-
|
|
42373
|
+
...!isFile && field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }
|
|
42310
42374
|
};
|
|
42311
42375
|
}
|
|
42312
42376
|
resolveFieldDataType(f) {
|
|
@@ -42351,6 +42415,8 @@ class EntityService extends BaseService {
|
|
|
42351
42415
|
return { lengthLimit: field.lengthLimit ?? defaults.STRING_LENGTH_LIMIT };
|
|
42352
42416
|
case EntityFieldDataType.MULTILINE_TEXT:
|
|
42353
42417
|
return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_TEXT_LENGTH_LIMIT };
|
|
42418
|
+
case EntityFieldDataType.MULTILINE_MAX:
|
|
42419
|
+
return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_MAX_LENGTH_LIMIT };
|
|
42354
42420
|
case EntityFieldDataType.DECIMAL:
|
|
42355
42421
|
return {
|
|
42356
42422
|
lengthLimit: defaults.DECIMAL_LENGTH_LIMIT,
|
|
@@ -42557,143 +42623,300 @@ __decorate([
|
|
|
42557
42623
|
__decorate([
|
|
42558
42624
|
track("Choicesets.DeleteValuesById")
|
|
42559
42625
|
], ChoiceSetService.prototype, "deleteValuesById", null);
|
|
42560
|
-
|
|
42626
|
+
var DataFabricRoleType;
|
|
42627
|
+
(function(DataFabricRoleType2) {
|
|
42628
|
+
DataFabricRoleType2["System"] = "System";
|
|
42629
|
+
DataFabricRoleType2["UserDefined"] = "UserDefined";
|
|
42630
|
+
})(DataFabricRoleType || (DataFabricRoleType = {}));
|
|
42631
|
+
function isRecord$1(value) {
|
|
42632
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
42633
|
+
}
|
|
42634
|
+
function isDataFabricRole(value) {
|
|
42635
|
+
if (!isRecord$1(value)) {
|
|
42636
|
+
return false;
|
|
42637
|
+
}
|
|
42638
|
+
const { id, name, type, directoryEntityCount, folderId } = value;
|
|
42639
|
+
const hasValidDirectoryEntityCount = directoryEntityCount === undefined || directoryEntityCount === null || typeof directoryEntityCount === "number";
|
|
42640
|
+
const hasValidFolderId = folderId === undefined || typeof folderId === "string";
|
|
42641
|
+
return typeof id === "string" && typeof name === "string" && (type === DataFabricRoleType.System || type === DataFabricRoleType.UserDefined) && hasValidDirectoryEntityCount && hasValidFolderId;
|
|
42642
|
+
}
|
|
42643
|
+
function validateRolesResponse(data) {
|
|
42644
|
+
if (Array.isArray(data) && data.every(isDataFabricRole)) {
|
|
42645
|
+
return data;
|
|
42646
|
+
}
|
|
42647
|
+
throw new ServerError({
|
|
42648
|
+
message: "Invalid Data Fabric roles response format."
|
|
42649
|
+
});
|
|
42650
|
+
}
|
|
42651
|
+
|
|
42652
|
+
class DataFabricRoleService extends BaseService {
|
|
42653
|
+
async getAll(options = {}) {
|
|
42654
|
+
const params = createParams({
|
|
42655
|
+
stats: options.stats ?? true
|
|
42656
|
+
});
|
|
42657
|
+
const headers = createHeaders({ [FOLDER_KEY]: options.folderKey });
|
|
42658
|
+
const response = await this.get(DATA_FABRIC_ENDPOINTS.ROLES.GET_ALL, { params, headers });
|
|
42659
|
+
return validateRolesResponse(response.data);
|
|
42660
|
+
}
|
|
42661
|
+
}
|
|
42662
|
+
__decorate([
|
|
42663
|
+
track("DataFabricRoles.GetAll")
|
|
42664
|
+
], DataFabricRoleService.prototype, "getAll", null);
|
|
42665
|
+
var DataFabricDirectoryEntityType;
|
|
42666
|
+
(function(DataFabricDirectoryEntityType2) {
|
|
42667
|
+
DataFabricDirectoryEntityType2[DataFabricDirectoryEntityType2["User"] = 0] = "User";
|
|
42668
|
+
DataFabricDirectoryEntityType2[DataFabricDirectoryEntityType2["Group"] = 1] = "Group";
|
|
42669
|
+
DataFabricDirectoryEntityType2[DataFabricDirectoryEntityType2["Application"] = 2] = "Application";
|
|
42670
|
+
})(DataFabricDirectoryEntityType || (DataFabricDirectoryEntityType = {}));
|
|
42671
|
+
var DataFabricDirectoryEntityTypeName;
|
|
42672
|
+
(function(DataFabricDirectoryEntityTypeName2) {
|
|
42673
|
+
DataFabricDirectoryEntityTypeName2["User"] = "User";
|
|
42674
|
+
DataFabricDirectoryEntityTypeName2["Group"] = "Group";
|
|
42675
|
+
DataFabricDirectoryEntityTypeName2["Application"] = "Application";
|
|
42676
|
+
})(DataFabricDirectoryEntityTypeName || (DataFabricDirectoryEntityTypeName = {}));
|
|
42677
|
+
var DEFAULT_DIRECTORY_PAGE_SIZE = 100;
|
|
42678
|
+
var MAX_DIRECTORY_PAGE_SIZE = 100;
|
|
42679
|
+
function validateDirectoryListResponse(data) {
|
|
42680
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
42681
|
+
throw new ServerError({
|
|
42682
|
+
message: "Invalid Data Fabric directory response format."
|
|
42683
|
+
});
|
|
42684
|
+
}
|
|
42685
|
+
const response = data;
|
|
42686
|
+
if (typeof response.totalCount !== "number" || !Array.isArray(response.results)) {
|
|
42687
|
+
throw new ServerError({
|
|
42688
|
+
message: "Invalid Data Fabric directory response format."
|
|
42689
|
+
});
|
|
42690
|
+
}
|
|
42561
42691
|
return {
|
|
42562
|
-
|
|
42563
|
-
|
|
42564
|
-
throw new Error("Process key is undefined");
|
|
42565
|
-
if (!processData.folderKey)
|
|
42566
|
-
throw new Error("Folder key is undefined");
|
|
42567
|
-
return service.getIncidents(processData.processKey, processData.folderKey);
|
|
42568
|
-
},
|
|
42569
|
-
getElementStats(startTime, endTime, packageVersion) {
|
|
42570
|
-
if (!processData.processKey)
|
|
42571
|
-
throw new Error("Process key is undefined");
|
|
42572
|
-
if (!processData.packageId)
|
|
42573
|
-
throw new Error("Package ID is undefined");
|
|
42574
|
-
return service.getElementStats(processData.processKey, processData.packageId, startTime, endTime, packageVersion);
|
|
42575
|
-
}
|
|
42692
|
+
totalCount: response.totalCount,
|
|
42693
|
+
results: response.results
|
|
42576
42694
|
};
|
|
42577
42695
|
}
|
|
42578
|
-
function
|
|
42579
|
-
|
|
42580
|
-
return Object.assign({}, processData, methods);
|
|
42696
|
+
function isRecord2(value) {
|
|
42697
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
42581
42698
|
}
|
|
42582
|
-
function
|
|
42583
|
-
return
|
|
42584
|
-
|
|
42585
|
-
|
|
42586
|
-
|
|
42587
|
-
|
|
42588
|
-
|
|
42589
|
-
|
|
42590
|
-
|
|
42591
|
-
|
|
42699
|
+
function isDirectoryEntityTypeName(value) {
|
|
42700
|
+
return value === DataFabricDirectoryEntityTypeName.User || value === DataFabricDirectoryEntityTypeName.Group || value === DataFabricDirectoryEntityTypeName.Application;
|
|
42701
|
+
}
|
|
42702
|
+
function isDirectoryRole(value) {
|
|
42703
|
+
if (!isRecord2(value)) {
|
|
42704
|
+
return false;
|
|
42705
|
+
}
|
|
42706
|
+
return typeof value.id === "string" && typeof value.name === "string";
|
|
42707
|
+
}
|
|
42708
|
+
function normalizeDirectoryEntry(entry) {
|
|
42709
|
+
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))) {
|
|
42710
|
+
throw new ServerError({
|
|
42711
|
+
message: "Invalid Data Fabric directory entry response format."
|
|
42712
|
+
});
|
|
42713
|
+
}
|
|
42714
|
+
const normalized = {
|
|
42715
|
+
externalId: entry.externalId,
|
|
42716
|
+
name: entry.name,
|
|
42717
|
+
type: entry.type,
|
|
42718
|
+
roles: entry.roles ?? [],
|
|
42719
|
+
isUIEnabled: entry.isUIEnabled ?? true
|
|
42592
42720
|
};
|
|
42721
|
+
if (entry.email !== undefined) {
|
|
42722
|
+
normalized.email = entry.email;
|
|
42723
|
+
}
|
|
42724
|
+
if (entry.objectType !== undefined) {
|
|
42725
|
+
normalized.objectType = entry.objectType;
|
|
42726
|
+
}
|
|
42727
|
+
return normalized;
|
|
42593
42728
|
}
|
|
42594
|
-
|
|
42595
|
-
const
|
|
42596
|
-
|
|
42597
|
-
startTime: startTime.getTime(),
|
|
42598
|
-
endTime: endTime.getTime(),
|
|
42599
|
-
isCaseManagement
|
|
42600
|
-
},
|
|
42601
|
-
timeSliceUnit: options?.groupBy,
|
|
42602
|
-
timezoneOffset: new Date().getTimezoneOffset() * -1
|
|
42603
|
-
});
|
|
42604
|
-
return response.data ?? [];
|
|
42729
|
+
function normalizePrincipalIds(principalIds) {
|
|
42730
|
+
const ids = Array.isArray(principalIds) ? principalIds : [principalIds];
|
|
42731
|
+
return [...new Set(ids.map((id) => id.trim()).filter(Boolean))];
|
|
42605
42732
|
}
|
|
42606
|
-
function
|
|
42607
|
-
return
|
|
42608
|
-
|
|
42609
|
-
|
|
42610
|
-
|
|
42611
|
-
|
|
42612
|
-
|
|
42613
|
-
version: packageVersion
|
|
42733
|
+
function normalizeRoleIds(roleIds) {
|
|
42734
|
+
return [...new Set(roleIds.map((id) => id.trim()).filter(Boolean))];
|
|
42735
|
+
}
|
|
42736
|
+
function normalizePrincipalType(type) {
|
|
42737
|
+
if (typeof type === "number") {
|
|
42738
|
+
if (type === DataFabricDirectoryEntityType.User || type === DataFabricDirectoryEntityType.Group || type === DataFabricDirectoryEntityType.Application) {
|
|
42739
|
+
return type;
|
|
42614
42740
|
}
|
|
42615
|
-
|
|
42741
|
+
throw new ValidationError({
|
|
42742
|
+
message: "Invalid Data Fabric principal type."
|
|
42743
|
+
});
|
|
42744
|
+
}
|
|
42745
|
+
switch (type) {
|
|
42746
|
+
case DataFabricDirectoryEntityTypeName.User:
|
|
42747
|
+
return DataFabricDirectoryEntityType.User;
|
|
42748
|
+
case DataFabricDirectoryEntityTypeName.Group:
|
|
42749
|
+
return DataFabricDirectoryEntityType.Group;
|
|
42750
|
+
case DataFabricDirectoryEntityTypeName.Application:
|
|
42751
|
+
return DataFabricDirectoryEntityType.Application;
|
|
42752
|
+
default:
|
|
42753
|
+
throw new ValidationError({
|
|
42754
|
+
message: "Invalid Data Fabric principal type."
|
|
42755
|
+
});
|
|
42756
|
+
}
|
|
42757
|
+
}
|
|
42758
|
+
function roleIdsFromEntry(entry) {
|
|
42759
|
+
if (!entry) {
|
|
42760
|
+
return [];
|
|
42761
|
+
}
|
|
42762
|
+
return normalizeRoleIds(entry.roles.map((role) => role.id));
|
|
42763
|
+
}
|
|
42764
|
+
function clampDirectoryPageSize(pageSize) {
|
|
42765
|
+
return Math.max(1, Math.min(pageSize ?? DEFAULT_DIRECTORY_PAGE_SIZE, MAX_DIRECTORY_PAGE_SIZE));
|
|
42616
42766
|
}
|
|
42617
|
-
var ProcessIncidentMap = {
|
|
42618
|
-
errorTimeUtc: "errorTime"
|
|
42619
|
-
};
|
|
42620
|
-
var ProcessIncidentSummaryMap = {
|
|
42621
|
-
firstTimeUtc: "firstOccuranceTime"
|
|
42622
|
-
};
|
|
42623
42767
|
|
|
42624
|
-
class
|
|
42625
|
-
|
|
42626
|
-
const
|
|
42627
|
-
|
|
42628
|
-
|
|
42629
|
-
|
|
42630
|
-
|
|
42631
|
-
|
|
42632
|
-
|
|
42633
|
-
|
|
42634
|
-
}
|
|
42635
|
-
const elementId = idMatch[1];
|
|
42636
|
-
const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
42637
|
-
const name = nameMatch ? nameMatch[1] : "";
|
|
42638
|
-
const activityType = this.formatActivityTypeForIncidents(elementType);
|
|
42639
|
-
const activityName = name || elementId;
|
|
42640
|
-
elementInfo[elementId] = {
|
|
42641
|
-
type: activityType,
|
|
42642
|
-
name: activityName
|
|
42643
|
-
};
|
|
42768
|
+
class DataFabricDirectoryService extends BaseService {
|
|
42769
|
+
async fetchAllEntries(options = {}) {
|
|
42770
|
+
const top = clampDirectoryPageSize(options.pageSize);
|
|
42771
|
+
const entries = [];
|
|
42772
|
+
let skip = 0;
|
|
42773
|
+
while (true) {
|
|
42774
|
+
const page = await this.list(skip === 0 ? { top } : { top, skip });
|
|
42775
|
+
entries.push(...page.results);
|
|
42776
|
+
if (page.results.length < top || page.totalCount !== undefined && entries.length >= page.totalCount) {
|
|
42777
|
+
return entries;
|
|
42644
42778
|
}
|
|
42645
|
-
|
|
42646
|
-
console.warn("Failed to parse BPMN XML for incidents:", error);
|
|
42779
|
+
skip += top;
|
|
42647
42780
|
}
|
|
42648
|
-
return elementInfo;
|
|
42649
42781
|
}
|
|
42650
|
-
|
|
42651
|
-
|
|
42652
|
-
|
|
42653
|
-
|
|
42654
|
-
|
|
42655
|
-
|
|
42656
|
-
|
|
42657
|
-
|
|
42658
|
-
|
|
42659
|
-
|
|
42660
|
-
|
|
42782
|
+
async list(options = {}) {
|
|
42783
|
+
const params = createParams({
|
|
42784
|
+
skip: options.skip,
|
|
42785
|
+
top: clampDirectoryPageSize(options.top)
|
|
42786
|
+
});
|
|
42787
|
+
const response = await this.get(DATA_FABRIC_ENDPOINTS.DIRECTORY.GET_ALL, { params });
|
|
42788
|
+
const data = validateDirectoryListResponse(response.data);
|
|
42789
|
+
const results = data.results.map(normalizeDirectoryEntry);
|
|
42790
|
+
return {
|
|
42791
|
+
totalCount: data.totalCount,
|
|
42792
|
+
results
|
|
42793
|
+
};
|
|
42661
42794
|
}
|
|
42662
|
-
|
|
42663
|
-
|
|
42664
|
-
const id = incident.instanceId || NO_INSTANCE;
|
|
42665
|
-
(acc[id] = acc[id] || []).push(incident);
|
|
42666
|
-
return acc;
|
|
42667
|
-
}, {});
|
|
42668
|
-
const results = await Promise.all(Object.entries(groups).map(async (entry) => {
|
|
42669
|
-
const [instanceId, groupIncidents] = entry;
|
|
42670
|
-
const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
|
|
42671
|
-
return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
42672
|
-
}));
|
|
42673
|
-
return results.flat();
|
|
42795
|
+
async getAll(options = {}) {
|
|
42796
|
+
return this.fetchAllEntries(options);
|
|
42674
42797
|
}
|
|
42675
|
-
|
|
42676
|
-
|
|
42677
|
-
|
|
42798
|
+
async assignRoles(principalIds, principalType, roleIds, options = {}) {
|
|
42799
|
+
const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
|
|
42800
|
+
const normalizedRoleIds = normalizeRoleIds(roleIds);
|
|
42801
|
+
if (normalizedPrincipalIds.length === 0) {
|
|
42802
|
+
throw new ValidationError({ message: "At least one principal ID is required." });
|
|
42678
42803
|
}
|
|
42679
|
-
|
|
42680
|
-
|
|
42681
|
-
return this.parseBpmnElementsForIncidents(bpmnXml);
|
|
42682
|
-
} catch (error) {
|
|
42683
|
-
console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
|
|
42684
|
-
return {};
|
|
42804
|
+
if (normalizedRoleIds.length === 0) {
|
|
42805
|
+
throw new ValidationError({ message: "At least one Data Fabric role ID is required." });
|
|
42685
42806
|
}
|
|
42807
|
+
const type = normalizePrincipalType(principalType);
|
|
42808
|
+
const preserveExisting = options.preserveExisting ?? true;
|
|
42809
|
+
const existingById = new Map;
|
|
42810
|
+
if (preserveExisting) {
|
|
42811
|
+
for (const entry of await this.fetchAllEntries()) {
|
|
42812
|
+
existingById.set(entry.externalId.toLowerCase(), entry);
|
|
42813
|
+
}
|
|
42814
|
+
}
|
|
42815
|
+
return Promise.all(normalizedPrincipalIds.map(async (principalId) => {
|
|
42816
|
+
const existing = existingById.get(principalId.toLowerCase());
|
|
42817
|
+
const mergedRoleIds = preserveExisting ? normalizeRoleIds([...roleIdsFromEntry(existing), ...normalizedRoleIds]) : normalizedRoleIds;
|
|
42818
|
+
const payload = {
|
|
42819
|
+
directoryEntities: [
|
|
42820
|
+
{
|
|
42821
|
+
externalId: principalId,
|
|
42822
|
+
type,
|
|
42823
|
+
resolved: true
|
|
42824
|
+
}
|
|
42825
|
+
],
|
|
42826
|
+
roles: mergedRoleIds,
|
|
42827
|
+
isUIEnabled: options.uiEnabled ?? true
|
|
42828
|
+
};
|
|
42829
|
+
await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.ASSIGN_ROLES, payload);
|
|
42830
|
+
return {
|
|
42831
|
+
principalId,
|
|
42832
|
+
roleIds: mergedRoleIds
|
|
42833
|
+
};
|
|
42834
|
+
}));
|
|
42686
42835
|
}
|
|
42687
|
-
|
|
42688
|
-
const
|
|
42689
|
-
|
|
42690
|
-
|
|
42691
|
-
|
|
42692
|
-
|
|
42693
|
-
|
|
42836
|
+
async revokeRoles(principalIds) {
|
|
42837
|
+
const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
|
|
42838
|
+
if (normalizedPrincipalIds.length === 0) {
|
|
42839
|
+
throw new ValidationError({ message: "At least one principal ID is required." });
|
|
42840
|
+
}
|
|
42841
|
+
const payload = {
|
|
42842
|
+
externalIds: normalizedPrincipalIds
|
|
42694
42843
|
};
|
|
42844
|
+
await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.REVOKE_ROLES, payload);
|
|
42695
42845
|
}
|
|
42696
42846
|
}
|
|
42847
|
+
__decorate([
|
|
42848
|
+
track("DataFabricDirectory.List")
|
|
42849
|
+
], DataFabricDirectoryService.prototype, "list", null);
|
|
42850
|
+
__decorate([
|
|
42851
|
+
track("DataFabricDirectory.GetAll")
|
|
42852
|
+
], DataFabricDirectoryService.prototype, "getAll", null);
|
|
42853
|
+
__decorate([
|
|
42854
|
+
track("DataFabricDirectory.AssignRoles")
|
|
42855
|
+
], DataFabricDirectoryService.prototype, "assignRoles", null);
|
|
42856
|
+
__decorate([
|
|
42857
|
+
track("DataFabricDirectory.RevokeRoles")
|
|
42858
|
+
], DataFabricDirectoryService.prototype, "revokeRoles", null);
|
|
42859
|
+
var InstanceStatsMap = {
|
|
42860
|
+
countOfAllInstances: "totalCount",
|
|
42861
|
+
countOfRunning: "runningCount",
|
|
42862
|
+
countOfTransitioning: "transitioningCount",
|
|
42863
|
+
countOfPaused: "pausedCount",
|
|
42864
|
+
countOfFaulted: "faultedCount",
|
|
42865
|
+
countOfCompleted: "completedCount",
|
|
42866
|
+
countOfCancelled: "cancelledCount",
|
|
42867
|
+
countOfDeleted: "deletedCount"
|
|
42868
|
+
};
|
|
42869
|
+
function createProcessMethods(processData, service) {
|
|
42870
|
+
return {
|
|
42871
|
+
async getIncidents() {
|
|
42872
|
+
if (!processData.processKey)
|
|
42873
|
+
throw new Error("Process key is undefined");
|
|
42874
|
+
if (!processData.folderKey)
|
|
42875
|
+
throw new Error("Folder key is undefined");
|
|
42876
|
+
return service.getIncidents(processData.processKey, processData.folderKey);
|
|
42877
|
+
},
|
|
42878
|
+
getElementStats(startTime, endTime, packageVersion) {
|
|
42879
|
+
if (!processData.processKey)
|
|
42880
|
+
throw new Error("Process key is undefined");
|
|
42881
|
+
if (!processData.packageId)
|
|
42882
|
+
throw new Error("Package ID is undefined");
|
|
42883
|
+
return service.getElementStats({
|
|
42884
|
+
processKey: processData.processKey,
|
|
42885
|
+
packageId: processData.packageId,
|
|
42886
|
+
packageVersion,
|
|
42887
|
+
startTime,
|
|
42888
|
+
endTime
|
|
42889
|
+
});
|
|
42890
|
+
},
|
|
42891
|
+
getInstanceStats(startTime, endTime, packageVersion) {
|
|
42892
|
+
if (!processData.processKey)
|
|
42893
|
+
throw new Error("Process key is undefined");
|
|
42894
|
+
if (!processData.packageId)
|
|
42895
|
+
throw new Error("Package ID is undefined");
|
|
42896
|
+
return service.getInstanceStats({
|
|
42897
|
+
processKey: processData.processKey,
|
|
42898
|
+
packageId: processData.packageId,
|
|
42899
|
+
packageVersion,
|
|
42900
|
+
startTime,
|
|
42901
|
+
endTime
|
|
42902
|
+
});
|
|
42903
|
+
},
|
|
42904
|
+
getInstanceStatusTimeline(startTime, endTime, options) {
|
|
42905
|
+
if (!processData.processKey)
|
|
42906
|
+
throw new Error("Process key is undefined");
|
|
42907
|
+
return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
|
|
42908
|
+
},
|
|
42909
|
+
getIncidentsTimeline(startTime, endTime, options) {
|
|
42910
|
+
if (!processData.processKey)
|
|
42911
|
+
throw new Error("Process key is undefined");
|
|
42912
|
+
return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
|
|
42913
|
+
}
|
|
42914
|
+
};
|
|
42915
|
+
}
|
|
42916
|
+
function createProcessWithMethods(processData, service) {
|
|
42917
|
+
const methods = createProcessMethods(processData, service);
|
|
42918
|
+
return Object.assign({}, processData, methods);
|
|
42919
|
+
}
|
|
42697
42920
|
function createProcessInstanceMethods(instanceData, service) {
|
|
42698
42921
|
return {
|
|
42699
42922
|
async cancel(options) {
|
|
@@ -42717,6 +42940,13 @@ function createProcessInstanceMethods(instanceData, service) {
|
|
|
42717
42940
|
throw new Error("Process instance folder key is undefined");
|
|
42718
42941
|
return service.resume(instanceData.instanceId, instanceData.folderKey, options);
|
|
42719
42942
|
},
|
|
42943
|
+
async retry(options) {
|
|
42944
|
+
if (!instanceData.instanceId)
|
|
42945
|
+
throw new Error("Process instance ID is undefined");
|
|
42946
|
+
if (!instanceData.folderKey)
|
|
42947
|
+
throw new Error("Process instance folder key is undefined");
|
|
42948
|
+
return service.retry(instanceData.instanceId, instanceData.folderKey, options);
|
|
42949
|
+
},
|
|
42720
42950
|
async getIncidents() {
|
|
42721
42951
|
if (!instanceData.instanceId)
|
|
42722
42952
|
throw new Error("Process instance ID is undefined");
|
|
@@ -42781,7 +43011,36 @@ function createCaseMethods(caseData, service) {
|
|
|
42781
43011
|
throw new Error("Process key is undefined");
|
|
42782
43012
|
if (!caseData.packageId)
|
|
42783
43013
|
throw new Error("Package ID is undefined");
|
|
42784
|
-
return service.getElementStats(
|
|
43014
|
+
return service.getElementStats({
|
|
43015
|
+
processKey: caseData.processKey,
|
|
43016
|
+
packageId: caseData.packageId,
|
|
43017
|
+
packageVersion,
|
|
43018
|
+
startTime,
|
|
43019
|
+
endTime
|
|
43020
|
+
});
|
|
43021
|
+
},
|
|
43022
|
+
getInstanceStats(startTime, endTime, packageVersion) {
|
|
43023
|
+
if (!caseData.processKey)
|
|
43024
|
+
throw new Error("Process key is undefined");
|
|
43025
|
+
if (!caseData.packageId)
|
|
43026
|
+
throw new Error("Package ID is undefined");
|
|
43027
|
+
return service.getInstanceStats({
|
|
43028
|
+
processKey: caseData.processKey,
|
|
43029
|
+
packageId: caseData.packageId,
|
|
43030
|
+
packageVersion,
|
|
43031
|
+
startTime,
|
|
43032
|
+
endTime
|
|
43033
|
+
});
|
|
43034
|
+
},
|
|
43035
|
+
getInstanceStatusTimeline(startTime, endTime, options) {
|
|
43036
|
+
if (!caseData.processKey)
|
|
43037
|
+
throw new Error("Process key is undefined");
|
|
43038
|
+
return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
|
|
43039
|
+
},
|
|
43040
|
+
getIncidentsTimeline(startTime, endTime, options) {
|
|
43041
|
+
if (!caseData.processKey)
|
|
43042
|
+
throw new Error("Process key is undefined");
|
|
43043
|
+
return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
|
|
42785
43044
|
}
|
|
42786
43045
|
};
|
|
42787
43046
|
}
|
|
@@ -42920,6 +43179,123 @@ var InstanceFinalStatus;
|
|
|
42920
43179
|
InstanceFinalStatus2["Faulted"] = "Faulted";
|
|
42921
43180
|
InstanceFinalStatus2["Cancelled"] = "Cancelled";
|
|
42922
43181
|
})(InstanceFinalStatus || (InstanceFinalStatus = {}));
|
|
43182
|
+
function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
|
|
43183
|
+
return {
|
|
43184
|
+
commonParams: {
|
|
43185
|
+
startTime: startTime.getTime(),
|
|
43186
|
+
endTime: endTime.getTime(),
|
|
43187
|
+
isCaseManagement,
|
|
43188
|
+
...options?.packageId ? { packageId: options.packageId } : {},
|
|
43189
|
+
...options?.processKey ? { processKey: options.processKey } : {},
|
|
43190
|
+
...options?.version ? { version: options.version } : {}
|
|
43191
|
+
}
|
|
43192
|
+
};
|
|
43193
|
+
}
|
|
43194
|
+
function buildInsightsTimelineBody(startTime, endTime, isCaseManagement, options) {
|
|
43195
|
+
return {
|
|
43196
|
+
commonParams: {
|
|
43197
|
+
startTime: startTime.getTime(),
|
|
43198
|
+
endTime: endTime.getTime(),
|
|
43199
|
+
isCaseManagement,
|
|
43200
|
+
...options?.packageId ? { packageId: options.packageId } : {},
|
|
43201
|
+
...options?.version ? { version: options.version } : {},
|
|
43202
|
+
...options?.processKeys ? { processKeys: options.processKeys } : {}
|
|
43203
|
+
},
|
|
43204
|
+
timeSliceUnit: options?.groupBy ?? TimeInterval.Day,
|
|
43205
|
+
timezoneOffset: new Date().getTimezoneOffset() * -1
|
|
43206
|
+
};
|
|
43207
|
+
}
|
|
43208
|
+
function buildInsightsCommonBody(request) {
|
|
43209
|
+
return {
|
|
43210
|
+
commonParams: {
|
|
43211
|
+
processKey: request.processKey,
|
|
43212
|
+
packageId: request.packageId,
|
|
43213
|
+
startTime: request.startTime.getTime(),
|
|
43214
|
+
endTime: request.endTime.getTime(),
|
|
43215
|
+
version: request.packageVersion
|
|
43216
|
+
}
|
|
43217
|
+
};
|
|
43218
|
+
}
|
|
43219
|
+
var ProcessIncidentMap = {
|
|
43220
|
+
errorTimeUtc: "errorTime"
|
|
43221
|
+
};
|
|
43222
|
+
var ProcessIncidentSummaryMap = {
|
|
43223
|
+
firstTimeUtc: "firstOccuranceTime"
|
|
43224
|
+
};
|
|
43225
|
+
|
|
43226
|
+
class BpmnHelpers {
|
|
43227
|
+
static parseBpmnElementsForIncidents(bpmnXml) {
|
|
43228
|
+
const elementInfo = {};
|
|
43229
|
+
try {
|
|
43230
|
+
const bpmnOpenTagRegex = /<bpmn:([A-Za-z][\w.-]*)\b[^>]*>/g;
|
|
43231
|
+
for (const tagMatch of bpmnXml.matchAll(bpmnOpenTagRegex)) {
|
|
43232
|
+
const [fullTag, elementType] = tagMatch;
|
|
43233
|
+
const idMatch = /\bid\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
43234
|
+
if (!idMatch) {
|
|
43235
|
+
continue;
|
|
43236
|
+
}
|
|
43237
|
+
const elementId = idMatch[1];
|
|
43238
|
+
const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
43239
|
+
const name = nameMatch ? nameMatch[1] : "";
|
|
43240
|
+
const activityType = this.formatActivityTypeForIncidents(elementType);
|
|
43241
|
+
const activityName = name || elementId;
|
|
43242
|
+
elementInfo[elementId] = {
|
|
43243
|
+
type: activityType,
|
|
43244
|
+
name: activityName
|
|
43245
|
+
};
|
|
43246
|
+
}
|
|
43247
|
+
} catch (error) {
|
|
43248
|
+
console.warn("Failed to parse BPMN XML for incidents:", error);
|
|
43249
|
+
}
|
|
43250
|
+
return elementInfo;
|
|
43251
|
+
}
|
|
43252
|
+
static formatActivityTypeForIncidents(elementType) {
|
|
43253
|
+
return elementType.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
43254
|
+
}
|
|
43255
|
+
static async enrichIncidentsWithBpmnData(incidents, folderKey, service) {
|
|
43256
|
+
const uniqueInstanceIds = [...new Set(incidents.map((i) => i.instanceId))];
|
|
43257
|
+
if (uniqueInstanceIds.length === 1) {
|
|
43258
|
+
const elementInfo = await this.getBpmnElementInfo(uniqueInstanceIds[0], folderKey, service);
|
|
43259
|
+
return incidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
43260
|
+
} else {
|
|
43261
|
+
return this.enrichMultipleInstanceIncidents(incidents, folderKey, service);
|
|
43262
|
+
}
|
|
43263
|
+
}
|
|
43264
|
+
static async enrichMultipleInstanceIncidents(incidents, folderKey, service) {
|
|
43265
|
+
const groups = incidents.reduce((acc, incident) => {
|
|
43266
|
+
const id = incident.instanceId || NO_INSTANCE;
|
|
43267
|
+
(acc[id] = acc[id] || []).push(incident);
|
|
43268
|
+
return acc;
|
|
43269
|
+
}, {});
|
|
43270
|
+
const results = await Promise.all(Object.entries(groups).map(async (entry) => {
|
|
43271
|
+
const [instanceId, groupIncidents] = entry;
|
|
43272
|
+
const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
|
|
43273
|
+
return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
43274
|
+
}));
|
|
43275
|
+
return results.flat();
|
|
43276
|
+
}
|
|
43277
|
+
static async getBpmnElementInfo(instanceId, folderKey, service) {
|
|
43278
|
+
if (!instanceId || instanceId === NO_INSTANCE) {
|
|
43279
|
+
return {};
|
|
43280
|
+
}
|
|
43281
|
+
try {
|
|
43282
|
+
const bpmnXml = await service.getBpmn(instanceId, folderKey);
|
|
43283
|
+
return this.parseBpmnElementsForIncidents(bpmnXml);
|
|
43284
|
+
} catch (error) {
|
|
43285
|
+
console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
|
|
43286
|
+
return {};
|
|
43287
|
+
}
|
|
43288
|
+
}
|
|
43289
|
+
static transformIncidentWithBpmn(incident, elementInfo) {
|
|
43290
|
+
const element = elementInfo[incident.elementId];
|
|
43291
|
+
const transformed = transformData(incident, ProcessIncidentMap);
|
|
43292
|
+
return {
|
|
43293
|
+
...transformed,
|
|
43294
|
+
incidentElementActivityType: element?.type || UNKNOWN2,
|
|
43295
|
+
incidentElementActivityName: element?.name || UNKNOWN2
|
|
43296
|
+
};
|
|
43297
|
+
}
|
|
43298
|
+
}
|
|
42923
43299
|
var ProcessInstanceMap = {
|
|
42924
43300
|
startedTimeUtc: "startedTime",
|
|
42925
43301
|
completedTimeUtc: "completedTime",
|
|
@@ -43031,6 +43407,15 @@ class ProcessInstancesService extends BaseService {
|
|
|
43031
43407
|
data: response.data
|
|
43032
43408
|
};
|
|
43033
43409
|
}
|
|
43410
|
+
async retry(instanceId, folderKey, options) {
|
|
43411
|
+
const response = await this.post(MAESTRO_ENDPOINTS.INSTANCES.RETRY(instanceId), options || {}, {
|
|
43412
|
+
headers: createHeaders({ [FOLDER_KEY]: folderKey })
|
|
43413
|
+
});
|
|
43414
|
+
return {
|
|
43415
|
+
success: true,
|
|
43416
|
+
data: response.data
|
|
43417
|
+
};
|
|
43418
|
+
}
|
|
43034
43419
|
parseBpmnVariables(bpmnXml) {
|
|
43035
43420
|
const variableMap = new Map;
|
|
43036
43421
|
const variableSourceMap = this.getVariableSource(bpmnXml);
|
|
@@ -43139,6 +43524,9 @@ __decorate([
|
|
|
43139
43524
|
__decorate([
|
|
43140
43525
|
track("ProcessInstances.Resume")
|
|
43141
43526
|
], ProcessInstancesService.prototype, "resume", null);
|
|
43527
|
+
__decorate([
|
|
43528
|
+
track("ProcessInstances.Retry")
|
|
43529
|
+
], ProcessInstancesService.prototype, "retry", null);
|
|
43142
43530
|
__decorate([
|
|
43143
43531
|
track("ProcessInstances.GetVariables")
|
|
43144
43532
|
], ProcessInstancesService.prototype, "getVariables", null);
|
|
@@ -43180,7 +43568,12 @@ class MaestroProcessesService extends BaseService {
|
|
|
43180
43568
|
}));
|
|
43181
43569
|
}
|
|
43182
43570
|
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
43183
|
-
|
|
43571
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, false, options));
|
|
43572
|
+
return data ?? [];
|
|
43573
|
+
}
|
|
43574
|
+
async getIncidentsTimeline(startTime, endTime, options) {
|
|
43575
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, false, options));
|
|
43576
|
+
return data?.dataPoints ?? [];
|
|
43184
43577
|
}
|
|
43185
43578
|
async getTopFaultedCount(startTime, endTime, options) {
|
|
43186
43579
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
|
|
@@ -43195,10 +43588,14 @@ class MaestroProcessesService extends BaseService {
|
|
|
43195
43588
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_DURATION, buildInsightsTopBody(startTime, endTime, false, options));
|
|
43196
43589
|
return (data ?? []).map((process10) => ({ ...process10, name: process10.packageId }));
|
|
43197
43590
|
}
|
|
43198
|
-
async getElementStats(
|
|
43199
|
-
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS,
|
|
43591
|
+
async getElementStats(request) {
|
|
43592
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
43200
43593
|
return data ?? [];
|
|
43201
43594
|
}
|
|
43595
|
+
async getInstanceStats(request) {
|
|
43596
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
43597
|
+
return transformData(data, InstanceStatsMap);
|
|
43598
|
+
}
|
|
43202
43599
|
}
|
|
43203
43600
|
__decorate([
|
|
43204
43601
|
track("MaestroProcesses.GetAll")
|
|
@@ -43215,6 +43612,9 @@ __decorate([
|
|
|
43215
43612
|
__decorate([
|
|
43216
43613
|
track("MaestroProcesses.GetInstanceStatusTimeline")
|
|
43217
43614
|
], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
|
|
43615
|
+
__decorate([
|
|
43616
|
+
track("MaestroProcesses.GetIncidentsTimeline")
|
|
43617
|
+
], MaestroProcessesService.prototype, "getIncidentsTimeline", null);
|
|
43218
43618
|
__decorate([
|
|
43219
43619
|
track("MaestroProcesses.GetTopFaultedCount")
|
|
43220
43620
|
], MaestroProcessesService.prototype, "getTopFaultedCount", null);
|
|
@@ -43224,6 +43624,9 @@ __decorate([
|
|
|
43224
43624
|
__decorate([
|
|
43225
43625
|
track("MaestroProcesses.GetElementStats")
|
|
43226
43626
|
], MaestroProcessesService.prototype, "getElementStats", null);
|
|
43627
|
+
__decorate([
|
|
43628
|
+
track("MaestroProcesses.GetInstanceStats")
|
|
43629
|
+
], MaestroProcessesService.prototype, "getInstanceStats", null);
|
|
43227
43630
|
|
|
43228
43631
|
class ProcessIncidentsService extends BaseService {
|
|
43229
43632
|
async getAll() {
|
|
@@ -43266,7 +43669,12 @@ class CasesService extends BaseService {
|
|
|
43266
43669
|
}));
|
|
43267
43670
|
}
|
|
43268
43671
|
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
43269
|
-
|
|
43672
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, true, options));
|
|
43673
|
+
return data ?? [];
|
|
43674
|
+
}
|
|
43675
|
+
async getIncidentsTimeline(startTime, endTime, options) {
|
|
43676
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, true, options));
|
|
43677
|
+
return data?.dataPoints ?? [];
|
|
43270
43678
|
}
|
|
43271
43679
|
async getTopFaultedCount(startTime, endTime, options) {
|
|
43272
43680
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
|
|
@@ -43281,10 +43689,14 @@ class CasesService extends BaseService {
|
|
|
43281
43689
|
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_DURATION, buildInsightsTopBody(startTime, endTime, true, options));
|
|
43282
43690
|
return (data ?? []).map((process10) => ({ ...process10, name: this.extractCaseName(process10.packageId) }));
|
|
43283
43691
|
}
|
|
43284
|
-
async getElementStats(
|
|
43285
|
-
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS,
|
|
43692
|
+
async getElementStats(request) {
|
|
43693
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
43286
43694
|
return data ?? [];
|
|
43287
43695
|
}
|
|
43696
|
+
async getInstanceStats(request) {
|
|
43697
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
43698
|
+
return transformData(data, InstanceStatsMap);
|
|
43699
|
+
}
|
|
43288
43700
|
extractCaseName(packageId) {
|
|
43289
43701
|
const caseManagementIndex = packageId.indexOf("CaseManagement.");
|
|
43290
43702
|
if (caseManagementIndex !== -1) {
|
|
@@ -43306,6 +43718,9 @@ __decorate([
|
|
|
43306
43718
|
__decorate([
|
|
43307
43719
|
track("Cases.GetInstanceStatusTimeline")
|
|
43308
43720
|
], CasesService.prototype, "getInstanceStatusTimeline", null);
|
|
43721
|
+
__decorate([
|
|
43722
|
+
track("Cases.GetIncidentsTimeline")
|
|
43723
|
+
], CasesService.prototype, "getIncidentsTimeline", null);
|
|
43309
43724
|
__decorate([
|
|
43310
43725
|
track("Cases.GetTopFaultedCount")
|
|
43311
43726
|
], CasesService.prototype, "getTopFaultedCount", null);
|
|
@@ -43315,6 +43730,9 @@ __decorate([
|
|
|
43315
43730
|
__decorate([
|
|
43316
43731
|
track("Cases.GetElementStats")
|
|
43317
43732
|
], CasesService.prototype, "getElementStats", null);
|
|
43733
|
+
__decorate([
|
|
43734
|
+
track("Cases.GetInstanceStats")
|
|
43735
|
+
], CasesService.prototype, "getInstanceStats", null);
|
|
43318
43736
|
var CaseInstanceMap = {
|
|
43319
43737
|
startedTimeUtc: "startedTime",
|
|
43320
43738
|
completedTimeUtc: "completedTime",
|
|
@@ -43447,6 +43865,7 @@ class TaskService extends BaseService {
|
|
|
43447
43865
|
const transformedTask = transformData(pascalToCamelCaseKeys(task), TaskMap);
|
|
43448
43866
|
return createTaskWithMethods(applyDataTransforms(transformedTask, { field: "status", valueMap: TaskStatusMap }), this);
|
|
43449
43867
|
};
|
|
43868
|
+
const apiOptions = options ? transformOptions(options, TaskMap) : options;
|
|
43450
43869
|
return PaginationHelpers.getAll({
|
|
43451
43870
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
43452
43871
|
getEndpoint: () => endpoint,
|
|
@@ -43463,7 +43882,7 @@ class TaskService extends BaseService {
|
|
|
43463
43882
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
43464
43883
|
}
|
|
43465
43884
|
}
|
|
43466
|
-
},
|
|
43885
|
+
}, apiOptions);
|
|
43467
43886
|
}
|
|
43468
43887
|
async getById(id, options = {}, folderId) {
|
|
43469
43888
|
const { taskType, ...restOptions } = options;
|
|
@@ -43475,8 +43894,8 @@ class TaskService extends BaseService {
|
|
|
43475
43894
|
}
|
|
43476
43895
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
43477
43896
|
const modifiedOptions = this.addDefaultExpand(restOptions);
|
|
43478
|
-
const
|
|
43479
|
-
const apiOptions = addPrefixToKeys(
|
|
43897
|
+
const apiFieldOptions = transformOptions(modifiedOptions, TaskMap);
|
|
43898
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
43480
43899
|
const response = await this.get(TASK_ENDPOINTS.GET_BY_ID(id), {
|
|
43481
43900
|
params: apiOptions,
|
|
43482
43901
|
headers
|
|
@@ -43941,7 +44360,7 @@ class FolderScopedService extends BaseService {
|
|
|
43941
44360
|
}
|
|
43942
44361
|
return response.data?.value;
|
|
43943
44362
|
}
|
|
43944
|
-
async getByNameLookup(resourceType, endpoint, name, options, transform2) {
|
|
44363
|
+
async getByNameLookup(resourceType, endpoint, name, options, transform2, responseFieldMap) {
|
|
43945
44364
|
const validatedName = validateName(resourceType, name);
|
|
43946
44365
|
const { folderId, folderKey, folderPath, ...queryOptions } = options;
|
|
43947
44366
|
const headers = resolveFolderHeaders({
|
|
@@ -43951,8 +44370,9 @@ class FolderScopedService extends BaseService {
|
|
|
43951
44370
|
resourceType: `${resourceType}.getByName`,
|
|
43952
44371
|
fallbackFolderKey: this.config.folderKey
|
|
43953
44372
|
});
|
|
44373
|
+
const apiFieldOptions = responseFieldMap ? transformOptions(queryOptions, responseFieldMap) : queryOptions;
|
|
43954
44374
|
const apiOptions = {
|
|
43955
|
-
...addPrefixToKeys(
|
|
44375
|
+
...addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions)),
|
|
43956
44376
|
$filter: `Name eq '${validatedName.replace(SINGLE_QUOTE_RE, "''")}'`,
|
|
43957
44377
|
$top: "1"
|
|
43958
44378
|
};
|
|
@@ -44002,6 +44422,7 @@ var AssetMap = {
|
|
|
44002
44422
|
class AssetService extends FolderScopedService {
|
|
44003
44423
|
async getAll(options) {
|
|
44004
44424
|
const transformAssetResponse = (asset) => transformData(pascalToCamelCaseKeys(asset), AssetMap);
|
|
44425
|
+
const apiOptions = options ? transformOptions(options, AssetMap) : options;
|
|
44005
44426
|
return PaginationHelpers.getAll({
|
|
44006
44427
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
44007
44428
|
getEndpoint: (folderId) => folderId ? ASSET_ENDPOINTS.GET_BY_FOLDER : ASSET_ENDPOINTS.GET_ALL,
|
|
@@ -44017,12 +44438,12 @@ class AssetService extends FolderScopedService {
|
|
|
44017
44438
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
44018
44439
|
}
|
|
44019
44440
|
}
|
|
44020
|
-
},
|
|
44441
|
+
}, apiOptions);
|
|
44021
44442
|
}
|
|
44022
44443
|
async getById(id, folderId, options = {}) {
|
|
44023
44444
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
44024
|
-
const
|
|
44025
|
-
const apiOptions = addPrefixToKeys(
|
|
44445
|
+
const apiFieldOptions = transformOptions(options, AssetMap);
|
|
44446
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
44026
44447
|
const response = await this.get(ASSET_ENDPOINTS.GET_BY_ID(id), {
|
|
44027
44448
|
headers,
|
|
44028
44449
|
params: apiOptions
|
|
@@ -44031,7 +44452,7 @@ class AssetService extends FolderScopedService {
|
|
|
44031
44452
|
return transformedAsset;
|
|
44032
44453
|
}
|
|
44033
44454
|
async getByName(name, options = {}) {
|
|
44034
|
-
return this.getByNameLookup("Asset", ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap));
|
|
44455
|
+
return this.getByNameLookup("Asset", ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap), AssetMap);
|
|
44035
44456
|
}
|
|
44036
44457
|
async updateValueById(id, newValue, options) {
|
|
44037
44458
|
if (!id) {
|
|
@@ -44170,6 +44591,7 @@ class BucketService extends FolderScopedService {
|
|
|
44170
44591
|
fallbackFolderKey: this.config.folderKey
|
|
44171
44592
|
});
|
|
44172
44593
|
const transformBlobItem = (item) => transformData(item, BucketMap);
|
|
44594
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
44173
44595
|
return PaginationHelpers.getAll({
|
|
44174
44596
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
44175
44597
|
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILE_META_DATA(bucketId),
|
|
@@ -44185,7 +44607,7 @@ class BucketService extends FolderScopedService {
|
|
|
44185
44607
|
},
|
|
44186
44608
|
excludeFromPrefix: ["prefix"],
|
|
44187
44609
|
headers
|
|
44188
|
-
},
|
|
44610
|
+
}, apiRestOptions);
|
|
44189
44611
|
}
|
|
44190
44612
|
async uploadFile(bucketIdOrOptions, path3, content, options) {
|
|
44191
44613
|
let bucketId;
|
|
@@ -44260,9 +44682,10 @@ class BucketService extends FolderScopedService {
|
|
|
44260
44682
|
resourceType: "Buckets.getReadUri",
|
|
44261
44683
|
fallbackFolderKey: this.config.folderKey
|
|
44262
44684
|
});
|
|
44685
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
44263
44686
|
const queryOptions = {
|
|
44264
44687
|
expiryInMinutes,
|
|
44265
|
-
...addPrefixToKeys(
|
|
44688
|
+
...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
|
|
44266
44689
|
};
|
|
44267
44690
|
return this._getUri(BUCKET_ENDPOINTS.GET_READ_URI(bucketId), bucketId, resolvedPath, headers, queryOptions);
|
|
44268
44691
|
}
|
|
@@ -44316,6 +44739,7 @@ class BucketService extends FolderScopedService {
|
|
|
44316
44739
|
fallbackFolderKey: this.config.folderKey
|
|
44317
44740
|
});
|
|
44318
44741
|
const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
|
|
44742
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
44319
44743
|
return PaginationHelpers.getAll({
|
|
44320
44744
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
44321
44745
|
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
|
|
@@ -44332,7 +44756,7 @@ class BucketService extends FolderScopedService {
|
|
|
44332
44756
|
},
|
|
44333
44757
|
excludeFromPrefix: ["directory", "recursive", "fileNameRegex"],
|
|
44334
44758
|
headers
|
|
44335
|
-
}, { ...
|
|
44759
|
+
}, { ...apiRestOptions, directory: "/", recursive: true });
|
|
44336
44760
|
}
|
|
44337
44761
|
async deleteFile(bucketId, path3, options) {
|
|
44338
44762
|
if (!bucketId) {
|
|
@@ -44355,9 +44779,10 @@ class BucketService extends FolderScopedService {
|
|
|
44355
44779
|
}
|
|
44356
44780
|
async _getWriteUri(options) {
|
|
44357
44781
|
const { bucketId, path: path3, expiryInMinutes, headers, ...restOptions } = options;
|
|
44782
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
44358
44783
|
const queryOptions = {
|
|
44359
44784
|
expiryInMinutes,
|
|
44360
|
-
...addPrefixToKeys(
|
|
44785
|
+
...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
|
|
44361
44786
|
};
|
|
44362
44787
|
return this._getUri(BUCKET_ENDPOINTS.GET_WRITE_URI(bucketId), bucketId, path3, headers, queryOptions);
|
|
44363
44788
|
}
|
|
@@ -44450,8 +44875,8 @@ class AttachmentService extends BaseService {
|
|
|
44450
44875
|
if (!id) {
|
|
44451
44876
|
throw new ValidationError({ message: "id is required for getById" });
|
|
44452
44877
|
}
|
|
44453
|
-
const
|
|
44454
|
-
const apiOptions = addPrefixToKeys(
|
|
44878
|
+
const apiFieldOptions = transformOptions(options, { ...AttachmentsMap, ...BucketMap });
|
|
44879
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
44455
44880
|
const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
|
|
44456
44881
|
params: apiOptions
|
|
44457
44882
|
});
|
|
@@ -44616,6 +45041,7 @@ class JobService extends FolderScopedService {
|
|
|
44616
45041
|
const rawJob = transformData(pascalToCamelCaseKeys(job), JobMap);
|
|
44617
45042
|
return createJobWithMethods(rawJob, this);
|
|
44618
45043
|
};
|
|
45044
|
+
const apiOptions = options ? transformOptions(options, JobMap) : options;
|
|
44619
45045
|
return PaginationHelpers.getAll({
|
|
44620
45046
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
44621
45047
|
getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
|
|
@@ -44631,7 +45057,7 @@ class JobService extends FolderScopedService {
|
|
|
44631
45057
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
44632
45058
|
}
|
|
44633
45059
|
}
|
|
44634
|
-
},
|
|
45060
|
+
}, apiOptions);
|
|
44635
45061
|
}
|
|
44636
45062
|
async getById(id, folderId, options) {
|
|
44637
45063
|
if (!id) {
|
|
@@ -44641,8 +45067,8 @@ class JobService extends FolderScopedService {
|
|
|
44641
45067
|
throw new ValidationError({ message: "folderId is required for getById" });
|
|
44642
45068
|
}
|
|
44643
45069
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
44644
|
-
const
|
|
44645
|
-
const apiOptions =
|
|
45070
|
+
const apiFieldOptions = options ? transformOptions(options, JobMap) : {};
|
|
45071
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
44646
45072
|
const response = await this.get(JOB_ENDPOINTS.GET_BY_KEY(id), {
|
|
44647
45073
|
params: apiOptions,
|
|
44648
45074
|
headers
|
|
@@ -44810,6 +45236,8 @@ var JobState;
|
|
|
44810
45236
|
JobState2["Stopped"] = "Stopped";
|
|
44811
45237
|
JobState2["Suspended"] = "Suspended";
|
|
44812
45238
|
JobState2["Resumed"] = "Resumed";
|
|
45239
|
+
JobState2["Cancelled"] = "Cancelled";
|
|
45240
|
+
JobState2["Unknown"] = "Unknown";
|
|
44813
45241
|
})(JobState || (JobState = {}));
|
|
44814
45242
|
var ProcessMap = {
|
|
44815
45243
|
lastModificationTime: "lastModifiedTime",
|
|
@@ -44828,6 +45256,7 @@ var ProcessMap = {
|
|
|
44828
45256
|
class ProcessService extends FolderScopedService {
|
|
44829
45257
|
async getAll(options) {
|
|
44830
45258
|
const transformProcessResponse = (process10) => transformData(pascalToCamelCaseKeys(process10), ProcessMap);
|
|
45259
|
+
const apiOptions = options ? transformOptions(options, ProcessMap) : options;
|
|
44831
45260
|
return PaginationHelpers.getAll({
|
|
44832
45261
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
44833
45262
|
getEndpoint: () => PROCESS_ENDPOINTS.GET_ALL,
|
|
@@ -44843,7 +45272,7 @@ class ProcessService extends FolderScopedService {
|
|
|
44843
45272
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
44844
45273
|
}
|
|
44845
45274
|
}
|
|
44846
|
-
},
|
|
45275
|
+
}, apiOptions);
|
|
44847
45276
|
}
|
|
44848
45277
|
async start(request, optionsOrFolderId, legacyOptions) {
|
|
44849
45278
|
let folderId;
|
|
@@ -44871,8 +45300,8 @@ class ProcessService extends FolderScopedService {
|
|
|
44871
45300
|
const requestBody = {
|
|
44872
45301
|
startInfo: apiRequest
|
|
44873
45302
|
};
|
|
44874
|
-
const
|
|
44875
|
-
const apiOptions = addPrefixToKeys(
|
|
45303
|
+
const apiFieldOptions = transformOptions(queryOptions, ProcessMap);
|
|
45304
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
44876
45305
|
const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
|
|
44877
45306
|
params: apiOptions,
|
|
44878
45307
|
headers
|
|
@@ -44882,8 +45311,8 @@ class ProcessService extends FolderScopedService {
|
|
|
44882
45311
|
}
|
|
44883
45312
|
async getById(id, folderId, options = {}) {
|
|
44884
45313
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
44885
|
-
const
|
|
44886
|
-
const apiOptions = addPrefixToKeys(
|
|
45314
|
+
const apiFieldOptions = transformOptions(options, ProcessMap);
|
|
45315
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
44887
45316
|
const response = await this.get(PROCESS_ENDPOINTS.GET_BY_ID(id), {
|
|
44888
45317
|
headers,
|
|
44889
45318
|
params: apiOptions
|
|
@@ -44892,7 +45321,7 @@ class ProcessService extends FolderScopedService {
|
|
|
44892
45321
|
return transformedProcess;
|
|
44893
45322
|
}
|
|
44894
45323
|
async getByName(name, options = {}) {
|
|
44895
|
-
return this.getByNameLookup("Process", PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap));
|
|
45324
|
+
return this.getByNameLookup("Process", PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap), ProcessMap);
|
|
44896
45325
|
}
|
|
44897
45326
|
}
|
|
44898
45327
|
__decorate([
|
|
@@ -44916,6 +45345,7 @@ var QueueMap = {
|
|
|
44916
45345
|
class QueueService extends FolderScopedService {
|
|
44917
45346
|
async getAll(options) {
|
|
44918
45347
|
const transformQueueResponse = (queue) => transformData(pascalToCamelCaseKeys(queue), QueueMap);
|
|
45348
|
+
const apiOptions = options ? transformOptions(options, QueueMap) : options;
|
|
44919
45349
|
return PaginationHelpers.getAll({
|
|
44920
45350
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
44921
45351
|
getEndpoint: (folderId) => folderId ? QUEUE_ENDPOINTS.GET_BY_FOLDER : QUEUE_ENDPOINTS.GET_ALL,
|
|
@@ -44931,12 +45361,12 @@ class QueueService extends FolderScopedService {
|
|
|
44931
45361
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
44932
45362
|
}
|
|
44933
45363
|
}
|
|
44934
|
-
},
|
|
45364
|
+
}, apiOptions);
|
|
44935
45365
|
}
|
|
44936
45366
|
async getById(id, folderId, options = {}) {
|
|
44937
45367
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
44938
|
-
const
|
|
44939
|
-
const apiOptions = addPrefixToKeys(
|
|
45368
|
+
const apiFieldOptions = transformOptions(options, QueueMap);
|
|
45369
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
44940
45370
|
const response = await this.get(QUEUE_ENDPOINTS.GET_BY_ID(id), {
|
|
44941
45371
|
headers,
|
|
44942
45372
|
params: apiOptions
|
|
@@ -44977,7 +45407,9 @@ class UiPath2 extends UiPath$1 {
|
|
|
44977
45407
|
}
|
|
44978
45408
|
get entities() {
|
|
44979
45409
|
return Object.assign(this.getService(EntityService), {
|
|
44980
|
-
choicesets: this.getService(ChoiceSetService)
|
|
45410
|
+
choicesets: this.getService(ChoiceSetService),
|
|
45411
|
+
roles: this.getService(DataFabricRoleService),
|
|
45412
|
+
directory: this.getService(DataFabricDirectoryService)
|
|
44981
45413
|
});
|
|
44982
45414
|
}
|
|
44983
45415
|
get tasks() {
|
|
@@ -45082,6 +45514,17 @@ var AgentErrorSortColumn;
|
|
|
45082
45514
|
AgentErrorSortColumn2["LastSeenFolderName"] = "LastSeenFolderName";
|
|
45083
45515
|
AgentErrorSortColumn2["LastSeenFolderPath"] = "LastSeenFolderPath";
|
|
45084
45516
|
})(AgentErrorSortColumn || (AgentErrorSortColumn = {}));
|
|
45517
|
+
var AgentType;
|
|
45518
|
+
(function(AgentType2) {
|
|
45519
|
+
AgentType2["Autonomous"] = "Autonomous";
|
|
45520
|
+
AgentType2["Conversational"] = "Conversational";
|
|
45521
|
+
AgentType2["Coded"] = "Coded";
|
|
45522
|
+
})(AgentType || (AgentType = {}));
|
|
45523
|
+
var AgentExecutionType;
|
|
45524
|
+
(function(AgentExecutionType2) {
|
|
45525
|
+
AgentExecutionType2["Debug"] = "Debug";
|
|
45526
|
+
AgentExecutionType2["Runtime"] = "Runtime";
|
|
45527
|
+
})(AgentExecutionType || (AgentExecutionType = {}));
|
|
45085
45528
|
var AgentMemoryExecutionType;
|
|
45086
45529
|
(function(AgentMemoryExecutionType2) {
|
|
45087
45530
|
AgentMemoryExecutionType2["Debug"] = "Debug";
|
|
@@ -45375,6 +45818,28 @@ var SpanAttachmentDirection;
|
|
|
45375
45818
|
SpanAttachmentDirection2["In"] = "In";
|
|
45376
45819
|
SpanAttachmentDirection2["Out"] = "Out";
|
|
45377
45820
|
})(SpanAttachmentDirection || (SpanAttachmentDirection = {}));
|
|
45821
|
+
var AgentGovernanceMode;
|
|
45822
|
+
(function(AgentGovernanceMode2) {
|
|
45823
|
+
AgentGovernanceMode2["Audit"] = "AUDIT";
|
|
45824
|
+
AgentGovernanceMode2["Enforce"] = "ENFORCE";
|
|
45825
|
+
AgentGovernanceMode2["Unknown"] = "Unknown";
|
|
45826
|
+
})(AgentGovernanceMode || (AgentGovernanceMode = {}));
|
|
45827
|
+
var AgentGovernanceVerdict;
|
|
45828
|
+
(function(AgentGovernanceVerdict2) {
|
|
45829
|
+
AgentGovernanceVerdict2["Allow"] = "ALLOW";
|
|
45830
|
+
AgentGovernanceVerdict2["Deny"] = "DENY";
|
|
45831
|
+
AgentGovernanceVerdict2["Unknown"] = "Unknown";
|
|
45832
|
+
})(AgentGovernanceVerdict || (AgentGovernanceVerdict = {}));
|
|
45833
|
+
var AgentGovernanceSection;
|
|
45834
|
+
(function(AgentGovernanceSection2) {
|
|
45835
|
+
AgentGovernanceSection2["Totals"] = "totals";
|
|
45836
|
+
AgentGovernanceSection2["Hook"] = "hook";
|
|
45837
|
+
AgentGovernanceSection2["Agent"] = "agent";
|
|
45838
|
+
AgentGovernanceSection2["Policy"] = "policy";
|
|
45839
|
+
AgentGovernanceSection2["Pack"] = "pack";
|
|
45840
|
+
AgentGovernanceSection2["Action"] = "action";
|
|
45841
|
+
AgentGovernanceSection2["Mode"] = "mode";
|
|
45842
|
+
})(AgentGovernanceSection || (AgentGovernanceSection = {}));
|
|
45378
45843
|
|
|
45379
45844
|
// src/utils/sdk-client.ts
|
|
45380
45845
|
var createDataFabricClient = async (tenantOverride) => {
|
|
@@ -45880,15 +46345,15 @@ var ENTITIES_DELETE_EXAMPLES = [
|
|
|
45880
46345
|
];
|
|
45881
46346
|
var ENTITIES_CREATE_EXAMPLES = [
|
|
45882
46347
|
{
|
|
45883
|
-
Description: "Create an entity with choice-set, relationship, and file fields. " + "CHOICE_SET_SINGLE/CHOICE_SET_MULTIPLE require 'choiceSetId' (from 'df choice-sets list'). " + "RELATIONSHIP
|
|
45884
|
-
Command: `uip df entities create Expense --body '{"displayName":"Expense","fields":[{"fieldName":"category","type":"CHOICE_SET_SINGLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000001","isRequired":true},{"fieldName":"tags","type":"CHOICE_SET_MULTIPLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000002"},{"fieldName":"submitter","type":"RELATIONSHIP","referenceEntityId":"a1b2c3d4-0000-0000-0000-000000000010","referenceFieldId":"f1000000-0000-0000-0000-000000000100","isRequired":true},{"fieldName":"receipt","type":"FILE"
|
|
46348
|
+
Description: "Create an entity with choice-set, relationship, and file fields. " + "CHOICE_SET_SINGLE/CHOICE_SET_MULTIPLE require 'choiceSetId' (from 'df choice-sets list'). " + "RELATIONSHIP requires 'referenceEntityId' (UUID of the target entity, from 'df entities list') and 'referenceFieldId' (UUID of the field on the target entity, from 'df entities get <target-id>'). " + "Note: a RELATIONSHIP column on a record always stores the target record's UUID 'Id' (regardless of which 'referenceFieldId' configured the join) — see 'df records insert' for how to write the value. " + "FILE fields take only 'fieldName' and 'type' — the server auto-wires the internal attachment reference; populate them later with 'uip df files upload <entity-id> <record-id> <field-name> --file <path>'.",
|
|
46349
|
+
Command: `uip df entities create Expense --body '{"displayName":"Expense","fields":[{"fieldName":"category","type":"CHOICE_SET_SINGLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000001","isRequired":true},{"fieldName":"tags","type":"CHOICE_SET_MULTIPLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000002"},{"fieldName":"submitter","type":"RELATIONSHIP","referenceEntityId":"a1b2c3d4-0000-0000-0000-000000000010","referenceFieldId":"f1000000-0000-0000-0000-000000000100","isRequired":true},{"fieldName":"receipt","type":"FILE"}]}'`,
|
|
45885
46350
|
Output: {
|
|
45886
46351
|
Code: "EntityCreated",
|
|
45887
46352
|
Data: { ID: "a1b2c3d4-0000-0000-0000-000000000004" }
|
|
45888
46353
|
}
|
|
45889
46354
|
},
|
|
45890
46355
|
{
|
|
45891
|
-
Description: "Create a folder-scoped entity with cross-folder references. " + "Pass '--folder-key' to place the new entity in a folder. " + "Per-field 'referenceFolderKey' points a RELATIONSHIP
|
|
46356
|
+
Description: "Create a folder-scoped entity with cross-folder references. " + "Pass '--folder-key' to place the new entity in a folder. " + "Per-field 'referenceFolderKey' points a RELATIONSHIP or CHOICE_SET_* field at a target that lives in a different folder (or at the tenant level when omitted). " + "Get target entity/field IDs from 'df entities list --folder-key <key>' and 'df entities get <id> --folder-key <key>'; get choice-set IDs from 'df choice-sets list --folder-key <key>' (omit '--folder-key' for tenant-level choice sets).",
|
|
45892
46357
|
Command: `uip df entities create OrderLine --folder-key f1000000-0000-0000-0000-000000000050 --body '{"displayName":"Order Line","fields":[{"fieldName":"order","type":"RELATIONSHIP","referenceEntityId":"a1b2c3d4-0000-0000-0000-000000000010","referenceFieldId":"f1000000-0000-0000-0000-000000000100","referenceFolderKey":"f1000000-0000-0000-0000-000000000060","isRequired":true},{"fieldName":"userType","type":"CHOICE_SET_SINGLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000077"}]}'`,
|
|
45893
46358
|
Output: {
|
|
45894
46359
|
Code: "EntityCreated",
|
|
@@ -46351,6 +46816,38 @@ var RECORDS_UPDATE_EXAMPLES = [
|
|
|
46351
46816
|
}
|
|
46352
46817
|
}
|
|
46353
46818
|
];
|
|
46819
|
+
var RECORDS_QUERY_EXAMPLES = [
|
|
46820
|
+
{
|
|
46821
|
+
Description: "Filter records — exact keys: filterGroup / queryFilters / fieldName / operator / value. " + "Operators: = != > < >= <= contains 'not contains' startswith endswith in 'not in'. " + "Not accepted: 'filters', 'field', '==', 'Equals', 'eq', 'like'.",
|
|
46822
|
+
Command: "uip df records query a1b2c3d4-0000-0000-0000-000000000001 " + `--body '{"filterGroup":{"logicalOperator":0,"queryFilters":[{"fieldName":"status","operator":"=","value":"Paid"}]}}'`,
|
|
46823
|
+
Output: {
|
|
46824
|
+
Code: "RecordQuery",
|
|
46825
|
+
Data: {
|
|
46826
|
+
items: [
|
|
46827
|
+
{
|
|
46828
|
+
Id: "b2c3d4e5-0000-0000-0000-000000000001",
|
|
46829
|
+
status: "Paid"
|
|
46830
|
+
}
|
|
46831
|
+
],
|
|
46832
|
+
totalCount: 1,
|
|
46833
|
+
hasNextPage: false
|
|
46834
|
+
}
|
|
46835
|
+
}
|
|
46836
|
+
},
|
|
46837
|
+
{
|
|
46838
|
+
Description: "Aggregate — COUNT grouped by a field.",
|
|
46839
|
+
Command: "uip df records query a1b2c3d4-0000-0000-0000-000000000001 " + `--body '{"aggregates":[{"function":"COUNT","field":"Id","alias":"total"}],"groupBy":["status"]}'`,
|
|
46840
|
+
Output: {
|
|
46841
|
+
Code: "RecordQuery",
|
|
46842
|
+
Data: {
|
|
46843
|
+
items: [
|
|
46844
|
+
{ status: "Paid", total: 12 },
|
|
46845
|
+
{ status: "Pending", total: 3 }
|
|
46846
|
+
]
|
|
46847
|
+
}
|
|
46848
|
+
}
|
|
46849
|
+
}
|
|
46850
|
+
];
|
|
46354
46851
|
var RECORDS_DELETE_EXAMPLES = [
|
|
46355
46852
|
{
|
|
46356
46853
|
Description: "Delete records by ID",
|
|
@@ -46517,7 +47014,7 @@ var registerRecordsCommand = (program2) => {
|
|
|
46517
47014
|
}
|
|
46518
47015
|
}
|
|
46519
47016
|
});
|
|
46520
|
-
records.command("query").description("Query records in a Data Fabric entity with filters, sorting, and aggregates. " + "Provide a JSON object via --body or --file with optional keys: " + "filterGroup, sortOptions (use isDescending: true/false), selectedFields, " + "aggregates (function: COUNT/SUM/AVG/MIN/MAX, field, alias?), groupBy.").argument("<id>", "Entity ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-f, --file <path>", "Path to JSON file with query options (filterGroup, selectedFields, sortOptions, aggregates, groupBy)").option("--body <json>", "Inline JSON query options (filterGroup, selectedFields, sortOptions, aggregates, groupBy; use `-` to read from stdin)").option("-l, --limit <number>", "Number of records to return per page", "50").option("-o, --offset <number>", "Start from the page containing this record index (rounded down to nearest page boundary;(mutually exclusive with --cursor)").option("--cursor <cursor>", "Pagination cursor from a previous response to fetch the next page").option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").trackedAction(processContext, async (entityId, options) => {
|
|
47017
|
+
records.command("query").description("Query records in a Data Fabric entity with filters, sorting, and aggregates. " + "Provide a JSON object via --body or --file with optional keys: " + "filterGroup, sortOptions (use isDescending: true/false), selectedFields, " + "aggregates (function: COUNT/SUM/AVG/MIN/MAX, field, alias?), groupBy.").argument("<id>", "Entity ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-f, --file <path>", "Path to JSON file with query options (filterGroup, selectedFields, sortOptions, aggregates, groupBy)").option("--body <json>", "Inline JSON query options (filterGroup, selectedFields, sortOptions, aggregates, groupBy; use `-` to read from stdin)").option("-l, --limit <number>", "Number of records to return per page", "50").option("-o, --offset <number>", "Start from the page containing this record index (rounded down to nearest page boundary;(mutually exclusive with --cursor)").option("--cursor <cursor>", "Pagination cursor from a previous response to fetch the next page").option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").examples(RECORDS_QUERY_EXAMPLES).trackedAction(processContext, async (entityId, options) => {
|
|
46521
47018
|
const pageSize = Number(options.limit);
|
|
46522
47019
|
if (Number.isNaN(pageSize) || pageSize < 1) {
|
|
46523
47020
|
return fail("Invalid --limit value", "Provide a positive integer for --limit.");
|
|
@@ -46652,4 +47149,4 @@ export {
|
|
|
46652
47149
|
metadata
|
|
46653
47150
|
};
|
|
46654
47151
|
|
|
46655
|
-
//# debugId=
|
|
47152
|
+
//# debugId=FE76A85C8BE8050764756E2164756E21
|