configforge 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +247 -1
- package/dist/core/Converter.d.ts +9 -0
- package/dist/core/Converter.d.ts.map +1 -1
- package/dist/core/Converter.js +15 -0
- package/dist/core/Converter.js.map +1 -1
- package/dist/core/IncrementalProcessor.d.ts.map +1 -1
- package/dist/core/IncrementalProcessor.js +23 -1
- package/dist/core/IncrementalProcessor.js.map +1 -1
- package/dist/core/MultiFileProcessor.d.ts +74 -0
- package/dist/core/MultiFileProcessor.d.ts.map +1 -0
- package/dist/core/MultiFileProcessor.js +255 -0
- package/dist/core/MultiFileProcessor.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -1
- package/dist/decentholograms-to-cmiholograms/index.d.ts +39 -0
- package/dist/decentholograms-to-cmiholograms/index.d.ts.map +1 -0
- package/dist/decentholograms-to-cmiholograms/index.js +274 -0
- package/dist/decentholograms-to-cmiholograms/index.js.map +1 -0
- package/dist/decentholograms-to-cmiholograms/types.d.ts +58 -0
- package/dist/decentholograms-to-cmiholograms/types.d.ts.map +1 -0
- package/dist/decentholograms-to-cmiholograms/types.js +6 -0
- package/dist/decentholograms-to-cmiholograms/types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiFileProcessor = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const ConversionResult_1 = require("./ConversionResult");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
/**
|
|
8
|
+
* MultiFileProcessor handles merging multiple input files into a single output
|
|
9
|
+
* or splitting a single input into multiple outputs
|
|
10
|
+
*/
|
|
11
|
+
class MultiFileProcessor {
|
|
12
|
+
constructor(converter, options = {}) {
|
|
13
|
+
this.converter = converter;
|
|
14
|
+
this.options = {
|
|
15
|
+
mergeStrategy: options.mergeStrategy ?? 'merge',
|
|
16
|
+
customMerger: options.customMerger ?? this.defaultMerger,
|
|
17
|
+
rootKey: options.rootKey ?? '',
|
|
18
|
+
preserveFileNames: options.preserveFileNames ?? true,
|
|
19
|
+
keyExtractor: options.keyExtractor ?? this.defaultKeyExtractor,
|
|
20
|
+
continueOnError: options.continueOnError ?? true,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Process multiple input files and merge them into a single result
|
|
25
|
+
*/
|
|
26
|
+
async processMany(inputPaths) {
|
|
27
|
+
const startTime = performance.now();
|
|
28
|
+
const fileResults = [];
|
|
29
|
+
const failedFiles = [];
|
|
30
|
+
const allWarnings = [];
|
|
31
|
+
const allErrors = [];
|
|
32
|
+
if (inputPaths.length === 0) {
|
|
33
|
+
throw new types_1.GenericConfigForgeError('No input files provided');
|
|
34
|
+
}
|
|
35
|
+
// Process each file individually
|
|
36
|
+
for (const filePath of inputPaths) {
|
|
37
|
+
try {
|
|
38
|
+
const result = await this.converter.convert(filePath);
|
|
39
|
+
fileResults.push({
|
|
40
|
+
filePath,
|
|
41
|
+
result,
|
|
42
|
+
success: result.errors.length === 0,
|
|
43
|
+
});
|
|
44
|
+
// Collect warnings and errors
|
|
45
|
+
allWarnings.push(...result.warnings);
|
|
46
|
+
allErrors.push(...result.errors);
|
|
47
|
+
// If there are errors, add to failed files
|
|
48
|
+
if (result.errors.length > 0) {
|
|
49
|
+
failedFiles.push(filePath);
|
|
50
|
+
if (!this.options.continueOnError) {
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const configError = error instanceof types_1.ConfigForgeError
|
|
57
|
+
? error
|
|
58
|
+
: new types_1.GenericConfigForgeError(`Failed to process ${filePath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
59
|
+
failedFiles.push(filePath);
|
|
60
|
+
allErrors.push(configError);
|
|
61
|
+
// Create a failed result entry
|
|
62
|
+
fileResults.push({
|
|
63
|
+
filePath,
|
|
64
|
+
result: {
|
|
65
|
+
data: {},
|
|
66
|
+
warnings: [],
|
|
67
|
+
unmapped: [],
|
|
68
|
+
errors: [configError],
|
|
69
|
+
stats: {
|
|
70
|
+
fieldsProcessed: 0,
|
|
71
|
+
fieldsMapped: 0,
|
|
72
|
+
fieldsUnmapped: 0,
|
|
73
|
+
fieldsWithDefaults: 0,
|
|
74
|
+
transformsApplied: 0,
|
|
75
|
+
validationErrors: 1,
|
|
76
|
+
duration: 0,
|
|
77
|
+
},
|
|
78
|
+
save: async () => { },
|
|
79
|
+
toJSON: () => '{}',
|
|
80
|
+
toYAML: () => '{}',
|
|
81
|
+
print: () => { },
|
|
82
|
+
},
|
|
83
|
+
success: false,
|
|
84
|
+
});
|
|
85
|
+
if (!this.options.continueOnError) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Extract successful results for merging
|
|
91
|
+
const successfulResults = fileResults
|
|
92
|
+
.filter(fr => fr.success)
|
|
93
|
+
.map(fr => ({ data: fr.result.data, filePath: fr.filePath }));
|
|
94
|
+
// Merge the data
|
|
95
|
+
let mergedData = {};
|
|
96
|
+
if (successfulResults.length > 0) {
|
|
97
|
+
try {
|
|
98
|
+
mergedData = this.mergeData(successfulResults);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
allErrors.push(new types_1.GenericConfigForgeError(`Failed to merge data: ${error instanceof Error ? error.message : 'Unknown error'}`));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Calculate combined statistics
|
|
105
|
+
const duration = performance.now() - startTime;
|
|
106
|
+
const stats = {
|
|
107
|
+
fieldsProcessed: fileResults.reduce((sum, fr) => sum + fr.result.stats.fieldsProcessed, 0),
|
|
108
|
+
fieldsMapped: fileResults.reduce((sum, fr) => sum + fr.result.stats.fieldsMapped, 0),
|
|
109
|
+
fieldsUnmapped: fileResults.reduce((sum, fr) => sum + fr.result.stats.fieldsUnmapped, 0),
|
|
110
|
+
fieldsWithDefaults: fileResults.reduce((sum, fr) => sum + fr.result.stats.fieldsWithDefaults, 0),
|
|
111
|
+
transformsApplied: fileResults.reduce((sum, fr) => sum + fr.result.stats.transformsApplied, 0),
|
|
112
|
+
validationErrors: allErrors.length,
|
|
113
|
+
duration,
|
|
114
|
+
};
|
|
115
|
+
// Get all unmapped fields
|
|
116
|
+
const allUnmapped = [
|
|
117
|
+
...new Set(fileResults.flatMap(fr => fr.result.unmapped)),
|
|
118
|
+
];
|
|
119
|
+
// Create the result
|
|
120
|
+
const baseResult = new ConversionResult_1.ConversionResultImpl(mergedData, allWarnings, allUnmapped, allErrors, stats);
|
|
121
|
+
// Create MultiFileResult by extending the base result
|
|
122
|
+
const result = Object.assign(baseResult, {
|
|
123
|
+
fileResults,
|
|
124
|
+
failedFiles,
|
|
125
|
+
});
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Split a single input into multiple outputs (one-to-many)
|
|
130
|
+
*/
|
|
131
|
+
async processSplit(inputPath, splitFn) {
|
|
132
|
+
// First convert the input file
|
|
133
|
+
const inputResult = await this.converter.convert(inputPath);
|
|
134
|
+
if (inputResult.errors.length > 0) {
|
|
135
|
+
throw new types_1.GenericConfigForgeError(`Failed to process input file: ${inputResult.errors.map(e => e.message).join(', ')}`);
|
|
136
|
+
}
|
|
137
|
+
// Split the data
|
|
138
|
+
const splitData = splitFn(inputResult.data);
|
|
139
|
+
const results = {};
|
|
140
|
+
// Create individual results for each split
|
|
141
|
+
for (const [key, data] of Object.entries(splitData)) {
|
|
142
|
+
// Use the same converter to process the split data directly
|
|
143
|
+
const splitResult = this.converter.convertSync(data);
|
|
144
|
+
results[key] = splitResult;
|
|
145
|
+
}
|
|
146
|
+
return results;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Merge data from multiple successful results
|
|
150
|
+
*/
|
|
151
|
+
mergeData(results) {
|
|
152
|
+
const inputs = results.map(r => r.data);
|
|
153
|
+
const filePaths = results.map(r => r.filePath);
|
|
154
|
+
let merged;
|
|
155
|
+
switch (this.options.mergeStrategy) {
|
|
156
|
+
case 'array':
|
|
157
|
+
merged = inputs;
|
|
158
|
+
break;
|
|
159
|
+
case 'custom':
|
|
160
|
+
merged = this.options.customMerger(inputs, filePaths);
|
|
161
|
+
break;
|
|
162
|
+
case 'merge':
|
|
163
|
+
default:
|
|
164
|
+
merged = this.mergeObjects(results);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
// Wrap in root key if specified
|
|
168
|
+
if (this.options.rootKey) {
|
|
169
|
+
return { [this.options.rootKey]: merged };
|
|
170
|
+
}
|
|
171
|
+
return merged;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Merge objects using file names as keys if preserveFileNames is true
|
|
175
|
+
*/
|
|
176
|
+
mergeObjects(results) {
|
|
177
|
+
if (!this.options.preserveFileNames) {
|
|
178
|
+
// Simple deep merge
|
|
179
|
+
return results.reduce((merged, { data }) => {
|
|
180
|
+
return this.deepMerge(merged, data);
|
|
181
|
+
}, {});
|
|
182
|
+
}
|
|
183
|
+
// Use file names as keys
|
|
184
|
+
const merged = {};
|
|
185
|
+
for (const { data, filePath } of results) {
|
|
186
|
+
const key = this.options.keyExtractor(filePath);
|
|
187
|
+
merged[key] = data;
|
|
188
|
+
}
|
|
189
|
+
return merged;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Default key extractor - extracts filename without extension
|
|
193
|
+
*/
|
|
194
|
+
defaultKeyExtractor(filePath) {
|
|
195
|
+
return (filePath
|
|
196
|
+
.split(/[/\\]/)
|
|
197
|
+
.pop()
|
|
198
|
+
?.replace(/\.[^/.]+$/, '') || 'unknown');
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Default merger - simple object merge
|
|
202
|
+
*/
|
|
203
|
+
defaultMerger(inputs) {
|
|
204
|
+
return inputs.reduce((merged, input) => {
|
|
205
|
+
return this.deepMerge(merged, input);
|
|
206
|
+
}, {});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Deep merge two objects
|
|
210
|
+
*/
|
|
211
|
+
deepMerge(target, source) {
|
|
212
|
+
if (source === null || typeof source !== 'object') {
|
|
213
|
+
return source;
|
|
214
|
+
}
|
|
215
|
+
if (target === null || typeof target !== 'object') {
|
|
216
|
+
return source;
|
|
217
|
+
}
|
|
218
|
+
const result = { ...target };
|
|
219
|
+
for (const key in source) {
|
|
220
|
+
if (source.hasOwnProperty(key)) {
|
|
221
|
+
if (typeof source[key] === 'object' &&
|
|
222
|
+
source[key] !== null &&
|
|
223
|
+
!Array.isArray(source[key]) &&
|
|
224
|
+
typeof result[key] === 'object' &&
|
|
225
|
+
result[key] !== null &&
|
|
226
|
+
!Array.isArray(result[key])) {
|
|
227
|
+
result[key] = this.deepMerge(result[key], source[key]);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
result[key] = source[key];
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Save split results to multiple files
|
|
238
|
+
*/
|
|
239
|
+
async saveSplit(results, outputDir, fileExtension = 'yml') {
|
|
240
|
+
// Ensure output directory exists
|
|
241
|
+
await fs_1.promises.mkdir(outputDir, { recursive: true });
|
|
242
|
+
const savePromises = Object.entries(results).map(async ([key, result]) => {
|
|
243
|
+
const outputPath = `${outputDir}/${key}.${fileExtension}`;
|
|
244
|
+
try {
|
|
245
|
+
await result.save(outputPath);
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
console.warn(`Failed to save split result for ${key}:`, error);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
await Promise.all(savePromises);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
exports.MultiFileProcessor = MultiFileProcessor;
|
|
255
|
+
//# sourceMappingURL=MultiFileProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiFileProcessor.js","sourceRoot":"","sources":["../../src/core/MultiFileProcessor.ts"],"names":[],"mappings":";;;AAAA,oCAMkB;AAElB,yDAA0D;AAC1D,2BAAoC;AAkCpC;;;GAGG;AACH,MAAa,kBAAkB;IAI7B,YAAY,SAAoB,EAAE,UAA4B,EAAE;QAC9D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG;YACb,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO;YAC/C,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,aAAa;YACxD,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;YAC9B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,IAAI;YACpD,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,mBAAmB;YAC9D,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,IAAI;SACjD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,UAAoB;QACpC,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,WAAW,GAIZ,EAAE,CAAC;QACR,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,MAAM,WAAW,GAAc,EAAE,CAAC;QAClC,MAAM,SAAS,GAAuB,EAAE,CAAC;QAEzC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,+BAAuB,CAAC,yBAAyB,CAAC,CAAC;QAC/D,CAAC;QAED,iCAAiC;QACjC,K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,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBACzD,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CACb,OAAyC,EACzC,SAAiB,EACjB,gBAAwB,KAAK;QAE7B,iCAAiC;QACjC,MAAM,aAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAE/C,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE;YACvE,MAAM,UAAU,GAAG,GAAG,SAAS,IAAI,GAAG,IAAI,aAAa,EAAE,CAAC;YAC1D,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,mCAAmC,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC;YACjE,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;CACF;AAtUD,gDAsUC"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export { ConversionResultImpl } from './ConversionResult';
|
|
|
4
4
|
export { Mapper } from './Mapper';
|
|
5
5
|
export { BatchProcessor } from './BatchProcessor';
|
|
6
6
|
export { IncrementalProcessor } from './IncrementalProcessor';
|
|
7
|
+
export { MultiFileProcessor } from './MultiFileProcessor';
|
|
7
8
|
export { PerformanceMonitor, PerformanceBenchmark } from './PerformanceMonitor';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PerformanceBenchmark = exports.PerformanceMonitor = exports.IncrementalProcessor = exports.BatchProcessor = exports.Mapper = exports.ConversionResultImpl = exports.forge = exports.ConditionalMapper = exports.Converter = void 0;
|
|
3
|
+
exports.PerformanceBenchmark = exports.PerformanceMonitor = exports.MultiFileProcessor = exports.IncrementalProcessor = exports.BatchProcessor = exports.Mapper = exports.ConversionResultImpl = exports.forge = exports.ConditionalMapper = exports.Converter = void 0;
|
|
4
4
|
var Converter_1 = require("./Converter");
|
|
5
5
|
Object.defineProperty(exports, "Converter", { enumerable: true, get: function () { return Converter_1.Converter; } });
|
|
6
6
|
Object.defineProperty(exports, "ConditionalMapper", { enumerable: true, get: function () { return Converter_1.ConditionalMapper; } });
|
|
@@ -14,6 +14,8 @@ var BatchProcessor_1 = require("./BatchProcessor");
|
|
|
14
14
|
Object.defineProperty(exports, "BatchProcessor", { enumerable: true, get: function () { return BatchProcessor_1.BatchProcessor; } });
|
|
15
15
|
var IncrementalProcessor_1 = require("./IncrementalProcessor");
|
|
16
16
|
Object.defineProperty(exports, "IncrementalProcessor", { enumerable: true, get: function () { return IncrementalProcessor_1.IncrementalProcessor; } });
|
|
17
|
+
var MultiFileProcessor_1 = require("./MultiFileProcessor");
|
|
18
|
+
Object.defineProperty(exports, "MultiFileProcessor", { enumerable: true, get: function () { return MultiFileProcessor_1.MultiFileProcessor; } });
|
|
17
19
|
var PerformanceMonitor_1 = require("./PerformanceMonitor");
|
|
18
20
|
Object.defineProperty(exports, "PerformanceMonitor", { enumerable: true, get: function () { return PerformanceMonitor_1.PerformanceMonitor; } });
|
|
19
21
|
Object.defineProperty(exports, "PerformanceBenchmark", { enumerable: true, get: function () { return PerformanceMonitor_1.PerformanceBenchmark; } });
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,yCAA2D;AAAlD,sGAAA,SAAS,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AACrC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,uDAA0D;AAAjD,wHAAA,oBAAoB,OAAA;AAC7B,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,2DAAgF;AAAvE,wHAAA,kBAAkB,OAAA;AAAE,0HAAA,oBAAoB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,yCAA2D;AAAlD,sGAAA,SAAS,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AACrC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,uDAA0D;AAAjD,wHAAA,oBAAoB,OAAA;AAC7B,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,2DAAgF;AAAvE,wHAAA,kBAAkB,OAAA;AAAE,0HAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DecentHologram, CMIHologram, ConversionOptions, ParsedLocation, ConversionResult as CustomConversionResult } from './types';
|
|
2
|
+
import { ConversionResult } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Utility function to parse DecentHolograms location format
|
|
5
|
+
* Converts "spawn:0.500:103.500:-6.5" to { world: "spawn", x: 0.5, y: 103.5, z: -6.5 }
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseDecentLocation(location: string, defaultWorld?: string): ParsedLocation;
|
|
8
|
+
/**
|
|
9
|
+
* Utility function to format location for CMI
|
|
10
|
+
* Converts parsed location to "world;0.5;103.5;-6.5" format
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatCMILocation(parsed: ParsedLocation): string;
|
|
13
|
+
/**
|
|
14
|
+
* Extract lines from DecentHolograms pages structure
|
|
15
|
+
* Takes the first page and extracts all line content
|
|
16
|
+
*/
|
|
17
|
+
export declare function extractLines(pages: any[]): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Default key extractor - extracts filename without extension
|
|
20
|
+
*/
|
|
21
|
+
export declare function defaultKeyExtractor(filePath: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Create a DecentHolograms to CMI Holograms converter
|
|
24
|
+
*/
|
|
25
|
+
export declare function createDecentToCMIConverter(options?: ConversionOptions): import("../index").Converter<DecentHologram, CMIHologram>;
|
|
26
|
+
/**
|
|
27
|
+
* Convert multiple DecentHolograms files to a single CMI Holograms file
|
|
28
|
+
*/
|
|
29
|
+
export declare function convertDecentToCMI(inputFiles: string[], outputPath?: string, options?: ConversionOptions): Promise<CustomConversionResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Convert a single DecentHolograms file for testing
|
|
32
|
+
*/
|
|
33
|
+
export declare function convertSingleDecent(inputFile: string, options?: ConversionOptions): Promise<ConversionResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Batch convert with custom grouping strategies
|
|
36
|
+
*/
|
|
37
|
+
export declare function convertWithGrouping(inputFiles: string[], groupingStrategy?: 'by-location' | 'by-type' | 'by-prefix', options?: ConversionOptions): Promise<CustomConversionResult>;
|
|
38
|
+
export default createDecentToCMIConverter;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decentholograms-to-cmiholograms/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,WAAW,EAEX,iBAAiB,EACjB,cAAc,EACd,gBAAgB,IAAI,sBAAsB,EAC3C,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,MAAgB,GAC7B,cAAc,CAgBhB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAEhE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,CAmBnD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iBAAsB,6DAiEzE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,EAAE,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CAuDjC;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CAiB3B;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAAE,EACpB,gBAAgB,GAAE,aAAa,GAAG,SAAS,GAAG,WAAuB,EACrE,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CAqFjC;AAGD,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseDecentLocation = parseDecentLocation;
|
|
7
|
+
exports.formatCMILocation = formatCMILocation;
|
|
8
|
+
exports.extractLines = extractLines;
|
|
9
|
+
exports.defaultKeyExtractor = defaultKeyExtractor;
|
|
10
|
+
exports.createDecentToCMIConverter = createDecentToCMIConverter;
|
|
11
|
+
exports.convertDecentToCMI = convertDecentToCMI;
|
|
12
|
+
exports.convertSingleDecent = convertSingleDecent;
|
|
13
|
+
exports.convertWithGrouping = convertWithGrouping;
|
|
14
|
+
const index_1 = require("../index");
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
16
|
+
/**
|
|
17
|
+
* Utility function to parse DecentHolograms location format
|
|
18
|
+
* Converts "spawn:0.500:103.500:-6.5" to { world: "spawn", x: 0.5, y: 103.5, z: -6.5 }
|
|
19
|
+
*/
|
|
20
|
+
function parseDecentLocation(location, defaultWorld = 'world') {
|
|
21
|
+
if (typeof location !== 'string') {
|
|
22
|
+
return { world: defaultWorld, x: 0, y: 0, z: 0 };
|
|
23
|
+
}
|
|
24
|
+
const parts = location.split(':');
|
|
25
|
+
if (parts.length < 4) {
|
|
26
|
+
return { world: defaultWorld, x: 0, y: 0, z: 0 };
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
world: parts[0] || defaultWorld,
|
|
30
|
+
x: parseFloat(parts[1] || '0') || 0,
|
|
31
|
+
y: parseFloat(parts[2] || '0') || 0,
|
|
32
|
+
z: parseFloat(parts[3] || '0') || 0,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Utility function to format location for CMI
|
|
37
|
+
* Converts parsed location to "world;0.5;103.5;-6.5" format
|
|
38
|
+
*/
|
|
39
|
+
function formatCMILocation(parsed) {
|
|
40
|
+
return `${parsed.world};${parsed.x};${parsed.y};${parsed.z}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Extract lines from DecentHolograms pages structure
|
|
44
|
+
* Takes the first page and extracts all line content
|
|
45
|
+
*/
|
|
46
|
+
function extractLines(pages) {
|
|
47
|
+
if (!Array.isArray(pages) || pages.length === 0) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
const firstPage = pages[0];
|
|
51
|
+
if (!firstPage || !Array.isArray(firstPage.lines)) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
return firstPage.lines
|
|
55
|
+
.map((line) => {
|
|
56
|
+
if (typeof line === 'string')
|
|
57
|
+
return line;
|
|
58
|
+
if (line && typeof line.content === 'string') {
|
|
59
|
+
return line.content;
|
|
60
|
+
}
|
|
61
|
+
return '';
|
|
62
|
+
})
|
|
63
|
+
.filter((line) => line.length > 0);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Default key extractor - extracts filename without extension
|
|
67
|
+
*/
|
|
68
|
+
function defaultKeyExtractor(filePath) {
|
|
69
|
+
return path_1.default.basename(filePath, path_1.default.extname(filePath));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create a DecentHolograms to CMI Holograms converter
|
|
73
|
+
*/
|
|
74
|
+
function createDecentToCMIConverter(options = {}) {
|
|
75
|
+
const { defaultFiller = 245, defaultWorld = 'world' } = options;
|
|
76
|
+
return ((0, index_1.forge)()
|
|
77
|
+
.from('decentholograms', { format: 'yaml' })
|
|
78
|
+
.to('cmi-holograms', { format: 'yaml' })
|
|
79
|
+
// Map location with proper format conversion
|
|
80
|
+
.map('location', 'Loc', (location) => {
|
|
81
|
+
const parsed = parseDecentLocation(location, defaultWorld);
|
|
82
|
+
return formatCMILocation(parsed);
|
|
83
|
+
})
|
|
84
|
+
// Map display range to CMI RangeExtra
|
|
85
|
+
.map('display-range', 'RangeExtra')
|
|
86
|
+
// Map update interval to CMI Interval
|
|
87
|
+
.map('update-interval', 'Interval')
|
|
88
|
+
// Transform pages structure to CMI Lines format
|
|
89
|
+
.map('pages', 'Lines', (pages) => {
|
|
90
|
+
return extractLines(pages);
|
|
91
|
+
})
|
|
92
|
+
// Set CMI-specific defaults
|
|
93
|
+
.defaults({
|
|
94
|
+
Filler: defaultFiller,
|
|
95
|
+
})
|
|
96
|
+
// Add validation to ensure required fields
|
|
97
|
+
.validate('Loc', value => {
|
|
98
|
+
if (!value || typeof value !== 'string') {
|
|
99
|
+
return 'Location (Loc) is required and must be a string';
|
|
100
|
+
}
|
|
101
|
+
if (!value.includes(';')) {
|
|
102
|
+
return 'Location must be in CMI format (world;x;y;z)';
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
105
|
+
})
|
|
106
|
+
.validate('Lines', value => {
|
|
107
|
+
if (!Array.isArray(value)) {
|
|
108
|
+
return 'Lines must be an array';
|
|
109
|
+
}
|
|
110
|
+
if (value.length === 0) {
|
|
111
|
+
return 'At least one line is required for the hologram';
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
})
|
|
115
|
+
// Add before hook for logging
|
|
116
|
+
.before(data => {
|
|
117
|
+
console.log(`🔄 Processing hologram with location: ${data.location}`);
|
|
118
|
+
return data;
|
|
119
|
+
})
|
|
120
|
+
// Add after hook for validation
|
|
121
|
+
.after(data => {
|
|
122
|
+
console.log(`✅ Converted hologram with ${data.Lines?.length || 0} lines`);
|
|
123
|
+
return data;
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Convert multiple DecentHolograms files to a single CMI Holograms file
|
|
128
|
+
*/
|
|
129
|
+
async function convertDecentToCMI(inputFiles, outputPath, options = {}) {
|
|
130
|
+
const converter = createDecentToCMIConverter(options);
|
|
131
|
+
try {
|
|
132
|
+
console.log(`🚀 Converting ${inputFiles.length} DecentHolograms files to CMI format...`);
|
|
133
|
+
const result = await converter.convertMany(inputFiles, {
|
|
134
|
+
mergeStrategy: 'merge',
|
|
135
|
+
preserveFileNames: options.preserveFileNames ?? true,
|
|
136
|
+
keyExtractor: options.keyExtractor ?? defaultKeyExtractor,
|
|
137
|
+
continueOnError: options.continueOnError ?? true,
|
|
138
|
+
});
|
|
139
|
+
const customResult = {
|
|
140
|
+
success: result.errors.length === 0,
|
|
141
|
+
data: result.data,
|
|
142
|
+
errors: result.errors.map(e => e.message),
|
|
143
|
+
warnings: result.warnings.map(w => w.message),
|
|
144
|
+
processedFiles: result.fileResults.length,
|
|
145
|
+
failedFiles: result.failedFiles,
|
|
146
|
+
};
|
|
147
|
+
// Log results
|
|
148
|
+
console.log(`✅ Conversion completed!`);
|
|
149
|
+
console.log(`📊 Processed: ${customResult.processedFiles} files`);
|
|
150
|
+
console.log(`⚠️ Warnings: ${customResult.warnings.length}`);
|
|
151
|
+
console.log(`❌ Errors: ${customResult.errors.length}`);
|
|
152
|
+
if (customResult.failedFiles.length > 0) {
|
|
153
|
+
console.log(`💥 Failed files: ${customResult.failedFiles.join(', ')}`);
|
|
154
|
+
}
|
|
155
|
+
// Save to file if output path provided
|
|
156
|
+
if (outputPath) {
|
|
157
|
+
await result.save(outputPath);
|
|
158
|
+
console.log(`💾 Saved to: ${outputPath}`);
|
|
159
|
+
}
|
|
160
|
+
return customResult;
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
164
|
+
console.error(`❌ Conversion failed: ${errorMessage}`);
|
|
165
|
+
return {
|
|
166
|
+
success: false,
|
|
167
|
+
data: {},
|
|
168
|
+
errors: [errorMessage],
|
|
169
|
+
warnings: [],
|
|
170
|
+
processedFiles: 0,
|
|
171
|
+
failedFiles: inputFiles,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Convert a single DecentHolograms file for testing
|
|
177
|
+
*/
|
|
178
|
+
async function convertSingleDecent(inputFile, options = {}) {
|
|
179
|
+
const converter = createDecentToCMIConverter(options);
|
|
180
|
+
try {
|
|
181
|
+
console.log(`🔄 Converting single file: ${inputFile}`);
|
|
182
|
+
const result = await converter.convert(inputFile);
|
|
183
|
+
console.log(`✅ Single file conversion completed!`);
|
|
184
|
+
if (result.errors.length > 0) {
|
|
185
|
+
console.log(`❌ Errors: ${result.errors.map(e => e.message).join(', ')}`);
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
console.error(`❌ Single file conversion failed: ${error}`);
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Batch convert with custom grouping strategies
|
|
196
|
+
*/
|
|
197
|
+
async function convertWithGrouping(inputFiles, groupingStrategy = 'by-type', options = {}) {
|
|
198
|
+
const converter = createDecentToCMIConverter(options);
|
|
199
|
+
// Custom merger based on grouping strategy
|
|
200
|
+
const customMerger = (inputs, filePaths) => {
|
|
201
|
+
const grouped = {};
|
|
202
|
+
inputs.forEach((data, index) => {
|
|
203
|
+
const filePath = filePaths[index];
|
|
204
|
+
if (!filePath)
|
|
205
|
+
return;
|
|
206
|
+
const fileName = path_1.default.basename(filePath, path_1.default.extname(filePath));
|
|
207
|
+
let groupKey = 'default';
|
|
208
|
+
switch (groupingStrategy) {
|
|
209
|
+
case 'by-location':
|
|
210
|
+
if (data.location) {
|
|
211
|
+
const parsed = parseDecentLocation(data.location);
|
|
212
|
+
groupKey = `${parsed.world}_holograms`;
|
|
213
|
+
}
|
|
214
|
+
break;
|
|
215
|
+
case 'by-type':
|
|
216
|
+
const lowerName = fileName.toLowerCase();
|
|
217
|
+
if (lowerName.includes('npc')) {
|
|
218
|
+
groupKey = 'npc_holograms';
|
|
219
|
+
}
|
|
220
|
+
else if (lowerName.includes('spawn') ||
|
|
221
|
+
(data.location && data.location.includes('spawn'))) {
|
|
222
|
+
groupKey = 'spawn_holograms';
|
|
223
|
+
}
|
|
224
|
+
else if (lowerName.includes('shop') ||
|
|
225
|
+
lowerName.includes('store')) {
|
|
226
|
+
groupKey = 'shop_holograms';
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
groupKey = 'other_holograms';
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
case 'by-prefix':
|
|
233
|
+
const prefix = fileName.split(/[_-]/)[0];
|
|
234
|
+
groupKey = `${prefix}_holograms`;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
if (!grouped[groupKey]) {
|
|
238
|
+
grouped[groupKey] = {};
|
|
239
|
+
}
|
|
240
|
+
grouped[groupKey][fileName] = data;
|
|
241
|
+
});
|
|
242
|
+
return grouped;
|
|
243
|
+
};
|
|
244
|
+
try {
|
|
245
|
+
console.log(`🚀 Converting with grouping strategy: ${groupingStrategy}`);
|
|
246
|
+
const result = await converter.convertMany(inputFiles, {
|
|
247
|
+
mergeStrategy: 'custom',
|
|
248
|
+
customMerger,
|
|
249
|
+
continueOnError: options.continueOnError ?? true,
|
|
250
|
+
});
|
|
251
|
+
return {
|
|
252
|
+
success: result.errors.length === 0,
|
|
253
|
+
data: result.data,
|
|
254
|
+
errors: result.errors.map(e => e.message),
|
|
255
|
+
warnings: result.warnings.map(w => w.message),
|
|
256
|
+
processedFiles: result.fileResults.length,
|
|
257
|
+
failedFiles: result.failedFiles,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
catch (error) {
|
|
261
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
262
|
+
return {
|
|
263
|
+
success: false,
|
|
264
|
+
data: {},
|
|
265
|
+
errors: [errorMessage],
|
|
266
|
+
warnings: [],
|
|
267
|
+
processedFiles: 0,
|
|
268
|
+
failedFiles: inputFiles,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
// Export the main converter creation function as default
|
|
273
|
+
exports.default = createDecentToCMIConverter;
|
|
274
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decentholograms-to-cmiholograms/index.ts"],"names":[],"mappings":";;;;;AAgBA,kDAmBC;AAMD,8CAEC;AAMD,oCAmBC;AAKD,kDAEC;AAKD,gEAiEC;AAKD,gDA2DC;AAKD,kDAoBC;AAKD,kDAyFC;AAxUD,oCAAiC;AAUjC,gDAAwB;AAExB;;;GAGG;AACH,SAAgB,mBAAmB,CACjC,QAAgB,EAChB,eAAuB,OAAO;IAE9B,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC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