@transcend-io/cli 10.0.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -5
- package/dist/{RequestDataSilo-_Iv44M9u.mjs → RequestDataSilo-Rrc2dL9g.mjs} +4 -1
- package/dist/RequestDataSilo-Rrc2dL9g.mjs.map +1 -0
- package/dist/{app-By_zDIkK.mjs → app-Cx8-4u8K.mjs} +21 -21
- package/dist/{app-By_zDIkK.mjs.map → app-Cx8-4u8K.mjs.map} +1 -1
- package/dist/approvePrivacyRequests-Bjq5cPSI.mjs +2 -0
- package/dist/approvePrivacyRequests-Bjq5cPSI.mjs.map +1 -0
- 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-DWs9ImOw.mjs +9 -0
- package/dist/buildXdiSyncEndpoint-DWs9ImOw.mjs.map +1 -0
- package/dist/bulkRestartRequests-sie3tM3W.mjs +2 -0
- package/dist/bulkRestartRequests-sie3tM3W.mjs.map +1 -0
- package/dist/bulkRetryEnrichers-C1RrxiTR.mjs +2 -0
- package/dist/bulkRetryEnrichers-C1RrxiTR.mjs.map +1 -0
- package/dist/cancelPrivacyRequests-DmvFijq_.mjs +2 -0
- package/dist/cancelPrivacyRequests-DmvFijq_.mjs.map +1 -0
- package/dist/{codecs-BE3Wmoh8.mjs → codecs-CeDPaLYa.mjs} +1 -1
- package/dist/{codecs-BE3Wmoh8.mjs.map → codecs-CeDPaLYa.mjs.map} +1 -1
- package/dist/collectCsvFilesOrExit-D-csvd13.mjs +2 -0
- package/dist/collectCsvFilesOrExit-D-csvd13.mjs.map +1 -0
- package/dist/collectParquetFilesOrExit-C8qT5_57.mjs +2 -0
- package/dist/collectParquetFilesOrExit-C8qT5_57.mjs.map +1 -0
- package/dist/{command-BUnCUxva.mjs → command-rzZKmlky.mjs} +2 -2
- package/dist/{command-BUnCUxva.mjs.map → command-rzZKmlky.mjs.map} +1 -1
- package/dist/commands/admin/chunk-csv/worker.d.mts +48 -0
- package/dist/commands/admin/chunk-csv/worker.d.mts.map +1 -0
- package/dist/commands/admin/chunk-csv/worker.mjs +2 -0
- package/dist/commands/admin/chunk-csv/worker.mjs.map +1 -0
- package/dist/commands/admin/parquet-to-csv/worker.d.mts +25 -0
- package/dist/commands/admin/parquet-to-csv/worker.d.mts.map +1 -0
- package/dist/commands/admin/parquet-to-csv/worker.mjs +2 -0
- package/dist/commands/admin/parquet-to-csv/worker.mjs.map +1 -0
- package/dist/{consentManagersToBusinessEntities-BDgOFga7.mjs → consentManagersToBusinessEntities-D1bdBgnA.mjs} +2 -2
- package/dist/{consentManagersToBusinessEntities-BDgOFga7.mjs.map → consentManagersToBusinessEntities-D1bdBgnA.mjs.map} +1 -1
- package/dist/{constants-lIvXgkdp.mjs → constants-DYbzl8QH.mjs} +1 -1
- package/dist/{constants-lIvXgkdp.mjs.map → constants-DYbzl8QH.mjs.map} +1 -1
- package/dist/constants-XOsAW1__.mjs +2 -0
- package/dist/constants-XOsAW1__.mjs.map +1 -0
- package/dist/{constants-AFtS5Nad.mjs → constants-mjLYTIJm.mjs} +2 -2
- package/dist/{constants-AFtS5Nad.mjs.map → constants-mjLYTIJm.mjs.map} +1 -1
- package/dist/{context-CdSyuBlf.mjs → context-bkKpii_t.mjs} +1 -1
- package/dist/{context-CdSyuBlf.mjs.map → context-bkKpii_t.mjs.map} +1 -1
- package/dist/createExtraKeyHandler-Jp5XpTJi.mjs +14 -0
- package/dist/createExtraKeyHandler-Jp5XpTJi.mjs.map +1 -0
- package/dist/{dataFlowsToDataSilos-NhvBw1iy.mjs → dataFlowsToDataSilos-DUj1NhOt.mjs} +1 -1
- package/dist/dataFlowsToDataSilos-DUj1NhOt.mjs.map +1 -0
- package/dist/{dataSilo-DrFetFXw.mjs → dataSilo-Dvi8-PkH.mjs} +1 -1
- package/dist/{dataSilo-DrFetFXw.mjs.map → dataSilo-Dvi8-PkH.mjs.map} +1 -1
- package/dist/{dataSubject-y_aXI0pa.mjs → dataSubject-CF784Ug0.mjs} +1 -1
- package/dist/{dataSubject-y_aXI0pa.mjs.map → dataSubject-CF784Ug0.mjs.map} +1 -1
- package/dist/{done-input-validation-DLR0-MJ7.mjs → done-input-validation-C5rgR0Wr.mjs} +1 -1
- package/dist/{done-input-validation-DLR0-MJ7.mjs.map → done-input-validation-C5rgR0Wr.mjs.map} +1 -1
- package/dist/downloadPrivacyRequestFiles-GUbd_PRc.mjs +2 -0
- package/dist/downloadPrivacyRequestFiles-GUbd_PRc.mjs.map +1 -0
- package/dist/{extractClientError-DPjv09EH.mjs → extractClientError-X9wJVqGq.mjs} +1 -1
- package/dist/{extractClientError-DPjv09EH.mjs.map → extractClientError-X9wJVqGq.mjs.map} +1 -1
- package/dist/{fetchAllRequestEnrichers-q34mRuE5.mjs → fetchAllRequestEnrichers-Bt97Bb7F.mjs} +5 -5
- package/dist/fetchAllRequestEnrichers-Bt97Bb7F.mjs.map +1 -0
- package/dist/fetchAllRequestIdentifiers-BXx3rSee.mjs +10 -0
- package/dist/fetchAllRequestIdentifiers-BXx3rSee.mjs.map +1 -0
- package/dist/fetchAllRequests-xGgt_STo.mjs +2 -0
- package/dist/fetchAllRequests-xGgt_STo.mjs.map +1 -0
- package/dist/fetchRequestDataSilo-0UvyeL60.mjs +2 -0
- package/dist/fetchRequestDataSilo-0UvyeL60.mjs.map +1 -0
- package/dist/{fetchRequestFilesForRequest-DrHGOdih.mjs → fetchRequestFilesForRequest-CJH2iB-P.mjs} +4 -4
- package/dist/fetchRequestFilesForRequest-CJH2iB-P.mjs.map +1 -0
- package/dist/generateCrossAccountApiKeys-DztJoLQS.mjs +2 -0
- package/dist/generateCrossAccountApiKeys-DztJoLQS.mjs.map +1 -0
- package/dist/impl-B-PzeHxN.mjs +2 -0
- package/dist/impl-B-PzeHxN.mjs.map +1 -0
- package/dist/impl-B6TXE2oE.mjs +4 -0
- package/dist/impl-B6TXE2oE.mjs.map +1 -0
- package/dist/impl-BBKJIP0Q.mjs +2 -0
- package/dist/impl-BBKJIP0Q.mjs.map +1 -0
- package/dist/impl-BBnnC5xq.mjs +2 -0
- package/dist/impl-BBnnC5xq.mjs.map +1 -0
- package/dist/impl-BGGm947r2.mjs +2 -0
- package/dist/impl-BGGm947r2.mjs.map +1 -0
- package/dist/{impl-G1brwI4o.mjs → impl-BKrNGF2F.mjs} +2 -2
- package/dist/{impl-G1brwI4o.mjs.map → impl-BKrNGF2F.mjs.map} +1 -1
- package/dist/{impl-DgyjJ8RY2.mjs → impl-BMnXA_Vd.mjs} +2 -2
- package/dist/impl-BMnXA_Vd.mjs.map +1 -0
- package/dist/{impl-Zr8uLP_n.mjs → impl-BRiRfzgu.mjs} +2 -2
- package/dist/{impl-Zr8uLP_n.mjs.map → impl-BRiRfzgu.mjs.map} +1 -1
- package/dist/{impl-CyJBbyuF.mjs → impl-BSKl6rC6.mjs} +2 -2
- package/dist/{impl-CyJBbyuF.mjs.map → impl-BSKl6rC6.mjs.map} +1 -1
- package/dist/impl-BVHfSIVG.mjs +2 -0
- package/dist/{impl-ArGeiHuz.mjs.map → impl-BVHfSIVG.mjs.map} +1 -1
- package/dist/impl-BVnfUDUm.mjs +2 -0
- package/dist/impl-BVnfUDUm.mjs.map +1 -0
- package/dist/impl-BfeWet_F2.mjs +2 -0
- package/dist/impl-BfeWet_F2.mjs.map +1 -0
- package/dist/{impl--Lmj1RHh2.mjs → impl-BffzTHKU.mjs} +2 -2
- package/dist/impl-BffzTHKU.mjs.map +1 -0
- package/dist/impl-BxOydpyJ.mjs +2 -0
- package/dist/impl-BxOydpyJ.mjs.map +1 -0
- package/dist/{impl-r8tHyAHB.mjs → impl-C-u5h8We.mjs} +2 -2
- package/dist/{impl-r8tHyAHB.mjs.map → impl-C-u5h8We.mjs.map} +1 -1
- package/dist/{impl-Cq_RqK0_2.mjs → impl-C3DXXn8M.mjs} +2 -2
- package/dist/impl-C3DXXn8M.mjs.map +1 -0
- package/dist/{impl-KV3yZaHz2.mjs → impl-CC0rkA9s.mjs} +2 -2
- package/dist/impl-CC0rkA9s.mjs.map +1 -0
- package/dist/impl-CODwodEc.mjs +7 -0
- package/dist/impl-CODwodEc.mjs.map +1 -0
- package/dist/impl-CPIMsZg-.mjs +2 -0
- package/dist/{impl-BkyC7nnu.mjs.map → impl-CPIMsZg-.mjs.map} +1 -1
- package/dist/{impl-D-ldjJzl2.mjs → impl-CZsYoSZQ.mjs} +2 -2
- package/dist/impl-CZsYoSZQ.mjs.map +1 -0
- package/dist/impl-CnHiD4zU.mjs +2 -0
- package/dist/impl-CnHiD4zU.mjs.map +1 -0
- package/dist/impl-CpJljZV2.mjs +2 -0
- package/dist/impl-CpJljZV2.mjs.map +1 -0
- package/dist/impl-Cpndlxar.mjs +4 -0
- package/dist/impl-Cpndlxar.mjs.map +1 -0
- package/dist/{impl-1U4QBT_L.mjs → impl-CqH3YYuv.mjs} +2 -2
- package/dist/impl-CqH3YYuv.mjs.map +1 -0
- package/dist/{impl-C05tQHSq.mjs → impl-CvJtt8H2.mjs} +2 -2
- package/dist/{impl-C05tQHSq.mjs.map → impl-CvJtt8H2.mjs.map} +1 -1
- package/dist/impl-Cw10WeUv.mjs +2 -0
- package/dist/impl-Cw10WeUv.mjs.map +1 -0
- package/dist/{impl-CMX0qQr_2.mjs → impl-Cy8-6_Oo2.mjs} +2 -2
- package/dist/{impl-CMX0qQr_2.mjs.map → impl-Cy8-6_Oo2.mjs.map} +1 -1
- package/dist/{impl-DZnSlfwn2.mjs → impl-DJ4VCAcc.mjs} +2 -2
- package/dist/impl-DJ4VCAcc.mjs.map +1 -0
- package/dist/impl-DKAV-8XC.mjs +3 -0
- package/dist/impl-DKAV-8XC.mjs.map +1 -0
- package/dist/{impl-y1I9Muyc2.mjs → impl-D_AxguFh2.mjs} +2 -2
- package/dist/{impl-y1I9Muyc2.mjs.map → impl-D_AxguFh2.mjs.map} +1 -1
- package/dist/{impl-D-cp0CYr.mjs → impl-DaK9UOwL.mjs} +2 -2
- package/dist/{impl-D-cp0CYr.mjs.map → impl-DaK9UOwL.mjs.map} +1 -1
- package/dist/{impl-Cgg_bv7j.mjs → impl-DfVep2mE.mjs} +2 -2
- package/dist/{impl-Cgg_bv7j.mjs.map → impl-DfVep2mE.mjs.map} +1 -1
- package/dist/impl-DhXQb3bm.mjs +2 -0
- package/dist/impl-DhXQb3bm.mjs.map +1 -0
- package/dist/impl-DpGVNllB.mjs +2 -0
- package/dist/impl-DpGVNllB.mjs.map +1 -0
- package/dist/impl-DpwyYsfg.mjs +2 -0
- package/dist/impl-DpwyYsfg.mjs.map +1 -0
- package/dist/impl-DvrSuAJv.mjs +12 -0
- package/dist/impl-DvrSuAJv.mjs.map +1 -0
- package/dist/{impl-CeLfAnyA2.mjs → impl-Dw9uW5zy2.mjs} +2 -2
- package/dist/{impl-CeLfAnyA2.mjs.map → impl-Dw9uW5zy2.mjs.map} +1 -1
- package/dist/impl-PdIU1pLr2.mjs +2 -0
- package/dist/impl-PdIU1pLr2.mjs.map +1 -0
- package/dist/{impl-BpUksm1b2.mjs → impl-StdJMCiM.mjs} +2 -2
- package/dist/impl-StdJMCiM.mjs.map +1 -0
- package/dist/impl-daUiLV3c.mjs +2 -0
- package/dist/impl-daUiLV3c.mjs.map +1 -0
- package/dist/{impl-Rt3C_fDF.mjs → impl-iGMjSniP.mjs} +2 -2
- package/dist/{impl-Rt3C_fDF.mjs.map → impl-iGMjSniP.mjs.map} +1 -1
- package/dist/impl-ogUHfunr.mjs +2 -0
- package/dist/impl-ogUHfunr.mjs.map +1 -0
- package/dist/impl-uwkj-RbF.mjs +2 -0
- package/dist/impl-uwkj-RbF.mjs.map +1 -0
- package/dist/{impl-D6nwGrO8.mjs → impl-yvc0y1uO.mjs} +2 -2
- package/dist/{impl-D6nwGrO8.mjs.map → impl-yvc0y1uO.mjs.map} +1 -1
- package/dist/index.d.mts +4143 -7330
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -78
- package/dist/index.mjs.map +1 -1
- package/dist/{inquirer-BgNcicZ4.mjs → inquirer-DyRwhvoh.mjs} +2 -2
- package/dist/{inquirer-BgNcicZ4.mjs.map → inquirer-DyRwhvoh.mjs.map} +1 -1
- package/dist/{listFiles-qzyQMaYH.mjs → listFiles-Odj7j2E1.mjs} +1 -1
- package/dist/{listFiles-qzyQMaYH.mjs.map → listFiles-Odj7j2E1.mjs.map} +1 -1
- package/dist/{logger-B-LXIf3U.mjs → logger-Bj782ZYD.mjs} +1 -1
- package/dist/{logger-B-LXIf3U.mjs.map → logger-Bj782ZYD.mjs.map} +1 -1
- package/dist/markRequestDataSiloIdsCompleted-DJSICILv.mjs +2 -0
- package/dist/markRequestDataSiloIdsCompleted-DJSICILv.mjs.map +1 -0
- package/dist/markSilentPrivacyRequests-ytCzpUkY.mjs +2 -0
- package/dist/markSilentPrivacyRequests-ytCzpUkY.mjs.map +1 -0
- package/dist/notifyPrivacyRequestsAdditionalTime-D8v68eAg.mjs +2 -0
- package/dist/notifyPrivacyRequestsAdditionalTime-D8v68eAg.mjs.map +1 -0
- package/dist/parquetToCsvOneFile-bgEgRoAi.mjs +6 -0
- package/dist/parquetToCsvOneFile-bgEgRoAi.mjs.map +1 -0
- package/dist/parseAttributesFromString-B8h4DudO.mjs +2 -0
- package/dist/{parseAttributesFromString-CZStzJc0.mjs.map → parseAttributesFromString-B8h4DudO.mjs.map} +1 -1
- package/dist/parseVariablesFromString-CvoeZZ75.mjs +23 -0
- package/dist/parseVariablesFromString-CvoeZZ75.mjs.map +1 -0
- package/dist/pullAllDatapoints-CqgqXRbp.mjs +45 -0
- package/dist/pullAllDatapoints-CqgqXRbp.mjs.map +1 -0
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DaYEDZ66.mjs +2 -0
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DaYEDZ66.mjs.map +1 -0
- package/dist/pullConsentManagerMetrics-BO0hYPDG.mjs +2 -0
- package/dist/pullConsentManagerMetrics-BO0hYPDG.mjs.map +1 -0
- package/dist/pullManualEnrichmentIdentifiersToCsv-BNuhsG20.mjs +2 -0
- package/dist/pullManualEnrichmentIdentifiersToCsv-BNuhsG20.mjs.map +1 -0
- package/dist/pullTranscendConfiguration-DSyMRyPe.mjs +58 -0
- package/dist/pullTranscendConfiguration-DSyMRyPe.mjs.map +1 -0
- package/dist/{pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs → pullUnstructuredSubDataPointRecommendations-jE-tdoVK.mjs} +4 -4
- package/dist/pullUnstructuredSubDataPointRecommendations-jE-tdoVK.mjs.map +1 -0
- package/dist/pushCronIdentifiersFromCsv-D9Hzna0W.mjs +2 -0
- package/dist/pushCronIdentifiersFromCsv-D9Hzna0W.mjs.map +1 -0
- package/dist/pushManualEnrichmentIdentifiersFromCsv-BiR7PS_d.mjs +2 -0
- package/dist/pushManualEnrichmentIdentifiersFromCsv-BiR7PS_d.mjs.map +1 -0
- package/dist/{readCsv-CyOL7eCc.mjs → readCsv-0PIlJQCN.mjs} +1 -1
- package/dist/{readCsv-CyOL7eCc.mjs.map → readCsv-0PIlJQCN.mjs.map} +1 -1
- package/dist/{readTranscendYaml-D-J1ilS0.mjs → readTranscendYaml-DVkQL2SC.mjs} +2 -2
- package/dist/{readTranscendYaml-D-J1ilS0.mjs.map → readTranscendYaml-DVkQL2SC.mjs.map} +1 -1
- package/dist/removeUnverifiedRequestIdentifiers-B0Gx09XN.mjs +35 -0
- package/dist/removeUnverifiedRequestIdentifiers-B0Gx09XN.mjs.map +1 -0
- package/dist/{request-CAsR6CMY.mjs → request-SLqRySNU.mjs} +1 -1
- package/dist/{request-CAsR6CMY.mjs.map → request-SLqRySNU.mjs.map} +1 -1
- package/dist/retryRequestDataSilos-DFjFhhC0.mjs +2 -0
- package/dist/retryRequestDataSilos-DFjFhhC0.mjs.map +1 -0
- package/dist/skipPreflightJobs-Bm8lZZk-.mjs +2 -0
- package/dist/skipPreflightJobs-Bm8lZZk-.mjs.map +1 -0
- package/dist/skipRequestDataSilos-B5FByYTj.mjs +2 -0
- package/dist/skipRequestDataSilos-B5FByYTj.mjs.map +1 -0
- package/dist/streamPrivacyRequestsToCsv-CBzh80oQ.mjs +2 -0
- package/dist/streamPrivacyRequestsToCsv-CBzh80oQ.mjs.map +1 -0
- package/dist/syncCodePackages-BOS5foh6.mjs +2 -0
- package/dist/syncCodePackages-BOS5foh6.mjs.map +1 -0
- package/dist/syncEnrichers-C9HcWCrs.mjs +3 -0
- package/dist/syncEnrichers-C9HcWCrs.mjs.map +1 -0
- package/dist/updateConsentManagerVersionToLatest-X1HAM_IX.mjs +2 -0
- package/dist/updateConsentManagerVersionToLatest-X1HAM_IX.mjs.map +1 -0
- package/dist/uploadConsents-BP5XILuw.mjs +2 -0
- package/dist/uploadConsents-BP5XILuw.mjs.map +1 -0
- package/dist/uploadCookiesFromCsv-B42cZgYW.mjs +2 -0
- package/dist/uploadCookiesFromCsv-B42cZgYW.mjs.map +1 -0
- package/dist/uploadDataFlowsFromCsv-D2V567pP.mjs +2 -0
- package/dist/uploadDataFlowsFromCsv-D2V567pP.mjs.map +1 -0
- package/dist/uploadPrivacyRequestsFromCsv-Czc3vGfJ.mjs +2 -0
- package/dist/uploadPrivacyRequestsFromCsv-Czc3vGfJ.mjs.map +1 -0
- package/dist/{validateTranscendAuth-1W1IylqE.mjs → validateTranscendAuth-DCwAtgvh.mjs} +2 -2
- package/dist/{validateTranscendAuth-1W1IylqE.mjs.map → validateTranscendAuth-DCwAtgvh.mjs.map} +1 -1
- package/dist/{writeCsv-B51ulrVl.mjs → writeCsv-Da8NUe1V.mjs} +1 -1
- package/dist/{writeCsv-B51ulrVl.mjs.map → writeCsv-Da8NUe1V.mjs.map} +1 -1
- package/package.json +15 -12
- package/dist/RateCounter-DFL_mnk2.mjs +0 -2
- package/dist/RateCounter-DFL_mnk2.mjs.map +0 -1
- package/dist/RequestDataSilo-_Iv44M9u.mjs.map +0 -1
- package/dist/approvePrivacyRequests-1cguqGqq.mjs +0 -2
- package/dist/approvePrivacyRequests-1cguqGqq.mjs.map +0 -1
- package/dist/assessment-BDywVaGR.mjs +0 -284
- package/dist/assessment-BDywVaGR.mjs.map +0 -1
- package/dist/bluebird-CUitXgsY.mjs +0 -2
- package/dist/bluebird-CUitXgsY.mjs.map +0 -1
- package/dist/buildXdiSyncEndpoint-BMaMHO7Z.mjs +0 -9
- package/dist/buildXdiSyncEndpoint-BMaMHO7Z.mjs.map +0 -1
- package/dist/bulkRestartRequests-DEPSHov-.mjs +0 -2
- package/dist/bulkRestartRequests-DEPSHov-.mjs.map +0 -1
- package/dist/bulkRetryEnrichers-BLkcFKXC.mjs +0 -2
- package/dist/bulkRetryEnrichers-BLkcFKXC.mjs.map +0 -1
- package/dist/cancelPrivacyRequests-C8MZQvsq.mjs +0 -2
- package/dist/cancelPrivacyRequests-C8MZQvsq.mjs.map +0 -1
- package/dist/codecs-Dx_vGxsl.mjs +0 -2
- package/dist/codecs-Dx_vGxsl.mjs.map +0 -1
- package/dist/constants-CeMiHaHx.mjs +0 -2
- package/dist/constants-CeMiHaHx.mjs.map +0 -1
- package/dist/createExtraKeyHandler-C_0EVj10.mjs +0 -23
- package/dist/createExtraKeyHandler-C_0EVj10.mjs.map +0 -1
- package/dist/createPreferenceAccessTokens-6WLr6z-l.mjs +0 -10
- package/dist/createPreferenceAccessTokens-6WLr6z-l.mjs.map +0 -1
- package/dist/createSombraGotInstance-CahOgD6V.mjs +0 -10
- package/dist/createSombraGotInstance-CahOgD6V.mjs.map +0 -1
- package/dist/dataFlowsToDataSilos-NhvBw1iy.mjs.map +0 -1
- package/dist/downloadPrivacyRequestFiles-B2yduagB.mjs +0 -2
- package/dist/downloadPrivacyRequestFiles-B2yduagB.mjs.map +0 -1
- package/dist/extractErrorMessage-CPnTsT1S.mjs +0 -2
- package/dist/extractErrorMessage-CPnTsT1S.mjs.map +0 -1
- package/dist/fetchAllActions-C0l3wjQV.mjs +0 -832
- package/dist/fetchAllActions-C0l3wjQV.mjs.map +0 -1
- package/dist/fetchAllDataFlows-AQ9j_NRa.mjs +0 -2
- package/dist/fetchAllDataFlows-AQ9j_NRa.mjs.map +0 -1
- package/dist/fetchAllPreferenceTopics-Bn9PG-rO.mjs +0 -36
- package/dist/fetchAllPreferenceTopics-Bn9PG-rO.mjs.map +0 -1
- package/dist/fetchAllPurposes-CykSkZRY.mjs +0 -29
- package/dist/fetchAllPurposes-CykSkZRY.mjs.map +0 -1
- package/dist/fetchAllPurposesAndPreferences-Dog6N9L2.mjs +0 -2
- package/dist/fetchAllPurposesAndPreferences-Dog6N9L2.mjs.map +0 -1
- package/dist/fetchAllRequestEnrichers-q34mRuE5.mjs.map +0 -1
- package/dist/fetchAllRequestIdentifiers-YP-geTV4.mjs +0 -10
- package/dist/fetchAllRequestIdentifiers-YP-geTV4.mjs.map +0 -1
- package/dist/fetchAllRequests-DEPTEUbi.mjs +0 -2
- package/dist/fetchAllRequests-DEPTEUbi.mjs.map +0 -1
- package/dist/fetchApiKeys-DkBco7W0.mjs +0 -33
- package/dist/fetchApiKeys-DkBco7W0.mjs.map +0 -1
- package/dist/fetchCatalogs-CBk871k6.mjs +0 -12
- package/dist/fetchCatalogs-CBk871k6.mjs.map +0 -1
- package/dist/fetchConsentManagerId-DHDA5Py9.mjs +0 -321
- package/dist/fetchConsentManagerId-DHDA5Py9.mjs.map +0 -1
- package/dist/fetchIdentifiers-DjqjUnaw.mjs +0 -54
- package/dist/fetchIdentifiers-DjqjUnaw.mjs.map +0 -1
- package/dist/fetchRequestDataSilo-CF6XOTQ-.mjs +0 -2
- package/dist/fetchRequestDataSilo-CF6XOTQ-.mjs.map +0 -1
- package/dist/fetchRequestFilesForRequest-DrHGOdih.mjs.map +0 -1
- package/dist/generateCrossAccountApiKeys-F11uqpc5.mjs +0 -33
- package/dist/generateCrossAccountApiKeys-F11uqpc5.mjs.map +0 -1
- package/dist/impl--Lmj1RHh2.mjs.map +0 -1
- package/dist/impl-0ooudQ_J2.mjs +0 -4
- package/dist/impl-0ooudQ_J2.mjs.map +0 -1
- package/dist/impl-1U4QBT_L.mjs.map +0 -1
- package/dist/impl-2FbPcOv_2.mjs +0 -2
- package/dist/impl-2FbPcOv_2.mjs.map +0 -1
- package/dist/impl-ArGeiHuz.mjs +0 -2
- package/dist/impl-B8iVBYdg.mjs +0 -2
- package/dist/impl-B8iVBYdg.mjs.map +0 -1
- package/dist/impl-BWjBYTQZ.mjs +0 -2
- package/dist/impl-BWjBYTQZ.mjs.map +0 -1
- package/dist/impl-Bc8Es_bT.mjs +0 -7
- package/dist/impl-Bc8Es_bT.mjs.map +0 -1
- package/dist/impl-BkyC7nnu.mjs +0 -2
- package/dist/impl-BpUksm1b2.mjs.map +0 -1
- package/dist/impl-BzupMfJi.mjs +0 -12
- package/dist/impl-BzupMfJi.mjs.map +0 -1
- package/dist/impl-CWHnw3oX.mjs +0 -2
- package/dist/impl-CWHnw3oX.mjs.map +0 -1
- package/dist/impl-CXK-D84c.mjs +0 -4
- package/dist/impl-CXK-D84c.mjs.map +0 -1
- package/dist/impl-CdoTu8TH.mjs +0 -2
- package/dist/impl-CdoTu8TH.mjs.map +0 -1
- package/dist/impl-CoLIqiH-2.mjs +0 -2
- package/dist/impl-CoLIqiH-2.mjs.map +0 -1
- package/dist/impl-Cq_RqK0_2.mjs.map +0 -1
- package/dist/impl-Cwj9LeEI.mjs +0 -3
- package/dist/impl-Cwj9LeEI.mjs.map +0 -1
- package/dist/impl-D-ldjJzl2.mjs.map +0 -1
- package/dist/impl-DGRuk3AB.mjs +0 -2
- package/dist/impl-DGRuk3AB.mjs.map +0 -1
- package/dist/impl-DXWN22xV.mjs +0 -2
- package/dist/impl-DXWN22xV.mjs.map +0 -1
- package/dist/impl-DZnSlfwn2.mjs.map +0 -1
- package/dist/impl-DcC8_dCy.mjs +0 -2
- package/dist/impl-DcC8_dCy.mjs.map +0 -1
- package/dist/impl-Dfc_yQML2.mjs +0 -2
- package/dist/impl-Dfc_yQML2.mjs.map +0 -1
- package/dist/impl-DgyjJ8RY2.mjs.map +0 -1
- package/dist/impl-DhIyASha.mjs +0 -2
- package/dist/impl-DhIyASha.mjs.map +0 -1
- package/dist/impl-Dny1LX9A.mjs +0 -2
- package/dist/impl-Dny1LX9A.mjs.map +0 -1
- package/dist/impl-KV3yZaHz2.mjs.map +0 -1
- package/dist/impl-VHp2K2bg.mjs +0 -2
- package/dist/impl-VHp2K2bg.mjs.map +0 -1
- package/dist/impl-dEQtD5uE.mjs +0 -2
- package/dist/impl-dEQtD5uE.mjs.map +0 -1
- package/dist/impl-dlRlTYAQ.mjs +0 -2
- package/dist/impl-dlRlTYAQ.mjs.map +0 -1
- package/dist/impl-f4UPMoS_2.mjs +0 -2
- package/dist/impl-f4UPMoS_2.mjs.map +0 -1
- package/dist/impl-ph0q6K3i.mjs +0 -2
- package/dist/impl-ph0q6K3i.mjs.map +0 -1
- package/dist/makeGraphQLRequest-G078PsEL.mjs +0 -2
- package/dist/makeGraphQLRequest-G078PsEL.mjs.map +0 -1
- package/dist/markRequestDataSiloIdsCompleted-DmAz-R0M.mjs +0 -2
- package/dist/markRequestDataSiloIdsCompleted-DmAz-R0M.mjs.map +0 -1
- package/dist/markSilentPrivacyRequests-s7_aBROE.mjs +0 -2
- package/dist/markSilentPrivacyRequests-s7_aBROE.mjs.map +0 -1
- package/dist/mergeTranscendInputs-C64BJsse.mjs +0 -2
- package/dist/mergeTranscendInputs-C64BJsse.mjs.map +0 -1
- package/dist/notifyPrivacyRequestsAdditionalTime-BvXIXZYu.mjs +0 -2
- package/dist/notifyPrivacyRequestsAdditionalTime-BvXIXZYu.mjs.map +0 -1
- package/dist/package-BjNQxHlz.mjs +0 -2
- package/dist/package-BjNQxHlz.mjs.map +0 -1
- package/dist/parquetToCsvOneFile-DZVKXrjn.mjs +0 -6
- package/dist/parquetToCsvOneFile-DZVKXrjn.mjs.map +0 -1
- package/dist/parseAttributesFromString-CZStzJc0.mjs +0 -2
- package/dist/pullAllDatapoints-DiMWp8a7.mjs +0 -45
- package/dist/pullAllDatapoints-DiMWp8a7.mjs.map +0 -1
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs +0 -2
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-DgWgggQt.mjs.map +0 -1
- package/dist/pullConsentManagerMetrics-pFRPXTHJ.mjs +0 -2
- package/dist/pullConsentManagerMetrics-pFRPXTHJ.mjs.map +0 -1
- package/dist/pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs +0 -2
- package/dist/pullManualEnrichmentIdentifiersToCsv-DA_4rIzW.mjs.map +0 -1
- package/dist/pullTranscendConfiguration-D2cYlu6V.mjs +0 -80
- package/dist/pullTranscendConfiguration-D2cYlu6V.mjs.map +0 -1
- package/dist/pullUnstructuredSubDataPointRecommendations-C4aVhH-W.mjs.map +0 -1
- package/dist/pushCronIdentifiersFromCsv-C34TB9tG.mjs +0 -2
- package/dist/pushCronIdentifiersFromCsv-C34TB9tG.mjs.map +0 -1
- package/dist/pushManualEnrichmentIdentifiersFromCsv-CGS9E3Ft.mjs +0 -2
- package/dist/pushManualEnrichmentIdentifiersFromCsv-CGS9E3Ft.mjs.map +0 -1
- package/dist/removeUnverifiedRequestIdentifiers-pGGOFbfE.mjs +0 -35
- package/dist/removeUnverifiedRequestIdentifiers-pGGOFbfE.mjs.map +0 -1
- package/dist/retryRequestDataSilos-DXwN5uPw.mjs +0 -2
- package/dist/retryRequestDataSilos-DXwN5uPw.mjs.map +0 -1
- package/dist/skipPreflightJobs-BNQhuPZ8.mjs +0 -2
- package/dist/skipPreflightJobs-BNQhuPZ8.mjs.map +0 -1
- package/dist/skipRequestDataSilos-C39ji4lO.mjs +0 -2
- package/dist/skipRequestDataSilos-C39ji4lO.mjs.map +0 -1
- package/dist/splitCsvToList-BRq_CIfd.mjs +0 -2
- package/dist/splitCsvToList-BRq_CIfd.mjs.map +0 -1
- package/dist/streamPrivacyRequestsToCsv-C8lquiyd.mjs +0 -2
- package/dist/streamPrivacyRequestsToCsv-C8lquiyd.mjs.map +0 -1
- package/dist/syncCodePackages-BHgjfXCI.mjs +0 -232
- package/dist/syncCodePackages-BHgjfXCI.mjs.map +0 -1
- package/dist/syncCookies-CiLtxDFf.mjs +0 -2
- package/dist/syncCookies-CiLtxDFf.mjs.map +0 -1
- package/dist/syncDataFlows-DmBUs3G_.mjs +0 -2
- package/dist/syncDataFlows-DmBUs3G_.mjs.map +0 -1
- package/dist/syncTemplates-BNu1_dmW.mjs +0 -23
- package/dist/syncTemplates-BNu1_dmW.mjs.map +0 -1
- package/dist/time-Bl_c3W8U.mjs +0 -2
- package/dist/time-Bl_c3W8U.mjs.map +0 -1
- package/dist/types-B4CVJCpj.mjs +0 -2
- package/dist/types-B4CVJCpj.mjs.map +0 -1
- package/dist/updateConsentManagerVersionToLatest-BBMN94Hs.mjs +0 -2
- package/dist/updateConsentManagerVersionToLatest-BBMN94Hs.mjs.map +0 -1
- package/dist/uploadConsents-BbR7_sSt.mjs +0 -2
- package/dist/uploadConsents-BbR7_sSt.mjs.map +0 -1
- package/dist/uploadCookiesFromCsv-BKZx_E_2.mjs +0 -2
- package/dist/uploadCookiesFromCsv-BKZx_E_2.mjs.map +0 -1
- package/dist/uploadDataFlowsFromCsv-CJFVLvCJ.mjs +0 -2
- package/dist/uploadDataFlowsFromCsv-CJFVLvCJ.mjs.map +0 -1
- package/dist/uploadPrivacyRequestsFromCsv-BmP1JluQ.mjs +0 -17
- package/dist/uploadPrivacyRequestsFromCsv-BmP1JluQ.mjs.map +0 -1
- package/dist/uploadSiloDiscoveryResults-XpDp2u35.mjs +0 -20
- package/dist/uploadSiloDiscoveryResults-XpDp2u35.mjs.map +0 -1
- package/dist/withPreferenceRetry-Cb5S310L.mjs +0 -2
- package/dist/withPreferenceRetry-Cb5S310L.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RateCounter-DFL_mnk2.mjs","names":[],"sources":["../src/lib/helpers/RateCounter.ts"],"sourcesContent":["/**\n * Tracks counts over time and calculates rates within a specified time window.\n *\n * This class maintains a rolling window of count \"buckets\" (timestamped values)\n * and provides methods to add new counts and compute the rate of events over a\n * configurable time window.\n *\n * Example usage:\n * ```typescript\n * const counter = new RateCounter();\n * counter.add(5); // Add 5 events\n * const rate = counter.rate(60_000); // Get rate over last 60 seconds\n * ```\n */\nexport class RateCounter {\n private buckets: Array<{\n /** Timestamp of the bucket */\n t: number;\n /** Number of events in the bucket */\n n: number;\n }> = [];\n\n /**\n * Adds a new count to the counter.\n *\n * @param n - The number of events to add to the counter.\n */\n add(n: number): void {\n const now = Date.now();\n this.buckets.push({ t: now, n });\n // keep last 2 minutes of buckets\n const cutoff = now - 120_000;\n while (this.buckets.length && this.buckets[0].t < cutoff) {\n this.buckets.shift();\n }\n }\n\n /**\n * rate over the last `windowMs` milliseconds\n *\n * @param windowMs - The time window in milliseconds to calculate the rate over.\n * @returns The average rate of events per second over the specified time window.\n */\n rate(windowMs: number): number {\n const now = Date.now();\n const cutoff = now - windowMs;\n let sum = 0;\n for (let i = this.buckets.length - 1; i >= 0; i -= 1) {\n const b = this.buckets[i];\n if (b.t < cutoff) break;\n sum += b.n;\n }\n return sum / (windowMs / 1000);\n }\n}\n"],"mappings":"AAcA,IAAa,EAAb,KAAyB,CACvB,QAKK,EAAE,CAOP,IAAI,EAAiB,CACnB,IAAM,EAAM,KAAK,KAAK,CACtB,KAAK,QAAQ,KAAK,CAAK,EAAK,IAAG,CAAC,CAEhC,IAAM,EAAS,EAAM,KACrB,KAAO,KAAK,QAAQ,QAAU,KAAK,QAAQ,GAAG,EAAI,GAChD,KAAK,QAAQ,OAAO,CAUxB,KAAK,EAA0B,CAE7B,IAAM,EADM,KAAK,KAAK,CACD,EACjB,EAAM,EACV,IAAK,IAAI,EAAI,KAAK,QAAQ,OAAS,EAAG,GAAK,EAAG,IAAQ,CACpD,IAAM,EAAI,KAAK,QAAQ,GACvB,GAAI,EAAE,EAAI,EAAQ,MAClB,GAAO,EAAE,EAEX,OAAO,GAAO,EAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDataSilo-_Iv44M9u.mjs","names":[],"sources":["../src/lib/graphql/gqls/RequestDataSilo.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\nexport const REQUEST_DATA_SILOS = gql`\n query TranscendCliRequestDataSilos(\n $first: Int!\n $offset: Int!\n $filterBy: RequestDataSiloFiltersInput!\n ) {\n requestDataSilos(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n orderBy: [\n { field: createdAt, direction: DESC }\n { field: title, direction: ASC, model: dataSilo }\n ]\n ) {\n nodes {\n id\n }\n totalCount\n }\n }\n`;\n\nexport const CHANGE_REQUEST_DATA_SILO_STATUS = gql`\n mutation TranscendCliMarkRequestDataSiloCompleted(\n $requestDataSiloId: ID!\n $status: UpdateRequestDataSiloStatus!\n ) {\n changeRequestDataSiloStatus(input: { id: $requestDataSiloId, status: $status }) {\n requestDataSilo {\n id\n }\n }\n }\n`;\n\nexport const RETRY_REQUEST_DATA_SILO = gql`\n mutation TranscendCliRetryRequestDataSilo($requestDataSiloId: ID!) {\n retryRequestDataSilo(id: $requestDataSiloId) {\n requestDataSilo {\n id\n }\n }\n }\n`;\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\n// orderBy: [\n// { field: createdAt, direction: DESC }\n// { field: title, direction: ASC, model: dataSilo }\n// ]\nexport const REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = gql`\n query TranscendCliListReducedRequestsForDataSiloCount(\n $input: BulkCompletionReducedRequestInput!\n ) {\n listReducedRequestsForDataSilo(input: $input) {\n totalCount\n }\n }\n`;\n"],"mappings":"sCAIA,MAAa,EAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;EAwBxB,EAAkC,CAAG;;;;;;;;;;;EAarC,EAA0B,CAAG;;;;;;;;EAiB7B,EAAuC,CAAG"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./bluebird-CUitXgsY.mjs";import{o as r,t as i}from"./request-CAsR6CMY.mjs";import{r as a,t as o}from"./makeGraphQLRequest-G078PsEL.mjs";import{r as s}from"./fetchAllRequests-DEPTEUbi.mjs";import{RequestStatus as c}from"@transcend-io/privacy-types";import l from"colors";import u from"cli-progress";async function d({requestActions:d,requestOrigins:f,auth:p,silentModeBefore:m,createdAtAfter:h,createdAtBefore:g,updatedAtBefore:_,updatedAtAfter:v,concurrency:y=50,transcendUrl:b=e}){let x=a(b,p),S=new Date().getTime(),C=new u.SingleBar({},u.Presets.shades_classic),w=await s(x,{actions:d,statuses:[c.Approving],createdAtAfter:h,createdAtBefore:g,updatedAtBefore:_,updatedAtAfter:v,origins:f});t.info(l.magenta(`Approving "${w.length}" requests.`));let T=0,E=0;C.start(w.length,0),await n(w,async e=>{m&&new Date(m)>new Date(e.createdAt)&&await o(x,r,{input:{id:e.id,isSilent:!0}});try{await o(x,i,{input:{requestId:e.id}})}catch(e){e.message.includes(`Request must be in an approving state,`)&&(E+=1)}T+=1,C.update(T)},{concurrency:y}),C.stop();let D=new Date().getTime()-S;return E>0&&t.info(l.yellow(`${E} requests were skipped.`)),t.info(l.green(`Successfully approved ${T} requests in "${D/1e3}" seconds!`)),w.length}export{d as t};
|
|
2
|
-
//# sourceMappingURL=approvePrivacyRequests-1cguqGqq.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"approvePrivacyRequests-1cguqGqq.mjs","names":[],"sources":["../src/lib/requests/approvePrivacyRequests.ts"],"sourcesContent":["import { RequestAction, RequestOrigin, RequestStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { map } from '../bluebird.js';\nimport {\n UPDATE_PRIVACY_REQUEST,\n fetchAllRequests,\n makeGraphQLRequest,\n buildTranscendGraphQLClient,\n APPROVE_PRIVACY_REQUEST,\n} from '../graphql/index.js';\n\n/**\n * Approve a set of privacy requests\n *\n * @param options - Options\n * @returns The number of requests approved\n */\nexport async function approvePrivacyRequests({\n requestActions,\n requestOrigins,\n auth,\n silentModeBefore,\n createdAtAfter,\n createdAtBefore,\n updatedAtBefore,\n updatedAtAfter,\n concurrency = 50,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The request actions that should be restarted */\n requestActions: RequestAction[];\n /** The request origins that should be restarted */\n requestOrigins?: RequestOrigin[];\n /** Transcend API key authentication */\n auth: string;\n /** Concurrency limit for approving */\n concurrency?: number;\n /** Mark these requests as silent mode if they were created before this date */\n silentModeBefore?: Date;\n /** Filter for requests created before this date */\n createdAtBefore?: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<number> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\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\n // Pull in the requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Approving],\n createdAtAfter,\n createdAtBefore,\n updatedAtBefore,\n updatedAtAfter,\n origins: requestOrigins,\n });\n\n // Notify Transcend\n logger.info(colors.magenta(`Approving \"${allRequests.length}\" requests.`));\n\n let total = 0;\n let skipped = 0;\n progressBar.start(allRequests.length, 0);\n await map(\n allRequests,\n async (requestToApprove) => {\n // update request to silent mode if silentModeBefore is defined\n // and the request was created before silentModeBefore\n if (silentModeBefore && new Date(silentModeBefore) > new Date(requestToApprove.createdAt)) {\n await makeGraphQLRequest(client, UPDATE_PRIVACY_REQUEST, {\n input: {\n id: requestToApprove.id,\n isSilent: true,\n },\n });\n }\n\n try {\n // approve the request\n await makeGraphQLRequest(client, APPROVE_PRIVACY_REQUEST, {\n input: { requestId: requestToApprove.id },\n });\n } catch (err) {\n if (err.message.includes('Request must be in an approving state,')) {\n skipped += 1;\n }\n }\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n if (skipped > 0) {\n logger.info(colors.yellow(`${skipped} requests were skipped.`));\n }\n logger.info(\n colors.green(`Successfully approved ${total} requests in \"${totalTime / 1000}\" seconds!`),\n );\n return allRequests.length;\n}\n"],"mappings":"+YAqBA,eAAsB,EAAuB,CAC3C,iBACA,iBACA,OACA,mBACA,iBACA,kBACA,kBACA,iBACA,cAAc,GACd,eAAe,GAsBG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,SAAU,CAAC,EAAc,UAAU,CACnC,iBACA,kBACA,kBACA,iBACA,QAAS,EACV,CAAC,CAGF,EAAO,KAAK,EAAO,QAAQ,cAAc,EAAY,OAAO,aAAa,CAAC,CAE1E,IAAI,EAAQ,EACR,EAAU,EACd,EAAY,MAAM,EAAY,OAAQ,EAAE,CACxC,MAAM,EACJ,EACA,KAAO,IAAqB,CAGtB,GAAoB,IAAI,KAAK,EAAiB,CAAG,IAAI,KAAK,EAAiB,UAAU,EACvF,MAAM,EAAmB,EAAQ,EAAwB,CACvD,MAAO,CACL,GAAI,EAAiB,GACrB,SAAU,GACX,CACF,CAAC,CAGJ,GAAI,CAEF,MAAM,EAAmB,EAAQ,EAAyB,CACxD,MAAO,CAAE,UAAW,EAAiB,GAAI,CAC1C,CAAC,OACK,EAAK,CACR,EAAI,QAAQ,SAAS,yCAAyC,GAChE,GAAW,GAIf,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAOvB,OANI,EAAU,GACZ,EAAO,KAAK,EAAO,OAAO,GAAG,EAAQ,yBAAyB,CAAC,CAEjE,EAAO,KACL,EAAO,MAAM,yBAAyB,EAAM,gBAAgB,EAAY,IAAK,YAAY,CAC1F,CACM,EAAY"}
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import{gql as e}from"graphql-request";const t=`
|
|
2
|
-
id
|
|
3
|
-
title
|
|
4
|
-
status
|
|
5
|
-
index
|
|
6
|
-
questions {
|
|
7
|
-
id
|
|
8
|
-
title
|
|
9
|
-
index
|
|
10
|
-
type
|
|
11
|
-
subType
|
|
12
|
-
placeholder
|
|
13
|
-
description
|
|
14
|
-
isRequired
|
|
15
|
-
displayLogic
|
|
16
|
-
riskLogic
|
|
17
|
-
requireRiskEvaluation
|
|
18
|
-
requireRiskMatrixEvaluation
|
|
19
|
-
riskCategories {
|
|
20
|
-
id
|
|
21
|
-
title
|
|
22
|
-
}
|
|
23
|
-
riskFramework {
|
|
24
|
-
id
|
|
25
|
-
title
|
|
26
|
-
description
|
|
27
|
-
riskLevels {
|
|
28
|
-
id
|
|
29
|
-
title
|
|
30
|
-
}
|
|
31
|
-
riskCategories {
|
|
32
|
-
id
|
|
33
|
-
title
|
|
34
|
-
}
|
|
35
|
-
riskMatrixColumns {
|
|
36
|
-
id
|
|
37
|
-
title
|
|
38
|
-
}
|
|
39
|
-
riskMatrixRows {
|
|
40
|
-
id
|
|
41
|
-
title
|
|
42
|
-
}
|
|
43
|
-
riskMatrix {
|
|
44
|
-
id
|
|
45
|
-
title
|
|
46
|
-
}
|
|
47
|
-
creator {
|
|
48
|
-
id
|
|
49
|
-
email
|
|
50
|
-
name
|
|
51
|
-
}
|
|
52
|
-
riskMatrixRowTitle
|
|
53
|
-
riskMatrixColumnTitle
|
|
54
|
-
}
|
|
55
|
-
riskLevel {
|
|
56
|
-
id
|
|
57
|
-
title
|
|
58
|
-
}
|
|
59
|
-
reviewerRiskLevel {
|
|
60
|
-
id
|
|
61
|
-
title
|
|
62
|
-
}
|
|
63
|
-
riskLevelFromRiskMatrix {
|
|
64
|
-
id
|
|
65
|
-
title
|
|
66
|
-
}
|
|
67
|
-
answerOptions {
|
|
68
|
-
id
|
|
69
|
-
index
|
|
70
|
-
value
|
|
71
|
-
}
|
|
72
|
-
selectedAnswers {
|
|
73
|
-
... on AssessmentAnswerInterface {
|
|
74
|
-
id
|
|
75
|
-
index
|
|
76
|
-
value
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
respondent {
|
|
80
|
-
id
|
|
81
|
-
email
|
|
82
|
-
name
|
|
83
|
-
}
|
|
84
|
-
attributeKey {
|
|
85
|
-
name
|
|
86
|
-
}
|
|
87
|
-
externalRespondentEmail
|
|
88
|
-
comments {
|
|
89
|
-
id
|
|
90
|
-
content
|
|
91
|
-
createdAt
|
|
92
|
-
updatedAt
|
|
93
|
-
author {
|
|
94
|
-
id
|
|
95
|
-
email
|
|
96
|
-
name
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
allowedMimeTypes
|
|
100
|
-
updatedAt
|
|
101
|
-
referenceId
|
|
102
|
-
previousSubmissions {
|
|
103
|
-
id
|
|
104
|
-
updatedAt
|
|
105
|
-
assessmentQuestionId
|
|
106
|
-
answers {
|
|
107
|
-
... on AssessmentAnswerInterface {
|
|
108
|
-
id
|
|
109
|
-
index
|
|
110
|
-
value
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
allowSelectOther
|
|
115
|
-
syncModel
|
|
116
|
-
syncColumn
|
|
117
|
-
syncRowIds
|
|
118
|
-
syncOverride
|
|
119
|
-
}
|
|
120
|
-
assignees {
|
|
121
|
-
id
|
|
122
|
-
email
|
|
123
|
-
name
|
|
124
|
-
}
|
|
125
|
-
externalAssignees {
|
|
126
|
-
id
|
|
127
|
-
email
|
|
128
|
-
}
|
|
129
|
-
isReviewed
|
|
130
|
-
`,n=e`
|
|
131
|
-
query TranscendCliAssessments(
|
|
132
|
-
$first: Int!
|
|
133
|
-
$offset: Int!
|
|
134
|
-
$filterBy: AssessmentFormFiltersInput
|
|
135
|
-
) {
|
|
136
|
-
assessmentForms(first: $first, offset: $offset, filterBy: $filterBy) {
|
|
137
|
-
nodes {
|
|
138
|
-
id
|
|
139
|
-
creator {
|
|
140
|
-
id
|
|
141
|
-
email
|
|
142
|
-
name
|
|
143
|
-
}
|
|
144
|
-
lastEditor {
|
|
145
|
-
id
|
|
146
|
-
email
|
|
147
|
-
name
|
|
148
|
-
}
|
|
149
|
-
title
|
|
150
|
-
description
|
|
151
|
-
status
|
|
152
|
-
assignees {
|
|
153
|
-
id
|
|
154
|
-
email
|
|
155
|
-
name
|
|
156
|
-
}
|
|
157
|
-
externalAssignees {
|
|
158
|
-
id
|
|
159
|
-
email
|
|
160
|
-
}
|
|
161
|
-
reviewers {
|
|
162
|
-
id
|
|
163
|
-
email
|
|
164
|
-
name
|
|
165
|
-
}
|
|
166
|
-
isLocked
|
|
167
|
-
isArchived
|
|
168
|
-
isExternallyCreated
|
|
169
|
-
dueDate
|
|
170
|
-
createdAt
|
|
171
|
-
updatedAt
|
|
172
|
-
assignedAt
|
|
173
|
-
submittedAt
|
|
174
|
-
approvedAt
|
|
175
|
-
rejectedAt
|
|
176
|
-
titleIsInternal
|
|
177
|
-
retentionSchedule {
|
|
178
|
-
id
|
|
179
|
-
type
|
|
180
|
-
durationDays
|
|
181
|
-
operation
|
|
182
|
-
}
|
|
183
|
-
attributeValues {
|
|
184
|
-
name
|
|
185
|
-
attributeKey {
|
|
186
|
-
name
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
sections {
|
|
190
|
-
${t}
|
|
191
|
-
}
|
|
192
|
-
assessmentGroup {
|
|
193
|
-
id
|
|
194
|
-
title
|
|
195
|
-
description
|
|
196
|
-
}
|
|
197
|
-
resources {
|
|
198
|
-
resourceType
|
|
199
|
-
... on AttributeBusinessEntityResource {
|
|
200
|
-
id
|
|
201
|
-
title
|
|
202
|
-
}
|
|
203
|
-
... on AttributeDataSiloResource {
|
|
204
|
-
id
|
|
205
|
-
title
|
|
206
|
-
}
|
|
207
|
-
... on AttributeDataSubCategoryResource {
|
|
208
|
-
id
|
|
209
|
-
name
|
|
210
|
-
category
|
|
211
|
-
}
|
|
212
|
-
... on AttributeSubDataPointResource {
|
|
213
|
-
id
|
|
214
|
-
name
|
|
215
|
-
}
|
|
216
|
-
... on AttributeProcessingPurposeSubCategoryResource {
|
|
217
|
-
id
|
|
218
|
-
name
|
|
219
|
-
purpose
|
|
220
|
-
}
|
|
221
|
-
... on AttributeRequestResource {
|
|
222
|
-
id
|
|
223
|
-
type
|
|
224
|
-
}
|
|
225
|
-
... on AttributeVendorResource {
|
|
226
|
-
id
|
|
227
|
-
title
|
|
228
|
-
}
|
|
229
|
-
... on AttributePromptResource {
|
|
230
|
-
id
|
|
231
|
-
title
|
|
232
|
-
}
|
|
233
|
-
... on AttributePromptRunResource {
|
|
234
|
-
id
|
|
235
|
-
title
|
|
236
|
-
}
|
|
237
|
-
... on AttributePromptGroupResource {
|
|
238
|
-
id
|
|
239
|
-
title
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
syncedRows {
|
|
243
|
-
resourceType
|
|
244
|
-
... on AttributeBusinessEntityResource {
|
|
245
|
-
id
|
|
246
|
-
title
|
|
247
|
-
}
|
|
248
|
-
... on AttributeDataSiloResource {
|
|
249
|
-
id
|
|
250
|
-
title
|
|
251
|
-
}
|
|
252
|
-
... on AttributeDataSubCategoryResource {
|
|
253
|
-
id
|
|
254
|
-
name
|
|
255
|
-
category
|
|
256
|
-
}
|
|
257
|
-
... on AttributeSubDataPointResource {
|
|
258
|
-
id
|
|
259
|
-
name
|
|
260
|
-
}
|
|
261
|
-
... on AttributeProcessingPurposeSubCategoryResource {
|
|
262
|
-
id
|
|
263
|
-
name
|
|
264
|
-
purpose
|
|
265
|
-
}
|
|
266
|
-
... on AttributeVendorResource {
|
|
267
|
-
id
|
|
268
|
-
title
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
`,r=e`
|
|
275
|
-
mutation TranscendCliImportOneTrustAssessmentForms($input: ImportOnetrustAssessmentsInput!) {
|
|
276
|
-
importOneTrustAssessmentForms(input: $input) {
|
|
277
|
-
assessmentForms {
|
|
278
|
-
id
|
|
279
|
-
title
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
`;export{t as n,r,n as t};
|
|
284
|
-
//# sourceMappingURL=assessment-BDywVaGR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assessment-BDywVaGR.mjs","names":[],"sources":["../src/lib/graphql/gqls/assessment.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\nexport const ASSESSMENT_SECTION_FIELDS = `\n id\n title\n status\n index\n questions {\n id\n title\n index\n type\n subType\n placeholder\n description\n isRequired\n displayLogic\n riskLogic\n requireRiskEvaluation\n requireRiskMatrixEvaluation\n riskCategories {\n id\n title\n }\n riskFramework {\n id\n title\n description\n riskLevels {\n id\n title\n }\n riskCategories {\n id\n title\n }\n riskMatrixColumns {\n id\n title\n }\n riskMatrixRows {\n id\n title\n }\n riskMatrix {\n id\n title\n }\n creator {\n id\n email\n name\n }\n riskMatrixRowTitle\n riskMatrixColumnTitle\n }\n riskLevel {\n id\n title\n }\n reviewerRiskLevel {\n id\n title\n }\n riskLevelFromRiskMatrix {\n id\n title\n }\n answerOptions {\n id\n index\n value\n }\n selectedAnswers {\n ... on AssessmentAnswerInterface {\n id\n index\n value\n }\n }\n respondent {\n id\n email\n name\n }\n attributeKey {\n name\n }\n externalRespondentEmail\n comments {\n id\n content\n createdAt\n updatedAt\n author {\n id\n email\n name\n }\n }\n allowedMimeTypes\n updatedAt\n referenceId\n previousSubmissions {\n id\n updatedAt\n assessmentQuestionId\n answers {\n ... on AssessmentAnswerInterface {\n id\n index\n value\n }\n }\n }\n allowSelectOther\n syncModel\n syncColumn\n syncRowIds\n syncOverride\n }\n assignees {\n id\n email\n name\n }\n externalAssignees {\n id\n email\n }\n isReviewed\n`;\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\n// orderBy: [\n// { field: createdAt, direction: ASC }\n// { field: name, direction: ASC }\n// ]\nexport const ASSESSMENTS = gql`\n query TranscendCliAssessments(\n $first: Int!\n $offset: Int!\n $filterBy: AssessmentFormFiltersInput\n ) {\n assessmentForms(first: $first, offset: $offset, filterBy: $filterBy) {\n nodes {\n id\n creator {\n id\n email\n name\n }\n lastEditor {\n id\n email\n name\n }\n title\n description\n status\n assignees {\n id\n email\n name\n }\n externalAssignees {\n id\n email\n }\n reviewers {\n id\n email\n name\n }\n isLocked\n isArchived\n isExternallyCreated\n dueDate\n createdAt\n updatedAt\n assignedAt\n submittedAt\n approvedAt\n rejectedAt\n titleIsInternal\n retentionSchedule {\n id\n type\n durationDays\n operation\n }\n attributeValues {\n name\n attributeKey {\n name\n }\n }\n sections {\n ${ASSESSMENT_SECTION_FIELDS}\n }\n assessmentGroup {\n id\n title\n description\n }\n resources {\n resourceType\n ... on AttributeBusinessEntityResource {\n id\n title\n }\n ... on AttributeDataSiloResource {\n id\n title\n }\n ... on AttributeDataSubCategoryResource {\n id\n name\n category\n }\n ... on AttributeSubDataPointResource {\n id\n name\n }\n ... on AttributeProcessingPurposeSubCategoryResource {\n id\n name\n purpose\n }\n ... on AttributeRequestResource {\n id\n type\n }\n ... on AttributeVendorResource {\n id\n title\n }\n ... on AttributePromptResource {\n id\n title\n }\n ... on AttributePromptRunResource {\n id\n title\n }\n ... on AttributePromptGroupResource {\n id\n title\n }\n }\n syncedRows {\n resourceType\n ... on AttributeBusinessEntityResource {\n id\n title\n }\n ... on AttributeDataSiloResource {\n id\n title\n }\n ... on AttributeDataSubCategoryResource {\n id\n name\n category\n }\n ... on AttributeSubDataPointResource {\n id\n name\n }\n ... on AttributeProcessingPurposeSubCategoryResource {\n id\n name\n purpose\n }\n ... on AttributeVendorResource {\n id\n title\n }\n }\n }\n }\n }\n`;\n\nexport const IMPORT_ONE_TRUST_ASSESSMENT_FORMS = gql`\n mutation TranscendCliImportOneTrustAssessmentForms($input: ImportOnetrustAssessmentsInput!) {\n importOneTrustAssessmentForms(input: $input) {\n assessmentForms {\n id\n title\n }\n }\n }\n`;\n"],"mappings":"sCAEA,MAAa,EAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0I5B,EAAc,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4DlB,EAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFzB,EAAoC,CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bluebird-CUitXgsY.mjs","names":[],"sources":["../src/lib/bluebird.ts"],"sourcesContent":["import Bluebird from 'bluebird';\n\nconst { map, mapSeries } = Bluebird;\n\nexport { map, mapSeries };\n"],"mappings":"wBAEA,KAAM,CAAE,MAAK,aAAc"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./bluebird-CUitXgsY.mjs";import{n as r}from"./fetchConsentManagerId-DHDA5Py9.mjs";import{r as i}from"./makeGraphQLRequest-G078PsEL.mjs";import{difference as a}from"lodash-es";import o from"colors";const s=e=>new URL(`https://${e}`).hostname.split(`.`).slice(-2).join(`.`),c=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;async function l(l,{xdiLocation:u,transcendUrl:d=e,removeIpAddresses:f=!0,domainBlockList:p=[`localhost`],xdiAllowedCommands:m=`ConsentManager:Sync`}){let h=await n(Array.isArray(l)?l:[{apiKey:l,organizationId:``,organizationName:``}],async e=>(t.info(o.magenta(`Pulling consent metadata for organization - ${e.organizationName}`)),await r(i(d,e.apiKey))),{concurrency:5}),g={};return h.forEach(e=>{let t=e.partition?.partition||e.bundleURL.split(`/`).reverse()[1];g[t]||(g[t]=[]);let n=a(e.configuration.domains.filter(e=>!f||!c.test(e)).map(e=>s(e)),p);g[t]=[...new Set([...g[t]||[],...n])]}),{html:`
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<script
|
|
4
|
-
src="${u}"
|
|
5
|
-
data-sync-groups='${JSON.stringify(g,null,2)}'
|
|
6
|
-
data-xdi-commands="${m}"
|
|
7
|
-
><\/script>
|
|
8
|
-
`,syncGroups:g}}export{l as n,s as r,c as t};
|
|
9
|
-
//# sourceMappingURL=buildXdiSyncEndpoint-BMaMHO7Z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildXdiSyncEndpoint-BMaMHO7Z.mjs","names":[],"sources":["../src/lib/consent-manager/domainToHost.ts","../src/lib/consent-manager/buildXdiSyncEndpoint.ts"],"sourcesContent":["/**\n * Convert a domain to host\n *\n * @param domain - e.g. test.acme.com\n * @returns Host acme.com\n */\nexport const domainToHost = (domain: string): string =>\n new URL(`https://${domain}`).hostname.split('.').slice(-2).join('.');\n","import colors from 'colors';\nimport { difference } from 'lodash-es';\n\nimport { StoredApiKey } from '../../codecs.js';\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { map } from '../bluebird.js';\nimport { buildTranscendGraphQLClient, fetchConsentManager } from '../graphql/index.js';\nimport { domainToHost } from './domainToHost.js';\n\n/**\n * Sync group configuration mapping\n * e.g.\n * {\n * \"abdb5e78-0d69-4554-a3bd-84b72ca3b3d9\": [\n * \"test.com\"\n * ],\n * \"f6b3ba87-c9df-444f-b420-6fac49e35910\": [\n * \"blue.com\"\n * ]\n * }\n */\nexport type XdiSyncGroups = { [k in string]: string[] };\n\n/** Regular expression for IP addresses - remove these from sync endpoint */\nexport const IP_ADDRESS_REGEX =\n // eslint-disable-next-line max-len\n /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\n/**\n * Build the sync endpoint definition for a set of Transcend accounts\n *\n * @param apiKeys - The API keys that will be used to pull down configurations for\n * @param options - Options\n * @returns The XDI configuration\n */\nexport async function buildXdiSyncEndpoint(\n apiKeys: string | StoredApiKey[],\n {\n xdiLocation,\n transcendUrl = DEFAULT_TRANSCEND_API,\n removeIpAddresses = true,\n domainBlockList = ['localhost'],\n xdiAllowedCommands = 'ConsentManager:Sync',\n }: {\n /** The file location where the XDI file is hosted */\n xdiLocation: string;\n /** URL of Transcend API */\n transcendUrl?: string;\n /** When true, remove IP addresses (defaults to true) */\n removeIpAddresses?: boolean;\n /** Block list of domains to omit from sync endpoint - includes `localhost` by default */\n domainBlockList?: string[];\n /** Allows XDI commands */\n xdiAllowedCommands?: string;\n },\n): Promise<{\n /** Sync group configurations */\n syncGroups: XdiSyncGroups;\n /** The HTML string */\n html: string;\n}> {\n // Convert API keys to list\n const apiKeysAsList = Array.isArray(apiKeys)\n ? apiKeys\n : [{ apiKey: apiKeys, organizationId: '', organizationName: '' }];\n\n // Fetch configuration for each account\n const consentManagers = await map(\n apiKeysAsList,\n async (apiKey) => {\n logger.info(\n colors.magenta(`Pulling consent metadata for organization - ${apiKey.organizationName}`),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n // Grab consent manager\n const consentManager = await fetchConsentManager(client);\n return consentManager;\n },\n { concurrency: 5 },\n );\n\n // construct the sync groups\n const syncGroups: XdiSyncGroups = {};\n consentManagers.forEach((consentManager) => {\n // grab the partition key\n const partitionKey =\n // take explicit key first\n consentManager.partition?.partition ||\n // fallback to bundle ID\n consentManager.bundleURL.split('/').reverse()[1];\n\n // Ensure that partition exists in the sync groups\n if (!syncGroups[partitionKey]) {\n syncGroups[partitionKey] = [];\n }\n\n // Map domain list to a host list\n const hosts = difference(\n consentManager.configuration.domains\n .filter(\n // ignore IP addresses\n (domain) => !removeIpAddresses || !IP_ADDRESS_REGEX.test(domain),\n )\n .map((domain) => domainToHost(domain)),\n // ignore block list\n domainBlockList,\n );\n // merge existing sync group with hosts for this consent manager\n syncGroups[partitionKey] = [...new Set([...(syncGroups[partitionKey] || []), ...hosts])];\n });\n\n // Construct the HTML\n const syncEndpointHtml = `\n<!DOCTYPE html>\n<script\nsrc=\"${xdiLocation}\"\ndata-sync-groups='${JSON.stringify(syncGroups, null, 2)}'\ndata-xdi-commands=\"${xdiAllowedCommands}\"\n></script>\n`;\n\n return {\n html: syncEndpointHtml,\n syncGroups,\n };\n}\n"],"mappings":"0SAMA,MAAa,EAAgB,GAC3B,IAAI,IAAI,WAAW,IAAS,CAAC,SAAS,MAAM,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,IAAI,CCkBzD,EAEX,mKASF,eAAsB,EACpB,EACA,CACE,cACA,eAAe,EACf,oBAAoB,GACpB,kBAAkB,CAAC,YAAY,CAC/B,qBAAqB,uBAkBtB,CAOD,IAAM,EAAkB,MAAM,EALR,MAAM,QAAQ,EAAQ,CACxC,EACA,CAAC,CAAE,OAAQ,EAAS,eAAgB,GAAI,iBAAkB,GAAI,CAAC,CAKjE,KAAO,KACL,EAAO,KACL,EAAO,QAAQ,+CAA+C,EAAO,mBAAmB,CACzF,CAMsB,MAAM,EAHd,EAA4B,EAAc,EAAO,OAAO,CAGf,EAG1D,CAAE,YAAa,EAAG,CACnB,CAGK,EAA4B,EAAE,CAuCpC,OAtCA,EAAgB,QAAS,GAAmB,CAE1C,IAAM,EAEJ,EAAe,WAAW,WAE1B,EAAe,UAAU,MAAM,IAAI,CAAC,SAAS,CAAC,GAG3C,EAAW,KACd,EAAW,GAAgB,EAAE,EAI/B,IAAM,EAAQ,EACZ,EAAe,cAAc,QAC1B,OAEE,GAAW,CAAC,GAAqB,CAAC,EAAiB,KAAK,EAAO,CACjE,CACA,IAAK,GAAW,EAAa,EAAO,CAAC,CAExC,EACD,CAED,EAAW,GAAgB,CAAC,GAAG,IAAI,IAAI,CAAC,GAAI,EAAW,IAAiB,EAAE,CAAG,GAAG,EAAM,CAAC,CAAC,EACxF,CAYK,CACL,KAVuB;;;OAGpB,EAAY;oBACC,KAAK,UAAU,EAAY,KAAM,EAAE,CAAC;qBACnC,EAAmB;;EAMpC,aACD"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./bluebird-CUitXgsY.mjs";import{t as r}from"./createSombraGotInstance-CahOgD6V.mjs";import{n as i,r as a}from"./fetchAllRequestIdentifiers-YP-geTV4.mjs";import{s as o,u as s}from"./constants-lIvXgkdp.mjs";import{r as c}from"./makeGraphQLRequest-G078PsEL.mjs";import{r as l}from"./fetchAllRequests-DEPTEUbi.mjs";import{n as u,t as d}from"./extractClientError-DPjv09EH.mjs";import{IdentifierType as f}from"@transcend-io/privacy-types";import{difference as p,groupBy as m}from"lodash-es";import{apply as h,decodeCodec as g}from"@transcend-io/type-utils";import{join as _,resolve as v}from"node:path";import y from"colors";import*as b from"io-ts";import x from"cli-progress";import{PersistedState as S}from"@transcend-io/persisted-state";async function C(e,t,{sendEmailReceipt:n=!1,skipWaitingPeriod:r=!1,emailIsVerified:i=!0,requestIdentifiers:a=[]}={}){let s=await e.post(`v1/data-subject-request`,{json:{type:t.type,subject:{coreIdentifier:t.coreIdentifier,email:t.email,emailIsVerified:i,...a.length>0?{attestedExtraIdentifiers:h(m(a.filter(e=>!(e.name===`email`&&e.value===t.email)&&!o.includes(e.name)).map(e=>({...e,type:Object.values(f).includes(e.name)?e.name:f.Custom})),`type`),(e,t)=>e.map(({name:e,value:n})=>({...t===f.Custom?{name:e}:{},value:n})))}:{}},requestId:t.id,subjectType:t.subjectType,isSilent:t.isSilent,isTest:t.isTest,locale:t.locale,skipWaitingPeriod:r,createdAt:t.createdAt,details:`Restarted by Transcend cli: "tr-request-restart" - ${t.details}`,skipSendingReceipt:!n}}).json(),{request:c}=g(b.type({request:u}),s);return c}const w=b.intersection([s,b.type({error:b.string})]),T=b.type({restartedRequests:b.array(s),failingRequests:b.array(w)});async function E({requestReceiptFolder:o,auth:s,sombraAuth:u,requestActions:f,requestStatuses:m,createdAtBefore:h,createdAtAfter:g,updatedAtBefore:b,updatedAtAfter:w,transcendUrl:E=e,requestIds:D=[],createdAt:O=new Date,silentModeBefore:k,sendEmailReceipt:A=!1,emailIsVerified:j=!0,copyIdentifiers:M=!1,skipWaitingPeriod:N=!1,concurrency:P=20}){let F=new Date().getTime(),I=new x.SingleBar({},x.Presets.shades_classic),L=_(o,`tr-request-restart-${new Date().toISOString()}.json`),R=new S(L,T,{restartedRequests:[],failingRequests:[]}),z=await r(E,s,u),B=c(E,s),V=(await l(B,{requestIds:D,actions:f,statuses:m,createdAtBefore:h,createdAtAfter:g,updatedAtBefore:b,updatedAtAfter:w})).filter(e=>new Date(e.createdAt)<O);if(t.info(`Found ${V.length} requests to restart`),M&&t.info(`copyIdentifiers detected - All Identifiers will be copied.`),A&&t.info(`sendEmailReceipt detected - Email receipts will be sent.`),N&&t.info(`skipWaitingPeriod detected - Waiting period will be skipped.`),D.length>0&&D.length!==V.length){let e=p(D,V.map(({id:e})=>e));e.length>0&&(t.error(y.red(`Failed to find the following requests by ID: ${e.join(`,`)}.`)),process.exit(1))}M&&await a(B);let H=0;I.start(V.length,0),await n(V,async(e,t)=>{try{let n=M?await i(B,z,{requestId:e.id,skipSombraCheck:!0}):[],r=await C(z,{...e,isSilent:k&&new Date(e.createdAt)<k?!0:e.isSilent},{requestIdentifiers:n,skipWaitingPeriod:N,sendEmailReceipt:A,emailIsVerified:j}),a=R.getValue(`restartedRequests`);a.push({id:r.id,link:r.link,rowIndex:t,coreIdentifier:r.coreIdentifier,attemptedAt:new Date().toISOString()}),await R.setValue(a,`restartedRequests`)}catch(n){let r=`${n.message} - ${JSON.stringify(n.response?.body,null,2)}`,i=d(r),a=R.getValue(`failingRequests`);a.push({id:e.id,link:e.link,rowIndex:t,coreIdentifier:e.coreIdentifier,attemptedAt:new Date().toISOString(),error:i||r}),await R.setValue(a,`failingRequests`)}H+=1,I.update(H)},{concurrency:P}),I.stop();let U=new Date().getTime()-F;t.info(y.green(`Completed restarting of requests in "${U/1e3}" seconds.`)),R.getValue(`failingRequests`).length>0&&(t.error(y.red(`Encountered "${R.getValue(`failingRequests`).length}" errors. See "${v(L)}" to review the error messages and inputs.`)),process.exit(1))}export{C as n,E as t};
|
|
2
|
-
//# sourceMappingURL=bulkRestartRequests-DEPSHov-.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulkRestartRequests-DEPSHov-.mjs","names":[],"sources":["../src/lib/requests/restartPrivacyRequest.ts","../src/lib/requests/bulkRestartRequests.ts"],"sourcesContent":["import { IdentifierType } from '@transcend-io/privacy-types';\nimport { apply, decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\nimport { groupBy } from 'lodash-es';\n\nimport { PrivacyRequest, RequestIdentifier } from '../graphql/index.js';\nimport { IDENTIFIER_BLOCK_LIST } from './constants.js';\nimport { PrivacyRequestResponse } from './submitPrivacyRequest.js';\n\n/**\n * Restart a privacy request to the Transcend API\n *\n * @param sombra - Sombra instance configured to make requests\n * @param request - Request to restart\n * @param input - Request input\n * @returns Successfully submitted request\n */\nexport async function restartPrivacyRequest(\n sombra: Got,\n request: PrivacyRequest,\n {\n sendEmailReceipt = false,\n skipWaitingPeriod = false,\n emailIsVerified = true,\n requestIdentifiers = [],\n }: {\n /** List of request identifiers to include */\n requestIdentifiers?: RequestIdentifier[];\n /** When true, send an email receipt to data subject */\n sendEmailReceipt?: boolean;\n /** Whether the email is verified */\n emailIsVerified?: boolean;\n /** Whether to skip waiting period */\n skipWaitingPeriod?: boolean;\n } = {},\n): Promise<PrivacyRequestResponse> {\n // Make the GraphQL request\n const response = await sombra\n .post('v1/data-subject-request', {\n json: {\n type: request.type,\n subject: {\n coreIdentifier: request.coreIdentifier,\n email: request.email,\n emailIsVerified,\n ...(requestIdentifiers.length > 0\n ? {\n attestedExtraIdentifiers: apply(\n groupBy(\n requestIdentifiers\n .filter(\n (ri) =>\n // these are already submitted above\n !(ri.name === 'email' && ri.value === request.email) &&\n !IDENTIFIER_BLOCK_LIST.includes(ri.name),\n )\n .map((ri) => ({\n ...ri,\n type: Object.values(IdentifierType).includes(\n ri.name as any, // eslint-disable-line @typescript-eslint/no-explicit-any\n )\n ? ri.name\n : IdentifierType.Custom,\n })),\n 'type',\n ),\n (values, type) =>\n values.map(({ name, value }) => ({\n ...(type === IdentifierType.Custom ? { name } : {}),\n value,\n })),\n ),\n }\n : {}),\n },\n requestId: request.id,\n subjectType: request.subjectType,\n isSilent: request.isSilent,\n isTest: request.isTest,\n locale: request.locale,\n skipWaitingPeriod,\n createdAt: request.createdAt,\n details: `Restarted by Transcend cli: \"tr-request-restart\" - ${request.details}`,\n skipSendingReceipt: !sendEmailReceipt,\n },\n })\n .json();\n\n const { request: requestResponse } = decodeCodec(\n t.type({\n request: PrivacyRequestResponse,\n }),\n response,\n );\n return requestResponse;\n}\n","import { join, resolve } from 'node:path';\n\nimport { PersistedState } from '@transcend-io/persisted-state';\nimport { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport * as t from 'io-ts';\nimport { difference } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { map } from '../bluebird.js';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllRequestIdentifiers,\n fetchAllRequests,\n validateSombraVersion,\n} from '../graphql/index.js';\nimport { SuccessfulRequest } from './constants.js';\nimport { extractClientError } from './extractClientError.js';\nimport { restartPrivacyRequest } from './restartPrivacyRequest.js';\n\n/** Minimal state we need to keep a list of requests */\nconst ErrorRequest = t.intersection([\n SuccessfulRequest,\n t.type({\n error: t.string,\n }),\n]);\n\n/** Type override */\ntype ErrorRequest = t.TypeOf<typeof ErrorRequest>;\n\n/** Persist this data between runs of the script */\nconst CachedRequestState = t.type({\n restartedRequests: t.array(SuccessfulRequest),\n failingRequests: t.array(ErrorRequest),\n});\n\n/**\n * Upload a set of privacy requests from CSV\n *\n * @param options - Options\n */\nexport async function bulkRestartRequests({\n requestReceiptFolder,\n auth,\n sombraAuth,\n requestActions,\n requestStatuses,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n transcendUrl = DEFAULT_TRANSCEND_API,\n requestIds = [],\n createdAt = new Date(),\n silentModeBefore,\n sendEmailReceipt = false,\n emailIsVerified = true,\n copyIdentifiers = false,\n skipWaitingPeriod = false,\n concurrency = 20,\n}: {\n /** Actions to filter for */\n requestActions: RequestAction[];\n /** Statues to filter for */\n requestStatuses: RequestStatus[];\n /** File where request receipts are stored */\n requestReceiptFolder: string;\n /** Transcend API key authentication */\n auth: string;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Request IDs to filter for */\n requestIds?: string[];\n /** Whether to re-verify the email when restarting the request */\n emailIsVerified?: boolean;\n /** Filter for requests that were submitted before this date */\n createdAt?: Date;\n /** Requests that have been open for this length of time should be marked as silent mode */\n silentModeBefore?: Date;\n /** Send an email receipt to the restarted requests */\n sendEmailReceipt?: boolean;\n /** Copy over all identifiers rather than restarting the request only with the core identifier */\n copyIdentifiers?: boolean;\n /** Skip the waiting period when restarting requests */\n skipWaitingPeriod?: boolean;\n /** Filter for requests created before this date */\n createdAtBefore?: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** Concurrency to upload requests at */\n concurrency?: number;\n}): Promise<void> {\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\n // Create a new state file to store the requests from this run\n const cacheFile = join(\n requestReceiptFolder,\n `tr-request-restart-${new Date().toISOString()}.json`,\n );\n const state = new PersistedState(cacheFile, CachedRequestState, {\n restartedRequests: [],\n failingRequests: [],\n });\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const allRequests = await fetchAllRequests(client, {\n requestIds,\n actions: requestActions,\n statuses: requestStatuses,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n });\n const requests = allRequests.filter((request) => new Date(request.createdAt) < createdAt);\n logger.info(`Found ${requests.length} requests to restart`);\n\n if (copyIdentifiers) {\n logger.info('copyIdentifiers detected - All Identifiers will be copied.');\n }\n if (sendEmailReceipt) {\n logger.info('sendEmailReceipt detected - Email receipts will be sent.');\n }\n if (skipWaitingPeriod) {\n logger.info('skipWaitingPeriod detected - Waiting period will be skipped.');\n }\n\n // Validate request IDs\n if (requestIds.length > 0 && requestIds.length !== requests.length) {\n const missingRequests = difference(\n requestIds,\n requests.map(({ id }) => id),\n );\n if (missingRequests.length > 0) {\n logger.error(\n colors.red(`Failed to find the following requests by ID: ${missingRequests.join(',')}.`),\n );\n process.exit(1);\n }\n }\n\n if (copyIdentifiers) {\n await validateSombraVersion(client);\n }\n\n // Map over the requests\n let total = 0;\n progressBar.start(requests.length, 0);\n await map(\n requests,\n async (request, ind) => {\n try {\n // Pull the request identifiers\n const requestIdentifiers = copyIdentifiers\n ? await fetchAllRequestIdentifiers(client, sombra, {\n requestId: request.id,\n skipSombraCheck: true,\n })\n : [];\n\n // Make the GraphQL request to restart the request\n const requestResponse = await restartPrivacyRequest(\n sombra,\n {\n ...request,\n // override silent mode\n isSilent:\n !!silentModeBefore && new Date(request.createdAt) < silentModeBefore\n ? true\n : request.isSilent,\n },\n {\n requestIdentifiers,\n skipWaitingPeriod,\n sendEmailReceipt,\n emailIsVerified,\n },\n );\n\n // Cache successful upload\n const restartedRequests = state.getValue('restartedRequests');\n restartedRequests.push({\n id: requestResponse.id,\n link: requestResponse.link,\n rowIndex: ind,\n coreIdentifier: requestResponse.coreIdentifier,\n attemptedAt: new Date().toISOString(),\n });\n await state.setValue(restartedRequests, 'restartedRequests');\n } catch (err) {\n const msg = `${err.message} - ${JSON.stringify(err.response?.body, null, 2)}`;\n const clientError = extractClientError(msg);\n\n const failingRequests = state.getValue('failingRequests');\n failingRequests.push({\n id: request.id,\n link: request.link,\n rowIndex: ind,\n coreIdentifier: request.coreIdentifier,\n attemptedAt: new Date().toISOString(),\n error: clientError || msg,\n });\n await state.setValue(failingRequests, 'failingRequests');\n }\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n // Log completion time\n logger.info(colors.green(`Completed restarting of requests in \"${totalTime / 1000}\" seconds.`));\n\n // Log errors\n if (state.getValue('failingRequests').length > 0) {\n logger.error(\n colors.red(\n `Encountered \"${state.getValue('failingRequests').length}\" errors. ` +\n `See \"${resolve(cacheFile)}\" to review the error messages and inputs.`,\n ),\n );\n process.exit(1);\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./bluebird-CUitXgsY.mjs";import{r,t as i}from"./fetchAllRequestEnrichers-q34mRuE5.mjs";import{r as a,t as o}from"./makeGraphQLRequest-G078PsEL.mjs";import{r as s}from"./fetchAllRequests-DEPTEUbi.mjs";import{RequestEnricherStatus as c,RequestStatus as l}from"@transcend-io/privacy-types";import{difference as u}from"lodash-es";import d from"colors";import f from"cli-progress";async function p(e,t){await o(e,r,{requestEnricherId:t})}async function m({auth:r,requestActions:o=[],createdAtBefore:m,createdAtAfter:h,updatedAtBefore:g,updatedAtAfter:_,transcendUrl:v=e,requestEnricherStatuses:y=Object.values(c),requestIds:b=[],enricherId:x,concurrency:S=20}){let C=new Date().getTime(),w=new f.SingleBar({},f.Presets.shades_classic),T=a(v,r);t.info(d.magenta(`Fetching requests to restart...`));let E=await s(T,{actions:o,statuses:[l.Enriching],createdAtBefore:m,createdAtAfter:h,updatedAtBefore:g,updatedAtAfter:_,requestIds:b}),D=0;if(b.length>0&&b.length!==E.length){let e=u(b,E.map(({id:e})=>e));e.length>0&&(t.error(d.red(`Failed to find the following requests by ID: ${e.join(`,`)}.`)),process.exit(1))}let O=0;w.start(E.length,0),await n(E,async e=>{await n((await i(T,{requestId:e.id})).filter(e=>e.enricher.id===x&&y.includes(e.status)),async e=>{await p(T,e.id),D+=1}),O+=1,w.update(O)},{concurrency:S}),w.stop();let k=new Date().getTime()-C;t.info(d.green(`Completed restarting of ${E.length} requests and ${D} enrichers in "${k/1e3}" seconds.`))}export{p as n,m as t};
|
|
2
|
-
//# sourceMappingURL=bulkRetryEnrichers-BLkcFKXC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulkRetryEnrichers-BLkcFKXC.mjs","names":[],"sources":["../src/lib/graphql/retryRequestEnricher.ts","../src/lib/requests/bulkRetryEnrichers.ts"],"sourcesContent":["import { GraphQLClient } from 'graphql-request';\n\nimport { RETRY_REQUEST_ENRICHER } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\n/**\n * Retry a request enricher\n *\n * @param client - GraphQL client\n * @param id - The ID of the request enricher to restart\n */\nexport async function retryRequestEnricher(client: GraphQLClient, id: string): Promise<void> {\n await makeGraphQLRequest(client, RETRY_REQUEST_ENRICHER, {\n requestEnricherId: id,\n });\n}\n","import { RequestAction, RequestEnricherStatus, RequestStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { difference } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { map } from '../bluebird.js';\nimport {\n buildTranscendGraphQLClient,\n fetchAllRequestEnrichers,\n fetchAllRequests,\n retryRequestEnricher,\n} from '../graphql/index.js';\n\n/**\n * Restart a bunch of request enrichers\n *\n * @param options - Options\n */\nexport async function bulkRetryEnrichers({\n auth,\n requestActions = [],\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n transcendUrl = DEFAULT_TRANSCEND_API,\n requestEnricherStatuses = Object.values(RequestEnricherStatus),\n requestIds = [],\n enricherId,\n concurrency = 20,\n}: {\n /** Actions to filter for */\n requestActions?: RequestAction[];\n /** Request enricher statuses to restart - defaults to all statuses */\n requestEnricherStatuses?: RequestEnricherStatus[];\n /** Transcend API key authentication */\n auth: string;\n /** The ID of the enricher to restart */\n enricherId: string;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Request IDs to filter for */\n requestIds?: string[];\n /** Filter for requests created before this date */\n createdAtBefore?: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** Concurrency to upload requests at */\n concurrency?: number;\n}): Promise<void> {\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\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n logger.info(colors.magenta('Fetching requests to restart...'));\n\n const requests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n requestIds,\n });\n\n let totalRestarted = 0;\n\n // Validate request IDs\n if (requestIds.length > 0 && requestIds.length !== requests.length) {\n const missingRequests = difference(\n requestIds,\n requests.map(({ id }) => id),\n );\n if (missingRequests.length > 0) {\n logger.error(\n colors.red(`Failed to find the following requests by ID: ${missingRequests.join(',')}.`),\n );\n process.exit(1);\n }\n }\n\n // Map over the requests\n let total = 0;\n progressBar.start(requests.length, 0);\n await map(\n requests,\n async (request) => {\n // Pull the request identifiers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n requestId: request.id,\n });\n const requestEnrichersToRestart = requestEnrichers.filter(\n (requestEnricher) =>\n requestEnricher.enricher.id === enricherId &&\n requestEnricherStatuses.includes(requestEnricher.status),\n );\n await map(requestEnrichersToRestart, async (requestEnricher) => {\n await retryRequestEnricher(client, requestEnricher.id);\n totalRestarted += 1;\n });\n\n // Cache successful upload\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n // Log completion time\n logger.info(\n colors.green(\n `Completed restarting of ${requests.length} requests and ${totalRestarted} enrichers in \"${\n totalTime / 1000\n }\" seconds.`,\n ),\n );\n}\n"],"mappings":"6dAWA,eAAsB,EAAqB,EAAuB,EAA2B,CAC3F,MAAM,EAAmB,EAAQ,EAAwB,CACvD,kBAAmB,EACpB,CAAC,CCMJ,eAAsB,EAAmB,CACvC,OACA,iBAAiB,EAAE,CACnB,kBACA,iBACA,kBACA,iBACA,eAAe,EACf,0BAA0B,OAAO,OAAO,EAAsB,CAC9D,aAAa,EAAE,CACf,aACA,cAAc,IAwBE,CAEhB,IAAM,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAS,EAA4B,EAAc,EAAK,CAE9D,EAAO,KAAK,EAAO,QAAQ,kCAAkC,CAAC,CAE9D,IAAM,EAAW,MAAM,EAAiB,EAAQ,CAC9C,QAAS,EACT,SAAU,CAAC,EAAc,UAAU,CACnC,kBACA,iBACA,kBACA,iBACA,aACD,CAAC,CAEE,EAAiB,EAGrB,GAAI,EAAW,OAAS,GAAK,EAAW,SAAW,EAAS,OAAQ,CAClE,IAAM,EAAkB,EACtB,EACA,EAAS,KAAK,CAAE,QAAS,EAAG,CAC7B,CACG,EAAgB,OAAS,IAC3B,EAAO,MACL,EAAO,IAAI,gDAAgD,EAAgB,KAAK,IAAI,CAAC,GAAG,CACzF,CACD,QAAQ,KAAK,EAAE,EAKnB,IAAI,EAAQ,EACZ,EAAY,MAAM,EAAS,OAAQ,EAAE,CACrC,MAAM,EACJ,EACA,KAAO,IAAY,CAUjB,MAAM,GARmB,MAAM,EAAyB,EAAQ,CAC9D,UAAW,EAAQ,GACpB,CAAC,EACiD,OAChD,GACC,EAAgB,SAAS,KAAO,GAChC,EAAwB,SAAS,EAAgB,OAAO,CAC3D,CACoC,KAAO,IAAoB,CAC9D,MAAM,EAAqB,EAAQ,EAAgB,GAAG,CACtD,GAAkB,GAClB,CAGF,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAGvB,EAAO,KACL,EAAO,MACL,2BAA2B,EAAS,OAAO,gBAAgB,EAAe,iBACxE,EAAY,IACb,YACF,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./bluebird-CUitXgsY.mjs";import{t as r}from"./syncTemplates-BNu1_dmW.mjs";import{n as i,o as a}from"./request-CAsR6CMY.mjs";import{r as o,t as s}from"./makeGraphQLRequest-G078PsEL.mjs";import{r as c}from"./fetchAllRequests-DEPTEUbi.mjs";import{RequestStatus as l}from"@transcend-io/privacy-types";import u from"colors";import d from"cli-progress";async function f({requestActions:f,cancellationTitle:p,auth:m,requestIds:h,silentModeBefore:g,createdAtBefore:_,createdAtAfter:v,updatedAtBefore:y,updatedAtAfter:b,statuses:x=[l.Compiling,l.RequestMade,l.Delayed,l.Approving,l.Secondary,l.Enriching,l.Waiting,l.SecondaryApproving],concurrency:S=50,transcendUrl:C=e}){let w=o(C,m),T=new Date().getTime(),E=new d.SingleBar({},d.Presets.shades_classic),D;if(p){let e=(await r(w,p)).find(e=>e.title===p);if(!e)throw Error(`Failed to find a template with title: "${p}"`);D=e}let O=await c(w,{actions:f,createdAtBefore:_,createdAtAfter:v,updatedAtBefore:y,updatedAtAfter:b,statuses:x,requestIds:h});t.info(u.magenta(`Canceling "${O.length}" requests${D?` Using template: ${D.title}`:``}.`));let k=0;E.start(O.length,0),await n(O,async e=>{g&&new Date(g)>new Date(e.createdAt)&&await s(w,a,{input:{id:e.id,isSilent:!0}}),await s(w,i,{input:{requestId:e.id,...D?{subject:`Re: ${D.subject.defaultMessage}`,template:D.template.defaultMessage}:{}}}),k+=1,E.update(k)},{concurrency:S}),E.stop();let A=new Date().getTime()-T;return t.info(u.green(`Successfully canceled ${k} requests in "${A/1e3}" seconds!`)),O.length}export{f as t};
|
|
2
|
-
//# sourceMappingURL=cancelPrivacyRequests-C8MZQvsq.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancelPrivacyRequests-C8MZQvsq.mjs","names":[],"sources":["../src/lib/requests/cancelPrivacyRequests.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { map } from '../bluebird.js';\nimport {\n UPDATE_PRIVACY_REQUEST,\n fetchAllRequests,\n makeGraphQLRequest,\n buildTranscendGraphQLClient,\n CANCEL_PRIVACY_REQUEST,\n fetchAllTemplates,\n Template,\n} from '../graphql/index.js';\n\n/**\n * Cancel a set of privacy requests\n *\n * @param options - Options\n * @returns The number of requests canceled\n */\nexport async function cancelPrivacyRequests({\n requestActions,\n cancellationTitle,\n auth,\n requestIds,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n statuses = [\n RequestStatus.Compiling,\n RequestStatus.RequestMade,\n RequestStatus.Delayed,\n RequestStatus.Approving,\n RequestStatus.Secondary,\n RequestStatus.Enriching,\n RequestStatus.Waiting,\n RequestStatus.SecondaryApproving,\n ],\n concurrency = 50,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The request actions that should be restarted */\n requestActions: RequestAction[];\n /** Transcend API key authentication */\n auth: string;\n /** Concurrency limit for approving */\n concurrency?: number;\n /** The request statuses to cancel */\n statuses?: RequestStatus[];\n /** The set of privacy requests to cancel */\n requestIds?: string[];\n /** Mark these requests as silent mode if they were created before this date */\n silentModeBefore?: Date;\n /** Filter for requests created before this date */\n createdAtBefore?: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** The email template to use when canceling the requests */\n cancellationTitle?: string;\n}): Promise<number> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\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\n // Grab the template with that title\n let cancelationTemplate: Template | undefined;\n if (cancellationTitle) {\n const matchingTemplates = await fetchAllTemplates(client, cancellationTitle);\n const exactTitleMatch = matchingTemplates.find(\n (template) => template.title === cancellationTitle,\n );\n if (!exactTitleMatch) {\n throw new Error(`Failed to find a template with title: \"${cancellationTitle}\"`);\n }\n cancelationTemplate = exactTitleMatch;\n }\n\n // Pull in the requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n statuses,\n requestIds,\n });\n\n // Notify Transcend\n logger.info(\n colors.magenta(\n `Canceling \"${allRequests.length}\" requests${\n cancelationTemplate ? ` Using template: ${cancelationTemplate.title}` : ''\n }.`,\n ),\n );\n\n let total = 0;\n progressBar.start(allRequests.length, 0);\n await map(\n allRequests,\n async (requestToCancel) => {\n // update request to silent mode if silentModeBefore is defined\n // and the request was created before silentModeBefore\n if (silentModeBefore && new Date(silentModeBefore) > new Date(requestToCancel.createdAt)) {\n await makeGraphQLRequest(client, UPDATE_PRIVACY_REQUEST, {\n input: {\n id: requestToCancel.id,\n isSilent: true,\n },\n });\n }\n\n // cancel the request\n await makeGraphQLRequest(client, CANCEL_PRIVACY_REQUEST, {\n input: {\n requestId: requestToCancel.id,\n ...(cancelationTemplate\n ? {\n subject: `Re: ${cancelationTemplate.subject.defaultMessage}`,\n template: cancelationTemplate.template.defaultMessage,\n }\n : {}),\n },\n });\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(`Successfully canceled ${total} requests in \"${totalTime / 1000}\" seconds!`),\n );\n return allRequests.length;\n}\n"],"mappings":"gcAuBA,eAAsB,EAAsB,CAC1C,iBACA,oBACA,OACA,aACA,mBACA,kBACA,iBACA,kBACA,iBACA,WAAW,CACT,EAAc,UACd,EAAc,YACd,EAAc,QACd,EAAc,UACd,EAAc,UACd,EAAc,UACd,EAAc,QACd,EAAc,mBACf,CACD,cAAc,GACd,eAAe,GA0BG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAGjF,EACJ,GAAI,EAAmB,CAErB,IAAM,GADoB,MAAM,EAAkB,EAAQ,EAAkB,EAClC,KACvC,GAAa,EAAS,QAAU,EAClC,CACD,GAAI,CAAC,EACH,MAAU,MAAM,0CAA0C,EAAkB,GAAG,CAEjF,EAAsB,EAIxB,IAAM,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,kBACA,iBACA,kBACA,iBACA,WACA,aACD,CAAC,CAGF,EAAO,KACL,EAAO,QACL,cAAc,EAAY,OAAO,YAC/B,EAAsB,oBAAoB,EAAoB,QAAU,GACzE,GACF,CACF,CAED,IAAI,EAAQ,EACZ,EAAY,MAAM,EAAY,OAAQ,EAAE,CACxC,MAAM,EACJ,EACA,KAAO,IAAoB,CAGrB,GAAoB,IAAI,KAAK,EAAiB,CAAG,IAAI,KAAK,EAAgB,UAAU,EACtF,MAAM,EAAmB,EAAQ,EAAwB,CACvD,MAAO,CACL,GAAI,EAAgB,GACpB,SAAU,GACX,CACF,CAAC,CAIJ,MAAM,EAAmB,EAAQ,EAAwB,CACvD,MAAO,CACL,UAAW,EAAgB,GAC3B,GAAI,EACA,CACE,QAAS,OAAO,EAAoB,QAAQ,iBAC5C,SAAU,EAAoB,SAAS,eACxC,CACD,EAAE,CACP,CACF,CAAC,CAEF,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAKvB,OAHA,EAAO,KACL,EAAO,MAAM,yBAAyB,EAAM,gBAAgB,EAAY,IAAK,YAAY,CAC1F,CACM,EAAY"}
|
package/dist/codecs-Dx_vGxsl.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{PreferenceQueryResponseItem as e,PreferenceStoreIdentifier as t,PreferenceUpdateItem as n}from"@transcend-io/privacy-types";import*as r from"io-ts";const i=r.type({purpose:r.string,preference:r.union([r.string,r.null]),valueMapping:r.record(r.string,r.union([r.string,r.boolean,r.null,r.undefined]))});r.record(r.string,i);const a=r.type({name:r.string,isUniqueOnPreferenceStore:r.boolean});r.record(r.string,a);const o=r.type({key:r.string});r.record(r.string,o);const s=r.intersection([r.type({columnToPurposeName:r.record(r.string,i),lastFetchedAt:r.string,pendingSafeUpdates:r.record(r.string,r.record(r.string,r.string)),pendingConflictUpdates:r.record(r.string,r.type({record:e,row:r.record(r.string,r.string)})),skippedUpdates:r.record(r.string,r.record(r.string,r.string))}),r.partial({identifierColumn:r.string,timestampColum:r.string})]);r.record(r.string,r.union([r.boolean,n])),r.record(r.string,r.union([r.boolean,r.record(r.string,r.string)])),r.record(r.string,r.type({uploadedAt:r.string,error:r.string,update:n})),r.record(r.string,r.type({record:e,row:r.record(r.string,r.string)})),r.record(r.string,r.record(r.string,r.string));const c=r.type({fileMetadata:r.record(r.string,s),failingUpdates:r.record(r.string,r.type({uploadedAt:r.string,error:r.string,update:n})),pendingUpdates:r.record(r.string,n)});r.type({records:r.array(r.type({anchorIdentifier:t,timestamp:r.string}))});const l=r.intersection([r.type({records:r.array(r.intersection([r.type({success:r.boolean}),r.partial({errorMessage:r.string})])),failures:r.array(r.type({index:r.number,error:r.string}))}),r.partial({errors:r.array(r.string)})]),u=r.type({name:r.string,value:r.string});export{l as n,c as r,u as t};
|
|
2
|
-
//# sourceMappingURL=codecs-Dx_vGxsl.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-Dx_vGxsl.mjs","names":[],"sources":["../src/lib/preference-management/codecs.ts"],"sourcesContent":["import {\n PreferenceQueryResponseItem,\n PreferenceStoreIdentifier,\n PreferenceUpdateItem,\n} from '@transcend-io/privacy-types';\nimport * as t from 'io-ts';\n\nexport const PurposeRowMapping = t.type({\n /**\n * The slug or trackingType of the purpose to map to\n *\n * e.g. `Marketing`\n */\n purpose: t.string,\n /**\n * If the column maps to a preference instead of a purpose\n * this is the slug of the purpose.\n *\n * null value indicates that this column maps to the true/false\n * value of the purpose\n */\n preference: t.union([t.string, t.null]),\n /**\n * The mapping between each row value and purpose/preference value.\n *\n * e.g. for a boolean preference or purpose\n * {\n * 'true': true,\n * 'false': false,\n * '': true,\n * }\n *\n * or for a single or multi select preference\n * {\n * '': true,\n * 'value1': 'Value1',\n * 'value2': 'Value2',\n * }\n */\n valueMapping: t.record(t.string, t.union([t.string, t.boolean, t.null, t.undefined])),\n});\n\n/** Override type */\nexport type PurposeRowMapping = t.TypeOf<typeof PurposeRowMapping>;\n\n/**\n * Mapping of column name to purpose row mapping.\n * This is used to map each column in the CSV to the relevant purpose and preference definitions in\n * transcend.\n */\nexport const ColumnPurposeMap = t.record(t.string, PurposeRowMapping);\n\n/** Override type */\nexport type ColumnPurposeMap = t.TypeOf<typeof ColumnPurposeMap>;\n\nexport const IdentifierMetadataForPreference = t.type({\n /** The identifier name */\n name: t.string,\n /** Is unique on preference store */\n isUniqueOnPreferenceStore: t.boolean,\n});\n\n/** Override type */\nexport type IdentifierMetadataForPreference = t.TypeOf<typeof IdentifierMetadataForPreference>;\n\n/**\n * Mapping of identifier name to the column name in the CSV file.\n * This is used to map each identifier name to the column in the CSV file.\n */\nexport const ColumnIdentifierMap = t.record(t.string, IdentifierMetadataForPreference);\n\n/** Override type */\nexport type ColumnIdentifierMap = t.TypeOf<typeof ColumnIdentifierMap>;\n\n/** Mapping of a CSV column to a metadata key in the preference store. */\nexport const MetadataMapping = t.type({\n /** The metadata key name in the preference store */\n key: t.string,\n});\n\n/** Override type */\nexport type MetadataMapping = t.TypeOf<typeof MetadataMapping>;\n\n/** Record mapping CSV column names to metadata keys. */\nexport const ColumnMetadataMap = t.record(t.string, MetadataMapping);\n\n/** Override type */\nexport type ColumnMetadataMap = t.TypeOf<typeof ColumnMetadataMap>;\n\nexport const FileMetadataState = t.intersection([\n t.type({\n /**\n * Definition of how to map each column in the CSV to\n * the relevant purpose and preference definitions in transcend\n */\n columnToPurposeName: t.record(t.string, PurposeRowMapping),\n /** Last time the file was last parsed at */\n lastFetchedAt: t.string,\n /**\n * Mapping of userId to the rows in the file that need to be uploaded\n * These uploads are overwriting non-existent preferences and are safe\n */\n pendingSafeUpdates: t.record(t.string, t.record(t.string, t.string)),\n /**\n * Mapping of userId to the rows in the file that need to be uploaded\n * these records have conflicts with existing consent preferences\n */\n pendingConflictUpdates: t.record(\n t.string,\n t.type({\n record: PreferenceQueryResponseItem,\n row: t.record(t.string, t.string),\n }),\n ),\n /**\n * Mapping of userId to the rows in the file that can be skipped because\n * their preferences are already in the store\n */\n skippedUpdates: t.record(t.string, t.record(t.string, t.string)),\n }),\n t.partial({\n /** Determine which column name in file maps to consent record identifier to upload on */\n identifierColumn: t.string,\n /** Determine which column name in file maps to the timestamp */\n timestampColum: t.string,\n }),\n]);\n\n/** Override type */\nexport type FileMetadataState = t.TypeOf<typeof FileMetadataState>;\n\n/**\n * This is the type of the receipts that are stored in the file\n * that is used to track the state of the upload process.\n * It is used to resume the upload process from where it left off.\n * It is used to persist the state of the upload process across multiple runs.\n */\nexport const PreferenceUpdateMap = t.record(\n t.string,\n // This can either be true to indicate the record is pending\n // or it can be an object showing the object\n // We only return a fixed number of results to avoid\n // making the JSON file too large\n t.union([t.boolean, PreferenceUpdateItem]),\n);\n\n/** Override type */\nexport type PreferenceUpdateMap = t.TypeOf<typeof PreferenceUpdateMap>;\n\n/**\n * This is the type of the pending updates that are safe to run without\n * conflicts with existing consent preferences.\n *\n * Key is primaryKey of the record in the file.\n * The value is the row in the file that is safe to upload.\n */\nexport const PendingSafePreferenceUpdates = t.record(\n t.string,\n // This can either be true to indicate the record is safe\n // or it can be an object showing the object\n // We only return a fixed number of results to avoid\n // making the JSON file too large\n t.union([t.boolean, t.record(t.string, t.string)]),\n);\n\n/** Override type */\nexport type PendingSafePreferenceUpdates = t.TypeOf<typeof PendingSafePreferenceUpdates>;\n\n/**\n * These are the updates that failed to be uploaded to the API.\n */\nexport const FailingPreferenceUpdates = t.record(\n t.string,\n t.type({\n /** Time upload ran at */\n uploadedAt: t.string,\n /** Attempts to upload that resulted in an error */\n error: t.string,\n /** The update body */\n update: PreferenceUpdateItem,\n }),\n);\n\n/** Override type */\nexport type FailingPreferenceUpdates = t.TypeOf<typeof FailingPreferenceUpdates>;\n\n/**\n * This is the type of the pending updates that are in conflict with existing consent preferences.\n *\n * Key is primaryKey of the record in the file.\n * The value is the row in the file that is pending upload.\n */\nexport const PendingWithConflictPreferenceUpdates = t.record(\n t.string,\n // We always return the conflicts for investigation\n t.type({\n /** Record to be inserted to transcend v1/preferences API */\n record: PreferenceQueryResponseItem,\n /** The row in the file that is pending upload */\n row: t.record(t.string, t.string),\n }),\n);\n\n/** Override type */\nexport type PendingWithConflictPreferenceUpdates = t.TypeOf<\n typeof PendingWithConflictPreferenceUpdates\n>;\n\n/**\n * The set of preference updates that are skipped\n * Key is primaryKey and value is the row in the CSV\n * that is skipped.\n *\n * This is usually because the preferences are already in the store\n * or there are duplicate rows in the CSV file that are identical.\n */\nexport const SkippedPreferenceUpdates = t.record(t.string, t.record(t.string, t.string));\n\n/** Override type */\nexport type SkippedPreferenceUpdates = t.TypeOf<typeof SkippedPreferenceUpdates>;\n\n/** Persist this data between runs of the script */\nexport const PreferenceState = t.type({\n /**\n * Store a cache of previous files read in\n */\n fileMetadata: t.record(t.string, FileMetadataState),\n /**\n * The set of successful uploads to Transcend\n * Mapping from userId to the upload metadata\n */\n failingUpdates: t.record(\n t.string,\n t.type({\n /** Time upload ran at */\n uploadedAt: t.string,\n /** Attempts to upload that resulted in an error */\n error: t.string,\n /** The update body */\n update: PreferenceUpdateItem,\n }),\n ),\n /**\n * The set of pending uploads to Transcend\n * Mapping from userId to the upload metadata\n */\n pendingUpdates: t.record(t.string, PreferenceUpdateItem),\n});\n\n/** Override type */\nexport type PreferenceState = t.TypeOf<typeof PreferenceState>;\n\nexport const DeletePreferenceRecordsInput = t.type({\n /** Array of consent preference records to delete */\n records: t.array(\n t.type({\n /** The anchor identifier to locate the consent record */\n anchorIdentifier: PreferenceStoreIdentifier,\n /** The ISO 8601 timestamp of when the deletion is requested */\n timestamp: t.string,\n }),\n ),\n});\n\n/** Override type */\nexport type DeletePreferenceRecordsInput = t.TypeOf<typeof DeletePreferenceRecordsInput>;\n\nexport const DeletePreferenceRecordsResponse = t.intersection([\n t.type({\n /** Array of results for each preference record deletion */\n records: t.array(\n t.intersection([\n t.type({\n /** Whether the deletion was successful */\n success: t.boolean,\n }),\n t.partial({\n /** An error message if the deletion failed */\n errorMessage: t.string,\n }),\n ]),\n ),\n /** The list of failed deletions with their respective errors */\n failures: t.array(\n t.type({\n /** The index of the failed update in the original request */\n index: t.number,\n /** The error message associated with the failure */\n error: t.string,\n }),\n ),\n }),\n t.partial({\n /** Any general errors that occurred during the operation */\n errors: t.array(t.string),\n }),\n]);\n\n/** Override type */\nexport type DeletePreferenceRecordsResponse = t.TypeOf<typeof DeletePreferenceRecordsResponse>;\n\n/** CLI CSV Row for deleting preference records */\nexport const DeletePreferenceRecordCliCsvRow = t.type({\n /** The name of the identifier type (e.g., email, userId) */\n name: t.string,\n /** The value of the identifier */\n value: t.string,\n});\n\n/** Override type */\nexport type DeletePreferenceRecordCliCsvRow = t.TypeOf<typeof DeletePreferenceRecordCliCsvRow>;\n"],"mappings":"2JAOA,MAAa,EAAoB,EAAE,KAAK,CAMtC,QAAS,EAAE,OAQX,WAAY,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,KAAK,CAAC,CAkBvC,aAAc,EAAE,OAAO,EAAE,OAAQ,EAAE,MAAM,CAAC,EAAE,OAAQ,EAAE,QAAS,EAAE,KAAM,EAAE,UAAU,CAAC,CAAC,CACtF,CAAC,CAU8B,EAAE,OAAO,EAAE,OAAQ,EAAkB,CAKrE,MAAa,EAAkC,EAAE,KAAK,CAEpD,KAAM,EAAE,OAER,0BAA2B,EAAE,QAC9B,CAAC,CASiC,EAAE,OAAO,EAAE,OAAQ,EAAgC,CAMtF,MAAa,EAAkB,EAAE,KAAK,CAEpC,IAAK,EAAE,OACR,CAAC,CAM+B,EAAE,OAAO,EAAE,OAAQ,EAAgB,CAKpE,MAAa,EAAoB,EAAE,aAAa,CAC9C,EAAE,KAAK,CAKL,oBAAqB,EAAE,OAAO,EAAE,OAAQ,EAAkB,CAE1D,cAAe,EAAE,OAKjB,mBAAoB,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAAC,CAKpE,uBAAwB,EAAE,OACxB,EAAE,OACF,EAAE,KAAK,CACL,OAAQ,EACR,IAAK,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAClC,CAAC,CACH,CAKD,eAAgB,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAAC,CACjE,CAAC,CACF,EAAE,QAAQ,CAER,iBAAkB,EAAE,OAEpB,eAAgB,EAAE,OACnB,CAAC,CACH,CAAC,CAWiC,EAAE,OACnC,EAAE,OAKF,EAAE,MAAM,CAAC,EAAE,QAAS,EAAqB,CAAC,CAC3C,CAY2C,EAAE,OAC5C,EAAE,OAKF,EAAE,MAAM,CAAC,EAAE,QAAS,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAAC,CAAC,CACnD,CAQuC,EAAE,OACxC,EAAE,OACF,EAAE,KAAK,CAEL,WAAY,EAAE,OAEd,MAAO,EAAE,OAET,OAAQ,EACT,CAAC,CACH,CAWmD,EAAE,OACpD,EAAE,OAEF,EAAE,KAAK,CAEL,OAAQ,EAER,IAAK,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAClC,CAAC,CACH,CAeuC,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAAC,CAMxF,MAAa,EAAkB,EAAE,KAAK,CAIpC,aAAc,EAAE,OAAO,EAAE,OAAQ,EAAkB,CAKnD,eAAgB,EAAE,OAChB,EAAE,OACF,EAAE,KAAK,CAEL,WAAY,EAAE,OAEd,MAAO,EAAE,OAET,OAAQ,EACT,CAAC,CACH,CAKD,eAAgB,EAAE,OAAO,EAAE,OAAQ,EAAqB,CACzD,CAAC,CAK0C,EAAE,KAAK,CAEjD,QAAS,EAAE,MACT,EAAE,KAAK,CAEL,iBAAkB,EAElB,UAAW,EAAE,OACd,CAAC,CACH,CACF,CAAC,CAKF,MAAa,EAAkC,EAAE,aAAa,CAC5D,EAAE,KAAK,CAEL,QAAS,EAAE,MACT,EAAE,aAAa,CACb,EAAE,KAAK,CAEL,QAAS,EAAE,QACZ,CAAC,CACF,EAAE,QAAQ,CAER,aAAc,EAAE,OACjB,CAAC,CACH,CAAC,CACH,CAED,SAAU,EAAE,MACV,EAAE,KAAK,CAEL,MAAO,EAAE,OAET,MAAO,EAAE,OACV,CAAC,CACH,CACF,CAAC,CACF,EAAE,QAAQ,CAER,OAAQ,EAAE,MAAM,EAAE,OAAO,CAC1B,CAAC,CACH,CAAC,CAMW,EAAkC,EAAE,KAAK,CAEpD,KAAM,EAAE,OAER,MAAO,EAAE,OACV,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./enums-CyFTrzXY.mjs";import{ScopeName as t,TRANSCEND_SCOPES as n}from"@transcend-io/privacy-types";import{keyBy as r}from"lodash-es";const i=`transcend`,a=`https://app.transcend.io`,o=`${a}/infrastructure/integrations`,s=`${a}/data-map/data-inventory/data-points`,c=process.env.TRANSCEND_API_URL||`https://api.transcend.io`,l=process.env.TRANSCEND_CONSENT_API_URL||`https://consent.transcend.io`,u={[e.ApiKeys]:[t.ViewApiKeys],[e.Templates]:[t.ManageEmailTemplates],[e.DataSilos]:[t.ManageDataMap,t.ConnectDataSilos],[e.Enrichers]:[t.ManageRequestIdentities],[e.BusinessEntities]:[t.ManageDataInventory],[e.ProcessingActivities]:[t.ManageDataMap],[e.Identifiers]:[t.ManageRequestIdentities],[e.Attributes]:[t.ManageGlobalAttributes],[e.DataFlows]:[t.ManageDataFlow],[e.Cookies]:[t.ManageDataFlow],[e.ConsentManager]:[t.ManageConsentManagerDeveloperSettings],[e.Partitions]:[t.ManageConsentManagerDeveloperSettings],[e.Actions]:[t.ManageDataSubjectRequestSettings],[e.DataSubjects]:[t.ManageDataSubjectRequestSettings],[e.Prompts]:[t.ManagePrompts],[e.PromptPartials]:[t.ManagePrompts],[e.PromptGroups]:[t.ManagePrompts],[e.Agents]:[t.ManagePathfinder],[e.AgentFunctions]:[t.ManagePathfinder],[e.AgentFiles]:[t.ManagePathfinder],[e.Vendors]:[t.ManageDataInventory],[e.DataCategories]:[t.ManageDataInventory],[e.ProcessingPurposes]:[t.ManageDataInventory],[e.ActionItems]:[t.ManageAllActionItems,t.ViewGlobalAttributes],[e.ActionItemCollections]:[t.ManageActionItemCollections],[e.Teams]:[t.ManageAccessControl],[e.Messages]:[t.ManageIntlMessages],[e.PrivacyCenters]:[t.ManagePrivacyCenter],[e.Policies]:[t.ManagePolicies],[e.Assessments]:[t.ManageAssessments],[e.AssessmentTemplates]:[t.ManageAssessments],[e.Purposes]:[t.ManageConsentManager,t.ManagePreferenceStoreSettings],[e.SystemDiscovery]:[t.ManageDataMap]},d={[e.ApiKeys]:[t.ViewApiKeys],[e.Templates]:[t.ViewEmailTemplates],[e.DataSilos]:[t.ViewDataMap,t.ViewDataSubjectRequestSettings],[e.Enrichers]:[t.ViewRequestIdentitySettings],[e.BusinessEntities]:[t.ViewDataInventory],[e.ProcessingActivities]:[t.ViewDataInventory],[e.Identifiers]:[t.ViewRequestIdentitySettings],[e.Attributes]:[t.ViewGlobalAttributes],[e.DataFlows]:[t.ViewDataFlow],[e.Cookies]:[t.ViewDataFlow],[e.ConsentManager]:[t.ViewConsentManager],[e.Partitions]:[t.ViewConsentManager],[e.Actions]:[t.ViewDataSubjectRequestSettings],[e.DataSubjects]:[t.ViewDataSubjectRequestSettings],[e.Prompts]:[t.ViewPrompts],[e.PromptPartials]:[t.ViewPrompts],[e.PromptGroups]:[t.ViewPrompts],[e.Agents]:[t.ViewPathfinder],[e.AgentFunctions]:[t.ViewPathfinder],[e.AgentFiles]:[t.ViewPathfinder],[e.Vendors]:[t.ViewDataInventory],[e.DataCategories]:[t.ViewDataInventory],[e.ProcessingPurposes]:[t.ViewDataInventory],[e.ActionItemCollections]:[t.ViewAllActionItems],[e.ActionItems]:[t.ViewAllActionItems],[e.Teams]:[t.ViewScopes],[e.Messages]:[t.ViewIntlMessages],[e.PrivacyCenters]:[t.ViewPrivacyCenter],[e.Policies]:[t.ViewPolicies],[e.Assessments]:[t.ViewAssessments],[e.AssessmentTemplates]:[t.ViewAssessments],[e.Purposes]:[t.ViewConsentManager,t.ViewPreferenceStoreSettings],[e.SystemDiscovery]:[t.ViewDataMap]},f={[e.ApiKeys]:`api-keys`,[e.Attributes]:`attributes`,[e.DataFlows]:`data-flows`,[e.Cookies]:`cookies`,[e.ConsentManager]:`consent-manager`,[e.Partitions]:`partitions`,[e.Actions]:`actions`,[e.DataSubjects]:`data-subjects`,[e.BusinessEntities]:`business-entities`,[e.ProcessingActivities]:`processing-activities`,[e.Identifiers]:`identifiers`,[e.Enrichers]:`enrichers`,[e.DataSilos]:`data-silos`,[e.Templates]:`templates`,[e.Prompts]:`prompts`,[e.PromptPartials]:`prompt-partials`,[e.PromptGroups]:`prompt-groups`,[e.Agents]:`agents`,[e.AgentFunctions]:`agent-functions`,[e.AgentFiles]:`agent-files`,[e.Vendors]:`vendors`,[e.DataCategories]:`data-categories`,[e.ProcessingPurposes]:`processing-purposes`,[e.ActionItems]:`action-items`,[e.ActionItemCollections]:`action-item-collections`,[e.Teams]:`teams`,[e.Messages]:`messages`,[e.PrivacyCenters]:`privacy-center`,[e.Policies]:`policies`,[e.Assessments]:`assessments`,[e.AssessmentTemplates]:`assessment-templates`,[e.Purposes]:`purposes`,[e.SystemDiscovery]:`system-discovery`},p=r(Object.entries(n).map(([e,t])=>({...t,name:e})),`title`),m=Object.keys(p),h=new Set([429,502,500,504,329]),g=process.env.DEBUG===`1`;export{c as a,p as c,u as d,f,g as i,m as l,s as n,l as o,i as p,o as r,h as s,a as t,d as u};
|
|
2
|
-
//# sourceMappingURL=constants-CeMiHaHx.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-CeMiHaHx.mjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { ScopeName, TRANSCEND_SCOPES, type ScopeDefinition } from '@transcend-io/privacy-types';\nimport { keyBy } from 'lodash-es';\n\nimport { TranscendInput } from './codecs.js';\nimport { TranscendPullResource } from './enums.js';\n\nexport { description, version } from '../package.json';\n/**\n * The name of the main binary for the CLI\n */\nexport const name = 'transcend';\n\nexport const ADMIN_DASH = 'https://app.transcend.io';\n\nexport const ADMIN_DASH_INTEGRATIONS = `${ADMIN_DASH}/infrastructure/integrations`;\nexport const ADMIN_DASH_DATAPOINTS = `${ADMIN_DASH}/data-map/data-inventory/data-points`;\n\n/**\n * Override default transcend API url using\n * TRANSCEND_API_URL=https://api.us.transcend.io transcend ...\n */\nexport const DEFAULT_TRANSCEND_API = process.env.TRANSCEND_API_URL || 'https://api.transcend.io';\n\n/**\n * Override default transcend API url using\n * TRANSCEND_CONSENT_API_URL=https://consent.us.transcend.io transcend ...\n */\nexport const DEFAULT_TRANSCEND_CONSENT_API =\n process.env.TRANSCEND_CONSENT_API_URL || 'https://consent.transcend.io';\n\n/**\n * Mapping between resource type and scopes required for cli\n */\nexport const TR_PUSH_RESOURCE_SCOPE_MAP: {\n [k in TranscendPullResource]: ScopeName[];\n} = {\n [TranscendPullResource.ApiKeys]: [ScopeName.ViewApiKeys],\n [TranscendPullResource.Templates]: [ScopeName.ManageEmailTemplates],\n [TranscendPullResource.DataSilos]: [ScopeName.ManageDataMap, ScopeName.ConnectDataSilos],\n [TranscendPullResource.Enrichers]: [ScopeName.ManageRequestIdentities],\n [TranscendPullResource.BusinessEntities]: [ScopeName.ManageDataInventory],\n [TranscendPullResource.ProcessingActivities]: [ScopeName.ManageDataMap],\n [TranscendPullResource.Identifiers]: [ScopeName.ManageRequestIdentities],\n [TranscendPullResource.Attributes]: [ScopeName.ManageGlobalAttributes],\n [TranscendPullResource.DataFlows]: [ScopeName.ManageDataFlow],\n [TranscendPullResource.Cookies]: [ScopeName.ManageDataFlow],\n [TranscendPullResource.ConsentManager]: [ScopeName.ManageConsentManagerDeveloperSettings],\n [TranscendPullResource.Partitions]: [ScopeName.ManageConsentManagerDeveloperSettings],\n [TranscendPullResource.Actions]: [ScopeName.ManageDataSubjectRequestSettings],\n [TranscendPullResource.DataSubjects]: [ScopeName.ManageDataSubjectRequestSettings],\n [TranscendPullResource.Prompts]: [ScopeName.ManagePrompts],\n [TranscendPullResource.PromptPartials]: [ScopeName.ManagePrompts],\n [TranscendPullResource.PromptGroups]: [ScopeName.ManagePrompts],\n [TranscendPullResource.Agents]: [ScopeName.ManagePathfinder],\n [TranscendPullResource.AgentFunctions]: [ScopeName.ManagePathfinder],\n [TranscendPullResource.AgentFiles]: [ScopeName.ManagePathfinder],\n [TranscendPullResource.Vendors]: [ScopeName.ManageDataInventory],\n [TranscendPullResource.DataCategories]: [ScopeName.ManageDataInventory],\n [TranscendPullResource.ProcessingPurposes]: [ScopeName.ManageDataInventory],\n [TranscendPullResource.ActionItems]: [\n ScopeName.ManageAllActionItems,\n ScopeName.ViewGlobalAttributes,\n ],\n [TranscendPullResource.ActionItemCollections]: [ScopeName.ManageActionItemCollections],\n [TranscendPullResource.Teams]: [ScopeName.ManageAccessControl],\n [TranscendPullResource.Messages]: [ScopeName.ManageIntlMessages],\n [TranscendPullResource.PrivacyCenters]: [ScopeName.ManagePrivacyCenter],\n [TranscendPullResource.Policies]: [ScopeName.ManagePolicies],\n [TranscendPullResource.Assessments]: [ScopeName.ManageAssessments],\n [TranscendPullResource.AssessmentTemplates]: [ScopeName.ManageAssessments],\n [TranscendPullResource.Purposes]: [\n ScopeName.ManageConsentManager,\n ScopeName.ManagePreferenceStoreSettings,\n ],\n [TranscendPullResource.SystemDiscovery]: [ScopeName.ManageDataMap],\n};\n\n/**\n * Mapping between resource type and scopes required for cli\n */\nexport const TR_PULL_RESOURCE_SCOPE_MAP: {\n [k in TranscendPullResource]: ScopeName[];\n} = {\n [TranscendPullResource.ApiKeys]: [ScopeName.ViewApiKeys],\n [TranscendPullResource.Templates]: [ScopeName.ViewEmailTemplates],\n [TranscendPullResource.DataSilos]: [\n ScopeName.ViewDataMap,\n ScopeName.ViewDataSubjectRequestSettings,\n ],\n [TranscendPullResource.Enrichers]: [ScopeName.ViewRequestIdentitySettings],\n [TranscendPullResource.BusinessEntities]: [ScopeName.ViewDataInventory],\n [TranscendPullResource.ProcessingActivities]: [ScopeName.ViewDataInventory],\n [TranscendPullResource.Identifiers]: [ScopeName.ViewRequestIdentitySettings],\n [TranscendPullResource.Attributes]: [ScopeName.ViewGlobalAttributes],\n [TranscendPullResource.DataFlows]: [ScopeName.ViewDataFlow],\n [TranscendPullResource.Cookies]: [ScopeName.ViewDataFlow],\n [TranscendPullResource.ConsentManager]: [ScopeName.ViewConsentManager],\n [TranscendPullResource.Partitions]: [ScopeName.ViewConsentManager],\n [TranscendPullResource.Actions]: [ScopeName.ViewDataSubjectRequestSettings],\n [TranscendPullResource.DataSubjects]: [ScopeName.ViewDataSubjectRequestSettings],\n [TranscendPullResource.Prompts]: [ScopeName.ViewPrompts],\n [TranscendPullResource.PromptPartials]: [ScopeName.ViewPrompts],\n [TranscendPullResource.PromptGroups]: [ScopeName.ViewPrompts],\n [TranscendPullResource.Agents]: [ScopeName.ViewPathfinder],\n [TranscendPullResource.AgentFunctions]: [ScopeName.ViewPathfinder],\n [TranscendPullResource.AgentFiles]: [ScopeName.ViewPathfinder],\n [TranscendPullResource.Vendors]: [ScopeName.ViewDataInventory],\n [TranscendPullResource.DataCategories]: [ScopeName.ViewDataInventory],\n [TranscendPullResource.ProcessingPurposes]: [ScopeName.ViewDataInventory],\n [TranscendPullResource.ActionItemCollections]: [ScopeName.ViewAllActionItems],\n [TranscendPullResource.ActionItems]: [ScopeName.ViewAllActionItems],\n [TranscendPullResource.Teams]: [ScopeName.ViewScopes],\n [TranscendPullResource.Messages]: [ScopeName.ViewIntlMessages],\n [TranscendPullResource.PrivacyCenters]: [ScopeName.ViewPrivacyCenter],\n [TranscendPullResource.Policies]: [ScopeName.ViewPolicies],\n [TranscendPullResource.Assessments]: [ScopeName.ViewAssessments],\n [TranscendPullResource.AssessmentTemplates]: [ScopeName.ViewAssessments],\n [TranscendPullResource.Purposes]: [\n ScopeName.ViewConsentManager,\n ScopeName.ViewPreferenceStoreSettings,\n ],\n [TranscendPullResource.SystemDiscovery]: [ScopeName.ViewDataMap],\n};\n\nexport const TR_YML_RESOURCE_TO_FIELD_NAME: Record<TranscendPullResource, keyof TranscendInput> = {\n [TranscendPullResource.ApiKeys]: 'api-keys',\n [TranscendPullResource.Attributes]: 'attributes',\n [TranscendPullResource.DataFlows]: 'data-flows',\n [TranscendPullResource.Cookies]: 'cookies',\n [TranscendPullResource.ConsentManager]: 'consent-manager',\n [TranscendPullResource.Partitions]: 'partitions',\n [TranscendPullResource.Actions]: 'actions',\n [TranscendPullResource.DataSubjects]: 'data-subjects',\n [TranscendPullResource.BusinessEntities]: 'business-entities',\n [TranscendPullResource.ProcessingActivities]: 'processing-activities',\n [TranscendPullResource.Identifiers]: 'identifiers',\n [TranscendPullResource.Enrichers]: 'enrichers',\n [TranscendPullResource.DataSilos]: 'data-silos',\n [TranscendPullResource.Templates]: 'templates',\n [TranscendPullResource.Prompts]: 'prompts',\n [TranscendPullResource.PromptPartials]: 'prompt-partials',\n [TranscendPullResource.PromptGroups]: 'prompt-groups',\n [TranscendPullResource.Agents]: 'agents',\n [TranscendPullResource.AgentFunctions]: 'agent-functions',\n [TranscendPullResource.AgentFiles]: 'agent-files',\n [TranscendPullResource.Vendors]: 'vendors',\n [TranscendPullResource.DataCategories]: 'data-categories',\n [TranscendPullResource.ProcessingPurposes]: 'processing-purposes',\n [TranscendPullResource.ActionItems]: 'action-items',\n [TranscendPullResource.ActionItemCollections]: 'action-item-collections',\n [TranscendPullResource.Teams]: 'teams',\n [TranscendPullResource.Messages]: 'messages',\n [TranscendPullResource.PrivacyCenters]: 'privacy-center',\n [TranscendPullResource.Policies]: 'policies',\n [TranscendPullResource.Assessments]: 'assessments',\n [TranscendPullResource.AssessmentTemplates]: 'assessment-templates',\n [TranscendPullResource.Purposes]: 'purposes',\n [TranscendPullResource.SystemDiscovery]: 'system-discovery',\n};\n\nexport const SCOPES_BY_TITLE = keyBy(\n Object.entries(TRANSCEND_SCOPES).map(([name, value]) => ({\n ...value,\n name,\n })),\n 'title',\n) as Record<\n string,\n ScopeDefinition & {\n /** The camelCased name which identifies the scope */\n name: ScopeName;\n }\n>;\n\nexport const SCOPE_TITLES = Object.keys(SCOPES_BY_TITLE);\n\n/**\n * HTTP statuses that should be retried *in place* without splitting.\n * 429: Rate-limited\n * 502: Upstream/edge gateway error\n * 329: Reserved for custom infra (kept defensively)\n */\nexport const RETRYABLE_BATCH_STATUSES = new Set([429, 502, 500, 504, 329] as const);\n\n/**\n * Debugging\n */\nexport const DEBUG = process.env.DEBUG === '1';\n"],"mappings":"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"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./constants-CeMiHaHx.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./RateCounter-DFL_mnk2.mjs";import{closeSync as r,createReadStream as i,createWriteStream as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,readdirSync as u,statSync as d,unlinkSync as f,writeFileSync as p}from"node:fs";import{availableParallelism as m,platform as h}from"node:os";import{basename as g,join as _}from"node:path";import v from"colors";import{fork as y,spawn as b}from"node:child_process";import*as x from"node:readline";function S(e,t){let n=Math.max(1,m?.()??1);return{poolSize:typeof e==`number`&&e>0?Math.min(e,t):Math.min(n,t),cpuCount:n}}function C(e){return`'${String(e).replace(/'/g,`'\\''`)}'`}function w(e,n,r=!1){if(r)return;let i=h();try{if(i===`darwin`){b(`osascript`,[`-e`,`
|
|
2
|
-
tell application "Terminal"
|
|
3
|
-
activate
|
|
4
|
-
do script "printf '\\e]0;${n}\\a'; tail -n +1 -f ${e.map(C).join(` -f `)}"
|
|
5
|
-
end tell
|
|
6
|
-
`],{stdio:`ignore`,detached:!0});return}if(i===`win32`){b(`cmd.exe`,[`/c`,`start`,...[`powershell`,`-NoExit`,`-Command`,`Write-Host '${n}'; $paths = ${`@(${e.map(e=>`'${e.replace(/'/g,`''`)}'`).join(`,`)})`}; Get-Content -Path $paths -Tail 200 -Wait`]],{stdio:`ignore`,detached:!0}).unref();return}let t=e.map(C).join(` -f `);try{b(`gnome-terminal`,[`--`,`bash`,`-lc`,`printf '\\e]0;${n}\\a'; tail -n +1 -f ${t}`],{stdio:`ignore`,detached:!0}).unref()}catch{b(`xterm`,[`-title`,n,`-e`,`tail -n +1 -f ${e.join(` `)}`],{stdio:`ignore`,detached:!0}).unref()}}catch(e){throw t.error(v.red(`Failed to open terminal window for tailing logs: ${e instanceof Error?e.message:String(e)}`)),e}}function T(e){o(e)||r(c(e,`a`))}function E(e,t){let n=[/worker-\d+\.log$/,/worker-\d+\.out\.log$/,/worker-\d+\.err\.log$/,/worker-\d+\.warn\.log$/,/worker-\d+\.info\.log$/];for(let r of u(e)){if(!n.some(e=>e.test(r)))continue;let i=_(e,r);try{t===`delete`&&o(i)?f(i):p(i,``)}catch{}}process.stdout.write(v.dim(`Logs have been ${t===`delete`?`deleted`:`truncated`} in ${e}\n`))}function D(e){let t=e.replace(/\x1B\[[0-9;]*m/g,``),n=/\[w\d+\]\s+(ERROR|WARN)\b/i.exec(t);if(n)return n[1].toLowerCase();if(/^\s*(ERROR|ERR|FATAL)\b/i.test(t))return`error`;if(/^\s*(WARN|WARNING)\b/.test(t)||/^\s*\(node:\d+\)\s*Warning:/i.test(t)||/^\s*DeprecationWarning:/i.test(t))return`warn`;try{let e=JSON.parse(t)?.level;if(typeof e==`number`){if(e>=50)return`error`;if(e>=40)return`warn`}else if(typeof e==`string`){let t=e.toLowerCase();if(t===`error`||t===`fatal`)return`error`;if(t===`warn`||t===`warning`)return`warn`}}catch{}let r=/\[w\d+\].*\b(WARN|WARNING|ERROR|FATAL)\b/i.exec(t);if(r){let e=r[1].toUpperCase();return e===`ERROR`||e===`FATAL`?`error`:`warn`}return null}function O(e){let t=``;return n=>{t+=n.toString(`utf8`);let r;for(;(r=t.indexOf(`
|
|
7
|
-
`))!==-1;)e(t.slice(0,r)),t=t.slice(r+1)}}function k(e){let t=_(e,`logs`);return s(t,{recursive:!0}),E(t,process.env.RESET_LOGS??`truncate`),t}const A=`--as-child`,j=Symbol(`workerLogPaths`);function M(e){return e[j]}function N(e){let t=e&&e.channel;return!!(e&&e.connected&&t&&!t.destroyed)}function P(e,t){if(!N(e))return!1;try{return e.send?.(t),!0}catch(e){if(e?.code===`ERR_IPC_CHANNEL_CLOSED`||e?.code===`EPIPE`||e?.errno===-32)return!1;throw e}}function F(e){let{id:t,modulePath:n,logDir:r,openLogWindows:i,isSilent:o,childFlag:s=A}=e,c=_(r,`worker-${t}.log`),l=_(r,`worker-${t}.out.log`),u=_(r,`worker-${t}.err.log`),d=_(r,`worker-${t}.info.log`),f=_(r,`worker-${t}.warn.log`),p=_(r,`worker-${t}.error.log`);[c,l,u,d,f,p].forEach(T);let m=y(n,[s],{stdio:[`pipe`,`pipe`,`pipe`,`ipc`],env:{...process.env,WORKER_ID:String(t),WORKER_LOG:c},execArgv:process.execArgv,silent:o}),h=a(l,{flags:`a`}),g=a(u,{flags:`a`}),v=a(d,{flags:`a`}),b=a(f,{flags:`a`}),x=a(p,{flags:`a`});m.stdout?.pipe(h),m.stderr?.pipe(g);let S=e=>`[parent] ${e} capture active for w${t} (pid ${m.pid})\n`;if(h.write(S(`stdout`)),g.write(S(`stderr`)),v.write(S(`info`)),b.write(S(`warn`)),x.write(S(`error`)),m.stdout){let e=O(e=>{if(e)try{v.write(`${e}\n`)}catch{}});m.stdout.on(`data`,e)}if(m.stderr){let e=O(e=>{if(!e)return;let t=D(e);try{t===`error`?x.write(`${e}\n`):b.write(`${e}\n`)}catch{}});m.stderr.on(`data`,e)}return m[j]={structuredPath:c,outPath:l,errPath:u,infoPath:d,warnPath:f,errorPath:p},i&&w([c,l,u,d,f,p],`worker-${t}`,o),h.on(`error`,()=>{}),g.on(`error`,()=>{}),v.on(`error`,()=>{}),b.on(`error`,()=>{}),x.on(`error`,()=>{}),m}function I(e,t,n){process.stdout.write(`\x1B[2J\x1B[H`);let r=e=>/\b(ERROR|uncaughtException|unhandledRejection)\b/i.test(e),i=e=>/\b(WARN|WARNING)\b/i.test(e),a=[];for(let[,o]of e){if(!o)continue;let e=[];for(let n of t)n===`out`&&o.outPath&&e.push({path:o.outPath,src:`out`}),n===`err`&&o.errPath&&e.push({path:o.errPath,src:`err`}),n===`structured`&&o.structuredPath&&e.push({path:o.structuredPath,src:`structured`}),o.warnPath&&n===`warn`&&e.push({path:o.warnPath,src:`warn`}),o.infoPath&&n===`info`&&e.push({path:o.infoPath,src:`info`});for(let{path:t,src:o}of e){let e=``;try{e=l(t,`utf8`)}catch{continue}for(let t of e.split(`
|
|
8
|
-
`)){if(!t)continue;let e=t.replace(/\x1B\[[0-9;]*m/g,``);if(n===`all`){a.push(t);continue}if(n===`error`){r(e)&&a.push(t);continue}if(i(e)||o===`err`&&!r(e)){a.push(t);continue}}}}a.sort((e,t)=>{let n=e.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/)?.[0]??``,r=t.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/)?.[0]??``;return n.localeCompare(r)}),process.stdout.write(`${a.join(`
|
|
9
|
-
`)}\n`),process.stdout.write(`
|
|
10
|
-
Press Esc/Ctrl+] to return to dashboard.
|
|
11
|
-
`)}function L(e,t,n){if(t.ctrl&&t.name===`c`)return{type:`CTRL_C`};if(n===`dashboard`)return t.name&&/^[0-9]$/.test(t.name)?{type:`ATTACH`,id:Number(t.name)}:t.name===`tab`&&!t.shift?{type:`CYCLE`,delta:1}:t.name===`tab`&&t.shift?{type:`CYCLE`,delta:-1}:t.name===`q`?{type:`QUIT`}:null;if(t.name===`escape`||t.ctrl&&t.name===`]`)return{type:`DETACH`};if(t.ctrl&&t.name===`d`)return{type:`CTRL_D`};let r=t.sequence??e??``;return r?{type:`FORWARD`,sequence:r}:null}async function R(e,t,n){await new Promise(r=>{try{let a=d(e),o=i(e,{start:Math.max(0,a.size-t),encoding:`utf8`});o.on(`data`,e=>n(e)),o.on(`end`,r),o.on(`error`,r)}catch{r(void 0)}})}function z(e){return[...e.keys()].sort((e,t)=>e-t)}function B(e,t,n){if(!e.length)return null;let r=t??e[0],i=e.indexOf(r);return i===-1&&(i=0),i=(i+n+e.length)%e.length,e[i]}function V(t){let{workers:n,onAttach:r,onDetach:i,onCtrlC:a,getLogPaths:o,replayBytes:s=200*1024,replayWhich:c=[`out`,`err`],onEnterAttachScreen:l,ports:u}=t,d=u?.stdin??process.stdin,f=u?.stdout??process.stdout,p=u?.stderr??process.stderr,m=(...t)=>{if(e)try{(u?.stderr??process.stderr).write(`[keys] ${t.map(String).join(` `)}\n`)}catch{}};if(!d.isTTY)return()=>{};x.emitKeypressEvents(d),d.setRawMode?.(!0);let h=`dashboard`,g=null,_=null,v=null;async function y(e){if(!o)return;let t=o(e);if(!t)return;let n=[];for(let e of c)e===`out`&&n.push(t.outPath),e===`err`&&n.push(t.errPath),e===`structured`&&n.push(t.structuredPath);if(n.length){f.write(`
|
|
12
|
-
------------ replay ------------
|
|
13
|
-
`);for(let e of n)f.write(`\n--- ${e} (last ~${Math.floor(s/1024)}KB) ---\n`),await R(e,s,e=>f.write(e));f.write(`
|
|
14
|
-
--------------------------------
|
|
15
|
-
|
|
16
|
-
`)}}let b=async e=>{m(`attach()`,`id=${e}`);let t=n.get(e);t&&(h===`attached`&&S(),h=`attached`,g=e,l?.(e),r?.(e),await y(e),_=e=>f.write(e),v=e=>p.write(e),t.stdout?.on(`data`,_),t.stderr?.on(`data`,v),t.once(`exit`,()=>{g===e&&S()}))},S=()=>{if(m(`detach()`,`id=${g}`),g==null)return;let e=g,t=n.get(e);t&&(_&&t.stdout?.off(`data`,_),v&&t.stderr?.off(`data`,v)),_=null,v=null,g=null,h=`dashboard`,i?.()},C=(e,t)=>{m(`keypress`,JSON.stringify({str:e,name:t.name,seq:t.sequence,ctrl:t.ctrl,meta:t.meta,shift:t.shift,mode:h}));let r=L(e,t,h);if(m(`mapped`,JSON.stringify(r)),r)switch(r.type){case`CTRL_C`:if(m(`CTRL_C`),h===`attached`&&g!=null){let e=n.get(g);try{e?.kill(`SIGINT`)}catch{}S();return}a?.();return;case`ATTACH`:if(m(`ATTACH`,`id=${r.id}`,`has=${n.has(r.id)}`),h!==`dashboard`)return;n.has(r.id)&&b(r.id);return;case`CYCLE`:{if(m(`CYCLE`,`delta=${r.delta}`),h!==`dashboard`)return;let e=B(z(n),g,r.delta);e!=null&&b(e);return}case`QUIT`:if(h!==`dashboard`)return;a?.();return;case`DETACH`:m(`DETACH`),h===`attached`&&S();return;case`CTRL_D`:if(h===`attached`&&g!=null){let e=n.get(g);try{e?.stdin?.end()}catch{}}return;case`FORWARD`:if(h===`attached`&&g!=null){let e=n.get(g);try{e?.stdin?.write(r.sequence)}catch{}}}},w=e=>{if(h===`attached`&&g!=null){let t=n.get(g);try{t?.stdin?.write(e)}catch{}}};return d.on(`keypress`,C),d.on(`data`,w),()=>{d.off(`keypress`,C),d.off(`data`,w),d.setRawMode?.(!1),f.write(`\x1B[?25h`)}}let H=``;const U=(e,t)=>{let n=Math.min(e-1,9),r=e<=1?`0`:`0-${n}`,i=e>10?` (Tab/Shift+Tab for ≥10)`:``;return t?v.dim(`Run complete — digits to view logs • Tab/Shift+Tab cycle • Esc/Ctrl+] detach • q to quit`):v.dim(`Hotkeys: [${r}] attach${i} • e=errors • w=warnings • i=info • l=logs • Tab/Shift+Tab • Esc/Ctrl+] detach • Ctrl+C exit`)};function W(e,t,n=!1){let r=[...t.renderHeader(e),``,...t.renderWorkers(e),...n?[]:[``,U(e.poolSize,e.final)],...t.renderExtras?[``].concat(t.renderExtras(e)):[]].join(`
|
|
17
|
-
`);!e.final&&r===H||(H=r,e.final?process.stdout.write(`\x1B[?25h`):(process.stdout.write(`\x1B[?25l`),x.cursorTo(process.stdout,0,0),x.clearScreenDown(process.stdout)),process.stdout.write(`${r}\n`))}function G(e,t,n){let r=t.get(e);if(N(r))try{let e=M(r);if(e!=null)return e}catch{}return n.get(e)}function K(e){return typeof e==`number`?e.toLocaleString():`0`}function q(e,t=40){let n=Math.max(0,Math.min(100,Math.floor(e))),r=Math.floor(n/100*t);return`█`.repeat(r)+`░`.repeat(t-r)}function J(e){let t=[...e.workerState.values()].filter(e=>e.busy).length,n=e.filesCompleted+e.filesFailed;return{done:n,inProgress:t,pct:e.filesTotal===0?100:Math.floor(n/Math.max(1,e.filesTotal)*100)}}function Y(e,t=[]){let{title:n,poolSize:r,cpuCount:i,filesTotal:a,filesCompleted:o,filesFailed:s,throughput:c}=e,{inProgress:l,pct:u}=J(e),d=[`${v.bold(n)} — ${r} workers ${v.dim(`(CPU avail: ${i})`)}`,`${v.dim(`Files`)} ${K(a)} ${v.dim(`Completed`)} ${K(o)} ${v.dim(`Failed`)} ${s?v.red(K(s)):K(s)} ${v.dim(`In-flight`)} ${K(l)}`,`[${q(u)}] ${u}%`];if(c){let t=c.jobsR10s>0||c.jobsR60s>0,n=Math.round((t?c.jobsR10s:c.r10s)*3600).toLocaleString(),r=Math.round((t?c.jobsR60s:c.r60s)*3600).toLocaleString(),i=t?`rec`:`files`,a=e.throughput?.successSoFar==null?``:` Newly uploaded: ${K(e.throughput.successSoFar)}`;d.push(v.cyan(`Throughput: ${n} ${i}/hr (1h: ${r} ${i}/hr)${a}`))}return t.length?d.concat(t):d}function X(e,t=e=>e?g(e):`-`){return[...e.workerState.entries()].map(([e,n])=>{let r=n.lastLevel===`error`?v.red(`ERROR `):n.lastLevel===`warn`?v.yellow(`WARN `):n.busy?v.green(`WORKING`):v.dim(`IDLE `),i=t(n.file),a=n.startedAt?`${Math.floor((Date.now()-n.startedAt)/1e3)}s`:`-`,o=n.progress?.processed??0,s=n.progress?.total??0,c=s>0?Math.floor(o/s*100):0;return` [w${e}] ${r} | ${i} | ${a} | [${s>0?q(c,18):` `.repeat(18)}] ${s>0?`${o.toLocaleString()}/${s.toLocaleString()} (${c}%)`:v.dim(`—`)}`})}async function Z(e){let{title:t,baseDir:r,poolSize:i,cpuCount:a,render:o,childModulePath:s,hooks:c,filesTotal:l,childFlag:u,viewerMode:d=!1}=e,f=e.openLogWindows??!d,p=e.isSilent??!0,m=Date.now(),h=k(r),g=new Map,_=new Map,y=new Map,b=new n,x=new n,S=new Map,C=c.initTotals?.()??{},w=0,T=0,E=0,A=null,j=!1,I=!1,L=null,R=(e=!1)=>{I||o({title:t,poolSize:i,cpuCount:a,filesTotal:l,filesCompleted:T,filesFailed:E,workerState:_,totals:C,final:e,exportStatus:c.exportStatus?.(),throughput:{successSoFar:T,r10s:b.rate(1e4),r60s:b.rate(6e4),jobsR10s:x.rate(1e4),jobsR60s:x.rate(6e4)}})},z=e=>{let t=c.nextTask();if(!t)return!1;let n=g.get(e),r=c.taskLabel(t),i=c.initSlotProgress?.(t);return _.set(e,{busy:!0,file:r,startedAt:Date.now(),lastLevel:`ok`,progress:i}),P(n,{type:`task`,payload:t}),R(),!0};for(let e=0;e<i;e+=1){let t=F({id:e,modulePath:s,logDir:h,openLogWindows:f,isSilent:p,childFlag:u});g.set(e,t),_.set(e,{busy:!1,file:null,startedAt:null,lastLevel:`ok`}),y.set(e,M(t)),w+=1;let n=O(t=>{let n=D(t);if(!n)return;let r=_.get(e);r.lastLevel!==n&&(_.set(e,{...r,lastLevel:n}),R())});t.stderr?.on(`data`,n),t.on(`message`,n=>{if(!(!n||typeof n!=`object`)){if(n.type===`ready`){j||(j=!0,A=setInterval(()=>R(!1),350)),z(e);return}if(n.type===`progress`){C=c.onProgress(C,n.payload);let t=_.get(e);_.set(e,{...t,progress:n.payload});let r=n.payload;if(typeof r?.processed==`number`){let t=S.get(e)??0,n=r.processed-t;n>0&&x.add(n),S.set(e,r.processed)}R();return}if(n.type===`result`){let r=_.get(e),{totals:i,ok:a}=c.onResult(C,n.payload);C=i,a?(T+=1,b.add(1)):E+=1,_.set(e,{...r,busy:!1,file:null,progress:void 0,lastLevel:a?`ok`:`error`}),S.delete(e),!z(e)&&N(t)&&P(t,{type:`shutdown`}),R()}}}),t.on(`exit`,()=>{--w,w===0&&(A&&clearInterval(A),R(!0))})}let B=()=>{},H=()=>{try{process.stdin.setRawMode?.(!1)}catch{}try{process.stdin.pause()}catch{}},U=()=>{if(A&&clearInterval(A),B?.(),L)try{process.stdin.off(`data`,L)}catch{}H(),process.stdout.write(`
|
|
18
|
-
Stopping workers...
|
|
19
|
-
`);for(let[,e]of g){N(e)&&P(e,{type:`shutdown`});try{e?.kill(`SIGTERM`)}catch{}}process.exit(130)},W=e=>{I=!0,process.stdout.write(`\x1B[2J\x1B[H`),process.stdout.write(`Attached to worker ${e}. (Esc/Ctrl+] detach • Ctrl+D EOF • Ctrl+C SIGINT)\n`)},K=()=>{I=!1,R()};if(process.once(`SIGINT`,U),!d){if(process.stdin.isTTY){try{process.stdin.setRawMode(!0)}catch{process.stdout.write(v.yellow(`Warning: Unable to enable raw mode for interactive key handling.
|
|
20
|
-
`))}process.stdin.resume()}B=V({workers:g,onAttach:W,onDetach:K,onCtrlC:U,getLogPaths:e=>G(e,g,y),replayBytes:200*1024,replayWhich:[`out`,`err`],onEnterAttachScreen:W}),e.extraKeyHandler&&(L=e.extraKeyHandler({logsBySlot:y,repaint:()=>R(),setPaused:e=>{I=e}}),process.stdin.on(`data`,L))}await new Promise(e=>{let t=setInterval(async()=>{if(w===0){if(clearInterval(t),A&&clearInterval(A),B(),L)try{process.stdin.off(`data`,L)}catch{}H();let n=Date.now();try{await c.postProcess?.({slots:_,totals:C,logDir:h,logsBySlot:y,startedAt:m,finishedAt:n,viewerMode:d,getLogPathsForSlot:e=>G(e,g,y)})}catch(e){let t=e?.stack??String(e);process.stdout.write(v.red(`postProcess error: ${t}\n`))}e()}},300)})}function Q(e){let{logsBySlot:t,repaint:n,setPaused:r,exportMgr:i,exportStatus:a,custom:o}=e,s=e=>{process.stdout.write(`${e}\n`)},c=(e,t)=>{let r=Date.now(),i=a?.[e]??{path:t};a&&(a[e]={path:t||i.path,savedAt:r,exported:!0},n())},l=!1,u=(e,i)=>{l||(l=!0,r(!0),process.stdout.write(`\x1B[2J\x1B[H`),process.stdout.write(`Combined logs viewer (press Esc or Ctrl+] to return)
|
|
21
|
-
|
|
22
|
-
`),(async()=>{try{await I(t,e,i)}catch{l=!1,r(!1),n()}})())},d=(e,n)=>{if(i)try{let r=i.exportCombinedLogs(t,e);s(`\nWrote combined ${n} logs to: ${r}`),c(e,r)}catch{s(`\nFailed to write combined ${n} logs`)}};return e=>{let t=e.toString(`utf8`);if(t===`e`){u([`err`],`error`);return}if(t===`w`){u([`warn`,`err`],`warn`);return}if(t===`i`){u([`info`],`all`);return}if(t===`l`){u([`out`,`err`,`structured`],`all`);return}if(t===`E`){d(`error`,`error`);return}if(t===`W`){d(`warn`,`warn`);return}if(t===`I`){d(`info`,`info`);return}if(t===`A`){d(`all`,`ALL`);return}let i=o?.[t];if(i){i({noteExport:c,say:s});return}(t===`\x1B`||t===``)&&(l=!1,r(!1),n())}}export{W as a,X as i,Z as n,A as o,Y as r,S as s,Q as t};
|
|
23
|
-
//# sourceMappingURL=createExtraKeyHandler-C_0EVj10.mjs.map
|