@transcend-io/cli 4.12.0 → 4.14.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.
Files changed (71) hide show
  1. package/README.md +156 -14
  2. package/build/cli-request-upload.d.ts +3 -0
  3. package/build/cli-request-upload.d.ts.map +1 -0
  4. package/build/cli-request-upload.js +63 -0
  5. package/build/cli-request-upload.js.map +1 -0
  6. package/build/graphql/fetchAllAttributeKeys.d.ts +17 -0
  7. package/build/graphql/fetchAllAttributeKeys.d.ts.map +1 -0
  8. package/build/graphql/fetchAllAttributeKeys.js +32 -0
  9. package/build/graphql/fetchAllAttributeKeys.js.map +1 -0
  10. package/build/graphql/gqls/attributeKey.d.ts +2 -0
  11. package/build/graphql/gqls/attributeKey.d.ts.map +1 -0
  12. package/build/graphql/gqls/attributeKey.js +20 -0
  13. package/build/graphql/gqls/attributeKey.js.map +1 -0
  14. package/build/graphql/gqls/enricher.d.ts +10 -0
  15. package/build/graphql/gqls/enricher.d.ts.map +1 -1
  16. package/build/graphql/gqls/enricher.js +11 -1
  17. package/build/graphql/gqls/enricher.js.map +1 -1
  18. package/build/graphql/gqls/index.d.ts +1 -0
  19. package/build/graphql/gqls/index.d.ts.map +1 -1
  20. package/build/graphql/gqls/index.js +1 -0
  21. package/build/graphql/gqls/index.js.map +1 -1
  22. package/build/graphql/index.d.ts +1 -0
  23. package/build/graphql/index.d.ts.map +1 -1
  24. package/build/graphql/index.js +1 -0
  25. package/build/graphql/index.js.map +1 -1
  26. package/build/requests/constants.d.ts +56 -5
  27. package/build/requests/constants.d.ts.map +1 -1
  28. package/build/requests/constants.js +33 -3
  29. package/build/requests/constants.js.map +1 -1
  30. package/build/requests/extractClientError.d.ts +8 -0
  31. package/build/requests/extractClientError.d.ts.map +1 -0
  32. package/build/requests/extractClientError.js +15 -0
  33. package/build/requests/extractClientError.js.map +1 -0
  34. package/build/requests/fuzzyMatchColumns.d.ts +3 -2
  35. package/build/requests/fuzzyMatchColumns.d.ts.map +1 -1
  36. package/build/requests/fuzzyMatchColumns.js +4 -2
  37. package/build/requests/fuzzyMatchColumns.js.map +1 -1
  38. package/build/requests/index.d.ts +4 -0
  39. package/build/requests/index.d.ts.map +1 -1
  40. package/build/requests/index.js +4 -0
  41. package/build/requests/index.js.map +1 -1
  42. package/build/requests/mapColumnsToAttributes.d.ts +22 -0
  43. package/build/requests/mapColumnsToAttributes.d.ts.map +1 -0
  44. package/build/requests/mapColumnsToAttributes.js +47 -0
  45. package/build/requests/mapColumnsToAttributes.js.map +1 -0
  46. package/build/requests/mapColumnsToIdentifiers.d.ts +20 -0
  47. package/build/requests/mapColumnsToIdentifiers.d.ts.map +1 -0
  48. package/build/requests/mapColumnsToIdentifiers.js +51 -0
  49. package/build/requests/mapColumnsToIdentifiers.js.map +1 -0
  50. package/build/requests/mapCsvColumnsToApi.d.ts.map +1 -1
  51. package/build/requests/mapCsvColumnsToApi.js +1 -1
  52. package/build/requests/mapCsvColumnsToApi.js.map +1 -1
  53. package/build/requests/mapCsvRowsToRequestInputs.d.ts +31 -7
  54. package/build/requests/mapCsvRowsToRequestInputs.d.ts.map +1 -1
  55. package/build/requests/mapCsvRowsToRequestInputs.js +121 -38
  56. package/build/requests/mapCsvRowsToRequestInputs.js.map +1 -1
  57. package/build/requests/mapRequestEnumValues.d.ts.map +1 -1
  58. package/build/requests/mapRequestEnumValues.js +8 -4
  59. package/build/requests/mapRequestEnumValues.js.map +1 -1
  60. package/build/requests/parseAttributesFromString.js +1 -1
  61. package/build/requests/parseAttributesFromString.js.map +1 -1
  62. package/build/requests/submitPrivacyRequest.d.ts +7 -5
  63. package/build/requests/submitPrivacyRequest.d.ts.map +1 -1
  64. package/build/requests/submitPrivacyRequest.js +23 -6
  65. package/build/requests/submitPrivacyRequest.js.map +1 -1
  66. package/build/requests/uploadPrivacyRequestsFromCsv.d.ts +43 -0
  67. package/build/requests/uploadPrivacyRequestsFromCsv.d.ts.map +1 -0
  68. package/build/requests/uploadPrivacyRequestsFromCsv.js +220 -0
  69. package/build/requests/uploadPrivacyRequestsFromCsv.js.map +1 -0
  70. package/build/tsbuildinfo +1 -1
  71. package/package.json +5 -2
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.uploadPrivacyRequestsFromCsv = void 0;
26
+ const colors_1 = __importDefault(require("colors"));
27
+ const bluebird_1 = require("bluebird");
28
+ const t = __importStar(require("io-ts"));
29
+ const uniq_1 = __importDefault(require("lodash/uniq"));
30
+ const cli_progress_1 = __importDefault(require("cli-progress"));
31
+ const persisted_state_1 = require("@transcend-io/persisted-state");
32
+ const logger_1 = require("../logger");
33
+ const graphql_1 = require("../graphql");
34
+ const mapRequestEnumValues_1 = require("./mapRequestEnumValues");
35
+ const constants_1 = require("./constants");
36
+ const mapCsvColumnsToApi_1 = require("./mapCsvColumnsToApi");
37
+ const parseAttributesFromString_1 = require("./parseAttributesFromString");
38
+ const readCsv_1 = require("./readCsv");
39
+ const submitPrivacyRequest_1 = require("./submitPrivacyRequest");
40
+ const mapColumnsToAttributes_1 = require("./mapColumnsToAttributes");
41
+ const mapColumnsToIdentifiers_1 = require("./mapColumnsToIdentifiers");
42
+ const mapCsvRowsToRequestInputs_1 = require("./mapCsvRowsToRequestInputs");
43
+ const filterRows_1 = require("./filterRows");
44
+ const extractClientError_1 = require("./extractClientError");
45
+ /**
46
+ * Upload a set of privacy requests from CSV
47
+ *
48
+ * @param options - Options
49
+ */
50
+ async function uploadPrivacyRequestsFromCsv({ cacheFilepath, file, auth, sombraAuth, concurrency = 20, defaultPhoneCountryCode = '1', // USA
51
+ transcendApiUrl = 'https://api.transcend.io', attributes = [], emailIsVerified = true, clearSuccessfulRequests = false, clearFailingRequests = false, clearDuplicateRequests = false, skipFilterStep = false, isTest = false, isSilent = true, debug = false, dryRun = false, }) {
52
+ // Time duration
53
+ const t0 = new Date().getTime();
54
+ // create a new progress bar instance and use shades_classic theme
55
+ const progressBar = new cli_progress_1.default.SingleBar({}, cli_progress_1.default.Presets.shades_classic);
56
+ // Parse out the extra attributes to apply to all requests uploaded
57
+ const parsedAttributes = (0, parseAttributesFromString_1.parseAttributesFromString)(attributes);
58
+ // Create a new state to persist the metadata that
59
+ // maps the request inputs to the Transcend API shape
60
+ const state = new persisted_state_1.PersistedState(cacheFilepath, constants_1.CachedState, {});
61
+ let cached = state.getValue(file) || {
62
+ columnNames: {},
63
+ requestTypeToRequestAction: {},
64
+ subjectTypeToSubjectName: {},
65
+ languageToLocale: {},
66
+ statusToRequestStatus: {},
67
+ identifierNames: {},
68
+ attributeNames: {},
69
+ successfulRequests: [],
70
+ duplicateRequests: [],
71
+ failingRequests: [],
72
+ };
73
+ if (clearFailingRequests) {
74
+ cached.failingRequests = [];
75
+ }
76
+ if (clearSuccessfulRequests) {
77
+ cached.successfulRequests = [];
78
+ }
79
+ if (clearDuplicateRequests) {
80
+ cached.duplicateRequests = [];
81
+ }
82
+ state.setValue(cached, file);
83
+ // Create sombra instance to communicate with
84
+ const sombra = await (0, graphql_1.createSombraGotInstance)(transcendApiUrl, auth, sombraAuth);
85
+ // Read in the list of integration requests
86
+ const requestsList = (0, readCsv_1.readCsv)(file, t.record(t.string, t.string));
87
+ const columnNames = (0, uniq_1.default)(requestsList.map((x) => Object.keys(x)).flat());
88
+ // Log out an example request
89
+ if (requestsList.length === 0) {
90
+ throw new Error('No Requests found in list! Ensure the first row of the CSV is a header and the rest are requests.');
91
+ }
92
+ if (debug) {
93
+ const firstRequest = requestsList[0];
94
+ logger_1.logger.info(colors_1.default.magenta(`First request: ${JSON.stringify(firstRequest, null, 2)}`));
95
+ }
96
+ // Determine what rows in the CSV should be imported
97
+ // Choose columns that contain metadata to filter the requests
98
+ const filteredRequestList = skipFilterStep
99
+ ? requestsList
100
+ : await (0, filterRows_1.filterRows)(requestsList);
101
+ // Build a GraphQL client
102
+ const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendApiUrl, auth);
103
+ // Grab the request attributes
104
+ const requestAttributeKeys = await (0, graphql_1.fetchAllRequestAttributeKeys)(client);
105
+ // Determine the columns that should be mapped
106
+ const columnNameMap = await (0, mapCsvColumnsToApi_1.mapCsvColumnsToApi)(columnNames, cached);
107
+ state.setValue(cached, file);
108
+ const identifierNameMap = await (0, mapColumnsToIdentifiers_1.mapColumnsToIdentifiers)(client, columnNames, cached);
109
+ state.setValue(cached, file);
110
+ const attributeNameMap = await (0, mapColumnsToAttributes_1.mapColumnsToAttributes)(client, columnNames, cached, requestAttributeKeys);
111
+ state.setValue(cached, file);
112
+ await (0, mapRequestEnumValues_1.mapRequestEnumValues)(client, filteredRequestList, {
113
+ fileName: file,
114
+ state,
115
+ columnNameMap,
116
+ });
117
+ cached = state.getValue(file);
118
+ // map the CSV to request input
119
+ const requestInputs = (0, mapCsvRowsToRequestInputs_1.mapCsvRowsToRequestInputs)(filteredRequestList, cached, {
120
+ defaultPhoneCountryCode,
121
+ columnNameMap,
122
+ identifierNameMap,
123
+ attributeNameMap,
124
+ requestAttributeKeys,
125
+ });
126
+ // start the progress bar with a total value of 200 and start value of 0
127
+ if (!debug) {
128
+ progressBar.start(requestInputs.length, 0);
129
+ }
130
+ let total = 0;
131
+ // Submit each request
132
+ await (0, bluebird_1.map)(requestInputs, async ([rawRow, requestInput], ind) => {
133
+ var _a;
134
+ // The identifier to log, only include personal data if debug mode is on
135
+ const requestLogId = debug
136
+ ? `email:${requestInput.email} | coreIdentifier:${requestInput.coreIdentifier}`
137
+ : `row:${ind.toString()}`;
138
+ if (debug) {
139
+ logger_1.logger.info(colors_1.default.magenta(`[${ind}/${requestInputs.length}] Importing: ${JSON.stringify(requestInput, null, 2)}`));
140
+ }
141
+ // Skip on dry run
142
+ if (dryRun) {
143
+ logger_1.logger.info(colors_1.default.magenta('Bailing out on dry run because dryRun is set'));
144
+ return;
145
+ }
146
+ try {
147
+ // Make the GraphQL request to submit the privacy request
148
+ const requestResponse = await (0, submitPrivacyRequest_1.submitPrivacyRequest)(sombra, requestInput, {
149
+ details: `Uploaded by Transcend Cli: "tr-request-upload" : ${JSON.stringify(rawRow, null, 2)}`,
150
+ isTest,
151
+ emailIsVerified,
152
+ isSilent,
153
+ additionalAttributes: parsedAttributes,
154
+ });
155
+ // Log success
156
+ if (debug) {
157
+ logger_1.logger.info(colors_1.default.green(`[${ind}/${requestInputs.length}] Successfully submitted the test data subject request: "${requestLogId}"`));
158
+ logger_1.logger.info(colors_1.default.green(`[${ind}/${requestInputs.length}] View it at: "${requestResponse.link}"`));
159
+ }
160
+ // Cache successful upload
161
+ cached.successfulRequests.push({
162
+ id: requestResponse.id,
163
+ link: requestResponse.link,
164
+ coreIdentifier: requestResponse.coreIdentifier,
165
+ attemptedAt: new Date().toISOString(),
166
+ });
167
+ state.setValue(cached, file);
168
+ }
169
+ catch (err) {
170
+ const msg = `${err.message} - ${JSON.stringify((_a = err.response) === null || _a === void 0 ? void 0 : _a.body, null, 2)}`;
171
+ const clientError = (0, extractClientError_1.extractClientError)(msg);
172
+ if (clientError === 'Client error: You have already made this request.') {
173
+ if (debug) {
174
+ logger_1.logger.info(colors_1.default.yellow(`[${ind}/${requestInputs.length}] Skipping request as it is a duplicate`));
175
+ }
176
+ cached.duplicateRequests.push({
177
+ coreIdentifier: requestInput.coreIdentifier,
178
+ attemptedAt: new Date().toISOString(),
179
+ });
180
+ state.setValue(cached, file);
181
+ }
182
+ else {
183
+ cached.failingRequests.push({
184
+ ...requestInput,
185
+ error: clientError || msg,
186
+ attemptedAt: new Date().toISOString(),
187
+ });
188
+ state.setValue(cached, file);
189
+ if (debug) {
190
+ logger_1.logger.error(colors_1.default.red(clientError || msg));
191
+ logger_1.logger.error(colors_1.default.red(`[${ind}/${requestInputs.length}] Failed to submit request for: "${requestLogId}"`));
192
+ }
193
+ }
194
+ }
195
+ total += 1;
196
+ if (!debug) {
197
+ progressBar.update(total);
198
+ }
199
+ }, {
200
+ concurrency,
201
+ });
202
+ progressBar.stop();
203
+ const t1 = new Date().getTime();
204
+ const totalTime = t1 - t0;
205
+ // Log completion time
206
+ logger_1.logger.info(colors_1.default.green(`Completed upload in "${totalTime / 1000}" seconds.`));
207
+ // Log duplicates
208
+ if (cached.duplicateRequests.length > 0) {
209
+ logger_1.logger.info(colors_1.default.magenta(`Encountered "${cached.duplicateRequests.length}" duplicate requests. ` +
210
+ `See "${cacheFilepath}" to review the core identifiers for these requests.`));
211
+ }
212
+ // Log errors
213
+ if (cached.failingRequests.length > 0) {
214
+ logger_1.logger.error(colors_1.default.red(`Encountered "${cached.failingRequests.length}" errors. ` +
215
+ `See "${cacheFilepath}" to review the error messages and inputs.`));
216
+ process.exit(1);
217
+ }
218
+ }
219
+ exports.uploadPrivacyRequestsFromCsv = uploadPrivacyRequestsFromCsv;
220
+ //# sourceMappingURL=uploadPrivacyRequestsFromCsv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadPrivacyRequestsFromCsv.js","sourceRoot":"","sources":["../../src/requests/uploadPrivacyRequestsFromCsv.ts"],"names":[],"mappings":";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