@transcend-io/cli 10.0.0 → 10.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/dist/{app-By_zDIkK.mjs → app-BfTrk2nc.mjs} +19 -19
  2. package/dist/{app-By_zDIkK.mjs.map → app-BfTrk2nc.mjs.map} +1 -1
  3. package/dist/{approvePrivacyRequests-1cguqGqq.mjs → approvePrivacyRequests-CWGZR2N6.mjs} +2 -2
  4. package/dist/{approvePrivacyRequests-1cguqGqq.mjs.map → approvePrivacyRequests-CWGZR2N6.mjs.map} +1 -1
  5. package/dist/bin/bash-complete.mjs +1 -1
  6. package/dist/bin/cli.mjs +1 -1
  7. package/dist/bin/deprecated-command.mjs +1 -1
  8. package/dist/{buildXdiSyncEndpoint-BMaMHO7Z.mjs → buildXdiSyncEndpoint-Cb-pvpak.mjs} +2 -2
  9. package/dist/{buildXdiSyncEndpoint-BMaMHO7Z.mjs.map → buildXdiSyncEndpoint-Cb-pvpak.mjs.map} +1 -1
  10. package/dist/{bulkRestartRequests-DEPSHov-.mjs → bulkRestartRequests-CKF_xpN0.mjs} +2 -2
  11. package/dist/{bulkRestartRequests-DEPSHov-.mjs.map → bulkRestartRequests-CKF_xpN0.mjs.map} +1 -1
  12. package/dist/{bulkRetryEnrichers-BLkcFKXC.mjs → bulkRetryEnrichers-B-Szmin-.mjs} +2 -2
  13. package/dist/{bulkRetryEnrichers-BLkcFKXC.mjs.map → bulkRetryEnrichers-B-Szmin-.mjs.map} +1 -1
  14. package/dist/{cancelPrivacyRequests-C8MZQvsq.mjs → cancelPrivacyRequests-DNiL13E_.mjs} +2 -2
  15. package/dist/{cancelPrivacyRequests-C8MZQvsq.mjs.map → cancelPrivacyRequests-DNiL13E_.mjs.map} +1 -1
  16. package/dist/{command-BUnCUxva.mjs → command-BXxoAjFo.mjs} +2 -2
  17. package/dist/{command-BUnCUxva.mjs.map → command-BXxoAjFo.mjs.map} +1 -1
  18. package/dist/{createExtraKeyHandler-C_0EVj10.mjs → createExtraKeyHandler-tubeaEjA.mjs} +2 -2
  19. package/dist/createExtraKeyHandler-tubeaEjA.mjs.map +1 -0
  20. package/dist/{createPreferenceAccessTokens-6WLr6z-l.mjs → createPreferenceAccessTokens-DqmFctn3.mjs} +2 -2
  21. package/dist/{createPreferenceAccessTokens-6WLr6z-l.mjs.map → createPreferenceAccessTokens-DqmFctn3.mjs.map} +1 -1
  22. package/dist/{createSombraGotInstance-CahOgD6V.mjs → createSombraGotInstance-D1Il9zUE.mjs} +2 -2
  23. package/dist/{createSombraGotInstance-CahOgD6V.mjs.map → createSombraGotInstance-D1Il9zUE.mjs.map} +1 -1
  24. package/dist/{downloadPrivacyRequestFiles-B2yduagB.mjs → downloadPrivacyRequestFiles-DlpgxqHF.mjs} +2 -2
  25. package/dist/{downloadPrivacyRequestFiles-B2yduagB.mjs.map → downloadPrivacyRequestFiles-DlpgxqHF.mjs.map} +1 -1
  26. package/dist/{fetchAllActions-C0l3wjQV.mjs → fetchAllActions-BJsPdnxy.mjs} +2 -2
  27. package/dist/{fetchAllActions-C0l3wjQV.mjs.map → fetchAllActions-BJsPdnxy.mjs.map} +1 -1
  28. package/dist/{fetchAllDataFlows-AQ9j_NRa.mjs → fetchAllDataFlows-D248lO6_.mjs} +2 -2
  29. package/dist/{fetchAllDataFlows-AQ9j_NRa.mjs.map → fetchAllDataFlows-D248lO6_.mjs.map} +1 -1
  30. package/dist/{fetchAllPreferenceTopics-Bn9PG-rO.mjs → fetchAllPreferenceTopics-ForE9GpZ.mjs} +2 -2
  31. package/dist/{fetchAllPreferenceTopics-Bn9PG-rO.mjs.map → fetchAllPreferenceTopics-ForE9GpZ.mjs.map} +1 -1
  32. package/dist/{fetchAllPurposes-CykSkZRY.mjs → fetchAllPurposes-ZdkO2fMp.mjs} +2 -2
  33. package/dist/{fetchAllPurposes-CykSkZRY.mjs.map → fetchAllPurposes-ZdkO2fMp.mjs.map} +1 -1
  34. package/dist/fetchAllPurposesAndPreferences-DD6OyA5t.mjs +2 -0
  35. package/dist/{fetchAllPurposesAndPreferences-Dog6N9L2.mjs.map → fetchAllPurposesAndPreferences-DD6OyA5t.mjs.map} +1 -1
  36. package/dist/{fetchAllRequestEnrichers-q34mRuE5.mjs → fetchAllRequestEnrichers-CK-kk5eg.mjs} +2 -2
  37. package/dist/{fetchAllRequestEnrichers-q34mRuE5.mjs.map → fetchAllRequestEnrichers-CK-kk5eg.mjs.map} +1 -1
  38. package/dist/{fetchAllRequestIdentifiers-YP-geTV4.mjs → fetchAllRequestIdentifiers-DrFFOt0m.mjs} +2 -2
  39. package/dist/{fetchAllRequestIdentifiers-YP-geTV4.mjs.map → fetchAllRequestIdentifiers-DrFFOt0m.mjs.map} +1 -1
  40. package/dist/{fetchAllRequests-DEPTEUbi.mjs → fetchAllRequests-DNQQsY4s.mjs} +2 -2
  41. package/dist/{fetchAllRequests-DEPTEUbi.mjs.map → fetchAllRequests-DNQQsY4s.mjs.map} +1 -1
  42. package/dist/{fetchApiKeys-DkBco7W0.mjs → fetchApiKeys-DjOr44xA.mjs} +2 -2
  43. package/dist/{fetchApiKeys-DkBco7W0.mjs.map → fetchApiKeys-DjOr44xA.mjs.map} +1 -1
  44. package/dist/{fetchCatalogs-CBk871k6.mjs → fetchCatalogs-BM4FCbcS.mjs} +2 -2
  45. package/dist/{fetchCatalogs-CBk871k6.mjs.map → fetchCatalogs-BM4FCbcS.mjs.map} +1 -1
  46. package/dist/{fetchConsentManagerId-DHDA5Py9.mjs → fetchConsentManagerId-CFkg3-RS.mjs} +2 -2
  47. package/dist/{fetchConsentManagerId-DHDA5Py9.mjs.map → fetchConsentManagerId-CFkg3-RS.mjs.map} +1 -1
  48. package/dist/{fetchIdentifiers-DjqjUnaw.mjs → fetchIdentifiers-pjQV4vUg.mjs} +2 -2
  49. package/dist/{fetchIdentifiers-DjqjUnaw.mjs.map → fetchIdentifiers-pjQV4vUg.mjs.map} +1 -1
  50. package/dist/{fetchRequestDataSilo-CF6XOTQ-.mjs → fetchRequestDataSilo-P4yA7Lyc.mjs} +2 -2
  51. package/dist/{fetchRequestDataSilo-CF6XOTQ-.mjs.map → fetchRequestDataSilo-P4yA7Lyc.mjs.map} +1 -1
  52. package/dist/{fetchRequestFilesForRequest-DrHGOdih.mjs → fetchRequestFilesForRequest-BbxrEKFK.mjs} +2 -2
  53. package/dist/{fetchRequestFilesForRequest-DrHGOdih.mjs.map → fetchRequestFilesForRequest-BbxrEKFK.mjs.map} +1 -1
  54. package/dist/{generateCrossAccountApiKeys-F11uqpc5.mjs → generateCrossAccountApiKeys-Bxc_dzMG.mjs} +2 -2
  55. package/dist/{generateCrossAccountApiKeys-F11uqpc5.mjs.map → generateCrossAccountApiKeys-Bxc_dzMG.mjs.map} +1 -1
  56. package/dist/{impl-0ooudQ_J2.mjs → impl-4ltdSmpl2.mjs} +2 -2
  57. package/dist/{impl-0ooudQ_J2.mjs.map → impl-4ltdSmpl2.mjs.map} +1 -1
  58. package/dist/{impl-BzupMfJi.mjs → impl-B19fH75P.mjs} +2 -2
  59. package/dist/{impl-BzupMfJi.mjs.map → impl-B19fH75P.mjs.map} +1 -1
  60. package/dist/{impl-CdoTu8TH.mjs → impl-BBMjv5YQ.mjs} +2 -2
  61. package/dist/{impl-CdoTu8TH.mjs.map → impl-BBMjv5YQ.mjs.map} +1 -1
  62. package/dist/{impl-Cwj9LeEI.mjs → impl-BKH3QRLi.mjs} +2 -2
  63. package/dist/{impl-Cwj9LeEI.mjs.map → impl-BKH3QRLi.mjs.map} +1 -1
  64. package/dist/{impl-KV3yZaHz2.mjs → impl-BOUm7wly2.mjs} +2 -2
  65. package/dist/{impl-KV3yZaHz2.mjs.map → impl-BOUm7wly2.mjs.map} +1 -1
  66. package/dist/{impl-r8tHyAHB.mjs → impl-BUC4ZelU.mjs} +2 -2
  67. package/dist/{impl-r8tHyAHB.mjs.map → impl-BUC4ZelU.mjs.map} +1 -1
  68. package/dist/{impl-dEQtD5uE.mjs → impl-BhTCp0kg.mjs} +2 -2
  69. package/dist/{impl-dEQtD5uE.mjs.map → impl-BhTCp0kg.mjs.map} +1 -1
  70. package/dist/{impl-f4UPMoS_2.mjs → impl-BlHU1bbJ2.mjs} +2 -2
  71. package/dist/{impl-f4UPMoS_2.mjs.map → impl-BlHU1bbJ2.mjs.map} +1 -1
  72. package/dist/{impl-CXK-D84c.mjs → impl-BwjguKHC.mjs} +2 -2
  73. package/dist/{impl-CXK-D84c.mjs.map → impl-BwjguKHC.mjs.map} +1 -1
  74. package/dist/{impl-VHp2K2bg.mjs → impl-C2o0eDzJ.mjs} +2 -2
  75. package/dist/{impl-VHp2K2bg.mjs.map → impl-C2o0eDzJ.mjs.map} +1 -1
  76. package/dist/{impl-2FbPcOv_2.mjs → impl-C8HKnjw82.mjs} +2 -2
  77. package/dist/{impl-2FbPcOv_2.mjs.map → impl-C8HKnjw82.mjs.map} +1 -1
  78. package/dist/{impl-CMX0qQr_2.mjs → impl-CCUsnhoW2.mjs} +2 -2
  79. package/dist/{impl-CMX0qQr_2.mjs.map → impl-CCUsnhoW2.mjs.map} +1 -1
  80. package/dist/{impl-B8iVBYdg.mjs → impl-CCc-wXqD.mjs} +2 -2
  81. package/dist/{impl-B8iVBYdg.mjs.map → impl-CCc-wXqD.mjs.map} +1 -1
  82. package/dist/{impl-ArGeiHuz.mjs → impl-CMmyv1cl.mjs} +2 -2
  83. package/dist/{impl-ArGeiHuz.mjs.map → impl-CMmyv1cl.mjs.map} +1 -1
  84. package/dist/{impl-1U4QBT_L.mjs → impl-CNez1OAw.mjs} +2 -2
  85. package/dist/impl-CNez1OAw.mjs.map +1 -0
  86. package/dist/{impl-DZnSlfwn2.mjs → impl-CNykdy3e2.mjs} +2 -2
  87. package/dist/{impl-DZnSlfwn2.mjs.map → impl-CNykdy3e2.mjs.map} +1 -1
  88. package/dist/{impl--Lmj1RHh2.mjs → impl-CSChmq_t2.mjs} +2 -2
  89. package/dist/{impl--Lmj1RHh2.mjs.map → impl-CSChmq_t2.mjs.map} +1 -1
  90. package/dist/{impl-dlRlTYAQ.mjs → impl-Ce9K4OCp.mjs} +2 -2
  91. package/dist/{impl-dlRlTYAQ.mjs.map → impl-Ce9K4OCp.mjs.map} +1 -1
  92. package/dist/{impl-CoLIqiH-2.mjs → impl-ChCqHkOc2.mjs} +2 -2
  93. package/dist/{impl-CoLIqiH-2.mjs.map → impl-ChCqHkOc2.mjs.map} +1 -1
  94. package/dist/{impl-DXWN22xV.mjs → impl-CqEwwWeD.mjs} +2 -2
  95. package/dist/{impl-DXWN22xV.mjs.map → impl-CqEwwWeD.mjs.map} +1 -1
  96. package/dist/{impl-CeLfAnyA2.mjs → impl-CqXFyvgV2.mjs} +2 -2
  97. package/dist/{impl-CeLfAnyA2.mjs.map → impl-CqXFyvgV2.mjs.map} +1 -1
  98. package/dist/{impl-ph0q6K3i.mjs → impl-CxLSJk2P.mjs} +2 -2
  99. package/dist/{impl-ph0q6K3i.mjs.map → impl-CxLSJk2P.mjs.map} +1 -1
  100. package/dist/{impl-DhIyASha.mjs → impl-CzU9WTiW.mjs} +2 -2
  101. package/dist/{impl-DhIyASha.mjs.map → impl-CzU9WTiW.mjs.map} +1 -1
  102. package/dist/{impl-BpUksm1b2.mjs → impl-D9NjIwEi2.mjs} +2 -2
  103. package/dist/{impl-BpUksm1b2.mjs.map → impl-D9NjIwEi2.mjs.map} +1 -1
  104. package/dist/{impl-BkyC7nnu.mjs → impl-DEWXA_QC.mjs} +2 -2
  105. package/dist/{impl-BkyC7nnu.mjs.map → impl-DEWXA_QC.mjs.map} +1 -1
  106. package/dist/{impl-DgyjJ8RY2.mjs → impl-DGiPB5Vq2.mjs} +2 -2
  107. package/dist/{impl-DgyjJ8RY2.mjs.map → impl-DGiPB5Vq2.mjs.map} +1 -1
  108. package/dist/{impl-CyJBbyuF.mjs → impl-DGuwD_qz.mjs} +2 -2
  109. package/dist/{impl-CyJBbyuF.mjs.map → impl-DGuwD_qz.mjs.map} +1 -1
  110. package/dist/{impl-D6nwGrO8.mjs → impl-DGzvE8aJ.mjs} +2 -2
  111. package/dist/{impl-D6nwGrO8.mjs.map → impl-DGzvE8aJ.mjs.map} +1 -1
  112. package/dist/{impl-Bc8Es_bT.mjs → impl-DTp9OQIZ.mjs} +2 -2
  113. package/dist/{impl-Bc8Es_bT.mjs.map → impl-DTp9OQIZ.mjs.map} +1 -1
  114. package/dist/{impl-DGRuk3AB.mjs → impl-DhscnXSw.mjs} +2 -2
  115. package/dist/{impl-DGRuk3AB.mjs.map → impl-DhscnXSw.mjs.map} +1 -1
  116. package/dist/{impl-BWjBYTQZ.mjs → impl-Dk7MdX-1.mjs} +2 -2
  117. package/dist/{impl-BWjBYTQZ.mjs.map → impl-Dk7MdX-1.mjs.map} +1 -1
  118. package/dist/{impl-Dny1LX9A.mjs → impl-DsNPvet4.mjs} +2 -2
  119. package/dist/{impl-Dny1LX9A.mjs.map → impl-DsNPvet4.mjs.map} +1 -1
  120. package/dist/{impl-DcC8_dCy.mjs → impl-DxUFb0vv.mjs} +2 -2
  121. package/dist/{impl-DcC8_dCy.mjs.map → impl-DxUFb0vv.mjs.map} +1 -1
  122. package/dist/{impl-y1I9Muyc2.mjs → impl-JThkrXiI2.mjs} +2 -2
  123. package/dist/{impl-y1I9Muyc2.mjs.map → impl-JThkrXiI2.mjs.map} +1 -1
  124. package/dist/{impl-Cq_RqK0_2.mjs → impl-KDuBh4bu2.mjs} +2 -2
  125. package/dist/{impl-Cq_RqK0_2.mjs.map → impl-KDuBh4bu2.mjs.map} +1 -1
  126. package/dist/{impl-C05tQHSq.mjs → impl-MpkLBntW.mjs} +2 -2
  127. package/dist/{impl-C05tQHSq.mjs.map → impl-MpkLBntW.mjs.map} +1 -1
  128. package/dist/{impl-Zr8uLP_n.mjs → impl-P_NDC3cX.mjs} +2 -2
  129. package/dist/{impl-Zr8uLP_n.mjs.map → impl-P_NDC3cX.mjs.map} +1 -1
  130. package/dist/{impl-D-ldjJzl2.mjs → impl-c7rUQYDc2.mjs} +2 -2
  131. package/dist/{impl-D-ldjJzl2.mjs.map → impl-c7rUQYDc2.mjs.map} +1 -1
  132. package/dist/{impl-G1brwI4o.mjs → impl-fqOKTw5J.mjs} +2 -2
  133. package/dist/{impl-G1brwI4o.mjs.map → impl-fqOKTw5J.mjs.map} +1 -1
  134. package/dist/{impl-Dfc_yQML2.mjs → impl-oiBTZqQS2.mjs} +2 -2
  135. package/dist/{impl-Dfc_yQML2.mjs.map → impl-oiBTZqQS2.mjs.map} +1 -1
  136. package/dist/{impl-CWHnw3oX.mjs → impl-tbGnvKFm.mjs} +2 -2
  137. package/dist/{impl-CWHnw3oX.mjs.map → impl-tbGnvKFm.mjs.map} +1 -1
  138. package/dist/index.d.mts +3397 -3397
  139. package/dist/index.mjs +1 -1
  140. package/dist/{makeGraphQLRequest-G078PsEL.mjs → makeGraphQLRequest-Cq26A_Lq.mjs} +2 -2
  141. package/dist/{makeGraphQLRequest-G078PsEL.mjs.map → makeGraphQLRequest-Cq26A_Lq.mjs.map} +1 -1
  142. package/dist/{markRequestDataSiloIdsCompleted-DmAz-R0M.mjs → markRequestDataSiloIdsCompleted-DzqJ5MNY.mjs} +2 -2
  143. package/dist/{markRequestDataSiloIdsCompleted-DmAz-R0M.mjs.map → markRequestDataSiloIdsCompleted-DzqJ5MNY.mjs.map} +1 -1
  144. package/dist/{markSilentPrivacyRequests-s7_aBROE.mjs → markSilentPrivacyRequests-BKQUu6Ep.mjs} +2 -2
  145. package/dist/{markSilentPrivacyRequests-s7_aBROE.mjs.map → markSilentPrivacyRequests-BKQUu6Ep.mjs.map} +1 -1
  146. package/dist/{mergeTranscendInputs-C64BJsse.mjs → mergeTranscendInputs-DGC4xUGu.mjs} +2 -2
  147. package/dist/{mergeTranscendInputs-C64BJsse.mjs.map → mergeTranscendInputs-DGC4xUGu.mjs.map} +1 -1
  148. package/dist/{notifyPrivacyRequestsAdditionalTime-BvXIXZYu.mjs → notifyPrivacyRequestsAdditionalTime-TEHAJe4C.mjs} +2 -2
  149. package/dist/{notifyPrivacyRequestsAdditionalTime-BvXIXZYu.mjs.map → notifyPrivacyRequestsAdditionalTime-TEHAJe4C.mjs.map} +1 -1
  150. package/dist/package-C4J38oR1.mjs +2 -0
  151. package/dist/package-C4J38oR1.mjs.map +1 -0
  152. package/dist/{pullAllDatapoints-DiMWp8a7.mjs → pullAllDatapoints-Cntwuzw7.mjs} +2 -2
  153. package/dist/{pullAllDatapoints-DiMWp8a7.mjs.map → pullAllDatapoints-Cntwuzw7.mjs.map} +1 -1
  154. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs → pullChunkedCustomSiloOutstandingIdentifiers-BT-GZpT1.mjs} +2 -2
  155. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-BT-GZpT1.mjs.map} +1 -1
  156. package/dist/{pullConsentManagerMetrics-pFRPXTHJ.mjs → pullConsentManagerMetrics-FnhPEszu.mjs} +2 -2
  157. package/dist/{pullConsentManagerMetrics-pFRPXTHJ.mjs.map → pullConsentManagerMetrics-FnhPEszu.mjs.map} +1 -1
  158. package/dist/{pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs → pullManualEnrichmentIdentifiersToCsv-B_4REnga.mjs} +2 -2
  159. package/dist/{pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs.map → pullManualEnrichmentIdentifiersToCsv-B_4REnga.mjs.map} +1 -1
  160. package/dist/{pullTranscendConfiguration-D2cYlu6V.mjs → pullTranscendConfiguration-CqsgEf9A.mjs} +2 -2
  161. package/dist/{pullTranscendConfiguration-D2cYlu6V.mjs.map → pullTranscendConfiguration-CqsgEf9A.mjs.map} +1 -1
  162. package/dist/{pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs → pullUnstructuredSubDataPointRecommendations-DZd2q6S2.mjs} +2 -2
  163. package/dist/{pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs.map → pullUnstructuredSubDataPointRecommendations-DZd2q6S2.mjs.map} +1 -1
  164. package/dist/{pushCronIdentifiersFromCsv-C34TB9tG.mjs → pushCronIdentifiersFromCsv-D2saGR5i.mjs} +2 -2
  165. package/dist/{pushCronIdentifiersFromCsv-C34TB9tG.mjs.map → pushCronIdentifiersFromCsv-D2saGR5i.mjs.map} +1 -1
  166. package/dist/{pushManualEnrichmentIdentifiersFromCsv-CGS9E3Ft.mjs → pushManualEnrichmentIdentifiersFromCsv-DOvAzMyt.mjs} +2 -2
  167. package/dist/{pushManualEnrichmentIdentifiersFromCsv-CGS9E3Ft.mjs.map → pushManualEnrichmentIdentifiersFromCsv-DOvAzMyt.mjs.map} +1 -1
  168. package/dist/{removeUnverifiedRequestIdentifiers-pGGOFbfE.mjs → removeUnverifiedRequestIdentifiers-ChlwRmhd.mjs} +2 -2
  169. package/dist/{removeUnverifiedRequestIdentifiers-pGGOFbfE.mjs.map → removeUnverifiedRequestIdentifiers-ChlwRmhd.mjs.map} +1 -1
  170. package/dist/{retryRequestDataSilos-DXwN5uPw.mjs → retryRequestDataSilos-DnwXA1YZ.mjs} +2 -2
  171. package/dist/{retryRequestDataSilos-DXwN5uPw.mjs.map → retryRequestDataSilos-DnwXA1YZ.mjs.map} +1 -1
  172. package/dist/{skipPreflightJobs-BNQhuPZ8.mjs → skipPreflightJobs-jK5lNlmv.mjs} +2 -2
  173. package/dist/{skipPreflightJobs-BNQhuPZ8.mjs.map → skipPreflightJobs-jK5lNlmv.mjs.map} +1 -1
  174. package/dist/{skipRequestDataSilos-C39ji4lO.mjs → skipRequestDataSilos-DQGroOos.mjs} +2 -2
  175. package/dist/{skipRequestDataSilos-C39ji4lO.mjs.map → skipRequestDataSilos-DQGroOos.mjs.map} +1 -1
  176. package/dist/{streamPrivacyRequestsToCsv-C8lquiyd.mjs → streamPrivacyRequestsToCsv-BK07Bm-T.mjs} +2 -2
  177. package/dist/{streamPrivacyRequestsToCsv-C8lquiyd.mjs.map → streamPrivacyRequestsToCsv-BK07Bm-T.mjs.map} +1 -1
  178. package/dist/{syncCodePackages-BHgjfXCI.mjs → syncCodePackages-F-97FNjo.mjs} +2 -2
  179. package/dist/{syncCodePackages-BHgjfXCI.mjs.map → syncCodePackages-F-97FNjo.mjs.map} +1 -1
  180. package/dist/{syncCookies-CiLtxDFf.mjs → syncCookies-BxY36BeJ.mjs} +2 -2
  181. package/dist/{syncCookies-CiLtxDFf.mjs.map → syncCookies-BxY36BeJ.mjs.map} +1 -1
  182. package/dist/{syncDataFlows-DmBUs3G_.mjs → syncDataFlows-Cx5LZCen.mjs} +2 -2
  183. package/dist/{syncDataFlows-DmBUs3G_.mjs.map → syncDataFlows-Cx5LZCen.mjs.map} +1 -1
  184. package/dist/{syncTemplates-BNu1_dmW.mjs → syncTemplates-BrH7Yr0V.mjs} +2 -2
  185. package/dist/{syncTemplates-BNu1_dmW.mjs.map → syncTemplates-BrH7Yr0V.mjs.map} +1 -1
  186. package/dist/{updateConsentManagerVersionToLatest-BBMN94Hs.mjs → updateConsentManagerVersionToLatest-C221vAAw.mjs} +2 -2
  187. package/dist/{updateConsentManagerVersionToLatest-BBMN94Hs.mjs.map → updateConsentManagerVersionToLatest-C221vAAw.mjs.map} +1 -1
  188. package/dist/{uploadCookiesFromCsv-BKZx_E_2.mjs → uploadCookiesFromCsv-roHWekOP.mjs} +2 -2
  189. package/dist/{uploadCookiesFromCsv-BKZx_E_2.mjs.map → uploadCookiesFromCsv-roHWekOP.mjs.map} +1 -1
  190. package/dist/{uploadDataFlowsFromCsv-CJFVLvCJ.mjs → uploadDataFlowsFromCsv-DcTbrsv2.mjs} +2 -2
  191. package/dist/{uploadDataFlowsFromCsv-CJFVLvCJ.mjs.map → uploadDataFlowsFromCsv-DcTbrsv2.mjs.map} +1 -1
  192. package/dist/{uploadPrivacyRequestsFromCsv-BmP1JluQ.mjs → uploadPrivacyRequestsFromCsv-BUGTS-pY.mjs} +2 -2
  193. package/dist/{uploadPrivacyRequestsFromCsv-BmP1JluQ.mjs.map → uploadPrivacyRequestsFromCsv-BUGTS-pY.mjs.map} +1 -1
  194. package/dist/{uploadSiloDiscoveryResults-XpDp2u35.mjs → uploadSiloDiscoveryResults-D2fK92WR.mjs} +2 -2
  195. package/dist/{uploadSiloDiscoveryResults-XpDp2u35.mjs.map → uploadSiloDiscoveryResults-D2fK92WR.mjs.map} +1 -1
  196. package/dist/{withPreferenceRetry-Cb5S310L.mjs → withPreferenceRetry-xLMZyTq9.mjs} +2 -2
  197. package/dist/{withPreferenceRetry-Cb5S310L.mjs.map → withPreferenceRetry-xLMZyTq9.mjs.map} +1 -1
  198. package/package.json +7 -7
  199. package/dist/createExtraKeyHandler-C_0EVj10.mjs.map +0 -1
  200. package/dist/fetchAllPurposesAndPreferences-Dog6N9L2.mjs +0 -2
  201. package/dist/impl-1U4QBT_L.mjs.map +0 -1
  202. package/dist/package-BjNQxHlz.mjs +0 -2
  203. package/dist/package-BjNQxHlz.mjs.map +0 -1
@@ -1 +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,EAAG,IAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC,CC1TnE,eAAsB,GACpB,EAC+B,CAC/B,IAAM,EAA4C,EAAE,CAChD,EAAS,EAET,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,wBAAyB,CAAE,UACzB,MAAM,EAMP,EAAQ,EAAs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MAAM,eACvD,CACD,EAAE,CACN,GAAI,EAAU,qBAAqB,OAAS,EACxC,CACE,yBAA0B,GACxB,GAAM,EAAU,qBAAsB,cAAc,CACnD,GACC,EAAyB,gBACzB,EAAyB,OACzB,IAAA,GACH,CACF,CACD,EAAE,CACN,GAAI,EAAU,cAAc,OAAS,EACjC,CACE,OAAQ,EAAU,cACf,IACE,IAAuB,CACtB,IAAK,EAAM,KACX,YAAa,EAAM,YACnB,SAAU,EAAM,SAChB,WAAY,EAAM,WAClB,GAAI,GAA4B,EAAM,uBAClC,CACE,qBAAsB,EAAM,uBACzB,OAAQ,GAAU,EAAM,SAAW,UAAU,CAC7C,IAAK,IAAW,CACf,SAAU,CACR,KAAM,EAAM,SAAS,KACrB,SAAU,EAAM,SAAS,SAC1B,CACD,OAAQ,EAAM,OACd,WAAY,EAAM,WAClB,kBAAmB,EAAM,mBAAqB,IAAA,GAC/C,EAAE,CACN,CACD,EAAE,CACN,oCAAqC,EAAM,+BAC3C,oCAAqC,EAAM,+BAC3C,WACE,EAAM,kBAAoB,IAAA,IAAa,EAAM,gBAAgB,OAAS,EAClE,EAAsB,EAAM,gBAAgB,CAC5C,IAAA,GACP,EACF,CACA,MAAM,EAAG,IAAM,EAAE,IAAI,cAAc,EAAE,IAAI,CAAC,CAC9C,CACD,EAAE,CACN,kBAAmB,EAAU,eAC1B,QAAQ,CAAE,YAAa,EAAO,CAC9B,KAAK,CAAE,UAAW,EAAK,CAC3B,EACF,CACA,MAAM,EAAG,IACR,CAAC,GAAI,EAAE,MAAQ,EAAE,CAAG,EAAE,IAAI,CACvB,KAAK,IAAI,CACT,cAAc,CAAC,GAAI,EAAE,MAAQ,EAAE,CAAG,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,CACvD,CACJ,EACF,CAEH,OAAO"}
1
+ {"version":3,"file":"pullTranscendConfiguration-CqsgEf9A.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,CA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,IAAA,GACP,EACF,CACA,MAAM,EAAG,IAAM,EAAE,IAAI,cAAc,EAAE,IAAI,CAAC,CAC9C,CACD,EAAE,CACN,kBAAmB,EAAU,eAC1B,QAAQ,CAAE,YAAa,EAAO,CAC9B,KAAK,CAAE,UAAW,EAAK,CAC3B,EACF,CACA,MAAM,EAAG,IACR,CAAC,GAAI,EAAE,MAAQ,EAAE,CAAG,EAAE,IAAI,CACvB,KAAK,IAAI,CACT,cAAc,CAAC,GAAI,EAAE,MAAQ,EAAE,CAAG,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,CACvD,CACJ,EACF,CAEH,OAAO"}
@@ -1,4 +1,4 @@
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`
1
+ import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./makeGraphQLRequest-Cq26A_Lq.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
2
  query TranscendCliEntryCount($filterBy: UnstructuredSubDataPointRecommendationsFilterInput) {
3
3
  unstructuredSubDataPointRecommendations(filterBy: $filterBy, useMaster: false) {
4
4
  totalCount
@@ -35,4 +35,4 @@ import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./makeGraphQLRequest-G07
35
35
  }
36
36
  }
37
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
38
+ //# sourceMappingURL=pullUnstructuredSubDataPointRecommendations-DZd2q6S2.mjs.map
@@ -1 +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,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAW,CACf,GAAI,EAAc,OAAS,EAAI,CAAE,eAAgB,EAAe,CAAG,EAAE,CACrE,GAAI,EAAS,CAAE,SAAQ,CAAG,EAAE,CAC5B,GAAI,EAAY,OAAS,EAAI,CAAE,UAAW,EAAa,CAAG,EAAE,CAC7D,CAGK,CACJ,wCAAyC,CAAE,eACzC,MAAM,EAMP,EAAQ,EAAa,CACtB,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,wCAAyC,CAAE,UACzC,MAAM,EAOR,EACA,CAAG;;;;;;;;;;;;;;;;;kBAiBO,EAA2B,OAAS,GAAG;kBACvC,EAA2B,iBAAmB,GAAG;;;;;;;;;;;;UAa3D,CACE,MAAO,EACP,SACA,SAAU,CACR,GAAG,EACJ,CACF,CACF,CAED,EAAS,EAAM,EAAM,OAAS,IAAI,GAClC,EAAwC,KAAK,GAAG,EAAM,CACtD,EAAiB,EAAM,SAAW,EAClC,GAAS,EAAM,OACf,GAAU,EAAM,OAChB,EAAY,OAAO,EAAM,OAClB,EAAK,CAIZ,MAHA,EAAO,MACL,EAAO,IAAI,8CAA8C,EAAO,cAAc,IAAS,CACxF,CACK,QAED,GAET,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAEjB,EAAS,EAAO,EAAyC,OAAO,CAOtE,OALA,EAAO,KACL,EAAO,MACL,0BAA0B,EAAO,OAAO,oBAAoB,EAAY,IAAK,WAC9E,CACF,CACM"}
1
+ {"version":3,"file":"pullUnstructuredSubDataPointRecommendations-DZd2q6S2.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,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAW,CACf,GAAI,EAAc,OAAS,EAAI,CAAE,eAAgB,EAAe,CAAG,EAAE,CACrE,GAAI,EAAS,CAAE,SAAQ,CAAG,EAAE,CAC5B,GAAI,EAAY,OAAS,EAAI,CAAE,UAAW,EAAa,CAAG,EAAE,CAC7D,CAGK,CACJ,wCAAyC,CAAE,eACzC,MAAM,EAMP,EAAQ,EAAa,CACtB,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,wCAAyC,CAAE,UACzC,MAAM,EAOR,EACA,CAAG;;;;;;;;;;;;;;;;;kBAiBO,EAA2B,OAAS,GAAG;kBACvC,EAA2B,iBAAmB,GAAG;;;;;;;;;;;;UAa3D,CACE,MAAO,EACP,SAC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