@uipath/agent-tool 1.203.0-preview.203 → 1.204.0-preview.206
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 +43 -5
- package/dist/{agent-tool-OK5DK57D-rjan4r3q.js → agent-tool-OK5DK57D-w2sn5ft0.js} +3 -2
- package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
- package/dist/executor-tool.js +7 -3
- package/dist/{index-s1mvhfbj.js → index-2gm7tb8q.js} +448 -980
- package/dist/index-q0fkqv6h.js +5339 -0
- package/dist/index-rgfg9t8f.js +663 -0
- package/dist/index.js +8 -4
- package/dist/memory-runtime-service-8b2j31ww.js +138 -0
- package/dist/packager-tool-22e4nhzm.js +1176 -0
- package/dist/packager-tool-af0drshm.js +988 -0
- package/dist/{packager-tool-byvnxap3.js → packager-tool-c6sb5jfp.js} +16 -1183
- package/dist/packager-tool-cxp7cwv2.js +5075 -0
- package/dist/packager-tool-kb4fk2pb.js +540 -0
- package/dist/packager-tool-nqcmgnpm.js +36786 -0
- package/dist/{packager-tool-tnz82jk0.js → packager-tool-ryge2f2x.js} +1826 -5310
- package/dist/packager-tool-xhvv7tkq.js +1376 -0
- package/dist/{packager-tool-cve3ftcb.js → packager-tool-ygxda1hn.js} +948 -2752
- package/dist/packager-tool.js +5 -5
- package/dist/tool.js +8 -4
- package/package.json +2 -2
- package/dist/packager-tool-y533fyyc.js +0 -1751
|
@@ -0,0 +1,1176 @@
|
|
|
1
|
+
import {
|
|
2
|
+
zipSync
|
|
3
|
+
} from "./packager-tool-b098y4a2.js";
|
|
4
|
+
|
|
5
|
+
// ../packager/packager-core/src/filesystem/path.ts
|
|
6
|
+
class Path {
|
|
7
|
+
static normalize(path) {
|
|
8
|
+
return path.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
9
|
+
}
|
|
10
|
+
static join(...segments) {
|
|
11
|
+
return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
|
|
12
|
+
}
|
|
13
|
+
static dirname(path) {
|
|
14
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
15
|
+
if (normalized === "")
|
|
16
|
+
return ".";
|
|
17
|
+
const lastSlash = normalized.lastIndexOf("/");
|
|
18
|
+
if (lastSlash === -1)
|
|
19
|
+
return ".";
|
|
20
|
+
if (lastSlash === 0)
|
|
21
|
+
return "/";
|
|
22
|
+
return normalized.substring(0, lastSlash);
|
|
23
|
+
}
|
|
24
|
+
static basename(path) {
|
|
25
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
26
|
+
if (normalized === "")
|
|
27
|
+
return "";
|
|
28
|
+
const lastSlash = normalized.lastIndexOf("/");
|
|
29
|
+
return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
|
|
30
|
+
}
|
|
31
|
+
static extname(path) {
|
|
32
|
+
const base = Path.basename(path);
|
|
33
|
+
const lastDot = base.lastIndexOf(".");
|
|
34
|
+
if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
37
|
+
return base.substring(lastDot);
|
|
38
|
+
}
|
|
39
|
+
static async walkDirectory(fs, rootPath, currentRelativePath = "") {
|
|
40
|
+
const entries = [];
|
|
41
|
+
const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
|
|
42
|
+
const items = await fs.readdir(absolutePath);
|
|
43
|
+
for (const item of items) {
|
|
44
|
+
const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
|
|
45
|
+
const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
|
|
46
|
+
const stat = await fs.stat(itemAbsolutePath);
|
|
47
|
+
if (stat?.isDirectory()) {
|
|
48
|
+
const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
|
|
49
|
+
entries.push(...subEntries);
|
|
50
|
+
} else if (stat?.isFile()) {
|
|
51
|
+
entries.push({
|
|
52
|
+
relativePath: Path.normalize(itemRelativePath),
|
|
53
|
+
absolutePath: Path.normalize(itemAbsolutePath)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return entries;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ../packager/packager-core/src/filesystem/temporary-storage-service.ts
|
|
62
|
+
class TemporaryStorageService {
|
|
63
|
+
fileSystem;
|
|
64
|
+
_tempFolderPath = null;
|
|
65
|
+
constructor(fileSystem) {
|
|
66
|
+
this.fileSystem = fileSystem;
|
|
67
|
+
}
|
|
68
|
+
async getTempFolderPath() {
|
|
69
|
+
if (!this._tempFolderPath) {
|
|
70
|
+
const systemTempDir = await this.fileSystem.getTempDir();
|
|
71
|
+
const uniqueFolderName = this.generateUniqueFolderName();
|
|
72
|
+
this._tempFolderPath = Path.join(systemTempDir, uniqueFolderName);
|
|
73
|
+
await this.fileSystem.mkdir(this._tempFolderPath);
|
|
74
|
+
}
|
|
75
|
+
return this._tempFolderPath;
|
|
76
|
+
}
|
|
77
|
+
generateUniqueFolderName() {
|
|
78
|
+
const timestamp = Date.now();
|
|
79
|
+
const random = Math.random().toString(36).substring(2, 10);
|
|
80
|
+
return `tool-temp-${timestamp}-${random}`;
|
|
81
|
+
}
|
|
82
|
+
async getTempSubfolderPathAsync(subfolder) {
|
|
83
|
+
const tempFolderPath = await this.getTempFolderPath();
|
|
84
|
+
const inputPath = Path.join(tempFolderPath, subfolder);
|
|
85
|
+
await this.fileSystem.mkdir(inputPath);
|
|
86
|
+
return inputPath;
|
|
87
|
+
}
|
|
88
|
+
async cleanup() {
|
|
89
|
+
try {
|
|
90
|
+
if (!this._tempFolderPath) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const stats = await this.fileSystem.stat(this._tempFolderPath);
|
|
95
|
+
if (!stats) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
} catch {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const _pathToCleanup = this._tempFolderPath;
|
|
102
|
+
await this.fileSystem.rm(this._tempFolderPath);
|
|
103
|
+
this._tempFolderPath = null;
|
|
104
|
+
} catch {}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
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
|
+
// ../packager/packager-core/src/i18n/types.ts
|
|
352
|
+
function isPluralForm(value) {
|
|
353
|
+
return typeof value === "object" && value !== null && "other" in value;
|
|
354
|
+
}
|
|
355
|
+
function selectPluralForm(forms, count) {
|
|
356
|
+
if (count === 0 && forms.zero !== undefined) {
|
|
357
|
+
return forms.zero;
|
|
358
|
+
}
|
|
359
|
+
if (count === 1 && forms.one !== undefined) {
|
|
360
|
+
return forms.one;
|
|
361
|
+
}
|
|
362
|
+
if (count === 2 && forms.two !== undefined) {
|
|
363
|
+
return forms.two;
|
|
364
|
+
}
|
|
365
|
+
if (forms.few !== undefined) {
|
|
366
|
+
const mod10 = count % 10;
|
|
367
|
+
const mod100 = count % 100;
|
|
368
|
+
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
|
|
369
|
+
return forms.few;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (forms.many !== undefined) {
|
|
373
|
+
const mod10 = count % 10;
|
|
374
|
+
const mod100 = count % 100;
|
|
375
|
+
if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
|
|
376
|
+
return forms.many;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return forms.other;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// ../packager/packager-core/src/i18n/i18n-manager.ts
|
|
383
|
+
class I18nManager {
|
|
384
|
+
static translations = {};
|
|
385
|
+
static currentLocale = "en";
|
|
386
|
+
static fallbackLocale = "en";
|
|
387
|
+
static registerTranslations(locale, catalog) {
|
|
388
|
+
if (!I18nManager.translations[locale]) {
|
|
389
|
+
I18nManager.translations[locale] = {};
|
|
390
|
+
}
|
|
391
|
+
I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
|
|
392
|
+
}
|
|
393
|
+
static setLocale(locale) {
|
|
394
|
+
const normalized = I18nManager.normalizeLocale(locale);
|
|
395
|
+
if (I18nManager.translations[normalized]) {
|
|
396
|
+
I18nManager.currentLocale = normalized;
|
|
397
|
+
return normalized;
|
|
398
|
+
}
|
|
399
|
+
const baseLocale = normalized.split("-")[0];
|
|
400
|
+
if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
|
|
401
|
+
I18nManager.currentLocale = baseLocale;
|
|
402
|
+
return baseLocale;
|
|
403
|
+
}
|
|
404
|
+
return I18nManager.currentLocale;
|
|
405
|
+
}
|
|
406
|
+
static getLocale() {
|
|
407
|
+
return I18nManager.currentLocale;
|
|
408
|
+
}
|
|
409
|
+
static setFallbackLocale(locale) {
|
|
410
|
+
I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
|
|
411
|
+
}
|
|
412
|
+
static t(key, params, locale) {
|
|
413
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
414
|
+
let value = I18nManager.getTranslationValue(key, targetLocale);
|
|
415
|
+
if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
|
|
416
|
+
value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
|
|
417
|
+
}
|
|
418
|
+
if (value === undefined) {
|
|
419
|
+
return key;
|
|
420
|
+
}
|
|
421
|
+
if (isPluralForm(value) && params && "count" in params) {
|
|
422
|
+
const count = typeof params.count === "number" ? params.count : Number(params.count);
|
|
423
|
+
value = selectPluralForm(value, count);
|
|
424
|
+
} else if (isPluralForm(value)) {
|
|
425
|
+
value = value.other;
|
|
426
|
+
}
|
|
427
|
+
if (typeof value !== "string") {
|
|
428
|
+
return key;
|
|
429
|
+
}
|
|
430
|
+
return params ? I18nManager.interpolate(value, params) : value;
|
|
431
|
+
}
|
|
432
|
+
static has(key, locale) {
|
|
433
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
434
|
+
const value = I18nManager.getTranslationValue(key, targetLocale);
|
|
435
|
+
if (value !== undefined) {
|
|
436
|
+
return true;
|
|
437
|
+
}
|
|
438
|
+
if (targetLocale !== I18nManager.fallbackLocale) {
|
|
439
|
+
return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
|
|
440
|
+
}
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
static getAvailableLocales() {
|
|
444
|
+
return Object.keys(I18nManager.translations);
|
|
445
|
+
}
|
|
446
|
+
static clearTranslations() {
|
|
447
|
+
I18nManager.translations = {};
|
|
448
|
+
I18nManager.currentLocale = "en";
|
|
449
|
+
}
|
|
450
|
+
static getTranslationValue(key, locale) {
|
|
451
|
+
const catalog = I18nManager.translations[locale];
|
|
452
|
+
if (!catalog) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const keys = key.split(".");
|
|
456
|
+
let value = catalog;
|
|
457
|
+
for (const k of keys) {
|
|
458
|
+
if (value && typeof value === "object" && k in value) {
|
|
459
|
+
value = value[k];
|
|
460
|
+
} else {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return value;
|
|
465
|
+
}
|
|
466
|
+
static interpolate(template, params) {
|
|
467
|
+
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
468
|
+
const value = params[key];
|
|
469
|
+
return value !== undefined ? String(value) : `{${key}}`;
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
static normalizeLocale(locale) {
|
|
473
|
+
const normalized = locale.toLowerCase().replace(/_/g, "-");
|
|
474
|
+
const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
|
|
475
|
+
if (specialLocales.includes(normalized)) {
|
|
476
|
+
return normalized;
|
|
477
|
+
}
|
|
478
|
+
return normalized.split("-")[0];
|
|
479
|
+
}
|
|
480
|
+
static deepMerge(target, source) {
|
|
481
|
+
const result = { ...target };
|
|
482
|
+
for (const key of Object.keys(source)) {
|
|
483
|
+
const sourceValue = source[key];
|
|
484
|
+
const targetValue = result[key];
|
|
485
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
486
|
+
result[key] = I18nManager.deepMerge(targetValue, sourceValue);
|
|
487
|
+
} else {
|
|
488
|
+
result[key] = sourceValue;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return result;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// ../packager/packager-core/src/i18n/locales/de.ts
|
|
496
|
+
var de = {
|
|
497
|
+
toolCore: {
|
|
498
|
+
errors: {
|
|
499
|
+
internal: "Internal error: {message}",
|
|
500
|
+
fileNotFound: "File not found: {path}",
|
|
501
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
502
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
503
|
+
directoryNotFound: "Directory not found: {path}",
|
|
504
|
+
invalidPath: "{path} is not a valid path",
|
|
505
|
+
operationCanceled: "Operation was canceled",
|
|
506
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
507
|
+
},
|
|
508
|
+
progress: {
|
|
509
|
+
copying: "Copying files...",
|
|
510
|
+
building: "Building project...",
|
|
511
|
+
packaging: "Creating package...",
|
|
512
|
+
validating: "Validating...",
|
|
513
|
+
analyzing: "Analyzing...",
|
|
514
|
+
restoring: "Restoring dependencies..."
|
|
515
|
+
},
|
|
516
|
+
validation: {
|
|
517
|
+
requiredField: "{field} is required",
|
|
518
|
+
invalidValue: "Invalid value for {field}",
|
|
519
|
+
pathNotFound: "Path not found: {path}",
|
|
520
|
+
fileRequired: "File is required: {path}",
|
|
521
|
+
directoryRequired: "Directory is required: {path}"
|
|
522
|
+
},
|
|
523
|
+
warnings: {
|
|
524
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
525
|
+
},
|
|
526
|
+
info: {
|
|
527
|
+
operationComplete: "Operation completed successfully",
|
|
528
|
+
filesProcessed: {
|
|
529
|
+
zero: "No files processed",
|
|
530
|
+
one: "{count} file processed",
|
|
531
|
+
other: "{count} files processed"
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
// ../packager/packager-core/src/i18n/locales/en.ts
|
|
538
|
+
var en = {
|
|
539
|
+
toolCore: {
|
|
540
|
+
errors: {
|
|
541
|
+
internal: "Internal error: {message}",
|
|
542
|
+
fileNotFound: "File not found: {path}",
|
|
543
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
544
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
545
|
+
directoryNotFound: "Directory not found: {path}",
|
|
546
|
+
invalidPath: "{path} is not a valid path",
|
|
547
|
+
operationCanceled: "Operation was canceled",
|
|
548
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
549
|
+
},
|
|
550
|
+
progress: {
|
|
551
|
+
copying: "Copying files...",
|
|
552
|
+
building: "Building project...",
|
|
553
|
+
packaging: "Creating package...",
|
|
554
|
+
validating: "Validating...",
|
|
555
|
+
analyzing: "Analyzing...",
|
|
556
|
+
restoring: "Restoring dependencies..."
|
|
557
|
+
},
|
|
558
|
+
validation: {
|
|
559
|
+
requiredField: "{field} is required",
|
|
560
|
+
invalidValue: "Invalid value for {field}",
|
|
561
|
+
pathNotFound: "Path not found: {path}",
|
|
562
|
+
fileRequired: "File is required: {path}",
|
|
563
|
+
directoryRequired: "Directory is required: {path}"
|
|
564
|
+
},
|
|
565
|
+
warnings: {
|
|
566
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
567
|
+
},
|
|
568
|
+
info: {
|
|
569
|
+
operationComplete: "Operation completed successfully",
|
|
570
|
+
filesProcessed: {
|
|
571
|
+
zero: "No files processed",
|
|
572
|
+
one: "{count} file processed",
|
|
573
|
+
other: "{count} files processed"
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
// ../packager/packager-core/src/i18n/locales/es.ts
|
|
580
|
+
var es = {
|
|
581
|
+
toolCore: {
|
|
582
|
+
errors: {
|
|
583
|
+
internal: "Internal error: {message}",
|
|
584
|
+
fileNotFound: "File not found: {path}",
|
|
585
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
586
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
587
|
+
directoryNotFound: "Directory not found: {path}",
|
|
588
|
+
invalidPath: "{path} is not a valid path",
|
|
589
|
+
operationCanceled: "Operation was canceled",
|
|
590
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
591
|
+
},
|
|
592
|
+
progress: {
|
|
593
|
+
copying: "Copying files...",
|
|
594
|
+
building: "Building project...",
|
|
595
|
+
packaging: "Creating package...",
|
|
596
|
+
validating: "Validating...",
|
|
597
|
+
analyzing: "Analyzing...",
|
|
598
|
+
restoring: "Restoring dependencies..."
|
|
599
|
+
},
|
|
600
|
+
validation: {
|
|
601
|
+
requiredField: "{field} is required",
|
|
602
|
+
invalidValue: "Invalid value for {field}",
|
|
603
|
+
pathNotFound: "Path not found: {path}",
|
|
604
|
+
fileRequired: "File is required: {path}",
|
|
605
|
+
directoryRequired: "Directory is required: {path}"
|
|
606
|
+
},
|
|
607
|
+
warnings: {
|
|
608
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
609
|
+
},
|
|
610
|
+
info: {
|
|
611
|
+
operationComplete: "Operation completed successfully",
|
|
612
|
+
filesProcessed: {
|
|
613
|
+
zero: "No files processed",
|
|
614
|
+
one: "{count} file processed",
|
|
615
|
+
other: "{count} files processed"
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
// ../packager/packager-core/src/i18n/locales/es-MX.ts
|
|
622
|
+
var es_MX = {
|
|
623
|
+
toolCore: {
|
|
624
|
+
errors: {
|
|
625
|
+
internal: "Internal error: {message}",
|
|
626
|
+
fileNotFound: "File not found: {path}",
|
|
627
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
628
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
629
|
+
directoryNotFound: "Directory not found: {path}",
|
|
630
|
+
invalidPath: "{path} is not a valid path",
|
|
631
|
+
operationCanceled: "Operation was canceled",
|
|
632
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
633
|
+
},
|
|
634
|
+
progress: {
|
|
635
|
+
copying: "Copying files...",
|
|
636
|
+
building: "Building project...",
|
|
637
|
+
packaging: "Creating package...",
|
|
638
|
+
validating: "Validating...",
|
|
639
|
+
analyzing: "Analyzing...",
|
|
640
|
+
restoring: "Restoring dependencies..."
|
|
641
|
+
},
|
|
642
|
+
validation: {
|
|
643
|
+
requiredField: "{field} is required",
|
|
644
|
+
invalidValue: "Invalid value for {field}",
|
|
645
|
+
pathNotFound: "Path not found: {path}",
|
|
646
|
+
fileRequired: "File is required: {path}",
|
|
647
|
+
directoryRequired: "Directory is required: {path}"
|
|
648
|
+
},
|
|
649
|
+
warnings: {
|
|
650
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
651
|
+
},
|
|
652
|
+
info: {
|
|
653
|
+
operationComplete: "Operation completed successfully",
|
|
654
|
+
filesProcessed: {
|
|
655
|
+
zero: "No files processed",
|
|
656
|
+
one: "{count} file processed",
|
|
657
|
+
other: "{count} files processed"
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
// ../packager/packager-core/src/i18n/locales/fr.ts
|
|
664
|
+
var fr = {
|
|
665
|
+
toolCore: {
|
|
666
|
+
errors: {
|
|
667
|
+
internal: "Internal error: {message}",
|
|
668
|
+
fileNotFound: "File not found: {path}",
|
|
669
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
670
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
671
|
+
directoryNotFound: "Directory not found: {path}",
|
|
672
|
+
invalidPath: "{path} is not a valid path",
|
|
673
|
+
operationCanceled: "Operation was canceled",
|
|
674
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
675
|
+
},
|
|
676
|
+
progress: {
|
|
677
|
+
copying: "Copying files...",
|
|
678
|
+
building: "Building project...",
|
|
679
|
+
packaging: "Creating package...",
|
|
680
|
+
validating: "Validating...",
|
|
681
|
+
analyzing: "Analyzing...",
|
|
682
|
+
restoring: "Restoring dependencies..."
|
|
683
|
+
},
|
|
684
|
+
validation: {
|
|
685
|
+
requiredField: "{field} is required",
|
|
686
|
+
invalidValue: "Invalid value for {field}",
|
|
687
|
+
pathNotFound: "Path not found: {path}",
|
|
688
|
+
fileRequired: "File is required: {path}",
|
|
689
|
+
directoryRequired: "Directory is required: {path}"
|
|
690
|
+
},
|
|
691
|
+
warnings: {
|
|
692
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
693
|
+
},
|
|
694
|
+
info: {
|
|
695
|
+
operationComplete: "Operation completed successfully",
|
|
696
|
+
filesProcessed: {
|
|
697
|
+
zero: "No files processed",
|
|
698
|
+
one: "{count} file processed",
|
|
699
|
+
other: "{count} files processed"
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
// ../packager/packager-core/src/i18n/locales/ja.ts
|
|
706
|
+
var ja = {
|
|
707
|
+
toolCore: {
|
|
708
|
+
errors: {
|
|
709
|
+
internal: "Internal error: {message}",
|
|
710
|
+
fileNotFound: "File not found: {path}",
|
|
711
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
712
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
713
|
+
directoryNotFound: "Directory not found: {path}",
|
|
714
|
+
invalidPath: "{path} is not a valid path",
|
|
715
|
+
operationCanceled: "Operation was canceled",
|
|
716
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
717
|
+
},
|
|
718
|
+
progress: {
|
|
719
|
+
copying: "Copying files...",
|
|
720
|
+
building: "Building project...",
|
|
721
|
+
packaging: "Creating package...",
|
|
722
|
+
validating: "Validating...",
|
|
723
|
+
analyzing: "Analyzing...",
|
|
724
|
+
restoring: "Restoring dependencies..."
|
|
725
|
+
},
|
|
726
|
+
validation: {
|
|
727
|
+
requiredField: "{field} is required",
|
|
728
|
+
invalidValue: "Invalid value for {field}",
|
|
729
|
+
pathNotFound: "Path not found: {path}",
|
|
730
|
+
fileRequired: "File is required: {path}",
|
|
731
|
+
directoryRequired: "Directory is required: {path}"
|
|
732
|
+
},
|
|
733
|
+
warnings: {
|
|
734
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
735
|
+
},
|
|
736
|
+
info: {
|
|
737
|
+
operationComplete: "Operation completed successfully",
|
|
738
|
+
filesProcessed: {
|
|
739
|
+
zero: "No files processed",
|
|
740
|
+
one: "{count} file processed",
|
|
741
|
+
other: "{count} files processed"
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
// ../packager/packager-core/src/i18n/locales/ko.ts
|
|
748
|
+
var ko = {
|
|
749
|
+
toolCore: {
|
|
750
|
+
errors: {
|
|
751
|
+
internal: "Internal error: {message}",
|
|
752
|
+
fileNotFound: "File not found: {path}",
|
|
753
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
754
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
755
|
+
directoryNotFound: "Directory not found: {path}",
|
|
756
|
+
invalidPath: "{path} is not a valid path",
|
|
757
|
+
operationCanceled: "Operation was canceled",
|
|
758
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
759
|
+
},
|
|
760
|
+
progress: {
|
|
761
|
+
copying: "Copying files...",
|
|
762
|
+
building: "Building project...",
|
|
763
|
+
packaging: "Creating package...",
|
|
764
|
+
validating: "Validating...",
|
|
765
|
+
analyzing: "Analyzing...",
|
|
766
|
+
restoring: "Restoring dependencies..."
|
|
767
|
+
},
|
|
768
|
+
validation: {
|
|
769
|
+
requiredField: "{field} is required",
|
|
770
|
+
invalidValue: "Invalid value for {field}",
|
|
771
|
+
pathNotFound: "Path not found: {path}",
|
|
772
|
+
fileRequired: "File is required: {path}",
|
|
773
|
+
directoryRequired: "Directory is required: {path}"
|
|
774
|
+
},
|
|
775
|
+
warnings: {
|
|
776
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
777
|
+
},
|
|
778
|
+
info: {
|
|
779
|
+
operationComplete: "Operation completed successfully",
|
|
780
|
+
filesProcessed: {
|
|
781
|
+
zero: "No files processed",
|
|
782
|
+
one: "{count} file processed",
|
|
783
|
+
other: "{count} files processed"
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
// ../packager/packager-core/src/i18n/locales/pt.ts
|
|
790
|
+
var pt = {
|
|
791
|
+
toolCore: {
|
|
792
|
+
errors: {
|
|
793
|
+
internal: "Internal error: {message}",
|
|
794
|
+
fileNotFound: "File not found: {path}",
|
|
795
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
796
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
797
|
+
directoryNotFound: "Directory not found: {path}",
|
|
798
|
+
invalidPath: "{path} is not a valid path",
|
|
799
|
+
operationCanceled: "Operation was canceled",
|
|
800
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
801
|
+
},
|
|
802
|
+
progress: {
|
|
803
|
+
copying: "Copying files...",
|
|
804
|
+
building: "Building project...",
|
|
805
|
+
packaging: "Creating package...",
|
|
806
|
+
validating: "Validating...",
|
|
807
|
+
analyzing: "Analyzing...",
|
|
808
|
+
restoring: "Restoring dependencies..."
|
|
809
|
+
},
|
|
810
|
+
validation: {
|
|
811
|
+
requiredField: "{field} is required",
|
|
812
|
+
invalidValue: "Invalid value for {field}",
|
|
813
|
+
pathNotFound: "Path not found: {path}",
|
|
814
|
+
fileRequired: "File is required: {path}",
|
|
815
|
+
directoryRequired: "Directory is required: {path}"
|
|
816
|
+
},
|
|
817
|
+
warnings: {
|
|
818
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
819
|
+
},
|
|
820
|
+
info: {
|
|
821
|
+
operationComplete: "Operation completed successfully",
|
|
822
|
+
filesProcessed: {
|
|
823
|
+
zero: "No files processed",
|
|
824
|
+
one: "{count} file processed",
|
|
825
|
+
other: "{count} files processed"
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
// ../packager/packager-core/src/i18n/locales/pt-BR.ts
|
|
832
|
+
var pt_BR = {
|
|
833
|
+
toolCore: {
|
|
834
|
+
errors: {
|
|
835
|
+
internal: "Internal error: {message}",
|
|
836
|
+
fileNotFound: "File not found: {path}",
|
|
837
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
838
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
839
|
+
directoryNotFound: "Directory not found: {path}",
|
|
840
|
+
invalidPath: "{path} is not a valid path",
|
|
841
|
+
operationCanceled: "Operation was canceled",
|
|
842
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
843
|
+
},
|
|
844
|
+
progress: {
|
|
845
|
+
copying: "Copying files...",
|
|
846
|
+
building: "Building project...",
|
|
847
|
+
packaging: "Creating package...",
|
|
848
|
+
validating: "Validating...",
|
|
849
|
+
analyzing: "Analyzing...",
|
|
850
|
+
restoring: "Restoring dependencies..."
|
|
851
|
+
},
|
|
852
|
+
validation: {
|
|
853
|
+
requiredField: "{field} is required",
|
|
854
|
+
invalidValue: "Invalid value for {field}",
|
|
855
|
+
pathNotFound: "Path not found: {path}",
|
|
856
|
+
fileRequired: "File is required: {path}",
|
|
857
|
+
directoryRequired: "Directory is required: {path}"
|
|
858
|
+
},
|
|
859
|
+
warnings: {
|
|
860
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
861
|
+
},
|
|
862
|
+
info: {
|
|
863
|
+
operationComplete: "Operation completed successfully",
|
|
864
|
+
filesProcessed: {
|
|
865
|
+
zero: "No files processed",
|
|
866
|
+
one: "{count} file processed",
|
|
867
|
+
other: "{count} files processed"
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
// ../packager/packager-core/src/i18n/locales/ro.ts
|
|
874
|
+
var ro = {
|
|
875
|
+
toolCore: {
|
|
876
|
+
errors: {
|
|
877
|
+
internal: "Internal error: {message}",
|
|
878
|
+
fileNotFound: "File not found: {path}",
|
|
879
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
880
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
881
|
+
directoryNotFound: "Directory not found: {path}",
|
|
882
|
+
invalidPath: "{path} is not a valid path",
|
|
883
|
+
operationCanceled: "Operation was canceled",
|
|
884
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
885
|
+
},
|
|
886
|
+
progress: {
|
|
887
|
+
copying: "Copying files...",
|
|
888
|
+
building: "Building project...",
|
|
889
|
+
packaging: "Creating package...",
|
|
890
|
+
validating: "Validating...",
|
|
891
|
+
analyzing: "Analyzing...",
|
|
892
|
+
restoring: "Restoring dependencies..."
|
|
893
|
+
},
|
|
894
|
+
validation: {
|
|
895
|
+
requiredField: "{field} is required",
|
|
896
|
+
invalidValue: "Invalid value for {field}",
|
|
897
|
+
pathNotFound: "Path not found: {path}",
|
|
898
|
+
fileRequired: "File is required: {path}",
|
|
899
|
+
directoryRequired: "Directory is required: {path}"
|
|
900
|
+
},
|
|
901
|
+
warnings: {
|
|
902
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
903
|
+
},
|
|
904
|
+
info: {
|
|
905
|
+
operationComplete: "Operation completed successfully",
|
|
906
|
+
filesProcessed: {
|
|
907
|
+
zero: "No files processed",
|
|
908
|
+
one: "{count} file processed",
|
|
909
|
+
other: "{count} files processed"
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
// ../packager/packager-core/src/i18n/locales/ru.ts
|
|
916
|
+
var ru = {
|
|
917
|
+
toolCore: {
|
|
918
|
+
errors: {
|
|
919
|
+
internal: "Internal error: {message}",
|
|
920
|
+
fileNotFound: "File not found: {path}",
|
|
921
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
922
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
923
|
+
directoryNotFound: "Directory not found: {path}",
|
|
924
|
+
invalidPath: "{path} is not a valid path",
|
|
925
|
+
operationCanceled: "Operation was canceled",
|
|
926
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
927
|
+
},
|
|
928
|
+
progress: {
|
|
929
|
+
copying: "Copying files...",
|
|
930
|
+
building: "Building project...",
|
|
931
|
+
packaging: "Creating package...",
|
|
932
|
+
validating: "Validating...",
|
|
933
|
+
analyzing: "Analyzing...",
|
|
934
|
+
restoring: "Restoring dependencies..."
|
|
935
|
+
},
|
|
936
|
+
validation: {
|
|
937
|
+
requiredField: "{field} is required",
|
|
938
|
+
invalidValue: "Invalid value for {field}",
|
|
939
|
+
pathNotFound: "Path not found: {path}",
|
|
940
|
+
fileRequired: "File is required: {path}",
|
|
941
|
+
directoryRequired: "Directory is required: {path}"
|
|
942
|
+
},
|
|
943
|
+
warnings: {
|
|
944
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
945
|
+
},
|
|
946
|
+
info: {
|
|
947
|
+
operationComplete: "Operation completed successfully",
|
|
948
|
+
filesProcessed: {
|
|
949
|
+
zero: "No files processed",
|
|
950
|
+
one: "{count} file processed",
|
|
951
|
+
other: "{count} files processed"
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
// ../packager/packager-core/src/i18n/locales/tr.ts
|
|
958
|
+
var tr = {
|
|
959
|
+
toolCore: {
|
|
960
|
+
errors: {
|
|
961
|
+
internal: "Internal error: {message}",
|
|
962
|
+
fileNotFound: "File not found: {path}",
|
|
963
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
964
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
965
|
+
directoryNotFound: "Directory not found: {path}",
|
|
966
|
+
invalidPath: "{path} is not a valid path",
|
|
967
|
+
operationCanceled: "Operation was canceled",
|
|
968
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
969
|
+
},
|
|
970
|
+
progress: {
|
|
971
|
+
copying: "Copying files...",
|
|
972
|
+
building: "Building project...",
|
|
973
|
+
packaging: "Creating package...",
|
|
974
|
+
validating: "Validating...",
|
|
975
|
+
analyzing: "Analyzing...",
|
|
976
|
+
restoring: "Restoring dependencies..."
|
|
977
|
+
},
|
|
978
|
+
validation: {
|
|
979
|
+
requiredField: "{field} is required",
|
|
980
|
+
invalidValue: "Invalid value for {field}",
|
|
981
|
+
pathNotFound: "Path not found: {path}",
|
|
982
|
+
fileRequired: "File is required: {path}",
|
|
983
|
+
directoryRequired: "Directory is required: {path}"
|
|
984
|
+
},
|
|
985
|
+
warnings: {
|
|
986
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
987
|
+
},
|
|
988
|
+
info: {
|
|
989
|
+
operationComplete: "Operation completed successfully",
|
|
990
|
+
filesProcessed: {
|
|
991
|
+
zero: "No files processed",
|
|
992
|
+
one: "{count} file processed",
|
|
993
|
+
other: "{count} files processed"
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
// ../packager/packager-core/src/i18n/locales/zh-CN.ts
|
|
1000
|
+
var zh_CN = {
|
|
1001
|
+
toolCore: {
|
|
1002
|
+
errors: {
|
|
1003
|
+
internal: "Internal error: {message}",
|
|
1004
|
+
fileNotFound: "File not found: {path}",
|
|
1005
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
1006
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
1007
|
+
directoryNotFound: "Directory not found: {path}",
|
|
1008
|
+
invalidPath: "{path} is not a valid path",
|
|
1009
|
+
operationCanceled: "Operation was canceled",
|
|
1010
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
1011
|
+
},
|
|
1012
|
+
progress: {
|
|
1013
|
+
copying: "Copying files...",
|
|
1014
|
+
building: "Building project...",
|
|
1015
|
+
packaging: "Creating package...",
|
|
1016
|
+
validating: "Validating...",
|
|
1017
|
+
analyzing: "Analyzing...",
|
|
1018
|
+
restoring: "Restoring dependencies..."
|
|
1019
|
+
},
|
|
1020
|
+
validation: {
|
|
1021
|
+
requiredField: "{field} is required",
|
|
1022
|
+
invalidValue: "Invalid value for {field}",
|
|
1023
|
+
pathNotFound: "Path not found: {path}",
|
|
1024
|
+
fileRequired: "File is required: {path}",
|
|
1025
|
+
directoryRequired: "Directory is required: {path}"
|
|
1026
|
+
},
|
|
1027
|
+
warnings: {
|
|
1028
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
1029
|
+
},
|
|
1030
|
+
info: {
|
|
1031
|
+
operationComplete: "Operation completed successfully",
|
|
1032
|
+
filesProcessed: {
|
|
1033
|
+
zero: "No files processed",
|
|
1034
|
+
one: "{count} file processed",
|
|
1035
|
+
other: "{count} files processed"
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
// ../packager/packager-core/src/i18n/locales/zh-TW.ts
|
|
1042
|
+
var zh_TW = {
|
|
1043
|
+
toolCore: {
|
|
1044
|
+
errors: {
|
|
1045
|
+
internal: "Internal error: {message}",
|
|
1046
|
+
fileNotFound: "File not found: {path}",
|
|
1047
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
1048
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
1049
|
+
directoryNotFound: "Directory not found: {path}",
|
|
1050
|
+
invalidPath: "{path} is not a valid path",
|
|
1051
|
+
operationCanceled: "Operation was canceled",
|
|
1052
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
1053
|
+
},
|
|
1054
|
+
progress: {
|
|
1055
|
+
copying: "Copying files...",
|
|
1056
|
+
building: "Building project...",
|
|
1057
|
+
packaging: "Creating package...",
|
|
1058
|
+
validating: "Validating...",
|
|
1059
|
+
analyzing: "Analyzing...",
|
|
1060
|
+
restoring: "Restoring dependencies..."
|
|
1061
|
+
},
|
|
1062
|
+
validation: {
|
|
1063
|
+
requiredField: "{field} is required",
|
|
1064
|
+
invalidValue: "Invalid value for {field}",
|
|
1065
|
+
pathNotFound: "Path not found: {path}",
|
|
1066
|
+
fileRequired: "File is required: {path}",
|
|
1067
|
+
directoryRequired: "Directory is required: {path}"
|
|
1068
|
+
},
|
|
1069
|
+
warnings: {
|
|
1070
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
1071
|
+
},
|
|
1072
|
+
info: {
|
|
1073
|
+
operationComplete: "Operation completed successfully",
|
|
1074
|
+
filesProcessed: {
|
|
1075
|
+
zero: "No files processed",
|
|
1076
|
+
one: "{count} file processed",
|
|
1077
|
+
other: "{count} files processed"
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
// ../packager/packager-core/src/i18n/locales/zu.ts
|
|
1084
|
+
var zu = {
|
|
1085
|
+
toolCore: {
|
|
1086
|
+
errors: {
|
|
1087
|
+
internal: "Internal error: {message}",
|
|
1088
|
+
fileNotFound: "File not found: {path}",
|
|
1089
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
1090
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
1091
|
+
directoryNotFound: "Directory not found: {path}",
|
|
1092
|
+
invalidPath: "{path} is not a valid path",
|
|
1093
|
+
operationCanceled: "Operation was canceled",
|
|
1094
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
1095
|
+
},
|
|
1096
|
+
progress: {
|
|
1097
|
+
copying: "Copying files...",
|
|
1098
|
+
building: "Building project...",
|
|
1099
|
+
packaging: "Creating package...",
|
|
1100
|
+
validating: "Validating...",
|
|
1101
|
+
analyzing: "Analyzing...",
|
|
1102
|
+
restoring: "Restoring dependencies..."
|
|
1103
|
+
},
|
|
1104
|
+
validation: {
|
|
1105
|
+
requiredField: "{field} is required",
|
|
1106
|
+
invalidValue: "Invalid value for {field}",
|
|
1107
|
+
pathNotFound: "Path not found: {path}",
|
|
1108
|
+
fileRequired: "File is required: {path}",
|
|
1109
|
+
directoryRequired: "Directory is required: {path}"
|
|
1110
|
+
},
|
|
1111
|
+
warnings: {
|
|
1112
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
1113
|
+
},
|
|
1114
|
+
info: {
|
|
1115
|
+
operationComplete: "Operation completed successfully",
|
|
1116
|
+
filesProcessed: {
|
|
1117
|
+
zero: "No files processed",
|
|
1118
|
+
one: "{count} file processed",
|
|
1119
|
+
other: "{count} files processed"
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
|
|
1125
|
+
// ../packager/packager-core/src/i18n/translation-service.ts
|
|
1126
|
+
class TranslationService {
|
|
1127
|
+
static instance;
|
|
1128
|
+
currentLocale = "en";
|
|
1129
|
+
constructor() {}
|
|
1130
|
+
static getInstance() {
|
|
1131
|
+
if (!TranslationService.instance) {
|
|
1132
|
+
TranslationService.instance = new TranslationService;
|
|
1133
|
+
}
|
|
1134
|
+
return TranslationService.instance;
|
|
1135
|
+
}
|
|
1136
|
+
setLocale(locale) {
|
|
1137
|
+
this.currentLocale = I18nManager.setLocale(locale);
|
|
1138
|
+
}
|
|
1139
|
+
getLocale() {
|
|
1140
|
+
return this.currentLocale;
|
|
1141
|
+
}
|
|
1142
|
+
t(key, params) {
|
|
1143
|
+
return I18nManager.t(key, params, this.currentLocale);
|
|
1144
|
+
}
|
|
1145
|
+
tLocale(key, locale, params) {
|
|
1146
|
+
return I18nManager.t(key, params, locale);
|
|
1147
|
+
}
|
|
1148
|
+
has(key) {
|
|
1149
|
+
return I18nManager.has(key, this.currentLocale);
|
|
1150
|
+
}
|
|
1151
|
+
getAvailableLocales() {
|
|
1152
|
+
return I18nManager.getAvailableLocales();
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
var translate = TranslationService.getInstance();
|
|
1156
|
+
|
|
1157
|
+
// ../packager/packager-core/src/i18n/index.ts
|
|
1158
|
+
I18nManager.registerTranslations("en", en);
|
|
1159
|
+
I18nManager.registerTranslations("de", de);
|
|
1160
|
+
I18nManager.registerTranslations("es", es);
|
|
1161
|
+
I18nManager.registerTranslations("es-mx", es_MX);
|
|
1162
|
+
I18nManager.registerTranslations("fr", fr);
|
|
1163
|
+
I18nManager.registerTranslations("ja", ja);
|
|
1164
|
+
I18nManager.registerTranslations("ko", ko);
|
|
1165
|
+
I18nManager.registerTranslations("pt", pt);
|
|
1166
|
+
I18nManager.registerTranslations("pt-br", pt_BR);
|
|
1167
|
+
I18nManager.registerTranslations("ro", ro);
|
|
1168
|
+
I18nManager.registerTranslations("ru", ru);
|
|
1169
|
+
I18nManager.registerTranslations("tr", tr);
|
|
1170
|
+
I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
1171
|
+
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
1172
|
+
I18nManager.registerTranslations("zu", zu);
|
|
1173
|
+
I18nManager.setLocale("en");
|
|
1174
|
+
export { Path, TemporaryStorageService, NugetConstants, ToolResult, NugetPackager, ProjectTool, toolsFactoryRepository };
|
|
1175
|
+
|
|
1176
|
+
//# debugId=964BCF56E9AD260E64756E2164756E21
|