@transcend-io/cli 10.1.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/dist/{app-Cx8-4u8K.mjs → app-C1m4rExX.mjs} +20 -20
  2. package/dist/{app-Cx8-4u8K.mjs.map → app-C1m4rExX.mjs.map} +1 -1
  3. package/dist/{approvePrivacyRequests-Bjq5cPSI.mjs → approvePrivacyRequests-BIHcACAj.mjs} +2 -2
  4. package/dist/{approvePrivacyRequests-Bjq5cPSI.mjs.map → approvePrivacyRequests-BIHcACAj.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-CBbcir-p.mjs} +2 -2
  9. package/dist/{buildXdiSyncEndpoint-DWs9ImOw.mjs.map → buildXdiSyncEndpoint-CBbcir-p.mjs.map} +1 -1
  10. package/dist/bulkRestartRequests-ByH7TjH2.mjs +2 -0
  11. package/dist/bulkRestartRequests-ByH7TjH2.mjs.map +1 -0
  12. package/dist/bulkRetryEnrichers-DuYXD-64.mjs +2 -0
  13. package/dist/bulkRetryEnrichers-DuYXD-64.mjs.map +1 -0
  14. package/dist/cancelPrivacyRequests-DMgQOffA.mjs +2 -0
  15. package/dist/cancelPrivacyRequests-DMgQOffA.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-DnoHX-eW.mjs} +2 -2
  21. package/dist/{command-rzZKmlky.mjs.map → command-DnoHX-eW.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-muOBBQA_.mjs} +2 -2
  30. package/dist/{constants-XOsAW1__.mjs.map → constants-muOBBQA_.mjs.map} +1 -1
  31. package/dist/{createExtraKeyHandler-Jp5XpTJi.mjs → createExtraKeyHandler-srtG2U7q.mjs} +2 -2
  32. package/dist/{createExtraKeyHandler-Jp5XpTJi.mjs.map → createExtraKeyHandler-srtG2U7q.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-kKhGnFmx.mjs} +2 -2
  38. package/dist/{downloadPrivacyRequestFiles-GUbd_PRc.mjs.map → downloadPrivacyRequestFiles-kKhGnFmx.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-C7yH3Rbi.mjs +2 -0
  44. package/dist/generateCrossAccountApiKeys-C7yH3Rbi.mjs.map +1 -0
  45. package/dist/{impl-B-PzeHxN.mjs → impl-3VLH9aat.mjs} +2 -2
  46. package/dist/{impl-B-PzeHxN.mjs.map → impl-3VLH9aat.mjs.map} +1 -1
  47. package/dist/{impl-iGMjSniP.mjs → impl-3sDUDXru.mjs} +2 -2
  48. package/dist/{impl-iGMjSniP.mjs.map → impl-3sDUDXru.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-84ylH4aO.mjs +2 -0
  52. package/dist/{impl-BVHfSIVG.mjs.map → impl-84ylH4aO.mjs.map} +1 -1
  53. package/dist/impl-B62XN4tV.mjs +2 -0
  54. package/dist/impl-B62XN4tV.mjs.map +1 -0
  55. package/dist/{impl-BMnXA_Vd.mjs → impl-B9BsXBxS.mjs} +2 -2
  56. package/dist/{impl-BMnXA_Vd.mjs.map → impl-B9BsXBxS.mjs.map} +1 -1
  57. package/dist/{impl-C3DXXn8M.mjs → impl-BNqmxytJ.mjs} +2 -2
  58. package/dist/{impl-C3DXXn8M.mjs.map → impl-BNqmxytJ.mjs.map} +1 -1
  59. package/dist/{impl-Dw9uW5zy2.mjs → impl-BYf4MpWP.mjs} +2 -2
  60. package/dist/impl-BYf4MpWP.mjs.map +1 -0
  61. package/dist/{impl-BBKJIP0Q.mjs → impl-BaC9iEO_.mjs} +2 -2
  62. package/dist/{impl-BBKJIP0Q.mjs.map → impl-BaC9iEO_.mjs.map} +1 -1
  63. package/dist/{impl-CpJljZV2.mjs → impl-BhDS0QIt.mjs} +2 -2
  64. package/dist/{impl-CpJljZV2.mjs.map → impl-BhDS0QIt.mjs.map} +1 -1
  65. package/dist/{impl-CqH3YYuv.mjs → impl-BjCQSRLu.mjs} +2 -2
  66. package/dist/{impl-CqH3YYuv.mjs.map → impl-BjCQSRLu.mjs.map} +1 -1
  67. package/dist/{impl-Cpndlxar.mjs → impl-BjIylEKQ.mjs} +2 -2
  68. package/dist/{impl-Cpndlxar.mjs.map → impl-BjIylEKQ.mjs.map} +1 -1
  69. package/dist/{impl-BBnnC5xq.mjs → impl-BwrEi3s7.mjs} +2 -2
  70. package/dist/{impl-BBnnC5xq.mjs.map → impl-BwrEi3s7.mjs.map} +1 -1
  71. package/dist/{impl-DKAV-8XC.mjs → impl-C4AI1Fsj.mjs} +2 -2
  72. package/dist/{impl-DKAV-8XC.mjs.map → impl-C4AI1Fsj.mjs.map} +1 -1
  73. package/dist/{impl-BKrNGF2F.mjs → impl-CCAeEeMR.mjs} +2 -2
  74. package/dist/{impl-BKrNGF2F.mjs.map → impl-CCAeEeMR.mjs.map} +1 -1
  75. package/dist/{impl-BRiRfzgu.mjs → impl-CFI5y5U-.mjs} +2 -2
  76. package/dist/{impl-BRiRfzgu.mjs.map → impl-CFI5y5U-.mjs.map} +1 -1
  77. package/dist/{impl-CC0rkA9s.mjs → impl-CIfRN0ux.mjs} +2 -2
  78. package/dist/{impl-CC0rkA9s.mjs.map → impl-CIfRN0ux.mjs.map} +1 -1
  79. package/dist/{impl-DhXQb3bm.mjs → impl-CLznNZ5F.mjs} +2 -2
  80. package/dist/{impl-DhXQb3bm.mjs.map → impl-CLznNZ5F.mjs.map} +1 -1
  81. package/dist/{impl-DpwyYsfg.mjs → impl-CUdo0Jyh.mjs} +2 -2
  82. package/dist/{impl-DpwyYsfg.mjs.map → impl-CUdo0Jyh.mjs.map} +1 -1
  83. package/dist/{impl-CvJtt8H2.mjs → impl-Cmj1Vi5Q.mjs} +2 -2
  84. package/dist/{impl-CvJtt8H2.mjs.map → impl-Cmj1Vi5Q.mjs.map} +1 -1
  85. package/dist/{impl-BVnfUDUm.mjs → impl-Cw3_0zqC.mjs} +2 -2
  86. package/dist/{impl-BVnfUDUm.mjs.map → impl-Cw3_0zqC.mjs.map} +1 -1
  87. package/dist/{impl-DaK9UOwL.mjs → impl-CzvCA0Ev.mjs} +2 -2
  88. package/dist/{impl-DaK9UOwL.mjs.map → impl-CzvCA0Ev.mjs.map} +1 -1
  89. package/dist/{impl-BffzTHKU.mjs → impl-D1DmW5-P.mjs} +2 -2
  90. package/dist/{impl-BffzTHKU.mjs.map → impl-D1DmW5-P.mjs.map} +1 -1
  91. package/dist/{impl-Cy8-6_Oo2.mjs → impl-D41c_KGj.mjs} +2 -2
  92. package/dist/impl-D41c_KGj.mjs.map +1 -0
  93. package/dist/impl-DEpCg7UP.mjs +2 -0
  94. package/dist/impl-DEpCg7UP.mjs.map +1 -0
  95. package/dist/{impl-BSKl6rC6.mjs → impl-DHOh4ypd.mjs} +2 -2
  96. package/dist/{impl-BSKl6rC6.mjs.map → impl-DHOh4ypd.mjs.map} +1 -1
  97. package/dist/{impl-StdJMCiM.mjs → impl-DJg0Ibxs.mjs} +2 -2
  98. package/dist/{impl-StdJMCiM.mjs.map → impl-DJg0Ibxs.mjs.map} +1 -1
  99. package/dist/{impl-ogUHfunr.mjs → impl-DUdbbIpf.mjs} +2 -2
  100. package/dist/{impl-ogUHfunr.mjs.map → impl-DUdbbIpf.mjs.map} +1 -1
  101. package/dist/{impl-CODwodEc.mjs → impl-DXHqqWJb.mjs} +2 -2
  102. package/dist/{impl-CODwodEc.mjs.map → impl-DXHqqWJb.mjs.map} +1 -1
  103. package/dist/{impl-CnHiD4zU.mjs → impl-DXaA3sMt.mjs} +2 -2
  104. package/dist/{impl-CnHiD4zU.mjs.map → impl-DXaA3sMt.mjs.map} +1 -1
  105. package/dist/{impl-CPIMsZg-.mjs → impl-Dl4RcPKp.mjs} +2 -2
  106. package/dist/{impl-CPIMsZg-.mjs.map → impl-Dl4RcPKp.mjs.map} +1 -1
  107. package/dist/{impl-CZsYoSZQ.mjs → impl-DvAwxl6Z.mjs} +2 -2
  108. package/dist/{impl-CZsYoSZQ.mjs.map → impl-DvAwxl6Z.mjs.map} +1 -1
  109. package/dist/{impl-D_AxguFh2.mjs → impl-GRdcDZQ4.mjs} +2 -2
  110. package/dist/impl-GRdcDZQ4.mjs.map +1 -0
  111. package/dist/{impl-DJ4VCAcc.mjs → impl-UMb9wjra.mjs} +2 -2
  112. package/dist/{impl-DJ4VCAcc.mjs.map → impl-UMb9wjra.mjs.map} +1 -1
  113. package/dist/{impl-BxOydpyJ.mjs → impl-Yq33AV90.mjs} +2 -2
  114. package/dist/{impl-BxOydpyJ.mjs.map → impl-Yq33AV90.mjs.map} +1 -1
  115. package/dist/{impl-BGGm947r2.mjs → impl-aGDJJgGc.mjs} +2 -2
  116. package/dist/impl-aGDJJgGc.mjs.map +1 -0
  117. package/dist/{impl-DvrSuAJv.mjs → impl-fZQxhZRu.mjs} +2 -2
  118. package/dist/{impl-DvrSuAJv.mjs.map → impl-fZQxhZRu.mjs.map} +1 -1
  119. package/dist/{impl-C-u5h8We.mjs → impl-gitQPEo3.mjs} +2 -2
  120. package/dist/{impl-C-u5h8We.mjs.map → impl-gitQPEo3.mjs.map} +1 -1
  121. package/dist/impl-i-vquwbD.mjs +2 -0
  122. package/dist/impl-i-vquwbD.mjs.map +1 -0
  123. package/dist/{impl-B6TXE2oE.mjs → impl-iteb85IZ.mjs} +2 -2
  124. package/dist/{impl-B6TXE2oE.mjs.map → impl-iteb85IZ.mjs.map} +1 -1
  125. package/dist/{impl-uwkj-RbF.mjs → impl-tYtVXUz2.mjs} +2 -2
  126. package/dist/{impl-uwkj-RbF.mjs.map → impl-tYtVXUz2.mjs.map} +1 -1
  127. package/dist/{impl-yvc0y1uO.mjs → impl-wcRtA0L3.mjs} +2 -2
  128. package/dist/{impl-yvc0y1uO.mjs.map → impl-wcRtA0L3.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 +842 -1645
  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-BaVxVfDe.mjs +2 -0
  142. package/dist/markRequestDataSiloIdsCompleted-BaVxVfDe.mjs.map +1 -0
  143. package/dist/{markSilentPrivacyRequests-ytCzpUkY.mjs → markSilentPrivacyRequests-miaumnaC.mjs} +2 -2
  144. package/dist/{markSilentPrivacyRequests-ytCzpUkY.mjs.map → markSilentPrivacyRequests-miaumnaC.mjs.map} +1 -1
  145. package/dist/notifyPrivacyRequestsAdditionalTime-BUdhSCNL.mjs +2 -0
  146. package/dist/notifyPrivacyRequestsAdditionalTime-BUdhSCNL.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-BW5Vws25.mjs +2 -0
  156. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-BW5Vws25.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-kpGy9H7T.mjs +2 -0
  160. package/dist/pullManualEnrichmentIdentifiersToCsv-kpGy9H7T.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-BZRA1n_8.mjs} +2 -2
  166. package/dist/{pushCronIdentifiersFromCsv-D9Hzna0W.mjs.map → pushCronIdentifiersFromCsv-BZRA1n_8.mjs.map} +1 -1
  167. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BiR7PS_d.mjs → pushManualEnrichmentIdentifiersFromCsv-DXqf8WWy.mjs} +2 -2
  168. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BiR7PS_d.mjs.map → pushManualEnrichmentIdentifiersFromCsv-DXqf8WWy.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-BxWSsJit.mjs +2 -0
  172. package/dist/removeUnverifiedRequestIdentifiers-BxWSsJit.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-BVrJz_GC.mjs +2 -0
  176. package/dist/retryRequestDataSilos-BVrJz_GC.mjs.map +1 -0
  177. package/dist/skipPreflightJobs-CYuoMG3z.mjs +2 -0
  178. package/dist/skipPreflightJobs-CYuoMG3z.mjs.map +1 -0
  179. package/dist/skipRequestDataSilos-BNspAsjR.mjs +2 -0
  180. package/dist/skipRequestDataSilos-BNspAsjR.mjs.map +1 -0
  181. package/dist/streamPrivacyRequestsToCsv-PoyTmQd6.mjs +2 -0
  182. package/dist/streamPrivacyRequestsToCsv-PoyTmQd6.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-lAw3E1wm.mjs +2 -0
  186. package/dist/updateConsentManagerVersionToLatest-lAw3E1wm.mjs.map +1 -0
  187. package/dist/{uploadConsents-BP5XILuw.mjs → uploadConsents-BzmWrNc1.mjs} +2 -2
  188. package/dist/{uploadConsents-BP5XILuw.mjs.map → uploadConsents-BzmWrNc1.mjs.map} +1 -1
  189. package/dist/{uploadCookiesFromCsv-B42cZgYW.mjs → uploadCookiesFromCsv-TH10UBgw.mjs} +2 -2
  190. package/dist/{uploadCookiesFromCsv-B42cZgYW.mjs.map → uploadCookiesFromCsv-TH10UBgw.mjs.map} +1 -1
  191. package/dist/{uploadDataFlowsFromCsv-D2V567pP.mjs → uploadDataFlowsFromCsv-DUSFCae9.mjs} +2 -2
  192. package/dist/{uploadDataFlowsFromCsv-D2V567pP.mjs.map → uploadDataFlowsFromCsv-DUSFCae9.mjs.map} +1 -1
  193. package/dist/uploadPrivacyRequestsFromCsv-sKSFfE6q.mjs +2 -0
  194. package/dist/uploadPrivacyRequestsFromCsv-sKSFfE6q.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 +6 -6
  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 +1 @@
1
- {"version":3,"file":"impl-CC0rkA9s.mjs","names":[],"sources":["../src/commands/request/export/impl.ts"],"sourcesContent":["import type { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { streamPrivacyRequestsToCsv } from '../../../lib/requests/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface ExportCommandFlags {\n auth: string;\n sombraAuth?: string;\n actions?: RequestAction[];\n statuses?: RequestStatus[];\n transcendUrl: string;\n file: string;\n concurrency: number;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n showTests?: boolean;\n skipRequestIdentifiers?: boolean;\n pageLimit: number;\n}\n\n// `export` is a reserved keyword, so we need to prefix it with an underscore\n// eslint-disable-next-line no-underscore-dangle\nexport async function _export(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n pageLimit,\n concurrency,\n actions,\n sombraAuth,\n skipRequestIdentifiers,\n statuses,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n showTests,\n }: ExportCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const { filePaths, totalCount } = await streamPrivacyRequestsToCsv({\n transcendUrl,\n concurrency,\n pageLimit,\n actions,\n statuses,\n auth,\n sombraAuth,\n skipRequestIdentifiers,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isTest: showTests,\n file,\n });\n\n logger.info(\n colors.green(\n `Successfully wrote ${totalCount} requests to ` +\n `${filePaths.length} file(s): ${filePaths.join(', ')}`,\n ),\n );\n}\n"],"mappings":"kLA2BA,eAAsB,EAEpB,CACE,OACA,eACA,OACA,YACA,cACA,UACA,aACA,yBACA,WACA,kBACA,iBACA,kBACA,iBACA,aAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAM,CAAE,YAAW,cAAe,MAAM,EAA2B,CACjE,eACA,cACA,YACA,UACA,WACA,OACA,aACA,yBACA,kBACA,iBACA,kBACA,iBACA,OAAQ,EACR,OACD,CAAC,CAEF,EAAO,KACL,EAAO,MACL,sBAAsB,EAAW,eAC5B,EAAU,OAAO,YAAY,EAAU,KAAK,KAAK,GACvD,CACF"}
1
+ {"version":3,"file":"impl-CIfRN0ux.mjs","names":[],"sources":["../src/commands/request/export/impl.ts"],"sourcesContent":["import type { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { streamPrivacyRequestsToCsv } from '../../../lib/requests/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface ExportCommandFlags {\n auth: string;\n sombraAuth?: string;\n actions?: RequestAction[];\n statuses?: RequestStatus[];\n transcendUrl: string;\n file: string;\n concurrency: number;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n showTests?: boolean;\n skipRequestIdentifiers?: boolean;\n pageLimit: number;\n}\n\n// `export` is a reserved keyword, so we need to prefix it with an underscore\n// eslint-disable-next-line no-underscore-dangle\nexport async function _export(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n pageLimit,\n concurrency,\n actions,\n sombraAuth,\n skipRequestIdentifiers,\n statuses,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n showTests,\n }: ExportCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const { filePaths, totalCount } = await streamPrivacyRequestsToCsv({\n transcendUrl,\n concurrency,\n pageLimit,\n actions,\n statuses,\n auth,\n sombraAuth,\n skipRequestIdentifiers,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isTest: showTests,\n file,\n });\n\n logger.info(\n colors.green(\n `Successfully wrote ${totalCount} requests to ` +\n `${filePaths.length} file(s): ${filePaths.join(', ')}`,\n ),\n );\n}\n"],"mappings":"kLA2BA,eAAsB,EAEpB,CACE,OACA,eACA,OACA,YACA,cACA,UACA,aACA,yBACA,WACA,kBACA,iBACA,kBACA,iBACA,aAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAM,CAAE,YAAW,cAAe,MAAM,EAA2B,CACjE,eACA,cACA,YACA,UACA,WACA,OACA,aACA,yBACA,kBACA,iBACA,kBACA,iBACA,OAAQ,EACR,OACD,CAAC,CAEF,EAAO,KACL,EAAO,MACL,sBAAsB,EAAW,eAC5B,EAAU,OAAO,YAAY,EAAU,KAAK,KAAK,GACvD,CACF"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{r as t,t as n}from"./writeCsv-Da8NUe1V.mjs";import{t as r}from"./done-input-validation-C5rgR0Wr.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,createSombraGotInstance as o,fetchAllIdentifiers as s,fetchAllPurposesAndPreferences as c,fetchConsentPreferences as l,fetchConsentPreferencesChunked as u,transformPreferenceRecordToCsv as d}from"@transcend-io/sdk";const f=[`userId`,`timestamp`,`partition`,`decryptionStatus`,`updatedAt`,`usp`,`gpp`,`tcf`,`airgapVersion`,`metadata`,`metadataTimestamp`];async function p({auth:p,partition:m,sombraAuth:h,file:g,transcendUrl:_,timestampBefore:v,timestampAfter:y,updatedBefore:b,updatedAfter:x,identifiers:S=[],concurrency:C,shouldChunk:w,windowConcurrency:T,maxChunks:E,exportIdentifiersWithDelimiter:D,maxLookbackDays:O}){r(this.process.exit);let k=await o(_,p,{logger:e,sombraApiKey:h,sombraUrl:process.env.SOMBRA_URL}),A=a(_,p),j=S.map(e=>{if(!e.includes(`:`))return{name:`email`,value:e};let[t,n]=e.split(`:`);return{name:t,value:n}}),M={...v?{timestampBefore:v.toISOString()}:{},...y?{timestampAfter:y.toISOString()}:{},...x||b?{system:{...b?{updatedBefore:b.toISOString()}:{},...x?{updatedAfter:x.toISOString()}:{}}}:{},...j.length>0?{identifiers:j}:{}};e.info(`Fetching consent preferences from partition ${m}, using mode=${w?`chunked-stream`:`paged-stream`}...`),e.info(i.magenta(`Preparing CSV at: ${g}`));let[N,P]=await Promise.all([c(A,{logger:e}),s(A,{logger:e})]),F=P.map(e=>e.name),I=Array.from(new Set(N.flatMap(e=>e.topics?.map(t=>`${e.trackingType}_${t.slug}`)??[]))).sort((e,t)=>e.localeCompare(t)),L=Array.from(new Set(N.map(e=>e.trackingType))).sort((e,t)=>e.localeCompare(t)),R=[...f,...F,...L,...I],z=null,B=!1,V=e=>{if(!e||e.length===0)return;let r=e.map(e=>d(e,D));if(!B){let e=Object.keys(r[0]??{}),n=new Set;z=[...R,...e].filter(e=>e===void 0||n.has(e)?!1:(n.add(e),!0)),t(g,z),B=!0}n(g,r,z)};if(w){await u(k,{partition:m,filterBy:M,limit:C,windowConcurrency:T,maxChunks:E,maxLookbackDays:O,logger:e,onItems:e=>V(e)}),e.info(i.green(`Finished writing CSV to ${g}`));return}await l(k,{partition:m,filterBy:M,limit:C,logger:e,onItems:e=>V(e)}),e.info(i.green(`Finished writing CSV to ${g}`))}export{p as pullConsentPreferences};
2
- //# sourceMappingURL=impl-DhXQb3bm.mjs.map
1
+ import{t as e}from"./logger-Bj782ZYD.mjs";import{r as t,t as n}from"./writeCsv-C4pjXGsD.mjs";import{t as r}from"./done-input-validation-BcNBxhEs.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,createSombraGotInstance as o,fetchAllIdentifiers as s,fetchAllPurposesAndPreferences as c,fetchConsentPreferences as l,fetchConsentPreferencesChunked as u,transformPreferenceRecordToCsv as d}from"@transcend-io/sdk";const f=[`userId`,`timestamp`,`partition`,`decryptionStatus`,`updatedAt`,`usp`,`gpp`,`tcf`,`airgapVersion`,`metadata`,`metadataTimestamp`];async function p({auth:p,partition:m,sombraAuth:h,file:g,transcendUrl:_,timestampBefore:v,timestampAfter:y,updatedBefore:b,updatedAfter:x,identifiers:S=[],concurrency:C,shouldChunk:w,windowConcurrency:T,maxChunks:E,exportIdentifiersWithDelimiter:D,maxLookbackDays:O}){r(this.process.exit);let k=await o(_,p,{logger:e,sombraApiKey:h,sombraUrl:process.env.SOMBRA_URL}),A=a(_,p),j=S.map(e=>{if(!e.includes(`:`))return{name:`email`,value:e};let[t,n]=e.split(`:`);return{name:t,value:n}}),M={...v?{timestampBefore:v.toISOString()}:{},...y?{timestampAfter:y.toISOString()}:{},...x||b?{system:{...b?{updatedBefore:b.toISOString()}:{},...x?{updatedAfter:x.toISOString()}:{}}}:{},...j.length>0?{identifiers:j}:{}};e.info(`Fetching consent preferences from partition ${m}, using mode=${w?`chunked-stream`:`paged-stream`}...`),e.info(i.magenta(`Preparing CSV at: ${g}`));let[N,P]=await Promise.all([c(A,{logger:e}),s(A,{logger:e})]),F=P.map(e=>e.name),I=Array.from(new Set(N.flatMap(e=>e.topics?.map(t=>`${e.trackingType}_${t.slug}`)??[]))).sort((e,t)=>e.localeCompare(t)),L=Array.from(new Set(N.map(e=>e.trackingType))).sort((e,t)=>e.localeCompare(t)),R=[...f,...F,...L,...I],z=null,B=!1,V=e=>{if(!e||e.length===0)return;let r=e.map(e=>d(e,D));if(!B){let e=Object.keys(r[0]??{}),n=new Set;z=[...R,...e].filter(e=>e===void 0||n.has(e)?!1:(n.add(e),!0)),t(g,z),B=!0}n(g,r,z)};if(w){await u(k,{partition:m,filterBy:M,limit:C,windowConcurrency:T,maxChunks:E,maxLookbackDays:O,logger:e,onItems:e=>V(e)}),e.info(i.green(`Finished writing CSV to ${g}`));return}await l(k,{partition:m,filterBy:M,limit:C,logger:e,onItems:e=>V(e)}),e.info(i.green(`Finished writing CSV to ${g}`))}export{p as pullConsentPreferences};
2
+ //# sourceMappingURL=impl-CLznNZ5F.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DhXQb3bm.mjs","names":[],"sources":["../src/commands/consent/pull-consent-preferences/impl.ts"],"sourcesContent":["import type { PreferenceQueryResponseItem } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllIdentifiers,\n fetchAllPurposesAndPreferences,\n fetchConsentPreferences,\n fetchConsentPreferencesChunked,\n transformPreferenceRecordToCsv,\n type PreferenceIdentifier,\n} from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { initCsvFile, appendCsvRowsOrdered } from '../../../lib/helpers/index.js';\nimport { logger } from '../../../logger.js';\n\n// Known “core” columns your transformer usually produces up front.\n// Leave this list conservative; we’ll still union with transformer keys.\nconst CORE_COLS = [\n 'userId',\n 'timestamp',\n 'partition',\n 'decryptionStatus',\n 'updatedAt',\n 'usp',\n 'gpp',\n 'tcf',\n 'airgapVersion',\n 'metadata',\n 'metadataTimestamp',\n];\n\nexport interface PullConsentPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n file: string;\n transcendUrl: string;\n timestampBefore?: Date;\n exportIdentifiersWithDelimiter: string;\n timestampAfter?: Date;\n updatedBefore?: Date;\n updatedAfter?: Date;\n identifiers?: string[];\n concurrency: number;\n shouldChunk: boolean;\n windowConcurrency: number;\n maxChunks: number;\n maxLookbackDays: number;\n}\n\nexport async function pullConsentPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n file,\n transcendUrl,\n timestampBefore,\n timestampAfter,\n updatedBefore,\n updatedAfter,\n identifiers = [],\n concurrency,\n shouldChunk,\n windowConcurrency,\n maxChunks,\n exportIdentifiersWithDelimiter,\n maxLookbackDays,\n }: PullConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\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 const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Identifiers are key:value, parse to PreferenceIdentifier[]\n const parsedIdentifiers = identifiers.map((identifier): PreferenceIdentifier => {\n if (!identifier.includes(':')) {\n return {\n name: 'email',\n value: identifier,\n };\n }\n const [name, value] = identifier.split(':');\n return { name, value };\n });\n\n // Build filter\n const filterBy = {\n ...(timestampBefore ? { timestampBefore: timestampBefore.toISOString() } : {}),\n ...(timestampAfter ? { timestampAfter: timestampAfter.toISOString() } : {}),\n ...(updatedAfter || updatedBefore\n ? {\n system: {\n ...(updatedBefore ? { updatedBefore: updatedBefore.toISOString() } : {}),\n ...(updatedAfter ? { updatedAfter: updatedAfter.toISOString() } : {}),\n },\n }\n : {}),\n ...(parsedIdentifiers.length > 0 ? { identifiers: parsedIdentifiers } : {}),\n };\n\n logger.info(\n `Fetching consent preferences from partition ${partition}, using mode=${\n shouldChunk ? 'chunked-stream' : 'paged-stream'\n }...`,\n );\n\n logger.info(colors.magenta(`Preparing CSV at: ${file}`));\n\n // Fetch full sets (purposes+topics, identifiers) to ensure header completeness\n const [purposesWithTopics, allIdentifiers] = await Promise.all([\n fetchAllPurposesAndPreferences(client, { logger }),\n fetchAllIdentifiers(client, { logger }),\n ]);\n\n // Identifier columns: exactly the identifier names\n const identifierCols = allIdentifiers.map((i) => i.name);\n\n // Preference topic columns: topic names (de-duped)\n const topicCols = Array.from(\n new Set(\n purposesWithTopics.flatMap((p) => p.topics?.map((t) => `${p.trackingType}_${t.slug}`) ?? []),\n ),\n ).sort((a, b) => a.localeCompare(b));\n\n // Some setups also want a per-purpose boolean column (e.g., “Email”, “Sms”).\n // If your transformer includes those, list them here, derived from purposes:\n const purposeCols = Array.from(new Set(purposesWithTopics.map((p) => p.trackingType))).sort(\n (a, b) => a.localeCompare(b),\n );\n\n // Build the complete header skeleton.\n // We’ll still union with the first transformed row’s keys to be safe.\n const completeHeadersList = [...CORE_COLS, ...identifierCols, ...purposeCols, ...topicCols];\n\n // Lazily initialize CSV header order from the first transformed row.\n let headerOrder: string[] | null = null;\n let wroteHeader = false;\n const writeRows = (items: PreferenceQueryResponseItem[]): void => {\n if (!items || items.length === 0) return;\n const rows = items.map((row) =>\n transformPreferenceRecordToCsv(row, exportIdentifiersWithDelimiter),\n );\n if (!wroteHeader) {\n const firstKeys = Object.keys(rows[0] ?? {});\n const seen = new Set<string>();\n headerOrder = [...completeHeadersList, ...firstKeys].filter((k) => {\n if (k === undefined) return false;\n if (seen.has(k)) return false;\n seen.add(k);\n return true;\n });\n initCsvFile(file, headerOrder);\n wroteHeader = true;\n }\n appendCsvRowsOrdered(file, rows, headerOrder!);\n };\n\n if (shouldChunk) {\n // Stream via chunked fetcher with page callback\n await fetchConsentPreferencesChunked(sombra, {\n partition,\n filterBy,\n limit: concurrency,\n windowConcurrency,\n maxChunks,\n maxLookbackDays,\n logger,\n onItems: (items) => writeRows(items),\n });\n\n logger.info(colors.green(`Finished writing CSV to ${file}`));\n return;\n }\n\n // Non-chunked path: still stream page-by-page via onItems (no in-memory accumulation)\n await fetchConsentPreferences(sombra, {\n partition,\n filterBy,\n limit: concurrency, // page size (API max 50 enforced internally)\n logger,\n onItems: (items) => writeRows(items),\n });\n\n logger.info(colors.green(`Finished writing CSV to ${file}`));\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"impl-CLznNZ5F.mjs","names":[],"sources":["../src/commands/consent/pull-consent-preferences/impl.ts"],"sourcesContent":["import type { PreferenceQueryResponseItem } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllIdentifiers,\n fetchAllPurposesAndPreferences,\n fetchConsentPreferences,\n fetchConsentPreferencesChunked,\n transformPreferenceRecordToCsv,\n type PreferenceIdentifier,\n} from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { initCsvFile, appendCsvRowsOrdered } from '../../../lib/helpers/index.js';\nimport { logger } from '../../../logger.js';\n\n// Known “core” columns your transformer usually produces up front.\n// Leave this list conservative; we’ll still union with transformer keys.\nconst CORE_COLS = [\n 'userId',\n 'timestamp',\n 'partition',\n 'decryptionStatus',\n 'updatedAt',\n 'usp',\n 'gpp',\n 'tcf',\n 'airgapVersion',\n 'metadata',\n 'metadataTimestamp',\n];\n\nexport interface PullConsentPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n file: string;\n transcendUrl: string;\n timestampBefore?: Date;\n exportIdentifiersWithDelimiter: string;\n timestampAfter?: Date;\n updatedBefore?: Date;\n updatedAfter?: Date;\n identifiers?: string[];\n concurrency: number;\n shouldChunk: boolean;\n windowConcurrency: number;\n maxChunks: number;\n maxLookbackDays: number;\n}\n\nexport async function pullConsentPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n file,\n transcendUrl,\n timestampBefore,\n timestampAfter,\n updatedBefore,\n updatedAfter,\n identifiers = [],\n concurrency,\n shouldChunk,\n windowConcurrency,\n maxChunks,\n exportIdentifiersWithDelimiter,\n maxLookbackDays,\n }: PullConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\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 const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Identifiers are key:value, parse to PreferenceIdentifier[]\n const parsedIdentifiers = identifiers.map((identifier): PreferenceIdentifier => {\n if (!identifier.includes(':')) {\n return {\n name: 'email',\n value: identifier,\n };\n }\n const [name, value] = identifier.split(':');\n return { name, value };\n });\n\n // Build filter\n const filterBy = {\n ...(timestampBefore ? { timestampBefore: timestampBefore.toISOString() } : {}),\n ...(timestampAfter ? { timestampAfter: timestampAfter.toISOString() } : {}),\n ...(updatedAfter || updatedBefore\n ? {\n system: {\n ...(updatedBefore ? { updatedBefore: updatedBefore.toISOString() } : {}),\n ...(updatedAfter ? { updatedAfter: updatedAfter.toISOString() } : {}),\n },\n }\n : {}),\n ...(parsedIdentifiers.length > 0 ? { identifiers: parsedIdentifiers } : {}),\n };\n\n logger.info(\n `Fetching consent preferences from partition ${partition}, using mode=${\n shouldChunk ? 'chunked-stream' : 'paged-stream'\n }...`,\n );\n\n logger.info(colors.magenta(`Preparing CSV at: ${file}`));\n\n // Fetch full sets (purposes+topics, identifiers) to ensure header completeness\n const [purposesWithTopics, allIdentifiers] = await Promise.all([\n fetchAllPurposesAndPreferences(client, { logger }),\n fetchAllIdentifiers(client, { logger }),\n ]);\n\n // Identifier columns: exactly the identifier names\n const identifierCols = allIdentifiers.map((i) => i.name);\n\n // Preference topic columns: topic names (de-duped)\n const topicCols = Array.from(\n new Set(\n purposesWithTopics.flatMap((p) => p.topics?.map((t) => `${p.trackingType}_${t.slug}`) ?? []),\n ),\n ).sort((a, b) => a.localeCompare(b));\n\n // Some setups also want a per-purpose boolean column (e.g., “Email”, “Sms”).\n // If your transformer includes those, list them here, derived from purposes:\n const purposeCols = Array.from(new Set(purposesWithTopics.map((p) => p.trackingType))).sort(\n (a, b) => a.localeCompare(b),\n );\n\n // Build the complete header skeleton.\n // We’ll still union with the first transformed row’s keys to be safe.\n const completeHeadersList = [...CORE_COLS, ...identifierCols, ...purposeCols, ...topicCols];\n\n // Lazily initialize CSV header order from the first transformed row.\n let headerOrder: string[] | null = null;\n let wroteHeader = false;\n const writeRows = (items: PreferenceQueryResponseItem[]): void => {\n if (!items || items.length === 0) return;\n const rows = items.map((row) =>\n transformPreferenceRecordToCsv(row, exportIdentifiersWithDelimiter),\n );\n if (!wroteHeader) {\n const firstKeys = Object.keys(rows[0] ?? {});\n const seen = new Set<string>();\n headerOrder = [...completeHeadersList, ...firstKeys].filter((k) => {\n if (k === undefined) return false;\n if (seen.has(k)) return false;\n seen.add(k);\n return true;\n });\n initCsvFile(file, headerOrder);\n wroteHeader = true;\n }\n appendCsvRowsOrdered(file, rows, headerOrder!);\n };\n\n if (shouldChunk) {\n // Stream via chunked fetcher with page callback\n await fetchConsentPreferencesChunked(sombra, {\n partition,\n filterBy,\n limit: concurrency,\n windowConcurrency,\n maxChunks,\n maxLookbackDays,\n logger,\n onItems: (items) => writeRows(items),\n });\n\n logger.info(colors.green(`Finished writing CSV to ${file}`));\n return;\n }\n\n // Non-chunked path: still stream page-by-page via onItems (no in-memory accumulation)\n await fetchConsentPreferences(sombra, {\n partition,\n filterBy,\n limit: concurrency, // page size (API max 50 enforced internally)\n logger,\n onItems: (items) => writeRows(items),\n });\n\n logger.info(colors.green(`Finished writing CSV to ${file}`));\n}\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{r as e}from"./constants-XOsAW1__.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{r as n}from"./readTranscendYaml-DVkQL2SC.mjs";import{n as r,r as i,t as a}from"./parseVariablesFromString-CvoeZZ75.mjs";import{t as o}from"./validateTranscendAuth-DCwAtgvh.mjs";import{t as s}from"./listFiles-Odj7j2E1.mjs";import{t as c}from"./done-input-validation-C5rgR0Wr.mjs";import{existsSync as l,lstatSync as u}from"node:fs";import{join as d}from"node:path";import f from"colors";import{buildTranscendGraphQLClient as p}from"@transcend-io/sdk";import{mapSeries as m}from"@transcend-io/utils";async function h({transcendUrl:e,auth:n,pageSize:r,publishToPrivacyCenter:a,contents:o,deleteExtraAttributeValues:s=!1,classifyService:c=!1}){let l=p(e,n);try{return!await i(o,l,{pageSize:r,publishToPrivacyCenter:a,classifyService:c,deleteExtraAttributeValues:s})}catch(e){return t.error(f.red(`An unexpected error occurred syncing the schema: ${e.message}`)),!1}}async function g({file:i=`./transcend.yml`,transcendUrl:p,auth:g,variables:_,pageSize:v,publishToPrivacyCenter:y,classifyService:b,deleteExtraAttributeValues:x}){c(this.process.exit);let S=await o(g),C=a(_),w;if(w=Array.isArray(S)&&u(i).isDirectory()?s(i).map(e=>d(i,e)):i.split(`,`),w.length<1)throw Error(`No file specified!`);let T=w.map(e=>{l(e)?t.info(f.magenta(`Reading file "${e}"...`)):(t.error(f.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let r=n(e,C);return t.info(f.green(`Successfully read in "${e}"`)),{content:r,name:e.split(`/`).pop().replace(`.yml`,``)}}catch(e){t.error(f.red(`The shape of your yaml file is invalid with the following errors: ${e.message}`)),this.process.exit(1)}});if(typeof S==`string`){let[n,...i]=T.map(({content:e})=>e);await h({transcendUrl:p,auth:S,contents:r(n,...i),publishToPrivacyCenter:y,deleteExtraAttributeValues:x,pageSize:v,classifyService:!!b})||(t.info(f.red(`Sync encountered errors. View output above for more information, or check out ${e}`)),this.process.exit(1))}else{if(T.length!==1&&T.length!==S.length)throw Error(`Expected list of yml files to be equal to the list of API keys.Got ${T.length} YML file${T.length===1?``:`s`} and ${S.length} API key${S.length===1?``:`s`}`);let n=[];await m(S,async(e,r)=>{let i=`[${r+1}/${S.length}][${e.organizationName}] `;t.info(f.magenta(`~~~\n\n${i}Attempting to push configuration...\n\n~~~`));let a=T.length===1?T[0].content:T.find(t=>t.name===e.organizationName)?.content;if(!a){t.error(f.red(`${i}Failed to find transcend.yml file for organization: "${e.organizationName}".`)),n.push(e.organizationName);return}await h({transcendUrl:p,auth:e.apiKey,contents:a,pageSize:v,publishToPrivacyCenter:y,deleteExtraAttributeValues:x,classifyService:b})?t.info(f.green(`${i}Successfully pushed configuration!`)):(t.error(f.red(`${i}Failed to sync configuration.`)),n.push(e.organizationName))}),n.length>0&&(t.info(f.red(`Sync encountered errors for "${n.join(`,`)}". View output above for more information, or check out ${e}`)),this.process.exit(1))}t.info(f.green(`Successfully synced yaml file to Transcend! View at ${e}`))}export{g as push};
2
- //# sourceMappingURL=impl-DpwyYsfg.mjs.map
1
+ import{r as e}from"./constants-muOBBQA_.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{r as n}from"./readTranscendYaml-DVkQL2SC.mjs";import{n as r,r as i,t as a}from"./parseVariablesFromString-BeKOGw5n.mjs";import{t as o}from"./validateTranscendAuth-Cuh2Qfdl.mjs";import{t as s}from"./listFiles-D2wMHnEr.mjs";import{t as c}from"./done-input-validation-BcNBxhEs.mjs";import{existsSync as l,lstatSync as u}from"node:fs";import{join as d}from"node:path";import f from"colors";import{buildTranscendGraphQLClient as p}from"@transcend-io/sdk";import{mapSeries as m}from"@transcend-io/utils";async function h({transcendUrl:e,auth:n,pageSize:r,publishToPrivacyCenter:a,contents:o,deleteExtraAttributeValues:s=!1,classifyService:c=!1}){let l=p(e,n);try{return!await i(o,l,{pageSize:r,publishToPrivacyCenter:a,classifyService:c,deleteExtraAttributeValues:s})}catch(e){return t.error(f.red(`An unexpected error occurred syncing the schema: ${e.message}`)),!1}}async function g({file:i=`./transcend.yml`,transcendUrl:p,auth:g,variables:_,pageSize:v,publishToPrivacyCenter:y,classifyService:b,deleteExtraAttributeValues:x}){c(this.process.exit);let S=await o(g),C=a(_),w;if(w=Array.isArray(S)&&u(i).isDirectory()?s(i).map(e=>d(i,e)):i.split(`,`),w.length<1)throw Error(`No file specified!`);let T=w.map(e=>{l(e)?t.info(f.magenta(`Reading file "${e}"...`)):(t.error(f.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let r=n(e,C);return t.info(f.green(`Successfully read in "${e}"`)),{content:r,name:e.split(`/`).pop().replace(`.yml`,``)}}catch(e){t.error(f.red(`The shape of your yaml file is invalid with the following errors: ${e.message}`)),this.process.exit(1)}});if(typeof S==`string`){let[n,...i]=T.map(({content:e})=>e);await h({transcendUrl:p,auth:S,contents:r(n,...i),publishToPrivacyCenter:y,deleteExtraAttributeValues:x,pageSize:v,classifyService:!!b})||(t.info(f.red(`Sync encountered errors. View output above for more information, or check out ${e}`)),this.process.exit(1))}else{if(T.length!==1&&T.length!==S.length)throw Error(`Expected list of yml files to be equal to the list of API keys.Got ${T.length} YML file${T.length===1?``:`s`} and ${S.length} API key${S.length===1?``:`s`}`);let n=[];await m(S,async(e,r)=>{let i=`[${r+1}/${S.length}][${e.organizationName}] `;t.info(f.magenta(`~~~\n\n${i}Attempting to push configuration...\n\n~~~`));let a=T.length===1?T[0].content:T.find(t=>t.name===e.organizationName)?.content;if(!a){t.error(f.red(`${i}Failed to find transcend.yml file for organization: "${e.organizationName}".`)),n.push(e.organizationName);return}await h({transcendUrl:p,auth:e.apiKey,contents:a,pageSize:v,publishToPrivacyCenter:y,deleteExtraAttributeValues:x,classifyService:b})?t.info(f.green(`${i}Successfully pushed configuration!`)):(t.error(f.red(`${i}Failed to sync configuration.`)),n.push(e.organizationName))}),n.length>0&&(t.info(f.red(`Sync encountered errors for "${n.join(`,`)}". View output above for more information, or check out ${e}`)),this.process.exit(1))}t.info(f.green(`Successfully synced yaml file to Transcend! View at ${e}`))}export{g as push};
2
+ //# sourceMappingURL=impl-CUdo0Jyh.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DpwyYsfg.mjs","names":[],"sources":["../src/commands/inventory/push/impl.ts"],"sourcesContent":["import { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { TranscendInput } from '../../../codecs.js';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { syncConfigurationToTranscend } from '../../../lib/graphql/index.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs.js';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(contents, client, {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n });\n return !encounteredError;\n } catch (err) {\n logger.error(colors.red(`An unexpected error occurred syncing the schema: ${err.message}`));\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (transcendInputs.length !== 1 && transcendInputs.length !== apiKeyOrList.length) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${apiKeyOrList.length === 1 ? '' : 's'}`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n logger.info(colors.magenta(`~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`));\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find((input) => input.name === apiKey.organizationName)?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(colors.green(`${prefix}Successfully pushed configuration!`));\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.green(`Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`),\n );\n}\n"],"mappings":"2kBAwBA,eAAe,EAAkB,CAC/B,eACA,OACA,WACA,yBACA,WACA,6BAA6B,GAC7B,kBAAkB,IAgBC,CACnB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAG9D,GAAI,CAOF,MAAO,CANkB,MAAM,EAA6B,EAAU,EAAQ,CAC5E,WACA,yBACA,kBACA,6BACD,CAAC,OAEK,EAAK,CAEZ,OADA,EAAO,MAAM,EAAO,IAAI,oDAAoD,EAAI,UAAU,CAAC,CACpF,IAeX,eAAsB,EAEpB,CACE,OAAO,kBACP,eACA,OACA,YACA,WACA,yBACA,kBACA,8BAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAe,MAAM,EAAsB,EAAK,CAGhD,EAAO,EAAyB,EAAU,CAG5C,EAQJ,GAPA,AAGE,EAHE,MAAM,QAAQ,EAAa,EAAI,EAAU,EAAK,CAAC,aAAa,CACnD,EAAU,EAAK,CAAC,IAAK,GAAa,EAAK,EAAM,EAAS,CAAC,CAEvD,EAAK,MAAM,IAAI,CAIxB,EAAS,OAAS,EACpB,MAAU,MAAM,qBAAqB,CAIvC,IAAM,EAAkB,EAAS,IAAK,GAAa,CAE5C,EAAW,EAAS,CAQvB,EAAO,KAAK,EAAO,QAAQ,iBAAiB,EAAS,MAAM,CAAC,EAP5D,EAAO,MACL,EAAO,IACL,yCAAyC,EAAS,sEACnD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAKtB,GAAI,CAEF,IAAM,EAAc,EAAkB,EAAU,EAAK,CAErD,OADA,EAAO,KAAK,EAAO,MAAM,yBAAyB,EAAS,GAAG,CAAC,CACxD,CACL,QAAS,EACT,KAAM,EAAS,MAAM,IAAI,CAAC,KAAK,CAAE,QAAQ,OAAQ,GAAG,CACrD,OACM,EAAK,CACZ,EAAO,MACL,EAAO,IACL,qEAAqE,EAAI,UAC1E,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,GAEtB,CAGF,GAAI,OAAO,GAAiB,SAAU,CAEpC,GAAM,CAAC,EAAM,GAAG,GAAQ,EAAgB,KAAK,CAAE,aAAc,EAAQ,CAIrD,MAAM,EAAkB,CACtC,eACA,KAAM,EACN,SANe,EAAqB,EAAM,GAAG,EAAK,CAOlD,yBACA,6BACA,WACA,gBAAiB,CAAC,CAAC,EACpB,CAAC,GAIA,EAAO,KACL,EAAO,IACL,iFAAiF,IAClF,CACF,CAED,KAAK,QAAQ,KAAK,EAAE,MAEjB,CAEL,GAAI,EAAgB,SAAW,GAAK,EAAgB,SAAW,EAAa,OAC1E,MAAU,MACR,sEACS,EAAgB,OAAO,WAC5B,EAAgB,SAAW,EAAI,GAAK,IACrC,OAAO,EAAa,OAAO,UAAU,EAAa,SAAW,EAAI,GAAK,MAC1E,CAGH,IAAM,EAA8B,EAAE,CACtC,MAAM,EAAU,EAAc,MAAO,EAAQ,IAAQ,CACnD,IAAM,EAAS,IAAI,EAAM,EAAE,GAAG,EAAa,OAAO,IAAI,EAAO,iBAAiB,IAC9E,EAAO,KAAK,EAAO,QAAQ,UAAU,EAAO,4CAA4C,CAAC,CAGzF,IAAM,EACJ,EAAgB,SAAW,EACvB,EAAgB,GAAG,QACnB,EAAgB,KAAM,GAAU,EAAM,OAAS,EAAO,iBAAiB,EAAE,QAG/E,GAAI,CAAC,EAAa,CAChB,EAAO,MACL,EAAO,IACL,GAAG,EAAO,uDAAuD,EAAO,iBAAiB,IAC1F,CACF,CACD,EAAkB,KAAK,EAAO,iBAAiB,CAC/C,OAGc,MAAM,EAAkB,CACtC,eACA,KAAM,EAAO,OACb,SAAU,EACV,WACA,yBACA,6BACA,kBACD,CAAC,CAGA,EAAO,KAAK,EAAO,MAAM,GAAG,EAAO,oCAAoC,CAAC,EAExE,EAAO,MAAM,EAAO,IAAI,GAAG,EAAO,+BAA+B,CAAC,CAClE,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,EAAO,KACL,EAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0D,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE,EAKxB,EAAO,KACL,EAAO,MAAM,uDAAuD,IAA0B,CAC/F"}
1
+ {"version":3,"file":"impl-CUdo0Jyh.mjs","names":[],"sources":["../src/commands/inventory/push/impl.ts"],"sourcesContent":["import { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { TranscendInput } from '../../../codecs.js';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { syncConfigurationToTranscend } from '../../../lib/graphql/index.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs.js';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(contents, client, {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n });\n return !encounteredError;\n } catch (err) {\n logger.error(colors.red(`An unexpected error occurred syncing the schema: ${err.message}`));\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (transcendInputs.length !== 1 && transcendInputs.length !== apiKeyOrList.length) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${apiKeyOrList.length === 1 ? '' : 's'}`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n logger.info(colors.magenta(`~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`));\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find((input) => input.name === apiKey.organizationName)?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(colors.green(`${prefix}Successfully pushed configuration!`));\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.green(`Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`),\n );\n}\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./uploadDataFlowsFromCsv-D2V567pP.mjs";import{t}from"./done-input-validation-C5rgR0Wr.mjs";async function n({auth:n,trackerStatus:r,file:i,classifyService:a,transcendUrl:o}){t(this.process.exit),await e({auth:n,trackerStatus:r,file:i,classifyService:a,transcendUrl:o})}export{n as uploadDataFlowsFromCsv};
2
- //# sourceMappingURL=impl-CvJtt8H2.mjs.map
1
+ import{t as e}from"./uploadDataFlowsFromCsv-DUSFCae9.mjs";import{t}from"./done-input-validation-BcNBxhEs.mjs";async function n({auth:n,trackerStatus:r,file:i,classifyService:a,transcendUrl:o}){t(this.process.exit),await e({auth:n,trackerStatus:r,file:i,classifyService:a,transcendUrl:o})}export{n as uploadDataFlowsFromCsv};
2
+ //# sourceMappingURL=impl-Cmj1Vi5Q.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-CvJtt8H2.mjs","names":["uploadDataFlowsFromCsvHelper"],"sources":["../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager/index.js';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, classifyService, transcendUrl }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadDataFlowsFromCsvHelper({\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n });\n}\n"],"mappings":"8GAcA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,kBAAiB,gBAC/B,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAA6B,CACjC,OACA,gBACA,OACA,kBACA,eACD,CAAC"}
1
+ {"version":3,"file":"impl-Cmj1Vi5Q.mjs","names":["uploadDataFlowsFromCsvHelper"],"sources":["../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager/index.js';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, classifyService, transcendUrl }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadDataFlowsFromCsvHelper({\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n });\n}\n"],"mappings":"8GAcA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,kBAAiB,gBAC/B,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAA6B,CACjC,OACA,gBACA,OACA,kBACA,eACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{t}from"./pullUnstructuredSubDataPointRecommendations-jE-tdoVK.mjs";import{s as n}from"./writeCsv-Da8NUe1V.mjs";import{t as r}from"./done-input-validation-C5rgR0Wr.mjs";import{uniq as i}from"lodash-es";import a from"colors";import{buildTranscendGraphQLClient as o}from"@transcend-io/sdk";async function s({auth:s,file:c,transcendUrl:l,dataSiloIds:u,subCategories:d,status:f,includeEncryptedSnippets:p}){r(this.process.exit);try{let r=await t(o(l,s),{dataSiloIds:u,subCategories:d,status:f,includeEncryptedSnippets:p});e.info(a.magenta(`Writing unstructured discovery files to file "${c}"...`));let m=[];await n(c,r.map(e=>{let t={"Entry ID":e.id,"Data Silo ID":e.dataSiloId,"Object Path ID":e.scannedObjectPathId,"Object ID":e.scannedObjectId,...p?{Entry:e.name,"Context Snippet":e.contextSnippet}:{},"Data Category":`${e.dataSubCategory.category}:${e.dataSubCategory.name}`,"Classification Status":e.status,"Confidence Score":e.confidence,"Classification Method":e.classificationMethod,"Classifier Version":e.classifierVersion};return m=i([...m,...Object.keys(t)]),t}),m)}catch(t){e.error(a.red(`An error occurred syncing the unstructured discovery files: ${t.message}`)),this.process.exit(1)}e.info(a.green(`Successfully synced unstructured discovery files to disk at ${c}!`))}export{s as pullUnstructuredDiscoveryFiles};
2
- //# sourceMappingURL=impl-BVnfUDUm.mjs.map
1
+ import{t as e}from"./logger-Bj782ZYD.mjs";import{t}from"./pullUnstructuredSubDataPointRecommendations-D0z-vPgq.mjs";import{s as n}from"./writeCsv-C4pjXGsD.mjs";import{t as r}from"./done-input-validation-BcNBxhEs.mjs";import{uniq as i}from"lodash-es";import a from"colors";import{buildTranscendGraphQLClient as o}from"@transcend-io/sdk";async function s({auth:s,file:c,transcendUrl:l,dataSiloIds:u,subCategories:d,status:f,includeEncryptedSnippets:p}){r(this.process.exit);try{let r=await t(o(l,s),{dataSiloIds:u,subCategories:d,status:f,includeEncryptedSnippets:p});e.info(a.magenta(`Writing unstructured discovery files to file "${c}"...`));let m=[];await n(c,r.map(e=>{let t={"Entry ID":e.id,"Data Silo ID":e.dataSiloId,"Object Path ID":e.scannedObjectPathId,"Object ID":e.scannedObjectId,...p?{Entry:e.name,"Context Snippet":e.contextSnippet}:{},"Data Category":`${e.dataSubCategory.category}:${e.dataSubCategory.name}`,"Classification Status":e.status,"Confidence Score":e.confidence,"Classification Method":e.classificationMethod,"Classifier Version":e.classifierVersion};return m=i([...m,...Object.keys(t)]),t}),m)}catch(t){e.error(a.red(`An error occurred syncing the unstructured discovery files: ${t.message}`)),this.process.exit(1)}e.info(a.green(`Successfully synced unstructured discovery files to disk at ${c}!`))}export{s as pullUnstructuredDiscoveryFiles};
2
+ //# sourceMappingURL=impl-Cw3_0zqC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BVnfUDUm.mjs","names":[],"sources":["../src/commands/inventory/pull-unstructured-discovery-files/impl.ts"],"sourcesContent":["import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { uniq } from 'lodash-es';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullUnstructuredSubDataPointRecommendations } from '../../../lib/data-inventory/index.js';\nimport { writeLargeCsv } from '../../../lib/helpers/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface PullUnstructuredDiscoveryFilesCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n subCategories?: string[];\n status?: UnstructuredSubDataPointRecommendationStatus[];\n includeEncryptedSnippets: boolean;\n}\n\nexport async function pullUnstructuredDiscoveryFiles(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n subCategories,\n status,\n includeEncryptedSnippets,\n }: PullUnstructuredDiscoveryFilesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const entries = await pullUnstructuredSubDataPointRecommendations(client, {\n dataSiloIds,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n status,\n includeEncryptedSnippets,\n });\n\n logger.info(colors.magenta(`Writing unstructured discovery files to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = entries.map((entry) => {\n const result = {\n 'Entry ID': entry.id,\n 'Data Silo ID': entry.dataSiloId,\n 'Object Path ID': entry.scannedObjectPathId,\n 'Object ID': entry.scannedObjectId,\n ...(includeEncryptedSnippets\n ? { Entry: entry.name, 'Context Snippet': entry.contextSnippet }\n : {}),\n 'Data Category': `${entry.dataSubCategory.category}:${entry.dataSubCategory.name}`,\n 'Classification Status': entry.status,\n 'Confidence Score': entry.confidence,\n 'Classification Method': entry.classificationMethod,\n 'Classifier Version': entry.classifierVersion,\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the unstructured discovery files: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(colors.green(`Successfully synced unstructured discovery files to disk at ${file}!`));\n}\n"],"mappings":"gVAqBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,gBACA,SACA,4BAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAI,CAIF,IAAM,EAAU,MAAM,EAFP,EAA4B,EAAc,EAAK,CAEY,CACxE,cACA,gBACA,SACA,2BACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,iDAAiD,EAAK,MAAM,CAAC,CACxF,IAAI,EAAoB,EAAE,CAmB1B,MAAM,EAAc,EAlBL,EAAQ,IAAK,GAAU,CACpC,IAAM,EAAS,CACb,WAAY,EAAM,GAClB,eAAgB,EAAM,WACtB,iBAAkB,EAAM,oBACxB,YAAa,EAAM,gBACnB,GAAI,EACA,CAAE,MAAO,EAAM,KAAM,kBAAmB,EAAM,eAAgB,CAC9D,EAAE,CACN,gBAAiB,GAAG,EAAM,gBAAgB,SAAS,GAAG,EAAM,gBAAgB,OAC5E,wBAAyB,EAAM,OAC/B,mBAAoB,EAAM,WAC1B,wBAAyB,EAAM,qBAC/B,qBAAsB,EAAM,kBAC7B,CAED,MADA,GAAU,EAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GACP,CACgC,EAAQ,OACnC,EAAK,CACZ,EAAO,MACL,EAAO,IAAI,+DAA+D,EAAI,UAAU,CACzF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAO,KAAK,EAAO,MAAM,+DAA+D,EAAK,GAAG,CAAC"}
1
+ {"version":3,"file":"impl-Cw3_0zqC.mjs","names":[],"sources":["../src/commands/inventory/pull-unstructured-discovery-files/impl.ts"],"sourcesContent":["import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { uniq } from 'lodash-es';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullUnstructuredSubDataPointRecommendations } from '../../../lib/data-inventory/index.js';\nimport { writeLargeCsv } from '../../../lib/helpers/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface PullUnstructuredDiscoveryFilesCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n subCategories?: string[];\n status?: UnstructuredSubDataPointRecommendationStatus[];\n includeEncryptedSnippets: boolean;\n}\n\nexport async function pullUnstructuredDiscoveryFiles(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n subCategories,\n status,\n includeEncryptedSnippets,\n }: PullUnstructuredDiscoveryFilesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const entries = await pullUnstructuredSubDataPointRecommendations(client, {\n dataSiloIds,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n status,\n includeEncryptedSnippets,\n });\n\n logger.info(colors.magenta(`Writing unstructured discovery files to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = entries.map((entry) => {\n const result = {\n 'Entry ID': entry.id,\n 'Data Silo ID': entry.dataSiloId,\n 'Object Path ID': entry.scannedObjectPathId,\n 'Object ID': entry.scannedObjectId,\n ...(includeEncryptedSnippets\n ? { Entry: entry.name, 'Context Snippet': entry.contextSnippet }\n : {}),\n 'Data Category': `${entry.dataSubCategory.category}:${entry.dataSubCategory.name}`,\n 'Classification Status': entry.status,\n 'Confidence Score': entry.confidence,\n 'Classification Method': entry.classificationMethod,\n 'Classifier Version': entry.classifierVersion,\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the unstructured discovery files: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(colors.green(`Successfully synced unstructured discovery files to disk at ${file}!`));\n}\n"],"mappings":"gVAqBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,gBACA,SACA,4BAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAI,CAIF,IAAM,EAAU,MAAM,EAFP,EAA4B,EAAc,EAAK,CAEY,CACxE,cACA,gBACA,SACA,2BACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,iDAAiD,EAAK,MAAM,CAAC,CACxF,IAAI,EAAoB,EAAE,CAmB1B,MAAM,EAAc,EAlBL,EAAQ,IAAK,GAAU,CACpC,IAAM,EAAS,CACb,WAAY,EAAM,GAClB,eAAgB,EAAM,WACtB,iBAAkB,EAAM,oBACxB,YAAa,EAAM,gBACnB,GAAI,EACA,CAAE,MAAO,EAAM,KAAM,kBAAmB,EAAM,eAAgB,CAC9D,EAAE,CACN,gBAAiB,GAAG,EAAM,gBAAgB,SAAS,GAAG,EAAM,gBAAgB,OAC5E,wBAAyB,EAAM,OAC/B,mBAAoB,EAAM,WAC1B,wBAAyB,EAAM,qBAC/B,qBAAsB,EAAM,kBAC7B,CAED,MADA,GAAU,EAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GACP,CACgC,EAAQ,OACnC,EAAK,CACZ,EAAO,MACL,EAAO,IAAI,+DAA+D,EAAI,UAAU,CACzF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAO,KAAK,EAAO,MAAM,+DAA+D,EAAK,GAAG,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{E as t}from"./codecs-CeDPaLYa.mjs";import{a as n}from"./readTranscendYaml-DVkQL2SC.mjs";import{t as r}from"./done-input-validation-C5rgR0Wr.mjs";import{ConsentTrackerStatus as i,DataFlowScope as a}from"@transcend-io/privacy-types";import{decodeCodec as o}from"@transcend-io/type-utils";import{existsSync as s,readFileSync as c}from"node:fs";import l from"colors";import*as u from"io-ts";function d({file:d,output:f}){r(this.process.exit),s(d)||(e.error(l.red(`File does not exist: --file="${d}"`)),this.process.exit(1));let p=o(u.array(t),c(d,`utf-8`)),m=[],h=[];p.forEach(e=>{e.dataFlows.filter(({type:e})=>e!==a.CSP).forEach(e=>{m.push({value:e.value,type:e.type,status:i.Live,trackingPurposes:e.trackingPurposes})}),e.cookies.forEach(e=>{h.push({name:e.name,status:i.Live,trackingPurposes:e.trackingPurposes})})}),n(f,{"data-flows":m,cookies:h}),e.info(l.green(`Successfully wrote ${m.length} data flows and ${h.length} cookies to file "${f}"`))}export{d as consentManagerServiceJsonToYml};
2
- //# sourceMappingURL=impl-DaK9UOwL.mjs.map
1
+ import{t as e}from"./logger-Bj782ZYD.mjs";import{E as t}from"./codecs-CeDPaLYa.mjs";import{a as n}from"./readTranscendYaml-DVkQL2SC.mjs";import{t as r}from"./done-input-validation-BcNBxhEs.mjs";import{ConsentTrackerStatus as i,DataFlowScope as a}from"@transcend-io/privacy-types";import{decodeCodec as o}from"@transcend-io/type-utils";import{existsSync as s,readFileSync as c}from"node:fs";import l from"colors";import*as u from"io-ts";function d({file:d,output:f}){r(this.process.exit),s(d)||(e.error(l.red(`File does not exist: --file="${d}"`)),this.process.exit(1));let p=o(u.array(t),c(d,`utf-8`)),m=[],h=[];p.forEach(e=>{e.dataFlows.filter(({type:e})=>e!==a.CSP).forEach(e=>{m.push({value:e.value,type:e.type,status:i.Live,trackingPurposes:e.trackingPurposes})}),e.cookies.forEach(e=>{h.push({name:e.name,status:i.Live,trackingPurposes:e.trackingPurposes})})}),n(f,{"data-flows":m,cookies:h}),e.info(l.green(`Successfully wrote ${m.length} data flows and ${h.length} cookies to file "${f}"`))}export{d as consentManagerServiceJsonToYml};
2
+ //# sourceMappingURL=impl-CzvCA0Ev.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DaK9UOwL.mjs","names":[],"sources":["../src/commands/inventory/consent-manager-service-json-to-yml/impl.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\n\nimport { ConsentTrackerStatus, DataFlowScope } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport colors from 'colors';\nimport * as t from 'io-ts';\n\nimport { ConsentManagerServiceMetadata, CookieInput, DataFlowInput } from '../../../codecs.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { writeTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\n\nexport interface ConsentManagerServiceJsonToYmlCommandFlags {\n file: string;\n output: string;\n}\n\nexport function consentManagerServiceJsonToYml(\n this: LocalContext,\n { file, output }: ConsentManagerServiceJsonToYmlCommandFlags,\n): void {\n doneInputValidation(this.process.exit);\n\n // Ensure files exist\n if (!existsSync(file)) {\n logger.error(colors.red(`File does not exist: --file=\"${file}\"`));\n this.process.exit(1);\n }\n\n // Read in each consent manager configuration\n const services = decodeCodec(t.array(ConsentManagerServiceMetadata), readFileSync(file, 'utf-8'));\n\n // Create data flows and cookie configurations\n const dataFlows: DataFlowInput[] = [];\n const cookies: CookieInput[] = [];\n services.forEach((service) => {\n service.dataFlows\n .filter(({ type }) => type !== DataFlowScope.CSP)\n .forEach((dataFlow) => {\n dataFlows.push({\n value: dataFlow.value,\n type: dataFlow.type,\n status: ConsentTrackerStatus.Live,\n trackingPurposes: dataFlow.trackingPurposes,\n });\n });\n\n service.cookies.forEach((cookie) => {\n cookies.push({\n name: cookie.name,\n status: ConsentTrackerStatus.Live,\n trackingPurposes: cookie.trackingPurposes,\n });\n });\n });\n\n // write to disk\n writeTranscendYaml(output, {\n 'data-flows': dataFlows,\n cookies,\n });\n\n logger.info(\n colors.green(\n `Successfully wrote ${dataFlows.length} data flows and ${cookies.length} cookies to file \"${output}\"`,\n ),\n );\n}\n"],"mappings":"obAkBA,SAAgB,EAEd,CAAE,OAAM,UACF,CACN,EAAoB,KAAK,QAAQ,KAAK,CAGjC,EAAW,EAAK,GACnB,EAAO,MAAM,EAAO,IAAI,gCAAgC,EAAK,GAAG,CAAC,CACjE,KAAK,QAAQ,KAAK,EAAE,EAItB,IAAM,EAAW,EAAY,EAAE,MAAM,EAA8B,CAAE,EAAa,EAAM,QAAQ,CAAC,CAG3F,EAA6B,EAAE,CAC/B,EAAyB,EAAE,CACjC,EAAS,QAAS,GAAY,CAC5B,EAAQ,UACL,QAAQ,CAAE,UAAW,IAAS,EAAc,IAAI,CAChD,QAAS,GAAa,CACrB,EAAU,KAAK,CACb,MAAO,EAAS,MAChB,KAAM,EAAS,KACf,OAAQ,EAAqB,KAC7B,iBAAkB,EAAS,iBAC5B,CAAC,EACF,CAEJ,EAAQ,QAAQ,QAAS,GAAW,CAClC,EAAQ,KAAK,CACX,KAAM,EAAO,KACb,OAAQ,EAAqB,KAC7B,iBAAkB,EAAO,iBAC1B,CAAC,EACF,EACF,CAGF,EAAmB,EAAQ,CACzB,aAAc,EACd,UACD,CAAC,CAEF,EAAO,KACL,EAAO,MACL,sBAAsB,EAAU,OAAO,kBAAkB,EAAQ,OAAO,oBAAoB,EAAO,GACpG,CACF"}
1
+ {"version":3,"file":"impl-CzvCA0Ev.mjs","names":[],"sources":["../src/commands/inventory/consent-manager-service-json-to-yml/impl.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\n\nimport { ConsentTrackerStatus, DataFlowScope } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport colors from 'colors';\nimport * as t from 'io-ts';\n\nimport { ConsentManagerServiceMetadata, CookieInput, DataFlowInput } from '../../../codecs.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { writeTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\n\nexport interface ConsentManagerServiceJsonToYmlCommandFlags {\n file: string;\n output: string;\n}\n\nexport function consentManagerServiceJsonToYml(\n this: LocalContext,\n { file, output }: ConsentManagerServiceJsonToYmlCommandFlags,\n): void {\n doneInputValidation(this.process.exit);\n\n // Ensure files exist\n if (!existsSync(file)) {\n logger.error(colors.red(`File does not exist: --file=\"${file}\"`));\n this.process.exit(1);\n }\n\n // Read in each consent manager configuration\n const services = decodeCodec(t.array(ConsentManagerServiceMetadata), readFileSync(file, 'utf-8'));\n\n // Create data flows and cookie configurations\n const dataFlows: DataFlowInput[] = [];\n const cookies: CookieInput[] = [];\n services.forEach((service) => {\n service.dataFlows\n .filter(({ type }) => type !== DataFlowScope.CSP)\n .forEach((dataFlow) => {\n dataFlows.push({\n value: dataFlow.value,\n type: dataFlow.type,\n status: ConsentTrackerStatus.Live,\n trackingPurposes: dataFlow.trackingPurposes,\n });\n });\n\n service.cookies.forEach((cookie) => {\n cookies.push({\n name: cookie.name,\n status: ConsentTrackerStatus.Live,\n trackingPurposes: cookie.trackingPurposes,\n });\n });\n });\n\n // write to disk\n writeTranscendYaml(output, {\n 'data-flows': dataFlows,\n cookies,\n });\n\n logger.info(\n colors.green(\n `Successfully wrote ${dataFlows.length} data flows and ${cookies.length} cookies to file \"${output}\"`,\n ),\n );\n}\n"],"mappings":"obAkBA,SAAgB,EAEd,CAAE,OAAM,UACF,CACN,EAAoB,KAAK,QAAQ,KAAK,CAGjC,EAAW,EAAK,GACnB,EAAO,MAAM,EAAO,IAAI,gCAAgC,EAAK,GAAG,CAAC,CACjE,KAAK,QAAQ,KAAK,EAAE,EAItB,IAAM,EAAW,EAAY,EAAE,MAAM,EAA8B,CAAE,EAAa,EAAM,QAAQ,CAAC,CAG3F,EAA6B,EAAE,CAC/B,EAAyB,EAAE,CACjC,EAAS,QAAS,GAAY,CAC5B,EAAQ,UACL,QAAQ,CAAE,UAAW,IAAS,EAAc,IAAI,CAChD,QAAS,GAAa,CACrB,EAAU,KAAK,CACb,MAAO,EAAS,MAChB,KAAM,EAAS,KACf,OAAQ,EAAqB,KAC7B,iBAAkB,EAAS,iBAC5B,CAAC,EACF,CAEJ,EAAQ,QAAQ,QAAS,GAAW,CAClC,EAAQ,KAAK,CACX,KAAM,EAAO,KACb,OAAQ,EAAqB,KAC7B,iBAAkB,EAAO,iBAC1B,CAAC,EACF,EACF,CAGF,EAAmB,EAAQ,CACzB,aAAc,EACd,UACD,CAAC,CAEF,EAAO,KACL,EAAO,MACL,sBAAsB,EAAU,OAAO,kBAAkB,EAAQ,OAAO,oBAAoB,EAAO,GACpG,CACF"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./pullManualEnrichmentIdentifiersToCsv-BNuhsG20.mjs";import{t}from"./done-input-validation-C5rgR0Wr.mjs";async function n({auth:n,transcendUrl:r,file:i,concurrency:a,actions:o,sombraAuth:s}){t(this.process.exit),await e({file:i,transcendUrl:r,concurrency:a,requestActions:o,auth:n,sombraAuth:s})}export{n as pullIdentifiers};
2
- //# sourceMappingURL=impl-BffzTHKU.mjs.map
1
+ import{t as e}from"./pullManualEnrichmentIdentifiersToCsv-kpGy9H7T.mjs";import{t}from"./done-input-validation-BcNBxhEs.mjs";async function n({auth:n,transcendUrl:r,file:i,concurrency:a,actions:o,sombraAuth:s}){t(this.process.exit),await e({file:i,transcendUrl:r,concurrency:a,requestActions:o,auth:n,sombraAuth:s})}export{n as pullIdentifiers};
2
+ //# sourceMappingURL=impl-D1DmW5-P.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BffzTHKU.mjs","names":[],"sources":["../src/commands/request/preflight/pull-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 { pullManualEnrichmentIdentifiersToCsv } from '../../../../lib/manual-enrichment/index.js';\n\nexport interface PullIdentifiersCommandFlags {\n auth: string;\n sombraAuth?: string;\n transcendUrl: string;\n file: string;\n actions?: RequestAction[];\n concurrency: number;\n}\n\nexport async function pullIdentifiers(\n this: LocalContext,\n { auth, transcendUrl, file, concurrency, actions, sombraAuth }: PullIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await pullManualEnrichmentIdentifiersToCsv({\n file,\n transcendUrl,\n concurrency,\n requestActions: actions,\n auth,\n sombraAuth,\n });\n}\n"],"mappings":"4HAeA,eAAsB,EAEpB,CAAE,OAAM,eAAc,OAAM,cAAa,UAAS,cACnC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAqC,CACzC,OACA,eACA,cACA,eAAgB,EAChB,OACA,aACD,CAAC"}
1
+ {"version":3,"file":"impl-D1DmW5-P.mjs","names":[],"sources":["../src/commands/request/preflight/pull-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 { pullManualEnrichmentIdentifiersToCsv } from '../../../../lib/manual-enrichment/index.js';\n\nexport interface PullIdentifiersCommandFlags {\n auth: string;\n sombraAuth?: string;\n transcendUrl: string;\n file: string;\n actions?: RequestAction[];\n concurrency: number;\n}\n\nexport async function pullIdentifiers(\n this: LocalContext,\n { auth, transcendUrl, file, concurrency, actions, sombraAuth }: PullIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await pullManualEnrichmentIdentifiersToCsv({\n file,\n transcendUrl,\n concurrency,\n requestActions: actions,\n auth,\n sombraAuth,\n });\n}\n"],"mappings":"4HAeA,eAAsB,EAEpB,CAAE,OAAM,eAAc,OAAM,cAAa,UAAS,cACnC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAqC,CACzC,OACA,eACA,cACA,eAAgB,EAChB,OACA,aACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./pushManualEnrichmentIdentifiersFromCsv-BiR7PS_d.mjs";import{t}from"./done-input-validation-C5rgR0Wr.mjs";async function n({auth:n,transcendUrl:r,file:i,enricherId:a,concurrency:o,markSilent:s,sombraAuth:c}){t(this.process.exit),await e({file:i,transcendUrl:r,enricherId:a,concurrency:o,markSilent:s,auth:n,sombraAuth:c})}export{n as pushIdentifiers};
2
- //# sourceMappingURL=impl-Cy8-6_Oo2.mjs.map
1
+ import{t as e}from"./pushManualEnrichmentIdentifiersFromCsv-DXqf8WWy.mjs";import{t}from"./done-input-validation-BcNBxhEs.mjs";async function n({auth:n,transcendUrl:r,file:i,enricherId:a,concurrency:o,markSilent:s,sombraAuth:c}){t(this.process.exit),await e({file:i,transcendUrl:r,enricherId:a,concurrency:o,markSilent:s,auth:n,sombraAuth:c})}export{n as pushIdentifiers};
2
+ //# sourceMappingURL=impl-D41c_KGj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-D41c_KGj.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"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./skipPreflightJobs-CYuoMG3z.mjs";import{t}from"./done-input-validation-BcNBxhEs.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-DEpCg7UP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-DEpCg7UP.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 +1,2 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{n as t}from"./buildXdiSyncEndpoint-DWs9ImOw.mjs";import{t as n}from"./validateTranscendAuth-DCwAtgvh.mjs";import{t as r}from"./done-input-validation-C5rgR0Wr.mjs";import{writeFileSync as i}from"node:fs";import a from"colors";async function o({auth:o,xdiLocation:s,file:c,removeIpAddresses:l,domainBlockList:u,xdiAllowedCommands:d,transcendUrl:f}){r(this.process.exit);let{syncGroups:p,html:m}=await t(await n(o),{xdiLocation:s,transcendUrl:f,removeIpAddresses:l,domainBlockList:u.length>0?u:void 0,xdiAllowedCommands:d});e.info(a.green(`Successfully constructed sync endpoint for sync groups: ${JSON.stringify(p,null,2)}`)),i(c,m),e.info(a.green(`Wrote configuration to file "${c}"!`))}export{o as buildXdiSyncEndpoint};
2
- //# sourceMappingURL=impl-BSKl6rC6.mjs.map
1
+ import{t as e}from"./logger-Bj782ZYD.mjs";import{n as t}from"./buildXdiSyncEndpoint-CBbcir-p.mjs";import{t as n}from"./validateTranscendAuth-Cuh2Qfdl.mjs";import{t as r}from"./done-input-validation-BcNBxhEs.mjs";import{writeFileSync as i}from"node:fs";import a from"colors";async function o({auth:o,xdiLocation:s,file:c,removeIpAddresses:l,domainBlockList:u,xdiAllowedCommands:d,transcendUrl:f}){r(this.process.exit);let{syncGroups:p,html:m}=await t(await n(o),{xdiLocation:s,transcendUrl:f,removeIpAddresses:l,domainBlockList:u.length>0?u:void 0,xdiAllowedCommands:d});e.info(a.green(`Successfully constructed sync endpoint for sync groups: ${JSON.stringify(p,null,2)}`)),i(c,m),e.info(a.green(`Wrote configuration to file "${c}"!`))}export{o as buildXdiSyncEndpoint};
2
+ //# sourceMappingURL=impl-DHOh4ypd.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BSKl6rC6.mjs","names":["buildXdiSyncEndpointHelper"],"sources":["../src/commands/consent/build-xdi-sync-endpoint/impl.ts"],"sourcesContent":["import { writeFileSync } from 'node:fs';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { buildXdiSyncEndpoint as buildXdiSyncEndpointHelper } from '../../../lib/consent-manager/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface BuildXdiSyncEndpointCommandFlags {\n auth: string;\n xdiLocation: string;\n file: string;\n removeIpAddresses: boolean;\n domainBlockList: string[];\n xdiAllowedCommands: string;\n transcendUrl: string;\n}\n\nexport async function buildXdiSyncEndpoint(\n this: LocalContext,\n {\n auth,\n xdiLocation,\n file,\n removeIpAddresses,\n domainBlockList,\n xdiAllowedCommands,\n transcendUrl,\n }: BuildXdiSyncEndpointCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Build the sync endpoint\n const { syncGroups, html } = await buildXdiSyncEndpointHelper(apiKeyOrList, {\n xdiLocation,\n transcendUrl,\n removeIpAddresses,\n domainBlockList: domainBlockList.length > 0 ? domainBlockList : undefined,\n xdiAllowedCommands,\n });\n\n // Log success\n logger.info(\n colors.green(\n `Successfully constructed sync endpoint for sync groups: ${JSON.stringify(\n syncGroups,\n null,\n 2,\n )}`,\n ),\n );\n\n // Write to disk\n writeFileSync(file, html);\n logger.info(colors.green(`Wrote configuration to file \"${file}\"!`));\n}\n"],"mappings":"kRAoBA,eAAsB,EAEpB,CACE,OACA,cACA,OACA,oBACA,kBACA,qBACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAMtC,GAAM,CAAE,aAAY,QAAS,MAAMA,EAHd,MAAM,EAAsB,EAAK,CAGsB,CAC1E,cACA,eACA,oBACA,gBAAiB,EAAgB,OAAS,EAAI,EAAkB,IAAA,GAChE,qBACD,CAAC,CAGF,EAAO,KACL,EAAO,MACL,2DAA2D,KAAK,UAC9D,EACA,KACA,EACD,GACF,CACF,CAGD,EAAc,EAAM,EAAK,CACzB,EAAO,KAAK,EAAO,MAAM,gCAAgC,EAAK,IAAI,CAAC"}
1
+ {"version":3,"file":"impl-DHOh4ypd.mjs","names":["buildXdiSyncEndpointHelper"],"sources":["../src/commands/consent/build-xdi-sync-endpoint/impl.ts"],"sourcesContent":["import { writeFileSync } from 'node:fs';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { buildXdiSyncEndpoint as buildXdiSyncEndpointHelper } from '../../../lib/consent-manager/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface BuildXdiSyncEndpointCommandFlags {\n auth: string;\n xdiLocation: string;\n file: string;\n removeIpAddresses: boolean;\n domainBlockList: string[];\n xdiAllowedCommands: string;\n transcendUrl: string;\n}\n\nexport async function buildXdiSyncEndpoint(\n this: LocalContext,\n {\n auth,\n xdiLocation,\n file,\n removeIpAddresses,\n domainBlockList,\n xdiAllowedCommands,\n transcendUrl,\n }: BuildXdiSyncEndpointCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Build the sync endpoint\n const { syncGroups, html } = await buildXdiSyncEndpointHelper(apiKeyOrList, {\n xdiLocation,\n transcendUrl,\n removeIpAddresses,\n domainBlockList: domainBlockList.length > 0 ? domainBlockList : undefined,\n xdiAllowedCommands,\n });\n\n // Log success\n logger.info(\n colors.green(\n `Successfully constructed sync endpoint for sync groups: ${JSON.stringify(\n syncGroups,\n null,\n 2,\n )}`,\n ),\n );\n\n // Write to disk\n writeFileSync(file, html);\n logger.info(colors.green(`Wrote configuration to file \"${file}\"!`));\n}\n"],"mappings":"kRAoBA,eAAsB,EAEpB,CACE,OACA,cACA,OACA,oBACA,kBACA,qBACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAMtC,GAAM,CAAE,aAAY,QAAS,MAAMA,EAHd,MAAM,EAAsB,EAAK,CAGsB,CAC1E,cACA,eACA,oBACA,gBAAiB,EAAgB,OAAS,EAAI,EAAkB,IAAA,GAChE,qBACD,CAAC,CAGF,EAAO,KACL,EAAO,MACL,2DAA2D,KAAK,UAC9D,EACA,KACA,EACD,GACF,CACF,CAGD,EAAc,EAAM,EAAK,CACzB,EAAO,KAAK,EAAO,MAAM,gCAAgC,EAAK,IAAI,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./bulkRetryEnrichers-C1RrxiTR.mjs";import{t}from"./done-input-validation-C5rgR0Wr.mjs";async function n({auth:n,enricherId:r,actions:i,requestEnricherStatuses:a,requestIds:o,createdAtBefore:s,createdAtAfter:c,updatedAtBefore:l,updatedAtAfter:u,concurrency:d,transcendUrl:f}){t(this.process.exit),await e({auth:n,enricherId:r,requestActions:i,requestEnricherStatuses:a,requestIds:o,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0,updatedAtBefore:l?new Date(l):void 0,updatedAtAfter:u?new Date(u):void 0,concurrency:d,transcendUrl:f})}export{n as enricherRestart};
2
- //# sourceMappingURL=impl-StdJMCiM.mjs.map
1
+ import{t as e}from"./bulkRetryEnrichers-DuYXD-64.mjs";import{t}from"./done-input-validation-BcNBxhEs.mjs";async function n({auth:n,enricherId:r,actions:i,requestEnricherStatuses:a,requestIds:o,createdAtBefore:s,createdAtAfter:c,updatedAtBefore:l,updatedAtAfter:u,concurrency:d,transcendUrl:f}){t(this.process.exit),await e({auth:n,enricherId:r,requestActions:i,requestEnricherStatuses:a,requestIds:o,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0,updatedAtBefore:l?new Date(l):void 0,updatedAtAfter:u?new Date(u):void 0,concurrency:d,transcendUrl:f})}export{n as enricherRestart};
2
+ //# sourceMappingURL=impl-DJg0Ibxs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-StdJMCiM.mjs","names":[],"sources":["../src/commands/request/enricher-restart/impl.ts"],"sourcesContent":["import type { RequestAction, RequestEnricherStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { bulkRetryEnrichers } from '../../../lib/requests/index.js';\n\nexport interface EnricherRestartCommandFlags {\n auth: string;\n enricherId: string;\n actions?: RequestAction[];\n requestEnricherStatuses?: RequestEnricherStatus[];\n transcendUrl: string;\n concurrency: number;\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n}\n\nexport async function enricherRestart(\n this: LocalContext,\n {\n auth,\n enricherId,\n actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n concurrency,\n transcendUrl,\n }: EnricherRestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRetryEnrichers({\n auth,\n enricherId,\n requestActions: actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n updatedAtBefore: updatedAtBefore ? new Date(updatedAtBefore) : undefined,\n updatedAtAfter: updatedAtAfter ? new Date(updatedAtAfter) : undefined,\n concurrency,\n transcendUrl,\n });\n}\n"],"mappings":"0GAoBA,eAAsB,EAEpB,CACE,OACA,aACA,UACA,0BACA,aACA,kBACA,iBACA,kBACA,iBACA,cACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAmB,CACvB,OACA,aACA,eAAgB,EAChB,0BACA,aACA,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,cACA,eACD,CAAC"}
1
+ {"version":3,"file":"impl-DJg0Ibxs.mjs","names":[],"sources":["../src/commands/request/enricher-restart/impl.ts"],"sourcesContent":["import type { RequestAction, RequestEnricherStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { bulkRetryEnrichers } from '../../../lib/requests/index.js';\n\nexport interface EnricherRestartCommandFlags {\n auth: string;\n enricherId: string;\n actions?: RequestAction[];\n requestEnricherStatuses?: RequestEnricherStatus[];\n transcendUrl: string;\n concurrency: number;\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n}\n\nexport async function enricherRestart(\n this: LocalContext,\n {\n auth,\n enricherId,\n actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n concurrency,\n transcendUrl,\n }: EnricherRestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRetryEnrichers({\n auth,\n enricherId,\n requestActions: actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n updatedAtBefore: updatedAtBefore ? new Date(updatedAtBefore) : undefined,\n updatedAtAfter: updatedAtAfter ? new Date(updatedAtAfter) : undefined,\n concurrency,\n transcendUrl,\n });\n}\n"],"mappings":"0GAoBA,eAAsB,EAEpB,CACE,OACA,aACA,UACA,0BACA,aACA,kBACA,iBACA,kBACA,iBACA,cACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAmB,CACvB,OACA,aACA,eAAgB,EAChB,0BACA,aACA,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,cACA,eACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{n as e}from"./constants-XOsAW1__.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{s as n}from"./writeCsv-Da8NUe1V.mjs";import{t as r}from"./pullAllDatapoints-CqgqXRbp.mjs";import{t as i}from"./done-input-validation-C5rgR0Wr.mjs";import{groupBy as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c}from"@transcend-io/sdk";async function l({auth:l,file:u,transcendUrl:d,dataSiloIds:f,includeAttributes:p,includeGuessedCategories:m,parentCategories:h,subCategories:g=[]}){i(this.process.exit);try{let e=await r(c(d,l),{dataSiloIds:f,includeGuessedCategories:m,parentCategories:h,includeAttributes:p,subCategories:g});t.info(s.magenta(`Writing datapoints to file "${u}"...`));let i=[];await n(u,e.map(e=>{let t={"Property ID":e.id,"Data Silo":e.dataSilo.title,Object:e.dataPoint.name,"Object Path":e.dataPoint.path.join(`.`),Property:e.name,"Property Description":e.description,"Data Categories":e.categories.map(e=>`${e.category}:${e.name}`).join(`, `),"Guessed Category":e.pendingCategoryGuesses?.[0]?`${e.pendingCategoryGuesses[0].category.category}:${e.pendingCategoryGuesses[0].category.name}`:``,"Processing Purposes":e.purposes.map(e=>`${e.purpose}:${e.name}`).join(`, `),...Object.entries(a(e.attributeValues||[],({attributeKey:e})=>e.name)).reduce((e,[t,n])=>(e[t]=n.map(e=>e.name).join(`,`),e),{})};return i=o([...i,...Object.keys(t)]),t}),i)}catch(e){t.error(s.red(`An error occurred syncing the datapoints: ${e.message}`)),this.process.exit(1)}t.info(s.green(`Successfully synced datapoints to disk at ${u}! View at ${e}`))}export{l as pullDatapoints};
2
- //# sourceMappingURL=impl-ogUHfunr.mjs.map
1
+ import{n as e}from"./constants-muOBBQA_.mjs";import{t}from"./logger-Bj782ZYD.mjs";import{s as n}from"./writeCsv-C4pjXGsD.mjs";import{t as r}from"./pullAllDatapoints-Bbmky50p.mjs";import{t as i}from"./done-input-validation-BcNBxhEs.mjs";import{groupBy as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c}from"@transcend-io/sdk";async function l({auth:l,file:u,transcendUrl:d,dataSiloIds:f,includeAttributes:p,includeGuessedCategories:m,parentCategories:h,subCategories:g=[]}){i(this.process.exit);try{let e=await r(c(d,l),{dataSiloIds:f,includeGuessedCategories:m,parentCategories:h,includeAttributes:p,subCategories:g});t.info(s.magenta(`Writing datapoints to file "${u}"...`));let i=[];await n(u,e.map(e=>{let t={"Property ID":e.id,"Data Silo":e.dataSilo.title,Object:e.dataPoint.name,"Object Path":e.dataPoint.path.join(`.`),Property:e.name,"Property Description":e.description,"Data Categories":e.categories.map(e=>`${e.category}:${e.name}`).join(`, `),"Guessed Category":e.pendingCategoryGuesses?.[0]?`${e.pendingCategoryGuesses[0].category.category}:${e.pendingCategoryGuesses[0].category.name}`:``,"Processing Purposes":e.purposes.map(e=>`${e.purpose}:${e.name}`).join(`, `),...Object.entries(a(e.attributeValues||[],({attributeKey:e})=>e.name)).reduce((e,[t,n])=>(e[t]=n.map(e=>e.name).join(`,`),e),{})};return i=o([...i,...Object.keys(t)]),t}),i)}catch(e){t.error(s.red(`An error occurred syncing the datapoints: ${e.message}`)),this.process.exit(1)}t.info(s.green(`Successfully synced datapoints to disk at ${u}! View at ${e}`))}export{l as pullDatapoints};
2
+ //# sourceMappingURL=impl-DUdbbIpf.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-ogUHfunr.mjs","names":[],"sources":["../src/commands/inventory/pull-datapoints/impl.ts"],"sourcesContent":["import { DataCategoryType } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { uniq, groupBy } from 'lodash-es';\n\nimport { ADMIN_DASH_DATAPOINTS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullAllDatapoints } from '../../../lib/data-inventory/index.js';\nimport { writeLargeCsv } from '../../../lib/helpers/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface PullDatapointsCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n includeAttributes: boolean;\n includeGuessedCategories: boolean;\n parentCategories?: DataCategoryType[];\n subCategories?: string[];\n}\n\nexport async function pullDatapoints(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n includeAttributes,\n includeGuessedCategories,\n parentCategories,\n subCategories = [],\n }: PullDatapointsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const dataPoints = await pullAllDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n parentCategories,\n includeAttributes,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n });\n\n logger.info(colors.magenta(`Writing datapoints to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = dataPoints.map((point) => {\n const result = {\n 'Property ID': point.id,\n 'Data Silo': point.dataSilo.title,\n Object: point.dataPoint.name,\n 'Object Path': point.dataPoint.path.join('.'),\n Property: point.name,\n 'Property Description': point.description,\n 'Data Categories': point.categories\n .map((category) => `${category.category}:${category.name}`)\n .join(', '),\n 'Guessed Category': point.pendingCategoryGuesses?.[0]\n ? `${point.pendingCategoryGuesses![0]!.category.category}:${\n point.pendingCategoryGuesses![0]!.category.name\n }`\n : '',\n 'Processing Purposes': point.purposes\n .map((purpose) => `${purpose.purpose}:${purpose.name}`)\n .join(', '),\n ...Object.entries(\n groupBy(point.attributeValues || [], ({ attributeKey }) => attributeKey.name),\n ).reduce(\n (acc, [key, values]) => {\n acc[key] = values.map((value) => value.name).join(',');\n return acc;\n },\n {} as Record<string, string>,\n ),\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(colors.red(`An error occurred syncing the datapoints: ${err.message}`));\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced datapoints to disk at ${file}! View at ${ADMIN_DASH_DATAPOINTS}`,\n ),\n );\n}\n"],"mappings":"gXAuBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,oBACA,2BACA,mBACA,gBAAgB,EAAE,EAEL,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAI,CAIF,IAAM,EAAa,MAAM,EAFV,EAA4B,EAAc,EAAK,CAEX,CACjD,cACA,2BACA,mBACA,oBACA,gBACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,+BAA+B,EAAK,MAAM,CAAC,CACtE,IAAI,EAAoB,EAAE,CAiC1B,MAAM,EAAc,EAhCL,EAAW,IAAK,GAAU,CACvC,IAAM,EAAS,CACb,cAAe,EAAM,GACrB,YAAa,EAAM,SAAS,MAC5B,OAAQ,EAAM,UAAU,KACxB,cAAe,EAAM,UAAU,KAAK,KAAK,IAAI,CAC7C,SAAU,EAAM,KAChB,uBAAwB,EAAM,YAC9B,kBAAmB,EAAM,WACtB,IAAK,GAAa,GAAG,EAAS,SAAS,GAAG,EAAS,OAAO,CAC1D,KAAK,KAAK,CACb,mBAAoB,EAAM,yBAAyB,GAC/C,GAAG,EAAM,uBAAwB,GAAI,SAAS,SAAS,GACrD,EAAM,uBAAwB,GAAI,SAAS,OAE7C,GACJ,sBAAuB,EAAM,SAC1B,IAAK,GAAY,GAAG,EAAQ,QAAQ,GAAG,EAAQ,OAAO,CACtD,KAAK,KAAK,CACb,GAAG,OAAO,QACR,EAAQ,EAAM,iBAAmB,EAAE,EAAG,CAAE,kBAAmB,EAAa,KAAK,CAC9E,CAAC,QACC,EAAK,CAAC,EAAK,MACV,EAAI,GAAO,EAAO,IAAK,GAAU,EAAM,KAAK,CAAC,KAAK,IAAI,CAC/C,GAET,EAAE,CACH,CACF,CAED,MADA,GAAU,EAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GACP,CACgC,EAAQ,OACnC,EAAK,CACZ,EAAO,MAAM,EAAO,IAAI,6CAA6C,EAAI,UAAU,CAAC,CACpF,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAO,KACL,EAAO,MACL,6CAA6C,EAAK,YAAY,IAC/D,CACF"}
1
+ {"version":3,"file":"impl-DUdbbIpf.mjs","names":[],"sources":["../src/commands/inventory/pull-datapoints/impl.ts"],"sourcesContent":["import { DataCategoryType } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { uniq, groupBy } from 'lodash-es';\n\nimport { ADMIN_DASH_DATAPOINTS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullAllDatapoints } from '../../../lib/data-inventory/index.js';\nimport { writeLargeCsv } from '../../../lib/helpers/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface PullDatapointsCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n includeAttributes: boolean;\n includeGuessedCategories: boolean;\n parentCategories?: DataCategoryType[];\n subCategories?: string[];\n}\n\nexport async function pullDatapoints(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n includeAttributes,\n includeGuessedCategories,\n parentCategories,\n subCategories = [],\n }: PullDatapointsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const dataPoints = await pullAllDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n parentCategories,\n includeAttributes,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n });\n\n logger.info(colors.magenta(`Writing datapoints to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = dataPoints.map((point) => {\n const result = {\n 'Property ID': point.id,\n 'Data Silo': point.dataSilo.title,\n Object: point.dataPoint.name,\n 'Object Path': point.dataPoint.path.join('.'),\n Property: point.name,\n 'Property Description': point.description,\n 'Data Categories': point.categories\n .map((category) => `${category.category}:${category.name}`)\n .join(', '),\n 'Guessed Category': point.pendingCategoryGuesses?.[0]\n ? `${point.pendingCategoryGuesses![0]!.category.category}:${\n point.pendingCategoryGuesses![0]!.category.name\n }`\n : '',\n 'Processing Purposes': point.purposes\n .map((purpose) => `${purpose.purpose}:${purpose.name}`)\n .join(', '),\n ...Object.entries(\n groupBy(point.attributeValues || [], ({ attributeKey }) => attributeKey.name),\n ).reduce(\n (acc, [key, values]) => {\n acc[key] = values.map((value) => value.name).join(',');\n return acc;\n },\n {} as Record<string, string>,\n ),\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(colors.red(`An error occurred syncing the datapoints: ${err.message}`));\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced datapoints to disk at ${file}! View at ${ADMIN_DASH_DATAPOINTS}`,\n ),\n );\n}\n"],"mappings":"gXAuBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,oBACA,2BACA,mBACA,gBAAgB,EAAE,EAEL,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAI,CAIF,IAAM,EAAa,MAAM,EAFV,EAA4B,EAAc,EAAK,CAEX,CACjD,cACA,2BACA,mBACA,oBACA,gBACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,+BAA+B,EAAK,MAAM,CAAC,CACtE,IAAI,EAAoB,EAAE,CAiC1B,MAAM,EAAc,EAhCL,EAAW,IAAK,GAAU,CACvC,IAAM,EAAS,CACb,cAAe,EAAM,GACrB,YAAa,EAAM,SAAS,MAC5B,OAAQ,EAAM,UAAU,KACxB,cAAe,EAAM,UAAU,KAAK,KAAK,IAAI,CAC7C,SAAU,EAAM,KAChB,uBAAwB,EAAM,YAC9B,kBAAmB,EAAM,WACtB,IAAK,GAAa,GAAG,EAAS,SAAS,GAAG,EAAS,OAAO,CAC1D,KAAK,KAAK,CACb,mBAAoB,EAAM,yBAAyB,GAC/C,GAAG,EAAM,uBAAwB,GAAI,SAAS,SAAS,GACrD,EAAM,uBAAwB,GAAI,SAAS,OAE7C,GACJ,sBAAuB,EAAM,SAC1B,IAAK,GAAY,GAAG,EAAQ,QAAQ,GAAG,EAAQ,OAAO,CACtD,KAAK,KAAK,CACb,GAAG,OAAO,QACR,EAAQ,EAAM,iBAAmB,EAAE,EAAG,CAAE,kBAAmB,EAAa,KAAK,CAC9E,CAAC,QACC,EAAK,CAAC,EAAK,MACV,EAAI,GAAO,EAAO,IAAK,GAAU,EAAM,KAAK,CAAC,KAAK,IAAI,CAC/C,GAET,EAAE,CACH,CACF,CAED,MADA,GAAU,EAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GACP,CACgC,EAAQ,OACnC,EAAK,CACZ,EAAO,MAAM,EAAO,IAAI,6CAA6C,EAAI,UAAU,CAAC,CACpF,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAO,KACL,EAAO,MACL,6CAA6C,EAAK,YAAY,IAC/D,CACF"}
@@ -1,7 +1,7 @@
1
- import{t as e}from"./logger-Bj782ZYD.mjs";import{n as t}from"./parseAttributesFromString-B8h4DudO.mjs";import{t as n}from"./readCsv-0PIlJQCN.mjs";import{n as r}from"./inquirer-DyRwhvoh.mjs";import{t as i}from"./done-input-validation-C5rgR0Wr.mjs";import{PreferenceTopicType as a}from"@transcend-io/privacy-types";import{chunk as o,difference as s,groupBy as c,keyBy as l,uniq as u}from"lodash-es";import{apply as d}from"@transcend-io/type-utils";import{readdirSync as f}from"node:fs";import{basename as p,join as m}from"node:path";import h from"colors";import*as g from"io-ts";import{PreferenceState as _,buildTranscendGraphQLClient as v,checkIfPendingPreferenceUpdatesAreNoOp as y,checkIfPendingPreferenceUpdatesCauseConflict as b,createSombraGotInstance as x,fetchAllPreferenceTopics as S,fetchAllPurposes as C,getPreferenceUpdatesFromRow as w,getPreferencesForIdentifiers as T}from"@transcend-io/sdk";import{map as E,mapSeries as D,splitCsvToList as O}from"@transcend-io/utils";import k from"cli-progress";import A from"inquirer";import{PersistedState as j}from"@transcend-io/persisted-state";async function M(t,n,{purposeSlugs:r,preferenceTopics:i,forceTriggerWorkflows:o}){let c=s(u(t.map(e=>Object.keys(e)).flat()),[...n.identifierColumn?[n.identifierColumn]:[],...n.timestampColum?[n.timestampColum]:[]]);if(c.length===0){if(o)return n;throw Error(`No other columns to process`)}let l=[...r,...i.map(e=>`${e.purpose.trackingType}->${e.slug}`)];return await D(c,async o=>{let s=u(t.map(e=>e[o])),c=n.columnToPurposeName[o];if(c)e.info(h.magenta(`Column "${o}" is associated with purpose "${c.purpose}"`));else{let{purposeName:e}=await A.prompt([{name:`purposeName`,message:`Choose the purpose that column ${o} is associated with`,type:`list`,default:l.find(e=>e.startsWith(r[0])),choices:l}]),[t,n]=e.split(`->`);c={purpose:t,preference:n||null,valueMapping:{}}}await D(s,async t=>{if(c.valueMapping[t]!==void 0){e.info(h.magenta(`Value "${t}" is associated with purpose value "${c.valueMapping[t]}"`));return}if(c.preference===null){let{purposeValue:e}=await A.prompt([{name:`purposeValue`,message:`Choose the purpose value for value "${t}" associated with purpose "${c.purpose}"`,type:`confirm`,default:t!==`false`}]);c.valueMapping[t]=e}if(c.preference!==null){let n=i.find(e=>e.slug===c.preference);if(!n){e.error(h.red(`Preference topic "${c.preference}" not found`));return}let r=n.preferenceOptionValues.map(({slug:e})=>e);if(n.type===a.Boolean){let{preferenceValue:e}=await A.prompt([{name:`preferenceValue`,message:`Choose the preference value for "${n.slug}" value "${t}" associated with purpose "${c.purpose}"`,type:`confirm`,default:t!==`false`}]);c.valueMapping[t]=e;return}if(n.type===a.Select){let{preferenceValue:e}=await A.prompt([{name:`preferenceValue`,message:`Choose the preference value for "${n.slug}" value "${t}" associated with purpose "${c.purpose}"`,type:`list`,choices:r,default:r.find(e=>e===t)}]);c.valueMapping[t]=e;return}if(n.type===a.MultiSelect){await D(O(t),async e=>{if(c.valueMapping[e]!==void 0)return;let{preferenceValue:t}=await A.prompt([{name:`preferenceValue`,message:`Choose the preference value for "${n.slug}" value "${e}" associated with purpose "${c.purpose}"`,type:`list`,choices:r,default:r.find(t=>t===e)}]);c.valueMapping[e]=t});return}throw Error(`Unknown preference topic type: ${n.type}`)}}),n.columnToPurposeName[o]=c}),n}async function N(t,n){let i=s(u(t.map(e=>Object.keys(e)).flat()),[...n.identifierColumn?[n.identifierColumn]:[],...Object.keys(n.columnToPurposeName)]);if(!n.identifierColumn){let{identifierName:e}=await A.prompt([{name:`identifierName`,message:`Choose the column that will be used as the identifier to upload consent preferences by`,type:`list`,default:i.find(e=>e.toLowerCase().includes(`email`))||i[0],choices:i}]);n.identifierColumn=e}e.info(h.magenta(`Using identifier column "${n.identifierColumn}"`));let a=t.map((e,t)=>e[n.identifierColumn]?null:[t]).filter(e=>!!e).flat();if(a.length>0){let i=`The identifier column "${n.identifierColumn}" is missing a value for the following rows: ${a.join(`, `)}`;if(e.warn(h.yellow(i)),!await r({message:`Would you like to skip rows missing an identifier?`}))throw Error(i);let o=t.length;t=t.filter(e=>e[n.identifierColumn]),e.info(h.yellow(`Skipped ${o-t.length} rows missing an identifier`))}e.info(h.magenta(`The identifier column "${n.identifierColumn}" is present for all rows`));let o=c(t,n.identifierColumn),l=Object.entries(o).filter(([,e])=>e.length>1);if(l.length>0){let i=`The identifier column "${n.identifierColumn}" has duplicate values for the following rows: ${l.slice(0,10).map(([e,t])=>`${e} (${t.length})`).join(`
1
+ import{t as e}from"./logger-Bj782ZYD.mjs";import{n as t}from"./parseAttributesFromString-D1Yl0xwT.mjs";import{t as n}from"./readCsv-C4TyEs-r.mjs";import{n as r}from"./inquirer-BqZXFEt1.mjs";import{t as i}from"./done-input-validation-BcNBxhEs.mjs";import{PreferenceTopicType as a}from"@transcend-io/privacy-types";import{chunk as o,difference as s,groupBy as c,keyBy as l,uniq as u}from"lodash-es";import{apply as d}from"@transcend-io/type-utils";import{readdirSync as f}from"node:fs";import{basename as p,join as m}from"node:path";import h from"colors";import*as g from"io-ts";import{PreferenceState as _,buildTranscendGraphQLClient as v,checkIfPendingPreferenceUpdatesAreNoOp as y,checkIfPendingPreferenceUpdatesCauseConflict as b,createSombraGotInstance as x,fetchAllPreferenceTopics as S,fetchAllPurposes as C,getPreferenceUpdatesFromRow as w,getPreferencesForIdentifiers as T}from"@transcend-io/sdk";import{map as E,mapSeries as D,splitCsvToList as O}from"@transcend-io/utils";import k from"cli-progress";import A from"inquirer";import{PersistedState as j}from"@transcend-io/persisted-state";async function M(t,n,{purposeSlugs:r,preferenceTopics:i,forceTriggerWorkflows:o}){let c=s(u(t.map(e=>Object.keys(e)).flat()),[...n.identifierColumn?[n.identifierColumn]:[],...n.timestampColum?[n.timestampColum]:[]]);if(c.length===0){if(o)return n;throw Error(`No other columns to process`)}let l=[...r,...i.map(e=>`${e.purpose.trackingType}->${e.slug}`)];return await D(c,async o=>{let s=u(t.map(e=>e[o])),c=n.columnToPurposeName[o];if(c)e.info(h.magenta(`Column "${o}" is associated with purpose "${c.purpose}"`));else{let{purposeName:e}=await A.prompt([{name:`purposeName`,message:`Choose the purpose that column ${o} is associated with`,type:`list`,default:l.find(e=>e.startsWith(r[0])),choices:l}]),[t,n]=e.split(`->`);c={purpose:t,preference:n||null,valueMapping:{}}}await D(s,async t=>{if(c.valueMapping[t]!==void 0){e.info(h.magenta(`Value "${t}" is associated with purpose value "${c.valueMapping[t]}"`));return}if(c.preference===null){let{purposeValue:e}=await A.prompt([{name:`purposeValue`,message:`Choose the purpose value for value "${t}" associated with purpose "${c.purpose}"`,type:`confirm`,default:t!==`false`}]);c.valueMapping[t]=e}if(c.preference!==null){let n=i.find(e=>e.slug===c.preference);if(!n){e.error(h.red(`Preference topic "${c.preference}" not found`));return}let r=n.preferenceOptionValues.map(({slug:e})=>e);if(n.type===a.Boolean){let{preferenceValue:e}=await A.prompt([{name:`preferenceValue`,message:`Choose the preference value for "${n.slug}" value "${t}" associated with purpose "${c.purpose}"`,type:`confirm`,default:t!==`false`}]);c.valueMapping[t]=e;return}if(n.type===a.Select){let{preferenceValue:e}=await A.prompt([{name:`preferenceValue`,message:`Choose the preference value for "${n.slug}" value "${t}" associated with purpose "${c.purpose}"`,type:`list`,choices:r,default:r.find(e=>e===t)}]);c.valueMapping[t]=e;return}if(n.type===a.MultiSelect){await D(O(t),async e=>{if(c.valueMapping[e]!==void 0)return;let{preferenceValue:t}=await A.prompt([{name:`preferenceValue`,message:`Choose the preference value for "${n.slug}" value "${e}" associated with purpose "${c.purpose}"`,type:`list`,choices:r,default:r.find(t=>t===e)}]);c.valueMapping[e]=t});return}throw Error(`Unknown preference topic type: ${n.type}`)}}),n.columnToPurposeName[o]=c}),n}async function N(t,n){let i=s(u(t.map(e=>Object.keys(e)).flat()),[...n.identifierColumn?[n.identifierColumn]:[],...Object.keys(n.columnToPurposeName)]);if(!n.identifierColumn){let{identifierName:e}=await A.prompt([{name:`identifierName`,message:`Choose the column that will be used as the identifier to upload consent preferences by`,type:`list`,default:i.find(e=>e.toLowerCase().includes(`email`))||i[0],choices:i}]);n.identifierColumn=e}e.info(h.magenta(`Using identifier column "${n.identifierColumn}"`));let a=t.map((e,t)=>e[n.identifierColumn]?null:[t]).filter(e=>!!e).flat();if(a.length>0){let i=`The identifier column "${n.identifierColumn}" is missing a value for the following rows: ${a.join(`, `)}`;if(e.warn(h.yellow(i)),!await r({message:`Would you like to skip rows missing an identifier?`}))throw Error(i);let o=t.length;t=t.filter(e=>e[n.identifierColumn]),e.info(h.yellow(`Skipped ${o-t.length} rows missing an identifier`))}e.info(h.magenta(`The identifier column "${n.identifierColumn}" is present for all rows`));let o=c(t,n.identifierColumn),l=Object.entries(o).filter(([,e])=>e.length>1);if(l.length>0){let i=`The identifier column "${n.identifierColumn}" has duplicate values for the following rows: ${l.slice(0,10).map(([e,t])=>`${e} (${t.length})`).join(`
2
2
  `)}`;if(e.warn(h.yellow(i)),!await r({message:`Would you like to automatically take the latest update?`}))throw Error(i);t=Object.entries(o).map(([,e])=>e.sort((e,t)=>new Date(t[n.timestampColum]).getTime()-new Date(e[n.timestampColum]).getTime())[0]).filter(e=>e)}return{currentState:n,preferences:t}}async function P(t,n){let r=s(u(t.map(e=>Object.keys(e)).flat()),[...n.identifierColumn?[n.identifierColumn]:[],...Object.keys(n.columnToPurposeName)]);if(!n.timestampColum){let{timestampName:e}=await A.prompt([{name:`timestampName`,message:`Choose the column that will be used as the timestamp of last preference update`,type:`list`,default:r.find(e=>e.toLowerCase().includes(`date`))||r.find(e=>e.toLowerCase().includes(`time`))||r[0],choices:[...r,`[NONE]`]}]);n.timestampColum=e}if(e.info(h.magenta(`Using timestamp column "${n.timestampColum}"`)),n.timestampColum!==`[NONE]`){let r=t.map((e,t)=>e[n.timestampColum]?null:[t]).filter(e=>!!e).flat();if(r.length>0)throw Error(`The timestamp column "${n.timestampColum}" is missing a value for the following rows: ${r.join(`
3
3
  `)}`);e.info(h.magenta(`The timestamp column "${n.timestampColum}" is present for all row`))}return n}async function F({file:t,sombra:r,purposeSlugs:i,preferenceTopics:a,partitionKey:o,skipExistingRecordCheck:s,forceTriggerWorkflows:c},u){let d=new Date().getTime(),f=u.getValue(`fileMetadata`);e.info(h.magenta(`Reading in file: "${t}"`));let p=n(t,g.record(g.string,g.string)),m={columnToPurposeName:{},pendingSafeUpdates:{},pendingConflictUpdates:{},skippedUpdates:{},...f[t]||{},lastFetchedAt:new Date().toISOString()};m=await P(p,m),f[t]=m,await u.setValue(f,`fileMetadata`);let _=await N(p,m);m=_.currentState,p=_.preferences,f[t]=m,await u.setValue(f,`fileMetadata`),m=await M(p,m,{preferenceTopics:a,purposeSlugs:i,forceTriggerWorkflows:c}),f[t]=m,await u.setValue(f,`fileMetadata`);let v=p.map(e=>e[m.identifierColumn]),x=new k.SingleBar({},k.Presets.shades_classic);s||x.start(v.length,0);let S=s?[]:await T(r,{identifiers:v.map(e=>({value:e})),partitionKey:o,logger:e,onProgress:(e,t)=>x.update(e,{total:t})});x.stop();let C=l(S,`userId`);m.pendingConflictUpdates={},m.pendingSafeUpdates={},m.skippedUpdates={},p.forEach(e=>{let t=e[m.identifierColumn],n=w({row:e,columnToPurposeName:m.columnToPurposeName,preferenceTopics:a,purposeSlugs:i}),r=C[t];if(c&&!r)throw Error(`No existing consent record found for user with id: ${t}.
4
4
  When 'forceTriggerWorkflows' is set all the user identifiers should contain a consent record`);if(r&&y({currentConsentRecord:r,pendingUpdates:n,preferenceTopics:a})&&!c){m.skippedUpdates[t]=e;return}if(r&&b({currentConsentRecord:r,pendingUpdates:n,preferenceTopics:a})){m.pendingConflictUpdates[t]={row:e,record:r};return}m.pendingSafeUpdates[t]=e}),f[t]=m,await u.setValue(f,`fileMetadata`);let E=new Date().getTime();e.info(h.green(`Successfully pre-processed file: "${t}" in ${(E-d)/1e3}s`))}async function I({auth:n,sombraAuth:r,receiptFilepath:i,file:a,partition:s,isSilent:c=!0,dryRun:l=!1,skipWorkflowTriggers:u=!1,skipConflictUpdates:f=!1,skipExistingRecordCheck:p=!1,attributes:m=[],transcendUrl:g,forceTriggerWorkflows:y=!1}){let b=t(m),T=new j(i,_,{fileMetadata:{},failingUpdates:{},pendingUpdates:{}}),D=T.getValue(`failingUpdates`),O=T.getValue(`pendingUpdates`),A=T.getValue(`fileMetadata`);e.info(h.magenta(`Restored cache, there are:
5
5
  ${Object.values(D).length} failing requests to be retried\n${Object.values(O).length} pending requests to be processed\nThe following files are stored in cache and will be used:\n${Object.keys(A).map(e=>e).join(`
6
6
  `)}\nThe following file will be processed: ${a}\n`));let M=v(g,n),[N,P,I]=await Promise.all([x(g,n,{logger:e,sombraApiKey:r,sombraUrl:process.env.SOMBRA_URL}),C(M,{logger:e}),S(M,{logger:e})]);await F({file:a,purposeSlugs:P.map(e=>e.trackingType),preferenceTopics:I,sombra:N,partitionKey:s,skipExistingRecordCheck:p,forceTriggerWorkflows:y},T);let L={};A=T.getValue(`fileMetadata`);let R=A[a];if(e.info(h.magenta(`Found ${Object.entries(R.pendingSafeUpdates).length} safe updates in ${a}`)),e.info(h.magenta(`Found ${Object.entries(R.pendingConflictUpdates).length} conflict updates in ${a}`)),e.info(h.magenta(`Found ${Object.entries(R.skippedUpdates).length} skipped updates in ${a}`)),Object.entries({...R.pendingSafeUpdates,...f?{}:d(R.pendingConflictUpdates,({row:e})=>e)}).forEach(([e,t])=>{let n=R.timestampColum===`[NONE]`?new Date:new Date(t[R.timestampColum]),r=w({row:t,columnToPurposeName:R.columnToPurposeName,preferenceTopics:I,purposeSlugs:P.map(e=>e.trackingType)});L[e]={userId:e,partition:s,timestamp:n.toISOString(),purposes:Object.entries(r).map(([e,t])=>({...t,purpose:e,workflowSettings:{attributes:b,isSilent:c,skipWorkflowTrigger:u,...y?{forceTriggerWorkflow:y}:{}}}))}}),await T.setValue(L,`pendingUpdates`),await T.setValue({},`failingUpdates`),l){e.info(h.green(`Dry run complete, exiting. ${Object.values(L).length} pending updates. Check file: ${i}`));return}e.info(h.magenta(`Uploading ${Object.values(L).length} preferences to partition: ${s}`));let z=new Date().getTime(),B=new k.SingleBar({},k.Presets.shades_classic),V=0,H=Object.entries(L),U=o(H,u?100:10);B.start(H.length,0),await E(U,async t=>{try{await N.put(`v1/preferences`,{json:{records:t.map(([,e])=>e),skipWorkflowTriggers:u}}).json()}catch(n){try{let t=JSON.parse(n?.response?.body||`{}`);t.error&&e.error(h.red(`Error: ${t.error}`))}catch{}e.error(h.red(`Failed to upload ${t.length} user preferences to partition ${s}: ${n?.response?.body||n?.message}`));let r=T.getValue(`failingUpdates`);t.forEach(([e,t])=>{r[e]={uploadedAt:new Date().toISOString(),update:t,error:n?.response?.body||n?.message||`Unknown error`}}),await T.setValue(r,`failingUpdates`)}V+=t.length,B.update(V)},{concurrency:40}),B.stop();let W=new Date().getTime()-z;e.info(h.green(`Successfully uploaded ${H.length} user preferences to partition ${s} in "${W/1e3}" seconds!`))}async function L({auth:t,partition:n,sombraAuth:r,transcendUrl:a,file:o=``,directory:s,dryRun:c,skipExistingRecordCheck:l,receiptFileDir:u,skipWorkflowTriggers:d,forceTriggerWorkflows:g,skipConflictUpdates:_,isSilent:v,attributes:y,concurrency:b}){s&&o&&(e.error(h.red(`Cannot provide both a directory and a file. Please provide only one.`)),this.process.exit(1)),!o&&!s&&(e.error(h.red(`A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences`)),this.process.exit(1)),i(this.process.exit);let x=[];if(s)try{let t=f(s).filter(e=>e.endsWith(`.csv`));t.length===0&&(e.error(h.red(`No CSV files found in directory: ${s}`)),this.process.exit(1)),x.push(...t.map(e=>m(s,e)))}catch(t){e.error(h.red(`Failed to read directory: ${s}`)),e.error(h.red(t.message)),this.process.exit(1)}else try{o.endsWith(`.csv`)||(e.error(h.red(`File must be a CSV file`)),this.process.exit(1)),x.push(o)}catch(t){e.error(h.red(`Failed to access file: ${o}`)),e.error(h.red(t.message)),this.process.exit(1)}e.info(h.green(`Processing ${x.length} consent preferences files for partition: ${n}`)),e.debug(`Files to process: ${x.join(`, `)}`),l&&e.info(h.bgYellow(`Skipping existing record check: ${l}`)),await E(x,async e=>{await I({receiptFilepath:m(u,`${p(e).replace(`.csv`,``)}-receipts.json`),auth:t,sombraAuth:r,file:e,partition:n,transcendUrl:a,skipConflictUpdates:_,skipWorkflowTriggers:d,skipExistingRecordCheck:l,isSilent:v,dryRun:c,attributes:O(y),forceTriggerWorkflows:g})},{concurrency:b})}export{L as uploadPreferences};
7
- //# sourceMappingURL=impl-CODwodEc.mjs.map
7
+ //# sourceMappingURL=impl-DXHqqWJb.mjs.map