@uipath/codedapp-tool 1.206.0-preview.301 → 1.207.0-preview.305
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/README.md +8 -1
- package/dist/THIRD-PARTY-NOTICES.md +34 -1
- package/dist/{browser-strategy-z97p0ezf.js → browser-strategy-zem90qdb.js} +1 -1
- package/dist/{index-mmkm1w8a.js → index-11wr60x6.js} +177 -13
- package/dist/{index-c3zcyvwz.js → index-928adfk3.js} +6 -4
- package/dist/index-a74rgqpp.js +12 -0
- package/dist/{index-pkqd5f49.js → index-aj4dp6kt.js} +11 -8
- package/dist/index.js +10 -9
- package/dist/{node-strategy-fk02jqd8.js → node-strategy-ems5bj71.js} +2 -2
- package/dist/{packager-tool-ew0d2fjb.js → packager-tool-1s4184sh.js} +96 -6
- package/dist/{packager-tool-szf8dh1w.js → packager-tool-2g046zfh.js} +1640 -174
- package/dist/{packager-tool-z73h4t8a.js → packager-tool-511nvmp8.js} +421 -245
- package/dist/{packager-tool-t0j980y4.js → packager-tool-62r4c9hq.js} +554 -54
- package/dist/{packager-tool-0ajs8pnk.js → packager-tool-9thx6ae9.js} +30 -8
- package/dist/{packager-tool-1qg04b7q.js → packager-tool-bzcphfa8.js} +4 -2
- package/dist/{packager-tool-tpa79b11.js → packager-tool-g7b4kkqx.js} +9761 -8437
- package/dist/{packager-tool-3ss96mpk.js → packager-tool-rnnkxjfm.js} +60 -18
- package/dist/{packager-tool-5t7c439j.js → packager-tool-tjb9qmzj.js} +9 -646
- package/dist/packager-tool-ywc134a9.js +915 -0
- package/dist/packager-tool.js +68 -7
- package/dist/tool.js +10 -9
- package/dist/zip-gfch9knd.js +77 -0
- package/package.json +3 -3
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UIPATH_HOME_DIR,
|
|
3
3
|
AUTH_FILENAME,
|
|
4
|
+
AUTH_FILE_MODE,
|
|
5
|
+
AUTH_DIR_MODE,
|
|
4
6
|
DEFAULT_BASE_URL,
|
|
5
7
|
DEFAULT_REDIRECT_URI
|
|
6
|
-
} from "./packager-tool-
|
|
8
|
+
} from "./packager-tool-bzcphfa8.js";
|
|
7
9
|
import {
|
|
8
10
|
getFileSystem
|
|
9
|
-
} from "./packager-tool-
|
|
11
|
+
} from "./packager-tool-9thx6ae9.js";
|
|
10
12
|
import {
|
|
11
13
|
__require
|
|
12
14
|
} from "./packager-tool-6an893wm.js";
|
|
@@ -684,7 +686,7 @@ var readTokenScopes2 = (accessToken) => accessToken ? pickScopes(decodeClaims(ac
|
|
|
684
686
|
// ../auth/src/envAuth.ts
|
|
685
687
|
var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
|
|
686
688
|
var ENFORCE_ROBOT_AUTH_VAR = "UIPATH_CLI_ENFORCE_ROBOT_AUTH";
|
|
687
|
-
var
|
|
689
|
+
var ENV_AUTH_VARS2 = {
|
|
688
690
|
token: "UIPATH_CLI_AUTH_TOKEN",
|
|
689
691
|
organizationName: "UIPATH_CLI_ORGANIZATION_NAME",
|
|
690
692
|
organizationId: "UIPATH_CLI_ORGANIZATION_ID",
|
|
@@ -721,17 +723,17 @@ var resolveBaseUrl = (rawUrl, failureContext) => {
|
|
|
721
723
|
return baseUrl;
|
|
722
724
|
};
|
|
723
725
|
var readAuthFromEnv = () => {
|
|
724
|
-
const accessToken = requireEnv(
|
|
725
|
-
const organizationName = requireEnv(
|
|
726
|
-
const organizationId = requireEnv(
|
|
727
|
-
const tenantName = requireEnv(
|
|
728
|
-
const tenantId = requireEnv(
|
|
726
|
+
const accessToken = requireEnv(ENV_AUTH_VARS2.token);
|
|
727
|
+
const organizationName = requireEnv(ENV_AUTH_VARS2.organizationName);
|
|
728
|
+
const organizationId = requireEnv(ENV_AUTH_VARS2.organizationId);
|
|
729
|
+
const tenantName = requireEnv(ENV_AUTH_VARS2.tenantName);
|
|
730
|
+
const tenantId = requireEnv(ENV_AUTH_VARS2.tenantId);
|
|
729
731
|
const [parseError, payload] = catchError2(() => parseJWT(accessToken));
|
|
730
732
|
if (parseError) {
|
|
731
733
|
const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
|
|
732
734
|
const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
|
|
733
735
|
if (!rawUrl) {
|
|
734
|
-
throw new EnvAuthConfigError(`${
|
|
736
|
+
throw new EnvAuthConfigError(`${ENV_AUTH_VARS2.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
|
|
735
737
|
}
|
|
736
738
|
const baseUrl = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
|
|
737
739
|
return {
|
|
@@ -748,7 +750,7 @@ var readAuthFromEnv = () => {
|
|
|
748
750
|
}
|
|
749
751
|
const iss = payload.iss;
|
|
750
752
|
if (typeof iss !== "string" || iss.length === 0) {
|
|
751
|
-
throw new EnvAuthConfigError(`${
|
|
753
|
+
throw new EnvAuthConfigError(`${ENV_AUTH_VARS2.token} has no 'iss' claim; cannot determine ` + `the UiPath server. Ensure the token was issued by a UiPath identity server.`);
|
|
752
754
|
}
|
|
753
755
|
const baseUrl = resolveBaseUrl(iss, "Failed to derive server URL from token 'iss' claim");
|
|
754
756
|
const expiration = getTokenExpiration(accessToken);
|
|
@@ -1186,6 +1188,38 @@ var loadEnvFileAsync = async ({ envPath }) => {
|
|
|
1186
1188
|
}
|
|
1187
1189
|
return parseEnvContent(content);
|
|
1188
1190
|
};
|
|
1191
|
+
var findAuthHomeDir = (fs, dir) => {
|
|
1192
|
+
let current = dir;
|
|
1193
|
+
for (;; ) {
|
|
1194
|
+
if (fs.path.basename(current) === UIPATH_HOME_DIR)
|
|
1195
|
+
return current;
|
|
1196
|
+
const parent = fs.path.dirname(current);
|
|
1197
|
+
if (parent === current)
|
|
1198
|
+
return;
|
|
1199
|
+
current = parent;
|
|
1200
|
+
}
|
|
1201
|
+
};
|
|
1202
|
+
var TEMP_FILE_ATTEMPTS = 5;
|
|
1203
|
+
var isFileExists = (error) => error instanceof Error && error.code === "EEXIST";
|
|
1204
|
+
var writeTempFile = async (fs, targetPath, content) => {
|
|
1205
|
+
for (let attempt = 1;; attempt++) {
|
|
1206
|
+
const tempPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
|
|
1207
|
+
try {
|
|
1208
|
+
await fs.writeFile(tempPath, content, {
|
|
1209
|
+
mode: AUTH_FILE_MODE,
|
|
1210
|
+
exclusive: true
|
|
1211
|
+
});
|
|
1212
|
+
return tempPath;
|
|
1213
|
+
} catch (error) {
|
|
1214
|
+
if (!isFileExists(error)) {
|
|
1215
|
+
await fs.rm(tempPath).catch(() => {});
|
|
1216
|
+
throw error;
|
|
1217
|
+
}
|
|
1218
|
+
if (attempt === TEMP_FILE_ATTEMPTS)
|
|
1219
|
+
throw error;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1189
1223
|
var saveEnvFileAsync2 = async ({
|
|
1190
1224
|
envPath,
|
|
1191
1225
|
data,
|
|
@@ -1213,10 +1247,18 @@ var saveEnvFileAsync2 = async ({
|
|
|
1213
1247
|
`)}
|
|
1214
1248
|
`;
|
|
1215
1249
|
const dir = fs.path.dirname(absolutePath);
|
|
1216
|
-
await fs.mkdir(dir);
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1219
|
-
|
|
1250
|
+
await fs.mkdir(dir, { mode: AUTH_DIR_MODE });
|
|
1251
|
+
const authHomeDir = findAuthHomeDir(fs, dir);
|
|
1252
|
+
if (authHomeDir !== undefined) {
|
|
1253
|
+
await fs.chmod?.(authHomeDir, AUTH_DIR_MODE);
|
|
1254
|
+
}
|
|
1255
|
+
const tempPath = await writeTempFile(fs, absolutePath, content);
|
|
1256
|
+
try {
|
|
1257
|
+
await fs.rename(tempPath, absolutePath);
|
|
1258
|
+
} catch (error) {
|
|
1259
|
+
await fs.rm(tempPath).catch(() => {});
|
|
1260
|
+
throw error;
|
|
1261
|
+
}
|
|
1220
1262
|
};
|
|
1221
1263
|
|
|
1222
1264
|
// ../auth/src/loginStatus.ts
|
|
@@ -1868,10 +1910,10 @@ var authenticate2 = async ({
|
|
|
1868
1910
|
const authUrl = `${authorizationEndpoint}?${authParams.toString()}`;
|
|
1869
1911
|
let strategy;
|
|
1870
1912
|
if (isBrowser()) {
|
|
1871
|
-
const { BrowserAuthStrategy } = await import("./browser-strategy-
|
|
1913
|
+
const { BrowserAuthStrategy } = await import("./browser-strategy-zem90qdb.js");
|
|
1872
1914
|
strategy = new BrowserAuthStrategy;
|
|
1873
1915
|
} else {
|
|
1874
|
-
const { NodeAuthStrategy } = await import("./node-strategy-
|
|
1916
|
+
const { NodeAuthStrategy } = await import("./node-strategy-ems5bj71.js");
|
|
1875
1917
|
strategy = new NodeAuthStrategy;
|
|
1876
1918
|
}
|
|
1877
1919
|
const code = await strategy.execute(authUrl, effectiveRedirectUriUrl, state, {
|
|
@@ -1891,6 +1933,6 @@ var authenticate2 = async ({
|
|
|
1891
1933
|
});
|
|
1892
1934
|
};
|
|
1893
1935
|
|
|
1894
|
-
export { resolveSessionIdentity2, readTokenScopes2, saveEnvFileAsync2, getLoginStatusAsync2, getAuthContext2, authenticate2 };
|
|
1936
|
+
export { resolveSessionIdentity2, readTokenScopes2, ENV_AUTH_VARS2, saveEnvFileAsync2, getLoginStatusAsync2, getAuthContext2, authenticate2 };
|
|
1895
1937
|
|
|
1896
|
-
//# debugId=
|
|
1938
|
+
//# debugId=1B715F2D4408F9E064756E2164756E21
|