@uipath/pm-tool 1.204.0-preview.255 → 1.205.0-preview.256
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/index.js +1 -1
- package/dist/{tool-gtjnrfmg.js → tool-gzdtry3m.js} +168 -32
- package/dist/tool.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2101,7 +2101,7 @@ var package_default = {
|
|
|
2101
2101
|
name: "@uipath/pm-tool",
|
|
2102
2102
|
author: "UiPath",
|
|
2103
2103
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2104
|
-
version: "1.
|
|
2104
|
+
version: "1.205.0-preview.256",
|
|
2105
2105
|
description: "Process Mining — process apps, transformations, and data ingestion.",
|
|
2106
2106
|
private: false,
|
|
2107
2107
|
repository: {
|
|
@@ -2323,6 +2323,16 @@ class NodeFileSystem {
|
|
|
2323
2323
|
async rename(oldPath, newPath) {
|
|
2324
2324
|
await fs.rename(oldPath, newPath);
|
|
2325
2325
|
}
|
|
2326
|
+
async isSymbolicLink(filePath) {
|
|
2327
|
+
try {
|
|
2328
|
+
return (await fs.lstat(filePath)).isSymbolicLink();
|
|
2329
|
+
} catch (error) {
|
|
2330
|
+
if (this.isEnoent(error) || this.hasErrnoCode(error, "ENOTDIR")) {
|
|
2331
|
+
return false;
|
|
2332
|
+
}
|
|
2333
|
+
throw error;
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2326
2336
|
async realpath(filePath) {
|
|
2327
2337
|
try {
|
|
2328
2338
|
return await fs.realpath(filePath);
|
|
@@ -3030,7 +3040,7 @@ function setGlobalLogFilePath(path2) {
|
|
|
3030
3040
|
function getGlobalLogFilePath() {
|
|
3031
3041
|
return logFilePathSlot.get("");
|
|
3032
3042
|
}
|
|
3033
|
-
var DEFAULT_LOG_LEVEL =
|
|
3043
|
+
var DEFAULT_LOG_LEVEL = 2 /* WARN */;
|
|
3034
3044
|
|
|
3035
3045
|
class SimpleLogger {
|
|
3036
3046
|
__brand = "SimpleLogger";
|
|
@@ -3297,7 +3307,9 @@ var ErrorDimensions = {
|
|
|
3297
3307
|
Result: "Result",
|
|
3298
3308
|
ErrorCode: "ErrorCode",
|
|
3299
3309
|
Retry: "Retry",
|
|
3300
|
-
ErrorMessage: "ErrorMessage"
|
|
3310
|
+
ErrorMessage: "ErrorMessage",
|
|
3311
|
+
HttpStatus: "HttpStatus",
|
|
3312
|
+
UpstreamErrorCode: "UpstreamErrorCode"
|
|
3301
3313
|
};
|
|
3302
3314
|
var AuthDimensions = {
|
|
3303
3315
|
AuthenticationMethod: "AuthenticationMethod",
|
|
@@ -4285,7 +4297,9 @@ var CLI_ERROR_CODES = [
|
|
|
4285
4297
|
"timeout",
|
|
4286
4298
|
"server_error",
|
|
4287
4299
|
"method_not_allowed",
|
|
4300
|
+
"not_supported",
|
|
4288
4301
|
"configuration_error",
|
|
4302
|
+
"execution_failed",
|
|
4289
4303
|
"unknown_error"
|
|
4290
4304
|
];
|
|
4291
4305
|
var RETRY_HINTS = [
|
|
@@ -5242,7 +5256,9 @@ var OutputFormatter;
|
|
|
5242
5256
|
[ErrorDimensions.Result]: data.Result,
|
|
5243
5257
|
[ErrorDimensions.ErrorCode]: data.ErrorCode,
|
|
5244
5258
|
[ErrorDimensions.Retry]: data.Retry,
|
|
5245
|
-
[ErrorDimensions.ErrorMessage]: data.Message
|
|
5259
|
+
[ErrorDimensions.ErrorMessage]: data.Message,
|
|
5260
|
+
[ErrorDimensions.HttpStatus]: data.Context?.httpStatus?.toString(),
|
|
5261
|
+
[ErrorDimensions.UpstreamErrorCode]: data.Context?.errorCode
|
|
5246
5262
|
});
|
|
5247
5263
|
}
|
|
5248
5264
|
logOutput(normalizeOutputKeys(envelope), getOutputFormat());
|
|
@@ -6208,22 +6224,12 @@ var resolveConfigAsync = async ({
|
|
|
6208
6224
|
baseUrl = DEFAULT_BASE_URL;
|
|
6209
6225
|
}
|
|
6210
6226
|
baseUrl = normalizeAndValidateBaseUrl(baseUrl);
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
clientId = fileAuth.clientId;
|
|
6214
|
-
}
|
|
6215
|
-
if (!clientId) {
|
|
6216
|
-
clientId = DEFAULT_CLIENT_ID;
|
|
6217
|
-
}
|
|
6218
|
-
let clientSecret = customClientSecret;
|
|
6219
|
-
if (!clientSecret && fileAuth.clientSecret) {
|
|
6220
|
-
clientSecret = fileAuth.clientSecret;
|
|
6221
|
-
}
|
|
6222
|
-
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
|
|
6227
|
+
const clientId = customClientId || DEFAULT_CLIENT_ID;
|
|
6228
|
+
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(customClientSecret) || Boolean(customClientAssertion));
|
|
6223
6229
|
const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
|
|
6224
6230
|
return {
|
|
6225
6231
|
clientId,
|
|
6226
|
-
clientSecret,
|
|
6232
|
+
clientSecret: customClientSecret,
|
|
6227
6233
|
scopes,
|
|
6228
6234
|
baseUrl,
|
|
6229
6235
|
authorizationEndpoint: `${baseUrl}/identity_/connect/authorize`,
|
|
@@ -6397,6 +6403,16 @@ var resolveIdentityType = (claims, authFlow, email) => {
|
|
|
6397
6403
|
}
|
|
6398
6404
|
return;
|
|
6399
6405
|
};
|
|
6406
|
+
var resolveApplicationSubtype = (claims, authFlow) => {
|
|
6407
|
+
switch (asString(claims?.sub_type)) {
|
|
6408
|
+
case "service.external":
|
|
6409
|
+
return "External";
|
|
6410
|
+
case "service.internal":
|
|
6411
|
+
return "Internal";
|
|
6412
|
+
default:
|
|
6413
|
+
return authFlow === "client_credentials" || authFlow === "federated_credentials" ? "External" : undefined;
|
|
6414
|
+
}
|
|
6415
|
+
};
|
|
6400
6416
|
var looksLikeEmail = (value) => value?.includes("@") ?? false;
|
|
6401
6417
|
var pickEmail = (claims) => {
|
|
6402
6418
|
for (const candidate of [claims?.email, claims?.preferred_username]) {
|
|
@@ -6438,6 +6454,12 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
|
6438
6454
|
const clientId = asString(claims?.client_id);
|
|
6439
6455
|
if (clientId)
|
|
6440
6456
|
identity.clientId = clientId;
|
|
6457
|
+
const subType = asString(claims?.sub_type);
|
|
6458
|
+
if (subType)
|
|
6459
|
+
identity.subType = subType;
|
|
6460
|
+
const applicationSubtype = resolveApplicationSubtype(claims, authFlow);
|
|
6461
|
+
if (applicationSubtype)
|
|
6462
|
+
identity.applicationSubtype = applicationSubtype;
|
|
6441
6463
|
return identity;
|
|
6442
6464
|
};
|
|
6443
6465
|
var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
|
|
@@ -6730,6 +6752,40 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
6730
6752
|
}
|
|
6731
6753
|
};
|
|
6732
6754
|
|
|
6755
|
+
// ../auth/src/tenantSelection.ts
|
|
6756
|
+
var LOGIN_STATUS_HINT = "Run 'uip login status' to see the organization the CLI is signed in to.";
|
|
6757
|
+
var organizationHint = (organizationId) => `The request used '${organizationId}' as the organization. ${LOGIN_STATUS_HINT}`;
|
|
6758
|
+
var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
|
|
6759
|
+
var describeNonJsonResponse = (organizationId, response, parseError) => {
|
|
6760
|
+
if (response.redirected) {
|
|
6761
|
+
return `Could not find organization '${organizationId}': the request was ` + `redirected to a sign-in page instead of the organization's tenant ` + `list. ${LOGIN_STATUS_HINT}`;
|
|
6762
|
+
}
|
|
6763
|
+
const contentType = response.headers.get("content-type") ?? "unknown";
|
|
6764
|
+
return `The organization service returned a '${contentType}' response instead ` + `of JSON: ${parseError.message}. ${organizationHint(organizationId)}`;
|
|
6765
|
+
};
|
|
6766
|
+
var fetchTenantsAndOrganizations = async (baseUrl, accessToken, organizationId, signal) => {
|
|
6767
|
+
const url = `${baseUrl}/${organizationId}/portal_/api/filtering/leftnav/tenantsAndOrganizationInfo`;
|
|
6768
|
+
const response = await fetch(url, {
|
|
6769
|
+
headers: {
|
|
6770
|
+
Authorization: `Bearer ${accessToken}`
|
|
6771
|
+
},
|
|
6772
|
+
...signal ? { signal } : {}
|
|
6773
|
+
});
|
|
6774
|
+
if (!response.ok) {
|
|
6775
|
+
if (response.status === 401) {
|
|
6776
|
+
throw new Error(`Unauthorized: the access token was rejected, it was not ` + `issued for organization '${organizationId}', or ` + `'${organizationId}' was not accepted as an organization ` + `URL segment in this environment. ` + LOGIN_STATUS_HINT);
|
|
6777
|
+
}
|
|
6778
|
+
const errorText = await response.text();
|
|
6779
|
+
const message = `Failed to get tenants and organizations: ${response.status} ${errorText}`;
|
|
6780
|
+
throw new Error(IDENTIFIER_STATUSES.has(response.status) ? `${message}. ${organizationHint(organizationId)}` : message);
|
|
6781
|
+
}
|
|
6782
|
+
const [parseError, data] = await catchError2(response.json());
|
|
6783
|
+
if (parseError) {
|
|
6784
|
+
throw new Error(describeNonJsonResponse(organizationId, response, parseError));
|
|
6785
|
+
}
|
|
6786
|
+
return data;
|
|
6787
|
+
};
|
|
6788
|
+
|
|
6733
6789
|
// ../auth/src/tokenRefresh.ts
|
|
6734
6790
|
var TOKEN_REFRESH_REAUTHENTICATE_MESSAGE = "Token refresh failed. Run 'uip login' to re-authenticate.";
|
|
6735
6791
|
|
|
@@ -6942,6 +6998,8 @@ var saveEnvFileAsync = async ({
|
|
|
6942
6998
|
};
|
|
6943
6999
|
|
|
6944
7000
|
// ../auth/src/loginStatus.ts
|
|
7001
|
+
var defaultRobotTenantIdCache = new Map;
|
|
7002
|
+
var ROBOT_TENANT_LOOKUP_TIMEOUT_MS = 5000;
|
|
6945
7003
|
var getLoginStatusAsync = async (options = {}) => {
|
|
6946
7004
|
return getLoginStatusWithDeps(options);
|
|
6947
7005
|
};
|
|
@@ -6954,12 +7012,20 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
6954
7012
|
refreshToken: refreshTokenFn = refreshAccessToken,
|
|
6955
7013
|
resolveConfig = resolveConfigAsync,
|
|
6956
7014
|
robotFallback = tryRobotClientFallback,
|
|
7015
|
+
fetchTenantsAndOrgs = fetchTenantsAndOrganizations,
|
|
7016
|
+
robotTenantIdCache = defaultRobotTenantIdCache,
|
|
7017
|
+
robotTenantLookupTimeoutMs = ROBOT_TENANT_LOOKUP_TIMEOUT_MS,
|
|
6957
7018
|
loadBreaker = loadRefreshBreaker,
|
|
6958
7019
|
saveBreaker = saveRefreshBreaker,
|
|
6959
7020
|
clearBreaker = clearRefreshBreaker
|
|
6960
7021
|
} = deps;
|
|
7022
|
+
const robotDeps = {
|
|
7023
|
+
fetchTenantsAndOrgs,
|
|
7024
|
+
cache: robotTenantIdCache,
|
|
7025
|
+
lookupTimeoutMs: robotTenantLookupTimeoutMs
|
|
7026
|
+
};
|
|
6961
7027
|
if (isRobotAuthEnforced()) {
|
|
6962
|
-
return resolveRobotEnforcedStatus(robotFallback);
|
|
7028
|
+
return resolveRobotEnforcedStatus(robotFallback, robotDeps);
|
|
6963
7029
|
}
|
|
6964
7030
|
if (isEnvAuthEnabled()) {
|
|
6965
7031
|
return readAuthFromEnv();
|
|
@@ -6977,7 +7043,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
6977
7043
|
hint: `No credentials found for profile "${activeProfile}". Run 'uip login --profile ${activeProfile}' to authenticate this profile.`
|
|
6978
7044
|
};
|
|
6979
7045
|
}
|
|
6980
|
-
return resolveBorrowedRobotStatus(robotFallback);
|
|
7046
|
+
return resolveBorrowedRobotStatus(robotFallback, robotDeps);
|
|
6981
7047
|
}
|
|
6982
7048
|
const loaded = await loadFileCredentials(loadEnvFile, absolutePath);
|
|
6983
7049
|
if ("status" in loaded) {
|
|
@@ -7019,7 +7085,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
7019
7085
|
}
|
|
7020
7086
|
return buildFileStatus(tokens, credentials, globalHint);
|
|
7021
7087
|
};
|
|
7022
|
-
async function resolveRobotEnforcedStatus(robotFallback) {
|
|
7088
|
+
async function resolveRobotEnforcedStatus(robotFallback, deps) {
|
|
7023
7089
|
if (isEnvAuthEnabled()) {
|
|
7024
7090
|
throw new EnvAuthConfigError(`${ENV_AUTH_ENABLE_VAR}=true and ${ENFORCE_ROBOT_AUTH_VAR}=true ` + `are mutually exclusive. Unset one of them and re-run.`);
|
|
7025
7091
|
}
|
|
@@ -7030,11 +7096,11 @@ async function resolveRobotEnforcedStatus(robotFallback) {
|
|
|
7030
7096
|
hint: `${ENFORCE_ROBOT_AUTH_VAR}=true but the UiPath Robot ` + `session is unavailable. Start and sign in to the Assistant, ` + `or unset ${ENFORCE_ROBOT_AUTH_VAR} to fall back to file or ` + `env-var authentication.`
|
|
7031
7097
|
};
|
|
7032
7098
|
}
|
|
7033
|
-
return buildRobotStatus(robotCreds);
|
|
7099
|
+
return buildRobotStatus(robotCreds, deps);
|
|
7034
7100
|
}
|
|
7035
|
-
async function resolveBorrowedRobotStatus(robotFallback) {
|
|
7101
|
+
async function resolveBorrowedRobotStatus(robotFallback, deps) {
|
|
7036
7102
|
const robotCreds = await robotFallback();
|
|
7037
|
-
return robotCreds ? buildRobotStatus(robotCreds) : { loginStatus: "Not logged in" };
|
|
7103
|
+
return robotCreds ? buildRobotStatus(robotCreds, deps) : { loginStatus: "Not logged in" };
|
|
7038
7104
|
}
|
|
7039
7105
|
async function loadFileCredentials(loadEnvFile, absolutePath) {
|
|
7040
7106
|
let credentials;
|
|
@@ -7169,9 +7235,10 @@ function identityFields(accessToken, credentials) {
|
|
|
7169
7235
|
...scopes ? { scopes } : {}
|
|
7170
7236
|
};
|
|
7171
7237
|
}
|
|
7172
|
-
function buildRobotStatus(robotCreds) {
|
|
7238
|
+
async function buildRobotStatus(robotCreds, deps) {
|
|
7173
7239
|
const identity = resolveSessionIdentity(robotCreds.accessToken);
|
|
7174
7240
|
const scopes = readTokenScopes(robotCreds.accessToken);
|
|
7241
|
+
const tenant = robotCreds.tenantId ? { tenantId: robotCreds.tenantId } : await resolveRobotTenantId(robotCreds, deps);
|
|
7175
7242
|
return {
|
|
7176
7243
|
loginStatus: "Logged in",
|
|
7177
7244
|
accessToken: robotCreds.accessToken,
|
|
@@ -7179,14 +7246,62 @@ function buildRobotStatus(robotCreds) {
|
|
|
7179
7246
|
organizationName: robotCreds.organizationName,
|
|
7180
7247
|
organizationId: robotCreds.organizationId,
|
|
7181
7248
|
tenantName: robotCreds.tenantName,
|
|
7182
|
-
tenantId:
|
|
7249
|
+
tenantId: tenant.tenantId,
|
|
7183
7250
|
issuer: robotCreds.issuer,
|
|
7184
7251
|
expiration: getTokenExpiration(robotCreds.accessToken),
|
|
7185
7252
|
source: "robot" /* Robot */,
|
|
7253
|
+
...tenant.hint ? { hint: tenant.hint } : {},
|
|
7186
7254
|
...identity ? { identity } : {},
|
|
7187
7255
|
...scopes ? { scopes } : {}
|
|
7188
7256
|
};
|
|
7189
7257
|
}
|
|
7258
|
+
async function resolveRobotTenantId(robotCreds, deps) {
|
|
7259
|
+
const { baseUrl, accessToken, tenantName } = robotCreds;
|
|
7260
|
+
const organization = robotCreds.organizationName ?? robotCreds.organizationId;
|
|
7261
|
+
if (!tenantName || !organization) {
|
|
7262
|
+
return {};
|
|
7263
|
+
}
|
|
7264
|
+
const key = `${baseUrl}|${organization}|${tenantName}|${accessToken}`;
|
|
7265
|
+
let pending = deps.cache.get(key);
|
|
7266
|
+
if (!pending) {
|
|
7267
|
+
pending = catchError2(lookupRobotTenantId({ baseUrl, accessToken, organization, tenantName }, deps)).then(([error, resolution]) => {
|
|
7268
|
+
const settled = error ? { hint: tenantLookupFailureHint(tenantName, error.message) } : resolution;
|
|
7269
|
+
if (!settled.tenantId) {
|
|
7270
|
+
deps.cache.delete(key);
|
|
7271
|
+
}
|
|
7272
|
+
return settled;
|
|
7273
|
+
});
|
|
7274
|
+
deps.cache.set(key, pending);
|
|
7275
|
+
}
|
|
7276
|
+
return pending;
|
|
7277
|
+
}
|
|
7278
|
+
async function lookupRobotTenantId(target, deps) {
|
|
7279
|
+
const { baseUrl, accessToken, organization, tenantName } = target;
|
|
7280
|
+
const [error, data] = await catchError2(deps.fetchTenantsAndOrgs(baseUrl, accessToken, organization, AbortSignal.timeout(deps.lookupTimeoutMs)));
|
|
7281
|
+
if (error) {
|
|
7282
|
+
const reason = error.name === "TimeoutError" ? `the tenant list did not answer within ${deps.lookupTimeoutMs} ms.` : error.message;
|
|
7283
|
+
return { hint: tenantLookupFailureHint(tenantName, reason) };
|
|
7284
|
+
}
|
|
7285
|
+
const rows = data?.tenants;
|
|
7286
|
+
const tenants = Array.isArray(rows) ? rows.filter((tenant) => typeof tenant?.id === "string" && typeof tenant?.name === "string") : [];
|
|
7287
|
+
const wantedName = decodePathSegment(tenantName);
|
|
7288
|
+
const wanted = wantedName.toLowerCase();
|
|
7289
|
+
const match = tenants.find((tenant) => tenant.name === wantedName) ?? tenants.find((tenant) => tenant.name.toLowerCase() === wanted);
|
|
7290
|
+
if (!match) {
|
|
7291
|
+
const names = tenants.map((tenant) => tenant.name).join(", ");
|
|
7292
|
+
return {
|
|
7293
|
+
hint: `The Robot session targets tenant '${tenantName}', but ` + `organization '${organization}' lists no tenant of that name` + `${names ? ` (available: ${names})` : ""}. Commands that need ` + `the tenant id will fail until it can be resolved.`
|
|
7294
|
+
};
|
|
7295
|
+
}
|
|
7296
|
+
return { tenantId: match.id };
|
|
7297
|
+
}
|
|
7298
|
+
function tenantLookupFailureHint(tenantName, reason) {
|
|
7299
|
+
return `Could not resolve the id of tenant '${tenantName}' from the ` + `Robot session: ${reason} Commands that need the tenant id will ` + `fail until it can be resolved.`;
|
|
7300
|
+
}
|
|
7301
|
+
function decodePathSegment(segment) {
|
|
7302
|
+
const [error, decoded] = catchError2(() => decodeURIComponent(segment));
|
|
7303
|
+
return error ? segment : decoded;
|
|
7304
|
+
}
|
|
7190
7305
|
var isFileNotFoundError = (error) => {
|
|
7191
7306
|
if (!(error instanceof Object))
|
|
7192
7307
|
return false;
|
|
@@ -7455,9 +7570,6 @@ var getAuthContext = async (options = {}) => {
|
|
|
7455
7570
|
identity: status.identity
|
|
7456
7571
|
};
|
|
7457
7572
|
};
|
|
7458
|
-
// ../auth/src/tenantSelection.ts
|
|
7459
|
-
var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
|
|
7460
|
-
|
|
7461
7573
|
// ../auth/src/selectTenant.ts
|
|
7462
7574
|
var TENANT_SELECTION_REQUIRED_CODE = "TENANT_SELECTION_REQUIRED";
|
|
7463
7575
|
var INVALID_TENANT_CODE = "INVALID_TENANT";
|
|
@@ -9561,6 +9673,14 @@ var INGESTIONS_CREATE_EXAMPLES = [
|
|
|
9561
9673
|
Code: "PmIngestionsCreate",
|
|
9562
9674
|
Data: { Status: "Accepted" }
|
|
9563
9675
|
}
|
|
9676
|
+
},
|
|
9677
|
+
{
|
|
9678
|
+
Description: "Load the app template's built-in demo sample data instead of uploaded files",
|
|
9679
|
+
Command: "uip pm ingestions create 9c46289e --sample-data --wait",
|
|
9680
|
+
Output: {
|
|
9681
|
+
Code: "PmIngestionsCreate",
|
|
9682
|
+
Data: { Status: "SUCCESS", IngestionId: "1d7e1421" }
|
|
9683
|
+
}
|
|
9564
9684
|
}
|
|
9565
9685
|
];
|
|
9566
9686
|
var INGESTIONS_CANCEL_EXAMPLES = [
|
|
@@ -9589,10 +9709,26 @@ var INGESTIONS_LOGS_EXAMPLES = [
|
|
|
9589
9709
|
];
|
|
9590
9710
|
function registerIngestionsCommand(program2) {
|
|
9591
9711
|
const ingestionsCmd = program2.command("ingestions").description("Trigger and inspect data ingestions of a process app");
|
|
9592
|
-
ingestionsCmd.command("create <app-id>").description("Trigger an ingestion of the uploaded data files").addOption(new Option("--stage <stage>", "App stage to ingest into").choices(STAGES6).default("dev")).addOption(new Option("--file-format <format>", "Data file format").choices(FILE_FORMATS).default("csv")).option("--field-delimiter <char>", "Field delimiter in the data files", ",").option("--quote-character <char>", "Quote character enclosing fields", '"').addOption(new Option("--encoding <encoding>", "File encoding").choices(ENCODINGS).default("utf-8")).
|
|
9712
|
+
ingestionsCmd.command("create <app-id>").description("Trigger an ingestion of the uploaded data files, or of the app " + "template's built-in demo sample data (--sample-data)").addOption(new Option("--stage <stage>", "App stage to ingest into").choices(STAGES6).default("dev")).addOption(new Option("--file-format <format>", "Data file format").choices(FILE_FORMATS).default("csv")).option("--field-delimiter <char>", "Field delimiter in the data files", ",").option("--quote-character <char>", "Quote character enclosing fields", '"').addOption(new Option("--encoding <encoding>", "File encoding").choices(ENCODINGS).default("utf-8")).addOption(new Option("--sample-data", "Ingest the demo sample data UiPath ships with the app template " + "instead of uploaded files (no 'files upload' needed). It is " + "not your data — never use it in an app meant to analyze real " + "data. Only for " + "templates whose 'app-types list' entry has " + "SampleDataAvailable: true").conflicts([
|
|
9713
|
+
"fileFormat",
|
|
9714
|
+
"fieldDelimiter",
|
|
9715
|
+
"quoteCharacter",
|
|
9716
|
+
"encoding"
|
|
9717
|
+
])).option("--wait", "Block until the ingestion reaches a terminal state; exit non-zero on failure").option("--timeout <seconds>", "Max seconds to wait when --wait is set", "1800").option("--poll-interval <seconds>", "Seconds between status polls when --wait is set", "5").examples(INGESTIONS_CREATE_EXAMPLES).trackedAction(processContext, async (appId, options) => {
|
|
9593
9718
|
const config = await loadConfigOrExit();
|
|
9594
9719
|
if (!config)
|
|
9595
9720
|
return;
|
|
9721
|
+
if (options.sampleData) {
|
|
9722
|
+
const [availErr, availability] = await catchError(pmGet(config, `/apps/${encodeURIComponent(appId)}/${options.stage}/sampleDataAvailable`));
|
|
9723
|
+
if (availErr) {
|
|
9724
|
+
fail(availErr.message, "Check the app id (uip pm apps list) and your authentication.");
|
|
9725
|
+
return;
|
|
9726
|
+
}
|
|
9727
|
+
if (field(availability ?? {}, "sampleDataAvailable") !== true) {
|
|
9728
|
+
fail(`App '${appId}' has no sample data available: its app template ships none, or the app was imported.`, "Upload your own data (uip pm files upload) and run 'uip pm ingestions create' " + "without --sample-data, or create the app from a template whose " + "'uip pm app-types list' entry has SampleDataAvailable: true.");
|
|
9729
|
+
return;
|
|
9730
|
+
}
|
|
9731
|
+
}
|
|
9596
9732
|
let before = {};
|
|
9597
9733
|
if (options.wait) {
|
|
9598
9734
|
const [readErr, snapshot] = await catchError(readLastIngestion(config, appId, options.stage));
|
|
@@ -9602,7 +9738,7 @@ function registerIngestionsCommand(program2) {
|
|
|
9602
9738
|
}
|
|
9603
9739
|
before = snapshot;
|
|
9604
9740
|
}
|
|
9605
|
-
const [err, result] = await catchError(pmPost(config, `/apps/${appId}/${options.stage}/ingest`, {
|
|
9741
|
+
const [err, result] = await catchError(pmPost(config, `/apps/${encodeURIComponent(appId)}/${options.stage}/ingest`, options.sampleData ? { useSampleData: true } : {
|
|
9606
9742
|
fileFormat: options.fileFormat,
|
|
9607
9743
|
fileFormatOptions: {
|
|
9608
9744
|
fieldDelimiter: options.fieldDelimiter,
|
|
@@ -9611,7 +9747,7 @@ function registerIngestionsCommand(program2) {
|
|
|
9611
9747
|
}
|
|
9612
9748
|
}));
|
|
9613
9749
|
if (err) {
|
|
9614
|
-
fail(err.message, "Check the app id and that data files were uploaded (uip pm files upload).");
|
|
9750
|
+
fail(err.message, options.sampleData ? "Check the app id and that no other ingestion is running on this stage." : "Check the app id and that data files were uploaded (uip pm files upload).");
|
|
9615
9751
|
return;
|
|
9616
9752
|
}
|
|
9617
9753
|
if (options.wait) {
|
|
@@ -10327,4 +10463,4 @@ var registerCommands = async (program2) => {
|
|
|
10327
10463
|
|
|
10328
10464
|
export { Command, metadata, registerCommands };
|
|
10329
10465
|
|
|
10330
|
-
//# debugId=
|
|
10466
|
+
//# debugId=B28602CCED487C9364756E2164756E21
|
package/dist/tool.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uipath/pm-tool",
|
|
3
3
|
"author": "UiPath",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.205.0-preview.256",
|
|
6
6
|
"description": "Process Mining — process apps, transformations, and data ingestion.",
|
|
7
7
|
"private": false,
|
|
8
8
|
"repository": {
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "63740c6cbb7ff282fa9118cc16a148eb030b245f"
|
|
31
31
|
}
|