move next to web-front
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { importCatalogExport } from '../src/entities/dashcam-catalog/api/importCatalogExport.ts';
|
||||
|
||||
const manifestUrl = process.env.DASHCAM_CATALOG_MANIFEST_URL ?? process.argv[2];
|
||||
const token = process.env.DASHCAM_CATALOG_EXPORT_TOKEN;
|
||||
|
||||
if (!manifestUrl) {
|
||||
throw new Error('Set DASHCAM_CATALOG_MANIFEST_URL or pass manifest URL as the first argument');
|
||||
}
|
||||
|
||||
if (!token) {
|
||||
throw new Error('Set DASHCAM_CATALOG_EXPORT_TOKEN');
|
||||
}
|
||||
|
||||
const result = await importCatalogExport({ manifestUrl, token });
|
||||
|
||||
console.log(
|
||||
JSON.stringify(
|
||||
{
|
||||
status: 'imported',
|
||||
exportId: result.exportId,
|
||||
itemCount: result.itemCount,
|
||||
sha256: result.sha256,
|
||||
dbFilePath: result.dbFilePath,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user