@transcend-io/cli 10.27.3 → 10.27.5

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 (355) hide show
  1. package/dist/{app-CWTAiJKB.mjs → app-dIu3pdTM.mjs} +21 -21
  2. package/dist/{app-CWTAiJKB.mjs.map → app-dIu3pdTM.mjs.map} +1 -1
  3. package/dist/{approvePrivacyRequests-DYW20j6q.mjs → approvePrivacyRequests-B842tXn4.mjs} +2 -2
  4. package/dist/{approvePrivacyRequests-DYW20j6q.mjs.map → approvePrivacyRequests-B842tXn4.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/cli.mjs.map +1 -1
  8. package/dist/bin/deprecated-command.mjs +3 -3
  9. package/dist/bin/deprecated-command.mjs.map +1 -1
  10. package/dist/{buildExamples-9cTRehd1.mjs → buildExamples-CRrUU89C.mjs} +2 -2
  11. package/dist/{buildExamples-9cTRehd1.mjs.map → buildExamples-CRrUU89C.mjs.map} +1 -1
  12. package/dist/{buildXdiSyncEndpoint-DPAOTaDK.mjs → buildXdiSyncEndpoint-B9seJTxP.mjs} +2 -2
  13. package/dist/{buildXdiSyncEndpoint-DPAOTaDK.mjs.map → buildXdiSyncEndpoint-B9seJTxP.mjs.map} +1 -1
  14. package/dist/{bulkRestartRequests-BNsFqq1U.mjs → bulkRestartRequests-CE7cDUMd.mjs} +2 -2
  15. package/dist/{bulkRestartRequests-BNsFqq1U.mjs.map → bulkRestartRequests-CE7cDUMd.mjs.map} +1 -1
  16. package/dist/{bulkRetryEnrichers-DzbsrAL3.mjs → bulkRetryEnrichers-BcSANZPC.mjs} +2 -2
  17. package/dist/{bulkRetryEnrichers-DzbsrAL3.mjs.map → bulkRetryEnrichers-BcSANZPC.mjs.map} +1 -1
  18. package/dist/{cancelPrivacyRequests-DIfhHbQn.mjs → cancelPrivacyRequests-BKibbagv.mjs} +2 -2
  19. package/dist/{cancelPrivacyRequests-DIfhHbQn.mjs.map → cancelPrivacyRequests-BKibbagv.mjs.map} +1 -1
  20. package/dist/{codecs-DJFlZLGT.mjs → codecs-zRkskjaJ.mjs} +1 -1
  21. package/dist/{codecs-DJFlZLGT.mjs.map → codecs-zRkskjaJ.mjs.map} +1 -1
  22. package/dist/collectCsvFilesOrExit-Dg5U3Qx_.mjs +2 -0
  23. package/dist/collectCsvFilesOrExit-Dg5U3Qx_.mjs.map +1 -0
  24. package/dist/collectParquetFilesOrExit-BlG2RRSC.mjs +2 -0
  25. package/dist/collectParquetFilesOrExit-BlG2RRSC.mjs.map +1 -0
  26. package/dist/{command-3eoWijOv.mjs → command-DKNKpgUB.mjs} +2 -2
  27. package/dist/{command-3eoWijOv.mjs.map → command-DKNKpgUB.mjs.map} +1 -1
  28. package/dist/commands/admin/chunk-csv/worker.mjs +1 -1
  29. package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
  30. package/dist/consentManagersToBusinessEntities-Rv-ajWya.mjs +2 -0
  31. package/dist/consentManagersToBusinessEntities-Rv-ajWya.mjs.map +1 -0
  32. package/dist/{constants-BgCEW975.mjs → constants-B6wESCW2.mjs} +2 -2
  33. package/dist/{constants-BgCEW975.mjs.map → constants-B6wESCW2.mjs.map} +1 -1
  34. package/dist/{constants-C9xZJ9YW.mjs → constants-BuoISmXP.mjs} +1 -1
  35. package/dist/{constants-C9xZJ9YW.mjs.map → constants-BuoISmXP.mjs.map} +1 -1
  36. package/dist/{constants-DKKXqoSr.mjs → constants-CdgK1myP.mjs} +2 -2
  37. package/dist/{constants-DKKXqoSr.mjs.map → constants-CdgK1myP.mjs.map} +1 -1
  38. package/dist/context-4GAUnhTE.mjs +2 -0
  39. package/dist/context-4GAUnhTE.mjs.map +1 -0
  40. package/dist/createPoolingCommandUi-vTsGgYZT.mjs +14 -0
  41. package/dist/createPoolingCommandUi-vTsGgYZT.mjs.map +1 -0
  42. package/dist/done-input-validation-BFgMCQWH.mjs +2 -0
  43. package/dist/done-input-validation-BFgMCQWH.mjs.map +1 -0
  44. package/dist/{downloadPrivacyRequestFiles-cSB4B_30.mjs → downloadPrivacyRequestFiles-Dn3VexN2.mjs} +2 -2
  45. package/dist/{downloadPrivacyRequestFiles-cSB4B_30.mjs.map → downloadPrivacyRequestFiles-Dn3VexN2.mjs.map} +1 -1
  46. package/dist/{extractClientError-X9wJVqGq.mjs → extractClientError-DeS63kje.mjs} +1 -1
  47. package/dist/{extractClientError-X9wJVqGq.mjs.map → extractClientError-DeS63kje.mjs.map} +1 -1
  48. package/dist/{fetchAllRequests-DP24WqrP.mjs → fetchAllRequests-DUQGTJjx.mjs} +2 -2
  49. package/dist/{fetchAllRequests-DP24WqrP.mjs.map → fetchAllRequests-DUQGTJjx.mjs.map} +1 -1
  50. package/dist/{fuzzyMatchColumns-C1STZ_T1.mjs → fuzzyMatchColumns-BDD4a2W0.mjs} +2 -2
  51. package/dist/{fuzzyMatchColumns-C1STZ_T1.mjs.map → fuzzyMatchColumns-BDD4a2W0.mjs.map} +1 -1
  52. package/dist/{generateCrossAccountApiKeys-B1nowja2.mjs → generateCrossAccountApiKeys-QhnLqtUN.mjs} +2 -2
  53. package/dist/{generateCrossAccountApiKeys-B1nowja2.mjs.map → generateCrossAccountApiKeys-QhnLqtUN.mjs.map} +1 -1
  54. package/dist/impl-3IyENr9T.mjs +2 -0
  55. package/dist/impl-3IyENr9T.mjs.map +1 -0
  56. package/dist/impl-4rLX5Wah2.mjs +2 -0
  57. package/dist/impl-4rLX5Wah2.mjs.map +1 -0
  58. package/dist/impl-9TDsbGfF2.mjs +2 -0
  59. package/dist/impl-9TDsbGfF2.mjs.map +1 -0
  60. package/dist/impl-BPjGRqOL2.mjs +3 -0
  61. package/dist/{impl-eW9ZxuVu2.mjs.map → impl-BPjGRqOL2.mjs.map} +1 -1
  62. package/dist/impl-BPn_YPIq2.mjs +2 -0
  63. package/dist/{impl-hGwy9khM2.mjs.map → impl-BPn_YPIq2.mjs.map} +1 -1
  64. package/dist/impl-BQTw6jpw.mjs +2 -0
  65. package/dist/impl-BQTw6jpw.mjs.map +1 -0
  66. package/dist/impl-Ba8naMzu.mjs +2 -0
  67. package/dist/impl-Ba8naMzu.mjs.map +1 -0
  68. package/dist/impl-BbWzTCSd2.mjs +2 -0
  69. package/dist/{impl-C3S5iupW2.mjs.map → impl-BbWzTCSd2.mjs.map} +1 -1
  70. package/dist/impl-BddyFp_q.mjs +3 -0
  71. package/dist/impl-BddyFp_q.mjs.map +1 -0
  72. package/dist/impl-BgxjEv88.mjs +3 -0
  73. package/dist/impl-BgxjEv88.mjs.map +1 -0
  74. package/dist/impl-BiBNqcob.mjs +2 -0
  75. package/dist/impl-BiBNqcob.mjs.map +1 -0
  76. package/dist/{impl-QK9-ui6X.mjs → impl-BkyqCY72.mjs} +2 -2
  77. package/dist/impl-BkyqCY72.mjs.map +1 -0
  78. package/dist/{impl-Ca064LmU.mjs → impl-BlFBTc6f.mjs} +3 -3
  79. package/dist/{impl-Ca064LmU.mjs.map → impl-BlFBTc6f.mjs.map} +1 -1
  80. package/dist/impl-BoCD0t4j.mjs +3 -0
  81. package/dist/impl-BoCD0t4j.mjs.map +1 -0
  82. package/dist/impl-BqiclSRZ.mjs +2 -0
  83. package/dist/impl-BqiclSRZ.mjs.map +1 -0
  84. package/dist/impl-BsEYMBx2.mjs +7 -0
  85. package/dist/{impl-DvSnW_IA.mjs.map → impl-BsEYMBx2.mjs.map} +1 -1
  86. package/dist/impl-CBC5K-IH.mjs +2 -0
  87. package/dist/impl-CBC5K-IH.mjs.map +1 -0
  88. package/dist/impl-CH40t5qf.mjs +2 -0
  89. package/dist/impl-CH40t5qf.mjs.map +1 -0
  90. package/dist/impl-CLVMZXJo.mjs +2 -0
  91. package/dist/impl-CLVMZXJo.mjs.map +1 -0
  92. package/dist/{impl-Bccyro7t.mjs → impl-CMYYX3Kz.mjs} +2 -2
  93. package/dist/{impl-Bccyro7t.mjs.map → impl-CMYYX3Kz.mjs.map} +1 -1
  94. package/dist/impl-CVChVd63.mjs +2 -0
  95. package/dist/impl-CVChVd63.mjs.map +1 -0
  96. package/dist/impl-CXdy0YMX.mjs +2 -0
  97. package/dist/impl-CXdy0YMX.mjs.map +1 -0
  98. package/dist/impl-CZ-KvZE02.mjs +2 -0
  99. package/dist/{impl-CKQu30cA2.mjs.map → impl-CZ-KvZE02.mjs.map} +1 -1
  100. package/dist/impl-CbijbA-M2.mjs +2 -0
  101. package/dist/{impl-CJpPjFIi2.mjs.map → impl-CbijbA-M2.mjs.map} +1 -1
  102. package/dist/impl-CccuY3Za.mjs +12 -0
  103. package/dist/impl-CccuY3Za.mjs.map +1 -0
  104. package/dist/impl-CclEOdC32.mjs +2 -0
  105. package/dist/{impl-B0oCwFpP2.mjs.map → impl-CclEOdC32.mjs.map} +1 -1
  106. package/dist/impl-Cq5wI-kP.mjs +2 -0
  107. package/dist/impl-Cq5wI-kP.mjs.map +1 -0
  108. package/dist/impl-CrY1za0t.mjs +2 -0
  109. package/dist/impl-CrY1za0t.mjs.map +1 -0
  110. package/dist/impl-CusKk_JR2.mjs +2 -0
  111. package/dist/{impl-BzhraaBB2.mjs.map → impl-CusKk_JR2.mjs.map} +1 -1
  112. package/dist/impl-CzbVqbm0.mjs +5 -0
  113. package/dist/impl-CzbVqbm0.mjs.map +1 -0
  114. package/dist/impl-D33Zr0vh2.mjs +2 -0
  115. package/dist/impl-D33Zr0vh2.mjs.map +1 -0
  116. package/dist/impl-DG9RwTkA2.mjs +2 -0
  117. package/dist/{impl-XKBP7s772.mjs.map → impl-DG9RwTkA2.mjs.map} +1 -1
  118. package/dist/impl-DQG3PiAW2.mjs +2 -0
  119. package/dist/{impl-B3whGgMU2.mjs.map → impl-DQG3PiAW2.mjs.map} +1 -1
  120. package/dist/impl-DRimS_G8.mjs +2 -0
  121. package/dist/impl-DRimS_G8.mjs.map +1 -0
  122. package/dist/impl-DWBQKUuq.mjs +2 -0
  123. package/dist/{impl-B0-rCxY1.mjs.map → impl-DWBQKUuq.mjs.map} +1 -1
  124. package/dist/impl-DbF7uw7f2.mjs +2 -0
  125. package/dist/{impl-CAAQ0OKP2.mjs.map → impl-DbF7uw7f2.mjs.map} +1 -1
  126. package/dist/impl-DbPLuDc22.mjs +2 -0
  127. package/dist/impl-DbPLuDc22.mjs.map +1 -0
  128. package/dist/impl-DiyWNLJq.mjs +2 -0
  129. package/dist/impl-DiyWNLJq.mjs.map +1 -0
  130. package/dist/impl-DlaWf-oS2.mjs +2 -0
  131. package/dist/impl-DlaWf-oS2.mjs.map +1 -0
  132. package/dist/impl-Dpes0u_6.mjs +2 -0
  133. package/dist/{impl-ByeEmvdo.mjs.map → impl-Dpes0u_6.mjs.map} +1 -1
  134. package/dist/impl-DxXWaXFU.mjs +2 -0
  135. package/dist/impl-DxXWaXFU.mjs.map +1 -0
  136. package/dist/impl-DzJG5HaX.mjs +2 -0
  137. package/dist/impl-DzJG5HaX.mjs.map +1 -0
  138. package/dist/impl-GYM4LDKp2.mjs +2 -0
  139. package/dist/{impl-B7qkiYZY2.mjs.map → impl-GYM4LDKp2.mjs.map} +1 -1
  140. package/dist/{impl-B24TOrY-.mjs → impl-GnxjtYL7.mjs} +2 -2
  141. package/dist/impl-GnxjtYL7.mjs.map +1 -0
  142. package/dist/impl-PYtpY5hs2.mjs +2 -0
  143. package/dist/impl-PYtpY5hs2.mjs.map +1 -0
  144. package/dist/impl-QeWNZCg4.mjs +3 -0
  145. package/dist/impl-QeWNZCg4.mjs.map +1 -0
  146. package/dist/impl-V_ffkzbd2.mjs +2 -0
  147. package/dist/{impl-DK0UUhuK2.mjs.map → impl-V_ffkzbd2.mjs.map} +1 -1
  148. package/dist/impl-_rrZ0KXo.mjs +3 -0
  149. package/dist/impl-_rrZ0KXo.mjs.map +1 -0
  150. package/dist/impl-_tY0CJdZ.mjs +5 -0
  151. package/dist/impl-_tY0CJdZ.mjs.map +1 -0
  152. package/dist/impl-nJ7LzilX2.mjs +2 -0
  153. package/dist/impl-nJ7LzilX2.mjs.map +1 -0
  154. package/dist/impl-p0AyZWFL.mjs +2 -0
  155. package/dist/impl-p0AyZWFL.mjs.map +1 -0
  156. package/dist/impl-s5h7dIlv2.mjs +2 -0
  157. package/dist/{impl-oNhkS5zO2.mjs.map → impl-s5h7dIlv2.mjs.map} +1 -1
  158. package/dist/impl-uKjAibIR.mjs +2 -0
  159. package/dist/impl-uKjAibIR.mjs.map +1 -0
  160. package/dist/impl-wf0PvJms.mjs +2 -0
  161. package/dist/impl-wf0PvJms.mjs.map +1 -0
  162. package/dist/impl-xRwX5ZLK.mjs +2 -0
  163. package/dist/impl-xRwX5ZLK.mjs.map +1 -0
  164. package/dist/index.d.mts +142 -78
  165. package/dist/index.d.mts.map +1 -1
  166. package/dist/index.mjs +3 -3
  167. package/dist/index.mjs.map +1 -1
  168. package/dist/initializeCliRuntime-B7zDhMok.mjs +2 -0
  169. package/dist/initializeCliRuntime-B7zDhMok.mjs.map +1 -0
  170. package/dist/{inquirer-B0OF_nRe.mjs → inquirer-DNa31Mkx.mjs} +2 -2
  171. package/dist/{inquirer-B0OF_nRe.mjs.map → inquirer-DNa31Mkx.mjs.map} +1 -1
  172. package/dist/listFiles-DrxRhlZ2.mjs +2 -0
  173. package/dist/listFiles-DrxRhlZ2.mjs.map +1 -0
  174. package/dist/logger-CB_h_zbj.mjs +2 -0
  175. package/dist/logger-CB_h_zbj.mjs.map +1 -0
  176. package/dist/mapConsentCsvRowsToInputs-DA7BRD7M.mjs +2 -0
  177. package/dist/mapConsentCsvRowsToInputs-DA7BRD7M.mjs.map +1 -0
  178. package/dist/{markRequestDataSiloIdsCompleted-BvfxBmzu.mjs → markRequestDataSiloIdsCompleted-CK7PNwTz.mjs} +2 -2
  179. package/dist/{markRequestDataSiloIdsCompleted-BvfxBmzu.mjs.map → markRequestDataSiloIdsCompleted-CK7PNwTz.mjs.map} +1 -1
  180. package/dist/{markSilentPrivacyRequests-CRGg650V.mjs → markSilentPrivacyRequests-Cb-J9ckA.mjs} +2 -2
  181. package/dist/{markSilentPrivacyRequests-CRGg650V.mjs.map → markSilentPrivacyRequests-Cb-J9ckA.mjs.map} +1 -1
  182. package/dist/{mergeTranscendInputs-DjPe49yR.mjs → mergeTranscendInputs-CkpitZbH.mjs} +2 -2
  183. package/dist/{mergeTranscendInputs-DjPe49yR.mjs.map → mergeTranscendInputs-CkpitZbH.mjs.map} +1 -1
  184. package/dist/{notifyPrivacyRequestsAdditionalTime-vHikIxVO.mjs → notifyPrivacyRequestsAdditionalTime-it1FA62W.mjs} +2 -2
  185. package/dist/{notifyPrivacyRequestsAdditionalTime-vHikIxVO.mjs.map → notifyPrivacyRequestsAdditionalTime-it1FA62W.mjs.map} +1 -1
  186. package/dist/{parquetToCsvOneFile-0O4iLz0t.mjs → parquetToCsvOneFile-Dtz90qfJ.mjs} +2 -2
  187. package/dist/{parquetToCsvOneFile-0O4iLz0t.mjs.map → parquetToCsvOneFile-Dtz90qfJ.mjs.map} +1 -1
  188. package/dist/{parseAttributesFromString-CYcxsS3n.mjs → parseAttributesFromString-BxJcnKmn.mjs} +2 -2
  189. package/dist/{parseAttributesFromString-CYcxsS3n.mjs.map → parseAttributesFromString-BxJcnKmn.mjs.map} +1 -1
  190. package/dist/{parseVariablesFromString-B4TUkJRF.mjs → parseVariablesFromString-cu5gPC3M.mjs} +1 -1
  191. package/dist/{parseVariablesFromString-B4TUkJRF.mjs.map → parseVariablesFromString-cu5gPC3M.mjs.map} +1 -1
  192. package/dist/{pullAllDatapoints-DJno8LkB.mjs → pullAllDatapoints-XqreMBT5.mjs} +2 -2
  193. package/dist/{pullAllDatapoints-DJno8LkB.mjs.map → pullAllDatapoints-XqreMBT5.mjs.map} +1 -1
  194. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DE7vqkyt.mjs → pullChunkedCustomSiloOutstandingIdentifiers-DuPDOm6f.mjs} +2 -2
  195. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DE7vqkyt.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-DuPDOm6f.mjs.map} +1 -1
  196. package/dist/{pullConsentManagerMetrics-C41UhU8u.mjs → pullConsentManagerMetrics-Dk5IejaY.mjs} +2 -2
  197. package/dist/{pullConsentManagerMetrics-C41UhU8u.mjs.map → pullConsentManagerMetrics-Dk5IejaY.mjs.map} +1 -1
  198. package/dist/{pullManualEnrichmentIdentifiersToCsv-DXYFOoqY.mjs → pullManualEnrichmentIdentifiersToCsv-CAD1navz.mjs} +2 -2
  199. package/dist/{pullManualEnrichmentIdentifiersToCsv-DXYFOoqY.mjs.map → pullManualEnrichmentIdentifiersToCsv-CAD1navz.mjs.map} +1 -1
  200. package/dist/{pullTranscendConfiguration-DbRVLKq5.mjs → pullTranscendConfiguration-NcFjHE8k.mjs} +2 -2
  201. package/dist/{pullTranscendConfiguration-DbRVLKq5.mjs.map → pullTranscendConfiguration-NcFjHE8k.mjs.map} +1 -1
  202. package/dist/{pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs → pullUnstructuredSubDataPointRecommendations-Cf4irXl4.mjs} +2 -2
  203. package/dist/{pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs.map → pullUnstructuredSubDataPointRecommendations-Cf4irXl4.mjs.map} +1 -1
  204. package/dist/pushCronIdentifiersFromCsv-BGaJycWo.mjs +2 -0
  205. package/dist/{pushCronIdentifiersFromCsv-BCyj2uxq.mjs.map → pushCronIdentifiersFromCsv-BGaJycWo.mjs.map} +1 -1
  206. package/dist/pushManualEnrichmentIdentifiersFromCsv-B9okRkhL.mjs +2 -0
  207. package/dist/{pushManualEnrichmentIdentifiersFromCsv-EFfarcCs.mjs.map → pushManualEnrichmentIdentifiersFromCsv-B9okRkhL.mjs.map} +1 -1
  208. package/dist/readCsv-CmRYYFJc.mjs +2 -0
  209. package/dist/readCsv-CmRYYFJc.mjs.map +1 -0
  210. package/dist/{readTranscendYaml-bL1qFPqv.mjs → readTranscendYaml-DtJz9mor.mjs} +3 -3
  211. package/dist/readTranscendYaml-DtJz9mor.mjs.map +1 -0
  212. package/dist/{removeUnverifiedRequestIdentifiers-DqXcSHOr.mjs → removeUnverifiedRequestIdentifiers-DJhxiy_D.mjs} +2 -2
  213. package/dist/{removeUnverifiedRequestIdentifiers-DqXcSHOr.mjs.map → removeUnverifiedRequestIdentifiers-DJhxiy_D.mjs.map} +1 -1
  214. package/dist/{request-BIplTb3L.mjs → request-CCCU2SdV.mjs} +1 -1
  215. package/dist/{request-BIplTb3L.mjs.map → request-CCCU2SdV.mjs.map} +1 -1
  216. package/dist/{retryRequestDataSilos-DDdC7nXr.mjs → retryRequestDataSilos-6JfyZclD.mjs} +2 -2
  217. package/dist/{retryRequestDataSilos-DDdC7nXr.mjs.map → retryRequestDataSilos-6JfyZclD.mjs.map} +1 -1
  218. package/dist/runOpa-Q2r3qPsi.mjs +2 -0
  219. package/dist/runOpa-Q2r3qPsi.mjs.map +1 -0
  220. package/dist/{skipPreflightJobs-Cl98mx0Z.mjs → skipPreflightJobs-xpbtJ3dK.mjs} +2 -2
  221. package/dist/{skipPreflightJobs-Cl98mx0Z.mjs.map → skipPreflightJobs-xpbtJ3dK.mjs.map} +1 -1
  222. package/dist/{skipRequestDataSilos-mxRGsUpY.mjs → skipRequestDataSilos-B7RA6I3Z.mjs} +2 -2
  223. package/dist/{skipRequestDataSilos-mxRGsUpY.mjs.map → skipRequestDataSilos-B7RA6I3Z.mjs.map} +1 -1
  224. package/dist/{streamPrivacyRequestsToCsv-Dbu1NoDu.mjs → streamPrivacyRequestsToCsv-DT31SP6w.mjs} +2 -2
  225. package/dist/{streamPrivacyRequestsToCsv-Dbu1NoDu.mjs.map → streamPrivacyRequestsToCsv-DT31SP6w.mjs.map} +1 -1
  226. package/dist/{syncCodePackages-Dhm5jI6B.mjs → syncCodePackages-ozt9aBXf.mjs} +2 -2
  227. package/dist/{syncCodePackages-Dhm5jI6B.mjs.map → syncCodePackages-ozt9aBXf.mjs.map} +1 -1
  228. package/dist/{updateConsentManagerVersionToLatest-BbSaHE83.mjs → updateConsentManagerVersionToLatest-CCzWEBEj.mjs} +2 -2
  229. package/dist/{updateConsentManagerVersionToLatest-BbSaHE83.mjs.map → updateConsentManagerVersionToLatest-CCzWEBEj.mjs.map} +1 -1
  230. package/dist/{uploadConsents-DAUUuqxb.mjs → uploadConsents-CDqFNWX_.mjs} +2 -2
  231. package/dist/{uploadConsents-DAUUuqxb.mjs.map → uploadConsents-CDqFNWX_.mjs.map} +1 -1
  232. package/dist/{uploadPrivacyRequestsFromCsv-CT-zfd4U.mjs → uploadPrivacyRequestsFromCsv-CVpBFaYB.mjs} +2 -2
  233. package/dist/{uploadPrivacyRequestsFromCsv-CT-zfd4U.mjs.map → uploadPrivacyRequestsFromCsv-CVpBFaYB.mjs.map} +1 -1
  234. package/dist/validateTranscendAuth-3guZJPKH.mjs +2 -0
  235. package/dist/validateTranscendAuth-3guZJPKH.mjs.map +1 -0
  236. package/dist/{writeCsv-DMw5OmWp.mjs → writeCsv-rhlEBjYp.mjs} +1 -1
  237. package/dist/{writeCsv-DMw5OmWp.mjs.map → writeCsv-rhlEBjYp.mjs.map} +1 -1
  238. package/package.json +4 -4
  239. package/dist/collectCsvFilesOrExit-BPo8Mjy7.mjs +0 -2
  240. package/dist/collectCsvFilesOrExit-BPo8Mjy7.mjs.map +0 -1
  241. package/dist/collectParquetFilesOrExit-DVS9_OSv.mjs +0 -2
  242. package/dist/collectParquetFilesOrExit-DVS9_OSv.mjs.map +0 -1
  243. package/dist/consentManagersToBusinessEntities-rf8_xu71.mjs +0 -5
  244. package/dist/consentManagersToBusinessEntities-rf8_xu71.mjs.map +0 -1
  245. package/dist/context-Br0NHHOk.mjs +0 -2
  246. package/dist/context-Br0NHHOk.mjs.map +0 -1
  247. package/dist/createExtraKeyHandler-ComtD6CG.mjs +0 -14
  248. package/dist/createExtraKeyHandler-ComtD6CG.mjs.map +0 -1
  249. package/dist/done-input-validation-DL31vk7g.mjs +0 -2
  250. package/dist/done-input-validation-DL31vk7g.mjs.map +0 -1
  251. package/dist/impl-4Habov2V.mjs +0 -2
  252. package/dist/impl-4Habov2V.mjs.map +0 -1
  253. package/dist/impl-7pxeoDZg.mjs +0 -5
  254. package/dist/impl-7pxeoDZg.mjs.map +0 -1
  255. package/dist/impl-B0-rCxY1.mjs +0 -2
  256. package/dist/impl-B0oCwFpP2.mjs +0 -2
  257. package/dist/impl-B24TOrY-.mjs.map +0 -1
  258. package/dist/impl-B2eZGemA.mjs +0 -2
  259. package/dist/impl-B2eZGemA.mjs.map +0 -1
  260. package/dist/impl-B3whGgMU2.mjs +0 -2
  261. package/dist/impl-B7ceQwag.mjs +0 -2
  262. package/dist/impl-B7ceQwag.mjs.map +0 -1
  263. package/dist/impl-B7qkiYZY2.mjs +0 -2
  264. package/dist/impl-BTFeQDKS.mjs +0 -2
  265. package/dist/impl-BTFeQDKS.mjs.map +0 -1
  266. package/dist/impl-B_s0saYs2.mjs +0 -2
  267. package/dist/impl-B_s0saYs2.mjs.map +0 -1
  268. package/dist/impl-BeoY4iKA.mjs +0 -2
  269. package/dist/impl-BeoY4iKA.mjs.map +0 -1
  270. package/dist/impl-BmQR1Pae.mjs +0 -3
  271. package/dist/impl-BmQR1Pae.mjs.map +0 -1
  272. package/dist/impl-BnzPrDmM.mjs +0 -2
  273. package/dist/impl-BnzPrDmM.mjs.map +0 -1
  274. package/dist/impl-BoZZp_W8.mjs +0 -2
  275. package/dist/impl-BoZZp_W8.mjs.map +0 -1
  276. package/dist/impl-BohgbWOH.mjs +0 -2
  277. package/dist/impl-BohgbWOH.mjs.map +0 -1
  278. package/dist/impl-Bur_bNXN.mjs +0 -2
  279. package/dist/impl-Bur_bNXN.mjs.map +0 -1
  280. package/dist/impl-BwuWn3TM.mjs +0 -2
  281. package/dist/impl-BwuWn3TM.mjs.map +0 -1
  282. package/dist/impl-BxQE7dL92.mjs +0 -2
  283. package/dist/impl-BxQE7dL92.mjs.map +0 -1
  284. package/dist/impl-ByeEmvdo.mjs +0 -2
  285. package/dist/impl-BzhraaBB2.mjs +0 -2
  286. package/dist/impl-C3S5iupW2.mjs +0 -2
  287. package/dist/impl-C3f_H_77.mjs +0 -3
  288. package/dist/impl-C3f_H_77.mjs.map +0 -1
  289. package/dist/impl-CAAQ0OKP2.mjs +0 -2
  290. package/dist/impl-CDGqGw3I.mjs +0 -2
  291. package/dist/impl-CDGqGw3I.mjs.map +0 -1
  292. package/dist/impl-CJpPjFIi2.mjs +0 -2
  293. package/dist/impl-CKQu30cA2.mjs +0 -2
  294. package/dist/impl-CQCQSmNx2.mjs +0 -2
  295. package/dist/impl-CQCQSmNx2.mjs.map +0 -1
  296. package/dist/impl-CZG9gzzR.mjs +0 -3
  297. package/dist/impl-CZG9gzzR.mjs.map +0 -1
  298. package/dist/impl-Chska4J8.mjs +0 -3
  299. package/dist/impl-Chska4J8.mjs.map +0 -1
  300. package/dist/impl-CkoQHhc8.mjs +0 -12
  301. package/dist/impl-CkoQHhc8.mjs.map +0 -1
  302. package/dist/impl-Cl3hf0Pd.mjs +0 -2
  303. package/dist/impl-Cl3hf0Pd.mjs.map +0 -1
  304. package/dist/impl-CnrK11Gr2.mjs +0 -2
  305. package/dist/impl-CnrK11Gr2.mjs.map +0 -1
  306. package/dist/impl-CoKWGTEu2.mjs +0 -2
  307. package/dist/impl-CoKWGTEu2.mjs.map +0 -1
  308. package/dist/impl-Cpirdh8t2.mjs +0 -2
  309. package/dist/impl-Cpirdh8t2.mjs.map +0 -1
  310. package/dist/impl-D0-ioxpZ.mjs +0 -2
  311. package/dist/impl-D0-ioxpZ.mjs.map +0 -1
  312. package/dist/impl-DBK5c6d0.mjs +0 -2
  313. package/dist/impl-DBK5c6d0.mjs.map +0 -1
  314. package/dist/impl-DEZrkNw9.mjs +0 -2
  315. package/dist/impl-DEZrkNw9.mjs.map +0 -1
  316. package/dist/impl-DK0UUhuK2.mjs +0 -2
  317. package/dist/impl-DLWhxaMi.mjs +0 -2
  318. package/dist/impl-DLWhxaMi.mjs.map +0 -1
  319. package/dist/impl-DmODS2cY.mjs +0 -2
  320. package/dist/impl-DmODS2cY.mjs.map +0 -1
  321. package/dist/impl-DoY3Yb0D.mjs +0 -2
  322. package/dist/impl-DoY3Yb0D.mjs.map +0 -1
  323. package/dist/impl-DojHsd-e2.mjs +0 -2
  324. package/dist/impl-DojHsd-e2.mjs.map +0 -1
  325. package/dist/impl-DvSnW_IA.mjs +0 -7
  326. package/dist/impl-QK9-ui6X.mjs.map +0 -1
  327. package/dist/impl-RwrRqICz.mjs +0 -3
  328. package/dist/impl-RwrRqICz.mjs.map +0 -1
  329. package/dist/impl-XKBP7s772.mjs +0 -2
  330. package/dist/impl-eW9ZxuVu2.mjs +0 -3
  331. package/dist/impl-hGwy9khM2.mjs +0 -2
  332. package/dist/impl-oNhkS5zO2.mjs +0 -2
  333. package/dist/impl-rXmcMRG5.mjs +0 -2
  334. package/dist/impl-rXmcMRG5.mjs.map +0 -1
  335. package/dist/impl-wJEOzIpn.mjs +0 -2
  336. package/dist/impl-wJEOzIpn.mjs.map +0 -1
  337. package/dist/impl-xIb20rTt.mjs +0 -2
  338. package/dist/impl-xIb20rTt.mjs.map +0 -1
  339. package/dist/listFiles-C5kubvdN.mjs +0 -2
  340. package/dist/listFiles-C5kubvdN.mjs.map +0 -1
  341. package/dist/logger-Ckep4QXn.mjs +0 -2
  342. package/dist/logger-Ckep4QXn.mjs.map +0 -1
  343. package/dist/pushCronIdentifiersFromCsv-BCyj2uxq.mjs +0 -2
  344. package/dist/pushManualEnrichmentIdentifiersFromCsv-EFfarcCs.mjs +0 -2
  345. package/dist/readCsv--FfP8n-H.mjs +0 -2
  346. package/dist/readCsv--FfP8n-H.mjs.map +0 -1
  347. package/dist/readTranscendYaml-bL1qFPqv.mjs.map +0 -1
  348. package/dist/runOpa-D511z37u.mjs +0 -2
  349. package/dist/runOpa-D511z37u.mjs.map +0 -1
  350. package/dist/uploadCookiesFromCsv-tEobd_k1.mjs +0 -2
  351. package/dist/uploadCookiesFromCsv-tEobd_k1.mjs.map +0 -1
  352. package/dist/uploadDataFlowsFromCsv-B9Mcdixu.mjs +0 -2
  353. package/dist/uploadDataFlowsFromCsv-B9Mcdixu.mjs.map +0 -1
  354. package/dist/validateTranscendAuth-CAO5ktnu.mjs +0 -2
  355. package/dist/validateTranscendAuth-CAO5ktnu.mjs.map +0 -1
@@ -1,3 +0,0 @@
1
- import{t as e}from"./buildExamples-9cTRehd1.mjs";import{r as t}from"./policyEngineCliError-BnBghLd1.mjs";import{n,t as r}from"./constants-FbK2iR--.mjs";import{r as i,t as a}from"./runOpa-D511z37u.mjs";import{i as o,n as s,t as c}from"./printResult-oXnpZu_9.mjs";import{t as l}from"./formatPolicyBundleVersionSummary-Bo7DYxoy.mjs";import{n as u}from"./resolveBundleIdByName-By5Vl8Iz.mjs";import{t as d}from"./logger-Ckep4QXn.mjs";import{n as f}from"./inquirer-B0OF_nRe.mjs";import{t as p}from"./done-input-validation-DL31vk7g.mjs";import{spawnSync as m}from"node:child_process";import h from"node:fs";import g from"node:os";import _ from"node:path";import{gunzipSync as v}from"node:zlib";import y from"fast-glob";import b from"colors";function x(e){return e.endsWith(`.rego`)&&!e.endsWith(`_test.rego`)}function S(e){let t=_.join(e,`manifest.json`);if(!h.existsSync(t))throw Error(`Policy bundle directory must contain a manifest.json file.`);let n=h.readFileSync(t,`utf8`),r;try{r=JSON.parse(n)}catch(e){throw Error(`manifest.json is not valid JSON: ${e instanceof Error?e.message:String(e)}`,{cause:e})}if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`manifest.json must contain a JSON object.`);let i=r.roots;if(!Array.isArray(i)||i.length===0)throw Error(`manifest.json must declare "roots" as a non-empty array of strings (e.g. {"roots":["policy_engine"]}).`);if(!i.every(e=>typeof e==`string`&&e.length>0))throw Error(`manifest.json "roots" must be an array of non-empty strings.`);return{roots:i}}function C(e){let t=S(e),n=y.sync(`**/*.rego`,{cwd:e,onlyFiles:!0,dot:!1}).filter(x);if(n.length===0)throw Error(`Policy bundle directory must contain at least one .rego policy file.`);return{entries:[`manifest.json`,...n.sort()],manifest:t}}const w=/^\s*package\s+([A-Za-z_][\w.]*)/m;function T(e){return e.replace(/\//g,`.`)}function E(e){let t=h.readFileSync(e,`utf8`);return w.exec(t)?.[1]}function D(e,t,n){let r=n.map(T),i=[];for(let a of t){let t=E(_.join(e,a));t&&(r.some(e=>t===e||t.startsWith(`${e}.`))||i.push(` - ${a} (package ${t}) is not covered by roots [${n.join(`, `)}]`))}if(i.length>0)throw Error([`manifest.json "roots" do not cover all Rego packages in the bundle; uncovered packages will fail-closed at decide time. Either broaden "roots" or move the policy under a covered package:`,...i].join(`
2
- `))}async function O(e){let t=_.join(g.tmpdir(),`transcend-policy-bundle-build-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`);try{let{code:n,stderr:r}=await a([`build`,`--v0-compatible`,`--ignore`,`*_test.rego`,`-o`,t,`.`],{cwd:e});if(n!==0)throw Error(r.trim()||`opa build failed with exit code ${n}`)}finally{h.existsSync(t)&&h.unlinkSync(t)}}function k(e){if(e<1024)return`${e} B`;let t=e/1024;if(t<1024)return`${t%1==0?t.toFixed(0):t.toFixed(1)} KiB`;let n=t/1024;return`${n%1==0?n.toFixed(0):n.toFixed(1)} MiB`}async function A(e){i();let t=_.resolve(e);if(!h.existsSync(t)||!h.statSync(t).isDirectory())throw Error(`Policy directory does not exist or is not a directory: ${t}`);let{entries:o,manifest:s}=C(t);D(t,o.filter(e=>e!==`manifest.json`),s.roots);let{code:c,stderr:l}=await a([`check`,`--strict`,`--v0-compatible`,t]);if(c!==0)throw Error(l.trim()||`opa check failed with exit code ${c}`);await O(t);let u=_.join(g.tmpdir(),`transcend-policy-bundle-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`),d=m(`tar`,[`-czf`,u,`-C`,t,...o],{env:{...process.env,COPYFILE_DISABLE:`1`},encoding:`utf8`});if(d.status!==0)throw Error(`Failed to create policy bundle archive: ${d.stderr.trim()||`tar failed`}`);let f=h.readFileSync(u);if(f.byteLength>5120)throw h.unlinkSync(u),Error(`Policy bundle exceeds the ${k(r)} compressed upload limit (bundle is ${k(f.byteLength)}). The server also rejects decompressed bundles larger than ${k(n)}.`);let p=v(f);if(p.byteLength>51200)throw h.unlinkSync(u),Error(`Policy bundle exceeds the ${k(n)} decompressed upload limit (bundle is ${k(p.byteLength)} decompressed).`);return u}function j(e){let t=h.readFileSync(e.bundlePath),n=new FormData;return n.append(`bundle`,new Blob([t],{type:`application/gzip`}),_.basename(e.bundlePath)),n.append(`version`,e.version),e.description&&n.append(`description`,e.description),e.bundleName&&n.append(`bundleName`,e.bundleName),n}function M(e){return e.toISOString().slice(0,19).replace(/[T:]/g,`-`)}function N(e,t=new Date){return`${e}-${M(t)}`}async function P({dir:n,"bundle-name":r,auth:i,"transcend-url":a,version:m,description:g,json:v,yes:y,debug:x=!1}){p(this.process.exit),t(x);let S=_.resolve(n),C=m??N(r),w=o(a,i),T;try{d.info(b.green(`Building policy bundle from ${S}...`)),T=await A(S);let t=await u(w,r),n;if(t){d.info(b.green(`Uploading new version for bundle "${r}"...`));let e=j({bundlePath:T,version:C,description:g});n=await s(w.post(`v1/policy-engine/policy-bundles/${t}/versions`,{body:e}).json())}else{if(!this.process.stdin.isTTY&&!y){d.error(b.red(`Cannot create a new bundle in a non-interactive environment; pass --yes to confirm.`)),this.process.exit(1);return}if(!y&&(d.warn(b.yellow(`No policy bundle named "${r}" exists for this organization.`)),!await f({message:`No policy bundle named "${r}" exists. Create a new bundle and upload its first version?`}))){d.info(b.yellow(`Publish cancelled.`));return}d.info(b.green(`Creating bundle "${r}" and uploading first version...`));let e=j({bundlePath:T,version:C,description:g,bundleName:r});n=await s(w.post(`v1/policy-engine/policy-bundles`,{body:e}).json())}c(this.process.stdout,{json:v,data:n,renderTable:()=>l(n.version)}),d.info(b.green(`Policy bundle version uploaded successfully.`));let i=e([`policy`,`activate`],{version:n.version.version,"bundle-name":r});d.info(b.yellow(`Publishing a policy does not activate it. To activate this version, run:\n ${i}`))}finally{T&&h.existsSync(T)&&h.unlinkSync(T)}}export{P as publish};
3
- //# sourceMappingURL=impl-eW9ZxuVu2.mjs.map
@@ -1,2 +0,0 @@
1
- import{t as e}from"./pushCronIdentifiersFromCsv-BCyj2uxq.mjs";import{t}from"./done-input-validation-DL31vk7g.mjs";async function n({file:n,transcendUrl:r,auth:i,sombraAuth:a,dataSiloId:o}){t(this.process.exit),await e({file:n,transcendUrl:r,auth:i,sombraAuth:a,dataSiloId:o})}export{n as markIdentifiersCompleted};
2
- //# sourceMappingURL=impl-hGwy9khM2.mjs.map
@@ -1,2 +0,0 @@
1
- import{t as e}from"./approvePrivacyRequests-DYW20j6q.mjs";import{t}from"./done-input-validation-DL31vk7g.mjs";async function n({auth:n,actions:r,origins:i,silentModeBefore:a,createdAtBefore:o,createdAtAfter:s,updatedAtBefore:c,updatedAtAfter:l,transcendUrl:u,concurrency:d}){t(this.process.exit),await e({transcendUrl:u,requestActions:r,auth:n,requestOrigins:i,concurrency:d,silentModeBefore:a,createdAtBefore:o,createdAtAfter:s,updatedAtBefore:c,updatedAtAfter:l})}export{n as approve};
2
- //# sourceMappingURL=impl-oNhkS5zO2.mjs.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./constants-DKKXqoSr.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{s as n}from"./writeCsv-DMw5OmWp.mjs";import{t as r}from"./pullAllDatapoints-DJno8LkB.mjs";import{t as i}from"./done-input-validation-DL31vk7g.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-rXmcMRG5.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-rXmcMRG5.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,EAER,CAAE,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,GAEuB,CAAE,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,2 +0,0 @@
1
- import{i as e}from"./enums-OiLcZ26O.mjs";import{r as t}from"./constants-DKKXqoSr.mjs";import{n,t as r}from"./command-3eoWijOv.mjs";import{t as i}from"./logger-Ckep4QXn.mjs";import{a}from"./readTranscendYaml-bL1qFPqv.mjs";import{n as o}from"./pullTranscendConfiguration-DbRVLKq5.mjs";import{t as s}from"./validateTranscendAuth-CAO5ktnu.mjs";import{t as c}from"./done-input-validation-DL31vk7g.mjs";import l from"node:fs";import{join as u}from"node:path";import d from"colors";import{buildTranscendGraphQLClient as f}from"@transcend-io/sdk";import{mapSeries as p}from"@transcend-io/utils";async function m({auth:m,resources:h=n,file:g,transcendUrl:_,dataSiloIds:v=[],integrationNames:y=[],trackerStatuses:b=r,pageSize:x,skipDatapoints:S,skipSubDatapoints:C,includeGuessedCategories:w,debug:T}){c(this.process.exit);let E=await s(m),D=h.includes(`all`)?Object.values(e):h;if(typeof E==`string`){try{let e=await o(f(_,E),{dataSiloIds:v,integrationNames:y,resources:D,pageSize:x,debug:T,skipDatapoints:S,skipSubDatapoints:C,includeGuessedCategories:w,trackerStatuses:b});i.info(d.magenta(`Writing configuration to file "${g}"...`)),a(g,e)}catch(e){i.error(d.red(`An error occurred syncing the schema: ${T?e.stack:e.message}`)),this.process.exit(1)}i.info(d.green(`Successfully synced yaml file to disk at ${g}! View at ${t}`))}else{if(!l.lstatSync(g).isDirectory())throw Error(`File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/`);let e=[];await p(E,async(t,n)=>{let r=`[${n+1}/${E.length}][${t.organizationName}] `;i.info(d.magenta(`~~~\n\n${r}Attempting to pull configuration...\n\n~~~`));let s=f(_,t.apiKey);try{let e=await o(s,{dataSiloIds:v,integrationNames:y,resources:D,pageSize:x,debug:T,skipDatapoints:S,skipSubDatapoints:C,includeGuessedCategories:w,trackerStatuses:b}),n=u(g,`${t.organizationName}.yml`);i.info(d.magenta(`Writing configuration to file "${n}"...`)),a(n,e),i.info(d.green(`${r}Successfully pulled configuration!`))}catch(n){i.error(d.red(`${r}Failed to sync configuration. - ${n.message}`)),e.push(t.organizationName)}}),e.length>0&&(i.info(d.red(`Sync encountered errors for "${e.join(`,`)}". View output above for more information, or check out ${t}`)),this.process.exit(1))}}export{m as pull};
2
- //# sourceMappingURL=impl-wJEOzIpn.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-wJEOzIpn.mjs","names":[],"sources":["../src/commands/inventory/pull/impl.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { join } from 'node:path';\n\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { TranscendPullResource } from '../../../enums.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullTranscendConfiguration } from '../../../lib/graphql/index.js';\nimport { writeTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\nimport { DEFAULT_CONSENT_TRACKER_STATUSES, DEFAULT_TRANSCEND_PULL_RESOURCES } from './command.js';\n\nexport interface PullCommandFlags {\n auth: string;\n resources?: (TranscendPullResource | 'all')[];\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n integrationNames?: string[];\n trackerStatuses?: ConsentTrackerStatus[];\n pageSize: number;\n skipDatapoints: boolean;\n skipSubDatapoints: boolean;\n includeGuessedCategories: boolean;\n debug: boolean;\n}\n\nexport async function pull(\n this: LocalContext,\n {\n auth,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n file,\n transcendUrl,\n dataSiloIds = [],\n integrationNames = [],\n trackerStatuses = DEFAULT_CONSENT_TRACKER_STATUSES,\n pageSize,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n debug,\n }: PullCommandFlags,\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 const resourcesToPull: TranscendPullResource[] = resources.includes('all')\n ? Object.values(TranscendPullResource)\n : (resources as TranscendPullResource[]);\n\n // Sync to Disk\n if (typeof apiKeyOrList === 'string') {\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList);\n\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n writeTranscendYaml(file, configuration);\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the schema: ${debug ? err.stack : err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to disk at ${file}! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\n if (!fs.lstatSync(file).isDirectory()) {\n throw new Error(\n 'File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/',\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 pull configuration...\\n\\n~~~`));\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n const filePath = join(file, `${apiKey.organizationName}.yml`);\n logger.info(colors.magenta(`Writing configuration to file \"${filePath}\"...`));\n writeTranscendYaml(filePath, configuration);\n\n logger.info(colors.green(`${prefix}Successfully pulled configuration!`));\n } catch (err) {\n logger.error(colors.red(`${prefix}Failed to sync configuration. - ${err.message}`));\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"],"mappings":"2kBAiCA,eAAsB,EAEpB,CACE,OACA,YAAY,EACZ,OACA,eACA,cAAc,EAAE,CAChB,mBAAmB,EAAE,CACrB,kBAAkB,EAClB,WACA,iBACA,oBACA,2BACA,SAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAe,MAAM,EAAsB,EAAK,CAEhD,EAA2C,EAAU,SAAS,MAAM,CACtE,OAAO,OAAO,EAAsB,CACnC,EAGL,GAAI,OAAO,GAAiB,SAAU,CACpC,GAAI,CAIF,IAAM,EAAgB,MAAM,EAFb,EAA4B,EAAc,EAEI,CAAE,CAC7D,cACA,mBACA,UAAW,EACX,WACA,QACA,iBACA,oBACA,2BACA,kBACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,kCAAkC,EAAK,MAAM,CAAC,CACzE,EAAmB,EAAM,EAAc,OAChC,EAAK,CACZ,EAAO,MACL,EAAO,IAAI,yCAAyC,EAAQ,EAAI,MAAQ,EAAI,UAAU,CACvF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAO,KACL,EAAO,MACL,4CAA4C,EAAK,YAAY,IAC9D,CACF,KACI,CACL,GAAI,CAAC,EAAG,UAAU,EAAK,CAAC,aAAa,CACnC,MAAU,MACR,0GACD,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,EAAS,EAA4B,EAAc,EAAO,OAAO,CAEvE,GAAI,CACF,IAAM,EAAgB,MAAM,EAA2B,EAAQ,CAC7D,cACA,mBACA,UAAW,EACX,WACA,QACA,iBACA,oBACA,2BACA,kBACD,CAAC,CAEI,EAAW,EAAK,EAAM,GAAG,EAAO,iBAAiB,MAAM,CAC7D,EAAO,KAAK,EAAO,QAAQ,kCAAkC,EAAS,MAAM,CAAC,CAC7E,EAAmB,EAAU,EAAc,CAE3C,EAAO,KAAK,EAAO,MAAM,GAAG,EAAO,oCAAoC,CAAC,OACjE,EAAK,CACZ,EAAO,MAAM,EAAO,IAAI,GAAG,EAAO,kCAAkC,EAAI,UAAU,CAAC,CACnF,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"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./logger-Ckep4QXn.mjs";import{a as t,r as n}from"./readTranscendYaml-bL1qFPqv.mjs";import{t as r}from"./consentManagersToBusinessEntities-rf8_xu71.mjs";import{t as i}from"./listFiles-C5kubvdN.mjs";import{t as a}from"./done-input-validation-DL31vk7g.mjs";import{existsSync as o,lstatSync as s}from"node:fs";import{join as c}from"node:path";import l from"colors";function u({consentManagerYmlFolder:u,output:d}){a(this.process.exit),(!o(u)||!s(u).isDirectory())&&(e.error(l.red(`Folder does not exist: "${u}"`)),this.process.exit(1));let f=r(i(u).map(e=>{let{"consent-manager":t}=n(c(u,e));return{name:e,input:t}}));t(d,{"business-entities":f}),e.info(l.green(`Successfully wrote ${f.length} business entities to file "${d}"`))}export{u as consentManagersToBusinessEntities};
2
- //# sourceMappingURL=impl-xIb20rTt.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-xIb20rTt.mjs","names":["consentManagersToBusinessEntitiesHelper"],"sources":["../src/commands/inventory/consent-managers-to-business-entities/impl.ts"],"sourcesContent":["import { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { listFiles } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { consentManagersToBusinessEntities as consentManagersToBusinessEntitiesHelper } from '../../../lib/consent-manager/index.js';\nimport { readTranscendYaml, writeTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\n\nexport interface ConsentManagersToBusinessEntitiesCommandFlags {\n consentManagerYmlFolder: string;\n output: string;\n}\n\nexport function consentManagersToBusinessEntities(\n this: LocalContext,\n { consentManagerYmlFolder, output }: ConsentManagersToBusinessEntitiesCommandFlags,\n): void {\n doneInputValidation(this.process.exit);\n\n // Ensure folder is passed\n if (!existsSync(consentManagerYmlFolder) || !lstatSync(consentManagerYmlFolder).isDirectory()) {\n logger.error(colors.red(`Folder does not exist: \"${consentManagerYmlFolder}\"`));\n this.process.exit(1);\n }\n\n // Read in each consent manager configuration\n const inputs = listFiles(consentManagerYmlFolder).map((directory) => {\n const { 'consent-manager': consentManager } = readTranscendYaml(\n join(consentManagerYmlFolder, directory),\n );\n return { name: directory, input: consentManager };\n });\n\n // Convert to business entities\n const businessEntities = consentManagersToBusinessEntitiesHelper(inputs);\n\n // write to disk\n writeTranscendYaml(output, {\n 'business-entities': businessEntities,\n });\n\n logger.info(\n colors.green(\n `Successfully wrote ${businessEntities.length} business entities to file \"${output}\"`,\n ),\n );\n}\n"],"mappings":"4XAiBA,SAAgB,EAEd,CAAE,0BAAyB,UACrB,CACN,EAAoB,KAAK,QAAQ,KAAK,EAGlC,CAAC,EAAW,EAAwB,EAAI,CAAC,EAAU,EAAwB,CAAC,aAAa,IAC3F,EAAO,MAAM,EAAO,IAAI,2BAA2B,EAAwB,GAAG,CAAC,CAC/E,KAAK,QAAQ,KAAK,EAAE,EAYtB,IAAM,EAAmBA,EARV,EAAU,EAAwB,CAAC,IAAK,GAAc,CACnE,GAAM,CAAE,kBAAmB,GAAmB,EAC5C,EAAK,EAAyB,EAAU,CACzC,CACD,MAAO,CAAE,KAAM,EAAW,MAAO,EAAgB,EAIoB,CAAC,CAGxE,EAAmB,EAAQ,CACzB,oBAAqB,EACtB,CAAC,CAEF,EAAO,KACL,EAAO,MACL,sBAAsB,EAAiB,OAAO,8BAA8B,EAAO,GACpF,CACF"}
@@ -1,2 +0,0 @@
1
- import{existsSync as e,readdirSync as t}from"node:fs";function n(n,r,i=!1){if(!e(n))return[];let a=t(n).filter(e=>r?r.filter(t=>e.endsWith(t)).length:!0).filter(e=>e.indexOf(`.`)>0);return i?a.map(e=>e.replace(/\.[^/.]+$/,``)):a}export{n as t};
2
- //# sourceMappingURL=listFiles-C5kubvdN.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listFiles-C5kubvdN.mjs","names":[],"sources":["../src/lib/api-keys/listFiles.ts"],"sourcesContent":["import { existsSync, readdirSync } from 'node:fs';\n\n/**\n * List the files in a directory\n *\n * ```typescript\n * // The directory to search\n * const directory = '/User/test/transcend/my-app/app/containers';\n * // Returns ['test.js']\n * listFiles(directory);\n * ```\n *\n * @param directory - The directory to search\n * @param validExtensions - The list of valid extensions\n * @param removeExtensions - When true, remove the extensions from the listed files\n * @returns The list of files in the directory\n */\nexport function listFiles(\n directory: string,\n validExtensions?: string[],\n removeExtensions = false,\n): string[] {\n if (!existsSync(directory)) {\n return [];\n }\n\n const files = readdirSync(directory)\n .filter((fil) =>\n validExtensions ? validExtensions.filter((ext) => fil.endsWith(ext)).length : true,\n )\n .filter((fil) => fil.indexOf('.') > 0);\n\n return removeExtensions ? files.map((fil) => fil.replace(/\\.[^/.]+$/, '')) : files;\n}\n"],"mappings":"sDAiBA,SAAgB,EACd,EACA,EACA,EAAmB,GACT,CACV,GAAI,CAAC,EAAW,EAAU,CACxB,MAAO,EAAE,CAGX,IAAM,EAAQ,EAAY,EAAU,CACjC,OAAQ,GACP,EAAkB,EAAgB,OAAQ,GAAQ,EAAI,SAAS,EAAI,CAAC,CAAC,OAAS,GAC/E,CACA,OAAQ,GAAQ,EAAI,QAAQ,IAAI,CAAG,EAAE,CAExC,OAAO,EAAmB,EAAM,IAAK,GAAQ,EAAI,QAAQ,YAAa,GAAG,CAAC,CAAG"}
@@ -1,2 +0,0 @@
1
- import e from"colors";import{bootstrap as t}from"global-agent";import{ProxyAgent as n,setGlobalDispatcher as r}from"undici";import i from"yargs-parser";const a=console,{httpProxy:o=process.env.http_proxy}=i(process.argv.slice(2));o&&(a.info(e.green(`Initializing proxy: ${o}`)),process.env.GLOBAL_AGENT_HTTP_PROXY=o,t(),r(new n(o)));export{a as t};
2
- //# sourceMappingURL=logger-Ckep4QXn.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger-Ckep4QXn.mjs","names":[],"sources":["../src/logger.ts"],"sourcesContent":["import colors from 'colors';\nimport { bootstrap } from 'global-agent';\nimport { ProxyAgent, setGlobalDispatcher } from 'undici';\nimport yargs from 'yargs-parser';\n\nexport const logger = console;\n\n// When the proxy env var of flag is specified, initiate the proxy\nconst { httpProxy = process.env.http_proxy } = yargs(process.argv.slice(2));\nif (httpProxy) {\n logger.info(colors.green(`Initializing proxy: ${httpProxy}`));\n\n // Use global-agent, which overrides `request` based requests\n process.env.GLOBAL_AGENT_HTTP_PROXY = httpProxy;\n bootstrap();\n\n // Use undici, which overrides `fetch` based requests\n setGlobalDispatcher(new ProxyAgent(httpProxy));\n}\n"],"mappings":"wJAKA,MAAa,EAAS,QAGhB,CAAE,YAAY,QAAQ,IAAI,YAAe,EAAM,QAAQ,KAAK,MAAM,EAAE,CAAC,CACvE,IACF,EAAO,KAAK,EAAO,MAAM,uBAAuB,IAAY,CAAC,CAG7D,QAAQ,IAAI,wBAA0B,EACtC,GAAW,CAGX,EAAoB,IAAI,EAAW,EAAU,CAAC"}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-DKKXqoSr.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{t as n}from"./readCsv--FfP8n-H.mjs";import{chunk as r}from"lodash-es";import i from"colors";import*as a from"io-ts";import{createSombraGotInstance as o}from"@transcend-io/sdk";import{map as s,mapSeries as c}from"@transcend-io/utils";import l from"cli-progress";const u=a.type({nonce:a.string,identifier:a.string});async function d(e,{nonce:t,identifier:n}){try{return await e.put(`v1/data-silo`,{headers:{"x-transcend-nonce":t},json:{profiles:[{profileId:n}]}}),!0}catch(e){if(e.response?.statusCode===409)return!1;throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function f({file:a,dataSiloId:f,auth:p,sombraAuth:m,concurrency:h=100,transcendUrl:g=e,sleepSeconds:_=10}){let v=await o(g,p,{logger:t,sombraApiKey:m,sombraUrl:process.env.SOMBRA_URL});t.info(i.magenta(`Reading "${a}" from disk`));let y=n(a,u);t.info(i.magenta(`Notifying Transcend for data silo "${f}" marking "${y.length}" identifiers as completed.`));let b=new Date().getTime(),x=new l.SingleBar({},l.Presets.shades_classic),S=0,C=0,w=0;x.start(y.length,0);let T=r(y,h),E=T.length;await c(T,async(e,n)=>{t.info(i.blue(`Processing chunk ${n+1}/${E} (${r.length} items)`)),await s(e,async e=>{try{await d(v,e)?S+=1:C+=1}catch(n){t.error(i.red(`Error notifying Transcend for identifier "${e.identifier}" - ${n?.message}`)),w+=1}x.update(S+C)}),_>0&&n<E-1&&(t.info(i.yellow(`Sleeping for ${_}s before next chunk...`)),await new Promise(e=>{setTimeout(e,_*1e3)}))}),x.stop();let D=new Date().getTime()-b;if(t.info(i.green(`Successfully notified Transcend for ${S} identifiers in "${D/1e3}" seconds!`)),C&&t.info(i.magenta(`There were ${C} identifiers that were not in a state to be updated.They likely have already been resolved.`)),w)throw t.error(i.red(`There were ${w} identifiers that failed to be updated. Please review the logs for more information.`)),Error(`Failed to update all identifiers`);return y.length}export{u as n,d as r,f as t};
2
- //# sourceMappingURL=pushCronIdentifiersFromCsv-BCyj2uxq.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-DKKXqoSr.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{t as n}from"./readCsv--FfP8n-H.mjs";import{o as r}from"./request-BIplTb3L.mjs";import{uniq as i}from"lodash-es";import a from"colors";import*as o from"io-ts";import{buildTranscendGraphQLClient as s,createSombraGotInstance as c,makeGraphQLRequest as l}from"@transcend-io/sdk";import{map as u,splitCsvToList as d}from"@transcend-io/utils";const f=`https://app.transcend.io/privacy-requests/incoming-requests/`,p=o.record(o.string,o.string);async function m(e,{id:n,...r},o,s){if(!n){let e=`Request ID must be provided to enricher request.${s?` Found error in row: ${s}`:``}`;throw t.error(a.red(e)),Error(e)}let c=n.toLowerCase(),l=Object.entries(r).reduce((e,[t,n])=>i(d(n)).length===0?e:Object.assign(e,{[t]:i(d(n)).map(e=>({value:t===`email`?e.toLowerCase():e}))}),{});try{return await e.post(`v1/enrich-identifiers`,{headers:{"x-transcend-request-id":c,"x-transcend-enricher-id":o},json:{enrichedIdentifiers:l}}).json(),t.error(a.green(`Successfully enriched request: ${f}${c}`)),!0}catch(e){if(typeof e.response.body==`string`&&e.response.body.includes(`Cannot update a resolved RequestEnricher`))return t.warn(a.magenta(`Skipped enrichment for request: ${f}${c}, request is no longer in the enriching phase.`)),!1;throw t.error(a.red(`Failed to enricher identifiers for request with id: ${f}${c} - ${e.message} - ${e.response.body}`)),e}}async function h({file:i,auth:o,sombraAuth:d,enricherId:f,markSilent:h,concurrency:g=100,transcendUrl:_=e}){let v=await c(_,o,{logger:t,sombraApiKey:d,sombraUrl:process.env.SOMBRA_URL}),y=s(_,o);t.info(a.magenta(`Reading "${i}" from disk`));let b=n(i,p);t.info(a.magenta(`Enriching "${b.length}" privacy requests.`));let x=0,S=0,C=0;if(await u(b,async(e,n)=>{try{h&&(await l(y,r,{variables:{input:{id:e.id,isSilent:!0}},logger:t}),t.info(a.magenta(`Mark request as silent mode - ${e.id}`))),await m(v,e,f,n)?x+=1:S+=1}catch{C+=1}},{concurrency:g}),t.info(a.green(`Successfully notified Transcend! \n Success count: ${x}.`)),S>0&&t.info(a.magenta(`Skipped count: ${S}.`)),C>0)throw t.info(a.red(`Error Count: ${C}.`)),Error(`Failed to enrich: ${C} requests.`);return b.length}export{p as n,m as r,h as t};
2
- //# sourceMappingURL=pushManualEnrichmentIdentifiersFromCsv-EFfarcCs.mjs.map
@@ -1,2 +0,0 @@
1
- import{readFileSync as e}from"node:fs";import{decodeCodec as t}from"@transcend-io/type-utils";import*as n from"io-ts";import{parse as r}from"csv-parse/sync";function i(i,a,o={columns:!0}){let s=r(e(i,`utf-8`),o);return t(n.array(a),s).map(e=>Object.entries(e).reduce((e,[t,n])=>Object.assign(e,{[t.replace(/[^a-z_.+\-A-Z -~]/g,``)]:n}),{}))}export{i as t};
2
- //# sourceMappingURL=readCsv--FfP8n-H.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readCsv--FfP8n-H.mjs","names":[],"sources":["../src/lib/requests/readCsv.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\n\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Options } from 'csv-parse';\nimport { parse } from 'csv-parse/sync';\nimport * as t from 'io-ts';\n\n/**\n * Read in a CSV and validate its shape\n *\n * @param pathToFile - Path to file\n * @param codec - The codec to validate against. This is the codec for individual, non-header, rows\n * @param options - CSV parse options\n * @returns The JSON data\n */\nexport function readCsv<T extends t.Any>(\n pathToFile: string,\n codec: T,\n options: Options = { columns: true },\n): t.TypeOf<T>[] {\n // read file contents and parse\n const fileContent = parse(readFileSync(pathToFile, 'utf-8'), options);\n\n // validate codec\n const data = decodeCodec(t.array(codec), fileContent);\n\n // remove any special characters from object keys\n const parsed = data.map((datum) =>\n Object.entries(datum).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key.replace(/[^a-z_.+\\-A-Z -~]/g, '')]: value,\n }),\n {} as T,\n ),\n );\n return parsed;\n}\n"],"mappings":"6JAeA,SAAgB,EACd,EACA,EACA,EAAmB,CAAE,QAAS,GAAM,CACrB,CAEf,IAAM,EAAc,EAAM,EAAa,EAAY,QAAQ,CAAE,EAAQ,CAerE,OAZa,EAAY,EAAE,MAAM,EAAM,CAAE,EAGtB,CAAC,IAAK,GACvB,OAAO,QAAQ,EAAM,CAAC,QACnB,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,EAAI,QAAQ,qBAAsB,GAAG,EAAG,EAC1C,CAAC,CACJ,EAAE,CACH,CAEU"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"readTranscendYaml-bL1qFPqv.mjs","names":[],"sources":["../src/lib/readTranscendYaml.ts"],"sourcesContent":["import { readFileSync, writeFileSync } from 'node:fs';\n\nimport { decodeCodec, ObjByString } from '@transcend-io/type-utils';\nimport yaml from 'js-yaml';\n\nimport { TranscendInput } from '../codecs.js';\n\nexport const VARIABLE_PARAMETERS_REGEXP = /<<parameters\\.(.+?)>>/;\nexport const VARIABLE_PARAMETERS_NAME = 'parameters';\n\n/**\n * Function that replaces variables in a text file.\n * Throws error if there are variables that have not been replaced\n *\n * @param input - Input text\n * @param variables - Variables to replace\n * @param extraErrorMessage - Additional error message text\n * @returns Output text\n */\nexport function replaceVariablesInYaml(\n input: string,\n variables: ObjByString,\n extraErrorMessage = '',\n): string {\n let contents = input;\n // Replace variables\n Object.entries(variables).forEach(([name, value]) => {\n contents = contents.split(`<<${VARIABLE_PARAMETERS_NAME}.${name}>>`).join(value);\n });\n\n // Throw error if unfilled variables\n if (VARIABLE_PARAMETERS_REGEXP.test(contents)) {\n const [, name] = VARIABLE_PARAMETERS_REGEXP.exec(contents) || [];\n throw new Error(\n `Found variable that was not set: ${name}.\nMake sure you are passing all parameters through the --${VARIABLE_PARAMETERS_NAME}=${name}:value-for-param flag.\n${extraErrorMessage}`,\n );\n }\n\n return contents;\n}\n\n/**\n * Read in the contents of a yaml file and validate that the shape\n * of the yaml file matches the codec API\n *\n * @param filePath - Path to yaml file\n * @param variables - Variables to fill in\n * @returns The contents of the yaml file, type-checked\n */\nexport function readTranscendYaml(filePath: string, variables: ObjByString = {}): TranscendInput {\n // Read in contents\n const fileContents = readFileSync(filePath, 'utf-8');\n\n // Replace variables\n const replacedVariables = replaceVariablesInYaml(\n fileContents,\n variables,\n `Also check that there are no extra variables defined in your yaml: ${filePath}`,\n );\n\n // Validate shape\n return decodeCodec(TranscendInput, yaml.load(replacedVariables));\n}\n\n/**\n * Write a Transcend configuration to disk\n *\n * @param filePath - Path to yaml file\n * @param input - The input to write out\n */\nexport function writeTranscendYaml(filePath: string, input: TranscendInput): void {\n writeFileSync(filePath, yaml.dump(decodeCodec(TranscendInput, input)));\n}\n"],"mappings":"mLAOA,MAAa,EAA6B,wBAC7B,EAA2B,aAWxC,SAAgB,EACd,EACA,EACA,EAAoB,GACZ,CACR,IAAI,EAAW,EAOf,GALA,OAAO,QAAQ,EAAU,CAAC,SAAS,CAAC,EAAM,KAAW,CACnD,EAAW,EAAS,MAAM,KAAK,EAAyB,GAAG,EAAK,IAAI,CAAC,KAAK,EAAM,EAChF,CAGE,EAA2B,KAAK,EAAS,CAAE,CAC7C,GAAM,EAAG,GAAQ,EAA2B,KAAK,EAAS,EAAI,EAAE,CAChE,MAAU,MACR,oCAAoC,EAAK;yDACU,EAAyB,GAAG,EAAK;EACxF,IACG,CAGH,OAAO,EAWT,SAAgB,EAAkB,EAAkB,EAAyB,EAAE,CAAkB,CAK/F,IAAM,EAAoB,EAHL,EAAa,EAAU,QAI9B,CACZ,EACA,sEAAsE,IACvE,CAGD,OAAO,EAAY,EAAgB,EAAK,KAAK,EAAkB,CAAC,CASlE,SAAgB,EAAmB,EAAkB,EAA6B,CAChF,EAAc,EAAU,EAAK,KAAK,EAAY,EAAgB,EAAM,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import{r as e}from"./constants-FbK2iR--.mjs";import{spawn as t,spawnSync as n}from"node:child_process";function r(){let t=n(`opa`,[`version`],{stdio:`ignore`});if(t.error||t.status!==0)throw Error(e)}function i(n,r={}){return new Promise((i,a)=>{let o=t(`opa`,n,{cwd:r.cwd,stdio:`inherit`});o.on(`error`,t=>{if(t.code===`ENOENT`){a(Error(e));return}a(t)}),o.on(`close`,e=>i(e??1))})}function a(n,r={}){return new Promise((i,a)=>{let o=t(`opa`,n,{cwd:r.cwd,stdio:[`ignore`,`pipe`,`pipe`]}),s=``,c=``;o.stdout?.on(`data`,e=>{s+=e.toString()}),o.stderr?.on(`data`,e=>{c+=e.toString()}),o.on(`error`,t=>{if(t.code===`ENOENT`){a(Error(e));return}a(t)}),o.on(`close`,e=>i({code:e??1,stdout:s,stderr:c}))})}export{i as n,r,a as t};
2
- //# sourceMappingURL=runOpa-D511z37u.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runOpa-D511z37u.mjs","names":[],"sources":["../src/commands/policy/helpers/assertOpaInstalled.ts","../src/commands/policy/helpers/runOpa.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\n\nimport { OPA_INSTALL_HINT } from '../constants.js';\n\n/**\n * Ensures the `opa` binary is available on PATH.\n *\n * @throws Error when `opa` is not installed\n */\nexport function assertOpaInstalled(): void {\n const result = spawnSync('opa', ['version'], { stdio: 'ignore' });\n if (result.error || result.status !== 0) {\n throw new Error(OPA_INSTALL_HINT);\n }\n}\n","import { spawn } from 'node:child_process';\n\nimport { OPA_INSTALL_HINT } from '../constants.js';\n\n/** Result of an OPA CLI invocation with captured output. */\nexport interface RunOpaCaptureResult {\n /** Child process exit code */\n code: number;\n /** Captured stdout */\n stdout: string;\n /** Captured stderr */\n stderr: string;\n}\n\n/**\n * Runs an OPA CLI command and streams stdout/stderr to the current process.\n *\n * @param args - Arguments passed to the `opa` binary\n * @param options - Optional working directory\n * @returns The child process exit code\n */\nexport function runOpa(args: string[], options: { cwd?: string } = {}): Promise<number> {\n return new Promise<number>((resolve, reject) => {\n const child = spawn('opa', args, {\n cwd: options.cwd,\n stdio: 'inherit',\n });\n\n child.on('error', (err) => {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n reject(new Error(OPA_INSTALL_HINT));\n return;\n }\n reject(err);\n });\n child.on('close', (code) => resolve(code ?? 1));\n });\n}\n\n/**\n * Runs an OPA CLI command and captures stdout/stderr.\n *\n * @param args - Arguments passed to the `opa` binary\n * @param options - Optional working directory\n * @returns Exit code and captured output\n */\nexport function runOPACapture(\n args: string[],\n options: { cwd?: string } = {},\n): Promise<RunOpaCaptureResult> {\n return new Promise<RunOpaCaptureResult>((resolve, reject) => {\n const child = spawn('opa', args, {\n cwd: options.cwd,\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n\n let stdout = '';\n let stderr = '';\n\n child.stdout?.on('data', (chunk: Buffer) => {\n stdout += chunk.toString();\n });\n child.stderr?.on('data', (chunk: Buffer) => {\n stderr += chunk.toString();\n });\n\n child.on('error', (err) => {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n reject(new Error(OPA_INSTALL_HINT));\n return;\n }\n reject(err);\n });\n child.on('close', (code) => resolve({ code: code ?? 1, stdout, stderr }));\n });\n}\n"],"mappings":"uGASA,SAAgB,GAA2B,CACzC,IAAM,EAAS,EAAU,MAAO,CAAC,UAAU,CAAE,CAAE,MAAO,SAAU,CAAC,CACjE,GAAI,EAAO,OAAS,EAAO,SAAW,EACpC,MAAU,MAAM,EAAiB,CCSrC,SAAgB,EAAO,EAAgB,EAA4B,EAAE,CAAmB,CACtF,OAAO,IAAI,SAAiB,EAAS,IAAW,CAC9C,IAAM,EAAQ,EAAM,MAAO,EAAM,CAC/B,IAAK,EAAQ,IACb,MAAO,UACR,CAAC,CAEF,EAAM,GAAG,QAAU,GAAQ,CACzB,GAAK,EAA8B,OAAS,SAAU,CACpD,EAAW,MAAM,EAAiB,CAAC,CACnC,OAEF,EAAO,EAAI,EACX,CACF,EAAM,GAAG,QAAU,GAAS,EAAQ,GAAQ,EAAE,CAAC,EAC/C,CAUJ,SAAgB,EACd,EACA,EAA4B,EAAE,CACA,CAC9B,OAAO,IAAI,SAA8B,EAAS,IAAW,CAC3D,IAAM,EAAQ,EAAM,MAAO,EAAM,CAC/B,IAAK,EAAQ,IACb,MAAO,CAAC,SAAU,OAAQ,OAAO,CAClC,CAAC,CAEE,EAAS,GACT,EAAS,GAEb,EAAM,QAAQ,GAAG,OAAS,GAAkB,CAC1C,GAAU,EAAM,UAAU,EAC1B,CACF,EAAM,QAAQ,GAAG,OAAS,GAAkB,CAC1C,GAAU,EAAM,UAAU,EAC1B,CAEF,EAAM,GAAG,QAAU,GAAQ,CACzB,GAAK,EAA8B,OAAS,SAAU,CACpD,EAAW,MAAM,EAAiB,CAAC,CACnC,OAEF,EAAO,EAAI,EACX,CACF,EAAM,GAAG,QAAU,GAAS,EAAQ,CAAE,KAAM,GAAQ,EAAG,SAAQ,SAAQ,CAAC,CAAC,EACzE"}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-DKKXqoSr.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{D as n}from"./codecs-DJFlZLGT.mjs";import{t as r}from"./readCsv--FfP8n-H.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,syncCookies as o}from"@transcend-io/sdk";import{splitCsvToList as s}from"@transcend-io/utils";const c=[`ID`,`Activity`,`Encounters`,`Last Seen At`,`Has Native Do Not Sell/Share Support`,`IAB USP API Support`,`Service Description`,`Website URL`,`Categories of Recipients`];async function l({auth:l,trackerStatus:u,file:d,transcendUrl:f=e}){let p=a(f,l);t.info(i.magenta(`Reading "${d}" from disk`)),await o(p,r(d,n).map(({"Is Regex?":e,Notes:t,Service:n,Purpose:r,Status:i,Owners:a,Teams:o,Name:l,...d})=>({...typeof e==`string`?{isRegex:e.toLowerCase()===`true`}:{},name:l,description:t,trackingPurposes:s(r),status:i||u,owners:a?s(a):void 0,teams:o?s(o):void 0,attributes:Object.entries(d).filter(([e])=>!c.includes(e)).map(([e,t])=>({key:e,values:s(t)}))})),{logger:t})||(t.error(i.red(`Encountered error(s) syncing cookies from CSV, see logs above for more info. `)),process.exit(1))}export{l as t};
2
- //# sourceMappingURL=uploadCookiesFromCsv-tEobd_k1.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploadCookiesFromCsv-tEobd_k1.mjs","names":[],"sources":["../src/lib/consent-manager/uploadCookiesFromCsv.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncCookies } from '@transcend-io/sdk';\nimport { splitCsvToList } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { CookieInput, CookieCsvInput } from '../../codecs.js';\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { readCsv } from '../requests/readCsv.js';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of cookies from CSV\n *\n * @param options - Options\n */\nexport async function uploadCookiesFromCsv({\n auth,\n trackerStatus,\n file,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of cookie inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const cookieInputs = readCsv(file, CookieCsvInput);\n\n // Convert these inputs into a format that the other function can use\n const validatedCookieInputs = cookieInputs.map(\n ({\n 'Is Regex?': isRegex,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n Name,\n ...rest\n }): CookieInput => ({\n ...(typeof isRegex === 'string' ? { isRegex: isRegex.toLowerCase() === 'true' } : {}),\n name: Name,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the cookies into Transcend dashboard\n const syncedCookies = await syncCookies(client, validatedCookieInputs, { logger });\n\n // Log errors\n if (!syncedCookies) {\n logger.error(\n colors.red('Encountered error(s) syncing cookies from CSV, see logs above for more info. '),\n );\n process.exit(1);\n }\n}\n"],"mappings":"mUAUA,MAAM,EAAe,CACnB,KACA,WACA,aACA,eACA,uCACA,sBACA,sBACA,cACA,2BACD,CAOD,eAAsB,EAAqB,CACzC,OACA,gBACA,OACA,eAAe,GAUC,CAEhB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAG9D,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CA6CrD,MAHuB,EAAY,EAzCnB,EAAQ,EAAM,EAGO,CAAC,KACxC,CACC,YAAa,EACb,QAGA,UACA,UACA,SACA,SACA,QACA,OACA,GAAG,MACe,CAClB,GAAI,OAAO,GAAY,SAAW,CAAE,QAAS,EAAQ,aAAa,GAAK,OAAQ,CAAG,EAAE,CACpF,KAAM,EACN,YAAa,EACb,iBAAkB,EAAe,EAAQ,CAKzC,OAAQ,GAAU,EAClB,OAAQ,EAAS,EAAe,EAAO,CAAG,IAAA,GAC1C,MAAO,EAAQ,EAAe,EAAM,CAAG,IAAA,GAEvC,WAAY,OAAO,QAAQ,EAAK,CAG7B,QAAQ,CAAC,KAAS,CAAC,EAAa,SAAS,EAAI,CAAC,CAC9C,KAAK,CAAC,EAAK,MAAY,CACtB,MACA,OAAQ,EAAe,EAAM,CAC9B,EAAE,CACN,EAIkE,CAAE,CAAE,SAAQ,CAAC,GAIhF,EAAO,MACL,EAAO,IAAI,gFAAgF,CAC5F,CACD,QAAQ,KAAK,EAAE"}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./constants-DKKXqoSr.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{N as n}from"./codecs-DJFlZLGT.mjs";import{t as r}from"./readCsv--FfP8n-H.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,syncDataFlows as o}from"@transcend-io/sdk";import{splitCsvToList as s}from"@transcend-io/utils";const c=[`ID`,`Activity`,`Encounters`,`Last Seen At`,`Has Native Do Not Sell/Share Support`,`IAB USP API Support`,`Service Description`,`Website URL`,`Categories of Recipients`];async function l({auth:l,trackerStatus:u,file:d,classifyService:f=!1,transcendUrl:p=e}){let m=a(p,l);t.info(i.magenta(`Reading "${d}" from disk`)),await o(m,r(d,n).map(({Type:e,Notes:t,Service:n,Purpose:r,Status:i,Owners:a,Teams:o,"Connections Made To":l,...d})=>({value:l,type:e,description:t,trackingPurposes:s(r),status:i||u,owners:a?s(a):void 0,teams:o?s(o):void 0,attributes:Object.entries(d).filter(([e])=>!c.includes(e)).map(([e,t])=>({key:e,values:s(t)}))})),{classifyService:f,logger:t})||(t.error(i.red(`Encountered error(s) syncing data flows from CSV, see logs above for more info. `)),process.exit(1))}export{l as t};
2
- //# sourceMappingURL=uploadDataFlowsFromCsv-B9Mcdixu.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploadDataFlowsFromCsv-B9Mcdixu.mjs","names":[],"sources":["../src/lib/consent-manager/uploadDataFlowsFromCsv.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncDataFlows } from '@transcend-io/sdk';\nimport { splitCsvToList } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { DataFlowInput, DataFlowCsvInput } from '../../codecs.js';\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { readCsv } from '../requests/readCsv.js';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of data flows from CSV\n *\n * @param options - Options\n */\nexport async function uploadDataFlowsFromCsv({\n auth,\n trackerStatus,\n file,\n classifyService = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of data flow inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const dataFlowInputs = readCsv(file, DataFlowCsvInput);\n\n // Convert these data flow inputs into a format that the other function can use\n const validatedDataFlowInputs = dataFlowInputs.map(\n ({\n Type,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n 'Connections Made To': value,\n ...rest\n }): DataFlowInput => ({\n value,\n type: Type,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the data flows into Transcend dashboard\n const syncedDataFlows = await syncDataFlows(client, validatedDataFlowInputs, {\n classifyService,\n logger,\n });\n\n // Log errors\n if (!syncedDataFlows) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing data flows from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n"],"mappings":"qUAUA,MAAM,EAAe,CACnB,KACA,WACA,aACA,eACA,uCACA,sBACA,sBACA,cACA,2BACD,CAOD,eAAsB,EAAuB,CAC3C,OACA,gBACA,OACA,kBAAkB,GAClB,eAAe,GAYC,CAEhB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAG9D,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAgDrD,MANyB,EAAc,EAzCrB,EAAQ,EAAM,EAGS,CAAC,KAC5C,CACC,OACA,QAGA,UACA,UACA,SACA,SACA,QACA,sBAAuB,EACvB,GAAG,MACiB,CACpB,QACA,KAAM,EACN,YAAa,EACb,iBAAkB,EAAe,EAAQ,CAKzC,OAAQ,GAAU,EAClB,OAAQ,EAAS,EAAe,EAAO,CAAG,IAAA,GAC1C,MAAO,EAAQ,EAAe,EAAM,CAAG,IAAA,GAEvC,WAAY,OAAO,QAAQ,EAAK,CAG7B,QAAQ,CAAC,KAAS,CAAC,EAAa,SAAS,EAAI,CAAC,CAC9C,KAAK,CAAC,EAAK,MAAY,CACtB,MACA,OAAQ,EAAe,EAAM,CAC9B,EAAE,CACN,EAIwE,CAAE,CAC3E,kBACA,SACD,CAAC,GAIA,EAAO,MACL,EAAO,IACL,mFACD,CACF,CACD,QAAQ,KAAK,EAAE"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./logger-Ckep4QXn.mjs";import{ct as t}from"./codecs-DJFlZLGT.mjs";import{existsSync as n,readFileSync as r}from"node:fs";import i from"colors";import{decodeCodec as a}from"@transcend-io/type-utils";import*as o from"io-ts";function s(s){return s||(e.error(i.red(`A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY`)),process.exit(1)),n(s)?a(o.array(t),r(s,`utf-8`)):s}export{s as t};
2
- //# sourceMappingURL=validateTranscendAuth-CAO5ktnu.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateTranscendAuth-CAO5ktnu.mjs","names":[],"sources":["../src/lib/api-keys/validateTranscendAuth.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\n\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport colors from 'colors';\nimport * as t from 'io-ts';\n\nimport { StoredApiKey } from '../../codecs.js';\nimport { logger } from '../../logger.js';\n\n/**\n * Determine if the `--auth` parameter is an API key or a path to a JSON\n * file containing a list of API keys.\n *\n * @param auth - Raw auth parameter\n * @returns The API key or the list API keys\n */\nexport function validateTranscendAuth(auth: string): string | StoredApiKey[] {\n // Ensure auth is passed\n if (!auth) {\n logger.error(\n colors.red(\n 'A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY',\n ),\n );\n process.exit(1);\n }\n\n // Read from disk\n if (existsSync(auth)) {\n // validate that file is a list of API keys\n return decodeCodec(t.array(StoredApiKey), readFileSync(auth, 'utf-8'));\n }\n\n // Return as single API key\n return auth;\n}\n"],"mappings":"iPAgBA,SAAgB,EAAsB,EAAuC,CAkB3E,OAhBK,IACH,EAAO,MACL,EAAO,IACL,wFACD,CACF,CACD,QAAQ,KAAK,EAAE,EAIb,EAAW,EAAK,CAEX,EAAY,EAAE,MAAM,EAAa,CAAE,EAAa,EAAM,QAAQ,CAAC,CAIjE"}