@transcend-io/cli 10.22.1 → 10.23.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 (293) hide show
  1. package/README.md +92 -86
  2. package/dist/app-BJ1QlNA0.mjs +131 -0
  3. package/dist/app-BJ1QlNA0.mjs.map +1 -0
  4. package/dist/{approvePrivacyRequests-CY6dRaiJ.mjs → approvePrivacyRequests-C2EflZEJ.mjs} +2 -2
  5. package/dist/{approvePrivacyRequests-CY6dRaiJ.mjs.map → approvePrivacyRequests-C2EflZEJ.mjs.map} +1 -1
  6. package/dist/bin/bash-complete.mjs +1 -1
  7. package/dist/bin/cli.mjs +1 -1
  8. package/dist/bin/deprecated-command.mjs +1 -1
  9. package/dist/{buildExamples-Dyfixa8C.mjs → buildExamples-DnV_tVZt.mjs} +2 -2
  10. package/dist/{buildExamples-Dyfixa8C.mjs.map → buildExamples-DnV_tVZt.mjs.map} +1 -1
  11. package/dist/{buildXdiSyncEndpoint-Cz2LSRjW.mjs → buildXdiSyncEndpoint-BYtXQ3Um.mjs} +2 -2
  12. package/dist/{buildXdiSyncEndpoint-Cz2LSRjW.mjs.map → buildXdiSyncEndpoint-BYtXQ3Um.mjs.map} +1 -1
  13. package/dist/{bulkRestartRequests-Dj3W8Smy.mjs → bulkRestartRequests-DROZyl0s.mjs} +2 -2
  14. package/dist/{bulkRestartRequests-Dj3W8Smy.mjs.map → bulkRestartRequests-DROZyl0s.mjs.map} +1 -1
  15. package/dist/{bulkRetryEnrichers-D6j9Ivc0.mjs → bulkRetryEnrichers-DHIt_YpU.mjs} +2 -2
  16. package/dist/{bulkRetryEnrichers-D6j9Ivc0.mjs.map → bulkRetryEnrichers-DHIt_YpU.mjs.map} +1 -1
  17. package/dist/{cancelPrivacyRequests-HT5NvgGF.mjs → cancelPrivacyRequests-DUmxmMsv.mjs} +2 -2
  18. package/dist/{cancelPrivacyRequests-HT5NvgGF.mjs.map → cancelPrivacyRequests-DUmxmMsv.mjs.map} +1 -1
  19. package/dist/codecs-Dch3sv5m.mjs +2 -0
  20. package/dist/codecs-Dch3sv5m.mjs.map +1 -0
  21. package/dist/{collectCsvFilesOrExit-BQdnr-m2.mjs → collectCsvFilesOrExit-C8-Pr9Hr.mjs} +2 -2
  22. package/dist/{collectCsvFilesOrExit-BQdnr-m2.mjs.map → collectCsvFilesOrExit-C8-Pr9Hr.mjs.map} +1 -1
  23. package/dist/{collectParquetFilesOrExit-BJ-GciNy.mjs → collectParquetFilesOrExit-DyZISY9X.mjs} +2 -2
  24. package/dist/{collectParquetFilesOrExit-BJ-GciNy.mjs.map → collectParquetFilesOrExit-DyZISY9X.mjs.map} +1 -1
  25. package/dist/{command-CJVah-g5.mjs → command-DsPVpqxX.mjs} +2 -2
  26. package/dist/{command-CJVah-g5.mjs.map → command-DsPVpqxX.mjs.map} +1 -1
  27. package/dist/commands/admin/chunk-csv/worker.mjs +1 -1
  28. package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
  29. package/dist/{consentManagersToBusinessEntities-l8jRfpYN.mjs → consentManagersToBusinessEntities-DGzryQ3W.mjs} +2 -2
  30. package/dist/{consentManagersToBusinessEntities-l8jRfpYN.mjs.map → consentManagersToBusinessEntities-DGzryQ3W.mjs.map} +1 -1
  31. package/dist/{constants-DXUo-hl3.mjs → constants-B44yUGaB.mjs} +2 -2
  32. package/dist/{constants-DXUo-hl3.mjs.map → constants-B44yUGaB.mjs.map} +1 -1
  33. package/dist/constants-CEPYyv4h.mjs +2 -0
  34. package/dist/constants-CEPYyv4h.mjs.map +1 -0
  35. package/dist/{constants-BhZIv-FP.mjs → constants-FbK2iR--.mjs} +1 -1
  36. package/dist/{constants-BhZIv-FP.mjs.map → constants-FbK2iR--.mjs.map} +1 -1
  37. package/dist/{constants-KYaYveEQ.mjs → constants-ykNINvFg.mjs} +1 -1
  38. package/dist/{constants-KYaYveEQ.mjs.map → constants-ykNINvFg.mjs.map} +1 -1
  39. package/dist/{context-CdSyuBlf.mjs → context-Br0NHHOk.mjs} +1 -1
  40. package/dist/{context-CdSyuBlf.mjs.map → context-Br0NHHOk.mjs.map} +1 -1
  41. package/dist/{createExtraKeyHandler-CuarjDkw.mjs → createExtraKeyHandler-CJRmK224.mjs} +2 -2
  42. package/dist/{createExtraKeyHandler-CuarjDkw.mjs.map → createExtraKeyHandler-CJRmK224.mjs.map} +1 -1
  43. package/dist/{dataFlowsToDataSilos-Blo6-adp.mjs → dataFlowsToDataSilos-DRGrUosf.mjs} +1 -1
  44. package/dist/{dataFlowsToDataSilos-Blo6-adp.mjs.map → dataFlowsToDataSilos-DRGrUosf.mjs.map} +1 -1
  45. package/dist/{done-input-validation-CvwjeRWr.mjs → done-input-validation-uqIgnJcw.mjs} +1 -1
  46. package/dist/{done-input-validation-CvwjeRWr.mjs.map → done-input-validation-uqIgnJcw.mjs.map} +1 -1
  47. package/dist/{downloadPrivacyRequestFiles-Cn-cm-QI.mjs → downloadPrivacyRequestFiles-BX85Pey2.mjs} +2 -2
  48. package/dist/{downloadPrivacyRequestFiles-Cn-cm-QI.mjs.map → downloadPrivacyRequestFiles-BX85Pey2.mjs.map} +1 -1
  49. package/dist/{extractClientError-CaF_Kj-f.mjs → extractClientError-X9wJVqGq.mjs} +1 -1
  50. package/dist/{extractClientError-CaF_Kj-f.mjs.map → extractClientError-X9wJVqGq.mjs.map} +1 -1
  51. package/dist/{fetchAllRequests-BCHpCeFo.mjs → fetchAllRequests-Bya6iwzL.mjs} +2 -2
  52. package/dist/{fetchAllRequests-BCHpCeFo.mjs.map → fetchAllRequests-Bya6iwzL.mjs.map} +1 -1
  53. package/dist/{formatPolicyBundleVersionSummary-DvxPXykZ.mjs → formatPolicyBundleVersionSummary-Bo7DYxoy.mjs} +1 -1
  54. package/dist/{formatPolicyBundleVersionSummary-DvxPXykZ.mjs.map → formatPolicyBundleVersionSummary-Bo7DYxoy.mjs.map} +1 -1
  55. package/dist/{fuzzyMatchColumns-Dym9eeQe.mjs → fuzzyMatchColumns-Ds0TqtJ5.mjs} +2 -2
  56. package/dist/{fuzzyMatchColumns-Dym9eeQe.mjs.map → fuzzyMatchColumns-Ds0TqtJ5.mjs.map} +1 -1
  57. package/dist/{generateCrossAccountApiKeys-Dh8X4a3W.mjs → generateCrossAccountApiKeys-DELmDKBr.mjs} +2 -2
  58. package/dist/{generateCrossAccountApiKeys-Dh8X4a3W.mjs.map → generateCrossAccountApiKeys-DELmDKBr.mjs.map} +1 -1
  59. package/dist/{impl-BCLxAEup.mjs → impl-1y382i4y.mjs} +2 -2
  60. package/dist/{impl-BCLxAEup.mjs.map → impl-1y382i4y.mjs.map} +1 -1
  61. package/dist/impl-3kG5jsbx.mjs +2 -0
  62. package/dist/{impl-RPen9vPS.mjs.map → impl-3kG5jsbx.mjs.map} +1 -1
  63. package/dist/{impl-D7wDuTnD.mjs → impl-6M90fU9c.mjs} +2 -2
  64. package/dist/{impl-D7wDuTnD.mjs.map → impl-6M90fU9c.mjs.map} +1 -1
  65. package/dist/impl-B0AKcSoy.mjs +2 -0
  66. package/dist/impl-B0AKcSoy.mjs.map +1 -0
  67. package/dist/{impl-IsvQznAE.mjs → impl-B2Um3cCa.mjs} +2 -2
  68. package/dist/{impl-IsvQznAE.mjs.map → impl-B2Um3cCa.mjs.map} +1 -1
  69. package/dist/impl-BCEw1fsj.mjs +3 -0
  70. package/dist/impl-BCEw1fsj.mjs.map +1 -0
  71. package/dist/{impl-GZe4ti1_2.mjs → impl-BHKNOzzl2.mjs} +2 -2
  72. package/dist/{impl-GZe4ti1_2.mjs.map → impl-BHKNOzzl2.mjs.map} +1 -1
  73. package/dist/impl-BTp6QWcY.mjs +3 -0
  74. package/dist/impl-BTp6QWcY.mjs.map +1 -0
  75. package/dist/{impl-BMU2cg0K.mjs → impl-BWenu3QG.mjs} +2 -2
  76. package/dist/{impl-BMU2cg0K.mjs.map → impl-BWenu3QG.mjs.map} +1 -1
  77. package/dist/{impl-aZEhTcLa.mjs → impl-BZ0aEWLg.mjs} +2 -2
  78. package/dist/{impl-aZEhTcLa.mjs.map → impl-BZ0aEWLg.mjs.map} +1 -1
  79. package/dist/{impl-BB8jBITw2.mjs → impl-BZXxpO912.mjs} +2 -2
  80. package/dist/{impl-BB8jBITw2.mjs.map → impl-BZXxpO912.mjs.map} +1 -1
  81. package/dist/impl-B_4_7a-i.mjs +3 -0
  82. package/dist/impl-B_4_7a-i.mjs.map +1 -0
  83. package/dist/{impl-CqAhgJRN.mjs → impl-BbIP694E.mjs} +2 -2
  84. package/dist/{impl-CqAhgJRN.mjs.map → impl-BbIP694E.mjs.map} +1 -1
  85. package/dist/{impl-jEFmv3UE.mjs → impl-BnJiEB-x.mjs} +2 -2
  86. package/dist/{impl-jEFmv3UE.mjs.map → impl-BnJiEB-x.mjs.map} +1 -1
  87. package/dist/{impl-CH_2Ay0I2.mjs → impl-Bxbu4It12.mjs} +2 -2
  88. package/dist/{impl-CH_2Ay0I2.mjs.map → impl-Bxbu4It12.mjs.map} +1 -1
  89. package/dist/{impl-DRLH1TnS.mjs → impl-BzyN0wbS2.mjs} +2 -2
  90. package/dist/impl-BzyN0wbS2.mjs.map +1 -0
  91. package/dist/impl-C5RWQxAV.mjs +3 -0
  92. package/dist/{impl-BU5epQoJ.mjs.map → impl-C5RWQxAV.mjs.map} +1 -1
  93. package/dist/{impl-ChIESsn-.mjs → impl-C69Nh_YS.mjs} +2 -2
  94. package/dist/{impl-ChIESsn-.mjs.map → impl-C69Nh_YS.mjs.map} +1 -1
  95. package/dist/impl-C7Xp0Txd.mjs +3 -0
  96. package/dist/impl-C7Xp0Txd.mjs.map +1 -0
  97. package/dist/impl-CEkTnggY2.mjs +2 -0
  98. package/dist/impl-CEkTnggY2.mjs.map +1 -0
  99. package/dist/{impl-D_1lQVRR2.mjs → impl-CLhItW5v2.mjs} +2 -2
  100. package/dist/{impl-D_1lQVRR2.mjs.map → impl-CLhItW5v2.mjs.map} +1 -1
  101. package/dist/{impl-MJ89a6cJ.mjs → impl-CdZ-nr1b.mjs} +2 -2
  102. package/dist/{impl-MJ89a6cJ.mjs.map → impl-CdZ-nr1b.mjs.map} +1 -1
  103. package/dist/{impl-X-lj6p6X.mjs → impl-Ce4Ua3nx.mjs} +3 -3
  104. package/dist/{impl-X-lj6p6X.mjs.map → impl-Ce4Ua3nx.mjs.map} +1 -1
  105. package/dist/{impl-BonZXKcP2.mjs → impl-ChO9Br2_2.mjs} +2 -2
  106. package/dist/{impl-BonZXKcP2.mjs.map → impl-ChO9Br2_2.mjs.map} +1 -1
  107. package/dist/{impl-spb5yfh5.mjs → impl-CiA-v1ol.mjs} +2 -2
  108. package/dist/{impl-spb5yfh5.mjs.map → impl-CiA-v1ol.mjs.map} +1 -1
  109. package/dist/impl-CjsLPYCP2.mjs +2 -0
  110. package/dist/impl-CjsLPYCP2.mjs.map +1 -0
  111. package/dist/{impl-F9isBn8P.mjs → impl-CpGmNKVh.mjs} +2 -2
  112. package/dist/{impl-F9isBn8P.mjs.map → impl-CpGmNKVh.mjs.map} +1 -1
  113. package/dist/{impl-FT-AX6eL2.mjs → impl-CsFbPjie2.mjs} +2 -2
  114. package/dist/{impl-FT-AX6eL2.mjs.map → impl-CsFbPjie2.mjs.map} +1 -1
  115. package/dist/{impl-C2SPhoeN.mjs → impl-CuAUD_Ij2.mjs} +2 -2
  116. package/dist/impl-CuAUD_Ij2.mjs.map +1 -0
  117. package/dist/impl-CwJx90K82.mjs +2 -0
  118. package/dist/impl-CwJx90K82.mjs.map +1 -0
  119. package/dist/{impl-DJwjZCcH.mjs → impl-D0rQ-_u_.mjs} +2 -2
  120. package/dist/{impl-DJwjZCcH.mjs.map → impl-D0rQ-_u_.mjs.map} +1 -1
  121. package/dist/impl-D6rMK5Us.mjs +2 -0
  122. package/dist/{impl-CwBLpuAJ.mjs.map → impl-D6rMK5Us.mjs.map} +1 -1
  123. package/dist/{impl-4gOELmu7.mjs → impl-DF8-QsO52.mjs} +2 -2
  124. package/dist/impl-DF8-QsO52.mjs.map +1 -0
  125. package/dist/impl-DGQW5mVR.mjs +2 -0
  126. package/dist/impl-DGQW5mVR.mjs.map +1 -0
  127. package/dist/{impl-UxzUmcgG2.mjs → impl-DJFPeUq32.mjs} +2 -2
  128. package/dist/{impl-UxzUmcgG2.mjs.map → impl-DJFPeUq32.mjs.map} +1 -1
  129. package/dist/impl-DLNk5Voe.mjs +4 -0
  130. package/dist/{impl-C-JpeZru.mjs.map → impl-DLNk5Voe.mjs.map} +1 -1
  131. package/dist/{impl-HrUgz4tG.mjs → impl-DMtn2boK.mjs} +2 -2
  132. package/dist/{impl-HrUgz4tG.mjs.map → impl-DMtn2boK.mjs.map} +1 -1
  133. package/dist/{impl-nePMEJkH.mjs → impl-DQ-kymSs.mjs} +2 -2
  134. package/dist/{impl-nePMEJkH.mjs.map → impl-DQ-kymSs.mjs.map} +1 -1
  135. package/dist/{impl-VZ5AFBNm.mjs → impl-D_Zke9vp.mjs} +2 -2
  136. package/dist/{impl-VZ5AFBNm.mjs.map → impl-D_Zke9vp.mjs.map} +1 -1
  137. package/dist/{impl-Clfzhtnt.mjs → impl-DvrO6Zrd.mjs} +2 -2
  138. package/dist/{impl-Clfzhtnt.mjs.map → impl-DvrO6Zrd.mjs.map} +1 -1
  139. package/dist/{impl-ZdDrknSR2.mjs → impl-E0CjQexl2.mjs} +2 -2
  140. package/dist/{impl-ZdDrknSR2.mjs.map → impl-E0CjQexl2.mjs.map} +1 -1
  141. package/dist/{impl-ukQtDFFF.mjs → impl-EmiQDBEx2.mjs} +2 -2
  142. package/dist/impl-EmiQDBEx2.mjs.map +1 -0
  143. package/dist/{impl-D5Gsgyj6.mjs → impl-IT4hoGkx.mjs} +2 -2
  144. package/dist/{impl-D5Gsgyj6.mjs.map → impl-IT4hoGkx.mjs.map} +1 -1
  145. package/dist/{impl-DQGV2G5v.mjs → impl-NUMkBg7d.mjs} +2 -2
  146. package/dist/{impl-DQGV2G5v.mjs.map → impl-NUMkBg7d.mjs.map} +1 -1
  147. package/dist/{impl-DJz0q9FW2.mjs → impl-ToUQkHVL2.mjs} +2 -2
  148. package/dist/{impl-DJz0q9FW2.mjs.map → impl-ToUQkHVL2.mjs.map} +1 -1
  149. package/dist/impl-WHaoeim8.mjs +2 -0
  150. package/dist/{impl-Bzn3FMBY.mjs.map → impl-WHaoeim8.mjs.map} +1 -1
  151. package/dist/{impl-Bq3ZIpcG.mjs → impl-Zjvt9J28.mjs} +2 -2
  152. package/dist/{impl-Bq3ZIpcG.mjs.map → impl-Zjvt9J28.mjs.map} +1 -1
  153. package/dist/{impl-DctprvAs.mjs → impl-_HlLHVRO.mjs} +2 -2
  154. package/dist/{impl-DctprvAs.mjs.map → impl-_HlLHVRO.mjs.map} +1 -1
  155. package/dist/{impl-CYiMx1--.mjs → impl-cMFtIJUY2.mjs} +2 -2
  156. package/dist/impl-cMFtIJUY2.mjs.map +1 -0
  157. package/dist/impl-fiK_rZ7c.mjs +2 -0
  158. package/dist/{impl-C0n31a_O.mjs.map → impl-fiK_rZ7c.mjs.map} +1 -1
  159. package/dist/{impl-DV68fyyl.mjs → impl-rKM9h7Vg.mjs} +2 -2
  160. package/dist/{impl-DV68fyyl.mjs.map → impl-rKM9h7Vg.mjs.map} +1 -1
  161. package/dist/{impl-BDE-0f_J2.mjs → impl-x_rM8yTw.mjs} +2 -2
  162. package/dist/impl-x_rM8yTw.mjs.map +1 -0
  163. package/dist/{impl-C515J-j7.mjs → impl-z5dBnPm5.mjs} +3 -3
  164. package/dist/{impl-C515J-j7.mjs.map → impl-z5dBnPm5.mjs.map} +1 -1
  165. package/dist/index.d.mts +87 -77
  166. package/dist/index.d.mts.map +1 -1
  167. package/dist/index.mjs +2 -2
  168. package/dist/index.mjs.map +1 -1
  169. package/dist/{inquirer-CXl1YWCs.mjs → inquirer-AEchly0b.mjs} +2 -2
  170. package/dist/{inquirer-CXl1YWCs.mjs.map → inquirer-AEchly0b.mjs.map} +1 -1
  171. package/dist/{listFiles-B1GqyM33.mjs → listFiles-BPx3iDV6.mjs} +1 -1
  172. package/dist/{listFiles-B1GqyM33.mjs.map → listFiles-BPx3iDV6.mjs.map} +1 -1
  173. package/dist/{logger-B-LXIf3U.mjs → logger-Ckep4QXn.mjs} +1 -1
  174. package/dist/{logger-B-LXIf3U.mjs.map → logger-Ckep4QXn.mjs.map} +1 -1
  175. package/dist/{markRequestDataSiloIdsCompleted-Dz8BpX68.mjs → markRequestDataSiloIdsCompleted-zFRxJN8D.mjs} +2 -2
  176. package/dist/{markRequestDataSiloIdsCompleted-Dz8BpX68.mjs.map → markRequestDataSiloIdsCompleted-zFRxJN8D.mjs.map} +1 -1
  177. package/dist/{markSilentPrivacyRequests-CNT4eigq.mjs → markSilentPrivacyRequests-t65ShOrn.mjs} +2 -2
  178. package/dist/{markSilentPrivacyRequests-CNT4eigq.mjs.map → markSilentPrivacyRequests-t65ShOrn.mjs.map} +1 -1
  179. package/dist/{notifyPrivacyRequestsAdditionalTime-D_MmmL_T.mjs → notifyPrivacyRequestsAdditionalTime-C7v7zo8q.mjs} +2 -2
  180. package/dist/{notifyPrivacyRequestsAdditionalTime-D_MmmL_T.mjs.map → notifyPrivacyRequestsAdditionalTime-C7v7zo8q.mjs.map} +1 -1
  181. package/dist/{parquetToCsvOneFile-DuyOOzqQ.mjs → parquetToCsvOneFile-13GirFzy.mjs} +2 -2
  182. package/dist/{parquetToCsvOneFile-DuyOOzqQ.mjs.map → parquetToCsvOneFile-13GirFzy.mjs.map} +1 -1
  183. package/dist/{parseAttributesFromString-ByzY22WY.mjs → parseAttributesFromString-CYcxsS3n.mjs} +2 -2
  184. package/dist/{parseAttributesFromString-ByzY22WY.mjs.map → parseAttributesFromString-CYcxsS3n.mjs.map} +1 -1
  185. package/dist/{parseVariablesFromString-CfXnITrG.mjs → parseVariablesFromString-RM3zV9Av.mjs} +3 -3
  186. package/dist/{parseVariablesFromString-CfXnITrG.mjs.map → parseVariablesFromString-RM3zV9Av.mjs.map} +1 -1
  187. package/dist/policyEngineCliError-BnBghLd1.mjs +3 -0
  188. package/dist/policyEngineCliError-BnBghLd1.mjs.map +1 -0
  189. package/dist/printResult-oXnpZu_9.mjs +33 -0
  190. package/dist/printResult-oXnpZu_9.mjs.map +1 -0
  191. package/dist/{pullAllDatapoints-D8mTXHun.mjs → pullAllDatapoints-Bvv9KRR5.mjs} +2 -2
  192. package/dist/{pullAllDatapoints-D8mTXHun.mjs.map → pullAllDatapoints-Bvv9KRR5.mjs.map} +1 -1
  193. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DbzbpVC5.mjs → pullChunkedCustomSiloOutstandingIdentifiers-io0k95RW.mjs} +2 -2
  194. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DbzbpVC5.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-io0k95RW.mjs.map} +1 -1
  195. package/dist/{pullConsentManagerMetrics-Cma2auCK.mjs → pullConsentManagerMetrics-CR4WwUt6.mjs} +2 -2
  196. package/dist/{pullConsentManagerMetrics-Cma2auCK.mjs.map → pullConsentManagerMetrics-CR4WwUt6.mjs.map} +1 -1
  197. package/dist/{pullManualEnrichmentIdentifiersToCsv-DV72-Ood.mjs → pullManualEnrichmentIdentifiersToCsv-CzhDjPw2.mjs} +2 -2
  198. package/dist/{pullManualEnrichmentIdentifiersToCsv-DV72-Ood.mjs.map → pullManualEnrichmentIdentifiersToCsv-CzhDjPw2.mjs.map} +1 -1
  199. package/dist/pullTranscendConfiguration-C2LAOKG4.mjs +58 -0
  200. package/dist/pullTranscendConfiguration-C2LAOKG4.mjs.map +1 -0
  201. package/dist/{pullUnstructuredSubDataPointRecommendations-DkQMoo7S.mjs → pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs} +2 -2
  202. package/dist/{pullUnstructuredSubDataPointRecommendations-DkQMoo7S.mjs.map → pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs.map} +1 -1
  203. package/dist/{pushCronIdentifiersFromCsv-Cc-POoSS.mjs → pushCronIdentifiersFromCsv-CehtFgXS.mjs} +2 -2
  204. package/dist/{pushCronIdentifiersFromCsv-Cc-POoSS.mjs.map → pushCronIdentifiersFromCsv-CehtFgXS.mjs.map} +1 -1
  205. package/dist/{pushManualEnrichmentIdentifiersFromCsv-C1k2t27x.mjs → pushManualEnrichmentIdentifiersFromCsv-CAl_kfHY.mjs} +2 -2
  206. package/dist/{pushManualEnrichmentIdentifiersFromCsv-C1k2t27x.mjs.map → pushManualEnrichmentIdentifiersFromCsv-CAl_kfHY.mjs.map} +1 -1
  207. package/dist/{readCsv-D1e7WRTc.mjs → readCsv-C84Jhrzx.mjs} +1 -1
  208. package/dist/{readCsv-D1e7WRTc.mjs.map → readCsv-C84Jhrzx.mjs.map} +1 -1
  209. package/dist/{readTranscendYaml-B1FLjET0.mjs → readTranscendYaml-dI3G3Og9.mjs} +2 -2
  210. package/dist/{readTranscendYaml-B1FLjET0.mjs.map → readTranscendYaml-dI3G3Og9.mjs.map} +1 -1
  211. package/dist/{removeUnverifiedRequestIdentifiers-CoqOTue3.mjs → removeUnverifiedRequestIdentifiers-CApHXROq.mjs} +2 -2
  212. package/dist/{removeUnverifiedRequestIdentifiers-CoqOTue3.mjs.map → removeUnverifiedRequestIdentifiers-CApHXROq.mjs.map} +1 -1
  213. package/dist/{renderTable-BgjVr6ch.mjs → renderTable-DKXvortp.mjs} +1 -1
  214. package/dist/{renderTable-BgjVr6ch.mjs.map → renderTable-DKXvortp.mjs.map} +1 -1
  215. package/dist/{request-C4gYxn1p.mjs → request-BIplTb3L.mjs} +1 -1
  216. package/dist/{request-C4gYxn1p.mjs.map → request-BIplTb3L.mjs.map} +1 -1
  217. package/dist/resolveBundleIdByName-By5Vl8Iz.mjs +2 -0
  218. package/dist/resolveBundleIdByName-By5Vl8Iz.mjs.map +1 -0
  219. package/dist/resolvePolicyBundleVersion-DO7IvEwb.mjs +2 -0
  220. package/dist/resolvePolicyBundleVersion-DO7IvEwb.mjs.map +1 -0
  221. package/dist/{retryRequestDataSilos-46M0IjN_.mjs → retryRequestDataSilos-Tou-97EC.mjs} +2 -2
  222. package/dist/{retryRequestDataSilos-46M0IjN_.mjs.map → retryRequestDataSilos-Tou-97EC.mjs.map} +1 -1
  223. package/dist/{runOpa-DGUkXzFZ.mjs → runOpa-D511z37u.mjs} +2 -2
  224. package/dist/{runOpa-DGUkXzFZ.mjs.map → runOpa-D511z37u.mjs.map} +1 -1
  225. package/dist/{skipPreflightJobs-C5CAhy9W.mjs → skipPreflightJobs-TL4bpgJ5.mjs} +2 -2
  226. package/dist/{skipPreflightJobs-C5CAhy9W.mjs.map → skipPreflightJobs-TL4bpgJ5.mjs.map} +1 -1
  227. package/dist/{skipRequestDataSilos-BeIEyLtB.mjs → skipRequestDataSilos-D4DQNs2F.mjs} +2 -2
  228. package/dist/{skipRequestDataSilos-BeIEyLtB.mjs.map → skipRequestDataSilos-D4DQNs2F.mjs.map} +1 -1
  229. package/dist/{streamPrivacyRequestsToCsv-GBm5edD3.mjs → streamPrivacyRequestsToCsv-BW7LayDe.mjs} +2 -2
  230. package/dist/{streamPrivacyRequestsToCsv-GBm5edD3.mjs.map → streamPrivacyRequestsToCsv-BW7LayDe.mjs.map} +1 -1
  231. package/dist/{syncCodePackages-CwPtA473.mjs → syncCodePackages-Dhm5jI6B.mjs} +2 -2
  232. package/dist/{syncCodePackages-CwPtA473.mjs.map → syncCodePackages-Dhm5jI6B.mjs.map} +1 -1
  233. package/dist/{updateConsentManagerVersionToLatest-CUu1TzQR.mjs → updateConsentManagerVersionToLatest-D22lm-RZ.mjs} +2 -2
  234. package/dist/{updateConsentManagerVersionToLatest-CUu1TzQR.mjs.map → updateConsentManagerVersionToLatest-D22lm-RZ.mjs.map} +1 -1
  235. package/dist/{uploadConsents-Bj6r4M0K.mjs → uploadConsents-7V2GfdKQ.mjs} +2 -2
  236. package/dist/{uploadConsents-Bj6r4M0K.mjs.map → uploadConsents-7V2GfdKQ.mjs.map} +1 -1
  237. package/dist/{uploadCookiesFromCsv-C50gkbUb.mjs → uploadCookiesFromCsv-AyQGnKOP.mjs} +2 -2
  238. package/dist/{uploadCookiesFromCsv-C50gkbUb.mjs.map → uploadCookiesFromCsv-AyQGnKOP.mjs.map} +1 -1
  239. package/dist/{uploadDataFlowsFromCsv-7a3Niqzl.mjs → uploadDataFlowsFromCsv-4Uw_-6pw.mjs} +2 -2
  240. package/dist/{uploadDataFlowsFromCsv-7a3Niqzl.mjs.map → uploadDataFlowsFromCsv-4Uw_-6pw.mjs.map} +1 -1
  241. package/dist/{uploadPrivacyRequestsFromCsv-C2EgMu_d.mjs → uploadPrivacyRequestsFromCsv-DuDL3uOz.mjs} +2 -2
  242. package/dist/{uploadPrivacyRequestsFromCsv-C2EgMu_d.mjs.map → uploadPrivacyRequestsFromCsv-DuDL3uOz.mjs.map} +1 -1
  243. package/dist/{validateTranscendAuth-D14jsB5C.mjs → validateTranscendAuth-DhzCBA3F.mjs} +2 -2
  244. package/dist/{validateTranscendAuth-D14jsB5C.mjs.map → validateTranscendAuth-DhzCBA3F.mjs.map} +1 -1
  245. package/dist/{writeCsv-DDKM_rAU.mjs → writeCsv-BMVkiMHM.mjs} +1 -1
  246. package/dist/{writeCsv-DDKM_rAU.mjs.map → writeCsv-BMVkiMHM.mjs.map} +1 -1
  247. package/package.json +4 -4
  248. package/dist/app-CaKX0swF.mjs +0 -131
  249. package/dist/app-CaKX0swF.mjs.map +0 -1
  250. package/dist/codecs-_SjJhduF.mjs +0 -2
  251. package/dist/codecs-_SjJhduF.mjs.map +0 -1
  252. package/dist/constants-cBzX_zyl.mjs +0 -2
  253. package/dist/constants-cBzX_zyl.mjs.map +0 -1
  254. package/dist/formatPolicyEngineRequestError-Dn_VYIIj.mjs +0 -2
  255. package/dist/formatPolicyEngineRequestError-Dn_VYIIj.mjs.map +0 -1
  256. package/dist/impl-4gOELmu7.mjs.map +0 -1
  257. package/dist/impl-BDE-0f_J2.mjs.map +0 -1
  258. package/dist/impl-BJ0wcQ7k.mjs +0 -2
  259. package/dist/impl-BJ0wcQ7k.mjs.map +0 -1
  260. package/dist/impl-BMteSe3O.mjs +0 -3
  261. package/dist/impl-BMteSe3O.mjs.map +0 -1
  262. package/dist/impl-BU5epQoJ.mjs +0 -3
  263. package/dist/impl-Bzn3FMBY.mjs +0 -2
  264. package/dist/impl-C-JpeZru.mjs +0 -4
  265. package/dist/impl-C0n31a_O.mjs +0 -2
  266. package/dist/impl-C2SPhoeN.mjs.map +0 -1
  267. package/dist/impl-CEQNDwPb.mjs +0 -2
  268. package/dist/impl-CEQNDwPb.mjs.map +0 -1
  269. package/dist/impl-CYiMx1--.mjs.map +0 -1
  270. package/dist/impl-CwBLpuAJ.mjs +0 -2
  271. package/dist/impl-DFfc5HBk.mjs +0 -3
  272. package/dist/impl-DFfc5HBk.mjs.map +0 -1
  273. package/dist/impl-DJR9yQoG.mjs +0 -2
  274. package/dist/impl-DJR9yQoG.mjs.map +0 -1
  275. package/dist/impl-DQRcwOlA.mjs +0 -2
  276. package/dist/impl-DQRcwOlA.mjs.map +0 -1
  277. package/dist/impl-DRLH1TnS.mjs.map +0 -1
  278. package/dist/impl-JU14ujB0.mjs +0 -3
  279. package/dist/impl-JU14ujB0.mjs.map +0 -1
  280. package/dist/impl-RPen9vPS.mjs +0 -2
  281. package/dist/impl-ouNg4TVN.mjs +0 -2
  282. package/dist/impl-ouNg4TVN.mjs.map +0 -1
  283. package/dist/impl-toPEtoCY.mjs +0 -2
  284. package/dist/impl-toPEtoCY.mjs.map +0 -1
  285. package/dist/impl-ukQtDFFF.mjs.map +0 -1
  286. package/dist/printResult-DdSpAx6T.mjs +0 -2
  287. package/dist/printResult-DdSpAx6T.mjs.map +0 -1
  288. package/dist/pullTranscendConfiguration-BPkc-b3x.mjs +0 -58
  289. package/dist/pullTranscendConfiguration-BPkc-b3x.mjs.map +0 -1
  290. package/dist/resolveBundleIdByName-C-M1UT8E.mjs +0 -2
  291. package/dist/resolveBundleIdByName-C-M1UT8E.mjs.map +0 -1
  292. package/dist/resolvePolicyBundleVersion-HwUipJxP.mjs +0 -2
  293. package/dist/resolvePolicyBundleVersion-HwUipJxP.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-DbzbpVC5.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { makeGraphQLRequest, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * Get number of open requests for a data silo\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request identifiers\n */\nexport async function fetchRequestDataSiloActiveCount(\n client: GraphQLClient,\n {\n dataSiloId,\n }: {\n /** Data silo ID */\n dataSiloId: string;\n },\n): Promise<number> {\n const {\n listReducedRequestsForDataSilo: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n listReducedRequestsForDataSilo: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, {\n variables: {\n input: {\n dataSiloId,\n isResolved: false,\n },\n },\n logger,\n });\n\n return totalCount;\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { withTransientRetry } from '@transcend-io/sdk';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\n\n/** Consent partition metadata when a DSR is scoped to a partition */\nexport const CronPartition = t.type({\n /** ID of the partition */\n id: t.string,\n /** The human readable name of the partition */\n name: t.string,\n /** The unique identifying partition value */\n partition: t.string,\n});\n\n/** Type override */\nexport type CronPartition = t.TypeOf<typeof CronPartition>;\n\nexport const CronIdentifier = t.intersection([\n t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n }),\n t.partial({\n /** The consent partition that scopes this request, when applicable */\n partition: t.union([CronPartition, t.null]),\n }),\n]);\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // `GET pending-requests` is a read and therefore safe to retry on transient\n // gateway / network errors. Customers running `transcend cron\n // pull-identifiers` against large silos would otherwise see the command\n // abort on a single 502 from the Sombra reverse tunnel.\n const response = await withTransientRetry(\n 'pullCronPageOfIdentifiers',\n () =>\n sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json(),\n { logger, maxAttempts: 6, baseDelayMs: 500 },\n );\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, createSombraGotInstance } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchRequestDataSiloActiveCount } from '../graphql/index.js';\nimport { pullCronPageOfIdentifiers, CronIdentifier } from './pullCronPageOfIdentifiers.js';\n\n/**\n * A CSV formatted identifier\n */\nexport type CsvFormattedIdentifier = {\n [k in string]: string | null | boolean | number;\n};\n\nexport interface CronIdentifierWithAction extends CronIdentifier {\n /** The request action that the identifier relates to */\n action: RequestAction;\n}\n\n/**\n * Pull the set of identifiers outstanding for a cron or AVC integration\n *\n * This function is designed to be used in a loop, and will call the onSave callback\n * with a chunk of identifiers when the savePageSize is reached.\n *\n * @param options - Options\n * @returns The identifiers and identifiers formatted for CSV\n */\nexport async function pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize = 100,\n savePageSize = 1000,\n onSave,\n transcendUrl = DEFAULT_TRANSCEND_API,\n skipRequestCount = false,\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** The request actions to fetch */\n actions: RequestAction[];\n /** How many identifiers to pull in a single call to the backend */\n apiPageSize: number;\n /** How many identifiers to save at a time (usually to a CSV file, should be a multiple of apiPageSize) */\n savePageSize: number;\n /** Callback function called when a chunk of identifiers is ready to be saved */\n onSave: (chunk: CsvFormattedIdentifier[]) => Promise<void>;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Skip request count */\n skipRequestCount?: boolean;\n}): Promise<{\n /** Raw Identifiers */\n identifiers: CronIdentifierWithAction[];\n}> {\n // Validate savePageSize\n if (savePageSize % apiPageSize !== 0) {\n throw new Error(\n `savePageSize must be a multiple of apiPageSize. savePageSize: ${savePageSize}, apiPageSize: ${apiPageSize}`,\n );\n }\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n let totalRequestCount = 0;\n if (!skipRequestCount) {\n totalRequestCount = await fetchRequestDataSiloActiveCount(client, {\n dataSiloId,\n });\n }\n\n logger.info(\n colors.magenta(\n `Pulling ${skipRequestCount ? 'all' : totalRequestCount} outstanding request identifiers ` +\n `for data silo: \"${dataSiloId}\" for requests of types \"${actions.join('\", \"')}\"`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const foundRequestIds = new Set<string>();\n\n // identifiers found in total\n const identifiers: CronIdentifierWithAction[] = [];\n // current chunk of identifiers to be saved\n let currentChunk: CsvFormattedIdentifier[] = [];\n\n // map over each action\n if (!skipRequestCount) {\n progressBar.start(totalRequestCount, 0);\n }\n await mapSeries(actions, async (action) => {\n let offset = 0;\n let shouldContinue = true;\n\n // Fetch a page of identifiers\n while (shouldContinue) {\n const pageIdentifiers = await pullCronPageOfIdentifiers(sombra, {\n dataSiloId,\n limit: apiPageSize,\n offset,\n requestType: action,\n });\n\n const identifiersWithAction: CronIdentifierWithAction[] = pageIdentifiers.map(\n (identifier) => {\n foundRequestIds.add(identifier.requestId);\n return {\n ...identifier,\n action,\n };\n },\n );\n\n const csvFormattedIdentifiers = identifiersWithAction.map(\n ({ attributes, partition, ...identifier }) => ({\n ...identifier,\n ...(partition\n ? {\n partitionId: partition.id,\n partitionName: partition.name,\n partitionKey: partition.partition,\n }\n : {}),\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n\n return { identifiers };\n}\n"],"mappings":"0bAYA,eAAsB,EACpB,EACA,CACE,cAKe,CACjB,GAAM,CACJ,+BAAgC,CAAE,eAChC,MAAM,EAMP,EAAQ,EAAsC,CAC/C,UAAW,CACT,MAAO,CACL,aACA,WAAY,GACb,CACF,CACD,SACD,CAAC,CAEF,OAAO,EC9BT,MAAa,EAAgB,EAAE,KAAK,CAElC,GAAI,EAAE,OAEN,KAAM,EAAE,OAER,UAAW,EAAE,OACd,CAAC,CAKW,EAAiB,EAAE,aAAa,CAC3C,EAAE,KAAK,CAEL,WAAY,EAAE,OAEd,KAAM,EAAE,OAER,eAAgB,EAAE,OAElB,WAAY,EAAE,OAEd,UAAW,EAAE,OAEb,MAAO,EAAE,OAET,iBAAkB,EAAE,OAEpB,iBAAkB,EAAE,OAEpB,WAAY,EAAE,MACZ,EAAE,KAAK,CACL,IAAK,EAAE,OACP,OAAQ,EAAE,MAAM,EAAE,OAAO,CAC1B,CAAC,CACH,CACF,CAAC,CACF,EAAE,QAAQ,CAER,UAAW,EAAE,MAAM,CAAC,EAAe,EAAE,KAAK,CAAC,CAC5C,CAAC,CACH,CAAC,CAaF,eAAsB,EACpB,EACA,CACE,aACA,QAAQ,IACR,SAAS,EACT,eAWyB,CAC3B,GAAI,CAKF,IAA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IAAI,EAAW,UAAU,CAClC,CACL,GAAG,EACH,SACD,EAEJ,CAEK,EAA0B,EAAsB,KACnD,CAAE,aAAY,YAAW,GAAG,MAAkB,CAC7C,GAAG,EACH,GAAI,EACA,CACE,YAAa,EAAU,GACvB,cAAe,EAAU,KACzB,aAAc,EAAU,UACzB,CACD,EAAE,CACN,GAAG,EAAW,QACX,EAAK,IACJ,OAAO,OAAO,EAAK,EAChB,EAAI,KAAM,EAAI,OAAO,KAAK,IAAI,CAChC,CAAC,CACJ,EAAE,CACH,CACF,EACF,CAED,EAAY,KAAK,GAAG,EAAsB,CAC1C,EAAa,KAAK,GAAG,EAAwB,CAGzC,EAAa,QAAU,IACzB,MAAM,EAAO,EAAa,CAC1B,EAAe,EAAE,EAGnB,EAAiB,EAAgB,SAAW,EAC5C,GAAU,EACL,EAGH,EAAO,KACL,EAAO,QACL,UAAU,EAAgB,OAAO,+BAA+B,EAAgB,KAAK,WACtF,CACF,CAND,EAAY,OAAO,EAAgB,KAAK,GAS5C,CAGE,EAAa,OAAS,GACxB,MAAM,EAAO,EAAa,CAGvB,GACH,EAAY,MAAM,CAGpB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAUvB,OARA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAY,OAAO,gCACxC,EAAgB,KACjB,gBAAgB,EAAY,IAAK,YACnC,CACF,CAEM,CAAE,cAAa"}
1
+ {"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-io0k95RW.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { makeGraphQLRequest, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * Get number of open requests for a data silo\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request identifiers\n */\nexport async function fetchRequestDataSiloActiveCount(\n client: GraphQLClient,\n {\n dataSiloId,\n }: {\n /** Data silo ID */\n dataSiloId: string;\n },\n): Promise<number> {\n const {\n listReducedRequestsForDataSilo: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n listReducedRequestsForDataSilo: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, {\n variables: {\n input: {\n dataSiloId,\n isResolved: false,\n },\n },\n logger,\n });\n\n return totalCount;\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { withTransientRetry } from '@transcend-io/sdk';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\n\n/** Consent partition metadata when a DSR is scoped to a partition */\nexport const CronPartition = t.type({\n /** ID of the partition */\n id: t.string,\n /** The human readable name of the partition */\n name: t.string,\n /** The unique identifying partition value */\n partition: t.string,\n});\n\n/** Type override */\nexport type CronPartition = t.TypeOf<typeof CronPartition>;\n\nexport const CronIdentifier = t.intersection([\n t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n }),\n t.partial({\n /** The consent partition that scopes this request, when applicable */\n partition: t.union([CronPartition, t.null]),\n }),\n]);\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // `GET pending-requests` is a read and therefore safe to retry on transient\n // gateway / network errors. Customers running `transcend cron\n // pull-identifiers` against large silos would otherwise see the command\n // abort on a single 502 from the Sombra reverse tunnel.\n const response = await withTransientRetry(\n 'pullCronPageOfIdentifiers',\n () =>\n sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json(),\n { logger, maxAttempts: 6, baseDelayMs: 500 },\n );\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, createSombraGotInstance } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchRequestDataSiloActiveCount } from '../graphql/index.js';\nimport { pullCronPageOfIdentifiers, CronIdentifier } from './pullCronPageOfIdentifiers.js';\n\n/**\n * A CSV formatted identifier\n */\nexport type CsvFormattedIdentifier = {\n [k in string]: string | null | boolean | number;\n};\n\nexport interface CronIdentifierWithAction extends CronIdentifier {\n /** The request action that the identifier relates to */\n action: RequestAction;\n}\n\n/**\n * Pull the set of identifiers outstanding for a cron or AVC integration\n *\n * This function is designed to be used in a loop, and will call the onSave callback\n * with a chunk of identifiers when the savePageSize is reached.\n *\n * @param options - Options\n * @returns The identifiers and identifiers formatted for CSV\n */\nexport async function pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize = 100,\n savePageSize = 1000,\n onSave,\n transcendUrl = DEFAULT_TRANSCEND_API,\n skipRequestCount = false,\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** The request actions to fetch */\n actions: RequestAction[];\n /** How many identifiers to pull in a single call to the backend */\n apiPageSize: number;\n /** How many identifiers to save at a time (usually to a CSV file, should be a multiple of apiPageSize) */\n savePageSize: number;\n /** Callback function called when a chunk of identifiers is ready to be saved */\n onSave: (chunk: CsvFormattedIdentifier[]) => Promise<void>;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Skip request count */\n skipRequestCount?: boolean;\n}): Promise<{\n /** Raw Identifiers */\n identifiers: CronIdentifierWithAction[];\n}> {\n // Validate savePageSize\n if (savePageSize % apiPageSize !== 0) {\n throw new Error(\n `savePageSize must be a multiple of apiPageSize. savePageSize: ${savePageSize}, apiPageSize: ${apiPageSize}`,\n );\n }\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n let totalRequestCount = 0;\n if (!skipRequestCount) {\n totalRequestCount = await fetchRequestDataSiloActiveCount(client, {\n dataSiloId,\n });\n }\n\n logger.info(\n colors.magenta(\n `Pulling ${skipRequestCount ? 'all' : totalRequestCount} outstanding request identifiers ` +\n `for data silo: \"${dataSiloId}\" for requests of types \"${actions.join('\", \"')}\"`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const foundRequestIds = new Set<string>();\n\n // identifiers found in total\n const identifiers: CronIdentifierWithAction[] = [];\n // current chunk of identifiers to be saved\n let currentChunk: CsvFormattedIdentifier[] = [];\n\n // map over each action\n if (!skipRequestCount) {\n progressBar.start(totalRequestCount, 0);\n }\n await mapSeries(actions, async (action) => {\n let offset = 0;\n let shouldContinue = true;\n\n // Fetch a page of identifiers\n while (shouldContinue) {\n const pageIdentifiers = await pullCronPageOfIdentifiers(sombra, {\n dataSiloId,\n limit: apiPageSize,\n offset,\n requestType: action,\n });\n\n const identifiersWithAction: CronIdentifierWithAction[] = pageIdentifiers.map(\n (identifier) => {\n foundRequestIds.add(identifier.requestId);\n return {\n ...identifier,\n action,\n };\n },\n );\n\n const csvFormattedIdentifiers = identifiersWithAction.map(\n ({ attributes, partition, ...identifier }) => ({\n ...identifier,\n ...(partition\n ? {\n partitionId: partition.id,\n partitionName: partition.name,\n partitionKey: partition.partition,\n }\n : {}),\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime /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AAa,QAAU,IACzB,MAAM,EAAO,EAAa,CAC1B,EAAe,EAAE,EAGnB,EAAiB,EAAgB,SAAW,EAC5C,GAAU,EACL,EAGH,EAAO,KACL,EAAO,QACL,UAAU,EAAgB,OAAO,+BAA+B,EAAgB,KAAK,WACtF,CACF,CAND,EAAY,OAAO,EAAgB,KAAK,GAS5C,CAGE,EAAa,OAAS,GACxB,MAAM,EAAO,EAAa,CAGvB,GACH,EAAY,MAAM,CAGpB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAUvB,OARA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAY,OAAO,gCACxC,EAAgB,KACjB,gBAAgB,EAAY,IAAK,YACnC,CACF,CAEM,CAAE,cAAa"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./logger-B-LXIf3U.mjs";import{fetchConsentManagerAnalyticsData as t,fetchConsentManagerId as n}from"@transcend-io/sdk";async function r(r,{bin:i,start:a,end:o=new Date}){let s=await n(r,{logger:e});if(Math.floor(a.getTime()/1e3)>Math.floor(o.getTime()/1e3))throw Error(`Received "end" date that happened before "start" date`);if(i===`1h`&&o.getTime()-a.getTime()>6048e5*2)throw Error(`When using bin=1h, start and end time can be no more than 2 weeks apart`);let c=a.toISOString(),l=o.toISOString(),[u,d,f]=await Promise.all([t(r,{dataSource:`PRIVACY_SIGNAL_TIMESERIES`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e}),t(r,{dataSource:`CONSENT_CHANGES_TIMESERIES`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e}),t(r,{dataSource:`CONSENT_SESSIONS_BY_REGIME`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e})]);return{PRIVACY_SIGNAL_TIMESERIES:u,CONSENT_CHANGES_TIMESERIES:d,CONSENT_SESSIONS_BY_REGIME:f}}export{r as t};
2
- //# sourceMappingURL=pullConsentManagerMetrics-Cma2auCK.mjs.map
1
+ import{t as e}from"./logger-Ckep4QXn.mjs";import{fetchConsentManagerAnalyticsData as t,fetchConsentManagerId as n}from"@transcend-io/sdk";async function r(r,{bin:i,start:a,end:o=new Date}){let s=await n(r,{logger:e});if(Math.floor(a.getTime()/1e3)>Math.floor(o.getTime()/1e3))throw Error(`Received "end" date that happened before "start" date`);if(i===`1h`&&o.getTime()-a.getTime()>6048e5*2)throw Error(`When using bin=1h, start and end time can be no more than 2 weeks apart`);let c=a.toISOString(),l=o.toISOString(),[u,d,f]=await Promise.all([t(r,{dataSource:`PRIVACY_SIGNAL_TIMESERIES`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e}),t(r,{dataSource:`CONSENT_CHANGES_TIMESERIES`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e}),t(r,{dataSource:`CONSENT_SESSIONS_BY_REGIME`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e})]);return{PRIVACY_SIGNAL_TIMESERIES:u,CONSENT_CHANGES_TIMESERIES:d,CONSENT_SESSIONS_BY_REGIME:f}}export{r as t};
2
+ //# sourceMappingURL=pullConsentManagerMetrics-CR4WwUt6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pullConsentManagerMetrics-Cma2auCK.mjs","names":[],"sources":["../src/lib/consent-manager/pullConsentManagerMetrics.ts"],"sourcesContent":["import { ConsentManagerMetricBin } from '@transcend-io/privacy-types';\nimport {\n type ConsentManagerMetric,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '@transcend-io/sdk';\nimport type { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * One second of time in ms\n */\nconst ONE_SECOND = 1000;\nconst ONE_MINUTE = 60 * ONE_SECOND;\nconst ONE_HOUR = 60 * ONE_MINUTE;\nconst ONE_DAY = 24 * ONE_HOUR;\nconst ONE_WEEK = 7 * ONE_DAY;\n\n/**\n * Pull consent manager metrics in an organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns The consent manager metrics\n */\nexport async function pullConsentManagerMetrics(\n client: GraphQLClient,\n {\n bin,\n start,\n end = new Date(),\n }: {\n /** Start date to pull metrics from */\n start: Date;\n /** End date to pull metrics from (assumes now) */\n end?: Date;\n /** Bin size to pull metrics */\n bin: ConsentManagerMetricBin;\n },\n): Promise<{\n /** Privacy signal data */\n PRIVACY_SIGNAL_TIMESERIES: ConsentManagerMetric[];\n /** Consent changes data */\n CONSENT_CHANGES_TIMESERIES: ConsentManagerMetric[];\n /** Consent sessions by regime */\n CONSENT_SESSIONS_BY_REGIME: ConsentManagerMetric[];\n}> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client, { logger });\n\n // convert start and end to times\n const startTime = Math.floor(start.getTime() / 1000);\n const endTime = Math.floor(end.getTime() / 1000);\n if (startTime > endTime) {\n throw new Error('Received \"end\" date that happened before \"start\" date');\n }\n\n // do not allow hourly bins greater than 2 weeks\n if (bin === '1h' && end.getTime() - start.getTime() > ONE_WEEK * 2) {\n throw new Error('When using bin=1h, start and end time can be no more than 2 weeks apart');\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] = await Promise.all([\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'PRIVACY_SIGNAL_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'CONSENT_CHANGES_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'CONSENT_SESSIONS_BY_REGIME',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n ]);\n\n return {\n PRIVACY_SIGNAL_TIMESERIES: privacySignalData,\n CONSENT_CHANGES_TIMESERIES: consentChangesData,\n CONSENT_SESSIONS_BY_REGIME: consentSessionsByRegimeData,\n };\n}\n"],"mappings":"0IA0BA,eAAsB,EACpB,EACA,CACE,MACA,QACA,MAAM,IAAI,MAgBX,CAED,IAAM,EAAiB,MAAM,EAAsB,EAAQ,CAAE,SAAQ,CAAC,CAKtE,GAFkB,KAAK,MAAM,EAAM,SAAS,CAAG,IAElC,CADG,KAAK,MAAM,EAAI,SAAS,CAAG,IACpB,CACrB,MAAU,MAAM,wDAAwD,CAI1E,GAAI,IAAQ,MAAQ,EAAI,SAAS,CAAG,EAAM,SAAS,CAAG,OAAW,EAC/D,MAAU,MAAM,0EAA0E,CAI5F,IAAM,EAAY,EAAM,aAAa,CAC/B,EAAU,EAAI,aAAa,CAC3B,CAAC,EAAmB,EAAoB,GAA+B,MAAM,QAAQ,IAAI,CAC7F,EACE,EACA,CACE,WAAY,4BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACD,EACE,EACA,CACE,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACD,EACE,EACA,CACE,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACF,CAAC,CAEF,MAAO,CACL,0BAA2B,EAC3B,2BAA4B,EAC5B,2BAA4B,EAC7B"}
1
+ {"version":3,"file":"pullConsentManagerMetrics-CR4WwUt6.mjs","names":[],"sources":["../src/lib/consent-manager/pullConsentManagerMetrics.ts"],"sourcesContent":["import { ConsentManagerMetricBin } from '@transcend-io/privacy-types';\nimport {\n type ConsentManagerMetric,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '@transcend-io/sdk';\nimport type { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * One second of time in ms\n */\nconst ONE_SECOND = 1000;\nconst ONE_MINUTE = 60 * ONE_SECOND;\nconst ONE_HOUR = 60 * ONE_MINUTE;\nconst ONE_DAY = 24 * ONE_HOUR;\nconst ONE_WEEK = 7 * ONE_DAY;\n\n/**\n * Pull consent manager metrics in an organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns The consent manager metrics\n */\nexport async function pullConsentManagerMetrics(\n client: GraphQLClient,\n {\n bin,\n start,\n end = new Date(),\n }: {\n /** Start date to pull metrics from */\n start: Date;\n /** End date to pull metrics from (assumes now) */\n end?: Date;\n /** Bin size to pull metrics */\n bin: ConsentManagerMetricBin;\n },\n): Promise<{\n /** Privacy signal data */\n PRIVACY_SIGNAL_TIMESERIES: ConsentManagerMetric[];\n /** Consent changes data */\n CONSENT_CHANGES_TIMESERIES: ConsentManagerMetric[];\n /** Consent sessions by regime */\n CONSENT_SESSIONS_BY_REGIME: ConsentManagerMetric[];\n}> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client, { logger });\n\n // convert start and end to times\n const startTime = Math.floor(start.getTime() / 1000);\n const endTime = Math.floor(end.getTime() / 1000);\n if (startTime > endTime) {\n throw new Error('Received \"end\" date that happened before \"start\" date');\n }\n\n // do not allow hourly bins greater than 2 weeks\n if (bin === '1h' && end.getTime() - start.getTime() > ONE_WEEK * 2) {\n throw new Error('When using bin=1h, start and end time can be no more than 2 weeks apart');\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] = await Promise.all([\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'PRIVACY_SIGNAL_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'CONSENT_CHANGES_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'CONSENT_SESSIONS_BY_REGIME',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n ]);\n\n return {\n PRIVACY_SIGNAL_TIMESERIES: privacySignalData,\n CONSENT_CHANGES_TIMESERIES: consentChangesData,\n CONSENT_SESSIONS_BY_REGIME: consentSessionsByRegimeData,\n };\n}\n"],"mappings":"0IA0BA,eAAsB,EACpB,EACA,CACE,MACA,QACA,MAAM,IAAI,MAgBX,CAED,IAAM,EAAiB,MAAM,EAAsB,EAAQ,CAAE,SAAQ,CAAC,CAKtE,GAFkB,KAAK,MAAM,EAAM,SAAS,CAAG,IAElC,CADG,KAAK,MAAM,EAAI,SAAS,CAAG,IACpB,CACrB,MAAU,MAAM,wDAAwD,CAI1E,GAAI,IAAQ,MAAQ,EAAI,SAAS,CAAG,EAAM,SAAS,CAAG,OAAW,EAC/D,MAAU,MAAM,0EAA0E,CAI5F,IAAM,EAAY,EAAM,aAAa,CAC/B,EAAU,EAAI,aAAa,CAC3B,CAAC,EAAmB,EAAoB,GAA+B,MAAM,QAAQ,IAAI,CAC7F,EACE,EACA,CACE,WAAY,4BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACD,EACE,EACA,CACE,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACD,EACE,EACA,CACE,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACF,CAAC,CAEF,MAAO,CACL,0BAA2B,EAC3B,2BAA4B,EAC5B,2BAA4B,EAC7B"}
@@ -1,2 +1,2 @@
1
- import{a as e}from"./constants-cBzX_zyl.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{r as n}from"./fetchAllRequests-BCHpCeFo.mjs";import{a as r}from"./writeCsv-DDKM_rAU.mjs";import{RequestStatus as i}from"@transcend-io/privacy-types";import{groupBy as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c,createSombraGotInstance as l,fetchAllRequestEnrichers as u,fetchAllRequestIdentifiers as d,validateSombraVersion as f}from"@transcend-io/sdk";import{map as p}from"@transcend-io/utils";async function m({file:m,auth:h,sombraAuth:g,requestActions:_=[],concurrency:v=100,transcendUrl:y=e}){let b=c(y,h),x=await l(y,h,{logger:t,sombraApiKey:g,sombraUrl:process.env.SOMBRA_URL});t.info(s.magenta(`Pulling manual enrichment requests, filtered for actions: ${_.join(`,`)}`));let S=await n(b,{actions:_,statuses:[i.Enriching]});await f(b,{logger:t});let C=[];await p(S,async e=>{let n=await u(b,{filterBy:{requestId:e.id},logger:t});if(n.filter(({status:e})=>e===`ACTION_REQUIRED`)){let r=await d(b,x,{filterBy:{requestId:e.id},skipSombraCheck:!0,logger:t});C.push({...e,requestIdentifiers:r,requestEnrichers:n})}},{concurrency:v});let w=C.map(({attributeValues:e,requestIdentifiers:t,requestEnrichers:n,...r})=>({...r,...Object.entries(a(t,`name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({value:e})=>e).join(`,`)}),{}),...Object.entries(a(e,`attributeKey.name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({name:e})=>e).join(`,`)}),{})}));return await r(m,w,o(w.map(e=>Object.keys(e)).flat())),t.info(s.green(`Successfully wrote ${C.length} requests to file "${m}"`)),C}export{m as t};
2
- //# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-DV72-Ood.mjs.map
1
+ import{a as e}from"./constants-CEPYyv4h.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{r as n}from"./fetchAllRequests-Bya6iwzL.mjs";import{a as r}from"./writeCsv-BMVkiMHM.mjs";import{RequestStatus as i}from"@transcend-io/privacy-types";import{groupBy as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c,createSombraGotInstance as l,fetchAllRequestEnrichers as u,fetchAllRequestIdentifiers as d,validateSombraVersion as f}from"@transcend-io/sdk";import{map as p}from"@transcend-io/utils";async function m({file:m,auth:h,sombraAuth:g,requestActions:_=[],concurrency:v=100,transcendUrl:y=e}){let b=c(y,h),x=await l(y,h,{logger:t,sombraApiKey:g,sombraUrl:process.env.SOMBRA_URL});t.info(s.magenta(`Pulling manual enrichment requests, filtered for actions: ${_.join(`,`)}`));let S=await n(b,{actions:_,statuses:[i.Enriching]});await f(b,{logger:t});let C=[];await p(S,async e=>{let n=await u(b,{filterBy:{requestId:e.id},logger:t});if(n.filter(({status:e})=>e===`ACTION_REQUIRED`)){let r=await d(b,x,{filterBy:{requestId:e.id},skipSombraCheck:!0,logger:t});C.push({...e,requestIdentifiers:r,requestEnrichers:n})}},{concurrency:v});let w=C.map(({attributeValues:e,requestIdentifiers:t,requestEnrichers:n,...r})=>({...r,...Object.entries(a(t,`name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({value:e})=>e).join(`,`)}),{}),...Object.entries(a(e,`attributeKey.name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({name:e})=>e).join(`,`)}),{})}));return await r(m,w,o(w.map(e=>Object.keys(e)).flat())),t.info(s.green(`Successfully wrote ${C.length} requests to file "${m}"`)),C}export{m as t};
2
+ //# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-CzhDjPw2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-DV72-Ood.mjs","names":[],"sources":["../src/lib/manual-enrichment/pullManualEnrichmentIdentifiersToCsv.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllRequestEnrichers,\n fetchAllRequestIdentifiers,\n validateSombraVersion,\n type RequestEnricher,\n type RequestIdentifier,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { groupBy, uniq } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { type PrivacyRequest, fetchAllRequests } from '../graphql/index.js';\nimport { writeCsv } from '../helpers/writeCsv.js';\n\nexport interface PrivacyRequestWithIdentifiers extends PrivacyRequest {\n /** Request Enrichers */\n requestEnrichers: RequestEnricher[];\n /** Request Identifiers */\n requestIdentifiers: RequestIdentifier[];\n}\n\n/**\n * Pull the set of manual enrichment jobs to CSV\n *\n * @param options - Options\n * @returns List of requests with identifiers\n */\nexport async function pullManualEnrichmentIdentifiersToCsv({\n file,\n auth,\n sombraAuth,\n requestActions = [],\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** The request actions to fetch */\n requestActions?: RequestAction[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<PrivacyRequestWithIdentifiers[]> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n logger.info(\n colors.magenta(\n `Pulling manual enrichment requests, filtered for actions: ${requestActions.join(',')}`,\n ),\n );\n\n // Pull all privacy requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n });\n\n await validateSombraVersion(client, { logger });\n\n // Requests to save\n const savedRequests: PrivacyRequestWithIdentifiers[] = [];\n\n // Filter down requests to what is needed\n await map(\n allRequests,\n async (request) => {\n // Fetch enrichers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n filterBy: { requestId: request.id },\n logger,\n });\n\n // Check if manual enrichment exists for that request\n const hasManualEnrichment = requestEnrichers.filter(\n ({ status }) => status === 'ACTION_REQUIRED',\n );\n\n // Save request to queue\n if (hasManualEnrichment) {\n const requestIdentifiers = await fetchAllRequestIdentifiers(client, sombra, {\n filterBy: { requestId: request.id },\n skipSombraCheck: true,\n logger,\n });\n savedRequests.push({\n ...request,\n requestIdentifiers,\n requestEnrichers,\n });\n }\n },\n {\n concurrency,\n },\n );\n\n const data = savedRequests.map(\n ({\n attributeValues,\n requestIdentifiers,\n requestEnrichers, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...request\n }) => ({\n ...request,\n // flatten identifiers\n ...Object.entries(groupBy(requestIdentifiers, 'name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ value }) => value).join(','),\n }),\n {},\n ),\n // flatten attributes\n ...Object.entries(groupBy(attributeValues, 'attributeKey.name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ name }) => name).join(','),\n }),\n {},\n ),\n }),\n );\n\n // Write out to CSV\n const headers = uniq(data.map((d) => Object.keys(d)).flat());\n await writeCsv(file, data, headers);\n\n logger.info(\n colors.green(`Successfully wrote ${savedRequests.length} requests to file \"${file}\"`),\n );\n\n return savedRequests;\n}\n"],"mappings":"khBAgCA,eAAsB,EAAqC,CACzD,OACA,OACA,aACA,iBAAiB,EAAE,CACnB,cAAc,IACd,eAAe,GAc4B,CAE3C,IAAM,EAAS,EAA4B,EAAc,EAAK,CACxD,EAAS,MAAM,EAAwB,EAAc,EAAM,CAC/D,SACA,aAAc,EACd,UAAW,QAAQ,IAAI,WACxB,CAAC,CAEF,EAAO,KACL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AAK,GAAG,CACtF,CAEM"}
1
+ {"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-CzhDjPw2.mjs","names":[],"sources":["../src/lib/manual-enrichment/pullManualEnrichmentIdentifiersToCsv.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllRequestEnrichers,\n fetchAllRequestIdentifiers,\n validateSombraVersion,\n type RequestEnricher,\n type RequestIdentifier,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { groupBy, uniq } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { type PrivacyRequest, fetchAllRequests } from '../graphql/index.js';\nimport { writeCsv } from '../helpers/writeCsv.js';\n\nexport interface PrivacyRequestWithIdentifiers extends PrivacyRequest {\n /** Request Enrichers */\n requestEnrichers: RequestEnricher[];\n /** Request Identifiers */\n requestIdentifiers: RequestIdentifier[];\n}\n\n/**\n * Pull the set of manual enrichment jobs to CSV\n *\n * @param options - Options\n * @returns List of requests with identifiers\n */\nexport async function pullManualEnrichmentIdentifiersToCsv({\n file,\n auth,\n sombraAuth,\n requestActions = [],\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** The request actions to fetch */\n requestActions?: RequestAction[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<PrivacyRequestWithIdentifiers[]> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n logger.info(\n colors.magenta(\n `Pulling manual enrichment requests, filtered for actions: ${requestActions.join(',')}`,\n ),\n );\n\n // Pull all privacy requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n });\n\n await validateSombraVersion(client, { logger });\n\n // Requests to save\n const savedRequests: PrivacyRequestWithIdentifiers[] = [];\n\n // Filter down requests to what is needed\n await map(\n allRequests,\n async (request) => {\n // Fetch enrichers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n filterBy: { requestId: request.id },\n logger,\n });\n\n // Check if manual enrichment exists for that request\n const hasManualEnrichment = requestEnrichers.filter(\n ({ status }) => status === 'ACTION_REQUIRED',\n );\n\n // Save request to queue\n if (hasManualEnrichment) {\n const requestIdentifiers = await fetchAllRequestIdentifiers(client, sombra, {\n filterBy: { requestId: request.id },\n skipSombraCheck: true,\n logger,\n });\n savedRequests.push({\n ...request,\n requestIdentifiers,\n requestEnrichers,\n });\n }\n },\n {\n concurrency,\n },\n );\n\n const data = savedRequests.map(\n ({\n attributeValues,\n requestIdentifiers,\n requestEnrichers, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...request\n }) => ({\n ...request,\n // flatten identifiers\n ...Object.entries(groupBy(requestIdentifiers, 'name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ value }) => value).join(','),\n }),\n {},\n ),\n // flatten attributes\n ...Object.entries(groupBy(attributeValues, 'attributeKey.name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ name }) => name).join(','),\n }),\n {},\n ),\n }),\n );\n\n // Write out to CSV\n const headers = uniq(data.map((d) => Object.keys(d)).flat());\n await writeCsv(file, data, headers);\n\n logger.info(\n colors.green(`Successfully wrote ${savedRequests.length} requests to file \"${file}\"`),\n );\n\n return savedRequests;\n}\n"],"mappings":"khBAgCA,eAAsB,EAAqC,CACzD,OACA,OACA,aACA,iBAAiB,EAAE,CACnB,cAAc,IACd,eAAe,GAc4B,CAE3C,IAAM,EAAS,EAA4B,EAAc,EAAK,CACx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,KAAK,EAAE,CAAC,CAAC,MAAM,CACzB,CAAC,CAEnC,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAc,OAAO,qBAAqB,EAAK,GAAG,CACtF,CAEM"}
@@ -0,0 +1,58 @@
1
+ import"./enums-BymyVyqr.mjs";import{t as e}from"./logger-Ckep4QXn.mjs";import{ActionItemCode as t,ConsentTrackerStatus as n,PreferenceTopicType as r,RequestAction as i,RetentionType as a,WorkflowConfigType as o}from"@transcend-io/privacy-types";import{flatten as s,groupBy as c,keyBy as l,mapValues as u}from"lodash-es";import d from"colors";import{ASSESSMENT_SECTION_FIELDS as f,convertToDataSubjectAllowlist as p,fetchAllActionItemCollections as m,fetchAllActionItems as h,fetchAllActions as g,fetchAllAgentFiles as _,fetchAllAgentFunctions as v,fetchAllAgents as y,fetchAllAssessments as b,fetchAllAttributes as x,fetchAllBusinessEntities as S,fetchAllConsentWorkflowTriggers as C,fetchAllCookies as w,fetchAllDataCategories as T,fetchAllDataFlows as E,fetchAllDataSubjects as D,fetchAllEnrichers as O,fetchAllIdentifiers as k,fetchAllMessages as ee,fetchAllPolicies as te,fetchAllPreferenceOptionValues as ne,fetchAllPrivacyCenters as re,fetchAllProcessingActivities as ie,fetchAllProcessingPurposes as ae,fetchAllPromptGroups as oe,fetchAllPromptPartials as se,fetchAllPrompts as ce,fetchAllPurposesAndPreferences as le,fetchAllSiloDiscoveryResults as ue,fetchAllTeams as de,fetchAllTemplates as fe,fetchAllVendors as pe,fetchAllWorkflowConfigs as A,fetchApiKeys as me,fetchConsentManager as he,fetchConsentManagerExperiences as ge,fetchConsentManagerTheme as _e,fetchConsentThemes as ve,fetchConsentVariants as ye,fetchEnrichedDataSilos as be,fetchPartitions as xe,formatAttributeValues as j,formatRegions as M,makeGraphQLRequest as N,parseAssessmentDisplayLogic as P,parseAssessmentRiskLogic as F,parsePurposesFromTriggerCondition as Se,resolveWorkflowTitleFromId as Ce,workflowConfigMatchKey as we}from"@transcend-io/sdk";import{gql as I}from"graphql-request";const L=I`
2
+ query TranscendCliAssessmentTemplates(
3
+ $first: Int!
4
+ $offset: Int!
5
+ $filterBy: AssessmentFormTemplateFiltersInput
6
+ ) {
7
+ assessmentFormTemplates(
8
+ first: $first
9
+ offset: $offset
10
+ filterBy: $filterBy
11
+ ) {
12
+ nodes {
13
+ id
14
+ creator {
15
+ id
16
+ email
17
+ name
18
+ }
19
+ lastEditor {
20
+ id
21
+ email
22
+ name
23
+ }
24
+ title
25
+ description
26
+ status
27
+ source
28
+ parentId
29
+ isLocked
30
+ isArchived
31
+ createdAt
32
+ updatedAt
33
+ retentionSchedule {
34
+ id
35
+ type
36
+ durationDays
37
+ operation
38
+ createdAt
39
+ updatedAt
40
+ }
41
+ assessmentEmailSet {
42
+ id
43
+ title
44
+ description
45
+ isDefault
46
+ templates {
47
+ id
48
+ title
49
+ }
50
+ }
51
+ sections {
52
+ ${f}
53
+ }
54
+ }
55
+ }
56
+ }
57
+ `;async function R(t){let n=[],r=0,i=!1;do{let{assessmentFormTemplates:{nodes:a}}=await N(t,L,{variables:{first:20,offset:r},logger:e});n.push(...a),r+=20,i=a.length===20}while(i);return n.sort((e,t)=>e.title.localeCompare(t.title))}const z=[`dataSilos`,`enrichers`,`templates`,`apiKeys`];async function B(f,{dataSiloIds:N,integrationNames:I,debug:L,resources:B=z,pageSize:V,skipDatapoints:Te,includeGuessedCategories:H,skipSubDatapoints:Ee,trackerStatuses:U=Object.values(n)}){if(N.length>0&&I.length>0)throw Error(`Only 1 of integrationNames OR dataSiloIds can be provided`);e.info(d.magenta(`Fetching data with page size ${V}...`));let[W,De,G,K,Oe,ke,Ae,je,Me,Ne,Pe,Fe,q,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,J,et,tt,nt,Y,X,rt,it]=await Promise.all([B.includes(`dataSilos`)||B.includes(`dataSubjects`)?D(f,{logger:e}):[],B.includes(`apiKeys`)?me(f,{fetchAll:!0,logger:e}):[],B.includes(`dataSilos`)?be(f,{ids:N,integrationNames:I,pageSize:V,debug:L,includeGuessedCategories:H,skipDatapoints:Te,skipSubDatapoints:Ee,logger:e}):[],B.includes(`enrichers`)?O(f,{logger:e}):[],B.includes(`dataFlows`)?[...U.includes(n.Live)?await E(f,{logger:e,filterBy:{status:n.Live}}):[],...U.includes(n.NeedsReview)?await E(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],B.includes(`cookies`)?[...U.includes(n.Live)?await w(f,{logger:e,filterBy:{status:n.Live}}):[],...U.includes(n.NeedsReview)?await w(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],B.includes(`customFields`)?x(f,{logger:e}):[],B.includes(`templates`)?fe(f,{logger:e}):[],B.includes(`identifiers`)?k(f,{logger:e}):[],B.includes(`actions`)?g(f,{logger:e}):[],B.includes(`businessEntities`)?S(f,{logger:e}):[],B.includes(`processingActivities`)?ie(f,{logger:e}):[],B.includes(`consentManager`)?he(f,{logger:e}):void 0,B.includes(`consentManager`)?ge(f,{logger:e}):[],B.includes(`consentManager`)?ye(f,{logger:e}):[],B.includes(`consentManager`)?ve(f,{logger:e}):[],B.includes(`prompts`)?ce(f,{logger:e}):[],B.includes(`promptPartials`)?se(f,{logger:e}):[],B.includes(`promptGroups`)?oe(f,{logger:e}):[],B.includes(`agents`)?y(f,{logger:e}):[],B.includes(`agentFunctions`)?v(f,{logger:e}):[],B.includes(`agentFiles`)?_(f,{logger:e}):[],B.includes(`vendors`)?pe(f,{logger:e}):[],B.includes(`dataCategories`)?T(f,{logger:e}):[],B.includes(`processingPurposes`)?ae(f,{logger:e}):[],B.includes(`actionItems`)?h(f,{logger:e,filterBy:{type:[t.Onboarding]}}):[],B.includes(`actionItemCollections`)?m(f,{logger:e}):[],B.includes(`teams`)?de(f,{logger:e}):[],B.includes(`policies`)?te(f,{logger:e}):[],B.includes(`privacyCenters`)?re(f,{logger:e}):[],B.includes(`messages`)?ee(f,{logger:e}):[],B.includes(`partitions`)?xe(f,{logger:e}):[],B.includes(`assessments`)?b(f,{logger:e}):[],B.includes(`assessmentTemplates`)?R(f):[],B.includes(`purposes`)?le(f,{logger:e}):[],B.includes(`preferenceWorkflowConfigs`)?C(f,{logger:e}):[],B.includes(`workflowConfigs`)?A(f,{logger:e,workflowConfigType:o.DSR}):[],B.includes(`preferenceOptions`)?ne(f,{logger:e}):[],B.includes(`systemDiscovery`)?ue(f,{logger:e}):[]]),Z=B.includes(`consentManager`)&&q?await _e(f,{logger:e,filterBy:{airgapBundleId:q.id}}):void 0,Q={},at=s(G.map(([{apiKeys:e}])=>e.map(({title:e})=>e))),$=Object.values(De).filter(({title:e})=>B.includes(`apiKeys`)?!0:at.includes(e));if($.length>0&&B.includes(`apiKeys`)&&(Q[`api-keys`]=$.map(({title:e})=>({title:e}))),J.length>0&&B.includes(`partitions`)&&(Q.partitions=J.map(({name:e,partition:t})=>({name:e,partition:t}))),q&&B.includes(`consentManager`)&&(Q[`consent-manager`]={bundleUrls:{TEST:q.testBundleURL,PRODUCTION:q.bundleURL},domains:q.configuration.domains||void 0,partition:q.configuration.partition||void 0,consentPrecedence:q.configuration.consentPrecedence||void 0,unknownRequestPolicy:q.configuration.unknownRequestPolicy||void 0,unknownCookiePolicy:q.configuration.unknownCookiePolicy||void 0,syncEndpoint:q.configuration.syncEndpoint||void 0,telemetryPartitioning:q.configuration.telemetryPartitioning||void 0,signedIabAgreement:q.configuration.signedIabAgreement||void 0,syncGroups:q.configuration.syncGroups||void 0,theme:Z?{primaryColor:Z.primaryColor||void 0,fontColor:Z.fontColor||void 0,privacyPolicy:Z.privacyPolicy||void 0,prompt:Z.prompt}:void 0,experiences:Ie.map(e=>({name:e.name,displayName:e.displayName||void 0,regions:e.regions.map(e=>({countrySubDivision:e.countrySubDivision||void 0,country:e.country||void 0})),onConsentExpiry:e.onConsentExpiry,consentExpiry:e.consentExpiry,operator:e.operator,displayPriority:e.displayPriority,viewState:e.viewState,purposes:e.purposes.map(e=>({trackingType:e.trackingType})),optedOutPurposes:e.optedOutPurposes.map(e=>({trackingType:e.trackingType})),browserLanguages:e.browserLanguages,browserTimeZones:e.browserTimeZones,consentUiVariantSlug:e.consentUiVariant?.slug})),consentVariants:Le.map(e=>({id:e.id,name:e.name,slug:e.slug,description:e.description||void 0,configuration:JSON.stringify(e.configuration),locales:e.locales,status:e.status,userFlow:e.userFlow||void 0,themeSlug:e.theme?.slug||void 0})),consentThemes:Re.map(e=>({id:e.id,name:e.name,slug:e.slug,configuration:JSON.stringify(e.configuration)}))}),et.length>0&&B.includes(`assessments`)&&(Q.assessments=et.map(({title:e,assessmentGroup:t,sections:n,creator:r,description:i,status:a,assignees:o,externalAssignees:s,reviewers:c,isLocked:l,isArchived:u,isExternallyCreated:d,dueDate:f,createdAt:p,assignedAt:m,submittedAt:h,approvedAt:g,rejectedAt:_,titleIsInternal:v,retentionSchedule:y,attributeValues:b,resources:x,syncedRows:S})=>({title:e,group:t.title,sections:n.map(({title:e,status:t,questions:n,assignees:r,isReviewed:i,externalAssignees:a})=>({title:e,status:t,questions:n.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,selectedAnswers:f,allowedMimeTypes:p,allowSelectOther:m,syncModel:h,syncColumn:g,attributeKey:_,requireRiskEvaluation:v,requireRiskMatrixEvaluation:y})=>{let b=s?P(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":b&&Object.keys(b).length>0?{action:b.action,rule:b.rule?{"depends-on-question-reference-id":b.rule.dependsOnQuestionReferenceId,"comparison-operator":b.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in b.rule?b.rule.comparisonOperands:void 0}:void 0,"nested-rule":b.nestedRule?{"logic-operator":b.nestedRule.logicOperator,rules:(b.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=F(e);return{"risk-level":t.riskAssignment?.riskLevelId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"selected-answers":f.map(({value:e})=>e),"allowed-mime-types":p,"allow-select-other":m,"sync-model":h||void 0,"sync-column":g||void 0,"attribute-key":_?.name,"require-risk-evaluation":v,"require-risk-matrix-evaluation":y}}),assignees:r.map(({email:e})=>e),"external-assignees":a.map(({email:e})=>e),"is-reviewed":i})),creator:r?.email,description:i,status:a,assignees:o.map(({email:e})=>e),"external-assignees":s.map(({email:e})=>e),reviewers:c.map(({email:e})=>e),locked:l,archived:u,external:d,"title-is-internal":v,"due-date":f||void 0,"created-at":p||void 0,"assigned-at":m||void 0,"submitted-at":h||void 0,"approved-at":g||void 0,"rejected-at":_||void 0,"retention-schedule":y?{type:y.type,"duration-days":y.durationDays,operand:y.operation}:void 0,attributes:b!==void 0&&b.length>0?j(b):void 0,resources:x.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``})),rows:S.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``}))}))),tt.length>0&&B.includes(`assessmentTemplates`)&&(Q[`assessment-templates`]=tt.map(({title:e,description:t,sections:n,status:r,source:i,creator:a,isLocked:o,isArchived:s,createdAt:c,retentionSchedule:l})=>({title:e,description:t,sections:n.map(({title:e,questions:t})=>({title:e,questions:t.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,allowedMimeTypes:f,allowSelectOther:p,syncModel:m,syncColumn:h,attributeKey:g,requireRiskEvaluation:_,requireRiskMatrixEvaluation:v})=>{let y=s?P(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":y&&Object.keys(y).length>0?{action:y.action,rule:y.rule?{"depends-on-question-reference-id":y.rule.dependsOnQuestionReferenceId,"comparison-operator":y.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in y.rule?y.rule.comparisonOperands:void 0}:void 0,"nested-rule":y.nestedRule?{"logic-operator":y.nestedRule.logicOperator,rules:(y.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=F(e);return{"risk-level":t.riskAssignment?.riskLevelId,"risk-matrix-row":t.riskAssignment?.riskMatrixRowId,"risk-matrix-column":t.riskAssignment?.riskMatrixColumnId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"allowed-mime-types":f,"allow-select-other":p,"sync-model":m||void 0,"sync-column":h||void 0,"attribute-key":g?.name,"require-risk-evaluation":_,"require-risk-matrix-evaluation":v}})})),status:r,source:i,creator:a?.email,locked:o,archived:s,"created-at":c||void 0,"retention-schedule":l?{type:l.type,"duration-days":l.durationDays,operand:l.operation}:void 0}))),it.length>0&&B.includes(`systemDiscovery`)&&(Q[`system-discovery`]=it.map(({title:e,resourceId:t,suggestedCatalog:{title:n},plugin:{dataSilo:{title:r}},country:i,countrySubDivision:a,plaintextContext:o,containsSensitiveData:s,status:c})=>({title:e,resourceId:t,suggestedCatalog:n,plugin:r,country:i||void 0,countrySubDivision:a||void 0,plaintextContext:o,containsSensitiveData:s,status:c}))),ze.length>0&&B.includes(`prompts`)&&(Q.prompts=ze.map(({title:e,content:t})=>({title:e,content:t}))),Be.length>0&&B.includes(`promptPartials`)&&(Q[`prompt-partials`]=Be.map(({title:e,content:t})=>({title:e,content:t}))),Ve.length>0&&B.includes(`promptGroups`)&&(Q[`prompt-groups`]=Ve.map(({title:e,description:t,prompts:n})=>({title:e,description:t,prompts:n.map(({title:e})=>e)}))),Xe.length>0&&B.includes(`teams`)&&(Q.teams=Xe.map(({name:e,description:t,ssoDepartment:n,ssoGroup:r,ssoTitle:i,users:a,scopes:o,parentTeam:s})=>({name:e,description:t,"sso-department":n||void 0,"sso-group":r||void 0,"sso-title":i||void 0,"parent-team-name":s?.name,users:a.map(({email:e})=>e),scopes:o.map(({name:e})=>e)}))),W.length>0&&B.includes(`dataSubjects`)&&(Q[`data-subjects`]=W.map(({type:e,title:t,active:n,adminDashboardDefaultSilentMode:r,supportsAuthorizedAgent:i,actions:a})=>({type:e,title:t?.defaultMessage,active:n,adminDashboardDefaultSilentMode:r,supportsAuthorizedAgent:i,actions:a.map(({type:e})=>e)}))),Ze.length>0&&(Q.policies=Ze.map(({title:e,type:t,versions:n,disabledLocales:r})=>({title:e?.defaultMessage,type:t,content:n?.[0]?.content?.defaultMessage,disabledLocales:r}))),$e.length>0&&(Q.messages=$e.map(({id:e,defaultMessage:t,targetReactIntlId:n,description:r,translations:i})=>({id:e,defaultMessage:t,description:r,targetReactIntlId:n||void 0,translations:i.reduce((e,{locale:t,value:n})=>Object.assign(e,{[t]:n}),{})}))),Qe.length>0){let e=Qe[0];Q[`privacy-center`]={isDisabled:e.isDisabled,showPrivacyRequestButton:e.showPrivacyRequestButton,showPolicies:e.showPolicies,showTrackingTechnologies:e.showTrackingTechnologies,showCookies:e.showCookies,showDataFlows:e.showDataFlows,showConsentManager:e.showConsentManager,showManageYourPrivacy:e.showManageYourPrivacy,showMarketingPreferences:e.showMarketingPreferences,locales:e.locales,defaultLocale:e.defaultLocale,preferBrowserDefaultLocale:e.preferBrowserDefaultLocale,supportEmail:e.supportEmail||void 0,replyToEmail:e.replyToEmail||void 0,useNoReplyEmailAddress:e.useNoReplyEmailAddress,useCustomEmailDomain:e.useCustomEmailDomain,transformAccessReportJsonToCsv:e.transformAccessReportJsonToCsv,home:e.home||void 0,expandSideMenuByDefault:e.expandSideMenuByDefault,workflowsCustomFieldsRequired:e.workflowsCustomFieldsRequired,footerLayout:e.footerLayout,...e.childOrganizations.length>0?{displayedChildOrganizationUris:e.childOrganizations.map(e=>e.uri)}:{},...e.footerLinks.length>0?{footerLinks:[...e.footerLinks].sort((e,t)=>e.displayOrder-t.displayOrder).map(e=>({title:e.title.defaultMessage,...e.url?{url:e.url}:{},...e.iconOnly?{iconOnly:e.iconOnly}:{}}))}:{},theme:e.theme}}if(Pe.length>0&&B.includes(`businessEntities`)&&(Q[`business-entities`]=Pe.map(({title:e,description:t,address:n,headquarterCountry:r,headquarterSubDivision:i,dataProtectionOfficerName:a,dataProtectionOfficerEmail:o,attributeValues:s})=>({title:e,description:t||void 0,address:n||void 0,headquarterCountry:r||void 0,headquarterSubDivision:i||void 0,dataProtectionOfficerName:a||void 0,dataProtectionOfficerEmail:o||void 0,attributes:s!==void 0&&s.length>0?j(s):void 0}))),Fe.length>0&&B.includes(`processingActivities`)&&(Q[`processing-activities`]=Fe.map(({title:e,description:t,securityMeasureDetails:n,controllerships:r,storageRegions:i,transferRegions:o,retentionType:s,retentionPeriod:c,dataProtectionImpactAssessmentLink:l,dataProtectionImpactAssessmentStatus:u,attributeValues:d,dataSilos:f,dataSubjects:p,teams:m,owners:h,processingPurposeSubCategories:g,dataSubCategories:_,saaSCategories:v})=>({title:e,description:t,securityMeasureDetails:n??void 0,controllerships:r.length>0?r:void 0,storageRegions:i.length>0?M(i):void 0,transferRegions:o.length>0?M(o):void 0,retentionType:s,retentionPeriod:s===a.StatedPeriod?c:void 0,dataProtectionImpactAssessmentLink:l??void 0,dataProtectionImpactAssessmentStatus:u,attributes:d!==void 0&&d.length>0?j(d):void 0,dataSiloTitles:f.length>0?f.map(({title:e})=>e):void 0,dataSubjectTypes:p.length>0?p.map(({type:e})=>e):void 0,teamNames:m.length>0?m.map(({name:e})=>e):void 0,ownerEmails:h.length>0?h.map(({email:e})=>e):void 0,processingSubPurposes:g.length>0?g.map(({name:e,purpose:t})=>({purpose:t,...e?{name:e}:{}})):void 0,dataSubCategories:_.length>0?_.map(({name:e,category:t})=>({category:t,...e?{name:e}:{}})):void 0,saaSCategories:v.length>0?v.map(({title:e})=>e):void 0}))),Ne.length>0&&B.includes(`actions`)&&(Q.actions=Ne.map(({type:e,skipSecondaryIfNoFiles:t,skipDownloadableStep:n,requiresReview:r,regionList:a,regionDetectionMethod:o,waitingPeriod:s})=>({type:e,...e===i.Erasure?{skipSecondaryIfNoFiles:t,skipDownloadableStep:n}:{},requiresReview:r,waitingPeriod:s,regionDetectionMethod:o,regionList:a.length>0?a:void 0}))),Me.length>0&&B.includes(`identifiers`)&&(Q.identifiers=Me.map(({name:e,type:t,regex:n,selectOptions:r,privacyCenterVisibility:i,isRequiredInForm:a,placeholder:o,displayTitle:s,dataSubjects:c,displayDescription:l,displayOrder:u,isUniqueOnPreferenceStore:d})=>({name:e,type:t,regex:n,selectOptions:r.length>0?r:void 0,privacyCenterVisibility:i.length>0?i:void 0,isRequiredInForm:a,placeholder:o||void 0,dataSubjects:c.length>0?c.map(({type:e})=>e):void 0,displayTitle:s?.defaultMessage,displayDescription:l?.defaultMessage,displayOrder:u,isUniqueOnPreferenceStore:d}))),He.length>0&&B.includes(`agents`)&&(Q.agents=He.map(({name:e,agentId:t,description:n,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o,largeLanguageModel:s,teams:c,owners:l,agentFunctions:u,agentFiles:d})=>({name:e,agentId:t,description:n||void 0,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o?.title,"large-language-model":{name:s.name,client:s.client},teams:c&&c.length>0?c.map(({name:e})=>e):void 0,owners:l&&l.length>0?l.map(({email:e})=>e):void 0,"agent-functions":u&&u.length>0?u.map(({name:e})=>e):void 0,"agent-files":d&&d.length>0?d.map(({name:e})=>e):void 0}))),Je.length>0&&B.includes(`actionItems`)&&(Q[`action-items`]=Je.map(({teams:e,users:t,customerExperienceActionItemIds:[n],dueDate:r,priority:i,resolved:a,collections:o,notes:s,link:c,title:l,type:u,attributeValues:d})=>({teams:e.map(({name:e})=>e),users:t.map(({email:e})=>e),dueDate:r||void 0,title:l,notes:s,customerExperienceActionItemId:n,collections:o.map(({title:e})=>e),link:c,priority:i||void 0,resolved:a,type:u,attributes:d!==void 0&&d.length>0?j(d):void 0}))),Ye.length>0&&B.includes(`actionItemCollections`)&&(Q[`action-item-collections`]=Ye.map(({title:e,description:t,hidden:n,productLine:r})=>({title:e,description:t||void 0,hidden:n,productLine:r}))),Ue.length>0&&B.includes(`agentFunctions`)&&(Q[`agent-functions`]=Ue.map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:JSON.stringify(n)}))),We.length>0&&B.includes(`agentFiles`)&&(Q[`agent-files`]=We.map(({name:e,description:t,fileId:n,size:r,purpose:i})=>({name:e,description:t,fileId:n,size:r,purpose:i}))),Ge.length>0&&B.includes(`vendors`)&&(Q.vendors=Ge.map(({title:e,description:t,dataProcessingAgreementLink:n,contactName:r,contactPhone:i,address:a,headquarterCountry:o,headquarterSubDivision:s,websiteUrl:c,businessEntity:l,teams:u,owners:d,attributeValues:f})=>({title:e,description:t||void 0,dataProcessingAgreementLink:n||void 0,contactName:r||void 0,contactPhone:i||void 0,address:a||void 0,headquarterCountry:o||void 0,headquarterSubDivision:s||void 0,websiteUrl:c||void 0,businessEntity:l?.title,teams:u&&u.length>0?u.map(({name:e})=>e):void 0,owners:d&&d.length>0?d.map(({email:e})=>e):void 0,attributes:f!==void 0&&f.length>0?j(f):void 0}))),Ke.length>0&&B.includes(`dataCategories`)&&(Q[`data-categories`]=Ke.map(({name:e,category:t,description:n,regex:r,owners:i,teams:a,attributeValues:o})=>({name:e,category:t,description:n||void 0,regex:r||void 0,owners:i&&i.length>0?i.map(({email:e})=>e):void 0,teams:a&&a.length>0?a.map(({name:e})=>e):void 0,attributes:o!==void 0&&o.length>0?j(o):void 0}))),qe.length>0&&B.includes(`processingPurposes`)&&(Q[`processing-purposes`]=qe.map(({name:e,purpose:t,description:n,owners:r,teams:i,attributeValues:a})=>({name:e,purpose:t,description:n||void 0,owners:r&&r.length>0?r.map(({email:e})=>e):void 0,teams:i&&i.length>0?i.map(({name:e})=>e):void 0,attributes:a!==void 0&&a.length>0?j(a):void 0}))),Oe.length>0&&B.includes(`dataFlows`)&&(Q[`data-flows`]=Oe.map(({value:e,type:t,description:n,trackingType:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({value:e,type:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?j(c):void 0}))),ke.length>0&&B.includes(`cookies`)&&(Q.cookies=ke.map(({name:e,isRegex:t,description:n,trackingPurposes:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({name:e,isRegex:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?j(c):void 0}))),Ae.length>0&&B.includes(`customFields`)&&(Q.attributes=Ae.map(({description:e,name:t,type:n,values:r,enabledOn:i=[]})=>({description:e||void 0,resources:i,name:t,type:n,values:r.map(({name:e,color:t,description:n})=>({name:e,color:t||void 0,description:n}))}))),nt.length>0&&(Q.purposes=nt.map(({name:e,description:t,trackingType:n,defaultConsent:i,configurable:a,showInConsentManager:o,isActive:s,displayOrder:c,optOutSignals:l,authLevel:u,topics:d,showInPrivacyCenter:f,title:p})=>({name:e,title:p,description:t||void 0,trackingType:n,"default-consent":i,configurable:a,"show-in-consent-manager":o,"show-in-privacy-center":f,"is-active":s,"display-order":c,"opt-out-signals":l.length>0?l:void 0,"auth-level":u||void 0,"preference-topics":d.map(({slug:e,title:t,type:n,color:i,displayDescription:a,defaultConfiguration:o,showInPrivacyCenter:s,preferenceOptionValues:c})=>({slug:e,title:t.defaultMessage,type:n,color:i,description:a.defaultMessage,"default-configuration":o,"show-in-privacy-center":s,options:n===r.Boolean?[]:c.map(({title:e,slug:t})=>({title:e.defaultMessage,slug:t}))}))}))),X.length>0&&B.includes(`workflowConfigs`)){let t=X.map(e=>({title:e.title.defaultMessage,"action-type":e.action.type,...e.internalName?{"internal-name":e.internalName}:{},...e.subtitle?{subtitle:e.subtitle.defaultMessage}:{},...e.description?{description:e.description.defaultMessage}:{},...e.subject?{"data-subject-type":e.subject.type}:{},visibility:e.workflowConfigVisibility,type:e.workflowConfigType,...e.collectDataSubjectRegions?{"collect-data-subject-regions":e.collectDataSubjectRegions}:{},...e.regionList.length>0?{"region-list":e.regionList}:{},...e.expiryTime&&e.expiryTime.length>0?{"expiry-time":e.expiryTime}:{},...e.WorkflowConfigAttributeKeys&&e.WorkflowConfigAttributeKeys.length>0?{"attribute-keys":e.WorkflowConfigAttributeKeys.map(({attributeKey:e})=>e.name)}:{}})),n=c(X,we);for(let t of Object.values(n))if(t.length>1){let n=t[0];e.warn(`Found "${t.length}" workflow configs with the same title, action-type, data-subject-type, and region-list for "${n.title.defaultMessage}" (${n.action.type}). Push will fail until they are disambiguated (for example with unique internal names).`)}t.length>0&&(Q[`workflow-configs`]=t)}if(Y.length>0&&B.includes(`preferenceWorkflowConfigs`)){let t=Y.some(e=>e.workflowConfigId)?await A(f,{logger:e,workflowConfigType:o.DSR}):[];Q[`preference-workflow-configs`]=Y.map(e=>{let n=Se(e.triggerCondition),r={name:e.name,"data-subject-type":e.subject.type,"is-silent":e.isSilent,"allow-unauthenticated":e.allowUnauthenticated,"is-active":e.isActive,purposes:n};if(e.workflowConfigId){let n=Ce(t,e.workflowConfigId);if(n)return{...r,"workflow-title":n}}return{...r,"action-type":e.action.type,"data-silo-titles":e.dataSilos.length>0?e.dataSilos.map(e=>e.title):void 0}})}if(rt.length>0&&B.includes(`preferenceOptions`)&&(Q[`preference-options`]=rt.map(({slug:e,title:t})=>({slug:e,title:t.defaultMessage}))),N.length===0&&je.length>0&&B.includes(`templates`)&&(Q.templates=je.map(({title:e})=>({title:e}))),K.length>0&&B.includes(`enrichers`)&&(Q.enrichers=K.map(({title:e,url:t,type:n,inputIdentifier:r,identifiers:a,actions:o,testRegex:s,dataSubjects:c,expirationDuration:l,lookerQueryTitle:u,transitionRequestStatus:d,phoneNumbers:f,regionList:p})=>({title:e,url:t||void 0,type:n,"input-identifier":r?.name,"output-identifiers":a.map(({name:e})=>e),"privacy-actions":Object.values(i).length===o.length?void 0:o,testRegex:s||void 0,lookerQueryTitle:u||void 0,expirationDuration:parseInt(l,10),transitionRequestStatus:d||void 0,phoneNumbers:f&&f.length>0?f:void 0,regionList:p&&p.length>0?p:void 0,"data-subjects":c.map(({type:e})=>e)}))),G.length>0&&B.includes(`dataSilos`)){let e=l(W,`type`);Q[`data-silos`]=G.map(([{title:t,description:n,url:r,type:i,outerType:a,apiKeys:o,notifyEmailAddress:s,identifiers:c,dependentDataSilos:d,owners:f,country:m,countrySubDivision:h,teams:g,subjectBlocklist:_,isLive:v,promptAVendorEmailSendFrequency:y,promptAVendorEmailSendType:b,promptAVendorEmailIncludeIdentifiersAttachment:x,promptAVendorEmailCompletionLinkType:S,manualWorkRetryFrequency:C,catalog:w,attributeValues:T,discoveredBy:E,businessEntities:D,sombra:O},k])=>({title:t,description:n,integrationName:i,"outer-type":a||void 0,url:r||void 0,"api-key-title":o[0]?.title,"sombra-id":O?.id||void 0,"identity-keys":c.filter(({isConnected:e})=>e).map(({name:e})=>e),...d.length>0?{"deletion-dependencies":d.map(({title:e})=>e)}:{},...f.length>0?{owners:f.map(({email:e})=>e)}:{},...g.length>0?{teams:g.map(({name:e})=>e)}:{},...E.length>0?{discoveredBy:E.map(({title:e})=>e)}:{},...D.length>0?{businessEntities:D.map(({title:e})=>e)}:{},country:m||void 0,countrySubDivision:h||void 0,disabled:!v,"data-subjects":_.length>0?p(_.map(({type:e})=>e),e):void 0,...w.hasAvcFunctionality?{"email-settings":{"notify-email-address":s||void 0,"send-frequency":y,"send-type":b,"include-identifiers-attachment":x,"completion-link-type":S,"manual-work-retry-frequency":C}}:{},attributes:T!==void 0&&T.length>0?j(T):void 0,datapoints:k.map(e=>({key:e.name,title:e.title?.defaultMessage,description:e.description?.defaultMessage,owners:e.owners.map(({email:e})=>e),teams:e.teams.map(({name:e})=>e),...e.path.length>0?{path:e.path}:{},...e.dataCollection?.title?{"data-collection-tag":e.dataCollection.title.defaultMessage}:{},...e.dbIntegrationQueries.length>0?{"privacy-action-queries":u(l(e.dbIntegrationQueries,`requestType`),e=>e.suggestedQuery||e.query||void 0)}:{},...e.subDataPoints.length>0?{fields:e.subDataPoints.map(e=>({key:e.name,description:e.description,purposes:e.purposes,categories:e.categories,...H&&e.pendingCategoryGuesses?{"guessed-categories":e.pendingCategoryGuesses.filter(e=>e.status===`PENDING`).map(e=>({category:{name:e.category.name,category:e.category.category},status:e.status,confidence:e.confidence,classifierVersion:e.classifierVersion||void 0}))}:{},"access-request-visibility-enabled":e.accessRequestVisibilityEnabled,"erasure-request-redaction-enabled":e.erasureRequestRedactionEnabled,attributes:e.attributeValues!==void 0&&e.attributeValues.length>0?j(e.attributeValues):void 0})).sort((e,t)=>e.key.localeCompare(t.key))}:{},"privacy-actions":e.actionSettings.filter(({active:e})=>e).map(({type:e})=>e)})).sort((e,t)=>[...e.path??[],e.key].join(`.`).localeCompare([...t.path??[],t.key].join(`.`)))}))}return Q}export{L as i,B as n,R as r,z as t};
58
+ //# sourceMappingURL=pullTranscendConfiguration-C2LAOKG4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pullTranscendConfiguration-C2LAOKG4.mjs","names":[],"sources":["../src/lib/graphql/gqls/assessmentTemplate.ts","../src/lib/graphql/fetchAllAssessmentTemplates.ts","../src/lib/graphql/pullTranscendConfiguration.ts"],"sourcesContent":["import { ASSESSMENT_SECTION_FIELDS } from '@transcend-io/sdk';\nimport { gql } from 'graphql-request';\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 {\n AssessmentFormTemplateSource,\n AssessmentFormTemplateStatus,\n} from '@transcend-io/privacy-types';\nimport {\n makeGraphQLRequest,\n type AssessmentSection,\n type RetentionSchedule,\n type UserPreview,\n} from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\nimport { ASSESSMENT_TEMPLATES } from './gqls/index.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 variables: { first: PAGE_SIZE, offset },\n logger,\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 { LocaleValue } from '@transcend-io/internationalization';\nimport {\n RequestAction,\n ConsentTrackerStatus,\n ActionItemCode,\n RetentionType,\n PreferenceTopicType,\n WorkflowConfigType,\n type ConsentThemeInput,\n type ConsentVariantInput,\n} from '@transcend-io/privacy-types';\nimport {\n fetchAllActionItemCollections,\n fetchAllActionItems,\n fetchAllActions,\n fetchAllAgentFiles,\n fetchAllAgentFunctions,\n fetchAllAgents,\n fetchAllAssessments,\n fetchAllAttributes,\n fetchAllBusinessEntities,\n fetchAllCookies,\n fetchAllDataCategories,\n fetchAllDataFlows,\n fetchAllPolicies,\n fetchAllPrivacyCenters,\n fetchAllProcessingPurposes,\n fetchAllSiloDiscoveryResults,\n fetchAllTemplates,\n fetchConsentManager,\n fetchConsentManagerExperiences,\n fetchConsentVariants,\n fetchConsentThemes,\n fetchConsentManagerTheme,\n fetchAllEnrichers,\n fetchAllIdentifiers,\n fetchAllMessages,\n fetchAllPromptGroups,\n fetchAllPromptPartials,\n fetchAllProcessingActivities,\n fetchAllPrompts,\n fetchAllPurposesAndPreferences,\n fetchAllConsentWorkflowTriggers,\n fetchAllPreferenceOptionValues,\n fetchAllWorkflowConfigs,\n fetchPartitions,\n fetchAllTeams,\n fetchAllVendors,\n fetchApiKeys,\n formatAttributeValues,\n formatRegions,\n parseAssessmentDisplayLogic,\n parseAssessmentRiskLogic,\n parsePurposesFromTriggerCondition,\n resolveWorkflowTitleFromId,\n convertToDataSubjectAllowlist,\n fetchAllDataSubjects,\n fetchEnrichedDataSilos,\n workflowConfigMatchKey,\n type AssessmentRule,\n} from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport { flatten, groupBy, 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 PreferenceWorkflowConfigInput,\n WorkflowConfigInput,\n ConsentPreferenceTopic,\n ConsentPreferenceTopicOptionValue,\n type SiloDiscoveryResultInput,\n} from '../../codecs.js';\nimport { TranscendPullResource } from '../../enums.js';\nimport { logger } from '../../logger.js';\nimport { fetchAllAssessmentTemplates } from './fetchAllAssessmentTemplates.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 consentVariants,\n consentThemes,\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 preferenceWorkflowConfigs,\n workflowConfigs,\n preferenceOptionValues,\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, { logger })\n : [],\n // Grab API keys\n resources.includes(TranscendPullResource.ApiKeys)\n ? fetchApiKeys(client, { fetchAll: true, logger })\n : [],\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 logger,\n })\n : [],\n // Fetch enrichers\n resources.includes(TranscendPullResource.Enrichers)\n ? fetchAllEnrichers(client, { logger })\n : [],\n // Fetch data flows\n resources.includes(TranscendPullResource.DataFlows)\n ? [\n ...(trackerStatuses.includes(ConsentTrackerStatus.Live)\n ? await fetchAllDataFlows(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.Live },\n })\n : []),\n ...(trackerStatuses.includes(ConsentTrackerStatus.NeedsReview)\n ? await fetchAllDataFlows(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.NeedsReview },\n })\n : []),\n ]\n : [],\n // Fetch data flows\n resources.includes(TranscendPullResource.Cookies)\n ? [\n ...(trackerStatuses.includes(ConsentTrackerStatus.Live)\n ? await fetchAllCookies(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.Live },\n })\n : []),\n ...(trackerStatuses.includes(ConsentTrackerStatus.NeedsReview)\n ? await fetchAllCookies(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.NeedsReview },\n })\n : []),\n ]\n : [],\n // Fetch attributes\n resources.includes(TranscendPullResource.Attributes)\n ? fetchAllAttributes(client, { logger })\n : [],\n // Fetch email templates\n resources.includes(TranscendPullResource.Templates)\n ? fetchAllTemplates(client, { logger })\n : [],\n // Fetch identifiers\n resources.includes(TranscendPullResource.Identifiers)\n ? fetchAllIdentifiers(client, { logger })\n : [],\n // Fetch actions\n resources.includes(TranscendPullResource.Actions) ? fetchAllActions(client, { logger }) : [],\n // Fetch business entities\n resources.includes(TranscendPullResource.BusinessEntities)\n ? fetchAllBusinessEntities(client, { logger })\n : [],\n // Fetch processing activities\n resources.includes(TranscendPullResource.ProcessingActivities)\n ? fetchAllProcessingActivities(client, { logger })\n : [],\n // Fetch consent manager\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentManager(client, { logger })\n : undefined,\n // Fetch consent manager experiences\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentManagerExperiences(client, { logger })\n : [],\n // Fetch consent manager consent variants\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentVariants(client, { logger })\n : [],\n // Fetch consent manager consent themes\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentThemes(client, { logger })\n : [],\n // Fetch prompts\n resources.includes(TranscendPullResource.Prompts) ? fetchAllPrompts(client, { logger }) : [],\n // Fetch promptPartials\n resources.includes(TranscendPullResource.PromptPartials)\n ? fetchAllPromptPartials(client, { logger })\n : [],\n // Fetch promptGroups\n resources.includes(TranscendPullResource.PromptGroups)\n ? fetchAllPromptGroups(client, { logger })\n : [],\n // Fetch agents\n resources.includes(TranscendPullResource.Agents) ? fetchAllAgents(client, { logger }) : [],\n // Fetch agentFunctions\n resources.includes(TranscendPullResource.AgentFunctions)\n ? fetchAllAgentFunctions(client, { logger })\n : [],\n // Fetch agentFiles\n resources.includes(TranscendPullResource.AgentFiles)\n ? fetchAllAgentFiles(client, { logger })\n : [],\n // Fetch vendors\n resources.includes(TranscendPullResource.Vendors) ? fetchAllVendors(client, { logger }) : [],\n // Fetch dataCategories\n resources.includes(TranscendPullResource.DataCategories)\n ? fetchAllDataCategories(client, { logger })\n : [],\n // Fetch dataCategories\n resources.includes(TranscendPullResource.ProcessingPurposes)\n ? fetchAllProcessingPurposes(client, { logger })\n : [],\n // Fetch actionItems\n resources.includes(TranscendPullResource.ActionItems)\n ? fetchAllActionItems(client, {\n logger,\n filterBy: { type: [ActionItemCode.Onboarding] },\n })\n : [],\n // Fetch actionItemCollections\n resources.includes(TranscendPullResource.ActionItemCollections)\n ? fetchAllActionItemCollections(client, { logger })\n : [],\n // Fetch teams\n resources.includes(TranscendPullResource.Teams) ? fetchAllTeams(client, { logger }) : [],\n // Fetch policies\n resources.includes(TranscendPullResource.Policies) ? fetchAllPolicies(client, { logger }) : [],\n // Fetch privacy centers\n resources.includes(TranscendPullResource.PrivacyCenters)\n ? fetchAllPrivacyCenters(client, { logger })\n : [],\n // Fetch messages\n resources.includes(TranscendPullResource.Messages) ? fetchAllMessages(client, { logger }) : [],\n // Fetch partitions\n resources.includes(TranscendPullResource.Partitions) ? fetchPartitions(client, { logger }) : [],\n // Fetch assessments\n resources.includes(TranscendPullResource.Assessments)\n ? fetchAllAssessments(client, { logger })\n : [],\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, { logger })\n : [],\n resources.includes(TranscendPullResource.PreferenceWorkflowConfigs)\n ? fetchAllConsentWorkflowTriggers(client, { logger })\n : [],\n resources.includes(TranscendPullResource.WorkflowConfigs)\n ? fetchAllWorkflowConfigs(client, {\n logger,\n workflowConfigType: WorkflowConfigType.DSR,\n })\n : [],\n resources.includes(TranscendPullResource.PreferenceOptions)\n ? fetchAllPreferenceOptionValues(client, { logger })\n : [],\n // Fetch silo discovery results\n resources.includes(TranscendPullResource.SystemDiscovery)\n ? fetchAllSiloDiscoveryResults(client, { logger })\n : [],\n ]);\n\n const consentManagerTheme =\n resources.includes(TranscendPullResource.ConsentManager) && consentManager\n ? await fetchConsentManagerTheme(client, {\n logger,\n filterBy: { airgapBundleId: consentManager.id },\n })\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 consentUiVariantSlug: experience.consentUiVariant?.slug,\n })),\n consentVariants: consentVariants.map(\n (variant): ConsentVariantInput => ({\n id: variant.id,\n name: variant.name,\n slug: variant.slug,\n // Backend returns null when unset; omit from yaml rather than writing null\n description: variant.description || undefined,\n configuration: JSON.stringify(variant.configuration),\n locales: variant.locales as LocaleValue[],\n status: variant.status,\n userFlow: variant.userFlow || undefined,\n themeSlug: variant.theme?.slug || undefined,\n }),\n ),\n consentThemes: consentThemes.map(\n (theme): ConsentThemeInput => ({\n id: theme.id,\n name: theme.name,\n slug: theme.slug,\n configuration: JSON.stringify(theme.configuration),\n }),\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 ({\n name,\n description,\n ssoDepartment,\n ssoGroup,\n ssoTitle,\n users,\n scopes,\n parentTeam,\n }): TeamInput => ({\n name,\n description,\n 'sso-department': ssoDepartment || undefined,\n 'sso-group': ssoGroup || undefined,\n 'sso-title': ssoTitle || undefined,\n 'parent-team-name': parentTeam?.name,\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 ({\n type,\n title,\n active,\n adminDashboardDefaultSilentMode,\n supportsAuthorizedAgent,\n actions,\n }): DataSubjectInput => ({\n type,\n title: title?.defaultMessage,\n active,\n adminDashboardDefaultSilentMode,\n supportsAuthorizedAgent,\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, type, versions, disabledLocales }): PolicyInput => ({\n title: title?.defaultMessage,\n type,\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 home: privacyCenter.home || undefined,\n expandSideMenuByDefault: privacyCenter.expandSideMenuByDefault,\n workflowsCustomFieldsRequired: privacyCenter.workflowsCustomFieldsRequired,\n footerLayout: privacyCenter.footerLayout,\n ...(privacyCenter.childOrganizations.length > 0\n ? {\n displayedChildOrganizationUris: privacyCenter.childOrganizations.map(\n (child) => child.uri,\n ),\n }\n : {}),\n ...(privacyCenter.footerLinks.length > 0\n ? {\n footerLinks: [...privacyCenter.footerLinks]\n .sort((a, b) => a.displayOrder - b.displayOrder)\n .map((link) => ({\n title: link.title.defaultMessage,\n ...(link.url ? { url: link.url } : {}),\n ...(link.iconOnly ? { iconOnly: link.iconOnly } : {}),\n })),\n }\n : {}),\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 slug,\n title,\n type,\n color,\n displayDescription,\n defaultConfiguration,\n showInPrivacyCenter,\n preferenceOptionValues,\n }): ConsentPreferenceTopic => ({\n slug,\n title: title.defaultMessage,\n type,\n color,\n description: displayDescription.defaultMessage,\n 'default-configuration': defaultConfiguration,\n 'show-in-privacy-center': showInPrivacyCenter,\n options:\n type === PreferenceTopicType.Boolean\n ? []\n : preferenceOptionValues.map(({ title, slug }) => ({\n title: title.defaultMessage,\n slug,\n })),\n }),\n ),\n }),\n );\n }\n\n if (workflowConfigs.length > 0 && resources.includes(TranscendPullResource.WorkflowConfigs)) {\n const pulledWorkflowConfigs = workflowConfigs.map(\n (config): WorkflowConfigInput => ({\n title: config.title.defaultMessage,\n 'action-type': config.action.type,\n ...(config.internalName ? { 'internal-name': config.internalName } : {}),\n ...(config.subtitle ? { subtitle: config.subtitle.defaultMessage } : {}),\n ...(config.description ? { description: config.description.defaultMessage } : {}),\n ...(config.subject ? { 'data-subject-type': config.subject.type } : {}),\n visibility: config.workflowConfigVisibility,\n type: config.workflowConfigType,\n ...(config.collectDataSubjectRegions\n ? {\n 'collect-data-subject-regions': config.collectDataSubjectRegions,\n }\n : {}),\n ...(config.regionList.length > 0 ? { 'region-list': config.regionList } : {}),\n ...(config.expiryTime && config.expiryTime.length > 0\n ? { 'expiry-time': config.expiryTime }\n : {}),\n ...(config.WorkflowConfigAttributeKeys && config.WorkflowConfigAttributeKeys.length > 0\n ? {\n 'attribute-keys': config.WorkflowConfigAttributeKeys.map(\n ({ attributeKey }) => attributeKey.name,\n ),\n }\n : {}),\n }),\n );\n // TODO: https://linear.app/transcend/issue/WAL-10312 - remove once internalName is unique in DB\n const configsByMatchKey = groupBy(workflowConfigs, workflowConfigMatchKey);\n for (const configs of Object.values(configsByMatchKey)) {\n if (configs.length > 1) {\n const sample = configs[0];\n logger.warn(\n `Found \"${configs.length}\" workflow configs with the same title, action-type, ` +\n `data-subject-type, and region-list for \"${sample.title.defaultMessage}\" ` +\n `(${sample.action.type}). Push will fail until they are disambiguated ` +\n '(for example with unique internal names).',\n );\n }\n }\n if (pulledWorkflowConfigs.length > 0) {\n result['workflow-configs'] = pulledWorkflowConfigs;\n }\n }\n\n if (\n preferenceWorkflowConfigs.length > 0 &&\n resources.includes(TranscendPullResource.PreferenceWorkflowConfigs)\n ) {\n const needsWorkflowTitles = preferenceWorkflowConfigs.some(\n (trigger) => trigger.workflowConfigId,\n );\n const dsrWorkflows = needsWorkflowTitles\n ? await fetchAllWorkflowConfigs(client, {\n logger,\n workflowConfigType: WorkflowConfigType.DSR,\n })\n : [];\n\n result['preference-workflow-configs'] = preferenceWorkflowConfigs.map(\n (trigger): PreferenceWorkflowConfigInput => {\n const purposes = parsePurposesFromTriggerCondition(trigger.triggerCondition);\n const shared = {\n name: trigger.name,\n 'data-subject-type': trigger.subject.type,\n 'is-silent': trigger.isSilent,\n 'allow-unauthenticated': trigger.allowUnauthenticated,\n 'is-active': trigger.isActive,\n purposes,\n };\n\n if (trigger.workflowConfigId) {\n const workflowTitle = resolveWorkflowTitleFromId(dsrWorkflows, trigger.workflowConfigId);\n if (workflowTitle) {\n return {\n ...shared,\n 'workflow-title': workflowTitle,\n };\n }\n // Workflow deleted or unreadable — fall back to legacy fields so YAML stays usable\n }\n\n return {\n ...shared,\n 'action-type': trigger.action.type,\n 'data-silo-titles':\n trigger.dataSilos.length > 0 ? trigger.dataSilos.map((ds) => ds.title) : undefined,\n };\n },\n );\n }\n\n if (\n preferenceOptionValues.length > 0 &&\n resources.includes(TranscendPullResource.PreferenceOptions)\n ) {\n result['preference-options'] = preferenceOptionValues.map(\n ({ slug, title }): ConsentPreferenceTopicOptionValue => ({\n slug,\n title: title.defaultMessage,\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 sombra,\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 'sombra-id': sombra?.id || undefined,\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":"wuDAUA,MAAa,EAAuB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmD3B,EAA0B;;;;;ECJtC,eAAsB,EACpB,EAC+B,CAC/B,IAAM,EAA4C,EAAE,CAChD,EAAS,EAET,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,wBAAyB,CAAE,UACzB,MAAM,EAMP,EAAQ,EAAsB,CAC/B,UAAW,CAAE,MAAO,GAAW,SAAQ,CACvC,SACD,CAAC,CACF,EAAoB,KAAK,GAAG,EAAM,CAClC,GAAU,GACV,EAAiB,EAAM,SAAW,SAC3B,GAET,OAAO,EAAoB,MAAM,EAAG,IAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC,CC6B3E,MAAa,EAAmC,+CAK/C,CA8BD,eAAsB,EACpB,EACA,CACE,cACA,mBACA,QACA,YAAY,EACZ,WACA,kBACA,2BACA,qBACA,kBAAkB,OAAO,OAAO,EAAqB,EAE9B,CACzB,GAAI,EAAY,OAAS,GAAK,EAAiB,OAAS,EACtD,MAAU,MAAM,4DAA4D,CAG9E,EAAO,KAAK,EAAO,QAAQ,gCAAgC,EAAS,KAAK,CAAC,CAG1E,GAAM,CACJ,EACA,GACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,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,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{sortBy as t}from"lodash-es";import n from"colors";import{makeGraphQLRequest as r}from"@transcend-io/sdk";import i from"cli-progress";import{gql as a}from"graphql-request";const o=a`
1
+ import{t as e}from"./logger-Ckep4QXn.mjs";import{sortBy as t}from"lodash-es";import n from"colors";import{makeGraphQLRequest as r}from"@transcend-io/sdk";import i from"cli-progress";import{gql as a}from"graphql-request";const o=a`
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{sortBy as t}from"lodash-es";imp
35
35
  }
36
36
  }
37
37
  `,{variables:{first:f,offset:x,filterBy:{...g}},logger:e});b=t[t.length-1]?.id,p.push(...t),y=t.length===f,v+=t.length,x+=t.length,h.update(v)}catch(t){throw e.error(n.red(`An error fetching subdatapoints for cursor ${b} and offset ${x}`)),t}while(y);h.stop();let S=new Date().getTime()-m,C=t(p,`name`);return e.info(n.green(`Successfully pulled in ${C.length} subdatapoints in ${S/1e3} seconds!`)),C}export{o as n,s as t};
38
- //# sourceMappingURL=pullUnstructuredSubDataPointRecommendations-DkQMoo7S.mjs.map
38
+ //# sourceMappingURL=pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pullUnstructuredSubDataPointRecommendations-DkQMoo7S.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 { makeGraphQLRequest } from '@transcend-io/sdk';\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 } 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 variables: { filterBy },\n logger,\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 variables: {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n },\n },\n logger,\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":"4NAEA,MAAa,EAAc,CAAG;;;;;;EC2D9B,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,UAAW,CAAE,WAAU,CACvB,SACD,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,UAAW,CACT,MAAO,EACP,SACA,SAAU,CACR,GAAG,EACJ,CACF,CACD,SACD,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,SACF,CAAG,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-B9xIDPf2.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 { makeGraphQLRequest } from '@transcend-io/sdk';\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 } 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 variables: { filterBy },\n logger,\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 variables: {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n },\n },\n logger,\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":"4NAEA,MAAa,EAAc,CAAG;;;;;;EC2D9B,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,UAAW,CAAE,WAAU,CACvB,SACD,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,UAAW,CACT,MAAO,EACP,SACA,SAAU,CACR,GAAG,EACJ,CACF,CACD,SACD,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,SACF,CAAG,EAEjB,EAAS,EAAO,EAAyC,OAAO,CAOtE,OALA,EAAO,KACL,EAAO,MACL,0BAA0B,EAAO,OAAO,oBAAoB,EAAY,IAAK,WAC9E,CACF,CACM"}
@@ -1,2 +1,2 @@
1
- import{a as e}from"./constants-cBzX_zyl.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./readCsv-D1e7WRTc.mjs";import{chunk as r}from"lodash-es";import i from"colors";import*as a from"io-ts";import{createSombraGotInstance as o}from"@transcend-io/sdk";import{map as s,mapSeries as c}from"@transcend-io/utils";import l from"cli-progress";const u=a.type({nonce:a.string,identifier:a.string});async function d(e,{nonce:t,identifier:n}){try{return await e.put(`v1/data-silo`,{headers:{"x-transcend-nonce":t},json:{profiles:[{profileId:n}]}}),!0}catch(e){if(e.response?.statusCode===409)return!1;throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function f({file:a,dataSiloId:f,auth:p,sombraAuth:m,concurrency:h=100,transcendUrl:g=e,sleepSeconds:_=10}){let v=await o(g,p,{logger:t,sombraApiKey:m,sombraUrl:process.env.SOMBRA_URL});t.info(i.magenta(`Reading "${a}" from disk`));let y=n(a,u);t.info(i.magenta(`Notifying Transcend for data silo "${f}" marking "${y.length}" identifiers as completed.`));let b=new Date().getTime(),x=new l.SingleBar({},l.Presets.shades_classic),S=0,C=0,w=0;x.start(y.length,0);let T=r(y,h),E=T.length;await c(T,async(e,n)=>{t.info(i.blue(`Processing chunk ${n+1}/${E} (${r.length} items)`)),await s(e,async e=>{try{await d(v,e)?S+=1:C+=1}catch(n){t.error(i.red(`Error notifying Transcend for identifier "${e.identifier}" - ${n?.message}`)),w+=1}x.update(S+C)}),_>0&&n<E-1&&(t.info(i.yellow(`Sleeping for ${_}s before next chunk...`)),await new Promise(e=>{setTimeout(e,_*1e3)}))}),x.stop();let D=new Date().getTime()-b;if(t.info(i.green(`Successfully notified Transcend for ${S} identifiers in "${D/1e3}" seconds!`)),C&&t.info(i.magenta(`There were ${C} identifiers that were not in a state to be updated.They likely have already been resolved.`)),w)throw t.error(i.red(`There were ${w} identifiers that failed to be updated. Please review the logs for more information.`)),Error(`Failed to update all identifiers`);return y.length}export{u as n,d as r,f as t};
2
- //# sourceMappingURL=pushCronIdentifiersFromCsv-Cc-POoSS.mjs.map
1
+ import{a as e}from"./constants-CEPYyv4h.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{t as n}from"./readCsv-C84Jhrzx.mjs";import{chunk as r}from"lodash-es";import i from"colors";import*as a from"io-ts";import{createSombraGotInstance as o}from"@transcend-io/sdk";import{map as s,mapSeries as c}from"@transcend-io/utils";import l from"cli-progress";const u=a.type({nonce:a.string,identifier:a.string});async function d(e,{nonce:t,identifier:n}){try{return await e.put(`v1/data-silo`,{headers:{"x-transcend-nonce":t},json:{profiles:[{profileId:n}]}}),!0}catch(e){if(e.response?.statusCode===409)return!1;throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function f({file:a,dataSiloId:f,auth:p,sombraAuth:m,concurrency:h=100,transcendUrl:g=e,sleepSeconds:_=10}){let v=await o(g,p,{logger:t,sombraApiKey:m,sombraUrl:process.env.SOMBRA_URL});t.info(i.magenta(`Reading "${a}" from disk`));let y=n(a,u);t.info(i.magenta(`Notifying Transcend for data silo "${f}" marking "${y.length}" identifiers as completed.`));let b=new Date().getTime(),x=new l.SingleBar({},l.Presets.shades_classic),S=0,C=0,w=0;x.start(y.length,0);let T=r(y,h),E=T.length;await c(T,async(e,n)=>{t.info(i.blue(`Processing chunk ${n+1}/${E} (${r.length} items)`)),await s(e,async e=>{try{await d(v,e)?S+=1:C+=1}catch(n){t.error(i.red(`Error notifying Transcend for identifier "${e.identifier}" - ${n?.message}`)),w+=1}x.update(S+C)}),_>0&&n<E-1&&(t.info(i.yellow(`Sleeping for ${_}s before next chunk...`)),await new Promise(e=>{setTimeout(e,_*1e3)}))}),x.stop();let D=new Date().getTime()-b;if(t.info(i.green(`Successfully notified Transcend for ${S} identifiers in "${D/1e3}" seconds!`)),C&&t.info(i.magenta(`There were ${C} identifiers that were not in a state to be updated.They likely have already been resolved.`)),w)throw t.error(i.red(`There were ${w} identifiers that failed to be updated. Please review the logs for more information.`)),Error(`Failed to update all identifiers`);return y.length}export{u as n,d as r,f as t};
2
+ //# sourceMappingURL=pushCronIdentifiersFromCsv-CehtFgXS.mjs.map