@uipath/test-manager-tool 1.205.0-preview.277 → 1.206.0-preview.279
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/attachment.input-77h243bm.js +35 -0
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-vk5n4tgj.js +26 -0
- package/dist/index-zy5jpz1m.js +141 -0
- package/dist/index.js +13 -14
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/{migration-import-run-g9g9c5x3.js → migration-import-run-ytnz9eap.js} +83 -89
- package/dist/tool-09vb7dkp.js +3247 -0
- package/dist/{tool-cpdm080k.js → tool-1nkyed5m.js} +100 -5199
- package/dist/{tool-8b7p4csj.js → tool-6mpkbszw.js} +57 -37
- package/dist/{tool-fxj3gn2v.js → tool-avfzv3ch.js} +74 -76
- package/dist/{tool-e3prtphw.js → tool-cp5yx7qz.js} +3413 -2894
- package/dist/{tool-1de529jm.js → tool-epsr41wx.js} +12 -3
- package/dist/tool-vgc9gpy6.js +62 -0
- package/dist/{tool-3safe6g7.js → tool-z80a3d1j.js} +1049 -1033
- package/dist/tool.js +12 -13
- package/package.json +2 -2
- package/dist/attachment.input-jpcea4mp.js +0 -36
- package/dist/index-ah3hzwzh.js +0 -3173
- package/dist/index-sa6fzfmt.js +0 -2808
- package/dist/tool-2a68c3s5.js +0 -62
- package/dist/tool-7hy7vvfk.js +0 -22083
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
// ../common/src/singleton.ts
|
|
2
|
-
var PREFIX = "@uipath/common/";
|
|
3
|
-
var _g = globalThis;
|
|
4
|
-
function singleton(ctorOrName) {
|
|
5
|
-
const name = typeof ctorOrName === "string" ? ctorOrName : ctorOrName.name;
|
|
6
|
-
const key = Symbol.for(PREFIX + name);
|
|
7
|
-
return {
|
|
8
|
-
get(fallback) {
|
|
9
|
-
return _g[key] ?? fallback;
|
|
10
|
-
},
|
|
11
|
-
set(value) {
|
|
12
|
-
_g[key] = value;
|
|
13
|
-
},
|
|
14
|
-
clear() {
|
|
15
|
-
delete _g[key];
|
|
16
|
-
},
|
|
17
|
-
getOrInit(factory, guard) {
|
|
18
|
-
const existing = _g[key];
|
|
19
|
-
if (existing != null && typeof existing === "object") {
|
|
20
|
-
if (!guard || guard(existing)) {
|
|
21
|
-
return existing;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const instance = factory();
|
|
25
|
-
_g[key] = instance;
|
|
26
|
-
return instance;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
1
|
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
32
2
|
var BaseDimensions = {
|
|
33
3
|
ApplicationName: "ApplicationName",
|
|
@@ -63,6 +33,21 @@ var CommandDimensions = {
|
|
|
63
33
|
ProductArea: "ProductArea",
|
|
64
34
|
Mode: "Mode"
|
|
65
35
|
};
|
|
36
|
+
var ProjectDimensions = {
|
|
37
|
+
ProjectKey: "ProjectKey",
|
|
38
|
+
ProjectType: "ProjectType",
|
|
39
|
+
ProjectIdentityStatus: "ProjectIdentityStatus",
|
|
40
|
+
SolutionKey: "SolutionKey",
|
|
41
|
+
SolutionProjectKey: "SolutionProjectKey",
|
|
42
|
+
SolutionIdentityStatus: "SolutionIdentityStatus",
|
|
43
|
+
PreviousSolutionKey: "PreviousSolutionKey"
|
|
44
|
+
};
|
|
45
|
+
var GUID_KEY_DIMENSIONS = new Set([
|
|
46
|
+
ProjectDimensions.ProjectKey,
|
|
47
|
+
ProjectDimensions.SolutionKey,
|
|
48
|
+
ProjectDimensions.SolutionProjectKey,
|
|
49
|
+
ProjectDimensions.PreviousSolutionKey
|
|
50
|
+
]);
|
|
66
51
|
var ShipDimensions = {
|
|
67
52
|
ShipKind: "ShipKind",
|
|
68
53
|
Target: "Target",
|
|
@@ -131,6 +116,7 @@ var RESERVED_DIMENSION_NAMES = new Set([
|
|
|
131
116
|
...Object.values(BaseDimensions),
|
|
132
117
|
...Object.values(CommandDimensions),
|
|
133
118
|
...Object.values(ShipDimensions),
|
|
119
|
+
...Object.values(ProjectDimensions),
|
|
134
120
|
...Object.values(ErrorDimensions),
|
|
135
121
|
...Object.values(AuthDimensions),
|
|
136
122
|
...Object.values(SkillsDimensions),
|
|
@@ -156,7 +142,8 @@ var CURATED_DIMENSIONS = new Set([
|
|
|
156
142
|
BaseDimensions.SessionIdSource,
|
|
157
143
|
BaseDimensions.SessionId,
|
|
158
144
|
...Object.values(CommandDimensions),
|
|
159
|
-
...Object.values(ShipDimensions)
|
|
145
|
+
...Object.values(ShipDimensions),
|
|
146
|
+
...Object.values(ProjectDimensions)
|
|
160
147
|
]);
|
|
161
148
|
function lowercaseIdDimensionValues(properties) {
|
|
162
149
|
let changed = false;
|
|
@@ -177,10 +164,34 @@ function lowercaseIdDimensionValues(properties) {
|
|
|
177
164
|
return changed ? result : properties;
|
|
178
165
|
}
|
|
179
166
|
|
|
180
|
-
// ../common/src/
|
|
181
|
-
var
|
|
182
|
-
|
|
183
|
-
|
|
167
|
+
// ../common/src/singleton.ts
|
|
168
|
+
var PREFIX = "@uipath/common/";
|
|
169
|
+
var _g = globalThis;
|
|
170
|
+
function singleton(ctorOrName) {
|
|
171
|
+
const name = typeof ctorOrName === "string" ? ctorOrName : ctorOrName.name;
|
|
172
|
+
const key = Symbol.for(PREFIX + name);
|
|
173
|
+
return {
|
|
174
|
+
get(fallback) {
|
|
175
|
+
return _g[key] ?? fallback;
|
|
176
|
+
},
|
|
177
|
+
set(value) {
|
|
178
|
+
_g[key] = value;
|
|
179
|
+
},
|
|
180
|
+
clear() {
|
|
181
|
+
delete _g[key];
|
|
182
|
+
},
|
|
183
|
+
getOrInit(factory, guard) {
|
|
184
|
+
const existing = _g[key];
|
|
185
|
+
if (existing != null && typeof existing === "object") {
|
|
186
|
+
if (!guard || guard(existing)) {
|
|
187
|
+
return existing;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
const instance = factory();
|
|
191
|
+
_g[key] = instance;
|
|
192
|
+
return instance;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
184
195
|
}
|
|
185
196
|
|
|
186
197
|
// ../common/src/telemetry/telemetry-config.ts
|
|
@@ -188,6 +199,15 @@ function isTelemetryDisabled() {
|
|
|
188
199
|
const value = process.env.UIPATH_TELEMETRY_DISABLED;
|
|
189
200
|
return value === "1" || value === "true";
|
|
190
201
|
}
|
|
202
|
+
function isProjectTelemetryDisabled() {
|
|
203
|
+
return isTelemetryDisabled() || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "1" || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "true";
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
207
|
+
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
208
|
+
function getGlobalTelemetryProperties() {
|
|
209
|
+
return telemetryPropsSlot.get();
|
|
210
|
+
}
|
|
191
211
|
|
|
192
212
|
// ../common/src/sdk-user-agent.ts
|
|
193
213
|
var USER_AGENT_HEADER = "User-Agent";
|
|
@@ -291,6 +311,6 @@ function installSdkCodingAgentHeader(BaseApiClass) {
|
|
|
291
311
|
installRequestHeaderForwarding(BaseApiClass, codingAgentPatchKey(), (headers) => addSdkCodingAgentHeader(headers));
|
|
292
312
|
}
|
|
293
313
|
|
|
294
|
-
export {
|
|
314
|
+
export { BaseDimensions, CommandDimensions, ProjectDimensions, GUID_KEY_DIMENSIONS, ErrorDimensions, SkillsDimensions, lowercaseIdDimensionValues, singleton, getGlobalTelemetryProperties, isProjectTelemetryDisabled, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, installSdkCodingAgentHeader };
|
|
295
315
|
|
|
296
|
-
//# debugId=
|
|
316
|
+
//# debugId=3691E206D1B4E76564756E2164756E21
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
getFileSystem,
|
|
3
|
+
catchError,
|
|
4
|
+
isCliErrorCode,
|
|
5
|
+
isRetryHint,
|
|
6
|
+
isHtmlDocument,
|
|
7
|
+
extractErrorDetails2,
|
|
8
|
+
instructionsFor,
|
|
9
|
+
RESULTS,
|
|
3
10
|
InvalidArgumentError,
|
|
4
|
-
LogLevel,
|
|
5
11
|
Option,
|
|
6
|
-
|
|
12
|
+
LogLevel,
|
|
13
|
+
logger,
|
|
14
|
+
configureLogger,
|
|
15
|
+
EXIT_CODES,
|
|
7
16
|
Pagination,
|
|
8
|
-
PollOutcome,
|
|
9
|
-
RESULTS,
|
|
10
17
|
SuccessOutput,
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
OutputFormatter,
|
|
19
|
+
processContext,
|
|
20
|
+
resolveDeprecatedOptionAlias,
|
|
21
|
+
warnDeprecatedOptionAlias,
|
|
13
22
|
createHiddenDeprecatedTenantOption,
|
|
14
|
-
|
|
15
|
-
getAuthContext,
|
|
16
|
-
getFileSystem,
|
|
17
|
-
instructionsFor,
|
|
18
|
-
isCliErrorCode,
|
|
19
|
-
isHtmlDocument,
|
|
20
|
-
isRetryHint,
|
|
21
|
-
logger,
|
|
23
|
+
PollOutcome,
|
|
22
24
|
mapPollFailure,
|
|
23
25
|
pollUntil,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
warnDeprecatedOptionAlias
|
|
27
|
-
} from "./tool-e3prtphw.js";
|
|
26
|
+
getAuthContext
|
|
27
|
+
} from "./tool-cp5yx7qz.js";
|
|
28
28
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} from "./tool-
|
|
29
|
+
Configuration2,
|
|
30
|
+
UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobType2,
|
|
31
|
+
UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2,
|
|
32
|
+
ProjectMigrationAttachmentApi2,
|
|
33
|
+
ProjectMigrationJobApi2,
|
|
34
|
+
ProjectsApi2
|
|
35
|
+
} from "./tool-1nkyed5m.js";
|
|
36
36
|
|
|
37
37
|
// src/utils/shared.ts
|
|
38
38
|
var ENCODING_MARKERS = [
|
|
@@ -66,8 +66,9 @@ function msToDuration(ms) {
|
|
|
66
66
|
const s = totalSec % 60;
|
|
67
67
|
return [h, m, s].map((v) => String(v).padStart(2, "0")).join(":");
|
|
68
68
|
}
|
|
69
|
-
function calcPassRate(passed,
|
|
70
|
-
|
|
69
|
+
function calcPassRate(passed, failed) {
|
|
70
|
+
const executed = passed + failed;
|
|
71
|
+
return executed > 0 ? Math.round(passed / executed * 1000) / 10 : 0;
|
|
71
72
|
}
|
|
72
73
|
var DEFAULT_TEST_CASE_VERSION = "1.0.0";
|
|
73
74
|
var PROJECT_CONFIG_FORBIDDEN_MESSAGE = "Forbidden (403). Exporting project configuration is a Test Cloud only feature, and this tenant is not a Test Cloud tenant. This is a licence limit, not a permissions problem.";
|
|
@@ -336,8 +337,8 @@ function isTmNotAvailableError(result) {
|
|
|
336
337
|
function isFeatureDisabledError(result) {
|
|
337
338
|
return result.context?.httpStatus === 403 && FEATURE_DISABLED_PATTERN.test(`${result.context?.errorCode ?? ""} ${result.details}`);
|
|
338
339
|
}
|
|
339
|
-
async function
|
|
340
|
-
const result = await
|
|
340
|
+
async function extractErrorDetails(error, options) {
|
|
341
|
+
const result = await extractErrorDetails2(error, {
|
|
341
342
|
...options,
|
|
342
343
|
forbiddenMessage: options?.forbiddenMessage ?? TM_FORBIDDEN_MESSAGE
|
|
343
344
|
});
|
|
@@ -353,15 +354,15 @@ async function extractErrorDetails2(error, options) {
|
|
|
353
354
|
}
|
|
354
355
|
return result;
|
|
355
356
|
}
|
|
356
|
-
async function emitTmFailure(error,
|
|
357
|
+
async function emitTmFailure(error, options) {
|
|
357
358
|
const { instructionsSuffix, ...extractOptions } = options ?? {};
|
|
358
|
-
const classified = await
|
|
359
|
+
const classified = await extractErrorDetails(error, {
|
|
359
360
|
...extractOptions,
|
|
360
361
|
forbiddenMessage: extractOptions.forbiddenMessage ?? TM_FORBIDDEN_MESSAGE
|
|
361
362
|
});
|
|
362
|
-
emitTmFailureDetails(classified,
|
|
363
|
+
emitTmFailureDetails(classified, instructionsSuffix);
|
|
363
364
|
}
|
|
364
|
-
function emitTmFailureDetails(classified,
|
|
365
|
+
function emitTmFailureDetails(classified, instructionsSuffix) {
|
|
365
366
|
const { result, message, details, errorCode, retry } = classified;
|
|
366
367
|
const suffix = typeof instructionsSuffix === "function" ? instructionsSuffix(errorCode) : instructionsSuffix;
|
|
367
368
|
OutputFormatter.error({
|
|
@@ -371,7 +372,6 @@ function emitTmFailureDetails(classified, exitCode = 1, instructionsSuffix) {
|
|
|
371
372
|
Instructions: suffix ? `${details} ${suffix}`.trim() : details,
|
|
372
373
|
Retry: retry
|
|
373
374
|
});
|
|
374
|
-
processContext.exit(EXIT_CODES[result] ?? exitCode);
|
|
375
375
|
}
|
|
376
376
|
async function refuseUnexpectedContentType(response, accept, expected, what) {
|
|
377
377
|
const contentType = response.raw.headers.get("content-type") ?? "";
|
|
@@ -389,7 +389,6 @@ function emitInvalidArgument(message, instructions) {
|
|
|
389
389
|
Instructions: instructions,
|
|
390
390
|
Retry: "RetryWillNotFix"
|
|
391
391
|
});
|
|
392
|
-
processContext.exit(1);
|
|
393
392
|
}
|
|
394
393
|
function emitAttachmentNotFound(attachmentId, objectType) {
|
|
395
394
|
OutputFormatter.error({
|
|
@@ -399,7 +398,6 @@ function emitAttachmentNotFound(attachmentId, objectType) {
|
|
|
399
398
|
Instructions: "Run 'uip tm attachment list' on the parent object to find its attachment ids, and check --object-type matches the object the file is attached to.",
|
|
400
399
|
Retry: "RetryWillNotFix"
|
|
401
400
|
});
|
|
402
|
-
processContext.exit(1);
|
|
403
401
|
}
|
|
404
402
|
function instructiveError(message, instructions, errorCode, retry = "RetryWillNotFix") {
|
|
405
403
|
const error = new Error(message);
|
|
@@ -494,7 +492,8 @@ async function getProjectLookupResult(projectKey, rawResponse) {
|
|
|
494
492
|
return {
|
|
495
493
|
status: "failure",
|
|
496
494
|
failure: {
|
|
497
|
-
message: `Project '${projectKey}' not found
|
|
495
|
+
message: `Project '${projectKey}' not found.`,
|
|
496
|
+
instructions: "Check the key with 'uip tm project list'."
|
|
498
497
|
}
|
|
499
498
|
};
|
|
500
499
|
}
|
|
@@ -526,7 +525,7 @@ async function getProjectLookupResult(projectKey, rawResponse) {
|
|
|
526
525
|
status: "failure",
|
|
527
526
|
failure: {
|
|
528
527
|
message: `Project lookup for '${projectKey}' returned an unexpected response.`,
|
|
529
|
-
instructions: details ?? serializedExtraContext ?? stringifyProjectLookupPayload(record)
|
|
528
|
+
instructions: details ?? serializedExtraContext ?? stringifyProjectLookupPayload(record) ?? "The service returned no project details."
|
|
530
529
|
}
|
|
531
530
|
};
|
|
532
531
|
}
|
|
@@ -544,8 +543,8 @@ async function resolveAuth(options) {
|
|
|
544
543
|
});
|
|
545
544
|
const organizationId = authCtx.organizationId;
|
|
546
545
|
const tenantName = authCtx.tenantName;
|
|
547
|
-
const tmBaseUrl = `${authCtx.baseUrl}/${organizationId}/${tenantName}/testmanager_`;
|
|
548
|
-
const tmConfig = new
|
|
546
|
+
const tmBaseUrl = `${authCtx.baseUrl}/${encodeURIComponent(organizationId)}/${encodeURIComponent(tenantName)}/testmanager_`;
|
|
547
|
+
const tmConfig = new Configuration2({
|
|
549
548
|
basePath: tmBaseUrl,
|
|
550
549
|
accessToken: authCtx.accessToken
|
|
551
550
|
});
|
|
@@ -623,12 +622,12 @@ async function initializeContextWithProject(options) {
|
|
|
623
622
|
};
|
|
624
623
|
}
|
|
625
624
|
const { projectKey } = selection;
|
|
626
|
-
const projectsApi = new
|
|
625
|
+
const projectsApi = new ProjectsApi2(base.tmConfig);
|
|
627
626
|
const [projectError, projectResponse] = await catchError(projectsApi.projectsGetProjectByProjectPrefixRaw({
|
|
628
627
|
projectPrefix: projectKey
|
|
629
628
|
}));
|
|
630
629
|
if (projectError) {
|
|
631
|
-
const { message, details } = await
|
|
630
|
+
const { message, details } = await extractErrorDetails(projectError, {
|
|
632
631
|
forbiddenMessage: TM_FORBIDDEN_MESSAGE
|
|
633
632
|
});
|
|
634
633
|
OutputFormatter.error({
|
|
@@ -644,7 +643,7 @@ async function initializeContextWithProject(options) {
|
|
|
644
643
|
OutputFormatter.error({
|
|
645
644
|
Result: RESULTS.Failure,
|
|
646
645
|
Message: projectLookup.failure.message,
|
|
647
|
-
|
|
646
|
+
Instructions: projectLookup.failure.instructions
|
|
648
647
|
});
|
|
649
648
|
processContext.exit(1);
|
|
650
649
|
return null;
|
|
@@ -673,10 +672,10 @@ async function ensureProjectKey(ctx) {
|
|
|
673
672
|
if (ctx.projectKey !== undefined) {
|
|
674
673
|
return ctx.projectKey;
|
|
675
674
|
}
|
|
676
|
-
const projectsApi = new
|
|
675
|
+
const projectsApi = new ProjectsApi2(ctx.tmConfig);
|
|
677
676
|
const [error, project] = await catchError(projectsApi.projectsGetById({ id: ctx.projectId }));
|
|
678
677
|
if (error) {
|
|
679
|
-
const { result, errorCode, message, retry, details } = await
|
|
678
|
+
const { result, errorCode, message, retry, details } = await extractErrorDetails(error, {
|
|
680
679
|
forbiddenMessage: TM_FORBIDDEN_MESSAGE
|
|
681
680
|
});
|
|
682
681
|
OutputFormatter.error({
|
|
@@ -707,9 +706,9 @@ async function ensureProjectKey(ctx) {
|
|
|
707
706
|
|
|
708
707
|
// src/mappers/input/migration.input.ts
|
|
709
708
|
var MIGRATION_TERMINAL_STATUSES = [
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
709
|
+
UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2.Completed,
|
|
710
|
+
UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2.Failed,
|
|
711
|
+
UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2.Cancelled
|
|
713
712
|
];
|
|
714
713
|
function isMigrationTerminal(status) {
|
|
715
714
|
if (status === undefined)
|
|
@@ -718,10 +717,10 @@ function isMigrationTerminal(status) {
|
|
|
718
717
|
return MIGRATION_TERMINAL_STATUSES.some((terminal) => terminal.toLowerCase() === lowered);
|
|
719
718
|
}
|
|
720
719
|
function isMigrationCancelled(status) {
|
|
721
|
-
return status?.toLowerCase() ===
|
|
720
|
+
return status?.toLowerCase() === UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2.Cancelled.toString().toLowerCase();
|
|
722
721
|
}
|
|
723
722
|
function isMigrationCompleted(status) {
|
|
724
|
-
return status?.toLowerCase() ===
|
|
723
|
+
return status?.toLowerCase() === UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2.Completed.toString().toLowerCase();
|
|
725
724
|
}
|
|
726
725
|
var EXPORT_CONTENT = {
|
|
727
726
|
governance: {
|
|
@@ -797,7 +796,7 @@ function toImportJobRequest(projectId, manifest, selection) {
|
|
|
797
796
|
projectId,
|
|
798
797
|
uiPathTestManagementHubProjectMigrationAbstractionsRequestModelsCreateProjectImportJobRequest: {
|
|
799
798
|
manifest,
|
|
800
|
-
status:
|
|
799
|
+
status: UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2.Uploading,
|
|
801
800
|
options
|
|
802
801
|
}
|
|
803
802
|
};
|
|
@@ -868,7 +867,7 @@ var CHUNK_NOT_SENT_CODES = new Set([
|
|
|
868
867
|
// src/utils/refreshing-config.ts
|
|
869
868
|
var TOKEN_HEADROOM_MINUTES = 5;
|
|
870
869
|
function withRefreshingToken(base) {
|
|
871
|
-
return new
|
|
870
|
+
return new Configuration2({
|
|
872
871
|
basePath: base.basePath,
|
|
873
872
|
fetchApi: base.fetchApi,
|
|
874
873
|
middleware: base.middleware,
|
|
@@ -1071,16 +1070,17 @@ var PACKAGE_WORDING = {
|
|
|
1071
1070
|
async function emitPollFailure(result, projectId, jobId, kind, targetHint) {
|
|
1072
1071
|
const mapped = mapPollFailure(result, `${kind} job '${jobId}'`);
|
|
1073
1072
|
const lastStatus = String(result.data?.status ?? "unknown");
|
|
1074
|
-
const
|
|
1075
|
-
const
|
|
1073
|
+
const timedOut = result.outcome === PollOutcome.Timeout;
|
|
1074
|
+
const classified = timedOut || !result.error ? undefined : await extractErrorDetails(result.error);
|
|
1075
|
+
const pollResult = timedOut ? RESULTS.Failure : classified?.result ?? RESULTS.Failure;
|
|
1076
1076
|
OutputFormatter.error({
|
|
1077
1077
|
Result: pollResult,
|
|
1078
1078
|
Message: `${mapped.message} after ${Math.round(result.elapsedMs / 1000)}s. Last status: ${lastStatus}.`,
|
|
1079
1079
|
Instructions: `${JOB_ENDINGS[kind].stoppedWatching} ${recheckJobHint(projectId, jobId)}${targetHint}`,
|
|
1080
|
-
ErrorCode:
|
|
1081
|
-
Retry: kind === "Import" ? "RetryWillNotFix" :
|
|
1080
|
+
ErrorCode: classified?.errorCode ?? mapped.errorCode,
|
|
1081
|
+
Retry: kind === "Import" ? "RetryWillNotFix" : classified?.retry ?? mapped.retry
|
|
1082
1082
|
});
|
|
1083
|
-
processContext.exit(
|
|
1083
|
+
processContext.exit(timedOut ? mapped.exitCode : EXIT_CODES[pollResult] ?? mapped.exitCode);
|
|
1084
1084
|
}
|
|
1085
1085
|
function emitJobEnding(kind, jobId, finalStatus, targetHint) {
|
|
1086
1086
|
const ending = JOB_ENDINGS[kind];
|
|
@@ -1127,7 +1127,7 @@ var JOB_ENDINGS = {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
};
|
|
1129
1129
|
async function emitImportPollError(error, projectId, jobId, targetHint) {
|
|
1130
|
-
const { result, message, details, errorCode } = await
|
|
1130
|
+
const { result, message, details, errorCode } = await extractErrorDetails(error, { forbiddenMessage: TM_FORBIDDEN_MESSAGE });
|
|
1131
1131
|
OutputFormatter.error({
|
|
1132
1132
|
Result: result,
|
|
1133
1133
|
Message: message,
|
|
@@ -1135,7 +1135,6 @@ async function emitImportPollError(error, projectId, jobId, targetHint) {
|
|
|
1135
1135
|
ErrorCode: errorCode,
|
|
1136
1136
|
Retry: "RetryWillNotFix"
|
|
1137
1137
|
});
|
|
1138
|
-
processContext.exit(EXIT_CODES[result] ?? 1);
|
|
1139
1138
|
}
|
|
1140
1139
|
async function waitForMigrationJob(jobApi, projectId, jobId, timing, kind, targetHint = "") {
|
|
1141
1140
|
const [pollError, result] = await catchError(pollUntil({
|
|
@@ -1154,7 +1153,7 @@ async function waitForMigrationJob(jobApi, projectId, jobId, timing, kind, targe
|
|
|
1154
1153
|
if (kind === "Import") {
|
|
1155
1154
|
await emitImportPollError(pollError, projectId, jobId, targetHint);
|
|
1156
1155
|
} else {
|
|
1157
|
-
await emitTmFailure(pollError,
|
|
1156
|
+
await emitTmFailure(pollError, {
|
|
1158
1157
|
instructionsSuffix: recheckJobHint(projectId, jobId)
|
|
1159
1158
|
});
|
|
1160
1159
|
}
|
|
@@ -1173,7 +1172,7 @@ async function waitForMigrationJob(jobApi, projectId, jobId, timing, kind, targe
|
|
|
1173
1172
|
return finished ?? null;
|
|
1174
1173
|
}
|
|
1175
1174
|
async function emitExportCreateFailure(error, askedForProjectConfig) {
|
|
1176
|
-
const { result, message, details, errorCode, retry } = await
|
|
1175
|
+
const { result, message, details, errorCode, retry } = await extractErrorDetails(error, {
|
|
1177
1176
|
forbiddenMessage: TM_FORBIDDEN_MESSAGE
|
|
1178
1177
|
});
|
|
1179
1178
|
const isProjectConfigGate = askedForProjectConfig && errorCode === "permission_denied" && /project configuration/i.test(details);
|
|
@@ -1184,7 +1183,6 @@ async function emitExportCreateFailure(error, askedForProjectConfig) {
|
|
|
1184
1183
|
ErrorCode: errorCode,
|
|
1185
1184
|
Retry: retry
|
|
1186
1185
|
});
|
|
1187
|
-
processContext.exit(EXIT_CODES[result] ?? 1);
|
|
1188
1186
|
}
|
|
1189
1187
|
function recheckJobHint(projectId, jobId) {
|
|
1190
1188
|
return `Re-check it with: uip tm migration get --project-id ${projectId} --job-id ${jobId}`;
|
|
@@ -1198,13 +1196,13 @@ function downloadRefusedHint(projectId, jobId) {
|
|
|
1198
1196
|
async function downloadPackage(tmConfig, projectId, jobId, outputFile, overwrite, hints = {}) {
|
|
1199
1197
|
const fetchHint = hints.onFetchFailure ?? retryDownloadHint(jobId);
|
|
1200
1198
|
const afterFetchHint = hints.afterFetch ?? retryDownloadHint(jobId);
|
|
1201
|
-
const attachmentApi = new
|
|
1199
|
+
const attachmentApi = new ProjectMigrationAttachmentApi2(tmConfig);
|
|
1202
1200
|
const [downloadError, response] = await catchError(attachmentApi.projectMigrationAttachmentDownloadProjectPackageRaw({
|
|
1203
1201
|
migrationJobId: jobId,
|
|
1204
1202
|
projectId
|
|
1205
1203
|
}));
|
|
1206
1204
|
if (downloadError) {
|
|
1207
|
-
await emitTmFailure(downloadError,
|
|
1205
|
+
await emitTmFailure(downloadError, {
|
|
1208
1206
|
instructionsSuffix: fetchHint
|
|
1209
1207
|
});
|
|
1210
1208
|
return null;
|
|
@@ -1234,7 +1232,7 @@ async function writePackage(raw, outputFile, target) {
|
|
|
1234
1232
|
if (streamError || streamed.status !== "ok") {
|
|
1235
1233
|
await catchError(fs.rm(partial));
|
|
1236
1234
|
if (streamError) {
|
|
1237
|
-
await emitTmFailure(streamError,
|
|
1235
|
+
await emitTmFailure(streamError, {
|
|
1238
1236
|
instructionsSuffix: target.afterFetchHint
|
|
1239
1237
|
});
|
|
1240
1238
|
} else {
|
|
@@ -1373,7 +1371,7 @@ async function movePartialIntoPlace(partial, outputFile, target) {
|
|
|
1373
1371
|
const [lockError, release] = await catchError(fs.acquireLock(outputFile));
|
|
1374
1372
|
if (lockError) {
|
|
1375
1373
|
await catchError(fs.rm(partial));
|
|
1376
|
-
await emitTmFailure(lockError,
|
|
1374
|
+
await emitTmFailure(lockError, {
|
|
1377
1375
|
instructionsSuffix: target.afterFetchHint
|
|
1378
1376
|
});
|
|
1379
1377
|
return false;
|
|
@@ -1394,7 +1392,7 @@ async function replaceOnlyIfAllowed(partial, outputFile, target) {
|
|
|
1394
1392
|
const [renameError] = await catchError(fs.rename(partial, outputFile));
|
|
1395
1393
|
if (renameError) {
|
|
1396
1394
|
await catchError(fs.rm(partial));
|
|
1397
|
-
await emitTmFailure(renameError,
|
|
1395
|
+
await emitTmFailure(renameError, {
|
|
1398
1396
|
instructionsSuffix: target.afterFetchHint
|
|
1399
1397
|
});
|
|
1400
1398
|
return false;
|
|
@@ -1429,13 +1427,13 @@ function retryDownloadHint(jobId) {
|
|
|
1429
1427
|
return `The export itself finished — job '${jobId}' still holds the package on the server.`;
|
|
1430
1428
|
}
|
|
1431
1429
|
function isExportJob(type) {
|
|
1432
|
-
return String(type ?? "").toLowerCase() ===
|
|
1430
|
+
return String(type ?? "").toLowerCase() === UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobType2.ExportProject.toString().toLowerCase();
|
|
1433
1431
|
}
|
|
1434
1432
|
async function readProjectJob(ctx, jobId) {
|
|
1435
1433
|
if (await ensureProjectKey(ctx) === null)
|
|
1436
1434
|
return null;
|
|
1437
1435
|
const { tmConfig, projectId } = ctx;
|
|
1438
|
-
const [error, response] = await catchError(new
|
|
1436
|
+
const [error, response] = await catchError(new ProjectMigrationJobApi2(tmConfig).projectMigrationJobGetByIdRaw(toJobGetRequest(projectId, jobId)));
|
|
1439
1437
|
if (error) {
|
|
1440
1438
|
await emitTmFailure(error);
|
|
1441
1439
|
return null;
|
|
@@ -1479,7 +1477,7 @@ var registerProjectExportCommand = (parent) => {
|
|
|
1479
1477
|
const { tmConfig, projectId } = ctx;
|
|
1480
1478
|
if (!timing)
|
|
1481
1479
|
warnIgnoredWaitOptions(options);
|
|
1482
|
-
const [startError, job] = await catchError(new
|
|
1480
|
+
const [startError, job] = await catchError(new ProjectMigrationJobApi2(tmConfig).projectMigrationJobCreateProjectExportJob(toExportJobRequest(projectId, selection)));
|
|
1483
1481
|
if (startError) {
|
|
1484
1482
|
await emitExportCreateFailure(startError, selection.include?.includes("project-config") === true);
|
|
1485
1483
|
return;
|
|
@@ -1523,7 +1521,7 @@ function emitMissingJobId(projectId) {
|
|
|
1523
1521
|
}
|
|
1524
1522
|
async function finishWaitedExport(tmConfig, projectId, jobId, timing, options) {
|
|
1525
1523
|
const waitConfig = withRefreshingToken(tmConfig);
|
|
1526
|
-
const finished = await waitForMigrationJob(new
|
|
1524
|
+
const finished = await waitForMigrationJob(new ProjectMigrationJobApi2(waitConfig), projectId, jobId, timing, "Export");
|
|
1527
1525
|
if (!finished)
|
|
1528
1526
|
return;
|
|
1529
1527
|
const outputFile = String(options.outputFile);
|
|
@@ -1599,7 +1597,7 @@ var registerMigrationCommand = (program) => {
|
|
|
1599
1597
|
Bytes: bytes
|
|
1600
1598
|
}));
|
|
1601
1599
|
});
|
|
1602
|
-
migrationCmd.command("list").description("Find a migration job when you no longer have its id, newest first. Pass --project-key or --project-id to narrow it to one project: the service lists across the whole tenant, including projects you have no role on.").addOption(new Option("--status <status>", `Filter by job status (${Object.values(
|
|
1600
|
+
migrationCmd.command("list").description("Find a migration job when you no longer have its id, newest first. Pass --project-key or --project-id to narrow it to one project: the service lists across the whole tenant, including projects you have no role on.").addOption(new Option("--status <status>", `Filter by job status (${Object.values(UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2).join(", ")})`).choices(Object.values(UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobStatus2))).addOption(new Option("--type <type>", `Filter by job type (${Object.values(UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobType2).join(", ")})`).choices(Object.values(UiPathTestManagementHubProjectMigrationAbstractionsEnumsMigrationJobType2))).addOption(projectKeyOption("Only jobs for this project — a filter, not a scope")).addOption(projectIdOption()).option("--package-name <name>", "Filter by package name").option("--filter <text>", "Substring match on package name. --package-name matches the whole name").option("--sort-by <expression>", "Sort as '<property> asc|desc', e.g. 'updated asc'", DEFAULT_JOB_SORT).option("--limit <number>", "Maximum jobs to return", "50").option("--offset <number>", "Jobs to skip", "0").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--log-level <level>", "Log verbosity: debug, info, warn, error", "Information").examples(MIGRATION_JOB_LIST_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
1603
1601
|
if (blankFilterGiven(options, ["packageName", "filter", "sortBy"]))
|
|
1604
1602
|
return;
|
|
1605
1603
|
const paging = resolvePaginationOptions(options);
|
|
@@ -1637,7 +1635,7 @@ var registerMigrationCommand = (program) => {
|
|
|
1637
1635
|
}
|
|
1638
1636
|
tmConfig = base.tmConfig;
|
|
1639
1637
|
}
|
|
1640
|
-
const [error, page] = await catchError(new
|
|
1638
|
+
const [error, page] = await catchError(new ProjectMigrationJobApi2(tmConfig).projectMigrationJobGet(toJobListRequest({
|
|
1641
1639
|
status: options.status,
|
|
1642
1640
|
type: options.type,
|
|
1643
1641
|
projectId,
|
|
@@ -1671,6 +1669,6 @@ var registerMigrationCommand = (program) => {
|
|
|
1671
1669
|
return migrationCmd;
|
|
1672
1670
|
};
|
|
1673
1671
|
|
|
1674
|
-
export { stripEncodingMarkers, ROBOT_LOG_LEVELS, TERMINAL_STATUSES, msToDuration, calcPassRate, DEFAULT_TEST_CASE_VERSION, SCHEMA_FORBIDDEN_MESSAGE, PROJECT_CONFIG_IMPORT_FORBIDDEN_MESSAGE, TM_FORBIDDEN_MESSAGE, TM_LICENSED_USER_FORBIDDEN_MESSAGE, TM_TEST_CLOUD_FORBIDDEN_MESSAGE, TM_NOT_AVAILABLE_MESSAGE, TM_NOT_AVAILABLE_INSTRUCTIONS, TAGGED_UPLOAD_NOT_SUPPORTED_INSTRUCTIONS, parseCustomFieldObjectType, parseCustomFieldDataType, validateIdentity, findExactByNamePaged, splitKeys, resolvePaginationOptions, hasText, sameGuid, resolveWaitTiming, toOutput, toIsoDate, isPortalShellDocument, isFeatureDisabledError,
|
|
1672
|
+
export { stripEncodingMarkers, ROBOT_LOG_LEVELS, TERMINAL_STATUSES, msToDuration, calcPassRate, DEFAULT_TEST_CASE_VERSION, SCHEMA_FORBIDDEN_MESSAGE, PROJECT_CONFIG_IMPORT_FORBIDDEN_MESSAGE, TM_FORBIDDEN_MESSAGE, TM_LICENSED_USER_FORBIDDEN_MESSAGE, TM_TEST_CLOUD_FORBIDDEN_MESSAGE, TM_NOT_AVAILABLE_MESSAGE, TM_NOT_AVAILABLE_INSTRUCTIONS, TAGGED_UPLOAD_NOT_SUPPORTED_INSTRUCTIONS, parseCustomFieldObjectType, parseCustomFieldDataType, validateIdentity, findExactByNamePaged, splitKeys, resolvePaginationOptions, hasText, sameGuid, resolveWaitTiming, toOutput, toIsoDate, isPortalShellDocument, isFeatureDisabledError, extractErrorDetails, emitTmFailure, emitTmFailureDetails, refuseUnexpectedContentType, emitInvalidArgument, emitAttachmentNotFound, instructiveError, readInstructions, readClassification, tmWebUrl, initializeContext, initializeContextWithProject, resolveContextWithProject, ensureProjectKey, projectKeyOption, projectIdOption, blankValueMessage, blankFilterGiven, IMPORT_CONTENT, IMPORT_CONTENT_CHOICES, toImportJobRequest, toChunkUploadRequest, toJobUpdateRequest, toMigrationJobOutput, toSchemaVersionRows, DEFAULT_IMPORT_TIMEOUT_MS, DEFAULT_MIGRATION_INTERVAL_MS, CHUNK_UPLOAD_ATTEMPTS, CHUNK_RETRY_BACKOFF_MS, CHUNK_SIZE_BYTES, MAX_PACKAGE_NAME_LENGTH, MAX_IMPORT_PACKAGE_BYTES, CHUNK_NOT_SENT_CODES, checkOutputTarget, resolveOutputPath, withRefreshingToken, describeContentDefaults, checkContentSelection, waitForMigrationJob, recheckJobHint, writeZipResponse, registerProjectExportCommand, registerMigrationCommand };
|
|
1675
1673
|
|
|
1676
|
-
//# debugId=
|
|
1674
|
+
//# debugId=6868C82965129C4264756E2164756E21
|