@transcend-io/cli 4.93.0 → 4.95.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 +87 -28
  2. package/build/cli-create-assessment.d.ts +3 -0
  3. package/build/cli-create-assessment.d.ts.map +1 -0
  4. package/build/cli-create-assessment.js +162 -0
  5. package/build/cli-create-assessment.js.map +1 -0
  6. package/build/cli-push.js +9 -9
  7. package/build/cli-push.js.map +1 -1
  8. package/build/codecs.d.ts +54 -0
  9. package/build/codecs.d.ts.map +1 -1
  10. package/build/codecs.js +35 -1
  11. package/build/codecs.js.map +1 -1
  12. package/build/constants.d.ts.map +1 -1
  13. package/build/constants.js +4 -0
  14. package/build/constants.js.map +1 -1
  15. package/build/enums.d.ts +2 -0
  16. package/build/enums.d.ts.map +1 -1
  17. package/build/enums.js +2 -0
  18. package/build/enums.js.map +1 -1
  19. package/build/graphql/fetchAssessmentTemplates.d.ts +22 -0
  20. package/build/graphql/fetchAssessmentTemplates.d.ts.map +1 -0
  21. package/build/graphql/fetchAssessmentTemplates.js +32 -0
  22. package/build/graphql/fetchAssessmentTemplates.js.map +1 -0
  23. package/build/graphql/fetchAssessments.d.ts +30 -0
  24. package/build/graphql/fetchAssessments.d.ts.map +1 -0
  25. package/build/graphql/fetchAssessments.js +32 -0
  26. package/build/graphql/fetchAssessments.js.map +1 -0
  27. package/build/graphql/gqls/assessment.d.ts +7 -0
  28. package/build/graphql/gqls/assessment.d.ts.map +1 -0
  29. package/build/graphql/gqls/assessment.js +87 -0
  30. package/build/graphql/gqls/assessment.js.map +1 -0
  31. package/build/graphql/gqls/index.d.ts +1 -0
  32. package/build/graphql/gqls/index.d.ts.map +1 -1
  33. package/build/graphql/gqls/index.js +1 -0
  34. package/build/graphql/gqls/index.js.map +1 -1
  35. package/build/graphql/pullTranscendConfiguration.d.ts.map +1 -1
  36. package/build/graphql/pullTranscendConfiguration.js +27 -1
  37. package/build/graphql/pullTranscendConfiguration.js.map +1 -1
  38. package/build/graphql/syncAssessmentTemplates.d.ts +16 -0
  39. package/build/graphql/syncAssessmentTemplates.d.ts.map +1 -0
  40. package/build/graphql/syncAssessmentTemplates.js +61 -0
  41. package/build/graphql/syncAssessmentTemplates.js.map +1 -0
  42. package/build/graphql/syncAssessments.d.ts +39 -0
  43. package/build/graphql/syncAssessments.d.ts.map +1 -0
  44. package/build/graphql/syncAssessments.js +95 -0
  45. package/build/graphql/syncAssessments.js.map +1 -0
  46. package/build/graphql/syncConfigurationToTranscend.d.ts +3 -1
  47. package/build/graphql/syncConfigurationToTranscend.d.ts.map +1 -1
  48. package/build/graphql/syncConfigurationToTranscend.js +14 -2
  49. package/build/graphql/syncConfigurationToTranscend.js.map +1 -1
  50. package/build/graphql/syncDataSubject.d.ts +1 -1
  51. package/build/graphql/syncDataSubject.js +1 -1
  52. package/build/helpers/getVariablesFromHandlebarsTemplate.d.ts +10 -0
  53. package/build/helpers/getVariablesFromHandlebarsTemplate.d.ts.map +1 -0
  54. package/build/helpers/getVariablesFromHandlebarsTemplate.js +99 -0
  55. package/build/helpers/getVariablesFromHandlebarsTemplate.js.map +1 -0
  56. package/build/helpers/inquirer.d.ts +32 -0
  57. package/build/helpers/inquirer.d.ts.map +1 -0
  58. package/build/helpers/inquirer.js +64 -0
  59. package/build/helpers/inquirer.js.map +1 -0
  60. package/build/helpers/parseVariablesFromString.d.ts +10 -0
  61. package/build/helpers/parseVariablesFromString.d.ts.map +1 -0
  62. package/build/helpers/parseVariablesFromString.js +21 -0
  63. package/build/helpers/parseVariablesFromString.js.map +1 -0
  64. package/build/logger.js +0 -1
  65. package/build/logger.js.map +1 -1
  66. package/build/tests/getVariablesFromHandlebars.test.d.ts +2 -0
  67. package/build/tests/getVariablesFromHandlebars.test.d.ts.map +1 -0
  68. package/build/tests/getVariablesFromHandlebars.test.js +44 -0
  69. package/build/tests/getVariablesFromHandlebars.test.js.map +1 -0
  70. package/build/tsbuildinfo +1 -1
  71. package/package.json +3 -1
package/README.md CHANGED
@@ -114,6 +114,10 @@
114
114
  - [Arguments](#arguments-25)
115
115
  - [Usage](#usage-26)
116
116
  - [Proxy usage](#proxy-usage)
117
+ - [tr-create-assessment](#tr-create-assessment)
118
+ - [Authentication](#authentication-26)
119
+ - [Arguments](#arguments-26)
120
+ - [Usage](#usage-27)
117
121
 
118
122
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
119
123
 
@@ -157,6 +161,7 @@ yarn tr-upload-data-flows-from-csv --auth=$TRANSCEND_API_KEY
157
161
  yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY
158
162
  yarn tr-generate-api-keys --auth=$TRANSCEND_API_KEY
159
163
  yarn tr-build-xdi-sync-endpoint --auth=$TRANSCEND_API_KEY
164
+ yarn tr-create-assessment --auth=$TRANSCEND_API_KEY
160
165
  ```
161
166
 
162
167
  or
@@ -190,6 +195,7 @@ tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY
190
195
  tr-upload-data-flows-from-csv --auth=$TRANSCEND_API_KEY
191
196
  tr-generate-api-keys --auth=$TRANSCEND_API_KEY
192
197
  tr-build-xdi-sync-endpoint --auth=$TRANSCEND_API_KEY
198
+ tr-create-assessment --auth=$TRANSCEND_API_KEY
193
199
 
194
200
  ```
195
201
 
@@ -318,20 +324,22 @@ In order to use this cli, you will first need to generate an API key on the Tran
318
324
 
319
325
  The API key permissions for this command vary based on the value to the `resources` argument. See the table below to understand the necessary permissions for the resources you are attempting to pull.
320
326
 
321
- | Key | Description | Scope | Is Default | Link |
322
- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
323
- | apiKeys | API Key definitions assigned to Data Silos. API keys cannot be created through the cli, but you can map API key usage to Data Silos. | View API Keys | true | [Infrastructure -> API keys](https://app.transcend.io/infrastructure/api-keys) |
324
- | templates | Email templates. Only template titles can be created and mapped to other resources. | View Email Templates | true | [Privacy Requests -> Email Templates](https://app.transcend.io/privacy-requests/email-templates) |
325
- | dataSilos | The Data Silo/Integration definitions. | View Data Map,View Data Subject Request Settings | true | [Data Mapping -> Data Inventory -> Data Silos](https://app.transcend.io/data-map/data-inventory/) and [Infrastucture -> Integrations](https://app.transcend.io/infrastructure/integrationsdata-silos) |
326
- | enrichers | The Privacy Request enricher configurations. | View Identity Verification Settings | true | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
327
- | businessEntities | The business entities in the data inventory. | View Data Inventory | false | [Data Mapping -> Data Inventory -> Business Entities](https://app.transcend.io/data-map/data-inventory/business-entities) |
328
- | identifiers | The Privacy Request identifier configurations. | View Identity Verification Settings | false | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
329
- | actions | The Privacy Request action settings. | View Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
330
- | dataSubjects | The Privacy Request data subject settings. | View Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
331
- | attributes | Attribute definitions that define extra metadata for each table in the Admin Dashboard. | View Global Attributes | false | [Infrastructure -> Attributes](https://app.transcend.io/infrastructure/attributes) |
332
- | dataFlows | Consent Manager Data Flow definitions. | View Data Flows | false | [Consent Manager -> Data Flows](https://app.transcend.io/consent-manager/data-flows/approved) |
333
- | cookies | Consent Manager Cookie definitions. | View Data Flows | false | [Consent Manager -> Cookies](https://app.transcend.io/consent-manager/cookies/approved) |
334
- | consentManager | Consent Manager general settings, including domain list. | View Consent Manager | false | [Consent Manager -> Developer Settings](https://app.transcend.io/consent-manager/developer-settings) |
327
+ | Key | Description | Scope | Is Default | Link |
328
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
329
+ | apiKeys | API Key definitions assigned to Data Silos. API keys cannot be created through the cli, but you can map API key usage to Data Silos. | View API Keys | true | [Infrastructure -> API keys](https://app.transcend.io/infrastructure/api-keys) |
330
+ | templates | Email templates. Only template titles can be created and mapped to other resources. | View Email Templates | true | [Privacy Requests -> Email Templates](https://app.transcend.io/privacy-requests/email-templates) |
331
+ | dataSilos | The Data Silo/Integration definitions. | View Data Map,View Data Subject Request Settings | true | [Data Mapping -> Data Inventory -> Data Silos](https://app.transcend.io/data-map/data-inventory/) and [Infrastucture -> Integrations](https://app.transcend.io/infrastructure/integrationsdata-silos) |
332
+ | enrichers | The Privacy Request enricher configurations. | View Identity Verification Settings | true | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
333
+ | businessEntities | The business entities in the data inventory. | View Data Inventory | false | [Data Mapping -> Data Inventory -> Business Entities](https://app.transcend.io/data-map/data-inventory/business-entities) |
334
+ | identifiers | The Privacy Request identifier configurations. | View Identity Verification Settings | false | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
335
+ | actions | The Privacy Request action settings. | View Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
336
+ | dataSubjects | The Privacy Request data subject settings. | View Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
337
+ | attributes | Attribute definitions that define extra metadata for each table in the Admin Dashboard. | View Global Attributes | false | [Infrastructure -> Attributes](https://app.transcend.io/infrastructure/attributes) |
338
+ | dataFlows | Consent Manager Data Flow definitions. | View Data Flows | false | [Consent Manager -> Data Flows](https://app.transcend.io/consent-manager/data-flows/approved) |
339
+ | cookies | Consent Manager Cookie definitions. | View Data Flows | false | [Consent Manager -> Cookies](https://app.transcend.io/consent-manager/cookies/approved) |
340
+ | consentManager | Consent Manager general settings, including domain list. | View Consent Manager | false | [Consent Manager -> Developer Settings](https://app.transcend.io/consent-manager/developer-settings) |
341
+ | assessments | The Transcend assessments | View Assessments | false | [Assessments -> Browse](https://app.transcend.io/assessments/browse) |
342
+ | assessmentTemplates | The Transcend assessment tempaltes | View Assessments | false | [Assessments -> Templates](https://app.transcend.io/assessments/templates) |
335
343
 
336
344
  _Note: The scopes for tr-push are comprehensive of the scopes for tr-pull_
337
345
 
@@ -443,6 +451,12 @@ Pull in request data subject configurations (see [this example](./examples/data-
443
451
  tr-pull --auth=$TRANSCEND_API_KEY --resources=dataSubjects
444
452
  ```
445
453
 
454
+ Pull in assessments and assessment templates (see [this example](./examples/assessments.yml)):
455
+
456
+ ```sh
457
+ tr-pull --auth=$TRANSCEND_API_KEY --resources=assessment,assessmentTemplate
458
+ ```
459
+
446
460
  Pull everything:
447
461
 
448
462
  ```sh
@@ -481,20 +495,22 @@ In order to use this cli, you will first need to generate an API key on the Tran
481
495
 
482
496
  The API key needs the following scopes when pushing the various resource types:
483
497
 
484
- | Key | Description | Scope | Is Default | Link |
485
- | ---------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
486
- | apiKeys | API Key definitions. API keys cannot be created through the cli, but you can map API key usage to Data Silos. | View API Keys | true | [Infrastructure -> API keys](https://app.transcend.io/infrastructure/api-keys) |
487
- | templates | Email templates. Only template titles can be created and mapped to other resources. | Manage Email Templates | true | [Privacy Requests -> Email Templates](https://app.transcend.io/privacy-requests/email-templates) |
488
- | dataSilos | The Data Silo/Integration definitions. | Manage Data Map,Connect Data Silos | true | [Data Mapping -> Data Inventory -> Data Silos](https://app.transcend.io/data-map/data-inventory/) and [Infrastucture -> Integrations](https://app.transcend.io/infrastructure/integrationsdata-silos) |
489
- | enrichers | The Privacy Request enricher configurations. | Manage Request Identity Verification | true | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
490
- | businessEntities | The business entities in the data inventory. | Manage Data Inventory | false | [Data Mapping -> Data Inventory -> Business Entities](https://app.transcend.io/data-map/data-inventory/business-entities) |
491
- | identifiers | The Privacy Request identifier configurations. | Manage Request Identity Verification | false | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
492
- | actions | The Privacy Request action settings. | Manage Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
493
- | dataSubjects | The Privacy Request data subject settings. | Manage Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
494
- | attributes | Attribute definitions that define extra metadata for each table in the Admin Dashboard. | Manage Global Attributes | false | [Infrastructure -> Attributes](https://app.transcend.io/infrastructure/attributes) |
495
- | dataFlows | Consent Manager Data Flow definitions. | Manage Data Flows | false | [Consent Manager -> Data Flows](https://app.transcend.io/consent-manager/data-flows/approved) |
496
- | cookies | Consent Manager Cookie definitions. | Manage Data Flows | false | [Consent Manager -> Cookies](https://app.transcend.io/consent-manager/cookies/approved) |
497
- | consentManager | Consent Manager general settings, including domain list. | Manage Consent Manager Developer Settings | false | [Consent Manager -> Developer Settings](https://app.transcend.io/consent-manager/developer-settings) |
498
+ | Key | Description | Scope | Is Default | Link |
499
+ | ------------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
500
+ | apiKeys | API Key definitions. API keys cannot be created through the cli, but you can map API key usage to Data Silos. | View API Keys | true | [Infrastructure -> API keys](https://app.transcend.io/infrastructure/api-keys) |
501
+ | templates | Email templates. Only template titles can be created and mapped to other resources. | Manage Email Templates | true | [Privacy Requests -> Email Templates](https://app.transcend.io/privacy-requests/email-templates) |
502
+ | dataSilos | The Data Silo/Integration definitions. | Manage Data Map,Connect Data Silos | true | [Data Mapping -> Data Inventory -> Data Silos](https://app.transcend.io/data-map/data-inventory/) and [Infrastucture -> Integrations](https://app.transcend.io/infrastructure/integrationsdata-silos) |
503
+ | enrichers | The Privacy Request enricher configurations. | Manage Request Identity Verification | true | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
504
+ | businessEntities | The business entities in the data inventory. | Manage Data Inventory | false | [Data Mapping -> Data Inventory -> Business Entities](https://app.transcend.io/data-map/data-inventory/business-entities) |
505
+ | identifiers | The Privacy Request identifier configurations. | Manage Request Identity Verification | false | [Privacy Requests -> Identifiers](https://app.transcend.io/privacy-requests/identifiers) |
506
+ | actions | The Privacy Request action settings. | Manage Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
507
+ | dataSubjects | The Privacy Request data subject settings. | Manage Data Subject Request Settings | false | [Privacy Requests -> Request Settings](https://app.transcend.io/privacy-requests/settings) |
508
+ | attributes | Attribute definitions that define extra metadata for each table in the Admin Dashboard. | Manage Global Attributes | false | [Infrastructure -> Attributes](https://app.transcend.io/infrastructure/attributes) |
509
+ | dataFlows | Consent Manager Data Flow definitions. | Manage Data Flows | false | [Consent Manager -> Data Flows](https://app.transcend.io/consent-manager/data-flows/approved) |
510
+ | cookies | Consent Manager Cookie definitions. | Manage Data Flows | false | [Consent Manager -> Cookies](https://app.transcend.io/consent-manager/cookies/approved) |
511
+ | consentManager | Consent Manager general settings, including domain list. | Manage Consent Manager Developer Settings | false | [Consent Manager -> Developer Settings](https://app.transcend.io/consent-manager/developer-settings) |
512
+ | assessments | The Transcend assessments | Manage Assessments | false | [Assessments -> Browse](https://app.transcend.io/assessments/browse) |
513
+ | assessmentTemplates | The Transcend assessment tempaltes | Manage Assessments | false | [Assessments -> Templates](https://app.transcend.io/assessments/templates) |
498
514
 
499
515
  #### Arguments
500
516
 
@@ -2090,3 +2106,46 @@ yarn tr-build-xdi-sync-endpoint --auth=$TRANSCEND_API_KEY --xdiLocation=https://
2090
2106
  ## Proxy usage
2091
2107
 
2092
2108
  If you are trying to use the cli inside a corporate firewall and need to send traffic through a proxy, you can do so via the `http_proxy` environment variable or the `--httpProxy` flag, with a command like `yarn tr-pull --auth=$TRANSCEND_API_KEY --httpProxy="http://localhost:5051"`.
2109
+
2110
+ ### tr-create-assessment
2111
+
2112
+ This command allows for creating a new assessment form an assessment template.
2113
+
2114
+ Assessment templates can be managed here: https://app.transcend.io/assessments/templates
2115
+
2116
+ #### Authentication
2117
+
2118
+ 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) or by using the `yarn tr-generate-api-keys` command above.
2119
+
2120
+ The API key must have the following scopes:
2121
+
2122
+ - "Manage Assessments"
2123
+
2124
+ #### Arguments
2125
+
2126
+ | Argument | Description | Type | Default | Required |
2127
+ | --------- | ---------------------------------------------------------------- | ------ | -------------- | -------- |
2128
+ | auth | The Transcend API key with the scopes necessary for the command. | string | N/A | true |
2129
+ | template | The title of the assessment template | string | N/A - Prompted | false |
2130
+ | title | The title of the new assessment | string | N/A - Prompted | false |
2131
+ | variables | Additional template variables to pre-fill the template | string | N/A - Prompted | false |
2132
+
2133
+ #### Usage
2134
+
2135
+ Create a new assessment, filling out more information by being prompted by the terminal line
2136
+
2137
+ ```sh
2138
+ yarn tr-create-assessment --auth=$TRANSCEND_API_KEY
2139
+ ```
2140
+
2141
+ Specifying the template and title
2142
+
2143
+ ```sh
2144
+ yarn tr-create-assessment --auth=$TRANSCEND_API_KEY --title="Test" --template="[AI Prompt] Product Manager Notes Parsing"
2145
+ ```
2146
+
2147
+ Configuring additional variables:
2148
+
2149
+ ```sh
2150
+ yarn tr-create-assessment --auth=$TRANSCEND_API_KEY --title="Test" --template="[AI Prompt] Product Manager Notes Parsing" --variables=description:"testt test"
2151
+ ```
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-create-assessment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-create-assessment.d.ts","sourceRoot":"","sources":["../src/cli-create-assessment.ts"],"names":[],"mappings":""}
@@ -0,0 +1,162 @@
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 handlebars_1 = __importDefault(require("handlebars"));
8
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
9
+ const colors_1 = __importDefault(require("colors"));
10
+ const logger_1 = require("./logger");
11
+ const constants_1 = require("./constants");
12
+ const fetchAssessmentTemplates_1 = require("./graphql/fetchAssessmentTemplates");
13
+ const graphql_1 = require("./graphql");
14
+ const getVariablesFromHandlebarsTemplate_1 = require("./helpers/getVariablesFromHandlebarsTemplate");
15
+ const bluebird_1 = require("bluebird");
16
+ const inquirer_1 = require("./helpers/inquirer");
17
+ const parseVariablesFromString_1 = require("./helpers/parseVariablesFromString");
18
+ const syncAssessments_1 = require("./graphql/syncAssessments");
19
+ /**
20
+ * Create a new assessment from an assessment template
21
+ *
22
+ * Requires scopes:
23
+ * - Manage Assessments
24
+ *
25
+ * Dev Usage:
26
+ * yarn ts-node ./src/cli-create-assessment.ts --auth=$TRANSCEND_API_KEY \
27
+ * --template="Product Manager JSON AI Prompt Template
28
+ * --title="Determine Product Line"
29
+ *
30
+ * Standard usage:
31
+ * yarn tr-create-assessment --auth=$TRANSCEND_API_KEY \
32
+ * --template="Product Manager JSON AI Prompt Template
33
+ * --title="Determine Product Line"
34
+ */
35
+ async function main() {
36
+ // Parse command line arguments
37
+ const {
38
+ /** Transcend Backend URL */
39
+ transcendUrl = constants_1.DEFAULT_TRANSCEND_API,
40
+ /** API key */
41
+ auth,
42
+ /** The name of the assessment template to use */
43
+ template = '',
44
+ /** The title of the new template */
45
+ title = '',
46
+ /** Other variables to template */
47
+ variables = '', } = (0, yargs_parser_1.default)(process.argv.slice(2));
48
+ // Ensure auth is passed
49
+ if (!auth) {
50
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
51
+ process.exit(1);
52
+ }
53
+ // Validate title, if not provided prompt user
54
+ let templateTitle = title;
55
+ if (!templateTitle) {
56
+ templateTitle = await (0, inquirer_1.inquirerConfirmText)({
57
+ message: 'What should be the title of the new template?',
58
+ });
59
+ }
60
+ // Validate template
61
+ const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
62
+ const assessmentTemplates = await (0, fetchAssessmentTemplates_1.fetchAllAssessmentTemplates)(client);
63
+ const validTitles = assessmentTemplates.map(({ title }) => title);
64
+ // If provided, ensure valid
65
+ if (template && !validTitles.includes(template)) {
66
+ throw new Error(`Invalid template "${template}", expected one of: ${validTitles.join(', ')}`);
67
+ }
68
+ // Prompt user if not provided
69
+ let selectedTemplate = template;
70
+ if (!selectedTemplate) {
71
+ selectedTemplate = await (0, inquirer_1.inquirerAutoComplete)({
72
+ message: 'Select assessment template',
73
+ values: validTitles,
74
+ });
75
+ }
76
+ // Get the assessment template
77
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
78
+ const assessmentTemplate = assessmentTemplates.find((template) => template.title === selectedTemplate);
79
+ logger_1.logger.info(colors_1.default.magenta(`\n\n~~~~Formatting template~~~~~\n\n${assessmentTemplate.content}`));
80
+ // Parse out the variables
81
+ const vars = (0, parseVariablesFromString_1.parseVariablesFromString)(variables);
82
+ // Pull the variables out of the template
83
+ const schema = (0, getVariablesFromHandlebarsTemplate_1.getVariablesFromHandlebarsTemplate)(assessmentTemplate.content);
84
+ const results = {};
85
+ await (0, bluebird_1.mapSeries)(Object.entries(schema), async ([variable, type]) => {
86
+ // Format from cli option
87
+ if (vars[variable]) {
88
+ logger_1.logger.info(colors_1.default.white(`[${variable}] Using cli provided variable for "${variable}": ${vars[variable]}`));
89
+ results[variable] =
90
+ type && typeof type === 'object'
91
+ ? JSON.parse(vars[variable])
92
+ : vars[variable];
93
+ return;
94
+ }
95
+ // Handle Arrays
96
+ if (Array.isArray(type)) {
97
+ const [first] = type;
98
+ const result = [];
99
+ /* eslint-disable no-await-in-loop */
100
+ while (await (0, inquirer_1.inquirerConfirmBoolean)({
101
+ message: `[${variable}[${result.length}]] Add new entry?`,
102
+ })) {
103
+ const datum = {};
104
+ await (0, bluebird_1.mapSeries)(Object.keys(first), async (k) => {
105
+ const data = await (0, inquirer_1.inquirerConfirmText)({
106
+ message: `[${variable}[${result.length}].${k}]:`,
107
+ });
108
+ datum[k] = data;
109
+ });
110
+ result.push(datum);
111
+ }
112
+ /* eslint-enable no-await-in-loop */
113
+ if (result.length > 0) {
114
+ results[variable] = result;
115
+ }
116
+ return;
117
+ }
118
+ // Handle object
119
+ if (type && typeof type === 'object') {
120
+ const shouldRun = await (0, inquirer_1.inquirerConfirmBoolean)({
121
+ message: `[${variable}] Define object?[y/n]`,
122
+ });
123
+ if (shouldRun) {
124
+ const datum = {};
125
+ await (0, bluebird_1.mapSeries)(Object.keys(type), async (k) => {
126
+ const data = await (0, inquirer_1.inquirerConfirmText)({
127
+ message: `[${variable}.${k}]:`,
128
+ });
129
+ datum[k] = data;
130
+ });
131
+ results[variable] = datum;
132
+ }
133
+ return;
134
+ }
135
+ // Prompt user
136
+ const result = await (0, inquirer_1.inquirerConfirmText)({
137
+ message: `[${variable}] Fill variable. Type "n" to skip`,
138
+ });
139
+ if (result !== 'n') {
140
+ results[variable] = result;
141
+ }
142
+ });
143
+ // Create new assessment
144
+ const content = handlebars_1.default
145
+ .compile(assessmentTemplate.content)(results)
146
+ // remove empty lines
147
+ .split('\n')
148
+ .filter((x) => x.trim().length > 0)
149
+ .join('\n');
150
+ // Create the assessment
151
+ const assessmentId = await (0, syncAssessments_1.createAssessment)(client, {
152
+ title: templateTitle,
153
+ assessmentTemplateId: assessmentTemplate.id,
154
+ });
155
+ await (0, syncAssessments_1.updateAssessment)(client, {
156
+ id: assessmentId,
157
+ content,
158
+ });
159
+ logger_1.logger.info(colors_1.default.green(`View assessment at https://app.transcend.io/assessments/view/${assessmentId}`));
160
+ }
161
+ main();
162
+ //# sourceMappingURL=cli-create-assessment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-create-assessment.js","sourceRoot":"","sources":["../src/cli-create-assessment.ts"],"names":[],"mappings":";;;;;;AACA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,EAAE,CAAC"}
package/build/cli-push.js CHANGED
@@ -15,17 +15,18 @@ const graphql_1 = require("./graphql");
15
15
  const constants_1 = require("./constants");
16
16
  const api_keys_1 = require("./api-keys");
17
17
  const mergeTranscendInputs_1 = require("./mergeTranscendInputs");
18
+ const parseVariablesFromString_1 = require("./helpers/parseVariablesFromString");
18
19
  /**
19
20
  * Sync configuration to Transcend
20
21
  *
21
22
  * @param options - Options
22
23
  * @returns True if synced successfully, false if error occurs
23
24
  */
24
- async function syncConfiguration({ transcendUrl, auth, pageSize, publishToPrivacyCenter, contents, classifyService = false, }) {
25
+ async function syncConfiguration({ transcendUrl, auth, pageSize, publishToPrivacyCenter, contents, creatorId, classifyService = false, }) {
25
26
  const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
26
27
  // Sync to Transcend
27
28
  try {
28
- const encounteredError = await (0, graphql_1.syncConfigurationToTranscend)(contents, client, { pageSize, publishToPrivacyCenter, classifyService });
29
+ const encounteredError = await (0, graphql_1.syncConfigurationToTranscend)(contents, client, { pageSize, publishToPrivacyCenter, classifyService, creatorId });
29
30
  return !encounteredError;
30
31
  }
31
32
  catch (err) {
@@ -44,16 +45,13 @@ async function syncConfiguration({ transcendUrl, auth, pageSize, publishToPrivac
44
45
  */
45
46
  async function main() {
46
47
  // Parse command line arguments
47
- const { file = './transcend.yml', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, variables = '', pageSize = '', publishToPrivacyCenter, classifyService = '', } = (0, yargs_parser_1.default)(process.argv.slice(2));
48
+ const { file = './transcend.yml', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, variables = '', pageSize = '', publishToPrivacyCenter, classifyService = '',
49
+ /** Creator ID of user for assessment templates TODO: https://transcend.height.app/T-29850 */
50
+ creatorId = '', } = (0, yargs_parser_1.default)(process.argv.slice(2));
48
51
  // Parse authentication as API key or path to list of API keys
49
52
  const apiKeyOrList = await (0, api_keys_1.validateTranscendAuth)(auth);
50
53
  // Parse out the variables
51
- const splitVars = variables.split(',').filter((x) => !!x);
52
- const vars = {};
53
- splitVars.forEach((variable) => {
54
- const [k, v] = variable.split(':');
55
- vars[k] = v;
56
- });
54
+ const vars = (0, parseVariablesFromString_1.parseVariablesFromString)(variables);
57
55
  // check if we are being passed a list of API keys and a list of files
58
56
  let fileList;
59
57
  if (Array.isArray(apiKeyOrList) && (0, fs_1.lstatSync)(file).isDirectory()) {
@@ -107,6 +105,7 @@ async function main() {
107
105
  publishToPrivacyCenter: publishToPrivacyCenter === 'true',
108
106
  pageSize: parsedPageSize,
109
107
  classifyService: !!classifyService,
108
+ creatorId,
110
109
  });
111
110
  // exist with error code
112
111
  if (!success) {
@@ -143,6 +142,7 @@ async function main() {
143
142
  pageSize: parsedPageSize,
144
143
  publishToPrivacyCenter: publishToPrivacyCenter === 'true',
145
144
  classifyService: !!classifyService,
145
+ creatorId,
146
146
  });
147
147
  if (success) {
148
148
  logger_1.logger.info(colors_1.default.green(`${prefix}Successfully pushed configuration!`));
@@ -1 +1 @@
1
- {"version":3,"file":"cli-push.js","sourceRoot":"","sources":["../src/cli-push.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,qCAAkC;AAClC,uCAAqC;AACrC,2BAA2C;AAC3C,+BAA4B;AAC5B,2DAAwD;AACxD,oDAA4B;AAC5B,uCAGmB;AAEnB,2CAA6E;AAG7E,yCAA8D;AAC9D,iEAA8D;AAE9D;;;;;GAKG;AACH,KAAK,UAAU,iBAAiB,CAAC,EAC/B,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,sBAAsB,EACtB,QAAQ,EACR,eAAe,GAAG,KAAK,GAcxB;IACC,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,oBAAoB;IACpB,IAAI;QACF,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAA4B,EACzD,QAAQ,EACR,MAAM,EACN,EAAE,QAAQ,EAAE,sBAAsB,EAAE,eAAe,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M,CAAC,gBAAgB,CAAC,CAAC;aACjD;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;YAChC,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,GAAG,CACR,gCAAgC,iBAAiB,CAAC,IAAI,CACpD,GAAG,CACJ,2DAA2D,mCAAuB,EAAE,CACtF,CACF,CAAC;YAEF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;KACF;IAED,mBAAmB;IACnB,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,uDAAuD,mCAAuB,EAAE,CACjF,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
package/build/codecs.d.ts CHANGED
@@ -5641,6 +5641,37 @@ export declare const Attributes: t.TypeC<{
5641
5641
  }>;
5642
5642
  /** Type override */
5643
5643
  export type Attributes = t.TypeOf<typeof Attributes>;
5644
+ /**
5645
+ * AssessmentTemplate type definition.
5646
+ */
5647
+ export declare const AssessmentTemplateInput: t.IntersectionC<[t.TypeC<{
5648
+ /** The title of the assessment template. */
5649
+ title: t.StringC;
5650
+ /** The content of the assessment template. */
5651
+ content: t.StringC;
5652
+ }>, t.PartialC<{
5653
+ /** Attribute keys related to the assessment template. */
5654
+ attributeKeys: t.ArrayC<t.StringC>;
5655
+ }>]>;
5656
+ /**
5657
+ * Type override
5658
+ */
5659
+ export type AssessmentTemplateInput = t.TypeOf<typeof AssessmentTemplateInput>;
5660
+ /**
5661
+ * Assessment type definition.
5662
+ */
5663
+ export declare const AssessmentInput: t.TypeC<{
5664
+ /** The title of the assessment template. */
5665
+ title: t.StringC;
5666
+ /** The content of the assessment template. */
5667
+ content: t.StringC;
5668
+ /** Title of the assessment template */
5669
+ 'assessment-template': t.StringC;
5670
+ }>;
5671
+ /**
5672
+ * Type override
5673
+ */
5674
+ export type AssessmentInput = t.TypeOf<typeof AssessmentInput>;
5644
5675
  /**
5645
5676
  * Annotate specific fields within a datapoint. These are often database table columns.
5646
5677
  * Fields can also be a JSON object or separate file.
@@ -74130,6 +74161,29 @@ export declare const TranscendInput: t.PartialC<{
74130
74161
  /** The Shared XDI host sync groups config (JSON) for this airgap bundle */
74131
74162
  syncGroups: t.StringC;
74132
74163
  }>;
74164
+ /**
74165
+ * Assessment template definitions
74166
+ */
74167
+ 'assessment-templates': t.ArrayC<t.IntersectionC<[t.TypeC<{
74168
+ /** The title of the assessment template. */
74169
+ title: t.StringC;
74170
+ /** The content of the assessment template. */
74171
+ content: t.StringC;
74172
+ }>, t.PartialC<{
74173
+ /** Attribute keys related to the assessment template. */
74174
+ attributeKeys: t.ArrayC<t.StringC>;
74175
+ }>]>>;
74176
+ /**
74177
+ * Consent manager definition
74178
+ */
74179
+ assessments: t.ArrayC<t.TypeC<{
74180
+ /** The title of the assessment template. */
74181
+ title: t.StringC;
74182
+ /** The content of the assessment template. */
74183
+ content: t.StringC;
74184
+ /** Title of the assessment template */
74185
+ 'assessment-template': t.StringC;
74186
+ }>>;
74133
74187
  }>;
74134
74188
  /** Type override */
74135
74189
  export type TranscendInput = t.TypeOf<typeof TranscendInput>;