@transcend-io/cli 9.0.1 → 10.0.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 (393) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +26 -34
  3. package/dist/RateCounter-DFL_mnk2.mjs +2 -0
  4. package/dist/RateCounter-DFL_mnk2.mjs.map +1 -0
  5. package/dist/RequestDataSilo-_Iv44M9u.mjs +51 -0
  6. package/dist/RequestDataSilo-_Iv44M9u.mjs.map +1 -0
  7. package/dist/app-By_zDIkK.mjs +131 -0
  8. package/dist/app-By_zDIkK.mjs.map +1 -0
  9. package/dist/approvePrivacyRequests-1cguqGqq.mjs +2 -0
  10. package/dist/approvePrivacyRequests-1cguqGqq.mjs.map +1 -0
  11. package/dist/assessment-BDywVaGR.mjs +284 -0
  12. package/dist/assessment-BDywVaGR.mjs.map +1 -0
  13. package/dist/bin/bash-complete.mjs +1 -1
  14. package/dist/bin/bash-complete.mjs.map +1 -1
  15. package/dist/bin/cli.mjs +1 -1
  16. package/dist/bin/cli.mjs.map +1 -1
  17. package/dist/bin/deprecated-command.mjs +1 -1
  18. package/dist/bin/deprecated-command.mjs.map +1 -1
  19. package/dist/bluebird-CUitXgsY.mjs +2 -0
  20. package/dist/bluebird-CUitXgsY.mjs.map +1 -0
  21. package/dist/buildXdiSyncEndpoint-BMaMHO7Z.mjs +9 -0
  22. package/dist/buildXdiSyncEndpoint-BMaMHO7Z.mjs.map +1 -0
  23. package/dist/bulkRestartRequests-DEPSHov-.mjs +2 -0
  24. package/dist/bulkRestartRequests-DEPSHov-.mjs.map +1 -0
  25. package/dist/bulkRetryEnrichers-BLkcFKXC.mjs +2 -0
  26. package/dist/bulkRetryEnrichers-BLkcFKXC.mjs.map +1 -0
  27. package/dist/cancelPrivacyRequests-C8MZQvsq.mjs +2 -0
  28. package/dist/cancelPrivacyRequests-C8MZQvsq.mjs.map +1 -0
  29. package/dist/codecs-BE3Wmoh8.mjs +2 -0
  30. package/dist/codecs-BE3Wmoh8.mjs.map +1 -0
  31. package/dist/codecs-Dx_vGxsl.mjs +2 -0
  32. package/dist/codecs-Dx_vGxsl.mjs.map +1 -0
  33. package/dist/{command-Bzyj3M2G.mjs → command-BUnCUxva.mjs} +2 -2
  34. package/dist/command-BUnCUxva.mjs.map +1 -0
  35. package/dist/consentManagersToBusinessEntities-BDgOFga7.mjs +5 -0
  36. package/dist/consentManagersToBusinessEntities-BDgOFga7.mjs.map +1 -0
  37. package/dist/constants-AFtS5Nad.mjs +4 -0
  38. package/dist/constants-AFtS5Nad.mjs.map +1 -0
  39. package/dist/constants-CeMiHaHx.mjs +2 -0
  40. package/dist/constants-CeMiHaHx.mjs.map +1 -0
  41. package/dist/constants-lIvXgkdp.mjs +2 -0
  42. package/dist/constants-lIvXgkdp.mjs.map +1 -0
  43. package/dist/{context-bkKpii_t.mjs → context-CdSyuBlf.mjs} +1 -1
  44. package/dist/context-CdSyuBlf.mjs.map +1 -0
  45. package/dist/{pooling-CazydwlD.mjs → createExtraKeyHandler-C_0EVj10.mjs} +5 -5
  46. package/dist/createExtraKeyHandler-C_0EVj10.mjs.map +1 -0
  47. package/dist/createPreferenceAccessTokens-6WLr6z-l.mjs +10 -0
  48. package/dist/createPreferenceAccessTokens-6WLr6z-l.mjs.map +1 -0
  49. package/dist/createSombraGotInstance-CahOgD6V.mjs +10 -0
  50. package/dist/createSombraGotInstance-CahOgD6V.mjs.map +1 -0
  51. package/dist/{dataFlowsToDataSilos-RAhfPV0l.mjs → dataFlowsToDataSilos-NhvBw1iy.mjs} +1 -1
  52. package/dist/dataFlowsToDataSilos-NhvBw1iy.mjs.map +1 -0
  53. package/dist/dataSilo-DrFetFXw.mjs +302 -0
  54. package/dist/dataSilo-DrFetFXw.mjs.map +1 -0
  55. package/dist/dataSubject-y_aXI0pa.mjs +92 -0
  56. package/dist/dataSubject-y_aXI0pa.mjs.map +1 -0
  57. package/dist/{done-input-validation-CcZtaz03.mjs → done-input-validation-DLR0-MJ7.mjs} +1 -1
  58. package/dist/{done-input-validation-CcZtaz03.mjs.map → done-input-validation-DLR0-MJ7.mjs.map} +1 -1
  59. package/dist/downloadPrivacyRequestFiles-B2yduagB.mjs +2 -0
  60. package/dist/downloadPrivacyRequestFiles-B2yduagB.mjs.map +1 -0
  61. package/dist/enums-CyFTrzXY.mjs.map +1 -1
  62. package/dist/extractClientError-DPjv09EH.mjs +2 -0
  63. package/dist/extractClientError-DPjv09EH.mjs.map +1 -0
  64. package/dist/extractErrorMessage-CPnTsT1S.mjs +2 -0
  65. package/dist/extractErrorMessage-CPnTsT1S.mjs.map +1 -0
  66. package/dist/fetchAllActions-C0l3wjQV.mjs +832 -0
  67. package/dist/fetchAllActions-C0l3wjQV.mjs.map +1 -0
  68. package/dist/fetchAllDataFlows-AQ9j_NRa.mjs +2 -0
  69. package/dist/fetchAllDataFlows-AQ9j_NRa.mjs.map +1 -0
  70. package/dist/fetchAllPreferenceTopics-Bn9PG-rO.mjs +36 -0
  71. package/dist/fetchAllPreferenceTopics-Bn9PG-rO.mjs.map +1 -0
  72. package/dist/fetchAllPurposes-CykSkZRY.mjs +29 -0
  73. package/dist/fetchAllPurposes-CykSkZRY.mjs.map +1 -0
  74. package/dist/fetchAllPurposesAndPreferences-Dog6N9L2.mjs +2 -0
  75. package/dist/fetchAllPurposesAndPreferences-Dog6N9L2.mjs.map +1 -0
  76. package/dist/fetchAllRequestEnrichers-q34mRuE5.mjs +42 -0
  77. package/dist/fetchAllRequestEnrichers-q34mRuE5.mjs.map +1 -0
  78. package/dist/fetchAllRequestIdentifiers-YP-geTV4.mjs +10 -0
  79. package/dist/fetchAllRequestIdentifiers-YP-geTV4.mjs.map +1 -0
  80. package/dist/fetchAllRequests-DEPTEUbi.mjs +2 -0
  81. package/dist/fetchAllRequests-DEPTEUbi.mjs.map +1 -0
  82. package/dist/fetchApiKeys-DkBco7W0.mjs +33 -0
  83. package/dist/fetchApiKeys-DkBco7W0.mjs.map +1 -0
  84. package/dist/fetchCatalogs-CBk871k6.mjs +12 -0
  85. package/dist/fetchCatalogs-CBk871k6.mjs.map +1 -0
  86. package/dist/fetchConsentManagerId-DHDA5Py9.mjs +321 -0
  87. package/dist/fetchConsentManagerId-DHDA5Py9.mjs.map +1 -0
  88. package/dist/fetchIdentifiers-DjqjUnaw.mjs +54 -0
  89. package/dist/fetchIdentifiers-DjqjUnaw.mjs.map +1 -0
  90. package/dist/fetchRequestDataSilo-CF6XOTQ-.mjs +2 -0
  91. package/dist/fetchRequestDataSilo-CF6XOTQ-.mjs.map +1 -0
  92. package/dist/fetchRequestFilesForRequest-DrHGOdih.mjs +33 -0
  93. package/dist/fetchRequestFilesForRequest-DrHGOdih.mjs.map +1 -0
  94. package/dist/generateCrossAccountApiKeys-F11uqpc5.mjs +33 -0
  95. package/dist/generateCrossAccountApiKeys-F11uqpc5.mjs.map +1 -0
  96. package/dist/impl--Lmj1RHh2.mjs +2 -0
  97. package/dist/impl--Lmj1RHh2.mjs.map +1 -0
  98. package/dist/impl-0ooudQ_J2.mjs +4 -0
  99. package/dist/impl-0ooudQ_J2.mjs.map +1 -0
  100. package/dist/{impl-BYBNi68b.mjs → impl-1U4QBT_L.mjs} +2 -2
  101. package/dist/impl-1U4QBT_L.mjs.map +1 -0
  102. package/dist/impl-2FbPcOv_2.mjs +2 -0
  103. package/dist/impl-2FbPcOv_2.mjs.map +1 -0
  104. package/dist/impl-ArGeiHuz.mjs +2 -0
  105. package/dist/impl-ArGeiHuz.mjs.map +1 -0
  106. package/dist/impl-B8iVBYdg.mjs +2 -0
  107. package/dist/impl-B8iVBYdg.mjs.map +1 -0
  108. package/dist/impl-BWjBYTQZ.mjs +2 -0
  109. package/dist/impl-BWjBYTQZ.mjs.map +1 -0
  110. package/dist/impl-Bc8Es_bT.mjs +7 -0
  111. package/dist/impl-Bc8Es_bT.mjs.map +1 -0
  112. package/dist/impl-BkyC7nnu.mjs +2 -0
  113. package/dist/impl-BkyC7nnu.mjs.map +1 -0
  114. package/dist/impl-BpUksm1b2.mjs +2 -0
  115. package/dist/impl-BpUksm1b2.mjs.map +1 -0
  116. package/dist/impl-BzupMfJi.mjs +12 -0
  117. package/dist/impl-BzupMfJi.mjs.map +1 -0
  118. package/dist/impl-C05tQHSq.mjs +2 -0
  119. package/dist/impl-C05tQHSq.mjs.map +1 -0
  120. package/dist/impl-CMX0qQr_2.mjs +2 -0
  121. package/dist/impl-CMX0qQr_2.mjs.map +1 -0
  122. package/dist/impl-CWHnw3oX.mjs +2 -0
  123. package/dist/impl-CWHnw3oX.mjs.map +1 -0
  124. package/dist/impl-CXK-D84c.mjs +4 -0
  125. package/dist/impl-CXK-D84c.mjs.map +1 -0
  126. package/dist/impl-CdoTu8TH.mjs +2 -0
  127. package/dist/impl-CdoTu8TH.mjs.map +1 -0
  128. package/dist/impl-CeLfAnyA2.mjs +2 -0
  129. package/dist/impl-CeLfAnyA2.mjs.map +1 -0
  130. package/dist/impl-Cgg_bv7j.mjs +2 -0
  131. package/dist/impl-Cgg_bv7j.mjs.map +1 -0
  132. package/dist/impl-CoLIqiH-2.mjs +2 -0
  133. package/dist/impl-CoLIqiH-2.mjs.map +1 -0
  134. package/dist/impl-Cq_RqK0_2.mjs +2 -0
  135. package/dist/impl-Cq_RqK0_2.mjs.map +1 -0
  136. package/dist/{impl-CZP2l3Ds.mjs → impl-Cwj9LeEI.mjs} +3 -3
  137. package/dist/impl-Cwj9LeEI.mjs.map +1 -0
  138. package/dist/impl-CyJBbyuF.mjs +2 -0
  139. package/dist/impl-CyJBbyuF.mjs.map +1 -0
  140. package/dist/impl-D-cp0CYr.mjs +2 -0
  141. package/dist/impl-D-cp0CYr.mjs.map +1 -0
  142. package/dist/impl-D-ldjJzl2.mjs +2 -0
  143. package/dist/impl-D-ldjJzl2.mjs.map +1 -0
  144. package/dist/impl-D6nwGrO8.mjs +2 -0
  145. package/dist/impl-D6nwGrO8.mjs.map +1 -0
  146. package/dist/impl-DGRuk3AB.mjs +2 -0
  147. package/dist/impl-DGRuk3AB.mjs.map +1 -0
  148. package/dist/impl-DXWN22xV.mjs +2 -0
  149. package/dist/impl-DXWN22xV.mjs.map +1 -0
  150. package/dist/impl-DZnSlfwn2.mjs +2 -0
  151. package/dist/impl-DZnSlfwn2.mjs.map +1 -0
  152. package/dist/impl-DcC8_dCy.mjs +2 -0
  153. package/dist/impl-DcC8_dCy.mjs.map +1 -0
  154. package/dist/impl-Dfc_yQML2.mjs +2 -0
  155. package/dist/impl-Dfc_yQML2.mjs.map +1 -0
  156. package/dist/impl-DgyjJ8RY2.mjs +2 -0
  157. package/dist/impl-DgyjJ8RY2.mjs.map +1 -0
  158. package/dist/impl-DhIyASha.mjs +2 -0
  159. package/dist/impl-DhIyASha.mjs.map +1 -0
  160. package/dist/impl-Dny1LX9A.mjs +2 -0
  161. package/dist/impl-Dny1LX9A.mjs.map +1 -0
  162. package/dist/impl-G1brwI4o.mjs +2 -0
  163. package/dist/impl-G1brwI4o.mjs.map +1 -0
  164. package/dist/impl-KV3yZaHz2.mjs +2 -0
  165. package/dist/impl-KV3yZaHz2.mjs.map +1 -0
  166. package/dist/impl-Rt3C_fDF.mjs +2 -0
  167. package/dist/impl-Rt3C_fDF.mjs.map +1 -0
  168. package/dist/impl-VHp2K2bg.mjs +2 -0
  169. package/dist/impl-VHp2K2bg.mjs.map +1 -0
  170. package/dist/impl-Zr8uLP_n.mjs +2 -0
  171. package/dist/impl-Zr8uLP_n.mjs.map +1 -0
  172. package/dist/impl-dEQtD5uE.mjs +2 -0
  173. package/dist/impl-dEQtD5uE.mjs.map +1 -0
  174. package/dist/impl-dlRlTYAQ.mjs +2 -0
  175. package/dist/impl-dlRlTYAQ.mjs.map +1 -0
  176. package/dist/impl-f4UPMoS_2.mjs +2 -0
  177. package/dist/impl-f4UPMoS_2.mjs.map +1 -0
  178. package/dist/impl-ph0q6K3i.mjs +2 -0
  179. package/dist/impl-ph0q6K3i.mjs.map +1 -0
  180. package/dist/impl-r8tHyAHB.mjs +2 -0
  181. package/dist/impl-r8tHyAHB.mjs.map +1 -0
  182. package/dist/impl-y1I9Muyc2.mjs +2 -0
  183. package/dist/impl-y1I9Muyc2.mjs.map +1 -0
  184. package/dist/index.d.mts +44 -32
  185. package/dist/index.d.mts.map +1 -0
  186. package/dist/index.mjs +78 -4
  187. package/dist/index.mjs.map +1 -1
  188. package/dist/inquirer-BgNcicZ4.mjs +2 -0
  189. package/dist/inquirer-BgNcicZ4.mjs.map +1 -0
  190. package/dist/listFiles-qzyQMaYH.mjs +2 -0
  191. package/dist/listFiles-qzyQMaYH.mjs.map +1 -0
  192. package/dist/{logger-Bj782ZYD.mjs → logger-B-LXIf3U.mjs} +1 -1
  193. package/dist/{logger-Bj782ZYD.mjs.map → logger-B-LXIf3U.mjs.map} +1 -1
  194. package/dist/makeGraphQLRequest-G078PsEL.mjs +2 -0
  195. package/dist/makeGraphQLRequest-G078PsEL.mjs.map +1 -0
  196. package/dist/markRequestDataSiloIdsCompleted-DmAz-R0M.mjs +2 -0
  197. package/dist/markRequestDataSiloIdsCompleted-DmAz-R0M.mjs.map +1 -0
  198. package/dist/markSilentPrivacyRequests-s7_aBROE.mjs +2 -0
  199. package/dist/markSilentPrivacyRequests-s7_aBROE.mjs.map +1 -0
  200. package/dist/mergeTranscendInputs-C64BJsse.mjs +2 -0
  201. package/dist/mergeTranscendInputs-C64BJsse.mjs.map +1 -0
  202. package/dist/notifyPrivacyRequestsAdditionalTime-BvXIXZYu.mjs +2 -0
  203. package/dist/notifyPrivacyRequestsAdditionalTime-BvXIXZYu.mjs.map +1 -0
  204. package/dist/package-BjNQxHlz.mjs +2 -0
  205. package/dist/package-BjNQxHlz.mjs.map +1 -0
  206. package/dist/parquetToCsvOneFile-DZVKXrjn.mjs +6 -0
  207. package/dist/parquetToCsvOneFile-DZVKXrjn.mjs.map +1 -0
  208. package/dist/parseAttributesFromString-CZStzJc0.mjs +2 -0
  209. package/dist/parseAttributesFromString-CZStzJc0.mjs.map +1 -0
  210. package/dist/pullAllDatapoints-DiMWp8a7.mjs +45 -0
  211. package/dist/pullAllDatapoints-DiMWp8a7.mjs.map +1 -0
  212. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs +2 -0
  213. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs.map +1 -0
  214. package/dist/pullConsentManagerMetrics-pFRPXTHJ.mjs +2 -0
  215. package/dist/pullConsentManagerMetrics-pFRPXTHJ.mjs.map +1 -0
  216. package/dist/pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs +2 -0
  217. package/dist/pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs.map +1 -0
  218. package/dist/pullTranscendConfiguration-D2cYlu6V.mjs +80 -0
  219. package/dist/pullTranscendConfiguration-D2cYlu6V.mjs.map +1 -0
  220. package/dist/pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs +38 -0
  221. package/dist/pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs.map +1 -0
  222. package/dist/pushCronIdentifiersFromCsv-C34TB9tG.mjs +2 -0
  223. package/dist/pushCronIdentifiersFromCsv-C34TB9tG.mjs.map +1 -0
  224. package/dist/pushManualEnrichmentIdentifiersFromCsv-CGS9E3Ft.mjs +2 -0
  225. package/dist/pushManualEnrichmentIdentifiersFromCsv-CGS9E3Ft.mjs.map +1 -0
  226. package/dist/readCsv-CyOL7eCc.mjs +2 -0
  227. package/dist/readCsv-CyOL7eCc.mjs.map +1 -0
  228. package/dist/{readTranscendYaml-DhKG1ViI.mjs → readTranscendYaml-D-J1ilS0.mjs} +2 -2
  229. package/dist/readTranscendYaml-D-J1ilS0.mjs.map +1 -0
  230. package/dist/removeUnverifiedRequestIdentifiers-pGGOFbfE.mjs +35 -0
  231. package/dist/removeUnverifiedRequestIdentifiers-pGGOFbfE.mjs.map +1 -0
  232. package/dist/request-CAsR6CMY.mjs +117 -0
  233. package/dist/request-CAsR6CMY.mjs.map +1 -0
  234. package/dist/retryRequestDataSilos-DXwN5uPw.mjs +2 -0
  235. package/dist/retryRequestDataSilos-DXwN5uPw.mjs.map +1 -0
  236. package/dist/skipPreflightJobs-BNQhuPZ8.mjs +2 -0
  237. package/dist/skipPreflightJobs-BNQhuPZ8.mjs.map +1 -0
  238. package/dist/skipRequestDataSilos-C39ji4lO.mjs +2 -0
  239. package/dist/skipRequestDataSilos-C39ji4lO.mjs.map +1 -0
  240. package/dist/splitCsvToList-BRq_CIfd.mjs +2 -0
  241. package/dist/splitCsvToList-BRq_CIfd.mjs.map +1 -0
  242. package/dist/streamPrivacyRequestsToCsv-C8lquiyd.mjs +2 -0
  243. package/dist/streamPrivacyRequestsToCsv-C8lquiyd.mjs.map +1 -0
  244. package/dist/syncCodePackages-BHgjfXCI.mjs +232 -0
  245. package/dist/syncCodePackages-BHgjfXCI.mjs.map +1 -0
  246. package/dist/syncCookies-CiLtxDFf.mjs +2 -0
  247. package/dist/syncCookies-CiLtxDFf.mjs.map +1 -0
  248. package/dist/syncDataFlows-DmBUs3G_.mjs +2 -0
  249. package/dist/syncDataFlows-DmBUs3G_.mjs.map +1 -0
  250. package/dist/syncTemplates-BNu1_dmW.mjs +23 -0
  251. package/dist/syncTemplates-BNu1_dmW.mjs.map +1 -0
  252. package/dist/time-Bl_c3W8U.mjs +2 -0
  253. package/dist/time-Bl_c3W8U.mjs.map +1 -0
  254. package/dist/types-B4CVJCpj.mjs +2 -0
  255. package/dist/types-B4CVJCpj.mjs.map +1 -0
  256. package/dist/updateConsentManagerVersionToLatest-BBMN94Hs.mjs +2 -0
  257. package/dist/updateConsentManagerVersionToLatest-BBMN94Hs.mjs.map +1 -0
  258. package/dist/uploadConsents-BbR7_sSt.mjs +2 -0
  259. package/dist/uploadConsents-BbR7_sSt.mjs.map +1 -0
  260. package/dist/uploadCookiesFromCsv-BKZx_E_2.mjs +2 -0
  261. package/dist/uploadCookiesFromCsv-BKZx_E_2.mjs.map +1 -0
  262. package/dist/uploadDataFlowsFromCsv-CJFVLvCJ.mjs +2 -0
  263. package/dist/uploadDataFlowsFromCsv-CJFVLvCJ.mjs.map +1 -0
  264. package/dist/uploadPrivacyRequestsFromCsv-BmP1JluQ.mjs +17 -0
  265. package/dist/uploadPrivacyRequestsFromCsv-BmP1JluQ.mjs.map +1 -0
  266. package/dist/uploadSiloDiscoveryResults-XpDp2u35.mjs +20 -0
  267. package/dist/uploadSiloDiscoveryResults-XpDp2u35.mjs.map +1 -0
  268. package/dist/validateTranscendAuth-1W1IylqE.mjs +2 -0
  269. package/dist/validateTranscendAuth-1W1IylqE.mjs.map +1 -0
  270. package/dist/withPreferenceRetry-Cb5S310L.mjs +2 -0
  271. package/dist/withPreferenceRetry-Cb5S310L.mjs.map +1 -0
  272. package/dist/writeCsv-B51ulrVl.mjs +6 -0
  273. package/dist/writeCsv-B51ulrVl.mjs.map +1 -0
  274. package/package.json +34 -53
  275. package/dist/api-keys-CxvKdj2v.mjs +0 -2
  276. package/dist/api-keys-CxvKdj2v.mjs.map +0 -1
  277. package/dist/app-BKMxG7RO.mjs +0 -131
  278. package/dist/app-BKMxG7RO.mjs.map +0 -1
  279. package/dist/buildAIIntegrationType-Bk0EbFKV.mjs +0 -2
  280. package/dist/buildAIIntegrationType-Bk0EbFKV.mjs.map +0 -1
  281. package/dist/code-scanning-Cx1kpssH.mjs +0 -4
  282. package/dist/code-scanning-Cx1kpssH.mjs.map +0 -1
  283. package/dist/codecs-TR6p48v3.mjs +0 -2
  284. package/dist/codecs-TR6p48v3.mjs.map +0 -1
  285. package/dist/command-Bzyj3M2G.mjs.map +0 -1
  286. package/dist/consent-manager-c4bgQF1N.mjs +0 -12
  287. package/dist/consent-manager-c4bgQF1N.mjs.map +0 -1
  288. package/dist/constants-CnLQtIBn.mjs +0 -2
  289. package/dist/constants-CnLQtIBn.mjs.map +0 -1
  290. package/dist/context-bkKpii_t.mjs.map +0 -1
  291. package/dist/cron-BvxWyvDu.mjs +0 -2
  292. package/dist/cron-BvxWyvDu.mjs.map +0 -1
  293. package/dist/data-inventory-CkS_kmus.mjs +0 -75
  294. package/dist/data-inventory-CkS_kmus.mjs.map +0 -1
  295. package/dist/dataFlowsToDataSilos-RAhfPV0l.mjs.map +0 -1
  296. package/dist/impl-8dOatHnF.mjs +0 -2
  297. package/dist/impl-8dOatHnF.mjs.map +0 -1
  298. package/dist/impl-Ah-1lwzr.mjs +0 -2
  299. package/dist/impl-Ah-1lwzr.mjs.map +0 -1
  300. package/dist/impl-B5lTeRbn.mjs +0 -2
  301. package/dist/impl-B5lTeRbn.mjs.map +0 -1
  302. package/dist/impl-B6UhzQcY2.mjs +0 -2
  303. package/dist/impl-B6UhzQcY2.mjs.map +0 -1
  304. package/dist/impl-BFf_CotE2.mjs +0 -2
  305. package/dist/impl-BFf_CotE2.mjs.map +0 -1
  306. package/dist/impl-BGQ0EGS0.mjs +0 -2
  307. package/dist/impl-BGQ0EGS0.mjs.map +0 -1
  308. package/dist/impl-BYBNi68b.mjs.map +0 -1
  309. package/dist/impl-B__p3_wC.mjs +0 -2
  310. package/dist/impl-B__p3_wC.mjs.map +0 -1
  311. package/dist/impl-BcayRe6a.mjs +0 -2
  312. package/dist/impl-BcayRe6a.mjs.map +0 -1
  313. package/dist/impl-BkYKsEVG2.mjs +0 -2
  314. package/dist/impl-BkYKsEVG2.mjs.map +0 -1
  315. package/dist/impl-Bl2yVgh0.mjs +0 -4
  316. package/dist/impl-Bl2yVgh0.mjs.map +0 -1
  317. package/dist/impl-BmAMgEEM.mjs +0 -12
  318. package/dist/impl-BmAMgEEM.mjs.map +0 -1
  319. package/dist/impl-BsttzxTN2.mjs +0 -2
  320. package/dist/impl-BsttzxTN2.mjs.map +0 -1
  321. package/dist/impl-BtnySmbi.mjs +0 -2
  322. package/dist/impl-BtnySmbi.mjs.map +0 -1
  323. package/dist/impl-BwX-evfW2.mjs +0 -4
  324. package/dist/impl-BwX-evfW2.mjs.map +0 -1
  325. package/dist/impl-C-wzeAib2.mjs +0 -2
  326. package/dist/impl-C-wzeAib2.mjs.map +0 -1
  327. package/dist/impl-C61PYfk12.mjs +0 -2
  328. package/dist/impl-C61PYfk12.mjs.map +0 -1
  329. package/dist/impl-CAuNpuF2.mjs +0 -2
  330. package/dist/impl-CAuNpuF2.mjs.map +0 -1
  331. package/dist/impl-CSKrBIuV.mjs +0 -2
  332. package/dist/impl-CSKrBIuV.mjs.map +0 -1
  333. package/dist/impl-CZP2l3Ds.mjs.map +0 -1
  334. package/dist/impl-CiJ8hE5W2.mjs +0 -2
  335. package/dist/impl-CiJ8hE5W2.mjs.map +0 -1
  336. package/dist/impl-Cj3H-m2Z.mjs +0 -2
  337. package/dist/impl-Cj3H-m2Z.mjs.map +0 -1
  338. package/dist/impl-CkY0wfCz.mjs +0 -2
  339. package/dist/impl-CkY0wfCz.mjs.map +0 -1
  340. package/dist/impl-Cm8pUfBU2.mjs +0 -2
  341. package/dist/impl-Cm8pUfBU2.mjs.map +0 -1
  342. package/dist/impl-CpzS9LVu2.mjs +0 -2
  343. package/dist/impl-CpzS9LVu2.mjs.map +0 -1
  344. package/dist/impl-CwfamZ1c.mjs +0 -2
  345. package/dist/impl-CwfamZ1c.mjs.map +0 -1
  346. package/dist/impl-D81et1Yb2.mjs +0 -2
  347. package/dist/impl-D81et1Yb2.mjs.map +0 -1
  348. package/dist/impl-D92PTNk3.mjs +0 -2
  349. package/dist/impl-D92PTNk3.mjs.map +0 -1
  350. package/dist/impl-DTXDVeo6.mjs +0 -2
  351. package/dist/impl-DTXDVeo6.mjs.map +0 -1
  352. package/dist/impl-DWoysXup.mjs +0 -2
  353. package/dist/impl-DWoysXup.mjs.map +0 -1
  354. package/dist/impl-DX3JHZ4v2.mjs +0 -2
  355. package/dist/impl-DX3JHZ4v2.mjs.map +0 -1
  356. package/dist/impl-DhuUrzxQ.mjs +0 -2
  357. package/dist/impl-DhuUrzxQ.mjs.map +0 -1
  358. package/dist/impl-DqMYLKjU.mjs +0 -2
  359. package/dist/impl-DqMYLKjU.mjs.map +0 -1
  360. package/dist/impl-DqQ6CIj0.mjs +0 -2
  361. package/dist/impl-DqQ6CIj0.mjs.map +0 -1
  362. package/dist/impl-Duaq6iWI2.mjs +0 -2
  363. package/dist/impl-Duaq6iWI2.mjs.map +0 -1
  364. package/dist/impl-O5gz8qcm.mjs +0 -2
  365. package/dist/impl-O5gz8qcm.mjs.map +0 -1
  366. package/dist/impl-PH0AoC7i.mjs +0 -2
  367. package/dist/impl-PH0AoC7i.mjs.map +0 -1
  368. package/dist/impl-S8p6toVb2.mjs +0 -2
  369. package/dist/impl-S8p6toVb2.mjs.map +0 -1
  370. package/dist/impl-X2MSb8Ij.mjs +0 -2
  371. package/dist/impl-X2MSb8Ij.mjs.map +0 -1
  372. package/dist/impl-bo95wZIU2.mjs +0 -2
  373. package/dist/impl-bo95wZIU2.mjs.map +0 -1
  374. package/dist/impl-cfdCesro.mjs +0 -2
  375. package/dist/impl-cfdCesro.mjs.map +0 -1
  376. package/dist/impl-iZoXu4nV.mjs +0 -2
  377. package/dist/impl-iZoXu4nV.mjs.map +0 -1
  378. package/dist/impl-lebl6Zek2.mjs +0 -2
  379. package/dist/impl-lebl6Zek2.mjs.map +0 -1
  380. package/dist/impl-p0YN9e2e.mjs +0 -2
  381. package/dist/impl-p0YN9e2e.mjs.map +0 -1
  382. package/dist/manual-enrichment-B6lW5kAX.mjs +0 -2
  383. package/dist/manual-enrichment-B6lW5kAX.mjs.map +0 -1
  384. package/dist/mergeTranscendInputs-Coj_e2N3.mjs +0 -2
  385. package/dist/mergeTranscendInputs-Coj_e2N3.mjs.map +0 -1
  386. package/dist/pooling-CazydwlD.mjs.map +0 -1
  387. package/dist/preference-management-8gj7aSJB.mjs +0 -7
  388. package/dist/preference-management-8gj7aSJB.mjs.map +0 -1
  389. package/dist/readTranscendYaml-DhKG1ViI.mjs.map +0 -1
  390. package/dist/syncConfigurationToTranscend-VJd0PnaZ.mjs +0 -3010
  391. package/dist/syncConfigurationToTranscend-VJd0PnaZ.mjs.map +0 -1
  392. package/dist/uploadConsents-C1S-BNzw.mjs +0 -2
  393. package/dist/uploadConsents-C1S-BNzw.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pullAllDatapoints-DiMWp8a7.mjs","names":[],"sources":["../src/lib/data-inventory/pullAllDatapoints.ts"],"sourcesContent":["import {\n type DataCategoryType,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql } from 'graphql-request';\nimport type { GraphQLClient } from 'graphql-request';\n/* eslint-disable max-lines */\nimport { keyBy, uniq, chunk, sortBy } from 'lodash-es';\n\nimport type { DataCategoryInput, ProcessingPurposeInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { mapSeries } from '../bluebird.js';\nimport {\n DATAPOINT_EXPORT,\n DATA_SILO_EXPORT,\n type DataSiloAttributeValue,\n SUB_DATA_POINTS_COUNT,\n makeGraphQLRequest,\n} from '../graphql/index.js';\n\nexport interface DataSiloCsvPreview {\n /** ID of dataSilo */\n id: string;\n /** Name of dataSilo */\n title: string;\n}\n\nexport interface DataPointCsvPreview {\n /** ID of dataPoint */\n id: string;\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n}\n\nexport interface SubDataPointCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** Data point ID */\n dataPointId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /** Attribute attached to subdatapoint */\n attributeValues?: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\nexport interface DatapointFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Whether to include guessed categories, defaults to only approved categories */\n includeGuessedCategories?: boolean;\n /** Whether or not to include attributes */\n includeAttributes?: boolean;\n /** Parent categories to filter down for */\n parentCategories?: DataCategoryType[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n}\n\n/**\n * Pull subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The subdatapoints\n */\nasync function pullSubDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<SubDataPointCsvPreview[]> {\n const subDataPoints: SubDataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n // Filters\n const filterBy = {\n ...(parentCategories.length > 0 ? { category: parentCategories } : {}),\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n // if parentCategories or subCategories and not includeGuessedCategories\n ...(parentCategories.length + subCategories.length > 0 && !includeGuessedCategories\n ? // then only show data points with approved data categories\n { status: SubDataPointDataSubCategoryGuessStatus.Approved }\n : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n subDataPoints: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** Count */\n totalCount: number;\n };\n }>(client, SUB_DATA_POINTS_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPointCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliSubDataPointCsvExport(\n $filterBy: SubDataPointFiltersInput\n $first: Int!\n $offset: Int!\n ) {\n subDataPoints(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n name\n description\n dataPointId\n dataSiloId\n purposes {\n name\n purpose\n }\n categories {\n name\n category\n }\n ${\n includeGuessedCategories\n ? `pendingCategoryGuesses {\n category {\n name\n category\n }\n status\n classifierVersion\n }`\n : ''\n }\n ${\n includeAttributes\n ? `attributeValues {\n attributeKey {\n name\n }\n name\n }`\n : ''\n }\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n // TODO: https://transcend.height.app/T-40484 - add cursor support\n // ...(cursor ? { cursor: { id: cursor } } : {}),\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n subDataPoints.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(subDataPoints, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return sorted;\n}\n\n/**\n * Pull datapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints\n */\nasync function pullDatapoints(\n client: GraphQLClient,\n {\n dataPointIds = [],\n pageSize = 100,\n }: {\n /** IDs of data points to filter down */\n dataPointIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataPointCsvPreview[]> {\n const dataPoints: DataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 2/3] Fetching metadata for ${dataPointIds.length} datapoints`));\n\n // Group by 100\n const dataPointsGrouped = chunk(dataPointIds, pageSize);\n\n progressBar.start(dataPointIds.length, 0);\n let total = 0;\n await mapSeries(dataPointsGrouped, async (dataPointIdsGroup) => {\n try {\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPointCsvPreview[];\n };\n }>(client, DATAPOINT_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataPointIdsGroup,\n },\n });\n\n dataPoints.push(...nodes);\n total += dataPointIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for IDs ${dataPointIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataPoints.length} dataPoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataPoints;\n}\n\n/**\n * Pull data silo information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The data silos\n */\nasync function pullDataSilos(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n pageSize = 100,\n }: {\n /** IDs of data silos to filter down */\n dataSiloIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataSiloCsvPreview[]> {\n const dataSilos: DataSiloCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 3/3] Fetching metadata for ${dataSiloIds.length} data silos`));\n\n // Group by 100\n const dataSilosGrouped = chunk(dataSiloIds, pageSize);\n\n progressBar.start(dataSiloIds.length, 0);\n let total = 0;\n await mapSeries(dataSilosGrouped, async (dataSiloIdsGroup) => {\n try {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: DataSiloCsvPreview[];\n };\n }>(client, DATA_SILO_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataSiloIdsGroup,\n },\n });\n\n dataSilos.push(...nodes);\n total += dataSiloIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching data silos for IDs ${dataSiloIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataSilos.length} data silos in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataSilos;\n}\n\n/**\n * Pull all datapoints from the data inventory.\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints and data silos\n */\nexport async function pullAllDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<\n (SubDataPointCsvPreview & {\n /** Data point information */\n dataPoint: DataPointCsvPreview;\n /** Data silo information */\n dataSilo: DataSiloCsvPreview;\n })[]\n> {\n // Subdatapoint information\n const subDatapoints = await pullSubDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n includeAttributes,\n parentCategories,\n subCategories,\n pageSize,\n });\n\n // The datapoint ids to grab\n const dataPointIds = uniq(subDatapoints.map((point) => point.dataPointId));\n const dataPoints = await pullDatapoints(client, {\n dataPointIds,\n });\n const dataPointById = keyBy(dataPoints, 'id');\n\n // The data silo IDs to grab\n const allDataSiloIds = uniq(subDatapoints.map((point) => point.dataSiloId));\n const dataSilos = await pullDataSilos(client, {\n dataSiloIds: allDataSiloIds,\n });\n const dataSiloById = keyBy(dataSilos, 'id');\n\n return subDatapoints.map((subDataPoint) => ({\n ...subDataPoint,\n dataPoint: dataPointById[subDataPoint.dataPointId],\n dataSilo: dataSiloById[subDataPoint.dataSiloId],\n }));\n}\n/* eslint-enable max-lines */\n"],"mappings":"sbA2FA,eAAe,EACb,EACA,CACE,cAAc,EAAE,CAChB,2BACA,oBACA,mBAAmB,EAAE,CACrB,gBAAgB,EAAE,CAClB,WAAW,KAIT,EAAE,CAC6B,CACnC,IAAM,EAA0C,EAAE,CAG5C,EAAK,IAAI,MAAM,CAAC,SAAS,CAGzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAW,CACf,GAAI,EAAiB,OAAS,EAAI,CAAE,SAAU,EAAkB,CAAG,EAAE,CACrE,GAAI,EAAc,OAAS,EAAI,CAAE,eAAgB,EAAe,CAAG,EAAE,CAErE,GAAI,EAAiB,OAAS,EAAc,OAAS,GAAK,CAAC,EAEvD,CAAE,OAAQ,EAAuC,SAAU,CAC3D,EAAE,CACN,GAAI,EAAY,OAAS,EAAI,CAAE,UAAW,EAAa,CAAG,EAAE,CAC7D,CAGK,CACJ,cAAe,CAAE,eACf,MAAM,EAMP,EAAQ,EAAuB,CAChC,WACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,0CAA0C,CAAC,CAEtE,EAAY,MAAM,EAAY,EAAE,CAChC,IAAI,EAAQ,EACR,EAAiB,GACjB,EACA,EAAS,EACb,EACE,IAAI,CACF,GAAM,CACJ,cAAe,CAAE,UACf,MAAM,EAOR,EACA,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2BO,EACI;;;;;;;mBAQA,GACL;kBAEC,EACI;;;;;mBAMA,GACL;;;;UAKT,CACE,MAAO,EACP,SACA,SAAU,CACR,GAAG,EAGJ,CACF,CACF,CAED,EAAS,EAAM,EAAM,OAAS,IAAI,GAClC,EAAc,KAAK,GAAG,EAAM,CAC5B,EAAiB,EAAM,SAAW,EAClC,GAAS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,IAAkB,CAC1C,GAAG,EACH,UAAW,EAAc,EAAa,aACtC,SAAU,EAAa,EAAa,YACrC,EAAE"}
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{n}from"./bluebird-CUitXgsY.mjs";import{t as r}from"./createSombraGotInstance-CahOgD6V.mjs";import{n as i}from"./RequestDataSilo-_Iv44M9u.mjs";import{r as a,t as o}from"./makeGraphQLRequest-G078PsEL.mjs";import{decodeCodec as s}from"@transcend-io/type-utils";import c from"colors";import*as l from"io-ts";import u from"cli-progress";async function d(e,{dataSiloId:t}){let{listReducedRequestsForDataSilo:{totalCount:n}}=await o(e,i,{input:{dataSiloId:t,isResolved:!1}});return n}const f=l.type({identifier:l.string,type:l.string,coreIdentifier:l.string,dataSiloId:l.string,requestId:l.string,nonce:l.string,requestCreatedAt:l.string,daysUntilOverdue:l.number,attributes:l.array(l.type({key:l.string,values:l.array(l.string)}))});async function p(e,{dataSiloId:t,limit:n=100,offset:r=0,requestType:i}){try{let a=await e.get(`v1/data-silo/${t}/pending-requests/${i}`,{searchParams:{offset:r,limit:n}}).json(),{items:o}=s(l.type({items:l.array(f)}),a);return o}catch(e){throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function m({dataSiloId:i,auth:o,sombraAuth:s,actions:l,apiPageSize:f=100,savePageSize:m=1e3,onSave:h,transcendUrl:g=e,skipRequestCount:_=!1}){if(m%f!==0)throw Error(`savePageSize must be a multiple of apiPageSize. savePageSize: ${m}, apiPageSize: ${f}`);let v=await r(g,o,s),y=a(g,o),b=0;_||(b=await d(y,{dataSiloId:i})),t.info(c.magenta(`Pulling ${_?`all`:b} outstanding request identifiers for data silo: "${i}" for requests of types "${l.join(`", "`)}"`));let x=new Date().getTime(),S=new u.SingleBar({},u.Presets.shades_classic),C=new Set,w=[],T=[];_||S.start(b,0),await n(l,async e=>{let n=0,r=!0;for(;r;){let a=await p(v,{dataSiloId:i,limit:f,offset:n,requestType:e}),o=a.map(t=>(C.add(t.requestId),{...t,action:e})),s=o.map(({attributes:e,...t})=>({...t,...e.reduce((e,t)=>Object.assign(e,{[t.key]:t.values.join(`,`)}),{})}));w.push(...o),T.push(...s),T.length>=m&&(await h(T),T=[]),r=a.length===f,n+=f,_?t.info(c.magenta(`Pulled ${a.length} outstanding identifiers for ${C.size} requests`)):S.update(C.size)}}),T.length>0&&await h(T),_||S.stop();let E=new Date().getTime()-x;return t.info(c.green(`Successfully pulled ${w.length} outstanding identifiers from ${C.size} requests in "${E/1e3}" seconds!`)),{identifiers:w}}export{d as i,f as n,p as r,m as t};
2
+ //# sourceMappingURL=pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { GraphQLClient } from 'graphql-request';\n\nimport { REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\n/**\n * Get number of open requests for a data silo\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request identifiers\n */\nexport async function fetchRequestDataSiloActiveCount(\n client: GraphQLClient,\n {\n dataSiloId,\n }: {\n /** Data silo ID */\n dataSiloId: string;\n },\n): Promise<number> {\n const {\n listReducedRequestsForDataSilo: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n listReducedRequestsForDataSilo: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, {\n input: {\n dataSiloId,\n isResolved: false,\n },\n });\n\n return totalCount;\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nexport const CronIdentifier = t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n});\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // Make the GraphQL request\n const response = await sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json();\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { mapSeries } from '../bluebird.js';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchRequestDataSiloActiveCount,\n} from '../graphql/index.js';\nimport { pullCronPageOfIdentifiers, CronIdentifier } from './pullCronPageOfIdentifiers.js';\n\n/**\n * A CSV formatted identifier\n */\nexport type CsvFormattedIdentifier = {\n [k in string]: string | null | boolean | number;\n};\n\nexport interface CronIdentifierWithAction extends CronIdentifier {\n /** The request action that the identifier relates to */\n action: RequestAction;\n}\n\n/**\n * Pull the set of identifiers outstanding for a cron or AVC integration\n *\n * This function is designed to be used in a loop, and will call the onSave callback\n * with a chunk of identifiers when the savePageSize is reached.\n *\n * @param options - Options\n * @returns The identifiers and identifiers formatted for CSV\n */\nexport async function pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize = 100,\n savePageSize = 1000,\n onSave,\n transcendUrl = DEFAULT_TRANSCEND_API,\n skipRequestCount = false,\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** The request actions to fetch */\n actions: RequestAction[];\n /** How many identifiers to pull in a single call to the backend */\n apiPageSize: number;\n /** How many identifiers to save at a time (usually to a CSV file, should be a multiple of apiPageSize) */\n savePageSize: number;\n /** Callback function called when a chunk of identifiers is ready to be saved */\n onSave: (chunk: CsvFormattedIdentifier[]) => Promise<void>;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Skip request count */\n skipRequestCount?: boolean;\n}): Promise<{\n /** Raw Identifiers */\n identifiers: CronIdentifierWithAction[];\n}> {\n // Validate savePageSize\n if (savePageSize % apiPageSize !== 0) {\n throw new Error(\n `savePageSize must be a multiple of apiPageSize. savePageSize: ${savePageSize}, apiPageSize: ${apiPageSize}`,\n );\n }\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n let totalRequestCount = 0;\n if (!skipRequestCount) {\n totalRequestCount = await fetchRequestDataSiloActiveCount(client, {\n dataSiloId,\n });\n }\n\n logger.info(\n colors.magenta(\n `Pulling ${skipRequestCount ? 'all' : totalRequestCount} outstanding request identifiers ` +\n `for data silo: \"${dataSiloId}\" for requests of types \"${actions.join('\", \"')}\"`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const foundRequestIds = new Set<string>();\n\n // identifiers found in total\n const identifiers: CronIdentifierWithAction[] = [];\n // current chunk of identifiers to be saved\n let currentChunk: CsvFormattedIdentifier[] = [];\n\n // map over each action\n if (!skipRequestCount) {\n progressBar.start(totalRequestCount, 0);\n }\n await mapSeries(actions, async (action) => {\n let offset = 0;\n let shouldContinue = true;\n\n // Fetch a page of identifiers\n while (shouldContinue) {\n const pageIdentifiers = await pullCronPageOfIdentifiers(sombra, {\n dataSiloId,\n limit: apiPageSize,\n offset,\n requestType: action,\n });\n\n const identifiersWithAction: CronIdentifierWithAction[] = pageIdentifiers.map(\n (identifier) => {\n foundRequestIds.add(identifier.requestId);\n return {\n ...identifier,\n action,\n };\n },\n );\n\n const csvFormattedIdentifiers = identifiersWithAction.map(\n ({ attributes, ...identifier }) => ({\n ...identifier,\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n\n return { identifiers };\n}\n"],"mappings":"qaAYA,eAAsB,EACpB,EACA,CACE,cAKe,CACjB,GAAM,CACJ,+BAAgC,CAAE,eAChC,MAAM,EAMP,EAAQ,EAAsC,CAC/C,MAAO,CACL,aACA,WAAY,GACb,CACF,CAAC,CAEF,OAAO,EC/BT,MAAa,EAAiB,EAAE,KAAK,CAEnC,WAAY,EAAE,OAEd,KAAM,EAAE,OAER,eAAgB,EAAE,OAElB,WAAY,EAAE,OAEd,UAAW,EAAE,OAEb,MAAO,EAAE,OAET,iBAAkB,EAAE,OAEpB,iBAAkB,EAAE,OAEpB,WAAY,EAAE,MACZ,EAAE,KAAK,CACL,IAAK,EAAE,OACP,OAAQ,EAAE,MAAM,EAAE,OAAO,CAC1B,CAAC,CACH,CACF,CAAC,CAaF,eAAsB,EACpB,EACA,CACE,aACA,QAAQ,IACR,SAAS,EACT,eAWyB,CAC3B,GAAI,CAEF,IAAM,EAAW,MAAM,EACpB,IAAI,gBAAgB,EAAW,oBAAoB,IAAe,CACjE,aAAc,CACZ,SACA,QACD,CACF,CAAC,CACD,MAAM,CAEH,CAAE,SAAU,EAChB,EAAE,KAAK,CACL,MAAO,EAAE,MAAM,EAAe,CAC/B,CAAC,CACF,EACD,CACD,OAAO,QACA,EAAK,CACZ,MAAU,MAAM,kCAAkC,GAAK,UAAU,MAAQ,GAAK,UAAU,EC5C5F,eAAsB,EAA4C,CAChE,aACA,OACA,aACA,UACA,cAAc,IACd,eAAe,IACf,SACA,eAAe,EACf,mBAAmB,IAuBlB,CAED,GAAI,EAAe,IAAgB,EACjC,MAAU,MACR,iEAAiE,EAAa,iBAAiB,IAChG,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,GACxB,MAAM,EAAO,EAAa,CAGvB,GACH,EAAY,MAAM,CAGpB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAUvB,OARA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAY,OAAO,gCACxC,EAAgB,KACjB,gBAAgB,EAAY,IAAK,YACnC,CACF,CAEM,CAAE,cAAa"}
@@ -0,0 +1,2 @@
1
+ import{a as e,r as t}from"./fetchConsentManagerId-DHDA5Py9.mjs";async function n(n,{bin:r,start:i,end:a=new Date}){let o=await e(n);if(Math.floor(i.getTime()/1e3)>Math.floor(a.getTime()/1e3))throw Error(`Received "end" date that happened before "start" date`);if(r===`1h`&&a.getTime()-i.getTime()>6048e5*2)throw Error(`When using bin=1h, start and end time can be no more than 2 weeks apart`);let s=i.toISOString(),c=a.toISOString(),[l,u,d]=await Promise.all([t(n,{dataSource:`PRIVACY_SIGNAL_TIMESERIES`,startDate:s,endDate:c,forceRefetch:!0,airgapBundleId:o,binInterval:r,smoothTimeseries:!1}),t(n,{dataSource:`CONSENT_CHANGES_TIMESERIES`,startDate:s,endDate:c,forceRefetch:!0,airgapBundleId:o,binInterval:r,smoothTimeseries:!1}),t(n,{dataSource:`CONSENT_SESSIONS_BY_REGIME`,startDate:s,endDate:c,forceRefetch:!0,airgapBundleId:o,binInterval:r,smoothTimeseries:!1})]);return{PRIVACY_SIGNAL_TIMESERIES:l,CONSENT_CHANGES_TIMESERIES:u,CONSENT_SESSIONS_BY_REGIME:d}}export{n as t};
2
+ //# sourceMappingURL=pullConsentManagerMetrics-pFRPXTHJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pullConsentManagerMetrics-pFRPXTHJ.mjs","names":[],"sources":["../src/lib/consent-manager/pullConsentManagerMetrics.ts"],"sourcesContent":["import type { GraphQLClient } from 'graphql-request';\n\nimport {\n ConsentManagerMetric,\n ConsentManagerMetricBin,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '../graphql/index.js';\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('When using bin=1h, start and end time can be no more than 2 weeks apart');\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] = 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"],"mappings":"gEAyBA,eAAsB,EACpB,EACA,CACE,MACA,QACA,MAAM,IAAI,MAgBX,CAED,IAAM,EAAiB,MAAM,EAAsB,EAAO,CAK1D,GAFkB,KAAK,MAAM,EAAM,SAAS,CAAG,IAAK,CACpC,KAAK,MAAM,EAAI,SAAS,CAAG,IAAK,CAE9C,MAAU,MAAM,wDAAwD,CAI1E,GAAI,IAAQ,MAAQ,EAAI,SAAS,CAAG,EAAM,SAAS,CAAG,OAAW,EAC/D,MAAU,MAAM,0EAA0E,CAI5F,IAAM,EAAY,EAAM,aAAa,CAC/B,EAAU,EAAI,aAAa,CAC3B,CAAC,EAAmB,EAAoB,GAA+B,MAAM,QAAQ,IAAI,CAC7F,EAAiC,EAAQ,CACvC,WAAY,4BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CAAC,CACF,EAAiC,EAAQ,CACvC,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CAAC,CACF,EAAiC,EAAQ,CACvC,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CAAC,CACH,CAAC,CAEF,MAAO,CACL,0BAA2B,EAC3B,2BAA4B,EAC5B,2BAA4B,EAC7B"}
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./bluebird-CUitXgsY.mjs";import{t as r}from"./createSombraGotInstance-CahOgD6V.mjs";import{t as i}from"./fetchAllRequestEnrichers-q34mRuE5.mjs";import{n as a,r as o}from"./fetchAllRequestIdentifiers-YP-geTV4.mjs";import{r as s}from"./makeGraphQLRequest-G078PsEL.mjs";import{r as c}from"./fetchAllRequests-DEPTEUbi.mjs";import{a as l}from"./writeCsv-B51ulrVl.mjs";import{RequestStatus as u}from"@transcend-io/privacy-types";import{groupBy as d,uniq as f}from"lodash-es";import p from"colors";async function m({file:m,auth:h,sombraAuth:g,requestActions:_=[],concurrency:v=100,transcendUrl:y=e}){let b=s(y,h),x=await r(y,h,g);t.info(p.magenta(`Pulling manual enrichment requests, filtered for actions: ${_.join(`,`)}`));let S=await c(b,{actions:_,statuses:[u.Enriching]});await o(b);let C=[];await n(S,async e=>{let t=await i(b,{requestId:e.id});if(t.filter(({status:e})=>e===`ACTION_REQUIRED`)){let n=await a(b,x,{requestId:e.id,skipSombraCheck:!0});C.push({...e,requestIdentifiers:n,requestEnrichers:t})}},{concurrency:v});let w=C.map(({attributeValues:e,requestIdentifiers:t,requestEnrichers:n,...r})=>({...r,...Object.entries(d(t,`name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({value:e})=>e).join(`,`)}),{}),...Object.entries(d(e,`attributeKey.name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({name:e})=>e).join(`,`)}),{})}));return await l(m,w,f(w.map(e=>Object.keys(e)).flat())),t.info(p.green(`Successfully wrote ${C.length} requests to file "${m}"`)),C}export{m as t};
2
+ //# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs","names":[],"sources":["../src/lib/manual-enrichment/pullManualEnrichmentIdentifiersToCsv.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { groupBy, uniq } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { map } from '../bluebird.js';\nimport {\n PrivacyRequest,\n RequestEnricher,\n RequestIdentifier,\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllRequestEnrichers,\n fetchAllRequestIdentifiers,\n fetchAllRequests,\n validateSombraVersion,\n} from '../graphql/index.js';\nimport { writeCsv } from '../helpers/writeCsv.js';\n\nexport interface PrivacyRequestWithIdentifiers extends PrivacyRequest {\n /** Request Enrichers */\n requestEnrichers: RequestEnricher[];\n /** Request Identifiers */\n requestIdentifiers: RequestIdentifier[];\n}\n\n/**\n * Pull the set of manual enrichment jobs to CSV\n *\n * @param options - Options\n * @returns List of requests with identifiers\n */\nexport async function pullManualEnrichmentIdentifiersToCsv({\n file,\n auth,\n sombraAuth,\n requestActions = [],\n concurrency = 100,\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 */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** The request actions to fetch */\n requestActions?: RequestAction[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<PrivacyRequestWithIdentifiers[]> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n\n logger.info(\n colors.magenta(\n `Pulling manual enrichment requests, filtered for actions: ${requestActions.join(',')}`,\n ),\n );\n\n // Pull all privacy requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n });\n\n await validateSombraVersion(client);\n\n // Requests to save\n const savedRequests: PrivacyRequestWithIdentifiers[] = [];\n\n // Filter down requests to what is needed\n await map(\n allRequests,\n async (request) => {\n // Fetch enrichers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n requestId: request.id,\n });\n\n // Check if manual enrichment exists for that request\n const hasManualEnrichment = requestEnrichers.filter(\n ({ status }) => status === 'ACTION_REQUIRED',\n );\n\n // Save request to queue\n if (hasManualEnrichment) {\n const requestIdentifiers = await fetchAllRequestIdentifiers(client, sombra, {\n requestId: request.id,\n skipSombraCheck: true,\n });\n savedRequests.push({\n ...request,\n requestIdentifiers,\n requestEnrichers,\n });\n }\n },\n {\n concurrency,\n },\n );\n\n const data = savedRequests.map(\n ({\n attributeValues,\n requestIdentifiers,\n requestEnrichers, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...request\n }) => ({\n ...request,\n // flatten identifiers\n ...Object.entries(groupBy(requestIdentifiers, 'name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ value }) => value).join(','),\n }),\n {},\n ),\n // flatten attributes\n ...Object.entries(groupBy(attributeValues, 'attributeKey.name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ name }) => name).join(','),\n }),\n {},\n ),\n }),\n );\n\n // Write out to CSV\n const headers = uniq(data.map((d) => Object.keys(d)).flat());\n await writeCsv(file, data, headers);\n\n logger.info(\n colors.green(`Successfully wrote ${savedRequests.length} requests to file \"${file}\"`),\n );\n\n return savedRequests;\n}\n"],"mappings":"glBAiCA,eAAsB,EAAqC,CACzD,OACA,OACA,aACA,iBAAiB,EAAE,CACnB,cAAc,IACd,eAAe,GAc4B,CAE3C,IAAM,EAAS,EAA4B,EAAc,EAAK,CACxD,EAAS,MAAM,EAAwB,EAAc,EAAM,EAAW,CAE5E,EAAO,KACL,EAAO,QACL,6DAA6D,EAAe,KAAK,IAAI,GACtF,CACF,CAGD,IAAM,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,SAAU,CAAC,EAAc,UAAU,CACpC,CAAC,CAEF,MAAM,EAAsB,EAAO,CAGnC,IAAM,EAAiD,EAAE,CAGzD,MAAM,EACJ,EACA,KAAO,IAAY,CAEjB,IAAM,EAAmB,MAAM,EAAyB,EAAQ,CAC9D,UAAW,EAAQ,GACpB,CAAC,CAQF,GAL4B,EAAiB,QAC1C,CAAE,YAAa,IAAW,kBAC5B,CAGwB,CACvB,IAAM,EAAqB,MAAM,EAA2B,EAAQ,EAAQ,CAC1E,UAAW,EAAQ,GACnB,gBAAiB,GAClB,CAAC,CACF,EAAc,KAAK,CACjB,GAAG,EACH,qBACA,mBACD,CAAC,GAGN,CACE,cACD,CACF,CAED,IAAM,EAAO,EAAc,KACxB,CACC,kBACA,qBACA,mBACA,GAAG,MACE,CACL,GAAG,EAEH,GAAG,OAAO,QAAQ,EAAQ,EAAoB,OAAO,CAAC,CAAC,QACpD,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,WAAY,EAAM,CAAC,KAAK,IAAI,CAClD,CAAC,CACJ,EAAE,CACH,CAED,GAAG,OAAO,QAAQ,EAAQ,EAAiB,oBAAoB,CAAC,CAAC,QAC9D,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,UAAW,EAAK,CAAC,KAAK,IAAI,CAChD,CAAC,CACJ,EAAE,CACH,CACF,EACF,CAUD,OANA,MAAM,EAAS,EAAM,EADL,EAAK,EAAK,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CACzB,CAEnC,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAc,OAAO,qBAAqB,EAAK,GAAG,CACtF,CAEM"}
@@ -0,0 +1,80 @@
1
+ import{o as e}from"./enums-CyFTrzXY.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./fetchIdentifiers-DjqjUnaw.mjs";import{n as r}from"./fetchApiKeys-DkBco7W0.mjs";import{t as i}from"./syncTemplates-BNu1_dmW.mjs";import{Bt as a,C as o,D as s,F as c,I as l,M as u,N as d,O as f,P as p,S as m,T as h,_ as g,b as _,f as v,g as y,h as b,i as x,k as S,l as C,n as w,ot as T,p as ee,t as te,w as ne,x as re}from"./fetchAllActions-C0l3wjQV.mjs";import{n as ie,t as E}from"./assessment-BDywVaGR.mjs";import{a as D,i as ae,l as O,n as oe,o as se}from"./fetchConsentManagerId-DHDA5Py9.mjs";import{t as k}from"./makeGraphQLRequest-G078PsEL.mjs";import{t as ce}from"./fetchAllDataFlows-AQ9j_NRa.mjs";import{t as le}from"./fetchAllPurposesAndPreferences-Dog6N9L2.mjs";import{ActionItemCode as ue,AssessmentsDisplayLogicAction as de,ComparisonOperator as A,ConsentTrackerStatus as j,LogicOperator as M,RequestAction as fe,RetentionType as pe}from"@transcend-io/privacy-types";import{flatten as me,keyBy as he,mapValues as ge}from"lodash-es";import{decodeCodec as N,valuesOf as P}from"@transcend-io/type-utils";import _e from"colors";import*as F from"io-ts";import{gql as I}from"graphql-request";const L=I`
2
+ query TranscendCliAssessmentTemplates(
3
+ $first: Int!
4
+ $offset: Int!
5
+ $filterBy: AssessmentFormTemplateFiltersInput
6
+ ) {
7
+ assessmentFormTemplates(
8
+ first: $first
9
+ offset: $offset
10
+ filterBy: $filterBy
11
+ ) {
12
+ nodes {
13
+ id
14
+ creator {
15
+ id
16
+ email
17
+ name
18
+ }
19
+ lastEditor {
20
+ id
21
+ email
22
+ name
23
+ }
24
+ title
25
+ description
26
+ status
27
+ source
28
+ parentId
29
+ isLocked
30
+ isArchived
31
+ createdAt
32
+ updatedAt
33
+ retentionSchedule {
34
+ id
35
+ type
36
+ durationDays
37
+ operation
38
+ createdAt
39
+ updatedAt
40
+ }
41
+ assessmentEmailSet {
42
+ id
43
+ title
44
+ description
45
+ isDefault
46
+ templates {
47
+ id
48
+ title
49
+ }
50
+ }
51
+ sections {
52
+ ${ie}
53
+ }
54
+ }
55
+ }
56
+ }
57
+ `,R=I`
58
+ query TranscendCliSiloDiscoveryResults($first: Int!, $offset: Int!) {
59
+ siloDiscoveryResults(first: $first, offset: $offset) {
60
+ nodes {
61
+ title
62
+ resourceId
63
+ country
64
+ countrySubDivision
65
+ plaintextContext
66
+ status
67
+ containsSensitiveData
68
+ suggestedCatalog {
69
+ title
70
+ }
71
+ plugin {
72
+ dataSilo {
73
+ title
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ `;async function z(e){let t=[],n=0,r=!1;do{let{assessmentForms:{nodes:i}}=await k(e,E,{first:20,offset:n});t.push(...i),n+=20,r=i.length===20}while(r);return t.sort((e,t)=>e.title.localeCompare(t.title))}async function ve(e){let t=[],n=0,r=!1;do{let{assessmentFormTemplates:{nodes:i}}=await k(e,L,{first:20,offset:n});t.push(...i),n+=20,r=i.length===20}while(r);return t.sort((e,t)=>e.title.localeCompare(t.title))}async function B(e,t=j.Live){let n=[],r=0,i=await D(e),a=!1;do{let{cookies:{nodes:o}}=await k(e,O,{first:20,offset:r,airgapBundleId:i,status:t});n.push(...o),r+=20,a=o.length===20}while(a);return n.sort((e,t)=>e.name.localeCompare(t.name))}async function ye(e){let{translatedMessages:t}=await k(e,a,{});return t}function V(e){let t=[];return e.map(e=>{let n=t.find(t=>t.key===e.attributeKey.name);return n===void 0?(n={key:e.attributeKey.name,values:[e.name]},t.push(n)):n.values.push(e.name),t}),t}async function be(e){let{privacyCenter:{themeStr:t,...n}}=await k(e,T,{url:await s(e)});return[{...n,theme:JSON.parse(t)}]}const H=F.type({dependsOnQuestionReferenceId:F.string,comparisonOperator:F.union([F.literal(A.IsEqualTo),F.literal(A.IsNotEqualTo),F.literal(A.IsOneOf),F.literal(A.IsNotOneOf),F.literal(A.Contains)]),comparisonOperands:F.array(F.string)}),U=F.type({dependsOnQuestionReferenceId:F.string,comparisonOperator:F.union([F.literal(A.IsNotShown),F.literal(A.IsShown)])}),W=F.union([H,U]),G=F.recursion(`AssessmentNestedRule`,e=>F.intersection([F.type({logicOperator:P(M)}),F.partial({rules:F.array(W),nestedRules:F.array(e)})])),K=F.partial({action:P(de),rule:W,nestedRule:G});function q(e){return N(K,e)}const J=F.intersection([F.partial({riskAssignment:F.partial({riskLevelId:F.string,riskMatrixRowId:F.string,riskMatrixColumnId:F.string})}),F.type({comparisonOperands:F.array(F.string),comparisonOperator:P(A)})]);function Y(e){return N(J,e)}async function xe(e){let t=[],n=0,r=!1;do{let{siloDiscoveryResults:{nodes:i}}=await k(e,R,{first:30,offset:n,input:{},filterBy:{}}),a=i.map(e=>e.title===null&&e.suggestedCatalog?.title?{...e,title:e.suggestedCatalog.title}:e);t.push(...a),n+=30,r=i.length===30}while(r);return t}function Se(e){return e.map(({country:e,countrySubDivision:t})=>({country:e,...t?{countrySubDivision:t}:{}}))}const Ce=[e.DataSilos,e.Enrichers,e.Templates,e.ApiKeys];async function we(a,{dataSiloIds:s,integrationNames:T,debug:ie,resources:E=Ce,pageSize:D,skipDatapoints:O,includeGuessedCategories:k,skipSubDatapoints:de,trackerStatuses:A=Object.values(j)}){if(s.length>0&&T.length>0)throw Error(`Only 1 of integrationNames OR dataSiloIds can be provided`);t.info(_e.magenta(`Fetching data with page size ${D}...`));let[M,N,P,F,I,L,R,H,U,W,G,K,J,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,X,Re,ze,Be,Ve,He,Ue]=await Promise.all([E.includes(e.DataSilos)||E.includes(e.DataSubjects)?_(a):[],E.includes(e.ApiKeys)?r({},a,!0):[],E.includes(e.DataSilos)?C(a,{ids:s,integrationNames:T,pageSize:D,debug:ie,includeGuessedCategories:k,skipDatapoints:O,skipSubDatapoints:de}):[],E.includes(e.Enrichers)?x(a):[],E.includes(e.DataFlows)?[...A.includes(j.Live)?await ce(a,j.Live):[],...A.includes(j.NeedsReview)?await ce(a,j.NeedsReview):[]]:[],E.includes(e.Cookies)?[...A.includes(j.Live)?await B(a,j.Live):[],...A.includes(j.NeedsReview)?await B(a,j.NeedsReview):[]]:[],E.includes(e.Attributes)?u(a):[],E.includes(e.Templates)?i(a):[],E.includes(e.Identifiers)?n(a):[],E.includes(e.Actions)?te(a):[],E.includes(e.BusinessEntities)?S(a):[],E.includes(e.ProcessingActivities)?ne(a):[],E.includes(e.ConsentManager)?oe(a):void 0,E.includes(e.ConsentManager)?ae(a):[],E.includes(e.Prompts)?ee(a):[],E.includes(e.PromptPartials)?b(a):[],E.includes(e.PromptGroups)?y(a):[],E.includes(e.Agents)?d(a):[],E.includes(e.AgentFunctions)?p(a):[],E.includes(e.AgentFiles)?c(a):[],E.includes(e.Vendors)?re(a):[],E.includes(e.DataCategories)?f(a):[],E.includes(e.ProcessingPurposes)?o(a):[],E.includes(e.ActionItems)?l(a,{type:[ue.Onboarding]}):[],E.includes(e.ActionItemCollections)?v(a):[],E.includes(e.Teams)?m(a):[],E.includes(e.Policies)?h(a):[],E.includes(e.PrivacyCenters)?be(a):[],E.includes(e.Messages)?ye(a):[],E.includes(e.Partitions)?w(a):[],E.includes(e.Assessments)?z(a):[],E.includes(e.AssessmentTemplates)?ve(a):[],E.includes(e.Purposes)?le(a):[],E.includes(e.SystemDiscovery)?xe(a):[]]),Z=E.includes(e.ConsentManager)&&J?await se(a,J.id):void 0,Q={},We=me(P.map(([{apiKeys:e}])=>e.map(({title:e})=>e))),$=Object.values(N).filter(({title:t})=>E.includes(e.ApiKeys)?!0:We.includes(t));if($.length>0&&E.includes(e.ApiKeys)&&(Q[`api-keys`]=$.map(({title:e})=>({title:e}))),ze.length>0&&E.includes(e.Partitions)&&(Q.partitions=ze.map(({name:e,partition:t})=>({name:e,partition:t}))),J&&E.includes(e.ConsentManager)&&(Q[`consent-manager`]={bundleUrls:{TEST:J.testBundleURL,PRODUCTION:J.bundleURL},domains:J.configuration.domains||void 0,partition:J.configuration.partition||void 0,consentPrecedence:J.configuration.consentPrecedence||void 0,unknownRequestPolicy:J.configuration.unknownRequestPolicy||void 0,unknownCookiePolicy:J.configuration.unknownCookiePolicy||void 0,syncEndpoint:J.configuration.syncEndpoint||void 0,telemetryPartitioning:J.configuration.telemetryPartitioning||void 0,signedIabAgreement:J.configuration.signedIabAgreement||void 0,syncGroups:J.configuration.syncGroups||void 0,theme:Z?{primaryColor:Z.primaryColor||void 0,fontColor:Z.fontColor||void 0,privacyPolicy:Z.privacyPolicy||void 0,prompt:Z.prompt}:void 0,experiences:we.map(e=>({name:e.name,displayName:e.displayName||void 0,regions:e.regions.map(e=>({countrySubDivision:e.countrySubDivision||void 0,country:e.country||void 0})),onConsentExpiry:e.onConsentExpiry,consentExpiry:e.consentExpiry,operator:e.operator,displayPriority:e.displayPriority,viewState:e.viewState,purposes:e.purposes.map(e=>({trackingType:e.trackingType})),optedOutPurposes:e.optedOutPurposes.map(e=>({trackingType:e.trackingType})),browserLanguages:e.browserLanguages,browserTimeZones:e.browserTimeZones}))}),Be.length>0&&E.includes(e.Assessments)&&(Q.assessments=Be.map(({title:e,assessmentGroup:t,sections:n,creator:r,description:i,status:a,assignees:o,externalAssignees:s,reviewers:c,isLocked:l,isArchived:u,isExternallyCreated:d,dueDate:f,createdAt:p,assignedAt:m,submittedAt:h,approvedAt:g,rejectedAt:_,titleIsInternal:v,retentionSchedule:y,attributeValues:b,resources:x,syncedRows:S})=>({title:e,group:t.title,sections:n.map(({title:e,status:t,questions:n,assignees:r,isReviewed:i,externalAssignees:a})=>({title:e,status:t,questions:n.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,selectedAnswers:f,allowedMimeTypes:p,allowSelectOther:m,syncModel:h,syncColumn:g,attributeKey:_,requireRiskEvaluation:v,requireRiskMatrixEvaluation:y})=>{let b=s?q(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":b&&Object.keys(b).length>0?{action:b.action,rule:b.rule?{"depends-on-question-reference-id":b.rule.dependsOnQuestionReferenceId,"comparison-operator":b.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in b.rule?b.rule.comparisonOperands:void 0}:void 0,"nested-rule":b.nestedRule?{"logic-operator":b.nestedRule.logicOperator,rules:(b.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=Y(e);return{"risk-level":t.riskAssignment?.riskLevelId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"selected-answers":f.map(({value:e})=>e),"allowed-mime-types":p,"allow-select-other":m,"sync-model":h||void 0,"sync-column":g||void 0,"attribute-key":_?.name,"require-risk-evaluation":v,"require-risk-matrix-evaluation":y}}),assignees:r.map(({email:e})=>e),"external-assignees":a.map(({email:e})=>e),"is-reviewed":i})),creator:r?.email,description:i,status:a,assignees:o.map(({email:e})=>e),"external-assignees":s.map(({email:e})=>e),reviewers:c.map(({email:e})=>e),locked:l,archived:u,external:d,"title-is-internal":v,"due-date":f||void 0,"created-at":p||void 0,"assigned-at":m||void 0,"submitted-at":h||void 0,"approved-at":g||void 0,"rejected-at":_||void 0,"retention-schedule":y?{type:y.type,"duration-days":y.durationDays,operand:y.operation}:void 0,attributes:b!==void 0&&b.length>0?V(b):void 0,resources:x.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``})),rows:S.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``}))}))),Ve.length>0&&E.includes(e.AssessmentTemplates)&&(Q[`assessment-templates`]=Ve.map(({title:e,description:t,sections:n,status:r,source:i,creator:a,isLocked:o,isArchived:s,createdAt:c,retentionSchedule:l})=>({title:e,description:t,sections:n.map(({title:e,questions:t})=>({title:e,questions:t.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,allowedMimeTypes:f,allowSelectOther:p,syncModel:m,syncColumn:h,attributeKey:g,requireRiskEvaluation:_,requireRiskMatrixEvaluation:v})=>{let y=s?q(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":y&&Object.keys(y).length>0?{action:y.action,rule:y.rule?{"depends-on-question-reference-id":y.rule.dependsOnQuestionReferenceId,"comparison-operator":y.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in y.rule?y.rule.comparisonOperands:void 0}:void 0,"nested-rule":y.nestedRule?{"logic-operator":y.nestedRule.logicOperator,rules:(y.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=Y(e);return{"risk-level":t.riskAssignment?.riskLevelId,"risk-matrix-row":t.riskAssignment?.riskMatrixRowId,"risk-matrix-column":t.riskAssignment?.riskMatrixColumnId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"allowed-mime-types":f,"allow-select-other":p,"sync-model":m||void 0,"sync-column":h||void 0,"attribute-key":g?.name,"require-risk-evaluation":_,"require-risk-matrix-evaluation":v}})})),status:r,source:i,creator:a?.email,locked:o,archived:s,"created-at":c||void 0,"retention-schedule":l?{type:l.type,"duration-days":l.durationDays,operand:l.operation}:void 0}))),Ue.length>0&&E.includes(e.SystemDiscovery)&&(Q[`system-discovery`]=Ue.map(({title:e,resourceId:t,suggestedCatalog:{title:n},plugin:{dataSilo:{title:r}},country:i,countrySubDivision:a,plaintextContext:o,containsSensitiveData:s,status:c})=>({title:e,resourceId:t,suggestedCatalog:n,plugin:r,country:i||void 0,countrySubDivision:a||void 0,plaintextContext:o,containsSensitiveData:s,status:c}))),Te.length>0&&E.includes(e.Prompts)&&(Q.prompts=Te.map(({title:e,content:t})=>({title:e,content:t}))),Ee.length>0&&E.includes(e.PromptPartials)&&(Q[`prompt-partials`]=Ee.map(({title:e,content:t})=>({title:e,content:t}))),De.length>0&&E.includes(e.PromptGroups)&&(Q[`prompt-groups`]=De.map(({title:e,description:t,prompts:n})=>({title:e,description:t,prompts:n.map(({title:e})=>e)}))),Ie.length>0&&E.includes(e.Teams)&&(Q.teams=Ie.map(({name:e,description:t,ssoDepartment:n,ssoGroup:r,ssoTitle:i,users:a,scopes:o})=>({name:e,description:t,"sso-department":n||void 0,"sso-group":r||void 0,"sso-title":i||void 0,users:a.map(({email:e})=>e),scopes:o.map(({name:e})=>e)}))),M.length>0&&E.includes(e.DataSubjects)&&(Q[`data-subjects`]=M.map(({type:e,title:t,active:n,adminDashboardDefaultSilentMode:r,actions:i})=>({type:e,title:t?.defaultMessage,active:n,adminDashboardDefaultSilentMode:r,actions:i.map(({type:e})=>e)}))),Le.length>0&&(Q.policies=Le.map(({title:e,versions:t,disabledLocales:n})=>({title:e?.defaultMessage,content:t?.[0]?.content?.defaultMessage,disabledLocales:n}))),Re.length>0&&(Q.messages=Re.map(({id:e,defaultMessage:t,targetReactIntlId:n,description:r,translations:i})=>({id:e,defaultMessage:t,description:r,targetReactIntlId:n||void 0,translations:i.reduce((e,{locale:t,value:n})=>Object.assign(e,{[t]:n}),{})}))),X.length>0){let e=X[0];Q[`privacy-center`]={isDisabled:e.isDisabled,showPrivacyRequestButton:e.showPrivacyRequestButton,showPolicies:e.showPolicies,showTrackingTechnologies:e.showTrackingTechnologies,showCookies:e.showCookies,showDataFlows:e.showDataFlows,showConsentManager:e.showConsentManager,showManageYourPrivacy:e.showManageYourPrivacy,showMarketingPreferences:e.showMarketingPreferences,locales:e.locales,defaultLocale:e.defaultLocale,preferBrowserDefaultLocale:e.preferBrowserDefaultLocale,supportEmail:e.supportEmail||void 0,replyToEmail:e.replyToEmail||void 0,useNoReplyEmailAddress:e.useNoReplyEmailAddress,useCustomEmailDomain:e.useCustomEmailDomain,transformAccessReportJsonToCsv:e.transformAccessReportJsonToCsv,theme:e.theme}}if(G.length>0&&E.includes(e.BusinessEntities)&&(Q[`business-entities`]=G.map(({title:e,description:t,address:n,headquarterCountry:r,headquarterSubDivision:i,dataProtectionOfficerName:a,dataProtectionOfficerEmail:o,attributeValues:s})=>({title:e,description:t||void 0,address:n||void 0,headquarterCountry:r||void 0,headquarterSubDivision:i||void 0,dataProtectionOfficerName:a||void 0,dataProtectionOfficerEmail:o||void 0,attributes:s!==void 0&&s.length>0?V(s):void 0}))),K.length>0&&E.includes(e.ProcessingActivities)&&(Q[`processing-activities`]=K.map(({title:e,description:t,securityMeasureDetails:n,controllerships:r,storageRegions:i,transferRegions:a,retentionType:o,retentionPeriod:s,dataProtectionImpactAssessmentLink:c,dataProtectionImpactAssessmentStatus:l,attributeValues:u,dataSilos:d,dataSubjects:f,teams:p,owners:m,processingPurposeSubCategories:h,dataSubCategories:g,saaSCategories:_})=>({title:e,description:t,securityMeasureDetails:n??void 0,controllerships:r.length>0?r:void 0,storageRegions:i.length>0?Se(i):void 0,transferRegions:a.length>0?Se(a):void 0,retentionType:o,retentionPeriod:o===pe.StatedPeriod?s:void 0,dataProtectionImpactAssessmentLink:c??void 0,dataProtectionImpactAssessmentStatus:l,attributes:u!==void 0&&u.length>0?V(u):void 0,dataSiloTitles:d.length>0?d.map(({title:e})=>e):void 0,dataSubjectTypes:f.length>0?f.map(({type:e})=>e):void 0,teamNames:p.length>0?p.map(({name:e})=>e):void 0,ownerEmails:m.length>0?m.map(({email:e})=>e):void 0,processingSubPurposes:h.length>0?h.map(({name:e,purpose:t})=>({purpose:t,...e?{name:e}:{}})):void 0,dataSubCategories:g.length>0?g.map(({name:e,category:t})=>({category:t,...e?{name:e}:{}})):void 0,saaSCategories:_.length>0?_.map(({title:e})=>e):void 0}))),W.length>0&&E.includes(e.Actions)&&(Q.actions=W.map(({type:e,skipSecondaryIfNoFiles:t,skipDownloadableStep:n,requiresReview:r,regionList:i,regionDetectionMethod:a,waitingPeriod:o})=>({type:e,...e===fe.Erasure?{skipSecondaryIfNoFiles:t,skipDownloadableStep:n}:{},requiresReview:r,waitingPeriod:o,regionDetectionMethod:a,regionList:i.length>0?i:void 0}))),U.length>0&&E.includes(e.Identifiers)&&(Q.identifiers=U.map(({name:e,type:t,regex:n,selectOptions:r,privacyCenterVisibility:i,isRequiredInForm:a,placeholder:o,displayTitle:s,dataSubjects:c,displayDescription:l,displayOrder:u,isUniqueOnPreferenceStore:d})=>({name:e,type:t,regex:n,selectOptions:r.length>0?r:void 0,privacyCenterVisibility:i.length>0?i:void 0,isRequiredInForm:a,placeholder:o||void 0,dataSubjects:c.length>0?c.map(({type:e})=>e):void 0,displayTitle:s?.defaultMessage,displayDescription:l?.defaultMessage,displayOrder:u,isUniqueOnPreferenceStore:d}))),Oe.length>0&&E.includes(e.Agents)&&(Q.agents=Oe.map(({name:e,agentId:t,description:n,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o,largeLanguageModel:s,teams:c,owners:l,agentFunctions:u,agentFiles:d})=>({name:e,agentId:t,description:n||void 0,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o?.title,"large-language-model":{name:s.name,client:s.client},teams:c&&c.length>0?c.map(({name:e})=>e):void 0,owners:l&&l.length>0?l.map(({email:e})=>e):void 0,"agent-functions":u&&u.length>0?u.map(({name:e})=>e):void 0,"agent-files":d&&d.length>0?d.map(({name:e})=>e):void 0}))),Pe.length>0&&E.includes(e.ActionItems)&&(Q[`action-items`]=Pe.map(({teams:e,users:t,customerExperienceActionItemIds:[n],dueDate:r,priority:i,resolved:a,collections:o,notes:s,link:c,title:l,type:u,attributeValues:d})=>({teams:e.map(({name:e})=>e),users:t.map(({email:e})=>e),dueDate:r||void 0,title:l,notes:s,customerExperienceActionItemId:n,collections:o.map(({title:e})=>e),link:c,priority:i||void 0,resolved:a,type:u,attributes:d!==void 0&&d.length>0?V(d):void 0}))),Fe.length>0&&E.includes(e.ActionItemCollections)&&(Q[`action-item-collections`]=Fe.map(({title:e,description:t,hidden:n,productLine:r})=>({title:e,description:t||void 0,hidden:n,productLine:r}))),ke.length>0&&E.includes(e.AgentFunctions)&&(Q[`agent-functions`]=ke.map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:JSON.stringify(n)}))),Ae.length>0&&E.includes(e.AgentFiles)&&(Q[`agent-files`]=Ae.map(({name:e,description:t,fileId:n,size:r,purpose:i})=>({name:e,description:t,fileId:n,size:r,purpose:i}))),je.length>0&&E.includes(e.Vendors)&&(Q.vendors=je.map(({title:e,description:t,dataProcessingAgreementLink:n,contactName:r,contactPhone:i,address:a,headquarterCountry:o,headquarterSubDivision:s,websiteUrl:c,businessEntity:l,teams:u,owners:d,attributeValues:f})=>({title:e,description:t||void 0,dataProcessingAgreementLink:n||void 0,contactName:r||void 0,contactPhone:i||void 0,address:a||void 0,headquarterCountry:o||void 0,headquarterSubDivision:s||void 0,websiteUrl:c||void 0,businessEntity:l?.title,teams:u&&u.length>0?u.map(({name:e})=>e):void 0,owners:d&&d.length>0?d.map(({email:e})=>e):void 0,attributes:f!==void 0&&f.length>0?V(f):void 0}))),Me.length>0&&E.includes(e.DataCategories)&&(Q[`data-categories`]=Me.map(({name:e,category:t,description:n,regex:r,owners:i,teams:a,attributeValues:o})=>({name:e,category:t,description:n||void 0,regex:r||void 0,owners:i&&i.length>0?i.map(({email:e})=>e):void 0,teams:a&&a.length>0?a.map(({name:e})=>e):void 0,attributes:o!==void 0&&o.length>0?V(o):void 0}))),Ne.length>0&&E.includes(e.ProcessingPurposes)&&(Q[`processing-purposes`]=Ne.map(({name:e,purpose:t,description:n,owners:r,teams:i,attributeValues:a})=>({name:e,purpose:t,description:n||void 0,owners:r&&r.length>0?r.map(({email:e})=>e):void 0,teams:i&&i.length>0?i.map(({name:e})=>e):void 0,attributes:a!==void 0&&a.length>0?V(a):void 0}))),I.length>0&&E.includes(e.DataFlows)&&(Q[`data-flows`]=I.map(({value:e,type:t,description:n,trackingType:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({value:e,type:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?V(c):void 0}))),L.length>0&&E.includes(e.Cookies)&&(Q.cookies=L.map(({name:e,isRegex:t,description:n,trackingPurposes:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({name:e,isRegex:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?V(c):void 0}))),R.length>0&&E.includes(e.Attributes)&&(Q.attributes=R.map(({description:e,name:t,type:n,values:r,enabledOn:i=[]})=>({description:e||void 0,resources:i,name:t,type:n,values:r.map(({name:e,color:t,description:n})=>({name:e,color:t||void 0,description:n}))}))),He.length>0&&(Q.purposes=He.map(({name:e,description:t,trackingType:n,defaultConsent:r,configurable:i,showInConsentManager:a,isActive:o,displayOrder:s,optOutSignals:c,authLevel:l,topics:u,showInPrivacyCenter:d,title:f})=>({name:e,title:f,description:t||void 0,trackingType:n,"default-consent":r,configurable:i,"show-in-consent-manager":a,"show-in-privacy-center":d,"is-active":o,"display-order":s,"opt-out-signals":c.length>0?c:void 0,"auth-level":l||void 0,"preference-topics":u.map(({title:e,type:t,displayDescription:n,defaultConfiguration:r,showInPrivacyCenter:i,preferenceOptionValues:a})=>({title:e.defaultMessage,type:t,description:n.defaultMessage,"default-configuration":r,"show-in-privacy-center":i,...a.length>0?{options:a.map(({title:e,slug:t})=>({title:e.defaultMessage,slug:t}))}:{}}))}))),s.length===0&&H.length>0&&E.includes(e.Templates)&&(Q.templates=H.map(({title:e})=>({title:e}))),F.length>0&&E.includes(e.Enrichers)&&(Q.enrichers=F.map(({title:e,url:t,type:n,inputIdentifier:r,identifiers:i,actions:a,testRegex:o,dataSubjects:s,expirationDuration:c,lookerQueryTitle:l,transitionRequestStatus:u,phoneNumbers:d,regionList:f})=>({title:e,url:t||void 0,type:n,"input-identifier":r?.name,"output-identifiers":i.map(({name:e})=>e),"privacy-actions":Object.values(fe).length===a.length?void 0:a,testRegex:o||void 0,lookerQueryTitle:l||void 0,expirationDuration:parseInt(c,10),transitionRequestStatus:u||void 0,phoneNumbers:d&&d.length>0?d:void 0,regionList:f&&f.length>0?f:void 0,"data-subjects":s.map(({type:e})=>e)}))),P.length>0&&E.includes(e.DataSilos)){let e=he(M,`type`);Q[`data-silos`]=P.map(([{title:t,description:n,url:r,type:i,outerType:a,apiKeys:o,notifyEmailAddress:s,identifiers:c,dependentDataSilos:l,owners:u,country:d,countrySubDivision:f,teams:p,subjectBlocklist:m,isLive:h,promptAVendorEmailSendFrequency:_,promptAVendorEmailSendType:v,promptAVendorEmailIncludeIdentifiersAttachment:y,promptAVendorEmailCompletionLinkType:b,manualWorkRetryFrequency:x,catalog:S,attributeValues:C,discoveredBy:w,businessEntities:T},ee])=>({title:t,description:n,integrationName:i,"outer-type":a||void 0,url:r||void 0,"api-key-title":o[0]?.title,"identity-keys":c.filter(({isConnected:e})=>e).map(({name:e})=>e),...l.length>0?{"deletion-dependencies":l.map(({title:e})=>e)}:{},...u.length>0?{owners:u.map(({email:e})=>e)}:{},...p.length>0?{teams:p.map(({name:e})=>e)}:{},...w.length>0?{discoveredBy:w.map(({title:e})=>e)}:{},...T.length>0?{businessEntities:T.map(({title:e})=>e)}:{},country:d||void 0,countrySubDivision:f||void 0,disabled:!h,"data-subjects":m.length>0?g(m.map(({type:e})=>e),e):void 0,...S.hasAvcFunctionality?{"email-settings":{"notify-email-address":s||void 0,"send-frequency":_,"send-type":v,"include-identifiers-attachment":y,"completion-link-type":b,"manual-work-retry-frequency":x}}:{},attributes:C!==void 0&&C.length>0?V(C):void 0,datapoints:ee.map(e=>({key:e.name,title:e.title?.defaultMessage,description:e.description?.defaultMessage,owners:e.owners.map(({email:e})=>e),teams:e.teams.map(({name:e})=>e),...e.path.length>0?{path:e.path}:{},...e.dataCollection?.title?{"data-collection-tag":e.dataCollection.title.defaultMessage}:{},...e.dbIntegrationQueries.length>0?{"privacy-action-queries":ge(he(e.dbIntegrationQueries,`requestType`),e=>e.suggestedQuery||e.query||void 0)}:{},...e.subDataPoints.length>0?{fields:e.subDataPoints.map(e=>({key:e.name,description:e.description,purposes:e.purposes,categories:e.categories,...k&&e.pendingCategoryGuesses?{"guessed-categories":e.pendingCategoryGuesses.filter(e=>e.status===`PENDING`).map(e=>({category:{name:e.category.name,category:e.category.category},status:e.status,confidence:e.confidence,classifierVersion:e.classifierVersion||void 0}))}:{},"access-request-visibility-enabled":e.accessRequestVisibilityEnabled,"erasure-request-redaction-enabled":e.erasureRequestRedactionEnabled,attributes:e.attributeValues!==void 0&&e.attributeValues.length>0?V(e.attributeValues):void 0})).sort((e,t)=>e.key.localeCompare(t.key))}:{},"privacy-actions":e.actionSettings.filter(({active:e})=>e).map(({type:e})=>e)})).sort((e,t)=>[...e.path??[],e.key].join(`.`).localeCompare([...t.path??[],t.key].join(`.`)))}))}return Q}export{z as _,Y as a,W as c,q as d,be as f,ve as g,B as h,J as i,H as l,ye as m,we as n,K as o,V as p,xe as r,G as s,Ce as t,U as u,R as v,L as y};
80
+ //# sourceMappingURL=pullTranscendConfiguration-D2cYlu6V.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pullTranscendConfiguration-D2cYlu6V.mjs","names":["PAGE_SIZE","PAGE_SIZE","PAGE_SIZE"],"sources":["../src/lib/graphql/gqls/assessmentTemplate.ts","../src/lib/graphql/gqls/siloDiscoveryResult.ts","../src/lib/graphql/fetchAllAssessments.ts","../src/lib/graphql/fetchAllAssessmentTemplates.ts","../src/lib/graphql/fetchAllCookies.ts","../src/lib/graphql/fetchAllMessages.ts","../src/lib/graphql/formatAttributeValues.ts","../src/lib/graphql/fetchAllPrivacyCenters.ts","../src/lib/graphql/parseAssessmentDisplayLogic.ts","../src/lib/graphql/parseAssessmentRiskLogic.ts","../src/lib/graphql/fetchAllSiloDiscoveryResults.ts","../src/lib/graphql/formatRegions.ts","../src/lib/graphql/pullTranscendConfiguration.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\nimport { ASSESSMENT_SECTION_FIELDS } from './assessment.js';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\n// orderBy: [\n// { field: createdAt, direction: ASC }\n// { field: name, direction: ASC }\n// ]\nexport const ASSESSMENT_TEMPLATES = gql`\n query TranscendCliAssessmentTemplates(\n $first: Int!\n $offset: Int!\n $filterBy: AssessmentFormTemplateFiltersInput\n ) {\n assessmentFormTemplates(\n first: $first\n offset: $offset\n filterBy: $filterBy\n ) {\n nodes {\n id\n creator {\n id\n email\n name\n }\n lastEditor {\n id\n email\n name\n }\n title\n description\n status\n source\n parentId\n isLocked\n isArchived\n createdAt\n updatedAt\n retentionSchedule {\n id\n type\n durationDays\n operation\n createdAt\n updatedAt\n }\n assessmentEmailSet {\n id\n title\n description\n isDefault\n templates {\n id\n title\n }\n }\n sections {\n ${ASSESSMENT_SECTION_FIELDS}\n }\n }\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\nexport const SILO_DISCOVERY_RESULTS = gql`\n query TranscendCliSiloDiscoveryResults($first: Int!, $offset: Int!) {\n siloDiscoveryResults(first: $first, offset: $offset) {\n nodes {\n title\n resourceId\n country\n countrySubDivision\n plaintextContext\n status\n containsSensitiveData\n suggestedCatalog {\n title\n }\n plugin {\n dataSilo {\n title\n }\n }\n }\n }\n }\n`;\n","import {\n AssessmentFormStatus,\n AssessmentQuestionSubType,\n AssessmentQuestionType,\n AssessmentSyncColumn,\n AssessmentSyncModel,\n AttributeSupportedResourceType,\n DataCategoryType,\n ProcessingPurpose,\n RetentionScheduleOperation,\n RetentionScheduleType,\n} from '@transcend-io/privacy-types';\n/* eslint-disable max-lines */\nimport { GraphQLClient } from 'graphql-request';\n\nimport { ASSESSMENTS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\n/**\n * Represents an assessment with various properties and metadata.\n */\nexport interface Assessment {\n /** The ID of the assessment */\n id: string;\n /** The user who created the assessment */\n creator: UserPreview;\n /** The user who last edited the assessment */\n lastEditor: UserPreview;\n /** The title of the assessment */\n title: string;\n /** The description of the assessment */\n description: string;\n /** The current status of the assessment */\n status: AssessmentFormStatus;\n /** The users assigned to the assessment */\n assignees: UserPreview[];\n /** The external users assigned to the assessment */\n externalAssignees: ExternalUser[];\n /** The users who are reviewers of the assessment */\n reviewers: UserPreview[];\n /** Indicates if the assessment is locked */\n isLocked: boolean;\n /** Indicates if the assessment is archived */\n isArchived: boolean;\n /** Indicates if the assessment was created externally */\n isExternallyCreated: boolean;\n /** The due date of the assessment */\n dueDate: string;\n /** The date when the assessment was created */\n createdAt: string;\n /** The date when the assessment was last updated */\n updatedAt: string;\n /** The date when the assessment was assigned */\n assignedAt: string;\n /** The date when the assessment was submitted */\n submittedAt: string;\n /** The date when the assessment was approved */\n approvedAt: string;\n /** The date when the assessment was rejected */\n rejectedAt: string;\n /** Indicates if the title of the assessment is internal */\n titleIsInternal: boolean;\n /** The retention schedule of the assessment */\n retentionSchedule?: RetentionSchedule;\n /** The attribute values associated with the assessment */\n attributeValues: AttributeValue[];\n /** The sections of the assessment */\n sections: AssessmentSection[];\n /** The group to which the assessment belongs */\n assessmentGroup: AssessmentGroup;\n /** The resources associated with the assessment */\n resources: AssessmentResource[];\n /** The rows that are synced with the assessment */\n syncedRows: AssessmentResource[];\n}\n\nexport interface UserPreview {\n /** ID of user */\n id: string;\n /** Email of user */\n email: string;\n /** Name of user */\n name: string;\n}\n\nexport interface ExternalUser {\n /** ID of external user */\n id: string;\n /** Email of external user */\n email: string;\n}\n\nexport interface RetentionSchedule {\n /** ID of retention schedule */\n id: string;\n /** Type */\n type: RetentionScheduleType;\n /** Duration of retention schedule */\n durationDays: number;\n /** The operation to perform on the retention schedule */\n operation: RetentionScheduleOperation;\n}\n\ninterface AttributeValue {\n /** Name of attribute value */\n name: string;\n /** Key */\n attributeKey: {\n /** Name of key */\n name: string;\n };\n}\n\nexport interface AssessmentSection {\n /** ID of section */\n id: string;\n /** Title of section */\n title: string;\n /** Status of section */\n status: string;\n /** Index of section */\n index: number;\n /** Questions */\n questions: AssessmentQuestion[];\n /** Assignees */\n assignees: UserPreview[];\n /** External assignees */\n externalAssignees: ExternalUser[];\n /** Whether is reviewed */\n isReviewed: boolean;\n}\n\n/**\n * Represents a question in the assessment.\n */\nexport interface AssessmentQuestion {\n /**\n * Unique identifier for the question.\n */\n id: string;\n /** Title of the question */\n title: string;\n /** Index of the question in the assessment */\n index: number;\n /** Type of the question */\n type: AssessmentQuestionType;\n /** Subtype of the question */\n subType: AssessmentQuestionSubType;\n /** Placeholder text for the question */\n placeholder: string;\n /** Description of the question */\n description: string;\n /** Indicates if the question is required */\n isRequired: boolean;\n /** Logic for displaying the question */\n displayLogic: string;\n /** Logic for assessing risk related to the question */\n riskLogic: string[];\n /** Indicates if risk evaluation is required for the question */\n requireRiskEvaluation: boolean;\n /** Indicates if risk matrix evaluation is required for the question */\n requireRiskMatrixEvaluation: boolean;\n /** Categories of risk associated with the question */\n riskCategories: RiskCategory[];\n /** Framework used for risk assessment */\n riskFramework?: RiskFramework;\n /** Level of risk associated with the question */\n riskLevel?: RiskLevel;\n /** Risk level assigned by the reviewer */\n reviewerRiskLevel?: RiskLevel;\n /** Risk level derived from the risk matrix */\n riskLevelFromRiskMatrix?: RiskLevel;\n /** Options available for answering the question */\n answerOptions: AssessmentAnswerOption[];\n /** Answers selected for the question */\n selectedAnswers: AssessmentAnswer[];\n /** User who responded to the question */\n respondent: UserPreview;\n /** Key attribute associated with the question */\n attributeKey?: {\n /** Name of key */\n name: string;\n };\n /** Email of the external respondent */\n externalRespondentEmail?: string;\n /** Comments related to the question */\n comments: unknown[];\n /** Allowed MIME types for file uploads in the question */\n allowedMimeTypes: string[];\n /** Timestamp of the last update to the question */\n updatedAt: string;\n /** Reference identifier for the question */\n referenceId: string;\n /** Previous submissions related to the question */\n previousSubmissions: AssessmentPreviousSubmission[];\n /** Indicates if selecting \"Other\" is allowed for the question */\n allowSelectOther: boolean;\n /** Model used for synchronization */\n syncModel: AssessmentSyncModel;\n /** Column used for synchronization */\n syncColumn: AssessmentSyncColumn;\n /** Row IDs used for synchronization */\n syncRowIds: string[];\n /** Indicates if synchronization override is allowed */\n syncOverride: boolean;\n}\n\nexport interface RiskCategory {\n /** ID of category */\n id: string;\n /** Title of category */\n title: string;\n}\n\nexport interface RiskFramework {\n /** ID of framework */\n id: string;\n /** Title of framework */\n title: string;\n /** Description of framework */\n description: string;\n /** Risk levels */\n riskLevels: RiskLevel[];\n /** Risk categories */\n riskCategories: RiskCategory[];\n /** Risk matrix columns */\n riskMatrixColumns: RiskMatrixColumn[];\n /** Risk matrix rows */\n riskMatrixRows: RiskMatrixRow[];\n /** Risk matrix settings */\n riskMatrix: RiskMatrix[][];\n /** Creator of risk framework */\n creator?: UserPreview;\n /** Risk matrix row title */\n riskMatrixRowTitle: string;\n /** Risk matrix column title */\n riskMatrixColumnTitle: string;\n}\n\nexport interface RiskLevel {\n /** ID of risk level */\n id: string;\n /** Title of risk level */\n title: string;\n}\n\nexport interface RiskMatrix {\n /** ID of risk matrix */\n id: string;\n /** Title of risk matrix */\n title: string;\n}\n\nexport interface RiskMatrixColumn {\n /** ID of column */\n id: string;\n /** Title of column */\n title: string;\n}\n\nexport interface RiskMatrixRow {\n /** ID of row */\n id: string;\n /** Title of row */\n title: string;\n}\n\nexport interface AssessmentAnswerOption {\n /** ID of answer option */\n id: string;\n /** Index of answer option */\n index: number;\n /** Value of answer */\n value: string;\n}\n\nexport interface AssessmentAnswer {\n /** ID of answer */\n id: string;\n /** Index of answer */\n index: number;\n /** Value of answer */\n value: string;\n}\n\nexport interface AssessmentComment {\n /** ID of comment */\n id: string;\n /** Content of comment */\n content: string;\n /** Date comment made */\n createdAt: string;\n /** Date comment updated */\n updatedAt: string;\n /** Author of comment */\n author?: UserPreview;\n}\n\nexport interface AssessmentPreviousSubmission {\n /** Id of submission */\n id: string;\n /** Date updated */\n updatedAt: string;\n /** ID of question */\n assessmentQuestionId: string;\n /** Answers */\n answers: AssessmentAnswer[];\n}\n\nexport interface AssessmentGroup {\n /** ID of group */\n id: string;\n /** Title of group */\n title: string;\n /** Description of group */\n description: string;\n}\n\nexport interface AssessmentResource {\n /** Type of resource */\n resourceType: AttributeSupportedResourceType;\n /** ID of resource */\n id: string;\n /** Title of resource */\n title?: string;\n /** Name of resource */\n name?: string;\n /** Category of resource */\n category?: DataCategoryType;\n /** Purpose of resource */\n purpose?: ProcessingPurpose;\n /** Type of integration */\n type?: string;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all assessments in the organization\n *\n * @param client - GraphQL client\n * @returns All assessments in the organization\n */\nexport async function fetchAllAssessments(client: GraphQLClient): Promise<Assessment[]> {\n const assessments: Assessment[] = [];\n let offset = 0;\n\n let shouldContinue = false;\n do {\n const {\n assessmentForms: { nodes },\n } = await makeGraphQLRequest<{\n /** Forms */\n assessmentForms: {\n /** Nodes */\n nodes: Assessment[];\n };\n }>(client, ASSESSMENTS, {\n first: PAGE_SIZE,\n offset,\n });\n assessments.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return assessments.sort((a, b) => a.title.localeCompare(b.title));\n}\n/* eslint-enable max-lines */\n","import {\n AssessmentFormTemplateSource,\n AssessmentFormTemplateStatus,\n} from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport type { AssessmentSection, RetentionSchedule, UserPreview } from './fetchAllAssessments.js';\nimport { ASSESSMENT_TEMPLATES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\n/**\n * Represents an assessment template with various properties and metadata.\n */\nexport interface AssessmentTemplate {\n /** The ID of the assessment template */\n id: string;\n /** The user who created the assessment template */\n creator: UserPreview;\n /** The user who last edited the assessment template */\n lastEditor: UserPreview;\n /** The title of the assessment template */\n title: string;\n /** The description of the assessment template */\n description: string;\n /** The current status of the assessment template */\n status: AssessmentFormTemplateStatus;\n /** The source fo the form template */\n source: AssessmentFormTemplateSource;\n /** ID of parent template */\n parentId: string;\n /** Indicates if the assessment template is locked */\n isLocked: boolean;\n /** Indicates if the assessment template is archived */\n isArchived: boolean;\n /** The date when the assessment template was created */\n createdAt: string;\n /** The date when the assessment template was last updated */\n updatedAt: string;\n /** The retention schedule of the assessment template */\n retentionSchedule?: RetentionSchedule;\n /** The sections of the assessment template */\n sections: AssessmentSection[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all assessment templates in the organization\n *\n * @param client - GraphQL client\n * @returns All assessment templates in the organization\n */\nexport async function fetchAllAssessmentTemplates(\n client: GraphQLClient,\n): Promise<AssessmentTemplate[]> {\n const assessmentTemplates: AssessmentTemplate[] = [];\n let offset = 0;\n\n let shouldContinue = false;\n do {\n const {\n assessmentFormTemplates: { nodes },\n } = await makeGraphQLRequest<{\n /** Templates */\n assessmentFormTemplates: {\n /** Nodes */\n nodes: AssessmentTemplate[];\n };\n }>(client, ASSESSMENT_TEMPLATES, {\n first: PAGE_SIZE,\n offset,\n });\n assessmentTemplates.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return assessmentTemplates.sort((a, b) => a.title.localeCompare(b.title));\n}\n","import { ConsentTrackerSource, ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { fetchConsentManagerId } from './fetchConsentManagerId.js';\nimport { COOKIES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Cookie {\n /** ID of the cookie */\n id: string;\n /** Name of the cookie */\n name: string;\n /** Whether cookie is a regular express */\n isRegex: boolean;\n /** Description of cookie */\n description: string;\n /** Enabled tracking purposes for the cookie */\n trackingPurposes: string[];\n /** The consent service */\n service: {\n /** Integration name of service */\n integrationName: string;\n };\n /** Source of how tracker was added */\n source: ConsentTrackerSource;\n /** Status of cookie labeling */\n status: ConsentTrackerStatus;\n /** Owners of that cookie */\n owners: {\n /** Email address of owner */\n email: string;\n }[];\n /** Teams assigned to that cookie */\n teams: {\n /** Name of team */\n name: string;\n }[];\n /** Attributes assigned to that cookie */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key that the value represents */\n attributeKey: {\n /** Name of attribute team */\n name: string;\n };\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all Cookies in the organization\n *\n * @param client - GraphQL client\n * @param status - The status to fetch\n * @returns All Cookies in the organization\n */\nexport async function fetchAllCookies(\n client: GraphQLClient,\n status = ConsentTrackerStatus.Live,\n): Promise<Cookie[]> {\n const cookies: Cookie[] = [];\n let offset = 0;\n\n const airgapBundleId = await fetchConsentManagerId(client);\n\n // Try to fetch an Cookies with the same title\n let shouldContinue = false;\n do {\n const {\n cookies: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n cookies: {\n /** List of matches */\n nodes: Cookie[];\n };\n }>(client, COOKIES, {\n first: PAGE_SIZE,\n offset,\n airgapBundleId,\n status,\n });\n cookies.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return cookies.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import type { LocaleValue } from '@transcend-io/internationalization';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { MESSAGES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Message {\n /** ID of message */\n id: string;\n /** Default message */\n defaultMessage: string;\n /** Description */\n description: string;\n /** React Intl ID */\n targetReactIntlId: string | null;\n /** Disabled locales */\n translations: {\n /** Locale */\n locale: LocaleValue;\n /** Value */\n value: string;\n }[];\n}\n\n/**\n * Fetch all messages in the organization\n *\n * @param client - GraphQL client\n * @returns All messages in the organization\n */\nexport async function fetchAllMessages(client: GraphQLClient): Promise<Message[]> {\n const { translatedMessages } = await makeGraphQLRequest<{\n /** Messages */\n translatedMessages: Message[];\n }>(client, MESSAGES, {});\n return translatedMessages;\n}\n","import type { DataSiloAttributeValue } from './syncDataSilos.js';\n\nexport interface FormattedAttribute {\n /** Attribute key */\n key: string;\n /** Attribute values */\n values: string[];\n}\n\n/**\n * Format attribute value objects to key-pair values\n *\n * @param vals - Attribute values\n * @returns formatted attributes\n */\nexport function formatAttributeValues(vals: DataSiloAttributeValue[]): FormattedAttribute[] {\n const attributes: FormattedAttribute[] = [];\n\n vals.map((val) => {\n let foundKey = attributes.find((att) => att.key === val.attributeKey.name);\n\n if (foundKey === undefined) {\n foundKey = {\n key: val.attributeKey.name,\n values: [val.name],\n };\n attributes.push(foundKey);\n } else {\n foundKey.values.push(val.name);\n }\n return attributes;\n });\n\n return attributes;\n}\n","import type { LocaleValue } from '@transcend-io/internationalization';\nimport { PrivacyCenterThemePartial } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { fetchPrivacyCenterUrl } from './fetchPrivacyCenterId.js';\nimport { PRIVACY_CENTER } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface PrivacyCenter {\n /** ID of the privacy center */\n id: string;\n /** The URL of the privacy center */\n url: string;\n /** Whether or not the entire privacy center is enabled or disabled */\n isDisabled: boolean;\n /** Whether or not to show the privacy requests button */\n showPrivacyRequestButton: boolean;\n /** Whether or not to show the policies page */\n showPolicies: boolean;\n /** Whether or not to show the tracking technologies page */\n showTrackingTechnologies: boolean;\n /** Whether or not to show the cookies on the tracking technologies page */\n showCookies: boolean;\n /** Whether or not to show the data flows on the tracking technologies page */\n showDataFlows: boolean;\n /** Whether or not to show the consent manager opt out options on the tracking technologies page */\n showConsentManager: boolean;\n /** Whether or not to show the manage your privacy page */\n showManageYourPrivacy: boolean;\n /** Whether or not to show the marketing preferences page */\n showMarketingPreferences: boolean;\n /** What languages are supported for the privacy center */\n locales: LocaleValue[];\n /** The default locale for the privacy center */\n defaultLocale: LocaleValue;\n /** Whether or not to prefer the browser default locale */\n preferBrowserDefaultLocale: boolean;\n /** The email addresses of the employees within your company that are the go-to individuals for managing this privacy center */\n supportEmail: string;\n /** The email addresses of the employees within your company that are the go-to individuals for managing this privacy center */\n replyToEmail: string;\n /** Whether or not to send emails from a no reply email */\n useNoReplyEmailAddress: boolean;\n /** Whether or not to use a custom email domain */\n useCustomEmailDomain: boolean;\n /** Whether or not to transcend access requests from JSON to CSV */\n transformAccessReportJsonToCsv: boolean;\n /** The theme object of colors to display on the privacy center */\n theme: PrivacyCenterThemePartial;\n}\n\n/**\n * Fetch all privacy centers in the organization\n *\n * @param client - GraphQL client\n * @returns All privacy centers in the organization\n */\nexport async function fetchAllPrivacyCenters(client: GraphQLClient): Promise<PrivacyCenter[]> {\n const deployedPrivacyCenterUrl = await fetchPrivacyCenterUrl(client);\n const {\n privacyCenter: { themeStr, ...rest },\n } = await makeGraphQLRequest<{\n /** Privacy centers */\n privacyCenter: Omit<PrivacyCenter, 'theme'> & {\n /** Theme string */\n themeStr: string;\n };\n }>(client, PRIVACY_CENTER, {\n url: deployedPrivacyCenterUrl,\n });\n\n return [\n {\n ...rest,\n theme: JSON.parse(themeStr),\n },\n ];\n}\n","import {\n AssessmentsDisplayLogicAction,\n ComparisonOperator,\n LogicOperator,\n} from '@transcend-io/privacy-types';\nimport { decodeCodec, valuesOf } from '@transcend-io/type-utils';\nimport * as t from 'io-ts';\n\n// This codec is for rules that logically require a list of values to compare against.\nexport const AssessmentRuleWithOperands = t.type({\n dependsOnQuestionReferenceId: t.string,\n comparisonOperator: t.union([\n t.literal(ComparisonOperator.IsEqualTo),\n t.literal(ComparisonOperator.IsNotEqualTo),\n t.literal(ComparisonOperator.IsOneOf),\n t.literal(ComparisonOperator.IsNotOneOf),\n t.literal(ComparisonOperator.Contains),\n ]),\n comparisonOperands: t.array(t.string),\n});\n\n// This codec is for the specific rule that does NOT require comparison operands.\nexport const AssessmentRuleWithoutOperands = t.type({\n dependsOnQuestionReferenceId: t.string,\n comparisonOperator: t.union([\n t.literal(ComparisonOperator.IsNotShown),\n t.literal(ComparisonOperator.IsShown),\n ]),\n});\n\n/**\n * The final, flexible codec that accepts EITHER a rule with operands OR a rule without them.\n */\nexport const AssessmentRule = t.union([AssessmentRuleWithOperands, AssessmentRuleWithoutOperands]);\n/** Type override */\nexport type AssessmentRule = t.TypeOf<typeof AssessmentRule>;\n\nexport interface AssessmentNestedRule {\n /** The operator to use when comparing the nested rules */\n logicOperator: LogicOperator;\n /** The rules to evaluate and be compared with to other using the LogicOperator */\n rules?: AssessmentRule[];\n /** The nested rules to add one more level of nesting to the rules. They are also compared to each other. */\n nestedRules?: AssessmentNestedRule[];\n}\n\nexport const AssessmentNestedRule: t.RecursiveType<t.Type<AssessmentNestedRule>> = t.recursion(\n 'AssessmentNestedRule',\n (self) =>\n t.intersection([\n t.type({\n /** The operator to use when comparing the nested rules */\n logicOperator: valuesOf(LogicOperator),\n }),\n t.partial({\n /** The rules to evaluate and be compared with to other using the LogicOperator */\n rules: t.array(AssessmentRule),\n /** The nested rules to add one more level of nesting to the rules. They are also compared to each other. */\n nestedRules: t.array(self),\n }),\n ]),\n);\n\nexport const AssessmentAction = t.partial({\n action: valuesOf(AssessmentsDisplayLogicAction),\n rule: AssessmentRule,\n nestedRule: AssessmentNestedRule,\n});\n\n/** Type override */\nexport type AssessmentAction = t.TypeOf<typeof AssessmentAction>;\n\n/**\n * Parse the assessment display logic\n *\n * @param displayLogic - Stringified rule\n * @returns The parsed assessment display logic\n */\nexport function parseAssessmentDisplayLogic(displayLogic: string): AssessmentAction {\n return decodeCodec(AssessmentAction, displayLogic);\n}\n","import { ComparisonOperator } from '@transcend-io/privacy-types';\nimport { decodeCodec, valuesOf } from '@transcend-io/type-utils';\nimport * as t from 'io-ts';\n\nexport const AssessmentRiskLogic = t.intersection([\n t.partial({\n riskAssignment: t.partial({\n riskLevelId: t.string,\n riskMatrixRowId: t.string,\n riskMatrixColumnId: t.string,\n }),\n }),\n t.type({\n comparisonOperands: t.array(t.string),\n comparisonOperator: valuesOf(ComparisonOperator),\n }),\n]);\n\n/** Type override */\nexport type AssessmentRiskLogic = t.TypeOf<typeof AssessmentRiskLogic>;\n\n/**\n * Parse the assessment risk logic\n *\n * @param riskLogic - Stringified rule\n * @returns The parsed assessment risk logic\n */\nexport function parseAssessmentRiskLogic(riskLogic: string): AssessmentRiskLogic {\n return decodeCodec(AssessmentRiskLogic, riskLogic);\n}\n","import type { IsoCountryCode, IsoCountrySubdivisionCode } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { SILO_DISCOVERY_RESULTS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface SiloDiscoveryResult {\n /** Title of silo discovery result */\n title?: string;\n /** Resource ID of silo discovery result */\n resourceId: string;\n /** Suggested catalog */\n suggestedCatalog: {\n /** Title for the suggested catalog */\n title: string;\n };\n /** The likelihood that data is sensitive for this results */\n containsSensitiveData: string;\n /** The status of silo discovery triage */\n status: string;\n /** Hosting country of data silo discovery result */\n country?: IsoCountryCode;\n /** Hosting subdivision data silo discovery result */\n countrySubDivision?: IsoCountrySubdivisionCode;\n /** Plaintext context data silo discovery result */\n plaintextContext: string;\n /** The plugin that found this result */\n plugin: {\n /** The data silo the plugin belongs to */\n dataSilo: {\n /** The internal display title */\n title: string;\n };\n };\n}\n\nconst PAGE_SIZE = 30;\n\n/**\n * Fetch all silo discovery results in the organization\n *\n * @param client - GraphQL client\n * @returns All silo discovery results in the organization\n */\nexport async function fetchAllSiloDiscoveryResults(\n client: GraphQLClient,\n): Promise<SiloDiscoveryResult[]> {\n const siloDiscoveryResults: SiloDiscoveryResult[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n siloDiscoveryResults: { nodes },\n } = await makeGraphQLRequest<{\n /** Discovery results */\n siloDiscoveryResults: {\n /** Nodes */\n nodes: SiloDiscoveryResult[];\n };\n }>(client, SILO_DISCOVERY_RESULTS, {\n first: PAGE_SIZE,\n offset,\n input: {},\n filterBy: {},\n });\n\n const titledNodes = nodes.map((node) =>\n node.title === null && node.suggestedCatalog?.title\n ? { ...node, title: node.suggestedCatalog.title }\n : node,\n );\n\n siloDiscoveryResults.push(...titledNodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return siloDiscoveryResults;\n}\n","import { IsoCountrySubdivisionCode, IsoCountryCode } from '@transcend-io/privacy-types';\n\nimport type { RegionInput } from '../../codecs.js';\n\n// Country subdivision is nullable in DB\nexport interface Region {\n /** Country */\n country: IsoCountryCode;\n /** Sub division (may be null in DB) */\n countrySubDivision?: IsoCountrySubdivisionCode | null;\n}\n\n/**\n * Format regions list to remove null country subdivisions\n *\n * @param vals - Regions\n * @returns formatted regions\n */\nexport function formatRegions(vals: Region[]): RegionInput[] {\n return vals.map(({ country, countrySubDivision }) => ({\n country,\n ...(countrySubDivision ? { countrySubDivision } : {}),\n }));\n}\n","import { LocaleValue } from '@transcend-io/internationalization';\nimport {\n RequestAction,\n ConsentTrackerStatus,\n ActionItemCode,\n RetentionType,\n} from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport { flatten, keyBy, mapValues } from 'lodash-es';\n\n/* eslint-disable max-lines */\nimport {\n TranscendInput,\n ApiKeyInput,\n DataSiloInput,\n AttributeInput,\n ActionInput,\n IdentifierInput,\n BusinessEntityInput,\n EnricherInput,\n PromptGroupInput,\n DataFlowInput,\n PromptPartialInput,\n DataSubjectInput,\n CookieInput,\n PromptInput,\n DatapointInput,\n FieldInput,\n ProcessingPurposeInput,\n ProcessingActivityInput,\n DataCategoryInput,\n VendorInput,\n AgentFileInput,\n AgentFunctionInput,\n AgentInput,\n PolicyInput,\n IntlMessageInput,\n ActionItemInput,\n TeamInput,\n ActionItemCollectionInput,\n AssessmentInput,\n AssessmentTemplateInput,\n AssessmentSectionInput,\n AssessmentSectionQuestionInput,\n RiskLogicInput,\n ConsentPurpose,\n type SiloDiscoveryResultInput,\n} from '../../codecs.js';\nimport { TranscendPullResource } from '../../enums.js';\nimport { logger } from '../../logger.js';\nimport { fetchAllActionItemCollections } from './fetchAllActionItemCollections.js';\nimport { fetchAllActionItems } from './fetchAllActionItems.js';\nimport { fetchAllActions } from './fetchAllActions.js';\nimport { fetchAllAgentFiles } from './fetchAllAgentFiles.js';\nimport { fetchAllAgentFunctions } from './fetchAllAgentFunctions.js';\nimport { fetchAllAgents } from './fetchAllAgents.js';\nimport { fetchAllAssessments } from './fetchAllAssessments.js';\nimport { fetchAllAssessmentTemplates } from './fetchAllAssessmentTemplates.js';\nimport { fetchAllAttributes } from './fetchAllAttributes.js';\nimport { fetchAllBusinessEntities } from './fetchAllBusinessEntities.js';\nimport { fetchAllCookies } from './fetchAllCookies.js';\nimport { fetchAllDataCategories } from './fetchAllDataCategories.js';\nimport { fetchAllDataFlows } from './fetchAllDataFlows.js';\nimport { fetchAllMessages } from './fetchAllMessages.js';\nimport { fetchAllPolicies } from './fetchAllPolicies.js';\nimport { fetchAllPrivacyCenters } from './fetchAllPrivacyCenters.js';\nimport { fetchAllProcessingActivities } from './fetchAllProcessingActivities.js';\nimport { fetchAllProcessingPurposes } from './fetchAllProcessingPurposes.js';\nimport { fetchAllPurposesAndPreferences } from './fetchAllPurposesAndPreferences.js';\nimport { fetchAllSiloDiscoveryResults } from './fetchAllSiloDiscoveryResults.js';\nimport { fetchAllTeams } from './fetchAllTeams.js';\nimport { fetchAllVendors } from './fetchAllVendors.js';\nimport { fetchApiKeys } from './fetchApiKeys.js';\nimport {\n fetchConsentManager,\n fetchConsentManagerExperiences,\n fetchConsentManagerTheme,\n} from './fetchConsentManagerId.js';\nimport { convertToDataSubjectAllowlist, fetchAllDataSubjects } from './fetchDataSubjects.js';\nimport { fetchAllIdentifiers } from './fetchIdentifiers.js';\nimport { fetchAllPromptGroups } from './fetchPromptGroups.js';\nimport { fetchAllPromptPartials } from './fetchPromptPartials.js';\nimport { fetchAllPrompts } from './fetchPrompts.js';\nimport { formatAttributeValues } from './formatAttributeValues.js';\nimport { formatRegions } from './formatRegions.js';\nimport { parseAssessmentDisplayLogic, type AssessmentRule } from './parseAssessmentDisplayLogic.js';\nimport { parseAssessmentRiskLogic } from './parseAssessmentRiskLogic.js';\nimport { fetchEnrichedDataSilos } from './syncDataSilos.js';\nimport { fetchAllEnrichers } from './syncEnrichers.js';\nimport { fetchPartitions } from './syncPartitions.js';\nimport { fetchAllTemplates } from './syncTemplates.js';\n\nexport const DEFAULT_TRANSCEND_PULL_RESOURCES = [\n TranscendPullResource.DataSilos,\n TranscendPullResource.Enrichers,\n TranscendPullResource.Templates,\n TranscendPullResource.ApiKeys,\n];\n\nexport interface TranscendPullConfigurationInput {\n /** Page size */\n pageSize: number;\n /** Enable debug logs */\n debug: boolean;\n /** The data silo IDs to sync. If empty list, pull all. */\n dataSiloIds: string[];\n /** Resources to pull in */\n resources?: TranscendPullResource[];\n /** The data silo types to sync.If empty list, pull all. */\n integrationNames: string[];\n /** The tracker statuses to pull */\n trackerStatuses?: ConsentTrackerStatus[];\n /** Skip fetching of datapoints */\n skipDatapoints?: boolean;\n /** Skip fetching of subdatapoints */\n skipSubDatapoints?: boolean;\n /** When true, metadata around guessed data categories should be included */\n includeGuessedCategories?: boolean;\n}\n\n/**\n * Pull a yaml configuration from Transcend\n *\n * @param client - GraphQL client\n * @param dataSiloIds - The data silos to sync. If empty list, pull all.\n * @returns The configuration\n */\nexport async function pullTranscendConfiguration(\n client: GraphQLClient,\n {\n dataSiloIds,\n integrationNames,\n debug,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n pageSize,\n skipDatapoints,\n includeGuessedCategories,\n skipSubDatapoints,\n trackerStatuses = Object.values(ConsentTrackerStatus),\n }: TranscendPullConfigurationInput,\n): Promise<TranscendInput> {\n if (dataSiloIds.length > 0 && integrationNames.length > 0) {\n throw new Error('Only 1 of integrationNames OR dataSiloIds can be provided');\n }\n\n logger.info(colors.magenta(`Fetching data with page size ${pageSize}...`));\n\n // Fetch all data, but only conditional fetch data that is requested\n const [\n dataSubjects,\n apiKeyTitleMap,\n dataSilos,\n enrichers,\n dataFlows,\n cookies,\n attributes,\n templates,\n identifiers,\n actions,\n businessEntities,\n processingActivities,\n consentManager,\n consentManagerExperiences,\n prompts,\n promptPartials,\n promptGroups,\n agents,\n agentFunctions,\n agentFiles,\n vendors,\n dataCategories,\n processingPurposes,\n actionItems,\n actionItemCollections,\n teams,\n policies,\n privacyCenters,\n messages,\n partitions,\n assessments,\n assessmentTemplates,\n purposes,\n siloDiscoveryResults,\n ] = await Promise.all([\n // Grab all data subjects in the organization\n resources.includes(TranscendPullResource.DataSilos) ||\n resources.includes(TranscendPullResource.DataSubjects)\n ? fetchAllDataSubjects(client)\n : [],\n // Grab API keys\n resources.includes(TranscendPullResource.ApiKeys) ? fetchApiKeys({}, client, true) : [],\n // Fetch the data silos\n resources.includes(TranscendPullResource.DataSilos)\n ? fetchEnrichedDataSilos(client, {\n ids: dataSiloIds,\n integrationNames,\n pageSize,\n debug,\n includeGuessedCategories,\n skipDatapoints,\n skipSubDatapoints,\n })\n : [],\n // Fetch enrichers\n resources.includes(TranscendPullResource.Enrichers) ? fetchAllEnrichers(client) : [],\n // Fetch data flows\n resources.includes(TranscendPullResource.DataFlows)\n ? [\n ...(trackerStatuses.includes(ConsentTrackerStatus.Live)\n ? await fetchAllDataFlows(client, ConsentTrackerStatus.Live)\n : []),\n ...(trackerStatuses.includes(ConsentTrackerStatus.NeedsReview)\n ? await fetchAllDataFlows(client, ConsentTrackerStatus.NeedsReview)\n : []),\n ]\n : [],\n // Fetch data flows\n resources.includes(TranscendPullResource.Cookies)\n ? [\n ...(trackerStatuses.includes(ConsentTrackerStatus.Live)\n ? await fetchAllCookies(client, ConsentTrackerStatus.Live)\n : []),\n ...(trackerStatuses.includes(ConsentTrackerStatus.NeedsReview)\n ? await fetchAllCookies(client, ConsentTrackerStatus.NeedsReview)\n : []),\n ]\n : [],\n // Fetch attributes\n resources.includes(TranscendPullResource.Attributes) ? fetchAllAttributes(client) : [],\n // Fetch email templates\n resources.includes(TranscendPullResource.Templates) ? fetchAllTemplates(client) : [],\n // Fetch identifiers\n resources.includes(TranscendPullResource.Identifiers) ? fetchAllIdentifiers(client) : [],\n // Fetch actions\n resources.includes(TranscendPullResource.Actions) ? fetchAllActions(client) : [],\n // Fetch business entities\n resources.includes(TranscendPullResource.BusinessEntities)\n ? fetchAllBusinessEntities(client)\n : [],\n // Fetch processing activities\n resources.includes(TranscendPullResource.ProcessingActivities)\n ? fetchAllProcessingActivities(client)\n : [],\n // Fetch consent manager\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentManager(client)\n : undefined,\n // Fetch consent manager experiences\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentManagerExperiences(client)\n : [],\n // Fetch prompts\n resources.includes(TranscendPullResource.Prompts) ? fetchAllPrompts(client) : [],\n // Fetch promptPartials\n resources.includes(TranscendPullResource.PromptPartials) ? fetchAllPromptPartials(client) : [],\n // Fetch promptGroups\n resources.includes(TranscendPullResource.PromptGroups) ? fetchAllPromptGroups(client) : [],\n // Fetch agents\n resources.includes(TranscendPullResource.Agents) ? fetchAllAgents(client) : [],\n // Fetch agentFunctions\n resources.includes(TranscendPullResource.AgentFunctions) ? fetchAllAgentFunctions(client) : [],\n // Fetch agentFiles\n resources.includes(TranscendPullResource.AgentFiles) ? fetchAllAgentFiles(client) : [],\n // Fetch vendors\n resources.includes(TranscendPullResource.Vendors) ? fetchAllVendors(client) : [],\n // Fetch dataCategories\n resources.includes(TranscendPullResource.DataCategories) ? fetchAllDataCategories(client) : [],\n // Fetch dataCategories\n resources.includes(TranscendPullResource.ProcessingPurposes)\n ? fetchAllProcessingPurposes(client)\n : [],\n // Fetch actionItems\n resources.includes(TranscendPullResource.ActionItems)\n ? fetchAllActionItems(client, { type: [ActionItemCode.Onboarding] })\n : [],\n // Fetch actionItemCollections\n resources.includes(TranscendPullResource.ActionItemCollections)\n ? fetchAllActionItemCollections(client)\n : [],\n // Fetch teams\n resources.includes(TranscendPullResource.Teams) ? fetchAllTeams(client) : [],\n // Fetch policies\n resources.includes(TranscendPullResource.Policies) ? fetchAllPolicies(client) : [],\n // Fetch privacy centers\n resources.includes(TranscendPullResource.PrivacyCenters) ? fetchAllPrivacyCenters(client) : [],\n // Fetch messages\n resources.includes(TranscendPullResource.Messages) ? fetchAllMessages(client) : [],\n // Fetch partitions\n resources.includes(TranscendPullResource.Partitions) ? fetchPartitions(client) : [],\n // Fetch assessments\n resources.includes(TranscendPullResource.Assessments) ? fetchAllAssessments(client) : [],\n // Fetch assessmentTemplates\n resources.includes(TranscendPullResource.AssessmentTemplates)\n ? fetchAllAssessmentTemplates(client)\n : [],\n // Fetch purpose and preferences\n resources.includes(TranscendPullResource.Purposes)\n ? fetchAllPurposesAndPreferences(client)\n : [],\n // Fetch silo discovery results\n resources.includes(TranscendPullResource.SystemDiscovery)\n ? fetchAllSiloDiscoveryResults(client)\n : [],\n ]);\n\n const consentManagerTheme =\n resources.includes(TranscendPullResource.ConsentManager) && consentManager\n ? await fetchConsentManagerTheme(client, consentManager.id)\n : undefined;\n\n const result: TranscendInput = {};\n\n // Save API keys\n const apiKeyTitles = flatten(dataSilos.map(([{ apiKeys }]) => apiKeys.map(({ title }) => title)));\n const relevantApiKeys = Object.values(apiKeyTitleMap).filter(({ title }) =>\n resources.includes(TranscendPullResource.ApiKeys) ? true : apiKeyTitles.includes(title),\n );\n if (relevantApiKeys.length > 0 && resources.includes(TranscendPullResource.ApiKeys)) {\n result['api-keys'] = relevantApiKeys.map(\n ({ title }): ApiKeyInput => ({\n title,\n }),\n );\n }\n\n // Save Partitions\n if (partitions.length > 0 && resources.includes(TranscendPullResource.Partitions)) {\n result.partitions = partitions.map(({ name, partition }) => ({\n name,\n partition,\n }));\n }\n\n // Save Consent Manager\n if (consentManager && resources.includes(TranscendPullResource.ConsentManager)) {\n result['consent-manager'] = {\n bundleUrls: {\n TEST: consentManager.testBundleURL,\n PRODUCTION: consentManager.bundleURL,\n },\n domains: consentManager.configuration.domains || undefined,\n partition: consentManager.configuration.partition || undefined,\n consentPrecedence: consentManager.configuration.consentPrecedence || undefined,\n unknownRequestPolicy: consentManager.configuration.unknownRequestPolicy || undefined,\n unknownCookiePolicy: consentManager.configuration.unknownCookiePolicy || undefined,\n syncEndpoint: consentManager.configuration.syncEndpoint || undefined,\n telemetryPartitioning: consentManager.configuration.telemetryPartitioning || undefined,\n signedIabAgreement: consentManager.configuration.signedIabAgreement || undefined,\n // TODO: https://transcend.height.app/T-23919 - reconsider simpler yml shape\n syncGroups: consentManager.configuration.syncGroups || undefined,\n theme: !consentManagerTheme\n ? undefined\n : {\n primaryColor: consentManagerTheme.primaryColor || undefined,\n fontColor: consentManagerTheme.fontColor || undefined,\n privacyPolicy: consentManagerTheme.privacyPolicy || undefined,\n prompt: consentManagerTheme.prompt,\n },\n experiences: consentManagerExperiences.map((experience) => ({\n name: experience.name,\n displayName: experience.displayName || undefined,\n regions: experience.regions.map((region) => ({\n countrySubDivision: region.countrySubDivision || undefined,\n country: region.country || undefined,\n })),\n onConsentExpiry: experience.onConsentExpiry,\n consentExpiry: experience.consentExpiry,\n operator: experience.operator,\n displayPriority: experience.displayPriority,\n viewState: experience.viewState,\n purposes: experience.purposes.map((purpose) => ({\n trackingType: purpose.trackingType,\n })),\n optedOutPurposes: experience.optedOutPurposes.map((purpose) => ({\n trackingType: purpose.trackingType,\n })),\n browserLanguages: experience.browserLanguages,\n browserTimeZones: experience.browserTimeZones,\n })),\n };\n }\n\n // Save assessments\n if (assessments.length > 0 && resources.includes(TranscendPullResource.Assessments)) {\n result.assessments = assessments.map(\n ({\n title,\n assessmentGroup,\n sections,\n creator,\n description,\n status,\n assignees,\n externalAssignees,\n reviewers,\n isLocked,\n isArchived,\n isExternallyCreated,\n dueDate,\n createdAt,\n assignedAt,\n submittedAt,\n approvedAt,\n rejectedAt,\n titleIsInternal,\n retentionSchedule,\n attributeValues,\n resources,\n syncedRows,\n }): AssessmentInput => ({\n title,\n group: assessmentGroup.title,\n sections: sections.map(\n ({\n title,\n status,\n questions,\n assignees,\n isReviewed,\n externalAssignees,\n }): AssessmentSectionInput => ({\n title,\n status,\n questions: questions.map(\n ({\n title,\n type,\n subType,\n placeholder,\n description,\n isRequired,\n referenceId,\n displayLogic,\n riskLogic,\n riskCategories,\n riskFramework,\n answerOptions,\n selectedAnswers,\n allowedMimeTypes,\n allowSelectOther,\n syncModel,\n syncColumn,\n attributeKey,\n requireRiskEvaluation,\n requireRiskMatrixEvaluation,\n }): AssessmentSectionQuestionInput => {\n const displayLogicParsed = displayLogic\n ? parseAssessmentDisplayLogic(displayLogic)\n : undefined;\n return {\n title,\n type,\n 'sub-type': subType,\n placeholder,\n description,\n 'is-required': isRequired,\n 'reference-id': referenceId,\n 'display-logic':\n displayLogicParsed && Object.keys(displayLogicParsed).length > 0\n ? {\n action: displayLogicParsed.action!,\n rule: displayLogicParsed.rule\n ? {\n 'depends-on-question-reference-id':\n displayLogicParsed.rule.dependsOnQuestionReferenceId,\n 'comparison-operator': displayLogicParsed.rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property with a check\n 'comparisonOperands' in displayLogicParsed.rule\n ? displayLogicParsed.rule.comparisonOperands\n : undefined,\n }\n : undefined,\n 'nested-rule': displayLogicParsed.nestedRule\n ? {\n 'logic-operator': displayLogicParsed.nestedRule.logicOperator,\n rules: (displayLogicParsed.nestedRule.rules || []).map(\n (rule: AssessmentRule) => ({\n 'depends-on-question-reference-id':\n rule.dependsOnQuestionReferenceId,\n 'comparison-operator': rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property on the nested rule\n 'comparisonOperands' in rule\n ? rule.comparisonOperands\n : undefined,\n }),\n ),\n }\n : undefined,\n }\n : undefined,\n 'risk-logic': riskLogic.map((logic): RiskLogicInput => {\n const parsed = parseAssessmentRiskLogic(logic);\n return {\n 'risk-level': parsed.riskAssignment?.riskLevelId,\n 'comparison-operands': parsed.comparisonOperands,\n 'comparison-operator': parsed.comparisonOperator,\n };\n }),\n 'risk-categories': riskCategories.map(({ title }) => title),\n 'risk-framework': riskFramework?.title,\n 'answer-options': answerOptions.map(({ value }) => ({\n value,\n })),\n 'selected-answers': selectedAnswers.map(({ value }) => value),\n 'allowed-mime-types': allowedMimeTypes,\n 'allow-select-other': allowSelectOther,\n 'sync-model': syncModel || undefined,\n 'sync-column': syncColumn || undefined,\n 'attribute-key': attributeKey?.name,\n 'require-risk-evaluation': requireRiskEvaluation,\n 'require-risk-matrix-evaluation': requireRiskMatrixEvaluation,\n };\n },\n ),\n assignees: assignees.map(({ email }) => email),\n 'external-assignees': externalAssignees.map(({ email }) => email),\n 'is-reviewed': isReviewed,\n }),\n ),\n creator: creator?.email,\n description,\n status,\n assignees: assignees.map(({ email }) => email),\n 'external-assignees': externalAssignees.map(({ email }) => email),\n reviewers: reviewers.map(({ email }) => email),\n locked: isLocked,\n archived: isArchived,\n external: isExternallyCreated,\n 'title-is-internal': titleIsInternal,\n 'due-date': dueDate || undefined,\n 'created-at': createdAt || undefined,\n 'assigned-at': assignedAt || undefined,\n 'submitted-at': submittedAt || undefined,\n 'approved-at': approvedAt || undefined,\n 'rejected-at': rejectedAt || undefined,\n 'retention-schedule': retentionSchedule\n ? {\n type: retentionSchedule.type,\n 'duration-days': retentionSchedule.durationDays,\n operand: retentionSchedule.operation,\n }\n : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n resources: resources.map(({ resourceType, title, name, category, type, purpose }) => ({\n type: resourceType,\n title: category\n ? `${category} - ${name}`\n : purpose\n ? `${purpose} - ${name}`\n : title || name || type || '',\n })),\n rows: syncedRows.map(({ resourceType, title, name, category, type, purpose }) => ({\n type: resourceType,\n title: category\n ? `${category} - ${name}`\n : purpose\n ? `${purpose} - ${name}`\n : title || name || type || '',\n })),\n }),\n );\n }\n\n // Save assessmentTemplates\n if (\n assessmentTemplates.length > 0 &&\n resources.includes(TranscendPullResource.AssessmentTemplates)\n ) {\n result['assessment-templates'] = assessmentTemplates.map(\n ({\n title,\n description,\n sections,\n status,\n source,\n creator,\n isLocked,\n isArchived,\n createdAt,\n retentionSchedule,\n }): AssessmentTemplateInput => ({\n title,\n description,\n sections: sections.map(\n ({ title, questions }): AssessmentSectionInput => ({\n title,\n questions: questions.map(\n ({\n title,\n type,\n subType,\n placeholder,\n description,\n isRequired,\n referenceId,\n displayLogic,\n riskLogic,\n riskCategories,\n riskFramework,\n answerOptions,\n allowedMimeTypes,\n allowSelectOther,\n syncModel,\n syncColumn,\n attributeKey,\n requireRiskEvaluation,\n requireRiskMatrixEvaluation,\n }): AssessmentSectionQuestionInput => {\n const displayLogicParsed = displayLogic\n ? parseAssessmentDisplayLogic(displayLogic)\n : undefined;\n return {\n title,\n type,\n 'sub-type': subType,\n placeholder,\n description,\n 'is-required': isRequired,\n 'reference-id': referenceId,\n 'display-logic':\n displayLogicParsed && Object.keys(displayLogicParsed).length > 0\n ? {\n action: displayLogicParsed.action!,\n rule: displayLogicParsed.rule\n ? {\n 'depends-on-question-reference-id':\n displayLogicParsed.rule.dependsOnQuestionReferenceId,\n 'comparison-operator': displayLogicParsed.rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property with a check\n 'comparisonOperands' in displayLogicParsed.rule\n ? displayLogicParsed.rule.comparisonOperands\n : undefined,\n }\n : undefined,\n 'nested-rule': displayLogicParsed.nestedRule\n ? {\n 'logic-operator': displayLogicParsed.nestedRule.logicOperator,\n rules: (displayLogicParsed.nestedRule.rules || []).map(\n (rule: AssessmentRule) => ({\n 'depends-on-question-reference-id':\n rule.dependsOnQuestionReferenceId,\n 'comparison-operator': rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property on the nested rule\n 'comparisonOperands' in rule\n ? rule.comparisonOperands\n : undefined,\n }),\n ),\n }\n : undefined,\n }\n : undefined,\n 'risk-logic': riskLogic.map((logic): RiskLogicInput => {\n const parsed = parseAssessmentRiskLogic(logic);\n return {\n 'risk-level': parsed.riskAssignment?.riskLevelId,\n 'risk-matrix-row': parsed.riskAssignment?.riskMatrixRowId,\n 'risk-matrix-column': parsed.riskAssignment?.riskMatrixColumnId,\n 'comparison-operands': parsed.comparisonOperands,\n 'comparison-operator': parsed.comparisonOperator,\n };\n }),\n 'risk-categories': riskCategories.map(({ title }) => title),\n 'risk-framework': riskFramework?.title,\n 'answer-options': answerOptions.map(({ value }) => ({\n value,\n })),\n 'allowed-mime-types': allowedMimeTypes,\n 'allow-select-other': allowSelectOther,\n 'sync-model': syncModel || undefined,\n 'sync-column': syncColumn || undefined,\n 'attribute-key': attributeKey?.name,\n 'require-risk-evaluation': requireRiskEvaluation,\n 'require-risk-matrix-evaluation': requireRiskMatrixEvaluation,\n };\n },\n ),\n }),\n ),\n status,\n source,\n creator: creator?.email,\n locked: isLocked,\n archived: isArchived,\n 'created-at': createdAt || undefined,\n 'retention-schedule': retentionSchedule\n ? {\n type: retentionSchedule.type,\n 'duration-days': retentionSchedule.durationDays,\n operand: retentionSchedule.operation,\n }\n : undefined,\n }),\n );\n }\n\n // Save Silo Discovery Results\n if (\n siloDiscoveryResults.length > 0 &&\n resources.includes(TranscendPullResource.SystemDiscovery)\n ) {\n result['system-discovery'] = siloDiscoveryResults.map(\n ({\n title,\n resourceId,\n suggestedCatalog: { title: suggestedCatalogTitle },\n plugin: {\n dataSilo: { title: dataSiloTitle },\n },\n country,\n countrySubDivision,\n plaintextContext,\n containsSensitiveData,\n status,\n }): SiloDiscoveryResultInput => ({\n title,\n resourceId,\n suggestedCatalog: suggestedCatalogTitle,\n plugin: dataSiloTitle,\n country: country || undefined,\n countrySubDivision: countrySubDivision || undefined,\n plaintextContext,\n containsSensitiveData,\n status,\n }),\n );\n }\n\n // Save prompts\n if (prompts.length > 0 && resources.includes(TranscendPullResource.Prompts)) {\n result.prompts = prompts.map(\n ({ title, content }): PromptInput => ({\n title,\n content,\n }),\n );\n }\n\n // Save promptPartials\n if (promptPartials.length > 0 && resources.includes(TranscendPullResource.PromptPartials)) {\n result['prompt-partials'] = promptPartials.map(\n ({ title, content }): PromptPartialInput => ({\n title,\n content,\n }),\n );\n }\n\n // Save promptGroups\n if (promptGroups.length > 0 && resources.includes(TranscendPullResource.PromptGroups)) {\n result['prompt-groups'] = promptGroups.map(\n ({ title, description, prompts }): PromptGroupInput => ({\n title,\n description,\n prompts: prompts.map(({ title }) => title),\n }),\n );\n }\n\n // Save teams\n if (teams.length > 0 && resources.includes(TranscendPullResource.Teams)) {\n result.teams = teams.map(\n ({ name, description, ssoDepartment, ssoGroup, ssoTitle, users, scopes }): TeamInput => ({\n name,\n description,\n 'sso-department': ssoDepartment || undefined,\n 'sso-group': ssoGroup || undefined,\n 'sso-title': ssoTitle || undefined,\n users: users.map(({ email }) => email),\n scopes: scopes.map(({ name }) => name),\n }),\n );\n }\n\n // Save Data Subjects\n if (dataSubjects.length > 0 && resources.includes(TranscendPullResource.DataSubjects)) {\n result['data-subjects'] = dataSubjects.map(\n ({ type, title, active, adminDashboardDefaultSilentMode, actions }): DataSubjectInput => ({\n type,\n title: title?.defaultMessage,\n active,\n adminDashboardDefaultSilentMode,\n actions: actions.map(({ type }) => type),\n }),\n );\n }\n\n // Save privacy policies\n if (policies.length > 0) {\n result.policies = policies.map(\n ({ title, versions, disabledLocales }): PolicyInput => ({\n title: title?.defaultMessage,\n content: versions?.[0]?.content?.defaultMessage,\n disabledLocales,\n }),\n );\n }\n\n // Save messages\n if (messages.length > 0) {\n result.messages = messages.map(\n ({ id, defaultMessage, targetReactIntlId, description, translations }): IntlMessageInput => ({\n id,\n defaultMessage,\n description,\n targetReactIntlId: targetReactIntlId || undefined,\n translations: translations.reduce(\n (acc, { locale, value }) => Object.assign(acc, { [locale]: value }),\n {} as Record<LocaleValue, string>,\n ),\n }),\n );\n }\n\n // Save privacy center\n if (privacyCenters.length > 0) {\n const privacyCenter = privacyCenters[0];\n result['privacy-center'] = {\n isDisabled: privacyCenter.isDisabled,\n showPrivacyRequestButton: privacyCenter.showPrivacyRequestButton,\n showPolicies: privacyCenter.showPolicies,\n showTrackingTechnologies: privacyCenter.showTrackingTechnologies,\n showCookies: privacyCenter.showCookies,\n showDataFlows: privacyCenter.showDataFlows,\n showConsentManager: privacyCenter.showConsentManager,\n showManageYourPrivacy: privacyCenter.showManageYourPrivacy,\n showMarketingPreferences: privacyCenter.showMarketingPreferences,\n locales: privacyCenter.locales,\n defaultLocale: privacyCenter.defaultLocale,\n preferBrowserDefaultLocale: privacyCenter.preferBrowserDefaultLocale,\n supportEmail: privacyCenter.supportEmail || undefined,\n replyToEmail: privacyCenter.replyToEmail || undefined,\n useNoReplyEmailAddress: privacyCenter.useNoReplyEmailAddress,\n useCustomEmailDomain: privacyCenter.useCustomEmailDomain,\n transformAccessReportJsonToCsv: privacyCenter.transformAccessReportJsonToCsv,\n theme: privacyCenter.theme,\n };\n }\n\n // Save business entities\n if (businessEntities.length > 0 && resources.includes(TranscendPullResource.BusinessEntities)) {\n result['business-entities'] = businessEntities.map(\n ({\n title,\n description,\n address,\n headquarterCountry,\n headquarterSubDivision,\n dataProtectionOfficerName,\n dataProtectionOfficerEmail,\n attributeValues,\n }): BusinessEntityInput => ({\n title,\n description: description || undefined,\n address: address || undefined,\n headquarterCountry: headquarterCountry || undefined,\n headquarterSubDivision: headquarterSubDivision || undefined,\n dataProtectionOfficerName: dataProtectionOfficerName || undefined,\n dataProtectionOfficerEmail: dataProtectionOfficerEmail || undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save processing activities\n if (\n processingActivities.length > 0 &&\n resources.includes(TranscendPullResource.ProcessingActivities)\n ) {\n result['processing-activities'] = processingActivities.map(\n ({\n title,\n description,\n securityMeasureDetails,\n controllerships,\n storageRegions,\n transferRegions,\n retentionType,\n retentionPeriod,\n dataProtectionImpactAssessmentLink,\n dataProtectionImpactAssessmentStatus,\n attributeValues,\n dataSilos,\n dataSubjects,\n teams,\n owners,\n processingPurposeSubCategories,\n dataSubCategories,\n saaSCategories,\n }): ProcessingActivityInput => ({\n title,\n description,\n securityMeasureDetails: securityMeasureDetails ?? undefined,\n controllerships: controllerships.length > 0 ? controllerships : undefined,\n storageRegions: storageRegions.length > 0 ? formatRegions(storageRegions) : undefined,\n transferRegions: transferRegions.length > 0 ? formatRegions(transferRegions) : undefined,\n retentionType,\n retentionPeriod: retentionType === RetentionType.StatedPeriod ? retentionPeriod : undefined,\n dataProtectionImpactAssessmentLink: dataProtectionImpactAssessmentLink ?? undefined,\n dataProtectionImpactAssessmentStatus,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n dataSiloTitles: dataSilos.length > 0 ? dataSilos.map(({ title }) => title) : undefined,\n dataSubjectTypes:\n dataSubjects.length > 0 ? dataSubjects.map(({ type }) => type) : undefined,\n teamNames: teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n ownerEmails: owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n processingSubPurposes:\n processingPurposeSubCategories.length > 0\n ? processingPurposeSubCategories.map(({ name, purpose }) => ({\n purpose,\n ...(name ? { name } : {}),\n }))\n : undefined,\n dataSubCategories:\n dataSubCategories.length > 0\n ? dataSubCategories.map(({ name, category }) => ({\n category,\n ...(name ? { name } : {}),\n }))\n : undefined,\n saaSCategories:\n saaSCategories.length > 0 ? saaSCategories.map(({ title }) => title) : undefined,\n }),\n );\n }\n\n // Save Actions\n if (actions.length > 0 && resources.includes(TranscendPullResource.Actions)) {\n result.actions = actions.map(\n ({\n type,\n skipSecondaryIfNoFiles,\n skipDownloadableStep,\n requiresReview,\n regionList,\n regionDetectionMethod,\n waitingPeriod,\n }): ActionInput => ({\n type,\n ...(type === RequestAction.Erasure\n ? {\n skipSecondaryIfNoFiles,\n skipDownloadableStep,\n }\n : {}),\n requiresReview,\n waitingPeriod,\n regionDetectionMethod,\n regionList: regionList.length > 0 ? regionList : undefined,\n }),\n );\n }\n\n // Save identifiers\n if (identifiers.length > 0 && resources.includes(TranscendPullResource.Identifiers)) {\n result.identifiers = identifiers.map(\n ({\n name,\n type,\n regex,\n selectOptions,\n privacyCenterVisibility,\n isRequiredInForm,\n placeholder,\n displayTitle,\n dataSubjects,\n displayDescription,\n displayOrder,\n isUniqueOnPreferenceStore,\n }): IdentifierInput => ({\n name,\n type,\n regex,\n selectOptions: selectOptions.length > 0 ? selectOptions : undefined,\n privacyCenterVisibility:\n privacyCenterVisibility.length > 0 ? privacyCenterVisibility : undefined,\n isRequiredInForm,\n placeholder: placeholder || undefined,\n dataSubjects: dataSubjects.length > 0 ? dataSubjects.map(({ type }) => type) : undefined,\n displayTitle: displayTitle?.defaultMessage,\n displayDescription: displayDescription?.defaultMessage,\n displayOrder,\n isUniqueOnPreferenceStore,\n }),\n );\n }\n\n // Save agents\n if (agents.length > 0 && resources.includes(TranscendPullResource.Agents)) {\n result.agents = agents.map(\n ({\n name,\n agentId,\n description,\n instructions,\n codeInterpreterEnabled,\n retrievalEnabled,\n prompt,\n largeLanguageModel,\n teams,\n owners,\n agentFunctions,\n agentFiles,\n }): AgentInput => ({\n name,\n agentId,\n description: description || undefined,\n instructions,\n codeInterpreterEnabled,\n retrievalEnabled,\n prompt: prompt?.title,\n 'large-language-model': {\n name: largeLanguageModel.name,\n client: largeLanguageModel.client,\n },\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n 'agent-functions':\n agentFunctions && agentFunctions.length > 0\n ? agentFunctions.map(({ name }) => name)\n : undefined,\n 'agent-files':\n agentFiles && agentFiles.length > 0 ? agentFiles.map(({ name }) => name) : undefined,\n }),\n );\n }\n\n // Save action items\n if (actionItems.length > 0 && resources.includes(TranscendPullResource.ActionItems)) {\n result['action-items'] = actionItems.map(\n ({\n teams,\n users,\n customerExperienceActionItemIds: [customerExperienceActionItemId],\n dueDate,\n priority,\n resolved,\n collections,\n notes,\n link,\n title,\n type,\n attributeValues,\n }): ActionItemInput => ({\n teams: teams.map(({ name }) => name),\n users: users.map(({ email }) => email),\n dueDate: dueDate || undefined,\n title,\n notes,\n customerExperienceActionItemId,\n collections: collections.map(({ title }) => title),\n link,\n priority: priority || undefined,\n resolved,\n type,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save action item collections\n if (\n actionItemCollections.length > 0 &&\n resources.includes(TranscendPullResource.ActionItemCollections)\n ) {\n result['action-item-collections'] = actionItemCollections.map(\n ({ title, description, hidden, productLine }): ActionItemCollectionInput => ({\n title,\n description: description || undefined,\n hidden,\n productLine,\n }),\n );\n }\n\n // Save agent functions\n if (agentFunctions.length > 0 && resources.includes(TranscendPullResource.AgentFunctions)) {\n result['agent-functions'] = agentFunctions.map(\n ({ name, description, parameters }): AgentFunctionInput => ({\n name,\n description,\n parameters: JSON.stringify(parameters),\n }),\n );\n }\n\n // Save agent files\n if (agentFiles.length > 0 && resources.includes(TranscendPullResource.AgentFiles)) {\n result['agent-files'] = agentFiles.map(\n ({ name, description, fileId, size, purpose }): AgentFileInput => ({\n name,\n description,\n fileId,\n size,\n purpose,\n }),\n );\n }\n\n // Save vendors\n if (vendors.length > 0 && resources.includes(TranscendPullResource.Vendors)) {\n result.vendors = vendors.map(\n ({\n title,\n description,\n dataProcessingAgreementLink,\n contactName,\n contactPhone,\n address,\n headquarterCountry,\n headquarterSubDivision,\n websiteUrl,\n businessEntity,\n teams,\n owners,\n attributeValues,\n }): VendorInput => ({\n title,\n description: description || undefined,\n dataProcessingAgreementLink: dataProcessingAgreementLink || undefined,\n contactName: contactName || undefined,\n contactPhone: contactPhone || undefined,\n address: address || undefined,\n headquarterCountry: headquarterCountry || undefined,\n headquarterSubDivision: headquarterSubDivision || undefined,\n websiteUrl: websiteUrl || undefined,\n businessEntity: businessEntity?.title,\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save data categories\n if (dataCategories.length > 0 && resources.includes(TranscendPullResource.DataCategories)) {\n result['data-categories'] = dataCategories.map(\n ({\n name,\n category,\n description,\n regex,\n owners,\n teams,\n attributeValues,\n }): DataCategoryInput => ({\n name,\n category,\n description: description || undefined,\n regex: regex || undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save processing purposes\n if (\n processingPurposes.length > 0 &&\n resources.includes(TranscendPullResource.ProcessingPurposes)\n ) {\n result['processing-purposes'] = processingPurposes.map(\n ({ name, purpose, description, owners, teams, attributeValues }): ProcessingPurposeInput => ({\n name,\n purpose,\n description: description || undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save data flows\n if (dataFlows.length > 0 && resources.includes(TranscendPullResource.DataFlows)) {\n result['data-flows'] = dataFlows.map(\n ({\n value,\n type,\n description,\n trackingType,\n service,\n status,\n owners,\n teams,\n attributeValues,\n }): DataFlowInput => ({\n value,\n type,\n description: description || undefined,\n trackingPurposes: trackingType,\n status,\n service: service?.integrationName,\n owners: owners.map(({ email }) => email),\n teams: teams.map(({ name }) => name),\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save cookies\n if (cookies.length > 0 && resources.includes(TranscendPullResource.Cookies)) {\n result.cookies = cookies.map(\n ({\n name,\n isRegex,\n description,\n trackingPurposes,\n service,\n status,\n owners,\n teams,\n attributeValues,\n }): CookieInput => ({\n name,\n isRegex,\n description: description || undefined,\n trackingPurposes,\n status,\n service: service?.integrationName,\n owners: owners.map(({ email }) => email),\n teams: teams.map(({ name }) => name),\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save attributes\n if (attributes.length > 0 && resources.includes(TranscendPullResource.Attributes)) {\n result.attributes = attributes.map(\n ({ description, name, type, values, enabledOn = [] }): AttributeInput => ({\n description: description || undefined,\n resources: enabledOn,\n name,\n type,\n values: values.map(({ name, color, description }) => ({\n name,\n color: color || undefined,\n description,\n })),\n }),\n );\n }\n\n // save purposes\n if (purposes.length > 0) {\n result.purposes = purposes.map(\n ({\n name,\n description,\n trackingType,\n defaultConsent,\n configurable,\n showInConsentManager,\n isActive,\n displayOrder,\n optOutSignals,\n authLevel,\n topics,\n showInPrivacyCenter,\n title,\n }): ConsentPurpose => ({\n name,\n title,\n description: description || undefined,\n trackingType,\n 'default-consent': defaultConsent,\n configurable,\n 'show-in-consent-manager': showInConsentManager,\n 'show-in-privacy-center': showInPrivacyCenter,\n 'is-active': isActive,\n 'display-order': displayOrder,\n 'opt-out-signals': optOutSignals.length > 0 ? optOutSignals : undefined,\n 'auth-level': authLevel || undefined,\n 'preference-topics': topics.map(\n ({\n title,\n type,\n displayDescription,\n defaultConfiguration,\n showInPrivacyCenter,\n preferenceOptionValues,\n }) => ({\n title: title.defaultMessage,\n type,\n description: displayDescription.defaultMessage,\n 'default-configuration': defaultConfiguration,\n 'show-in-privacy-center': showInPrivacyCenter,\n ...(preferenceOptionValues.length > 0\n ? {\n options: preferenceOptionValues.map(({ title, slug }) => ({\n title: title.defaultMessage,\n slug,\n })),\n }\n : {}),\n }),\n ),\n }),\n );\n }\n\n // save email templates\n if (\n dataSiloIds.length === 0 &&\n templates.length > 0 &&\n resources.includes(TranscendPullResource.Templates)\n ) {\n result.templates = templates.map(({ title }) => ({ title }));\n }\n\n // Save enrichers\n if (enrichers.length > 0 && resources.includes(TranscendPullResource.Enrichers)) {\n result.enrichers = enrichers.map(\n ({\n title,\n url,\n type,\n inputIdentifier,\n identifiers,\n actions,\n testRegex,\n dataSubjects,\n expirationDuration,\n lookerQueryTitle,\n transitionRequestStatus,\n phoneNumbers,\n regionList,\n }): EnricherInput => ({\n title,\n url: url || undefined,\n type,\n 'input-identifier': inputIdentifier?.name,\n 'output-identifiers': identifiers.map(({ name }) => name),\n 'privacy-actions':\n Object.values(RequestAction).length === actions.length ? undefined : actions,\n testRegex: testRegex || undefined,\n lookerQueryTitle: lookerQueryTitle || undefined,\n expirationDuration: parseInt(expirationDuration, 10),\n transitionRequestStatus: transitionRequestStatus || undefined,\n phoneNumbers: phoneNumbers && phoneNumbers.length > 0 ? phoneNumbers : undefined,\n regionList: regionList && regionList.length > 0 ? regionList : undefined,\n 'data-subjects': dataSubjects.map(({ type }) => type),\n }),\n );\n }\n\n // Save data silos\n if (dataSilos.length > 0 && resources.includes(TranscendPullResource.DataSilos)) {\n const indexedDataSubjects = keyBy(dataSubjects, 'type');\n result['data-silos'] = dataSilos.map(\n ([\n {\n title,\n description,\n url,\n type,\n outerType,\n apiKeys,\n notifyEmailAddress,\n identifiers,\n dependentDataSilos,\n owners,\n country,\n countrySubDivision,\n teams,\n subjectBlocklist,\n isLive,\n promptAVendorEmailSendFrequency,\n promptAVendorEmailSendType,\n promptAVendorEmailIncludeIdentifiersAttachment,\n promptAVendorEmailCompletionLinkType,\n manualWorkRetryFrequency,\n catalog,\n attributeValues,\n discoveredBy,\n businessEntities,\n },\n dataPoints,\n ]): DataSiloInput => ({\n title,\n description,\n integrationName: type,\n 'outer-type': outerType || undefined,\n url: url || undefined,\n 'api-key-title': apiKeys[0]?.title,\n 'identity-keys': identifiers\n .filter(({ isConnected }) => isConnected)\n .map(({ name }) => name),\n ...(dependentDataSilos.length > 0\n ? {\n 'deletion-dependencies': dependentDataSilos.map(({ title }) => title),\n }\n : {}),\n ...(owners.length > 0 ? { owners: owners.map(({ email }) => email) } : {}),\n ...(teams.length > 0 ? { teams: teams.map(({ name }) => name) } : {}),\n ...(discoveredBy.length > 0\n ? { discoveredBy: discoveredBy.map(({ title }) => title) }\n : {}),\n ...(businessEntities.length > 0\n ? {\n businessEntities: businessEntities.map(({ title }) => title),\n }\n : {}),\n country: country || undefined,\n countrySubDivision: countrySubDivision || undefined,\n disabled: !isLive,\n 'data-subjects':\n subjectBlocklist.length > 0\n ? convertToDataSubjectAllowlist(\n subjectBlocklist.map(({ type }) => type),\n indexedDataSubjects,\n )\n : undefined,\n ...(catalog.hasAvcFunctionality\n ? {\n 'email-settings': {\n 'notify-email-address': notifyEmailAddress || undefined,\n 'send-frequency': promptAVendorEmailSendFrequency,\n 'send-type': promptAVendorEmailSendType,\n 'include-identifiers-attachment': promptAVendorEmailIncludeIdentifiersAttachment,\n 'completion-link-type': promptAVendorEmailCompletionLinkType,\n 'manual-work-retry-frequency': manualWorkRetryFrequency,\n },\n }\n : {}),\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n\n datapoints: dataPoints\n .map(\n (dataPoint): DatapointInput => ({\n key: dataPoint.name,\n title: dataPoint.title?.defaultMessage,\n description: dataPoint.description?.defaultMessage,\n owners: dataPoint.owners.map(({ email }) => email),\n teams: dataPoint.teams.map(({ name }) => name),\n ...(dataPoint.path.length > 0 ? { path: dataPoint.path } : {}),\n ...(dataPoint.dataCollection?.title\n ? {\n 'data-collection-tag': dataPoint.dataCollection.title.defaultMessage,\n }\n : {}),\n ...(dataPoint.dbIntegrationQueries.length > 0\n ? {\n 'privacy-action-queries': mapValues(\n keyBy(dataPoint.dbIntegrationQueries, 'requestType'),\n (databaseIntegrationQuery) =>\n databaseIntegrationQuery.suggestedQuery ||\n databaseIntegrationQuery.query ||\n undefined,\n ),\n }\n : {}),\n ...(dataPoint.subDataPoints.length > 0\n ? {\n fields: dataPoint.subDataPoints\n .map(\n (field): FieldInput => ({\n key: field.name,\n description: field.description,\n purposes: field.purposes,\n categories: field.categories,\n ...(includeGuessedCategories && field.pendingCategoryGuesses\n ? {\n 'guessed-categories': field.pendingCategoryGuesses\n .filter((guess) => guess.status === 'PENDING')\n .map((guess) => ({\n category: {\n name: guess.category.name,\n category: guess.category.category,\n },\n status: guess.status,\n confidence: guess.confidence,\n classifierVersion: guess.classifierVersion || undefined,\n })),\n }\n : {}),\n 'access-request-visibility-enabled': field.accessRequestVisibilityEnabled,\n 'erasure-request-redaction-enabled': field.erasureRequestRedactionEnabled,\n attributes:\n field.attributeValues !== undefined && field.attributeValues.length > 0\n ? formatAttributeValues(field.attributeValues)\n : undefined,\n }),\n )\n .sort((a, b) => a.key.localeCompare(b.key)),\n }\n : {}),\n 'privacy-actions': dataPoint.actionSettings\n .filter(({ active }) => active)\n .map(({ type }) => type),\n }),\n )\n .sort((a, b) =>\n [...(a.path ?? []), a.key]\n .join('.')\n .localeCompare([...(b.path ?? []), b.key].join('.')),\n ),\n }),\n );\n }\n return result;\n}\n/* eslint-enable max-lines */\n"],"mappings":"2qCAWA,MAAa,EAAuB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmD3B,GAA0B;;;;;EC5DzB,EAAyB,CAAG;;;;;;;;;;;;;;;;;;;;;;ECqVzC,eAAsB,EAAoB,EAA8C,CACtF,IAAM,EAA4B,EAAE,CAChC,EAAS,EAET,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,gBAAiB,CAAE,UACjB,MAAM,EAMP,EAAQ,EAAa,CACtB,MAAOA,GACP,SACD,CAAC,CACF,EAAY,KAAK,GAAG,EAAM,CAC1B,GAAUA,GACV,EAAiB,EAAM,SAAWA,SAC3B,GAET,OAAO,EAAY,MAAM,EAA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EAAE,CAAG,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,CACvD,CACJ,EACF,CAEH,OAAO"}
@@ -0,0 +1,38 @@
1
+ import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./makeGraphQLRequest-G078PsEL.mjs";import{sortBy as n}from"lodash-es";import r from"colors";import{gql as i}from"graphql-request";import a from"cli-progress";const o=i`
2
+ query TranscendCliEntryCount($filterBy: UnstructuredSubDataPointRecommendationsFilterInput) {
3
+ unstructuredSubDataPointRecommendations(filterBy: $filterBy, useMaster: false) {
4
+ totalCount
5
+ }
6
+ }
7
+ `;async function s(s,{dataSiloIds:c=[],status:l,subCategories:u=[],includeEncryptedSnippets:d,pageSize:f=100}={}){let p=[],m=new Date().getTime(),h=new a.SingleBar({},a.Presets.shades_classic),g={...u.length>0?{subCategoryIds:u}:{},...l?{status:l}:{},...c.length>0?{dataSilos:c}:{}},{unstructuredSubDataPointRecommendations:{totalCount:_}}=await t(s,o,{filterBy:g});e.info(r.magenta(`[Step 1/3] Pulling in all subdatapoints`)),h.start(_,0);let v=0,y=!1,b,x=0;do try{let{unstructuredSubDataPointRecommendations:{nodes:e}}=await t(s,i`
8
+ query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(
9
+ $filterBy: UnstructuredSubDataPointRecommendationsFilterInput
10
+ $first: Int!
11
+ $offset: Int!
12
+ ) {
13
+ unstructuredSubDataPointRecommendations(
14
+ filterBy: $filterBy
15
+ first: $first
16
+ offset: $offset
17
+ useMaster: false
18
+ ) {
19
+ nodes {
20
+ id
21
+ dataSiloId
22
+ scannedObjectPathId
23
+ scannedObjectId
24
+ ${d?`name`:``}
25
+ ${d?`contextSnippet`:``}
26
+ dataSubCategory {
27
+ name
28
+ category
29
+ }
30
+ status
31
+ confidence
32
+ classificationMethod
33
+ classifierVersion
34
+ }
35
+ }
36
+ }
37
+ `,{first:f,offset:x,filterBy:{...g}});b=e[e.length-1]?.id,p.push(...e),y=e.length===f,v+=e.length,x+=e.length,h.update(v)}catch(t){throw e.error(r.red(`An error fetching subdatapoints for cursor ${b} and offset ${x}`)),t}while(y);h.stop();let S=new Date().getTime()-m,C=n(p,`name`);return e.info(r.green(`Successfully pulled in ${C.length} subdatapoints in ${S/1e3} seconds!`)),C}export{o as n,s as t};
38
+ //# sourceMappingURL=pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs","names":[],"sources":["../src/lib/graphql/gqls/entry.ts","../src/lib/data-inventory/pullUnstructuredSubDataPointRecommendations.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\nexport const ENTRY_COUNT = gql`\n query TranscendCliEntryCount($filterBy: UnstructuredSubDataPointRecommendationsFilterInput) {\n unstructuredSubDataPointRecommendations(filterBy: $filterBy, useMaster: false) {\n totalCount\n }\n }\n`;\n","import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql, type GraphQLClient } from 'graphql-request';\nimport { sortBy } from 'lodash-es';\n\nimport type { DataCategoryInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { ENTRY_COUNT, makeGraphQLRequest } from '../graphql/index.js';\n\ninterface UnstructuredSubDataPointRecommendationCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Entry or Named Entity recognized by the classifier */\n name: string;\n /** Context snippet including entry */\n contextSnippet: string;\n /** Scanned object ID */\n scannedObjectId: string;\n /** Scanned object path ID */\n scannedObjectPathId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** Personal data category */\n dataSubCategory: DataCategoryInput;\n /** Classification Status */\n status: UnstructuredSubDataPointRecommendationStatus;\n /** Confidence */\n confidence: number;\n /** Classification method */\n classificationMethod: string;\n /** Classifier version */\n classifierVersion: string;\n}\n\ninterface EntryFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Parent categories to filter down for */\n status?: UnstructuredSubDataPointRecommendationStatus[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n /** Include entry and snippet */\n includeEncryptedSnippets?: boolean;\n /** Include encryptedSamplesS3Key */\n includeEncryptedSamplesS3Key?: boolean;\n}\n/**\n * Pull unstructured subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @param options.dataSiloIds - IDs of data silos to filter down\n * @param options.status - Parent categories to filter down for\n * @param options.subCategories - Sub categories to filter down for\n * @param options.includeEncryptedSnippets - Include entry and snippet\n * @param options.includeEncryptedSamplesS3Key - Include encryptedSamplesS3Key\n * @param options.pageSize - Page size to pull in\n * @returns A promise that resolves to an array of unstructured subdatapoint recommendations\n */\nexport async function pullUnstructuredSubDataPointRecommendations(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n status,\n subCategories = [],\n includeEncryptedSnippets,\n pageSize = 100,\n }: EntryFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<UnstructuredSubDataPointRecommendationCsvPreview[]> {\n const unstructuredSubDataPointRecommendations: UnstructuredSubDataPointRecommendationCsvPreview[] =\n [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n // Filters\n const filterBy = {\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n ...(status ? { status } : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n unstructuredSubDataPointRecommendations: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** Count */\n totalCount: number;\n };\n }>(client, ENTRY_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n unstructuredSubDataPointRecommendations: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** List of matches */\n nodes: UnstructuredSubDataPointRecommendationCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(\n $filterBy: UnstructuredSubDataPointRecommendationsFilterInput\n $first: Int!\n $offset: Int!\n ) {\n unstructuredSubDataPointRecommendations(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n dataSiloId\n scannedObjectPathId\n scannedObjectId\n ${includeEncryptedSnippets ? 'name' : ''}\n ${includeEncryptedSnippets ? 'contextSnippet' : ''}\n dataSubCategory {\n name\n category\n }\n status\n confidence\n classificationMethod\n classifierVersion\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n unstructuredSubDataPointRecommendations.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(unstructuredSubDataPointRecommendations, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return sorted;\n}\n"],"mappings":"sNAEA,MAAa,EAAc,CAAG;;;;;;EC0D9B,eAAsB,EACpB,EACA,CACE,cAAc,EAAE,CAChB,SACA,gBAAgB,EAAE,CAClB,2BACA,WAAW,KAIT,EAAE,CACuD,CAC7D,IAAM,EACJ,EAAE,CAGE,EAAK,IAAI,MAAM,CAAC,SAAS,CAGzB,EAAc,IAAI,EAAY,UAAU,EAAE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