@transcend-io/cli 10.28.0 → 10.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/README.md +81 -15
  2. package/dist/{app-DCY8E776.mjs → app-B9yoXd7q.mjs} +21 -21
  3. package/dist/app-B9yoXd7q.mjs.map +1 -0
  4. package/dist/{approvePrivacyRequests-80SV_94y.mjs → approvePrivacyRequests-DDT8Zjhc.mjs} +2 -2
  5. package/dist/{approvePrivacyRequests-80SV_94y.mjs.map → approvePrivacyRequests-DDT8Zjhc.mjs.map} +1 -1
  6. package/dist/bin/bash-complete.mjs +1 -1
  7. package/dist/bin/cli.mjs +1 -1
  8. package/dist/bin/deprecated-command.mjs +1 -1
  9. package/dist/{buildExamples-2YDkSvtA.mjs → buildExamples-DLDlrgWE.mjs} +2 -2
  10. package/dist/{buildExamples-2YDkSvtA.mjs.map → buildExamples-DLDlrgWE.mjs.map} +1 -1
  11. package/dist/{buildXdiSyncEndpoint-B3zUrI16.mjs → buildXdiSyncEndpoint-uSDQEXT2.mjs} +2 -2
  12. package/dist/{buildXdiSyncEndpoint-B3zUrI16.mjs.map → buildXdiSyncEndpoint-uSDQEXT2.mjs.map} +1 -1
  13. package/dist/{bulkRestartRequests-BLb8OJmf.mjs → bulkRestartRequests-C4wyNZ65.mjs} +2 -2
  14. package/dist/{bulkRestartRequests-BLb8OJmf.mjs.map → bulkRestartRequests-C4wyNZ65.mjs.map} +1 -1
  15. package/dist/{bulkRetryEnrichers-BA9cboSe.mjs → bulkRetryEnrichers-VbIb-WIs.mjs} +2 -2
  16. package/dist/{bulkRetryEnrichers-BA9cboSe.mjs.map → bulkRetryEnrichers-VbIb-WIs.mjs.map} +1 -1
  17. package/dist/{cancelPrivacyRequests-BEyOBJ2r.mjs → cancelPrivacyRequests-Ds6HKabX.mjs} +2 -2
  18. package/dist/{cancelPrivacyRequests-BEyOBJ2r.mjs.map → cancelPrivacyRequests-Ds6HKabX.mjs.map} +1 -1
  19. package/dist/codecs-CTxFjCg4.mjs +2 -0
  20. package/dist/codecs-CTxFjCg4.mjs.map +1 -0
  21. package/dist/{collectCsvFilesOrExit-BqnmK63h.mjs → collectCsvFilesOrExit-B1VOVGWN.mjs} +1 -1
  22. package/dist/{collectCsvFilesOrExit-BqnmK63h.mjs.map → collectCsvFilesOrExit-B1VOVGWN.mjs.map} +1 -1
  23. package/dist/{collectParquetFilesOrExit-BiksFI-Q.mjs → collectParquetFilesOrExit-DVlv5ctt.mjs} +1 -1
  24. package/dist/{collectParquetFilesOrExit-BiksFI-Q.mjs.map → collectParquetFilesOrExit-DVlv5ctt.mjs.map} +1 -1
  25. package/dist/{command-eIenZMOx.mjs → command-BVK929yJ.mjs} +2 -2
  26. package/dist/{command-eIenZMOx.mjs.map → command-BVK929yJ.mjs.map} +1 -1
  27. package/dist/commands/admin/chunk-csv/worker.mjs +1 -1
  28. package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
  29. package/dist/{consentManagersToBusinessEntities-O4KBox9u.mjs → consentManagersToBusinessEntities-CBJ81aGO.mjs} +1 -1
  30. package/dist/{consentManagersToBusinessEntities-O4KBox9u.mjs.map → consentManagersToBusinessEntities-CBJ81aGO.mjs.map} +1 -1
  31. package/dist/{constants-BpQ5awGp.mjs → constants-DXzsg2CQ.mjs} +2 -2
  32. package/dist/{constants-BpQ5awGp.mjs.map → constants-DXzsg2CQ.mjs.map} +1 -1
  33. package/dist/{constants-C1seVfCu.mjs → constants-D_HVDaOy.mjs} +1 -1
  34. package/dist/{constants-C1seVfCu.mjs.map → constants-D_HVDaOy.mjs.map} +1 -1
  35. package/dist/{constants-BG53Mbi9.mjs → constants-X60pMfSm.mjs} +2 -2
  36. package/dist/{constants-BG53Mbi9.mjs.map → constants-X60pMfSm.mjs.map} +1 -1
  37. package/dist/{context-CZYrQfAn.mjs → context-B33NT3ki.mjs} +1 -1
  38. package/dist/{context-CZYrQfAn.mjs.map → context-B33NT3ki.mjs.map} +1 -1
  39. package/dist/{createPoolingCommandUi-C39R_zo3.mjs → createPoolingCommandUi-Dr6Cmq63.mjs} +2 -2
  40. package/dist/{createPoolingCommandUi-C39R_zo3.mjs.map → createPoolingCommandUi-Dr6Cmq63.mjs.map} +1 -1
  41. package/dist/{dataFlowsToDataSilos-CLSHb1GA.mjs → dataFlowsToDataSilos-BF6fzWcm.mjs} +1 -1
  42. package/dist/{dataFlowsToDataSilos-CLSHb1GA.mjs.map → dataFlowsToDataSilos-BF6fzWcm.mjs.map} +1 -1
  43. package/dist/deno-runtime-DV52X8-P.mjs +2 -0
  44. package/dist/deno-runtime-DV52X8-P.mjs.map +1 -0
  45. package/dist/{done-input-validation-Cjk7a3jX.mjs → done-input-validation-BUz-aVC5.mjs} +1 -1
  46. package/dist/{done-input-validation-Cjk7a3jX.mjs.map → done-input-validation-BUz-aVC5.mjs.map} +1 -1
  47. package/dist/{downloadPrivacyRequestFiles-CLFgQItk.mjs → downloadPrivacyRequestFiles-BZjAtiKF.mjs} +2 -2
  48. package/dist/{downloadPrivacyRequestFiles-CLFgQItk.mjs.map → downloadPrivacyRequestFiles-BZjAtiKF.mjs.map} +1 -1
  49. package/dist/{extractClientError-C_6ly7Gw.mjs → extractClientError-HZ2U7yqV.mjs} +1 -1
  50. package/dist/{extractClientError-C_6ly7Gw.mjs.map → extractClientError-HZ2U7yqV.mjs.map} +1 -1
  51. package/dist/{fetchAllRequests-CEDKdq0c.mjs → fetchAllRequests-2TZr-LfT.mjs} +2 -2
  52. package/dist/{fetchAllRequests-CEDKdq0c.mjs.map → fetchAllRequests-2TZr-LfT.mjs.map} +1 -1
  53. package/dist/{formatPolicyBundleVersionSummary-CrFtcPwS.mjs → formatPolicyBundleVersionSummary-CJmMCLtJ.mjs} +1 -1
  54. package/dist/{formatPolicyBundleVersionSummary-CrFtcPwS.mjs.map → formatPolicyBundleVersionSummary-CJmMCLtJ.mjs.map} +1 -1
  55. package/dist/{fuzzyMatchColumns-OTsFJ21f.mjs → fuzzyMatchColumns-CQCzpjWC.mjs} +2 -2
  56. package/dist/{fuzzyMatchColumns-OTsFJ21f.mjs.map → fuzzyMatchColumns-CQCzpjWC.mjs.map} +1 -1
  57. package/dist/{generateCrossAccountApiKeys-D6O_Qm3Y.mjs → generateCrossAccountApiKeys-POFAc7bo.mjs} +2 -2
  58. package/dist/{generateCrossAccountApiKeys-D6O_Qm3Y.mjs.map → generateCrossAccountApiKeys-POFAc7bo.mjs.map} +1 -1
  59. package/dist/impl--JGnR3wp.mjs +3 -0
  60. package/dist/{impl-CzxvoiGW.mjs.map → impl--JGnR3wp.mjs.map} +1 -1
  61. package/dist/{impl-Drql0g72.mjs → impl-7UqkSO3x2.mjs} +2 -2
  62. package/dist/impl-7UqkSO3x2.mjs.map +1 -0
  63. package/dist/impl-B4BgGuF_.mjs +3 -0
  64. package/dist/impl-B4BgGuF_.mjs.map +1 -0
  65. package/dist/{impl-C50tdWlL2.mjs → impl-BDgc5PEC2.mjs} +2 -2
  66. package/dist/{impl-C50tdWlL2.mjs.map → impl-BDgc5PEC2.mjs.map} +1 -1
  67. package/dist/{impl-CXUJ1eRC.mjs → impl-BPoEH3Nf2.mjs} +2 -2
  68. package/dist/impl-BPoEH3Nf2.mjs.map +1 -0
  69. package/dist/impl-BPzANN8n.mjs +2 -0
  70. package/dist/{impl-C8BmxFQ2.mjs.map → impl-BPzANN8n.mjs.map} +1 -1
  71. package/dist/{impl-M3Eu4QjS.mjs → impl-BScGBm2o.mjs} +2 -2
  72. package/dist/{impl-M3Eu4QjS.mjs.map → impl-BScGBm2o.mjs.map} +1 -1
  73. package/dist/{impl-CE56-wQh.mjs → impl-BT0N2HwU.mjs} +2 -2
  74. package/dist/{impl-CE56-wQh.mjs.map → impl-BT0N2HwU.mjs.map} +1 -1
  75. package/dist/{impl-CDtUusmg.mjs → impl-BTff-yNX.mjs} +2 -2
  76. package/dist/{impl-CDtUusmg.mjs.map → impl-BTff-yNX.mjs.map} +1 -1
  77. package/dist/{impl-DXNcD7CZ.mjs → impl-BeHsB-Zk.mjs} +2 -2
  78. package/dist/{impl-DXNcD7CZ.mjs.map → impl-BeHsB-Zk.mjs.map} +1 -1
  79. package/dist/{impl-CQGeH47F.mjs → impl-Bg7zZ_F_.mjs} +2 -2
  80. package/dist/{impl-CQGeH47F.mjs.map → impl-Bg7zZ_F_.mjs.map} +1 -1
  81. package/dist/impl-Bguphgoc.mjs +2 -0
  82. package/dist/{impl-BsC1KVxS.mjs.map → impl-Bguphgoc.mjs.map} +1 -1
  83. package/dist/{impl-CWh9H7mL.mjs → impl-BkqQI3vZ.mjs} +2 -2
  84. package/dist/{impl-CWh9H7mL.mjs.map → impl-BkqQI3vZ.mjs.map} +1 -1
  85. package/dist/{impl-zZFaSmxd2.mjs → impl-BnvfuqEA2.mjs} +2 -2
  86. package/dist/{impl-zZFaSmxd2.mjs.map → impl-BnvfuqEA2.mjs.map} +1 -1
  87. package/dist/impl-C1xIUoJS.mjs +2 -0
  88. package/dist/impl-C1xIUoJS.mjs.map +1 -0
  89. package/dist/impl-C6HtWd1t.mjs +2 -0
  90. package/dist/{impl-BcJ019T2.mjs.map → impl-C6HtWd1t.mjs.map} +1 -1
  91. package/dist/impl-C8sWVJUG.mjs +2 -0
  92. package/dist/impl-C8sWVJUG.mjs.map +1 -0
  93. package/dist/{impl-KKrDTraf.mjs → impl-CE_nprLV.mjs} +2 -2
  94. package/dist/{impl-KKrDTraf.mjs.map → impl-CE_nprLV.mjs.map} +1 -1
  95. package/dist/{impl-CEmXPEq22.mjs → impl-CF0ts8Fz2.mjs} +2 -2
  96. package/dist/{impl-CEmXPEq22.mjs.map → impl-CF0ts8Fz2.mjs.map} +1 -1
  97. package/dist/impl-CMK8Qm_I2.mjs +303 -0
  98. package/dist/impl-CMK8Qm_I2.mjs.map +1 -0
  99. package/dist/{impl-BvNZqLrT.mjs → impl-CO4ZqlLV.mjs} +2 -2
  100. package/dist/{impl-BvNZqLrT.mjs.map → impl-CO4ZqlLV.mjs.map} +1 -1
  101. package/dist/{impl-DJLlcqSg.mjs → impl-COujMWgp.mjs} +2 -2
  102. package/dist/{impl-DJLlcqSg.mjs.map → impl-COujMWgp.mjs.map} +1 -1
  103. package/dist/{impl-Bs-drNBf.mjs → impl-CPSEzCc9.mjs} +2 -2
  104. package/dist/{impl-Bs-drNBf.mjs.map → impl-CPSEzCc9.mjs.map} +1 -1
  105. package/dist/{impl-Dib6Fff12.mjs → impl-CQtMFz1O.mjs} +2 -2
  106. package/dist/impl-CQtMFz1O.mjs.map +1 -0
  107. package/dist/{impl-B--lr5RJ2.mjs → impl-CSRal4Rj2.mjs} +2 -2
  108. package/dist/{impl-B--lr5RJ2.mjs.map → impl-CSRal4Rj2.mjs.map} +1 -1
  109. package/dist/{impl-DYf10-BD2.mjs → impl-CSmFd6iO2.mjs} +2 -2
  110. package/dist/{impl-DYf10-BD2.mjs.map → impl-CSmFd6iO2.mjs.map} +1 -1
  111. package/dist/{impl-B3_hrFPX.mjs → impl-CUOVJsRg.mjs} +2 -2
  112. package/dist/{impl-B3_hrFPX.mjs.map → impl-CUOVJsRg.mjs.map} +1 -1
  113. package/dist/{impl-BySmbxEt.mjs → impl-CUiYbk6G.mjs} +2 -2
  114. package/dist/{impl-BySmbxEt.mjs.map → impl-CUiYbk6G.mjs.map} +1 -1
  115. package/dist/{impl-BFJtKA2o2.mjs → impl-CfMrFWb_.mjs} +2 -2
  116. package/dist/impl-CfMrFWb_.mjs.map +1 -0
  117. package/dist/{impl-Cx3T0Iei.mjs → impl-CfvxD3RI.mjs} +2 -2
  118. package/dist/{impl-Cx3T0Iei.mjs.map → impl-CfvxD3RI.mjs.map} +1 -1
  119. package/dist/{impl-DHfYO9T52.mjs → impl-Cli2XRp02.mjs} +2 -2
  120. package/dist/{impl-DHfYO9T52.mjs.map → impl-Cli2XRp02.mjs.map} +1 -1
  121. package/dist/{impl-C5dzaDga2.mjs → impl-DInF5q00.mjs} +2 -2
  122. package/dist/impl-DInF5q00.mjs.map +1 -0
  123. package/dist/{impl-BWVe4VGF2.mjs → impl-DKNJFnFv2.mjs} +2 -2
  124. package/dist/{impl-BWVe4VGF2.mjs.map → impl-DKNJFnFv2.mjs.map} +1 -1
  125. package/dist/{impl-DOoR93T6.mjs → impl-DKepRc812.mjs} +2 -2
  126. package/dist/impl-DKepRc812.mjs.map +1 -0
  127. package/dist/{impl-CqF9xIIy.mjs → impl-DOuVyX0O.mjs} +2 -2
  128. package/dist/{impl-CqF9xIIy.mjs.map → impl-DOuVyX0O.mjs.map} +1 -1
  129. package/dist/{impl-DzNk41xd.mjs → impl-DPtx5iZO.mjs} +2 -2
  130. package/dist/{impl-DzNk41xd.mjs.map → impl-DPtx5iZO.mjs.map} +1 -1
  131. package/dist/{impl-BqrSLoig.mjs → impl-DRW2qfyk.mjs} +2 -2
  132. package/dist/{impl-BqrSLoig.mjs.map → impl-DRW2qfyk.mjs.map} +1 -1
  133. package/dist/{impl-syp5hclX.mjs → impl-DRpK-QLC.mjs} +2 -2
  134. package/dist/{impl-syp5hclX.mjs.map → impl-DRpK-QLC.mjs.map} +1 -1
  135. package/dist/{impl-DYwojWvN.mjs → impl-DVeGQCrr.mjs} +2 -2
  136. package/dist/{impl-DYwojWvN.mjs.map → impl-DVeGQCrr.mjs.map} +1 -1
  137. package/dist/{impl-DF8RGVlT.mjs → impl-DXRDWiB1.mjs} +2 -2
  138. package/dist/{impl-DF8RGVlT.mjs.map → impl-DXRDWiB1.mjs.map} +1 -1
  139. package/dist/{impl-CiYKuCHV.mjs → impl-DXowiNOz.mjs} +2 -2
  140. package/dist/{impl-CiYKuCHV.mjs.map → impl-DXowiNOz.mjs.map} +1 -1
  141. package/dist/{impl-DpuhHpuk.mjs → impl-DaH1_ZzK.mjs} +2 -2
  142. package/dist/{impl-DpuhHpuk.mjs.map → impl-DaH1_ZzK.mjs.map} +1 -1
  143. package/dist/{impl-DIPvFKiP.mjs → impl-DdIa0zla.mjs} +2 -2
  144. package/dist/{impl-DIPvFKiP.mjs.map → impl-DdIa0zla.mjs.map} +1 -1
  145. package/dist/{impl-Bq6g_xYv.mjs → impl-DkHzw1nR.mjs} +2 -2
  146. package/dist/{impl-Bq6g_xYv.mjs.map → impl-DkHzw1nR.mjs.map} +1 -1
  147. package/dist/{impl-DbZ1cYoR.mjs → impl-DqhZR11m.mjs} +2 -2
  148. package/dist/{impl-DbZ1cYoR.mjs.map → impl-DqhZR11m.mjs.map} +1 -1
  149. package/dist/{impl-VPBEqV0w2.mjs → impl-Dqqb0lVN.mjs} +2 -2
  150. package/dist/impl-Dqqb0lVN.mjs.map +1 -0
  151. package/dist/{impl-6m7GXUAe.mjs → impl-DryC3OJu.mjs} +2 -2
  152. package/dist/{impl-6m7GXUAe.mjs.map → impl-DryC3OJu.mjs.map} +1 -1
  153. package/dist/{impl-amV0wRWk.mjs → impl-Dv8ecMWN.mjs} +2 -2
  154. package/dist/{impl-amV0wRWk.mjs.map → impl-Dv8ecMWN.mjs.map} +1 -1
  155. package/dist/{impl-CfPXYgT42.mjs → impl-DzUTmaID2.mjs} +2 -2
  156. package/dist/{impl-CfPXYgT42.mjs.map → impl-DzUTmaID2.mjs.map} +1 -1
  157. package/dist/{impl-Dm-Fkr392.mjs → impl-IFoIxW9s.mjs} +2 -2
  158. package/dist/impl-IFoIxW9s.mjs.map +1 -0
  159. package/dist/{impl-BJlKQJdS2.mjs → impl-WxoE0bN_.mjs} +2 -2
  160. package/dist/impl-WxoE0bN_.mjs.map +1 -0
  161. package/dist/impl-Z8oWVENM.mjs +2 -0
  162. package/dist/impl-Z8oWVENM.mjs.map +1 -0
  163. package/dist/{impl-CHmjV-Pa.mjs → impl-Z_ZuLfFK.mjs} +2 -2
  164. package/dist/{impl-CHmjV-Pa.mjs.map → impl-Z_ZuLfFK.mjs.map} +1 -1
  165. package/dist/{impl-BwRcpAno.mjs → impl-_erU3Uzt2.mjs} +2 -2
  166. package/dist/impl-_erU3Uzt2.mjs.map +1 -0
  167. package/dist/{impl-m3QXCc6n.mjs → impl-a_Y8bnSn.mjs} +4 -4
  168. package/dist/impl-a_Y8bnSn.mjs.map +1 -0
  169. package/dist/{impl-BewF8tB6.mjs → impl-dXDmiiG6.mjs} +2 -2
  170. package/dist/{impl-BewF8tB6.mjs.map → impl-dXDmiiG6.mjs.map} +1 -1
  171. package/dist/{impl-BYGNx-8W2.mjs → impl-lcLJ4Wp-.mjs} +2 -2
  172. package/dist/impl-lcLJ4Wp-.mjs.map +1 -0
  173. package/dist/{impl-CTIWliTx.mjs → impl-nvYE0p_K.mjs} +2 -2
  174. package/dist/{impl-CTIWliTx.mjs.map → impl-nvYE0p_K.mjs.map} +1 -1
  175. package/dist/{impl-Dk6TZKrp2.mjs → impl-xKt-NwTT.mjs} +2 -2
  176. package/dist/impl-xKt-NwTT.mjs.map +1 -0
  177. package/dist/{impl-GHukPBnk.mjs → impl-ymZeayvp.mjs} +2 -2
  178. package/dist/{impl-GHukPBnk.mjs.map → impl-ymZeayvp.mjs.map} +1 -1
  179. package/dist/index.d.mts +12797 -1840
  180. package/dist/index.d.mts.map +1 -1
  181. package/dist/index.mjs +3 -3
  182. package/dist/index.mjs.map +1 -1
  183. package/dist/{initializeCliRuntime-802-P8MC.mjs → initializeCliRuntime-6wI_VIHV.mjs} +1 -1
  184. package/dist/{initializeCliRuntime-802-P8MC.mjs.map → initializeCliRuntime-6wI_VIHV.mjs.map} +1 -1
  185. package/dist/{inquirer-DkFTQU00.mjs → inquirer-BeaBetMO.mjs} +2 -2
  186. package/dist/{inquirer-DkFTQU00.mjs.map → inquirer-BeaBetMO.mjs.map} +1 -1
  187. package/dist/jsonc-D9dDWb1J.mjs +6 -0
  188. package/dist/jsonc-D9dDWb1J.mjs.map +1 -0
  189. package/dist/{listFiles-CWHAdKY-.mjs → listFiles-BdFUbX5x.mjs} +1 -1
  190. package/dist/{listFiles-CWHAdKY-.mjs.map → listFiles-BdFUbX5x.mjs.map} +1 -1
  191. package/dist/logger-zplFSeXU.mjs +2 -0
  192. package/dist/logger-zplFSeXU.mjs.map +1 -0
  193. package/dist/manifest-BNIpO_zW.mjs +2 -0
  194. package/dist/manifest-BNIpO_zW.mjs.map +1 -0
  195. package/dist/{mapConsentCsvRowsToInputs-MMPZwzrV.mjs → mapConsentCsvRowsToInputs-Dqb6WL4r.mjs} +1 -1
  196. package/dist/{mapConsentCsvRowsToInputs-MMPZwzrV.mjs.map → mapConsentCsvRowsToInputs-Dqb6WL4r.mjs.map} +1 -1
  197. package/dist/{markRequestDataSiloIdsCompleted-PKCcn5wQ.mjs → markRequestDataSiloIdsCompleted-2DHClQ32.mjs} +2 -2
  198. package/dist/{markRequestDataSiloIdsCompleted-PKCcn5wQ.mjs.map → markRequestDataSiloIdsCompleted-2DHClQ32.mjs.map} +1 -1
  199. package/dist/{markSilentPrivacyRequests-7l9I99pe.mjs → markSilentPrivacyRequests-BUYzKbhW.mjs} +2 -2
  200. package/dist/{markSilentPrivacyRequests-7l9I99pe.mjs.map → markSilentPrivacyRequests-BUYzKbhW.mjs.map} +1 -1
  201. package/dist/mergeTranscendInputs-DFQcbh8b.mjs +3 -0
  202. package/dist/mergeTranscendInputs-DFQcbh8b.mjs.map +1 -0
  203. package/dist/missing-manifest-DgcukXfg.mjs +2 -0
  204. package/dist/missing-manifest-DgcukXfg.mjs.map +1 -0
  205. package/dist/{module-graph-DBC7ZvyA.mjs → module-graph-Cb0g74Ft.mjs} +1 -1
  206. package/dist/{module-graph-DBC7ZvyA.mjs.map → module-graph-Cb0g74Ft.mjs.map} +1 -1
  207. package/dist/{notifyPrivacyRequestsAdditionalTime-BPIYuCov.mjs → notifyPrivacyRequestsAdditionalTime-G8IZ0Ooy.mjs} +2 -2
  208. package/dist/{notifyPrivacyRequestsAdditionalTime-BPIYuCov.mjs.map → notifyPrivacyRequestsAdditionalTime-G8IZ0Ooy.mjs.map} +1 -1
  209. package/dist/{parquetToCsvOneFile-CSVdrLvq.mjs → parquetToCsvOneFile-ChmPC6dL.mjs} +2 -2
  210. package/dist/{parquetToCsvOneFile-CSVdrLvq.mjs.map → parquetToCsvOneFile-ChmPC6dL.mjs.map} +1 -1
  211. package/dist/{parseAttributesFromString-C5-KGkPH.mjs → parseAttributesFromString-CO16oAlx.mjs} +2 -2
  212. package/dist/{parseAttributesFromString-C5-KGkPH.mjs.map → parseAttributesFromString-CO16oAlx.mjs.map} +1 -1
  213. package/dist/{parseVariablesFromString-Cr3x2uq3.mjs → parseVariablesFromString-BOSfQ4QF.mjs} +1 -1
  214. package/dist/{parseVariablesFromString-Cr3x2uq3.mjs.map → parseVariablesFromString-BOSfQ4QF.mjs.map} +1 -1
  215. package/dist/path-safety-D5Qwl40b.mjs +2 -0
  216. package/dist/path-safety-D5Qwl40b.mjs.map +1 -0
  217. package/dist/policy-bundle-manifest-D6dkbjNi.mjs +7 -0
  218. package/dist/policy-bundle-manifest-D6dkbjNi.mjs.map +1 -0
  219. package/dist/policy-runtime-BMKa-Upy.mjs +2 -0
  220. package/dist/policy-runtime-BMKa-Upy.mjs.map +1 -0
  221. package/dist/{printResult-esxW3HhT.mjs → printResult-CHe3nRN4.mjs} +5 -5
  222. package/dist/printResult-CHe3nRN4.mjs.map +1 -0
  223. package/dist/project-plan-apply-Dvndx455.mjs +3 -0
  224. package/dist/project-plan-apply-Dvndx455.mjs.map +1 -0
  225. package/dist/prompts-ClBXdELk.mjs +4 -0
  226. package/dist/prompts-ClBXdELk.mjs.map +1 -0
  227. package/dist/{pullAllDatapoints-H92qjLSx.mjs → pullAllDatapoints-uk5ggk6O.mjs} +2 -2
  228. package/dist/{pullAllDatapoints-H92qjLSx.mjs.map → pullAllDatapoints-uk5ggk6O.mjs.map} +1 -1
  229. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-BrDmPbvc.mjs → pullChunkedCustomSiloOutstandingIdentifiers-BxolFAfF.mjs} +2 -2
  230. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-BrDmPbvc.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-BxolFAfF.mjs.map} +1 -1
  231. package/dist/{pullConsentManagerMetrics-Cvex-gpd.mjs → pullConsentManagerMetrics-Dv5n1ZGp.mjs} +2 -2
  232. package/dist/{pullConsentManagerMetrics-Cvex-gpd.mjs.map → pullConsentManagerMetrics-Dv5n1ZGp.mjs.map} +1 -1
  233. package/dist/{pullManualEnrichmentIdentifiersToCsv-qjdNA75O.mjs → pullManualEnrichmentIdentifiersToCsv-DcLZeqF2.mjs} +2 -2
  234. package/dist/{pullManualEnrichmentIdentifiersToCsv-qjdNA75O.mjs.map → pullManualEnrichmentIdentifiersToCsv-DcLZeqF2.mjs.map} +1 -1
  235. package/dist/{pullTranscendConfiguration-CD7Frn8z.mjs → pullTranscendConfiguration-B63M3ild.mjs} +3 -3
  236. package/dist/{pullTranscendConfiguration-CD7Frn8z.mjs.map → pullTranscendConfiguration-B63M3ild.mjs.map} +1 -1
  237. package/dist/{pullUnstructuredSubDataPointRecommendations-Dmh_-r95.mjs → pullUnstructuredSubDataPointRecommendations-YTBzfkRZ.mjs} +2 -2
  238. package/dist/{pullUnstructuredSubDataPointRecommendations-Dmh_-r95.mjs.map → pullUnstructuredSubDataPointRecommendations-YTBzfkRZ.mjs.map} +1 -1
  239. package/dist/{pushCronIdentifiersFromCsv-DjeY7TtK.mjs → pushCronIdentifiersFromCsv-CVTCk6s3.mjs} +2 -2
  240. package/dist/{pushCronIdentifiersFromCsv-DjeY7TtK.mjs.map → pushCronIdentifiersFromCsv-CVTCk6s3.mjs.map} +1 -1
  241. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BDtMo13j.mjs → pushManualEnrichmentIdentifiersFromCsv-BIkBbKfs.mjs} +2 -2
  242. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BDtMo13j.mjs.map → pushManualEnrichmentIdentifiersFromCsv-BIkBbKfs.mjs.map} +1 -1
  243. package/dist/{readCsv-Cr_1t8F5.mjs → readCsv-DLg8pwjd.mjs} +1 -1
  244. package/dist/{readCsv-Cr_1t8F5.mjs.map → readCsv-DLg8pwjd.mjs.map} +1 -1
  245. package/dist/readTranscendYaml-BNn6-Ofi.mjs +4 -0
  246. package/dist/readTranscendYaml-BNn6-Ofi.mjs.map +1 -0
  247. package/dist/{removeUnverifiedRequestIdentifiers-B9uPApVR.mjs → removeUnverifiedRequestIdentifiers-CzEvT_WR.mjs} +2 -2
  248. package/dist/{removeUnverifiedRequestIdentifiers-B9uPApVR.mjs.map → removeUnverifiedRequestIdentifiers-CzEvT_WR.mjs.map} +1 -1
  249. package/dist/{renderTable-DKTZbMjY.mjs → renderTable-D68QasPc.mjs} +1 -1
  250. package/dist/{renderTable-DKTZbMjY.mjs.map → renderTable-D68QasPc.mjs.map} +1 -1
  251. package/dist/{request-B1yRTdG-.mjs → request-BiPv6jmP.mjs} +1 -1
  252. package/dist/{request-B1yRTdG-.mjs.map → request-BiPv6jmP.mjs.map} +1 -1
  253. package/dist/{resolveBundleIdByName-DuxWYrDF.mjs → resolveBundleIdByName-qXZBrUz_.mjs} +2 -2
  254. package/dist/{resolveBundleIdByName-DuxWYrDF.mjs.map → resolveBundleIdByName-qXZBrUz_.mjs.map} +1 -1
  255. package/dist/{resolvePolicyBundleVersion-DhXZKwb4.mjs → resolvePolicyBundleVersion-BG7XqBBP.mjs} +2 -2
  256. package/dist/{resolvePolicyBundleVersion-DhXZKwb4.mjs.map → resolvePolicyBundleVersion-BG7XqBBP.mjs.map} +1 -1
  257. package/dist/{retryRequestDataSilos-D9dBtbdl.mjs → retryRequestDataSilos-C2csdZmC.mjs} +2 -2
  258. package/dist/{retryRequestDataSilos-D9dBtbdl.mjs.map → retryRequestDataSilos-C2csdZmC.mjs.map} +1 -1
  259. package/dist/{run-captured-process-CpZBh0lG.mjs → run-captured-process-BXwWXuTh.mjs} +1 -1
  260. package/dist/{run-captured-process-CpZBh0lG.mjs.map → run-captured-process-BXwWXuTh.mjs.map} +1 -1
  261. package/dist/runOpa-CswzJxIs.mjs +2 -0
  262. package/dist/runOpa-CswzJxIs.mjs.map +1 -0
  263. package/dist/scaffold-model-BAbYTR0q.mjs +2 -0
  264. package/dist/scaffold-model-BAbYTR0q.mjs.map +1 -0
  265. package/dist/scaffold-planning-CNv83t_v.mjs +123 -0
  266. package/dist/scaffold-planning-CNv83t_v.mjs.map +1 -0
  267. package/dist/scaffold-templates-DzDGTZie.mjs +84 -0
  268. package/dist/scaffold-templates-DzDGTZie.mjs.map +1 -0
  269. package/dist/{skipPreflightJobs-Beia_iB6.mjs → skipPreflightJobs-CB_lGpri.mjs} +2 -2
  270. package/dist/{skipPreflightJobs-Beia_iB6.mjs.map → skipPreflightJobs-CB_lGpri.mjs.map} +1 -1
  271. package/dist/{skipRequestDataSilos-BSNLacnR.mjs → skipRequestDataSilos-Bf85wXUC.mjs} +2 -2
  272. package/dist/{skipRequestDataSilos-BSNLacnR.mjs.map → skipRequestDataSilos-Bf85wXUC.mjs.map} +1 -1
  273. package/dist/{streamPrivacyRequestsToCsv-Cksb9D49.mjs → streamPrivacyRequestsToCsv-CPwLKjTm.mjs} +2 -2
  274. package/dist/{streamPrivacyRequestsToCsv-Cksb9D49.mjs.map → streamPrivacyRequestsToCsv-CPwLKjTm.mjs.map} +1 -1
  275. package/dist/{syncCodePackages-DsC1tE8B.mjs → syncCodePackages-BHE2Tn1Q.mjs} +2 -2
  276. package/dist/{syncCodePackages-DsC1tE8B.mjs.map → syncCodePackages-BHE2Tn1Q.mjs.map} +1 -1
  277. package/dist/{updateConsentManagerVersionToLatest-CaEkTnlL.mjs → updateConsentManagerVersionToLatest-ikIE5dHp.mjs} +2 -2
  278. package/dist/{updateConsentManagerVersionToLatest-CaEkTnlL.mjs.map → updateConsentManagerVersionToLatest-ikIE5dHp.mjs.map} +1 -1
  279. package/dist/{uploadConsents-CNyuYx0o.mjs → uploadConsents-BrWpoV6_.mjs} +2 -2
  280. package/dist/{uploadConsents-CNyuYx0o.mjs.map → uploadConsents-BrWpoV6_.mjs.map} +1 -1
  281. package/dist/{uploadPrivacyRequestsFromCsv-BdTQOZnF.mjs → uploadPrivacyRequestsFromCsv-BuB0-XpH.mjs} +2 -2
  282. package/dist/{uploadPrivacyRequestsFromCsv-BdTQOZnF.mjs.map → uploadPrivacyRequestsFromCsv-BuB0-XpH.mjs.map} +1 -1
  283. package/dist/{validateTranscendAuth-CnHMn77m.mjs → validateTranscendAuth-D6Wr1cxY.mjs} +2 -2
  284. package/dist/{validateTranscendAuth-CnHMn77m.mjs.map → validateTranscendAuth-D6Wr1cxY.mjs.map} +1 -1
  285. package/dist/{writeCsv-D46aDkGf.mjs → writeCsv-D-2siSwE.mjs} +1 -1
  286. package/dist/{writeCsv-D46aDkGf.mjs.map → writeCsv-D-2siSwE.mjs.map} +1 -1
  287. package/package.json +8 -7
  288. package/dist/app-DCY8E776.mjs.map +0 -1
  289. package/dist/codecs-BsQFAFGT.mjs +0 -2
  290. package/dist/codecs-BsQFAFGT.mjs.map +0 -1
  291. package/dist/constants-BMAOvdcA.mjs +0 -2
  292. package/dist/constants-BMAOvdcA.mjs.map +0 -1
  293. package/dist/deno-runtime-QqwBDKXX.mjs +0 -2
  294. package/dist/deno-runtime-QqwBDKXX.mjs.map +0 -1
  295. package/dist/impl-BFJtKA2o2.mjs.map +0 -1
  296. package/dist/impl-BJlKQJdS2.mjs.map +0 -1
  297. package/dist/impl-BNPgYSBT.mjs +0 -3
  298. package/dist/impl-BNPgYSBT.mjs.map +0 -1
  299. package/dist/impl-BYGNx-8W2.mjs.map +0 -1
  300. package/dist/impl-BcJ019T2.mjs +0 -2
  301. package/dist/impl-BsC1KVxS.mjs +0 -2
  302. package/dist/impl-BwRcpAno.mjs.map +0 -1
  303. package/dist/impl-C5dzaDga2.mjs.map +0 -1
  304. package/dist/impl-C8BmxFQ2.mjs +0 -2
  305. package/dist/impl-CXUJ1eRC.mjs.map +0 -1
  306. package/dist/impl-CzxvoiGW.mjs +0 -3
  307. package/dist/impl-D-SQJc3t.mjs +0 -2
  308. package/dist/impl-D-SQJc3t.mjs.map +0 -1
  309. package/dist/impl-D23kJPAQ2.mjs +0 -3
  310. package/dist/impl-D23kJPAQ2.mjs.map +0 -1
  311. package/dist/impl-DOoR93T6.mjs.map +0 -1
  312. package/dist/impl-Dib6Fff12.mjs.map +0 -1
  313. package/dist/impl-Dk6TZKrp2.mjs.map +0 -1
  314. package/dist/impl-Dm-Fkr392.mjs.map +0 -1
  315. package/dist/impl-Drql0g72.mjs.map +0 -1
  316. package/dist/impl-FLj_mWLO.mjs +0 -2
  317. package/dist/impl-FLj_mWLO.mjs.map +0 -1
  318. package/dist/impl-VPBEqV0w2.mjs.map +0 -1
  319. package/dist/impl-m3QXCc6n.mjs.map +0 -1
  320. package/dist/logger-9T6vva73.mjs +0 -2
  321. package/dist/logger-9T6vva73.mjs.map +0 -1
  322. package/dist/manifest-DVuW_vvO.mjs +0 -2
  323. package/dist/manifest-DVuW_vvO.mjs.map +0 -1
  324. package/dist/mergeTranscendInputs-CWHXH0kF.mjs +0 -3
  325. package/dist/mergeTranscendInputs-CWHXH0kF.mjs.map +0 -1
  326. package/dist/missing-manifest-BKj1j-jg.mjs +0 -2
  327. package/dist/missing-manifest-BKj1j-jg.mjs.map +0 -1
  328. package/dist/printResult-esxW3HhT.mjs.map +0 -1
  329. package/dist/project-plan-apply-C2DfikVN.mjs +0 -3
  330. package/dist/project-plan-apply-C2DfikVN.mjs.map +0 -1
  331. package/dist/readTranscendYaml-STYnRzq-.mjs +0 -4
  332. package/dist/readTranscendYaml-STYnRzq-.mjs.map +0 -1
  333. package/dist/runOpa-CkKAwsvB.mjs +0 -2
  334. package/dist/runOpa-CkKAwsvB.mjs.map +0 -1
  335. package/dist/scaffold-planning-DMACXSnX.mjs +0 -121
  336. package/dist/scaffold-planning-DMACXSnX.mjs.map +0 -1
  337. package/dist/scaffold-templates-CsHM1y80.mjs +0 -84
  338. package/dist/scaffold-templates-CsHM1y80.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-Dqqb0lVN.mjs","names":[],"sources":["../src/lib/oneTrust/helpers/oneTrustAssessmentToJson.ts","../src/lib/oneTrust/helpers/syncOneTrustAssessmentToDisk.ts","../src/lib/oneTrust/endpoints/getListOfOneTrustAssessments.ts","../src/lib/oneTrust/endpoints/getOneTrustAssessment.ts","../src/lib/oneTrust/endpoints/getOneTrustRisk.ts","../src/lib/oneTrust/endpoints/getOneTrustUser.ts","../src/lib/oneTrust/helpers/enrichOneTrustAssessment.ts","../src/lib/oneTrust/helpers/syncOneTrustAssessmentToTranscend.ts","../src/lib/oneTrust/helpers/syncOneTrustAssessmentsFromOneTrust.ts","../src/lib/oneTrust/helpers/syncOneTrustAssessmentsFromFile.ts","../src/lib/oneTrust/createOneTrustGotInstance.ts","../src/commands/migration/sync-ot/impl.ts"],"sourcesContent":["import { OneTrustEnrichedAssessment } from '@transcend-io/privacy-types';\n\n/**\n * Converts the assessment into a json entry.\n *\n * @param param - information about the assessment and amount of entries\n * @returns a stringified json entry ready to be appended to a file\n */\nexport const oneTrustAssessmentToJson = ({\n assessment,\n index,\n total,\n wrap = true,\n}: {\n /** The assessment to convert */\n assessment: OneTrustEnrichedAssessment;\n /** The position of the assessment in the final Json object */\n index: number;\n /** The total amount of the assessments in the final Json object */\n total?: number;\n /** Whether to wrap every entry in brackets */\n wrap?: boolean;\n}): string => {\n let jsonEntry = '';\n // start with an opening bracket\n if (index === 0 || wrap) {\n jsonEntry = '[\\n';\n }\n\n const stringifiedAssessment = JSON.stringify(assessment);\n\n // Add comma for all items except the last one\n const comma = total && index < total - 1 && !wrap ? ',' : '';\n\n // write to file\n jsonEntry = `${jsonEntry + stringifiedAssessment + comma}\\n`;\n\n // end with closing bracket\n if ((total && index === total - 1) || wrap) {\n jsonEntry += '\\n]';\n }\n\n return jsonEntry;\n};\n","import fs from 'node:fs';\n\nimport { OneTrustEnrichedAssessment } from '@transcend-io/privacy-types';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger.js';\nimport { oneTrustAssessmentToJson } from './oneTrustAssessmentToJson.js';\n\n/**\n * Write the assessment to disk at the specified file path.\n *\n *\n * @param param - information about the assessment to write\n */\nexport const syncOneTrustAssessmentToDisk = ({\n file,\n assessment,\n index,\n total,\n}: {\n /** The file path to write the assessment to */\n file: string;\n /** The basic assessment */\n assessment: OneTrustEnrichedAssessment;\n /** The index of the assessment being written to the file */\n index: number;\n /** The total amount of assessments that we will write */\n total: number;\n}): void => {\n logger.info(\n colors.magenta(`Writing enriched assessment ${index + 1} of ${total} to file \"${file}\"...`),\n );\n\n if (index === 0) {\n fs.writeFileSync(\n file,\n oneTrustAssessmentToJson({\n assessment,\n index,\n total,\n wrap: false,\n }),\n );\n } else {\n fs.appendFileSync(\n file,\n oneTrustAssessmentToJson({\n assessment,\n index,\n total,\n wrap: false,\n }),\n );\n }\n};\n","import {\n OneTrustAssessment,\n OneTrustGetListOfAssessmentsResponse,\n} from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport { Got } from 'got';\n\nimport { logger } from '../../../logger.js';\n\n/**\n * Fetch a list of all assessments from the OneTrust client.\n * ref: https://developer.onetrust.com/onetrust/reference/getallassessmentbasicdetailsusingget\n *\n * @param param - the information about the OneTrust client\n * @returns a list of OneTrustAssessment\n */\nexport const getListOfOneTrustAssessments = async ({\n oneTrust,\n}: {\n /** The OneTrust client instance */\n oneTrust: Got;\n}): Promise<OneTrustAssessment[]> => {\n let currentPage = 0;\n let totalPages = 1;\n let totalElements = 0;\n\n const allAssessments: OneTrustAssessment[] = [];\n\n while (currentPage < totalPages) {\n const { body } = await oneTrust.get(\n `api/assessment/v2/assessments?page=${currentPage}&size=2000`,\n );\n\n const { page, content } = decodeCodec(OneTrustGetListOfAssessmentsResponse, body);\n allAssessments.push(...(content ?? []));\n if (currentPage === 0) {\n totalPages = page?.totalPages ?? 0;\n totalElements = page?.totalElements ?? 0;\n }\n currentPage += 1;\n\n // log progress\n logger.info(`Fetched ${allAssessments.length} of ${totalElements} assessments.`);\n }\n\n return allAssessments;\n};\n","import { OneTrustGetAssessmentResponse } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport { Got } from 'got';\n\n/**\n * Retrieve details about a particular assessment.\n * ref: https://developer.onetrust.com/onetrust/reference/exportassessmentusingget\n *\n * @param param - the information about the OneTrust client and assessment to retrieve\n * @returns details about the assessment\n */\nexport const getOneTrustAssessment = async ({\n oneTrust,\n assessmentId,\n}: {\n /** The OneTrust client instance */\n oneTrust: Got;\n /** The ID of the assessment to retrieve */\n assessmentId: string;\n}): Promise<OneTrustGetAssessmentResponse> => {\n const { body } = await oneTrust.get(\n `api/assessment/v2/assessments/${assessmentId}/export?ExcludeSkippedQuestions=false`,\n );\n\n return decodeCodec(OneTrustGetAssessmentResponse, body);\n};\n","import { OneTrustGetRiskResponse } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport { Got } from 'got';\n\n/**\n * Retrieve details about a particular risk.\n * ref: https://developer.onetrust.com/onetrust/reference/getriskusingget\n *\n * @param param - the information about the OneTrust client and risk to retrieve\n * @returns the OneTrust risk\n */\nexport const getOneTrustRisk = async ({\n oneTrust,\n riskId,\n}: {\n /** The OneTrust client instance */\n oneTrust: Got;\n /** The ID of the OneTrust risk to retrieve */\n riskId: string;\n}): Promise<OneTrustGetRiskResponse> => {\n const { body } = await oneTrust.get(`api/risk/v2/risks/${riskId}`);\n\n return decodeCodec(OneTrustGetRiskResponse, body);\n};\n","import { OneTrustGetUserResponse } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport { Got } from 'got';\n\n/**\n * Retrieve details about a particular user.\n * ref: https://developer.onetrust.com/onetrust/reference/getriskusingget\n *\n * @param param - the information about the OneTrust client and risk to retrieve\n * @returns the OneTrust risk\n */\nexport const getOneTrustUser = async ({\n oneTrust,\n userId,\n}: {\n /** The OneTrust client instance */\n oneTrust: Got;\n /** The ID of the OneTrust user to retrieve */\n userId: string;\n}): Promise<OneTrustGetUserResponse> => {\n const { body } = await oneTrust.get(`api/scim/v2/Users/${userId}`);\n\n return decodeCodec(OneTrustGetUserResponse, body);\n};\n","import {\n OneTrustAssessment,\n OneTrustEnrichedAssessment,\n OneTrustGetAssessmentResponse,\n OneTrustGetRiskResponse,\n OneTrustGetUserResponse,\n} from '@transcend-io/privacy-types';\nimport { keyBy } from 'lodash-es';\n\n/**\n * Merge the assessment, assessmentDetails, and riskDetails into one object.\n *\n * @param param - the assessment and risk information\n * @returns the assessment enriched with details and risk information\n */\nexport const enrichOneTrustAssessment = ({\n assessment,\n assessmentDetails,\n riskDetails,\n creatorDetails,\n approversDetails,\n respondentsDetails,\n}: {\n /** The OneTrust risk details */\n riskDetails: OneTrustGetRiskResponse[];\n /** The OneTrust assessment as returned from Get List of Assessments endpoint */\n assessment: OneTrustAssessment;\n /** The OneTrust assessment details */\n assessmentDetails: OneTrustGetAssessmentResponse;\n /** The OneTrust assessment creator details */\n creatorDetails: OneTrustGetUserResponse;\n /** The OneTrust assessment approvers details */\n approversDetails: OneTrustGetUserResponse[];\n /** The OneTrust assessment internal respondents details */\n respondentsDetails: OneTrustGetUserResponse[];\n}): OneTrustEnrichedAssessment => {\n const riskDetailsById = keyBy(riskDetails, 'id');\n const { sections, createdBy, ...restAssessmentDetails } = assessmentDetails;\n const sectionsWithEnrichedRisk = sections.map((section) => {\n const { questions, ...restSection } = section;\n const enrichedQuestions = questions.map((question) => {\n const { risks, ...restQuestion } = question;\n const enrichedRisks = (risks ?? []).map((risk) => {\n const details = riskDetailsById[risk.riskId];\n return {\n ...risk,\n ...details,\n level: risk.level,\n impactLevel: risk.impactLevel ?? 0,\n };\n });\n return {\n ...restQuestion,\n risks: enrichedRisks,\n };\n });\n return {\n ...restSection,\n questions: enrichedQuestions,\n };\n });\n\n // grab creator details\n const enrichedCreatedBy = {\n ...createdBy,\n active: creatorDetails?.active ?? false,\n userType: creatorDetails?.userType ?? 'Internal',\n emails: creatorDetails?.emails ?? [],\n title: creatorDetails?.title ?? null,\n givenName: creatorDetails?.name.givenName ?? null,\n familyName: creatorDetails?.name.familyName ?? null,\n };\n\n // grab approvers details\n const approverDetailsById = keyBy(approversDetails, 'id');\n const enrichedApprovers = assessmentDetails.approvers.flatMap((originalApprover) =>\n approverDetailsById[originalApprover.id]\n ? [\n {\n ...originalApprover,\n approver: {\n ...originalApprover.approver,\n active: approverDetailsById[originalApprover.id].active,\n userType: approverDetailsById[originalApprover.id].userType,\n emails: approverDetailsById[originalApprover.id].emails,\n title: approverDetailsById[originalApprover.id].title,\n givenName: approverDetailsById[originalApprover.id].name.givenName ?? null,\n familyName: approverDetailsById[originalApprover.id].name.familyName ?? null,\n },\n },\n ]\n : [],\n );\n\n // grab respondents details\n const respondentsDetailsById = keyBy(respondentsDetails, 'id');\n const enrichedRespondents = assessmentDetails.respondents\n .filter((r) => !r.name.includes('@')) // search only internal respondents\n .flatMap((respondent) =>\n respondentsDetailsById[respondent.id]\n ? [\n {\n ...respondent,\n active: respondentsDetailsById[respondent.id].active,\n userType: respondentsDetailsById[respondent.id].userType,\n emails: respondentsDetailsById[respondent.id].emails,\n title: respondentsDetailsById[respondent.id].title,\n givenName: respondentsDetailsById[respondent.id].name.givenName ?? null,\n familyName: respondentsDetailsById[respondent.id].name.familyName ?? null,\n },\n ]\n : [],\n );\n\n // combine everything into a single enriched assessment\n return {\n ...assessment,\n ...restAssessmentDetails,\n approvers: enrichedApprovers,\n respondents: enrichedRespondents,\n createdBy: enrichedCreatedBy,\n sections: sectionsWithEnrichedRisk,\n };\n};\n","import { OneTrustEnrichedAssessment } from '@transcend-io/privacy-types';\nimport { makeGraphQLRequest, IMPORT_ONE_TRUST_ASSESSMENT_FORMS } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { ImportOnetrustAssessmentsInput } from '../../../codecs.js';\nimport { logger } from '../../../logger.js';\nimport { oneTrustAssessmentToJson } from './oneTrustAssessmentToJson.js';\n\nexport interface AssessmentForm {\n /** ID of Assessment Form */\n id: string;\n /** Title of Assessment Form */\n name: string;\n}\n\n/**\n * Write the assessment to a Transcend instance.\n *\n *\n * @param param - information about the assessment and Transcend instance to write to\n */\nexport const syncOneTrustAssessmentToTranscend = async ({\n transcend,\n assessment,\n total,\n index,\n}: {\n /** the Transcend client instance */\n transcend: GraphQLClient;\n /** the assessment to sync to Transcend */\n assessment: OneTrustEnrichedAssessment;\n /** The index of the assessment being written to the file */\n index: number;\n /** The total amount of assessments that we will write */\n total?: number;\n}): Promise<void> => {\n logger.info(\n colors.magenta(\n `Writing enriched assessment ${index + 1} ${total ? `of ${total} ` : ' '}to Transcend...`,\n ),\n );\n\n // convert the OneTrust assessment object into a json record\n const json = oneTrustAssessmentToJson({\n assessment,\n index,\n total,\n });\n\n // transform the json record into a valid input to the mutation\n const input: ImportOnetrustAssessmentsInput = {\n json,\n };\n\n try {\n await makeGraphQLRequest<{\n /** the importOneTrustAssessmentForms mutation */\n importOneTrustAssessmentForms: {\n /** Created Assessment Forms */\n assessmentForms: AssessmentForm[];\n };\n }>(transcend, IMPORT_ONE_TRUST_ASSESSMENT_FORMS, {\n variables: { input },\n logger,\n });\n } catch (error) {\n logger.error(\n colors.red(\n `Failed to sync assessment ${index + 1} ${total ? `of ${total} ` : ' '}to Transcend.\\n` +\n `\\tAssessment Title: ${assessment.name}. Template Title: ${assessment.template.name}\\n`,\n ),\n error,\n );\n }\n};\n","import {\n OneTrustAssessmentQuestion,\n OneTrustAssessmentSection,\n OneTrustEnrichedAssessment,\n OneTrustGetRiskResponse,\n OneTrustGetUserResponse,\n} from '@transcend-io/privacy-types';\nimport { mapSeries, map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport type { Got } from 'got';\nimport { GraphQLClient } from 'graphql-request';\nimport { uniq } from 'lodash-es';\n\nimport { logger } from '../../../logger.js';\nimport {\n getListOfOneTrustAssessments,\n getOneTrustAssessment,\n getOneTrustRisk,\n getOneTrustUser,\n} from '../endpoints/index.js';\nimport { enrichOneTrustAssessment } from './enrichOneTrustAssessment.js';\nimport { syncOneTrustAssessmentToDisk } from './syncOneTrustAssessmentToDisk.js';\nimport { syncOneTrustAssessmentToTranscend } from './syncOneTrustAssessmentToTranscend.js';\n\nexport interface AssessmentForm {\n /** ID of Assessment Form */\n id: string;\n /** Title of Assessment Form */\n name: string;\n}\n\n/**\n * Reads all the assessments from a OneTrust instance and syncs them to Transcend or to Disk.\n *\n * @param param - the information about the assessment, its OneTrust source, and destination (disk or Transcend)\n */\nexport const syncOneTrustAssessmentsFromOneTrust = async ({\n oneTrust,\n file,\n dryRun,\n transcend,\n}: {\n /** the OneTrust client instance */\n oneTrust: Got;\n /** the Transcend client instance */\n transcend?: GraphQLClient;\n /** Whether to write to file instead of syncing to Transcend */\n dryRun: boolean;\n /** the path to the file in case dryRun is true */\n file?: string;\n}): Promise<void> => {\n // fetch the list of all assessments in the OneTrust organization\n logger.info('Getting list of all assessments from OneTrust...');\n const assessments = await getListOfOneTrustAssessments({ oneTrust });\n\n // a cache of OneTrust users so we avoid requesting already fetched users\n const oneTrustCachedUsers: Record<string, OneTrustGetUserResponse> = {};\n\n // split all assessments in batches, so we can process some of steps in parallel\n const BATCH_SIZE = 5;\n const assessmentBatches = Array.from(\n {\n length: Math.ceil(assessments.length / BATCH_SIZE),\n },\n (_, i) => assessments.slice(i * BATCH_SIZE, (i + 1) * BATCH_SIZE),\n );\n\n // process each batch and sync the batch right away so it's garbage collected and we don't run out of memory\n await mapSeries(assessmentBatches, async (assessmentBatch, batch) => {\n const batchEnrichedAssessments: OneTrustEnrichedAssessment[] = [];\n\n // fetch assessment details from OneTrust in parallel\n await map(\n assessmentBatch,\n async (assessment, index) => {\n const assessmentNumber = BATCH_SIZE * batch + index + 1;\n logger.info(\n `[assessment ${assessmentNumber} of ${assessments.length}]: fetching details...`,\n );\n const { templateName, assessmentId } = assessment;\n const assessmentDetails = await getOneTrustAssessment({\n oneTrust,\n assessmentId,\n });\n // fetch assessment's creator information\n const creatorId = assessmentDetails.createdBy.id;\n let creator = oneTrustCachedUsers[creatorId];\n if (!creator) {\n logger.info(\n `[assessment ${assessmentNumber} of ${assessments.length}]: fetching creator...`,\n );\n try {\n creator = await getOneTrustUser({\n oneTrust,\n userId: creatorId,\n });\n oneTrustCachedUsers[creatorId] = creator;\n } catch (error) {\n logger.warn(\n colors.yellow(\n `[assessment ${assessmentNumber} of ${assessments.length}]: failed to fetch form creator.` +\n `\\tcreatorId: ${creatorId}. Assessment Title: ${assessment.name}. Template Title: ${templateName}`,\n ),\n error,\n );\n }\n }\n\n // fetch assessment approvers information\n const { approvers } = assessmentDetails;\n let approversDetails: OneTrustGetUserResponse[][] = [];\n if (approvers.length > 0) {\n logger.info(\n `[assessment ${assessmentNumber} of ${assessments.length}]: fetching approvers...`,\n );\n approversDetails = await map(\n approvers.map(({ id }) => id),\n async (userId) => {\n try {\n let approver = oneTrustCachedUsers[userId];\n if (!approver) {\n approver = await getOneTrustUser({ oneTrust, userId });\n oneTrustCachedUsers[userId] = approver;\n }\n return [approver];\n } catch (error) {\n logger.warn(\n colors.yellow(\n `[assessment ${assessmentNumber} of ${assessments.length}]: failed to fetch a form approver.` +\n `\\tapproverId: ${userId}. Assessment Title: ${assessment.name}. Template Title: ${templateName}`,\n ),\n error,\n );\n return [];\n }\n },\n { concurrency: 5 },\n );\n }\n\n // fetch assessment internal respondents information\n const { respondents } = assessmentDetails;\n // if a user is an internal respondents, their 'name' field can't be an email.\n const internalRespondents = respondents.filter((r) => !r.name.includes('@'));\n let respondentsDetails: OneTrustGetUserResponse[][] = [];\n if (internalRespondents.length > 0) {\n logger.info(\n `[assessment ${assessmentNumber} of ${assessments.length}]: fetching respondents...`,\n );\n respondentsDetails = await map(\n internalRespondents.map(({ id }) => id),\n async (userId) => {\n try {\n let respondent = oneTrustCachedUsers[userId];\n if (!respondent) {\n respondent = await getOneTrustUser({ oneTrust, userId });\n oneTrustCachedUsers[userId] = respondent;\n }\n return [respondent];\n } catch (error) {\n logger.warn(\n colors.yellow(\n `[assessment ${assessmentNumber} of ${assessments.length}]: failed to fetch a respondent.` +\n `\\trespondentId: ${userId}. Assessment Title: ${assessment.name}. Template Title: ${templateName}`,\n ),\n error,\n );\n return [];\n }\n },\n { concurrency: 5 },\n );\n }\n\n // fetch assessment risk information\n let riskDetails: OneTrustGetRiskResponse[] = [];\n const riskIds = uniq(\n assessmentDetails.sections.flatMap((s: OneTrustAssessmentSection) =>\n s.questions.flatMap((q: OneTrustAssessmentQuestion) =>\n (q.risks ?? []).flatMap((r) => r.riskId),\n ),\n ),\n );\n if (riskIds.length > 0) {\n logger.info(\n `[assessment ${assessmentNumber} of ${assessments.length}]: fetching risks...`,\n );\n riskDetails = await map(\n riskIds,\n (riskId) => getOneTrustRisk({ oneTrust, riskId: riskId as string }),\n {\n concurrency: 5,\n },\n );\n }\n\n // enrich the assessments with user and risk details\n const enrichedAssessment = enrichOneTrustAssessment({\n assessment,\n assessmentDetails,\n riskDetails,\n creatorDetails: creator,\n approversDetails: approversDetails.flat(),\n respondentsDetails: respondentsDetails.flat(),\n });\n\n batchEnrichedAssessments.push(enrichedAssessment);\n },\n { concurrency: BATCH_SIZE },\n );\n\n // sync assessments in series to avoid concurrency bugs\n await mapSeries(batchEnrichedAssessments, async (enrichedAssessment, index) => {\n // the assessment's global index takes its batch into consideration\n const globalIndex = batch * BATCH_SIZE + index;\n\n if (dryRun && file) {\n // sync to file\n syncOneTrustAssessmentToDisk({\n assessment: enrichedAssessment,\n index: globalIndex,\n total: assessments.length,\n file,\n });\n } else if (transcend) {\n // sync to transcend\n await syncOneTrustAssessmentToTranscend({\n assessment: enrichedAssessment,\n transcend,\n total: assessments.length,\n index: globalIndex,\n });\n }\n });\n });\n};\n","import { createReadStream } from 'node:fs';\n\nimport { OneTrustEnrichedAssessment } from '@transcend-io/privacy-types';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport JSONStream from 'JSONStream';\n\nimport { logger } from '../../../logger.js';\nimport { syncOneTrustAssessmentToTranscend } from './syncOneTrustAssessmentToTranscend.js';\n\n/**\n * Reads assessments from a file and syncs them to Transcend.\n *\n * @param param - the information about the source file and Transcend instance to write them to.\n */\nexport const syncOneTrustAssessmentsFromFile = ({\n transcend,\n file,\n}: {\n /** the Transcend client instance */\n transcend: GraphQLClient;\n /** The name of the file from which to read the OneTrust assessments */\n file: string;\n}): Promise<void> => {\n logger.info(`Getting list of all assessments from file ${file}...`);\n\n return new Promise((resolve, reject) => {\n // Create a readable stream from the file\n const fileStream = createReadStream(file, {\n encoding: 'utf-8',\n highWaterMark: 64 * 1024, // 64KB chunks\n });\n\n // Create a JSONStream parser to parse the array of OneTrust assessments from the file\n const parser = JSONStream.parse('*'); // '*' matches each element in the root array\n\n let index = 0;\n\n // Pipe the file stream into the JSON parser\n fileStream.pipe(parser);\n\n // Handle each parsed assessment object\n parser.on('data', async (assessment) => {\n try {\n // Pause the stream while processing to avoid overwhelming memory\n parser.pause();\n\n // Decode and validate the assessment\n const parsedAssessment = decodeCodec(OneTrustEnrichedAssessment, assessment);\n\n // Sync the assessment to transcend\n await syncOneTrustAssessmentToTranscend({\n assessment: parsedAssessment,\n transcend,\n index,\n });\n\n index += 1;\n\n // Resume the stream after processing\n parser.resume();\n } catch (e) {\n // if failed to parse a line, report error and continue\n logger.error(\n colors.red(`Failed to parse the assessment ${index} from file '${file}': ${e.message}.`),\n );\n }\n });\n\n // Handle completion\n parser.on('end', () => {\n logger.info(`Finished processing ${index} assessments from file ${file}`);\n resolve();\n });\n\n // Handle stream or parsing errors\n parser.on('error', (error) => {\n logger.error(colors.red(`Error parsing file '${file}': ${error.message}`));\n reject(error);\n });\n\n fileStream.on('error', (error) => {\n logger.error(colors.red(`Error reading file '${file}': ${error.message}`));\n reject(error);\n });\n });\n};\n","import got, { Got } from 'got';\n\n/**\n * Instantiate an instance of got that is capable of making requests to OneTrust\n *\n * @param param - information about the OneTrust URL\n * @returns The instance of got that is capable of making requests to the customer ingress\n */\nexport const createOneTrustGotInstance = ({\n hostname,\n auth,\n}: {\n /** Hostname of the OneTrust API */\n hostname: string;\n /** The OAuth access token */\n auth: string;\n}): Got =>\n got.extend({\n prefixUrl: `https://${hostname}`,\n headers: {\n accept: 'application/json',\n 'content-type': 'application/json',\n authorization: `Bearer ${auth}`,\n },\n });\n","import { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { OneTrustFileFormat, OneTrustPullResource, OneTrustPullSource } from '../../../enums.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport {\n syncOneTrustAssessmentsFromFile,\n syncOneTrustAssessmentsFromOneTrust,\n} from '../../../lib/oneTrust/helpers/index.js';\nimport { createOneTrustGotInstance } from '../../../lib/oneTrust/index.js';\n\n// Command flag interface\nexport interface SyncOtCommandFlags {\n hostname?: string;\n oneTrustAuth?: string;\n source: OneTrustPullSource;\n transcendAuth?: string;\n transcendUrl: string;\n file?: string;\n resource: OneTrustPullResource;\n dryRun: boolean;\n debug: boolean;\n}\n\n// Command implementation\nexport async function syncOt(\n this: LocalContext,\n {\n hostname,\n oneTrustAuth,\n source,\n transcendAuth,\n transcendUrl,\n resource,\n file,\n dryRun,\n debug,\n }: SyncOtCommandFlags,\n): Promise<void> {\n // Must be able to authenticate to transcend to sync resources to it\n if (!dryRun && !transcendAuth) {\n throw new Error(\n // eslint-disable-next-line no-template-curly-in-string\n 'Must specify a \"transcendAuth\" parameter to sync resources to Transcend. e.g. --transcendAuth=${TRANSCEND_API_KEY}',\n );\n }\n\n // If trying to sync to disk, must specify a file path\n if (dryRun && !file) {\n throw new Error(\n 'Must set a \"file\" parameter when \"dryRun\" is \"true\". e.g. --file=./oneTrustAssessments.json',\n );\n }\n\n if (file) {\n const splitFile = file.split('.');\n if (splitFile.length < 2) {\n throw new Error(\n 'The \"file\" parameter has an invalid format. Expected a path with extensions. e.g. --file=./pathToFile.json.',\n );\n }\n if (splitFile.at(-1) !== OneTrustFileFormat.Json) {\n throw new Error(\n `Expected the format of the \"file\" parameters '${file}' to be '${\n OneTrustFileFormat.Json\n }', but got '${splitFile.at(-1)}'.`,\n );\n }\n }\n\n // if reading assessments from a OneTrust\n if (source === OneTrustPullSource.OneTrust) {\n // must specify the OneTrust hostname\n if (!hostname) {\n throw new Error(\n 'Missing required parameter \"hostname\". e.g. --hostname=customer.my.onetrust.com',\n );\n }\n // must specify the OneTrust auth\n if (!oneTrustAuth) {\n throw new Error(\n 'Missing required parameter \"oneTrustAuth\". e.g. --oneTrustAuth=$ONE_TRUST_AUTH_TOKEN',\n );\n }\n } else {\n // if reading the assessments from a file, must specify a file to read from\n if (!file) {\n throw new Error(\n 'Must specify a \"file\" parameter to read the OneTrust assessments from. e.g. --source=./oneTrustAssessments.json',\n );\n }\n\n // Cannot try reading from file and save assessments to a file simultaneously\n if (dryRun) {\n throw new Error(\n 'Cannot read and write to a file simultaneously.' +\n ` Emit the \"source\" parameter or set it to ${OneTrustPullSource.OneTrust} if \"dryRun\" is enabled.`,\n );\n }\n }\n\n doneInputValidation(this.process);\n\n // instantiate a client to talk to OneTrust\n const oneTrust =\n hostname && oneTrustAuth\n ? createOneTrustGotInstance({\n hostname,\n auth: oneTrustAuth,\n })\n : undefined;\n\n // instantiate a client to talk to Transcend\n const transcend =\n transcendUrl && transcendAuth\n ? buildTranscendGraphQLClient(transcendUrl, transcendAuth)\n : undefined;\n\n try {\n if (resource === OneTrustPullResource.Assessments) {\n if (source === OneTrustPullSource.OneTrust && oneTrust) {\n await syncOneTrustAssessmentsFromOneTrust({\n oneTrust,\n file,\n dryRun,\n ...(transcend && { transcend }),\n });\n } else if (source === OneTrustPullSource.File && file && transcend) {\n await syncOneTrustAssessmentsFromFile({ file, transcend });\n }\n }\n } catch (err) {\n throw new Error(\n `An error occurred syncing the resource ${resource} from OneTrust: ${\n debug ? err.stack : err.message\n }`,\n );\n }\n\n // Indicate success\n this.logger.info(\n colors.green(\n `Successfully synced OneTrust ${resource} to ${dryRun ? `disk at \"${file}\"` : 'Transc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R,IAAM,EAAY,EAAK,MAAM,IAAI,CACjC,GAAI,EAAU,OAAS,EACrB,MAAU,MACR,8GACD,CAEH,GAAI,EAAU,GAAG,GAAG,GAAA,OAClB,MAAU,MACR,iDAAiD,EAAK,2BAEvC,EAAU,GAAG,GAAG,CAAC,IACjC,CAKL,GAAI,IAAA,WAAwC,CAE1C,GAAI,CAAC,EACH,MAAU,MACR,kFACD,CAGH,GAAI,CAAC,EACH,MAAU,MACR,uFACD,KAEE,CAEL,GAAI,CAAC,EACH,MAAU,MACR,kHACD,CAIH,GAAI,EACF,MAAU,MACR,4HAED,CAIL,EAAoB,KAAK,QAAQ,CAGjC,IAAM,EACJ,GAAY,EACR,EAA0B,CACxB,WACA,KAAM,EACP,CAAC,CACF,IAAA,GAGA,EACJ,GAAgB,EACZ,EAA4B,EAAc,EAAc,CACxD,IAAA,GAEN,GAAI,CACE,IAAA,gBACE,IAAA,YAA0C,EAC5C,MAAM,EAAoC,CACxC,WACA,OACA,SACA,GAAI,GAAa,CAAE,YAAW,CAC/B,CAAC,CACO,IAAA,QAAsC,GAAQ,GACvD,MAAM,EAAgC,CAAE,OAAM,YAAW,CAAC,QAGvD,EAAK,CACZ,MAAU,MACR,0CAA0C,EAAS,kBACjD,EAAQ,EAAI,MAAQ,EAAI,UAE3B,CAIH,KAAK,OAAO,KACV,EAAO,MACL,gCAAgC,EAAS,MAAM,EAAS,YAAY,EAAK,GAAK,YAAY,GAC3F,CACF"}
@@ -1,2 +1,2 @@
1
- import{n as e,r as t}from"./runOpa-CkKAwsvB.mjs";import{t as n}from"./done-input-validation-Cjk7a3jX.mjs";import r from"node:path";import i from"colors";async function a({pkg:a,input:o,bundle:s}){n(this.process),t();let c=r.resolve(o);if(!this.fs.existsSync(c))throw Error(`Input file not found: ${c}`);let l=[`eval`,`--format`,`pretty`,`--input`,c];s&&l.push(`-b`,r.resolve(s)),l.push(a),this.logger.info(i.green(`Evaluating ${a} with input ${c}...`));let u=await e(l);u!==0&&this.process.exit(u)}export{a as _eval};
2
- //# sourceMappingURL=impl-6m7GXUAe.mjs.map
1
+ import{n as e,r as t}from"./runOpa-CswzJxIs.mjs";import{t as n}from"./done-input-validation-BUz-aVC5.mjs";import r from"node:path";import i from"colors";async function a({pkg:a,input:o,bundle:s}){n(this.process),t();let c=r.resolve(o);if(!this.fs.existsSync(c))throw Error(`Input file not found: ${c}`);let l=[`eval`,`--format`,`pretty`,`--input`,c];s&&l.push(`-b`,r.resolve(s)),l.push(a),this.logger.info(i.green(`Evaluating ${a} with input ${c}...`));let u=await e(l);u!==0&&this.process.exit(u)}export{a as _eval};
2
+ //# sourceMappingURL=impl-DryC3OJu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-6m7GXUAe.mjs","names":[],"sources":["../src/commands/policy/eval/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { assertOpaInstalled, runOpa } from '../helpers/index.js';\n\n/** CLI flags for `transcend policy eval`. */\nexport interface EvalCommandFlags {\n /** OPA package/query to evaluate (e.g. `data.transcend.decision`) */\n pkg: string;\n /** Path to a JSON envelope input file */\n input: string;\n /** Optional local policy bundle directory */\n bundle?: string;\n}\n\n/**\n * Evaluate one envelope against a local policy bundle via `opa eval`.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function _eval(\n this: LocalContext,\n { pkg, input, bundle }: EvalCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n assertOpaInstalled();\n\n const inputPath = path.resolve(input);\n if (!this.fs.existsSync(inputPath)) {\n throw new Error(`Input file not found: ${inputPath}`);\n }\n\n const args = ['eval', '--format', 'pretty', '--input', inputPath];\n if (bundle) {\n args.push('-b', path.resolve(bundle));\n }\n args.push(pkg);\n\n this.logger.info(colors.green(`Evaluating ${pkg} with input ${inputPath}...`));\n\n const exitCode = await runOpa(args);\n if (exitCode !== 0) {\n this.process.exit(exitCode);\n }\n}\n"],"mappings":"yJAwBA,eAAsB,EAEpB,CAAE,MAAK,QAAO,UACC,CACf,EAAoB,KAAK,QAAQ,CAEjC,GAAoB,CAEpB,IAAM,EAAY,EAAK,QAAQ,EAAM,CACrC,GAAI,CAAC,KAAK,GAAG,WAAW,EAAU,CAChC,MAAU,MAAM,yBAAyB,IAAY,CAGvD,IAAM,EAAO,CAAC,OAAQ,WAAY,SAAU,UAAW,EAAU,CAC7D,GACF,EAAK,KAAK,KAAM,EAAK,QAAQ,EAAO,CAAC,CAEvC,EAAK,KAAK,EAAI,CAEd,KAAK,OAAO,KAAK,EAAO,MAAM,cAAc,EAAI,cAAc,EAAU,KAAK,CAAC,CAE9E,IAAM,EAAW,MAAM,EAAO,EAAK,CAC/B,IAAa,GACf,KAAK,QAAQ,KAAK,EAAS"}
1
+ {"version":3,"file":"impl-DryC3OJu.mjs","names":[],"sources":["../src/commands/policy/eval/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { assertOpaInstalled, runOpa } from '../helpers/index.js';\n\n/** CLI flags for `transcend policy eval`. */\nexport interface EvalCommandFlags {\n /** OPA package/query to evaluate (e.g. `data.transcend.decision`) */\n pkg: string;\n /** Path to a JSON envelope input file */\n input: string;\n /** Optional local policy bundle directory */\n bundle?: string;\n}\n\n/**\n * Evaluate one envelope against a local policy bundle via `opa eval`.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function _eval(\n this: LocalContext,\n { pkg, input, bundle }: EvalCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n assertOpaInstalled();\n\n const inputPath = path.resolve(input);\n if (!this.fs.existsSync(inputPath)) {\n throw new Error(`Input file not found: ${inputPath}`);\n }\n\n const args = ['eval', '--format', 'pretty', '--input', inputPath];\n if (bundle) {\n args.push('-b', path.resolve(bundle));\n }\n args.push(pkg);\n\n this.logger.info(colors.green(`Evaluating ${pkg} with input ${inputPath}...`));\n\n const exitCode = await runOpa(args);\n if (exitCode !== 0) {\n this.process.exit(exitCode);\n }\n}\n"],"mappings":"yJAwBA,eAAsB,EAEpB,CAAE,MAAK,QAAO,UACC,CACf,EAAoB,KAAK,QAAQ,CAEjC,GAAoB,CAEpB,IAAM,EAAY,EAAK,QAAQ,EAAM,CACrC,GAAI,CAAC,KAAK,GAAG,WAAW,EAAU,CAChC,MAAU,MAAM,yBAAyB,IAAY,CAGvD,IAAM,EAAO,CAAC,OAAQ,WAAY,SAAU,UAAW,EAAU,CAC7D,GACF,EAAK,KAAK,KAAM,EAAK,QAAQ,EAAO,CAAC,CAEvC,EAAK,KAAK,EAAI,CAEd,KAAK,OAAO,KAAK,EAAO,MAAM,cAAc,EAAI,cAAc,EAAU,KAAK,CAAC,CAE9E,IAAM,EAAW,MAAM,EAAO,EAAK,CAC/B,IAAa,GACf,KAAK,QAAQ,KAAK,EAAS"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./notifyPrivacyRequestsAdditionalTime-BPIYuCov.mjs";import{t}from"./done-input-validation-Cjk7a3jX.mjs";async function n({auth:n,transcendUrl:r,createdAtBefore:i,createdAtAfter:a,updatedAtBefore:o,updatedAtAfter:s,actions:c,daysLeft:l,days:u,requestIds:d,emailTemplate:f,concurrency:p}){t(this.process),await e({transcendUrl:r,requestActions:c,auth:n,emailTemplate:f,days:u,daysLeft:l,requestIds:d,concurrency:p,createdAtBefore:i,createdAtAfter:a,updatedAtBefore:o,updatedAtAfter:s})}export{n as notifyAdditionalTime};
2
- //# sourceMappingURL=impl-amV0wRWk.mjs.map
1
+ import{t as e}from"./notifyPrivacyRequestsAdditionalTime-G8IZ0Ooy.mjs";import{t}from"./done-input-validation-BUz-aVC5.mjs";async function n({auth:n,transcendUrl:r,createdAtBefore:i,createdAtAfter:a,updatedAtBefore:o,updatedAtAfter:s,actions:c,daysLeft:l,days:u,requestIds:d,emailTemplate:f,concurrency:p}){t(this.process),await e({transcendUrl:r,requestActions:c,auth:n,emailTemplate:f,days:u,daysLeft:l,requestIds:d,concurrency:p,createdAtBefore:i,createdAtAfter:a,updatedAtBefore:o,updatedAtAfter:s})}export{n as notifyAdditionalTime};
2
+ //# sourceMappingURL=impl-Dv8ecMWN.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-amV0wRWk.mjs","names":[],"sources":["../src/commands/request/notify-additional-time/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { notifyPrivacyRequestsAdditionalTime } from '../../../lib/requests/index.js';\n\nexport interface NotifyAdditionalTimeCommandFlags {\n auth: string;\n createdAtBefore: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n actions?: RequestAction[];\n daysLeft: number;\n days: number;\n requestIds?: string[];\n emailTemplate: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function notifyAdditionalTime(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n actions,\n daysLeft,\n days,\n requestIds,\n emailTemplate,\n concurrency,\n }: NotifyAdditionalTimeCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await notifyPrivacyRequestsAdditionalTime({\n transcendUrl,\n requestActions: actions,\n auth,\n emailTemplate,\n days,\n daysLeft,\n requestIds,\n concurrency,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n });\n}\n"],"mappings":"2HAqBA,eAAsB,EAEpB,CACE,OACA,eACA,kBACA,iBACA,kBACA,iBACA,UACA,WACA,OACA,aACA,gBACA,eAEa,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAAoC,CACxC,eACA,eAAgB,EAChB,OACA,gBACA,OACA,WACA,aACA,cACA,kBACA,iBACA,kBACA,iBACD,CAAC"}
1
+ {"version":3,"file":"impl-Dv8ecMWN.mjs","names":[],"sources":["../src/commands/request/notify-additional-time/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { notifyPrivacyRequestsAdditionalTime } from '../../../lib/requests/index.js';\n\nexport interface NotifyAdditionalTimeCommandFlags {\n auth: string;\n createdAtBefore: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n actions?: RequestAction[];\n daysLeft: number;\n days: number;\n requestIds?: string[];\n emailTemplate: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function notifyAdditionalTime(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n actions,\n daysLeft,\n days,\n requestIds,\n emailTemplate,\n concurrency,\n }: NotifyAdditionalTimeCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await notifyPrivacyRequestsAdditionalTime({\n transcendUrl,\n requestActions: actions,\n auth,\n emailTemplate,\n days,\n daysLeft,\n requestIds,\n concurrency,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n });\n}\n"],"mappings":"2HAqBA,eAAsB,EAEpB,CACE,OACA,eACA,kBACA,iBACA,kBACA,iBACA,UACA,WACA,OACA,aACA,gBACA,eAEa,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAAoC,CACxC,eACA,eAAgB,EAChB,OACA,gBACA,OACA,WACA,aACA,cACA,kBACA,iBACA,kBACA,iBACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./pullUnstructuredSubDataPointRecommendations-Dmh_-r95.mjs";import{s as t}from"./writeCsv-D46aDkGf.mjs";import{t as n}from"./done-input-validation-Cjk7a3jX.mjs";import{uniq as r}from"lodash-es";import i from"colors";import{buildTranscendGraphQLClient as a}from"@transcend-io/sdk";async function o({auth:o,file:s,transcendUrl:c,dataSiloIds:l,subCategories:u,status:d,includeEncryptedSnippets:f}){n(this.process);try{let n=await e(a(c,o),{dataSiloIds:l,subCategories:u,status:d,includeEncryptedSnippets:f});this.logger.info(i.magenta(`Writing unstructured discovery files to file "${s}"...`));let p=[];await t(s,n.map(e=>{let t={"Entry ID":e.id,"Data Silo ID":e.dataSiloId,"Object Path ID":e.scannedObjectPathId,"Object ID":e.scannedObjectId,...f?{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 p=r([...p,...Object.keys(t)]),t}),p)}catch(e){this.logger.error(i.red(`An error occurred syncing the unstructured discovery files: ${e.message}`)),this.process.exit(1)}this.logger.info(i.green(`Successfully synced unstructured discovery files to disk at ${s}!`))}export{o as pullUnstructuredDiscoveryFiles};
2
- //# sourceMappingURL=impl-CfPXYgT42.mjs.map
1
+ import{t as e}from"./pullUnstructuredSubDataPointRecommendations-YTBzfkRZ.mjs";import{s as t}from"./writeCsv-D-2siSwE.mjs";import{t as n}from"./done-input-validation-BUz-aVC5.mjs";import{uniq as r}from"lodash-es";import i from"colors";import{buildTranscendGraphQLClient as a}from"@transcend-io/sdk";async function o({auth:o,file:s,transcendUrl:c,dataSiloIds:l,subCategories:u,status:d,includeEncryptedSnippets:f}){n(this.process);try{let n=await e(a(c,o),{dataSiloIds:l,subCategories:u,status:d,includeEncryptedSnippets:f});this.logger.info(i.magenta(`Writing unstructured discovery files to file "${s}"...`));let p=[];await t(s,n.map(e=>{let t={"Entry ID":e.id,"Data Silo ID":e.dataSiloId,"Object Path ID":e.scannedObjectPathId,"Object ID":e.scannedObjectId,...f?{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 p=r([...p,...Object.keys(t)]),t}),p)}catch(e){this.logger.error(i.red(`An error occurred syncing the unstructured discovery files: ${e.message}`)),this.process.exit(1)}this.logger.info(i.green(`Successfully synced unstructured discovery files to disk at ${s}!`))}export{o as pullUnstructuredDiscoveryFiles};
2
+ //# sourceMappingURL=impl-DzUTmaID2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-CfPXYgT42.mjs","names":[],"sources":["../src/commands/inventory/pull-unstructured-discovery-files/impl.ts"],"sourcesContent":["import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { uniq } from 'lodash-es';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullUnstructuredSubDataPointRecommendations } from '../../../lib/data-inventory/index.js';\nimport { writeLargeCsv } from '../../../lib/helpers/index.js';\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);\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 this.logger.info(colors.magenta(`Writing unstructured discovery files to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = entries.map((entry) => {\n const result = {\n 'Entry ID': entry.id,\n 'Data Silo ID': entry.dataSiloId,\n 'Object Path ID': entry.scannedObjectPathId,\n 'Object ID': entry.scannedObjectId,\n ...(includeEncryptedSnippets\n ? { Entry: entry.name, 'Context Snippet': entry.contextSnippet }\n : {}),\n 'Data Category': `${entry.dataSubCategory.category}:${entry.dataSubCategory.name}`,\n 'Classification Status': entry.status,\n 'Confidence Score': entry.confidence,\n 'Classification Method': entry.classificationMethod,\n 'Classifier Version': entry.classifierVersion,\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n this.logger.error(\n colors.red(`An error occurred syncing the unstructured discovery files: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n this.logger.info(\n colors.green(`Successfully synced unstructured discovery files to disk at ${file}!`),\n );\n}\n"],"mappings":"2SAoBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,gBACA,SACA,4BAEa,CACf,EAAoB,KAAK,QAAQ,CAEjC,GAAI,CAIF,IAAM,EAAU,MAAM,EAFP,EAA4B,EAAc,EAEe,CAAE,CACxE,cACA,gBACA,SACA,2BACD,CAAC,CAEF,KAAK,OAAO,KAAK,EAAO,QAAQ,iDAAiD,EAAK,MAAM,CAAC,CAC7F,IAAI,EAAoB,EAAE,CAmB1B,MAAM,EAAc,EAlBL,EAAQ,IAAK,GAAU,CACpC,IAAM,EAAS,CACb,WAAY,EAAM,GAClB,eAAgB,EAAM,WACtB,iBAAkB,EAAM,oBACxB,YAAa,EAAM,gBACnB,GAAI,EACA,CAAE,MAAO,EAAM,KAAM,kBAAmB,EAAM,eAAgB,CAC9D,EAAE,CACN,gBAAiB,GAAG,EAAM,gBAAgB,SAAS,GAAG,EAAM,gBAAgB,OAC5E,wBAAyB,EAAM,OAC/B,mBAAoB,EAAM,WAC1B,wBAAyB,EAAM,qBAC/B,qBAAsB,EAAM,kBAC7B,CAED,MADA,GAAU,EAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GAEuB,CAAE,EAAQ,OACnC,EAAK,CACZ,KAAK,OAAO,MACV,EAAO,IAAI,+DAA+D,EAAI,UAAU,CACzF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,KAAK,OAAO,KACV,EAAO,MAAM,+DAA+D,EAAK,GAAG,CACrF"}
1
+ {"version":3,"file":"impl-DzUTmaID2.mjs","names":[],"sources":["../src/commands/inventory/pull-unstructured-discovery-files/impl.ts"],"sourcesContent":["import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { uniq } from 'lodash-es';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullUnstructuredSubDataPointRecommendations } from '../../../lib/data-inventory/index.js';\nimport { writeLargeCsv } from '../../../lib/helpers/index.js';\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);\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 this.logger.info(colors.magenta(`Writing unstructured discovery files to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = entries.map((entry) => {\n const result = {\n 'Entry ID': entry.id,\n 'Data Silo ID': entry.dataSiloId,\n 'Object Path ID': entry.scannedObjectPathId,\n 'Object ID': entry.scannedObjectId,\n ...(includeEncryptedSnippets\n ? { Entry: entry.name, 'Context Snippet': entry.contextSnippet }\n : {}),\n 'Data Category': `${entry.dataSubCategory.category}:${entry.dataSubCategory.name}`,\n 'Classification Status': entry.status,\n 'Confidence Score': entry.confidence,\n 'Classification Method': entry.classificationMethod,\n 'Classifier Version': entry.classifierVersion,\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n this.logger.error(\n colors.red(`An error occurred syncing the unstructured discovery files: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n this.logger.info(\n colors.green(`Successfully synced unstructured discovery files to disk at ${file}!`),\n );\n}\n"],"mappings":"2SAoBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,gBACA,SACA,4BAEa,CACf,EAAoB,KAAK,QAAQ,CAEjC,GAAI,CAIF,IAAM,EAAU,MAAM,EAFP,EAA4B,EAAc,EAEe,CAAE,CACxE,cACA,gBACA,SACA,2BACD,CAAC,CAEF,KAAK,OAAO,KAAK,EAAO,QAAQ,iDAAiD,EAAK,MAAM,CAAC,CAC7F,IAAI,EAAoB,EAAE,CAmB1B,MAAM,EAAc,EAlBL,EAAQ,IAAK,GAAU,CACpC,IAAM,EAAS,CACb,WAAY,EAAM,GAClB,eAAgB,EAAM,WACtB,iBAAkB,EAAM,oBACxB,YAAa,EAAM,gBACnB,GAAI,EACA,CAAE,MAAO,EAAM,KAAM,kBAAmB,EAAM,eAAgB,CAC9D,EAAE,CACN,gBAAiB,GAAG,EAAM,gBAAgB,SAAS,GAAG,EAAM,gBAAgB,OAC5E,wBAAyB,EAAM,OAC/B,mBAAoB,EAAM,WAC1B,wBAAyB,EAAM,qBAC/B,qBAAsB,EAAM,kBAC7B,CAED,MADA,GAAU,EAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GAEuB,CAAE,EAAQ,OACnC,EAAK,CACZ,KAAK,OAAO,MACV,EAAO,IAAI,+DAA+D,EAAI,UAAU,CACzF,CACD,KAAK,QAAQ,KAAK,EAAE,CAItB,KAAK,OAAO,KACV,EAAO,MAAM,+DAA+D,EAAK,GAAG,CACrF"}
@@ -1,2 +1,2 @@
1
- import{r as e}from"./constants-BG53Mbi9.mjs";import{r as t}from"./readTranscendYaml-STYnRzq-.mjs";import{n,t as r}from"./mergeTranscendInputs-CWHXH0kF.mjs";import{t as i}from"./parseVariablesFromString-Cr3x2uq3.mjs";import{t as a}from"./validateTranscendAuth-CnHMn77m.mjs";import{t as o}from"./listFiles-CWHAdKY-.mjs";import{t as s}from"./done-input-validation-Cjk7a3jX.mjs";import c from"node:path";import l from"colors";import{buildTranscendGraphQLClient as u}from"@transcend-io/sdk";import{mapSeries as d}from"@transcend-io/utils";async function f({transcendUrl:e,auth:t,pageSize:r,publishToPrivacyCenter:i,contents:a,deleteExtraAttributeValues:o=!1,classifyService:s=!1,logger:c}){let d=u(e,t);try{let e=await n(a,d,{pageSize:r,publishToPrivacyCenter:i,classifyService:s,deleteExtraAttributeValues:o,logger:c});return e.success||e.errors.forEach(({resource:e,item:t,message:n})=>{c.error(l.red(`Failed to sync ${e}${t?` "${t}"`:``}: ${n}`))}),e.success}catch(e){return c.error(l.red(`An unexpected error occurred syncing the schema: ${e.message}`)),!1}}async function p({file:n=`./transcend.yml`,transcendUrl:u,auth:p,variables:m,pageSize:h,publishToPrivacyCenter:g,classifyService:_,deleteExtraAttributeValues:v}){s(this.process);let y=await a(p,this),b=i(m),x;if(x=Array.isArray(y)&&this.fs.lstatSync(n).isDirectory()?o(this.fs.readdirSync(n)).map(e=>c.join(n,e)):n.split(`,`),x.length<1)throw Error(`No file specified!`);let S=x.map(e=>{this.fs.existsSync(e)?this.logger.info(l.magenta(`Reading file "${e}"...`)):(this.logger.error(l.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let n=t(this.fs.readFileSync(e,`utf8`),b,e);return this.logger.info(l.green(`Successfully read in "${e}"`)),{content:n,name:e.split(`/`).pop().replace(`.yml`,``)}}catch(e){this.logger.error(l.red(`The shape of your yaml file is invalid with the following errors: ${e.message}`)),this.process.exit(1)}});if(typeof y==`string`){let[t,...n]=S.map(({content:e})=>e);await f({transcendUrl:u,auth:y,contents:r(t,...n),publishToPrivacyCenter:g,deleteExtraAttributeValues:v,pageSize:h,classifyService:!!_,logger:this.logger})||(this.logger.info(l.red(`Sync encountered errors. View output above for more information, or check out ${e}`)),this.process.exit(1))}else{if(S.length!==1&&S.length!==y.length)throw Error(`Expected list of yml files to be equal to the list of API keys.Got ${S.length} YML file${S.length===1?``:`s`} and ${y.length} API key${y.length===1?``:`s`}`);let t=[];await d(y,async(e,n)=>{let r=`[${n+1}/${y.length}][${e.organizationName}] `;this.logger.info(l.magenta(`~~~\n\n${r}Attempting to push configuration...\n\n~~~`));let i=S.length===1?S[0].content:S.find(t=>t.name===e.organizationName)?.content;if(!i){this.logger.error(l.red(`${r}Failed to find transcend.yml file for organization: "${e.organizationName}".`)),t.push(e.organizationName);return}await f({transcendUrl:u,auth:e.apiKey,contents:i,pageSize:h,publishToPrivacyCenter:g,deleteExtraAttributeValues:v,classifyService:_,logger:this.logger})?this.logger.info(l.green(`${r}Successfully pushed configuration!`)):(this.logger.error(l.red(`${r}Failed to sync configuration.`)),t.push(e.organizationName))}),t.length>0&&(this.logger.info(l.red(`Sync encountered errors for "${t.join(`,`)}". View output above for more information, or check out ${e}`)),this.process.exit(1))}this.logger.info(l.green(`Successfully synced yaml file to Transcend! View at ${e}`))}export{p as push};
2
- //# sourceMappingURL=impl-Dm-Fkr392.mjs.map
1
+ import{r as e}from"./constants-X60pMfSm.mjs";import{r as t}from"./readTranscendYaml-BNn6-Ofi.mjs";import{n,t as r}from"./mergeTranscendInputs-DFQcbh8b.mjs";import{t as i}from"./parseVariablesFromString-BOSfQ4QF.mjs";import{t as a}from"./validateTranscendAuth-D6Wr1cxY.mjs";import{t as o}from"./listFiles-BdFUbX5x.mjs";import{t as s}from"./done-input-validation-BUz-aVC5.mjs";import c from"node:path";import l from"colors";import{buildTranscendGraphQLClient as u}from"@transcend-io/sdk";import{mapSeries as d}from"@transcend-io/utils";async function f({transcendUrl:e,auth:t,pageSize:r,publishToPrivacyCenter:i,contents:a,deleteExtraAttributeValues:o=!1,classifyService:s=!1,logger:c}){let d=u(e,t);try{let e=await n(a,d,{pageSize:r,publishToPrivacyCenter:i,classifyService:s,deleteExtraAttributeValues:o,logger:c});return e.success||e.errors.forEach(({resource:e,item:t,message:n})=>{c.error(l.red(`Failed to sync ${e}${t?` "${t}"`:``}: ${n}`))}),e.success}catch(e){return c.error(l.red(`An unexpected error occurred syncing the schema: ${e.message}`)),!1}}async function p({file:n=`./transcend.yml`,transcendUrl:u,auth:p,variables:m,pageSize:h,publishToPrivacyCenter:g,classifyService:_,deleteExtraAttributeValues:v}){s(this.process);let y=await a(p,this),b=i(m),x;if(x=Array.isArray(y)&&this.fs.lstatSync(n).isDirectory()?o(this.fs.readdirSync(n)).map(e=>c.join(n,e)):n.split(`,`),x.length<1)throw Error(`No file specified!`);let S=x.map(e=>{this.fs.existsSync(e)?this.logger.info(l.magenta(`Reading file "${e}"...`)):(this.logger.error(l.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let n=t(this.fs.readFileSync(e,`utf8`),b,e);return this.logger.info(l.green(`Successfully read in "${e}"`)),{content:n,name:e.split(`/`).pop().replace(`.yml`,``)}}catch(e){this.logger.error(l.red(`The shape of your yaml file is invalid with the following errors: ${e.message}`)),this.process.exit(1)}});if(typeof y==`string`){let[t,...n]=S.map(({content:e})=>e);await f({transcendUrl:u,auth:y,contents:r(t,...n),publishToPrivacyCenter:g,deleteExtraAttributeValues:v,pageSize:h,classifyService:!!_,logger:this.logger})||(this.logger.info(l.red(`Sync encountered errors. View output above for more information, or check out ${e}`)),this.process.exit(1))}else{if(S.length!==1&&S.length!==y.length)throw Error(`Expected list of yml files to be equal to the list of API keys.Got ${S.length} YML file${S.length===1?``:`s`} and ${y.length} API key${y.length===1?``:`s`}`);let t=[];await d(y,async(e,n)=>{let r=`[${n+1}/${y.length}][${e.organizationName}] `;this.logger.info(l.magenta(`~~~\n\n${r}Attempting to push configuration...\n\n~~~`));let i=S.length===1?S[0].content:S.find(t=>t.name===e.organizationName)?.content;if(!i){this.logger.error(l.red(`${r}Failed to find transcend.yml file for organization: "${e.organizationName}".`)),t.push(e.organizationName);return}await f({transcendUrl:u,auth:e.apiKey,contents:i,pageSize:h,publishToPrivacyCenter:g,deleteExtraAttributeValues:v,classifyService:_,logger:this.logger})?this.logger.info(l.green(`${r}Successfully pushed configuration!`)):(this.logger.error(l.red(`${r}Failed to sync configuration.`)),t.push(e.organizationName))}),t.length>0&&(this.logger.info(l.red(`Sync encountered errors for "${t.join(`,`)}". View output above for more information, or check out ${e}`)),this.process.exit(1))}this.logger.info(l.green(`Successfully synced yaml file to Transcend! View at ${e}`))}export{p as push};
2
+ //# sourceMappingURL=impl-IFoIxW9s.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-IFoIxW9s.mjs","names":[],"sources":["../src/commands/inventory/push/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { TranscendInput } from '../../../codecs.js';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth, filterFileNames } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { syncConfigurationToTranscend } from '../../../lib/graphql/index.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs.js';\nimport { parseTranscendYaml } from '../../../lib/readTranscendYaml.js';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n logger,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n /** Logger for reporting sync progress and errors */\n logger: LocalContext['logger'];\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const result = await syncConfigurationToTranscend(contents, client, {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n logger,\n });\n if (!result.success) {\n result.errors.forEach(({ resource, item, message }) => {\n logger.error(\n colors.red(`Failed to sync ${resource}${item ? ` \"${item}\"` : ''}: ${message}`),\n );\n });\n }\n return result.success;\n } catch (err) {\n logger.error(colors.red(`An unexpected error occurred syncing the schema: ${err.message}`));\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth, this);\n\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && this.fs.lstatSync(file).isDirectory()) {\n fileList = filterFileNames(this.fs.readdirSync(file)).map((filePath) =>\n path.join(file, filePath),\n );\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!this.fs.existsSync(filePath)) {\n this.logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n this.logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = parseTranscendYaml(\n this.fs.readFileSync(filePath, 'utf8'),\n vars,\n filePath,\n );\n this.logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n this.logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n logger: this.logger,\n });\n\n // exist with error code\n if (!success) {\n this.logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (transcendInputs.length !== 1 && transcendInputs.length !== apiKeyOrList.length) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${apiKeyOrList.length === 1 ? '' : 's'}`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n this.logger.info(\n colors.magenta(`~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`),\n );\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find((input) => input.name === apiKey.organizationName)?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n this.logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n logger: this.logger,\n });\n\n if (success) {\n this.logger.info(colors.green(`${prefix}Successfully pushed configuration!`));\n } else {\n this.logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n this.logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n this.logger.info(\n colors.green(`Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`),\n );\n}\n"],"mappings":"shBAsBA,eAAe,EAAkB,CAC/B,eACA,OACA,WACA,yBACA,WACA,6BAA6B,GAC7B,kBAAkB,GAClB,UAkBmB,CACnB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAG9D,GAAI,CACF,IAAM,E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O,oCAAoC,CAAC,EAE7E,KAAK,OAAO,MAAM,EAAO,IAAI,GAAG,EAAO,+BAA+B,CAAC,CACvE,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,KAAK,OAAO,KACV,EAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0D,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE,EAKxB,KAAK,OAAO,KACV,EAAO,MAAM,uDAAuD,IAA0B,CAC/F"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./constants-BG53Mbi9.mjs";import{t}from"./logger-9T6vva73.mjs";import{n}from"./syncCodePackages-DsC1tE8B.mjs";import{t as r}from"./done-input-validation-Cjk7a3jX.mjs";import{t as i}from"./constants-BpQ5awGp.mjs";import a from"fast-glob";import o from"colors";import{getEntries as s}from"@transcend-io/type-utils";import{buildTranscendGraphQLClient as c}from"@transcend-io/sdk";import{execSync as l}from"child_process";async function u({scanPath:e,ignoreDirs:n=[],repositoryName:r}){return(await Promise.all(s(i).map(async([i,s])=>{let{ignoreDirs:c,supportedFiles:l,scanFunction:u}=s,d=[...n,...c].filter(e=>e.length>0);try{let n=await a(`${e}/**/${l.join(`|`)}`,{ignore:d.map(t=>`${e}/**/${t}`),unique:!0,onlyFiles:!0});t.info(o.magenta(`Scanning: ${n.length} files of type ${i}`));let s=n.map(t=>u(t).map(n=>({...n,relativePath:t.replace(`${e}/`,``)}))).flat();return t.info(o.green(`Found: ${s.length} packages and ${s.map(({softwareDevelopmentKits:e=[]})=>e).flat().length} sdks`)),s.map(e=>({...e,type:i,repositoryName:r}))}catch(e){throw Error(`Error scanning globs ${l} with error: ${e}`)}}))).flat()}const d=`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 f({auth:t,scanPath:i,ignoreDirs:a,repositoryName:s,transcendUrl:f}){r(this.process);let p=s;if(!p)try{let e=l(`cd ${i} && 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||(this.logger.error(o.red(d)),this.process.exit(1))}catch(e){this.logger.error(o.red(`${d} - Got error: ${e.message}`)),this.process.exit(1)}let m=c(f,t),h=await u({scanPath:i,ignoreDirs:a,repositoryName:p});await n(m,h);let g=new URL(e);g.pathname=`/code-scanning/code-packages`,this.logger.info(o.green(`Scan found ${h.length} packages at ${i}! View results at '${g.href}'`))}export{f as scanPackages};
2
- //# sourceMappingURL=impl-BJlKQJdS2.mjs.map
1
+ import{t as e}from"./constants-X60pMfSm.mjs";import{t}from"./logger-zplFSeXU.mjs";import{n}from"./syncCodePackages-BHE2Tn1Q.mjs";import{t as r}from"./done-input-validation-BUz-aVC5.mjs";import{t as i}from"./constants-DXzsg2CQ.mjs";import a from"fast-glob";import o from"colors";import{getEntries as s}from"@transcend-io/type-utils";import{buildTranscendGraphQLClient as c}from"@transcend-io/sdk";import{execSync as l}from"child_process";async function u({scanPath:e,ignoreDirs:n=[],repositoryName:r}){return(await Promise.all(s(i).map(async([i,s])=>{let{ignoreDirs:c,supportedFiles:l,scanFunction:u}=s,d=[...n,...c].filter(e=>e.length>0);try{let n=await a(`${e}/**/${l.join(`|`)}`,{ignore:d.map(t=>`${e}/**/${t}`),unique:!0,onlyFiles:!0});t.info(o.magenta(`Scanning: ${n.length} files of type ${i}`));let s=n.map(t=>u(t).map(n=>({...n,relativePath:t.replace(`${e}/`,``)}))).flat();return t.info(o.green(`Found: ${s.length} packages and ${s.map(({softwareDevelopmentKits:e=[]})=>e).flat().length} sdks`)),s.map(e=>({...e,type:i,repositoryName:r}))}catch(e){throw Error(`Error scanning globs ${l} with error: ${e}`)}}))).flat()}const d=`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 f({auth:t,scanPath:i,ignoreDirs:a,repositoryName:s,transcendUrl:f}){r(this.process);let p=s;if(!p)try{let e=l(`cd ${i} && 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||(this.logger.error(o.red(d)),this.process.exit(1))}catch(e){this.logger.error(o.red(`${d} - Got error: ${e.message}`)),this.process.exit(1)}let m=c(f,t),h=await u({scanPath:i,ignoreDirs:a,repositoryName:p});await n(m,h);let g=new URL(e);g.pathname=`/code-scanning/code-packages`,this.logger.info(o.green(`Scan found ${h.length} packages at ${i}! View results at '${g.href}'`))}export{f as scanPackages};
2
+ //# sourceMappingURL=impl-WxoE0bN_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-WxoE0bN_.mjs","names":[],"sources":["../src/lib/code-scanning/findCodePackagesInFolder.ts","../src/commands/inventory/scan-packages/impl.ts"],"sourcesContent":["import { getEntries } from '@transcend-io/type-utils';\nimport colors from 'colors';\nimport fastGlob from 'fast-glob';\n\nimport { CodePackageInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { CODE_SCANNING_CONFIGS } from './constants.js';\n\n/**\n * Helper to scan and discovery all of the code packages within a folder\n *\n * @param options - Options\n * @returns the list of integrations\n */\nexport async function findCodePackagesInFolder({\n scanPath,\n ignoreDirs = [],\n repositoryName,\n}: {\n /** The name of the github repository reporting packages for */\n repositoryName: string;\n /** Where to look for package.json files */\n scanPath: string;\n /** The directories to ignore (excludes node_modules and serverless-build) */\n ignoreDirs?: string[];\n}): Promise<CodePackageInput[]> {\n const allCodePackages = await Promise.all(\n getEntries(CODE_SCANNING_CONFIGS).map(async ([codePackageType, config]) => {\n const { ignoreDirs: configIgnoreDirs, supportedFiles, scanFunction } = config;\n const dirsToIgnore = [...ignoreDirs, ...configIgnoreDirs].filter((dir) => dir.length > 0);\n try {\n const filesToScan: string[] = await fastGlob(`${scanPath}/**/${supportedFiles.join('|')}`, {\n ignore: dirsToIgnore.map((dir: string) => `${scanPath}/**/${dir}`),\n unique: true,\n onlyFiles: true,\n });\n logger.info(\n colors.magenta(`Scanning: ${filesToScan.length} files of type ${codePackageType}`),\n );\n const allPackages = filesToScan\n .map((filePath) =>\n scanFunction(filePath).map((result) => ({\n ...result,\n relativePath: filePath.replace(`${scanPath}/`, ''),\n })),\n )\n .flat();\n logger.info(\n colors.green(\n `Found: ${allPackages.length} packages and ${\n allPackages.map(({ softwareDevelopmentKits = [] }) => softwareDevelopmentKits).flat()\n .length\n } sdks`,\n ),\n );\n\n return allPackages.map(\n (pkg): CodePackageInput => ({\n ...pkg,\n type: codePackageType,\n repositoryName,\n }),\n );\n } catch (error) {\n throw new Error(`Error scanning globs ${supportedFiles} with error: ${error}`);\n }\n }),\n );\n\n return allCodePackages.flat();\n}\n","import { execSync } from 'child_process';\n\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport { ADMIN_DASH } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { findCodePackagesInFolder } from '../../../lib/code-scanning/index.js';\nimport { syncCodePackages } from '../../../lib/graphql/index.js';\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 { auth, scanPath, ignoreDirs, repositoryName, transcendUrl }: ScanPackagesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Ensure repository name is specified\n let gitRepositoryName = repositoryName;\n if (!gitRepositoryName) {\n try {\n const name = execSync(`cd ${scanPath} && git config --get remote.origin.url`);\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 this.logger.error(colors.red(REPO_ERROR));\n this.process.exit(1);\n }\n } catch (err) {\n this.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 this.logger.info(\n colors.green(\n `Scan found ${results.length} packages at ${scanPath}! ` + `View results at '${newUrl.href}'`,\n ),\n );\n}\n"],"mappings":"qbAcA,eAAsB,EAAyB,CAC7C,WACA,aAAa,EAAE,CACf,kBAQ8B,CA4C9B,OAAO,MA3CuB,QAAQ,IACpC,EAAW,EAAsB,CAAC,IAAI,MAAO,CAAC,EAAiB,KAAY,CACzE,GAAM,CAAE,WAAY,EAAkB,iBAAgB,gBAAiB,EACjE,EAAe,CAAC,GAAG,EAAY,GAAG,EAAiB,CAAC,OAAQ,GAAQ,EAAI,OAAS,EAAE,CACzF,GAAI,CACF,IAAM,EAAwB,MAAM,EAAS,GAAG,EAAS,MAAM,EAAe,KAAK,IAAI,GAAI,CACzF,OAAQ,EAAa,IAAK,GAAgB,GAAG,EAAS,MAAM,IAAM,CAClE,OAAQ,GACR,UAAW,GACZ,CAAC,CACF,EAAO,KACL,EAAO,QAAQ,aAAa,EAAY,OAAO,iBAAiB,IAAkB,CACnF,CACD,IAAM,EAAc,EACjB,IAAK,GACJ,EAAa,EAAS,CAAC,IAAK,IAAY,CACtC,GAAG,EACH,aAAc,EAAS,QAAQ,GAAG,EAAS,GAAI,GAAG,CACnD,EAAE,CACJ,CACA,MAAM,CAUT,OATA,EAAO,KACL,EAAO,MACL,UAAU,EAAY,OA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-input-validation-BUz-aVC5.mjs";import{h as o,n as s,p as c,r as l,t as u}from"./prompts-ClBXdELk.mjs";import{t as d}from"./missing-manifest-DgcukXfg.mjs";import{a as f,i as p,o as m}from"./deno-runtime-DV52X8-P.mjs";import{t as h}from"./project-plan-apply-Dvndx455.mjs";import{a as g,l as _,o as v,r as y,s as b,t as x,u as S}from"./scaffold-planning-CNv83t_v.mjs";import{CustomFunctionType as C}from"@transcend-io/privacy-types";import{join as w}from"node:path";import T from"colors";function E(e,t,n){return!e.json&&!e.noInteractive&&!!(t&&n)}async function D(n){let i=await n.select(`Custom Function type:`,[{name:r[C.General],value:C.General},{name:r[C.Dsr],value:C.Dsr}],C.General),a=e[i];if(a.length<2){let[e]=a;if(e===void 0)throw Error(`No Custom Function templates are defined for type ${i}.`);return e}return n.select(`Template:`,a.map(e=>({name:t[e],value:e})),a[0])}async function O(e,t){a(this.process);try{let r=f(this,{...t?{directory:t}:{},...e.manifest?{manifest:e.manifest}:{}});if(!this.fs.existsSync(r.manifestPath)){let e=this.process.cwd();throw Error(d({cwd:e,manifestPath:r.manifestPath,discoveredManifestPaths:p(this,e),command:`new`}))}let a=new s(this),u=E(e,this.process.stdin.isTTY,this.process.stderr.isTTY),C=e.name??(u?await a.text(`Custom Function display name:`,void 0,e=>{try{return n(e),!0}catch(e){return e instanceof Error?e.message:String(e)}}):void 0);if(!C)throw Error(`Missing Custom Function name. Pass --name in a non-interactive invocation.`);let O=e.template??(u?await D(a):void 0);if(!O||!i.includes(O))throw Error(`Missing Custom Function template. Pass --template=general, --template=dsr-datapoint, --template=dsr-enricher, or --template=dsr-both.`);let k=v(C,O),A=x({state:r,snapshots:l(this,r.manifestDirectory,y(r,k))},{generated:k});this.fs.existsSync(r.denoConfigPath)||A.warnings.push(`No Deno configuration was found. Run transcend custom-functions init ${m(r.targetDirectory,r.manifestPath,this.process.cwd())} --deno --noInteractive.`),e.json||this.logger.info(o(A,{cwd:this.process.cwd(),title:`Custom Function plan`,details:[{label:`Target`,path:A.targetDirectory},{label:`Manifest`,path:A.manifestPath}]}));let j=A.changes.length===0||e.dryRun;if(A.changes.length>0&&!e.dryRun)if(e.yes)j=!0;else if(u)j=await a.confirm(`Apply this complete plan?`,!0);else throw Error(`The plan requires approval in a non-interactive invocation. Review with --dryRun, then pass --yes.`);j&&!e.dryRun&&A.changes.length>0&&await h(this,A);let M=j&&!e.dryRun&&A.changes.length>0,N=r.existingSkillDirectories.some(({path:e})=>this.fs.existsSync(w(r.projectRoot,e,S,`SKILL.md`))),P=_({displayName:k.displayName,sourcePath:c(this.process.cwd(),w(r.manifestDirectory,k.sourceFile.path)),targetDirectory:c(this.process.cwd(),r.targetDirectory),manifestPath:c(this.process.cwd(),r.manifestPath),hasSkill:N,variableNames:g(k.manifestEntry)}),F=b(A,{applied:M,dryRun:e.dryRun,cwd:this.process.cwd(),aiHandoff:P});if(e.json){this.process.stdout.write(`${JSON.stringify(F)}\n`);return}if(e.dryRun){this.logger.info(T.yellow(`Dry run complete. No changes were written.`));return}if(!j){this.logger.info(T.yellow(`No changes applied.`));return}this.logger.info(T.green(`Custom Function added.`)),A.nextSteps.length>0&&(this.logger.info(`\n${T.bold(`Next steps`)}`),A.nextSteps.forEach(e=>this.logger.info(e))),this.logger.info(`\n${T.bold(`AI handoff — paste into your coding agent`)}`),this.logger.info(P)}catch(e){throw e instanceof u&&this.process.exit(130),e}}export{O as _new,O as newCustomFunction};
2
+ //# sourceMappingURL=impl-Z8oWVENM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-Z8oWVENM.mjs","names":[],"sources":["../src/commands/custom-functions/new/impl.ts"],"sourcesContent":["import { join } from 'node:path';\n\nimport { CustomFunctionType } from '@transcend-io/privacy-types';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { buildNewFunctionAiHandoff } from '../../../lib/custom-functions/ai-handoff.js';\nimport { CUSTOM_FUNCTION_SKILL_NAME } from '../../../lib/custom-functions/custom-function-skill.js';\nimport { formatMissingManifestMessage } from '../../../lib/custom-functions/missing-manifest.js';\nimport { buildCustomFunctionProjectArguments } from '../../../lib/custom-functions/paths.js';\nimport {\n discoverCustomFunctionManifests,\n discoverCustomFunctionProject,\n} from '../../../lib/custom-functions/project-discovery.js';\nimport { buildPlanResult } from '../../../lib/custom-functions/scaffold-output.js';\nimport {\n buildAddFunctionPlan,\n getAddFunctionPlanningCandidatePaths,\n parameterNamesInManifestValue,\n prepareGeneratedCustomFunction,\n} from '../../../lib/custom-functions/scaffold-planning.js';\nimport {\n CUSTOM_FUNCTION_TEMPLATE_NAMES,\n CUSTOM_FUNCTION_TEMPLATE_PROMPT_LABELS,\n CUSTOM_FUNCTION_TYPE_PROMPT_LABELS,\n TEMPLATES_FOR_CUSTOM_FUNCTION_TYPE,\n type CustomFunctionTemplateName,\n validateCustomFunctionDisplayName,\n} from '../../../lib/custom-functions/scaffold-templates.js';\nimport { collectPlanningSnapshots } from '../../../lib/scaffolding/project-discovery.js';\nimport { applyProjectPlan } from '../../../lib/scaffolding/project-plan-apply.js';\nimport {\n displayProjectPath,\n renderProjectPlan,\n} from '../../../lib/scaffolding/project-plan-output.js';\nimport { PromptCancelledError, ScaffoldPrompts } from '../../../lib/scaffolding/prompts.js';\n\n/** Flags for `custom-functions new`. */\nexport interface CustomFunctionNewFlags {\n /** Explicit existing manifest path. */\n manifest?: string;\n /** Custom Function display name. */\n name?: string;\n /** Starter handler shape. */\n template?: CustomFunctionTemplateName;\n /** Disable prompts. */\n noInteractive: boolean;\n /** Render but do not apply. */\n dryRun: boolean;\n /** Approve the final displayed plan. */\n yes: boolean;\n /** Emit one stable JSON result on stdout. */\n json: boolean;\n}\n\n/**\n * Whether this invocation can ask questions.\n *\n * @param context - CLI context\n * @param flags - Interaction flags\n * @returns Whether prompts are enabled\n */\nfunction isInteractiveInvocation(\n flags: Pick<CustomFunctionNewFlags, 'json' | 'noInteractive'>,\n stdinIsTTY: boolean | undefined,\n stderrIsTTY: boolean | undefined,\n): boolean {\n return !flags.json && !flags.noInteractive && Boolean(stdinIsTTY && stderrIsTTY);\n}\n\n/**\n * Ask for the product-level function type, then its available starter template.\n *\n * General currently has one template, so selecting it completes the choice immediately.\n *\n * @param prompts - Context-bound prompt adapter\n * @returns Selected starter template\n */\nexport async function selectInteractiveTemplate(\n prompts: Pick<ScaffoldPrompts, 'select'>,\n): Promise<CustomFunctionTemplateName> {\n const functionType = await prompts.select<CustomFunctionType>(\n 'Custom Function type:',\n [\n {\n name: CUSTOM_FUNCTION_TYPE_PROMPT_LABELS[CustomFunctionType.General],\n value: CustomFunctionType.General,\n },\n {\n name: CUSTOM_FUNCTION_TYPE_PROMPT_LABELS[CustomFunctionType.Dsr],\n value: CustomFunctionType.Dsr,\n },\n ],\n CustomFunctionType.General,\n );\n const templates = TEMPLATES_FOR_CUSTOM_FUNCTION_TYPE[functionType];\n if (templates.length < 2) {\n const [onlyTemplate] = templates;\n if (onlyTemplate === undefined) {\n throw new Error(`No Custom Function templates are defined for type ${functionType}.`);\n }\n return onlyTemplate;\n }\n return prompts.select<CustomFunctionTemplateName>(\n 'Template:',\n templates.map((value) => ({\n name: CUSTOM_FUNCTION_TEMPLATE_PROMPT_LABELS[value],\n value,\n })),\n templates[0],\n );\n}\n\n/**\n * Scaffold one deterministic local Custom Function.\n *\n * @param this - CLI context\n * @param flags - Template and interaction flags\n * @param directory - Optional target directory\n */\nexport async function _new(\n this: LocalContext,\n flags: CustomFunctionNewFlags,\n directory?: string,\n): Promise<void> {\n doneInputValidation(this.process);\n try {\n const state = discoverCustomFunctionProject(this, {\n ...(directory ? { directory } : {}),\n ...(flags.manifest ? { manifest: flags.manifest } : {}),\n });\n if (!this.fs.existsSync(state.manifestPath)) {\n const cwd = this.process.cwd();\n throw new Error(\n formatMissingManifestMessage({\n cwd,\n manifestPath: state.manifestPath,\n discoveredManifestPaths: discoverCustomFunctionManifests(this, cwd),\n command: 'new',\n }),\n );\n }\n const prompts = new ScaffoldPrompts(this);\n const interactive = isInteractiveInvocation(\n flags,\n this.process.stdin.isTTY,\n this.process.stderr.isTTY,\n );\n const name =\n flags.name ??\n (interactive\n ? await prompts.text('Custom Function display name:', undefined, (value) => {\n try {\n validateCustomFunctionDisplayName(value);\n return true;\n } catch (error) {\n return error instanceof Error ? error.message : String(error);\n }\n })\n : undefined);\n if (!name) {\n throw new Error('Missing Custom Function name. Pass --name in a non-interactive invocation.');\n }\n const template =\n flags.template ?? (interactive ? await selectInteractiveTemplate(prompts) : undefined);\n if (!template || !CUSTOM_FUNCTION_TEMPLATE_NAMES.includes(template)) {\n throw new Error(\n 'Missing Custom Function template. Pass --template=general, --template=dsr-datapoint, --template=dsr-enricher, or --template=dsr-both.',\n );\n }\n const generated = prepareGeneratedCustomFunction(name, template);\n const snapshots = collectPlanningSnapshots(\n this,\n state.manifestDirectory,\n getAddFunctionPlanningCandidatePaths(state, generated),\n );\n const plan = buildAddFunctionPlan(\n {\n state,\n snapshots,\n },\n { generated },\n );\n if (!this.fs.existsSync(state.denoConfigPath)) {\n plan.warnings.push(\n `No Deno configuration was found. Run ` +\n `transcend custom-functions init ${buildCustomFunctionProjectArguments(\n state.targetDirectory,\n state.manifestPath,\n this.process.cwd(),\n )} --deno --noInteractive.`,\n );\n }\n if (!flags.json) {\n this.logger.info(\n renderProjectPlan(plan, {\n cwd: this.process.cwd(),\n title: 'Custom Function plan',\n details: [\n { label: 'Target', path: plan.targetDirectory },\n { label: 'Manifest', path: plan.manifestPath },\n ],\n }),\n );\n }\n\n let approved = plan.changes.length === 0 || flags.dryRun;\n if (plan.changes.length > 0 && !flags.dryRun) {\n if (flags.yes) {\n approved = true;\n } else if (interactive) {\n approved = await prompts.confirm('Apply this complete plan?', true);\n } else {\n throw new Error(\n 'The plan requires approval in a non-interactive invocation. Review with --dryRun, then pass --yes.',\n );\n }\n }\n\n if (approved && !flags.dryRun && plan.changes.length > 0) {\n await applyProjectPlan(this, plan);\n }\n const applied = approved && !flags.dryRun && plan.changes.length > 0;\n const hasSkill = state.existingSkillDirectories.some(({ path }) =>\n this.fs.existsSync(join(state.projectRoot, path, CUSTOM_FUNCTION_SKILL_NAME, 'SKILL.md')),\n );\n const aiHandoff = buildNewFunctionAiHandoff({\n displayName: generated.displayName,\n sourcePath: displayProjectPath(\n this.process.cwd(),\n join(state.manifestDirectory, generated.sourceFile.path),\n ),\n targetDirectory: displayProjectPath(this.process.cwd(), state.targetDirectory),\n manifestPath: displayProjectPath(this.process.cwd(), state.manifestPath),\n hasSkill,\n variableNames: parameterNamesInManifestValue(generated.manifestEntry),\n });\n const result = buildPlanResult(plan, {\n applied,\n dryRun: flags.dryRun,\n cwd: this.process.cwd(),\n aiHandoff,\n });\n if (flags.json) {\n this.process.stdout.write(`${JSON.stringify(result)}\\n`);\n return;\n }\n if (flags.dryRun) {\n this.logger.info(colors.yellow('Dry run complete. No changes were written.'));\n return;\n }\n if (!approved) {\n this.logger.info(colors.yellow('No changes applied.'));\n return;\n }\n this.logger.info(colors.green('Custom Function added.'));\n if (plan.nextSteps.length > 0) {\n this.logger.info(`\\n${colors.bold('Next steps')}`);\n plan.nextSteps.forEach((step) => this.logger.info(step));\n }\n this.logger.info(`\\n${colors.bold('AI handoff — paste into your coding agent')}`);\n this.logger.info(aiHandoff);\n } catch (error) {\n if (error instanceof PromptCancelledError) {\n this.process.exit(130);\n }\n throw error;\n }\n}\n\nexport { _new as newCustomFunction };\n"],"mappings":"4kBA+DA,SAAS,EACP,EACA,EACA,EACS,CACT,MAAO,CAAC,EAAM,MAAQ,CAAC,EAAM,eAAiB,GAAQ,GAAc,GAWtE,eAAsB,EACpB,EACqC,CACrC,IAAM,EAAe,MAAM,EAAQ,OACjC,wBACA,CACE,CACE,KAAM,EAAmC,EAAmB,SAC5D,MAAO,EAAmB,QAC3B,CACD,CACE,KAAM,EAAmC,EAAmB,KAC5D,MAAO,EAAmB,IAC3B,CACF,CACD,EAAmB,QACpB,CACK,EAAY,EAAmC,GACrD,G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F,GAAI,EAAM,KAAM,CACd,KAAK,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,EAAO,CAAC,IAAI,CACxD,OAEF,GAAI,EAAM,OAAQ,CAChB,KAAK,OAAO,KAAK,EAAO,OAAO,6CAA6C,CAAC,CAC7E,OAEF,GAAI,CAAC,EAAU,CACb,KAAK,OAAO,KAAK,EAAO,OAAO,sBAAsB,CAAC,CACtD,OAEF,KAAK,OAAO,KAAK,EAAO,MAAM,yBAAyB,CAAC,CACpD,EAAK,UAAU,OAAS,IAC1B,KAAK,OAAO,KAAK,KAAK,EAAO,KAAK,aAAa,GAAG,CAClD,EAAK,UAAU,QAAS,GAAS,KAAK,OAAO,KAAK,EAAK,CAAC,EAE1D,KAAK,OAAO,KAAK,KAAK,EAAO,KAAK,4CAA4C,GAAG,CACjF,KAAK,OAAO,KAAK,EAAU,OACpB,EAAO,CAId,MAHI,aAAiB,GACnB,KAAK,QAAQ,KAAK,IAAI,CAElB"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./removeUnverifiedRequestIdentifiers-B9uPApVR.mjs";import{t}from"./done-input-validation-Cjk7a3jX.mjs";async function n({auth:n,transcendUrl:r,identifierNames:i,actions:a=[]}){t(this.process),await e({requestActions:a,transcendUrl:r,auth:n,identifierNames:i})}export{n as rejectUnverifiedIdentifiers};
2
- //# sourceMappingURL=impl-CHmjV-Pa.mjs.map
1
+ import{t as e}from"./removeUnverifiedRequestIdentifiers-CzEvT_WR.mjs";import{t}from"./done-input-validation-BUz-aVC5.mjs";async function n({auth:n,transcendUrl:r,identifierNames:i,actions:a=[]}){t(this.process),await e({requestActions:a,transcendUrl:r,auth:n,identifierNames:i})}export{n as rejectUnverifiedIdentifiers};
2
+ //# sourceMappingURL=impl-Z_ZuLfFK.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-CHmjV-Pa.mjs","names":[],"sources":["../src/commands/request/reject-unverified-identifiers/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { removeUnverifiedRequestIdentifiers } from '../../../lib/requests/index.js';\n\nexport interface RejectUnverifiedIdentifiersCommandFlags {\n auth: string;\n identifierNames: string[];\n actions?: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function rejectUnverifiedIdentifiers(\n this: LocalContext,\n { auth, transcendUrl, identifierNames, actions = [] }: RejectUnverifiedIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await removeUnverifiedRequestIdentifiers({\n requestActions: actions,\n transcendUrl,\n auth,\n identifierNames,\n });\n}\n"],"mappings":"0HAaA,eAAsB,EAEpB,CAAE,OAAM,eAAc,kBAAiB,UAAU,EAAE,EACpC,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAAmC,CACvC,eAAgB,EAChB,eACA,OACA,kBACD,CAAC"}
1
+ {"version":3,"file":"impl-Z_ZuLfFK.mjs","names":[],"sources":["../src/commands/request/reject-unverified-identifiers/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { removeUnverifiedRequestIdentifiers } from '../../../lib/requests/index.js';\n\nexport interface RejectUnverifiedIdentifiersCommandFlags {\n auth: string;\n identifierNames: string[];\n actions?: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function rejectUnverifiedIdentifiers(\n this: LocalContext,\n { auth, transcendUrl, identifierNames, actions = [] }: RejectUnverifiedIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await removeUnverifiedRequestIdentifiers({\n requestActions: actions,\n transcendUrl,\n auth,\n identifierNames,\n });\n}\n"],"mappings":"0HAaA,eAAsB,EAEpB,CAAE,OAAM,eAAc,kBAAiB,UAAU,EAAE,EACpC,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAAmC,CACvC,eAAgB,EAChB,eACA,OACA,kBACD,CAAC"}
@@ -1,4 +1,4 @@
1
- import{t as e}from"./constants-BG53Mbi9.mjs";import{t}from"./logger-9T6vva73.mjs";import{t as n}from"./done-input-validation-Cjk7a3jX.mjs";import{n as r}from"./constants-BpQ5awGp.mjs";import i from"fast-glob";import a from"colors";import{buildTranscendGraphQLClient as o,fetchActiveSiloDiscoPlugin as s,uploadSiloDiscoveryResults as c}from"@transcend-io/sdk";import{stringify as l}from"query-string";async function u({scanPath:e,fileGlobs:n,ignoreDirs:r,config:a}){let{ignoreDirs:o,supportedFiles:s,scanFunction:c}=a,l=n===``?s:s.concat(n.split(`,`)),d=[...r.split(`,`),...o].filter(e=>e.length>0);try{let n=await i(`${e}/**/${l.join(`|`)}`,{ignore:d.map(t=>`${e}/**/${t}`),unique:!0,onlyFiles:!0});t.info(`Scanning: ${n.length} files`);let r=n.map(e=>c(e)).flat().map(e=>e.softwareDevelopmentKits||[]).flat(),a=[...new Set(r.map(e=>e.name))];return t.info(`Found: ${a.length} unique dependencies`),a.map(t=>({name:t,resourceId:`${e}/**/${t}`,useStrictClassifier:!0}))}catch(e){throw Error(`Error scanning globs ${u} with error: ${e}`)}}async function d({scanPath:t,dataSiloId:i,auth:d,fileGlobs:f,ignoreDirs:p,transcendUrl:m}){n(this.process);let h=o(m,d),g=await s(h,{logger:this.logger,filterBy:{dataSiloId:i}}),_=r[g.dataSilo.type];_||(this.logger.error(a.red(`This plugin "${g.dataSilo.type}" is not supported for offline silo discovery.`)),this.process.exit(1));let v=await u({scanPath:t,fileGlobs:f,ignoreDirs:p,config:_});await c(h,{pluginId:g.id,results:v,logger:this.logger});let y=new URL(e);y.pathname=`/data-map/data-inventory/silo-discovery/triage`,y.search=l({filters:JSON.stringify({pluginIds:[g.id]})}),this.logger.info(a.green(`Scan found ${v.length} potential data silos at ${t}! View at '${y.href}'
1
+ import{t as e}from"./constants-X60pMfSm.mjs";import{t}from"./logger-zplFSeXU.mjs";import{t as n}from"./done-input-validation-BUz-aVC5.mjs";import{n as r}from"./constants-DXzsg2CQ.mjs";import i from"fast-glob";import a from"colors";import{buildTranscendGraphQLClient as o,fetchActiveSiloDiscoPlugin as s,uploadSiloDiscoveryResults as c}from"@transcend-io/sdk";import{stringify as l}from"query-string";async function u({scanPath:e,fileGlobs:n,ignoreDirs:r,config:a}){let{ignoreDirs:o,supportedFiles:s,scanFunction:c}=a,l=n===``?s:s.concat(n.split(`,`)),d=[...r.split(`,`),...o].filter(e=>e.length>0);try{let n=await i(`${e}/**/${l.join(`|`)}`,{ignore:d.map(t=>`${e}/**/${t}`),unique:!0,onlyFiles:!0});t.info(`Scanning: ${n.length} files`);let r=n.map(e=>c(e)).flat().map(e=>e.softwareDevelopmentKits||[]).flat(),a=[...new Set(r.map(e=>e.name))];return t.info(`Found: ${a.length} unique dependencies`),a.map(t=>({name:t,resourceId:`${e}/**/${t}`,useStrictClassifier:!0}))}catch(e){throw Error(`Error scanning globs ${u} with error: ${e}`)}}async function d({scanPath:t,dataSiloId:i,auth:d,fileGlobs:f,ignoreDirs:p,transcendUrl:m}){n(this.process);let h=o(m,d),g=await s(h,{logger:this.logger,filterBy:{dataSiloId:i}}),_=r[g.dataSilo.type];_||(this.logger.error(a.red(`This plugin "${g.dataSilo.type}" is not supported for offline silo discovery.`)),this.process.exit(1));let v=await u({scanPath:t,fileGlobs:f,ignoreDirs:p,config:_});await c(h,{pluginId:g.id,results:v,logger:this.logger});let y=new URL(e);y.pathname=`/data-map/data-inventory/silo-discovery/triage`,y.search=l({filters:JSON.stringify({pluginIds:[g.id]})}),this.logger.info(a.green(`Scan found ${v.length} potential data silos at ${t}! View at '${y.href}'
2
2
 
3
3
  NOTE: it may take 2-3 minutes for scan results to appear in the UI.`))}export{d as discoverSilos};
4
- //# sourceMappingURL=impl-BwRcpAno.mjs.map
4
+ //# sourceMappingURL=impl-_erU3Uzt2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-_erU3Uzt2.mjs","names":[],"sources":["../src/lib/code-scanning/findFilesToScan.ts","../src/commands/inventory/discover-silos/impl.ts"],"sourcesContent":["import fastGlob from 'fast-glob';\n\nimport { logger } from '../../logger.js';\nimport { CodeScanningConfig } from './types.js';\n\nexport interface SiloDiscoveryRawResults {\n /** The name of the potential data silo entry */\n name: string;\n /** A unique UUID (represents the same resource across different silo discovery runs) */\n resourceId: string;\n /** Any hosts associated with the entry */\n host?: string;\n /** Type of data silo */\n type?: string | undefined;\n}\n\n/**\n * Helper to scan for data silos in all package.json files that it can find in a directory\n *\n * @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead\n * @param options - Options\n * @returns the list of integrations\n */\nexport async function findFilesToScan({\n scanPath,\n fileGlobs,\n ignoreDirs,\n config,\n}: {\n /** Where to look for package.json files */\n scanPath: string;\n /** Globs to look for */\n fileGlobs: string;\n /** The directories to ignore (excludes node_modules and serverless-build) */\n ignoreDirs: string;\n /** Silo Discovery configuration */\n config: CodeScanningConfig;\n}): Promise<SiloDiscoveryRawResults[]> {\n const { ignoreDirs: IGNORE_DIRS, supportedFiles, scanFunction } = config;\n const globsToSupport =\n fileGlobs === '' ? supportedFiles : supportedFiles.concat(fileGlobs.split(','));\n const dirsToIgnore = [...ignoreDirs.split(','), ...IGNORE_DIRS].filter((dir) => dir.length > 0);\n try {\n const filesToScan: string[] = await fastGlob(`${scanPath}/**/${globsToSupport.join('|')}`, {\n ignore: dirsToIgnore.map((dir: string) => `${scanPath}/**/${dir}`),\n unique: true,\n onlyFiles: true,\n });\n logger.info(`Scanning: ${filesToScan.length} files`);\n const allPackages = filesToScan.map((filePath: string) => scanFunction(filePath)).flat();\n const allSdks = allPackages\n .map((appPackage) => appPackage.softwareDevelopmentKits || [])\n .flat();\n const uniqueDeps = new Set(allSdks.map((sdk) => sdk.name));\n const deps = [...uniqueDeps];\n logger.info(`Found: ${deps.length} unique dependencies`);\n return deps.map((dep) => ({\n name: dep,\n resourceId: `${scanPath}/**/${dep}`,\n useStrictClassifier: true,\n }));\n } catch (error) {\n throw new Error(`Error scanning globs ${findFilesToScan} with error: ${error}`);\n }\n}\n","import {\n buildTranscendGraphQLClient,\n fetchActiveSiloDiscoPlugin,\n uploadSiloDiscoveryResults,\n} from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { stringify } from 'query-string';\n\nimport { ADMIN_DASH } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { findFilesToScan } from '../../../lib/code-scanning/findFilesToScan.js';\nimport { SILO_DISCOVERY_CONFIGS } from '../../../lib/code-scanning/index.js';\n\nexport interface DiscoverSilosCommandFlags {\n scanPath: string;\n dataSiloId: string;\n auth: string;\n fileGlobs: string;\n ignoreDirs: string;\n transcendUrl: string;\n}\n\nexport async function discoverSilos(\n this: LocalContext,\n { scanPath, dataSiloId, auth, fileGlobs, ignoreDirs, transcendUrl }: DiscoverSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const plugin = await fetchActiveSiloDiscoPlugin(client, {\n logger: this.logger,\n filterBy: { dataSiloId },\n });\n\n const config = SILO_DISCOVERY_CONFIGS[plugin.dataSilo.type];\n if (!config) {\n this.logger.error(\n colors.red(\n `This plugin \"${plugin.dataSilo.type}\" is not supported for offline silo discovery.`,\n ),\n );\n this.process.exit(1);\n }\n\n const results = await findFilesToScan({\n scanPath,\n fileGlobs,\n ignoreDirs,\n config,\n });\n\n await uploadSiloDiscoveryResults(client, {\n pluginId: plugin.id,\n results,\n logger: this.logger,\n });\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/data-map/data-inventory/silo-discovery/triage';\n newUrl.search = stringify({\n filters: JSON.stringify({ pluginIds: [plugin.id] }),\n });\n\n // Indicate success\n this.logger.info(\n colors.green(\n `Scan found ${results.length} potential data silos at ${scanPath}! ` +\n `View at '${newUrl.href}' ` +\n '\\n\\n NOTE: it may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AgB,EAAO,SAAS,KAAK,gDACtC,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,IAAM,EAAU,MAAM,EAAgB,CACpC,WACA,YACA,aACA,SACD,CAAC,CAEF,MAAM,EAA2B,EAAQ,CACvC,SAAU,EAAO,GACjB,UACA,OAAQ,KAAK,OACd,CAAC,CAEF,IAAM,EAAS,IAAI,IAAI,EAAW,CAClC,EAAO,SAAW,iDAClB,EAAO,OAAS,EAAU,CACxB,QAAS,KAAK,UAAU,CAAE,UAAW,CAAC,EAAO,GAAG,CAAE,CAAC,CACpD,CAAC,CAGF,KAAK,OAAO,KACV,EAAO,MACL,cAAc,EAAQ,OAAO,2BAA2B,EAAS,aACnD,EAAO,KAAK;;sEAE3B,CACF"}
@@ -1,4 +1,4 @@
1
- import{t as e}from"./parseVariablesFromString-Cr3x2uq3.mjs";import{t}from"./done-input-validation-Cjk7a3jX.mjs";import{a as n,c as r,i,r as a,s as o,t as s}from"./deno-runtime-QqwBDKXX.mjs";import{t as c}from"./missing-manifest-BKj1j-jg.mjs";import{c as l,i as u,r as d,s as f}from"./manifest-DVuW_vvO.mjs";import{t as p}from"./run-captured-process-CpZBh0lG.mjs";import{t as m}from"./module-graph-DBC7ZvyA.mjs";import{CustomFunctionPayloadType as h,CustomFunctionType as g}from"@transcend-io/privacy-types";import{tmpdir as _}from"node:os";import{join as v}from"node:path";import y from"colors";import{Buffer as b}from"node:buffer";import{DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as x,DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as S,GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as C}from"@transcend-io/custom-function-types";import w from"ajv";import{stripVTControlCharacters as T}from"node:util";const E=3e4,D=1024*1024,O=v(_(),`transcend-custom-functions-deno`),k=new w({allErrors:!0,strict:!1}),A={general:k.compile(C),datapoint:k.compile(x),enricher:k.compile(S)};function j(e,t,n){let r=t,i=r.extras??{},a=i.profile,o=e.type??g.General,s=o===g.Dsr&&n!==h.RequestEnricher&&a?.identifier===`{{identifier}}`?{...a,identifier:`example-identifier`}:a,c=i.dataSilo,l=o===g.Dsr?{...i,...s?{profile:s}:{},dataSilo:{title:e.name,description:``,link:``,...c,id:e.dataSiloId??c?.id??`00000000-0000-4000-8000-000000000000`}}:s?{...i,profile:s}:i;return{...r,...Object.keys(l).length>0?{extras:l}:{},coreIdentifier:r.coreIdentifier??{value:`example-identifier`}}}function M(e,t){let n=(e.type??g.General)===g.Dsr?t.payloadType===h.RequestEnricher?A.enricher:A.datapoint:A.general;if(!n(t.payload)){let t=(n.errors??[]).map(e=>`${e.instancePath||`/`} ${e.message??`is invalid`}`).join(`; `);throw Error(`Invalid test payload for "${e.name}": ${t}`)}}function N(e,t,n={}){M(e,t);let r=e.env??{},i=Object.keys(r),a=e.allowedHosts??[];f(e);let o=n.allowNetwork?a.length===0?[`--allow-net=localhost`]:a[0]===`*`?[`--allow-net`]:[`--allow-net=${a.join(`,`)}`]:[],s=(e.type??g.General)===g.Dsr&&t.payloadType===h.RequestEnricher?`enricher`:`default`,c=`data:application/javascript;base64,${b.from(`
1
+ import{t as e}from"./parseVariablesFromString-BOSfQ4QF.mjs";import{t}from"./done-input-validation-BUz-aVC5.mjs";import{n,t as r}from"./prompts-ClBXdELk.mjs";import{t as i}from"./missing-manifest-DgcukXfg.mjs";import{a,i as o,r as s,t as c}from"./deno-runtime-DV52X8-P.mjs";import{t as l}from"./path-safety-D5Qwl40b.mjs";import{i as u,r as d,s as f}from"./manifest-BNIpO_zW.mjs";import{t as p}from"./run-captured-process-BXwWXuTh.mjs";import{t as m}from"./module-graph-Cb0g74Ft.mjs";import{CustomFunctionPayloadType as h,CustomFunctionType as g}from"@transcend-io/privacy-types";import{tmpdir as _}from"node:os";import{join as v}from"node:path";import y from"colors";import{Buffer as b}from"node:buffer";import{DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as x,DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as S,GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as C}from"@transcend-io/custom-function-types";import w from"ajv";import{stripVTControlCharacters as T}from"node:util";const E=3e4,D=1024*1024,O=v(_(),`transcend-custom-functions-deno`),k=new w({allErrors:!0,strict:!1}),A={general:k.compile(C),datapoint:k.compile(x),enricher:k.compile(S)};function j(e,t,n){let r=t,i=r.extras??{},a=i.profile,o=e.type??g.General,s=o===g.Dsr&&n!==h.RequestEnricher&&a?.identifier===`{{identifier}}`?{...a,identifier:`example-identifier`}:a,c=i.dataSilo,l=o===g.Dsr?{...i,...s?{profile:s}:{},dataSilo:{title:e.name,description:``,link:``,...c,id:e.dataSiloId??c?.id??`00000000-0000-4000-8000-000000000000`}}:s?{...i,profile:s}:i;return{...r,...Object.keys(l).length>0?{extras:l}:{},coreIdentifier:r.coreIdentifier??{value:`example-identifier`}}}function M(e,t){let n=(e.type??g.General)===g.Dsr?t.payloadType===h.RequestEnricher?A.enricher:A.datapoint:A.general;if(!n(t.payload)){let t=(n.errors??[]).map(e=>`${e.instancePath||`/`} ${e.message??`is invalid`}`).join(`; `);throw Error(`Invalid test payload for "${e.name}": ${t}`)}}function N(e,t,n={}){M(e,t);let r=e.env??{},i=Object.keys(r),a=e.allowedHosts??[];f(e);let o=n.allowNetwork?a.length===0?[`--allow-net=localhost`]:a[0]===`*`?[`--allow-net`]:[`--allow-net=${a.join(`,`)}`]:[],s=(e.type??g.General)===g.Dsr&&t.payloadType===h.RequestEnricher?`enricher`:`default`,c=`data:application/javascript;base64,${b.from(`
2
2
  const input = JSON.parse(await new Response(Deno.stdin.readable).text());
3
3
  for (const [name, value] of Object.entries(input.functionArgs.environment)) {
4
4
  Deno.env.set(name, value);
@@ -85,7 +85,7 @@ try {
85
85
  Deno.exit(1);
86
86
  }
87
87
  `).toString(`base64`)}`;return{args:[`run`,`--no-check`,`--no-prompt`,`--no-lock`,`--node-modules-dir=none`,`--vendor=false`,`--allow-read=${O}`,...i.length>0?[`--allow-env=${i.join(`,`)}`]:[],...n.denoConfigPath?[`--config=${n.denoConfigPath}`]:[`--no-config`],...o,...e.allowThirdPartyImports?[]:[`--no-remote`,`--no-npm`],c],input:JSON.stringify({base64Function:b.from(e.code).toString(`base64`),functionToRun:s,functionArgs:{environment:r,payload:j(e,t.payload,t.payloadType),nonce:`local-simulator`}}),env:{...r,DENO_DIR:O,DENO_TLS_CA_STORE:`system`,NO_COLOR:`1`},timeoutMs:e.timeoutMs&&e.timeoutMs>0?Math.min(e.timeoutMs,E):E}}function P(e){return Array.from(T(e.replace(/data:application\/(?:javascript|typescript);base64,[A-Za-z\d+/=]+/gu,`<local-module>`)).replace(/\r(?!\n)/gu,`
88
- `)).filter(e=>{let t=e.codePointAt(0);return t===9||t===10||t>=32&&t!==127&&!(t>=128&&t<=159)}).join(``)}function F(e,t={},n=!1){let r=Object.values(t).filter(e=>e.length>0).map(P).sort((e,t)=>t.length-e.length),i=P(e);if(n){let e=Math.max(0,...r.map(e=>{let t=Math.min(e.length-1,i.length);for(let n=t;n>0;--n)if(i.endsWith(e.slice(0,n)))return n;return 0}));e>0&&(i=i.slice(0,-e))}return r.reduce((e,t)=>e.split(t).join(`[REDACTED]`),i)}function I(e,t=D){let n=b.from(e);if(n.length<=t)return{output:e,truncated:!1};let r=t;for(;r>0&&(n[r]&192)==128;)--r;return{output:n.subarray(0,r).toString(`utf8`),truncated:!0}}function L(e,t){if(!t)return e.length===1?e[0]:void 0;let n=e.filter(e=>e.name===t||e.id===t);if(n.length===0)throw Error(`Custom Function "${t}" was not found in the manifest.`);if(n.length>1)throw Error(`Custom Function selector "${t}" is ambiguous. Pass its manifest ID instead.`);return n[0]}async function R(f,h){t(this.process);try{let t=r(this,{...h?{directory:h}:{},...f.manifest?{manifest:f.manifest}:{}});if(!this.fs.existsSync(t.manifestPath)){let e=this.process.cwd();throw Error(c({cwd:e,manifestPath:t.manifestPath,discoveredManifestPaths:o(this,e),command:`run`}))}let n=d(this.fs.readFileSync(t.manifestPath,`utf8`));if(n.functions.length===0)throw Error(`The Custom Function manifest does not define any functions.`);let g=!f.noInteractive&&!!(this.process.stdin.isTTY&&this.process.stderr.isTTY),_=L(n.functions,f.function);if(!_&&g){let e=await new i(this).select(`Custom Function to run:`,n.functions.map((e,t)=>({name:e.id?`${e.name} (${e.id})`:e.name,value:String(t)})),`0`);_=n.functions[Number(e)]}if(!_)throw Error(`Select a Custom Function with --function in a non-interactive invocation.`);let{config:v,sourcePath:x}=u(t.manifestPath,_,e(f.variables),e=>l(this,t.manifestDirectory,e));if(!v.testPayloads||v.testPayloads.length===0)throw Error(`Custom Function "${v.name}" has no test payloads. Add test-payload or test-payloads to its manifest entry.`);let S=this.fs.existsSync(t.denoConfigPath)?{denoConfigPath:t.denoConfigPath}:{},C=v.testPayloads.map(e=>({testPayload:e,invocation:N(v,e,{...S,allowNetwork:f.allowNetwork})})),w=await p(`deno`,[`--version`],{cwd:t.manifestDirectory},this);if(w.error?.code===`ENOENT`)throw Error(`Deno 2.x is required. Install it from ${s}`);if(w.code!==0)throw Error(`Deno was found, but its version could not be determined.`);let T=a(w.stdout);if(T.level===`error`)throw Error(T.message);T.level===`warning`&&this.logger.warn(T.message);let E=await p(`deno`,[`info`,`--json`,...S.denoConfigPath?[`--config=${S.denoConfigPath}`]:[`--no-config`],x],{cwd:t.manifestDirectory},this);if(E.code!==0)throw Error(`Could not inspect Custom Function runtime imports: ${E.stderr.trim()||`Deno exited with code ${E.code}`}`);let O=m(E.stdout);if(O.length>0)throw Error(`Custom Functions must be self-contained. Local or import-map runtime dependencies are not deployed: ${O.join(`, `)}`);this.logger.warn(y.yellow(`Local simulator: sdk.fetch calls are logged and return HTTP 200 without sending a request; KV state starts empty for each payload.`)),f.allowNetwork?this.logger.warn(y.yellow(`Network enabled: native fetch can make real requests to ${v.allowedHosts?.length?v.allowedHosts.join(`, `):`localhost`}.`)):v.allowedHosts?.length&&this.logger.warn(y.yellow(`Native network access is disabled. Pass --allowNetwork to permit calls to allowed-hosts.`));let k=!1;for(let[e,{invocation:n,testPayload:r}]of C.entries()){let i=r.payloadType??`payload ${e+1}`;this.logger.info(`\n${y.bold(`Running "${v.name}" (${i})`)}`);let a=await p(`deno`,n.args,{cwd:t.manifestDirectory,input:n.input,env:n.env,timeoutMs:n.timeoutMs,maxOutputBytes:D+Math.max(0,...Object.values(v.env??{}).map(e=>b.byteLength(e)))},this),o=v.env??{},s=I(F(a.stdout,o,a.stdoutTruncated)),c=I(F(a.stderr,o,a.stderrTruncated));if(s.output&&this.process.stdout.write(s.output.endsWith(`
88
+ `)).filter(e=>{let t=e.codePointAt(0);return t===9||t===10||t>=32&&t!==127&&!(t>=128&&t<=159)}).join(``)}function F(e,t={},n=!1){let r=Object.values(t).filter(e=>e.length>0).map(P).sort((e,t)=>t.length-e.length),i=P(e);if(n){let e=Math.max(0,...r.map(e=>{let t=Math.min(e.length-1,i.length);for(let n=t;n>0;--n)if(i.endsWith(e.slice(0,n)))return n;return 0}));e>0&&(i=i.slice(0,-e))}return r.reduce((e,t)=>e.split(t).join(`[REDACTED]`),i)}function I(e,t=D){let n=b.from(e);if(n.length<=t)return{output:e,truncated:!1};let r=t;for(;r>0&&(n[r]&192)==128;)--r;return{output:n.subarray(0,r).toString(`utf8`),truncated:!0}}function L(e,t){if(!t)return e.length===1?e[0]:void 0;let n=e.filter(e=>e.name===t||e.id===t);if(n.length===0)throw Error(`Custom Function "${t}" was not found in the manifest.`);if(n.length>1)throw Error(`Custom Function selector "${t}" is ambiguous. Pass its manifest ID instead.`);return n[0]}async function R(f,h){t(this.process);try{let t=a(this,{...h?{directory:h}:{},...f.manifest?{manifest:f.manifest}:{}});if(!this.fs.existsSync(t.manifestPath)){let e=this.process.cwd();throw Error(i({cwd:e,manifestPath:t.manifestPath,discoveredManifestPaths:o(this,e),command:`run`}))}let r=d(this.fs.readFileSync(t.manifestPath,`utf8`));if(r.functions.length===0)throw Error(`The Custom Function manifest does not define any functions.`);let g=!f.noInteractive&&!!(this.process.stdin.isTTY&&this.process.stderr.isTTY),_=L(r.functions,f.function);if(!_&&g){let e=await new n(this).select(`Custom Function to run:`,r.functions.map((e,t)=>({name:e.id?`${e.name} (${e.id})`:e.name,value:String(t)})),`0`);_=r.functions[Number(e)]}if(!_)throw Error(`Select a Custom Function with --function in a non-interactive invocation.`);let{config:v,sourcePath:x}=u(t.manifestPath,_,e(f.variables),e=>l(this,t.manifestDirectory,e));if(!v.testPayloads||v.testPayloads.length===0)throw Error(`Custom Function "${v.name}" has no test payloads. Add test-payload or test-payloads to its manifest entry.`);let S=this.fs.existsSync(t.denoConfigPath)?{denoConfigPath:t.denoConfigPath}:{},C=v.testPayloads.map(e=>({testPayload:e,invocation:N(v,e,{...S,allowNetwork:f.allowNetwork})})),w=await p(`deno`,[`--version`],{cwd:t.manifestDirectory},this);if(w.error?.code===`ENOENT`)throw Error(`Deno 2.x is required. Install it from ${c}`);if(w.code!==0)throw Error(`Deno was found, but its version could not be determined.`);let T=s(w.stdout);if(T.level===`error`)throw Error(T.message);T.level===`warning`&&this.logger.warn(T.message);let E=await p(`deno`,[`info`,`--json`,...S.denoConfigPath?[`--config=${S.denoConfigPath}`]:[`--no-config`],x],{cwd:t.manifestDirectory},this);if(E.code!==0)throw Error(`Could not inspect Custom Function runtime imports: ${E.stderr.trim()||`Deno exited with code ${E.code}`}`);let O=m(E.stdout);if(O.length>0)throw Error(`Custom Functions must be self-contained. Local or import-map runtime dependencies are not deployed: ${O.join(`, `)}`);this.logger.warn(y.yellow(`Local simulator: sdk.fetch calls are logged and return HTTP 200 without sending a request; KV state starts empty for each payload.`)),f.allowNetwork?this.logger.warn(y.yellow(`Network enabled: native fetch can make real requests to ${v.allowedHosts?.length?v.allowedHosts.join(`, `):`localhost`}.`)):v.allowedHosts?.length&&this.logger.warn(y.yellow(`Native network access is disabled. Pass --allowNetwork to permit calls to allowed-hosts.`));let k=!1;for(let[e,{invocation:n,testPayload:r}]of C.entries()){let i=r.payloadType??`payload ${e+1}`;this.logger.info(`\n${y.bold(`Running "${v.name}" (${i})`)}`);let a=await p(`deno`,n.args,{cwd:t.manifestDirectory,input:n.input,env:n.env,timeoutMs:n.timeoutMs,maxOutputBytes:D+Math.max(0,...Object.values(v.env??{}).map(e=>b.byteLength(e)))},this),o=v.env??{},s=I(F(a.stdout,o,a.stdoutTruncated)),c=I(F(a.stderr,o,a.stderrTruncated));if(s.output&&this.process.stdout.write(s.output.endsWith(`
89
89
  `)?s.output:`${s.output}\n`),c.output&&this.process.stderr.write(c.output.endsWith(`
90
- `)?c.output:`${c.output}\n`),(a.outputTruncated||s.truncated||c.truncated)&&this.logger.warn(y.yellow(`Simulator output was truncated after ${D} bytes per stream.`)),a.code===0)this.logger.info(y.green(`Passed "${v.name}" (${i})`));else{k=!0;let e=a.timedOut?`timed out after ${n.timeoutMs}ms`:a.inputError?`could not send the fixture to Deno: ${a.inputError.message}`:a.error?`could not start Deno: ${a.error.message}`:a.signal?`was terminated with ${a.signal}`:`exited with code ${a.code}`;this.logger.error(y.red(`Failed "${v.name}" (${i}): ${e}`))}}k&&(this.process.exitCode=1)}catch(e){throw e instanceof n&&this.process.exit(130),e}}export{R as run};
91
- //# sourceMappingURL=impl-m3QXCc6n.mjs.map
90
+ `)?c.output:`${c.output}\n`),(a.outputTruncated||s.truncated||c.truncated)&&this.logger.warn(y.yellow(`Simulator output was truncated after ${D} bytes per stream.`)),a.code===0)this.logger.info(y.green(`Passed "${v.name}" (${i})`));else{k=!0;let e=a.timedOut?`timed out after ${n.timeoutMs}ms`:a.inputError?`could not send the fixture to Deno: ${a.inputError.message}`:a.error?`could not start Deno: ${a.error.message}`:a.signal?`was terminated with ${a.signal}`:`exited with code ${a.code}`;this.logger.error(y.red(`Failed "${v.name}" (${i}): ${e}`))}}k&&(this.process.exitCode=1)}catch(e){throw e instanceof r&&this.process.exit(130),e}}export{R as run};
91
+ //# sourceMappingURL=impl-a_Y8bnSn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-a_Y8bnSn.mjs","names":[],"sources":["../src/lib/custom-functions/local-simulator.ts","../src/commands/custom-functions/run/impl.ts"],"sourcesContent":["import { Buffer } from 'node:buffer';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { stripVTControlCharacters } from 'node:util';\n\nimport {\n DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n} from '@transcend-io/custom-function-types';\nimport { CustomFunctionPayloadType, CustomFunctionType } from '@transcend-io/privacy-types';\nimport Ajv from 'ajv';\n\nimport { validateCustomFunctionExecutionContext } from './execution-context.js';\nimport type { CustomFunctionManifestConfig } from './manifest.js';\n\n/** Value injected when production-only identifiers are absent from a fixture. */\nexport const LOCAL_SIMULATOR_IDENTIFIER = 'example-identifier';\n\n/** Synthetic data silo used by local DSR simulations. */\nexport const LOCAL_SIMULATOR_DATA_SILO_ID = '00000000-0000-4000-8000-000000000000';\n\n/** Default local execution timeout. */\nexport const LOCAL_SIMULATOR_TIMEOUT_MS = 30_000;\n\n/** Maximum stdout and stderr retained from one local invocation. */\nexport const LOCAL_SIMULATOR_MAX_OUTPUT_BYTES = 1024 * 1024;\n\n/** Isolated dependency cache readable by simulated functions. */\nexport const LOCAL_SIMULATOR_DENO_DIR = join(tmpdir(), 'transcend-custom-functions-deno');\n\nconst ajv = new Ajv({ allErrors: true, strict: false });\nconst payloadValidators = {\n general: ajv.compile(GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n datapoint: ajv.compile(DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n enricher: ajv.compile(DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n};\n\n/** Complete local Deno process invocation. */\nexport interface LocalSimulatorInvocation {\n /** Deno CLI arguments. */\n args: string[];\n /** JSON sent privately over stdin. */\n input: string;\n /** Minimal environment exposed to the process. */\n env: NodeJS.ProcessEnv;\n /** Maximum execution time. */\n timeoutMs: number;\n}\n\n/**\n * Runtime wrapper modeled after Sombra's Deno executor.\n *\n * The local SDK intentionally simulates customer-ingress calls rather than\n * sending authenticated requests. Native fetch remains governed by Deno's\n * allow-net permissions.\n */\nconst LOCAL_SIMULATOR_SOURCE = `\nconst input = JSON.parse(await new Response(Deno.stdin.readable).text());\nfor (const [name, value] of Object.entries(input.functionArgs.environment)) {\n Deno.env.set(name, value);\n}\n\nclass KV {\n constructor() {\n this.store = {};\n }\n\n get(key) {\n return Promise.resolve(key in this.store ? this.store[key] : null);\n }\n\n async set(key, value) {\n if (typeof value !== 'string') throw new Error('Value must be of type string');\n if (value.length > 2048) throw new Error('Cannot store value greater than 2048 bytes');\n if (key.length > 128) throw new Error('Key length cannot be greater than 128 bytes');\n if (!(key in this.store) && Object.keys(this.store).length >= 128) {\n throw new Error('Maximum number of keys allowed is 128');\n }\n this.store[key] = value;\n }\n\n keys() {\n return Promise.resolve(Object.keys(this.store));\n }\n\n has(key) {\n return Promise.resolve(key in this.store);\n }\n\n async del(key) {\n if (!(key in this.store)) return false;\n delete this.store[key];\n return true;\n }\n}\n\nclass SDK {\n constructor(nonce) {\n this.transcendNonce = nonce;\n this.customerIngressBaseUrl = 'local://customer-ingress';\n }\n\n nonce() {\n return this.transcendNonce;\n }\n\n setCustomerIngressUrl(newUrl) {\n this.customerIngressBaseUrl = newUrl;\n }\n\n async ping() {\n await this.fetch('/test', { method: 'GET' });\n }\n\n fetch(path, options = {}) {\n const method = options.method ?? 'GET';\n console.warn(\n \\`[simulator] sdk.fetch \\${method} \\${path} -> HTTP 200 (request not sent)\\`,\n );\n return Promise.resolve(new Response(null, { status: 200, statusText: 'OK' }));\n }\n}\n\ntry {\n const custom = await import(\n \\`data:application/typescript;base64,\\${input.base64Function}\\`\n );\n if (!(input.functionToRun in custom)) {\n throw new Error(\n \\`Custom Function does not export \"\\${input.functionToRun}\" for this payload\\`,\n );\n }\n await custom[input.functionToRun]({\n ...input.functionArgs,\n sdk: new SDK(input.functionArgs.nonce),\n kv: new KV(),\n });\n Deno.exit(0);\n} catch (error) {\n console.error(error);\n Deno.exit(1);\n}\n`;\n\n/**\n * Add values that Sombra normally injects into test payloads.\n *\n * @param config - Selected manifest function\n * @param payload - Parsed test fixture\n * @param payloadType - Optional DSR export selector\n * @returns Prepared local handler payload\n */\nexport function prepareLocalSimulatorPayload(\n config: Pick<CustomFunctionManifestConfig, 'dataSiloId' | 'name' | 'type'>,\n payload: object,\n payloadType?: CustomFunctionPayloadType,\n): object {\n const record = payload as {\n /** Runtime core identifier. */\n coreIdentifier?: { value: string };\n /** DSR metadata. */\n extras?: Record<string, unknown>;\n };\n const extras = record.extras ?? {};\n const profile = extras['profile'] as { identifier?: unknown } | undefined;\n const type = config.type ?? CustomFunctionType.General;\n const isDataPoint =\n type === CustomFunctionType.Dsr && payloadType !== CustomFunctionPayloadType.RequestEnricher;\n const preparedProfile =\n isDataPoint && profile?.identifier === '{{identifier}}'\n ? { ...profile, identifier: LOCAL_SIMULATOR_IDENTIFIER }\n : profile;\n const dataSilo = extras['dataSilo'] as Record<string, unknown> | undefined;\n const preparedExtras =\n type === CustomFunctionType.Dsr\n ? {\n ...extras,\n ...(preparedProfile ? { profile: preparedProfile } : {}),\n dataSilo: {\n title: config.name,\n description: '',\n link: '',\n ...dataSilo,\n id: config.dataSiloId ?? dataSilo?.['id'] ?? LOCAL_SIMULATOR_DATA_SILO_ID,\n },\n }\n : preparedProfile\n ? { ...extras, profile: preparedProfile }\n : extras;\n return {\n ...record,\n ...(Object.keys(preparedExtras).length > 0 ? { extras: preparedExtras } : {}),\n coreIdentifier: record.coreIdentifier ?? { value: LOCAL_SIMULATOR_IDENTIFIER },\n };\n}\n\n/**\n * Validate a fixture with the same published schemas used by `check`.\n *\n * @param config - Selected manifest function\n * @param testPayload - Fixture and optional DSR export selector\n */\nfunction validateLocalSimulatorPayload(\n config: CustomFunctionManifestConfig,\n testPayload: NonNullable<CustomFunctionManifestConfig['testPayloads']>[number],\n): void {\n const type = config.type ?? CustomFunctionType.General;\n const validate =\n type !== CustomFunctionType.Dsr\n ? payloadValidators.general\n : testPayload.payloadType === CustomFunctionPayloadType.RequestEnricher\n ? payloadValidators.enricher\n : payloadValidators.datapoint;\n if (!validate(testPayload.payload)) {\n const details = (validate.errors ?? [])\n .map((error) => `${error.instancePath || '/'} ${error.message ?? 'is invalid'}`)\n .join('; ');\n throw new Error(`Invalid test payload for \"${config.name}\": ${details}`);\n }\n}\n\n/**\n * Build one constrained Deno invocation for a test fixture.\n *\n * @param config - Selected manifest function\n * @param testPayload - Fixture and optional DSR export selector\n * @param options - Discovered Deno configuration\n * @returns Process arguments, input, environment, and timeout\n */\nexport function buildLocalSimulatorInvocation(\n config: CustomFunctionManifestConfig,\n testPayload: NonNullable<CustomFunctionManifestConfig['testPayloads']>[number],\n options: {\n /** Existing deno.json or deno.jsonc path. */\n denoConfigPath?: string;\n /** Permit real native fetch calls to manifest allowed hosts. */\n allowNetwork?: boolean;\n } = {},\n): LocalSimulatorInvocation {\n validateLocalSimulatorPayload(config, testPayload);\n const environment = config.env ?? {};\n const envNames = Object.keys(environment);\n const allowedHosts = config.allowedHosts ?? [];\n validateCustomFunctionExecutionContext(config);\n const allowNetArgs = options.allowNetwork\n ? allowedHosts.length === 0\n ? ['--allow-net=localhost']\n : allowedHosts[0] === '*'\n ? ['--allow-net']\n : [`--allow-net=${allowedHosts.join(',')}`]\n : [];\n const type = config.type ?? CustomFunctionType.General;\n const functionToRun =\n type === CustomFunctionType.Dsr &&\n testPayload.payloadType === CustomFunctionPayloadType.RequestEnricher\n ? 'enricher'\n : 'default';\n const runnerUrl = `data:application/javascript;base64,${Buffer.from(\n LOCAL_SIMULATOR_SOURCE,\n ).toString('base64')}`;\n const args = [\n 'run',\n '--no-check',\n '--no-prompt',\n '--no-lock',\n '--node-modules-dir=none',\n '--vendor=false',\n `--allow-read=${LOCAL_SIMULATOR_DENO_DIR}`,\n ...(envNames.length > 0 ? [`--allow-env=${envNames.join(',')}`] : []),\n ...(options.denoConfigPath ? [`--config=${options.denoConfigPath}`] : ['--no-config']),\n ...allowNetArgs,\n ...(config.allowThirdPartyImports ? [] : ['--no-remote', '--no-npm']),\n runnerUrl,\n ];\n return {\n args,\n input: JSON.stringify({\n base64Function: Buffer.from(config.code).toString('base64'),\n functionToRun,\n functionArgs: {\n environment,\n payload: prepareLocalSimulatorPayload(config, testPayload.payload, testPayload.payloadType),\n nonce: 'local-simulator',\n },\n }),\n env: {\n ...environment,\n DENO_DIR: LOCAL_SIMULATOR_DENO_DIR,\n DENO_TLS_CA_STORE: 'system',\n NO_COLOR: '1',\n },\n timeoutMs:\n config.timeoutMs && config.timeoutMs > 0\n ? Math.min(config.timeoutMs, LOCAL_SIMULATOR_TIMEOUT_MS)\n : LOCAL_SIMULATOR_TIMEOUT_MS,\n };\n}\n\n/**\n * Remove terminal controls and opaque data URLs from local output.\n *\n * @param value - Untrusted terminal text\n * @returns Plain printable text\n */\nfunction sanitizeLocalSimulatorText(value: string): string {\n return Array.from(\n stripVTControlCharacters(\n value.replace(\n /data:application\\/(?:javascript|typescript);base64,[A-Za-z\\d+/=]+/gu,\n '<local-module>',\n ),\n ).replace(/\\r(?!\\n)/gu, '\\n'),\n )\n .filter((character) => {\n const code = character.codePointAt(0)!;\n return (\n code === 9 || code === 10 || (code >= 32 && code !== 127 && !(code >= 128 && code <= 159))\n );\n })\n .join('');\n}\n\n/**\n * Redact configured environment values from captured local output.\n *\n * @param output - Captured stdout or stderr\n * @param environment - User-defined environment\n * @param sourceTruncated - Whether capture stopped before the stream ended\n * @returns Redacted output\n */\nexport function redactLocalSimulatorOutput(\n output: string,\n environment: Record<string, string> = {},\n sourceTruncated = false,\n): string {\n const values = Object.values(environment)\n .filter((value) => value.length > 0)\n .map(sanitizeLocalSimulatorText)\n .sort((left, right) => right.length - left.length);\n let sanitized = sanitizeLocalSimulatorText(output);\n if (sourceTruncated) {\n const trailingFragmentLength = Math.max(\n 0,\n ...values.map((value) => {\n const maximum = Math.min(value.length - 1, sanitized.length);\n for (let length = maximum; length > 0; length -= 1) {\n if (sanitized.endsWith(value.slice(0, length))) {\n return length;\n }\n }\n return 0;\n }),\n );\n if (trailingFragmentLength > 0) {\n sanitized = sanitized.slice(0, -trailingFragmentLength);\n }\n }\n return values.reduce((redacted, value) => redacted.split(value).join('[REDACTED]'), sanitized);\n}\n\n/**\n * Truncate sanitized output without splitting a UTF-8 code point.\n *\n * @param output - Sanitized and redacted output\n * @param maxBytes - Maximum output size\n * @returns Bounded output and whether truncation occurred\n */\nexport function truncateLocalSimulatorOutput(\n output: string,\n maxBytes = LOCAL_SIMULATOR_MAX_OUTPUT_BYTES,\n): { output: string; truncated: boolean } {\n const bytes = Buffer.from(output);\n if (bytes.length <= maxBytes) {\n return { output, truncated: false };\n }\n let end = maxBytes;\n while (end > 0 && (bytes[end]! & 0b1100_0000) === 0b1000_0000) {\n end -= 1;\n }\n return {\n output: bytes.subarray(0, end).toString('utf8'),\n truncated: true,\n };\n}\n","import { Buffer } from 'node:buffer';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { runCapturedProcess } from '../../../lib/cli/run-captured-process.js';\nimport {\n DENO_INSTALL_URL,\n getDenoRuntimeCompatibility,\n SUPPORTED_DENO_MAJOR_VERSION,\n} from '../../../lib/custom-functions/deno-runtime.js';\nimport {\n buildLocalSimulatorInvocation,\n LOCAL_SIMULATOR_MAX_OUTPUT_BYTES,\n redactLocalSimulatorOutput,\n truncateLocalSimulatorOutput,\n} from '../../../lib/custom-functions/local-simulator.js';\nimport {\n parseCustomFunctionsManifest,\n readCustomFunctionManifestEntry,\n type CustomFunctionManifestEntry,\n} from '../../../lib/custom-functions/manifest.js';\nimport { formatMissingManifestMessage } from '../../../lib/custom-functions/missing-manifest.js';\nimport { findNonSelfContainedRuntimeImports } from '../../../lib/custom-functions/module-graph.js';\nimport {\n discoverCustomFunctionManifests,\n discoverCustomFunctionProject,\n} from '../../../lib/custom-functions/project-discovery.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { assertPathPhysicallyContained } from '../../../lib/scaffolding/path-safety.js';\nimport { PromptCancelledError, ScaffoldPrompts } from '../../../lib/scaffolding/prompts.js';\n\n/** Flags accepted by `transcend custom-functions run`. */\nexport interface CustomFunctionRunFlags {\n /** Explicit manifest path. */\n manifest?: string;\n /** Exact function name. */\n function?: string;\n /** Manifest variable substitutions. */\n variables: string;\n /** Disable prompts. */\n noInteractive: boolean;\n /** Permit native network calls to allowed hosts. */\n allowNetwork: boolean;\n}\n\n/**\n * Select one function by exact name or ID.\n *\n * @param configs - Hydrated manifest functions\n * @param selector - Optional exact name or ID\n * @returns Selected function, or undefined when interactive selection is needed\n */\nfunction selectNamedFunction<Config extends Pick<CustomFunctionManifestEntry, 'id' | 'name'>>(\n configs: readonly Config[],\n selector: string | undefined,\n): Config | undefined {\n if (!selector) {\n return configs.length === 1 ? configs[0] : undefined;\n }\n const matches = configs.filter((config) => config.name === selector || config.id === selector);\n if (matches.length === 0) {\n throw new Error(`Custom Function \"${selector}\" was not found in the manifest.`);\n }\n if (matches.length > 1) {\n throw new Error(\n `Custom Function selector \"${selector}\" is ambiguous. Pass its manifest ID instead.`,\n );\n }\n return matches[0];\n}\n\n/**\n * Run one manifest function in the credential-free local Deno simulator.\n *\n * @param this - CLI context\n * @param flags - Selection and manifest flags\n * @param directory - Optional project directory\n */\nexport async function run(\n this: LocalContext,\n flags: CustomFunctionRunFlags,\n directory?: string,\n): Promise<void> {\n doneInputValidation(this.process);\n try {\n const state = discoverCustomFunctionProject(this, {\n ...(directory ? { directory } : {}),\n ...(flags.manifest ? { manifest: flags.manifest } : {}),\n });\n if (!this.fs.existsSync(state.manifestPath)) {\n const cwd = this.process.cwd();\n throw new Error(\n formatMissingManifestMessage({\n cwd,\n manifestPath: state.manifestPath,\n discoveredManifestPaths: discoverCustomFunctionManifests(this, cwd),\n command: 'run',\n }),\n );\n }\n\n const parsedManifest = parseCustomFunctionsManifest(\n this.fs.readFileSync(state.manifestPath, 'utf8'),\n );\n if (parsedManifest.functions.length === 0) {\n throw new Error('The Custom Function manifest does not define any functions.');\n }\n const interactive =\n !flags.noInteractive && Boolean(this.process.stdin.isTTY && this.process.stderr.isTTY);\n let selectedEntry = selectNamedFunction(parsedManifest.functions, flags.function);\n if (!selectedEntry && interactive) {\n const prompts = new ScaffoldPrompts(this);\n const selectedIndex = await prompts.select(\n 'Custom Function to run:',\n parsedManifest.functions.map((entry, index) => ({\n name: entry.id ? `${entry.name} (${entry.id})` : entry.name,\n value: String(index),\n })),\n '0',\n );\n selectedEntry = parsedManifest.functions[Number(selectedIndex)];\n }\n if (!selectedEntry) {\n throw new Error('Select a Custom Function with --function in a non-interactive invocation.');\n }\n const { config: selected, sourcePath } = readCustomFunctionManifestEntry(\n state.manifestPath,\n selectedEntry,\n parseVariablesFromString(flags.variables),\n (path) => assertPathPhysicallyContained(this, state.manifestDirectory, path),\n );\n if (!selected.testPayloads || selected.testPayloads.length === 0) {\n throw new Error(\n `Custom Function \"${selected.name}\" has no test payloads. Add test-payload or test-payloads to its manifest entry.`,\n );\n }\n const denoConfig = this.fs.existsSync(state.denoConfigPath)\n ? { denoConfigPath: state.denoConfigPath }\n : {};\n const simulations = selected.testPayloads.map((testPayload) => ({\n testPayload,\n invocation: buildLocalSimulatorInvocation(selected, testPayload, {\n ...denoConfig,\n allowNetwork: flags.allowNetwork,\n }),\n }));\n\n const denoVersion = await runCapturedProcess(\n 'deno',\n ['--version'],\n { cwd: state.manifestDirectory },\n this,\n );\n if (denoVersion.error?.code === 'ENOENT') {\n throw new Error(\n `Deno ${SUPPORTED_DENO_MAJOR_VERSION}.x is required. Install it from ${DENO_INSTALL_URL}`,\n );\n }\n if (denoVersion.code !== 0) {\n throw new Error('Deno was found, but its version could not be determined.');\n }\n const compatibility = getDenoRuntimeCompatibility(denoVersion.stdout);\n if (compatibility.level === 'error') {\n throw new Error(compatibility.message);\n }\n if (compatibility.level === 'warning') {\n this.logger.warn(compatibility.message);\n }\n const moduleGraph = await runCapturedProcess(\n 'deno',\n [\n 'info',\n '--json',\n ...(denoConfig.denoConfigPath\n ? [`--config=${denoConfig.denoConfigPath}`]\n : ['--no-config']),\n sourcePath,\n ],\n { cwd: state.manifestDirectory },\n this,\n );\n if (moduleGraph.code !== 0) {\n throw new Error(\n `Could not inspect Custom Function runtime imports: ${\n moduleGraph.stderr.trim() || `Deno exited with code ${moduleGraph.code}`\n }`,\n );\n }\n const unsupportedImports = findNonSelfContainedRuntimeImports(moduleGraph.stdout);\n if (unsupportedImports.length > 0) {\n throw new Error(\n `Custom Functions must be self-contained. Local or import-map runtime dependencies are not deployed: ${unsupportedImports.join(\n ', ',\n )}`,\n );\n }\n\n this.logger.warn(\n colors.yellow(\n 'Local simulator: sdk.fetch calls are logged and return HTTP 200 without sending a request; KV state starts empty for each payload.',\n ),\n );\n if (flags.allowNetwork) {\n this.logger.warn(\n colors.yellow(\n `Network enabled: native fetch can make real requests to ${\n selected.allowedHosts?.length ? selected.allowedHosts.join(', ') : 'localhost'\n }.`,\n ),\n );\n } else if (selected.allowedHosts?.length) {\n this.logger.warn(\n colors.yellow(\n 'Native network access is disabled. Pass --allowNetwork to permit calls to allowed-hosts.',\n ),\n );\n }\n let failed = false;\n for (const [index, { invocation, testPayload }] of simulations.entries()) {\n const label = testPayload.payloadType ?? `payload ${index + 1}`;\n this.logger.info(`\\n${colors.bold(`Running \"${selected.name}\" (${label})`)}`);\n const result = await runCapturedProcess(\n 'deno',\n invocation.args,\n {\n cwd: state.manifestDirectory,\n input: invocation.input,\n env: invocation.env,\n timeoutMs: invocation.timeoutMs,\n maxOutputBytes:\n LOCAL_SIMULATOR_MAX_OUTPUT_BYTES +\n Math.max(\n 0,\n ...Object.values(selected.env ?? {}).map((value) => Buffer.byteLength(value)),\n ),\n },\n this,\n );\n const environment = selected.env ?? {};\n const stdout = truncateLocalSimulatorOutput(\n redactLocalSimulatorOutput(result.stdout, environment, result.stdoutTruncated),\n );\n const stderr = truncateLocalSimulatorOutput(\n redactLocalSimulatorOutput(result.stderr, environment, result.stderrTruncated),\n );\n if (stdout.output) {\n this.process.stdout.write(\n stdout.output.endsWith('\\n') ? stdout.output : `${stdout.output}\\n`,\n );\n }\n if (stderr.output) {\n this.process.stderr.write(\n stderr.output.endsWith('\\n') ? stderr.output : `${stderr.output}\\n`,\n );\n }\n if (result.outputTruncated || stdout.truncated || stderr.truncated) {\n this.logger.warn(\n colors.yellow(\n `Simulator output was truncated after ${LOCAL_SIMULATOR_MAX_OUTPUT_BYTES} bytes per stream.`,\n ),\n );\n }\n if (result.code === 0) {\n this.logger.info(colors.green(`Passed \"${selected.name}\" (${label})`));\n } else {\n failed = true;\n const detail = result.timedOut\n ? `timed out after ${invocation.timeoutMs}ms`\n : result.inputError\n ? `could not send the fixture to Deno: ${result.inputError.message}`\n : result.error\n ? `could not start Deno: ${result.error.message}`\n : result.signal\n ? `was terminated with ${result.signal}`\n : `exited with code ${result.code}`;\n this.logger.error(colors.red(`Failed \"${selected.name}\" (${label}): ${detail}`));\n }\n }\n if (failed) {\n this.process.exitCode = 1;\n }\n } catch (error) {\n if (error instanceof PromptCancelledError) {\n this.process.exit(130);\n }\n throw error;\n }\n}\n"],"mappings":"+8BAiBA,MAMa,EAA6B,IAG7B,EAAmC,KAAO,KAG1C,EAA2B,EAAK,GAAQ,CAAE,kCAAkC,CAEnF,EAAM,IAAI,EAAI,CAAE,UAAW,GAAM,OAAQ,GAAO,CAAC,CACjD,EAAoB,CACxB,QAAS,EAAI,QAAQ,EAAuC,CAC5D,UAAW,EAAI,QAAQ,EAA6C,CACpE,SAAU,EAAI,QAAQ,EAAoD,CAC3E,CAqHD,SAAgB,EACd,EACA,EACA,EACQ,CACR,IAAM,EAA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W,EAAS,KAAK,KAAK,EAAM,KAAK,IAAS,CAAC,EAGhF,IACF,KAAK,QAAQ,SAAW,SAEnB,EAAO,CAId,MAHI,aAAiB,GACnB,KAAK,QAAQ,KAAK,IAAI,CAElB"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./readCsv-Cr_1t8F5.mjs";import{r as t}from"./uploadConsents-CNyuYx0o.mjs";import{t as n}from"./done-input-validation-Cjk7a3jX.mjs";import*as r from"io-ts";const i=r.intersection([r.type({userId:r.string,timestamp:r.string}),r.partial({confirmed:r.union([r.literal(`true`),r.literal(`false`)]),updated:r.union([r.literal(`true`),r.literal(`false`)]),prompted:r.union([r.literal(`true`),r.literal(`false`)]),metadata:r.string,usp:r.union([r.string,r.null]),gpp:r.union([r.string,r.null]),purposes:r.string})]);async function a({base64EncryptionKey:r,base64SigningKey:a,partition:o,file:s,consentUrl:c,concurrency:l}){n(this.process),await t({base64EncryptionKey:r,base64SigningKey:a,preferences:e(this.fs.readFileSync(s,`utf8`),i),partition:o,concurrency:l,transcendUrl:c})}export{a as uploadConsentPreferences};
2
- //# sourceMappingURL=impl-BewF8tB6.mjs.map
1
+ import{t as e}from"./readCsv-DLg8pwjd.mjs";import{r as t}from"./uploadConsents-BrWpoV6_.mjs";import{t as n}from"./done-input-validation-BUz-aVC5.mjs";import*as r from"io-ts";const i=r.intersection([r.type({userId:r.string,timestamp:r.string}),r.partial({confirmed:r.union([r.literal(`true`),r.literal(`false`)]),updated:r.union([r.literal(`true`),r.literal(`false`)]),prompted:r.union([r.literal(`true`),r.literal(`false`)]),metadata:r.string,usp:r.union([r.string,r.null]),gpp:r.union([r.string,r.null]),purposes:r.string})]);async function a({base64EncryptionKey:r,base64SigningKey:a,partition:o,file:s,consentUrl:c,concurrency:l}){n(this.process),await t({base64EncryptionKey:r,base64SigningKey:a,preferences:e(this.fs.readFileSync(s,`utf8`),i),partition:o,concurrency:l,transcendUrl:c})}export{a as uploadConsentPreferences};
2
+ //# sourceMappingURL=impl-dXDmiiG6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BewF8tB6.mjs","names":[],"sources":["../src/lib/consent-manager/types.ts","../src/commands/consent/upload-consent-preferences/impl.ts"],"sourcesContent":["import * as t from 'io-ts';\n\nexport const ConsentPreferenceUpload = t.intersection([\n t.type({\n /** User ID */\n userId: t.string,\n /** Has the consent been updated (including no-change confirmation) since default resolution */\n timestamp: t.string,\n }),\n t.partial({\n /** Was tracking consent confirmed by the user? If this is false, the consent was resolved from defaults & is not yet confirmed */\n confirmed: t.union([t.literal('true'), t.literal('false')]),\n /**\n * Has the consent been updated (including no-change confirmation) since default resolution\n */\n updated: t.union([t.literal('true'), t.literal('false')]),\n /**\n * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js)\n */\n prompted: t.union([t.literal('true'), t.literal('false')]),\n /** Consent metadata */\n metadata: t.string,\n /** US Privacy (USP) String */\n usp: t.union([t.string, t.null]),\n /** IAB GPP String */\n gpp: t.union([t.string, t.null]),\n /**\n * Purpose map\n * This is a stringified JSON object with keys as purpose names and values as booleans or 'Auto'\n */\n purposes: t.string,\n }),\n]);\n\n/** Type override */\nexport type ConsentPreferenceUpload = t.TypeOf<typeof ConsentPreferenceUpload>;\n","import type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { ConsentPreferenceUpload } from '../../../lib/consent-manager/types.js';\nimport { uploadConsents } from '../../../lib/consent-manager/uploadConsents.js';\nimport { parseCsv } from '../../../lib/requests/readCsv.js';\n\nexport interface UploadConsentPreferencesCommandFlags {\n base64EncryptionKey: string;\n base64SigningKey: string;\n partition: string;\n file: string;\n consentUrl: string;\n concurrency: number;\n}\n\nexport async function uploadConsentPreferences(\n this: LocalContext,\n {\n base64EncryptionKey,\n base64SigningKey,\n partition,\n file,\n consentUrl,\n concurrency,\n }: UploadConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Load in preferences from csv\n const preferences = parseCsv(this.fs.readFileSync(file, 'utf8'), ConsentPreferenceUpload);\n\n // Upload cookies\n await uploadConsents({\n base64EncryptionKey,\n base64SigningKey,\n preferences,\n partition,\n concurrency,\n transcendUrl: consentUrl,\n });\n}\n"],"mappings":"8KAEA,MAAa,EAA0B,EAAE,aAAa,CACpD,EAAE,KAAK,CAEL,OAAQ,EAAE,OAEV,UAAW,EAAE,OACd,CAAC,CACF,EAAE,QAAQ,CAER,UAAW,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAI3D,QAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAIzD,SAAU,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAE1D,SAAU,EAAE,OAEZ,IAAK,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,KAAK,CAAC,CAEhC,IAAK,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,KAAK,CAAC,CAKhC,SAAU,EAAE,OACb,CAAC,CACH,CAAC,CCjBF,eAAsB,EAEpB,CACE,sBACA,mBACA,YACA,OACA,aACA,eAEa,CACf,EAAoB,KAAK,QAAQ,CAMjC,MAAM,EAAe,CACnB,sBACA,mBACA,YANkB,EAAS,KAAK,GAAG,aAAa,EAAM,OAAO,CAAE,EAMpD,CACX,YACA,cACA,aAAc,EACf,CAAC"}
1
+ {"version":3,"file":"impl-dXDmiiG6.mjs","names":[],"sources":["../src/lib/consent-manager/types.ts","../src/commands/consent/upload-consent-preferences/impl.ts"],"sourcesContent":["import * as t from 'io-ts';\n\nexport const ConsentPreferenceUpload = t.intersection([\n t.type({\n /** User ID */\n userId: t.string,\n /** Has the consent been updated (including no-change confirmation) since default resolution */\n timestamp: t.string,\n }),\n t.partial({\n /** Was tracking consent confirmed by the user? If this is false, the consent was resolved from defaults & is not yet confirmed */\n confirmed: t.union([t.literal('true'), t.literal('false')]),\n /**\n * Has the consent been updated (including no-change confirmation) since default resolution\n */\n updated: t.union([t.literal('true'), t.literal('false')]),\n /**\n * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js)\n */\n prompted: t.union([t.literal('true'), t.literal('false')]),\n /** Consent metadata */\n metadata: t.string,\n /** US Privacy (USP) String */\n usp: t.union([t.string, t.null]),\n /** IAB GPP String */\n gpp: t.union([t.string, t.null]),\n /**\n * Purpose map\n * This is a stringified JSON object with keys as purpose names and values as booleans or 'Auto'\n */\n purposes: t.string,\n }),\n]);\n\n/** Type override */\nexport type ConsentPreferenceUpload = t.TypeOf<typeof ConsentPreferenceUpload>;\n","import type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { ConsentPreferenceUpload } from '../../../lib/consent-manager/types.js';\nimport { uploadConsents } from '../../../lib/consent-manager/uploadConsents.js';\nimport { parseCsv } from '../../../lib/requests/readCsv.js';\n\nexport interface UploadConsentPreferencesCommandFlags {\n base64EncryptionKey: string;\n base64SigningKey: string;\n partition: string;\n file: string;\n consentUrl: string;\n concurrency: number;\n}\n\nexport async function uploadConsentPreferences(\n this: LocalContext,\n {\n base64EncryptionKey,\n base64SigningKey,\n partition,\n file,\n consentUrl,\n concurrency,\n }: UploadConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Load in preferences from csv\n const preferences = parseCsv(this.fs.readFileSync(file, 'utf8'), ConsentPreferenceUpload);\n\n // Upload cookies\n await uploadConsents({\n base64EncryptionKey,\n base64SigningKey,\n preferences,\n partition,\n concurrency,\n transcendUrl: consentUrl,\n });\n}\n"],"mappings":"8KAEA,MAAa,EAA0B,EAAE,aAAa,CACpD,EAAE,KAAK,CAEL,OAAQ,EAAE,OAEV,UAAW,EAAE,OACd,CAAC,CACF,EAAE,QAAQ,CAER,UAAW,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAI3D,QAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAIzD,SAAU,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAE1D,SAAU,EAAE,OAEZ,IAAK,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,KAAK,CAAC,CAEhC,IAAK,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,KAAK,CAAC,CAKhC,SAAU,EAAE,OACb,CAAC,CACH,CAAC,CCjBF,eAAsB,EAEpB,CACE,sBACA,mBACA,YACA,OACA,aACA,eAEa,CACf,EAAoB,KAAK,QAAQ,CAMjC,MAAM,EAAe,CACnB,sBACA,mBACA,YANkB,EAAS,KAAK,GAAG,aAAa,EAAM,OAAO,CAAE,EAMpD,CACX,YACA,cACA,aAAc,EACf,CAAC"}
@@ -1,2 +1,2 @@
1
- import{i as e}from"./enums-OiLcZ26O.mjs";import{r as t}from"./constants-BG53Mbi9.mjs";import{n,t as r}from"./command-eIenZMOx.mjs";import{o as i}from"./readTranscendYaml-STYnRzq-.mjs";import{n as a}from"./pullTranscendConfiguration-CD7Frn8z.mjs";import{t as o}from"./validateTranscendAuth-CnHMn77m.mjs";import{t as s}from"./done-input-validation-Cjk7a3jX.mjs";import c from"node:path";import l from"colors";import{buildTranscendGraphQLClient as u}from"@transcend-io/sdk";import{mapSeries as d}from"@transcend-io/utils";async function f({auth:f,resources:p=n,file:m,transcendUrl:h,dataSiloIds:g=[],integrationNames:_=[],trackerStatuses:v=r,pageSize:y,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,debug:C}){s(this.process);let w=await o(f,this),T=p.includes(`all`)?Object.values(e):p;if(typeof w==`string`){try{let e=await a(u(h,w),{dataSiloIds:g,integrationNames:_,resources:T,pageSize:y,debug:C,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,trackerStatuses:v});this.logger.info(l.magenta(`Writing configuration to file "${m}"...`)),this.fs.writeFileSync(m,i(e))}catch(e){this.logger.error(l.red(`An error occurred syncing the schema: ${C?e.stack:e.message}`)),this.process.exit(1)}this.logger.info(l.green(`Successfully synced yaml file to disk at ${m}! View at ${t}`))}else{if(!this.fs.lstatSync(m).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 d(w,async(t,n)=>{let r=`[${n+1}/${w.length}][${t.organizationName}] `;this.logger.info(l.magenta(`~~~\n\n${r}Attempting to pull configuration...\n\n~~~`));let o=u(h,t.apiKey);try{let e=await a(o,{dataSiloIds:g,integrationNames:_,resources:T,pageSize:y,debug:C,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,trackerStatuses:v}),n=c.join(m,`${t.organizationName}.yml`);this.logger.info(l.magenta(`Writing configuration to file "${n}"...`)),this.fs.writeFileSync(n,i(e)),this.logger.info(l.green(`${r}Successfully pulled configuration!`))}catch(n){this.logger.error(l.red(`${r}Failed to sync configuration. - ${n.message}`)),e.push(t.organizationName)}}),e.length>0&&(this.logger.info(l.red(`Sync encountered errors for "${e.join(`,`)}". View output above for more information, or check out ${t}`)),this.process.exit(1))}}export{f as pull};
2
- //# sourceMappingURL=impl-BYGNx-8W2.mjs.map
1
+ import{i as e}from"./enums-OiLcZ26O.mjs";import{r as t}from"./constants-X60pMfSm.mjs";import{n,t as r}from"./command-BVK929yJ.mjs";import{o as i}from"./readTranscendYaml-BNn6-Ofi.mjs";import{n as a}from"./pullTranscendConfiguration-B63M3ild.mjs";import{t as o}from"./validateTranscendAuth-D6Wr1cxY.mjs";import{t as s}from"./done-input-validation-BUz-aVC5.mjs";import c from"node:path";import l from"colors";import{buildTranscendGraphQLClient as u}from"@transcend-io/sdk";import{mapSeries as d}from"@transcend-io/utils";async function f({auth:f,resources:p=n,file:m,transcendUrl:h,dataSiloIds:g=[],integrationNames:_=[],trackerStatuses:v=r,pageSize:y,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,debug:C}){s(this.process);let w=await o(f,this),T=p.includes(`all`)?Object.values(e):p;if(typeof w==`string`){try{let e=await a(u(h,w),{dataSiloIds:g,integrationNames:_,resources:T,pageSize:y,debug:C,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,trackerStatuses:v});this.logger.info(l.magenta(`Writing configuration to file "${m}"...`)),this.fs.writeFileSync(m,i(e))}catch(e){this.logger.error(l.red(`An error occurred syncing the schema: ${C?e.stack:e.message}`)),this.process.exit(1)}this.logger.info(l.green(`Successfully synced yaml file to disk at ${m}! View at ${t}`))}else{if(!this.fs.lstatSync(m).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 d(w,async(t,n)=>{let r=`[${n+1}/${w.length}][${t.organizationName}] `;this.logger.info(l.magenta(`~~~\n\n${r}Attempting to pull configuration...\n\n~~~`));let o=u(h,t.apiKey);try{let e=await a(o,{dataSiloIds:g,integrationNames:_,resources:T,pageSize:y,debug:C,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,trackerStatuses:v}),n=c.join(m,`${t.organizationName}.yml`);this.logger.info(l.magenta(`Writing configuration to file "${n}"...`)),this.fs.writeFileSync(n,i(e)),this.logger.info(l.green(`${r}Successfully pulled configuration!`))}catch(n){this.logger.error(l.red(`${r}Failed to sync configuration. - ${n.message}`)),e.push(t.organizationName)}}),e.length>0&&(this.logger.info(l.red(`Sync encountered errors for "${e.join(`,`)}". View output above for more information, or check out ${t}`)),this.process.exit(1))}}export{f as pull};
2
+ //# sourceMappingURL=impl-lcLJ4Wp-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-lcLJ4Wp-.mjs","names":[],"sources":["../src/commands/inventory/pull/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { TranscendPullResource } from '../../../enums.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullTranscendConfiguration } from '../../../lib/graphql/index.js';\nimport { serializeTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { DEFAULT_CONSENT_TRACKER_STATUSES, DEFAULT_TRANSCEND_PULL_RESOURCES } from './command.js';\n\nexport interface PullCommandFlags {\n auth: string;\n resources?: (TranscendPullResource | 'all')[];\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n integrationNames?: string[];\n trackerStatuses?: ConsentTrackerStatus[];\n pageSize: number;\n skipDatapoints: boolean;\n skipSubDatapoints: boolean;\n includeGuessedCategories: boolean;\n debug: boolean;\n}\n\nexport async function pull(\n this: LocalContext,\n {\n auth,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n file,\n transcendUrl,\n dataSiloIds = [],\n integrationNames = [],\n trackerStatuses = DEFAULT_CONSENT_TRACKER_STATUSES,\n pageSize,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n debug,\n }: PullCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth, this);\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 this.logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n this.fs.writeFileSync(file, serializeTranscendYaml(configuration));\n } catch (err) {\n this.logger.error(\n colors.red(`An error occurred syncing the schema: ${debug ? err.stack : err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n this.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 (!this.fs.lstatSync(file).isDirectory()) {\n throw new Error(\n 'File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/',\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n this.logger.info(\n colors.magenta(`~~~\\n\\n${prefix}Attempting to pull configuration...\\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 = path.join(file, `${apiKey.organizationName}.yml`);\n this.logger.info(colors.magenta(`Writing configuration to file \"${filePath}\"...`));\n this.fs.writeFileSync(filePath, serializeTranscendYaml(configuration));\n\n this.logger.info(colors.green(`${prefix}Successfully pulled configuration!`));\n } catch (err) {\n this.logger.error(colors.red(`${prefix}Failed to sync configuration. - ${err.message}`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n this.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":"ugBA+BA,eAAsB,EAEpB,CACE,OACA,YAAY,EACZ,OACA,eACA,cAAc,EAA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kC,EAAS,MAAM,CAAC,CAClF,KAAK,GAAG,cAAc,EAAU,EAAuB,EAAc,CAAC,CAEtE,KAAK,OAAO,KAAK,EAAO,MAAM,GAAG,EAAO,oCAAoC,CAAC,OACtE,EAAK,CACZ,KAAK,OAAO,MAAM,EAAO,IAAI,GAAG,EAAO,kCAAkC,EAAI,UAAU,CAAC,CACxF,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,KAAK,OAAO,KACV,EAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0D,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./bulkRestartRequests-BLb8OJmf.mjs";import{t}from"./done-input-validation-Cjk7a3jX.mjs";async function n({auth:n,requestReceiptFolder:r,sombraAuth:i,actions:a,statuses:o,requestIds:s,createdAt:c,emailIsVerified:l,silentModeBefore:u,sendEmailReceipt:d,copyIdentifiers:f,restartIdentifierStrategy:p,skipWaitingPeriod:m,createdAtBefore:h,createdAtAfter:g,updatedAtBefore:_,updatedAtAfter:v,concurrency:y,transcendUrl:b}){t(this.process),await e({requestReceiptFolder:r,auth:n,sombraAuth:i,requestActions:a,requestStatuses:o,requestIds:s,createdAt:c,emailIsVerified:l,silentModeBefore:u,sendEmailReceipt:d,copyIdentifiers:f,restartIdentifierStrategy:p,skipWaitingPeriod:m,createdAtBefore:h,createdAtAfter:g,updatedAtBefore:_,updatedAtAfter:v,concurrency:y,transcendUrl:b})}export{n as restart};
2
- //# sourceMappingURL=impl-CTIWliTx.mjs.map
1
+ import{t as e}from"./bulkRestartRequests-C4wyNZ65.mjs";import{t}from"./done-input-validation-BUz-aVC5.mjs";async function n({auth:n,requestReceiptFolder:r,sombraAuth:i,actions:a,statuses:o,requestIds:s,createdAt:c,emailIsVerified:l,silentModeBefore:u,sendEmailReceipt:d,copyIdentifiers:f,restartIdentifierStrategy:p,skipWaitingPeriod:m,createdAtBefore:h,createdAtAfter:g,updatedAtBefore:_,updatedAtAfter:v,concurrency:y,transcendUrl:b}){t(this.process),await e({requestReceiptFolder:r,auth:n,sombraAuth:i,requestActions:a,requestStatuses:o,requestIds:s,createdAt:c,emailIsVerified:l,silentModeBefore:u,sendEmailReceipt:d,copyIdentifiers:f,restartIdentifierStrategy:p,skipWaitingPeriod:m,createdAtBefore:h,createdAtAfter:g,updatedAtBefore:_,updatedAtAfter:v,concurrency:y,transcendUrl:b})}export{n as restart};
2
+ //# sourceMappingURL=impl-nvYE0p_K.mjs.map