@transcend-io/cli 10.0.1 → 10.2.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/{app-BfTrk2nc.mjs → app-C1m4rExX.mjs} +21 -21
- package/dist/{app-BfTrk2nc.mjs.map → app-C1m4rExX.mjs.map} +1 -1
- package/dist/approvePrivacyRequests-BIHcACAj.mjs +2 -0
- package/dist/approvePrivacyRequests-BIHcACAj.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-CBbcir-p.mjs +9 -0
- package/dist/buildXdiSyncEndpoint-CBbcir-p.mjs.map +1 -0
- package/dist/bulkRestartRequests-ByH7TjH2.mjs +2 -0
- package/dist/bulkRestartRequests-ByH7TjH2.mjs.map +1 -0
- package/dist/bulkRetryEnrichers-DuYXD-64.mjs +2 -0
- package/dist/bulkRetryEnrichers-DuYXD-64.mjs.map +1 -0
- package/dist/cancelPrivacyRequests-DMgQOffA.mjs +2 -0
- package/dist/cancelPrivacyRequests-DMgQOffA.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-CbtyKAzu.mjs +2 -0
- package/dist/collectCsvFilesOrExit-CbtyKAzu.mjs.map +1 -0
- package/dist/collectParquetFilesOrExit-BJiAyaQ5.mjs +2 -0
- package/dist/collectParquetFilesOrExit-BJiAyaQ5.mjs.map +1 -0
- package/dist/{command-BXxoAjFo.mjs → command-DnoHX-eW.mjs} +2 -2
- package/dist/{command-BXxoAjFo.mjs.map → command-DnoHX-eW.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-BdKDganK.mjs} +2 -2
- package/dist/{consentManagersToBusinessEntities-BDgOFga7.mjs.map → consentManagersToBusinessEntities-BdKDganK.mjs.map} +1 -1
- package/dist/{constants-AFtS5Nad.mjs → constants-BmwXDQu9.mjs} +2 -2
- package/dist/{constants-AFtS5Nad.mjs.map → constants-BmwXDQu9.mjs.map} +1 -1
- package/dist/{constants-lIvXgkdp.mjs → constants-ClkQQhJs.mjs} +1 -1
- package/dist/{constants-lIvXgkdp.mjs.map → constants-ClkQQhJs.mjs.map} +1 -1
- package/dist/constants-muOBBQA_.mjs +2 -0
- package/dist/constants-muOBBQA_.mjs.map +1 -0
- 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-srtG2U7q.mjs +14 -0
- package/dist/createExtraKeyHandler-srtG2U7q.mjs.map +1 -0
- package/dist/{dataFlowsToDataSilos-NhvBw1iy.mjs → dataFlowsToDataSilos-Ca2DtTsd.mjs} +1 -1
- package/dist/dataFlowsToDataSilos-Ca2DtTsd.mjs.map +1 -0
- package/dist/{done-input-validation-DLR0-MJ7.mjs → done-input-validation-BcNBxhEs.mjs} +1 -1
- package/dist/{done-input-validation-DLR0-MJ7.mjs.map → done-input-validation-BcNBxhEs.mjs.map} +1 -1
- package/dist/downloadPrivacyRequestFiles-kKhGnFmx.mjs +2 -0
- package/dist/downloadPrivacyRequestFiles-kKhGnFmx.mjs.map +1 -0
- package/dist/{extractClientError-DPjv09EH.mjs → extractClientError-i-Tw_az7.mjs} +1 -1
- package/dist/{extractClientError-DPjv09EH.mjs.map → extractClientError-i-Tw_az7.mjs.map} +1 -1
- package/dist/fetchAllRequests-CHHdyb4Q.mjs +2 -0
- package/dist/fetchAllRequests-CHHdyb4Q.mjs.map +1 -0
- package/dist/generateCrossAccountApiKeys-C7yH3Rbi.mjs +2 -0
- package/dist/generateCrossAccountApiKeys-C7yH3Rbi.mjs.map +1 -0
- package/dist/impl-3VLH9aat.mjs +2 -0
- package/dist/impl-3VLH9aat.mjs.map +1 -0
- package/dist/{impl-Rt3C_fDF.mjs → impl-3sDUDXru.mjs} +2 -2
- package/dist/{impl-Rt3C_fDF.mjs.map → impl-3sDUDXru.mjs.map} +1 -1
- package/dist/{impl-Cgg_bv7j.mjs → impl-6mCOBlSD.mjs} +2 -2
- package/dist/{impl-Cgg_bv7j.mjs.map → impl-6mCOBlSD.mjs.map} +1 -1
- package/dist/impl-84ylH4aO.mjs +2 -0
- package/dist/{impl-CMmyv1cl.mjs.map → impl-84ylH4aO.mjs.map} +1 -1
- package/dist/impl-B62XN4tV.mjs +2 -0
- package/dist/impl-B62XN4tV.mjs.map +1 -0
- package/dist/{impl-DGiPB5Vq2.mjs → impl-B9BsXBxS.mjs} +2 -2
- package/dist/impl-B9BsXBxS.mjs.map +1 -0
- package/dist/{impl-KDuBh4bu2.mjs → impl-BNqmxytJ.mjs} +2 -2
- package/dist/impl-BNqmxytJ.mjs.map +1 -0
- package/dist/{impl-CqXFyvgV2.mjs → impl-BYf4MpWP.mjs} +2 -2
- package/dist/impl-BYf4MpWP.mjs.map +1 -0
- package/dist/impl-BaC9iEO_.mjs +2 -0
- package/dist/impl-BaC9iEO_.mjs.map +1 -0
- package/dist/impl-BhDS0QIt.mjs +2 -0
- package/dist/impl-BhDS0QIt.mjs.map +1 -0
- package/dist/{impl-CNez1OAw.mjs → impl-BjCQSRLu.mjs} +2 -2
- package/dist/{impl-CNez1OAw.mjs.map → impl-BjCQSRLu.mjs.map} +1 -1
- package/dist/impl-BjIylEKQ.mjs +4 -0
- package/dist/impl-BjIylEKQ.mjs.map +1 -0
- package/dist/impl-BwrEi3s7.mjs +2 -0
- package/dist/impl-BwrEi3s7.mjs.map +1 -0
- package/dist/impl-C4AI1Fsj.mjs +3 -0
- package/dist/impl-C4AI1Fsj.mjs.map +1 -0
- package/dist/{impl-fqOKTw5J.mjs → impl-CCAeEeMR.mjs} +2 -2
- package/dist/{impl-fqOKTw5J.mjs.map → impl-CCAeEeMR.mjs.map} +1 -1
- package/dist/{impl-P_NDC3cX.mjs → impl-CFI5y5U-.mjs} +2 -2
- package/dist/{impl-P_NDC3cX.mjs.map → impl-CFI5y5U-.mjs.map} +1 -1
- package/dist/{impl-BOUm7wly2.mjs → impl-CIfRN0ux.mjs} +2 -2
- package/dist/impl-CIfRN0ux.mjs.map +1 -0
- package/dist/impl-CLznNZ5F.mjs +2 -0
- package/dist/impl-CLznNZ5F.mjs.map +1 -0
- package/dist/impl-CUdo0Jyh.mjs +2 -0
- package/dist/impl-CUdo0Jyh.mjs.map +1 -0
- package/dist/{impl-MpkLBntW.mjs → impl-Cmj1Vi5Q.mjs} +2 -2
- package/dist/{impl-MpkLBntW.mjs.map → impl-Cmj1Vi5Q.mjs.map} +1 -1
- package/dist/impl-Cw3_0zqC.mjs +2 -0
- package/dist/impl-Cw3_0zqC.mjs.map +1 -0
- package/dist/{impl-D-cp0CYr.mjs → impl-CzvCA0Ev.mjs} +2 -2
- package/dist/{impl-D-cp0CYr.mjs.map → impl-CzvCA0Ev.mjs.map} +1 -1
- package/dist/{impl-CSChmq_t2.mjs → impl-D1DmW5-P.mjs} +2 -2
- package/dist/impl-D1DmW5-P.mjs.map +1 -0
- package/dist/{impl-CCUsnhoW2.mjs → impl-D41c_KGj.mjs} +2 -2
- package/dist/impl-D41c_KGj.mjs.map +1 -0
- package/dist/impl-DEpCg7UP.mjs +2 -0
- package/dist/{impl-tbGnvKFm.mjs.map → impl-DEpCg7UP.mjs.map} +1 -1
- package/dist/{impl-DGuwD_qz.mjs → impl-DHOh4ypd.mjs} +2 -2
- package/dist/{impl-DGuwD_qz.mjs.map → impl-DHOh4ypd.mjs.map} +1 -1
- package/dist/{impl-D9NjIwEi2.mjs → impl-DJg0Ibxs.mjs} +2 -2
- package/dist/impl-DJg0Ibxs.mjs.map +1 -0
- package/dist/impl-DUdbbIpf.mjs +2 -0
- package/dist/impl-DUdbbIpf.mjs.map +1 -0
- package/dist/impl-DXHqqWJb.mjs +7 -0
- package/dist/impl-DXHqqWJb.mjs.map +1 -0
- package/dist/impl-DXaA3sMt.mjs +2 -0
- package/dist/impl-DXaA3sMt.mjs.map +1 -0
- package/dist/impl-Dl4RcPKp.mjs +2 -0
- package/dist/{impl-DEWXA_QC.mjs.map → impl-Dl4RcPKp.mjs.map} +1 -1
- package/dist/{impl-c7rUQYDc2.mjs → impl-DvAwxl6Z.mjs} +2 -2
- package/dist/impl-DvAwxl6Z.mjs.map +1 -0
- package/dist/{impl-JThkrXiI2.mjs → impl-GRdcDZQ4.mjs} +2 -2
- package/dist/impl-GRdcDZQ4.mjs.map +1 -0
- package/dist/{impl-CNykdy3e2.mjs → impl-UMb9wjra.mjs} +2 -2
- package/dist/impl-UMb9wjra.mjs.map +1 -0
- package/dist/impl-Yq33AV90.mjs +2 -0
- package/dist/impl-Yq33AV90.mjs.map +1 -0
- package/dist/impl-aGDJJgGc.mjs +2 -0
- package/dist/impl-aGDJJgGc.mjs.map +1 -0
- package/dist/impl-fZQxhZRu.mjs +12 -0
- package/dist/impl-fZQxhZRu.mjs.map +1 -0
- package/dist/{impl-BUC4ZelU.mjs → impl-gitQPEo3.mjs} +2 -2
- package/dist/{impl-BUC4ZelU.mjs.map → impl-gitQPEo3.mjs.map} +1 -1
- package/dist/impl-i-vquwbD.mjs +2 -0
- package/dist/{impl-C2o0eDzJ.mjs.map → impl-i-vquwbD.mjs.map} +1 -1
- package/dist/impl-iteb85IZ.mjs +4 -0
- package/dist/impl-iteb85IZ.mjs.map +1 -0
- package/dist/impl-tYtVXUz2.mjs +2 -0
- package/dist/impl-tYtVXUz2.mjs.map +1 -0
- package/dist/{impl-DGzvE8aJ.mjs → impl-wcRtA0L3.mjs} +2 -2
- package/dist/{impl-DGzvE8aJ.mjs.map → impl-wcRtA0L3.mjs.map} +1 -1
- package/dist/impl-xtlx25UP.mjs +2 -0
- package/dist/impl-xtlx25UP.mjs.map +1 -0
- package/dist/impl-yMumZUUX.mjs +2 -0
- package/dist/impl-yMumZUUX.mjs.map +1 -0
- package/dist/index.d.mts +1135 -5125
- 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-BqZXFEt1.mjs} +2 -2
- package/dist/{inquirer-BgNcicZ4.mjs.map → inquirer-BqZXFEt1.mjs.map} +1 -1
- package/dist/{listFiles-qzyQMaYH.mjs → listFiles-D2wMHnEr.mjs} +1 -1
- package/dist/{listFiles-qzyQMaYH.mjs.map → listFiles-D2wMHnEr.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-BaVxVfDe.mjs +2 -0
- package/dist/markRequestDataSiloIdsCompleted-BaVxVfDe.mjs.map +1 -0
- package/dist/markSilentPrivacyRequests-miaumnaC.mjs +2 -0
- package/dist/markSilentPrivacyRequests-miaumnaC.mjs.map +1 -0
- package/dist/notifyPrivacyRequestsAdditionalTime-BUdhSCNL.mjs +2 -0
- package/dist/notifyPrivacyRequestsAdditionalTime-BUdhSCNL.mjs.map +1 -0
- package/dist/parquetToCsvOneFile-B84XXInh.mjs +6 -0
- package/dist/parquetToCsvOneFile-B84XXInh.mjs.map +1 -0
- package/dist/parseAttributesFromString-D1Yl0xwT.mjs +2 -0
- package/dist/{parseAttributesFromString-CZStzJc0.mjs.map → parseAttributesFromString-D1Yl0xwT.mjs.map} +1 -1
- package/dist/parseVariablesFromString-BeKOGw5n.mjs +3 -0
- package/dist/parseVariablesFromString-BeKOGw5n.mjs.map +1 -0
- package/dist/pullAllDatapoints-Bbmky50p.mjs +45 -0
- package/dist/pullAllDatapoints-Bbmky50p.mjs.map +1 -0
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-BW5Vws25.mjs +2 -0
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-BW5Vws25.mjs.map +1 -0
- package/dist/pullConsentManagerMetrics-zKgjc3Ap.mjs +2 -0
- package/dist/pullConsentManagerMetrics-zKgjc3Ap.mjs.map +1 -0
- package/dist/pullManualEnrichmentIdentifiersToCsv-kpGy9H7T.mjs +2 -0
- package/dist/pullManualEnrichmentIdentifiersToCsv-kpGy9H7T.mjs.map +1 -0
- package/dist/pullTranscendConfiguration-DjOELnPo.mjs +58 -0
- package/dist/pullTranscendConfiguration-DjOELnPo.mjs.map +1 -0
- package/dist/{pullUnstructuredSubDataPointRecommendations-DZd2q6S2.mjs → pullUnstructuredSubDataPointRecommendations-D0z-vPgq.mjs} +4 -4
- package/dist/pullUnstructuredSubDataPointRecommendations-D0z-vPgq.mjs.map +1 -0
- package/dist/pushCronIdentifiersFromCsv-BZRA1n_8.mjs +2 -0
- package/dist/pushCronIdentifiersFromCsv-BZRA1n_8.mjs.map +1 -0
- package/dist/pushManualEnrichmentIdentifiersFromCsv-DXqf8WWy.mjs +2 -0
- package/dist/pushManualEnrichmentIdentifiersFromCsv-DXqf8WWy.mjs.map +1 -0
- package/dist/{readCsv-CyOL7eCc.mjs → readCsv-C4TyEs-r.mjs} +1 -1
- package/dist/{readCsv-CyOL7eCc.mjs.map → readCsv-C4TyEs-r.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-BxWSsJit.mjs +2 -0
- package/dist/removeUnverifiedRequestIdentifiers-BxWSsJit.mjs.map +1 -0
- package/dist/{request-CAsR6CMY.mjs → request-DfkRPQFr.mjs} +1 -1
- package/dist/{request-CAsR6CMY.mjs.map → request-DfkRPQFr.mjs.map} +1 -1
- package/dist/retryRequestDataSilos-BVrJz_GC.mjs +2 -0
- package/dist/retryRequestDataSilos-BVrJz_GC.mjs.map +1 -0
- package/dist/skipPreflightJobs-CYuoMG3z.mjs +2 -0
- package/dist/skipPreflightJobs-CYuoMG3z.mjs.map +1 -0
- package/dist/skipRequestDataSilos-BNspAsjR.mjs +2 -0
- package/dist/skipRequestDataSilos-BNspAsjR.mjs.map +1 -0
- package/dist/streamPrivacyRequestsToCsv-PoyTmQd6.mjs +2 -0
- package/dist/streamPrivacyRequestsToCsv-PoyTmQd6.mjs.map +1 -0
- package/dist/syncCodePackages-CAk_Hjyl.mjs +2 -0
- package/dist/syncCodePackages-CAk_Hjyl.mjs.map +1 -0
- package/dist/updateConsentManagerVersionToLatest-lAw3E1wm.mjs +2 -0
- package/dist/updateConsentManagerVersionToLatest-lAw3E1wm.mjs.map +1 -0
- package/dist/uploadConsents-BzmWrNc1.mjs +2 -0
- package/dist/uploadConsents-BzmWrNc1.mjs.map +1 -0
- package/dist/uploadCookiesFromCsv-TH10UBgw.mjs +2 -0
- package/dist/uploadCookiesFromCsv-TH10UBgw.mjs.map +1 -0
- package/dist/uploadDataFlowsFromCsv-DUSFCae9.mjs +2 -0
- package/dist/uploadDataFlowsFromCsv-DUSFCae9.mjs.map +1 -0
- package/dist/uploadPrivacyRequestsFromCsv-sKSFfE6q.mjs +2 -0
- package/dist/uploadPrivacyRequestsFromCsv-sKSFfE6q.mjs.map +1 -0
- package/dist/{validateTranscendAuth-1W1IylqE.mjs → validateTranscendAuth-Cuh2Qfdl.mjs} +2 -2
- package/dist/{validateTranscendAuth-1W1IylqE.mjs.map → validateTranscendAuth-Cuh2Qfdl.mjs.map} +1 -1
- package/dist/{writeCsv-B51ulrVl.mjs → writeCsv-C4pjXGsD.mjs} +1 -1
- package/dist/{writeCsv-B51ulrVl.mjs.map → writeCsv-C4pjXGsD.mjs.map} +1 -1
- package/package.json +13 -10
- package/dist/RateCounter-DFL_mnk2.mjs +0 -2
- package/dist/RateCounter-DFL_mnk2.mjs.map +0 -1
- package/dist/RequestDataSilo-_Iv44M9u.mjs +0 -51
- package/dist/RequestDataSilo-_Iv44M9u.mjs.map +0 -1
- package/dist/approvePrivacyRequests-CWGZR2N6.mjs +0 -2
- package/dist/approvePrivacyRequests-CWGZR2N6.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-Cb-pvpak.mjs +0 -9
- package/dist/buildXdiSyncEndpoint-Cb-pvpak.mjs.map +0 -1
- package/dist/bulkRestartRequests-CKF_xpN0.mjs +0 -2
- package/dist/bulkRestartRequests-CKF_xpN0.mjs.map +0 -1
- package/dist/bulkRetryEnrichers-B-Szmin-.mjs +0 -2
- package/dist/bulkRetryEnrichers-B-Szmin-.mjs.map +0 -1
- package/dist/cancelPrivacyRequests-DNiL13E_.mjs +0 -2
- package/dist/cancelPrivacyRequests-DNiL13E_.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-tubeaEjA.mjs +0 -23
- package/dist/createExtraKeyHandler-tubeaEjA.mjs.map +0 -1
- package/dist/createPreferenceAccessTokens-DqmFctn3.mjs +0 -10
- package/dist/createPreferenceAccessTokens-DqmFctn3.mjs.map +0 -1
- package/dist/createSombraGotInstance-D1Il9zUE.mjs +0 -10
- package/dist/createSombraGotInstance-D1Il9zUE.mjs.map +0 -1
- package/dist/dataFlowsToDataSilos-NhvBw1iy.mjs.map +0 -1
- package/dist/dataSilo-DrFetFXw.mjs +0 -302
- package/dist/dataSilo-DrFetFXw.mjs.map +0 -1
- package/dist/dataSubject-y_aXI0pa.mjs +0 -92
- package/dist/dataSubject-y_aXI0pa.mjs.map +0 -1
- package/dist/downloadPrivacyRequestFiles-DlpgxqHF.mjs +0 -2
- package/dist/downloadPrivacyRequestFiles-DlpgxqHF.mjs.map +0 -1
- package/dist/extractErrorMessage-CPnTsT1S.mjs +0 -2
- package/dist/extractErrorMessage-CPnTsT1S.mjs.map +0 -1
- package/dist/fetchAllActions-BJsPdnxy.mjs +0 -832
- package/dist/fetchAllActions-BJsPdnxy.mjs.map +0 -1
- package/dist/fetchAllDataFlows-D248lO6_.mjs +0 -2
- package/dist/fetchAllDataFlows-D248lO6_.mjs.map +0 -1
- package/dist/fetchAllPreferenceTopics-ForE9GpZ.mjs +0 -36
- package/dist/fetchAllPreferenceTopics-ForE9GpZ.mjs.map +0 -1
- package/dist/fetchAllPurposes-ZdkO2fMp.mjs +0 -29
- package/dist/fetchAllPurposes-ZdkO2fMp.mjs.map +0 -1
- package/dist/fetchAllPurposesAndPreferences-DD6OyA5t.mjs +0 -2
- package/dist/fetchAllPurposesAndPreferences-DD6OyA5t.mjs.map +0 -1
- package/dist/fetchAllRequestEnrichers-CK-kk5eg.mjs +0 -42
- package/dist/fetchAllRequestEnrichers-CK-kk5eg.mjs.map +0 -1
- package/dist/fetchAllRequestIdentifiers-DrFFOt0m.mjs +0 -10
- package/dist/fetchAllRequestIdentifiers-DrFFOt0m.mjs.map +0 -1
- package/dist/fetchAllRequests-DNQQsY4s.mjs +0 -2
- package/dist/fetchAllRequests-DNQQsY4s.mjs.map +0 -1
- package/dist/fetchApiKeys-DjOr44xA.mjs +0 -33
- package/dist/fetchApiKeys-DjOr44xA.mjs.map +0 -1
- package/dist/fetchCatalogs-BM4FCbcS.mjs +0 -12
- package/dist/fetchCatalogs-BM4FCbcS.mjs.map +0 -1
- package/dist/fetchConsentManagerId-CFkg3-RS.mjs +0 -321
- package/dist/fetchConsentManagerId-CFkg3-RS.mjs.map +0 -1
- package/dist/fetchIdentifiers-pjQV4vUg.mjs +0 -54
- package/dist/fetchIdentifiers-pjQV4vUg.mjs.map +0 -1
- package/dist/fetchRequestDataSilo-P4yA7Lyc.mjs +0 -2
- package/dist/fetchRequestDataSilo-P4yA7Lyc.mjs.map +0 -1
- package/dist/fetchRequestFilesForRequest-BbxrEKFK.mjs +0 -33
- package/dist/fetchRequestFilesForRequest-BbxrEKFK.mjs.map +0 -1
- package/dist/generateCrossAccountApiKeys-Bxc_dzMG.mjs +0 -33
- package/dist/generateCrossAccountApiKeys-Bxc_dzMG.mjs.map +0 -1
- package/dist/impl-4ltdSmpl2.mjs +0 -4
- package/dist/impl-4ltdSmpl2.mjs.map +0 -1
- package/dist/impl-B19fH75P.mjs +0 -12
- package/dist/impl-B19fH75P.mjs.map +0 -1
- package/dist/impl-BBMjv5YQ.mjs +0 -2
- package/dist/impl-BBMjv5YQ.mjs.map +0 -1
- package/dist/impl-BKH3QRLi.mjs +0 -3
- package/dist/impl-BKH3QRLi.mjs.map +0 -1
- package/dist/impl-BOUm7wly2.mjs.map +0 -1
- package/dist/impl-BhTCp0kg.mjs +0 -2
- package/dist/impl-BhTCp0kg.mjs.map +0 -1
- package/dist/impl-BlHU1bbJ2.mjs +0 -2
- package/dist/impl-BlHU1bbJ2.mjs.map +0 -1
- package/dist/impl-BwjguKHC.mjs +0 -4
- package/dist/impl-BwjguKHC.mjs.map +0 -1
- package/dist/impl-C2o0eDzJ.mjs +0 -2
- package/dist/impl-C8HKnjw82.mjs +0 -2
- package/dist/impl-C8HKnjw82.mjs.map +0 -1
- package/dist/impl-CCUsnhoW2.mjs.map +0 -1
- package/dist/impl-CCc-wXqD.mjs +0 -2
- package/dist/impl-CCc-wXqD.mjs.map +0 -1
- package/dist/impl-CMmyv1cl.mjs +0 -2
- package/dist/impl-CNykdy3e2.mjs.map +0 -1
- package/dist/impl-CSChmq_t2.mjs.map +0 -1
- package/dist/impl-Ce9K4OCp.mjs +0 -2
- package/dist/impl-Ce9K4OCp.mjs.map +0 -1
- package/dist/impl-ChCqHkOc2.mjs +0 -2
- package/dist/impl-ChCqHkOc2.mjs.map +0 -1
- package/dist/impl-CqEwwWeD.mjs +0 -2
- package/dist/impl-CqEwwWeD.mjs.map +0 -1
- package/dist/impl-CqXFyvgV2.mjs.map +0 -1
- package/dist/impl-CxLSJk2P.mjs +0 -2
- package/dist/impl-CxLSJk2P.mjs.map +0 -1
- package/dist/impl-CzU9WTiW.mjs +0 -2
- package/dist/impl-CzU9WTiW.mjs.map +0 -1
- package/dist/impl-D9NjIwEi2.mjs.map +0 -1
- package/dist/impl-DEWXA_QC.mjs +0 -2
- package/dist/impl-DGiPB5Vq2.mjs.map +0 -1
- package/dist/impl-DTp9OQIZ.mjs +0 -7
- package/dist/impl-DTp9OQIZ.mjs.map +0 -1
- package/dist/impl-DhscnXSw.mjs +0 -2
- package/dist/impl-DhscnXSw.mjs.map +0 -1
- package/dist/impl-Dk7MdX-1.mjs +0 -2
- package/dist/impl-Dk7MdX-1.mjs.map +0 -1
- package/dist/impl-DsNPvet4.mjs +0 -2
- package/dist/impl-DsNPvet4.mjs.map +0 -1
- package/dist/impl-DxUFb0vv.mjs +0 -2
- package/dist/impl-DxUFb0vv.mjs.map +0 -1
- package/dist/impl-JThkrXiI2.mjs.map +0 -1
- package/dist/impl-KDuBh4bu2.mjs.map +0 -1
- package/dist/impl-c7rUQYDc2.mjs.map +0 -1
- package/dist/impl-oiBTZqQS2.mjs +0 -2
- package/dist/impl-oiBTZqQS2.mjs.map +0 -1
- package/dist/impl-tbGnvKFm.mjs +0 -2
- package/dist/makeGraphQLRequest-Cq26A_Lq.mjs +0 -2
- package/dist/makeGraphQLRequest-Cq26A_Lq.mjs.map +0 -1
- package/dist/markRequestDataSiloIdsCompleted-DzqJ5MNY.mjs +0 -2
- package/dist/markRequestDataSiloIdsCompleted-DzqJ5MNY.mjs.map +0 -1
- package/dist/markSilentPrivacyRequests-BKQUu6Ep.mjs +0 -2
- package/dist/markSilentPrivacyRequests-BKQUu6Ep.mjs.map +0 -1
- package/dist/mergeTranscendInputs-DGC4xUGu.mjs +0 -2
- package/dist/mergeTranscendInputs-DGC4xUGu.mjs.map +0 -1
- package/dist/notifyPrivacyRequestsAdditionalTime-TEHAJe4C.mjs +0 -2
- package/dist/notifyPrivacyRequestsAdditionalTime-TEHAJe4C.mjs.map +0 -1
- package/dist/package-C4J38oR1.mjs +0 -2
- package/dist/package-C4J38oR1.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-Cntwuzw7.mjs +0 -45
- package/dist/pullAllDatapoints-Cntwuzw7.mjs.map +0 -1
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-BT-GZpT1.mjs +0 -2
- package/dist/pullChunkedCustomSiloOutstandingIdentifiers-BT-GZpT1.mjs.map +0 -1
- package/dist/pullConsentManagerMetrics-FnhPEszu.mjs +0 -2
- package/dist/pullConsentManagerMetrics-FnhPEszu.mjs.map +0 -1
- package/dist/pullManualEnrichmentIdentifiersToCsv-B_4REnga.mjs +0 -2
- package/dist/pullManualEnrichmentIdentifiersToCsv-B_4REnga.mjs.map +0 -1
- package/dist/pullTranscendConfiguration-CqsgEf9A.mjs +0 -80
- package/dist/pullTranscendConfiguration-CqsgEf9A.mjs.map +0 -1
- package/dist/pullUnstructuredSubDataPointRecommendations-DZd2q6S2.mjs.map +0 -1
- package/dist/pushCronIdentifiersFromCsv-D2saGR5i.mjs +0 -2
- package/dist/pushCronIdentifiersFromCsv-D2saGR5i.mjs.map +0 -1
- package/dist/pushManualEnrichmentIdentifiersFromCsv-DOvAzMyt.mjs +0 -2
- package/dist/pushManualEnrichmentIdentifiersFromCsv-DOvAzMyt.mjs.map +0 -1
- package/dist/removeUnverifiedRequestIdentifiers-ChlwRmhd.mjs +0 -35
- package/dist/removeUnverifiedRequestIdentifiers-ChlwRmhd.mjs.map +0 -1
- package/dist/retryRequestDataSilos-DnwXA1YZ.mjs +0 -2
- package/dist/retryRequestDataSilos-DnwXA1YZ.mjs.map +0 -1
- package/dist/skipPreflightJobs-jK5lNlmv.mjs +0 -2
- package/dist/skipPreflightJobs-jK5lNlmv.mjs.map +0 -1
- package/dist/skipRequestDataSilos-DQGroOos.mjs +0 -2
- package/dist/skipRequestDataSilos-DQGroOos.mjs.map +0 -1
- package/dist/splitCsvToList-BRq_CIfd.mjs +0 -2
- package/dist/splitCsvToList-BRq_CIfd.mjs.map +0 -1
- package/dist/streamPrivacyRequestsToCsv-BK07Bm-T.mjs +0 -2
- package/dist/streamPrivacyRequestsToCsv-BK07Bm-T.mjs.map +0 -1
- package/dist/syncCodePackages-F-97FNjo.mjs +0 -232
- package/dist/syncCodePackages-F-97FNjo.mjs.map +0 -1
- package/dist/syncCookies-BxY36BeJ.mjs +0 -2
- package/dist/syncCookies-BxY36BeJ.mjs.map +0 -1
- package/dist/syncDataFlows-Cx5LZCen.mjs +0 -2
- package/dist/syncDataFlows-Cx5LZCen.mjs.map +0 -1
- package/dist/syncTemplates-BrH7Yr0V.mjs +0 -23
- package/dist/syncTemplates-BrH7Yr0V.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-C221vAAw.mjs +0 -2
- package/dist/updateConsentManagerVersionToLatest-C221vAAw.mjs.map +0 -1
- package/dist/uploadConsents-BbR7_sSt.mjs +0 -2
- package/dist/uploadConsents-BbR7_sSt.mjs.map +0 -1
- package/dist/uploadCookiesFromCsv-roHWekOP.mjs +0 -2
- package/dist/uploadCookiesFromCsv-roHWekOP.mjs.map +0 -1
- package/dist/uploadDataFlowsFromCsv-DcTbrsv2.mjs +0 -2
- package/dist/uploadDataFlowsFromCsv-DcTbrsv2.mjs.map +0 -1
- package/dist/uploadPrivacyRequestsFromCsv-BUGTS-pY.mjs +0 -17
- package/dist/uploadPrivacyRequestsFromCsv-BUGTS-pY.mjs.map +0 -1
- package/dist/uploadSiloDiscoveryResults-D2fK92WR.mjs +0 -20
- package/dist/uploadSiloDiscoveryResults-D2fK92WR.mjs.map +0 -1
- package/dist/withPreferenceRetry-xLMZyTq9.mjs +0 -2
- package/dist/withPreferenceRetry-xLMZyTq9.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllActions-BJsPdnxy.mjs","names":["PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE","PAGE_SIZE"],"sources":["../src/lib/graphql/gqls/policy.ts","../src/lib/graphql/gqls/message.ts","../src/lib/graphql/gqls/prompt.ts","../src/lib/graphql/gqls/team.ts","../src/lib/graphql/gqls/actionItemCollection.ts","../src/lib/graphql/gqls/attribute.ts","../src/lib/graphql/gqls/businessEntity.ts","../src/lib/graphql/gqls/action.ts","../src/lib/graphql/gqls/actionItem.ts","../src/lib/graphql/gqls/privacyCenter.ts","../src/lib/graphql/gqls/agent.ts","../src/lib/graphql/gqls/agentFile.ts","../src/lib/graphql/gqls/agentFunction.ts","../src/lib/graphql/gqls/vendor.ts","../src/lib/graphql/gqls/dataCategory.ts","../src/lib/graphql/gqls/processingPurpose.ts","../src/lib/graphql/gqls/processingActivity.ts","../src/lib/graphql/fetchAllActionItems.ts","../src/lib/graphql/fetchAllAgentFiles.ts","../src/lib/graphql/fetchAllAgentFunctions.ts","../src/lib/graphql/fetchAllAgents.ts","../src/lib/graphql/fetchAllAttributes.ts","../src/lib/graphql/fetchAllBusinessEntities.ts","../src/lib/graphql/fetchAllDataCategories.ts","../src/lib/graphql/fetchPrivacyCenterId.ts","../src/lib/graphql/fetchAllPolicies.ts","../src/lib/graphql/fetchAllProcessingActivities.ts","../src/lib/graphql/fetchAllProcessingPurposes.ts","../src/lib/graphql/fetchAllTeams.ts","../src/lib/graphql/fetchAllVendors.ts","../src/lib/graphql/fetchDataSubjects.ts","../src/lib/graphql/fetchPromptGroups.ts","../src/lib/graphql/fetchPromptPartials.ts","../src/lib/graphql/fetchPrompts.ts","../src/lib/graphql/fetchAllActionItemCollections.ts","../src/lib/graphql/syncDataSilos.ts","../src/lib/graphql/syncEnrichers.ts","../src/lib/graphql/syncPartitions.ts","../src/lib/graphql/fetchAllActions.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\nexport const POLICIES = gql`\n query TranscendCliFetchPolicies($url: String!) {\n privacyCenterPolicies(lookup: { url: $url }) {\n id\n title {\n defaultMessage\n }\n disableEffectiveOn\n disabledLocales\n versions {\n effectiveOn\n content {\n defaultMessage\n }\n }\n }\n }\n`;\n\nexport const UPDATE_POLICIES = gql`\n mutation TranscendCliUpdatePolicies($policies: [PolicyInput!]!, $privacyCenterId: ID!) {\n updatePolicies(\n input: { privacyCenterId: $privacyCenterId, policies: $policies, skipPublish: true }\n ) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\nexport const MESSAGES = gql`\n query TranscendCliFetchMessage {\n translatedMessages {\n id\n defaultMessage\n description\n targetReactIntlId\n translations {\n locale\n value\n }\n }\n }\n`;\n\nexport const UPDATE_INTL_MESSAGES = gql`\n mutation TranscendCliUpdateIntlMessages($messages: [MessageInput!]!) {\n updateIntlMessages(input: { messages: $messages, skipPublish: true }) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\nexport const PROMPTS = gql`\n query TranscendCliPrompts($first: Int!, $offset: Int!, $filterBy: PromptFiltersInput) {\n prompts(\n first: $first\n orderBy: [{ field: title, direction: ASC }]\n offset: $offset\n filterBy: $filterBy\n ) {\n nodes {\n id\n title\n status\n content\n temperature\n topP\n maxTokensToSample\n }\n }\n }\n`;\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\n// TODO: https://transcend.height.app/T-27909 - order by createdAt\n// orderBy: [{ field: title, direction: ASC }]\nexport const PROMPT_PARTIALS = gql`\n query TranscendCliPromptPartials($first: Int!, $offset: Int!) {\n promptPartials(first: $first, offset: $offset) {\n nodes {\n id\n title\n content\n }\n }\n }\n`;\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\n// TODO: https://transcend.height.app/T-27909 - order by createdAt\n// orderBy: [{ field: title, direction: ASC }]\nexport const PROMPT_GROUPS = gql`\n query TranscendCliPromptGroups($first: Int!, $offset: Int!) {\n promptGroups(first: $first, offset: $offset) {\n nodes {\n id\n title\n description\n prompts {\n title\n }\n }\n }\n }\n`;\n\nexport const PROMPTS_WITH_VARIABLES = gql`\n query TranscendCliPromptsWithVariables($input: PromptsWithVariablesInput!) {\n promptsWithVariables(input: $input) {\n prompts {\n id\n title\n content\n status\n temperature\n topP\n maxTokensToSample\n responseFormat\n }\n promptPartials {\n id\n title\n content\n slug\n }\n calculatedVariables {\n data\n name\n }\n runtimeVariables {\n name\n }\n }\n }\n`;\n\nexport const UPDATE_PROMPTS = gql`\n mutation TranscendCliUpdatePrompts($input: UpdatePromptsInput!) {\n updatePrompts(input: $input) {\n clientMutationId\n }\n }\n`;\n\nexport const CREATE_PROMPT = gql`\n mutation TranscendCliCreatePrompt($input: CreatePromptInput!) {\n createPrompt(input: $input) {\n clientMutationId\n prompt {\n id\n }\n }\n }\n`;\n\nexport const UPDATE_PROMPT_PARTIALS = gql`\n mutation TranscendCliUpdatePromptPartials($input: UpdatePromptPartialsInput!) {\n updatePromptPartials(input: $input) {\n clientMutationId\n }\n }\n`;\n\nexport const CREATE_PROMPT_PARTIAL = gql`\n mutation TranscendCliCreatePromptPartial($input: CreatePromptPartialInput!) {\n createPromptPartial(input: $input) {\n clientMutationId\n promptPartial {\n id\n }\n }\n }\n`;\n\nexport const UPDATE_PROMPT_GROUPS = gql`\n mutation TranscendCliUpdatePromptGroups($input: UpdatePromptGroupsInput!) {\n updatePromptGroups(input: $input) {\n clientMutationId\n }\n }\n`;\n\nexport const CREATE_PROMPT_GROUP = gql`\n mutation TranscendCliCreatePromptPartial($input: CreatePromptGroupInput!) {\n createPromptGroup(input: $input) {\n clientMutationId\n promptGroup {\n id\n }\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\nexport const TEAMS = gql`\n query TranscendCliTeams($first: Int!, $offset: Int!, $input: TeamFiltersInput) {\n teams(\n first: $first\n offset: $offset\n filterBy: $input\n orderBy: [{ field: createdAt, direction: ASC }, { field: name, direction: ASC }]\n ) {\n nodes {\n id\n name\n description\n ssoDepartment\n ssoGroup\n ssoTitle\n users {\n id\n email\n name\n }\n scopes {\n id\n name\n title\n }\n }\n }\n }\n`;\n\nexport const CREATE_TEAM = gql`\n mutation TranscendCliCreateTeam($input: TeamInput!) {\n createTeam(input: $input) {\n team {\n id\n name\n }\n }\n }\n`;\n\nexport const UPDATE_TEAM = gql`\n mutation TranscendCliUpdateTeam($input: UpdateTeamInput!) {\n updateTeam(input: $input) {\n team {\n id\n name\n }\n }\n }\n`;\n","import { gql } from 'graphql-request';\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: title, direction: ASC }\n// ]\nexport const GLOBAL_ACTION_ITEM_COLLECTIONS = gql`\n query TranscendCliGlobalActionItemCollectionss(\n $filterBy: GlobalActionItemCollectionFiltersInput!\n ) {\n globalActionItemCollections(filterBy: $filterBy) {\n nodes {\n id\n title\n description\n hidden\n productLine\n }\n }\n }\n`;\n\nexport const CREATE_ACTION_ITEM_COLLECTION = gql`\n mutation TranscendCliCreateActionItemCollection($input: CreateActionItemCollectionInput!) {\n createActionItemCollection(input: $input) {\n created {\n id\n title\n }\n }\n }\n`;\n\nexport const UPDATE_ACTION_ITEM_COLLECTION = gql`\n mutation TranscendCliUpdateActionItemCollection($input: UpdateActionItemCollectionInput!) {\n updateActionItemCollection(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - order by createdAt\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\nexport const ATTRIBUTES = gql`\n query TranscendCliAttributes($first: Int!, $offset: Int!) {\n attributeKeys(first: $first, offset: $offset, useMaster: false) {\n nodes {\n id\n isCustom\n description\n enabledOn\n name\n type\n }\n }\n }\n`;\n\nexport const CREATE_ATTRIBUTE_VALUES = gql`\n mutation TranscendCliCreateAttributeValues($input: [CreateAttributeValuesInput!]!) {\n createAttributeValues(input: $input) {\n clientMutationId\n }\n }\n`;\n\nexport const UPDATE_ATTRIBUTE_VALUES = gql`\n mutation TranscendCliUpdateAttributeValues($input: [UpdateAttributeValueInput!]!) {\n updateAttributeValues(input: $input) {\n clientMutationId\n }\n }\n`;\n\nexport const DELETE_ATTRIBUTE_VALUE = gql`\n mutation TranscendCliDeleteAttributeValue($id: ID!) {\n deleteAttributeValue(id: $id) {\n clientMutationId\n }\n }\n`;\n\n// TODO: https://transcend.height.app/T-27909 - order by createdAt\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\nexport const ATTRIBUTE_VALUES = gql`\n query TranscendCliAttributeValues($first: Int!, $offset: Int!, $attributeKeyId: ID!) {\n attributeValues(\n first: $first\n offset: $offset\n useMaster: false\n filterBy: { attributeKeys: [$attributeKeyId] }\n ) {\n nodes {\n id\n name\n description\n color\n }\n }\n }\n`;\n\nexport const CREATE_ATTRIBUTE = gql`\n mutation TranscendCliCreateAttribute(\n $name: String!\n $type: AttributeKeyType!\n $description: String\n $enabledOn: [AttributeSupportedResourceType!]\n ) {\n createAttributeKey(\n input: { name: $name, type: $type, description: $description, enabledOn: $enabledOn }\n ) {\n clientMutationId\n attributeKey {\n id\n }\n }\n }\n`;\n\nexport const UPDATE_ATTRIBUTE = gql`\n mutation TranscendCliCreateAttribute(\n $attributeKeyId: ID!\n $description: String\n $enabledOn: [AttributeSupportedResourceType!]\n ) {\n updateAttributeKey(\n input: { id: $attributeKeyId, description: $description, enabledOn: $enabledOn }\n ) {\n clientMutationId\n attributeKey {\n id\n }\n }\n }\n`;\n\nexport const SET_RESOURCE_ATTRIBUTES = gql`\n mutation TranscendCliSetResourceAttributes($input: SetResourceAttributesInput!) {\n setResourceAttributes(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\nexport const BUSINESS_ENTITIES = gql`\n query TranscendCliBusinessEntities($first: Int!, $offset: Int!) {\n businessEntities(\n first: $first\n offset: $offset\n orderBy: [{ field: createdAt, direction: ASC }, { field: title, direction: ASC }]\n useMaster: false\n ) {\n nodes {\n id\n title\n description\n dataProtectionOfficerName\n dataProtectionOfficerEmail\n address\n headquarterCountry\n headquarterSubDivision\n attributeValues {\n name\n attributeKey {\n name\n }\n }\n }\n }\n }\n`;\n\nexport const CREATE_BUSINESS_ENTITY = gql`\n mutation TranscendCliCreateBusinessEntity($input: CreateBusinessEntityInput!) {\n createBusinessEntity(input: $input) {\n businessEntity {\n id\n title\n description\n dataProtectionOfficerName\n dataProtectionOfficerEmail\n address\n headquarterCountry\n headquarterSubDivision\n attributeValues {\n name\n attributeKey {\n name\n }\n }\n }\n }\n }\n`;\n\nexport const UPDATE_BUSINESS_ENTITIES = gql`\n mutation TranscendCliUpdateBusinessEntities($input: [UpdateBusinessEntityInput!]!) {\n updateBusinessEntities(input: { businessEntities: $input }) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// TODO: https://transcend.height.app/T-27909 - order by createdAt\nexport const ACTIONS = gql`\n query TranscendCliActions($first: Int!, $offset: Int!) {\n actions(\n first: $first\n offset: $offset\n useMaster: false\n orderBy: [{ field: type, direction: ASC }]\n ) {\n nodes {\n id\n type\n skipSecondaryIfNoFiles\n skipDownloadableStep\n requiresReview\n regionList\n regionDetectionMethod\n waitingPeriod\n }\n }\n }\n`;\n\nexport const UPDATE_ACTION = gql`\n mutation TranscendCliUpdateAction($input: UpdateActionInput!) {\n updateAction(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\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: title, direction: ASC }\n// ]\nexport const GLOBAL_ACTION_ITEMS = gql`\n query TranscendCliGlobalActionItems(\n $first: Int!\n $offset: Int!\n $filterBy: GlobalActionItemFiltersInput!\n ) {\n globalActionItems(first: $first, offset: $offset, filterBy: $filterBy) {\n nodes {\n ids\n count\n teams {\n id\n name\n }\n customerExperienceActionItemIds\n users {\n id\n email\n }\n collections {\n title\n id\n }\n dueDate\n priority\n titles\n resolved\n notes\n links\n type\n additionalContexts {\n iconOverride\n requestId\n dataSiloId\n requestType\n latestAirgapVersion\n parentTitle\n }\n attributeValues {\n name\n attributeKey {\n name\n }\n }\n }\n }\n }\n`;\n\nexport const UPDATE_ACTION_ITEMS = gql`\n mutation TranscendCliUpdateActionItems($input: UpdateActionItemsInput!) {\n updateActionItems(input: $input) {\n clientMutationId\n }\n }\n`;\n\nexport const CREATE_ACTION_ITEMS = gql`\n mutation TranscendCliCreateActionItems($input: [CreateActionItemsInput!]!) {\n createActionItems(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\nexport const FETCH_PRIVACY_CENTER_ID = gql`\n query TranscendCliFetchPrivacyCenterId($url: String!) {\n privacyCenter(lookup: { url: $url }) {\n id\n }\n }\n`;\n\nexport const DEPLOYED_PRIVACY_CENTER_URL = gql`\n query TranscendCliDeployedPrivacyCenterUrl {\n organization {\n deployedPrivacyCenterUrl\n }\n }\n`;\n\nexport const PRIVACY_CENTER = gql`\n query TranscendCliFetchPrivacyCenters($url: String!) {\n privacyCenter(lookup: { url: $url }) {\n id\n url\n isDisabled\n showPrivacyRequestButton\n showPolicies\n showTrackingTechnologies\n showCookies\n showDataFlows\n showConsentManager\n showManageYourPrivacy\n showMarketingPreferences\n locales\n defaultLocale\n preferBrowserDefaultLocale\n supportEmail\n replyToEmail\n useNoReplyEmailAddress\n useCustomEmailDomain\n transformAccessReportJsonToCsv\n themeStr\n }\n }\n`;\n\nexport const UPDATE_PRIVACY_CENTER = gql`\n mutation TranscendCliUpdatePrivacyCenter($input: UpdatePrivacyCenterInput!) {\n updatePrivacyCenter(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\nexport const AGENTS = gql`\n query TranscendCliAgents($first: Int!, $offset: Int!, $filterBy: AgentFiltersInput) {\n agents(\n first: $first\n offset: $offset\n filterBy: $filterBy\n orderBy: [{ field: createdAt, direction: ASC }, { field: name, direction: ASC }]\n ) {\n nodes {\n id\n name\n agentId\n instructions\n description\n codeInterpreterEnabled\n retrievalEnabled\n prompt {\n title\n }\n largeLanguageModel {\n name\n client\n }\n teams {\n name\n }\n owners {\n email\n }\n agentFunctions {\n name\n }\n agentFiles {\n name\n }\n }\n }\n }\n`;\n\nexport const CREATE_AGENT = gql`\n mutation TranscendCliCreateAgent($input: CreateAgentInput!) {\n createAgent(input: $input) {\n agent {\n id\n name\n agentId\n }\n }\n }\n`;\n\nexport const UPDATE_AGENTS = gql`\n mutation TranscendCliUpdateAgents($input: UpdateAgentsInput!) {\n updateAgents(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\nexport const AGENT_FILES = gql`\n query TranscendCliAgentFiles($first: Int!, $offset: Int!, $filterBy: AgentFileFiltersInput) {\n agentFiles(\n first: $first\n offset: $offset\n filterBy: $filterBy\n orderBy: [{ field: createdAt, direction: ASC }, { field: name, direction: ASC }]\n ) {\n nodes {\n id\n name\n description\n fileId\n size\n purpose\n initialFileName\n }\n }\n }\n`;\n\nexport const CREATE_AGENT_FILE = gql`\n mutation TranscendCliCreateAgentFile($input: CreateAgentFileInput!) {\n createAgentFile(input: $input) {\n agentFile {\n id\n name\n fileId\n initialFileName\n }\n }\n }\n`;\n\nexport const UPDATE_AGENT_FILES = gql`\n mutation TranscendCliUpdateAgentFiles($input: UpdateAgentFilesInput!) {\n updateAgentFiles(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\n// useMaster: false\nexport const AGENT_FUNCTIONS = gql`\n query TranscendCliAgentFunctions($first: Int!, $offset: Int!) {\n agentFunctions(\n first: $first\n offset: $offset\n orderBy: [{ field: createdAt, direction: ASC }, { field: name, direction: ASC }]\n ) {\n nodes {\n id\n name\n description\n parameters\n }\n }\n }\n`;\n\nexport const CREATE_AGENT_FUNCTION = gql`\n mutation TranscendCliCreateAgentFunction($input: CreateAgentFunctionInput!) {\n createAgentFunction(input: $input) {\n agentFunction {\n id\n name\n }\n }\n }\n`;\n\nexport const UPDATE_AGENT_FUNCTIONS = gql`\n mutation TranscendCliUpdateAgentFunctions($input: UpdateAgentFunctionsInput!) {\n updateAgentFunctions(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\nexport const VENDORS = gql`\n query TranscendCliVendors($first: Int!, $offset: Int!) {\n vendors(\n first: $first\n offset: $offset\n useMaster: false\n isExportCsv: true\n orderBy: [{ field: createdAt, direction: ASC }, { field: title, direction: ASC }]\n ) {\n nodes {\n id\n title\n description\n dataProcessingAgreementLink\n contactName\n contactEmail\n contactPhone\n address\n headquarterCountry\n headquarterSubDivision\n websiteUrl\n businessEntity {\n title\n }\n teams {\n name\n }\n owners {\n email\n }\n attributeValues {\n attributeKey {\n name\n }\n name\n }\n }\n }\n }\n`;\n\nexport const CREATE_VENDOR = gql`\n mutation TranscendCliCreateVendor($input: CreateVendorInput!) {\n createVendor(input: $input) {\n vendor {\n id\n title\n }\n }\n }\n`;\n\nexport const UPDATE_VENDORS = gql`\n mutation TranscendCliUpdateVendor($input: UpdateVendorsInput!) {\n updateVendors(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// orderBy: [\n// { field: createdAt, direction: ASC }\n// { field: name, direction: ASC }\n// ]\nexport const DATA_SUB_CATEGORIES = gql`\n query TranscendCliDataSubCategories($first: Int!, $offset: Int!) {\n dataSubCategories(first: $first, offset: $offset, isExportCsv: true, useMaster: false) {\n nodes {\n id\n name\n category\n description\n regex\n teams {\n name\n }\n owners {\n email\n }\n attributeValues {\n attributeKey {\n name\n }\n name\n }\n }\n }\n }\n`;\n\nexport const CREATE_DATA_SUB_CATEGORY = gql`\n mutation TranscendCliCreateDataSubCategory($input: CreateDataInventorySubCategoryInput!) {\n createDataSubCategory(input: $input) {\n dataSubCategory {\n id\n name\n category\n }\n }\n }\n`;\n\nexport const UPDATE_DATA_SUB_CATEGORIES = gql`\n mutation TranscendCliUpdateDataSubCategories($input: UpdateDataSubCategoriesInput!) {\n updateDataSubCategories(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// orderBy: [\n// { field: createdAt, direction: ASC }\n// { field: name, direction: ASC }\n// ]\nexport const PROCESSING_PURPOSE_SUB_CATEGORIES = gql`\n query TranscendCliProcessingPurposeSubCategories($first: Int!, $offset: Int!) {\n processingPurposeSubCategories(\n first: $first\n offset: $offset\n isExportCsv: true\n useMaster: false\n ) {\n nodes {\n id\n name\n purpose\n description\n teams {\n name\n }\n owners {\n email\n }\n attributeValues {\n attributeKey {\n name\n }\n name\n }\n }\n }\n }\n`;\n\nexport const CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = gql`\n mutation TranscendCliCreateProcessingPurposeSubCategory(\n $input: CreateProcessingPurposeCategoryInput!\n ) {\n createProcessingPurposeSubCategory(input: $input) {\n processingPurposeSubCategory {\n id\n name\n purpose\n }\n }\n }\n`;\n\nexport const UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = gql`\n mutation TranscendCliUpdateProcessingPurposeSubCategories(\n $input: UpdateProcessingPurposeSubCategoriesInput!\n ) {\n updateProcessingPurposeSubCategories(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { gql } from 'graphql-request';\n\nexport const PROCESSING_ACTIVITIES = gql`\n query TranscendCliProcessingActivities($first: Int!, $offset: Int!) {\n processingActivities(first: $first, offset: $offset, useMaster: false) {\n nodes {\n id\n title\n description\n securityMeasureDetails\n controllerships\n storageRegions {\n countrySubDivision\n country\n }\n transferRegions {\n countrySubDivision\n country\n }\n retentionType\n retentionPeriod\n dataProtectionImpactAssessmentLink\n dataProtectionImpactAssessmentStatus\n attributeValues {\n name\n attributeKey {\n name\n }\n }\n dataSilos {\n title\n }\n dataSubjects {\n type\n }\n teams {\n name\n }\n owners {\n email\n }\n processingPurposeSubCategories {\n name\n purpose\n }\n dataSubCategories {\n name\n category\n }\n saaSCategories {\n title\n }\n }\n }\n }\n`;\n\nexport const CREATE_PROCESSING_ACTIVITY = gql`\n mutation TranscendCliCreateProcessingActivity($input: CreateProcessingActivityInput!) {\n createProcessingActivity(input: $input) {\n processingActivity {\n id\n title\n }\n }\n }\n`;\n\nexport const UPDATE_PROCESSING_ACTIVITIES = gql`\n mutation TranscendCliUpdateProcessingActivities($input: UpdateProcessingActivitiesInput!) {\n updateProcessingActivities(input: $input) {\n clientMutationId\n }\n }\n`;\n","import { ActionItemCode, ActionItemPriorityOverride } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { GLOBAL_ACTION_ITEMS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface ActionItemRaw {\n /** ID of action item */\n ids: string[];\n /** Count of action items */\n count: number;\n /** Teams assigned to action items */\n teams: {\n /** ID of team */\n id: string;\n /** Name of team */\n name: string;\n }[];\n /** Customer experience action item ID */\n customerExperienceActionItemIds: string[];\n /** Users assigned to the action item */\n users: {\n /** ID of user */\n id: string;\n /** User email */\n email: string;\n }[];\n /** Due date of action item */\n dueDate?: string;\n /** Priority of action item */\n priority?: ActionItemPriorityOverride;\n /** Titles of action items */\n titles: string[];\n /** Description of the action item */\n resolved: boolean;\n /** Notes */\n notes: string[];\n /** links */\n links: string[];\n /** Action item types */\n type: ActionItemCode;\n /** Custom fields */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key that the value represents */\n attributeKey: {\n /** Name of attribute team */\n name: string;\n };\n }[];\n /** Additional context related to action item */\n additionalContexts?: {\n /** Override of icon */\n iconOverride?: string;\n /** Request ID */\n requestId?: string;\n /** Data Silo ID */\n dataSiloId?: string;\n /** Request type */\n requestType?: string;\n /** Airgap version */\n latestAirgapVersion?: string;\n /** Parent title */\n parentTitle?: string;\n };\n /** Sections where action item is grouped under */\n collections: {\n /** ID of collection that action item belongs to */\n id: string;\n /** Title of collection */\n title: string;\n }[];\n}\n\nexport interface ActionItem extends Omit<ActionItemRaw, 'ids' | 'titles' | 'links' | 'notes'> {\n /** ID of action item */\n id: string;\n /** Title of action item */\n title: string;\n /** Notes */\n notes: string;\n /** Links */\n link: string;\n /** Sections where action item is grouped under */\n collections: {\n /** ID of collection that action item belongs to */\n id: string;\n /** Title of collection */\n title: string;\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all action items in the organization\n *\n * @param client - GraphQL client\n * @param filterBy - Filter by\n * @returns All action items in the organization\n */\nexport async function fetchAllActionItems(\n client: GraphQLClient,\n filterBy: {\n /** Names of the action items to filter for */\n priority?: ActionItemPriorityOverride[];\n /** Type of action item */\n type?: ActionItemCode[];\n /** Whether resolved or not */\n resolved?: boolean;\n /** Filter for action items due before this date */\n startDueDate?: Date;\n /** Filter for action items due after this date */\n endDueDate?: Date;\n } = {},\n): Promise<ActionItem[]> {\n const actionItems: ActionItem[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n globalActionItems: { nodes },\n } = await makeGraphQLRequest<{\n /** ActionItems */\n globalActionItems: {\n /** List */\n nodes: ActionItemRaw[];\n };\n }>(client, GLOBAL_ACTION_ITEMS, {\n first: PAGE_SIZE,\n offset,\n filterBy: {\n ...filterBy,\n ...(filterBy.startDueDate ? { startDueDate: filterBy.startDueDate.toISOString() } : {}),\n ...(filterBy.endDueDate ? { endDueDate: filterBy.endDueDate.toISOString() } : {}),\n },\n });\n actionItems.push(\n ...nodes.map((node) => ({\n ...node,\n id: node.ids[0],\n title: node.titles[0],\n notes: node.notes[0],\n link: node.links[0],\n })),\n );\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return actionItems;\n}\n","import { PromptFilePurpose } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { AGENT_FILES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface AgentFile {\n /** ID of agentFile */\n id: string;\n /** Name of agentFile */\n name: string;\n /** Description of the agentFile */\n description: string;\n /** Initial file name, useful to track if a file was split into multiple chunks */\n initialFileName?: string;\n /** File ID */\n fileId: string;\n /** File size */\n size: number;\n /** File purpose */\n purpose: PromptFilePurpose;\n}\n\nconst PAGE_SIZE = 20;\n\nexport interface AgentFileFilterBy {\n /** Filter by remote file IDs */\n fileIds?: string[];\n /** Filter by file names */\n names?: string[];\n /** Filter by initial file names (when split into chunks) */\n initialFileNames?: string[];\n}\n\n/**\n * Fetch all agentFiles in the organization\n *\n * @param client - GraphQL client\n * @param filterBy - Filter by options\n * @returns All agentFiles in the organization\n */\nexport async function fetchAllAgentFiles(\n client: GraphQLClient,\n filterBy: AgentFileFilterBy = {},\n): Promise<AgentFile[]> {\n const agentFiles: AgentFile[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n agentFiles: { nodes },\n } = await makeGraphQLRequest<{\n /** AgentFiles */\n agentFiles: {\n /** List */\n nodes: AgentFile[];\n };\n }>(client, AGENT_FILES, {\n first: PAGE_SIZE,\n offset,\n filterBy,\n });\n agentFiles.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return agentFiles.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { GraphQLClient } from 'graphql-request';\nimport type { JSONSchema7 } from 'json-schema';\n\nimport { AGENT_FUNCTIONS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface AgentFunction {\n /** ID of agentFunction */\n id: string;\n /** Name of agentFunction */\n name: string;\n /** Description of the agentFunction */\n description: string;\n /** The JSON schema */\n parameters: JSONSchema7;\n}\n\ninterface AgentFunctionInput extends Omit<AgentFunction, 'parameters'> {\n /** Stringified parameters */\n parameters: string;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all agentFunctions in the organization\n *\n * @param client - GraphQL client\n * @returns All agentFunctions in the organization\n */\nexport async function fetchAllAgentFunctions(client: GraphQLClient): Promise<AgentFunction[]> {\n const agentFunctions: AgentFunction[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n agentFunctions: { nodes },\n } = await makeGraphQLRequest<{\n /** AgentFunctions */\n agentFunctions: {\n /** List */\n nodes: AgentFunctionInput[];\n };\n }>(client, AGENT_FUNCTIONS, {\n first: PAGE_SIZE,\n offset,\n });\n agentFunctions.push(\n ...nodes.map((node) => ({\n ...node,\n parameters: JSON.parse(node.parameters),\n })),\n );\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return agentFunctions.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { LargeLanguageModelClient } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { AGENTS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Agent {\n /** ID of agent */\n id: string;\n /** Name of agent */\n name: string;\n /** Agent instructions */\n instructions: string;\n /** The ID of the agent */\n agentId: string;\n /** Description of the agent */\n description: string;\n /** Whether the agent has code interpreter enabled */\n codeInterpreterEnabled: boolean;\n /** Whether the agent has retrieval enabled */\n retrievalEnabled: boolean;\n /** The prompt that the agent is based on */\n prompt?: {\n /** Title of the prompt */\n title: string;\n };\n /** Large language model that the agent is based on */\n largeLanguageModel: {\n /** Name of model */\n name: string;\n /** Client */\n client: LargeLanguageModelClient;\n };\n /** Teams assigned to the agent */\n teams: {\n /** Team name */\n name: string;\n }[];\n /** Users assigned to the agent */\n owners: {\n /** User email */\n email: string;\n }[];\n /** Functions that the agent has access to */\n agentFunctions: {\n /** Function name */\n name: string;\n }[];\n /** Files that the agent has access to */\n agentFiles: {\n /** File name */\n name: string;\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all agents in the organization\n *\n * @param client - GraphQL client\n * @param filterBy - Filter by\n * @returns All agents in the organization\n */\nexport async function fetchAllAgents(\n client: GraphQLClient,\n filterBy: {\n /** Names of the agents to filter for */\n names?: string[];\n /** IDs of agents */\n agentIds?: string[];\n } = {},\n): Promise<Agent[]> {\n const agents: Agent[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n agents: { nodes },\n } = await makeGraphQLRequest<{\n /** Agents */\n agents: {\n /** List */\n nodes: Agent[];\n };\n }>(client, AGENTS, {\n first: PAGE_SIZE,\n offset,\n filterBy,\n });\n agents.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return agents.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { AttributeKeyType, AttributeSupportedResourceType } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\nimport { ATTRIBUTES, ATTRIBUTE_VALUES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface AttributeValue {\n /** Attribute ID */\n id: string;\n /** Attribute name */\n name: string;\n /** Attribute description */\n description: string;\n /** Color of attribute value */\n color: string;\n}\n\nexport interface Attribute {\n /** ID of attribute */\n id: string;\n /** Name of attribute */\n name: string;\n /** if custom attribute */\n isCustom: boolean;\n /** Description */\n description: string;\n /** Type of attribute */\n type: AttributeKeyType;\n /** Values */\n values: AttributeValue[];\n /** The different fields that the attribute is enabled on */\n enabledOn: AttributeSupportedResourceType[];\n}\n\nconst PAGE_SIZE = 100;\n\n/**\n * Fetch all attribute values for an attribute key\n *\n * @param client - GraphQL client\n * @param attributeKeyId - Attribute keyID\n * @returns A map from apiKey title to Identifier\n */\nexport async function fetchAllAttributeValues(\n client: GraphQLClient,\n attributeKeyId: string,\n): Promise<AttributeValue[]> {\n logger.info(colors.magenta(`Fetching all attribute values for ${attributeKeyId}...`));\n const attributeValues: AttributeValue[] = [];\n let offset = 0;\n\n // Paginate\n let shouldContinue = false;\n do {\n const {\n attributeValues: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n attributeValues: {\n /** List of matches */\n nodes: AttributeValue[];\n };\n }>(client, ATTRIBUTE_VALUES, {\n first: PAGE_SIZE,\n offset,\n attributeKeyId,\n });\n attributeValues.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return attributeValues.sort((a, b) => a.name.localeCompare(b.name));\n}\n\nexport const SYNC_ATTRIBUTE_TYPES = [AttributeKeyType.MultiSelect, AttributeKeyType.SingleSelect];\n\n/**\n * Fetch all attributes in an organization\n *\n * @param client - GraphQL client\n * @returns A map from apiKey title to Identifier\n */\nexport async function fetchAllAttributes(client: GraphQLClient): Promise<Attribute[]> {\n logger.info(colors.magenta('Fetching all attributes...'));\n const attributes: Attribute[] = [];\n let offset = 0;\n\n // Paginate\n let shouldContinue = false;\n do {\n const {\n attributeKeys: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n attributeKeys: {\n /** List of matches */\n nodes: Attribute[];\n };\n }>(client, ATTRIBUTES, {\n first: PAGE_SIZE,\n offset,\n });\n attributes.push(\n ...(await Promise.all(\n nodes.map(async (node) => ({\n ...node,\n values: SYNC_ATTRIBUTE_TYPES.includes(node.type)\n ? await fetchAllAttributeValues(client, node.id)\n : [],\n })),\n )),\n );\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return attributes.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { IsoCountryCode, IsoCountrySubdivisionCode } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { BUSINESS_ENTITIES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface BusinessEntity {\n /** ID of business entity */\n id: string;\n /** Title of business entity */\n title: string;\n /** Description of business entity */\n description?: string;\n /** Data protection officer name */\n dataProtectionOfficerName?: string;\n /** Data protection officer email */\n dataProtectionOfficerEmail?: string;\n /** Address of business entity */\n address?: string;\n /** Headquarters of business entity */\n headquarterCountry?: IsoCountryCode;\n /** Subdivision of business entity */\n headquarterSubDivision?: IsoCountrySubdivisionCode;\n /** Attributes */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key */\n attributeKey: {\n /** Name of attribute key */\n name: string;\n };\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all businessEntities in the organization\n *\n * @param client - GraphQL client\n * @returns All businessEntities in the organization\n */\nexport async function fetchAllBusinessEntities(client: GraphQLClient): Promise<BusinessEntity[]> {\n const businessEntities: BusinessEntity[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n businessEntities: { nodes },\n } = await makeGraphQLRequest<{\n /** Business entities */\n businessEntities: {\n /** List */\n nodes: BusinessEntity[];\n };\n }>(client, BUSINESS_ENTITIES, {\n first: PAGE_SIZE,\n offset,\n });\n businessEntities.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return businessEntities.sort((a, b) => a.title.localeCompare(b.title));\n}\n","import { DataCategoryType } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { DATA_SUB_CATEGORIES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface DataSubCategory {\n /** ID of data category */\n id: string;\n /** Name of data category */\n name: string;\n /** Type of data category */\n category: DataCategoryType;\n /** Description of data category */\n description?: string;\n /** Regex for data category */\n regex?: string;\n /** Assigned teams */\n teams: {\n /** Team name */\n name: string;\n }[];\n /** Assigned owners */\n owners: {\n /** Email */\n email: string;\n }[];\n /** Custom fields */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key that the value represents */\n attributeKey: {\n /** Name of attribute team */\n name: string;\n };\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all dataSubCategories in the organization\n *\n * @param client - GraphQL client\n * @returns All dataSubCategories in the organization\n */\nexport async function fetchAllDataCategories(client: GraphQLClient): Promise<DataSubCategory[]> {\n const dataSubCategories: DataSubCategory[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n dataSubCategories: { nodes },\n } = await makeGraphQLRequest<{\n /** DataCategories */\n dataSubCategories: {\n /** List */\n nodes: DataSubCategory[];\n };\n }>(client, DATA_SUB_CATEGORIES, {\n first: PAGE_SIZE,\n offset,\n });\n dataSubCategories.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return dataSubCategories.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { GraphQLClient } from 'graphql-request';\n\nimport { DEPLOYED_PRIVACY_CENTER_URL, FETCH_PRIVACY_CENTER_ID } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\n/**\n * Fetch default privacy center URL\n *\n * @param client - GraphQL client\n * @returns Privacy Center ID in organization\n */\nexport async function fetchPrivacyCenterUrl(client: GraphQLClient): Promise<string> {\n const { organization } = await makeGraphQLRequest<{\n /** Organization */\n organization: {\n /** URL */\n deployedPrivacyCenterUrl: string;\n };\n }>(client, DEPLOYED_PRIVACY_CENTER_URL);\n return organization.deployedPrivacyCenterUrl;\n}\n\n/**\n * Fetch privacy center ID\n *\n * @param client - GraphQL client\n * @param url - URLto lookup\n * @returns Privacy Center ID in organization\n */\nexport async function fetchPrivacyCenterId(client: GraphQLClient, url?: string): Promise<string> {\n let urlToUse = url;\n if (!urlToUse) {\n urlToUse = await fetchPrivacyCenterUrl(client);\n }\n const { privacyCenter } = await makeGraphQLRequest<{\n /** Privacy Center query */\n privacyCenter: {\n /** ID of bundle */\n id: string;\n };\n }>(client, FETCH_PRIVACY_CENTER_ID, {\n url: urlToUse,\n });\n return privacyCenter.id;\n}\n","import type { LocaleValue } from '@transcend-io/internationalization';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { fetchPrivacyCenterUrl } from './fetchPrivacyCenterId.js';\nimport { POLICIES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Policy {\n /** ID of policy */\n id: string;\n /** Title of policy */\n title: {\n /** Default message */\n defaultMessage: string;\n };\n /** Disabled locales */\n disabledLocales: LocaleValue[];\n /** Versions */\n versions: {\n /** Message content */\n content: {\n /** Default message */\n defaultMessage: string;\n };\n }[];\n}\n\n/**\n * Fetch all policies in the organization\n *\n * @param client - GraphQL client\n * @returns All policies in the organization\n */\nexport async function fetchAllPolicies(client: GraphQLClient): Promise<Policy[]> {\n const deployedPrivacyCenterUrl = await fetchPrivacyCenterUrl(client);\n const { privacyCenterPolicies } = await makeGraphQLRequest<{\n /** Policies */\n privacyCenterPolicies: Policy[];\n }>(client, POLICIES, {\n url: deployedPrivacyCenterUrl,\n });\n\n return privacyCenterPolicies.sort((a, b) =>\n a.title.defaultMessage.localeCompare(b.title.defaultMessage),\n );\n}\n","import type {\n ProcessingPurpose,\n DataCategoryType,\n DataProtectionImpactAssessmentStatus,\n Controllership,\n RetentionType,\n} from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport type { Region } from './formatRegions.js';\nimport { PROCESSING_ACTIVITIES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface ProcessingActivity {\n /** ID of processing activity */\n id: string;\n /** Title of processing activity */\n title: string;\n /** Description of processing activity */\n description: string;\n /** Security measure details */\n securityMeasureDetails?: string;\n /** Controllerships */\n controllerships: Controllership[];\n /** Storage regions */\n storageRegions: Region[];\n /** Transfer regions */\n transferRegions: Region[];\n /** Retention type */\n retentionType: RetentionType;\n /** Retention period in days */\n retentionPeriod?: number;\n /** Data protection impact assessment link */\n dataProtectionImpactAssessmentLink?: string;\n /** Data protection impact assessment status */\n dataProtectionImpactAssessmentStatus: DataProtectionImpactAssessmentStatus;\n /** Attribute values */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key */\n attributeKey: {\n /** Name of attribute key */\n name: string;\n };\n }[];\n /** Data silos */\n dataSilos: {\n /** Data silo title */\n title: string;\n }[];\n /** Data subjects */\n dataSubjects: {\n /** Data subject type */\n type: string;\n }[];\n /** Teams */\n teams: {\n /** Team name */\n name: string;\n }[];\n /** Owners */\n owners: {\n /** Owner email */\n email: string;\n }[];\n /** Processing purpose sub categories */\n processingPurposeSubCategories: {\n /** Processing purpose sub category name */\n name: string;\n /** Processing purpose */\n purpose: ProcessingPurpose;\n }[];\n /** Data sub categories */\n dataSubCategories: {\n /** Data sub category name */\n name: string;\n /** Data category */\n category: DataCategoryType;\n }[];\n /** SaaS categories */\n saaSCategories: {\n /** Title */\n title: string;\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all processingActivities in the organization\n *\n * @param client - GraphQL client\n * @returns All processingActivities in the organization\n */\nexport async function fetchAllProcessingActivities(\n client: GraphQLClient,\n): Promise<ProcessingActivity[]> {\n const processingActivities: ProcessingActivity[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n processingActivities: { nodes },\n } = await makeGraphQLRequest<{\n /** Processing activities */\n processingActivities: {\n /** List */\n nodes: ProcessingActivity[];\n };\n }>(client, PROCESSING_ACTIVITIES, {\n first: PAGE_SIZE,\n offset,\n });\n processingActivities.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return processingActivities.sort((a, b) => a.title.localeCompare(b.title));\n}\n","import { ProcessingPurpose } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { PROCESSING_PURPOSE_SUB_CATEGORIES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface ProcessingPurposeSubCategory {\n /** ID of processing purpose */\n id: string;\n /** Name of processing purpose */\n name: string;\n /** Type of processing purpose */\n purpose: ProcessingPurpose;\n /** Description of processing purpose */\n description?: string;\n /** Assigned teams */\n teams: {\n /** Team name */\n name: string;\n }[];\n /** Assigned owners */\n owners: {\n /** Email */\n email: string;\n }[];\n /** Custom fields */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key that the value represents */\n attributeKey: {\n /** Name of attribute team */\n name: string;\n };\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all processingPurposeSubCategories in the organization\n *\n * @param client - GraphQL client\n * @returns All processingPurposeSubCategories in the organization\n */\nexport async function fetchAllProcessingPurposes(\n client: GraphQLClient,\n): Promise<ProcessingPurposeSubCategory[]> {\n const processingPurposeSubCategories: ProcessingPurposeSubCategory[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n processingPurposeSubCategories: { nodes },\n } = await makeGraphQLRequest<{\n /** DataCategories */\n processingPurposeSubCategories: {\n /** List */\n nodes: ProcessingPurposeSubCategory[];\n };\n }>(client, PROCESSING_PURPOSE_SUB_CATEGORIES, {\n first: PAGE_SIZE,\n offset,\n });\n processingPurposeSubCategories.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return processingPurposeSubCategories.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { ScopeName } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { TEAMS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Team {\n /** ID of team */\n id: string;\n /** Name of team */\n name: string;\n /** Description of team */\n description: string;\n /** SSO department for automated provisioning */\n ssoDepartment?: string;\n /** SSO group name for automated provisioning */\n ssoGroup?: string;\n /** SSO title mapping for automated provisioning */\n ssoTitle?: string;\n /** List of users on the team */\n users: {\n /** ID of user */\n id: string;\n /** Email of user */\n email: string;\n /** Name of user */\n name: string;\n }[];\n /** List of scopes on the team */\n scopes: {\n /** ID of scope */\n id: string;\n /** Name of scope */\n name: ScopeName;\n /** Title of scope */\n title: string;\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all teams in the organization\n *\n * @param client - GraphQL client\n * @returns All teams in the organization\n */\nexport async function fetchAllTeams(client: GraphQLClient): Promise<Team[]> {\n const teams: Team[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n teams: { nodes },\n } = await makeGraphQLRequest<{\n /** Teams */\n teams: {\n /** List */\n nodes: Team[];\n };\n }>(client, TEAMS, {\n first: PAGE_SIZE,\n offset,\n });\n teams.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return teams.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { IsoCountryCode, IsoCountrySubdivisionCode } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { VENDORS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Vendor {\n /** ID of vendor */\n id: string;\n /** Title of vendor */\n title: string;\n /** Description of vendor */\n description: string;\n /** DPA link */\n dataProcessingAgreementLink?: string;\n /** Contract email */\n contactName?: string;\n /** Contract phone */\n contactPhone?: string;\n /** Address */\n address?: string;\n /** Headquarters country */\n headquarterCountry?: IsoCountryCode;\n /** Headquarters subdivision */\n headquarterSubDivision?: IsoCountrySubdivisionCode;\n /** Website URL */\n websiteUrl?: string;\n /** Business entity */\n businessEntity?: {\n /** Business entity title */\n title: string;\n };\n /** Assigned teams */\n teams: {\n /** Team name */\n name: string;\n }[];\n /** Assigned owners */\n owners: {\n /** Email */\n email: string;\n }[];\n /** Custom fields */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key that the value represents */\n attributeKey: {\n /** Name of attribute team */\n name: string;\n };\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all vendors in the organization\n *\n * @param client - GraphQL client\n * @returns All vendors in the organization\n */\nexport async function fetchAllVendors(client: GraphQLClient): Promise<Vendor[]> {\n const vendors: Vendor[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n vendors: { nodes },\n } = await makeGraphQLRequest<{\n /** Vendors */\n vendors: {\n /** List */\n nodes: Vendor[];\n };\n }>(client, VENDORS, {\n first: PAGE_SIZE,\n offset,\n });\n vendors.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return vendors.sort((a, b) => a.title.localeCompare(b.title));\n}\n","import { RequestActionObjectResolver } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport { keyBy, flatten, uniq, difference } from 'lodash-es';\n\nimport { TranscendInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { mapSeries } from '../bluebird.js';\nimport { CREATE_DATA_SUBJECT, DATA_SUBJECTS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface DataSubject {\n /** ID of data subject */\n id: string;\n /** Type of data subject */\n type: string;\n /** Whether active */\n active: boolean;\n /** Title of data subject */\n title: {\n /** Default message */\n defaultMessage: string;\n };\n /** Whether silent mode is enabled by default */\n adminDashboardDefaultSilentMode: boolean;\n /** Enabled actions */\n actions: {\n /** Type of action */\n type: RequestActionObjectResolver;\n }[];\n}\n\n/**\n * Fetch all data subjects in an organization\n *\n * @param client - GraphQL client\n * @returns List of data subject configurations\n */\nexport async function fetchAllDataSubjects(client: GraphQLClient): Promise<DataSubject[]> {\n // Fetch all data subjects in the organization\n const { internalSubjects } = await makeGraphQLRequest<{\n /** Query response */\n internalSubjects: DataSubject[];\n }>(client, DATA_SUBJECTS);\n return internalSubjects;\n}\n\n/**\n * Fetch all of the data subjects in the organization\n *\n * @param input - Input to fetch\n * @param client - GraphQL client\n * @param fetchAll - When true, always fetch all subjects\n * @returns The list of data subjects\n */\nexport async function ensureAllDataSubjectsExist(\n {\n 'data-silos': dataSilos = [],\n 'data-subjects': dataSubjects = [],\n 'processing-activities': processingActivities = [],\n enrichers = [],\n }: TranscendInput,\n client: GraphQLClient,\n fetchAll = false,\n): Promise<{ [type in string]: DataSubject }> {\n // Only need to fetch data subjects if specified in config\n const expectedDataSubjects = uniq([\n ...flatten(dataSilos.map((silo) => silo['data-subjects'] || []) || []),\n ...flatten(processingActivities.map(({ dataSubjectTypes }) => dataSubjectTypes ?? []) ?? []),\n ...flatten(enrichers.map((enricher) => enricher['data-subjects'] || []) || []),\n ...dataSubjects.map((subject) => subject.type),\n ]);\n if (expectedDataSubjects.length === 0 && !fetchAll) {\n return {};\n }\n\n // Fetch all data subjects in the organization\n const internalSubjects = await fetchAllDataSubjects(client);\n const dataSubjectByName = keyBy(internalSubjects, 'type');\n\n // Determine expected set of data subjects to create\n const missingDataSubjects = difference(\n expectedDataSubjects,\n internalSubjects.map(({ type }) => type),\n );\n\n // If there are missing data subjects, create new ones\n if (missingDataSubjects.length > 0) {\n logger.info(colors.magenta(`Creating ${missingDataSubjects.length} new data subjects...`));\n await mapSeries(missingDataSubjects, async (dataSubject) => {\n logger.info(colors.magenta(`Creating data subject ${dataSubject}...`));\n const { createSubject } = await makeGraphQLRequest<{\n /** Create Subject Response */\n createSubject: {\n /** Created Data Subject */\n subject: DataSubject;\n };\n }>(client, CREATE_DATA_SUBJECT, {\n type: dataSubject,\n skipPublish: true,\n });\n logger.info(colors.green(`Created data subject ${dataSubject}!`));\n\n dataSubjectByName[dataSubject] = createSubject.subject;\n });\n }\n\n return dataSubjectByName;\n}\n\n/**\n * Convert a list of data subject types into the block list of IDs to assign to the data silo\n *\n * @param dataSubjectTypes - The list of data subject types that the data silo should be for\n * @param allDataSubjects - All data subjects in the organization\n * @returns The block list of data subject ids to not process against this data silo\n */\nexport function convertToDataSubjectBlockList(\n dataSubjectTypes: string[],\n allDataSubjects: { [type in string]: DataSubject },\n): string[] {\n dataSubjectTypes.forEach((type) => {\n if (!allDataSubjects[type]) {\n throw new Error(`Expected to find data subject definition: ${type}`);\n }\n });\n\n return Object.values(allDataSubjects)\n .filter((silo) => !dataSubjectTypes.includes(silo.type))\n .map(({ id }) => id);\n}\n\n/**\n * Convert a list of data subject types into the allow list of types\n *\n * @param dataSubjectTypes - The list of data subject types that the data silo should be for\n * @param allDataSubjects - All data subjects in the organization\n * @returns The allow list of data subjects for that silo\n */\nexport function convertToDataSubjectAllowlist(\n dataSubjectTypes: string[],\n allDataSubjects: { [type in string]: DataSubject },\n): string[] {\n dataSubjectTypes.forEach((type) => {\n if (!allDataSubjects[type]) {\n throw new Error(`Expected to find data subject definition: ${type}`);\n }\n });\n\n return Object.values(allDataSubjects)\n .filter((silo) => !dataSubjectTypes.includes(silo.type))\n .map(({ type }) => type);\n}\n","import { GraphQLClient } from 'graphql-request';\n\nimport { PROMPT_GROUPS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface PromptGroup {\n /** ID of prompts */\n id: string;\n /** The title of the prompt group. */\n title: string;\n /** The description of the prompt group. */\n description: string;\n /** Prompts in the group */\n prompts: {\n /** Title of prompt */\n title: string;\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all PromptGroups in the organization\n *\n * @param client - GraphQL client\n * @returns All PromptGroups in the organization\n */\nexport async function fetchAllPromptGroups(client: GraphQLClient): Promise<PromptGroup[]> {\n const promptGroups: PromptGroup[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n promptGroups: { nodes },\n } = await makeGraphQLRequest<{\n /** PromptGroups */\n promptGroups: {\n /** List */\n nodes: PromptGroup[];\n };\n }>(client, PROMPT_GROUPS, {\n first: PAGE_SIZE,\n offset,\n });\n promptGroups.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return promptGroups.sort((a, b) => a.title.localeCompare(b.title));\n}\n","import { GraphQLClient } from 'graphql-request';\n\nimport { PROMPT_PARTIALS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface PromptPartial {\n /** ID of prompts */\n id: string;\n /** The title of the prompt partial. */\n title: string;\n /** The content of the prompt partial. */\n content: string;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all PromptPartials in the organization\n *\n * @param client - GraphQL client\n * @returns All PromptPartials in the organization\n */\nexport async function fetchAllPromptPartials(client: GraphQLClient): Promise<PromptPartial[]> {\n const promptPartials: PromptPartial[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n promptPartials: { nodes },\n } = await makeGraphQLRequest<{\n /** PromptPartials */\n promptPartials: {\n /** List */\n nodes: PromptPartial[];\n };\n }>(client, PROMPT_PARTIALS, {\n first: PAGE_SIZE,\n offset,\n });\n promptPartials.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return promptPartials.sort((a, b) => a.title.localeCompare(b.title));\n}\n","import { PromptStatus, PromptResponseFormat } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { PROMPTS, PROMPTS_WITH_VARIABLES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Prompt {\n /** ID of prompt */\n id: string;\n /** The title of the prompt */\n title: string;\n /** The status of the prompt */\n status: PromptStatus;\n /** The content of the prompt */\n content: string;\n /** Temperature to use with prompt */\n temperature: number;\n /** Top P to use with prompt */\n topP: number;\n /** Max tokens to sample for prompt */\n maxTokensToSample: number;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all Prompts in the organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns All Prompts in the organization\n */\nexport async function fetchAllPrompts(\n client: GraphQLClient,\n {\n text,\n titles = [],\n ids = [],\n }: {\n /** Filter by text */\n text?: string;\n /** Filter by ids */\n ids?: string[];\n /** Filter by titles */\n titles?: string[];\n } = {},\n): Promise<Prompt[]> {\n const prompts: Prompt[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n prompts: { nodes },\n } = await makeGraphQLRequest<{\n /** Prompts */\n prompts: {\n /** List */\n nodes: Prompt[];\n };\n }>(client, PROMPTS, {\n first: PAGE_SIZE,\n offset,\n filterBy: {\n ...(text ? { text } : {}),\n ...(titles.length > 0 ? { title: titles } : {}),\n ...(ids.length > 0 ? { id: ids } : {}),\n },\n });\n prompts.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return prompts.sort((a, b) => a.title.localeCompare(b.title));\n}\n\n/**\n * The basic metadata needed to use a prompt at runtime\n */\nexport type TranscendPromptTemplated = {\n /** ID of prompt */\n id: string;\n /** Title of prompt */\n title: string;\n /** Content of prompt */\n content: string;\n /** Status of prompt */\n status: PromptStatus;\n /** Temperature */\n temperature?: number;\n /** Top P */\n topP?: number;\n /** Max tokens to sample */\n maxTokensToSample?: number;\n /** Response format */\n responseFormat?: PromptResponseFormat;\n};\n\n/**\n * The basic metadata needed to use a prompt partial at runtime\n */\nexport type TranscendPromptPartialTemplated = {\n /** ID of prompt */\n id: string;\n /** Title of prompt */\n title: string;\n /** Slug of prompt */\n slug: string;\n /** Content of prompt */\n content: string;\n};\n\n/**\n * Calculated variables\n */\nexport type PromptCalculatedVariable = {\n /** JSON stringified data to template */\n data: string | null;\n /** Name of variable */\n name: string;\n};\n\n/**\n * Runtime variables\n */\nexport type PromptRuntimeVariable = {\n /** Type of variable */\n type: string;\n /** Name of variable */\n name: string;\n};\n\n/**\n * Metadata useful for filling variables within a prompt\n */\nexport type TranscendPromptsAndVariables = {\n /** Prompts ready to be templated */\n prompts: TranscendPromptTemplated[];\n /** Prompt partials */\n promptPartials: TranscendPromptPartialTemplated[];\n /** Calculated variables to be templated */\n calculatedVariables: PromptCalculatedVariable[];\n /** Runtime variables to be templated */\n runtimeVariables: PromptRuntimeVariable[];\n};\n\n/**\n * Fetch prompts with templated variables\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns Prompts and template variables\n */\nexport async function fetchPromptsWithVariables(\n client: GraphQLClient,\n {\n promptTitles = [],\n promptIds = [],\n }: {\n /** Filter by prompt ids */\n promptIds?: string[];\n /** Filter by prompt titles */\n promptTitles?: string[];\n } = {},\n): Promise<TranscendPromptsAndVariables> {\n const { promptsWithVariables } = await makeGraphQLRequest<{\n /** Prompts */\n promptsWithVariables: TranscendPromptsAndVariables;\n }>(client, PROMPTS_WITH_VARIABLES, {\n input: {\n ...(promptTitles.length > 0 ? { promptTitles } : {}),\n ...(promptIds.length > 0 ? { promptIds } : {}),\n },\n });\n\n return promptsWithVariables;\n}\n","import { TranscendProduct } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { GLOBAL_ACTION_ITEM_COLLECTIONS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface ActionItemCollection {\n /** ID of collection */\n id: string;\n /** Title of collection */\n title: string;\n /** Description of collection */\n description: string;\n /** Whether section is hidden */\n hidden: boolean;\n /** Which locations/products the action item shows up in */\n productLine: TranscendProduct;\n}\n\n/**\n * Fetch all action item collections in the organization\n *\n * @param client - GraphQL client\n * @param filterBy - Filter by\n * @returns All action item collections in the organization\n */\nexport async function fetchAllActionItemCollections(\n client: GraphQLClient,\n filterBy: {\n /** Filter on location */\n location?: TranscendProduct;\n } = {},\n): Promise<ActionItemCollection[]> {\n const {\n globalActionItemCollections: { nodes },\n } = await makeGraphQLRequest<{\n /** ActionItemCollections */\n globalActionItemCollections: {\n /** List */\n nodes: ActionItemCollection[];\n };\n }>(client, GLOBAL_ACTION_ITEM_COLLECTIONS, {\n filterBy: {\n ...filterBy,\n },\n });\n return nodes;\n}\n","import {\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n PromptAVendorEmailCompletionLinkType,\n PromptAVendorEmailSendType,\n ConfidenceLabel,\n RequestActionObjectResolver,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport { apply } from '@transcend-io/type-utils';\n/* eslint-disable max-lines */\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport { sortBy, chunk, keyBy } from 'lodash-es';\n\nimport { DataCategoryInput, DataSiloInput, ProcessingPurposeInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { mapSeries, map } from '../bluebird.js';\nimport { ApiKey } from './fetchApiKeys.js';\nimport { convertToDataSubjectBlockList, DataSubject } from './fetchDataSubjects.js';\nimport {\n DATA_SILOS,\n CREATE_DATA_SILOS,\n UPDATE_OR_CREATE_DATA_POINT,\n DATA_POINTS,\n SUB_DATA_POINTS,\n UPDATE_DATA_SILOS,\n DATA_SILOS_ENRICHED,\n SUB_DATA_POINTS_WITH_GUESSES,\n} from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface DataSiloAttributeValue {\n /** Key associated to value */\n attributeKey: {\n /** Name of key */\n name: string;\n };\n /** Name of value */\n name: string;\n}\nexport interface DataSilo {\n /** ID of dataSilo */\n id: string;\n /** Title of dataSilo */\n title: string;\n /** Type of silo */\n type: string;\n /** The link to the data silo */\n link: string;\n /** Attribute labels */\n attributeValues: DataSiloAttributeValue[];\n /** description */\n description: string;\n /** Metadata for this data silo */\n catalog: {\n /** Whether the data silo supports automated vendor coordination */\n hasAvcFunctionality: boolean;\n };\n}\n\nconst BATCH_SILOS_LIMIT = 20;\n\n/**\n * Fetch all dataSilos in the organization\n *\n * @param client - GraphQL client\n * @param title - Filter by title\n * @returns All dataSilos in the organization\n */\nexport async function fetchAllDataSilos<TDataSilo extends DataSilo>(\n client: GraphQLClient,\n {\n titles,\n pageSize,\n ids = [],\n gql = DATA_SILOS,\n integrationNames = [],\n }: {\n /** Page size to fetch datapoints in */\n pageSize: number;\n /** Title */\n titles?: string[];\n /** IDs */\n ids?: string[];\n /** Set of integration names to fetch */\n integrationNames?: string[];\n /** GQL query for data silos */\n gql?: string;\n },\n): Promise<TDataSilo[]> {\n logger.info(colors.magenta(`Fetching ${ids.length === 0 ? 'all' : ids.length} Data Silos...`));\n\n const dataSilos: TDataSilo[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: TDataSilo[];\n };\n }>(client, gql, {\n filterBy: {\n ids: ids.length > 0 ? ids : undefined,\n type: integrationNames.length > 0 ? integrationNames : undefined,\n titles,\n },\n first: pageSize,\n offset,\n });\n dataSilos.push(...nodes);\n offset += pageSize;\n shouldContinue = nodes.length === pageSize;\n } while (shouldContinue);\n logger.info(\n colors.green(\n `Found a total of ${dataSilos.length} data silo${\n ids.length > 0 ? ` matching IDs ${ids.join(',')}` : ''\n }s${\n integrationNames.length > 0\n ? ` matching integrationNames ${integrationNames.join(',')}`\n : ''\n }`,\n ),\n );\n\n return dataSilos.sort((a, b) => a.title.localeCompare(b.title));\n}\n\nexport interface SubDataPoint {\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /**\n * When true, this subdatapoint should be revealed in a data access request.\n * When false, this field should be redacted\n */\n accessRequestVisibilityEnabled: boolean;\n /**\n * When true, this subdatapoint should be redacted during an erasure request.\n * There normally is a choice of enabling hard deletion or redaction at the\n * datapoint level, but if redaction is enabled, this column can be used\n * to define which fields should be redacted.\n */\n erasureRequestRedactionEnabled: boolean;\n /** Attribute attached to subdatapoint */\n attributeValues: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** Confidence level of guess */\n confidence: number;\n /** Confidence label */\n confidenceLabel: ConfidenceLabel;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\ninterface DataPoint {\n /** ID of dataPoint */\n id: string;\n /** Title of dataPoint */\n title: {\n /** Default message */\n defaultMessage: string;\n };\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n /** Global actions */\n actionSettings: {\n /** Action type */\n type: RequestActionObjectResolver;\n /** Is enabled */\n active: boolean;\n }[];\n /** Data collection tag for privacy request download zip labeling */\n dataCollection?: {\n /** Title of data collection */\n title: {\n /** Default message (since message can be translated) */\n defaultMessage: string;\n };\n };\n /** Metadata for this data silo */\n catalog: {\n /** Whether the data silo supports automated vendor coordination */\n hasAvcFunctionality: boolean;\n };\n /** Owners of the datapoint */\n owners: {\n /** Email address of the owner */\n email: string;\n }[];\n /** Teams that own the datapoint */\n teams: {\n /** Name of the team */\n name: string;\n }[];\n /** Database integration queries */\n dbIntegrationQueries: {\n /** Approved query */\n query: string | null;\n /** Suggested query */\n suggestedQuery: string | null;\n /** Request action */\n requestType: RequestActionObjectResolver;\n }[];\n}\n\ninterface DataPointWithSubDataPoint extends DataPoint {\n /** The associated subdatapoints */\n subDataPoints: SubDataPoint[];\n}\n\n/**\n * Helper to fetch all subdatapoints for a given datapoint\n *\n * @param client - The GraphQL client\n * @param dataPointId - The datapoint ID\n * @param options - Options\n * @returns The list of subdatapoints\n */\nexport async function fetchAllSubDataPoints(\n client: GraphQLClient,\n dataPointId: string,\n {\n debug,\n includeGuessedCategories,\n pageSize,\n }: {\n /** Debug logs */\n debug: boolean;\n /** Page size */\n pageSize: number;\n /** When true, metadata around guessed data categories should be included */\n includeGuessedCategories?: boolean;\n },\n): Promise<SubDataPoint[]> {\n const subDataPoints: SubDataPoint[] = [];\n\n let offset = 0;\n\n let shouldContinue = false;\n do {\n try {\n if (debug) {\n logger.log(colors.magenta(`Pulling in subdatapoints for offset ${offset}`));\n }\n const {\n subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPoint[];\n };\n }>(client, includeGuessedCategories ? SUB_DATA_POINTS_WITH_GUESSES : SUB_DATA_POINTS, {\n first: pageSize,\n filterBy: {\n dataPoints: [dataPointId],\n },\n offset,\n });\n\n subDataPoints.push(...nodes);\n offset += pageSize;\n shouldContinue = nodes.length === pageSize;\n\n if (debug) {\n logger.log(\n colors.green(\n `Pulled in subdatapoints for offset ${offset} for dataPointId=${dataPointId}`,\n ),\n );\n }\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for offset ${offset} for dataPointId=${dataPointId}`,\n ),\n );\n throw err;\n }\n } while (shouldContinue);\n return sortBy(subDataPoints, 'name');\n}\n\n/**\n * Fetch all datapoints for a data silo\n *\n * @param client - GraphQL client\n * @param dataSiloId - Data silo ID\n * @param options - Options\n * @returns List of datapoints\n */\nexport async function fetchAllDataPoints(\n client: GraphQLClient,\n dataSiloId: string,\n {\n debug,\n pageSize,\n skipSubDatapoints,\n includeGuessedCategories,\n }: {\n /** Debug logs */\n debug: boolean;\n /** Page size */\n pageSize: number;\n /** Skip fetching of subdatapoints */\n skipSubDatapoints?: boolean;\n /** When true, metadata around guessed data categories should be included */\n includeGuessedCategories?: boolean;\n },\n): Promise<DataPointWithSubDataPoint[]> {\n const dataPoints: DataPointWithSubDataPoint[] = [];\n\n // TODO: https://transcend.height.app/T-40481 - add cursor pagination\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n if (debug) {\n logger.info(colors.magenta(`Fetching datapoints with offset: ${offset}`));\n }\n\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPoint[];\n };\n }>(client, DATA_POINTS, {\n first: pageSize,\n filterBy: {\n dataSilos: [dataSiloId],\n },\n offset,\n });\n\n if (debug) {\n logger.info(colors.magenta(`Fetched ${nodes.length} datapoints at offset: ${offset}`));\n }\n\n if (!skipSubDatapoints) {\n await map(\n nodes,\n /* eslint-disable no-loop-func */\n async (node) => {\n try {\n if (debug) {\n logger.info(\n colors.magenta(\n `Fetching subdatapoints for ${node.name} for datapoint offset ${offset}`,\n ),\n );\n }\n\n const subDataPoints = await fetchAllSubDataPoints(client, node.id, {\n pageSize: 1000, // max page size\n debug,\n includeGuessedCategories,\n });\n dataPoints.push({\n ...node,\n subDataPoints: subDataPoints.sort((a, b) => a.name.localeCompare(b.name)),\n });\n\n if (debug) {\n logger.info(colors.green(`Successfully fetched subdatapoints for ${node.name}`));\n }\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for ${node.name} datapoint offset ${offset}`,\n ),\n );\n throw err;\n }\n },\n /* eslint-enable no-loop-func */\n {\n concurrency: 5,\n },\n );\n\n if (debug) {\n logger.info(\n colors.green(`Fetched all subdatapoints for page of datapoints at offset: ${offset}`),\n );\n }\n }\n\n offset += pageSize;\n shouldContinue = nodes.length === pageSize;\n } while (shouldContinue);\n return dataPoints.sort((a, b) => a.name.localeCompare(b.name));\n}\n\nexport interface DataSiloEnriched {\n /** ID of dataSilo */\n id: string;\n /** Title of dataSilo */\n title: string;\n /** Type of silo */\n type: string;\n /** Link to silo */\n link: string;\n /** Outer type of silo */\n outerType: string;\n /** Description of data silo */\n description: string;\n /** Webhook URL */\n url?: string;\n /** Email address of user to notify for prompt a person use case */\n notifyEmailAddress?: string;\n /** Associated API keys */\n apiKeys: {\n /** Title */\n title: string;\n }[];\n /** Data subject block list */\n subjectBlocklist: {\n /** Type of data subject */\n type: string;\n }[];\n /** Identifiers */\n identifiers: {\n /** Name of identifier */\n name: string;\n /** True if identifier is wired */\n isConnected: boolean;\n }[];\n /** Dependent data silos */\n dependentDataSilos: {\n /** Title of silo */\n title: string;\n }[];\n /** Silo owners */\n owners: {\n /** Email owners */\n email: string;\n }[];\n /** The teams assigned to this data silo */\n teams: {\n /** Name of the team assigned to this data silo */\n name: string;\n }[];\n /** Metadata for this data silo */\n catalog: {\n /** Whether the data silo supports automated vendor coordination */\n hasAvcFunctionality: boolean;\n };\n /** Silo is live */\n isLive: boolean;\n /** Hosting country of data silo */\n country?: IsoCountryCode;\n /** Hosting subdivision data silo */\n countrySubDivision?: IsoCountrySubdivisionCode;\n /**\n * The frequency with which we should be sending emails for this data silo, in milliseconds.\n */\n promptAVendorEmailSendFrequency: number;\n /**\n * The type of emails to send for this data silo, i.e. send an email for each DSR, across all open DSRs,\n * or per profile in a DSR.\n */\n promptAVendorEmailSendType: PromptAVendorEmailSendType;\n /**\n * Indicates whether prompt-a-vendor emails should include a list of identifiers\n * in addition to a link to the bulk processing UI.\n */\n promptAVendorEmailIncludeIdentifiersAttachment: boolean;\n /**\n * Indicates what kind of link to generate as part of the emails sent out for this Prompt-a-Vendor silo.\n */\n promptAVendorEmailCompletionLinkType: PromptAVendorEmailCompletionLinkType;\n /**\n * The frequency with which we should retry sending emails for this data silo, in milliseconds.\n * Needs to be a string because the number can be larger than the MAX_INT\n */\n manualWorkRetryFrequency: string;\n /** Attribute values tagged to data silo */\n attributeValues: DataSiloAttributeValue[];\n /**\n * The data silos that discovered this particular data silo\n */\n discoveredBy: {\n /** Title of data silo */\n title: string;\n }[];\n /**\n * The business entities assigned directly to this data silo\n */\n businessEntities: {\n /** Title of business entity */\n title: string;\n }[];\n}\n\n/**\n * Fetch all dataSilos with additional metadata\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns All dataSilos in the organization\n */\nexport async function fetchEnrichedDataSilos(\n client: GraphQLClient,\n {\n ids,\n pageSize,\n titles,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n integrationNames,\n }: {\n /** Page size */\n pageSize: number;\n /** Filter by IDs */\n ids?: string[];\n /** Enable debug logs */\n debug: boolean;\n /** Filter by title */\n titles?: string[];\n /** Integration names */\n integrationNames?: string[];\n /** Skip fetching of datapoints */\n skipDatapoints?: boolean;\n /** Skip fetching of subdatapoints */\n skipSubDatapoints?: boolean;\n /** When true, metadata around guessed data categories should be included */\n includeGuessedCategories?: boolean;\n },\n): Promise<[DataSiloEnriched, DataPointWithSubDataPoint[]][]> {\n const dataSilos: [DataSiloEnriched, DataPointWithSubDataPoint[]][] = [];\n\n // Grab silos\n const silos = await fetchAllDataSilos<DataSiloEnriched>(client, {\n titles,\n ids,\n integrationNames,\n pageSize,\n gql: DATA_SILOS_ENRICHED,\n });\n\n // Graph datapoints for each silo\n if (!skipDatapoints) {\n await mapSeries(silos, async (silo, index) => {\n logger.info(\n colors.magenta(`[${index + 1}/${silos.length}] Fetching data silo - ${silo.title}`),\n );\n\n const dataPoints = await fetchAllDataPoints(client, silo.id, {\n debug,\n pageSize,\n skipSubDatapoints,\n includeGuessedCategories,\n });\n\n if (debug) {\n logger.info(\n colors.green(\n `[${index + 1}/${silos.length}] Successfully fetched datapoint for - ${silo.title}`,\n ),\n );\n }\n\n dataSilos.push([silo, dataPoints]);\n });\n }\n\n logger.info(colors.green(`Successfully fetched all ${silos.length} data silo configurations`));\n\n return dataSilos;\n}\n\n/**\n * Sync a data silo configuration\n *\n * @param dataSilos - Data silos to sync\n * @param client - GraphQL client\n * @param options - Options\n * @returns Data silo info\n */\nexport async function syncDataSilos(\n dataSilos: DataSiloInput[],\n client: GraphQLClient,\n {\n pageSize,\n dataSubjectsByName,\n apiKeysByTitle,\n }: {\n /** Page size */\n pageSize: number;\n /** The data subjects in the organization */\n dataSubjectsByName: { [type in string]: DataSubject };\n /** API key title to API key */\n apiKeysByTitle: { [title in string]: ApiKey };\n },\n): Promise<{\n /** Whether successfully updated */\n success: boolean;\n /** A mapping between data silo title to data silo ID */\n dataSiloTitleToId: { [k in string]: string };\n}> {\n let encounteredError = false;\n\n // Time duration\n const t0 = new Date().getTime();\n logger.info(colors.magenta(`Syncing \"${dataSilos.length}\" data silos...`));\n\n // Determine the set of data silos that already exist\n const existingDataSilos = await fetchAllDataSilos(client, {\n titles: dataSilos.map(({ title }) => title),\n pageSize,\n });\n\n // Create a mapping of title -> existing silo, if it exists\n const existingDataSiloByTitle = keyBy<Pick<DataSilo, 'id' | 'title'>>(existingDataSilos, 'title');\n\n // Create new silos that do not exist\n const newDataSiloInputs = dataSilos.filter(({ title }) => !existingDataSiloByTitle[title]);\n if (newDataSiloInputs.length > 0) {\n logger.info(\n colors.magenta(`Creating \"${newDataSiloInputs.length}\" data silos that did not exist...`),\n );\n\n // Batch the creation\n const chunked = chunk(newDataSiloInputs, BATCH_SILOS_LIMIT);\n await mapSeries(chunked, async (dependencyUpdateChunk) => {\n const {\n createDataSilos: { dataSilos },\n } = await makeGraphQLRequest<{\n /** Mutation result */\n createDataSilos: {\n /** New data silos */\n dataSilos: Pick<DataSilo, 'id' | 'title'>[];\n };\n }>(client, CREATE_DATA_SILOS, {\n input: dependencyUpdateChunk.map((input) => ({\n name: input['outer-type'] || input.integrationName,\n title: input.title,\n country: input.country,\n countrySubDivision: input.countrySubDivision,\n })),\n });\n\n // save mapping of title and id\n dataSilos.forEach((silo) => {\n existingDataSiloByTitle[silo.title] = silo;\n });\n });\n\n logger.info(colors.green(`Successfully created \"${newDataSiloInputs.length}\" data silos!`));\n }\n\n // Batch the updates\n const chunkedUpdates = chunk(dataSilos, BATCH_SILOS_LIMIT);\n await mapSeries(chunkedUpdates, async (dataSiloUpdateChunk, ind) => {\n logger.info(\n colors.magenta(\n `[Batch ${ind + 1}/${chunkedUpdates.length}] Syncing \"${\n dataSiloUpdateChunk.length\n }\" data silos`,\n ),\n );\n await makeGraphQLRequest<{\n /** Mutation result */\n updateDataSilos: {\n /** New data silos */\n dataSilos: Pick<DataSilo, 'id' | 'title'>[];\n };\n }>(client, UPDATE_DATA_SILOS, {\n input: {\n dataSilos: dataSiloUpdateChunk.map((input) => ({\n id: existingDataSiloByTitle[input.title].id,\n country: input.country,\n countrySubDivision: input.countrySubDivision,\n url: input.url,\n headers: input.headers,\n description: input.description,\n identifiers: input['identity-keys'],\n isLive: !input.disabled,\n ownerEmails: input.owners,\n teamNames: input.teams,\n // clear out if not specified, otherwise the update needs to be applied after\n // all data silos are created\n dependedOnDataSiloTitles: input['deletion-dependencies'] ? undefined : [],\n apiKeyId: input['api-key-title'] ? apiKeysByTitle[input['api-key-title']].id : undefined,\n dataSubjectBlockListIds: input['data-subjects']\n ? convertToDataSubjectBlockList(input['data-subjects'], dataSubjectsByName)\n : undefined,\n attributes: input.attributes,\n businessEntityTitles: input.businessEntityTitles,\n // AVC settings\n notifyEmailAddress: input['email-settings']?.['notify-email-address'],\n promptAVendorEmailSendFrequency: input['email-settings']?.['send-frequency'],\n promptAVendorEmailSendType: input['email-settings']?.['send-type'],\n promptAVendorEmailIncludeIdentifiersAttachment:\n input['email-settings']?.['include-identifiers-attachment'],\n promptAVendorEmailCompletionLinkType: input['email-settings']?.['completion-link-type'],\n manualWorkRetryFrequency: input['email-settings']?.['manual-work-retry-frequency'],\n })),\n },\n });\n logger.info(\n colors.green(\n `[Batch ${ind + 1}/${chunkedUpdates.length}] Synced \"${\n dataSiloUpdateChunk.length\n }\" data silos!`,\n ),\n );\n });\n\n // Sync datapoints\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const dataSilosWithDataPoints = dataSilos.filter(({ datapoints = [] }) => datapoints.length > 0);\n const totalDataPoints = dataSilos\n .map(({ datapoints = [] }) => datapoints.length)\n .reduce((acc, count) => acc + count, 0);\n logger.info(\n colors.magenta(\n `Syncing \"${totalDataPoints}\" datapoints from \"${dataSilosWithDataPoints.length}\" data silos...`,\n ),\n );\n progressBar.start(totalDataPoints, 0);\n let total = 0;\n\n await map(\n dataSilosWithDataPoints,\n async ({ datapoints, title }) => {\n if (datapoints) {\n await mapSeries(datapoints, async (datapoint) => {\n const fields = datapoint.fields\n ? datapoint.fields.map(\n ({ key, description, categories, purposes, attributes, ...rest }) =>\n // TODO: Support setting title separately from the 'key/name'\n ({\n name: key,\n description,\n categories: !categories\n ? undefined\n : categories.map((category) => ({\n ...category,\n name: category.name || 'Other',\n })),\n purposes: !purposes\n ? undefined\n : purposes.map((purpose) => ({\n ...purpose,\n name: purpose.name || 'Other',\n })),\n attributes,\n accessRequestVisibilityEnabled: rest['access-request-visibility-enabled'],\n erasureRequestRedactionEnabled: rest['erasure-request-redaction-enabled'],\n }),\n )\n : undefined;\n\n const payload = {\n dataSiloId: existingDataSiloByTitle[title].id,\n path: datapoint.path,\n name: datapoint.key,\n title: datapoint.title,\n description: datapoint.description,\n ...(datapoint.owners\n ? {\n ownerEmails: datapoint.owners,\n }\n : {}),\n ...(datapoint.teams\n ? {\n teamNames: datapoint.teams,\n }\n : {}),\n ...(datapoint['data-collection-tag']\n ? { dataCollectionTag: datapoint['data-collection-tag'] }\n : {}),\n querySuggestions: !datapoint['privacy-action-queries']\n ? undefined\n : Object.entries(datapoint['privacy-action-queries']).map(([key, value]) => ({\n requestType: key,\n suggestedQuery: value,\n })),\n enabledActions: datapoint['privacy-actions'] || [], // clear out when not specified\n subDataPoints: fields,\n };\n\n // Ensure no duplicate sub-datapoints are provided\n const subDataPointsToUpdate = (payload.subDataPoints || []).map(({ name }) => name);\n const duplicateDataPoints = subDataPointsToUpdate.filter(\n (name, index) => subDataPointsToUpdate.indexOf(name) !== index,\n );\n if (duplicateDataPoints.length > 0) {\n logger.info(\n colors.red(\n `\\nCannot update datapoint \"${\n datapoint.key\n }\" as it has duplicate sub-datapoints with the same name: \\n${duplicateDataPoints.join(\n '\\n',\n )}`,\n ),\n );\n encounteredError = true;\n } else {\n try {\n await makeGraphQLRequest(client, UPDATE_OR_CREATE_DATA_POINT, payload);\n } catch (err) {\n logger.info(\n colors.red(\n `\\nFailed to update datapoint \"${datapoint.key}\" for data silo \"${title}\"! - \\n${err.message}`,\n ),\n );\n encounteredError = true;\n }\n }\n total += 1;\n progressBar.update(total);\n });\n }\n },\n {\n concurrency: 10,\n },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Synced \"${dataSilos.length}\" data silos and \"${totalDataPoints}\" datapoints in \"${\n totalTime / 1000\n }\" seconds!`,\n ),\n );\n return {\n success: !encounteredError,\n dataSiloTitleToId: apply(existingDataSiloByTitle, ({ id }) => id),\n };\n}\n\n/**\n * Sync data silo dependencies\n *\n * @param client - GraphQL client\n * @param dependencyUpdates - Mapping from [data silo ID, dependency titles]\n * @returns True upon success\n */\nexport async function syncDataSiloDependencies(\n client: GraphQLClient,\n dependencyUpdates: [string, string[]][],\n): Promise<boolean> {\n let encounteredError = false;\n logger.info(colors.magenta(`Syncing \"${dependencyUpdates.length}\" data silo dependencies...`));\n\n // Batch the updates\n const chunkedUpdates = chunk(dependencyUpdates, BATCH_SILOS_LIMIT);\n await mapSeries(chunkedUpdates, async (dependencyUpdateChunk, ind) => {\n logger.info(\n colors.magenta(\n `[Batch ${ind}/${dependencyUpdateChunk.length}] Updating \"${dependencyUpdateChunk.length}\" data silos...`,\n ),\n );\n try {\n await makeGraphQLRequest<{\n /** Mutation result */\n updateDataSilos: {\n /** New data silos */\n dataSilos: Pick<DataSilo, 'id' | 'title'>[];\n };\n }>(client, UPDATE_DATA_SILOS, {\n input: {\n dataSilos: dependencyUpdateChunk.map(([id, dependedOnDataSiloTitles]) => ({\n id,\n dependedOnDataSiloTitles,\n })),\n },\n });\n logger.info(\n colors.green(\n `[Batch ${ind + 1}/${dependencyUpdateChunk.length}] ` +\n `Synced \"${dependencyUpdateChunk.length}\" data silos!`,\n ),\n );\n } catch (err) {\n encounteredError = true;\n logger.info(\n colors.red(\n `[Batch ${ind + 1}/${dependencyUpdateChunk.length}] ` +\n `Failed to update \"${dependencyUpdateChunk.length}\" silos! - ${err.message}`,\n ),\n );\n }\n });\n return !encounteredError;\n}\n/* eslint-enable max-lines */\n","import {\n EnricherType,\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n PreflightRequestStatus,\n RequestAction,\n} from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { EnricherInput } from '../../codecs.js';\nimport { DataSubject } from './fetchDataSubjects.js';\nimport { Identifier } from './fetchIdentifiers.js';\nimport { ENRICHERS, CREATE_ENRICHER, UPDATE_ENRICHER } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Enricher {\n /** ID of enricher */\n id: string;\n /** Title of enricher */\n title: string;\n /** URL of enricher */\n url: string;\n /** Server silo */\n type: EnricherType;\n /** Input identifier */\n inputIdentifier: {\n /** Identifier name */\n name: string;\n };\n /** The selected actions */\n actions: RequestAction[];\n /** Output identifiers */\n identifiers: {\n /** Identifier name */\n name: string;\n }[];\n /** Data subjects that the preflight check is configured for */\n dataSubjects: {\n /** Data subject type */\n type: string;\n }[];\n /** The duration (in ms) that the enricher should take to execute. - BigInt */\n expirationDuration: string;\n /** Looker query title */\n lookerQueryTitle?: string;\n /** A regular expression that can be used to match on for cancelation */\n testRegex?: string;\n /** The status that the enricher should transfer to when condition is met. */\n transitionRequestStatus?: PreflightRequestStatus;\n /** The twilio phone number to send from */\n phoneNumbers: string[];\n /**\n * The list of regions that should trigger the enrichment condition\n */\n regionList: (IsoCountryCode | IsoCountrySubdivisionCode)[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all enrichers in the organization\n *\n * @param client - GraphQL client\n * @param title - Filter by title\n * @returns All enrichers in the organization\n */\nexport async function fetchAllEnrichers(\n client: GraphQLClient,\n title?: string,\n): Promise<Enricher[]> {\n const enrichers: Enricher[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n enrichers: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n enrichers: {\n /** List of matches */\n nodes: Enricher[];\n };\n }>(client, ENRICHERS, {\n first: PAGE_SIZE,\n offset,\n title,\n });\n enrichers.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return enrichers.sort((a, b) => a.title.localeCompare(b.title));\n}\n\n/**\n * Sync an enricher configuration\n *\n * @param client - GraphQL client\n * @param options - Options\n */\nexport async function syncEnricher(\n client: GraphQLClient,\n {\n enricher,\n identifierByName,\n dataSubjectsByName,\n }: {\n /** The enricher input */\n enricher: EnricherInput;\n /** Index of identifiers in the organization */\n identifierByName: { [name in string]: Identifier };\n /** Lookup data subject by name */\n dataSubjectsByName: { [name in string]: DataSubject };\n },\n): Promise<void> {\n // Whether to continue looping\n const matches = await fetchAllEnrichers(client, enricher.title);\n const existingEnricher = matches.find(({ title }) => title === enricher.title);\n\n // Map to data subject Ids\n const dataSubjectIds = enricher['data-subjects']?.map((subject) => {\n const existing = dataSubjectsByName[subject];\n if (!existing) {\n throw new Error(`Failed to find a data subject with name: ${subject}`);\n }\n return existing.id;\n });\n\n // If enricher exists, update it, else create new\n const inputIdentifier = enricher['input-identifier'];\n const actionUpdates = enricher['privacy-actions'] || Object.values(RequestAction);\n if (existingEnricher) {\n await makeGraphQLRequest(client, UPDATE_ENRICHER, {\n input: {\n id: existingEnricher.id,\n title: enricher.title,\n url: enricher.url,\n headers: enricher.headers,\n testRegex: enricher.testRegex,\n lookerQueryTitle: enricher.lookerQueryTitle,\n expirationDuration:\n typeof enricher.expirationDuration === 'number'\n ? enricher.expirationDuration.toString()\n : undefined,\n transitionRequestStatus: enricher.transitionRequestStatus,\n phoneNumbers: enricher.phoneNumbers,\n regionList: enricher.regionList,\n dataSubjectIds,\n description: enricher.description || '',\n inputIdentifier: inputIdentifier ? identifierByName[inputIdentifier].id : undefined,\n identifiers: enricher['output-identifiers'].map((id) => identifierByName[id].id),\n ...(existingEnricher.type === EnricherType.Sombra ? {} : { actions: actionUpdates }),\n },\n });\n } else if (inputIdentifier) {\n await makeGraphQLRequest(client, CREATE_ENRICHER, {\n input: {\n title: enricher.title,\n url: enricher.url,\n type: enricher.type || EnricherType.Server,\n headers: enricher.headers,\n testRegex: enricher.testRegex,\n lookerQueryTitle: enricher.lookerQueryTitle,\n expirationDuration:\n typeof enricher.expirationDuration === 'number'\n ? enricher.expirationDuration.toString()\n : undefined,\n transitionRequestStatus: enricher.transitionRequestStatus,\n phoneNumbers: enricher.phoneNumbers,\n dataSubjectIds,\n regionList: enricher.regionList,\n description: enricher.description || '',\n inputIdentifier: identifierByName[inputIdentifier].id,\n identifiers: enricher['output-identifiers'].map((id) => identifierByName[id].id),\n actions: actionUpdates,\n },\n });\n }\n}\n","import colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport { difference } from 'lodash-es';\n\nimport { PartitionInput } from '../../codecs.js';\nimport { logger } from '../../logger.js';\nimport { mapSeries } from '../bluebird.js';\nimport { fetchConsentManagerId } from './fetchConsentManagerId.js';\nimport { CREATE_CONSENT_PARTITION, CONSENT_PARTITIONS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nconst PAGE_SIZE = 50;\n\nexport interface TranscendPartition {\n /** ID of the partition */\n id: string;\n /** Name of partition */\n name: string;\n /** Partition value */\n partition: string;\n}\n\n/**\n * Fetch the list of partitions\n *\n * @param client - GraphQL client\n * @returns Partition list\n */\nexport async function fetchPartitions(client: GraphQLClient): Promise<TranscendPartition[]> {\n const partitions: TranscendPartition[] = [];\n let offset = 0;\n\n // Fetch all partitions\n let shouldContinue = false;\n do {\n const {\n consentPartitions: { nodes },\n } = await makeGraphQLRequest<{\n /** Consent experience */\n consentPartitions: {\n /** List */\n nodes: TranscendPartition[];\n };\n }>(client, CONSENT_PARTITIONS, {\n first: PAGE_SIZE,\n offset,\n });\n partitions.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return partitions.sort((a, b) => a.name.localeCompare(b.name));\n}\n\n/**\n * Sync the consent manager\n *\n * @param client - GraphQL client\n * @param partitionInputs - The partition input\n *@returns true on success\n */\nexport async function syncPartitions(\n client: GraphQLClient,\n partitionInputs: PartitionInput[],\n): Promise<boolean> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client);\n let encounteredError = false;\n const partitions = await fetchPartitions(client);\n const newPartitionNames = difference(\n partitionInputs.map(({ name }) => name),\n partitions.map(({ name }) => name),\n );\n await mapSeries(newPartitionNames, async (name) => {\n try {\n await makeGraphQLRequest(client, CREATE_CONSENT_PARTITION, {\n input: {\n id: airgapBundleId,\n name,\n },\n });\n logger.info(colors.green(`Successfully created consent partition: ${name}!`));\n } catch (err) {\n logger.error(colors.red(`Failed to create consent partition: ${name}! - ${err.message}`));\n encounteredError = true;\n }\n });\n return !encounteredError;\n}\n","import {\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n RegionDetectionMethod,\n RequestAction,\n} from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { ACTIONS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Action {\n /** ID of identifier */\n id: string;\n /** Type of action */\n type: RequestAction;\n /** Whether to skip secondary when no files exist */\n skipSecondaryIfNoFiles: boolean;\n /** Whether to skip downloadable step */\n skipDownloadableStep: boolean;\n /** Whether action requires review */\n requiresReview: boolean;\n /** Waiting period for action */\n waitingPeriod: number;\n /** Method in which the data subject's region is detected */\n regionDetectionMethod: RegionDetectionMethod;\n /** The list of regions to show in the form */\n regionList: (IsoCountryCode | IsoCountrySubdivisionCode)[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all actions in the organization\n *\n * @param client - GraphQL client\n * @returns All actions in the organization\n */\nexport async function fetchAllActions(client: GraphQLClient): Promise<Action[]> {\n const actions: Action[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n actions: { nodes },\n } = await makeGraphQLRequest<{\n /** Actions */\n actions: {\n /** List */\n nodes: Action[];\n };\n }>(client, ACTIONS, {\n first: PAGE_SIZE,\n offset,\n });\n actions.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return actions.sort((a, b)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AM,EAAE,KAAK,cAAc,EAAE,KAAK,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,m as t}from"./fetchConsentManagerId-CFkg3-RS.mjs";import{t as n}from"./makeGraphQLRequest-Cq26A_Lq.mjs";import{ConsentTrackerStatus as r}from"@transcend-io/privacy-types";async function i(i,a=r.Live){let o=[],s=0,c=await e(i),l=!1;do{let{dataFlows:{nodes:e}}=await n(i,t,{first:20,offset:s,airgapBundleId:c,status:a,...a===r.NeedsReview?{showZeroActivity:!0}:{}});o.push(...e),s+=20,l=e.length===20}while(l);return o.sort((e,t)=>e.value.localeCompare(t.value))}export{i as t};
|
|
2
|
-
//# sourceMappingURL=fetchAllDataFlows-D248lO6_.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllDataFlows-D248lO6_.mjs","names":[],"sources":["../src/lib/graphql/fetchAllDataFlows.ts"],"sourcesContent":["import {\n DataFlowScope,\n ConsentTrackerSource,\n ConsentTrackerStatus,\n} from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { fetchConsentManagerId } from './fetchConsentManagerId.js';\nimport { DATA_FLOWS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface DataFlow {\n /** ID of data flow */\n id: string;\n /** Value of data flow */\n value: string;\n /** Type of data flow */\n type: DataFlowScope;\n /** Description of data flow */\n description: string;\n /** Enabled tracking purposes */\n trackingType: string[];\n /** The consent service */\n service: {\n /** Integration name of service */\n integrationName: string;\n };\n /** Source of how tracker was added */\n source: ConsentTrackerSource;\n /** Status of data flow labeling */\n status: ConsentTrackerStatus;\n /** Owners of that data flow */\n owners: {\n /** Email address of owner */\n email: string;\n }[];\n /** Teams assigned to that data flow */\n teams: {\n /** Name of team */\n name: string;\n }[];\n /** Attributes assigned to that data flow */\n attributeValues: {\n /** Name of attribute value */\n name: string;\n /** Attribute key that the value represents */\n attributeKey: {\n /** Name of attribute team */\n name: string;\n };\n }[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all DataFlows in the organization\n *\n * @param client - GraphQL client\n * @param status - The status to fetch\n * @returns All DataFlows in the organization\n */\nexport async function fetchAllDataFlows(\n client: GraphQLClient,\n status = ConsentTrackerStatus.Live,\n): Promise<DataFlow[]> {\n const dataFlows: DataFlow[] = [];\n let offset = 0;\n\n const airgapBundleId = await fetchConsentManagerId(client);\n\n // Try to fetch an DataFlow with the same title\n let shouldContinue = false;\n do {\n const {\n dataFlows: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataFlows: {\n /** List of matches */\n nodes: DataFlow[];\n };\n }>(client, DATA_FLOWS, {\n first: PAGE_SIZE,\n offset,\n airgapBundleId,\n status,\n ...(status === ConsentTrackerStatus.NeedsReview ? { showZeroActivity: true } : {}),\n });\n dataFlows.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return dataFlows.sort((a, b) => a.value.localeCompare(b.value));\n}\n"],"mappings":"yLA8DA,eAAsB,EACpB,EACA,EAAS,EAAqB,KACT,CACrB,IAAM,EAAwB,EAAE,CAC5B,EAAS,EAEP,EAAiB,MAAM,EAAsB,EAAO,CAGtD,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,UAAW,CAAE,UACX,MAAM,EAMP,EAAQ,EAAY,CACrB,MAAO,GACP,SACA,iBACA,SACA,GAAI,IAAW,EAAqB,YAAc,CAAE,iBAAkB,GAAM,CAAG,EAAE,CAClF,CAAC,CACF,EAAU,KAAK,GAAG,EAAM,CACxB,GAAU,GACV,EAAiB,EAAM,SAAW,SAC3B,GAET,OAAO,EAAU,MAAM,EAAG,IAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./makeGraphQLRequest-Cq26A_Lq.mjs";import{gql as t}from"graphql-request";const n=t`
|
|
2
|
-
query TranscendCliPreferenceTopics(
|
|
3
|
-
$first: Int!
|
|
4
|
-
$offset: Int!
|
|
5
|
-
$filterBy: PreferenceTopicFilterInput
|
|
6
|
-
) {
|
|
7
|
-
preferenceTopics(first: $first, offset: $offset, filterBy: $filterBy) {
|
|
8
|
-
nodes {
|
|
9
|
-
id
|
|
10
|
-
slug
|
|
11
|
-
type
|
|
12
|
-
title {
|
|
13
|
-
id
|
|
14
|
-
defaultMessage
|
|
15
|
-
}
|
|
16
|
-
showInPrivacyCenter
|
|
17
|
-
displayDescription {
|
|
18
|
-
id
|
|
19
|
-
defaultMessage
|
|
20
|
-
}
|
|
21
|
-
defaultConfiguration
|
|
22
|
-
preferenceOptionValues {
|
|
23
|
-
slug
|
|
24
|
-
title {
|
|
25
|
-
id
|
|
26
|
-
defaultMessage
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
purpose {
|
|
30
|
-
trackingType
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;async function r(t){let r=[],i=0,a=!1;do{let{preferenceTopics:{nodes:o}}=await e(t,n,{first:20,offset:i});r.push(...o),i+=20,a=o.length===20}while(a);return r.sort((e,t)=>`${e.slug}:${e.purpose.trackingType}`.localeCompare(`${t.slug}:${t.purpose.trackingType}`))}export{n,r as t};
|
|
36
|
-
//# sourceMappingURL=fetchAllPreferenceTopics-ForE9GpZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllPreferenceTopics-ForE9GpZ.mjs","names":[],"sources":["../src/lib/graphql/gqls/preferenceTopic.ts","../src/lib/graphql/fetchAllPreferenceTopics.ts"],"sourcesContent":["import { gql } from 'graphql-request';\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 PREFERENCE_TOPICS = gql`\n query TranscendCliPreferenceTopics(\n $first: Int!\n $offset: Int!\n $filterBy: PreferenceTopicFilterInput\n ) {\n preferenceTopics(first: $first, offset: $offset, filterBy: $filterBy) {\n nodes {\n id\n slug\n type\n title {\n id\n defaultMessage\n }\n showInPrivacyCenter\n displayDescription {\n id\n defaultMessage\n }\n defaultConfiguration\n preferenceOptionValues {\n slug\n title {\n id\n defaultMessage\n }\n }\n purpose {\n trackingType\n }\n }\n }\n }\n`;\n","import { PreferenceTopicType } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { PREFERENCE_TOPICS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface PreferenceTopic {\n /** ID of preference topic */\n id: string;\n /** Slug of preference topic */\n slug: string;\n /** Title of topic */\n title: {\n /** ID */\n id: string;\n /** Default message */\n defaultMessage: string;\n };\n /** Whether to show in privacy center */\n showInPrivacyCenter: boolean;\n /** Description to display in privacy center */\n displayDescription: {\n /** ID */\n id: string;\n /** Default message */\n defaultMessage: string;\n };\n /** Type of preference topic */\n type: PreferenceTopicType;\n /** Default configuration */\n defaultConfiguration: string;\n /** Option values */\n preferenceOptionValues: {\n /** Slug of value */\n slug: string;\n /** Title of value */\n title: {\n /** ID */\n id: string;\n /** Default message */\n defaultMessage: string;\n };\n }[];\n /** Related purpose */\n purpose: {\n /** Slug */\n trackingType: string;\n };\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all preference topics in the organization\n *\n * @param client - GraphQL client\n * @returns All preference topics in the organization\n */\nexport async function fetchAllPreferenceTopics(client: GraphQLClient): Promise<PreferenceTopic[]> {\n const preferenceTopics: PreferenceTopic[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n preferenceTopics: { nodes },\n } = await makeGraphQLRequest<{\n /** Preference topics */\n preferenceTopics: {\n /** List */\n nodes: PreferenceTopic[];\n };\n }>(client, PREFERENCE_TOPICS, {\n first: PAGE_SIZE,\n offset,\n });\n preferenceTopics.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return preferenceTopics.sort((a, b) =>\n `${a.slug}:${a.purpose.trackingType}`.localeCompare(`${b.slug}:${b.purpose.trackingType}`),\n );\n}\n"],"mappings":"4FASA,MAAa,EAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECiDpC,eAAsB,EAAyB,EAAmD,CAChG,IAAM,EAAsC,EAAE,CAC1C,EAAS,EAGT,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,iBAAkB,CAAE,UAClB,MAAM,EAMP,EAAQ,EAAmB,CAC5B,MAAO,GACP,SACD,CAAC,CACF,EAAiB,KAAK,GAAG,EAAM,CAC/B,GAAU,GACV,EAAiB,EAAM,SAAW,SAC3B,GAET,OAAO,EAAiB,MAAM,EAAG,IAC/B,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,eAAe,cAAc,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,eAAe,CAC3F"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./makeGraphQLRequest-Cq26A_Lq.mjs";import{gql as t}from"graphql-request";const n=t`
|
|
2
|
-
query TranscendCliPurposes(
|
|
3
|
-
$first: Int!
|
|
4
|
-
$offset: Int!
|
|
5
|
-
$filterBy: TrackingPurposeFiltersInput
|
|
6
|
-
$input: TrackingPurposeInput!
|
|
7
|
-
) {
|
|
8
|
-
purposes(first: $first, offset: $offset, filterBy: $filterBy, input: $input) {
|
|
9
|
-
nodes {
|
|
10
|
-
id
|
|
11
|
-
name
|
|
12
|
-
description
|
|
13
|
-
defaultConsent
|
|
14
|
-
trackingType
|
|
15
|
-
configurable
|
|
16
|
-
essential
|
|
17
|
-
showInConsentManager
|
|
18
|
-
isActive
|
|
19
|
-
displayOrder
|
|
20
|
-
optOutSignals
|
|
21
|
-
deletedAt
|
|
22
|
-
authLevel
|
|
23
|
-
showInPrivacyCenter
|
|
24
|
-
title
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;async function r(t,{includeDeleted:r=!1}={}){let i=[],a=0,o=!1;do{let{purposes:{nodes:s}}=await e(t,n,{first:20,offset:a,input:{includeDeleted:r}});i.push(...s),a+=20,o=s.length===20}while(o);return i.sort((e,t)=>e.trackingType.localeCompare(t.trackingType))}export{n,r as t};
|
|
29
|
-
//# sourceMappingURL=fetchAllPurposes-ZdkO2fMp.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllPurposes-ZdkO2fMp.mjs","names":[],"sources":["../src/lib/graphql/gqls/purpose.ts","../src/lib/graphql/fetchAllPurposes.ts"],"sourcesContent":["import { gql } from 'graphql-request';\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 PURPOSES = gql`\n query TranscendCliPurposes(\n $first: Int!\n $offset: Int!\n $filterBy: TrackingPurposeFiltersInput\n $input: TrackingPurposeInput!\n ) {\n purposes(first: $first, offset: $offset, filterBy: $filterBy, input: $input) {\n nodes {\n id\n name\n description\n defaultConsent\n trackingType\n configurable\n essential\n showInConsentManager\n isActive\n displayOrder\n optOutSignals\n deletedAt\n authLevel\n showInPrivacyCenter\n title\n }\n }\n }\n`;\n","import { UserPrivacySignalEnum } from '@transcend-io/airgap.js-types';\nimport { DefaultConsentOption, PreferenceStoreAuthLevel } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { PURPOSES } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface Purpose {\n /** ID of purpose */\n id: string;\n /** Name of purpose */\n name: string;\n /** Description of purpose */\n description: string;\n /** Default consent status */\n defaultConsent: DefaultConsentOption;\n /** Slug of purpose */\n trackingType: string;\n /** Whether the purpose is configurable */\n configurable: boolean;\n /** Whether the purpose is essential */\n essential: boolean;\n /** Whether to show the purpose in the consent manager */\n showInConsentManager: boolean;\n /** Whether the purpose is active */\n isActive: boolean;\n /** Display order of the purpose */\n displayOrder: number;\n /** Opt-out signals for the purpose */\n optOutSignals: UserPrivacySignalEnum[];\n /** Whether the purpose is deleted */\n deletedAt?: string;\n /** Authorization level required for the purpose */\n authLevel: PreferenceStoreAuthLevel;\n /** Whether to show the purpose in the privacy center */\n showInPrivacyCenter: boolean;\n /** Title of the purpose */\n title: string;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all purposes in the organization\n *\n * @param client - GraphQL client\n * @param input - Input\n * @returns All purposes in the organization\n */\nexport async function fetchAllPurposes(\n client: GraphQLClient,\n {\n includeDeleted = false,\n }: {\n /** Whether to include deleted purposes */\n includeDeleted?: boolean;\n } = {},\n): Promise<Purpose[]> {\n const purposes: Purpose[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n purposes: { nodes },\n } = await makeGraphQLRequest<{\n /** Purposes */\n purposes: {\n /** List */\n nodes: Purpose[];\n };\n }>(client, PURPOSES, {\n first: PAGE_SIZE,\n offset,\n input: {\n includeDeleted,\n },\n });\n purposes.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return purposes.sort((a, b) => a.trackingType.localeCompare(b.trackingType));\n}\n"],"mappings":"4FASA,MAAa,EAAW,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;ECwC3B,eAAsB,EACpB,EACA,CACE,iBAAiB,IAIf,EAAE,CACc,CACpB,IAAM,EAAsB,EAAE,CAC1B,EAAS,EAGT,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,SAAU,CAAE,UACV,MAAM,EAMP,EAAQ,EAAU,CACnB,MAAO,GACP,SACA,MAAO,CACL,iBACD,CACF,CAAC,CACF,EAAS,KAAK,GAAG,EAAM,CACvB,GAAU,GACV,EAAiB,EAAM,SAAW,SAC3B,GAET,OAAO,EAAS,MAAM,EAAG,IAAM,EAAE,aAAa,cAAc,EAAE,aAAa,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./fetchAllPurposes-ZdkO2fMp.mjs";import{t}from"./fetchAllPreferenceTopics-ForE9GpZ.mjs";async function n(n){let[r,i]=await Promise.all([e(n),t(n)]);return r.map(e=>{let t=i.filter(t=>t.purpose.trackingType===e.trackingType);return{...e,topics:t}})}export{n as t};
|
|
2
|
-
//# sourceMappingURL=fetchAllPurposesAndPreferences-DD6OyA5t.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllPurposesAndPreferences-DD6OyA5t.mjs","names":[],"sources":["../src/lib/graphql/fetchAllPurposesAndPreferences.ts"],"sourcesContent":["import { GraphQLClient } from 'graphql-request';\n\nimport { PreferenceTopic, fetchAllPreferenceTopics } from './fetchAllPreferenceTopics.js';\nimport { Purpose, fetchAllPurposes } from './fetchAllPurposes.js';\n\nexport interface PurposeWithPreferences extends Purpose {\n /** Topics */\n topics: PreferenceTopic[];\n}\n\n/**\n * Fetch all purposes and preferences for a request]\n *\n * @param client - GraphQL client\n * @returns List of request enrichers\n */\nexport async function fetchAllPurposesAndPreferences(\n client: GraphQLClient,\n): Promise<PurposeWithPreferences[]> {\n const [purposes, topics] = await Promise.all([\n fetchAllPurposes(client),\n fetchAllPreferenceTopics(client),\n ]);\n\n return purposes.map((purpose) => {\n const purposeTopics = topics.filter(\n (topic) => topic.purpose.trackingType === purpose.trackingType,\n );\n return {\n ...purpose,\n topics: purposeTopics,\n };\n });\n}\n"],"mappings":"2GAgBA,eAAsB,EACpB,EACmC,CACnC,GAAM,CAAC,EAAU,GAAU,MAAM,QAAQ,IAAI,CAC3C,EAAiB,EAAO,CACxB,EAAyB,EAAO,CACjC,CAAC,CAEF,OAAO,EAAS,IAAK,GAAY,CAC/B,IAAM,EAAgB,EAAO,OAC1B,GAAU,EAAM,QAAQ,eAAiB,EAAQ,aACnD,CACD,MAAO,CACL,GAAG,EACH,OAAQ,EACT,EACD"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./makeGraphQLRequest-Cq26A_Lq.mjs";import{gql as t}from"graphql-request";const n=t`
|
|
2
|
-
query TranscendCliRequestEnrichers($first: Int!, $offset: Int!, $requestId: ID!) {
|
|
3
|
-
requestEnrichers(
|
|
4
|
-
input: { requestId: $requestId }
|
|
5
|
-
first: $first
|
|
6
|
-
offset: $offset
|
|
7
|
-
useMaster: false
|
|
8
|
-
orderBy: [
|
|
9
|
-
{ field: createdAt, direction: ASC }
|
|
10
|
-
{ field: title, direction: ASC, model: enricher }
|
|
11
|
-
]
|
|
12
|
-
) {
|
|
13
|
-
nodes {
|
|
14
|
-
id
|
|
15
|
-
status
|
|
16
|
-
enricher {
|
|
17
|
-
id
|
|
18
|
-
type
|
|
19
|
-
title
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
totalCount
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`,r=t`
|
|
26
|
-
mutation TranscendCliRetryRequestEnricher($requestEnricherId: ID!) {
|
|
27
|
-
retryRequestEnricher(id: $requestEnricherId) {
|
|
28
|
-
requestEnricher {
|
|
29
|
-
id
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`,i=t`
|
|
34
|
-
mutation TranscendCliSkipRequestEnricher($requestEnricherId: ID!) {
|
|
35
|
-
skipRequestEnricher(id: $requestEnricherId) {
|
|
36
|
-
requestEnricher {
|
|
37
|
-
id
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
`;async function a(t,{requestId:r}){let i=[],a=0,o=!1;do{let{requestEnrichers:{nodes:s}}=await e(t,n,{first:50,offset:a,requestId:r});i.push(...s),a+=50,o=s.length===50}while(o);return i}export{i,n,r,a as t};
|
|
42
|
-
//# sourceMappingURL=fetchAllRequestEnrichers-CK-kk5eg.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllRequestEnrichers-CK-kk5eg.mjs","names":[],"sources":["../src/lib/graphql/gqls/RequestEnricher.ts","../src/lib/graphql/fetchAllRequestEnrichers.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\n// TODO: https://transcend.height.app/T-27909 - enable optimizations\n// isExportCsv: true\nexport const REQUEST_ENRICHERS = gql`\n query TranscendCliRequestEnrichers($first: Int!, $offset: Int!, $requestId: ID!) {\n requestEnrichers(\n input: { requestId: $requestId }\n first: $first\n offset: $offset\n useMaster: false\n orderBy: [\n { field: createdAt, direction: ASC }\n { field: title, direction: ASC, model: enricher }\n ]\n ) {\n nodes {\n id\n status\n enricher {\n id\n type\n title\n }\n }\n totalCount\n }\n }\n`;\n\nexport const RETRY_REQUEST_ENRICHER = gql`\n mutation TranscendCliRetryRequestEnricher($requestEnricherId: ID!) {\n retryRequestEnricher(id: $requestEnricherId) {\n requestEnricher {\n id\n }\n }\n }\n`;\n\nexport const SKIP_REQUEST_ENRICHER = gql`\n mutation TranscendCliSkipRequestEnricher($requestEnricherId: ID!) {\n skipRequestEnricher(id: $requestEnricherId) {\n requestEnricher {\n id\n }\n }\n }\n`;\n","import { RequestEnricherStatus } from '@transcend-io/privacy-types';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { REQUEST_ENRICHERS } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport interface RequestEnricher {\n /** ID of request enricher */\n id: string;\n /** Name of identifier */\n enricher: {\n /** ID of enricher */\n id: string;\n /** Title of enricher */\n title: string;\n /** Typeof of enricher */\n type: string;\n };\n /** The status of the enricher */\n status: RequestEnricherStatus;\n}\n\nconst PAGE_SIZE = 50;\n\n/**\n * Fetch all request enrichers for a particular request\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request enrichers\n */\nexport async function fetchAllRequestEnrichers(\n client: GraphQLClient,\n {\n requestId,\n }: {\n /** ID of request to filter on */\n requestId: string;\n },\n): Promise<RequestEnricher[]> {\n const requestEnrichers: RequestEnricher[] = [];\n let offset = 0;\n\n // Paginate\n let shouldContinue = false;\n do {\n const {\n requestEnrichers: { nodes },\n } = await makeGraphQLRequest<{\n /** Request Enrichers */\n requestEnrichers: {\n /** List */\n nodes: RequestEnricher[];\n };\n }>(client, REQUEST_ENRICHERS, {\n first: PAGE_SIZE,\n offset,\n requestId,\n });\n requestEnrichers.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return requestEnrichers;\n}\n"],"mappings":"4FAIA,MAAa,EAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;EA0BvB,EAAyB,CAAG;;;;;;;;EAU5B,EAAwB,CAAG;;;;;;;;ECTxC,eAAsB,EACpB,EACA,CACE,aAK0B,CAC5B,IAAM,EAAsC,EAAE,CAC1C,EAAS,EAGT,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,iBAAkB,CAAE,UAClB,MAAM,EAMP,EAAQ,EAAmB,CAC5B,MAAO,GACP,SACA,YACD,CAAC,CACF,EAAiB,KAAK,GAAG,EAAM,CAC/B,GAAU,GACV,EAAiB,EAAM,SAAW,SAC3B,GAET,OAAO"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./makeGraphQLRequest-Cq26A_Lq.mjs";import{IdentifierType as t}from"@transcend-io/privacy-types";import{decodeCodec as n,valuesOf as r}from"@transcend-io/type-utils";import*as i from"io-ts";import{gql as a}from"graphql-request";import o from"semver";const s=a`
|
|
2
|
-
query TranscendSombraVersion {
|
|
3
|
-
organization {
|
|
4
|
-
sombra {
|
|
5
|
-
version
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
`,c=`7.180.0`,l=i.type({id:i.string,name:i.string,value:i.string,type:r(t)}),u=i.type({identifiers:i.array(l)});async function d(t){let{organization:{sombra:{version:n}}}=await e(t,s);if(n&&o.lt(n,c))throw Error(`Please upgrade Sombra to ${c} or greater to use this command.`)}async function f(e,t,{requestId:r,skipSombraCheck:i=!1}){let a=[],o=0,s=!1;i||await d(e);do{let e;try{e=await t.post(`v1/request-identifiers`,{json:{first:50,offset:o,requestId:r}}).json()}catch(e){throw Error(`Failed to fetch request identifiers: ${e?.response?.body||e?.message}`)}let{identifiers:i}=n(u,e);a.push(...i),o+=50,s=i.length===50}while(s);return a}export{s as i,f as n,d as r,u as t};
|
|
10
|
-
//# sourceMappingURL=fetchAllRequestIdentifiers-DrFFOt0m.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllRequestIdentifiers-DrFFOt0m.mjs","names":[],"sources":["../src/lib/graphql/gqls/sombraVersion.ts","../src/lib/graphql/fetchAllRequestIdentifiers.ts"],"sourcesContent":["import { gql } from 'graphql-request';\n\nexport const SOMBRA_VERSION = gql`\n query TranscendSombraVersion {\n organization {\n sombra {\n version\n }\n }\n }\n`;\n","import { IdentifierType } from '@transcend-io/privacy-types';\nimport { decodeCodec, valuesOf } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport { GraphQLClient } from 'graphql-request';\nimport * as t from 'io-ts';\nimport semver from 'semver';\n\nimport { SOMBRA_VERSION } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nconst MIN_SOMBRA_VERSION_TO_DECRYPT = '7.180.0';\n\nconst RequestIdentifier = t.type({\n /** ID of request */\n id: t.string,\n /** Name of identifier */\n name: t.string,\n /** The underlying identifier value */\n value: t.string,\n /** Type of identifier */\n type: valuesOf(IdentifierType),\n});\n\n/** Type override */\nexport type RequestIdentifier = t.TypeOf<typeof RequestIdentifier>;\n\nconst PAGE_SIZE = 50;\n\nexport const RequestIdentifiersResponse = t.type({\n identifiers: t.array(RequestIdentifier),\n});\n\n/**\n * Validate that the Sombra version meets the minimum requirement for\n * decrypting request identifiers. Call once before bulk-fetching identifiers\n * to avoid repeating this check on every request.\n *\n * @param client - GraphQL client\n */\nexport async function validateSombraVersion(client: GraphQLClient): Promise<void> {\n const {\n organization: {\n sombra: { version },\n },\n } = await makeGraphQLRequest<{\n /** The organization */\n organization: {\n /** Sombra */\n sombra: {\n /** Version string */\n version: string;\n };\n };\n }>(client, SOMBRA_VERSION);\n\n if (version && semver.lt(version, MIN_SOMBRA_VERSION_TO_DECRYPT)) {\n throw new Error(\n `Please upgrade Sombra to ${MIN_SOMBRA_VERSION_TO_DECRYPT} or greater to use this command.`,\n );\n }\n}\n\n/**\n * Fetch all request identifiers for a particular request\n *\n * @param client - GraphQL client\n * @param sombra - Sombra client\n * @param options - Options\n * @returns List of request identifiers\n */\nexport async function fetchAllRequestIdentifiers(\n client: GraphQLClient,\n sombra: Got,\n {\n requestId,\n skipSombraCheck = false,\n }: {\n /** ID of request to filter on */\n requestId: string;\n /** Skip the Sombra version check (caller already validated) */\n skipSombraCheck?: boolean;\n },\n): Promise<RequestIdentifier[]> {\n const requestIdentifiers: RequestIdentifier[] = [];\n let offset = 0;\n let shouldContinue = false;\n\n if (!skipSombraCheck) {\n await validateSombraVersion(client);\n }\n\n do {\n let response: unknown;\n try {\n response = await sombra!\n .post<{\n /** Decrypted identifiers */\n identifiers: RequestIdentifier[];\n }>('v1/request-identifiers', {\n json: {\n first: PAGE_SIZE,\n offset,\n requestId,\n },\n })\n .json();\n } catch (err) {\n throw new Error(\n `Failed to fetch request identifiers: ${err?.response?.body || err?.message}`,\n );\n }\n\n const { identifiers: nodes } = decodeCodec(RequestIdentifiersResponse, response);\n\n requestIdentifiers.push(...nodes);\n\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return requestIdentifiers;\n}\n"],"mappings":"4QAEA,MAAa,EAAiB,CAAG;;;;;;;;ECQ3B,EAAgC,UAEhC,EAAoB,EAAE,KAAK,CAE/B,GAAI,EAAE,OAEN,KAAM,EAAE,OAER,MAAO,EAAE,OAET,KAAM,EAAS,EAAe,CAC/B,CAAC,CAOW,EAA6B,EAAE,KAAK,CAC/C,YAAa,EAAE,MAAM,EAAkB,CACxC,CAAC,CASF,eAAsB,EAAsB,EAAsC,CAChF,GAAM,CACJ,aAAc,CACZ,OAAQ,CAAE,aAEV,MAAM,EASP,EAAQ,EAAe,CAE1B,GAAI,GAAW,EAAO,GAAG,EAAS,EAA8B,CAC9D,MAAU,MACR,4BAA4B,EAA8B,kCAC3D,CAYL,eAAsB,EACpB,EACA,EACA,CACE,YACA,kBAAkB,IAOU,CAC9B,IAAM,EAA0C,EAAE,CAC9C,EAAS,EACT,EAAiB,GAEhB,GACH,MAAM,EAAsB,EAAO,CAGrC,EAAG,CACD,IAAI,EACJ,GAAI,CACF,EAAW,MAAM,EACd,KAGE,yBAA0B,CAC3B,KAAM,CACJ,MAAO,GACP,SACA,YACD,CACF,CAAC,CACD,MAAM,OACF,EAAK,CACZ,MAAU,MACR,wCAAwC,GAAK,UAAU,MAAQ,GAAK,UACrE,CAGH,GAAM,CAAE,YAAa,GAAU,EAAY,EAA4B,EAAS,CAEhF,EAAmB,KAAK,GAAG,EAAM,CAEjC,GAAU,GACV,EAAiB,EAAM,SAAW,SAC3B,GAET,OAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-LXIf3U.mjs";import{a as t,i as n}from"./request-CAsR6CMY.mjs";import{t as r}from"./makeGraphQLRequest-Cq26A_Lq.mjs";import{IsoCountryCode as i,IsoCountrySubdivisionCode as a,RequestAction as o,RequestOrigin as s,RequestStatus as c}from"@transcend-io/privacy-types";import{valuesOf as l}from"@transcend-io/type-utils";import u from"colors";import{LOCALE_KEY as d}from"@transcend-io/internationalization";import*as f from"io-ts";import p from"cli-progress";const m=f.type({title:f.string,name:f.string,consent:f.boolean,enrichedPreferences:f.array(f.type({topic:f.string,selectValues:f.array(f.type({id:f.string,name:f.string,preferenceOption:f.type({id:f.string,slug:f.string,title:f.type({defaultMessage:f.string})})})),selectValue:f.type({id:f.string,name:f.string}),preferenceTopic:f.type({title:f.type({defaultMessage:f.string}),id:f.string,slug:f.string}),name:f.string,id:f.string,booleanValue:f.boolean}))}),h=f.intersection([f.type({id:f.string,createdAt:f.string,email:f.string,type:l(o),link:f.string,isSilent:f.boolean,origin:l(s),isTest:f.boolean,coreIdentifier:f.string,details:f.string,locale:l(d),status:l(c),subjectType:f.string,country:f.union([f.null,l(i)]),countrySubDivision:f.union([f.null,l(a)]),attributeValues:f.array(f.type({id:f.string,attributeKey:f.type({name:f.string,id:f.string}),name:f.string}))}),f.partial({daysRemaining:f.union([f.null,f.number]),successfullyCompletedAt:f.union([f.null,f.string]),purpose:m})]);async function g(e,n){let{requests:{totalCount:i}}=await r(e,t,{filterBy:n});return i}async function _(i,{actions:a=[],statuses:o=[],origins:s=[],text:c,createdAtBefore:l,createdAtAfter:d,updatedAtBefore:f,updatedAtAfter:m,isTest:h,isSilent:g,isClosed:_,requestIds:v=[],onPage:y}={}){let b=!!y,x={text:c,type:a.length>0?a:void 0,status:o.length>0?o:void 0,origin:s.length>0?s:void 0,isTest:h,isSilent:g,isClosed:_,createdAtBefore:l?l.toISOString():void 0,createdAtAfter:d?d.toISOString():void 0,updatedAtBefore:f?f.toISOString():void 0,updatedAtAfter:m?m.toISOString():void 0},S=new Date().getTime(),C=new p.SingleBar({},p.Presets.shades_classic);if(!b){e.info(u.magenta(`Fetching requests...`));let{requests:{totalCount:n}}=await r(i,t,{filterBy:x});n>100&&(e.info(u.magenta(`Fetching ${n} requests`)),C.start(n,0))}let w=[],T=0,E,D=!1;do{let{requests:{nodes:e,pageInfo:t}}=await r(i,n,{first:100,after:E,filterBy:x});b?await y(e):w.push(...e),T+=e.length,E=t.endCursor??void 0,b||C.update(T),D=t.hasNextPage}while(D);if(!b){C.stop();let t=new Date().getTime()-S;e.info(u.green(`Completed fetching of ${T} request in "${t/1e3}" seconds.`))}if(b)return[];let O=w;return v&&v.length>0&&(O=O.filter(e=>v.includes(e.id)),e.info(u.green(`Filtered down to ${O.length} requests based on ${v.length} provided IDs.`))),O}export{g as i,m as n,_ as r,h as t};
|
|
2
|
-
//# sourceMappingURL=fetchAllRequests-DNQQsY4s.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAllRequests-DNQQsY4s.mjs","names":[],"sources":["../src/lib/graphql/fetchAllRequests.ts"],"sourcesContent":["import { LOCALE_KEY } from '@transcend-io/internationalization';\nimport {\n RequestAction,\n RequestOrigin,\n RequestStatus,\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n} from '@transcend-io/privacy-types';\nimport { valuesOf } from '@transcend-io/type-utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\nimport { REQUESTS, REQUESTS_COUNT } from './gqls/index.js';\nimport { makeGraphQLRequest } from './makeGraphQLRequest.js';\n\nexport const RequestPurposeTrigger = t.type({\n title: t.string,\n name: t.string,\n consent: t.boolean,\n enrichedPreferences: t.array(\n t.type({\n topic: t.string,\n selectValues: t.array(\n t.type({\n id: t.string,\n name: t.string,\n preferenceOption: t.type({\n id: t.string,\n slug: t.string,\n title: t.type({\n defaultMessage: t.string,\n }),\n }),\n }),\n ),\n selectValue: t.type({\n id: t.string,\n name: t.string,\n }),\n preferenceTopic: t.type({\n title: t.type({\n defaultMessage: t.string,\n }),\n id: t.string,\n slug: t.string,\n }),\n name: t.string,\n id: t.string,\n booleanValue: t.boolean,\n }),\n ),\n});\n\n/** Override type */\nexport type RequestPurposeTrigger = t.TypeOf<typeof RequestPurposeTrigger>;\n\nexport const PrivacyRequest = t.intersection([\n t.type({\n /** Request ID */\n id: t.string,\n /** Time request was made */\n createdAt: t.string,\n /** Email of request */\n email: t.string,\n /** The type of request */\n type: valuesOf(RequestAction),\n /** Link to request in Transcend dashboard */\n link: t.string,\n /** Whether request is in silent mode */\n isSilent: t.boolean,\n /** Where request was made */\n origin: valuesOf(RequestOrigin),\n /** Whether request is a test request */\n isTest: t.boolean,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** Request details */\n details: t.string,\n /** Locale of request */\n locale: valuesOf(LOCALE_KEY),\n /** Status of request */\n status: valuesOf(RequestStatus),\n /** Type of data subject */\n subjectType: t.string,\n /** Country of request */\n country: t.union([t.null, valuesOf(IsoCountryCode)]),\n /** Subdivision of request */\n countrySubDivision: t.union([t.null, valuesOf(IsoCountrySubdivisionCode)]),\n /** Request attributes */\n attributeValues: t.array(\n t.type({\n id: t.string,\n attributeKey: t.type({ name: t.string, id: t.string }),\n name: t.string,\n }),\n ),\n }),\n t.partial({\n /** Days remaining until expired */\n daysRemaining: t.union([t.null, t.number]),\n /** Time when request was successfully completed */\n successfullyCompletedAt: t.union([t.null, t.string]),\n /** Purpose */\n purpose: RequestPurposeTrigger,\n }),\n]);\n\n/** Type override */\nexport type PrivacyRequest = t.TypeOf<typeof PrivacyRequest>;\n\nconst PAGE_SIZE = 100;\n\n/**\n * Fetch just the total count of requests matching a set of filters.\n * Useful for setting up a progress bar before streaming pages.\n *\n * @param client - GraphQL client\n * @param filterBy - Filter object (already serialized to ISO strings)\n * @returns The total count\n */\nexport async function fetchRequestsTotalCount(\n client: GraphQLClient,\n filterBy: Record<string, unknown>,\n): Promise<number> {\n const {\n requests: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REQUESTS_COUNT, { filterBy });\n return totalCount;\n}\n\n/**\n * Fetch all requests matching a set of filters.\n *\n * When `onPage` is provided the function streams pages to the callback\n * and never accumulates nodes in memory — ideal for very large exports.\n * Without `onPage` the function returns all nodes in a single array\n * (existing behaviour, kept for backward compatibility).\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of requests (empty when using onPage)\n */\nexport async function fetchAllRequests(\n client: GraphQLClient,\n {\n actions = [],\n statuses = [],\n origins = [],\n text,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isTest,\n isSilent,\n isClosed,\n requestIds = [],\n onPage,\n }: {\n /** Actions to filter on */\n actions?: RequestAction[];\n /** Origins to filter on */\n origins?: RequestOrigin[];\n /** Statuses to filter on */\n statuses?: RequestStatus[];\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 /** Filter for requests with a specific identifier */\n text?: string;\n /** Return test requests */\n isTest?: boolean;\n /** Return silent mode requests */\n isSilent?: boolean;\n /** Filter by whether request is active */\n isClosed?: boolean;\n /**\n * Filter the list of requests for a set of IDs - these are applied\n * at runtime while other filters are applied at the GraphQL level.\n */\n requestIds?: string[];\n /** When provided, called with each page of nodes instead of accumulating in memory */\n onPage?: (nodes: PrivacyRequest[]) => void | Promise<void>;\n } = {},\n): Promise<PrivacyRequest[]> {\n const streaming = !!onPage;\n\n const filterBy = {\n text,\n type: actions.length > 0 ? actions : undefined,\n status: statuses.length > 0 ? statuses : undefined,\n origin: origins.length > 0 ? origins : undefined,\n isTest,\n isSilent,\n isClosed,\n createdAtBefore: createdAtBefore ? createdAtBefore.toISOString() : undefined,\n createdAtAfter: createdAtAfter ? createdAtAfter.toISOString() : undefined,\n updatedAtBefore: updatedAtBefore ? updatedAtBefore.toISOString() : undefined,\n updatedAtAfter: updatedAtAfter ? updatedAtAfter.toISOString() : undefined,\n };\n\n // When streaming, the caller manages progress/logging — skip count query & bar\n const t0 = new Date().getTime();\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n if (!streaming) {\n logger.info(colors.magenta('Fetching requests...'));\n const {\n requests: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REQUESTS_COUNT, { filterBy });\n\n if (totalCount > PAGE_SIZE) {\n logger.info(colors.magenta(`Fetching ${totalCount} requests`));\n progressBar.start(totalCount, 0);\n }\n }\n\n const requests: PrivacyRequest[] = [];\n let fetchedCount = 0;\n\n // Paginate through all results\n let cursor: string | undefined;\n let shouldContinue = false;\n do {\n const {\n requests: { nodes, pageInfo },\n } = await makeGraphQLRequest<{\n /** Requests */\n requests: {\n /** List */\n nodes: PrivacyRequest[];\n /** Pagination info */\n pageInfo: {\n /** Cursor for the last item */\n endCursor: string | null;\n /** Whether more pages exist */\n hasNextPage: boolean;\n };\n };\n }>(client, REQUESTS, {\n first: PAGE_SIZE,\n after: cursor,\n filterBy,\n });\n\n if (streaming) {\n await onPage!(nodes);\n } else {\n requests.push(...nodes);\n }\n\n fetchedCount += nodes.length;\n cursor = pageInfo.endCursor ?? undefined;\n if (!streaming) {\n progressBar.update(fetchedCount);\n }\n shouldContinue = pageInfo.hasNextPage;\n } while (shouldContinue);\n\n if (!streaming) {\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Completed fetching of ${fetchedCount} request in \"${totalTime / 1000}\" seconds.`,\n ),\n );\n }\n\n if (streaming) {\n return [];\n }\n\n // Filter down requests by request ID\n let allRequests = requests;\n if (requestIds && requestIds.length > 0) {\n allRequests = allRequests.filter((request) => requestIds.includes(request.id));\n logger.info(\n colors.green(\n `Filtered down to ${allRequests.length} requests based on ${requestIds.length} provided IDs.`,\n ),\n );\n }\n\n return allRequests;\n}\n"],"mappings":"qeAkBA,MAAa,EAAwB,EAAE,KAAK,CAC1C,MAAO,EAAE,OACT,KAAM,EAAE,OACR,QAAS,EAAE,QACX,oBAAqB,EAAE,MACrB,EAAE,KAAK,CACL,MAAO,EAAE,OACT,aAAc,EAAE,MACd,EAAE,KAAK,CACL,GAAI,EAAE,OACN,KAAM,EAAE,OACR,iBAAkB,EAAE,KAAK,CACvB,GAAI,EAAE,OACN,KAAM,EAAE,OACR,MAAO,EAAE,KAAK,CACZ,eAAgB,EAAE,O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GAAI,CAAC,EAAW,CACd,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SAAS,CACR,EAEvB,EAAO,KACL,EAAO,MACL,yBAAyB,EAAa,eAAe,EAAY,IAAK,YACvE,CACF,CAGH,GAAI,EACF,MAAO,EAAE,CAIX,IAAI,EAAc,EAUlB,OATI,GAAc,EAAW,OAAS,IACpC,EAAc,EAAY,OAAQ,GAAY,EAAW,SAAS,EAAQ,GAAG,CAAC,CAC9E,EAAO,KACL,EAAO,MACL,oBAAoB,EAAY,OAAO,qBAAqB,EAAW,OAAO,gBAC/E,CACF,EAGI"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-LXIf3U.mjs";import{t}from"./makeGraphQLRequest-Cq26A_Lq.mjs";import{difference as n,keyBy as r,uniq as i}from"lodash-es";import a from"colors";import{gql as o}from"graphql-request";const s=o`
|
|
2
|
-
query TranscendCliApiKeys($first: Int!, $offset: Int!, $titles: [String!]) {
|
|
3
|
-
apiKeys(
|
|
4
|
-
first: $first
|
|
5
|
-
offset: $offset
|
|
6
|
-
filterBy: { titles: $titles }
|
|
7
|
-
useMaster: false
|
|
8
|
-
orderBy: [{ field: createdAt, direction: ASC }, { field: title, direction: ASC }]
|
|
9
|
-
) {
|
|
10
|
-
nodes {
|
|
11
|
-
id
|
|
12
|
-
title
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
`,c=o`
|
|
17
|
-
mutation TranscendCliCreateApiKey($input: ApiKeyInput!) {
|
|
18
|
-
createApiKey(input: $input) {
|
|
19
|
-
apiKey {
|
|
20
|
-
id
|
|
21
|
-
apiKey
|
|
22
|
-
title
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`,l=o`
|
|
27
|
-
mutation TranscendCliDeleteApiKey($id: ID!) {
|
|
28
|
-
deleteApiKey(id: $id) {
|
|
29
|
-
clientMutationId
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`;async function u(e,n){let r=[],i=0,a=!1;do{let{apiKeys:{nodes:o}}=await t(e,s,{first:20,offset:i,titles:n});r.push(...o),i+=20,a=o.length===20}while(a);return r.sort((e,t)=>e.title.localeCompare(t.title))}async function d({"api-keys":t=[],"data-silos":o=[]},s,c=!1){e.info(a.magenta(`Fetching ${c?`all`:t.length} API keys...`));let l=t.map(({title:e})=>e),d=i(o.map(e=>e[`api-key-title`]).filter(e=>!!e)),f=[...d,...l],p=await u(s,c?void 0:[...d,...l]),m=r(p,`title`),h=n(f,p.map(({title:e})=>e));return h.length>0&&(e.info(a.red(`Failed to find API keys "${h.join(`", "`)}"! Make sure these API keys are created at: https://app.transcend.io/infrastructure/api-keys`)),process.exit(1)),m}export{l as a,c as i,d as n,s as r,u as t};
|
|
33
|
-
//# sourceMappingURL=fetchApiKeys-DjOr44xA.mjs.map
|