@transcend-io/cli 6.9.0 → 6.11.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 (140) hide show
  1. package/README.md +88 -12
  2. package/build/cli-request-upload.js +1 -1
  3. package/build/cli-request-upload.js.map +1 -1
  4. package/build/cli-upload-consent-preferences.js +2 -2
  5. package/build/cli-upload-consent-preferences.js.map +1 -1
  6. package/build/cli-upload-preferences.d.ts +3 -0
  7. package/build/cli-upload-preferences.d.ts.map +1 -0
  8. package/build/cli-upload-preferences.js +79 -0
  9. package/build/cli-upload-preferences.js.map +1 -0
  10. package/build/codecs.d.ts +12 -0
  11. package/build/codecs.d.ts.map +1 -1
  12. package/build/codecs.js +2 -0
  13. package/build/codecs.js.map +1 -1
  14. package/build/consent-manager/index.d.ts +1 -0
  15. package/build/consent-manager/index.d.ts.map +1 -1
  16. package/build/consent-manager/index.js +1 -0
  17. package/build/consent-manager/index.js.map +1 -1
  18. package/build/consent-manager/{uploadConsentPreferences.d.ts → uploadConsents.d.ts} +2 -2
  19. package/build/consent-manager/uploadConsents.d.ts.map +1 -0
  20. package/build/consent-manager/{uploadConsentPreferences.js → uploadConsents.js} +4 -4
  21. package/build/consent-manager/uploadConsents.js.map +1 -0
  22. package/build/graphql/createSombraGotInstance.d.ts.map +1 -1
  23. package/build/graphql/createSombraGotInstance.js.map +1 -1
  24. package/build/graphql/fetchAllPreferenceTopics.d.ts +28 -0
  25. package/build/graphql/fetchAllPreferenceTopics.d.ts.map +1 -0
  26. package/build/graphql/fetchAllPreferenceTopics.js +32 -0
  27. package/build/graphql/fetchAllPreferenceTopics.js.map +1 -0
  28. package/build/graphql/fetchAllPurposes.d.ts +25 -0
  29. package/build/graphql/fetchAllPurposes.d.ts.map +1 -0
  30. package/build/graphql/fetchAllPurposes.js +36 -0
  31. package/build/graphql/fetchAllPurposes.js.map +1 -0
  32. package/build/graphql/fetchConsentManagerId.d.ts +0 -7
  33. package/build/graphql/fetchConsentManagerId.d.ts.map +1 -1
  34. package/build/graphql/fetchConsentManagerId.js +1 -12
  35. package/build/graphql/fetchConsentManagerId.js.map +1 -1
  36. package/build/graphql/gqls/consentManager.d.ts +0 -1
  37. package/build/graphql/gqls/consentManager.d.ts.map +1 -1
  38. package/build/graphql/gqls/consentManager.js +1 -12
  39. package/build/graphql/gqls/consentManager.js.map +1 -1
  40. package/build/graphql/gqls/index.d.ts +2 -0
  41. package/build/graphql/gqls/index.d.ts.map +1 -1
  42. package/build/graphql/gqls/index.js +2 -0
  43. package/build/graphql/gqls/index.js.map +1 -1
  44. package/build/graphql/gqls/preferenceTopic.d.ts +2 -0
  45. package/build/graphql/gqls/preferenceTopic.d.ts.map +1 -0
  46. package/build/graphql/gqls/preferenceTopic.js +33 -0
  47. package/build/graphql/gqls/preferenceTopic.js.map +1 -0
  48. package/build/graphql/gqls/purpose.d.ts +2 -0
  49. package/build/graphql/gqls/purpose.d.ts.map +1 -0
  50. package/build/graphql/gqls/purpose.js +35 -0
  51. package/build/graphql/gqls/purpose.js.map +1 -0
  52. package/build/graphql/index.d.ts +2 -0
  53. package/build/graphql/index.d.ts.map +1 -1
  54. package/build/graphql/index.js +2 -0
  55. package/build/graphql/index.js.map +1 -1
  56. package/build/graphql/pullTranscendConfiguration.d.ts.map +1 -1
  57. package/build/graphql/pullTranscendConfiguration.js +2 -1
  58. package/build/graphql/pullTranscendConfiguration.js.map +1 -1
  59. package/build/graphql/syncConsentManager.js +2 -1
  60. package/build/graphql/syncConsentManager.js.map +1 -1
  61. package/build/graphql/syncCookies.js +1 -1
  62. package/build/graphql/syncCookies.js.map +1 -1
  63. package/build/graphql/syncDataFlows.js +2 -2
  64. package/build/graphql/syncDataFlows.js.map +1 -1
  65. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.d.ts +19 -0
  66. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.d.ts.map +1 -0
  67. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.js +56 -0
  68. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.js.map +1 -0
  69. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.d.ts +20 -0
  70. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.d.ts.map +1 -0
  71. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.js +58 -0
  72. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.js.map +1 -0
  73. package/build/preference-management/codecs.d.ts +369 -0
  74. package/build/preference-management/codecs.d.ts.map +1 -0
  75. package/build/preference-management/codecs.js +122 -0
  76. package/build/preference-management/codecs.js.map +1 -0
  77. package/build/preference-management/getPreferenceUpdatesFromRow.d.ts +37 -0
  78. package/build/preference-management/getPreferenceUpdatesFromRow.d.ts.map +1 -0
  79. package/build/preference-management/getPreferenceUpdatesFromRow.js +144 -0
  80. package/build/preference-management/getPreferenceUpdatesFromRow.js.map +1 -0
  81. package/build/preference-management/getPreferencesForIdentifiers.d.ts +21 -0
  82. package/build/preference-management/getPreferencesForIdentifiers.d.ts.map +1 -0
  83. package/build/preference-management/getPreferencesForIdentifiers.js +113 -0
  84. package/build/preference-management/getPreferencesForIdentifiers.js.map +1 -0
  85. package/build/preference-management/index.d.ts +12 -0
  86. package/build/preference-management/index.d.ts.map +1 -0
  87. package/build/preference-management/index.js +28 -0
  88. package/build/preference-management/index.js.map +1 -0
  89. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.d.ts +17 -0
  90. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.d.ts.map +1 -0
  91. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.js +86 -0
  92. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.js.map +1 -0
  93. package/build/preference-management/parsePreferenceIdentifiersFromCsv.d.ts +18 -0
  94. package/build/preference-management/parsePreferenceIdentifiersFromCsv.d.ts.map +1 -0
  95. package/build/preference-management/parsePreferenceIdentifiersFromCsv.js +97 -0
  96. package/build/preference-management/parsePreferenceIdentifiersFromCsv.js.map +1 -0
  97. package/build/preference-management/parsePreferenceManagementCsv.d.ts +25 -0
  98. package/build/preference-management/parsePreferenceManagementCsv.d.ts.map +1 -0
  99. package/build/preference-management/parsePreferenceManagementCsv.js +145 -0
  100. package/build/preference-management/parsePreferenceManagementCsv.js.map +1 -0
  101. package/build/preference-management/parsePreferenceTimestampsFromCsv.d.ts +16 -0
  102. package/build/preference-management/parsePreferenceTimestampsFromCsv.d.ts.map +1 -0
  103. package/build/preference-management/parsePreferenceTimestampsFromCsv.js +65 -0
  104. package/build/preference-management/parsePreferenceTimestampsFromCsv.js.map +1 -0
  105. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.d.ts +2 -0
  106. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.d.ts.map +1 -0
  107. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.js +408 -0
  108. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.js.map +1 -0
  109. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.d.ts +2 -0
  110. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.d.ts.map +1 -0
  111. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.js +428 -0
  112. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.js.map +1 -0
  113. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.d.ts +2 -0
  114. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.d.ts.map +1 -0
  115. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.js +549 -0
  116. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.js.map +1 -0
  117. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.d.ts +33 -0
  118. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.d.ts.map +1 -0
  119. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.js +166 -0
  120. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.js.map +1 -0
  121. package/build/requests/bulkRestartRequests.js +2 -2
  122. package/build/requests/bulkRestartRequests.js.map +1 -1
  123. package/build/requests/mapColumnsToAttributes.d.ts.map +1 -1
  124. package/build/requests/mapColumnsToAttributes.js +1 -3
  125. package/build/requests/mapColumnsToAttributes.js.map +1 -1
  126. package/build/requests/mapColumnsToIdentifiers.d.ts.map +1 -1
  127. package/build/requests/mapColumnsToIdentifiers.js +1 -3
  128. package/build/requests/mapColumnsToIdentifiers.js.map +1 -1
  129. package/build/requests/mapCsvColumnsToApi.d.ts.map +1 -1
  130. package/build/requests/mapCsvColumnsToApi.js +1 -3
  131. package/build/requests/mapCsvColumnsToApi.js.map +1 -1
  132. package/build/requests/mapRequestEnumValues.d.ts.map +1 -1
  133. package/build/requests/mapRequestEnumValues.js +6 -6
  134. package/build/requests/mapRequestEnumValues.js.map +1 -1
  135. package/build/requests/uploadPrivacyRequestsFromCsv.js +3 -3
  136. package/build/requests/uploadPrivacyRequestsFromCsv.js.map +1 -1
  137. package/build/tsbuildinfo +1 -1
  138. package/package.json +6 -3
  139. package/build/consent-manager/uploadConsentPreferences.d.ts.map +0 -1
  140. package/build/consent-manager/uploadConsentPreferences.js.map +0 -1
package/README.md CHANGED
@@ -118,30 +118,35 @@
118
118
  - [Authentication](#authentication-26)
119
119
  - [Arguments](#arguments-26)
120
120
  - [Usage](#usage-27)
121
- - [tr-upload-consent-preferences](#tr-upload-consent-preferences)
121
+ - [tr-upload-preferences](#tr-upload-preferences)
122
122
  - [Authentication](#authentication-27)
123
+ - [Authentication](#authentication-28)
123
124
  - [Arguments](#arguments-27)
124
125
  - [Usage](#usage-28)
125
- - [tr-pull-consent-preferences](#tr-pull-consent-preferences)
126
- - [Authentication](#authentication-28)
126
+ - [tr-upload-consent-preferences](#tr-upload-consent-preferences)
127
+ - [Authentication](#authentication-29)
127
128
  - [Arguments](#arguments-28)
128
129
  - [Usage](#usage-29)
129
- - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
130
- - [Authentication](#authentication-29)
130
+ - [tr-pull-consent-preferences](#tr-pull-consent-preferences)
131
+ - [Authentication](#authentication-30)
131
132
  - [Arguments](#arguments-29)
132
133
  - [Usage](#usage-30)
133
- - [tr-upload-cookies-from-csv](#tr-upload-cookies-from-csv)
134
- - [Authentication](#authentication-30)
134
+ - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
135
+ - [Authentication](#authentication-31)
135
136
  - [Arguments](#arguments-30)
136
137
  - [Usage](#usage-31)
137
- - [tr-generate-api-keys](#tr-generate-api-keys)
138
- - [Authentication](#authentication-31)
138
+ - [tr-upload-cookies-from-csv](#tr-upload-cookies-from-csv)
139
+ - [Authentication](#authentication-32)
139
140
  - [Arguments](#arguments-31)
140
141
  - [Usage](#usage-32)
141
- - [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
142
- - [Authentication](#authentication-32)
142
+ - [tr-generate-api-keys](#tr-generate-api-keys)
143
+ - [Authentication](#authentication-33)
143
144
  - [Arguments](#arguments-32)
144
145
  - [Usage](#usage-33)
146
+ - [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
147
+ - [Authentication](#authentication-34)
148
+ - [Arguments](#arguments-33)
149
+ - [Usage](#usage-34)
145
150
  - [Prompt Manager](#prompt-manager)
146
151
  - [Proxy usage](#proxy-usage)
147
152
 
@@ -262,7 +267,13 @@ You can find various examples for your `transcend.yml` file in the [examples/](.
262
267
 
263
268
  The API for this YAML file can be found in [./src/codecs.ts](./src/codecs.ts) under the variable named "TranscendInput". The shape of the YAML file will be type-checked every time a command is run.
264
269
 
265
- By default, your editor or IDE should recognize `transcend.yml` and validate it against our published [JSON schema](./transcend-yml-schema-v4.json). This is dependent on whether your editor uses [yaml-language-server](https://github.com/redhat-developer/yaml-language-server), such as through the [VS Code YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml).
270
+ By default, your editor or IDE should recognize `transcend.yml` and validate it against our latest published [JSON schema](./transcend-yml-schema-latest.json). This is dependent on whether your editor uses [yaml-language-server](https://github.com/redhat-developer/yaml-language-server), such as through the [VS Code YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml).
271
+
272
+ Your editor will use the latest version's schema. To pin the `transcend.yml` schema to a previous major version, include this at the top of your file (and change `v4` to your target major version):
273
+
274
+ ```yml
275
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/transcend-io/cli/main/transcend-yml-schema-v4.json
276
+ ```
266
277
 
267
278
  The structure of `transcend.yml` looks something like the following:
268
279
 
@@ -2290,6 +2301,71 @@ Specify the backend URL, needed for US hosted backend infrastructure:
2290
2301
  yarn tr-pull-datapoints --auth=$TRANSCEND_API_KEY --file=./datapoints.csv --transcendUrl=https://api.us.transcend.io
2291
2302
  ```
2292
2303
 
2304
+ ### tr-upload-preferences
2305
+
2306
+ This command allows for updating of preference management data to your Transcend Preference Store.
2307
+
2308
+ This command uses [inquirer](https://github.com/SBoudrias/Inquirer.js/) to prompt the user to
2309
+ map the shape of the CSV to the shape of the Transcend API. There is no requirement for the
2310
+ shape of the incoming CSV, as the script will handle the mapping process.
2311
+
2312
+ The script will also produce a JSON cache file, that allows for the mappings to be preserved between runs.
2313
+ This can be useful if you have the same CSV shape that needs to be imported multiple times.
2314
+ Once the mapping process is done once, it does not need to be done again.
2315
+
2316
+ Additionally, the JSON cache file will store the result of any preferences that fail to be uploaded so that the
2317
+ script can be run multiple times if an issue happens.
2318
+
2319
+ #### Authentication
2320
+
2321
+ 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).
2322
+
2323
+ The API key needs the following scopes:
2324
+
2325
+ - Modify User Stored Preferences
2326
+ - View Managed Consent Database Admin API
2327
+ - View Preference Store Settings
2328
+
2329
+ #### Authentication
2330
+
2331
+ In order to use this cli, you will first need to follow [this guide](https://docs.transcend.io/docs/consent/reference/managed-consent-database#authenticate-a-user's-consent) in order
2332
+
2333
+ #### Arguments
2334
+
2335
+ | Argument | Description | Type | Default | Required |
2336
+ | -------------------- | ------------------------------------------------------------------------------------------------- | ------------------ | -------------------------------------------- | -------- |
2337
+ | auth | The Transcend API key with the scopes necessary for the command. | string | N/A | true |
2338
+ | partition | The partition key to download consent preferences to | string | N/A | true |
2339
+ | sombraAuth | The sombra internal key, use for additional authentication when self-hosting sombra. | string | N/A | false |
2340
+ | transcendUrl | URL of the Transcend backend. Use https://consent.us.transcend.io for US hosting. | string - URL | https://consent.transcend.io | false |
2341
+ | file | Path to the CSV file to load preferences from | string - file-path | ./preferences.csv | false |
2342
+ | dryRun | Whether to do a dry run only - will write results ti receiptFilepath without updating Transcend | boolean | false | false |
2343
+ | skipWorkflowTriggers | Whether to skip workflow triggers when uploading to preference store | boolean | false | false |
2344
+ | skipConflictUpdates | Whether to skip uploading of any records where the preference store and file have a hard conflict | boolean | false | false |
2345
+ | isSilent | Whether to skip sending emails in workflows | boolean | true | false |
2346
+ | attributes | Attributes to add to any DSR request if created | string | Tags:transcend-cli,Source:transcend-cli | false |
2347
+ | receiptFilepath | Store resulting, continuing where left off | string - file-path | ./preference-management-upload-receipts.json | false |
2348
+
2349
+ #### Usage
2350
+
2351
+ Upload consent preferences to partition key `4d1c5daa-90b7-4d18-aa40-f86a43d2c726`
2352
+
2353
+ ```sh
2354
+ yarn tr-upload-preferences --auth=$TRANSCEND_API_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726
2355
+ ```
2356
+
2357
+ Upload consent preferences with additional options
2358
+
2359
+ ```sh
2360
+ yarn tr-upload-preferences --auth=$TRANSCEND_API_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 --file=./preferences.csv --dryRun=true --skipWorkflowTriggers=true --skipConflictUpdates=true --isSilent=false --attributes="Tags:transcend-cli,Source:transcend-cli" --receiptFilepath=./preference-management-upload-receipts.json
2361
+ ```
2362
+
2363
+ Specifying the backend URL, needed for US hosted backend infrastructure.
2364
+
2365
+ ```sh
2366
+ yarn tr-upload-preferences --auth=$TRANSCEND_API_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 --transcendUrl=https://consent.us.transcend.io
2367
+ ```
2368
+
2293
2369
  ### tr-upload-consent-preferences
2294
2370
 
2295
2371
  This command allows for updating of consent preferences to the [Managed Consent Database](https://docs.transcend.io/docs/consent/reference/managed-consent-database).
@@ -53,7 +53,7 @@ async function main() {
53
53
  skipSendingReceipt: skipSendingReceipt === 'true',
54
54
  emailIsVerified: emailIsVerified === 'true',
55
55
  isTest: isTest === 'true',
56
- dryRun: dryRun === 'true',
56
+ dryRun: dryRun !== 'false',
57
57
  });
58
58
  }
59
59
  main();
@@ -1 +1 @@
1
- {"version":3,"file":"cli-request-upload.js","sourceRoot":"","sources":["../src/cli-request-upload.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,yCAA0E;AAC1E,2CAAoD;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,EACJ,IAAI,GAAG,gBAAgB,EACvB,YAAY,GAAG,iCAAqB,EACpC,aAAa,GAAG,yCAAyC,EACzD,oBAAoB,GAAG,mCAAmC,EAC1D,UAAU,EACV,WAAW,GAAG,IAAI,EAClB,MAAM,GAAG,OAAO,EAChB,QAAQ,GAAG,MAAM,EACjB,kBAAkB,GAAG,OAAO,EAC5B,uBAAuB,GAAG,GAAG,EAAE,MAAM;IACrC,eAAe,GAAG,MAAM,EACxB,MAAM,GAAG,OAAO,EAChB,KAAK,GAAG,OAAO,EACf,cAAc,GAAG,OAAO,EACxB,UAAU,GAAG,oBAAoB,GAClC,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,0BAA0B;IAC1B,MAAM,IAAA,uCAA4B,EAAC;QACjC,aAAa;QACb,oBAAoB;QACpB,IAAI;QACJ,IAAI;QACJ,UAAU;QACV,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QACtC,YAAY;QACZ,uBAAuB;QACvB,UAAU,EAAE,IAAA,yBAAc,EAAC,UAAU,CAAC;QACtC,KAAK,EAAE,KAAK,KAAK,MAAM;QACvB,cAAc,EAAE,cAAc,KAAK,MAAM;QACzC,QAAQ,EAAE,QAAQ,KAAK,MAAM;QAC7B,kBAAkB,EAAE,kBAAkB,KAAK,MAAM;QACjD,eAAe,EAAE,eAAe,KAAK,MAAM;QAC3C,MAAM,EAAE,MAAM,KAAK,MAAM;QACzB,MAAM,EAAE,MAAM,KAAK,MAAM;KAC1B,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"cli-request-upload.js","sourceRoot":"","sources":["../src/cli-request-upload.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,yCAA0E;AAC1E,2CAAoD;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,EACJ,IAAI,GAAG,gBAAgB,EACvB,YAAY,GAAG,iCAAqB,EACpC,aAAa,GAAG,yCAAyC,EACzD,oBAAoB,GAAG,mCAAmC,EAC1D,UAAU,EACV,WAAW,GAAG,IAAI,EAClB,MAAM,GAAG,OAAO,EAChB,QAAQ,GAAG,MAAM,EACjB,kBAAkB,GAAG,OAAO,EAC5B,uBAAuB,GAAG,GAAG,EAAE,MAAM;IACrC,eAAe,GAAG,MAAM,EACxB,MAAM,GAAG,OAAO,EAChB,KAAK,GAAG,OAAO,EACf,cAAc,GAAG,OAAO,EACxB,UAAU,GAAG,oBAAoB,GAClC,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,0BAA0B;IAC1B,MAAM,IAAA,uCAA4B,EAAC;QACjC,aAAa;QACb,oBAAoB;QACpB,IAAI;QACJ,IAAI;QACJ,UAAU;QACV,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QACtC,YAAY;QACZ,uBAAuB;QACvB,UAAU,EAAE,IAAA,yBAAc,EAAC,UAAU,CAAC;QACtC,KAAK,EAAE,KAAK,KAAK,MAAM;QACvB,cAAc,EAAE,cAAc,KAAK,MAAM;QACzC,QAAQ,EAAE,QAAQ,KAAK,MAAM;QAC7B,kBAAkB,EAAE,kBAAkB,KAAK,MAAM;QACjD,eAAe,EAAE,eAAe,KAAK,MAAM;QAC3C,MAAM,EAAE,MAAM,KAAK,MAAM;QACzB,MAAM,EAAE,MAAM,KAAK,OAAO;KAC3B,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -8,7 +8,7 @@ const yargs_parser_1 = __importDefault(require("yargs-parser"));
8
8
  const colors_1 = __importDefault(require("colors"));
9
9
  const logger_1 = require("./logger");
10
10
  const constants_1 = require("./constants");
11
- const uploadConsentPreferences_1 = require("./consent-manager/uploadConsentPreferences");
11
+ const uploadConsents_1 = require("./consent-manager/uploadConsents");
12
12
  const types_1 = require("./consent-manager/types");
13
13
  const requests_1 = require("./requests");
14
14
  /**
@@ -60,7 +60,7 @@ async function main() {
60
60
  // Load in preferences from csv
61
61
  const preferences = (0, requests_1.readCsv)(file, types_1.ConsentPreferenceUpload);
62
62
  // Upload cookies
63
- await (0, uploadConsentPreferences_1.uploadConsentPreferences)({
63
+ await (0, uploadConsents_1.uploadConsents)({
64
64
  base64EncryptionKey,
65
65
  base64SigningKey,
66
66
  preferences,
@@ -1 +1 @@
1
- {"version":3,"file":"cli-upload-consent-preferences.js","sourceRoot":"","sources":["../src/cli-upload-consent-preferences.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,2CAA4D;AAC5D,yFAAsF;AACtF,mDAAkE;AAClE,yCAAqC;AAErC;;;;;;;;;;;;;GAaG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM;IACJ,oCAAoC;IACpC,IAAI,GAAG,iBAAiB;IACxB,oBAAoB;IACpB,YAAY,GAAG,yCAA6B;IAC5C,4BAA4B;IAC5B,mBAAmB;IACnB,yBAAyB;IACzB,gBAAgB;IAChB,iCAAiC;IACjC,SAAS;IACT,kBAAkB;IAClB,WAAW,GAAG,KAAK,GACpB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,mBAAmB,EAAE;QACxB,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,0CAA0C;YACxC,+EAA+E,CAClF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,IAAI,CAAC,gBAAgB,EAAE;QACrB,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uCAAuC;YACrC,yEAAyE,CAC5E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,mBAAmB;IACnB,IAAI,CAAC,SAAS,EAAE;QACd,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,gCAAgC;YAC9B,wEAAwE,CAC3E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,+BAA+B;IAC/B,MAAM,WAAW,GAAG,IAAA,kBAAO,EAAC,IAAI,EAAE,+BAAuB,CAAC,CAAC;IAE3D,iBAAiB;IACjB,MAAM,IAAA,mDAAwB,EAAC;QAC7B,mBAAmB;QACnB,gBAAgB;QAChB,WAAW;QACX,SAAS;QACT,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QACtC,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"cli-upload-consent-preferences.js","sourceRoot":"","sources":["../src/cli-upload-consent-preferences.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,2CAA4D;AAC5D,qEAAkE;AAClE,mDAAkE;AAClE,yCAAqC;AAErC;;;;;;;;;;;;;GAaG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM;IACJ,oCAAoC;IACpC,IAAI,GAAG,iBAAiB;IACxB,oBAAoB;IACpB,YAAY,GAAG,yCAA6B;IAC5C,4BAA4B;IAC5B,mBAAmB;IACnB,yBAAyB;IACzB,gBAAgB;IAChB,iCAAiC;IACjC,SAAS;IACT,kBAAkB;IAClB,WAAW,GAAG,KAAK,GACpB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,mBAAmB,EAAE;QACxB,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,0CAA0C;YACxC,+EAA+E,CAClF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,IAAI,CAAC,gBAAgB,EAAE;QACrB,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uCAAuC;YACrC,yEAAyE,CAC5E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,mBAAmB;IACnB,IAAI,CAAC,SAAS,EAAE;QACd,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,gCAAgC;YAC9B,wEAAwE,CAC3E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,+BAA+B;IAC/B,MAAM,WAAW,GAAG,IAAA,kBAAO,EAAC,IAAI,EAAE,+BAAuB,CAAC,CAAC;IAE3D,iBAAiB;IACjB,MAAM,IAAA,+BAAc,EAAC;QACnB,mBAAmB;QACnB,gBAAgB;QAChB,WAAW;QACX,SAAS;QACT,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QACtC,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-upload-preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-upload-preferences.d.ts","sourceRoot":"","sources":["../src/cli-upload-preferences.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
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 constants_1 = require("./constants");
11
+ const preference_management_1 = require("./preference-management");
12
+ const requests_1 = require("./requests");
13
+ /**
14
+ * Upload consent preferences to the managed consent database
15
+ *
16
+ * Requires following documentation found at:
17
+ * https://docs.transcend.io/docs/consent/reference/managed-consent-database
18
+ *
19
+ * Dev Usage:
20
+ * yarn ts-node ./src/cli-upload-consent-preferences-interactive --base64EncryptionKey=$TRANSCEND_CONSENT_ENCRYPTION_KEY \
21
+ * --base64SigningKey=$TRANSCEND_CONSENT_SIGNING_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726
22
+ *
23
+ * Standard usage:
24
+ * yarn tr-upload-consent-preferences-interactive --base64EncryptionKey=$TRANSCEND_CONSENT_ENCRYPTION_KEY \
25
+ * --base64SigningKey=$TRANSCEND_CONSENT_SIGNING_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726
26
+ */
27
+ async function main() {
28
+ // Parse command line arguments
29
+ const {
30
+ /** File to load preferences from */
31
+ file = './preferences.csv',
32
+ /** Transcend URL */
33
+ transcendUrl = constants_1.DEFAULT_TRANSCEND_API,
34
+ /** API key */
35
+ auth,
36
+ /** Sombra API key */
37
+ sombraAuth,
38
+ /** Partition key to load into */
39
+ partition,
40
+ /** Whether to do a dry run */
41
+ dryRun = 'false',
42
+ /** Whether to skip workflow triggers */
43
+ skipWorkflowTriggers = 'false',
44
+ /** Whether to skip conflict updates */
45
+ skipConflictUpdates = 'false',
46
+ /** Whether to skip sending emails */
47
+ isSilent = 'true',
48
+ /** Attributes to add to any DSR request if created */
49
+ attributes = 'Tags:transcend-cli,Source:transcend-cli',
50
+ /** Store resulting, continuing where left off */
51
+ receiptFilepath = './preference-management-upload-receipts.json', } = (0, yargs_parser_1.default)(process.argv.slice(2));
52
+ // Ensure auth is passed
53
+ if (!auth) {
54
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
55
+ process.exit(1);
56
+ }
57
+ // Ensure partition
58
+ if (!partition) {
59
+ logger_1.logger.error(colors_1.default.red('A partition must be provided. ' +
60
+ 'You can specify using --partition=ee1a0845-694e-4820-9d51-50c7d0a23467'));
61
+ process.exit(1);
62
+ }
63
+ // Upload cookies
64
+ await (0, preference_management_1.uploadPreferenceManagementPreferencesInteractive)({
65
+ receiptFilepath,
66
+ auth,
67
+ sombraAuth,
68
+ file,
69
+ partition,
70
+ transcendUrl,
71
+ skipConflictUpdates: skipConflictUpdates !== 'false',
72
+ skipWorkflowTriggers: skipWorkflowTriggers !== 'false',
73
+ isSilent: isSilent !== 'false',
74
+ dryRun: dryRun !== 'false',
75
+ attributes: (0, requests_1.splitCsvToList)(attributes),
76
+ });
77
+ }
78
+ main();
79
+ //# sourceMappingURL=cli-upload-preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-upload-preferences.js","sourceRoot":"","sources":["../src/cli-upload-preferences.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,2CAAoD;AACpD,mEAA2F;AAC3F,yCAA4C;AAE5C;;;;;;;;;;;;;GAaG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM;IACJ,oCAAoC;IACpC,IAAI,GAAG,mBAAmB;IAC1B,oBAAoB;IACpB,YAAY,GAAG,iCAAqB;IACpC,cAAc;IACd,IAAI;IACJ,qBAAqB;IACrB,UAAU;IACV,iCAAiC;IACjC,SAAS;IACT,8BAA8B;IAC9B,MAAM,GAAG,OAAO;IAChB,wCAAwC;IACxC,oBAAoB,GAAG,OAAO;IAC9B,uCAAuC;IACvC,mBAAmB,GAAG,OAAO;IAC7B,qCAAqC;IACrC,QAAQ,GAAG,MAAM;IACjB,sDAAsD;IACtD,UAAU,GAAG,yCAAyC;IACtD,kDAAkD;IAClD,eAAe,GAAG,8CAA8C,GACjE,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,mBAAmB;IACnB,IAAI,CAAC,SAAS,EAAE;QACd,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,gCAAgC;YAC9B,wEAAwE,CAC3E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,iBAAiB;IACjB,MAAM,IAAA,wEAAgD,EAAC;QACrD,eAAe;QACf,IAAI;QACJ,UAAU;QACV,IAAI;QACJ,SAAS;QACT,YAAY;QACZ,mBAAmB,EAAE,mBAAmB,KAAK,OAAO;QACpD,oBAAoB,EAAE,oBAAoB,KAAK,OAAO;QACtD,QAAQ,EAAE,QAAQ,KAAK,OAAO;QAC9B,MAAM,EAAE,MAAM,KAAK,OAAO;QAC1B,UAAU,EAAE,IAAA,yBAAc,EAAC,UAAU,CAAC;KACvC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
package/build/codecs.d.ts CHANGED
@@ -47267,6 +47267,8 @@ export declare const AssessmentSectionQuestionInput: t.IntersectionC<[t.TypeC<{
47267
47267
  /** Value of answer */
47268
47268
  value: t.StringC;
47269
47269
  }>>;
47270
+ /** The selected answers to the assessments */
47271
+ 'selected-answers': t.ArrayC<t.StringC>;
47270
47272
  /** Allowed MIME types for the question */
47271
47273
  'allowed-mime-types': t.ArrayC<t.StringC>;
47272
47274
  /** Allow selecting other options */
@@ -47476,6 +47478,8 @@ export declare const AssessmentSectionInput: t.IntersectionC<[t.TypeC<{
47476
47478
  /** Value of answer */
47477
47479
  value: t.StringC;
47478
47480
  }>>;
47481
+ /** The selected answers to the assessments */
47482
+ 'selected-answers': t.ArrayC<t.StringC>;
47479
47483
  /** Allowed MIME types for the question */
47480
47484
  'allowed-mime-types': t.ArrayC<t.StringC>;
47481
47485
  /** Allow selecting other options */
@@ -47717,6 +47721,8 @@ export declare const AssessmentTemplateInput: t.IntersectionC<[t.TypeC<{
47717
47721
  /** Value of answer */
47718
47722
  value: t.StringC;
47719
47723
  }>>;
47724
+ /** The selected answers to the assessments */
47725
+ 'selected-answers': t.ArrayC<t.StringC>;
47720
47726
  /** Allowed MIME types for the question */
47721
47727
  'allowed-mime-types': t.ArrayC<t.StringC>;
47722
47728
  /** Allow selecting other options */
@@ -48020,6 +48026,8 @@ export declare const AssessmentInput: t.IntersectionC<[t.TypeC<{
48020
48026
  /** Value of answer */
48021
48027
  value: t.StringC;
48022
48028
  }>>;
48029
+ /** The selected answers to the assessments */
48030
+ 'selected-answers': t.ArrayC<t.StringC>;
48023
48031
  /** Allowed MIME types for the question */
48024
48032
  'allowed-mime-types': t.ArrayC<t.StringC>;
48025
48033
  /** Allow selecting other options */
@@ -88571,6 +88579,8 @@ export declare const TranscendInput: t.PartialC<{
88571
88579
  /** Value of answer */
88572
88580
  value: t.StringC;
88573
88581
  }>>;
88582
+ /** The selected answers to the assessments */
88583
+ 'selected-answers': t.ArrayC<t.StringC>;
88574
88584
  /** Allowed MIME types for the question */
88575
88585
  'allowed-mime-types': t.ArrayC<t.StringC>;
88576
88586
  /** Allow selecting other options */
@@ -88842,6 +88852,8 @@ export declare const TranscendInput: t.PartialC<{
88842
88852
  /** Value of answer */
88843
88853
  value: t.StringC;
88844
88854
  }>>;
88855
+ /** The selected answers to the assessments */
88856
+ 'selected-answers': t.ArrayC<t.StringC>;
88845
88857
  /** Allowed MIME types for the question */
88846
88858
  'allowed-mime-types': t.ArrayC<t.StringC>;
88847
88859
  /** Allow selecting other options */