@uipath/solutionpackager-tool-core 0.0.26 → 0.0.31

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.
Files changed (77) hide show
  1. package/dist/i18n/i18n-manager.d.ts +1 -0
  2. package/dist/i18n/locales/de.d.ts +3 -0
  3. package/dist/i18n/locales/en.d.ts +3 -0
  4. package/dist/i18n/locales/es-MX.d.ts +3 -0
  5. package/dist/i18n/locales/es.d.ts +3 -0
  6. package/dist/i18n/locales/fr.d.ts +3 -0
  7. package/dist/i18n/locales/ja.d.ts +3 -0
  8. package/dist/i18n/locales/ko.d.ts +3 -0
  9. package/dist/i18n/locales/pt-BR.d.ts +3 -0
  10. package/dist/i18n/locales/pt.d.ts +3 -0
  11. package/dist/i18n/locales/ro.d.ts +3 -0
  12. package/dist/i18n/locales/ru.d.ts +3 -0
  13. package/dist/i18n/locales/tr.d.ts +3 -0
  14. package/dist/i18n/locales/zh-CN.d.ts +3 -0
  15. package/dist/i18n/locales/zh-TW.d.ts +3 -0
  16. package/dist/i18n/locales/zu.d.ts +3 -0
  17. package/dist/index.js +1359 -5
  18. package/dist/models/connection-info.d.ts +4 -0
  19. package/dist/models/project-type.d.ts +1 -0
  20. package/dist/models/tool-error-code.d.ts +1 -0
  21. package/dist/services/project-operation-context.d.ts +4 -0
  22. package/dist/services/tools-factory-repository.d.ts +1 -1
  23. package/package.json +13 -7
  24. package/dist/filesystem/file-system.js +0 -0
  25. package/dist/filesystem/index.js +0 -3
  26. package/dist/filesystem/path.js +0 -47
  27. package/dist/filesystem/temporary-storage-service.js +0 -46
  28. package/dist/filesystem/zip-service.js +0 -41
  29. package/dist/i18n/i18n-manager.js +0 -104
  30. package/dist/i18n/index.js +0 -34
  31. package/dist/i18n/locales/de.js +0 -38
  32. package/dist/i18n/locales/en.js +0 -38
  33. package/dist/i18n/locales/es-MX.js +0 -38
  34. package/dist/i18n/locales/es.js +0 -38
  35. package/dist/i18n/locales/fr.js +0 -38
  36. package/dist/i18n/locales/ja.js +0 -38
  37. package/dist/i18n/locales/ko.js +0 -38
  38. package/dist/i18n/locales/pt-BR.js +0 -38
  39. package/dist/i18n/locales/pt.js +0 -38
  40. package/dist/i18n/locales/ro.js +0 -38
  41. package/dist/i18n/locales/ru.js +0 -38
  42. package/dist/i18n/locales/tr.js +0 -38
  43. package/dist/i18n/locales/zh-CN.js +0 -38
  44. package/dist/i18n/locales/zh-TW.js +0 -38
  45. package/dist/i18n/locales/zu.js +0 -38
  46. package/dist/i18n/translation-service.js +0 -29
  47. package/dist/i18n/types.js +0 -20
  48. package/dist/models/build-configuration.js +0 -6
  49. package/dist/models/connection-info.js +0 -9
  50. package/dist/models/index.js +0 -8
  51. package/dist/models/log-message.js +0 -48
  52. package/dist/models/nuget-constants.js +0 -10
  53. package/dist/models/nuget-feed-model.js +0 -0
  54. package/dist/models/nuget-package-info.js +0 -0
  55. package/dist/models/package-info.js +0 -0
  56. package/dist/models/project-options.js +0 -7
  57. package/dist/models/project-type.js +0 -16
  58. package/dist/models/solution-options.js +0 -0
  59. package/dist/models/target-frameworks.js +0 -6
  60. package/dist/models/tool-error-code.js +0 -7
  61. package/dist/models/tool-result.js +0 -21
  62. package/dist/models/uipath-project.js +0 -0
  63. package/dist/models/uipath-solution.js +0 -0
  64. package/dist/package-descriptor/entry-points-file-model.js +0 -0
  65. package/dist/package-descriptor/index.js +0 -1
  66. package/dist/package-descriptor/operate-file-model.js +0 -0
  67. package/dist/package-descriptor/package-descriptor-file-model.js +0 -0
  68. package/dist/package-descriptor/project-bindings-file-model.js +0 -7
  69. package/dist/services/index.js +0 -4
  70. package/dist/services/nuget-packager.js +0 -105
  71. package/dist/services/project-operation-context.js +0 -0
  72. package/dist/services/project-tool-factory.js +0 -0
  73. package/dist/services/project-tool.js +0 -27
  74. package/dist/services/solution-tool-factory.js +0 -0
  75. package/dist/services/solution-tool.js +0 -27
  76. package/dist/services/tool-logger.js +0 -0
  77. package/dist/services/tools-factory-repository.js +0 -34
@@ -1,105 +0,0 @@
1
- import { zipSync } from "fflate";
2
- import { Path } from "../filesystem/path.js";
3
- function escapeXml(str) {
4
- if (null == str) return "";
5
- return String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
6
- }
7
- function optionalElement(name, value) {
8
- if (void 0 === value || "" === value) return "";
9
- return ` <${name}>${escapeXml(value)}</${name}>\n`;
10
- }
11
- function generateDependenciesXml(dependencies) {
12
- if (!dependencies || 0 === dependencies.length) return "";
13
- const deps = dependencies.map((d)=>` <dependency id="${escapeXml(d.id)}" version="${escapeXml(d.version)}" />`).join("\n");
14
- return ` <dependencies>\n${deps}\n </dependencies>\n`;
15
- }
16
- function generateRepositoryXml(packageInfo) {
17
- if (!packageInfo.repositoryType || !packageInfo.repositoryUrl) return "";
18
- let repoXml = ` <repository type="${escapeXml(packageInfo.repositoryType)}" url="${escapeXml(packageInfo.repositoryUrl)}"`;
19
- if (packageInfo.repositoryBranch) repoXml += ` branch="${escapeXml(packageInfo.repositoryBranch)}"`;
20
- if (packageInfo.repositoryCommit) repoXml += ` commit="${escapeXml(packageInfo.repositoryCommit)}"`;
21
- repoXml += " />\n";
22
- return repoXml;
23
- }
24
- function generateNuspecXml(packageInfo) {
25
- const author = packageInfo.author?.trim() || "UiPath";
26
- const description = packageInfo.description?.trim() || "Created by UiPath";
27
- const title = packageInfo.title?.trim() || packageInfo.id;
28
- const requireLicenseAcceptance = true === packageInfo.requireLicenseAcceptance ? "true" : "false";
29
- const releaseNotes = packageInfo.releaseNotes ?? "";
30
- const xml = `\uFEFF<?xml version="1.0" encoding="utf-8"?>
31
- <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
32
- <metadata>
33
- <id>${escapeXml(packageInfo.id)}</id>
34
- <version>${escapeXml(packageInfo.version)}</version>
35
- <title>${escapeXml(title)}</title>
36
- <authors>${escapeXml(author)}</authors>
37
- <requireLicenseAcceptance>${requireLicenseAcceptance}</requireLicenseAcceptance>
38
- <description>${escapeXml(description)}</description>
39
- <releaseNotes>${escapeXml(releaseNotes)}</releaseNotes>
40
- ${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>
41
- </package>
42
- `;
43
- return xml;
44
- }
45
- function generatePsmdcpXml(packageInfo) {
46
- const author = packageInfo.author?.trim() || "UiPath";
47
- const description = packageInfo.description?.trim() || "Created by UiPath";
48
- return `<?xml version="1.0" encoding="utf-8"?>
49
- <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">
50
- <dc:creator>${escapeXml(author)}</dc:creator>
51
- <dc:description>${escapeXml(description)}</dc:description>
52
- <dc:identifier>${escapeXml(packageInfo.id)}</dc:identifier>
53
- <version>${escapeXml(packageInfo.version)}</version>
54
- <keywords></keywords>
55
- <lastModifiedBy>NuGet.Packaging, Version=6.12.1.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35;.NET 5.0</lastModifiedBy>
56
- </coreProperties>`;
57
- }
58
- class NugetPackager {
59
- fileSystem;
60
- constructor(fileSystem){
61
- this.fileSystem = fileSystem;
62
- }
63
- async packAsync(rootPath, packageInfo, outputPath) {
64
- const normalizedOutputPath = Path.normalize(outputPath);
65
- const nuspecXml = generateNuspecXml(packageInfo);
66
- const nuspecFileName = `${packageInfo.id}.nuspec`;
67
- const fileEntries = await Path.walkDirectory(this.fileSystem, rootPath);
68
- const zipContents = {};
69
- const encoder = new TextEncoder();
70
- const psmdcpId = Array.from({
71
- length: 4
72
- }, ()=>Math.floor(0x100000000 * Math.random()).toString(16).padStart(8, "0")).join("");
73
- const psmdcpFileName = `${psmdcpId}.psmdcp`;
74
- const psmdcpPath = `package/services/metadata/core-properties/${psmdcpFileName}`;
75
- const contentTypesXml = `<?xml version="1.0" encoding="utf-8"?>
76
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
77
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
78
- <Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
79
- <Default Extension="uiproj" ContentType="application/octet" />
80
- <Default Extension="json" ContentType="application/octet" />
81
- <Default Extension="nuspec" ContentType="application/octet" />
82
- </Types>`;
83
- zipContents["[Content_Types].xml"] = encoder.encode(contentTypesXml);
84
- const manifestRelId = `R${Date.now().toString(16).toUpperCase()}`;
85
- const corePropsRelId = `R${(Date.now() + 1).toString(16).toUpperCase()}`;
86
- const relsXml = `<?xml version="1.0" encoding="utf-8"?>
87
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
88
- <Relationship Type="http://schemas.microsoft.com/packaging/2010/07/manifest" Target="/${nuspecFileName}" Id="${manifestRelId}" />
89
- <Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="/${psmdcpPath}" Id="${corePropsRelId}" />
90
- </Relationships>`;
91
- zipContents["_rels/.rels"] = encoder.encode(relsXml);
92
- zipContents[psmdcpPath] = encoder.encode(generatePsmdcpXml(packageInfo));
93
- zipContents[nuspecFileName] = encoder.encode(nuspecXml);
94
- for (const entry of fileEntries){
95
- const content = await this.fileSystem.readFile(entry.absolutePath);
96
- if (null !== content) zipContents[entry.relativePath] = content;
97
- }
98
- const zippedData = zipSync(zipContents);
99
- await this.fileSystem.writeFile(normalizedOutputPath, zippedData);
100
- return {
101
- outputPath: normalizedOutputPath
102
- };
103
- }
104
- }
105
- export { NugetPackager };
File without changes
File without changes
@@ -1,27 +0,0 @@
1
- import { ToolResult } from "../models/tool-result.js";
2
- class ProjectTool {
3
- fileSystem;
4
- logger;
5
- constructor(fileSystem, logger){
6
- this.fileSystem = fileSystem;
7
- this.logger = logger;
8
- }
9
- async restoreAsync(_options, _cancellationToken) {
10
- this.logger.info("Restore operation is a noop");
11
- return ToolResult.success();
12
- }
13
- async validateAsync(_options, _cancellationToken) {
14
- this.logger.info("Validate operation is a noop");
15
- return ToolResult.success();
16
- }
17
- async buildAsync(_options, _cancellationToken) {
18
- this.logger.info("Build operation is a noop");
19
- return ToolResult.success();
20
- }
21
- async packAsync(_options, _cancellationToken) {
22
- this.logger.info("Pack operation is a noop");
23
- return ToolResult.success();
24
- }
25
- async dispose() {}
26
- }
27
- export { ProjectTool };
File without changes
@@ -1,27 +0,0 @@
1
- import { ToolResult } from "../models/tool-result.js";
2
- class SolutionTool {
3
- fileSystem;
4
- logger;
5
- constructor(fileSystem, logger){
6
- this.fileSystem = fileSystem;
7
- this.logger = logger;
8
- }
9
- async restoreAsync(_options, _cancellationToken) {
10
- this.logger.info("Restore operation is a noop");
11
- return ToolResult.success();
12
- }
13
- async validateAsync(_options, _cancellationToken) {
14
- this.logger.info("Validate operation is a noop");
15
- return ToolResult.success();
16
- }
17
- async buildAsync(_options, _cancellationToken) {
18
- this.logger.info("Build operation is a noop");
19
- return ToolResult.success();
20
- }
21
- async packAsync(_options, _cancellationToken) {
22
- this.logger.info("Pack operation is a noop");
23
- return ToolResult.success();
24
- }
25
- dispose() {}
26
- }
27
- export { SolutionTool };
File without changes
@@ -1,34 +0,0 @@
1
- class ToolsFactoryRepository {
2
- projectFactoryMap = new Map();
3
- solutionFactory = null;
4
- registerProjectToolFactory(factory) {
5
- for (const type of factory.supportedTypes){
6
- if (this.projectFactoryMap.has(type)) throw new Error(`A factory is already registered for project type '${type}'.`);
7
- this.projectFactoryMap.set(type, factory);
8
- }
9
- }
10
- registerSolutionToolFactory(factory) {
11
- this.solutionFactory = factory;
12
- }
13
- getSolutionToolFactory() {
14
- if (!this.solutionFactory) throw new Error("No solution tool factory is registered");
15
- return this.solutionFactory;
16
- }
17
- canHandleProject(projectType) {
18
- return this.projectFactoryMap.has(projectType);
19
- }
20
- getProjectToolFactory(projectType) {
21
- const factory = this.projectFactoryMap.get(projectType);
22
- if (!factory) throw new Error(`No tool factory found for project type '${projectType}'`);
23
- return factory;
24
- }
25
- reset() {
26
- this.projectFactoryMap.clear();
27
- this.solutionFactory = null;
28
- }
29
- }
30
- const REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
31
- const _global = globalThis;
32
- if (!_global[REGISTRY_KEY]) _global[REGISTRY_KEY] = new ToolsFactoryRepository();
33
- const toolsFactoryRepository = _global[REGISTRY_KEY];
34
- export { ToolsFactoryRepository, toolsFactoryRepository };