@transcend-io/cli 10.23.0 → 10.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -86
- package/dist/app-BJ1QlNA0.mjs +131 -0
- package/dist/app-BJ1QlNA0.mjs.map +1 -0
- package/dist/{approvePrivacyRequests-BMa5P15R.mjs → approvePrivacyRequests-C2EflZEJ.mjs} +2 -2
- package/dist/{approvePrivacyRequests-BMa5P15R.mjs.map → approvePrivacyRequests-C2EflZEJ.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-C1d7A08r.mjs → buildExamples-DnV_tVZt.mjs} +2 -2
- package/dist/{buildExamples-C1d7A08r.mjs.map → buildExamples-DnV_tVZt.mjs.map} +1 -1
- package/dist/{buildXdiSyncEndpoint-CZmu6rbU.mjs → buildXdiSyncEndpoint-BYtXQ3Um.mjs} +2 -2
- package/dist/{buildXdiSyncEndpoint-CZmu6rbU.mjs.map → buildXdiSyncEndpoint-BYtXQ3Um.mjs.map} +1 -1
- package/dist/{bulkRestartRequests-Bt1ywbss.mjs → bulkRestartRequests-DROZyl0s.mjs} +2 -2
- package/dist/{bulkRestartRequests-Bt1ywbss.mjs.map → bulkRestartRequests-DROZyl0s.mjs.map} +1 -1
- package/dist/{bulkRetryEnrichers-B42uPqju.mjs → bulkRetryEnrichers-DHIt_YpU.mjs} +2 -2
- package/dist/{bulkRetryEnrichers-B42uPqju.mjs.map → bulkRetryEnrichers-DHIt_YpU.mjs.map} +1 -1
- package/dist/{cancelPrivacyRequests-BLWlXNF5.mjs → cancelPrivacyRequests-DUmxmMsv.mjs} +2 -2
- package/dist/{cancelPrivacyRequests-BLWlXNF5.mjs.map → cancelPrivacyRequests-DUmxmMsv.mjs.map} +1 -1
- package/dist/{codecs-DH-hZonL.mjs → codecs-Dch3sv5m.mjs} +1 -1
- package/dist/{codecs-DH-hZonL.mjs.map → codecs-Dch3sv5m.mjs.map} +1 -1
- package/dist/{collectCsvFilesOrExit-BQdnr-m2.mjs → collectCsvFilesOrExit-C8-Pr9Hr.mjs} +2 -2
- package/dist/{collectCsvFilesOrExit-BQdnr-m2.mjs.map → collectCsvFilesOrExit-C8-Pr9Hr.mjs.map} +1 -1
- package/dist/{collectParquetFilesOrExit-BJ-GciNy.mjs → collectParquetFilesOrExit-DyZISY9X.mjs} +2 -2
- package/dist/{collectParquetFilesOrExit-BJ-GciNy.mjs.map → collectParquetFilesOrExit-DyZISY9X.mjs.map} +1 -1
- package/dist/{command-DSEJjlWi.mjs → command-DsPVpqxX.mjs} +2 -2
- package/dist/{command-DSEJjlWi.mjs.map → command-DsPVpqxX.mjs.map} +1 -1
- package/dist/commands/admin/chunk-csv/worker.mjs +1 -1
- package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
- package/dist/{consentManagersToBusinessEntities-l8jRfpYN.mjs → consentManagersToBusinessEntities-DGzryQ3W.mjs} +2 -2
- package/dist/{consentManagersToBusinessEntities-l8jRfpYN.mjs.map → consentManagersToBusinessEntities-DGzryQ3W.mjs.map} +1 -1
- package/dist/{constants-DXUo-hl3.mjs → constants-B44yUGaB.mjs} +2 -2
- package/dist/{constants-DXUo-hl3.mjs.map → constants-B44yUGaB.mjs.map} +1 -1
- package/dist/constants-CEPYyv4h.mjs +2 -0
- package/dist/constants-CEPYyv4h.mjs.map +1 -0
- package/dist/{constants-BhZIv-FP.mjs → constants-FbK2iR--.mjs} +1 -1
- package/dist/{constants-BhZIv-FP.mjs.map → constants-FbK2iR--.mjs.map} +1 -1
- package/dist/{constants-KYaYveEQ.mjs → constants-ykNINvFg.mjs} +1 -1
- package/dist/{constants-KYaYveEQ.mjs.map → constants-ykNINvFg.mjs.map} +1 -1
- package/dist/{context-CdSyuBlf.mjs → context-Br0NHHOk.mjs} +1 -1
- package/dist/{context-CdSyuBlf.mjs.map → context-Br0NHHOk.mjs.map} +1 -1
- package/dist/{createExtraKeyHandler-BdxKFYkG.mjs → createExtraKeyHandler-CJRmK224.mjs} +2 -2
- package/dist/{createExtraKeyHandler-BdxKFYkG.mjs.map → createExtraKeyHandler-CJRmK224.mjs.map} +1 -1
- package/dist/{dataFlowsToDataSilos-Blo6-adp.mjs → dataFlowsToDataSilos-DRGrUosf.mjs} +1 -1
- package/dist/{dataFlowsToDataSilos-Blo6-adp.mjs.map → dataFlowsToDataSilos-DRGrUosf.mjs.map} +1 -1
- package/dist/{done-input-validation-CvwjeRWr.mjs → done-input-validation-uqIgnJcw.mjs} +1 -1
- package/dist/{done-input-validation-CvwjeRWr.mjs.map → done-input-validation-uqIgnJcw.mjs.map} +1 -1
- package/dist/{downloadPrivacyRequestFiles-B_Hj7D8R.mjs → downloadPrivacyRequestFiles-BX85Pey2.mjs} +2 -2
- package/dist/{downloadPrivacyRequestFiles-B_Hj7D8R.mjs.map → downloadPrivacyRequestFiles-BX85Pey2.mjs.map} +1 -1
- package/dist/{extractClientError-CaF_Kj-f.mjs → extractClientError-X9wJVqGq.mjs} +1 -1
- package/dist/{extractClientError-CaF_Kj-f.mjs.map → extractClientError-X9wJVqGq.mjs.map} +1 -1
- package/dist/{fetchAllRequests-BCHpCeFo.mjs → fetchAllRequests-Bya6iwzL.mjs} +2 -2
- package/dist/{fetchAllRequests-BCHpCeFo.mjs.map → fetchAllRequests-Bya6iwzL.mjs.map} +1 -1
- package/dist/{formatPolicyBundleVersionSummary-DvxPXykZ.mjs → formatPolicyBundleVersionSummary-Bo7DYxoy.mjs} +1 -1
- package/dist/{formatPolicyBundleVersionSummary-DvxPXykZ.mjs.map → formatPolicyBundleVersionSummary-Bo7DYxoy.mjs.map} +1 -1
- package/dist/{fuzzyMatchColumns-Dym9eeQe.mjs → fuzzyMatchColumns-Ds0TqtJ5.mjs} +2 -2
- package/dist/{fuzzyMatchColumns-Dym9eeQe.mjs.map → fuzzyMatchColumns-Ds0TqtJ5.mjs.map} +1 -1
- package/dist/{generateCrossAccountApiKeys-C8ZFxpdg.mjs → generateCrossAccountApiKeys-DELmDKBr.mjs} +2 -2
- package/dist/{generateCrossAccountApiKeys-C8ZFxpdg.mjs.map → generateCrossAccountApiKeys-DELmDKBr.mjs.map} +1 -1
- package/dist/{impl-DkwbYk5g.mjs → impl-1y382i4y.mjs} +2 -2
- package/dist/{impl-DkwbYk5g.mjs.map → impl-1y382i4y.mjs.map} +1 -1
- package/dist/impl-3kG5jsbx.mjs +2 -0
- package/dist/{impl-CPSwCOH3.mjs.map → impl-3kG5jsbx.mjs.map} +1 -1
- package/dist/{impl-CoaEY_Xu.mjs → impl-6M90fU9c.mjs} +2 -2
- package/dist/{impl-CoaEY_Xu.mjs.map → impl-6M90fU9c.mjs.map} +1 -1
- package/dist/impl-B0AKcSoy.mjs +2 -0
- package/dist/impl-B0AKcSoy.mjs.map +1 -0
- package/dist/{impl-D1qyAnzc.mjs → impl-B2Um3cCa.mjs} +2 -2
- package/dist/{impl-D1qyAnzc.mjs.map → impl-B2Um3cCa.mjs.map} +1 -1
- package/dist/impl-BCEw1fsj.mjs +3 -0
- package/dist/impl-BCEw1fsj.mjs.map +1 -0
- package/dist/{impl-CcuqNyVQ2.mjs → impl-BHKNOzzl2.mjs} +2 -2
- package/dist/{impl-CcuqNyVQ2.mjs.map → impl-BHKNOzzl2.mjs.map} +1 -1
- package/dist/impl-BTp6QWcY.mjs +3 -0
- package/dist/impl-BTp6QWcY.mjs.map +1 -0
- package/dist/{impl-BMU2cg0K.mjs → impl-BWenu3QG.mjs} +2 -2
- package/dist/{impl-BMU2cg0K.mjs.map → impl-BWenu3QG.mjs.map} +1 -1
- package/dist/{impl-CoLm9Dhn.mjs → impl-BZ0aEWLg.mjs} +2 -2
- package/dist/{impl-CoLm9Dhn.mjs.map → impl-BZ0aEWLg.mjs.map} +1 -1
- package/dist/{impl-sEqlxROi2.mjs → impl-BZXxpO912.mjs} +2 -2
- package/dist/{impl-sEqlxROi2.mjs.map → impl-BZXxpO912.mjs.map} +1 -1
- package/dist/impl-B_4_7a-i.mjs +3 -0
- package/dist/impl-B_4_7a-i.mjs.map +1 -0
- package/dist/{impl-CqAhgJRN.mjs → impl-BbIP694E.mjs} +2 -2
- package/dist/{impl-CqAhgJRN.mjs.map → impl-BbIP694E.mjs.map} +1 -1
- package/dist/{impl-BeWMuac5.mjs → impl-BnJiEB-x.mjs} +2 -2
- package/dist/{impl-BeWMuac5.mjs.map → impl-BnJiEB-x.mjs.map} +1 -1
- package/dist/{impl-D-0T5fxa2.mjs → impl-Bxbu4It12.mjs} +2 -2
- package/dist/{impl-D-0T5fxa2.mjs.map → impl-Bxbu4It12.mjs.map} +1 -1
- package/dist/{impl-DPAGD55t.mjs → impl-BzyN0wbS2.mjs} +2 -2
- package/dist/impl-BzyN0wbS2.mjs.map +1 -0
- package/dist/impl-C5RWQxAV.mjs +3 -0
- package/dist/{impl-BU5epQoJ.mjs.map → impl-C5RWQxAV.mjs.map} +1 -1
- package/dist/{impl-BqBydC_y.mjs → impl-C69Nh_YS.mjs} +2 -2
- package/dist/{impl-BqBydC_y.mjs.map → impl-C69Nh_YS.mjs.map} +1 -1
- package/dist/impl-C7Xp0Txd.mjs +3 -0
- package/dist/impl-C7Xp0Txd.mjs.map +1 -0
- package/dist/impl-CEkTnggY2.mjs +2 -0
- package/dist/impl-CEkTnggY2.mjs.map +1 -0
- package/dist/{impl-ozhL5VUB2.mjs → impl-CLhItW5v2.mjs} +2 -2
- package/dist/{impl-ozhL5VUB2.mjs.map → impl-CLhItW5v2.mjs.map} +1 -1
- package/dist/{impl-MJ89a6cJ.mjs → impl-CdZ-nr1b.mjs} +2 -2
- package/dist/{impl-MJ89a6cJ.mjs.map → impl-CdZ-nr1b.mjs.map} +1 -1
- package/dist/{impl-X-lj6p6X.mjs → impl-Ce4Ua3nx.mjs} +3 -3
- package/dist/{impl-X-lj6p6X.mjs.map → impl-Ce4Ua3nx.mjs.map} +1 -1
- package/dist/{impl-D7ke0Gwy2.mjs → impl-ChO9Br2_2.mjs} +2 -2
- package/dist/{impl-D7ke0Gwy2.mjs.map → impl-ChO9Br2_2.mjs.map} +1 -1
- package/dist/{impl-DOQ5bwXl.mjs → impl-CiA-v1ol.mjs} +2 -2
- package/dist/{impl-DOQ5bwXl.mjs.map → impl-CiA-v1ol.mjs.map} +1 -1
- package/dist/impl-CjsLPYCP2.mjs +2 -0
- package/dist/impl-CjsLPYCP2.mjs.map +1 -0
- package/dist/{impl-DKzkdLQN.mjs → impl-CpGmNKVh.mjs} +2 -2
- package/dist/{impl-DKzkdLQN.mjs.map → impl-CpGmNKVh.mjs.map} +1 -1
- package/dist/{impl-D1y8T-ku2.mjs → impl-CsFbPjie2.mjs} +2 -2
- package/dist/{impl-D1y8T-ku2.mjs.map → impl-CsFbPjie2.mjs.map} +1 -1
- package/dist/{impl-Dt0HArIu.mjs → impl-CuAUD_Ij2.mjs} +2 -2
- package/dist/impl-CuAUD_Ij2.mjs.map +1 -0
- package/dist/impl-CwJx90K82.mjs +2 -0
- package/dist/impl-CwJx90K82.mjs.map +1 -0
- package/dist/{impl-mDm2_MJM.mjs → impl-D0rQ-_u_.mjs} +2 -2
- package/dist/{impl-mDm2_MJM.mjs.map → impl-D0rQ-_u_.mjs.map} +1 -1
- package/dist/impl-D6rMK5Us.mjs +2 -0
- package/dist/{impl-CwBLpuAJ.mjs.map → impl-D6rMK5Us.mjs.map} +1 -1
- package/dist/{impl-D-kVJk0V.mjs → impl-DF8-QsO52.mjs} +2 -2
- package/dist/impl-DF8-QsO52.mjs.map +1 -0
- package/dist/impl-DGQW5mVR.mjs +2 -0
- package/dist/impl-DGQW5mVR.mjs.map +1 -0
- package/dist/{impl-cIT5ehpg2.mjs → impl-DJFPeUq32.mjs} +2 -2
- package/dist/{impl-cIT5ehpg2.mjs.map → impl-DJFPeUq32.mjs.map} +1 -1
- package/dist/impl-DLNk5Voe.mjs +4 -0
- package/dist/{impl-Qkau85p_.mjs.map → impl-DLNk5Voe.mjs.map} +1 -1
- package/dist/{impl-BAcwgZfx.mjs → impl-DMtn2boK.mjs} +2 -2
- package/dist/{impl-BAcwgZfx.mjs.map → impl-DMtn2boK.mjs.map} +1 -1
- package/dist/{impl-DbW8OPcD.mjs → impl-DQ-kymSs.mjs} +2 -2
- package/dist/{impl-DbW8OPcD.mjs.map → impl-DQ-kymSs.mjs.map} +1 -1
- package/dist/{impl-CXXgArMZ.mjs → impl-D_Zke9vp.mjs} +2 -2
- package/dist/{impl-CXXgArMZ.mjs.map → impl-D_Zke9vp.mjs.map} +1 -1
- package/dist/{impl-qqLyjAc_.mjs → impl-DvrO6Zrd.mjs} +2 -2
- package/dist/{impl-qqLyjAc_.mjs.map → impl-DvrO6Zrd.mjs.map} +1 -1
- package/dist/{impl-BaeIbfQe2.mjs → impl-E0CjQexl2.mjs} +2 -2
- package/dist/{impl-BaeIbfQe2.mjs.map → impl-E0CjQexl2.mjs.map} +1 -1
- package/dist/{impl-BFCZDhHg.mjs → impl-EmiQDBEx2.mjs} +2 -2
- package/dist/impl-EmiQDBEx2.mjs.map +1 -0
- package/dist/{impl-BOCQpFcO.mjs → impl-IT4hoGkx.mjs} +2 -2
- package/dist/{impl-BOCQpFcO.mjs.map → impl-IT4hoGkx.mjs.map} +1 -1
- package/dist/{impl-DQGV2G5v.mjs → impl-NUMkBg7d.mjs} +2 -2
- package/dist/{impl-DQGV2G5v.mjs.map → impl-NUMkBg7d.mjs.map} +1 -1
- package/dist/{impl-C-bO3-ZT2.mjs → impl-ToUQkHVL2.mjs} +2 -2
- package/dist/{impl-C-bO3-ZT2.mjs.map → impl-ToUQkHVL2.mjs.map} +1 -1
- package/dist/impl-WHaoeim8.mjs +2 -0
- package/dist/{impl-DgUf3gA3.mjs.map → impl-WHaoeim8.mjs.map} +1 -1
- package/dist/{impl-Bq3ZIpcG.mjs → impl-Zjvt9J28.mjs} +2 -2
- package/dist/{impl-Bq3ZIpcG.mjs.map → impl-Zjvt9J28.mjs.map} +1 -1
- package/dist/{impl-g_xHoYv8.mjs → impl-_HlLHVRO.mjs} +2 -2
- package/dist/{impl-g_xHoYv8.mjs.map → impl-_HlLHVRO.mjs.map} +1 -1
- package/dist/{impl-BoHg4UN1.mjs → impl-cMFtIJUY2.mjs} +2 -2
- package/dist/impl-cMFtIJUY2.mjs.map +1 -0
- package/dist/impl-fiK_rZ7c.mjs +2 -0
- package/dist/{impl-C0n31a_O.mjs.map → impl-fiK_rZ7c.mjs.map} +1 -1
- package/dist/{impl-BHisOrKX.mjs → impl-rKM9h7Vg.mjs} +2 -2
- package/dist/{impl-BHisOrKX.mjs.map → impl-rKM9h7Vg.mjs.map} +1 -1
- package/dist/{impl-BFZWp3UU2.mjs → impl-x_rM8yTw.mjs} +2 -2
- package/dist/impl-x_rM8yTw.mjs.map +1 -0
- package/dist/{impl-C515J-j7.mjs → impl-z5dBnPm5.mjs} +3 -3
- package/dist/{impl-C515J-j7.mjs.map → impl-z5dBnPm5.mjs.map} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{inquirer-CXl1YWCs.mjs → inquirer-AEchly0b.mjs} +2 -2
- package/dist/{inquirer-CXl1YWCs.mjs.map → inquirer-AEchly0b.mjs.map} +1 -1
- package/dist/{listFiles-B1GqyM33.mjs → listFiles-BPx3iDV6.mjs} +1 -1
- package/dist/{listFiles-B1GqyM33.mjs.map → listFiles-BPx3iDV6.mjs.map} +1 -1
- package/dist/{logger-B-LXIf3U.mjs → logger-Ckep4QXn.mjs} +1 -1
- package/dist/{logger-B-LXIf3U.mjs.map → logger-Ckep4QXn.mjs.map} +1 -1
- package/dist/{markRequestDataSiloIdsCompleted-CB_yZAXh.mjs → markRequestDataSiloIdsCompleted-zFRxJN8D.mjs} +2 -2
- package/dist/{markRequestDataSiloIdsCompleted-CB_yZAXh.mjs.map → markRequestDataSiloIdsCompleted-zFRxJN8D.mjs.map} +1 -1
- package/dist/{markSilentPrivacyRequests-cfNU6f9-.mjs → markSilentPrivacyRequests-t65ShOrn.mjs} +2 -2
- package/dist/{markSilentPrivacyRequests-cfNU6f9-.mjs.map → markSilentPrivacyRequests-t65ShOrn.mjs.map} +1 -1
- package/dist/{notifyPrivacyRequestsAdditionalTime-DYWo4N8w.mjs → notifyPrivacyRequestsAdditionalTime-C7v7zo8q.mjs} +2 -2
- package/dist/{notifyPrivacyRequestsAdditionalTime-DYWo4N8w.mjs.map → notifyPrivacyRequestsAdditionalTime-C7v7zo8q.mjs.map} +1 -1
- package/dist/{parquetToCsvOneFile-DuyOOzqQ.mjs → parquetToCsvOneFile-13GirFzy.mjs} +2 -2
- package/dist/{parquetToCsvOneFile-DuyOOzqQ.mjs.map → parquetToCsvOneFile-13GirFzy.mjs.map} +1 -1
- package/dist/{parseAttributesFromString-ByzY22WY.mjs → parseAttributesFromString-CYcxsS3n.mjs} +2 -2
- package/dist/{parseAttributesFromString-ByzY22WY.mjs.map → parseAttributesFromString-CYcxsS3n.mjs.map} +1 -1
- package/dist/{parseVariablesFromString-BH2VIMis.mjs → parseVariablesFromString-RM3zV9Av.mjs} +2 -2
- package/dist/{parseVariablesFromString-BH2VIMis.mjs.map → parseVariablesFromString-RM3zV9Av.mjs.map} +1 -1
- package/dist/policyEngineCliError-BnBghLd1.mjs +3 -0
- package/dist/policyEngineCliError-BnBghLd1.mjs.map +1 -0
- package/dist/printResult-oXnpZu_9.mjs +33 -0
- package/dist/printResult-oXnpZu_9.mjs.map +1 -0
- package/dist/{pullAllDatapoints-D8mTXHun.mjs → pullAllDatapoints-Bvv9KRR5.mjs} +2 -2
- package/dist/{pullAllDatapoints-D8mTXHun.mjs.map → pullAllDatapoints-Bvv9KRR5.mjs.map} +1 -1
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-Czdfe35L.mjs → pullChunkedCustomSiloOutstandingIdentifiers-io0k95RW.mjs} +2 -2
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-Czdfe35L.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-io0k95RW.mjs.map} +1 -1
- package/dist/{pullConsentManagerMetrics-Cma2auCK.mjs → pullConsentManagerMetrics-CR4WwUt6.mjs} +2 -2
- package/dist/{pullConsentManagerMetrics-Cma2auCK.mjs.map → pullConsentManagerMetrics-CR4WwUt6.mjs.map} +1 -1
- package/dist/{pullManualEnrichmentIdentifiersToCsv-MCAxey_B.mjs → pullManualEnrichmentIdentifiersToCsv-CzhDjPw2.mjs} +2 -2
- package/dist/{pullManualEnrichmentIdentifiersToCsv-MCAxey_B.mjs.map → pullManualEnrichmentIdentifiersToCsv-CzhDjPw2.mjs.map} +1 -1
- package/dist/{pullTranscendConfiguration-BQCO6G7Z.mjs → pullTranscendConfiguration-C2LAOKG4.mjs} +2 -2
- package/dist/{pullTranscendConfiguration-BQCO6G7Z.mjs.map → pullTranscendConfiguration-C2LAOKG4.mjs.map} +1 -1
- package/dist/{pullUnstructuredSubDataPointRecommendations-DkQMoo7S.mjs → pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs} +2 -2
- package/dist/{pullUnstructuredSubDataPointRecommendations-DkQMoo7S.mjs.map → pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs.map} +1 -1
- package/dist/{pushCronIdentifiersFromCsv-Bp93Ba9h.mjs → pushCronIdentifiersFromCsv-CehtFgXS.mjs} +2 -2
- package/dist/{pushCronIdentifiersFromCsv-Bp93Ba9h.mjs.map → pushCronIdentifiersFromCsv-CehtFgXS.mjs.map} +1 -1
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-n1WyKiBi.mjs → pushManualEnrichmentIdentifiersFromCsv-CAl_kfHY.mjs} +2 -2
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-n1WyKiBi.mjs.map → pushManualEnrichmentIdentifiersFromCsv-CAl_kfHY.mjs.map} +1 -1
- package/dist/{readCsv-D1e7WRTc.mjs → readCsv-C84Jhrzx.mjs} +1 -1
- package/dist/{readCsv-D1e7WRTc.mjs.map → readCsv-C84Jhrzx.mjs.map} +1 -1
- package/dist/{readTranscendYaml-CVbI1N8S.mjs → readTranscendYaml-dI3G3Og9.mjs} +2 -2
- package/dist/{readTranscendYaml-CVbI1N8S.mjs.map → readTranscendYaml-dI3G3Og9.mjs.map} +1 -1
- package/dist/{removeUnverifiedRequestIdentifiers-CllBM6yg.mjs → removeUnverifiedRequestIdentifiers-CApHXROq.mjs} +2 -2
- package/dist/{removeUnverifiedRequestIdentifiers-CllBM6yg.mjs.map → removeUnverifiedRequestIdentifiers-CApHXROq.mjs.map} +1 -1
- package/dist/{renderTable-BgjVr6ch.mjs → renderTable-DKXvortp.mjs} +1 -1
- package/dist/{renderTable-BgjVr6ch.mjs.map → renderTable-DKXvortp.mjs.map} +1 -1
- package/dist/{request-C4gYxn1p.mjs → request-BIplTb3L.mjs} +1 -1
- package/dist/{request-C4gYxn1p.mjs.map → request-BIplTb3L.mjs.map} +1 -1
- package/dist/resolveBundleIdByName-By5Vl8Iz.mjs +2 -0
- package/dist/resolveBundleIdByName-By5Vl8Iz.mjs.map +1 -0
- package/dist/resolvePolicyBundleVersion-DO7IvEwb.mjs +2 -0
- package/dist/resolvePolicyBundleVersion-DO7IvEwb.mjs.map +1 -0
- package/dist/{retryRequestDataSilos-Bmh5RtDW.mjs → retryRequestDataSilos-Tou-97EC.mjs} +2 -2
- package/dist/{retryRequestDataSilos-Bmh5RtDW.mjs.map → retryRequestDataSilos-Tou-97EC.mjs.map} +1 -1
- package/dist/{runOpa-DGUkXzFZ.mjs → runOpa-D511z37u.mjs} +2 -2
- package/dist/{runOpa-DGUkXzFZ.mjs.map → runOpa-D511z37u.mjs.map} +1 -1
- package/dist/{skipPreflightJobs-5PcntUk7.mjs → skipPreflightJobs-TL4bpgJ5.mjs} +2 -2
- package/dist/{skipPreflightJobs-5PcntUk7.mjs.map → skipPreflightJobs-TL4bpgJ5.mjs.map} +1 -1
- package/dist/{skipRequestDataSilos-GA77Dtwe.mjs → skipRequestDataSilos-D4DQNs2F.mjs} +2 -2
- package/dist/{skipRequestDataSilos-GA77Dtwe.mjs.map → skipRequestDataSilos-D4DQNs2F.mjs.map} +1 -1
- package/dist/{streamPrivacyRequestsToCsv-DgvBRjF-.mjs → streamPrivacyRequestsToCsv-BW7LayDe.mjs} +2 -2
- package/dist/{streamPrivacyRequestsToCsv-DgvBRjF-.mjs.map → streamPrivacyRequestsToCsv-BW7LayDe.mjs.map} +1 -1
- package/dist/{syncCodePackages-CwPtA473.mjs → syncCodePackages-Dhm5jI6B.mjs} +2 -2
- package/dist/{syncCodePackages-CwPtA473.mjs.map → syncCodePackages-Dhm5jI6B.mjs.map} +1 -1
- package/dist/{updateConsentManagerVersionToLatest-Db_3rBVb.mjs → updateConsentManagerVersionToLatest-D22lm-RZ.mjs} +2 -2
- package/dist/{updateConsentManagerVersionToLatest-Db_3rBVb.mjs.map → updateConsentManagerVersionToLatest-D22lm-RZ.mjs.map} +1 -1
- package/dist/{uploadConsents-DYRO1JJQ.mjs → uploadConsents-7V2GfdKQ.mjs} +2 -2
- package/dist/{uploadConsents-DYRO1JJQ.mjs.map → uploadConsents-7V2GfdKQ.mjs.map} +1 -1
- package/dist/{uploadCookiesFromCsv-D-b7vR50.mjs → uploadCookiesFromCsv-AyQGnKOP.mjs} +2 -2
- package/dist/{uploadCookiesFromCsv-D-b7vR50.mjs.map → uploadCookiesFromCsv-AyQGnKOP.mjs.map} +1 -1
- package/dist/{uploadDataFlowsFromCsv-DSuBhPT4.mjs → uploadDataFlowsFromCsv-4Uw_-6pw.mjs} +2 -2
- package/dist/{uploadDataFlowsFromCsv-DSuBhPT4.mjs.map → uploadDataFlowsFromCsv-4Uw_-6pw.mjs.map} +1 -1
- package/dist/{uploadPrivacyRequestsFromCsv-BcrzcKIL.mjs → uploadPrivacyRequestsFromCsv-DuDL3uOz.mjs} +2 -2
- package/dist/{uploadPrivacyRequestsFromCsv-BcrzcKIL.mjs.map → uploadPrivacyRequestsFromCsv-DuDL3uOz.mjs.map} +1 -1
- package/dist/{validateTranscendAuth-Bxc1ETtl.mjs → validateTranscendAuth-DhzCBA3F.mjs} +2 -2
- package/dist/{validateTranscendAuth-Bxc1ETtl.mjs.map → validateTranscendAuth-DhzCBA3F.mjs.map} +1 -1
- package/dist/{writeCsv-DDKM_rAU.mjs → writeCsv-BMVkiMHM.mjs} +1 -1
- package/dist/{writeCsv-DDKM_rAU.mjs.map → writeCsv-BMVkiMHM.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/app-C9JuEKbr.mjs +0 -131
- package/dist/app-C9JuEKbr.mjs.map +0 -1
- package/dist/constants-CgI8_Rfc.mjs +0 -2
- package/dist/constants-CgI8_Rfc.mjs.map +0 -1
- package/dist/formatPolicyEngineRequestError-Dn_VYIIj.mjs +0 -2
- package/dist/formatPolicyEngineRequestError-Dn_VYIIj.mjs.map +0 -1
- package/dist/impl-BFCZDhHg.mjs.map +0 -1
- package/dist/impl-BFZWp3UU2.mjs.map +0 -1
- package/dist/impl-BMteSe3O.mjs +0 -3
- package/dist/impl-BMteSe3O.mjs.map +0 -1
- package/dist/impl-BU5epQoJ.mjs +0 -3
- package/dist/impl-BoHg4UN1.mjs.map +0 -1
- package/dist/impl-C0n31a_O.mjs +0 -2
- package/dist/impl-C2ZIXwmT.mjs +0 -2
- package/dist/impl-C2ZIXwmT.mjs.map +0 -1
- package/dist/impl-C930divP.mjs +0 -2
- package/dist/impl-C930divP.mjs.map +0 -1
- package/dist/impl-CEQNDwPb.mjs +0 -2
- package/dist/impl-CEQNDwPb.mjs.map +0 -1
- package/dist/impl-CPSwCOH3.mjs +0 -2
- package/dist/impl-CwBLpuAJ.mjs +0 -2
- package/dist/impl-D-kVJk0V.mjs.map +0 -1
- package/dist/impl-DFfc5HBk.mjs +0 -3
- package/dist/impl-DFfc5HBk.mjs.map +0 -1
- package/dist/impl-DPAGD55t.mjs.map +0 -1
- package/dist/impl-DfUBAl_6.mjs +0 -2
- package/dist/impl-DfUBAl_6.mjs.map +0 -1
- package/dist/impl-DgUf3gA3.mjs +0 -2
- package/dist/impl-Dt0HArIu.mjs.map +0 -1
- package/dist/impl-DxkQuCp8.mjs +0 -2
- package/dist/impl-DxkQuCp8.mjs.map +0 -1
- package/dist/impl-JU14ujB0.mjs +0 -3
- package/dist/impl-JU14ujB0.mjs.map +0 -1
- package/dist/impl-Qkau85p_.mjs +0 -4
- package/dist/impl-ouNg4TVN.mjs +0 -2
- package/dist/impl-ouNg4TVN.mjs.map +0 -1
- package/dist/printResult-DdSpAx6T.mjs +0 -2
- package/dist/printResult-DdSpAx6T.mjs.map +0 -1
- package/dist/resolveBundleIdByName-C-M1UT8E.mjs +0 -2
- package/dist/resolveBundleIdByName-C-M1UT8E.mjs.map +0 -1
- package/dist/resolvePolicyBundleVersion-HwUipJxP.mjs +0 -2
- package/dist/resolvePolicyBundleVersion-HwUipJxP.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-C930divP.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 { inquirerConfirmBoolean } from '../../../lib/helpers/inquirer.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 /** Skip the \"create new bundle\" confirmation */\n yes: 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 yes,\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 if (!this.process.stdin.isTTY && !yes) {\n logger.error(\n colors.red(\n 'Cannot create a new bundle in a non-interactive environment; pass --yes to confirm.',\n ),\n );\n this.process.exit(1);\n return;\n }\n\n if (!yes) {\n logger.warn(\n colors.yellow(`No policy bundle named \"${bundleName}\" exists for this organization.`),\n );\n const shouldCreate = await inquirerConfirmBoolean({\n message: `No policy bundle named \"${bundleName}\" exists. Create a new bundle and upload its first version?`,\n });\n if (!shouldCreate) {\n logger.info(colors.yellow('Publish cancelled.'));\n return;\n }\n }\n\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":"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"}
|
package/dist/impl-CEQNDwPb.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";import{n,t as r}from"./printResult-DdSpAx6T.mjs";import{t as i}from"./renderTable-BgjVr6ch.mjs";import a from"colors";async function o({auth:o,"transcend-url":s,limit:c,offset:l,json:u}){t(this.process.exit);let d=n(s,o);e.info(a.green(`Listing policy bundles...`));let f=await d.get(`v1/policy-engine/policy-bundles`,{searchParams:{limit:c,offset:l}}).json();r(this.process.stdout,{json:u,data:f,renderTable:()=>{if(f.nodes.length===0)return`No policy bundles found.`;let e=i([`id`,`bundleName`,`activeVersionId`,`lastActivatedAt`,`createdAt`],f.nodes.map(e=>[e.id,e.bundleName,e.activeVersionId??`-`,e.lastActivatedAt??`-`,e.createdAt]));return e+=`\n\ntotalCount: ${f.totalCount}`,l+f.nodes.length<f.totalCount&&(e+=`\nnextOffset: ${l+f.nodes.length}`),e}})}export{o as bundles};
|
|
2
|
-
//# sourceMappingURL=impl-CEQNDwPb.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-CEQNDwPb.mjs","names":[],"sources":["../src/commands/policy/bundles/impl.ts"],"sourcesContent":["import 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 { EMPTY_CELL } from '../constants.js';\nimport { buildPolicyEngineClient, printResult, renderTable } from '../helpers/index.js';\nimport type { PolicyBundleListResponse } from '../types.js';\n\n/** CLI flags for `transcend policy bundles`. */\nexport interface BundlesCommandFlags {\n /** Transcend API key */\n auth: string;\n /** Transcend API URL */\n 'transcend-url': string;\n /** Page size */\n limit: number;\n /** Number of records to skip */\n offset: number;\n /** Print raw JSON response */\n json: boolean;\n}\n\n/**\n * List policy bundles for the current organization.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function bundles(\n this: LocalContext,\n { auth, 'transcend-url': transcendUrl, limit, offset, json }: BundlesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const client = buildPolicyEngineClient(transcendUrl, auth);\n\n logger.info(colors.green('Listing policy bundles...'));\n\n const body = await client\n .get('v1/policy-engine/policy-bundles', {\n searchParams: { limit, offset },\n })\n .json<PolicyBundleListResponse>();\n\n printResult(this.process.stdout, {\n json,\n data: body,\n renderTable: () => {\n if (body.nodes.length === 0) {\n return 'No policy bundles found.';\n }\n\n const rows = body.nodes.map((bundle) => [\n bundle.id,\n bundle.bundleName,\n bundle.activeVersionId ?? EMPTY_CELL,\n bundle.lastActivatedAt ?? EMPTY_CELL,\n bundle.createdAt,\n ]);\n\n let table = renderTable(\n ['id', 'bundleName', 'activeVersionId', 'lastActivatedAt', 'createdAt'],\n rows,\n );\n table += `\\n\\ntotalCount: ${body.totalCount}`;\n if (offset + body.nodes.length < body.totalCount) {\n table += `\\nnextOffset: ${offset + body.nodes.length}`;\n }\n return table;\n },\n });\n}\n"],"mappings":"oNA6BA,eAAsB,EAEpB,CAAE,OAAM,gBAAiB,EAAc,QAAO,SAAQ,QACvC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAS,EAAwB,EAAc,EAAK,CAE1D,EAAO,KAAK,EAAO,MAAM,4BAA4B,CAAC,CAEtD,IAAM,EAAO,MAAM,EAChB,IAAI,kCAAmC,CACtC,aAAc,CAAE,QAAO,SAAQ,CAChC,CAAC,CACD,MAAgC,CAEnC,EAAY,KAAK,QAAQ,OAAQ,CAC/B,OACA,KAAM,EACN,gBAAmB,CACjB,GAAI,EAAK,MAAM,SAAW,EACxB,MAAO,2BAWT,IAAI,EAAQ,EACV,CAAC,KAAM,aAAc,kBAAmB,kBAAmB,YAAY,CAT5D,EAAK,MAAM,IAAK,GAAW,CACtC,EAAO,GACP,EAAO,WACP,EAAO,iBAAA,IACP,EAAO,iBAAA,IACP,EAAO,UACR,CAIK,CACL,CAKD,MAJA,IAAS,mBAAmB,EAAK,aAC7B,EAAS,EAAK,MAAM,OAAS,EAAK,aACpC,GAAS,iBAAiB,EAAS,EAAK,MAAM,UAEzC,GAEV,CAAC"}
|
package/dist/impl-CPSwCOH3.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./uploadCookiesFromCsv-D-b7vR50.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";async function n({auth:n,trackerStatus:r,file:i,transcendUrl:a}){t(this.process.exit),await e({auth:n,trackerStatus:r,file:i,transcendUrl:a})}export{n as uploadCookiesFromCsv};
|
|
2
|
-
//# sourceMappingURL=impl-CPSwCOH3.mjs.map
|
package/dist/impl-CwBLpuAJ.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";import{n,r}from"./runOpa-DGUkXzFZ.mjs";import i from"node:path";import a from"colors";async function o({dir:o}){t(this.process.exit),r();let s=i.resolve(o);e.info(a.green(`Running policy tests in ${s}...`));let c=await n([`test`,s]);c!==0&&this.process.exit(c),e.info(a.green(`Policy tests passed.`))}export{o as test};
|
|
2
|
-
//# sourceMappingURL=impl-CwBLpuAJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-D-kVJk0V.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.exit);\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,KAAK,CAEtC,MAAM,EAAmC,CACvC,eAAgB,EAChB,eACA,OACA,kBACD,CAAC"}
|
package/dist/impl-DFfc5HBk.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";import{n,t as r}from"./printResult-DdSpAx6T.mjs";import{t as i}from"./formatPolicyBundleVersionSummary-DvxPXykZ.mjs";import{t as a}from"./formatPolicyEngineRequestError-Dn_VYIIj.mjs";import{n as o}from"./resolveBundleIdByName-C-M1UT8E.mjs";import s from"colors";async function c({"bundle-name":c,auth:l,"transcend-url":u,json:d}){t(this.process.exit);let f=n(u,l),p=await o(f,c);if(!p)throw Error(`Policy bundle "${c}" was not found for this organization.`);e.info(s.green(`Deactivating active version for bundle "${c}"...`));let m;try{m=await f.post(`v1/policy-engine/policy-bundles/${p}/deactivate`).json()}catch(e){throw e?.response?.statusCode===409?Error(`Policy bundle "${c}" has no active version.`,{cause:e}):Error(a(e),{cause:e})}r(this.process.stdout,{json:d,data:m,renderTable:()=>[`bundleId ${m.bundle.id}`,`bundleName ${m.bundle.bundleName}`,i(m.version)].join(`
|
|
2
|
-
`)}),e.info(s.green(`Policy bundle version deactivated.`))}export{c as deactivate};
|
|
3
|
-
//# sourceMappingURL=impl-DFfc5HBk.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-DFfc5HBk.mjs","names":[],"sources":["../src/commands/policy/deactivate/impl.ts"],"sourcesContent":["import 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 {\n buildPolicyEngineClient,\n formatPolicyBundleVersionSummary,\n formatPolicyEngineRequestError,\n printResult,\n resolveBundleIdByName,\n} from '../helpers/index.js';\nimport type { DeactivatePolicyBundleResponse } from '../types.js';\n\n/** CLI flags for `transcend policy deactivate`. */\nexport interface DeactivateCommandFlags {\n /** Logical bundle name to deactivate */\n 'bundle-name': string;\n /** Transcend API key */\n auth: string;\n /** Transcend API URL */\n 'transcend-url': string;\n /** Print raw JSON response */\n json: boolean;\n}\n\n/**\n * Deactivate the currently active version of a policy bundle.\n *\n * Resolves `--bundle-name` to the parent bundle UUID internally, then calls the\n * Policy Engine deactivate endpoint. The bundle is addressed by name only -- the\n * UUID is never exposed to the operator.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function deactivate(\n this: LocalContext,\n { 'bundle-name': bundleName, auth, 'transcend-url': transcendUrl, json }: DeactivateCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const client = buildPolicyEngineClient(transcendUrl, auth);\n\n const resolvedBundleId = await resolveBundleIdByName(client, bundleName);\n if (!resolvedBundleId) {\n throw new Error(`Policy bundle \"${bundleName}\" was not found for this organization.`);\n }\n\n logger.info(colors.green(`Deactivating active version for bundle \"${bundleName}\"...`));\n\n let body: DeactivatePolicyBundleResponse;\n try {\n body = await client\n .post(`v1/policy-engine/policy-bundles/${resolvedBundleId}/deactivate`)\n .json<DeactivatePolicyBundleResponse>();\n } catch (err) {\n // The monolith 409 references the internal bundle UUID; rewrite it to the\n // user-supplied bundle name so the error is actionable.\n const statusCode = (err as { response?: { statusCode?: number } })?.response?.statusCode;\n if (statusCode === 409) {\n throw new Error(`Policy bundle \"${bundleName}\" has no active version.`, { cause: err });\n }\n throw new Error(formatPolicyEngineRequestError(err), { cause: err });\n }\n\n printResult(this.process.stdout, {\n json,\n data: body,\n renderTable: () =>\n [\n `bundleId ${body.bundle.id}`,\n `bundleName ${body.bundle.bundleName}`,\n formatPolicyBundleVersionSummary(body.version),\n ].join('\\n'),\n });\n\n logger.info(colors.green('Policy bundle version deactivated.'));\n}\n"],"mappings":"oWAoCA,eAAsB,EAEpB,CAAE,cAAe,EAAY,OAAM,gBAAiB,EAAc,QACnD,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAS,EAAwB,EAAc,EAAK,CAEpD,EAAmB,MAAM,EAAsB,EAAQ,EAAW,CACxE,GAAI,CAAC,EACH,MAAU,MAAM,kBAAkB,EAAW,wCAAwC,CAGvF,EAAO,KAAK,EAAO,MAAM,2CAA2C,EAAW,MAAM,CAAC,CAEtF,IAAI,EACJ,GAAI,CACF,EAAO,MAAM,EACV,KAAK,mCAAmC,EAAiB,aAAa,CACtE,MAAsC,OAClC,EAAK,CAOZ,MAJoB,GAAgD,UAAU,aAC3D,IACP,MAAM,kBAAkB,EAAW,0BAA2B,CAAE,MAAO,EAAK,CAAC,CAE/E,MAAM,EAA+B,EAAI,CAAE,CAAE,MAAO,EAAK,CAAC,CAGtE,EAAY,KAAK,QAAQ,OAAQ,CAC/B,OACA,KAAM,EACN,gBACE,CACE,eAAe,EAAK,OAAO,KAC3B,eAAe,EAAK,OAAO,aAC3B,EAAiC,EAAK,QAAQ,CAC/C,CAAC,KAAK;EAAK,CACf,CAAC,CAEF,EAAO,KAAK,EAAO,MAAM,qCAAqC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-DPAGD55t.mjs","names":[],"sources":["../src/commands/request/restart/impl.ts"],"sourcesContent":["import type {\n RequestAction,\n RequestStatus,\n RestartIdentifierStrategy,\n} from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { bulkRestartRequests } from '../../../lib/requests/index.js';\n\nexport interface RestartCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses: RequestStatus[];\n transcendUrl: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n requestIds?: string[];\n emailIsVerified: boolean;\n createdAt?: Date;\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n sendEmailReceipt: boolean;\n copyIdentifiers: boolean;\n restartIdentifierStrategy?: RestartIdentifierStrategy;\n skipWaitingPeriod: boolean;\n}\n\nexport async function restart(\n this: LocalContext,\n {\n auth,\n requestReceiptFolder,\n sombraAuth,\n actions,\n statuses,\n requestIds,\n createdAt,\n emailIsVerified,\n silentModeBefore,\n sendEmailReceipt,\n copyIdentifiers,\n restartIdentifierStrategy,\n skipWaitingPeriod,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n concurrency,\n transcendUrl,\n }: RestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRestartRequests({\n requestReceiptFolder,\n auth,\n sombraAuth,\n requestActions: actions,\n requestStatuses: statuses,\n requestIds,\n createdAt,\n emailIsVerified,\n silentModeBefore,\n sendEmailReceipt,\n copyIdentifiers,\n restartIdentifierStrategy,\n skipWaitingPeriod,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n concurrency,\n transcendUrl,\n });\n}\n"],"mappings":"2GAgCA,eAAsB,EAEpB,CACE,OACA,uBACA,aACA,UACA,WACA,aACA,YACA,kBACA,mBACA,mBACA,kBACA,4BACA,oBACA,kBACA,iBACA,kBACA,iBACA,cACA,gBAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAoB,CACxB,uBACA,OACA,aACA,eAAgB,EAChB,gBAAiB,EACjB,aACA,YACA,kBACA,mBACA,mBACA,kBACA,4BACA,oBACA,kBACA,iBACA,kBACA,iBACA,cACA,eACD,CAAC"}
|
package/dist/impl-DfUBAl_6.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./retryRequestDataSilos-Bmh5RtDW.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";async function n({auth:n,dataSiloId:r,actions:i,transcendUrl:a}){t(this.process.exit),await e({requestActions:i,transcendUrl:a,auth:n,dataSiloId:r})}export{n as retryRequestDataSilos};
|
|
2
|
-
//# sourceMappingURL=impl-DfUBAl_6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-DfUBAl_6.mjs","names":["retryRequestDataSilosHelper"],"sources":["../src/commands/request/system/retry-request-data-silos/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 { retryRequestDataSilos as retryRequestDataSilosHelper } from '../../../../lib/requests/index.js';\n\nexport interface RetryRequestDataSilosCommandFlags {\n auth: string;\n dataSiloId: string;\n actions: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function retryRequestDataSilos(\n this: LocalContext,\n { auth, dataSiloId, actions, transcendUrl }: RetryRequestDataSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await retryRequestDataSilosHelper({\n requestActions: actions,\n transcendUrl,\n auth,\n dataSiloId,\n });\n}\n"],"mappings":"6GAaA,eAAsB,EAEpB,CAAE,OAAM,aAAY,UAAS,gBACd,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAA4B,CAChC,eAAgB,EAChB,eACA,OACA,aACD,CAAC"}
|
package/dist/impl-DgUf3gA3.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./constants-CgI8_Rfc.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{n}from"./syncCodePackages-CwPtA473.mjs";import{t as r}from"./done-input-validation-CvwjeRWr.mjs";import{t as i}from"./constants-DXUo-hl3.mjs";import{getEntries as a}from"@transcend-io/type-utils";import o from"colors";import{buildTranscendGraphQLClient as s}from"@transcend-io/sdk";import{execSync as c}from"child_process";import l from"fast-glob";async function u({scanPath:e,ignoreDirs:n=[],repositoryName:r}){return(await Promise.all(a(i).map(async([i,a])=>{let{ignoreDirs:s,supportedFiles:c,scanFunction:u}=a,d=[...n,...s].filter(e=>e.length>0);try{let n=await l(`${e}/**/${c.join(`|`)}`,{ignore:d.map(t=>`${e}/**/${t}`),unique:!0,onlyFiles:!0});t.info(o.magenta(`Scanning: ${n.length} files of type ${i}`));let a=n.map(t=>u(t).map(n=>({...n,relativePath:t.replace(`${e}/`,``)}))).flat();return t.info(o.green(`Found: ${a.length} packages and ${a.map(({softwareDevelopmentKits:e=[]})=>e).flat().length} sdks`)),a.map(e=>({...e,type:i,repositoryName:r}))}catch(e){throw Error(`Error scanning globs ${c} with error: ${e}`)}}))).flat()}const d=`A repository name must be provided. You can specify using --repositoryName=$REPO_NAME or by ensuring the command "git config --get remote.origin.url" returns the name of the repository`;async function f({auth:i,scanPath:a,ignoreDirs:l,repositoryName:f,transcendUrl:p}){r(this.process.exit);let m=f;if(!m)try{let e=c(`cd ${a} && git config --get remote.origin.url`).toString(`utf-8`).trim();[m]=e.includes(`https:`)?e.split(`/`).slice(3).join(`/`).split(`.`):(e.split(`:`).pop()||``).split(`.`),m||(t.error(o.red(d)),this.process.exit(1))}catch(e){t.error(o.red(`${d} - Got error: ${e.message}`)),this.process.exit(1)}let h=s(p,i),g=await u({scanPath:a,ignoreDirs:l,repositoryName:m});await n(h,g);let _=new URL(e);_.pathname=`/code-scanning/code-packages`,t.info(o.green(`Scan found ${g.length} packages at ${a}! View results at '${_.href}'`))}export{f as scanPackages};
|
|
2
|
-
//# sourceMappingURL=impl-DgUf3gA3.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-Dt0HArIu.mjs","names":[],"sources":["../src/commands/request/preflight/push-identifiers/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { pushManualEnrichmentIdentifiersFromCsv } from '../../../../lib/manual-enrichment/index.js';\n\nexport interface PushIdentifiersCommandFlags {\n auth: string;\n enricherId: string;\n sombraAuth?: string;\n transcendUrl: string;\n file: string;\n markSilent: boolean;\n concurrency: number;\n}\n\nexport async function pushIdentifiers(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n enricherId,\n concurrency,\n markSilent,\n sombraAuth,\n }: PushIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await pushManualEnrichmentIdentifiersFromCsv({\n file,\n transcendUrl,\n enricherId,\n concurrency,\n markSilent,\n auth,\n sombraAuth,\n });\n}\n"],"mappings":"8HAcA,eAAsB,EAEpB,CACE,OACA,eACA,OACA,aACA,cACA,aACA,cAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAuC,CAC3C,OACA,eACA,aACA,cACA,aACA,OACA,aACD,CAAC"}
|
package/dist/impl-DxkQuCp8.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./skipPreflightJobs-5PcntUk7.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";async function n({auth:n,transcendUrl:r,enricherIds:i}){t(this.process.exit),await e({transcendUrl:r,auth:n,enricherIds:i})}export{n as skipPreflightJobs};
|
|
2
|
-
//# sourceMappingURL=impl-DxkQuCp8.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-DxkQuCp8.mjs","names":["skipPreflightJobsHelper"],"sources":["../src/commands/request/skip-preflight-jobs/impl.ts"],"sourcesContent":["import type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { skipPreflightJobs as skipPreflightJobsHelper } from '../../../lib/requests/index.js';\n\nexport interface SkipPreflightJobsCommandFlags {\n auth: string;\n enricherIds: string[];\n transcendUrl: string;\n}\n\nexport async function skipPreflightJobs(\n this: LocalContext,\n { auth, transcendUrl, enricherIds }: SkipPreflightJobsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await skipPreflightJobsHelper({\n transcendUrl,\n auth,\n enricherIds,\n });\n}\n"],"mappings":"yGAUA,eAAsB,EAEpB,CAAE,OAAM,eAAc,eACP,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAMA,EAAwB,CAC5B,eACA,OACA,cACD,CAAC"}
|
package/dist/impl-JU14ujB0.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";import{n,t as r}from"./printResult-DdSpAx6T.mjs";import{t as i}from"./formatPolicyBundleVersionSummary-DvxPXykZ.mjs";import{n as a}from"./resolveBundleIdByName-C-M1UT8E.mjs";import{t as o}from"./resolvePolicyBundleVersion-HwUipJxP.mjs";import s from"colors";async function c({"bundle-name":c,version:l,auth:u,"transcend-url":d,"dry-run":f,json:p}){t(this.process.exit);let m=n(d,u),h=await a(m,c);if(!h)throw Error(`Policy bundle "${c}" was not found for this organization.`);let g=await o(m,h,{version:l});e.info(s.green(f?`Validating activation for version "${g.version}"...`:`Activating version "${g.version}"...`));let _=await m.post(`v1/policy-engine/policy-bundles/${h}/versions/${g.id}/activate`,{json:f?{dryRun:!0}:{}}).json();r(this.process.stdout,{json:p,data:_,renderTable:()=>[`bundleId ${_.bundle.id}`,`bundleName ${_.bundle.bundleName}`,i(_.version)].join(`
|
|
2
|
-
`)}),e.info(s.green(f?`Activation validation succeeded.`:`Policy bundle version activated.`))}export{c as activate};
|
|
3
|
-
//# sourceMappingURL=impl-JU14ujB0.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-JU14ujB0.mjs","names":[],"sources":["../src/commands/policy/activate/impl.ts"],"sourcesContent":["import 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 {\n buildPolicyEngineClient,\n formatPolicyBundleVersionSummary,\n printResult,\n resolveBundleIdByName,\n resolvePolicyBundleVersion,\n} from '../helpers/index.js';\nimport type { ActivatePolicyBundleVersionResponse } from '../types.js';\n\n/** CLI flags for `transcend policy activate`. */\nexport interface ActivateCommandFlags {\n /** Logical bundle name to activate */\n 'bundle-name': string;\n /** Caller-supplied version label to activate */\n version?: string;\n /** Transcend API key */\n auth: string;\n /** Transcend API URL */\n 'transcend-url': string;\n /** Validate activation without flipping */\n 'dry-run': boolean;\n /** Print raw JSON response */\n json: boolean;\n}\n\n/**\n * Activate an uploaded policy bundle version.\n *\n * Resolves `--bundle-name` to the parent bundle UUID internally, then calls the\n * Policy Engine activate endpoint. The bundle is addressed by name only -- the\n * UUID is never exposed to the operator.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function activate(\n this: LocalContext,\n {\n 'bundle-name': bundleName,\n version,\n auth,\n 'transcend-url': transcendUrl,\n 'dry-run': dryRun,\n json,\n }: ActivateCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const client = buildPolicyEngineClient(transcendUrl, auth);\n const resolvedBundleId = await resolveBundleIdByName(client, bundleName);\n if (!resolvedBundleId) {\n throw new Error(`Policy bundle \"${bundleName}\" was not found for this organization.`);\n }\n const resolvedVersion = await resolvePolicyBundleVersion(client, resolvedBundleId, { version });\n\n logger.info(\n colors.green(\n dryRun\n ? `Validating activation for version \"${resolvedVersion.version}\"...`\n : `Activating version \"${resolvedVersion.version}\"...`,\n ),\n );\n\n const body = await client\n .post(\n `v1/policy-engine/policy-bundles/${resolvedBundleId}/versions/${resolvedVersion.id}/activate`,\n {\n json: dryRun ? { dryRun: true } : {},\n },\n )\n .json<ActivatePolicyBundleVersionResponse>();\n\n printResult(this.process.stdout, {\n json,\n data: body,\n renderTable: () =>\n [\n `bundleId ${body.bundle.id}`,\n `bundleName ${body.bundle.bundleName}`,\n formatPolicyBundleVersionSummary(body.version),\n ].join('\\n'),\n });\n\n logger.info(\n colors.green(dryRun ? 'Activation validation succeeded.' : 'Policy bundle version activated.'),\n );\n}\n"],"mappings":"gWAwCA,eAAsB,EAEpB,CACE,cAAe,EACf,UACA,OACA,gBAAiB,EACjB,UAAW,EACX,QAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAS,EAAwB,EAAc,EAAK,CACpD,EAAmB,MAAM,EAAsB,EAAQ,EAAW,CACxE,GAAI,CAAC,EACH,MAAU,MAAM,kBAAkB,EAAW,wCAAwC,CAEvF,IAAM,EAAkB,MAAM,EAA2B,EAAQ,EAAkB,CAAE,UAAS,CAAC,CAE/F,EAAO,KACL,EAAO,MACL,EACI,sCAAsC,EAAgB,QAAQ,MAC9D,uBAAuB,EAAgB,QAAQ,MACpD,CACF,CAED,IAAM,EAAO,MAAM,EAChB,KACC,mCAAmC,EAAiB,YAAY,EAAgB,GAAG,WACnF,CACE,KAAM,EAAS,CAAE,OAAQ,GAAM,CAAG,EAAE,CACrC,CACF,CACA,MAA2C,CAE9C,EAAY,KAAK,QAAQ,OAAQ,CAC/B,OACA,KAAM,EACN,gBACE,CACE,eAAe,EAAK,OAAO,KAC3B,eAAe,EAAK,OAAO,aAC3B,EAAiC,EAAK,QAAQ,CAC/C,CAAC,KAAK;EAAK,CACf,CAAC,CAEF,EAAO,KACL,EAAO,MAAM,EAAS,mCAAqC,mCAAmC,CAC/F"}
|
package/dist/impl-Qkau85p_.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./constants-CgI8_Rfc.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./done-input-validation-CvwjeRWr.mjs";import{n as r}from"./constants-DXUo-hl3.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
|
-
|
|
3
|
-
NOTE: it may take 2-3 minutes for scan results to appear in the UI.`))}export{d as discoverSilos};
|
|
4
|
-
//# sourceMappingURL=impl-Qkau85p_.mjs.map
|
package/dist/impl-ouNg4TVN.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./done-input-validation-CvwjeRWr.mjs";import{n,t as r}from"./printResult-DdSpAx6T.mjs";import{t as i}from"./renderTable-BgjVr6ch.mjs";import{n as a}from"./resolveBundleIdByName-C-M1UT8E.mjs";import o from"colors";async function s({"bundle-name":s,auth:c,"transcend-url":l,limit:u,after:d,json:f}){t(this.process.exit);let p=n(l,c),m=await a(p,s);if(!m)throw Error(`Policy bundle "${s}" was not found for this organization.`);e.info(o.green(`Listing versions for bundle "${s}"...`));let h={limit:u};d&&(h.after=d);let g=await p.get(`v1/policy-engine/policy-bundles/${m}/versions`,{searchParams:h}).json();r(this.process.stdout,{json:f,data:g,renderTable:()=>{if(g.nodes.length===0)return`No versions found for bundle "${s}".`;let e=i([`id`,`version`,`createdAt`,`activatedAt`,`deactivatedAt`],g.nodes.map(e=>[e.id,e.version,e.createdAt,e.activatedAt??`-`,e.deactivatedAt??`-`]));return g.pageInfo.endCursor&&(e+=`\n\nafter: ${g.pageInfo.endCursor}`),e}})}export{s as versions};
|
|
2
|
-
//# sourceMappingURL=impl-ouNg4TVN.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impl-ouNg4TVN.mjs","names":[],"sources":["../src/commands/policy/versions/impl.ts"],"sourcesContent":["import 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 { EMPTY_CELL } from '../constants.js';\nimport {\n buildPolicyEngineClient,\n printResult,\n renderTable,\n resolveBundleIdByName,\n} from '../helpers/index.js';\nimport type { PolicyBundleVersionListResponse } from '../types.js';\n\n/** CLI flags for `transcend policy versions`. */\nexport interface VersionsCommandFlags {\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 /** Page size */\n limit: number;\n /** Cursor from a previous page's pageInfo.endCursor */\n after?: string;\n /** Print raw JSON response */\n json: boolean;\n}\n\n/**\n * List versions for a policy bundle.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function versions(\n this: LocalContext,\n {\n 'bundle-name': bundleName,\n auth,\n 'transcend-url': transcendUrl,\n limit,\n after,\n json,\n }: VersionsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const client = buildPolicyEngineClient(transcendUrl, auth);\n const bundleId = await resolveBundleIdByName(client, bundleName);\n\n if (!bundleId) {\n throw new Error(`Policy bundle \"${bundleName}\" was not found for this organization.`);\n }\n\n logger.info(colors.green(`Listing versions for bundle \"${bundleName}\"...`));\n\n const searchParams: Record<string, string | number> = { limit };\n if (after) {\n searchParams.after = after;\n }\n\n const body = await client\n .get(`v1/policy-engine/policy-bundles/${bundleId}/versions`, {\n searchParams,\n })\n .json<PolicyBundleVersionListResponse>();\n\n printResult(this.process.stdout, {\n json,\n data: body,\n renderTable: () => {\n if (body.nodes.length === 0) {\n return `No versions found for bundle \"${bundleName}\".`;\n }\n\n const rows = body.nodes.map((version) => [\n version.id,\n version.version,\n version.createdAt,\n version.activatedAt ?? EMPTY_CELL,\n version.deactivatedAt ?? EMPTY_CELL,\n ]);\n\n let table = renderTable(['id', 'version', 'createdAt', 'activatedAt', 'deactivatedAt'], rows);\n if (body.pageInfo.endCursor) {\n table += `\\n\\nafter: ${body.pageInfo.endCursor}`;\n }\n return table;\n },\n });\n}\n"],"mappings":"6QAoCA,eAAsB,EAEpB,CACE,cAAe,EACf,OACA,gBAAiB,EACjB,QACA,QACA,QAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,IAAM,EAAS,EAAwB,EAAc,EAAK,CACpD,EAAW,MAAM,EAAsB,EAAQ,EAAW,CAEhE,GAAI,CAAC,EACH,MAAU,MAAM,kBAAkB,EAAW,wCAAwC,CAGvF,EAAO,KAAK,EAAO,MAAM,gCAAgC,EAAW,MAAM,CAAC,CAE3E,IAAM,EAAgD,CAAE,QAAO,CAC3D,IACF,EAAa,MAAQ,GAGvB,IAAM,EAAO,MAAM,EAChB,IAAI,mCAAmC,EAAS,WAAY,CAC3D,eACD,CAAC,CACD,MAAuC,CAE1C,EAAY,KAAK,QAAQ,OAAQ,CAC/B,OACA,KAAM,EACN,gBAAmB,CACjB,GAAI,EAAK,MAAM,SAAW,EACxB,MAAO,iCAAiC,EAAW,IAWrD,IAAI,EAAQ,EAAY,CAAC,KAAM,UAAW,YAAa,cAAe,gBAAgB,CARzE,EAAK,MAAM,IAAK,GAAY,CACvC,EAAQ,GACR,EAAQ,QACR,EAAQ,UACR,EAAQ,aAAA,IACR,EAAQ,eAAA,IACT,CAE2F,CAAC,CAI7F,OAHI,EAAK,SAAS,YAChB,GAAS,cAAc,EAAK,SAAS,aAEhC,GAEV,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"got";function t(t,n){return e.extend({prefixUrl:t.replace(/\/$/,``),headers:{Authorization:`Bearer ${n}`,accept:`application/json`}})}function n(e,t){if(t.json){e.write(`${JSON.stringify(t.data,null,2)}\n`);return}t.renderTable&&e.write(`${t.renderTable()}\n`)}export{t as n,n as t};
|
|
2
|
-
//# sourceMappingURL=printResult-DdSpAx6T.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printResult-DdSpAx6T.mjs","names":[],"sources":["../src/commands/policy/helpers/buildPolicyEngineClient.ts","../src/commands/policy/helpers/printResult.ts"],"sourcesContent":["import got, { type Got } from 'got';\n\n/**\n * Creates a got client for Policy Engine REST endpoints on the monolith.\n *\n * @param transcendUrl - Transcend API base URL\n * @param auth - Transcend API key\n * @returns Configured got instance\n */\nexport function buildPolicyEngineClient(transcendUrl: string, auth: string): Got {\n return got.extend({\n prefixUrl: transcendUrl.replace(/\\/$/, ''),\n headers: {\n Authorization: `Bearer ${auth}`,\n accept: 'application/json',\n },\n });\n}\n","/** Options for printing CLI command output. */\nexport interface PrintResultOptions {\n /** When true, print raw JSON */\n json: boolean;\n /** JSON-serializable payload */\n data: unknown;\n /** Table renderer used when json is false */\n renderTable?: () => string;\n}\n\n/**\n * Prints JSON or a human-readable table to stdout.\n *\n * @param stdout - Process stdout stream\n * @param options - Output options\n */\nexport function printResult(stdout: NodeJS.WriteStream, options: PrintResultOptions): void {\n if (options.json) {\n stdout.write(`${JSON.stringify(options.data, null, 2)}\\n`);\n return;\n }\n\n if (options.renderTable) {\n stdout.write(`${options.renderTable()}\\n`);\n }\n}\n"],"mappings":"mBASA,SAAgB,EAAwB,EAAsB,EAAmB,CAC/E,OAAO,EAAI,OAAO,CAChB,UAAW,EAAa,QAAQ,MAAO,GAAG,CAC1C,QAAS,CACP,cAAe,UAAU,IACzB,OAAQ,mBACT,CACF,CAAC,CCAJ,SAAgB,EAAY,EAA4B,EAAmC,CACzF,GAAI,EAAQ,KAAM,CAChB,EAAO,MAAM,GAAG,KAAK,UAAU,EAAQ,KAAM,KAAM,EAAE,CAAC,IAAI,CAC1D,OAGE,EAAQ,aACV,EAAO,MAAM,GAAG,EAAQ,aAAa,CAAC,IAAI"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
async function e(e,t){let n=0;for(;;){let r=await e.get(`v1/policy-engine/policy-bundles`,{searchParams:{limit:100,offset:n}}).json(),i=r.nodes.find(e=>e.bundleName===t);if(i)return i;if(n+=r.nodes.length,n>=r.totalCount||r.nodes.length===0)return}}async function t(t,n){return(await e(t,n))?.id}export{t as n,e as t};
|
|
2
|
-
//# sourceMappingURL=resolveBundleIdByName-C-M1UT8E.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveBundleIdByName-C-M1UT8E.mjs","names":[],"sources":["../src/commands/policy/helpers/resolveBundleIdByName.ts"],"sourcesContent":["import type { Got } from 'got';\n\nimport type { PolicyBundle, PolicyBundleListResponse } from '../types.js';\n\n/**\n * Resolves a bundle name to its parent record by scanning offset-paginated listings.\n *\n * @param client - Policy Engine REST client\n * @param bundleName - Bundle name to resolve\n * @returns Matching bundle when found\n */\nexport async function resolveBundleByName(\n client: Got,\n bundleName: string,\n): Promise<PolicyBundle | undefined> {\n const limit = 100;\n let offset = 0;\n\n while (true) {\n const body = await client\n .get('v1/policy-engine/policy-bundles', {\n searchParams: { limit, offset },\n })\n .json<PolicyBundleListResponse>();\n\n const match = body.nodes.find((bundle) => bundle.bundleName === bundleName);\n if (match) {\n return match;\n }\n\n offset += body.nodes.length;\n if (offset >= body.totalCount || body.nodes.length === 0) {\n return undefined;\n }\n }\n}\n\n/**\n * Resolves a bundle name to its UUID by scanning offset-paginated bundle listings.\n *\n * @param client - Policy Engine REST client\n * @param bundleName - Bundle name to resolve\n * @returns Bundle UUID when found\n */\nexport async function resolveBundleIdByName(\n client: Got,\n bundleName: string,\n): Promise<string | undefined> {\n const bundle = await resolveBundleByName(client, bundleName);\n return bundle?.id;\n}\n"],"mappings":"AAWA,eAAsB,EACpB,EACA,EACmC,CACnC,IACI,EAAS,EAEb,OAAa,CACX,IAAM,EAAO,MAAM,EAChB,IAAI,kCAAmC,CACtC,aAAc,CAAE,UAAO,SAAQ,CAChC,CAAC,CACD,MAAgC,CAE7B,EAAQ,EAAK,MAAM,KAAM,GAAW,EAAO,aAAe,EAAW,CAC3E,GAAI,EACF,OAAO,EAIT,GADA,GAAU,EAAK,MAAM,OACjB,GAAU,EAAK,YAAc,EAAK,MAAM,SAAW,EACrD,QAYN,eAAsB,EACpB,EACA,EAC6B,CAE7B,OAAO,MADc,EAAoB,EAAQ,EAAW,GAC7C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
async function e(e,t){let n=[],r;for(;;){let i={limit:100};r&&(i.after=r);let a=await e.get(`v1/policy-engine/policy-bundles/${t}/versions`,{searchParams:i}).json();if(n.push(...a.nodes),!a.pageInfo.hasNextPage||!a.pageInfo.endCursor)break;r=a.pageInfo.endCursor}return n}function t(e,t){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}async function n(n,r,i){let a=await e(n,r);if(a.length===0)throw Error(`No versions found for this policy bundle.`);if(i.version){let e=a.find(e=>e.version===i.version);if(!e)throw Error(`Version "${i.version}" was not found for this policy bundle.`);return e}return a.sort(t)[0]}export{n as t};
|
|
2
|
-
//# sourceMappingURL=resolvePolicyBundleVersion-HwUipJxP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvePolicyBundleVersion-HwUipJxP.mjs","names":[],"sources":["../src/commands/policy/helpers/resolvePolicyBundleVersion.ts"],"sourcesContent":["import type { Got } from 'got';\n\nimport type { PolicyBundleVersion, PolicyBundleVersionListResponse } from '../types.js';\n\n/** Options for resolving a policy bundle version. */\nexport interface ResolvePolicyBundleVersionOptions {\n /** Caller-supplied version label; omitted to pick the latest by createdAt */\n version?: string;\n}\n\n/**\n * Lists all versions for a bundle, following cursor pagination.\n *\n * @param client - Policy Engine REST client\n * @param bundleId - Parent bundle UUID\n * @returns All uploaded versions\n */\nasync function listAllPolicyBundleVersions(\n client: Got,\n bundleId: string,\n): Promise<PolicyBundleVersion[]> {\n const limit = 100;\n const versions: PolicyBundleVersion[] = [];\n let after: string | undefined;\n\n while (true) {\n const searchParams: Record<string, string | number> = { limit };\n if (after) {\n searchParams.after = after;\n }\n\n const body = await client\n .get(`v1/policy-engine/policy-bundles/${bundleId}/versions`, {\n searchParams,\n })\n .json<PolicyBundleVersionListResponse>();\n\n versions.push(...body.nodes);\n\n if (!body.pageInfo.hasNextPage || !body.pageInfo.endCursor) {\n break;\n }\n after = body.pageInfo.endCursor;\n }\n\n return versions;\n}\n\n/**\n * Compares two version records by createdAt, newest first.\n *\n * @param left - First version\n * @param right - Second version\n * @returns Sort order for descending createdAt\n */\nfunction compareVersionsByCreatedAtDesc(\n left: PolicyBundleVersion,\n right: PolicyBundleVersion,\n): number {\n return new Date(right.createdAt).getTime() - new Date(left.createdAt).getTime();\n}\n\n/**\n * Resolves a version label to a version record, or picks the latest by createdAt.\n *\n * @param client - Policy Engine REST client\n * @param bundleId - Parent bundle UUID\n * @param options - Version lookup options\n * @returns Matching or latest version record\n */\nexport async function resolvePolicyBundleVersion(\n client: Got,\n bundleId: string,\n options: ResolvePolicyBundleVersionOptions,\n): Promise<PolicyBundleVersion> {\n const versions = await listAllPolicyBundleVersions(client, bundleId);\n\n if (versions.length === 0) {\n throw new Error('No versions found for this policy bundle.');\n }\n\n if (options.version) {\n const match = versions.find((entry) => entry.version === options.version);\n if (!match) {\n throw new Error(`Version \"${options.version}\" was not found for this policy bundle.`);\n }\n return match;\n }\n\n return versions.sort(compareVersionsByCreatedAtDesc)[0];\n}\n"],"mappings":"AAiBA,eAAe,EACb,EACA,EACgC,CAChC,IACM,EAAkC,EAAE,CACtC,EAEJ,OAAa,CACX,IAAM,EAAgD,CAAE,UAAO,CAC3D,IACF,EAAa,MAAQ,GAGvB,IAAM,EAAO,MAAM,EAChB,IAAI,mCAAmC,EAAS,WAAY,CAC3D,eACD,CAAC,CACD,MAAuC,CAI1C,GAFA,EAAS,KAAK,GAAG,EAAK,MAAM,CAExB,CAAC,EAAK,SAAS,aAAe,CAAC,EAAK,SAAS,UAC/C,MAEF,EAAQ,EAAK,SAAS,UAGxB,OAAO,EAUT,SAAS,EACP,EACA,EACQ,CACR,OAAO,IAAI,KAAK,EAAM,UAAU,CAAC,SAAS,CAAG,IAAI,KAAK,EAAK,UAAU,CAAC,SAAS,CAWjF,eAAsB,EACpB,EACA,EACA,EAC8B,CAC9B,IAAM,EAAW,MAAM,EAA4B,EAAQ,EAAS,CAEpE,GAAI,EAAS,SAAW,EACtB,MAAU,MAAM,4CAA4C,CAG9D,GAAI,EAAQ,QAAS,CACnB,IAAM,EAAQ,EAAS,KAAM,GAAU,EAAM,UAAY,EAAQ,QAAQ,CACzE,GAAI,CAAC,EACH,MAAU,MAAM,YAAY,EAAQ,QAAQ,yCAAyC,CAEvF,OAAO,EAGT,OAAO,EAAS,KAAK,EAA+B,CAAC"}
|