@transcend-io/cli 8.38.2 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/dist/api-keys-CxvKdj2v.mjs +2 -0
  2. package/dist/api-keys-CxvKdj2v.mjs.map +1 -0
  3. package/dist/app-BKMxG7RO.mjs +131 -0
  4. package/dist/app-BKMxG7RO.mjs.map +1 -0
  5. package/dist/bin/bash-complete.mjs +3 -0
  6. package/dist/bin/bash-complete.mjs.map +1 -0
  7. package/dist/bin/cli.mjs +3 -0
  8. package/dist/bin/cli.mjs.map +1 -0
  9. package/dist/bin/deprecated-command.mjs +5 -0
  10. package/dist/bin/deprecated-command.mjs.map +1 -0
  11. package/dist/buildAIIntegrationType-Bk0EbFKV.mjs +2 -0
  12. package/dist/buildAIIntegrationType-Bk0EbFKV.mjs.map +1 -0
  13. package/dist/code-scanning-Cx1kpssH.mjs +4 -0
  14. package/dist/code-scanning-Cx1kpssH.mjs.map +1 -0
  15. package/dist/codecs-TR6p48v3.mjs +2 -0
  16. package/dist/codecs-TR6p48v3.mjs.map +1 -0
  17. package/dist/command-Bzyj3M2G.mjs +9 -0
  18. package/dist/command-Bzyj3M2G.mjs.map +1 -0
  19. package/dist/consent-manager-c4bgQF1N.mjs +12 -0
  20. package/dist/consent-manager-c4bgQF1N.mjs.map +1 -0
  21. package/dist/constants-CnLQtIBn.mjs +2 -0
  22. package/dist/constants-CnLQtIBn.mjs.map +1 -0
  23. package/dist/context-bkKpii_t.mjs +2 -0
  24. package/dist/{context-_8xfl0dt.cjs.map → context-bkKpii_t.mjs.map} +1 -1
  25. package/dist/cron-BvxWyvDu.mjs +2 -0
  26. package/dist/cron-BvxWyvDu.mjs.map +1 -0
  27. package/dist/data-inventory-CkS_kmus.mjs +75 -0
  28. package/dist/data-inventory-CkS_kmus.mjs.map +1 -0
  29. package/dist/dataFlowsToDataSilos-RAhfPV0l.mjs +2 -0
  30. package/dist/dataFlowsToDataSilos-RAhfPV0l.mjs.map +1 -0
  31. package/dist/done-input-validation-CcZtaz03.mjs +2 -0
  32. package/dist/{done-input-validation-DGckEJ5a.cjs.map → done-input-validation-CcZtaz03.mjs.map} +1 -1
  33. package/dist/enums-CyFTrzXY.mjs +2 -0
  34. package/dist/{enums-BZulhPFa.cjs.map → enums-CyFTrzXY.mjs.map} +1 -1
  35. package/dist/impl-8dOatHnF.mjs +2 -0
  36. package/dist/{impl-BN8N7BHo.cjs.map → impl-8dOatHnF.mjs.map} +1 -1
  37. package/dist/impl-Ah-1lwzr.mjs +2 -0
  38. package/dist/impl-Ah-1lwzr.mjs.map +1 -0
  39. package/dist/impl-B5lTeRbn.mjs +2 -0
  40. package/dist/impl-B5lTeRbn.mjs.map +1 -0
  41. package/dist/impl-B6UhzQcY2.mjs +2 -0
  42. package/dist/impl-B6UhzQcY2.mjs.map +1 -0
  43. package/dist/impl-BFf_CotE2.mjs +2 -0
  44. package/dist/impl-BFf_CotE2.mjs.map +1 -0
  45. package/dist/impl-BGQ0EGS0.mjs +2 -0
  46. package/dist/impl-BGQ0EGS0.mjs.map +1 -0
  47. package/dist/impl-BYBNi68b.mjs +5 -0
  48. package/dist/impl-BYBNi68b.mjs.map +1 -0
  49. package/dist/impl-B__p3_wC.mjs +2 -0
  50. package/dist/impl-B__p3_wC.mjs.map +1 -0
  51. package/dist/impl-BcayRe6a.mjs +2 -0
  52. package/dist/{impl-CA7X_TDD.cjs.map → impl-BcayRe6a.mjs.map} +1 -1
  53. package/dist/impl-BkYKsEVG2.mjs +2 -0
  54. package/dist/impl-BkYKsEVG2.mjs.map +1 -0
  55. package/dist/impl-Bl2yVgh0.mjs +4 -0
  56. package/dist/impl-Bl2yVgh0.mjs.map +1 -0
  57. package/dist/impl-BmAMgEEM.mjs +12 -0
  58. package/dist/impl-BmAMgEEM.mjs.map +1 -0
  59. package/dist/impl-BsttzxTN2.mjs +2 -0
  60. package/dist/impl-BsttzxTN2.mjs.map +1 -0
  61. package/dist/impl-BtnySmbi.mjs +2 -0
  62. package/dist/impl-BtnySmbi.mjs.map +1 -0
  63. package/dist/impl-BwX-evfW2.mjs +4 -0
  64. package/dist/impl-BwX-evfW2.mjs.map +1 -0
  65. package/dist/impl-C-wzeAib2.mjs +2 -0
  66. package/dist/impl-C-wzeAib2.mjs.map +1 -0
  67. package/dist/impl-C61PYfk12.mjs +2 -0
  68. package/dist/impl-C61PYfk12.mjs.map +1 -0
  69. package/dist/impl-CAuNpuF2.mjs +2 -0
  70. package/dist/impl-CAuNpuF2.mjs.map +1 -0
  71. package/dist/impl-CSKrBIuV.mjs +2 -0
  72. package/dist/impl-CSKrBIuV.mjs.map +1 -0
  73. package/dist/impl-CZP2l3Ds.mjs +3 -0
  74. package/dist/impl-CZP2l3Ds.mjs.map +1 -0
  75. package/dist/impl-CiJ8hE5W2.mjs +2 -0
  76. package/dist/impl-CiJ8hE5W2.mjs.map +1 -0
  77. package/dist/impl-Cj3H-m2Z.mjs +2 -0
  78. package/dist/impl-Cj3H-m2Z.mjs.map +1 -0
  79. package/dist/impl-CkY0wfCz.mjs +2 -0
  80. package/dist/impl-CkY0wfCz.mjs.map +1 -0
  81. package/dist/impl-Cm8pUfBU2.mjs +2 -0
  82. package/dist/impl-Cm8pUfBU2.mjs.map +1 -0
  83. package/dist/impl-CpzS9LVu2.mjs +2 -0
  84. package/dist/impl-CpzS9LVu2.mjs.map +1 -0
  85. package/dist/impl-CwfamZ1c.mjs +2 -0
  86. package/dist/{impl-BO1fP5DL.cjs.map → impl-CwfamZ1c.mjs.map} +1 -1
  87. package/dist/impl-D81et1Yb2.mjs +2 -0
  88. package/dist/impl-D81et1Yb2.mjs.map +1 -0
  89. package/dist/impl-D92PTNk3.mjs +2 -0
  90. package/dist/impl-D92PTNk3.mjs.map +1 -0
  91. package/dist/impl-DTXDVeo6.mjs +2 -0
  92. package/dist/impl-DTXDVeo6.mjs.map +1 -0
  93. package/dist/impl-DWoysXup.mjs +2 -0
  94. package/dist/impl-DWoysXup.mjs.map +1 -0
  95. package/dist/impl-DX3JHZ4v2.mjs +2 -0
  96. package/dist/impl-DX3JHZ4v2.mjs.map +1 -0
  97. package/dist/impl-DhuUrzxQ.mjs +2 -0
  98. package/dist/impl-DhuUrzxQ.mjs.map +1 -0
  99. package/dist/impl-DqMYLKjU.mjs +2 -0
  100. package/dist/impl-DqMYLKjU.mjs.map +1 -0
  101. package/dist/impl-DqQ6CIj0.mjs +2 -0
  102. package/dist/impl-DqQ6CIj0.mjs.map +1 -0
  103. package/dist/impl-Duaq6iWI2.mjs +2 -0
  104. package/dist/impl-Duaq6iWI2.mjs.map +1 -0
  105. package/dist/impl-O5gz8qcm.mjs +2 -0
  106. package/dist/impl-O5gz8qcm.mjs.map +1 -0
  107. package/dist/impl-PH0AoC7i.mjs +2 -0
  108. package/dist/impl-PH0AoC7i.mjs.map +1 -0
  109. package/dist/impl-S8p6toVb2.mjs +2 -0
  110. package/dist/impl-S8p6toVb2.mjs.map +1 -0
  111. package/dist/impl-X2MSb8Ij.mjs +2 -0
  112. package/dist/impl-X2MSb8Ij.mjs.map +1 -0
  113. package/dist/impl-bo95wZIU2.mjs +2 -0
  114. package/dist/impl-bo95wZIU2.mjs.map +1 -0
  115. package/dist/impl-cfdCesro.mjs +2 -0
  116. package/dist/impl-cfdCesro.mjs.map +1 -0
  117. package/dist/impl-iZoXu4nV.mjs +2 -0
  118. package/dist/{impl-DZMWJNLE.cjs.map → impl-iZoXu4nV.mjs.map} +1 -1
  119. package/dist/impl-lebl6Zek2.mjs +2 -0
  120. package/dist/impl-lebl6Zek2.mjs.map +1 -0
  121. package/dist/impl-p0YN9e2e.mjs +2 -0
  122. package/dist/impl-p0YN9e2e.mjs.map +1 -0
  123. package/dist/{index.d.cts → index.d.mts} +1704 -3463
  124. package/dist/index.mjs +5 -0
  125. package/dist/index.mjs.map +1 -0
  126. package/dist/logger-Bj782ZYD.mjs +2 -0
  127. package/dist/logger-Bj782ZYD.mjs.map +1 -0
  128. package/dist/manual-enrichment-B6lW5kAX.mjs +2 -0
  129. package/dist/manual-enrichment-B6lW5kAX.mjs.map +1 -0
  130. package/dist/mergeTranscendInputs-Coj_e2N3.mjs +2 -0
  131. package/dist/{mergeTranscendInputs-BIBCYbug.cjs.map → mergeTranscendInputs-Coj_e2N3.mjs.map} +1 -1
  132. package/dist/pooling-CazydwlD.mjs +23 -0
  133. package/dist/pooling-CazydwlD.mjs.map +1 -0
  134. package/dist/preference-management-8gj7aSJB.mjs +7 -0
  135. package/dist/preference-management-8gj7aSJB.mjs.map +1 -0
  136. package/dist/readTranscendYaml-DhKG1ViI.mjs +4 -0
  137. package/dist/readTranscendYaml-DhKG1ViI.mjs.map +1 -0
  138. package/dist/syncConfigurationToTranscend-VJd0PnaZ.mjs +3010 -0
  139. package/dist/syncConfigurationToTranscend-VJd0PnaZ.mjs.map +1 -0
  140. package/dist/uploadConsents-C1S-BNzw.mjs +2 -0
  141. package/dist/uploadConsents-C1S-BNzw.mjs.map +1 -0
  142. package/package.json +46 -49
  143. package/dist/api-keys-DMPYZTne.cjs +0 -2
  144. package/dist/api-keys-DMPYZTne.cjs.map +0 -1
  145. package/dist/app-bPlpZQj_.cjs +0 -131
  146. package/dist/app-bPlpZQj_.cjs.map +0 -1
  147. package/dist/bin/bash-complete.cjs +0 -3
  148. package/dist/bin/bash-complete.cjs.map +0 -1
  149. package/dist/bin/cli.cjs +0 -3
  150. package/dist/bin/cli.cjs.map +0 -1
  151. package/dist/bin/deprecated-command.cjs +0 -5
  152. package/dist/bin/deprecated-command.cjs.map +0 -1
  153. package/dist/buildAIIntegrationType-BwuCYR-o.cjs +0 -2
  154. package/dist/buildAIIntegrationType-BwuCYR-o.cjs.map +0 -1
  155. package/dist/chunk-Bmb41Sf3.cjs +0 -1
  156. package/dist/code-scanning-D6YstOWo.cjs +0 -4
  157. package/dist/code-scanning-D6YstOWo.cjs.map +0 -1
  158. package/dist/codecs-Bvmb8o9R.cjs +0 -2
  159. package/dist/codecs-Bvmb8o9R.cjs.map +0 -1
  160. package/dist/command-C39HGpGR.cjs +0 -9
  161. package/dist/command-C39HGpGR.cjs.map +0 -1
  162. package/dist/consent-manager-C3UVAKd_.cjs +0 -12
  163. package/dist/consent-manager-C3UVAKd_.cjs.map +0 -1
  164. package/dist/constants-gJm1eQH0.cjs +0 -2
  165. package/dist/constants-gJm1eQH0.cjs.map +0 -1
  166. package/dist/context-_8xfl0dt.cjs +0 -2
  167. package/dist/cron-NLlyCiml.cjs +0 -2
  168. package/dist/cron-NLlyCiml.cjs.map +0 -1
  169. package/dist/data-inventory-a9Nz9lUO.cjs +0 -75
  170. package/dist/data-inventory-a9Nz9lUO.cjs.map +0 -1
  171. package/dist/dataFlowsToDataSilos-BJh0hzJI.cjs +0 -2
  172. package/dist/dataFlowsToDataSilos-BJh0hzJI.cjs.map +0 -1
  173. package/dist/done-input-validation-DGckEJ5a.cjs +0 -2
  174. package/dist/enums-BZulhPFa.cjs +0 -2
  175. package/dist/impl--RUTvJko.cjs +0 -2
  176. package/dist/impl--RUTvJko.cjs.map +0 -1
  177. package/dist/impl-6vrF2_M3.cjs +0 -2
  178. package/dist/impl-6vrF2_M3.cjs.map +0 -1
  179. package/dist/impl-73q3K0b_.cjs +0 -2
  180. package/dist/impl-73q3K0b_.cjs.map +0 -1
  181. package/dist/impl-BAZ34gSp.cjs +0 -2
  182. package/dist/impl-BAZ34gSp.cjs.map +0 -1
  183. package/dist/impl-BAs-7neS.cjs +0 -12
  184. package/dist/impl-BAs-7neS.cjs.map +0 -1
  185. package/dist/impl-BF44h4oH.cjs +0 -2
  186. package/dist/impl-BF44h4oH.cjs.map +0 -1
  187. package/dist/impl-BKXkRTVx.cjs +0 -2
  188. package/dist/impl-BKXkRTVx.cjs.map +0 -1
  189. package/dist/impl-BN8N7BHo.cjs +0 -2
  190. package/dist/impl-BO1fP5DL.cjs +0 -2
  191. package/dist/impl-BRAiiMt3.cjs +0 -2
  192. package/dist/impl-BRAiiMt3.cjs.map +0 -1
  193. package/dist/impl-BRNha4nQ.cjs +0 -2
  194. package/dist/impl-BRNha4nQ.cjs.map +0 -1
  195. package/dist/impl-Ba1d91O1.cjs +0 -2
  196. package/dist/impl-Ba1d91O1.cjs.map +0 -1
  197. package/dist/impl-Bgp_TuxN.cjs +0 -2
  198. package/dist/impl-Bgp_TuxN.cjs.map +0 -1
  199. package/dist/impl-BreaZGaV.cjs +0 -2
  200. package/dist/impl-BreaZGaV.cjs.map +0 -1
  201. package/dist/impl-BzAwMfNS.cjs +0 -2
  202. package/dist/impl-BzAwMfNS.cjs.map +0 -1
  203. package/dist/impl-C0eKnbO8.cjs +0 -4
  204. package/dist/impl-C0eKnbO8.cjs.map +0 -1
  205. package/dist/impl-C2kTLgRr.cjs +0 -2
  206. package/dist/impl-C2kTLgRr.cjs.map +0 -1
  207. package/dist/impl-CA7X_TDD.cjs +0 -2
  208. package/dist/impl-CC0T0jNd.cjs +0 -2
  209. package/dist/impl-CC0T0jNd.cjs.map +0 -1
  210. package/dist/impl-CJT35FpG.cjs +0 -2
  211. package/dist/impl-CJT35FpG.cjs.map +0 -1
  212. package/dist/impl-CTXPMoXc.cjs +0 -3
  213. package/dist/impl-CTXPMoXc.cjs.map +0 -1
  214. package/dist/impl-CUScCLAS.cjs +0 -2
  215. package/dist/impl-CUScCLAS.cjs.map +0 -1
  216. package/dist/impl-CYmPZogW.cjs +0 -2
  217. package/dist/impl-CYmPZogW.cjs.map +0 -1
  218. package/dist/impl-Ccd0FaOU.cjs +0 -2
  219. package/dist/impl-Ccd0FaOU.cjs.map +0 -1
  220. package/dist/impl-CmKWcYiV.cjs +0 -2
  221. package/dist/impl-CmKWcYiV.cjs.map +0 -1
  222. package/dist/impl-CqshC7my.cjs +0 -2
  223. package/dist/impl-CqshC7my.cjs.map +0 -1
  224. package/dist/impl-Cru4riTc.cjs +0 -5
  225. package/dist/impl-Cru4riTc.cjs.map +0 -1
  226. package/dist/impl-Cypfgm4t.cjs +0 -2
  227. package/dist/impl-Cypfgm4t.cjs.map +0 -1
  228. package/dist/impl-D2SWeIGe.cjs +0 -2
  229. package/dist/impl-D2SWeIGe.cjs.map +0 -1
  230. package/dist/impl-DLwIQVA6.cjs +0 -2
  231. package/dist/impl-DLwIQVA6.cjs.map +0 -1
  232. package/dist/impl-DMm4lt-A.cjs +0 -2
  233. package/dist/impl-DMm4lt-A.cjs.map +0 -1
  234. package/dist/impl-DRsuGuRx.cjs +0 -2
  235. package/dist/impl-DRsuGuRx.cjs.map +0 -1
  236. package/dist/impl-DSrvfkVp.cjs +0 -2
  237. package/dist/impl-DSrvfkVp.cjs.map +0 -1
  238. package/dist/impl-DZMWJNLE.cjs +0 -2
  239. package/dist/impl-DbqAvW7X.cjs +0 -2
  240. package/dist/impl-DbqAvW7X.cjs.map +0 -1
  241. package/dist/impl-Dl78xJu6.cjs +0 -2
  242. package/dist/impl-Dl78xJu6.cjs.map +0 -1
  243. package/dist/impl-Dvpc-Qa5.cjs +0 -2
  244. package/dist/impl-Dvpc-Qa5.cjs.map +0 -1
  245. package/dist/impl-DySeNL1m.cjs +0 -2
  246. package/dist/impl-DySeNL1m.cjs.map +0 -1
  247. package/dist/impl-Fj-Esff-.cjs +0 -2
  248. package/dist/impl-Fj-Esff-.cjs.map +0 -1
  249. package/dist/impl-W6tVmm8N.cjs +0 -2
  250. package/dist/impl-W6tVmm8N.cjs.map +0 -1
  251. package/dist/impl-WphnR0cX.cjs +0 -2
  252. package/dist/impl-WphnR0cX.cjs.map +0 -1
  253. package/dist/impl-YNAicr-z.cjs +0 -2
  254. package/dist/impl-YNAicr-z.cjs.map +0 -1
  255. package/dist/impl-jEpWgC2N.cjs +0 -2
  256. package/dist/impl-jEpWgC2N.cjs.map +0 -1
  257. package/dist/impl-x2P-_Pk2.cjs +0 -4
  258. package/dist/impl-x2P-_Pk2.cjs.map +0 -1
  259. package/dist/index.cjs +0 -5
  260. package/dist/index.cjs.map +0 -1
  261. package/dist/logger-DQwEYtSS.cjs +0 -2
  262. package/dist/logger-DQwEYtSS.cjs.map +0 -1
  263. package/dist/manual-enrichment-DTVJo7hP.cjs +0 -2
  264. package/dist/manual-enrichment-DTVJo7hP.cjs.map +0 -1
  265. package/dist/mergeTranscendInputs-BIBCYbug.cjs +0 -2
  266. package/dist/pooling-C-TYBnHI.cjs +0 -23
  267. package/dist/pooling-C-TYBnHI.cjs.map +0 -1
  268. package/dist/preference-management-Ch77Yxod.cjs +0 -7
  269. package/dist/preference-management-Ch77Yxod.cjs.map +0 -1
  270. package/dist/readTranscendYaml-Cycz6RxW.cjs +0 -4
  271. package/dist/readTranscendYaml-Cycz6RxW.cjs.map +0 -1
  272. package/dist/syncConfigurationToTranscend-s-cjtUI3.cjs +0 -3010
  273. package/dist/syncConfigurationToTranscend-s-cjtUI3.cjs.map +0 -1
  274. package/dist/uploadConsents-CDkk_sWY.cjs +0 -2
  275. package/dist/uploadConsents-CDkk_sWY.cjs.map +0 -1
  276. /package/dist/bin/{bash-complete.d.cts → bash-complete.d.mts} +0 -0
  277. /package/dist/bin/{cli.d.cts → cli.d.mts} +0 -0
  278. /package/dist/bin/{deprecated-command.d.cts → deprecated-command.d.mts} +0 -0
@@ -0,0 +1,75 @@
1
+ import{t as e}from"./logger-Bj782ZYD.mjs";import{Cs as t,Ds as n,Ss as r,bs as i,i as a,js as o}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{SubDataPointDataSubCategoryGuessStatus as s}from"@transcend-io/privacy-types";import{chunk as c,keyBy as l,sortBy as u,uniq as d}from"lodash-es";import f from"colors";import{gql as p}from"graphql-request";import m from"cli-progress";async function h(t,{dataSiloIds:r=[],includeGuessedCategories:i,includeAttributes:o,parentCategories:c=[],subCategories:l=[],pageSize:d=1e3}={}){let h=[],g=new Date().getTime(),_=new m.SingleBar({},m.Presets.shades_classic),v={...c.length>0?{category:c}:{},...l.length>0?{subCategoryIds:l}:{},...c.length+l.length>0&&!i?{status:s.Approved}:{},...r.length>0?{dataSilos:r}:{}},{subDataPoints:{totalCount:y}}=await a(t,n,{filterBy:v});e.info(f.magenta(`[Step 1/3] Pulling in all subdatapoints`)),_.start(y,0);let b=0,x=!1,S,C=0;do try{let{subDataPoints:{nodes:e}}=await a(t,p`
2
+ query TranscendCliSubDataPointCsvExport(
3
+ $filterBy: SubDataPointFiltersInput
4
+ $first: Int!
5
+ $offset: Int!
6
+ ) {
7
+ subDataPoints(
8
+ filterBy: $filterBy
9
+ first: $first
10
+ offset: $offset
11
+ useMaster: false
12
+ ) {
13
+ nodes {
14
+ id
15
+ name
16
+ description
17
+ dataPointId
18
+ dataSiloId
19
+ purposes {
20
+ name
21
+ purpose
22
+ }
23
+ categories {
24
+ name
25
+ category
26
+ }
27
+ ${i?`pendingCategoryGuesses {
28
+ category {
29
+ name
30
+ category
31
+ }
32
+ status
33
+ classifierVersion
34
+ }`:``}
35
+ ${o?`attributeValues {
36
+ attributeKey {
37
+ name
38
+ }
39
+ name
40
+ }`:``}
41
+ }
42
+ }
43
+ }
44
+ `,{first:d,offset:C,filterBy:{...v}});S=e[e.length-1]?.id,h.push(...e),x=e.length===d,b+=e.length,C+=e.length,_.update(b)}catch(t){throw e.error(f.red(`An error fetching subdatapoints for cursor ${S} and offset ${C}`)),t}while(x);_.stop();let w=new Date().getTime()-g,T=u(h,`name`);return e.info(f.green(`Successfully pulled in ${T.length} subdatapoints in ${w/1e3} seconds!`)),T}async function g(n,{dataPointIds:r=[],pageSize:i=100}){let s=[],l=new Date().getTime(),u=new m.SingleBar({},m.Presets.shades_classic);e.info(f.magenta(`[Step 2/3] Fetching metadata for ${r.length} datapoints`));let d=c(r,i);u.start(r.length,0);let p=0;await o(d,async r=>{try{let{dataPoints:{nodes:e}}=await a(n,t,{first:i,filterBy:{ids:r}});s.push(...e),p+=r.length,u.update(p)}catch(t){throw e.error(f.red(`An error fetching subdatapoints for IDs ${r.join(`, `)}`)),t}}),u.stop();let h=new Date().getTime()-l;return e.info(f.green(`Successfully pulled in ${s.length} dataPoints in ${h/1e3} seconds!`)),s}async function _(t,{dataSiloIds:n=[],pageSize:r=100}){let s=[],l=new Date().getTime(),u=new m.SingleBar({},m.Presets.shades_classic);e.info(f.magenta(`[Step 3/3] Fetching metadata for ${n.length} data silos`));let d=c(n,r);u.start(n.length,0);let p=0;await o(d,async n=>{try{let{dataSilos:{nodes:e}}=await a(t,i,{first:r,filterBy:{ids:n}});s.push(...e),p+=n.length,u.update(p)}catch(t){throw e.error(f.red(`An error fetching data silos for IDs ${n.join(`, `)}`)),t}}),u.stop();let h=new Date().getTime()-l;return e.info(f.green(`Successfully pulled in ${s.length} data silos in ${h/1e3} seconds!`)),s}async function v(e,{dataSiloIds:t=[],includeGuessedCategories:n,includeAttributes:r,parentCategories:i=[],subCategories:a=[],pageSize:o=1e3}={}){let s=await h(e,{dataSiloIds:t,includeGuessedCategories:n,includeAttributes:r,parentCategories:i,subCategories:a,pageSize:o}),c=l(await g(e,{dataPointIds:d(s.map(e=>e.dataPointId))}),`id`),u=l(await _(e,{dataSiloIds:d(s.map(e=>e.dataSiloId))}),`id`);return s.map(e=>({...e,dataPoint:c[e.dataPointId],dataSilo:u[e.dataSiloId]}))}async function y(t,{dataSiloIds:n=[],status:i,subCategories:o=[],includeEncryptedSnippets:s,pageSize:c=100}={}){let l=[],d=new Date().getTime(),h=new m.SingleBar({},m.Presets.shades_classic),g={...o.length>0?{subCategoryIds:o}:{},...i?{status:i}:{},...n.length>0?{dataSilos:n}:{}},{unstructuredSubDataPointRecommendations:{totalCount:_}}=await a(t,r,{filterBy:g});e.info(f.magenta(`[Step 1/3] Pulling in all subdatapoints`)),h.start(_,0);let v=0,y=!1,b,x=0;do try{let{unstructuredSubDataPointRecommendations:{nodes:e}}=await a(t,p`
45
+ query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(
46
+ $filterBy: UnstructuredSubDataPointRecommendationsFilterInput
47
+ $first: Int!
48
+ $offset: Int!
49
+ ) {
50
+ unstructuredSubDataPointRecommendations(
51
+ filterBy: $filterBy
52
+ first: $first
53
+ offset: $offset
54
+ useMaster: false
55
+ ) {
56
+ nodes {
57
+ id
58
+ dataSiloId
59
+ scannedObjectPathId
60
+ scannedObjectId
61
+ ${s?`name`:``}
62
+ ${s?`contextSnippet`:``}
63
+ dataSubCategory {
64
+ name
65
+ category
66
+ }
67
+ status
68
+ confidence
69
+ classificationMethod
70
+ classifierVersion
71
+ }
72
+ }
73
+ }
74
+ `,{first:c,offset:x,filterBy:{...g}});b=e[e.length-1]?.id,l.push(...e),y=e.length===c,v+=e.length,x+=e.length,h.update(v)}catch(t){throw e.error(f.red(`An error fetching subdatapoints for cursor ${b} and offset ${x}`)),t}while(y);h.stop();let S=new Date().getTime()-d,C=u(l,`name`);return e.info(f.green(`Successfully pulled in ${C.length} subdatapoints in ${S/1e3} seconds!`)),C}export{v as n,y as t};
75
+ //# sourceMappingURL=data-inventory-CkS_kmus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-inventory-CkS_kmus.mjs","names":[],"sources":["../src/lib/data-inventory/pullAllDatapoints.ts","../src/lib/data-inventory/pullUnstructuredSubDataPointRecommendations.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport { keyBy, uniq, chunk, sortBy } from 'lodash-es';\nimport {\n type DataCategoryType,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport { gql } from 'graphql-request';\nimport colors from 'colors';\nimport type { GraphQLClient } from 'graphql-request';\nimport {\n DATAPOINT_EXPORT,\n DATA_SILO_EXPORT,\n type DataSiloAttributeValue,\n SUB_DATA_POINTS_COUNT,\n makeGraphQLRequest,\n} from '../graphql';\nimport { logger } from '../../logger';\nimport type { DataCategoryInput, ProcessingPurposeInput } from '../../codecs';\nimport { mapSeries } from '../bluebird';\n\nexport interface DataSiloCsvPreview {\n /** ID of dataSilo */\n id: string;\n /** Name of dataSilo */\n title: string;\n}\n\nexport interface DataPointCsvPreview {\n /** ID of dataPoint */\n id: string;\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n}\n\nexport interface SubDataPointCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** Data point ID */\n dataPointId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /** Attribute attached to subdatapoint */\n attributeValues?: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\nexport interface DatapointFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Whether to include guessed categories, defaults to only approved categories */\n includeGuessedCategories?: boolean;\n /** Whether or not to include attributes */\n includeAttributes?: boolean;\n /** Parent categories to filter down for */\n parentCategories?: DataCategoryType[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n}\n\n/**\n * Pull subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The subdatapoints\n */\nasync function pullSubDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<SubDataPointCsvPreview[]> {\n const subDataPoints: SubDataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n // Filters\n const filterBy = {\n ...(parentCategories.length > 0 ? { category: parentCategories } : {}),\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n // if parentCategories or subCategories and not includeGuessedCategories\n ...(parentCategories.length + subCategories.length > 0 &&\n !includeGuessedCategories\n ? // then only show data points with approved data categories\n { status: SubDataPointDataSubCategoryGuessStatus.Approved }\n : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n subDataPoints: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** Count */\n totalCount: number;\n };\n }>(client, SUB_DATA_POINTS_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPointCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliSubDataPointCsvExport(\n $filterBy: SubDataPointFiltersInput\n $first: Int!\n $offset: Int!\n ) {\n subDataPoints(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n name\n description\n dataPointId\n dataSiloId\n purposes {\n name\n purpose\n }\n categories {\n name\n category\n }\n ${\n includeGuessedCategories\n ? `pendingCategoryGuesses {\n category {\n name\n category\n }\n status\n classifierVersion\n }`\n : ''\n }\n ${\n includeAttributes\n ? `attributeValues {\n attributeKey {\n name\n }\n name\n }`\n : ''\n }\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n // TODO: https://transcend.height.app/T-40484 - add cursor support\n // ...(cursor ? { cursor: { id: cursor } } : {}),\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n subDataPoints.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`,\n ),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(subDataPoints, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return sorted;\n}\n\n/**\n * Pull datapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints\n */\nasync function pullDatapoints(\n client: GraphQLClient,\n {\n dataPointIds = [],\n pageSize = 100,\n }: {\n /** IDs of data points to filter down */\n dataPointIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataPointCsvPreview[]> {\n const dataPoints: DataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n logger.info(\n colors.magenta(\n `[Step 2/3] Fetching metadata for ${dataPointIds.length} datapoints`,\n ),\n );\n\n // Group by 100\n const dataPointsGrouped = chunk(dataPointIds, pageSize);\n\n progressBar.start(dataPointIds.length, 0);\n let total = 0;\n await mapSeries(dataPointsGrouped, async (dataPointIdsGroup) => {\n try {\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPointCsvPreview[];\n };\n }>(client, DATAPOINT_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataPointIdsGroup,\n },\n });\n\n dataPoints.push(...nodes);\n total += dataPointIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for IDs ${dataPointIdsGroup.join(\n ', ',\n )}`,\n ),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataPoints.length} dataPoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return dataPoints;\n}\n\n/**\n * Pull data silo information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The data silos\n */\nasync function pullDataSilos(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n pageSize = 100,\n }: {\n /** IDs of data silos to filter down */\n dataSiloIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataSiloCsvPreview[]> {\n const dataSilos: DataSiloCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n logger.info(\n colors.magenta(\n `[Step 3/3] Fetching metadata for ${dataSiloIds.length} data silos`,\n ),\n );\n\n // Group by 100\n const dataSilosGrouped = chunk(dataSiloIds, pageSize);\n\n progressBar.start(dataSiloIds.length, 0);\n let total = 0;\n await mapSeries(dataSilosGrouped, async (dataSiloIdsGroup) => {\n try {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: DataSiloCsvPreview[];\n };\n }>(client, DATA_SILO_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataSiloIdsGroup,\n },\n });\n\n dataSilos.push(...nodes);\n total += dataSiloIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching data silos for IDs ${dataSiloIdsGroup.join(', ')}`,\n ),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataSilos.length} data silos in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return dataSilos;\n}\n\n/**\n * Pull all datapoints from the data inventory.\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints and data silos\n */\nexport async function pullAllDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<\n (SubDataPointCsvPreview & {\n /** Data point information */\n dataPoint: DataPointCsvPreview;\n /** Data silo information */\n dataSilo: DataSiloCsvPreview;\n })[]\n> {\n // Subdatapoint information\n const subDatapoints = await pullSubDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n includeAttributes,\n parentCategories,\n subCategories,\n pageSize,\n });\n\n // The datapoint ids to grab\n const dataPointIds = uniq(subDatapoints.map((point) => point.dataPointId));\n const dataPoints = await pullDatapoints(client, {\n dataPointIds,\n });\n const dataPointById = keyBy(dataPoints, 'id');\n\n // The data silo IDs to grab\n const allDataSiloIds = uniq(subDatapoints.map((point) => point.dataSiloId));\n const dataSilos = await pullDataSilos(client, {\n dataSiloIds: allDataSiloIds,\n });\n const dataSiloById = keyBy(dataSilos, 'id');\n\n return subDatapoints.map((subDataPoint) => ({\n ...subDataPoint,\n dataPoint: dataPointById[subDataPoint.dataPointId],\n dataSilo: dataSiloById[subDataPoint.dataSiloId],\n }));\n}\n/* eslint-enable max-lines */\n","import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql, type GraphQLClient } from 'graphql-request';\nimport { sortBy } from 'lodash-es';\nimport type { DataCategoryInput } from '../../codecs';\nimport { ENTRY_COUNT, makeGraphQLRequest } from '../graphql';\nimport { logger } from '../../logger';\n\ninterface UnstructuredSubDataPointRecommendationCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Entry or Named Entity recognized by the classifier */\n name: string;\n /** Context snippet including entry */\n contextSnippet: string;\n /** Scanned object ID */\n scannedObjectId: string;\n /** Scanned object path ID */\n scannedObjectPathId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** Personal data category */\n dataSubCategory: DataCategoryInput;\n /** Classification Status */\n status: UnstructuredSubDataPointRecommendationStatus;\n /** Confidence */\n confidence: number;\n /** Classification method */\n classificationMethod: string;\n /** Classifier version */\n classifierVersion: string;\n}\n\ninterface EntryFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Parent categories to filter down for */\n status?: UnstructuredSubDataPointRecommendationStatus[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n /** Include entry and snippet */\n includeEncryptedSnippets?: boolean;\n /** Include encryptedSamplesS3Key */\n includeEncryptedSamplesS3Key?: boolean;\n}\n/**\n * Pull unstructured subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @param options.dataSiloIds - IDs of data silos to filter down\n * @param options.status - Parent categories to filter down for\n * @param options.subCategories - Sub categories to filter down for\n * @param options.includeEncryptedSnippets - Include entry and snippet\n * @param options.includeEncryptedSamplesS3Key - Include encryptedSamplesS3Key\n * @param options.pageSize - Page size to pull in\n * @returns A promise that resolves to an array of unstructured subdatapoint recommendations\n */\nexport async function pullUnstructuredSubDataPointRecommendations(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n status,\n subCategories = [],\n includeEncryptedSnippets,\n pageSize = 100,\n }: EntryFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<UnstructuredSubDataPointRecommendationCsvPreview[]> {\n const unstructuredSubDataPointRecommendations: UnstructuredSubDataPointRecommendationCsvPreview[] =\n [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n // Filters\n const filterBy = {\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n ...(status ? { status } : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n unstructuredSubDataPointRecommendations: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** Count */\n totalCount: number;\n };\n }>(client, ENTRY_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n unstructuredSubDataPointRecommendations: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** List of matches */\n nodes: UnstructuredSubDataPointRecommendationCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(\n $filterBy: UnstructuredSubDataPointRecommendationsFilterInput\n $first: Int!\n $offset: Int!\n ) {\n unstructuredSubDataPointRecommendations(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n dataSiloId\n scannedObjectPathId\n scannedObjectId\n ${includeEncryptedSnippets ? 'name' : ''}\n ${includeEncryptedSnippets ? 'contextSnippet' : ''}\n dataSubCategory {\n name\n category\n }\n status\n confidence\n classificationMethod\n classifierVersion\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n unstructuredSubDataPointRecommendations.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`,\n ),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(unstructuredSubDataPointRecommendations, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return sorted;\n}\n"],"mappings":"kYA0FA,eAAe,EACb,EACA,CACE,cAAc,EAAE,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AAS,CAGzB,EAAc,IAAI,EAAY,UAClC,EAAE,CACF,EAAY,QAAQ,eACrB,CAGK,EAAW,CACf,GAAI,EAAc,OAAS,EAAI,CAAE,eAAgB,EAAe,CAAG,EAAE,CACrE,GAAI,EAAS,CAAE,SAAQ,CAAG,EAAE,CAC5B,GAAI,EAAY,OAAS,EAAI,CAAE,UAAW,EAAa,CAAG,EAAE,CAC7D,CAGK,CACJ,wCAAyC,CAAE,eACzC,MAAM,EAMP,EAAQ,EAAa,CACtB,WACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,0CAA0C,CAAC,CAEtE,EAAY,MAAM,EAAY,EAAE,CAChC,IAAI,EAAQ,EACR,EAAiB,GACjB,EACA,EAAS,EACb,EACE,IAAI,CACF,GAAM,CACJ,wCAAyC,CAAE,UACzC,MAAM,EAOR,EACA,CAAG;;;;;;;;;;;;;;;;;kBAiBO,EAA2B,OAAS,GAAG;kBACvC,EAA2B,iBAAmB,GAAG;;;;;;;;;;;;UAa3D,CACE,MAAO,EACP,SACA,SAAU,CACR,GAAG,EACJ,CACF,CACF,CAED,EAAS,EAAM,EAAM,OAAS,IAAI,GAClC,EAAwC,KAAK,GAAG,EAAM,CACtD,EAAiB,EAAM,SAAW,EAClC,GAAS,EAAM,OACf,GAAU,EAAM,OAChB,EAAY,OAAO,EAAM,OAClB,EAAK,CAMZ,MALA,EAAO,MACL,EAAO,IACL,8CAA8C,EAAO,cAAc,IACpE,CACF,CACK,QAED,GAET,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAEjB,EAAS,EAAO,EAAyC,OAAO,CAStE,OAPA,EAAO,KACL,EAAO,MACL,0BAA0B,EAAO,OAAO,oBACtC,EAAY,IACb,WACF,CACF,CACM"}
@@ -0,0 +1,2 @@
1
+ import{union as e}from"lodash-es";function t(t,{adTechPurposes:n=[`SaleOfInfo`],serviceToTitle:r,serviceToSupportedIntegration:i}){let a=[],o=[],s={};t.forEach(t=>{let{service:r,attributes:i=[]}=t;if(!r||r===`internalService`)return;let c=i.find(e=>e.key===`Found on Domain`);c&&(s[r]||(s[r]=[]),s[r].push(...c.values.map(e=>e.replace(`https://`,``).replace(`http://`,``))),s[r]=[...new Set(s[r])]),e(t.trackingPurposes,n).length>0?(o.push(r),a.includes(r)&&(a=a.filter(e=>e!==r))):o.includes(r)||a.push(r)});let c=[...new Set(o)].map(e=>({title:r[e],...i[e]?{integrationName:e}:{integrationName:`promptAPerson`,"outer-type":e},attributes:[{key:`Tech Type`,values:[`Ad Tech`]},{key:`Found On Domain`,values:s[e]||[]}]}));return{siteTechDataSilos:[...new Set(a)].map(e=>({title:r[e],...i[e]?{integrationName:e}:{integrationName:`promptAPerson`,outerType:e},attributes:[{key:`Tech Type`,values:[`Site Tech`]},{key:`Found On Domain`,values:s[e]||[]}]})),adTechDataSilos:c}}export{t};
2
+ //# sourceMappingURL=dataFlowsToDataSilos-RAhfPV0l.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataFlowsToDataSilos-RAhfPV0l.mjs","names":[],"sources":["../src/lib/consent-manager/dataFlowsToDataSilos.ts"],"sourcesContent":["import { DataFlowInput, DataSiloInput } from '../../codecs';\nimport { union } from 'lodash-es';\nimport { IndexedCatalogs } from '../graphql';\n\n/**\n * Convert data flow configurations into a set of data silo configurations\n *\n * @param inputs - Data flow input to convert to data silos\n * @param options - Additional options\n * @returns Business entity configuration input\n */\nexport function dataFlowsToDataSilos(\n inputs: DataFlowInput[],\n {\n adTechPurposes = ['SaleOfInfo'],\n serviceToTitle,\n serviceToSupportedIntegration,\n }: IndexedCatalogs & {\n /** List of purposes that are considered \"Ad Tech\" */\n adTechPurposes?: string[];\n },\n): {\n /** List of data silo configurations for site-tech services */\n siteTechDataSilos: DataSiloInput[];\n /** List of data silo configurations for ad-tech services */\n adTechDataSilos: DataSiloInput[];\n} {\n // List of site tech integrations\n let siteTechIntegrations: string[] = [];\n\n // List of ad tech integrations\n const adTechIntegrations: string[] = [];\n\n // Mapping from service name to list of\n const serviceToFoundOnDomain: { [k in string]: string[] } = {};\n\n // iterate over each flow\n inputs.forEach((flow) => {\n // process data flows with services\n const { service, attributes = [] } = flow;\n if (!service || service === 'internalService') {\n return;\n }\n\n // create mapping to found on domain\n const foundOnDomain = attributes.find(\n (attr) => attr.key === 'Found on Domain',\n );\n\n // Create a list of all domains where the data flow was found\n if (foundOnDomain) {\n if (!serviceToFoundOnDomain[service]) {\n serviceToFoundOnDomain[service] = [];\n }\n serviceToFoundOnDomain[service]!.push(\n ...foundOnDomain.values.map((v) =>\n v.replace('https://', '').replace('http://', ''),\n ),\n );\n serviceToFoundOnDomain[service] = [\n ...new Set(serviceToFoundOnDomain[service]),\n ];\n }\n\n // Keep track of ad tech\n if (union(flow.trackingPurposes, adTechPurposes).length > 0) {\n // add service to ad tech list\n adTechIntegrations.push(service);\n\n // remove from site tech list\n if (siteTechIntegrations.includes(service)) {\n siteTechIntegrations = siteTechIntegrations.filter(\n (s) => s !== service,\n );\n }\n } else if (!adTechIntegrations.includes(service)) {\n // add to site tech list\n siteTechIntegrations.push(service);\n }\n });\n\n // create the list of ad tech integrations\n const adTechDataSilos = [...new Set(adTechIntegrations)].map((service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', 'outer-type': service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Ad Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }));\n\n // create the list of site tech integrations\n const siteTechDataSilos = [...new Set(siteTechIntegrations)].map(\n (service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', outerType: service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Site Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }),\n );\n\n return {\n siteTechDataSilos,\n ad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E,gBAAiB,gBAAiB,UAAW,EAAS,CAC5D,WAAY,CACV,CACE,IAAK,YACL,OAAQ,CAAC,YAAY,CACtB,CACD,CACE,IAAK,kBACL,OAAQ,EAAuB,IAAY,EAAE,CAC9C,CACF,CACF,EACF,CAIC,kBACD"}
@@ -0,0 +1,2 @@
1
+ function e(e){process.env.DEVELOPMENT_MODE_VALIDATE_ONLY===`true`&&e(0)}export{e as t};
2
+ //# sourceMappingURL=done-input-validation-CcZtaz03.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"done-input-validation-DGckEJ5a.cjs","names":[],"sources":["../src/lib/cli/done-input-validation.ts"],"sourcesContent":["/**\n * If the environment variable `DEVELOPMENT_MODE_VALIDATE_ONLY` is set,\n * this function will exit the process with a status code of 0.\n *\n * This is useful for development mode, where we want to validate the\n * command flags without actually running the command.\n *\n * This should be called after input validation, and must be agnostic to the environment (e.g., the existence of a file on the file system)\n *\n * @param exit - The function to exit the process.\n */\nexport function doneInputValidation(exit: (code?: number) => void): void {\n if (process.env.DEVELOPMENT_MODE_VALIDATE_ONLY === 'true') {\n exit(0);\n }\n}\n"],"mappings":"AAWA,SAAgB,EAAoB,EAAqC,CACnE,QAAQ,IAAI,iCAAmC,QACjD,EAAK,EAAE"}
1
+ {"version":3,"file":"done-input-validation-CcZtaz03.mjs","names":[],"sources":["../src/lib/cli/done-input-validation.ts"],"sourcesContent":["/**\n * If the environment variable `DEVELOPMENT_MODE_VALIDATE_ONLY` is set,\n * this function will exit the process with a status code of 0.\n *\n * This is useful for development mode, where we want to validate the\n * command flags without actually running the command.\n *\n * This should be called after input validation, and must be agnostic to the environment (e.g., the existence of a file on the file system)\n *\n * @param exit - The function to exit the process.\n */\nexport function doneInputValidation(exit: (code?: number) => void): void {\n if (process.env.DEVELOPMENT_MODE_VALIDATE_ONLY === 'true') {\n exit(0);\n }\n}\n"],"mappings":"AAWA,SAAgB,EAAoB,EAAqC,CACnE,QAAQ,IAAI,iCAAmC,QACjD,EAAK,EAAE"}
@@ -0,0 +1,2 @@
1
+ import{makeEnum as e}from"@transcend-io/type-utils";let t=function(e){return e.Json=`json`,e}({}),n=function(e){return e.Assessments=`assessments`,e}({}),r=function(e){return e.OneTrust=`oneTrust`,e.File=`file`,e}({}),i=function(e){return e.ApiKeys=`apiKeys`,e.Attributes=`customFields`,e.Templates=`templates`,e.DataSilos=`dataSilos`,e.Enrichers=`enrichers`,e.DataFlows=`dataFlows`,e.BusinessEntities=`businessEntities`,e.ProcessingActivities=`processingActivities`,e.Actions=`actions`,e.DataSubjects=`dataSubjects`,e.Identifiers=`identifiers`,e.Cookies=`cookies`,e.ConsentManager=`consentManager`,e.Partitions=`partitions`,e.Prompts=`prompts`,e.PromptPartials=`promptPartials`,e.PromptGroups=`promptGroups`,e.Agents=`agents`,e.AgentFunctions=`agentFunctions`,e.AgentFiles=`agentFiles`,e.Vendors=`vendors`,e.DataCategories=`dataCategories`,e.ProcessingPurposes=`processingPurposes`,e.ActionItems=`actionItems`,e.ActionItemCollections=`actionItemCollections`,e.Teams=`teams`,e.PrivacyCenters=`privacyCenters`,e.Policies=`policies`,e.Messages=`messages`,e.Assessments=`assessments`,e.AssessmentTemplates=`assessmentTemplates`,e.Purposes=`purposes`,e.SystemDiscovery=`systemDiscovery`,e}({});const a=e({RedactEmail:`redactEmail`,Log:`log`,LogToTranscend:`logToTranscend`,ApplyTranscendPolicies:`applyTranscendPolicies`}),o=e({ChatCompletion:`/v1/chat/completions`,Embeddings:`/v1/embeddings`,Completions:`/v1/completions`,Agents:`/v1/assistants`,Agent:`/v1/assistants/:assistantId`,Threads:`/v1/threads`,Thread:`/v1/threads/:threadId`,Messages:`/v1/threads/:threadId/messages`,Message:`/v1/threads/:threadId/messages/:messageId`,Runs:`/v1/threads/:threadId/runs`,Run:`/v1/threads/:threadId/runs/:runId`,Files:`/v1/files`,File:`/v1/files/:fileId`});export{a,o as i,n,i as o,r,t};
2
+ //# sourceMappingURL=enums-CyFTrzXY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums-BZulhPFa.cjs","names":[],"sources":["../src/enums.ts"],"sourcesContent":["import { makeEnum } from '@transcend-io/type-utils';\n\n/** Accepted file formats for exporting resources from OneTrust */\nexport enum OneTrustFileFormat {\n Json = 'json',\n}\n\n/**\n * Resources that can be pulled in from OneTrust\n */\nexport enum OneTrustPullResource {\n Assessments = 'assessments',\n}\n\n/**\n * Where to read OneTrust resources from\n */\nexport enum OneTrustPullSource {\n OneTrust = 'oneTrust',\n File = 'file',\n}\n\n/**\n * Resources that can be pulled in\n */\nexport enum TranscendPullResource {\n ApiKeys = 'apiKeys',\n Attributes = 'customFields',\n Templates = 'templates',\n DataSilos = 'dataSilos',\n Enrichers = 'enrichers',\n DataFlows = 'dataFlows',\n BusinessEntities = 'businessEntities',\n ProcessingActivities = 'processingActivities',\n Actions = 'actions',\n DataSubjects = 'dataSubjects',\n Identifiers = 'identifiers',\n Cookies = 'cookies',\n ConsentManager = 'consentManager',\n Partitions = 'partitions',\n Prompts = 'prompts',\n PromptPartials = 'promptPartials',\n PromptGroups = 'promptGroups',\n Agents = 'agents',\n AgentFunctions = 'agentFunctions',\n AgentFiles = 'agentFiles',\n Vendors = 'vendors',\n DataCategories = 'dataCategories',\n ProcessingPurposes = 'processingPurposes',\n ActionItems = 'actionItems',\n ActionItemCollections = 'actionItemCollections',\n Teams = 'teams',\n PrivacyCenters = 'privacyCenters',\n Policies = 'policies',\n Messages = 'messages',\n Assessments = 'assessments',\n AssessmentTemplates = 'assessmentTemplates',\n Purposes = 'purposes',\n SystemDiscovery = 'systemDiscovery',\n}\n\n/**\n * Names of built in policies for pathfinder\n */\nexport const PathfinderPolicyName = makeEnum({\n RedactEmail: 'redactEmail',\n Log: 'log',\n LogToTranscend: 'logToTranscend',\n ApplyTranscendPolicies: 'applyTranscendPolicies',\n});\n\n/**\n * Type override\n */\nexport type PathfinderPolicyName =\n (typeof PathfinderPolicyName)[keyof typeof PathfinderPolicyName];\n\n/**\n * The names of the OpenAI routes that we support setting policies for\n * reference: https://platform.openai.com/docs/api-reference/introduction\n */\nexport const OpenAIRouteName = makeEnum({\n ChatCompletion: '/v1/chat/completions',\n Embeddings: '/v1/embeddings',\n Completions: '/v1/completions',\n Agents: '/v1/assistants',\n Agent: '/v1/assistants/:assistantId',\n Threads: '/v1/threads',\n Thread: '/v1/threads/:threadId',\n Messages: '/v1/threads/:threadId/messages',\n Message: '/v1/threads/:threadId/messages/:messageId',\n Runs: '/v1/threads/:threadId/runs',\n Run: '/v1/threads/:threadId/runs/:runId',\n Files: '/v1/files',\n File: '/v1/files/:fileId',\n});\n\n/**\n * Type override\n */\nexport type OpenAIRouteName =\n (typeof OpenAIRouteName)[keyof typeof OpenAIRouteName];\n"],"mappings":"kFAGY,EAAA,SAAA,EAAL,OACL,GAAA,KAAA,cAMU,EAAA,SAAA,EAAL,OACL,GAAA,YAAA,qBAMU,EAAA,SAAA,EAAL,OACL,GAAA,SAAA,WACA,EAAA,KAAA,cAMU,EAAA,SAAA,EAAL,OACL,GAAA,QAAA,UACA,EAAA,WAAA,eACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,iBAAA,mBACA,EAAA,qBAAA,uBACA,EAAA,QAAA,UACA,EAAA,aAAA,eACA,EAAA,YAAA,cACA,EAAA,QAAA,UACA,EAAA,eAAA,iBACA,EAAA,WAAA,aACA,EAAA,QAAA,UACA,EAAA,eAAA,iBACA,EAAA,aAAA,eACA,EAAA,OAAA,SACA,EAAA,eAAA,iBACA,EAAA,WAAA,aACA,EAAA,QAAA,UACA,EAAA,eAAA,iBACA,EAAA,mBAAA,qBACA,EAAA,YAAA,cACA,EAAA,sBAAA,wBACA,EAAA,MAAA,QACA,EAAA,eAAA,iBACA,EAAA,SAAA,WACA,EAAA,SAAA,WACA,EAAA,YAAA,cACA,EAAA,oBAAA,sBACA,EAAA,SAAA,WACA,EAAA,gBAAA,yBAMF,MAAa,GAAA,EAAA,EAAA,UAAgC,CAC3C,YAAa,cACb,IAAK,MACL,eAAgB,iBAChB,uBAAwB,yBACzB,CAAC,CAYW,GAAA,EAAA,EAAA,UAA2B,CACtC,eAAgB,uBAChB,WAAY,iBACZ,YAAa,kBACb,OAAQ,iBACR,MAAO,8BACP,QAAS,cACT,OAAQ,wBACR,SAAU,iCACV,QAAS,4CACT,KAAM,6BACN,IAAK,oCACL,MAAO,YACP,KAAM,oBACP,CAAC"}
1
+ {"version":3,"file":"enums-CyFTrzXY.mjs","names":[],"sources":["../src/enums.ts"],"sourcesContent":["import { makeEnum } from '@transcend-io/type-utils';\n\n/** Accepted file formats for exporting resources from OneTrust */\nexport enum OneTrustFileFormat {\n Json = 'json',\n}\n\n/**\n * Resources that can be pulled in from OneTrust\n */\nexport enum OneTrustPullResource {\n Assessments = 'assessments',\n}\n\n/**\n * Where to read OneTrust resources from\n */\nexport enum OneTrustPullSource {\n OneTrust = 'oneTrust',\n File = 'file',\n}\n\n/**\n * Resources that can be pulled in\n */\nexport enum TranscendPullResource {\n ApiKeys = 'apiKeys',\n Attributes = 'customFields',\n Templates = 'templates',\n DataSilos = 'dataSilos',\n Enrichers = 'enrichers',\n DataFlows = 'dataFlows',\n BusinessEntities = 'businessEntities',\n ProcessingActivities = 'processingActivities',\n Actions = 'actions',\n DataSubjects = 'dataSubjects',\n Identifiers = 'identifiers',\n Cookies = 'cookies',\n ConsentManager = 'consentManager',\n Partitions = 'partitions',\n Prompts = 'prompts',\n PromptPartials = 'promptPartials',\n PromptGroups = 'promptGroups',\n Agents = 'agents',\n AgentFunctions = 'agentFunctions',\n AgentFiles = 'agentFiles',\n Vendors = 'vendors',\n DataCategories = 'dataCategories',\n ProcessingPurposes = 'processingPurposes',\n ActionItems = 'actionItems',\n ActionItemCollections = 'actionItemCollections',\n Teams = 'teams',\n PrivacyCenters = 'privacyCenters',\n Policies = 'policies',\n Messages = 'messages',\n Assessments = 'assessments',\n AssessmentTemplates = 'assessmentTemplates',\n Purposes = 'purposes',\n SystemDiscovery = 'systemDiscovery',\n}\n\n/**\n * Names of built in policies for pathfinder\n */\nexport const PathfinderPolicyName = makeEnum({\n RedactEmail: 'redactEmail',\n Log: 'log',\n LogToTranscend: 'logToTranscend',\n ApplyTranscendPolicies: 'applyTranscendPolicies',\n});\n\n/**\n * Type override\n */\nexport type PathfinderPolicyName =\n (typeof PathfinderPolicyName)[keyof typeof PathfinderPolicyName];\n\n/**\n * The names of the OpenAI routes that we support setting policies for\n * reference: https://platform.openai.com/docs/api-reference/introduction\n */\nexport const OpenAIRouteName = makeEnum({\n ChatCompletion: '/v1/chat/completions',\n Embeddings: '/v1/embeddings',\n Completions: '/v1/completions',\n Agents: '/v1/assistants',\n Agent: '/v1/assistants/:assistantId',\n Threads: '/v1/threads',\n Thread: '/v1/threads/:threadId',\n Messages: '/v1/threads/:threadId/messages',\n Message: '/v1/threads/:threadId/messages/:messageId',\n Runs: '/v1/threads/:threadId/runs',\n Run: '/v1/threads/:threadId/runs/:runId',\n Files: '/v1/files',\n File: '/v1/files/:fileId',\n});\n\n/**\n * Type override\n */\nexport type OpenAIRouteName =\n (typeof OpenAIRouteName)[keyof typeof OpenAIRouteName];\n"],"mappings":"oDAGA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,aACD,CAKW,EAAL,SAAA,EAAA,OACL,GAAA,YAAA,oBACD,CAKW,EAAL,SAAA,EAAA,OACL,GAAA,SAAA,WACA,EAAA,KAAA,aACD,CAKW,EAAL,SAAA,EAAA,OACL,GAAA,QAAA,UACA,EAAA,WAAA,eACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,iBAAA,mBACA,EAAA,qBAAA,uBACA,EAAA,QAAA,UACA,EAAA,aAAA,eACA,EAAA,YAAA,cACA,EAAA,QAAA,UACA,EAAA,eAAA,iBACA,EAAA,WAAA,aACA,EAAA,QAAA,UACA,EAAA,eAAA,iBACA,EAAA,aAAA,eACA,EAAA,OAAA,SACA,EAAA,eAAA,iBACA,EAAA,WAAA,aACA,EAAA,QAAA,UACA,EAAA,eAAA,iBACA,EAAA,mBAAA,qBACA,EAAA,YAAA,cACA,EAAA,sBAAA,wBACA,EAAA,MAAA,QACA,EAAA,eAAA,iBACA,EAAA,SAAA,WACA,EAAA,SAAA,WACA,EAAA,YAAA,cACA,EAAA,oBAAA,sBACA,EAAA,SAAA,WACA,EAAA,gBAAA,wBACD,CAKD,MAAa,EAAuB,EAAS,CAC3C,YAAa,cACb,IAAK,MACL,eAAgB,iBAChB,uBAAwB,yBACzB,CAAC,CAYW,EAAkB,EAAS,CACtC,eAAgB,uBAChB,WAAY,iBACZ,YAAa,kBACb,OAAQ,iBACR,MAAO,8BACP,QAAS,cACT,OAAQ,wBACR,SAAU,iCACV,QAAS,4CACT,KAAM,6BACN,IAAK,oCACL,MAAO,YACP,KAAM,oBACP,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import"./codecs-TR6p48v3.mjs";import"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{o as e}from"./consent-manager-c4bgQF1N.mjs";import"./uploadConsents-C1S-BNzw.mjs";import{t}from"./done-input-validation-CcZtaz03.mjs";async function n({auth:n,trackerStatus:r,file:i,transcendUrl:a}){t(this.process.exit),await e({auth:n,trackerStatus:r,file:i,transcendUrl:a})}export{n as uploadCookiesFromCsv};
2
+ //# sourceMappingURL=impl-8dOatHnF.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BN8N7BHo.cjs","names":["uploadCookiesFromCsvHelper"],"sources":["../src/commands/consent/upload-cookies-from-csv/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { uploadCookiesFromCsv as uploadCookiesFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadCookiesFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n transcendUrl: string;\n}\n\nexport async function uploadCookiesFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, transcendUrl }: UploadCookiesFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Upload cookies\n await uploadCookiesFromCsvHelper({\n auth,\n trackerStatus,\n file,\n transcendUrl,\n });\n}\n"],"mappings":"iYAYA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,gBACd,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAGtC,MAAMA,EAAAA,EAA2B,CAC/B,OACA,gBACA,OACA,eACD,CAAC"}
1
+ {"version":3,"file":"impl-8dOatHnF.mjs","names":["uploadCookiesFromCsvHelper"],"sources":["../src/commands/consent/upload-cookies-from-csv/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { uploadCookiesFromCsv as uploadCookiesFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadCookiesFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n transcendUrl: string;\n}\n\nexport async function uploadCookiesFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, transcendUrl }: UploadCookiesFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Upload cookies\n await uploadCookiesFromCsvHelper({\n auth,\n trackerStatus,\n file,\n transcendUrl,\n });\n}\n"],"mappings":"yWAYA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,gBACd,CACf,EAAoB,KAAK,QAAQ,KAAK,CAGtC,MAAMA,EAA2B,CAC/B,OACA,gBACA,OACA,eACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./command-Bzyj3M2G.mjs";import{o as n}from"./enums-CyFTrzXY.mjs";import{r}from"./constants-CnLQtIBn.mjs";import{t as i}from"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import"./codecs-TR6p48v3.mjs";import{a}from"./readTranscendYaml-DhKG1ViI.mjs";import{ai as o,js as s,yn as c}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{r as l}from"./api-keys-CxvKdj2v.mjs";import{t as u}from"./done-input-validation-CcZtaz03.mjs";import d from"node:fs";import{join as f}from"node:path";import p from"colors";async function m({auth:m,resources:h=e,file:g,transcendUrl:_,dataSiloIds:v=[],integrationNames:y=[],trackerStatuses:b=t,pageSize:x,skipDatapoints:S,skipSubDatapoints:C,includeGuessedCategories:w,debug:T}){u(this.process.exit);let E=await l(m),D=h.includes(`all`)?Object.values(n):h;if(typeof E==`string`){try{let e=await c(o(_,E),{dataSiloIds:v,integrationNames:y,resources:D,pageSize:x,debug:T,skipDatapoints:S,skipSubDatapoints:C,includeGuessedCategories:w,trackerStatuses:b});i.info(p.magenta(`Writing configuration to file "${g}"...`)),a(g,e)}catch(e){i.error(p.red(`An error occurred syncing the schema: ${T?e.stack:e.message}`)),this.process.exit(1)}i.info(p.green(`Successfully synced yaml file to disk at ${g}! View at ${r}`))}else{if(!d.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 s(E,async(t,n)=>{let r=`[${n+1}/${E.length}][${t.organizationName}] `;i.info(p.magenta(`~~~\n\n${r}Attempting to pull configuration...\n\n~~~`));let s=o(_,t.apiKey);try{let e=await c(s,{dataSiloIds:v,integrationNames:y,resources:D,pageSize:x,debug:T,skipDatapoints:S,skipSubDatapoints:C,includeGuessedCategories:w,trackerStatuses:b}),n=f(g,`${t.organizationName}.yml`);i.info(p.magenta(`Writing configuration to file "${n}"...`)),a(n,e),i.info(p.green(`${r}Successfully pulled configuration!`))}catch(n){i.error(p.red(`${r}Failed to sync configuration. - ${n.message}`)),e.push(t.organizationName)}}),e.length>0&&(i.info(p.red(`Sync encountered errors for "${e.join(`,`)}". View output above for more information, or check out ${r}`)),this.process.exit(1))}}export{m as pull};
2
+ //# sourceMappingURL=impl-Ah-1lwzr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-Ah-1lwzr.mjs","names":[],"sources":["../src/commands/inventory/pull/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport type { LocalContext } from '../../../context';\nimport { TranscendPullResource } from '../../../enums';\nimport {\n DEFAULT_CONSENT_TRACKER_STATUSES,\n DEFAULT_TRANSCEND_PULL_RESOURCES,\n} from './command';\n\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { mapSeries } from '../../../lib/bluebird';\nimport { join } from 'node:path';\nimport fs from 'node:fs';\nimport {\n buildTranscendGraphQLClient,\n pullTranscendConfiguration,\n} from '../../../lib/graphql';\n\nimport { writeTranscendYaml } from '../../../lib/readTranscendYaml';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\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(\n `An error occurred syncing the schema: ${\n debug ? err.stack : err.message\n }`,\n ),\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}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to pull configuration...\\n\\n~~~`,\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(\n colors.magenta(`Writing configuration to file \"${filePath}\"...`),\n );\n writeTranscendYaml(filePath, configuration);\n\n logger.info(\n colors.green(`${prefix}Successfully pulled configuration!`),\n );\n } catch (err) {\n logger.error(\n colors.red(`${prefix}Failed to sync configuration. - ${err.message}`),\n );\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":"wiBAsCA,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,EAAa,CAEP,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,IACL,yCACE,EAAQ,EAAI,MAAQ,EAAI,UAE3B,CACF,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,IAChD,EAAO,iBACR,IACD,EAAO,KACL,EAAO,QACL,UAAU,EAAO,4CAClB,CACF,CAGD,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,KACL,EAAO,QAAQ,kCAAkC,EAAS,MAAM,CACjE,CACD,EAAmB,EAAU,EAAc,CAE3C,EAAO,KACL,EAAO,MAAM,GAAG,EAAO,oCAAoC,CAC5D,OACM,EAAK,CACZ,EAAO,MACL,EAAO,IAAI,GAAG,EAAO,kCAAkC,EAAI,UAAU,CACtE,CACD,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"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import{t as e}from"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{Kr as t,ai as n,l as r,ui as i}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t as a}from"./done-input-validation-CcZtaz03.mjs";import{SombraStandardScope as o}from"@transcend-io/privacy-types";import{existsSync as s}from"node:fs";import c from"colors";import*as l from"io-ts";import u from"cli-progress";async function d({auth:d,file:f,transcendUrl:p,duration:m,subjectType:h,emailColumnName:g,coreIdentifierColumnName:_}){a(this.process.exit),s(f)||(e.error(c.red(`File does not exist: "${f}". Please provide a valid path to a CSV file.`)),this.process.exit(1));try{let a=n(p,d),s=i(f,l.type({[g]:l.string,..._?{[_]:l.string}:{}}));if(!s.length)throw Error(`Input CSV is empty.`);let v=s.map((e,t)=>[e,t]).filter(([e])=>!e[g]?.trim());if(v.length){let e=v.map(([,e])=>e+2).join(`, `);throw Error(`The following rows are missing the required "${g}" column: ${e}`)}if(_){let e=s.map((e,t)=>[e,t]).filter(([e])=>!e[_]?.trim());if(e.length){let t=e.map(([,e])=>e+2).join(`, `);throw Error(`The following rows are missing the required "${_}" column: ${t}`)}}let y=Math.max(1,Math.floor(m/1e3)),b=s.map((e,t)=>{let n=e[g].trim(),r=_?e[_]?.trim():void 0;return{subjectType:h,scopes:[o.PreferenceManagement],expiresIn:y,email:n,...r?{coreIdentifier:r}:{},index:t}}),x=new u.SingleBar({},u.Presets.shades_classic);x.start(b.length,0);let S=Date.now(),C=await t(a,b,e=>{x.update(e)});x.update(b.length),x.stop();let w=C.map(({accessToken:e,input:t})=>{if(typeof t.index!=`number`)throw Error(`Internal error: missing input index.`);return{...s[t.index],token:e}});e.info(c.magenta(`Writing access tokens to file "${f}"...`)),await r(f,w,!0);let T=Math.round((Date.now()-S)/1e3);e.info(c.green(`Successfully generated ${C.length} access tokens to "${f}" in ${T}s!`))}catch(t){e.error(c.red(`An error occurred while generating access tokens: ${t?.message||String(t)}`)),this.process.exit(1)}}export{d as generateAccessTokens};
2
+ //# sourceMappingURL=impl-B5lTeRbn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-B5lTeRbn.mjs","names":[],"sources":["../src/commands/consent/generate-access-tokens/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport * as t from 'io-ts';\nimport colors from 'colors';\nimport { logger } from '../../../logger';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { existsSync } from 'node:fs';\nimport cliProgress from 'cli-progress';\nimport {\n buildTranscendGraphQLClient,\n createPreferenceAccessTokens,\n type PreferenceAccessTokenInputWithIndex,\n} from '../../../lib/graphql';\nimport { readCsv } from '../../../lib/requests';\nimport { SombraStandardScope } from '@transcend-io/privacy-types';\nimport { writeCsv } from '../../../lib/helpers';\n\n/**\n * CLI flags accepted by the `generate-access-tokens` command.\n *\n * These are passed down from the CLI parser into the parent process.\n */\nexport type GenerateAccessTokenCommandFlags = {\n auth: string;\n file: string;\n duration: number;\n transcendUrl: string;\n subjectType: string;\n emailColumnName: string;\n coreIdentifierColumnName?: string;\n};\n\n/**\n * Take in a CSV of user identifiers and generate access tokens for each user.\n *\n * Expected CSV columns:\n * - [emailColumnName] (required)\n * - [coreIdentifierColumnName] (optional)\n *\n * @param this - Bound CLI context (provides process exit + logging).\n * @param flags - CLI options for the run.\n */\nexport async function generateAccessTokens(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n duration,\n subjectType,\n emailColumnName,\n coreIdentifierColumnName,\n }: GenerateAccessTokenCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n if (!existsSync(file)) {\n logger.error(\n colors.red(\n `File does not exist: \"${file}\". Please provide a valid path to a CSV file.`,\n ),\n );\n this.process.exit(1);\n }\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read + parse CSV\n const codec = t.type({\n [emailColumnName]: t.string,\n ...(coreIdentifierColumnName\n ? { [coreIdentifierColumnName]: t.string }\n : {}),\n });\n const rows: Array<Record<string, string>> = readCsv(file, codec);\n if (!rows.length) {\n throw new Error('Input CSV is empty.');\n }\n\n // Ensure emails and core identifiers exist\n const missingEmail = rows\n .map((r, i) => [r, i] as const)\n .filter(([r]) => !r[emailColumnName]?.trim());\n if (missingEmail.length) {\n const rowNumbers = missingEmail\n .map(([, i]) => i + 2) // +2 to account for header row and 0-indexing\n .join(', ');\n throw new Error(\n `The following rows are missing the required \"${emailColumnName}\" column: ${rowNumbers}`,\n );\n }\n if (coreIdentifierColumnName) {\n const missingCoreId = rows\n .map((r, i) => [r, i] as const)\n .filter(([r]) => !r[coreIdentifierColumnName]?.trim());\n if (missingCoreId.length) {\n const rowNumbers = missingCoreId\n .map(([, i]) => i + 2) // +2 to account for header row and 0-indexing\n .join(', ');\n throw new Error(\n `The following rows are missing the required \"${coreIdentifierColumnName}\" column: ${rowNumbers}`,\n );\n }\n }\n\n // Duration provided by CLI is in ms; GraphQL expects seconds\n const expiresInSeconds = Math.max(1, Math.floor(duration / 1000));\n\n // Build inputs for GraphQL\n const inputs = rows.map((r, index): PreferenceAccessTokenInputWithIndex => {\n const email = r[emailColumnName].trim();\n const coreIdentifier = coreIdentifierColumnName\n ? r[coreIdentifierColumnName]?.trim()\n : undefined;\n const scopes = [SombraStandardScope.PreferenceManagement];\n return {\n subjectType,\n scopes,\n expiresIn: expiresInSeconds,\n email,\n ...(coreIdentifier ? { coreIdentifier } : {}),\n index,\n };\n });\n\n // Progress bar\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n progressBar.start(inputs.length, 0);\n\n // Kick off token creation (batched internally)\n const t0 = Date.now();\n const results = await createPreferenceAccessTokens(\n client,\n inputs,\n (progress) => {\n progressBar.update(progress);\n },\n );\n progressBar.update(inputs.length);\n progressBar.stop();\n\n // Prepare output CSV rows\n const outputRows = results.map(({ accessToken, input }) => {\n if (typeof input.index !== 'number') {\n throw new Error('Internal error: missing input index.');\n }\n return {\n ...rows[input.index],\n token: accessToken,\n };\n });\n\n logger.info(colors.magenta(`Writing access tokens to file \"${file}\"...`));\n await writeCsv(file, outputRows, true);\n\n const totalTimeSec = Math.round((Date.now() - t0) / 1000);\n logger.info(\n colors.green(\n `Successfully generated ${results.length} access tokens to \"${file}\" in ${totalTimeSec}s!`,\n ),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n logger.error(\n colors.red(\n `An error occurred while generating access tokens: ${\n err?.message || String(err)\n }`,\n ),\n );\n this.process.exit(1);\n }\n}\n"],"mappings":"wdAyCA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,WACA,cACA,kBACA,4BAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CACjC,EAAW,EAAK,GACnB,EAAO,MACL,EAAO,IACL,yBAAyB,EAAK,+CAC/B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE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,KAAK,CACf,EAAU,MAAM,EACpB,EACA,EACC,GAAa,CACZ,EAAY,OAAO,EAAS,EAE/B,CACD,EAAY,OAAO,EAAO,OAAO,CACjC,EAAY,MAAM,CAGlB,IAAM,EAAa,EAAQ,KAAK,CAAE,cAAa,WAAY,CACzD,GAAI,OAAO,EAAM,OAAU,SACzB,MAAU,MAAM,uCAAuC,CAEzD,MAAO,CACL,GAAG,EAAK,EAAM,OACd,MAAO,EACR,EACD,CAEF,EAAO,KAAK,EAAO,QAAQ,kCAAkC,EAAK,MAAM,CAAC,CACzE,MAAM,EAAS,EAAM,EAAY,GAAK,CAEtC,IAAM,EAAe,KAAK,OAAO,KAAK,KAAK,CAAG,GAAM,IAAK,CACzD,EAAO,KACL,EAAO,MACL,0BAA0B,EAAQ,OAAO,qBAAqB,EAAK,OAAO,EAAa,IACxF,CACF,OAEM,EAAU,CACjB,EAAO,MACL,EAAO,IACL,qDACE,GAAK,SAAW,OAAO,EAAI,GAE9B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{q as e}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t}from"./done-input-validation-CcZtaz03.mjs";async function n({auth:n,actions:r,statuses:i=[],requestIds:a,silentModeBefore:o,createdAtBefore:s,createdAtAfter:c,updatedAtBefore:l,updatedAtAfter:u,cancellationTitle:d,transcendUrl:f,concurrency:p}){t(this.process.exit),await e({transcendUrl:f,requestActions:r,auth:n,cancellationTitle:d,requestIds:a,statuses:i,concurrency:p,silentModeBefore:o?new Date(o):void 0,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})}export{n as cancel};
2
+ //# sourceMappingURL=impl-B6UhzQcY2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-B6UhzQcY2.mjs","names":[],"sources":["../src/commands/request/cancel/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { cancelPrivacyRequests } from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface CancelCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses?: RequestStatus[];\n requestIds?: string[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n cancellationTitle: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function cancel(\n this: LocalContext,\n {\n auth,\n actions,\n statuses = [],\n requestIds,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n cancellationTitle,\n transcendUrl,\n concurrency,\n }: CancelCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await cancelPrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n cancellationTitle,\n requestIds,\n statuses,\n concurrency,\n silentModeBefore: silentModeBefore ? new Date(silentModeBefore) : undefined,\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 });\n}\n"],"mappings":"8PAoBA,eAAsB,EAEpB,CACE,OACA,UACA,WAAW,EAAE,CACb,aACA,mBACA,kBACA,iBACA,kBACA,iBACA,oBACA,eACA,eAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAsB,CAC1B,eACA,eAAgB,EAChB,OACA,oBACA,aACA,WACA,cACA,iBAAkB,EAAmB,IAAI,KAAK,EAAiB,CAAG,IAAA,GAClE,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,GAC7D,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{B as e}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t}from"./done-input-validation-CcZtaz03.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-BFf_CotE2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-BFf_CotE2.mjs","names":[],"sources":["../src/commands/request/enricher-restart/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { bulkRetryEnrichers } from '../../../lib/requests';\nimport type {\n RequestAction,\n RequestEnricherStatus,\n} from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\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":"8PAsBA,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"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import{t as e}from"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import"./codecs-TR6p48v3.mjs";import{a as t,r as n}from"./readTranscendYaml-DhKG1ViI.mjs";import{ai as r,or as i}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{n as a}from"./api-keys-CxvKdj2v.mjs";import{t as o}from"./done-input-validation-CcZtaz03.mjs";import{t as s}from"./dataFlowsToDataSilos-RAhfPV0l.mjs";import{difference as c}from"lodash-es";import{existsSync as l,lstatSync as u}from"node:fs";import{join as d}from"node:path";import f from"colors";async function p({auth:p,dataFlowsYmlFolder:m,output:h,ignoreYmls:g=[],transcendUrl:_}){o(this.process.exit),(!l(m)||!u(m).isDirectory())&&(e.error(f.red(`Folder does not exist: "${m}"`)),this.process.exit(1));let v=g.map(e=>e.split(`.`)[0]),y=a(m).map(e=>{let{"data-flows":t=[]}=n(d(m,e)),{adTechDataSilos:r,siteTechDataSilos:i}=s(t,{serviceToSupportedIntegration:T,serviceToTitle:w});return{adTechDataSilos:r,siteTechDataSilos:i,organizationName:e.split(`.`)[0]}}),b={};y.forEach(({adTechDataSilos:e,siteTechDataSilos:t,organizationName:n})=>{[...e,...t].forEach(e=>{let t=e[`outer-type`]||e.integrationName;b[t]||(b[t]=[]),b[t].push(n),b[t]=[...new Set(b[t])]})});let x=[...new Set(y.map(({adTechDataSilos:e})=>e.map(e=>e[`outer-type`]||e.integrationName)).flat())],S=c([...new Set(y.map(({siteTechDataSilos:e})=>e.map(e=>e[`outer-type`]||e.integrationName)).flat())],x),C={};y.forEach(({adTechDataSilos:e,siteTechDataSilos:t})=>{[...e,...t].forEach(e=>{let t=e[`outer-type`]||e.integrationName,n=e.attributes?.find(e=>e.key===`Found On Domain`);C[t]||(C[t]=[]),C[t].push(...n?.values||[]),C[t]=[...new Set(C[t])]})});let{serviceToTitle:w,serviceToSupportedIntegration:T}=await i(r(_,p)),E=[...x,...S].map(e=>({title:w[e],...T[e]?{integrationName:e}:{integrationName:`promptAPerson`,"outer-type":e},attributes:[{key:`Tech Type`,values:[`Ad Tech`]},{key:`Business Units`,values:c(b[e]||[],v)},{key:`Found On Domain`,values:C[e]||[]}]}));e.log(`Total Services: ${E.length}`),e.log(`Ad Tech Services: ${x.length}`),e.log(`Site Tech Services: ${S.length}`),t(h,{"data-silos":E})}export{p as deriveDataSilosFromDataFlowsCrossInstance};
2
+ //# sourceMappingURL=impl-BGQ0EGS0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-BGQ0EGS0.mjs","names":[],"sources":["../src/commands/inventory/derive-data-silos-from-data-flows-cross-instance/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport {\n fetchAndIndexCatalogs,\n buildTranscendGraphQLClient,\n} from '../../../lib/graphql';\nimport { join } from 'node:path';\nimport { difference } from 'lodash-es';\nimport colors from 'colors';\nimport { logger } from '../../../logger';\nimport { dataFlowsToDataSilos } from '../../../lib/consent-manager/dataFlowsToDataSilos';\nimport { DataFlowInput } from '../../../codecs';\nimport { existsSync, lstatSync } from 'node:fs';\nimport { listFiles } from '../../../lib/api-keys';\nimport {\n readTranscendYaml,\n writeTranscendYaml,\n} from '../../../lib/readTranscendYaml';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface DeriveDataSilosFromDataFlowsCrossInstanceCommandFlags {\n auth: string;\n dataFlowsYmlFolder: string;\n output: string;\n ignoreYmls?: string[];\n transcendUrl: string;\n}\n\nexport async function deriveDataSilosFromDataFlowsCrossInstance(\n this: LocalContext,\n {\n auth,\n dataFlowsYmlFolder,\n output,\n ignoreYmls = [],\n transcendUrl,\n }: DeriveDataSilosFromDataFlowsCrossInstanceCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Ensure folder is passed\n if (\n !existsSync(dataFlowsYmlFolder) ||\n !lstatSync(dataFlowsYmlFolder).isDirectory()\n ) {\n logger.error(colors.red(`Folder does not exist: \"${dataFlowsYmlFolder}\"`));\n this.process.exit(1);\n }\n\n // Ignore the data flows in these yml files\n const instancesToIgnore = ignoreYmls.map((x) => x.split('.')[0]);\n\n // Map over each data flow yml file and convert to data silo configurations\n const dataSiloInputs = listFiles(dataFlowsYmlFolder).map((directory) => {\n // read in the data flows for a specific instance\n const { 'data-flows': dataFlows = [] } = readTranscendYaml(\n join(dataFlowsYmlFolder, directory),\n );\n\n // map the data flows to data silos\n const { adTechDataSilos, siteTechDataSilos } = dataFlowsToDataSilos(\n dataFlows as DataFlowInput[],\n {\n serviceToSupportedIntegration,\n serviceToTitle,\n },\n );\n\n return {\n adTechDataSilos,\n siteTechDataSilos,\n organizationName: directory.split('.')[0],\n };\n });\n\n // Mapping from service name to instances that have that service\n const serviceToInstance: { [k in string]: string[] } = {};\n dataSiloInputs.forEach(\n ({ adTechDataSilos, siteTechDataSilos, organizationName }) => {\n const allDataSilos = [...adTechDataSilos, ...siteTechDataSilos];\n allDataSilos.forEach((dataSilo) => {\n const service = dataSilo['outer-type'] || dataSilo.integrationName;\n // create mapping to instance\n if (!serviceToInstance[service]) {\n serviceToInstance[service] = [];\n }\n serviceToInstance[service]!.push(organizationName);\n serviceToInstance[service] = [...new Set(serviceToInstance[service])];\n });\n },\n );\n\n // List of ad tech integrations\n const adTechIntegrations = [\n ...new Set(\n dataSiloInputs\n .map(({ adTechDataSilos }) =>\n adTechDataSilos.map(\n (silo) => silo['outer-type'] || silo.integrationName,\n ),\n )\n .flat(),\n ),\n ];\n\n // List of site tech integrations\n const siteTechIntegrations = difference(\n [\n ...new Set(\n dataSiloInputs\n .map(({ siteTechDataSilos }) =>\n siteTechDataSilos.map(\n (silo) => silo['outer-type'] || silo.integrationName,\n ),\n )\n .flat(),\n ),\n ],\n adTechIntegrations,\n );\n\n // Mapping from service name to list of\n const serviceToFoundOnDomain: { [k in string]: string[] } = {};\n dataSiloInputs.forEach(({ adTechDataSilos, siteTechDataSilos }) => {\n const allDataSilos = [...adTechDataSilos, ...siteTechDataSilos];\n allDataSilos.forEach((dataSilo) => {\n const service = dataSilo['outer-type'] || dataSilo.integrationName;\n const foundOnDomain = dataSilo.attributes?.find(\n (attr) => attr.key === 'Found On Domain',\n );\n // create mapping to instance\n if (!serviceToFoundOnDomain[service]) {\n serviceToFoundOnDomain[service] = [];\n }\n serviceToFoundOnDomain[service]!.push(...(foundOnDomain?.values || []));\n serviceToFoundOnDomain[service] = [\n ...new Set(serviceToFoundOnDomain[service]),\n ];\n });\n });\n\n // Fetch all integrations in the catalog\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const { serviceToTitle, serviceToSupportedIntegration } =\n await fetchAndIndexCatalogs(client);\n\n // construct the aggregated data silo inputs\n const dataSilos = [...adTechIntegrations, ...siteTechIntegrations].map(\n (service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', 'outer-type': service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Ad Tech'],\n },\n {\n key: 'Business Units',\n values: difference(\n serviceToInstance[service] || [],\n instancesToIgnore,\n ),\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }),\n );\n\n // Log output\n logger.log(`Total Services: ${dataSilos.length}`);\n logger.log(`Ad Tech Services: ${adTechIntegrations.length}`);\n logger.log(`Site Tech Services: ${siteTechIntegrations.length}`);\n\n // Write to yaml\n writeTranscendYaml(output, {\n 'data-silos': dataSilos,\n });\n}\n"],"mappings":"wmBA2BA,eAAsB,EAEpB,CACE,OACA,qBACA,SACA,aAAa,EAAE,CACf,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,EAIpC,CAAC,EAAW,EAAmB,EAC/B,CAAC,EAAU,EAAmB,CAAC,aAAa,IAE5C,EAAO,MAAM,EAAO,IAAI,2BAA2B,EAAmB,GAAG,CAAC,CAC1E,KAAK,QAAQ,KAAK,EAAE,EAItB,IAAM,EAAoB,EAAW,IAAK,GAAM,EAAE,MAAM,IAAI,CAAC,GAAG,CAG1D,EAAiB,EAAU,EAAmB,CAAC,IAAK,GAAc,CAEtE,GAAM,CAAE,aAAc,EAAY,EAAE,EAAK,EACvC,EAAK,EAAoB,EAAU,CACpC,CAGK,CAAE,kBAAiB,qBAAsB,EAC7C,EACA,CACE,gCACA,iBACD,CACF,CAED,MAAO,CACL,kBACA,oBACA,iBAAkB,EAAU,MAAM,IAAI,CAAC,GACxC,EACD,CAGI,EAAiD,EAAE,CACzD,EAAe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AAC,UAAU,CACpB,CACD,CACE,IAAK,iBACL,OAAQ,EACN,EAAkB,IAAY,EAAE,CAChC,EACD,CACF,CACD,CACE,IAAK,kBACL,OAAQ,EAAuB,IAAY,EAAE,CAC9C,CACF,CACF,EACF,CAGD,EAAO,IAAI,mBAAmB,EAAU,SAAS,CACjD,EAAO,IAAI,qBAAqB,EAAmB,SAAS,CAC5D,EAAO,IAAI,uBAAuB,EAAqB,SAAS,CAGhE,EAAmB,EAAQ,CACzB,aAAc,EACf,CAAC"}
@@ -0,0 +1,5 @@
1
+ import{t as e}from"./logger-Bj782ZYD.mjs";import{t}from"./done-input-validation-CcZtaz03.mjs";import n from"node:fs";import r from"node:path";import i from"colors";import a from"fast-glob";import{spawn as o}from"node:child_process";function s(e,t,r){return new Promise((i,a)=>{let o=n.createReadStream(e),s=Buffer.alloc(0),c=t.length,l=0;o.on(`data`,e=>{let n=e;if(r){let e=r-l;if(e<=0){o.destroy(),i(!1);return}n.length>e&&(n=n.subarray(0,e)),l+=n.length}let a=s.length?Buffer.concat([s,n]):n;if(a.toString(`utf8`).toLowerCase().includes(t.toString(`utf8`))){o.destroy(),i(!0);return}s=c>1?Buffer.from(a.subarray(Math.max(0,a.length-(c-1)))):Buffer.alloc(0)}),o.on(`error`,a),o.on(`close`,()=>i(!1)),o.on(`end`,()=>i(!1))})}async function c(e,t,n){let r=0,i=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let t=r;if(r+=1,t>=e.length)return;await n(e[t])}});await Promise.all(i)}function l(e,t){return new Promise((n,r)=>{let i=o(e,[`-noheader`,`-batch`,`-cmd`,t],{stdio:[`ignore`,`pipe`,`pipe`]}),a=``,s=``;i.stdout.on(`data`,e=>{a+=String(e)}),i.stderr.on(`data`,e=>{s+=String(e)}),i.on(`error`,r),i.on(`close`,e=>{e===0?n(a):r(Error(`duckdb exited ${e}: ${s}`))})})}async function u(e,t){return(await l(e,[`SELECT column_name`,`FROM parquet_schema('${t.replace(/'/g,`''`)}')`,`WHERE lower(column_type) LIKE '%varchar%'`,` OR lower(column_type) LIKE '%string%';`].join(`
2
+ `))).split(`
3
+ `).map(e=>e.trim()).filter(Boolean)}async function d(e,t,n){let r=await u(e,t);if(r.length===0)return!1;let i=t.replace(/'/g,`''`),a=r.map(e=>`"${e.replace(/"/g,`""`)}" = '${n.replace(/'/g,`''`)}'`).join(` OR `);return(await l(e,[`SELECT 1 AS hit FROM read_parquet('${i}')`,`WHERE ${a}`,`LIMIT 1;`].join(`
4
+ `))).trim().length>0}async function f(n){t(this.process.exit);let{needle:o,root:l,exts:u,noParquet:f,concurrency:p,maxBytes:m}=n,h=r.resolve(l),g=new Set(u.split(`,`).map(e=>e.trim().replace(/^\./,``).toLowerCase()).filter(Boolean)),_=Array.from(g).map(e=>`**/*.${e}`);e.info(i.green(`Searching for "${o}" in ${h} (exts: ${[...g].join(`, `)})`));let v=await a(_,{cwd:h,absolute:!0,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0}),y=Buffer.from(o.toLowerCase(),`utf8`),b=[];if(await c(v,p,async e=>{try{await s(e,y,m)&&(b.push(e),this.process.stdout.write(`${e}\n`))}catch{}}),!f){let t=await a([`**/*.parquet`],{cwd:h,absolute:!0,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0});t.length>0&&(e.info(i.green(`Scanning ${t.length} parquet file(s) via DuckDB...`)),await c(t,Math.max(2,Math.floor(p/4)),async e=>{try{await d(`duckdb`,e,o)&&(b.push(e),this.process.stdout.write(`${e}\n`))}catch{}}))}e.info(i.green(`Done. Found ${b.length} matching file(s).`))}export{f as findTextInFolder};
5
+ //# sourceMappingURL=impl-BYBNi68b.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-BYBNi68b.mjs","names":["fg"],"sources":["../src/commands/admin/find-text-in-folder/impl.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { spawn } from 'node:child_process';\nimport fg from 'fast-glob';\nimport colors from 'colors';\nimport type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\n/** CLI flags accepted by the `find-text-in-folder` command. */\nexport type FindTextInFolderCommandFlags = {\n /** The text string to search for */\n needle: string;\n /** Root directory to search */\n root: string;\n /** Comma-separated file extensions */\n exts: string;\n /** Skip parquet file scanning */\n noParquet: boolean;\n /** Max concurrent file scans */\n concurrency: number;\n /** Stop scanning each file after N bytes */\n maxBytes?: number;\n};\n\n/**\n * Streams through a file checking if it contains the needle (case-insensitive).\n *\n * @param filePath - Absolute path to the file to scan\n * @param needle - Lowercased needle as a Buffer\n * @param maxBytes - Optional byte limit per file\n * @returns Whether the file contains the needle\n */\nexport function fileContainsExactBytes(\n filePath: string,\n needle: Buffer,\n maxBytes?: number,\n): Promise<boolean> {\n return new Promise<boolean>((resolve, reject) => {\n const stream = fs.createReadStream(filePath);\n let carry = Buffer.alloc(0);\n const n = needle.length;\n let seen = 0;\n\n stream.on('data', (raw: Buffer) => {\n let chunk = raw;\n\n if (maxBytes) {\n const remaining = maxBytes - seen;\n if (remaining <= 0) {\n stream.destroy();\n resolve(false);\n return;\n }\n if (chunk.length > remaining) {\n chunk = chunk.subarray(0, remaining);\n }\n seen += chunk.length;\n }\n\n const buf = carry.length ? Buffer.concat([carry, chunk]) : chunk;\n const haystack = buf.toString('utf8').toLowerCase();\n if (haystack.includes(needle.toString('utf8'))) {\n stream.destroy();\n resolve(true);\n return;\n }\n\n // Keep last n-1 bytes to catch boundary matches\n if (n > 1) {\n carry = Buffer.from(buf.subarray(Math.max(0, buf.length - (n - 1))));\n } else {\n carry = Buffer.alloc(0);\n }\n });\n\n stream.on('error', reject);\n stream.on('close', () => resolve(false));\n stream.on('end', () => resolve(false));\n });\n}\n\n/**\n * Run async workers over items with bounded concurrency.\n *\n * @param items - Array of items to process\n * @param limit - Maximum concurrent workers\n * @param worker - Async function to run per item\n * @returns Resolves when all items are processed\n */\nasync function runWithConcurrency<T>(\n items: T[],\n limit: number,\n worker: (item: T) => Promise<void>,\n): Promise<void> {\n let idx = 0;\n const runners = Array.from(\n { length: Math.min(limit, items.length) },\n async () => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const current = idx;\n idx += 1;\n if (current >= items.length) return;\n await worker(items[current]);\n }\n },\n );\n await Promise.all(runners);\n}\n\n/**\n * Execute a DuckDB query and return stdout.\n *\n * @param duckdbPath - Path to the duckdb binary\n * @param sql - SQL query to execute\n * @returns The stdout output from duckdb\n */\nfunction duckdbQuery(duckdbPath: string, sql: string): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const child = spawn(duckdbPath, ['-noheader', '-batch', '-cmd', sql], {\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n\n let stdout = '';\n let stderr = '';\n child.stdout.on('data', (d) => {\n stdout += String(d);\n });\n child.stderr.on('data', (d) => {\n stderr += String(d);\n });\n\n child.on('error', reject);\n child.on('close', (code) => {\n if (code === 0) resolve(stdout);\n else reject(new Error(`duckdb exited ${code}: ${stderr}`));\n });\n });\n}\n\n/**\n * Get all VARCHAR/STRING column names from a parquet file.\n *\n * @param duckdbPath - Path to the duckdb binary\n * @param filePath - Absolute path to the parquet file\n * @returns Array of string column names\n */\nasync function duckdbGetParquetStringColumns(\n duckdbPath: string,\n filePath: string,\n): Promise<string[]> {\n const escaped = filePath.replace(/'/g, \"''\");\n const sql = [\n 'SELECT column_name',\n `FROM parquet_schema('${escaped}')`,\n \"WHERE lower(column_type) LIKE '%varchar%'\",\n \" OR lower(column_type) LIKE '%string%';\",\n ].join('\\n');\n\n const out = await duckdbQuery(duckdbPath, sql);\n return out\n .split('\\n')\n .map((l) => l.trim())\n .filter(Boolean);\n}\n\n/**\n * Check if any string column in a parquet file contains the needle value.\n *\n * @param duckdbPath - Path to the duckdb binary\n * @param filePath - Absolute path to the parquet file\n * @param needle - The string to search for (exact equality per column)\n * @returns Whether any row/column matches\n */\nasync function parquetFileHasExactString(\n duckdbPath: string,\n filePath: string,\n needle: string,\n): Promise<boolean> {\n const cols = await duckdbGetParquetStringColumns(duckdbPath, filePath);\n if (cols.length === 0) return false;\n\n const escaped = filePath.replace(/'/g, \"''\");\n const orChain = cols\n .map((c) => `\"${c.replace(/\"/g, '\"\"')}\" = '${needle.replace(/'/g, \"''\")}'`)\n .join(' OR ');\n\n const sql = [\n `SELECT 1 AS hit FROM read_parquet('${escaped}')`,\n `WHERE ${orChain}`,\n 'LIMIT 1;',\n ].join('\\n');\n\n const out = await duckdbQuery(duckdbPath, sql);\n return out.trim().length > 0;\n}\n\n/**\n * Entrypoint for the `admin find-text-in-folder` command.\n *\n * Searches a folder of files for a given text string. Useful for finding\n * a needle in a haystack across many large files (multi-GB CSVs, JSON\n * dumps, log archives). Files are streamed so memory stays flat.\n *\n * @param this - Bound CLI context\n * @param flags - CLI flags for the run\n */\nexport async function findTextInFolder(\n this: LocalContext,\n flags: FindTextInFolderCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const { needle, root, exts, noParquet, concurrency, maxBytes } = flags;\n const rootAbs = path.resolve(root);\n\n const extSet = new Set(\n exts\n .split(',')\n .map((x) => x.trim().replace(/^\\./, '').toLowerCase())\n .filter(Boolean),\n );\n const patterns = Array.from(extSet).map((e) => `**/*.${e}`);\n\n logger.info(\n colors.green(\n `Searching for \"${needle}\" in ${rootAbs} (exts: ${[...extSet].join(\n ', ',\n )})`,\n ),\n );\n\n const normalFiles = await fg(patterns, {\n cwd: rootAbs,\n absolute: true,\n onlyFiles: true,\n followSymbolicLinks: false,\n suppressErrors: true,\n });\n\n const needleBuf = Buffer.from(needle.toLowerCase(), 'utf8');\n const hits: string[] = [];\n\n await runWithConcurrency(normalFiles, concurrency, async (file) => {\n try {\n const ok = await fileContainsExactBytes(file, needleBuf, maxBytes);\n if (ok) {\n hits.push(file);\n this.process.stdout.write(`${file}\\n`);\n }\n } catch {\n // ignore unreadable files\n }\n });\n\n if (!noParquet) {\n const parquetFiles = await fg(['**/*.parquet'], {\n cwd: rootAbs,\n absolute: true,\n onlyFiles: true,\n followSymbolicLinks: false,\n suppressErrors: true,\n });\n\n if (parquetFiles.length > 0) {\n logger.info(\n colors.green(\n `Scanning ${parquetFiles.length} parquet file(s) via DuckDB...`,\n ),\n );\n\n await runWithConcurrency(\n parquetFiles,\n Math.max(2, Math.floor(concurrency / 4)),\n async (file) => {\n try {\n const ok = await parquetFileHasExactString('duckdb', file, needle);\n if (ok) {\n hits.push(file);\n this.process.stdout.write(`${file}\\n`);\n }\n } catch {\n // ignore parquet read issues\n }\n },\n );\n }\n }\n\n logger.info(colors.green(`Done. Found ${hits.length} matching file(s).`));\n}\n"],"mappings":"wOAiCA,SAAgB,EACd,EACA,EACA,EACkB,CAClB,OAAO,IAAI,SAAkB,EAAS,IAAW,CAC/C,IAAM,EAAS,EAAG,iBAAiB,EAAS,CACxC,EAAQ,OAAO,MAAM,EAAE,CACrB,EAAI,EAAO,OACb,EAAO,EAEX,EAAO,GAAG,OAAS,GAAgB,CACjC,IAAI,EAAQ,EAEZ,GAAI,EAAU,CACZ,IAAM,EAAY,EAAW,EAC7B,GAAI,GAAa,EAAG,CAClB,EAAO,SAAS,CAChB,EAAQ,GAAM,CACd,OAEE,EAAM,OAAS,IACjB,EAAQ,EAAM,SAAS,EAAG,EAAU,EAEtC,GAAQ,EAAM,OAGhB,IAAM,EAAM,EAAM,OAAS,OAAO,OAAO,CAAC,EAAO,EAAM,CAAC,CAAG,EAE3D,GADiB,EAAI,SAAS,OAAO,CAAC,aAAa,CACtC,SAAS,EAAO,SAAS,OAAO,CAAC,CAAE,CAC9C,EAAO,SAAS,CAChB,EAAQ,GAAK,CACb,OAIF,AAGE,EAHE,EAAI,EACE,OAAO,KAAK,EAAI,SAAS,KAAK,IAAI,EAAG,EAAI,QAAU,EAAI,GAAG,CAAC,CAAC,CAE5D,OAAO,MAAM,EAAE,EAEzB,CAEF,EAAO,GAAG,QAAS,EAAO,CAC1B,EAAO,GAAG,YAAe,EAAQ,GAAM,CAAC,CACxC,EAAO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OAAO,gCACjC,CACF,CAED,MAAM,EACJ,EACA,KAAK,IAAI,EAAG,KAAK,MAAM,EAAc,EAAE,CAAC,CACxC,KAAO,IAAS,CACd,GAAI,CACS,MAAM,EAA0B,SAAU,EAAM,EAAO,GAEhE,EAAK,KAAK,EAAK,CACf,KAAK,QAAQ,OAAO,MAAM,GAAG,EAAK,IAAI,OAElC,IAIX,EAIL,EAAO,KAAK,EAAO,MAAM,eAAe,EAAK,OAAO,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{W as e,pi as t}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t as n}from"./done-input-validation-CcZtaz03.mjs";async function r({auth:r,file:i,transcendUrl:a,cacheFilepath:o,requestReceiptFolder:s,sombraAuth:c,concurrency:l,attributes:u,isTest:d,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,skipFilterStep:h,dryRun:g,debug:_,defaultPhoneCountryCode:v}){n(this.process.exit),await e({cacheFilepath:o,requestReceiptFolder:s,file:i,auth:r,sombraAuth:c,concurrency:l,transcendUrl:a,defaultPhoneCountryCode:v,attributes:t(u),debug:_,skipFilterStep:h,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,isTest:d,dryRun:g})}export{r as upload};
2
+ //# sourceMappingURL=impl-B__p3_wC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-B__p3_wC.mjs","names":[],"sources":["../src/commands/request/upload/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport {\n splitCsvToList,\n uploadPrivacyRequestsFromCsv,\n} from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n cacheFilepath: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n attributes: string;\n isTest: boolean;\n isSilent: boolean;\n skipSendingReceipt: boolean;\n emailIsVerified: boolean;\n skipFilterStep: boolean;\n dryRun: boolean;\n debug: boolean;\n defaultPhoneCountryCode: string;\n}\n\nexport async function upload(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n cacheFilepath,\n requestReceiptFolder,\n sombraAuth,\n concurrency,\n attributes,\n isTest,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n skipFilterStep,\n dryRun,\n debug,\n defaultPhoneCountryCode,\n }: UploadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadPrivacyRequestsFromCsv({\n cacheFilepath,\n requestReceiptFolder,\n file,\n auth,\n sombraAuth,\n concurrency,\n transcendUrl,\n defaultPhoneCountryCode,\n attributes: splitCsvToList(attributes),\n debug,\n skipFilterStep,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n isTest,\n dryRun,\n });\n}\n"],"mappings":"2QA0BA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,gBACA,uBACA,aACA,cACA,aACA,SACA,WACA,qBACA,kBACA,iBACA,SACA,QACA,2BAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAA6B,CACjC,gBACA,uBACA,OACA,OACA,aACA,cACA,eACA,0BACA,WAAY,EAAe,EAAW,CACtC,QACA,iBACA,WACA,qBACA,kBACA,SACA,SACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import"./codecs-TR6p48v3.mjs";import"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{s as e}from"./consent-manager-c4bgQF1N.mjs";import"./uploadConsents-C1S-BNzw.mjs";import{t}from"./done-input-validation-CcZtaz03.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-BcayRe6a.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-CA7X_TDD.cjs","names":["uploadDataFlowsFromCsvHelper"],"sources":["../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\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 {\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n }: 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":"iYAaA,eAAsB,EAEpB,CACE,OACA,gBACA,OACA,kBACA,gBAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAAAA,EAA6B,CACjC,OACA,gBACA,OACA,kBACA,eACD,CAAC"}
1
+ {"version":3,"file":"impl-BcayRe6a.mjs","names":["uploadDataFlowsFromCsvHelper"],"sources":["../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\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 {\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n }: 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":"yWAaA,eAAsB,EAEpB,CACE,OACA,gBACA,OACA,kBACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAA6B,CACjC,OACA,gBACA,OACA,kBACA,eACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{$ as e}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t}from"./done-input-validation-CcZtaz03.mjs";import{RequestStatus as n}from"@transcend-io/privacy-types";async function r({auth:r,transcendUrl:i,folderPath:a,requestIds:o,statuses:s=[n.Approving,n.Downloadable],concurrency:c,createdAtBefore:l,createdAtAfter:u,updatedAtBefore:d,updatedAtAfter:f,approveAfterDownload:p}){t(this.process.exit),await e({transcendUrl:i,auth:r,folderPath:a,requestIds:o,statuses:s,concurrency:c,createdAtBefore:l,createdAtAfter:u,updatedAtBefore:d,updatedAtAfter:f,approveAfterDownload:p})}export{r as downloadFiles};
2
+ //# sourceMappingURL=impl-BkYKsEVG2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-BkYKsEVG2.mjs","names":[],"sources":["../src/commands/request/download-files/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { downloadPrivacyRequestFiles } from '../../../lib/requests';\nimport { RequestStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface DownloadFilesCommandFlags {\n auth: string;\n sombraAuth?: string;\n concurrency: number;\n requestIds?: string[];\n statuses?: RequestStatus[];\n folderPath: string;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n approveAfterDownload: boolean;\n transcendUrl: string;\n}\n\nexport async function downloadFiles(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n folderPath,\n requestIds,\n statuses = [RequestStatus.Approving, RequestStatus.Downloadable],\n concurrency,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n approveAfterDownload,\n }: DownloadFilesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await downloadPrivacyRequestFiles({\n transcendUrl,\n auth,\n folderPath,\n requestIds,\n statuses,\n concurrency,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n approveAfterDownload,\n });\n}\n"],"mappings":"0TAoBA,eAAsB,EAEpB,CACE,OACA,eACA,aACA,aACA,WAAW,CAAC,EAAc,UAAW,EAAc,aAAa,CAChE,cACA,kBACA,iBACA,kBACA,iBACA,wBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAA4B,CAChC,eACA,OACA,aACA,aACA,WACA,cACA,kBACA,iBACA,kBACA,iBACA,uBACD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import"./enums-CyFTrzXY.mjs";import{t as e}from"./constants-CnLQtIBn.mjs";import{t}from"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import"./codecs-TR6p48v3.mjs";import{ai as n,ei as r,ft as i}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import"./api-keys-CxvKdj2v.mjs";import{t as a}from"./done-input-validation-CcZtaz03.mjs";import{n as o}from"./code-scanning-Cx1kpssH.mjs";import s from"colors";import c from"fast-glob";import{stringify as l}from"query-string";async function u({scanPath:e,fileGlobs:n,ignoreDirs:r,config:i}){let{ignoreDirs:a,supportedFiles:o,scanFunction:s}=i,l=n===``?o:o.concat(n.split(`,`)),d=[...r.split(`,`),...a].filter(e=>e.length>0);try{let n=await c(`${e}/**/${l.join(`|`)}`,{ignore:d.map(t=>`${e}/**/${t}`),unique:!0,onlyFiles:!0});t.info(`Scanning: ${n.length} files`);let r=n.map(e=>s(e)).flat().map(e=>e.softwareDevelopmentKits||[]).flat(),i=[...new Set(r.map(e=>e.name))];return t.info(`Found: ${i.length} unique dependencies`),i.map(t=>({name:t,resourceId:`${e}/**/${t}`,useStrictClassifier:!0}))}catch(e){throw Error(`Error scanning globs ${u} with error: ${e}`)}}async function d({scanPath:c,dataSiloId:d,auth:f,fileGlobs:p,ignoreDirs:m,transcendUrl:h}){a(this.process.exit);let g=n(h,f),_=await r(g,d),v=o[_.dataSilo.type];v||(t.error(s.red(`This plugin "${_.dataSilo.type}" is not supported for offline silo discovery.`)),this.process.exit(1));let y=await u({scanPath:c,fileGlobs:p,ignoreDirs:m,config:v});await i(g,_.id,y);let b=new URL(e);b.pathname=`/data-map/data-inventory/silo-discovery/triage`,b.search=l({filters:JSON.stringify({pluginIds:[_.id]})}),t.info(s.green(`Scan found ${y.length} potential data silos at ${c}! View at '${b.href}'
2
+
3
+ NOTE: it may take 2-3 minutes for scan results to appear in the UI.`))}export{d as discoverSilos};
4
+ //# sourceMappingURL=impl-Bl2yVgh0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-Bl2yVgh0.mjs","names":[],"sources":["../src/lib/code-scanning/findFilesToScan.ts","../src/commands/inventory/discover-silos/impl.ts"],"sourcesContent":["import fastGlob from 'fast-glob';\nimport { logger } from '../../logger';\nimport { CodeScanningConfig } from './types';\n\nexport interface SiloDiscoveryRawResults {\n /** The name of the potential data silo entry */\n name: string;\n /** A unique UUID (represents the same resource across different silo discovery runs) */\n resourceId: string;\n /** Any hosts associated with the entry */\n host?: string;\n /** Type of data silo */\n type?: string | undefined;\n}\n\n/**\n * Helper to scan for data silos in all package.json files that it can find in a directory\n *\n * @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead\n * @param options - Options\n * @returns the list of integrations\n */\nexport async function findFilesToScan({\n scanPath,\n fileGlobs,\n ignoreDirs,\n config,\n}: {\n /** Where to look for package.json files */\n scanPath: string;\n /** Globs to look for */\n fileGlobs: string;\n /** The directories to ignore (excludes node_modules and serverless-build) */\n ignoreDirs: string;\n /** Silo Discovery configuration */\n config: CodeScanningConfig;\n}): Promise<SiloDiscoveryRawResults[]> {\n const { ignoreDirs: IGNORE_DIRS, supportedFiles, scanFunction } = config;\n const globsToSupport =\n fileGlobs === ''\n ? supportedFiles\n : supportedFiles.concat(fileGlobs.split(','));\n const dirsToIgnore = [...ignoreDirs.split(','), ...IGNORE_DIRS].filter(\n (dir) => dir.length > 0,\n );\n try {\n const filesToScan: string[] = await fastGlob(\n `${scanPath}/**/${globsToSupport.join('|')}`,\n {\n ignore: dirsToIgnore.map((dir: string) => `${scanPath}/**/${dir}`),\n unique: true,\n onlyFiles: true,\n },\n );\n logger.info(`Scanning: ${filesToScan.length} files`);\n const allPackages = filesToScan\n .map((filePath: string) => scanFunction(filePath))\n .flat();\n const allSdks = allPackages\n .map((appPackage) => appPackage.softwareDevelopmentKits || [])\n .flat();\n const uniqueDeps = new Set(allSdks.map((sdk) => sdk.name));\n const deps = [...uniqueDeps];\n logger.info(`Found: ${deps.length} unique dependencies`);\n return deps.map((dep) => ({\n name: dep,\n resourceId: `${scanPath}/**/${dep}`,\n useStrictClassifier: true,\n }));\n } catch (error) {\n throw new Error(\n `Error scanning globs ${findFilesToScan} with error: ${error}`,\n );\n }\n}\n","import type { LocalContext } from '../../../context';\nimport { stringify } from 'query-string';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { ADMIN_DASH } from '../../../constants';\nimport {\n fetchActiveSiloDiscoPlugin,\n buildTranscendGraphQLClient,\n uploadSiloDiscoveryResults,\n} from '../../../lib/graphql';\nimport { findFilesToScan } from '../../../lib/code-scanning/findFilesToScan';\nimport { SILO_DISCOVERY_CONFIGS } from '../../../lib/code-scanning';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface DiscoverSilosCommandFlags {\n scanPath: string;\n dataSiloId: string;\n auth: string;\n fileGlobs: string;\n ignoreDirs: string;\n transcendUrl: string;\n}\n\nexport async function discoverSilos(\n this: LocalContext,\n {\n scanPath,\n dataSiloId,\n auth,\n fileGlobs,\n ignoreDirs,\n transcendUrl,\n }: DiscoverSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const plugin = await fetchActiveSiloDiscoPlugin(client, dataSiloId);\n\n const config = SILO_DISCOVERY_CONFIGS[plugin.dataSilo.type];\n if (!config) {\n logger.error(\n colors.red(\n `This plugin \"${plugin.dataSilo.type}\" is not supported for offline silo discovery.`,\n ),\n );\n this.process.exit(1);\n }\n\n const results = await findFilesToScan({\n scanPath,\n fileGlobs,\n ignoreDirs,\n config,\n });\n\n await uploadSiloDiscoveryResults(client, plugin.id, results);\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/data-map/data-inventory/silo-discovery/triage';\n newUrl.search = stringify({\n filters: JSON.stringify({ pluginIds: [plugin.id] }),\n });\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} potential data silos at ${scanPath}! ` +\n `View at '${newUrl.href}' ` +\n '\\n\\n NOTE: it may take 2-3 minutes for scan results to appear in the UI.',\n ),\n );\n}\n"],"mappings":"8eAsBA,eAAsB,EAAgB,CACpC,WACA,YACA,aACA,UAUqC,CACrC,GAAM,CAAE,WAAY,EAAa,iBAAgB,gBAAiB,EAC5D,EACJ,IAAc,GACV,EACA,EAAe,OAAO,EAAU,MAAM,IAAI,CAAC,CAC3C,EAAe,CAAC,GAAG,EAAW,MAAM,IAAI,CAAE,GAAG,EAAY,CAAC,OAC7D,GAAQ,EAAI,OAAS,EACvB,CACD,GAAI,CACF,IAAM,EAAwB,MAAM,EAClC,GAAG,EAAS,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@@ -0,0 +1,12 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import{t as e}from"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{As as t,ii as n,l as r}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t as i}from"./done-input-validation-CcZtaz03.mjs";import{t as a}from"./preference-management-8gj7aSJB.mjs";import{readdirSync as o}from"node:fs";import{join as s}from"node:path";import c from"colors";import l from"cli-progress";async function u({auth:u,partition:d,sombraAuth:f,file:p=``,directory:m,transcendUrl:h,timestamp:g,maxConcurrency:_,maxItemsInChunk:v,receiptDirectory:y,fileConcurrency:b}){m&&p&&(e.error(c.red(`Cannot provide both a directory and a file. Please provide only one.`)),this.process.exit(1)),!p&&!m&&(e.error(c.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(m)try{let t=o(m).filter(e=>e.endsWith(`.csv`));t.length===0&&(e.error(c.red(`No CSV files found in directory: ${m}`)),this.process.exit(1)),x.push(...t.map(e=>s(m,e)))}catch(t){e.error(c.red(`Failed to read directory: ${m}`)),e.error(c.red(t.message)),this.process.exit(1)}else try{p.endsWith(`.csv`)||(e.error(c.red(`File must be a CSV file`)),this.process.exit(1)),x.push(p)}catch(t){e.error(c.red(`Failed to access file: ${p}`)),e.error(c.red(t.message)),this.process.exit(1)}e.debug(c.green(`Processing ${x.length} consent preferences files for partition: ${d}`)),e.debug(`\nFiles to process: ${x.join(`, `)}\n`);let S=await n(h,u,f),C=new l.SingleBar({format:`Deletion Progress |${c.cyan(`[{bar}]`)}| Duration: ${c.red(`{duration_formatted}`)} | {value}/{total} Files Processed `},l.Presets.shades_classic);C.start(x.length,0);let w=await t(x,async e=>{let t=await a(S,{partition:d,filePath:e,timestamp:g,maxItemsInChunk:v,maxConcurrency:_});return C.increment(),t},{concurrency:b});C.stop();let T=w.flat(),E=``;T.length>0&&(E=s(y,`deletion-failures-${Date.now()}.csv`),r(E,T,!0)),e.info(c.green(`
2
+
3
+ ==================================
4
+
5
+ `)),e.info(c.green(`
6
+ #### Deletion Summary Report #####
7
+ `)),e.info(c.green(`📁 Total Files Processed: ${x.length} \n❌ Errors: ${T.length} \n📝 Receipt Path: ${E||`N/A`}`)),e.info(c.green(`
8
+
9
+ ==================================
10
+
11
+ `))}export{u as deletePreferenceRecords};
12
+ //# sourceMappingURL=impl-BmAMgEEM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-BmAMgEEM.mjs","names":[],"sources":["../src/commands/consent/delete-preference-records/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { createSombraGotInstance } from '../../../lib/graphql';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { logger } from '../../../logger';\nimport { readdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { map } from '../../../lib/bluebird';\nimport { bulkDeletePreferenceRecords } from '../../../lib/preference-management';\nimport cliProgress from 'cli-progress';\nimport { writeCsv } from '../../../lib/helpers';\n\nexport interface DeletePreferenceRecordsCommandFlags {\n /** Transcend API key for authentication */\n auth: string;\n /** Partition ID to delete preference records from */\n partition: string;\n /** Optional Sombra internal key for self-hosted instances */\n sombraAuth?: string;\n /** Path to the CSV file used to identify preference records to delete */\n file?: string;\n /** Path to the directory of CSV files to load preferences from */\n directory?: string;\n /** Base URL for the Transcend API */\n transcendUrl: string;\n /** The timestamp when the deletion operation is made. Used for logging purposes. */\n timestamp: Date;\n /** Maximum items to include in each deletion chunk */\n maxItemsInChunk: number;\n /** Maximum concurrency for deletion requests */\n maxConcurrency: number;\n /** Directory to write receipts of failed deletions to */\n receiptDirectory: string;\n /** Number of files to process concurrently when deleting preference records from multiple files */\n fileConcurrency: number;\n}\n\nexport async function deletePreferenceRecords(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n file = '',\n directory,\n transcendUrl,\n timestamp,\n maxConcurrency,\n maxItemsInChunk,\n receiptDirectory,\n fileConcurrency,\n }: DeletePreferenceRecordsCommandFlags,\n): Promise<void> {\n if (!!directory && !!file) {\n logger.error(\n colors.red(\n 'Cannot provide both a directory and a file. Please provide only one.',\n ),\n );\n this.process.exit(1);\n }\n\n if (!file && !directory) {\n logger.error(\n colors.red(\n 'A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences',\n ),\n );\n this.process.exit(1);\n }\n doneInputValidation(this.process.exit);\n\n const files: string[] = [];\n\n if (directory) {\n try {\n const filesInDirectory = readdirSync(directory);\n const csvFiles = filesInDirectory.filter((file) => file.endsWith('.csv'));\n\n if (csvFiles.length === 0) {\n logger.error(\n colors.red(`No CSV files found in directory: ${directory}`),\n );\n this.process.exit(1);\n }\n\n // Add full paths for each CSV file\n files.push(...csvFiles.map((file) => join(directory, file)));\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n } else {\n try {\n // Verify file exists and is a CSV\n if (!file.endsWith('.csv')) {\n logger.error(colors.red('File must be a CSV file'));\n this.process.exit(1);\n }\n files.push(file);\n } catch (err) {\n logger.error(colors.red(`Failed to access file: ${file}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n }\n\n logger.debug(\n colors.green(\n `Processing ${files.length} consent preferences files for partition: ${partition}`,\n ),\n );\n logger.debug(`\\nFiles to process: ${files.join(', ')}\\n`);\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n const globalProgressBar = new cliProgress.SingleBar(\n {\n format: `Deletion Progress |${colors.cyan(\n '[{bar}]',\n )}| Duration: ${colors.red(\n '{duration_formatted}',\n )} | {value}/{total} Files Processed `,\n },\n cliProgress.Presets.shades_classic,\n );\n globalProgressBar.start(files.length, 0);\n\n // Process batch of files with concurrency\n const failedResultsArrays = await map(\n files,\n async (filePath) => {\n const result = await bulkDeletePreferenceRecords(sombra, {\n partition,\n filePath,\n timestamp,\n maxItemsInChunk,\n maxConcurrency,\n });\n globalProgressBar.increment();\n return result;\n },\n { concurrency: fileConcurrency },\n );\n globalProgressBar.stop();\n const failedResults = failedResultsArrays.flat();\n\n // Check for failed results and write receipt if any\n let receiptPath = '';\n if (failedResults.length > 0) {\n receiptPath = join(receiptDirectory, `deletion-failures-${Date.now()}.csv`);\n writeCsv(receiptPath, failedResults, true);\n }\n\n logger.info(colors.green('\\n\\n ================================== \\n\\n'));\n logger.info(colors.green('\\n#### Deletion Summary Report #####\\n'));\n logger.info(\n colors.green(\n `📁 Total Files Processed: ${files.length} \\n` +\n `❌ Errors: ${failedResults.length} \\n` +\n `📝 Receipt Path: ${receiptPath || 'N/A'}`,\n ),\n );\n logger.info(colors.green('\\n\\n==================================\\n\\n'));\n}\n"],"mappings":"idAsCA,eAAsB,EAEpB,CACE,OACA,YACA,aACA,OAAO,GACP,YACA,eACA,YACA,iBACA,kBACA,mBACA,mBAEa,CACT,GAAe,IACnB,EAAO,MACL,EAAO,IACL,uEACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGlB,CAAC,GAAQ,CAAC,IACZ,EAAO,MACL,EAAO,IACL,uHACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAEtB,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAkB,EAAE,CAE1B,GAAI,EACF,GAAI,CAEF,IAAM,EADmB,EAAY,EAAU,CACb,OAAQ,GAAS,EAAK,SAAS,OAAO,CAAC,CAErE,EAAS,SAAW,IACtB,EAAO,MACL,EAAO,IAAI,oCAAoC,IAAY,CAC5D,CACD,KAAK,QAAQ,KAAK,EAAE,EAItB,EAAM,KAAK,GAAG,EAAS,IAAK,GAAS,EAAK,EAAW,EAAK,CAAC,CAAC,OACrD,EAAK,CACZ,EAAO,MAAM,EAAO,IAAI,6BAA6B,IAAY,CAAC,CAClE,EAAO,MAAM,EAAO,IAAK,EAAc,QAAQ,CAAC,CAChD,KAAK,QAA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-0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{P as e}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t}from"./done-input-validation-CcZtaz03.mjs";async function n({auth:n,transcendUrl:r,identifierNames:i,actions:a=[]}){t(this.process.exit),await e({requestActions:a,transcendUrl:r,auth:n,identifierNames:i})}export{n as rejectUnverifiedIdentifiers};
2
+ //# sourceMappingURL=impl-BsttzxTN2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-BsttzxTN2.mjs","names":[],"sources":["../src/commands/request/reject-unverified-identifiers/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { removeUnverifiedRequestIdentifiers } from '../../../lib/requests';\nimport type { RequestAction } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface RejectUnverifiedIdentifiersCommandFlags {\n auth: string;\n identifierNames: string[];\n actions?: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function rejectUnverifiedIdentifiers(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n identifierNames,\n actions = [],\n }: RejectUnverifiedIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await removeUnverifiedRequestIdentifiers({\n requestActions: actions,\n transcendUrl,\n auth,\n identifierNames,\n });\n}\n"],"mappings":"8PAYA,eAAsB,EAEpB,CACE,OACA,eACA,kBACA,UAAU,EAAE,EAEC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAmC,CACvC,eAAgB,EAChB,eACA,OACA,kBACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import{t as e}from"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{ui as t}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{n}from"./cron-BvxWyvDu.mjs";import{t as r}from"./done-input-validation-CcZtaz03.mjs";import i from"colors";import*as a from"io-ts";const o=a.type({"Request Id":a.string});async function s({auth:a,dataSiloId:s,file:c,transcendUrl:l}){r(this.process.exit),e.info(i.magenta(`Reading "${c}" from disk`)),await n({requestIds:t(c,o).map(e=>e[`Request Id`]),transcendUrl:l,auth:a,dataSiloId:s})}export{s as markRequestDataSilosCompleted};
2
+ //# sourceMappingURL=impl-BtnySmbi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-BtnySmbi.mjs","names":[],"sources":["../src/commands/request/system/mark-request-data-silos-completed/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../../context';\nimport colors from 'colors';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../../../logger';\nimport { markRequestDataSiloIdsCompleted } from '../../../../lib/cron';\nimport { readCsv } from '../../../../lib/requests';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\n\nconst RequestIdRow = t.type({\n 'Request Id': t.string,\n});\n\nexport interface MarkRequestDataSilosCompletedCommandFlags {\n auth: string;\n dataSiloId: string;\n file: string;\n transcendUrl: string;\n}\n\nexport async function markRequestDataSilosCompleted(\n this: LocalContext,\n {\n auth,\n dataSiloId,\n file,\n transcendUrl,\n }: MarkRequestDataSilosCompletedCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const activeResults = readCsv(file, RequestIdRow);\n\n await markRequestDataSiloIdsCompleted({\n requestIds: activeResults.map((request) => request['Request Id']),\n transcendUrl,\n auth,\n dataSiloId,\n });\n}\n"],"mappings":"iWASA,MAAM,EAAe,EAAE,KAAK,CAC1B,aAAc,EAAE,OACjB,CAAC,CASF,eAAsB,EAEpB,CACE,OACA,aACA,OACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAG1D,MAAM,EAAgC,CACpC,WAHoB,EAAQ,EAAM,EAAa,CAGrB,IAAK,GAAY,EAAQ,cAAc,CACjE,eACA,OACA,aACD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import{n as e,r as t,t as n}from"./enums-CyFTrzXY.mjs";import"./constants-CnLQtIBn.mjs";import{t as r}from"./logger-Bj782ZYD.mjs";import"./buildAIIntegrationType-Bk0EbFKV.mjs";import{As as i,ai as a,i as o,js as s,wo as c}from"./syncConfigurationToTranscend-VJd0PnaZ.mjs";import{t as l}from"./done-input-validation-CcZtaz03.mjs";import{OneTrustEnrichedAssessment as u,OneTrustGetAssessmentResponse as d,OneTrustGetListOfAssessmentsResponse as f,OneTrustGetRiskResponse as p,OneTrustGetUserResponse as m}from"@transcend-io/privacy-types";import{keyBy as h,uniq as g}from"lodash-es";import{decodeCodec as _}from"@transcend-io/type-utils";import v,{createReadStream as y}from"node:fs";import b from"colors";import"yargs-parser";import x from"got";import S from"JSONStream";const C=({hostname:e,auth:t})=>x.extend({prefixUrl:`https://${e}`,headers:{accept:`application/json`,"content-type":`application/json`,authorization:`Bearer ${t}`}});Object.values(e);const w=({assessment:e,index:t,total:n,wrap:r=!0})=>{let i=``;(t===0||r)&&(i=`[
2
+ `);let a=JSON.stringify(e),o=n&&t<n-1&&!r?`,`:``;return i=`${i+a+o}\n`,(n&&t===n-1||r)&&(i+=`
3
+ ]`),i},T=({file:e,assessment:t,index:n,total:i})=>{r.info(b.magenta(`Writing enriched assessment ${n+1} of ${i} to file "${e}"...`)),n===0?v.writeFileSync(e,w({assessment:t,index:n,total:i,wrap:!1})):v.appendFileSync(e,w({assessment:t,index:n,total:i,wrap:!1}))},E=async({oneTrust:e})=>{let t=0,n=1,i=0,a=[];for(;t<n;){let{body:o}=await e.get(`api/assessment/v2/assessments?page=${t}&size=2000`),{page:s,content:c}=_(f,o);a.push(...c??[]),t===0&&(n=s?.totalPages??0,i=s?.totalElements??0),t+=1,r.info(`Fetched ${a.length} of ${i} assessments.`)}return a},D=async({oneTrust:e,assessmentId:t})=>{let{body:n}=await e.get(`api/assessment/v2/assessments/${t}/export?ExcludeSkippedQuestions=false`);return _(d,n)},O=async({oneTrust:e,riskId:t})=>{let{body:n}=await e.get(`api/risk/v2/risks/${t}`);return _(p,n)},k=async({oneTrust:e,userId:t})=>{let{body:n}=await e.get(`api/scim/v2/Users/${t}`);return _(m,n)},A=({assessment:e,assessmentDetails:t,riskDetails:n,creatorDetails:r,approversDetails:i,respondentsDetails:a})=>{let o=h(n,`id`),{sections:s,createdBy:c,...l}=t,u=s.map(e=>{let{questions:t,...n}=e,r=t.map(e=>{let{risks:t,...n}=e,r=(t??[]).map(e=>{let t=o[e.riskId];return{...e,...t,level:e.level,impactLevel:e.impactLevel??0}});return{...n,risks:r}});return{...n,questions:r}}),d={...c,active:r?.active??!1,userType:r?.userType??`Internal`,emails:r?.emails??[],title:r?.title??null,givenName:r?.name.givenName??null,familyName:r?.name.familyName??null},f=h(i,`id`),p=t.approvers.flatMap(e=>f[e.id]?[{...e,approver:{...e.approver,active:f[e.id].active,userType:f[e.id].userType,emails:f[e.id].emails,title:f[e.id].title,givenName:f[e.id].name.givenName??null,familyName:f[e.id].name.familyName??null}}]:[]),m=h(a,`id`),g=t.respondents.filter(e=>!e.name.includes(`@`)).flatMap(e=>m[e.id]?[{...e,active:m[e.id].active,userType:m[e.id].userType,emails:m[e.id].emails,title:m[e.id].title,givenName:m[e.id].name.givenName??null,familyName:m[e.id].name.familyName??null}]:[]);return{...e,...l,approvers:p,respondents:g,createdBy:d,sections:u}},j=async({transcend:e,assessment:t,total:n,index:i})=>{r.info(b.magenta(`Writing enriched assessment ${i+1} ${n?`of ${n} `:` `}to Transcend...`));let a={json:w({assessment:t,index:i,total:n})};try{await o(e,c,{input:a})}catch{r.error(b.red(`Failed to sync assessment ${i+1} ${n?`of ${n} `:` `}to Transcend.\n\tAssessment Title: ${t.name}. Template Title: ${t.template.name}\n`))}},M=async({oneTrust:e,file:t,dryRun:n,transcend:a})=>{r.info(`Getting list of all assessments from OneTrust...`);let o=await E({oneTrust:e}),c={};await s(Array.from({length:Math.ceil(o.length/5)},(e,t)=>o.slice(t*5,(t+1)*5)),async(l,u)=>{let d=[];await i(l,async(t,n)=>{let a=5*u+n+1;r.info(`[assessment ${a} of ${o.length}]: fetching details...`);let{templateName:s,assessmentId:l}=t,f=await D({oneTrust:e,assessmentId:l}),p=f.createdBy.id,m=c[p];if(!m){r.info(`[assessment ${a} of ${o.length}]: fetching creator...`);try{m=await k({oneTrust:e,userId:p}),c[p]=m}catch{r.warn(b.yellow(`[assessment ${a} of ${o.length}]: failed to fetch form creator.\tcreatorId: ${p}. Assessment Title: ${t.name}. Template Title: ${s}`))}}let{approvers:h}=f,_=[];h.length>0&&(r.info(`[assessment ${a} of ${o.length}]: fetching approvers...`),_=await i(h.map(({id:e})=>e),async n=>{try{let t=c[n];return t||(t=await k({oneTrust:e,userId:n}),c[n]=t),[t]}catch{return r.warn(b.yellow(`[assessment ${a} of ${o.length}]: failed to fetch a form approver.\tapproverId: ${n}. Assessment Title: ${t.name}. Template Title: ${s}`)),[]}},{concurrency:5}));let{respondents:v}=f,y=v.filter(e=>!e.name.includes(`@`)),x=[];y.length>0&&(r.info(`[assessment ${a} of ${o.length}]: fetching respondents...`),x=await i(y.map(({id:e})=>e),async n=>{try{let t=c[n];return t||(t=await k({oneTrust:e,userId:n}),c[n]=t),[t]}catch{return r.warn(b.yellow(`[assessment ${a} of ${o.length}]: failed to fetch a respondent.\trespondentId: ${n}. Assessment Title: ${t.name}. Template Title: ${s}`)),[]}},{concurrency:5}));let S=[],C=g(f.sections.flatMap(e=>e.questions.flatMap(e=>(e.risks??[]).flatMap(e=>e.riskId))));C.length>0&&(r.info(`[assessment ${a} of ${o.length}]: fetching risks...`),S=await i(C,t=>O({oneTrust:e,riskId:t}),{concurrency:5}));let w=A({assessment:t,assessmentDetails:f,riskDetails:S,creatorDetails:m,approversDetails:_.flat(),respondentsDetails:x.flat()});d.push(w)},{concurrency:5}),await s(d,async(e,r)=>{let i=u*5+r;n&&t?T({assessment:e,index:i,total:o.length,file:t}):a&&await j({assessment:e,transcend:a,total:o.length,index:i})})})},N=({transcend:e,file:t})=>(r.info(`Getting list of all assessments from file ${t}...`),new Promise((n,i)=>{let a=y(t,{encoding:`utf-8`,highWaterMark:64*1024}),o=S.parse(`*`),s=0;a.pipe(o),o.on(`data`,async n=>{try{o.pause(),await j({assessment:_(u,n),transcend:e,index:s}),s+=1,o.resume()}catch(e){r.error(b.red(`Failed to parse the assessment ${s} from file '${t}': ${e.message}.`))}}),o.on(`end`,()=>{r.info(`Finished processing ${s} assessments from file ${t}`),n()}),o.on(`error`,e=>{r.error(b.red(`Error parsing file '${t}': ${e.message}`)),i(e)}),a.on(`error`,e=>{r.error(b.red(`Error reading file '${t}': ${e.message}`)),i(e)})}));async function P({hostname:i,oneTrustAuth:o,source:s,transcendAuth:c,transcendUrl:u,resource:d,file:f,dryRun:p,debug:m}){if(!p&&!c)throw Error('Must specify a "transcendAuth" parameter to sync resources to Transcend. e.g. --transcendAuth=${TRANSCEND_API_KEY}');if(p&&!f)throw Error(`Must set a "file" parameter when "dryRun" is "true". e.g. --file=./oneTrustAssessments.json`);if(f){let e=f.split(`.`);if(e.length<2)throw Error(`The "file" parameter has an invalid format. Expected a path with extensions. e.g. --file=./pathToFile.json.`);if(e.at(-1)!==n.Json)throw Error(`Expected the format of the "file" parameters '${f}' to be '${n.Json}', but got '${e.at(-1)}'.`)}if(s===t.OneTrust){if(!i)throw Error(`Missing required parameter "hostname". e.g. --hostname=customer.my.onetrust.com`);if(!o)throw Error(`Missing required parameter "oneTrustAuth". e.g. --oneTrustAuth=$ONE_TRUST_AUTH_TOKEN`)}else{if(!f)throw Error(`Must specify a "file" parameter to read the OneTrust assessments from. e.g. --source=./oneTrustAssessments.json`);if(p)throw Error(`Cannot read and write to a file simultaneously. Emit the "source" parameter or set it to ${t.OneTrust} if "dryRun" is enabled.`)}l(this.process.exit);let h=i&&o?C({hostname:i,auth:o}):void 0,g=u&&c?a(u,c):void 0;try{d===e.Assessments&&(s===t.OneTrust&&h?await M({oneTrust:h,file:f,dryRun:p,...g&&{transcend:g}}):s===t.File&&f&&g&&await N({file:f,transcend:g}))}catch(e){throw Error(`An error occurred syncing the resource ${d} from OneTrust: ${m?e.stack:e.message}`)}r.info(b.green(`Successfully synced OneTrust ${d} to ${p?`disk at "${f}"`:`Transcend`}!`))}export{P as syncOt};
4
+ //# sourceMappingURL=impl-BwX-evfW2.mjs.map