Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes pull profile to only pull files for the specified data silo #378

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
30 changes: 20 additions & 10 deletions src/cli-cron-pull-profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,26 @@ async function main(): Promise<void> {
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,
Expand Down
2 changes: 2 additions & 0 deletions src/graphql/fetchRequestFilesForRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export async function fetchRequestFilesForRequest(
filterBy: {
/** Filter by request ID */
requestId: string;
/** Filter by data silo ID */
dataSiloId?: string;
},
): Promise<RequestFile[]> {
const requestFiles: RequestFile[] = [];
Expand Down
Loading