@transcend-io/cli 10.15.0 → 10.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -48
- package/dist/{app-D0tUYZvi.mjs → app-D_h2VQYJ.mjs} +18 -18
- package/dist/app-D_h2VQYJ.mjs.map +1 -0
- package/dist/{approvePrivacyRequests-B4Ux_-Qq.mjs → approvePrivacyRequests-CQzypOiU.mjs} +2 -2
- package/dist/{approvePrivacyRequests-B4Ux_-Qq.mjs.map → approvePrivacyRequests-CQzypOiU.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-Fz7Gecgy.mjs → buildExamples-CbXqb5QS.mjs} +2 -2
- package/dist/{buildExamples-Fz7Gecgy.mjs.map → buildExamples-CbXqb5QS.mjs.map} +1 -1
- package/dist/{buildXdiSyncEndpoint-CzW4Xv-7.mjs → buildXdiSyncEndpoint-16mdsBxp.mjs} +2 -2
- package/dist/{buildXdiSyncEndpoint-CzW4Xv-7.mjs.map → buildXdiSyncEndpoint-16mdsBxp.mjs.map} +1 -1
- package/dist/{bulkRestartRequests-BhIryCwd.mjs → bulkRestartRequests-Bo_R-Bu6.mjs} +2 -2
- package/dist/{bulkRestartRequests-BhIryCwd.mjs.map → bulkRestartRequests-Bo_R-Bu6.mjs.map} +1 -1
- package/dist/{bulkRetryEnrichers-B4QzcdOz.mjs → bulkRetryEnrichers-By8Lzu96.mjs} +2 -2
- package/dist/{bulkRetryEnrichers-B4QzcdOz.mjs.map → bulkRetryEnrichers-By8Lzu96.mjs.map} +1 -1
- package/dist/{cancelPrivacyRequests-D2gOKNYG.mjs → cancelPrivacyRequests-RygRMV5h.mjs} +2 -2
- package/dist/{cancelPrivacyRequests-D2gOKNYG.mjs.map → cancelPrivacyRequests-RygRMV5h.mjs.map} +1 -1
- package/dist/codecs-CwRYEdQK.mjs +2 -0
- package/dist/{codecs-DW8SY77H.mjs.map → codecs-CwRYEdQK.mjs.map} +1 -1
- package/dist/{command-DTGtCGj8.mjs → command-q8MOijXW.mjs} +2 -2
- package/dist/{command-DTGtCGj8.mjs.map → command-q8MOijXW.mjs.map} +1 -1
- package/dist/constants-BeMH_MWn.mjs +2 -0
- package/dist/constants-BeMH_MWn.mjs.map +1 -0
- package/dist/{createExtraKeyHandler-HgjX5PlO.mjs → createExtraKeyHandler-BckC7HfJ.mjs} +2 -2
- package/dist/{createExtraKeyHandler-HgjX5PlO.mjs.map → createExtraKeyHandler-BckC7HfJ.mjs.map} +1 -1
- package/dist/{downloadPrivacyRequestFiles-O-kkivdu.mjs → downloadPrivacyRequestFiles-DWUBzMms.mjs} +2 -2
- package/dist/{downloadPrivacyRequestFiles-O-kkivdu.mjs.map → downloadPrivacyRequestFiles-DWUBzMms.mjs.map} +1 -1
- package/dist/{enums-CyFTrzXY.mjs → enums-mAXnon_I.mjs} +2 -2
- package/dist/enums-mAXnon_I.mjs.map +1 -0
- package/dist/formatPolicyEngineRequestError-C8g0v7nh.mjs +2 -0
- package/dist/formatPolicyEngineRequestError-C8g0v7nh.mjs.map +1 -0
- package/dist/{generateCrossAccountApiKeys-Cz9hMZTZ.mjs → generateCrossAccountApiKeys-Ch6311KG.mjs} +2 -2
- package/dist/{generateCrossAccountApiKeys-Cz9hMZTZ.mjs.map → generateCrossAccountApiKeys-Ch6311KG.mjs.map} +1 -1
- package/dist/impl--eayIBq5.mjs +2 -0
- package/dist/impl--eayIBq5.mjs.map +1 -0
- package/dist/{impl-DjHxujUK.mjs → impl-5oKENBqi.mjs} +2 -2
- package/dist/{impl-DjHxujUK.mjs.map → impl-5oKENBqi.mjs.map} +1 -1
- package/dist/{impl-P5gOnwob2.mjs → impl-84Ex4gfr.mjs} +2 -2
- package/dist/impl-84Ex4gfr.mjs.map +1 -0
- package/dist/{impl-BHDOmS862.mjs → impl-B1jA1R3_2.mjs} +2 -2
- package/dist/{impl-BHDOmS862.mjs.map → impl-B1jA1R3_2.mjs.map} +1 -1
- package/dist/{impl-D-T2DtQO.mjs → impl-B3bx4FKy.mjs} +2 -2
- package/dist/{impl-D-T2DtQO.mjs.map → impl-B3bx4FKy.mjs.map} +1 -1
- package/dist/{impl-1-q8d3pQ.mjs → impl-B3gPt89q.mjs} +2 -2
- package/dist/{impl-1-q8d3pQ.mjs.map → impl-B3gPt89q.mjs.map} +1 -1
- package/dist/{impl-pGIOCyRI.mjs → impl-B3u38Ct_.mjs} +1 -1
- package/dist/{impl-pGIOCyRI.mjs.map → impl-B3u38Ct_.mjs.map} +1 -1
- package/dist/{impl-BfkPpR-c2.mjs → impl-B4LIjXnh.mjs} +2 -2
- package/dist/impl-B4LIjXnh.mjs.map +1 -0
- package/dist/{impl-BEqAygyV.mjs → impl-B6hA8tWQ.mjs} +2 -2
- package/dist/{impl-BEqAygyV.mjs.map → impl-B6hA8tWQ.mjs.map} +1 -1
- package/dist/{impl-CRSNjo07.mjs → impl-B7HFZI-o.mjs} +2 -2
- package/dist/{impl-CRSNjo07.mjs.map → impl-B7HFZI-o.mjs.map} +1 -1
- package/dist/{impl-vW-6-fGu.mjs → impl-BBjnVFyp.mjs} +2 -2
- package/dist/{impl-vW-6-fGu.mjs.map → impl-BBjnVFyp.mjs.map} +1 -1
- package/dist/{impl-Dc39zuTf.mjs → impl-BEz9kwDB.mjs} +2 -2
- package/dist/{impl-Dc39zuTf.mjs.map → impl-BEz9kwDB.mjs.map} +1 -1
- package/dist/{impl-bzESF0CN.mjs → impl-BJldWkkC.mjs} +1 -1
- package/dist/{impl-bzESF0CN.mjs.map → impl-BJldWkkC.mjs.map} +1 -1
- package/dist/{impl--nNSiskS.mjs → impl-BlKCGB2H.mjs} +2 -2
- package/dist/{impl--nNSiskS.mjs.map → impl-BlKCGB2H.mjs.map} +1 -1
- package/dist/{impl-BVPL6NaD.mjs → impl-Bopsmew92.mjs} +2 -2
- package/dist/impl-Bopsmew92.mjs.map +1 -0
- package/dist/{impl-DK2Rai3F.mjs → impl-BtgbwWAB.mjs} +2 -2
- package/dist/{impl-DK2Rai3F.mjs.map → impl-BtgbwWAB.mjs.map} +1 -1
- package/dist/{impl-4R_FYU--.mjs → impl-BtipvRbs.mjs} +2 -2
- package/dist/{impl-4R_FYU--.mjs.map → impl-BtipvRbs.mjs.map} +1 -1
- package/dist/{impl-U_ECyYox.mjs → impl-BzUzbqBO.mjs} +2 -2
- package/dist/{impl-U_ECyYox.mjs.map → impl-BzUzbqBO.mjs.map} +1 -1
- package/dist/{impl-gHr6mUUw.mjs → impl-C6ZYU5m12.mjs} +2 -2
- package/dist/impl-C6ZYU5m12.mjs.map +1 -0
- package/dist/{impl-Czx6HkHX.mjs → impl-CAftr82F2.mjs} +2 -2
- package/dist/impl-CAftr82F2.mjs.map +1 -0
- package/dist/{impl-C0I8JaaR.mjs → impl-CCP1-ZeX.mjs} +2 -2
- package/dist/{impl-C0I8JaaR.mjs.map → impl-CCP1-ZeX.mjs.map} +1 -1
- package/dist/{impl-CEFK4nX32.mjs → impl-CDpONRWz.mjs} +2 -2
- package/dist/impl-CDpONRWz.mjs.map +1 -0
- package/dist/{impl-BnKkkdaV.mjs → impl-CGOLSFzA.mjs} +2 -2
- package/dist/{impl-BnKkkdaV.mjs.map → impl-CGOLSFzA.mjs.map} +1 -1
- package/dist/{impl-DA-CqVoI.mjs → impl-Cea7k4on.mjs} +2 -2
- package/dist/{impl-DA-CqVoI.mjs.map → impl-Cea7k4on.mjs.map} +1 -1
- package/dist/{impl-COWe0KAi.mjs → impl-Cx5U2XsV.mjs} +2 -2
- package/dist/{impl-COWe0KAi.mjs.map → impl-Cx5U2XsV.mjs.map} +1 -1
- package/dist/impl-DF1uDAp0.mjs +2 -0
- package/dist/impl-DF1uDAp0.mjs.map +1 -0
- package/dist/{impl-Dl-XNXfK.mjs → impl-DGBJkbeS.mjs} +2 -2
- package/dist/{impl-Dl-XNXfK.mjs.map → impl-DGBJkbeS.mjs.map} +1 -1
- package/dist/impl-DGm5NVUi.mjs +3 -0
- package/dist/impl-DGm5NVUi.mjs.map +1 -0
- package/dist/{impl-CsHfqKxU.mjs → impl-DOGMbdAR.mjs} +2 -2
- package/dist/{impl-CsHfqKxU.mjs.map → impl-DOGMbdAR.mjs.map} +1 -1
- package/dist/{impl-Bwh8iWQm.mjs → impl-DXaDDpI7.mjs} +2 -2
- package/dist/{impl-Bwh8iWQm.mjs.map → impl-DXaDDpI7.mjs.map} +1 -1
- package/dist/{impl-cNol5cU12.mjs → impl-D_cEbtMo2.mjs} +2 -2
- package/dist/{impl-cNol5cU12.mjs.map → impl-D_cEbtMo2.mjs.map} +1 -1
- package/dist/{impl-Ba6PPE2j.mjs → impl-Da2Aoswt.mjs} +2 -2
- package/dist/{impl-Ba6PPE2j.mjs.map → impl-Da2Aoswt.mjs.map} +1 -1
- package/dist/{impl-D2J3OSc12.mjs → impl-DcSsXSNW2.mjs} +2 -2
- package/dist/{impl-D2J3OSc12.mjs.map → impl-DcSsXSNW2.mjs.map} +1 -1
- package/dist/{impl-DLM8ohWo.mjs → impl-DefbnFrT.mjs} +2 -2
- package/dist/{impl-DLM8ohWo.mjs.map → impl-DefbnFrT.mjs.map} +1 -1
- package/dist/{impl-Dk-MSA-J.mjs → impl-Dh9KPYhQ.mjs} +2 -2
- package/dist/{impl-Dk-MSA-J.mjs.map → impl-Dh9KPYhQ.mjs.map} +1 -1
- package/dist/impl-DiRx33sh.mjs +2 -0
- package/dist/impl-DiRx33sh.mjs.map +1 -0
- package/dist/{impl-By_j4twx2.mjs → impl-Djk5Ykxb2.mjs} +2 -2
- package/dist/{impl-By_j4twx2.mjs.map → impl-Djk5Ykxb2.mjs.map} +1 -1
- package/dist/impl-Dn7OFlxh.mjs +2 -0
- package/dist/impl-Dn7OFlxh.mjs.map +1 -0
- package/dist/{impl-DQdzYE12.mjs → impl-DqcpxYHF.mjs} +1 -1
- package/dist/{impl-DQdzYE12.mjs.map → impl-DqcpxYHF.mjs.map} +1 -1
- package/dist/{impl-D7_ZNvz3.mjs → impl-GJ3nq4P6.mjs} +2 -2
- package/dist/{impl-D7_ZNvz3.mjs.map → impl-GJ3nq4P6.mjs.map} +1 -1
- package/dist/{impl-FIuVqYGx2.mjs → impl-OMY9ATKa2.mjs} +2 -2
- package/dist/{impl-FIuVqYGx2.mjs.map → impl-OMY9ATKa2.mjs.map} +1 -1
- package/dist/{impl-BJA9PYEn.mjs → impl-SnNbavfi2.mjs} +2 -2
- package/dist/impl-SnNbavfi2.mjs.map +1 -0
- package/dist/{impl-BjGI8AF4.mjs → impl-Wu5usA1Y.mjs} +2 -2
- package/dist/{impl-BjGI8AF4.mjs.map → impl-Wu5usA1Y.mjs.map} +1 -1
- package/dist/{impl-DxYf6zGe2.mjs → impl-YySyd8Le2.mjs} +2 -2
- package/dist/{impl-DxYf6zGe2.mjs.map → impl-YySyd8Le2.mjs.map} +1 -1
- package/dist/{impl-DvtvdnkQ.mjs → impl-d0CyctvS.mjs} +2 -2
- package/dist/{impl-DvtvdnkQ.mjs.map → impl-d0CyctvS.mjs.map} +1 -1
- package/dist/{impl-DlYwcNod.mjs → impl-mKyN6ET8.mjs} +2 -2
- package/dist/{impl-DlYwcNod.mjs.map → impl-mKyN6ET8.mjs.map} +1 -1
- package/dist/index.d.mts +29 -10
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{markRequestDataSiloIdsCompleted-DwW-WiOW.mjs → markRequestDataSiloIdsCompleted-DXFBaJTl.mjs} +2 -2
- package/dist/{markRequestDataSiloIdsCompleted-DwW-WiOW.mjs.map → markRequestDataSiloIdsCompleted-DXFBaJTl.mjs.map} +1 -1
- package/dist/{markSilentPrivacyRequests-gGd4Y1qn.mjs → markSilentPrivacyRequests-ChvSN2zw.mjs} +2 -2
- package/dist/{markSilentPrivacyRequests-gGd4Y1qn.mjs.map → markSilentPrivacyRequests-ChvSN2zw.mjs.map} +1 -1
- package/dist/{notifyPrivacyRequestsAdditionalTime-P3_q0IyH.mjs → notifyPrivacyRequestsAdditionalTime-BMXmHJQy.mjs} +2 -2
- package/dist/{notifyPrivacyRequestsAdditionalTime-P3_q0IyH.mjs.map → notifyPrivacyRequestsAdditionalTime-BMXmHJQy.mjs.map} +1 -1
- package/dist/parseVariablesFromString-CrzXJu3n.mjs +3 -0
- package/dist/parseVariablesFromString-CrzXJu3n.mjs.map +1 -0
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-QRqoKtLp.mjs → pullChunkedCustomSiloOutstandingIdentifiers-VRZvZwup.mjs} +2 -2
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-QRqoKtLp.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-VRZvZwup.mjs.map} +1 -1
- package/dist/{pullManualEnrichmentIdentifiersToCsv-C30KTnOp.mjs → pullManualEnrichmentIdentifiersToCsv-BzVcZB_9.mjs} +2 -2
- package/dist/{pullManualEnrichmentIdentifiersToCsv-C30KTnOp.mjs.map → pullManualEnrichmentIdentifiersToCsv-BzVcZB_9.mjs.map} +1 -1
- package/dist/pullTranscendConfiguration-CZD-sx8L.mjs +58 -0
- package/dist/pullTranscendConfiguration-CZD-sx8L.mjs.map +1 -0
- package/dist/{pushCronIdentifiersFromCsv-CgO1R52T.mjs → pushCronIdentifiersFromCsv-nVaVVfm2.mjs} +2 -2
- package/dist/{pushCronIdentifiersFromCsv-CgO1R52T.mjs.map → pushCronIdentifiersFromCsv-nVaVVfm2.mjs.map} +1 -1
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-LGKXXOxA.mjs → pushManualEnrichmentIdentifiersFromCsv-ChJ0dCPU.mjs} +2 -2
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-LGKXXOxA.mjs.map → pushManualEnrichmentIdentifiersFromCsv-ChJ0dCPU.mjs.map} +1 -1
- package/dist/{readTranscendYaml-I64TqeSd.mjs → readTranscendYaml-B2Asm9c5.mjs} +2 -2
- package/dist/{readTranscendYaml-I64TqeSd.mjs.map → readTranscendYaml-B2Asm9c5.mjs.map} +1 -1
- package/dist/{removeUnverifiedRequestIdentifiers-XFdpkQgL.mjs → removeUnverifiedRequestIdentifiers-xejbAnmv.mjs} +2 -2
- package/dist/{removeUnverifiedRequestIdentifiers-XFdpkQgL.mjs.map → removeUnverifiedRequestIdentifiers-xejbAnmv.mjs.map} +1 -1
- package/dist/{renderTable-BgjVr6ch.mjs → renderTable-BzIh5FoT.mjs} +1 -1
- package/dist/{renderTable-BgjVr6ch.mjs.map → renderTable-BzIh5FoT.mjs.map} +1 -1
- package/dist/{resolveBundleIdByName-DdemhmTX.mjs → resolveBundleIdByName-Bxoxa8CK.mjs} +1 -1
- package/dist/{resolveBundleIdByName-DdemhmTX.mjs.map → resolveBundleIdByName-Bxoxa8CK.mjs.map} +1 -1
- package/dist/{retryRequestDataSilos-DMgCUvaM.mjs → retryRequestDataSilos-D9v-Ydk6.mjs} +2 -2
- package/dist/{retryRequestDataSilos-DMgCUvaM.mjs.map → retryRequestDataSilos-D9v-Ydk6.mjs.map} +1 -1
- package/dist/{skipPreflightJobs-B7wTN0Bq.mjs → skipPreflightJobs-CAyRUXNn.mjs} +2 -2
- package/dist/{skipPreflightJobs-B7wTN0Bq.mjs.map → skipPreflightJobs-CAyRUXNn.mjs.map} +1 -1
- package/dist/{skipRequestDataSilos-a8uRrHS3.mjs → skipRequestDataSilos-DNHaLKzO.mjs} +2 -2
- package/dist/{skipRequestDataSilos-a8uRrHS3.mjs.map → skipRequestDataSilos-DNHaLKzO.mjs.map} +1 -1
- package/dist/{streamPrivacyRequestsToCsv-CacoKyV6.mjs → streamPrivacyRequestsToCsv-DK1t54C2.mjs} +2 -2
- package/dist/{streamPrivacyRequestsToCsv-CacoKyV6.mjs.map → streamPrivacyRequestsToCsv-DK1t54C2.mjs.map} +1 -1
- package/dist/{updateConsentManagerVersionToLatest-CpTxdJNW.mjs → updateConsentManagerVersionToLatest-CQ5OaS-T.mjs} +2 -2
- package/dist/{updateConsentManagerVersionToLatest-CpTxdJNW.mjs.map → updateConsentManagerVersionToLatest-CQ5OaS-T.mjs.map} +1 -1
- package/dist/{uploadConsents-De_xHyyO.mjs → uploadConsents-CG9C7chh.mjs} +2 -2
- package/dist/{uploadConsents-De_xHyyO.mjs.map → uploadConsents-CG9C7chh.mjs.map} +1 -1
- package/dist/{uploadCookiesFromCsv-K14ohf2u.mjs → uploadCookiesFromCsv-hcAHtlDf.mjs} +2 -2
- package/dist/{uploadCookiesFromCsv-K14ohf2u.mjs.map → uploadCookiesFromCsv-hcAHtlDf.mjs.map} +1 -1
- package/dist/{uploadDataFlowsFromCsv-E8FkU0A-.mjs → uploadDataFlowsFromCsv-B61qZpKb.mjs} +2 -2
- package/dist/{uploadDataFlowsFromCsv-E8FkU0A-.mjs.map → uploadDataFlowsFromCsv-B61qZpKb.mjs.map} +1 -1
- package/dist/{uploadPrivacyRequestsFromCsv-Dq3jkrr9.mjs → uploadPrivacyRequestsFromCsv-DFKHnc0H.mjs} +2 -2
- package/dist/{uploadPrivacyRequestsFromCsv-Dq3jkrr9.mjs.map → uploadPrivacyRequestsFromCsv-DFKHnc0H.mjs.map} +1 -1
- package/dist/{validateTranscendAuth-CToEUu1U.mjs → validateTranscendAuth-DrVM-Bxh.mjs} +2 -2
- package/dist/{validateTranscendAuth-CToEUu1U.mjs.map → validateTranscendAuth-DrVM-Bxh.mjs.map} +1 -1
- package/package.json +4 -4
- package/dist/app-D0tUYZvi.mjs.map +0 -1
- package/dist/codecs-DW8SY77H.mjs +0 -2
- package/dist/constants-Di-rbigP.mjs +0 -2
- package/dist/constants-Di-rbigP.mjs.map +0 -1
- package/dist/enums-CyFTrzXY.mjs.map +0 -1
- package/dist/impl-BAKYoOt5.mjs +0 -2
- package/dist/impl-BAKYoOt5.mjs.map +0 -1
- package/dist/impl-BJA9PYEn.mjs.map +0 -1
- package/dist/impl-BVPL6NaD.mjs.map +0 -1
- package/dist/impl-BfkPpR-c2.mjs.map +0 -1
- package/dist/impl-C9uF6jBk.mjs +0 -2
- package/dist/impl-C9uF6jBk.mjs.map +0 -1
- package/dist/impl-CEFK4nX32.mjs.map +0 -1
- package/dist/impl-Czx6HkHX.mjs.map +0 -1
- package/dist/impl-P5gOnwob2.mjs.map +0 -1
- package/dist/impl-QhkS8iHU.mjs +0 -2
- package/dist/impl-QhkS8iHU.mjs.map +0 -1
- package/dist/impl-WYYi6kC-.mjs +0 -2
- package/dist/impl-WYYi6kC-.mjs.map +0 -1
- package/dist/impl-gHr6mUUw.mjs.map +0 -1
- package/dist/parseVariablesFromString-Cpjk0zeN.mjs +0 -3
- package/dist/parseVariablesFromString-Cpjk0zeN.mjs.map +0 -1
- package/dist/pullTranscendConfiguration-CICvJuZ5.mjs +0 -58
- package/dist/pullTranscendConfiguration-CICvJuZ5.mjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./buildExamples-CbXqb5QS.mjs";import{t}from"./logger-D1tXVwJj.mjs";import{t as n}from"./done-input-validation-D25TzrxG.mjs";import{n as r,t as i}from"./constants-Opbj9jaF.mjs";import{r as a,t as o}from"./runOpa-NnuspgN0.mjs";import{n as s,t as c}from"./printResult-BE0CcmNZ.mjs";import{t as l}from"./formatPolicyBundleVersionSummary-BJgl5Q3D.mjs";import{t as u}from"./formatPolicyEngineRequestError-C8g0v7nh.mjs";import{t as d}from"./resolveBundleIdByName-Bxoxa8CK.mjs";import f from"node:fs";import p from"node:os";import m from"node:path";import h from"colors";import g from"fast-glob";import{spawnSync as _}from"node:child_process";import{gunzipSync as v}from"node:zlib";function y(e){return e.endsWith(`.rego`)&&!e.endsWith(`_test.rego`)}function b(e){let t=m.join(e,`manifest.json`);if(!f.existsSync(t))throw Error(`Policy bundle directory must contain a manifest.json file.`);let n=g.sync(`**/*.rego`,{cwd:e,onlyFiles:!0,dot:!1}).filter(y);if(n.length===0)throw Error(`Policy bundle directory must contain at least one .rego policy file.`);return[`manifest.json`,...n.sort()]}async function x(e){let t=m.join(p.tmpdir(),`transcend-policy-bundle-build-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`);try{let{code:n,stderr:r}=await o([`build`,`--v0-compatible`,`--ignore`,`*_test.rego`,`-o`,t,`.`],{cwd:e});if(n!==0)throw Error(r.trim()||`opa build failed with exit code ${n}`)}finally{f.existsSync(t)&&f.unlinkSync(t)}}async function S(e){a();let t=m.resolve(e);if(!f.existsSync(t)||!f.statSync(t).isDirectory())throw Error(`Policy directory does not exist or is not a directory: ${t}`);let{code:n,stderr:s}=await o([`check`,`--strict`,`--v0-compatible`,t]);if(n!==0)throw Error(s.trim()||`opa check failed with exit code ${n}`);await x(t);let c=b(t),l=m.join(p.tmpdir(),`transcend-policy-bundle-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`),u=_(`tar`,[`-czf`,l,`-C`,t,...c],{env:{...process.env,COPYFILE_DISABLE:`1`},encoding:`utf8`});if(u.status!==0)throw Error(`Failed to create policy bundle archive: ${u.stderr.trim()||`tar failed`}`);let d=f.readFileSync(l);if(d.byteLength>5120)throw f.unlinkSync(l),Error(`Policy bundle exceeds the ${i} byte compressed upload limit (${d.byteLength} bytes). The server also rejects decompressed bundles larger than ${r} bytes.`);let h=v(d);if(h.byteLength>51200)throw f.unlinkSync(l),Error(`Policy bundle exceeds the ${r} byte decompressed upload limit (${h.byteLength} bytes).`);return l}function C(e){let t=f.readFileSync(e.bundlePath),n=new FormData;return n.append(`bundle`,new Blob([t],{type:`application/gzip`}),m.basename(e.bundlePath)),n.append(`version`,e.version),e.description&&n.append(`description`,e.description),e.bundleName&&n.append(`bundleName`,e.bundleName),n}function w(e){return e.toISOString().slice(0,19).replace(/[T:]/g,`-`)}function T(e,t=new Date){return`${e}-${w(t)}`}async function E({dir:r,"bundle-name":i,auth:a,"transcend-url":o,version:p,description:g,json:_}){n(this.process.exit);let v=m.resolve(r),y=p??T(i),b=s(o,a),x;try{t.info(h.green(`Building policy bundle from ${v}...`)),x=await S(v);let n=await d(b,i),r;if(n){t.info(h.green(`Uploading new version for bundle "${i}"...`));let e=C({bundlePath:x,version:y,description:g});try{r=await b.post(`v1/policy-engine/policy-bundles/${n}/versions`,{body:e}).json()}catch(e){throw Error(u(e),{cause:e})}}else{t.info(h.green(`Creating bundle "${i}" and uploading first version...`));let e=C({bundlePath:x,version:y,description:g,bundleName:i});try{r=await b.post(`v1/policy-engine/policy-bundles`,{body:e}).json()}catch(e){throw Error(u(e),{cause:e})}}c(this.process.stdout,{json:_,data:r,renderTable:()=>l(r.version)}),t.info(h.green(`Policy bundle version uploaded successfully.`));let a=e([`policy`,`activate`],{version:r.version.version,"bundle-name":i});t.info(h.yellow(`Publishing a policy does not activate it. To activate this version, run:\n ${a}`))}finally{x&&f.existsSync(x)&&f.unlinkSync(x)}}export{E as publish};
|
|
2
|
+
//# sourceMappingURL=impl-Dn7OFlxh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impl-Dn7OFlxh.mjs","names":["fg"],"sources":["../src/commands/policy/helpers/buildOpaBundleTarball.ts","../src/commands/policy/helpers/buildPolicyBundleFormData.ts","../src/commands/policy/helpers/defaultPolicyVersionLabel.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 fg from 'fast-glob';\n\nimport { MAX_BUNDLE_COMPRESSED_BYTES, MAX_BUNDLE_DECOMPRESSED_BYTES } from '../constants.js';\nimport { assertOpaInstalled } from './assertOpaInstalled.js';\nimport { runOPACapture } from './runOpa.js';\n\n/**\n * Returns whether a relative path is a publishable Rego policy file.\n *\n * OPA test files (`*_test.rego`) are excluded because they are for local\n * validation only and are not part of the upload contract.\n *\n * @param relativePath - Path relative to the bundle directory\n * @returns Whether the file should be included in the upload archive\n */\nfunction isPublishableRegoFile(relativePath: string): boolean {\n return relativePath.endsWith('.rego') && !relativePath.endsWith('_test.rego');\n}\n\n/**\n * Collects `manifest.json` and publishable `.rego` files from a policy directory.\n *\n * @param dir - Absolute path to the policy bundle directory\n * @returns Relative paths to include in the upload tarball\n */\nfunction collectPolicyBundleArchiveEntries(dir: string): string[] {\n const manifestPath = path.join(dir, 'manifest.json');\n if (!fs.existsSync(manifestPath)) {\n throw new Error('Policy bundle directory must contain a manifest.json file.');\n }\n\n const regoFiles = fg\n .sync('**/*.rego', {\n cwd: dir,\n onlyFiles: true,\n dot: false,\n })\n .filter(isPublishableRegoFile);\n\n if (regoFiles.length === 0) {\n throw new Error('Policy bundle directory must contain at least one .rego policy file.');\n }\n\n return ['manifest.json', ...regoFiles.sort()];\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.json` +\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. `*_test.rego` files are local-only.\n const { code, stderr } = await runOPACapture(\n ['build', '--v0-compatible', '--ignore', '*_test.rego', '-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 * Builds a gzip-compressed policy bundle tarball for upload to Transcend.\n *\n * The Policy Engine API expects a plain archive containing `manifest.json` and\n * one or more `.rego` files. This differs from `opa build` output, which embeds\n * `.manifest`, `data.json`, and other OPA bundle metadata that the server\n * rejects. Before packaging, the bundle is validated with `opa check` (strict\n * Rego linting) and `opa build` (full compilation) so compile failures surface\n * client-side rather than after upload.\n *\n * @param dir - Directory containing `manifest.json` 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 // 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 '--v0-compatible',\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 archiveEntries = collectPolicyBundleArchiveEntries(resolvedDir);\n const outputPath = path.join(\n os.tmpdir(),\n `transcend-policy-bundle-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`,\n );\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 ${MAX_BUNDLE_COMPRESSED_BYTES} byte compressed upload limit (${compressedBytes.byteLength} bytes). ` +\n `The server also rejects decompressed bundles larger than ${MAX_BUNDLE_DECOMPRESSED_BYTES} 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 ${MAX_BUNDLE_DECOMPRESSED_BYTES} byte decompressed upload limit (${decompressedBytes.byteLength} bytes).`,\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 fs from 'node:fs';\nimport 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 { buildExampleCommand } from '../../../lib/docgen/buildExamples.js';\nimport { logger } from '../../../logger.js';\nimport type { ActivateCommandFlags } from '../activate/impl.js';\nimport {\n buildPolicyBundleFormData,\n buildPolicyEngineClient,\n buildOpaBundleTarball,\n defaultPolicyVersionLabel,\n formatPolicyBundleVersionSummary,\n formatPolicyEngineRequestError,\n printResult,\n resolveBundleIdByName,\n} from '../helpers/index.js';\nimport type { CreatePolicyBundleResponse, CreatePolicyBundleVersionResponse } from '../types.js';\n\n/** CLI flags for `transcend policy publish`. */\nexport interface PublishCommandFlags {\n /** Directory containing Rego policy files */\n dir: string;\n /** Tenant-unique bundle name */\n '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}\n\n/**\n * Build and upload a new immutable policy bundle version.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function publish(\n this: LocalContext,\n {\n dir,\n 'bundle-name': bundleName,\n auth,\n 'transcend-url': transcendUrl,\n version,\n description,\n json,\n }: PublishCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const resolvedDir = path.resolve(dir);\n const versionLabel = version ?? defaultPolicyVersionLabel(bundleName);\n const client = buildPolicyEngineClient(transcendUrl, auth);\n\n let bundlePath: string | undefined;\n try {\n logger.info(colors.green(`Building policy bundle from ${resolvedDir}...`));\n bundlePath = await buildOpaBundleTarball(resolvedDir);\n\n const existingBundleId = await resolveBundleIdByName(client, bundleName);\n\n let responseBody: CreatePolicyBundleResponse | CreatePolicyBundleVersionResponse;\n\n if (existingBundleId) {\n logger.info(colors.green(`Uploading new version for bundle \"${bundleName}\"...`));\n const form = buildPolicyBundleFormData({\n bundlePath,\n version: versionLabel,\n description,\n });\n try {\n responseBody = await client\n .post(`v1/policy-engine/policy-bundles/${existingBundleId}/versions`, { body: form })\n .json<CreatePolicyBundleVersionResponse>();\n } catch (err) {\n throw new Error(formatPolicyEngineRequestError(err), { cause: err });\n }\n } else {\n logger.info(colors.green(`Creating bundle \"${bundleName}\" and uploading first version...`));\n const createForm = buildPolicyBundleFormData({\n bundlePath,\n version: versionLabel,\n description,\n bundleName,\n });\n try {\n responseBody = await client\n .post('v1/policy-engine/policy-bundles', {\n body: createForm,\n })\n .json<CreatePolicyBundleResponse>();\n } catch (err) {\n throw new Error(formatPolicyEngineRequestError(err), { cause: err });\n }\n }\n\n printResult(this.process.stdout, {\n json,\n data: responseBody,\n renderTable: () => formatPolicyBundleVersionSummary(responseBody.version),\n });\n\n logger.info(colors.green('Policy bundle version uploaded successfully.'));\n\n const activateCommand = buildExampleCommand<ActivateCommandFlags>(['policy', 'activate'], {\n version: responseBody.version.version,\n 'bundle-name': bundleName,\n });\n logger.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 && fs.existsSync(bundlePath)) {\n fs.unlinkSync(bundlePath);\n }\n }\n}\n"],"mappings":"qrBAqBA,SAAS,EAAsB,EAA+B,CAC5D,OAAO,EAAa,SAAS,QAAQ,EAAI,CAAC,EAAa,SAAS,aAAa,CAS/E,SAAS,EAAkC,EAAuB,CAChE,IAAM,EAAe,EAAK,KAAK,EAAK,gBAAgB,CACpD,GAAI,CAAC,EAAG,WAAW,EAAa,CAC9B,MAAU,MAAM,6DAA6D,CAG/E,IAAM,EAAYA,EACf,KAAK,YAAa,CACjB,IAAK,EACL,UAAW,GACX,IAAK,GACN,CAAC,CACD,OAAO,EAAsB,CAEhC,GAAI,EAAU,SAAW,EACvB,MAAU,MAAM,uEAAuE,CAGzF,MAAO,CAAC,gBAAiB,GAAG,EAAU,MAAM,CAAC,CAa/C,eAAe,EAAqB,EAA4B,CAC9D,IAAM,EAAkB,EAAK,KAC3B,EAAG,QAAQ,CACX,iCAAiC,KAAK,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,CAAC,SACpF,CACD,GAAI,CAGF,GAAM,CAAE,OAAM,UAAW,MAAM,EAC7B,CAAC,QAAS,kBAAmB,WAAY,cAAe,KAAM,EAAiB,IAAI,CACnF,CAAE,IAAK,EAAK,CACb,CACD,GAAI,IAAS,EACX,MAAU,MAAM,EAAO,MAAM,EAAI,mCAAmC,IAAO,QAErE,CACJ,EAAG,WAAW,EAAgB,EAChC,EAAG,WAAW,EAAgB,EAkBpC,eAAsB,EAAsB,EAA8B,CACxE,GAAoB,CAEpB,IAAM,EAAc,EAAK,QAAQ,EAAI,CACrC,GAAI,CAAC,EAAG,WAAW,EAAY,EAAI,CAAC,EAAG,SAAS,EAAY,CAAC,aAAa,CACxE,MAAU,MAAM,0DAA0D,IAAc,CAI1F,GAAM,CAAE,KAAM,EAAW,OAAQ,GAAgB,MAAM,EAAc,CACnE,QACA,WACA,kBACA,EACD,CAAC,CACF,GAAI,IAAc,EAChB,MAAU,MAAM,EAAY,MAAM,EAAI,mCAAmC,IAAY,CAIvF,MAAM,EAAqB,EAAY,CAEvC,IAAM,EAAiB,EAAkC,EAAY,CAC/D,EAAa,EAAK,KACtB,EAAG,QAAQ,CACX,2BAA2B,KAAK,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,CAAC,SAC9E,CAEK,EAAY,EAAU,MAAO,CAAC,OAAQ,EAAY,KAAM,EAAa,GAAG,EAAe,CAAE,CAC7F,IAAK,CAAE,GAAG,QAAQ,IAAK,iBAAkB,IAAK,CAC9C,SAAU,OACX,CAAC,CACF,GAAI,EAAU,SAAW,EACvB,MAAU,MACR,2CAA2C,EAAU,OAAO,MAAM,EAAI,eACvE,CAGH,IAAM,EAAkB,EAAG,aAAa,EAAW,CACnD,GAAI,EAAgB,WAAA,KAElB,MADA,EAAG,WAAW,EAAW,CACf,MACR,6BAA6B,EAA4B,iCAAiC,EAAgB,WAAW,oEACvD,EAA8B,SAC7F,CAGH,IAAM,EAAoB,EAAW,EAAgB,CACrD,GAAI,EAAkB,WAAA,MAEpB,MADA,EAAG,WAAW,EAAW,CACf,MACR,6BAA6B,EAA8B,mCAAmC,EAAkB,WAAW,UAC5H,CAGH,OAAO,ECnIT,SAAgB,EAA0B,EAAqD,CAC7F,IAAM,EAAc,EAAG,aAAa,EAAQ,WAAW,CACjD,EAAO,IAAI,SAajB,OAZA,EAAK,OACH,SACA,IAAI,KAAK,CAAC,EAAY,CAAE,CAAE,KAAM,mBAAoB,CAAC,CACrD,EAAK,SAAS,EAAQ,WAAW,CAClC,CACD,EAAK,OAAO,UAAW,EAAQ,QAAQ,CACnC,EAAQ,aACV,EAAK,OAAO,cAAe,EAAQ,YAAY,CAE7C,EAAQ,YACV,EAAK,OAAO,aAAc,EAAQ,WAAW,CAExC,EC9BT,SAAS,EAA6B,EAAoB,CACxD,OAAO,EAAK,aAAa,CAAC,MAAM,EAAG,GAAG,CAAC,QAAQ,QAAS,IAAI,CAU9D,SAAgB,EAA0B,EAAoB,EAAY,IAAI,KAAgB,CAC5F,MAAO,GAAG,EAAW,GAAG,EAA6B,EAAI,GC4B3D,eAAsB,EAEpB,CACE,MACA,cAAe,EACf,OACA,gBAAiB,EACjB,UACA,cACA,QAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAc,EAAK,QAAQ,EAAI,CAC/B,EAAe,GAAW,EAA0B,EAAW,CAC/D,EAAS,EAAwB,EAAc,EAAK,CAEtD,EACJ,GAAI,CACF,EAAO,KAAK,EAAO,MAAM,+BAA+B,EAAY,KAAK,CAAC,CAC1E,EAAa,MAAM,EAAsB,EAAY,CAErD,IAAM,EAAmB,MAAM,EAAsB,EAAQ,EAAW,CAEpE,EAEJ,GAAI,EAAkB,CACpB,EAAO,KAAK,EAAO,MAAM,qCAAqC,EAAW,MAAM,CAAC,CAChF,IAAM,EAAO,EAA0B,CACrC,aACA,QAAS,EACT,cACD,CAAC,CACF,GAAI,CACF,EAAe,MAAM,EAClB,KAAK,mCAAmC,EAAiB,WAAY,CAAE,KAAM,EAAM,CAAC,CACpF,MAAyC,OACrC,EAAK,CACZ,MAAU,MAAM,EAA+B,EAAI,CAAE,CAAE,MAAO,EAAK,CAAC,MAEjE,CACL,EAAO,KAAK,EAAO,MAAM,oBAAoB,EAAW,kCAAkC,CAAC,CAC3F,IAAM,EAAa,EAA0B,CAC3C,aACA,QAAS,EACT,cACA,aACD,CAAC,CACF,GAAI,CACF,EAAe,MAAM,EAClB,KAAK,kCAAmC,CACvC,KAAM,EACP,CAAC,CACD,MAAkC,OAC9B,EAAK,CACZ,MAAU,MAAM,EAA+B,EAAI,CAAE,CAAE,MAAO,EAAK,CAAC,EAIxE,EAAY,KAAK,QAAQ,OAAQ,CAC/B,OACA,KAAM,EACN,gBAAmB,EAAiC,EAAa,QAAQ,CAC1E,CAAC,CAEF,EAAO,KAAK,EAAO,MAAM,+CAA+C,CAAC,CAEzE,IAAM,EAAkB,EAA0C,CAAC,SAAU,WAAW,CAAE,CACxF,QAAS,EAAa,QAAQ,QAC9B,cAAe,EAChB,CAAC,CACF,EAAO,KACL,EAAO,OACL,+EAA+E,IAChF,CACF,QACO,CACJ,GAAc,EAAG,WAAW,EAAW,EACzC,EAAG,WAAW,EAAW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";import{n,r}from"./runOpa-NnuspgN0.mjs";import i from"node:fs";import a from"node:path";import o from"colors";async function s({pkg:s,input:c,bundle:l}){t(this.process.exit),r();let u=a.resolve(c);if(!i.existsSync(u))throw Error(`Input file not found: ${u}`);let d=[`eval`,`--format`,`pretty`,`--input`,u];l&&d.push(`-b`,a.resolve(l)),d.push(s),e.info(o.green(`Evaluating ${s} with input ${u}...`));let f=await n(d);f!==0&&this.process.exit(f)}export{s as _eval};
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
2
|
+
//# sourceMappingURL=impl-DqcpxYHF.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-DqcpxYHF.mjs","names":[],"sources":["../src/commands/policy/eval/impl.ts"],"sourcesContent":["import fs from 'node:fs';\nimport 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 { logger } from '../../../logger.js';\nimport { assertOpaInstalled, runOpa } from '../helpers/index.js';\n\n/** CLI flags for `transcend policy eval`. */\nexport interface EvalCommandFlags {\n /** OPA package/query to evaluate (e.g. `data.transcend.decision`) */\n pkg: string;\n /** Path to a JSON envelope input file */\n input: string;\n /** Optional local policy bundle directory */\n bundle?: string;\n}\n\n/**\n * Evaluate one envelope against a local policy bundle via `opa eval`.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function _eval(\n this: LocalContext,\n { pkg, input, bundle }: EvalCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n assertOpaInstalled();\n\n const inputPath = path.resolve(input);\n if (!fs.existsSync(inputPath)) {\n throw new Error(`Input file not found: ${inputPath}`);\n }\n\n const args = ['eval', '--format', 'pretty', '--input', inputPath];\n if (bundle) {\n args.push('-b', path.resolve(bundle));\n }\n args.push(pkg);\n\n logger.info(colors.green(`Evaluating ${pkg} with input ${inputPath}...`));\n\n const exitCode = await runOpa(args);\n if (exitCode !== 0) {\n this.process.exit(exitCode);\n }\n}\n"],"mappings":"2MA0BA,eAAsB,EAEpB,CAAE,MAAK,QAAO,UACC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAoB,CAEpB,IAAM,EAAY,EAAK,QAAQ,EAAM,CACrC,GAAI,CAAC,EAAG,WAAW,EAAU,CAC3B,MAAU,MAAM,yBAAyB,IAAY,CAGvD,IAAM,EAAO,CAAC,OAAQ,WAAY,SAAU,UAAW,EAAU,CAC7D,GACF,EAAK,KAAK,KAAM,EAAK,QAAQ,EAAO,CAAC,CAEvC,EAAK,KAAK,EAAI,CAEd,EAAO,KAAK,EAAO,MAAM,cAAc,EAAI,cAAc,EAAU,KAAK,CAAC,CAEzE,IAAM,EAAW,MAAM,EAAO,EAAK,CAC/B,IAAa,GACf,KAAK,QAAQ,KAAK,EAAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./constants-
|
|
1
|
+
import{t as e}from"./constants-BeMH_MWn.mjs";import{t}from"./logger-D1tXVwJj.mjs";import{t as n}from"./done-input-validation-D25TzrxG.mjs";import{n as r}from"./constants-2MiVdjAH.mjs";import i from"colors";import{buildTranscendGraphQLClient as a,fetchActiveSiloDiscoPlugin as o,uploadSiloDiscoveryResults as s}from"@transcend-io/sdk";import c from"fast-glob";import{stringify as l}from"query-string";async function u({scanPath:e,fileGlobs:n,ignoreDirs:r,config:i}){let{ignoreDirs:a,supportedFiles:o,scanFunction:s}=i,l=n===``?o:o.concat(n.split(`,`)),d=[...r.split(`,`),...a].filter(e=>e.length>0);try{let n=await c(`${e}/**/${l.join(`|`)}`,{ignore:d.map(t=>`${e}/**/${t}`),unique:!0,onlyFiles:!0});t.info(`Scanning: ${n.length} files`);let r=n.map(e=>s(e)).flat().map(e=>e.softwareDevelopmentKits||[]).flat(),i=[...new Set(r.map(e=>e.name))];return t.info(`Found: ${i.length} unique dependencies`),i.map(t=>({name:t,resourceId:`${e}/**/${t}`,useStrictClassifier:!0}))}catch(e){throw Error(`Error scanning globs ${u} with error: ${e}`)}}async function d({scanPath:c,dataSiloId:d,auth:f,fileGlobs:p,ignoreDirs:m,transcendUrl:h}){n(this.process.exit);let g=a(h,f),_=await o(g,{logger:t,filterBy:{dataSiloId:d}}),v=r[_.dataSilo.type];v||(t.error(i.red(`This plugin "${_.dataSilo.type}" is not supported for offline silo discovery.`)),this.process.exit(1));let y=await u({scanPath:c,fileGlobs:p,ignoreDirs:m,config:v});await s(g,{pluginId:_.id,results:y,logger:t});let b=new URL(e);b.pathname=`/data-map/data-inventory/silo-discovery/triage`,b.search=l({filters:JSON.stringify({pluginIds:[_.id]})}),t.info(i.green(`Scan found ${y.length} potential data silos at ${c}! View at '${b.href}'
|
|
2
2
|
|
|
3
3
|
NOTE: it may take 2-3 minutes for scan results to appear in the UI.`))}export{d as discoverSilos};
|
|
4
|
-
//# sourceMappingURL=impl-
|
|
4
|
+
//# sourceMappingURL=impl-GJ3nq4P6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-GJ3nq4P6.mjs","names":[],"sources":["../src/lib/code-scanning/findFilesToScan.ts","../src/commands/inventory/discover-silos/impl.ts"],"sourcesContent":["import fastGlob from 'fast-glob';\n\nimport { logger } from '../../logger.js';\nimport { CodeScanningConfig } from './types.js';\n\nexport interface SiloDiscoveryRawResults {\n /** The name of the potential data silo entry */\n name: string;\n /** A unique UUID (represents the same resource across different silo discovery runs) */\n resourceId: string;\n /** Any hosts associated with the entry */\n host?: string;\n /** Type of data silo */\n type?: string | undefined;\n}\n\n/**\n * Helper to scan for data silos in all package.json files that it can find in a directory\n *\n * @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead\n * @param options - Options\n * @returns the list of integrations\n */\nexport async function findFilesToScan({\n scanPath,\n fileGlobs,\n ignoreDirs,\n config,\n}: {\n /** Where to look for package.json files */\n scanPath: string;\n /** Globs to look for */\n fileGlobs: string;\n /** The directories to ignore (excludes node_modules and serverless-build) */\n ignoreDirs: string;\n /** Silo Discovery configuration */\n config: CodeScanningConfig;\n}): Promise<SiloDiscoveryRawResults[]> {\n const { ignoreDirs: IGNORE_DIRS, supportedFiles, scanFunction } = config;\n const globsToSupport =\n fileGlobs === '' ? supportedFiles : supportedFiles.concat(fileGlobs.split(','));\n const dirsToIgnore = [...ignoreDirs.split(','), ...IGNORE_DIRS].filter((dir) => dir.length > 0);\n try {\n const filesToScan: string[] = await fastGlob(`${scanPath}/**/${globsToSupport.join('|')}`, {\n ignore: dirsToIgnore.map((dir: string) => `${scanPath}/**/${dir}`),\n unique: true,\n onlyFiles: true,\n });\n logger.info(`Scanning: ${filesToScan.length} files`);\n const allPackages = filesToScan.map((filePath: string) => scanFunction(filePath)).flat();\n const allSdks = allPackages\n .map((appPackage) => appPackage.softwareDevelopmentKits || [])\n .flat();\n const uniqueDeps = new Set(allSdks.map((sdk) => sdk.name));\n const deps = [...uniqueDeps];\n logger.info(`Found: ${deps.length} unique dependencies`);\n return deps.map((dep) => ({\n name: dep,\n resourceId: `${scanPath}/**/${dep}`,\n useStrictClassifier: true,\n }));\n } catch (error) {\n throw new Error(`Error scanning globs ${findFilesToScan} with error: ${error}`);\n }\n}\n","import {\n buildTranscendGraphQLClient,\n fetchActiveSiloDiscoPlugin,\n uploadSiloDiscoveryResults,\n} from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { stringify } from 'query-string';\n\nimport { ADMIN_DASH } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { findFilesToScan } from '../../../lib/code-scanning/findFilesToScan.js';\nimport { SILO_DISCOVERY_CONFIGS } from '../../../lib/code-scanning/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface DiscoverSilosCommandFlags {\n scanPath: string;\n dataSiloId: string;\n auth: string;\n fileGlobs: string;\n ignoreDirs: string;\n transcendUrl: string;\n}\n\nexport async function discoverSilos(\n this: LocalContext,\n { scanPath, dataSiloId, auth, fileGlobs, ignoreDirs, transcendUrl }: DiscoverSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const plugin = await fetchActiveSiloDiscoPlugin(client, {\n logger,\n filterBy: { dataSiloId },\n });\n\n const config = SILO_DISCOVERY_CONFIGS[plugin.dataSilo.type];\n if (!config) {\n logger.error(\n colors.red(\n `This plugin \"${plugin.dataSilo.type}\" is not supported for offline silo discovery.`,\n ),\n );\n this.process.exit(1);\n }\n\n const results = await findFilesToScan({\n scanPath,\n fileGlobs,\n ignoreDirs,\n config,\n });\n\n await uploadSiloDiscoveryResults(client, {\n pluginId: plugin.id,\n results,\n logger,\n });\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/data-map/data-inventory/silo-discovery/triage';\n newUrl.search = stringify({\n filters: JSON.stringify({ pluginIds: [plugin.id] }),\n });\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} potential data silos at ${scanPath}! ` +\n `View at '${newUrl.href}' ` +\n '\\n\\n NOTE: it may take 2-3 minutes for scan results to appear in the UI.',\n ),\n );\n}\n"],"mappings":"gZAuBA,eAAsB,EAAgB,CACpC,WACA,YACA,aACA,UAUqC,CACrC,GAAM,CAAE,WAAY,EAAa,iBAAgB,gBAAiB,EAC5D,EACJ,IAAc,GAAK,EAAiB,EAAe,OAAO,EAAU,MAAM,IAAI,CAAC,CAC3E,EAAe,CAAC,GAAG,EAAW,MAAM,IAAI,CAAE,GAAG,EAAY,CAAC,OAAQ,GAAQ,EAAI,OAAS,EAAE,CAC/F,GAAI,CACF,IAAM,EAAwB,MAAM,EAAS,GAAG,EAAS,MAAM,EAAe,KAAK,IAAI,GAAI,CACzF,OAAQ,EAAa,IAAK,GAAgB,GAAG,EAAS,MAAM,IAAM,CAClE,OAAQ,GACR,UAAW,GACZ,CAAC,CACF,EAAO,KAAK,aAAa,EAAY,OAAO,QAAQ,CAEpD,IAAM,EADc,EAAY,IAAK,GAAqB,EAAa,EAAS,CAAC,CAAC,MACvD,CACxB,IAAK,GAAe,EAAW,yBAA2B,EAAE,CAAC,CAC7D,MAAM,CAEH,EAAO,CAAC,GAAG,IADM,IAAI,EAAQ,IAAK,GAAQ,EAAI,KAAK,CAC9B,CAAC,CAE5B,OADA,EAAO,KAAK,UAAU,EAAK,OAAO,sBAAsB,CACjD,EAAK,IAAK,IAAS,CACxB,KAAM,EACN,WAAY,GAAG,EAAS,MAAM,IAC9B,oBAAqB,GACtB,EAAE,OACI,EAAO,CACd,MAAU,MAAM,wBAAwB,EAAgB,eAAe,IAAQ,ECtCnF,eAAsB,EAEpB,CAAE,WAAU,aAAY,OAAM,YAAW,aAAY,gBACtC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAS,EAA4B,EAAc,EAAK,CAExD,EAAS,MAAM,EAA2B,EAAQ,CACtD,SACA,SAAU,CAAE,aAAY,CACzB,CAAC,CAEI,EAAS,EAAuB,EAAO,SAAS,MACjD,IACH,EAAO,MACL,EAAO,IACL,gBAAgB,EAAO,SAAS,KAAK,gDACtC,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,IAAM,EAAU,MAAM,EAAgB,CACpC,WACA,YACA,aACA,SACD,CAAC,CAEF,MAAM,EAA2B,EAAQ,CACvC,SAAU,EAAO,GACjB,UACA,SACD,CAAC,CAEF,IAAM,EAAS,IAAI,IAAI,EAAW,CAClC,EAAO,SAAW,iDAClB,EAAO,OAAS,EAAU,CACxB,QAAS,KAAK,UAAU,CAAE,UAAW,CAAC,EAAO,GAAG,CAAE,CAAC,CACpD,CAAC,CAGF,EAAO,KACL,EAAO,MACL,cAAc,EAAQ,OAAO,2BAA2B,EAAS,aACnD,EAAO,KAAK;;sEAE3B,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./pullChunkedCustomSiloOutstandingIdentifiers-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./pullChunkedCustomSiloOutstandingIdentifiers-VRZvZwup.mjs";import{i as n,s as r}from"./writeCsv-Dg4Wuj5V.mjs";import{t as i}from"./done-input-validation-D25TzrxG.mjs";import{chunk as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c,fetchRequestFilesForRequest as l}from"@transcend-io/sdk";import{map as u}from"@transcend-io/utils";async function d({file:d,fileTarget:f,transcendUrl:p,auth:m,sombraAuth:h,cronDataSiloId:g,targetDataSiloId:_,actions:v,skipRequestCount:y,pageLimit:b,chunkSize:x}){y&&e.info(s.yellow(`Skipping request count as requested. This may help speed up the call.`)),(Number.isNaN(x)||x<=0||x%b!==0)&&(e.error(s.red(`Invalid chunk size: "${x}". Must be a positive integer that is a multiple of ${b}.`)),this.process.exit(1)),i(this.process.exit);let S=c(p,m),{baseName:C,extension:w}=n(d),{baseName:T,extension:E}=n(f),D=0,O=0,k=0;await t({dataSiloId:g,auth:m,sombraAuth:h,actions:v,apiPageSize:b,savePageSize:x,onSave:async t=>{D+=t.length;let n=await u(a(o(t.map(e=>e.requestId)),b),async t=>(e.info(s.magenta(`Fetching target identifiers for ${t.length} requests`)),(await l(S,{logger:e,pageSize:b*2,filterBy:{requestIds:t,dataSiloIds:[_]}})).map(({fileName:e,remoteId:t})=>{if(!t)throw Error(`Failed to find remoteId for ${e}`);return{RecordId:t,Object:e.replace(`.json`,``).split(`/`).pop()?.replace(` Information`,``),Comment:`Customer data deletion request submitted via transcend.io`}})),{concurrency:1});O+=n.flat().length;let i=o(t.map(e=>Object.keys(e)).flat()),c=`${C}-${k}${w}`,p=`${T}-${k}${E}`;await r(c,t,i),e.info(s.green(`Successfully wrote ${t.length} identifiers to file "${d}"`));let m=n.flat();await r(p,m,o(m.map(e=>Object.keys(e)).flat())),e.info(s.green(`Successfully wrote ${m.length} identifiers to file "${f}"`)),e.info(s.blue(`Processed chunk of ${a.length} identifiers, found ${m.length} target identifiers`)),k+=1},transcendUrl:p,skipRequestCount:y}),e.info(s.green(`Successfully wrote ${D} identifiers to file "${d}"`)),e.info(s.green(`Successfully wrote ${O} identifiers to file "${f}"`))}export{d as pullProfiles};
|
|
2
|
+
//# sourceMappingURL=impl-OMY9ATKa2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-OMY9ATKa2.mjs","names":[],"sources":["../src/commands/request/cron/pull-profiles/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, fetchRequestFilesForRequest } from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { uniq, chunk } from 'lodash-es';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport {\n pullChunkedCustomSiloOutstandingIdentifiers,\n type CsvFormattedIdentifier,\n} from '../../../../lib/cron/index.js';\nimport { parseFilePath, writeLargeCsv } from '../../../../lib/helpers/index.js';\nimport { logger } from '../../../../logger.js';\n\nexport interface PullProfilesCommandFlags {\n file: string;\n fileTarget: string;\n transcendUrl: string;\n auth: string;\n sombraAuth?: string;\n cronDataSiloId: string;\n targetDataSiloId: string;\n actions: RequestAction[];\n skipRequestCount: boolean;\n pageLimit: number;\n chunkSize: number;\n}\n\nexport async function pullProfiles(\n this: LocalContext,\n {\n file,\n fileTarget,\n transcendUrl,\n auth,\n sombraAuth,\n cronDataSiloId,\n targetDataSiloId,\n actions,\n skipRequestCount,\n pageLimit,\n chunkSize,\n }: PullProfilesCommandFlags,\n): Promise<void> {\n if (skipRequestCount) {\n logger.info(\n colors.yellow('Skipping request count as requested. This may help speed up the call.'),\n );\n }\n\n if (Number.isNaN(chunkSize) || chunkSize <= 0 || chunkSize % pageLimit !== 0) {\n logger.error(\n colors.red(\n `Invalid chunk size: \"${chunkSize}\". Must be a positive integer that is a multiple of ${pageLimit}.`,\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const { baseName, extension } = parseFilePath(file);\n const { baseName: baseNameTarget, extension: extensionTarget } = parseFilePath(fileTarget);\n\n let allIdentifiersCount = 0;\n let allTargetIdentifiersCount = 0;\n let fileCount = 0;\n // Create onSave callback to handle chunked processing\n const onSave = async (chunkToSave: CsvFormattedIdentifier[]): Promise<void> => {\n // Add to all identifiers\n allIdentifiersCount += chunkToSave.length;\n\n // Get unique request IDs from this chunk\n const requestIds = chunkToSave.map((d) => d.requestId as string);\n const uniqueRequestIds = uniq(requestIds);\n\n // Pull down target identifiers for this chunk\n const chunkedRequestIds = chunk(uniqueRequestIds, pageLimit);\n const results = await map(\n chunkedRequestIds,\n async (requestIds) => {\n logger.info(\n colors.magenta(`Fetching target identifiers for ${requestIds.length} requests`),\n );\n const results = await fetchRequestFilesForRequest(client, {\n logger,\n pageSize: pageLimit * 2,\n filterBy: {\n requestIds,\n dataSiloIds: [targetDataSiloId],\n },\n });\n return results.map(({ fileName, remoteId }) => {\n if (!remoteId) {\n throw new Error(`Failed to find remoteId for ${fileName}`);\n }\n return {\n RecordId: remoteId,\n Object: fileName.replace('.json', '').split('/').pop()?.replace(' Information', ''),\n Comment: 'Customer data deletion request submitted via transcend.io',\n };\n });\n },\n // We are grabbing all the request files for the 'pageLimit' # of requests at a time\n {\n concurrency: 1,\n },\n );\n\n allTargetIdentifiersCount += results.flat().length;\n\n // Write the identifiers and target identifiers to CSV\n const headers = uniq(chunkToSave.map((d) => Object.keys(d)).flat());\n const numberedFileName = `${baseName}-${fileCount}${extension}`;\n const numberedFileNameTarget = `${baseNameTarget}-${fileCount}${extensionTarget}`;\n await writeLargeCsv(numberedFileName, chunkToSave, headers);\n logger.info(\n colors.green(`Successfully wrote ${chunkToSave.length} identifiers to file \"${file}\"`),\n );\n\n const targetIdentifiers = results.flat();\n const headers2 = uniq(targetIdentifiers.map((d) => Object.keys(d)).flat());\n await writeLargeCsv(numberedFileNameTarget, targetIdentifiers, headers2);\n logger.info(\n colors.green(\n `Successfully wrote ${targetIdentifiers.length} identifiers to file \"${fileTarget}\"`,\n ),\n );\n\n logger.info(\n colors.blue(\n `Processed chunk of ${chunk.length} identifiers, found ${targetIdentifiers.length} target identifiers`,\n ),\n );\n fileCount += 1;\n };\n\n // Pull down outstanding identifiers using the new chunked function\n await pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId: cronDataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize: pageLimit,\n savePageSize: chunkSize,\n onSave,\n transcendUrl,\n skipRequestCount,\n });\n\n logger.info(\n colors.green(`Successfully wrote ${allIdentifiersCount} identifiers to file \"${file}\"`),\n );\n logger.info(\n colors.green(\n `Successfully wrote ${allTargetIdentifiersCount} identifiers to file \"${fileTarget}\"`,\n ),\n );\n}\n"],"mappings":"6aA6BA,eAAsB,EAEpB,CACE,OACA,aACA,eACA,OACA,aACA,iBACA,mBACA,UACA,mBACA,YACA,aAEa,CACX,GACF,EAAO,KACL,EAAO,OAAO,wEAAwE,CACvF,EAGC,OAAO,MAAM,EAAU,EAAI,GAAa,GAAK,EAAY,IAAc,KACzE,EAAO,MACL,EAAO,IACL,wBAAwB,EAAU,sDAAsD,EAAU,GACnG,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAS,EAA4B,EAAc,EAAK,CACxD,CAAE,WAAU,aAAc,EAAc,EAAK,CAC7C,CAAE,SAAU,EAAgB,UAAW,GAAoB,EAAc,EAAW,CAEtF,EAAsB,EACtB,EAA4B,EAC5B,EAAY,EAwEhB,MAAM,EAA4C,CAChD,WAAY,EACZ,OACA,aACA,UACA,YAAa,EACb,aAAc,EACd,YA7EoB,IAAyD,CAE7E,GAAuB,EAAY,OAQnC,IAAM,EAAU,MAAM,EADI,EAHD,EADN,EAAY,IAAK,GAAM,EAAE,UACJ,CAGQ,CAAE,EAE/B,CACjB,KAAO,KACL,EAAO,KACL,EAAO,QAAQ,mCAAmC,EAAW,OAAO,WAAW,CAChF,EASM,MARe,EAA4B,EAAQ,CACxD,SACA,SAAU,EAAY,EACtB,SAAU,CACR,aACA,YAAa,CAAC,EAAiB,CAChC,CACF,CAAC,EACa,KAAK,CAAE,WAAU,cAAe,CAC7C,GAAI,CAAC,EACH,MAAU,MAAM,+BAA+B,IAAW,CAE5D,MAAO,CACL,SAAU,EACV,OAAQ,EAAS,QAAQ,QAAS,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,QAAQ,eAAgB,GAAG,CACnF,QAAS,4DACV,EACD,EAGJ,CACE,YAAa,EACd,CACF,CAED,GAA6B,EAAQ,MAAM,CAAC,OAG5C,IAAM,EAAU,EAAK,EAAY,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAC7D,EAAmB,GAAG,EAAS,GAAG,IAAY,IAC9C,EAAyB,GAAG,EAAe,GAAG,IAAY,IAChE,MAAM,EAAc,EAAkB,EAAa,EAAQ,CAC3D,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAY,OAAO,wBAAwB,EAAK,GAAG,CACvF,CAED,IAAM,EAAoB,EAAQ,MAAM,CAExC,MAAM,EAAc,EAAwB,EAD3B,EAAK,EAAkB,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CACF,CAAC,CACxE,EAAO,KACL,EAAO,MACL,sBAAsB,EAAkB,OAAO,wBAAwB,EAAW,GACnF,CACF,CAED,EAAO,KACL,EAAO,KACL,sBAAsB,EAAM,OAAO,sBAAsB,EAAkB,OAAO,qBACnF,CACF,CACD,GAAa,GAYb,eACA,mBACD,CAAC,CAEF,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAoB,wBAAwB,EAAK,GAAG,CACxF,CACD,EAAO,KACL,EAAO,MACL,sBAAsB,EAA0B,wBAAwB,EAAW,GACpF,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./cancelPrivacyRequests-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./cancelPrivacyRequests-RygRMV5h.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";async function n({auth:n,actions:r,statuses:i=[],requestIds:a,silentModeBefore:o,createdAtBefore:s,createdAtAfter:c,updatedAtBefore:l,updatedAtAfter:u,cancellationTitle:d,transcendUrl:f,concurrency:p}){t(this.process.exit),await e({transcendUrl:f,requestActions:r,auth:n,cancellationTitle:d,requestIds:a,statuses:i,concurrency:p,silentModeBefore:o?new Date(o):void 0,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0,updatedAtBefore:l?new Date(l):void 0,updatedAtAfter:u?new Date(u):void 0})}export{n as cancel};
|
|
2
|
+
//# sourceMappingURL=impl-SnNbavfi2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impl-SnNbavfi2.mjs","names":[],"sources":["../src/commands/request/cancel/impl.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { cancelPrivacyRequests } from '../../../lib/requests/index.js';\n\nexport interface CancelCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses?: RequestStatus[];\n requestIds?: string[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n cancellationTitle: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function cancel(\n this: LocalContext,\n {\n auth,\n actions,\n statuses = [],\n requestIds,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n cancellationTitle,\n transcendUrl,\n concurrency,\n }: CancelCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await cancelPrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n cancellationTitle,\n requestIds,\n statuses,\n concurrency,\n silentModeBefore: silentModeBefore ? new Date(silentModeBefore) : undefined,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n updatedAtBefore: updatedAtBefore ? new Date(updatedAtBefore) : undefined,\n updatedAtAfter: updatedAtAfter ? new Date(updatedAtAfter) : undefined,\n });\n}\n"],"mappings":"6GAqBA,eAAsB,EAEpB,CACE,OACA,UACA,WAAW,EAAE,CACb,aACA,mBACA,kBACA,iBACA,kBACA,iBACA,oBACA,eACA,eAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAsB,CAC1B,eACA,eAAgB,EAChB,OACA,oBACA,aACA,WACA,cACA,iBAAkB,EAAmB,IAAI,KAAK,EAAiB,CAAG,IAAA,GAClE,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC7D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./logger-D1tXVwJj.mjs";import{n as t}from"./buildXdiSyncEndpoint-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./logger-D1tXVwJj.mjs";import{n as t}from"./buildXdiSyncEndpoint-16mdsBxp.mjs";import{t as n}from"./validateTranscendAuth-DrVM-Bxh.mjs";import{t as r}from"./done-input-validation-D25TzrxG.mjs";import{writeFileSync as i}from"node:fs";import a from"colors";async function o({auth:o,xdiLocation:s,file:c,removeIpAddresses:l,domainBlockList:u,xdiAllowedCommands:d,transcendUrl:f}){r(this.process.exit);let{syncGroups:p,html:m}=await t(await n(o),{xdiLocation:s,transcendUrl:f,removeIpAddresses:l,domainBlockList:u.length>0?u:void 0,xdiAllowedCommands:d});e.info(a.green(`Successfully constructed sync endpoint for sync groups: ${JSON.stringify(p,null,2)}`)),i(c,m),e.info(a.green(`Wrote configuration to file "${c}"!`))}export{o as buildXdiSyncEndpoint};
|
|
2
|
+
//# sourceMappingURL=impl-Wu5usA1Y.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-Wu5usA1Y.mjs","names":["buildXdiSyncEndpointHelper"],"sources":["../src/commands/consent/build-xdi-sync-endpoint/impl.ts"],"sourcesContent":["import { writeFileSync } from 'node:fs';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { buildXdiSyncEndpoint as buildXdiSyncEndpointHelper } from '../../../lib/consent-manager/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface BuildXdiSyncEndpointCommandFlags {\n auth: string;\n xdiLocation: string;\n file: string;\n removeIpAddresses: boolean;\n domainBlockList: string[];\n xdiAllowedCommands: string;\n transcendUrl: string;\n}\n\nexport async function buildXdiSyncEndpoint(\n this: LocalContext,\n {\n auth,\n xdiLocation,\n file,\n removeIpAddresses,\n domainBlockList,\n xdiAllowedCommands,\n transcendUrl,\n }: BuildXdiSyncEndpointCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Build the sync endpoint\n const { syncGroups, html } = await buildXdiSyncEndpointHelper(apiKeyOrList, {\n xdiLocation,\n transcendUrl,\n removeIpAddresses,\n domainBlockList: domainBlockList.length > 0 ? domainBlockList : undefined,\n xdiAllowedCommands,\n });\n\n // Log success\n logger.info(\n colors.green(\n `Successfully constructed sync endpoint for sync groups: ${JSON.stringify(\n syncGroups,\n null,\n 2,\n )}`,\n ),\n );\n\n // Write to disk\n writeFileSync(file, html);\n logger.info(colors.green(`Wrote configuration to file \"${file}\"!`));\n}\n"],"mappings":"kRAoBA,eAAsB,EAEpB,CACE,OACA,cACA,OACA,oBACA,kBACA,qBACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAMtC,GAAM,CAAE,aAAY,QAAS,MAAMA,EAA2B,MAHnC,EAAsB,EAAK,CAGsB,CAC1E,cACA,eACA,oBACA,gBAAiB,EAAgB,OAAS,EAAI,EAAkB,IAAA,GAChE,qBACD,CAAC,CAGF,EAAO,KACL,EAAO,MACL,2DAA2D,KAAK,UAC9D,EACA,KACA,EACD,GACF,CACF,CAGD,EAAc,EAAM,EAAK,CACzB,EAAO,KAAK,EAAO,MAAM,gCAAgC,EAAK,IAAI,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./bulkRetryEnrichers-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./bulkRetryEnrichers-By8Lzu96.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";async function n({auth:n,enricherId:r,actions:i,requestEnricherStatuses:a,requestIds:o,createdAtBefore:s,createdAtAfter:c,updatedAtBefore:l,updatedAtAfter:u,concurrency:d,transcendUrl:f}){t(this.process.exit),await e({auth:n,enricherId:r,requestActions:i,requestEnricherStatuses:a,requestIds:o,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0,updatedAtBefore:l?new Date(l):void 0,updatedAtAfter:u?new Date(u):void 0,concurrency:d,transcendUrl:f})}export{n as enricherRestart};
|
|
2
|
+
//# sourceMappingURL=impl-YySyd8Le2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-YySyd8Le2.mjs","names":[],"sources":["../src/commands/request/enricher-restart/impl.ts"],"sourcesContent":["import type { RequestAction, RequestEnricherStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { bulkRetryEnrichers } from '../../../lib/requests/index.js';\n\nexport interface EnricherRestartCommandFlags {\n auth: string;\n enricherId: string;\n actions?: RequestAction[];\n requestEnricherStatuses?: RequestEnricherStatus[];\n transcendUrl: string;\n concurrency: number;\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n}\n\nexport async function enricherRestart(\n this: LocalContext,\n {\n auth,\n enricherId,\n actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n concurrency,\n transcendUrl,\n }: EnricherRestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRetryEnrichers({\n auth,\n enricherId,\n requestActions: actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n updatedAtBefore: updatedAtBefore ? new Date(updatedAtBefore) : undefined,\n updatedAtAfter: updatedAtAfter ? new Date(updatedAtAfter) : undefined,\n concurrency,\n transcendUrl,\n });\n}\n"],"mappings":"0GAoBA,eAAsB,EAEpB,CACE,OACA,aACA,UACA,0BACA,aACA,kBACA,iBACA,kBACA,iBACA,cACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAmB,CACvB,OACA,aACA,eAAgB,EAChB,0BACA,aACA,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,cACA,eACD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{n as e}from"./constants-BeMH_MWn.mjs";import{t}from"./logger-D1tXVwJj.mjs";import{s as n}from"./writeCsv-Dg4Wuj5V.mjs";import{t as r}from"./pullAllDatapoints-OrD_W80t.mjs";import{t as i}from"./done-input-validation-D25TzrxG.mjs";import{groupBy as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c}from"@transcend-io/sdk";async function l({auth:l,file:u,transcendUrl:d,dataSiloIds:f,includeAttributes:p,includeGuessedCategories:m,parentCategories:h,subCategories:g=[]}){i(this.process.exit);try{let e=await r(c(d,l),{dataSiloIds:f,includeGuessedCategories:m,parentCategories:h,includeAttributes:p,subCategories:g});t.info(s.magenta(`Writing datapoints to file "${u}"...`));let i=[];await n(u,e.map(e=>{let t={"Property ID":e.id,"Data Silo":e.dataSilo.title,Object:e.dataPoint.name,"Object Path":e.dataPoint.path.join(`.`),Property:e.name,"Property Description":e.description,"Data Categories":e.categories.map(e=>`${e.category}:${e.name}`).join(`, `),"Guessed Category":e.pendingCategoryGuesses?.[0]?`${e.pendingCategoryGuesses[0].category.category}:${e.pendingCategoryGuesses[0].category.name}`:``,"Processing Purposes":e.purposes.map(e=>`${e.purpose}:${e.name}`).join(`, `),...Object.entries(a(e.attributeValues||[],({attributeKey:e})=>e.name)).reduce((e,[t,n])=>(e[t]=n.map(e=>e.name).join(`,`),e),{})};return i=o([...i,...Object.keys(t)]),t}),i)}catch(e){t.error(s.red(`An error occurred syncing the datapoints: ${e.message}`)),this.process.exit(1)}t.info(s.green(`Successfully synced datapoints to disk at ${u}! View at ${e}`))}export{l as pullDatapoints};
|
|
2
|
+
//# sourceMappingURL=impl-d0CyctvS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-d0CyctvS.mjs","names":[],"sources":["../src/commands/inventory/pull-datapoints/impl.ts"],"sourcesContent":["import { DataCategoryType } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { uniq, groupBy } from 'lodash-es';\n\nimport { ADMIN_DASH_DATAPOINTS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { pullAllDatapoints } from '../../../lib/data-inventory/index.js';\nimport { writeLargeCsv } from '../../../lib/helpers/index.js';\nimport { logger } from '../../../logger.js';\n\nexport interface PullDatapointsCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n includeAttributes: boolean;\n includeGuessedCategories: boolean;\n parentCategories?: DataCategoryType[];\n subCategories?: string[];\n}\n\nexport async function pullDatapoints(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n includeAttributes,\n includeGuessedCategories,\n parentCategories,\n subCategories = [],\n }: PullDatapointsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const dataPoints = await pullAllDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n parentCategories,\n includeAttributes,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n });\n\n logger.info(colors.magenta(`Writing datapoints to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = dataPoints.map((point) => {\n const result = {\n 'Property ID': point.id,\n 'Data Silo': point.dataSilo.title,\n Object: point.dataPoint.name,\n 'Object Path': point.dataPoint.path.join('.'),\n Property: point.name,\n 'Property Description': point.description,\n 'Data Categories': point.categories\n .map((category) => `${category.category}:${category.name}`)\n .join(', '),\n 'Guessed Category': point.pendingCategoryGuesses?.[0]\n ? `${point.pendingCategoryGuesses![0]!.category.category}:${\n point.pendingCategoryGuesses![0]!.category.name\n }`\n : '',\n 'Processing Purposes': point.purposes\n .map((purpose) => `${purpose.purpose}:${purpose.name}`)\n .join(', '),\n ...Object.entries(\n groupBy(point.attributeValues || [], ({ attributeKey }) => attributeKey.name),\n ).reduce(\n (acc, [key, values]) => {\n acc[key] = values.map((value) => value.name).join(',');\n return acc;\n },\n {} as Record<string, string>,\n ),\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(colors.red(`An error occurred syncing the datapoints: ${err.message}`));\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced datapoints to disk at ${file}! View at ${ADMIN_DASH_DATAPOINTS}`,\n ),\n );\n}\n"],"mappings":"gXAuBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,cACA,oBACA,2BACA,mBACA,gBAAgB,EAAE,EAEL,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAI,CAIF,IAAM,EAAa,MAAM,EAFV,EAA4B,EAAc,EAER,CAAE,CACjD,cACA,2BACA,mBACA,oBACA,gBACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,+BAA+B,EAAK,MAAM,CAAC,CACtE,IAAI,EAAoB,EAAE,CAiC1B,MAAM,EAAc,EAhCL,EAAW,IAAK,GAAU,CACvC,IAAM,EAAS,CACb,cAAe,EAAM,GACrB,YAAa,EAAM,SAAS,MAC5B,OAAQ,EAAM,UAAU,KACxB,cAAe,EAAM,UAAU,KAAK,KAAK,IAAI,CAC7C,SAAU,EAAM,KAChB,uBAAwB,EAAM,YAC9B,kBAAmB,EAAM,WACtB,IAAK,GAAa,GAAG,EAAS,SAAS,GAAG,EAAS,OAAO,CAC1D,KAAK,KAAK,CACb,mBAAoB,EAAM,yBAAyB,GAC/C,GAAG,EAAM,uBAAwB,GAAI,SAAS,SAAS,GACrD,EAAM,uBAAwB,GAAI,SAAS,OAE7C,GACJ,sBAAuB,EAAM,SAC1B,IAAK,GAAY,GAAG,EAAQ,QAAQ,GAAG,EAAQ,OAAO,CACtD,KAAK,KAAK,CACb,GAAG,OAAO,QACR,EAAQ,EAAM,iBAAmB,EAAE,EAAG,CAAE,kBAAmB,EAAa,KAAK,CAC9E,CAAC,QACC,EAAK,CAAC,EAAK,MACV,EAAI,GAAO,EAAO,IAAK,GAAU,EAAM,KAAK,CAAC,KAAK,IAAI,CAC/C,GAET,EAAE,CACH,CACF,CAED,MADA,GAAU,EAAK,CAAC,GAAG,EAAS,GAAG,OAAO,KAAK,EAAO,CAAC,CAAC,CAC7C,GAEuB,CAAE,EAAQ,OACnC,EAAK,CACZ,EAAO,MAAM,EAAO,IAAI,6CAA6C,EAAI,UAAU,CAAC,CACpF,KAAK,QAAQ,KAAK,EAAE,CAItB,EAAO,KACL,EAAO,MACL,6CAA6C,EAAK,YAAY,IAC/D,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./collectParquetFilesOrExit-DOdNctY-.mjs";import{t as n}from"./done-input-validation-D25TzrxG.mjs";import{a as r,i,n as a,r as o,t as s}from"./createExtraKeyHandler-
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./collectParquetFilesOrExit-DOdNctY-.mjs";import{t as n}from"./done-input-validation-D25TzrxG.mjs";import{a as r,i,n as a,r as o,t as s}from"./createExtraKeyHandler-BckC7HfJ.mjs";import c from"colors";import{CHILD_FLAG as l,PoolCancelledError as u,computePoolSize as d,resolveWorkerPath as f,runPool as p}from"@transcend-io/utils";function m(e){return a(e)}function h(e){return o(e)}const g={renderHeader:m,renderWorkers:h};async function _(a){n(this.process.exit);let{directory:o,outputDir:m,clearOutputDir:h,concurrency:_,viewerMode:v}=a,y=t(o,this),{poolSize:b,cpuCount:x}=d(_,y.length);e.info(c.green(`Converting ${y.length} Parquet file(s) → CSV with pool size ${b} (CPU=${x})`));let S=y.map(e=>({filePath:e,options:{outputDir:m,clearOutputDir:h}}));await p({title:`Parquet → CSV - ${o}`,baseDir:o||m||process.cwd(),childFlag:l,childModulePath:f(import.meta.url,`commands/admin/parquet-to-csv/worker.mjs`),poolSize:b,cpuCount:x,filesTotal:y.length,hooks:{nextTask:()=>S.shift(),taskLabel:e=>e.filePath,initTotals:()=>({}),initSlotProgress:()=>void 0,onProgress:e=>e,onResult:(e,t)=>({totals:e,ok:!!t.ok}),postProcess:async()=>{}},viewerMode:v,render:e=>i(e,g,v),installInteractiveSwitcher:v?void 0:({workers:e,onCtrlC:t,getLogPaths:n,replayBytes:i,replayWhich:a,setPaused:o,repaint:s})=>r({workers:e,onCtrlC:t,getLogPaths:n,replayBytes:i,replayWhich:a,onAttach:()=>o(!0),onDetach:()=>{o(!1),s()},onEnterAttachScreen:e=>{o(!0),process.stdout.write(`\x1B[2J\x1B[H`),process.stdout.write(`Attached to worker ${e}. (Esc/Ctrl+] detach \u2022 Ctrl+D EOF \u2022 Ctrl+C SIGINT)\n`)}}),extraKeyHandler:({logsBySlot:e,repaint:t,setPaused:n})=>s({logsBySlot:e,repaint:t,setPaused:n})}).catch(e=>{throw e instanceof u&&process.exit(130),e})}export{_ as parquetToCsv};
|
|
2
|
+
//# sourceMappingURL=impl-mKyN6ET8.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl-
|
|
1
|
+
{"version":3,"file":"impl-mKyN6ET8.mjs","names":[],"sources":["../src/commands/admin/parquet-to-csv/ui/plugin.ts","../src/commands/admin/parquet-to-csv/impl.ts"],"sourcesContent":["import {\n makeHeader,\n makeWorkerRows,\n type ChunkSlotProgress,\n type CommonCtx,\n type DashboardPlugin,\n} from '../../../../lib/pooling/index.js';\n\n/**\n * Header for parquet-to-csv (no extra totals block).\n *\n * @param ctx - Dashboard context.\n * @returns Header lines.\n */\nfunction renderHeader<TTotals>(ctx: CommonCtx<TTotals, ChunkSlotProgress>): string[] {\n // no extra lines — reuse the shared header as-is\n return makeHeader(ctx);\n}\n\n/**\n * Worker rows for parquet-to-csv — share the generic row renderer.\n *\n * @param ctx - Dashboard context.\n * @returns Array of strings, each representing one worker row.\n */\nfunction renderWorkers<TTotals>(ctx: CommonCtx<TTotals, ChunkSlotProgress>): string[] {\n return makeWorkerRows(ctx);\n}\n\nexport const parquetToCsvPlugin: DashboardPlugin<unknown, ChunkSlotProgress> = {\n renderHeader,\n renderWorkers,\n // no extras\n};\n","import {\n CHILD_FLAG,\n type PoolHooks,\n runPool,\n computePoolSize,\n PoolCancelledError,\n resolveWorkerPath,\n} from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { collectParquetFilesOrExit } from '../../../lib/helpers/index.js';\nimport {\n createExtraKeyHandler,\n dashboardPlugin,\n installInteractiveSwitcher,\n} from '../../../lib/pooling/index.js';\nimport { logger } from '../../../logger.js';\nimport { parquetToCsvPlugin } from './ui/index.js';\nimport type { ParquetProgress, ParquetResult, ParquetTask } from './worker.js';\n\n/** No custom totals for the header; the runner’s built-ins suffice. */\ntype Totals = Record<string, never>;\n\nexport type ParquetToCsvCommandFlags = {\n directory: string;\n outputDir?: string;\n clearOutputDir: boolean;\n concurrency?: number;\n viewerMode: boolean;\n};\n\n/**\n * Convert all Parquet files in a directory to CSV, in parallel.\n *\n * @param flags - The command flags.\n */\nexport async function parquetToCsv(\n this: LocalContext,\n flags: ParquetToCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const { directory, outputDir, clearOutputDir, concurrency, viewerMode } = flags;\n\n /* 1) Discover .parquet inputs */\n const files = collectParquetFilesOrExit(directory, this);\n\n /* 2) Size the pool */\n const { poolSize, cpuCount } = computePoolSize(concurrency, files.length);\n\n logger.info(\n colors.green(\n `Converting ${files.length} Parquet file(s) → CSV with pool size ${poolSize} (CPU=${cpuCount})`,\n ),\n );\n\n /* 3) Build FIFO queue of tasks (one per file) */\n const queue = files.map<ParquetTask>((filePath) => ({\n filePath,\n options: { outputDir, clearOutputDir },\n }));\n\n /* 4) Pool hooks */\n const hooks: PoolHooks<ParquetTask, ParquetProgress, ParquetResult, Totals> = {\n nextTask: () => queue.shift(),\n taskLabel: (t) => t.filePath,\n initTotals: () => ({}) as Totals,\n initSlotProgress: () => undefined,\n onProgress: (totals) => totals,\n onResult: (totals, res) => ({ totals, ok: !!res.ok }),\n postProcess: async () => {\n // nothing special post-run\n },\n };\n\n /* 5) Launch the pool runner with custom dashboard plugin */\n await runPool({\n title: `Parquet → CSV - ${directory}`,\n baseDir: directory || outputDir || process.cwd(),\n childFlag: CHILD_FLAG,\n childModulePath: resolveWorkerPath(import.meta.url, 'commands/admin/parquet-to-csv/worker.mjs'),\n poolSize,\n cpuCount,\n filesTotal: files.length,\n hooks,\n viewerMode,\n render: (input) => dashboardPlugin(input, parquetToCsvPlugin, viewerMode),\n installInteractiveSwitcher: viewerMode\n ? undefined\n : ({\n workers,\n onCtrlC,\n getLogPaths,\n replayBytes: rb,\n replayWhich: rw,\n setPaused,\n repaint: rp,\n }) =>\n installInteractiveSwitcher({\n workers,\n onCtrlC,\n getLogPaths,\n replayBytes: rb,\n replayWhich: rw,\n onAttach: () => setPaused(true),\n onDetach: () => {\n setPaused(false);\n rp();\n },\n onEnterAttachScreen: (id) => {\n setPaused(true);\n process.stdout.write('\\x1b[2J\\x1b[H');\n process.stdout.write(\n `Attached to worker ${id}. (Esc/Ctrl+] detach \\u2022 Ctrl+D EOF \\u2022 Ctrl+C SIGINT)\\n`,\n );\n },\n }),\n extraKeyHandler: ({ logsBySlot, repaint, setPaused }) =>\n createExtraKeyHandler({ logsBySlot, repaint, setPaused }),\n }).catch((err) => {\n if (err instanceof PoolCancelledError) {\n process.exit(130);\n }\n throw err;\n });\n}\n"],"mappings":"mYAcA,SAAS,EAAsB,EAAsD,CAEnF,OAAO,EAAW,EAAI,CASxB,SAAS,EAAuB,EAAsD,CACpF,OAAO,EAAe,EAAI,CAG5B,MAAa,EAAkE,CAC7E,eACA,gBAED,CCKD,eAAsB,EAEpB,EACe,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAM,CAAE,YAAW,YAAW,iBAAgB,cAAa,cAAe,EAGpE,EAAQ,EAA0B,EAAW,KAAK,CAGlD,CAAE,WAAU,YAAa,EAAgB,EAAa,EAAM,OAAO,CAEzE,EAAO,KACL,EAAO,MACL,cAAc,EAAM,OAAO,wCAAwC,EAAS,QAAQ,EAAS,GAC9F,CACF,CAGD,IAAM,EAAQ,EAAM,IAAkB,IAAc,CAClD,WACA,QAAS,CAAE,YAAW,iBAAgB,CACvC,EAAE,CAgBH,MAAM,EAAQ,CACZ,MAAO,mBAAmB,IAC1B,QAAS,GAAa,GAAa,QAAQ,KAAK,CAChD,UAAW,EACX,gBAAiB,EAAkB,OAAO,KAAK,IAAK,2CAA2C,CAC/F,WACA,WACA,WAAY,EAAM,OAClB,MAAA,CApBA,aAAgB,EAAM,OAAO,CAC7B,UAAY,GAAM,EAAE,SACpB,gBAAmB,EAAE,EACrB,qBAAwB,IAAA,GACxB,WAAa,GAAW,EACxB,UAAW,EAAQ,KAAS,CAAE,SAAQ,GAAI,CAAC,CAAC,EAAI,GAAI,EACpD,YAAa,SAAY,GAcpB,CACL,aACA,OAAS,GAAU,EAAgB,EAAO,EAAoB,EAAW,CACzE,2BAA4B,EACxB,IAAA,IACC,CACC,UACA,UACA,cACA,YAAa,EACb,YAAa,EACb,YACA,QAAS,KAET,EAA2B,CACzB,UACA,UACA,cACA,YAAa,EACb,YAAa,EACb,aAAgB,EAAU,GAAK,CAC/B,aAAgB,CACd,EAAU,GAAM,CAChB,GAAI,EAEN,oBAAsB,GAAO,CAC3B,EAAU,GAAK,CACf,QAAQ,OAAO,MAAM,gBAAgB,CACrC,QAAQ,OAAO,MACb,sBAAsB,EAAG,gEAC1B,EAEJ,CAAC,CACR,iBAAkB,CAAE,aAAY,UAAS,eACvC,EAAsB,CAAE,aAAY,UAAS,YAAW,CAAC,CAC5D,CAAC,CAAC,MAAO,GAAQ,CAIhB,MAHI,aAAe,GACjB,QAAQ,KAAK,IAAI,CAEb,GACN"}
|
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ import { AssessmentFormTemplateSource, AssessmentFormTemplateStatus, CodePackage
|
|
|
4
4
|
import { ObjByString, Optionalize, Requirize } from "@transcend-io/type-utils";
|
|
5
5
|
import * as t from "io-ts";
|
|
6
6
|
import { Agent, AgentFile, AgentFileFilterBy, ApiKey, AssessmentSection, AttributeKey, CodePackage, ConsentManagerMetric, DataSiloAttributeValue, DataSubject, LargeLanguageModel, PromptThread, ReportPromptRunInput, RequestEnricher, RequestIdentifier, RetentionSchedule, TranscendPromptTemplated, TranscendPromptsAndVariables, UserPreview } from "@transcend-io/sdk";
|
|
7
|
+
import { Logger, SyncResult } from "@transcend-io/utils";
|
|
7
8
|
import inquirer from "inquirer";
|
|
8
9
|
import { GraphQLClient } from "graphql-request";
|
|
9
10
|
import * as _$io_ts_types0 from "io-ts-types";
|
|
@@ -65041,9 +65042,11 @@ declare const ConsentPreferenceTopic: t.IntersectionC<[t.TypeC<{
|
|
|
65041
65042
|
BOOLEAN: unknown;
|
|
65042
65043
|
}>; /** The title of the preference topic */
|
|
65043
65044
|
title: t.StringC; /** The description of the preference topic */
|
|
65044
|
-
description: t.StringC;
|
|
65045
|
+
description: t.StringC; /** API slug for the preference topic (PascalCase; alphabetical letters only) */
|
|
65046
|
+
slug: t.StringC;
|
|
65045
65047
|
}>, t.PartialC<{
|
|
65046
|
-
/**
|
|
65048
|
+
/** Hex color for the preference topic (pull-only; not writable via CLI push today) */color: t.StringC; /** Default value */
|
|
65049
|
+
'default-configuration': t.StringC; /** Whether the preference topic is shown in privacy center */
|
|
65047
65050
|
'show-in-privacy-center': t.BooleanC; /** The options when type is single or multi select */
|
|
65048
65051
|
options: t.ArrayC<t.TypeC<{
|
|
65049
65052
|
/** Title of option value */title: t.StringC; /** API slug */
|
|
@@ -65070,9 +65073,11 @@ declare const ConsentPurpose: t.IntersectionC<[t.TypeC<{
|
|
|
65070
65073
|
BOOLEAN: unknown;
|
|
65071
65074
|
}>; /** The title of the preference topic */
|
|
65072
65075
|
title: t.StringC; /** The description of the preference topic */
|
|
65073
|
-
description: t.StringC;
|
|
65076
|
+
description: t.StringC; /** API slug for the preference topic (PascalCase; alphabetical letters only) */
|
|
65077
|
+
slug: t.StringC;
|
|
65074
65078
|
}>, t.PartialC<{
|
|
65075
|
-
/**
|
|
65079
|
+
/** Hex color for the preference topic (pull-only; not writable via CLI push today) */color: t.StringC; /** Default value */
|
|
65080
|
+
'default-configuration': t.StringC; /** Whether the preference topic is shown in privacy center */
|
|
65076
65081
|
'show-in-privacy-center': t.BooleanC; /** The options when type is single or multi select */
|
|
65077
65082
|
options: t.ArrayC<t.TypeC<{
|
|
65078
65083
|
/** Title of option value */title: t.StringC; /** API slug */
|
|
@@ -122734,9 +122739,11 @@ declare const TranscendInput: t.PartialC<{
|
|
|
122734
122739
|
BOOLEAN: unknown;
|
|
122735
122740
|
}>; /** The title of the preference topic */
|
|
122736
122741
|
title: t.StringC; /** The description of the preference topic */
|
|
122737
|
-
description: t.StringC;
|
|
122742
|
+
description: t.StringC; /** API slug for the preference topic (PascalCase; alphabetical letters only) */
|
|
122743
|
+
slug: t.StringC;
|
|
122738
122744
|
}>, t.PartialC<{
|
|
122739
|
-
/**
|
|
122745
|
+
/** Hex color for the preference topic (pull-only; not writable via CLI push today) */color: t.StringC; /** Default value */
|
|
122746
|
+
'default-configuration': t.StringC; /** Whether the preference topic is shown in privacy center */
|
|
122740
122747
|
'show-in-privacy-center': t.BooleanC; /** The options when type is single or multi select */
|
|
122741
122748
|
options: t.ArrayC<t.TypeC<{
|
|
122742
122749
|
/** Title of option value */title: t.StringC; /** API slug */
|
|
@@ -128157,6 +128164,13 @@ declare const TranscendInput: t.PartialC<{
|
|
|
128157
128164
|
plaintextContext: t.StringC; /** The custom title of the data silo results */
|
|
128158
128165
|
title: t.UnionC<[t.StringC, t.NullC]>;
|
|
128159
128166
|
}>]>>;
|
|
128167
|
+
/**
|
|
128168
|
+
* Preference management options for multi and single selects
|
|
128169
|
+
*/
|
|
128170
|
+
'preference-options': t.ArrayC<t.TypeC<{
|
|
128171
|
+
/** Title of option value */title: t.StringC; /** API slug */
|
|
128172
|
+
slug: t.StringC;
|
|
128173
|
+
}>>;
|
|
128160
128174
|
}>;
|
|
128161
128175
|
/** Type override */
|
|
128162
128176
|
type TranscendInput = t.TypeOf<typeof TranscendInput>;
|
|
@@ -128417,6 +128431,7 @@ declare enum TranscendPullResource {
|
|
|
128417
128431
|
Assessments = "assessments",
|
|
128418
128432
|
AssessmentTemplates = "assessmentTemplates",
|
|
128419
128433
|
Purposes = "purposes",
|
|
128434
|
+
PreferenceOptions = "preferenceOptions",
|
|
128420
128435
|
SystemDiscovery = "systemDiscovery"
|
|
128421
128436
|
}
|
|
128422
128437
|
/**
|
|
@@ -128493,19 +128508,23 @@ declare function writeTranscendYaml(filePath: string, input: TranscendInput): vo
|
|
|
128493
128508
|
* @param input - The yml input
|
|
128494
128509
|
* @param client - GraphQL client
|
|
128495
128510
|
* @param pageSize - Page size
|
|
128496
|
-
* @returns
|
|
128511
|
+
* @returns Structured sync result with per-resource errors
|
|
128497
128512
|
*/
|
|
128498
128513
|
declare function syncConfigurationToTranscend(input: TranscendInput, client: GraphQLClient, {
|
|
128499
128514
|
pageSize,
|
|
128500
128515
|
publishToPrivacyCenter,
|
|
128501
128516
|
classifyService,
|
|
128502
|
-
deleteExtraAttributeValues
|
|
128517
|
+
deleteExtraAttributeValues,
|
|
128518
|
+
logger: syncLogger,
|
|
128519
|
+
warnings
|
|
128503
128520
|
}: {
|
|
128504
128521
|
/** Page size */pageSize?: number; /** When true, skip publishing to privacy center */
|
|
128505
128522
|
publishToPrivacyCenter?: boolean; /** When true, delete any attributes being synced up */
|
|
128506
128523
|
deleteExtraAttributeValues?: boolean; /** classify data flow service if missing */
|
|
128507
|
-
classifyService?: boolean;
|
|
128508
|
-
|
|
128524
|
+
classifyService?: boolean; /** Optional logger (e.g. collecting logger for MCP debug responses) */
|
|
128525
|
+
logger?: Logger; /** Non-fatal warnings to include in the result */
|
|
128526
|
+
warnings?: string[];
|
|
128527
|
+
}): Promise<SyncResult>;
|
|
128509
128528
|
//#endregion
|
|
128510
128529
|
//#region src/lib/mergeTranscendInputs.d.ts
|
|
128511
128530
|
/**
|