use metadatas and schemas

This commit is contained in:
Ben Irvin 2022-11-28 13:24:34 +01:00
parent c62758ebfc
commit ef980513bf
2 changed files with 5 additions and 6 deletions

View File

@ -246,6 +246,7 @@ class TransferEngine<
const isValidTransfer = await this.integrityCheck(); const isValidTransfer = await this.integrityCheck();
if (!isValidTransfer) { if (!isValidTransfer) {
// TODO: provide the log from the integrity check
throw new Error( throw new Error(
`Unable to transfer the data between ${this.sourceProvider.name} and ${this.destinationProvider.name}.\nPlease refer to the log above for more information.` `Unable to transfer the data between ${this.sourceProvider.name} and ${this.destinationProvider.name}.\nPlease refer to the log above for more information.`
); );

View File

@ -82,15 +82,13 @@ class LocalFileSourceProvider implements ISourceProvider {
// TODO: need to read the file & extract the metadata json file // TODO: need to read the file & extract the metadata json file
// => we might also need to read the schema.jsonl files & implements a custom stream-check // => we might also need to read the schema.jsonl files & implements a custom stream-check
const backupStream = this.#getBackupStream(); const backupStream = this.#getBackupStream();
return {}; return this.#parseJSONFile<IMetadata>(backupStream, METADATA_FILE_PATH);
// return this.#parseJSONFile<IMetadata>(backupStream, METADATA_FILE_PATH);
} }
async getSchemas() { async getSchemas() {
// const schemas = await collect(this.streamSchemas() as Readable); const schemas = await collect(this.streamSchemas() as Readable);
// return keyBy('uid', schemas); return keyBy('uid', schemas);
return null;
} }
streamEntities(): NodeJS.ReadableStream { streamEntities(): NodeJS.ReadableStream {