@uipath/function-tool 1.200.0 → 1.201.0-preview.123
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/packager-tool.js +28 -6
- package/dist/tool.js +11895 -11141
- package/package.json +2 -2
package/dist/packager-tool.js
CHANGED
|
@@ -1887,10 +1887,27 @@ var EXCLUDED_NAMES = new Set([
|
|
|
1887
1887
|
".env",
|
|
1888
1888
|
".deno",
|
|
1889
1889
|
"dist",
|
|
1890
|
-
".uip-dbg",
|
|
1891
1890
|
".uipath"
|
|
1892
1891
|
]);
|
|
1893
1892
|
var EXCLUDED_EXTENSIONS = [".nupkg"];
|
|
1893
|
+
var NPMRC = ".npmrc";
|
|
1894
|
+
var UIPATH_SCOPE = "@uipath:";
|
|
1895
|
+
var CREDENTIAL_KEYS = ["_authtoken", "_auth", "_password"];
|
|
1896
|
+
function isComment(line) {
|
|
1897
|
+
return line === "" || line.startsWith("#") || line.startsWith(";");
|
|
1898
|
+
}
|
|
1899
|
+
function isOurs(line) {
|
|
1900
|
+
const trimmed = line.trim();
|
|
1901
|
+
if (isComment(trimmed))
|
|
1902
|
+
return false;
|
|
1903
|
+
const key = (trimmed.split("=")[0] ?? "").trim().toLowerCase();
|
|
1904
|
+
return key.startsWith(UIPATH_SCOPE) || CREDENTIAL_KEYS.some((c) => key.endsWith(c));
|
|
1905
|
+
}
|
|
1906
|
+
function sanitizeNpmrc(content) {
|
|
1907
|
+
const kept = content.split(/\r?\n/).filter((line) => !isOurs(line));
|
|
1908
|
+
return kept.some((line) => !isComment(line.trim())) ? kept.join(`
|
|
1909
|
+
`) : null;
|
|
1910
|
+
}
|
|
1894
1911
|
var LOCK_FILES = new Set(["bun.lock", "package-lock.json", "deno.lock", "yarn.lock"]);
|
|
1895
1912
|
async function buildFunctionsPackage(fs, options) {
|
|
1896
1913
|
const { projectPath, outputPath, projectStorageId } = options;
|
|
@@ -1907,7 +1924,7 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
1907
1924
|
throw new Error("entry-points.json not found. Run 'uipath-functions pack' to generate it.");
|
|
1908
1925
|
}
|
|
1909
1926
|
const entryPoints = JSON.parse(entryPointsRaw);
|
|
1910
|
-
const bindingsRaw = await fs.readFile(fs.path.join(projectPath, "
|
|
1927
|
+
const bindingsRaw = await fs.readFile(fs.path.join(projectPath, "bindings_v2.json"), "utf-8");
|
|
1911
1928
|
const bindings = bindingsRaw ? JSON.parse(bindingsRaw) : {
|
|
1912
1929
|
$schema: "https://cloud.uipath.com/draft/2024-12/bindings",
|
|
1913
1930
|
version: "2.0",
|
|
@@ -1918,11 +1935,9 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
1918
1935
|
const targetRuntime = detectRuntime(uipathJson.functions);
|
|
1919
1936
|
const includeLockFile = options.excludeLockFile ? false : uipathJson.packOptions?.includeLockFile ?? true;
|
|
1920
1937
|
await copyProjectFiles(fs, projectPath, contentPath, includeLockFile, uipathJson.packOptions);
|
|
1921
|
-
const mainPath = entryPoints.entryPoints[0]?.filePath ?? "";
|
|
1922
1938
|
const operateJson = {
|
|
1923
1939
|
$schema: "https://cloud.uipath.com/draft/2024-12/operate",
|
|
1924
1940
|
projectId: projectStorageId,
|
|
1925
|
-
main: mainPath,
|
|
1926
1941
|
contentType: "function",
|
|
1927
1942
|
targetFramework: "Portable",
|
|
1928
1943
|
targetRuntime,
|
|
@@ -1930,6 +1945,9 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
1930
1945
|
requiresUserInteraction: false,
|
|
1931
1946
|
isAttended: false
|
|
1932
1947
|
},
|
|
1948
|
+
deploymentOptions: {
|
|
1949
|
+
generateSlug: true
|
|
1950
|
+
},
|
|
1933
1951
|
dependencies: packageDependencies
|
|
1934
1952
|
};
|
|
1935
1953
|
await fs.writeFile(fs.path.join(contentPath, "operate.json"), JSON.stringify(operateJson, null, 2));
|
|
@@ -1946,7 +1964,7 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
1946
1964
|
for (const ep of entryPoints.entryPoints) {
|
|
1947
1965
|
const fnEntry = uipathJson.functions?.[ep.filePath];
|
|
1948
1966
|
const filePath = fnEntry ? fnEntry.split(":")[0] ?? ep.filePath : ep.filePath;
|
|
1949
|
-
packageDescriptor.files[ep.filePath] =
|
|
1967
|
+
packageDescriptor.files[ep.filePath] = `${filePath}`;
|
|
1950
1968
|
}
|
|
1951
1969
|
await fs.writeFile(fs.path.join(contentPath, "package-descriptor.json"), JSON.stringify(packageDescriptor, null, 2));
|
|
1952
1970
|
}
|
|
@@ -1984,6 +2002,10 @@ async function copyProjectFiles(fs, sourcePath, destPath, includeLockFile, packO
|
|
|
1984
2002
|
const stat = await fs.stat(srcEntry);
|
|
1985
2003
|
if (stat?.isDirectory()) {
|
|
1986
2004
|
await walk(srcEntry, destEntry);
|
|
2005
|
+
} else if (name === NPMRC) {
|
|
2006
|
+
const sanitized = sanitizeNpmrc(await fs.readFile(srcEntry, "utf-8") ?? "");
|
|
2007
|
+
if (sanitized !== null)
|
|
2008
|
+
await fs.writeFile(destEntry, sanitized);
|
|
1987
2009
|
} else if (stat?.isFile()) {
|
|
1988
2010
|
const content = await fs.readFile(srcEntry);
|
|
1989
2011
|
if (content)
|
|
@@ -2288,4 +2310,4 @@ export {
|
|
|
2288
2310
|
registerPackagerFactories
|
|
2289
2311
|
};
|
|
2290
2312
|
|
|
2291
|
-
//# debugId=
|
|
2313
|
+
//# debugId=A20941B0BC0FCD2364756E2164756E21
|