@transcend-io/cli 10.28.0 → 10.29.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 (338) hide show
  1. package/README.md +81 -15
  2. package/dist/{app-DCY8E776.mjs → app-C5baDSA2.mjs} +21 -21
  3. package/dist/app-C5baDSA2.mjs.map +1 -0
  4. package/dist/{approvePrivacyRequests-80SV_94y.mjs → approvePrivacyRequests-B8x7oxTn.mjs} +2 -2
  5. package/dist/{approvePrivacyRequests-80SV_94y.mjs.map → approvePrivacyRequests-B8x7oxTn.mjs.map} +1 -1
  6. package/dist/bin/bash-complete.mjs +1 -1
  7. package/dist/bin/cli.mjs +1 -1
  8. package/dist/bin/deprecated-command.mjs +1 -1
  9. package/dist/{buildExamples-2YDkSvtA.mjs → buildExamples-7KXBjl-b.mjs} +2 -2
  10. package/dist/{buildExamples-2YDkSvtA.mjs.map → buildExamples-7KXBjl-b.mjs.map} +1 -1
  11. package/dist/{buildXdiSyncEndpoint-B3zUrI16.mjs → buildXdiSyncEndpoint-DcrkZ2Gu.mjs} +2 -2
  12. package/dist/{buildXdiSyncEndpoint-B3zUrI16.mjs.map → buildXdiSyncEndpoint-DcrkZ2Gu.mjs.map} +1 -1
  13. package/dist/{bulkRestartRequests-BLb8OJmf.mjs → bulkRestartRequests-CysUfl98.mjs} +2 -2
  14. package/dist/{bulkRestartRequests-BLb8OJmf.mjs.map → bulkRestartRequests-CysUfl98.mjs.map} +1 -1
  15. package/dist/{bulkRetryEnrichers-BA9cboSe.mjs → bulkRetryEnrichers-DaLE67Ht.mjs} +2 -2
  16. package/dist/{bulkRetryEnrichers-BA9cboSe.mjs.map → bulkRetryEnrichers-DaLE67Ht.mjs.map} +1 -1
  17. package/dist/{cancelPrivacyRequests-BEyOBJ2r.mjs → cancelPrivacyRequests-D0zNUNdS.mjs} +2 -2
  18. package/dist/{cancelPrivacyRequests-BEyOBJ2r.mjs.map → cancelPrivacyRequests-D0zNUNdS.mjs.map} +1 -1
  19. package/dist/codecs-CTxFjCg4.mjs +2 -0
  20. package/dist/codecs-CTxFjCg4.mjs.map +1 -0
  21. package/dist/{collectCsvFilesOrExit-BqnmK63h.mjs → collectCsvFilesOrExit-B1VOVGWN.mjs} +1 -1
  22. package/dist/{collectCsvFilesOrExit-BqnmK63h.mjs.map → collectCsvFilesOrExit-B1VOVGWN.mjs.map} +1 -1
  23. package/dist/{collectParquetFilesOrExit-BiksFI-Q.mjs → collectParquetFilesOrExit-DVlv5ctt.mjs} +1 -1
  24. package/dist/{collectParquetFilesOrExit-BiksFI-Q.mjs.map → collectParquetFilesOrExit-DVlv5ctt.mjs.map} +1 -1
  25. package/dist/{command-eIenZMOx.mjs → command-CIv9yk86.mjs} +2 -2
  26. package/dist/{command-eIenZMOx.mjs.map → command-CIv9yk86.mjs.map} +1 -1
  27. package/dist/commands/admin/chunk-csv/worker.mjs +1 -1
  28. package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
  29. package/dist/{consentManagersToBusinessEntities-O4KBox9u.mjs → consentManagersToBusinessEntities-CBJ81aGO.mjs} +1 -1
  30. package/dist/{consentManagersToBusinessEntities-O4KBox9u.mjs.map → consentManagersToBusinessEntities-CBJ81aGO.mjs.map} +1 -1
  31. package/dist/{constants-BpQ5awGp.mjs → constants-DXzsg2CQ.mjs} +2 -2
  32. package/dist/{constants-BpQ5awGp.mjs.map → constants-DXzsg2CQ.mjs.map} +1 -1
  33. package/dist/{constants-C1seVfCu.mjs → constants-D_HVDaOy.mjs} +1 -1
  34. package/dist/{constants-C1seVfCu.mjs.map → constants-D_HVDaOy.mjs.map} +1 -1
  35. package/dist/{constants-BG53Mbi9.mjs → constants-jjHIzHGm.mjs} +2 -2
  36. package/dist/{constants-BG53Mbi9.mjs.map → constants-jjHIzHGm.mjs.map} +1 -1
  37. package/dist/{context-CZYrQfAn.mjs → context-B33NT3ki.mjs} +1 -1
  38. package/dist/{context-CZYrQfAn.mjs.map → context-B33NT3ki.mjs.map} +1 -1
  39. package/dist/{createPoolingCommandUi-C39R_zo3.mjs → createPoolingCommandUi-uiDjLlqf.mjs} +2 -2
  40. package/dist/{createPoolingCommandUi-C39R_zo3.mjs.map → createPoolingCommandUi-uiDjLlqf.mjs.map} +1 -1
  41. package/dist/{dataFlowsToDataSilos-CLSHb1GA.mjs → dataFlowsToDataSilos-BF6fzWcm.mjs} +1 -1
  42. package/dist/{dataFlowsToDataSilos-CLSHb1GA.mjs.map → dataFlowsToDataSilos-BF6fzWcm.mjs.map} +1 -1
  43. package/dist/deno-runtime-DV52X8-P.mjs +2 -0
  44. package/dist/deno-runtime-DV52X8-P.mjs.map +1 -0
  45. package/dist/{done-input-validation-Cjk7a3jX.mjs → done-input-validation-BUz-aVC5.mjs} +1 -1
  46. package/dist/{done-input-validation-Cjk7a3jX.mjs.map → done-input-validation-BUz-aVC5.mjs.map} +1 -1
  47. package/dist/{downloadPrivacyRequestFiles-CLFgQItk.mjs → downloadPrivacyRequestFiles-B_BVxW5Z.mjs} +2 -2
  48. package/dist/{downloadPrivacyRequestFiles-CLFgQItk.mjs.map → downloadPrivacyRequestFiles-B_BVxW5Z.mjs.map} +1 -1
  49. package/dist/{extractClientError-C_6ly7Gw.mjs → extractClientError-HZ2U7yqV.mjs} +1 -1
  50. package/dist/{extractClientError-C_6ly7Gw.mjs.map → extractClientError-HZ2U7yqV.mjs.map} +1 -1
  51. package/dist/{fetchAllRequests-CEDKdq0c.mjs → fetchAllRequests-2TZr-LfT.mjs} +2 -2
  52. package/dist/{fetchAllRequests-CEDKdq0c.mjs.map → fetchAllRequests-2TZr-LfT.mjs.map} +1 -1
  53. package/dist/{formatPolicyBundleVersionSummary-CrFtcPwS.mjs → formatPolicyBundleVersionSummary-CJmMCLtJ.mjs} +1 -1
  54. package/dist/{formatPolicyBundleVersionSummary-CrFtcPwS.mjs.map → formatPolicyBundleVersionSummary-CJmMCLtJ.mjs.map} +1 -1
  55. package/dist/{fuzzyMatchColumns-OTsFJ21f.mjs → fuzzyMatchColumns-CQCzpjWC.mjs} +2 -2
  56. package/dist/{fuzzyMatchColumns-OTsFJ21f.mjs.map → fuzzyMatchColumns-CQCzpjWC.mjs.map} +1 -1
  57. package/dist/{generateCrossAccountApiKeys-D6O_Qm3Y.mjs → generateCrossAccountApiKeys-Bnqgmj-H.mjs} +2 -2
  58. package/dist/{generateCrossAccountApiKeys-D6O_Qm3Y.mjs.map → generateCrossAccountApiKeys-Bnqgmj-H.mjs.map} +1 -1
  59. package/dist/impl--JGnR3wp.mjs +3 -0
  60. package/dist/{impl-CzxvoiGW.mjs.map → impl--JGnR3wp.mjs.map} +1 -1
  61. package/dist/{impl-BqrSLoig.mjs → impl-2iVTxNn4.mjs} +2 -2
  62. package/dist/{impl-BqrSLoig.mjs.map → impl-2iVTxNn4.mjs.map} +1 -1
  63. package/dist/{impl-Drql0g72.mjs → impl-7UqkSO3x2.mjs} +2 -2
  64. package/dist/impl-7UqkSO3x2.mjs.map +1 -0
  65. package/dist/{impl-C50tdWlL2.mjs → impl-B-j5ACi02.mjs} +2 -2
  66. package/dist/{impl-C50tdWlL2.mjs.map → impl-B-j5ACi02.mjs.map} +1 -1
  67. package/dist/impl-B4BgGuF_.mjs +3 -0
  68. package/dist/impl-B4BgGuF_.mjs.map +1 -0
  69. package/dist/{impl-zZFaSmxd2.mjs → impl-BDrvzlpf2.mjs} +2 -2
  70. package/dist/{impl-zZFaSmxd2.mjs.map → impl-BDrvzlpf2.mjs.map} +1 -1
  71. package/dist/{impl-Dk6TZKrp2.mjs → impl-BH_A5rgL.mjs} +2 -2
  72. package/dist/impl-BH_A5rgL.mjs.map +1 -0
  73. package/dist/{impl-CHmjV-Pa.mjs → impl-BOawPhYE.mjs} +2 -2
  74. package/dist/{impl-CHmjV-Pa.mjs.map → impl-BOawPhYE.mjs.map} +1 -1
  75. package/dist/{impl-CXUJ1eRC.mjs → impl-BPoEH3Nf2.mjs} +2 -2
  76. package/dist/impl-BPoEH3Nf2.mjs.map +1 -0
  77. package/dist/{impl-CqF9xIIy.mjs → impl-BXUYpR27.mjs} +2 -2
  78. package/dist/{impl-CqF9xIIy.mjs.map → impl-BXUYpR27.mjs.map} +1 -1
  79. package/dist/{impl-DYf10-BD2.mjs → impl-Bc6p8A1l2.mjs} +2 -2
  80. package/dist/{impl-DYf10-BD2.mjs.map → impl-Bc6p8A1l2.mjs.map} +1 -1
  81. package/dist/{impl-M3Eu4QjS.mjs → impl-BqWQh9Ss.mjs} +2 -2
  82. package/dist/{impl-M3Eu4QjS.mjs.map → impl-BqWQh9Ss.mjs.map} +1 -1
  83. package/dist/impl-C6HtWd1t.mjs +2 -0
  84. package/dist/{impl-BcJ019T2.mjs.map → impl-C6HtWd1t.mjs.map} +1 -1
  85. package/dist/{impl-GHukPBnk.mjs → impl-CL29fOWM.mjs} +2 -2
  86. package/dist/{impl-GHukPBnk.mjs.map → impl-CL29fOWM.mjs.map} +1 -1
  87. package/dist/{impl-BvNZqLrT.mjs → impl-CO4ZqlLV.mjs} +2 -2
  88. package/dist/{impl-BvNZqLrT.mjs.map → impl-CO4ZqlLV.mjs.map} +1 -1
  89. package/dist/{impl-DJLlcqSg.mjs → impl-COujMWgp.mjs} +2 -2
  90. package/dist/{impl-DJLlcqSg.mjs.map → impl-COujMWgp.mjs.map} +1 -1
  91. package/dist/{impl-Bs-drNBf.mjs → impl-CPSEzCc9.mjs} +2 -2
  92. package/dist/{impl-Bs-drNBf.mjs.map → impl-CPSEzCc9.mjs.map} +1 -1
  93. package/dist/{impl-Dib6Fff12.mjs → impl-CQVy2k3o.mjs} +2 -2
  94. package/dist/impl-CQVy2k3o.mjs.map +1 -0
  95. package/dist/{impl-B3_hrFPX.mjs → impl-CUOVJsRg.mjs} +2 -2
  96. package/dist/{impl-B3_hrFPX.mjs.map → impl-CUOVJsRg.mjs.map} +1 -1
  97. package/dist/{impl-BySmbxEt.mjs → impl-CUiYbk6G.mjs} +2 -2
  98. package/dist/{impl-BySmbxEt.mjs.map → impl-CUiYbk6G.mjs.map} +1 -1
  99. package/dist/{impl-CWh9H7mL.mjs → impl-CXTBcYo6.mjs} +2 -2
  100. package/dist/{impl-CWh9H7mL.mjs.map → impl-CXTBcYo6.mjs.map} +1 -1
  101. package/dist/{impl-Cx3T0Iei.mjs → impl-CfvxD3RI.mjs} +2 -2
  102. package/dist/{impl-Cx3T0Iei.mjs.map → impl-CfvxD3RI.mjs.map} +1 -1
  103. package/dist/{impl-DHfYO9T52.mjs → impl-Cli2XRp02.mjs} +2 -2
  104. package/dist/{impl-DHfYO9T52.mjs.map → impl-Cli2XRp02.mjs.map} +1 -1
  105. package/dist/{impl-CDtUusmg.mjs → impl-CuDs6SsI.mjs} +2 -2
  106. package/dist/{impl-CDtUusmg.mjs.map → impl-CuDs6SsI.mjs.map} +1 -1
  107. package/dist/{impl-BYGNx-8W2.mjs → impl-CvLI_Jig.mjs} +2 -2
  108. package/dist/impl-CvLI_Jig.mjs.map +1 -0
  109. package/dist/{impl-BFJtKA2o2.mjs → impl-CwKYKBYb.mjs} +2 -2
  110. package/dist/impl-CwKYKBYb.mjs.map +1 -0
  111. package/dist/{impl-BewF8tB6.mjs → impl-CwXp3Tbr.mjs} +2 -2
  112. package/dist/{impl-BewF8tB6.mjs.map → impl-CwXp3Tbr.mjs.map} +1 -1
  113. package/dist/{impl-B--lr5RJ2.mjs → impl-CyQRmuM72.mjs} +2 -2
  114. package/dist/{impl-B--lr5RJ2.mjs.map → impl-CyQRmuM72.mjs.map} +1 -1
  115. package/dist/impl-DEJpYLPB.mjs +2 -0
  116. package/dist/impl-DEJpYLPB.mjs.map +1 -0
  117. package/dist/impl-DEhw1iNn.mjs +2 -0
  118. package/dist/impl-DEhw1iNn.mjs.map +1 -0
  119. package/dist/impl-DK7nSMle2.mjs +303 -0
  120. package/dist/impl-DK7nSMle2.mjs.map +1 -0
  121. package/dist/{impl-DOoR93T6.mjs → impl-DKepRc812.mjs} +2 -2
  122. package/dist/impl-DKepRc812.mjs.map +1 -0
  123. package/dist/{impl-CTIWliTx.mjs → impl-DLG0Egy6.mjs} +2 -2
  124. package/dist/{impl-CTIWliTx.mjs.map → impl-DLG0Egy6.mjs.map} +1 -1
  125. package/dist/impl-DMe_OqJx.mjs +2 -0
  126. package/dist/{impl-BsC1KVxS.mjs.map → impl-DMe_OqJx.mjs.map} +1 -1
  127. package/dist/{impl-BwRcpAno.mjs → impl-DNe-gRXe2.mjs} +2 -2
  128. package/dist/impl-DNe-gRXe2.mjs.map +1 -0
  129. package/dist/{impl-Dm-Fkr392.mjs → impl-DNzkRayg.mjs} +2 -2
  130. package/dist/impl-DNzkRayg.mjs.map +1 -0
  131. package/dist/{impl-DzNk41xd.mjs → impl-DPtx5iZO.mjs} +2 -2
  132. package/dist/{impl-DzNk41xd.mjs.map → impl-DPtx5iZO.mjs.map} +1 -1
  133. package/dist/{impl-syp5hclX.mjs → impl-DRpK-QLC.mjs} +2 -2
  134. package/dist/{impl-syp5hclX.mjs.map → impl-DRpK-QLC.mjs.map} +1 -1
  135. package/dist/{impl-Bq6g_xYv.mjs → impl-DVQmuZQY.mjs} +2 -2
  136. package/dist/{impl-Bq6g_xYv.mjs.map → impl-DVQmuZQY.mjs.map} +1 -1
  137. package/dist/{impl-DYwojWvN.mjs → impl-DVeGQCrr.mjs} +2 -2
  138. package/dist/{impl-DYwojWvN.mjs.map → impl-DVeGQCrr.mjs.map} +1 -1
  139. package/dist/{impl-DF8RGVlT.mjs → impl-DXRDWiB1.mjs} +2 -2
  140. package/dist/{impl-DF8RGVlT.mjs.map → impl-DXRDWiB1.mjs.map} +1 -1
  141. package/dist/{impl-CiYKuCHV.mjs → impl-DXowiNOz.mjs} +2 -2
  142. package/dist/{impl-CiYKuCHV.mjs.map → impl-DXowiNOz.mjs.map} +1 -1
  143. package/dist/{impl-DpuhHpuk.mjs → impl-DaH1_ZzK.mjs} +2 -2
  144. package/dist/{impl-DpuhHpuk.mjs.map → impl-DaH1_ZzK.mjs.map} +1 -1
  145. package/dist/{impl-DIPvFKiP.mjs → impl-DdIa0zla.mjs} +2 -2
  146. package/dist/{impl-DIPvFKiP.mjs.map → impl-DdIa0zla.mjs.map} +1 -1
  147. package/dist/{impl-DbZ1cYoR.mjs → impl-DqhZR11m.mjs} +2 -2
  148. package/dist/{impl-DbZ1cYoR.mjs.map → impl-DqhZR11m.mjs.map} +1 -1
  149. package/dist/{impl-VPBEqV0w2.mjs → impl-Dqqb0lVN.mjs} +2 -2
  150. package/dist/impl-Dqqb0lVN.mjs.map +1 -0
  151. package/dist/{impl-6m7GXUAe.mjs → impl-DryC3OJu.mjs} +2 -2
  152. package/dist/{impl-6m7GXUAe.mjs.map → impl-DryC3OJu.mjs.map} +1 -1
  153. package/dist/{impl-CQGeH47F.mjs → impl-DuZjI6p0.mjs} +2 -2
  154. package/dist/{impl-CQGeH47F.mjs.map → impl-DuZjI6p0.mjs.map} +1 -1
  155. package/dist/{impl-C5dzaDga2.mjs → impl-Dw8NYkzw.mjs} +2 -2
  156. package/dist/impl-Dw8NYkzw.mjs.map +1 -0
  157. package/dist/impl-Dx_TfvW1.mjs +2 -0
  158. package/dist/{impl-C8BmxFQ2.mjs.map → impl-Dx_TfvW1.mjs.map} +1 -1
  159. package/dist/{impl-DXNcD7CZ.mjs → impl-DypttZd6.mjs} +2 -2
  160. package/dist/{impl-DXNcD7CZ.mjs.map → impl-DypttZd6.mjs.map} +1 -1
  161. package/dist/{impl-CfPXYgT42.mjs → impl-DzUTmaID2.mjs} +2 -2
  162. package/dist/{impl-CfPXYgT42.mjs.map → impl-DzUTmaID2.mjs.map} +1 -1
  163. package/dist/{impl-BJlKQJdS2.mjs → impl-INhq_CiK.mjs} +2 -2
  164. package/dist/impl-INhq_CiK.mjs.map +1 -0
  165. package/dist/{impl-KKrDTraf.mjs → impl-KmCNH-yw.mjs} +2 -2
  166. package/dist/{impl-KKrDTraf.mjs.map → impl-KmCNH-yw.mjs.map} +1 -1
  167. package/dist/{impl-CE56-wQh.mjs → impl-RPG-BTmX.mjs} +2 -2
  168. package/dist/{impl-CE56-wQh.mjs.map → impl-RPG-BTmX.mjs.map} +1 -1
  169. package/dist/{impl-amV0wRWk.mjs → impl-XrTL-TDl.mjs} +2 -2
  170. package/dist/{impl-amV0wRWk.mjs.map → impl-XrTL-TDl.mjs.map} +1 -1
  171. package/dist/impl-Z8oWVENM.mjs +2 -0
  172. package/dist/impl-Z8oWVENM.mjs.map +1 -0
  173. package/dist/{impl-m3QXCc6n.mjs → impl-a_Y8bnSn.mjs} +4 -4
  174. package/dist/impl-a_Y8bnSn.mjs.map +1 -0
  175. package/dist/{impl-CEmXPEq22.mjs → impl-hwpT9u5o2.mjs} +2 -2
  176. package/dist/{impl-CEmXPEq22.mjs.map → impl-hwpT9u5o2.mjs.map} +1 -1
  177. package/dist/{impl-BWVe4VGF2.mjs → impl-xq89cSSz2.mjs} +2 -2
  178. package/dist/{impl-BWVe4VGF2.mjs.map → impl-xq89cSSz2.mjs.map} +1 -1
  179. package/dist/index.d.mts +12797 -1840
  180. package/dist/index.d.mts.map +1 -1
  181. package/dist/index.mjs +3 -3
  182. package/dist/index.mjs.map +1 -1
  183. package/dist/{initializeCliRuntime-802-P8MC.mjs → initializeCliRuntime-6wI_VIHV.mjs} +1 -1
  184. package/dist/{initializeCliRuntime-802-P8MC.mjs.map → initializeCliRuntime-6wI_VIHV.mjs.map} +1 -1
  185. package/dist/{inquirer-DkFTQU00.mjs → inquirer-BeaBetMO.mjs} +2 -2
  186. package/dist/{inquirer-DkFTQU00.mjs.map → inquirer-BeaBetMO.mjs.map} +1 -1
  187. package/dist/jsonc-D9dDWb1J.mjs +6 -0
  188. package/dist/jsonc-D9dDWb1J.mjs.map +1 -0
  189. package/dist/{listFiles-CWHAdKY-.mjs → listFiles-BdFUbX5x.mjs} +1 -1
  190. package/dist/{listFiles-CWHAdKY-.mjs.map → listFiles-BdFUbX5x.mjs.map} +1 -1
  191. package/dist/logger-zplFSeXU.mjs +2 -0
  192. package/dist/logger-zplFSeXU.mjs.map +1 -0
  193. package/dist/manifest-BNIpO_zW.mjs +2 -0
  194. package/dist/manifest-BNIpO_zW.mjs.map +1 -0
  195. package/dist/{mapConsentCsvRowsToInputs-MMPZwzrV.mjs → mapConsentCsvRowsToInputs-Dqb6WL4r.mjs} +1 -1
  196. package/dist/{mapConsentCsvRowsToInputs-MMPZwzrV.mjs.map → mapConsentCsvRowsToInputs-Dqb6WL4r.mjs.map} +1 -1
  197. package/dist/{markRequestDataSiloIdsCompleted-PKCcn5wQ.mjs → markRequestDataSiloIdsCompleted-B5N-cQWr.mjs} +2 -2
  198. package/dist/{markRequestDataSiloIdsCompleted-PKCcn5wQ.mjs.map → markRequestDataSiloIdsCompleted-B5N-cQWr.mjs.map} +1 -1
  199. package/dist/{markSilentPrivacyRequests-7l9I99pe.mjs → markSilentPrivacyRequests-BiaButWF.mjs} +2 -2
  200. package/dist/{markSilentPrivacyRequests-7l9I99pe.mjs.map → markSilentPrivacyRequests-BiaButWF.mjs.map} +1 -1
  201. package/dist/mergeTranscendInputs-DFQcbh8b.mjs +3 -0
  202. package/dist/mergeTranscendInputs-DFQcbh8b.mjs.map +1 -0
  203. package/dist/missing-manifest-DgcukXfg.mjs +2 -0
  204. package/dist/missing-manifest-DgcukXfg.mjs.map +1 -0
  205. package/dist/{module-graph-DBC7ZvyA.mjs → module-graph-Cb0g74Ft.mjs} +1 -1
  206. package/dist/{module-graph-DBC7ZvyA.mjs.map → module-graph-Cb0g74Ft.mjs.map} +1 -1
  207. package/dist/{notifyPrivacyRequestsAdditionalTime-BPIYuCov.mjs → notifyPrivacyRequestsAdditionalTime-D3Vtvg5G.mjs} +2 -2
  208. package/dist/{notifyPrivacyRequestsAdditionalTime-BPIYuCov.mjs.map → notifyPrivacyRequestsAdditionalTime-D3Vtvg5G.mjs.map} +1 -1
  209. package/dist/{parquetToCsvOneFile-CSVdrLvq.mjs → parquetToCsvOneFile-ChmPC6dL.mjs} +2 -2
  210. package/dist/{parquetToCsvOneFile-CSVdrLvq.mjs.map → parquetToCsvOneFile-ChmPC6dL.mjs.map} +1 -1
  211. package/dist/{parseAttributesFromString-C5-KGkPH.mjs → parseAttributesFromString-CO16oAlx.mjs} +2 -2
  212. package/dist/{parseAttributesFromString-C5-KGkPH.mjs.map → parseAttributesFromString-CO16oAlx.mjs.map} +1 -1
  213. package/dist/{parseVariablesFromString-Cr3x2uq3.mjs → parseVariablesFromString-BOSfQ4QF.mjs} +1 -1
  214. package/dist/{parseVariablesFromString-Cr3x2uq3.mjs.map → parseVariablesFromString-BOSfQ4QF.mjs.map} +1 -1
  215. package/dist/path-safety-D5Qwl40b.mjs +2 -0
  216. package/dist/path-safety-D5Qwl40b.mjs.map +1 -0
  217. package/dist/policy-bundle-manifest-D6dkbjNi.mjs +7 -0
  218. package/dist/policy-bundle-manifest-D6dkbjNi.mjs.map +1 -0
  219. package/dist/policy-runtime-BMKa-Upy.mjs +2 -0
  220. package/dist/policy-runtime-BMKa-Upy.mjs.map +1 -0
  221. package/dist/{printResult-esxW3HhT.mjs → printResult-CHe3nRN4.mjs} +5 -5
  222. package/dist/printResult-CHe3nRN4.mjs.map +1 -0
  223. package/dist/project-plan-apply-Dvndx455.mjs +3 -0
  224. package/dist/project-plan-apply-Dvndx455.mjs.map +1 -0
  225. package/dist/prompts-ClBXdELk.mjs +4 -0
  226. package/dist/prompts-ClBXdELk.mjs.map +1 -0
  227. package/dist/{pullAllDatapoints-H92qjLSx.mjs → pullAllDatapoints-uk5ggk6O.mjs} +2 -2
  228. package/dist/{pullAllDatapoints-H92qjLSx.mjs.map → pullAllDatapoints-uk5ggk6O.mjs.map} +1 -1
  229. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-BrDmPbvc.mjs → pullChunkedCustomSiloOutstandingIdentifiers-D85P1W_8.mjs} +2 -2
  230. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-BrDmPbvc.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-D85P1W_8.mjs.map} +1 -1
  231. package/dist/{pullConsentManagerMetrics-Cvex-gpd.mjs → pullConsentManagerMetrics-Dv5n1ZGp.mjs} +2 -2
  232. package/dist/{pullConsentManagerMetrics-Cvex-gpd.mjs.map → pullConsentManagerMetrics-Dv5n1ZGp.mjs.map} +1 -1
  233. package/dist/{pullManualEnrichmentIdentifiersToCsv-qjdNA75O.mjs → pullManualEnrichmentIdentifiersToCsv-DbNSrKEk.mjs} +2 -2
  234. package/dist/{pullManualEnrichmentIdentifiersToCsv-qjdNA75O.mjs.map → pullManualEnrichmentIdentifiersToCsv-DbNSrKEk.mjs.map} +1 -1
  235. package/dist/{pullTranscendConfiguration-CD7Frn8z.mjs → pullTranscendConfiguration-B63M3ild.mjs} +3 -3
  236. package/dist/{pullTranscendConfiguration-CD7Frn8z.mjs.map → pullTranscendConfiguration-B63M3ild.mjs.map} +1 -1
  237. package/dist/{pullUnstructuredSubDataPointRecommendations-Dmh_-r95.mjs → pullUnstructuredSubDataPointRecommendations-YTBzfkRZ.mjs} +2 -2
  238. package/dist/{pullUnstructuredSubDataPointRecommendations-Dmh_-r95.mjs.map → pullUnstructuredSubDataPointRecommendations-YTBzfkRZ.mjs.map} +1 -1
  239. package/dist/{pushCronIdentifiersFromCsv-DjeY7TtK.mjs → pushCronIdentifiersFromCsv-5ruUKHtL.mjs} +2 -2
  240. package/dist/{pushCronIdentifiersFromCsv-DjeY7TtK.mjs.map → pushCronIdentifiersFromCsv-5ruUKHtL.mjs.map} +1 -1
  241. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BDtMo13j.mjs → pushManualEnrichmentIdentifiersFromCsv-B0i2239u.mjs} +2 -2
  242. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BDtMo13j.mjs.map → pushManualEnrichmentIdentifiersFromCsv-B0i2239u.mjs.map} +1 -1
  243. package/dist/{readCsv-Cr_1t8F5.mjs → readCsv-DLg8pwjd.mjs} +1 -1
  244. package/dist/{readCsv-Cr_1t8F5.mjs.map → readCsv-DLg8pwjd.mjs.map} +1 -1
  245. package/dist/readTranscendYaml-BNn6-Ofi.mjs +4 -0
  246. package/dist/readTranscendYaml-BNn6-Ofi.mjs.map +1 -0
  247. package/dist/{removeUnverifiedRequestIdentifiers-B9uPApVR.mjs → removeUnverifiedRequestIdentifiers-QmeqrmxM.mjs} +2 -2
  248. package/dist/{removeUnverifiedRequestIdentifiers-B9uPApVR.mjs.map → removeUnverifiedRequestIdentifiers-QmeqrmxM.mjs.map} +1 -1
  249. package/dist/{renderTable-DKTZbMjY.mjs → renderTable-D68QasPc.mjs} +1 -1
  250. package/dist/{renderTable-DKTZbMjY.mjs.map → renderTable-D68QasPc.mjs.map} +1 -1
  251. package/dist/{request-B1yRTdG-.mjs → request-BiPv6jmP.mjs} +1 -1
  252. package/dist/{request-B1yRTdG-.mjs.map → request-BiPv6jmP.mjs.map} +1 -1
  253. package/dist/{resolveBundleIdByName-DuxWYrDF.mjs → resolveBundleIdByName-qXZBrUz_.mjs} +2 -2
  254. package/dist/{resolveBundleIdByName-DuxWYrDF.mjs.map → resolveBundleIdByName-qXZBrUz_.mjs.map} +1 -1
  255. package/dist/{resolvePolicyBundleVersion-DhXZKwb4.mjs → resolvePolicyBundleVersion-BG7XqBBP.mjs} +2 -2
  256. package/dist/{resolvePolicyBundleVersion-DhXZKwb4.mjs.map → resolvePolicyBundleVersion-BG7XqBBP.mjs.map} +1 -1
  257. package/dist/{retryRequestDataSilos-D9dBtbdl.mjs → retryRequestDataSilos-BfckLjOJ.mjs} +2 -2
  258. package/dist/{retryRequestDataSilos-D9dBtbdl.mjs.map → retryRequestDataSilos-BfckLjOJ.mjs.map} +1 -1
  259. package/dist/{run-captured-process-CpZBh0lG.mjs → run-captured-process-BXwWXuTh.mjs} +1 -1
  260. package/dist/{run-captured-process-CpZBh0lG.mjs.map → run-captured-process-BXwWXuTh.mjs.map} +1 -1
  261. package/dist/runOpa-CswzJxIs.mjs +2 -0
  262. package/dist/runOpa-CswzJxIs.mjs.map +1 -0
  263. package/dist/scaffold-model-BAbYTR0q.mjs +2 -0
  264. package/dist/scaffold-model-BAbYTR0q.mjs.map +1 -0
  265. package/dist/scaffold-planning-CNv83t_v.mjs +123 -0
  266. package/dist/scaffold-planning-CNv83t_v.mjs.map +1 -0
  267. package/dist/scaffold-templates-DzDGTZie.mjs +84 -0
  268. package/dist/scaffold-templates-DzDGTZie.mjs.map +1 -0
  269. package/dist/{skipPreflightJobs-Beia_iB6.mjs → skipPreflightJobs-Do_kwu3m.mjs} +2 -2
  270. package/dist/{skipPreflightJobs-Beia_iB6.mjs.map → skipPreflightJobs-Do_kwu3m.mjs.map} +1 -1
  271. package/dist/{skipRequestDataSilos-BSNLacnR.mjs → skipRequestDataSilos-BNDhdllD.mjs} +2 -2
  272. package/dist/{skipRequestDataSilos-BSNLacnR.mjs.map → skipRequestDataSilos-BNDhdllD.mjs.map} +1 -1
  273. package/dist/{streamPrivacyRequestsToCsv-Cksb9D49.mjs → streamPrivacyRequestsToCsv-CbJfhV6A.mjs} +2 -2
  274. package/dist/{streamPrivacyRequestsToCsv-Cksb9D49.mjs.map → streamPrivacyRequestsToCsv-CbJfhV6A.mjs.map} +1 -1
  275. package/dist/{syncCodePackages-DsC1tE8B.mjs → syncCodePackages-BHE2Tn1Q.mjs} +2 -2
  276. package/dist/{syncCodePackages-DsC1tE8B.mjs.map → syncCodePackages-BHE2Tn1Q.mjs.map} +1 -1
  277. package/dist/{updateConsentManagerVersionToLatest-CaEkTnlL.mjs → updateConsentManagerVersionToLatest-DEFwH4Se.mjs} +2 -2
  278. package/dist/{updateConsentManagerVersionToLatest-CaEkTnlL.mjs.map → updateConsentManagerVersionToLatest-DEFwH4Se.mjs.map} +1 -1
  279. package/dist/{uploadConsents-CNyuYx0o.mjs → uploadConsents-ChmFIw_j.mjs} +2 -2
  280. package/dist/{uploadConsents-CNyuYx0o.mjs.map → uploadConsents-ChmFIw_j.mjs.map} +1 -1
  281. package/dist/{uploadPrivacyRequestsFromCsv-BdTQOZnF.mjs → uploadPrivacyRequestsFromCsv-D3KSb1qH.mjs} +2 -2
  282. package/dist/{uploadPrivacyRequestsFromCsv-BdTQOZnF.mjs.map → uploadPrivacyRequestsFromCsv-D3KSb1qH.mjs.map} +1 -1
  283. package/dist/{validateTranscendAuth-CnHMn77m.mjs → validateTranscendAuth-D6Wr1cxY.mjs} +2 -2
  284. package/dist/{validateTranscendAuth-CnHMn77m.mjs.map → validateTranscendAuth-D6Wr1cxY.mjs.map} +1 -1
  285. package/dist/{writeCsv-D46aDkGf.mjs → writeCsv-D-2siSwE.mjs} +1 -1
  286. package/dist/{writeCsv-D46aDkGf.mjs.map → writeCsv-D-2siSwE.mjs.map} +1 -1
  287. package/package.json +8 -7
  288. package/dist/app-DCY8E776.mjs.map +0 -1
  289. package/dist/codecs-BsQFAFGT.mjs +0 -2
  290. package/dist/codecs-BsQFAFGT.mjs.map +0 -1
  291. package/dist/constants-BMAOvdcA.mjs +0 -2
  292. package/dist/constants-BMAOvdcA.mjs.map +0 -1
  293. package/dist/deno-runtime-QqwBDKXX.mjs +0 -2
  294. package/dist/deno-runtime-QqwBDKXX.mjs.map +0 -1
  295. package/dist/impl-BFJtKA2o2.mjs.map +0 -1
  296. package/dist/impl-BJlKQJdS2.mjs.map +0 -1
  297. package/dist/impl-BNPgYSBT.mjs +0 -3
  298. package/dist/impl-BNPgYSBT.mjs.map +0 -1
  299. package/dist/impl-BYGNx-8W2.mjs.map +0 -1
  300. package/dist/impl-BcJ019T2.mjs +0 -2
  301. package/dist/impl-BsC1KVxS.mjs +0 -2
  302. package/dist/impl-BwRcpAno.mjs.map +0 -1
  303. package/dist/impl-C5dzaDga2.mjs.map +0 -1
  304. package/dist/impl-C8BmxFQ2.mjs +0 -2
  305. package/dist/impl-CXUJ1eRC.mjs.map +0 -1
  306. package/dist/impl-CzxvoiGW.mjs +0 -3
  307. package/dist/impl-D-SQJc3t.mjs +0 -2
  308. package/dist/impl-D-SQJc3t.mjs.map +0 -1
  309. package/dist/impl-D23kJPAQ2.mjs +0 -3
  310. package/dist/impl-D23kJPAQ2.mjs.map +0 -1
  311. package/dist/impl-DOoR93T6.mjs.map +0 -1
  312. package/dist/impl-Dib6Fff12.mjs.map +0 -1
  313. package/dist/impl-Dk6TZKrp2.mjs.map +0 -1
  314. package/dist/impl-Dm-Fkr392.mjs.map +0 -1
  315. package/dist/impl-Drql0g72.mjs.map +0 -1
  316. package/dist/impl-FLj_mWLO.mjs +0 -2
  317. package/dist/impl-FLj_mWLO.mjs.map +0 -1
  318. package/dist/impl-VPBEqV0w2.mjs.map +0 -1
  319. package/dist/impl-m3QXCc6n.mjs.map +0 -1
  320. package/dist/logger-9T6vva73.mjs +0 -2
  321. package/dist/logger-9T6vva73.mjs.map +0 -1
  322. package/dist/manifest-DVuW_vvO.mjs +0 -2
  323. package/dist/manifest-DVuW_vvO.mjs.map +0 -1
  324. package/dist/mergeTranscendInputs-CWHXH0kF.mjs +0 -3
  325. package/dist/mergeTranscendInputs-CWHXH0kF.mjs.map +0 -1
  326. package/dist/missing-manifest-BKj1j-jg.mjs +0 -2
  327. package/dist/missing-manifest-BKj1j-jg.mjs.map +0 -1
  328. package/dist/printResult-esxW3HhT.mjs.map +0 -1
  329. package/dist/project-plan-apply-C2DfikVN.mjs +0 -3
  330. package/dist/project-plan-apply-C2DfikVN.mjs.map +0 -1
  331. package/dist/readTranscendYaml-STYnRzq-.mjs +0 -4
  332. package/dist/readTranscendYaml-STYnRzq-.mjs.map +0 -1
  333. package/dist/runOpa-CkKAwsvB.mjs +0 -2
  334. package/dist/runOpa-CkKAwsvB.mjs.map +0 -1
  335. package/dist/scaffold-planning-DMACXSnX.mjs +0 -121
  336. package/dist/scaffold-planning-DMACXSnX.mjs.map +0 -1
  337. package/dist/scaffold-templates-CsHM1y80.mjs +0 -84
  338. package/dist/scaffold-templates-CsHM1y80.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"fetchAllRequests-CEDKdq0c.mjs","names":[],"sources":["../src/lib/graphql/fetchAllRequests.ts"],"sourcesContent":["import { LOCALE_KEY } from '@transcend-io/internationalization';\nimport {\n RequestAction,\n RequestOrigin,\n RequestStatus,\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n} from '@transcend-io/privacy-types';\nimport { makeGraphQLRequest } from '@transcend-io/sdk';\nimport { valuesOf } from '@transcend-io/type-utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\nimport { REQUESTS, REQUESTS_COUNT } from './gqls/index.js';\n\nexport const RequestPurposeTrigger = t.type({\n title: t.string,\n name: t.string,\n consent: t.boolean,\n enrichedPreferences: t.array(\n t.type({\n topic: t.string,\n selectValues: t.array(\n t.type({\n id: t.string,\n name: t.string,\n preferenceOption: t.type({\n id: t.string,\n slug: t.string,\n title: t.type({\n defaultMessage: t.string,\n }),\n }),\n }),\n ),\n selectValue: t.type({\n id: t.string,\n name: t.string,\n }),\n preferenceTopic: t.type({\n title: t.type({\n defaultMessage: t.string,\n }),\n id: t.string,\n slug: t.string,\n }),\n name: t.string,\n id: t.string,\n booleanValue: t.boolean,\n }),\n ),\n});\n\n/** Override type */\nexport type RequestPurposeTrigger = t.TypeOf<typeof RequestPurposeTrigger>;\n\nexport const PrivacyRequest = t.intersection([\n t.type({\n /** Request ID */\n id: t.string,\n /** Time request was made */\n createdAt: t.string,\n /** Email of request */\n email: t.string,\n /** The type of request */\n type: valuesOf(RequestAction),\n /** Link to request in Transcend dashboard */\n link: t.string,\n /** Whether request is in silent mode */\n isSilent: t.boolean,\n /** Where request was made */\n origin: valuesOf(RequestOrigin),\n /** Whether request is a test request */\n isTest: t.boolean,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** Request details */\n details: t.string,\n /** Locale of request */\n locale: valuesOf(LOCALE_KEY),\n /** Status of request */\n status: valuesOf(RequestStatus),\n /** Type of data subject */\n subjectType: t.string,\n /** Country of request */\n country: t.union([t.null, valuesOf(IsoCountryCode)]),\n /** Subdivision of request */\n countrySubDivision: t.union([t.null, valuesOf(IsoCountrySubdivisionCode)]),\n /** Request attributes */\n attributeValues: t.array(\n t.type({\n id: t.string,\n attributeKey: t.type({ name: t.string, id: t.string }),\n name: t.string,\n }),\n ),\n }),\n t.partial({\n /** Days remaining until expired */\n daysRemaining: t.union([t.null, t.number]),\n /** Time when request was successfully completed */\n successfullyCompletedAt: t.union([t.null, t.string]),\n /** Purpose */\n purpose: RequestPurposeTrigger,\n }),\n]);\n\n/** Type override */\nexport type PrivacyRequest = t.TypeOf<typeof PrivacyRequest>;\n\nconst PAGE_SIZE = 100;\n\n/**\n * Fetch just the total count of requests matching a set of filters.\n * Useful for setting up a progress bar before streaming pages.\n *\n * @param client - GraphQL client\n * @param filterBy - Filter object (already serialized to ISO strings)\n * @returns The total count\n */\nexport async function fetchRequestsTotalCount(\n client: GraphQLClient,\n filterBy: Record<string, unknown>,\n): Promise<number> {\n const {\n requests: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REQUESTS_COUNT, { variables: { filterBy }, logger });\n return totalCount;\n}\n\n/**\n * Fetch all requests matching a set of filters.\n *\n * When `onPage` is provided the function streams pages to the callback\n * and never accumulates nodes in memory — ideal for very large exports.\n * Without `onPage` the function returns all nodes in a single array\n * (existing behaviour, kept for backward compatibility).\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of requests (empty when using onPage)\n */\nexport async function fetchAllRequests(\n client: GraphQLClient,\n {\n actions = [],\n statuses = [],\n origins = [],\n text,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isTest,\n isSilent,\n isClosed,\n requestIds = [],\n onPage,\n }: {\n /** Actions to filter on */\n actions?: RequestAction[];\n /** Origins to filter on */\n origins?: RequestOrigin[];\n /** Statuses to filter on */\n statuses?: RequestStatus[];\n /** Filter for requests created before this date */\n createdAtBefore?: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** Filter for requests with a specific identifier */\n text?: string;\n /** Return test requests */\n isTest?: boolean;\n /** Return silent mode requests */\n isSilent?: boolean;\n /** Filter by whether request is active */\n isClosed?: boolean;\n /**\n * Filter the list of requests for a set of IDs - these are applied\n * at runtime while other filters are applied at the GraphQL level.\n */\n requestIds?: string[];\n /** When provided, called with each page of nodes instead of accumulating in memory */\n onPage?: (nodes: PrivacyRequest[]) => void | Promise<void>;\n } = {},\n): Promise<PrivacyRequest[]> {\n const streaming = !!onPage;\n\n const filterBy = {\n text,\n type: actions.length > 0 ? actions : undefined,\n status: statuses.length > 0 ? statuses : undefined,\n origin: origins.length > 0 ? origins : undefined,\n isTest,\n isSilent,\n isClosed,\n createdAtBefore: createdAtBefore ? createdAtBefore.toISOString() : undefined,\n createdAtAfter: createdAtAfter ? createdAtAfter.toISOString() : undefined,\n updatedAtBefore: updatedAtBefore ? updatedAtBefore.toISOString() : undefined,\n updatedAtAfter: updatedAtAfter ? updatedAtAfter.toISOString() : undefined,\n };\n\n // When streaming, the caller manages progress/logging — skip count query & bar\n const t0 = new Date().getTime();\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n if (!streaming) {\n logger.info(colors.magenta('Fetching requests...'));\n const {\n requests: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REQUESTS_COUNT, { variables: { filterBy }, logger });\n\n if (totalCount > PAGE_SIZE) {\n logger.info(colors.magenta(`Fetching ${totalCount} requests`));\n progressBar.start(totalCount, 0);\n }\n }\n\n const requests: PrivacyRequest[] = [];\n let fetchedCount = 0;\n\n // Paginate through all results\n let cursor: string | undefined;\n let shouldContinue = false;\n do {\n const {\n requests: { nodes, pageInfo },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** List */\n nodes: PrivacyRequest[];\n /** Pagination info */\n pageInfo: {\n /** Cursor for the last item */\n endCursor: string | null;\n /** Whether more pages exist */\n hasNextPage: boolean;\n };\n };\n }>(client, REQUESTS, {\n variables: { first: PAGE_SIZE, after: cursor, filterBy },\n logger,\n });\n\n if (streaming) {\n await onPage!(nodes);\n } else {\n requests.push(...nodes);\n }\n\n fetchedCount += nodes.length;\n cursor = pageInfo.endCursor ?? undefined;\n if (!streaming) {\n progressBar.update(fetchedCount);\n }\n shouldContinue = pageInfo.hasNextPage;\n } while (shouldContinue);\n\n if (!streaming) {\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Completed fetching of ${fetchedCount} request in \"${totalTime / 1000}\" seconds.`,\n ),\n );\n }\n\n if (streaming) {\n return [];\n }\n\n // Filter down requests by request ID\n let allRequests = requests;\n if (requestIds && requestIds.length > 0) {\n allRequests = allRequests.filter((request) => requestIds.includes(request.id));\n logger.info(\n colors.green(\n `Filtered down to ${allRequests.length} requests based on ${requestIds.length} provided IDs.`,\n ),\n );\n }\n\n return allRequests;\n}\n"],"mappings":"seAkBA,MAAa,EAAwB,EAAE,KAAK,CAC1C,MAAO,EAAE,OACT,KAAM,EAAE,OACR,QAAS,EAAE,QACX,oBAAqB,EAAE,MACrB,EAAE,KAAK,CACL,MAAO,EAAE,OACT,aAAc,EAAE,MACd,EAAE,KAAK,CACL,GAAI,EAAE,OACN,KAAM,EAAE,OACR,iBAAkB,EAAE,KAAK,CACvB,GAAI,EAAE,OACN,KAAM,EAAE,OACR,MAAO,EAAE,KAAK,CACZ,eAAgB,EAAE,OACnB,CAAC,CACH,CAAC,CACH,CAAC,CACH,CACD,YAAa,EAAE,KAAK,CAClB,GAAI,EAAE,OACN,KAAM,EAAE,OACT,CAAC,CACF,gBAAiB,EAAE,KAAK,CACtB,MAAO,EAAE,KAAK,CACZ,eAAgB,EAAE,OACnB,CAAC,CACF,GAAI,EAAE,OACN,KAAM,EAAE,OACT,CAAC,CACF,KAAM,EAAE,OACR,GAAI,EAA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AIX,IAAI,EAAc,EAUlB,OATI,GAAc,EAAW,OAAS,IACpC,EAAc,EAAY,OAAQ,GAAY,EAAW,SAAS,EAAQ,GAAG,CAAC,CAC9E,EAAO,KACL,EAAO,MACL,oBAAoB,EAAY,OAAO,qBAAqB,EAAW,OAAO,gBAC/E,CACF,EAGI"}
1
+ {"version":3,"file":"fetchAllRequests-2TZr-LfT.mjs","names":[],"sources":["../src/lib/graphql/fetchAllRequests.ts"],"sourcesContent":["import { LOCALE_KEY } from '@transcend-io/internationalization';\nimport {\n RequestAction,\n RequestOrigin,\n RequestStatus,\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n} from '@transcend-io/privacy-types';\nimport { makeGraphQLRequest } from '@transcend-io/sdk';\nimport { valuesOf } from '@transcend-io/type-utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\nimport { REQUESTS, REQUESTS_COUNT } from './gqls/index.js';\n\nexport const RequestPurposeTrigger = t.type({\n title: t.string,\n name: t.string,\n consent: t.boolean,\n enrichedPreferences: t.array(\n t.type({\n topic: t.string,\n selectValues: t.array(\n t.type({\n id: t.string,\n name: t.string,\n preferenceOption: t.type({\n id: t.string,\n slug: t.string,\n title: t.type({\n defaultMessage: t.string,\n }),\n }),\n }),\n ),\n selectValue: t.type({\n id: t.string,\n name: t.string,\n }),\n preferenceTopic: t.type({\n title: t.type({\n defaultMessage: t.string,\n }),\n id: t.string,\n slug: t.string,\n }),\n name: t.string,\n id: t.string,\n booleanValue: t.boolean,\n }),\n ),\n});\n\n/** Override type */\nexport type RequestPurposeTrigger = t.TypeOf<typeof RequestPurposeTrigger>;\n\nexport const PrivacyRequest = t.intersection([\n t.type({\n /** Request ID */\n id: t.string,\n /** Time request was made */\n createdAt: t.string,\n /** Email of request */\n email: t.string,\n /** The type of request */\n type: valuesOf(RequestAction),\n /** Link to request in Transcend dashboard */\n link: t.string,\n /** Whether request is in silent mode */\n isSilent: t.boolean,\n /** Where request was made */\n origin: valuesOf(RequestOrigin),\n /** Whether request is a test request */\n isTest: t.boolean,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** Request details */\n details: t.string,\n /** Locale of request */\n locale: valuesOf(LOCALE_KEY),\n /** Status of request */\n status: valuesOf(RequestStatus),\n /** Type of data subject */\n subjectType: t.string,\n /** Country of request */\n country: t.union([t.null, valuesOf(IsoCountryCode)]),\n /** Subdivision of request */\n countrySubDivision: t.union([t.null, valuesOf(IsoCountrySubdivisionCode)]),\n /** Request attributes */\n attributeValues: t.array(\n t.type({\n id: t.string,\n attributeKey: t.type({ name: t.string, id: t.string }),\n name: t.string,\n }),\n ),\n }),\n t.partial({\n /** Days remaining until expired */\n daysRemaining: t.union([t.null, t.number]),\n /** Time when request was successfully completed */\n successfullyCompletedAt: t.union([t.null, t.string]),\n /** Purpose */\n purpose: RequestPurposeTrigger,\n }),\n]);\n\n/** Type override */\nexport type PrivacyRequest = t.TypeOf<typeof PrivacyRequest>;\n\nconst PAGE_SIZE = 100;\n\n/**\n * Fetch just the total count of requests matching a set of filters.\n * Useful for setting up a progress bar before streaming pages.\n *\n * @param client - GraphQL client\n * @param filterBy - Filter object (already serialized to ISO strings)\n * @returns The total count\n */\nexport async function fetchRequestsTotalCount(\n client: GraphQLClient,\n filterBy: Record<string, unknown>,\n): Promise<number> {\n const {\n requests: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REQUESTS_COUNT, { variables: { filterBy }, logger });\n return totalCount;\n}\n\n/**\n * Fetch all requests matching a set of filters.\n *\n * When `onPage` is provided the function streams pages to the callback\n * and never accumulates nodes in memory — ideal for very large exports.\n * Without `onPage` the function returns all nodes in a single array\n * (existing behaviour, kept for backward compatibility).\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of requests (empty when using onPage)\n */\nexport async function fetchAllRequests(\n client: GraphQLClient,\n {\n actions = [],\n statuses = [],\n origins = [],\n text,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isTest,\n isSilent,\n isClosed,\n requestIds = [],\n onPage,\n }: {\n /** Actions to filter on */\n actions?: RequestAction[];\n /** Origins to filter on */\n origins?: RequestOrigin[];\n /** Statuses to filter on */\n statuses?: RequestStatus[];\n /** Filter for requests created before this date */\n createdAtBefore?: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** Filter for requests with a specific identifier */\n text?: string;\n /** Return test requests */\n isTest?: boolean;\n /** Return silent mode requests */\n isSilent?: boolean;\n /** Filter by whether request is active */\n isClosed?: boolean;\n /**\n * Filter the list of requests for a set of IDs - these are applied\n * at runtime while other filters are applied at the GraphQL level.\n */\n requestIds?: string[];\n /** When provided, called with each page of nodes instead of accumulating in memory */\n onPage?: (nodes: PrivacyRequest[]) => void | Promise<void>;\n } = {},\n): Promise<PrivacyRequest[]> {\n const streaming = !!onPage;\n\n const filterBy = {\n text,\n type: actions.length > 0 ? actions : undefined,\n status: statuses.length > 0 ? statuses : undefined,\n origin: origins.length > 0 ? origins : undefined,\n isTest,\n isSilent,\n isClosed,\n createdAtBefore: createdAtBefore ? createdAtBefore.toISOString() : undefined,\n createdAtAfter: createdAtAfter ? createdAtAfter.toISOString() : undefined,\n updatedAtBefore: updatedAtBefore ? updatedAtBefore.toISOString() : undefined,\n updatedAtAfter: updatedAtAfter ? updatedAtAfter.toISOString() : undefined,\n };\n\n // When streaming, the caller manages progress/logging — skip count query & bar\n const t0 = new Date().getTime();\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n if (!streaming) {\n logger.info(colors.magenta('Fetching requests...'));\n const {\n requests: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REQUESTS_COUNT, { variables: { filterBy }, logger });\n\n if (totalCount > PAGE_SIZE) {\n logger.info(colors.magenta(`Fetching ${totalCount} requests`));\n progressBar.start(totalCount, 0);\n }\n }\n\n const requests: PrivacyRequest[] = [];\n let fetchedCount = 0;\n\n // Paginate through all results\n let cursor: string | undefined;\n let shouldContinue = false;\n do {\n const {\n requests: { nodes, pageInfo },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** List */\n nodes: PrivacyRequest[];\n /** Pagination info */\n pageInfo: {\n /** Cursor for the last item */\n endCursor: string | null;\n /** Whether more pages exist */\n hasNextPage: boolean;\n };\n };\n }>(client, REQUESTS, {\n variables: { first: PAGE_SIZE, after: cursor, filterBy },\n logger,\n });\n\n if (streaming) {\n await onPage!(nodes);\n } else {\n requests.push(...nodes);\n }\n\n fetchedCount += nodes.length;\n cursor = pageInfo.endCursor ?? undefined;\n if (!streaming) {\n progressBar.update(fetchedCount);\n }\n shouldContinue = pageInfo.hasNextPage;\n } while (shouldContinue);\n\n if (!streaming) {\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Completed fetching of ${fetchedCount} request in \"${totalTime / 1000}\" seconds.`,\n ),\n );\n }\n\n if (streaming) {\n return [];\n }\n\n // Filter down requests by request ID\n let allRequests = requests;\n if (requestIds && requestIds.length > 0) {\n allRequests = allRequests.filter((request) => requestIds.includes(request.id));\n logger.info(\n colors.green(\n `Filtered down to ${allRequests.length} requests based on ${requestIds.length} provided IDs.`,\n ),\n );\n }\n\n return allRequests;\n}\n"],"mappings":"seAkBA,MAAa,EAAwB,EAAE,KAAK,CAC1C,MAAO,EAAE,OACT,KAAM,EAAE,OACR,QAAS,EAAE,QACX,oBAAqB,EAAE,MACrB,EAAE,KAAK,CACL,MAAO,EAAE,OACT,aAAc,EAAE,MACd,EAAE,KAAK,CACL,GAAI,EAAE,OACN,KAAM,EAAE,OACR,iBAAkB,EAAE,KAAK,CACvB,GAAI,EAAE,OACN,K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AS,KAAK,GAAG,EAAM,CAGzB,GAAgB,EAAM,OACtB,EAAS,EAAS,WAAa,IAAA,GAC1B,GACH,EAAY,OAAO,EAAa,CAElC,EAAiB,EAAS,kBACnB,GAET,GAAI,CAAC,EAAW,CACd,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAEvB,EAAO,KACL,EAAO,MACL,yBAAyB,EAAa,eAAe,EAAY,IAAK,YACvE,CACF,CAGH,GAAI,EACF,MAAO,EAAE,CAIX,IAAI,EAAc,EAUlB,OATI,GAAc,EAAW,OAAS,IACpC,EAAc,EAAY,OAAQ,GAAY,EAAW,SAAS,EAAQ,GAAG,CAAC,CAC9E,EAAO,KACL,EAAO,MACL,oBAAoB,EAAY,OAAO,qBAAqB,EAAW,OAAO,gBAC/E,CACF,EAGI"}
@@ -1,3 +1,3 @@
1
1
  function e(e){return[`id ${e.id}`,`version ${e.version}`,`createdAt ${e.createdAt}`,`activatedAt ${e.activatedAt??`-`}`].join(`
2
2
  `)}export{e as t};
3
- //# sourceMappingURL=formatPolicyBundleVersionSummary-CrFtcPwS.mjs.map
3
+ //# sourceMappingURL=formatPolicyBundleVersionSummary-CJmMCLtJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatPolicyBundleVersionSummary-CrFtcPwS.mjs","names":[],"sources":["../src/commands/policy/helpers/formatPolicyBundleVersionSummary.ts"],"sourcesContent":["import { EMPTY_CELL } from '../constants.js';\nimport type { PolicyBundleVersion } from '../types.js';\n\n/**\n * Formats a policy bundle version for human-readable CLI output.\n *\n * @param version - Version record from the API\n * @returns Summary lines\n */\nexport function formatPolicyBundleVersionSummary(version: PolicyBundleVersion): string {\n return [\n `id ${version.id}`,\n `version ${version.version}`,\n `createdAt ${version.createdAt}`,\n `activatedAt ${version.activatedAt ?? EMPTY_CELL}`,\n ].join('\\n');\n}\n"],"mappings":"AASA,SAAgB,EAAiC,EAAsC,CACrF,MAAO,CACL,eAAe,EAAQ,KACvB,eAAe,EAAQ,UACvB,eAAe,EAAQ,YACvB,eAAe,EAAQ,aAAA,MACxB,CAAC,KAAK;EAAK"}
1
+ {"version":3,"file":"formatPolicyBundleVersionSummary-CJmMCLtJ.mjs","names":[],"sources":["../src/commands/policy/helpers/formatPolicyBundleVersionSummary.ts"],"sourcesContent":["import { EMPTY_CELL } from '../constants.js';\nimport type { PolicyBundleVersion } from '../types.js';\n\n/**\n * Formats a policy bundle version for human-readable CLI output.\n *\n * @param version - Version record from the API\n * @returns Summary lines\n */\nexport function formatPolicyBundleVersionSummary(version: PolicyBundleVersion): string {\n return [\n `id ${version.id}`,\n `version ${version.version}`,\n `createdAt ${version.createdAt}`,\n `activatedAt ${version.activatedAt ?? EMPTY_CELL}`,\n ].join('\\n');\n}\n"],"mappings":"AASA,SAAgB,EAAiC,EAAsC,CACrF,MAAO,CACL,eAAe,EAAQ,KACvB,eAAe,EAAQ,UACvB,eAAe,EAAQ,YACvB,eAAe,EAAQ,aAAA,MACxB,CAAC,KAAK;EAAK"}
@@ -1,2 +1,2 @@
1
- import{l as e,n as t}from"./constants-C1seVfCu.mjs";import n from"fuzzysearch";import r from"inquirer";function i(e,t){return n(e.toLowerCase(),t.toLowerCase())||n(t.toLowerCase(),e.toLowerCase())}function a(n,a,o,s){let c=n.filter(e=>i(a.toLowerCase(),e.toLowerCase()));return[...c,new r.Separator,...o?[]:[e],...s?[t]:[],...n.filter(e=>!c.includes(e))]}export{i as n,a as t};
2
- //# sourceMappingURL=fuzzyMatchColumns-OTsFJ21f.mjs.map
1
+ import{l as e,n as t}from"./constants-D_HVDaOy.mjs";import n from"fuzzysearch";import r from"inquirer";function i(e,t){return n(e.toLowerCase(),t.toLowerCase())||n(t.toLowerCase(),e.toLowerCase())}function a(n,a,o,s){let c=n.filter(e=>i(a.toLowerCase(),e.toLowerCase()));return[...c,new r.Separator,...o?[]:[e],...s?[t]:[],...n.filter(e=>!c.includes(e))]}export{i as n,a as t};
2
+ //# sourceMappingURL=fuzzyMatchColumns-CQCzpjWC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fuzzyMatchColumns-OTsFJ21f.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-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,2 +1,2 @@
1
- import{a as e}from"./constants-BG53Mbi9.mjs";import{t}from"./logger-9T6vva73.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-D6O_Qm3Y.mjs.map
1
+ import{a as e}from"./constants-jjHIzHGm.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-Bnqgmj-H.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateCrossAccountApiKeys-D6O_Qm3Y.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,MAA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,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-Bnqgmj-H.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,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5C,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,3 @@
1
+ import{a as e}from"./readTranscendYaml-BNn6-Ofi.mjs";import{t}from"./parseVariablesFromString-BOSfQ4QF.mjs";import{t as n}from"./done-input-validation-BUz-aVC5.mjs";import{n as r,t as i}from"./prompts-ClBXdELk.mjs";import{t as a}from"./missing-manifest-DgcukXfg.mjs";import{c as o,i as s,r as c,t as l}from"./deno-runtime-DV52X8-P.mjs";import{n as u,t as d}from"./path-safety-D5Qwl40b.mjs";import{n as f,r as p,s as m}from"./manifest-BNIpO_zW.mjs";import{t as h}from"./run-captured-process-BXwWXuTh.mjs";import{t as g}from"./module-graph-Cb0g74Ft.mjs";import{t as _}from"./project-plan-apply-Dvndx455.mjs";import{dirname as v,extname as y,join as b,relative as x,resolve as S,sep as C}from"node:path";import w from"colors";import{createTwoFilesPatch as T}from"diff";import{DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as E,DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as D,GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA as O}from"@transcend-io/custom-function-types";import k from"ajv";import{parse as A}from"jsonc-parser";function j(e,t){e.push({severity:`error`,...t})}function M(e,t){return x(e,t).split(C).join(`/`)||`.`}function N(e){let t=t=>e.type===`DSR`?t===`REQUEST_ENRICHER`?`dsr-enricher`:`dsr-datapoint`:`general`;return e[`test-payload`]?[{entry:e,path:e[`test-payload`],type:t(e[`test-payload-type`])}]:(e[`test-payloads`]??[]).map(n=>({entry:e,path:n.payload,type:t(n[`payload-type`])}))}function P(e,t){let n=N(e).map(({type:e})=>e),r=e.type===`DSR`&&n.length===0;return{entry:e,path:S(t,e.code),needsDefault:e.type!==`DSR`||n.includes(`dsr-datapoint`),needsEnricher:n.includes(`dsr-enricher`),needsAnyDsrExport:r}}function F(){let e=new k({allErrors:!0,strict:!1});return{general:e.compile(O),"dsr-datapoint":e.compile(E),"dsr-enricher":e.compile(D)}}function I(e){return`${e.instancePath||`/`} ${e.message??`is invalid`}`}function L(e,t,n,r){let i=F(),a=[],o=[];return n.forEach(n=>{if(/<<parameters\.[^>]+>>/u.test(n.code))j(r,{code:`manifest.unresolved-code-path`,message:`Code paths cannot contain unresolved parameter placeholders.`,path:n.code,functionName:n.name});else if(f(n.code)){let i=P(n,t);e.fs.existsSync(i.path)?u(e,t,i.path)?e.fs.statSync(i.path).isFile()?a.push(i):j(r,{code:`source.not-file`,message:`Referenced source path is not a regular file.`,path:n.code,functionName:n.name}):j(r,{code:`source.outside-project`,message:`Referenced source resolves outside the manifest directory through a symlink.`,path:n.code,functionName:n.name}):j(r,{code:`source.missing`,message:`Referenced source file does not exist.`,path:n.code,functionName:n.name})}N(n).forEach(a=>{if(/<<parameters\.[^>]+>>/u.test(a.path)){j(r,{code:`manifest.unresolved-payload-path`,message:`Payload paths cannot contain unresolved parameter placeholders.`,path:a.path,functionName:n.name});return}let s=S(t,a.path);if(!e.fs.existsSync(s)){j(r,{code:`payload.missing`,message:`Referenced test payload does not exist.`,path:a.path,functionName:n.name});return}if(!u(e,t,s)){j(r,{code:`payload.outside-project`,message:`Referenced test payload resolves outside the manifest directory through a symlink.`,path:a.path,functionName:n.name});return}if(!e.fs.statSync(s).isFile()){j(r,{code:`payload.not-file`,message:`Referenced test payload is not a regular file.`,path:a.path,functionName:n.name});return}o.push(s);let c;try{c=JSON.parse(e.fs.readFileSync(s,`utf8`))}catch(e){j(r,{code:`payload.invalid-json`,message:`Invalid JSON: ${e.message}`,path:a.path,functionName:n.name});return}let l=i[a.type];l(c)||(l.errors??[]).forEach(e=>j(r,{code:`payload.schema`,message:I(e),path:a.path,functionName:n.name}))})}),{sources:a,payloadPaths:[...new Set(o)]}}function R(e){try{let t=JSON.parse(e),n=Array.isArray(t)?t:t&&typeof t==`object`&&Array.isArray(t.nodes)?t.nodes:void 0;return n?new Set(n.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e.name;return typeof t==`string`?[t]:[]})):new Set}catch{return new Set}}function z(e){switch(y(e)){case`.ts`:case`.tsx`:return`ts`;case`.json`:case`.jsonc`:return`json`;case`.yaml`:case`.yml`:return`yaml`;default:return`ts`}}function B(e,t,n){if(!n)return;let r=A(e.fs.readFileSync(n,`utf8`));if(typeof r?.importMap==`string`){if(/^[a-z][a-z\d+.-]*:/iu.test(r.importMap))return r.importMap;let i=S(v(n),r.importMap);return d(e,t,i),i}let i={};if(r.imports!==void 0&&(i.imports=r.imports),r.scopes!==void 0&&(i.scopes=r.scopes),Object.keys(i).length!==0)return`data:application/json,${encodeURIComponent(JSON.stringify(i))}`}async function V(e,t,n,r,i){let a=[],o=[];for(let s of i){d(e,n,s);let i=e.fs.readFileSync(s,`utf8`),c=await t(`deno`,[`fmt`,...r,`--ext=${z(s)}`,`-`],{cwd:n,input:i},e);if(c.code!==0)throw Error(`Deno could not preview formatting for ${M(n,s)}.${c.stderr.trim()?`\n${c.stderr.trim()}`:``}`);if(c.stdout!==i){let t=M(n,s);a.push(T(t,t,i,c.stdout,``,``,{context:3})),o.push({kind:`file`,path:s,before:i,after:c.stdout,description:`Format ${t}`,mode:e.fs.statSync(s).mode})}}return{patch:a.join(`
2
+ `),changes:o}}function H(e,t,n,r){j(e,{code:t,message:`${n}${r.stderr.trim()?`\n${r.stderr.trim()}`:``}`})}async function U(t,n,r=h){let i=S(n.manifestPath),a=v(i),o=[],s=new Map([[`manifest`,`passed`],[`files`,`passed`],[`payloads`,`passed`],[`runtime`,`passed`],[`exports`,`passed`],[`typecheck`,`passed`],[`lint`,`passed`],[`format`,`passed`]]),f=()=>({version:1,status:o.some(({severity:e})=>e===`error`)?`failed`:`passed`,manifestPath:i,checks:[...s].map(([e,t])=>({name:e,status:t})),diagnostics:o});if(!t.fs.existsSync(i))return j(o,{code:`manifest.missing`,message:`Custom Function manifest does not exist.`,path:M(t.process.cwd(),i)}),s.set(`manifest`,`failed`),[`files`,`payloads`,`runtime`,`exports`,`typecheck`,`lint`,`format`].forEach(e=>s.set(e,`skipped`)),f();let y=[];try{y=p(e(t.fs.readFileSync(i,`utf8`),n.variables??{})).functions}catch(e){return j(o,{code:`manifest.invalid`,message:e.message,path:M(a,i)}),s.set(`manifest`,`failed`),[`files`,`payloads`,`runtime`,`exports`,`typecheck`,`lint`,`format`].forEach(e=>s.set(e,`skipped`)),f()}y.forEach(e=>{try{m({...e.env?{env:e.env}:{},...e[`allowed-hosts`]?{allowedHosts:e[`allowed-hosts`]}:{}})}catch(t){s.set(`manifest`,`failed`),j(o,{code:`manifest.execution-context`,message:t.message,path:M(a,i),functionName:e.name})}});let{sources:x,payloadPaths:C}=L(t,a,y,o);o.some(({code:e})=>[`source.`,`manifest.unresolved-code-path`].some(t=>e.startsWith(t)))&&(s.set(`files`,`failed`),[`exports`,`typecheck`,`lint`].forEach(e=>s.set(e,`failed`))),o.some(({code:e})=>[`payload.`,`manifest.unresolved-payload-path`].some(t=>e.startsWith(t)))&&s.set(`payloads`,`failed`);let w=b(a,`deno.jsonc`),T=b(a,`deno.json`),E=t.fs.existsSync(w)?w:t.fs.existsSync(T)?T:void 0,D=E!==void 0&&!u(t,a,E),O=D,k;if(D)j(o,{code:`deno.config-outside-project`,message:`Deno configuration resolves outside the manifest directory through a symlink.`,path:M(a,E)}),[`exports`,`typecheck`,`lint`,`format`].forEach(e=>s.set(e,`failed`));else try{k=B(t,a,E)}catch(e){O=!0,j(o,{code:`deno.import-map-outside-project`,message:e.message}),[`exports`,`typecheck`,`lint`,`format`].forEach(e=>s.set(e,`failed`))}let A=E&&!O?[`--config=${E}`]:[`--no-config`],N=()=>{[`exports`,`typecheck`,`lint`,`format`].forEach(e=>{s.get(e)!==`failed`&&s.set(e,`skipped`)})},P=await r(`deno`,[`--version`],{cwd:a},t),F=P.code===0?c(P.stdout):void 0;if(F?.level===`warning`&&o.push({code:`deno.version-mismatch`,severity:`warning`,message:F.message}),P.error?.code===`ENOENT`)s.set(`runtime`,`failed`),N(),j(o,{code:`deno.missing`,message:`Deno 2.x is required for export, type, lint, and format checks. Install it from ${l}`});else if(P.code!==0)s.set(`runtime`,`failed`),N(),H(o,`deno.unavailable`,`Deno could not be started.`,P);else if(F?.level===`error`)s.set(`runtime`,`failed`),N(),j(o,{code:`deno.unsupported-version`,message:F.message});else if(!O){for(let e of x){let n=await r(`deno`,[`info`,`--json`,...A,e.path],{cwd:a},t);if(n.code!==0)s.set(`files`,`failed`),H(o,`source.module-graph`,`Could not inspect runtime imports for ${M(a,e.path)}.`,n);else try{let t=g(n.stdout);t.length>0&&(s.set(`files`,`failed`),j(o,{code:`source.local-runtime-import`,message:`Custom Functions must be self-contained. Local or import-map runtime dependencies are not deployed: `+t.join(`, `),path:M(a,e.path),functionName:e.entry.name}))}catch(t){s.set(`files`,`failed`),j(o,{code:`source.module-graph`,message:t.message,path:M(a,e.path),functionName:e.entry.name})}let i=await r(`deno`,[`doc`,`--json`,...k?[`--import-map`,k]:[],e.path],{cwd:a},t);if(i.code!==0){s.set(`exports`,`failed`),H(o,`exports.inspect`,`Could not inspect exports for ${M(a,e.path)}.`,i);continue}let c=R(i.stdout);e.needsDefault&&!c.has(`default`)&&(s.set(`exports`,`failed`),j(o,{code:`exports.default-missing`,message:`The manifest fixtures require a default export.`,path:M(a,e.path),functionName:e.entry.name})),e.needsEnricher&&!c.has(`enricher`)&&(s.set(`exports`,`failed`),j(o,{code:`exports.enricher-missing`,message:"A REQUEST_ENRICHER fixture requires an `enricher` export.",path:M(a,e.path),functionName:e.entry.name})),e.needsAnyDsrExport&&!c.has(`default`)&&!c.has(`enricher`)&&(s.set(`exports`,`failed`),j(o,{code:`exports.dsr-missing`,message:"A DSR Custom Function requires a `default` or `enricher` export.",path:M(a,e.path),functionName:e.entry.name}))}let e=[...new Set(x.map(({path:e})=>e))];if(e.length>0){let n=await r(`deno`,[`check`,...A,...e],{cwd:a},t);n.code!==0&&(s.set(`typecheck`,`failed`),H(o,`deno.typecheck`,`Deno type checking failed.`,n));let i=await r(`deno`,[`lint`,...A,...e],{cwd:a},t);i.code!==0&&(s.set(`lint`,`failed`),H(o,`deno.lint`,`Deno linting failed.`,i))}let c=[...e,...C,i,...E?[E]:[],...k&&k!==E&&!/^[a-z][a-z\d+.-]*:/iu.test(k)?[k]:[]];c.forEach(e=>d(t,a,e));let l=await r(`deno`,[`fmt`,`--check`,...A,...c],{cwd:a},t);if(l.code!==0){let e;try{e=await V(t,r,a,A,c)}catch(e){return s.set(`format`,`failed`),j(o,{code:`deno.format-preview`,message:e.message}),f()}if(e.changes.length===0)return s.set(`format`,`failed`),H(o,`deno.format`,`Deno reported a formatting failure but did not produce a repair.`,l),f();if(n.fix||n.confirmFormat&&await n.confirmFormat(e.patch))try{await _(t,{rootDirectory:a,changes:e.changes})}catch(e){s.set(`format`,`failed`),j(o,{code:`deno.format-fix`,message:`Could not apply formatting transaction: ${e.message}`})}else s.set(`format`,`failed`),e.changes.forEach((t,r)=>{j(o,{code:`deno.format`,message:`Referenced file is not formatted.`+(r===0&&n.includeFormatPatchInDiagnostics&&e.patch?`\n${e.patch}`:``),path:M(a,t.path)})})}}return f()}async function W(e,c){n(this.process);let{manifestPath:l}=o(this.process.cwd(),{...c?{directory:c}:{},...e.manifest?{manifest:e.manifest}:{}}),u=this.fs.existsSync(l)?void 0:a({cwd:this.process.cwd(),manifestPath:l,discoveredManifestPaths:s(this,this.process.cwd()),command:`check`}),d=!e.json&&!e.noInteractive&&!!(this.process.stdin.isTTY&&this.process.stderr.isTTY),f=new r(this);try{let n=await U(this,{manifestPath:l,variables:t(e.variables),fix:e.fix,includeFormatPatchInDiagnostics:!e.json,...d&&!e.fix?{confirmFormat:async e=>(e&&this.logger.error(e),f.confirm(`Format the files shown above?`,!0))}:{}});u&&n.diagnostics.forEach(e=>{e.code===`manifest.missing`&&(e.message=u)}),e.json?this.process.stdout.write(`${JSON.stringify(n)}\n`):(this.logger.info(`${w.bold(`Custom Function checks`)}\n`),n.checks.forEach(({name:e,status:t})=>{let n=t===`passed`?`PASS`:t===`failed`?`FAIL`:`SKIP`,r=t===`passed`?w.green(n):t===`failed`?w.red(n):w.yellow(n);this.logger.info(`${r} ${e[0].toUpperCase()}${e.slice(1)}`)}),n.diagnostics.length>0&&this.logger.error(``),n.diagnostics.forEach(e=>{let t=e.path?`${e.path}: `:``,n=e.functionName?`[${e.functionName}] `:``,r=`${e.severity}: ${t}${n}${e.message}`;e.severity===`warning`?this.logger.warn(w.yellow(r)):this.logger.error(w.red(r))}),n.status===`passed`?(this.logger.info(``),this.logger.info(w.green(`Custom Function checks passed.`))):(this.logger.error(``),this.logger.error(w.red(`Custom Function checks failed.`)))),n.status===`failed`&&(this.process.exitCode=1)}catch(e){throw e instanceof i&&this.process.exit(130),e}}export{W as check};
3
+ //# sourceMappingURL=impl--JGnR3wp.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-CzxvoiGW.mjs","names":["parseJsonc"],"sources":["../src/commands/custom-functions/check/helpers.ts","../src/commands/custom-functions/check/impl.ts"],"sourcesContent":["import { dirname, extname, join, relative, resolve, sep } from 'node:path';\n\nimport {\n DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n} from '@transcend-io/custom-function-types';\nimport Ajv, { type ErrorObject, type ValidateFunction } from 'ajv';\nimport { createTwoFilesPatch } from 'diff';\nimport { parse as parseJsonc } from 'jsonc-parser';\n\nimport type { LocalContext } from '../../../context.js';\nimport {\n runCapturedProcess,\n type CapturedProcessResult,\n type CapturedProcessRunner,\n} from '../../../lib/cli/run-captured-process.js';\nimport {\n type CustomFunctionCheckResult,\n type CustomFunctionCheckStatus,\n type CustomFunctionDiagnostic,\n} from '../../../lib/custom-functions/check-model.js';\nimport {\n DENO_INSTALL_URL,\n getDenoRuntimeCompatibility,\n SUPPORTED_DENO_MAJOR_VERSION,\n} from '../../../lib/custom-functions/deno-runtime.js';\nimport { validateCustomFunctionExecutionContext } from '../../../lib/custom-functions/execution-context.js';\nimport {\n isCustomFunctionManifestPathContained,\n parseCustomFunctionsManifest,\n type CustomFunctionManifestEntry,\n} from '../../../lib/custom-functions/manifest.js';\nimport { findNonSelfContainedRuntimeImports } from '../../../lib/custom-functions/module-graph.js';\nimport { CUSTOM_FUNCTION_RESULT_VERSION } from '../../../lib/custom-functions/scaffold-model.js';\nimport { replaceVariablesInYaml } from '../../../lib/readTranscendYaml.js';\nimport {\n assertPathPhysicallyContained,\n isPathPhysicallyContained,\n} from '../../../lib/scaffolding/path-safety.js';\nimport { applyProjectPlan } from '../../../lib/scaffolding/project-plan-apply.js';\nimport type { PlannedFileChange } from '../../../lib/scaffolding/project-plan.js';\n\n/** Payload file plus its validation contract. */\ninterface PayloadReference {\n /** Manifest entry. */\n entry: CustomFunctionManifestEntry;\n /** Manifest-relative payload path. */\n path: string;\n /** Schema variant. */\n type: 'general' | 'dsr-datapoint' | 'dsr-enricher';\n}\n\n/** Source file plus exports required by fixtures. */\ninterface SourceReference {\n /** Manifest entry. */\n entry: CustomFunctionManifestEntry;\n /** Absolute source path. */\n path: string;\n /** Whether a default export is required. */\n needsDefault: boolean;\n /** Whether an enricher export is required. */\n needsEnricher: boolean;\n /** Whether either DSR export is acceptable when no fixtures identify one. */\n needsAnyDsrExport: boolean;\n}\n\n/** Options for local validation. */\nexport interface RunCustomFunctionChecksOptions {\n /** Absolute manifest path. */\n manifestPath: string;\n /** Variables used to resolve manifest placeholders. */\n variables?: Record<string, string>;\n /** Apply Deno formatting. */\n fix: boolean;\n /** Ask for an interactive formatting repair after receiving a patch. */\n confirmFormat?: (patch: string) => Promise<boolean>;\n /** Include a unified format patch in human-oriented diagnostics. */\n includeFormatPatchInDiagnostics?: boolean;\n}\n\n/**\n * Add one diagnostic.\n *\n * @param diagnostics - Result collection\n * @param diagnostic - Diagnostic without severity\n */\nfunction addError(\n diagnostics: CustomFunctionDiagnostic[],\n diagnostic: Omit<CustomFunctionDiagnostic, 'severity'>,\n): void {\n diagnostics.push({ severity: 'error', ...diagnostic });\n}\n\n/**\n * Normalize an absolute path relative to the manifest.\n *\n * @param manifestDirectory - Manifest directory\n * @param path - Absolute path\n * @returns Portable display path\n */\nfunction relativePath(manifestDirectory: string, path: string): string {\n const value = relative(manifestDirectory, path).split(sep).join('/');\n return value || '.';\n}\n\n/**\n * Select all payload files and schema variants.\n *\n * @param entry - Manifest entry\n * @returns Payload references\n */\nfunction payloadReferences(entry: CustomFunctionManifestEntry): PayloadReference[] {\n const variant = (\n payloadType: 'DATA_POINT' | 'REQUEST_ENRICHER' | undefined,\n ): PayloadReference['type'] => {\n if (entry.type !== 'DSR') {\n return 'general';\n }\n return payloadType === 'REQUEST_ENRICHER' ? 'dsr-enricher' : 'dsr-datapoint';\n };\n if (entry['test-payload']) {\n return [\n {\n entry,\n path: entry['test-payload'],\n type: variant(entry['test-payload-type']),\n },\n ];\n }\n return (entry['test-payloads'] ?? []).map((item) => ({\n entry,\n path: item.payload,\n type: variant(item['payload-type']),\n }));\n}\n\n/**\n * Select export expectations from the registered fixtures.\n *\n * @param entry - Manifest entry\n * @param manifestDirectory - Manifest directory\n * @returns Source reference\n */\nfunction sourceReference(\n entry: CustomFunctionManifestEntry,\n manifestDirectory: string,\n): SourceReference {\n const payloadTypes = payloadReferences(entry).map(({ type }) => type);\n const dsrWithoutPayloads = entry.type === 'DSR' && payloadTypes.length === 0;\n return {\n entry,\n path: resolve(manifestDirectory, entry.code),\n needsDefault: entry.type !== 'DSR' || payloadTypes.includes('dsr-datapoint'),\n needsEnricher: payloadTypes.includes('dsr-enricher'),\n needsAnyDsrExport: dsrWithoutPayloads,\n };\n}\n\n/**\n * Compile published payload schemas.\n *\n * @returns Validators by local variant\n */\nfunction buildPayloadValidators(): Record<PayloadReference['type'], ValidateFunction> {\n const ajv = new Ajv({ allErrors: true, strict: false });\n return {\n general: ajv.compile(GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n 'dsr-datapoint': ajv.compile(DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n 'dsr-enricher': ajv.compile(DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n };\n}\n\n/**\n * Format one Ajv failure.\n *\n * @param error - Ajv error\n * @returns Concise path and message\n */\nfunction formatSchemaError(error: ErrorObject): string {\n return `${error.instancePath || '/'} ${error.message ?? 'is invalid'}`;\n}\n\n/**\n * Validate referenced source and payload files without invoking Deno.\n *\n * @param context - CLI context\n * @param manifestDirectory - Manifest directory\n * @param entries - Parsed manifest entries\n * @param diagnostics - Result collection\n * @returns Existing source and format paths\n */\nfunction validateReferencedFiles(\n context: LocalContext,\n manifestDirectory: string,\n entries: readonly CustomFunctionManifestEntry[],\n diagnostics: CustomFunctionDiagnostic[],\n): {\n /** Existing source references. */\n sources: SourceReference[];\n /** Existing payload paths. */\n payloadPaths: string[];\n} {\n const validators = buildPayloadValidators();\n const sources: SourceReference[] = [];\n const payloadPaths: string[] = [];\n entries.forEach((entry) => {\n if (/<<parameters\\.[^>]+>>/u.test(entry.code)) {\n addError(diagnostics, {\n code: 'manifest.unresolved-code-path',\n message: 'Code paths cannot contain unresolved parameter placeholders.',\n path: entry.code,\n functionName: entry.name,\n });\n } else if (isCustomFunctionManifestPathContained(entry.code)) {\n const source = sourceReference(entry, manifestDirectory);\n if (!context.fs.existsSync(source.path)) {\n addError(diagnostics, {\n code: 'source.missing',\n message: 'Referenced source file does not exist.',\n path: entry.code,\n functionName: entry.name,\n });\n } else if (!isPathPhysicallyContained(context, manifestDirectory, source.path)) {\n addError(diagnostics, {\n code: 'source.outside-project',\n message: 'Referenced source resolves outside the manifest directory through a symlink.',\n path: entry.code,\n functionName: entry.name,\n });\n } else if (!context.fs.statSync(source.path).isFile()) {\n addError(diagnostics, {\n code: 'source.not-file',\n message: 'Referenced source path is not a regular file.',\n path: entry.code,\n functionName: entry.name,\n });\n } else {\n sources.push(source);\n }\n }\n\n payloadReferences(entry).forEach((reference) => {\n if (/<<parameters\\.[^>]+>>/u.test(reference.path)) {\n addError(diagnostics, {\n code: 'manifest.unresolved-payload-path',\n message: 'Payload paths cannot contain unresolved parameter placeholders.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n const payloadPath = resolve(manifestDirectory, reference.path);\n if (!context.fs.existsSync(payloadPath)) {\n addError(diagnostics, {\n code: 'payload.missing',\n message: 'Referenced test payload does not exist.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n if (!isPathPhysicallyContained(context, manifestDirectory, payloadPath)) {\n addError(diagnostics, {\n code: 'payload.outside-project',\n message:\n 'Referenced test payload resolves outside the manifest directory through a symlink.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n if (!context.fs.statSync(payloadPath).isFile()) {\n addError(diagnostics, {\n code: 'payload.not-file',\n message: 'Referenced test payload is not a regular file.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n payloadPaths.push(payloadPath);\n let payload: unknown;\n try {\n payload = JSON.parse(context.fs.readFileSync(payloadPath, 'utf8'));\n } catch (error) {\n addError(diagnostics, {\n code: 'payload.invalid-json',\n message: `Invalid JSON: ${(error as Error).message}`,\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n const validate = validators[reference.type];\n if (!validate(payload)) {\n (validate.errors ?? []).forEach((error) =>\n addError(diagnostics, {\n code: 'payload.schema',\n message: formatSchemaError(error),\n path: reference.path,\n functionName: entry.name,\n }),\n );\n }\n });\n });\n return {\n sources,\n payloadPaths: [...new Set(payloadPaths)],\n };\n}\n\n/**\n * Read Deno's JSON documentation output for exported names.\n *\n * @param output - `deno doc --json` output\n * @returns Exported names\n */\nfunction exportedNames(output: string): Set<string> {\n try {\n const document = JSON.parse(output) as unknown;\n const nodes = Array.isArray(document)\n ? document\n : document &&\n typeof document === 'object' &&\n Array.isArray((document as Record<string, unknown>).nodes)\n ? ((document as Record<string, unknown>).nodes as unknown[])\n : undefined;\n if (!nodes) {\n return new Set();\n }\n return new Set(\n nodes.flatMap((node) => {\n if (!node || typeof node !== 'object') {\n return [];\n }\n const name = (node as Record<string, unknown>).name;\n return typeof name === 'string' ? [name] : [];\n }),\n );\n } catch {\n return new Set();\n }\n}\n\n/**\n * Choose the Deno formatter extension for stdin.\n *\n * @param path - Source path\n * @returns Deno extension\n */\nfunction denoExtension(path: string): string {\n switch (extname(path)) {\n case '.ts':\n case '.tsx':\n return 'ts';\n case '.json':\n case '.jsonc':\n return 'json';\n case '.yaml':\n case '.yml':\n return 'yaml';\n default:\n return 'ts';\n }\n}\n\n/**\n * Resolve the import-map input supported by `deno doc`.\n *\n * Deno 2.4 does not expose `--config` for `doc`. A full `deno.json` is not a\n * valid import map when it also has `tasks`, `lint`, `fmt`, or\n * `compilerOptions`, so inline `imports` / `scopes` are passed as a data URL.\n * An `importMap` reference is followed explicitly.\n *\n * @param context - CLI context\n * @param manifestDirectory - Approved project root\n * @param configPath - Selected Deno config\n * @returns Import map path or URL\n */\nfunction resolveDocImportMap(\n context: LocalContext,\n manifestDirectory: string,\n configPath: string | undefined,\n): string | undefined {\n if (!configPath) {\n return undefined;\n }\n const config = parseJsonc(context.fs.readFileSync(configPath, 'utf8')) as {\n /** Optional separate import map. */\n importMap?: unknown;\n /** Inline import map entries. */\n imports?: unknown;\n /** Inline import map scopes. */\n scopes?: unknown;\n };\n if (typeof config?.importMap === 'string') {\n if (/^[a-z][a-z\\d+.-]*:/iu.test(config.importMap)) {\n return config.importMap;\n }\n const importMapPath = resolve(dirname(configPath), config.importMap);\n assertPathPhysicallyContained(context, manifestDirectory, importMapPath);\n return importMapPath;\n }\n const importMap: {\n /** Bare-specifier remappings. */\n imports?: unknown;\n /** Scoped remappings. */\n scopes?: unknown;\n } = {};\n if (config.imports !== undefined) {\n importMap.imports = config.imports;\n }\n if (config.scopes !== undefined) {\n importMap.scopes = config.scopes;\n }\n if (Object.keys(importMap).length === 0) {\n return undefined;\n }\n return `data:application/json,${encodeURIComponent(JSON.stringify(importMap))}`;\n}\n\n/**\n * Render deterministic formatter patches without changing files.\n *\n * @param context - CLI context\n * @param runner - Process runner\n * @param manifestDirectory - Working directory\n * @param configArgs - Deno config arguments\n * @param paths - Target files\n * @returns Unified patches and transactional file changes\n */\nasync function buildFormatPlan(\n context: LocalContext,\n runner: CapturedProcessRunner,\n manifestDirectory: string,\n configArgs: readonly string[],\n paths: readonly string[],\n): Promise<{ patch: string; changes: PlannedFileChange[] }> {\n const patches: string[] = [];\n const changes: PlannedFileChange[] = [];\n for (const path of paths) {\n assertPathPhysicallyContained(context, manifestDirectory, path);\n const before = context.fs.readFileSync(path, 'utf8');\n const result = await runner(\n 'deno',\n ['fmt', ...configArgs, `--ext=${denoExtension(path)}`, '-'],\n { cwd: manifestDirectory, input: before },\n context,\n );\n if (result.code !== 0) {\n throw new Error(\n `Deno could not preview formatting for ${relativePath(manifestDirectory, path)}.${\n result.stderr.trim() ? `\\n${result.stderr.trim()}` : ''\n }`,\n );\n }\n if (result.stdout !== before) {\n const display = relativePath(manifestDirectory, path);\n patches.push(\n createTwoFilesPatch(display, display, before, result.stdout, '', '', { context: 3 }),\n );\n changes.push({\n kind: 'file',\n path,\n before,\n after: result.stdout,\n description: `Format ${display}`,\n mode: context.fs.statSync(path).mode,\n });\n }\n }\n return { patch: patches.join('\\n'), changes };\n}\n\n/**\n * Record one Deno command failure.\n *\n * @param diagnostics - Result collection\n * @param code - Stable code\n * @param message - Summary\n * @param result - Captured process result\n */\nfunction recordDenoFailure(\n diagnostics: CustomFunctionDiagnostic[],\n code: string,\n message: string,\n result: CapturedProcessResult,\n): void {\n addError(diagnostics, {\n code,\n message: `${message}${result.stderr.trim() ? `\\n${result.stderr.trim()}` : ''}`,\n });\n}\n\n/**\n * Run credential-free local validation without executing user modules.\n *\n * @param context - CLI context\n * @param options - Manifest and format behavior\n * @param runner - Captured process runner\n * @returns Stable check result\n */\nexport async function runCustomFunctionChecks(\n context: LocalContext,\n options: RunCustomFunctionChecksOptions,\n runner: CapturedProcessRunner = runCapturedProcess,\n): Promise<CustomFunctionCheckResult> {\n const manifestPath = resolve(options.manifestPath);\n const manifestDirectory = dirname(manifestPath);\n const diagnostics: CustomFunctionDiagnostic[] = [];\n const statuses = new Map<string, CustomFunctionCheckStatus>([\n ['manifest', 'passed'],\n ['files', 'passed'],\n ['payloads', 'passed'],\n ['runtime', 'passed'],\n ['exports', 'passed'],\n ['typecheck', 'passed'],\n ['lint', 'passed'],\n ['format', 'passed'],\n ]);\n const buildResult = (): CustomFunctionCheckResult => ({\n version: CUSTOM_FUNCTION_RESULT_VERSION,\n status: diagnostics.some(({ severity }) => severity === 'error') ? 'failed' : 'passed',\n manifestPath,\n checks: [...statuses].map(([name, status]) => ({ name, status })),\n diagnostics,\n });\n if (!context.fs.existsSync(manifestPath)) {\n addError(diagnostics, {\n code: 'manifest.missing',\n message: 'Custom Function manifest does not exist.',\n path: relativePath(context.process.cwd(), manifestPath),\n });\n statuses.set('manifest', 'failed');\n ['files', 'payloads', 'runtime', 'exports', 'typecheck', 'lint', 'format'].forEach((name) =>\n statuses.set(name, 'skipped'),\n );\n return buildResult();\n }\n\n let entries: readonly CustomFunctionManifestEntry[] = [];\n try {\n const manifestContents = replaceVariablesInYaml(\n context.fs.readFileSync(manifestPath, 'utf8'),\n options.variables ?? {},\n );\n entries = parseCustomFunctionsManifest(manifestContents).functions;\n } catch (error) {\n addError(diagnostics, {\n code: 'manifest.invalid',\n message: (error as Error).message,\n path: relativePath(manifestDirectory, manifestPath),\n });\n statuses.set('manifest', 'failed');\n ['files', 'payloads', 'runtime', 'exports', 'typecheck', 'lint', 'format'].forEach((name) =>\n statuses.set(name, 'skipped'),\n );\n return buildResult();\n }\n entries.forEach((entry) => {\n try {\n validateCustomFunctionExecutionContext({\n ...(entry.env ? { env: entry.env } : {}),\n ...(entry['allowed-hosts'] ? { allowedHosts: entry['allowed-hosts'] } : {}),\n });\n } catch (error) {\n statuses.set('manifest', 'failed');\n addError(diagnostics, {\n code: 'manifest.execution-context',\n message: (error as Error).message,\n path: relativePath(manifestDirectory, manifestPath),\n functionName: entry.name,\n });\n }\n });\n\n const { sources, payloadPaths } = validateReferencedFiles(\n context,\n manifestDirectory,\n entries,\n diagnostics,\n );\n if (\n diagnostics.some(({ code }) =>\n ['source.', 'manifest.unresolved-code-path'].some((prefix) => code.startsWith(prefix)),\n )\n ) {\n statuses.set('files', 'failed');\n ['exports', 'typecheck', 'lint'].forEach((name) => statuses.set(name, 'failed'));\n }\n if (\n diagnostics.some(({ code }) =>\n ['payload.', 'manifest.unresolved-payload-path'].some((prefix) => code.startsWith(prefix)),\n )\n ) {\n statuses.set('payloads', 'failed');\n }\n\n const denoJsonc = join(manifestDirectory, 'deno.jsonc');\n const denoJson = join(manifestDirectory, 'deno.json');\n const configPath = context.fs.existsSync(denoJsonc)\n ? denoJsonc\n : context.fs.existsSync(denoJson)\n ? denoJson\n : undefined;\n const unsafeConfig =\n configPath !== undefined && !isPathPhysicallyContained(context, manifestDirectory, configPath);\n let unsafeConfiguration = unsafeConfig;\n let docImportMap: string | undefined;\n if (unsafeConfig) {\n addError(diagnostics, {\n code: 'deno.config-outside-project',\n message: 'Deno configuration resolves outside the manifest directory through a symlink.',\n path: relativePath(manifestDirectory, configPath),\n });\n ['exports', 'typecheck', 'lint', 'format'].forEach((name) => statuses.set(name, 'failed'));\n } else {\n try {\n docImportMap = resolveDocImportMap(context, manifestDirectory, configPath);\n } catch (error) {\n unsafeConfiguration = true;\n addError(diagnostics, {\n code: 'deno.import-map-outside-project',\n message: (error as Error).message,\n });\n ['exports', 'typecheck', 'lint', 'format'].forEach((name) => statuses.set(name, 'failed'));\n }\n }\n const configArgs =\n configPath && !unsafeConfiguration ? [`--config=${configPath}`] : ['--no-config'];\n const skipPendingDenoChecks = (): void => {\n ['exports', 'typecheck', 'lint', 'format'].forEach((name) => {\n if (statuses.get(name) !== 'failed') {\n statuses.set(name, 'skipped');\n }\n });\n };\n const denoVersion = await runner('deno', ['--version'], { cwd: manifestDirectory }, context);\n const compatibility =\n denoVersion.code === 0 ? getDenoRuntimeCompatibility(denoVersion.stdout) : undefined;\n if (compatibility?.level === 'warning') {\n diagnostics.push({\n code: 'deno.version-mismatch',\n severity: 'warning',\n message: compatibility.message,\n });\n }\n if (denoVersion.error?.code === 'ENOENT') {\n statuses.set('runtime', 'failed');\n skipPendingDenoChecks();\n addError(diagnostics, {\n code: 'deno.missing',\n message: `Deno ${SUPPORTED_DENO_MAJOR_VERSION}.x is required for export, type, lint, and format checks. Install it from ${DENO_INSTALL_URL}`,\n });\n } else if (denoVersion.code !== 0) {\n statuses.set('runtime', 'failed');\n skipPendingDenoChecks();\n recordDenoFailure(diagnostics, 'deno.unavailable', 'Deno could not be started.', denoVersion);\n } else if (compatibility?.level === 'error') {\n statuses.set('runtime', 'failed');\n skipPendingDenoChecks();\n addError(diagnostics, {\n code: 'deno.unsupported-version',\n message: compatibility.message,\n });\n } else if (!unsafeConfiguration) {\n for (const source of sources) {\n const moduleGraph = await runner(\n 'deno',\n ['info', '--json', ...configArgs, source.path],\n { cwd: manifestDirectory },\n context,\n );\n if (moduleGraph.code !== 0) {\n statuses.set('files', 'failed');\n recordDenoFailure(\n diagnostics,\n 'source.module-graph',\n `Could not inspect runtime imports for ${relativePath(manifestDirectory, source.path)}.`,\n moduleGraph,\n );\n } else {\n try {\n const unsupportedImports = findNonSelfContainedRuntimeImports(moduleGraph.stdout);\n if (unsupportedImports.length > 0) {\n statuses.set('files', 'failed');\n addError(diagnostics, {\n code: 'source.local-runtime-import',\n message:\n 'Custom Functions must be self-contained. Local or import-map runtime dependencies are not deployed: ' +\n unsupportedImports.join(', '),\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n } catch (error) {\n statuses.set('files', 'failed');\n addError(diagnostics, {\n code: 'source.module-graph',\n message: (error as Error).message,\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n }\n const result = await runner(\n 'deno',\n ['doc', '--json', ...(docImportMap ? ['--import-map', docImportMap] : []), source.path],\n { cwd: manifestDirectory },\n context,\n );\n if (result.code !== 0) {\n statuses.set('exports', 'failed');\n recordDenoFailure(\n diagnostics,\n 'exports.inspect',\n `Could not inspect exports for ${relativePath(manifestDirectory, source.path)}.`,\n result,\n );\n continue;\n }\n const names = exportedNames(result.stdout);\n if (source.needsDefault && !names.has('default')) {\n statuses.set('exports', 'failed');\n addError(diagnostics, {\n code: 'exports.default-missing',\n message: 'The manifest fixtures require a default export.',\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n if (source.needsEnricher && !names.has('enricher')) {\n statuses.set('exports', 'failed');\n addError(diagnostics, {\n code: 'exports.enricher-missing',\n message: 'A REQUEST_ENRICHER fixture requires an `enricher` export.',\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n if (source.needsAnyDsrExport && !names.has('default') && !names.has('enricher')) {\n statuses.set('exports', 'failed');\n addError(diagnostics, {\n code: 'exports.dsr-missing',\n message: 'A DSR Custom Function requires a `default` or `enricher` export.',\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n }\n\n const sourcePaths = [...new Set(sources.map(({ path }) => path))];\n if (sourcePaths.length > 0) {\n const typecheck = await runner(\n 'deno',\n ['check', ...configArgs, ...sourcePaths],\n { cwd: manifestDirectory },\n context,\n );\n if (typecheck.code !== 0) {\n statuses.set('typecheck', 'failed');\n recordDenoFailure(diagnostics, 'deno.typecheck', 'Deno type checking failed.', typecheck);\n }\n const lint = await runner(\n 'deno',\n ['lint', ...configArgs, ...sourcePaths],\n { cwd: manifestDirectory },\n context,\n );\n if (lint.code !== 0) {\n statuses.set('lint', 'failed');\n recordDenoFailure(diagnostics, 'deno.lint', 'Deno linting failed.', lint);\n }\n }\n\n const formatPaths = [\n ...sourcePaths,\n ...payloadPaths,\n manifestPath,\n ...(configPath ? [configPath] : []),\n ...(docImportMap && docImportMap !== configPath && !/^[a-z][a-z\\d+.-]*:/iu.test(docImportMap)\n ? [docImportMap]\n : []),\n ];\n formatPaths.forEach((path) => assertPathPhysicallyContained(context, manifestDirectory, path));\n const format = await runner(\n 'deno',\n ['fmt', '--check', ...configArgs, ...formatPaths],\n { cwd: manifestDirectory },\n context,\n );\n if (format.code !== 0) {\n let formatPlan: Awaited<ReturnType<typeof buildFormatPlan>>;\n try {\n formatPlan = await buildFormatPlan(\n context,\n runner,\n manifestDirectory,\n configArgs,\n formatPaths,\n );\n } catch (error) {\n statuses.set('format', 'failed');\n addError(diagnostics, {\n code: 'deno.format-preview',\n message: (error as Error).message,\n });\n return buildResult();\n }\n if (formatPlan.changes.length === 0) {\n statuses.set('format', 'failed');\n recordDenoFailure(\n diagnostics,\n 'deno.format',\n 'Deno reported a formatting failure but did not produce a repair.',\n format,\n );\n return buildResult();\n }\n const shouldFix =\n options.fix ||\n (options.confirmFormat ? await options.confirmFormat(formatPlan.patch) : false);\n if (shouldFix) {\n try {\n await applyProjectPlan(context, {\n rootDirectory: manifestDirectory,\n changes: formatPlan.changes,\n });\n } catch (error) {\n statuses.set('format', 'failed');\n addError(diagnostics, {\n code: 'deno.format-fix',\n message: `Could not apply formatting transaction: ${(error as Error).message}`,\n });\n }\n } else {\n statuses.set('format', 'failed');\n formatPlan.changes.forEach((change, index) => {\n addError(diagnostics, {\n code: 'deno.format',\n message:\n 'Referenced file is not formatted.' +\n (index === 0 && options.includeFormatPatchInDiagnostics && formatPlan.patch\n ? `\\n${formatPlan.patch}`\n : ''),\n path: relativePath(manifestDirectory, change.path),\n });\n });\n }\n }\n }\n\n return buildResult();\n}\n","import colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { formatMissingManifestMessage } from '../../../lib/custom-functions/missing-manifest.js';\nimport { resolveCustomFunctionProjectPaths } from '../../../lib/custom-functions/paths.js';\nimport { discoverCustomFunctionManifests } from '../../../lib/custom-functions/project-discovery.js';\nimport {\n CustomFunctionPrompts,\n PromptCancelledError,\n} from '../../../lib/custom-functions/prompts.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { runCustomFunctionChecks } from './helpers.js';\n\n/** CLI flags for `transcend custom-functions check`. */\nexport interface CustomFunctionsCheckFlags {\n /** Explicit manifest path. */\n manifest?: string;\n /** Manifest variable substitutions. */\n variables: string;\n /** Apply Deno formatting. */\n fix: boolean;\n /** Disable prompts. */\n noInteractive: boolean;\n /** Emit JSON on stdout. */\n json: boolean;\n}\n\n/**\n * Validate a local Custom Function project without credentials.\n *\n * @param this - CLI context\n * @param flags - Check and interaction flags\n * @param directory - Optional target directory\n */\nexport async function check(\n this: LocalContext,\n flags: CustomFunctionsCheckFlags,\n directory?: string,\n): Promise<void> {\n doneInputValidation(this.process);\n const { manifestPath } = resolveCustomFunctionProjectPaths(this.process.cwd(), {\n ...(directory ? { directory } : {}),\n ...(flags.manifest ? { manifest: flags.manifest } : {}),\n });\n const missingMessage = this.fs.existsSync(manifestPath)\n ? undefined\n : formatMissingManifestMessage({\n cwd: this.process.cwd(),\n manifestPath,\n discoveredManifestPaths: discoverCustomFunctionManifests(this, this.process.cwd()),\n command: 'check',\n });\n const interactive =\n !flags.json &&\n !flags.noInteractive &&\n Boolean(this.process.stdin.isTTY && this.process.stderr.isTTY);\n const prompts = new CustomFunctionPrompts(this);\n try {\n const result = await runCustomFunctionChecks(this, {\n manifestPath,\n variables: parseVariablesFromString(flags.variables),\n fix: flags.fix,\n includeFormatPatchInDiagnostics: !flags.json,\n ...(interactive && !flags.fix\n ? {\n confirmFormat: async (patch: string): Promise<boolean> => {\n if (patch) {\n this.logger.error(patch);\n }\n return prompts.confirm('Format the files shown above?', true);\n },\n }\n : {}),\n });\n if (missingMessage) {\n result.diagnostics.forEach((diagnostic) => {\n if (diagnostic.code === 'manifest.missing') {\n diagnostic.message = missingMessage;\n }\n });\n }\n if (flags.json) {\n this.process.stdout.write(`${JSON.stringify(result)}\\n`);\n } else {\n this.logger.info(`${colors.bold('Custom Function checks')}\\n`);\n result.checks.forEach(({ name, status }) => {\n const label = status === 'passed' ? 'PASS' : status === 'failed' ? 'FAIL' : 'SKIP';\n const styledLabel =\n status === 'passed'\n ? colors.green(label)\n : status === 'failed'\n ? colors.red(label)\n : colors.yellow(label);\n this.logger.info(`${styledLabel} ${name[0]!.toUpperCase()}${name.slice(1)}`);\n });\n if (result.diagnostics.length > 0) {\n this.logger.error('');\n }\n result.diagnostics.forEach((diagnostic) => {\n const location = diagnostic.path ? `${diagnostic.path}: ` : '';\n const owner = diagnostic.functionName ? `[${diagnostic.functionName}] ` : '';\n const message = `${diagnostic.severity}: ${location}${owner}${diagnostic.message}`;\n if (diagnostic.severity === 'warning') {\n this.logger.warn(colors.yellow(message));\n } else {\n this.logger.error(colors.red(message));\n }\n });\n if (result.status === 'passed') {\n this.logger.info('');\n this.logger.info(colors.green('Custom Function checks passed.'));\n } else {\n this.logger.error('');\n this.logger.error(colors.red('Custom Function checks failed.'));\n }\n }\n if (result.status === 'failed') {\n this.process.exitCode = 1;\n }\n } catch (error) {\n if (error instanceof PromptCancelledError) {\n this.process.exit(130);\n }\n throw error;\n }\n}\n"],"mappings":"66BAuFA,SAAS,EACP,EACA,EACM,CACN,EAAY,KAAK,CAAE,SAAU,QAAS,GAAG,EAAY,CAAC,CAUxD,SAAS,EAAa,EAA2B,EAAsB,CAErE,OADc,EAAS,EAAmB,EAAK,CAAC,MAAM,EAAI,CAAC,KAAK,IACpD,EAAI,IASlB,SAAS,EAAkB,EAAwD,CACjF,IAAM,EACJ,GAEI,EAAM,OAAS,MAGZ,IAAgB,mBAAqB,eAAiB,gBAFpD,UAaX,OATI,EAAM,gBACD,CACL,CACE,QACA,KAAM,EAAM,gBACZ,KAAM,EAAQ,EAAM,qBAAqB,CAC1C,CACF,EAEK,EAAM,kBAAoB,EAAE,EAAE,IAAK,IAAU,CACnD,QACA,KAAM,EAAK,QACX,KAAM,EAAQ,EAAK,gBAAgB,CACpC,EAAE,CAUL,SAAS,EACP,EACA,EACiB,CACjB,IAAM,EAAe,EAAkB,EAAM,CAAC,KAAK,CAAE,UAAW,EAAK,CAC/D,EAAqB,EAAM,OAAS,OAAS,EAAa,SAAW,EAC3E,MAAO,CACL,QACA,KAAM,EAAQ,EAAmB,EAAM,KAAK,CAC5C,aAAc,EAAM,OAAS,OAAS,EAAa,SAAS,gBAAgB,CAC5E,cAAe,EAAa,SAAS,eAAe,CACpD,kBAAmB,EACpB,CAQH,SAAS,GAA6E,CACpF,IAAM,EAAM,IAAI,EAAI,CAAE,UAAW,GAAM,OAAQ,GAAO,CAAC,CACvD,MAAO,CACL,QAAS,EAAI,QAAQ,EAAuC,CAC5D,gBAAiB,EAAI,QAAQ,EAA6C,CAC1E,eAAgB,EAAI,QAAQ,EAAoD,CACjF,CASH,SAAS,EAA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EAAW,EAAW,KAAO,GAAG,EAAW,KAAK,IAAM,GACtD,EAAQ,EAAW,aAAe,IAAI,EAAW,aAAa,IAAM,GACpE,EAAU,GAAG,EAAW,SAAS,IAAI,IAAW,IAAQ,EAAW,UACrE,EAAW,WAAa,UAC1B,KAAK,OAAO,KAAK,EAAO,OAAO,EAAQ,CAAC,CAExC,KAAK,OAAO,MAAM,EAAO,IAAI,EAAQ,CAAC,EAExC,CACE,EAAO,SAAW,UACpB,KAAK,OAAO,KAAK,GAAG,CACpB,KAAK,OAAO,KAAK,EAAO,MAAM,iCAAiC,CAAC,GAEhE,KAAK,OAAO,MAAM,GAAG,CACrB,KAAK,OAAO,MAAM,EAAO,IAAI,iCAAiC,CAAC,GAG/D,EAAO,SAAW,WACpB,KAAK,QAAQ,SAAW,SAEnB,EAAO,CAId,MAHI,aAAiB,GACnB,KAAK,QAAQ,KAAK,IAAI,CAElB"}
1
+ {"version":3,"file":"impl--JGnR3wp.mjs","names":["parseJsonc"],"sources":["../src/commands/custom-functions/check/helpers.ts","../src/commands/custom-functions/check/impl.ts"],"sourcesContent":["import { dirname, extname, join, relative, resolve, sep } from 'node:path';\n\nimport {\n DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA,\n} from '@transcend-io/custom-function-types';\nimport Ajv, { type ErrorObject, type ValidateFunction } from 'ajv';\nimport { createTwoFilesPatch } from 'diff';\nimport { parse as parseJsonc } from 'jsonc-parser';\n\nimport type { LocalContext } from '../../../context.js';\nimport {\n runCapturedProcess,\n type CapturedProcessResult,\n type CapturedProcessRunner,\n} from '../../../lib/cli/run-captured-process.js';\nimport {\n type CustomFunctionCheckResult,\n type CustomFunctionCheckStatus,\n type CustomFunctionDiagnostic,\n} from '../../../lib/custom-functions/check-model.js';\nimport {\n DENO_INSTALL_URL,\n getDenoRuntimeCompatibility,\n SUPPORTED_DENO_MAJOR_VERSION,\n} from '../../../lib/custom-functions/deno-runtime.js';\nimport { validateCustomFunctionExecutionContext } from '../../../lib/custom-functions/execution-context.js';\nimport {\n isCustomFunctionManifestPathContained,\n parseCustomFunctionsManifest,\n type CustomFunctionManifestEntry,\n} from '../../../lib/custom-functions/manifest.js';\nimport { findNonSelfContainedRuntimeImports } from '../../../lib/custom-functions/module-graph.js';\nimport { CUSTOM_FUNCTION_RESULT_VERSION } from '../../../lib/custom-functions/scaffold-model.js';\nimport { replaceVariablesInYaml } from '../../../lib/readTranscendYaml.js';\nimport {\n assertPathPhysicallyContained,\n isPathPhysicallyContained,\n} from '../../../lib/scaffolding/path-safety.js';\nimport { applyProjectPlan } from '../../../lib/scaffolding/project-plan-apply.js';\nimport type { PlannedFileChange } from '../../../lib/scaffolding/project-plan.js';\n\n/** Payload file plus its validation contract. */\ninterface PayloadReference {\n /** Manifest entry. */\n entry: CustomFunctionManifestEntry;\n /** Manifest-relative payload path. */\n path: string;\n /** Schema variant. */\n type: 'general' | 'dsr-datapoint' | 'dsr-enricher';\n}\n\n/** Source file plus exports required by fixtures. */\ninterface SourceReference {\n /** Manifest entry. */\n entry: CustomFunctionManifestEntry;\n /** Absolute source path. */\n path: string;\n /** Whether a default export is required. */\n needsDefault: boolean;\n /** Whether an enricher export is required. */\n needsEnricher: boolean;\n /** Whether either DSR export is acceptable when no fixtures identify one. */\n needsAnyDsrExport: boolean;\n}\n\n/** Options for local validation. */\nexport interface RunCustomFunctionChecksOptions {\n /** Absolute manifest path. */\n manifestPath: string;\n /** Variables used to resolve manifest placeholders. */\n variables?: Record<string, string>;\n /** Apply Deno formatting. */\n fix: boolean;\n /** Ask for an interactive formatting repair after receiving a patch. */\n confirmFormat?: (patch: string) => Promise<boolean>;\n /** Include a unified format patch in human-oriented diagnostics. */\n includeFormatPatchInDiagnostics?: boolean;\n}\n\n/**\n * Add one diagnostic.\n *\n * @param diagnostics - Result collection\n * @param diagnostic - Diagnostic without severity\n */\nfunction addError(\n diagnostics: CustomFunctionDiagnostic[],\n diagnostic: Omit<CustomFunctionDiagnostic, 'severity'>,\n): void {\n diagnostics.push({ severity: 'error', ...diagnostic });\n}\n\n/**\n * Normalize an absolute path relative to the manifest.\n *\n * @param manifestDirectory - Manifest directory\n * @param path - Absolute path\n * @returns Portable display path\n */\nfunction relativePath(manifestDirectory: string, path: string): string {\n const value = relative(manifestDirectory, path).split(sep).join('/');\n return value || '.';\n}\n\n/**\n * Select all payload files and schema variants.\n *\n * @param entry - Manifest entry\n * @returns Payload references\n */\nfunction payloadReferences(entry: CustomFunctionManifestEntry): PayloadReference[] {\n const variant = (\n payloadType: 'DATA_POINT' | 'REQUEST_ENRICHER' | undefined,\n ): PayloadReference['type'] => {\n if (entry.type !== 'DSR') {\n return 'general';\n }\n return payloadType === 'REQUEST_ENRICHER' ? 'dsr-enricher' : 'dsr-datapoint';\n };\n if (entry['test-payload']) {\n return [\n {\n entry,\n path: entry['test-payload'],\n type: variant(entry['test-payload-type']),\n },\n ];\n }\n return (entry['test-payloads'] ?? []).map((item) => ({\n entry,\n path: item.payload,\n type: variant(item['payload-type']),\n }));\n}\n\n/**\n * Select export expectations from the registered fixtures.\n *\n * @param entry - Manifest entry\n * @param manifestDirectory - Manifest directory\n * @returns Source reference\n */\nfunction sourceReference(\n entry: CustomFunctionManifestEntry,\n manifestDirectory: string,\n): SourceReference {\n const payloadTypes = payloadReferences(entry).map(({ type }) => type);\n const dsrWithoutPayloads = entry.type === 'DSR' && payloadTypes.length === 0;\n return {\n entry,\n path: resolve(manifestDirectory, entry.code),\n needsDefault: entry.type !== 'DSR' || payloadTypes.includes('dsr-datapoint'),\n needsEnricher: payloadTypes.includes('dsr-enricher'),\n needsAnyDsrExport: dsrWithoutPayloads,\n };\n}\n\n/**\n * Compile published payload schemas.\n *\n * @returns Validators by local variant\n */\nfunction buildPayloadValidators(): Record<PayloadReference['type'], ValidateFunction> {\n const ajv = new Ajv({ allErrors: true, strict: false });\n return {\n general: ajv.compile(GENERAL_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n 'dsr-datapoint': ajv.compile(DSR_DATAPOINT_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n 'dsr-enricher': ajv.compile(DSR_REQUEST_ENRICHER_CUSTOM_FUNCTION_PAYLOAD_SCHEMA),\n };\n}\n\n/**\n * Format one Ajv failure.\n *\n * @param error - Ajv error\n * @returns Concise path and message\n */\nfunction formatSchemaError(error: ErrorObject): string {\n return `${error.instancePath || '/'} ${error.message ?? 'is invalid'}`;\n}\n\n/**\n * Validate referenced source and payload files without invoking Deno.\n *\n * @param context - CLI context\n * @param manifestDirectory - Manifest directory\n * @param entries - Parsed manifest entries\n * @param diagnostics - Result collection\n * @returns Existing source and format paths\n */\nfunction validateReferencedFiles(\n context: LocalContext,\n manifestDirectory: string,\n entries: readonly CustomFunctionManifestEntry[],\n diagnostics: CustomFunctionDiagnostic[],\n): {\n /** Existing source references. */\n sources: SourceReference[];\n /** Existing payload paths. */\n payloadPaths: string[];\n} {\n const validators = buildPayloadValidators();\n const sources: SourceReference[] = [];\n const payloadPaths: string[] = [];\n entries.forEach((entry) => {\n if (/<<parameters\\.[^>]+>>/u.test(entry.code)) {\n addError(diagnostics, {\n code: 'manifest.unresolved-code-path',\n message: 'Code paths cannot contain unresolved parameter placeholders.',\n path: entry.code,\n functionName: entry.name,\n });\n } else if (isCustomFunctionManifestPathContained(entry.code)) {\n const source = sourceReference(entry, manifestDirectory);\n if (!context.fs.existsSync(source.path)) {\n addError(diagnostics, {\n code: 'source.missing',\n message: 'Referenced source file does not exist.',\n path: entry.code,\n functionName: entry.name,\n });\n } else if (!isPathPhysicallyContained(context, manifestDirectory, source.path)) {\n addError(diagnostics, {\n code: 'source.outside-project',\n message: 'Referenced source resolves outside the manifest directory through a symlink.',\n path: entry.code,\n functionName: entry.name,\n });\n } else if (!context.fs.statSync(source.path).isFile()) {\n addError(diagnostics, {\n code: 'source.not-file',\n message: 'Referenced source path is not a regular file.',\n path: entry.code,\n functionName: entry.name,\n });\n } else {\n sources.push(source);\n }\n }\n\n payloadReferences(entry).forEach((reference) => {\n if (/<<parameters\\.[^>]+>>/u.test(reference.path)) {\n addError(diagnostics, {\n code: 'manifest.unresolved-payload-path',\n message: 'Payload paths cannot contain unresolved parameter placeholders.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n const payloadPath = resolve(manifestDirectory, reference.path);\n if (!context.fs.existsSync(payloadPath)) {\n addError(diagnostics, {\n code: 'payload.missing',\n message: 'Referenced test payload does not exist.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n if (!isPathPhysicallyContained(context, manifestDirectory, payloadPath)) {\n addError(diagnostics, {\n code: 'payload.outside-project',\n message:\n 'Referenced test payload resolves outside the manifest directory through a symlink.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n if (!context.fs.statSync(payloadPath).isFile()) {\n addError(diagnostics, {\n code: 'payload.not-file',\n message: 'Referenced test payload is not a regular file.',\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n payloadPaths.push(payloadPath);\n let payload: unknown;\n try {\n payload = JSON.parse(context.fs.readFileSync(payloadPath, 'utf8'));\n } catch (error) {\n addError(diagnostics, {\n code: 'payload.invalid-json',\n message: `Invalid JSON: ${(error as Error).message}`,\n path: reference.path,\n functionName: entry.name,\n });\n return;\n }\n const validate = validators[reference.type];\n if (!validate(payload)) {\n (validate.errors ?? []).forEach((error) =>\n addError(diagnostics, {\n code: 'payload.schema',\n message: formatSchemaError(error),\n path: reference.path,\n functionName: entry.name,\n }),\n );\n }\n });\n });\n return {\n sources,\n payloadPaths: [...new Set(payloadPaths)],\n };\n}\n\n/**\n * Read Deno's JSON documentation output for exported names.\n *\n * @param output - `deno doc --json` output\n * @returns Exported names\n */\nfunction exportedNames(output: string): Set<string> {\n try {\n const document = JSON.parse(output) as unknown;\n const nodes = Array.isArray(document)\n ? document\n : document &&\n typeof document === 'object' &&\n Array.isArray((document as Record<string, unknown>).nodes)\n ? ((document as Record<string, unknown>).nodes as unknown[])\n : undefined;\n if (!nodes) {\n return new Set();\n }\n return new Set(\n nodes.flatMap((node) => {\n if (!node || typeof node !== 'object') {\n return [];\n }\n const name = (node as Record<string, unknown>).name;\n return typeof name === 'string' ? [name] : [];\n }),\n );\n } catch {\n return new Set();\n }\n}\n\n/**\n * Choose the Deno formatter extension for stdin.\n *\n * @param path - Source path\n * @returns Deno extension\n */\nfunction denoExtension(path: string): string {\n switch (extname(path)) {\n case '.ts':\n case '.tsx':\n return 'ts';\n case '.json':\n case '.jsonc':\n return 'json';\n case '.yaml':\n case '.yml':\n return 'yaml';\n default:\n return 'ts';\n }\n}\n\n/**\n * Resolve the import-map input supported by `deno doc`.\n *\n * Deno 2.4 does not expose `--config` for `doc`. A full `deno.json` is not a\n * valid import map when it also has `tasks`, `lint`, `fmt`, or\n * `compilerOptions`, so inline `imports` / `scopes` are passed as a data URL.\n * An `importMap` reference is followed explicitly.\n *\n * @param context - CLI context\n * @param manifestDirectory - Approved project root\n * @param configPath - Selected Deno config\n * @returns Import map path or URL\n */\nfunction resolveDocImportMap(\n context: LocalContext,\n manifestDirectory: string,\n configPath: string | undefined,\n): string | undefined {\n if (!configPath) {\n return undefined;\n }\n const config = parseJsonc(context.fs.readFileSync(configPath, 'utf8')) as {\n /** Optional separate import map. */\n importMap?: unknown;\n /** Inline import map entries. */\n imports?: unknown;\n /** Inline import map scopes. */\n scopes?: unknown;\n };\n if (typeof config?.importMap === 'string') {\n if (/^[a-z][a-z\\d+.-]*:/iu.test(config.importMap)) {\n return config.importMap;\n }\n const importMapPath = resolve(dirname(configPath), config.importMap);\n assertPathPhysicallyContained(context, manifestDirectory, importMapPath);\n return importMapPath;\n }\n const importMap: {\n /** Bare-specifier remappings. */\n imports?: unknown;\n /** Scoped remappings. */\n scopes?: unknown;\n } = {};\n if (config.imports !== undefined) {\n importMap.imports = config.imports;\n }\n if (config.scopes !== undefined) {\n importMap.scopes = config.scopes;\n }\n if (Object.keys(importMap).length === 0) {\n return undefined;\n }\n return `data:application/json,${encodeURIComponent(JSON.stringify(importMap))}`;\n}\n\n/**\n * Render deterministic formatter patches without changing files.\n *\n * @param context - CLI context\n * @param runner - Process runner\n * @param manifestDirectory - Working directory\n * @param configArgs - Deno config arguments\n * @param paths - Target files\n * @returns Unified patches and transactional file changes\n */\nasync function buildFormatPlan(\n context: LocalContext,\n runner: CapturedProcessRunner,\n manifestDirectory: string,\n configArgs: readonly string[],\n paths: readonly string[],\n): Promise<{ patch: string; changes: PlannedFileChange[] }> {\n const patches: string[] = [];\n const changes: PlannedFileChange[] = [];\n for (const path of paths) {\n assertPathPhysicallyContained(context, manifestDirectory, path);\n const before = context.fs.readFileSync(path, 'utf8');\n const result = await runner(\n 'deno',\n ['fmt', ...configArgs, `--ext=${denoExtension(path)}`, '-'],\n { cwd: manifestDirectory, input: before },\n context,\n );\n if (result.code !== 0) {\n throw new Error(\n `Deno could not preview formatting for ${relativePath(manifestDirectory, path)}.${\n result.stderr.trim() ? `\\n${result.stderr.trim()}` : ''\n }`,\n );\n }\n if (result.stdout !== before) {\n const display = relativePath(manifestDirectory, path);\n patches.push(\n createTwoFilesPatch(display, display, before, result.stdout, '', '', { context: 3 }),\n );\n changes.push({\n kind: 'file',\n path,\n before,\n after: result.stdout,\n description: `Format ${display}`,\n mode: context.fs.statSync(path).mode,\n });\n }\n }\n return { patch: patches.join('\\n'), changes };\n}\n\n/**\n * Record one Deno command failure.\n *\n * @param diagnostics - Result collection\n * @param code - Stable code\n * @param message - Summary\n * @param result - Captured process result\n */\nfunction recordDenoFailure(\n diagnostics: CustomFunctionDiagnostic[],\n code: string,\n message: string,\n result: CapturedProcessResult,\n): void {\n addError(diagnostics, {\n code,\n message: `${message}${result.stderr.trim() ? `\\n${result.stderr.trim()}` : ''}`,\n });\n}\n\n/**\n * Run credential-free local validation without executing user modules.\n *\n * @param context - CLI context\n * @param options - Manifest and format behavior\n * @param runner - Captured process runner\n * @returns Stable check result\n */\nexport async function runCustomFunctionChecks(\n context: LocalContext,\n options: RunCustomFunctionChecksOptions,\n runner: CapturedProcessRunner = runCapturedProcess,\n): Promise<CustomFunctionCheckResult> {\n const manifestPath = resolve(options.manifestPath);\n const manifestDirectory = dirname(manifestPath);\n const diagnostics: CustomFunctionDiagnostic[] = [];\n const statuses = new Map<string, CustomFunctionCheckStatus>([\n ['manifest', 'passed'],\n ['files', 'passed'],\n ['payloads', 'passed'],\n ['runtime', 'passed'],\n ['exports', 'passed'],\n ['typecheck', 'passed'],\n ['lint', 'passed'],\n ['format', 'passed'],\n ]);\n const buildResult = (): CustomFunctionCheckResult => ({\n version: CUSTOM_FUNCTION_RESULT_VERSION,\n status: diagnostics.some(({ severity }) => severity === 'error') ? 'failed' : 'passed',\n manifestPath,\n checks: [...statuses].map(([name, status]) => ({ name, status })),\n diagnostics,\n });\n if (!context.fs.existsSync(manifestPath)) {\n addError(diagnostics, {\n code: 'manifest.missing',\n message: 'Custom Function manifest does not exist.',\n path: relativePath(context.process.cwd(), manifestPath),\n });\n statuses.set('manifest', 'failed');\n ['files', 'payloads', 'runtime', 'exports', 'typecheck', 'lint', 'format'].forEach((name) =>\n statuses.set(name, 'skipped'),\n );\n return buildResult();\n }\n\n let entries: readonly CustomFunctionManifestEntry[] = [];\n try {\n const manifestContents = replaceVariablesInYaml(\n context.fs.readFileSync(manifestPath, 'utf8'),\n options.variables ?? {},\n );\n entries = parseCustomFunctionsManifest(manifestContents).functions;\n } catch (error) {\n addError(diagnostics, {\n code: 'manifest.invalid',\n message: (error as Error).message,\n path: relativePath(manifestDirectory, manifestPath),\n });\n statuses.set('manifest', 'failed');\n ['files', 'payloads', 'runtime', 'exports', 'typecheck', 'lint', 'format'].forEach((name) =>\n statuses.set(name, 'skipped'),\n );\n return buildResult();\n }\n entries.forEach((entry) => {\n try {\n validateCustomFunctionExecutionContext({\n ...(entry.env ? { env: entry.env } : {}),\n ...(entry['allowed-hosts'] ? { allowedHosts: entry['allowed-hosts'] } : {}),\n });\n } catch (error) {\n statuses.set('manifest', 'failed');\n addError(diagnostics, {\n code: 'manifest.execution-context',\n message: (error as Error).message,\n path: relativePath(manifestDirectory, manifestPath),\n functionName: entry.name,\n });\n }\n });\n\n const { sources, payloadPaths } = validateReferencedFiles(\n context,\n manifestDirectory,\n entries,\n diagnostics,\n );\n if (\n diagnostics.some(({ code }) =>\n ['source.', 'manifest.unresolved-code-path'].some((prefix) => code.startsWith(prefix)),\n )\n ) {\n statuses.set('files', 'failed');\n ['exports', 'typecheck', 'lint'].forEach((name) => statuses.set(name, 'failed'));\n }\n if (\n diagnostics.some(({ code }) =>\n ['payload.', 'manifest.unresolved-payload-path'].some((prefix) => code.startsWith(prefix)),\n )\n ) {\n statuses.set('payloads', 'failed');\n }\n\n const denoJsonc = join(manifestDirectory, 'deno.jsonc');\n const denoJson = join(manifestDirectory, 'deno.json');\n const configPath = context.fs.existsSync(denoJsonc)\n ? denoJsonc\n : context.fs.existsSync(denoJson)\n ? denoJson\n : undefined;\n const unsafeConfig =\n configPath !== undefined && !isPathPhysicallyContained(context, manifestDirectory, configPath);\n let unsafeConfiguration = unsafeConfig;\n let docImportMap: string | undefined;\n if (unsafeConfig) {\n addError(diagnostics, {\n code: 'deno.config-outside-project',\n message: 'Deno configuration resolves outside the manifest directory through a symlink.',\n path: relativePath(manifestDirectory, configPath),\n });\n ['exports', 'typecheck', 'lint', 'format'].forEach((name) => statuses.set(name, 'failed'));\n } else {\n try {\n docImportMap = resolveDocImportMap(context, manifestDirectory, configPath);\n } catch (error) {\n unsafeConfiguration = true;\n addError(diagnostics, {\n code: 'deno.import-map-outside-project',\n message: (error as Error).message,\n });\n ['exports', 'typecheck', 'lint', 'format'].forEach((name) => statuses.set(name, 'failed'));\n }\n }\n const configArgs =\n configPath && !unsafeConfiguration ? [`--config=${configPath}`] : ['--no-config'];\n const skipPendingDenoChecks = (): void => {\n ['exports', 'typecheck', 'lint', 'format'].forEach((name) => {\n if (statuses.get(name) !== 'failed') {\n statuses.set(name, 'skipped');\n }\n });\n };\n const denoVersion = await runner('deno', ['--version'], { cwd: manifestDirectory }, context);\n const compatibility =\n denoVersion.code === 0 ? getDenoRuntimeCompatibility(denoVersion.stdout) : undefined;\n if (compatibility?.level === 'warning') {\n diagnostics.push({\n code: 'deno.version-mismatch',\n severity: 'warning',\n message: compatibility.message,\n });\n }\n if (denoVersion.error?.code === 'ENOENT') {\n statuses.set('runtime', 'failed');\n skipPendingDenoChecks();\n addError(diagnostics, {\n code: 'deno.missing',\n message: `Deno ${SUPPORTED_DENO_MAJOR_VERSION}.x is required for export, type, lint, and format checks. Install it from ${DENO_INSTALL_URL}`,\n });\n } else if (denoVersion.code !== 0) {\n statuses.set('runtime', 'failed');\n skipPendingDenoChecks();\n recordDenoFailure(diagnostics, 'deno.unavailable', 'Deno could not be started.', denoVersion);\n } else if (compatibility?.level === 'error') {\n statuses.set('runtime', 'failed');\n skipPendingDenoChecks();\n addError(diagnostics, {\n code: 'deno.unsupported-version',\n message: compatibility.message,\n });\n } else if (!unsafeConfiguration) {\n for (const source of sources) {\n const moduleGraph = await runner(\n 'deno',\n ['info', '--json', ...configArgs, source.path],\n { cwd: manifestDirectory },\n context,\n );\n if (moduleGraph.code !== 0) {\n statuses.set('files', 'failed');\n recordDenoFailure(\n diagnostics,\n 'source.module-graph',\n `Could not inspect runtime imports for ${relativePath(manifestDirectory, source.path)}.`,\n moduleGraph,\n );\n } else {\n try {\n const unsupportedImports = findNonSelfContainedRuntimeImports(moduleGraph.stdout);\n if (unsupportedImports.length > 0) {\n statuses.set('files', 'failed');\n addError(diagnostics, {\n code: 'source.local-runtime-import',\n message:\n 'Custom Functions must be self-contained. Local or import-map runtime dependencies are not deployed: ' +\n unsupportedImports.join(', '),\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n } catch (error) {\n statuses.set('files', 'failed');\n addError(diagnostics, {\n code: 'source.module-graph',\n message: (error as Error).message,\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n }\n const result = await runner(\n 'deno',\n ['doc', '--json', ...(docImportMap ? ['--import-map', docImportMap] : []), source.path],\n { cwd: manifestDirectory },\n context,\n );\n if (result.code !== 0) {\n statuses.set('exports', 'failed');\n recordDenoFailure(\n diagnostics,\n 'exports.inspect',\n `Could not inspect exports for ${relativePath(manifestDirectory, source.path)}.`,\n result,\n );\n continue;\n }\n const names = exportedNames(result.stdout);\n if (source.needsDefault && !names.has('default')) {\n statuses.set('exports', 'failed');\n addError(diagnostics, {\n code: 'exports.default-missing',\n message: 'The manifest fixtures require a default export.',\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n if (source.needsEnricher && !names.has('enricher')) {\n statuses.set('exports', 'failed');\n addError(diagnostics, {\n code: 'exports.enricher-missing',\n message: 'A REQUEST_ENRICHER fixture requires an `enricher` export.',\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n if (source.needsAnyDsrExport && !names.has('default') && !names.has('enricher')) {\n statuses.set('exports', 'failed');\n addError(diagnostics, {\n code: 'exports.dsr-missing',\n message: 'A DSR Custom Function requires a `default` or `enricher` export.',\n path: relativePath(manifestDirectory, source.path),\n functionName: source.entry.name,\n });\n }\n }\n\n const sourcePaths = [...new Set(sources.map(({ path }) => path))];\n if (sourcePaths.length > 0) {\n const typecheck = await runner(\n 'deno',\n ['check', ...configArgs, ...sourcePaths],\n { cwd: manifestDirectory },\n context,\n );\n if (typecheck.code !== 0) {\n statuses.set('typecheck', 'failed');\n recordDenoFailure(diagnostics, 'deno.typecheck', 'Deno type checking failed.', typecheck);\n }\n const lint = await runner(\n 'deno',\n ['lint', ...configArgs, ...sourcePaths],\n { cwd: manifestDirectory },\n context,\n );\n if (lint.code !== 0) {\n statuses.set('lint', 'failed');\n recordDenoFailure(diagnostics, 'deno.lint', 'Deno linting failed.', lint);\n }\n }\n\n const formatPaths = [\n ...sourcePaths,\n ...payloadPaths,\n manifestPath,\n ...(configPath ? [configPath] : []),\n ...(docImportMap && docImportMap !== configPath && !/^[a-z][a-z\\d+.-]*:/iu.test(docImportMap)\n ? [docImportMap]\n : []),\n ];\n formatPaths.forEach((path) => assertPathPhysicallyContained(context, manifestDirectory, path));\n const format = await runner(\n 'deno',\n ['fmt', '--check', ...configArgs, ...formatPaths],\n { cwd: manifestDirectory },\n context,\n );\n if (format.code !== 0) {\n let formatPlan: Awaited<ReturnType<typeof buildFormatPlan>>;\n try {\n formatPlan = await buildFormatPlan(\n context,\n runner,\n manifestDirectory,\n configArgs,\n formatPaths,\n );\n } catch (error) {\n statuses.set('format', 'failed');\n addError(diagnostics, {\n code: 'deno.format-preview',\n message: (error as Error).message,\n });\n return buildResult();\n }\n if (formatPlan.changes.length === 0) {\n statuses.set('format', 'failed');\n recordDenoFailure(\n diagnostics,\n 'deno.format',\n 'Deno reported a formatting failure but did not produce a repair.',\n format,\n );\n return buildResult();\n }\n const shouldFix =\n options.fix ||\n (options.confirmFormat ? await options.confirmFormat(formatPlan.patch) : false);\n if (shouldFix) {\n try {\n await applyProjectPlan(context, {\n rootDirectory: manifestDirectory,\n changes: formatPlan.changes,\n });\n } catch (error) {\n statuses.set('format', 'failed');\n addError(diagnostics, {\n code: 'deno.format-fix',\n message: `Could not apply formatting transaction: ${(error as Error).message}`,\n });\n }\n } else {\n statuses.set('format', 'failed');\n formatPlan.changes.forEach((change, index) => {\n addError(diagnostics, {\n code: 'deno.format',\n message:\n 'Referenced file is not formatted.' +\n (index === 0 && options.includeFormatPatchInDiagnostics && formatPlan.patch\n ? `\\n${formatPlan.patch}`\n : ''),\n path: relativePath(manifestDirectory, change.path),\n });\n });\n }\n }\n }\n\n return buildResult();\n}\n","import colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { formatMissingManifestMessage } from '../../../lib/custom-functions/missing-manifest.js';\nimport { resolveCustomFunctionProjectPaths } from '../../../lib/custom-functions/paths.js';\nimport { discoverCustomFunctionManifests } from '../../../lib/custom-functions/project-discovery.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { PromptCancelledError, ScaffoldPrompts } from '../../../lib/scaffolding/prompts.js';\nimport { runCustomFunctionChecks } from './helpers.js';\n\n/** CLI flags for `transcend custom-functions check`. */\nexport interface CustomFunctionsCheckFlags {\n /** Explicit manifest path. */\n manifest?: string;\n /** Manifest variable substitutions. */\n variables: string;\n /** Apply Deno formatting. */\n fix: boolean;\n /** Disable prompts. */\n noInteractive: boolean;\n /** Emit JSON on stdout. */\n json: boolean;\n}\n\n/**\n * Validate a local Custom Function project without credentials.\n *\n * @param this - CLI context\n * @param flags - Check and interaction flags\n * @param directory - Optional target directory\n */\nexport async function check(\n this: LocalContext,\n flags: CustomFunctionsCheckFlags,\n directory?: string,\n): Promise<void> {\n doneInputValidation(this.process);\n const { manifestPath } = resolveCustomFunctionProjectPaths(this.process.cwd(), {\n ...(directory ? { directory } : {}),\n ...(flags.manifest ? { manifest: flags.manifest } : {}),\n });\n const missingMessage = this.fs.existsSync(manifestPath)\n ? undefined\n : formatMissingManifestMessage({\n cwd: this.process.cwd(),\n manifestPath,\n discoveredManifestPaths: discoverCustomFunctionManifests(this, this.process.cwd()),\n command: 'check',\n });\n const interactive =\n !flags.json &&\n !flags.noInteractive &&\n Boolean(this.process.stdin.isTTY && this.process.stderr.isTTY);\n const prompts = new ScaffoldPrompts(this);\n try {\n const result = await runCustomFunctionChecks(this, {\n manifestPath,\n variables: parseVariablesFromString(flags.variables),\n fix: flags.fix,\n includeFormatPatchInDiagnostics: !flags.json,\n ...(interactive && !flags.fix\n ? {\n confirmFormat: async (patch: string): Promise<boolean> => {\n if (patch) {\n this.logger.error(patch);\n }\n return prompts.confirm('Format the files shown above?', true);\n },\n }\n : {}),\n });\n if (missingMessage) {\n result.diagnostics.forEach((diagnostic) => {\n if (diagnostic.code === 'manifest.missing') {\n diagnostic.message = missingMessage;\n }\n });\n }\n if (flags.json) {\n this.process.stdout.write(`${JSON.stringify(result)}\\n`);\n } else {\n this.logger.info(`${colors.bold('Custom Function checks')}\\n`);\n result.checks.forEach(({ name, status }) => {\n const label = status === 'passed' ? 'PASS' : status === 'failed' ? 'FAIL' : 'SKIP';\n const styledLabel =\n status === 'passed'\n ? colors.green(label)\n : status === 'failed'\n ? colors.red(label)\n : colors.yellow(label);\n this.logger.info(`${styledLabel} ${name[0]!.toUpperCase()}${name.slice(1)}`);\n });\n if (result.diagnostics.length > 0) {\n this.logger.error('');\n }\n result.diagnostics.forEach((diagnostic) => {\n const location = diagnostic.path ? `${diagnostic.path}: ` : '';\n const owner = diagnostic.functionName ? `[${diagnostic.functionName}] ` : '';\n const message = `${diagnostic.severity}: ${location}${owner}${diagnostic.message}`;\n if (diagnostic.severity === 'warning') {\n this.logger.warn(colors.yellow(message));\n } else {\n this.logger.error(colors.red(message));\n }\n });\n if (result.status === 'passed') {\n this.logger.info('');\n this.logger.info(colors.green('Custom Function checks passed.'));\n } else {\n this.logger.error('');\n this.logger.error(colors.red('Custom Function checks failed.'));\n }\n }\n if (result.status === 'failed') {\n this.process.exitCode = 1;\n }\n } catch (error) {\n if (error instanceof PromptCancelledError) {\n this.process.exit(130);\n }\n throw error;\n }\n}\n"],"mappings":"8/BAuFA,SAAS,EACP,EACA,EACM,CACN,EAAY,KAAK,CAAE,SAAU,QAAS,GAAG,EAAY,CAAC,CAUxD,SAAS,EAAa,EAA2B,EAAsB,CAErE,OADc,EAAS,EAAmB,EAAK,CAAC,MAAM,EAAI,CAAC,KAAK,IACpD,EAAI,IASlB,SAAS,EAAkB,EAAwD,CACjF,IAAM,EACJ,GAEI,EAAM,OAAS,MAGZ,IAAgB,mBAAqB,eAAiB,gBAFpD,UAaX,OATI,EAAM,gBACD,CACL,CACE,QACA,KAAM,EAAM,gBACZ,KAAM,EAAQ,EAAM,qBAAqB,CAC1C,CACF,EAEK,EAAM,kBAAoB,EAAE,EAAE,IAAK,IAAU,CACn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.mjs";import{t as n}from"./done-input-validation-Cjk7a3jX.mjs";async function r({email:r,password:i,apiKeyTitle:a,file:o,scopes:s,deleteExistingApiKey:c,createNewApiKey:l,parentOrganizationId:u,transcendUrl:d}){n(this.process);let{errors:f,apiKeys:p}=await t({transcendUrl:d,password:i,email:r,parentOrganizationId:u,deleteExistingApiKey:c,createNewApiKey:l,apiKeyTitle:a,scopes:s.map(t=>e[t].name)});this.fs.writeFileSync(o,`${JSON.stringify(p,null,2)}\n`),f.length>0&&this.process.exit(1)}export{r as generateApiKeys};
2
- //# sourceMappingURL=impl-BqrSLoig.mjs.map
1
+ import{l as e}from"./constants-jjHIzHGm.mjs";import{t}from"./generateCrossAccountApiKeys-Bnqgmj-H.mjs";import{t as n}from"./done-input-validation-BUz-aVC5.mjs";async function r({email:r,password:i,apiKeyTitle:a,file:o,scopes:s,deleteExistingApiKey:c,createNewApiKey:l,parentOrganizationId:u,transcendUrl:d}){n(this.process);let{errors:f,apiKeys:p}=await t({transcendUrl:d,password:i,email:r,parentOrganizationId:u,deleteExistingApiKey:c,createNewApiKey:l,apiKeyTitle:a,scopes:s.map(t=>e[t].name)});this.fs.writeFileSync(o,`${JSON.stringify(p,null,2)}\n`),f.length>0&&this.process.exit(1)}export{r as generateApiKeys};
2
+ //# sourceMappingURL=impl-2iVTxNn4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-BqrSLoig.mjs","names":[],"sources":["../src/commands/admin/generate-api-keys/impl.ts"],"sourcesContent":["import { ScopeName } from '@transcend-io/privacy-types';\n\nimport { SCOPES_BY_TITLE } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { generateCrossAccountApiKeys } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\n\n// Command flag interface\nexport interface GenerateApiKeysCommandFlags {\n email: string;\n password: string;\n apiKeyTitle: string;\n file: string;\n scopes: string[];\n deleteExistingApiKey: boolean;\n createNewApiKey: boolean;\n parentOrganizationId?: string;\n transcendUrl: string;\n}\n\n// Command implementation\nexport async function generateApiKeys(\n this: LocalContext,\n {\n email,\n password,\n apiKeyTitle,\n file,\n scopes,\n deleteExistingApiKey,\n createNewApiKey,\n parentOrganizationId,\n transcendUrl,\n }: GenerateApiKeysCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n const scopeNames = scopes.map((scopeTitle) => SCOPES_BY_TITLE[scopeTitle].name as ScopeName);\n\n // Upload privacy requests\n const { errors, apiKeys } = await generateCrossAccountApiKeys({\n transcendUrl,\n password,\n email,\n parentOrganizationId,\n deleteExistingApiKey,\n createNewApiKey,\n apiKeyTitle,\n scopes: scopeNames,\n });\n\n // Write to disk\n this.fs.writeFileSync(file, `${JSON.stringify(apiKeys, null, 2)}\\n`);\n if (errors.length > 0) {\n this.process.exit(1);\n }\n}\n"],"mappings":"gKAqBA,eAAsB,EAEpB,CACE,QACA,WACA,cACA,OACA,SACA,uBACA,kBACA,uBACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,CAKjC,GAAM,CAAE,SAAQ,WAAY,MAAM,EAA4B,CAC5D,eACA,WACA,QACA,uBACA,uBACA,kBACA,cACA,OAXiB,EAAO,IAAK,GAAe,EAAgB,GAAY,KAWtD,CACnB,CAAC,CAGF,KAAK,GAAG,cAAc,EAAM,GAAG,KAAK,UAAU,EAAS,KAAM,EAAE,CAAC,IAAI,CAChE,EAAO,OAAS,GAClB,KAAK,QAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"impl-2iVTxNn4.mjs","names":[],"sources":["../src/commands/admin/generate-api-keys/impl.ts"],"sourcesContent":["import { ScopeName } from '@transcend-io/privacy-types';\n\nimport { SCOPES_BY_TITLE } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { generateCrossAccountApiKeys } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\n\n// Command flag interface\nexport interface GenerateApiKeysCommandFlags {\n email: string;\n password: string;\n apiKeyTitle: string;\n file: string;\n scopes: string[];\n deleteExistingApiKey: boolean;\n createNewApiKey: boolean;\n parentOrganizationId?: string;\n transcendUrl: string;\n}\n\n// Command implementation\nexport async function generateApiKeys(\n this: LocalContext,\n {\n email,\n password,\n apiKeyTitle,\n file,\n scopes,\n deleteExistingApiKey,\n createNewApiKey,\n parentOrganizationId,\n transcendUrl,\n }: GenerateApiKeysCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n const scopeNames = scopes.map((scopeTitle) => SCOPES_BY_TITLE[scopeTitle].name as ScopeName);\n\n // Upload privacy requests\n const { errors, apiKeys } = await generateCrossAccountApiKeys({\n transcendUrl,\n password,\n email,\n parentOrganizationId,\n deleteExistingApiKey,\n createNewApiKey,\n apiKeyTitle,\n scopes: scopeNames,\n });\n\n // Write to disk\n this.fs.writeFileSync(file, `${JSON.stringify(apiKeys, null, 2)}\\n`);\n if (errors.length > 0) {\n this.process.exit(1);\n }\n}\n"],"mappings":"gKAqBA,eAAsB,EAEpB,CACE,QACA,WACA,cACA,OACA,SACA,uBACA,kBACA,uBACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,CAKjC,GAAM,CAAE,SAAQ,WAAY,MAAM,EAA4B,CAC5D,eACA,WACA,QACA,uBACA,uBACA,kBACA,cACA,OAXiB,EAAO,IAAK,GAAe,EAAgB,GAAY,KAWtD,CACnB,CAAC,CAGF,KAAK,GAAG,cAAc,EAAM,GAAG,KAAK,UAAU,EAAS,KAAM,EAAE,CAAC,IAAI,CAChE,EAAO,OAAS,GAClB,KAAK,QAAQ,KAAK,EAAE"}
@@ -1,2 +1,2 @@
1
- import{n as e,r as t}from"./runOpa-CkKAwsvB.mjs";import{t as n}from"./done-input-validation-Cjk7a3jX.mjs";import r from"node:path";import i from"colors";async function a({dir:a}){n(this.process),t();let o=r.resolve(a);this.logger.info(i.green(`Running policy tests in ${o}...`));let s=await e([`test`,o]);s!==0&&this.process.exit(s),this.logger.info(i.green(`Policy tests passed.`))}export{a as test};
2
- //# sourceMappingURL=impl-Drql0g72.mjs.map
1
+ import{n as e,r as t}from"./runOpa-CswzJxIs.mjs";import{t as n}from"./done-input-validation-BUz-aVC5.mjs";import r from"node:path";import i from"colors";async function a({dir:a}){n(this.process),t();let o=r.resolve(a);this.logger.info(i.green(`Running policy tests in ${o}...`));let s=await e([`test`,o]);s!==0&&this.process.exit(s),this.logger.info(i.green(`Policy tests passed.`))}export{a as test};
2
+ //# sourceMappingURL=impl-7UqkSO3x2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-7UqkSO3x2.mjs","names":[],"sources":["../src/commands/policy/test/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { assertOpaInstalled, runOpa } from '../helpers/index.js';\n\n/** CLI flags for `transcend policy test`. */\nexport interface TestCommandFlags {\n /** Directory containing Rego policy files and tests */\n dir: string;\n}\n\n/**\n * Run OPA tests against a local policy bundle.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function test(this: LocalContext, { dir }: TestCommandFlags): Promise<void> {\n doneInputValidation(this.process);\n\n assertOpaInstalled();\n const resolvedDir = path.resolve(dir);\n\n this.logger.info(colors.green(`Running policy tests in ${resolvedDir}...`));\n\n const exitCode = await runOpa(['test', resolvedDir]);\n if (exitCode !== 0) {\n this.process.exit(exitCode);\n }\n\n this.logger.info(colors.green('Policy tests passed.'));\n}\n"],"mappings":"yJAoBA,eAAsB,EAAyB,CAAE,OAAwC,CACvF,EAAoB,KAAK,QAAQ,CAEjC,GAAoB,CACpB,IAAM,EAAc,EAAK,QAAQ,EAAI,CAErC,KAAK,OAAO,KAAK,EAAO,MAAM,2BAA2B,EAAY,KAAK,CAAC,CAE3E,IAAM,EAAW,MAAM,EAAO,CAAC,OAAQ,EAAY,CAAC,CAChD,IAAa,GACf,KAAK,QAAQ,KAAK,EAAS,CAG7B,KAAK,OAAO,KAAK,EAAO,MAAM,uBAAuB,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./pushCronIdentifiersFromCsv-DjeY7TtK.mjs";import{t}from"./done-input-validation-Cjk7a3jX.mjs";async function n({file:n,transcendUrl:r,auth:i,sombraAuth:a,dataSiloId:o}){t(this.process),await e({file:n,transcendUrl:r,auth:i,sombraAuth:a,dataSiloId:o})}export{n as markIdentifiersCompleted};
2
- //# sourceMappingURL=impl-C50tdWlL2.mjs.map
1
+ import{t as e}from"./pushCronIdentifiersFromCsv-5ruUKHtL.mjs";import{t}from"./done-input-validation-BUz-aVC5.mjs";async function n({file:n,transcendUrl:r,auth:i,sombraAuth:a,dataSiloId:o}){t(this.process),await e({file:n,transcendUrl:r,auth:i,sombraAuth:a,dataSiloId:o})}export{n as markIdentifiersCompleted};
2
+ //# sourceMappingURL=impl-B-j5ACi02.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-C50tdWlL2.mjs","names":[],"sources":["../src/commands/request/cron/mark-identifiers-completed/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { pushCronIdentifiersFromCsv } from '../../../../lib/cron/index.js';\n\nexport interface MarkIdentifiersCompletedCommandFlags {\n file: string;\n transcendUrl: string;\n auth: string;\n sombraAuth?: string;\n dataSiloId: string;\n}\n\nexport async function markIdentifiersCompleted(\n this: LocalContext,\n { file, transcendUrl, auth, sombraAuth, dataSiloId }: MarkIdentifiersCompletedCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await pushCronIdentifiersFromCsv({\n file,\n transcendUrl,\n auth,\n sombraAuth,\n dataSiloId,\n });\n}\n"],"mappings":"kHAYA,eAAsB,EAEpB,CAAE,OAAM,eAAc,OAAM,aAAY,cACzB,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAA2B,CAC/B,OACA,eACA,OACA,aACA,aACD,CAAC"}
1
+ {"version":3,"file":"impl-B-j5ACi02.mjs","names":[],"sources":["../src/commands/request/cron/mark-identifiers-completed/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { pushCronIdentifiersFromCsv } from '../../../../lib/cron/index.js';\n\nexport interface MarkIdentifiersCompletedCommandFlags {\n file: string;\n transcendUrl: string;\n auth: string;\n sombraAuth?: string;\n dataSiloId: string;\n}\n\nexport async function markIdentifiersCompleted(\n this: LocalContext,\n { file, transcendUrl, auth, sombraAuth, dataSiloId }: MarkIdentifiersCompletedCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await pushCronIdentifiersFromCsv({\n file,\n transcendUrl,\n auth,\n sombraAuth,\n dataSiloId,\n });\n}\n"],"mappings":"kHAYA,eAAsB,EAEpB,CAAE,OAAM,eAAc,OAAM,aAAY,cACzB,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAA2B,CAC/B,OACA,eACA,OACA,aACA,aACD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import{c as e,i as t,l as n,o as r,s as i}from"./policy-runtime-BMKa-Upy.mjs";import{t as a}from"./policy-bundle-manifest-D6dkbjNi.mjs";import{n as o}from"./inquirer-BeaBetMO.mjs";import{t as s}from"./done-input-validation-BUz-aVC5.mjs";import{t as c}from"./run-captured-process-BXwWXuTh.mjs";import l from"node:path";import u from"colors";const d=[`manifest`,`opa-version`,`regal-version`,`format`,`opa-check`,`regal-lint`,`opa-test`],f={manifest:`Manifest and package roots`,"opa-version":`OPA 1.x`,"regal-version":`Regal`,format:`OPA formatting`,"opa-check":`OPA strict check`,"regal-lint":`Regal lint`,"opa-test":`OPA tests`};function p(e,t){return[e.stdout.trim(),e.stderr.trim()].filter(Boolean).join(`
2
+ `)||t}function m(e,t){return[...new Set(e.split(/\r?\n/gu).map(e=>e.trim()).filter(Boolean).map(e=>l.isAbsolute(e)?l.relative(t,e).split(l.sep).join(`/`):e.split(l.sep).join(`/`)))].sort()}function h(e,t,n=t){return e.fs.readdirSync(n,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name)).flatMap(r=>{let i=l.join(n,r.name);return r.isDirectory()?h(e,t,i):!r.isFile()||!r.name.endsWith(`.rego`)?[]:[{path:l.relative(t,i).split(l.sep).join(`/`),contents:e.fs.readFileSync(i,`utf8`)}]})}function g(e,t){e.logger.info(`${u.bold(`Policy verification`)}\n`),t.checks.forEach(({name:n,status:r})=>{let i=r===`passed`?`PASS`:r===`failed`?`FAIL`:`SKIP`,a=r===`passed`?u.green(i):r===`failed`?u.red(i):u.yellow(i),o=n===`opa-version`&&t.tools.opa?` (${t.tools.opa})`:n===`regal-version`&&t.tools.regal?` (${t.tools.regal})`:``;e.logger.info(`${a} ${f[n]}${o}`)}),t.diagnostics.length>0&&e.logger.error(``),t.diagnostics.forEach(t=>{let n=t.path?`${t.path}: `:``;e.logger.error(u.red(`error [${t.code}]: ${n}${t.message}`))}),t.status===`passed`?(e.logger.info(``),e.logger.info(u.green(`Policy verification passed.`))):(e.logger.error(``),e.logger.error(u.red(`Policy verification failed.`)))}async function _({dir:f=`transcend/policy`,fix:_=!1,noInteractive:v=!1,json:y=!1},b=c){s(this.process);let x=l.resolve(this.process.cwd(),f),S=d.map(e=>({name:e,status:`skipped`})),C=[],w={version:1,status:`passed`,directory:x,fix:_,tools:{opa:null,regal:null},checks:S,unformattedFiles:[],fixedFiles:[],diagnostics:C},T=(e,t)=>{S.find(t=>t.name===e).status=t},E=(e,t,n)=>{C.push({code:e,severity:`error`,message:t,...n?{path:n}:{}})};if(!this.fs.existsSync(x)||!this.fs.statSync(x).isDirectory())T(`manifest`,`failed`),E(`project.directory`,`Policy directory does not exist or is not a directory: ${x}`,l.relative(this.process.cwd(),x));else{let s=l.join(x,`manifest.json`);try{a(this.fs.existsSync(s)?this.fs.readFileSync(s,`utf8`):void 0,h(this,x)),T(`manifest`,`passed`)}catch(e){T(`manifest`,`failed`),E(`manifest.invalid`,e instanceof Error?e.message:String(e),l.relative(this.process.cwd(),s))}let c=await b(`opa`,[`version`],{cwd:x},this);if(c.error?.code===`ENOENT`)T(`opa-version`,`failed`),E(`opa.missing`,t);else{let t=`${c.stdout}\n${c.stderr}`,n=e(t);c.code!==0||n?(T(`opa-version`,`failed`),E(`opa.version`,n??p(c,`Unable to determine the installed OPA version.`))):(w.tools.opa=i(t).version,T(`opa-version`,`passed`))}let d=await b(`regal`,[`version`],{cwd:x},this);if(d.error?.code===`ENOENT`)T(`regal-version`,`failed`),E(`regal.missing`,r);else{let e=`${d.stdout}\n${d.stderr}`,t=n(e);d.code!==0||t?(T(`regal-version`,`failed`),E(`regal.version`,t??p(d,`Unable to determine the installed Regal version.`))):(w.tools.regal=i(e).version,T(`regal-version`,`passed`))}if(w.tools.opa){let e=await b(`opa`,[`fmt`,`--list`,x],{cwd:x},this);if(e.code!==0)T(`format`,`failed`),E(`opa.format`,p(e,`opa fmt --list failed with exit code ${e.code}`));else if(w.unformattedFiles=m(e.stdout,x),w.unformattedFiles.length===0)T(`format`,`passed`);else{let e=_,t=!y&&!v&&!!this.process.stdin.isTTY;if(!y&&!_){this.logger.error(u.red(`Policy files are not formatted:`)),w.unformattedFiles.forEach(e=>{this.logger.error(u.red(` - ${e}`))});let e=await b(`opa`,[`fmt`,`--diff`,x],{cwd:x},this),t=e.stdout.trim()||e.stderr.trim();t&&(this.logger.error(``),this.logger.error(t))}if(!_&&t)try{e=await o({message:`Format the unformatted policy files listed above?`})}catch(e){let t=e instanceof Error?e.message:String(e);throw/force closed|prompt.*cancel|user.*close|SIGINT/iu.test(t)&&this.process.exit(130),e}if(e){let e=await b(`opa`,[`fmt`,`--write`,x],{cwd:x},this);e.code===0?(w.fixedFiles=[...w.unformattedFiles],T(`format`,`passed`)):(T(`format`,`failed`),E(`opa.format-fix`,p(e,`opa fmt --write failed with exit code ${e.code}`)))}else T(`format`,`failed`),E(`opa.format-required`,"Policy files are not formatted. Re-run `transcend policy lint --fix` to repair them.")}let t=await b(`opa`,[`check`,`--strict`,`--v0-compatible`,`--ignore`,`*_test.rego`,x],{cwd:x},this);t.code===0?T(`opa-check`,`passed`):(T(`opa-check`,`failed`),E(`opa.check`,p(t,`opa check failed with exit code ${t.code}`)))}if(w.tools.regal){let e=l.join(x,`.regal`,`config.yaml`),t=l.join(x,`.regal.yaml`),n=this.fs.existsSync(e)?e:this.fs.existsSync(t)?t:void 0,r=await b(`regal`,[`lint`,`--fail-level`,`warning`,...n?[`--config-file`,n]:[],x],{cwd:x},this);r.code===0?T(`regal-lint`,`passed`):(T(`regal-lint`,`failed`),E(`regal.lint`,p(r,`regal lint failed with exit code ${r.code}`)))}if(w.tools.opa){let e=await b(`opa`,[`test`,`--fail-on-empty`,x],{cwd:x},this);e.code===0?T(`opa-test`,`passed`):(T(`opa-test`,`failed`),E(`opa.test`,p(e,`opa test --fail-on-empty failed with exit code ${e.code}`)))}}w.status=S.some(({status:e})=>e===`failed`)?`failed`:`passed`,y?this.process.stdout.write(`${JSON.stringify(w)}\n`):g(this,w),w.status===`failed`&&(this.process.exitCode=1)}export{_ as lint};
3
+ //# sourceMappingURL=impl-B4BgGuF_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-B4BgGuF_.mjs","names":[],"sources":["../src/lib/policy/policy-lint-model.ts","../src/lib/policy/policy-lint-output.ts","../src/commands/policy/lint/impl.ts"],"sourcesContent":["/** Stable policy lint result schema version. */\nexport const POLICY_LINT_RESULT_VERSION = 1;\n\n/** Status of the full gate or an individual verification. */\nexport type PolicyLintStatus = 'passed' | 'failed' | 'skipped';\n\n/** One named policy verification. */\nexport interface PolicyLintCheck {\n /** Stable verification name. */\n name:\n | 'manifest'\n | 'opa-version'\n | 'regal-version'\n | 'format'\n | 'opa-check'\n | 'regal-lint'\n | 'opa-test';\n /** Verification outcome. */\n status: PolicyLintStatus;\n}\n\n/** Stable verification execution order. */\nexport const POLICY_LINT_CHECK_NAMES: PolicyLintCheck['name'][] = [\n 'manifest',\n 'opa-version',\n 'regal-version',\n 'format',\n 'opa-check',\n 'regal-lint',\n 'opa-test',\n];\n\n/** User-facing verification labels. */\nexport const POLICY_LINT_CHECK_LABELS: Readonly<Record<PolicyLintCheck['name'], string>> = {\n manifest: 'Manifest and package roots',\n 'opa-version': 'OPA 1.x',\n 'regal-version': 'Regal',\n format: 'OPA formatting',\n 'opa-check': 'OPA strict check',\n 'regal-lint': 'Regal lint',\n 'opa-test': 'OPA tests',\n};\n\n/** One machine-readable policy lint diagnostic. */\nexport interface PolicyLintDiagnostic {\n /** Stable diagnostic identifier. */\n code: string;\n /** Diagnostic severity. */\n severity: 'error';\n /** Human-readable detail, including captured tool output when available. */\n message: string;\n /** Optional path relative to the invocation directory. */\n path?: string;\n}\n\n/** Detected local policy tool versions. */\nexport interface PolicyLintTools {\n /** Detected OPA version, or null when missing or unsupported. */\n opa: string | null;\n /** Detected Regal version, or null when missing or unsupported. */\n regal: string | null;\n}\n\n/** Stable result emitted by `transcend policy lint --json`. */\nexport interface PolicyLintResult {\n /** Result schema version. */\n version: typeof POLICY_LINT_RESULT_VERSION;\n /** Overall verification outcome. */\n status: Exclude<PolicyLintStatus, 'skipped'>;\n /** Absolute policy project directory. */\n directory: string;\n /** Whether formatting repair was explicitly requested. */\n fix: boolean;\n /** Detected supported tool versions. */\n tools: PolicyLintTools;\n /** Verification outcomes in stable execution order. */\n checks: PolicyLintCheck[];\n /** Files found to need OPA formatting, relative to the policy directory. */\n unformattedFiles: string[];\n /** Files repaired with OPA formatting, relative to the policy directory. */\n fixedFiles: string[];\n /** Ordered verification diagnostics. */\n diagnostics: PolicyLintDiagnostic[];\n}\n","import path from 'node:path';\n\nimport type { CapturedProcessResult } from '../cli/run-captured-process.js';\n\n/**\n * Use captured tool output as a concise diagnostic.\n *\n * @param result - Captured process result\n * @param fallback - Message used when the tool emitted no output\n * @returns Diagnostic message\n */\nexport function getPolicyProcessFailureMessage(\n result: CapturedProcessResult,\n fallback: string,\n): string {\n const output = [result.stdout.trim(), result.stderr.trim()].filter(Boolean).join('\\n');\n return output || fallback;\n}\n\n/**\n * Convert absolute OPA formatter paths to stable project-relative paths.\n *\n * @param stdout - `opa fmt --list` output\n * @param projectDirectory - Absolute policy directory\n * @returns Sorted unique paths\n */\nexport function parseUnformattedPolicyFiles(stdout: string, projectDirectory: string): string[] {\n return [\n ...new Set(\n stdout\n .split(/\\r?\\n/gu)\n .map((file) => file.trim())\n .filter(Boolean)\n .map((file) =>\n path.isAbsolute(file)\n ? path.relative(projectDirectory, file).split(path.sep).join('/')\n : file.split(path.sep).join('/'),\n ),\n ),\n ].sort();\n}\n","import path from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport {\n runCapturedProcess,\n type CapturedProcessRunner,\n} from '../../../lib/cli/run-captured-process.js';\nimport { inquirerConfirmBoolean } from '../../../lib/helpers/inquirer.js';\nimport {\n type PolicyBundleRegoFile,\n validatePolicyBundleContents,\n} from '../../../lib/policy/policy-bundle-manifest.js';\nimport {\n type PolicyLintCheck,\n type PolicyLintDiagnostic,\n type PolicyLintResult,\n POLICY_LINT_CHECK_LABELS,\n POLICY_LINT_CHECK_NAMES,\n POLICY_LINT_RESULT_VERSION,\n} from '../../../lib/policy/policy-lint-model.js';\nimport {\n getPolicyProcessFailureMessage,\n parseUnformattedPolicyFiles,\n} from '../../../lib/policy/policy-lint-output.js';\nimport {\n OPA_MISSING_MESSAGE,\n parsePolicyToolVersion,\n REGAL_MISSING_MESSAGE,\n unsupportedOpaVersionMessage,\n unsupportedRegalVersionMessage,\n} from '../../../lib/policy/policy-runtime.js';\n\n/** CLI flags for `transcend policy lint`. */\nexport interface LintCommandFlags {\n /** Directory containing manifest.json, Rego policy files, and tests. */\n dir: string;\n /** Apply OPA formatting. */\n fix: boolean;\n /** Disable the optional formatting confirmation. */\n noInteractive: boolean;\n /** Emit one stable JSON result on stdout. */\n json: boolean;\n}\n\n/**\n * Collect Rego source snapshots without following symlinks.\n *\n * @param context - CLI context\n * @param projectDirectory - Absolute policy directory\n * @param currentDirectory - Current recursive directory\n * @returns Deterministically ordered Rego snapshots\n */\nfunction collectRegoFiles(\n context: LocalContext,\n projectDirectory: string,\n currentDirectory: string = projectDirectory,\n): PolicyBundleRegoFile[] {\n return context.fs\n .readdirSync(currentDirectory, { withFileTypes: true })\n .sort((left, right) => left.name.localeCompare(right.name))\n .flatMap((entry) => {\n const absolutePath = path.join(currentDirectory, entry.name);\n if (entry.isDirectory()) {\n return collectRegoFiles(context, projectDirectory, absolutePath);\n }\n if (!entry.isFile() || !entry.name.endsWith('.rego')) {\n return [];\n }\n return [\n {\n path: path.relative(projectDirectory, absolutePath).split(path.sep).join('/'),\n contents: context.fs.readFileSync(absolutePath, 'utf8'),\n },\n ];\n });\n}\n\n/**\n * Render the terminal summary for a policy verification result.\n *\n * @param context - CLI context\n * @param result - Completed verification result\n */\nfunction renderResult(context: LocalContext, result: PolicyLintResult): void {\n context.logger.info(`${colors.bold('Policy verification')}\\n`);\n result.checks.forEach(({ name, status }) => {\n const label = status === 'passed' ? 'PASS' : status === 'failed' ? 'FAIL' : 'SKIP';\n const styledLabel =\n status === 'passed'\n ? colors.green(label)\n : status === 'failed'\n ? colors.red(label)\n : colors.yellow(label);\n const version =\n name === 'opa-version' && result.tools.opa\n ? ` (${result.tools.opa})`\n : name === 'regal-version' && result.tools.regal\n ? ` (${result.tools.regal})`\n : '';\n context.logger.info(`${styledLabel} ${POLICY_LINT_CHECK_LABELS[name]}${version}`);\n });\n if (result.diagnostics.length > 0) {\n context.logger.error('');\n }\n result.diagnostics.forEach((diagnostic) => {\n const location = diagnostic.path ? `${diagnostic.path}: ` : '';\n context.logger.error(\n colors.red(`error [${diagnostic.code}]: ${location}${diagnostic.message}`),\n );\n });\n if (result.status === 'passed') {\n context.logger.info('');\n context.logger.info(colors.green('Policy verification passed.'));\n } else {\n context.logger.error('');\n context.logger.error(colors.red('Policy verification failed.'));\n }\n}\n\n/**\n * Verify a local policy project with the shared upload contract, OPA, and Regal.\n *\n * @param this - CLI context\n * @param flags - Command flags\n * @param runner - Captured subprocess runner\n */\nexport async function lint(\n this: LocalContext,\n { dir = 'transcend/policy', fix = false, noInteractive = false, json = false }: LintCommandFlags,\n runner: CapturedProcessRunner = runCapturedProcess,\n): Promise<void> {\n doneInputValidation(this.process);\n\n const resolvedDir = path.resolve(this.process.cwd(), dir);\n const checks: PolicyLintCheck[] = POLICY_LINT_CHECK_NAMES.map((name) => ({\n name,\n status: 'skipped',\n }));\n const diagnostics: PolicyLintDiagnostic[] = [];\n const result: PolicyLintResult = {\n version: POLICY_LINT_RESULT_VERSION,\n status: 'passed',\n directory: resolvedDir,\n fix,\n tools: { opa: null, regal: null },\n checks,\n unformattedFiles: [],\n fixedFiles: [],\n diagnostics,\n };\n const setStatus = (name: PolicyLintCheck['name'], status: PolicyLintCheck['status']): void => {\n checks.find((check) => check.name === name)!.status = status;\n };\n const addError = (code: string, message: string, diagnosticPath?: string): void => {\n diagnostics.push({\n code,\n severity: 'error',\n message,\n ...(diagnosticPath ? { path: diagnosticPath } : {}),\n });\n };\n\n if (!this.fs.existsSync(resolvedDir) || !this.fs.statSync(resolvedDir).isDirectory()) {\n setStatus('manifest', 'failed');\n addError(\n 'project.directory',\n `Policy directory does not exist or is not a directory: ${resolvedDir}`,\n path.relative(this.process.cwd(), resolvedDir),\n );\n } else {\n const manifestPath = path.join(resolvedDir, 'manifest.json');\n try {\n validatePolicyBundleContents(\n this.fs.existsSync(manifestPath) ? this.fs.readFileSync(manifestPath, 'utf8') : undefined,\n collectRegoFiles(this, resolvedDir),\n );\n setStatus('manifest', 'passed');\n } catch (error) {\n setStatus('manifest', 'failed');\n addError(\n 'manifest.invalid',\n error instanceof Error ? error.message : String(error),\n path.relative(this.process.cwd(), manifestPath),\n );\n }\n\n const opaVersionResult = await runner('opa', ['version'], { cwd: resolvedDir }, this);\n if (opaVersionResult.error?.code === 'ENOENT') {\n setStatus('opa-version', 'failed');\n addError('opa.missing', OPA_MISSING_MESSAGE);\n } else {\n const opaVersionOutput = `${opaVersionResult.stdout}\\n${opaVersionResult.stderr}`;\n const unsupportedOpa = unsupportedOpaVersionMessage(opaVersionOutput);\n if (opaVersionResult.code !== 0 || unsupportedOpa) {\n setStatus('opa-version', 'failed');\n addError(\n 'opa.version',\n unsupportedOpa ??\n getPolicyProcessFailureMessage(\n opaVersionResult,\n 'Unable to determine the installed OPA version.',\n ),\n );\n } else {\n result.tools.opa = parsePolicyToolVersion(opaVersionOutput)!.version;\n setStatus('opa-version', 'passed');\n }\n }\n\n const regalVersionResult = await runner('regal', ['version'], { cwd: resolvedDir }, this);\n if (regalVersionResult.error?.code === 'ENOENT') {\n setStatus('regal-version', 'failed');\n addError('regal.missing', REGAL_MISSING_MESSAGE);\n } else {\n const regalVersionOutput = `${regalVersionResult.stdout}\\n${regalVersionResult.stderr}`;\n const unsupportedRegal = unsupportedRegalVersionMessage(regalVersionOutput);\n if (regalVersionResult.code !== 0 || unsupportedRegal) {\n setStatus('regal-version', 'failed');\n addError(\n 'regal.version',\n unsupportedRegal ??\n getPolicyProcessFailureMessage(\n regalVersionResult,\n 'Unable to determine the installed Regal version.',\n ),\n );\n } else {\n result.tools.regal = parsePolicyToolVersion(regalVersionOutput)!.version;\n setStatus('regal-version', 'passed');\n }\n }\n\n if (result.tools.opa) {\n const formatResult = await runner(\n 'opa',\n ['fmt', '--list', resolvedDir],\n { cwd: resolvedDir },\n this,\n );\n if (formatResult.code !== 0) {\n setStatus('format', 'failed');\n addError(\n 'opa.format',\n getPolicyProcessFailureMessage(\n formatResult,\n `opa fmt --list failed with exit code ${formatResult.code}`,\n ),\n );\n } else {\n result.unformattedFiles = parseUnformattedPolicyFiles(formatResult.stdout, resolvedDir);\n if (result.unformattedFiles.length === 0) {\n setStatus('format', 'passed');\n } else {\n let shouldFormat = fix;\n const interactive = !json && !noInteractive && Boolean(this.process.stdin.isTTY);\n if (!json && !fix) {\n this.logger.error(colors.red('Policy files are not formatted:'));\n result.unformattedFiles.forEach((file) => {\n this.logger.error(colors.red(` - ${file}`));\n });\n const diffResult = await runner(\n 'opa',\n ['fmt', '--diff', resolvedDir],\n { cwd: resolvedDir },\n this,\n );\n const diff = diffResult.stdout.trim() || diffResult.stderr.trim();\n if (diff) {\n this.logger.error('');\n this.logger.error(diff);\n }\n }\n if (!fix && interactive) {\n try {\n shouldFormat = await inquirerConfirmBoolean({\n message: 'Format the unformatted policy files listed above?',\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (/force closed|prompt.*cancel|user.*close|SIGINT/iu.test(message)) {\n this.process.exit(130);\n }\n throw error;\n }\n }\n if (shouldFormat) {\n const writeResult = await runner(\n 'opa',\n ['fmt', '--write', resolvedDir],\n { cwd: resolvedDir },\n this,\n );\n if (writeResult.code === 0) {\n result.fixedFiles = [...result.unformattedFiles];\n setStatus('format', 'passed');\n } else {\n setStatus('format', 'failed');\n addError(\n 'opa.format-fix',\n getPolicyProcessFailureMessage(\n writeResult,\n `opa fmt --write failed with exit code ${writeResult.code}`,\n ),\n );\n }\n } else {\n setStatus('format', 'failed');\n addError(\n 'opa.format-required',\n 'Policy files are not formatted. Re-run `transcend policy lint --fix` to repair them.',\n );\n }\n }\n }\n\n const checkResult = await runner(\n 'opa',\n ['check', '--strict', '--v0-compatible', '--ignore', '*_test.rego', resolvedDir],\n { cwd: resolvedDir },\n this,\n );\n if (checkResult.code === 0) {\n setStatus('opa-check', 'passed');\n } else {\n setStatus('opa-check', 'failed');\n addError(\n 'opa.check',\n getPolicyProcessFailureMessage(\n checkResult,\n `opa check failed with exit code ${checkResult.code}`,\n ),\n );\n }\n }\n\n if (result.tools.regal) {\n const nestedRegalConfig = path.join(resolvedDir, '.regal', 'config.yaml');\n const rootRegalConfig = path.join(resolvedDir, '.regal.yaml');\n const regalConfig = this.fs.existsSync(nestedRegalConfig)\n ? nestedRegalConfig\n : this.fs.existsSync(rootRegalConfig)\n ? rootRegalConfig\n : undefined;\n const regalResult = await runner(\n 'regal',\n [\n 'lint',\n '--fail-level',\n 'warning',\n ...(regalConfig ? ['--config-file', regalConfig] : []),\n resolvedDir,\n ],\n { cwd: resolvedDir },\n this,\n );\n if (regalResult.code === 0) {\n setStatus('regal-lint', 'passed');\n } else {\n setStatus('regal-lint', 'failed');\n addError(\n 'regal.lint',\n getPolicyProcessFailureMessage(\n regalResult,\n `regal lint failed with exit code ${regalResult.code}`,\n ),\n );\n }\n }\n\n if (result.tools.opa) {\n const testResult = await runner(\n 'opa',\n ['test', '--fail-on-empty', resolvedDir],\n { cwd: resolvedDir },\n this,\n );\n if (testResult.code === 0) {\n setStatus('opa-test', 'passed');\n } else {\n setStatus('opa-test', 'failed');\n addError(\n 'opa.test',\n getPolicyProcessFailureMessage(\n testResult,\n `opa test --fail-on-empty failed with exit code ${testResult.code}`,\n ),\n );\n }\n }\n }\n\n result.status = checks.some(({ status }) => status === 'failed') ? 'failed' : 'passed';\n if (json) {\n this.process.stdout.write(`${JSON.stringify(result)}\\n`);\n } else {\n renderResult(this, result);\n }\n if (result.status === 'failed') {\n this.process.exitCode = 1;\n }\n}\n"],"mappings":"oVAsBA,MAAa,EAAqD,CAChE,WACA,cACA,gBACA,SACA,YACA,aACA,WACD,CAGY,EAA8E,CACzF,SAAU,6BACV,cAAe,UACf,gBAAiB,QACjB,OAAQ,iBACR,YAAa,mBACb,aAAc,aACd,WAAY,YACb,CC9BD,SAAgB,EACd,EACA,EACQ,CAER,MADe,CAAC,EAAO,OAAO,MAAM,CAAE,EAAO,OAAO,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAC,KAAK;EACpE,EAAI,EAUnB,SAAgB,EAA4B,EAAgB,EAAoC,CAC9F,MAAO,CACL,GAAG,IAAI,IACL,EACG,MAAM,UAAU,CAChB,IAAK,GAAS,EAAK,MAAM,CAAC,CAC1B,OAAO,QAAQ,CACf,IAAK,GACJ,EAAK,WAAW,EAAK,CACjB,EAAK,SAAS,EAAkB,EA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,EACxB,MACA,CAAC,QAAS,WAAY,kBAAmB,WAAY,cAAe,EAAY,CAChF,CAAE,IAAK,EAAa,CACpB,KACD,CACG,EAAY,OAAS,EACvB,EAAU,YAAa,SAAS,EAEhC,EAAU,YAAa,SAAS,CAChC,EACE,YACA,EACE,EACA,mCAAmC,EAAY,OAChD,CACF,EAIL,GAAI,EAAO,MAAM,MAAO,CACtB,IAAM,EAAoB,EAAK,KAAK,EAAa,SAAU,cAAc,CACnE,EAAkB,EAAK,KAAK,EAAa,cAAc,CACvD,EAAc,KAAK,GAAG,WAAW,EAAkB,CACrD,EACA,KAAK,GAAG,WAAW,EAAgB,CACjC,EACA,IAAA,GACA,EAAc,MAAM,EACxB,QACA,CACE,OACA,eACA,UACA,GAAI,EAAc,CAAC,gBAAiB,EAAY,CAAG,EAAE,CACrD,EACD,CACD,CAAE,IAAK,EAAa,CACpB,KACD,CACG,EAAY,OAAS,EACvB,EAAU,aAAc,SAAS,EAEjC,EAAU,aAAc,SAAS,CACjC,EACE,aACA,EACE,EACA,oCAAoC,EAAY,OACjD,CACF,EAIL,GAAI,EAAO,MAAM,IAAK,CACpB,IAAM,EAAa,MAAM,EACvB,MACA,CAAC,OAAQ,kBAAmB,EAAY,CACxC,CAAE,IAAK,EAAa,CACpB,KACD,CACG,EAAW,OAAS,EACtB,EAAU,WAAY,SAAS,EAE/B,EAAU,WAAY,SAAS,CAC/B,EACE,WACA,EACE,EACA,kDAAkD,EAAW,OAC9D,CACF,GAKP,EAAO,OAAS,EAAO,MAAM,CAAE,YAAa,IAAW,SAAS,CAAG,SAAW,SAC1E,EACF,KAAK,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,EAAO,CAAC,IAAI,CAExD,EAAa,KAAM,EAAO,CAExB,EAAO,SAAW,WACpB,KAAK,QAAQ,SAAW"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./pullChunkedCustomSiloOutstandingIdentifiers-BrDmPbvc.mjs";import{i as t,s as n}from"./writeCsv-D46aDkGf.mjs";import{t as r}from"./done-input-validation-Cjk7a3jX.mjs";import{uniq as i}from"lodash-es";import a from"colors";async function o({file:o,transcendUrl:s,auth:c,sombraAuth:l,dataSiloId:u,actions:d,pageLimit:f,skipRequestCount:p,chunkSize:m}){p&&this.logger.info(a.yellow(`Skipping request count as requested. This may help speed up the call.`)),(Number.isNaN(m)||m<=0||m%f!==0)&&(this.logger.error(a.red(`Invalid chunk size: "${m}". Must be a positive integer that is a multiple of ${f}.`)),this.process.exit(1)),r(this.process);let{baseName:h,extension:g}=t(o),_=0;await e({transcendUrl:s,apiPageSize:f,savePageSize:m,onSave:async e=>{let t=`${h}-${_}${g}`;return this.logger.info(a.blue(`Saving ${e.length} identifiers to file "${t}"`)),await n(t,e,i(e.map(e=>Object.keys(e)).flat())),this.logger.info(a.green(`Successfully wrote ${e.length} identifiers to file "${t}"`)),_+=1,Promise.resolve()},actions:d,auth:c,sombraAuth:l,dataSiloId:u,skipRequestCount:p})}export{o as pullIdentifiers};
2
- //# sourceMappingURL=impl-zZFaSmxd2.mjs.map
1
+ import{t as e}from"./pullChunkedCustomSiloOutstandingIdentifiers-D85P1W_8.mjs";import{i as t,s as n}from"./writeCsv-D-2siSwE.mjs";import{t as r}from"./done-input-validation-BUz-aVC5.mjs";import{uniq as i}from"lodash-es";import a from"colors";async function o({file:o,transcendUrl:s,auth:c,sombraAuth:l,dataSiloId:u,actions:d,pageLimit:f,skipRequestCount:p,chunkSize:m}){p&&this.logger.info(a.yellow(`Skipping request count as requested. This may help speed up the call.`)),(Number.isNaN(m)||m<=0||m%f!==0)&&(this.logger.error(a.red(`Invalid chunk size: "${m}". Must be a positive integer that is a multiple of ${f}.`)),this.process.exit(1)),r(this.process);let{baseName:h,extension:g}=t(o),_=0;await e({transcendUrl:s,apiPageSize:f,savePageSize:m,onSave:async e=>{let t=`${h}-${_}${g}`;return this.logger.info(a.blue(`Saving ${e.length} identifiers to file "${t}"`)),await n(t,e,i(e.map(e=>Object.keys(e)).flat())),this.logger.info(a.green(`Successfully wrote ${e.length} identifiers to file "${t}"`)),_+=1,Promise.resolve()},actions:d,auth:c,sombraAuth:l,dataSiloId:u,skipRequestCount:p})}export{o as pullIdentifiers};
2
+ //# sourceMappingURL=impl-BDrvzlpf2.mjs.map