@transcend-io/cli 12.1.5 → 13.0.2
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.
- package/README.md +64 -14
- package/dist/{app-BMLQABJX.mjs → app-CCGKgPiC.mjs} +19 -19
- package/dist/app-CCGKgPiC.mjs.map +1 -0
- package/dist/{approvePrivacyRequests-CY6rQT4J.mjs → approvePrivacyRequests-BBcqydVb.mjs} +2 -2
- package/dist/{approvePrivacyRequests-CY6rQT4J.mjs.map → approvePrivacyRequests-BBcqydVb.mjs.map} +1 -1
- package/dist/bin/bash-complete.mjs +1 -1
- package/dist/bin/cli.mjs +1 -1
- package/dist/bin/deprecated-command.mjs +1 -1
- package/dist/{buildExamples-BNGtj-DW.mjs → buildExamples-DRU0o6EK.mjs} +2 -2
- package/dist/{buildExamples-BNGtj-DW.mjs.map → buildExamples-DRU0o6EK.mjs.map} +1 -1
- package/dist/{buildXdiSyncEndpoint-BNCfOc-g.mjs → buildXdiSyncEndpoint-CSjQKSn3.mjs} +2 -2
- package/dist/{buildXdiSyncEndpoint-BNCfOc-g.mjs.map → buildXdiSyncEndpoint-CSjQKSn3.mjs.map} +1 -1
- package/dist/{bulkRestartRequests-CGvODu3r.mjs → bulkRestartRequests-Cx5LfpdX.mjs} +2 -2
- package/dist/{bulkRestartRequests-CGvODu3r.mjs.map → bulkRestartRequests-Cx5LfpdX.mjs.map} +1 -1
- package/dist/{bulkRetryEnrichers-BgDd4GWH.mjs → bulkRetryEnrichers-BSJtvqJD.mjs} +2 -2
- package/dist/{bulkRetryEnrichers-BgDd4GWH.mjs.map → bulkRetryEnrichers-BSJtvqJD.mjs.map} +1 -1
- package/dist/{cancelPrivacyRequests-Ccsiwrnu.mjs → cancelPrivacyRequests-Cy48R4tJ.mjs} +2 -2
- package/dist/{cancelPrivacyRequests-Ccsiwrnu.mjs.map → cancelPrivacyRequests-Cy48R4tJ.mjs.map} +1 -1
- package/dist/codecs-8T8Jhxsr.mjs +2 -0
- package/dist/codecs-8T8Jhxsr.mjs.map +1 -0
- package/dist/{command-BjzdoKgJ.mjs → command-Gip5wB8W.mjs} +2 -2
- package/dist/{command-BjzdoKgJ.mjs.map → command-Gip5wB8W.mjs.map} +1 -1
- package/dist/constants-D6y_AX3P.mjs +2 -0
- package/dist/constants-D6y_AX3P.mjs.map +1 -0
- package/dist/{constants-FDjw7bPS.mjs → constants-DAx9VK1C.mjs} +2 -2
- package/dist/{constants-FDjw7bPS.mjs.map → constants-DAx9VK1C.mjs.map} +1 -1
- package/dist/{createPoolingCommandUi-BdtnLBBM.mjs → createPoolingCommandUi-DZx16Cn8.mjs} +2 -2
- package/dist/{createPoolingCommandUi-BdtnLBBM.mjs.map → createPoolingCommandUi-DZx16Cn8.mjs.map} +1 -1
- package/dist/{downloadPrivacyRequestFiles-C9-xSCpt.mjs → downloadPrivacyRequestFiles-DBeuW9b3.mjs} +2 -2
- package/dist/{downloadPrivacyRequestFiles-C9-xSCpt.mjs.map → downloadPrivacyRequestFiles-DBeuW9b3.mjs.map} +1 -1
- package/dist/fetchAllRequests-BV9K0wXv.mjs +2 -0
- package/dist/fetchAllRequests-BV9K0wXv.mjs.map +1 -0
- package/dist/{fuzzyMatchColumns-D18n9Beu.mjs → fuzzyMatchColumns-Djl3a7lV.mjs} +2 -2
- package/dist/{fuzzyMatchColumns-D18n9Beu.mjs.map → fuzzyMatchColumns-Djl3a7lV.mjs.map} +1 -1
- package/dist/{generateCrossAccountApiKeys-FtWwlf_L.mjs → generateCrossAccountApiKeys-CjmSyfwm.mjs} +2 -2
- package/dist/{generateCrossAccountApiKeys-FtWwlf_L.mjs.map → generateCrossAccountApiKeys-CjmSyfwm.mjs.map} +1 -1
- package/dist/{impl-Dg7XSQdO2.mjs → impl-7qTKg-YP2.mjs} +2 -2
- package/dist/{impl-Dg7XSQdO2.mjs.map → impl-7qTKg-YP2.mjs.map} +1 -1
- package/dist/{impl-D58JUOdA.mjs → impl-9W0QG6fB.mjs} +2 -2
- package/dist/{impl-D58JUOdA.mjs.map → impl-9W0QG6fB.mjs.map} +1 -1
- package/dist/{impl-B94dMG4x2.mjs → impl-B-BkGfqq2.mjs} +2 -2
- package/dist/{impl-B94dMG4x2.mjs.map → impl-B-BkGfqq2.mjs.map} +1 -1
- package/dist/{impl-yIVxAhCG2.mjs → impl-B8DsKzNn2.mjs} +2 -2
- package/dist/{impl-yIVxAhCG2.mjs.map → impl-B8DsKzNn2.mjs.map} +1 -1
- package/dist/impl-B9jwlKCX2.mjs +2 -0
- package/dist/impl-B9jwlKCX2.mjs.map +1 -0
- package/dist/{impl-C3vTm9zQ.mjs → impl-BIhXJ0Nw.mjs} +2 -2
- package/dist/{impl-C3vTm9zQ.mjs.map → impl-BIhXJ0Nw.mjs.map} +1 -1
- package/dist/{impl-B_N_fOq0.mjs → impl-BLM6rMBq.mjs} +2 -2
- package/dist/{impl-B_N_fOq0.mjs.map → impl-BLM6rMBq.mjs.map} +1 -1
- package/dist/{impl-Hj5CgbWd.mjs → impl-BPmzcgpy.mjs} +2 -2
- package/dist/{impl-Hj5CgbWd.mjs.map → impl-BPmzcgpy.mjs.map} +1 -1
- package/dist/{impl-COqlYiiw.mjs → impl-BUKV7sYp.mjs} +2 -2
- package/dist/{impl-COqlYiiw.mjs.map → impl-BUKV7sYp.mjs.map} +1 -1
- package/dist/{impl-DFnWzZyY.mjs → impl-BahDGEJJ.mjs} +2 -2
- package/dist/{impl-DFnWzZyY.mjs.map → impl-BahDGEJJ.mjs.map} +1 -1
- package/dist/{impl-qNF5eqX-.mjs → impl-BfU0GFmW.mjs} +1 -1
- package/dist/{impl-qNF5eqX-.mjs.map → impl-BfU0GFmW.mjs.map} +1 -1
- package/dist/{impl-DDVhG8Gf.mjs → impl-Bh1CkZhV.mjs} +2 -2
- package/dist/{impl-DDVhG8Gf.mjs.map → impl-Bh1CkZhV.mjs.map} +1 -1
- package/dist/{impl-BvwRiPSG.mjs → impl-BkQryDNq.mjs} +2 -2
- package/dist/{impl-BvwRiPSG.mjs.map → impl-BkQryDNq.mjs.map} +1 -1
- package/dist/{impl-bl6NF3Lr.mjs → impl-BsdneZZP.mjs} +2 -2
- package/dist/{impl-bl6NF3Lr.mjs.map → impl-BsdneZZP.mjs.map} +1 -1
- package/dist/{impl-D6rMLiNB2.mjs → impl-BuOc87b6.mjs} +2 -2
- package/dist/impl-BuOc87b6.mjs.map +1 -0
- package/dist/{impl-DUYRVzMo.mjs → impl-BzzkiK_b.mjs} +1 -1
- package/dist/{impl-DUYRVzMo.mjs.map → impl-BzzkiK_b.mjs.map} +1 -1
- package/dist/{impl-ClT3G845.mjs → impl-C2BYhujB.mjs} +2 -2
- package/dist/{impl-ClT3G845.mjs.map → impl-C2BYhujB.mjs.map} +1 -1
- package/dist/{impl-DnDM9zcu.mjs → impl-C5qif_gE.mjs} +2 -2
- package/dist/{impl-DnDM9zcu.mjs.map → impl-C5qif_gE.mjs.map} +1 -1
- package/dist/{impl-BLtOfbtk.mjs → impl-C8auyA7u.mjs} +2 -2
- package/dist/{impl-BLtOfbtk.mjs.map → impl-C8auyA7u.mjs.map} +1 -1
- package/dist/{impl-BEiCEzl_2.mjs → impl-CHoglMch.mjs} +1 -1
- package/dist/impl-CHoglMch.mjs.map +1 -0
- package/dist/{impl-QD3_9HTk.mjs → impl-CJ4oVuXN.mjs} +2 -2
- package/dist/{impl-QD3_9HTk.mjs.map → impl-CJ4oVuXN.mjs.map} +1 -1
- package/dist/{impl-DhXzxQDN2.mjs → impl-CRif3TpB2.mjs} +2 -2
- package/dist/{impl-DhXzxQDN2.mjs.map → impl-CRif3TpB2.mjs.map} +1 -1
- package/dist/{impl-Cvyc-iTI2.mjs → impl-CWINXCFq2.mjs} +2 -2
- package/dist/{impl-Cvyc-iTI2.mjs.map → impl-CWINXCFq2.mjs.map} +1 -1
- package/dist/{impl-Dd39KsYO.mjs → impl-C_lIkMLn2.mjs} +2 -2
- package/dist/impl-C_lIkMLn2.mjs.map +1 -0
- package/dist/{impl-EDwngLc7.mjs → impl-CcPwm8a4.mjs} +2 -2
- package/dist/{impl-EDwngLc7.mjs.map → impl-CcPwm8a4.mjs.map} +1 -1
- package/dist/{impl-DGtCNANL.mjs → impl-CjjiXsMh.mjs} +2 -2
- package/dist/{impl-DGtCNANL.mjs.map → impl-CjjiXsMh.mjs.map} +1 -1
- package/dist/{impl-BLOhoP-b2.mjs → impl-CzFfjx8n2.mjs} +2 -2
- package/dist/{impl-BLOhoP-b2.mjs.map → impl-CzFfjx8n2.mjs.map} +1 -1
- package/dist/{impl-BXGpJz21.mjs → impl-D6e2LNBm.mjs} +2 -2
- package/dist/{impl-BXGpJz21.mjs.map → impl-D6e2LNBm.mjs.map} +1 -1
- package/dist/{impl-SOebshza.mjs → impl-D8yF0jw9.mjs} +2 -2
- package/dist/{impl-SOebshza.mjs.map → impl-D8yF0jw9.mjs.map} +1 -1
- package/dist/{impl-DeCRXfAh2.mjs → impl-DEF-meSg2.mjs} +2 -2
- package/dist/{impl-DeCRXfAh2.mjs.map → impl-DEF-meSg2.mjs.map} +1 -1
- package/dist/{impl-DZoTWLfw2.mjs → impl-DEPuP4Oy2.mjs} +2 -2
- package/dist/{impl-DZoTWLfw2.mjs.map → impl-DEPuP4Oy2.mjs.map} +1 -1
- package/dist/impl-DGLrKNNs2.mjs +2 -0
- package/dist/impl-DGLrKNNs2.mjs.map +1 -0
- package/dist/{impl-XxYQHKO5.mjs → impl-DPq1O87s.mjs} +2 -2
- package/dist/{impl-XxYQHKO5.mjs.map → impl-DPq1O87s.mjs.map} +1 -1
- package/dist/{impl-ChQAmyBN.mjs → impl-DiaD11OP.mjs} +2 -2
- package/dist/{impl-ChQAmyBN.mjs.map → impl-DiaD11OP.mjs.map} +1 -1
- package/dist/{impl-0-_oxvck.mjs → impl-DioQW8jR.mjs} +2 -2
- package/dist/{impl-0-_oxvck.mjs.map → impl-DioQW8jR.mjs.map} +1 -1
- package/dist/{impl-D6frX-PK.mjs → impl-DjBbx05w.mjs} +2 -2
- package/dist/{impl-D6frX-PK.mjs.map → impl-DjBbx05w.mjs.map} +1 -1
- package/dist/{impl-BCKUj-ko.mjs → impl-DnBmd-wi.mjs} +2 -2
- package/dist/{impl-BCKUj-ko.mjs.map → impl-DnBmd-wi.mjs.map} +1 -1
- package/dist/{impl-Cp5o0Q2g.mjs → impl-Do3hnGHt.mjs} +2 -2
- package/dist/{impl-Cp5o0Q2g.mjs.map → impl-Do3hnGHt.mjs.map} +1 -1
- package/dist/{impl-VSo8bO-J.mjs → impl-DqbJ33ve.mjs} +2 -2
- package/dist/{impl-VSo8bO-J.mjs.map → impl-DqbJ33ve.mjs.map} +1 -1
- package/dist/{impl-Cb-7C1Ml2.mjs → impl-DvHiVaGW.mjs} +12 -105
- package/dist/impl-DvHiVaGW.mjs.map +1 -0
- package/dist/{impl-CTOgxZFi.mjs → impl-Dx8BYv7U.mjs} +2 -2
- package/dist/{impl-CTOgxZFi.mjs.map → impl-Dx8BYv7U.mjs.map} +1 -1
- package/dist/{impl-Bz1wZxa-.mjs → impl-GphhprmF.mjs} +2 -2
- package/dist/{impl-Bz1wZxa-.mjs.map → impl-GphhprmF.mjs.map} +1 -1
- package/dist/{impl-agm4lpyq.mjs → impl-HsRwcfRu.mjs} +2 -2
- package/dist/{impl-agm4lpyq.mjs.map → impl-HsRwcfRu.mjs.map} +1 -1
- package/dist/{impl-BHEAKFX02.mjs → impl-LT1FBKID2.mjs} +2 -2
- package/dist/{impl-BHEAKFX02.mjs.map → impl-LT1FBKID2.mjs.map} +1 -1
- package/dist/{impl-xY_5o78i.mjs → impl-Nwbb2xaH.mjs} +2 -2
- package/dist/{impl-xY_5o78i.mjs.map → impl-Nwbb2xaH.mjs.map} +1 -1
- package/dist/{impl-CSnBFv5P.mjs → impl-SKxxByoN.mjs} +2 -2
- package/dist/{impl-CSnBFv5P.mjs.map → impl-SKxxByoN.mjs.map} +1 -1
- package/dist/{impl-ojAnhhbi.mjs → impl-bUltX0u3.mjs} +2 -2
- package/dist/{impl-ojAnhhbi.mjs.map → impl-bUltX0u3.mjs.map} +1 -1
- package/dist/{impl-Bs2pNgMK.mjs → impl-cU3bjY3P.mjs} +2 -2
- package/dist/{impl-Bs2pNgMK.mjs.map → impl-cU3bjY3P.mjs.map} +1 -1
- package/dist/{impl-xVmMN-Vt.mjs → impl-h0z8OSQY.mjs} +2 -2
- package/dist/{impl-xVmMN-Vt.mjs.map → impl-h0z8OSQY.mjs.map} +1 -1
- package/dist/{impl-Ay6JeH-7.mjs → impl-kuuX5KaC.mjs} +2 -2
- package/dist/{impl-Ay6JeH-7.mjs.map → impl-kuuX5KaC.mjs.map} +1 -1
- package/dist/{impl-Ar7VAh0Z.mjs → impl-nYlbrsD7.mjs} +2 -2
- package/dist/{impl-Ar7VAh0Z.mjs.map → impl-nYlbrsD7.mjs.map} +1 -1
- package/dist/{impl-zZd6fuXS.mjs → impl-nte7qanu.mjs} +2 -2
- package/dist/{impl-zZd6fuXS.mjs.map → impl-nte7qanu.mjs.map} +1 -1
- package/dist/{impl-ApZGIx6l.mjs → impl-o66EB2o7.mjs} +2 -2
- package/dist/{impl-ApZGIx6l.mjs.map → impl-o66EB2o7.mjs.map} +1 -1
- package/dist/{impl-BpVe6fMe.mjs → impl-yxR3rwGm.mjs} +2 -2
- package/dist/{impl-BpVe6fMe.mjs.map → impl-yxR3rwGm.mjs.map} +1 -1
- package/dist/index.d.mts +36 -26
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{inquirer-jzIQWAvq.mjs → inquirer-DK1JbPA0.mjs} +2 -2
- package/dist/{inquirer-jzIQWAvq.mjs.map → inquirer-DK1JbPA0.mjs.map} +1 -1
- package/dist/{markRequestDataSiloIdsCompleted-JGJf33yp.mjs → markRequestDataSiloIdsCompleted-loC-xyyW.mjs} +2 -2
- package/dist/{markRequestDataSiloIdsCompleted-JGJf33yp.mjs.map → markRequestDataSiloIdsCompleted-loC-xyyW.mjs.map} +1 -1
- package/dist/{markSilentPrivacyRequests-BTI3rH-V.mjs → markSilentPrivacyRequests-D7ncAg8k.mjs} +2 -2
- package/dist/{markSilentPrivacyRequests-BTI3rH-V.mjs.map → markSilentPrivacyRequests-D7ncAg8k.mjs.map} +1 -1
- package/dist/{mergeTranscendInputs-B7WjxYMN.mjs → mergeTranscendInputs-9kQ3t5VY.mjs} +2 -2
- package/dist/{mergeTranscendInputs-B7WjxYMN.mjs.map → mergeTranscendInputs-9kQ3t5VY.mjs.map} +1 -1
- package/dist/{notifyPrivacyRequestsAdditionalTime-n5fvOJaA.mjs → notifyPrivacyRequestsAdditionalTime-DpCfIR_O.mjs} +2 -2
- package/dist/{notifyPrivacyRequestsAdditionalTime-n5fvOJaA.mjs.map → notifyPrivacyRequestsAdditionalTime-DpCfIR_O.mjs.map} +1 -1
- package/dist/{policy-bundle-manifest-DbbTXe0u.mjs → policy-bundle-manifest-DW3Wilp8.mjs} +2 -2
- package/dist/{policy-bundle-manifest-DbbTXe0u.mjs.map → policy-bundle-manifest-DW3Wilp8.mjs.map} +1 -1
- package/dist/{policy-project-discovery-DTSl0Gfl.mjs → policy-project-discovery-CND7N2HI.mjs} +4 -4
- package/dist/policy-project-discovery-CND7N2HI.mjs.map +1 -0
- package/dist/{policy-scaffold-config-RpxwwZ2H.mjs → policy-scaffold-config-CwY0QZC0.mjs} +8 -8
- package/dist/policy-scaffold-config-CwY0QZC0.mjs.map +1 -0
- package/dist/{project-discovery-BkHpTXDx.mjs → project-discovery-g29vd44a.mjs} +2 -2
- package/dist/{project-discovery-BkHpTXDx.mjs.map → project-discovery-g29vd44a.mjs.map} +1 -1
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DbybCU2T.mjs → pullChunkedCustomSiloOutstandingIdentifiers-7qvaMN58.mjs} +2 -2
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-DbybCU2T.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-7qvaMN58.mjs.map} +1 -1
- package/dist/{pullManualEnrichmentIdentifiersToCsv-CxTPUfpV.mjs → pullManualEnrichmentIdentifiersToCsv-CWPs7VeX.mjs} +2 -2
- package/dist/{pullManualEnrichmentIdentifiersToCsv-CxTPUfpV.mjs.map → pullManualEnrichmentIdentifiersToCsv-CWPs7VeX.mjs.map} +1 -1
- package/dist/{pushCronIdentifiersFromCsv-CeRVlbFE.mjs → pushCronIdentifiersFromCsv-DQoliMdQ.mjs} +2 -2
- package/dist/{pushCronIdentifiersFromCsv-CeRVlbFE.mjs.map → pushCronIdentifiersFromCsv-DQoliMdQ.mjs.map} +1 -1
- package/dist/{pushManualEnrichmentIdentifiersFromCsv--4dYCvyv.mjs → pushManualEnrichmentIdentifiersFromCsv-R9BXYuFk.mjs} +2 -2
- package/dist/{pushManualEnrichmentIdentifiersFromCsv--4dYCvyv.mjs.map → pushManualEnrichmentIdentifiersFromCsv-R9BXYuFk.mjs.map} +1 -1
- package/dist/{readTranscendYaml-BfqQbPiT.mjs → readTranscendYaml-D576bvzR.mjs} +2 -2
- package/dist/{readTranscendYaml-BfqQbPiT.mjs.map → readTranscendYaml-D576bvzR.mjs.map} +1 -1
- package/dist/{removeUnverifiedRequestIdentifiers-CV6JGgt_.mjs → removeUnverifiedRequestIdentifiers-CgnfHdbc.mjs} +2 -2
- package/dist/{removeUnverifiedRequestIdentifiers-CV6JGgt_.mjs.map → removeUnverifiedRequestIdentifiers-CgnfHdbc.mjs.map} +1 -1
- package/dist/{retryRequestDataSilos-_OThvVwU.mjs → retryRequestDataSilos-BrLLNQqT.mjs} +2 -2
- package/dist/{retryRequestDataSilos-_OThvVwU.mjs.map → retryRequestDataSilos-BrLLNQqT.mjs.map} +1 -1
- package/dist/runRegalLintStep-DPaMm7Gg.mjs +3 -0
- package/dist/runRegalLintStep-DPaMm7Gg.mjs.map +1 -0
- package/dist/{scaffold-planning-BrX-pcz6.mjs → scaffold-planning-Bp_yqZWx.mjs} +2 -2
- package/dist/{scaffold-planning-BrX-pcz6.mjs.map → scaffold-planning-Bp_yqZWx.mjs.map} +1 -1
- package/dist/{skipPreflightJobs-D8og5pKe.mjs → skipPreflightJobs-CqjpB7ug.mjs} +2 -2
- package/dist/{skipPreflightJobs-D8og5pKe.mjs.map → skipPreflightJobs-CqjpB7ug.mjs.map} +1 -1
- package/dist/{skipRequestDataSilos-DUQ6AD_O.mjs → skipRequestDataSilos-DPi6-XVr.mjs} +2 -2
- package/dist/{skipRequestDataSilos-DUQ6AD_O.mjs.map → skipRequestDataSilos-DPi6-XVr.mjs.map} +1 -1
- package/dist/{streamPrivacyRequestsToCsv-BApu4dvI.mjs → streamPrivacyRequestsToCsv-DVPQ860_.mjs} +2 -2
- package/dist/{streamPrivacyRequestsToCsv-BApu4dvI.mjs.map → streamPrivacyRequestsToCsv-DVPQ860_.mjs.map} +1 -1
- package/dist/{updateConsentManagerVersionToLatest-BrgPZ5hX.mjs → updateConsentManagerVersionToLatest-gJMWny-i.mjs} +2 -2
- package/dist/{updateConsentManagerVersionToLatest-BrgPZ5hX.mjs.map → updateConsentManagerVersionToLatest-gJMWny-i.mjs.map} +1 -1
- package/dist/{uploadConsents-DRlDHQak.mjs → uploadConsents-5HlMj7EK.mjs} +2 -2
- package/dist/{uploadConsents-DRlDHQak.mjs.map → uploadConsents-5HlMj7EK.mjs.map} +1 -1
- package/dist/uploadPrivacyRequestsFromCsv-Dh8KEW3n.mjs +2 -0
- package/dist/uploadPrivacyRequestsFromCsv-Dh8KEW3n.mjs.map +1 -0
- package/dist/{validateTranscendAuth-D-dDINof.mjs → validateTranscendAuth-BrVGfq6X.mjs} +2 -2
- package/dist/{validateTranscendAuth-D-dDINof.mjs.map → validateTranscendAuth-BrVGfq6X.mjs.map} +1 -1
- package/package.json +22 -22
- package/dist/app-BMLQABJX.mjs.map +0 -1
- package/dist/codecs-CfcaFoZR.mjs +0 -2
- package/dist/codecs-CfcaFoZR.mjs.map +0 -1
- package/dist/constants-DlH2vWm_.mjs +0 -2
- package/dist/constants-DlH2vWm_.mjs.map +0 -1
- package/dist/fetchAllRequests-BI0tFl_a.mjs +0 -2
- package/dist/fetchAllRequests-BI0tFl_a.mjs.map +0 -1
- package/dist/impl-BEiCEzl_2.mjs.map +0 -1
- package/dist/impl-Cb-7C1Ml2.mjs.map +0 -1
- package/dist/impl-D6rMLiNB2.mjs.map +0 -1
- package/dist/impl-DNOgBcsu.mjs +0 -3
- package/dist/impl-DNOgBcsu.mjs.map +0 -1
- package/dist/impl-Dd39KsYO.mjs.map +0 -1
- package/dist/policy-project-discovery-DTSl0Gfl.mjs.map +0 -1
- package/dist/policy-scaffold-config-RpxwwZ2H.mjs.map +0 -1
- package/dist/uploadPrivacyRequestsFromCsv-FAGllBdd.mjs +0 -2
- package/dist/uploadPrivacyRequestsFromCsv-FAGllBdd.mjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,n as t,t as n}from"./policy-project-discovery-CND7N2HI.mjs";import{t as r}from"./done-input-validation-LiTaCEzF.mjs";import{t as i}from"./run-captured-process-BjaSDWXG.mjs";import{n as a,r as o,t as s}from"./runRegalLintStep-DPaMm7Gg.mjs";import c from"node:path";import l from"colors";const u=[`opa-version`,`regal-version`,`format`,`regal-lint`],d={"opa-version":`OPA 1.x`,"regal-version":`Regal`,format:`OPA formatting`,"regal-lint":`Regal lint`};function f(e,t,n){n?e.logger.info(`${l.bold(n)}\n`):e.logger.info(`${l.bold(`Policy lint`)}\n`),t.checks.forEach(({name:n,status:r})=>{let i=r===`passed`?`PASS`:r===`failed`?`FAIL`:`SKIP`,a=r===`passed`?l.green(i):r===`failed`?l.red(i):l.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} ${d[n]}${o}`)}),t.diagnostics.length>0&&e.logger.error(``),t.diagnostics.forEach(t=>{let n=t.path?`${t.path}: `:``;e.logger.error(l.red(`error [${t.code}]: ${n}${t.message}`))}),t.status===`passed`?(e.logger.info(``),e.logger.info(l.green(`Policy lint passed.`))):(e.logger.error(``),e.logger.error(l.red(`Policy lint failed.`)))}async function p({fix:e,noInteractive:t,json:n},r,i){let l=u.map(e=>({name:e,status:`skipped`})),d=[],f={version:1,status:`passed`,directory:r,fix:e,tools:{opa:null,regal:null},checks:l,unformattedFiles:[],fixedFiles:[],diagnostics:d},p=(e,t)=>{l.find(t=>t.name===e).status=t},m=(e,t,n)=>{d.push({code:e,severity:`error`,message:t,...n?{path:n}:{}})};if(!this.fs.existsSync(r)||!this.fs.statSync(r).isDirectory())return p(`opa-version`,`failed`),m(`project.directory`,`Policy directory does not exist or is not a directory: ${r}`,c.relative(this.process.cwd(),r)),f.status=`failed`,f;let h=await o.call(this,r,i);if(f.tools={opa:h.opa,regal:h.regal},p(`opa-version`,h.opaStatus),p(`regal-version`,h.regalStatus),h.diagnostics.forEach(e=>{m(e.code,e.message)}),f.tools.opa){let o=await a.call(this,{resolvedDir:r,fix:e,noInteractive:t,json:n,fixCommandHint:`transcend policy lint --fix`,runner:i});f.unformattedFiles=o.unformattedFiles,f.fixedFiles=o.fixedFiles,p(`format`,o.status),o.diagnostics.forEach(e=>{m(e.code,e.message)})}if(f.tools.regal){let e=await s.call(this,{resolvedDir:r,runner:i});p(`regal-lint`,e.status),e.diagnostics.forEach(e=>{m(e.code,e.message)})}return f.status=l.some(({status:e})=>e===`failed`)?`failed`:`passed`,f}async function m(a,o=n,s=i){r(this.process);let{fix:l=!1,noInteractive:d=!1,json:m=!1}=a,h=e(this.process.cwd(),o);if(!this.fs.existsSync(h)||!this.fs.statSync(h).isDirectory()){let e={version:1,status:`failed`,directory:h,fix:l,tools:{opa:null,regal:null},checks:u.map(e=>({name:e,status:e===`opa-version`?`failed`:`skipped`})),unformattedFiles:[],fixedFiles:[],diagnostics:[{code:`project.directory`,severity:`error`,message:`Policy directory does not exist or is not a directory: ${h}`,path:c.relative(this.process.cwd(),h)}]};m?this.process.stdout.write(`${JSON.stringify(e)}\n`):f(this,e),this.process.exitCode=1;return}let g=t(this,h);if(g.length===0){let e={version:1,status:`failed`,directory:h,fix:l,tools:{opa:null,regal:null},checks:u.map(e=>({name:e,status:e===`opa-version`?`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:c.relative(this.process.cwd(),h)||`.`}]};m?this.process.stdout.write(`${JSON.stringify(e)}\n`):f(this,e),this.process.exitCode=1;return}let _=[];for(let e of g)_.push(await p.call(this,{fix:l,noInteractive:d,json:m},e,s));let v=_.some(e=>e.status===`failed`);if(m)if(_.length===1)this.process.stdout.write(`${JSON.stringify(_[0])}\n`);else{let e={version:1,status:v?`failed`:`passed`,directory:h,fix:l,results:_};this.process.stdout.write(`${JSON.stringify(e)}\n`)}else _.length===1?f(this,_[0]):_.forEach((e,t)=>{t>0&&this.logger.info(``);let n=c.relative(this.process.cwd(),e.directory)||e.directory;f(this,e,`Policy lint — ${n}`)});v&&(this.process.exitCode=1)}export{m as lint};
|
|
2
|
+
//# sourceMappingURL=impl-DGLrKNNs2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impl-DGLrKNNs2.mjs","names":[],"sources":["../src/lib/policy/policy-lint-model.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 = 1;\n\n/** Status of the lint gate or an individual step. */\nexport type PolicyLintStatus = 'passed' | 'failed' | 'skipped';\n\n/** One named policy lint step. */\nexport interface PolicyLintStep {\n /** Stable step name. */\n name: 'opa-version' | 'regal-version' | 'format' | 'regal-lint';\n /** Step outcome. */\n status: PolicyLintStatus;\n}\n\n/** Stable lint step execution order. */\nexport const POLICY_LINT_STEP_NAMES: PolicyLintStep['name'][] = [\n 'opa-version',\n 'regal-version',\n 'format',\n 'regal-lint',\n];\n\n/** User-facing lint step labels. */\nexport const POLICY_LINT_STEP_LABELS: Readonly<Record<PolicyLintStep['name'], string>> = {\n 'opa-version': 'OPA 1.x',\n 'regal-version': 'Regal',\n format: 'OPA formatting',\n 'regal-lint': 'Regal lint',\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 lint 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 /** Lint step outcomes in stable execution order. */\n checks: PolicyLintStep[];\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 lint diagnostics. */\n diagnostics: PolicyLintDiagnostic[];\n}\n\n/**\n * Stable result when `transcend policy lint --json` lints 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 lint 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 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 {\n type PolicyLintDiagnostic,\n type PolicyLintMultiResult,\n type PolicyLintResult,\n type PolicyLintStep,\n POLICY_LINT_MULTI_RESULT_VERSION,\n POLICY_LINT_RESULT_VERSION,\n POLICY_LINT_STEP_LABELS,\n POLICY_LINT_STEP_NAMES,\n} from '../../../lib/policy/policy-lint-model.js';\nimport {\n DEFAULT_POLICY_PROJECT_DIRECTORY,\n discoverPolicyBundleDirectories,\n resolvePolicyProjectDirectory,\n} from '../../../lib/policy/policy-project-discovery.js';\nimport { probePolicyToolVersions } from '../helpers/probePolicyToolVersions.js';\nimport { runOpaFormatStep } from '../helpers/runOpaFormatStep.js';\nimport { runRegalLintStep } from '../helpers/runRegalLintStep.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 * Render the terminal summary for a policy lint result.\n *\n * @param context - CLI context\n * @param result - Completed lint 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 lint')}\\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_STEP_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 lint passed.'));\n } else {\n context.logger.error('');\n context.logger.error(colors.red('Policy lint failed.'));\n }\n}\n\n/**\n * Lint one publishable policy bundle directory (format + Regal).\n *\n * @param this - CLI context\n * @param flags - Command flags\n * @param resolvedDir - Absolute bundle directory\n * @param runner - Captured subprocess runner\n * @returns Completed lint 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: PolicyLintStep[] = POLICY_LINT_STEP_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: PolicyLintStep['name'], status: PolicyLintStep['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('opa-version', '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 toolVersions = await probePolicyToolVersions.call(this, resolvedDir, runner);\n result.tools = { opa: toolVersions.opa, regal: toolVersions.regal };\n setStatus('opa-version', toolVersions.opaStatus);\n setStatus('regal-version', toolVersions.regalStatus);\n toolVersions.diagnostics.forEach((diagnostic) => {\n addError(diagnostic.code, diagnostic.message);\n });\n\n if (result.tools.opa) {\n const formatStep = await runOpaFormatStep.call(this, {\n resolvedDir,\n fix,\n noInteractive,\n json,\n fixCommandHint: 'transcend policy lint --fix',\n runner,\n });\n result.unformattedFiles = formatStep.unformattedFiles;\n result.fixedFiles = formatStep.fixedFiles;\n setStatus('format', formatStep.status);\n formatStep.diagnostics.forEach((diagnostic) => {\n addError(diagnostic.code, diagnostic.message);\n });\n }\n\n if (result.tools.regal) {\n const regalStep = await runRegalLintStep.call(this, { resolvedDir, runner });\n setStatus('regal-lint', regalStep.status);\n regalStep.diagnostics.forEach((diagnostic) => {\n addError(diagnostic.code, diagnostic.message);\n });\n }\n\n result.status = checks.some(({ status }) => status === 'failed') ? 'failed' : 'passed';\n return result;\n}\n\n/**\n * Lint local policy bundles with OPA formatting and Regal.\n *\n * With no directory (or the default workspace path), discovers every immediate\n * child that contains a `.manifest` and lints each. Pass one bundle path to\n * lint 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_STEP_NAMES.map((name) => ({\n name,\n status: name === 'opa-version' ? '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_STEP_NAMES.map((name) => ({\n name,\n status: name === 'opa-version' ? '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 lint — ${relative}`);\n });\n }\n\n if (failed) {\n this.process.exitCode = 1;\n }\n}\n"],"mappings":"4SAkBA,MAAa,EAAmD,CAC9D,cACA,gBACA,SACA,aACD,CAGY,EAA4E,CACvF,cAAe,UACf,gBAAiB,QACjB,OAAQ,iBACR,aAAc,aACf,CCeD,SAAS,EAAa,EAAuB,EAA0B,EAAwB,CACzF,EACF,EAAQ,OAAO,KAAK,GAAG,EAAO,KAAK,EAAQ,CAAC,IAAI,CAEhD,EAAQ,OAAO,KAAK,GAAG,EAAO,KAAK,cAAc,CAAC,IAAI,CAExD,EAAO,OAAO,SAAS,CAAE,OAAM,YAAa,CAC1C,IAAM,EAAQ,IAAW,SAAW,OAAS,IAAW,SAAW,OAAS,OACtE,EACJ,IAAW,SACP,EAAO,MAAM,EAAM,CACnB,IAAW,SACT,EAAO,IAAI,EAAM,CACjB,EAAO,OAAO,EAAM,CACtB,EACJ,IAAS,eAAiB,EAAO,MAAM,IACnC,KAAK,EAAO,MAAM,IAAI,GACtB,IAAS,iBAAmB,EAAO,MAAM,MACvC,KAAK,EAAO,MAAM,MAAM,GACxB,GACR,EAAQ,OAAO,KAAK,GAAG,EAAY,GAAG,EAAwB,KAAQ,IAAU,EAChF,CACE,EAAO,YAAY,OAAS,GAC9B,EAAQ,OAAO,MAAM,GAAG,CAE1B,EAAO,YAAY,QAAS,GAAe,CACzC,IAAM,EAAW,EAAW,KAAO,GAAG,EAAW,KAAK,IAAM,GAC5D,EAAQ,OAAO,MACb,EAAO,IAAI,UAAU,EAAW,KAAK,KAAK,IAAW,EAAW,UAAU,CAC3E,EACD,CACE,EAAO,SAAW,UACpB,EAAQ,OAAO,KAAK,GAAG,CACvB,EAAQ,OAAO,KAAK,EAAO,MAAM,sBAAsB,CAAC,GAExD,EAAQ,OAAO,MAAM,GAAG,CACxB,EAAQ,OAAO,MAAM,EAAO,IAAI,sBAAsB,CAAC,EAa3D,eAAe,EAEb,C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URL=impl-
|
|
1
|
+
import{t as e}from"./uploadPrivacyRequestsFromCsv-Dh8KEW3n.mjs";import{t}from"./done-input-validation-LiTaCEzF.mjs";import{splitCsvToList as n}from"@transcend-io/utils";async function r({auth:r,file:i,transcendUrl:a,cacheFilepath:o,requestReceiptFolder:s,sombraAuth:c,concurrency:l,attributes:u,isTest:d,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,skipFilterStep:h,dryRun:g,debug:_,defaultPhoneCountryCode:v}){t(this.process),await e({cacheFilepath:o,requestReceiptFolder:s,file:i,auth:r,sombraAuth:c,concurrency:l,transcendUrl:a,defaultPhoneCountryCode:v,attributes:n(u),debug:_,skipFilterStep:h,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,isTest:d,dryRun:g})}export{r as upload};
|
|
2
|
+
//# sourceMappingURL=impl-DPq1O87s.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-DPq1O87s.mjs","names":[],"sources":["../src/commands/request/upload/impl.ts"],"sourcesContent":["import { splitCsvToList } from '@transcend-io/utils';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { uploadPrivacyRequestsFromCsv } from '../../../lib/requests/index.js';\n\nexport interface UploadCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n cacheFilepath: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n attributes: string;\n isTest: boolean;\n isSilent: boolean;\n skipSendingReceipt: boolean;\n emailIsVerified: boolean;\n skipFilterStep: boolean;\n dryRun: boolean;\n debug: boolean;\n defaultPhoneCountryCode: string;\n}\n\nexport async function upload(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n cacheFilepath,\n requestReceiptFolder,\n sombraAuth,\n concurrency,\n attributes,\n isTest,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n skipFilterStep,\n dryRun,\n debug,\n defaultPhoneCountryCode,\n }: UploadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await uploadPrivacyRequestsFromCsv({\n cacheFilepath,\n requestReceiptFolder,\n file,\n auth,\n sombraAuth,\n concurrency,\n transcendUrl,\n defaultPhoneCountryCode,\n attributes: splitCsvToList(attributes),\n debug,\n skipFilterStep,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n isTest,\n dryRun,\n });\n}\n"],"mappings":"yKAyBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,gBACA,uBACA,aACA,cACA,aACA,SACA,WACA,qBACA,kBACA,iBACA,SACA,QACA,2BAEa,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAA6B,CACjC,gBACA,uBACA,OACA,OACA,aACA,cACA,eACA,0BACA,WAAY,EAAe,EAAW,CACtC,QACA,iBACA,WACA,qBACA,kBACA,SACA,SACD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./constants-
|
|
1
|
+
import{r as e}from"./constants-DAx9VK1C.mjs";import{a as t}from"./writeCsv-CNZrq3zU.mjs";import{t as n}from"./pullConsentManagerMetrics-DKCkfbCB.mjs";import{t as r}from"./validateTranscendAuth-BrVGfq6X.mjs";import{t as i}from"./done-input-validation-LiTaCEzF.mjs";import{ConsentManagerMetricBin as a}from"@transcend-io/privacy-types";import o from"node:path";import s from"colors";import{map as c,mapSeries as l}from"@transcend-io/utils";import{buildTranscendGraphQLClient as u}from"@transcend-io/sdk";async function d({auth:d,start:f,end:p,folder:m,bin:h,transcendUrl:g}){let _=h;Object.values(a).includes(_)||(this.logger.error(s.red(`Failed to parse argument "bin" with value "${h}"\nExpected one of: \n${Object.values(a).join(`
|
|
2
2
|
`)}`)),this.process.exit(1));let v=new Date(f),y=p?new Date(p):new Date;Number.isNaN(v.getTime())&&(this.logger.error(s.red(`Start date provided is invalid date. Got --start="${f}" expected --start="01/01/2023"`)),this.process.exit(1)),Number.isNaN(y.getTime())&&(this.logger.error(s.red(`End date provided is invalid date. Got --end="${p}" expected --end="01/01/2023"`)),this.process.exit(1)),v>y&&(this.logger.error(s.red(`Got a start date "${v.toISOString()}" that was larger than the end date "${y.toISOString()}". Start date must be before end date.`)),this.process.exit(1)),i(this.process);let b=await r(d,this);if(this.fs.existsSync(m)&&!this.fs.lstatSync(m).isDirectory()&&(this.logger.error(s.red(`The provided argument "folder" was passed a file. expected: folder="./consent-metrics/"`)),this.process.exit(1)),this.fs.existsSync(m)||this.fs.mkdirSync(m),this.logger.info(s.magenta(`Pulling consent metrics from start=${v.toString()} to end=${y.toISOString()} with bin size "${h}"`)),typeof b==`string`){try{let e=await n(u(g,b),{bin:_,start:v,end:y});await c(Object.entries(e),async([e,n])=>{await c(n,async({points:n,name:r})=>{let i=o.join(m,`${e}_${r}.csv`);this.logger.info(s.magenta(`Writing configuration to file "${i}"...`)),await t(i,n.map(({key:e,value:t})=>({timestamp:e,value:t})))},{concurrency:5})},{concurrency:5})}catch(e){this.logger.error(s.red(`An error occurred syncing the schema: ${e.message}`)),this.process.exit(1)}this.logger.info(s.green(`Successfully synced consent metrics to disk in folder "${m}"! View at ${e}`))}else{let r=[];await l(b,async(e,i)=>{let a=`[${i+1}/${b.length}][${e.organizationName}] `;this.logger.info(s.magenta(`~~~\n\n${a}Attempting to pull consent metrics...\n\n~~~`));let c=u(g,e.apiKey);try{let r=await n(c,{bin:_,start:v,end:y}),i=o.join(m,e.organizationName);this.fs.existsSync(i)||this.fs.mkdirSync(i),Object.entries(r).forEach(([e,n])=>{n.forEach(({points:n,name:r})=>{let a=o.join(i,`${e}_${r}.csv`);this.logger.info(s.magenta(`Writing configuration to file "${a}"...`)),t(a,n.map(({key:e,value:t})=>({timestamp:e,value:t})))})}),this.logger.info(s.green(`${a}Successfully pulled configuration!`))}catch(t){this.logger.error(s.red(`${a}Failed to sync configuration.`),t),r.push(e.organizationName)}}),r.length>0&&(this.logger.info(s.red(`Sync encountered errors for "${r.join(`,`)}". View output above for more information, or check out ${e}`)),this.process.exit(1))}}export{d as pullConsentMetrics};
|
|
3
|
-
//# sourceMappingURL=impl-
|
|
3
|
+
//# sourceMappingURL=impl-DiaD11OP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-DiaD11OP.mjs","names":[],"sources":["../src/commands/consent/pull-consent-metrics/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { ConsentManagerMetricBin } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { map, mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullConsentManagerMetrics } from '../../../lib/consent-manager/index.js';\nimport { writeCsv } from '../../../lib/helpers/index.js';\n\nexport interface PullConsentMetricsCommandFlags {\n auth: string;\n start: Date;\n end?: Date;\n folder: string;\n bin: string;\n transcendUrl: string;\n}\n\nexport async function pullConsentMetrics(\n this: LocalContext,\n { auth, start, end, folder, bin, transcendUrl }: PullConsentMetricsCommandFlags,\n): Promise<void> {\n // Validate bin\n const parsedBin = bin as ConsentManagerMetricBin;\n if (!Object.values(ConsentManagerMetricBin).includes(parsedBin)) {\n this.logger.error(\n colors.red(\n `Failed to parse argument \"bin\" with value \"${bin}\"\\n` +\n `Expected one of: \\n${Object.values(ConsentManagerMetricBin).join('\\n')}`,\n ),\n );\n this.process.exit(1);\n }\n\n // Parse the dates\n const startDate = new Date(start);\n const endDate = end ? new Date(end) : new Date();\n if (Number.isNaN(startDate.getTime())) {\n this.logger.error(\n colors.red(\n `Start date provided is invalid date. Got --start=\"${start}\" expected --start=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (Number.isNaN(endDate.getTime())) {\n this.logger.error(\n colors.red(\n `End date provided is invalid date. Got --end=\"${end}\" expected --end=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (startDate > endDate) {\n this.logger.error(\n colors.red(\n `Got a start date \"${startDate.toISOString()}\" that was larger than the end date \"${endDate.toISOString()}\". ` +\n 'Start date must be before end date.',\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth, this);\n\n // Ensure folder either does not exist or is not a file\n if (this.fs.existsSync(folder) && !this.fs.lstatSync(folder).isDirectory()) {\n this.logger.error(\n colors.red(\n 'The provided argument \"folder\" was passed a file. expected: folder=\"./consent-metrics/\"',\n ),\n );\n this.process.exit(1);\n }\n\n // Create the folder if it does not exist\n if (!this.fs.existsSync(folder)) {\n this.fs.mkdirSync(folder);\n }\n\n this.logger.info(\n colors.magenta(\n `Pulling consent metrics from start=${startDate.toString()} to end=${endDate.toISOString()} with bin size \"${bin}\"`,\n ),\n );\n\n // Sync to Disk\n if (typeof apiKeyOrList === 'string') {\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList);\n\n // Pull the metrics\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // Write to file\n await map(\n Object.entries(configuration),\n async ([metricName, metrics]) => {\n await map(\n metrics,\n async ({ points, name }) => {\n const file = path.join(folder, `${metricName}_${name}.csv`);\n this.logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n await writeCsv(\n file,\n points.map(({ key, value }: { key: string; value: string }) => ({\n timestamp: key,\n value,\n })),\n );\n },\n {\n concurrency: 5,\n },\n );\n },\n { concurrency: 5 },\n );\n } catch (err) {\n this.logger.error(colors.red(`An error occurred syncing the schema: ${err.message}`));\n this.process.exit(1);\n }\n\n // Indicate success\n this.logger.info(\n colors.green(\n `Successfully synced consent metrics to disk in folder \"${folder}\"! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n this.logger.info(\n colors.magenta(`~~~\\n\\n${prefix}Attempting to pull consent metrics...\\n\\n~~~`),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // ensure folder exists for that organization\n const subFolder = path.join(folder, apiKey.organizationName);\n if (!this.fs.existsSync(subFolder)) {\n this.fs.mkdirSync(subFolder);\n }\n\n // Write to file\n Object.entries(configuration).forEach(([metricName, metrics]) => {\n metrics.forEach(({ points, name }) => {\n const file = path.join(subFolder, `${metricName}_${name}.csv`);\n this.logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n writeCsv(\n file,\n points.map(({ key, value }: { key: string; value: string }) => ({\n timestamp: key,\n value,\n })),\n );\n });\n });\n\n this.logger.info(colors.green(`${prefix}Successfully pulled configuration!`));\n } catch (err) {\n this.logger.error(colors.red(`${prefix}Failed to sync configuration.`), err);\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n this.logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n}\n"],"mappings":"sfAuBA,eAAsB,EAEpB,CAAE,OAAM,QAAO,MAAK,SAAQ,MAAK,gBAClB,CAEf,IAAM,EAAY,EACb,OAAO,OAAO,EAAwB,CAAC,SAAS,EAAU,GAC7D,KAAK,OAAO,MACV,EAAO,IACL,8CAA8C,EAAI,wBAC1B,OAAO,OAAO,EAAwB,CAAC,KAAK;EAAK,GAC1E,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAItB,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,MAAM,EAAO,IAAI,GAAG,EAAO,+BAA+B,CAAE,EAAI,CAC5E,EAAkB,KAAK,EAAO,iBAAiB,GAEjD,CAEE,EAAkB,OAAS,IAC7B,KAAK,OAAO,KACV,EAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0D,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./validateTranscendAuth-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./validateTranscendAuth-BrVGfq6X.mjs";import{t}from"./done-input-validation-LiTaCEzF.mjs";import{t as n}from"./command-output-BJcDRXNr.mjs";import{t as r}from"./command-output-BRfF3YFv.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,fetchAllCustomFunctions as o}from"@transcend-io/sdk";async function s({auth:s,transcendUrl:c,json:l}){t(this.process);let u=e(s,this);Array.isArray(u)&&(this.logger.error(i.red(`transcend custom-functions list does not support a list of API keys — pass a single API key.`)),this.process.exit(1));let d=await o(a(c,u),{logger:n(this.logger,l)});if(l){let e=r(d);this.process.stdout.write(`${JSON.stringify(e)}\n`);return}if(d.length===0){this.logger.info(i.yellow(`No custom functions found in this organization.`));return}this.logger.info(i.magenta(`Found ${d.length} custom function(s):`)),d.forEach(e=>{let t=e.activeVersion?`active v${e.activeVersion.versionNumber}`:`no active version`,n=e.hasPendingDraft&&e.draftVersion?`, pending draft v${e.draftVersion.versionNumber}`:``;this.logger.info(` - ${i.green(e.name)} [${e.type}] (${e.lifecycleState.toLowerCase()}, ${t}${n}) `+i.dim(`id: ${e.id}`))})}export{s as list};
|
|
2
|
+
//# sourceMappingURL=impl-DioQW8jR.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-DioQW8jR.mjs","names":[],"sources":["../src/commands/custom-functions/list/impl.ts"],"sourcesContent":["import { buildTranscendGraphQLClient, fetchAllCustomFunctions } from '@transcend-io/sdk';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { selectCommandLogger } from '../../../lib/cli/command-output.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { buildCustomFunctionListJsonResult } from '../../../lib/custom-functions/command-output.js';\n\nexport interface CustomFunctionsListCommandFlags {\n /** Transcend API key. */\n auth: string;\n /** Transcend backend URL. */\n transcendUrl: string;\n /** Emit stable JSON output. */\n json: boolean;\n}\n\nexport async function list(\n this: LocalContext,\n { auth, transcendUrl, json }: CustomFunctionsListCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n const apiKeyOrList = validateTranscendAuth(auth, this);\n if (Array.isArray(apiKeyOrList)) {\n this.logger.error(\n colors.red(\n 'transcend custom-functions list does not support a list of API keys — pass a single API key.',\n ),\n );\n this.process.exit(1);\n }\n\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList as string);\n const commandLogger = selectCommandLogger(this.logger, json);\n const customFunctions = await fetchAllCustomFunctions(client, { logger: commandLogger });\n\n if (json) {\n const result = buildCustomFunctionListJsonResult(customFunctions);\n this.process.stdout.write(`${JSON.stringify(result)}\\n`);\n return;\n }\n\n if (customFunctions.length === 0) {\n this.logger.info(colors.yellow('No custom functions found in this organization.'));\n return;\n }\n\n this.logger.info(colors.magenta(`Found ${customFunctions.length} custom function(s):`));\n customFunctions.forEach((customFunction) => {\n const active = customFunction.activeVersion\n ? `active v${customFunction.activeVersion.versionNumber}`\n : 'no active version';\n const draft =\n customFunction.hasPendingDraft && customFunction.draftVersion\n ? `, pending draft v${customFunction.draftVersion.versionNumber}`\n : '';\n this.logger.info(\n ` - ${colors.green(customFunction.name)} [${customFunction.type}] ` +\n `(${customFunction.lifecycleState.toLowerCase()}, ${active}${draft}) ` +\n colors.dim(`id: ${customFunction.id}`),\n );\n });\n}\n"],"mappings":"oUAkBA,eAAsB,EAEpB,CAAE,OAAM,eAAc,QACP,CACf,EAAoB,KAAK,QAAQ,CAEjC,IAAM,EAAe,EAAsB,EAAM,KAAK,CAClD,MAAM,QAAQ,EAAa,GAC7B,KAAK,OAAO,MACV,EAAO,IACL,+FACD,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAKtB,IAAM,EAAkB,MAAM,EAFf,EAA4B,EAAc,EAEG,CAAE,CAAE,OAD1C,EAAoB,KAAK,OAAQ,EAC8B,CAAE,CAAC,CAExF,GAAI,EAAM,CACR,IAAM,EAAS,EAAkC,EAAgB,CACjE,KAAK,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,EAAO,CAAC,IAAI,CACxD,OAGF,GAAI,EAAgB,SAAW,EAAG,CAChC,KAAK,OAAO,KAAK,EAAO,OAAO,kDAAkD,CAAC,CAClF,OAGF,KAAK,OAAO,KAAK,EAAO,QAAQ,SAAS,EAAgB,OAAO,sBAAsB,CAAC,CACvF,EAAgB,QAAS,GAAmB,CAC1C,IAAM,EAAS,EAAe,cAC1B,WAAW,EAAe,cAAc,gBACxC,oBACE,EACJ,EAAe,iBAAmB,EAAe,aAC7C,oBAAoB,EAAe,aAAa,gBAChD,GACN,KAAK,OAAO,KACV,OAAO,EAAO,MAAM,EAAe,KAAK,CAAC,IAAI,EAAe,KAAK,KAC3D,EAAe,eAAe,aAAa,CAAC,IAAI,IAAS,EAAM,IACnE,EAAO,IAAI,OAAO,EAAe,KAAK,CACzC,EACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./removeUnverifiedRequestIdentifiers-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./removeUnverifiedRequestIdentifiers-CgnfHdbc.mjs";import{t}from"./done-input-validation-LiTaCEzF.mjs";async function n({auth:n,transcendUrl:r,identifierNames:i,actions:a=[]}){t(this.process),await e({requestActions:a,transcendUrl:r,auth:n,identifierNames:i})}export{n as rejectUnverifiedIdentifiers};
|
|
2
|
+
//# sourceMappingURL=impl-DjBbx05w.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-DjBbx05w.mjs","names":[],"sources":["../src/commands/request/reject-unverified-identifiers/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { removeUnverifiedRequestIdentifiers } from '../../../lib/requests/index.js';\n\nexport interface RejectUnverifiedIdentifiersCommandFlags {\n auth: string;\n identifierNames: string[];\n actions?: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function rejectUnverifiedIdentifiers(\n this: LocalContext,\n { auth, transcendUrl, identifierNames, actions = [] }: RejectUnverifiedIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await removeUnverifiedRequestIdentifiers({\n requestActions: actions,\n transcendUrl,\n auth,\n identifierNames,\n });\n}\n"],"mappings":"0HAaA,eAAsB,EAEpB,CAAE,OAAM,eAAc,kBAAiB,UAAU,EAAE,EACpC,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAAmC,CACvC,eAAgB,EAChB,eACA,OACA,kBACD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./approvePrivacyRequests-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./approvePrivacyRequests-BBcqydVb.mjs";import{t}from"./done-input-validation-LiTaCEzF.mjs";async function n({auth:n,actions:r,origins:i,silentModeBefore:a,createdAtBefore:o,createdAtAfter:s,updatedAtBefore:c,updatedAtAfter:l,transcendUrl:u,concurrency:d}){t(this.process),await e({transcendUrl:u,requestActions:r,auth:n,requestOrigins:i,concurrency:d,silentModeBefore:a,createdAtBefore:o,createdAtAfter:s,updatedAtBefore:c,updatedAtAfter:l})}export{n as approve};
|
|
2
|
+
//# sourceMappingURL=impl-DnBmd-wi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-DnBmd-wi.mjs","names":[],"sources":["../src/commands/request/approve/impl.ts"],"sourcesContent":["import { RequestAction, RequestOrigin } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { approvePrivacyRequests } from '../../../lib/requests/index.js';\n\nexport interface ApproveCommandFlags {\n auth: string;\n actions: RequestAction[];\n origins?: RequestOrigin[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function approve(\n this: LocalContext,\n {\n auth,\n actions,\n origins,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n transcendUrl,\n concurrency,\n }: ApproveCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n await approvePrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestOrigins: origins,\n concurrency,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n });\n}\n"],"mappings":"8GAmBA,eAAsB,EAEpB,CACE,OACA,UACA,UACA,mBACA,kBACA,iBACA,kBACA,iBACA,eACA,eAEa,CACf,EAAoB,KAAK,QAAQ,CAEjC,MAAM,EAAuB,CAC3B,eACA,eAAgB,EAChB,OACA,eAAgB,EAChB,cACA,mBACA,kBACA,iBACA,kBACA,iBACD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./readCsv-DNcJ_UfU.mjs";import{r as t}from"./uploadConsents-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./readCsv-DNcJ_UfU.mjs";import{r as t}from"./uploadConsents-5HlMj7EK.mjs";import{t as n}from"./done-input-validation-LiTaCEzF.mjs";import*as r from"io-ts";const i=r.intersection([r.type({userId:r.string,timestamp:r.string}),r.partial({confirmed:r.union([r.literal(`true`),r.literal(`false`)]),updated:r.union([r.literal(`true`),r.literal(`false`)]),prompted:r.union([r.literal(`true`),r.literal(`false`)]),metadata:r.string,usp:r.union([r.string,r.null]),gpp:r.union([r.string,r.null]),purposes:r.string})]);async function a({base64EncryptionKey:r,base64SigningKey:a,partition:o,file:s,consentUrl:c,concurrency:l}){n(this.process),await t({base64EncryptionKey:r,base64SigningKey:a,preferences:e(this.fs.readFileSync(s,`utf8`),i),partition:o,concurrency:l,transcendUrl:c})}export{a as uploadConsentPreferences};
|
|
2
|
+
//# sourceMappingURL=impl-Do3hnGHt.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-Do3hnGHt.mjs","names":[],"sources":["../src/lib/consent-manager/types.ts","../src/commands/consent/upload-consent-preferences/impl.ts"],"sourcesContent":["import * as t from 'io-ts';\n\nexport const ConsentPreferenceUpload = t.intersection([\n t.type({\n /** User ID */\n userId: t.string,\n /** Has the consent been updated (including no-change confirmation) since default resolution */\n timestamp: t.string,\n }),\n t.partial({\n /** Was tracking consent confirmed by the user? If this is false, the consent was resolved from defaults & is not yet confirmed */\n confirmed: t.union([t.literal('true'), t.literal('false')]),\n /**\n * Has the consent been updated (including no-change confirmation) since default resolution\n */\n updated: t.union([t.literal('true'), t.literal('false')]),\n /**\n * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js)\n */\n prompted: t.union([t.literal('true'), t.literal('false')]),\n /** Consent metadata */\n metadata: t.string,\n /** US Privacy (USP) String */\n usp: t.union([t.string, t.null]),\n /** IAB GPP String */\n gpp: t.union([t.string, t.null]),\n /**\n * Purpose map\n * This is a stringified JSON object with keys as purpose names and values as booleans or 'Auto'\n */\n purposes: t.string,\n }),\n]);\n\n/** Type override */\nexport type ConsentPreferenceUpload = t.TypeOf<typeof ConsentPreferenceUpload>;\n","import type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { ConsentPreferenceUpload } from '../../../lib/consent-manager/types.js';\nimport { uploadConsents } from '../../../lib/consent-manager/uploadConsents.js';\nimport { parseCsv } from '../../../lib/requests/readCsv.js';\n\nexport interface UploadConsentPreferencesCommandFlags {\n base64EncryptionKey: string;\n base64SigningKey: string;\n partition: string;\n file: string;\n consentUrl: string;\n concurrency: number;\n}\n\nexport async function uploadConsentPreferences(\n this: LocalContext,\n {\n base64EncryptionKey,\n base64SigningKey,\n partition,\n file,\n consentUrl,\n concurrency,\n }: UploadConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Load in preferences from csv\n const preferences = parseCsv(this.fs.readFileSync(file, 'utf8'), ConsentPreferenceUpload);\n\n // Upload cookies\n await uploadConsents({\n base64EncryptionKey,\n base64SigningKey,\n preferences,\n partition,\n concurrency,\n transcendUrl: consentUrl,\n });\n}\n"],"mappings":"8KAEA,MAAa,EAA0B,EAAE,aAAa,CACpD,EAAE,KAAK,CAEL,OAAQ,EAAE,OAEV,UAAW,EAAE,OACd,CAAC,CACF,EAAE,QAAQ,CAER,UAAW,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAI3D,QAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAIzD,SAAU,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,CAAE,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAE1D,SAAU,EAAE,OAEZ,IAAK,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,KAAK,CAAC,CAEhC,IAAK,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,KAAK,CAAC,CAKhC,SAAU,EAAE,OACb,CAAC,CACH,CAAC,CCjBF,eAAsB,EAEpB,CACE,sBACA,mBACA,YACA,OACA,aACA,eAEa,CACf,EAAoB,KAAK,QAAQ,CAMjC,MAAM,EAAe,CACnB,sBACA,mBACA,YANkB,EAAS,KAAK,GAAG,aAAa,EAAM,OAAO,CAAE,EAMpD,CACX,YACA,cACA,aAAc,EACf,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./enums-OiLcZ26O.mjs";import{r as t}from"./constants-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{i as e}from"./enums-OiLcZ26O.mjs";import{r as t}from"./constants-DAx9VK1C.mjs";import{n,t as r}from"./command-Gip5wB8W.mjs";import{o as i}from"./readTranscendYaml-D576bvzR.mjs";import{n as a}from"./pullTranscendConfiguration-CDUDqxpm.mjs";import{t as o}from"./validateTranscendAuth-BrVGfq6X.mjs";import{t as s}from"./done-input-validation-LiTaCEzF.mjs";import c from"node:path";import l from"colors";import{mapSeries as u}from"@transcend-io/utils";import{buildTranscendGraphQLClient as d}from"@transcend-io/sdk";async function f({auth:f,resources:p=n,file:m,transcendUrl:h,dataSiloIds:g=[],integrationNames:_=[],trackerStatuses:v=r,pageSize:y,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,debug:C}){s(this.process);let w=await o(f,this),T=p.includes(`all`)?Object.values(e):p;if(typeof w==`string`){try{let e=await a(d(h,w),{dataSiloIds:g,integrationNames:_,resources:T,pageSize:y,debug:C,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,trackerStatuses:v});this.logger.info(l.magenta(`Writing configuration to file "${m}"...`)),this.fs.writeFileSync(m,i(e))}catch(e){this.logger.error(l.red(`An error occurred syncing the schema: ${C?e.stack:e.message}`)),this.process.exit(1)}this.logger.info(l.green(`Successfully synced yaml file to disk at ${m}! View at ${t}`))}else{if(!this.fs.lstatSync(m).isDirectory())throw Error(`File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/`);let e=[];await u(w,async(t,n)=>{let r=`[${n+1}/${w.length}][${t.organizationName}] `;this.logger.info(l.magenta(`~~~\n\n${r}Attempting to pull configuration...\n\n~~~`));let o=d(h,t.apiKey);try{let e=await a(o,{dataSiloIds:g,integrationNames:_,resources:T,pageSize:y,debug:C,skipDatapoints:b,skipSubDatapoints:x,includeGuessedCategories:S,trackerStatuses:v}),n=c.join(m,`${t.organizationName}.yml`);this.logger.info(l.magenta(`Writing configuration to file "${n}"...`)),this.fs.writeFileSync(n,i(e)),this.logger.info(l.green(`${r}Successfully pulled configuration!`))}catch(n){this.logger.error(l.red(`${r}Failed to sync configuration. - ${n.message}`)),e.push(t.organizationName)}}),e.length>0&&(this.logger.info(l.red(`Sync encountered errors for "${e.join(`,`)}". View output above for more information, or check out ${t}`)),this.process.exit(1))}}export{f as pull};
|
|
2
|
+
//# sourceMappingURL=impl-DqbJ33ve.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-DqbJ33ve.mjs","names":[],"sources":["../src/commands/inventory/pull/impl.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { TranscendPullResource } from '../../../enums.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullTranscendConfiguration } from '../../../lib/graphql/index.js';\nimport { serializeTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { DEFAULT_CONSENT_TRACKER_STATUSES, DEFAULT_TRANSCEND_PULL_RESOURCES } from './command.js';\n\nexport interface PullCommandFlags {\n auth: string;\n resources?: (TranscendPullResource | 'all')[];\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n integrationNames?: string[];\n trackerStatuses?: ConsentTrackerStatus[];\n pageSize: number;\n skipDatapoints: boolean;\n skipSubDatapoints: boolean;\n includeGuessedCategories: boolean;\n debug: boolean;\n}\n\nexport async function pull(\n this: LocalContext,\n {\n auth,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n file,\n transcendUrl,\n dataSiloIds = [],\n integrationNames = [],\n trackerStatuses = DEFAULT_CONSENT_TRACKER_STATUSES,\n pageSize,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n debug,\n }: PullCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth, this);\n\n const resourcesToPull: TranscendPullResource[] = resources.includes('all')\n ? Object.values(TranscendPullResource)\n : (resources as TranscendPullResource[]);\n\n // Sync to Disk\n if (typeof apiKeyOrList === 'string') {\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList);\n\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n this.logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n this.fs.writeFileSync(file, serializeTranscendYaml(configuration));\n } catch (err) {\n this.logger.error(\n colors.red(`An error occurred syncing the schema: ${debug ? err.stack : err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n this.logger.info(\n colors.green(\n `Successfully synced yaml file to disk at ${file}! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\n if (!this.fs.lstatSync(file).isDirectory()) {\n throw new Error(\n 'File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/',\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n this.logger.info(\n colors.magenta(`~~~\\n\\n${prefix}Attempting to pull configuration...\\n\\n~~~`),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n const filePath = path.join(file, `${apiKey.organizationName}.yml`);\n this.logger.info(colors.magenta(`Writing configuration to file \"${filePath}\"...`));\n this.fs.writeFileSync(filePath, serializeTranscendYaml(configuration));\n\n this.logger.info(colors.green(`${prefix}Successfully pulled configuration!`));\n } catch (err) {\n this.logger.error(colors.red(`${prefix}Failed to sync configuration. - ${err.message}`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n this.logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n}\n"],"mappings":"ugBA+BA,eAAsB,EAEpB,CACE,OACA,YAAY,EACZ,OACA,eACA,cAAc,EAAE,CAChB,mBAAmB,EAAE,CACrB,kBAAkB,EAClB,WACA,iBACA,oBACA,2BACA,SAEa,CACf,EAAoB,KAAK,QAAQ,CAGjC,IAAM,EAAe,MAAM,EAAsB,EAAM,KAAK,CAEtD,EAA2C,EAAU,SAAS,MAAM,CACtE,OAAO,OAAO,EAAsB,CACnC,EAGL,GAAI,OAAO,GAAiB,SAAU,CACpC,GAAI,CAIF,IAAM,EAAgB,MAAM,EAFb,EAA4B,EAAc,EAEI,CAAE,CAC7D,cACA,mBACA,UAAW,EACX,WACA,QACA,iBACA,oBACA,2BACA,kBACD,CAAC,CAEF,KAAK,OAAO,KAAK,EAAO,QAAQ,kCAAkC,EAAK,MAAM,CAAC,CAC9E,KAAK,GAAG,cAAc,EAAM,E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g as e}from"./constants-DAx9VK1C.mjs";import{i as t,n,r,t as i}from"./project-plan-output-BHHlkLxe.mjs";import{c as a,d as o,f as s,l as c,t as l,u}from"./project-discovery-CWRjlFnC.mjs";import{b as d,d as f,r as p,t as m,u as h}from"./policy-project-discovery-CND7N2HI.mjs";import{a as g,c as _,i as v,l as y,o as b,r as x,s as S,t as C}from"./policy-runtime-6jmkXlBk.mjs";import{t as w}from"./done-input-validation-LiTaCEzF.mjs";import{i as T,n as E,r as D,t as O}from"./prompts-BhXfYD6g.mjs";import{t as k}from"./run-captured-process-BjaSDWXG.mjs";import{t as A}from"./project-plan-apply-Bg_1eMX9.mjs";import{a as j,n as ee,o as te,r as ne,t as re}from"./policy-scaffold-config-CwY0QZC0.mjs";import{isAbsolute as M,join as N,posix as P,relative as F,sep as I}from"node:path";import L from"colors";const R={Editor:`editor`,Skill:`skill`,Ci:`ci`};var z=`# Idiomatic Rego and document-tree authoring
|
|
2
2
|
|
|
3
3
|
## Start from the document tree
|
|
4
4
|
|
|
@@ -55,7 +55,7 @@ allow if facts.subject_is_trusted
|
|
|
55
55
|
|
|
56
56
|
Do not use a fully qualified \`data.<root>…\` reference directly in a rule body.
|
|
57
57
|
Policy Engine re-namespaces package declarations and imports during activation,
|
|
58
|
-
and \`transcend policy
|
|
58
|
+
and \`transcend policy check\` rejects direct self-root references that would
|
|
59
59
|
change meaning.
|
|
60
60
|
|
|
61
61
|
## Define the contract before implementation
|
|
@@ -135,7 +135,7 @@ hints**. Upload does not branch on them.
|
|
|
135
135
|
Before publishing:
|
|
136
136
|
|
|
137
137
|
1. confirm the intended package and query paths with the consuming application;
|
|
138
|
-
2. run \`transcend policy
|
|
138
|
+
2. run \`transcend policy check <bundle-directory> --noInteractive\` and tests;
|
|
139
139
|
3. review the generated bundle name, version, description, and target Transcend environment;
|
|
140
140
|
4. keep API keys in the environment or the repository's approved secret store.
|
|
141
141
|
|
|
@@ -250,7 +250,7 @@ updates VS Code settings/tasks when \`.vscode\` is present.
|
|
|
250
250
|
|
|
251
251
|
The generated Regal configuration targets OPA 1.18.2 capabilities. Generated CI
|
|
252
252
|
installs OPA 1.18.2 and Regal 0.42.0; local tools only need to satisfy the
|
|
253
|
-
compatible versions reported by \`policy init\` and \`policy
|
|
253
|
+
compatible versions reported by \`policy init\` and \`policy check\`. Follow their
|
|
254
254
|
official installation links when a compatible tool is missing.
|
|
255
255
|
|
|
256
256
|
## Editor and CI
|
|
@@ -266,112 +266,19 @@ Repository-level VS Code settings should include:
|
|
|
266
266
|
Preserve custom settings and tasks when adapting generated editor files.
|
|
267
267
|
|
|
268
268
|
Generated GitHub Actions CI is read-only and credential-free: it installs pinned
|
|
269
|
-
tools and the pinned Transcend CLI, then runs \`transcend policy
|
|
269
|
+
tools and the pinned Transcend CLI, then runs \`transcend policy check\` per
|
|
270
270
|
publish directory (matrix when multiple bundles exist). Locally, bare
|
|
271
|
-
\`transcend policy
|
|
271
|
+
\`transcend policy check\` verifies every child under the workspace that contains
|
|
272
272
|
a \`.manifest\`:
|
|
273
273
|
|
|
274
274
|
\`\`\`sh
|
|
275
|
-
transcend policy
|
|
276
|
-
transcend policy
|
|
275
|
+
transcend policy check --noInteractive --json
|
|
276
|
+
transcend policy check transcend/policy/example-bundle --noInteractive --json
|
|
277
277
|
\`\`\`
|
|
278
278
|
|
|
279
279
|
Adapt triggers, runner labels, dependency installation, and caching to
|
|
280
280
|
established repository conventions without adding publish steps or secrets.
|
|
281
|
-
`,H
|
|
282
|
-
|
|
283
|
-
## Write executable tests
|
|
284
|
-
|
|
285
|
-
Place tests next to the package they exercise and suffix test modules with
|
|
286
|
-
\`_test.rego\`. A separate \`_test\` package makes the production API and test
|
|
287
|
-
helpers easy to distinguish. Keep the \`_test\` package under the same manifest
|
|
288
|
-
root (for example \`example.result_test\`, not a sibling root), so bundle-mode
|
|
289
|
-
loads accept it.
|
|
290
|
-
|
|
291
|
-
\`\`\`rego
|
|
292
|
-
package example.result_test
|
|
293
|
-
|
|
294
|
-
import data.example.result
|
|
295
|
-
import rego.v1
|
|
296
|
-
|
|
297
|
-
test_denies_missing_input if {
|
|
298
|
-
result.decision == "deny" with input as {}
|
|
299
|
-
result.reason_code == "untrusted_or_invalid_input" with input as {}
|
|
300
|
-
}
|
|
301
|
-
\`\`\`
|
|
302
|
-
|
|
303
|
-
Cover at least:
|
|
304
|
-
|
|
305
|
-
- the ordinary allow case;
|
|
306
|
-
- explicit deny cases;
|
|
307
|
-
- absent, malformed, and unknown input;
|
|
308
|
-
- important result fields and reason codes;
|
|
309
|
-
- interactions between packages when one policy reads another document.
|
|
310
|
-
|
|
311
|
-
\`transcend policy lint\` requires a non-empty test suite.
|
|
312
|
-
|
|
313
|
-
## Use local inputs safely
|
|
314
|
-
|
|
315
|
-
Keep a sanitized \`input.example.json\` in each publish directory. \`policy new\`
|
|
316
|
-
also writes a gitignored \`input.json\` beside it (same contents) so VS Code /
|
|
317
|
-
Regal Evaluate work immediately. Customize \`input.json\` locally; keep
|
|
318
|
-
\`input.example.json\` committed and free of credentials or personal data.
|
|
319
|
-
|
|
320
|
-
## Run the complete gate
|
|
321
|
-
|
|
322
|
-
With no directory argument, \`policy lint\` and \`policy test\` verify every
|
|
323
|
-
immediate child under the workspace (\`transcend/policy\`) that contains a
|
|
324
|
-
\`.manifest\`. Pass one bundle path to target a single unit:
|
|
325
|
-
|
|
326
|
-
\`\`\`sh
|
|
327
|
-
transcend policy lint --noInteractive
|
|
328
|
-
transcend policy test
|
|
329
|
-
transcend policy lint transcend/policy/permissions-bundle --noInteractive
|
|
330
|
-
transcend policy test transcend/policy/permissions-bundle
|
|
331
|
-
opa check --strict -b transcend/policy/permissions-bundle -s transcend/policy/permissions-bundle/input.schema.json
|
|
332
|
-
\`\`\`
|
|
333
|
-
|
|
334
|
-
\`policy lint\` and \`policy test\` run \`opa test -b\` (bundle mode) so a local
|
|
335
|
-
gitignored \`input.json\` beside \`input.example.json\` does not cause a merge
|
|
336
|
-
error. Prefer the CLI over raw directory-mode \`opa test\`. Strict OPA checks use
|
|
337
|
-
Rego v1 (no \`--v0-compatible\`).
|
|
338
|
-
|
|
339
|
-
Use \`transcend policy lint --help\` for formatter flags. Review Regal findings
|
|
340
|
-
deliberately instead of applying broad rewrites.
|
|
341
|
-
|
|
342
|
-
## Evaluate a query
|
|
343
|
-
|
|
344
|
-
\`policy eval\` requires an explicit local publish directory (\`<bundle>\`).
|
|
345
|
-
|
|
346
|
-
Generic example bundle:
|
|
347
|
-
|
|
348
|
-
\`\`\`sh
|
|
349
|
-
transcend policy eval transcend/policy/example-bundle \\
|
|
350
|
-
--package=data.example.result \\
|
|
351
|
-
--input=transcend/policy/example-bundle/input.json
|
|
352
|
-
\`\`\`
|
|
353
|
-
|
|
354
|
-
To simulate the Permissions API, pass the bundle, a purpose query (\`--package\`),
|
|
355
|
-
the local envelope (\`--input\`), and the bundle's input schema (\`--schema\`) so
|
|
356
|
-
OPA type-checks \`input\`:
|
|
357
|
-
|
|
358
|
-
\`\`\`sh
|
|
359
|
-
transcend policy eval transcend/policy/permissions-bundle \\
|
|
360
|
-
--package=data.permissions.purposes \\
|
|
361
|
-
--input=transcend/policy/permissions-bundle/input.json \\
|
|
362
|
-
--schema=transcend/policy/permissions-bundle/input.schema.json
|
|
363
|
-
\`\`\`
|
|
364
|
-
|
|
365
|
-
Or pipe the envelope with \`--stdin-input\`. \`policy eval\` ignores \`*_test.rego\`
|
|
366
|
-
(same as lint/publish — tests are not shipped). Use \`transcend policy eval --help\`
|
|
367
|
-
for curated \`opa eval\` pass-through flags (format, explain, metrics, and similar).
|
|
368
|
-
Exit-on-result flags like OPA \`--fail\` are not exposed — production Evaluate uses
|
|
369
|
-
the Data API (policy deny is a successful evaluation).
|
|
370
|
-
|
|
371
|
-
Or \`opa eval -b … -i …\` with the caller's query path. If the result differs from
|
|
372
|
-
expectations, inspect package paths, imports, defaults, input field presence,
|
|
373
|
-
and the selected bundle directory before changing policy logic.
|
|
374
|
-
`,U=`---
|
|
281
|
+
`,H='# Testing and debugging\n\n## Write executable tests\n\nPlace tests next to the package they exercise and suffix test modules with\n`_test.rego`. A separate `_test` package makes the production API and test\nhelpers easy to distinguish. Keep the `_test` package under the same manifest\nroot (for example `example.result_test`, not a sibling root), so bundle-mode\nloads accept it.\n\n```rego\npackage example.result_test\n\nimport data.example.result\nimport rego.v1\n\ntest_denies_missing_input if {\n result.decision == "deny" with input as {}\n result.reason_code == "untrusted_or_invalid_input" with input as {}\n}\n```\n\nCover at least:\n\n- the ordinary allow case;\n- explicit deny cases;\n- absent, malformed, and unknown input;\n- important result fields and reason codes;\n- interactions between packages when one policy reads another document.\n\n`transcend policy check` requires a non-empty test suite.\n\n## Use local inputs safely\n\nKeep a sanitized `input.example.json` in each publish directory. `policy new`\nalso writes a gitignored `input.json` beside it (same contents) so VS Code /\nRegal Evaluate work immediately. Customize `input.json` locally; keep\n`input.example.json` committed and free of credentials or personal data.\n\n## Run the complete gate\n\nWith no directory argument, `policy check` and `policy test` verify every\nimmediate child under the workspace (`transcend/policy`) that contains a\n`.manifest`. Pass one bundle path to target a single unit:\n\n```sh\ntranscend policy check --noInteractive\ntranscend policy test\ntranscend policy check transcend/policy/permissions-bundle --noInteractive\ntranscend policy test transcend/policy/permissions-bundle\nopa check --strict -b transcend/policy/permissions-bundle -s transcend/policy/permissions-bundle/input.schema.json\n```\n\n`policy check` and `policy test` run `opa test -b` (bundle mode) so a local\ngitignored `input.json` beside `input.example.json` does not cause a merge\nerror. Prefer the CLI over raw directory-mode `opa test`. Strict OPA checks use\nRego v1 (no `--v0-compatible`).\n\nUse `transcend policy lint` for OPA formatting and Regal only (with `--fix` to\nrepair formatting). Use `transcend policy check --help` for the full gate.\nReview Regal findings deliberately instead of applying broad rewrites.\n\n## Evaluate a query\n\n`policy eval` requires an explicit local publish directory (`<bundle>`).\n\nGeneric example bundle:\n\n```sh\ntranscend policy eval transcend/policy/example-bundle \\\n --package=data.example.result \\\n --input=transcend/policy/example-bundle/input.json\n```\n\nTo simulate the Permissions API, pass the bundle, a purpose query (`--package`),\nthe local envelope (`--input`), and the bundle\'s input schema (`--schema`) so\nOPA type-checks `input`:\n\n```sh\ntranscend policy eval transcend/policy/permissions-bundle \\\n --package=data.permissions.purposes \\\n --input=transcend/policy/permissions-bundle/input.json \\\n --schema=transcend/policy/permissions-bundle/input.schema.json\n```\n\nOr pipe the envelope with `--stdin-input`. `policy eval` ignores `*_test.rego`\n(same as lint/publish — tests are not shipped). Use `transcend policy eval --help`\nfor curated `opa eval` pass-through flags (format, explain, metrics, and similar).\nExit-on-result flags like OPA `--fail` are not exposed — production Evaluate uses\nthe Data API (policy deny is a successful evaluation).\n\nOr `opa eval -b … -i …` with the caller\'s query path. If the result differs from\nexpectations, inspect package paths, imports, defaults, input field presence,\nand the selected bundle directory before changing policy logic.\n',U=`---
|
|
375
282
|
name: transcend-policy-engine
|
|
376
283
|
description: Sets up, authors, validates, tests, and publishes Transcend Policy Engine projects backed by OPA and Rego. Use for .manifest roots, Rego v1 policy trees, Regal configuration, local policy inputs, Policy Engine CI, or transcend policy CLI commands.
|
|
377
284
|
compatibility: Requires OPA 1.x, Regal, and Transcend CLI ≥ 11 for local validation.
|
|
@@ -383,7 +290,7 @@ Use the CLI for deterministic scaffolding and validation. Treat generated
|
|
|
383
290
|
examples as disposable teaching material and derive the real policy contract
|
|
384
291
|
from repository code and product requirements.
|
|
385
292
|
|
|
386
|
-
Requires **Transcend CLI ≥ 11** (\`transcend policy
|
|
293
|
+
Requires **Transcend CLI ≥ 11** (\`transcend policy check [<directory>]\`, with
|
|
387
294
|
\`init\` available).
|
|
388
295
|
|
|
389
296
|
## Workflow
|
|
@@ -399,7 +306,7 @@ Requires **Transcend CLI ≥ 11** (\`transcend policy lint [<directory>]\`, with
|
|
|
399
306
|
6. Preserve repository conventions and finish with:
|
|
400
307
|
|
|
401
308
|
\`\`\`sh
|
|
402
|
-
transcend policy
|
|
309
|
+
transcend policy check --noInteractive
|
|
403
310
|
\`\`\`
|
|
404
311
|
|
|
405
312
|
## Documentation
|
|
@@ -418,4 +325,4 @@ transcend policy lint --noInteractive
|
|
|
418
325
|
products into a single \`.manifest\` unless they share activation and callers.
|
|
419
326
|
`;const W=`transcend-policy-engine`,G=[{path:`SKILL.md`,contents:U},{path:`references/setup-tooling.md`,contents:V},{path:`references/authoring.md`,contents:z},{path:`references/testing-debugging.md`,contents:H},{path:`references/publishing.md`,contents:B}];function K(e){return`${e.hasSkill?`Use the \`${W}\` skill and run`:`Run`} ${e.newCommand} to add a bundle from a template, then adapt the policy document tree and input/output contract to the intended application.`}function q(e,n){return{version:e.version,command:e.command,applied:n.applied,dryRun:n.dryRun,targetDirectory:e.targetDirectory,manifestPath:e.manifestPath,changes:e.changes.map(e=>t(n.cwd,e)),warnings:e.warnings,nextSteps:e.nextSteps,features:[...e.features],aiHandoff:n.aiHandoff,tools:n.tools}}const J={name:W,displayName:`Policy Engine`,owner:`@transcend-io/cli`,files:G};function Y(e,t){let n=new Set(d().map(({path:t})=>N(e.targetDirectory,t))),r=new Set(t.features);return r.has(R.Editor)&&(n.add(N(e.projectRoot,`.vscode`,`settings.json`)),n.add(N(e.projectRoot,`.vscode`,`extensions.json`)),n.add(N(e.projectRoot,`.vscode`,`tasks.json`))),r.has(R.Skill)&&a(e.projectRoot,e.existingSkillDirectories,J).forEach(e=>n.add(e)),r.has(R.Ci)&&e.repositoryRoot&&e.usesGithub&&n.add(N(e.repositoryRoot,j)),[...n].sort((e,t)=>e.localeCompare(t))}function X(e,t){let n=F(e,t);if(n===`..`||n.startsWith(`..${I}`)||M(n))throw Error(`Refusing to modify path outside project root: ${t}`)}function ie(e){let t=new Set([`${h}/input.json`]);return e.forEach(({path:e})=>{t.add(e);let n=P.dirname(e);for(;n!==`.`;)t.add(n),n=P.dirname(n)}),t}function Z(e,t,n){let r=s({snapshot:u(t.snapshots,n.path),after:n.contents,description:n.description,...n.createOnly===void 0?{}:{createOnly:n.createOnly}});r?e.changes.push(r):e.unchanged.push(n.path)}function ae(e,t,n,r,a,o){Z(e,t,{path:n,contents:r.contents,description:a}),e.warnings.push(...r.warnings.map(e=>`${e} (${i(o,n)})`))}function oe(e,t){let{state:n}=e,r=d(),a=`transcend policy new`,s={version:3,command:`init`,rootDirectory:n.projectRoot,targetDirectory:n.targetDirectory,manifestPath:n.targetDirectory,changes:[],unchanged:[],warnings:[],nextSteps:[a],features:[...t.features]},l=Y(n,t);if(X(n.projectRoot,n.targetDirectory),l.forEach(e=>X(n.projectRoot,e)),n.relativeFilePaths.length===0)s.directoryPreconditions=[{path:n.targetDirectory,relativePaths:[...n.relativePaths]}],r.forEach(t=>{let r=N(n.targetDirectory,t.path);if(o(e.snapshots,r).kind!==`absent`)throw Error(`Expected an empty policy target, but found an entry at: ${r}`);Z(s,e,{path:r,contents:t.contents,description:t.description,createOnly:!0})});else{let t=!0;r.forEach(r=>{let a=N(n.targetDirectory,r.path),c=o(e.snapshots,a);if(c.kind===`file`&&c.contents===r.contents){s.unchanged.push(a);return}t=!1,c.kind!==`absent`&&(s.unchanged.push(a),s.warnings.push(`Existing policy scaffold path was left unchanged: ${i(n.invocationDirectory,a)}`))});let c=ie(r),l=n.relativeFilePaths.some(e=>!c.has(e));(!t||l)&&s.warnings.push(`Existing policy target contains custom or partial content, so no workspace files were added or overwritten. Review ${i(n.invocationDirectory,n.targetDirectory)} manually, then run \`${a}\`.`)}let u=new Set(t.features),f=n.projectRoot;if(u.has(R.Editor)){let t=N(f,`.vscode`,`settings.json`),r=N(f,`.vscode`,`extensions.json`),a=N(f,`.vscode`,`tasks.json`);[{path:t,description:`Merge strict target-scoped OPA and Rego editor settings`,merge:(e,t,n)=>ee(e,t,n)},{path:r,description:`Recommend the OPA extension and discourage its syntax-only conflict`,merge:e=>re(e)},{path:a,description:`Create the VS Code task configuration`,merge:(e,t,n)=>ne(e,t,n)}].forEach(({path:t,description:r,merge:a})=>{let c=o(e.snapshots,t);if(c.kind!==`absent`&&c.kind!==`file`){s.unchanged.push(t),s.warnings.push(`Existing VS Code artifact is not a regular file and was left unchanged: ${i(n.invocationDirectory,t)}`);return}ae(s,e,t,a(c.kind===`file`?c.contents:null,f,n.targetDirectory),r,n.invocationDirectory)})}if(u.has(R.Skill)){let t=c({rootDirectory:f,existingDirectories:n.existingSkillDirectories,snapshots:e.snapshots,skill:J,preserveModified:!0});s.changes.push(...t.changes),s.unchanged.push(...t.unchanged),s.warnings.push(...t.warnings.map(e=>t.unchanged.reduce((e,t)=>e.replace(t,i(n.invocationDirectory,t)),e)))}if(u.has(R.Ci))if(!n.repositoryRoot||!n.usesGithub)s.warnings.push(`GitHub Actions setup was selected, but this target is not inside a detected GitHub repository.`);else{let r=N(n.repositoryRoot,j),a=F(n.repositoryRoot,n.targetDirectory).split(I).join(`/`)||`.`,c=te({cliVersion:t.cliVersion,workspaceDirectory:a,bundleDirectories:[]}),l=o(e.snapshots,r);l.kind===`absent`?Z(s,e,{path:r,contents:c,description:`Add credential-free Policy Engine validation`,createOnly:!0}):l.kind===`file`&&l.contents===c?s.unchanged.push(r):(s.unchanged.push(r),s.warnings.push(`Existing GitHub Actions workflow was left unchanged: ${i(n.invocationDirectory,r)}. Adapt it manually to validate each policy bundle.`))}return s.changes.forEach(({path:e})=>X(n.projectRoot,e)),s}const se={[R.Editor]:`VS Code settings and lint task`,[R.Skill]:`Policy Engine Agent Skill`,[R.Ci]:`Validation-only GitHub Actions`},ce=Object.values(R);function Q(e,t){let n=[t.stdout.trim(),t.stderr.trim()].filter(Boolean).join(`
|
|
420
327
|
`),r=e===`OPA`?x:g;return`${e===`OPA`?`OPA 1.x`:`Regal ${C} or newer`} is required, but \`${e.toLowerCase()} version\` exited with code ${t.code}${n?`: ${n}`:`.`} Install or upgrade it using the official instructions: ${r}`}async function le(e,t,n){let r={opa:null,regal:null},i=[],a=await n(`opa`,[`version`],{cwd:t},e);if(a.error?.code===`ENOENT`)i.push(v);else{let e=`${a.stdout}\n${a.stderr}`,t=_(e);a.code===0?t?i.push(t):r.opa=S(e).version:i.push(t??Q(`OPA`,a))}let o=await n(`regal`,[`version`],{cwd:t},e);if(o.error?.code===`ENOENT`)i.push(b);else{let e=`${o.stdout}\n${o.stderr}`,t=y(e,C,`the generated OPA ${f} capabilities configuration`);o.code===0?t?i.push(t):r.regal=S(e).version:i.push(t??Q(`Regal`,o))}return{tools:r,warnings:i}}async function $(t,a=m,o=k){w(this.process);try{let s=await le(this,this.process.cwd(),o),c=p(this,a),u=new E(this),d=D(t,this.process.stdin.isTTY,this.process.stderr.isTTY),f=await T(u,{features:ce,labels:se,enabled:{[R.Editor]:t.editor,[R.Skill]:t.skill,[R.Ci]:t.ci},interactive:d}),m=Y(c,{features:f}),h=oe({state:c,snapshots:l(this,c.projectRoot,m)},{features:f,cliVersion:e});h.warnings.push(...s.warnings),t.json||this.logger.info(r(h,{cwd:this.process.cwd(),title:`Policy initialization plan`,details:[{label:`Target`,path:h.targetDirectory}]}));let g=h.changes.length===0||t.dryRun;if(h.changes.length>0&&!t.dryRun)if(t.yes)g=!0;else if(d)g=await u.confirm(`Apply this complete plan?`,!0);else throw Error(`The plan requires approval in a non-interactive invocation. Review with --dryRun, then pass --yes.`);g&&!t.dryRun&&h.changes.length>0&&await A(this,h);let _=g&&!t.dryRun&&h.changes.length>0,v=g&&!t.dryRun,y=K({projectPath:n(i(this.process.cwd(),c.targetDirectory)),hasSkill:v&&f.includes(R.Skill),newCommand:h.nextSteps[0]}),b=q(h,{applied:_,dryRun:t.dryRun,cwd:this.process.cwd(),aiHandoff:y,tools:s.tools});if(t.json){this.process.stdout.write(`${JSON.stringify(b)}\n`);return}if(t.dryRun){this.logger.info(L.yellow(`Dry run complete. No changes were written.`));return}if(!g){this.logger.info(L.yellow(`No changes applied.`));return}if(h.changes.length===0){let e=h.warnings.length===s.warnings.length?`Policy project is already initialized.`:`Existing policy project was left unchanged.`;this.logger.info(L.green(e))}else this.logger.info(L.green(`Policy project initialized.`));h.nextSteps.length>0&&(this.logger.info(`\n${L.bold(`Next steps`)}`),h.nextSteps.forEach(e=>this.logger.info(e))),this.logger.info(`\n${L.bold(`AI handoff — paste into your coding agent`)}`),this.logger.info(y)}catch(e){if(e instanceof O)return this.process.exit(130);throw e}}export{$ as init};
|
|
421
|
-
//# sourceMappingURL=impl-
|
|
328
|
+
//# sourceMappingURL=impl-DvHiVaGW.mjs.map
|