@transcend-io/cli 6.14.3 → 6.16.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 (67) hide show
  1. package/README.md +78 -12
  2. package/build/cli-pull-unstructured-discovery-files.d.ts +3 -0
  3. package/build/cli-pull-unstructured-discovery-files.d.ts.map +1 -0
  4. package/build/cli-pull-unstructured-discovery-files.js +73 -0
  5. package/build/cli-pull-unstructured-discovery-files.js.map +1 -0
  6. package/build/cli-sync-ot.js +32 -29
  7. package/build/cli-sync-ot.js.map +1 -1
  8. package/build/codecs.d.ts +71 -6
  9. package/build/codecs.d.ts.map +1 -1
  10. package/build/codecs.js +19 -2
  11. package/build/codecs.js.map +1 -1
  12. package/build/data-inventory/index.d.ts +1 -0
  13. package/build/data-inventory/index.d.ts.map +1 -1
  14. package/build/data-inventory/index.js +1 -0
  15. package/build/data-inventory/index.js.map +1 -1
  16. package/build/data-inventory/pullAllDatapoints.d.ts +3 -3
  17. package/build/data-inventory/pullAllDatapoints.d.ts.map +1 -1
  18. package/build/data-inventory/pullAllDatapoints.js +7 -0
  19. package/build/data-inventory/pullAllDatapoints.js.map +1 -1
  20. package/build/data-inventory/pullUnstructuredSubDataPointRecommendations.d.ts +58 -0
  21. package/build/data-inventory/pullUnstructuredSubDataPointRecommendations.d.ts.map +1 -0
  22. package/build/data-inventory/pullUnstructuredSubDataPointRecommendations.js +110 -0
  23. package/build/data-inventory/pullUnstructuredSubDataPointRecommendations.js.map +1 -0
  24. package/build/enums.d.ts +7 -0
  25. package/build/enums.d.ts.map +1 -1
  26. package/build/enums.js +9 -1
  27. package/build/enums.js.map +1 -1
  28. package/build/graphql/gqls/entry.d.ts +2 -0
  29. package/build/graphql/gqls/entry.d.ts.map +1 -0
  30. package/build/graphql/gqls/entry.js +17 -0
  31. package/build/graphql/gqls/entry.js.map +1 -0
  32. package/build/graphql/gqls/index.d.ts +1 -0
  33. package/build/graphql/gqls/index.d.ts.map +1 -1
  34. package/build/graphql/gqls/index.js +1 -0
  35. package/build/graphql/gqls/index.js.map +1 -1
  36. package/build/graphql/makeGraphQLRequest.d.ts +1 -1
  37. package/build/graphql/makeGraphQLRequest.d.ts.map +1 -1
  38. package/build/graphql/makeGraphQLRequest.js.map +1 -1
  39. package/build/oneTrust/helpers/enrichOneTrustAssessment.d.ts.map +1 -1
  40. package/build/oneTrust/helpers/enrichOneTrustAssessment.js +38 -30
  41. package/build/oneTrust/helpers/enrichOneTrustAssessment.js.map +1 -1
  42. package/build/oneTrust/helpers/index.d.ts +2 -0
  43. package/build/oneTrust/helpers/index.d.ts.map +1 -1
  44. package/build/oneTrust/helpers/index.js +2 -0
  45. package/build/oneTrust/helpers/index.js.map +1 -1
  46. package/build/oneTrust/helpers/oneTrustAssessmentToJson.js +3 -3
  47. package/build/oneTrust/helpers/oneTrustAssessmentToJson.js.map +1 -1
  48. package/build/oneTrust/helpers/parseCliSyncOtArguments.d.ts +5 -3
  49. package/build/oneTrust/helpers/parseCliSyncOtArguments.d.ts.map +1 -1
  50. package/build/oneTrust/helpers/parseCliSyncOtArguments.js +31 -10
  51. package/build/oneTrust/helpers/parseCliSyncOtArguments.js.map +1 -1
  52. package/build/oneTrust/helpers/syncOneTrustAssessmentToTranscend.d.ts +1 -1
  53. package/build/oneTrust/helpers/syncOneTrustAssessmentToTranscend.d.ts.map +1 -1
  54. package/build/oneTrust/helpers/syncOneTrustAssessmentToTranscend.js +11 -6
  55. package/build/oneTrust/helpers/syncOneTrustAssessmentToTranscend.js.map +1 -1
  56. package/build/oneTrust/helpers/syncOneTrustAssessmentsFromFile.d.ts +13 -0
  57. package/build/oneTrust/helpers/syncOneTrustAssessmentsFromFile.d.ts.map +1 -0
  58. package/build/oneTrust/helpers/syncOneTrustAssessmentsFromFile.js +78 -0
  59. package/build/oneTrust/helpers/syncOneTrustAssessmentsFromFile.js.map +1 -0
  60. package/build/oneTrust/helpers/{syncOneTrustAssessments.d.ts → syncOneTrustAssessmentsFromOneTrust.d.ts} +7 -2
  61. package/build/oneTrust/helpers/syncOneTrustAssessmentsFromOneTrust.d.ts.map +1 -0
  62. package/build/oneTrust/helpers/{syncOneTrustAssessments.js → syncOneTrustAssessmentsFromOneTrust.js} +50 -23
  63. package/build/oneTrust/helpers/syncOneTrustAssessmentsFromOneTrust.js.map +1 -0
  64. package/build/tsbuildinfo +1 -1
  65. package/package.json +3 -2
  66. package/build/oneTrust/helpers/syncOneTrustAssessments.d.ts.map +0 -1
  67. package/build/oneTrust/helpers/syncOneTrustAssessments.js.map +0 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  - [Authentication](#authentication)
13
13
  - [Arguments](#arguments)
14
14
  - [Usage](#usage-1)
15
- - [tr-pull-ot](#tr-pull-ot)
15
+ - [tr-sync-ot](#tr-sync-ot)
16
16
  - [Authentication](#authentication-1)
17
17
  - [Arguments](#arguments-1)
18
18
  - [Usage](#usage-2)
@@ -122,36 +122,39 @@
122
122
  - [Authentication](#authentication-27)
123
123
  - [Arguments](#arguments-27)
124
124
  - [Usage](#usage-28)
125
- - [tr-upload-preferences](#tr-upload-preferences)
125
+ - [tr-pull-pull-unstructured-discovery-files](#tr-pull-pull-unstructured-discovery-files)
126
126
  - [Authentication](#authentication-28)
127
- - [Authentication](#authentication-29)
128
127
  - [Arguments](#arguments-28)
129
128
  - [Usage](#usage-29)
130
- - [tr-upload-consent-preferences](#tr-upload-consent-preferences)
129
+ - [tr-upload-preferences](#tr-upload-preferences)
130
+ - [Authentication](#authentication-29)
131
131
  - [Authentication](#authentication-30)
132
132
  - [Arguments](#arguments-29)
133
133
  - [Usage](#usage-30)
134
- - [tr-pull-consent-preferences](#tr-pull-consent-preferences)
134
+ - [tr-upload-consent-preferences](#tr-upload-consent-preferences)
135
135
  - [Authentication](#authentication-31)
136
136
  - [Arguments](#arguments-30)
137
137
  - [Usage](#usage-31)
138
- - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
138
+ - [tr-pull-consent-preferences](#tr-pull-consent-preferences)
139
139
  - [Authentication](#authentication-32)
140
140
  - [Arguments](#arguments-31)
141
141
  - [Usage](#usage-32)
142
- - [tr-upload-cookies-from-csv](#tr-upload-cookies-from-csv)
142
+ - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
143
143
  - [Authentication](#authentication-33)
144
144
  - [Arguments](#arguments-32)
145
145
  - [Usage](#usage-33)
146
- - [tr-generate-api-keys](#tr-generate-api-keys)
146
+ - [tr-upload-cookies-from-csv](#tr-upload-cookies-from-csv)
147
147
  - [Authentication](#authentication-34)
148
148
  - [Arguments](#arguments-33)
149
149
  - [Usage](#usage-34)
150
- - [tr-sync-ot](#tr-sync-ot)
151
- - [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
150
+ - [tr-generate-api-keys](#tr-generate-api-keys)
152
151
  - [Authentication](#authentication-35)
153
152
  - [Arguments](#arguments-34)
154
153
  - [Usage](#usage-35)
154
+ - [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
155
+ - [Authentication](#authentication-36)
156
+ - [Arguments](#arguments-35)
157
+ - [Usage](#usage-36)
155
158
  - [Prompt Manager](#prompt-manager)
156
159
  - [Proxy usage](#proxy-usage)
157
160
 
@@ -610,8 +613,9 @@ The API key needs the following scopes when pushing the various resource types:
610
613
 
611
614
  | Argument | Description | Type | Default | Required |
612
615
  | ------------- | ------------------------------------------------------------------------------------------------- | ------------ | ------------------------ | -------- |
613
- | hostname | The domain of the OneTrust environment from which to pull the resource (e.g. trial.onetrust.com). | string | N/A | true |
614
- | oneTrustAuth | The OAuth access token with the scopes necessary to access the OneTrust Public APIs. | string | N/A | true |
616
+ | hostname | The domain of the OneTrust environment from which to pull the resource (e.g. trial.onetrust.com). | string | N/A | false |
617
+ | oneTrustAuth | The OAuth access token with the scopes necessary to access the OneTrust Public APIs. | string | N/A | false |
618
+ | source | Whether to read the assessments from OneTrust or from a file | string | oneTrust | false |
615
619
  | transcendAuth | The Transcend API Key to with the scopes necessary to access Transcend's Public APIs. | string | N/A | false |
616
620
  | transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
617
621
  | file | Path to the file to pull the resource into. Its format must match the fileFormat argument. | string | N/A | false |
@@ -2372,6 +2376,68 @@ Specify the backend URL, needed for US hosted backend infrastructure:
2372
2376
  yarn tr-pull-datapoints --auth=$TRANSCEND_API_KEY --file=./datapoints.csv --transcendUrl=https://api.us.transcend.io
2373
2377
  ```
2374
2378
 
2379
+ ### tr-pull-pull-unstructured-discovery-files
2380
+
2381
+ This command allows for pulling Unstructured Discovery into a CSV.
2382
+
2383
+ #### Authentication
2384
+
2385
+ 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).
2386
+
2387
+ The API key must have the following scopes:
2388
+
2389
+ - "View Data Inventory"
2390
+
2391
+ #### Arguments
2392
+
2393
+ | Argument | Description | Type | Default | Required |
2394
+ | ------------------------ | ---------------------------------------------------------------------------------------------------- | ------------- | ---------------------------------- | -------- |
2395
+ | auth | The Transcend API key with the scopes necessary for the command. | string | N/A | true |
2396
+ | file | The file to save datapoints to | string - path | ./unstructured-discovery-files.csv | false |
2397
+ | transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
2398
+ | dataSiloIds | Comma-separated list of data silo IDs to filter by | string | N/A | false |
2399
+ | subCategories | Comma-separated list of data categories to filter by | string | N/A | false |
2400
+ | status | Comma-separated list of classification statuses to filter by (CLASSIFIED, VALIDATED, REJECTED, etc.) | string | (excludes REJECTED) | false |
2401
+ | includeEncryptedSnippets | Whether to include encrypted snippets of the entries classified | boolean | false | false |
2402
+
2403
+ #### Usage
2404
+
2405
+ All arguments
2406
+
2407
+ ```sh
2408
+ yarn tr-pull-unstructured-discovery-files --auth=$TRANSCEND_API_KEY --file=./unstructured-discovery-files.csv --transcendUrl=https://api.us.transcend.io --dataSiloIds=f956ccce-5534-4328-a78d-3a924b1fe429 --subCategories=79d998b7-45dd-481c-ae3a-856fd93458b2,9ecc213a-cd46-46d6-afd9-46cea713f5d1 --status=VALIDATED,MANUALLY_ADDED,CORRECTED --includeEncryptedSnippets=true
2409
+ ```
2410
+
2411
+ Specify the backend URL, needed for US hosted backend infrastructure:
2412
+
2413
+ ```sh
2414
+ yarn tr-pull-datapoints --auth=$TRANSCEND_API_KEY --transcendUrl=https://api.us.transcend.io
2415
+ ```
2416
+
2417
+ Pull entries for specific data silos:
2418
+
2419
+ ```sh
2420
+ yarn tr-pull-unstructured-discovery-files --auth=$TRANSCEND_API_KEY --dataSiloIds=f956ccce-5534-4328-a78d-3a924b1fe429
2421
+ ```
2422
+
2423
+ Filter by data categories:
2424
+
2425
+ ```sh
2426
+ yarn tr-pull-unstructured-discovery-files --auth=$TRANSCEND_API_KEY --subCategories=79d998b7-45dd-481c-ae3a-856fd93458b2,9ecc213a-cd46-46d6-afd9-46cea713f5d1
2427
+ ```
2428
+
2429
+ Filter by classification status (exclude unconfirmed recommendations):
2430
+
2431
+ ```sh
2432
+ yarn tr-pull-unstructured-discovery-files --auth=$TRANSCEND_API_KEY --status=VALIDATED,MANUALLY_ADDED,CORRECTED
2433
+ ```
2434
+
2435
+ Filter by classification status (include rejected recommendations):
2436
+
2437
+ ```sh
2438
+ yarn tr-pull-unstructured-discovery-files --auth=$TRANSCEND_API_KEY --status=REJECTED
2439
+ ```
2440
+
2375
2441
  ### tr-upload-preferences
2376
2442
 
2377
2443
  This command allows for updating of preference management data to your Transcend Preference Store.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-pull-unstructured-discovery-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-pull-unstructured-discovery-files.d.ts","sourceRoot":"","sources":["../src/cli-pull-unstructured-discovery-files.ts"],"names":[],"mappings":""}
@@ -0,0 +1,73 @@
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 colors_1 = __importDefault(require("colors"));
8
+ const uniq_1 = __importDefault(require("lodash/uniq"));
9
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
10
+ const constants_1 = require("./constants");
11
+ const cron_1 = require("./cron");
12
+ const data_inventory_1 = require("./data-inventory");
13
+ const graphql_1 = require("./graphql");
14
+ const logger_1 = require("./logger");
15
+ const requests_1 = require("./requests");
16
+ /**
17
+ * Sync unstructured discovery files from Transcend inventory to a CSV
18
+ *
19
+ * Dev Usage:
20
+ * yarn ts-node ./src/cli-pull-unstructured-discovery-files.ts --auth=$TRANSCEND_API_KEY
21
+ *
22
+ * Standard usage
23
+ * yarn cli-pull-unstructured-discovery-files --auth=$TRANSCEND_API_KEY
24
+ */
25
+ async function main() {
26
+ // Parse command line arguments
27
+ const { file = './unstructured-discovery-files.csv', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, dataSiloIds = '', subCategories = '', status = '', includeEncryptedSnippets = 'false', } = (0, yargs_parser_1.default)(process.argv.slice(2));
28
+ // Ensure auth is passed
29
+ if (!auth) {
30
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
31
+ process.exit(1);
32
+ }
33
+ const includeEncryptedSnippetsBool = includeEncryptedSnippets === 'true';
34
+ try {
35
+ // Create a GraphQL client
36
+ const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
37
+ const entries = await (0, data_inventory_1.pullUnstructuredSubDataPointRecommendations)(client, {
38
+ dataSiloIds: (0, requests_1.splitCsvToList)(dataSiloIds),
39
+ subCategories: (0, requests_1.splitCsvToList)(subCategories),
40
+ status: (0, requests_1.splitCsvToList)(status),
41
+ includeEncryptedSnippets: includeEncryptedSnippetsBool,
42
+ });
43
+ logger_1.logger.info(colors_1.default.magenta(`Writing unstructured discovery files to file "${file}"...`));
44
+ let headers = [];
45
+ const inputs = entries.map((entry) => {
46
+ const result = {
47
+ 'Entry ID': entry.id,
48
+ 'Data Silo ID': entry.dataSiloId,
49
+ 'Object Path ID': entry.scannedObjectPathId,
50
+ 'Object ID': entry.scannedObjectId,
51
+ ...(includeEncryptedSnippetsBool
52
+ ? { Entry: entry.name, 'Context Snippet': entry.contextSnippet }
53
+ : {}),
54
+ 'Data Category': `${entry.dataSubCategory.category}:${entry.dataSubCategory.name}`,
55
+ 'Classification Status': entry.status,
56
+ 'Confidence Score': entry.confidence,
57
+ 'Classification Method': entry.classificationMethod,
58
+ 'Classifier Version': entry.classifierVersion,
59
+ };
60
+ headers = (0, uniq_1.default)([...headers, ...Object.keys(result)]);
61
+ return result;
62
+ });
63
+ (0, cron_1.writeCsv)(file, inputs, headers);
64
+ }
65
+ catch (err) {
66
+ logger_1.logger.error(colors_1.default.red(`An error occurred syncing the unstructured discovery files: ${err.message}`));
67
+ process.exit(1);
68
+ }
69
+ // Indicate success
70
+ logger_1.logger.info(colors_1.default.green(`Successfully synced unstructured discovery files to disk at ${file}!`));
71
+ }
72
+ main();
73
+ //# sourceMappingURL=cli-pull-unstructured-discovery-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-pull-unstructured-discovery-files.js","sourceRoot":"","sources":["../src/cli-pull-unstructured-discovery-files.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;AAC5B,uDAA+B;AAC/B,gEAAiC;AACjC,2CAAoD;AACpD,iCAAkC;AAClC,qDAA+E;AAC/E,uCAAwD;AACxD,qCAAkC;AAClC,yCAA4C;AAE5C;;;;;;;;GAQG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,GAAG,oCAAoC,EAC3C,YAAY,GAAG,iCAAqB,EACpC,IAAI,EACJ,WAAW,GAAG,EAAE,EAChB,aAAa,GAAG,EAAE,EAClB,MAAM,GAAG,EAAE,EACX,w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E,CAAC;gBACP,eAAe,EAAE,GAAG,KAAK,CAAC,eAAe,CAAC,QAAQ,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE;gBAClF,uBAAuB,EAAE,KAAK,CAAC,MAAM;gBACrC,kBAAkB,EAAE,KAAK,CAAC,UAAU;gBACpC,uBAAuB,EAAE,KAAK,CAAC,oBAAoB;gBACnD,oBAAoB,EAAE,KAAK,CAAC,iBAAiB;aAC9C,CAAC;YACF,OAAO,GAAG,IAAA,cAAI,EAAC,CAAC,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,IAAA,eAAQ,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACZ,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,+DAA+D,GAAG,CAAC,OAAO,EAAE,CAC7E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,mBAAmB;IACnB,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,+DAA+D,IAAI,GAAG,CACvE,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -8,8 +8,8 @@ const logger_1 = require("./logger");
8
8
  const colors_1 = __importDefault(require("colors"));
9
9
  const oneTrust_1 = require("./oneTrust");
10
10
  const enums_1 = require("./enums");
11
- const syncOneTrustAssessments_1 = require("./oneTrust/helpers/syncOneTrustAssessments");
12
11
  const graphql_1 = require("./graphql");
12
+ const helpers_1 = require("./oneTrust/helpers");
13
13
  /**
14
14
  * Pull configuration from OneTrust down locally to disk
15
15
  *
@@ -20,35 +20,38 @@ const graphql_1 = require("./graphql");
20
20
  * yarn cli-sync-ot --hostname=customer.my.onetrust.com --oneTrustAuth=$ONE_TRUST_OAUTH_TOKEN --transcendAuth=$TRANSCEND_API_KEY
21
21
  */
22
22
  async function main() {
23
- const { file, fileFormat, hostname, oneTrustAuth, transcendAuth, transcendUrl, resource,
24
- // debug,
25
- dryRun, } = (0, oneTrust_1.parseCliSyncOtArguments)();
26
- // use the hostname and auth token to instantiate a client to talk to OneTrust
27
- const oneTrust = (0, oneTrust_1.createOneTrustGotInstance)({ hostname, auth: oneTrustAuth });
28
- // try {
29
- if (resource === enums_1.OneTrustPullResource.Assessments) {
30
- await (0, syncOneTrustAssessments_1.syncOneTrustAssessments)({
31
- oneTrust,
32
- file,
33
- fileFormat,
34
- dryRun,
35
- ...(transcendAuth && transcendUrl
36
- ? {
37
- transcend: (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, transcendAuth),
38
- }
39
- : {}),
40
- });
23
+ const { file, fileFormat, hostname, oneTrustAuth, transcendAuth, transcendUrl, resource, debug, dryRun, source, } = (0, oneTrust_1.parseCliSyncOtArguments)();
24
+ // instantiate a client to talk to OneTrust
25
+ const oneTrust = hostname && oneTrustAuth
26
+ ? (0, oneTrust_1.createOneTrustGotInstance)({
27
+ hostname,
28
+ auth: oneTrustAuth,
29
+ })
30
+ : undefined;
31
+ // instantiate a client to talk to Transcend
32
+ const transcend = transcendUrl && transcendAuth
33
+ ? (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, transcendAuth)
34
+ : undefined;
35
+ try {
36
+ if (resource === enums_1.OneTrustPullResource.Assessments) {
37
+ if (source === enums_1.OneTrustPullSource.OneTrust && oneTrust) {
38
+ await (0, helpers_1.syncOneTrustAssessmentsFromOneTrust)({
39
+ oneTrust,
40
+ file,
41
+ fileFormat,
42
+ dryRun,
43
+ ...(transcend && { transcend }),
44
+ });
45
+ }
46
+ else if (source === enums_1.OneTrustPullSource.File && file && transcend) {
47
+ await (0, helpers_1.syncOneTrustAssessmentsFromFile)({ file, transcend });
48
+ }
49
+ }
50
+ }
51
+ catch (err) {
52
+ logger_1.logger.error(colors_1.default.red(`An error occurred syncing the resource ${resource} from OneTrust: ${debug ? err.stack : err.message}`));
53
+ process.exit(1);
41
54
  }
42
- // } catch (err) {
43
- // logger.error(
44
- // colors.red(
45
- // `An error occurred syncing the resource ${resource} from OneTrust: ${
46
- // debug ? err.stack : err.message
47
- // }`,
48
- // ),
49
- // );
50
- // process.exit(1);
51
- // }
52
55
  // Indicate success
53
56
  logger_1.logger.info(colors_1.default.green(`Successfully synced OneTrust ${resource} to ${dryRun ? `disk at "${file}"` : 'Transcend'}!`));
54
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cli-sync-ot.js","sourceRoot":"","sources":["../src/cli-sync-ot.ts"],"names":[],"mappings":";;;;;;AACA,qCAAkC;AAElC,oDAA4B;AAC5B,yCAAgF;AAChF,mCAA+C;AAC/C,wFAAqF;AACrF,uCAAwD;AAExD;;;;;;;;GAQG;AACH,KAAK,UAAU,IAAI;IACjB,MAAM,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,QAAQ;IACR,SAAS;IACT,MAAM,GACP,GAAG,IAAA,kCAAuB,GAAE,CAAC;IAE9B,8EAA8E;IAC9E,MAAM,QAAQ,GAAG,IAAA,oCAAyB,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IAE7E,QAAQ;IACR,IAAI,QAAQ,KAAK,4BAAoB,CAAC,WAAW,EAAE;QACjD,MAAM,IAAA,iDAAuB,EAAC;YAC5B,QAAQ;YACR,IAAI;YACJ,UAAU;YACV,MAAM;YACN,GAAG,CAAC,aAAa,IAAI,YAAY;gBAC/B,CAAC,CAAC;oBACE,SAAS,EAAE,IAAA,qCAA2B,EAAC,YAAY,EAAE,aAAa,CAAC;iBACpE;gBACH,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;KACJ;IACD,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,8EAA8E;IAC9E,0CAA0C;IAC1C,YAAY;I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AAE,CAAC;iBAChC,CAAC,CAAC;aACJ;iBAAM,IAAI,MAAM,KAAK,0BAAkB,CAAC,IAAI,IAAI,IAAI,IAAI,SAAS,EAAE;gBAClE,MAAM,IAAA,yCAA+B,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;aAC5D;SACF;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,0CAA0C,QAAQ,mBAChD,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAC1B,EAAE,CACH,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,mBAAmB;IACnB,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,gCAAgC,QAAQ,OACtC,MAAM,CAAC,CAAC,CAAC,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,WACjC,GAAG,CACJ,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
package/build/codecs.d.ts CHANGED
@@ -5752,6 +5752,52 @@ export declare const DataCategoryGuessInput: t.IntersectionC<[t.TypeC<{
5752
5752
  }>]>;
5753
5753
  /** Type override */
5754
5754
  export type DataCategoryGuessInput = t.TypeOf<typeof DataCategoryGuessInput>;
5755
+ /**
5756
+ * A guessed data category from the content classifier
5757
+ */
5758
+ export declare const DataCategoryRecommendationInput: t.IntersectionC<[t.TypeC<{
5759
+ /** The parent category */
5760
+ category: t.IntersectionC<[t.TypeC<{
5761
+ /** The parent category */
5762
+ category: t.KeyofC<{
5763
+ ID: unknown;
5764
+ OTHER: unknown;
5765
+ UNSPECIFIED: unknown;
5766
+ FINANCIAL: unknown;
5767
+ HEALTH: unknown;
5768
+ CONTACT: unknown;
5769
+ LOCATION: unknown;
5770
+ DEMOGRAPHIC: unknown;
5771
+ ONLINE_ACTIVITY: unknown;
5772
+ USER_PROFILE: unknown;
5773
+ SOCIAL_MEDIA: unknown;
5774
+ CONNECTION: unknown;
5775
+ TRACKING: unknown;
5776
+ DEVICE: unknown;
5777
+ SURVEY: unknown;
5778
+ NOT_PERSONAL_DATA: unknown;
5779
+ INTEGRATION_IDENTIFIER: unknown;
5780
+ }>;
5781
+ }>, t.PartialC<{
5782
+ /** User-defined name for this sub category */
5783
+ name: t.StringC;
5784
+ }>]>;
5785
+ /** Status of guess */
5786
+ status: t.KeyofC<{
5787
+ REJECTED: unknown;
5788
+ MANUALLY_ADDED: unknown;
5789
+ CORRECTED: unknown;
5790
+ VALIDATED: unknown;
5791
+ CLASSIFIED: unknown;
5792
+ }>;
5793
+ /** Confidence level of guess */
5794
+ confidence: t.NumberC;
5795
+ }>, t.PartialC<{
5796
+ /** classifier version that produced the guess */
5797
+ classifierVersion: t.NumberC;
5798
+ }>]>;
5799
+ /** Type override */
5800
+ export type DataCategoryRecommendationInput = t.TypeOf<typeof DataCategoryRecommendationInput>;
5755
5801
  export declare const AttributeValueInput: t.IntersectionC<[t.TypeC<{
5756
5802
  /** Name of attribute value */
5757
5803
  name: t.StringC;
@@ -5797,11 +5843,14 @@ export declare const AttributeInput: t.IntersectionC<[t.TypeC<{
5797
5843
  identifier: unknown;
5798
5844
  legalHold: unknown;
5799
5845
  legalMatter: unknown;
5846
+ processingActivity: unknown;
5800
5847
  processingPurposeSubCategory: unknown;
5801
5848
  prompt: unknown;
5802
5849
  promptGroup: unknown;
5803
5850
  promptRun: unknown;
5804
5851
  request: unknown;
5852
+ scannedObject: unknown;
5853
+ scannedObjectPath: unknown;
5805
5854
  subject: unknown;
5806
5855
  subDataPoint: unknown;
5807
5856
  vendor: unknown;
@@ -41006,7 +41055,6 @@ export declare const PrivacyCenterInput: t.PartialC<{
41006
41055
  sideMenuText: t.StringC;
41007
41056
  primaryButton: t.StringC;
41008
41057
  secondaryButton: t.StringC;
41009
- /** Type override */
41010
41058
  emailButton: t.StringC;
41011
41059
  emailContainer: t.StringC;
41012
41060
  hero: t.StringC;
@@ -41026,12 +41074,12 @@ export declare const PrivacyCenterInput: t.PartialC<{
41026
41074
  }>]>;
41027
41075
  fontFamilyBody: t.IntersectionC<[t.TypeC<{
41028
41076
  name: t.StringC;
41029
- url: t.StringC; /** Name of attribute value */
41077
+ url: t.StringC;
41030
41078
  }>, t.PartialC<{
41031
41079
  assets: t.ArrayC<t.TypeC<{
41032
41080
  name: t.StringC;
41033
41081
  url: t.StringC;
41034
- }>>; /** Color */
41082
+ }>>; /** The parent category */
41035
41083
  }>]>;
41036
41084
  }>;
41037
41085
  }>;
@@ -47917,11 +47965,14 @@ export declare const AssessmentResourceInput: t.TypeC<{
47917
47965
  identifier: unknown;
47918
47966
  legalHold: unknown;
47919
47967
  legalMatter: unknown;
47968
+ processingActivity: unknown;
47920
47969
  processingPurposeSubCategory: unknown;
47921
47970
  prompt: unknown;
47922
47971
  promptGroup: unknown;
47923
47972
  promptRun: unknown;
47924
47973
  request: unknown;
47974
+ scannedObject: unknown;
47975
+ scannedObjectPath: unknown;
47925
47976
  subject: unknown;
47926
47977
  subDataPoint: unknown;
47927
47978
  vendor: unknown;
@@ -48223,11 +48274,14 @@ export declare const AssessmentInput: t.IntersectionC<[t.TypeC<{
48223
48274
  identifier: unknown;
48224
48275
  legalHold: unknown;
48225
48276
  legalMatter: unknown;
48277
+ processingActivity: unknown;
48226
48278
  processingPurposeSubCategory: unknown;
48227
48279
  prompt: unknown;
48228
48280
  promptGroup: unknown;
48229
48281
  promptRun: unknown;
48230
48282
  request: unknown;
48283
+ scannedObject: unknown;
48284
+ scannedObjectPath: unknown;
48231
48285
  subject: unknown;
48232
48286
  subDataPoint: unknown;
48233
48287
  vendor: unknown;
@@ -48255,11 +48309,14 @@ export declare const AssessmentInput: t.IntersectionC<[t.TypeC<{
48255
48309
  identifier: unknown;
48256
48310
  legalHold: unknown;
48257
48311
  legalMatter: unknown;
48312
+ processingActivity: unknown;
48258
48313
  processingPurposeSubCategory: unknown;
48259
48314
  prompt: unknown;
48260
48315
  promptGroup: unknown;
48261
48316
  promptRun: unknown;
48262
48317
  request: unknown;
48318
+ scannedObject: unknown;
48319
+ scannedObjectPath: unknown;
48263
48320
  subject: unknown;
48264
48321
  subDataPoint: unknown;
48265
48322
  vendor: unknown;
@@ -54057,11 +54114,14 @@ export declare const TranscendInput: t.PartialC<{
54057
54114
  identifier: unknown;
54058
54115
  legalHold: unknown;
54059
54116
  legalMatter: unknown;
54117
+ processingActivity: unknown;
54060
54118
  processingPurposeSubCategory: unknown;
54061
54119
  prompt: unknown;
54062
54120
  promptGroup: unknown;
54063
54121
  promptRun: unknown;
54064
54122
  request: unknown;
54123
+ scannedObject: unknown;
54124
+ scannedObjectPath: unknown;
54065
54125
  subject: unknown;
54066
54126
  subDataPoint: unknown;
54067
54127
  vendor: unknown;
@@ -88280,7 +88340,6 @@ export declare const TranscendInput: t.PartialC<{
88280
88340
  sideMenuText: t.StringC;
88281
88341
  primaryButton: t.StringC;
88282
88342
  secondaryButton: t.StringC;
88283
- /** Type override */
88284
88343
  emailButton: t.StringC;
88285
88344
  emailContainer: t.StringC;
88286
88345
  hero: t.StringC;
@@ -88300,12 +88359,12 @@ export declare const TranscendInput: t.PartialC<{
88300
88359
  }>]>;
88301
88360
  fontFamilyBody: t.IntersectionC<[t.TypeC<{
88302
88361
  name: t.StringC;
88303
- url: t.StringC; /** Name of attribute value */
88362
+ url: t.StringC;
88304
88363
  }>, t.PartialC<{
88305
88364
  assets: t.ArrayC<t.TypeC<{
88306
88365
  name: t.StringC;
88307
88366
  url: t.StringC;
88308
- }>>; /** Color */
88367
+ }>>; /** The parent category */
88309
88368
  }>]>;
88310
88369
  }>;
88311
88370
  }>;
@@ -89056,11 +89115,14 @@ export declare const TranscendInput: t.PartialC<{
89056
89115
  identifier: unknown;
89057
89116
  legalHold: unknown;
89058
89117
  legalMatter: unknown;
89118
+ processingActivity: unknown;
89059
89119
  processingPurposeSubCategory: unknown;
89060
89120
  prompt: unknown;
89061
89121
  promptGroup: unknown;
89062
89122
  promptRun: unknown;
89063
89123
  request: unknown;
89124
+ scannedObject: unknown;
89125
+ scannedObjectPath: unknown;
89064
89126
  subject: unknown;
89065
89127
  subDataPoint: unknown;
89066
89128
  vendor: unknown;
@@ -89088,11 +89150,14 @@ export declare const TranscendInput: t.PartialC<{
89088
89150
  identifier: unknown;
89089
89151
  legalHold: unknown;
89090
89152
  legalMatter: unknown;
89153
+ processingActivity: unknown;
89091
89154
  processingPurposeSubCategory: unknown;
89092
89155
  prompt: unknown;
89093
89156
  promptGroup: unknown;
89094
89157
  promptRun: unknown;
89095
89158
  request: unknown;
89159
+ scannedObject: unknown;
89160
+ scannedObjectPath: unknown;
89096
89161
  subject: unknown;
89097
89162
  subDataPoint: unknown;
89098
89163
  vendor: unknown;