diff --git a/package.json b/package.json index e2c927e9..f62a209d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Transcend Inc.", "name": "@transcend-io/cli", "description": "Small package containing useful typescript utilities.", - "version": "6.13.0", + "version": "6.13.1", "homepage": "https://github.com/transcend-io/cli", "repository": { "type": "git", diff --git a/src/cli-cron-pull-profiles.ts b/src/cli-cron-pull-profiles.ts index 8b71967b..6c40615b 100644 --- a/src/cli-cron-pull-profiles.ts +++ b/src/cli-cron-pull-profiles.ts @@ -131,16 +131,26 @@ async function main(): Promise { const results = await map( uniq(requestIds), async (requestId) => { - const results = await fetchRequestFilesForRequest(client, { requestId }); - return results.map(({ fileName, remoteId }) => ({ - RecordId: remoteId, - Object: fileName - .replace('.json', '') - .split('/') - .pop() - ?.replace(' Information', ''), - Comment: 'Customer data deletion request submitted via transcend.io', - })); + const results = await fetchRequestFilesForRequest(client, { + requestId, + dataSiloId: targetDataSiloId, + }); + return results.map(({ fileName, remoteId }) => { + if (!remoteId) { + throw new Error( + `Failed to find remoteId for ${fileName} request: ${requestId}`, + ); + } + return { + RecordId: remoteId, + Object: fileName + .replace('.json', '') + .split('/') + .pop() + ?.replace(' Information', ''), + Comment: 'Customer data deletion request submitted via transcend.io', + }; + }); }, { concurrency: 10, diff --git a/src/graphql/fetchRequestFilesForRequest.ts b/src/graphql/fetchRequestFilesForRequest.ts index b321e855..7bf55acb 100644 --- a/src/graphql/fetchRequestFilesForRequest.ts +++ b/src/graphql/fetchRequestFilesForRequest.ts @@ -23,6 +23,8 @@ export async function fetchRequestFilesForRequest( filterBy: { /** Filter by request ID */ requestId: string; + /** Filter by data silo ID */ + dataSiloId?: string; }, ): Promise { const requestFiles: RequestFile[] = [];