@transcend-io/cli 10.11.0 → 10.12.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 +38 -2
- package/dist/{app-SZjGrYwT.mjs → app-ByQFC_j5.mjs} +20 -20
- package/dist/app-ByQFC_j5.mjs.map +1 -0
- package/dist/{approvePrivacyRequests-BQBKfJjz.mjs → approvePrivacyRequests-u2nuk8iv.mjs} +2 -2
- package/dist/{approvePrivacyRequests-BQBKfJjz.mjs.map → approvePrivacyRequests-u2nuk8iv.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/{buildXdiSyncEndpoint-CyXZIwZY.mjs → buildXdiSyncEndpoint-BQ6myHGp.mjs} +2 -2
- package/dist/{buildXdiSyncEndpoint-CyXZIwZY.mjs.map → buildXdiSyncEndpoint-BQ6myHGp.mjs.map} +1 -1
- package/dist/{bulkRestartRequests-DhJ-tAul.mjs → bulkRestartRequests-B1IoY8us.mjs} +2 -2
- package/dist/{bulkRestartRequests-DhJ-tAul.mjs.map → bulkRestartRequests-B1IoY8us.mjs.map} +1 -1
- package/dist/{bulkRetryEnrichers-CINDJT29.mjs → bulkRetryEnrichers-BfJUQnyj.mjs} +2 -2
- package/dist/{bulkRetryEnrichers-CINDJT29.mjs.map → bulkRetryEnrichers-BfJUQnyj.mjs.map} +1 -1
- package/dist/{cancelPrivacyRequests-h0Jjzwz1.mjs → cancelPrivacyRequests-Bavzb0X7.mjs} +2 -2
- package/dist/{cancelPrivacyRequests-h0Jjzwz1.mjs.map → cancelPrivacyRequests-Bavzb0X7.mjs.map} +1 -1
- package/dist/{collectCsvFilesOrExit-ChKkrsVz.mjs → collectCsvFilesOrExit-BQdnr-m2.mjs} +1 -1
- package/dist/{collectCsvFilesOrExit-ChKkrsVz.mjs.map → collectCsvFilesOrExit-BQdnr-m2.mjs.map} +1 -1
- package/dist/{collectParquetFilesOrExit-4EqbLDaB.mjs → collectParquetFilesOrExit-BJ-GciNy.mjs} +1 -1
- package/dist/{collectParquetFilesOrExit-4EqbLDaB.mjs.map → collectParquetFilesOrExit-BJ-GciNy.mjs.map} +1 -1
- package/dist/{command-Bwz-_CRM.mjs → command-Ccgq_M8g.mjs} +2 -2
- package/dist/{command-Bwz-_CRM.mjs.map → command-Ccgq_M8g.mjs.map} +1 -1
- package/dist/commands/admin/parquet-to-csv/worker.mjs +1 -1
- package/dist/{consentManagersToBusinessEntities-C95GQMxK.mjs → consentManagersToBusinessEntities-l8jRfpYN.mjs} +1 -1
- package/dist/{consentManagersToBusinessEntities-C95GQMxK.mjs.map → consentManagersToBusinessEntities-l8jRfpYN.mjs.map} +1 -1
- package/dist/constants-BhZIv-FP.mjs +2 -0
- package/dist/constants-BhZIv-FP.mjs.map +1 -0
- package/dist/{constants-xRJ7Twuw.mjs → constants-DXUo-hl3.mjs} +2 -2
- package/dist/{constants-xRJ7Twuw.mjs.map → constants-DXUo-hl3.mjs.map} +1 -1
- package/dist/{constants-DrkNQLIO.mjs → constants-W0InNUWp.mjs} +2 -2
- package/dist/{constants-DrkNQLIO.mjs.map → constants-W0InNUWp.mjs.map} +1 -1
- package/dist/{createExtraKeyHandler-WI5OVh5Q.mjs → createExtraKeyHandler-DOEdOZW7.mjs} +2 -2
- package/dist/{createExtraKeyHandler-WI5OVh5Q.mjs.map → createExtraKeyHandler-DOEdOZW7.mjs.map} +1 -1
- package/dist/{dataFlowsToDataSilos-Cj60GwT2.mjs → dataFlowsToDataSilos-Blo6-adp.mjs} +1 -1
- package/dist/{dataFlowsToDataSilos-Cj60GwT2.mjs.map → dataFlowsToDataSilos-Blo6-adp.mjs.map} +1 -1
- package/dist/{done-input-validation-9r-9VL6r.mjs → done-input-validation-CvwjeRWr.mjs} +1 -1
- package/dist/{done-input-validation-9r-9VL6r.mjs.map → done-input-validation-CvwjeRWr.mjs.map} +1 -1
- package/dist/{downloadPrivacyRequestFiles-DqiA-mse.mjs → downloadPrivacyRequestFiles-BWntL3Ln.mjs} +2 -2
- package/dist/{downloadPrivacyRequestFiles-DqiA-mse.mjs.map → downloadPrivacyRequestFiles-BWntL3Ln.mjs.map} +1 -1
- package/dist/{extractClientError-ZFI8f5OR.mjs → extractClientError-CaF_Kj-f.mjs} +1 -1
- package/dist/{extractClientError-ZFI8f5OR.mjs.map → extractClientError-CaF_Kj-f.mjs.map} +1 -1
- package/dist/{fetchAllRequests-B2qEAfDh.mjs → fetchAllRequests-BCHpCeFo.mjs} +2 -2
- package/dist/{fetchAllRequests-B2qEAfDh.mjs.map → fetchAllRequests-BCHpCeFo.mjs.map} +1 -1
- package/dist/formatPolicyBundleVersionSummary-DvxPXykZ.mjs +3 -0
- package/dist/formatPolicyBundleVersionSummary-DvxPXykZ.mjs.map +1 -0
- package/dist/fuzzyMatchColumns-Dym9eeQe.mjs +2 -0
- package/dist/fuzzyMatchColumns-Dym9eeQe.mjs.map +1 -0
- package/dist/{generateCrossAccountApiKeys-CpaKhWfU.mjs → generateCrossAccountApiKeys-CEuLd4kn.mjs} +2 -2
- package/dist/{generateCrossAccountApiKeys-CpaKhWfU.mjs.map → generateCrossAccountApiKeys-CEuLd4kn.mjs.map} +1 -1
- package/dist/{impl-D5uV31yx.mjs → impl-02ZZootp.mjs} +2 -2
- package/dist/{impl-D5uV31yx.mjs.map → impl-02ZZootp.mjs.map} +1 -1
- package/dist/{impl-D1vQsy5J.mjs → impl-3At22Cgr.mjs} +2 -2
- package/dist/{impl-D1vQsy5J.mjs.map → impl-3At22Cgr.mjs.map} +1 -1
- package/dist/{impl-saIKgNF6.mjs → impl-4RNw7C1h.mjs} +2 -2
- package/dist/{impl-saIKgNF6.mjs.map → impl-4RNw7C1h.mjs.map} +1 -1
- package/dist/impl-AmFTxFav.mjs +2 -0
- package/dist/impl-AmFTxFav.mjs.map +1 -0
- package/dist/{impl-DGEhn7xe.mjs → impl-B62KOx7V.mjs} +2 -2
- package/dist/{impl-DGEhn7xe.mjs.map → impl-B62KOx7V.mjs.map} +1 -1
- package/dist/{impl-BhFQcH3n.mjs → impl-BMU2cg0K.mjs} +2 -2
- package/dist/{impl-BhFQcH3n.mjs.map → impl-BMU2cg0K.mjs.map} +1 -1
- package/dist/impl-BRxpULGs.mjs +2 -0
- package/dist/{impl-Bjgy30tR.mjs.map → impl-BRxpULGs.mjs.map} +1 -1
- package/dist/{impl-mDlXBAeB.mjs → impl-BUa-GIco2.mjs} +2 -2
- package/dist/impl-BUa-GIco2.mjs.map +1 -0
- package/dist/{impl-BAehUgNy.mjs → impl-BdT4BEy82.mjs} +2 -2
- package/dist/impl-BdT4BEy82.mjs.map +1 -0
- package/dist/{impl-x41b0Zix.mjs → impl-BiVj3J5Z.mjs} +2 -2
- package/dist/{impl-x41b0Zix.mjs.map → impl-BiVj3J5Z.mjs.map} +1 -1
- package/dist/impl-BjZRHvg4.mjs +3 -0
- package/dist/impl-BjZRHvg4.mjs.map +1 -0
- package/dist/{impl-CVoLLxEQ.mjs → impl-Bq3ZIpcG.mjs} +2 -2
- package/dist/{impl-CVoLLxEQ.mjs.map → impl-Bq3ZIpcG.mjs.map} +1 -1
- package/dist/{impl-DfUg1xpp.mjs → impl-BviUuJ64.mjs} +2 -2
- package/dist/{impl-DfUg1xpp.mjs.map → impl-BviUuJ64.mjs.map} +1 -1
- package/dist/{impl-CelvG8_p.mjs → impl-Bvs9jO1A.mjs} +2 -2
- package/dist/{impl-CelvG8_p.mjs.map → impl-Bvs9jO1A.mjs.map} +1 -1
- package/dist/{impl-BAD_b0xz.mjs → impl-ByUAqFSu2.mjs} +2 -2
- package/dist/impl-ByUAqFSu2.mjs.map +1 -0
- package/dist/{impl-B-vUfLBu2.mjs → impl-C-dO4Fdx2.mjs} +2 -2
- package/dist/{impl-B-vUfLBu2.mjs.map → impl-C-dO4Fdx2.mjs.map} +1 -1
- package/dist/{impl-BPspZqwr.mjs → impl-C0bbPFc3.mjs} +2 -2
- package/dist/{impl-BPspZqwr.mjs.map → impl-C0bbPFc3.mjs.map} +1 -1
- package/dist/{impl-B5bE0lSK.mjs → impl-C4MBoRRx.mjs} +2 -2
- package/dist/{impl-B5bE0lSK.mjs.map → impl-C4MBoRRx.mjs.map} +1 -1
- package/dist/{impl-DxEAabYI.mjs → impl-C4fhTDuz.mjs} +2 -2
- package/dist/{impl-DxEAabYI.mjs.map → impl-C4fhTDuz.mjs.map} +1 -1
- package/dist/{impl-CYAYg5CX2.mjs → impl-C8f60bq3.mjs} +2 -2
- package/dist/impl-C8f60bq3.mjs.map +1 -0
- package/dist/{impl-H0dOy3D9.mjs → impl-CC7GdMv8.mjs} +2 -2
- package/dist/{impl-H0dOy3D9.mjs.map → impl-CC7GdMv8.mjs.map} +1 -1
- package/dist/{impl-BhnRLkLg.mjs → impl-CExtJer0.mjs} +2 -2
- package/dist/{impl-BhnRLkLg.mjs.map → impl-CExtJer0.mjs.map} +1 -1
- package/dist/{impl-n3VF1th4.mjs → impl-CJ59X6Z3.mjs} +2 -2
- package/dist/{impl-n3VF1th4.mjs.map → impl-CJ59X6Z3.mjs.map} +1 -1
- package/dist/impl-COpeNq1x.mjs +2 -0
- package/dist/{impl-PGlAUyrI.mjs.map → impl-COpeNq1x.mjs.map} +1 -1
- package/dist/{impl-E_iiNVwN.mjs → impl-CZR5l7cx.mjs} +2 -2
- package/dist/{impl-E_iiNVwN.mjs.map → impl-CZR5l7cx.mjs.map} +1 -1
- package/dist/{impl-B9W5P4LM.mjs → impl-CqAhgJRN.mjs} +2 -2
- package/dist/{impl-B9W5P4LM.mjs.map → impl-CqAhgJRN.mjs.map} +1 -1
- package/dist/{impl-CUyHx1rE2.mjs → impl-Cssw5MRG2.mjs} +2 -2
- package/dist/{impl-CUyHx1rE2.mjs.map → impl-Cssw5MRG2.mjs.map} +1 -1
- package/dist/impl-CxoNjjcc.mjs +2 -0
- package/dist/impl-CxoNjjcc.mjs.map +1 -0
- package/dist/{impl-u8cmT1tT.mjs → impl-D3gYUf5v.mjs} +2 -2
- package/dist/{impl-u8cmT1tT.mjs.map → impl-D3gYUf5v.mjs.map} +1 -1
- package/dist/{impl-BaDggdDO.mjs → impl-D4V-YlVF.mjs} +2 -2
- package/dist/{impl-BaDggdDO.mjs.map → impl-D4V-YlVF.mjs.map} +1 -1
- package/dist/{impl-DEDU3xQB.mjs → impl-DCXqRGGc.mjs} +2 -2
- package/dist/{impl-DEDU3xQB.mjs.map → impl-DCXqRGGc.mjs.map} +1 -1
- package/dist/{impl-P7bPD8V0.mjs → impl-DFNYHuwJ.mjs} +2 -2
- package/dist/{impl-P7bPD8V0.mjs.map → impl-DFNYHuwJ.mjs.map} +1 -1
- package/dist/{impl-CVqQYu7W.mjs → impl-DNb4z05j2.mjs} +2 -2
- package/dist/impl-DNb4z05j2.mjs.map +1 -0
- package/dist/{impl-D6J2bsoN.mjs → impl-DQGV2G5v.mjs} +2 -2
- package/dist/{impl-D6J2bsoN.mjs.map → impl-DQGV2G5v.mjs.map} +1 -1
- package/dist/impl-DRUQDDka.mjs +3 -0
- package/dist/{impl-VaOJJuto.mjs.map → impl-DRUQDDka.mjs.map} +1 -1
- package/dist/{impl-CcitjJS-.mjs → impl-De5np7Sk.mjs} +2 -2
- package/dist/{impl-CcitjJS-.mjs.map → impl-De5np7Sk.mjs.map} +1 -1
- package/dist/{impl-BjG5fxYp.mjs → impl-DgWm5-be.mjs} +2 -2
- package/dist/{impl-BjG5fxYp.mjs.map → impl-DgWm5-be.mjs.map} +1 -1
- package/dist/{impl-_X1a20u1.mjs → impl-Di-QSIIw.mjs} +2 -2
- package/dist/{impl-_X1a20u1.mjs.map → impl-Di-QSIIw.mjs.map} +1 -1
- package/dist/{impl-Gb7HxrtC2.mjs → impl-DnMCRNa72.mjs} +2 -2
- package/dist/{impl-Gb7HxrtC2.mjs.map → impl-DnMCRNa72.mjs.map} +1 -1
- package/dist/{impl-CBPe28r4.mjs → impl-Do_uwMZ22.mjs} +2 -2
- package/dist/impl-Do_uwMZ22.mjs.map +1 -0
- package/dist/impl-Dt7ED3wN.mjs +2 -0
- package/dist/{impl-DdoOAvjJ.mjs.map → impl-Dt7ED3wN.mjs.map} +1 -1
- package/dist/impl-F2eTk1wl.mjs +2 -0
- package/dist/impl-F2eTk1wl.mjs.map +1 -0
- package/dist/{impl-CReDJGod.mjs → impl-JyrJHlgj.mjs} +2 -2
- package/dist/{impl-CReDJGod.mjs.map → impl-JyrJHlgj.mjs.map} +1 -1
- package/dist/{impl-Bhvaczzz.mjs → impl-K8IkM1wk.mjs} +2 -2
- package/dist/{impl-Bhvaczzz.mjs.map → impl-K8IkM1wk.mjs.map} +1 -1
- package/dist/{impl-bz9v5xdV.mjs → impl-KSDaRRXr.mjs} +2 -2
- package/dist/{impl-bz9v5xdV.mjs.map → impl-KSDaRRXr.mjs.map} +1 -1
- package/dist/{impl-cr6noMmG.mjs → impl-MJ89a6cJ.mjs} +2 -2
- package/dist/{impl-cr6noMmG.mjs.map → impl-MJ89a6cJ.mjs.map} +1 -1
- package/dist/{impl-C0LTzcKG.mjs → impl-MOC3jU7F.mjs} +2 -2
- package/dist/{impl-C0LTzcKG.mjs.map → impl-MOC3jU7F.mjs.map} +1 -1
- package/dist/impl-SQvRYQWv.mjs +2 -0
- package/dist/{impl-DeE60yI-.mjs.map → impl-SQvRYQWv.mjs.map} +1 -1
- package/dist/{impl-CZXftWOO.mjs → impl-X-lj6p6X.mjs} +2 -2
- package/dist/{impl-CZXftWOO.mjs.map → impl-X-lj6p6X.mjs.map} +1 -1
- package/dist/impl-dliGC_hd.mjs +2 -0
- package/dist/impl-dliGC_hd.mjs.map +1 -0
- package/dist/{impl-BOGIveaY2.mjs → impl-ffW0OqMw.mjs} +2 -2
- package/dist/impl-ffW0OqMw.mjs.map +1 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/inquirer-CXl1YWCs.mjs +2 -0
- package/dist/{inquirer-C-TI9k_N.mjs.map → inquirer-CXl1YWCs.mjs.map} +1 -1
- package/dist/{listFiles-oqwR2oZ4.mjs → listFiles-B1GqyM33.mjs} +1 -1
- package/dist/{listFiles-oqwR2oZ4.mjs.map → listFiles-B1GqyM33.mjs.map} +1 -1
- package/dist/{markRequestDataSiloIdsCompleted-CY2wuSvF.mjs → markRequestDataSiloIdsCompleted-BN17wdkl.mjs} +2 -2
- package/dist/{markRequestDataSiloIdsCompleted-CY2wuSvF.mjs.map → markRequestDataSiloIdsCompleted-BN17wdkl.mjs.map} +1 -1
- package/dist/{markSilentPrivacyRequests-DSeSY-Ii.mjs → markSilentPrivacyRequests-CV35P6oq.mjs} +2 -2
- package/dist/{markSilentPrivacyRequests-DSeSY-Ii.mjs.map → markSilentPrivacyRequests-CV35P6oq.mjs.map} +1 -1
- package/dist/{notifyPrivacyRequestsAdditionalTime-CBxM2ycO.mjs → notifyPrivacyRequestsAdditionalTime-EfbFNbXf.mjs} +2 -2
- package/dist/{notifyPrivacyRequestsAdditionalTime-CBxM2ycO.mjs.map → notifyPrivacyRequestsAdditionalTime-EfbFNbXf.mjs.map} +1 -1
- package/dist/{parquetToCsvOneFile-Bry79xw-.mjs → parquetToCsvOneFile-DuyOOzqQ.mjs} +1 -1
- package/dist/{parquetToCsvOneFile-Bry79xw-.mjs.map → parquetToCsvOneFile-DuyOOzqQ.mjs.map} +1 -1
- package/dist/parseAttributesFromString-ByzY22WY.mjs +2 -0
- package/dist/parseAttributesFromString-ByzY22WY.mjs.map +1 -0
- package/dist/{printResult-DyCE6B_m.mjs → printResult-DdSpAx6T.mjs} +1 -1
- package/dist/{printResult-DyCE6B_m.mjs.map → printResult-DdSpAx6T.mjs.map} +1 -1
- package/dist/{pullAllDatapoints-49ZSGNFN.mjs → pullAllDatapoints-D8mTXHun.mjs} +1 -1
- package/dist/{pullAllDatapoints-49ZSGNFN.mjs.map → pullAllDatapoints-D8mTXHun.mjs.map} +1 -1
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-C5uhtMJZ.mjs → pullChunkedCustomSiloOutstandingIdentifiers-DMwrDs_z.mjs} +2 -2
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-C5uhtMJZ.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-DMwrDs_z.mjs.map} +1 -1
- package/dist/{pullConsentManagerMetrics-CcBfEEzz.mjs → pullConsentManagerMetrics-Cma2auCK.mjs} +1 -1
- package/dist/{pullConsentManagerMetrics-CcBfEEzz.mjs.map → pullConsentManagerMetrics-Cma2auCK.mjs.map} +1 -1
- package/dist/{pullManualEnrichmentIdentifiersToCsv-DAjzpJrD.mjs → pullManualEnrichmentIdentifiersToCsv-CFW476px.mjs} +2 -2
- package/dist/{pullManualEnrichmentIdentifiersToCsv-DAjzpJrD.mjs.map → pullManualEnrichmentIdentifiersToCsv-CFW476px.mjs.map} +1 -1
- package/dist/{pullTranscendConfiguration-ChFN8Wp4.mjs → pullTranscendConfiguration-nltf79oD.mjs} +1 -1
- package/dist/{pullTranscendConfiguration-ChFN8Wp4.mjs.map → pullTranscendConfiguration-nltf79oD.mjs.map} +1 -1
- package/dist/{pullUnstructuredSubDataPointRecommendations-C8VuWR7j.mjs → pullUnstructuredSubDataPointRecommendations-DkQMoo7S.mjs} +1 -1
- package/dist/{pullUnstructuredSubDataPointRecommendations-C8VuWR7j.mjs.map → pullUnstructuredSubDataPointRecommendations-DkQMoo7S.mjs.map} +1 -1
- package/dist/{pushCronIdentifiersFromCsv-5rPEhGSa.mjs → pushCronIdentifiersFromCsv-Cs1D_MBV.mjs} +2 -2
- package/dist/{pushCronIdentifiersFromCsv-5rPEhGSa.mjs.map → pushCronIdentifiersFromCsv-Cs1D_MBV.mjs.map} +1 -1
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-BWn9vFTr.mjs → pushManualEnrichmentIdentifiersFromCsv-CZHKG_VZ.mjs} +2 -2
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-BWn9vFTr.mjs.map → pushManualEnrichmentIdentifiersFromCsv-CZHKG_VZ.mjs.map} +1 -1
- package/dist/{readCsv-C-5HBa7w.mjs → readCsv-D1e7WRTc.mjs} +1 -1
- package/dist/{readCsv-C-5HBa7w.mjs.map → readCsv-D1e7WRTc.mjs.map} +1 -1
- package/dist/{removeUnverifiedRequestIdentifiers-q0ZyY9AM.mjs → removeUnverifiedRequestIdentifiers-DngnnV1k.mjs} +2 -2
- package/dist/{removeUnverifiedRequestIdentifiers-q0ZyY9AM.mjs.map → removeUnverifiedRequestIdentifiers-DngnnV1k.mjs.map} +1 -1
- package/dist/renderTable-BBSYeuZA.mjs +3 -0
- package/dist/renderTable-BBSYeuZA.mjs.map +1 -0
- package/dist/{request-CikRkOJR.mjs → request-C4gYxn1p.mjs} +1 -1
- package/dist/{request-CikRkOJR.mjs.map → request-C4gYxn1p.mjs.map} +1 -1
- package/dist/resolveBundleIdByName-yE0HYhLC.mjs +2 -0
- package/dist/resolveBundleIdByName-yE0HYhLC.mjs.map +1 -0
- package/dist/{retryRequestDataSilos-OfPZjwRt.mjs → retryRequestDataSilos-Bwj2UIUd.mjs} +2 -2
- package/dist/{retryRequestDataSilos-OfPZjwRt.mjs.map → retryRequestDataSilos-Bwj2UIUd.mjs.map} +1 -1
- package/dist/runOpa-BLjrKfy_.mjs +2 -0
- package/dist/runOpa-BLjrKfy_.mjs.map +1 -0
- package/dist/{skipPreflightJobs-_y0gfjsz.mjs → skipPreflightJobs-CANoUi80.mjs} +2 -2
- package/dist/{skipPreflightJobs-_y0gfjsz.mjs.map → skipPreflightJobs-CANoUi80.mjs.map} +1 -1
- package/dist/{skipRequestDataSilos-1DJUOU5A.mjs → skipRequestDataSilos-F2IIAHh_.mjs} +2 -2
- package/dist/{skipRequestDataSilos-1DJUOU5A.mjs.map → skipRequestDataSilos-F2IIAHh_.mjs.map} +1 -1
- package/dist/{streamPrivacyRequestsToCsv-DlQbNdTN.mjs → streamPrivacyRequestsToCsv-B3jmG1bZ.mjs} +2 -2
- package/dist/{streamPrivacyRequestsToCsv-DlQbNdTN.mjs.map → streamPrivacyRequestsToCsv-B3jmG1bZ.mjs.map} +1 -1
- package/dist/{syncCodePackages-Du1OqJvL.mjs → syncCodePackages-CwPtA473.mjs} +1 -1
- package/dist/{syncCodePackages-Du1OqJvL.mjs.map → syncCodePackages-CwPtA473.mjs.map} +1 -1
- package/dist/{updateConsentManagerVersionToLatest-D0-vKrkk.mjs → updateConsentManagerVersionToLatest-o9RhTc_M.mjs} +2 -2
- package/dist/{updateConsentManagerVersionToLatest-D0-vKrkk.mjs.map → updateConsentManagerVersionToLatest-o9RhTc_M.mjs.map} +1 -1
- package/dist/{uploadConsents-Rp0YJNA4.mjs → uploadConsents-LCte0KCM.mjs} +2 -2
- package/dist/{uploadConsents-Rp0YJNA4.mjs.map → uploadConsents-LCte0KCM.mjs.map} +1 -1
- package/dist/{uploadCookiesFromCsv-d-1JGI8B.mjs → uploadCookiesFromCsv-dPUGOCnk.mjs} +2 -2
- package/dist/{uploadCookiesFromCsv-d-1JGI8B.mjs.map → uploadCookiesFromCsv-dPUGOCnk.mjs.map} +1 -1
- package/dist/{uploadDataFlowsFromCsv-BJ4eSmI4.mjs → uploadDataFlowsFromCsv-KNs2fhJd.mjs} +2 -2
- package/dist/{uploadDataFlowsFromCsv-BJ4eSmI4.mjs.map → uploadDataFlowsFromCsv-KNs2fhJd.mjs.map} +1 -1
- package/dist/uploadPrivacyRequestsFromCsv-dgtJzNwi.mjs +2 -0
- package/dist/{uploadPrivacyRequestsFromCsv-Dz3Q-YJZ.mjs.map → uploadPrivacyRequestsFromCsv-dgtJzNwi.mjs.map} +1 -1
- package/dist/{validateTranscendAuth-RgQkJacW.mjs → validateTranscendAuth-CXcE-oTu.mjs} +1 -1
- package/dist/{validateTranscendAuth-RgQkJacW.mjs.map → validateTranscendAuth-CXcE-oTu.mjs.map} +1 -1
- package/dist/{writeCsv-CbT4a0uj.mjs → writeCsv-DDKM_rAU.mjs} +1 -1
- package/dist/{writeCsv-CbT4a0uj.mjs.map → writeCsv-DDKM_rAU.mjs.map} +1 -1
- package/package.json +3 -3
- package/dist/app-SZjGrYwT.mjs.map +0 -1
- package/dist/impl-B7XAhrKf.mjs +0 -3
- package/dist/impl-B7XAhrKf.mjs.map +0 -1
- package/dist/impl-BAD_b0xz.mjs.map +0 -1
- package/dist/impl-BAehUgNy.mjs.map +0 -1
- package/dist/impl-BOGIveaY2.mjs.map +0 -1
- package/dist/impl-Bjgy30tR.mjs +0 -2
- package/dist/impl-C7-YJhT-.mjs +0 -2
- package/dist/impl-C7-YJhT-.mjs.map +0 -1
- package/dist/impl-CBPe28r4.mjs.map +0 -1
- package/dist/impl-CVqQYu7W.mjs.map +0 -1
- package/dist/impl-CYAYg5CX2.mjs.map +0 -1
- package/dist/impl-DdoOAvjJ.mjs +0 -2
- package/dist/impl-DeE60yI-.mjs +0 -2
- package/dist/impl-DiKtPpJg2.mjs +0 -2
- package/dist/impl-DiKtPpJg2.mjs.map +0 -1
- package/dist/impl-PGlAUyrI.mjs +0 -2
- package/dist/impl-VaOJJuto.mjs +0 -3
- package/dist/impl-XmiHSCMj2.mjs +0 -2
- package/dist/impl-XmiHSCMj2.mjs.map +0 -1
- package/dist/impl-mDlXBAeB.mjs.map +0 -1
- package/dist/inquirer-C-TI9k_N.mjs +0 -2
- package/dist/parseAttributesFromString-tbxM3lmh.mjs +0 -2
- package/dist/parseAttributesFromString-tbxM3lmh.mjs.map +0 -1
- package/dist/resolveBundleIdByName-CwOnHS6D.mjs +0 -3
- package/dist/resolveBundleIdByName-CwOnHS6D.mjs.map +0 -1
- package/dist/runOpa-Cbh5ktOh.mjs +0 -2
- package/dist/runOpa-Cbh5ktOh.mjs.map +0 -1
- package/dist/uploadPrivacyRequestsFromCsv-Dz3Q-YJZ.mjs +0 -2
|
@@ -42,4 +42,4 @@ import{t as e}from"./logger-B-LXIf3U.mjs";import{SubDataPointDataSubCategoryGues
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
`,{variables:{first:m,offset:C,filterBy:{...v}},logger:e});S=t[t.length-1]?.id,h.push(...t),x=t.length===m,b+=t.length,C+=t.length,_.update(b)}catch(t){throw e.error(o.red(`An error fetching subdatapoints for cursor ${S} and offset ${C}`)),t}while(x);_.stop();let w=new Date().getTime()-g,T=i(h,`name`);return e.info(o.green(`Successfully pulled in ${T.length} subdatapoints in ${w/1e3} seconds!`)),T}async function h(t,{dataPointIds:r=[],pageSize:i=100}){let a=[],c=new Date().getTime(),l=new f.SingleBar({},f.Presets.shades_classic);e.info(o.magenta(`[Step 2/3] Fetching metadata for ${r.length} datapoints`));let p=n(r,i);l.start(r.length,0);let m=0;await d(p,async n=>{try{let{dataPoints:{nodes:r}}=await u(t,s,{variables:{first:i,filterBy:{ids:n}},logger:e});a.push(...r),m+=n.length,l.update(m)}catch(t){throw e.error(o.red(`An error fetching subdatapoints for IDs ${n.join(`, `)}`)),t}}),l.stop();let h=new Date().getTime()-c;return e.info(o.green(`Successfully pulled in ${a.length} dataPoints in ${h/1e3} seconds!`)),a}async function g(t,{dataSiloIds:r=[],pageSize:i=100}){let a=[],s=new Date().getTime(),l=new f.SingleBar({},f.Presets.shades_classic);e.info(o.magenta(`[Step 3/3] Fetching metadata for ${r.length} data silos`));let p=n(r,i);l.start(r.length,0);let m=0;await d(p,async n=>{try{let{dataSilos:{nodes:r}}=await u(t,c,{variables:{first:i,filterBy:{ids:n}},logger:e});a.push(...r),m+=n.length,l.update(m)}catch(t){throw e.error(o.red(`An error fetching data silos for IDs ${n.join(`, `)}`)),t}}),l.stop();let h=new Date().getTime()-s;return e.info(o.green(`Successfully pulled in ${a.length} data silos in ${h/1e3} seconds!`)),a}async function _(e,{dataSiloIds:t=[],includeGuessedCategories:n,includeAttributes:i,parentCategories:o=[],subCategories:s=[],pageSize:c=1e3}={}){let l=await m(e,{dataSiloIds:t,includeGuessedCategories:n,includeAttributes:i,parentCategories:o,subCategories:s,pageSize:c}),u=r(await h(e,{dataPointIds:a(l.map(e=>e.dataPointId))}),`id`),d=r(await g(e,{dataSiloIds:a(l.map(e=>e.dataSiloId))}),`id`);return l.map(e=>({...e,dataPoint:u[e.dataPointId],dataSilo:d[e.dataSiloId]}))}export{_ as t};
|
|
45
|
-
//# sourceMappingURL=pullAllDatapoints-
|
|
45
|
+
//# sourceMappingURL=pullAllDatapoints-D8mTXHun.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullAllDatapoints-49ZSGNFN.mjs","names":[],"sources":["../src/lib/data-inventory/pullAllDatapoints.ts"],"sourcesContent":["import {\n type DataCategoryType,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport {\n makeGraphQLRequest,\n DATAPOINT_EXPORT,\n DATA_SILO_EXPORT,\n SUB_DATA_POINTS_COUNT,\n type DataSiloAttributeValue,\n} from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql, type GraphQLClient } from 'graphql-request';\n/* eslint-disable max-lines */\nimport { keyBy, uniq, chunk, sortBy } from 'lodash-es';\n\nimport type { DataCategoryInput, ProcessingPurposeInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\n\nexport interface DataSiloCsvPreview {\n /** ID of dataSilo */\n id: string;\n /** Name of dataSilo */\n title: string;\n}\n\nexport interface DataPointCsvPreview {\n /** ID of dataPoint */\n id: string;\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n}\n\nexport interface SubDataPointCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** Data point ID */\n dataPointId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /** Attribute attached to subdatapoint */\n attributeValues?: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\nexport interface DatapointFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Whether to include guessed categories, defaults to only approved categories */\n includeGuessedCategories?: boolean;\n /** Whether or not to include attributes */\n includeAttributes?: boolean;\n /** Parent categories to filter down for */\n parentCategories?: DataCategoryType[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n}\n\n/**\n * Pull subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The subdatapoints\n */\nasync function pullSubDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<SubDataPointCsvPreview[]> {\n const subDataPoints: SubDataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n // Filters\n const filterBy = {\n ...(parentCategories.length > 0 ? { category: parentCategories } : {}),\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n // if parentCategories or subCategories and not includeGuessedCategories\n ...(parentCategories.length + subCategories.length > 0 && !includeGuessedCategories\n ? // then only show data points with approved data categories\n { status: SubDataPointDataSubCategoryGuessStatus.Approved }\n : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n subDataPoints: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** Count */\n totalCount: number;\n };\n }>(client, SUB_DATA_POINTS_COUNT, {\n variables: { filterBy },\n logger,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPointCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliSubDataPointCsvExport(\n $filterBy: SubDataPointFiltersInput\n $first: Int!\n $offset: Int!\n ) {\n subDataPoints(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n name\n description\n dataPointId\n dataSiloId\n purposes {\n name\n purpose\n }\n categories {\n name\n category\n }\n ${\n includeGuessedCategories\n ? `pendingCategoryGuesses {\n category {\n name\n category\n }\n status\n classifierVersion\n }`\n : ''\n }\n ${\n includeAttributes\n ? `attributeValues {\n attributeKey {\n name\n }\n name\n }`\n : ''\n }\n }\n }\n }\n `,\n {\n variables: {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n // TODO: https://transcend.height.app/T-40484 - add cursor support\n // ...(cursor ? { cursor: { id: cursor } } : {}),\n },\n },\n logger,\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n subDataPoints.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(subDataPoints, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return sorted;\n}\n\n/**\n * Pull datapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints\n */\nasync function pullDatapoints(\n client: GraphQLClient,\n {\n dataPointIds = [],\n pageSize = 100,\n }: {\n /** IDs of data points to filter down */\n dataPointIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataPointCsvPreview[]> {\n const dataPoints: DataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 2/3] Fetching metadata for ${dataPointIds.length} datapoints`));\n\n // Group by 100\n const dataPointsGrouped = chunk(dataPointIds, pageSize);\n\n progressBar.start(dataPointIds.length, 0);\n let total = 0;\n await mapSeries(dataPointsGrouped, async (dataPointIdsGroup) => {\n try {\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPointCsvPreview[];\n };\n }>(client, DATAPOINT_EXPORT, {\n variables: {\n first: pageSize,\n filterBy: {\n ids: dataPointIdsGroup,\n },\n },\n logger,\n });\n\n dataPoints.push(...nodes);\n total += dataPointIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for IDs ${dataPointIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataPoints.length} dataPoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataPoints;\n}\n\n/**\n * Pull data silo information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The data silos\n */\nasync function pullDataSilos(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n pageSize = 100,\n }: {\n /** IDs of data silos to filter down */\n dataSiloIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataSiloCsvPreview[]> {\n const dataSilos: DataSiloCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 3/3] Fetching metadata for ${dataSiloIds.length} data silos`));\n\n // Group by 100\n const dataSilosGrouped = chunk(dataSiloIds, pageSize);\n\n progressBar.start(dataSiloIds.length, 0);\n let total = 0;\n await mapSeries(dataSilosGrouped, async (dataSiloIdsGroup) => {\n try {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: DataSiloCsvPreview[];\n };\n }>(client, DATA_SILO_EXPORT, {\n variables: {\n first: pageSize,\n filterBy: {\n ids: dataSiloIdsGroup,\n },\n },\n logger,\n });\n\n dataSilos.push(...nodes);\n total += dataSiloIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching data silos for IDs ${dataSiloIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataSilos.length} data silos in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataSilos;\n}\n\n/**\n * Pull all datapoints from the data inventory.\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints and data silos\n */\nexport async function pullAllDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<\n (SubDataPointCsvPreview & {\n /** Data point information */\n dataPoint: DataPointCsvPreview;\n /** Data silo information */\n dataSilo: DataSiloCsvPreview;\n })[]\n> {\n // Subdatapoint information\n const subDatapoints = await pullSubDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n includeAttributes,\n parentCategories,\n subCategories,\n pageSize,\n });\n\n // The datapoint ids to grab\n const dataPointIds = uniq(subDatapoints.map((point) => point.dataPointId));\n const dataPoints = await pullDatapoints(client, {\n dataPointIds,\n });\n const dataPointById = keyBy(dataPoints, 'id');\n\n // The data silo IDs to grab\n const allDataSiloIds = uniq(subDatapoints.map((point) => point.dataSiloId));\n const dataSilos = await pullDataSilos(client, {\n dataSiloIds: allDataSiloIds,\n });\n const dataSiloById = keyBy(dataSilos, 'id');\n\n return subDatapoints.map((subDataPoint) => ({\n ...subDataPoint,\n dataPoint: dataPointById[subDataPoint.dataPointId],\n dataSilo: dataSiloById[subDataPoint.dataSiloId],\n }));\n}\n/* eslint-enable max-lines */\n"],"mappings":"wcA0FA,eAAe,EACb,EACA,CACE,cAAc,EAAE,CAChB,2BACA,oBACA,mBAAmB,EAAE,CACrB,gBAAgB,EAAE,CAClB,WAAW,KAIT,EAAE,CAC6B,CACnC,IAAM,EAA0C,EAAE,CAG5C,EAAK,IAAI,MAAM,CAAC,SAAS,CAGzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAW,CACf,GAAI,EAAiB,OAAS,EAAI,CAAE,SAAU,EAAkB,CAAG,EAAE,CACrE,GAAI,EAAc,OAAS,EAAI,CAAE,eAAgB,EAAe,CAAG,EAAE,CAErE,GAAI,EAAiB,OAAS,EAAc,OAAS,GAAK,CAAC,EAEvD,CAAE,OAAQ,EAAuC,SAAU,CAC3D,EAAE,CACN,GAAI,EAAY,OAAS,EAAI,CAAE,UAAW,EAAa,CAAG,EAAE,CAC7D,CAGK,CACJ,cAAe,CAAE,eACf,MAAM,EAMP,EAAQ,EAAuB,CAChC,UAAW,CAAE,WAAU,CACvB,SACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,0CAA0C,CAAC,CAEtE,EAAY,MAAM,EAAY,EAAE,CAChC,IAAI,EAAQ,EACR,EAAiB,GACjB,EACA,EAAS,EACb,EACE,IAAI,CACF,GAAM,CACJ,cAAe,CAAE,UACf,MAAM,EAOR,EACA,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2BO,EACI;;;;;;;mBAQA,GAC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EAAgB,EAAM,MAHH,EAAe,EAAQ,CAC9C,aAFmB,EAAK,EAAc,IAAK,GAAU,EAAM,YAAY,CAE3D,CACb,CAAC,CACsC,KAAK,CAOvC,EAAe,EAAM,MAHH,EAAc,EAAQ,CAC5C,YAFqB,EAAK,EAAc,IAAK,GAAU,EAAM,WAAW,CAE7C,CAC5B,CAAC,CACoC,KAAK,CAE3C,OAAO,EAAc,IAAK,IAAkB,CAC1C,GAAG,EACH,UAAW,EAAc,EAAa,aACtC,SAAU,EAAa,EAAa,YACrC,EAAE"}
|
|
1
|
+
{"version":3,"file":"pullAllDatapoints-D8mTXHun.mjs","names":[],"sources":["../src/lib/data-inventory/pullAllDatapoints.ts"],"sourcesContent":["import {\n type DataCategoryType,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport {\n makeGraphQLRequest,\n DATAPOINT_EXPORT,\n DATA_SILO_EXPORT,\n SUB_DATA_POINTS_COUNT,\n type DataSiloAttributeValue,\n} from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql, type GraphQLClient } from 'graphql-request';\n/* eslint-disable max-lines */\nimport { keyBy, uniq, chunk, sortBy } from 'lodash-es';\n\nimport type { DataCategoryInput, ProcessingPurposeInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\n\nexport interface DataSiloCsvPreview {\n /** ID of dataSilo */\n id: string;\n /** Name of dataSilo */\n title: string;\n}\n\nexport interface DataPointCsvPreview {\n /** ID of dataPoint */\n id: string;\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n}\n\nexport interface SubDataPointCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** Data point ID */\n dataPointId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /** Attribute attached to subdatapoint */\n attributeValues?: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\nexport interface DatapointFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Whether to include guessed categories, defaults to only approved categories */\n includeGuessedCategories?: boolean;\n /** Whether or not to include attributes */\n includeAttributes?: boolean;\n /** Parent categories to filter down for */\n parentCategories?: DataCategoryType[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n}\n\n/**\n * Pull subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The subdatapoints\n */\nasync function pullSubDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<SubDataPointCsvPreview[]> {\n const subDataPoints: SubDataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n // Filters\n const filterBy = {\n ...(parentCategories.length > 0 ? { category: parentCategories } : {}),\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n // if parentCategories or subCategories and not includeGuessedCategories\n ...(parentCategories.length + subCategories.length > 0 && !includeGuessedCategories\n ? // then only show data points with approved data categories\n { status: SubDataPointDataSubCategoryGuessStatus.Approved }\n : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n subDataPoints: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** Count */\n totalCount: number;\n };\n }>(client, SUB_DATA_POINTS_COUNT, {\n variables: { filterBy },\n logger,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPointCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliSubDataPointCsvExport(\n $filterBy: SubDataPointFiltersInput\n $first: Int!\n $offset: Int!\n ) {\n subDataPoints(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n name\n description\n dataPointId\n dataSiloId\n purposes {\n name\n purpose\n }\n categories {\n name\n category\n }\n ${\n includeGuessedCategories\n ? `pendingCategoryGuesses {\n category {\n name\n category\n }\n status\n classifierVersion\n }`\n : ''\n }\n ${\n includeAttributes\n ? `attributeValues {\n attributeKey {\n name\n }\n name\n }`\n : ''\n }\n }\n }\n }\n `,\n {\n variables: {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n // TODO: https://transcend.height.app/T-40484 - add cursor support\n // ...(cursor ? { cursor: { id: cursor } } : {}),\n },\n },\n logger,\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n subDataPoints.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(subDataPoints, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return sorted;\n}\n\n/**\n * Pull datapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints\n */\nasync function pullDatapoints(\n client: GraphQLClient,\n {\n dataPointIds = [],\n pageSize = 100,\n }: {\n /** IDs of data points to filter down */\n dataPointIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataPointCsvPreview[]> {\n const dataPoints: DataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 2/3] Fetching metadata for ${dataPointIds.length} datapoints`));\n\n // Group by 100\n const dataPointsGrouped = chunk(dataPointIds, pageSize);\n\n progressBar.start(dataPointIds.length, 0);\n let total = 0;\n await mapSeries(dataPointsGrouped, async (dataPointIdsGroup) => {\n try {\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPointCsvPreview[];\n };\n }>(client, DATAPOINT_EXPORT, {\n variables: {\n first: pageSize,\n filterBy: {\n ids: dataPointIdsGroup,\n },\n },\n logger,\n });\n\n dataPoints.push(...nodes);\n total += dataPointIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching subdatapoints for IDs ${dataPointIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataPoints.length} dataPoints in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataPoints;\n}\n\n/**\n * Pull data silo information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The data silos\n */\nasync function pullDataSilos(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n pageSize = 100,\n }: {\n /** IDs of data silos to filter down */\n dataSiloIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataSiloCsvPreview[]> {\n const dataSilos: DataSiloCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n logger.info(colors.magenta(`[Step 3/3] Fetching metadata for ${dataSiloIds.length} data silos`));\n\n // Group by 100\n const dataSilosGrouped = chunk(dataSiloIds, pageSize);\n\n progressBar.start(dataSiloIds.length, 0);\n let total = 0;\n await mapSeries(dataSilosGrouped, async (dataSiloIdsGroup) => {\n try {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: DataSiloCsvPreview[];\n };\n }>(client, DATA_SILO_EXPORT, {\n variables: {\n first: pageSize,\n filterBy: {\n ids: dataSiloIdsGroup,\n },\n },\n logger,\n });\n\n dataSilos.push(...nodes);\n total += dataSiloIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(`An error fetching data silos for IDs ${dataSiloIdsGroup.join(', ')}`),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataSilos.length} data silos in ${totalTime / 1000} seconds!`,\n ),\n );\n return dataSilos;\n}\n\n/**\n * Pull all datapoints from the data inventory.\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints and data silos\n */\nexport async function pullAllDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<\n (SubDataPointCsvPreview & {\n /** Data point information */\n dataPoint: DataPointCsvPreview;\n /** Data silo information */\n dataSilo: DataSiloCsvPreview;\n })[]\n> {\n // Subdatapoint information\n const subDatapoints = await pullSubDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n includeAttributes,\n parentCategories,\n subCategories,\n pageSize,\n });\n\n // The datapoint ids to grab\n const dataPointIds = uniq(subDatapoints.map((point) => point.dataPointId));\n const dataPoints = await pullDatapoints(client, {\n dataPointIds,\n });\n const dataPointById = keyBy(dataPoints, 'id');\n\n // The data silo IDs to grab\n const allDataSiloIds = uniq(subDatapoints.map((point) => point.dataSiloId));\n const dataSilos = await pullDataSilos(client, {\n dataSiloIds: allDataSiloIds,\n });\n const dataSiloById = keyBy(dataSilos, 'id');\n\n return subDatapoints.map((subDataPoint) => ({\n ...subDataPoint,\n dataPoint: dataPointById[subDataPoint.dataPointId],\n dataSilo: dataSiloById[subDataPoint.dataSiloId],\n }));\n}\n/* eslint-enable max-lines */\n"],"mappings":"wcA0FA,eAAe,EACb,EACA,CACE,cAAc,EAAE,CAChB,2BACA,oBACA,mBAAmB,EAAE,CACrB,gBAAgB,EAAE,CAClB,WAAW,KAIT,EAAE,CAC6B,CACnC,IAAM,EAA0C,EAAE,CAG5C,EAAK,IAAI,MAAM,CAAC,SAAS,CAGzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAW,CACf,GAAI,EAAiB,OAAS,EAAI,CAAE,SAAU,EAAkB,CAAG,EAAE,CACrE,GAAI,EAAc,OAAS,EAAI,CAAE,eAAgB,EAAe,CAAG,EAAE,CAErE,GAAI,EAAiB,OAAS,EAAc,OAAS,GAAK,CAAC,EAEvD,CAAE,OAAQ,EAAuC,SAAU,CAC3D,EAAE,CACN,GAAI,EAAY,OAAS,EAAI,CAAE,UAAW,EAAa,CAAG,EAAE,CAC7D,CAGK,CACJ,cAAe,CAAE,eACf,MAAM,EAMP,EAAQ,EAAuB,CAChC,UAAW,CAAE,WAAU,CACvB,SACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,0CAA0C,CAAC,CAEtE,EAAY,MAAM,EAAY,EAAE,CAChC,IAAI,EAAQ,EACR,EAA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AmB,EAAE,CACrB,gBAAgB,EAAE,CAClB,WAAW,KAIT,EAAE,CAQN,CAEA,IAAM,EAAgB,MAAM,EAAkB,EAAQ,CACpD,cACA,2BACA,oBACA,mBACA,gBACA,WACD,CAAC,CAOI,EAAgB,EAAM,MAHH,EAAe,EAAQ,CAC9C,aAFmB,EAAK,EAAc,IAAK,GAAU,EAAM,YAAY,CAE3D,CACb,CAAC,CACsC,KAAK,CAOvC,EAAe,EAAM,MAHH,EAAc,EAAQ,CAC5C,YAFqB,EAAK,EAAc,IAAK,GAAU,EAAM,WAAW,CAE7C,CAC5B,CAAC,CACoC,KAAK,CAE3C,OAAO,EAAc,IAAK,IAAkB,CAC1C,GAAG,EACH,UAAW,EAAc,EAAa,aACtC,SAAU,EAAa,EAAa,YACrC,EAAE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=pullChunkedCustomSiloOutstandingIdentifiers-
|
|
1
|
+
import{a as e}from"./constants-W0InNUWp.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{decodeCodec as n}from"@transcend-io/type-utils";import r from"colors";import*as i from"io-ts";import{REDUCED_REQUESTS_FOR_DATA_SILO_COUNT as a,buildTranscendGraphQLClient as o,createSombraGotInstance as s,makeGraphQLRequest as c,withTransientRetry as l}from"@transcend-io/sdk";import{mapSeries as u}from"@transcend-io/utils";import d from"cli-progress";async function f(e,{dataSiloId:n}){let{listReducedRequestsForDataSilo:{totalCount:r}}=await c(e,a,{variables:{input:{dataSiloId:n,isResolved:!1}},logger:t});return r}const p=i.type({id:i.string,name:i.string,partition:i.string}),m=i.intersection([i.type({identifier:i.string,type:i.string,coreIdentifier:i.string,dataSiloId:i.string,requestId:i.string,nonce:i.string,requestCreatedAt:i.string,daysUntilOverdue:i.number,attributes:i.array(i.type({key:i.string,values:i.array(i.string)}))}),i.partial({partition:i.union([p,i.null])})]);async function h(e,{dataSiloId:r,limit:a=100,offset:o=0,requestType:s}){try{let c=await l(`pullCronPageOfIdentifiers`,()=>e.get(`v1/data-silo/${r}/pending-requests/${s}`,{searchParams:{offset:o,limit:a}}).json(),{logger:t,maxAttempts:6,baseDelayMs:500}),{items:u}=n(i.type({items:i.array(m)}),c);return u}catch(e){throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function g({dataSiloId:n,auth:i,sombraAuth:a,actions:c,apiPageSize:l=100,savePageSize:p=1e3,onSave:m,transcendUrl:g=e,skipRequestCount:_=!1}){if(p%l!==0)throw Error(`savePageSize must be a multiple of apiPageSize. savePageSize: ${p}, apiPageSize: ${l}`);let v=await s(g,i,{logger:t,sombraApiKey:a,sombraUrl:process.env.SOMBRA_URL}),y=o(g,i),b=0;_||(b=await f(y,{dataSiloId:n})),t.info(r.magenta(`Pulling ${_?`all`:b} outstanding request identifiers for data silo: "${n}" for requests of types "${c.join(`", "`)}"`));let x=new Date().getTime(),S=new d.SingleBar({},d.Presets.shades_classic),C=new Set,w=[],T=[];_||S.start(b,0),await u(c,async e=>{let i=0,a=!0;for(;a;){let o=await h(v,{dataSiloId:n,limit:l,offset:i,requestType:e}),s=o.map(t=>(C.add(t.requestId),{...t,action:e})),c=s.map(({attributes:e,partition:t,...n})=>({...n,...t?{partitionId:t.id,partitionName:t.name,partitionKey:t.partition}:{},...e.reduce((e,t)=>Object.assign(e,{[t.key]:t.values.join(`,`)}),{})}));w.push(...s),T.push(...c),T.length>=p&&(await m(T),T=[]),a=o.length===l,i+=l,_?t.info(r.magenta(`Pulled ${o.length} outstanding identifiers for ${C.size} requests`)):S.update(C.size)}}),T.length>0&&await m(T),_||S.stop();let E=new Date().getTime()-x;return t.info(r.green(`Successfully pulled ${w.length} outstanding identifiers from ${C.size} requests in "${E/1e3}" seconds!`)),{identifiers:w}}export{f as a,h as i,m as n,p as r,g as t};
|
|
2
|
+
//# sourceMappingURL=pullChunkedCustomSiloOutstandingIdentifiers-DMwrDs_z.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-C5uhtMJZ.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { makeGraphQLRequest, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * Get number of open requests for a data silo\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request identifiers\n */\nexport async function fetchRequestDataSiloActiveCount(\n client: GraphQLClient,\n {\n dataSiloId,\n }: {\n /** Data silo ID */\n dataSiloId: string;\n },\n): Promise<number> {\n const {\n listReducedRequestsForDataSilo: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n listReducedRequestsForDataSilo: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, {\n variables: {\n input: {\n dataSiloId,\n isResolved: false,\n },\n },\n logger,\n });\n\n return totalCount;\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { withTransientRetry } from '@transcend-io/sdk';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\n\n/** Consent partition metadata when a DSR is scoped to a partition */\nexport const CronPartition = t.type({\n /** ID of the partition */\n id: t.string,\n /** The human readable name of the partition */\n name: t.string,\n /** The unique identifying partition value */\n partition: t.string,\n});\n\n/** Type override */\nexport type CronPartition = t.TypeOf<typeof CronPartition>;\n\nexport const CronIdentifier = t.intersection([\n t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n }),\n t.partial({\n /** The consent partition that scopes this request, when applicable */\n partition: t.union([CronPartition, t.null]),\n }),\n]);\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // `GET pending-requests` is a read and therefore safe to retry on transient\n // gateway / network errors. Customers running `transcend cron\n // pull-identifiers` against large silos would otherwise see the command\n // abort on a single 502 from the Sombra reverse tunnel.\n const response = await withTransientRetry(\n 'pullCronPageOfIdentifiers',\n () =>\n sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json(),\n { logger, maxAttempts: 6, baseDelayMs: 500 },\n );\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, createSombraGotInstance } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchRequestDataSiloActiveCount } from '../graphql/index.js';\nimport { pullCronPageOfIdentifiers, CronIdentifier } from './pullCronPageOfIdentifiers.js';\n\n/**\n * A CSV formatted identifier\n */\nexport type CsvFormattedIdentifier = {\n [k in string]: string | null | boolean | number;\n};\n\nexport interface CronIdentifierWithAction extends CronIdentifier {\n /** The request action that the identifier relates to */\n action: RequestAction;\n}\n\n/**\n * Pull the set of identifiers outstanding for a cron or AVC integration\n *\n * This function is designed to be used in a loop, and will call the onSave callback\n * with a chunk of identifiers when the savePageSize is reached.\n *\n * @param options - Options\n * @returns The identifiers and identifiers formatted for CSV\n */\nexport async function pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize = 100,\n savePageSize = 1000,\n onSave,\n transcendUrl = DEFAULT_TRANSCEND_API,\n skipRequestCount = false,\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** The request actions to fetch */\n actions: RequestAction[];\n /** How many identifiers to pull in a single call to the backend */\n apiPageSize: number;\n /** How many identifiers to save at a time (usually to a CSV file, should be a multiple of apiPageSize) */\n savePageSize: number;\n /** Callback function called when a chunk of identifiers is ready to be saved */\n onSave: (chunk: CsvFormattedIdentifier[]) => Promise<void>;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Skip request count */\n skipRequestCount?: boolean;\n}): Promise<{\n /** Raw Identifiers */\n identifiers: CronIdentifierWithAction[];\n}> {\n // Validate savePageSize\n if (savePageSize % apiPageSize !== 0) {\n throw new Error(\n `savePageSize must be a multiple of apiPageSize. savePageSize: ${savePageSize}, apiPageSize: ${apiPageSize}`,\n );\n }\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n let totalRequestCount = 0;\n if (!skipRequestCount) {\n totalRequestCount = await fetchRequestDataSiloActiveCount(client, {\n dataSiloId,\n });\n }\n\n logger.info(\n colors.magenta(\n `Pulling ${skipRequestCount ? 'all' : totalRequestCount} outstanding request identifiers ` +\n `for data silo: \"${dataSiloId}\" for requests of types \"${actions.join('\", \"')}\"`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const foundRequestIds = new Set<string>();\n\n // identifiers found in total\n const identifiers: CronIdentifierWithAction[] = [];\n // current chunk of identifiers to be saved\n let currentChunk: CsvFormattedIdentifier[] = [];\n\n // map over each action\n if (!skipRequestCount) {\n progressBar.start(totalRequestCount, 0);\n }\n await mapSeries(actions, async (action) => {\n let offset = 0;\n let shouldContinue = true;\n\n // Fetch a page of identifiers\n while (shouldContinue) {\n const pageIdentifiers = await pullCronPageOfIdentifiers(sombra, {\n dataSiloId,\n limit: apiPageSize,\n offset,\n requestType: action,\n });\n\n const identifiersWithAction: CronIdentifierWithAction[] = pageIdentifiers.map(\n (identifier) => {\n foundRequestIds.add(identifier.requestId);\n return {\n ...identifier,\n action,\n };\n },\n );\n\n const csvFormattedIdentifiers = identifiersWithAction.map(\n ({ attributes, partition, ...identifier }) => ({\n ...identifier,\n ...(partition\n ? {\n partitionId: partition.id,\n partitionName: partition.name,\n partitionKey: partition.partition,\n }\n : {}),\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n\n return { identifiers };\n}\n"],"mappings":"0bAYA,eAAsB,EACpB,EACA,CACE,cAKe,CACjB,GAAM,CACJ,+BAAgC,CAAE,eAChC,MAAM,EAMP,EAAQ,EAAsC,CAC/C,UAAW,CACT,MAAO,CACL,aACA,WAAY,GACb,CACF,CACD,SACD,CAAC,CAEF,OAAO,EC9BT,MAAa,EAAgB,EAAE,KAAK,CAElC,GAAI,EAAE,OAEN,KAAM,EAAE,OAER,UAAW,EAAE,OACd,CAAC,CAKW,EAAiB,EAAE,aAAa,CAC3C,EAAE,KAAK,CAEL,WAAY,EAAE,OAEd,KAAM,EAAE,OAER,eAAgB,EAAE,OAElB,WAAY,EAAE,OAEd,UAAW,EAAE,OAEb,MAAO,EAAE,OAET,iBAAkB,EAAE,OAEpB,iBAAkB,EAAE,OAEpB,WAAY,EAAE,MACZ,EAAE,KAAK,CACL,IAAK,EAAE,OACP,OAAQ,EAAE,MAAM,EAAE,OAAO,CAC1B,CAAC,CACH,CACF,CAAC,CACF,EAAE,QAAQ,CAER,UAAW,EAAE,MAAM,CAAC,EAAe,EAAE,KAAK,CAAC,CAC5C,CAAC,CACH,CAAC,CAaF,eAAsB,EACpB,EACA,CACE,aACA,QAAQ,IACR,SAAS,EACT,eAWyB,CAC3B,GAAI,CAKF,IAAM,EAAW,MAAM,EACrB,gCAEE,EACG,IAAI,gBAAgB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AEJ,CAEK,EAA0B,EAAsB,KACnD,CAAE,aAAY,YAAW,GAAG,MAAkB,CAC7C,GAAG,EACH,GAAI,EACA,CACE,YAAa,EAAU,GACvB,cAAe,EAAU,KACzB,aAAc,EAAU,UACzB,CACD,EAAE,CACN,GAAG,EAAW,QACX,EAAK,IACJ,OAAO,OAAO,EAAK,EAChB,EAAI,KAAM,EAAI,OAAO,KAAK,IAAI,CAChC,CAAC,CACJ,EAAE,CACH,CACF,EACF,CAED,EAAY,KAAK,GAAG,EAAsB,CAC1C,EAAa,KAAK,GAAG,EAAwB,CAGzC,EAAa,QAAU,IACzB,MAAM,EAAO,EAAa,CAC1B,EAAe,EAAE,EAGnB,EAAiB,EAAgB,SAAW,EAC5C,GAAU,EACL,EAGH,EAAO,KACL,EAAO,QACL,UAAU,EAAgB,OAAO,+BAA+B,EAAgB,KAAK,WACtF,CACF,CAND,EAAY,OAAO,EAAgB,KAAK,GAS5C,CAGE,EAAa,OAAS,GACxB,MAAM,EAAO,EAAa,CAGvB,GACH,EAAY,MAAM,CAGpB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAUvB,OARA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAY,OAAO,gCACxC,EAAgB,KACjB,gBAAgB,EAAY,IAAK,YACnC,CACF,CAEM,CAAE,cAAa"}
|
|
1
|
+
{"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-DMwrDs_z.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { makeGraphQLRequest, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * Get number of open requests for a data silo\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request identifiers\n */\nexport async function fetchRequestDataSiloActiveCount(\n client: GraphQLClient,\n {\n dataSiloId,\n }: {\n /** Data silo ID */\n dataSiloId: string;\n },\n): Promise<number> {\n const {\n listReducedRequestsForDataSilo: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n listReducedRequestsForDataSilo: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, {\n variables: {\n input: {\n dataSiloId,\n isResolved: false,\n },\n },\n logger,\n });\n\n return totalCount;\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { withTransientRetry } from '@transcend-io/sdk';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\n\n/** Consent partition metadata when a DSR is scoped to a partition */\nexport const CronPartition = t.type({\n /** ID of the partition */\n id: t.string,\n /** The human readable name of the partition */\n name: t.string,\n /** The unique identifying partition value */\n partition: t.string,\n});\n\n/** Type override */\nexport type CronPartition = t.TypeOf<typeof CronPartition>;\n\nexport const CronIdentifier = t.intersection([\n t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n }),\n t.partial({\n /** The consent partition that scopes this request, when applicable */\n partition: t.union([CronPartition, t.null]),\n }),\n]);\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // `GET pending-requests` is a read and therefore safe to retry on transient\n // gateway / network errors. Customers running `transcend cron\n // pull-identifiers` against large silos would otherwise see the command\n // abort on a single 502 from the Sombra reverse tunnel.\n const response = await withTransientRetry(\n 'pullCronPageOfIdentifiers',\n () =>\n sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json(),\n { logger, maxAttempts: 6, baseDelayMs: 500 },\n );\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, createSombraGotInstance } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchRequestDataSiloActiveCount } from '../graphql/index.js';\nimport { pullCronPageOfIdentifiers, CronIdentifier } from './pullCronPageOfIdentifiers.js';\n\n/**\n * A CSV formatted identifier\n */\nexport type CsvFormattedIdentifier = {\n [k in string]: string | null | boolean | number;\n};\n\nexport interface CronIdentifierWithAction extends CronIdentifier {\n /** The request action that the identifier relates to */\n action: RequestAction;\n}\n\n/**\n * Pull the set of identifiers outstanding for a cron or AVC integration\n *\n * This function is designed to be used in a loop, and will call the onSave callback\n * with a chunk of identifiers when the savePageSize is reached.\n *\n * @param options - Options\n * @returns The identifiers and identifiers formatted for CSV\n */\nexport async function pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize = 100,\n savePageSize = 1000,\n onSave,\n transcendUrl = DEFAULT_TRANSCEND_API,\n skipRequestCount = false,\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** The request actions to fetch */\n actions: RequestAction[];\n /** How many identifiers to pull in a single call to the backend */\n apiPageSize: number;\n /** How many identifiers to save at a time (usually to a CSV file, should be a multiple of apiPageSize) */\n savePageSize: number;\n /** Callback function called when a chunk of identifiers is ready to be saved */\n onSave: (chunk: CsvFormattedIdentifier[]) => Promise<void>;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Skip request count */\n skipRequestCount?: boolean;\n}): Promise<{\n /** Raw Identifiers */\n identifiers: CronIdentifierWithAction[];\n}> {\n // Validate savePageSize\n if (savePageSize % apiPageSize !== 0) {\n throw new Error(\n `savePageSize must be a multiple of apiPageSize. savePageSize: ${savePageSize}, apiPageSize: ${apiPageSize}`,\n );\n }\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n let totalRequestCount = 0;\n if (!skipRequestCount) {\n totalRequestCount = await fetchRequestDataSiloActiveCount(client, {\n dataSiloId,\n });\n }\n\n logger.info(\n colors.magenta(\n `Pulling ${skipRequestCount ? 'all' : totalRequestCount} outstanding request identifiers ` +\n `for data silo: \"${dataSiloId}\" for requests of types \"${actions.join('\", \"')}\"`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const foundRequestIds = new Set<string>();\n\n // identifiers found in total\n const identifiers: CronIdentifierWithAction[] = [];\n // current chunk of identifiers to be saved\n let currentChunk: CsvFormattedIdentifier[] = [];\n\n // map over each action\n if (!skipRequestCount) {\n progressBar.start(totalRequestCount, 0);\n }\n await mapSeries(actions, async (action) => {\n let offset = 0;\n let shouldContinue = true;\n\n // Fetch a page of identifiers\n while (shouldContinue) {\n const pageIdentifiers = await pullCronPageOfIdentifiers(sombra, {\n dataSiloId,\n limit: apiPageSize,\n offset,\n requestType: action,\n });\n\n const identifiersWithAction: CronIdentifierWithAction[] = pageIdentifiers.map(\n (identifier) => {\n foundRequestIds.add(identifier.requestId);\n return {\n ...identifier,\n action,\n };\n },\n );\n\n const csvFormattedIdentifiers = identifiersWithAction.map(\n ({ attributes, partition, ...identifier }) => ({\n ...identifier,\n ...(partition\n ? {\n partitionId: partition.id,\n partitionName: partition.name,\n partitionKey: partition.partition,\n }\n : {}),\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n\n return { identifiers };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AC1B,EAAe,EAAE,EAGnB,EAAiB,EAAgB,SAAW,EAC5C,GAAU,EACL,EAGH,EAAO,KACL,EAAO,QACL,UAAU,EAAgB,OAAO,+BAA+B,EAAgB,KAAK,WACtF,CACF,CAND,EAAY,OAAO,EAAgB,KAAK,GAS5C,CAGE,EAAa,OAAS,GACxB,MAAM,EAAO,EAAa,CAGvB,GACH,EAAY,MAAM,CAGpB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAUvB,OARA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAY,OAAO,gCACxC,EAAgB,KACjB,gBAAgB,EAAY,IAAK,YACnC,CACF,CAEM,CAAE,cAAa"}
|
package/dist/{pullConsentManagerMetrics-CcBfEEzz.mjs → pullConsentManagerMetrics-Cma2auCK.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{t as e}from"./logger-B-LXIf3U.mjs";import{fetchConsentManagerAnalyticsData as t,fetchConsentManagerId as n}from"@transcend-io/sdk";async function r(r,{bin:i,start:a,end:o=new Date}){let s=await n(r,{logger:e});if(Math.floor(a.getTime()/1e3)>Math.floor(o.getTime()/1e3))throw Error(`Received "end" date that happened before "start" date`);if(i===`1h`&&o.getTime()-a.getTime()>6048e5*2)throw Error(`When using bin=1h, start and end time can be no more than 2 weeks apart`);let c=a.toISOString(),l=o.toISOString(),[u,d,f]=await Promise.all([t(r,{dataSource:`PRIVACY_SIGNAL_TIMESERIES`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e}),t(r,{dataSource:`CONSENT_CHANGES_TIMESERIES`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e}),t(r,{dataSource:`CONSENT_SESSIONS_BY_REGIME`,startDate:c,endDate:l,forceRefetch:!0,airgapBundleId:s,binInterval:i,smoothTimeseries:!1},{logger:e})]);return{PRIVACY_SIGNAL_TIMESERIES:u,CONSENT_CHANGES_TIMESERIES:d,CONSENT_SESSIONS_BY_REGIME:f}}export{r as t};
|
|
2
|
-
//# sourceMappingURL=pullConsentManagerMetrics-
|
|
2
|
+
//# sourceMappingURL=pullConsentManagerMetrics-Cma2auCK.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullConsentManagerMetrics-
|
|
1
|
+
{"version":3,"file":"pullConsentManagerMetrics-Cma2auCK.mjs","names":[],"sources":["../src/lib/consent-manager/pullConsentManagerMetrics.ts"],"sourcesContent":["import { ConsentManagerMetricBin } from '@transcend-io/privacy-types';\nimport {\n type ConsentManagerMetric,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '@transcend-io/sdk';\nimport type { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * One second of time in ms\n */\nconst ONE_SECOND = 1000;\nconst ONE_MINUTE = 60 * ONE_SECOND;\nconst ONE_HOUR = 60 * ONE_MINUTE;\nconst ONE_DAY = 24 * ONE_HOUR;\nconst ONE_WEEK = 7 * ONE_DAY;\n\n/**\n * Pull consent manager metrics in an organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns The consent manager metrics\n */\nexport async function pullConsentManagerMetrics(\n client: GraphQLClient,\n {\n bin,\n start,\n end = new Date(),\n }: {\n /** Start date to pull metrics from */\n start: Date;\n /** End date to pull metrics from (assumes now) */\n end?: Date;\n /** Bin size to pull metrics */\n bin: ConsentManagerMetricBin;\n },\n): Promise<{\n /** Privacy signal data */\n PRIVACY_SIGNAL_TIMESERIES: ConsentManagerMetric[];\n /** Consent changes data */\n CONSENT_CHANGES_TIMESERIES: ConsentManagerMetric[];\n /** Consent sessions by regime */\n CONSENT_SESSIONS_BY_REGIME: ConsentManagerMetric[];\n}> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client, { logger });\n\n // convert start and end to times\n const startTime = Math.floor(start.getTime() / 1000);\n const endTime = Math.floor(end.getTime() / 1000);\n if (startTime > endTime) {\n throw new Error('Received \"end\" date that happened before \"start\" date');\n }\n\n // do not allow hourly bins greater than 2 weeks\n if (bin === '1h' && end.getTime() - start.getTime() > ONE_WEEK * 2) {\n throw new Error('When using bin=1h, start and end time can be no more than 2 weeks apart');\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] = await Promise.all([\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'PRIVACY_SIGNAL_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'CONSENT_CHANGES_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n fetchConsentManagerAnalyticsData(\n client,\n {\n dataSource: 'CONSENT_SESSIONS_BY_REGIME',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n },\n { logger },\n ),\n ]);\n\n return {\n PRIVACY_SIGNAL_TIMESERIES: privacySignalData,\n CONSENT_CHANGES_TIMESERIES: consentChangesData,\n CONSENT_SESSIONS_BY_REGIME: consentSessionsByRegimeData,\n };\n}\n"],"mappings":"0IA0BA,eAAsB,EACpB,EACA,CACE,MACA,QACA,MAAM,IAAI,MAgBX,CAED,IAAM,EAAiB,MAAM,EAAsB,EAAQ,CAAE,SAAQ,CAAC,CAKtE,GAFkB,KAAK,MAAM,EAAM,SAAS,CAAG,IAElC,CADG,KAAK,MAAM,EAAI,SAAS,CAAG,IACpB,CACrB,MAAU,MAAM,wDAAwD,CAI1E,GAAI,IAAQ,MAAQ,EAAI,SAAS,CAAG,EAAM,SAAS,CAAG,OAAW,EAC/D,MAAU,MAAM,0EAA0E,CAI5F,IAAM,EAAY,EAAM,aAAa,CAC/B,EAAU,EAAI,aAAa,CAC3B,CAAC,EAAmB,EAAoB,GAA+B,MAAM,QAAQ,IAAI,CAC7F,EACE,EACA,CACE,WAAY,4BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACD,EACE,EACA,CACE,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACD,EACE,EACA,CACE,WAAY,6BACZ,YACA,UACA,aAAc,GACd,iBACA,YAAa,EACb,iBAAkB,GACnB,CACD,CAAE,SAAQ,CACX,CACF,CAAC,CAEF,MAAO,CACL,0BAA2B,EAC3B,2BAA4B,EAC5B,2BAA4B,EAC7B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-
|
|
1
|
+
import{a as e}from"./constants-W0InNUWp.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{r as n}from"./fetchAllRequests-BCHpCeFo.mjs";import{a as r}from"./writeCsv-DDKM_rAU.mjs";import{RequestStatus as i}from"@transcend-io/privacy-types";import{groupBy as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c,createSombraGotInstance as l,fetchAllRequestEnrichers as u,fetchAllRequestIdentifiers as d,validateSombraVersion as f}from"@transcend-io/sdk";import{map as p}from"@transcend-io/utils";async function m({file:m,auth:h,sombraAuth:g,requestActions:_=[],concurrency:v=100,transcendUrl:y=e}){let b=c(y,h),x=await l(y,h,{logger:t,sombraApiKey:g,sombraUrl:process.env.SOMBRA_URL});t.info(s.magenta(`Pulling manual enrichment requests, filtered for actions: ${_.join(`,`)}`));let S=await n(b,{actions:_,statuses:[i.Enriching]});await f(b,{logger:t});let C=[];await p(S,async e=>{let n=await u(b,{filterBy:{requestId:e.id},logger:t});if(n.filter(({status:e})=>e===`ACTION_REQUIRED`)){let r=await d(b,x,{filterBy:{requestId:e.id},skipSombraCheck:!0,logger:t});C.push({...e,requestIdentifiers:r,requestEnrichers:n})}},{concurrency:v});let w=C.map(({attributeValues:e,requestIdentifiers:t,requestEnrichers:n,...r})=>({...r,...Object.entries(a(t,`name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({value:e})=>e).join(`,`)}),{}),...Object.entries(a(e,`attributeKey.name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({name:e})=>e).join(`,`)}),{})}));return await r(m,w,o(w.map(e=>Object.keys(e)).flat())),t.info(s.green(`Successfully wrote ${C.length} requests to file "${m}"`)),C}export{m as t};
|
|
2
|
+
//# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-CFW476px.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-
|
|
1
|
+
{"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-CFW476px.mjs","names":[],"sources":["../src/lib/manual-enrichment/pullManualEnrichmentIdentifiersToCsv.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllRequestEnrichers,\n fetchAllRequestIdentifiers,\n validateSombraVersion,\n type RequestEnricher,\n type RequestIdentifier,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { groupBy, uniq } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { type PrivacyRequest, fetchAllRequests } from '../graphql/index.js';\nimport { writeCsv } from '../helpers/writeCsv.js';\n\nexport interface PrivacyRequestWithIdentifiers extends PrivacyRequest {\n /** Request Enrichers */\n requestEnrichers: RequestEnricher[];\n /** Request Identifiers */\n requestIdentifiers: RequestIdentifier[];\n}\n\n/**\n * Pull the set of manual enrichment jobs to CSV\n *\n * @param options - Options\n * @returns List of requests with identifiers\n */\nexport async function pullManualEnrichmentIdentifiersToCsv({\n file,\n auth,\n sombraAuth,\n requestActions = [],\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** The request actions to fetch */\n requestActions?: RequestAction[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<PrivacyRequestWithIdentifiers[]> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n logger.info(\n colors.magenta(\n `Pulling manual enrichment requests, filtered for actions: ${requestActions.join(',')}`,\n ),\n );\n\n // Pull all privacy requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n });\n\n await validateSombraVersion(client, { logger });\n\n // Requests to save\n const savedRequests: PrivacyRequestWithIdentifiers[] = [];\n\n // Filter down requests to what is needed\n await map(\n allRequests,\n async (request) => {\n // Fetch enrichers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n filterBy: { requestId: request.id },\n logger,\n });\n\n // Check if manual enrichment exists for that request\n const hasManualEnrichment = requestEnrichers.filter(\n ({ status }) => status === 'ACTION_REQUIRED',\n );\n\n // Save request to queue\n if (hasManualEnrichment) {\n const requestIdentifiers = await fetchAllRequestIdentifiers(client, sombra, {\n filterBy: { requestId: request.id },\n skipSombraCheck: true,\n logger,\n });\n savedRequests.push({\n ...request,\n requestIdentifiers,\n requestEnrichers,\n });\n }\n },\n {\n concurrency,\n },\n );\n\n const data = savedRequests.map(\n ({\n attributeValues,\n requestIdentifiers,\n requestEnrichers, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...request\n }) => ({\n ...request,\n // flatten identifiers\n ...Object.entries(groupBy(requestIdentifiers, 'name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ value }) => value).join(','),\n }),\n {},\n ),\n // flatten attributes\n ...Object.entries(groupBy(attributeValues, 'attributeKey.name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ name }) => name).join(','),\n }),\n {},\n ),\n }),\n );\n\n // Write out to CSV\n const headers = uniq(data.map((d) => Object.keys(d)).flat());\n await writeCsv(file, data, headers);\n\n logger.info(\n colors.green(`Successfully wrote ${savedRequests.length} requests to file \"${file}\"`),\n );\n\n return savedRequests;\n}\n"],"mappings":"khBAgCA,eAAsB,EAAqC,CACzD,OACA,OACA,aACA,iBAAiB,EAAE,CACnB,cAAc,IACd,eAAe,GAc4B,CAE3C,IAAM,EAAS,EAA4B,EAAc,EAAK,CACxD,EAAS,MAAM,EAAwB,EAAc,EAAM,CAC/D,SACA,aAAc,EACd,UAAW,QAAQ,IAAI,WACxB,CAAC,CAEF,EAAO,KACL,EAAO,QACL,6DAA6D,EAAe,KAAK,IAAI,GACtF,CACF,CAGD,IAAM,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,SAAU,CAAC,EAAc,UAAU,CACpC,CAAC,CAEF,MAAM,EAAsB,EAAQ,CAAE,SAAQ,CAAC,CAG/C,IAAM,EAAiD,EAAE,CAGzD,MAAM,EACJ,EACA,KAAO,IAAY,CAEjB,IAAM,EAAmB,MAAM,EAAyB,EAAQ,CAC9D,SAAU,CAAE,UAAW,EAAQ,GAAI,CACnC,SACD,CAAC,CAQF,GAL4B,EAAiB,QAC1C,CAAE,YAAa,IAAW,kBAIN,CAAE,CACvB,IAAM,EAAqB,MAAM,EAA2B,EAAQ,EAAQ,CAC1E,SAAU,CAAE,UAAW,EAAQ,GAAI,CACnC,gBAAiB,GACjB,SACD,CAAC,CACF,EAAc,KAAK,CACjB,GAAG,EACH,qBACA,mBACD,CAAC,GAGN,CACE,cACD,CACF,CAED,IAAM,EAAO,EAAc,KACxB,CACC,kBACA,qBACA,mBACA,GAAG,MACE,CACL,GAAG,EAEH,GAAG,OAAO,QAAQ,EAAQ,EAAoB,OAAO,CAAC,CAAC,QACpD,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,WAAY,EAAM,CAAC,KAAK,IAAI,CAClD,CAAC,CACJ,EAAE,CACH,CAED,GAAG,OAAO,QAAQ,EAAQ,EAAiB,oBAAoB,CAAC,CAAC,QAC9D,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,UAAW,EAAK,CAAC,KAAK,IAAI,CAChD,CAAC,CACJ,EAAE,CACH,CACF,EACF,CAUD,OANA,MAAM,EAAS,EAAM,EADL,EAAK,EAAK,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CACzB,CAAC,CAEnC,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAc,OAAO,qBAAqB,EAAK,GAAG,CACtF,CAEM"}
|
package/dist/{pullTranscendConfiguration-ChFN8Wp4.mjs → pullTranscendConfiguration-nltf79oD.mjs}
RENAMED
|
@@ -55,4 +55,4 @@ import"./enums-CyFTrzXY.mjs";import{t as e}from"./logger-B-LXIf3U.mjs";import{Ac
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
`;async function I(t){let n=[],r=0,i=!1;do{let{assessmentFormTemplates:{nodes:a}}=await j(t,F,{variables:{first:20,offset:r},logger:e});n.push(...a),r+=20,i=a.length===20}while(i);return n.sort((e,t)=>e.title.localeCompare(t.title))}const L=[`dataSilos`,`enrichers`,`templates`,`apiKeys`];async function R(l,{dataSiloIds:j,integrationNames:P,debug:F,resources:R=L,pageSize:z,skipDatapoints:ve,includeGuessedCategories:B,skipSubDatapoints:ye,trackerStatuses:V=Object.values(n)}){if(j.length>0&&P.length>0)throw Error(`Only 1 of integrationNames OR dataSiloIds can be provided`);e.info(c.magenta(`Fetching data with page size ${z}...`));let[H,be,U,W,G,K,q,J,xe,Se,Ce,we,Y,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,X,Re,ze,Be,Ve,He,Ue,We,Ge,Ke]=await Promise.all([R.includes(`dataSilos`)||R.includes(`dataSubjects`)?C(l,{logger:e}):[],R.includes(`apiKeys`)?ue(l,{fetchAll:!0,logger:e}):[],R.includes(`dataSilos`)?ge(l,{ids:j,integrationNames:P,pageSize:z,debug:F,includeGuessedCategories:B,skipDatapoints:ve,skipSubDatapoints:ye,logger:e}):[],R.includes(`enrichers`)?w(l,{logger:e}):[],R.includes(`dataFlows`)?[...V.includes(n.Live)?await S(l,{logger:e,filterBy:{status:n.Live}}):[],...V.includes(n.NeedsReview)?await S(l,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],R.includes(`cookies`)?[...V.includes(n.Live)?await b(l,{logger:e,filterBy:{status:n.Live}}):[],...V.includes(n.NeedsReview)?await b(l,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],R.includes(`customFields`)?v(l,{logger:e}):[],R.includes(`templates`)?ce(l,{logger:e}):[],R.includes(`identifiers`)?T(l,{logger:e}):[],R.includes(`actions`)?p(l,{logger:e}):[],R.includes(`businessEntities`)?y(l,{logger:e}):[],R.includes(`processingActivities`)?ee(l,{logger:e}):[],R.includes(`consentManager`)?de(l,{logger:e}):void 0,R.includes(`consentManager`)?fe(l,{logger:e}):[],R.includes(`consentManager`)?he(l,{logger:e}):[],R.includes(`consentManager`)?me(l,{logger:e}):[],R.includes(`prompts`)?ie(l,{logger:e}):[],R.includes(`promptPartials`)?re(l,{logger:e}):[],R.includes(`promptGroups`)?ne(l,{logger:e}):[],R.includes(`agents`)?g(l,{logger:e}):[],R.includes(`agentFunctions`)?h(l,{logger:e}):[],R.includes(`agentFiles`)?m(l,{logger:e}):[],R.includes(`vendors`)?le(l,{logger:e}):[],R.includes(`dataCategories`)?x(l,{logger:e}):[],R.includes(`processingPurposes`)?te(l,{logger:e}):[],R.includes(`actionItems`)?f(l,{logger:e,filterBy:{type:[t.Onboarding]}}):[],R.includes(`actionItemCollections`)?d(l,{logger:e}):[],R.includes(`teams`)?se(l,{logger:e}):[],R.includes(`policies`)?D(l,{logger:e}):[],R.includes(`privacyCenters`)?O(l,{logger:e}):[],R.includes(`messages`)?E(l,{logger:e}):[],R.includes(`partitions`)?_e(l,{logger:e}):[],R.includes(`assessments`)?_(l,{logger:e}):[],R.includes(`assessmentTemplates`)?I(l):[],R.includes(`purposes`)?ae(l,{logger:e}):[],R.includes(`systemDiscovery`)?oe(l,{logger:e}):[]]),Z=R.includes(`consentManager`)&&Y?await pe(l,{logger:e,filterBy:{airgapBundleId:Y.id}}):void 0,Q={},qe=a(U.map(([{apiKeys:e}])=>e.map(({title:e})=>e))),$=Object.values(be).filter(({title:e})=>R.includes(`apiKeys`)?!0:qe.includes(e));if($.length>0&&R.includes(`apiKeys`)&&(Q[`api-keys`]=$.map(({title:e})=>({title:e}))),He.length>0&&R.includes(`partitions`)&&(Q.partitions=He.map(({name:e,partition:t})=>({name:e,partition:t}))),Y&&R.includes(`consentManager`)&&(Q[`consent-manager`]={bundleUrls:{TEST:Y.testBundleURL,PRODUCTION:Y.bundleURL},domains:Y.configuration.domains||void 0,partition:Y.configuration.partition||void 0,consentPrecedence:Y.configuration.consentPrecedence||void 0,unknownRequestPolicy:Y.configuration.unknownRequestPolicy||void 0,unknownCookiePolicy:Y.configuration.unknownCookiePolicy||void 0,syncEndpoint:Y.configuration.syncEndpoint||void 0,telemetryPartitioning:Y.configuration.telemetryPartitioning||void 0,signedIabAgreement:Y.configuration.signedIabAgreement||void 0,syncGroups:Y.configuration.syncGroups||void 0,theme:Z?{primaryColor:Z.primaryColor||void 0,fontColor:Z.fontColor||void 0,privacyPolicy:Z.privacyPolicy||void 0,prompt:Z.prompt}:void 0,experiences:Te.map(e=>({name:e.name,displayName:e.displayName||void 0,regions:e.regions.map(e=>({countrySubDivision:e.countrySubDivision||void 0,country:e.country||void 0})),onConsentExpiry:e.onConsentExpiry,consentExpiry:e.consentExpiry,operator:e.operator,displayPriority:e.displayPriority,viewState:e.viewState,purposes:e.purposes.map(e=>({trackingType:e.trackingType})),optedOutPurposes:e.optedOutPurposes.map(e=>({trackingType:e.trackingType})),browserLanguages:e.browserLanguages,browserTimeZones:e.browserTimeZones,consentUiVariantSlug:e.consentUiVariant?.slug})),consentVariants:Ee.map(e=>({id:e.id,name:e.name,slug:e.slug,description:e.description,configuration:JSON.stringify(e.configuration),locales:e.locales,status:e.status,userFlow:e.userFlow,themeSlug:e.theme?.slug})),consentThemes:De.map(e=>({id:e.id,name:e.name,slug:e.slug,configuration:JSON.stringify(e.configuration)}))}),Ue.length>0&&R.includes(`assessments`)&&(Q.assessments=Ue.map(({title:e,assessmentGroup:t,sections:n,creator:r,description:i,status:a,assignees:o,externalAssignees:s,reviewers:c,isLocked:l,isArchived:u,isExternallyCreated:d,dueDate:f,createdAt:p,assignedAt:m,submittedAt:h,approvedAt:g,rejectedAt:_,titleIsInternal:v,retentionSchedule:y,attributeValues:b,resources:x,syncedRows:S})=>({title:e,group:t.title,sections:n.map(({title:e,status:t,questions:n,assignees:r,isReviewed:i,externalAssignees:a})=>({title:e,status:t,questions:n.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,selectedAnswers:f,allowedMimeTypes:p,allowSelectOther:m,syncModel:h,syncColumn:g,attributeKey:_,requireRiskEvaluation:v,requireRiskMatrixEvaluation:y})=>{let b=s?M(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":b&&Object.keys(b).length>0?{action:b.action,rule:b.rule?{"depends-on-question-reference-id":b.rule.dependsOnQuestionReferenceId,"comparison-operator":b.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in b.rule?b.rule.comparisonOperands:void 0}:void 0,"nested-rule":b.nestedRule?{"logic-operator":b.nestedRule.logicOperator,rules:(b.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=N(e);return{"risk-level":t.riskAssignment?.riskLevelId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"selected-answers":f.map(({value:e})=>e),"allowed-mime-types":p,"allow-select-other":m,"sync-model":h||void 0,"sync-column":g||void 0,"attribute-key":_?.name,"require-risk-evaluation":v,"require-risk-matrix-evaluation":y}}),assignees:r.map(({email:e})=>e),"external-assignees":a.map(({email:e})=>e),"is-reviewed":i})),creator:r?.email,description:i,status:a,assignees:o.map(({email:e})=>e),"external-assignees":s.map(({email:e})=>e),reviewers:c.map(({email:e})=>e),locked:l,archived:u,external:d,"title-is-internal":v,"due-date":f||void 0,"created-at":p||void 0,"assigned-at":m||void 0,"submitted-at":h||void 0,"approved-at":g||void 0,"rejected-at":_||void 0,"retention-schedule":y?{type:y.type,"duration-days":y.durationDays,operand:y.operation}:void 0,attributes:b!==void 0&&b.length>0?k(b):void 0,resources:x.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``})),rows:S.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``}))}))),We.length>0&&R.includes(`assessmentTemplates`)&&(Q[`assessment-templates`]=We.map(({title:e,description:t,sections:n,status:r,source:i,creator:a,isLocked:o,isArchived:s,createdAt:c,retentionSchedule:l})=>({title:e,description:t,sections:n.map(({title:e,questions:t})=>({title:e,questions:t.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,allowedMimeTypes:f,allowSelectOther:p,syncModel:m,syncColumn:h,attributeKey:g,requireRiskEvaluation:_,requireRiskMatrixEvaluation:v})=>{let y=s?M(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":y&&Object.keys(y).length>0?{action:y.action,rule:y.rule?{"depends-on-question-reference-id":y.rule.dependsOnQuestionReferenceId,"comparison-operator":y.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in y.rule?y.rule.comparisonOperands:void 0}:void 0,"nested-rule":y.nestedRule?{"logic-operator":y.nestedRule.logicOperator,rules:(y.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=N(e);return{"risk-level":t.riskAssignment?.riskLevelId,"risk-matrix-row":t.riskAssignment?.riskMatrixRowId,"risk-matrix-column":t.riskAssignment?.riskMatrixColumnId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"allowed-mime-types":f,"allow-select-other":p,"sync-model":m||void 0,"sync-column":h||void 0,"attribute-key":g?.name,"require-risk-evaluation":_,"require-risk-matrix-evaluation":v}})})),status:r,source:i,creator:a?.email,locked:o,archived:s,"created-at":c||void 0,"retention-schedule":l?{type:l.type,"duration-days":l.durationDays,operand:l.operation}:void 0}))),Ke.length>0&&R.includes(`systemDiscovery`)&&(Q[`system-discovery`]=Ke.map(({title:e,resourceId:t,suggestedCatalog:{title:n},plugin:{dataSilo:{title:r}},country:i,countrySubDivision:a,plaintextContext:o,containsSensitiveData:s,status:c})=>({title:e,resourceId:t,suggestedCatalog:n,plugin:r,country:i||void 0,countrySubDivision:a||void 0,plaintextContext:o,containsSensitiveData:s,status:c}))),Oe.length>0&&R.includes(`prompts`)&&(Q.prompts=Oe.map(({title:e,content:t})=>({title:e,content:t}))),ke.length>0&&R.includes(`promptPartials`)&&(Q[`prompt-partials`]=ke.map(({title:e,content:t})=>({title:e,content:t}))),Ae.length>0&&R.includes(`promptGroups`)&&(Q[`prompt-groups`]=Ae.map(({title:e,description:t,prompts:n})=>({title:e,description:t,prompts:n.map(({title:e})=>e)}))),Re.length>0&&R.includes(`teams`)&&(Q.teams=Re.map(({name:e,description:t,ssoDepartment:n,ssoGroup:r,ssoTitle:i,users:a,scopes:o,parentTeam:s})=>({name:e,description:t,"sso-department":n||void 0,"sso-group":r||void 0,"sso-title":i||void 0,"parent-team-name":s?.name,users:a.map(({email:e})=>e),scopes:o.map(({name:e})=>e)}))),H.length>0&&R.includes(`dataSubjects`)&&(Q[`data-subjects`]=H.map(({type:e,title:t,active:n,adminDashboardDefaultSilentMode:r,actions:i})=>({type:e,title:t?.defaultMessage,active:n,adminDashboardDefaultSilentMode:r,actions:i.map(({type:e})=>e)}))),ze.length>0&&(Q.policies=ze.map(({title:e,versions:t,disabledLocales:n})=>({title:e?.defaultMessage,content:t?.[0]?.content?.defaultMessage,disabledLocales:n}))),Ve.length>0&&(Q.messages=Ve.map(({id:e,defaultMessage:t,targetReactIntlId:n,description:r,translations:i})=>({id:e,defaultMessage:t,description:r,targetReactIntlId:n||void 0,translations:i.reduce((e,{locale:t,value:n})=>Object.assign(e,{[t]:n}),{})}))),Be.length>0){let e=Be[0];Q[`privacy-center`]={isDisabled:e.isDisabled,showPrivacyRequestButton:e.showPrivacyRequestButton,showPolicies:e.showPolicies,showTrackingTechnologies:e.showTrackingTechnologies,showCookies:e.showCookies,showDataFlows:e.showDataFlows,showConsentManager:e.showConsentManager,showManageYourPrivacy:e.showManageYourPrivacy,showMarketingPreferences:e.showMarketingPreferences,locales:e.locales,defaultLocale:e.defaultLocale,preferBrowserDefaultLocale:e.preferBrowserDefaultLocale,supportEmail:e.supportEmail||void 0,replyToEmail:e.replyToEmail||void 0,useNoReplyEmailAddress:e.useNoReplyEmailAddress,useCustomEmailDomain:e.useCustomEmailDomain,transformAccessReportJsonToCsv:e.transformAccessReportJsonToCsv,theme:e.theme}}if(Ce.length>0&&R.includes(`businessEntities`)&&(Q[`business-entities`]=Ce.map(({title:e,description:t,address:n,headquarterCountry:r,headquarterSubDivision:i,dataProtectionOfficerName:a,dataProtectionOfficerEmail:o,attributeValues:s})=>({title:e,description:t||void 0,address:n||void 0,headquarterCountry:r||void 0,headquarterSubDivision:i||void 0,dataProtectionOfficerName:a||void 0,dataProtectionOfficerEmail:o||void 0,attributes:s!==void 0&&s.length>0?k(s):void 0}))),we.length>0&&R.includes(`processingActivities`)&&(Q[`processing-activities`]=we.map(({title:e,description:t,securityMeasureDetails:n,controllerships:r,storageRegions:a,transferRegions:o,retentionType:s,retentionPeriod:c,dataProtectionImpactAssessmentLink:l,dataProtectionImpactAssessmentStatus:u,attributeValues:d,dataSilos:f,dataSubjects:p,teams:m,owners:h,processingPurposeSubCategories:g,dataSubCategories:_,saaSCategories:v})=>({title:e,description:t,securityMeasureDetails:n??void 0,controllerships:r.length>0?r:void 0,storageRegions:a.length>0?A(a):void 0,transferRegions:o.length>0?A(o):void 0,retentionType:s,retentionPeriod:s===i.StatedPeriod?c:void 0,dataProtectionImpactAssessmentLink:l??void 0,dataProtectionImpactAssessmentStatus:u,attributes:d!==void 0&&d.length>0?k(d):void 0,dataSiloTitles:f.length>0?f.map(({title:e})=>e):void 0,dataSubjectTypes:p.length>0?p.map(({type:e})=>e):void 0,teamNames:m.length>0?m.map(({name:e})=>e):void 0,ownerEmails:h.length>0?h.map(({email:e})=>e):void 0,processingSubPurposes:g.length>0?g.map(({name:e,purpose:t})=>({purpose:t,...e?{name:e}:{}})):void 0,dataSubCategories:_.length>0?_.map(({name:e,category:t})=>({category:t,...e?{name:e}:{}})):void 0,saaSCategories:v.length>0?v.map(({title:e})=>e):void 0}))),Se.length>0&&R.includes(`actions`)&&(Q.actions=Se.map(({type:e,skipSecondaryIfNoFiles:t,skipDownloadableStep:n,requiresReview:i,regionList:a,regionDetectionMethod:o,waitingPeriod:s})=>({type:e,...e===r.Erasure?{skipSecondaryIfNoFiles:t,skipDownloadableStep:n}:{},requiresReview:i,waitingPeriod:s,regionDetectionMethod:o,regionList:a.length>0?a:void 0}))),xe.length>0&&R.includes(`identifiers`)&&(Q.identifiers=xe.map(({name:e,type:t,regex:n,selectOptions:r,privacyCenterVisibility:i,isRequiredInForm:a,placeholder:o,displayTitle:s,dataSubjects:c,displayDescription:l,displayOrder:u,isUniqueOnPreferenceStore:d})=>({name:e,type:t,regex:n,selectOptions:r.length>0?r:void 0,privacyCenterVisibility:i.length>0?i:void 0,isRequiredInForm:a,placeholder:o||void 0,dataSubjects:c.length>0?c.map(({type:e})=>e):void 0,displayTitle:s?.defaultMessage,displayDescription:l?.defaultMessage,displayOrder:u,isUniqueOnPreferenceStore:d}))),je.length>0&&R.includes(`agents`)&&(Q.agents=je.map(({name:e,agentId:t,description:n,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o,largeLanguageModel:s,teams:c,owners:l,agentFunctions:u,agentFiles:d})=>({name:e,agentId:t,description:n||void 0,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o?.title,"large-language-model":{name:s.name,client:s.client},teams:c&&c.length>0?c.map(({name:e})=>e):void 0,owners:l&&l.length>0?l.map(({email:e})=>e):void 0,"agent-functions":u&&u.length>0?u.map(({name:e})=>e):void 0,"agent-files":d&&d.length>0?d.map(({name:e})=>e):void 0}))),Le.length>0&&R.includes(`actionItems`)&&(Q[`action-items`]=Le.map(({teams:e,users:t,customerExperienceActionItemIds:[n],dueDate:r,priority:i,resolved:a,collections:o,notes:s,link:c,title:l,type:u,attributeValues:d})=>({teams:e.map(({name:e})=>e),users:t.map(({email:e})=>e),dueDate:r||void 0,title:l,notes:s,customerExperienceActionItemId:n,collections:o.map(({title:e})=>e),link:c,priority:i||void 0,resolved:a,type:u,attributes:d!==void 0&&d.length>0?k(d):void 0}))),X.length>0&&R.includes(`actionItemCollections`)&&(Q[`action-item-collections`]=X.map(({title:e,description:t,hidden:n,productLine:r})=>({title:e,description:t||void 0,hidden:n,productLine:r}))),Me.length>0&&R.includes(`agentFunctions`)&&(Q[`agent-functions`]=Me.map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:JSON.stringify(n)}))),Ne.length>0&&R.includes(`agentFiles`)&&(Q[`agent-files`]=Ne.map(({name:e,description:t,fileId:n,size:r,purpose:i})=>({name:e,description:t,fileId:n,size:r,purpose:i}))),Pe.length>0&&R.includes(`vendors`)&&(Q.vendors=Pe.map(({title:e,description:t,dataProcessingAgreementLink:n,contactName:r,contactPhone:i,address:a,headquarterCountry:o,headquarterSubDivision:s,websiteUrl:c,businessEntity:l,teams:u,owners:d,attributeValues:f})=>({title:e,description:t||void 0,dataProcessingAgreementLink:n||void 0,contactName:r||void 0,contactPhone:i||void 0,address:a||void 0,headquarterCountry:o||void 0,headquarterSubDivision:s||void 0,websiteUrl:c||void 0,businessEntity:l?.title,teams:u&&u.length>0?u.map(({name:e})=>e):void 0,owners:d&&d.length>0?d.map(({email:e})=>e):void 0,attributes:f!==void 0&&f.length>0?k(f):void 0}))),Fe.length>0&&R.includes(`dataCategories`)&&(Q[`data-categories`]=Fe.map(({name:e,category:t,description:n,regex:r,owners:i,teams:a,attributeValues:o})=>({name:e,category:t,description:n||void 0,regex:r||void 0,owners:i&&i.length>0?i.map(({email:e})=>e):void 0,teams:a&&a.length>0?a.map(({name:e})=>e):void 0,attributes:o!==void 0&&o.length>0?k(o):void 0}))),Ie.length>0&&R.includes(`processingPurposes`)&&(Q[`processing-purposes`]=Ie.map(({name:e,purpose:t,description:n,owners:r,teams:i,attributeValues:a})=>({name:e,purpose:t,description:n||void 0,owners:r&&r.length>0?r.map(({email:e})=>e):void 0,teams:i&&i.length>0?i.map(({name:e})=>e):void 0,attributes:a!==void 0&&a.length>0?k(a):void 0}))),G.length>0&&R.includes(`dataFlows`)&&(Q[`data-flows`]=G.map(({value:e,type:t,description:n,trackingType:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({value:e,type:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?k(c):void 0}))),K.length>0&&R.includes(`cookies`)&&(Q.cookies=K.map(({name:e,isRegex:t,description:n,trackingPurposes:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({name:e,isRegex:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?k(c):void 0}))),q.length>0&&R.includes(`customFields`)&&(Q.attributes=q.map(({description:e,name:t,type:n,values:r,enabledOn:i=[]})=>({description:e||void 0,resources:i,name:t,type:n,values:r.map(({name:e,color:t,description:n})=>({name:e,color:t||void 0,description:n}))}))),Ge.length>0&&(Q.purposes=Ge.map(({name:e,description:t,trackingType:n,defaultConsent:r,configurable:i,showInConsentManager:a,isActive:o,displayOrder:s,optOutSignals:c,authLevel:l,topics:u,showInPrivacyCenter:d,title:f})=>({name:e,title:f,description:t||void 0,trackingType:n,"default-consent":r,configurable:i,"show-in-consent-manager":a,"show-in-privacy-center":d,"is-active":o,"display-order":s,"opt-out-signals":c.length>0?c:void 0,"auth-level":l||void 0,"preference-topics":u.map(({title:e,type:t,displayDescription:n,defaultConfiguration:r,showInPrivacyCenter:i,preferenceOptionValues:a})=>({title:e.defaultMessage,type:t,description:n.defaultMessage,"default-configuration":r,"show-in-privacy-center":i,...a.length>0?{options:a.map(({title:e,slug:t})=>({title:e.defaultMessage,slug:t}))}:{}}))}))),j.length===0&&J.length>0&&R.includes(`templates`)&&(Q.templates=J.map(({title:e})=>({title:e}))),W.length>0&&R.includes(`enrichers`)&&(Q.enrichers=W.map(({title:e,url:t,type:n,inputIdentifier:i,identifiers:a,actions:o,testRegex:s,dataSubjects:c,expirationDuration:l,lookerQueryTitle:u,transitionRequestStatus:d,phoneNumbers:f,regionList:p})=>({title:e,url:t||void 0,type:n,"input-identifier":i?.name,"output-identifiers":a.map(({name:e})=>e),"privacy-actions":Object.values(r).length===o.length?void 0:o,testRegex:s||void 0,lookerQueryTitle:u||void 0,expirationDuration:parseInt(l,10),transitionRequestStatus:d||void 0,phoneNumbers:f&&f.length>0?f:void 0,regionList:p&&p.length>0?p:void 0,"data-subjects":c.map(({type:e})=>e)}))),U.length>0&&R.includes(`dataSilos`)){let e=o(H,`type`);Q[`data-silos`]=U.map(([{title:t,description:n,url:r,type:i,outerType:a,apiKeys:c,notifyEmailAddress:l,identifiers:d,dependentDataSilos:f,owners:p,country:m,countrySubDivision:h,teams:g,subjectBlocklist:_,isLive:v,promptAVendorEmailSendFrequency:y,promptAVendorEmailSendType:b,promptAVendorEmailIncludeIdentifiersAttachment:x,promptAVendorEmailCompletionLinkType:S,manualWorkRetryFrequency:C,catalog:w,attributeValues:T,discoveredBy:E,businessEntities:D},O])=>({title:t,description:n,integrationName:i,"outer-type":a||void 0,url:r||void 0,"api-key-title":c[0]?.title,"identity-keys":d.filter(({isConnected:e})=>e).map(({name:e})=>e),...f.length>0?{"deletion-dependencies":f.map(({title:e})=>e)}:{},...p.length>0?{owners:p.map(({email:e})=>e)}:{},...g.length>0?{teams:g.map(({name:e})=>e)}:{},...E.length>0?{discoveredBy:E.map(({title:e})=>e)}:{},...D.length>0?{businessEntities:D.map(({title:e})=>e)}:{},country:m||void 0,countrySubDivision:h||void 0,disabled:!v,"data-subjects":_.length>0?u(_.map(({type:e})=>e),e):void 0,...w.hasAvcFunctionality?{"email-settings":{"notify-email-address":l||void 0,"send-frequency":y,"send-type":b,"include-identifiers-attachment":x,"completion-link-type":S,"manual-work-retry-frequency":C}}:{},attributes:T!==void 0&&T.length>0?k(T):void 0,datapoints:O.map(e=>({key:e.name,title:e.title?.defaultMessage,description:e.description?.defaultMessage,owners:e.owners.map(({email:e})=>e),teams:e.teams.map(({name:e})=>e),...e.path.length>0?{path:e.path}:{},...e.dataCollection?.title?{"data-collection-tag":e.dataCollection.title.defaultMessage}:{},...e.dbIntegrationQueries.length>0?{"privacy-action-queries":s(o(e.dbIntegrationQueries,`requestType`),e=>e.suggestedQuery||e.query||void 0)}:{},...e.subDataPoints.length>0?{fields:e.subDataPoints.map(e=>({key:e.name,description:e.description,purposes:e.purposes,categories:e.categories,...B&&e.pendingCategoryGuesses?{"guessed-categories":e.pendingCategoryGuesses.filter(e=>e.status===`PENDING`).map(e=>({category:{name:e.category.name,category:e.category.category},status:e.status,confidence:e.confidence,classifierVersion:e.classifierVersion||void 0}))}:{},"access-request-visibility-enabled":e.accessRequestVisibilityEnabled,"erasure-request-redaction-enabled":e.erasureRequestRedactionEnabled,attributes:e.attributeValues!==void 0&&e.attributeValues.length>0?k(e.attributeValues):void 0})).sort((e,t)=>e.key.localeCompare(t.key))}:{},"privacy-actions":e.actionSettings.filter(({active:e})=>e).map(({type:e})=>e)})).sort((e,t)=>[...e.path??[],e.key].join(`.`).localeCompare([...t.path??[],t.key].join(`.`)))}))}return Q}export{F as i,R as n,I as r,L as t};
|
|
58
|
-
//# sourceMappingURL=pullTranscendConfiguration-
|
|
58
|
+
//# sourceMappingURL=pullTranscendConfiguration-nltf79oD.mjs.map
|