@transcend-io/cli 11.0.0 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/README.md +286 -130
  2. package/dist/app-CfJlhIn8.mjs +148 -0
  3. package/dist/app-CfJlhIn8.mjs.map +1 -0
  4. package/dist/{approvePrivacyRequests-C165wLBa.mjs → approvePrivacyRequests-BWj6SsgX.mjs} +2 -2
  5. package/dist/{approvePrivacyRequests-C165wLBa.mjs.map → approvePrivacyRequests-BWj6SsgX.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-1I3xKR1X.mjs +2 -0
  10. package/dist/buildExamples-1I3xKR1X.mjs.map +1 -0
  11. package/dist/{buildXdiSyncEndpoint-DeStnIit.mjs → buildXdiSyncEndpoint-CAal3Xc4.mjs} +2 -2
  12. package/dist/{buildXdiSyncEndpoint-DeStnIit.mjs.map → buildXdiSyncEndpoint-CAal3Xc4.mjs.map} +1 -1
  13. package/dist/{bulkRestartRequests-_Mu1rwZQ.mjs → bulkRestartRequests-B3wupylo.mjs} +2 -2
  14. package/dist/{bulkRestartRequests-_Mu1rwZQ.mjs.map → bulkRestartRequests-B3wupylo.mjs.map} +1 -1
  15. package/dist/{bulkRetryEnrichers-C2keTKuQ.mjs → bulkRetryEnrichers-D801tBcB.mjs} +2 -2
  16. package/dist/{bulkRetryEnrichers-C2keTKuQ.mjs.map → bulkRetryEnrichers-D801tBcB.mjs.map} +1 -1
  17. package/dist/{cancelPrivacyRequests-DwQr18Fk.mjs → cancelPrivacyRequests-CAKTZF47.mjs} +2 -2
  18. package/dist/{cancelPrivacyRequests-DwQr18Fk.mjs.map → cancelPrivacyRequests-CAKTZF47.mjs.map} +1 -1
  19. package/dist/{codecs-CTxFjCg4.mjs → codecs-CfcaFoZR.mjs} +1 -1
  20. package/dist/{codecs-CTxFjCg4.mjs.map → codecs-CfcaFoZR.mjs.map} +1 -1
  21. package/dist/{collectCsvFilesOrExit-B1VOVGWN.mjs → collectCsvFilesOrExit-BindZ0dF.mjs} +1 -1
  22. package/dist/{collectCsvFilesOrExit-B1VOVGWN.mjs.map → collectCsvFilesOrExit-BindZ0dF.mjs.map} +1 -1
  23. package/dist/{collectParquetFilesOrExit-DVlv5ctt.mjs → collectParquetFilesOrExit-CbNQ9CJc.mjs} +1 -1
  24. package/dist/{collectParquetFilesOrExit-DVlv5ctt.mjs.map → collectParquetFilesOrExit-CbNQ9CJc.mjs.map} +1 -1
  25. package/dist/command-BDQOL_MQ.mjs +9 -0
  26. package/dist/command-BDQOL_MQ.mjs.map +1 -0
  27. package/dist/command-output-BJcDRXNr.mjs +2 -0
  28. package/dist/command-output-BJcDRXNr.mjs.map +1 -0
  29. package/dist/command-output-BRfF3YFv.mjs +2 -0
  30. package/dist/command-output-BRfF3YFv.mjs.map +1 -0
  31. package/dist/commands/admin/chunk-csv/worker.mjs +1 -1
  32. package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
  33. package/dist/{consentManagersToBusinessEntities-CBJ81aGO.mjs → consentManagersToBusinessEntities-DG0_eby5.mjs} +1 -1
  34. package/dist/{consentManagersToBusinessEntities-CBJ81aGO.mjs.map → consentManagersToBusinessEntities-DG0_eby5.mjs.map} +1 -1
  35. package/dist/{constants-Upxn_rQF.mjs → constants-BlKpAm3R.mjs} +2 -2
  36. package/dist/{constants-Upxn_rQF.mjs.map → constants-BlKpAm3R.mjs.map} +1 -1
  37. package/dist/{constants-DXzsg2CQ.mjs → constants-DC_bBO09.mjs} +3 -3
  38. package/dist/{constants-DXzsg2CQ.mjs.map → constants-DC_bBO09.mjs.map} +1 -1
  39. package/dist/{constants-D_HVDaOy.mjs → constants-qvGk0wlN.mjs} +1 -1
  40. package/dist/{constants-D_HVDaOy.mjs.map → constants-qvGk0wlN.mjs.map} +1 -1
  41. package/dist/{context-B33NT3ki.mjs → context-D0A0LxsP.mjs} +1 -1
  42. package/dist/{context-B33NT3ki.mjs.map → context-D0A0LxsP.mjs.map} +1 -1
  43. package/dist/{createPoolingCommandUi-CKH-24w5.mjs → createPoolingCommandUi-JBOW5UxY.mjs} +5 -5
  44. package/dist/{createPoolingCommandUi-CKH-24w5.mjs.map → createPoolingCommandUi-JBOW5UxY.mjs.map} +1 -1
  45. package/dist/{dataFlowsToDataSilos-BF6fzWcm.mjs → dataFlowsToDataSilos-CRqbNjZ0.mjs} +1 -1
  46. package/dist/{dataFlowsToDataSilos-BF6fzWcm.mjs.map → dataFlowsToDataSilos-CRqbNjZ0.mjs.map} +1 -1
  47. package/dist/deno-runtime-CB2HBach.mjs +2 -0
  48. package/dist/deno-runtime-CB2HBach.mjs.map +1 -0
  49. package/dist/{done-input-validation-BUz-aVC5.mjs → done-input-validation-LiTaCEzF.mjs} +1 -1
  50. package/dist/{done-input-validation-BUz-aVC5.mjs.map → done-input-validation-LiTaCEzF.mjs.map} +1 -1
  51. package/dist/downloadPrivacyRequestFiles-Cf14MQR4.mjs +2 -0
  52. package/dist/{downloadPrivacyRequestFiles-D3bzcegH.mjs.map → downloadPrivacyRequestFiles-Cf14MQR4.mjs.map} +1 -1
  53. package/dist/{extractClientError-HZ2U7yqV.mjs → extractClientError-DUJxHv07.mjs} +1 -1
  54. package/dist/{extractClientError-HZ2U7yqV.mjs.map → extractClientError-DUJxHv07.mjs.map} +1 -1
  55. package/dist/{fetchAllRequests-2TZr-LfT.mjs → fetchAllRequests-BI0tFl_a.mjs} +2 -2
  56. package/dist/{fetchAllRequests-2TZr-LfT.mjs.map → fetchAllRequests-BI0tFl_a.mjs.map} +1 -1
  57. package/dist/{formatPolicyBundleVersionSummary-CJmMCLtJ.mjs → formatPolicyBundleVersionSummary-DCHl1Vhy.mjs} +1 -1
  58. package/dist/{formatPolicyBundleVersionSummary-CJmMCLtJ.mjs.map → formatPolicyBundleVersionSummary-DCHl1Vhy.mjs.map} +1 -1
  59. package/dist/{fuzzyMatchColumns-CQCzpjWC.mjs → fuzzyMatchColumns-2NmQqCZI.mjs} +2 -2
  60. package/dist/{fuzzyMatchColumns-CQCzpjWC.mjs.map → fuzzyMatchColumns-2NmQqCZI.mjs.map} +1 -1
  61. package/dist/{generateCrossAccountApiKeys-DWfJtB3t.mjs → generateCrossAccountApiKeys-CVdsJFOe.mjs} +2 -2
  62. package/dist/{generateCrossAccountApiKeys-DWfJtB3t.mjs.map → generateCrossAccountApiKeys-CVdsJFOe.mjs.map} +1 -1
  63. package/dist/impl-0-_oxvck.mjs +2 -0
  64. package/dist/impl-0-_oxvck.mjs.map +1 -0
  65. package/dist/{impl-ByFyaZkK.mjs → impl-2sYR_UFO.mjs} +2 -2
  66. package/dist/{impl-ByFyaZkK.mjs.map → impl-2sYR_UFO.mjs.map} +1 -1
  67. package/dist/{impl-DRpK-QLC.mjs → impl-ApZGIx6l.mjs} +2 -2
  68. package/dist/{impl-DRpK-QLC.mjs.map → impl-ApZGIx6l.mjs.map} +1 -1
  69. package/dist/{impl-DVeGQCrr.mjs → impl-Ay6JeH-7.mjs} +2 -2
  70. package/dist/{impl-DVeGQCrr.mjs.map → impl-Ay6JeH-7.mjs.map} +1 -1
  71. package/dist/impl-B-Oe7DcE2.mjs +421 -0
  72. package/dist/impl-B-Oe7DcE2.mjs.map +1 -0
  73. package/dist/{impl-BPoEH3Nf2.mjs → impl-B94dMG4x2.mjs} +2 -2
  74. package/dist/{impl-BPoEH3Nf2.mjs.map → impl-B94dMG4x2.mjs.map} +1 -1
  75. package/dist/{impl-BEA5cQOT2.mjs → impl-BD03bzB-.mjs} +2 -2
  76. package/dist/impl-BD03bzB-.mjs.map +1 -0
  77. package/dist/{impl-BpMQYnbR.mjs → impl-BGtup1F9.mjs} +2 -2
  78. package/dist/{impl-BpMQYnbR.mjs.map → impl-BGtup1F9.mjs.map} +1 -1
  79. package/dist/{impl-DXowiNOz.mjs → impl-BH1fCPDh.mjs} +2 -2
  80. package/dist/{impl-DXowiNOz.mjs.map → impl-BH1fCPDh.mjs.map} +1 -1
  81. package/dist/{impl-CfvxD3RI.mjs → impl-BLOhoP-b2.mjs} +2 -2
  82. package/dist/impl-BLOhoP-b2.mjs.map +1 -0
  83. package/dist/impl-BQRP9NIv.mjs +2 -0
  84. package/dist/impl-BQRP9NIv.mjs.map +1 -0
  85. package/dist/{impl-BppXJ1AD2.mjs → impl-BQe6vddz.mjs} +2 -2
  86. package/dist/impl-BQe6vddz.mjs.map +1 -0
  87. package/dist/impl-BQj1Ien4.mjs +3 -0
  88. package/dist/impl-BQj1Ien4.mjs.map +1 -0
  89. package/dist/{impl-C_62Z4ED.mjs → impl-BRFL8xp7.mjs} +2 -2
  90. package/dist/{impl-C_62Z4ED.mjs.map → impl-BRFL8xp7.mjs.map} +1 -1
  91. package/dist/impl-BTvZxws5.mjs +2 -0
  92. package/dist/impl-BTvZxws5.mjs.map +1 -0
  93. package/dist/{impl-D94m3EPp.mjs → impl-BVcy_GYa.mjs} +2 -2
  94. package/dist/{impl-D94m3EPp.mjs.map → impl-BVcy_GYa.mjs.map} +1 -1
  95. package/dist/{impl-zRAjMVgz.mjs → impl-B_CRtRo8.mjs} +2 -2
  96. package/dist/{impl-zRAjMVgz.mjs.map → impl-B_CRtRo8.mjs.map} +1 -1
  97. package/dist/{impl-D4Ne3Vbg.mjs → impl-BgD7TeMD.mjs} +2 -2
  98. package/dist/{impl-D4Ne3Vbg.mjs.map → impl-BgD7TeMD.mjs.map} +1 -1
  99. package/dist/{impl-Cw0L2xEU.mjs → impl-BgkovGOz.mjs} +2 -2
  100. package/dist/{impl-Cw0L2xEU.mjs.map → impl-BgkovGOz.mjs.map} +1 -1
  101. package/dist/{impl-C9OmNI49.mjs → impl-Bh02zrTq.mjs} +2 -2
  102. package/dist/{impl-C9OmNI49.mjs.map → impl-Bh02zrTq.mjs.map} +1 -1
  103. package/dist/{impl-CiBT9-GH2.mjs → impl-BopWGXnH.mjs} +2 -2
  104. package/dist/impl-BopWGXnH.mjs.map +1 -0
  105. package/dist/impl-BpVe6fMe.mjs +3 -0
  106. package/dist/{impl--JGnR3wp.mjs.map → impl-BpVe6fMe.mjs.map} +1 -1
  107. package/dist/impl-BxvKe9_7.mjs +2 -0
  108. package/dist/impl-BxvKe9_7.mjs.map +1 -0
  109. package/dist/{impl-C8jjYvgu.mjs → impl-BzIyVAg_.mjs} +2 -2
  110. package/dist/{impl-C8jjYvgu.mjs.map → impl-BzIyVAg_.mjs.map} +1 -1
  111. package/dist/{impl-DXQHLpMw.mjs → impl-C-PvYlFE.mjs} +2 -2
  112. package/dist/{impl-DXQHLpMw.mjs.map → impl-C-PvYlFE.mjs.map} +1 -1
  113. package/dist/impl-C36c5NfN.mjs +2 -0
  114. package/dist/impl-C36c5NfN.mjs.map +1 -0
  115. package/dist/{impl-BhfxcCgN2.mjs → impl-CC-yFYWt.mjs} +2 -2
  116. package/dist/impl-CC-yFYWt.mjs.map +1 -0
  117. package/dist/{impl-lsmXIGSo2.mjs → impl-CFB_508q.mjs} +2 -2
  118. package/dist/impl-CFB_508q.mjs.map +1 -0
  119. package/dist/{impl-D2Q4nxUO.mjs → impl-CG3f4B6u.mjs} +2 -2
  120. package/dist/{impl-D2Q4nxUO.mjs.map → impl-CG3f4B6u.mjs.map} +1 -1
  121. package/dist/{impl-DaH1_ZzK.mjs → impl-CVUD-7mJ.mjs} +5 -5
  122. package/dist/{impl-DaH1_ZzK.mjs.map → impl-CVUD-7mJ.mjs.map} +1 -1
  123. package/dist/impl-CY8C-Fvj2.mjs +2 -0
  124. package/dist/impl-CY8C-Fvj2.mjs.map +1 -0
  125. package/dist/{impl-DqhZR11m.mjs → impl-ClqrQo1M.mjs} +2 -2
  126. package/dist/{impl-DqhZR11m.mjs.map → impl-ClqrQo1M.mjs.map} +1 -1
  127. package/dist/impl-CnHfn7rr.mjs +5 -0
  128. package/dist/{impl-DPtx5iZO.mjs.map → impl-CnHfn7rr.mjs.map} +1 -1
  129. package/dist/{impl-Dqqb0lVN.mjs → impl-CoqCyj7e.mjs} +3 -3
  130. package/dist/{impl-Dqqb0lVN.mjs.map → impl-CoqCyj7e.mjs.map} +1 -1
  131. package/dist/{impl-CHUxKOz_.mjs → impl-Cq-GARM1.mjs} +2 -2
  132. package/dist/{impl-CHUxKOz_.mjs.map → impl-Cq-GARM1.mjs.map} +1 -1
  133. package/dist/{impl-DzUTmaID2.mjs → impl-CsaT3aM2.mjs} +2 -2
  134. package/dist/impl-CsaT3aM2.mjs.map +1 -0
  135. package/dist/impl-Cvyc-iTI2.mjs +2 -0
  136. package/dist/impl-Cvyc-iTI2.mjs.map +1 -0
  137. package/dist/impl-CwBa15M42.mjs +3 -0
  138. package/dist/impl-CwBa15M42.mjs.map +1 -0
  139. package/dist/impl-D3gqip90.mjs +2 -0
  140. package/dist/impl-D3gqip90.mjs.map +1 -0
  141. package/dist/{impl-nz1MyjX22.mjs → impl-D6Lzwd-R2.mjs} +2 -2
  142. package/dist/{impl-nz1MyjX22.mjs.map → impl-D6Lzwd-R2.mjs.map} +1 -1
  143. package/dist/impl-DG-041kN.mjs +3 -0
  144. package/dist/impl-DG-041kN.mjs.map +1 -0
  145. package/dist/{impl-CD2R3L0v.mjs → impl-DTvnDByz.mjs} +2 -2
  146. package/dist/{impl-CD2R3L0v.mjs.map → impl-DTvnDByz.mjs.map} +1 -1
  147. package/dist/{impl-CTwyYUw3.mjs → impl-DUg1sDwg.mjs} +2 -2
  148. package/dist/{impl-CTwyYUw3.mjs.map → impl-DUg1sDwg.mjs.map} +1 -1
  149. package/dist/{impl-DKepRc812.mjs → impl-DeCRXfAh2.mjs} +2 -2
  150. package/dist/{impl-DKepRc812.mjs.map → impl-DeCRXfAh2.mjs.map} +1 -1
  151. package/dist/{impl-COujMWgp.mjs → impl-Dg7XSQdO2.mjs} +2 -2
  152. package/dist/impl-Dg7XSQdO2.mjs.map +1 -0
  153. package/dist/{impl-a_Y8bnSn.mjs → impl-DhXzxQDN2.mjs} +5 -5
  154. package/dist/impl-DhXzxQDN2.mjs.map +1 -0
  155. package/dist/{impl-C2sSZ8qF.mjs → impl-DldrBJEa.mjs} +2 -2
  156. package/dist/{impl-C2sSZ8qF.mjs.map → impl-DldrBJEa.mjs.map} +1 -1
  157. package/dist/{impl-gs5wJ1BK.mjs → impl-Dmn1CWts.mjs} +3 -3
  158. package/dist/{impl-gs5wJ1BK.mjs.map → impl-Dmn1CWts.mjs.map} +1 -1
  159. package/dist/impl-Dr9Jezjh2.mjs +2 -0
  160. package/dist/impl-Dr9Jezjh2.mjs.map +1 -0
  161. package/dist/impl-DtTfsHtL.mjs +2 -0
  162. package/dist/impl-DtTfsHtL.mjs.map +1 -0
  163. package/dist/impl-DzNEfRoS2.mjs +4 -0
  164. package/dist/{impl-D-AHlqlD2.mjs.map → impl-DzNEfRoS2.mjs.map} +1 -1
  165. package/dist/{impl-a0BFtbna.mjs → impl-HnrcGt_T.mjs} +2 -2
  166. package/dist/{impl-a0BFtbna.mjs.map → impl-HnrcGt_T.mjs.map} +1 -1
  167. package/dist/{impl-B5df-igZ.mjs → impl-QdSegO65.mjs} +2 -2
  168. package/dist/{impl-B5df-igZ.mjs.map → impl-QdSegO65.mjs.map} +1 -1
  169. package/dist/{impl-BJyzyrZD.mjs → impl-S90NUBGm.mjs} +2 -2
  170. package/dist/{impl-BJyzyrZD.mjs.map → impl-S90NUBGm.mjs.map} +1 -1
  171. package/dist/impl-Tr08dgdk.mjs +2 -0
  172. package/dist/{impl-DQPmSYSE.mjs.map → impl-Tr08dgdk.mjs.map} +1 -1
  173. package/dist/{impl-CPSEzCc9.mjs → impl-WJBuS_0m.mjs} +2 -2
  174. package/dist/{impl-CPSEzCc9.mjs.map → impl-WJBuS_0m.mjs.map} +1 -1
  175. package/dist/impl-b4KAEVci.mjs +2 -0
  176. package/dist/{impl-GytUVAMP.mjs.map → impl-b4KAEVci.mjs.map} +1 -1
  177. package/dist/impl-defjX-97.mjs +3 -0
  178. package/dist/impl-defjX-97.mjs.map +1 -0
  179. package/dist/{impl-DhxDp4GN.mjs → impl-fg0UZYw6.mjs} +2 -2
  180. package/dist/{impl-DhxDp4GN.mjs.map → impl-fg0UZYw6.mjs.map} +1 -1
  181. package/dist/{impl-CzdUHruN.mjs → impl-hRK54juc.mjs} +2 -2
  182. package/dist/{impl-CzdUHruN.mjs.map → impl-hRK54juc.mjs.map} +1 -1
  183. package/dist/{impl-CSk_okwj.mjs → impl-mjDxMEDR.mjs} +2 -2
  184. package/dist/{impl-CSk_okwj.mjs.map → impl-mjDxMEDR.mjs.map} +1 -1
  185. package/dist/index.d.mts +1 -1
  186. package/dist/index.mjs +2 -2
  187. package/dist/index.mjs.map +1 -1
  188. package/dist/{initializeCliRuntime-6wI_VIHV.mjs → initializeCliRuntime-BaATMO1X.mjs} +1 -1
  189. package/dist/{initializeCliRuntime-6wI_VIHV.mjs.map → initializeCliRuntime-BaATMO1X.mjs.map} +1 -1
  190. package/dist/{inquirer-BeaBetMO.mjs → inquirer-BU5IpgA8.mjs} +2 -2
  191. package/dist/{inquirer-BeaBetMO.mjs.map → inquirer-BU5IpgA8.mjs.map} +1 -1
  192. package/dist/{jsonc-D9dDWb1J.mjs → jsonc-CdTubr53.mjs} +1 -1
  193. package/dist/{jsonc-D9dDWb1J.mjs.map → jsonc-CdTubr53.mjs.map} +1 -1
  194. package/dist/{listFiles-BdFUbX5x.mjs → listFiles-DDGCBdtx.mjs} +1 -1
  195. package/dist/{listFiles-BdFUbX5x.mjs.map → listFiles-DDGCBdtx.mjs.map} +1 -1
  196. package/dist/logger-CPu6zbyQ.mjs +2 -0
  197. package/dist/logger-CPu6zbyQ.mjs.map +1 -0
  198. package/dist/{mapConsentCsvRowsToInputs-Dqb6WL4r.mjs → mapConsentCsvRowsToInputs-CkLfxaIf.mjs} +1 -1
  199. package/dist/{mapConsentCsvRowsToInputs-Dqb6WL4r.mjs.map → mapConsentCsvRowsToInputs-CkLfxaIf.mjs.map} +1 -1
  200. package/dist/markRequestDataSiloIdsCompleted-C6lV_My-.mjs +2 -0
  201. package/dist/{markRequestDataSiloIdsCompleted-Br5gIS3S.mjs.map → markRequestDataSiloIdsCompleted-C6lV_My-.mjs.map} +1 -1
  202. package/dist/{markSilentPrivacyRequests-Cs_iZNJs.mjs → markSilentPrivacyRequests-D3bFOMLh.mjs} +2 -2
  203. package/dist/{markSilentPrivacyRequests-Cs_iZNJs.mjs.map → markSilentPrivacyRequests-D3bFOMLh.mjs.map} +1 -1
  204. package/dist/{mergeTranscendInputs-DFQcbh8b.mjs → mergeTranscendInputs-B7WjxYMN.mjs} +3 -3
  205. package/dist/{mergeTranscendInputs-DFQcbh8b.mjs.map → mergeTranscendInputs-B7WjxYMN.mjs.map} +1 -1
  206. package/dist/missing-manifest-D8y1VL4p.mjs +2 -0
  207. package/dist/missing-manifest-D8y1VL4p.mjs.map +1 -0
  208. package/dist/{module-graph-Cb0g74Ft.mjs → module-graph-CAT8_JCG.mjs} +1 -1
  209. package/dist/{module-graph-Cb0g74Ft.mjs.map → module-graph-CAT8_JCG.mjs.map} +1 -1
  210. package/dist/{notifyPrivacyRequestsAdditionalTime-kPXTdjgT.mjs → notifyPrivacyRequestsAdditionalTime-BGUxsWLN.mjs} +2 -2
  211. package/dist/{notifyPrivacyRequestsAdditionalTime-kPXTdjgT.mjs.map → notifyPrivacyRequestsAdditionalTime-BGUxsWLN.mjs.map} +1 -1
  212. package/dist/{parquetToCsvOneFile-ChmPC6dL.mjs → parquetToCsvOneFile-DtbCFm08.mjs} +3 -3
  213. package/dist/{parquetToCsvOneFile-ChmPC6dL.mjs.map → parquetToCsvOneFile-DtbCFm08.mjs.map} +1 -1
  214. package/dist/{parseAttributesFromString-CO16oAlx.mjs → parseAttributesFromString-C5hJMRvt.mjs} +2 -2
  215. package/dist/{parseAttributesFromString-CO16oAlx.mjs.map → parseAttributesFromString-C5hJMRvt.mjs.map} +1 -1
  216. package/dist/{parseVariablesFromString-BOSfQ4QF.mjs → parseVariablesFromString-6TYW65LF.mjs} +1 -1
  217. package/dist/{parseVariablesFromString-BOSfQ4QF.mjs.map → parseVariablesFromString-6TYW65LF.mjs.map} +1 -1
  218. package/dist/paths-J5KScOaQ.mjs +2 -0
  219. package/dist/paths-J5KScOaQ.mjs.map +1 -0
  220. package/dist/policy-bundle-manifest-RgsjPnfI.mjs +7 -0
  221. package/dist/policy-bundle-manifest-RgsjPnfI.mjs.map +1 -0
  222. package/dist/policy-project-discovery-B4cFXUlA.mjs +430 -0
  223. package/dist/policy-project-discovery-B4cFXUlA.mjs.map +1 -0
  224. package/dist/{policy-runtime-BMKa-Upy.mjs → policy-runtime-6jmkXlBk.mjs} +2 -2
  225. package/dist/{policy-runtime-BMKa-Upy.mjs.map → policy-runtime-6jmkXlBk.mjs.map} +1 -1
  226. package/dist/policy-scaffold-config-CwlygiTz.mjs +76 -0
  227. package/dist/policy-scaffold-config-CwlygiTz.mjs.map +1 -0
  228. package/dist/{policyEngineCliError-DY8V-qkK.mjs → policyEngineCliError-CZrOHhLv.mjs} +1 -1
  229. package/dist/{policyEngineCliError-DY8V-qkK.mjs.map → policyEngineCliError-CZrOHhLv.mjs.map} +1 -1
  230. package/dist/printResult-Dmwv78e7.mjs +33 -0
  231. package/dist/printResult-Dmwv78e7.mjs.map +1 -0
  232. package/dist/project-discovery-BkHpTXDx.mjs +2 -0
  233. package/dist/project-discovery-BkHpTXDx.mjs.map +1 -0
  234. package/dist/project-discovery-CWRjlFnC.mjs +2 -0
  235. package/dist/project-discovery-CWRjlFnC.mjs.map +1 -0
  236. package/dist/project-plan-apply-Bg_1eMX9.mjs +3 -0
  237. package/dist/{project-plan-apply-Dvndx455.mjs.map → project-plan-apply-Bg_1eMX9.mjs.map} +1 -1
  238. package/dist/project-plan-output-BHHlkLxe.mjs +4 -0
  239. package/dist/project-plan-output-BHHlkLxe.mjs.map +1 -0
  240. package/dist/prompts-BhXfYD6g.mjs +2 -0
  241. package/dist/prompts-BhXfYD6g.mjs.map +1 -0
  242. package/dist/{pullAllDatapoints-uk5ggk6O.mjs → pullAllDatapoints-CNqQSSmF.mjs} +3 -3
  243. package/dist/{pullAllDatapoints-uk5ggk6O.mjs.map → pullAllDatapoints-CNqQSSmF.mjs.map} +1 -1
  244. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-BfNNWqeI.mjs +2 -0
  245. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DbFFXAVM.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-BfNNWqeI.mjs.map} +1 -1
  246. package/dist/{pullConsentManagerMetrics-Dv5n1ZGp.mjs → pullConsentManagerMetrics-DKCkfbCB.mjs} +2 -2
  247. package/dist/{pullConsentManagerMetrics-Dv5n1ZGp.mjs.map → pullConsentManagerMetrics-DKCkfbCB.mjs.map} +1 -1
  248. package/dist/pullManualEnrichmentIdentifiersToCsv-B_lWa6Yg.mjs +2 -0
  249. package/dist/{pullManualEnrichmentIdentifiersToCsv-D5is0Nrs.mjs.map → pullManualEnrichmentIdentifiersToCsv-B_lWa6Yg.mjs.map} +1 -1
  250. package/dist/{pullTranscendConfiguration-B63M3ild.mjs → pullTranscendConfiguration-CDUDqxpm.mjs} +2 -2
  251. package/dist/{pullTranscendConfiguration-B63M3ild.mjs.map → pullTranscendConfiguration-CDUDqxpm.mjs.map} +1 -1
  252. package/dist/{pullUnstructuredSubDataPointRecommendations-YTBzfkRZ.mjs → pullUnstructuredSubDataPointRecommendations-Ci4AOxyH.mjs} +2 -2
  253. package/dist/{pullUnstructuredSubDataPointRecommendations-YTBzfkRZ.mjs.map → pullUnstructuredSubDataPointRecommendations-Ci4AOxyH.mjs.map} +1 -1
  254. package/dist/{pushCronIdentifiersFromCsv-Ctq38wAY.mjs → pushCronIdentifiersFromCsv-CDhlEf6n.mjs} +2 -2
  255. package/dist/{pushCronIdentifiersFromCsv-Ctq38wAY.mjs.map → pushCronIdentifiersFromCsv-CDhlEf6n.mjs.map} +1 -1
  256. package/dist/pushManualEnrichmentIdentifiersFromCsv-Bn_028w5.mjs +2 -0
  257. package/dist/{pushManualEnrichmentIdentifiersFromCsv-0WHf6d_m.mjs.map → pushManualEnrichmentIdentifiersFromCsv-Bn_028w5.mjs.map} +1 -1
  258. package/dist/{readCsv-DLg8pwjd.mjs → readCsv-DNcJ_UfU.mjs} +1 -1
  259. package/dist/{readCsv-DLg8pwjd.mjs.map → readCsv-DNcJ_UfU.mjs.map} +1 -1
  260. package/dist/{readTranscendYaml-BNn6-Ofi.mjs → readTranscendYaml-BfqQbPiT.mjs} +3 -3
  261. package/dist/{readTranscendYaml-BNn6-Ofi.mjs.map → readTranscendYaml-BfqQbPiT.mjs.map} +1 -1
  262. package/dist/{removeUnverifiedRequestIdentifiers-Do3Pus6m.mjs → removeUnverifiedRequestIdentifiers-DcI9ut4q.mjs} +2 -2
  263. package/dist/{removeUnverifiedRequestIdentifiers-Do3Pus6m.mjs.map → removeUnverifiedRequestIdentifiers-DcI9ut4q.mjs.map} +1 -1
  264. package/dist/{renderTable-D68QasPc.mjs → renderTable-CZP2roD1.mjs} +1 -1
  265. package/dist/{renderTable-D68QasPc.mjs.map → renderTable-CZP2roD1.mjs.map} +1 -1
  266. package/dist/{request-BiPv6jmP.mjs → request-BpKyN9Xm.mjs} +1 -1
  267. package/dist/{request-BiPv6jmP.mjs.map → request-BpKyN9Xm.mjs.map} +1 -1
  268. package/dist/resolveBundleIdByName-BPrMkU0w.mjs +2 -0
  269. package/dist/resolveBundleIdByName-BPrMkU0w.mjs.map +1 -0
  270. package/dist/resolvePolicyBundleVersion-BrVz4LKN.mjs +2 -0
  271. package/dist/resolvePolicyBundleVersion-BrVz4LKN.mjs.map +1 -0
  272. package/dist/{retryRequestDataSilos-CEgUW6Fx.mjs → retryRequestDataSilos-ZdY2PM0S.mjs} +2 -2
  273. package/dist/{retryRequestDataSilos-CEgUW6Fx.mjs.map → retryRequestDataSilos-ZdY2PM0S.mjs.map} +1 -1
  274. package/dist/{run-captured-process-BXwWXuTh.mjs → run-captured-process-BjaSDWXG.mjs} +1 -1
  275. package/dist/{run-captured-process-BXwWXuTh.mjs.map → run-captured-process-BjaSDWXG.mjs.map} +1 -1
  276. package/dist/{runOpa-CswzJxIs.mjs → runOpa-ojIqU1tO.mjs} +2 -2
  277. package/dist/{runOpa-CswzJxIs.mjs.map → runOpa-ojIqU1tO.mjs.map} +1 -1
  278. package/dist/{scaffold-model-BAbYTR0q.mjs → scaffold-model-CUZER0BC.mjs} +1 -1
  279. package/dist/scaffold-model-CUZER0BC.mjs.map +1 -0
  280. package/dist/{scaffold-planning-CNv83t_v.mjs → scaffold-planning-CaetLfv8.mjs} +9 -9
  281. package/dist/{scaffold-planning-CNv83t_v.mjs.map → scaffold-planning-CaetLfv8.mjs.map} +1 -1
  282. package/dist/{scaffold-templates-DzDGTZie.mjs → scaffold-templates-CUL82Zf8.mjs} +1 -1
  283. package/dist/{scaffold-templates-DzDGTZie.mjs.map → scaffold-templates-CUL82Zf8.mjs.map} +1 -1
  284. package/dist/{skipPreflightJobs-D_1mZ9mr.mjs → skipPreflightJobs-KdcSw8Td.mjs} +2 -2
  285. package/dist/{skipPreflightJobs-D_1mZ9mr.mjs.map → skipPreflightJobs-KdcSw8Td.mjs.map} +1 -1
  286. package/dist/{skipRequestDataSilos-CcGl9Z8M.mjs → skipRequestDataSilos-Cy2NfP47.mjs} +2 -2
  287. package/dist/{skipRequestDataSilos-CcGl9Z8M.mjs.map → skipRequestDataSilos-Cy2NfP47.mjs.map} +1 -1
  288. package/dist/{streamPrivacyRequestsToCsv-1l8RAcnK.mjs → streamPrivacyRequestsToCsv-ByRBG8Mb.mjs} +2 -2
  289. package/dist/{streamPrivacyRequestsToCsv-1l8RAcnK.mjs.map → streamPrivacyRequestsToCsv-ByRBG8Mb.mjs.map} +1 -1
  290. package/dist/{syncCodePackages-BHE2Tn1Q.mjs → syncCodePackages-DJnrcX5l.mjs} +2 -2
  291. package/dist/{syncCodePackages-BHE2Tn1Q.mjs.map → syncCodePackages-DJnrcX5l.mjs.map} +1 -1
  292. package/dist/updateConsentManagerVersionToLatest-KwMaAkwh.mjs +2 -0
  293. package/dist/{updateConsentManagerVersionToLatest-yZhBDcv8.mjs.map → updateConsentManagerVersionToLatest-KwMaAkwh.mjs.map} +1 -1
  294. package/dist/{uploadConsents-DQqApEaH.mjs → uploadConsents-C5LmI-9T.mjs} +2 -2
  295. package/dist/{uploadConsents-DQqApEaH.mjs.map → uploadConsents-C5LmI-9T.mjs.map} +1 -1
  296. package/dist/{uploadPrivacyRequestsFromCsv-ntuK0eSR.mjs → uploadPrivacyRequestsFromCsv-BsYnCgbl.mjs} +2 -2
  297. package/dist/{uploadPrivacyRequestsFromCsv-ntuK0eSR.mjs.map → uploadPrivacyRequestsFromCsv-BsYnCgbl.mjs.map} +1 -1
  298. package/dist/validateTranscendAuth-D-dDINof.mjs +2 -0
  299. package/dist/{validateTranscendAuth-D6Wr1cxY.mjs.map → validateTranscendAuth-D-dDINof.mjs.map} +1 -1
  300. package/dist/{writeCsv-D-2siSwE.mjs → writeCsv-CNZrq3zU.mjs} +1 -1
  301. package/dist/{writeCsv-D-2siSwE.mjs.map → writeCsv-CNZrq3zU.mjs.map} +1 -1
  302. package/package.json +8 -7
  303. package/dist/app-DhG-JhT3.mjs +0 -148
  304. package/dist/app-DhG-JhT3.mjs.map +0 -1
  305. package/dist/buildExamples-DOopJFYY.mjs +0 -2
  306. package/dist/buildExamples-DOopJFYY.mjs.map +0 -1
  307. package/dist/command-Ds6oNo0v.mjs +0 -9
  308. package/dist/command-Ds6oNo0v.mjs.map +0 -1
  309. package/dist/deno-runtime-DV52X8-P.mjs +0 -2
  310. package/dist/deno-runtime-DV52X8-P.mjs.map +0 -1
  311. package/dist/downloadPrivacyRequestFiles-D3bzcegH.mjs +0 -2
  312. package/dist/impl--JGnR3wp.mjs +0 -3
  313. package/dist/impl-7UqkSO3x2.mjs +0 -2
  314. package/dist/impl-7UqkSO3x2.mjs.map +0 -1
  315. package/dist/impl-B4BgGuF_.mjs +0 -3
  316. package/dist/impl-B4BgGuF_.mjs.map +0 -1
  317. package/dist/impl-B5oVsX-F2.mjs +0 -303
  318. package/dist/impl-B5oVsX-F2.mjs.map +0 -1
  319. package/dist/impl-BEA5cQOT2.mjs.map +0 -1
  320. package/dist/impl-BhfxcCgN2.mjs.map +0 -1
  321. package/dist/impl-BppXJ1AD2.mjs.map +0 -1
  322. package/dist/impl-C6HtWd1t.mjs +0 -2
  323. package/dist/impl-C6HtWd1t.mjs.map +0 -1
  324. package/dist/impl-CO4ZqlLV.mjs +0 -3
  325. package/dist/impl-CO4ZqlLV.mjs.map +0 -1
  326. package/dist/impl-COujMWgp.mjs.map +0 -1
  327. package/dist/impl-CUOVJsRg.mjs +0 -3
  328. package/dist/impl-CUOVJsRg.mjs.map +0 -1
  329. package/dist/impl-CUiYbk6G.mjs +0 -3
  330. package/dist/impl-CUiYbk6G.mjs.map +0 -1
  331. package/dist/impl-CfvxD3RI.mjs.map +0 -1
  332. package/dist/impl-CiBT9-GH2.mjs.map +0 -1
  333. package/dist/impl-Cli2XRp02.mjs +0 -2
  334. package/dist/impl-Cli2XRp02.mjs.map +0 -1
  335. package/dist/impl-D-AHlqlD2.mjs +0 -4
  336. package/dist/impl-DPN1En7L.mjs +0 -2
  337. package/dist/impl-DPN1En7L.mjs.map +0 -1
  338. package/dist/impl-DPtx5iZO.mjs +0 -5
  339. package/dist/impl-DQPmSYSE.mjs +0 -2
  340. package/dist/impl-DXRDWiB1.mjs +0 -2
  341. package/dist/impl-DXRDWiB1.mjs.map +0 -1
  342. package/dist/impl-DdIa0zla.mjs +0 -2
  343. package/dist/impl-DdIa0zla.mjs.map +0 -1
  344. package/dist/impl-Dp4bZvAV.mjs +0 -2
  345. package/dist/impl-Dp4bZvAV.mjs.map +0 -1
  346. package/dist/impl-DryC3OJu.mjs +0 -2
  347. package/dist/impl-DryC3OJu.mjs.map +0 -1
  348. package/dist/impl-DzUTmaID2.mjs.map +0 -1
  349. package/dist/impl-GytUVAMP.mjs +0 -2
  350. package/dist/impl-Z8oWVENM.mjs +0 -2
  351. package/dist/impl-Z8oWVENM.mjs.map +0 -1
  352. package/dist/impl-a_Y8bnSn.mjs.map +0 -1
  353. package/dist/impl-lsmXIGSo2.mjs.map +0 -1
  354. package/dist/logger-zplFSeXU.mjs +0 -2
  355. package/dist/logger-zplFSeXU.mjs.map +0 -1
  356. package/dist/manifest-BNIpO_zW.mjs +0 -2
  357. package/dist/manifest-BNIpO_zW.mjs.map +0 -1
  358. package/dist/markRequestDataSiloIdsCompleted-Br5gIS3S.mjs +0 -2
  359. package/dist/missing-manifest-DgcukXfg.mjs +0 -2
  360. package/dist/missing-manifest-DgcukXfg.mjs.map +0 -1
  361. package/dist/path-safety-D5Qwl40b.mjs +0 -2
  362. package/dist/path-safety-D5Qwl40b.mjs.map +0 -1
  363. package/dist/policy-bundle-manifest-D6dkbjNi.mjs +0 -7
  364. package/dist/policy-bundle-manifest-D6dkbjNi.mjs.map +0 -1
  365. package/dist/printResult-CHe3nRN4.mjs +0 -33
  366. package/dist/printResult-CHe3nRN4.mjs.map +0 -1
  367. package/dist/project-plan-apply-Dvndx455.mjs +0 -3
  368. package/dist/prompts-ClBXdELk.mjs +0 -4
  369. package/dist/prompts-ClBXdELk.mjs.map +0 -1
  370. package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DbFFXAVM.mjs +0 -2
  371. package/dist/pullManualEnrichmentIdentifiersToCsv-D5is0Nrs.mjs +0 -2
  372. package/dist/pushManualEnrichmentIdentifiersFromCsv-0WHf6d_m.mjs +0 -2
  373. package/dist/resolveBundleIdByName-qXZBrUz_.mjs +0 -2
  374. package/dist/resolveBundleIdByName-qXZBrUz_.mjs.map +0 -1
  375. package/dist/resolvePolicyBundleVersion-BG7XqBBP.mjs +0 -2
  376. package/dist/resolvePolicyBundleVersion-BG7XqBBP.mjs.map +0 -1
  377. package/dist/scaffold-model-BAbYTR0q.mjs.map +0 -1
  378. package/dist/updateConsentManagerVersionToLatest-yZhBDcv8.mjs +0 -2
  379. package/dist/validateTranscendAuth-D6Wr1cxY.mjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"fuzzyMatchColumns-CQCzpjWC.mjs","names":[],"sources":["../src/lib/requests/fuzzyMatchColumns.ts"],"sourcesContent":["import fuzzysearch from 'fuzzysearch';\nimport inquirer from 'inquirer';\n\nimport { NONE, BULK_APPLY } from './constants.js';\n\n/**\n * Check if word1 and word2 are a fuzzy match of each other.\n * Returns true if word1 is fuzzy match of word2 or vice versa.\n *\n * @param word1 - First word\n * @param word2 - Second word\n * @returns True if words are fuzzy match\n */\nexport function fuzzySearch(word1: string, word2: string): boolean {\n return (\n fuzzysearch(word1.toLowerCase(), word2.toLowerCase()) ||\n fuzzysearch(word2.toLowerCase(), word1.toLowerCase())\n );\n}\n\n/**\n * Fuzzy match column names for a particular field\n *\n * @param allColumnNames - List of all column names\n * @param fuzzyMapName - The name of field being mapped to\n * @param isRequired - When true, don't include \"NONE\" as an option\n * @param canApplyAll - When true, include an option to specify the value in bulk\n * @returns The list of suggestions for inquirer\n */\nexport function fuzzyMatchColumns(\n allColumnNames: string[],\n fuzzyMapName: string,\n isRequired: boolean,\n canApplyAll?: boolean,\n): (string | InstanceType<typeof inquirer.Separator>)[] {\n const matchingColumnNames = allColumnNames.filter((x) =>\n fuzzySearch(fuzzyMapName.toLowerCase(), x.toLowerCase()),\n );\n return [\n ...matchingColumnNames,\n new inquirer.Separator(),\n ...(isRequired ? [] : [NONE]),\n ...(canApplyAll ? [BULK_APPLY] : []),\n ...allColumnNames.filter((x) => !matchingColumnNames.includes(x)),\n ];\n}\n"],"mappings":"uGAaA,SAAgB,EAAY,EAAe,EAAwB,CACjE,OACE,EAAY,EAAM,aAAa,CAAE,EAAM,aAAa,CAAC,EACrD,EAAY,EAAM,aAAa,CAAE,EAAM,aAAa,CAAC,CAazD,SAAgB,EACd,EACA,EACA,EACA,EACsD,CACtD,IAAM,EAAsB,EAAe,OAAQ,GACjD,EAAY,EAAa,aAAa,CAAE,EAAE,aAAa,CAAC,CACzD,CACD,MAAO,CACL,GAAG,EACH,IAAI,EAAS,UACb,GAAI,EAAa,EAAE,CAAG,CAAC,EAAK,CAC5B,GAAI,EAAc,CAAC,EAAW,CAAG,EAAE,CACnC,GAAG,EAAe,OAAQ,GAAM,CAAC,EAAoB,SAAS,EAAE,CAAC,CAClE"}
1
+ {"version":3,"file":"fuzzyMatchColumns-2NmQqCZI.mjs","names":[],"sources":["../src/lib/requests/fuzzyMatchColumns.ts"],"sourcesContent":["import fuzzysearch from 'fuzzysearch';\nimport inquirer from 'inquirer';\n\nimport { NONE, BULK_APPLY } from './constants.js';\n\n/**\n * Check if word1 and word2 are a fuzzy match of each other.\n * Returns true if word1 is fuzzy match of word2 or vice versa.\n *\n * @param word1 - First word\n * @param word2 - Second word\n * @returns True if words are fuzzy match\n */\nexport function fuzzySearch(word1: string, word2: string): boolean {\n return (\n fuzzysearch(word1.toLowerCase(), word2.toLowerCase()) ||\n fuzzysearch(word2.toLowerCase(), word1.toLowerCase())\n );\n}\n\n/**\n * Fuzzy match column names for a particular field\n *\n * @param allColumnNames - List of all column names\n * @param fuzzyMapName - The name of field being mapped to\n * @param isRequired - When true, don't include \"NONE\" as an option\n * @param canApplyAll - When true, include an option to specify the value in bulk\n * @returns The list of suggestions for inquirer\n */\nexport function fuzzyMatchColumns(\n allColumnNames: string[],\n fuzzyMapName: string,\n isRequired: boolean,\n canApplyAll?: boolean,\n): (string | InstanceType<typeof inquirer.Separator>)[] {\n const matchingColumnNames = allColumnNames.filter((x) =>\n fuzzySearch(fuzzyMapName.toLowerCase(), x.toLowerCase()),\n );\n return [\n ...matchingColumnNames,\n new inquirer.Separator(),\n ...(isRequired ? [] : [NONE]),\n ...(canApplyAll ? [BULK_APPLY] : []),\n ...allColumnNames.filter((x) => !matchingColumnNames.includes(x)),\n ];\n}\n"],"mappings":"uGAaA,SAAgB,EAAY,EAAe,EAAwB,CACjE,OACE,EAAY,EAAM,aAAa,CAAE,EAAM,aAAa,CAAC,EACrD,EAAY,EAAM,aAAa,CAAE,EAAM,aAAa,CAAC,CAazD,SAAgB,EACd,EACA,EACA,EACA,EACsD,CACtD,IAAM,EAAsB,EAAe,OAAQ,GACjD,EAAY,EAAa,aAAa,CAAE,EAAE,aAAa,CAAC,CACzD,CACD,MAAO,CACL,GAAG,EACH,IAAI,EAAS,UACb,GAAI,EAAa,EAAE,CAAG,CAAC,EAAK,CAC5B,GAAI,EAAc,CAAC,EAAW,CAAG,EAAE,CACnC,GAAG,EAAe,OAAQ,GAAM,CAAC,EAAoB,SAAS,EAAE,CAAC,CAClE"}
@@ -1,2 +1,2 @@
1
- import{a as e}from"./constants-Upxn_rQF.mjs";import{t}from"./logger-zplFSeXU.mjs";import n from"colors";import{assumeRole as r,buildTranscendGraphQLClientGeneric as i,createApiKey as a,deleteApiKey as o,fetchAllApiKeys as s,loginUser as c}from"@transcend-io/sdk";import{mapSeries as l}from"@transcend-io/utils";async function u({email:u,password:d,scopes:f,apiKeyTitle:p,parentOrganizationId:m,deleteExistingApiKey:h=!0,createNewApiKey:g=!0,transcendUrl:_=e}){let v=await i(_,{});t.info(n.magenta(`Logging in using email and password.`));let{roles:y,loginCookie:b}=await c(v,{email:u,password:d,logger:t});t.info(n.green(`Successfully logged in and found ${y.length} role${y.length===1?``:`s`}!`));let x=m?y.filter(e=>e.organization.id===m||e.organization.parentOrganizationId===m):y;v.setHeaders({Cookie:b});let S=[],C=[];return t.info(n.magenta(`Generating API keys with title: ${p}, scopes: ${f.join(`,`)}.`)),await l(x,async e=>{try{await r(v,{roleId:e.id,email:u,logger:t}),t.info(n.magenta(`Checking if API key already exists in organization "${e.organization.name}" with title: "${p}".`));let[i]=await s(v,{logger:t,filterBy:{titles:[p]}});if(i&&h)t.info(n.yellow(`Deleting existing API key in "${e.organization.name}" with title: "${p}".`)),await o(v,{id:i.id,logger:t}),t.info(n.green(`Successfully deleted API key in "${e.organization.name}" with title: "${p}".`));else if(i)throw Error(`API key already exists with title: "${p}"`);if(g){t.info(n.magenta(`Creating API key in "${e.organization.name}" with title: "${p}".`));let{apiKey:r}=await a(v,{input:{title:p,scopes:f},logger:t});S.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:r}),t.info(n.green(`Successfully created API key in "${e.organization.name}" with title: "${p}".`))}else S.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:``})}catch(r){t.error(n.red(`Failed to create API key in organization "${e.organization.name}"! - ${r.message}`)),C.push({organizationName:e.organization.name,organizationId:e.organization.id,error:r.message})}}),t.info(n.green(`Successfully created ${S.length} API key${S.length===1?``:`s`}`)),C.length>0&&t.error(n.red(`Failed to create ${C.length} API key${C.length===1?``:`s`}!`)),{errors:C,apiKeys:S}}export{u as t};
2
- //# sourceMappingURL=generateCrossAccountApiKeys-DWfJtB3t.mjs.map
1
+ import{a as e}from"./constants-BlKpAm3R.mjs";import{t}from"./logger-CPu6zbyQ.mjs";import n from"colors";import{mapSeries as r}from"@transcend-io/utils";import{assumeRole as i,buildTranscendGraphQLClientGeneric as a,createApiKey as o,deleteApiKey as s,fetchAllApiKeys as c,loginUser as l}from"@transcend-io/sdk";async function u({email:u,password:d,scopes:f,apiKeyTitle:p,parentOrganizationId:m,deleteExistingApiKey:h=!0,createNewApiKey:g=!0,transcendUrl:_=e}){let v=await a(_,{});t.info(n.magenta(`Logging in using email and password.`));let{roles:y,loginCookie:b}=await l(v,{email:u,password:d,logger:t});t.info(n.green(`Successfully logged in and found ${y.length} role${y.length===1?``:`s`}!`));let x=m?y.filter(e=>e.organization.id===m||e.organization.parentOrganizationId===m):y;v.setHeaders({Cookie:b});let S=[],C=[];return t.info(n.magenta(`Generating API keys with title: ${p}, scopes: ${f.join(`,`)}.`)),await r(x,async e=>{try{await i(v,{roleId:e.id,email:u,logger:t}),t.info(n.magenta(`Checking if API key already exists in organization "${e.organization.name}" with title: "${p}".`));let[r]=await c(v,{logger:t,filterBy:{titles:[p]}});if(r&&h)t.info(n.yellow(`Deleting existing API key in "${e.organization.name}" with title: "${p}".`)),await s(v,{id:r.id,logger:t}),t.info(n.green(`Successfully deleted API key in "${e.organization.name}" with title: "${p}".`));else if(r)throw Error(`API key already exists with title: "${p}"`);if(g){t.info(n.magenta(`Creating API key in "${e.organization.name}" with title: "${p}".`));let{apiKey:r}=await o(v,{input:{title:p,scopes:f},logger:t});S.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:r}),t.info(n.green(`Successfully created API key in "${e.organization.name}" with title: "${p}".`))}else S.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:``})}catch(r){t.error(n.red(`Failed to create API key in organization "${e.organization.name}"! - ${r.message}`)),C.push({organizationName:e.organization.name,organizationId:e.organization.id,error:r.message})}}),t.info(n.green(`Successfully created ${S.length} API key${S.length===1?``:`s`}`)),C.length>0&&t.error(n.red(`Failed to create ${C.length} API key${C.length===1?``:`s`}!`)),{errors:C,apiKeys:S}}export{u as t};
2
+ //# sourceMappingURL=generateCrossAccountApiKeys-CVdsJFOe.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateCrossAccountApiKeys-DWfJtB3t.mjs","names":[],"sources":["../src/lib/api-keys/generateCrossAccountApiKeys.ts"],"sourcesContent":["import { ScopeName } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClientGeneric,\n loginUser,\n createApiKey,\n fetchAllApiKeys,\n deleteApiKey,\n assumeRole,\n} from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { StoredApiKey } from '../../codecs.js';\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\n\nexport interface ApiKeyGenerateError {\n /** Name of instance */\n organizationName: string;\n /** Error */\n error: string;\n /** Organization ID API key is for */\n organizationId: string;\n}\n\n/**\n * Generate API keys across multiple transcend accounts\n *\n * @param options - Options\n * @returns Number of API keys created\n */\nexport async function generateCrossAccountApiKeys({\n email,\n password,\n scopes,\n apiKeyTitle,\n parentOrganizationId,\n deleteExistingApiKey = true,\n createNewApiKey = true,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** Email address of user generating API keys */\n email: string;\n /** Password of user generating API keys */\n password: string;\n /** Filter for organizations that match this parent organization ID */\n parentOrganizationId?: string;\n /** Title of the API create to create */\n apiKeyTitle: string;\n /** Title of the API create to create */\n scopes: ScopeName[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** When true delete existing API keys with that title, if set to false an API key exists with that title, an error is thrown */\n deleteExistingApiKey?: boolean;\n /** When true, generate new API keys, otherwise only will delete past API keys */\n createNewApiKey?: boolean;\n}): Promise<{\n /** Successfully generated */\n apiKeys: StoredApiKey[];\n /** Error results */\n errors: ApiKeyGenerateError[];\n}> {\n // Create GraphQL client\n const client = await buildTranscendGraphQLClientGeneric(transcendUrl, {});\n\n // Login the user\n logger.info(colors.magenta('Logging in using email and password.'));\n const { roles, loginCookie } = await loginUser(client, { email, password, logger });\n logger.info(\n colors.green(\n `Successfully logged in and found ${roles.length} role${roles.length === 1 ? '' : 's'}!`,\n ),\n );\n\n // Filter down by parentOrganizationId\n const filteredRoles = parentOrganizationId\n ? roles.filter(\n (role) =>\n role.organization.id === parentOrganizationId ||\n role.organization.parentOrganizationId === parentOrganizationId,\n )\n : roles;\n\n // Save cookie to call route subsequent times\n client.setHeaders({\n Cookie: loginCookie,\n });\n\n // Save the resulting API keys\n const results: StoredApiKey[] = [];\n const errors: ApiKeyGenerateError[] = [];\n\n // Generate API keys\n logger.info(\n colors.magenta(`Generating API keys with title: ${apiKeyTitle}, scopes: ${scopes.join(',')}.`),\n );\n\n // Map over each role\n await mapSeries(filteredRoles, async (role) => {\n try {\n // Log into the other instance\n await assumeRole(client, { roleId: role.id, email, logger });\n\n // Grab API keys with that title\n logger.info(\n colors.magenta(\n `Checking if API key already exists in organization \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n\n // Delete existing API key\n const [apiKeyWithTitle] = await fetchAllApiKeys(client, {\n logger,\n filterBy: { titles: [apiKeyTitle] },\n });\n if (apiKeyWithTitle && deleteExistingApiKey) {\n logger.info(\n colors.yellow(\n `Deleting existing API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n await deleteApiKey(client, { id: apiKeyWithTitle.id, logger });\n logger.info(\n colors.green(\n `Successfully deleted API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else if (apiKeyWithTitle) {\n // throw error if one exists but not configured to delete\n throw new Error(`API key already exists with title: \"${apiKeyTitle}\"`);\n }\n\n // Create the API key\n if (createNewApiKey) {\n logger.info(\n colors.magenta(\n `Creating API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n const { apiKey } = await createApiKey(client, {\n input: { title: apiKeyTitle, scopes },\n logger,\n });\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey,\n });\n logger.info(\n colors.green(\n `Successfully created API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else {\n // Delete only\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey: '',\n });\n }\n } catch (err) {\n logger.error(\n colors.red(\n `Failed to create API key in organization \"${role.organization.name}\"! - ${err.message}`,\n ),\n );\n errors.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n error: err.message,\n });\n }\n });\n logger.info(\n colors.green(\n `Successfully created ${results.length} API key${results.length === 1 ? '' : 's'}`,\n ),\n );\n\n if (errors.length > 0) {\n logger.error(\n colors.red(`Failed to create ${errors.length} API key${errors.length === 1 ? '' : 's'}!`),\n );\n }\n\n return { errors, apiKeys: results };\n}\n"],"mappings":"uTA+BA,eAAsB,EAA4B,CAChD,QACA,WACA,SACA,cACA,uBACA,uBAAuB,GACvB,kBAAkB,GAClB,eAAe,GAuBd,CAED,IAAM,EAAS,MAAM,EAAmC,EAAc,EAAE,CAAC,CAGzE,EAAO,KAAK,EAAO,QAAQ,uCAAuC,CAAC,CACnE,GAAM,CAAE,QAAO,eAAgB,MAAM,EAAU,EAAQ,CAAE,QAAO,WAAU,SAAQ,CAAC,CACnF,EAAO,KACL,EAAO,MACL,oCAAoC,EAAM,OAAO,OAAO,EAAM,SAAW,EAAI,GAAK,IAAI,GACvF,CACF,CAGD,IAAM,EAAgB,EAClB,EAAM,OACH,GACC,EAAK,aAAa,KAAO,GACzB,EAAK,aAAa,uBAAyB,EAC9C,CACD,EAGJ,EAAO,WAAW,CAChB,OAAQ,EACT,CAAC,CAGF,IAAM,EAA0B,EAAE,CAC5B,EAAgC,EAAE,CAgGxC,OA7FA,EAAO,KACL,EAAO,QAAQ,mCAAmC,EAAY,YAAY,EAAO,KAAK,IAAI,CAAC,GAAG,CAC/F,CAGD,MAAM,EAAU,EAAe,KAAO,IAAS,CAC7C,GAAI,CAEF,MAAM,EAAW,EAAQ,CAAE,OAAQ,EAAK,GAAI,QAAO,SAAQ,CAAC,CAG5D,EAAO,KACL,EAAO,QACL,uDAAuD,EAAK,aAAa,KAAK,iBAAiB,EAAY,IAC5G,CACF,CAGD,GAAM,CAAC,GAAmB,MAAM,EAAgB,EAAQ,CACtD,SACA,SAAU,CAAE,OAAQ,CAAC,EAAY,CAAE,CACpC,CAAC,CACF,GAAI,GAAmB,EACrB,EAAO,KACL,EAAO,OACL,iCAAiC,EAAK,aAAa,KAAK,iBAAiB,EAAY,IACtF,CACF,CACD,MAAM,EAAa,EAAQ,CAAE,GAAI,EAAgB,GAAI,SAAQ,CAAC,CAC9D,EAAO,KACL,EAAO,MACL,oCAAoC,EAAK,aAAa,KAAK,iBAAiB,EAAY,IACzF,CACF,SACQ,EAET,MAAU,MAAM,uCAAuC,EAAY,GAAG,CAIxE,GAAI,EAAiB,CACnB,EAAO,KACL,EAAO,QACL,wBAAwB,EAAK,aAAa,KAAK,iBAAiB,EAAY,IAC7E,CACF,CACD,GAAM,CAAE,UAAW,MAAM,EAAa,EAAQ,CAC5C,MAAO,CAAE,MAAO,EAAa,SAAQ,CACrC,SACD,CAAC,CACF,EAAQ,KAAK,CACX,iBAAkB,EAAK,aAAa,KACpC,eAAgB,EAAK,aAAa,GAClC,SACD,CAAC,CACF,EAAO,KACL,EAAO,MACL,oCAAoC,EAAK,aAAa,KAAK,iBAAiB,EAAY,IACzF,CACF,MAGD,EAAQ,KAAK,CACX,iBAAkB,EAAK,aAAa,KACpC,eAAgB,EAAK,aAAa,GAClC,OAAQ,GACT,CAAC,OAEG,EAAK,CACZ,EAAO,MACL,EAAO,IACL,6CAA6C,EAAK,aAAa,KAAK,OAAO,EAAI,UAChF,CACF,CACD,EAAO,KAAK,CACV,iBAAkB,EAAK,aAAa,KACpC,eAAgB,EAAK,aAAa,GAClC,MAAO,EAAI,QACZ,CAAC,GAEJ,CACF,EAAO,KACL,EAAO,MACL,wBAAwB,EAAQ,OAAO,UAAU,EAAQ,SAAW,EAAI,GAAK,MAC9E,CACF,CAEG,EAAO,OAAS,GAClB,EAAO,MACL,EAAO,IAAI,oBAAoB,EAAO,OAAO,UAAU,EAAO,SAAW,EAAI,GAAK,IAAI,GAAG,CAC1F,CAGI,CAAE,SAAQ,QAAS,EAAS"}
1
+ {"version":3,"file":"generateCrossAccountApiKeys-CVdsJFOe.mjs","names":[],"sources":["../src/lib/api-keys/generateCrossAccountApiKeys.ts"],"sourcesContent":["import { ScopeName } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClientGeneric,\n loginUser,\n createApiKey,\n fetchAllApiKeys,\n deleteApiKey,\n assumeRole,\n} from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { StoredApiKey } from '../../codecs.js';\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\n\nexport interface ApiKeyGenerateError {\n /** Name of instance */\n organizationName: string;\n /** Error */\n error: string;\n /** Organization ID API key is for */\n organizationId: string;\n}\n\n/**\n * Generate API keys across multiple transcend accounts\n *\n * @param options - Options\n * @returns Number of API keys created\n */\nexport async function generateCrossAccountApiKeys({\n email,\n password,\n scopes,\n apiKeyTitle,\n parentOrganizationId,\n deleteExistingApiKey = true,\n createNewApiKey = true,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** Email address of user generating API keys */\n email: string;\n /** Password of user generating API keys */\n password: string;\n /** Filter for organizations that match this parent organization ID */\n parentOrganizationId?: string;\n /** Title of the API create to create */\n apiKeyTitle: string;\n /** Title of the API create to create */\n scopes: ScopeName[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** When true delete existing API keys with that title, if set to false an API key exists with that title, an error is thrown */\n deleteExistingApiKey?: boolean;\n /** When true, generate new API keys, otherwise only will delete past API keys */\n createNewApiKey?: boolean;\n}): Promise<{\n /** Successfully generated */\n apiKeys: StoredApiKey[];\n /** Error results */\n errors: ApiKeyGenerateError[];\n}> {\n // Create GraphQL client\n const client = await buildTranscendGraphQLClientGeneric(transcendUrl, {});\n\n // Login the user\n logger.info(colors.magenta('Logging in using email and password.'));\n const { roles, loginCookie } = await loginUser(client, { email, password, logger });\n logger.info(\n colors.green(\n `Successfully logged in and found ${roles.length} role${roles.length === 1 ? '' : 's'}!`,\n ),\n );\n\n // Filter down by parentOrganizationId\n const filteredRoles = parentOrganizationId\n ? roles.filter(\n (role) =>\n role.organization.id === parentOrganizationId ||\n role.organization.parentOrganizationId === parentOrganizationId,\n )\n : roles;\n\n // Save cookie to call route subsequent times\n client.setHeaders({\n Cookie: loginCookie,\n });\n\n // Save the resulting API keys\n const results: StoredApiKey[] = [];\n const errors: ApiKeyGenerateError[] = [];\n\n // Generate API keys\n logger.info(\n colors.magenta(`Generating API keys with title: ${apiKeyTitle}, scopes: ${scopes.join(',')}.`),\n );\n\n // Map over each role\n await mapSeries(filteredRoles, async (role) => {\n try {\n // Log into the other instance\n await assumeRole(client, { roleId: role.id, email, logger });\n\n // Grab API keys with that title\n logger.info(\n colors.magenta(\n `Checking if API key already exists in organization \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n\n // Delete existing API key\n const [apiKeyWithTitle] = await fetchAllApiKeys(client, {\n logger,\n filterBy: { titles: [apiKeyTitle] },\n });\n if (apiKeyWithTitle && deleteExistingApiKey) {\n logger.info(\n colors.yellow(\n `Deleting existing API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n await deleteApiKey(client, { id: apiKeyWithTitle.id, logger });\n logger.info(\n colors.green(\n `Successfully deleted API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else if (apiKeyWithTitle) {\n // throw error if one exists but not configured to delete\n throw new Error(`API key already exists with title: \"${apiKeyTitle}\"`);\n }\n\n // Create the API key\n if (createNewApiKey) {\n logger.info(\n colors.magenta(\n `Creating API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n const { apiKey } = await createApiKey(client, {\n input: { title: apiKeyTitle, scopes },\n logger,\n });\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey,\n });\n logger.info(\n colors.green(\n `Successfully created API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else {\n // Delete only\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey: '',\n });\n }\n } catch (err) {\n logger.error(\n colors.red(\n `Failed to create API key in organization \"${role.organization.name}\"! - ${err.message}`,\n ),\n );\n errors.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n error: err.message,\n });\n }\n });\n logger.info(\n colors.green(\n `Successfully created ${results.length} API key${results.length === 1 ? '' : 's'}`,\n ),\n );\n\n if (errors.length > 0) {\n logger.error(\n colors.red(`Failed to create ${errors.length} API key${errors.length === 1 ? '' : 's'}!`),\n );\n }\n\n return { errors, apiKeys: results };\n}\n"],"mappings":"uTA+BA,eAAsB,EAA4B,CAChD,QACA,WACA,SACA,cACA,uBACA,uBAAuB,GACvB,kBAAkB,GAClB,eAAe,GAuBd,CAED,IAAM,EAAS,MAAM,EAAmC,EAAc,EAAE,CAAC,CAGzE,EAAO,KAAK,EAAO,QAAQ,uCAAuC,CAAC,CACnE,GAAM,CAAE,QAAO,eAAgB,MAAM,EAAU,EAAQ,CAAE,QAAO,WAAU,SAAQ,CAAC,CACnF,EAAO,KACL,EAAO,MACL,oCAAoC,EAAM,OAAO,OAAO,EAAM,SAAW,EAAI,GAAK,IAAI,GACvF,CACF,CAGD,IAAM,EAAgB,EAClB,EAAM,OACH,GACC,EAAK,aAAa,KAAO,GACzB,EAAK,aAAa,uBAAyB,EAC9C,CACD,EAGJ,EAAO,WAAW,CAChB,OAAQ,EACT,CAAC,CAGF,IAAM,EAA0B,EAAE,CAC5B,EAAgC,EAAE,CAgGxC,OA7FA,EAAO,KACL,EAAO,QAAQ,mCAAmC,EAAY,YAAY,EAAO,KAAK,IAAI,CAAC,GAAG,CAC/F,CAGD,MAAM,EAAU,EAAe,KAAO,IAAS,CAC7C,GAAI,CAEF,MAAM,EAAW,EAAQ,CAAE,OAAQ,EAAK,GAAI,QAAO,SAAQ,CAAC,CAG5D,EAAO,KACL,EAAO,QACL,uDAAuD,EAAK,aAAa,KAAK,iBAAiB,EAAY,IAC5G,CACF,CAGD,GAAM,CAAC,GAAmB,MAAM,EAAgB,EAAQ,CACtD,SACA,SAAU,CAAE,OAAQ,CAAC,EAAY,CAAE,CACpC,CAAC,CACF,GAAI,GAAmB,EACrB,EAAO,KACL,EAAO,OACL,iCAAiC,EAAK,aAAa,KAAK,iBAAiB,EAAY,IACtF,CACF,CACD,MAAM,EAAa,EAAQ,CAAE,GAAI,EAAgB,GAAI,SAAQ,CAAC,CAC9D,EAAO,KACL,EAAO,MACL,oCAAoC,EAAK,aAAa,KAAK,iBAAiB,EAAY,IACzF,CACF,SACQ,EAET,MAAU,MAAM,uCAAuC,EAAY,GAAG,CAIxE,GAAI,EAAiB,CACnB,EAAO,KACL,EAAO,QACL,wBAAwB,EAAK,aAAa,KAAK,iBAAiB,EAAY,IAC7E,CACF,CACD,GAAM,CAAE,UAAW,MAAM,EAAa,EAAQ,CAC5C,MAAO,CAAE,MAAO,EAAa,SAAQ,CACrC,SACD,CAAC,CACF,EAAQ,KAAK,CACX,iBAAkB,EAAK,aAAa,KACpC,eAAgB,EAAK,aAAa,GAClC,SACD,CAAC,CACF,EAAO,KACL,EAAO,MACL,oCAAoC,EAAK,aAAa,KAAK,iBAAiB,EAAY,IACzF,CACF,MAGD,EAAQ,KAAK,CACX,iBAAkB,EAAK,aAAa,KACpC,eAAgB,EAAK,aAAa,GAClC,OAAQ,GACT,CAAC,OAEG,EAAK,CACZ,EAAO,MACL,EAAO,IACL,6CAA6C,EAAK,aAAa,KAAK,OAAO,EAAI,UAChF,CACF,CACD,EAAO,KAAK,CACV,iBAAkB,EAAK,aAAa,KACpC,eAAgB,EAAK,aAAa,GAClC,MAAO,EAAI,QACZ,CAAC,GAEJ,CACF,EAAO,KACL,EAAO,MACL,wBAAwB,EAAQ,OAAO,UAAU,EAAQ,SAAW,EAAI,GAAK,MAC9E,CACF,CAEG,EAAO,OAAS,GAClB,EAAO,MACL,EAAO,IAAI,oBAAoB,EAAO,OAAO,UAAU,EAAO,SAAW,EAAI,GAAK,IAAI,GAAG,CAC1F,CAGI,CAAE,SAAQ,QAAS,EAAS"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./validateTranscendAuth-D-dDINof.mjs";import{t}from"./done-input-validation-LiTaCEzF.mjs";import{t as n}from"./command-output-BJcDRXNr.mjs";import{t as r}from"./command-output-BRfF3YFv.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,fetchAllCustomFunctions as o}from"@transcend-io/sdk";async function s({auth:s,transcendUrl:c,json:l}){t(this.process);let u=e(s,this);Array.isArray(u)&&(this.logger.error(i.red(`transcend custom-functions list does not support a list of API keys — pass a single API key.`)),this.process.exit(1));let d=await o(a(c,u),{logger:n(this.logger,l)});if(l){let e=r(d);this.process.stdout.write(`${JSON.stringify(e)}\n`);return}if(d.length===0){this.logger.info(i.yellow(`No custom functions found in this organization.`));return}this.logger.info(i.magenta(`Found ${d.length} custom function(s):`)),d.forEach(e=>{let t=e.activeVersion?`active v${e.activeVersion.versionNumber}`:`no active version`,n=e.hasPendingDraft&&e.draftVersion?`, pending draft v${e.draftVersion.versionNumber}`:``;this.logger.info(` - ${i.green(e.name)} [${e.type}] (${e.lifecycleState.toLowerCase()}, ${t}${n}) `+i.dim(`id: ${e.id}`))})}export{s as list};
2
+ //# sourceMappingURL=impl-0-_oxvck.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-0-_oxvck.mjs","names":[],"sources":["../src/commands/custom-functions/list/impl.ts"],"sourcesContent":["import { buildTranscendGraphQLClient, fetchAllCustomFunctions } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { selectCommandLogger } from '../../../lib/cli/command-output.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { buildCustomFunctionListJsonResult } from '../../../lib/custom-functions/command-output.js';\n\nexport interface CustomFunctionsListCommandFlags {\n /** Transcend API key. */\n auth: string;\n /** Transcend backend URL. */\n transcendUrl: string;\n /** Emit stable JSON output. */\n json: boolean;\n}\n\nexport async function list(\n this: LocalContext,\n { auth, transcendUrl, json }: CustomFunctionsListCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n const apiKeyOrList = validateTranscendAuth(auth, this);\n if (Array.isArray(apiKeyOrList)) {\n this.logger.error(\n colors.red(\n 'transcend custom-functions list does not support a list of API keys — pass a single API key.',\n ),\n );\n this.process.exit(1);\n }\n\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList as string);\n const commandLogger = selectCommandLogger(this.logger, json);\n const customFunctions = await fetchAllCustomFunctions(client, { logger: commandLogger });\n\n if (json) {\n const result = buildCustomFunctionListJsonResult(customFunctions);\n this.process.stdout.write(`${JSON.stringify(result)}\\n`);\n return;\n }\n\n if (customFunctions.length === 0) {\n this.logger.info(colors.yellow('No custom functions found in this organization.'));\n return;\n }\n\n this.logger.info(colors.magenta(`Found ${customFunctions.length} custom function(s):`));\n customFunctions.forEach((customFunction) => {\n const active = customFunction.activeVersion\n ? `active v${customFunction.activeVersion.versionNumber}`\n : 'no active version';\n const draft =\n customFunction.hasPendingDraft && customFunction.draftVersion\n ? `, pending draft v${customFunction.draftVersion.versionNumber}`\n : '';\n this.logger.info(\n ` - ${colors.green(customFunction.name)} [${customFunction.type}] ` +\n `(${customFunction.lifecycleState.toLowerCase()}, ${active}${draft}) ` +\n colors.dim(`id: ${customFunction.id}`),\n );\n });\n}\n"],"mappings":"oUAkBA,eAAsB,EAEpB,CAAE,OAAM,eAAc,QACP,CACf,EAAoB,KAAK,QAAQ,CAEjC,IAAM,EAAe,EAAsB,EAAM,KAAK,CAClD,MAAM,QAAQ,EAAa,GAC7B,KAAK,OAAO,MACV,EAAO,IACL,+FACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAKtB,IAAM,EAAkB,MAAM,EAFf,EAA4B,EAAc,EAEG,CAAE,CAAE,OAD1C,EAAoB,KAAK,OAAQ,EAC8B,CAAE,CAAC,CAExF,GAAI,EAAM,CACR,IAAM,EAAS,EAAkC,EAAgB,CACjE,KAAK,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,EAAO,CAAC,IAAI,CACxD,OAGF,GAAI,EAAgB,SAAW,EAAG,CAChC,KAAK,OAAO,KAAK,EAAO,OAAO,kDAAkD,CAAC,CAClF,OAGF,KAAK,OAAO,KAAK,EAAO,QAAQ,SAAS,EAAgB,OAAO,sBAAsB,CAAC,CACvF,EAAgB,QAAS,GAAmB,CAC1C,IAAM,EAAS,EAAe,cAC1B,WAAW,EAAe,cAAc,gBACxC,oBACE,EACJ,EAAe,iBAAmB,EAAe,aAC7C,oBAAoB,EAAe,aAAa,gBAChD,GACN,KAAK,OAAO,KACV,OAAO,EAAO,MAAM,EAAe,KAAK,CAAC,IAAI,EAAe,KAAK,KAC3D,EAAe,eAAe,aAAa,CAAC,IAAI,IAAS,EAAM,IACnE,EAAO,IAAI,OAAO,EAAe,KAAK,CACzC,EACD"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./removeUnverifiedRequestIdentifiers-Do3Pus6m.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-ByFyaZkK.mjs.map
1
+ import{t as e}from"./removeUnverifiedRequestIdentifiers-DcI9ut4q.mjs";import{t}from"./done-input-validation-LiTaCEzF.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-2sYR_UFO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-ByFyaZkK.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-2sYR_UFO.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,2 +1,2 @@
1
- import{D as e}from"./codecs-CTxFjCg4.mjs";import{t}from"./readCsv-DLg8pwjd.mjs";import{t as n}from"./mapConsentCsvRowsToInputs-Dqb6WL4r.mjs";import{t as r}from"./done-input-validation-BUz-aVC5.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,syncCookies as o}from"@transcend-io/sdk";async function s({auth:s,trackerStatus:c,file:l,transcendUrl:u}){r(this.process),this.logger.info(i.magenta(`Reading "${l}" from disk`));let d=n(t(this.fs.readFileSync(l,`utf8`),e),c);await o(a(u,s),d,{logger:this.logger})||(this.logger.error(i.red(`Encountered error(s) syncing cookies from CSV, see logs above for more info. `)),this.process.exit(1))}export{s as uploadCookiesFromCsv};
2
- //# sourceMappingURL=impl-DRpK-QLC.mjs.map
1
+ import{D as e}from"./codecs-CfcaFoZR.mjs";import{t}from"./readCsv-DNcJ_UfU.mjs";import{t as n}from"./mapConsentCsvRowsToInputs-CkLfxaIf.mjs";import{t as r}from"./done-input-validation-LiTaCEzF.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,syncCookies as o}from"@transcend-io/sdk";async function s({auth:s,trackerStatus:c,file:l,transcendUrl:u}){r(this.process),this.logger.info(i.magenta(`Reading "${l}" from disk`));let d=n(t(this.fs.readFileSync(l,`utf8`),e),c);await o(a(u,s),d,{logger:this.logger})||(this.logger.error(i.red(`Encountered error(s) syncing cookies from CSV, see logs above for more info. `)),this.process.exit(1))}export{s as uploadCookiesFromCsv};
2
+ //# sourceMappingURL=impl-ApZGIx6l.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DRpK-QLC.mjs","names":[],"sources":["../src/commands/consent/upload-cookies-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncCookies } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport { CookieCsvInput } from '../../../codecs.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { mapCookieCsvRowsToInputs } from '../../../lib/consent-manager/mapConsentCsvRowsToInputs.js';\nimport { parseCsv } from '../../../lib/requests/readCsv.js';\n\nexport interface UploadCookiesFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n transcendUrl: string;\n}\n\nexport async function uploadCookiesFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, transcendUrl }: UploadCookiesFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n this.logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const cookieRows = parseCsv(this.fs.readFileSync(file, 'utf8'), CookieCsvInput);\n const cookieInputs = mapCookieCsvRowsToInputs(cookieRows, trackerStatus);\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const syncedCookies = await syncCookies(client, cookieInputs, { logger: this.logger });\n\n if (!syncedCookies) {\n this.logger.error(\n colors.red('Encountered error(s) syncing cookies from CSV, see logs above for more info. '),\n );\n this.process.exit(1);\n }\n}\n"],"mappings":"6SAiBA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,gBACd,CACf,EAAoB,KAAK,QAAQ,CAEjC,KAAK,OAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAE/D,IAAM,EAAe,EADF,EAAS,KAAK,GAAG,aAAa,EAAM,OAAO,CAAE,EACR,CAAE,EAAc,CAInE,MAFuB,EADb,EAA4B,EAAc,EACX,CAAE,EAAc,CAAE,OAAQ,KAAK,OAAQ,CAAC,GAGpF,KAAK,OAAO,MACV,EAAO,IAAI,gFAAgF,CAC5F,CACD,KAAK,QAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"impl-ApZGIx6l.mjs","names":[],"sources":["../src/commands/consent/upload-cookies-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncCookies } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport { CookieCsvInput } from '../../../codecs.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { mapCookieCsvRowsToInputs } from '../../../lib/consent-manager/mapConsentCsvRowsToInputs.js';\nimport { parseCsv } from '../../../lib/requests/readCsv.js';\n\nexport interface UploadCookiesFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n transcendUrl: string;\n}\n\nexport async function uploadCookiesFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, transcendUrl }: UploadCookiesFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n this.logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const cookieRows = parseCsv(this.fs.readFileSync(file, 'utf8'), CookieCsvInput);\n const cookieInputs = mapCookieCsvRowsToInputs(cookieRows, trackerStatus);\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const syncedCookies = await syncCookies(client, cookieInputs, { logger: this.logger });\n\n if (!syncedCookies) {\n this.logger.error(\n colors.red('Encountered error(s) syncing cookies from CSV, see logs above for more info. '),\n );\n this.process.exit(1);\n }\n}\n"],"mappings":"6SAiBA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,gBACd,CACf,EAAoB,KAAK,QAAQ,CAEjC,KAAK,OAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAE/D,IAAM,EAAe,EADF,EAAS,KAAK,GAAG,aAAa,EAAM,OAAO,CAAE,EACR,CAAE,EAAc,CAInE,MAFuB,EADb,EAA4B,EAAc,EACX,CAAE,EAAc,CAAE,OAAQ,KAAK,OAAQ,CAAC,GAGpF,KAAK,OAAO,MACV,EAAO,IAAI,gFAAgF,CAC5F,CACD,KAAK,QAAQ,KAAK,EAAE"}
@@ -1,2 +1,2 @@
1
- import{N as e}from"./codecs-CTxFjCg4.mjs";import{t}from"./readCsv-DLg8pwjd.mjs";import{n}from"./mapConsentCsvRowsToInputs-Dqb6WL4r.mjs";import{t as r}from"./done-input-validation-BUz-aVC5.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,syncDataFlows as o}from"@transcend-io/sdk";async function s({auth:s,trackerStatus:c,file:l,classifyService:u,transcendUrl:d}){r(this.process),this.logger.info(i.magenta(`Reading "${l}" from disk`));let f=n(t(this.fs.readFileSync(l,`utf8`),e),c);await o(a(d,s),f,{classifyService:u,logger:this.logger})||(this.logger.error(i.red(`Encountered error(s) syncing data flows from CSV, see logs above for more info. `)),this.process.exit(1))}export{s as uploadDataFlowsFromCsv};
2
- //# sourceMappingURL=impl-DVeGQCrr.mjs.map
1
+ import{N as e}from"./codecs-CfcaFoZR.mjs";import{t}from"./readCsv-DNcJ_UfU.mjs";import{n}from"./mapConsentCsvRowsToInputs-CkLfxaIf.mjs";import{t as r}from"./done-input-validation-LiTaCEzF.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,syncDataFlows as o}from"@transcend-io/sdk";async function s({auth:s,trackerStatus:c,file:l,classifyService:u,transcendUrl:d}){r(this.process),this.logger.info(i.magenta(`Reading "${l}" from disk`));let f=n(t(this.fs.readFileSync(l,`utf8`),e),c);await o(a(d,s),f,{classifyService:u,logger:this.logger})||(this.logger.error(i.red(`Encountered error(s) syncing data flows from CSV, see logs above for more info. `)),this.process.exit(1))}export{s as uploadDataFlowsFromCsv};
2
+ //# sourceMappingURL=impl-Ay6JeH-7.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DVeGQCrr.mjs","names":[],"sources":["../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncDataFlows } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport { DataFlowCsvInput } from '../../../codecs.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { mapDataFlowCsvRowsToInputs } from '../../../lib/consent-manager/mapConsentCsvRowsToInputs.js';\nimport { parseCsv } from '../../../lib/requests/readCsv.js';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, classifyService, transcendUrl }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n this.logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const dataFlowRows = parseCsv(this.fs.readFileSync(file, 'utf8'), DataFlowCsvInput);\n const dataFlowInputs = mapDataFlowCsvRowsToInputs(dataFlowRows, trackerStatus);\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const syncedDataFlows = await syncDataFlows(client, dataFlowInputs, {\n classifyService,\n logger: this.logger,\n });\n\n if (!syncedDataFlows) {\n this.logger.error(\n colors.red(\n 'Encountered error(s) syncing data flows from CSV, see logs above for more info. ',\n ),\n );\n this.process.exit(1);\n }\n}\n"],"mappings":"0SAkBA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,kBAAiB,gBAC/B,CACf,EAAoB,KAAK,QAAQ,CAEjC,KAAK,OAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAE/D,IAAM,EAAiB,EADF,EAAS,KAAK,GAAG,aAAa,EAAM,OAAO,CAAE,EACJ,CAAE,EAAc,CAOzE,MALyB,EADf,EAA4B,EAAc,EACP,CAAE,EAAgB,CAClE,kBACA,OAAQ,KAAK,OACd,CAAC,GAGA,KAAK,OAAO,MACV,EAAO,IACL,mFACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"impl-Ay6JeH-7.mjs","names":[],"sources":["../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncDataFlows } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport { DataFlowCsvInput } from '../../../codecs.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { mapDataFlowCsvRowsToInputs } from '../../../lib/consent-manager/mapConsentCsvRowsToInputs.js';\nimport { parseCsv } from '../../../lib/requests/readCsv.js';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, classifyService, transcendUrl }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n this.logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const dataFlowRows = parseCsv(this.fs.readFileSync(file, 'utf8'), DataFlowCsvInput);\n const dataFlowInputs = mapDataFlowCsvRowsToInputs(dataFlowRows, trackerStatus);\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const syncedDataFlows = await syncDataFlows(client, dataFlowInputs, {\n classifyService,\n logger: this.logger,\n });\n\n if (!syncedDataFlows) {\n this.logger.error(\n colors.red(\n 'Encountered error(s) syncing data flows from CSV, see logs above for more info. ',\n ),\n );\n this.process.exit(1);\n }\n}\n"],"mappings":"0SAkBA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,kBAAiB,gBAC/B,CACf,EAAoB,KAAK,QAAQ,CAEjC,KAAK,OAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAE/D,IAAM,EAAiB,EADF,EAAS,KAAK,GAAG,aAAa,EAAM,OAAO,CAAE,EACJ,CAAE,EAAc,CAOzE,MALyB,EADf,EAA4B,EAAc,EACP,CAAE,EAAgB,CAClE,kBACA,OAAQ,KAAK,OACd,CAAC,GAGA,KAAK,OAAO,MACV,EAAO,IACL,mFACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE"}
@@ -0,0 +1,421 @@
1
+ import{g as e}from"./constants-BlKpAm3R.mjs";import{i as t,n,r,t as i}from"./project-plan-output-BHHlkLxe.mjs";import{c as a,d as o,f as s,l as c,t as l,u}from"./project-discovery-CWRjlFnC.mjs";import{b as d,d as f,r as p,t as m,u as h}from"./policy-project-discovery-B4cFXUlA.mjs";import{a as g,c as _,i as v,l as y,o as b,r as x,s as S,t as C}from"./policy-runtime-6jmkXlBk.mjs";import{t as w}from"./done-input-validation-LiTaCEzF.mjs";import{i as T,n as E,r as D,t as O}from"./prompts-BhXfYD6g.mjs";import{t as k}from"./run-captured-process-BjaSDWXG.mjs";import{t as A}from"./project-plan-apply-Bg_1eMX9.mjs";import{a as j,n as ee,o as te,r as ne,t as re}from"./policy-scaffold-config-CwlygiTz.mjs";import{isAbsolute as M,join as N,posix as P,relative as F,sep as I}from"node:path";import L from"colors";const R={Editor:`editor`,Skill:`skill`,Ci:`ci`};var z=`# Idiomatic Rego and document-tree authoring
2
+
3
+ ## Start from the document tree
4
+
5
+ OPA evaluates queries against one document tree:
6
+
7
+ - \`input\` is the request-specific document supplied by the caller.
8
+ - \`data\` contains loaded policy packages and static data.
9
+ - A Rego \`package\` determines where a module contributes documents below \`data\`.
10
+
11
+ Choose package paths from the application's required query and ownership
12
+ boundaries. Keep directory and package names aligned
13
+ (\`directory-package-mismatch\`), and cover every publishable package with a
14
+ \`.manifest\` root.
15
+
16
+ ### Multi-bundle template layout
17
+
18
+ Prefer a publish directory named \`{root}-bundle/\` so the package-root folder can
19
+ be \`{root}/\` without doubling names:
20
+
21
+ \`\`\`
22
+ example-bundle/ # transcend policy publish … <dir>
23
+ .manifest # roots + optional metadata.transcend.io.template / templateVersion
24
+ example/
25
+ result/… # package example.result
26
+ input.example.json
27
+ input.json # gitignored; VS Code / Regal Evaluate
28
+ input.schema.json # input JSON Schema for editors and opa --schema
29
+ \`\`\`
30
+
31
+ Permissions starters use the same layout. Upload does not branch on template
32
+ metadata; Permissions API still loads only the remote bundle named
33
+ \`permissions\` (publish with \`--remote-bundle-name=permissions\`). Local folder
34
+ (\`--bundle-dir\` / \`{root}-bundle/\`) and remote \`--remote-bundle-name\` are independent.
35
+
36
+ OPA \`.rego\` placement follows the \`package\` line; \`data.json\` paths follow the
37
+ filesystem and must sit under the manifest root prefix on disk.
38
+
39
+ Use Rego v1 explicitly:
40
+
41
+ \`\`\`rego
42
+ package example.result
43
+
44
+ import rego.v1
45
+ \`\`\`
46
+
47
+ When one publishable package reads another package under the same manifest root,
48
+ import it and use the local name:
49
+
50
+ \`\`\`rego
51
+ import data.example.facts
52
+
53
+ allow if facts.subject_is_trusted
54
+ \`\`\`
55
+
56
+ Do not use a fully qualified \`data.<root>…\` reference directly in a rule body.
57
+ Policy Engine re-namespaces package declarations and imports during activation,
58
+ and \`transcend policy lint\` rejects direct self-root references that would
59
+ change meaning.
60
+
61
+ ## Define the contract before implementation
62
+
63
+ Find the actual caller and document:
64
+
65
+ 1. the query path below \`data\`;
66
+ 2. required and optional \`input\` fields;
67
+ 3. the result document consumed by the caller;
68
+ 4. fail-closed behavior for absent, malformed, or unknown input;
69
+ 5. stable reason codes and any fields reserved for later extension.
70
+
71
+ Do not infer a product contract from the generated example. Replace its package
72
+ names and fields when the repository's contract is known.
73
+
74
+ Keep the input JSON Schema as \`input.schema.json\` in the publish directory.
75
+ Pass that file to \`opa check -s\` / \`transcend policy eval --schema\` when you want
76
+ OPA to type-check \`input\`.
77
+
78
+ ## Prefer declarative result construction
79
+
80
+ String decisions inside an object remain readable and extensible. Keep one
81
+ result document shape and derive its fields from named rules:
82
+
83
+ \`\`\`rego
84
+ default decision := "deny"
85
+
86
+ decision := "allow" if {
87
+ input.subject.trusted == true
88
+ }
89
+
90
+ default reason_code := "untrusted_or_invalid_input"
91
+
92
+ reason_code := "trusted_subject" if {
93
+ decision == "allow"
94
+ }
95
+ \`\`\`
96
+
97
+ Rego rules define documents; they are not an imperative sequence of variable
98
+ assignments. Prefer small named predicates and one result constructor over
99
+ repeated branch-specific copies of the full output object.
100
+
101
+ ## Fail closed
102
+
103
+ - Give the externally queried decision or result a deny/error default.
104
+ - Treat missing fields and unknown enum values as non-authorizing.
105
+ - Avoid broad truthiness checks when exact values are required.
106
+ - Add tests for malformed and incomplete inputs, not only expected allow cases.
107
+ - Add result fields compatibly so existing consumers can continue reading the
108
+ stable core.
109
+ `,B=`# Publishing
110
+
111
+ ## Validate the upload contract
112
+
113
+ \`.manifest\` declares the document-tree roots included in the Policy Engine
114
+ bundle. Each non-test Rego package must equal a root or be nested below one.
115
+ Test modules remain local and are excluded from the upload archive.
116
+
117
+ In this template, the publish directory is \`{root}-bundle/\` (the folder that
118
+ contains \`.manifest\`), not the inner \`{root}/\` package tree alone.
119
+
120
+ Scaffolded manifests may include optional OPA \`metadata\`:
121
+
122
+ \`\`\`json
123
+ "metadata": {
124
+ "transcend.io": {
125
+ "template": "generic",
126
+ "templateVersion": "<@transcend-io/cli version>"
127
+ }
128
+ }
129
+ \`\`\`
130
+
131
+ \`template\` (\`generic\` or \`permissions\`) and \`templateVersion\` (the
132
+ \`@transcend-io/cli\` version that generated the scaffold) are **authoring
133
+ hints**. Upload does not branch on them.
134
+
135
+ Before publishing:
136
+
137
+ 1. confirm the intended package and query paths with the consuming application;
138
+ 2. run \`transcend policy lint <bundle-directory> --noInteractive\` and tests;
139
+ 3. review the generated bundle name, version, description, and target Transcend environment;
140
+ 4. keep API keys in the environment or the repository's approved secret store.
141
+
142
+ The publish path validates strict Rego compatibility and bundle compilation
143
+ before creating the upload tarball.
144
+
145
+ ## Bundle names: local folder vs remote name
146
+
147
+ Upload uses one create/version path for every bundle. Keep these distinct:
148
+
149
+ - **Local** publish directory (\`{root}-bundle/\` or \`--bundle-dir\`) — the
150
+ \`<bundle>\` positional on \`policy publish\` / \`policy eval\`
151
+ - **Remote** \`--remote-bundle-name\` — the Policy Engine resource name in Transcend
152
+
153
+ What makes a bundle “Permissions” is convention plus where Sombra queries it:
154
+
155
+ - **Permissions API** always loads the fixed remote bundle name
156
+ \`permissions\`. Publish that starter with \`--remote-bundle-name=permissions\`.
157
+ - **Generic / decide** bundles use any other \`--remote-bundle-name\` and the decide
158
+ path.
159
+
160
+ \`policy publish\` may warn when \`.manifest\` metadata/roots look Permissions-
161
+ oriented but \`--remote-bundle-name\` is not \`permissions\` (or the reverse). The warning
162
+ does not block upload.
163
+
164
+ ## Publish deliberately
165
+
166
+ \`\`\`sh
167
+ # Generic / decide path
168
+ transcend policy publish --remote-bundle-name example --auth "$TRANSCEND_API_KEY" \\
169
+ transcend/policy/example-bundle
170
+
171
+ # Permissions API path (fixed remote name)
172
+ transcend policy publish --remote-bundle-name permissions --auth "$TRANSCEND_API_KEY" \\
173
+ transcend/policy/permissions-bundle
174
+ \`\`\`
175
+
176
+ Run \`transcend policy publish --help\` for current flags and scopes. Publishing
177
+ creates or updates remote Policy Engine bundle resources, so keep it out of
178
+ pull-request validation and require the repository's normal deployment approval.
179
+
180
+ Publish each \`{root}-bundle/\` separately with its own \`--remote-bundle-name\`. Do not
181
+ add publishing, Transcend API credentials, or environment activation to the
182
+ validation-only workflow generated by \`policy init\`.
183
+ `,V=`# Setup and tooling
184
+
185
+ ## Install the CLI
186
+
187
+ Install the Transcend CLI **≥ 11**:
188
+
189
+ \`\`\`sh
190
+ npm install --global @transcend-io/cli@^11
191
+ transcend policy --help # should list init, new, lint [<directory>], …
192
+ \`\`\`
193
+
194
+ ## Initialize safely
195
+
196
+ Run \`transcend policy init --help\` before choosing flags. The default target is
197
+ \`transcend/policy\`.
198
+
199
+ \`policy init\` creates an empty multi-bundle workspace — shared Regal config
200
+ (\`project.roots: []\`) and a README. No bundles or Rego are created.
201
+
202
+ Interactive initialization offers VS Code setup, this Agent Skill, and
203
+ validation-only GitHub Actions. Non-interactive automation enables only
204
+ explicitly supplied \`--editor\`, \`--skill\`, and \`--ci\` flags:
205
+
206
+ \`\`\`sh
207
+ transcend policy init ./transcend/policy --editor --skill --ci --noInteractive --yes
208
+ \`\`\`
209
+
210
+ Use \`--dryRun\` to inspect the complete transactional plan. Existing policy
211
+ files, manifests, Regal configuration, workflows, and customized managed
212
+ artifacts are preserved.
213
+
214
+ ## Add bundles
215
+
216
+ After initializing the workspace, add bundles with \`transcend policy new\`:
217
+
218
+ \`\`\`sh
219
+ transcend policy new --template generic --name example --yes
220
+ transcend policy new --template permissions --name permissions --yes
221
+ # optional: different local folder than {name}-bundle
222
+ transcend policy new --template permissions --name permissions --bundle-dir my-bundle --yes
223
+ \`\`\`
224
+
225
+ Templates available:
226
+
227
+ - \`generic\` — A fail-closed teaching entrypoint (default root: \`example\`)
228
+ - \`permissions\` — A Permission API starter with purpose preferences (default root: \`permissions\`)
229
+
230
+ Naming triad (keep these distinct):
231
+
232
+ - \`--name\` — Rego / \`.manifest\` package root
233
+ - \`--bundle-dir\` — local publish folder basename under the workspace (default
234
+ \`{name}-bundle\`)
235
+ - \`--remote-bundle-name\` — remote Policy Engine name at upload time; unrelated to
236
+ the local folder
237
+
238
+ Each publish directory includes its own \`input.schema.json\` beside the input
239
+ fixtures.
240
+
241
+ \`policy new\` creates the publish directory, its \`.manifest\`, Rego tree,
242
+ input fixtures, and input schema. It also merges the root into Regal config and
243
+ updates VS Code settings/tasks when \`.vscode\` is present.
244
+
245
+ ## Required tools
246
+
247
+ - Use OPA 1.x for Rego v1 parsing, formatting, checks, tests, and bundle compilation.
248
+ - Use Regal for idiomatic Rego linting and editor language-server features.
249
+ - Run \`opa version\` and \`regal version\` to confirm the active executables.
250
+
251
+ The generated Regal configuration targets OPA 1.18.2 capabilities. Generated CI
252
+ installs OPA 1.18.2 and Regal 0.42.0; local tools only need to satisfy the
253
+ compatible versions reported by \`policy init\` and \`policy lint\`. Follow their
254
+ official installation links when a compatible tool is missing.
255
+
256
+ ## Editor and CI
257
+
258
+ Repository-level VS Code settings should include:
259
+
260
+ - \`opa.roots\` — one entry per \`{root}-bundle/\` publish directory
261
+ - \`opa.bundleMode: true\` — avoid loading fixture JSON as data
262
+ - \`json.schemas\` — validates \`input.json\` / \`input.example.json\`; Permissions
263
+ templates point at the published schema \`$id\`, generic bundles use the local
264
+ \`input.schema.json\`
265
+
266
+ Preserve custom settings and tasks when adapting generated editor files.
267
+
268
+ Generated GitHub Actions CI is read-only and credential-free: it installs pinned
269
+ tools and the pinned Transcend CLI, then runs \`transcend policy lint\` per
270
+ publish directory (matrix when multiple bundles exist). Locally, bare
271
+ \`transcend policy lint\` verifies every child under the workspace that contains
272
+ a \`.manifest\`:
273
+
274
+ \`\`\`sh
275
+ transcend policy lint --noInteractive --json
276
+ transcend policy lint transcend/policy/example-bundle --noInteractive --json
277
+ \`\`\`
278
+
279
+ Adapt triggers, runner labels, dependency installation, and caching to
280
+ established repository conventions without adding publish steps or secrets.
281
+ `,H=`# Testing and debugging
282
+
283
+ ## Write executable tests
284
+
285
+ Place tests next to the package they exercise and suffix test modules with
286
+ \`_test.rego\`. A separate \`_test\` package makes the production API and test
287
+ helpers easy to distinguish. Keep the \`_test\` package under the same manifest
288
+ root (for example \`example.result_test\`, not a sibling root), so bundle-mode
289
+ loads accept it.
290
+
291
+ \`\`\`rego
292
+ package example.result_test
293
+
294
+ import data.example.result
295
+ import rego.v1
296
+
297
+ test_denies_missing_input if {
298
+ result.decision == "deny" with input as {}
299
+ result.reason_code == "untrusted_or_invalid_input" with input as {}
300
+ }
301
+ \`\`\`
302
+
303
+ Cover at least:
304
+
305
+ - the ordinary allow case;
306
+ - explicit deny cases;
307
+ - absent, malformed, and unknown input;
308
+ - important result fields and reason codes;
309
+ - interactions between packages when one policy reads another document.
310
+
311
+ \`transcend policy lint\` requires a non-empty test suite.
312
+
313
+ ## Use local inputs safely
314
+
315
+ Keep a sanitized \`input.example.json\` in each publish directory. \`policy new\`
316
+ also writes a gitignored \`input.json\` beside it (same contents) so VS Code /
317
+ Regal Evaluate work immediately. Customize \`input.json\` locally; keep
318
+ \`input.example.json\` committed and free of credentials or personal data.
319
+
320
+ ## Run the complete gate
321
+
322
+ With no directory argument, \`policy lint\` and \`policy test\` verify every
323
+ immediate child under the workspace (\`transcend/policy\`) that contains a
324
+ \`.manifest\`. Pass one bundle path to target a single unit:
325
+
326
+ \`\`\`sh
327
+ transcend policy lint --noInteractive
328
+ transcend policy test
329
+ transcend policy lint transcend/policy/permissions-bundle --noInteractive
330
+ transcend policy test transcend/policy/permissions-bundle
331
+ opa check --strict -b transcend/policy/permissions-bundle -s transcend/policy/permissions-bundle/input.schema.json
332
+ \`\`\`
333
+
334
+ \`policy lint\` and \`policy test\` run \`opa test -b\` (bundle mode) so a local
335
+ gitignored \`input.json\` beside \`input.example.json\` does not cause a merge
336
+ error. Prefer the CLI over raw directory-mode \`opa test\`. Strict OPA checks use
337
+ Rego v1 (no \`--v0-compatible\`).
338
+
339
+ Use \`transcend policy lint --help\` for formatter flags. Review Regal findings
340
+ deliberately instead of applying broad rewrites.
341
+
342
+ ## Evaluate a query
343
+
344
+ \`policy eval\` requires an explicit local publish directory (\`<bundle>\`).
345
+
346
+ Generic example bundle:
347
+
348
+ \`\`\`sh
349
+ transcend policy eval transcend/policy/example-bundle \\
350
+ --package=data.example.result \\
351
+ --input=transcend/policy/example-bundle/input.json
352
+ \`\`\`
353
+
354
+ To simulate the Permissions API, pass the bundle, a purpose query (\`--package\`),
355
+ the local envelope (\`--input\`), and the bundle's input schema (\`--schema\`) so
356
+ OPA type-checks \`input\`:
357
+
358
+ \`\`\`sh
359
+ transcend policy eval transcend/policy/permissions-bundle \\
360
+ --package=data.permissions.purposes \\
361
+ --input=transcend/policy/permissions-bundle/input.json \\
362
+ --schema=transcend/policy/permissions-bundle/input.schema.json
363
+ \`\`\`
364
+
365
+ Or pipe the envelope with \`--stdin-input\`. \`policy eval\` ignores \`*_test.rego\`
366
+ (same as lint/publish — tests are not shipped). Use \`transcend policy eval --help\`
367
+ for curated \`opa eval\` pass-through flags (format, explain, metrics, and similar).
368
+ Exit-on-result flags like OPA \`--fail\` are not exposed — production Evaluate uses
369
+ the Data API (policy deny is a successful evaluation).
370
+
371
+ Or \`opa eval -b … -i …\` with the caller's query path. If the result differs from
372
+ expectations, inspect package paths, imports, defaults, input field presence,
373
+ and the selected bundle directory before changing policy logic.
374
+ `,U=`---
375
+ name: transcend-policy-engine
376
+ description: Sets up, authors, validates, tests, and publishes Transcend Policy Engine projects backed by OPA and Rego. Use for .manifest roots, Rego v1 policy trees, Regal configuration, local policy inputs, Policy Engine CI, or transcend policy CLI commands.
377
+ compatibility: Requires OPA 1.x, Regal, and Transcend CLI ≥ 11 for local validation.
378
+ ---
379
+
380
+ # Transcend Policy Engine
381
+
382
+ Use the CLI for deterministic scaffolding and validation. Treat generated
383
+ examples as disposable teaching material and derive the real policy contract
384
+ from repository code and product requirements.
385
+
386
+ Requires **Transcend CLI ≥ 11** (\`transcend policy lint [<directory>]\`, with
387
+ \`init\` available).
388
+
389
+ ## Workflow
390
+
391
+ 1. Locate each publishable bundle directory (a directory with a \`.manifest\`;
392
+ \`policy new\` scaffolds these as \`{root}-bundle/\` by default (override with
393
+ \`--bundle-dir\`) with a \`{root}/\` package
394
+ tree inside).
395
+ 2. For initialization, editor support, tools, or CI, read [references/setup-tooling.md](references/setup-tooling.md).
396
+ 3. For package layout, document-tree design, decisions, and inputs, read [references/authoring.md](references/authoring.md).
397
+ 4. For tests, local inputs, linting, and evaluation, read [references/testing-debugging.md](references/testing-debugging.md).
398
+ 5. For bundle validation and publishing, read [references/publishing.md](references/publishing.md).
399
+ 6. Preserve repository conventions and finish with:
400
+
401
+ \`\`\`sh
402
+ transcend policy lint --noInteractive
403
+ \`\`\`
404
+
405
+ ## Documentation
406
+
407
+ - Every Transcend CLI command and subcommand provides contextual help with \`transcend <command> --help\`.
408
+ - Use the [Transcend CLI README](https://github.com/transcend-io/tools/tree/main/packages/cli#readme) for command documentation and examples.
409
+ - Use the [Transcend documentation index](https://docs.transcend.io/llms.txt) to find current product documentation.
410
+
411
+ ## Guardrails
412
+
413
+ - Do not invent an input shape, output contract, package tree, or deployment convention.
414
+ - Keep decisions fail-closed and make result documents extensible.
415
+ - Never commit credentials or a real local \`input.json\`.
416
+ - Keep every publishable Rego package covered by a \`.manifest\` root.
417
+ - One publish directory = one Policy Engine bundle; do not merge unrelated
418
+ products into a single \`.manifest\` unless they share activation and callers.
419
+ `;const W=`transcend-policy-engine`,G=[{path:`SKILL.md`,contents:U},{path:`references/setup-tooling.md`,contents:V},{path:`references/authoring.md`,contents:z},{path:`references/testing-debugging.md`,contents:H},{path:`references/publishing.md`,contents:B}];function K(e){return`${e.hasSkill?`Use the \`${W}\` skill and run`:`Run`} ${e.newCommand} to add a bundle from a template, then adapt the policy document tree and input/output contract to the intended application.`}function q(e,n){return{version:e.version,command:e.command,applied:n.applied,dryRun:n.dryRun,targetDirectory:e.targetDirectory,manifestPath:e.manifestPath,changes:e.changes.map(e=>t(n.cwd,e)),warnings:e.warnings,nextSteps:e.nextSteps,features:[...e.features],aiHandoff:n.aiHandoff,tools:n.tools}}const J={name:W,displayName:`Policy Engine`,owner:`@transcend-io/cli`,files:G};function Y(e,t){let n=new Set(d().map(({path:t})=>N(e.targetDirectory,t))),r=new Set(t.features);return r.has(R.Editor)&&(n.add(N(e.projectRoot,`.vscode`,`settings.json`)),n.add(N(e.projectRoot,`.vscode`,`extensions.json`)),n.add(N(e.projectRoot,`.vscode`,`tasks.json`))),r.has(R.Skill)&&a(e.projectRoot,e.existingSkillDirectories,J).forEach(e=>n.add(e)),r.has(R.Ci)&&e.repositoryRoot&&e.usesGithub&&n.add(N(e.repositoryRoot,j)),[...n].sort((e,t)=>e.localeCompare(t))}function X(e,t){let n=F(e,t);if(n===`..`||n.startsWith(`..${I}`)||M(n))throw Error(`Refusing to modify path outside project root: ${t}`)}function ie(e){let t=new Set([`${h}/input.json`]);return e.forEach(({path:e})=>{t.add(e);let n=P.dirname(e);for(;n!==`.`;)t.add(n),n=P.dirname(n)}),t}function Z(e,t,n){let r=s({snapshot:u(t.snapshots,n.path),after:n.contents,description:n.description,...n.createOnly===void 0?{}:{createOnly:n.createOnly}});r?e.changes.push(r):e.unchanged.push(n.path)}function ae(e,t,n,r,a,o){Z(e,t,{path:n,contents:r.contents,description:a}),e.warnings.push(...r.warnings.map(e=>`${e} (${i(o,n)})`))}function oe(e,t){let{state:n}=e,r=d(),a=`transcend policy new`,s={version:3,command:`init`,rootDirectory:n.projectRoot,targetDirectory:n.targetDirectory,manifestPath:n.targetDirectory,changes:[],unchanged:[],warnings:[],nextSteps:[a],features:[...t.features]},l=Y(n,t);if(X(n.projectRoot,n.targetDirectory),l.forEach(e=>X(n.projectRoot,e)),n.relativeFilePaths.length===0)s.directoryPreconditions=[{path:n.targetDirectory,relativePaths:[...n.relativePaths]}],r.forEach(t=>{let r=N(n.targetDirectory,t.path);if(o(e.snapshots,r).kind!==`absent`)throw Error(`Expected an empty policy target, but found an entry at: ${r}`);Z(s,e,{path:r,contents:t.contents,description:t.description,createOnly:!0})});else{let t=!0;r.forEach(r=>{let a=N(n.targetDirectory,r.path),c=o(e.snapshots,a);if(c.kind===`file`&&c.contents===r.contents){s.unchanged.push(a);return}t=!1,c.kind!==`absent`&&(s.unchanged.push(a),s.warnings.push(`Existing policy scaffold path was left unchanged: ${i(n.invocationDirectory,a)}`))});let c=ie(r),l=n.relativeFilePaths.some(e=>!c.has(e));(!t||l)&&s.warnings.push(`Existing policy target contains custom or partial content, so no workspace files were added or overwritten. Review ${i(n.invocationDirectory,n.targetDirectory)} manually, then run \`${a}\`.`)}let u=new Set(t.features),f=n.projectRoot;if(u.has(R.Editor)){let t=N(f,`.vscode`,`settings.json`),r=N(f,`.vscode`,`extensions.json`),a=N(f,`.vscode`,`tasks.json`);[{path:t,description:`Merge strict target-scoped OPA and Rego editor settings`,merge:(e,t,n)=>ee(e,t,n)},{path:r,description:`Recommend the OPA extension and discourage its syntax-only conflict`,merge:e=>re(e)},{path:a,description:`Create the VS Code task configuration`,merge:(e,t,n)=>ne(e,t,n)}].forEach(({path:t,description:r,merge:a})=>{let c=o(e.snapshots,t);if(c.kind!==`absent`&&c.kind!==`file`){s.unchanged.push(t),s.warnings.push(`Existing VS Code artifact is not a regular file and was left unchanged: ${i(n.invocationDirectory,t)}`);return}ae(s,e,t,a(c.kind===`file`?c.contents:null,f,n.targetDirectory),r,n.invocationDirectory)})}if(u.has(R.Skill)){let t=c({rootDirectory:f,existingDirectories:n.existingSkillDirectories,snapshots:e.snapshots,skill:J,preserveModified:!0});s.changes.push(...t.changes),s.unchanged.push(...t.unchanged),s.warnings.push(...t.warnings.map(e=>t.unchanged.reduce((e,t)=>e.replace(t,i(n.invocationDirectory,t)),e)))}if(u.has(R.Ci))if(!n.repositoryRoot||!n.usesGithub)s.warnings.push(`GitHub Actions setup was selected, but this target is not inside a detected GitHub repository.`);else{let r=N(n.repositoryRoot,j),a=F(n.repositoryRoot,n.targetDirectory).split(I).join(`/`)||`.`,c=te({cliVersion:t.cliVersion,workspaceDirectory:a,bundleDirectories:[]}),l=o(e.snapshots,r);l.kind===`absent`?Z(s,e,{path:r,contents:c,description:`Add credential-free Policy Engine validation`,createOnly:!0}):l.kind===`file`&&l.contents===c?s.unchanged.push(r):(s.unchanged.push(r),s.warnings.push(`Existing GitHub Actions workflow was left unchanged: ${i(n.invocationDirectory,r)}. Adapt it manually to validate each policy bundle.`))}return s.changes.forEach(({path:e})=>X(n.projectRoot,e)),s}const se={[R.Editor]:`VS Code settings and lint task`,[R.Skill]:`Policy Engine Agent Skill`,[R.Ci]:`Validation-only GitHub Actions`},ce=Object.values(R);function Q(e,t){let n=[t.stdout.trim(),t.stderr.trim()].filter(Boolean).join(`
420
+ `),r=e===`OPA`?x:g;return`${e===`OPA`?`OPA 1.x`:`Regal ${C} or newer`} is required, but \`${e.toLowerCase()} version\` exited with code ${t.code}${n?`: ${n}`:`.`} Install or upgrade it using the official instructions: ${r}`}async function le(e,t,n){let r={opa:null,regal:null},i=[],a=await n(`opa`,[`version`],{cwd:t},e);if(a.error?.code===`ENOENT`)i.push(v);else{let e=`${a.stdout}\n${a.stderr}`,t=_(e);a.code===0?t?i.push(t):r.opa=S(e).version:i.push(t??Q(`OPA`,a))}let o=await n(`regal`,[`version`],{cwd:t},e);if(o.error?.code===`ENOENT`)i.push(b);else{let e=`${o.stdout}\n${o.stderr}`,t=y(e,C,`the generated OPA ${f} capabilities configuration`);o.code===0?t?i.push(t):r.regal=S(e).version:i.push(t??Q(`Regal`,o))}return{tools:r,warnings:i}}async function $(t,a=m,o=k){w(this.process);try{let s=await le(this,this.process.cwd(),o),c=p(this,a),u=new E(this),d=D(t,this.process.stdin.isTTY,this.process.stderr.isTTY),f=await T(u,{features:ce,labels:se,enabled:{[R.Editor]:t.editor,[R.Skill]:t.skill,[R.Ci]:t.ci},interactive:d}),m=Y(c,{features:f}),h=oe({state:c,snapshots:l(this,c.projectRoot,m)},{features:f,cliVersion:e});h.warnings.push(...s.warnings),t.json||this.logger.info(r(h,{cwd:this.process.cwd(),title:`Policy initialization plan`,details:[{label:`Target`,path:h.targetDirectory}]}));let g=h.changes.length===0||t.dryRun;if(h.changes.length>0&&!t.dryRun)if(t.yes)g=!0;else if(d)g=await u.confirm(`Apply this complete plan?`,!0);else throw Error(`The plan requires approval in a non-interactive invocation. Review with --dryRun, then pass --yes.`);g&&!t.dryRun&&h.changes.length>0&&await A(this,h);let _=g&&!t.dryRun&&h.changes.length>0,v=g&&!t.dryRun,y=K({projectPath:n(i(this.process.cwd(),c.targetDirectory)),hasSkill:v&&f.includes(R.Skill),newCommand:h.nextSteps[0]}),b=q(h,{applied:_,dryRun:t.dryRun,cwd:this.process.cwd(),aiHandoff:y,tools:s.tools});if(t.json){this.process.stdout.write(`${JSON.stringify(b)}\n`);return}if(t.dryRun){this.logger.info(L.yellow(`Dry run complete. No changes were written.`));return}if(!g){this.logger.info(L.yellow(`No changes applied.`));return}if(h.changes.length===0){let e=h.warnings.length===s.warnings.length?`Policy project is already initialized.`:`Existing policy project was left unchanged.`;this.logger.info(L.green(e))}else this.logger.info(L.green(`Policy project initialized.`));h.nextSteps.length>0&&(this.logger.info(`\n${L.bold(`Next steps`)}`),h.nextSteps.forEach(e=>this.logger.info(e))),this.logger.info(`\n${L.bold(`AI handoff — paste into your coding agent`)}`),this.logger.info(y)}catch(e){if(e instanceof O)return this.process.exit(130);throw e}}export{$ as init};
421
+ //# sourceMappingURL=impl-B-Oe7DcE2.mjs.map