@transcend-io/cli 6.26.2 → 6.26.4
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 +17 -0
- package/build/cli-cron-pull-identifiers.js +25 -6
- package/build/cli-cron-pull-identifiers.js.map +1 -1
- package/build/cli-sync-ot.js +1 -1
- package/build/codecs.d.ts +2 -0
- package/build/codecs.d.ts.map +1 -1
- package/build/cron/writeCsv.d.ts +9 -0
- package/build/cron/writeCsv.d.ts.map +1 -1
- package/build/cron/writeCsv.js +36 -1
- package/build/cron/writeCsv.js.map +1 -1
- package/build/oneTrust/helpers/syncOneTrustAssessmentsFromOneTrust.js +3 -3
- package/build/oneTrust/helpers/syncOneTrustAssessmentsFromOneTrust.js.map +1 -1
- package/build/tsbuildinfo +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1752,6 +1752,9 @@ yarn tr-request-export --auth=$TRANSCEND_API_KEY --file=./path/to/file.csv
|
|
|
1752
1752
|
If you are using the cron job integration, you can run this command to pull the outstanding identifiers
|
|
1753
1753
|
for the data silo to a CSV.
|
|
1754
1754
|
|
|
1755
|
+
For large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits.
|
|
1756
|
+
Use the `--chunkSize` parameter to control the maximum number of rows per file.
|
|
1757
|
+
|
|
1755
1758
|
Read more at https://docs.transcend.io/docs/integrations/cron-job-integration.
|
|
1756
1759
|
|
|
1757
1760
|
https://user-images.githubusercontent.com/10264973/205483055-f4050645-bdf5-4ea2-8464-3183abd63074.mov
|
|
@@ -1774,6 +1777,7 @@ The API key must be associated to the ID of the integration/data silo that is be
|
|
|
1774
1777
|
| sombraAuth | The sombra internal key, use for additional authentication when self-hosting sombra. | string | N/A | false |
|
|
1775
1778
|
| pageLimit | The page limit to use when pulling in pages of identifiers. | number | 100 | false |
|
|
1776
1779
|
| skipRequestCount | Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers. | boolean | false | false |
|
|
1780
|
+
| chunkSize | Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows. | number | 100000 | false |
|
|
1777
1781
|
|
|
1778
1782
|
#### Usage
|
|
1779
1783
|
|
|
@@ -1809,6 +1813,19 @@ yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf
|
|
|
1809
1813
|
--pageLimit=300
|
|
1810
1814
|
```
|
|
1811
1815
|
|
|
1816
|
+
Specifying the chunk size for large datasets to avoid file size limits (defaults to 100,000 rows per file).
|
|
1817
|
+
|
|
1818
|
+
```sh
|
|
1819
|
+
yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --actions=ERASURE \
|
|
1820
|
+
--chunkSize=50000
|
|
1821
|
+
```
|
|
1822
|
+
|
|
1823
|
+
**Note:** For large datasets exceeding the chunk size, multiple CSV files will be created automatically:
|
|
1824
|
+
|
|
1825
|
+
- `filename_part01_of_05.csv` (50,000 rows)
|
|
1826
|
+
- `filename_part02_of_05.csv` (50,000 rows)
|
|
1827
|
+
- ... and so on
|
|
1828
|
+
|
|
1812
1829
|
### tr-cron-mark-identifiers-completed
|
|
1813
1830
|
|
|
1814
1831
|
This command takes the output of `tr-cron-pull-identifiers` and notifies Transcend that all of the requests in the CSV have been processed.
|
|
@@ -15,23 +15,28 @@ const requests_1 = require("./requests");
|
|
|
15
15
|
/**
|
|
16
16
|
* Pull the set of active identifiers for a cron job silo.
|
|
17
17
|
*
|
|
18
|
+
* For large datasets, the output will be automatically split into multiple CSV files
|
|
19
|
+
* to avoid file system size limits. Use --chunkSize to control the number of rows per file.
|
|
20
|
+
*
|
|
18
21
|
* Requires an API key with scope for the cron integration being checked on.
|
|
19
22
|
*
|
|
20
23
|
* Dev Usage:
|
|
21
24
|
* yarn ts-node ./src/cli-cron-pull-identifiers.ts --auth=$TRANSCEND_API_KEY \
|
|
22
25
|
* --dataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
|
|
23
26
|
* --actions=ERASURE \
|
|
24
|
-
* --file=/Users/michaelfarrell/Desktop/test.csv
|
|
27
|
+
* --file=/Users/michaelfarrell/Desktop/test.csv \
|
|
28
|
+
* --chunkSize=100000
|
|
25
29
|
*
|
|
26
30
|
* Standard usage:
|
|
27
31
|
* yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY \
|
|
28
32
|
* --dataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
|
|
29
33
|
* --actions=ERASURE \
|
|
30
|
-
* --file=/Users/michaelfarrell/Desktop/test.csv
|
|
34
|
+
* --file=/Users/michaelfarrell/Desktop/test.csv \
|
|
35
|
+
* --chunkSize=100000
|
|
31
36
|
*/
|
|
32
37
|
async function main() {
|
|
33
38
|
// Parse command line arguments
|
|
34
|
-
const { file = './cron-identifiers.csv', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, sombraAuth, dataSiloId, actions, pageLimit = '100', skipRequestCount = false, } = (0, yargs_parser_1.default)(process.argv.slice(2));
|
|
39
|
+
const { file = './cron-identifiers.csv', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, sombraAuth, dataSiloId, actions, pageLimit = '100', skipRequestCount = false, chunkSize = '100000', } = (0, yargs_parser_1.default)(process.argv.slice(2));
|
|
35
40
|
// Ensure auth is passed
|
|
36
41
|
if (!auth) {
|
|
37
42
|
logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
|
|
@@ -58,6 +63,12 @@ async function main() {
|
|
|
58
63
|
`Expected one of: \n${Object.values(privacy_types_1.RequestAction).join('\n')}`));
|
|
59
64
|
process.exit(1);
|
|
60
65
|
}
|
|
66
|
+
// Validate chunk size
|
|
67
|
+
const parsedChunkSize = parseInt(chunkSize, 10);
|
|
68
|
+
if (Number.isNaN(parsedChunkSize) || parsedChunkSize <= 0) {
|
|
69
|
+
logger_1.logger.error(colors_1.default.red(`Invalid chunk size: "${chunkSize}". Must be a positive integer.`));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
61
72
|
// Pull down outstanding identifiers
|
|
62
73
|
const { identifiersFormattedForCsv } = await (0, cron_1.pullCustomSiloOutstandingIdentifiers)({
|
|
63
74
|
transcendUrl,
|
|
@@ -68,10 +79,18 @@ async function main() {
|
|
|
68
79
|
dataSiloId,
|
|
69
80
|
skipRequestCount: skipRequestCount === 'true',
|
|
70
81
|
});
|
|
71
|
-
// Write CSV
|
|
82
|
+
// Write CSV (split into multiple files if too large)
|
|
72
83
|
const headers = (0, uniq_1.default)(identifiersFormattedForCsv.map((d) => Object.keys(d)).flat());
|
|
73
|
-
(0, cron_1.
|
|
74
|
-
|
|
84
|
+
const writtenFiles = await (0, cron_1.writeLargeCsv)(file, identifiersFormattedForCsv, headers, parsedChunkSize);
|
|
85
|
+
if (writtenFiles.length === 1) {
|
|
86
|
+
logger_1.logger.info(colors_1.default.green(`Successfully wrote ${identifiersFormattedForCsv.length} identifiers to file "${file}"`));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
logger_1.logger.info(colors_1.default.green(`Successfully wrote ${identifiersFormattedForCsv.length} identifiers to ${writtenFiles.length} files:`));
|
|
90
|
+
writtenFiles.forEach((fileName) => {
|
|
91
|
+
logger_1.logger.info(colors_1.default.green(` - ${fileName}`));
|
|
92
|
+
});
|
|
93
|
+
}
|
|
75
94
|
}
|
|
76
95
|
main();
|
|
77
96
|
//# sourceMappingURL=cli-cron-pull-identifiers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-cron-pull-identifiers.js","sourceRoot":"","sources":["../src/cli-cron-pull-identifiers.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,uDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"cli-cron-pull-identifiers.js","sourceRoot":"","sources":["../src/cli-cron-pull-identifiers.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,uDAA+B;AAC/B,iCAA6E;AAC7E,+DAA4D;AAC5D,2CAAoD;AACpD,yCAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,GAAG,wBAAwB,EAC/B,YAAY,GAAG,iCAAqB,EACpC,IAAI,EACJ,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,gBAAgB,GAAG,KAAK,EACxB,SAAS,GAAG,QAAQ,GACrB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,IAAI,CAAC,UAAU,EAAE;QACf,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,0GAA0G,CAC3G,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,IAAI,CAAC,OAAO,EAAE;QACZ,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,+EAA+E,CAChF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,IAAI,gBAAgB,KAAK,MAAM,EAAE;QAC/B,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,MAAM,CACX,uEAAuE,CACxE,CACF,CAAC;KACH;IAED,mBAAmB;IACnB,MAAM,aAAa,GAAG,IAAA,yBAAc,EAAC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C,CAAC,IAAI,EAAE,CAC7D,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,IAAA,oBAAa,EACtC,IAAI,EACJ,0BAA0B,EAC1B,OAAO,EACP,eAAe,CAChB,CAAC;IAEF,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,sBAAsB,0BAA0B,CAAC,MAAM,yBAAyB,IAAI,GAAG,CACxF,CACF,CAAC;KACH;SAAM;QACL,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,sBAAsB,0BAA0B,CAAC,MAAM,mBAAmB,YAAY,CAAC,MAAM,SAAS,CACvG,CACF,CAAC;QACF,YAAY,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChC,eAAM,CAAC,IAAI,CAAC,gBAAM,CAAC,KAAK,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/build/cli-sync-ot.js
CHANGED
|
@@ -11,7 +11,7 @@ const enums_1 = require("./enums");
|
|
|
11
11
|
const graphql_1 = require("./graphql");
|
|
12
12
|
const helpers_1 = require("./oneTrust/helpers");
|
|
13
13
|
/**
|
|
14
|
-
* Pull
|
|
14
|
+
* Pull resources from OneTrust to Transcend or locally to disk
|
|
15
15
|
*
|
|
16
16
|
* Dev Usage:
|
|
17
17
|
* yarn ts-node ./src/cli-sync-ot.ts --hostname=customer.my.onetrust.com --oneTrustAuth=$ONE_TRUST_OAUTH_TOKEN --transcendAuth=$TRANSCEND_API_KEY
|
package/build/codecs.d.ts
CHANGED
|
@@ -190,6 +190,7 @@ export declare const EnricherInput: t.IntersectionC<[t.TypeC<{
|
|
|
190
190
|
LOOKER: unknown;
|
|
191
191
|
WAIT_PERIOD: unknown;
|
|
192
192
|
GOVERNMENT_ID: unknown;
|
|
193
|
+
CUSTOM_FUNCTION: unknown;
|
|
193
194
|
email: unknown;
|
|
194
195
|
phone: unknown;
|
|
195
196
|
SOMBRA: unknown;
|
|
@@ -48729,6 +48730,7 @@ export declare const TranscendInput: t.PartialC<{
|
|
|
48729
48730
|
LOOKER: unknown;
|
|
48730
48731
|
WAIT_PERIOD: unknown;
|
|
48731
48732
|
GOVERNMENT_ID: unknown;
|
|
48733
|
+
CUSTOM_FUNCTION: unknown;
|
|
48732
48734
|
email: unknown;
|
|
48733
48735
|
phone: unknown;
|
|
48734
48736
|
SOMBRA: unknown;
|