@transcend-io/cli 6.23.1 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -32
- package/build/cli-request-download-files.d.ts +3 -0
- package/build/cli-request-download-files.d.ts.map +1 -0
- package/build/cli-request-download-files.js +77 -0
- package/build/cli-request-download-files.js.map +1 -0
- package/build/cli-skip-preflight-jobs.d.ts +3 -0
- package/build/cli-skip-preflight-jobs.d.ts.map +1 -0
- package/build/cli-skip-preflight-jobs.js +53 -0
- package/build/cli-skip-preflight-jobs.js.map +1 -0
- package/build/codecs.d.ts +8 -0
- package/build/codecs.d.ts.map +1 -1
- package/build/graphql/fetchAllPrivacyCenters.d.ts +0 -2
- package/build/graphql/fetchAllPrivacyCenters.d.ts.map +1 -1
- package/build/graphql/fetchAllPrivacyCenters.js.map +1 -1
- package/build/graphql/fetchAllRequests.d.ts +6 -1
- package/build/graphql/fetchAllRequests.d.ts.map +1 -1
- package/build/graphql/fetchAllRequests.js +9 -2
- package/build/graphql/fetchAllRequests.js.map +1 -1
- package/build/graphql/fetchConsentManagerId.d.ts +0 -8
- package/build/graphql/fetchConsentManagerId.d.ts.map +1 -1
- package/build/graphql/fetchConsentManagerId.js.map +1 -1
- package/build/graphql/gqls/RequestEnricher.d.ts +1 -0
- package/build/graphql/gqls/RequestEnricher.d.ts.map +1 -1
- package/build/graphql/gqls/RequestEnricher.js +10 -1
- package/build/graphql/gqls/RequestEnricher.js.map +1 -1
- package/build/graphql/gqls/privacyCenter.d.ts.map +1 -1
- package/build/graphql/gqls/privacyCenter.js +0 -1
- package/build/graphql/gqls/privacyCenter.js.map +1 -1
- package/build/graphql/pullTranscendConfiguration.d.ts.map +1 -1
- package/build/graphql/pullTranscendConfiguration.js +0 -1
- package/build/graphql/pullTranscendConfiguration.js.map +1 -1
- package/build/graphql/syncPrivacyCenter.d.ts.map +1 -1
- package/build/graphql/syncPrivacyCenter.js +0 -3
- package/build/graphql/syncPrivacyCenter.js.map +1 -1
- package/build/preference-management/codecs.d.ts +22 -4
- package/build/preference-management/codecs.d.ts.map +1 -1
- package/build/requests/bulkRestartRequests.d.ts.map +1 -1
- package/build/requests/bulkRestartRequests.js +1 -3
- package/build/requests/bulkRestartRequests.js.map +1 -1
- package/build/requests/bulkRetryEnrichers.d.ts.map +1 -1
- package/build/requests/bulkRetryEnrichers.js +2 -3
- package/build/requests/bulkRetryEnrichers.js.map +1 -1
- package/build/requests/cancelPrivacyRequests.d.ts.map +1 -1
- package/build/requests/cancelPrivacyRequests.js +2 -5
- package/build/requests/cancelPrivacyRequests.js.map +1 -1
- package/build/requests/downloadPrivacyRequestFiles.d.ts +30 -0
- package/build/requests/downloadPrivacyRequestFiles.d.ts.map +1 -0
- package/build/requests/downloadPrivacyRequestFiles.js +96 -0
- package/build/requests/downloadPrivacyRequestFiles.js.map +1 -0
- package/build/requests/getFileMetadataForPrivacyRequests.d.ts +157 -0
- package/build/requests/getFileMetadataForPrivacyRequests.d.ts.map +1 -0
- package/build/requests/getFileMetadataForPrivacyRequests.js +159 -0
- package/build/requests/getFileMetadataForPrivacyRequests.js.map +1 -0
- package/build/requests/index.d.ts +4 -0
- package/build/requests/index.d.ts.map +1 -1
- package/build/requests/index.js +4 -0
- package/build/requests/index.js.map +1 -1
- package/build/requests/markSilentPrivacyRequests.d.ts.map +1 -1
- package/build/requests/markSilentPrivacyRequests.js +2 -5
- package/build/requests/markSilentPrivacyRequests.js.map +1 -1
- package/build/requests/notifyPrivacyRequestsAdditionalTime.d.ts.map +1 -1
- package/build/requests/notifyPrivacyRequestsAdditionalTime.js +1 -4
- package/build/requests/notifyPrivacyRequestsAdditionalTime.js.map +1 -1
- package/build/requests/skipPreflightJobs.d.ts +20 -0
- package/build/requests/skipPreflightJobs.d.ts.map +1 -0
- package/build/requests/skipPreflightJobs.js +73 -0
- package/build/requests/skipPreflightJobs.js.map +1 -0
- package/build/requests/streamPrivacyRequestFiles.d.ts +22 -0
- package/build/requests/streamPrivacyRequestFiles.d.ts.map +1 -0
- package/build/requests/streamPrivacyRequestFiles.js +48 -0
- package/build/requests/streamPrivacyRequestFiles.js.map +1 -0
- package/build/tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancelPrivacyRequests.js","sourceRoot":"","sources":["../../src/requests/cancelPrivacyRequests.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,oDAA4B;AAC5B,sCAAmC;AACnC,+DAA2E;AAC3E,wCAQoB;AACpB,gEAAuC;AACvC,4CAAqD;AAErD;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,EAC1C,cAAc,EACd,iBAAiB,EACjB,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,QAAQ,GAAG;IACT,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,WAAW;IACzB,6BAAa,CAAC,OAAO;IACrB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,OAAO;IACrB,6BAAa,CAAC,kBAAkB;CACjC,EACD,WAAW,GAAG,EAAE,EAChB,YAAY,GAAG,iCAAqB,GAsBrC;IACC,4EAA4E;IAC5E,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,gBAAgB;IAChB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,kEAAkE;IAClE,MAAM,WAAW,GAAG,IAAI,sBAAW,CAAC,SAAS,CAC3C,EAAE,EACF,sBAAW,CAAC,OAAO,CAAC,cAAc,CACnC,CAAC;IAEF,oCAAoC;IACpC,IAAI,mBAAyC,CAAC;IAC9C,IAAI,iBAAiB,EAAE;QACrB,MAAM,iBAAiB,GAAG,MAAM,IAAA,2BAAiB,EAC/C,MAAM,EACN,iBAAiB,CAClB,CAAC;QACF,MAAM,eAAe,GAAG,iBAAiB,CAAC,IAAI,CAC5C,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,iBAAiB,CACnD,CAAC;QACF,IAAI,CAAC,eAAe,EAAE;YACpB,MAAM,IAAI,KAAK,CACb,0CAA0C,iBAAiB,GAAG,CAC/D,CAAC;SACH;QACD,mBAAmB,GAAG,eAAe,CAAC;KACvC;IAED,uBAAuB;IACvB,
|
|
1
|
+
{"version":3,"file":"cancelPrivacyRequests.js","sourceRoot":"","sources":["../../src/requests/cancelPrivacyRequests.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,oDAA4B;AAC5B,sCAAmC;AACnC,+DAA2E;AAC3E,wCAQoB;AACpB,gEAAuC;AACvC,4CAAqD;AAErD;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,EAC1C,cAAc,EACd,iBAAiB,EACjB,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,QAAQ,GAAG;IACT,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,WAAW;IACzB,6BAAa,CAAC,OAAO;IACrB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,OAAO;IACrB,6BAAa,CAAC,kBAAkB;CACjC,EACD,WAAW,GAAG,EAAE,EAChB,YAAY,GAAG,iCAAqB,GAsBrC;IACC,4EAA4E;IAC5E,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,gBAAgB;IAChB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,kEAAkE;IAClE,MAAM,WAAW,GAAG,IAAI,sBAAW,CAAC,SAAS,CAC3C,EAAE,EACF,sBAAW,CAAC,OAAO,CAAC,cAAc,CACnC,CAAC;IAEF,oCAAoC;I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ACf;aACF,CAAC,CAAC;SACJ;QAED,qBAAqB;QACrB,MAAM,IAAA,4BAAkB,EAAC,MAAM,EAAE,gCAAsB,EAAE;YACvD,KAAK,EAAE;gBACL,SAAS,EAAE,eAAe,CAAC,EAAE;gBAC7B,GAAG,CAAC,mBAAmB;oBACrB,CAAC,CAAC;wBACE,OAAO,EAAE,OAAO,mBAAmB,CAAC,OAAO,CAAC,cAAc,EAAE;wBAC5D,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,CAAC,cAAc;qBACtD;oBACH,CAAC,CAAC,EAAE,CAAC;aACR;SACF,CAAC,CAAC;QAEH,KAAK,IAAI,CAAC,CAAC;QACX,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,EACD,EAAE,WAAW,EAAE,CAChB,CAAC;IAEF,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC;IAE1B,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,yBAAyB,KAAK,iBAC5B,SAAS,GAAG,IACd,YAAY,CACb,CACF,CAAC;IACF,OAAO,WAAW,CAAC,MAAM,CAAC;AAC5B,CAAC;AA7ID,sDA6IC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RequestStatus } from '@transcend-io/privacy-types';
|
|
2
|
+
/**
|
|
3
|
+
* Download a set of privacy requests to disk
|
|
4
|
+
*
|
|
5
|
+
* @param options - Options
|
|
6
|
+
* @returns The number of requests canceled
|
|
7
|
+
*/
|
|
8
|
+
export declare function downloadPrivacyRequestFiles({ auth, folderPath, requestIds, createdAtBefore, sombraAuth, createdAtAfter, statuses, concurrency, transcendUrl, approveAfterDownload, }: {
|
|
9
|
+
/** The folder path to download the files to */
|
|
10
|
+
folderPath: string;
|
|
11
|
+
/** Transcend API key authentication */
|
|
12
|
+
auth: string;
|
|
13
|
+
/** Sombra API key authentication */
|
|
14
|
+
sombraAuth?: string;
|
|
15
|
+
/** Concurrency limit for approving */
|
|
16
|
+
concurrency?: number;
|
|
17
|
+
/** The request statuses to cancel */
|
|
18
|
+
statuses?: RequestStatus[];
|
|
19
|
+
/** The set of privacy requests to cancel */
|
|
20
|
+
requestIds?: string[];
|
|
21
|
+
/** Filter for requests created before this date */
|
|
22
|
+
createdAtBefore?: Date;
|
|
23
|
+
/** Filter for requests created after this date */
|
|
24
|
+
createdAtAfter?: Date;
|
|
25
|
+
/** API URL for Transcend backend */
|
|
26
|
+
transcendUrl?: string;
|
|
27
|
+
/** When true, approve any requests in Transcend that are in status=APPROVING */
|
|
28
|
+
approveAfterDownload?: boolean;
|
|
29
|
+
}): Promise<number>;
|
|
30
|
+
//# sourceMappingURL=downloadPrivacyRequestFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadPrivacyRequestFiles.d.ts","sourceRoot":"","sources":["../../src/requests/downloadPrivacyRequestFiles.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAa3E;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,IAAI,EACJ,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,cAAc,EACd,QAAgE,EAChE,WAAe,EACf,YAAoC,EACpC,oBAA4B,GAC7B,EAAE;IACD,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,mDAAmD;IACnD,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,kDAAkD;IAClD,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,GAAG,OAAO,CAAC,MAAM,CAAC,CAoGlB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.downloadPrivacyRequestFiles = void 0;
|
|
7
|
+
const bluebird_1 = require("bluebird");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const colors_1 = __importDefault(require("colors"));
|
|
11
|
+
const logger_1 = require("../logger");
|
|
12
|
+
const privacy_types_1 = require("@transcend-io/privacy-types");
|
|
13
|
+
const graphql_1 = require("../graphql");
|
|
14
|
+
const cli_progress_1 = __importDefault(require("cli-progress"));
|
|
15
|
+
const constants_1 = require("../constants");
|
|
16
|
+
const getFileMetadataForPrivacyRequests_1 = require("./getFileMetadataForPrivacyRequests");
|
|
17
|
+
const streamPrivacyRequestFiles_1 = require("./streamPrivacyRequestFiles");
|
|
18
|
+
/**
|
|
19
|
+
* Download a set of privacy requests to disk
|
|
20
|
+
*
|
|
21
|
+
* @param options - Options
|
|
22
|
+
* @returns The number of requests canceled
|
|
23
|
+
*/
|
|
24
|
+
async function downloadPrivacyRequestFiles({ auth, folderPath, requestIds, createdAtBefore, sombraAuth, createdAtAfter, statuses = [privacy_types_1.RequestStatus.Approving, privacy_types_1.RequestStatus.Downloadable], concurrency = 5, transcendUrl = constants_1.DEFAULT_TRANSCEND_API, approveAfterDownload = false, }) {
|
|
25
|
+
// Find all requests made before createdAt that are in a removing data state
|
|
26
|
+
const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
|
|
27
|
+
// Create sombra instance to communicate with
|
|
28
|
+
const sombra = await (0, graphql_1.createSombraGotInstance)(transcendUrl, auth, sombraAuth);
|
|
29
|
+
// Create the folder if it does not exist
|
|
30
|
+
if (!(0, fs_1.existsSync)(folderPath)) {
|
|
31
|
+
(0, fs_1.mkdirSync)(folderPath);
|
|
32
|
+
}
|
|
33
|
+
// Pull in the requests
|
|
34
|
+
const allRequests = await (0, graphql_1.fetchAllRequests)(client, {
|
|
35
|
+
actions: [privacy_types_1.RequestAction.Access],
|
|
36
|
+
createdAtBefore,
|
|
37
|
+
createdAtAfter,
|
|
38
|
+
statuses,
|
|
39
|
+
requestIds,
|
|
40
|
+
});
|
|
41
|
+
// Download the file metadata for each request
|
|
42
|
+
const requestFileMetadata = await (0, getFileMetadataForPrivacyRequests_1.getFileMetadataForPrivacyRequests)(allRequests, {
|
|
43
|
+
sombra,
|
|
44
|
+
concurrency,
|
|
45
|
+
});
|
|
46
|
+
// Start timer for download process
|
|
47
|
+
const t0 = new Date().getTime();
|
|
48
|
+
const progressBar = new cli_progress_1.default.SingleBar({}, cli_progress_1.default.Presets.shades_classic);
|
|
49
|
+
let total = 0;
|
|
50
|
+
let totalApproved = 0;
|
|
51
|
+
progressBar.start(allRequests.length, 0);
|
|
52
|
+
// Download the files for each request
|
|
53
|
+
await (0, bluebird_1.map)(requestFileMetadata, async ([request, metadata]) => {
|
|
54
|
+
// Create a new folder to store request files
|
|
55
|
+
const requestFolder = (0, path_1.join)(folderPath, request.id);
|
|
56
|
+
if (!(0, fs_1.existsSync)(requestFolder)) {
|
|
57
|
+
(0, fs_1.mkdirSync)(requestFolder);
|
|
58
|
+
}
|
|
59
|
+
// Stream each file to disk
|
|
60
|
+
await (0, streamPrivacyRequestFiles_1.streamPrivacyRequestFiles)(metadata, {
|
|
61
|
+
sombra,
|
|
62
|
+
requestId: request.id,
|
|
63
|
+
onFileDownloaded: (fil, stream) => {
|
|
64
|
+
// Ensure a folder exists for the file
|
|
65
|
+
// filename looks like Health/heartbeat.csv
|
|
66
|
+
const filePath = (0, path_1.join)(requestFolder, fil.fileName);
|
|
67
|
+
const folder = (0, path_1.dirname)(filePath);
|
|
68
|
+
if (!(0, fs_1.existsSync)(folder)) {
|
|
69
|
+
(0, fs_1.mkdirSync)(folder, { recursive: true });
|
|
70
|
+
}
|
|
71
|
+
// Write to disk
|
|
72
|
+
(0, fs_1.writeFileSync)(filePath, stream);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
// Approve the request if requested
|
|
76
|
+
if (approveAfterDownload && request.status === privacy_types_1.RequestStatus.Approving) {
|
|
77
|
+
await (0, graphql_1.makeGraphQLRequest)(client, graphql_1.APPROVE_PRIVACY_REQUEST, {
|
|
78
|
+
input: { requestId: request.id },
|
|
79
|
+
});
|
|
80
|
+
totalApproved += 1;
|
|
81
|
+
}
|
|
82
|
+
// Increment the progress bar
|
|
83
|
+
total += 1;
|
|
84
|
+
progressBar.update(total);
|
|
85
|
+
}, { concurrency });
|
|
86
|
+
progressBar.stop();
|
|
87
|
+
const t1 = new Date().getTime();
|
|
88
|
+
const totalTime = t1 - t0;
|
|
89
|
+
logger_1.logger.info(colors_1.default.green(`Successfully downloaded ${total} requests in "${totalTime / 1000}" seconds!`));
|
|
90
|
+
if (totalApproved > 0) {
|
|
91
|
+
logger_1.logger.info(colors_1.default.green(`Approved ${totalApproved} requests in Transcend.`));
|
|
92
|
+
}
|
|
93
|
+
return allRequests.length;
|
|
94
|
+
}
|
|
95
|
+
exports.downloadPrivacyRequestFiles = downloadPrivacyRequestFiles;
|
|
96
|
+
//# sourceMappingURL=downloadPrivacyRequestFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadPrivacyRequestFiles.js","sourceRoot":"","sources":["../../src/requests/downloadPrivacyRequestFiles.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,2BAA0D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AAO,CAAC,EAAE,EAAE;aACjC,CAAC,CAAC;YACH,aAAa,IAAI,CAAC,CAAC;SACpB;QAED,6BAA6B;QAC7B,KAAK,IAAI,CAAC,CAAC;QACX,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,EACD,EAAE,WAAW,EAAE,CAChB,CAAC;IAEF,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC;IAE1B,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,2BAA2B,KAAK,iBAC9B,SAAS,GAAG,IACd,YAAY,CACb,CACF,CAAC;IACF,IAAI,aAAa,GAAG,CAAC,EAAE;QACrB,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CAAC,YAAY,aAAa,yBAAyB,CAAC,CACjE,CAAC;KACH;IACD,OAAO,WAAW,CAAC,MAAM,CAAC;AAC5B,CAAC;AApID,kEAoIC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { PrivacyRequest } from '../graphql';
|
|
2
|
+
import * as t from 'io-ts';
|
|
3
|
+
import { Got } from 'got/dist/source';
|
|
4
|
+
export declare const IntlMessage: t.TypeC<{
|
|
5
|
+
/** The message key */
|
|
6
|
+
defaultMessage: t.StringC;
|
|
7
|
+
/** ID */
|
|
8
|
+
id: t.StringC;
|
|
9
|
+
}>;
|
|
10
|
+
/** Type */
|
|
11
|
+
export type IntlMessage = t.TypeOf<typeof IntlMessage>;
|
|
12
|
+
export declare const RequestFileMetadata: t.TypeC<{
|
|
13
|
+
/** The key to pass to download the file contents */
|
|
14
|
+
downloadKey: t.StringC;
|
|
15
|
+
/** Error message related to file */
|
|
16
|
+
error: t.UnionC<[t.NullC, t.StringC]>;
|
|
17
|
+
/** Mimetype of file */
|
|
18
|
+
mimetype: t.StringC;
|
|
19
|
+
/** Size of file, stored as string as this can be a BigInt */
|
|
20
|
+
size: t.StringC;
|
|
21
|
+
/** Name of file based on datapoint names in Transcend */
|
|
22
|
+
fileName: t.StringC;
|
|
23
|
+
/** The metadata on the datapoint */
|
|
24
|
+
dataPoint: t.TypeC<{
|
|
25
|
+
/** ID of datapoint */
|
|
26
|
+
id: t.StringC;
|
|
27
|
+
/** The title of datapoint */
|
|
28
|
+
title: t.UnionC<[t.TypeC<{
|
|
29
|
+
/** The message key */
|
|
30
|
+
defaultMessage: t.StringC;
|
|
31
|
+
/** ID */
|
|
32
|
+
id: t.StringC;
|
|
33
|
+
}>, t.NullC]>;
|
|
34
|
+
/** Description of datapoint */
|
|
35
|
+
description: t.UnionC<[t.TypeC<{
|
|
36
|
+
/** The message key */
|
|
37
|
+
defaultMessage: t.StringC;
|
|
38
|
+
/** ID */
|
|
39
|
+
id: t.StringC;
|
|
40
|
+
}>, t.NullC]>;
|
|
41
|
+
/** Name of datapoint */
|
|
42
|
+
name: t.StringC;
|
|
43
|
+
/** Slug of datapoint */
|
|
44
|
+
slug: t.StringC;
|
|
45
|
+
/** Table level encryption information */
|
|
46
|
+
encryption: t.UnionC<[t.KeyofC<{
|
|
47
|
+
UNENCRYPTED: unknown;
|
|
48
|
+
ENCRYPTED_APPLICATION_SIDE: unknown;
|
|
49
|
+
ENCRYPTED_DATA_AT_REST: unknown;
|
|
50
|
+
}>, t.NullC]>;
|
|
51
|
+
/** The name of the data silo */
|
|
52
|
+
dataSilo: t.TypeC<{
|
|
53
|
+
/** ID of the data silo */
|
|
54
|
+
id: t.StringC;
|
|
55
|
+
/** The title of the data silo */
|
|
56
|
+
title: t.StringC;
|
|
57
|
+
/** The description of the data silo */
|
|
58
|
+
description: t.StringC;
|
|
59
|
+
/** The type of the data silo */
|
|
60
|
+
type: t.StringC;
|
|
61
|
+
/** The outer type of the data silo */
|
|
62
|
+
outerType: t.UnionC<[t.StringC, t.NullC]>;
|
|
63
|
+
}>;
|
|
64
|
+
/** The path to the datapoint if a database (e.g. name of schema) */
|
|
65
|
+
path: t.ArrayC<t.StringC>;
|
|
66
|
+
}>;
|
|
67
|
+
}>;
|
|
68
|
+
/** Type override */
|
|
69
|
+
export type RequestFileMetadata = t.TypeOf<typeof RequestFileMetadata>;
|
|
70
|
+
export declare const RequestFileMetadataResponse: t.TypeC<{
|
|
71
|
+
/** The list of file metadata */
|
|
72
|
+
nodes: t.ArrayC<t.TypeC<{
|
|
73
|
+
/** The key to pass to download the file contents */
|
|
74
|
+
downloadKey: t.StringC;
|
|
75
|
+
/** Error message related to file */
|
|
76
|
+
error: t.UnionC<[t.NullC, t.StringC]>;
|
|
77
|
+
/** Mimetype of file */
|
|
78
|
+
mimetype: t.StringC;
|
|
79
|
+
/** Size of file, stored as string as this can be a BigInt */
|
|
80
|
+
size: t.StringC;
|
|
81
|
+
/** Name of file based on datapoint names in Transcend */
|
|
82
|
+
fileName: t.StringC;
|
|
83
|
+
/** The metadata on the datapoint */
|
|
84
|
+
dataPoint: t.TypeC<{
|
|
85
|
+
/** ID of datapoint */
|
|
86
|
+
id: t.StringC;
|
|
87
|
+
/** The title of datapoint */
|
|
88
|
+
title: t.UnionC<[t.TypeC<{
|
|
89
|
+
/** The message key */
|
|
90
|
+
defaultMessage: t.StringC;
|
|
91
|
+
/** ID */
|
|
92
|
+
id: t.StringC;
|
|
93
|
+
}>, t.NullC]>;
|
|
94
|
+
/** Description of datapoint */
|
|
95
|
+
description: t.UnionC<[t.TypeC<{
|
|
96
|
+
/** The message key */
|
|
97
|
+
defaultMessage: t.StringC;
|
|
98
|
+
/** ID */
|
|
99
|
+
id: t.StringC;
|
|
100
|
+
}>, t.NullC]>;
|
|
101
|
+
/** Name of datapoint */
|
|
102
|
+
name: t.StringC;
|
|
103
|
+
/** Slug of datapoint */
|
|
104
|
+
slug: t.StringC;
|
|
105
|
+
/** Table level encryption information */
|
|
106
|
+
encryption: t.UnionC<[t.KeyofC<{
|
|
107
|
+
UNENCRYPTED: unknown;
|
|
108
|
+
ENCRYPTED_APPLICATION_SIDE: unknown;
|
|
109
|
+
ENCRYPTED_DATA_AT_REST: unknown;
|
|
110
|
+
}>, t.NullC]>;
|
|
111
|
+
/** The name of the data silo */
|
|
112
|
+
dataSilo: t.TypeC<{
|
|
113
|
+
/** ID of the data silo */
|
|
114
|
+
id: t.StringC;
|
|
115
|
+
/** The title of the data silo */
|
|
116
|
+
title: t.StringC;
|
|
117
|
+
/** The description of the data silo */
|
|
118
|
+
description: t.StringC;
|
|
119
|
+
/** The type of the data silo */
|
|
120
|
+
type: t.StringC;
|
|
121
|
+
/** The outer type of the data silo */
|
|
122
|
+
outerType: t.UnionC<[t.StringC, t.NullC]>;
|
|
123
|
+
}>;
|
|
124
|
+
/** The path to the datapoint if a database (e.g. name of schema) */
|
|
125
|
+
path: t.ArrayC<t.StringC>;
|
|
126
|
+
}>;
|
|
127
|
+
}>>;
|
|
128
|
+
/** The total number of file metadata */
|
|
129
|
+
totalCount: t.NumberC;
|
|
130
|
+
/** Links to next pages */
|
|
131
|
+
_links: t.PartialC<{
|
|
132
|
+
/** The link to the next page of file metadata */
|
|
133
|
+
next: t.UnionC<[t.StringC, t.NullC]>;
|
|
134
|
+
/** The link to the previous page of file metadata */
|
|
135
|
+
previous: t.UnionC<[t.StringC, t.NullC]>;
|
|
136
|
+
}>;
|
|
137
|
+
}>;
|
|
138
|
+
/** Type override */
|
|
139
|
+
export type RequestFileMetadataResponse = t.TypeOf<typeof RequestFileMetadataResponse>;
|
|
140
|
+
/**
|
|
141
|
+
* Given a list of privacy requests, download the file metadata
|
|
142
|
+
* for these requests - this is useful to prepare the files in a
|
|
143
|
+
* data access request for download.
|
|
144
|
+
*
|
|
145
|
+
* @param requests - The list of privacy requests to download files for
|
|
146
|
+
* @param options - Options
|
|
147
|
+
* @returns The number of requests canceled
|
|
148
|
+
*/
|
|
149
|
+
export declare function getFileMetadataForPrivacyRequests(requests: Pick<PrivacyRequest, 'id' | 'status'>[], { sombra, concurrency, limit, }: {
|
|
150
|
+
/** Sombra instance */
|
|
151
|
+
sombra: Got;
|
|
152
|
+
/** Number of files to pull at once */
|
|
153
|
+
limit?: number;
|
|
154
|
+
/** Concurrency limit for approving */
|
|
155
|
+
concurrency?: number;
|
|
156
|
+
}): Promise<[Pick<PrivacyRequest, 'id' | 'status'>, RequestFileMetadata[]][]>;
|
|
157
|
+
//# sourceMappingURL=getFileMetadataForPrivacyRequests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFileMetadataForPrivacyRequests.d.ts","sourceRoot":"","sources":["../../src/requests/getFileMetadataForPrivacyRequests.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAKtC,eAAO,MAAM,WAAW;IACtB,sBAAsB;;IAEtB,SAAS;;EAET,CAAC;AAEH,WAAW;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAEvD,eAAO,MAAM,mBAAmB;IAC9B,oDAAoD;;IAEpD,oCAAoC;;IAEpC,uBAAuB;;IAEvB,6DAA6D;;IAE7D,yDAAyD;;IAEzD,oCAAoC;;QAElC,sBAAsB;;QAEtB,6BAA6B;;YAxB/B,sBAAsB;;YAEtB,SAAS;;;QAwBP,+BAA+B;;YA1BjC,sBAAsB;;YAEtB,SAAS;;;QA0BP,wBAAwB;;QAExB,wBAAwB;;QAExB,yCAAyC;;;;;;QAEzC,gCAAgC;;YAE9B,0BAA0B;;YAE1B,iCAAiC;;YAEjC,uCAAuC;;YAEvC,gCAAgC;;YAEhC,sCAAsC;;;QAGxC,oEAAoE;;;EAGtE,CAAC;AAEH,oBAAoB;AACpB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEvE,eAAO,MAAM,2BAA2B;IACtC,gCAAgC;;QA9ChC,oDAAoD;;QAEpD,oCAAoC;;QAEpC,uBAAuB;;QAEvB,6DAA6D;;QAE7D,yDAAyD;;QAEzD,oCAAoC;;YAElC,sBAAsB;;YAEtB,6BAA6B;;gBAxB/B,sBAAsB;;gBAEtB,SAAS;;;YAwBP,+BAA+B;;gBA1BjC,sBAAsB;;gBAEtB,SAAS;;;YA0BP,wBAAwB;;YAExB,wBAAwB;;YAExB,yCAAyC;;;;;;YAEzC,gCAAgC;;gBAE9B,0BAA0B;;gBAE1B,iCAAiC;;gBAEjC,uCAAuC;;gBAEvC,gCAAgC;;gBAEhC,sCAAsC;;;YAGxC,oEAAoE;;;;IAWtE,wCAAwC;;IAExC,0BAA0B;;QAExB,iDAAiD;;QAEjD,qDAAqD;;;EAGvD,CAAC;AAEH,oBAAoB;AACpB,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,2BAA2B,CACnC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,iCAAiC,CACrD,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,QAAQ,CAAC,EAAE,EACjD,EACE,MAAM,EACN,WAAe,EACf,KAAW,GACZ,EAAE;IACD,sBAAsB;IACtB,MAAM,EAAE,GAAG,CAAC;IACZ,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACA,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAmF3E"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.getFileMetadataForPrivacyRequests = exports.RequestFileMetadataResponse = exports.RequestFileMetadata = exports.IntlMessage = void 0;
|
|
30
|
+
const bluebird_1 = require("bluebird");
|
|
31
|
+
const colors_1 = __importDefault(require("colors"));
|
|
32
|
+
const cli_progress_1 = __importDefault(require("cli-progress"));
|
|
33
|
+
const t = __importStar(require("io-ts"));
|
|
34
|
+
const type_utils_1 = require("@transcend-io/type-utils");
|
|
35
|
+
const logger_1 = require("../logger");
|
|
36
|
+
const privacy_types_1 = require("@transcend-io/privacy-types");
|
|
37
|
+
exports.IntlMessage = t.type({
|
|
38
|
+
/** The message key */
|
|
39
|
+
defaultMessage: t.string,
|
|
40
|
+
/** ID */
|
|
41
|
+
id: t.string,
|
|
42
|
+
});
|
|
43
|
+
exports.RequestFileMetadata = t.type({
|
|
44
|
+
/** The key to pass to download the file contents */
|
|
45
|
+
downloadKey: t.string,
|
|
46
|
+
/** Error message related to file */
|
|
47
|
+
error: t.union([t.null, t.string]),
|
|
48
|
+
/** Mimetype of file */
|
|
49
|
+
mimetype: t.string,
|
|
50
|
+
/** Size of file, stored as string as this can be a BigInt */
|
|
51
|
+
size: t.string,
|
|
52
|
+
/** Name of file based on datapoint names in Transcend */
|
|
53
|
+
fileName: t.string,
|
|
54
|
+
/** The metadata on the datapoint */
|
|
55
|
+
dataPoint: t.type({
|
|
56
|
+
/** ID of datapoint */
|
|
57
|
+
id: t.string,
|
|
58
|
+
/** The title of datapoint */
|
|
59
|
+
title: t.union([exports.IntlMessage, t.null]),
|
|
60
|
+
/** Description of datapoint */
|
|
61
|
+
description: t.union([exports.IntlMessage, t.null]),
|
|
62
|
+
/** Name of datapoint */
|
|
63
|
+
name: t.string,
|
|
64
|
+
/** Slug of datapoint */
|
|
65
|
+
slug: t.string,
|
|
66
|
+
/** Table level encryption information */
|
|
67
|
+
encryption: t.union([(0, type_utils_1.valuesOf)(privacy_types_1.TableEncryptionType), t.null]),
|
|
68
|
+
/** The name of the data silo */
|
|
69
|
+
dataSilo: t.type({
|
|
70
|
+
/** ID of the data silo */
|
|
71
|
+
id: t.string,
|
|
72
|
+
/** The title of the data silo */
|
|
73
|
+
title: t.string,
|
|
74
|
+
/** The description of the data silo */
|
|
75
|
+
description: t.string,
|
|
76
|
+
/** The type of the data silo */
|
|
77
|
+
type: t.string,
|
|
78
|
+
/** The outer type of the data silo */
|
|
79
|
+
outerType: t.union([t.string, t.null]),
|
|
80
|
+
}),
|
|
81
|
+
/** The path to the datapoint if a database (e.g. name of schema) */
|
|
82
|
+
path: t.array(t.string),
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
exports.RequestFileMetadataResponse = t.type({
|
|
86
|
+
/** The list of file metadata */
|
|
87
|
+
nodes: t.array(exports.RequestFileMetadata),
|
|
88
|
+
/** The total number of file metadata */
|
|
89
|
+
totalCount: t.number,
|
|
90
|
+
/** Links to next pages */
|
|
91
|
+
_links: t.partial({
|
|
92
|
+
/** The link to the next page of file metadata */
|
|
93
|
+
next: t.union([t.string, t.null]),
|
|
94
|
+
/** The link to the previous page of file metadata */
|
|
95
|
+
previous: t.union([t.string, t.null]),
|
|
96
|
+
}),
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* Given a list of privacy requests, download the file metadata
|
|
100
|
+
* for these requests - this is useful to prepare the files in a
|
|
101
|
+
* data access request for download.
|
|
102
|
+
*
|
|
103
|
+
* @param requests - The list of privacy requests to download files for
|
|
104
|
+
* @param options - Options
|
|
105
|
+
* @returns The number of requests canceled
|
|
106
|
+
*/
|
|
107
|
+
async function getFileMetadataForPrivacyRequests(requests, { sombra, concurrency = 5, limit = 100, }) {
|
|
108
|
+
logger_1.logger.info(colors_1.default.magenta(`Pulling file metadata for ${requests.length} requests`));
|
|
109
|
+
// Time duration
|
|
110
|
+
const t0 = new Date().getTime();
|
|
111
|
+
// create a new progress bar instance and use shades_classic theme
|
|
112
|
+
const progressBar = new cli_progress_1.default.SingleBar({}, cli_progress_1.default.Presets.shades_classic);
|
|
113
|
+
// Start timer
|
|
114
|
+
let total = 0;
|
|
115
|
+
progressBar.start(requests.length, 0);
|
|
116
|
+
// Loop over the requests
|
|
117
|
+
const results = await (0, bluebird_1.map)(requests, async (requestToDownload) => {
|
|
118
|
+
var _a;
|
|
119
|
+
const localResults = [];
|
|
120
|
+
// Paginate over the file metadata for this request
|
|
121
|
+
let shouldContinue = true;
|
|
122
|
+
let offset = 0;
|
|
123
|
+
while (shouldContinue) {
|
|
124
|
+
let response;
|
|
125
|
+
try {
|
|
126
|
+
// Grab the file metadata for this request
|
|
127
|
+
// eslint-disable-next-line no-await-in-loop
|
|
128
|
+
const rawResponse = await sombra
|
|
129
|
+
.get(`v1/data-subject-request/${requestToDownload.id}/download-keys`, {
|
|
130
|
+
searchParams: {
|
|
131
|
+
limit,
|
|
132
|
+
offset,
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
.json();
|
|
136
|
+
response = (0, type_utils_1.decodeCodec)(exports.RequestFileMetadataResponse, rawResponse);
|
|
137
|
+
localResults.push(...response.nodes);
|
|
138
|
+
// Increase offset and break if no more pages
|
|
139
|
+
offset += limit;
|
|
140
|
+
shouldContinue =
|
|
141
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
142
|
+
!!response._links.next && response.nodes.length === limit;
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
throw new Error(`Received an error from server: ${((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.body) || (err === null || err === void 0 ? void 0 : err.message)}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
total += 1;
|
|
149
|
+
progressBar.update(total);
|
|
150
|
+
return [requestToDownload, localResults];
|
|
151
|
+
}, { concurrency });
|
|
152
|
+
progressBar.stop();
|
|
153
|
+
const t1 = new Date().getTime();
|
|
154
|
+
const totalTime = t1 - t0;
|
|
155
|
+
logger_1.logger.info(colors_1.default.green(`Successfully downloaded file metadata ${requests.length} requests in "${totalTime / 1000}" seconds!`));
|
|
156
|
+
return results;
|
|
157
|
+
}
|
|
158
|
+
exports.getFileMetadataForPrivacyRequests = getFileMetadataForPrivacyRequests;
|
|
159
|
+
//# sourceMappingURL=getFileMetadataForPrivacyRequests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFileMetadataForPrivacyRequests.js","sourceRoot":"","sources":["../../src/requests/getFileMetadataForPrivacyRequests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA+B;AAC/B,oDAA4B;AAC5B,gEAAuC;AAGvC,yCAA2B;AAE3B,yDAAiE;AACjE,s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,CAAC;aACH;SACF;QAED,KAAK,IAAI,CAAC,CAAC;QACX,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,OAAO,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;IAC3C,CAAC,EACD,EAAE,WAAW,EAAE,CAChB,CAAC;IAEF,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC;IAE1B,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,yCAAyC,QAAQ,CAAC,MAAM,iBACtD,SAAS,GAAG,IACd,YAAY,CACb,CACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAjGD,8EAiGC"}
|
|
@@ -10,16 +10,20 @@ export * from './markSilentPrivacyRequests';
|
|
|
10
10
|
export * from './mapCsvColumnsToApi';
|
|
11
11
|
export * from './mapRequestEnumValues';
|
|
12
12
|
export * from './mapCsvRowsToRequestInputs';
|
|
13
|
+
export * from './downloadPrivacyRequestFiles';
|
|
13
14
|
export * from './submitPrivacyRequest';
|
|
14
15
|
export * from './approvePrivacyRequests';
|
|
15
16
|
export * from './notifyPrivacyRequestsAdditionalTime';
|
|
16
17
|
export * from './mapColumnsToIdentifiers';
|
|
17
18
|
export * from './cancelPrivacyRequests';
|
|
18
19
|
export * from './mapColumnsToAttributes';
|
|
20
|
+
export * from './streamPrivacyRequestFiles';
|
|
19
21
|
export * from './extractClientError';
|
|
20
22
|
export * from './uploadPrivacyRequestsFromCsv';
|
|
21
23
|
export * from './bulkRestartRequests';
|
|
24
|
+
export * from './getFileMetadataForPrivacyRequests';
|
|
22
25
|
export * from './restartPrivacyRequest';
|
|
26
|
+
export * from './skipPreflightJobs';
|
|
23
27
|
export * from './bulkRetryEnrichers';
|
|
24
28
|
export * from './retryRequestDataSilos';
|
|
25
29
|
export * from './pullPrivacyRequests';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/requests/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/requests/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC"}
|
package/build/requests/index.js
CHANGED
|
@@ -26,16 +26,20 @@ __exportStar(require("./markSilentPrivacyRequests"), exports);
|
|
|
26
26
|
__exportStar(require("./mapCsvColumnsToApi"), exports);
|
|
27
27
|
__exportStar(require("./mapRequestEnumValues"), exports);
|
|
28
28
|
__exportStar(require("./mapCsvRowsToRequestInputs"), exports);
|
|
29
|
+
__exportStar(require("./downloadPrivacyRequestFiles"), exports);
|
|
29
30
|
__exportStar(require("./submitPrivacyRequest"), exports);
|
|
30
31
|
__exportStar(require("./approvePrivacyRequests"), exports);
|
|
31
32
|
__exportStar(require("./notifyPrivacyRequestsAdditionalTime"), exports);
|
|
32
33
|
__exportStar(require("./mapColumnsToIdentifiers"), exports);
|
|
33
34
|
__exportStar(require("./cancelPrivacyRequests"), exports);
|
|
34
35
|
__exportStar(require("./mapColumnsToAttributes"), exports);
|
|
36
|
+
__exportStar(require("./streamPrivacyRequestFiles"), exports);
|
|
35
37
|
__exportStar(require("./extractClientError"), exports);
|
|
36
38
|
__exportStar(require("./uploadPrivacyRequestsFromCsv"), exports);
|
|
37
39
|
__exportStar(require("./bulkRestartRequests"), exports);
|
|
40
|
+
__exportStar(require("./getFileMetadataForPrivacyRequests"), exports);
|
|
38
41
|
__exportStar(require("./restartPrivacyRequest"), exports);
|
|
42
|
+
__exportStar(require("./skipPreflightJobs"), exports);
|
|
39
43
|
__exportStar(require("./bulkRetryEnrichers"), exports);
|
|
40
44
|
__exportStar(require("./retryRequestDataSilos"), exports);
|
|
41
45
|
__exportStar(require("./pullPrivacyRequests"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/requests/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,8CAA4B;AAC5B,kDAAgC;AAChC,mDAAiC;AACjC,8DAA4C;AAC5C,4CAA0B;AAC1B,6DAA2C;AAC3C,+CAA6B;AAC7B,8DAA4C;AAC5C,uDAAqC;AACrC,yDAAuC;AACvC,8DAA4C;AAC5C,yDAAuC;AACvC,2DAAyC;AACzC,wEAAsD;AACtD,4DAA0C;AAC1C,0DAAwC;AACxC,2DAAyC;AACzC,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,0DAAwC;AACxC,uDAAqC;AACrC,0DAAwC;AACxC,wDAAsC;AACtC,yDAAuC;AACvC,uEAAqD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/requests/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,8CAA4B;AAC5B,kDAAgC;AAChC,mDAAiC;AACjC,8DAA4C;AAC5C,4CAA0B;AAC1B,6DAA2C;AAC3C,+CAA6B;AAC7B,8DAA4C;AAC5C,uDAAqC;AACrC,yDAAuC;AACvC,8DAA4C;AAC5C,gEAA8C;AAC9C,yDAAuC;AACvC,2DAAyC;AACzC,wEAAsD;AACtD,4DAA0C;AAC1C,0DAAwC;AACxC,2DAAyC;AACzC,8DAA4C;AAC5C,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,sEAAoD;AACpD,0DAAwC;AACxC,sDAAoC;AACpC,uDAAqC;AACrC,0DAAwC;AACxC,wDAAsC;AACtC,yDAAuC;AACvC,uEAAqD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markSilentPrivacyRequests.d.ts","sourceRoot":"","sources":["../../src/requests/markSilentPrivacyRequests.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAU3E;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,cAAc,EACd,IAAI,EACJ,UAAU,EACV,QASC,EACD,cAAc,EACd,eAAe,EACf,WAAiB,EACjB,YAAoC,GACrC,EAAE;IACD,mDAAmD;IACnD,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,mDAAmD;IACnD,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,kDAAkD;IAClD,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"markSilentPrivacyRequests.d.ts","sourceRoot":"","sources":["../../src/requests/markSilentPrivacyRequests.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAU3E;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,cAAc,EACd,IAAI,EACJ,UAAU,EACV,QASC,EACD,cAAc,EACd,eAAe,EACf,WAAiB,EACjB,YAAoC,GACrC,EAAE;IACD,mDAAmD;IACnD,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,mDAAmD;IACnD,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,kDAAkD;IAClD,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAyDlB"}
|
|
@@ -34,17 +34,14 @@ async function markSilentPrivacyRequests({ requestActions, auth, requestIds, sta
|
|
|
34
34
|
// create a new progress bar instance and use shades_classic theme
|
|
35
35
|
const progressBar = new cli_progress_1.default.SingleBar({}, cli_progress_1.default.Presets.shades_classic);
|
|
36
36
|
// Pull in the requests
|
|
37
|
-
|
|
37
|
+
const allRequests = await (0, graphql_1.fetchAllRequests)(client, {
|
|
38
38
|
actions: requestActions,
|
|
39
39
|
statuses,
|
|
40
40
|
createdAtBefore,
|
|
41
41
|
createdAtAfter,
|
|
42
42
|
isSilent: false,
|
|
43
|
+
requestIds,
|
|
43
44
|
});
|
|
44
|
-
// Filter down requests by request ID
|
|
45
|
-
if (requestIds && requestIds.length > 0) {
|
|
46
|
-
allRequests = allRequests.filter((request) => requestIds.includes(request.id));
|
|
47
|
-
}
|
|
48
45
|
// Notify Transcend
|
|
49
46
|
logger_1.logger.info(colors_1.default.magenta(`Marking "${allRequests.length}" as silent mode.`));
|
|
50
47
|
let total = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markSilentPrivacyRequests.js","sourceRoot":"","sources":["../../src/requests/markSilentPrivacyRequests.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,oDAA4B;AAC5B,sCAAmC;AACnC,+DAA2E;AAC3E,wCAKoB;AACpB,gEAAuC;AACvC,4CAAqD;AAErD;;;;;GAKG;AACI,KAAK,UAAU,yBAAyB,CAAC,EAC9C,cAAc,EACd,IAAI,EACJ,UAAU,EACV,QAAQ,GAAG;IACT,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,WAAW;IACzB,6BAAa,CAAC,OAAO;IACrB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,OAAO;IACrB,6BAAa,CAAC,kBAAkB;CACjC,EACD,cAAc,EACd,eAAe,EACf,WAAW,GAAG,GAAG,EACjB,YAAY,GAAG,iCAAqB,GAkBrC;IACC,4EAA4E;IAC5E,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,gBAAgB;IAChB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,kEAAkE;IAClE,MAAM,WAAW,GAAG,IAAI,sBAAW,CAAC,SAAS,CAC3C,EAAE,EACF,sBAAW,CAAC,OAAO,CAAC,cAAc,CACnC,CAAC;IAEF,uBAAuB;IACvB,
|
|
1
|
+
{"version":3,"file":"markSilentPrivacyRequests.js","sourceRoot":"","sources":["../../src/requests/markSilentPrivacyRequests.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,oDAA4B;AAC5B,sCAAmC;AACnC,+DAA2E;AAC3E,wCAKoB;AACpB,gEAAuC;AACvC,4CAAqD;AAErD;;;;;GAKG;AACI,KAAK,UAAU,yBAAyB,CAAC,EAC9C,cAAc,EACd,IAAI,EACJ,UAAU,EACV,QAAQ,GAAG;IACT,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,WAAW;IACzB,6BAAa,CAAC,OAAO;IACrB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,SAAS;IACvB,6BAAa,CAAC,OAAO;IACrB,6B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GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC;IAE1B,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,uBAAuB,KAAK,gCAC1B,SAAS,GAAG,IACd,YAAY,CACb,CACF,CAAC;IACF,OAAO,WAAW,CAAC,MAAM,CAAC;AAC5B,CAAC;AA5FD,8DA4FC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyPrivacyRequestsAdditionalTime.d.ts","sourceRoot":"","sources":["../../src/requests/notifyPrivacyRequestsAdditionalTime.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAW5D;;;;;;GAMG;AACH,wBAAsB,mCAAmC,CAAC,EACxD,cAA6C,EAC7C,IAAI,EACJ,UAAU,EACV,eAAe,EACf,IAAS,EACT,QAAa,EACb,cAAc,EACd,aAAwC,EACxC,WAAiB,EACjB,YAAoC,GACrC,EAAE;IACD,mDAAmD;IACnD,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,mDAAmD;IACnD,eAAe,EAAE,IAAI,CAAC;IACtB,kDAAkD;IAClD,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"notifyPrivacyRequestsAdditionalTime.d.ts","sourceRoot":"","sources":["../../src/requests/notifyPrivacyRequestsAdditionalTime.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAW5D;;;;;;GAMG;AACH,wBAAsB,mCAAmC,CAAC,EACxD,cAA6C,EAC7C,IAAI,EACJ,UAAU,EACV,eAAe,EACf,IAAS,EACT,QAAa,EACb,cAAc,EACd,aAAwC,EACxC,WAAiB,EACjB,YAAoC,GACrC,EAAE;IACD,mDAAmD;IACnD,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,mDAAmD;IACnD,eAAe,EAAE,IAAI,CAAC;IACtB,kDAAkD;IAClD,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ElB"}
|
|
@@ -38,11 +38,8 @@ async function notifyPrivacyRequestsAdditionalTime({ requestActions = Object.val
|
|
|
38
38
|
createdAtAfter,
|
|
39
39
|
isSilent: false,
|
|
40
40
|
isClosed: false,
|
|
41
|
+
requestIds,
|
|
41
42
|
});
|
|
42
|
-
// Filter down requests by request ID
|
|
43
|
-
if (requestIds && requestIds.length > 0) {
|
|
44
|
-
allRequests = allRequests.filter((request) => requestIds.includes(request.id));
|
|
45
|
-
}
|
|
46
43
|
// Filter requests by daysLeft
|
|
47
44
|
allRequests = allRequests.filter((request) => typeof request.daysRemaining === 'number' &&
|
|
48
45
|
request.daysRemaining < daysLeft);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyPrivacyRequestsAdditionalTime.js","sourceRoot":"","sources":["../../src/requests/notifyPrivacyRequestsAdditionalTime.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,oDAA4B;AAC5B,sCAAmC;AACnC,+DAA4D;AAC5D,wCAMoB;AACpB,gEAAuC;AACvC,4CAAqD;AAErD;;;;;;GAMG;AACI,KAAK,UAAU,mCAAmC,CAAC,EACxD,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,EAC7C,IAAI,EACJ,UAAU,EACV,eAAe,EACf,IAAI,GAAG,EAAE,EACT,QAAQ,GAAG,EAAE,EACb,cAAc,EACd,aAAa,GAAG,wBAAwB,EACxC,WAAW,GAAG,GAAG,EACjB,YAAY,GAAG,iCAAqB,GAyBrC;IACC,4EAA4E;IAC5E,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,gBAAgB;IAChB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,kEAAkE;IAClE,MAAM,WAAW,GAAG,IAAI,sBAAW,CAAC,SAAS,CAC3C,EAAE,EACF,sBAAW,CAAC,OAAO,CAAC,cAAc,CACnC,CAAC;IAEF,oCAAoC;IACpC,MAAM,iBAAiB,GAAG,MAAM,IAAA,2BAAiB,EAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACzE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,IAAI,CAC/C,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,aAAa,CAC/C,CAAC;IACF,IAAI,CAAC,kBAAkB,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,0CAA0C,aAAa,GAAG,CAAC,CAAC;KAC7E;IAED,uBAAuB;IACvB,IAAI,WAAW,GAAG,MAAM,IAAA,0BAAgB,EAAC,MAAM,EAAE;QAC/C,OAAO,EAAE,cAAc;QACvB,eAAe;QACf,cAAc;QACd,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"notifyPrivacyRequestsAdditionalTime.js","sourceRoot":"","sources":["../../src/requests/notifyPrivacyRequestsAdditionalTime.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,oDAA4B;AAC5B,sCAAmC;AACnC,+DAA4D;AAC5D,wCAMoB;AACpB,gEAAuC;AACvC,4CAAqD;AAErD;;;;;;GAMG;AACI,KAAK,UAAU,mCAAmC,CAAC,EACxD,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,EAC7C,IAAI,EACJ,UAAU,EACV,eAAe,EACf,IAAI,GAAG,EAAE,EACT,QAAQ,GAAG,EAAE,EACb,cAAc,EACd,aAAa,GAAG,wBAAwB,EACxC,WAAW,GAAG,GAAG,EACjB,YAAY,GAAG,iCAAqB,GAyBrC;IACC,4EAA4E;IAC5E,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,gBAAgB;IAChB,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAChC,kEAAkE;IAClE,MAAM,WAAW,GAAG,IAAI,sBAAW,CAAC,SAAS,CAC3C,EAAE,EACF,sBAAW,CAAC,OAAO,CAAC,cAAc,CACnC,CAAC;IAEF,oCAAoC;IACpC,MAAM,iBAAiB,GAAG,MAAM,IAAA,2BAAiB,EAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACzE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,IAAI,CAC/C,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,aAAa,CAC/C,CAAC;IACF,IAAI,CAAC,kBAAkB,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,0CAA0C,a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EAAE,CAAC;IAE1B,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,uBAAuB,KAAK,gCAC1B,SAAS,GAAG,IACd,YAAY,CACb,CACF,CAAC;IACF,OAAO,WAAW,CAAC,MAAM,CAAC;AAC5B,CAAC;AAhHD,kFAgHC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RequestStatus } from '@transcend-io/privacy-types';
|
|
2
|
+
/**
|
|
3
|
+
* Given an enricher ID, mark all open request enrichers as skipped
|
|
4
|
+
*
|
|
5
|
+
* @param options - Options
|
|
6
|
+
* @returns Number of items skipped
|
|
7
|
+
*/
|
|
8
|
+
export declare function skipPreflightJobs({ enricherIds, auth, concurrency, transcendUrl, }: {
|
|
9
|
+
/** Transcend API key authentication */
|
|
10
|
+
auth: string;
|
|
11
|
+
/** Enricher IDs to pull down jobs for */
|
|
12
|
+
enricherIds: string[];
|
|
13
|
+
/** Upload concurrency */
|
|
14
|
+
concurrency?: number;
|
|
15
|
+
/** API URL for Transcend backend */
|
|
16
|
+
transcendUrl?: string;
|
|
17
|
+
/** Request statuses to mark as completed */
|
|
18
|
+
requestStatuses?: RequestStatus[];
|
|
19
|
+
}): Promise<number>;
|
|
20
|
+
//# sourceMappingURL=skipPreflightJobs.d.ts.map
|