@bytebrand/export-cars 1.0.10 → 1.0.12
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=14.0.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "a00f3e2f8028d22be76d15fbda2a5b143375ded3"
|
|
68
68
|
}
|
|
@@ -91,18 +91,27 @@ export class MobileExporter implements Exporter {
|
|
|
91
91
|
return new Promise((resolve, reject) => {
|
|
92
92
|
lastValueFrom(
|
|
93
93
|
this.httpService.get(imageUrl, {
|
|
94
|
-
responseType: '
|
|
94
|
+
responseType: 'arraybuffer',
|
|
95
95
|
}),
|
|
96
96
|
)
|
|
97
|
-
.then(({ data }) => {
|
|
98
|
-
const writer = createWriteStream(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
.then(async ({ data }) => {
|
|
98
|
+
// const writer = createWriteStream(
|
|
99
|
+
// join(
|
|
100
|
+
// this.configService.config.pathesConfig.localConvertedDirectory,
|
|
101
|
+
// 'images',
|
|
102
|
+
// `${vehicleId}_${index + 1}${extname(imageUrl) || '.jpg'}`,
|
|
103
|
+
// ),
|
|
104
|
+
// );
|
|
105
|
+
// pipeline(data, writer).then(resolve).catch(reject);
|
|
106
|
+
|
|
107
|
+
const imageFile = join(
|
|
108
|
+
this.configService.config.pathesConfig.localConvertedDirectory,
|
|
109
|
+
'images',
|
|
110
|
+
`${vehicleId}_${index + 1}${extname(imageUrl) || '.jpg'}`,
|
|
104
111
|
);
|
|
105
|
-
|
|
112
|
+
|
|
113
|
+
await writeFile(imageFile, data, { flag: 'w' });
|
|
114
|
+
resolve(imageFile);
|
|
106
115
|
})
|
|
107
116
|
.catch(reject);
|
|
108
117
|
});
|