@transcend-io/cli 6.26.1 → 6.26.3

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 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.writeCsv)(file, identifiersFormattedForCsv, headers);
74
- logger_1.logger.info(colors_1.default.green(`Successfully wrote ${identifiersFormattedForCsv.length} identifiers to file "${file}"`));
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,iCAAwE;AACxE,+DAA4D;AAC5D,2CAAoD;AACpD,yCAA4C;AAE5C;;;;;;;;;;;;;;;;GAgBG;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,GACzB,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,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C7D,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/codecs.d.ts CHANGED
@@ -40854,8 +40854,6 @@ export declare const PrivacyCenterInput: t.PartialC<{
40854
40854
  showConsentManager: t.BooleanC;
40855
40855
  /** Whether or not to show the manage your privacy page */
40856
40856
  showManageYourPrivacy: t.BooleanC;
40857
- /** Whether or not to show the privacy preferences page */
40858
- showPrivacyPreferences: t.BooleanC;
40859
40857
  /** Whether or not to show the marketing preferences page */
40860
40858
  showMarketingPreferences: t.BooleanC;
40861
40859
  /** What languages are supported for the privacy center */
@@ -88262,8 +88260,6 @@ export declare const TranscendInput: t.PartialC<{
88262
88260
  showConsentManager: t.BooleanC;
88263
88261
  /** Whether or not to show the manage your privacy page */
88264
88262
  showManageYourPrivacy: t.BooleanC;
88265
- /** Whether or not to show the privacy preferences page */
88266
- showPrivacyPreferences: t.BooleanC;
88267
88263
  /** Whether or not to show the marketing preferences page */
88268
88264
  showMarketingPreferences: t.BooleanC;
88269
88265
  /** What languages are supported for the privacy center */