@transcend-io/cli 8.30.1 → 8.31.1

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 (137) hide show
  1. package/README.md +4 -4
  2. package/dist/bin/bash-complete.cjs +1 -1
  3. package/dist/bin/cli.cjs +1 -1
  4. package/dist/bin/deprecated-command.cjs +2 -2
  5. package/dist/{chunk-LRADV5OI.cjs → chunk-52MA7ZLS.cjs} +2 -2
  6. package/dist/{chunk-LRADV5OI.cjs.map → chunk-52MA7ZLS.cjs.map} +1 -1
  7. package/dist/{chunk-HTS7K7QD.cjs → chunk-55B57ZAY.cjs} +4 -4
  8. package/dist/{chunk-HTS7K7QD.cjs.map → chunk-55B57ZAY.cjs.map} +1 -1
  9. package/dist/{chunk-LZA5Y4SB.cjs → chunk-7H4ALAHC.cjs} +4 -4
  10. package/dist/{chunk-LZA5Y4SB.cjs.map → chunk-7H4ALAHC.cjs.map} +1 -1
  11. package/dist/{chunk-T3BBQIRY.cjs → chunk-7PB6LVSE.cjs} +2 -2
  12. package/dist/chunk-7PB6LVSE.cjs.map +1 -0
  13. package/dist/{chunk-LU3DKRNK.cjs → chunk-ABKDAPPR.cjs} +2 -2
  14. package/dist/{chunk-LU3DKRNK.cjs.map → chunk-ABKDAPPR.cjs.map} +1 -1
  15. package/dist/{chunk-XEXS6R45.cjs → chunk-ALOB5SWZ.cjs} +2 -2
  16. package/dist/{chunk-XEXS6R45.cjs.map → chunk-ALOB5SWZ.cjs.map} +1 -1
  17. package/dist/{chunk-SPN6SWMF.cjs → chunk-DIB7IOEX.cjs} +2 -2
  18. package/dist/{chunk-SPN6SWMF.cjs.map → chunk-DIB7IOEX.cjs.map} +1 -1
  19. package/dist/{chunk-RAA5VWQS.cjs → chunk-G522ZIHS.cjs} +2 -2
  20. package/dist/{chunk-RAA5VWQS.cjs.map → chunk-G522ZIHS.cjs.map} +1 -1
  21. package/dist/{chunk-UXFL56TL.cjs → chunk-HCEZRZHV.cjs} +6 -6
  22. package/dist/{chunk-UXFL56TL.cjs.map → chunk-HCEZRZHV.cjs.map} +1 -1
  23. package/dist/{chunk-BQSBPO63.cjs → chunk-JH5HRI6D.cjs} +3 -3
  24. package/dist/{chunk-BQSBPO63.cjs.map → chunk-JH5HRI6D.cjs.map} +1 -1
  25. package/dist/{chunk-WURUFVEG.cjs → chunk-M3Y6JH6I.cjs} +2 -2
  26. package/dist/{chunk-WURUFVEG.cjs.map → chunk-M3Y6JH6I.cjs.map} +1 -1
  27. package/dist/{chunk-FIJLHU4Q.cjs → chunk-M7OVJJGB.cjs} +4 -4
  28. package/dist/{chunk-FIJLHU4Q.cjs.map → chunk-M7OVJJGB.cjs.map} +1 -1
  29. package/dist/{chunk-6KRRRMY2.cjs → chunk-MXT7N555.cjs} +21 -21
  30. package/dist/{chunk-6KRRRMY2.cjs.map → chunk-MXT7N555.cjs.map} +1 -1
  31. package/dist/{chunk-YYDWSYMF.cjs → chunk-NC6VWOMN.cjs} +2 -2
  32. package/dist/{chunk-YYDWSYMF.cjs.map → chunk-NC6VWOMN.cjs.map} +1 -1
  33. package/dist/{chunk-Z2DYKPKM.cjs → chunk-Q2RJZGYW.cjs} +2 -2
  34. package/dist/{chunk-Z2DYKPKM.cjs.map → chunk-Q2RJZGYW.cjs.map} +1 -1
  35. package/dist/{chunk-3FIDP42N.cjs → chunk-SKOTYI3A.cjs} +2 -2
  36. package/dist/chunk-SKOTYI3A.cjs.map +1 -0
  37. package/dist/{chunk-FHUHBSLE.cjs → chunk-TSJTXXLZ.cjs} +2 -2
  38. package/dist/{chunk-FHUHBSLE.cjs.map → chunk-TSJTXXLZ.cjs.map} +1 -1
  39. package/dist/{chunk-OMVVROKB.cjs → chunk-XXFLFF7Q.cjs} +2 -2
  40. package/dist/{chunk-OMVVROKB.cjs.map → chunk-XXFLFF7Q.cjs.map} +1 -1
  41. package/dist/impl-4CWCLU5Z.cjs +2 -0
  42. package/dist/{impl-J62VZXDY.cjs.map → impl-4CWCLU5Z.cjs.map} +1 -1
  43. package/dist/{impl-BSIFPZLW.cjs → impl-542SIWQ2.cjs} +2 -2
  44. package/dist/{impl-BSIFPZLW.cjs.map → impl-542SIWQ2.cjs.map} +1 -1
  45. package/dist/impl-55GTRVMZ.cjs +2 -0
  46. package/dist/{impl-FKXR7U4X.cjs.map → impl-55GTRVMZ.cjs.map} +1 -1
  47. package/dist/{impl-KBVYLYIZ.cjs → impl-5VMEZB7F.cjs} +2 -2
  48. package/dist/{impl-KBVYLYIZ.cjs.map → impl-5VMEZB7F.cjs.map} +1 -1
  49. package/dist/{impl-2X2FNMJR.cjs → impl-6ANYWCOV.cjs} +2 -2
  50. package/dist/{impl-2X2FNMJR.cjs.map → impl-6ANYWCOV.cjs.map} +1 -1
  51. package/dist/{impl-VBE4QUJN.cjs → impl-A7XL5O4W.cjs} +2 -2
  52. package/dist/{impl-VBE4QUJN.cjs.map → impl-A7XL5O4W.cjs.map} +1 -1
  53. package/dist/{impl-COZ7ADUO.cjs → impl-BQNXMBQ4.cjs} +4 -4
  54. package/dist/{impl-COZ7ADUO.cjs.map → impl-BQNXMBQ4.cjs.map} +1 -1
  55. package/dist/{impl-3BTFEGV4.cjs → impl-CFYRFABZ.cjs} +5 -5
  56. package/dist/{impl-3BTFEGV4.cjs.map → impl-CFYRFABZ.cjs.map} +1 -1
  57. package/dist/{impl-T7EOUHYL.cjs → impl-D2HENZNO.cjs} +2 -2
  58. package/dist/{impl-T7EOUHYL.cjs.map → impl-D2HENZNO.cjs.map} +1 -1
  59. package/dist/{impl-IFHM4YOL.cjs → impl-GEEPG7OH.cjs} +2 -2
  60. package/dist/{impl-IFHM4YOL.cjs.map → impl-GEEPG7OH.cjs.map} +1 -1
  61. package/dist/{impl-EE3BM53W.cjs → impl-GRGWQUU7.cjs} +2 -2
  62. package/dist/{impl-EE3BM53W.cjs.map → impl-GRGWQUU7.cjs.map} +1 -1
  63. package/dist/{impl-Z3EAXTJV.cjs → impl-JFYHXSOV.cjs} +2 -2
  64. package/dist/{impl-Z3EAXTJV.cjs.map → impl-JFYHXSOV.cjs.map} +1 -1
  65. package/dist/impl-JQVCW52V.cjs +2 -0
  66. package/dist/{impl-RTZTJWMX.cjs.map → impl-JQVCW52V.cjs.map} +1 -1
  67. package/dist/impl-JSXYZHX4.cjs +2 -0
  68. package/dist/{impl-VHY4ALCB.cjs.map → impl-JSXYZHX4.cjs.map} +1 -1
  69. package/dist/{impl-Q5WCETP4.cjs → impl-K2D3GTZG.cjs} +2 -2
  70. package/dist/{impl-Q5WCETP4.cjs.map → impl-K2D3GTZG.cjs.map} +1 -1
  71. package/dist/{impl-463J7BYV.cjs → impl-KQYINEBI.cjs} +2 -2
  72. package/dist/{impl-463J7BYV.cjs.map → impl-KQYINEBI.cjs.map} +1 -1
  73. package/dist/impl-KRJNBGJ6.cjs +2 -0
  74. package/dist/{impl-7BAUUGZT.cjs.map → impl-KRJNBGJ6.cjs.map} +1 -1
  75. package/dist/{impl-5WHENVVS.cjs → impl-NK42TN4C.cjs} +2 -2
  76. package/dist/{impl-5WHENVVS.cjs.map → impl-NK42TN4C.cjs.map} +1 -1
  77. package/dist/{impl-5GGFGRTD.cjs → impl-OQAP7YDW.cjs} +2 -2
  78. package/dist/{impl-5GGFGRTD.cjs.map → impl-OQAP7YDW.cjs.map} +1 -1
  79. package/dist/{impl-T5V56TM5.cjs → impl-PHBUSAGS.cjs} +2 -2
  80. package/dist/{impl-T5V56TM5.cjs.map → impl-PHBUSAGS.cjs.map} +1 -1
  81. package/dist/{impl-XAZ6YY3R.cjs → impl-PKWSORXX.cjs} +2 -2
  82. package/dist/{impl-XAZ6YY3R.cjs.map → impl-PKWSORXX.cjs.map} +1 -1
  83. package/dist/{impl-4CA7VK4U.cjs → impl-PWYKAVK4.cjs} +2 -2
  84. package/dist/{impl-4CA7VK4U.cjs.map → impl-PWYKAVK4.cjs.map} +1 -1
  85. package/dist/{impl-UMVE7IPO.cjs → impl-Q3P6DGHG.cjs} +2 -2
  86. package/dist/{impl-UMVE7IPO.cjs.map → impl-Q3P6DGHG.cjs.map} +1 -1
  87. package/dist/{impl-ZJ2L727T.cjs → impl-RD5UOJY6.cjs} +2 -2
  88. package/dist/{impl-ZJ2L727T.cjs.map → impl-RD5UOJY6.cjs.map} +1 -1
  89. package/dist/{impl-U76PZBUK.cjs → impl-REKQO7ZI.cjs} +2 -2
  90. package/dist/{impl-U76PZBUK.cjs.map → impl-REKQO7ZI.cjs.map} +1 -1
  91. package/dist/{impl-IM22LNW5.cjs → impl-RI3WQFOE.cjs} +3 -3
  92. package/dist/{impl-IM22LNW5.cjs.map → impl-RI3WQFOE.cjs.map} +1 -1
  93. package/dist/impl-SRI65ZIC.cjs +2 -0
  94. package/dist/{impl-IBOGAUVL.cjs.map → impl-SRI65ZIC.cjs.map} +1 -1
  95. package/dist/{impl-YEXEFJS7.cjs → impl-T67PUM7X.cjs} +2 -2
  96. package/dist/{impl-YEXEFJS7.cjs.map → impl-T67PUM7X.cjs.map} +1 -1
  97. package/dist/{impl-NEV6KDPU.cjs → impl-TCR3Y3J2.cjs} +2 -2
  98. package/dist/{impl-NEV6KDPU.cjs.map → impl-TCR3Y3J2.cjs.map} +1 -1
  99. package/dist/{impl-VPUALIUR.cjs → impl-U46BMUFL.cjs} +2 -2
  100. package/dist/{impl-VPUALIUR.cjs.map → impl-U46BMUFL.cjs.map} +1 -1
  101. package/dist/{impl-BLIELFUK.cjs → impl-UVQJ7HSK.cjs} +3 -3
  102. package/dist/{impl-BLIELFUK.cjs.map → impl-UVQJ7HSK.cjs.map} +1 -1
  103. package/dist/{impl-GJMVAL3N.cjs → impl-V3MXFXZF.cjs} +2 -2
  104. package/dist/{impl-GJMVAL3N.cjs.map → impl-V3MXFXZF.cjs.map} +1 -1
  105. package/dist/{impl-76E4DKAE.cjs → impl-VL3CJ2OT.cjs} +2 -2
  106. package/dist/{impl-76E4DKAE.cjs.map → impl-VL3CJ2OT.cjs.map} +1 -1
  107. package/dist/{impl-Z5HT5JQU.cjs → impl-VT3C6SP4.cjs} +2 -2
  108. package/dist/{impl-Z5HT5JQU.cjs.map → impl-VT3C6SP4.cjs.map} +1 -1
  109. package/dist/{impl-OFB5I4S6.cjs → impl-VUAC7AYF.cjs} +2 -2
  110. package/dist/{impl-OFB5I4S6.cjs.map → impl-VUAC7AYF.cjs.map} +1 -1
  111. package/dist/impl-VXOHC45F.cjs +3 -0
  112. package/dist/{impl-LMKJ6UBT.cjs.map → impl-VXOHC45F.cjs.map} +1 -1
  113. package/dist/{impl-UPDFANVR.cjs → impl-WMI46UXI.cjs} +2 -2
  114. package/dist/{impl-UPDFANVR.cjs.map → impl-WMI46UXI.cjs.map} +1 -1
  115. package/dist/{impl-FTSCECOZ.cjs → impl-XJBUIDZP.cjs} +2 -2
  116. package/dist/{impl-FTSCECOZ.cjs.map → impl-XJBUIDZP.cjs.map} +1 -1
  117. package/dist/impl-XLL66FXK.cjs +2 -0
  118. package/dist/{impl-X6TORGVF.cjs.map → impl-XLL66FXK.cjs.map} +1 -1
  119. package/dist/{impl-BSI3RBQ2.cjs → impl-YGVW4RTA.cjs} +2 -2
  120. package/dist/{impl-BSI3RBQ2.cjs.map → impl-YGVW4RTA.cjs.map} +1 -1
  121. package/dist/{impl-AWWB3TEU.cjs → impl-ZAKPYQ32.cjs} +2 -2
  122. package/dist/{impl-AWWB3TEU.cjs.map → impl-ZAKPYQ32.cjs.map} +1 -1
  123. package/dist/{impl-DS73OYLE.cjs → impl-ZTYQ3IB5.cjs} +2 -2
  124. package/dist/{impl-DS73OYLE.cjs.map → impl-ZTYQ3IB5.cjs.map} +1 -1
  125. package/dist/index.cjs +3 -3
  126. package/dist/index.d.cts +3 -3
  127. package/package.json +1 -1
  128. package/dist/chunk-3FIDP42N.cjs.map +0 -1
  129. package/dist/chunk-T3BBQIRY.cjs.map +0 -1
  130. package/dist/impl-7BAUUGZT.cjs +0 -2
  131. package/dist/impl-FKXR7U4X.cjs +0 -2
  132. package/dist/impl-IBOGAUVL.cjs +0 -2
  133. package/dist/impl-J62VZXDY.cjs +0 -2
  134. package/dist/impl-LMKJ6UBT.cjs +0 -3
  135. package/dist/impl-RTZTJWMX.cjs +0 -2
  136. package/dist/impl-VHY4ALCB.cjs +0 -2
  137. package/dist/impl-X6TORGVF.cjs +0 -2
package/README.md CHANGED
@@ -2250,7 +2250,7 @@ transcend consent upload-preferences \
2250
2250
 
2251
2251
  ```txt
2252
2252
  USAGE
2253
- transcend inventory pull (--auth value) [--resources all|apiKeys|customFields|templates|dataSilos|enrichers|dataFlows|businessEntities|processingActivities|actions|dataSubjects|identifiers|cookies|consentManager|partitions|prompts|promptPartials|promptGroups|agents|agentFunctions|agentFiles|vendors|dataCategories|processingPurposes|actionItems|actionItemCollections|teams|privacyCenters|policies|messages|assessments|assessmentTemplates|purposes|siloDiscoveryResults] [--file value] [--transcendUrl value] [--dataSiloIds value]... [--integrationNames value]... [--trackerStatuses LIVE|NEEDS_REVIEW] [--pageSize value] [--skipDatapoints] [--skipSubDatapoints] [--includeGuessedCategories] [--debug]
2253
+ transcend inventory pull (--auth value) [--resources all|apiKeys|customFields|templates|dataSilos|enrichers|dataFlows|businessEntities|processingActivities|actions|dataSubjects|identifiers|cookies|consentManager|partitions|prompts|promptPartials|promptGroups|agents|agentFunctions|agentFiles|vendors|dataCategories|processingPurposes|actionItems|actionItemCollections|teams|privacyCenters|policies|messages|assessments|assessmentTemplates|purposes|systemDiscovery] [--file value] [--transcendUrl value] [--dataSiloIds value]... [--integrationNames value]... [--trackerStatuses LIVE|NEEDS_REVIEW] [--pageSize value] [--skipDatapoints] [--skipSubDatapoints] [--includeGuessedCategories] [--debug]
2254
2254
  transcend inventory pull --help
2255
2255
 
2256
2256
  Generates a transcend.yml by pulling the configuration from your Transcend instance.
@@ -2264,7 +2264,7 @@ This command can be helpful if you are looking to:
2264
2264
 
2265
2265
  FLAGS
2266
2266
  --auth The Transcend API key. The scopes required will vary depending on the operation performed. If in doubt, the Full Admin scope will always work.
2267
- [--resources] The different resource types to pull in. Defaults to dataSilos,enrichers,templates,apiKeys. [all|apiKeys|customFields|templates|dataSilos|enrichers|dataFlows|businessEntities|processingActivities|actions|dataSubjects|identifiers|cookies|consentManager|partitions|prompts|promptPartials|promptGroups|agents|agentFunctions|agentFiles|vendors|dataCategories|processingPurposes|actionItems|actionItemCollections|teams|privacyCenters|policies|messages|assessments|assessmentTemplates|purposes|siloDiscoveryResults, separator = ,]
2267
+ [--resources] The different resource types to pull in. Defaults to dataSilos,enrichers,templates,apiKeys. [all|apiKeys|customFields|templates|dataSilos|enrichers|dataFlows|businessEntities|processingActivities|actions|dataSubjects|identifiers|cookies|consentManager|partitions|prompts|promptPartials|promptGroups|agents|agentFunctions|agentFiles|vendors|dataCategories|processingPurposes|actionItems|actionItemCollections|teams|privacyCenters|policies|messages|assessments|assessmentTemplates|purposes|systemDiscovery, separator = ,]
2268
2268
  [--file] Path to the YAML file to pull into [default = ./transcend.yml]
2269
2269
  [--transcendUrl] URL of the Transcend backend. Use https://api.us.transcend.io for US hosting [default = https://api.transcend.io]
2270
2270
  [--dataSiloIds]... The UUIDs of the data silos that should be pulled into the YAML file [separator = ,]
@@ -2316,7 +2316,7 @@ The API key permissions for this command vary based on the `resources` argument:
2316
2316
  | `assessments` | `assessments` | Assessment responses. | View Assessments | [Assessments -> Assessments](https://app.transcend.io/assessments/groups) |
2317
2317
  | `assessmentTemplates` | `assessment-templates` | Assessment template configurations. | View Assessments | [Assessment -> Templates](https://app.transcend.io/assessments/form-templates) |
2318
2318
  | `purposes` | `purposes` | Consent purposes and related preference management topics. | View Consent Manager, View Preference Store Settings | [Consent Management -> Regional Experiences -> Purposes](https://app.transcend.io/consent-manager/regional-experiences/purposes) |
2319
- | `siloDiscoveryResults` | `siloDiscoveryResults` | System discovery results | View Data Map | [System Discovery](https://app.transcend.io/data-map/data-inventory/silo-discovery) |
2319
+ | `systemDiscovery` | `system-discovery` | System discovery results | View Data Map | [System Discovery](https://app.transcend.io/data-map/data-inventory/silo-discovery) |
2320
2320
 
2321
2321
  #### Examples
2322
2322
 
@@ -2528,7 +2528,7 @@ The API key permissions for this command vary based on the resources declared as
2528
2528
  | `assessments` | `assessments` | Assessment responses. | Manage Assessments | [Assessments -> Assessments](https://app.transcend.io/assessments/groups) |
2529
2529
  | `assessmentTemplates` | `assessment-templates` | Assessment template configurations. | Manage Assessments | [Assessment -> Templates](https://app.transcend.io/assessments/form-templates) |
2530
2530
  | `purposes` | `purposes` | Consent purposes and related preference management topics. | Manage Consent Manager, Manage Preference Store Settings | [Consent Management -> Regional Experiences -> Purposes](https://app.transcend.io/consent-manager/regional-experiences/purposes) |
2531
- | `siloDiscoveryResults` | `siloDiscoveryResults` | System discovery results | Manage Data Map | [System Discovery](https://app.transcend.io/data-map/data-inventory/silo-discovery) |
2531
+ | `systemDiscovery` | `system-discovery` | System discovery results | Manage Data Map | [System Discovery](https://app.transcend.io/data-map/data-inventory/silo-discovery) |
2532
2532
 
2533
2533
  #### Examples
2534
2534
 
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- "use strict"; function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunk6KRRRMY2cjs = require('../chunk-6KRRRMY2.cjs');require('../chunk-SPN6SWMF.cjs');require('../chunk-OMVVROKB.cjs');require('../chunk-T3BBQIRY.cjs');var _core = require('@stricli/core');async function e(){let o=process.argv.slice(3);_optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.COMP_LINE, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4(" ")])&&o.push(""),await _core.proposeCompletions.call(void 0, _chunk6KRRRMY2cjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process));try{for(let{completion:r}of await _core.proposeCompletions.call(void 0, _chunk6KRRRMY2cjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process)))process.stdout.write(`${r}
2
+ "use strict"; function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkMXT7N555cjs = require('../chunk-MXT7N555.cjs');require('../chunk-DIB7IOEX.cjs');require('../chunk-XXFLFF7Q.cjs');require('../chunk-7PB6LVSE.cjs');var _core = require('@stricli/core');async function e(){let o=process.argv.slice(3);_optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.COMP_LINE, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4(" ")])&&o.push(""),await _core.proposeCompletions.call(void 0, _chunkMXT7N555cjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process));try{for(let{completion:r}of await _core.proposeCompletions.call(void 0, _chunkMXT7N555cjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process)))process.stdout.write(`${r}
3
3
  `)}catch (e2){}}e();
4
4
  //# sourceMappingURL=bash-complete.cjs.map
package/dist/bin/cli.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunk6KRRRMY2cjs = require('../chunk-6KRRRMY2.cjs');require('../chunk-SPN6SWMF.cjs');require('../chunk-OMVVROKB.cjs');require('../chunk-T3BBQIRY.cjs');var _core = require('@stricli/core');async function n(){await _core.run.call(void 0, _chunk6KRRRMY2cjs.a,process.argv.slice(2),_chunkT462ONFXcjs.a.call(void 0, process))}n();
2
+ "use strict";var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkMXT7N555cjs = require('../chunk-MXT7N555.cjs');require('../chunk-DIB7IOEX.cjs');require('../chunk-XXFLFF7Q.cjs');require('../chunk-7PB6LVSE.cjs');var _core = require('@stricli/core');async function n(){await _core.run.call(void 0, _chunkMXT7N555cjs.a,process.argv.slice(2),_chunkT462ONFXcjs.a.call(void 0, process))}n();
3
3
  //# sourceMappingURL=cli.cjs.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- "use strict"; function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk6KRRRMY2cjs = require('../chunk-6KRRRMY2.cjs');require('../chunk-SPN6SWMF.cjs');var _chunkZUNVPK23cjs = require('../chunk-ZUNVPK23.cjs');require('../chunk-OMVVROKB.cjs');require('../chunk-T3BBQIRY.cjs');var _core = require('@stricli/core');var o={"tr-build-xdi-sync-endpoint":["consent","build-xdi-sync-endpoint"],"tr-consent-manager-service-json-to-yml":["inventory","consent-manager-service-json-to-yml"],"tr-consent-managers-to-business-entities":["inventory","consent-managers-to-business-entities"],"tr-cron-mark-identifiers-completed":["request","cron","mark-identifiers-completed"],"tr-cron-pull-identifiers":["request","cron","pull-identifiers"],"tr-derive-data-silos-from-data-flows":["inventory","derive-data-silos-from-data-flows"],"tr-derive-data-silos-from-data-flows-cross-instance":["inventory","derive-data-silos-from-data-flows-cross-instance"],"tr-discover-silos":["inventory","discover-silos"],"tr-generate-api-keys":["admin","generate-api-keys"],"tr-manual-enrichment-pull-identifiers":["request","preflight","pull-identifiers"],"tr-manual-enrichment-push-identifiers":["request","preflight","push-identifiers"],"tr-mark-request-data-silos-completed":["request","system","mark-request-data-silos-completed"],"tr-pull":["inventory","pull"],"tr-pull-consent-metrics":["consent","pull-consent-metrics"],"tr-pull-consent-preferences":["consent","pull-consent-preferences"],"tr-pull-datapoints":["inventory","pull-datapoints"],"tr-pull-pull-unstructured-discovery-files":["inventory","pull-unstructured-discovery-files"],"tr-push":["inventory","push"],"tr-request-approve":["request","approve"],"tr-request-cancel":["request","cancel"],"tr-request-download-files":["request","download-files"],"tr-request-enricher-restart":["request","enricher-restart"],"tr-request-export":["request","export"],"tr-request-mark-silent":["request","mark-silent"],"tr-request-notify-additional-time":["request","notify-additional-time"],"tr-request-reject-unverified-identifiers":["request","reject-unverified-identifiers"],"tr-request-restart":["request","restart"],"tr-request-upload":["request","upload"],"tr-retry-request-data-silos":["request","system","retry-request-data-silos"],"tr-scan-packages":["inventory","scan-packages"],"tr-skip-preflight-jobs":["request","skip-preflight-jobs"],"tr-skip-request-data-silos":["request","system","skip-request-data-silos"],"tr-sync-ot":["migration","sync-ot"],"tr-update-consent-manager":["consent","update-consent-manager"],"tr-upload-consent-preferences":["consent","upload-consent-preferences"],"tr-upload-cookies-from-csv":["consent","upload-cookies-from-csv"],"tr-upload-data-flows-from-csv":["consent","upload-data-flows-from-csv"],"tr-upload-preferences":["consent","upload-preferences"]};function p(t){return _optionalChain([_core.generateHelpTextForAllCommands.call(void 0, _chunk6KRRRMY2cjs.a), 'access', _ => _.find, 'call', _2 => _2(s=>s[0]===`${_chunk6KRRRMY2cjs.a.config.name} ${t.join(" ")}`), 'optionalAccess', _3 => _3[1]])}function i(t){_chunkZUNVPK23cjs.a.log("[DEPRECATION NOTICE]");let e=o[t];if(!e){let a=Object.entries(o).map(([l,d])=>`\`${l}\` -> \`${_chunk6KRRRMY2cjs.a.config.name} ${d.join(" ")}\``).join(`
2
+ "use strict"; function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkMXT7N555cjs = require('../chunk-MXT7N555.cjs');require('../chunk-DIB7IOEX.cjs');var _chunkZUNVPK23cjs = require('../chunk-ZUNVPK23.cjs');require('../chunk-XXFLFF7Q.cjs');require('../chunk-7PB6LVSE.cjs');var _core = require('@stricli/core');var o={"tr-build-xdi-sync-endpoint":["consent","build-xdi-sync-endpoint"],"tr-consent-manager-service-json-to-yml":["inventory","consent-manager-service-json-to-yml"],"tr-consent-managers-to-business-entities":["inventory","consent-managers-to-business-entities"],"tr-cron-mark-identifiers-completed":["request","cron","mark-identifiers-completed"],"tr-cron-pull-identifiers":["request","cron","pull-identifiers"],"tr-derive-data-silos-from-data-flows":["inventory","derive-data-silos-from-data-flows"],"tr-derive-data-silos-from-data-flows-cross-instance":["inventory","derive-data-silos-from-data-flows-cross-instance"],"tr-discover-silos":["inventory","discover-silos"],"tr-generate-api-keys":["admin","generate-api-keys"],"tr-manual-enrichment-pull-identifiers":["request","preflight","pull-identifiers"],"tr-manual-enrichment-push-identifiers":["request","preflight","push-identifiers"],"tr-mark-request-data-silos-completed":["request","system","mark-request-data-silos-completed"],"tr-pull":["inventory","pull"],"tr-pull-consent-metrics":["consent","pull-consent-metrics"],"tr-pull-consent-preferences":["consent","pull-consent-preferences"],"tr-pull-datapoints":["inventory","pull-datapoints"],"tr-pull-pull-unstructured-discovery-files":["inventory","pull-unstructured-discovery-files"],"tr-push":["inventory","push"],"tr-request-approve":["request","approve"],"tr-request-cancel":["request","cancel"],"tr-request-download-files":["request","download-files"],"tr-request-enricher-restart":["request","enricher-restart"],"tr-request-export":["request","export"],"tr-request-mark-silent":["request","mark-silent"],"tr-request-notify-additional-time":["request","notify-additional-time"],"tr-request-reject-unverified-identifiers":["request","reject-unverified-identifiers"],"tr-request-restart":["request","restart"],"tr-request-upload":["request","upload"],"tr-retry-request-data-silos":["request","system","retry-request-data-silos"],"tr-scan-packages":["inventory","scan-packages"],"tr-skip-preflight-jobs":["request","skip-preflight-jobs"],"tr-skip-request-data-silos":["request","system","skip-request-data-silos"],"tr-sync-ot":["migration","sync-ot"],"tr-update-consent-manager":["consent","update-consent-manager"],"tr-upload-consent-preferences":["consent","upload-consent-preferences"],"tr-upload-cookies-from-csv":["consent","upload-cookies-from-csv"],"tr-upload-data-flows-from-csv":["consent","upload-data-flows-from-csv"],"tr-upload-preferences":["consent","upload-preferences"]};function p(t){return _optionalChain([_core.generateHelpTextForAllCommands.call(void 0, _chunkMXT7N555cjs.a), 'access', _ => _.find, 'call', _2 => _2(s=>s[0]===`${_chunkMXT7N555cjs.a.config.name} ${t.join(" ")}`), 'optionalAccess', _3 => _3[1]])}function i(t){_chunkZUNVPK23cjs.a.log("[DEPRECATION NOTICE]");let e=o[t];if(!e){let a=Object.entries(o).map(([l,d])=>`\`${l}\` -> \`${_chunkMXT7N555cjs.a.config.name} ${d.join(" ")}\``).join(`
3
3
  `);_chunkZUNVPK23cjs.a.log(`This command is deprecated as of v7.0.0. Here is a list of new commands, mapped to their legacy command names:
4
4
  ${a}`);return}_chunkZUNVPK23cjs.a.log(`\`${t}\` is deprecated as of v7.0.0.
5
- Use \`${_chunk6KRRRMY2cjs.a.config.name} ${e.join(" ")}\` instead.
5
+ Use \`${_chunkMXT7N555cjs.a.config.name} ${e.join(" ")}\` instead.
6
6
  `);let s=p(e);if(!s)throw new Error(`Failed to get help text for command: \`${e.join(" ")}\``);_chunkZUNVPK23cjs.a.log(s)}function m(){let e=_optionalChain([process, 'access', _4 => _4.argv, 'access', _5 => _5.at, 'call', _6 => _6(-1), 'optionalAccess', _7 => _7.split, 'call', _8 => _8("/"), 'access', _9 => _9.pop, 'call', _10 => _10(), 'optionalAccess', _11 => _11.trim, 'call', _12 => _12()]);if(e)i(e);else throw new Error("Deprecated command");process.exit(1)}m();
7
7
  //# sourceMappingURL=deprecated-command.cjs.map
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkLU3DKRNKcjs = require('./chunk-LU3DKRNK.cjs');var _chunkHTS7K7QDcjs = require('./chunk-HTS7K7QD.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkOMVVROKBcjs = require('./chunk-OMVVROKB.cjs');var _privacytypes = require('@transcend-io/privacy-types');var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function nt({auth:e,deploy:s=!1,transcendUrl:o=_chunkOMVVROKBcjs.r,bundleTypes:t=Object.values(_privacytypes.ConsentBundleType)}){let a=_chunkHTS7K7QDcjs.xc.call(void 0, o,e),n=await _chunkHTS7K7QDcjs.Rc.call(void 0, a);await _bluebird.mapSeries.call(void 0, t,async i=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Update Consent Manager bundle with ID "${n}" and type "${i}" to latest version...`)),await _chunkHTS7K7QDcjs.Bc.call(void 0, a,{id:n,bundleType:i}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Updated Consent Manager bundle with ID "${n}" and type "${i}" to latest version!`))}),s&&await _bluebird.mapSeries.call(void 0, t,async i=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Deploying Consent Manager bundle with ID "${n}" and type "${i}"...`)),await _chunkHTS7K7QDcjs.Ac.call(void 0, a,{id:n,bundleType:i}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Deployed Consent Manager bundle with ID "${n}" and type "${i}"!`))})}var F=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function ft({auth:e,trackerStatus:s,file:o,classifyService:t=!1,transcendUrl:a=_chunkOMVVROKBcjs.r}){let n=_chunkHTS7K7QDcjs.xc.call(void 0, a,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let l=_chunkHTS7K7QDcjs.sc.call(void 0, o,_chunkLU3DKRNKcjs.ja).map(({Type:S,Notes:p,Service:m,Purpose:C,Status:f,Owners:E,Teams:T,"Connections Made To":A,...I})=>({value:A,type:S,description:p,trackingPurposes:_chunkHTS7K7QDcjs.pc.call(void 0, C),status:f||s,owners:E?_chunkHTS7K7QDcjs.pc.call(void 0, E):void 0,teams:T?_chunkHTS7K7QDcjs.pc.call(void 0, T):void 0,attributes:Object.entries(I).filter(([y])=>!F.includes(y)).map(([y,$])=>({key:y,values:_chunkHTS7K7QDcjs.pc.call(void 0, $)}))}));await _chunkHTS7K7QDcjs.Ye.call(void 0, n,l,t)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing data flows from CSV, see logs above for more info. ")),process.exit(1))}var H=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function Mt({auth:e,trackerStatus:s,file:o,transcendUrl:t=_chunkOMVVROKBcjs.r}){let a=_chunkHTS7K7QDcjs.xc.call(void 0, t,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let i=_chunkHTS7K7QDcjs.sc.call(void 0, o,_chunkLU3DKRNKcjs.ka).map(({"Is Regex?":c,Notes:S,Service:p,Purpose:m,Status:C,Owners:f,Teams:E,Name:T,...A})=>({...typeof c=="string"?{isRegex:c.toLowerCase()==="true"}:{},name:T,description:S,trackingPurposes:_chunkHTS7K7QDcjs.pc.call(void 0, m),status:C||s,owners:f?_chunkHTS7K7QDcjs.pc.call(void 0, f):void 0,teams:E?_chunkHTS7K7QDcjs.pc.call(void 0, E):void 0,attributes:Object.entries(A).filter(([I])=>!H.includes(I)).map(([I,y])=>({key:I,values:_chunkHTS7K7QDcjs.pc.call(void 0, y)}))}));await _chunkHTS7K7QDcjs.Se.call(void 0, a,i)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing cookies from CSV, see logs above for more info. ")),process.exit(1))}var Y=1e3,j=60*Y,Q=60*j,V=24*Q,X=7*V;async function Rt(e,{bin:s,start:o,end:t=new Date}){let a=await _chunkHTS7K7QDcjs.Rc.call(void 0, e),n=Math.floor(o.getTime()/1e3),i=Math.floor(t.getTime()/1e3);if(n>i)throw new Error('Received "end" date that happened before "start" date');if(s==="1h"&&t.getTime()-o.getTime()>X*2)throw new Error("When using bin=1h, start and end time can be no more than 2 weeks apart");let l=o.toISOString(),c=t.toISOString(),[S,p,m]=await Promise.all([_chunkHTS7K7QDcjs.Uc.call(void 0, e,{dataSource:"PRIVACY_SIGNAL_TIMESERIES",startDate:l,endDate:c,forceRefetch:!0,airgapBundleId:a,binInterval:s,smoothTimeseries:!1}),_chunkHTS7K7QDcjs.Uc.call(void 0, e,{dataSource:"CONSENT_CHANGES_TIMESERIES",startDate:l,endDate:c,forceRefetch:!0,airgapBundleId:a,binInterval:s,smoothTimeseries:!1}),_chunkHTS7K7QDcjs.Uc.call(void 0, e,{dataSource:"CONSENT_SESSIONS_BY_REGIME",startDate:l,endDate:c,forceRefetch:!0,airgapBundleId:a,binInterval:s,smoothTimeseries:!1})]);return{PRIVACY_SIGNAL_TIMESERIES:S,CONSENT_CHANGES_TIMESERIES:p,CONSENT_SESSIONS_BY_REGIME:m}}var G=e=>new URL(`https://${e}`).hostname.split(".").slice(-2).join(".");var W=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;async function Gt(e,{xdiLocation:s,transcendUrl:o=_chunkOMVVROKBcjs.r,removeIpAddresses:t=!0,domainBlockList:a=["localhost"],xdiAllowedCommands:n="ConsentManager:Sync"}){let i=Array.isArray(e)?e:[{apiKey:e,organizationId:"",organizationName:""}],l=await _bluebird.map.call(void 0, i,async p=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling consent metadata for organization - ${p.organizationName}`));let m=_chunkHTS7K7QDcjs.xc.call(void 0, o,p.apiKey);return await _chunkHTS7K7QDcjs.Qc.call(void 0, m)},{concurrency:5}),c={};return l.forEach(p=>{let m=_optionalChain([p, 'access', _2 => _2.partition, 'optionalAccess', _3 => _3.partition])||p.bundleURL.split("/").reverse()[1];c[m]||(c[m]=[]);let C=_chunkOMVVROKBcjs.c.call(void 0, p.configuration.domains.filter(f=>!t||!W.test(f)).map(f=>G(f)),a);c[m]=[...new Set([...c[m]||[],...C])]}),{html:`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkABKDAPPRcjs = require('./chunk-ABKDAPPR.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');var _privacytypes = require('@transcend-io/privacy-types');var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function nt({auth:e,deploy:s=!1,transcendUrl:o=_chunkXXFLFF7Qcjs.r,bundleTypes:t=Object.values(_privacytypes.ConsentBundleType)}){let a=_chunk55B57ZAYcjs.xc.call(void 0, o,e),n=await _chunk55B57ZAYcjs.Rc.call(void 0, a);await _bluebird.mapSeries.call(void 0, t,async i=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Update Consent Manager bundle with ID "${n}" and type "${i}" to latest version...`)),await _chunk55B57ZAYcjs.Bc.call(void 0, a,{id:n,bundleType:i}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Updated Consent Manager bundle with ID "${n}" and type "${i}" to latest version!`))}),s&&await _bluebird.mapSeries.call(void 0, t,async i=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Deploying Consent Manager bundle with ID "${n}" and type "${i}"...`)),await _chunk55B57ZAYcjs.Ac.call(void 0, a,{id:n,bundleType:i}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Deployed Consent Manager bundle with ID "${n}" and type "${i}"!`))})}var F=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function ft({auth:e,trackerStatus:s,file:o,classifyService:t=!1,transcendUrl:a=_chunkXXFLFF7Qcjs.r}){let n=_chunk55B57ZAYcjs.xc.call(void 0, a,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let l=_chunk55B57ZAYcjs.sc.call(void 0, o,_chunkABKDAPPRcjs.ja).map(({Type:S,Notes:p,Service:m,Purpose:C,Status:f,Owners:E,Teams:T,"Connections Made To":A,...I})=>({value:A,type:S,description:p,trackingPurposes:_chunk55B57ZAYcjs.pc.call(void 0, C),status:f||s,owners:E?_chunk55B57ZAYcjs.pc.call(void 0, E):void 0,teams:T?_chunk55B57ZAYcjs.pc.call(void 0, T):void 0,attributes:Object.entries(I).filter(([y])=>!F.includes(y)).map(([y,$])=>({key:y,values:_chunk55B57ZAYcjs.pc.call(void 0, $)}))}));await _chunk55B57ZAYcjs.Ye.call(void 0, n,l,t)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing data flows from CSV, see logs above for more info. ")),process.exit(1))}var H=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function Mt({auth:e,trackerStatus:s,file:o,transcendUrl:t=_chunkXXFLFF7Qcjs.r}){let a=_chunk55B57ZAYcjs.xc.call(void 0, t,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let i=_chunk55B57ZAYcjs.sc.call(void 0, o,_chunkABKDAPPRcjs.ka).map(({"Is Regex?":c,Notes:S,Service:p,Purpose:m,Status:C,Owners:f,Teams:E,Name:T,...A})=>({...typeof c=="string"?{isRegex:c.toLowerCase()==="true"}:{},name:T,description:S,trackingPurposes:_chunk55B57ZAYcjs.pc.call(void 0, m),status:C||s,owners:f?_chunk55B57ZAYcjs.pc.call(void 0, f):void 0,teams:E?_chunk55B57ZAYcjs.pc.call(void 0, E):void 0,attributes:Object.entries(A).filter(([I])=>!H.includes(I)).map(([I,y])=>({key:I,values:_chunk55B57ZAYcjs.pc.call(void 0, y)}))}));await _chunk55B57ZAYcjs.Se.call(void 0, a,i)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing cookies from CSV, see logs above for more info. ")),process.exit(1))}var Y=1e3,j=60*Y,Q=60*j,V=24*Q,X=7*V;async function Rt(e,{bin:s,start:o,end:t=new Date}){let a=await _chunk55B57ZAYcjs.Rc.call(void 0, e),n=Math.floor(o.getTime()/1e3),i=Math.floor(t.getTime()/1e3);if(n>i)throw new Error('Received "end" date that happened before "start" date');if(s==="1h"&&t.getTime()-o.getTime()>X*2)throw new Error("When using bin=1h, start and end time can be no more than 2 weeks apart");let l=o.toISOString(),c=t.toISOString(),[S,p,m]=await Promise.all([_chunk55B57ZAYcjs.Uc.call(void 0, e,{dataSource:"PRIVACY_SIGNAL_TIMESERIES",startDate:l,endDate:c,forceRefetch:!0,airgapBundleId:a,binInterval:s,smoothTimeseries:!1}),_chunk55B57ZAYcjs.Uc.call(void 0, e,{dataSource:"CONSENT_CHANGES_TIMESERIES",startDate:l,endDate:c,forceRefetch:!0,airgapBundleId:a,binInterval:s,smoothTimeseries:!1}),_chunk55B57ZAYcjs.Uc.call(void 0, e,{dataSource:"CONSENT_SESSIONS_BY_REGIME",startDate:l,endDate:c,forceRefetch:!0,airgapBundleId:a,binInterval:s,smoothTimeseries:!1})]);return{PRIVACY_SIGNAL_TIMESERIES:S,CONSENT_CHANGES_TIMESERIES:p,CONSENT_SESSIONS_BY_REGIME:m}}var G=e=>new URL(`https://${e}`).hostname.split(".").slice(-2).join(".");var W=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;async function Gt(e,{xdiLocation:s,transcendUrl:o=_chunkXXFLFF7Qcjs.r,removeIpAddresses:t=!0,domainBlockList:a=["localhost"],xdiAllowedCommands:n="ConsentManager:Sync"}){let i=Array.isArray(e)?e:[{apiKey:e,organizationId:"",organizationName:""}],l=await _bluebird.map.call(void 0, i,async p=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling consent metadata for organization - ${p.organizationName}`));let m=_chunk55B57ZAYcjs.xc.call(void 0, o,p.apiKey);return await _chunk55B57ZAYcjs.Qc.call(void 0, m)},{concurrency:5}),c={};return l.forEach(p=>{let m=_optionalChain([p, 'access', _2 => _2.partition, 'optionalAccess', _3 => _3.partition])||p.bundleURL.split("/").reverse()[1];c[m]||(c[m]=[]);let C=_chunkXXFLFF7Qcjs.c.call(void 0, p.configuration.domains.filter(f=>!t||!W.test(f)).map(f=>G(f)),a);c[m]=[...new Set([...c[m]||[],...C])]}),{html:`
2
2
  <!DOCTYPE html>
3
3
  <script
4
4
  src="${s}"
@@ -9,4 +9,4 @@ data-xdi-commands="${n}"
9
9
 
10
10
  ~~~~~~~~~~~
11
11
  Airgap scripts to host:`),s.forEach(({attributes:o,title:t},a)=>{_optionalChain([o, 'optionalAccess', _7 => _7.find, 'call', _8 => _8(n=>n.key==="Airgap Production URL"), 'optionalAccess', _9 => _9.values, 'optionalAccess', _10 => _10.forEach, 'call', _11 => _11(n=>{_chunkZUNVPK23cjs.a.info(`${a}) ${t} - ${n}`)})])}),s}exports.a = nt; exports.b = ft; exports.c = Mt; exports.d = Rt; exports.e = G; exports.f = W; exports.g = Gt; exports.h = Ft;
12
- //# sourceMappingURL=chunk-LRADV5OI.cjs.map
12
+ //# sourceMappingURL=chunk-52MA7ZLS.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-LRADV5OI.cjs","../src/lib/consent-manager/updateConsentManagerVersionToLatest.ts","../src/lib/consent-manager/uploadDataFlowsFromCsv.ts","../src/lib/consent-manager/uploadCookiesFromCsv.ts","../src/lib/consent-manager/pullConsentManagerMetrics.ts","../src/lib/consent-manager/domainToHost.ts","../src/lib/consent-manager/buildXdiSyncEndpoint.ts","../src/lib/consent-manager/consentManagersToBusinessEntities.ts"],"names":["updateConsentManagerVersionToLatest","auth","deploy","transcendUrl","DEFAULT_TRANSCEND_API","bundleTypes","ConsentBundleType","client","buildTranscendGraphQLClient","consentManagerId","fetchConsentManagerId","mapSeries","bundleType","logger","colors","updateConsentManagerToLatest","deployConsentManager","OMIT_COLUMNS","uploadDataFlowsFromCsv","trackerStatus","file","classifyService","validatedDataFlowInputs","readCsv","DataFlowCsvInput","Type","Notes","Service","Purpose","Status","Owners","Teams","value","rest","splitCsvToList","key","syncDataFlows","uploadCookiesFromCsv","validatedCookieInputs","CookieCsvInput","isRegex","Name","syncCookies","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_WEEK","pullConsentManagerMetrics","bin","start","end","airgapBundleId","startTime","endTime","startDate","endDate","privacySignalData","consentChangesData","consentSessionsByRegimeData","fetchConsentManagerAnalyticsData","domainToHost","domain"],"mappings":"AAAA,quBAAiD,wDAAkH,wDAAyC,wDAAgD,2DCA1N,oCACR,gFAOP,MAUnB,SAAsBA,EAAAA,CAAoC,CACxD,IAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CAAS,CAAA,CAAA,CACT,YAAA,CAAAC,CAAAA,CAAeC,mBAAAA,CACf,WAAA,CAAAC,CAAAA,CAAc,MAAA,CAAO,MAAA,CAAOC,+BAAiB,CAC/C,CAAA,CASkB,CAEhB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BL,CAAcF,CAAI,CAAA,CAGvDQ,CAAAA,CAAmB,MAAMC,kCAAAA,CAA4B,CAAA,CAG3D,MAAMC,iCAAAA,CAAUN,CAAa,MAAOO,CAAAA,EAAe,CACjDC,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,uCAAA,EAA0CL,CAAgB,CAAA,YAAA,EAAeG,CAAU,CAAA,sBAAA,CACrF,CACF,CAAA,CACA,MAAMG,kCAAAA,CAA6BR,CAAQ,CACzC,EAAA,CAAIE,CAAAA,CACJ,UAAA,CAAAG,CACF,CAAC,CAAA,CACDC,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,wCAAA,EAA2CL,CAAgB,CAAA,YAAA,EAAeG,CAAU,CAAA,oBAAA,CACtF,CACF,CACF,CAAC,CAAA,CAGGV,CAAAA,EAEF,MAAMS,iCAAAA,CAAUN,CAAa,MAAO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AA,CACvE,MAAM,OAAA,CAAQ,GAAA,CAAI,CAChBC,kCAAAA,CAAiCrD,CAAQ,CACvC,UAAA,CAAY,2BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CAAA,CACDW,kCAAAA,CAAiCrD,CAAQ,CACvC,UAAA,CAAY,4BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CAAA,CACDW,kCAAAA,CAAiCrD,CAAQ,CACvC,UAAA,CAAY,4BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CACH,CAAC,CAAA,CAEH,MAAO,CACL,yBAAA,CAA2BQ,CAAAA,CAC3B,0BAAA,CAA4BC,CAAAA,CAC5B,0BAAA,CAA4BC,CAC9B,CACF,CChGO,IAAME,CAAAA,CAAgBC,CAAAA,EAC3B,IAAI,GAAA,CAAI,CAAA,QAAA,EAAWA,CAAM,CAAA,CAAA;ACiHA;AAAA;AAGT,KAAA;AACqC,kBAAA;AAChB,mBAAA;AAAA;AC5DzB;AAAA;AAAA;AAUd,uBAAA","file":"/home/runner/work/cli/cli/dist/chunk-LRADV5OI.cjs","sourcesContent":[null,"import { ConsentBundleType } from '@transcend-io/privacy-types';\nimport { mapSeries } from 'bluebird';\nimport {\n updateConsentManagerToLatest,\n buildTranscendGraphQLClient,\n fetchConsentManagerId,\n deployConsentManager,\n} from '../graphql';\nimport colors from 'colors';\n\nimport { logger } from '../../logger';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\n/**\n * Update the consent manager to latest version\n *\n * @param options - Options\n */\nexport async function updateConsentManagerVersionToLatest({\n auth,\n deploy = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n bundleTypes = Object.values(ConsentBundleType),\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Deploy consent manager with this update */\n deploy?: boolean;\n /** The bundle types to update and deploy */\n bundleTypes?: ConsentBundleType[];\n}): Promise<void> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Grab Consent Manager ID\n const consentManagerId = await fetchConsentManagerId(client);\n\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Update Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version...`,\n ),\n );\n await updateConsentManagerToLatest(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Updated Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version!`,\n ),\n );\n });\n\n // deploy Consent Managers\n if (deploy) {\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Deploying Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"...`,\n ),\n );\n await deployConsentManager(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Deployed Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"!`,\n ),\n );\n });\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncDataFlows } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { DataFlowInput, DataFlowCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of data flows from CSV\n *\n * @param options - Options\n */\nexport async function uploadDataFlowsFromCsv({\n auth,\n trackerStatus,\n file,\n classifyService = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of data flow inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const dataFlowInputs = readCsv(file, DataFlowCsvInput);\n\n // Convert these data flow inputs into a format that the other function can use\n const validatedDataFlowInputs = dataFlowInputs.map(\n ({\n Type,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n 'Connections Made To': value,\n ...rest\n }): DataFlowInput => ({\n value,\n type: Type,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the data flows into Transcend dashboard\n const syncedDataFlows = await syncDataFlows(\n client,\n validatedDataFlowInputs,\n classifyService,\n );\n\n // Log errors\n if (!syncedDataFlows) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing data flows from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncCookies } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { CookieInput, CookieCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of cookies from CSV\n *\n * @param options - Options\n */\nexport async function uploadCookiesFromCsv({\n auth,\n trackerStatus,\n file,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of cookie inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const cookieInputs = readCsv(file, CookieCsvInput);\n\n // Convert these inputs into a format that the other function can use\n const validatedCookieInputs = cookieInputs.map(\n ({\n 'Is Regex?': isRegex,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n Name,\n ...rest\n }): CookieInput => ({\n ...(typeof isRegex === 'string'\n ? { isRegex: isRegex.toLowerCase() === 'true' }\n : {}),\n name: Name,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the cookies into Transcend dashboard\n const syncedCookies = await syncCookies(client, validatedCookieInputs);\n\n // Log errors\n if (!syncedCookies) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing cookies from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import type { GraphQLClient } from 'graphql-request';\nimport {\n ConsentManagerMetric,\n ConsentManagerMetricBin,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '../graphql';\n\n/**\n * One second of time in ms\n */\nconst ONE_SECOND = 1000;\nconst ONE_MINUTE = 60 * ONE_SECOND;\nconst ONE_HOUR = 60 * ONE_MINUTE;\nconst ONE_DAY = 24 * ONE_HOUR;\nconst ONE_WEEK = 7 * ONE_DAY;\n\n/**\n * Pull consent manager metrics in an organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns The consent manager metrics\n */\nexport async function pullConsentManagerMetrics(\n client: GraphQLClient,\n {\n bin,\n start,\n end = new Date(),\n }: {\n /** Start date to pull metrics from */\n start: Date;\n /** End date to pull metrics from (assumes now) */\n end?: Date;\n /** Bin size to pull metrics */\n bin: ConsentManagerMetricBin;\n },\n): Promise<{\n /** Privacy signal data */\n PRIVACY_SIGNAL_TIMESERIES: ConsentManagerMetric[];\n /** Consent changes data */\n CONSENT_CHANGES_TIMESERIES: ConsentManagerMetric[];\n /** Consent sessions by regime */\n CONSENT_SESSIONS_BY_REGIME: ConsentManagerMetric[];\n}> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client);\n\n // convert start and end to times\n const startTime = Math.floor(start.getTime() / 1000);\n const endTime = Math.floor(end.getTime() / 1000);\n if (startTime > endTime) {\n throw new Error('Received \"end\" date that happened before \"start\" date');\n }\n\n // do not allow hourly bins greater than 2 weeks\n if (bin === '1h' && end.getTime() - start.getTime() > ONE_WEEK * 2) {\n throw new Error(\n 'When using bin=1h, start and end time can be no more than 2 weeks apart',\n );\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] =\n await Promise.all([\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'PRIVACY_SIGNAL_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_CHANGES_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_SESSIONS_BY_REGIME',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n ]);\n\n return {\n PRIVACY_SIGNAL_TIMESERIES: privacySignalData,\n CONSENT_CHANGES_TIMESERIES: consentChangesData,\n CONSENT_SESSIONS_BY_REGIME: consentSessionsByRegimeData,\n };\n}\n","/**\n * Convert a domain to host\n *\n * @param domain - e.g. test.acme.com\n * @returns Host acme.com\n */\nexport const domainToHost = (domain: string): string =>\n new URL(`https://${domain}`).hostname.split('.').slice(-2).join('.');\n","import colors from 'colors';\n\nimport { buildTranscendGraphQLClient, fetchConsentManager } from '../graphql';\nimport { difference } from 'lodash-es';\nimport { map } from 'bluebird';\nimport { StoredApiKey } from '../../codecs';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport { logger } from '../../logger';\nimport { domainToHost } from './domainToHost';\n\n/**\n * Sync group configuration mapping\n * e.g.\n * {\n * \"abdb5e78-0d69-4554-a3bd-84b72ca3b3d9\": [\n * \"test.com\"\n * ],\n * \"f6b3ba87-c9df-444f-b420-6fac49e35910\": [\n * \"blue.com\"\n * ]\n * }\n */\nexport type XdiSyncGroups = { [k in string]: string[] };\n\n/** Regular expression for IP addresses - remove these from sync endpoint */\nexport const IP_ADDRESS_REGEX =\n // eslint-disable-next-line max-len\n /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\n/**\n * Build the sync endpoint definition for a set of Transcend accounts\n *\n * @param apiKeys - The API keys that will be used to pull down configurations for\n * @param options - Options\n * @returns The XDI configuration\n */\nexport async function buildXdiSyncEndpoint(\n apiKeys: string | StoredApiKey[],\n {\n xdiLocation,\n transcendUrl = DEFAULT_TRANSCEND_API,\n removeIpAddresses = true,\n domainBlockList = ['localhost'],\n xdiAllowedCommands = 'ConsentManager:Sync',\n }: {\n /** The file location where the XDI file is hosted */\n xdiLocation: string;\n /** URL of Transcend API */\n transcendUrl?: string;\n /** When true, remove IP addresses (defaults to true) */\n removeIpAddresses?: boolean;\n /** Block list of domains to omit from sync endpoint - includes `localhost` by default */\n domainBlockList?: string[];\n /** Allows XDI commands */\n xdiAllowedCommands?: string;\n },\n): Promise<{\n /** Sync group configurations */\n syncGroups: XdiSyncGroups;\n /** The HTML string */\n html: string;\n}> {\n // Convert API keys to list\n const apiKeysAsList = Array.isArray(apiKeys)\n ? apiKeys\n : [{ apiKey: apiKeys, organizationId: '', organizationName: '' }];\n\n // Fetch configuration for each account\n const consentManagers = await map(\n apiKeysAsList,\n async (apiKey) => {\n logger.info(\n colors.magenta(\n `Pulling consent metadata for organization - ${apiKey.organizationName}`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n // Grab consent manager\n const consentManager = await fetchConsentManager(client);\n return consentManager;\n },\n { concurrency: 5 },\n );\n\n // construct the sync groups\n const syncGroups: XdiSyncGroups = {};\n consentManagers.forEach((consentManager) => {\n // grab the partition key\n const partitionKey =\n // take explicit key first\n consentManager.partition?.partition ||\n // fallback to bundle ID\n consentManager.bundleURL.split('/').reverse()[1];\n\n // Ensure that partition exists in the sync groups\n if (!syncGroups[partitionKey]) {\n syncGroups[partitionKey] = [];\n }\n\n // Map domain list to a host list\n const hosts = difference(\n consentManager.configuration.domains\n .filter(\n // ignore IP addresses\n (domain) => !removeIpAddresses || !IP_ADDRESS_REGEX.test(domain),\n )\n .map((domain) => domainToHost(domain)),\n // ignore block list\n domainBlockList,\n );\n // merge existing sync group with hosts for this consent manager\n syncGroups[partitionKey] = [\n ...new Set([...(syncGroups[partitionKey] || []), ...hosts]),\n ];\n });\n\n // Construct the HTML\n const syncEndpointHtml = `\n<!DOCTYPE html>\n<script\nsrc=\"${xdiLocation}\"\ndata-sync-groups='${JSON.stringify(syncGroups, null, 2)}'\ndata-xdi-commands=\"${xdiAllowedCommands}\"\n></script>\n`;\n\n return {\n html: syncEndpointHtml,\n syncGroups,\n };\n}\n","import { BusinessEntityInput, ConsentManagerInput } from '../../codecs';\nimport { logger } from '../../logger';\n\n/**\n * Combine multiple consent manager configurations into a list of business entity configurations\n *\n * @param inputs - Consent manager configurations to combine\n * @returns Business entity configuration input\n */\nexport function consentManagersToBusinessEntities(\n inputs: {\n /** Name of business entity */\n name: string;\n /** Consent manager input */\n input?: ConsentManagerInput;\n }[],\n): BusinessEntityInput[] {\n // Construct the business entities YAML definition\n const businessEntities = inputs.map(\n ({ name, input }): BusinessEntityInput => ({\n // Title of Transcend Instance\n title: name.replace('.yml', ''),\n attributes: [\n // Sync domain list\n ...(input?.domains\n ? [\n {\n key: 'Transcend Domain List',\n values: [...new Set(input.domains)],\n },\n ]\n : []),\n // Sync bundle URLs\n ...(input?.bundleUrls\n ? [\n {\n key: 'Airgap Production URL',\n values: [input.bundleUrls.PRODUCTION],\n },\n {\n key: 'Airgap Test URL',\n values: [input.bundleUrls.TEST],\n },\n {\n key: 'Airgap XDI URL',\n values: [\n input.bundleUrls.PRODUCTION.replace('airgap.js', 'xdi.js'),\n ],\n },\n ]\n : []),\n // Sync partition keys\n ...(input?.partition\n ? [\n {\n key: 'Consent Partition Key',\n values: [input.partition],\n },\n ]\n : []),\n ],\n }),\n );\n\n // Log out info on airgap scripts to host\n logger.info('\\n\\n~~~~~~~~~~~\\nAirgap scripts to host:');\n businessEntities.forEach(({ attributes, title }, ind) => {\n attributes\n ?.find((attr) => attr.key === 'Airgap Production URL')\n ?.values?.forEach((url) => {\n logger.info(`${ind}) ${title} - ${url}`);\n });\n });\n\n return businessEntities;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-52MA7ZLS.cjs","../src/lib/consent-manager/updateConsentManagerVersionToLatest.ts","../src/lib/consent-manager/uploadDataFlowsFromCsv.ts","../src/lib/consent-manager/uploadCookiesFromCsv.ts","../src/lib/consent-manager/pullConsentManagerMetrics.ts","../src/lib/consent-manager/domainToHost.ts","../src/lib/consent-manager/buildXdiSyncEndpoint.ts","../src/lib/consent-manager/consentManagersToBusinessEntities.ts"],"names":["updateConsentManagerVersionToLatest","auth","deploy","transcendUrl","DEFAULT_TRANSCEND_API","bundleTypes","ConsentBundleType","client","buildTranscendGraphQLClient","consentManagerId","fetchConsentManagerId","mapSeries","bundleType","logger","colors","updateConsentManagerToLatest","deployConsentManager","OMIT_COLUMNS","uploadDataFlowsFromCsv","trackerStatus","file","classifyService","validatedDataFlowInputs","readCsv","DataFlowCsvInput","Type","Notes","Service","Purpose","Status","Owners","Teams","value","rest","splitCsvToList","key","syncDataFlows","uploadCookiesFromCsv","validatedCookieInputs","CookieCsvInput","isRegex","Name","syncCookies","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_WEEK","pullConsentManagerMetrics","bin","start","end","airgapBundleId","startTime","endTime","startDate","endDate","privacySignalData","consentChangesData","consentSessionsByRegimeData","fetchConsentManagerAnalyticsData","domainToHost","domain"],"mappings":"AAAA,quBAAiD,wDAAkH,wDAAyC,wDAAgD,2DCA1N,oCACR,gFAOP,MAUnB,SAAsBA,EAAAA,CAAoC,CACxD,IAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CAAS,CAAA,CAAA,CACT,YAAA,CAAAC,CAAAA,CAAeC,mBAAAA,CACf,WAAA,CAAAC,CAAAA,CAAc,MAAA,CAAO,MAAA,CAAOC,+BAAiB,CAC/C,CAAA,CASkB,CAEhB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BL,CAAcF,CAAI,CAAA,CAGvDQ,CAAAA,CAAmB,MAAMC,kCAAAA,CAA4B,CAAA,CAG3D,MAAMC,iCAAAA,CAAUN,CAAa,MAAOO,CAAAA,EAAe,CACjDC,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,uCAAA,EAA0CL,CAAgB,CAAA,YAAA,EAAeG,CAAU,CAAA,sBAAA,CACrF,CACF,CAAA,CACA,MAAMG,kCAAAA,CAA6BR,CAAQ,CACzC,EAAA,CAAIE,CAAAA,CACJ,UAAA,CAAAG,CACF,CAAC,CAAA,CACDC,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,wCAAA,EAA2CL,CAAgB,CAAA,YAAA,EAAeG,CAAU,CAAA,oBAAA,CACtF,CACF,CACF,CAAC,CAAA,CAGGV,CAAAA,EAEF,MAAMS,iCAAAA,CAAUN,CAAa,MAAOO,CAAAA,EAAe,CACjDC,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,0C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A,CAAY,2BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CAAA,CACDW,kCAAAA,CAAiCrD,CAAQ,CACvC,UAAA,CAAY,4BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CAAA,CACDW,kCAAAA,CAAiCrD,CAAQ,CACvC,UAAA,CAAY,4BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CACH,CAAC,CAAA,CAEH,MAAO,CACL,yBAAA,CAA2BQ,CAAAA,CAC3B,0BAAA,CAA4BC,CAAAA,CAC5B,0BAAA,CAA4BC,CAC9B,CACF,CChGO,IAAME,CAAAA,CAAgBC,CAAAA,EAC3B,IAAI,GAAA,CAAI,CAAA,QAAA,EAAWA,CAAM,CAAA,CAAA;ACiHA;AAAA;AAGT,KAAA;AACqC,kBAAA;AAChB,mBAAA;AAAA;AC5DzB;AAAA;AAAA;AAUd,uBAAA","file":"/home/runner/work/cli/cli/dist/chunk-52MA7ZLS.cjs","sourcesContent":[null,"import { ConsentBundleType } from '@transcend-io/privacy-types';\nimport { mapSeries } from 'bluebird';\nimport {\n updateConsentManagerToLatest,\n buildTranscendGraphQLClient,\n fetchConsentManagerId,\n deployConsentManager,\n} from '../graphql';\nimport colors from 'colors';\n\nimport { logger } from '../../logger';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\n/**\n * Update the consent manager to latest version\n *\n * @param options - Options\n */\nexport async function updateConsentManagerVersionToLatest({\n auth,\n deploy = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n bundleTypes = Object.values(ConsentBundleType),\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Deploy consent manager with this update */\n deploy?: boolean;\n /** The bundle types to update and deploy */\n bundleTypes?: ConsentBundleType[];\n}): Promise<void> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Grab Consent Manager ID\n const consentManagerId = await fetchConsentManagerId(client);\n\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Update Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version...`,\n ),\n );\n await updateConsentManagerToLatest(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Updated Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version!`,\n ),\n );\n });\n\n // deploy Consent Managers\n if (deploy) {\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Deploying Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"...`,\n ),\n );\n await deployConsentManager(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Deployed Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"!`,\n ),\n );\n });\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncDataFlows } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { DataFlowInput, DataFlowCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of data flows from CSV\n *\n * @param options - Options\n */\nexport async function uploadDataFlowsFromCsv({\n auth,\n trackerStatus,\n file,\n classifyService = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of data flow inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const dataFlowInputs = readCsv(file, DataFlowCsvInput);\n\n // Convert these data flow inputs into a format that the other function can use\n const validatedDataFlowInputs = dataFlowInputs.map(\n ({\n Type,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n 'Connections Made To': value,\n ...rest\n }): DataFlowInput => ({\n value,\n type: Type,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the data flows into Transcend dashboard\n const syncedDataFlows = await syncDataFlows(\n client,\n validatedDataFlowInputs,\n classifyService,\n );\n\n // Log errors\n if (!syncedDataFlows) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing data flows from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncCookies } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { CookieInput, CookieCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of cookies from CSV\n *\n * @param options - Options\n */\nexport async function uploadCookiesFromCsv({\n auth,\n trackerStatus,\n file,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of cookie inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const cookieInputs = readCsv(file, CookieCsvInput);\n\n // Convert these inputs into a format that the other function can use\n const validatedCookieInputs = cookieInputs.map(\n ({\n 'Is Regex?': isRegex,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n Name,\n ...rest\n }): CookieInput => ({\n ...(typeof isRegex === 'string'\n ? { isRegex: isRegex.toLowerCase() === 'true' }\n : {}),\n name: Name,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the cookies into Transcend dashboard\n const syncedCookies = await syncCookies(client, validatedCookieInputs);\n\n // Log errors\n if (!syncedCookies) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing cookies from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import type { GraphQLClient } from 'graphql-request';\nimport {\n ConsentManagerMetric,\n ConsentManagerMetricBin,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '../graphql';\n\n/**\n * One second of time in ms\n */\nconst ONE_SECOND = 1000;\nconst ONE_MINUTE = 60 * ONE_SECOND;\nconst ONE_HOUR = 60 * ONE_MINUTE;\nconst ONE_DAY = 24 * ONE_HOUR;\nconst ONE_WEEK = 7 * ONE_DAY;\n\n/**\n * Pull consent manager metrics in an organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns The consent manager metrics\n */\nexport async function pullConsentManagerMetrics(\n client: GraphQLClient,\n {\n bin,\n start,\n end = new Date(),\n }: {\n /** Start date to pull metrics from */\n start: Date;\n /** End date to pull metrics from (assumes now) */\n end?: Date;\n /** Bin size to pull metrics */\n bin: ConsentManagerMetricBin;\n },\n): Promise<{\n /** Privacy signal data */\n PRIVACY_SIGNAL_TIMESERIES: ConsentManagerMetric[];\n /** Consent changes data */\n CONSENT_CHANGES_TIMESERIES: ConsentManagerMetric[];\n /** Consent sessions by regime */\n CONSENT_SESSIONS_BY_REGIME: ConsentManagerMetric[];\n}> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client);\n\n // convert start and end to times\n const startTime = Math.floor(start.getTime() / 1000);\n const endTime = Math.floor(end.getTime() / 1000);\n if (startTime > endTime) {\n throw new Error('Received \"end\" date that happened before \"start\" date');\n }\n\n // do not allow hourly bins greater than 2 weeks\n if (bin === '1h' && end.getTime() - start.getTime() > ONE_WEEK * 2) {\n throw new Error(\n 'When using bin=1h, start and end time can be no more than 2 weeks apart',\n );\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] =\n await Promise.all([\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'PRIVACY_SIGNAL_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_CHANGES_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_SESSIONS_BY_REGIME',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n ]);\n\n return {\n PRIVACY_SIGNAL_TIMESERIES: privacySignalData,\n CONSENT_CHANGES_TIMESERIES: consentChangesData,\n CONSENT_SESSIONS_BY_REGIME: consentSessionsByRegimeData,\n };\n}\n","/**\n * Convert a domain to host\n *\n * @param domain - e.g. test.acme.com\n * @returns Host acme.com\n */\nexport const domainToHost = (domain: string): string =>\n new URL(`https://${domain}`).hostname.split('.').slice(-2).join('.');\n","import colors from 'colors';\n\nimport { buildTranscendGraphQLClient, fetchConsentManager } from '../graphql';\nimport { difference } from 'lodash-es';\nimport { map } from 'bluebird';\nimport { StoredApiKey } from '../../codecs';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport { logger } from '../../logger';\nimport { domainToHost } from './domainToHost';\n\n/**\n * Sync group configuration mapping\n * e.g.\n * {\n * \"abdb5e78-0d69-4554-a3bd-84b72ca3b3d9\": [\n * \"test.com\"\n * ],\n * \"f6b3ba87-c9df-444f-b420-6fac49e35910\": [\n * \"blue.com\"\n * ]\n * }\n */\nexport type XdiSyncGroups = { [k in string]: string[] };\n\n/** Regular expression for IP addresses - remove these from sync endpoint */\nexport const IP_ADDRESS_REGEX =\n // eslint-disable-next-line max-len\n /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\n/**\n * Build the sync endpoint definition for a set of Transcend accounts\n *\n * @param apiKeys - The API keys that will be used to pull down configurations for\n * @param options - Options\n * @returns The XDI configuration\n */\nexport async function buildXdiSyncEndpoint(\n apiKeys: string | StoredApiKey[],\n {\n xdiLocation,\n transcendUrl = DEFAULT_TRANSCEND_API,\n removeIpAddresses = true,\n domainBlockList = ['localhost'],\n xdiAllowedCommands = 'ConsentManager:Sync',\n }: {\n /** The file location where the XDI file is hosted */\n xdiLocation: string;\n /** URL of Transcend API */\n transcendUrl?: string;\n /** When true, remove IP addresses (defaults to true) */\n removeIpAddresses?: boolean;\n /** Block list of domains to omit from sync endpoint - includes `localhost` by default */\n domainBlockList?: string[];\n /** Allows XDI commands */\n xdiAllowedCommands?: string;\n },\n): Promise<{\n /** Sync group configurations */\n syncGroups: XdiSyncGroups;\n /** The HTML string */\n html: string;\n}> {\n // Convert API keys to list\n const apiKeysAsList = Array.isArray(apiKeys)\n ? apiKeys\n : [{ apiKey: apiKeys, organizationId: '', organizationName: '' }];\n\n // Fetch configuration for each account\n const consentManagers = await map(\n apiKeysAsList,\n async (apiKey) => {\n logger.info(\n colors.magenta(\n `Pulling consent metadata for organization - ${apiKey.organizationName}`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n // Grab consent manager\n const consentManager = await fetchConsentManager(client);\n return consentManager;\n },\n { concurrency: 5 },\n );\n\n // construct the sync groups\n const syncGroups: XdiSyncGroups = {};\n consentManagers.forEach((consentManager) => {\n // grab the partition key\n const partitionKey =\n // take explicit key first\n consentManager.partition?.partition ||\n // fallback to bundle ID\n consentManager.bundleURL.split('/').reverse()[1];\n\n // Ensure that partition exists in the sync groups\n if (!syncGroups[partitionKey]) {\n syncGroups[partitionKey] = [];\n }\n\n // Map domain list to a host list\n const hosts = difference(\n consentManager.configuration.domains\n .filter(\n // ignore IP addresses\n (domain) => !removeIpAddresses || !IP_ADDRESS_REGEX.test(domain),\n )\n .map((domain) => domainToHost(domain)),\n // ignore block list\n domainBlockList,\n );\n // merge existing sync group with hosts for this consent manager\n syncGroups[partitionKey] = [\n ...new Set([...(syncGroups[partitionKey] || []), ...hosts]),\n ];\n });\n\n // Construct the HTML\n const syncEndpointHtml = `\n<!DOCTYPE html>\n<script\nsrc=\"${xdiLocation}\"\ndata-sync-groups='${JSON.stringify(syncGroups, null, 2)}'\ndata-xdi-commands=\"${xdiAllowedCommands}\"\n></script>\n`;\n\n return {\n html: syncEndpointHtml,\n syncGroups,\n };\n}\n","import { BusinessEntityInput, ConsentManagerInput } from '../../codecs';\nimport { logger } from '../../logger';\n\n/**\n * Combine multiple consent manager configurations into a list of business entity configurations\n *\n * @param inputs - Consent manager configurations to combine\n * @returns Business entity configuration input\n */\nexport function consentManagersToBusinessEntities(\n inputs: {\n /** Name of business entity */\n name: string;\n /** Consent manager input */\n input?: ConsentManagerInput;\n }[],\n): BusinessEntityInput[] {\n // Construct the business entities YAML definition\n const businessEntities = inputs.map(\n ({ name, input }): BusinessEntityInput => ({\n // Title of Transcend Instance\n title: name.replace('.yml', ''),\n attributes: [\n // Sync domain list\n ...(input?.domains\n ? [\n {\n key: 'Transcend Domain List',\n values: [...new Set(input.domains)],\n },\n ]\n : []),\n // Sync bundle URLs\n ...(input?.bundleUrls\n ? [\n {\n key: 'Airgap Production URL',\n values: [input.bundleUrls.PRODUCTION],\n },\n {\n key: 'Airgap Test URL',\n values: [input.bundleUrls.TEST],\n },\n {\n key: 'Airgap XDI URL',\n values: [\n input.bundleUrls.PRODUCTION.replace('airgap.js', 'xdi.js'),\n ],\n },\n ]\n : []),\n // Sync partition keys\n ...(input?.partition\n ? [\n {\n key: 'Consent Partition Key',\n values: [input.partition],\n },\n ]\n : []),\n ],\n }),\n );\n\n // Log out info on airgap scripts to host\n logger.info('\\n\\n~~~~~~~~~~~\\nAirgap scripts to host:');\n businessEntities.forEach(({ attributes, title }, ind) => {\n attributes\n ?.find((attr) => attr.key === 'Airgap Production URL')\n ?.values?.forEach((url) => {\n logger.info(`${ind}) ${title} - ${url}`);\n });\n });\n\n return businessEntities;\n}\n"]}