@forzalabs/remora 0.0.15 → 0.0.16
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/Constants.js
CHANGED
|
@@ -132,7 +132,11 @@ class ProducerEngineClass {
|
|
|
132
132
|
sampleData = ParseManager_1.default.csvLinesToJson(fileData.data, producer);
|
|
133
133
|
}
|
|
134
134
|
else if (((_b = producer.settings.fileType) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'JSON' || ((_c = producer.settings.fileType) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === 'JSONL') {
|
|
135
|
-
|
|
135
|
+
// With JSON or JSONL the readFile function already parses the strings
|
|
136
|
+
if (typeof fileData.data[0] === 'object')
|
|
137
|
+
sampleData = fileData.data;
|
|
138
|
+
else
|
|
139
|
+
sampleData = fileData.data.map(line => JSON.parse(line));
|
|
136
140
|
}
|
|
137
141
|
else {
|
|
138
142
|
sampleData = fileData.data;
|
|
@@ -58,7 +58,7 @@ class PostProcessorClass {
|
|
|
58
58
|
const { key, alias } = field.cField;
|
|
59
59
|
const fieldKey = alias !== null && alias !== void 0 ? alias : key;
|
|
60
60
|
const maskType = (_a = field.dimension) === null || _a === void 0 ? void 0 : _a.mask;
|
|
61
|
-
projected[fieldKey] = CryptoEngine_1.default.hashValue(maskType, x[
|
|
61
|
+
projected[fieldKey] = CryptoEngine_1.default.hashValue(maskType, x[key]);
|
|
62
62
|
}
|
|
63
63
|
return projected;
|
|
64
64
|
});
|
|
@@ -99,14 +99,15 @@ class FileExporterClass {
|
|
|
99
99
|
const folder = source.authentication.path;
|
|
100
100
|
if (!fs.existsSync(folder))
|
|
101
101
|
fs.mkdirSync(folder);
|
|
102
|
-
const
|
|
102
|
+
const date = DSTE_1.default.now().toISOString().split('.')[0];
|
|
103
|
+
const path = `${folder}/${consumer.name}_${Algo_1.default.replaceAll(date, ':', '-')}.${extension}`;
|
|
103
104
|
fs.writeFileSync(path, exportData);
|
|
104
105
|
return path;
|
|
105
106
|
}
|
|
106
107
|
case 'aws-s3': {
|
|
107
108
|
const driver = yield DriverFactory_1.default.instantiateDestination(source);
|
|
108
109
|
const date = DSTE_1.default.now().toISOString().split('.')[0];
|
|
109
|
-
const res = yield driver.uploadFile({ content: exportData, name: `${consumer.name}_${date}.${extension}` });
|
|
110
|
+
const res = yield driver.uploadFile({ content: exportData, name: `${consumer.name}_${Algo_1.default.replaceAll(date, ':', '-')}.${extension}` });
|
|
110
111
|
return res.key;
|
|
111
112
|
}
|
|
112
113
|
}
|