diff --git a/packages/core/data-transfer/lib/engine/index.ts b/packages/core/data-transfer/lib/engine/index.ts index b6e3ebd4d6..c16430d8d5 100644 --- a/packages/core/data-transfer/lib/engine/index.ts +++ b/packages/core/data-transfer/lib/engine/index.ts @@ -173,7 +173,7 @@ class TransferEngine< if (!isEmpty(diffs)) { throw new Error( `Import process failed because the project doesn't have a matching data structure - ${JSON.stringify(diffs, null, 2)} + ${JSON.stringify(diffs, null, 2)} ` ); } @@ -246,6 +246,7 @@ class TransferEngine< const isValidTransfer = await this.integrityCheck(); if (!isValidTransfer) { + // TODO: provide the log from the integrity check 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.` ); diff --git a/packages/core/data-transfer/lib/providers/local-file-source-provider.ts b/packages/core/data-transfer/lib/providers/local-file-source-provider.ts index e4bc344e5a..3ccbea728d 100644 --- a/packages/core/data-transfer/lib/providers/local-file-source-provider.ts +++ b/packages/core/data-transfer/lib/providers/local-file-source-provider.ts @@ -82,15 +82,13 @@ class LocalFileSourceProvider implements ISourceProvider { // 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 const backupStream = this.#getBackupStream(); - return {}; - // return this.#parseJSONFile(backupStream, METADATA_FILE_PATH); + return this.#parseJSONFile(backupStream, METADATA_FILE_PATH); } async getSchemas() { - // const schemas = await collect(this.streamSchemas() as Readable); + const schemas = await collect(this.streamSchemas() as Readable); - // return keyBy('uid', schemas); - return null; + return keyBy('uid', schemas); } streamEntities(): NodeJS.ReadableStream {