@uipath/agent-tool 1.206.0-preview.303 → 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/dist/THIRD-PARTY-NOTICES.md +2 -2
- package/dist/{agent-tool-OK5DK57D-bjevqt47.js → agent-tool-OK5DK57D-swanc7b5.js} +2 -2
- package/dist/{browser-strategy-gnftxwsf.js → browser-strategy-1nk8hgcf.js} +1 -1
- package/dist/{de-AI7ML6JM-km47f8k4.js → de-B6IFKV43-9sk50xx0.js} +164 -2
- package/dist/{en-LAVDF7IQ-xe939kq1.js → en-5JIPZTS5-q1x823gc.js} +4 -2
- package/dist/{es-SPNKTD5Y-vw5cbgv5.js → es-AQW6PFIU-q2mz247f.js} +164 -2
- package/dist/{es-MX-7KJZPEQN-1fq0a9jr.js → es-MX-KWITVBWE-w49gknha.js} +164 -2
- package/dist/executor-tool.js +42 -9
- package/dist/{fr-AXJGUT53-hdg3pmd4.js → fr-RNWK2TMC-dpyzj366.js} +164 -2
- package/dist/index-9vtvwe74.js +26 -0
- package/dist/{index-89cxyepj.js → index-je168ncz.js} +7 -5
- package/dist/{index-r7ff4pb0.js → index-knn2nm9e.js} +104 -60
- package/dist/{index-18dnd3nk.js → index-v88kds1m.js} +5 -5
- package/dist/{index-kvhrzcvf.js → index-yv2728h1.js} +3 -3
- package/dist/index.js +9 -9
- package/dist/{ja-C7GZV6YP-hvtbngr5.js → ja-DH4I3GEF-ywyhhppa.js} +164 -2
- package/dist/{ko-Q24HSSL4-5vn55pte.js → ko-R5BCWVO7-whzgmh6q.js} +164 -2
- package/dist/{memory-runtime-service-tt5y1af6.js → memory-runtime-service-zk17fk27.js} +57 -11
- package/dist/{node-strategy-fk02jqd8.js → node-strategy-ems5bj71.js} +2 -2
- package/dist/{packager-tool-9xrkfzn1.js → packager-tool-4px3x90r.js} +51 -9
- package/dist/{packager-tool-j4an6b3v.js → packager-tool-85qp13np.js} +786 -294
- 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-2dd1qswc.js → packager-tool-fjgtaen6.js} +144 -12
- package/dist/{packager-tool-4shqngrj.js → packager-tool-gpm2hwy5.js} +316 -261
- package/dist/{packager-tool-kawtadzm.js → packager-tool-hgmpt45k.js} +34 -34
- package/dist/{packager-tool-fc08rcbk.js → packager-tool-k7h03v9f.js} +5 -3
- package/dist/{packager-tool-9nh85680.js → packager-tool-m0wy5pqh.js} +4 -2
- package/dist/{packager-tool-3t6d1zdz.js → packager-tool-m63j60x7.js} +120 -13
- package/dist/{packager-tool-dy6gcgks.js → packager-tool-wqg51y3z.js} +328 -133
- package/dist/{packager-tool-ehaw8hwg.js → packager-tool-xmv0ajm4.js} +56 -15
- package/dist/{packager-tool-kphvt8vb.js → packager-tool-yz4vywz9.js} +52 -15
- package/dist/packager-tool.js +6 -6
- package/dist/{pt-BR-BIUJXIPU-2sqzhr8y.js → pt-BR-6TBBEDQS-y3f2vg5d.js} +164 -2
- package/dist/{pt-MHX6JGAX-xfgvdqwg.js → pt-ZSQC5RZ3-8kp3g1z5.js} +164 -2
- package/dist/{ro-3RKJNGJZ-xqj14e3d.js → ro-P33AQ6ZL-s92z1mgg.js} +164 -2
- package/dist/solution-auth-1tdetckr.js +11 -0
- package/dist/tool.js +9 -9
- package/dist/{tr-PQLUUHPC-qsb7btxn.js → tr-XD73CQAA-tb2nrpyp.js} +164 -2
- package/dist/{zh-CN-OHNTHZRI-b0hjkfqn.js → zh-CN-GWP3B2EM-c07fm17a.js} +164 -2
- package/dist/{zh-TW-E4D3Y6ZR-tn3bmzz5.js → zh-TW-2DLUOA7C-9khqnr4r.js} +164 -2
- package/package.json +2 -2
- package/dist/solution-auth-4zs3axft.js +0 -11
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./packager-tool-wbksf242.js";
|
|
4
4
|
|
|
5
5
|
// ../packager/packager-core/src/filesystem/path.ts
|
|
6
|
-
class
|
|
6
|
+
class Path2 {
|
|
7
7
|
static normalize(path) {
|
|
8
8
|
return path.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
9
9
|
}
|
|
10
10
|
static join(...segments) {
|
|
11
|
-
return
|
|
11
|
+
return Path2.normalize(segments.filter((s) => s.length > 0).join("/"));
|
|
12
12
|
}
|
|
13
13
|
static dirname(path) {
|
|
14
|
-
const normalized =
|
|
14
|
+
const normalized = Path2.normalize(path).replace(/\/$/, "");
|
|
15
15
|
if (normalized === "")
|
|
16
16
|
return ".";
|
|
17
17
|
const lastSlash = normalized.lastIndexOf("/");
|
|
@@ -22,14 +22,14 @@ class Path {
|
|
|
22
22
|
return normalized.substring(0, lastSlash);
|
|
23
23
|
}
|
|
24
24
|
static basename(path) {
|
|
25
|
-
const normalized =
|
|
25
|
+
const normalized = Path2.normalize(path).replace(/\/$/, "");
|
|
26
26
|
if (normalized === "")
|
|
27
27
|
return "";
|
|
28
28
|
const lastSlash = normalized.lastIndexOf("/");
|
|
29
29
|
return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
|
|
30
30
|
}
|
|
31
31
|
static extname(path) {
|
|
32
|
-
const base =
|
|
32
|
+
const base = Path2.basename(path);
|
|
33
33
|
const lastDot = base.lastIndexOf(".");
|
|
34
34
|
if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
|
|
35
35
|
return "";
|
|
@@ -38,28 +38,27 @@ class Path {
|
|
|
38
38
|
}
|
|
39
39
|
static async walkDirectory(fs, rootPath, currentRelativePath = "") {
|
|
40
40
|
const entries = [];
|
|
41
|
-
const absolutePath = currentRelativePath ?
|
|
41
|
+
const absolutePath = currentRelativePath ? Path2.join(rootPath, currentRelativePath) : rootPath;
|
|
42
42
|
const items = await fs.readdir(absolutePath);
|
|
43
43
|
for (const item of items) {
|
|
44
|
-
const itemRelativePath = currentRelativePath ?
|
|
45
|
-
const itemAbsolutePath =
|
|
44
|
+
const itemRelativePath = currentRelativePath ? Path2.join(currentRelativePath, item) : item;
|
|
45
|
+
const itemAbsolutePath = Path2.join(rootPath, itemRelativePath);
|
|
46
46
|
const stat = await fs.stat(itemAbsolutePath);
|
|
47
47
|
if (stat?.isDirectory()) {
|
|
48
|
-
const subEntries = await
|
|
48
|
+
const subEntries = await Path2.walkDirectory(fs, rootPath, itemRelativePath);
|
|
49
49
|
entries.push(...subEntries);
|
|
50
50
|
} else if (stat?.isFile()) {
|
|
51
51
|
entries.push({
|
|
52
|
-
relativePath:
|
|
53
|
-
absolutePath:
|
|
52
|
+
relativePath: Path2.normalize(itemRelativePath),
|
|
53
|
+
absolutePath: Path2.normalize(itemAbsolutePath)
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
return entries;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
|
|
61
60
|
// ../packager/packager-core/src/filesystem/temporary-storage-service.ts
|
|
62
|
-
class
|
|
61
|
+
class TemporaryStorageService2 {
|
|
63
62
|
fileSystem;
|
|
64
63
|
_tempFolderPath = null;
|
|
65
64
|
constructor(fileSystem) {
|
|
@@ -69,7 +68,7 @@ class TemporaryStorageService {
|
|
|
69
68
|
if (!this._tempFolderPath) {
|
|
70
69
|
const systemTempDir = await this.fileSystem.getTempDir();
|
|
71
70
|
const uniqueFolderName = this.generateUniqueFolderName();
|
|
72
|
-
this._tempFolderPath =
|
|
71
|
+
this._tempFolderPath = Path2.join(systemTempDir, uniqueFolderName);
|
|
73
72
|
await this.fileSystem.mkdir(this._tempFolderPath);
|
|
74
73
|
}
|
|
75
74
|
return this._tempFolderPath;
|
|
@@ -81,7 +80,7 @@ class TemporaryStorageService {
|
|
|
81
80
|
}
|
|
82
81
|
async getTempSubfolderPathAsync(subfolder) {
|
|
83
82
|
const tempFolderPath = await this.getTempFolderPath();
|
|
84
|
-
const inputPath =
|
|
83
|
+
const inputPath = Path2.join(tempFolderPath, subfolder);
|
|
85
84
|
await this.fileSystem.mkdir(inputPath);
|
|
86
85
|
return inputPath;
|
|
87
86
|
}
|
|
@@ -104,250 +103,6 @@ class TemporaryStorageService {
|
|
|
104
103
|
} catch {}
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
|
-
// ../packager/packager-core/src/models/nuget-constants.ts
|
|
108
|
-
var NugetConstants = {
|
|
109
|
-
OutputFolderName: "bundle",
|
|
110
|
-
ContentFolderName: "content",
|
|
111
|
-
OperateFileName: "operate.json",
|
|
112
|
-
EntryPointsFileName: "entry-points.json",
|
|
113
|
-
PackageDescriptorFileName: "package-descriptor.json",
|
|
114
|
-
BindingsV2FileName: "bindings_v2.json",
|
|
115
|
-
BindingsFileId: "bindings.json"
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
// ../packager/packager-core/src/models/tool-result.ts
|
|
119
|
-
class ToolResult {
|
|
120
|
-
errorCode;
|
|
121
|
-
message;
|
|
122
|
-
packages;
|
|
123
|
-
details;
|
|
124
|
-
instructions;
|
|
125
|
-
constructor(errorCode, message, packages = [], instructions) {
|
|
126
|
-
this.errorCode = errorCode;
|
|
127
|
-
this.message = message;
|
|
128
|
-
this.packages = packages;
|
|
129
|
-
this.instructions = instructions;
|
|
130
|
-
}
|
|
131
|
-
get isSuccess() {
|
|
132
|
-
return this.errorCode === "SUCCESS" /* Success */;
|
|
133
|
-
}
|
|
134
|
-
static success() {
|
|
135
|
-
return new ToolResult("SUCCESS" /* Success */);
|
|
136
|
-
}
|
|
137
|
-
static error(errorCode, message, instructions) {
|
|
138
|
-
return new ToolResult(errorCode, message, [], instructions);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
// ../packager/packager-core/src/services/nuget-packager.ts
|
|
142
|
-
function escapeXml(str) {
|
|
143
|
-
if (str === null || str === undefined) {
|
|
144
|
-
return "";
|
|
145
|
-
}
|
|
146
|
-
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
147
|
-
}
|
|
148
|
-
function optionalElement(name, value) {
|
|
149
|
-
if (value === undefined || value === "")
|
|
150
|
-
return "";
|
|
151
|
-
return ` <${name}>${escapeXml(value)}</${name}>
|
|
152
|
-
`;
|
|
153
|
-
}
|
|
154
|
-
function generateDependenciesXml(dependencies) {
|
|
155
|
-
if (!dependencies || dependencies.length === 0)
|
|
156
|
-
return "";
|
|
157
|
-
const deps = dependencies.map((d) => ` <dependency id="${escapeXml(d.id)}" version="${escapeXml(d.version)}" />`).join(`
|
|
158
|
-
`);
|
|
159
|
-
return ` <dependencies>
|
|
160
|
-
${deps}
|
|
161
|
-
</dependencies>
|
|
162
|
-
`;
|
|
163
|
-
}
|
|
164
|
-
function generateRepositoryXml(packageInfo) {
|
|
165
|
-
if (!packageInfo.repositoryType || !packageInfo.repositoryUrl)
|
|
166
|
-
return "";
|
|
167
|
-
let repoXml = ` <repository type="${escapeXml(packageInfo.repositoryType)}" url="${escapeXml(packageInfo.repositoryUrl)}"`;
|
|
168
|
-
if (packageInfo.repositoryBranch) {
|
|
169
|
-
repoXml += ` branch="${escapeXml(packageInfo.repositoryBranch)}"`;
|
|
170
|
-
}
|
|
171
|
-
if (packageInfo.repositoryCommit) {
|
|
172
|
-
repoXml += ` commit="${escapeXml(packageInfo.repositoryCommit)}"`;
|
|
173
|
-
}
|
|
174
|
-
repoXml += ` />
|
|
175
|
-
`;
|
|
176
|
-
return repoXml;
|
|
177
|
-
}
|
|
178
|
-
function generateNuspecXml(packageInfo) {
|
|
179
|
-
const author = packageInfo.author?.trim() || "UiPath";
|
|
180
|
-
const description = packageInfo.description?.trim() || "Created by UiPath";
|
|
181
|
-
const title = packageInfo.title?.trim() || packageInfo.id;
|
|
182
|
-
const requireLicenseAcceptance = packageInfo.requireLicenseAcceptance === true ? "true" : "false";
|
|
183
|
-
const releaseNotes = packageInfo.releaseNotes ?? "";
|
|
184
|
-
const xml = `\uFEFF<?xml version="1.0" encoding="utf-8"?>
|
|
185
|
-
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
|
186
|
-
<metadata>
|
|
187
|
-
<id>${escapeXml(packageInfo.id)}</id>
|
|
188
|
-
<version>${escapeXml(packageInfo.version)}</version>
|
|
189
|
-
<title>${escapeXml(title)}</title>
|
|
190
|
-
<authors>${escapeXml(author)}</authors>
|
|
191
|
-
<requireLicenseAcceptance>${requireLicenseAcceptance}</requireLicenseAcceptance>
|
|
192
|
-
<description>${escapeXml(description)}</description>
|
|
193
|
-
<releaseNotes>${escapeXml(releaseNotes)}</releaseNotes>
|
|
194
|
-
${optionalElement("tags", packageInfo.tags)}${optionalElement("iconUrl", packageInfo.iconUrl)}${optionalElement("projectUrl", packageInfo.projectUrl)}${optionalElement("licenseUrl", packageInfo.licenseUrl)}${optionalElement("copyright", packageInfo.copyright)}${generateRepositoryXml(packageInfo)}${generateDependenciesXml(packageInfo.dependencies)} </metadata>
|
|
195
|
-
</package>
|
|
196
|
-
`;
|
|
197
|
-
return xml;
|
|
198
|
-
}
|
|
199
|
-
function generatePsmdcpXml(packageInfo) {
|
|
200
|
-
const author = packageInfo.author?.trim() || "UiPath";
|
|
201
|
-
const description = packageInfo.description?.trim() || "Created by UiPath";
|
|
202
|
-
return `<?xml version="1.0" encoding="utf-8"?>
|
|
203
|
-
<coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">
|
|
204
|
-
<dc:creator>${escapeXml(author)}</dc:creator>
|
|
205
|
-
<dc:description>${escapeXml(description)}</dc:description>
|
|
206
|
-
<dc:identifier>${escapeXml(packageInfo.id)}</dc:identifier>
|
|
207
|
-
<version>${escapeXml(packageInfo.version)}</version>
|
|
208
|
-
<keywords></keywords>
|
|
209
|
-
<lastModifiedBy>NuGet.Packaging, Version=6.12.1.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35;.NET 5.0</lastModifiedBy>
|
|
210
|
-
</coreProperties>`;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
class NugetPackager {
|
|
214
|
-
fileSystem;
|
|
215
|
-
constructor(fileSystem) {
|
|
216
|
-
this.fileSystem = fileSystem;
|
|
217
|
-
}
|
|
218
|
-
async packAsync(rootPath, packageInfo, outputPath) {
|
|
219
|
-
const normalizedOutputPath = Path.normalize(outputPath);
|
|
220
|
-
const nuspecXml = generateNuspecXml(packageInfo);
|
|
221
|
-
const nuspecFileName = `${packageInfo.id}.nuspec`;
|
|
222
|
-
const fileEntries = await Path.walkDirectory(this.fileSystem, rootPath);
|
|
223
|
-
const zipContents = {};
|
|
224
|
-
const encoder = new TextEncoder;
|
|
225
|
-
const psmdcpId = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0")).join("");
|
|
226
|
-
const psmdcpFileName = `${psmdcpId}.psmdcp`;
|
|
227
|
-
const psmdcpPath = `package/services/metadata/core-properties/${psmdcpFileName}`;
|
|
228
|
-
const contentTypesXml = `<?xml version="1.0" encoding="utf-8"?>
|
|
229
|
-
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
230
|
-
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
|
|
231
|
-
<Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
|
|
232
|
-
<Default Extension="uiproj" ContentType="application/octet" />
|
|
233
|
-
<Default Extension="json" ContentType="application/octet" />
|
|
234
|
-
<Default Extension="nuspec" ContentType="application/octet" />
|
|
235
|
-
</Types>`;
|
|
236
|
-
zipContents["[Content_Types].xml"] = encoder.encode(contentTypesXml);
|
|
237
|
-
const manifestRelId = `R${Date.now().toString(16).toUpperCase()}`;
|
|
238
|
-
const corePropsRelId = `R${(Date.now() + 1).toString(16).toUpperCase()}`;
|
|
239
|
-
const relsXml = `<?xml version="1.0" encoding="utf-8"?>
|
|
240
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
241
|
-
<Relationship Type="http://schemas.microsoft.com/packaging/2010/07/manifest" Target="/${nuspecFileName}" Id="${manifestRelId}" />
|
|
242
|
-
<Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="/${psmdcpPath}" Id="${corePropsRelId}" />
|
|
243
|
-
</Relationships>`;
|
|
244
|
-
zipContents["_rels/.rels"] = encoder.encode(relsXml);
|
|
245
|
-
zipContents[psmdcpPath] = encoder.encode(generatePsmdcpXml(packageInfo));
|
|
246
|
-
zipContents[nuspecFileName] = encoder.encode(nuspecXml);
|
|
247
|
-
for (const entry of fileEntries) {
|
|
248
|
-
const content = await this.fileSystem.readFile(entry.absolutePath);
|
|
249
|
-
if (content !== null) {
|
|
250
|
-
zipContents[entry.relativePath] = content;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
const zippedData = zipSync(zipContents);
|
|
254
|
-
await this.fileSystem.writeFile(normalizedOutputPath, zippedData);
|
|
255
|
-
return {
|
|
256
|
-
outputPath: normalizedOutputPath
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// ../packager/packager-core/src/services/project-tool.ts
|
|
262
|
-
class ProjectTool {
|
|
263
|
-
fileSystem;
|
|
264
|
-
logger;
|
|
265
|
-
static ProjectFileName = "project.uiproj";
|
|
266
|
-
constructor(fileSystem, logger) {
|
|
267
|
-
this.fileSystem = fileSystem;
|
|
268
|
-
this.logger = logger;
|
|
269
|
-
}
|
|
270
|
-
async restoreAsync(_options, _cancellationToken) {
|
|
271
|
-
this.logger.info("Restore operation is a noop");
|
|
272
|
-
return ToolResult.success();
|
|
273
|
-
}
|
|
274
|
-
async validateAsync(_options, _cancellationToken) {
|
|
275
|
-
this.logger.info("Validate operation is a noop");
|
|
276
|
-
return ToolResult.success();
|
|
277
|
-
}
|
|
278
|
-
async buildAsync(_options, _cancellationToken) {
|
|
279
|
-
this.logger.info("Build operation is a noop");
|
|
280
|
-
return ToolResult.success();
|
|
281
|
-
}
|
|
282
|
-
async packAsync(_options, _cancellationToken) {
|
|
283
|
-
this.logger.info("Pack operation is a noop");
|
|
284
|
-
return ToolResult.success();
|
|
285
|
-
}
|
|
286
|
-
async cleanupAsync(_options, _cancellationToken) {
|
|
287
|
-
this.logger.info("Cleanup operation is a noop");
|
|
288
|
-
return ToolResult.success();
|
|
289
|
-
}
|
|
290
|
-
async getUiProjectAsync(projectPath) {
|
|
291
|
-
const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
|
|
292
|
-
if (!await this.fileSystem.exists(filePath)) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
const raw = await this.fileSystem.readFile(filePath);
|
|
296
|
-
if (!raw) {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
const json = typeof raw === "string" ? raw : new TextDecoder("utf-8").decode(raw);
|
|
300
|
-
return JSON.parse(json);
|
|
301
|
-
}
|
|
302
|
-
async dispose() {}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// ../packager/packager-core/src/services/tools-factory-repository.ts
|
|
306
|
-
class ToolsFactoryRepository {
|
|
307
|
-
projectFactoryMap = new Map;
|
|
308
|
-
solutionFactory = null;
|
|
309
|
-
registerProjectToolFactory(factory) {
|
|
310
|
-
for (const type of factory.supportedTypes) {
|
|
311
|
-
const existing = this.projectFactoryMap.get(type);
|
|
312
|
-
if (existing) {
|
|
313
|
-
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
314
|
-
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
315
|
-
}
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
this.projectFactoryMap.set(type, factory);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
registerSolutionToolFactory(factory) {
|
|
322
|
-
this.solutionFactory = factory;
|
|
323
|
-
}
|
|
324
|
-
getSolutionToolFactory() {
|
|
325
|
-
if (!this.solutionFactory) {
|
|
326
|
-
throw new Error("No solution tool factory is registered");
|
|
327
|
-
}
|
|
328
|
-
return this.solutionFactory;
|
|
329
|
-
}
|
|
330
|
-
canHandleProject(projectType) {
|
|
331
|
-
return this.projectFactoryMap.has(projectType);
|
|
332
|
-
}
|
|
333
|
-
getProjectToolFactory(projectType) {
|
|
334
|
-
const factory = this.projectFactoryMap.get(projectType);
|
|
335
|
-
if (!factory) {
|
|
336
|
-
throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
|
|
337
|
-
}
|
|
338
|
-
return factory;
|
|
339
|
-
}
|
|
340
|
-
reset() {
|
|
341
|
-
this.projectFactoryMap.clear();
|
|
342
|
-
this.solutionFactory = null;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
346
|
-
var _global = globalThis;
|
|
347
|
-
if (!_global[REGISTRY_KEY]) {
|
|
348
|
-
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
|
|
349
|
-
}
|
|
350
|
-
var toolsFactoryRepository = _global[REGISTRY_KEY];
|
|
351
106
|
// ../packager/packager-core/src/i18n/types.ts
|
|
352
107
|
function isPluralForm(value) {
|
|
353
108
|
return typeof value === "object" && value !== null && "other" in value;
|
|
@@ -1171,6 +926,306 @@ I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
|
1171
926
|
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
1172
927
|
I18nManager.registerTranslations("zu", zu);
|
|
1173
928
|
I18nManager.setLocale("en");
|
|
1174
|
-
|
|
929
|
+
// ../packager/packager-core/src/models/nuget-constants.ts
|
|
930
|
+
var NugetConstants2 = {
|
|
931
|
+
OutputFolderName: "bundle",
|
|
932
|
+
ContentFolderName: "content",
|
|
933
|
+
OperateFileName: "operate.json",
|
|
934
|
+
EntryPointsFileName: "entry-points.json",
|
|
935
|
+
PackageDescriptorFileName: "package-descriptor.json",
|
|
936
|
+
BindingsV2FileName: "bindings_v2.json",
|
|
937
|
+
BindingsFileId: "bindings.json"
|
|
938
|
+
};
|
|
939
|
+
// ../packager/packager-core/src/models/project-type.ts
|
|
940
|
+
var ProjectTypes2;
|
|
941
|
+
((ProjectTypes) => {
|
|
942
|
+
ProjectTypes["Agent"] = "Agent";
|
|
943
|
+
ProjectTypes["Api"] = "Api";
|
|
944
|
+
ProjectTypes["BusinessRules"] = "BusinessRules";
|
|
945
|
+
ProjectTypes["Connector"] = "Connector";
|
|
946
|
+
ProjectTypes["CaseManagement"] = "CaseManagement";
|
|
947
|
+
ProjectTypes["Flow"] = "Flow";
|
|
948
|
+
ProjectTypes["Function"] = "Function";
|
|
949
|
+
ProjectTypes["ProcessOrchestration"] = "ProcessOrchestration";
|
|
950
|
+
ProjectTypes["Process"] = "Process";
|
|
951
|
+
ProjectTypes["Library"] = "Library";
|
|
952
|
+
ProjectTypes["WebApp"] = "WebApp";
|
|
953
|
+
ProjectTypes["Tests"] = "Tests";
|
|
954
|
+
ProjectTypes["AppV2"] = "AppV2";
|
|
955
|
+
})(ProjectTypes2 ||= {});
|
|
956
|
+
// ../packager/packager-core/src/models/tool-error-code.ts
|
|
957
|
+
var ToolErrorCodes2;
|
|
958
|
+
((ToolErrorCodes) => {
|
|
959
|
+
ToolErrorCodes["Success"] = "SUCCESS";
|
|
960
|
+
ToolErrorCodes["InternalError"] = "INTERNAL_ERROR";
|
|
961
|
+
ToolErrorCodes["InvalidProject"] = "INVALID_PROJECT";
|
|
962
|
+
ToolErrorCodes["DependencyInstallFailed"] = "DEPENDENCY_INSTALL_FAILED";
|
|
963
|
+
ToolErrorCodes["Canceled"] = "CANCELED";
|
|
964
|
+
})(ToolErrorCodes2 ||= {});
|
|
965
|
+
// ../packager/packager-core/src/models/tool-result.ts
|
|
966
|
+
class ToolResult2 {
|
|
967
|
+
errorCode;
|
|
968
|
+
message;
|
|
969
|
+
packages;
|
|
970
|
+
details;
|
|
971
|
+
instructions;
|
|
972
|
+
constructor(errorCode, message, packages = [], instructions) {
|
|
973
|
+
this.errorCode = errorCode;
|
|
974
|
+
this.message = message;
|
|
975
|
+
this.packages = packages;
|
|
976
|
+
this.instructions = instructions;
|
|
977
|
+
}
|
|
978
|
+
get isSuccess() {
|
|
979
|
+
return this.errorCode === "SUCCESS" /* Success */;
|
|
980
|
+
}
|
|
981
|
+
static success() {
|
|
982
|
+
return new ToolResult2("SUCCESS" /* Success */);
|
|
983
|
+
}
|
|
984
|
+
static error(errorCode, message, instructions) {
|
|
985
|
+
return new ToolResult2(errorCode, message, [], instructions);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
// ../packager/packager-core/src/services/nuget-packager.ts
|
|
989
|
+
function escapeXml(str) {
|
|
990
|
+
if (str === null || str === undefined) {
|
|
991
|
+
return "";
|
|
992
|
+
}
|
|
993
|
+
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
994
|
+
}
|
|
995
|
+
function optionalElement(name, value) {
|
|
996
|
+
if (value === undefined || value === "")
|
|
997
|
+
return "";
|
|
998
|
+
return ` <${name}>${escapeXml(value)}</${name}>
|
|
999
|
+
`;
|
|
1000
|
+
}
|
|
1001
|
+
function generateDependenciesXml(dependencies) {
|
|
1002
|
+
if (!dependencies || dependencies.length === 0)
|
|
1003
|
+
return "";
|
|
1004
|
+
const deps = dependencies.map((d) => ` <dependency id="${escapeXml(d.id)}" version="${escapeXml(d.version)}" />`).join(`
|
|
1005
|
+
`);
|
|
1006
|
+
return ` <dependencies>
|
|
1007
|
+
${deps}
|
|
1008
|
+
</dependencies>
|
|
1009
|
+
`;
|
|
1010
|
+
}
|
|
1011
|
+
function generateRepositoryXml(packageInfo) {
|
|
1012
|
+
if (!packageInfo.repositoryType || !packageInfo.repositoryUrl)
|
|
1013
|
+
return "";
|
|
1014
|
+
let repoXml = ` <repository type="${escapeXml(packageInfo.repositoryType)}" url="${escapeXml(packageInfo.repositoryUrl)}"`;
|
|
1015
|
+
if (packageInfo.repositoryBranch) {
|
|
1016
|
+
repoXml += ` branch="${escapeXml(packageInfo.repositoryBranch)}"`;
|
|
1017
|
+
}
|
|
1018
|
+
if (packageInfo.repositoryCommit) {
|
|
1019
|
+
repoXml += ` commit="${escapeXml(packageInfo.repositoryCommit)}"`;
|
|
1020
|
+
}
|
|
1021
|
+
repoXml += ` />
|
|
1022
|
+
`;
|
|
1023
|
+
return repoXml;
|
|
1024
|
+
}
|
|
1025
|
+
function generateNuspecXml(packageInfo) {
|
|
1026
|
+
const author = packageInfo.author?.trim() || "UiPath";
|
|
1027
|
+
const description = packageInfo.description?.trim() || "Created by UiPath";
|
|
1028
|
+
const title = packageInfo.title?.trim() || packageInfo.id;
|
|
1029
|
+
const requireLicenseAcceptance = packageInfo.requireLicenseAcceptance === true ? "true" : "false";
|
|
1030
|
+
const releaseNotes = packageInfo.releaseNotes ?? "";
|
|
1031
|
+
const xml = `\uFEFF<?xml version="1.0" encoding="utf-8"?>
|
|
1032
|
+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
|
1033
|
+
<metadata>
|
|
1034
|
+
<id>${escapeXml(packageInfo.id)}</id>
|
|
1035
|
+
<version>${escapeXml(packageInfo.version)}</version>
|
|
1036
|
+
<title>${escapeXml(title)}</title>
|
|
1037
|
+
<authors>${escapeXml(author)}</authors>
|
|
1038
|
+
<requireLicenseAcceptance>${requireLicenseAcceptance}</requireLicenseAcceptance>
|
|
1039
|
+
<description>${escapeXml(description)}</description>
|
|
1040
|
+
<releaseNotes>${escapeXml(releaseNotes)}</releaseNotes>
|
|
1041
|
+
${optionalElement("tags", packageInfo.tags)}${optionalElement("iconUrl", packageInfo.iconUrl)}${optionalElement("projectUrl", packageInfo.projectUrl)}${optionalElement("licenseUrl", packageInfo.licenseUrl)}${optionalElement("copyright", packageInfo.copyright)}${generateRepositoryXml(packageInfo)}${generateDependenciesXml(packageInfo.dependencies)} </metadata>
|
|
1042
|
+
</package>
|
|
1043
|
+
`;
|
|
1044
|
+
return xml;
|
|
1045
|
+
}
|
|
1046
|
+
function generatePsmdcpXml(packageInfo) {
|
|
1047
|
+
const author = packageInfo.author?.trim() || "UiPath";
|
|
1048
|
+
const description = packageInfo.description?.trim() || "Created by UiPath";
|
|
1049
|
+
return `<?xml version="1.0" encoding="utf-8"?>
|
|
1050
|
+
<coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">
|
|
1051
|
+
<dc:creator>${escapeXml(author)}</dc:creator>
|
|
1052
|
+
<dc:description>${escapeXml(description)}</dc:description>
|
|
1053
|
+
<dc:identifier>${escapeXml(packageInfo.id)}</dc:identifier>
|
|
1054
|
+
<version>${escapeXml(packageInfo.version)}</version>
|
|
1055
|
+
<keywords></keywords>
|
|
1056
|
+
<lastModifiedBy>NuGet.Packaging, Version=6.12.1.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35;.NET 5.0</lastModifiedBy>
|
|
1057
|
+
</coreProperties>`;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
class NugetPackager2 {
|
|
1061
|
+
fileSystem;
|
|
1062
|
+
constructor(fileSystem) {
|
|
1063
|
+
this.fileSystem = fileSystem;
|
|
1064
|
+
}
|
|
1065
|
+
async packAsync(rootPath, packageInfo, outputPath) {
|
|
1066
|
+
const normalizedOutputPath = Path2.normalize(outputPath);
|
|
1067
|
+
const nuspecXml = generateNuspecXml(packageInfo);
|
|
1068
|
+
const nuspecFileName = `${packageInfo.id}.nuspec`;
|
|
1069
|
+
const fileEntries = await Path2.walkDirectory(this.fileSystem, rootPath);
|
|
1070
|
+
const zipContents = {};
|
|
1071
|
+
const encoder = new TextEncoder;
|
|
1072
|
+
const psmdcpId = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0")).join("");
|
|
1073
|
+
const psmdcpFileName = `${psmdcpId}.psmdcp`;
|
|
1074
|
+
const psmdcpPath = `package/services/metadata/core-properties/${psmdcpFileName}`;
|
|
1075
|
+
const contentTypesXml = `<?xml version="1.0" encoding="utf-8"?>
|
|
1076
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
1077
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
|
|
1078
|
+
<Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
|
|
1079
|
+
<Default Extension="uiproj" ContentType="application/octet" />
|
|
1080
|
+
<Default Extension="json" ContentType="application/octet" />
|
|
1081
|
+
<Default Extension="nuspec" ContentType="application/octet" />
|
|
1082
|
+
</Types>`;
|
|
1083
|
+
zipContents["[Content_Types].xml"] = encoder.encode(contentTypesXml);
|
|
1084
|
+
const manifestRelId = `R${Date.now().toString(16).toUpperCase()}`;
|
|
1085
|
+
const corePropsRelId = `R${(Date.now() + 1).toString(16).toUpperCase()}`;
|
|
1086
|
+
const relsXml = `<?xml version="1.0" encoding="utf-8"?>
|
|
1087
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
1088
|
+
<Relationship Type="http://schemas.microsoft.com/packaging/2010/07/manifest" Target="/${nuspecFileName}" Id="${manifestRelId}" />
|
|
1089
|
+
<Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="/${psmdcpPath}" Id="${corePropsRelId}" />
|
|
1090
|
+
</Relationships>`;
|
|
1091
|
+
zipContents["_rels/.rels"] = encoder.encode(relsXml);
|
|
1092
|
+
zipContents[psmdcpPath] = encoder.encode(generatePsmdcpXml(packageInfo));
|
|
1093
|
+
zipContents[nuspecFileName] = encoder.encode(nuspecXml);
|
|
1094
|
+
for (const entry of fileEntries) {
|
|
1095
|
+
const content = await this.fileSystem.readFile(entry.absolutePath);
|
|
1096
|
+
if (content !== null) {
|
|
1097
|
+
zipContents[entry.relativePath] = content;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
const zippedData = zipSync(zipContents);
|
|
1101
|
+
await this.fileSystem.writeFile(normalizedOutputPath, zippedData);
|
|
1102
|
+
return {
|
|
1103
|
+
outputPath: normalizedOutputPath
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
// ../packager/packager-core/src/services/project-identity.ts
|
|
1108
|
+
var MAX_IDENTITY_FILE_BYTES = 1024 * 1024;
|
|
1109
|
+
async function readIdentityJson(fs, path) {
|
|
1110
|
+
const stat = await fs.stat(path);
|
|
1111
|
+
if (!stat)
|
|
1112
|
+
return;
|
|
1113
|
+
if (!stat.isFile() || stat.size > MAX_IDENTITY_FILE_BYTES)
|
|
1114
|
+
throw new Error("Invalid identity metadata");
|
|
1115
|
+
const text = await fs.readFile(path, "utf-8");
|
|
1116
|
+
if (text === null)
|
|
1117
|
+
return;
|
|
1118
|
+
const value = JSON.parse(text.replace(/^/, ""));
|
|
1119
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
1120
|
+
throw new Error("Invalid identity metadata");
|
|
1121
|
+
}
|
|
1122
|
+
return value;
|
|
1123
|
+
}
|
|
1124
|
+
function identityFieldValue(source, fields) {
|
|
1125
|
+
let value = source;
|
|
1126
|
+
for (const field of fields) {
|
|
1127
|
+
if (!value || typeof value !== "object")
|
|
1128
|
+
return;
|
|
1129
|
+
value = value[field];
|
|
1130
|
+
}
|
|
1131
|
+
if (value === undefined || value === null || value === "")
|
|
1132
|
+
return;
|
|
1133
|
+
if (typeof value !== "string" || !value.trim())
|
|
1134
|
+
throw new Error("Invalid project identity");
|
|
1135
|
+
return value;
|
|
1136
|
+
}
|
|
1137
|
+
async function readIdentityField2(fs, file, fields) {
|
|
1138
|
+
return identityFieldValue(await readIdentityJson(fs, file), fields);
|
|
1139
|
+
}
|
|
1140
|
+
// ../packager/packager-core/src/services/project-tool.ts
|
|
1141
|
+
class ProjectTool2 {
|
|
1142
|
+
fileSystem;
|
|
1143
|
+
logger;
|
|
1144
|
+
static ProjectFileName = "project.uiproj";
|
|
1145
|
+
constructor(fileSystem, logger) {
|
|
1146
|
+
this.fileSystem = fileSystem;
|
|
1147
|
+
this.logger = logger;
|
|
1148
|
+
}
|
|
1149
|
+
async restoreAsync(_options, _cancellationToken) {
|
|
1150
|
+
this.logger.info("Restore operation is a noop");
|
|
1151
|
+
return ToolResult2.success();
|
|
1152
|
+
}
|
|
1153
|
+
async validateAsync(_options, _cancellationToken) {
|
|
1154
|
+
this.logger.info("Validate operation is a noop");
|
|
1155
|
+
return ToolResult2.success();
|
|
1156
|
+
}
|
|
1157
|
+
async buildAsync(_options, _cancellationToken) {
|
|
1158
|
+
this.logger.info("Build operation is a noop");
|
|
1159
|
+
return ToolResult2.success();
|
|
1160
|
+
}
|
|
1161
|
+
async packAsync(_options, _cancellationToken) {
|
|
1162
|
+
this.logger.info("Pack operation is a noop");
|
|
1163
|
+
return ToolResult2.success();
|
|
1164
|
+
}
|
|
1165
|
+
async cleanupAsync(_options, _cancellationToken) {
|
|
1166
|
+
this.logger.info("Cleanup operation is a noop");
|
|
1167
|
+
return ToolResult2.success();
|
|
1168
|
+
}
|
|
1169
|
+
async getUiProjectAsync(projectPath) {
|
|
1170
|
+
const filePath = Path2.join(projectPath, ProjectTool2.ProjectFileName);
|
|
1171
|
+
if (!await this.fileSystem.exists(filePath)) {
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
const raw = await this.fileSystem.readFile(filePath);
|
|
1175
|
+
if (!raw) {
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
const json = typeof raw === "string" ? raw : new TextDecoder("utf-8").decode(raw);
|
|
1179
|
+
return JSON.parse(json);
|
|
1180
|
+
}
|
|
1181
|
+
async dispose() {}
|
|
1182
|
+
}
|
|
1183
|
+
// ../packager/packager-core/src/services/tools-factory-repository.ts
|
|
1184
|
+
class ToolsFactoryRepository {
|
|
1185
|
+
projectFactoryMap = new Map;
|
|
1186
|
+
solutionFactory = null;
|
|
1187
|
+
registerProjectToolFactory(factory) {
|
|
1188
|
+
for (const type of factory.supportedTypes) {
|
|
1189
|
+
const existing = this.projectFactoryMap.get(type);
|
|
1190
|
+
if (existing) {
|
|
1191
|
+
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
1192
|
+
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
1193
|
+
}
|
|
1194
|
+
continue;
|
|
1195
|
+
}
|
|
1196
|
+
this.projectFactoryMap.set(type, factory);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
registerSolutionToolFactory(factory) {
|
|
1200
|
+
this.solutionFactory = factory;
|
|
1201
|
+
}
|
|
1202
|
+
getSolutionToolFactory() {
|
|
1203
|
+
if (!this.solutionFactory) {
|
|
1204
|
+
throw new Error("No solution tool factory is registered");
|
|
1205
|
+
}
|
|
1206
|
+
return this.solutionFactory;
|
|
1207
|
+
}
|
|
1208
|
+
canHandleProject(projectType) {
|
|
1209
|
+
return this.projectFactoryMap.has(projectType);
|
|
1210
|
+
}
|
|
1211
|
+
getProjectToolFactory(projectType) {
|
|
1212
|
+
const factory = this.projectFactoryMap.get(projectType);
|
|
1213
|
+
if (!factory) {
|
|
1214
|
+
throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
|
|
1215
|
+
}
|
|
1216
|
+
return factory;
|
|
1217
|
+
}
|
|
1218
|
+
reset() {
|
|
1219
|
+
this.projectFactoryMap.clear();
|
|
1220
|
+
this.solutionFactory = null;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
1224
|
+
var _global = globalThis;
|
|
1225
|
+
if (!_global[REGISTRY_KEY]) {
|
|
1226
|
+
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
|
|
1227
|
+
}
|
|
1228
|
+
var toolsFactoryRepository2 = _global[REGISTRY_KEY];
|
|
1229
|
+
export { Path2, TemporaryStorageService2, NugetConstants2, ProjectTypes2, ToolErrorCodes2, ToolResult2, NugetPackager2, readIdentityField2, ProjectTool2, toolsFactoryRepository2 };
|
|
1175
1230
|
|
|
1176
|
-
//# debugId=
|
|
1231
|
+
//# debugId=66E22C76EDC9715F64756E2164756E21
|