@transcend-io/cli 10.1.0 → 10.2.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 (262) hide show
  1. package/dist/{app-Cx8-4u8K.mjs → app-DLzaZHc8.mjs} +20 -20
  2. package/dist/{app-Cx8-4u8K.mjs.map → app-DLzaZHc8.mjs.map} +1 -1
  3. package/dist/{approvePrivacyRequests-Bjq5cPSI.mjs → approvePrivacyRequests-BlUcYXpH.mjs} +2 -2
  4. package/dist/{approvePrivacyRequests-Bjq5cPSI.mjs.map → approvePrivacyRequests-BlUcYXpH.mjs.map} +1 -1
  5. package/dist/bin/bash-complete.mjs +1 -1
  6. package/dist/bin/cli.mjs +1 -1
  7. package/dist/bin/deprecated-command.mjs +1 -1
  8. package/dist/{buildXdiSyncEndpoint-DWs9ImOw.mjs → buildXdiSyncEndpoint-D5GxPH6o.mjs} +2 -2
  9. package/dist/{buildXdiSyncEndpoint-DWs9ImOw.mjs.map → buildXdiSyncEndpoint-D5GxPH6o.mjs.map} +1 -1
  10. package/dist/bulkRestartRequests-DILDBdc1.mjs +2 -0
  11. package/dist/bulkRestartRequests-DILDBdc1.mjs.map +1 -0
  12. package/dist/bulkRetryEnrichers-CjSz1472.mjs +2 -0
  13. package/dist/bulkRetryEnrichers-CjSz1472.mjs.map +1 -0
  14. package/dist/cancelPrivacyRequests-BWJZmZVY.mjs +2 -0
  15. package/dist/cancelPrivacyRequests-BWJZmZVY.mjs.map +1 -0
  16. package/dist/{collectCsvFilesOrExit-D-csvd13.mjs → collectCsvFilesOrExit-CbtyKAzu.mjs} +1 -1
  17. package/dist/{collectCsvFilesOrExit-D-csvd13.mjs.map → collectCsvFilesOrExit-CbtyKAzu.mjs.map} +1 -1
  18. package/dist/{collectParquetFilesOrExit-C8qT5_57.mjs → collectParquetFilesOrExit-BJiAyaQ5.mjs} +1 -1
  19. package/dist/{collectParquetFilesOrExit-C8qT5_57.mjs.map → collectParquetFilesOrExit-BJiAyaQ5.mjs.map} +1 -1
  20. package/dist/{command-rzZKmlky.mjs → command-BMa3UWax.mjs} +2 -2
  21. package/dist/{command-rzZKmlky.mjs.map → command-BMa3UWax.mjs.map} +1 -1
  22. package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
  23. package/dist/{consentManagersToBusinessEntities-D1bdBgnA.mjs → consentManagersToBusinessEntities-BdKDganK.mjs} +1 -1
  24. package/dist/{consentManagersToBusinessEntities-D1bdBgnA.mjs.map → consentManagersToBusinessEntities-BdKDganK.mjs.map} +1 -1
  25. package/dist/{constants-mjLYTIJm.mjs → constants-BmwXDQu9.mjs} +2 -2
  26. package/dist/{constants-mjLYTIJm.mjs.map → constants-BmwXDQu9.mjs.map} +1 -1
  27. package/dist/{constants-DYbzl8QH.mjs → constants-ClkQQhJs.mjs} +1 -1
  28. package/dist/{constants-DYbzl8QH.mjs.map → constants-ClkQQhJs.mjs.map} +1 -1
  29. package/dist/{constants-XOsAW1__.mjs → constants-TpID7AXE.mjs} +2 -2
  30. package/dist/{constants-XOsAW1__.mjs.map → constants-TpID7AXE.mjs.map} +1 -1
  31. package/dist/{createExtraKeyHandler-Jp5XpTJi.mjs → createExtraKeyHandler-BO4lu0HO.mjs} +2 -2
  32. package/dist/{createExtraKeyHandler-Jp5XpTJi.mjs.map → createExtraKeyHandler-BO4lu0HO.mjs.map} +1 -1
  33. package/dist/{dataFlowsToDataSilos-DUj1NhOt.mjs → dataFlowsToDataSilos-Ca2DtTsd.mjs} +1 -1
  34. package/dist/{dataFlowsToDataSilos-DUj1NhOt.mjs.map → dataFlowsToDataSilos-Ca2DtTsd.mjs.map} +1 -1
  35. package/dist/{done-input-validation-C5rgR0Wr.mjs → done-input-validation-BcNBxhEs.mjs} +1 -1
  36. package/dist/{done-input-validation-C5rgR0Wr.mjs.map → done-input-validation-BcNBxhEs.mjs.map} +1 -1
  37. package/dist/{downloadPrivacyRequestFiles-GUbd_PRc.mjs → downloadPrivacyRequestFiles-8DtRUNXp.mjs} +2 -2
  38. package/dist/{downloadPrivacyRequestFiles-GUbd_PRc.mjs.map → downloadPrivacyRequestFiles-8DtRUNXp.mjs.map} +1 -1
  39. package/dist/{extractClientError-X9wJVqGq.mjs → extractClientError-i-Tw_az7.mjs} +1 -1
  40. package/dist/{extractClientError-X9wJVqGq.mjs.map → extractClientError-i-Tw_az7.mjs.map} +1 -1
  41. package/dist/{fetchAllRequests-xGgt_STo.mjs → fetchAllRequests-CHHdyb4Q.mjs} +2 -2
  42. package/dist/{fetchAllRequests-xGgt_STo.mjs.map → fetchAllRequests-CHHdyb4Q.mjs.map} +1 -1
  43. package/dist/generateCrossAccountApiKeys-D6hg9146.mjs +2 -0
  44. package/dist/generateCrossAccountApiKeys-D6hg9146.mjs.map +1 -0
  45. package/dist/{impl-ogUHfunr.mjs → impl--VlanXjT.mjs} +2 -2
  46. package/dist/{impl-ogUHfunr.mjs.map → impl--VlanXjT.mjs.map} +1 -1
  47. package/dist/{impl-B-PzeHxN.mjs → impl-3VLH9aat.mjs} +2 -2
  48. package/dist/{impl-B-PzeHxN.mjs.map → impl-3VLH9aat.mjs.map} +1 -1
  49. package/dist/{impl-DfVep2mE.mjs → impl-6mCOBlSD.mjs} +2 -2
  50. package/dist/{impl-DfVep2mE.mjs.map → impl-6mCOBlSD.mjs.map} +1 -1
  51. package/dist/impl-AEjPyfhu.mjs +2 -0
  52. package/dist/impl-AEjPyfhu.mjs.map +1 -0
  53. package/dist/{impl-CZsYoSZQ.mjs → impl-BC17WMY4.mjs} +2 -2
  54. package/dist/{impl-CZsYoSZQ.mjs.map → impl-BC17WMY4.mjs.map} +1 -1
  55. package/dist/{impl-yvc0y1uO.mjs → impl-BECek1in.mjs} +2 -2
  56. package/dist/{impl-yvc0y1uO.mjs.map → impl-BECek1in.mjs.map} +1 -1
  57. package/dist/{impl-B6TXE2oE.mjs → impl-BKvcmB7W.mjs} +2 -2
  58. package/dist/{impl-B6TXE2oE.mjs.map → impl-BKvcmB7W.mjs.map} +1 -1
  59. package/dist/impl-BNDNzc2I.mjs +2 -0
  60. package/dist/impl-BNDNzc2I.mjs.map +1 -0
  61. package/dist/{impl-Cy8-6_Oo2.mjs → impl-BTZOd3VN.mjs} +2 -2
  62. package/dist/impl-BTZOd3VN.mjs.map +1 -0
  63. package/dist/{impl-BffzTHKU.mjs → impl-BXb07jBU.mjs} +2 -2
  64. package/dist/{impl-BffzTHKU.mjs.map → impl-BXb07jBU.mjs.map} +1 -1
  65. package/dist/{impl-BBnnC5xq.mjs → impl-BaHZqboi.mjs} +2 -2
  66. package/dist/{impl-BBnnC5xq.mjs.map → impl-BaHZqboi.mjs.map} +1 -1
  67. package/dist/{impl-BSKl6rC6.mjs → impl-BhnojAfL.mjs} +2 -2
  68. package/dist/{impl-BSKl6rC6.mjs.map → impl-BhnojAfL.mjs.map} +1 -1
  69. package/dist/{impl-CqH3YYuv.mjs → impl-BjCQSRLu.mjs} +2 -2
  70. package/dist/{impl-CqH3YYuv.mjs.map → impl-BjCQSRLu.mjs.map} +1 -1
  71. package/dist/{impl-Cpndlxar.mjs → impl-BjIylEKQ.mjs} +2 -2
  72. package/dist/{impl-Cpndlxar.mjs.map → impl-BjIylEKQ.mjs.map} +1 -1
  73. package/dist/{impl-DKAV-8XC.mjs → impl-BsecIND0.mjs} +2 -2
  74. package/dist/{impl-DKAV-8XC.mjs.map → impl-BsecIND0.mjs.map} +1 -1
  75. package/dist/{impl-Dw9uW5zy2.mjs → impl-BtIsgTGn.mjs} +2 -2
  76. package/dist/impl-BtIsgTGn.mjs.map +1 -0
  77. package/dist/{impl-BMnXA_Vd.mjs → impl-BuvbXmXj.mjs} +2 -2
  78. package/dist/{impl-BMnXA_Vd.mjs.map → impl-BuvbXmXj.mjs.map} +1 -1
  79. package/dist/{impl-BBKJIP0Q.mjs → impl-C71CkarV.mjs} +2 -2
  80. package/dist/{impl-BBKJIP0Q.mjs.map → impl-C71CkarV.mjs.map} +1 -1
  81. package/dist/{impl-CpJljZV2.mjs → impl-CIYSnaMG.mjs} +2 -2
  82. package/dist/{impl-CpJljZV2.mjs.map → impl-CIYSnaMG.mjs.map} +1 -1
  83. package/dist/{impl-DhXQb3bm.mjs → impl-CLznNZ5F.mjs} +2 -2
  84. package/dist/{impl-DhXQb3bm.mjs.map → impl-CLznNZ5F.mjs.map} +1 -1
  85. package/dist/{impl-BGGm947r2.mjs → impl-CR6tW9Jz.mjs} +2 -2
  86. package/dist/impl-CR6tW9Jz.mjs.map +1 -0
  87. package/dist/{impl-CPIMsZg-.mjs → impl-CScy-GrG.mjs} +2 -2
  88. package/dist/{impl-CPIMsZg-.mjs.map → impl-CScy-GrG.mjs.map} +1 -1
  89. package/dist/{impl-uwkj-RbF.mjs → impl-CYS38cQM.mjs} +2 -2
  90. package/dist/{impl-uwkj-RbF.mjs.map → impl-CYS38cQM.mjs.map} +1 -1
  91. package/dist/{impl-BVnfUDUm.mjs → impl-Cw3_0zqC.mjs} +2 -2
  92. package/dist/{impl-BVnfUDUm.mjs.map → impl-Cw3_0zqC.mjs.map} +1 -1
  93. package/dist/{impl-D_AxguFh2.mjs → impl-CxwEMQhw.mjs} +2 -2
  94. package/dist/impl-CxwEMQhw.mjs.map +1 -0
  95. package/dist/{impl-DaK9UOwL.mjs → impl-CzvCA0Ev.mjs} +2 -2
  96. package/dist/{impl-DaK9UOwL.mjs.map → impl-CzvCA0Ev.mjs.map} +1 -1
  97. package/dist/{impl-StdJMCiM.mjs → impl-DAkBsgQN.mjs} +2 -2
  98. package/dist/{impl-StdJMCiM.mjs.map → impl-DAkBsgQN.mjs.map} +1 -1
  99. package/dist/{impl-iGMjSniP.mjs → impl-DAu079Yl.mjs} +2 -2
  100. package/dist/{impl-iGMjSniP.mjs.map → impl-DAu079Yl.mjs.map} +1 -1
  101. package/dist/{impl-BKrNGF2F.mjs → impl-DTaM3UE3.mjs} +2 -2
  102. package/dist/{impl-BKrNGF2F.mjs.map → impl-DTaM3UE3.mjs.map} +1 -1
  103. package/dist/{impl-CnHiD4zU.mjs → impl-DWiE5RsV.mjs} +2 -2
  104. package/dist/{impl-CnHiD4zU.mjs.map → impl-DWiE5RsV.mjs.map} +1 -1
  105. package/dist/{impl-CODwodEc.mjs → impl-DXHqqWJb.mjs} +2 -2
  106. package/dist/{impl-CODwodEc.mjs.map → impl-DXHqqWJb.mjs.map} +1 -1
  107. package/dist/impl-DZicly6r.mjs +2 -0
  108. package/dist/{impl-BVHfSIVG.mjs.map → impl-DZicly6r.mjs.map} +1 -1
  109. package/dist/{impl-CvJtt8H2.mjs → impl-DbGCApR_.mjs} +2 -2
  110. package/dist/{impl-CvJtt8H2.mjs.map → impl-DbGCApR_.mjs.map} +1 -1
  111. package/dist/{impl-BxOydpyJ.mjs → impl-DgG4lZ9T.mjs} +2 -2
  112. package/dist/{impl-BxOydpyJ.mjs.map → impl-DgG4lZ9T.mjs.map} +1 -1
  113. package/dist/{impl-DpwyYsfg.mjs → impl-Dik9I7Bz.mjs} +2 -2
  114. package/dist/{impl-DpwyYsfg.mjs.map → impl-Dik9I7Bz.mjs.map} +1 -1
  115. package/dist/impl-Djlx-Dqj.mjs +2 -0
  116. package/dist/impl-Djlx-Dqj.mjs.map +1 -0
  117. package/dist/{impl-CC0rkA9s.mjs → impl-DmQAAT-u.mjs} +2 -2
  118. package/dist/{impl-CC0rkA9s.mjs.map → impl-DmQAAT-u.mjs.map} +1 -1
  119. package/dist/{impl-C3DXXn8M.mjs → impl-DpuPyy-w.mjs} +2 -2
  120. package/dist/{impl-C3DXXn8M.mjs.map → impl-DpuPyy-w.mjs.map} +1 -1
  121. package/dist/{impl-C-u5h8We.mjs → impl-Du8quB1O.mjs} +2 -2
  122. package/dist/{impl-C-u5h8We.mjs.map → impl-Du8quB1O.mjs.map} +1 -1
  123. package/dist/{impl-BRiRfzgu.mjs → impl-OxHej0UO.mjs} +2 -2
  124. package/dist/{impl-BRiRfzgu.mjs.map → impl-OxHej0UO.mjs.map} +1 -1
  125. package/dist/{impl-DJ4VCAcc.mjs → impl-c7VvcNpZ.mjs} +2 -2
  126. package/dist/{impl-DJ4VCAcc.mjs.map → impl-c7VvcNpZ.mjs.map} +1 -1
  127. package/dist/{impl-DvrSuAJv.mjs → impl-fZQxhZRu.mjs} +2 -2
  128. package/dist/{impl-DvrSuAJv.mjs.map → impl-fZQxhZRu.mjs.map} +1 -1
  129. package/dist/{impl-DpGVNllB.mjs → impl-xtlx25UP.mjs} +2 -2
  130. package/dist/{impl-DpGVNllB.mjs.map → impl-xtlx25UP.mjs.map} +1 -1
  131. package/dist/{impl-Cw10WeUv.mjs → impl-yMumZUUX.mjs} +2 -2
  132. package/dist/{impl-Cw10WeUv.mjs.map → impl-yMumZUUX.mjs.map} +1 -1
  133. package/dist/index.d.mts +895 -1698
  134. package/dist/index.d.mts.map +1 -1
  135. package/dist/index.mjs +4 -4
  136. package/dist/index.mjs.map +1 -1
  137. package/dist/{inquirer-DyRwhvoh.mjs → inquirer-BqZXFEt1.mjs} +2 -2
  138. package/dist/{inquirer-DyRwhvoh.mjs.map → inquirer-BqZXFEt1.mjs.map} +1 -1
  139. package/dist/{listFiles-Odj7j2E1.mjs → listFiles-D2wMHnEr.mjs} +1 -1
  140. package/dist/{listFiles-Odj7j2E1.mjs.map → listFiles-D2wMHnEr.mjs.map} +1 -1
  141. package/dist/markRequestDataSiloIdsCompleted-sDBo1vUD.mjs +2 -0
  142. package/dist/markRequestDataSiloIdsCompleted-sDBo1vUD.mjs.map +1 -0
  143. package/dist/{markSilentPrivacyRequests-ytCzpUkY.mjs → markSilentPrivacyRequests-Cmn1fxHI.mjs} +2 -2
  144. package/dist/{markSilentPrivacyRequests-ytCzpUkY.mjs.map → markSilentPrivacyRequests-Cmn1fxHI.mjs.map} +1 -1
  145. package/dist/notifyPrivacyRequestsAdditionalTime-CmhFE4b0.mjs +2 -0
  146. package/dist/notifyPrivacyRequestsAdditionalTime-CmhFE4b0.mjs.map +1 -0
  147. package/dist/{parquetToCsvOneFile-bgEgRoAi.mjs → parquetToCsvOneFile-B84XXInh.mjs} +1 -1
  148. package/dist/{parquetToCsvOneFile-bgEgRoAi.mjs.map → parquetToCsvOneFile-B84XXInh.mjs.map} +1 -1
  149. package/dist/{parseAttributesFromString-B8h4DudO.mjs → parseAttributesFromString-D1Yl0xwT.mjs} +2 -2
  150. package/dist/{parseAttributesFromString-B8h4DudO.mjs.map → parseAttributesFromString-D1Yl0xwT.mjs.map} +1 -1
  151. package/dist/parseVariablesFromString-BeKOGw5n.mjs +3 -0
  152. package/dist/parseVariablesFromString-BeKOGw5n.mjs.map +1 -0
  153. package/dist/pullAllDatapoints-Bbmky50p.mjs +45 -0
  154. package/dist/pullAllDatapoints-Bbmky50p.mjs.map +1 -0
  155. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-QRET4M0x.mjs +2 -0
  156. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-QRET4M0x.mjs.map +1 -0
  157. package/dist/{pullConsentManagerMetrics-BO0hYPDG.mjs → pullConsentManagerMetrics-zKgjc3Ap.mjs} +1 -1
  158. package/dist/{pullConsentManagerMetrics-BO0hYPDG.mjs.map → pullConsentManagerMetrics-zKgjc3Ap.mjs.map} +1 -1
  159. package/dist/pullManualEnrichmentIdentifiersToCsv-8I6PgBQc.mjs +2 -0
  160. package/dist/pullManualEnrichmentIdentifiersToCsv-8I6PgBQc.mjs.map +1 -0
  161. package/dist/pullTranscendConfiguration-DjOELnPo.mjs +58 -0
  162. package/dist/pullTranscendConfiguration-DjOELnPo.mjs.map +1 -0
  163. package/dist/{pullUnstructuredSubDataPointRecommendations-jE-tdoVK.mjs → pullUnstructuredSubDataPointRecommendations-D0z-vPgq.mjs} +3 -3
  164. package/dist/{pullUnstructuredSubDataPointRecommendations-jE-tdoVK.mjs.map → pullUnstructuredSubDataPointRecommendations-D0z-vPgq.mjs.map} +1 -1
  165. package/dist/{pushCronIdentifiersFromCsv-D9Hzna0W.mjs → pushCronIdentifiersFromCsv-CBb2FvPD.mjs} +2 -2
  166. package/dist/{pushCronIdentifiersFromCsv-D9Hzna0W.mjs.map → pushCronIdentifiersFromCsv-CBb2FvPD.mjs.map} +1 -1
  167. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BiR7PS_d.mjs → pushManualEnrichmentIdentifiersFromCsv-DYQq7hsN.mjs} +2 -2
  168. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BiR7PS_d.mjs.map → pushManualEnrichmentIdentifiersFromCsv-DYQq7hsN.mjs.map} +1 -1
  169. package/dist/{readCsv-0PIlJQCN.mjs → readCsv-C4TyEs-r.mjs} +1 -1
  170. package/dist/{readCsv-0PIlJQCN.mjs.map → readCsv-C4TyEs-r.mjs.map} +1 -1
  171. package/dist/removeUnverifiedRequestIdentifiers-VCbL2BXD.mjs +2 -0
  172. package/dist/removeUnverifiedRequestIdentifiers-VCbL2BXD.mjs.map +1 -0
  173. package/dist/{request-SLqRySNU.mjs → request-DfkRPQFr.mjs} +1 -1
  174. package/dist/{request-SLqRySNU.mjs.map → request-DfkRPQFr.mjs.map} +1 -1
  175. package/dist/retryRequestDataSilos-BCe-WGdL.mjs +2 -0
  176. package/dist/retryRequestDataSilos-BCe-WGdL.mjs.map +1 -0
  177. package/dist/skipPreflightJobs-Bc0--Bvs.mjs +2 -0
  178. package/dist/skipPreflightJobs-Bc0--Bvs.mjs.map +1 -0
  179. package/dist/skipRequestDataSilos-BHbAQkpb.mjs +2 -0
  180. package/dist/skipRequestDataSilos-BHbAQkpb.mjs.map +1 -0
  181. package/dist/streamPrivacyRequestsToCsv-eB3gNhol.mjs +2 -0
  182. package/dist/streamPrivacyRequestsToCsv-eB3gNhol.mjs.map +1 -0
  183. package/dist/{syncCodePackages-BOS5foh6.mjs → syncCodePackages-CAk_Hjyl.mjs} +1 -1
  184. package/dist/{syncCodePackages-BOS5foh6.mjs.map → syncCodePackages-CAk_Hjyl.mjs.map} +1 -1
  185. package/dist/updateConsentManagerVersionToLatest-D6i1Xh6o.mjs +2 -0
  186. package/dist/updateConsentManagerVersionToLatest-D6i1Xh6o.mjs.map +1 -0
  187. package/dist/{uploadConsents-BP5XILuw.mjs → uploadConsents-BTM49EbZ.mjs} +2 -2
  188. package/dist/{uploadConsents-BP5XILuw.mjs.map → uploadConsents-BTM49EbZ.mjs.map} +1 -1
  189. package/dist/{uploadCookiesFromCsv-B42cZgYW.mjs → uploadCookiesFromCsv-DoC9rtEF.mjs} +2 -2
  190. package/dist/{uploadCookiesFromCsv-B42cZgYW.mjs.map → uploadCookiesFromCsv-DoC9rtEF.mjs.map} +1 -1
  191. package/dist/{uploadDataFlowsFromCsv-D2V567pP.mjs → uploadDataFlowsFromCsv-DL1-cAit.mjs} +2 -2
  192. package/dist/{uploadDataFlowsFromCsv-D2V567pP.mjs.map → uploadDataFlowsFromCsv-DL1-cAit.mjs.map} +1 -1
  193. package/dist/uploadPrivacyRequestsFromCsv-wXm4H4FH.mjs +2 -0
  194. package/dist/uploadPrivacyRequestsFromCsv-wXm4H4FH.mjs.map +1 -0
  195. package/dist/{validateTranscendAuth-DCwAtgvh.mjs → validateTranscendAuth-Cuh2Qfdl.mjs} +1 -1
  196. package/dist/{validateTranscendAuth-DCwAtgvh.mjs.map → validateTranscendAuth-Cuh2Qfdl.mjs.map} +1 -1
  197. package/dist/{writeCsv-Da8NUe1V.mjs → writeCsv-C4pjXGsD.mjs} +1 -1
  198. package/dist/{writeCsv-Da8NUe1V.mjs.map → writeCsv-C4pjXGsD.mjs.map} +1 -1
  199. package/package.json +8 -8
  200. package/dist/RequestDataSilo-Rrc2dL9g.mjs +0 -54
  201. package/dist/RequestDataSilo-Rrc2dL9g.mjs.map +0 -1
  202. package/dist/bulkRestartRequests-sie3tM3W.mjs +0 -2
  203. package/dist/bulkRestartRequests-sie3tM3W.mjs.map +0 -1
  204. package/dist/bulkRetryEnrichers-C1RrxiTR.mjs +0 -2
  205. package/dist/bulkRetryEnrichers-C1RrxiTR.mjs.map +0 -1
  206. package/dist/cancelPrivacyRequests-DmvFijq_.mjs +0 -2
  207. package/dist/cancelPrivacyRequests-DmvFijq_.mjs.map +0 -1
  208. package/dist/dataSilo-Dvi8-PkH.mjs +0 -302
  209. package/dist/dataSilo-Dvi8-PkH.mjs.map +0 -1
  210. package/dist/dataSubject-CF784Ug0.mjs +0 -92
  211. package/dist/dataSubject-CF784Ug0.mjs.map +0 -1
  212. package/dist/fetchAllRequestEnrichers-Bt97Bb7F.mjs +0 -42
  213. package/dist/fetchAllRequestEnrichers-Bt97Bb7F.mjs.map +0 -1
  214. package/dist/fetchAllRequestIdentifiers-BXx3rSee.mjs +0 -10
  215. package/dist/fetchAllRequestIdentifiers-BXx3rSee.mjs.map +0 -1
  216. package/dist/fetchRequestDataSilo-0UvyeL60.mjs +0 -2
  217. package/dist/fetchRequestDataSilo-0UvyeL60.mjs.map +0 -1
  218. package/dist/fetchRequestFilesForRequest-CJH2iB-P.mjs +0 -33
  219. package/dist/fetchRequestFilesForRequest-CJH2iB-P.mjs.map +0 -1
  220. package/dist/generateCrossAccountApiKeys-DztJoLQS.mjs +0 -2
  221. package/dist/generateCrossAccountApiKeys-DztJoLQS.mjs.map +0 -1
  222. package/dist/impl-BGGm947r2.mjs.map +0 -1
  223. package/dist/impl-BVHfSIVG.mjs +0 -2
  224. package/dist/impl-BfeWet_F2.mjs +0 -2
  225. package/dist/impl-BfeWet_F2.mjs.map +0 -1
  226. package/dist/impl-Cy8-6_Oo2.mjs.map +0 -1
  227. package/dist/impl-D_AxguFh2.mjs.map +0 -1
  228. package/dist/impl-Dw9uW5zy2.mjs.map +0 -1
  229. package/dist/impl-PdIU1pLr2.mjs +0 -2
  230. package/dist/impl-PdIU1pLr2.mjs.map +0 -1
  231. package/dist/impl-daUiLV3c.mjs +0 -2
  232. package/dist/impl-daUiLV3c.mjs.map +0 -1
  233. package/dist/markRequestDataSiloIdsCompleted-DJSICILv.mjs +0 -2
  234. package/dist/markRequestDataSiloIdsCompleted-DJSICILv.mjs.map +0 -1
  235. package/dist/notifyPrivacyRequestsAdditionalTime-D8v68eAg.mjs +0 -2
  236. package/dist/notifyPrivacyRequestsAdditionalTime-D8v68eAg.mjs.map +0 -1
  237. package/dist/parseVariablesFromString-CvoeZZ75.mjs +0 -23
  238. package/dist/parseVariablesFromString-CvoeZZ75.mjs.map +0 -1
  239. package/dist/pullAllDatapoints-CqgqXRbp.mjs +0 -45
  240. package/dist/pullAllDatapoints-CqgqXRbp.mjs.map +0 -1
  241. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DaYEDZ66.mjs +0 -2
  242. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DaYEDZ66.mjs.map +0 -1
  243. package/dist/pullManualEnrichmentIdentifiersToCsv-BNuhsG20.mjs +0 -2
  244. package/dist/pullManualEnrichmentIdentifiersToCsv-BNuhsG20.mjs.map +0 -1
  245. package/dist/pullTranscendConfiguration-DSyMRyPe.mjs +0 -58
  246. package/dist/pullTranscendConfiguration-DSyMRyPe.mjs.map +0 -1
  247. package/dist/removeUnverifiedRequestIdentifiers-B0Gx09XN.mjs +0 -35
  248. package/dist/removeUnverifiedRequestIdentifiers-B0Gx09XN.mjs.map +0 -1
  249. package/dist/retryRequestDataSilos-DFjFhhC0.mjs +0 -2
  250. package/dist/retryRequestDataSilos-DFjFhhC0.mjs.map +0 -1
  251. package/dist/skipPreflightJobs-Bm8lZZk-.mjs +0 -2
  252. package/dist/skipPreflightJobs-Bm8lZZk-.mjs.map +0 -1
  253. package/dist/skipRequestDataSilos-B5FByYTj.mjs +0 -2
  254. package/dist/skipRequestDataSilos-B5FByYTj.mjs.map +0 -1
  255. package/dist/streamPrivacyRequestsToCsv-CBzh80oQ.mjs +0 -2
  256. package/dist/streamPrivacyRequestsToCsv-CBzh80oQ.mjs.map +0 -1
  257. package/dist/syncEnrichers-C9HcWCrs.mjs +0 -3
  258. package/dist/syncEnrichers-C9HcWCrs.mjs.map +0 -1
  259. package/dist/updateConsentManagerVersionToLatest-X1HAM_IX.mjs +0 -2
  260. package/dist/updateConsentManagerVersionToLatest-X1HAM_IX.mjs.map +0 -1
  261. package/dist/uploadPrivacyRequestsFromCsv-Czc3vGfJ.mjs +0 -2
  262. package/dist/uploadPrivacyRequestsFromCsv-Czc3vGfJ.mjs.map +0 -1
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-XOsAW1__.mjs";import{t}from"./logger-Bj782ZYD.mjs";import n from"colors";import{assumeRole as r,buildTranscendGraphQLClientGeneric as i,createApiKey as a,deleteApiKey as o,fetchAllApiKeys as s,loginUser as c}from"@transcend-io/sdk";import{mapSeries as l}from"@transcend-io/utils";async function u({email:u,password:d,scopes:f,apiKeyTitle:p,parentOrganizationId:m,deleteExistingApiKey:h=!0,createNewApiKey:g=!0,transcendUrl:_=e}){let v=await i(_,{});t.info(n.magenta(`Logging in using email and password.`));let{roles:y,loginCookie:b}=await c(v,{email:u,password:d,logger:t});t.info(n.green(`Successfully logged in and found ${y.length} role${y.length===1?``:`s`}!`));let x=m?y.filter(e=>e.organization.id===m||e.organization.parentOrganizationId===m):y;v.setHeaders({Cookie:b});let S=[],C=[];return t.info(n.magenta(`Generating API keys with title: ${p}, scopes: ${f.join(`,`)}.`)),await l(x,async e=>{try{await r(v,{roleId:e.id,email:u,logger:t}),t.info(n.magenta(`Checking if API key already exists in organization "${e.organization.name}" with title: "${p}".`));let[i]=await s(v,{titles:[p],logger:t});if(i&&h)t.info(n.yellow(`Deleting existing API key in "${e.organization.name}" with title: "${p}".`)),await o(v,i.id,{logger:t}),t.info(n.green(`Successfully deleted API key in "${e.organization.name}" with title: "${p}".`));else if(i)throw Error(`API key already exists with title: "${p}"`);if(g){t.info(n.magenta(`Creating API key in "${e.organization.name}" with title: "${p}".`));let{apiKey:r}=await a(v,{title:p,scopes:f},{logger:t});S.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:r}),t.info(n.green(`Successfully created API key in "${e.organization.name}" with title: "${p}".`))}else S.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:``})}catch(r){t.error(n.red(`Failed to create API key in organization "${e.organization.name}"! - ${r.message}`)),C.push({organizationName:e.organization.name,organizationId:e.organization.id,error:r.message})}}),t.info(n.green(`Successfully created ${S.length} API key${S.length===1?``:`s`}`)),C.length>0&&t.error(n.red(`Failed to create ${C.length} API key${C.length===1?``:`s`}!`)),{errors:C,apiKeys:S}}export{u as t};
2
- //# sourceMappingURL=generateCrossAccountApiKeys-DztJoLQS.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateCrossAccountApiKeys-DztJoLQS.mjs","names":[],"sources":["../src/lib/api-keys/generateCrossAccountApiKeys.ts"],"sourcesContent":["import { ScopeName } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClientGeneric,\n loginUser,\n createApiKey,\n fetchAllApiKeys,\n deleteApiKey,\n assumeRole,\n} from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { StoredApiKey } from '../../codecs.js';\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\n\nexport interface ApiKeyGenerateError {\n /** Name of instance */\n organizationName: string;\n /** Error */\n error: string;\n /** Organization ID API key is for */\n organizationId: string;\n}\n\n/**\n * Generate API keys across multiple transcend accounts\n *\n * @param options - Options\n * @returns Number of API keys created\n */\nexport async function generateCrossAccountApiKeys({\n email,\n password,\n scopes,\n apiKeyTitle,\n parentOrganizationId,\n deleteExistingApiKey = true,\n createNewApiKey = true,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** Email address of user generating API keys */\n email: string;\n /** Password of user generating API keys */\n password: string;\n /** Filter for organizations that match this parent organization ID */\n parentOrganizationId?: string;\n /** Title of the API create to create */\n apiKeyTitle: string;\n /** Title of the API create to create */\n scopes: ScopeName[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** When true delete existing API keys with that title, if set to false an API key exists with that title, an error is thrown */\n deleteExistingApiKey?: boolean;\n /** When true, generate new API keys, otherwise only will delete past API keys */\n createNewApiKey?: boolean;\n}): Promise<{\n /** Successfully generated */\n apiKeys: StoredApiKey[];\n /** Error results */\n errors: ApiKeyGenerateError[];\n}> {\n // Create GraphQL client\n const client = await buildTranscendGraphQLClientGeneric(transcendUrl, {});\n\n // Login the user\n logger.info(colors.magenta('Logging in using email and password.'));\n const { roles, loginCookie } = await loginUser(client, { email, password, logger });\n logger.info(\n colors.green(\n `Successfully logged in and found ${roles.length} role${roles.length === 1 ? '' : 's'}!`,\n ),\n );\n\n // Filter down by parentOrganizationId\n const filteredRoles = parentOrganizationId\n ? roles.filter(\n (role) =>\n role.organization.id === parentOrganizationId ||\n role.organization.parentOrganizationId === parentOrganizationId,\n )\n : roles;\n\n // Save cookie to call route subsequent times\n client.setHeaders({\n Cookie: loginCookie,\n });\n\n // Save the resulting API keys\n const results: StoredApiKey[] = [];\n const errors: ApiKeyGenerateError[] = [];\n\n // Generate API keys\n logger.info(\n colors.magenta(`Generating API keys with title: ${apiKeyTitle}, scopes: ${scopes.join(',')}.`),\n );\n\n // Map over each role\n await mapSeries(filteredRoles, async (role) => {\n try {\n // Log into the other instance\n await assumeRole(client, { roleId: role.id, email, logger });\n\n // Grab API keys with that title\n logger.info(\n colors.magenta(\n `Checking if API key already exists in organization \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n\n // Delete existing API key\n const [apiKeyWithTitle] = await fetchAllApiKeys(client, { titles: [apiKeyTitle], logger });\n if (apiKeyWithTitle && deleteExistingApiKey) {\n logger.info(\n colors.yellow(\n `Deleting existing API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n await deleteApiKey(client, apiKeyWithTitle.id, { logger });\n logger.info(\n colors.green(\n `Successfully deleted API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else if (apiKeyWithTitle) {\n // throw error if one exists but not configured to delete\n throw new Error(`API key already exists with title: \"${apiKeyTitle}\"`);\n }\n\n // Create the API key\n if (createNewApiKey) {\n logger.info(\n colors.magenta(\n `Creating API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n const { apiKey } = await createApiKey(client, { title: apiKeyTitle, scopes }, { logger });\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey,\n });\n logger.info(\n colors.green(\n `Successfully created API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else {\n // Delete only\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey: '',\n });\n }\n } catch (err) {\n logger.error(\n colors.red(\n `Failed to create API key in organization \"${role.organization.name}\"! - ${err.message}`,\n ),\n );\n errors.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n error: err.message,\n });\n }\n });\n logger.info(\n colors.green(\n `Successfully created ${results.length} API key${results.length === 1 ? '' : 's'}`,\n ),\n );\n\n if (errors.length > 0) {\n logger.error(\n colors.red(`Failed to create ${errors.length} API key${errors.length === 1 ? '' : 's'}!`),\n );\n }\n\n return { errors, apiKeys: results };\n}\n"],"mappings":"uTA+BA,eAAsB,EAA4B,CAChD,QACA,WACA,SACA,cACA,uBACA,uBAAuB,GACvB,kBAAkB,GAClB,eAAe,GAuBd,CAED,IAAM,EAAS,MAAM,EAAmC,EAAc,EAAE,CAAC,CAGzE,EAAO,KAAK,EAAO,QAAQ,uCAAuC,CAAC,CACnE,GAAM,CAAE,QAAO,eAAgB,MAAM,EAAU,EAAQ,CAAE,QAAO,WAAU,SAAQ,CAAC,CACnF,EAAO,KACL,EAAO,MACL,oCAAoC,EAAM,OAAO,OAAO,EAAM,SAAW,EAAI,GAAK,IAAI,GACvF,CACF,CAGD,IAAM,EAAgB,EAClB,EAAM,OACH,GACC,EAAK,aAAa,KAAO,GACzB,EAAK,aAAa,uBAAyB,EAC9C,CACD,EAGJ,EAAO,WAAW,CAChB,OAAQ,EACT,CAAC,CAGF,IAAM,EAA0B,EAAE,CAC5B,EAAgC,EAAE,CA0FxC,OAvFA,EAAO,KACL,EAAO,QAAQ,mCAAmC,EAAY,YAAY,EAAO,KAAK,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AC,GAEJ,CACF,EAAO,KACL,EAAO,MACL,wBAAwB,EAAQ,OAAO,UAAU,EAAQ,SAAW,EAAI,GAAK,MAC9E,CACF,CAEG,EAAO,OAAS,GAClB,EAAO,MACL,EAAO,IAAI,oBAAoB,EAAO,OAAO,UAAU,EAAO,SAAW,EAAI,GAAK,IAAI,GAAG,CAC1F,CAGI,CAAE,SAAQ,QAAS,EAAS"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-BGGm947r2.mjs","names":["skipRequestDataSilosHelper"],"sources":["../src/commands/request/system/skip-request-data-silos/impl.ts"],"sourcesContent":["import type {\n RequestAction,\n RequestDataSiloStatus,\n RequestStatus,\n} from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { skipRequestDataSilos as skipRequestDataSilosHelper } from '../../../../lib/requests/index.js';\n\nexport interface SkipRequestDataSilosCommandFlags {\n auth: string;\n dataSiloId: string;\n transcendUrl: string;\n statuses: RequestStatus[];\n status: (typeof RequestDataSiloStatus)['Skipped'] | (typeof RequestDataSiloStatus)['Resolved'];\n actionTypes?: RequestAction[];\n}\n\nexport async function skipRequestDataSilos(\n this: LocalContext,\n {\n auth,\n dataSiloId,\n status,\n statuses,\n transcendUrl,\n actionTypes,\n }: SkipRequestDataSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await skipRequestDataSilosHelper({\n transcendUrl,\n auth,\n status,\n dataSiloId,\n requestStatuses: statuses,\n actionTypes,\n });\n}\n"],"mappings":"4GAmBA,eAAsB,EAEpB,CACE,OACA,aACA,SACA,WACA,eACA,eAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAA2B,CAC/B,eACA,OACA,SACA,aACA,gBAAiB,EACjB,cACD,CAAC"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./uploadCookiesFromCsv-B42cZgYW.mjs";import{t}from"./done-input-validation-C5rgR0Wr.mjs";async function n({auth:n,trackerStatus:r,file:i,transcendUrl:a}){t(this.process.exit),await e({auth:n,trackerStatus:r,file:i,transcendUrl:a})}export{n as uploadCookiesFromCsv};
2
- //# sourceMappingURL=impl-BVHfSIVG.mjs.map
@@ -1,2 +0,0 @@
1
- import{t as e}from"./retryRequestDataSilos-DFjFhhC0.mjs";import{t}from"./done-input-validation-C5rgR0Wr.mjs";async function n({auth:n,dataSiloId:r,actions:i,transcendUrl:a}){t(this.process.exit),await e({requestActions:i,transcendUrl:a,auth:n,dataSiloId:r})}export{n as retryRequestDataSilos};
2
- //# sourceMappingURL=impl-BfeWet_F2.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-BfeWet_F2.mjs","names":["retryRequestDataSilosHelper"],"sources":["../src/commands/request/system/retry-request-data-silos/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { retryRequestDataSilos as retryRequestDataSilosHelper } from '../../../../lib/requests/index.js';\n\nexport interface RetryRequestDataSilosCommandFlags {\n auth: string;\n dataSiloId: string;\n actions: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function retryRequestDataSilos(\n this: LocalContext,\n { auth, dataSiloId, actions, transcendUrl }: RetryRequestDataSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await retryRequestDataSilosHelper({\n requestActions: actions,\n transcendUrl,\n auth,\n dataSiloId,\n });\n}\n"],"mappings":"6GAaA,eAAsB,EAEpB,CAAE,OAAM,aAAY,UAAS,gBACd,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAA4B,CAChC,eAAgB,EAChB,eACA,OACA,aACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-Cy8-6_Oo2.mjs","names":[],"sources":["../src/commands/request/preflight/push-identifiers/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { pushManualEnrichmentIdentifiersFromCsv } from '../../../../lib/manual-enrichment/index.js';\n\nexport interface PushIdentifiersCommandFlags {\n auth: string;\n enricherId: string;\n sombraAuth?: string;\n transcendUrl: string;\n file: string;\n markSilent: boolean;\n concurrency: number;\n}\n\nexport async function pushIdentifiers(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n enricherId,\n concurrency,\n markSilent,\n sombraAuth,\n }: PushIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await pushManualEnrichmentIdentifiersFromCsv({\n file,\n transcendUrl,\n enricherId,\n concurrency,\n markSilent,\n auth,\n sombraAuth,\n });\n}\n"],"mappings":"8HAcA,eAAsB,EAEpB,CACE,OACA,eACA,OACA,aACA,cACA,aACA,cAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAuC,CAC3C,OACA,eACA,aACA,cACA,aACA,OACA,aACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-D_AxguFh2.mjs","names":[],"sources":["../src/commands/request/restart/impl.ts"],"sourcesContent":["import type { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { bulkRestartRequests } from '../../../lib/requests/index.js';\n\nexport interface RestartCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses: RequestStatus[];\n transcendUrl: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n requestIds?: string[];\n emailIsVerified: boolean;\n createdAt?: Date;\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n sendEmailReceipt: boolean;\n copyIdentifiers: boolean;\n skipWaitingPeriod: boolean;\n}\n\nexport async function restart(\n this: LocalContext,\n {\n auth,\n requestReceiptFolder,\n sombraAuth,\n actions,\n statuses,\n requestIds,\n createdAt,\n emailIsVerified,\n silentModeBefore,\n sendEmailReceipt,\n copyIdentifiers,\n skipWaitingPeriod,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n concurrency,\n transcendUrl,\n }: RestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRestartRequests({\n requestReceiptFolder,\n auth,\n sombraAuth,\n requestActions: actions,\n requestStatuses: statuses,\n requestIds,\n createdAt,\n emailIsVerified,\n silentModeBefore,\n sendEmailReceipt,\n copyIdentifiers,\n skipWaitingPeriod,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n concurrency,\n transcendUrl,\n });\n}\n"],"mappings":"2GA2BA,eAAsB,EAEpB,CACE,OACA,uBACA,aACA,UACA,WACA,aACA,YACA,kBACA,mBACA,mBACA,kBACA,oBACA,kBACA,iBACA,kBACA,iBACA,cACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAoB,CACxB,uBACA,OACA,aACA,eAAgB,EAChB,gBAAiB,EACjB,aACA,YACA,kBACA,mBACA,mBACA,kBACA,oBACA,kBACA,iBACA,kBACA,iBACA,cACA,eACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-Dw9uW5zy2.mjs","names":[],"sources":["../src/commands/request/reject-unverified-identifiers/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { removeUnverifiedRequestIdentifiers } from '../../../lib/requests/index.js';\n\nexport interface RejectUnverifiedIdentifiersCommandFlags {\n auth: string;\n identifierNames: string[];\n actions?: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function rejectUnverifiedIdentifiers(\n this: LocalContext,\n { auth, transcendUrl, identifierNames, actions = [] }: RejectUnverifiedIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await removeUnverifiedRequestIdentifiers({\n requestActions: actions,\n transcendUrl,\n auth,\n identifierNames,\n });\n}\n"],"mappings":"0HAaA,eAAsB,EAEpB,CAAE,OAAM,eAAc,kBAAiB,UAAU,EAAE,EACpC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAmC,CACvC,eAAgB,EAChB,eACA,OACA,kBACD,CAAC"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./skipPreflightJobs-Bm8lZZk-.mjs";import{t}from"./done-input-validation-C5rgR0Wr.mjs";async function n({auth:n,transcendUrl:r,enricherIds:i}){t(this.process.exit),await e({transcendUrl:r,auth:n,enricherIds:i})}export{n as skipPreflightJobs};
2
- //# sourceMappingURL=impl-PdIU1pLr2.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-PdIU1pLr2.mjs","names":["skipPreflightJobsHelper"],"sources":["../src/commands/request/skip-preflight-jobs/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { skipPreflightJobs as skipPreflightJobsHelper } from '../../../lib/requests/index.js';\n\nexport interface SkipPreflightJobsCommandFlags {\n auth: string;\n enricherIds: string[];\n transcendUrl: string;\n}\n\nexport async function skipPreflightJobs(\n this: LocalContext,\n { auth, transcendUrl, enricherIds }: SkipPreflightJobsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await skipPreflightJobsHelper({\n transcendUrl,\n auth,\n enricherIds,\n });\n}\n"],"mappings":"yGAUA,eAAsB,EAEpB,CAAE,OAAM,eAAc,eACP,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAAwB,CAC5B,eACA,OACA,cACD,CAAC"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{t}from"./fetchRequestFilesForRequest-CJH2iB-P.mjs";import{t as n}from"./pullChunkedCustomSiloOutstandingIdentifiers-DaYEDZ66.mjs";import{i as r,s as i}from"./writeCsv-Da8NUe1V.mjs";import{t as a}from"./done-input-validation-C5rgR0Wr.mjs";import{chunk as o,uniq as s}from"lodash-es";import c from"colors";import{buildTranscendGraphQLClient as l}from"@transcend-io/sdk";import{map as u}from"@transcend-io/utils";async function d({file:d,fileTarget:f,transcendUrl:p,auth:m,sombraAuth:h,cronDataSiloId:g,targetDataSiloId:_,actions:v,skipRequestCount:y,pageLimit:b,chunkSize:x}){y&&e.info(c.yellow(`Skipping request count as requested. This may help speed up the call.`)),(Number.isNaN(x)||x<=0||x%b!==0)&&(e.error(c.red(`Invalid chunk size: "${x}". Must be a positive integer that is a multiple of ${b}.`)),this.process.exit(1)),a(this.process.exit);let S=l(p,m),{baseName:C,extension:w}=r(d),{baseName:T,extension:E}=r(f),D=0,O=0,k=0;await n({dataSiloId:g,auth:m,sombraAuth:h,actions:v,apiPageSize:b,savePageSize:x,onSave:async n=>{D+=n.length;let r=await u(o(s(n.map(e=>e.requestId)),b),async n=>(e.info(c.magenta(`Fetching target identifiers for ${n.length} requests`)),(await t(S,b*2,{requestIds:n,dataSiloIds:[_]})).map(({fileName:e,remoteId:t})=>{if(!t)throw Error(`Failed to find remoteId for ${e}`);return{RecordId:t,Object:e.replace(`.json`,``).split(`/`).pop()?.replace(` Information`,``),Comment:`Customer data deletion request submitted via transcend.io`}})),{concurrency:1});O+=r.flat().length;let a=s(n.map(e=>Object.keys(e)).flat()),l=`${C}-${k}${w}`,p=`${T}-${k}${E}`;await i(l,n,a),e.info(c.green(`Successfully wrote ${n.length} identifiers to file "${d}"`));let m=r.flat();await i(p,m,s(m.map(e=>Object.keys(e)).flat())),e.info(c.green(`Successfully wrote ${m.length} identifiers to file "${f}"`)),e.info(c.blue(`Processed chunk of ${o.length} identifiers, found ${m.length} target identifiers`)),k+=1},transcendUrl:p,skipRequestCount:y}),e.info(c.green(`Successfully wrote ${D} identifiers to file "${d}"`)),e.info(c.green(`Successfully wrote ${O} identifiers to file "${f}"`))}export{d as pullProfiles};
2
- //# sourceMappingURL=impl-daUiLV3c.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-daUiLV3c.mjs","names":[],"sources":["../src/commands/request/cron/pull-profiles/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { uniq, chunk } from 'lodash-es';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport {\n pullChunkedCustomSiloOutstandingIdentifiers,\n type CsvFormattedIdentifier,\n} from '../../../../lib/cron/index.js';\nimport { fetchRequestFilesForRequest } from '../../../../lib/graphql/index.js';\nimport { parseFilePath, writeLargeCsv } from '../../../../lib/helpers/index.js';\nimport { logger } from '../../../../logger.js';\n\nexport interface PullProfilesCommandFlags {\n file: string;\n fileTarget: string;\n transcendUrl: string;\n auth: string;\n sombraAuth?: string;\n cronDataSiloId: string;\n targetDataSiloId: string;\n actions: RequestAction[];\n skipRequestCount: boolean;\n pageLimit: number;\n chunkSize: number;\n}\n\nexport async function pullProfiles(\n this: LocalContext,\n {\n file,\n fileTarget,\n transcendUrl,\n auth,\n sombraAuth,\n cronDataSiloId,\n targetDataSiloId,\n actions,\n skipRequestCount,\n pageLimit,\n chunkSize,\n }: PullProfilesCommandFlags,\n): Promise<void> {\n if (skipRequestCount) {\n logger.info(\n colors.yellow('Skipping request count as requested. This may help speed up the call.'),\n );\n }\n\n if (Number.isNaN(chunkSize) || chunkSize <= 0 || chunkSize % pageLimit !== 0) {\n logger.error(\n colors.red(\n `Invalid chunk size: \"${chunkSize}\". Must be a positive integer that is a multiple of ${pageLimit}.`,\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const { baseName, extension } = parseFilePath(file);\n const { baseName: baseNameTarget, extension: extensionTarget } = parseFilePath(fileTarget);\n\n let allIdentifiersCount = 0;\n let allTargetIdentifiersCount = 0;\n let fileCount = 0;\n // Create onSave callback to handle chunked processing\n const onSave = async (chunkToSave: CsvFormattedIdentifier[]): Promise<void> => {\n // Add to all identifiers\n allIdentifiersCount += chunkToSave.length;\n\n // Get unique request IDs from this chunk\n const requestIds = chunkToSave.map((d) => d.requestId as string);\n const uniqueRequestIds = uniq(requestIds);\n\n // Pull down target identifiers for this chunk\n const chunkedRequestIds = chunk(uniqueRequestIds, pageLimit);\n const results = await map(\n chunkedRequestIds,\n async (requestIds) => {\n logger.info(\n colors.magenta(`Fetching target identifiers for ${requestIds.length} requests`),\n );\n const results = await fetchRequestFilesForRequest(client, pageLimit * 2, {\n requestIds,\n dataSiloIds: [targetDataSiloId],\n });\n return results.map(({ fileName, remoteId }) => {\n if (!remoteId) {\n throw new Error(`Failed to find remoteId for ${fileName}`);\n }\n return {\n RecordId: remoteId,\n Object: fileName.replace('.json', '').split('/').pop()?.replace(' Information', ''),\n Comment: 'Customer data deletion request submitted via transcend.io',\n };\n });\n },\n // We are grabbing all the request files for the 'pageLimit' # of requests at a time\n {\n concurrency: 1,\n },\n );\n\n allTargetIdentifiersCount += results.flat().length;\n\n // Write the identifiers and target identifiers to CSV\n const headers = uniq(chunkToSave.map((d) => Object.keys(d)).flat());\n const numberedFileName = `${baseName}-${fileCount}${extension}`;\n const numberedFileNameTarget = `${baseNameTarget}-${fileCount}${extensionTarget}`;\n await writeLargeCsv(numberedFileName, chunkToSave, headers);\n logger.info(\n colors.green(`Successfully wrote ${chunkToSave.length} identifiers to file \"${file}\"`),\n );\n\n const targetIdentifiers = results.flat();\n const headers2 = uniq(targetIdentifiers.map((d) => Object.keys(d)).flat());\n await writeLargeCsv(numberedFileNameTarget, targetIdentifiers, headers2);\n logger.info(\n colors.green(\n `Successfully wrote ${targetIdentifiers.length} identifiers to file \"${fileTarget}\"`,\n ),\n );\n\n logger.info(\n colors.blue(\n `Processed chunk of ${chunk.length} identifiers, found ${targetIdentifiers.length} target identifiers`,\n ),\n );\n fileCount += 1;\n };\n\n // Pull down outstanding identifiers using the new chunked function\n await pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId: cronDataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize: pageLimit,\n savePageSize: chunkSize,\n onSave,\n transcendUrl,\n skipRequestCount,\n });\n\n logger.info(\n colors.green(`Successfully wrote ${allIdentifiersCount} identifiers to file \"${file}\"`),\n );\n logger.info(\n colors.green(\n `Successfully wrote ${allTargetIdentifiersCount} identifiers to file \"${fileTarget}\"`,\n ),\n );\n}\n"],"mappings":"2cA8BA,eAAsB,EAEpB,CACE,OACA,aACA,eACA,OACA,aACA,iBACA,mBACA,UACA,mBACA,YACA,aAEa,CACX,GACF,EAAO,KACL,EAAO,OAAO,wEAAwE,CACvF,EAGC,OAAO,MAAM,EAAU,EAAI,GAAa,GAAK,EAAY,IAAc,KACzE,EAAO,MACL,EAAO,IACL,wBAAwB,EAAU,sDAAsD,EAAU,GACnG,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAS,EAA4B,EAAc,EAAK,CACxD,CAAE,WAAU,aAAc,EAAc,EAAK,CAC7C,CAAE,SAAU,EAAgB,UAAW,GAAoB,EAAc,EAAW,CAEtF,EAAsB,EACtB,EAA4B,EAC5B,EAAY,EAoEhB,MAAM,EAA4C,CAChD,WAAY,EACZ,OACA,aACA,UACA,YAAa,EACb,aAAc,EACd,OAzEa,KAAO,IAAyD,CAE7E,GAAuB,EAAY,OAQnC,IAAM,EAAU,MAAM,EADI,EAHD,EADN,EAAY,IAAK,GAAM,EAAE,UAAoB,CACvB,CAGS,EAAU,CAG1D,KAAO,KACL,EAAO,KACL,EAAO,QAAQ,mCAAmC,EAAW,OAAO,WAAW,CAChF,EACe,MAAM,EAA4B,EAAQ,EAAY,EAAG,CACvE,aACA,YAAa,CAAC,EAAiB,CAChC,CAAC,EACa,KAAK,CAAE,WAAU,cAAe,CAC7C,GAAI,CAAC,EACH,MAAU,MAAM,+BAA+B,IAAW,CAE5D,MAAO,CACL,SAAU,EACV,OAAQ,EAAS,QAAQ,QAAS,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,QAAQ,eAAgB,GAAG,CACnF,QAAS,4DACV,EACD,EAGJ,CACE,YAAa,EACd,CACF,CAED,GAA6B,EAAQ,MAAM,CAAC,OAG5C,IAAM,EAAU,EAAK,EAAY,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAC7D,EAAmB,GAAG,EAAS,GAAG,IAAY,IAC9C,EAAyB,GAAG,EAAe,GAAG,IAAY,IAChE,MAAM,EAAc,EAAkB,EAAa,EAAQ,CAC3D,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAY,OAAO,wBAAwB,EAAK,GAAG,CACvF,CAED,IAAM,EAAoB,EAAQ,MAAM,CAExC,MAAM,EAAc,EAAwB,EAD3B,EAAK,EAAkB,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CACF,CACxE,EAAO,KACL,EAAO,MACL,sBAAsB,EAAkB,OAAO,wBAAwB,EAAW,GACnF,CACF,CAED,EAAO,KACL,EAAO,KACL,sBAAsB,EAAM,OAAO,sBAAsB,EAAkB,OAAO,qBACnF,CACF,CACD,GAAa,GAYb,eACA,mBACD,CAAC,CAEF,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAoB,wBAAwB,EAAK,GAAG,CACxF,CACD,EAAO,KACL,EAAO,MACL,sBAAsB,EAA0B,wBAAwB,EAAW,GACpF,CACF"}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-XOsAW1__.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{t as n}from"./RequestDataSilo-Rrc2dL9g.mjs";import{t as r}from"./fetchRequestDataSilo-0UvyeL60.mjs";import{RequestDataSiloStatus as i}from"@transcend-io/privacy-types";import a from"colors";import{buildTranscendGraphQLClient as o,makeGraphQLRequest as s}from"@transcend-io/sdk";import{map as c}from"@transcend-io/utils";import l from"cli-progress";async function u({requestIds:u,dataSiloId:d,auth:f,concurrency:p=100,status:m=i.Resolved,transcendUrl:h=e}){let g=o(h,f),_=new Date().getTime(),v=new l.SingleBar({},l.Presets.shades_classic);t.info(a.magenta(`Notifying Transcend for data silo "${d}" marking "${u.length}" requests as completed.`));let y=0;v.start(u.length,0),await c(u,async e=>{let i=await r(g,{requestId:e,dataSiloId:d});try{await s(g,n,{variables:{requestDataSiloId:i.id,status:m},logger:t})}catch(e){if(!e.message.includes(`Client error: Request must be active:`)&&!e.message.includes(`Failed to find RequestDataSilo`))throw e}y+=1,v.update(y)},{concurrency:p}),v.stop();let b=new Date().getTime()-_;return t.info(a.green(`Successfully notified Transcend in "${b/1e3}" seconds!`)),u.length}export{u as t};
2
- //# sourceMappingURL=markRequestDataSiloIdsCompleted-DJSICILv.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markRequestDataSiloIdsCompleted-DJSICILv.mjs","names":[],"sources":["../src/lib/cron/markRequestDataSiloIdsCompleted.ts"],"sourcesContent":["import { RequestDataSiloStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, makeGraphQLRequest } from '@transcend-io/sdk';\nimport { map } 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 { CHANGE_REQUEST_DATA_SILO_STATUS, fetchRequestDataSilo } from '../graphql/index.js';\n\n/**\n * Given a CSV of Request IDs, mark associated RequestDataSilos as completed\n *\n * @param options - Options\n * @returns Number of items marked as completed\n */\nexport async function markRequestDataSiloIdsCompleted({\n requestIds,\n dataSiloId,\n auth,\n concurrency = 100,\n status = RequestDataSiloStatus.Resolved,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The list of request ids to mark as completed */\n requestIds: string[];\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** Status to update requests to */\n status?: RequestDataSiloStatus;\n /** Upload concurrency */\n concurrency?: number;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<number> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\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\n // Notify Transcend\n logger.info(\n colors.magenta(\n `Notifying Transcend for data silo \"${dataSiloId}\" marking \"${requestIds.length}\" requests as completed.`,\n ),\n );\n\n let total = 0;\n progressBar.start(requestIds.length, 0);\n await map(\n requestIds,\n async (requestId) => {\n const requestDataSilo = await fetchRequestDataSilo(client, {\n requestId,\n dataSiloId,\n });\n\n try {\n await makeGraphQLRequest<{\n /** Whether we successfully uploaded the results */\n success: boolean;\n }>(client, CHANGE_REQUEST_DATA_SILO_STATUS, {\n variables: {\n requestDataSiloId: requestDataSilo.id,\n status,\n },\n logger,\n });\n } catch (err) {\n if (\n !err.message.includes('Client error: Request must be active:') &&\n !err.message.includes('Failed to find RequestDataSilo')\n ) {\n throw err;\n }\n }\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(colors.green(`Successfully notified Transcend in \"${totalTime / 1000}\" seconds!`));\n return requestIds.length;\n}\n"],"mappings":"qbAgBA,eAAsB,EAAgC,CACpD,aACA,aACA,OACA,cAAc,IACd,SAAS,EAAsB,SAC/B,eAAe,GAcG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAGrF,EAAO,KACL,EAAO,QACL,sCAAsC,EAAW,aAAa,EAAW,OAAO,0BACjF,CACF,CAED,IAAI,EAAQ,EACZ,EAAY,MAAM,EAAW,OAAQ,EAAE,CACvC,MAAM,EACJ,EACA,KAAO,IAAc,CACnB,IAAM,EAAkB,MAAM,EAAqB,EAAQ,CACzD,YACA,aACD,CAAC,CAEF,GAAI,CACF,MAAM,EAGH,EAAQ,EAAiC,CAC1C,UAAW,CACT,kBAAmB,EAAgB,GACnC,SACD,CACD,SACD,CAAC,OACK,EAAK,CACZ,GACE,CAAC,EAAI,QAAQ,SAAS,wCAAwC,EAC9D,CAAC,EAAI,QAAQ,SAAS,iCAAiC,CAEvD,MAAM,EAIV,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAGvB,OADA,EAAO,KAAK,EAAO,MAAM,uCAAuC,EAAY,IAAK,YAAY,CAAC,CACvF,EAAW"}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-XOsAW1__.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{r as n}from"./request-SLqRySNU.mjs";import{r}from"./fetchAllRequests-xGgt_STo.mjs";import{RequestAction as i}from"@transcend-io/privacy-types";import a from"colors";import{buildTranscendGraphQLClient as o,fetchAllTemplates as s,makeGraphQLRequest as c}from"@transcend-io/sdk";import{map as l}from"@transcend-io/utils";import u from"cli-progress";async function d({requestActions:d=Object.values(i),auth:f,requestIds:p,createdAtBefore:m,days:h=45,daysLeft:g=10,createdAtAfter:_,updatedAtBefore:v,updatedAtAfter:y,emailTemplate:b=`Additional Time Needed`,concurrency:x=100,transcendUrl:S=e}){let C=o(S,f),w=new Date().getTime(),T=new u.SingleBar({},u.Presets.shades_classic),E=(await s(C,{title:b,logger:t})).find(e=>e.title===b);if(!E)throw Error(`Failed to find a template with title: "${b}"`);let D=await r(C,{actions:d,createdAtBefore:m,createdAtAfter:_,updatedAtBefore:v,updatedAtAfter:y,isSilent:!1,isClosed:!1,requestIds:p});D=D.filter(e=>typeof e.daysRemaining==`number`&&e.daysRemaining<g),t.info(a.magenta(`Notifying "${D.length}" that more time is needed.`));let O=0;T.start(D.length,0),await l(D,async e=>{await c(C,n,{variables:{input:{requestId:e.id,template:E.template.defaultMessage,subject:E.subject.defaultMessage,additionalTime:h}},logger:t}),O+=1,T.update(O)},{concurrency:x}),T.stop();let k=new Date().getTime()-w;return t.info(a.green(`Successfully marked ${O} requests as silent mode in "${k/1e3}" seconds!`)),D.length}export{d as t};
2
- //# sourceMappingURL=notifyPrivacyRequestsAdditionalTime-D8v68eAg.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notifyPrivacyRequestsAdditionalTime-D8v68eAg.mjs","names":[],"sources":["../src/lib/requests/notifyPrivacyRequestsAdditionalTime.ts"],"sourcesContent":["import { RequestAction } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n fetchAllTemplates,\n makeGraphQLRequest,\n} from '@transcend-io/sdk';\nimport { map } 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 { NOTIFY_ADDITIONAL_TIME, fetchAllRequests } from '../graphql/index.js';\n\n/**\n * Mark a set of privacy requests to be in silent mode.\n * Note requests in silent mode are ignored\n *\n * @param options - Options\n * @returns The number of requests marked silent\n */\nexport async function notifyPrivacyRequestsAdditionalTime({\n requestActions = Object.values(RequestAction),\n auth,\n requestIds,\n createdAtBefore,\n days = 45,\n daysLeft = 10,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n emailTemplate = 'Additional Time Needed',\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The request actions that should be restarted */\n requestActions?: RequestAction[];\n /** Filter for requests created before this date */\n createdAtBefore: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** Email template */\n emailTemplate?: string;\n /** Transcend API key authentication */\n auth: string;\n /** Number of days to extend request by */\n days?: number;\n /**\n * Only notify requests that have less than this number of days until they are considered expired.\n * This allows for re-running the command without notifying the same users multiple times\n */\n daysLeft?: number;\n /** Concurrency limit for approving */\n concurrency?: number;\n /** The set of privacy requests to notify */\n requestIds?: string[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<number> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\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\n // Grab the template with that title\n const matchingTemplates = await fetchAllTemplates(client, {\n title: emailTemplate,\n logger,\n });\n const exactTemplateMatch = matchingTemplates.find((template) => template.title === emailTemplate);\n if (!exactTemplateMatch) {\n throw new Error(`Failed to find a template with title: \"${emailTemplate}\"`);\n }\n\n // Pull in the requests\n let allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isSilent: false,\n isClosed: false,\n requestIds,\n });\n\n // Filter requests by daysLeft\n allRequests = allRequests.filter(\n (request) => typeof request.daysRemaining === 'number' && request.daysRemaining < daysLeft,\n );\n\n // Notify Transcend\n logger.info(colors.magenta(`Notifying \"${allRequests.length}\" that more time is needed.`));\n\n let total = 0;\n progressBar.start(allRequests.length, 0);\n await map(\n allRequests,\n async (requestToNotify) => {\n await makeGraphQLRequest(client, NOTIFY_ADDITIONAL_TIME, {\n variables: {\n input: {\n requestId: requestToNotify.id,\n template: exactTemplateMatch.template.defaultMessage,\n subject: exactTemplateMatch.subject.defaultMessage,\n additionalTime: days,\n },\n },\n logger,\n });\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully marked ${total} requests as silent mode in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n return allRequests.length;\n}\n"],"mappings":"mbAqBA,eAAsB,EAAoC,CACxD,iBAAiB,OAAO,OAAO,EAAc,CAC7C,OACA,aACA,kBACA,OAAO,GACP,WAAW,GACX,iBACA,kBACA,iBACA,gBAAgB,yBAChB,cAAc,IACd,eAAe,GA6BG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAO/E,GAJoB,MAAM,EAAkB,EAAQ,CACxD,MAAO,EACP,SACD,CAAC,EAC2C,KAAM,GAAa,EAAS,QAAU,EAAc,CACjG,GAAI,CAAC,EACH,MAAU,MAAM,0CAA0C,EAAc,GAAG,CAI7E,IAAI,EAAc,MAAM,EAAiB,EAAQ,CAC/C,QAAS,EACT,kBACA,iBACA,kBACA,iBACA,SAAU,GACV,SAAU,GACV,aACD,CAAC,CAGF,EAAc,EAAY,OACvB,GAAY,OAAO,EAAQ,eAAkB,UAAY,EAAQ,cAAgB,EACnF,CAGD,EAAO,KAAK,EAAO,QAAQ,cAAc,EAAY,OAAO,6BAA6B,CAAC,CAE1F,IAAI,EAAQ,EACZ,EAAY,MAAM,EAAY,OAAQ,EAAE,CACxC,MAAM,EACJ,EACA,KAAO,IAAoB,CACzB,MAAM,EAAmB,EAAQ,EAAwB,CACvD,UAAW,CACT,MAAO,CACL,UAAW,EAAgB,GAC3B,SAAU,EAAmB,SAAS,eACtC,QAAS,EAAmB,QAAQ,eACpC,eAAgB,EACjB,CACF,CACD,SACD,CAAC,CAEF,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAOvB,OALA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAM,+BAA+B,EAAY,IAAK,YAC9E,CACF,CACM,EAAY"}
@@ -1,23 +0,0 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{i as t,r as n}from"./dataSubject-CF784Ug0.mjs";import{c as r,d as i,f as a,n as o,s}from"./syncEnrichers-C9HcWCrs.mjs";import{difference as c,flatten as l,keyBy as u,uniq as d}from"lodash-es";import{getEntries as f}from"@transcend-io/type-utils";import p from"colors";import{fetchAllActions as ee,fetchAllAttributes as te,fetchAllIdentifiers as m,fetchApiKeys as ne,makeGraphQLRequest as h,syncAction as re,syncActionItemCollections as g,syncActionItems as _,syncAgentFiles as ie,syncAgentFunctions as ae,syncAgents as oe,syncAttribute as se,syncBusinessEntities as ce,syncConsentManager as v,syncCookies as y,syncDataCategories as le,syncDataFlows as ue,syncIntlMessages as de,syncPartitions as b,syncPolicies as fe,syncPrivacyCenter as pe,syncProcessingActivities as me,syncProcessingPurposes as he,syncPromptGroups as ge,syncPromptPartials as _e,syncPrompts as ve,syncTeams as ye,syncTemplate as be,syncVendors as xe}from"@transcend-io/sdk";import{map as x,mapSeries as S}from"@transcend-io/utils";import{gql as C}from"graphql-request";const w=C`
2
- query TranscendCliNewIdentifierTypes {
3
- newIdentifierTypes {
4
- name
5
- }
6
- }
7
- `,T=C`
8
- mutation TranscendCliCreateIdentifier($input: IdentifierInput!) {
9
- createIdentifier(input: $input) {
10
- identifier {
11
- id
12
- name
13
- }
14
- }
15
- }
16
- `,E=C`
17
- mutation TranscendCliUpdateIdentifier($input: UpdateIdentifierInput!) {
18
- updateIdentifier(input: $input) {
19
- clientMutationId
20
- }
21
- }
22
- `;async function D({enrichers:t=[],"data-silos":n=[],identifiers:r=[]},i,a=!1){let o=await m(i,{logger:e}),s=u(o,`name`),f=c(d([...l(t.map(e=>[e[`input-identifier`],...e[`output-identifiers`]])),...l(n.map(e=>e[`identity-keys`])),...r.map(({name:e})=>e)]).filter(e=>!!e),o.map(({name:e})=>e));if(f.length>0){e.info(p.magenta(`Creating ${f.length} new identifiers...`));let{newIdentifierTypes:t}=await h(i,w,{logger:e}),n=t.map(({name:e})=>e);await S(f,async t=>{e.info(p.magenta(`Creating identifier ${t}...`));let{createIdentifier:r}=await h(i,T,{variables:{input:{name:t,type:n.includes(t)?t:`custom`,skipPublish:a}},logger:e});e.info(p.green(`Created identifier ${t}!`)),s[t]=r.identifier})}return s}async function O(r,{dataSubject:i,dataSubjectId:a,skipPublish:o=!1}){await h(r,t,{variables:{input:{id:a,title:i.title,adminDashboardDefaultSilentMode:i.adminDashboardDefaultSilentMode,actions:i.actions,skipPublish:o&&i.active===void 0}},logger:e}),typeof i.active==`boolean`&&await h(r,n,{variables:{input:{id:a,active:i.active,skipPublish:o}},logger:e})}async function k(t,{identifier:n,dataSubjectsByName:r,identifierId:i,skipPublish:a=!1}){await h(t,E,{variables:{input:{id:i,selectOptions:n.selectOptions,isRequiredInForm:n.isRequiredInForm,regex:n.regex,placeholder:n.placeholder,displayTitle:n.displayTitle,displayDescription:n.displayDescription,displayOrder:n.displayOrder,isUniqueOnPreferenceStore:n.isUniqueOnPreferenceStore,privacyCenterVisibility:n.privacyCenterVisibility,dataSubjectIds:n.dataSubjects?n.dataSubjects.map(e=>r[e].id):void 0,skipPublish:a}},logger:e})}async function A(t,n,{pageSize:c=50,publishToPrivacyCenter:l=!0,classifyService:u=!1,deleteExtraAttributeValues:d=!1}){let f=!1;e.info(p.magenta(`Fetching data with page size ${c}...`));let{templates:m,attributes:h,actions:S,identifiers:C,"data-subjects":w,"business-entities":T,enrichers:E,cookies:A,"consent-manager":j,"data-silos":M,"data-flows":N,prompts:P,"prompt-groups":F,"prompt-partials":I,agents:L,"agent-functions":R,"agent-files":z,vendors:B,"data-categories":V,"processing-activities":H,"processing-purposes":U,"action-items":W,"action-item-collections":G,teams:K,"privacy-center":q,messages:J,policies:Y,partitions:X}=t,[Z,Q,Se]=await Promise.all([E||C?D(t,n,!l):{},M||w||E||H?i(t,n):{},M&&M.map(e=>e[`api-key-title`]||[]).reduce((e,t)=>e+t.length,0)>0?ne(t,n,!1,{logger:e}):{}]);if(j){e.info(p.magenta(`Syncing consent manager...`));try{await v(n,j,{logger:e}),e.info(p.green(`Successfully synced consent manager!`))}catch(t){f=!0,e.error(p.red(`Failed to sync consent manager! - ${t.message}`))}}if(P){let t=await ve(n,P,{logger:e});f||=!t}if(I){let t=await _e(n,I,{logger:e});f||=!t}if(F){let t=await ge(n,F,{logger:e});f||=!t}if(K){let t=await ye(n,K,{logger:e});f||=!t}if(m&&(e.info(p.magenta(`Syncing "${m.length}" email templates...`)),await x(m,async t=>{e.info(p.magenta(`Syncing template "${t.title}"...`));try{await be(n,t,{logger:e}),e.info(p.green(`Successfully synced template "${t.title}"!`))}catch(n){f=!0,e.error(p.red(`Failed to sync template "${t.title}"! - ${n.message}`))}},{concurrency:10}),e.info(p.green(`Synced "${m.length}" email templates!`))),T){let t=await ce(n,T,{logger:e});f||=!t}if(B){let t=await xe(n,B,{logger:e});f||=!t}if(V){let t=await le(n,V,{logger:e});f||=!t}if(U){let t=await he(n,U,{logger:e});f||=!t}if(X){let t=await b(n,X,{logger:e});f||=!t}if(L){let t=await oe(n,L,{logger:e});f||=!t}if(R){let t=await ae(n,R,{logger:e});f||=!t}if(z){let t=await ie(n,z,{logger:e});f||=!t}if(A){let t=await y(n,A,{logger:e});f||=!t}if(G){let t=await g(n,G,{logger:e});f||=!t}if(h){e.info(p.magenta(`Syncing "${h.length}" attributes...`));let t=await te(n,{logger:e});await x(h,async r=>{let i=t.find(e=>e.name===r.name);e.info(p.magenta(`Syncing attribute "${r.name}"...`));try{await se(n,r,{existingAttribute:i,deleteExtraAttributeValues:d,logger:e}),e.info(p.green(`Successfully synced attribute "${r.name}"!`))}catch(t){f=!0,e.error(p.red(`Failed to sync attribute "${r.name}"! - ${t.message}`))}},{concurrency:10}),e.info(p.green(`Synced "${h.length}" attributes!`))}if(W){let t=await _(n,W,{logger:e});f||=!t}if(E&&(e.info(p.magenta(`Syncing "${E.length}" enrichers...`)),await x(E,async t=>{e.info(p.magenta(`Syncing enricher "${t.title}"...`));try{await o(n,{enricher:t,identifierByName:Z,dataSubjectsByName:Q}),e.info(p.green(`Successfully synced enricher "${t.title}"!`))}catch(n){f=!0,e.error(p.red(`Failed to sync enricher "${t.title}"! - ${n.message}`))}},{concurrency:10}),e.info(p.green(`Synced "${E.length}" enrichers!`))),C&&(e.info(p.magenta(`Syncing "${C.length}" identifiers...`)),await x(C,async t=>{let r=Z[t.name];if(!r)throw Error(`Failed to find identifier with name: ${t.type}. Should have been auto-created by cli.`);e.info(p.magenta(`Syncing identifier "${t.type}"...`));try{await k(n,{identifier:t,dataSubjectsByName:Q,identifierId:r.id,skipPublish:!l}),e.info(p.green(`Successfully synced identifier "${t.type}"!`))}catch(n){f=!0,e.info(p.red(`Failed to sync identifier "${t.type}"! - ${n.message}`))}},{concurrency:10}),e.info(p.green(`Synced "${C.length}" identifiers!`))),S){e.info(p.magenta(`Syncing "${S.length}" actions...`));let t=await ee(n,{logger:e});await x(S,async r=>{let i=t.find(e=>e.type===r.type);if(!i)throw Error(`Failed to find action with type: ${r.type}. Should have already existing in the organization.`);e.info(p.magenta(`Syncing action "${r.type}"...`));try{await re(n,{action:r,actionId:i.id,skipPublish:!l},{logger:e}),e.info(p.green(`Successfully synced action "${r.type}"!`))}catch(t){f=!0,e.error(p.red(`Failed to sync action "${r.type}"! - ${t.message}`))}},{concurrency:10}),e.info(p.green(`Synced "${S.length}" actions!`))}if(w){e.info(p.magenta(`Syncing "${w.length}" data subjects...`));let t=await a(n);await x(w,async r=>{let i=t.find(e=>e.type===r.type);if(!i)throw Error(`Failed to find data subject with type: ${r.type}. Should have already existing in the organization.`);e.info(p.magenta(`Syncing data subject "${r.type}"...`));try{await O(n,{dataSubject:r,dataSubjectId:i.id,skipPublish:!l}),e.info(p.green(`Successfully synced data subject "${r.type}"!`))}catch(t){f=!0,e.info(p.red(`Failed to sync data subject "${r.type}"! - ${t.message}`))}},{concurrency:10}),e.info(p.green(`Synced "${w.length}" data subjects!`))}if(N){let t=await ue(n,N,u,{logger:e});f||=!t}if(q){let t=await pe(n,q,{logger:e});f||=!t}if(J){let t=await de(n,J,{logger:e});f||=!t}if(Y){let t=await fe(n,Y,{logger:e});f||=!t}let $=[];if(M){let{success:e,dataSiloTitleToId:t}=await r(M,n,{dataSubjectsByName:Q,apiKeysByTitle:Se,pageSize:c});M?.forEach(e=>{e[`deletion-dependencies`]&&$.push([t[e.title],e[`deletion-dependencies`]])}),f||=!e}if($.length>0&&await s(n,$),H){let t=await me(n,H,{logger:e});f||=!t}return f}function j(e,...t){let n=JSON.parse(JSON.stringify(e));return t.forEach(e=>{f(e).forEach(([e,t])=>{n[e]===void 0?n[e]=t:Array.isArray(t)?n[e]=[...n[e],...t]:n[e]=t})}),n}function M(e){let t=e.split(`,`).filter(e=>!!e),n={};return t.forEach(e=>{let[t,r]=e.split(`:`);if(!t||!r)throw Error(`Invalid variable: ${e}. Expected format: key:value`);n[t]=r}),n}export{O as a,w as c,k as i,E as l,j as n,D as o,A as r,T as s,M as t};
23
- //# sourceMappingURL=parseVariablesFromString-CvoeZZ75.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseVariablesFromString-CvoeZZ75.mjs","names":["sdkFetchAllIdentifiers"],"sources":["../src/lib/graphql/gqls/identifier.ts","../src/lib/graphql/fetchIdentifiers.ts","../src/lib/graphql/syncDataSubject.ts","../src/lib/graphql/syncIdentifier.ts","../src/lib/graphql/syncConfigurationToTranscend.ts","../src/lib/mergeTranscendInputs.ts","../src/lib/helpers/parseVariablesFromString.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\nexport const NEW_IDENTIFIER_TYPES = gql`\n query TranscendCliNewIdentifierTypes {\n newIdentifierTypes {\n name\n }\n }\n`;\n\nexport const CREATE_IDENTIFIER = gql`\n mutation TranscendCliCreateIdentifier($input: IdentifierInput!) {\n createIdentifier(input: $input) {\n identifier {\n id\n name\n }\n }\n }\n`;\n\nexport const UPDATE_IDENTIFIER = gql`\n mutation TranscendCliUpdateIdentifier($input: UpdateIdentifierInput!) {\n updateIdentifier(input: $input) {\n clientMutationId\n }\n }\n`;\n","import {\n fetchAllIdentifiers as sdkFetchAllIdentifiers,\n makeGraphQLRequest,\n type Identifier,\n} from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport { keyBy, uniq, flatten, difference } from 'lodash-es';\n\nimport { TranscendInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { CREATE_IDENTIFIER, NEW_IDENTIFIER_TYPES } from './gqls/index.js';\n\n/**\n * Fetch all identifiers and if any are found in the config that are\n * missing, create those identifiers.\n *\n * @param input - Transcend input\n * @param client - GraphQL client\n * @param skipPublish - When true, skip publishing to privacy center\n * @returns A map from identifier name to Identifier\n */\nexport async function fetchIdentifiersAndCreateMissing(\n { enrichers = [], 'data-silos': dataSilos = [], identifiers = [] }: TranscendInput,\n client: GraphQLClient,\n skipPublish = false,\n): Promise<{ [k in string]: Identifier }> {\n const allIdentifiers = await sdkFetchAllIdentifiers(client, { logger });\n const identifiersByName = keyBy(allIdentifiers, 'name');\n\n const expectedIdentifiers = uniq([\n ...flatten(\n enrichers.map((enricher) => [\n enricher['input-identifier'],\n ...enricher['output-identifiers'],\n ]),\n ),\n ...flatten(dataSilos.map((dataSilo) => dataSilo['identity-keys'])),\n ...identifiers.map(({ name }) => name),\n ]).filter((x) => !!x);\n const missingIdentifiers = difference(\n expectedIdentifiers,\n allIdentifiers.map(({ name }) => name),\n );\n\n if (missingIdentifiers.length > 0) {\n logger.info(colors.magenta(`Creating ${missingIdentifiers.length} new identifiers...`));\n const { newIdentifierTypes } = await makeGraphQLRequest<{\n /** Query response */\n newIdentifierTypes: {\n /** Name of identifier type remaining */\n name: string;\n }[];\n }>(client, NEW_IDENTIFIER_TYPES, { logger });\n const nativeTypesRemaining = newIdentifierTypes.map(({ name }) => name);\n await mapSeries(missingIdentifiers, async (identifier) => {\n logger.info(colors.magenta(`Creating identifier ${identifier}...`));\n const { createIdentifier } = await makeGraphQLRequest<{\n /** createIdentifier Response */\n createIdentifier: {\n /** Created identifier */\n identifier: Identifier;\n };\n }>(client, CREATE_IDENTIFIER, {\n variables: {\n input: {\n name: identifier,\n type: nativeTypesRemaining.includes(identifier!) ? identifier : 'custom',\n skipPublish,\n },\n },\n logger,\n });\n logger.info(colors.green(`Created identifier ${identifier}!`));\n\n identifiersByName[identifier!] = createIdentifier.identifier;\n });\n }\n return identifiersByName;\n}\n","import { makeGraphQLRequest } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { DataSubjectInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { UPDATE_DATA_SUBJECT, TOGGLE_DATA_SUBJECT } from './gqls/index.js';\n\n/**\n * Sync the data subjects\n *\n * @param client - GraphQL client\n * @param options - Options\n */\nexport async function syncDataSubject(\n client: GraphQLClient,\n {\n dataSubject,\n dataSubjectId,\n skipPublish = false,\n }: {\n /** DataSubject update input */\n dataSubject: DataSubjectInput;\n /** Existing data subject Id */\n dataSubjectId: string;\n /** When true, skip publishing to privacy center */\n skipPublish?: boolean;\n },\n): Promise<void> {\n await makeGraphQLRequest(client, UPDATE_DATA_SUBJECT, {\n variables: {\n input: {\n id: dataSubjectId,\n title: dataSubject.title,\n adminDashboardDefaultSilentMode: dataSubject.adminDashboardDefaultSilentMode,\n actions: dataSubject.actions,\n skipPublish: skipPublish && typeof dataSubject.active === 'undefined',\n },\n },\n logger,\n });\n\n if (typeof dataSubject.active === 'boolean') {\n await makeGraphQLRequest(client, TOGGLE_DATA_SUBJECT, {\n variables: {\n input: {\n id: dataSubjectId,\n active: dataSubject.active,\n skipPublish,\n },\n },\n logger,\n });\n }\n}\n","import { makeGraphQLRequest } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { IdentifierInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport type { DataSubject } from './fetchDataSubjects.js';\nimport { UPDATE_IDENTIFIER } from './gqls/index.js';\n\n/**\n * Sync the consent manager\n *\n * @param client - GraphQL client\n * @param options - Options\n */\nexport async function syncIdentifier(\n client: GraphQLClient,\n {\n identifier,\n dataSubjectsByName,\n identifierId,\n skipPublish = false,\n }: {\n /** Identifier update input */\n identifier: IdentifierInput;\n /** Data subject lookup by name */\n dataSubjectsByName: { [k in string]: DataSubject };\n /** Existing identifier Id */\n identifierId: string;\n /** When true, skip publishing to privacy center */\n skipPublish?: boolean;\n },\n): Promise<void> {\n await makeGraphQLRequest(client, UPDATE_IDENTIFIER, {\n variables: {\n input: {\n id: identifierId,\n selectOptions: identifier.selectOptions,\n isRequiredInForm: identifier.isRequiredInForm,\n regex: identifier.regex,\n placeholder: identifier.placeholder,\n displayTitle: identifier.displayTitle,\n displayDescription: identifier.displayDescription,\n displayOrder: identifier.displayOrder,\n isUniqueOnPreferenceStore: identifier.isUniqueOnPreferenceStore,\n privacyCenterVisibility: identifier.privacyCenterVisibility,\n dataSubjectIds: identifier.dataSubjects\n ? identifier.dataSubjects.map((type) => dataSubjectsByName[type].id)\n : undefined,\n skipPublish,\n },\n },\n logger,\n });\n}\n","import {\n fetchAllActions,\n fetchAllAttributes,\n fetchApiKeys,\n syncAction,\n syncActionItemCollections,\n syncActionItems,\n syncAgentFiles,\n syncAgentFunctions,\n syncAgents,\n syncAttribute,\n syncBusinessEntities,\n syncDataCategories,\n syncConsentManager,\n syncCookies,\n syncDataFlows,\n syncIntlMessages,\n syncPartitions,\n syncPolicies,\n syncPrivacyCenter,\n syncProcessingActivities,\n syncProcessingPurposes,\n syncPromptGroups,\n syncPromptPartials,\n syncPrompts,\n syncTeams,\n syncTemplate,\n syncVendors,\n type Identifier,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\n\n/* eslint-disable max-lines */\nimport { TranscendInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { fetchAllDataSubjects, ensureAllDataSubjectsExist } from './fetchDataSubjects.js';\nimport { fetchIdentifiersAndCreateMissing } from './fetchIdentifiers.js';\nimport { syncDataSiloDependencies, syncDataSilos } from './syncDataSilos.js';\nimport { syncDataSubject } from './syncDataSubject.js';\nimport { syncEnricher } from './syncEnrichers.js';\nimport { syncIdentifier } from './syncIdentifier.js';\n\nconst CONCURRENCY = 10;\n\n/**\n * Sync the yaml input back to Transcend using the GraphQL APIs\n *\n * @param input - The yml input\n * @param client - GraphQL client\n * @param pageSize - Page size\n * @returns True if an error was encountered\n */\nexport async function syncConfigurationToTranscend(\n input: TranscendInput,\n client: GraphQLClient,\n {\n pageSize = 50,\n // TODO: https://transcend.height.app/T-23779\n publishToPrivacyCenter = true,\n classifyService = false,\n deleteExtraAttributeValues = false,\n }: {\n /** Page size */\n pageSize?: number;\n /** When true, skip publishing to privacy center */\n publishToPrivacyCenter?: boolean;\n /** When true, delete any attributes being synced up */\n deleteExtraAttributeValues?: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n },\n): Promise<boolean> {\n let encounteredError = false;\n\n logger.info(colors.magenta(`Fetching data with page size ${pageSize}...`));\n\n const {\n templates,\n attributes,\n actions,\n identifiers,\n 'data-subjects': dataSubjects,\n 'business-entities': businessEntities,\n enrichers,\n cookies,\n 'consent-manager': consentManager,\n 'data-silos': dataSilos,\n 'data-flows': dataFlows,\n prompts,\n 'prompt-groups': promptGroups,\n 'prompt-partials': promptPartials,\n agents,\n 'agent-functions': agentFunctions,\n 'agent-files': agentFiles,\n vendors,\n 'data-categories': dataCategories,\n 'processing-activities': processingActivities,\n 'processing-purposes': processingPurposes,\n 'action-items': actionItems,\n 'action-item-collections': actionItemCollections,\n teams,\n 'privacy-center': privacyCenter,\n messages,\n policies,\n partitions,\n } = input;\n\n const [identifierByName, dataSubjectsByName, apiKeyTitleMap] = await Promise.all([\n // Ensure all identifiers are created and create a map from name -> identifier.id\n enrichers || identifiers\n ? fetchIdentifiersAndCreateMissing(input, client, !publishToPrivacyCenter)\n : ({} as { [k in string]: Identifier }),\n // Grab all data subjects in the organization\n dataSilos || dataSubjects || enrichers || processingActivities\n ? ensureAllDataSubjectsExist(input, client)\n : {},\n // Grab API keys\n dataSilos &&\n dataSilos\n .map((dataSilo) => dataSilo['api-key-title'] || [])\n .reduce((acc, lst) => acc + lst.length, 0) > 0\n ? fetchApiKeys(input, client, false, { logger })\n : {},\n ]);\n\n // Sync consent manager\n if (consentManager) {\n logger.info(colors.magenta('Syncing consent manager...'));\n try {\n await syncConsentManager(client, consentManager, { logger });\n logger.info(colors.green('Successfully synced consent manager!'));\n } catch (err) {\n encounteredError = true;\n logger.error(colors.red(`Failed to sync consent manager! - ${err.message}`));\n }\n }\n\n // Sync prompts\n if (prompts) {\n const promptsSuccess = await syncPrompts(client, prompts, { logger });\n encounteredError = encounteredError || !promptsSuccess;\n }\n if (promptPartials) {\n const promptsSuccess = await syncPromptPartials(client, promptPartials, { logger });\n encounteredError = encounteredError || !promptsSuccess;\n }\n if (promptGroups) {\n const promptsSuccess = await syncPromptGroups(client, promptGroups, { logger });\n encounteredError = encounteredError || !promptsSuccess;\n }\n\n if (teams) {\n const teamsSuccess = await syncTeams(client, teams, { logger });\n encounteredError = encounteredError || !teamsSuccess;\n }\n\n // Sync email templates\n if (templates) {\n logger.info(colors.magenta(`Syncing \"${templates.length}\" email templates...`));\n await map(\n templates,\n async (template) => {\n logger.info(colors.magenta(`Syncing template \"${template.title}\"...`));\n try {\n await syncTemplate(client, template, { logger });\n logger.info(colors.green(`Successfully synced template \"${template.title}\"!`));\n } catch (err) {\n encounteredError = true;\n logger.error(colors.red(`Failed to sync template \"${template.title}\"! - ${err.message}`));\n }\n },\n {\n concurrency: CONCURRENCY,\n },\n );\n logger.info(colors.green(`Synced \"${templates.length}\" email templates!`));\n }\n\n // Sync business entities\n if (businessEntities) {\n const businessEntitySuccess = await syncBusinessEntities(client, businessEntities, { logger });\n encounteredError = encounteredError || !businessEntitySuccess;\n }\n\n // Sync vendors\n if (vendors) {\n const vendorsSuccess = await syncVendors(client, vendors, { logger });\n encounteredError = encounteredError || !vendorsSuccess;\n }\n\n // Sync data categories\n if (dataCategories) {\n const dataCategoriesSuccess = await syncDataCategories(client, dataCategories, { logger });\n encounteredError = encounteredError || !dataCategoriesSuccess;\n }\n\n // Sync processing purposes\n if (processingPurposes) {\n const processingPurposesSuccess = await syncProcessingPurposes(client, processingPurposes, {\n logger,\n });\n encounteredError = encounteredError || !processingPurposesSuccess;\n }\n\n // Sync partitions\n if (partitions) {\n const partitionsSuccess = await syncPartitions(client, partitions, { logger });\n encounteredError = encounteredError || !partitionsSuccess;\n }\n\n // Sync agents\n if (agents) {\n const agentsSuccess = await syncAgents(client, agents, { logger });\n encounteredError = encounteredError || !agentsSuccess;\n }\n\n // Sync agent functions\n if (agentFunctions) {\n const agentFunctionsSuccess = await syncAgentFunctions(client, agentFunctions, { logger });\n encounteredError = encounteredError || !agentFunctionsSuccess;\n }\n\n // Sync agent files\n if (agentFiles) {\n const agentFilesSuccess = await syncAgentFiles(client, agentFiles, { logger });\n encounteredError = encounteredError || !agentFilesSuccess;\n }\n\n // Sync cookies\n if (cookies) {\n const cookiesSuccess = await syncCookies(client, cookies, { logger });\n encounteredError = encounteredError || !cookiesSuccess;\n }\n\n // Sync action item collections\n if (actionItemCollections) {\n const actionItemCollectionsSuccess = await syncActionItemCollections(\n client,\n actionItemCollections,\n { logger },\n );\n encounteredError = encounteredError || !actionItemCollectionsSuccess;\n }\n\n // Sync attributes\n if (attributes) {\n // Fetch existing\n logger.info(colors.magenta(`Syncing \"${attributes.length}\" attributes...`));\n const existingAttributes = await fetchAllAttributes(client, { logger });\n await map(\n attributes,\n async (attribute) => {\n const existing = existingAttributes.find((attr) => attr.name === attribute.name);\n\n logger.info(colors.magenta(`Syncing attribute \"${attribute.name}\"...`));\n try {\n await syncAttribute(client, attribute, {\n existingAttribute: existing,\n deleteExtraAttributeValues,\n logger,\n });\n logger.info(colors.green(`Successfully synced attribute \"${attribute.name}\"!`));\n } catch (err) {\n encounteredError = true;\n logger.error(\n colors.red(`Failed to sync attribute \"${attribute.name}\"! - ${err.message}`),\n );\n }\n },\n {\n concurrency: CONCURRENCY,\n },\n );\n logger.info(colors.green(`Synced \"${attributes.length}\" attributes!`));\n }\n\n // Sync action items\n if (actionItems) {\n const actionItemsSuccess = await syncActionItems(client, actionItems, { logger });\n encounteredError = encounteredError || !actionItemsSuccess;\n }\n\n // Sync enrichers\n if (enrichers) {\n logger.info(colors.magenta(`Syncing \"${enrichers.length}\" enrichers...`));\n await map(\n enrichers,\n async (enricher) => {\n logger.info(colors.magenta(`Syncing enricher \"${enricher.title}\"...`));\n try {\n await syncEnricher(client, {\n enricher,\n identifierByName,\n dataSubjectsByName,\n });\n logger.info(colors.green(`Successfully synced enricher \"${enricher.title}\"!`));\n } catch (err) {\n encounteredError = true;\n logger.error(colors.red(`Failed to sync enricher \"${enricher.title}\"! - ${err.message}`));\n }\n },\n {\n concurrency: CONCURRENCY,\n },\n );\n logger.info(colors.green(`Synced \"${enrichers.length}\" enrichers!`));\n }\n\n // Sync identifiers\n if (identifiers) {\n // Fetch existing\n logger.info(colors.magenta(`Syncing \"${identifiers.length}\" identifiers...`));\n await map(\n identifiers,\n async (identifier) => {\n const existing = identifierByName[identifier.name];\n if (!existing) {\n throw new Error(\n `Failed to find identifier with name: ${identifier.type}. Should have been auto-created by cli.`,\n );\n }\n\n logger.info(colors.magenta(`Syncing identifier \"${identifier.type}\"...`));\n try {\n await syncIdentifier(client, {\n identifier,\n dataSubjectsByName,\n identifierId: existing.id,\n skipPublish: !publishToPrivacyCenter,\n });\n logger.info(colors.green(`Successfully synced identifier \"${identifier.type}\"!`));\n } catch (err) {\n encounteredError = true;\n logger.info(\n colors.red(`Failed to sync identifier \"${identifier.type}\"! - ${err.message}`),\n );\n }\n },\n {\n concurrency: CONCURRENCY,\n },\n );\n logger.info(colors.green(`Synced \"${identifiers.length}\" identifiers!`));\n }\n\n // Sync actions\n if (actions) {\n // Fetch existing\n logger.info(colors.magenta(`Syncing \"${actions.length}\" actions...`));\n const existingActions = await fetchAllActions(client, { logger });\n await map(\n actions,\n async (action) => {\n const existing = existingActions.find((act) => act.type === action.type);\n if (!existing) {\n throw new Error(\n `Failed to find action with type: ${action.type}. Should have already existing in the organization.`,\n );\n }\n\n logger.info(colors.magenta(`Syncing action \"${action.type}\"...`));\n try {\n await syncAction(\n client,\n {\n action,\n actionId: existing.id,\n skipPublish: !publishToPrivacyCenter,\n },\n { logger },\n );\n logger.info(colors.green(`Successfully synced action \"${action.type}\"!`));\n } catch (err) {\n encounteredError = true;\n logger.error(colors.red(`Failed to sync action \"${action.type}\"! - ${err.message}`));\n }\n },\n {\n concurrency: CONCURRENCY,\n },\n );\n logger.info(colors.green(`Synced \"${actions.length}\" actions!`));\n }\n\n // Sync data subjects\n if (dataSubjects) {\n // Fetch existing\n logger.info(colors.magenta(`Syncing \"${dataSubjects.length}\" data subjects...`));\n const existingDataSubjects = await fetchAllDataSubjects(client);\n await map(\n dataSubjects,\n async (dataSubject) => {\n const existing = existingDataSubjects.find((subj) => subj.type === dataSubject.type);\n if (!existing) {\n throw new Error(\n `Failed to find data subject with type: ${dataSubject.type}. Should have already existing in the organization.`,\n );\n }\n\n logger.info(colors.magenta(`Syncing data subject \"${dataSubject.type}\"...`));\n try {\n await syncDataSubject(client, {\n dataSubject,\n dataSubjectId: existing.id,\n skipPublish: !publishToPrivacyCenter,\n });\n logger.info(colors.green(`Successfully synced data subject \"${dataSubject.type}\"!`));\n } catch (err) {\n encounteredError = true;\n logger.info(\n colors.red(`Failed to sync data subject \"${dataSubject.type}\"! - ${err.message}`),\n );\n }\n },\n {\n concurrency: CONCURRENCY,\n },\n );\n logger.info(colors.green(`Synced \"${dataSubjects.length}\" data subjects!`));\n }\n\n // Sync data flows\n if (dataFlows) {\n const syncedDataFlows = await syncDataFlows(client, dataFlows, classifyService, { logger });\n encounteredError = encounteredError || !syncedDataFlows;\n }\n\n // Sync privacy center\n if (privacyCenter) {\n const privacyCenterSuccess = await syncPrivacyCenter(client, privacyCenter, { logger });\n encounteredError = encounteredError || !privacyCenterSuccess;\n }\n\n // Sync messages\n if (messages) {\n const messagesSuccess = await syncIntlMessages(client, messages, { logger });\n encounteredError = encounteredError || !messagesSuccess;\n }\n\n // Sync policies\n if (policies) {\n const policiesSuccess = await syncPolicies(client, policies, { logger });\n encounteredError = encounteredError || !policiesSuccess;\n }\n\n // Store dependency updates\n const dependencyUpdates: [string, string[]][] = [];\n // Sync data silos\n if (dataSilos) {\n const { success, dataSiloTitleToId } = await syncDataSilos(dataSilos, client, {\n dataSubjectsByName,\n apiKeysByTitle: apiKeyTitleMap,\n pageSize,\n });\n dataSilos?.forEach((dataSilo) => {\n // Queue up dependency update\n if (dataSilo['deletion-dependencies']) {\n dependencyUpdates.push([\n dataSiloTitleToId[dataSilo.title],\n dataSilo['deletion-dependencies'],\n ]);\n }\n });\n encounteredError = encounteredError || !success;\n }\n\n // Dependencies updated at the end after all data silos are created\n if (dependencyUpdates.length > 0) {\n await syncDataSiloDependencies(client, dependencyUpdates);\n }\n\n // Update processing activities\n if (processingActivities) {\n const processingActivitySuccess = await syncProcessingActivities(client, processingActivities, {\n logger,\n });\n encounteredError = encounteredError || !processingActivitySuccess;\n }\n\n if (publishToPrivacyCenter) {\n // TODO: https://transcend.height.app/T-23779\n }\n\n return encounteredError;\n}\n/* eslint-enable max-lines */\n","import { getEntries } from '@transcend-io/type-utils';\n\nimport { TranscendInput } from '../codecs.js';\n\n/**\n * Combine a set of TranscendInput yaml files into a single yaml\n *\n * @param base - Base input\n * @param inputs - The list of inputs\n * @returns Merged input\n */\nexport function mergeTranscendInputs(\n base: TranscendInput,\n ...inputs: TranscendInput[]\n): TranscendInput {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const cloned: any = JSON.parse(JSON.stringify(base));\n inputs.forEach((input) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getEntries(input).forEach(([key, value]: [any, any]) => {\n if (cloned[key] === undefined) {\n cloned[key] = value;\n } else if (Array.isArray(value)) {\n cloned[key] = [...cloned[key], ...value];\n } else {\n cloned[key] = value;\n }\n });\n });\n return cloned;\n}\n","/**\n * Parse variables from string\n *\n * @param variables - Variables as string\n * @returns Variables as object\n */\nexport function parseVariablesFromString(variables: string): {\n [k in string]: string;\n} {\n // Parse out the variables\n const splitVars = variables.split(',').filter((x) => !!x);\n const vars: { [k in string]: string } = {};\n splitVars.forEach((variable) => {\n const [k, v] = variable.split(':');\n if (!k || !v) {\n throw new Error(`Invalid variable: ${variable}. Expected format: key:value`);\n }\n vars[k] = v;\n });\n return vars;\n}\n"],"mappings":"gkCAEA,MAAa,EAAuB,CAAG;;;;;;EAQ1B,EAAoB,CAAG;;;;;;;;;EAWvB,EAAoB,CAAG;;;;;;ECEpC,eAAsB,EACpB,CAAE,YAAY,EAAE,CAAE,aAAc,EAAY,EAAE,CAAE,cAAc,EAAE,EAChE,EACA,EAAc,GAC0B,CACxC,IAAM,EAAiB,MAAMA,EAAuB,EAAQ,CAAE,SAAQ,CAAC,CACjE,EAAoB,EAAM,EAAgB,OAAO,CAYjD,EAAqB,EAVC,EAAK,CAC/B,GAAG,EACD,EAAU,IAAK,GAAa,CAC1B,EAAS,oBACT,GAAG,EAAS,sBACb,CAAC,CACH,CACD,GAAG,EAAQ,EAAU,IAAK,GAAa,EAAS,iBAAiB,CAAC,CAClE,GAAG,EAAY,KAAK,CAAE,UAAW,EAAK,CACvC,CAAC,CAAC,OAAQ,GAAM,CAAC,CAAC,EAAE,CAGnB,EAAe,KAAK,CAAE,UAAW,EAAK,CACvC,CAED,GAAI,EAAmB,OAAS,EAAG,CACjC,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAmB,OAAO,qBAAqB,CAAC,CACvF,GAAM,CAAE,sBAAuB,MAAM,EAMlC,E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AO,GAEhB,EACF,CACK,ECvBT,SAAgB,EAAyB,EAEvC,CAEA,IAAM,EAAY,EAAU,MAAM,IAAI,CAAC,OAAQ,GAAM,CAAC,CAAC,EAAE,CACnD,EAAkC,EAAE,CAQ1C,OAPA,EAAU,QAAS,GAAa,CAC9B,GAAM,CAAC,EAAG,GAAK,EAAS,MAAM,IAAI,CAClC,GAAI,CAAC,GAAK,CAAC,EACT,MAAU,MAAM,qBAAqB,EAAS,8BAA8B,CAE9E,EAAK,GAAK,GACV,CACK"}
@@ -1,45 +0,0 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{i as t,o as n,u as r}from"./dataSilo-Dvi8-PkH.mjs";import{SubDataPointDataSubCategoryGuessStatus as i}from"@transcend-io/privacy-types";import{chunk as a,keyBy as o,sortBy as s,uniq as c}from"lodash-es";import l from"colors";import{makeGraphQLRequest as u}from"@transcend-io/sdk";import{mapSeries as d}from"@transcend-io/utils";import{gql as f}from"graphql-request";import p from"cli-progress";async function m(t,{dataSiloIds:n=[],includeGuessedCategories:a,includeAttributes:o,parentCategories:c=[],subCategories:d=[],pageSize:m=1e3}={}){let h=[],g=new Date().getTime(),_=new p.SingleBar({},p.Presets.shades_classic),v={...c.length>0?{category:c}:{},...d.length>0?{subCategoryIds:d}:{},...c.length+d.length>0&&!a?{status:i.Approved}:{},...n.length>0?{dataSilos:n}:{}},{subDataPoints:{totalCount:y}}=await u(t,r,{variables:{filterBy:v},logger:e});e.info(l.magenta(`[Step 1/3] Pulling in all subdatapoints`)),_.start(y,0);let b=0,x=!1,S,C=0;do try{let{subDataPoints:{nodes:n}}=await u(t,f`
2
- query TranscendCliSubDataPointCsvExport(
3
- $filterBy: SubDataPointFiltersInput
4
- $first: Int!
5
- $offset: Int!
6
- ) {
7
- subDataPoints(
8
- filterBy: $filterBy
9
- first: $first
10
- offset: $offset
11
- useMaster: false
12
- ) {
13
- nodes {
14
- id
15
- name
16
- description
17
- dataPointId
18
- dataSiloId
19
- purposes {
20
- name
21
- purpose
22
- }
23
- categories {
24
- name
25
- category
26
- }
27
- ${a?`pendingCategoryGuesses {
28
- category {
29
- name
30
- category
31
- }
32
- status
33
- classifierVersion
34
- }`:``}
35
- ${o?`attributeValues {
36
- attributeKey {
37
- name
38
- }
39
- name
40
- }`:``}
41
- }
42
- }
43
- }
44
- `,{variables:{first:m,offset:C,filterBy:{...v}},logger:e});S=n[n.length-1]?.id,h.push(...n),x=n.length===m,b+=n.length,C+=n.length,_.update(b)}catch(t){throw e.error(l.red(`An error fetching subdatapoints for cursor ${S} and offset ${C}`)),t}while(x);_.stop();let w=new Date().getTime()-g,T=s(h,`name`);return e.info(l.green(`Successfully pulled in ${T.length} subdatapoints in ${w/1e3} seconds!`)),T}async function h(t,{dataPointIds:r=[],pageSize:i=100}){let o=[],s=new Date().getTime(),c=new p.SingleBar({},p.Presets.shades_classic);e.info(l.magenta(`[Step 2/3] Fetching metadata for ${r.length} datapoints`));let f=a(r,i);c.start(r.length,0);let m=0;await d(f,async r=>{try{let{dataPoints:{nodes:a}}=await u(t,n,{variables:{first:i,filterBy:{ids:r}},logger:e});o.push(...a),m+=r.length,c.update(m)}catch(t){throw e.error(l.red(`An error fetching subdatapoints for IDs ${r.join(`, `)}`)),t}}),c.stop();let h=new Date().getTime()-s;return e.info(l.green(`Successfully pulled in ${o.length} dataPoints in ${h/1e3} seconds!`)),o}async function g(n,{dataSiloIds:r=[],pageSize:i=100}){let o=[],s=new Date().getTime(),c=new p.SingleBar({},p.Presets.shades_classic);e.info(l.magenta(`[Step 3/3] Fetching metadata for ${r.length} data silos`));let f=a(r,i);c.start(r.length,0);let m=0;await d(f,async r=>{try{let{dataSilos:{nodes:a}}=await u(n,t,{variables:{first:i,filterBy:{ids:r}},logger:e});o.push(...a),m+=r.length,c.update(m)}catch(t){throw e.error(l.red(`An error fetching data silos for IDs ${r.join(`, `)}`)),t}}),c.stop();let h=new Date().getTime()-s;return e.info(l.green(`Successfully pulled in ${o.length} data silos in ${h/1e3} seconds!`)),o}async function _(e,{dataSiloIds:t=[],includeGuessedCategories:n,includeAttributes:r,parentCategories:i=[],subCategories:a=[],pageSize:s=1e3}={}){let l=await m(e,{dataSiloIds:t,includeGuessedCategories:n,includeAttributes:r,parentCategories:i,subCategories:a,pageSize:s}),u=o(await h(e,{dataPointIds:c(l.map(e=>e.dataPointId))}),`id`),d=o(await g(e,{dataSiloIds:c(l.map(e=>e.dataSiloId))}),`id`);return l.map(e=>({...e,dataPoint:u[e.dataPointId],dataSilo:d[e.dataSiloId]}))}export{_ as t};
45
- //# sourceMappingURL=pullAllDatapoints-CqgqXRbp.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pullAllDatapoints-CqgqXRbp.mjs","names":[],"sources":["../src/lib/data-inventory/pullAllDatapoints.ts"],"sourcesContent":["import {\n type DataCategoryType,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport { makeGraphQLRequest } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql, type GraphQLClient } from 'graphql-request';\n/* eslint-disable max-lines */\nimport { keyBy, uniq, chunk, sortBy } from 'lodash-es';\n\nimport type { DataCategoryInput, ProcessingPurposeInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport {\n DATAPOINT_EXPORT,\n DATA_SILO_EXPORT,\n type DataSiloAttributeValue,\n SUB_DATA_POINTS_COUNT,\n} from '../graphql/index.js';\n\nexport interface DataSiloCsvPreview {\n /** ID of dataSilo */\n id: string;\n /** Name of dataSilo */\n title: string;\n}\n\nexport interface DataPointCsvPreview {\n /** ID of dataPoint */\n id: string;\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n}\n\nexport interface SubDataPointCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** Data point ID */\n dataPointId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /** Attribute attached to subdatapoint */\n attributeValues?: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\nexport interface DatapointFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Whether to include guessed categories, defaults to only approved categories */\n includeGuessedCategories?: boolean;\n /** Whether or not to include attributes */\n includeAttributes?: boolean;\n /** Parent categories to filter down for */\n parentCategories?: DataCategoryType[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n}\n\n/**\n * Pull subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The subdatapoints\n */\nasync function pullSubDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<SubDataPointCsvPreview[]> {\n const subDataPoints: SubDataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n // Filters\n const filterBy = {\n ...(parentCategories.length > 0 ? { category: parentCategories } : {}),\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n // if parentCategories or subCategories and not includeGuessedCategories\n ...(parentCategories.length + subCategories.length > 0 && !includeGuessedCategories\n ? // then only show data points with approved data categories\n { status: SubDataPointDataSubCategoryGuessStatus.Approved }\n : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n subDataPoints: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** Count */\n totalCount: number;\n };\n }>(client, SUB_DATA_POINTS_COUNT, {\n 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 subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPointCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliSubDataPointCsvExport(\n $filterBy: SubDataPointFiltersInput\n $first: Int!\n $offset: Int!\n ) {\n subDataPoints(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n name\n description\n dataPointId\n dataSiloId\n purposes {\n name\n purpose\n }\n categories {\n name\n category\n }\n ${\n includeGuessedCategories\n ? `pendingCategoryGuesses {\n category {\n name\n category\n }\n status\n classifierVersion\n }`\n : ''\n }\n ${\n includeAttributes\n ? `attributeValues {\n attributeKey {\n name\n }\n name\n }`\n : ''\n }\n }\n }\n }\n `,\n {\n variables: {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n // TODO: https://transcend.height.app/T-40484 - add cursor support\n // ...(cursor ? { cursor: { id: cursor } } : {}),\n },\n },\n logger,\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n subDataPoints.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(subDataPoints, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return sorted;\n}\n\n/**\n * Pull datapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints\n */\nasync function pullDatapoints(\n client: GraphQLClient,\n {\n dataPointIds = [],\n pageSize = 100,\n }: {\n /** IDs of data points to filter down */\n dataPointIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataPointCsvPreview[]> {\n const dataPoints: DataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 2/3] Fetching metadata for ${dataPointIds.length} datapoints`));\n\n // Group by 100\n const dataPointsGrouped = chunk(dataPointIds, pageSize);\n\n progressBar.start(dataPointIds.length, 0);\n let total = 0;\n await mapSeries(dataPointsGrouped, async (dataPointIdsGroup) => {\n try {\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPointCsvPreview[];\n };\n }>(client, DATAPOINT_EXPORT, {\n variables: {\n first: pageSize,\n filterBy: {\n ids: dataPointIdsGroup,\n },\n },\n logger,\n });\n\n dataPoints.push(...nodes);\n total += dataPointIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for IDs ${dataPointIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataPoints.length} dataPoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataPoints;\n}\n\n/**\n * Pull data silo information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The data silos\n */\nasync function pullDataSilos(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n pageSize = 100,\n }: {\n /** IDs of data silos to filter down */\n dataSiloIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataSiloCsvPreview[]> {\n const dataSilos: DataSiloCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 3/3] Fetching metadata for ${dataSiloIds.length} data silos`));\n\n // Group by 100\n const dataSilosGrouped = chunk(dataSiloIds, pageSize);\n\n progressBar.start(dataSiloIds.length, 0);\n let total = 0;\n await mapSeries(dataSilosGrouped, async (dataSiloIdsGroup) => {\n try {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: DataSiloCsvPreview[];\n };\n }>(client, DATA_SILO_EXPORT, {\n variables: {\n first: pageSize,\n filterBy: {\n ids: dataSiloIdsGroup,\n },\n },\n logger,\n });\n\n dataSilos.push(...nodes);\n total += dataSiloIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching data silos for IDs ${dataSiloIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataSilos.length} data silos in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataSilos;\n}\n\n/**\n * Pull all datapoints from the data inventory.\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints and data silos\n */\nexport async function pullAllDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<\n (SubDataPointCsvPreview & {\n /** Data point information */\n dataPoint: DataPointCsvPreview;\n /** Data silo information */\n dataSilo: DataSiloCsvPreview;\n })[]\n> {\n // Subdatapoint information\n const subDatapoints = await pullSubDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n includeAttributes,\n parentCategories,\n subCategories,\n pageSize,\n });\n\n // The datapoint ids to grab\n const dataPointIds = uniq(subDatapoints.map((point) => point.dataPointId));\n const dataPoints = await pullDatapoints(client, {\n dataPointIds,\n });\n const dataPointById = keyBy(dataPoints, 'id');\n\n // The data silo IDs to grab\n const allDataSiloIds = uniq(subDatapoints.map((point) => point.dataSiloId));\n const dataSilos = await pullDataSilos(client, {\n dataSiloIds: allDataSiloIds,\n });\n const dataSiloById = keyBy(dataSilos, 'id');\n\n return subDatapoints.map((subDataPoint) => ({\n ...subDataPoint,\n dataPoint: dataPointById[subDataPoint.dataPointId],\n dataSilo: dataSiloById[subDataPoint.dataSiloId],\n }));\n}\n/* eslint-enable max-lines */\n"],"mappings":"2bA0FA,eAAe,EACb,EACA,CACE,cAAc,EAAE,CAChB,2BACA,oBACA,mBAAmB,EAAE,CACrB,gBAAgB,EAAE,CAClB,WAAW,KAIT,EAAE,CAC6B,CACnC,IAAM,EAA0C,EAAE,CAG5C,EAAK,IAAI,MAAM,CAAC,SAAS,CAGzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAW,CACf,GAAI,EAAiB,OAAS,EAAI,CAAE,SAAU,EAAkB,CAAG,EAAE,CACrE,GAAI,EAAc,OAAS,EAAI,CAAE,eAAgB,EAAe,CAAG,EAAE,CAErE,GAAI,EAAiB,OAAS,EAAc,OAAS,GAAK,CAAC,EAEvD,CAAE,OAAQ,EAAuC,SAAU,CAC3D,EAAE,CACN,GAAI,EAAY,OAAS,EAAI,CAAE,UAAW,EAAa,CAAG,EAAE,CAC7D,CAGK,CACJ,cAAe,CAAE,eACf,MAAM,EAMP,EAAQ,EAAuB,CAChC,UAAW,CAAE,WAAU,CACvB,SACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,0CAA0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CACM,EAUT,eAAsB,EACpB,EACA,CACE,cAAc,EAAE,CAChB,2BACA,oBACA,mBAAmB,EAAE,CACrB,gBAAgB,EAAE,CAClB,WAAW,KAIT,EAAE,CAQN,CAEA,IAAM,EAAgB,MAAM,EAAkB,EAAQ,CACpD,cACA,2BACA,oBACA,mBACA,gBACA,WACD,CAAC,CAOI,EAAgB,EAHH,MAAM,EAAe,EAAQ,CAC9C,aAFmB,EAAK,EAAc,IAAK,GAAU,EAAM,YAAY,CAAC,CAGzE,CAAC,CACsC,KAAK,CAOvC,EAAe,EAHH,MAAM,EAAc,EAAQ,CAC5C,YAFqB,EAAK,EAAc,IAAK,GAAU,EAAM,WAAW,CAAC,CAG1E,CAAC,CACoC,KAAK,CAE3C,OAAO,EAAc,IAAK,IAAkB,CAC1C,GAAG,EACH,UAAW,EAAc,EAAa,aACtC,SAAU,EAAa,EAAa,YACrC,EAAE"}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-XOsAW1__.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{n}from"./RequestDataSilo-Rrc2dL9g.mjs";import{decodeCodec as r}from"@transcend-io/type-utils";import i from"colors";import*as a from"io-ts";import{buildTranscendGraphQLClient as o,createSombraGotInstance as s,makeGraphQLRequest as c}from"@transcend-io/sdk";import{mapSeries as l}from"@transcend-io/utils";import u from"cli-progress";async function d(e,{dataSiloId:r}){let{listReducedRequestsForDataSilo:{totalCount:i}}=await c(e,n,{variables:{input:{dataSiloId:r,isResolved:!1}},logger:t});return i}const f=a.type({identifier:a.string,type:a.string,coreIdentifier:a.string,dataSiloId:a.string,requestId:a.string,nonce:a.string,requestCreatedAt:a.string,daysUntilOverdue:a.number,attributes:a.array(a.type({key:a.string,values:a.array(a.string)}))});async function p(e,{dataSiloId:t,limit:n=100,offset:i=0,requestType:o}){try{let s=await e.get(`v1/data-silo/${t}/pending-requests/${o}`,{searchParams:{offset:i,limit:n}}).json(),{items:c}=r(a.type({items:a.array(f)}),s);return c}catch(e){throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function m({dataSiloId:n,auth:r,sombraAuth:a,actions:c,apiPageSize:f=100,savePageSize:m=1e3,onSave:h,transcendUrl:g=e,skipRequestCount:_=!1}){if(m%f!==0)throw Error(`savePageSize must be a multiple of apiPageSize. savePageSize: ${m}, apiPageSize: ${f}`);let v=await s(g,r,{logger:t,sombraApiKey:a,sombraUrl:process.env.SOMBRA_URL}),y=o(g,r),b=0;_||(b=await d(y,{dataSiloId:n})),t.info(i.magenta(`Pulling ${_?`all`:b} outstanding request identifiers for data silo: "${n}" for requests of types "${c.join(`", "`)}"`));let x=new Date().getTime(),S=new u.SingleBar({},u.Presets.shades_classic),C=new Set,w=[],T=[];_||S.start(b,0),await l(c,async e=>{let r=0,a=!0;for(;a;){let o=await p(v,{dataSiloId:n,limit:f,offset:r,requestType:e}),s=o.map(t=>(C.add(t.requestId),{...t,action:e})),c=s.map(({attributes:e,...t})=>({...t,...e.reduce((e,t)=>Object.assign(e,{[t.key]:t.values.join(`,`)}),{})}));w.push(...s),T.push(...c),T.length>=m&&(await h(T),T=[]),a=o.length===f,r+=f,_?t.info(i.magenta(`Pulled ${o.length} outstanding identifiers for ${C.size} requests`)):S.update(C.size)}}),T.length>0&&await h(T),_||S.stop();let E=new Date().getTime()-x;return t.info(i.green(`Successfully pulled ${w.length} outstanding identifiers from ${C.size} requests in "${E/1e3}" seconds!`)),{identifiers:w}}export{d as i,f as n,p as r,m as t};
2
- //# sourceMappingURL=pullChunkedCustomSiloOutstandingIdentifiers-DaYEDZ66.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-DaYEDZ66.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { makeGraphQLRequest } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\nimport { REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from './gqls/index.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 { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nexport const CronIdentifier = t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n});\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // Make the GraphQL request\n const response = await sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json();\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { 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, ...identifier }) => ({\n ...identifier,\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n\n return { identifiers };\n}\n"],"mappings":"saAaA,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,ECnCT,MAAa,EAAiB,EAAE,KAAK,CAEnC,WAAY,EAAE,OAEd,KAAM,EAAE,OAER,eAAgB,EAAE,OAElB,WAAY,EAAE,OAEd,UAAW,EAAE,OAEb,MAAO,EAAE,OAET,iBAAkB,EAAE,OAEpB,iBAAkB,EAAE,OAEpB,WAAY,EAA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AgB,CACrB,IAAM,EAAkB,MAAM,EAA0B,EAAQ,CAC9D,aACA,MAAO,EACP,SACA,YAAa,EACd,CAAC,CAEI,EAAoD,EAAgB,IACvE,IACC,EAAgB,IAAI,EAAW,UAAU,CAClC,CACL,GAAG,EACH,SACD,EAEJ,CAEK,EAA0B,EAAsB,KACnD,CAAE,aAAY,GAAG,MAAkB,CAClC,GAAG,EACH,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,SAAS,CACR,EAUvB,OARA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAY,OAAO,gCACxC,EAAgB,KACjB,gBAAgB,EAAY,IAAK,YACnC,CACF,CAEM,CAAE,cAAa"}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-XOsAW1__.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{t as n}from"./fetchAllRequestEnrichers-Bt97Bb7F.mjs";import{n as r,r as i}from"./fetchAllRequestIdentifiers-BXx3rSee.mjs";import{r as a}from"./fetchAllRequests-xGgt_STo.mjs";import{a as o}from"./writeCsv-Da8NUe1V.mjs";import{RequestStatus as s}from"@transcend-io/privacy-types";import{groupBy as c,uniq as l}from"lodash-es";import u from"colors";import{buildTranscendGraphQLClient as d,createSombraGotInstance 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=d(y,h),x=await f(y,h,{logger:t,sombraApiKey:g,sombraUrl:process.env.SOMBRA_URL});t.info(u.magenta(`Pulling manual enrichment requests, filtered for actions: ${_.join(`,`)}`));let S=await a(b,{actions:_,statuses:[s.Enriching]});await i(b);let C=[];await p(S,async e=>{let t=await n(b,{requestId:e.id});if(t.filter(({status:e})=>e===`ACTION_REQUIRED`)){let n=await r(b,x,{requestId:e.id,skipSombraCheck:!0});C.push({...e,requestIdentifiers:n,requestEnrichers:t})}},{concurrency:v});let w=C.map(({attributeValues:e,requestIdentifiers:t,requestEnrichers:n,...r})=>({...r,...Object.entries(c(t,`name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({value:e})=>e).join(`,`)}),{}),...Object.entries(c(e,`attributeKey.name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({name:e})=>e).join(`,`)}),{})}));return await o(m,w,l(w.map(e=>Object.keys(e)).flat())),t.info(u.green(`Successfully wrote ${C.length} requests to file "${m}"`)),C}export{m as t};
2
- //# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-BNuhsG20.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-BNuhsG20.mjs","names":[],"sources":["../src/lib/manual-enrichment/pullManualEnrichmentIdentifiersToCsv.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, createSombraGotInstance } 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 {\n PrivacyRequest,\n RequestEnricher,\n RequestIdentifier,\n fetchAllRequestEnrichers,\n fetchAllRequestIdentifiers,\n fetchAllRequests,\n validateSombraVersion,\n} from '../graphql/index.js';\nimport { writeCsv } from '../helpers/writeCsv.js';\n\nexport interface PrivacyRequestWithIdentifiers extends PrivacyRequest {\n /** Request Enrichers */\n requestEnrichers: RequestEnricher[];\n /** Request Identifiers */\n requestIdentifiers: RequestIdentifier[];\n}\n\n/**\n * Pull the set of manual enrichment jobs to CSV\n *\n * @param options - Options\n * @returns List of requests with identifiers\n */\nexport async function pullManualEnrichmentIdentifiersToCsv({\n file,\n auth,\n sombraAuth,\n requestActions = [],\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** The request actions to fetch */\n requestActions?: RequestAction[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<PrivacyRequestWithIdentifiers[]> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\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);\n\n // Requests to save\n const savedRequests: PrivacyRequestWithIdentifiers[] = [];\n\n // Filter down requests to what is needed\n await map(\n allRequests,\n async (request) => {\n // Fetch enrichers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n requestId: request.id,\n });\n\n // Check if manual enrichment exists for that request\n const hasManualEnrichment = requestEnrichers.filter(\n ({ status }) => status === 'ACTION_REQUIRED',\n );\n\n // Save request to queue\n if (hasManualEnrichment) {\n const requestIdentifiers = await fetchAllRequestIdentifiers(client, sombra, {\n requestId: request.id,\n skipSombraCheck: true,\n });\n savedRequests.push({\n ...request,\n requestIdentifiers,\n requestEnrichers,\n });\n }\n },\n {\n concurrency,\n },\n );\n\n const data = savedRequests.map(\n ({\n attributeValues,\n requestIdentifiers,\n requestEnrichers, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...request\n }) => ({\n ...request,\n // flatten identifiers\n ...Object.entries(groupBy(requestIdentifiers, 'name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ value }) => value).join(','),\n }),\n {},\n ),\n // flatten attributes\n ...Object.entries(groupBy(attributeValues, 'attributeKey.name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ name }) => name).join(','),\n }),\n {},\n ),\n }),\n );\n\n // Write out to CSV\n const headers = uniq(data.map((d) => Object.keys(d)).flat());\n await writeCsv(file, data, headers);\n\n logger.info(\n colors.green(`Successfully wrote ${savedRequests.length} requests to file \"${file}\"`),\n );\n\n return savedRequests;\n}\n"],"mappings":"0jBAgCA,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,EAAO,QACL,6DAA6D,EAAe,KAAK,IAAI,GACtF,CACF,CAGD,IAAM,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,SAAU,CAAC,EAAc,UAAU,CACpC,CAAC,CAEF,MAAM,EAAsB,EAAO,CAGnC,IAAM,EAAiD,EAAE,CAGzD,MAAM,EACJ,EACA,KAAO,IAAY,CAEjB,IAAM,EAAmB,MAAM,EAAyB,EAAQ,CAC9D,UAAW,EAAQ,GACpB,CAAC,CAQF,GAL4B,EAAiB,QAC1C,CAAE,YAAa,IAAW,kBAC5B,CAGwB,CACvB,IAAM,EAAqB,MAAM,EAA2B,EAAQ,EAAQ,CAC1E,UAAW,EAAQ,GACnB,gBAAiB,GAClB,CAAC,CACF,EAAc,KAAK,CACjB,GAAG,EACH,qBACA,mBACD,CAAC,GAGN,CACE,cACD,CACF,CAED,IAAM,EAAO,EAAc,KACxB,CACC,kBACA,qBACA,mBACA,GAAG,MACE,CACL,GAAG,EAEH,GAAG,OAAO,QAAQ,EAAQ,EAAoB,OAAO,CAAC,CAAC,QACpD,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,WAAY,EAAM,CAAC,KAAK,IAAI,CAClD,CAAC,CACJ,EAAE,CACH,CAED,GAAG,OAAO,QAAQ,EAAQ,EAAiB,oBAAoB,CAAC,CAAC,QAC9D,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,UAAW,EAAK,CAAC,KAAK,IAAI,CAChD,CAAC,CACJ,EAAE,CACH,CACF,EACF,CAUD,OANA,MAAM,EAAS,EAAM,EADL,EAAK,EAAK,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CACzB,CAEnC,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAc,OAAO,qBAAqB,EAAK,GAAG,CACtF,CAEM"}
@@ -1,58 +0,0 @@
1
- import{o as e}from"./enums-CyFTrzXY.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{f as n,l as r,o as i,t as a}from"./syncEnrichers-C9HcWCrs.mjs";import{ActionItemCode as o,ConsentTrackerStatus as s,RequestAction as c,RetentionType as l}from"@transcend-io/privacy-types";import{flatten as u,keyBy as d,mapValues as f}from"lodash-es";import p from"colors";import{ASSESSMENT_SECTION_FIELDS as m,fetchAllActionItemCollections as h,fetchAllActionItems as g,fetchAllActions as _,fetchAllAgentFiles as v,fetchAllAgentFunctions as y,fetchAllAgents as b,fetchAllAssessments as x,fetchAllAttributes as S,fetchAllBusinessEntities as C,fetchAllCookies as w,fetchAllDataCategories as T,fetchAllDataFlows as E,fetchAllIdentifiers as D,fetchAllMessages as O,fetchAllPolicies as ee,fetchAllPrivacyCenters as te,fetchAllProcessingActivities as ne,fetchAllProcessingPurposes as re,fetchAllPromptGroups as ie,fetchAllPromptPartials as ae,fetchAllPrompts as oe,fetchAllPurposesAndPreferences as se,fetchAllSiloDiscoveryResults as ce,fetchAllTeams as le,fetchAllTemplates as ue,fetchAllVendors as de,fetchApiKeys as fe,fetchConsentManager as pe,fetchConsentManagerExperiences as me,fetchConsentManagerTheme as he,fetchPartitions as ge,formatRegions as k,makeGraphQLRequest as A,parseAssessmentDisplayLogic as j,parseAssessmentRiskLogic as M}from"@transcend-io/sdk";import{gql as N}from"graphql-request";const P=N`
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
- ${m}
53
- }
54
- }
55
- }
56
- }
57
- `;async function F(e){let n=[],r=0,i=!1;do{let{assessmentFormTemplates:{nodes:a}}=await A(e,P,{variables:{first:20,offset:r},logger:t});n.push(...a),r+=20,i=a.length===20}while(i);return n.sort((e,t)=>e.title.localeCompare(t.title))}function I(e){let t=[];return e.map(e=>{let n=t.find(t=>t.key===e.attributeKey.name);return n===void 0?(n={key:e.attributeKey.name,values:[e.name]},t.push(n)):n.values.push(e.name),t}),t}const L=[e.DataSilos,e.Enrichers,e.Templates,e.ApiKeys];async function R(m,{dataSiloIds:A,integrationNames:N,debug:P,resources:R=L,pageSize:z,skipDatapoints:_e,includeGuessedCategories:B,skipSubDatapoints:ve,trackerStatuses:V=Object.values(s)}){if(A.length>0&&N.length>0)throw Error(`Only 1 of integrationNames OR dataSiloIds can be provided`);t.info(p.magenta(`Fetching data with page size ${z}...`));let[H,ye,U,W,G,K,q,J,Y,be,xe,Se,X,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Z,Le,Re,ze,Be,Ve,He]=await Promise.all([R.includes(e.DataSilos)||R.includes(e.DataSubjects)?n(m):[],R.includes(e.ApiKeys)?fe({},m,!0,{logger:t}):[],R.includes(e.DataSilos)?i(m,{ids:A,integrationNames:N,pageSize:z,debug:P,includeGuessedCategories:B,skipDatapoints:_e,skipSubDatapoints:ve}):[],R.includes(e.Enrichers)?a(m):[],R.includes(e.DataFlows)?[...V.includes(s.Live)?await E(m,s.Live,{logger:t}):[],...V.includes(s.NeedsReview)?await E(m,s.NeedsReview,{logger:t}):[]]:[],R.includes(e.Cookies)?[...V.includes(s.Live)?await w(m,s.Live,{logger:t}):[],...V.includes(s.NeedsReview)?await w(m,s.NeedsReview,{logger:t}):[]]:[],R.includes(e.Attributes)?S(m,{logger:t}):[],R.includes(e.Templates)?ue(m,{logger:t}):[],R.includes(e.Identifiers)?D(m,{logger:t}):[],R.includes(e.Actions)?_(m,{logger:t}):[],R.includes(e.BusinessEntities)?C(m,{logger:t}):[],R.includes(e.ProcessingActivities)?ne(m,{logger:t}):[],R.includes(e.ConsentManager)?pe(m,{logger:t}):void 0,R.includes(e.ConsentManager)?me(m,{logger:t}):[],R.includes(e.Prompts)?oe(m,{logger:t}):[],R.includes(e.PromptPartials)?ae(m,{logger:t}):[],R.includes(e.PromptGroups)?ie(m,{logger:t}):[],R.includes(e.Agents)?b(m,{logger:t}):[],R.includes(e.AgentFunctions)?y(m,{logger:t}):[],R.includes(e.AgentFiles)?v(m,{logger:t}):[],R.includes(e.Vendors)?de(m,{logger:t}):[],R.includes(e.DataCategories)?T(m,{logger:t}):[],R.includes(e.ProcessingPurposes)?re(m,{logger:t}):[],R.includes(e.ActionItems)?g(m,{logger:t,filterBy:{type:[o.Onboarding]}}):[],R.includes(e.ActionItemCollections)?h(m,{logger:t}):[],R.includes(e.Teams)?le(m,{logger:t}):[],R.includes(e.Policies)?ee(m,{logger:t}):[],R.includes(e.PrivacyCenters)?te(m,{logger:t}):[],R.includes(e.Messages)?O(m,{logger:t}):[],R.includes(e.Partitions)?ge(m,{logger:t}):[],R.includes(e.Assessments)?x(m,{logger:t}):[],R.includes(e.AssessmentTemplates)?F(m):[],R.includes(e.Purposes)?se(m,{logger:t}):[],R.includes(e.SystemDiscovery)?ce(m,{logger:t}):[]]),Q=R.includes(e.ConsentManager)&&X?await he(m,X.id,{logger:t}):void 0,$={},Ue=u(U.map(([{apiKeys:e}])=>e.map(({title:e})=>e))),We=Object.values(ye).filter(({title:t})=>R.includes(e.ApiKeys)?!0:Ue.includes(t));if(We.length>0&&R.includes(e.ApiKeys)&&($[`api-keys`]=We.map(({title:e})=>({title:e}))),Re.length>0&&R.includes(e.Partitions)&&($.partitions=Re.map(({name:e,partition:t})=>({name:e,partition:t}))),X&&R.includes(e.ConsentManager)&&($[`consent-manager`]={bundleUrls:{TEST:X.testBundleURL,PRODUCTION:X.bundleURL},domains:X.configuration.domains||void 0,partition:X.configuration.partition||void 0,consentPrecedence:X.configuration.consentPrecedence||void 0,unknownRequestPolicy:X.configuration.unknownRequestPolicy||void 0,unknownCookiePolicy:X.configuration.unknownCookiePolicy||void 0,syncEndpoint:X.configuration.syncEndpoint||void 0,telemetryPartitioning:X.configuration.telemetryPartitioning||void 0,signedIabAgreement:X.configuration.signedIabAgreement||void 0,syncGroups:X.configuration.syncGroups||void 0,theme:Q?{primaryColor:Q.primaryColor||void 0,fontColor:Q.fontColor||void 0,privacyPolicy:Q.privacyPolicy||void 0,prompt:Q.prompt}:void 0,experiences:Ce.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}))}),ze.length>0&&R.includes(e.Assessments)&&($.assessments=ze.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?j(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=M(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?I(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||``}))}))),Be.length>0&&R.includes(e.AssessmentTemplates)&&($[`assessment-templates`]=Be.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?j(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=M(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}))),He.length>0&&R.includes(e.SystemDiscovery)&&($[`system-discovery`]=He.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}))),we.length>0&&R.includes(e.Prompts)&&($.prompts=we.map(({title:e,content:t})=>({title:e,content:t}))),Te.length>0&&R.includes(e.PromptPartials)&&($[`prompt-partials`]=Te.map(({title:e,content:t})=>({title:e,content:t}))),Ee.length>0&&R.includes(e.PromptGroups)&&($[`prompt-groups`]=Ee.map(({title:e,description:t,prompts:n})=>({title:e,description:t,prompts:n.map(({title:e})=>e)}))),Fe.length>0&&R.includes(e.Teams)&&($.teams=Fe.map(({name:e,description:t,ssoDepartment:n,ssoGroup:r,ssoTitle:i,users:a,scopes:o})=>({name:e,description:t,"sso-department":n||void 0,"sso-group":r||void 0,"sso-title":i||void 0,users:a.map(({email:e})=>e),scopes:o.map(({name:e})=>e)}))),H.length>0&&R.includes(e.DataSubjects)&&($[`data-subjects`]=H.map(({type:e,title:t,active:n,adminDashboardDefaultSilentMode:r,actions:i})=>({type:e,title:t?.defaultMessage,active:n,adminDashboardDefaultSilentMode:r,actions:i.map(({type:e})=>e)}))),Ie.length>0&&($.policies=Ie.map(({title:e,versions:t,disabledLocales:n})=>({title:e?.defaultMessage,content:t?.[0]?.content?.defaultMessage,disabledLocales:n}))),Le.length>0&&($.messages=Le.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}),{})}))),Z.length>0){let e=Z[0];$[`privacy-center`]={isDisabled:e.isDisabled,showPrivacyRequestButton:e.showPrivacyRequestButton,showPolicies:e.showPolicies,showTrackingTechnologies:e.showTrackingTechnologies,showCookies:e.showCookies,showDataFlows:e.showDataFlows,showConsentManager:e.showConsentManager,showManageYourPrivacy:e.showManageYourPrivacy,showMarketingPreferences:e.showMarketingPreferences,locales:e.locales,defaultLocale:e.defaultLocale,preferBrowserDefaultLocale:e.preferBrowserDefaultLocale,supportEmail:e.supportEmail||void 0,replyToEmail:e.replyToEmail||void 0,useNoReplyEmailAddress:e.useNoReplyEmailAddress,useCustomEmailDomain:e.useCustomEmailDomain,transformAccessReportJsonToCsv:e.transformAccessReportJsonToCsv,theme:e.theme}}if(xe.length>0&&R.includes(e.BusinessEntities)&&($[`business-entities`]=xe.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?I(s):void 0}))),Se.length>0&&R.includes(e.ProcessingActivities)&&($[`processing-activities`]=Se.map(({title:e,description:t,securityMeasureDetails:n,controllerships:r,storageRegions:i,transferRegions:a,retentionType:o,retentionPeriod:s,dataProtectionImpactAssessmentLink:c,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?k(i):void 0,transferRegions:a.length>0?k(a):void 0,retentionType:o,retentionPeriod:o===l.StatedPeriod?s:void 0,dataProtectionImpactAssessmentLink:c??void 0,dataProtectionImpactAssessmentStatus:u,attributes:d!==void 0&&d.length>0?I(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}))),be.length>0&&R.includes(e.Actions)&&($.actions=be.map(({type:e,skipSecondaryIfNoFiles:t,skipDownloadableStep:n,requiresReview:r,regionList:i,regionDetectionMethod:a,waitingPeriod:o})=>({type:e,...e===c.Erasure?{skipSecondaryIfNoFiles:t,skipDownloadableStep:n}:{},requiresReview:r,waitingPeriod:o,regionDetectionMethod:a,regionList:i.length>0?i:void 0}))),Y.length>0&&R.includes(e.Identifiers)&&($.identifiers=Y.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}))),De.length>0&&R.includes(e.Agents)&&($.agents=De.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}))),Ne.length>0&&R.includes(e.ActionItems)&&($[`action-items`]=Ne.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?I(d):void 0}))),Pe.length>0&&R.includes(e.ActionItemCollections)&&($[`action-item-collections`]=Pe.map(({title:e,description:t,hidden:n,productLine:r})=>({title:e,description:t||void 0,hidden:n,productLine:r}))),Oe.length>0&&R.includes(e.AgentFunctions)&&($[`agent-functions`]=Oe.map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:JSON.stringify(n)}))),ke.length>0&&R.includes(e.AgentFiles)&&($[`agent-files`]=ke.map(({name:e,description:t,fileId:n,size:r,purpose:i})=>({name:e,description:t,fileId:n,size:r,purpose:i}))),Ae.length>0&&R.includes(e.Vendors)&&($.vendors=Ae.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?I(f):void 0}))),je.length>0&&R.includes(e.DataCategories)&&($[`data-categories`]=je.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?I(o):void 0}))),Me.length>0&&R.includes(e.ProcessingPurposes)&&($[`processing-purposes`]=Me.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?I(a):void 0}))),G.length>0&&R.includes(e.DataFlows)&&($[`data-flows`]=G.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?I(c):void 0}))),K.length>0&&R.includes(e.Cookies)&&($.cookies=K.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?I(c):void 0}))),q.length>0&&R.includes(e.Attributes)&&($.attributes=q.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}))}))),Ve.length>0&&($.purposes=Ve.map(({name:e,description:t,trackingType:n,defaultConsent:r,configurable:i,showInConsentManager:a,isActive:o,displayOrder:s,optOutSignals:c,authLevel:l,topics:u,showInPrivacyCenter:d,title:f})=>({name:e,title:f,description:t||void 0,trackingType:n,"default-consent":r,configurable:i,"show-in-consent-manager":a,"show-in-privacy-center":d,"is-active":o,"display-order":s,"opt-out-signals":c.length>0?c:void 0,"auth-level":l||void 0,"preference-topics":u.map(({title:e,type:t,displayDescription:n,defaultConfiguration:r,showInPrivacyCenter:i,preferenceOptionValues:a})=>({title:e.defaultMessage,type:t,description:n.defaultMessage,"default-configuration":r,"show-in-privacy-center":i,...a.length>0?{options:a.map(({title:e,slug:t})=>({title:e.defaultMessage,slug:t}))}:{}}))}))),A.length===0&&J.length>0&&R.includes(e.Templates)&&($.templates=J.map(({title:e})=>({title:e}))),W.length>0&&R.includes(e.Enrichers)&&($.enrichers=W.map(({title:e,url:t,type:n,inputIdentifier:r,identifiers:i,actions:a,testRegex:o,dataSubjects:s,expirationDuration:l,lookerQueryTitle:u,transitionRequestStatus:d,phoneNumbers:f,regionList:p})=>({title:e,url:t||void 0,type:n,"input-identifier":r?.name,"output-identifiers":i.map(({name:e})=>e),"privacy-actions":Object.values(c).length===a.length?void 0:a,testRegex:o||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":s.map(({type:e})=>e)}))),U.length>0&&R.includes(e.DataSilos)){let e=d(H,`type`);$[`data-silos`]=U.map(([{title:t,description:n,url:i,type:a,outerType:o,apiKeys:s,notifyEmailAddress:c,identifiers:l,dependentDataSilos:u,owners:p,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},O])=>({title:t,description:n,integrationName:a,"outer-type":o||void 0,url:i||void 0,"api-key-title":s[0]?.title,"identity-keys":l.filter(({isConnected:e})=>e).map(({name:e})=>e),...u.length>0?{"deletion-dependencies":u.map(({title:e})=>e)}:{},...p.length>0?{owners:p.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?r(_.map(({type:e})=>e),e):void 0,...w.hasAvcFunctionality?{"email-settings":{"notify-email-address":c||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?I(T):void 0,datapoints:O.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":f(d(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,...B&&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?I(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 $}export{P as a,F as i,R as n,I as r,L as t};
58
- //# sourceMappingURL=pullTranscendConfiguration-DSyMRyPe.mjs.map