@transcend-io/cli 4.48.1 → 4.49.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 CHANGED
@@ -29,38 +29,42 @@
29
29
  - [Authentication](#authentication-4)
30
30
  - [Arguments](#arguments-4)
31
31
  - [Usage](#usage-5)
32
- - [tr-cron-pull-identifiers](#tr-cron-pull-identifiers)
32
+ - [tr-request-export](#tr-request-export)
33
33
  - [Authentication](#authentication-5)
34
34
  - [Arguments](#arguments-5)
35
35
  - [Usage](#usage-6)
36
- - [tr-cron-mark-identifiers-completed](#tr-cron-mark-identifiers-completed)
36
+ - [tr-cron-pull-identifiers](#tr-cron-pull-identifiers)
37
37
  - [Authentication](#authentication-6)
38
38
  - [Arguments](#arguments-6)
39
39
  - [Usage](#usage-7)
40
- - [tr-manual-enrichment-pull-identifiers](#tr-manual-enrichment-pull-identifiers)
40
+ - [tr-cron-mark-identifiers-completed](#tr-cron-mark-identifiers-completed)
41
41
  - [Authentication](#authentication-7)
42
42
  - [Arguments](#arguments-7)
43
43
  - [Usage](#usage-8)
44
- - [tr-manual-enrichment-push-identifiers](#tr-manual-enrichment-push-identifiers)
44
+ - [tr-manual-enrichment-pull-identifiers](#tr-manual-enrichment-pull-identifiers)
45
45
  - [Authentication](#authentication-8)
46
46
  - [Arguments](#arguments-8)
47
47
  - [Usage](#usage-9)
48
- - [tr-mark-request-data-silos-completed](#tr-mark-request-data-silos-completed)
48
+ - [tr-manual-enrichment-push-identifiers](#tr-manual-enrichment-push-identifiers)
49
49
  - [Authentication](#authentication-9)
50
50
  - [Arguments](#arguments-9)
51
51
  - [Usage](#usage-10)
52
- - [tr-retry-request-data-silos](#tr-retry-request-data-silos)
52
+ - [tr-mark-request-data-silos-completed](#tr-mark-request-data-silos-completed)
53
53
  - [Authentication](#authentication-10)
54
54
  - [Arguments](#arguments-10)
55
55
  - [Usage](#usage-11)
56
- - [tr-update-consent-manager](#tr-update-consent-manager)
56
+ - [tr-retry-request-data-silos](#tr-retry-request-data-silos)
57
57
  - [Authentication](#authentication-11)
58
58
  - [Arguments](#arguments-11)
59
59
  - [Usage](#usage-12)
60
- - [tr-generate-api-keys](#tr-generate-api-keys)
60
+ - [tr-update-consent-manager](#tr-update-consent-manager)
61
61
  - [Authentication](#authentication-12)
62
62
  - [Arguments](#arguments-12)
63
63
  - [Usage](#usage-13)
64
+ - [tr-generate-api-keys](#tr-generate-api-keys)
65
+ - [Authentication](#authentication-13)
66
+ - [Arguments](#arguments-13)
67
+ - [Usage](#usage-14)
64
68
 
65
69
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
66
70
 
@@ -83,9 +87,15 @@ yarn tr-pull --auth=$TRANSCEND_API_KEY
83
87
  yarn tr-push --auth=$TRANSCEND_API_KEY
84
88
  yarn tr-discover-silos --auth=$TRANSCEND_API_KEY
85
89
  yarn tr-request-upload --auth=$TRANSCEND_API_KEY
90
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY
86
91
  yarn tr-request-restart --auth=$TRANSCEND_API_KEY
87
92
  yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY
88
93
  yarn tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY
94
+ yarn tr-manual-enrichment-pull-identifiers --auth=$TRANSCEND_API_KEY
95
+ yarn tr-mark-request-data-silos-completed --auth=$TRANSCEND_API_KEY
96
+ yarn tr-retry-request-data-silos --auth=$TRANSCEND_API_KEY
97
+ yarn tr-update-consent-manager --auth=$TRANSCEND_API_KEY
98
+ yarn tr-generate-api-keys --auth=$TRANSCEND_API_KEY
89
99
  ```
90
100
 
91
101
  or
@@ -99,9 +109,15 @@ tr-pull --auth=$TRANSCEND_API_KEY
99
109
  tr-push --auth=$TRANSCEND_API_KEY
100
110
  tr-discover-silos --auth=$TRANSCEND_API_KEY
101
111
  tr-request-upload --auth=$TRANSCEND_API_KEY
112
+ tr-request-export --auth=$TRANSCEND_API_KEY
102
113
  tr-request-restart --auth=$TRANSCEND_API_KEY
103
114
  tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY
104
115
  tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY
116
+ tr-manual-enrichment-pull-identifiers --auth=$TRANSCEND_API_KEY
117
+ tr-mark-request-data-silos-completed --auth=$TRANSCEND_API_KEY
118
+ tr-retry-request-data-silos --auth=$TRANSCEND_API_KEY
119
+ tr-update-consent-manager --auth=$TRANSCEND_API_KEY
120
+ tr-generate-api-keys --auth=$TRANSCEND_API_KEY
105
121
  ```
106
122
 
107
123
  alternatively, you can install the cli globally on your machine:
@@ -797,6 +813,77 @@ Skip queued state of request and go straight to compiling
797
813
  yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --skipWaitingPeriod=true
798
814
  ```
799
815
 
816
+ ### tr-request-export
817
+
818
+ Export privacy requests and request identifiers to a CSV file.
819
+
820
+ #### Authentication
821
+
822
+ In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
823
+
824
+ The API key needs the following scopes:
825
+
826
+ - View Incoming Requests
827
+ - View the Request Compilation
828
+
829
+ #### Arguments
830
+
831
+ | Argument | Description | Type | Default | Required |
832
+ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------ | -------- |
833
+ | auth | The Transcend API capable of pulling privacy requests. | string | N/A | true |
834
+ | actions | The [request action](https://docs.transcend.io/docs/privacy-requests/configuring-requests/data-subject-requests#data-actions) to restart. | RequestAction[] | N/A | false |
835
+ | statuses | The [request statuses](https://docs.transcend.io/docs/privacy-requests/overview#request-statuses) to restart. | RequestStatus[] | N/A | false |
836
+ | transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
837
+ | file | Path to the CSV file where identifiers will be written to. | string - file-path | ./transcend-request-export.csv | false |
838
+ | concurrency | The concurrency to use when uploading requests in parallel. | number | 100 | false |
839
+ | createdAtBefore | Pull requests that were submitted before this time | Date | N/A | false |
840
+ | createdAtAfter | Pull requests that were submitted after this time | Date | N/A | false |
841
+ | showTests | Filter for test requests or production requests - when not provided, pulls both | boolean | N/A | false |
842
+
843
+ #### Usage
844
+
845
+ Pull all requests:
846
+
847
+ ```sh
848
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY
849
+ ```
850
+
851
+ Filter for specific actions and statuses:
852
+
853
+ ```sh
854
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE
855
+ ```
856
+
857
+ Specifying the backend URL, needed for US hosted backend infrastructure.
858
+
859
+ ```sh
860
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY --transcendUrl=https://api.us.transcend.io
861
+ ```
862
+
863
+ Increase the concurrency (defaults to 100)
864
+
865
+ ```sh
866
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY --concurrency=500
867
+ ```
868
+
869
+ Filter for production requests only
870
+
871
+ ```sh
872
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY --showTests=false
873
+ ```
874
+
875
+ Filter for requests within a date range
876
+
877
+ ```sh
878
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY --createdAtBefore="04/05/2023" --createdAtAfter="02/21/2023"
879
+ ```
880
+
881
+ Write to a specific file location
882
+
883
+ ```sh
884
+ yarn tr-request-export --auth=$TRANSCEND_API_KEY --file=./path/to/file.csv
885
+ ```
886
+
800
887
  ### tr-cron-pull-identifiers
801
888
 
802
889
  If you are using the cron job integration, you can run this command to pull the outstanding identifiers
@@ -1139,7 +1226,7 @@ The API key must have the following scopes:
1139
1226
  yarn tr-update-consent-manager --auth=$TRANSCEND_API_KEY
1140
1227
  ```
1141
1228
 
1142
- Specifying the backend URL, needed for US hosted backend infrastructure.
1229
+ Specifying the backend URL, needed for US hosted backend infrastructu re.
1143
1230
 
1144
1231
  ```sh
1145
1232
  yarn tr-update-consent-manager --auth=$TRANSCEND_API_KEY --transcendUrl=https://api.us.transcend.io
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-request-export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-request-export.d.ts","sourceRoot":"","sources":["../src/cli-request-export.ts"],"names":[],"mappings":""}
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
8
+ const colors_1 = __importDefault(require("colors"));
9
+ const logger_1 = require("./logger");
10
+ const privacy_types_1 = require("@transcend-io/privacy-types");
11
+ const requests_1 = require("./requests");
12
+ /**
13
+ * Pull down the metadata for a set of Privacy requests.
14
+ *
15
+ * Requires scopes:
16
+ * - View Incoming Requests
17
+ * - View the Request Compilation
18
+ *
19
+ * Dev Usage:
20
+ * yarn ts-node ./src/cli-request-export.ts --auth=asd123 \
21
+ * --requestType=ERASURE \
22
+ * --file=/Users/michaelfarrell/Desktop/test.csv
23
+ *
24
+ * Standard usage:
25
+ * yarn tr-request-export --auth=asd123 \
26
+ * --requestType=ERASURE \
27
+ * --file=/Users/michaelfarrell/Desktop/test.csv
28
+ */
29
+ async function main() {
30
+ // Parse command line arguments
31
+ const { file = './transcend-request-export.csv', transcendUrl = 'https://api.transcend.io', auth, actions = '', statuses = '', showTests, createdAtBefore, createdAtAfter, pageLimit = '100', } = (0, yargs_parser_1.default)(process.argv.slice(2));
32
+ // Ensure auth is passed
33
+ if (!auth) {
34
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=asd123'));
35
+ process.exit(1);
36
+ }
37
+ // Validate actions
38
+ const parsedActions = (0, requests_1.splitCsvToList)(actions);
39
+ const invalidActions = parsedActions.filter(
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ (type) => !Object.values(privacy_types_1.RequestAction).includes(type));
42
+ if (invalidActions.length > 0) {
43
+ logger_1.logger.error(colors_1.default.red(`Failed to parse actions:"${invalidActions.join(',')}".\n` +
44
+ `Expected one of: \n${Object.values(privacy_types_1.RequestAction).join('\n')}`));
45
+ process.exit(1);
46
+ }
47
+ // Validate statuses
48
+ const parsedStatuses = (0, requests_1.splitCsvToList)(statuses);
49
+ const invalidStatuses = parsedStatuses.filter(
50
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
+ (type) => !Object.values(privacy_types_1.RequestAction).includes(type));
52
+ if (invalidStatuses.length > 0) {
53
+ logger_1.logger.error(colors_1.default.red(`Failed to parse statuses:"${invalidStatuses.join(',')}".\n` +
54
+ `Expected one of: \n${Object.values(privacy_types_1.RequestStatus).join('\n')}`));
55
+ process.exit(1);
56
+ }
57
+ // Pull privacy requests
58
+ await (0, requests_1.pullRequestsToCsv)({
59
+ file,
60
+ transcendUrl,
61
+ pageLimit: parseInt(pageLimit, 10),
62
+ actions: parsedActions,
63
+ statuses: parsedStatuses,
64
+ auth,
65
+ createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,
66
+ createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,
67
+ showTests: showTests === 'true' ? true : showTests === 'false' ? false : undefined,
68
+ });
69
+ }
70
+ main();
71
+ //# sourceMappingURL=cli-request-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-request-export.js","sourceRoot":"","sources":["../src/cli-request-export.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,+DAA2E;AAC3E,yCAA+D;AAE/D;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,GAAG,gCAAgC,EACvC,YAAY,GAAG,0BAA0B,EACzC,IAAI,EACJ,OAAO,GAAG,EAAE,EACZ,QAAQ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