@transcend-io/cli 8.36.1 → 8.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +33 -0
  2. package/dist/{api-keys-DB0BZSh5.cjs → api-keys-eh_rPCV_.cjs} +2 -2
  3. package/dist/{api-keys-DB0BZSh5.cjs.map → api-keys-eh_rPCV_.cjs.map} +1 -1
  4. package/dist/app-D0ewaGAn.cjs +131 -0
  5. package/dist/app-D0ewaGAn.cjs.map +1 -0
  6. package/dist/bin/bash-complete.cjs +1 -1
  7. package/dist/bin/bash-complete.cjs.map +1 -1
  8. package/dist/bin/cli.cjs +1 -1
  9. package/dist/bin/cli.cjs.map +1 -1
  10. package/dist/bin/deprecated-command.cjs +1 -1
  11. package/dist/bin/deprecated-command.cjs.map +1 -1
  12. package/dist/buildAIIntegrationType-BwuCYR-o.cjs +2 -0
  13. package/dist/{buildAIIntegrationType-n_Qlv8wG.cjs.map → buildAIIntegrationType-BwuCYR-o.cjs.map} +1 -1
  14. package/dist/chunk-Bmb41Sf3.cjs +1 -0
  15. package/dist/{code-scanning-Yc7rgoTY.cjs → code-scanning-BB6Ncuzh.cjs} +2 -2
  16. package/dist/{code-scanning-Yc7rgoTY.cjs.map → code-scanning-BB6Ncuzh.cjs.map} +1 -1
  17. package/dist/codecs-Bvmb8o9R.cjs +2 -0
  18. package/dist/{codecs-JSDJgtyL.cjs.map → codecs-Bvmb8o9R.cjs.map} +1 -1
  19. package/dist/command-BUkTNNIa.cjs +9 -0
  20. package/dist/{command-41dUPvEa.cjs.map → command-BUkTNNIa.cjs.map} +1 -1
  21. package/dist/{consent-manager-BNMaKHId.cjs → consent-manager-Df8gw2Qh.cjs} +2 -2
  22. package/dist/{consent-manager-BNMaKHId.cjs.map → consent-manager-Df8gw2Qh.cjs.map} +1 -1
  23. package/dist/constants-7qBywLgI.cjs +2 -0
  24. package/dist/{constants-JoCDv9ym.cjs.map → constants-7qBywLgI.cjs.map} +1 -1
  25. package/dist/context-_8xfl0dt.cjs +2 -0
  26. package/dist/{context-Bw1xk9Q_.cjs.map → context-_8xfl0dt.cjs.map} +1 -1
  27. package/dist/{cron-ClvgH2uD.cjs → cron-BhfbISdy.cjs} +2 -2
  28. package/dist/{cron-ClvgH2uD.cjs.map → cron-BhfbISdy.cjs.map} +1 -1
  29. package/dist/{data-inventory-BzEYoxaa.cjs → data-inventory-D36n1YAJ.cjs} +2 -2
  30. package/dist/{data-inventory-BzEYoxaa.cjs.map → data-inventory-D36n1YAJ.cjs.map} +1 -1
  31. package/dist/{dataFlowsToDataSilos-daBgPi7V.cjs → dataFlowsToDataSilos-BLNhWeOw.cjs} +2 -2
  32. package/dist/{dataFlowsToDataSilos-daBgPi7V.cjs.map → dataFlowsToDataSilos-BLNhWeOw.cjs.map} +1 -1
  33. package/dist/{done-input-validation-Cgk5kNBs.cjs → done-input-validation-DGckEJ5a.cjs} +1 -1
  34. package/dist/{done-input-validation-Cgk5kNBs.cjs.map → done-input-validation-DGckEJ5a.cjs.map} +1 -1
  35. package/dist/enums-BZulhPFa.cjs +2 -0
  36. package/dist/{enums-CBXlBJii.cjs.map → enums-BZulhPFa.cjs.map} +1 -1
  37. package/dist/impl--CgaKM4x.cjs +2 -0
  38. package/dist/{impl-BFOghVmx.cjs.map → impl--CgaKM4x.cjs.map} +1 -1
  39. package/dist/impl--PmMYd1g.cjs +2 -0
  40. package/dist/{impl-BouHRicT.cjs.map → impl--PmMYd1g.cjs.map} +1 -1
  41. package/dist/impl-47WGWxyj.cjs +2 -0
  42. package/dist/{impl-CFmFCVt8.cjs.map → impl-47WGWxyj.cjs.map} +1 -1
  43. package/dist/impl-4NCrJ_Y6.cjs +2 -0
  44. package/dist/{impl-cfDtPbS9.cjs.map → impl-4NCrJ_Y6.cjs.map} +1 -1
  45. package/dist/impl-5AfPlpzA.cjs +2 -0
  46. package/dist/{impl-hGu8uCC4.cjs.map → impl-5AfPlpzA.cjs.map} +1 -1
  47. package/dist/impl-73q3K0b_.cjs +2 -0
  48. package/dist/{impl-BN61r-PG.cjs.map → impl-73q3K0b_.cjs.map} +1 -1
  49. package/dist/impl-8Basu9U-.cjs +2 -0
  50. package/dist/{impl-BXMfTm4K.cjs.map → impl-8Basu9U-.cjs.map} +1 -1
  51. package/dist/impl-BC1mCUl1.cjs +2 -0
  52. package/dist/{impl-CCOEjRnr.cjs.map → impl-BC1mCUl1.cjs.map} +1 -1
  53. package/dist/impl-BNEgHNz7.cjs +4 -0
  54. package/dist/{impl-8bci0gd2.cjs.map → impl-BNEgHNz7.cjs.map} +1 -1
  55. package/dist/impl-BPq8EyHn.cjs +2 -0
  56. package/dist/{impl-BRuqPhJU.cjs.map → impl-BPq8EyHn.cjs.map} +1 -1
  57. package/dist/impl-BfN9XMNM.cjs +2 -0
  58. package/dist/{impl-ClDXxODZ.cjs.map → impl-BfN9XMNM.cjs.map} +1 -1
  59. package/dist/impl-Boa1Uuzk.cjs +2 -0
  60. package/dist/{impl-DpdGWdrr.cjs.map → impl-Boa1Uuzk.cjs.map} +1 -1
  61. package/dist/impl-Bv2mYf1w.cjs +2 -0
  62. package/dist/{impl-C4D1tHjp.cjs.map → impl-Bv2mYf1w.cjs.map} +1 -1
  63. package/dist/impl-BxOeeF35.cjs +2 -0
  64. package/dist/{impl-CoxOrlXu.cjs.map → impl-BxOeeF35.cjs.map} +1 -1
  65. package/dist/impl-ByQI5s4b.cjs +2 -0
  66. package/dist/{impl-D7WBmmHb.cjs.map → impl-ByQI5s4b.cjs.map} +1 -1
  67. package/dist/impl-C1IjDv1N.cjs +2 -0
  68. package/dist/{impl-_dGu54cO.cjs.map → impl-C1IjDv1N.cjs.map} +1 -1
  69. package/dist/impl-CVsXgVaf.cjs +2 -0
  70. package/dist/{impl-BWiNjS6v.cjs.map → impl-CVsXgVaf.cjs.map} +1 -1
  71. package/dist/impl-CdXk78ar.cjs +2 -0
  72. package/dist/{impl-DhdY6lbj.cjs.map → impl-CdXk78ar.cjs.map} +1 -1
  73. package/dist/impl-CfsKuglq.cjs +2 -0
  74. package/dist/{impl-BH0HWnIY.cjs.map → impl-CfsKuglq.cjs.map} +1 -1
  75. package/dist/impl-CkkD_smS.cjs +2 -0
  76. package/dist/{impl-BS8t24Z7.cjs.map → impl-CkkD_smS.cjs.map} +1 -1
  77. package/dist/impl-Cotrjytz.cjs +2 -0
  78. package/dist/{impl-yHutqfbd.cjs.map → impl-Cotrjytz.cjs.map} +1 -1
  79. package/dist/impl-Crhm9eFe.cjs +2 -0
  80. package/dist/{impl-BYK9pQs0.cjs.map → impl-Crhm9eFe.cjs.map} +1 -1
  81. package/dist/impl-Cru4riTc.cjs +5 -0
  82. package/dist/impl-Cru4riTc.cjs.map +1 -0
  83. package/dist/impl-D2P_gDE8.cjs +2 -0
  84. package/dist/{impl-CA_CO88W.cjs.map → impl-D2P_gDE8.cjs.map} +1 -1
  85. package/dist/{impl-DjVmOb9T.cjs → impl-DDHduv-X.cjs} +2 -2
  86. package/dist/{impl-DjVmOb9T.cjs.map → impl-DDHduv-X.cjs.map} +1 -1
  87. package/dist/impl-DEULjxRp.cjs +2 -0
  88. package/dist/{impl-8zottXEQ.cjs.map → impl-DEULjxRp.cjs.map} +1 -1
  89. package/dist/impl-DHUnZ-Qx.cjs +2 -0
  90. package/dist/{impl-CSZwdpH-.cjs.map → impl-DHUnZ-Qx.cjs.map} +1 -1
  91. package/dist/impl-DI3lTLCy.cjs +2 -0
  92. package/dist/{impl-D3sI4I1g.cjs.map → impl-DI3lTLCy.cjs.map} +1 -1
  93. package/dist/impl-DKMxd5Wy.cjs +2 -0
  94. package/dist/{impl-ay7i0K_5.cjs.map → impl-DKMxd5Wy.cjs.map} +1 -1
  95. package/dist/impl-DNDs3FFG.cjs +2 -0
  96. package/dist/{impl-BjOFvm4E.cjs.map → impl-DNDs3FFG.cjs.map} +1 -1
  97. package/dist/impl-DQTfX_qq.cjs +4 -0
  98. package/dist/{impl-FlZPR0yd.cjs.map → impl-DQTfX_qq.cjs.map} +1 -1
  99. package/dist/impl-DS2IlxS3.cjs +2 -0
  100. package/dist/{impl-BIqdEXRo.cjs.map → impl-DS2IlxS3.cjs.map} +1 -1
  101. package/dist/impl-DVCUGrVY.cjs +2 -0
  102. package/dist/{impl-SkiG9sWb.cjs.map → impl-DVCUGrVY.cjs.map} +1 -1
  103. package/dist/{impl-C-_9uRms.cjs → impl-DZbi3AkB.cjs} +2 -2
  104. package/dist/{impl-C-_9uRms.cjs.map → impl-DZbi3AkB.cjs.map} +1 -1
  105. package/dist/impl-DcMkDhXY.cjs +2 -0
  106. package/dist/{impl-NLEQuKnT.cjs.map → impl-DcMkDhXY.cjs.map} +1 -1
  107. package/dist/impl-DlB56v12.cjs +2 -0
  108. package/dist/{impl-DU-WTXTY.cjs.map → impl-DlB56v12.cjs.map} +1 -1
  109. package/dist/impl-Du1Ty4JE.cjs +2 -0
  110. package/dist/{impl-Cp12F9tr.cjs.map → impl-Du1Ty4JE.cjs.map} +1 -1
  111. package/dist/{impl-KgEJvOhE.cjs → impl-DxDGyjMI.cjs} +2 -2
  112. package/dist/{impl-KgEJvOhE.cjs.map → impl-DxDGyjMI.cjs.map} +1 -1
  113. package/dist/impl-Dxgw6Xfk.cjs +2 -0
  114. package/dist/{impl-J5fV8gbh.cjs.map → impl-Dxgw6Xfk.cjs.map} +1 -1
  115. package/dist/impl-IQ7JOZxt.cjs +2 -0
  116. package/dist/{impl-Bv4gPikD.cjs.map → impl-IQ7JOZxt.cjs.map} +1 -1
  117. package/dist/impl-bgI-lF8x.cjs +2 -0
  118. package/dist/{impl-4pmSDQvA.cjs.map → impl-bgI-lF8x.cjs.map} +1 -1
  119. package/dist/impl-feFIqpBO.cjs +2 -0
  120. package/dist/{impl-BwAnSxkP.cjs.map → impl-feFIqpBO.cjs.map} +1 -1
  121. package/dist/impl-orpaJd8b.cjs +12 -0
  122. package/dist/{impl-BMxxKrNz.cjs.map → impl-orpaJd8b.cjs.map} +1 -1
  123. package/dist/{impl-ChNLuyNq.cjs → impl-xUzH7vUF.cjs} +2 -2
  124. package/dist/{impl-ChNLuyNq.cjs.map → impl-xUzH7vUF.cjs.map} +1 -1
  125. package/dist/index.cjs +4 -4
  126. package/dist/index.cjs.map +1 -1
  127. package/dist/{logger-BaHHbWVd.cjs → logger-DQwEYtSS.cjs} +2 -2
  128. package/dist/{logger-BaHHbWVd.cjs.map → logger-DQwEYtSS.cjs.map} +1 -1
  129. package/dist/{manual-enrichment-D-0rM9KN.cjs → manual-enrichment-CzRiIFev.cjs} +2 -2
  130. package/dist/{manual-enrichment-D-0rM9KN.cjs.map → manual-enrichment-CzRiIFev.cjs.map} +1 -1
  131. package/dist/{mergeTranscendInputs-PPpGbYgG.cjs → mergeTranscendInputs-BIBCYbug.cjs} +2 -2
  132. package/dist/{mergeTranscendInputs-PPpGbYgG.cjs.map → mergeTranscendInputs-BIBCYbug.cjs.map} +1 -1
  133. package/dist/{pooling-DbIx6-i7.cjs → pooling-BJAPXDiq.cjs} +2 -2
  134. package/dist/{pooling-DbIx6-i7.cjs.map → pooling-BJAPXDiq.cjs.map} +1 -1
  135. package/dist/{preference-management-Dapt3Li3.cjs → preference-management-DV6NIcXt.cjs} +2 -2
  136. package/dist/{preference-management-Dapt3Li3.cjs.map → preference-management-DV6NIcXt.cjs.map} +1 -1
  137. package/dist/{readTranscendYaml-CL9nujUr.cjs → readTranscendYaml-Cycz6RxW.cjs} +2 -2
  138. package/dist/{readTranscendYaml-CL9nujUr.cjs.map → readTranscendYaml-Cycz6RxW.cjs.map} +1 -1
  139. package/dist/syncConfigurationToTranscend-Bd0ZTIm1.cjs +2994 -0
  140. package/dist/{syncConfigurationToTranscend-D4PLA70C.cjs.map → syncConfigurationToTranscend-Bd0ZTIm1.cjs.map} +1 -1
  141. package/dist/{uploadConsents-CN1JucL3.cjs → uploadConsents-XYRco1_L.cjs} +2 -2
  142. package/dist/{uploadConsents-CN1JucL3.cjs.map → uploadConsents-XYRco1_L.cjs.map} +1 -1
  143. package/package.json +1 -1
  144. package/dist/app-BOlZhpYh.cjs +0 -118
  145. package/dist/app-BOlZhpYh.cjs.map +0 -1
  146. package/dist/buildAIIntegrationType-n_Qlv8wG.cjs +0 -2
  147. package/dist/codecs-JSDJgtyL.cjs +0 -2
  148. package/dist/command-41dUPvEa.cjs +0 -9
  149. package/dist/constants-JoCDv9ym.cjs +0 -2
  150. package/dist/context-Bw1xk9Q_.cjs +0 -2
  151. package/dist/enums-CBXlBJii.cjs +0 -2
  152. package/dist/impl-4pmSDQvA.cjs +0 -2
  153. package/dist/impl-8bci0gd2.cjs +0 -4
  154. package/dist/impl-8zottXEQ.cjs +0 -2
  155. package/dist/impl-BFOghVmx.cjs +0 -2
  156. package/dist/impl-BH0HWnIY.cjs +0 -2
  157. package/dist/impl-BIqdEXRo.cjs +0 -2
  158. package/dist/impl-BMxxKrNz.cjs +0 -12
  159. package/dist/impl-BN61r-PG.cjs +0 -2
  160. package/dist/impl-BRuqPhJU.cjs +0 -2
  161. package/dist/impl-BS8t24Z7.cjs +0 -2
  162. package/dist/impl-BWiNjS6v.cjs +0 -2
  163. package/dist/impl-BXMfTm4K.cjs +0 -2
  164. package/dist/impl-BYK9pQs0.cjs +0 -2
  165. package/dist/impl-BjOFvm4E.cjs +0 -2
  166. package/dist/impl-BouHRicT.cjs +0 -2
  167. package/dist/impl-Bv4gPikD.cjs +0 -2
  168. package/dist/impl-BwAnSxkP.cjs +0 -2
  169. package/dist/impl-C4D1tHjp.cjs +0 -2
  170. package/dist/impl-CA_CO88W.cjs +0 -2
  171. package/dist/impl-CCOEjRnr.cjs +0 -2
  172. package/dist/impl-CFmFCVt8.cjs +0 -2
  173. package/dist/impl-CSZwdpH-.cjs +0 -2
  174. package/dist/impl-ClDXxODZ.cjs +0 -2
  175. package/dist/impl-CoxOrlXu.cjs +0 -2
  176. package/dist/impl-Cp12F9tr.cjs +0 -2
  177. package/dist/impl-D3sI4I1g.cjs +0 -2
  178. package/dist/impl-D7WBmmHb.cjs +0 -2
  179. package/dist/impl-DU-WTXTY.cjs +0 -2
  180. package/dist/impl-DhdY6lbj.cjs +0 -2
  181. package/dist/impl-DpdGWdrr.cjs +0 -2
  182. package/dist/impl-FlZPR0yd.cjs +0 -4
  183. package/dist/impl-J5fV8gbh.cjs +0 -2
  184. package/dist/impl-NLEQuKnT.cjs +0 -2
  185. package/dist/impl-SkiG9sWb.cjs +0 -2
  186. package/dist/impl-_dGu54cO.cjs +0 -2
  187. package/dist/impl-ay7i0K_5.cjs +0 -2
  188. package/dist/impl-cfDtPbS9.cjs +0 -2
  189. package/dist/impl-hGu8uCC4.cjs +0 -2
  190. package/dist/impl-yHutqfbd.cjs +0 -2
  191. package/dist/syncConfigurationToTranscend-D4PLA70C.cjs +0 -2994
@@ -0,0 +1,2 @@
1
+ require(`./constants-7qBywLgI.cjs`);const e=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`);require(`./enums-BZulhPFa.cjs`),require(`./logger-DQwEYtSS.cjs`),require(`./buildAIIntegrationType-BwuCYR-o.cjs`);const t=require(`./done-input-validation-DGckEJ5a.cjs`);async function n({auth:n,actions:r,origins:i,silentModeBefore:a,createdAtBefore:o,createdAtAfter:s,transcendUrl:c,concurrency:l}){t.t(this.process.exit),await e.J({transcendUrl:c,requestActions:r,auth:n,requestOrigins:i,concurrency:l,silentModeBefore:a,createdAtBefore:o,createdAtAfter:s})}exports.approve=n;
2
+ //# sourceMappingURL=impl-DcMkDhXY.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-NLEQuKnT.cjs","names":["approvePrivacyRequests"],"sources":["../src/commands/request/approve/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\n\nimport { RequestAction, RequestOrigin } from '@transcend-io/privacy-types';\nimport { approvePrivacyRequests } from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ApproveCommandFlags {\n auth: string;\n actions: RequestAction[];\n origins?: RequestOrigin[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function approve(\n this: LocalContext,\n {\n auth,\n actions,\n origins,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n transcendUrl,\n concurrency,\n }: ApproveCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await approvePrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestOrigins: origins,\n concurrency,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"],"mappings":"6QAiBA,eAAsB,EAEpB,CACE,OACA,UACA,UACA,mBACA,kBACA,iBACA,eACA,eAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAAAA,EAAuB,CAC3B,eACA,eAAgB,EAChB,OACA,eAAgB,EAChB,cACA,mBACA,kBACA,iBACD,CAAC"}
1
+ {"version":3,"file":"impl-DcMkDhXY.cjs","names":["approvePrivacyRequests"],"sources":["../src/commands/request/approve/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\n\nimport { RequestAction, RequestOrigin } from '@transcend-io/privacy-types';\nimport { approvePrivacyRequests } from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ApproveCommandFlags {\n auth: string;\n actions: RequestAction[];\n origins?: RequestOrigin[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function approve(\n this: LocalContext,\n {\n auth,\n actions,\n origins,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n transcendUrl,\n concurrency,\n }: ApproveCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await approvePrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestOrigins: origins,\n concurrency,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"],"mappings":"6QAiBA,eAAsB,EAEpB,CACE,OACA,UACA,UACA,mBACA,kBACA,iBACA,eACA,eAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAAAA,EAAuB,CAC3B,eACA,eAAgB,EAChB,OACA,eAAgB,EAChB,cACA,mBACA,kBACA,iBACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./constants-7qBywLgI.cjs`),n=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`);require(`./enums-BZulhPFa.cjs`);const r=require(`./logger-DQwEYtSS.cjs`);require(`./buildAIIntegrationType-BwuCYR-o.cjs`),require(`./codecs-Bvmb8o9R.cjs`),require(`./api-keys-eh_rPCV_.cjs`);const i=require(`./done-input-validation-DGckEJ5a.cjs`),a=require(`./code-scanning-BB6Ncuzh.cjs`);let o=require(`colors`);o=e.t(o);let s=require(`child_process`);const c=`A repository name must be provided. You can specify using --repositoryName=$REPO_NAME or by ensuring the command "git config --get remote.origin.url" returns the name of the repository`;async function l({auth:e,scanPath:l,ignoreDirs:u,repositoryName:d,transcendUrl:f}){i.t(this.process.exit);let p=d;if(!p)try{let e=(0,s.execSync)(`cd ${l} && git config --get remote.origin.url`).toString(`utf-8`).trim();[p]=e.includes(`https:`)?e.split(`/`).slice(3).join(`/`).split(`.`):(e.split(`:`).pop()||``).split(`.`),p||(r.t.error(o.default.red(c)),this.process.exit(1))}catch(e){r.t.error(o.default.red(`${c} - Got error: ${e.message}`)),this.process.exit(1)}let m=n.ti(f,e),h=await a.t({scanPath:l,ignoreDirs:u,repositoryName:p});await n.zt(m,h);let g=new URL(t.t);g.pathname=`/code-scanning/code-packages`,r.t.info(o.default.green(`Scan found ${h.length} packages at ${l}! View results at '${g.href}'`))}exports.scanPackages=l;
2
+ //# sourceMappingURL=impl-DlB56v12.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DU-WTXTY.cjs","names":["buildTranscendGraphQLClient","findCodePackagesInFolder","syncCodePackages","ADMIN_DASH"],"sources":["../src/commands/inventory/scan-packages/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { ADMIN_DASH } from '../../../constants';\nimport { findCodePackagesInFolder } from '../../../lib/code-scanning';\nimport {\n buildTranscendGraphQLClient,\n syncCodePackages,\n} from '../../../lib/graphql';\nimport { execSync } from 'child_process';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nconst REPO_ERROR =\n 'A repository name must be provided. ' +\n 'You can specify using --repositoryName=$REPO_NAME or by ensuring the ' +\n 'command \"git config --get remote.origin.url\" returns the name of the repository';\n\nexport interface ScanPackagesCommandFlags {\n auth: string;\n scanPath: string;\n ignoreDirs?: string[];\n repositoryName?: string;\n transcendUrl: string;\n}\n\nexport async function scanPackages(\n this: LocalContext,\n {\n auth,\n scanPath,\n ignoreDirs,\n repositoryName,\n transcendUrl,\n }: ScanPackagesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Ensure repository name is specified\n let gitRepositoryName = repositoryName;\n if (!gitRepositoryName) {\n try {\n const name = execSync(\n `cd ${scanPath} && git config --get remote.origin.url`,\n );\n // Trim and parse the URL\n const url = name.toString('utf-8').trim();\n [gitRepositoryName] = !url.includes('https:')\n ? (url.split(':').pop() || '').split('.')\n : url.split('/').slice(3).join('/').split('.');\n if (!gitRepositoryName) {\n logger.error(colors.red(REPO_ERROR));\n this.process.exit(1);\n }\n } catch (err) {\n logger.error(colors.red(`${REPO_ERROR} - Got error: ${err.message}`));\n this.process.exit(1);\n }\n }\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Scan the codebase to discovery packages\n const results = await findCodePackagesInFolder({\n scanPath,\n ignoreDirs,\n repositoryName: gitRepositoryName,\n });\n\n // Report scan to Transcend\n await syncCodePackages(client, results);\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/code-scanning/code-packages';\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} packages at ${scanPath}! ` +\n `View results at '${newUrl.href}'`,\n ),\n );\n}\n"],"mappings":"icAYA,MAAM,EACJ,2LAYF,eAAsB,EAEpB,CACE,OACA,WACA,aACA,iBACA,gBAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAI,EAAoB,EACxB,GAAI,CAAC,EACH,GAAI,CAKF,IAAM,GAAA,EAAA,EAAA,UAHJ,MAAM,EAAS,wCAChB,CAEgB,SAAS,QAAQ,CAAC,MAAM,CACzC,CAAC,GAAsB,EAAI,SAAS,SAAS,CAEzC,EAAI,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,EAD3C,EAAI,MAAM,IAAI,CAAC,KAAK,EAAI,IAAI,MAAM,IAAI,CAEtC,IACH,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,EAAW,CAAC,CACpC,KAAK,QAAQ,KAAK,EAAE,QAEf,EAAK,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,GAAG,EAAW,gBAAgB,EAAI,UAAU,CAAC,CACrE,KAAK,QAAQ,KAAK,EAAE,CAKxB,IAAM,EAASA,EAAAA,GAA4B,EAAc,EAAK,CAGxD,EAAU,MAAMC,EAAAA,EAAyB,CAC7C,WACA,aACA,eAAgB,EACjB,CAAC,CAGF,MAAMC,EAAAA,GAAiB,EAAQ,EAAQ,CAEvC,IAAM,EAAS,IAAI,IAAIC,EAAAA,EAAW,CAClC,EAAO,SAAW,+BAGlB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,cAAc,EAAQ,OAAO,eAAe,EAAS,qBAC/B,EAAO,KAAK,GACnC,CACF"}
1
+ {"version":3,"file":"impl-DlB56v12.cjs","names":["buildTranscendGraphQLClient","findCodePackagesInFolder","syncCodePackages","ADMIN_DASH"],"sources":["../src/commands/inventory/scan-packages/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { ADMIN_DASH } from '../../../constants';\nimport { findCodePackagesInFolder } from '../../../lib/code-scanning';\nimport {\n buildTranscendGraphQLClient,\n syncCodePackages,\n} from '../../../lib/graphql';\nimport { execSync } from 'child_process';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nconst REPO_ERROR =\n 'A repository name must be provided. ' +\n 'You can specify using --repositoryName=$REPO_NAME or by ensuring the ' +\n 'command \"git config --get remote.origin.url\" returns the name of the repository';\n\nexport interface ScanPackagesCommandFlags {\n auth: string;\n scanPath: string;\n ignoreDirs?: string[];\n repositoryName?: string;\n transcendUrl: string;\n}\n\nexport async function scanPackages(\n this: LocalContext,\n {\n auth,\n scanPath,\n ignoreDirs,\n repositoryName,\n transcendUrl,\n }: ScanPackagesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Ensure repository name is specified\n let gitRepositoryName = repositoryName;\n if (!gitRepositoryName) {\n try {\n const name = execSync(\n `cd ${scanPath} && git config --get remote.origin.url`,\n );\n // Trim and parse the URL\n const url = name.toString('utf-8').trim();\n [gitRepositoryName] = !url.includes('https:')\n ? (url.split(':').pop() || '').split('.')\n : url.split('/').slice(3).join('/').split('.');\n if (!gitRepositoryName) {\n logger.error(colors.red(REPO_ERROR));\n this.process.exit(1);\n }\n } catch (err) {\n logger.error(colors.red(`${REPO_ERROR} - Got error: ${err.message}`));\n this.process.exit(1);\n }\n }\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Scan the codebase to discovery packages\n const results = await findCodePackagesInFolder({\n scanPath,\n ignoreDirs,\n repositoryName: gitRepositoryName,\n });\n\n // Report scan to Transcend\n await syncCodePackages(client, results);\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/code-scanning/code-packages';\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} packages at ${scanPath}! ` +\n `View results at '${newUrl.href}'`,\n ),\n );\n}\n"],"mappings":"ueAYA,MAAM,EACJ,2LAYF,eAAsB,EAEpB,CACE,OACA,WACA,aACA,iBACA,gBAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAI,EAAoB,EACxB,GAAI,CAAC,EACH,GAAI,CAKF,IAAM,GAAA,EAAA,EAAA,UAHJ,MAAM,EAAS,wCAChB,CAEgB,SAAS,QAAQ,CAAC,MAAM,CACzC,CAAC,GAAsB,EAAI,SAAS,SAAS,CAEzC,EAAI,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,EAD3C,EAAI,MAAM,IAAI,CAAC,KAAK,EAAI,IAAI,MAAM,IAAI,CAEtC,IACH,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,EAAW,CAAC,CACpC,KAAK,QAAQ,KAAK,EAAE,QAEf,EAAK,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,GAAG,EAAW,gBAAgB,EAAI,UAAU,CAAC,CACrE,KAAK,QAAQ,KAAK,EAAE,CAKxB,IAAM,EAASA,EAAAA,GAA4B,EAAc,EAAK,CAGxD,EAAU,MAAMC,EAAAA,EAAyB,CAC7C,WACA,aACA,eAAgB,EACjB,CAAC,CAGF,MAAMC,EAAAA,GAAiB,EAAQ,EAAQ,CAEvC,IAAM,EAAS,IAAI,IAAIC,EAAAA,EAAW,CAClC,EAAO,SAAW,+BAGlB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,cAAc,EAAQ,OAAO,eAAe,EAAS,qBAC/B,EAAO,KAAK,GACnC,CACF"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./command-BUkTNNIa.cjs`),n=require(`./constants-7qBywLgI.cjs`),r=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`),i=require(`./enums-BZulhPFa.cjs`),a=require(`./logger-DQwEYtSS.cjs`);require(`./buildAIIntegrationType-BwuCYR-o.cjs`),require(`./codecs-Bvmb8o9R.cjs`);const o=require(`./readTranscendYaml-Cycz6RxW.cjs`),s=require(`./api-keys-eh_rPCV_.cjs`),c=require(`./done-input-validation-DGckEJ5a.cjs`);let l=require(`node:fs`);l=e.t(l);let u=require(`node:path`),d=require(`colors`);d=e.t(d);async function f({auth:e,resources:f=t.n,file:p,transcendUrl:m,dataSiloIds:h=[],integrationNames:g=[],trackerStatuses:_=t.t,pageSize:v,skipDatapoints:y,skipSubDatapoints:b,includeGuessedCategories:x,debug:S}){c.t(this.process.exit);let C=await s.r(e),w=f.includes(`all`)?Object.values(i.o):f;if(typeof C==`string`){try{let e=await r._n(r.ti(m,C),{dataSiloIds:h,integrationNames:g,resources:w,pageSize:v,debug:S,skipDatapoints:y,skipSubDatapoints:b,includeGuessedCategories:x,trackerStatuses:_});a.t.info(d.default.magenta(`Writing configuration to file "${p}"...`)),o.a(p,e)}catch(e){a.t.error(d.default.red(`An error occurred syncing the schema: ${S?e.stack:e.message}`)),this.process.exit(1)}a.t.info(d.default.green(`Successfully synced yaml file to disk at ${p}! View at ${n.r}`))}else{if(!l.default.lstatSync(p).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 r.Es(C,async(t,n)=>{let i=`[${n+1}/${C.length}][${t.organizationName}] `;a.t.info(d.default.magenta(`~~~\n\n${i}Attempting to pull configuration...\n\n~~~`));let s=r.ti(m,t.apiKey);try{let e=await r._n(s,{dataSiloIds:h,integrationNames:g,resources:w,pageSize:v,debug:S,skipDatapoints:y,skipSubDatapoints:b,includeGuessedCategories:x,trackerStatuses:_}),n=(0,u.join)(p,`${t.organizationName}.yml`);a.t.info(d.default.magenta(`Writing configuration to file "${n}"...`)),o.a(n,e),a.t.info(d.default.green(`${i}Successfully pulled configuration!`))}catch(n){a.t.error(d.default.red(`${i}Failed to sync configuration. - ${n.message}`)),e.push(t.organizationName)}}),e.length>0&&(a.t.info(d.default.red(`Sync encountered errors for "${e.join(`,`)}". View output above for more information, or check out ${n.r}`)),this.process.exit(1))}}exports.pull=f;
2
+ //# sourceMappingURL=impl-Du1Ty4JE.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-Cp12F9tr.cjs","names":["DEFAULT_TRANSCEND_PULL_RESOURCES","DEFAULT_CONSENT_TRACKER_STATUSES","validateTranscendAuth","TranscendPullResource","pullTranscendConfiguration","buildTranscendGraphQLClient","ADMIN_DASH_INTEGRATIONS","fs","mapSeries"],"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":"qgBAsCA,eAAsB,EAEpB,CACE,OACA,YAAYA,EAAAA,EACZ,OACA,eACA,cAAc,EAAE,CAChB,mBAAmB,EAAE,CACrB,kBAAkBC,EAAAA,EAClB,WACA,iBACA,oBACA,2BACA,SAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAe,MAAMC,EAAAA,EAAsB,EAAK,CAEhD,EAA2C,EAAU,SAAS,MAAM,CACtE,OAAO,OAAOC,EAAAA,EAAsB,CACnC,EAGL,GAAI,OAAO,GAAiB,SAAU,CACpC,GAAI,CAIF,IAAM,EAAgB,MAAMC,EAAAA,GAFbC,EAAAA,GAA4B,EAAc,EAAa,CAEP,CAC7D,cACA,mBACA,UAAW,EACX,WACA,QACA,iBACA,oBACA,2BACA,kBACD,CAAC,CAEF,EAAA,EAAO,KAAK,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAAC,CACzE,EAAA,EAAmB,EAAM,EAAc,OAChC,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IACL,yCACE,EAAQ,EAAI,MAAQ,EAAI,UAE3B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,4CAA4C,EAAK,YAAYC,EAAAA,IAC9D,CACF,KACI,CACL,GAAI,CAACC,EAAAA,QAAG,UAAU,EAAK,CAAC,aAAa,CACnC,MAAU,MACR,0GACD,CAGH,IAAM,EAA8B,EAAE,CACtC,MAAMC,EAAAA,GAAU,EAAc,MAAO,EAAQ,IAAQ,CACnD,IAAM,EAAS,IAAI,EAAM,EAAE,GAAG,EAAa,OAAO,IAChD,EAAO,iBACR,IACD,EAAA,EAAO,KACL,EAAA,QAAO,QACL,UAAU,EAAO,4CAClB,CACF,CAGD,IAAM,EAASH,EAAAA,GAA4B,EAAc,EAAO,OAAO,CAEvE,GAAI,CACF,IAAM,EAAgB,MAAMD,EAAAA,GAA2B,EAAQ,CAC7D,cACA,mBACA,UAAW,EACX,WACA,QACA,iBACA,oBACA,2BACA,kBACD,CAAC,CAEI,GAAA,EAAA,EAAA,MAAgB,EAAM,GAAG,EAAO,iBAAiB,MAAM,CAC7D,EAAA,EAAO,KACL,EAAA,QAAO,QAAQ,kCAAkC,EAAS,MAAM,CACjE,CACD,EAAA,EAAmB,EAAU,EAAc,CAE3C,EAAA,EAAO,KACL,EAAA,QAAO,MAAM,GAAG,EAAO,oCAAoC,CAC5D,OACM,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IAAI,GAAG,EAAO,kCAAkC,EAAI,UAAU,CACtE,CACD,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,EAAA,EAAO,KACL,EAAA,QAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0DE,EAAAA,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"impl-Du1Ty4JE.cjs","names":["DEFAULT_TRANSCEND_PULL_RESOURCES","DEFAULT_CONSENT_TRACKER_STATUSES","validateTranscendAuth","TranscendPullResource","pullTranscendConfiguration","buildTranscendGraphQLClient","ADMIN_DASH_INTEGRATIONS","fs","mapSeries"],"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":"uiBAsCA,eAAsB,EAEpB,CACE,OACA,YAAYA,EAAAA,EACZ,OACA,eACA,cAAc,EAAE,CAChB,mBAAmB,EAAE,CACrB,kBAAkBC,EAAAA,EAClB,WACA,iBACA,oBACA,2BACA,SAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAe,MAAMC,EAAAA,EAAsB,EAAK,CAEhD,EAA2C,EAAU,SAAS,MAAM,CACtE,OAAO,OAAOC,EAAAA,EAAsB,CACnC,EAGL,GAAI,OAAO,GAAiB,SAAU,CACpC,GAAI,CAIF,IAAM,EAAgB,MAAMC,EAAAA,GAFbC,EAAAA,GAA4B,EAAc,EAAa,CAEP,CAC7D,cACA,mBACA,UAAW,EACX,WACA,QACA,iBACA,oBACA,2BACA,kBACD,CAAC,CAEF,EAAA,EAAO,KAAK,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAAC,CACzE,EAAA,EAAmB,EAAM,EAAc,OAChC,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IACL,yCACE,EAAQ,EAAI,MAAQ,EAAI,UAE3B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,4CAA4C,EAAK,YAAYC,EAAAA,IAC9D,CACF,KACI,CACL,GAAI,CAACC,EAAAA,QAAG,UAAU,EAAK,CAAC,aAAa,CACnC,MAAU,MACR,0GACD,CAGH,IAAM,EAA8B,EAAE,CACtC,MAAMC,EAAAA,GAAU,EAAc,MAAO,EAAQ,IAAQ,CACnD,IAAM,EAAS,IAAI,EAAM,EAAE,GAAG,EAAa,OAAO,IAChD,EAAO,iBACR,IACD,EAAA,EAAO,KACL,EAAA,QAAO,QACL,UAAU,EAAO,4CAClB,CACF,CAGD,IAAM,EAASH,EAAAA,GAA4B,EAAc,EAAO,OAAO,CAEvE,GAAI,CACF,IAAM,EAAgB,MAAMD,EAAAA,GAA2B,EAAQ,CAC7D,cACA,mBACA,UAAW,EACX,WACA,QACA,iBACA,oBACA,2BACA,kBACD,CAAC,CAEI,GAAA,EAAA,EAAA,MAAgB,EAAM,GAAG,EAAO,iBAAiB,MAAM,CAC7D,EAAA,EAAO,KACL,EAAA,QAAO,QAAQ,kCAAkC,EAAS,MAAM,CACjE,CACD,EAAA,EAAmB,EAAU,EAAc,CAE3C,EAAA,EAAO,KACL,EAAA,QAAO,MAAM,GAAG,EAAO,oCAAoC,CAC5D,OACM,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IAAI,GAAG,EAAO,kCAAkC,EAAI,UAAU,CACtE,CACD,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,EAAA,EAAO,KACL,EAAA,QAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0DE,EAAAA,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE"}
@@ -1,3 +1,3 @@
1
- const e=require(`./enums-CBXlBJii.cjs`),t=require(`./constants-JoCDv9ym.cjs`),n=require(`./syncConfigurationToTranscend-D4PLA70C.cjs`),r=require(`./logger-BaHHbWVd.cjs`);require(`./buildAIIntegrationType-n_Qlv8wG.cjs`),require(`./codecs-JSDJgtyL.cjs`);const i=require(`./consent-manager-BNMaKHId.cjs`);require(`./uploadConsents-CN1JucL3.cjs`);const a=require(`./api-keys-DB0BZSh5.cjs`),o=require(`./done-input-validation-Cgk5kNBs.cjs`);let s=require(`node:fs`);s=e.s(s);let c=require(`node:path`),l=require(`colors`);l=e.s(l);async function u({auth:e,start:u,end:d,folder:f,bin:p,transcendUrl:m}){let h=p;Object.values(n.jr).includes(h)||(r.t.error(l.default.red(`Failed to parse argument "bin" with value "${p}"\nExpected one of: \n${Object.values(n.jr).join(`
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./constants-7qBywLgI.cjs`),n=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`);require(`./enums-BZulhPFa.cjs`);const r=require(`./logger-DQwEYtSS.cjs`);require(`./buildAIIntegrationType-BwuCYR-o.cjs`),require(`./codecs-Bvmb8o9R.cjs`);const i=require(`./consent-manager-Df8gw2Qh.cjs`);require(`./uploadConsents-XYRco1_L.cjs`);const a=require(`./api-keys-eh_rPCV_.cjs`),o=require(`./done-input-validation-DGckEJ5a.cjs`);let s=require(`node:fs`);s=e.t(s);let c=require(`node:path`),l=require(`colors`);l=e.t(l);async function u({auth:e,start:u,end:d,folder:f,bin:p,transcendUrl:m}){let h=p;Object.values(n.jr).includes(h)||(r.t.error(l.default.red(`Failed to parse argument "bin" with value "${p}"\nExpected one of: \n${Object.values(n.jr).join(`
2
2
  `)}`)),this.process.exit(1));let g=new Date(u),_=d?new Date(d):new Date;Number.isNaN(g.getTime())&&(r.t.error(l.default.red(`Start date provided is invalid date. Got --start="${u}" expected --start="01/01/2023"`)),this.process.exit(1)),Number.isNaN(_.getTime())&&(r.t.error(l.default.red(`End date provided is invalid date. Got --end="${d}" expected --end="01/01/2023"`)),this.process.exit(1)),g>_&&(r.t.error(l.default.red(`Got a start date "${g.toISOString()}" that was larger than the end date "${_.toISOString()}". Start date must be before end date.`)),this.process.exit(1)),o.t(this.process.exit);let v=await a.r(e);if(s.default.existsSync(f)&&!s.default.lstatSync(f).isDirectory()&&(r.t.error(l.default.red(`The provided argument "folder" was passed a file. expected: folder="./consent-metrics/"`)),this.process.exit(1)),(0,s.existsSync)(f)||(0,s.mkdirSync)(f),r.t.info(l.default.magenta(`Pulling consent metrics from start=${g.toString()} to end=${_.toISOString()} with bin size "${p}"`)),typeof v==`string`){try{let e=await i.a(n.ti(m,v),{bin:h,start:g,end:_});await n.Ts(Object.entries(e),async([e,t])=>{await n.Ts(t,async({points:t,name:i})=>{let a=(0,c.join)(f,`${e}_${i}.csv`);r.t.info(l.default.magenta(`Writing configuration to file "${a}"...`)),await n.l(a,t.map(({key:e,value:t})=>({timestamp:e,value:t})))},{concurrency:5})},{concurrency:5})}catch(e){r.t.error(l.default.red(`An error occurred syncing the schema: ${e.message}`)),this.process.exit(1)}r.t.info(l.default.green(`Successfully synced consent metrics to disk in folder "${f}"! View at ${t.r}`))}else{let e=[];await n.Es(v,async(t,a)=>{let o=`[${a+1}/${v.length}][${t.organizationName}] `;r.t.info(l.default.magenta(`~~~\n\n${o}Attempting to pull consent metrics...\n\n~~~`));let u=n.ti(m,t.apiKey);try{let e=await i.a(u,{bin:h,start:g,end:_}),a=(0,c.join)(f,t.organizationName);(0,s.existsSync)(a)||(0,s.mkdirSync)(a),Object.entries(e).forEach(([e,t])=>{t.forEach(({points:t,name:i})=>{let o=(0,c.join)(a,`${e}_${i}.csv`);r.t.info(l.default.magenta(`Writing configuration to file "${o}"...`)),n.l(o,t.map(({key:e,value:t})=>({timestamp:e,value:t})))})}),r.t.info(l.default.green(`${o}Successfully pulled configuration!`))}catch{r.t.error(l.default.red(`${o}Failed to sync configuration.`)),e.push(t.organizationName)}}),e.length>0&&(r.t.info(l.default.red(`Sync encountered errors for "${e.join(`,`)}". View output above for more information, or check out ${t.r}`)),this.process.exit(1))}}exports.pullConsentMetrics=u;
3
- //# sourceMappingURL=impl-KgEJvOhE.cjs.map
3
+ //# sourceMappingURL=impl-DxDGyjMI.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-KgEJvOhE.cjs","names":["ConsentManagerMetricBin","validateTranscendAuth","fs","pullConsentManagerMetrics","buildTranscendGraphQLClient","map","writeCsv","ADMIN_DASH_INTEGRATIONS","mapSeries"],"sources":["../src/commands/consent/pull-consent-metrics/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { map, mapSeries } from '../../../lib/bluebird';\nimport { join } from 'node:path';\nimport fs, { existsSync, mkdirSync } from 'node:fs';\nimport {\n buildTranscendGraphQLClient,\n ConsentManagerMetricBin,\n} from '../../../lib/graphql';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { pullConsentManagerMetrics } from '../../../lib/consent-manager';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeCsv } from '../../../lib/helpers';\n\nexport interface PullConsentMetricsCommandFlags {\n auth: string;\n start: Date;\n end?: Date;\n folder: string;\n bin: string;\n transcendUrl: string;\n}\n\nexport async function pullConsentMetrics(\n this: LocalContext,\n {\n auth,\n start,\n end,\n folder,\n bin,\n transcendUrl,\n }: PullConsentMetricsCommandFlags,\n): Promise<void> {\n // Validate bin\n const parsedBin = bin as ConsentManagerMetricBin;\n if (!Object.values(ConsentManagerMetricBin).includes(parsedBin)) {\n logger.error(\n colors.red(\n `Failed to parse argument \"bin\" with value \"${bin}\"\\n` +\n `Expected one of: \\n${Object.values(ConsentManagerMetricBin).join(\n '\\n',\n )}`,\n ),\n );\n this.process.exit(1);\n }\n\n // Parse the dates\n const startDate = new Date(start);\n const endDate = end ? new Date(end) : new Date();\n if (Number.isNaN(startDate.getTime())) {\n logger.error(\n colors.red(\n `Start date provided is invalid date. Got --start=\"${start}\" expected --start=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (Number.isNaN(endDate.getTime())) {\n logger.error(\n colors.red(\n `End date provided is invalid date. Got --end=\"${end}\" expected --end=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (startDate > endDate) {\n logger.error(\n colors.red(\n `Got a start date \"${startDate.toISOString()}\" that was larger than the end date \"${endDate.toISOString()}\". ` +\n 'Start date must be before end date.',\n ),\n );\n this.process.exit(1);\n }\n\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 // Ensure folder either does not exist or is not a file\n if (fs.existsSync(folder) && !fs.lstatSync(folder).isDirectory()) {\n logger.error(\n colors.red(\n 'The provided argument \"folder\" was passed a file. expected: folder=\"./consent-metrics/\"',\n ),\n );\n this.process.exit(1);\n }\n\n // Create the folder if it does not exist\n if (!existsSync(folder)) {\n mkdirSync(folder);\n }\n\n logger.info(\n colors.magenta(\n `Pulling consent metrics from start=${startDate.toString()} to end=${endDate.toISOString()} with bin size \"${bin}\"`,\n ),\n );\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 // Pull the metrics\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // Write to file\n await map(\n Object.entries(configuration),\n async ([metricName, metrics]) => {\n await map(\n metrics,\n async ({ points, name }) => {\n const file = join(folder, `${metricName}_${name}.csv`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${file}\"...`),\n );\n await writeCsv(\n file,\n points.map(({ key, value }) => ({\n timestamp: key,\n value,\n })),\n );\n },\n {\n concurrency: 5,\n },\n );\n },\n { concurrency: 5 },\n );\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the schema: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced consent metrics to disk in folder \"${folder}\"! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\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 consent metrics...\\n\\n~~~`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // ensure folder exists for that organization\n const subFolder = join(folder, apiKey.organizationName);\n if (!existsSync(subFolder)) {\n mkdirSync(subFolder);\n }\n\n // Write to file\n Object.entries(configuration).forEach(([metricName, metrics]) => {\n metrics.forEach(({ points, name }) => {\n const file = join(subFolder, `${metricName}_${name}.csv`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${file}\"...`),\n );\n writeCsv(\n file,\n points.map(({ key, value }) => ({\n timestamp: key,\n value,\n })),\n );\n });\n });\n\n logger.info(\n colors.green(`${prefix}Successfully pulled configuration!`),\n );\n } catch (err) {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n}\n"],"mappings":"8gBAyBA,eAAsB,EAEpB,CACE,OACA,QACA,MACA,SACA,MACA,gBAEa,CAEf,IAAM,EAAY,EACb,OAAO,OAAOA,EAAAA,GAAwB,CAAC,SAAS,EAAU,GAC7D,EAAA,EAAO,MACL,EAAA,QAAO,IACL,8CAA8C,EAAI,wBAC1B,OAAO,OAAOA,EAAAA,GAAwB,CAAC,KAC3D;EACD,GACJ,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAItB,IAAM,EAAY,IAAI,KAAK,EAAM,CAC3B,EAAU,EAAM,IAAI,KAAK,EAAI,CAAG,IAAI,KACtC,OAAO,MAAM,EAAU,SAAS,CAAC,GACnC,EAAA,EAAO,MACL,EAAA,QAAO,IACL,qDAAqD,EAAM,iCAC5D,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAElB,OAAO,MAAM,EAAQ,SAAS,CAAC,GACjC,EAAA,EAAO,MACL,EAAA,QAAO,IACL,iDAAiD,EAAI,+BACtD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAElB,EAAY,IACd,EAAA,EAAO,MACL,EAAA,QAAO,IACL,qBAAqB,EAAU,aAAa,CAAC,uCAAuC,EAAQ,aAAa,CAAC,wCAE3G,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAe,MAAMC,EAAAA,EAAsB,EAAK,CAwBtD,GArBIC,EAAAA,QAAG,WAAW,EAAO,EAAI,CAACA,EAAAA,QAAG,UAAU,EAAO,CAAC,aAAa,GAC9D,EAAA,EAAO,MACL,EAAA,QAAO,IACL,0FACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,GAIlB,EAAA,EAAA,YAAY,EAAO,GACrB,EAAA,EAAA,WAAU,EAAO,CAGnB,EAAA,EAAO,KACL,EAAA,QAAO,QACL,sCAAsC,EAAU,UAAU,CAAC,UAAU,EAAQ,aAAa,CAAC,kBAAkB,EAAI,GAClH,CACF,CAGG,OAAO,GAAiB,SAAU,CACpC,GAAI,CAKF,IAAM,EAAgB,MAAMC,EAAAA,EAHbC,EAAAA,GAA4B,EAAc,EAAa,CAGR,CAC5D,IAAK,EACL,MAAO,EACP,IAAK,EACN,CAAC,CAGF,MAAMC,EAAAA,GACJ,OAAO,QAAQ,EAAc,CAC7B,MAAO,CAAC,EAAY,KAAa,CAC/B,MAAMA,EAAAA,GACJ,EACA,MAAO,CAAE,SAAQ,UAAW,CAC1B,IAAM,GAAA,EAAA,EAAA,MAAY,EAAQ,GAAG,EAAW,GAAG,EAAK,MAAM,CACtD,EAAA,EAAO,KACL,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAC7D,CACD,MAAMC,EAAAA,EACJ,EACA,EAAO,KAAK,CAAE,MAAK,YAAa,CAC9B,UAAW,EACX,QACD,EAAE,CACJ,EAEH,CACE,YAAa,EACd,CACF,EAEH,CAAE,YAAa,EAAG,CACnB,OACM,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IAAI,yCAAyC,EAAI,UAAU,CACnE,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,0DAA0D,EAAO,aAAaC,EAAAA,IAC/E,CACF,KACI,CACL,IAAM,EAA8B,EAAE,CACtC,MAAMC,EAAAA,GAAU,EAAc,MAAO,EAAQ,IAAQ,CACnD,IAAM,EAAS,IAAI,EAAM,EAAE,GAAG,EAAa,OAAO,IAChD,EAAO,iBACR,IACD,EAAA,EAAO,KACL,EAAA,QAAO,QACL,UAAU,EAAO,8CAClB,CACF,CAGD,IAAM,EAASJ,EAAAA,GAA4B,EAAc,EAAO,OAAO,CAEvE,GAAI,CACF,IAAM,EAAgB,MAAMD,EAAAA,EAA0B,EAAQ,CAC5D,IAAK,EACL,MAAO,EACP,IAAK,EACN,CAAC,CAGI,GAAA,EAAA,EAAA,MAAiB,EAAQ,EAAO,iBAAiB,EACnD,EAAA,EAAA,YAAY,EAAU,GACxB,EAAA,EAAA,WAAU,EAAU,CAItB,OAAO,QAAQ,EAAc,CAAC,SAAS,CAAC,EAAY,KAAa,CAC/D,EAAQ,SAAS,CAAE,SAAQ,UAAW,CACpC,IAAM,GAAA,EAAA,EAAA,MAAY,EAAW,GAAG,EAAW,GAAG,EAAK,MAAM,CACzD,EAAA,EAAO,KACL,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAC7D,CACD,EAAA,EACE,EACA,EAAO,KAAK,CAAE,MAAK,YAAa,CAC9B,UAAW,EACX,QACD,EAAE,CACJ,EACD,EACF,CAEF,EAAA,EAAO,KACL,EAAA,QAAO,MAAM,GAAG,EAAO,oCAAoC,CAC5D,MACW,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,GAAG,EAAO,+BAA+B,CAAC,CAClE,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,EAAA,EAAO,KACL,EAAA,QAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0DI,EAAAA,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"impl-DxDGyjMI.cjs","names":["ConsentManagerMetricBin","validateTranscendAuth","fs","pullConsentManagerMetrics","buildTranscendGraphQLClient","map","writeCsv","ADMIN_DASH_INTEGRATIONS","mapSeries"],"sources":["../src/commands/consent/pull-consent-metrics/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { map, mapSeries } from '../../../lib/bluebird';\nimport { join } from 'node:path';\nimport fs, { existsSync, mkdirSync } from 'node:fs';\nimport {\n buildTranscendGraphQLClient,\n ConsentManagerMetricBin,\n} from '../../../lib/graphql';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { pullConsentManagerMetrics } from '../../../lib/consent-manager';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeCsv } from '../../../lib/helpers';\n\nexport interface PullConsentMetricsCommandFlags {\n auth: string;\n start: Date;\n end?: Date;\n folder: string;\n bin: string;\n transcendUrl: string;\n}\n\nexport async function pullConsentMetrics(\n this: LocalContext,\n {\n auth,\n start,\n end,\n folder,\n bin,\n transcendUrl,\n }: PullConsentMetricsCommandFlags,\n): Promise<void> {\n // Validate bin\n const parsedBin = bin as ConsentManagerMetricBin;\n if (!Object.values(ConsentManagerMetricBin).includes(parsedBin)) {\n logger.error(\n colors.red(\n `Failed to parse argument \"bin\" with value \"${bin}\"\\n` +\n `Expected one of: \\n${Object.values(ConsentManagerMetricBin).join(\n '\\n',\n )}`,\n ),\n );\n this.process.exit(1);\n }\n\n // Parse the dates\n const startDate = new Date(start);\n const endDate = end ? new Date(end) : new Date();\n if (Number.isNaN(startDate.getTime())) {\n logger.error(\n colors.red(\n `Start date provided is invalid date. Got --start=\"${start}\" expected --start=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (Number.isNaN(endDate.getTime())) {\n logger.error(\n colors.red(\n `End date provided is invalid date. Got --end=\"${end}\" expected --end=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (startDate > endDate) {\n logger.error(\n colors.red(\n `Got a start date \"${startDate.toISOString()}\" that was larger than the end date \"${endDate.toISOString()}\". ` +\n 'Start date must be before end date.',\n ),\n );\n this.process.exit(1);\n }\n\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 // Ensure folder either does not exist or is not a file\n if (fs.existsSync(folder) && !fs.lstatSync(folder).isDirectory()) {\n logger.error(\n colors.red(\n 'The provided argument \"folder\" was passed a file. expected: folder=\"./consent-metrics/\"',\n ),\n );\n this.process.exit(1);\n }\n\n // Create the folder if it does not exist\n if (!existsSync(folder)) {\n mkdirSync(folder);\n }\n\n logger.info(\n colors.magenta(\n `Pulling consent metrics from start=${startDate.toString()} to end=${endDate.toISOString()} with bin size \"${bin}\"`,\n ),\n );\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 // Pull the metrics\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // Write to file\n await map(\n Object.entries(configuration),\n async ([metricName, metrics]) => {\n await map(\n metrics,\n async ({ points, name }) => {\n const file = join(folder, `${metricName}_${name}.csv`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${file}\"...`),\n );\n await writeCsv(\n file,\n points.map(({ key, value }) => ({\n timestamp: key,\n value,\n })),\n );\n },\n {\n concurrency: 5,\n },\n );\n },\n { concurrency: 5 },\n );\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the schema: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced consent metrics to disk in folder \"${folder}\"! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\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 consent metrics...\\n\\n~~~`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // ensure folder exists for that organization\n const subFolder = join(folder, apiKey.organizationName);\n if (!existsSync(subFolder)) {\n mkdirSync(subFolder);\n }\n\n // Write to file\n Object.entries(configuration).forEach(([metricName, metrics]) => {\n metrics.forEach(({ points, name }) => {\n const file = join(subFolder, `${metricName}_${name}.csv`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${file}\"...`),\n );\n writeCsv(\n file,\n points.map(({ key, value }) => ({\n timestamp: key,\n value,\n })),\n );\n });\n });\n\n logger.info(\n colors.green(`${prefix}Successfully pulled configuration!`),\n );\n } catch (err) {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n}\n"],"mappings":"ojBAyBA,eAAsB,EAEpB,CACE,OACA,QACA,MACA,SACA,MACA,gBAEa,CAEf,IAAM,EAAY,EACb,OAAO,OAAOA,EAAAA,GAAwB,CAAC,SAAS,EAAU,GAC7D,EAAA,EAAO,MACL,EAAA,QAAO,IACL,8CAA8C,EAAI,wBAC1B,OAAO,OAAOA,EAAAA,GAAwB,CAAC,KAC3D;EACD,GACJ,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAItB,IAAM,EAAY,IAAI,KAAK,EAAM,CAC3B,EAAU,EAAM,IAAI,KAAK,EAAI,CAAG,IAAI,KACtC,OAAO,MAAM,EAAU,SAAS,CAAC,GACnC,EAAA,EAAO,MACL,EAAA,QAAO,IACL,qDAAqD,EAAM,iCAC5D,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAElB,OAAO,MAAM,EAAQ,SAAS,CAAC,GACjC,EAAA,EAAO,MACL,EAAA,QAAO,IACL,iDAAiD,EAAI,+BACtD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAElB,EAAY,IACd,EAAA,EAAO,MACL,EAAA,QAAO,IACL,qBAAqB,EAAU,aAAa,CAAC,uCAAuC,EAAQ,aAAa,CAAC,wCAE3G,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAe,MAAMC,EAAAA,EAAsB,EAAK,CAwBtD,GArBIC,EAAAA,QAAG,WAAW,EAAO,EAAI,CAACA,EAAAA,QAAG,UAAU,EAAO,CAAC,aAAa,GAC9D,EAAA,EAAO,MACL,EAAA,QAAO,IACL,0FACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,GAIlB,EAAA,EAAA,YAAY,EAAO,GACrB,EAAA,EAAA,WAAU,EAAO,CAGnB,EAAA,EAAO,KACL,EAAA,QAAO,QACL,sCAAsC,EAAU,UAAU,CAAC,UAAU,EAAQ,aAAa,CAAC,kBAAkB,EAAI,GAClH,CACF,CAGG,OAAO,GAAiB,SAAU,CACpC,GAAI,CAKF,IAAM,EAAgB,MAAMC,EAAAA,EAHbC,EAAAA,GAA4B,EAAc,EAAa,CAGR,CAC5D,IAAK,EACL,MAAO,EACP,IAAK,EACN,CAAC,CAGF,MAAMC,EAAAA,GACJ,OAAO,QAAQ,EAAc,CAC7B,MAAO,CAAC,EAAY,KAAa,CAC/B,MAAMA,EAAAA,GACJ,EACA,MAAO,CAAE,SAAQ,UAAW,CAC1B,IAAM,GAAA,EAAA,EAAA,MAAY,EAAQ,GAAG,EAAW,GAAG,EAAK,MAAM,CACtD,EAAA,EAAO,KACL,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAC7D,CACD,MAAMC,EAAAA,EACJ,EACA,EAAO,KAAK,CAAE,MAAK,YAAa,CAC9B,UAAW,EACX,QACD,EAAE,CACJ,EAEH,CACE,YAAa,EACd,CACF,EAEH,CAAE,YAAa,EAAG,CACnB,OACM,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IAAI,yCAAyC,EAAI,UAAU,CACnE,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,0DAA0D,EAAO,aAAaC,EAAAA,IAC/E,CACF,KACI,CACL,IAAM,EAA8B,EAAE,CACtC,MAAMC,EAAAA,GAAU,EAAc,MAAO,EAAQ,IAAQ,CACnD,IAAM,EAAS,IAAI,EAAM,EAAE,GAAG,EAAa,OAAO,IAChD,EAAO,iBACR,IACD,EAAA,EAAO,KACL,EAAA,QAAO,QACL,UAAU,EAAO,8CAClB,CACF,CAGD,IAAM,EAASJ,EAAAA,GAA4B,EAAc,EAAO,OAAO,CAEvE,GAAI,CACF,IAAM,EAAgB,MAAMD,EAAAA,EAA0B,EAAQ,CAC5D,IAAK,EACL,MAAO,EACP,IAAK,EACN,CAAC,CAGI,GAAA,EAAA,EAAA,MAAiB,EAAQ,EAAO,iBAAiB,EACnD,EAAA,EAAA,YAAY,EAAU,GACxB,EAAA,EAAA,WAAU,EAAU,CAItB,OAAO,QAAQ,EAAc,CAAC,SAAS,CAAC,EAAY,KAAa,CAC/D,EAAQ,SAAS,CAAE,SAAQ,UAAW,CACpC,IAAM,GAAA,EAAA,EAAA,MAAY,EAAW,GAAG,EAAW,GAAG,EAAK,MAAM,CACzD,EAAA,EAAO,KACL,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAC7D,CACD,EAAA,EACE,EACA,EAAO,KAAK,CAAE,MAAK,YAAa,CAC9B,UAAW,EACX,QACD,EAAE,CACJ,EACD,EACF,CAEF,EAAA,EAAO,KACL,EAAA,QAAO,MAAM,GAAG,EAAO,oCAAoC,CAC5D,MACW,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,GAAG,EAAO,+BAA+B,CAAC,CAClE,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,EAAA,EAAO,KACL,EAAA,QAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0DI,EAAAA,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`);require(`./constants-7qBywLgI.cjs`);const t=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`);require(`./enums-BZulhPFa.cjs`);const n=require(`./logger-DQwEYtSS.cjs`);require(`./buildAIIntegrationType-BwuCYR-o.cjs`);const r=require(`./done-input-validation-DGckEJ5a.cjs`);let i=require(`@transcend-io/privacy-types`),a=require(`node:fs`),o=require(`colors`);o=e.t(o);let s=require(`io-ts`);s=e.t(s);let c=require(`cli-progress`);c=e.t(c);async function l({auth:e,file:l,transcendUrl:u,duration:d,subjectType:f,emailColumnName:p,coreIdentifierColumnName:m}){r.t(this.process.exit),(0,a.existsSync)(l)||(n.t.error(o.default.red(`File does not exist: "${l}". Please provide a valid path to a CSV file.`)),this.process.exit(1));try{let r=t.ti(u,e),a=t.oi(l,s.type({[p]:s.string,...m?{[m]:s.string}:{}}));if(!a.length)throw Error(`Input CSV is empty.`);let h=a.map((e,t)=>[e,t]).filter(([e])=>!e[p]?.trim());if(h.length){let e=h.map(([,e])=>e+2).join(`, `);throw Error(`The following rows are missing the required "${p}" column: ${e}`)}if(m){let e=a.map((e,t)=>[e,t]).filter(([e])=>!e[m]?.trim());if(e.length){let t=e.map(([,e])=>e+2).join(`, `);throw Error(`The following rows are missing the required "${m}" column: ${t}`)}}let g=Math.max(1,Math.floor(d/1e3)),_=a.map((e,t)=>{let n=e[p].trim(),r=m?e[m]?.trim():void 0;return{subjectType:f,scopes:[i.SombraStandardScope.PreferenceManagement],expiresIn:g,email:n,...r?{coreIdentifier:r}:{},index:t}}),v=new c.default.SingleBar({},c.default.Presets.shades_classic);v.start(_.length,0);let y=Date.now(),b=await t.Hr(r,_,e=>{v.update(e)});v.update(_.length),v.stop();let x=b.map(({accessToken:e,input:t})=>{if(typeof t.index!=`number`)throw Error(`Internal error: missing input index.`);return{...a[t.index],token:e}});n.t.info(o.default.magenta(`Writing access tokens to file "${l}"...`)),await t.l(l,x,!0);let S=Math.round((Date.now()-y)/1e3);n.t.info(o.default.green(`Successfully generated ${b.length} access tokens to "${l}" in ${S}s!`))}catch(e){n.t.error(o.default.red(`An error occurred while generating access tokens: ${e?.message||String(e)}`)),this.process.exit(1)}}exports.generateAccessTokens=l;
2
+ //# sourceMappingURL=impl-Dxgw6Xfk.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-J5fV8gbh.cjs","names":["buildTranscendGraphQLClient","readCsv","t","SombraStandardScope","cliProgress","createPreferenceAccessTokens","writeCsv"],"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":"6bAyCA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,WACA,cACA,kBACA,4BAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,EAClC,EAAA,EAAA,YAAY,EAAK,GACnB,EAAA,EAAO,MACL,EAAA,QAAO,IACL,yBAAyB,EAAK,+CAC/B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,GAAI,CAEF,IAAM,EAASA,EAAAA,GAA4B,EAAc,EAAK,CASxD,EAAsCC,EAAAA,GAAQ,EANtCC,EAAE,KAAK,EAClB,GAAkBA,EAAE,OACrB,GAAI,EACA,EAAG,GAA2BA,EAAE,OAAQ,CACxC,EAAE,CACP,CAAC,CAC8D,CAChE,GAAI,CAAC,EAAK,OACR,MAAU,MAAM,sBAAsB,CAIxC,IAAM,EAAe,EAClB,KAAK,EAAG,IAAM,CAAC,EAAG,EAAE,CAAU,CAC9B,QAAQ,CAAC,KAAO,CAAC,EAAE,IAAkB,MAAM,CAAC,CAC/C,GAAI,EAAa,OAAQ,CACvB,IAAM,EAAa,EAChB,KAAK,EAAG,KAAO,EAAI,EAAE,CACrB,KAAK,KAAK,CACb,MAAU,MACR,gDAAgD,EAAgB,YAAY,IAC7E,CAEH,GAAI,EAA0B,CAC5B,IAAM,EAAgB,EACnB,KAAK,EAAG,IAAM,CAAC,EAAG,EAAE,CAAU,CAC9B,QAAQ,CAAC,KAAO,CAAC,EAAE,IAA2B,MAAM,CAAC,CACxD,GAAI,EAAc,OAAQ,CACxB,IAAM,EAAa,EAChB,KAAK,EAAG,KAAO,EAAI,EAAE,CACrB,KAAK,KAAK,CACb,MAAU,MACR,gDAAgD,EAAyB,YAAY,IACtF,EAKL,IAAM,EAAmB,KAAK,IAAI,EAAG,KAAK,MAAM,EAAW,IAAK,CAAC,CAG3D,EAAS,EAAK,KAAK,EAAG,IAA+C,CACzE,IAAM,EAAQ,EAAE,GAAiB,MAAM,CACjC,EAAiB,EACnB,EAAE,IAA2B,MAAM,CACnC,IAAA,GAEJ,MAAO,CACL,cACA,OAHa,CAACC,EAAAA,oBAAoB,qBAAqB,CAIvD,UAAW,EACX,QACA,GAAI,EAAiB,CAAE,iBAAgB,CAAG,EAAE,CAC5C,QACD,EACD,CAGI,EAAc,IAAIC,EAAAA,QAAY,UAClC,EAAE,CACFA,EAAAA,QAAY,QAAQ,eACrB,CACD,EAAY,MAAM,EAAO,OAAQ,EAAE,CAGnC,IAAM,EAAK,KAAK,KAAK,CACf,EAAU,MAAMC,EAAAA,GACpB,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,EAAA,EAAO,KAAK,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAAC,CACzE,MAAMC,EAAAA,EAAS,EAAM,EAAY,GAAK,CAEtC,IAAM,EAAe,KAAK,OAAO,KAAK,KAAK,CAAG,GAAM,IAAK,CACzD,EAAA,EAAO,KACL,EAAA,QAAO,MACL,0BAA0B,EAAQ,OAAO,qBAAqB,EAAK,OAAO,EAAa,IACxF,CACF,OAEM,EAAU,CACjB,EAAA,EAAO,MACL,EAAA,QAAO,IACL,qDACE,GAAK,SAAW,OAAO,EAAI,GAE9B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"impl-Dxgw6Xfk.cjs","names":["buildTranscendGraphQLClient","readCsv","t","SombraStandardScope","cliProgress","createPreferenceAccessTokens","writeCsv"],"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":"meAyCA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,WACA,cACA,kBACA,4BAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,EAClC,EAAA,EAAA,YAAY,EAAK,GACnB,EAAA,EAAO,MACL,EAAA,QAAO,IACL,yBAAyB,EAAK,+CAC/B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,GAAI,CAEF,IAAM,EAASA,EAAAA,GAA4B,EAAc,EAAK,CASxD,EAAsCC,EAAAA,GAAQ,EANtCC,EAAE,KAAK,EAClB,GAAkBA,EAAE,OACrB,GAAI,EACA,EAAG,GAA2BA,EAAE,OAAQ,CACxC,EAAE,CACP,CAAC,CAC8D,CAChE,GAAI,CAAC,EAAK,OACR,MAAU,MAAM,sBAAsB,CAIxC,IAAM,EAAe,EAClB,KAAK,EAAG,IAAM,CAAC,EAAG,EAAE,CAAU,CAC9B,QAAQ,CAAC,KAAO,CAAC,EAAE,IAAkB,MAAM,CAAC,CAC/C,GAAI,EAAa,OAAQ,CACvB,IAAM,EAAa,EAChB,KAAK,EAAG,KAAO,EAAI,EAAE,CACrB,KAAK,KAAK,CACb,MAAU,MACR,gDAAgD,EAAgB,YAAY,IAC7E,CAEH,GAAI,EAA0B,CAC5B,IAAM,EAAgB,EACnB,KAAK,EAAG,IAAM,CAAC,EAAG,EAAE,CAAU,CAC9B,QAAQ,CAAC,KAAO,CAAC,EAAE,IAA2B,MAAM,CAAC,CACxD,GAAI,EAAc,OAAQ,CACxB,IAAM,EAAa,EAChB,KAAK,EAAG,KAAO,EAAI,EAAE,CACrB,KAAK,KAAK,CACb,MAAU,MACR,gDAAgD,EAAyB,YAAY,IACtF,EAKL,IAAM,EAAmB,KAAK,IAAI,EAAG,KAAK,MAAM,EAAW,IAAK,CAAC,CAG3D,EAAS,EAAK,KAAK,EAAG,IAA+C,CACzE,IAAM,EAAQ,EAAE,GAAiB,MAAM,CACjC,EAAiB,EACnB,EAAE,IAA2B,MAAM,CACnC,IAAA,GAEJ,MAAO,CACL,cACA,OAHa,CAACC,EAAAA,oBAAoB,qBAAqB,CAIvD,UAAW,EACX,QACA,GAAI,EAAiB,CAAE,iBAAgB,CAAG,EAAE,CAC5C,QACD,EACD,CAGI,EAAc,IAAIC,EAAAA,QAAY,UAClC,EAAE,CACFA,EAAAA,QAAY,QAAQ,eACrB,CACD,EAAY,MAAM,EAAO,OAAQ,EAAE,CAGnC,IAAM,EAAK,KAAK,KAAK,CACf,EAAU,MAAMC,EAAAA,GACpB,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,EAAA,EAAO,KAAK,EAAA,QAAO,QAAQ,kCAAkC,EAAK,MAAM,CAAC,CACzE,MAAMC,EAAAA,EAAS,EAAM,EAAY,GAAK,CAEtC,IAAM,EAAe,KAAK,OAAO,KAAK,KAAK,CAAG,GAAM,IAAK,CACzD,EAAA,EAAO,KACL,EAAA,QAAO,MACL,0BAA0B,EAAQ,OAAO,qBAAqB,EAAK,OAAO,EAAa,IACxF,CACF,OAEM,EAAU,CACjB,EAAA,EAAO,MACL,EAAA,QAAO,IACL,qDACE,GAAK,SAAW,OAAO,EAAI,GAE9B,CACF,CACD,KAAK,QAAQ,KAAK,EAAE"}
@@ -0,0 +1,2 @@
1
+ require(`./constants-7qBywLgI.cjs`),require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`),require(`./enums-BZulhPFa.cjs`),require(`./logger-DQwEYtSS.cjs`),require(`./buildAIIntegrationType-BwuCYR-o.cjs`),require(`./codecs-Bvmb8o9R.cjs`);const e=require(`./consent-manager-Df8gw2Qh.cjs`);require(`./uploadConsents-XYRco1_L.cjs`);const t=require(`./done-input-validation-DGckEJ5a.cjs`);async function n({auth:n,trackerStatus:r,file:i,transcendUrl:a}){t.t(this.process.exit),await e.o({auth:n,trackerStatus:r,file:i,transcendUrl:a})}exports.uploadCookiesFromCsv=n;
2
+ //# sourceMappingURL=impl-IQ7JOZxt.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-Bv4gPikD.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-IQ7JOZxt.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"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`);require(`./constants-7qBywLgI.cjs`);const t=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`);require(`./enums-BZulhPFa.cjs`);const n=require(`./logger-DQwEYtSS.cjs`);require(`./buildAIIntegrationType-BwuCYR-o.cjs`);const r=require(`./data-inventory-D36n1YAJ.cjs`),i=require(`./done-input-validation-DGckEJ5a.cjs`);let a=require(`colors`);a=e.t(a);async function o({auth:e,file:o,transcendUrl:s,dataSiloIds:c,subCategories:l,status:u,includeEncryptedSnippets:d}){i.t(this.process.exit);try{let i=await r.t(t.ti(s,e),{dataSiloIds:c,subCategories:l,status:u,includeEncryptedSnippets:d});n.t.info(a.default.magenta(`Writing unstructured discovery files to file "${o}"...`));let f=[];await t.d(o,i.map(e=>{let n={"Entry ID":e.id,"Data Silo ID":e.dataSiloId,"Object Path ID":e.scannedObjectPathId,"Object ID":e.scannedObjectId,...d?{Entry:e.name,"Context Snippet":e.contextSnippet}:{},"Data Category":`${e.dataSubCategory.category}:${e.dataSubCategory.name}`,"Classification Status":e.status,"Confidence Score":e.confidence,"Classification Method":e.classificationMethod,"Classifier Version":e.classifierVersion};return f=t.Ds([...f,...Object.keys(n)]),n}),f)}catch(e){n.t.error(a.default.red(`An error occurred syncing the unstructured discovery files: ${e.message}`)),this.process.exit(1)}n.t.info(a.default.green(`Successfully synced unstructured discovery files to disk at ${o}!`))}exports.pullUnstructuredDiscoveryFiles=o;
2
+ //# sourceMappingURL=impl-bgI-lF8x.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-4pmSDQvA.cjs","names":["pullUnstructuredSubDataPointRecommendations","buildTranscendGraphQLClient","writeLargeCsv","uniq"],"sources":["../src/commands/inventory/pull-unstructured-discovery-files/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { uniq } from 'lodash-es';\nimport { pullUnstructuredSubDataPointRecommendations } from '../../../lib/data-inventory';\nimport { buildTranscendGraphQLClient } from '../../../lib/graphql';\nimport { logger } from '../../../logger';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeLargeCsv } from '../../../lib/helpers';\n\nexport interface PullUnstructuredDiscoveryFilesCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n subCategories?: string[];\n status?: UnstructuredSubDataPointRecommendationStatus[];\n includeEncryptedSnippets: boolean;\n}\n\nexport async function pullUnstructuredDiscoveryFiles(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n subCategories,\n status,\n includeEncryptedSnippets,\n }: PullUnstructuredDiscoveryFilesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const entries = await pullUnstructuredSubDataPointRecommendations(client, {\n dataSiloIds,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n status,\n includeEncryptedSnippets,\n });\n\n logger.info(\n colors.magenta(\n `Writing unstructured discovery files to file \"${file}\"...`,\n ),\n );\n let headers: string[] = [];\n const inputs = entries.map((entry) => {\n const result = {\n 'Entry ID': entry.id,\n 'Data Silo ID': entry.dataSiloId,\n 'Object Path ID': entry.scannedObjectPathId,\n 'Object ID': entry.scannedObjectId,\n ...(includeEncryptedSnippets\n ? { Entry: entry.name, 'Context Snippet': entry.contextSnippet }\n : {}),\n 'Data Category': `${entry.dataSubCategory.category}:${entry.dataSubCategory.name}`,\n 'Classification Status': entry.status,\n 'Confidence Score': entry.confidence,\n 'Classification Method': entry.classificationMethod,\n 'Classifier Version': entry.classifierVersion,\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(\n colors.red(\n `An error occurred syncing the unstructured discovery files: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced unstructured discovery files to disk at ${file}!`,\n ),\n );\n}\n"],"mappings":"mWAoBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,gBACA,SACA,4BAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAI,CAIF,IAAM,EAAU,MAAMA,EAAAA,EAFPC,EAAAA,GAA4B,EAAc,EAAK,CAEY,CACxE,cACA,gBACA,SACA,2BACD,CAAC,CAEF,EAAA,EAAO,KACL,EAAA,QAAO,QACL,iDAAiD,EAAK,MACvD,CACF,CACD,IAAI,EAAoB,EAAE,CAmB1B,MAAMC,EAAAA,EAAc,EAlBL,EAAQ,IAAK,GAAU,CACpC,IAAM,EAAS,CACb,WAAY,EAAM,GAClB,eAAgB,EAAM,WACtB,iBAAkB,EAAM,oBACxB,YAAa,EAAM,gBACnB,GAAI,EACA,CAAE,MAAO,EAAM,KAAM,kBAAmB,EAAM,eAAgB,CAC9D,EAAE,CACN,gBAAiB,GAAG,EAAM,gBAAgB,SAAS,GAAG,EAAM,gBAAgB,OAC5E,wBAAyB,EAAM,OAC/B,mBAAoB,EAAM,WAC1B,wBAAyB,EAAM,qBAC/B,qBAAsB,EAAM,kBAC7B,CAED,MADA,GAAUC,EAAAA,GAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GACP,CACgC,EAAQ,OACnC,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IACL,+DAA+D,EAAI,UACpE,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,+DAA+D,EAAK,GACrE,CACF"}
1
+ {"version":3,"file":"impl-bgI-lF8x.cjs","names":["pullUnstructuredSubDataPointRecommendations","buildTranscendGraphQLClient","writeLargeCsv","uniq"],"sources":["../src/commands/inventory/pull-unstructured-discovery-files/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { uniq } from 'lodash-es';\nimport { pullUnstructuredSubDataPointRecommendations } from '../../../lib/data-inventory';\nimport { buildTranscendGraphQLClient } from '../../../lib/graphql';\nimport { logger } from '../../../logger';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeLargeCsv } from '../../../lib/helpers';\n\nexport interface PullUnstructuredDiscoveryFilesCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n subCategories?: string[];\n status?: UnstructuredSubDataPointRecommendationStatus[];\n includeEncryptedSnippets: boolean;\n}\n\nexport async function pullUnstructuredDiscoveryFiles(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n subCategories,\n status,\n includeEncryptedSnippets,\n }: PullUnstructuredDiscoveryFilesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const entries = await pullUnstructuredSubDataPointRecommendations(client, {\n dataSiloIds,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n status,\n includeEncryptedSnippets,\n });\n\n logger.info(\n colors.magenta(\n `Writing unstructured discovery files to file \"${file}\"...`,\n ),\n );\n let headers: string[] = [];\n const inputs = entries.map((entry) => {\n const result = {\n 'Entry ID': entry.id,\n 'Data Silo ID': entry.dataSiloId,\n 'Object Path ID': entry.scannedObjectPathId,\n 'Object ID': entry.scannedObjectId,\n ...(includeEncryptedSnippets\n ? { Entry: entry.name, 'Context Snippet': entry.contextSnippet }\n : {}),\n 'Data Category': `${entry.dataSubCategory.category}:${entry.dataSubCategory.name}`,\n 'Classification Status': entry.status,\n 'Confidence Score': entry.confidence,\n 'Classification Method': entry.classificationMethod,\n 'Classifier Version': entry.classifierVersion,\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(\n colors.red(\n `An error occurred syncing the unstructured discovery files: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced unstructured discovery files to disk at ${file}!`,\n ),\n );\n}\n"],"mappings":"yYAoBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,gBACA,SACA,4BAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAI,CAIF,IAAM,EAAU,MAAMA,EAAAA,EAFPC,EAAAA,GAA4B,EAAc,EAAK,CAEY,CACxE,cACA,gBACA,SACA,2BACD,CAAC,CAEF,EAAA,EAAO,KACL,EAAA,QAAO,QACL,iDAAiD,EAAK,MACvD,CACF,CACD,IAAI,EAAoB,EAAE,CAmB1B,MAAMC,EAAAA,EAAc,EAlBL,EAAQ,IAAK,GAAU,CACpC,IAAM,EAAS,CACb,WAAY,EAAM,GAClB,eAAgB,EAAM,WACtB,iBAAkB,EAAM,oBACxB,YAAa,EAAM,gBACnB,GAAI,EACA,CAAE,MAAO,EAAM,KAAM,kBAAmB,EAAM,eAAgB,CAC9D,EAAE,CACN,gBAAiB,GAAG,EAAM,gBAAgB,SAAS,GAAG,EAAM,gBAAgB,OAC5E,wBAAyB,EAAM,OAC/B,mBAAoB,EAAM,WAC1B,wBAAyB,EAAM,qBAC/B,qBAAsB,EAAM,kBAC7B,CAED,MADA,GAAUC,EAAAA,GAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GACP,CACgC,EAAQ,OACnC,EAAK,CACZ,EAAA,EAAO,MACL,EAAA,QAAO,IACL,+DAA+D,EAAI,UACpE,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAA,EAAO,KACL,EAAA,QAAO,MACL,+DAA+D,EAAK,GACrE,CACF"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`);require(`./constants-7qBywLgI.cjs`),require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`),require(`./enums-BZulhPFa.cjs`);const t=require(`./logger-DQwEYtSS.cjs`);require(`./buildAIIntegrationType-BwuCYR-o.cjs`),require(`./codecs-Bvmb8o9R.cjs`);const n=require(`./consent-manager-Df8gw2Qh.cjs`);require(`./uploadConsents-XYRco1_L.cjs`);const r=require(`./api-keys-eh_rPCV_.cjs`),i=require(`./done-input-validation-DGckEJ5a.cjs`);let a=require(`node:fs`),o=require(`colors`);o=e.t(o);async function s({auth:e,xdiLocation:s,file:c,removeIpAddresses:l,domainBlockList:u,xdiAllowedCommands:d,transcendUrl:f}){i.t(this.process.exit);let{syncGroups:p,html:m}=await n.r(await r.r(e),{xdiLocation:s,transcendUrl:f,removeIpAddresses:l,domainBlockList:u.length>0?u:void 0,xdiAllowedCommands:d});t.t.info(o.default.green(`Successfully constructed sync endpoint for sync groups: ${JSON.stringify(p,null,2)}`)),(0,a.writeFileSync)(c,m),t.t.info(o.default.green(`Wrote configuration to file "${c}"!`))}exports.buildXdiSyncEndpoint=s;
2
+ //# sourceMappingURL=impl-feFIqpBO.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BwAnSxkP.cjs","names":["buildXdiSyncEndpointHelper","validateTranscendAuth"],"sources":["../src/commands/consent/build-xdi-sync-endpoint/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { writeFileSync } from 'node:fs';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { buildXdiSyncEndpoint as buildXdiSyncEndpointHelper } from '../../../lib/consent-manager';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface BuildXdiSyncEndpointCommandFlags {\n auth: string;\n xdiLocation: string;\n file: string;\n removeIpAddresses: boolean;\n domainBlockList: string[];\n xdiAllowedCommands: string;\n transcendUrl: string;\n}\n\nexport async function buildXdiSyncEndpoint(\n this: LocalContext,\n {\n auth,\n xdiLocation,\n file,\n removeIpAddresses,\n domainBlockList,\n xdiAllowedCommands,\n transcendUrl,\n }: BuildXdiSyncEndpointCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Build the sync endpoint\n const { syncGroups, html } = await buildXdiSyncEndpointHelper(apiKeyOrList, {\n xdiLocation,\n transcendUrl,\n removeIpAddresses,\n domainBlockList: domainBlockList.length > 0 ? domainBlockList : undefined,\n xdiAllowedCommands,\n });\n\n // Log success\n logger.info(\n colors.green(\n `Successfully constructed sync endpoint for sync groups: ${JSON.stringify(\n syncGroups,\n null,\n 2,\n )}`,\n ),\n );\n\n // Write to disk\n writeFileSync(file, html);\n logger.info(colors.green(`Wrote configuration to file \"${file}\"!`));\n}\n"],"mappings":"4eAkBA,eAAsB,EAEpB,CACE,OACA,cACA,OACA,oBACA,kBACA,qBACA,gBAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAMtC,GAAM,CAAE,aAAY,QAAS,MAAMA,EAAAA,EAHd,MAAMC,EAAAA,EAAsB,EAAK,CAGsB,CAC1E,cACA,eACA,oBACA,gBAAiB,EAAgB,OAAS,EAAI,EAAkB,IAAA,GAChE,qBACD,CAAC,CAGF,EAAA,EAAO,KACL,EAAA,QAAO,MACL,2DAA2D,KAAK,UAC9D,EACA,KACA,EACD,GACF,CACF,EAGD,EAAA,EAAA,eAAc,EAAM,EAAK,CACzB,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM,gCAAgC,EAAK,IAAI,CAAC"}
1
+ {"version":3,"file":"impl-feFIqpBO.cjs","names":["buildXdiSyncEndpointHelper","validateTranscendAuth"],"sources":["../src/commands/consent/build-xdi-sync-endpoint/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { writeFileSync } from 'node:fs';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { buildXdiSyncEndpoint as buildXdiSyncEndpointHelper } from '../../../lib/consent-manager';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface BuildXdiSyncEndpointCommandFlags {\n auth: string;\n xdiLocation: string;\n file: string;\n removeIpAddresses: boolean;\n domainBlockList: string[];\n xdiAllowedCommands: string;\n transcendUrl: string;\n}\n\nexport async function buildXdiSyncEndpoint(\n this: LocalContext,\n {\n auth,\n xdiLocation,\n file,\n removeIpAddresses,\n domainBlockList,\n xdiAllowedCommands,\n transcendUrl,\n }: BuildXdiSyncEndpointCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Build the sync endpoint\n const { syncGroups, html } = await buildXdiSyncEndpointHelper(apiKeyOrList, {\n xdiLocation,\n transcendUrl,\n removeIpAddresses,\n domainBlockList: domainBlockList.length > 0 ? domainBlockList : undefined,\n xdiAllowedCommands,\n });\n\n // Log success\n logger.info(\n colors.green(\n `Successfully constructed sync endpoint for sync groups: ${JSON.stringify(\n syncGroups,\n null,\n 2,\n )}`,\n ),\n );\n\n // Write to disk\n writeFileSync(file, html);\n logger.info(colors.green(`Wrote configuration to file \"${file}\"!`));\n}\n"],"mappings":"4gBAkBA,eAAsB,EAEpB,CACE,OACA,cACA,OACA,oBACA,kBACA,qBACA,gBAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAMtC,GAAM,CAAE,aAAY,QAAS,MAAMA,EAAAA,EAHd,MAAMC,EAAAA,EAAsB,EAAK,CAGsB,CAC1E,cACA,eACA,oBACA,gBAAiB,EAAgB,OAAS,EAAI,EAAkB,IAAA,GAChE,qBACD,CAAC,CAGF,EAAA,EAAO,KACL,EAAA,QAAO,MACL,2DAA2D,KAAK,UAC9D,EACA,KACA,EACD,GACF,CACF,EAGD,EAAA,EAAA,eAAc,EAAM,EAAK,CACzB,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM,gCAAgC,EAAK,IAAI,CAAC"}
@@ -0,0 +1,12 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`);require(`./constants-7qBywLgI.cjs`);const t=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`);require(`./enums-BZulhPFa.cjs`);const n=require(`./logger-DQwEYtSS.cjs`);require(`./buildAIIntegrationType-BwuCYR-o.cjs`);const r=require(`./done-input-validation-DGckEJ5a.cjs`),i=require(`./preference-management-DV6NIcXt.cjs`);let a=require(`node:fs`),o=require(`node:path`),s=require(`colors`);s=e.t(s);let c=require(`cli-progress`);c=e.t(c);async function l({auth:e,partition:l,sombraAuth:u,file:d=``,directory:f,transcendUrl:p,timestamp:m,maxConcurrency:h,maxItemsInChunk:g,receiptDirectory:_,fileConcurrency:v}){f&&d&&(n.t.error(s.default.red(`Cannot provide both a directory and a file. Please provide only one.`)),this.process.exit(1)),!d&&!f&&(n.t.error(s.default.red(`A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences`)),this.process.exit(1)),r.t(this.process.exit);let y=[];if(f)try{let e=(0,a.readdirSync)(f).filter(e=>e.endsWith(`.csv`));e.length===0&&(n.t.error(s.default.red(`No CSV files found in directory: ${f}`)),this.process.exit(1)),y.push(...e.map(e=>(0,o.join)(f,e)))}catch(e){n.t.error(s.default.red(`Failed to read directory: ${f}`)),n.t.error(s.default.red(e.message)),this.process.exit(1)}else try{d.endsWith(`.csv`)||(n.t.error(s.default.red(`File must be a CSV file`)),this.process.exit(1)),y.push(d)}catch(e){n.t.error(s.default.red(`Failed to access file: ${d}`)),n.t.error(s.default.red(e.message)),this.process.exit(1)}n.t.debug(s.default.green(`Processing ${y.length} consent preferences files for partition: ${l}`)),n.t.debug(`\nFiles to process: ${y.join(`, `)}\n`);let b=await t.ei(p,e,u),x=new c.default.SingleBar({format:`Deletion Progress |${s.default.cyan(`[{bar}]`)}| Duration: ${s.default.red(`{duration_formatted}`)} | {value}/{total} Files Processed `},c.default.Presets.shades_classic);x.start(y.length,0);let S=await t.Ts(y,async e=>{let t=await i.t(b,{partition:l,filePath:e,timestamp:m,maxItemsInChunk:g,maxConcurrency:h});return x.increment(),t},{concurrency:v});x.stop();let C=S.flat(),w=``;C.length>0&&(w=(0,o.join)(_,`deletion-failures-${Date.now()}.csv`),t.l(w,C,!0)),n.t.info(s.default.green(`
2
+
3
+ ==================================
4
+
5
+ `)),n.t.info(s.default.green(`
6
+ #### Deletion Summary Report #####
7
+ `)),n.t.info(s.default.green(`📁 Total Files Processed: ${y.length} \n❌ Errors: ${C.length} \n📝 Receipt Path: ${w||`N/A`}`)),n.t.info(s.default.green(`
8
+
9
+ ==================================
10
+
11
+ `))}exports.deletePreferenceRecords=l;
12
+ //# sourceMappingURL=impl-orpaJd8b.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BMxxKrNz.cjs","names":["file","createSombraGotInstance","cliProgress","map","bulkDeletePreferenceRecords"],"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":"6bAsCA,eAAsB,EAEpB,CACE,OACA,YACA,aACA,OAAO,GACP,YACA,eACA,YACA,iBACA,kBACA,mBACA,mBAEa,CACT,GAAe,IACnB,EAAA,EAAO,MACL,EAAA,QAAO,IACL,uEACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGlB,CAAC,GAAQ,CAAC,IACZ,EAAA,EAAO,MACL,EAAA,QAAO,IACL,uHACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAEtB,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAkB,EAAE,CAE1B,GAAI,EACF,GAAI,CAEF,IAAM,GAAA,EAAA,EAAA,aAD+B,EAAU,CACb,OAAQ,GAASA,EAAK,SAAS,OAAO,CAAC,CAErE,EAAS,SAAW,IACtB,EAAA,EAAO,MACL,EAAA,QAAO,IAAI,oCAAoC,IAAY,CAC5D,CACD,KAAK,QAAQ,KAAK,EAAE,EAItB,EAAM,KAAK,GAAG,EAAS,IAAK,IAAA,EAAA,EAAA,MAAc,EAAWA,EAAK,CAAC,CAAC,OACrD,EAAK,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,6BAA6B,IAAY,CAAC,CAClE,EAAA,EAAO,MAAM,EAAA,QAAO,IAAK,EAAc,QAAQ,CAAC,CAChD,KAAK,QAAQ,KAAK,EAAE,MAGtB,GAAI,CAEG,EAAK,SAAS,OAAO,GACxB,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,0BAA0B,CAAC,CACnD,KAAK,QAAQ,KAAK,EAAE,EAEtB,EAAM,KAAK,EAAK,OACT,EAAK,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,0BAA0B,IAAO,CAAC,CAC1D,EAAA,EAAO,MAAM,EAAA,QAAO,IAAK,EAAc,QAAQ,CAAC,CAChD,KAAK,QAAQ,KAAK,EAAE,CAIxB,EAAA,EAAO,MACL,EAAA,QAAO,MACL,cAAc,EAAM,OAAO,4CAA4C,IACxE,CACF,CACD,EAAA,EAAO,MAAM,uBAAuB,EAAM,KAAK,KAAK,CAAC,IAAI,CAGzD,IAAM,EAAS,MAAMC,EAAAA,GAAwB,EAAc,EAAM,EAAW,CACtE,EAAoB,IAAIC,EAAAA,QAAY,UACxC,CACE,OAAQ,sBAAsB,EAAA,QAAO,KACnC,UACD,CAAC,cAAc,EAAA,QAAO,IACrB,uBACD,CAAC,qCACH,CACDA,EAAAA,QAAY,QAAQ,eACrB,CACD,EAAkB,MAAM,EAAM,OAAQ,EAAE,CAGxC,IAAM,EAAsB,MAAMC,EAAAA,GAChC,EACA,KAAO,IAAa,CAClB,IAAM,EAAS,MAAMC,EAAAA,EAA4B,EAAQ,CACvD,YACA,WACA,YACA,kBACA,iBACD,CAAC,CAEF,OADA,EAAkB,WAAW,CACtB,GAET,CAAE,YAAa,EAAiB,CACjC,CACD,EAAkB,MAAM,CACxB,IAAM,EAAgB,EAAoB,MAAM,CAG5C,EAAc,GACd,EAAc,OAAS,IACzB,GAAA,EAAA,EAAA,MAAmB,EAAkB,qBAAqB,KAAK,KAAK,CAAC,MAAM,CAC3E,EAAA,EAAS,EAAa,EAAe,GAAK,EAG5C,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM;;;;EAA+C,CAAC,CACzE,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM;;EAAyC,CAAC,CACnE,EAAA,EAAO,KACL,EAAA,QAAO,MACL,6BAA6B,EAAM,OAAO,eAC3B,EAAc,OAAO,sBACd,GAAe,QACtC,CACF,CACD,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM;;;;EAA6C,CAAC"}
1
+ {"version":3,"file":"impl-orpaJd8b.cjs","names":["file","createSombraGotInstance","cliProgress","map","bulkDeletePreferenceRecords"],"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":"meAsCA,eAAsB,EAEpB,CACE,OACA,YACA,aACA,OAAO,GACP,YACA,eACA,YACA,iBACA,kBACA,mBACA,mBAEa,CACT,GAAe,IACnB,EAAA,EAAO,MACL,EAAA,QAAO,IACL,uEACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGlB,CAAC,GAAQ,CAAC,IACZ,EAAA,EAAO,MACL,EAAA,QAAO,IACL,uHACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAEtB,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAkB,EAAE,CAE1B,GAAI,EACF,GAAI,CAEF,IAAM,GAAA,EAAA,EAAA,aAD+B,EAAU,CACb,OAAQ,GAASA,EAAK,SAAS,OAAO,CAAC,CAErE,EAAS,SAAW,IACtB,EAAA,EAAO,MACL,EAAA,QAAO,IAAI,oCAAoC,IAAY,CAC5D,CACD,KAAK,QAAQ,KAAK,EAAE,EAItB,EAAM,KAAK,GAAG,EAAS,IAAK,IAAA,EAAA,EAAA,MAAc,EAAWA,EAAK,CAAC,CAAC,OACrD,EAAK,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,6BAA6B,IAAY,CAAC,CAClE,EAAA,EAAO,MAAM,EAAA,QAAO,IAAK,EAAc,QAAQ,CAAC,CAChD,KAAK,QAAQ,KAAK,EAAE,MAGtB,GAAI,CAEG,EAAK,SAAS,OAAO,GACxB,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,0BAA0B,CAAC,CACnD,KAAK,QAAQ,KAAK,EAAE,EAEtB,EAAM,KAAK,EAAK,OACT,EAAK,CACZ,EAAA,EAAO,MAAM,EAAA,QAAO,IAAI,0BAA0B,IAAO,CAAC,CAC1D,EAAA,EAAO,MAAM,EAAA,QAAO,IAAK,EAAc,QAAQ,CAAC,CAChD,KAAK,QAAQ,KAAK,EAAE,CAIxB,EAAA,EAAO,MACL,EAAA,QAAO,MACL,cAAc,EAAM,OAAO,4CAA4C,IACxE,CACF,CACD,EAAA,EAAO,MAAM,uBAAuB,EAAM,KAAK,KAAK,CAAC,IAAI,CAGzD,IAAM,EAAS,MAAMC,EAAAA,GAAwB,EAAc,EAAM,EAAW,CACtE,EAAoB,IAAIC,EAAAA,QAAY,UACxC,CACE,OAAQ,sBAAsB,EAAA,QAAO,KACnC,UACD,CAAC,cAAc,EAAA,QAAO,IACrB,uBACD,CAAC,qCACH,CACDA,EAAAA,QAAY,QAAQ,eACrB,CACD,EAAkB,MAAM,EAAM,OAAQ,EAAE,CAGxC,IAAM,EAAsB,MAAMC,EAAAA,GAChC,EACA,KAAO,IAAa,CAClB,IAAM,EAAS,MAAMC,EAAAA,EAA4B,EAAQ,CACvD,YACA,WACA,YACA,kBACA,iBACD,CAAC,CAEF,OADA,EAAkB,WAAW,CACtB,GAET,CAAE,YAAa,EAAiB,CACjC,CACD,EAAkB,MAAM,CACxB,IAAM,EAAgB,EAAoB,MAAM,CAG5C,EAAc,GACd,EAAc,OAAS,IACzB,GAAA,EAAA,EAAA,MAAmB,EAAkB,qBAAqB,KAAK,KAAK,CAAC,MAAM,CAC3E,EAAA,EAAS,EAAa,EAAe,GAAK,EAG5C,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM;;;;EAA+C,CAAC,CACzE,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM;;EAAyC,CAAC,CACnE,EAAA,EAAO,KACL,EAAA,QAAO,MACL,6BAA6B,EAAM,OAAO,eAC3B,EAAc,OAAO,sBACd,GAAe,QACtC,CACF,CACD,EAAA,EAAO,KAAK,EAAA,QAAO,MAAM;;;;EAA6C,CAAC"}
@@ -1,2 +1,2 @@
1
- require(`./enums-CBXlBJii.cjs`),require(`./constants-JoCDv9ym.cjs`);const e=require(`./syncConfigurationToTranscend-D4PLA70C.cjs`);require(`./logger-BaHHbWVd.cjs`),require(`./buildAIIntegrationType-n_Qlv8wG.cjs`);const t=require(`./done-input-validation-Cgk5kNBs.cjs`);async function n({auth:n,actions:r,statuses:i=[],requestIds:a,silentModeBefore:o,createdAtBefore:s,createdAtAfter:c,cancellationTitle:l,transcendUrl:u,concurrency:d}){t.t(this.process.exit),await e.G({transcendUrl:u,requestActions:r,auth:n,cancellationTitle:l,requestIds:a,statuses:i,concurrency:d,silentModeBefore:o?new Date(o):void 0,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0})}exports.cancel=n;
2
- //# sourceMappingURL=impl-ChNLuyNq.cjs.map
1
+ require(`./constants-7qBywLgI.cjs`);const e=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`);require(`./enums-BZulhPFa.cjs`),require(`./logger-DQwEYtSS.cjs`),require(`./buildAIIntegrationType-BwuCYR-o.cjs`);const t=require(`./done-input-validation-DGckEJ5a.cjs`);async function n({auth:n,actions:r,statuses:i=[],requestIds:a,silentModeBefore:o,createdAtBefore:s,createdAtAfter:c,cancellationTitle:l,transcendUrl:u,concurrency:d}){t.t(this.process.exit),await e.G({transcendUrl:u,requestActions:r,auth:n,cancellationTitle:l,requestIds:a,statuses:i,concurrency:d,silentModeBefore:o?new Date(o):void 0,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0})}exports.cancel=n;
2
+ //# sourceMappingURL=impl-xUzH7vUF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-ChNLuyNq.cjs","names":["cancelPrivacyRequests"],"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 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 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 });\n}\n"],"mappings":"6QAkBA,eAAsB,EAEpB,CACE,OACA,UACA,WAAW,EAAE,CACb,aACA,mBACA,kBACA,iBACA,oBACA,eACA,eAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAAAA,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,GAC7D,CAAC"}
1
+ {"version":3,"file":"impl-xUzH7vUF.cjs","names":["cancelPrivacyRequests"],"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 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 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 });\n}\n"],"mappings":"6QAkBA,eAAsB,EAEpB,CACE,OACA,UACA,WAAW,EAAE,CACb,aACA,mBACA,kBACA,iBACA,oBACA,eACA,eAEa,CACf,EAAA,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAAAA,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,GAC7D,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const e=require(`./enums-CBXlBJii.cjs`),t=require(`./constants-JoCDv9ym.cjs`),n=require(`./syncConfigurationToTranscend-D4PLA70C.cjs`);require(`./logger-BaHHbWVd.cjs`);const r=require(`./buildAIIntegrationType-n_Qlv8wG.cjs`),i=require(`./codecs-JSDJgtyL.cjs`),a=require(`./readTranscendYaml-CL9nujUr.cjs`),o=require(`./mergeTranscendInputs-PPpGbYgG.cjs`),s=require(`./consent-manager-BNMaKHId.cjs`),c=require(`./uploadConsents-CN1JucL3.cjs`),l=require(`./cron-ClvgH2uD.cjs`),u=require(`./api-keys-DB0BZSh5.cjs`),d=require(`./data-inventory-BzEYoxaa.cjs`),f=require(`./manual-enrichment-D-0rM9KN.cjs`);let p=require(`@transcend-io/privacy-types`),m=require(`@transcend-io/type-utils`),h=require(`@transcend-io/handlebars-utils`),g=require(`fast-glob`);g=e.s(g);let _=require(`child_process`);const v=20;async function y(e){let t=[],r=0,i=!1;do{let{largeLanguageModels:{nodes:a}}=await n.i(e,n.Ki,{first:20,offset:r});t.push(...a),r+=20,i=a.length===20}while(i);return t.sort((e,t)=>e.name.localeCompare(t.name))}function b(e){return RegExp(`<${e}>([\\s\\S]+?)<\\/${e}>`)}function x(e){return e}const S=e=>{try{return JSON.parse(e)}catch{return e}};var C=class{prompts;handlebarsOptions;promptContentMap;largeLanguageModels=[];agentsByName={};agentsByAgentId={};graphQLClient;defaultVariables;variables;handlebars;transcendApiKey;transcendUrl;requireApproval;cacheDuration;lastUpdatedAt;constructor({prompts:e,handlebarsOptions:r={},transcendUrl:i=t.a,transcendApiKey:a,requireApproval:o=!0,cacheDuration:s,defaultVariables:c={}}){this.prompts=e,this.transcendUrl=i,this.transcendApiKey=a,this.variables=c,this.defaultVariables=c,this.graphQLClient=n.ti(i,typeof a==`object`?a.release():a),this.requireApproval=o,this.cacheDuration=s,this.handlebarsOptions=r,this.handlebars=(0,h.createHandlebarsWithHelpers)(r)}async fetchPromptsAndMetadata(){let e=(0,m.getValues)(this.prompts),r=e.map(({id:e})=>e).filter(e=>!!e),i=e.map(({title:e})=>e).filter(e=>!!e),a=n.Ds(e.map(({agentNames:e})=>e||[]).flat()),[o,s,c]=await Promise.all([n.Xn(this.graphQLClient,{promptIds:r,promptTitles:i}),y(this.graphQLClient),n.Gr(this.graphQLClient,{names:a})]);this.agentsByName=t.g(c,`name`),this.agentsByAgentId=t.g(c,`agentId`),this.largeLanguageModels=s.filter(e=>e.isTranscendHosted===!1);let l=t.g(o.prompts,`title`),u=t.g(o.prompts,`id`);return this.variables={...o.calculatedVariables.reduce((e,t)=>Object.assign(e,{[t.name]:t.data?JSON.parse(t.data):t.data}),{}),...this.defaultVariables},this.handlebars=(0,h.createHandlebarsWithHelpers)({...this.handlebarsOptions,templates:[...this.handlebarsOptions.templates||[],...o.promptPartials.map(e=>({name:e.slug,content:e.content}))]}),this.promptContentMap=(0,m.apply)(this.prompts,({id:e,title:t})=>{let n=e?u[e]:t?l[t]:void 0;if(!n)throw Error(`Failed to find prompt with title: "${t}" and id: "${e}"`);return n}),this.lastUpdatedAt=new Date,o}async getAgentByName(e){let t=this.agentsByName[e];if(t)return t;let[r]=await n.Gr(this.graphQLClient,{names:[e]});if(r)return this.agentsByName[r.name]=r,this.agentsByAgentId[r.agentId]=r,r}async getPromptThreadBySlackTs(e){let[t]=await n.Jn(this.graphQLClient,{slackMessageTs:[e]});return t}async getAgentsByName(e){if(e.length<1)throw Error(`Expected at least one name to be provided`);let{hasCache:t=[],missingCache:r=[]}=n.As(e,e=>this.agentsByName[e]?`hasCache`:`missingCache`),i=t.map(e=>this.agentsByName[e]);if(r.length===0)return i;let a=n.Ns(r,50),o=[];return await n.Es(a,async e=>{let t=await n.Gr(this.graphQLClient,{names:e});t.forEach(e=>{this.agentsByName[e.name]=e,this.agentsByAgentId[e.agentId]=e}),o.push(...t)}),[...i,...o]}getAgentFiles(e){return n.qr(this.graphQLClient,e)}getLargeLanguageModel(e){let t=this.largeLanguageModels.find(t=>typeof e==`string`?t.id===e:t.name===e.name&&t.client===e.client);if(!t)throw Error(`Failed to find model matching: ${typeof e==`string`?e:JSON.stringify(e)}`);return t}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:t}=this;if(!t)throw Error(`Expected this.promptContentMap to be defined`);let n=t[e];if(!n)throw Error(`Expected this.promptContentMap[${e}] to be defined`);return n}async compilePrompt(e,t){let n=await this.getPromptDefinition(e),r=this.prompts[e];if(!r)throw Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&n.status!==p.PromptStatus.Approved)throw Error(`Assessment "${n.title}" cannot be used because its in status: "${n.status}"`);if(n.status===p.PromptStatus.Rejected)throw Error(`Assessment "${n.title}" cannot be used because it's in status: "${n.status}"`);return(0,m.decodeCodec)(r.paramCodec,t),this.handlebars.compile(n.content)({currentDate:new Date().toISOString(),...this.variables,...t})}parseAiResponse(e,t){let n=this.prompts[e];if(!n)throw Error(`Expected this.prompts[${e}] to be defined`);let r=n.extractFromTag&&(b(n.extractFromTag).exec(t)||[])[1]||t;return(0,m.decodeCodec)(n.outputCodec,S(r),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:t,...r}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let i=r.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw Error(`Expected this.promptContentMap to be defined`);let a=this.promptContentMap[e];if(!a)throw Error(`Expected this.prompts[${e}] to be defined`);if(r.promptRunMessages.length===0)throw Error(`promptRunMessages is expected to have length > 0`);if(r.promptRunMessages[0].role!==p.ChatCompletionRole.System)throw Error(`promptRunMessages[0].role is expected to be = ${p.ChatCompletionRole.System}`);if(r.promptRunMessages[r.promptRunMessages.length-1].role!==p.ChatCompletionRole.Assistant)throw Error(`promptRunMessages[${r.promptRunMessages.length-1}].role is expected to be = ${p.ChatCompletionRole.Assistant}`);let o=r.promptRunMessages[r.promptRunMessages.length-1].content,s;try{s=this.parseAiResponse(e,o)}catch(e){throw await n.hn(this.graphQLClient,{productArea:p.PromptRunProductArea.PromptManager,...r,name:i,error:e.message,status:p.QueueStatus.Error,...typeof t==`string`?{largeLanguageModelId:t}:{largeLanguageModelName:t.name,largeLanguageModelClient:t.client},promptId:a.id,promptRunMessages:r.promptRunMessages.map((e,t)=>({...e,...t===0?{template:a.content}:{}}))}),e}let c=await n.hn(this.graphQLClient,{productArea:p.PromptRunProductArea.PromptManager,...r,name:i,status:p.QueueStatus.Resolved,...typeof t==`string`?{largeLanguageModelId:t}:{largeLanguageModelName:t.name,largeLanguageModelClient:t.client},promptId:a.id,promptRunMessages:r.promptRunMessages.map((e,t)=>({...e,...t===0?{template:a.content}:{}}))});return{result:s,promptRunId:c,promptRunUrl:`https://app.transcend.io/prompts/runs/${c}`}}async reportPromptRunError(e,{largeLanguageModel:t,...r}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let i=r.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw Error(`Expected this.promptContentMap to be defined`);let a=this.promptContentMap[e];if(!a)throw Error(`Expected this.prompts[${e}] to be defined`);if(r.promptRunMessages.length===0)throw Error(`promptRunMessages is expected to have length > 0`);if(r.promptRunMessages[0].role!==p.ChatCompletionRole.System)throw Error(`promptRunMessages[0].role is expected to be = ${p.ChatCompletionRole.System}`);let o=await n.hn(this.graphQLClient,{productArea:p.PromptRunProductArea.PromptManager,...r,name:i,status:p.QueueStatus.Error,...typeof t==`string`?{largeLanguageModelId:t}:{largeLanguageModelName:t.name,largeLanguageModelClient:t.client},promptId:a.id,promptRunMessages:r.promptRunMessages.map((e,t)=>({...e,...t===0?{template:a.content}:{}}))});return{promptRunId:o,promptRunUrl:`https://app.transcend.io/prompts/runs/${o}`}}};function w(e){return e.replace(/(https?:\/\/[^\s]+)/g,`<link-omitted>`)}function T(e){return Object.entries(e).reduce((e,[t,n])=>n!=null&&n!==``&&!(Array.isArray(n)&&n.length===0)&&!(typeof n==`object`&&Object.keys(n).length===0)?Object.assign(e,{[t]:n}):e,{})}function E({baseBranch:e,rootDirectory:t,githubRepo:r,excludedGlob:i=[],fileBlockList:a=[]}){(0,_.execSync)(`git fetch origin ${e}`);let o=(0,_.execSync)(`git ls-remote ${r} "refs/heads/${e}" | cut -f 1`,{encoding:`utf-8`}).split(`
2
- `)[0],s=(0,_.execSync)(`git rev-parse HEAD`,{encoding:`utf-8`}).split(`
3
- `)[0];if(!o||!s)throw Error(`FAILED TO FIND COMMIT RANGE`);let c=n.js((0,_.execSync)(`git fetch && git diff --name-only "${e||o}...${s}" -- ${t}`,{encoding:`utf-8`}).split(`
4
- `).filter(e=>e),a),l=i.length>0?g.default.sync(c,{ignore:i}):c,u={};return l.forEach(e=>{u[e]=(0,_.execSync)(`git show ${s}:${e}`,{encoding:`utf-8`})}),{changedFiles:c,fileDiffs:u,repoName:r.split(`/`).pop().split(`.`)[0],commit:s}}exports.ACTIONS=n.ra,exports.ADD_MESSAGES_TO_PROMPT_RUN=n.Ga,exports.ADD_SILO_DISCOVERY_RESULTS=n.Wo,exports.ADMIN_DASH=t.t,exports.ADMIN_DASH_DATAPOINTS=t.n,exports.ADMIN_DASH_INTEGRATIONS=t.r,exports.AGENTS=n.Ui,exports.AGENT_FILES=n.Bi,exports.AGENT_FUNCTIONS=n.Li,exports.API_KEYS=n.qo,exports.APPROVE_PRIVACY_REQUEST=n.Eo,exports.ASSESSMENTS=n.vo,exports.ASSESSMENT_SECTION_FIELDS=n.yo,exports.ASSESSMENT_TEMPLATES=n.ho,exports.ASSUME_ROLE=n.qi,exports.ATTRIBUTES=n.Pa,exports.ATTRIBUTE_KEYS_REQUESTS=n.Bo,exports.ATTRIBUTE_VALUES=n.Fa,exports.ActionInput=i.t,exports.ActionItemCollectionInput=i.n,exports.ActionItemInput=i.r,exports.AgentFileInput=i.i,exports.AgentFunctionInput=i.a,exports.AgentInput=i.o,exports.ApiKeyInput=i.s,exports.AssessmentAction=n.Nn,exports.AssessmentAnswerOptionInput=i.c,exports.AssessmentDisplayLogicInput=i.l,exports.AssessmentInput=i.u,exports.AssessmentNestedRule=n.Pn,exports.AssessmentNestedRuleInput=i.d,exports.AssessmentResourceInput=i.f,exports.AssessmentRetentionScheduleInput=i.p,exports.AssessmentRiskLogic=n.jn,exports.AssessmentRule=n.Fn,exports.AssessmentRuleInput=i.m,exports.AssessmentRuleWithOperands=n.In,exports.AssessmentRuleWithoutOperands=n.Ln,exports.AssessmentSectionInput=i.h,exports.AssessmentSectionQuestionInput=i.g,exports.AssessmentTemplateInput=i._,exports.AttestedExtraIdentifiers=n.rt,exports.AttributeInput=i.v,exports.AttributePreview=i.y,exports.AttributeValueInput=i.b,exports.BLANK=n.pi,exports.BULK_APPLY=n.mi,exports.BULK_REQUEST_FILES=n.qa,exports.BUSINESS_ENTITIES=n.aa,exports.BusinessEntityInput=i.x,exports.CANCEL_PRIVACY_REQUEST=n.Do,exports.CAN_APPLY_IN_BULK=n.hi,exports.CATALOGS=n.ss,exports.CHANGE_REQUEST_DATA_SILO_STATUS=n.to,exports.CODE_PACKAGES=n.Po,exports.CONSENT_MANAGER_ANALYTICS_DATA=n.ca,exports.CONSENT_PARTITIONS=n.la,exports.COOKIES=n.ua,exports.CREATE_ACTION_ITEMS=n.ea,exports.CREATE_ACTION_ITEM_COLLECTION=n.Ha,exports.CREATE_AGENT=n.Wi,exports.CREATE_AGENT_FILE=n.Vi,exports.CREATE_AGENT_FUNCTION=n.Ri,exports.CREATE_API_KEY=n.Jo,exports.CREATE_ATTRIBUTE=n.Ia,exports.CREATE_ATTRIBUTE_VALUES=n.La,exports.CREATE_BUSINESS_ENTITY=n.oa,exports.CREATE_CODE_PACKAGE=n.Fo,exports.CREATE_CONSENT_EXPERIENCE=n.da,exports.CREATE_CONSENT_MANAGER=n.fa,exports.CREATE_CONSENT_PARTITION=n.pa,exports.CREATE_DATA_FLOWS=n.ma,exports.CREATE_DATA_SILOS=n.fs,exports.CREATE_DATA_SUBJECT=n.$o,exports.CREATE_DATA_SUB_CATEGORY=n.ji,exports.CREATE_ENRICHER=n.cs,exports.CREATE_IDENTIFIER=n.rs,exports.CREATE_PREFERENCE_ACCESS_TOKENS=n.Ko,exports.CREATE_PROCESSING_ACTIVITY=n.Ti,exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY=n.Oi,exports.CREATE_PROMPT=n.ao,exports.CREATE_PROMPT_GROUP=n.oo,exports.CREATE_PROMPT_PARTIAL=n.so,exports.CREATE_REPOSITORY=n.Xo,exports.CREATE_SOFTWARE_DEVELOPMENT_KIT=n.Lo,exports.CREATE_TEAM=n.Qa,exports.CREATE_TEMPLATE=n.Ho,exports.CREATE_VENDOR=n.Pi,exports.CachedFileState=n.gi,exports.CachedRequestState=n._i,exports.CodePackageInput=i.S,exports.CodePackageSdk=i.C,exports.ColumnName=n.vi,exports.ConsentManageExperienceInput=i.w,exports.ConsentManagerInput=i.T,exports.ConsentManagerMetricBin=n.jr,exports.ConsentManagerServiceMetadata=i.E,exports.ConsentPreferenceTopic=i.D,exports.ConsentPreferenceTopicOptionValue=i.O,exports.ConsentPurpose=i.k,exports.CookieCsvInput=i.A,exports.CookieInput=i.j,exports.CronIdentifier=l.o,exports.CronIdentifierPush=l.i,exports.DATAPOINT_EXPORT=n.vs,exports.DATA_FLOWS=n.ha,exports.DATA_POINTS=n.ys,exports.DATA_POINT_COUNT=n.bs,exports.DATA_SILOS=n.ps,exports.DATA_SILOS_ENRICHED=n.ms,exports.DATA_SILO_EXPORT=n.hs,exports.DATA_SUBJECTS=n.es,exports.DATA_SUB_CATEGORIES=n.Mi,exports.DAY_MS=n.f,exports.DEBUG=t.i,exports.DEFAULT_TRANSCEND_API=t.a,exports.DEFAULT_TRANSCEND_CONSENT_API=t.o,exports.DEFAULT_TRANSCEND_PULL_RESOURCES=n.gn,exports.DELETE_API_KEY=n.Yo,exports.DELETE_ATTRIBUTE_VALUE=n.Ra,exports.DEPLOYED_PRIVACY_CENTER_URL=n.Xi,exports.DEPLOY_CONSENT_MANAGER=n.ga,exports.DETERMINE_LOGIN_METHOD=n.Ji,exports.DataCategoryGuessInput=i.M,exports.DataCategoryInput=i.N,exports.DataCategoryPreviewInput=i.P,exports.DataCategoryRecommendationInput=i.F,exports.DataFlowCsvInput=i.I,exports.DataFlowInput=i.L,exports.DataSiloInput=i.R,exports.DataSubjectInput=i.z,exports.DatapointInput=i.B,exports.ENABLED_PLUGINS=n.Go,exports.ENRICHERS=n.ls,exports.ENTRY_COUNT=n._s,exports.EXPERIENCES=n._a,exports.EnrichPrivacyRequest=f.n,exports.EnricherInput=i.V,exports.FETCH_CONSENT_MANAGER=n.va,exports.FETCH_CONSENT_MANAGER_ID=n.ya,exports.FETCH_CONSENT_MANAGER_THEME=n.ba,exports.FETCH_PRIVACY_CENTER_ID=n.Zi,exports.FIVE_MIN_MS=n.p,exports.FieldInput=i.H,exports.GLOBAL_ACTION_ITEMS=n.ta,exports.GLOBAL_ACTION_ITEM_COLLECTIONS=n.Ua,exports.HOUR_MS=n.m,exports.IDENTIFIERS=n.is,exports.IDENTIFIER_BLOCK_LIST=n.yi,exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS=n.bo,exports.INITIALIZER=n.us,exports.IP_ADDRESS_REGEX=s.n,exports.IS_REQUIRED=n.bi,exports.IdentifierInput=i.U,exports.ImportOnetrustAssessmentsInput=i.W,exports.IntlMessage=n.$,exports.IntlMessageInput=i.G,exports.LARGE_LANGUAGE_MODELS=n.Ki,exports.LOGIN=n.Yi,exports.MESSAGES=n.wo,exports.NEW_IDENTIFIER_TYPES=n.as,exports.NONE=n.xi,exports.NOTIFY_ADDITIONAL_TIME=n.Oo,exports.ORGANIZATION=n.Vo,exports.OneTrustFileFormat=e.t,exports.OneTrustPullResource=e.n,exports.OneTrustPullSource=e.r,exports.OpenAIEnabledRoute=i.K,exports.OpenAIEnabledRoutes=i.q,exports.OpenAIIntegration=i.J,exports.OpenAIRouteName=e.i,exports.POLICIES=n.jo,exports.PREFERENCE_TOPICS=n.go,exports.PRIVACY_CENTER=n.Qi,exports.PROCESSING_ACTIVITIES=n.Ei,exports.PROCESSING_PURPOSE_SUB_CATEGORIES=n.ki,exports.PROMPTS=n.co,exports.PROMPTS_WITH_VARIABLES=n.lo,exports.PROMPT_GROUPS=n.uo,exports.PROMPT_PARTIALS=n.do,exports.PROMPT_THREADS=n.No,exports.PURPOSES=n._o,exports.ParsedAttributeInput=n.si,exports.PartitionInput=i.Y,exports.PathfinderPolicy=i.X,exports.PathfinderPolicyName=e.a,exports.PathfinderPolicyNameC=i.Z,exports.PathfinderPromptRunMetadata=i.Q,exports.PolicyInput=i.$,exports.PrivacyCenterInput=i.et,exports.PrivacyRequest=n.ur,exports.PrivacyRequestInput=n.it,exports.PrivacyRequestResponse=n.Y,exports.ProcessingActivityInput=i.tt,exports.ProcessingPurposeInput=i.nt,exports.ProcessingPurposePreviewInput=i.rt,exports.PromptAVendorEmailSettings=i.it,exports.PromptGroupInput=i.at,exports.PromptInput=i.ot,exports.PromptPartialInput=i.st,exports.PurposeMap=c.t,exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT=n.no,exports.REMOVE_REQUEST_IDENTIFIERS=n.Xa,exports.REPORT_PROMPT_RUN=n.Ka,exports.REPOSITORIES=n.Zo,exports.REQUESTS=n.ko,exports.REQUEST_DATA_SILOS=n.ro,exports.REQUEST_ENRICHERS=n.xo,exports.REQUEST_FILES=n.Ja,exports.REQUEST_IDENTIFIERS=n.Za,exports.RETRYABLE_BATCH_STATUSES=t.s,exports.RETRY_REQUEST_DATA_SILO=n.io,exports.RETRY_REQUEST_ENRICHER=n.So,exports.RateCounter=n.C,exports.RegionInput=i.ct,exports.RepositoryInput=i.lt,exports.RequestFileMetadata=n.et,exports.RequestFileMetadataResponse=n.tt,exports.RequestIdentifiersResponse=n.pr,exports.RequestPurposeTrigger=n.dr,exports.RiskAssignmentInput=i.ut,exports.RiskLogicInput=i.dt,exports.SCOPES_BY_TITLE=t.c,exports.SCOPE_TITLES=t.l,exports.SET_RESOURCE_ATTRIBUTES=n.za,exports.SILO_DISCOVERY_RESULTS=n.Ci,exports.SKIP_REQUEST_ENRICHER=n.Co,exports.SOFTWARE_DEVELOPMENT_KITS=n.Ro,exports.SOMBRA_VERSION=n.wi,exports.SUB_DATA_POINTS=n.xs,exports.SUB_DATA_POINTS_COUNT=n.Ss,exports.SUB_DATA_POINTS_WITH_GUESSES=n.Cs,exports.SYNC_ATTRIBUTE_TYPES=n.Rr,exports.SiloDiscoveryResultInput=i.ft,exports.SoftwareDevelopmentKitInput=i.pt,exports.StoredApiKey=i.mt,exports.SuccessfulRequest=n.Si,exports.TEAMS=n.$a,exports.TEMPLATES=n.Uo,exports.TOGGLE_CONSENT_PRECEDENCE=n.xa,exports.TOGGLE_DATA_SUBJECT=n.ts,exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY=n.Sa,exports.TOGGLE_UNKNOWN_COOKIE_POLICY=n.Ca,exports.TOGGLE_UNKNOWN_REQUEST_POLICY=n.wa,exports.TR_PULL_RESOURCE_SCOPE_MAP=t.u,exports.TR_PUSH_RESOURCE_SCOPE_MAP=t.d,exports.TR_YML_RESOURCE_TO_FIELD_NAME=t.f,exports.TeamInput=i.ht,exports.TemplateInput=i.gt,exports.TranscendInput=i._t,exports.TranscendPromptManager=C,exports.TranscendPullResource=e.o,exports.UPDATE_ACTION=n.ia,exports.UPDATE_ACTION_ITEMS=n.na,exports.UPDATE_ACTION_ITEM_COLLECTION=n.Wa,exports.UPDATE_AGENTS=n.Gi,exports.UPDATE_AGENT_FILES=n.Hi,exports.UPDATE_AGENT_FUNCTIONS=n.zi,exports.UPDATE_ATTRIBUTE=n.Ba,exports.UPDATE_ATTRIBUTE_VALUES=n.Va,exports.UPDATE_BUSINESS_ENTITIES=n.sa,exports.UPDATE_CODE_PACKAGES=n.Io,exports.UPDATE_CONSENT_EXPERIENCE=n.Ta,exports.UPDATE_CONSENT_MANAGER_DOMAINS=n.Ea,exports.UPDATE_CONSENT_MANAGER_PARTITION=n.Da,exports.UPDATE_CONSENT_MANAGER_THEME=n.Oa,exports.UPDATE_CONSENT_MANAGER_TO_LATEST=n.ka,exports.UPDATE_CONSENT_MANAGER_VERSION=n.Aa,exports.UPDATE_DATA_FLOWS=n.ja,exports.UPDATE_DATA_SILOS=n.gs,exports.UPDATE_DATA_SUBJECT=n.ns,exports.UPDATE_DATA_SUB_CATEGORIES=n.Ni,exports.UPDATE_ENRICHER=n.ds,exports.UPDATE_IDENTIFIER=n.os,exports.UPDATE_INTL_MESSAGES=n.To,exports.UPDATE_LOAD_OPTIONS=n.Ma,exports.UPDATE_OR_CREATE_COOKIES=n.Na,exports.UPDATE_OR_CREATE_DATA_POINT=n.ws,exports.UPDATE_POLICIES=n.Mo,exports.UPDATE_PRIVACY_CENTER=n.$i,exports.UPDATE_PRIVACY_REQUEST=n.Ao,exports.UPDATE_PROCESSING_ACTIVITIES=n.Di,exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES=n.Ai,exports.UPDATE_PROMPTS=n.fo,exports.UPDATE_PROMPT_GROUPS=n.po,exports.UPDATE_PROMPT_PARTIALS=n.mo,exports.UPDATE_REPOSITORIES=n.Qo,exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS=n.zo,exports.UPDATE_TEAM=n.eo,exports.UPDATE_VENDORS=n.Fi,exports.USERS=n.Ya,exports.USP_STRING_REGEX=c.n,exports.VARIABLE_PARAMETERS_NAME=a.t,exports.VARIABLE_PARAMETERS_REGEXP=a.n,exports.VENDORS=n.Ii,exports.VendorInput=i.vt,exports.WebhookHeader=i.yt,exports.addDaysUtc=n.h,exports.addMessagesToPromptRun=n.ri,exports.addMs=n.g,exports.appendCsvRowsOrdered=n.a,exports.appendCsvSync=n.o,exports.approvePrivacyRequests=n.J,exports.assumeRole=n.Vn,exports.buildAIIntegrationType=r.t,exports.buildEnabledRouteType=r.n,exports.buildTranscendGraphQLClient=n.ti,exports.buildTranscendGraphQLClientGeneric=n.ni,exports.buildXdiSyncEndpoint=s.r,exports.bulkRestartRequests=n.B,exports.bulkRetryEnrichers=n.R,exports.cancelPrivacyRequests=n.G,exports.clampPageSize=n._,exports.collectParquetFilesOrExit=n.x,exports.consentManagersToBusinessEntities=s.t,exports.convertToDataSubjectAllowlist=n.$n,exports.convertToDataSubjectBlockList=n.er,exports.createActionItemCollection=n.ln,exports.createActionItems=n.on,exports.createAgent=n.Zt,exports.createAgentFile=n.rn,exports.createAgentFunction=n.en,exports.createApiKey=n.zn,exports.createBusinessEntity=n.qt,exports.createCodePackage=n.Rt,exports.createConsentToken=c.i,exports.createDataCategory=n.jt,exports.createDataFlows=n.Ot,exports.createPreferenceAccessTokens=n.Hr,exports.createProcessingPurpose=n._t,exports.createPrompt=n.mt,exports.createRegexForTag=b,exports.createRepository=n.Vt,exports.createSoftwareDevelopmentKit=n.Wt,exports.createSombraGotInstance=n.ei,exports.createTranscendConsentGotInstance=n.$r,exports.createVendor=n.dt,exports.defineTranscendPrompts=x,exports.deleteApiKey=n.Bn,exports.deployConsentManager=n.Zr,Object.defineProperty(exports,`description`,{enumerable:!0,get:function(){return t.m}}),exports.domainToHost=s.i,exports.downloadPrivacyRequestFiles=n.Z,exports.enrichPrivacyRequest=f.r,exports.ensureAllDataSubjectsExist=n.tr,exports.extractClientError=n.U,exports.extractErrorMessage=n.O,exports.fetchActiveSiloDiscoPlugin=n.Xr,exports.fetchAllActionItems=n.Yr,exports.fetchAllActions=n.Jr,exports.fetchAllAgentFiles=n.qr,exports.fetchAllAgentFunctions=n.Kr,exports.fetchAllAgents=n.Gr,exports.fetchAllApiKeys=n.ar,exports.fetchAllAssessmentTemplates=n.Ur,exports.fetchAllAssessments=n.Wr,exports.fetchAllAttributeValues=n.zr,exports.fetchAllAttributes=n.Br,exports.fetchAllBusinessEntities=n.Lr,exports.fetchAllCatalogs=n.rr,exports.fetchAllCookies=n.Ar,exports.fetchAllDataCategories=n.kr,exports.fetchAllDataFlows=n.Or,exports.fetchAllDataPoints=n.Tn,exports.fetchAllDataSilos=n.En,exports.fetchAllDataSubjects=n.nr,exports.fetchAllEnrichers=n.Cn,exports.fetchAllIdentifiers=n.n,exports.fetchAllMessages=n.Dr,exports.fetchAllPolicies=n.wr,exports.fetchAllPreferenceTopics=n.Sr,exports.fetchAllPrivacyCenters=n.xr,exports.fetchAllProcessingActivities=n.br,exports.fetchAllProcessingPurposes=n.yr,exports.fetchAllPromptGroups=n.Qn,exports.fetchAllPromptPartials=n.Zn,exports.fetchAllPromptThreads=n.Jn,exports.fetchAllPrompts=n.Yn,exports.fetchAllPurposes=n.vr,exports.fetchAllPurposesAndPreferences=n._r,exports.fetchAllRequestAttributeKeys=n.Vr,exports.fetchAllRequestEnrichers=n.gr,exports.fetchAllRequestIdentifierMetadata=n.hr,exports.fetchAllRequestIdentifiers=n.mr,exports.fetchAllRequests=n.fr,exports.fetchAllSiloDiscoveryResults=n.vn,exports.fetchAllSubDataPoints=n.Dn,exports.fetchAllTeams=n.lr,exports.fetchAllTemplates=n.xn,exports.fetchAllUsers=n.cr,exports.fetchAllVendors=n.sr,exports.fetchAndIndexCatalogs=n.ir,exports.fetchApiKeys=n.or,exports.fetchConsentManager=n.Mr,exports.fetchConsentManagerAnalyticsData=n.Nr,exports.fetchConsentManagerExperiences=n.Pr,exports.fetchConsentManagerId=n.Fr,exports.fetchConsentManagerTheme=n.Ir,exports.fetchEnrichedDataSilos=n.On,exports.fetchIdentifiersAndCreateMissing=n.r,exports.fetchPartitions=n.yn,exports.fetchPrivacyCenterId=n.Tr,exports.fetchPrivacyCenterUrl=n.Er,exports.fetchPromptsWithVariables=n.Xn,exports.fetchRequestDataSilo=n.Gn,exports.fetchRequestDataSiloActiveCount=n.Wn,exports.fetchRequestDataSilos=n.Kn,exports.fetchRequestDataSilosCount=n.qn,exports.fetchRequestFilesForRequest=n.Un,exports.filterNullishValuesFromObject=T,exports.filterRows=n.ii,exports.formatAttributeValues=n.Cr,exports.fuzzyMatchColumns=n.di,exports.fuzzySearch=n.fi,exports.generateCrossAccountApiKeys=u.i,exports.getErrorStatus=n.k,exports.getFileMetadataForPrivacyRequests=n.nt,exports.getGitFilesThatChanged=E,exports.getUniqueValuesForColumn=n.ai,exports.initCsvFile=n.s,exports.inquirerAutoComplete=n.j,exports.inquirerConfirmBoolean=n.M,exports.inquirerConfirmText=n.N,exports.limitRecords=n.w,exports.listDirectories=u.t,exports.listFiles=u.n,exports.loginUser=n.Hn,exports.makeGraphQLRequest=n.i,exports.mapColumnsToAttributes=n.W,exports.mapColumnsToIdentifiers=n.K,exports.mapCsvColumnsToApi=n.ct,exports.mapCsvRowsToRequestInputs=n.at,exports.mapEnumValues=n.ui,exports.mapRequestEnumValues=n.st,exports.markCronIdentifierCompleted=l.a,exports.markRequestDataSiloIdsCompleted=l.n,exports.markSilentPrivacyRequests=n.lt,exports.mergeTranscendInputs=o.t,exports.name=t.p,exports.normalizeIdentifierValue=n.ot,exports.notifyPrivacyRequestsAdditionalTime=n.q,exports.parquetToCsvOneFile=n.b,exports.parseAssessmentDisplayLogic=n.Rn,exports.parseAssessmentRiskLogic=n.Mn,exports.parseAttributesFromString=n.ci,exports.parseFilePath=n.c,exports.parseVariablesFromString=n.A,exports.pullAllDatapoints=d.n,exports.pullChunkedCustomSiloOutstandingIdentifiers=l.t,exports.pullConsentManagerMetrics=s.a,exports.pullCronPageOfIdentifiers=l.s,exports.pullManualEnrichmentIdentifiersToCsv=f.i,exports.pullPrivacyRequests=n.I,exports.pullTranscendConfiguration=n._n,exports.pullUnstructuredSubDataPointRecommendations=d.t,exports.pushCronIdentifiersFromCsv=l.r,exports.pushManualEnrichmentIdentifiersFromCsv=f.t,exports.readCsv=n.oi,exports.readSafe=n.S,exports.readTranscendYaml=a.r,exports.removeLinks=w,exports.removeUnverifiedRequestIdentifiers=n.P,exports.replaceVariablesInYaml=a.i,exports.reportPromptRun=n.hn,exports.restartPrivacyRequest=n.V,exports.retryRequestDataSilos=n.L,exports.retryRequestEnricher=n.mn,exports.retrySamePromise=n.T,exports.setResourceAttributes=n.pn,exports.skipPreflightJobs=n.z,exports.skipRequestDataSilos=n.F,exports.sleepPromise=n.D,exports.splitCsvToList=n.li,exports.splitInHalf=n.E,exports.startOfHour=n.v,exports.startOfUtcDay=n.y,exports.streamPrivacyRequestFiles=n.Q,exports.submitPrivacyRequest=n.X,exports.syncAction=n.fn,exports.syncActionItemCollections=n.un,exports.syncActionItems=n.sn,exports.syncAgentFiles=n.in,exports.syncAgentFunctions=n.tn,exports.syncAgents=n.Qt,exports.syncAttribute=n.Xt,exports.syncBusinessEntities=n.Jt,exports.syncCodePackages=n.zt,exports.syncConfigurationToTranscend=n.t,exports.syncConsentManager=n.It,exports.syncConsentManagerExperiences=n.Lt,exports.syncCookies=n.Pt,exports.syncDataCategories=n.Mt,exports.syncDataFlows=n.kt,exports.syncDataSiloDependencies=n.kn,exports.syncDataSilos=n.An,exports.syncDataSubject=n.Dt,exports.syncEnricher=n.wn,exports.syncIdentifier=n.Et,exports.syncIntlMessages=n.wt,exports.syncPartitions=n.bn,exports.syncPolicies=n.St,exports.syncPrivacyCenter=n.xt,exports.syncProcessingActivities=n.bt,exports.syncProcessingPurposes=n.vt,exports.syncPrompts=n.ht,exports.syncRepositories=n.Ht,exports.syncSoftwareDevelopmentKits=n.Gt,exports.syncTemplate=n.Sn,exports.syncVendors=n.ft,exports.updateActionItem=n.cn,exports.updateActionItemCollection=n.dn,exports.updateAgentFiles=n.an,exports.updateAgentFunctions=n.nn,exports.updateAgents=n.$t,exports.updateBusinessEntities=n.Yt,exports.updateCodePackages=n.Bt,exports.updateConsentManagerToLatest=n.Qr,exports.updateConsentManagerVersionToLatest=s.c,exports.updateDataCategories=n.Nt,exports.updateDataFlows=n.At,exports.updateIntlMessages=n.Tt,exports.updateOrCreateCookies=n.Ft,exports.updatePolicies=n.Ct,exports.updateProcessingPurposes=n.yt,exports.updatePrompts=n.gt,exports.updateRepositories=n.Ut,exports.updateSoftwareDevelopmentKits=n.Kt,exports.updateVendors=n.pt,exports.uploadConsents=c.r,exports.uploadCookiesFromCsv=s.o,exports.uploadDataFlowsFromCsv=s.s,exports.uploadPrivacyRequestsFromCsv=n.H,exports.uploadSiloDiscoveryResults=n.ut,exports.validateTranscendAuth=u.r,Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return t.h}}),exports.writeCsv=n.l,exports.writeCsvSync=n.u,exports.writeLargeCsv=n.d,exports.writeTranscendYaml=a.a;
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./constants-7qBywLgI.cjs`),n=require(`./syncConfigurationToTranscend-Bd0ZTIm1.cjs`),r=require(`./enums-BZulhPFa.cjs`);require(`./logger-DQwEYtSS.cjs`);const i=require(`./buildAIIntegrationType-BwuCYR-o.cjs`),a=require(`./codecs-Bvmb8o9R.cjs`),o=require(`./readTranscendYaml-Cycz6RxW.cjs`),s=require(`./mergeTranscendInputs-BIBCYbug.cjs`),c=require(`./consent-manager-Df8gw2Qh.cjs`),l=require(`./uploadConsents-XYRco1_L.cjs`),u=require(`./cron-BhfbISdy.cjs`),d=require(`./api-keys-eh_rPCV_.cjs`),f=require(`./data-inventory-D36n1YAJ.cjs`),p=require(`./manual-enrichment-CzRiIFev.cjs`);let m=require(`@transcend-io/privacy-types`),h=require(`@transcend-io/type-utils`),g=require(`@transcend-io/handlebars-utils`),_=require(`fast-glob`);_=e.t(_);let v=require(`child_process`);const y=20;async function b(e){let t=[],r=0,i=!1;do{let{largeLanguageModels:{nodes:a}}=await n.i(e,n.Ki,{first:20,offset:r});t.push(...a),r+=20,i=a.length===20}while(i);return t.sort((e,t)=>e.name.localeCompare(t.name))}function x(e){return RegExp(`<${e}>([\\s\\S]+?)<\\/${e}>`)}function S(e){return e}const C=e=>{try{return JSON.parse(e)}catch{return e}};var w=class{prompts;handlebarsOptions;promptContentMap;largeLanguageModels=[];agentsByName={};agentsByAgentId={};graphQLClient;defaultVariables;variables;handlebars;transcendApiKey;transcendUrl;requireApproval;cacheDuration;lastUpdatedAt;constructor({prompts:e,handlebarsOptions:r={},transcendUrl:i=t.a,transcendApiKey:a,requireApproval:o=!0,cacheDuration:s,defaultVariables:c={}}){this.prompts=e,this.transcendUrl=i,this.transcendApiKey=a,this.variables=c,this.defaultVariables=c,this.graphQLClient=n.ti(i,typeof a==`object`?a.release():a),this.requireApproval=o,this.cacheDuration=s,this.handlebarsOptions=r,this.handlebars=(0,g.createHandlebarsWithHelpers)(r)}async fetchPromptsAndMetadata(){let e=(0,h.getValues)(this.prompts),r=e.map(({id:e})=>e).filter(e=>!!e),i=e.map(({title:e})=>e).filter(e=>!!e),a=n.Ds(e.map(({agentNames:e})=>e||[]).flat()),[o,s,c]=await Promise.all([n.Xn(this.graphQLClient,{promptIds:r,promptTitles:i}),b(this.graphQLClient),n.Gr(this.graphQLClient,{names:a})]);this.agentsByName=t.g(c,`name`),this.agentsByAgentId=t.g(c,`agentId`),this.largeLanguageModels=s.filter(e=>e.isTranscendHosted===!1);let l=t.g(o.prompts,`title`),u=t.g(o.prompts,`id`);return this.variables={...o.calculatedVariables.reduce((e,t)=>Object.assign(e,{[t.name]:t.data?JSON.parse(t.data):t.data}),{}),...this.defaultVariables},this.handlebars=(0,g.createHandlebarsWithHelpers)({...this.handlebarsOptions,templates:[...this.handlebarsOptions.templates||[],...o.promptPartials.map(e=>({name:e.slug,content:e.content}))]}),this.promptContentMap=(0,h.apply)(this.prompts,({id:e,title:t})=>{let n=e?u[e]:t?l[t]:void 0;if(!n)throw Error(`Failed to find prompt with title: "${t}" and id: "${e}"`);return n}),this.lastUpdatedAt=new Date,o}async getAgentByName(e){let t=this.agentsByName[e];if(t)return t;let[r]=await n.Gr(this.graphQLClient,{names:[e]});if(r)return this.agentsByName[r.name]=r,this.agentsByAgentId[r.agentId]=r,r}async getPromptThreadBySlackTs(e){let[t]=await n.Jn(this.graphQLClient,{slackMessageTs:[e]});return t}async getAgentsByName(e){if(e.length<1)throw Error(`Expected at least one name to be provided`);let{hasCache:t=[],missingCache:r=[]}=n.As(e,e=>this.agentsByName[e]?`hasCache`:`missingCache`),i=t.map(e=>this.agentsByName[e]);if(r.length===0)return i;let a=n.Ns(r,50),o=[];return await n.Es(a,async e=>{let t=await n.Gr(this.graphQLClient,{names:e});t.forEach(e=>{this.agentsByName[e.name]=e,this.agentsByAgentId[e.agentId]=e}),o.push(...t)}),[...i,...o]}getAgentFiles(e){return n.qr(this.graphQLClient,e)}getLargeLanguageModel(e){let t=this.largeLanguageModels.find(t=>typeof e==`string`?t.id===e:t.name===e.name&&t.client===e.client);if(!t)throw Error(`Failed to find model matching: ${typeof e==`string`?e:JSON.stringify(e)}`);return t}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:t}=this;if(!t)throw Error(`Expected this.promptContentMap to be defined`);let n=t[e];if(!n)throw Error(`Expected this.promptContentMap[${e}] to be defined`);return n}async compilePrompt(e,t){let n=await this.getPromptDefinition(e),r=this.prompts[e];if(!r)throw Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&n.status!==m.PromptStatus.Approved)throw Error(`Assessment "${n.title}" cannot be used because its in status: "${n.status}"`);if(n.status===m.PromptStatus.Rejected)throw Error(`Assessment "${n.title}" cannot be used because it's in status: "${n.status}"`);return(0,h.decodeCodec)(r.paramCodec,t),this.handlebars.compile(n.content)({currentDate:new Date().toISOString(),...this.variables,...t})}parseAiResponse(e,t){let n=this.prompts[e];if(!n)throw Error(`Expected this.prompts[${e}] to be defined`);let r=n.extractFromTag&&(x(n.extractFromTag).exec(t)||[])[1]||t;return(0,h.decodeCodec)(n.outputCodec,C(r),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:t,...r}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let i=r.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw Error(`Expected this.promptContentMap to be defined`);let a=this.promptContentMap[e];if(!a)throw Error(`Expected this.prompts[${e}] to be defined`);if(r.promptRunMessages.length===0)throw Error(`promptRunMessages is expected to have length > 0`);if(r.promptRunMessages[0].role!==m.ChatCompletionRole.System)throw Error(`promptRunMessages[0].role is expected to be = ${m.ChatCompletionRole.System}`);if(r.promptRunMessages[r.promptRunMessages.length-1].role!==m.ChatCompletionRole.Assistant)throw Error(`promptRunMessages[${r.promptRunMessages.length-1}].role is expected to be = ${m.ChatCompletionRole.Assistant}`);let o=r.promptRunMessages[r.promptRunMessages.length-1].content,s;try{s=this.parseAiResponse(e,o)}catch(e){throw await n.hn(this.graphQLClient,{productArea:m.PromptRunProductArea.PromptManager,...r,name:i,error:e.message,status:m.QueueStatus.Error,...typeof t==`string`?{largeLanguageModelId:t}:{largeLanguageModelName:t.name,largeLanguageModelClient:t.client},promptId:a.id,promptRunMessages:r.promptRunMessages.map((e,t)=>({...e,...t===0?{template:a.content}:{}}))}),e}let c=await n.hn(this.graphQLClient,{productArea:m.PromptRunProductArea.PromptManager,...r,name:i,status:m.QueueStatus.Resolved,...typeof t==`string`?{largeLanguageModelId:t}:{largeLanguageModelName:t.name,largeLanguageModelClient:t.client},promptId:a.id,promptRunMessages:r.promptRunMessages.map((e,t)=>({...e,...t===0?{template:a.content}:{}}))});return{result:s,promptRunId:c,promptRunUrl:`https://app.transcend.io/prompts/runs/${c}`}}async reportPromptRunError(e,{largeLanguageModel:t,...r}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let i=r.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw Error(`Expected this.promptContentMap to be defined`);let a=this.promptContentMap[e];if(!a)throw Error(`Expected this.prompts[${e}] to be defined`);if(r.promptRunMessages.length===0)throw Error(`promptRunMessages is expected to have length > 0`);if(r.promptRunMessages[0].role!==m.ChatCompletionRole.System)throw Error(`promptRunMessages[0].role is expected to be = ${m.ChatCompletionRole.System}`);let o=await n.hn(this.graphQLClient,{productArea:m.PromptRunProductArea.PromptManager,...r,name:i,status:m.QueueStatus.Error,...typeof t==`string`?{largeLanguageModelId:t}:{largeLanguageModelName:t.name,largeLanguageModelClient:t.client},promptId:a.id,promptRunMessages:r.promptRunMessages.map((e,t)=>({...e,...t===0?{template:a.content}:{}}))});return{promptRunId:o,promptRunUrl:`https://app.transcend.io/prompts/runs/${o}`}}};function T(e){return e.replace(/(https?:\/\/[^\s]+)/g,`<link-omitted>`)}function E(e){return Object.entries(e).reduce((e,[t,n])=>n!=null&&n!==``&&!(Array.isArray(n)&&n.length===0)&&!(typeof n==`object`&&Object.keys(n).length===0)?Object.assign(e,{[t]:n}):e,{})}function D({baseBranch:e,rootDirectory:t,githubRepo:r,excludedGlob:i=[],fileBlockList:a=[]}){(0,v.execSync)(`git fetch origin ${e}`);let o=(0,v.execSync)(`git ls-remote ${r} "refs/heads/${e}" | cut -f 1`,{encoding:`utf-8`}).split(`
2
+ `)[0],s=(0,v.execSync)(`git rev-parse HEAD`,{encoding:`utf-8`}).split(`
3
+ `)[0];if(!o||!s)throw Error(`FAILED TO FIND COMMIT RANGE`);let c=n.js((0,v.execSync)(`git fetch && git diff --name-only "${e||o}...${s}" -- ${t}`,{encoding:`utf-8`}).split(`
4
+ `).filter(e=>e),a),l=i.length>0?_.default.sync(c,{ignore:i}):c,u={};return l.forEach(e=>{u[e]=(0,v.execSync)(`git show ${s}:${e}`,{encoding:`utf-8`})}),{changedFiles:c,fileDiffs:u,repoName:r.split(`/`).pop().split(`.`)[0],commit:s}}exports.ACTIONS=n.ra,exports.ADD_MESSAGES_TO_PROMPT_RUN=n.Ga,exports.ADD_SILO_DISCOVERY_RESULTS=n.Wo,exports.ADMIN_DASH=t.t,exports.ADMIN_DASH_DATAPOINTS=t.n,exports.ADMIN_DASH_INTEGRATIONS=t.r,exports.AGENTS=n.Ui,exports.AGENT_FILES=n.Bi,exports.AGENT_FUNCTIONS=n.Li,exports.API_KEYS=n.qo,exports.APPROVE_PRIVACY_REQUEST=n.Eo,exports.ASSESSMENTS=n.vo,exports.ASSESSMENT_SECTION_FIELDS=n.yo,exports.ASSESSMENT_TEMPLATES=n.ho,exports.ASSUME_ROLE=n.qi,exports.ATTRIBUTES=n.Pa,exports.ATTRIBUTE_KEYS_REQUESTS=n.Bo,exports.ATTRIBUTE_VALUES=n.Fa,exports.ActionInput=a.t,exports.ActionItemCollectionInput=a.n,exports.ActionItemInput=a.r,exports.AgentFileInput=a.i,exports.AgentFunctionInput=a.a,exports.AgentInput=a.o,exports.ApiKeyInput=a.s,exports.AssessmentAction=n.Nn,exports.AssessmentAnswerOptionInput=a.c,exports.AssessmentDisplayLogicInput=a.l,exports.AssessmentInput=a.u,exports.AssessmentNestedRule=n.Pn,exports.AssessmentNestedRuleInput=a.d,exports.AssessmentResourceInput=a.f,exports.AssessmentRetentionScheduleInput=a.p,exports.AssessmentRiskLogic=n.jn,exports.AssessmentRule=n.Fn,exports.AssessmentRuleInput=a.m,exports.AssessmentRuleWithOperands=n.In,exports.AssessmentRuleWithoutOperands=n.Ln,exports.AssessmentSectionInput=a.h,exports.AssessmentSectionQuestionInput=a.g,exports.AssessmentTemplateInput=a._,exports.AttestedExtraIdentifiers=n.rt,exports.AttributeInput=a.v,exports.AttributePreview=a.y,exports.AttributeValueInput=a.b,exports.BLANK=n.pi,exports.BULK_APPLY=n.mi,exports.BULK_REQUEST_FILES=n.qa,exports.BUSINESS_ENTITIES=n.aa,exports.BusinessEntityInput=a.x,exports.CANCEL_PRIVACY_REQUEST=n.Do,exports.CAN_APPLY_IN_BULK=n.hi,exports.CATALOGS=n.ss,exports.CHANGE_REQUEST_DATA_SILO_STATUS=n.to,exports.CODE_PACKAGES=n.Po,exports.CONSENT_MANAGER_ANALYTICS_DATA=n.ca,exports.CONSENT_PARTITIONS=n.la,exports.COOKIES=n.ua,exports.CREATE_ACTION_ITEMS=n.ea,exports.CREATE_ACTION_ITEM_COLLECTION=n.Ha,exports.CREATE_AGENT=n.Wi,exports.CREATE_AGENT_FILE=n.Vi,exports.CREATE_AGENT_FUNCTION=n.Ri,exports.CREATE_API_KEY=n.Jo,exports.CREATE_ATTRIBUTE=n.Ia,exports.CREATE_ATTRIBUTE_VALUES=n.La,exports.CREATE_BUSINESS_ENTITY=n.oa,exports.CREATE_CODE_PACKAGE=n.Fo,exports.CREATE_CONSENT_EXPERIENCE=n.da,exports.CREATE_CONSENT_MANAGER=n.fa,exports.CREATE_CONSENT_PARTITION=n.pa,exports.CREATE_DATA_FLOWS=n.ma,exports.CREATE_DATA_SILOS=n.fs,exports.CREATE_DATA_SUBJECT=n.$o,exports.CREATE_DATA_SUB_CATEGORY=n.ji,exports.CREATE_ENRICHER=n.cs,exports.CREATE_IDENTIFIER=n.rs,exports.CREATE_PREFERENCE_ACCESS_TOKENS=n.Ko,exports.CREATE_PROCESSING_ACTIVITY=n.Ti,exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY=n.Oi,exports.CREATE_PROMPT=n.ao,exports.CREATE_PROMPT_GROUP=n.oo,exports.CREATE_PROMPT_PARTIAL=n.so,exports.CREATE_REPOSITORY=n.Xo,exports.CREATE_SOFTWARE_DEVELOPMENT_KIT=n.Lo,exports.CREATE_TEAM=n.Qa,exports.CREATE_TEMPLATE=n.Ho,exports.CREATE_VENDOR=n.Pi,exports.CachedFileState=n.gi,exports.CachedRequestState=n._i,exports.CodePackageInput=a.S,exports.CodePackageSdk=a.C,exports.ColumnName=n.vi,exports.ConsentManageExperienceInput=a.w,exports.ConsentManagerInput=a.T,exports.ConsentManagerMetricBin=n.jr,exports.ConsentManagerServiceMetadata=a.E,exports.ConsentPreferenceTopic=a.D,exports.ConsentPreferenceTopicOptionValue=a.O,exports.ConsentPurpose=a.k,exports.CookieCsvInput=a.A,exports.CookieInput=a.j,exports.CronIdentifier=u.o,exports.CronIdentifierPush=u.i,exports.DATAPOINT_EXPORT=n.vs,exports.DATA_FLOWS=n.ha,exports.DATA_POINTS=n.ys,exports.DATA_POINT_COUNT=n.bs,exports.DATA_SILOS=n.ps,exports.DATA_SILOS_ENRICHED=n.ms,exports.DATA_SILO_EXPORT=n.hs,exports.DATA_SUBJECTS=n.es,exports.DATA_SUB_CATEGORIES=n.Mi,exports.DAY_MS=n.f,exports.DEBUG=t.i,exports.DEFAULT_TRANSCEND_API=t.a,exports.DEFAULT_TRANSCEND_CONSENT_API=t.o,exports.DEFAULT_TRANSCEND_PULL_RESOURCES=n.gn,exports.DELETE_API_KEY=n.Yo,exports.DELETE_ATTRIBUTE_VALUE=n.Ra,exports.DEPLOYED_PRIVACY_CENTER_URL=n.Xi,exports.DEPLOY_CONSENT_MANAGER=n.ga,exports.DETERMINE_LOGIN_METHOD=n.Ji,exports.DataCategoryGuessInput=a.M,exports.DataCategoryInput=a.N,exports.DataCategoryPreviewInput=a.P,exports.DataCategoryRecommendationInput=a.F,exports.DataFlowCsvInput=a.I,exports.DataFlowInput=a.L,exports.DataSiloInput=a.R,exports.DataSubjectInput=a.z,exports.DatapointInput=a.B,exports.ENABLED_PLUGINS=n.Go,exports.ENRICHERS=n.ls,exports.ENTRY_COUNT=n._s,exports.EXPERIENCES=n._a,exports.EnrichPrivacyRequest=p.n,exports.EnricherInput=a.V,exports.FETCH_CONSENT_MANAGER=n.va,exports.FETCH_CONSENT_MANAGER_ID=n.ya,exports.FETCH_CONSENT_MANAGER_THEME=n.ba,exports.FETCH_PRIVACY_CENTER_ID=n.Zi,exports.FIVE_MIN_MS=n.p,exports.FieldInput=a.H,exports.GLOBAL_ACTION_ITEMS=n.ta,exports.GLOBAL_ACTION_ITEM_COLLECTIONS=n.Ua,exports.HOUR_MS=n.m,exports.IDENTIFIERS=n.is,exports.IDENTIFIER_BLOCK_LIST=n.yi,exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS=n.bo,exports.INITIALIZER=n.us,exports.IP_ADDRESS_REGEX=c.n,exports.IS_REQUIRED=n.bi,exports.IdentifierInput=a.U,exports.ImportOnetrustAssessmentsInput=a.W,exports.IntlMessage=n.$,exports.IntlMessageInput=a.G,exports.LARGE_LANGUAGE_MODELS=n.Ki,exports.LOGIN=n.Yi,exports.MESSAGES=n.wo,exports.NEW_IDENTIFIER_TYPES=n.as,exports.NONE=n.xi,exports.NOTIFY_ADDITIONAL_TIME=n.Oo,exports.ORGANIZATION=n.Vo,exports.OneTrustFileFormat=r.t,exports.OneTrustPullResource=r.n,exports.OneTrustPullSource=r.r,exports.OpenAIEnabledRoute=a.K,exports.OpenAIEnabledRoutes=a.q,exports.OpenAIIntegration=a.J,exports.OpenAIRouteName=r.i,exports.POLICIES=n.jo,exports.PREFERENCE_TOPICS=n.go,exports.PRIVACY_CENTER=n.Qi,exports.PROCESSING_ACTIVITIES=n.Ei,exports.PROCESSING_PURPOSE_SUB_CATEGORIES=n.ki,exports.PROMPTS=n.co,exports.PROMPTS_WITH_VARIABLES=n.lo,exports.PROMPT_GROUPS=n.uo,exports.PROMPT_PARTIALS=n.do,exports.PROMPT_THREADS=n.No,exports.PURPOSES=n._o,exports.ParsedAttributeInput=n.si,exports.PartitionInput=a.Y,exports.PathfinderPolicy=a.X,exports.PathfinderPolicyName=r.a,exports.PathfinderPolicyNameC=a.Z,exports.PathfinderPromptRunMetadata=a.Q,exports.PolicyInput=a.$,exports.PrivacyCenterInput=a.et,exports.PrivacyRequest=n.ur,exports.PrivacyRequestInput=n.it,exports.PrivacyRequestResponse=n.Y,exports.ProcessingActivityInput=a.tt,exports.ProcessingPurposeInput=a.nt,exports.ProcessingPurposePreviewInput=a.rt,exports.PromptAVendorEmailSettings=a.it,exports.PromptGroupInput=a.at,exports.PromptInput=a.ot,exports.PromptPartialInput=a.st,exports.PurposeMap=l.t,exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT=n.no,exports.REMOVE_REQUEST_IDENTIFIERS=n.Xa,exports.REPORT_PROMPT_RUN=n.Ka,exports.REPOSITORIES=n.Zo,exports.REQUESTS=n.ko,exports.REQUEST_DATA_SILOS=n.ro,exports.REQUEST_ENRICHERS=n.xo,exports.REQUEST_FILES=n.Ja,exports.REQUEST_IDENTIFIERS=n.Za,exports.RETRYABLE_BATCH_STATUSES=t.s,exports.RETRY_REQUEST_DATA_SILO=n.io,exports.RETRY_REQUEST_ENRICHER=n.So,exports.RateCounter=n.C,exports.RegionInput=a.ct,exports.RepositoryInput=a.lt,exports.RequestFileMetadata=n.et,exports.RequestFileMetadataResponse=n.tt,exports.RequestIdentifiersResponse=n.pr,exports.RequestPurposeTrigger=n.dr,exports.RiskAssignmentInput=a.ut,exports.RiskLogicInput=a.dt,exports.SCOPES_BY_TITLE=t.c,exports.SCOPE_TITLES=t.l,exports.SET_RESOURCE_ATTRIBUTES=n.za,exports.SILO_DISCOVERY_RESULTS=n.Ci,exports.SKIP_REQUEST_ENRICHER=n.Co,exports.SOFTWARE_DEVELOPMENT_KITS=n.Ro,exports.SOMBRA_VERSION=n.wi,exports.SUB_DATA_POINTS=n.xs,exports.SUB_DATA_POINTS_COUNT=n.Ss,exports.SUB_DATA_POINTS_WITH_GUESSES=n.Cs,exports.SYNC_ATTRIBUTE_TYPES=n.Rr,exports.SiloDiscoveryResultInput=a.ft,exports.SoftwareDevelopmentKitInput=a.pt,exports.StoredApiKey=a.mt,exports.SuccessfulRequest=n.Si,exports.TEAMS=n.$a,exports.TEMPLATES=n.Uo,exports.TOGGLE_CONSENT_PRECEDENCE=n.xa,exports.TOGGLE_DATA_SUBJECT=n.ts,exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY=n.Sa,exports.TOGGLE_UNKNOWN_COOKIE_POLICY=n.Ca,exports.TOGGLE_UNKNOWN_REQUEST_POLICY=n.wa,exports.TR_PULL_RESOURCE_SCOPE_MAP=t.u,exports.TR_PUSH_RESOURCE_SCOPE_MAP=t.d,exports.TR_YML_RESOURCE_TO_FIELD_NAME=t.f,exports.TeamInput=a.ht,exports.TemplateInput=a.gt,exports.TranscendInput=a._t,exports.TranscendPromptManager=w,exports.TranscendPullResource=r.o,exports.UPDATE_ACTION=n.ia,exports.UPDATE_ACTION_ITEMS=n.na,exports.UPDATE_ACTION_ITEM_COLLECTION=n.Wa,exports.UPDATE_AGENTS=n.Gi,exports.UPDATE_AGENT_FILES=n.Hi,exports.UPDATE_AGENT_FUNCTIONS=n.zi,exports.UPDATE_ATTRIBUTE=n.Ba,exports.UPDATE_ATTRIBUTE_VALUES=n.Va,exports.UPDATE_BUSINESS_ENTITIES=n.sa,exports.UPDATE_CODE_PACKAGES=n.Io,exports.UPDATE_CONSENT_EXPERIENCE=n.Ta,exports.UPDATE_CONSENT_MANAGER_DOMAINS=n.Ea,exports.UPDATE_CONSENT_MANAGER_PARTITION=n.Da,exports.UPDATE_CONSENT_MANAGER_THEME=n.Oa,exports.UPDATE_CONSENT_MANAGER_TO_LATEST=n.ka,exports.UPDATE_CONSENT_MANAGER_VERSION=n.Aa,exports.UPDATE_DATA_FLOWS=n.ja,exports.UPDATE_DATA_SILOS=n.gs,exports.UPDATE_DATA_SUBJECT=n.ns,exports.UPDATE_DATA_SUB_CATEGORIES=n.Ni,exports.UPDATE_ENRICHER=n.ds,exports.UPDATE_IDENTIFIER=n.os,exports.UPDATE_INTL_MESSAGES=n.To,exports.UPDATE_LOAD_OPTIONS=n.Ma,exports.UPDATE_OR_CREATE_COOKIES=n.Na,exports.UPDATE_OR_CREATE_DATA_POINT=n.ws,exports.UPDATE_POLICIES=n.Mo,exports.UPDATE_PRIVACY_CENTER=n.$i,exports.UPDATE_PRIVACY_REQUEST=n.Ao,exports.UPDATE_PROCESSING_ACTIVITIES=n.Di,exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES=n.Ai,exports.UPDATE_PROMPTS=n.fo,exports.UPDATE_PROMPT_GROUPS=n.po,exports.UPDATE_PROMPT_PARTIALS=n.mo,exports.UPDATE_REPOSITORIES=n.Qo,exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS=n.zo,exports.UPDATE_TEAM=n.eo,exports.UPDATE_VENDORS=n.Fi,exports.USERS=n.Ya,exports.USP_STRING_REGEX=l.n,exports.VARIABLE_PARAMETERS_NAME=o.t,exports.VARIABLE_PARAMETERS_REGEXP=o.n,exports.VENDORS=n.Ii,exports.VendorInput=a.vt,exports.WebhookHeader=a.yt,exports.addDaysUtc=n.h,exports.addMessagesToPromptRun=n.ri,exports.addMs=n.g,exports.appendCsvRowsOrdered=n.a,exports.appendCsvSync=n.o,exports.approvePrivacyRequests=n.J,exports.assumeRole=n.Vn,exports.buildAIIntegrationType=i.t,exports.buildEnabledRouteType=i.n,exports.buildTranscendGraphQLClient=n.ti,exports.buildTranscendGraphQLClientGeneric=n.ni,exports.buildXdiSyncEndpoint=c.r,exports.bulkRestartRequests=n.B,exports.bulkRetryEnrichers=n.R,exports.cancelPrivacyRequests=n.G,exports.clampPageSize=n._,exports.collectParquetFilesOrExit=n.x,exports.consentManagersToBusinessEntities=c.t,exports.convertToDataSubjectAllowlist=n.$n,exports.convertToDataSubjectBlockList=n.er,exports.createActionItemCollection=n.ln,exports.createActionItems=n.on,exports.createAgent=n.Zt,exports.createAgentFile=n.rn,exports.createAgentFunction=n.en,exports.createApiKey=n.zn,exports.createBusinessEntity=n.qt,exports.createCodePackage=n.Rt,exports.createConsentToken=l.i,exports.createDataCategory=n.jt,exports.createDataFlows=n.Ot,exports.createPreferenceAccessTokens=n.Hr,exports.createProcessingPurpose=n._t,exports.createPrompt=n.mt,exports.createRegexForTag=x,exports.createRepository=n.Vt,exports.createSoftwareDevelopmentKit=n.Wt,exports.createSombraGotInstance=n.ei,exports.createTranscendConsentGotInstance=n.$r,exports.createVendor=n.dt,exports.defineTranscendPrompts=S,exports.deleteApiKey=n.Bn,exports.deployConsentManager=n.Zr,Object.defineProperty(exports,`description`,{enumerable:!0,get:function(){return t.m}}),exports.domainToHost=c.i,exports.downloadPrivacyRequestFiles=n.Z,exports.enrichPrivacyRequest=p.r,exports.ensureAllDataSubjectsExist=n.tr,exports.extractClientError=n.U,exports.extractErrorMessage=n.O,exports.fetchActiveSiloDiscoPlugin=n.Xr,exports.fetchAllActionItems=n.Yr,exports.fetchAllActions=n.Jr,exports.fetchAllAgentFiles=n.qr,exports.fetchAllAgentFunctions=n.Kr,exports.fetchAllAgents=n.Gr,exports.fetchAllApiKeys=n.ar,exports.fetchAllAssessmentTemplates=n.Ur,exports.fetchAllAssessments=n.Wr,exports.fetchAllAttributeValues=n.zr,exports.fetchAllAttributes=n.Br,exports.fetchAllBusinessEntities=n.Lr,exports.fetchAllCatalogs=n.rr,exports.fetchAllCookies=n.Ar,exports.fetchAllDataCategories=n.kr,exports.fetchAllDataFlows=n.Or,exports.fetchAllDataPoints=n.Tn,exports.fetchAllDataSilos=n.En,exports.fetchAllDataSubjects=n.nr,exports.fetchAllEnrichers=n.Cn,exports.fetchAllIdentifiers=n.n,exports.fetchAllMessages=n.Dr,exports.fetchAllPolicies=n.wr,exports.fetchAllPreferenceTopics=n.Sr,exports.fetchAllPrivacyCenters=n.xr,exports.fetchAllProcessingActivities=n.br,exports.fetchAllProcessingPurposes=n.yr,exports.fetchAllPromptGroups=n.Qn,exports.fetchAllPromptPartials=n.Zn,exports.fetchAllPromptThreads=n.Jn,exports.fetchAllPrompts=n.Yn,exports.fetchAllPurposes=n.vr,exports.fetchAllPurposesAndPreferences=n._r,exports.fetchAllRequestAttributeKeys=n.Vr,exports.fetchAllRequestEnrichers=n.gr,exports.fetchAllRequestIdentifierMetadata=n.hr,exports.fetchAllRequestIdentifiers=n.mr,exports.fetchAllRequests=n.fr,exports.fetchAllSiloDiscoveryResults=n.vn,exports.fetchAllSubDataPoints=n.Dn,exports.fetchAllTeams=n.lr,exports.fetchAllTemplates=n.xn,exports.fetchAllUsers=n.cr,exports.fetchAllVendors=n.sr,exports.fetchAndIndexCatalogs=n.ir,exports.fetchApiKeys=n.or,exports.fetchConsentManager=n.Mr,exports.fetchConsentManagerAnalyticsData=n.Nr,exports.fetchConsentManagerExperiences=n.Pr,exports.fetchConsentManagerId=n.Fr,exports.fetchConsentManagerTheme=n.Ir,exports.fetchEnrichedDataSilos=n.On,exports.fetchIdentifiersAndCreateMissing=n.r,exports.fetchPartitions=n.yn,exports.fetchPrivacyCenterId=n.Tr,exports.fetchPrivacyCenterUrl=n.Er,exports.fetchPromptsWithVariables=n.Xn,exports.fetchRequestDataSilo=n.Gn,exports.fetchRequestDataSiloActiveCount=n.Wn,exports.fetchRequestDataSilos=n.Kn,exports.fetchRequestDataSilosCount=n.qn,exports.fetchRequestFilesForRequest=n.Un,exports.filterNullishValuesFromObject=E,exports.filterRows=n.ii,exports.formatAttributeValues=n.Cr,exports.fuzzyMatchColumns=n.di,exports.fuzzySearch=n.fi,exports.generateCrossAccountApiKeys=d.i,exports.getErrorStatus=n.k,exports.getFileMetadataForPrivacyRequests=n.nt,exports.getGitFilesThatChanged=D,exports.getUniqueValuesForColumn=n.ai,exports.initCsvFile=n.s,exports.inquirerAutoComplete=n.j,exports.inquirerConfirmBoolean=n.M,exports.inquirerConfirmText=n.N,exports.limitRecords=n.w,exports.listDirectories=d.t,exports.listFiles=d.n,exports.loginUser=n.Hn,exports.makeGraphQLRequest=n.i,exports.mapColumnsToAttributes=n.W,exports.mapColumnsToIdentifiers=n.K,exports.mapCsvColumnsToApi=n.ct,exports.mapCsvRowsToRequestInputs=n.at,exports.mapEnumValues=n.ui,exports.mapRequestEnumValues=n.st,exports.markCronIdentifierCompleted=u.a,exports.markRequestDataSiloIdsCompleted=u.n,exports.markSilentPrivacyRequests=n.lt,exports.mergeTranscendInputs=s.t,exports.name=t.p,exports.normalizeIdentifierValue=n.ot,exports.notifyPrivacyRequestsAdditionalTime=n.q,exports.parquetToCsvOneFile=n.b,exports.parseAssessmentDisplayLogic=n.Rn,exports.parseAssessmentRiskLogic=n.Mn,exports.parseAttributesFromString=n.ci,exports.parseFilePath=n.c,exports.parseVariablesFromString=n.A,exports.pullAllDatapoints=f.n,exports.pullChunkedCustomSiloOutstandingIdentifiers=u.t,exports.pullConsentManagerMetrics=c.a,exports.pullCronPageOfIdentifiers=u.s,exports.pullManualEnrichmentIdentifiersToCsv=p.i,exports.pullPrivacyRequests=n.I,exports.pullTranscendConfiguration=n._n,exports.pullUnstructuredSubDataPointRecommendations=f.t,exports.pushCronIdentifiersFromCsv=u.r,exports.pushManualEnrichmentIdentifiersFromCsv=p.t,exports.readCsv=n.oi,exports.readSafe=n.S,exports.readTranscendYaml=o.r,exports.removeLinks=T,exports.removeUnverifiedRequestIdentifiers=n.P,exports.replaceVariablesInYaml=o.i,exports.reportPromptRun=n.hn,exports.restartPrivacyRequest=n.V,exports.retryRequestDataSilos=n.L,exports.retryRequestEnricher=n.mn,exports.retrySamePromise=n.T,exports.setResourceAttributes=n.pn,exports.skipPreflightJobs=n.z,exports.skipRequestDataSilos=n.F,exports.sleepPromise=n.D,exports.splitCsvToList=n.li,exports.splitInHalf=n.E,exports.startOfHour=n.v,exports.startOfUtcDay=n.y,exports.streamPrivacyRequestFiles=n.Q,exports.submitPrivacyRequest=n.X,exports.syncAction=n.fn,exports.syncActionItemCollections=n.un,exports.syncActionItems=n.sn,exports.syncAgentFiles=n.in,exports.syncAgentFunctions=n.tn,exports.syncAgents=n.Qt,exports.syncAttribute=n.Xt,exports.syncBusinessEntities=n.Jt,exports.syncCodePackages=n.zt,exports.syncConfigurationToTranscend=n.t,exports.syncConsentManager=n.It,exports.syncConsentManagerExperiences=n.Lt,exports.syncCookies=n.Pt,exports.syncDataCategories=n.Mt,exports.syncDataFlows=n.kt,exports.syncDataSiloDependencies=n.kn,exports.syncDataSilos=n.An,exports.syncDataSubject=n.Dt,exports.syncEnricher=n.wn,exports.syncIdentifier=n.Et,exports.syncIntlMessages=n.wt,exports.syncPartitions=n.bn,exports.syncPolicies=n.St,exports.syncPrivacyCenter=n.xt,exports.syncProcessingActivities=n.bt,exports.syncProcessingPurposes=n.vt,exports.syncPrompts=n.ht,exports.syncRepositories=n.Ht,exports.syncSoftwareDevelopmentKits=n.Gt,exports.syncTemplate=n.Sn,exports.syncVendors=n.ft,exports.updateActionItem=n.cn,exports.updateActionItemCollection=n.dn,exports.updateAgentFiles=n.an,exports.updateAgentFunctions=n.nn,exports.updateAgents=n.$t,exports.updateBusinessEntities=n.Yt,exports.updateCodePackages=n.Bt,exports.updateConsentManagerToLatest=n.Qr,exports.updateConsentManagerVersionToLatest=c.c,exports.updateDataCategories=n.Nt,exports.updateDataFlows=n.At,exports.updateIntlMessages=n.Tt,exports.updateOrCreateCookies=n.Ft,exports.updatePolicies=n.Ct,exports.updateProcessingPurposes=n.yt,exports.updatePrompts=n.gt,exports.updateRepositories=n.Ut,exports.updateSoftwareDevelopmentKits=n.Kt,exports.updateVendors=n.pt,exports.uploadConsents=l.r,exports.uploadCookiesFromCsv=c.o,exports.uploadDataFlowsFromCsv=c.s,exports.uploadPrivacyRequestsFromCsv=n.H,exports.uploadSiloDiscoveryResults=n.ut,exports.validateTranscendAuth=d.r,Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return t.h}}),exports.writeCsv=n.l,exports.writeCsvSync=n.u,exports.writeLargeCsv=n.d,exports.writeTranscendYaml=o.a;
5
5
  //# sourceMappingURL=index.cjs.map