@transcend-io/cli 12.1.5 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/README.md +64 -14
  2. package/dist/{app-BMLQABJX.mjs → app-Bms-wwFP.mjs} +19 -19
  3. package/dist/app-Bms-wwFP.mjs.map +1 -0
  4. package/dist/{approvePrivacyRequests-CY6rQT4J.mjs → approvePrivacyRequests-DyLb38gV.mjs} +2 -2
  5. package/dist/{approvePrivacyRequests-CY6rQT4J.mjs.map → approvePrivacyRequests-DyLb38gV.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-BNGtj-DW.mjs → buildExamples-Ck7gzWSG.mjs} +2 -2
  10. package/dist/{buildExamples-BNGtj-DW.mjs.map → buildExamples-Ck7gzWSG.mjs.map} +1 -1
  11. package/dist/{buildXdiSyncEndpoint-BNCfOc-g.mjs → buildXdiSyncEndpoint-etqb_c38.mjs} +2 -2
  12. package/dist/{buildXdiSyncEndpoint-BNCfOc-g.mjs.map → buildXdiSyncEndpoint-etqb_c38.mjs.map} +1 -1
  13. package/dist/{bulkRestartRequests-CGvODu3r.mjs → bulkRestartRequests-DWJ8N0fa.mjs} +2 -2
  14. package/dist/{bulkRestartRequests-CGvODu3r.mjs.map → bulkRestartRequests-DWJ8N0fa.mjs.map} +1 -1
  15. package/dist/{bulkRetryEnrichers-BgDd4GWH.mjs → bulkRetryEnrichers-J8CHMy_1.mjs} +2 -2
  16. package/dist/{bulkRetryEnrichers-BgDd4GWH.mjs.map → bulkRetryEnrichers-J8CHMy_1.mjs.map} +1 -1
  17. package/dist/{cancelPrivacyRequests-Ccsiwrnu.mjs → cancelPrivacyRequests-C9nFdfgW.mjs} +2 -2
  18. package/dist/{cancelPrivacyRequests-Ccsiwrnu.mjs.map → cancelPrivacyRequests-C9nFdfgW.mjs.map} +1 -1
  19. package/dist/codecs-8T8Jhxsr.mjs +2 -0
  20. package/dist/codecs-8T8Jhxsr.mjs.map +1 -0
  21. package/dist/{command-BjzdoKgJ.mjs → command-C-wEPTO5.mjs} +2 -2
  22. package/dist/{command-BjzdoKgJ.mjs.map → command-C-wEPTO5.mjs.map} +1 -1
  23. package/dist/constants-D6y_AX3P.mjs +2 -0
  24. package/dist/constants-D6y_AX3P.mjs.map +1 -0
  25. package/dist/{constants-FDjw7bPS.mjs → constants-I694qbRg.mjs} +2 -2
  26. package/dist/{constants-FDjw7bPS.mjs.map → constants-I694qbRg.mjs.map} +1 -1
  27. package/dist/{createPoolingCommandUi-BdtnLBBM.mjs → createPoolingCommandUi-BZr2HSiZ.mjs} +2 -2
  28. package/dist/{createPoolingCommandUi-BdtnLBBM.mjs.map → createPoolingCommandUi-BZr2HSiZ.mjs.map} +1 -1
  29. package/dist/{downloadPrivacyRequestFiles-C9-xSCpt.mjs → downloadPrivacyRequestFiles-CF_QjkR9.mjs} +2 -2
  30. package/dist/{downloadPrivacyRequestFiles-C9-xSCpt.mjs.map → downloadPrivacyRequestFiles-CF_QjkR9.mjs.map} +1 -1
  31. package/dist/fetchAllRequests-BV9K0wXv.mjs +2 -0
  32. package/dist/fetchAllRequests-BV9K0wXv.mjs.map +1 -0
  33. package/dist/{fuzzyMatchColumns-D18n9Beu.mjs → fuzzyMatchColumns-Djl3a7lV.mjs} +2 -2
  34. package/dist/{fuzzyMatchColumns-D18n9Beu.mjs.map → fuzzyMatchColumns-Djl3a7lV.mjs.map} +1 -1
  35. package/dist/{generateCrossAccountApiKeys-FtWwlf_L.mjs → generateCrossAccountApiKeys-BxW6xU40.mjs} +2 -2
  36. package/dist/{generateCrossAccountApiKeys-FtWwlf_L.mjs.map → generateCrossAccountApiKeys-BxW6xU40.mjs.map} +1 -1
  37. package/dist/{impl-SOebshza.mjs → impl-3VziEzJI.mjs} +2 -2
  38. package/dist/{impl-SOebshza.mjs.map → impl-3VziEzJI.mjs.map} +1 -1
  39. package/dist/{impl-DnDM9zcu.mjs → impl-7NFxUzSa.mjs} +2 -2
  40. package/dist/{impl-DnDM9zcu.mjs.map → impl-7NFxUzSa.mjs.map} +1 -1
  41. package/dist/{impl-Dg7XSQdO2.mjs → impl-7qTKg-YP2.mjs} +2 -2
  42. package/dist/{impl-Dg7XSQdO2.mjs.map → impl-7qTKg-YP2.mjs.map} +1 -1
  43. package/dist/{impl-zZd6fuXS.mjs → impl-AWYAfZ2C.mjs} +2 -2
  44. package/dist/{impl-zZd6fuXS.mjs.map → impl-AWYAfZ2C.mjs.map} +1 -1
  45. package/dist/{impl-B94dMG4x2.mjs → impl-B-BkGfqq2.mjs} +2 -2
  46. package/dist/{impl-B94dMG4x2.mjs.map → impl-B-BkGfqq2.mjs.map} +1 -1
  47. package/dist/{impl-Dd39KsYO.mjs → impl-B0NqrNcJ2.mjs} +2 -2
  48. package/dist/impl-B0NqrNcJ2.mjs.map +1 -0
  49. package/dist/{impl-C3vTm9zQ.mjs → impl-B5fkF8m2.mjs} +2 -2
  50. package/dist/{impl-C3vTm9zQ.mjs.map → impl-B5fkF8m2.mjs.map} +1 -1
  51. package/dist/{impl-xVmMN-Vt.mjs → impl-B9vbcV8J.mjs} +2 -2
  52. package/dist/{impl-xVmMN-Vt.mjs.map → impl-B9vbcV8J.mjs.map} +1 -1
  53. package/dist/{impl-CSnBFv5P.mjs → impl-BCTVuvlD.mjs} +2 -2
  54. package/dist/{impl-CSnBFv5P.mjs.map → impl-BCTVuvlD.mjs.map} +1 -1
  55. package/dist/impl-BfS6LtNo2.mjs +2 -0
  56. package/dist/impl-BfS6LtNo2.mjs.map +1 -0
  57. package/dist/{impl-qNF5eqX-.mjs → impl-BfU0GFmW.mjs} +1 -1
  58. package/dist/{impl-qNF5eqX-.mjs.map → impl-BfU0GFmW.mjs.map} +1 -1
  59. package/dist/{impl-BXGpJz21.mjs → impl-Bhmoagby.mjs} +2 -2
  60. package/dist/{impl-BXGpJz21.mjs.map → impl-Bhmoagby.mjs.map} +1 -1
  61. package/dist/{impl-COqlYiiw.mjs → impl-Bpiggf8H.mjs} +2 -2
  62. package/dist/{impl-COqlYiiw.mjs.map → impl-Bpiggf8H.mjs.map} +1 -1
  63. package/dist/{impl-D6frX-PK.mjs → impl-BsxD7toO.mjs} +2 -2
  64. package/dist/{impl-D6frX-PK.mjs.map → impl-BsxD7toO.mjs.map} +1 -1
  65. package/dist/{impl-Bs2pNgMK.mjs → impl-BvL9wElZ.mjs} +2 -2
  66. package/dist/{impl-Bs2pNgMK.mjs.map → impl-BvL9wElZ.mjs.map} +1 -1
  67. package/dist/{impl-DUYRVzMo.mjs → impl-BzzkiK_b.mjs} +1 -1
  68. package/dist/{impl-DUYRVzMo.mjs.map → impl-BzzkiK_b.mjs.map} +1 -1
  69. package/dist/{impl-DZoTWLfw2.mjs → impl-C-hBO0Wa2.mjs} +2 -2
  70. package/dist/{impl-DZoTWLfw2.mjs.map → impl-C-hBO0Wa2.mjs.map} +1 -1
  71. package/dist/{impl-bl6NF3Lr.mjs → impl-C6tbQV8G.mjs} +2 -2
  72. package/dist/{impl-bl6NF3Lr.mjs.map → impl-C6tbQV8G.mjs.map} +1 -1
  73. package/dist/{impl-BEiCEzl_2.mjs → impl-CHoglMch.mjs} +1 -1
  74. package/dist/impl-CHoglMch.mjs.map +1 -0
  75. package/dist/{impl-ClT3G845.mjs → impl-CQ3NctWn.mjs} +2 -2
  76. package/dist/{impl-ClT3G845.mjs.map → impl-CQ3NctWn.mjs.map} +1 -1
  77. package/dist/{impl-DhXzxQDN2.mjs → impl-CRif3TpB2.mjs} +2 -2
  78. package/dist/{impl-DhXzxQDN2.mjs.map → impl-CRif3TpB2.mjs.map} +1 -1
  79. package/dist/{impl-Cvyc-iTI2.mjs → impl-CWINXCFq2.mjs} +2 -2
  80. package/dist/{impl-Cvyc-iTI2.mjs.map → impl-CWINXCFq2.mjs.map} +1 -1
  81. package/dist/{impl-BLtOfbtk.mjs → impl-CaErz960.mjs} +2 -2
  82. package/dist/{impl-BLtOfbtk.mjs.map → impl-CaErz960.mjs.map} +1 -1
  83. package/dist/{impl-D6rMLiNB2.mjs → impl-CjOkPJJx.mjs} +2 -2
  84. package/dist/impl-CjOkPJJx.mjs.map +1 -0
  85. package/dist/{impl-yIVxAhCG2.mjs → impl-CpJIikeg2.mjs} +2 -2
  86. package/dist/{impl-yIVxAhCG2.mjs.map → impl-CpJIikeg2.mjs.map} +1 -1
  87. package/dist/{impl-XxYQHKO5.mjs → impl-CujcaHKR.mjs} +2 -2
  88. package/dist/{impl-XxYQHKO5.mjs.map → impl-CujcaHKR.mjs.map} +1 -1
  89. package/dist/{impl-BLOhoP-b2.mjs → impl-CzFfjx8n2.mjs} +2 -2
  90. package/dist/{impl-BLOhoP-b2.mjs.map → impl-CzFfjx8n2.mjs.map} +1 -1
  91. package/dist/{impl-QD3_9HTk.mjs → impl-CzgNvB64.mjs} +2 -2
  92. package/dist/{impl-QD3_9HTk.mjs.map → impl-CzgNvB64.mjs.map} +1 -1
  93. package/dist/{impl-B_N_fOq0.mjs → impl-D5BItJzQ.mjs} +2 -2
  94. package/dist/{impl-B_N_fOq0.mjs.map → impl-D5BItJzQ.mjs.map} +1 -1
  95. package/dist/{impl-DeCRXfAh2.mjs → impl-DEF-meSg2.mjs} +2 -2
  96. package/dist/{impl-DeCRXfAh2.mjs.map → impl-DEF-meSg2.mjs.map} +1 -1
  97. package/dist/{impl-CTOgxZFi.mjs → impl-DIz7yqDc.mjs} +2 -2
  98. package/dist/{impl-CTOgxZFi.mjs.map → impl-DIz7yqDc.mjs.map} +1 -1
  99. package/dist/{impl-DDVhG8Gf.mjs → impl-DLnVDCjy.mjs} +2 -2
  100. package/dist/{impl-DDVhG8Gf.mjs.map → impl-DLnVDCjy.mjs.map} +1 -1
  101. package/dist/{impl-DGtCNANL.mjs → impl-DMoMMAMW.mjs} +2 -2
  102. package/dist/{impl-DGtCNANL.mjs.map → impl-DMoMMAMW.mjs.map} +1 -1
  103. package/dist/{impl-ChQAmyBN.mjs → impl-DMwjar-u.mjs} +2 -2
  104. package/dist/{impl-ChQAmyBN.mjs.map → impl-DMwjar-u.mjs.map} +1 -1
  105. package/dist/{impl-Bz1wZxa-.mjs → impl-DUWlKcy6.mjs} +2 -2
  106. package/dist/{impl-Bz1wZxa-.mjs.map → impl-DUWlKcy6.mjs.map} +1 -1
  107. package/dist/{impl-D58JUOdA.mjs → impl-DY_TNWaO.mjs} +2 -2
  108. package/dist/{impl-D58JUOdA.mjs.map → impl-DY_TNWaO.mjs.map} +1 -1
  109. package/dist/{impl-Cp5o0Q2g.mjs → impl-D_8KoR4w.mjs} +2 -2
  110. package/dist/{impl-Cp5o0Q2g.mjs.map → impl-D_8KoR4w.mjs.map} +1 -1
  111. package/dist/{impl-VSo8bO-J.mjs → impl-DdL7paBD.mjs} +2 -2
  112. package/dist/{impl-VSo8bO-J.mjs.map → impl-DdL7paBD.mjs.map} +1 -1
  113. package/dist/{impl-0-_oxvck.mjs → impl-DioQW8jR.mjs} +2 -2
  114. package/dist/{impl-0-_oxvck.mjs.map → impl-DioQW8jR.mjs.map} +1 -1
  115. package/dist/{impl-EDwngLc7.mjs → impl-Dj4IYEXg.mjs} +2 -2
  116. package/dist/{impl-EDwngLc7.mjs.map → impl-Dj4IYEXg.mjs.map} +1 -1
  117. package/dist/{impl-BvwRiPSG.mjs → impl-DpW_rDzv.mjs} +2 -2
  118. package/dist/{impl-BvwRiPSG.mjs.map → impl-DpW_rDzv.mjs.map} +1 -1
  119. package/dist/{impl-Cb-7C1Ml2.mjs → impl-Dr1qLfh1.mjs} +12 -105
  120. package/dist/impl-Dr1qLfh1.mjs.map +1 -0
  121. package/dist/{impl-agm4lpyq.mjs → impl-HsRwcfRu.mjs} +2 -2
  122. package/dist/{impl-agm4lpyq.mjs.map → impl-HsRwcfRu.mjs.map} +1 -1
  123. package/dist/{impl-BHEAKFX02.mjs → impl-LT1FBKID2.mjs} +2 -2
  124. package/dist/{impl-BHEAKFX02.mjs.map → impl-LT1FBKID2.mjs.map} +1 -1
  125. package/dist/impl-Q2ZDQO_y2.mjs +2 -0
  126. package/dist/impl-Q2ZDQO_y2.mjs.map +1 -0
  127. package/dist/{impl-DFnWzZyY.mjs → impl-UtanPzK1.mjs} +2 -2
  128. package/dist/{impl-DFnWzZyY.mjs.map → impl-UtanPzK1.mjs.map} +1 -1
  129. package/dist/{impl-Ar7VAh0Z.mjs → impl-ZFp_SwYr.mjs} +2 -2
  130. package/dist/{impl-Ar7VAh0Z.mjs.map → impl-ZFp_SwYr.mjs.map} +1 -1
  131. package/dist/{impl-Hj5CgbWd.mjs → impl-eWsR0UvV.mjs} +2 -2
  132. package/dist/{impl-Hj5CgbWd.mjs.map → impl-eWsR0UvV.mjs.map} +1 -1
  133. package/dist/{impl-Ay6JeH-7.mjs → impl-kuuX5KaC.mjs} +2 -2
  134. package/dist/{impl-Ay6JeH-7.mjs.map → impl-kuuX5KaC.mjs.map} +1 -1
  135. package/dist/{impl-xY_5o78i.mjs → impl-mBJWy3lg.mjs} +2 -2
  136. package/dist/{impl-xY_5o78i.mjs.map → impl-mBJWy3lg.mjs.map} +1 -1
  137. package/dist/{impl-ojAnhhbi.mjs → impl-nWslO7Lu.mjs} +2 -2
  138. package/dist/{impl-ojAnhhbi.mjs.map → impl-nWslO7Lu.mjs.map} +1 -1
  139. package/dist/{impl-ApZGIx6l.mjs → impl-o66EB2o7.mjs} +2 -2
  140. package/dist/{impl-ApZGIx6l.mjs.map → impl-o66EB2o7.mjs.map} +1 -1
  141. package/dist/{impl-BCKUj-ko.mjs → impl-pqCx3OlD.mjs} +2 -2
  142. package/dist/{impl-BCKUj-ko.mjs.map → impl-pqCx3OlD.mjs.map} +1 -1
  143. package/dist/{impl-BpVe6fMe.mjs → impl-yxR3rwGm.mjs} +2 -2
  144. package/dist/{impl-BpVe6fMe.mjs.map → impl-yxR3rwGm.mjs.map} +1 -1
  145. package/dist/index.d.mts +36 -26
  146. package/dist/index.d.mts.map +1 -1
  147. package/dist/index.mjs +1 -1
  148. package/dist/{inquirer-jzIQWAvq.mjs → inquirer-DK1JbPA0.mjs} +2 -2
  149. package/dist/{inquirer-jzIQWAvq.mjs.map → inquirer-DK1JbPA0.mjs.map} +1 -1
  150. package/dist/{markRequestDataSiloIdsCompleted-JGJf33yp.mjs → markRequestDataSiloIdsCompleted-CRLlmf-g.mjs} +2 -2
  151. package/dist/{markRequestDataSiloIdsCompleted-JGJf33yp.mjs.map → markRequestDataSiloIdsCompleted-CRLlmf-g.mjs.map} +1 -1
  152. package/dist/{markSilentPrivacyRequests-BTI3rH-V.mjs → markSilentPrivacyRequests-CZIAGpw2.mjs} +2 -2
  153. package/dist/{markSilentPrivacyRequests-BTI3rH-V.mjs.map → markSilentPrivacyRequests-CZIAGpw2.mjs.map} +1 -1
  154. package/dist/{mergeTranscendInputs-B7WjxYMN.mjs → mergeTranscendInputs-9kQ3t5VY.mjs} +2 -2
  155. package/dist/{mergeTranscendInputs-B7WjxYMN.mjs.map → mergeTranscendInputs-9kQ3t5VY.mjs.map} +1 -1
  156. package/dist/{notifyPrivacyRequestsAdditionalTime-n5fvOJaA.mjs → notifyPrivacyRequestsAdditionalTime-KiF9dkuk.mjs} +2 -2
  157. package/dist/{notifyPrivacyRequestsAdditionalTime-n5fvOJaA.mjs.map → notifyPrivacyRequestsAdditionalTime-KiF9dkuk.mjs.map} +1 -1
  158. package/dist/{policy-bundle-manifest-DbbTXe0u.mjs → policy-bundle-manifest-DW1kUjMf.mjs} +2 -2
  159. package/dist/{policy-bundle-manifest-DbbTXe0u.mjs.map → policy-bundle-manifest-DW1kUjMf.mjs.map} +1 -1
  160. package/dist/{policy-project-discovery-DTSl0Gfl.mjs → policy-project-discovery-BSQ2Cow0.mjs} +4 -4
  161. package/dist/policy-project-discovery-BSQ2Cow0.mjs.map +1 -0
  162. package/dist/{policy-scaffold-config-RpxwwZ2H.mjs → policy-scaffold-config-B_Xbfv7q.mjs} +8 -8
  163. package/dist/policy-scaffold-config-B_Xbfv7q.mjs.map +1 -0
  164. package/dist/{project-discovery-BkHpTXDx.mjs → project-discovery-g29vd44a.mjs} +2 -2
  165. package/dist/{project-discovery-BkHpTXDx.mjs.map → project-discovery-g29vd44a.mjs.map} +1 -1
  166. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DbybCU2T.mjs → pullChunkedCustomSiloOutstandingIdentifiers-ekuEZlzq.mjs} +2 -2
  167. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DbybCU2T.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-ekuEZlzq.mjs.map} +1 -1
  168. package/dist/{pullManualEnrichmentIdentifiersToCsv-CxTPUfpV.mjs → pullManualEnrichmentIdentifiersToCsv-D710M8kt.mjs} +2 -2
  169. package/dist/{pullManualEnrichmentIdentifiersToCsv-CxTPUfpV.mjs.map → pullManualEnrichmentIdentifiersToCsv-D710M8kt.mjs.map} +1 -1
  170. package/dist/{pushCronIdentifiersFromCsv-CeRVlbFE.mjs → pushCronIdentifiersFromCsv-f8FSSFhM.mjs} +2 -2
  171. package/dist/{pushCronIdentifiersFromCsv-CeRVlbFE.mjs.map → pushCronIdentifiersFromCsv-f8FSSFhM.mjs.map} +1 -1
  172. package/dist/{pushManualEnrichmentIdentifiersFromCsv--4dYCvyv.mjs → pushManualEnrichmentIdentifiersFromCsv-6xOUhOpJ.mjs} +2 -2
  173. package/dist/{pushManualEnrichmentIdentifiersFromCsv--4dYCvyv.mjs.map → pushManualEnrichmentIdentifiersFromCsv-6xOUhOpJ.mjs.map} +1 -1
  174. package/dist/{readTranscendYaml-BfqQbPiT.mjs → readTranscendYaml-D576bvzR.mjs} +2 -2
  175. package/dist/{readTranscendYaml-BfqQbPiT.mjs.map → readTranscendYaml-D576bvzR.mjs.map} +1 -1
  176. package/dist/{removeUnverifiedRequestIdentifiers-CV6JGgt_.mjs → removeUnverifiedRequestIdentifiers-B8iIreP4.mjs} +2 -2
  177. package/dist/{removeUnverifiedRequestIdentifiers-CV6JGgt_.mjs.map → removeUnverifiedRequestIdentifiers-B8iIreP4.mjs.map} +1 -1
  178. package/dist/{retryRequestDataSilos-_OThvVwU.mjs → retryRequestDataSilos-BQuxZd4C.mjs} +2 -2
  179. package/dist/{retryRequestDataSilos-_OThvVwU.mjs.map → retryRequestDataSilos-BQuxZd4C.mjs.map} +1 -1
  180. package/dist/runRegalLintStep-DPaMm7Gg.mjs +3 -0
  181. package/dist/runRegalLintStep-DPaMm7Gg.mjs.map +1 -0
  182. package/dist/{scaffold-planning-BrX-pcz6.mjs → scaffold-planning-Bp_yqZWx.mjs} +2 -2
  183. package/dist/{scaffold-planning-BrX-pcz6.mjs.map → scaffold-planning-Bp_yqZWx.mjs.map} +1 -1
  184. package/dist/{skipPreflightJobs-D8og5pKe.mjs → skipPreflightJobs-BkTH4QOf.mjs} +2 -2
  185. package/dist/{skipPreflightJobs-D8og5pKe.mjs.map → skipPreflightJobs-BkTH4QOf.mjs.map} +1 -1
  186. package/dist/{skipRequestDataSilos-DUQ6AD_O.mjs → skipRequestDataSilos-sdfJ0gPn.mjs} +2 -2
  187. package/dist/{skipRequestDataSilos-DUQ6AD_O.mjs.map → skipRequestDataSilos-sdfJ0gPn.mjs.map} +1 -1
  188. package/dist/{streamPrivacyRequestsToCsv-BApu4dvI.mjs → streamPrivacyRequestsToCsv-D0PK8mjN.mjs} +2 -2
  189. package/dist/{streamPrivacyRequestsToCsv-BApu4dvI.mjs.map → streamPrivacyRequestsToCsv-D0PK8mjN.mjs.map} +1 -1
  190. package/dist/{updateConsentManagerVersionToLatest-BrgPZ5hX.mjs → updateConsentManagerVersionToLatest-EJaexjTY.mjs} +2 -2
  191. package/dist/{updateConsentManagerVersionToLatest-BrgPZ5hX.mjs.map → updateConsentManagerVersionToLatest-EJaexjTY.mjs.map} +1 -1
  192. package/dist/{uploadConsents-DRlDHQak.mjs → uploadConsents-DjvQVsIl.mjs} +2 -2
  193. package/dist/{uploadConsents-DRlDHQak.mjs.map → uploadConsents-DjvQVsIl.mjs.map} +1 -1
  194. package/dist/uploadPrivacyRequestsFromCsv-FvSx9zis.mjs +2 -0
  195. package/dist/uploadPrivacyRequestsFromCsv-FvSx9zis.mjs.map +1 -0
  196. package/dist/{validateTranscendAuth-D-dDINof.mjs → validateTranscendAuth-BrVGfq6X.mjs} +2 -2
  197. package/dist/{validateTranscendAuth-D-dDINof.mjs.map → validateTranscendAuth-BrVGfq6X.mjs.map} +1 -1
  198. package/package.json +6 -6
  199. package/dist/app-BMLQABJX.mjs.map +0 -1
  200. package/dist/codecs-CfcaFoZR.mjs +0 -2
  201. package/dist/codecs-CfcaFoZR.mjs.map +0 -1
  202. package/dist/constants-DlH2vWm_.mjs +0 -2
  203. package/dist/constants-DlH2vWm_.mjs.map +0 -1
  204. package/dist/fetchAllRequests-BI0tFl_a.mjs +0 -2
  205. package/dist/fetchAllRequests-BI0tFl_a.mjs.map +0 -1
  206. package/dist/impl-BEiCEzl_2.mjs.map +0 -1
  207. package/dist/impl-Cb-7C1Ml2.mjs.map +0 -1
  208. package/dist/impl-D6rMLiNB2.mjs.map +0 -1
  209. package/dist/impl-DNOgBcsu.mjs +0 -3
  210. package/dist/impl-DNOgBcsu.mjs.map +0 -1
  211. package/dist/impl-Dd39KsYO.mjs.map +0 -1
  212. package/dist/policy-project-discovery-DTSl0Gfl.mjs.map +0 -1
  213. package/dist/policy-scaffold-config-RpxwwZ2H.mjs.map +0 -1
  214. package/dist/uploadPrivacyRequestsFromCsv-FAGllBdd.mjs +0 -2
  215. package/dist/uploadPrivacyRequestsFromCsv-FAGllBdd.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"codecs-CfcaFoZR.mjs","names":[],"sources":["../src/codecs.ts"],"sourcesContent":["import {\n InitialViewState,\n BrowserLanguage,\n UserPrivacySignalEnum,\n OnConsentExpiry,\n} from '@transcend-io/airgap.js-types';\nimport { LOCALE_KEY } from '@transcend-io/internationalization';\nimport {\n DataCategoryType,\n ConsentBundleType,\n EnricherType,\n ProcessingPurpose,\n RequestAction,\n ComparisonOperator,\n RequestActionObjectResolver,\n AssessmentSyncColumn,\n RetentionScheduleType,\n AssessmentQuestionType,\n DataFlowScope,\n PromptAVendorEmailSendType,\n RetentionScheduleOperation,\n AssessmentsDisplayLogicAction,\n DefaultConsentOption,\n LogicOperator,\n ConsentPrecedenceOption,\n AssessmentSyncModel,\n AssessmentQuestionSubType,\n IsoCountryCode,\n BrowserTimeZone,\n IsoCountrySubdivisionCode,\n ConsentTrackerStatus,\n AttributeKeyType,\n PromptAVendorEmailCompletionLinkType,\n RegionsOperator,\n UnknownRequestPolicy,\n TelemetryPartitionStrategy,\n SignedIabAgreementOption,\n RegionDetectionMethod,\n PreflightRequestStatus,\n AttributeSupportedResourceType,\n SubDataPointDataSubCategoryGuessStatus,\n CodePackageType,\n ActionItemPriorityOverride,\n ActionItemCode,\n ScopeName,\n TranscendProduct,\n PrivacyCenterComponentStyles,\n PrivacyCenterTextStyles,\n PreferenceStoreAuthLevel,\n ConfigurableColorPaletteColor,\n PrivacyCenterFooterLayout,\n AssessmentFormTemplateStatus,\n AssessmentFormStatus,\n AssessmentFormTemplateSource,\n UnstructuredSubDataPointRecommendationStatus,\n PreferenceTopicType,\n Controllership,\n RetentionType,\n DataProtectionImpactAssessmentStatus,\n WorkflowConfigVisibility,\n WorkflowConfigType,\n CollectDataSubjectRegions,\n ConsentThemeInput,\n ConsentVariantInput,\n PolicyType,\n} from '@transcend-io/privacy-types';\nimport { applyEnum, valuesOf } from '@transcend-io/type-utils';\n// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable max-lines */\nimport * as t from 'io-ts';\n\n/**\n * Input to define email templates that can be used to communicate to end-users\n * about the status of their requests\n *\n * @see https://docs.transcend.io/docs/privacy-requests/configuring-requests/email-templates\n */\nexport const TemplateInput = t.type({\n /** The title of the template */\n title: t.string,\n});\n\n/** Type override */\nexport type TemplateInput = t.TypeOf<typeof TemplateInput>;\n\nexport const WebhookHeader = t.intersection([\n t.type({\n /** The name of the header to set. */\n name: t.string,\n /** The value of the header. */\n value: t.string,\n }),\n t.partial({\n /** The header contains a secret */\n isSecret: t.boolean,\n }),\n]);\n\n/** Type override */\nexport type WebhookHeader = t.TypeOf<typeof WebhookHeader>;\n\n/**\n * Input to define API keys that may be shared across data silos\n * in the data map. When creating new data silos through the yaml\n * cli, it is possible to specify which API key should be associated\n * with the newly created data silo.\n *\n * @see https://docs.transcend.io/docs/authentication\n */\nexport const ApiKeyInput = t.type({\n /** The display title of the enricher */\n title: t.string,\n});\n\n/** Type override */\nexport type ApiKeyInput = t.TypeOf<typeof ApiKeyInput>;\n\n/**\n * Input to define teams in Transcend\n * Users belong to teams and teams can be assigned to various resources\n *\n * @see https://docs.transcend.io/docs/security/access-control\n */\nexport const TeamInput = t.intersection([\n t.type({\n /** The display name of the team */\n name: t.string,\n /** Team description */\n description: t.string,\n }),\n t.partial({\n /** SSO department for automated provisioning */\n 'sso-department': t.string,\n /** SSO group name for automated provisioning */\n 'sso-group': t.string,\n /** SSO title mapping for automated provisioning */\n 'sso-title': t.string,\n /** Parent organization team name to link this team to */\n 'parent-team-name': t.string,\n /** List of user emails on the team */\n users: t.array(t.string),\n /** List of scopes that the team should have */\n scopes: t.array(valuesOf(ScopeName)),\n }),\n]);\n\n/** Type override */\nexport type TeamInput = t.TypeOf<typeof TeamInput>;\n\n/**\n * Input to define a preflight check (formerly called an \"enricher\")\n *\n * Define preflight check webhooks that will be executed prior to privacy\n * request workflows. Some examples may include:\n * - identity enrichment: look up additional identifiers for that user.\n * i.e. map an email address to a user ID\n * - fraud check: auto-cancel requests if the user is flagged for fraudulent behavior\n * - customer check: auto-cancel request for some custom business criteria\n *\n * @see https://docs.transcend.io/docs/identity-enrichment\n */\nexport const EnricherInput = t.intersection([\n t.type({\n /** The display title of the preflight check */\n title: t.string,\n\n /**\n * The names of the identifiers that can be resolved by this preflight check.\n * i.e. email -> [userId, phone, advertisingId]\n */\n 'output-identifiers': t.array(t.string),\n }),\n t.partial({\n /** Internal description for why the preflight check is needed */\n description: t.string,\n /** The URL of the preflight check webhook */\n url: t.string,\n /** The type of preflight check */\n type: valuesOf(EnricherType),\n /**\n * The name of the identifier that will be the input to this preflight check.\n * Whenever a privacy request contains this identifier, the webhook will\n * be called with the value of that identifier as input\n */\n 'input-identifier': t.string,\n /**\n * A regular expression that can be used to match on for cancellation\n */\n testRegex: t.string,\n /**\n * For looker integration - the title of the looker query to run\n */\n lookerQueryTitle: t.string,\n /**\n * The duration (in ms) that the preflight check should take to execute.\n */\n expirationDuration: t.number,\n /**\n * The status that the preflight check should transfer to when condition is met.\n */\n transitionRequestStatus: valuesOf(PreflightRequestStatus),\n /**\n * For twilio integration - the phone numbers that can be used to send text codes\n */\n phoneNumbers: t.array(t.string),\n /** The list of regions that should trigger the preflight check */\n regionList: t.array(valuesOf({ ...IsoCountryCode, ...IsoCountrySubdivisionCode })),\n /**\n * Specify which data subjects the preflight check should run for\n */\n 'data-subjects': t.array(t.string),\n /** Headers to include in the webhook */\n headers: t.array(WebhookHeader),\n /** The privacy actions that the preflight check should run against */\n 'privacy-actions': t.array(valuesOf(RequestAction)),\n }),\n]);\n\n/** Type override */\nexport type EnricherInput = t.TypeOf<typeof EnricherInput>;\n\n/** Alias for {@link EnricherInput} */\nexport const PreflightInput = EnricherInput;\n\n/** Type override */\nexport type PreflightInput = EnricherInput;\n\n/**\n * The processing purpose for a field\n */\nexport const ProcessingPurposePreviewInput = t.intersection([\n t.type({\n /** The parent purpose */\n purpose: valuesOf(ProcessingPurpose),\n }),\n t.partial({\n /** User-defined name for this processing purpose sub category */\n name: t.string,\n }),\n]);\n\n/** Type override */\nexport type ProcessingPurposePreviewInput = t.TypeOf<typeof ProcessingPurposePreviewInput>;\n\n/**\n * The data category for a field\n */\nexport const DataCategoryPreviewInput = t.intersection([\n t.type({\n /** The parent category */\n category: valuesOf(DataCategoryType),\n }),\n t.partial({\n /** User-defined name for this sub category */\n name: t.string,\n }),\n]);\n\n/** Type override */\nexport type DataCategoryPreviewInput = t.TypeOf<typeof DataCategoryPreviewInput>;\n\n/**\n * A guessed data category from the content classifier\n */\nexport const DataCategoryGuessInput = t.intersection([\n t.type({\n /** The parent category */\n category: DataCategoryPreviewInput,\n /** Status of guess */\n status: valuesOf(SubDataPointDataSubCategoryGuessStatus),\n /** Confidence level of guess */\n confidence: t.number,\n }),\n t.partial({\n /** classifier version that produced the guess */\n classifierVersion: t.number,\n }),\n]);\n\n/** Type override */\nexport type DataCategoryGuessInput = t.TypeOf<typeof DataCategoryGuessInput>;\n\n/**\n * A guessed data category from the content classifier\n */\nexport const DataCategoryRecommendationInput = t.intersection([\n t.type({\n /** The parent category */\n category: DataCategoryPreviewInput,\n /** Status of guess */\n status: valuesOf(UnstructuredSubDataPointRecommendationStatus),\n /** Confidence level of guess */\n confidence: t.number,\n }),\n t.partial({\n /** classifier version that produced the guess */\n classifierVersion: t.number,\n }),\n]);\n\n/** Type override */\nexport type DataCategoryRecommendationInput = t.TypeOf<typeof DataCategoryRecommendationInput>;\n\nexport const AttributeValueInput = t.intersection([\n t.type({\n /** Name of attribute value */\n name: t.string,\n }),\n t.partial({\n /** Description */\n description: t.string,\n /** Color */\n color: t.string,\n }),\n]);\n\n/** Type override */\nexport type AttributeValueInput = t.TypeOf<typeof AttributeValueInput>;\n\nexport const AttributeInput = t.intersection([\n t.type({\n /** Name of attribute */\n name: t.string,\n /** Type of attribute */\n type: valuesOf(AttributeKeyType),\n }),\n t.partial({\n /** Description of attribute */\n description: t.string,\n /** Resource types that the attribute is enabled on */\n resources: t.array(valuesOf(AttributeSupportedResourceType)),\n /** Values of attribute */\n values: t.array(AttributeValueInput),\n }),\n]);\n\n/** Type override */\nexport type AttributeInput = t.TypeOf<typeof AttributeInput>;\n\nexport const AttributePreview = t.type({\n /** Attribute key */\n key: t.string,\n /** Attribute values */\n values: t.array(t.string),\n});\n\n/** Type override */\nexport type AttributePreview = t.TypeOf<typeof AttributePreview>;\n\n/**\n * Vendor type definition.\n */\nexport const VendorInput = t.intersection([\n t.type({\n /** Title of vendor */\n title: t.string,\n }),\n t.partial({\n /** Description of vendor */\n description: t.string,\n /** DPA link */\n dataProcessingAgreementLink: t.string,\n /** Contract email */\n contactName: t.string,\n /** Contract phone */\n contactPhone: t.string,\n /** Address */\n address: t.string,\n /** Headquarters country */\n headquarterCountry: valuesOf(IsoCountryCode),\n /** Headquarters subdivision */\n headquarterSubDivision: valuesOf(IsoCountrySubdivisionCode),\n /** Website URL */\n websiteUrl: t.string,\n /** Business entity */\n businessEntity: t.string,\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this vendor\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this vendor\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/**\n * Type override\n */\nexport type VendorInput = t.TypeOf<typeof VendorInput>;\n\n/**\n * DataCategory type definition.\n */\nexport const DataCategoryInput = t.intersection([\n t.type({\n /** Name of data category */\n name: t.string,\n /** Type of data category */\n category: valuesOf(DataCategoryType),\n }),\n t.partial({\n /** Description of data category */\n description: t.string,\n /** Regex for data category */\n regex: t.string,\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this data category\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this data category.\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/**\n * Type override\n */\nexport type DataCategoryInput = t.TypeOf<typeof DataCategoryInput>;\n\n/**\n * ProcessingPurpose type definition.\n */\nexport const ProcessingPurposeInput = t.intersection([\n t.type({\n /** Name of processing purpose */\n name: t.string,\n /** Type of processing purpose */\n purpose: valuesOf(ProcessingPurpose),\n }),\n t.partial({\n /** Description of processing purpose */\n description: t.string,\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this processing purpose\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this processing purpose.\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/**\n * Type override\n */\nexport type ProcessingPurposeInput = t.TypeOf<typeof ProcessingPurposeInput>;\n\n/**\n * Annotate specific fields within a datapoint. These are often database table columns.\n * Fields can also be a JSON object or separate file.\n */\nexport const FieldInput = t.intersection([\n t.type({\n /** The unique key of the field. When a database, this is the column name. */\n key: t.string,\n }),\n t.partial({\n /** The display title of the field */\n title: t.string,\n /** Description of the field */\n description: t.union([t.string, t.null]),\n /**\n * What is the purpose of processing for this datapoint/table?\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/objects.ts\n */\n purposes: t.array(ProcessingPurposePreviewInput),\n /**\n * The category of personal data for this datapoint\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/objects.ts\n */\n categories: t.array(DataCategoryPreviewInput),\n /**\n * The category of personal data that have been guessed by the classifier this datapoint\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/objects.ts\n */\n 'guessed-categories': t.array(DataCategoryGuessInput),\n /**\n * When true, this subdatapoint should be revealed in a data access request.\n * When false, this field should be redacted\n */\n 'access-request-visibility-enabled': t.boolean,\n /**\n * When true, this subdatapoint should be redacted during an erasure request.\n * There normally is a choice of enabling hard deletion or redaction at the\n * datapoint level, but if redaction is enabled, this column can be used\n * to define which fields should be redacted.\n */\n 'erasure-request-redaction-enabled': t.boolean,\n /** Attributes tagged to subdatapoint */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/** Type override */\nexport type FieldInput = t.TypeOf<typeof FieldInput>;\n\n/**\n * Datapoints are the different types of data models that existing within your data silo.\n * If the data silo is a database, these would be your tables.\n * Note: These are currently called \"datapoints\" in the Transcend UI and documentation.\n *\n * @see https://docs.transcend.io/docs/the-data-map#datapoints\n */\nexport const DatapointInput = t.intersection([\n t.type({\n /** The unique key of the datapoint. For a database, this is the table name. */\n key: t.string,\n }),\n t.partial({\n /**\n * Usually only relevant for databases,\n * this field should include any schema information for a given datapoint.\n *\n * Examples:\n * - In postgres, it's possible to have multiple tables with the same name under\n * different schemas. e.g., \"public\", \"test\". So here you'd specify [\"public\"] or [\"test\"]\n * - In Snowflake, it's possible to have different databases with different schemas,\n * so you can specify [\"ANALYTICS\", \"public\"] to indicate that the datapoint belongs to\n * the \"public\" schema of the \"ANALYTICS\" database.\n */\n path: t.array(t.string),\n /** The display title of the enricher */\n title: t.string,\n /** Internal description for why the enricher is needed */\n description: t.string,\n /**\n * Configure the category of data that this datapoint should be grouped by in a data access request.\n *\n * @see https://docs.transcend.io/docs/privacy-requests/connecting-data-silos/saas-tools#configuring-an-integration\n */\n 'data-collection-tag': t.string,\n /**\n * The SQL queries that should be run for that datapoint in a privacy request.\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/actions.ts\n */\n 'privacy-action-queries': t.partial(applyEnum(RequestActionObjectResolver, () => t.string)),\n /**\n * The types of privacy actions that this datapoint can implement\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/actions.ts\n */\n 'privacy-actions': t.array(valuesOf(RequestActionObjectResolver)),\n /**\n * Provide field-level metadata for this datapoint.\n * This is often the column metadata\n */\n fields: t.array(FieldInput),\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this datapoint\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this datapoint\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type DatapointInput = t.TypeOf<typeof DatapointInput>;\n\nexport const PromptAVendorEmailSettings = t.partial({\n /** The email address of the user to notify when a promptAPerson integration */\n 'notify-email-address': t.string,\n /**\n * The frequency with which we should be sending emails for this data silo, in milliseconds.\n */\n 'send-frequency': t.number,\n /**\n * The type of emails to send for this data silo, i.e. send an email for each DSR, across all open DSRs,\n * or per profile in a DSR.\n */\n 'send-type': valuesOf(PromptAVendorEmailSendType),\n /**\n * Indicates whether prompt-a-vendor emails should include a list of identifiers\n * in addition to a link to the bulk processing UI.\n */\n 'include-identifiers-attachment': t.boolean,\n /**\n * Indicates what kind of link to generate as part of the emails sent out for this Prompt-a-Vendor silo.\n */\n 'completion-link-type': valuesOf(PromptAVendorEmailCompletionLinkType),\n /**\n * The frequency with which we should retry sending emails for this data silo, in milliseconds.\n * Needs to be a string because the number can be larger than the MAX_INT\n */\n 'manual-work-retry-frequency': t.string,\n});\n\n/** Type override */\nexport type PromptAVendorEmailSettings = t.TypeOf<typeof PromptAVendorEmailSettings>;\n\n/**\n * Input to define a business entity\n *\n * @see https://app.transcend.io/data-map/data-inventory/business-entities\n */\nexport const BusinessEntityInput = t.intersection([\n t.type({\n /** The title of the business entity */\n title: t.string,\n }),\n t.partial({\n /** Description of the business entity */\n description: t.string,\n /** Address of the business entity */\n address: t.string,\n /** Country of headquarters */\n headquarterCountry: valuesOf(IsoCountryCode),\n /** Subdivision of headquarters */\n headquarterSubDivision: valuesOf(IsoCountrySubdivisionCode),\n /** Data protection officer name for the business entity */\n dataProtectionOfficerName: t.string,\n /** Data protection officer email for the business entity */\n dataProtectionOfficerEmail: t.string,\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this data silo\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this data silo.\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type BusinessEntityInput = t.TypeOf<typeof BusinessEntityInput>;\n\nexport const RegionInput = t.partial({\n /** The country */\n country: valuesOf(IsoCountryCode),\n /** The country subdivision */\n countrySubDivision: valuesOf(IsoCountrySubdivisionCode),\n});\n\n/** Type override */\nexport type RegionInput = t.TypeOf<typeof RegionInput>;\n\n/**\n * Input to define a processing activity\n *\n * @see https://app.transcend.io/data-map/data-inventory/processing-activities\n */\nexport const ProcessingActivityInput = t.intersection([\n t.type({\n /** The title of the processing activity */\n title: t.string,\n }),\n t.partial({\n /** Description of the processing activity */\n description: t.string,\n /** Security measure details */\n securityMeasureDetails: t.string,\n /**\n * Controllerships\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/datapoint.ts\n */\n controllerships: t.array(valuesOf(Controllership)),\n /** Storage regions */\n storageRegions: t.array(RegionInput),\n /** Transfer regions */\n transferRegions: t.array(RegionInput),\n /**\n * Retention type\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/datapoint.ts\n */\n retentionType: valuesOf(RetentionType),\n /** Retention period in days */\n retentionPeriod: t.number,\n /** Data protection impact assessment link */\n dataProtectionImpactAssessmentLink: t.string,\n /**\n * Data protection impact assessment status\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/processingActivity.ts.ts\n */\n dataProtectionImpactAssessmentStatus: valuesOf(DataProtectionImpactAssessmentStatus),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n /** Data silo titles */\n dataSiloTitles: t.array(t.string),\n /** Data subject types */\n dataSubjectTypes: t.array(t.string),\n /** Team names */\n teamNames: t.array(t.string),\n /** Owner emails */\n ownerEmails: t.array(t.string),\n /**\n * The purposes of processing for this processing activity\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/objects.ts\n */\n processingSubPurposes: t.array(ProcessingPurposePreviewInput),\n /**\n * The categories of personal data for this processing activity\n *\n * @see https://github.com/transcend-io/privacy-types/blob/main/src/objects.ts\n */\n dataSubCategories: t.array(DataCategoryPreviewInput),\n /** SaaS category titles */\n saaSCategories: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type ProcessingActivityInput = t.TypeOf<typeof ProcessingActivityInput>;\n\n/**\n * Software development kit inputs\n *\n * @see https://app.transcend.io/code-scanning/sdks\n */\nexport const SoftwareDevelopmentKitInput = t.intersection([\n t.type({\n /** Title of software development kit */\n name: t.string,\n /** Code package type */\n codePackageType: valuesOf(CodePackageType),\n }),\n t.partial({\n /** Description of the SDK */\n description: t.string,\n /** Github repository */\n repositoryUrl: t.string,\n /** Integration name */\n catalogIntegrationName: t.string,\n /** Doc links */\n documentationLinks: t.array(t.string),\n /** Emails of owners */\n ownerEmails: t.array(t.string),\n /** Team names */\n teamNames: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type SoftwareDevelopmentKitInput = t.TypeOf<typeof SoftwareDevelopmentKitInput>;\n\n/**\n * SDK defined for a code package\n */\nexport const CodePackageSdk = t.intersection([\n t.type({\n /** Name of SDK */\n name: t.string,\n }),\n t.partial({\n /** Version of SDK */\n version: t.string,\n /** Indicate if dependency is a dev dependency */\n isDevDependency: t.boolean,\n }),\n]);\n\n/** Type override */\nexport type CodePackageSdk = t.TypeOf<typeof CodePackageSdk>;\n\n/**\n * Input to define a code package\n *\n * @see https://app.transcend.io/code-scanning/code-packages\n */\nexport const CodePackageInput = t.intersection([\n t.type({\n /** The name of the package */\n name: t.string,\n /** Type of code package */\n type: valuesOf(CodePackageType),\n /** Relative path to code package within the repository */\n relativePath: t.string,\n /** Name of repository that the code packages are being uploaded to */\n repositoryName: t.string,\n }),\n t.partial({\n /** Description of the code package */\n description: t.string,\n /** Software development kits in the repository */\n softwareDevelopmentKits: t.array(CodePackageSdk),\n /** Names of the teams that manage the code package */\n teamNames: t.array(t.string),\n /** Names of the owner emails that manage the code package */\n ownerEmails: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type CodePackageInput = t.TypeOf<typeof CodePackageInput>;\n\n/**\n * Input to define a repository\n *\n * @see https://app.transcend.io/code-scanning/repositories\n */\nexport const RepositoryInput = t.intersection([\n t.type({\n /** The name of the repo */\n name: t.string,\n /** URL of repository */\n url: t.string,\n }),\n t.partial({\n /** Description of the repository */\n description: t.string,\n /** Names of the teams that manage the repository */\n teamNames: t.array(t.string),\n /** Names of the owner emails that manage the repository */\n ownerEmails: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type RepositoryInput = t.TypeOf<typeof RepositoryInput>;\n\n/**\n * Input to define a data subject\n *\n * @see https://app.transcend.io/privacy-requests/settings\n */\nexport const DataSubjectInput = t.intersection([\n t.type({\n /** The type of the data subject */\n type: t.string,\n }),\n t.partial({\n /** Whether the data subject is active on the Privacy Center & DSR API */\n active: t.boolean,\n /** The title of the data subject */\n title: t.string,\n /** Whether or not to default new requests made in the admin dashboard to silent mode */\n adminDashboardDefaultSilentMode: t.boolean,\n /**\n * Whether requests can be submitted on behalf of this data subject by an authorized agent.\n * Requires the Authorized Agents feature to be enabled for the organization.\n */\n supportsAuthorizedAgent: t.boolean,\n /** Enabled request actions for the data subject */\n actions: t.array(valuesOf(RequestAction)),\n }),\n]);\n\n/** Type override */\nexport type DataSubjectInput = t.TypeOf<typeof DataSubjectInput>;\n\n/**\n * Input to define an action\n *\n * @see https://app.transcend.io/privacy-requests/settings\n */\nexport const ActionInput = t.intersection([\n t.type({\n /** The type of the data subject */\n type: valuesOf(RequestAction),\n }),\n t.partial({\n /** Whether or not to skip deletion phase when no data is found */\n skipSecondaryIfNoFiles: t.boolean,\n /** Whether to skip the downloadable step */\n skipDownloadableStep: t.boolean,\n /** Whether the request action requires review */\n requiresReview: t.boolean,\n /** The wait period for the action */\n waitingPeriod: t.number,\n /** The method in which the data subject's region is detected */\n regionDetectionMethod: valuesOf(RegionDetectionMethod),\n /** The list of regions to show in the form */\n regionList: t.array(valuesOf({ ...IsoCountryCode, ...IsoCountrySubdivisionCode })),\n /** The list of regions NOT to show in the form */\n regionBlockList: t.array(valuesOf({ ...IsoCountryCode, ...IsoCountrySubdivisionCode })),\n }),\n]);\n\n/** Type override */\nexport type ActionInput = t.TypeOf<typeof ActionInput>;\n\n/**\n * Input to define an identifier\n *\n * @see https://app.transcend.io/privacy-requests/identifiers\n */\nexport const IdentifierInput = t.intersection([\n t.type({\n /** The name of the identifier */\n name: t.string,\n /** The type of the identifier */\n type: t.string,\n }),\n t.partial({\n /** Regular expression to verify the identifier */\n regex: t.string,\n /** The fixed set of options that an identifier can take on */\n selectOptions: t.array(t.string),\n /** Whether or not the identifier is shown in the privacy center form */\n privacyCenterVisibility: t.array(valuesOf(RequestAction)),\n /** The set of data subjects that this identifier is enabled for */\n dataSubjects: t.array(t.string),\n /** When true, the identifier is a required field on the privacy center form */\n isRequiredInForm: t.boolean,\n /** Placeholder message for identifier */\n placeholder: t.string,\n /** Display title for identifier */\n displayTitle: t.string,\n /** Display description for identifier */\n displayDescription: t.string,\n /** The display order for the identifier */\n displayOrder: t.number,\n /** Whether or not the identifier is unique on the preference store */\n isUniqueOnPreferenceStore: t.boolean,\n }),\n]);\n\n/** Type override */\nexport type IdentifierInput = t.TypeOf<typeof IdentifierInput>;\n\n/**\n * Input to define a data flow\n *\n * @see https://app.transcend.io/consent-manager/data-flows/approved\n */\nexport const DataFlowInput = t.intersection([\n t.type({\n /** Value of data flow */\n value: t.string,\n /** Type of data flow */\n type: valuesOf(DataFlowScope),\n }),\n t.partial({\n /** Description of data flow */\n description: t.string,\n /** The tracking purposes that are required to be opted in for this data flow */\n trackingPurposes: t.array(t.string),\n /**\n * Name of the consent service attached\n */\n service: t.string,\n /**\n * Status of the tracker (approved vs triage)\n */\n status: valuesOf(ConsentTrackerStatus),\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this data silo\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this data silo.\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/** Type override */\nexport type DataFlowInput = t.TypeOf<typeof DataFlowInput>;\n\nexport const CookieInput = t.intersection([\n t.type({\n /** Name of data flow */\n name: t.string,\n }),\n t.partial({\n /** Whether or not the cookie is a regular expression */\n isRegex: t.boolean,\n /** Description of data flow */\n description: t.string,\n /** The tracking purposes that are required to be opted in for this data flow */\n trackingPurposes: t.array(t.string),\n /**\n * Name of the consent service attached\n */\n service: t.string,\n /**\n * Status of the tracker (approved vs triage)\n */\n status: valuesOf(ConsentTrackerStatus),\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this data silo\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this data silo.\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/** Type override */\nexport type CookieInput = t.TypeOf<typeof CookieInput>;\n\nexport const ConsentManageExperienceInput = t.intersection([\n t.type({\n /** Name of experience */\n name: t.string,\n }),\n t.partial({\n /** Name of experience */\n displayName: t.string,\n /** Region that define this regional experience */\n regions: t.array(RegionInput),\n /** How to handle consent expiry */\n onConsentExpiry: valuesOf(OnConsentExpiry),\n /** Consent expiration lever */\n consentExpiry: t.number,\n /** In vs not in operator */\n operator: valuesOf(RegionsOperator),\n /** Priority of experience */\n displayPriority: t.number,\n /** View state to prompt when auto prompting is enabled */\n viewState: valuesOf(InitialViewState),\n /** Purposes that can be opted out of in a particular experience */\n purposes: t.array(\n t.type({\n /** Slug of purpose */\n trackingType: t.string,\n }),\n ),\n /** Purposes that are opted out by default in a particular experience */\n optedOutPurposes: t.array(\n t.type({\n /** Slug of purpose */\n trackingType: t.string,\n }),\n ),\n /**\n * Browser languages that define this regional experience\n */\n browserLanguages: t.array(valuesOf(BrowserLanguage)),\n /** Browser time zones that define this regional experience */\n browserTimeZones: t.array(valuesOf(BrowserTimeZone)),\n /** ID of the consent UI variant assigned to this experience */\n consentUiVariantSlug: t.string,\n }),\n]);\n\n/** Type override */\nexport type ConsentManageExperienceInput = t.TypeOf<typeof ConsentManageExperienceInput>;\n\nexport const PartitionInput = t.intersection([\n t.type({\n /** Name of partition */\n name: t.string,\n }),\n t.partial({\n /** Value of partition, cannot be pushed, can only be pulled */\n partition: t.string,\n }),\n]);\n\n/** Type override */\nexport type PartitionInput = t.TypeOf<typeof PartitionInput>;\n\nexport const ConsentManagerInput = t.partial({\n /** Airgap version */\n version: t.string,\n /** The consent manager domains in the instance */\n bundleUrls: t.record(valuesOf(ConsentBundleType), t.string),\n /** The consent manager domains in the instance */\n domains: t.array(t.string),\n /** Key used to partition consent records */\n partition: t.string,\n /** Precedence of signals vs user input */\n consentPrecedence: valuesOf(ConsentPrecedenceOption),\n /** The consent manager unknown request policy */\n unknownRequestPolicy: valuesOf(UnknownRequestPolicy),\n /** The consent manager unknown cookie policy */\n unknownCookiePolicy: valuesOf(UnknownRequestPolicy),\n /** The XDI sync endpoint for this airgap bundle */\n syncEndpoint: t.string,\n /** The telemetry partitioning strategy */\n telemetryPartitioning: valuesOf(TelemetryPartitionStrategy),\n /** Whether the site owner has signed the IAB agreement */\n signedIabAgreement: valuesOf(SignedIabAgreementOption),\n /** Regional experience configurations */\n experiences: t.array(ConsentManageExperienceInput),\n /** Theme config */\n theme: t.partial({\n /** Primary color */\n primaryColor: t.string,\n /** Font color */\n fontColor: t.string,\n /** Privacy policy URL */\n privacyPolicy: t.string,\n /** Auto-prompt setting */\n prompt: t.number,\n }),\n // TODO: https://transcend.height.app/T-23919 - reconsider simpler yml shape\n /** The Shared XDI host sync groups config (JSON) for this airgap bundle */\n syncGroups: t.string,\n consentVariants: t.array(ConsentVariantInput),\n consentThemes: t.array(ConsentThemeInput),\n});\n\n/** Type override */\nexport type ConsentManagerInput = t.TypeOf<typeof ConsentManagerInput>;\n\n/**\n * Input to define a privacy center\n */\nexport const PrivacyCenterInput = t.partial({\n /** Whether or not the entire privacy center is enabled or disabled */\n isDisabled: t.boolean,\n /** Whether or not to show the privacy requests button */\n showPrivacyRequestButton: t.boolean,\n /** Whether or not to show the policies page */\n showPolicies: t.boolean,\n /** Whether or not to show the tracking technologies page */\n showTrackingTechnologies: t.boolean,\n /** Whether or not to show the cookies on the tracking technologies page */\n showCookies: t.boolean,\n /** Whether or not to show the data flows on the tracking technologies page */\n showDataFlows: t.boolean,\n /** Whether or not to show the consent manager opt out options on the tracking technologies page */\n showConsentManager: t.boolean,\n /** Whether or not to show the manage your privacy page */\n showManageYourPrivacy: t.boolean,\n /** Whether or not to show the marketing preferences page */\n showMarketingPreferences: t.boolean,\n /** What languages are supported for the privacy center */\n locales: t.array(valuesOf(LOCALE_KEY)),\n /** The default locale for the privacy center */\n defaultLocale: valuesOf(LOCALE_KEY),\n /** Whether or not to prefer the browser default locale */\n preferBrowserDefaultLocale: t.boolean,\n /** The email addresses of the employees within your company that are the go-to individuals for managing this privacy center */\n supportEmail: t.string,\n /** The email addresses of the employees within your company that are the go-to individuals for managing this privacy center */\n replyToEmail: t.string,\n /** Whether or not to send emails from a no reply email */\n useNoReplyEmailAddress: t.boolean,\n /** Whether or not to use a custom email domain */\n useCustomEmailDomain: t.boolean,\n /** Whether or not to transcend access requests from JSON to CSV */\n transformAccessReportJsonToCsv: t.boolean,\n /**\n * Privacy Center \"home\" / back-to-site link URL shown in the privacy center\n * header\n */\n home: t.string,\n /** Whether the side menu is expanded by default on the privacy center */\n expandSideMenuByDefault: t.boolean,\n /**\n * Whether custom fields are required when submitting privacy requests from\n * the privacy center workflows UI\n */\n workflowsCustomFieldsRequired: t.boolean,\n /**\n * Child organization URIs (or IDs) to display on a unified multi-brand\n * privacy center. Resolved to organization IDs on push.\n */\n displayedChildOrganizationUris: t.array(t.string),\n /** Footer layout for privacy center footer links */\n footerLayout: valuesOf(PrivacyCenterFooterLayout),\n /**\n * Footer links displayed on the privacy center. Matched by title on push;\n * links omitted from this list are deleted.\n */\n footerLinks: t.array(\n t.intersection([\n t.type({\n /** Link title (default locale) */\n title: t.string,\n }),\n t.partial({\n /** Link URL (default locale); optional for icon-only links */\n url: t.string,\n /**\n * When true with an icon set, render as icon-only (title is used for\n * accessibility). When false with an icon set, render icon beside the\n * visible label.\n */\n iconOnly: t.boolean,\n }),\n ]),\n ),\n /** The theme object of colors to display on the privacy center */\n theme: t.partial({\n /** The theme colors */\n colors: t.partial(applyEnum(ConfigurableColorPaletteColor, () => t.string)),\n /** Styles to apply to components */\n componentStyles: PrivacyCenterComponentStyles,\n /** Override styles */\n textStyles: PrivacyCenterTextStyles,\n }),\n});\n\n/** Type override */\nexport type PrivacyCenterInput = t.TypeOf<typeof PrivacyCenterInput>;\n\n/**\n * Input to define a policy\n */\nexport const PolicyInput = t.intersection([\n t.type({\n /** The title of the policy */\n title: t.string,\n }),\n t.partial({\n /**\n * Policy type. On create, defaults from title\n * (Privacy Policy / Cookie Policy / CUSTOM).\n */\n type: valuesOf(PolicyType),\n /** Effective date of policy */\n effectiveOn: t.string,\n /** Whether or not to disable the effective date */\n disableEffectiveOn: t.boolean,\n /** Content of the policy */\n content: t.string,\n /** The languages for which the policy is disabled for */\n disabledLocales: t.array(valuesOf(LOCALE_KEY)),\n }),\n]);\n\n/** Type override */\nexport type PolicyInput = t.TypeOf<typeof PolicyInput>;\n\n/**\n * Input to define an internationalized message defined in Transcend\n */\nexport const IntlMessageInput = t.intersection([\n t.type({\n /** The ID of the message */\n id: t.string,\n }),\n t.partial({\n /** The hard-coded ID that the message refers to in the Privacy Center or Consent Manager UI, null if message is dynamic */\n targetReactIntlId: t.string,\n /** The description of the message */\n description: t.string,\n /** The default message to use */\n defaultMessage: t.string,\n /** The translations */\n translations: t.partial(applyEnum(LOCALE_KEY, () => t.string)),\n }),\n]);\n\n/** Type override */\nexport type IntlMessageInput = t.TypeOf<typeof IntlMessageInput>;\n\n/**\n * A set of deletion dependencies, either global (when `workflow` is omitted)\n * or scoped to a single DSR workflow.\n *\n * An empty `titles` list scoped to a workflow is an explicit override, meaning\n * that workflow runs the data silo with no dependencies at all.\n */\nexport const DeletionDependency = t.intersection([\n t.type({\n /**\n * The titles of the data silos that must be deleted from first. This list can contain\n * other internal systems defined in this file, as well as any of the SaaS tools connected\n * in your Transcend instance.\n */\n titles: t.array(t.string),\n }),\n t.partial({\n /**\n * The internal name of the DSR workflow that these dependencies override the global\n * configuration for. Omit to declare the global configuration.\n */\n workflow: t.string,\n }),\n]);\n\n/** Type override */\nexport type DeletionDependency = t.TypeOf<typeof DeletionDependency>;\n\n/**\n * Removes a workflow's deletion dependency override so that the workflow falls back\n * to the global configuration.\n */\nexport const DeletionDependencyReset = t.type({\n /** The internal name of the DSR workflow to remove the override from */\n workflow: t.string,\n /** Must be `true`; declares that the override should be removed */\n 'reset-to-global': t.literal(true),\n});\n\n/** Type override */\nexport type DeletionDependencyReset = t.TypeOf<typeof DeletionDependencyReset>;\n\n/**\n * A single object entry in a data silo's `deletion-dependencies` list.\n * Global dependencies are written as `{ titles: [...] }`; per-workflow overrides\n * include a `workflow` key.\n */\nexport const DeletionDependencyInput = t.union([DeletionDependency, DeletionDependencyReset]);\n\n/** Type override */\nexport type DeletionDependencyInput = t.TypeOf<typeof DeletionDependencyInput>;\n\n/**\n * The `deletion-dependencies` field for a data silo.\n *\n * Prefer a list of objects: `{ titles: [...] }` for the global configuration and\n * `{ workflow, titles }` or `{ workflow, reset-to-global: true }` for each override.\n * A bare list of titles is still accepted for global-only configuration. Mixing\n * titles and objects in the same list is not allowed.\n */\nexport const DeletionDependencies = t.union([t.array(t.string), t.array(DeletionDependencyInput)]);\n\n/** Type override */\nexport type DeletionDependencies = t.TypeOf<typeof DeletionDependencies>;\n\n/**\n * Input to define a data silo\n *\n * Define the data silos in your data map. A data silo can be a database,\n * or a web service that may use a collection of different data stores under the hood.\n *\n * @see https://docs.transcend.io/docs/the-data-map#data-silos\n */\nexport const DataSiloInput = t.intersection([\n t.type({\n /** The display title of the data silo */\n title: t.string,\n /**\n * The type of integration. Common internal system types:\n * server | database | cron | promptAPerson\n */\n integrationName: t.string,\n }),\n t.partial({\n /** For prompt a person or database integrations, the underlying integration name */\n 'outer-type': t.string,\n /** A description for that data silo */\n description: t.string,\n /** The webhook URL to notify for data privacy requests */\n url: t.string,\n /** The title of the API key that will be used to respond to privacy requests */\n 'api-key-title': t.string,\n /**\n * The ID of the configured Sombra instance that processes privacy requests for this data silo.\n * Useful for multi-Sombra organizations. Pull/push via `transcend inventory pull` / `push`.\n */\n 'sombra-id': t.string,\n /** Custom headers to include in outbound webhook */\n headers: t.array(WebhookHeader),\n /**\n * Specify which data subjects may have personally-identifiable-information (PII) within this system\n * This field can be omitted, and the default assumption will be that the system may potentially\n * contain PII for any potential data subject type.\n */\n 'data-subjects': t.array(t.string),\n /**\n * When this data silo implements a privacy request, these are the identifiers\n * that should be looked up within this system.\n */\n 'identity-keys': t.array(t.string),\n /**\n * When a data erasure request is being performed, this data silo should not be deleted from\n * until all of the following data silos were deleted first. This list can contain other internal\n * systems defined in this file, as well as any of the SaaS tools connected in your Transcend instance.\n *\n * Prefer a list of objects: `{ titles: [...] }` for the global configuration and\n * `{ workflow, titles }` (or `{ workflow, reset-to-global: true }`) for each override.\n * A bare list of titles is still accepted for global-only configuration. Workflows that\n * are not listed keep whatever configuration they already have.\n */\n 'deletion-dependencies': DeletionDependencies,\n /**\n * The email addresses of the employees within your company that are the go-to individuals\n * for managing this data silo\n */\n owners: t.array(t.string),\n /**\n * The names of teams within your Transcend instance that should be responsible\n * for managing this data silo.\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n /**\n * Specify this flag if the data silo is under development and should not be included\n * in production privacy request workflows. Will still sync metadata to app.transcend.io.\n */\n disabled: t.boolean,\n /**\n * Datapoints defined within this data silo, see comment of `DatapointInput`\n * for further details.\n */\n datapoints: t.array(DatapointInput),\n /**\n * Configure email notification settings for privacy requests\n */\n 'email-settings': PromptAVendorEmailSettings,\n /** Country of data silo hosting */\n country: valuesOf(IsoCountryCode),\n /** Sub-division of data silo hosting */\n countrySubDivision: valuesOf(IsoCountrySubdivisionCode),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n /**\n * The business entities associated with this data silo\n */\n businessEntityTitles: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type DataSiloInput = t.TypeOf<typeof DataSiloInput>;\n\nexport const ActionItemCollectionInput = t.intersection([\n t.type({\n /** The display title of the enricher */\n title: t.string,\n /** Locations where collection is shown */\n productLine: valuesOf(TranscendProduct),\n }),\n t.partial({\n /** Description of collection */\n description: t.string,\n /** Whether hidden */\n hidden: t.boolean,\n }),\n]);\n\n/** Type override */\nexport type ActionItemCollectionInput = t.TypeOf<typeof ActionItemCollectionInput>;\n\n/**\n * Input to define an action item\n */\nexport const ActionItemInput = t.intersection([\n t.type({\n /** The display title of the enricher */\n title: t.string,\n /** Action item type */\n type: valuesOf(ActionItemCode),\n /** The titles of the collections that the action item is grouped within */\n collections: t.array(t.string),\n }),\n t.partial({\n /** Priority of the action item */\n priority: valuesOf(ActionItemPriorityOverride),\n /** Customer experience action item key */\n customerExperienceActionItemId: t.string,\n /** Due date of the action item */\n dueDate: t.string,\n /** Whether action item has been resolved */\n resolved: t.boolean,\n /** Notes */\n notes: t.string,\n /** Links to action items */\n link: t.string,\n /**\n * The email addresses of the employees assigned to the action item\n */\n users: t.array(t.string),\n /**\n * The names of teams assigned to the action item\n *\n * @see https://docs.transcend.io/docs/security/access-control#teams\n * for more information about how to create and manage teams\n */\n teams: t.array(t.string),\n /**\n * Attribute value and its corresponding attribute key\n */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/** Type override */\nexport type ActionItemInput = t.TypeOf<typeof ActionItemInput>;\n\nexport const AssessmentRuleInput = t.intersection([\n t.type({\n /** The reference id of the question whose answer is compared by this rule */\n 'depends-on-question-reference-id': t.string,\n /** The operator to use when comparing the question answer to the operands */\n 'comparison-operator': valuesOf(ComparisonOperator),\n }),\n t.partial({\n /** The values to compare the question answer to */\n 'comparison-operands': t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type AssessmentRuleInput = t.TypeOf<typeof AssessmentRuleInput>;\n\nexport interface AssessmentNestedRuleInput {\n /** The operator to use when comparing the nested rules */\n 'logic-operator': LogicOperator;\n /** The rules to evaluate and be compared with to other using the LogicOperator */\n rules?: AssessmentRuleInput[];\n /** The nested rules to add one more level of nesting to the rules. They are also compared to each other. */\n 'nested-rules'?: AssessmentNestedRuleInput[];\n}\n\nexport const AssessmentNestedRuleInput: t.RecursiveType<t.Type<AssessmentNestedRuleInput>> =\n t.recursion('AssessmentNestedRuleInput', (self) =>\n t.intersection([\n t.type({\n /** The operator to use when comparing the nested rules */\n 'logic-operator': valuesOf(LogicOperator),\n }),\n t.partial({\n /** The rules to evaluate and be compared with to other using the LogicOperator */\n rules: t.array(AssessmentRuleInput),\n /** The nested rules to add one more level of nesting to the rules. They are also compared to each other. */\n 'nested-rules': t.array(self),\n }),\n ]),\n );\n\nexport const AssessmentDisplayLogicInput = t.intersection([\n t.type({\n /** The display logic type */\n action: valuesOf(AssessmentsDisplayLogicAction),\n }),\n t.partial({\n /** The rule to evaluate */\n rule: AssessmentRuleInput,\n /** The nested rule to evaluate */\n 'nested-rule': AssessmentNestedRuleInput,\n }),\n]);\n\n/** Type override */\nexport type AssessmentDisplayLogicInput = t.TypeOf<typeof AssessmentDisplayLogicInput>;\n\nexport const RiskAssignmentInput = t.partial({\n /** The risk level to assign to the question */\n 'risk-level': t.string,\n /** The risk matrix column to assign to a question. */\n 'risk-matrix-column': t.string,\n /** The risk matrix row to assign to a question. */\n 'risk-matrix-row': t.string,\n});\n\n/** Type override */\nexport type RiskAssignmentInput = t.TypeOf<typeof RiskAssignmentInput>;\n\nexport const RiskLogicInput = t.intersection([\n t.type({\n /** The values to compare */\n 'comparison-operands': t.array(t.string),\n /** The operator */\n 'comparison-operator': valuesOf(ComparisonOperator),\n }),\n t.partial({\n /** The risk level to assign to the question */\n 'risk-level': t.string,\n /** The risk matrix column to assign to a question. */\n 'risk-matrix-column': t.string,\n /** The risk matrix row to assign to a question. */\n 'risk-matrix-row': t.string,\n }),\n]);\n\n/** Type override */\nexport type RiskLogicInput = t.TypeOf<typeof RiskLogicInput>;\n\nexport const AssessmentAnswerOptionInput = t.type({\n /** Value of answer */\n value: t.string,\n});\n\n/** Type override */\nexport type AssessmentAnswerOptionInput = t.TypeOf<typeof AssessmentAnswerOptionInput>;\n\nexport const AssessmentSectionQuestionInput = t.intersection([\n t.type({\n /** The title of the assessment section question */\n title: t.string,\n /** The question type */\n type: valuesOf(AssessmentQuestionType),\n }),\n t.partial({\n /** The sub-type of the assessment question */\n 'sub-type': valuesOf(AssessmentQuestionSubType),\n /** The question placeholder */\n placeholder: t.string,\n /** The question description */\n description: t.string,\n /** Whether an answer is required */\n 'is-required': t.boolean,\n /** Used to identify the question within a form or template so it can be referenced in conditional logic. */\n 'reference-id': t.string,\n /** Display logic for the question */\n 'display-logic': AssessmentDisplayLogicInput,\n /** Risk logic for the question */\n 'risk-logic': t.array(RiskLogicInput),\n /** Risk category titles for the question */\n 'risk-categories': t.array(t.string),\n /** Risk framework titles for the question */\n 'risk-framework': t.string,\n /** Answer options for the question */\n 'answer-options': t.array(AssessmentAnswerOptionInput),\n /** The selected answers to the assessments */\n 'selected-answers': t.array(t.string),\n /** Allowed MIME types for the question */\n 'allowed-mime-types': t.array(t.string),\n /** Allow selecting other options */\n 'allow-select-other': t.boolean,\n /** Sync model for the question */\n 'sync-model': valuesOf(AssessmentSyncModel),\n /** Sync column for the question */\n 'sync-column': valuesOf(AssessmentSyncColumn),\n /** Attribute key / custom field name for the question */\n 'attribute-key': t.string,\n /** Require risk evaluation for the question */\n 'require-risk-evaluation': t.boolean,\n /** Require risk matrix evaluation for the question */\n 'require-risk-matrix-evaluation': t.boolean,\n }),\n]);\n\n/** Type override */\nexport type AssessmentSectionQuestionInput = t.TypeOf<typeof AssessmentSectionQuestionInput>;\n\nexport const AssessmentSectionInput = t.intersection([\n t.type({\n /** The title of the assessment section */\n title: t.string,\n /** The questions in the assessment section */\n questions: t.array(AssessmentSectionQuestionInput),\n }),\n t.partial({\n /** Email address of those assigned */\n assignees: t.array(t.string),\n /** Email address of those externally assigned */\n 'external-assignees': t.array(t.string),\n /** Status of section */\n status: t.string,\n /** Whether assessment is reviewed */\n 'is-reviewed': t.boolean,\n }),\n]);\n\n/** Type override */\nexport type AssessmentSectionInput = t.TypeOf<typeof AssessmentSectionInput>;\n\nexport const AssessmentRetentionScheduleInput = t.type({\n /** The retention schedule type */\n type: valuesOf(RetentionScheduleType),\n /** The duration of the retention schedule in days */\n 'duration-days': t.number,\n /** The operation to perform on the retention schedule */\n operand: valuesOf(RetentionScheduleOperation),\n});\n\n/** Type override */\nexport type AssessmentRetentionScheduleInput = t.TypeOf<typeof AssessmentRetentionScheduleInput>;\n\nexport const AssessmentTemplateInput = t.intersection([\n t.type({\n /** The title of the assessment template */\n title: t.string,\n }),\n t.partial({\n /** The Assessment sections under this assessment template */\n sections: t.array(AssessmentSectionInput),\n /** Description of assessment template */\n description: t.string,\n /** The status of the assessment */\n status: valuesOf(AssessmentFormTemplateStatus),\n /** The source of the assessment */\n source: valuesOf(AssessmentFormTemplateSource),\n /** The email of the user that created the assessment */\n creator: t.string,\n /** Whether the template is in a locked status */\n locked: t.boolean,\n /** ID of parent template this was cloned from */\n 'parent-id': t.string,\n /** Whether the template is archived */\n archived: t.boolean,\n /** The date that the assessment was created */\n 'created-at': t.string,\n /** The names of the custom fields associated to this assessment template */\n 'attribute-keys': t.array(t.string),\n /** The retention schedule configuration */\n 'retention-schedule': AssessmentRetentionScheduleInput,\n /** The titles of the email templates used in the assessment template */\n templates: t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type AssessmentTemplateInput = t.TypeOf<typeof AssessmentTemplateInput>;\n\nexport const AssessmentResourceInput = t.type({\n /** The title of the resource */\n title: t.string,\n /** The type of the resource */\n type: valuesOf(AttributeSupportedResourceType),\n});\n\n/** Type override */\nexport type AssessmentResourceInput = t.TypeOf<typeof AssessmentResourceInput>;\n\nexport const AssessmentInput = t.intersection([\n t.type({\n /** The title of the assessment */\n title: t.string,\n /** The title of the assessment group */\n group: t.string,\n }),\n t.partial({\n /** The assessment sections */\n sections: t.array(AssessmentSectionInput),\n /** The email of the user that created the assessment */\n creator: t.string,\n /** The description of the assessment */\n description: t.string,\n /** The status of the assessment */\n status: valuesOf(AssessmentFormStatus),\n /** The emails of the transcend users assigned to the assessment */\n assignees: t.array(t.string),\n /** The emails of the external emails assigned to the assessment */\n 'external-assignees': t.array(t.string),\n /** The emails of the assessment reviewers */\n reviewers: t.array(t.string),\n /** Whether the assessment is in a locked status */\n locked: t.boolean,\n /** Whether the assessment is archived */\n archived: t.boolean,\n /** Whether the form is created by an external user */\n external: t.boolean,\n /**\n * Whether the form title is an internal label only, and the group title should be used in communications with assignees\n */\n 'title-is-internal': t.boolean,\n /** The date that the assessment is due */\n 'due-date': t.string,\n /** The date that the assessment was created */\n 'created-at': t.string,\n /** The date that the assessment was assigned at */\n 'assigned-at': t.string,\n /** The date that the assessment was submitted at */\n 'submitted-at': t.string,\n /** The date that the assessment was approved at */\n 'approved-at': t.string,\n /** The date that the assessment was rejected at */\n 'rejected-at': t.string,\n /** The linked data inventory resources */\n resources: t.array(AssessmentResourceInput),\n /** The linked data inventory synced rows */\n rows: t.array(AssessmentResourceInput),\n /** The assessment retention schedule */\n 'retention-schedule': AssessmentRetentionScheduleInput,\n /** The assessment custom fields */\n attributes: t.array(AttributePreview),\n }),\n]);\n\n/** Type override */\nexport type AssessmentInput = t.TypeOf<typeof AssessmentInput>;\n\nexport const ConsentPreferenceTopicOptionValue = t.type({\n /** Title of option value */\n title: t.string,\n /** API slug */\n slug: t.string,\n});\n\n/** Type override */\nexport type ConsentPreferenceTopicOptionValue = t.TypeOf<typeof ConsentPreferenceTopicOptionValue>;\n\nexport const ConsentPreferenceTopic = t.intersection([\n t.type({\n /** The type of the preference topic */\n type: valuesOf(PreferenceTopicType),\n /** The title of the preference topic */\n title: t.string,\n /** The description of the preference topic */\n description: t.string,\n /** API slug for the preference topic (PascalCase; alphabetical letters only) */\n slug: t.string,\n }),\n t.partial({\n /** Hex color for the preference topic (pull-only; not writable via CLI push today) */\n color: t.string,\n /** Default value */\n 'default-configuration': t.string,\n /** Whether the preference topic is shown in privacy center */\n 'show-in-privacy-center': t.boolean,\n /** The options when type is single or multi select */\n options: t.array(ConsentPreferenceTopicOptionValue),\n }),\n]);\n\n/** Type override */\nexport type ConsentPreferenceTopic = t.TypeOf<typeof ConsentPreferenceTopic>;\n\nexport const ConsentPurpose = t.intersection([\n t.type({\n /** Consent purpose slug */\n trackingType: t.string,\n /** The title of the tracking purpose that appears in Consent Management and Privacy Center UIs */\n title: t.string,\n /** The display name of this tracking purpose */\n name: t.string,\n }),\n t.partial({\n /** Description of purpose */\n description: t.string,\n /** Whether purpose is active */\n 'is-active': t.boolean,\n /** Whether purpose is configurable */\n configurable: t.boolean,\n /** Display order of purpose for privacy center */\n 'display-order': t.number,\n /** Whether purpose is shown in privacy center */\n 'show-in-privacy-center': t.boolean,\n /** Whether purpose is show in consent manger */\n 'show-in-consent-manager': t.boolean,\n /** The preference topics configured for the purpose */\n 'preference-topics': t.array(ConsentPreferenceTopic),\n /** Authentication level for purpose on privacy center */\n 'auth-level': valuesOf(PreferenceStoreAuthLevel),\n /** Opt out signals that should instantly opt out of this purpose */\n 'opt-out-signals': t.array(valuesOf(UserPrivacySignalEnum)),\n /** Default consent value */\n 'default-consent': valuesOf(DefaultConsentOption),\n }),\n]);\n\n/** Type override */\nexport type ConsentPurpose = t.TypeOf<typeof ConsentPurpose>;\n\n/**\n * Input for a purpose associated with a preference workflow config\n */\nexport const PreferenceWorkflowConfigPurposeInput = t.type({\n /** The tracking type slug of the purpose */\n 'tracking-type': t.string,\n /** The matching consent state for the purpose */\n 'matching-state': t.boolean,\n});\n\n/** Type override */\nexport type PreferenceWorkflowConfigPurposeInput = t.TypeOf<\n typeof PreferenceWorkflowConfigPurposeInput\n>;\n\n/**\n * Input to define a preference workflow config.\n * Purposes are the source of truth; triggerCondition is derived on push\n * (same as Workflows → Preference Workflows in the admin dashboard).\n *\n * Exactly one mode per config:\n * - Legacy: action-type (+ optional data-silo-titles), no workflow-title\n * - V2: workflow-title (DSR workflow display title), no action-type / data-silo-titles\n */\nexport const PreferenceWorkflowConfigInput = t.intersection([\n t.type({\n /** The name of the preference workflow config */\n name: t.string,\n /**\n * Purposes and their matching consent states.\n * Used to derive triggerCondition as `{ And: [{ [tracking-type]: matching-state }, ...] }`.\n */\n purposes: t.array(PreferenceWorkflowConfigPurposeInput),\n }),\n t.partial({\n /**\n * DSR workflow display title (internalName when set, else external title).\n * Workflows V2 mode — mutually exclusive with action-type / data-silo-titles.\n */\n 'workflow-title': t.string,\n /** The action type (e.g. ERASURE, ACCESS). Legacy mode; required when creating without workflow-title. */\n 'action-type': valuesOf(RequestAction),\n /** The data subject type slug (e.g. customer) */\n 'data-subject-type': t.string,\n /** Whether the config runs silently */\n 'is-silent': t.boolean,\n /** Whether unauthenticated requests are allowed */\n 'allow-unauthenticated': t.boolean,\n /** Whether the config is active */\n 'is-active': t.boolean,\n /** Titles of data silos associated with this config (legacy mode only) */\n 'data-silo-titles': t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type PreferenceWorkflowConfigInput = t.TypeOf<typeof PreferenceWorkflowConfigInput>;\n\n/**\n * Input to define a workflow config. Push matches using a cascading key\n * (internal-name → title → action-type → data-subject-type → region-list) and\n * creates the workflow when no match exists (DSR only).\n */\nexport const WorkflowConfigInput = t.intersection([\n t.type({\n /** User-facing title */\n title: t.string,\n /** Request action type */\n 'action-type': valuesOf(RequestAction),\n }),\n t.partial({\n /**\n * Internal name of the workflow config. When provided, used as the first\n * match key on push.\n */\n 'internal-name': t.string,\n /** Subtitle */\n subtitle: t.string,\n /** Description */\n description: t.string,\n /** Data subject type */\n 'data-subject-type': t.string,\n /** Visibility tier */\n visibility: valuesOf(WorkflowConfigVisibility),\n /** Workflow config type (read-only on pull; included for reference) */\n type: valuesOf(WorkflowConfigType),\n /** Whether to collect the data subject's region during intake */\n 'collect-data-subject-regions': valuesOf(CollectDataSubjectRegions),\n /** Region allow list */\n 'region-list': t.array(valuesOf({ ...IsoCountryCode, ...IsoCountrySubdivisionCode })),\n /** Per-region request expiry times */\n 'expiry-time': t.array(\n t.type({\n /** Region code (or 'default') */\n region: valuesOf({ default: 'default', ...IsoCountryCode, ...IsoCountrySubdivisionCode }),\n /** Expiry time in days */\n value: t.number,\n }),\n ),\n /** Attribute key (custom field) names to associate with the workflow */\n 'attribute-keys': t.array(t.string),\n }),\n]);\n\n/** Type override */\nexport type WorkflowConfigInput = t.TypeOf<typeof WorkflowConfigInput>;\n\n/**\n * Input to define a silo discovery results\n *\n * @see https://docs.transcend.io/docs/silo-discovery\n */\nexport const SiloDiscoveryResultInput = t.intersection([\n t.type({\n /** The unique identifier for the resource */\n resourceId: t.string,\n /** The plugin that found this results */\n plugin: t.string, // Assuming Plugin is a string, replace with appropriate type if necessary\n /** The suggested catalog for this results */\n suggestedCatalog: t.string,\n /** The likelihood that data is sensitive for this results */\n containsSensitiveData: t.string,\n /** The status of silo discovery triage */\n status: t.string,\n }),\n t.partial({\n /** The ISO country code for the AWS Region if applicable */\n country: valuesOf(IsoCountryCode),\n /** The ISO country subdivision code for the AWS Region if applicable */\n countrySubDivision: valuesOf(IsoCountrySubdivisionCode),\n /** The plaintext that we will pass into results */\n plaintextContext: t.string,\n /** The custom title of the data silo results */\n title: t.union([t.string, t.null]),\n }),\n]);\n\n/** Type override */\nexport type SiloDiscoveryResultInput = t.TypeOf<typeof SiloDiscoveryResultInput>;\n\nexport const TranscendInput = t.partial({\n /**\n * Action items\n */\n 'action-items': t.array(ActionItemInput),\n /**\n * Action item collections\n */\n 'action-item-collections': t.array(ActionItemCollectionInput),\n /**\n * API key definitions\n */\n 'api-keys': t.array(ApiKeyInput),\n /** Team definitions */\n teams: t.array(TeamInput),\n /**\n * Email template definitions\n */\n templates: t.array(TemplateInput),\n /**\n * Preflight check definitions\n */\n preflights: t.array(PreflightInput),\n /**\n * @deprecated Use `preflights` instead. Kept for legacy transcend.yml support.\n */\n enrichers: t.array(PreflightInput),\n /**\n * Attribute definitions\n */\n attributes: t.array(AttributeInput),\n /**\n * Business entity definitions\n */\n 'business-entities': t.array(BusinessEntityInput),\n /**\n * Vendor definitions\n */\n vendors: t.array(VendorInput),\n /**\n * Data categories definitions\n */\n 'data-categories': t.array(DataCategoryInput),\n /**\n * Vendor definitions\n */\n 'processing-purposes': t.array(ProcessingPurposeInput),\n /**\n * Data subject definitions\n */\n 'data-subjects': t.array(DataSubjectInput),\n /**\n * Action definitions\n */\n actions: t.array(ActionInput),\n /**\n * Identifier definitions\n */\n identifiers: t.array(IdentifierInput),\n /**\n * Data silo definitions\n */\n 'data-silos': t.array(DataSiloInput),\n /**\n * Data flow definitions\n */\n 'data-flows': t.array(DataFlowInput),\n /**\n * Cookie definitions\n */\n cookies: t.array(CookieInput),\n /**\n * Consent manager definition\n */\n 'consent-manager': ConsentManagerInput,\n /**\n * The privacy center configuration\n */\n 'privacy-center': PrivacyCenterInput,\n /**\n * The policies configuration\n */\n policies: t.array(PolicyInput),\n /**\n * The internationalized messages configuration\n */\n messages: t.array(IntlMessageInput),\n /** The full list of consent manager partitions (e.g. dev vs staging vs prod) */\n partitions: t.array(PartitionInput),\n /**\n * The full list of assessment templates\n */\n 'assessment-templates': t.array(AssessmentTemplateInput),\n /**\n * The full list of assessment results\n */\n assessments: t.array(AssessmentInput),\n /**\n * Processing activity definitions\n */\n 'processing-activities': t.array(ProcessingActivityInput),\n /**\n * Consent and preference management purposes\n */\n purposes: t.array(ConsentPurpose),\n /**\n * The full list of silo discovery results\n */\n 'system-discovery': t.array(SiloDiscoveryResultInput),\n /**\n * Preference workflow config definitions (Workflows → Preference Workflows)\n */\n 'preference-workflow-configs': t.array(PreferenceWorkflowConfigInput),\n /**\n * DSR workflow config settings (create or update via cascading match key)\n */\n 'workflow-configs': t.array(WorkflowConfigInput),\n /**\n * Preference management options for multi and single selects\n */\n 'preference-options': t.array(ConsentPreferenceTopicOptionValue),\n});\n\n/** Type override */\nexport type TranscendInput = t.TypeOf<typeof TranscendInput>;\n\n/**\n * Fold legacy `enrichers` into `preflights` and drop the deprecated key.\n *\n * @param input - Parsed transcend.yml contents\n * @returns Input with only the canonical `preflights` key\n */\nexport function normalizeTranscendInput(input: TranscendInput): TranscendInput {\n const { enrichers, preflights, ...rest } = input;\n if (enrichers === undefined && preflights === undefined) {\n return input;\n }\n return {\n ...rest,\n preflights: [...(preflights ?? []), ...(enrichers ?? [])],\n };\n}\n\n/**\n * The output of `tr-generate-api-keys` that can be provided to `tr-push`\n */\nexport const StoredApiKey = t.type({\n /** Name of instance */\n organizationName: t.string,\n /** API key */\n apiKey: t.string,\n /** Organization ID API key is for */\n organizationId: t.string,\n});\n\n/** Type override */\nexport type StoredApiKey = t.TypeOf<typeof StoredApiKey>;\n\n/**\n * Minimal set required to mark as completed\n */\nexport const DataFlowCsvInput = t.intersection([\n t.type({\n /** The value of the data flow (host or regex) */\n 'Connections Made To': t.string,\n /** The type of the data flow */\n Type: valuesOf(DataFlowScope),\n /** The CSV of purposes mapped to that data flow */\n Purpose: t.string,\n }),\n t.partial({\n /** The service that the data flow relates to */\n Service: t.string,\n /** Notes and descriptions for the data flow */\n Notes: t.string,\n /** Set of data flow owners */\n Owners: t.string,\n /** Set of data flow team owners */\n Teams: t.string,\n /** LIVE vs NEEDS_REVIEW aka Approved vs Triage */\n Status: valuesOf(ConsentTrackerStatus),\n }),\n // Custom attributes\n t.record(t.string, t.string),\n]);\n\n/** Type override */\nexport type DataFlowCsvInput = t.TypeOf<typeof DataFlowCsvInput>;\n\nexport const CookieCsvInput = t.intersection([\n t.type({\n /** The value of the cookie */\n Name: t.string,\n /** The CSV of purposes mapped to that cookie */\n Purpose: t.string,\n }),\n t.partial({\n /** The service that the cookie relates to */\n Service: t.string,\n /** Notes and descriptions for the cookie */\n Notes: t.string,\n /** Set of cookie owners */\n Owners: t.string,\n /** Set of cookie team owners */\n Teams: t.string,\n /** LIVE vs NEEDS_REVIEW aka Approved vs Triage */\n Status: valuesOf(ConsentTrackerStatus),\n }),\n // Custom attributes\n t.record(t.string, t.string),\n]);\n\n/** Type override */\nexport type CookieCsvInput = t.TypeOf<typeof CookieCsvInput>;\n\n/**\n * Export of (await airgap.getMetadata()).services\n */\nexport const ConsentManagerServiceMetadata = t.type({\n /** The title of the service */\n title: t.string,\n /** The description */\n description: t.string,\n /** Cookies */\n cookies: t.array(\n t.type({\n /** Name of cookie */\n name: t.string,\n /** Allowed purposes */\n trackingPurposes: t.array(t.string),\n }),\n ),\n /** Data Flows */\n dataFlows: t.array(\n t.type({\n /** Value of data flow */\n value: t.string,\n /** Type of data flow */\n type: valuesOf(DataFlowScope),\n /** Allowed purposes */\n trackingPurposes: t.array(t.string),\n }),\n ),\n});\n\n/** Type override */\nexport type ConsentManagerServiceMetadata = t.TypeOf<typeof ConsentManagerServiceMetadata>;\n\n/** The columns of a row of a OneTrust Assessment form to import into Transcend. */\nconst OneTrustAssessmentColumnInput = t.intersection([\n t.type({\n /** The title of the column */\n title: t.string,\n }),\n t.partial({\n /** The optional value of the column */\n value: t.string,\n }),\n]);\n\n/** A row with information of the OneTrust assessment form to import into Transcend */\nconst OneTrustAssessmentRowInput = t.type({\n /** A list of columns within this row. */\n columns: t.array(OneTrustAssessmentColumnInput),\n});\n\n/** Input for importing multiple OneTrust assessment forms into Transcend */\nexport const ImportOnetrustAssessmentsInput = t.partial({\n /** 'The rows of the CSV file.' */\n rows: t.array(OneTrustAssessmentRowInput),\n /** 'The json record representing the assessment.' */\n json: t.string,\n});\n/** Type override */\nexport type ImportOnetrustAssessmentsInput = t.TypeOf<typeof ImportOnetrustAssessmentsInput>;\n"],"mappings":"s5DA6EA,MAAa,EAAgB,EAAE,KAAK,CAElC,MAAO,E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,OAEX,MAAO,EAAE,OAET,OAAQ,EAAE,OAEV,MAAO,EAAE,OAET,OAAQ,EAAS,EAAqB,CACvC,CAAC,CAEF,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAC7B,CAAC,CAKW,GAAiB,EAAE,aAAa,CAC3C,EAAE,KAAK,CAEL,KAAM,EAAE,OAER,QAAS,EAAE,OACZ,CAAC,CACF,EAAE,QAAQ,CAER,QAAS,EAAE,OAEX,MAAO,EAAE,OAET,OAAQ,EAAE,OAEV,MAAO,EAAE,OAET,OAAQ,EAAS,EAAqB,CACvC,CAAC,CAEF,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAC7B,CAAC,CAQW,GAAgC,EAAE,KAAK,CAElD,MAAO,EAAE,OAET,YAAa,EAAE,OAEf,QAAS,EAAE,MACT,EAAE,KAAK,CAEL,KAAM,EAAE,OAER,iBAAkB,EAAE,MAAM,EAAE,OAAO,CACpC,CAAC,CACH,CAED,UAAW,EAAE,MACX,EAAE,KAAK,CAEL,MAAO,EAAE,OAET,KAAM,EAAS,EAAc,CAE7B,iBAAkB,EAAE,MAAM,EAAE,OAAO,CACpC,CAAC,CACH,CACF,CAAC,CAMI,GAAgC,EAAE,aAAa,CACnD,EAAE,KAAK,CAEL,MAAO,EAAE,OACV,CAAC,CACF,EAAE,QAAQ,CAER,MAAO,EAAE,OACV,CAAC,CACH,CAAC,CAGI,GAA6B,EAAE,KAAK,CAExC,QAAS,EAAE,MAAM,GAA8B,CAChD,CAAC,CAGW,GAAiC,EAAE,QAAQ,CAEtD,KAAM,EAAE,MAAM,GAA2B,CAEzC,KAAM,EAAE,OACT,CAAC"}
@@ -1,2 +0,0 @@
1
- import{CompletedRequestStatus as e,IsoCountryCode as t,IsoCountrySubdivisionCode as n,RequestAction as r}from"@transcend-io/privacy-types";import{LOCALE_KEY as i}from"@transcend-io/internationalization";import{applyEnum as a,valuesOf as o}from"@transcend-io/type-utils";import*as s from"io-ts";const c=`[NONE]`,l=`[APPLY VALUE TO ALL ROWS]`,u=`<blank>`,d=[`email`,`coreIdentifier`];let f=function(e){return e.Email=`email`,e.CoreIdentifier=`coreIdentifier`,e.RequestType=`requestType`,e.SubjectType=`subjectType`,e.Locale=`locale`,e.Country=`country`,e.CountrySubDivision=`countrySubDivision`,e.RequestStatus=`requestStatus`,e.CreatedAt=`createdAt`,e.DataSiloIds=`dataSiloIds`,e.WorkflowConfigId=`workflowConfigId`,e}({});const p={email:!1,coreIdentifier:!0,requestType:!0,subjectType:!0,requestStatus:!1,createdAt:!1,dataSiloIds:!1,locale:!1,country:!1,countrySubDivision:!1,workflowConfigId:!1},m={requestType:!0,subjectType:!0},h=s.type({columnNames:s.partial(a(f,()=>s.string)),identifierNames:s.record(s.string,s.string),attributeNames:s.record(s.string,s.string),requestTypeToRequestAction:s.record(s.string,o(r)),subjectTypeToSubjectName:s.record(s.string,s.string),languageToLocale:s.record(s.string,o(i)),regionToCountry:s.record(s.string,o({...t,[c]:c})),regionToCountrySubDivision:s.record(s.string,o({...n,[c]:c})),statusToRequestStatus:s.record(s.string,o({...e,[c]:c}))}),g=s.type({id:s.string,link:s.string,rowIndex:s.number,coreIdentifier:s.string,attemptedAt:s.string}),_=s.type({failingRequests:s.array(s.record(s.string,s.any)),successfulRequests:s.array(g),duplicateRequests:s.array(s.type({rowIndex:s.number,coreIdentifier:s.string,attemptedAt:s.string}))});export{_ as a,p as c,h as i,c as l,l as n,f as o,m as r,d as s,u as t,g as u};
2
- //# sourceMappingURL=constants-DlH2vWm_.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-DlH2vWm_.mjs","names":[],"sources":["../src/lib/requests/constants.ts"],"sourcesContent":["import { LOCALE_KEY } from '@transcend-io/internationalization';\nimport {\n CompletedRequestStatus,\n RequestAction,\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n} from '@transcend-io/privacy-types';\nimport { applyEnum, valuesOf } from '@transcend-io/type-utils';\nimport * as t from 'io-ts';\n\nexport const NONE = '[NONE]' as const;\nexport const BULK_APPLY = '[APPLY VALUE TO ALL ROWS]' as const;\nexport const BLANK = '<blank>' as const;\n\n/** These are uploaded at the top level of the request */\nexport const IDENTIFIER_BLOCK_LIST = ['email', 'coreIdentifier'];\n\n/**\n * Column names to map\n */\nexport enum ColumnName {\n /** The title of the email column */\n Email = 'email',\n /** The title of the core identifier column */\n CoreIdentifier = 'coreIdentifier',\n /** The title of the requestType column */\n RequestType = 'requestType',\n /** The title of the subjectType column */\n SubjectType = 'subjectType',\n /** The title of the locale column */\n Locale = 'locale',\n /** The country */\n Country = 'country',\n /** The country sub division */\n CountrySubDivision = 'countrySubDivision',\n /** The title of the requestStatus column */\n RequestStatus = 'requestStatus',\n /** The title of the createdAt column */\n CreatedAt = 'createdAt',\n /** The title of the dataSiloIds column */\n DataSiloIds = 'dataSiloIds',\n /** The title of the workflowConfigId column */\n WorkflowConfigId = 'workflowConfigId',\n}\n\n/** These parameters are required in the Transcend DSR API */\nexport const IS_REQUIRED: { [k in ColumnName]: boolean } = {\n [ColumnName.Email]: false,\n [ColumnName.CoreIdentifier]: true,\n [ColumnName.RequestType]: true,\n [ColumnName.SubjectType]: true,\n [ColumnName.RequestStatus]: false,\n [ColumnName.CreatedAt]: false,\n [ColumnName.DataSiloIds]: false,\n [ColumnName.Locale]: false,\n [ColumnName.Country]: false,\n [ColumnName.CountrySubDivision]: false,\n [ColumnName.WorkflowConfigId]: false,\n};\n\n/** These parameters can be specified for the entire CSV set if needed */\nexport const CAN_APPLY_IN_BULK: { [k in ColumnName]?: boolean } = {\n [ColumnName.RequestType]: true,\n [ColumnName.SubjectType]: true,\n};\n\n// Cache state\nexport const CachedFileState = t.type({\n /** Mapping between the default request input column names and the CSV column name for that input */\n columnNames: t.partial(applyEnum(ColumnName, () => t.string)),\n /** Mapping between the identifier names and the CSV column name for that input */\n identifierNames: t.record(t.string, t.string),\n /** Mapping between the request attribute inputs and the CSV column name for that input */\n attributeNames: t.record(t.string, t.string),\n /** Mapping between CSV request type and Transcend Request Action */\n requestTypeToRequestAction: t.record(t.string, valuesOf(RequestAction)),\n /** Mapping between CSV data subject type and the name of the data subject in Transcend */\n subjectTypeToSubjectName: t.record(t.string, t.string),\n /** Mapping between language imported and Transcend locale code */\n languageToLocale: t.record(t.string, valuesOf(LOCALE_KEY)),\n /** Mapping between region and country code */\n regionToCountry: t.record(t.string, valuesOf({ ...IsoCountryCode, [NONE]: NONE })),\n /** Mapping between region and country sub division code */\n regionToCountrySubDivision: t.record(\n t.string,\n valuesOf({ ...IsoCountrySubdivisionCode, [NONE]: NONE }),\n ),\n /** Mapping between request status in import to Transcend request status */\n statusToRequestStatus: t.record(t.string, valuesOf({ ...CompletedRequestStatus, [NONE]: NONE })),\n});\n\n/** Type override */\nexport type CachedFileState = t.TypeOf<typeof CachedFileState>;\n\n/**\n * Successfully processed request\n */\nexport const SuccessfulRequest = t.type({\n id: t.string,\n link: t.string,\n rowIndex: t.number,\n coreIdentifier: t.string,\n attemptedAt: t.string,\n});\n\n/** Type override */\nexport type SuccessfulRequest = t.TypeOf<typeof SuccessfulRequest>;\n\n// Cache state\nexport const CachedRequestState = t.type({\n /** Set of privacy requests that failed to upload */\n failingRequests: t.array(t.record(t.string, t.any)),\n /** Successfully uploaded requests */\n successfulRequests: t.array(SuccessfulRequest),\n /** Duplicate requests */\n duplicateRequests: t.array(\n t.type({\n rowIndex: t.number,\n coreIdentifier: t.string,\n attemptedAt: t.string,\n }),\n ),\n});\n\n/** Type override */\nexport type CachedRequestState = t.TypeOf<typeof CachedRequestState>;\n"],"mappings":"sSAUA,MAAa,EAAO,SACP,EAAa,4BACb,EAAQ,UAGR,EAAwB,CAAC,QAAS,iBAAiB,CAKhE,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,MAAA,QAEA,EAAA,eAAA,iBAEA,EAAA,YAAA,cAEA,EAAA,YAAA,cAEA,EAAA,OAAA,SAEA,EAAA,QAAA,UAEA,EAAA,mBAAA,qBAEA,EAAA,cAAA,gBAEA,EAAA,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.mjs";import{a as t,i as n}from"./request-BpKyN9Xm.mjs";import{IsoCountryCode as r,IsoCountrySubdivisionCode as i,RequestAction as a,RequestOrigin as o,RequestStatus as s}from"@transcend-io/privacy-types";import c from"colors";import{LOCALE_KEY as l}from"@transcend-io/internationalization";import{valuesOf as u}from"@transcend-io/type-utils";import*as d from"io-ts";import{makeGraphQLRequest as f}from"@transcend-io/sdk";import p from"cli-progress";const m=d.type({title:d.string,name:d.string,consent:d.boolean,enrichedPreferences:d.array(d.type({topic:d.string,selectValues:d.array(d.type({id:d.string,name:d.string,preferenceOption:d.type({id:d.string,slug:d.string,title:d.type({defaultMessage:d.string})})})),selectValue:d.type({id:d.string,name:d.string}),preferenceTopic:d.type({title:d.type({defaultMessage:d.string}),id:d.string,slug:d.string}),name:d.string,id:d.string,booleanValue:d.boolean}))}),h=d.intersection([d.type({id:d.string,createdAt:d.string,email:d.string,type:u(a),link:d.string,isSilent:d.boolean,origin:u(o),isTest:d.boolean,coreIdentifier:d.string,details:d.string,locale:u(l),status:u(s),subjectType:d.string,country:d.union([d.null,u(r)]),countrySubDivision:d.union([d.null,u(i)]),attributeValues:d.array(d.type({id:d.string,attributeKey:d.type({name:d.string,id:d.string}),name:d.string}))}),d.partial({daysRemaining:d.union([d.null,d.number]),successfullyCompletedAt:d.union([d.null,d.string]),purpose:m})]);async function g(n,r){let{requests:{totalCount:i}}=await f(n,t,{variables:{filterBy:r},logger:e});return i}async function _(r,{actions:i=[],statuses:a=[],origins:o=[],text:s,createdAtBefore:l,createdAtAfter:u,updatedAtBefore:d,updatedAtAfter:m,isTest:h,isSilent:g,isClosed:_,requestIds:v=[],onPage:y}={}){let b=!!y,x={text:s,type:i.length>0?i:void 0,status:a.length>0?a:void 0,origin:o.length>0?o:void 0,isTest:h,isSilent:g,isClosed:_,createdAtBefore:l?l.toISOString():void 0,createdAtAfter:u?u.toISOString():void 0,updatedAtBefore:d?d.toISOString():void 0,updatedAtAfter:m?m.toISOString():void 0},S=new Date().getTime(),C=new p.SingleBar({},p.Presets.shades_classic);if(!b){e.info(c.magenta(`Fetching requests...`));let{requests:{totalCount:n}}=await f(r,t,{variables:{filterBy:x},logger:e});n>100&&(e.info(c.magenta(`Fetching ${n} requests`)),C.start(n,0))}let w=[],T=0,E,D=!1;do{let{requests:{nodes:t,pageInfo:i}}=await f(r,n,{variables:{first:100,after:E,filterBy:x},logger:e});b?await y(t):w.push(...t),T+=t.length,E=i.endCursor??void 0,b||C.update(T),D=i.hasNextPage}while(D);if(!b){C.stop();let t=new Date().getTime()-S;e.info(c.green(`Completed fetching of ${T} request in "${t/1e3}" seconds.`))}if(b)return[];let O=w;return v&&v.length>0&&(O=O.filter(e=>v.includes(e.id)),e.info(c.green(`Filtered down to ${O.length} requests based on ${v.length} provided IDs.`))),O}export{g as i,m as n,_ as r,h as t};
2
- //# sourceMappingURL=fetchAllRequests-BI0tFl_a.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetchAllRequests-BI0tFl_a.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,EAAE,OACN,aAAc,EAAE,QACjB,CAAC,CACH,CACF,CAAC,CAKW,EAAiB,EAAE,aAAa,CAC3C,EAAE,KAAK,CAEL,GAAI,EAAE,OAEN,UAAW,EAAE,OAEb,MAAO,EAAE,OAET,KAAM,EAAS,EAAc,CAE7B,KAAM,EAAE,OAER,SAAU,EAAE,QAEZ,OAAQ,EAAS,EAAc,CAE/B,OAAQ,EAAE,QAEV,eAAgB,EAAE,OAElB,QAAS,EAAE,OAEX,OAAQ,EAAS,EAAW,CAE5B,OAAQ,EAAS,EAAc,CAE/B,YAAa,EAAE,OAEf,QAAS,EAAE,MAAM,CAAC,EAAE,KAAM,EAAS,EAAe,CAAC,CAAC,CAEpD,mBAAoB,EAAE,MAAM,CAAC,EAAE,KAAM,EAAS,EAA0B,CAAC,CAAC,CAE1E,gBAAiB,EAAE,MACjB,EAAE,KAAK,CACL,GAA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CAAE,WAAU,CAAE,SAAQ,CAAC,CAE3D,EAAa,MACf,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAW,WAAW,CAAC,CAC9D,EAAY,MAAM,EAAY,EAAE,EAIpC,IAAM,EAA6B,EAAE,CACjC,EAAe,EAGf,EACA,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,SAAU,CAAE,QAAO,aACjB,MAAM,EAaP,EAAQ,EAAU,CACnB,UAAW,CAAE,MAAO,IAAW,MAAO,EAAQ,WAAU,CACxD,SACD,CAAC,CAEE,EACF,MAAM,EAAQ,EAAM,CAEpB,EAAS,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 +0,0 @@
1
- {"version":3,"file":"impl-BEiCEzl_2.mjs","names":[],"sources":["../src/commands/policy/download/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport colors from 'colors';\nimport got from 'got';\n\nimport type { LocalContext } from '../../../context.js';\nimport { selectCommandLogger } from '../../../lib/cli/command-output.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { EMPTY_CELL } from '../constants.js';\nimport {\n buildPolicyEngineClient,\n policyEngineRequest,\n printResult,\n resolveBundleByName,\n resolvePolicyBundleVersion,\n setPolicyEngineCliDebug,\n} from '../helpers/index.js';\nimport type { GetPolicyBundleVersionResponse } from '../types.js';\n\n/** CLI flags for `transcend policy download`. */\nexport interface DownloadCommandFlags {\n /** Tenant-unique bundle name */\n 'remote-bundle-name': string;\n /**\n * Caller-supplied version label to download.\n * When omitted, downloads the bundle's currently active version.\n */\n version?: string;\n /** Destination file path; defaults to `{bundleName}-{version}.tar.gz` */\n output?: string;\n /** Transcend API key */\n auth: string;\n /** Transcend API URL */\n 'transcend-url': string;\n /** Print metadata + presigned URL as JSON without writing a file */\n json: boolean;\n /** Include technical error details when a command fails */\n debug?: boolean;\n}\n\n/**\n * Builds the default output path for a downloaded policy bundle.\n *\n * @param bundleName - Tenant-unique bundle name\n * @param version - Caller-supplied version label\n * @returns Relative path `{bundleName}-{version}.tar.gz`\n */\nexport function defaultPolicyDownloadOutputPath(bundleName: string, version: string): string {\n return `${bundleName}-${version}.tar.gz`;\n}\n\n/**\n * Formats download metadata for human-readable CLI output.\n *\n * @param body - Version metadata from the Policy Engine API\n * @param outputPath - Destination path written (or that would be written)\n * @returns Summary lines\n */\nfunction formatDownloadSummary(body: GetPolicyBundleVersionResponse, outputPath: string): string {\n return [\n `bundleName ${body.bundleName}`,\n `version ${body.version}`,\n `output ${outputPath}`,\n `sha256 ${body.sha256}`,\n `sizeBytes ${body.sizeBytes}`,\n `uploadedAt ${body.uploadedAt}`,\n `activatedAt ${body.activatedAt ?? EMPTY_CELL}`,\n ].join('\\n');\n}\n\n/**\n * Download a compiled policy bundle version to disk.\n *\n * Resolves `--remote-bundle-name` and an optional `--version` to IDs, fetches a\n * short-lived presigned S3 URL from the monolith, then downloads the `.tar.gz`\n * bytes directly from S3 (the monolith does not proxy the artifact).\n *\n * When `--version` is omitted, downloads the bundle's currently active version.\n * If the bundle has no active version, exits with an error.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function download(\n this: LocalContext,\n {\n 'remote-bundle-name': bundleName,\n version,\n output,\n auth,\n 'transcend-url': transcendUrl,\n json,\n debug = false,\n }: DownloadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n setPolicyEngineCliDebug(debug);\n\n const client = buildPolicyEngineClient(transcendUrl, auth);\n const commandLogger = selectCommandLogger(this.logger, json);\n\n const bundle = await resolveBundleByName(client, bundleName);\n if (!bundle) {\n throw new Error(`Policy bundle \"${bundleName}\" was not found for this organization.`);\n }\n\n let versionId: string;\n if (version) {\n const resolvedVersion = await resolvePolicyBundleVersion(client, bundle.id, { version });\n versionId = resolvedVersion.id;\n } else {\n if (!bundle.activeVersionId) {\n throw new Error(`Policy bundle \"${bundleName}\" has no active version.`);\n }\n versionId = bundle.activeVersionId;\n }\n\n commandLogger.info(\n colors.green(\n version\n ? `Fetching download URL for bundle \"${bundleName}\" version \"${version}\"...`\n : `Fetching download URL for active version of bundle \"${bundleName}\"...`,\n ),\n );\n\n const body = await policyEngineRequest(\n client\n .get(`v1/policy-engine/policy-bundles/${bundle.id}/versions/${versionId}`)\n .json<GetPolicyBundleVersionResponse>(),\n );\n\n if (json) {\n printResult(this.process.stdout, {\n json: true,\n data: body,\n });\n return;\n }\n\n const outputPath = path.resolve(\n output ?? defaultPolicyDownloadOutputPath(bundleName, body.version),\n );\n\n commandLogger.info(colors.green(`Downloading policy bundle to ${outputPath}...`));\n\n let bundleBytes: Uint8Array;\n try {\n bundleBytes = await got(body.downloadUrl).buffer();\n } catch (err) {\n throw new Error(\n `Failed to download policy bundle from the presigned URL: ${\n err instanceof Error ? err.message : String(err)\n }`,\n { cause: err },\n );\n }\n\n const outputDir = path.dirname(outputPath);\n this.fs.mkdirSync(outputDir, { recursive: true });\n this.fs.writeFileSync(outputPath, bundleBytes);\n\n printResult(this.process.stdout, {\n json: false,\n data: body,\n renderTable: () => formatDownloadSummary(body, outputPath),\n });\n\n commandLogger.info(colors.green('Policy bundle downloaded successfully.'));\n}\n"],"mappings":"oZA+CA,SAAgB,EAAgC,EAAoB,EAAyB,CAC3F,MAAO,GAAG,EAA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,QAAU,OAAO,EAAI,GAElD,CAAE,MAAO,EAAK,CACf,CAGH,IAAM,EAAY,EAAK,QAAQ,EAAW,CAC1C,KAAK,GAAG,UAAU,EAAW,CAAE,UAAW,GAAM,CAAC,CACjD,KAAK,GAAG,cAAc,EAAY,EAAY,CAE9C,EAAY,KAAK,QAAQ,OAAQ,CAC/B,KAAM,GACN,KAAM,EACN,gBAAmB,EAAsB,EAAM,EAAW,CAC3D,CAAC,CAEF,EAAc,KAAK,EAAO,MAAM,yCAAyC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-Cb-7C1Ml2.mjs","names":["POLICY_SKILL_MD","POLICY_SETUP_TOOLING_REFERENCE_MD","POLICY_AUTHORING_REFERENCE_MD","POLICY_TESTING_DEBUGGING_REFERENCE_MD","POLICY_PUBLISHING_REFERENCE_MD","CLI_VERSION"],"sources":["../src/lib/policy/policy-scaffold-model.ts","../../../skills/transcend-policy-engine/references/authoring.md","../../../skills/transcend-policy-engine/references/publishing.md","../../../skills/transcend-policy-engine/references/setup-tooling.md","../../../skills/transcend-policy-engine/references/testing-debugging.md","../../../skills/transcend-policy-engine/SKILL.md","../src/lib/policy/policy-skill.ts","../src/lib/policy/policy-scaffold-output.ts","../src/lib/policy/policy-scaffold-planning.ts","../src/commands/policy/init/impl.ts"],"sourcesContent":["import type { ExistingProjectSkillDirectory } from '../scaffolding/agent-skill.js';\nimport type { ProjectPlan } from '../scaffolding/project-plan.js';\n\n/** Version of the stable policy initialization JSON result. */\nexport const POLICY_INIT_RESULT_VERSION = 3 as const;\n\n/** Optional repository integrations for policy authoring. */\nexport const PolicySetupFeature = {\n /** Repository-level editor configuration. */\n Editor: 'editor',\n /** Managed policy authoring skill. */\n Skill: 'skill',\n /** Credential-free continuous integration. */\n Ci: 'ci',\n} as const;\n\n/** Optional repository integration for policy authoring. */\nexport type PolicySetupFeature = (typeof PolicySetupFeature)[keyof typeof PolicySetupFeature];\n\n/** Repository and target state collected before policy planning. */\nexport interface PolicyProjectState {\n /** Directory from which the CLI was invoked. */\n invocationDirectory: string;\n /** Absolute user-selected policy directory. */\n targetDirectory: string;\n /** Repository or invocation root that owns setup artifacts. */\n projectRoot: string;\n /** Nearest repository root, when present. */\n repositoryRoot?: string;\n /** Existing project-level skill directories. */\n existingSkillDirectories: ExistingProjectSkillDirectory[];\n /** Whether the repository appears to use GitHub. */\n usesGithub: boolean;\n /** Case-preserving relative paths below the policy directory. */\n relativePaths: string[];\n /** Relative file and link paths below the policy directory. */\n relativeFilePaths: string[];\n}\n\n/** A complete, validated policy initialization plan. */\nexport interface PolicyInitProjectPlan extends ProjectPlan {\n /** JSON contract version. */\n version: typeof POLICY_INIT_RESULT_VERSION;\n /** Command that produced the plan. */\n command: 'init';\n /** Absolute policy project directory. */\n targetDirectory: string;\n /** Absolute policy manifest path. */\n manifestPath: string;\n /** Files inspected and deliberately left unchanged. */\n unchanged: string[];\n /** Non-fatal plan warnings. */\n warnings: string[];\n /** Raw commands shown after a successful apply. */\n nextSteps: string[];\n /** Exact generated example that remains safe to replace. */\n disposableExamplePath?: string;\n /** Selected repository integrations. */\n features: PolicySetupFeature[];\n}\n",null,null,null,null,null,"import POLICY_AUTHORING_REFERENCE_MD from '../../../../../skills/transcend-policy-engine/references/authoring.md';\nimport POLICY_PUBLISHING_REFERENCE_MD from '../../../../../skills/transcend-policy-engine/references/publishing.md';\nimport POLICY_SETUP_TOOLING_REFERENCE_MD from '../../../../../skills/transcend-policy-engine/references/setup-tooling.md';\nimport POLICY_TESTING_DEBUGGING_REFERENCE_MD from '../../../../../skills/transcend-policy-engine/references/testing-debugging.md';\nimport POLICY_SKILL_MD from '../../../../../skills/transcend-policy-engine/SKILL.md';\nimport type { AgentSkillFile } from '../scaffolding/agent-skill.js';\n\n/** Namespaced directory and frontmatter name for the installed Agent Skill. */\nexport const POLICY_SKILL_NAME = 'transcend-policy-engine';\n\nexport {\n POLICY_AUTHORING_REFERENCE_MD,\n POLICY_PUBLISHING_REFERENCE_MD,\n POLICY_SETUP_TOOLING_REFERENCE_MD,\n POLICY_SKILL_MD,\n POLICY_TESTING_DEBUGGING_REFERENCE_MD,\n};\n\n/** Complete portable Policy Engine Agent Skill file set. */\nexport const POLICY_SKILL_FILES: readonly AgentSkillFile[] = [\n { path: 'SKILL.md', contents: POLICY_SKILL_MD },\n { path: 'references/setup-tooling.md', contents: POLICY_SETUP_TOOLING_REFERENCE_MD },\n { path: 'references/authoring.md', contents: POLICY_AUTHORING_REFERENCE_MD },\n { path: 'references/testing-debugging.md', contents: POLICY_TESTING_DEBUGGING_REFERENCE_MD },\n { path: 'references/publishing.md', contents: POLICY_PUBLISHING_REFERENCE_MD },\n];\n","import {\n toPublicPlannedChange,\n type PublicPlannedChange,\n} from '../scaffolding/project-plan-output.js';\nimport type { PolicyInitProjectPlan, PolicySetupFeature } from './policy-scaffold-model.js';\nimport { POLICY_SKILL_NAME } from './policy-skill.js';\n\n/** Detected local policy tool versions. */\nexport interface PolicyInitToolVersions {\n /** OPA version, or null when missing or incompatible. */\n opa: string | null;\n /** Regal version, or null when missing or incompatible. */\n regal: string | null;\n}\n\n/** Stable machine-readable policy initialization result. */\nexport interface PolicyInitPlanResult {\n /** JSON contract version. */\n version: number;\n /** Command that produced the result. */\n command: 'init';\n /** Whether the plan was applied. */\n applied: boolean;\n /** Whether this was a dry run. */\n dryRun: boolean;\n /** Absolute policy target directory. */\n targetDirectory: string;\n /** Absolute policy manifest path. */\n manifestPath: string;\n /** Planned mutations without file contents. */\n changes: PublicPlannedChange[];\n /** Non-fatal preservation and runtime warnings. */\n warnings: string[];\n /** Suggested raw one-line follow-up commands. */\n nextSteps: string[];\n /** Explicitly selected repository integrations. */\n features: PolicySetupFeature[];\n /** Compact prompt for continuing with a coding agent. */\n aiHandoff: string;\n /** Compatible local policy tool versions. */\n tools: PolicyInitToolVersions;\n}\n\n/**\n * Build the compact policy implementation and CI handoff.\n *\n * @param options - Portable project path and next step\n * @returns Raw one-line prompt\n */\nexport function buildPolicyInitAiHandoff(options: {\n /** Display path to the policy project. */\n projectPath: string;\n /** Whether the policy authoring skill was installed. */\n hasSkill: boolean;\n /** Copyable new-bundle command. */\n newCommand: string;\n}): string {\n const instruction = options.hasSkill ? `Use the \\`${POLICY_SKILL_NAME}\\` skill and run` : 'Run';\n return (\n `${instruction} ${options.newCommand} to add a bundle from a template, ` +\n `then adapt the policy document tree and input/output contract to the intended application.`\n );\n}\n\n/**\n * Build the stable machine-readable initialization result.\n *\n * @param plan - Policy project plan\n * @param options - Apply and runtime state\n * @returns Public JSON result\n */\nexport function buildPolicyInitPlanResult(\n plan: PolicyInitProjectPlan,\n options: {\n /** Whether the plan was applied. */\n applied: boolean;\n /** Whether this was a dry run. */\n dryRun: boolean;\n /** Working directory for portable paths. */\n cwd: string;\n /** Compact coding-agent prompt. */\n aiHandoff: string;\n /** Compatible local policy tool versions. */\n tools: PolicyInitToolVersions;\n },\n): PolicyInitPlanResult {\n return {\n version: plan.version,\n command: plan.command,\n applied: options.applied,\n dryRun: options.dryRun,\n targetDirectory: plan.targetDirectory,\n manifestPath: plan.manifestPath,\n changes: plan.changes.map((change) => toPublicPlannedChange(options.cwd, change)),\n warnings: plan.warnings,\n nextSteps: plan.nextSteps,\n features: [...plan.features],\n aiHandoff: options.aiHandoff,\n tools: options.tools,\n };\n}\n","import { isAbsolute, join, posix, relative, sep } from 'node:path';\n\nimport {\n getManagedAgentSkillCandidatePaths,\n planManagedAgentSkill,\n type ManagedAgentSkillDefinition,\n} from '../scaffolding/agent-skill.js';\nimport { displayProjectPath } from '../scaffolding/project-plan-output.js';\nimport {\n getPlanningPathSnapshot,\n getPlanningFileSnapshot,\n planFileChange,\n type PlanningPathSnapshot,\n} from '../scaffolding/project-plan.js';\nimport {\n generatePolicyGithubActionsWorkflow,\n POLICY_CI_WORKFLOW_PATH,\n} from './policy-scaffold-artifacts.js';\nimport {\n mergePolicyEditorExtensions,\n mergePolicyEditorSettings,\n mergePolicyEditorTasks,\n type PolicyEditorMergeResult,\n} from './policy-scaffold-config.js';\nimport {\n POLICY_INIT_RESULT_VERSION,\n PolicySetupFeature,\n type PolicyInitProjectPlan,\n type PolicyProjectState,\n type PolicySetupFeature as PolicySetupFeatureType,\n} from './policy-scaffold-model.js';\nimport {\n generatePolicyWorkspaceFiles,\n POLICY_STARTER_BUNDLE_DIRECTORY,\n type PolicyStarterFile,\n} from './policy-scaffold-templates.js';\nimport { POLICY_SKILL_FILES, POLICY_SKILL_NAME } from './policy-skill.js';\n\n/** Managed Policy Engine Agent Skill definition. */\nconst POLICY_MANAGED_SKILL: ManagedAgentSkillDefinition = {\n name: POLICY_SKILL_NAME,\n displayName: 'Policy Engine',\n owner: '@transcend-io/cli',\n files: POLICY_SKILL_FILES,\n};\n\n/** In-memory input consumed by the pure policy initializer. */\nexport interface PolicyInitPlanningInput {\n /** Project discovery state. */\n state: PolicyProjectState;\n /** Potential mutation paths keyed by absolute path. */\n snapshots: Readonly<Record<string, PlanningPathSnapshot>>;\n}\n\n/** Optional repository setup selected for policy initialization. */\nexport interface PolicyInitPlanOptions {\n /** Selected setup features. */\n features: readonly PolicySetupFeatureType[];\n /** Exact released Transcend CLI version for generated CI. */\n cliVersion: string;\n}\n\n/**\n * Enumerate all core starter paths that could be created.\n *\n * @param state - Policy project state\n * @param options - Selected repository setup\n * @returns Absolute candidate paths\n */\nexport function getPolicyInitPlanningCandidatePaths(\n state: PolicyProjectState,\n options: Pick<PolicyInitPlanOptions, 'features'>,\n): string[] {\n const paths = new Set(\n generatePolicyWorkspaceFiles().map(({ path }) => join(state.targetDirectory, path)),\n );\n const selected = new Set(options.features);\n if (selected.has(PolicySetupFeature.Editor)) {\n paths.add(join(state.projectRoot, '.vscode', 'settings.json'));\n paths.add(join(state.projectRoot, '.vscode', 'extensions.json'));\n paths.add(join(state.projectRoot, '.vscode', 'tasks.json'));\n }\n if (selected.has(PolicySetupFeature.Skill)) {\n getManagedAgentSkillCandidatePaths(\n state.projectRoot,\n state.existingSkillDirectories,\n POLICY_MANAGED_SKILL,\n ).forEach((path) => paths.add(path));\n }\n if (selected.has(PolicySetupFeature.Ci) && state.repositoryRoot && state.usesGithub) {\n paths.add(join(state.repositoryRoot, POLICY_CI_WORKFLOW_PATH));\n }\n return [...paths].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Ensure a destination stays below an approved project root.\n *\n * @param root - Approved root\n * @param path - Candidate path\n */\nfunction assertContained(root: string, path: string): void {\n const child = relative(root, path);\n if (child === '..' || child.startsWith(`..${sep}`) || isAbsolute(child)) {\n throw new Error(`Refusing to modify path outside project root: ${path}`);\n }\n}\n\n/**\n * Enumerate generated file and directory paths allowed in an exact starter.\n *\n * @param files - Starter files\n * @returns POSIX relative paths\n */\nfunction starterRelativePaths(files: readonly PolicyStarterFile[]): Set<string> {\n const paths = new Set<string>([`${POLICY_STARTER_BUNDLE_DIRECTORY}/input.json`]);\n files.forEach(({ path }) => {\n paths.add(path);\n let parent = posix.dirname(path);\n while (parent !== '.') {\n paths.add(parent);\n parent = posix.dirname(parent);\n }\n });\n return paths;\n}\n\n/**\n * Add or classify one regular-file mutation.\n *\n * @param plan - Policy plan being assembled\n * @param input - Collected snapshots\n * @param options - Desired file\n */\nfunction addFileChange(\n plan: PolicyInitProjectPlan,\n input: PolicyInitPlanningInput,\n options: {\n /** Absolute destination path. */\n path: string;\n /** Complete desired contents. */\n contents: string;\n /** Human-readable plan description. */\n description: string;\n /** Refuse existing contents. */\n createOnly?: boolean;\n },\n): void {\n const change = planFileChange({\n snapshot: getPlanningFileSnapshot(input.snapshots, options.path),\n after: options.contents,\n description: options.description,\n ...(options.createOnly === undefined ? {} : { createOnly: options.createOnly }),\n });\n if (change) {\n plan.changes.push(change);\n } else {\n plan.unchanged.push(options.path);\n }\n}\n\n/**\n * Add one safe editor merge and its preservation warnings.\n *\n * @param plan - Policy plan being assembled\n * @param input - Collected snapshots\n * @param path - Absolute editor artifact path\n * @param result - Pure JSONC merge result\n * @param description - Human-readable plan description\n * @param cwd - Invocation directory for portable warning paths\n */\nfunction addEditorMerge(\n plan: PolicyInitProjectPlan,\n input: PolicyInitPlanningInput,\n path: string,\n result: PolicyEditorMergeResult,\n description: string,\n cwd: string,\n): void {\n addFileChange(plan, input, {\n path,\n contents: result.contents,\n description,\n });\n plan.warnings.push(\n ...result.warnings.map((warning) => `${warning} (${displayProjectPath(cwd, path)})`),\n );\n}\n\n/**\n * Build a safe policy project plan without reading the filesystem.\n *\n * Empty targets receive the complete starter. Existing targets are classified\n * only; no domain file is added, merged, or overwritten.\n *\n * @param input - Collected project state and path snapshots\n * @param options - Selected setup and pinned CLI version\n * @returns Validated policy initialization plan\n */\nexport function buildPolicyInitPlan(\n input: PolicyInitPlanningInput,\n options: PolicyInitPlanOptions,\n): PolicyInitProjectPlan {\n const { state } = input;\n const files = generatePolicyWorkspaceFiles();\n const newCommand = 'transcend policy new';\n const plan: PolicyInitProjectPlan = {\n version: POLICY_INIT_RESULT_VERSION,\n command: 'init',\n rootDirectory: state.projectRoot,\n targetDirectory: state.targetDirectory,\n // Init creates a workspace only; bundles (and their .manifest) come from `policy new`.\n manifestPath: state.targetDirectory,\n changes: [],\n unchanged: [],\n warnings: [],\n nextSteps: [newCommand],\n features: [...options.features],\n };\n\n const candidatePaths = getPolicyInitPlanningCandidatePaths(state, options);\n assertContained(state.projectRoot, state.targetDirectory);\n candidatePaths.forEach((path) => assertContained(state.projectRoot, path));\n\n if (state.relativeFilePaths.length === 0) {\n plan.directoryPreconditions = [\n {\n path: state.targetDirectory,\n relativePaths: [...state.relativePaths],\n },\n ];\n files.forEach((file) => {\n const path = join(state.targetDirectory, file.path);\n const snapshot = getPlanningPathSnapshot(input.snapshots, path);\n if (snapshot.kind !== 'absent') {\n throw new Error(`Expected an empty policy target, but found an entry at: ${path}`);\n }\n addFileChange(plan, input, {\n path,\n contents: file.contents,\n description: file.description,\n createOnly: true,\n });\n });\n } else {\n let allWorkspaceFilesMatch = true;\n files.forEach((file) => {\n const path = join(state.targetDirectory, file.path);\n const snapshot = getPlanningPathSnapshot(input.snapshots, path);\n if (snapshot.kind === 'file' && snapshot.contents === file.contents) {\n plan.unchanged.push(path);\n return;\n }\n allWorkspaceFilesMatch = false;\n if (snapshot.kind !== 'absent') {\n plan.unchanged.push(path);\n plan.warnings.push(\n `Existing policy scaffold path was left unchanged: ${displayProjectPath(\n state.invocationDirectory,\n path,\n )}`,\n );\n }\n });\n\n const allowedPaths = starterRelativePaths(files);\n const hasCustomPaths = state.relativeFilePaths.some((path) => !allowedPaths.has(path));\n if (!allWorkspaceFilesMatch || hasCustomPaths) {\n plan.warnings.push(\n `Existing policy target contains custom or partial content, so no workspace files were added or overwritten. ` +\n `Review ${displayProjectPath(\n state.invocationDirectory,\n state.targetDirectory,\n )} manually, then run \\`${newCommand}\\`.`,\n );\n }\n }\n\n const selected = new Set(options.features);\n const root = state.projectRoot;\n if (selected.has(PolicySetupFeature.Editor)) {\n const settingsPath = join(root, '.vscode', 'settings.json');\n const extensionsPath = join(root, '.vscode', 'extensions.json');\n const tasksPath = join(root, '.vscode', 'tasks.json');\n\n type EditorMergeFn = (\n contents: string | null,\n repositoryRoot: string,\n targetDirectory: string,\n ) => PolicyEditorMergeResult;\n const editorArtifacts: {\n /** Absolute path. */\n path: string;\n /** Plan description. */\n description: string;\n /** Merge function. */\n merge: EditorMergeFn;\n }[] = [\n {\n path: settingsPath,\n description: 'Merge strict target-scoped OPA and Rego editor settings',\n merge: (contents, repositoryRoot, targetDirectory) =>\n mergePolicyEditorSettings(contents, repositoryRoot, targetDirectory),\n },\n {\n path: extensionsPath,\n description: 'Recommend the OPA extension and discourage its syntax-only conflict',\n merge: (contents) => mergePolicyEditorExtensions(contents),\n },\n {\n path: tasksPath,\n description: 'Create the VS Code task configuration',\n merge: (contents, repositoryRoot, targetDirectory) =>\n mergePolicyEditorTasks(contents, repositoryRoot, targetDirectory),\n },\n ];\n editorArtifacts.forEach(({ path, description, merge }) => {\n const snapshot = getPlanningPathSnapshot(input.snapshots, path);\n if (snapshot.kind !== 'absent' && snapshot.kind !== 'file') {\n plan.unchanged.push(path);\n plan.warnings.push(\n `Existing VS Code artifact is not a regular file and was left unchanged: ${displayProjectPath(\n state.invocationDirectory,\n path,\n )}`,\n );\n return;\n }\n addEditorMerge(\n plan,\n input,\n path,\n merge(snapshot.kind === 'file' ? snapshot.contents : null, root, state.targetDirectory),\n description,\n state.invocationDirectory,\n );\n });\n }\n\n if (selected.has(PolicySetupFeature.Skill)) {\n const skillPlan = planManagedAgentSkill({\n rootDirectory: root,\n existingDirectories: state.existingSkillDirectories,\n snapshots: input.snapshots,\n skill: POLICY_MANAGED_SKILL,\n preserveModified: true,\n });\n plan.changes.push(...skillPlan.changes);\n plan.unchanged.push(...skillPlan.unchanged);\n plan.warnings.push(\n ...skillPlan.warnings.map((warning) => {\n return skillPlan.unchanged.reduce(\n (rendered, path) =>\n rendered.replace(path, displayProjectPath(state.invocationDirectory, path)),\n warning,\n );\n }),\n );\n }\n\n if (selected.has(PolicySetupFeature.Ci)) {\n if (!state.repositoryRoot || !state.usesGithub) {\n plan.warnings.push(\n 'GitHub Actions setup was selected, but this target is not inside a detected GitHub repository.',\n );\n } else {\n const workflowPath = join(state.repositoryRoot, POLICY_CI_WORKFLOW_PATH);\n const workspaceDirectory =\n relative(state.repositoryRoot, state.targetDirectory).split(sep).join('/') || '.';\n const workflowContents = generatePolicyGithubActionsWorkflow({\n cliVersion: options.cliVersion,\n workspaceDirectory,\n bundleDirectories: [],\n });\n const workflowSnapshot = getPlanningPathSnapshot(input.snapshots, workflowPath);\n if (workflowSnapshot.kind === 'absent') {\n addFileChange(plan, input, {\n path: workflowPath,\n contents: workflowContents,\n description: 'Add credential-free Policy Engine validation',\n createOnly: true,\n });\n } else if (\n workflowSnapshot.kind === 'file' &&\n workflowSnapshot.contents === workflowContents\n ) {\n plan.unchanged.push(workflowPath);\n } else {\n plan.unchanged.push(workflowPath);\n plan.warnings.push(\n `Existing GitHub Actions workflow was left unchanged: ${displayProjectPath(\n state.invocationDirectory,\n workflowPath,\n )}. Adapt it manually to validate each policy bundle.`,\n );\n }\n }\n }\n\n plan.changes.forEach(({ path }) => assertContained(state.projectRoot, path));\n return plan;\n}\n","import colors from 'colors';\n\nimport { version as CLI_VERSION } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport {\n runCapturedProcess,\n type CapturedProcessResult,\n type CapturedProcessRunner,\n} from '../../../lib/cli/run-captured-process.js';\nimport {\n DEFAULT_POLICY_PROJECT_DIRECTORY,\n discoverPolicyProject,\n} from '../../../lib/policy/policy-project-discovery.js';\nimport {\n OPA_INSTALL_URL,\n OPA_MISSING_MESSAGE,\n parsePolicyToolVersion,\n MINIMUM_POLICY_STARTER_REGAL_VERSION,\n REGAL_INSTALL_URL,\n REGAL_MISSING_MESSAGE,\n unsupportedOpaVersionMessage,\n unsupportedRegalVersionMessage,\n} from '../../../lib/policy/policy-runtime.js';\nimport {\n PolicySetupFeature,\n type PolicySetupFeature as PolicySetupFeatureType,\n} from '../../../lib/policy/policy-scaffold-model.js';\nimport {\n buildPolicyInitAiHandoff,\n buildPolicyInitPlanResult,\n type PolicyInitToolVersions,\n} from '../../../lib/policy/policy-scaffold-output.js';\nimport {\n buildPolicyInitPlan,\n getPolicyInitPlanningCandidatePaths,\n} from '../../../lib/policy/policy-scaffold-planning.js';\nimport { POLICY_STARTER_OPA_VERSION } from '../../../lib/policy/policy-scaffold-templates.js';\nimport { collectPlanningSnapshots } from '../../../lib/scaffolding/project-discovery.js';\nimport { applyProjectPlan } from '../../../lib/scaffolding/project-plan-apply.js';\nimport {\n displayProjectPath,\n quoteShellArgument,\n renderProjectPlan,\n} from '../../../lib/scaffolding/project-plan-output.js';\nimport {\n isInteractivePromptInvocation,\n PromptCancelledError,\n resolveSetupFeatures,\n ScaffoldPrompts,\n} from '../../../lib/scaffolding/prompts.js';\n\n/** Flags for `transcend policy init`. */\nexport interface PolicyInitFlags {\n /** Install repository-level VS Code setup. */\n editor?: boolean;\n /** Install the Policy Engine Agent Skill. */\n skill?: boolean;\n /** Install validation-only GitHub Actions CI. */\n ci?: boolean;\n /** Disable prompts. */\n noInteractive: boolean;\n /** Render but do not apply the plan. */\n dryRun: boolean;\n /** Approve the final displayed plan. */\n yes: boolean;\n /** Emit one stable JSON result on stdout. */\n json: boolean;\n}\n\n/** User-facing optional setup labels. */\nconst SETUP_LABELS: Readonly<Record<PolicySetupFeatureType, string>> = {\n [PolicySetupFeature.Editor]: 'VS Code settings and lint task',\n [PolicySetupFeature.Skill]: 'Policy Engine Agent Skill',\n [PolicySetupFeature.Ci]: 'Validation-only GitHub Actions',\n};\n\n/** All optional setup features in stable prompt order. */\nconst ALL_SETUP_FEATURES = Object.values(PolicySetupFeature);\n\n/** Runtime compatibility detected before policy planning. */\ninterface PolicyRuntimeProbe {\n /** Compatible tool versions. */\n tools: PolicyInitToolVersions;\n /** Missing or incompatible runtime guidance. */\n warnings: string[];\n}\n\n/**\n * Explain a failed version subprocess with official installation guidance.\n *\n * @param tool - Policy tool name\n * @param result - Failed captured process\n * @returns Actionable warning\n */\nfunction failedVersionProbeMessage(tool: 'OPA' | 'Regal', result: CapturedProcessResult): string {\n const detail = [result.stdout.trim(), result.stderr.trim()].filter(Boolean).join('\\n');\n const url = tool === 'OPA' ? OPA_INSTALL_URL : REGAL_INSTALL_URL;\n const requirement =\n tool === 'OPA' ? 'OPA 1.x' : `Regal ${MINIMUM_POLICY_STARTER_REGAL_VERSION} or newer`;\n return (\n `${requirement} is required, but \\`${tool.toLowerCase()} version\\` exited with code ` +\n `${result.code}${detail ? `: ${detail}` : '.'} ` +\n `Install or upgrade it using the official instructions: ${url}`\n );\n}\n\n/**\n * Probe both local policy runtimes without installing or modifying them.\n *\n * @param context - CLI context\n * @param cwd - Invocation working directory\n * @param runner - Captured subprocess runner\n * @returns Compatible versions and exact runtime guidance\n */\nasync function probePolicyRuntimes(\n context: LocalContext,\n cwd: string,\n runner: CapturedProcessRunner,\n): Promise<PolicyRuntimeProbe> {\n const tools: PolicyInitToolVersions = { opa: null, regal: null };\n const warnings: string[] = [];\n\n const opaResult = await runner('opa', ['version'], { cwd }, context);\n if (opaResult.error?.code === 'ENOENT') {\n warnings.push(OPA_MISSING_MESSAGE);\n } else {\n const output = `${opaResult.stdout}\\n${opaResult.stderr}`;\n const unsupported = unsupportedOpaVersionMessage(output);\n if (opaResult.code !== 0) {\n warnings.push(unsupported ?? failedVersionProbeMessage('OPA', opaResult));\n } else if (unsupported) {\n warnings.push(unsupported);\n } else {\n tools.opa = parsePolicyToolVersion(output)!.version;\n }\n }\n\n const regalResult = await runner('regal', ['version'], { cwd }, context);\n if (regalResult.error?.code === 'ENOENT') {\n warnings.push(REGAL_MISSING_MESSAGE);\n } else {\n const output = `${regalResult.stdout}\\n${regalResult.stderr}`;\n const unsupported = unsupportedRegalVersionMessage(\n output,\n MINIMUM_POLICY_STARTER_REGAL_VERSION,\n `the generated OPA ${POLICY_STARTER_OPA_VERSION} capabilities configuration`,\n );\n if (regalResult.code !== 0) {\n warnings.push(unsupported ?? failedVersionProbeMessage('Regal', regalResult));\n } else if (unsupported) {\n warnings.push(unsupported);\n } else {\n tools.regal = parsePolicyToolVersion(output)!.version;\n }\n }\n\n return { tools, warnings };\n}\n\n/**\n * Initialize a credential-free local Policy Engine project.\n *\n * @param this - CLI context\n * @param flags - Scaffold and interaction flags\n * @param directory - Target policy directory\n * @param runner - Captured policy tool runner\n */\nexport async function init(\n this: LocalContext,\n flags: PolicyInitFlags,\n directory: string = DEFAULT_POLICY_PROJECT_DIRECTORY,\n runner: CapturedProcessRunner = runCapturedProcess,\n): Promise<void> {\n doneInputValidation(this.process);\n try {\n const runtime = await probePolicyRuntimes(this, this.process.cwd(), runner);\n const state = discoverPolicyProject(this, directory);\n const prompts = new ScaffoldPrompts(this);\n const interactive = isInteractivePromptInvocation(\n flags,\n this.process.stdin.isTTY,\n this.process.stderr.isTTY,\n );\n const features = await resolveSetupFeatures(prompts, {\n features: ALL_SETUP_FEATURES,\n labels: SETUP_LABELS,\n enabled: {\n [PolicySetupFeature.Editor]: flags.editor,\n [PolicySetupFeature.Skill]: flags.skill,\n [PolicySetupFeature.Ci]: flags.ci,\n },\n interactive,\n });\n const candidatePaths = getPolicyInitPlanningCandidatePaths(state, { features });\n const snapshots = collectPlanningSnapshots(this, state.projectRoot, candidatePaths);\n\n const plan = buildPolicyInitPlan(\n { state, snapshots },\n {\n features,\n cliVersion: CLI_VERSION,\n },\n );\n plan.warnings.push(...runtime.warnings);\n\n if (!flags.json) {\n this.logger.info(\n renderProjectPlan(plan, {\n cwd: this.process.cwd(),\n title: 'Policy initialization plan',\n details: [{ label: 'Target', path: plan.targetDirectory }],\n }),\n );\n }\n\n let approved = plan.changes.length === 0 || flags.dryRun;\n if (plan.changes.length > 0 && !flags.dryRun) {\n if (flags.yes) {\n approved = true;\n } else if (interactive) {\n approved = await prompts.confirm('Apply this complete plan?', true);\n } else {\n throw new Error(\n 'The plan requires approval in a non-interactive invocation. Review with --dryRun, then pass --yes.',\n );\n }\n }\n\n if (approved && !flags.dryRun && plan.changes.length > 0) {\n await applyProjectPlan(this, plan);\n }\n const applied = approved && !flags.dryRun && plan.changes.length > 0;\n const setupAvailable = approved && !flags.dryRun;\n const aiHandoff = buildPolicyInitAiHandoff({\n projectPath: quoteShellArgument(\n displayProjectPath(this.process.cwd(), state.targetDirectory),\n ),\n hasSkill: setupAvailable && features.includes(PolicySetupFeature.Skill),\n newCommand: plan.nextSteps[0]!,\n });\n const result = buildPolicyInitPlanResult(plan, {\n applied,\n dryRun: flags.dryRun,\n cwd: this.process.cwd(),\n aiHandoff,\n tools: runtime.tools,\n });\n if (flags.json) {\n this.process.stdout.write(`${JSON.stringify(result)}\\n`);\n return;\n }\n if (flags.dryRun) {\n this.logger.info(colors.yellow('Dry run complete. No changes were written.'));\n return;\n }\n if (!approved) {\n this.logger.info(colors.yellow('No changes applied.'));\n return;\n }\n if (plan.changes.length === 0) {\n const message =\n plan.warnings.length === runtime.warnings.length\n ? 'Policy project is already initialized.'\n : 'Existing policy project was left unchanged.';\n this.logger.info(colors.green(message));\n } else {\n this.logger.info(colors.green('Policy project initialized.'));\n }\n if (plan.nextSteps.length > 0) {\n this.logger.info(`\\n${colors.bold('Next steps')}`);\n plan.nextSteps.forEach((step) => this.logger.info(step));\n }\n this.logger.info(`\\n${colors.bold('AI handoff — paste into your coding agent')}`);\n this.logger.info(aiHandoff);\n } catch (error) {\n if (error instanceof PromptCancelledError) {\n return this.process.exit(130);\n }\n throw error;\n }\n}\n"],"mappings":"uyBAOA,MAAa,EAAqB,CAEhC,OAAQ,SAER,MAAO,QAEP,GAAI,KACL,OCdD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECQA,MAAa,EAAoB,0BAWpB,EAAgD,CAC3D,CAAE,KAAM,WAAY,SAAUA,EAAiB,CAC/C,CAAE,KAAM,8BAA+B,SAAUC,EAAmC,CACpF,CAAE,KAAM,0BAA2B,SAAUC,EAA+B,CAC5E,CAAE,KAAM,kCAAmC,SAAUC,EAAuC,CAC5F,CAAE,KAAM,2BAA4B,SAAUC,EAAgC,CAC/E,CCwBD,SAAgB,EAAyB,EAO9B,CAET,M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AAM,EAAQ,CAAC,MAEvC,KAAK,OAAO,KAAK,EAAO,MAAM,8BAA8B,CAAC,CAE3D,EAAK,UAAU,OAAS,IAC1B,KAAK,OAAO,KAAK,KAAK,EAAO,KAAK,aAAa,GAAG,CAClD,EAAK,UAAU,QAAS,GAAS,KAAK,OAAO,KAAK,EAAK,CAAC,EAE1D,KAAK,OAAO,KAAK,KAAK,EAAO,KAAK,4CAA4C,GAAG,CACjF,KAAK,OAAO,KAAK,EAAU,OACpB,EAAO,CACd,GAAI,aAAiB,EACnB,OAAO,KAAK,QAAQ,KAAK,IAAI,CAE/B,MAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-D6rMLiNB2.mjs","names":["fg"],"sources":["../src/commands/policy/helpers/buildOpaBundleTarball.ts","../src/commands/policy/helpers/buildPolicyBundleFormData.ts","../src/commands/policy/helpers/defaultPolicyVersionLabel.ts","../src/lib/policy/policy-publish-hints.ts","../src/commands/policy/publish/impl.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { gunzipSync } from 'node:zlib';\n\nimport { MAX_BUNDLE_COMPRESSED_BYTES, MAX_BUNDLE_DECOMPRESSED_BYTES } from '@transcend-io/utils';\nimport fg from 'fast-glob';\n\nimport { validatePolicyBundleContents } from '../../../lib/policy/policy-bundle-manifest.js';\nimport { POLICY_MANIFEST_FILENAME } from '../../../lib/policy/policy-scaffold-templates.js';\nimport { assertOpaInstalled } from './assertOpaInstalled.js';\nimport { runOPACapture } from './runOpa.js';\n\n/** Result of collecting publishable entries from a policy bundle directory. */\ninterface PolicyBundleArchiveContents {\n /** Relative paths to include in the upload tarball (manifest first, then rego) */\n entries: string[];\n}\n\n/**\n * Collects `.manifest` and publishable `.rego` files from a policy directory.\n *\n * @param dir - Absolute path to the policy bundle directory\n * @returns Validated archive entries\n */\nfunction collectPolicyBundleArchiveEntries(dir: string): PolicyBundleArchiveContents {\n const regoFiles = fg\n .sync('**/*.rego', {\n cwd: dir,\n onlyFiles: true,\n dot: false,\n })\n .sort();\n const onDiskManifestPath = path.join(dir, POLICY_MANIFEST_FILENAME);\n const { publishableRegoPaths } = validatePolicyBundleContents(\n fs.existsSync(onDiskManifestPath) ? fs.readFileSync(onDiskManifestPath, 'utf8') : undefined,\n regoFiles.map((relativePath) => ({\n path: relativePath,\n contents: fs.readFileSync(path.join(dir, relativePath), 'utf8'),\n })),\n );\n\n return {\n entries: [POLICY_MANIFEST_FILENAME, ...publishableRegoPaths],\n };\n}\n\n/**\n * Verifies that a policy directory compiles end-to-end with `opa build`.\n *\n * The compiled output is discarded — the server receives the `.manifest` +\n * `.rego` archive produced by {@link buildOpaBundleTarball}, not the OPA bundle\n * — but a successful build guarantees the policies compile and link, surfacing\n * errors (syntax, missing imports, undefined references, etc.) before upload.\n *\n * @param dir - Absolute path to the policy bundle directory\n */\nasync function assertBundleCompiles(dir: string): Promise<void> {\n const buildOutputPath = path.join(\n os.tmpdir(),\n `transcend-policy-bundle-build-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`,\n );\n try {\n // Run with `cwd` set to the bundle directory and pass `.` so `opa build`\n // resolves the bundle root correctly. Bundle mode (`-b`) keeps local\n // `input.json` / `input.example.json` fixtures from merging as data.\n // `*_test.rego` files are local-only.\n const { code, stderr } = await runOPACapture(\n ['build', '--ignore', '*_test.rego', '-b', '-o', buildOutputPath, '.'],\n { cwd: dir },\n );\n if (code !== 0) {\n throw new Error(stderr.trim() || `opa build failed with exit code ${code}`);\n }\n } finally {\n if (fs.existsSync(buildOutputPath)) {\n fs.unlinkSync(buildOutputPath);\n }\n }\n}\n\n/**\n * Formats a byte count as a human-readable size with binary units.\n *\n * @param bytes - Number of bytes\n * @returns Human-readable size, e.g. `14 MiB` or `4 KiB`\n */\nfunction formatBytes(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n const kib = bytes / 1024;\n if (kib < 1024) {\n return `${kib % 1 === 0 ? kib.toFixed(0) : kib.toFixed(1)} KiB`;\n }\n const mib = kib / 1024;\n return `${mib % 1 === 0 ? mib.toFixed(0) : mib.toFixed(1)} MiB`;\n}\n\n/**\n * Builds a gzip-compressed policy bundle tarball for upload to Transcend.\n *\n * The Policy Engine API expects a plain archive containing `.manifest` and\n * one or more `.rego` files. Local projects author an OPA `.manifest` and it\n * is uploaded directly — no rename at pack time. Before packaging, the\n * manifest is validated (shape + root coverage) and the bundle is validated\n * with `opa check` (strict Rego linting) and `opa build` (full compilation) so\n * failures surface client-side rather than after upload.\n *\n * @param dir - Directory containing `.manifest` and `.rego` policy files\n * @returns Absolute path to the generated `.tar.gz` bundle\n */\nexport async function buildOpaBundleTarball(dir: string): Promise<string> {\n assertOpaInstalled();\n\n const resolvedDir = path.resolve(dir);\n if (!fs.existsSync(resolvedDir) || !fs.statSync(resolvedDir).isDirectory()) {\n throw new Error(`Policy directory does not exist or is not a directory: ${resolvedDir}`);\n }\n\n // Validate the manifest shape and that roots cover every Rego package before\n // invoking OPA, so invalid manifests surface a clear error instead of an\n // opaque `opa build failed with exit code 1`.\n const { entries: archiveEntries } = collectPolicyBundleArchiveEntries(resolvedDir);\n\n // Match the Rego v1 validation the Policy Engine API runs on upload.\n const { code: checkCode, stderr: checkStderr } = await runOPACapture([\n 'check',\n '--strict',\n resolvedDir,\n ]);\n if (checkCode !== 0) {\n throw new Error(checkStderr.trim() || `opa check failed with exit code ${checkCode}`);\n }\n\n // Ensure the bundle compiles end-to-end before packaging for upload.\n await assertBundleCompiles(resolvedDir);\n\n const outputPath = path.join(\n os.tmpdir(),\n `transcend-policy-bundle-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`,\n );\n const tarResult = spawnSync('tar', ['-czf', outputPath, '-C', resolvedDir, ...archiveEntries], {\n env: { ...process.env, COPYFILE_DISABLE: '1' },\n encoding: 'utf8',\n });\n if (tarResult.status !== 0) {\n throw new Error(\n `Failed to create policy bundle archive: ${tarResult.stderr.trim() || 'tar failed'}`,\n );\n }\n\n const compressedBytes = fs.readFileSync(outputPath);\n if (compressedBytes.byteLength > MAX_BUNDLE_COMPRESSED_BYTES) {\n fs.unlinkSync(outputPath);\n throw new Error(\n `Policy bundle exceeds the ${formatBytes(MAX_BUNDLE_COMPRESSED_BYTES)} compressed upload limit ` +\n `(bundle is ${formatBytes(compressedBytes.byteLength)}). ` +\n `The server also rejects decompressed bundles larger than ${formatBytes(MAX_BUNDLE_DECOMPRESSED_BYTES)}.`,\n );\n }\n\n const decompressedBytes = gunzipSync(compressedBytes);\n if (decompressedBytes.byteLength > MAX_BUNDLE_DECOMPRESSED_BYTES) {\n fs.unlinkSync(outputPath);\n throw new Error(\n `Policy bundle exceeds the ${formatBytes(MAX_BUNDLE_DECOMPRESSED_BYTES)} decompressed upload limit ` +\n `(bundle is ${formatBytes(decompressedBytes.byteLength)} decompressed).`,\n );\n }\n\n return outputPath;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\n/** Fields for building a policy bundle upload form. */\nexport interface BuildPolicyBundleFormDataOptions {\n /** Absolute path to the bundle tarball */\n bundlePath: string;\n /** Version label */\n version: string;\n /** Optional description */\n description?: string;\n /** Bundle name (only for create) */\n bundleName?: string;\n}\n\n/**\n * Builds multipart form data for a policy bundle upload.\n *\n * @param options - Upload fields\n * @returns FormData ready for POST\n */\nexport function buildPolicyBundleFormData(options: BuildPolicyBundleFormDataOptions): FormData {\n const bundleBytes = fs.readFileSync(options.bundlePath);\n const form = new FormData();\n form.append(\n 'bundle',\n new Blob([bundleBytes], { type: 'application/gzip' }),\n path.basename(options.bundlePath),\n );\n form.append('version', options.version);\n if (options.description) {\n form.append('description', options.description);\n }\n if (options.bundleName) {\n form.append('bundleName', options.bundleName);\n }\n return form;\n}\n","/**\n * Formats a date as `yyyy-mm-dd-hh-mm-ss` in UTC.\n *\n * @param date - Date to format\n * @returns Timestamp label\n */\nfunction formatPolicyVersionTimestamp(date: Date): string {\n return date.toISOString().slice(0, 19).replace(/[T:]/g, '-');\n}\n\n/**\n * Returns a default version label from the bundle name and current UTC timestamp.\n *\n * @param bundleName - Tenant-unique policy bundle name\n * @param now - Current time (for testing)\n * @returns Version label in `{bundleName}-yyyy-mm-dd-hh-mm-ss` form\n */\nexport function defaultPolicyVersionLabel(bundleName: string, now: Date = new Date()): string {\n return `${bundleName}-${formatPolicyVersionTimestamp(now)}`;\n}\n","import {\n PERMISSIONS_POLICY_BUNDLE_NAME,\n PolicyTemplate,\n type PolicyTemplateName,\n} from './policy-scaffold-templates.js';\n\n/** Inputs used to soft-warn about Permissions vs generic publish naming. */\nexport interface PolicyPublishBundleNameHintInput {\n /** Optional scaffold template from `.manifest` metadata. */\n template?: PolicyTemplateName;\n /** Declared OPA package roots. */\n roots: string[];\n}\n\n/**\n * Whether local authoring signals suggest a Permissions API bundle.\n *\n * Prefers explicit `metadata.transcend.io.template`. Without metadata, falls\n * back to a root that is exactly `permissions` or nested under it.\n *\n * @param input - Manifest template hint and roots\n * @returns Whether the local tree looks Permissions-oriented\n */\nfunction looksLikePermissionsBundle(input: PolicyPublishBundleNameHintInput): boolean {\n if (input.template === PolicyTemplate.Permissions) {\n return true;\n }\n if (input.template === PolicyTemplate.Generic) {\n return false;\n }\n return input.roots.some(\n (root) =>\n root === PERMISSIONS_POLICY_BUNDLE_NAME ||\n root.startsWith(`${PERMISSIONS_POLICY_BUNDLE_NAME}/`),\n );\n}\n\n/**\n * Soft-warning when `--remote-bundle-name` disagrees with Permissions conventions.\n *\n * Upload does not enforce bundle kinds. Permissions API only loads the\n * remote bundle named {@link PERMISSIONS_POLICY_BUNDLE_NAME}.\n *\n * @param bundleName - Value of `--remote-bundle-name`\n * @param input - Local manifest template/roots\n * @returns Warning text, or undefined when names align\n */\nexport function formatPolicyPublishBundleNameHint(\n bundleName: string,\n input: PolicyPublishBundleNameHintInput,\n): string | undefined {\n const permissionsLocal = looksLikePermissionsBundle(input);\n const permissionsRemote = bundleName === PERMISSIONS_POLICY_BUNDLE_NAME;\n\n if (permissionsLocal && !permissionsRemote) {\n return (\n `This directory looks like a Permissions API policy, but --remote-bundle-name is ` +\n `\"${bundleName}\". Permissions API only loads the remote bundle named ` +\n `\"${PERMISSIONS_POLICY_BUNDLE_NAME}\". Upload still succeeds; pass ` +\n `--remote-bundle-name=${PERMISSIONS_POLICY_BUNDLE_NAME} if that is the intended path.`\n );\n }\n\n if (!permissionsLocal && permissionsRemote) {\n return (\n `--remote-bundle-name=${PERMISSIONS_POLICY_BUNDLE_NAME} reserves the Permissions API ` +\n `path. Upload treats all bundles the same; only that fixed name is queried by ` +\n `the Permissions API. Continue only if you intend this bundle for the Permissions API.`\n );\n }\n\n return undefined;\n}\n","import { join } from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { selectCommandLogger } from '../../../lib/cli/command-output.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { buildExampleCommand } from '../../../lib/docgen/buildExamples.js';\nimport { inquirerConfirmBoolean } from '../../../lib/helpers/inquirer.js';\nimport { parsePolicyBundleManifest } from '../../../lib/policy/policy-bundle-manifest.js';\nimport { resolvePolicyProjectDirectory } from '../../../lib/policy/policy-project-discovery.js';\nimport { formatPolicyPublishBundleNameHint } from '../../../lib/policy/policy-publish-hints.js';\nimport { POLICY_MANIFEST_FILENAME } from '../../../lib/policy/policy-scaffold-templates.js';\nimport { isInteractivePromptInvocation } from '../../../lib/scaffolding/prompts.js';\nimport type { ActivateCommandFlags } from '../activate/impl.js';\nimport {\n buildPolicyBundleFormData,\n buildPolicyEngineClient,\n buildOpaBundleTarball,\n defaultPolicyVersionLabel,\n formatPolicyBundleVersionSummary,\n policyEngineRequest,\n printResult,\n resolveBundleIdByName,\n setPolicyEngineCliDebug,\n} from '../helpers/index.js';\nimport type { CreatePolicyBundleResponse, CreatePolicyBundleVersionResponse } from '../types.js';\n\n/** CLI flags for `transcend policy publish`. */\nexport interface PublishCommandFlags {\n /** Tenant-unique bundle name */\n 'remote-bundle-name': string;\n /** Transcend API key */\n auth: string;\n /** Transcend API URL */\n 'transcend-url': string;\n /** Version label (defaults to `{bundleName}-yyyy-mm-dd-hh-mm-ss`) */\n version?: string;\n /** Optional version description */\n description?: string;\n /** Print raw JSON response */\n json: boolean;\n /** Skip the \"create new bundle\" confirmation */\n yes: boolean;\n /** Include technical error details when a command fails */\n debug?: boolean;\n}\n\n/**\n * Build and upload a new immutable policy bundle version.\n *\n * @param this - CLI context\n * @param flags - Command flags\n * @param directory - Policy bundle directory containing a `.manifest`\n */\nexport async function publish(\n this: LocalContext,\n {\n 'remote-bundle-name': bundleName,\n auth,\n 'transcend-url': transcendUrl,\n version,\n description,\n json,\n yes,\n debug = false,\n }: PublishCommandFlags,\n directory: string,\n): Promise<void> {\n doneInputValidation(this.process);\n setPolicyEngineCliDebug(debug);\n\n const commandLogger = selectCommandLogger(this.logger, json);\n const resolvedDir = resolvePolicyProjectDirectory(this.process.cwd(), directory);\n const versionLabel = version ?? defaultPolicyVersionLabel(bundleName);\n const client = buildPolicyEngineClient(transcendUrl, auth);\n const interactive = isInteractivePromptInvocation(\n { json, noInteractive: false },\n this.process.stdin.isTTY,\n this.process.stderr.isTTY,\n );\n\n let bundlePath: string | undefined;\n try {\n commandLogger.info(colors.green(`Building policy bundle from ${resolvedDir}...`));\n bundlePath = await buildOpaBundleTarball(resolvedDir);\n\n try {\n const manifestPath = join(resolvedDir, POLICY_MANIFEST_FILENAME);\n const manifest = parsePolicyBundleManifest(this.fs.readFileSync(manifestPath, 'utf8'));\n const bundleNameHint = formatPolicyPublishBundleNameHint(bundleName, manifest);\n if (bundleNameHint) {\n commandLogger.warn(colors.yellow(bundleNameHint));\n }\n } catch {\n // Best-effort authoring hint; tarball build already validated the manifest.\n }\n\n const existingBundleId = await resolveBundleIdByName(client, bundleName);\n\n let responseBody: CreatePolicyBundleResponse | CreatePolicyBundleVersionResponse;\n\n if (existingBundleId) {\n commandLogger.info(colors.green(`Uploading new version for bundle \"${bundleName}\"...`));\n const form = buildPolicyBundleFormData({\n bundlePath,\n version: versionLabel,\n description,\n });\n responseBody = await policyEngineRequest(\n client\n .post(`v1/policy-engine/policy-bundles/${existingBundleId}/versions`, { body: form })\n .json<CreatePolicyBundleVersionResponse>(),\n );\n } else {\n if (!interactive && !yes) {\n this.logger.error(\n colors.red(\n 'Cannot create a new bundle in non-interactive or JSON mode; pass --yes to confirm.',\n ),\n );\n this.process.exit(1);\n return;\n }\n\n if (!yes) {\n commandLogger.warn(\n colors.yellow(`No policy bundle named \"${bundleName}\" exists for this organization.`),\n );\n const shouldCreate = await inquirerConfirmBoolean({\n message: `No policy bundle named \"${bundleName}\" exists. Create a new bundle and upload its first version?`,\n });\n if (!shouldCreate) {\n commandLogger.info(colors.yellow('Publish cancelled.'));\n return;\n }\n }\n\n commandLogger.info(\n colors.green(`Creating bundle \"${bundleName}\" and uploading first version...`),\n );\n const createForm = buildPolicyBundleFormData({\n bundlePath,\n version: versionLabel,\n description,\n bundleName,\n });\n responseBody = await policyEngineRequest(\n client\n .post('v1/policy-engine/policy-bundles', {\n body: createForm,\n })\n .json<CreatePolicyBundleResponse>(),\n );\n }\n\n printResult(this.process.stdout, {\n json,\n data: responseBody,\n renderTable: () => formatPolicyBundleVersionSummary(responseBody.version),\n });\n\n commandLogger.info(colors.green('Policy bundle version uploaded successfully.'));\n\n const activateCommand = buildExampleCommand<ActivateCommandFlags>(['policy', 'activate'], {\n version: responseBody.version.version,\n 'remote-bundle-name': bundleName,\n });\n commandLogger.info(\n colors.yellow(\n `Publishing a policy does not activate it. To activate this version, run:\\n ${activateCommand}`,\n ),\n );\n } finally {\n if (bundlePath && this.fs.existsSync(bundlePath)) {\n this.fs.unlinkSync(bundlePath);\n }\n }\n}\n"],"mappings":"o+BA0BA,SAAS,EAAkC,EAA0C,CACnF,IAAM,EAAYA,EACf,KAAK,YAAa,CACjB,IAAK,EACL,UAAW,GACX,IAAK,GACN,CAAC,CACD,MAAM,CACH,EAAqB,EAAK,KAAK,EAAK,EAAyB,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AAG,WAAW,EAAW"}
@@ -1,3 +0,0 @@
1
- import{c as e,i as t,n,t as r}from"./policy-project-discovery-DTSl0Gfl.mjs";import{c as i,i as a,l as o,o as s,s as c}from"./policy-runtime-6jmkXlBk.mjs";import{n as l}from"./policy-bundle-manifest-DbbTXe0u.mjs";import{n as u}from"./inquirer-jzIQWAvq.mjs";import{t as d}from"./done-input-validation-LiTaCEzF.mjs";import{r as f}from"./prompts-BhXfYD6g.mjs";import{t as p}from"./run-captured-process-BjaSDWXG.mjs";import m from"node:path";import h from"colors";const g=[`manifest`,`opa-version`,`regal-version`,`format`,`opa-check`,`regal-lint`,`opa-test`],_={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 v(e,t){return[e.stdout.trim(),e.stderr.trim()].filter(Boolean).join(`
2
- `)||t}function y(e,t){return[...new Set(e.split(/\r?\n/gu).map(e=>e.trim()).filter(Boolean).map(e=>m.isAbsolute(e)?m.relative(t,e).split(m.sep).join(`/`):e.split(m.sep).join(`/`)))].sort()}function b(e,t,n=t){return e.fs.readdirSync(n,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name)).flatMap(r=>{let i=m.join(n,r.name);return r.isDirectory()?b(e,t,i):!r.isFile()||!r.name.endsWith(`.rego`)?[]:[{path:m.relative(t,i).split(m.sep).join(`/`),contents:e.fs.readFileSync(i,`utf8`)}]})}function x(e,t){let n=t;for(;;){let t=m.join(n,`.regal`,`config.yaml`);if(e.fs.existsSync(t))return t;let r=m.join(n,`.regal.yaml`);if(e.fs.existsSync(r))return r;let i=m.dirname(n);if(i===n)return;n=i}}function S(e,t,n){n?e.logger.info(`${h.bold(n)}\n`):e.logger.info(`${h.bold(`Policy verification`)}\n`),t.checks.forEach(({name:n,status:r})=>{let i=r===`passed`?`PASS`:r===`failed`?`FAIL`:`SKIP`,a=r===`passed`?h.green(i):r===`failed`?h.red(i):h.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} ${_[n]}${o}`)}),t.diagnostics.length>0&&e.logger.error(``),t.diagnostics.forEach(t=>{let n=t.path?`${t.path}: `:``;e.logger.error(h.red(`error [${t.code}]: ${n}${t.message}`))}),t.status===`passed`?(e.logger.info(``),e.logger.info(h.green(`Policy verification passed.`))):(e.logger.error(``),e.logger.error(h.red(`Policy verification failed.`)))}async function C({fix:t,noInteractive:n,json:r},d,p){let _=g.map(e=>({name:e,status:`skipped`})),S=[],C={version:1,status:`passed`,directory:d,fix:t,tools:{opa:null,regal:null},checks:_,unformattedFiles:[],fixedFiles:[],diagnostics:S},w=(e,t)=>{_.find(t=>t.name===e).status=t},T=(e,t,n)=>{S.push({code:e,severity:`error`,message:t,...n?{path:n}:{}})};if(!this.fs.existsSync(d)||!this.fs.statSync(d).isDirectory())return w(`manifest`,`failed`),T(`project.directory`,`Policy directory does not exist or is not a directory: ${d}`,m.relative(this.process.cwd(),d)),C.status=`failed`,C;let E=m.join(d,e);try{l(this.fs.existsSync(E)?this.fs.readFileSync(E,`utf8`):void 0,b(this,d)),w(`manifest`,`passed`)}catch(e){w(`manifest`,`failed`),T(`manifest.invalid`,e instanceof Error?e.message:String(e),m.relative(this.process.cwd(),E))}let D=await p(`opa`,[`version`],{cwd:d},this);if(D.error?.code===`ENOENT`)w(`opa-version`,`failed`),T(`opa.missing`,a);else{let e=`${D.stdout}\n${D.stderr}`,t=i(e);D.code!==0||t?(w(`opa-version`,`failed`),T(`opa.version`,t??v(D,`Unable to determine the installed OPA version.`))):(C.tools.opa=c(e).version,w(`opa-version`,`passed`))}let O=await p(`regal`,[`version`],{cwd:d},this);if(O.error?.code===`ENOENT`)w(`regal-version`,`failed`),T(`regal.missing`,s);else{let e=`${O.stdout}\n${O.stderr}`,t=o(e);O.code!==0||t?(w(`regal-version`,`failed`),T(`regal.version`,t??v(O,`Unable to determine the installed Regal version.`))):(C.tools.regal=c(e).version,w(`regal-version`,`passed`))}if(C.tools.opa){let e=await p(`opa`,[`fmt`,`--list`,d],{cwd:d},this);if(e.code!==0)w(`format`,`failed`),T(`opa.format`,v(e,`opa fmt --list failed with exit code ${e.code}`));else if(C.unformattedFiles=y(e.stdout,d),C.unformattedFiles.length===0)w(`format`,`passed`);else{let e=t,i=f({json:r,noInteractive:n},this.process.stdin.isTTY,this.process.stderr.isTTY);if(!r&&!t){this.logger.error(h.red(`Policy files are not formatted:`)),C.unformattedFiles.forEach(e=>{this.logger.error(h.red(` - ${e}`))});let e=await p(`opa`,[`fmt`,`--diff`,d],{cwd:d},this),t=e.stdout.trim()||e.stderr.trim();t&&(this.logger.error(``),this.logger.error(t))}if(!t&&i)try{e=await u({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 p(`opa`,[`fmt`,`--write`,d],{cwd:d},this);e.code===0?(C.fixedFiles=[...C.unformattedFiles],w(`format`,`passed`)):(w(`format`,`failed`),T(`opa.format-fix`,v(e,`opa fmt --write failed with exit code ${e.code}`)))}else w(`format`,`failed`),T(`opa.format-required`,"Policy files are not formatted. Re-run `transcend policy lint --fix` to repair them.")}let i=await p(`opa`,[`check`,`--strict`,`--ignore`,`*_test.rego`,d],{cwd:d},this);i.code===0?w(`opa-check`,`passed`):(w(`opa-check`,`failed`),T(`opa.check`,v(i,`opa check failed with exit code ${i.code}`)))}if(C.tools.regal){let e=x(this,d),t=await p(`regal`,[`lint`,`--fail-level`,`warning`,...e?[`--config-file`,e]:[],d],{cwd:d},this);t.code===0?w(`regal-lint`,`passed`):(w(`regal-lint`,`failed`),T(`regal.lint`,v(t,`regal lint failed with exit code ${t.code}`)))}if(C.tools.opa){let e=await p(`opa`,[`test`,`--fail-on-empty`,`-b`,d],{cwd:d},this);e.code===0?w(`opa-test`,`passed`):(w(`opa-test`,`failed`),T(`opa.test`,v(e,`opa test --fail-on-empty -b failed with exit code ${e.code}`)))}return C.status=_.some(({status:e})=>e===`failed`)?`failed`:`passed`,C}async function w(e,i=r,a=p){d(this.process);let{fix:o=!1,noInteractive:s=!1,json:c=!1}=e,l=t(this.process.cwd(),i);if(!this.fs.existsSync(l)||!this.fs.statSync(l).isDirectory()){let e={version:1,status:`failed`,directory:l,fix:o,tools:{opa:null,regal:null},checks:g.map(e=>({name:e,status:e===`manifest`?`failed`:`skipped`})),unformattedFiles:[],fixedFiles:[],diagnostics:[{code:`project.directory`,severity:`error`,message:`Policy directory does not exist or is not a directory: ${l}`,path:m.relative(this.process.cwd(),l)}]};c?this.process.stdout.write(`${JSON.stringify(e)}\n`):S(this,e),this.process.exitCode=1;return}let u=n(this,l);if(u.length===0){let e={version:1,status:`failed`,directory:l,fix:o,tools:{opa:null,regal:null},checks:g.map(e=>({name:e,status:e===`manifest`?`failed`:`skipped`})),unformattedFiles:[],fixedFiles:[],diagnostics:[{code:`project.bundles`,severity:`error`,message:"No publishable policy bundles found. Add one with `transcend policy new`, or pass a directory that contains a `.manifest`.",path:m.relative(this.process.cwd(),l)||`.`}]};c?this.process.stdout.write(`${JSON.stringify(e)}\n`):S(this,e),this.process.exitCode=1;return}let f=[];for(let e of u)f.push(await C.call(this,{fix:o,noInteractive:s,json:c},e,a));let h=f.some(e=>e.status===`failed`);if(c)if(f.length===1)this.process.stdout.write(`${JSON.stringify(f[0])}\n`);else{let e={version:2,status:h?`failed`:`passed`,directory:l,fix:o,results:f};this.process.stdout.write(`${JSON.stringify(e)}\n`)}else f.length===1?S(this,f[0]):f.forEach((e,t)=>{t>0&&this.logger.info(``);let n=m.relative(this.process.cwd(),e.directory)||e.directory;S(this,e,`Policy verification — ${n}`)});h&&(this.process.exitCode=1)}export{w as lint};
3
- //# sourceMappingURL=impl-DNOgBcsu.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"impl-DNOgBcsu.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/** Stable multi-bundle lint result schema version. */\nexport const POLICY_LINT_MULTI_RESULT_VERSION = 2;\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` for one bundle. */\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 bundle 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\n/**\n * Stable result when `transcend policy lint --json` verifies multiple bundles.\n *\n * Emitted only when the selected path is a workspace with more than one\n * publishable `*-bundle/` directory.\n */\nexport interface PolicyLintMultiResult {\n /** Result schema version. */\n version: typeof POLICY_LINT_MULTI_RESULT_VERSION;\n /** Overall verification outcome across all bundles. */\n status: Exclude<PolicyLintStatus, 'skipped'>;\n /** Absolute policy workspace directory that was searched. */\n directory: string;\n /** Whether formatting repair was explicitly requested. */\n fix: boolean;\n /** Per-bundle results in discovery order. */\n results: PolicyLintResult[];\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 PolicyLintMultiResult,\n type PolicyLintResult,\n POLICY_LINT_CHECK_LABELS,\n POLICY_LINT_CHECK_NAMES,\n POLICY_LINT_MULTI_RESULT_VERSION,\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 DEFAULT_POLICY_PROJECT_DIRECTORY,\n discoverPolicyBundleDirectories,\n resolvePolicyProjectDirectory,\n} from '../../../lib/policy/policy-project-discovery.js';\nimport {\n OPA_MISSING_MESSAGE,\n parsePolicyToolVersion,\n REGAL_MISSING_MESSAGE,\n unsupportedOpaVersionMessage,\n unsupportedRegalVersionMessage,\n} from '../../../lib/policy/policy-runtime.js';\nimport { POLICY_MANIFEST_FILENAME } from '../../../lib/policy/policy-scaffold-templates.js';\nimport { isInteractivePromptInvocation } from '../../../lib/scaffolding/prompts.js';\n\n/** CLI flags for `transcend policy lint`. */\nexport interface LintCommandFlags {\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 * Resolve a Regal config file for a bundle, walking up to the workspace.\n *\n * @param context - CLI context\n * @param bundleDirectory - Absolute bundle directory\n * @returns Absolute config path, or undefined when none is found\n */\nfunction resolveRegalConfigFile(\n context: LocalContext,\n bundleDirectory: string,\n): string | undefined {\n let current = bundleDirectory;\n for (;;) {\n const nestedRegalConfig = path.join(current, '.regal', 'config.yaml');\n if (context.fs.existsSync(nestedRegalConfig)) {\n return nestedRegalConfig;\n }\n const rootRegalConfig = path.join(current, '.regal.yaml');\n if (context.fs.existsSync(rootRegalConfig)) {\n return rootRegalConfig;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\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 * @param heading - Optional section heading when linting multiple bundles\n */\nfunction renderResult(context: LocalContext, result: PolicyLintResult, heading?: string): void {\n if (heading) {\n context.logger.info(`${colors.bold(heading)}\\n`);\n } else {\n context.logger.info(`${colors.bold('Policy verification')}\\n`);\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 one publishable policy bundle directory.\n *\n * @param context - CLI context\n * @param flags - Command flags\n * @param resolvedDir - Absolute bundle directory\n * @param runner - Captured subprocess runner\n * @returns Completed verification result\n */\nasync function lintBundle(\n this: LocalContext,\n { fix, noInteractive, json }: LintCommandFlags,\n resolvedDir: string,\n runner: CapturedProcessRunner,\n): Promise<PolicyLintResult> {\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 result.status = 'failed';\n return result;\n }\n\n const manifestPath = path.join(resolvedDir, POLICY_MANIFEST_FILENAME);\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 = isInteractivePromptInvocation(\n { json, noInteractive },\n this.process.stdin.isTTY,\n this.process.stderr.isTTY,\n );\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', '--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 regalConfig = resolveRegalConfigFile(this, resolvedDir);\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', '-b', 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 -b failed with exit code ${testResult.code}`,\n ),\n );\n }\n }\n\n result.status = checks.some(({ status }) => status === 'failed') ? 'failed' : 'passed';\n return result;\n}\n\n/**\n * Verify local policy bundles with the shared upload contract, OPA, and Regal.\n *\n * With no directory (or the default workspace path), discovers every immediate\n * child that contains a `.manifest` and verifies each. Pass one bundle path to\n * verify a single publishable unit.\n *\n * @param this - CLI context\n * @param flags - Command flags\n * @param directory - Policy workspace or bundle directory\n * @param runner - Captured subprocess runner\n */\nexport async function lint(\n this: LocalContext,\n flags: LintCommandFlags,\n directory: string = DEFAULT_POLICY_PROJECT_DIRECTORY,\n runner: CapturedProcessRunner = runCapturedProcess,\n): Promise<void> {\n doneInputValidation(this.process);\n\n const { fix = false, noInteractive = false, json = false } = flags;\n const resolvedDir = resolvePolicyProjectDirectory(this.process.cwd(), directory);\n\n if (!this.fs.existsSync(resolvedDir) || !this.fs.statSync(resolvedDir).isDirectory()) {\n const missing: PolicyLintResult = {\n version: POLICY_LINT_RESULT_VERSION,\n status: 'failed',\n directory: resolvedDir,\n fix,\n tools: { opa: null, regal: null },\n checks: POLICY_LINT_CHECK_NAMES.map((name) => ({\n name,\n status: name === 'manifest' ? 'failed' : 'skipped',\n })),\n unformattedFiles: [],\n fixedFiles: [],\n diagnostics: [\n {\n code: 'project.directory',\n severity: 'error',\n message: `Policy directory does not exist or is not a directory: ${resolvedDir}`,\n path: path.relative(this.process.cwd(), resolvedDir),\n },\n ],\n };\n if (json) {\n this.process.stdout.write(`${JSON.stringify(missing)}\\n`);\n } else {\n renderResult(this, missing);\n }\n this.process.exitCode = 1;\n return;\n }\n\n const bundleDirectories = discoverPolicyBundleDirectories(this, resolvedDir);\n if (bundleDirectories.length === 0) {\n const empty: PolicyLintResult = {\n version: POLICY_LINT_RESULT_VERSION,\n status: 'failed',\n directory: resolvedDir,\n fix,\n tools: { opa: null, regal: null },\n checks: POLICY_LINT_CHECK_NAMES.map((name) => ({\n name,\n status: name === 'manifest' ? 'failed' : 'skipped',\n })),\n unformattedFiles: [],\n fixedFiles: [],\n diagnostics: [\n {\n code: 'project.bundles',\n severity: 'error',\n message:\n 'No publishable policy bundles found. Add one with `transcend policy new`, ' +\n 'or pass a directory that contains a `.manifest`.',\n path: path.relative(this.process.cwd(), resolvedDir) || '.',\n },\n ],\n };\n if (json) {\n this.process.stdout.write(`${JSON.stringify(empty)}\\n`);\n } else {\n renderResult(this, empty);\n }\n this.process.exitCode = 1;\n return;\n }\n\n const results: PolicyLintResult[] = [];\n for (const bundleDirectory of bundleDirectories) {\n results.push(\n await lintBundle.call(this, { fix, noInteractive, json }, bundleDirectory, runner),\n );\n }\n\n const failed = results.some((result) => result.status === 'failed');\n if (json) {\n if (results.length === 1) {\n this.process.stdout.write(`${JSON.stringify(results[0])}\\n`);\n } else {\n const multi: PolicyLintMultiResult = {\n version: POLICY_LINT_MULTI_RESULT_VERSION,\n status: failed ? 'failed' : 'passed',\n directory: resolvedDir,\n fix,\n results,\n };\n this.process.stdout.write(`${JSON.stringify(multi)}\\n`);\n }\n } else if (results.length === 1) {\n renderResult(this, results[0]!);\n } else {\n results.forEach((result, index) => {\n if (index > 0) {\n this.logger.info('');\n }\n const relative = path.relative(this.process.cwd(), result.directory) || result.directory;\n renderResult(this, result, `Policy verification — ${relative}`);\n });\n }\n\n if (failed) {\n this.process.exitCode = 1;\n }\n}\n"],"mappings":"2cAyBA,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,CCjCD,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,EAAK,CAAC,MAAM,EAAK,IAAI,CAAC,KAAK,IAAI,CAC/D,EAAK,MAAM,EAAK,IAAI,CAAC,KAAK,IAAI,CACnC,CACJ,CACF,CAAC,MAAM,CCuBV,SAAS,EACP,EACA,EACA,EAA2B,EACH,CACxB,OAAO,EAAQ,GACZ,YAAY,EAAkB,CAAE,cAAe,GAAM,CAAC,CACtD,MAAM,EAAM,IAAU,EAAK,KAAK,cAAc,EAAM,KAAK,CAAC,CAC1D,QAAS,GAAU,CAClB,IAAM,EAAe,EAAK,KAAK,EAAkB,EA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