@transcend-io/cli 10.20.0 → 10.21.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 +2 -0
- package/dist/{app-CwIs_xeP.mjs → app-D29TqW_A.mjs} +17 -17
- package/dist/{app-CwIs_xeP.mjs.map → app-D29TqW_A.mjs.map} +1 -1
- package/dist/{approvePrivacyRequests-BsNtrVwv.mjs → approvePrivacyRequests-BjjUp-hw.mjs} +2 -2
- package/dist/{approvePrivacyRequests-BsNtrVwv.mjs.map → approvePrivacyRequests-BjjUp-hw.mjs.map} +1 -1
- package/dist/bin/bash-complete.mjs +1 -1
- package/dist/bin/cli.mjs +1 -1
- package/dist/bin/deprecated-command.mjs +1 -1
- package/dist/{buildExamples-FGTunLac.mjs → buildExamples-2xaj8FoK.mjs} +2 -2
- package/dist/{buildExamples-FGTunLac.mjs.map → buildExamples-2xaj8FoK.mjs.map} +1 -1
- package/dist/{buildXdiSyncEndpoint-DPo9Sw3F.mjs → buildXdiSyncEndpoint-ozQ3T4Hj.mjs} +2 -2
- package/dist/{buildXdiSyncEndpoint-DPo9Sw3F.mjs.map → buildXdiSyncEndpoint-ozQ3T4Hj.mjs.map} +1 -1
- package/dist/{bulkRestartRequests-iE9g9WBz.mjs → bulkRestartRequests-c29oH5GC.mjs} +2 -2
- package/dist/{bulkRestartRequests-iE9g9WBz.mjs.map → bulkRestartRequests-c29oH5GC.mjs.map} +1 -1
- package/dist/{bulkRetryEnrichers-DDA5OvCM.mjs → bulkRetryEnrichers-i3oFHWx-.mjs} +2 -2
- package/dist/{bulkRetryEnrichers-DDA5OvCM.mjs.map → bulkRetryEnrichers-i3oFHWx-.mjs.map} +1 -1
- package/dist/{cancelPrivacyRequests-SWJzauUB.mjs → cancelPrivacyRequests-B4IzmRWC.mjs} +2 -2
- package/dist/{cancelPrivacyRequests-SWJzauUB.mjs.map → cancelPrivacyRequests-B4IzmRWC.mjs.map} +1 -1
- package/dist/codecs-CbOFsh1R.mjs +2 -0
- package/dist/codecs-CbOFsh1R.mjs.map +1 -0
- package/dist/{command-Cr4p5WG-.mjs → command-DOo9vOei.mjs} +2 -2
- package/dist/{command-Cr4p5WG-.mjs.map → command-DOo9vOei.mjs.map} +1 -1
- package/dist/{constants-Cb9QI4yq.mjs → constants-BesTSxZW.mjs} +2 -2
- package/dist/{constants-Cb9QI4yq.mjs.map → constants-BesTSxZW.mjs.map} +1 -1
- package/dist/{createExtraKeyHandler-BfTP-FYM.mjs → createExtraKeyHandler-JtWqC00U.mjs} +2 -2
- package/dist/{createExtraKeyHandler-BfTP-FYM.mjs.map → createExtraKeyHandler-JtWqC00U.mjs.map} +1 -1
- package/dist/{downloadPrivacyRequestFiles-V9ITIuDi.mjs → downloadPrivacyRequestFiles-CIxwRWnH.mjs} +2 -2
- package/dist/{downloadPrivacyRequestFiles-V9ITIuDi.mjs.map → downloadPrivacyRequestFiles-CIxwRWnH.mjs.map} +1 -1
- package/dist/{generateCrossAccountApiKeys-BjbmV5iK.mjs → generateCrossAccountApiKeys-qw686-vX.mjs} +2 -2
- package/dist/{generateCrossAccountApiKeys-BjbmV5iK.mjs.map → generateCrossAccountApiKeys-qw686-vX.mjs.map} +1 -1
- package/dist/{impl-DXmqDQqu2.mjs → impl-2wy1Bi1C2.mjs} +2 -2
- package/dist/{impl-DXmqDQqu2.mjs.map → impl-2wy1Bi1C2.mjs.map} +1 -1
- package/dist/{impl-459Az7fC2.mjs → impl-B4MaLZAd2.mjs} +2 -2
- package/dist/{impl-459Az7fC2.mjs.map → impl-B4MaLZAd2.mjs.map} +1 -1
- package/dist/{impl-CvNWIETy.mjs → impl-BDPtNJLp.mjs} +2 -2
- package/dist/{impl-CvNWIETy.mjs.map → impl-BDPtNJLp.mjs.map} +1 -1
- package/dist/{impl-BTP9SQTC.mjs → impl-BHibMDBv.mjs} +2 -2
- package/dist/{impl-BTP9SQTC.mjs.map → impl-BHibMDBv.mjs.map} +1 -1
- package/dist/{impl-BZMvZ-H5.mjs → impl-BV9t4j6E.mjs} +2 -2
- package/dist/{impl-BZMvZ-H5.mjs.map → impl-BV9t4j6E.mjs.map} +1 -1
- package/dist/{impl-tCrd3m6C.mjs → impl-BaDKnY6X.mjs} +2 -2
- package/dist/{impl-tCrd3m6C.mjs.map → impl-BaDKnY6X.mjs.map} +1 -1
- package/dist/{impl-DI1UENx5.mjs → impl-BcHxVhtN.mjs} +2 -2
- package/dist/{impl-DI1UENx5.mjs.map → impl-BcHxVhtN.mjs.map} +1 -1
- package/dist/{impl-qexLI_cv.mjs → impl-Bhd63d2E.mjs} +2 -2
- package/dist/{impl-qexLI_cv.mjs.map → impl-Bhd63d2E.mjs.map} +1 -1
- package/dist/{impl-DWRMbSmy.mjs → impl-C5jWisyQ.mjs} +2 -2
- package/dist/{impl-DWRMbSmy.mjs.map → impl-C5jWisyQ.mjs.map} +1 -1
- package/dist/{impl-CNKuWYpL2.mjs → impl-C6wTDCex2.mjs} +2 -2
- package/dist/{impl-CNKuWYpL2.mjs.map → impl-C6wTDCex2.mjs.map} +1 -1
- package/dist/{impl-BAAcCu2K.mjs → impl-CK9A4BvD.mjs} +2 -2
- package/dist/{impl-BAAcCu2K.mjs.map → impl-CK9A4BvD.mjs.map} +1 -1
- package/dist/{impl-4k456kRN.mjs → impl-CSMzpKv5.mjs} +2 -2
- package/dist/{impl-4k456kRN.mjs.map → impl-CSMzpKv5.mjs.map} +1 -1
- package/dist/{impl-7Nr7gpgv2.mjs → impl-CW6TFAzt2.mjs} +2 -2
- package/dist/{impl-7Nr7gpgv2.mjs.map → impl-CW6TFAzt2.mjs.map} +1 -1
- package/dist/{impl-BCPzfDOr.mjs → impl-CWd25f8p.mjs} +2 -2
- package/dist/{impl-BCPzfDOr.mjs.map → impl-CWd25f8p.mjs.map} +1 -1
- package/dist/{impl-CgIZUWGW.mjs → impl-CZfS7Ydy.mjs} +2 -2
- package/dist/{impl-CgIZUWGW.mjs.map → impl-CZfS7Ydy.mjs.map} +1 -1
- package/dist/{impl-DpkSquYY.mjs → impl-ChV4laNE.mjs} +2 -2
- package/dist/{impl-DpkSquYY.mjs.map → impl-ChV4laNE.mjs.map} +1 -1
- package/dist/{impl-C9ycytEX.mjs → impl-CiDSQd1n.mjs} +2 -2
- package/dist/{impl-C9ycytEX.mjs.map → impl-CiDSQd1n.mjs.map} +1 -1
- package/dist/{impl-CS4W0xxJ2.mjs → impl-CrVGqakz2.mjs} +2 -2
- package/dist/{impl-CS4W0xxJ2.mjs.map → impl-CrVGqakz2.mjs.map} +1 -1
- package/dist/{impl-nkCz_WoZ.mjs → impl-CrpWDfKW.mjs} +2 -2
- package/dist/{impl-nkCz_WoZ.mjs.map → impl-CrpWDfKW.mjs.map} +1 -1
- package/dist/{impl-CfRJByur.mjs → impl-CwOPj70B.mjs} +2 -2
- package/dist/{impl-CfRJByur.mjs.map → impl-CwOPj70B.mjs.map} +1 -1
- package/dist/{impl-lMY6fT6G.mjs → impl-D2KU3B7g.mjs} +2 -2
- package/dist/{impl-lMY6fT6G.mjs.map → impl-D2KU3B7g.mjs.map} +1 -1
- package/dist/{impl-k-AQAHRI2.mjs → impl-D2LX8clq2.mjs} +2 -2
- package/dist/{impl-k-AQAHRI2.mjs.map → impl-D2LX8clq2.mjs.map} +1 -1
- package/dist/{impl-DzR3gsYc.mjs → impl-DBV_D1ii.mjs} +2 -2
- package/dist/{impl-DzR3gsYc.mjs.map → impl-DBV_D1ii.mjs.map} +1 -1
- package/dist/{impl-j0JKrcEn.mjs → impl-DE9OHpyc.mjs} +2 -2
- package/dist/{impl-j0JKrcEn.mjs.map → impl-DE9OHpyc.mjs.map} +1 -1
- package/dist/{impl-umKPtZJS2.mjs → impl-DF374hZ52.mjs} +2 -2
- package/dist/{impl-umKPtZJS2.mjs.map → impl-DF374hZ52.mjs.map} +1 -1
- package/dist/{impl-Bjdv9HmT2.mjs → impl-DFZBjY6J2.mjs} +2 -2
- package/dist/{impl-Bjdv9HmT2.mjs.map → impl-DFZBjY6J2.mjs.map} +1 -1
- package/dist/{impl-BHZVyoUU.mjs → impl-DH049g3W.mjs} +2 -2
- package/dist/{impl-BHZVyoUU.mjs.map → impl-DH049g3W.mjs.map} +1 -1
- package/dist/{impl-BaJGA--D.mjs → impl-DI5BZJRL.mjs} +2 -2
- package/dist/{impl-BaJGA--D.mjs.map → impl-DI5BZJRL.mjs.map} +1 -1
- package/dist/{impl-BtYepbPW.mjs → impl-DMQEmlVb.mjs} +2 -2
- package/dist/{impl-BtYepbPW.mjs.map → impl-DMQEmlVb.mjs.map} +1 -1
- package/dist/{impl-B7_rAfK4.mjs → impl-DNwwq1Nh.mjs} +2 -2
- package/dist/{impl-B7_rAfK4.mjs.map → impl-DNwwq1Nh.mjs.map} +1 -1
- package/dist/{impl-DJAJ3NgX2.mjs → impl-DUI3qGsC2.mjs} +2 -2
- package/dist/{impl-DJAJ3NgX2.mjs.map → impl-DUI3qGsC2.mjs.map} +1 -1
- package/dist/{impl-7dSd5RHY2.mjs → impl-DWvfhn-62.mjs} +2 -2
- package/dist/{impl-7dSd5RHY2.mjs.map → impl-DWvfhn-62.mjs.map} +1 -1
- package/dist/{impl-CS5GsbS4.mjs → impl-Dl7w91bL.mjs} +2 -2
- package/dist/{impl-CS5GsbS4.mjs.map → impl-Dl7w91bL.mjs.map} +1 -1
- package/dist/{impl-BY4R2tG1.mjs → impl-JxprJNni.mjs} +2 -2
- package/dist/{impl-BY4R2tG1.mjs.map → impl-JxprJNni.mjs.map} +1 -1
- package/dist/{impl-vg65GYUd.mjs → impl-hY30kWpN.mjs} +2 -2
- package/dist/{impl-vg65GYUd.mjs.map → impl-hY30kWpN.mjs.map} +1 -1
- package/dist/{impl-Cs9AHT0v.mjs → impl-u1q93_tK.mjs} +2 -2
- package/dist/{impl-Cs9AHT0v.mjs.map → impl-u1q93_tK.mjs.map} +1 -1
- package/dist/{impl-q_vV3NSd.mjs → impl-v1WWFSFZ.mjs} +2 -2
- package/dist/{impl-q_vV3NSd.mjs.map → impl-v1WWFSFZ.mjs.map} +1 -1
- package/dist/{impl-CP2Musou.mjs → impl-zECFyZrU.mjs} +2 -2
- package/dist/{impl-CP2Musou.mjs.map → impl-zECFyZrU.mjs.map} +1 -1
- package/dist/index.d.mts +86 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{markRequestDataSiloIdsCompleted-aUZLQ4vH.mjs → markRequestDataSiloIdsCompleted-C7R1YENn.mjs} +2 -2
- package/dist/{markRequestDataSiloIdsCompleted-aUZLQ4vH.mjs.map → markRequestDataSiloIdsCompleted-C7R1YENn.mjs.map} +1 -1
- package/dist/{markSilentPrivacyRequests-DSymICv1.mjs → markSilentPrivacyRequests-D9swsyuo.mjs} +2 -2
- package/dist/{markSilentPrivacyRequests-DSymICv1.mjs.map → markSilentPrivacyRequests-D9swsyuo.mjs.map} +1 -1
- package/dist/{notifyPrivacyRequestsAdditionalTime-C9YqK6WF.mjs → notifyPrivacyRequestsAdditionalTime-CpDSAOaZ.mjs} +2 -2
- package/dist/{notifyPrivacyRequestsAdditionalTime-C9YqK6WF.mjs.map → notifyPrivacyRequestsAdditionalTime-CpDSAOaZ.mjs.map} +1 -1
- package/dist/{parseVariablesFromString-C2SbrKX5.mjs → parseVariablesFromString-CHcigVIK.mjs} +3 -3
- package/dist/parseVariablesFromString-CHcigVIK.mjs.map +1 -0
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-Ckh-dpAa.mjs → pullChunkedCustomSiloOutstandingIdentifiers-nJdP5Lhb.mjs} +2 -2
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-Ckh-dpAa.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-nJdP5Lhb.mjs.map} +1 -1
- package/dist/{pullManualEnrichmentIdentifiersToCsv-gzP-wpef.mjs → pullManualEnrichmentIdentifiersToCsv-CvS65fmI.mjs} +2 -2
- package/dist/{pullManualEnrichmentIdentifiersToCsv-gzP-wpef.mjs.map → pullManualEnrichmentIdentifiersToCsv-CvS65fmI.mjs.map} +1 -1
- package/dist/{pullTranscendConfiguration-B8mxJCi7.mjs → pullTranscendConfiguration-Cdg8JEii.mjs} +2 -2
- package/dist/pullTranscendConfiguration-Cdg8JEii.mjs.map +1 -0
- package/dist/{pushCronIdentifiersFromCsv-7M24AbQL.mjs → pushCronIdentifiersFromCsv-BEPg03aD.mjs} +2 -2
- package/dist/{pushCronIdentifiersFromCsv-7M24AbQL.mjs.map → pushCronIdentifiersFromCsv-BEPg03aD.mjs.map} +1 -1
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-Bjr1td2N.mjs → pushManualEnrichmentIdentifiersFromCsv-B0jKrYOZ.mjs} +2 -2
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-Bjr1td2N.mjs.map → pushManualEnrichmentIdentifiersFromCsv-B0jKrYOZ.mjs.map} +1 -1
- package/dist/{readTranscendYaml-BiOgzaYR.mjs → readTranscendYaml-D-k8P4v1.mjs} +2 -2
- package/dist/{readTranscendYaml-BiOgzaYR.mjs.map → readTranscendYaml-D-k8P4v1.mjs.map} +1 -1
- package/dist/{removeUnverifiedRequestIdentifiers-OZ7bu7Ru.mjs → removeUnverifiedRequestIdentifiers-BIchFbPB.mjs} +2 -2
- package/dist/{removeUnverifiedRequestIdentifiers-OZ7bu7Ru.mjs.map → removeUnverifiedRequestIdentifiers-BIchFbPB.mjs.map} +1 -1
- package/dist/{retryRequestDataSilos-CBQVt1KQ.mjs → retryRequestDataSilos-DUfHyF_U.mjs} +2 -2
- package/dist/{retryRequestDataSilos-CBQVt1KQ.mjs.map → retryRequestDataSilos-DUfHyF_U.mjs.map} +1 -1
- package/dist/{skipPreflightJobs-Bv4Aq4A8.mjs → skipPreflightJobs-DaFjvih9.mjs} +2 -2
- package/dist/{skipPreflightJobs-Bv4Aq4A8.mjs.map → skipPreflightJobs-DaFjvih9.mjs.map} +1 -1
- package/dist/{skipRequestDataSilos-ad1-O-VR.mjs → skipRequestDataSilos-DYE2aYYS.mjs} +2 -2
- package/dist/{skipRequestDataSilos-ad1-O-VR.mjs.map → skipRequestDataSilos-DYE2aYYS.mjs.map} +1 -1
- package/dist/{streamPrivacyRequestsToCsv-Dp2Zyy5x.mjs → streamPrivacyRequestsToCsv-DakIlTv0.mjs} +2 -2
- package/dist/{streamPrivacyRequestsToCsv-Dp2Zyy5x.mjs.map → streamPrivacyRequestsToCsv-DakIlTv0.mjs.map} +1 -1
- package/dist/{updateConsentManagerVersionToLatest-BplmLTDD.mjs → updateConsentManagerVersionToLatest-BzAN1bBC.mjs} +2 -2
- package/dist/{updateConsentManagerVersionToLatest-BplmLTDD.mjs.map → updateConsentManagerVersionToLatest-BzAN1bBC.mjs.map} +1 -1
- package/dist/{uploadConsents-zl9yaBjX.mjs → uploadConsents-CAAkg4cf.mjs} +2 -2
- package/dist/{uploadConsents-zl9yaBjX.mjs.map → uploadConsents-CAAkg4cf.mjs.map} +1 -1
- package/dist/{uploadCookiesFromCsv-B8Ast_0y.mjs → uploadCookiesFromCsv-DP3LBhMG.mjs} +2 -2
- package/dist/{uploadCookiesFromCsv-B8Ast_0y.mjs.map → uploadCookiesFromCsv-DP3LBhMG.mjs.map} +1 -1
- package/dist/{uploadDataFlowsFromCsv-DY_dmUdU.mjs → uploadDataFlowsFromCsv-C--ho0_f.mjs} +2 -2
- package/dist/{uploadDataFlowsFromCsv-DY_dmUdU.mjs.map → uploadDataFlowsFromCsv-C--ho0_f.mjs.map} +1 -1
- package/dist/{uploadPrivacyRequestsFromCsv-CzZCVwFV.mjs → uploadPrivacyRequestsFromCsv-CLklOZOl.mjs} +2 -2
- package/dist/{uploadPrivacyRequestsFromCsv-CzZCVwFV.mjs.map → uploadPrivacyRequestsFromCsv-CLklOZOl.mjs.map} +1 -1
- package/dist/{validateTranscendAuth-B_EFnL1A.mjs → validateTranscendAuth-CIPn35zS.mjs} +2 -2
- package/dist/{validateTranscendAuth-B_EFnL1A.mjs.map → validateTranscendAuth-CIPn35zS.mjs.map} +1 -1
- package/package.json +4 -4
- package/dist/codecs-CfHvcMSL.mjs +0 -2
- package/dist/codecs-CfHvcMSL.mjs.map +0 -1
- package/dist/parseVariablesFromString-C2SbrKX5.mjs.map +0 -1
- package/dist/pullTranscendConfiguration-B8mxJCi7.mjs.map +0 -1
package/dist/{pullTranscendConfiguration-B8mxJCi7.mjs → pullTranscendConfiguration-Cdg8JEii.mjs}
RENAMED
|
@@ -54,5 +54,5 @@ import"./enums-D53y231X.mjs";import{t as e}from"./logger-B-LXIf3U.mjs";import{Ac
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`;async function F(t){let n=[],r=0,i=!1;do{let{assessmentFormTemplates:{nodes:a}}=await A(t,P,{variables:{first:20,offset:r},logger:e});n.push(...a),r+=20,i=a.length===20}while(i);return n.sort((e,t)=>e.title.localeCompare(t.title))}const I=[`dataSilos`,`enrichers`,`templates`,`apiKeys`];async function L(f,{dataSiloIds:A,integrationNames:N,debug:P,resources:L=I,pageSize:R,skipDatapoints:Te,includeGuessedCategories:z,skipSubDatapoints:Ee,trackerStatuses:B=Object.values(n)}){if(A.length>0&&N.length>0)throw Error(`Only 1 of integrationNames OR dataSiloIds can be provided`);e.info(d.magenta(`Fetching data with page size ${R}...`));let[V,De,H,U,W,G,K,q,Oe,J,ke,Ae,Y,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,X,$e,et]=await Promise.all([L.includes(`dataSilos`)||L.includes(`dataSubjects`)?E(f,{logger:e}):[],L.includes(`apiKeys`)?ge(f,{fetchAll:!0,logger:e}):[],L.includes(`dataSilos`)?Se(f,{ids:A,integrationNames:N,pageSize:R,debug:P,includeGuessedCategories:z,skipDatapoints:Te,skipSubDatapoints:Ee,logger:e}):[],L.includes(`enrichers`)?D(f,{logger:e}):[],L.includes(`dataFlows`)?[...B.includes(n.Live)?await T(f,{logger:e,filterBy:{status:n.Live}}):[],...B.includes(n.NeedsReview)?await T(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],L.includes(`cookies`)?[...B.includes(n.Live)?await C(f,{logger:e,filterBy:{status:n.Live}}):[],...B.includes(n.NeedsReview)?await C(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],L.includes(`customFields`)?x(f,{logger:e}):[],L.includes(`templates`)?pe(f,{logger:e}):[],L.includes(`identifiers`)?ee(f,{logger:e}):[],L.includes(`actions`)?g(f,{logger:e}):[],L.includes(`businessEntities`)?S(f,{logger:e}):[],L.includes(`processingActivities`)?ae(f,{logger:e}):[],L.includes(`consentManager`)?_e(f,{logger:e}):void 0,L.includes(`consentManager`)?ve(f,{logger:e}):[],L.includes(`consentManager`)?xe(f,{logger:e}):[],L.includes(`consentManager`)?be(f,{logger:e}):[],L.includes(`prompts`)?le(f,{logger:e}):[],L.includes(`promptPartials`)?ce(f,{logger:e}):[],L.includes(`promptGroups`)?se(f,{logger:e}):[],L.includes(`agents`)?y(f,{logger:e}):[],L.includes(`agentFunctions`)?v(f,{logger:e}):[],L.includes(`agentFiles`)?_(f,{logger:e}):[],L.includes(`vendors`)?me(f,{logger:e}):[],L.includes(`dataCategories`)?w(f,{logger:e}):[],L.includes(`processingPurposes`)?oe(f,{logger:e}):[],L.includes(`actionItems`)?h(f,{logger:e,filterBy:{type:[t.Onboarding]}}):[],L.includes(`actionItemCollections`)?m(f,{logger:e}):[],L.includes(`teams`)?fe(f,{logger:e}):[],L.includes(`policies`)?ne(f,{logger:e}):[],L.includes(`privacyCenters`)?ie(f,{logger:e}):[],L.includes(`messages`)?te(f,{logger:e}):[],L.includes(`partitions`)?Ce(f,{logger:e}):[],L.includes(`assessments`)?b(f,{logger:e}):[],L.includes(`assessmentTemplates`)?F(f):[],L.includes(`purposes`)?ue(f,{logger:e}):[],L.includes(`workflowConfigs`)?he(f,{logger:e,workflowConfigType:o.DSR}):[],L.includes(`preferenceOptions`)?re(f,{logger:e}):[],L.includes(`systemDiscovery`)?de(f,{logger:e}):[]]),Z=L.includes(`consentManager`)&&Y?await ye(f,{logger:e,filterBy:{airgapBundleId:Y.id}}):void 0,Q={},tt=s(H.map(([{apiKeys:e}])=>e.map(({title:e})=>e))),$=Object.values(De).filter(({title:e})=>L.includes(`apiKeys`)?!0:tt.includes(e));if($.length>0&&L.includes(`apiKeys`)&&(Q[`api-keys`]=$.map(({title:e})=>({title:e}))),Ye.length>0&&L.includes(`partitions`)&&(Q.partitions=Ye.map(({name:e,partition:t})=>({name:e,partition:t}))),Y&&L.includes(`consentManager`)&&(Q[`consent-manager`]={bundleUrls:{TEST:Y.testBundleURL,PRODUCTION:Y.bundleURL},domains:Y.configuration.domains||void 0,partition:Y.configuration.partition||void 0,consentPrecedence:Y.configuration.consentPrecedence||void 0,unknownRequestPolicy:Y.configuration.unknownRequestPolicy||void 0,unknownCookiePolicy:Y.configuration.unknownCookiePolicy||void 0,syncEndpoint:Y.configuration.syncEndpoint||void 0,telemetryPartitioning:Y.configuration.telemetryPartitioning||void 0,signedIabAgreement:Y.configuration.signedIabAgreement||void 0,syncGroups:Y.configuration.syncGroups||void 0,theme:Z?{primaryColor:Z.primaryColor||void 0,fontColor:Z.fontColor||void 0,privacyPolicy:Z.privacyPolicy||void 0,prompt:Z.prompt}:void 0,experiences:je.map(e=>({name:e.name,displayName:e.displayName||void 0,regions:e.regions.map(e=>({countrySubDivision:e.countrySubDivision||void 0,country:e.country||void 0})),onConsentExpiry:e.onConsentExpiry,consentExpiry:e.consentExpiry,operator:e.operator,displayPriority:e.displayPriority,viewState:e.viewState,purposes:e.purposes.map(e=>({trackingType:e.trackingType})),optedOutPurposes:e.optedOutPurposes.map(e=>({trackingType:e.trackingType})),browserLanguages:e.browserLanguages,browserTimeZones:e.browserTimeZones,consentUiVariantSlug:e.consentUiVariant?.slug})),consentVariants:Me.map(e=>({id:e.id,name:e.name,slug:e.slug,description:e.description,configuration:JSON.stringify(e.configuration),locales:e.locales,status:e.status,userFlow:e.userFlow,themeSlug:e.theme?.slug})),consentThemes:Ne.map(e=>({id:e.id,name:e.name,slug:e.slug,configuration:JSON.stringify(e.configuration)}))}),Xe.length>0&&L.includes(`assessments`)&&(Q.assessments=Xe.map(({title:e,assessmentGroup:t,sections:n,creator:r,description:i,status:a,assignees:o,externalAssignees:s,reviewers:c,isLocked:l,isArchived:u,isExternallyCreated:d,dueDate:f,createdAt:p,assignedAt:m,submittedAt:h,approvedAt:g,rejectedAt:_,titleIsInternal:v,retentionSchedule:y,attributeValues:b,resources:x,syncedRows:S})=>({title:e,group:t.title,sections:n.map(({title:e,status:t,questions:n,assignees:r,isReviewed:i,externalAssignees:a})=>({title:e,status:t,questions:n.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,selectedAnswers:f,allowedMimeTypes:p,allowSelectOther:m,syncModel:h,syncColumn:g,attributeKey:_,requireRiskEvaluation:v,requireRiskMatrixEvaluation:y})=>{let b=s?j(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":b&&Object.keys(b).length>0?{action:b.action,rule:b.rule?{"depends-on-question-reference-id":b.rule.dependsOnQuestionReferenceId,"comparison-operator":b.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in b.rule?b.rule.comparisonOperands:void 0}:void 0,"nested-rule":b.nestedRule?{"logic-operator":b.nestedRule.logicOperator,rules:(b.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=M(e);return{"risk-level":t.riskAssignment?.riskLevelId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"selected-answers":f.map(({value:e})=>e),"allowed-mime-types":p,"allow-select-other":m,"sync-model":h||void 0,"sync-column":g||void 0,"attribute-key":_?.name,"require-risk-evaluation":v,"require-risk-matrix-evaluation":y}}),assignees:r.map(({email:e})=>e),"external-assignees":a.map(({email:e})=>e),"is-reviewed":i})),creator:r?.email,description:i,status:a,assignees:o.map(({email:e})=>e),"external-assignees":s.map(({email:e})=>e),reviewers:c.map(({email:e})=>e),locked:l,archived:u,external:d,"title-is-internal":v,"due-date":f||void 0,"created-at":p||void 0,"assigned-at":m||void 0,"submitted-at":h||void 0,"approved-at":g||void 0,"rejected-at":_||void 0,"retention-schedule":y?{type:y.type,"duration-days":y.durationDays,operand:y.operation}:void 0,attributes:b!==void 0&&b.length>0?O(b):void 0,resources:x.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``})),rows:S.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``}))}))),Ze.length>0&&L.includes(`assessmentTemplates`)&&(Q[`assessment-templates`]=Ze.map(({title:e,description:t,sections:n,status:r,source:i,creator:a,isLocked:o,isArchived:s,createdAt:c,retentionSchedule:l})=>({title:e,description:t,sections:n.map(({title:e,questions:t})=>({title:e,questions:t.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,allowedMimeTypes:f,allowSelectOther:p,syncModel:m,syncColumn:h,attributeKey:g,requireRiskEvaluation:_,requireRiskMatrixEvaluation:v})=>{let y=s?j(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":y&&Object.keys(y).length>0?{action:y.action,rule:y.rule?{"depends-on-question-reference-id":y.rule.dependsOnQuestionReferenceId,"comparison-operator":y.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in y.rule?y.rule.comparisonOperands:void 0}:void 0,"nested-rule":y.nestedRule?{"logic-operator":y.nestedRule.logicOperator,rules:(y.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=M(e);return{"risk-level":t.riskAssignment?.riskLevelId,"risk-matrix-row":t.riskAssignment?.riskMatrixRowId,"risk-matrix-column":t.riskAssignment?.riskMatrixColumnId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"allowed-mime-types":f,"allow-select-other":p,"sync-model":m||void 0,"sync-column":h||void 0,"attribute-key":g?.name,"require-risk-evaluation":_,"require-risk-matrix-evaluation":v}})})),status:r,source:i,creator:a?.email,locked:o,archived:s,"created-at":c||void 0,"retention-schedule":l?{type:l.type,"duration-days":l.durationDays,operand:l.operation}:void 0}))),et.length>0&&L.includes(`systemDiscovery`)&&(Q[`system-discovery`]=et.map(({title:e,resourceId:t,suggestedCatalog:{title:n},plugin:{dataSilo:{title:r}},country:i,countrySubDivision:a,plaintextContext:o,containsSensitiveData:s,status:c})=>({title:e,resourceId:t,suggestedCatalog:n,plugin:r,country:i||void 0,countrySubDivision:a||void 0,plaintextContext:o,containsSensitiveData:s,status:c}))),Pe.length>0&&L.includes(`prompts`)&&(Q.prompts=Pe.map(({title:e,content:t})=>({title:e,content:t}))),Fe.length>0&&L.includes(`promptPartials`)&&(Q[`prompt-partials`]=Fe.map(({title:e,content:t})=>({title:e,content:t}))),Ie.length>0&&L.includes(`promptGroups`)&&(Q[`prompt-groups`]=Ie.map(({title:e,description:t,prompts:n})=>({title:e,description:t,prompts:n.map(({title:e})=>e)}))),Ge.length>0&&L.includes(`teams`)&&(Q.teams=Ge.map(({name:e,description:t,ssoDepartment:n,ssoGroup:r,ssoTitle:i,users:a,scopes:o,parentTeam:s})=>({name:e,description:t,"sso-department":n||void 0,"sso-group":r||void 0,"sso-title":i||void 0,"parent-team-name":s?.name,users:a.map(({email:e})=>e),scopes:o.map(({name:e})=>e)}))),V.length>0&&L.includes(`dataSubjects`)&&(Q[`data-subjects`]=V.map(({type:e,title:t,active:n,adminDashboardDefaultSilentMode:r,actions:i})=>({type:e,title:t?.defaultMessage,active:n,adminDashboardDefaultSilentMode:r,actions:i.map(({type:e})=>e)}))),Ke.length>0&&(Q.policies=Ke.map(({title:e,versions:t,disabledLocales:n})=>({title:e?.defaultMessage,content:t?.[0]?.content?.defaultMessage,disabledLocales:n}))),Je.length>0&&(Q.messages=Je.map(({id:e,defaultMessage:t,targetReactIntlId:n,description:r,translations:i})=>({id:e,defaultMessage:t,description:r,targetReactIntlId:n||void 0,translations:i.reduce((e,{locale:t,value:n})=>Object.assign(e,{[t]:n}),{})}))),qe.length>0){let e=qe[0];Q[`privacy-center`]={isDisabled:e.isDisabled,showPrivacyRequestButton:e.showPrivacyRequestButton,showPolicies:e.showPolicies,showTrackingTechnologies:e.showTrackingTechnologies,showCookies:e.showCookies,showDataFlows:e.showDataFlows,showConsentManager:e.showConsentManager,showManageYourPrivacy:e.showManageYourPrivacy,showMarketingPreferences:e.showMarketingPreferences,locales:e.locales,defaultLocale:e.defaultLocale,preferBrowserDefaultLocale:e.preferBrowserDefaultLocale,supportEmail:e.supportEmail||void 0,replyToEmail:e.replyToEmail||void 0,useNoReplyEmailAddress:e.useNoReplyEmailAddress,useCustomEmailDomain:e.useCustomEmailDomain,transformAccessReportJsonToCsv:e.transformAccessReportJsonToCsv,theme:e.theme}}if(ke.length>0&&L.includes(`businessEntities`)&&(Q[`business-entities`]=ke.map(({title:e,description:t,address:n,headquarterCountry:r,headquarterSubDivision:i,dataProtectionOfficerName:a,dataProtectionOfficerEmail:o,attributeValues:s})=>({title:e,description:t||void 0,address:n||void 0,headquarterCountry:r||void 0,headquarterSubDivision:i||void 0,dataProtectionOfficerName:a||void 0,dataProtectionOfficerEmail:o||void 0,attributes:s!==void 0&&s.length>0?O(s):void 0}))),Ae.length>0&&L.includes(`processingActivities`)&&(Q[`processing-activities`]=Ae.map(({title:e,description:t,securityMeasureDetails:n,controllerships:r,storageRegions:i,transferRegions:o,retentionType:s,retentionPeriod:c,dataProtectionImpactAssessmentLink:l,dataProtectionImpactAssessmentStatus:u,attributeValues:d,dataSilos:f,dataSubjects:p,teams:m,owners:h,processingPurposeSubCategories:g,dataSubCategories:_,saaSCategories:v})=>({title:e,description:t,securityMeasureDetails:n??void 0,controllerships:r.length>0?r:void 0,storageRegions:i.length>0?k(i):void 0,transferRegions:o.length>0?k(o):void 0,retentionType:s,retentionPeriod:s===a.StatedPeriod?c:void 0,dataProtectionImpactAssessmentLink:l??void 0,dataProtectionImpactAssessmentStatus:u,attributes:d!==void 0&&d.length>0?O(d):void 0,dataSiloTitles:f.length>0?f.map(({title:e})=>e):void 0,dataSubjectTypes:p.length>0?p.map(({type:e})=>e):void 0,teamNames:m.length>0?m.map(({name:e})=>e):void 0,ownerEmails:h.length>0?h.map(({email:e})=>e):void 0,processingSubPurposes:g.length>0?g.map(({name:e,purpose:t})=>({purpose:t,...e?{name:e}:{}})):void 0,dataSubCategories:_.length>0?_.map(({name:e,category:t})=>({category:t,...e?{name:e}:{}})):void 0,saaSCategories:v.length>0?v.map(({title:e})=>e):void 0}))),J.length>0&&L.includes(`actions`)&&(Q.actions=J.map(({type:e,skipSecondaryIfNoFiles:t,skipDownloadableStep:n,requiresReview:r,regionList:a,regionDetectionMethod:o,waitingPeriod:s})=>({type:e,...e===i.Erasure?{skipSecondaryIfNoFiles:t,skipDownloadableStep:n}:{},requiresReview:r,waitingPeriod:s,regionDetectionMethod:o,regionList:a.length>0?a:void 0}))),Oe.length>0&&L.includes(`identifiers`)&&(Q.identifiers=Oe.map(({name:e,type:t,regex:n,selectOptions:r,privacyCenterVisibility:i,isRequiredInForm:a,placeholder:o,displayTitle:s,dataSubjects:c,displayDescription:l,displayOrder:u,isUniqueOnPreferenceStore:d})=>({name:e,type:t,regex:n,selectOptions:r.length>0?r:void 0,privacyCenterVisibility:i.length>0?i:void 0,isRequiredInForm:a,placeholder:o||void 0,dataSubjects:c.length>0?c.map(({type:e})=>e):void 0,displayTitle:s?.defaultMessage,displayDescription:l?.defaultMessage,displayOrder:u,isUniqueOnPreferenceStore:d}))),Le.length>0&&L.includes(`agents`)&&(Q.agents=Le.map(({name:e,agentId:t,description:n,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o,largeLanguageModel:s,teams:c,owners:l,agentFunctions:u,agentFiles:d})=>({name:e,agentId:t,description:n||void 0,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o?.title,"large-language-model":{name:s.name,client:s.client},teams:c&&c.length>0?c.map(({name:e})=>e):void 0,owners:l&&l.length>0?l.map(({email:e})=>e):void 0,"agent-functions":u&&u.length>0?u.map(({name:e})=>e):void 0,"agent-files":d&&d.length>0?d.map(({name:e})=>e):void 0}))),Ue.length>0&&L.includes(`actionItems`)&&(Q[`action-items`]=Ue.map(({teams:e,users:t,customerExperienceActionItemIds:[n],dueDate:r,priority:i,resolved:a,collections:o,notes:s,link:c,title:l,type:u,attributeValues:d})=>({teams:e.map(({name:e})=>e),users:t.map(({email:e})=>e),dueDate:r||void 0,title:l,notes:s,customerExperienceActionItemId:n,collections:o.map(({title:e})=>e),link:c,priority:i||void 0,resolved:a,type:u,attributes:d!==void 0&&d.length>0?O(d):void 0}))),We.length>0&&L.includes(`actionItemCollections`)&&(Q[`action-item-collections`]=We.map(({title:e,description:t,hidden:n,productLine:r})=>({title:e,description:t||void 0,hidden:n,productLine:r}))),Re.length>0&&L.includes(`agentFunctions`)&&(Q[`agent-functions`]=Re.map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:JSON.stringify(n)}))),ze.length>0&&L.includes(`agentFiles`)&&(Q[`agent-files`]=ze.map(({name:e,description:t,fileId:n,size:r,purpose:i})=>({name:e,description:t,fileId:n,size:r,purpose:i}))),Be.length>0&&L.includes(`vendors`)&&(Q.vendors=Be.map(({title:e,description:t,dataProcessingAgreementLink:n,contactName:r,contactPhone:i,address:a,headquarterCountry:o,headquarterSubDivision:s,websiteUrl:c,businessEntity:l,teams:u,owners:d,attributeValues:f})=>({title:e,description:t||void 0,dataProcessingAgreementLink:n||void 0,contactName:r||void 0,contactPhone:i||void 0,address:a||void 0,headquarterCountry:o||void 0,headquarterSubDivision:s||void 0,websiteUrl:c||void 0,businessEntity:l?.title,teams:u&&u.length>0?u.map(({name:e})=>e):void 0,owners:d&&d.length>0?d.map(({email:e})=>e):void 0,attributes:f!==void 0&&f.length>0?O(f):void 0}))),Ve.length>0&&L.includes(`dataCategories`)&&(Q[`data-categories`]=Ve.map(({name:e,category:t,description:n,regex:r,owners:i,teams:a,attributeValues:o})=>({name:e,category:t,description:n||void 0,regex:r||void 0,owners:i&&i.length>0?i.map(({email:e})=>e):void 0,teams:a&&a.length>0?a.map(({name:e})=>e):void 0,attributes:o!==void 0&&o.length>0?O(o):void 0}))),He.length>0&&L.includes(`processingPurposes`)&&(Q[`processing-purposes`]=He.map(({name:e,purpose:t,description:n,owners:r,teams:i,attributeValues:a})=>({name:e,purpose:t,description:n||void 0,owners:r&&r.length>0?r.map(({email:e})=>e):void 0,teams:i&&i.length>0?i.map(({name:e})=>e):void 0,attributes:a!==void 0&&a.length>0?O(a):void 0}))),W.length>0&&L.includes(`dataFlows`)&&(Q[`data-flows`]=W.map(({value:e,type:t,description:n,trackingType:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({value:e,type:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?O(c):void 0}))),G.length>0&&L.includes(`cookies`)&&(Q.cookies=G.map(({name:e,isRegex:t,description:n,trackingPurposes:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({name:e,isRegex:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?O(c):void 0}))),K.length>0&&L.includes(`customFields`)&&(Q.attributes=K.map(({description:e,name:t,type:n,values:r,enabledOn:i=[]})=>({description:e||void 0,resources:i,name:t,type:n,values:r.map(({name:e,color:t,description:n})=>({name:e,color:t||void 0,description:n}))}))),Qe.length>0&&(Q.purposes=Qe.map(({name:e,description:t,trackingType:n,defaultConsent:i,configurable:a,showInConsentManager:o,isActive:s,displayOrder:c,optOutSignals:l,authLevel:u,topics:d,showInPrivacyCenter:f,title:p})=>({name:e,title:p,description:t||void 0,trackingType:n,"default-consent":i,configurable:a,"show-in-consent-manager":o,"show-in-privacy-center":f,"is-active":s,"display-order":c,"opt-out-signals":l.length>0?l:void 0,"auth-level":u||void 0,"preference-topics":d.map(({slug:e,title:t,type:n,color:i,displayDescription:a,defaultConfiguration:o,showInPrivacyCenter:s,preferenceOptionValues:c})=>({slug:e,title:t.defaultMessage,type:n,color:i,description:a.defaultMessage,"default-configuration":o,"show-in-privacy-center":s,options:n===r.Boolean?[]:c.map(({title:e,slug:t})=>({title:e.defaultMessage,slug:t}))}))}))),X.length>0&&L.includes(`workflowConfigs`)){let t=X.map(e=>({title:e.title.defaultMessage,"action-type":e.action.type,...e.internalName?{"internal-name":e.internalName}:{},...e.subtitle?{subtitle:e.subtitle.defaultMessage}:{},...e.description?{description:e.description.defaultMessage}:{},...e.subject?{"data-subject-type":e.subject.type}:{},visibility:e.workflowConfigVisibility,type:e.workflowConfigType,...e.collectDataSubjectRegions?{"collect-data-subject-regions":e.collectDataSubjectRegions}:{},...e.regionList.length>0?{"region-list":e.regionList}:{},...e.expiryTime&&e.expiryTime.length>0?{"expiry-time":e.expiryTime}:{},...e.WorkflowConfigAttributeKeys&&e.WorkflowConfigAttributeKeys.length>0?{"attribute-keys":e.WorkflowConfigAttributeKeys.map(({attributeKey:e})=>e.name)}:{}})),n=c(X,we);for(let t of Object.values(n))if(t.length>1){let n=t[0];e.warn(`Found "${t.length}" workflow configs with the same title, action-type, data-subject-type, and region-list for "${n.title.defaultMessage}" (${n.action.type}). Push will fail until they are disambiguated (for example with unique internal names).`)}t.length>0&&(Q[`workflow-configs`]=t)}if($e.length>0&&L.includes(`preferenceOptions`)&&(Q[`preference-options`]=$e.map(({slug:e,title:t})=>({slug:e,title:t.defaultMessage}))),A.length===0&&q.length>0&&L.includes(`templates`)&&(Q.templates=q.map(({title:e})=>({title:e}))),U.length>0&&L.includes(`enrichers`)&&(Q.enrichers=U.map(({title:e,url:t,type:n,inputIdentifier:r,identifiers:a,actions:o,testRegex:s,dataSubjects:c,expirationDuration:l,lookerQueryTitle:u,transitionRequestStatus:d,phoneNumbers:f,regionList:p})=>({title:e,url:t||void 0,type:n,"input-identifier":r?.name,"output-identifiers":a.map(({name:e})=>e),"privacy-actions":Object.values(i).length===o.length?void 0:o,testRegex:s||void 0,lookerQueryTitle:u||void 0,expirationDuration:parseInt(l,10),transitionRequestStatus:d||void 0,phoneNumbers:f&&f.length>0?f:void 0,regionList:p&&p.length>0?p:void 0,"data-subjects":c.map(({type:e})=>e)}))),H.length>0&&L.includes(`dataSilos`)){let e=l(V,`type`);Q[`data-silos`]=H.map(([{title:t,description:n,url:r,type:i,outerType:a,apiKeys:o,notifyEmailAddress:s,identifiers:c,dependentDataSilos:d,owners:f,country:m,countrySubDivision:h,teams:g,subjectBlocklist:_,isLive:v,promptAVendorEmailSendFrequency:y,promptAVendorEmailSendType:b,promptAVendorEmailIncludeIdentifiersAttachment:x,promptAVendorEmailCompletionLinkType:S,manualWorkRetryFrequency:C,catalog:w,attributeValues:T,discoveredBy:E,businessEntities:D},ee])=>({title:t,description:n,integrationName:i,"outer-type":a||void 0,url:r||void 0,"api-key-title":o[0]?.title,"identity-keys":c.filter(({isConnected:e})=>e).map(({name:e})=>e),...d.length>0?{"deletion-dependencies":d.map(({title:e})=>e)}:{},...f.length>0?{owners:f.map(({email:e})=>e)}:{},...g.length>0?{teams:g.map(({name:e})=>e)}:{},...E.length>0?{discoveredBy:E.map(({title:e})=>e)}:{},...D.length>0?{businessEntities:D.map(({title:e})=>e)}:{},country:m||void 0,countrySubDivision:h||void 0,disabled:!v,"data-subjects":_.length>0?p(_.map(({type:e})=>e),e):void 0,...w.hasAvcFunctionality?{"email-settings":{"notify-email-address":s||void 0,"send-frequency":y,"send-type":b,"include-identifiers-attachment":x,"completion-link-type":S,"manual-work-retry-frequency":C}}:{},attributes:T!==void 0&&T.length>0?O(T):void 0,datapoints:ee.map(e=>({key:e.name,title:e.title?.defaultMessage,description:e.description?.defaultMessage,owners:e.owners.map(({email:e})=>e),teams:e.teams.map(({name:e})=>e),...e.path.length>0?{path:e.path}:{},...e.dataCollection?.title?{"data-collection-tag":e.dataCollection.title.defaultMessage}:{},...e.dbIntegrationQueries.length>0?{"privacy-action-queries":u(l(e.dbIntegrationQueries,`requestType`),e=>e.suggestedQuery||e.query||void 0)}:{},...e.subDataPoints.length>0?{fields:e.subDataPoints.map(e=>({key:e.name,description:e.description,purposes:e.purposes,categories:e.categories,...z&&e.pendingCategoryGuesses?{"guessed-categories":e.pendingCategoryGuesses.filter(e=>e.status===`PENDING`).map(e=>({category:{name:e.category.name,category:e.category.category},status:e.status,confidence:e.confidence,classifierVersion:e.classifierVersion||void 0}))}:{},"access-request-visibility-enabled":e.accessRequestVisibilityEnabled,"erasure-request-redaction-enabled":e.erasureRequestRedactionEnabled,attributes:e.attributeValues!==void 0&&e.attributeValues.length>0?O(e.attributeValues):void 0})).sort((e,t)=>e.key.localeCompare(t.key))}:{},"privacy-actions":e.actionSettings.filter(({active:e})=>e).map(({type:e})=>e)})).sort((e,t)=>[...e.path??[],e.key].join(`.`).localeCompare([...t.path??[],t.key].join(`.`)))}))}return Q}export{P as i,L as n,F as r,I as t};
|
|
58
|
-
//# sourceMappingURL=pullTranscendConfiguration-
|
|
57
|
+
`;async function F(t){let n=[],r=0,i=!1;do{let{assessmentFormTemplates:{nodes:a}}=await A(t,P,{variables:{first:20,offset:r},logger:e});n.push(...a),r+=20,i=a.length===20}while(i);return n.sort((e,t)=>e.title.localeCompare(t.title))}const I=[`dataSilos`,`enrichers`,`templates`,`apiKeys`];async function L(f,{dataSiloIds:A,integrationNames:N,debug:P,resources:L=I,pageSize:R,skipDatapoints:Te,includeGuessedCategories:z,skipSubDatapoints:Ee,trackerStatuses:B=Object.values(n)}){if(A.length>0&&N.length>0)throw Error(`Only 1 of integrationNames OR dataSiloIds can be provided`);e.info(d.magenta(`Fetching data with page size ${R}...`));let[V,De,H,U,W,G,K,q,Oe,J,ke,Ae,Y,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,X,$e,et]=await Promise.all([L.includes(`dataSilos`)||L.includes(`dataSubjects`)?E(f,{logger:e}):[],L.includes(`apiKeys`)?ge(f,{fetchAll:!0,logger:e}):[],L.includes(`dataSilos`)?Se(f,{ids:A,integrationNames:N,pageSize:R,debug:P,includeGuessedCategories:z,skipDatapoints:Te,skipSubDatapoints:Ee,logger:e}):[],L.includes(`enrichers`)?D(f,{logger:e}):[],L.includes(`dataFlows`)?[...B.includes(n.Live)?await T(f,{logger:e,filterBy:{status:n.Live}}):[],...B.includes(n.NeedsReview)?await T(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],L.includes(`cookies`)?[...B.includes(n.Live)?await C(f,{logger:e,filterBy:{status:n.Live}}):[],...B.includes(n.NeedsReview)?await C(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],L.includes(`customFields`)?x(f,{logger:e}):[],L.includes(`templates`)?pe(f,{logger:e}):[],L.includes(`identifiers`)?ee(f,{logger:e}):[],L.includes(`actions`)?g(f,{logger:e}):[],L.includes(`businessEntities`)?S(f,{logger:e}):[],L.includes(`processingActivities`)?ae(f,{logger:e}):[],L.includes(`consentManager`)?_e(f,{logger:e}):void 0,L.includes(`consentManager`)?ve(f,{logger:e}):[],L.includes(`consentManager`)?xe(f,{logger:e}):[],L.includes(`consentManager`)?be(f,{logger:e}):[],L.includes(`prompts`)?le(f,{logger:e}):[],L.includes(`promptPartials`)?ce(f,{logger:e}):[],L.includes(`promptGroups`)?se(f,{logger:e}):[],L.includes(`agents`)?y(f,{logger:e}):[],L.includes(`agentFunctions`)?v(f,{logger:e}):[],L.includes(`agentFiles`)?_(f,{logger:e}):[],L.includes(`vendors`)?me(f,{logger:e}):[],L.includes(`dataCategories`)?w(f,{logger:e}):[],L.includes(`processingPurposes`)?oe(f,{logger:e}):[],L.includes(`actionItems`)?h(f,{logger:e,filterBy:{type:[t.Onboarding]}}):[],L.includes(`actionItemCollections`)?m(f,{logger:e}):[],L.includes(`teams`)?fe(f,{logger:e}):[],L.includes(`policies`)?ne(f,{logger:e}):[],L.includes(`privacyCenters`)?ie(f,{logger:e}):[],L.includes(`messages`)?te(f,{logger:e}):[],L.includes(`partitions`)?Ce(f,{logger:e}):[],L.includes(`assessments`)?b(f,{logger:e}):[],L.includes(`assessmentTemplates`)?F(f):[],L.includes(`purposes`)?ue(f,{logger:e}):[],L.includes(`workflowConfigs`)?he(f,{logger:e,workflowConfigType:o.DSR}):[],L.includes(`preferenceOptions`)?re(f,{logger:e}):[],L.includes(`systemDiscovery`)?de(f,{logger:e}):[]]),Z=L.includes(`consentManager`)&&Y?await ye(f,{logger:e,filterBy:{airgapBundleId:Y.id}}):void 0,Q={},tt=s(H.map(([{apiKeys:e}])=>e.map(({title:e})=>e))),$=Object.values(De).filter(({title:e})=>L.includes(`apiKeys`)?!0:tt.includes(e));if($.length>0&&L.includes(`apiKeys`)&&(Q[`api-keys`]=$.map(({title:e})=>({title:e}))),Ye.length>0&&L.includes(`partitions`)&&(Q.partitions=Ye.map(({name:e,partition:t})=>({name:e,partition:t}))),Y&&L.includes(`consentManager`)&&(Q[`consent-manager`]={bundleUrls:{TEST:Y.testBundleURL,PRODUCTION:Y.bundleURL},domains:Y.configuration.domains||void 0,partition:Y.configuration.partition||void 0,consentPrecedence:Y.configuration.consentPrecedence||void 0,unknownRequestPolicy:Y.configuration.unknownRequestPolicy||void 0,unknownCookiePolicy:Y.configuration.unknownCookiePolicy||void 0,syncEndpoint:Y.configuration.syncEndpoint||void 0,telemetryPartitioning:Y.configuration.telemetryPartitioning||void 0,signedIabAgreement:Y.configuration.signedIabAgreement||void 0,syncGroups:Y.configuration.syncGroups||void 0,theme:Z?{primaryColor:Z.primaryColor||void 0,fontColor:Z.fontColor||void 0,privacyPolicy:Z.privacyPolicy||void 0,prompt:Z.prompt}:void 0,experiences:je.map(e=>({name:e.name,displayName:e.displayName||void 0,regions:e.regions.map(e=>({countrySubDivision:e.countrySubDivision||void 0,country:e.country||void 0})),onConsentExpiry:e.onConsentExpiry,consentExpiry:e.consentExpiry,operator:e.operator,displayPriority:e.displayPriority,viewState:e.viewState,purposes:e.purposes.map(e=>({trackingType:e.trackingType})),optedOutPurposes:e.optedOutPurposes.map(e=>({trackingType:e.trackingType})),browserLanguages:e.browserLanguages,browserTimeZones:e.browserTimeZones,consentUiVariantSlug:e.consentUiVariant?.slug})),consentVariants:Me.map(e=>({id:e.id,name:e.name,slug:e.slug,description:e.description,configuration:JSON.stringify(e.configuration),locales:e.locales,status:e.status,userFlow:e.userFlow,themeSlug:e.theme?.slug})),consentThemes:Ne.map(e=>({id:e.id,name:e.name,slug:e.slug,configuration:JSON.stringify(e.configuration)}))}),Xe.length>0&&L.includes(`assessments`)&&(Q.assessments=Xe.map(({title:e,assessmentGroup:t,sections:n,creator:r,description:i,status:a,assignees:o,externalAssignees:s,reviewers:c,isLocked:l,isArchived:u,isExternallyCreated:d,dueDate:f,createdAt:p,assignedAt:m,submittedAt:h,approvedAt:g,rejectedAt:_,titleIsInternal:v,retentionSchedule:y,attributeValues:b,resources:x,syncedRows:S})=>({title:e,group:t.title,sections:n.map(({title:e,status:t,questions:n,assignees:r,isReviewed:i,externalAssignees:a})=>({title:e,status:t,questions:n.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,selectedAnswers:f,allowedMimeTypes:p,allowSelectOther:m,syncModel:h,syncColumn:g,attributeKey:_,requireRiskEvaluation:v,requireRiskMatrixEvaluation:y})=>{let b=s?j(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":b&&Object.keys(b).length>0?{action:b.action,rule:b.rule?{"depends-on-question-reference-id":b.rule.dependsOnQuestionReferenceId,"comparison-operator":b.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in b.rule?b.rule.comparisonOperands:void 0}:void 0,"nested-rule":b.nestedRule?{"logic-operator":b.nestedRule.logicOperator,rules:(b.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=M(e);return{"risk-level":t.riskAssignment?.riskLevelId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"selected-answers":f.map(({value:e})=>e),"allowed-mime-types":p,"allow-select-other":m,"sync-model":h||void 0,"sync-column":g||void 0,"attribute-key":_?.name,"require-risk-evaluation":v,"require-risk-matrix-evaluation":y}}),assignees:r.map(({email:e})=>e),"external-assignees":a.map(({email:e})=>e),"is-reviewed":i})),creator:r?.email,description:i,status:a,assignees:o.map(({email:e})=>e),"external-assignees":s.map(({email:e})=>e),reviewers:c.map(({email:e})=>e),locked:l,archived:u,external:d,"title-is-internal":v,"due-date":f||void 0,"created-at":p||void 0,"assigned-at":m||void 0,"submitted-at":h||void 0,"approved-at":g||void 0,"rejected-at":_||void 0,"retention-schedule":y?{type:y.type,"duration-days":y.durationDays,operand:y.operation}:void 0,attributes:b!==void 0&&b.length>0?O(b):void 0,resources:x.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``})),rows:S.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``}))}))),Ze.length>0&&L.includes(`assessmentTemplates`)&&(Q[`assessment-templates`]=Ze.map(({title:e,description:t,sections:n,status:r,source:i,creator:a,isLocked:o,isArchived:s,createdAt:c,retentionSchedule:l})=>({title:e,description:t,sections:n.map(({title:e,questions:t})=>({title:e,questions:t.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,allowedMimeTypes:f,allowSelectOther:p,syncModel:m,syncColumn:h,attributeKey:g,requireRiskEvaluation:_,requireRiskMatrixEvaluation:v})=>{let y=s?j(s):void 0;return{title:e,type:t,"sub-type":n,placeholder:r,description:i,"is-required":a,"reference-id":o,"display-logic":y&&Object.keys(y).length>0?{action:y.action,rule:y.rule?{"depends-on-question-reference-id":y.rule.dependsOnQuestionReferenceId,"comparison-operator":y.rule.comparisonOperator,"comparison-operands":`comparisonOperands`in y.rule?y.rule.comparisonOperands:void 0}:void 0,"nested-rule":y.nestedRule?{"logic-operator":y.nestedRule.logicOperator,rules:(y.nestedRule.rules||[]).map(e=>({"depends-on-question-reference-id":e.dependsOnQuestionReferenceId,"comparison-operator":e.comparisonOperator,"comparison-operands":`comparisonOperands`in e?e.comparisonOperands:void 0}))}:void 0}:void 0,"risk-logic":c.map(e=>{let t=M(e);return{"risk-level":t.riskAssignment?.riskLevelId,"risk-matrix-row":t.riskAssignment?.riskMatrixRowId,"risk-matrix-column":t.riskAssignment?.riskMatrixColumnId,"comparison-operands":t.comparisonOperands,"comparison-operator":t.comparisonOperator}}),"risk-categories":l.map(({title:e})=>e),"risk-framework":u?.title,"answer-options":d.map(({value:e})=>({value:e})),"allowed-mime-types":f,"allow-select-other":p,"sync-model":m||void 0,"sync-column":h||void 0,"attribute-key":g?.name,"require-risk-evaluation":_,"require-risk-matrix-evaluation":v}})})),status:r,source:i,creator:a?.email,locked:o,archived:s,"created-at":c||void 0,"retention-schedule":l?{type:l.type,"duration-days":l.durationDays,operand:l.operation}:void 0}))),et.length>0&&L.includes(`systemDiscovery`)&&(Q[`system-discovery`]=et.map(({title:e,resourceId:t,suggestedCatalog:{title:n},plugin:{dataSilo:{title:r}},country:i,countrySubDivision:a,plaintextContext:o,containsSensitiveData:s,status:c})=>({title:e,resourceId:t,suggestedCatalog:n,plugin:r,country:i||void 0,countrySubDivision:a||void 0,plaintextContext:o,containsSensitiveData:s,status:c}))),Pe.length>0&&L.includes(`prompts`)&&(Q.prompts=Pe.map(({title:e,content:t})=>({title:e,content:t}))),Fe.length>0&&L.includes(`promptPartials`)&&(Q[`prompt-partials`]=Fe.map(({title:e,content:t})=>({title:e,content:t}))),Ie.length>0&&L.includes(`promptGroups`)&&(Q[`prompt-groups`]=Ie.map(({title:e,description:t,prompts:n})=>({title:e,description:t,prompts:n.map(({title:e})=>e)}))),Ge.length>0&&L.includes(`teams`)&&(Q.teams=Ge.map(({name:e,description:t,ssoDepartment:n,ssoGroup:r,ssoTitle:i,users:a,scopes:o,parentTeam:s})=>({name:e,description:t,"sso-department":n||void 0,"sso-group":r||void 0,"sso-title":i||void 0,"parent-team-name":s?.name,users:a.map(({email:e})=>e),scopes:o.map(({name:e})=>e)}))),V.length>0&&L.includes(`dataSubjects`)&&(Q[`data-subjects`]=V.map(({type:e,title:t,active:n,adminDashboardDefaultSilentMode:r,actions:i})=>({type:e,title:t?.defaultMessage,active:n,adminDashboardDefaultSilentMode:r,actions:i.map(({type:e})=>e)}))),Ke.length>0&&(Q.policies=Ke.map(({title:e,versions:t,disabledLocales:n})=>({title:e?.defaultMessage,content:t?.[0]?.content?.defaultMessage,disabledLocales:n}))),Je.length>0&&(Q.messages=Je.map(({id:e,defaultMessage:t,targetReactIntlId:n,description:r,translations:i})=>({id:e,defaultMessage:t,description:r,targetReactIntlId:n||void 0,translations:i.reduce((e,{locale:t,value:n})=>Object.assign(e,{[t]:n}),{})}))),qe.length>0){let e=qe[0];Q[`privacy-center`]={isDisabled:e.isDisabled,showPrivacyRequestButton:e.showPrivacyRequestButton,showPolicies:e.showPolicies,showTrackingTechnologies:e.showTrackingTechnologies,showCookies:e.showCookies,showDataFlows:e.showDataFlows,showConsentManager:e.showConsentManager,showManageYourPrivacy:e.showManageYourPrivacy,showMarketingPreferences:e.showMarketingPreferences,locales:e.locales,defaultLocale:e.defaultLocale,preferBrowserDefaultLocale:e.preferBrowserDefaultLocale,supportEmail:e.supportEmail||void 0,replyToEmail:e.replyToEmail||void 0,useNoReplyEmailAddress:e.useNoReplyEmailAddress,useCustomEmailDomain:e.useCustomEmailDomain,transformAccessReportJsonToCsv:e.transformAccessReportJsonToCsv,home:e.home||void 0,expandSideMenuByDefault:e.expandSideMenuByDefault,workflowsCustomFieldsRequired:e.workflowsCustomFieldsRequired,footerLayout:e.footerLayout,...e.childOrganizations.length>0?{displayedChildOrganizationUris:e.childOrganizations.map(e=>e.uri)}:{},...e.footerLinks.length>0?{footerLinks:[...e.footerLinks].sort((e,t)=>e.displayOrder-t.displayOrder).map(e=>({title:e.title.defaultMessage,...e.url?{url:e.url}:{},...e.iconOnly?{iconOnly:e.iconOnly}:{}}))}:{},theme:e.theme}}if(ke.length>0&&L.includes(`businessEntities`)&&(Q[`business-entities`]=ke.map(({title:e,description:t,address:n,headquarterCountry:r,headquarterSubDivision:i,dataProtectionOfficerName:a,dataProtectionOfficerEmail:o,attributeValues:s})=>({title:e,description:t||void 0,address:n||void 0,headquarterCountry:r||void 0,headquarterSubDivision:i||void 0,dataProtectionOfficerName:a||void 0,dataProtectionOfficerEmail:o||void 0,attributes:s!==void 0&&s.length>0?O(s):void 0}))),Ae.length>0&&L.includes(`processingActivities`)&&(Q[`processing-activities`]=Ae.map(({title:e,description:t,securityMeasureDetails:n,controllerships:r,storageRegions:i,transferRegions:o,retentionType:s,retentionPeriod:c,dataProtectionImpactAssessmentLink:l,dataProtectionImpactAssessmentStatus:u,attributeValues:d,dataSilos:f,dataSubjects:p,teams:m,owners:h,processingPurposeSubCategories:g,dataSubCategories:_,saaSCategories:v})=>({title:e,description:t,securityMeasureDetails:n??void 0,controllerships:r.length>0?r:void 0,storageRegions:i.length>0?k(i):void 0,transferRegions:o.length>0?k(o):void 0,retentionType:s,retentionPeriod:s===a.StatedPeriod?c:void 0,dataProtectionImpactAssessmentLink:l??void 0,dataProtectionImpactAssessmentStatus:u,attributes:d!==void 0&&d.length>0?O(d):void 0,dataSiloTitles:f.length>0?f.map(({title:e})=>e):void 0,dataSubjectTypes:p.length>0?p.map(({type:e})=>e):void 0,teamNames:m.length>0?m.map(({name:e})=>e):void 0,ownerEmails:h.length>0?h.map(({email:e})=>e):void 0,processingSubPurposes:g.length>0?g.map(({name:e,purpose:t})=>({purpose:t,...e?{name:e}:{}})):void 0,dataSubCategories:_.length>0?_.map(({name:e,category:t})=>({category:t,...e?{name:e}:{}})):void 0,saaSCategories:v.length>0?v.map(({title:e})=>e):void 0}))),J.length>0&&L.includes(`actions`)&&(Q.actions=J.map(({type:e,skipSecondaryIfNoFiles:t,skipDownloadableStep:n,requiresReview:r,regionList:a,regionDetectionMethod:o,waitingPeriod:s})=>({type:e,...e===i.Erasure?{skipSecondaryIfNoFiles:t,skipDownloadableStep:n}:{},requiresReview:r,waitingPeriod:s,regionDetectionMethod:o,regionList:a.length>0?a:void 0}))),Oe.length>0&&L.includes(`identifiers`)&&(Q.identifiers=Oe.map(({name:e,type:t,regex:n,selectOptions:r,privacyCenterVisibility:i,isRequiredInForm:a,placeholder:o,displayTitle:s,dataSubjects:c,displayDescription:l,displayOrder:u,isUniqueOnPreferenceStore:d})=>({name:e,type:t,regex:n,selectOptions:r.length>0?r:void 0,privacyCenterVisibility:i.length>0?i:void 0,isRequiredInForm:a,placeholder:o||void 0,dataSubjects:c.length>0?c.map(({type:e})=>e):void 0,displayTitle:s?.defaultMessage,displayDescription:l?.defaultMessage,displayOrder:u,isUniqueOnPreferenceStore:d}))),Le.length>0&&L.includes(`agents`)&&(Q.agents=Le.map(({name:e,agentId:t,description:n,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o,largeLanguageModel:s,teams:c,owners:l,agentFunctions:u,agentFiles:d})=>({name:e,agentId:t,description:n||void 0,instructions:r,codeInterpreterEnabled:i,retrievalEnabled:a,prompt:o?.title,"large-language-model":{name:s.name,client:s.client},teams:c&&c.length>0?c.map(({name:e})=>e):void 0,owners:l&&l.length>0?l.map(({email:e})=>e):void 0,"agent-functions":u&&u.length>0?u.map(({name:e})=>e):void 0,"agent-files":d&&d.length>0?d.map(({name:e})=>e):void 0}))),Ue.length>0&&L.includes(`actionItems`)&&(Q[`action-items`]=Ue.map(({teams:e,users:t,customerExperienceActionItemIds:[n],dueDate:r,priority:i,resolved:a,collections:o,notes:s,link:c,title:l,type:u,attributeValues:d})=>({teams:e.map(({name:e})=>e),users:t.map(({email:e})=>e),dueDate:r||void 0,title:l,notes:s,customerExperienceActionItemId:n,collections:o.map(({title:e})=>e),link:c,priority:i||void 0,resolved:a,type:u,attributes:d!==void 0&&d.length>0?O(d):void 0}))),We.length>0&&L.includes(`actionItemCollections`)&&(Q[`action-item-collections`]=We.map(({title:e,description:t,hidden:n,productLine:r})=>({title:e,description:t||void 0,hidden:n,productLine:r}))),Re.length>0&&L.includes(`agentFunctions`)&&(Q[`agent-functions`]=Re.map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:JSON.stringify(n)}))),ze.length>0&&L.includes(`agentFiles`)&&(Q[`agent-files`]=ze.map(({name:e,description:t,fileId:n,size:r,purpose:i})=>({name:e,description:t,fileId:n,size:r,purpose:i}))),Be.length>0&&L.includes(`vendors`)&&(Q.vendors=Be.map(({title:e,description:t,dataProcessingAgreementLink:n,contactName:r,contactPhone:i,address:a,headquarterCountry:o,headquarterSubDivision:s,websiteUrl:c,businessEntity:l,teams:u,owners:d,attributeValues:f})=>({title:e,description:t||void 0,dataProcessingAgreementLink:n||void 0,contactName:r||void 0,contactPhone:i||void 0,address:a||void 0,headquarterCountry:o||void 0,headquarterSubDivision:s||void 0,websiteUrl:c||void 0,businessEntity:l?.title,teams:u&&u.length>0?u.map(({name:e})=>e):void 0,owners:d&&d.length>0?d.map(({email:e})=>e):void 0,attributes:f!==void 0&&f.length>0?O(f):void 0}))),Ve.length>0&&L.includes(`dataCategories`)&&(Q[`data-categories`]=Ve.map(({name:e,category:t,description:n,regex:r,owners:i,teams:a,attributeValues:o})=>({name:e,category:t,description:n||void 0,regex:r||void 0,owners:i&&i.length>0?i.map(({email:e})=>e):void 0,teams:a&&a.length>0?a.map(({name:e})=>e):void 0,attributes:o!==void 0&&o.length>0?O(o):void 0}))),He.length>0&&L.includes(`processingPurposes`)&&(Q[`processing-purposes`]=He.map(({name:e,purpose:t,description:n,owners:r,teams:i,attributeValues:a})=>({name:e,purpose:t,description:n||void 0,owners:r&&r.length>0?r.map(({email:e})=>e):void 0,teams:i&&i.length>0?i.map(({name:e})=>e):void 0,attributes:a!==void 0&&a.length>0?O(a):void 0}))),W.length>0&&L.includes(`dataFlows`)&&(Q[`data-flows`]=W.map(({value:e,type:t,description:n,trackingType:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({value:e,type:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?O(c):void 0}))),G.length>0&&L.includes(`cookies`)&&(Q.cookies=G.map(({name:e,isRegex:t,description:n,trackingPurposes:r,service:i,status:a,owners:o,teams:s,attributeValues:c})=>({name:e,isRegex:t,description:n||void 0,trackingPurposes:r,status:a,service:i?.integrationName,owners:o.map(({email:e})=>e),teams:s.map(({name:e})=>e),attributes:c!==void 0&&c.length>0?O(c):void 0}))),K.length>0&&L.includes(`customFields`)&&(Q.attributes=K.map(({description:e,name:t,type:n,values:r,enabledOn:i=[]})=>({description:e||void 0,resources:i,name:t,type:n,values:r.map(({name:e,color:t,description:n})=>({name:e,color:t||void 0,description:n}))}))),Qe.length>0&&(Q.purposes=Qe.map(({name:e,description:t,trackingType:n,defaultConsent:i,configurable:a,showInConsentManager:o,isActive:s,displayOrder:c,optOutSignals:l,authLevel:u,topics:d,showInPrivacyCenter:f,title:p})=>({name:e,title:p,description:t||void 0,trackingType:n,"default-consent":i,configurable:a,"show-in-consent-manager":o,"show-in-privacy-center":f,"is-active":s,"display-order":c,"opt-out-signals":l.length>0?l:void 0,"auth-level":u||void 0,"preference-topics":d.map(({slug:e,title:t,type:n,color:i,displayDescription:a,defaultConfiguration:o,showInPrivacyCenter:s,preferenceOptionValues:c})=>({slug:e,title:t.defaultMessage,type:n,color:i,description:a.defaultMessage,"default-configuration":o,"show-in-privacy-center":s,options:n===r.Boolean?[]:c.map(({title:e,slug:t})=>({title:e.defaultMessage,slug:t}))}))}))),X.length>0&&L.includes(`workflowConfigs`)){let t=X.map(e=>({title:e.title.defaultMessage,"action-type":e.action.type,...e.internalName?{"internal-name":e.internalName}:{},...e.subtitle?{subtitle:e.subtitle.defaultMessage}:{},...e.description?{description:e.description.defaultMessage}:{},...e.subject?{"data-subject-type":e.subject.type}:{},visibility:e.workflowConfigVisibility,type:e.workflowConfigType,...e.collectDataSubjectRegions?{"collect-data-subject-regions":e.collectDataSubjectRegions}:{},...e.regionList.length>0?{"region-list":e.regionList}:{},...e.expiryTime&&e.expiryTime.length>0?{"expiry-time":e.expiryTime}:{},...e.WorkflowConfigAttributeKeys&&e.WorkflowConfigAttributeKeys.length>0?{"attribute-keys":e.WorkflowConfigAttributeKeys.map(({attributeKey:e})=>e.name)}:{}})),n=c(X,we);for(let t of Object.values(n))if(t.length>1){let n=t[0];e.warn(`Found "${t.length}" workflow configs with the same title, action-type, data-subject-type, and region-list for "${n.title.defaultMessage}" (${n.action.type}). Push will fail until they are disambiguated (for example with unique internal names).`)}t.length>0&&(Q[`workflow-configs`]=t)}if($e.length>0&&L.includes(`preferenceOptions`)&&(Q[`preference-options`]=$e.map(({slug:e,title:t})=>({slug:e,title:t.defaultMessage}))),A.length===0&&q.length>0&&L.includes(`templates`)&&(Q.templates=q.map(({title:e})=>({title:e}))),U.length>0&&L.includes(`enrichers`)&&(Q.enrichers=U.map(({title:e,url:t,type:n,inputIdentifier:r,identifiers:a,actions:o,testRegex:s,dataSubjects:c,expirationDuration:l,lookerQueryTitle:u,transitionRequestStatus:d,phoneNumbers:f,regionList:p})=>({title:e,url:t||void 0,type:n,"input-identifier":r?.name,"output-identifiers":a.map(({name:e})=>e),"privacy-actions":Object.values(i).length===o.length?void 0:o,testRegex:s||void 0,lookerQueryTitle:u||void 0,expirationDuration:parseInt(l,10),transitionRequestStatus:d||void 0,phoneNumbers:f&&f.length>0?f:void 0,regionList:p&&p.length>0?p:void 0,"data-subjects":c.map(({type:e})=>e)}))),H.length>0&&L.includes(`dataSilos`)){let e=l(V,`type`);Q[`data-silos`]=H.map(([{title:t,description:n,url:r,type:i,outerType:a,apiKeys:o,notifyEmailAddress:s,identifiers:c,dependentDataSilos:d,owners:f,country:m,countrySubDivision:h,teams:g,subjectBlocklist:_,isLive:v,promptAVendorEmailSendFrequency:y,promptAVendorEmailSendType:b,promptAVendorEmailIncludeIdentifiersAttachment:x,promptAVendorEmailCompletionLinkType:S,manualWorkRetryFrequency:C,catalog:w,attributeValues:T,discoveredBy:E,businessEntities:D,sombra:ee},te])=>({title:t,description:n,integrationName:i,"outer-type":a||void 0,url:r||void 0,"api-key-title":o[0]?.title,"sombra-id":ee?.id||void 0,"identity-keys":c.filter(({isConnected:e})=>e).map(({name:e})=>e),...d.length>0?{"deletion-dependencies":d.map(({title:e})=>e)}:{},...f.length>0?{owners:f.map(({email:e})=>e)}:{},...g.length>0?{teams:g.map(({name:e})=>e)}:{},...E.length>0?{discoveredBy:E.map(({title:e})=>e)}:{},...D.length>0?{businessEntities:D.map(({title:e})=>e)}:{},country:m||void 0,countrySubDivision:h||void 0,disabled:!v,"data-subjects":_.length>0?p(_.map(({type:e})=>e),e):void 0,...w.hasAvcFunctionality?{"email-settings":{"notify-email-address":s||void 0,"send-frequency":y,"send-type":b,"include-identifiers-attachment":x,"completion-link-type":S,"manual-work-retry-frequency":C}}:{},attributes:T!==void 0&&T.length>0?O(T):void 0,datapoints:te.map(e=>({key:e.name,title:e.title?.defaultMessage,description:e.description?.defaultMessage,owners:e.owners.map(({email:e})=>e),teams:e.teams.map(({name:e})=>e),...e.path.length>0?{path:e.path}:{},...e.dataCollection?.title?{"data-collection-tag":e.dataCollection.title.defaultMessage}:{},...e.dbIntegrationQueries.length>0?{"privacy-action-queries":u(l(e.dbIntegrationQueries,`requestType`),e=>e.suggestedQuery||e.query||void 0)}:{},...e.subDataPoints.length>0?{fields:e.subDataPoints.map(e=>({key:e.name,description:e.description,purposes:e.purposes,categories:e.categories,...z&&e.pendingCategoryGuesses?{"guessed-categories":e.pendingCategoryGuesses.filter(e=>e.status===`PENDING`).map(e=>({category:{name:e.category.name,category:e.category.category},status:e.status,confidence:e.confidence,classifierVersion:e.classifierVersion||void 0}))}:{},"access-request-visibility-enabled":e.accessRequestVisibilityEnabled,"erasure-request-redaction-enabled":e.erasureRequestRedactionEnabled,attributes:e.attributeValues!==void 0&&e.attributeValues.length>0?O(e.attributeValues):void 0})).sort((e,t)=>e.key.localeCompare(t.key))}:{},"privacy-actions":e.actionSettings.filter(({active:e})=>e).map(({type:e})=>e)})).sort((e,t)=>[...e.path??[],e.key].join(`.`).localeCompare([...t.path??[],t.key].join(`.`)))}))}return Q}export{P as i,L as n,F as r,I as t};
|
|
58
|
+
//# sourceMappingURL=pullTranscendConfiguration-Cdg8JEii.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pullTranscendConfiguration-Cdg8JEii.mjs","names":[],"sources":["../src/lib/graphql/gqls/assessmentTemplate.ts","../src/lib/graphql/fetchAllAssessmentTemplates.ts","../src/lib/graphql/pullTranscendConfiguration.ts"],"sourcesContent":["import { ASSESSMENT_SECTION_FIELDS } from '@transcend-io/sdk';\nimport { 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 ASSESSMENT_TEMPLATES = gql`\n query TranscendCliAssessmentTemplates(\n $first: Int!\n $offset: Int!\n $filterBy: AssessmentFormTemplateFiltersInput\n ) {\n assessmentFormTemplates(\n first: $first\n offset: $offset\n filterBy: $filterBy\n ) {\n nodes {\n id\n creator {\n id\n email\n name\n }\n lastEditor {\n id\n email\n name\n }\n title\n description\n status\n source\n parentId\n isLocked\n isArchived\n createdAt\n updatedAt\n retentionSchedule {\n id\n type\n durationDays\n operation\n createdAt\n updatedAt\n }\n assessmentEmailSet {\n id\n title\n description\n isDefault\n templates {\n id\n title\n }\n }\n sections {\n ${ASSESSMENT_SECTION_FIELDS}\n }\n }\n }\n }\n`;\n","import {\n AssessmentFormTemplateSource,\n AssessmentFormTemplateStatus,\n} from '@transcend-io/privacy-types';\nimport {\n makeGraphQLRequest,\n type AssessmentSection,\n type RetentionSchedule,\n type UserPreview,\n} from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\nimport { ASSESSMENT_TEMPLATES } from './gqls/index.js';\n\n/**\n * Represents an assessment template with various properties and metadata.\n */\nexport interface AssessmentTemplate {\n /** The ID of the assessment template */\n id: string;\n /** The user who created the assessment template */\n creator: UserPreview;\n /** The user who last edited the assessment template */\n lastEditor: UserPreview;\n /** The title of the assessment template */\n title: string;\n /** The description of the assessment template */\n description: string;\n /** The current status of the assessment template */\n status: AssessmentFormTemplateStatus;\n /** The source fo the form template */\n source: AssessmentFormTemplateSource;\n /** ID of parent template */\n parentId: string;\n /** Indicates if the assessment template is locked */\n isLocked: boolean;\n /** Indicates if the assessment template is archived */\n isArchived: boolean;\n /** The date when the assessment template was created */\n createdAt: string;\n /** The date when the assessment template was last updated */\n updatedAt: string;\n /** The retention schedule of the assessment template */\n retentionSchedule?: RetentionSchedule;\n /** The sections of the assessment template */\n sections: AssessmentSection[];\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all assessment templates in the organization\n *\n * @param client - GraphQL client\n * @returns All assessment templates in the organization\n */\nexport async function fetchAllAssessmentTemplates(\n client: GraphQLClient,\n): Promise<AssessmentTemplate[]> {\n const assessmentTemplates: AssessmentTemplate[] = [];\n let offset = 0;\n\n let shouldContinue = false;\n do {\n const {\n assessmentFormTemplates: { nodes },\n } = await makeGraphQLRequest<{\n /** Templates */\n assessmentFormTemplates: {\n /** Nodes */\n nodes: AssessmentTemplate[];\n };\n }>(client, ASSESSMENT_TEMPLATES, {\n variables: { first: PAGE_SIZE, offset },\n logger,\n });\n assessmentTemplates.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return assessmentTemplates.sort((a, b) => a.title.localeCompare(b.title));\n}\n","import { LocaleValue } from '@transcend-io/internationalization';\nimport {\n RequestAction,\n ConsentTrackerStatus,\n ActionItemCode,\n RetentionType,\n PreferenceTopicType,\n WorkflowConfigType,\n type ConsentThemeInput,\n type ConsentVariantInput,\n} from '@transcend-io/privacy-types';\nimport {\n fetchAllActionItemCollections,\n fetchAllActionItems,\n fetchAllActions,\n fetchAllAgentFiles,\n fetchAllAgentFunctions,\n fetchAllAgents,\n fetchAllAssessments,\n fetchAllAttributes,\n fetchAllBusinessEntities,\n fetchAllCookies,\n fetchAllDataCategories,\n fetchAllDataFlows,\n fetchAllPolicies,\n fetchAllPrivacyCenters,\n fetchAllProcessingPurposes,\n fetchAllSiloDiscoveryResults,\n fetchAllTemplates,\n fetchConsentManager,\n fetchConsentManagerExperiences,\n fetchConsentVariants,\n fetchConsentThemes,\n fetchConsentManagerTheme,\n fetchAllEnrichers,\n fetchAllIdentifiers,\n fetchAllMessages,\n fetchAllPromptGroups,\n fetchAllPromptPartials,\n fetchAllProcessingActivities,\n fetchAllPrompts,\n fetchAllPurposesAndPreferences,\n fetchAllWorkflowConfigs,\n fetchAllPreferenceOptionValues,\n fetchPartitions,\n fetchAllTeams,\n fetchAllVendors,\n fetchApiKeys,\n formatAttributeValues,\n formatRegions,\n parseAssessmentDisplayLogic,\n parseAssessmentRiskLogic,\n convertToDataSubjectAllowlist,\n fetchAllDataSubjects,\n fetchEnrichedDataSilos,\n workflowConfigMatchKey,\n type AssessmentRule,\n} from '@transcend-io/sdk';\nimport colors from 'colors';\nimport { GraphQLClient } from 'graphql-request';\nimport { flatten, groupBy, keyBy, mapValues } from 'lodash-es';\n\n/* eslint-disable max-lines */\nimport {\n TranscendInput,\n ApiKeyInput,\n DataSiloInput,\n AttributeInput,\n ActionInput,\n IdentifierInput,\n BusinessEntityInput,\n EnricherInput,\n PromptGroupInput,\n DataFlowInput,\n PromptPartialInput,\n DataSubjectInput,\n CookieInput,\n PromptInput,\n DatapointInput,\n FieldInput,\n ProcessingPurposeInput,\n ProcessingActivityInput,\n DataCategoryInput,\n VendorInput,\n AgentFileInput,\n AgentFunctionInput,\n AgentInput,\n PolicyInput,\n IntlMessageInput,\n ActionItemInput,\n TeamInput,\n ActionItemCollectionInput,\n AssessmentInput,\n AssessmentTemplateInput,\n AssessmentSectionInput,\n AssessmentSectionQuestionInput,\n RiskLogicInput,\n ConsentPurpose,\n WorkflowConfigInput,\n ConsentPreferenceTopic,\n ConsentPreferenceTopicOptionValue,\n type SiloDiscoveryResultInput,\n} from '../../codecs.js';\nimport { TranscendPullResource } from '../../enums.js';\nimport { logger } from '../../logger.js';\nimport { fetchAllAssessmentTemplates } from './fetchAllAssessmentTemplates.js';\n\nexport const DEFAULT_TRANSCEND_PULL_RESOURCES = [\n TranscendPullResource.DataSilos,\n TranscendPullResource.Enrichers,\n TranscendPullResource.Templates,\n TranscendPullResource.ApiKeys,\n];\n\nexport interface TranscendPullConfigurationInput {\n /** Page size */\n pageSize: number;\n /** Enable debug logs */\n debug: boolean;\n /** The data silo IDs to sync. If empty list, pull all. */\n dataSiloIds: string[];\n /** Resources to pull in */\n resources?: TranscendPullResource[];\n /** The data silo types to sync.If empty list, pull all. */\n integrationNames: string[];\n /** The tracker statuses to pull */\n trackerStatuses?: ConsentTrackerStatus[];\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\n/**\n * Pull a yaml configuration from Transcend\n *\n * @param client - GraphQL client\n * @param dataSiloIds - The data silos to sync. If empty list, pull all.\n * @returns The configuration\n */\nexport async function pullTranscendConfiguration(\n client: GraphQLClient,\n {\n dataSiloIds,\n integrationNames,\n debug,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n pageSize,\n skipDatapoints,\n includeGuessedCategories,\n skipSubDatapoints,\n trackerStatuses = Object.values(ConsentTrackerStatus),\n }: TranscendPullConfigurationInput,\n): Promise<TranscendInput> {\n if (dataSiloIds.length > 0 && integrationNames.length > 0) {\n throw new Error('Only 1 of integrationNames OR dataSiloIds can be provided');\n }\n\n logger.info(colors.magenta(`Fetching data with page size ${pageSize}...`));\n\n // Fetch all data, but only conditional fetch data that is requested\n const [\n dataSubjects,\n apiKeyTitleMap,\n dataSilos,\n enrichers,\n dataFlows,\n cookies,\n attributes,\n templates,\n identifiers,\n actions,\n businessEntities,\n processingActivities,\n consentManager,\n consentManagerExperiences,\n consentVariants,\n consentThemes,\n prompts,\n promptPartials,\n promptGroups,\n agents,\n agentFunctions,\n agentFiles,\n vendors,\n dataCategories,\n processingPurposes,\n actionItems,\n actionItemCollections,\n teams,\n policies,\n privacyCenters,\n messages,\n partitions,\n assessments,\n assessmentTemplates,\n purposes,\n workflowConfigs,\n preferenceOptionValues,\n siloDiscoveryResults,\n ] = await Promise.all([\n // Grab all data subjects in the organization\n resources.includes(TranscendPullResource.DataSilos) ||\n resources.includes(TranscendPullResource.DataSubjects)\n ? fetchAllDataSubjects(client, { logger })\n : [],\n // Grab API keys\n resources.includes(TranscendPullResource.ApiKeys)\n ? fetchApiKeys(client, { fetchAll: true, logger })\n : [],\n // Fetch the data silos\n resources.includes(TranscendPullResource.DataSilos)\n ? fetchEnrichedDataSilos(client, {\n ids: dataSiloIds,\n integrationNames,\n pageSize,\n debug,\n includeGuessedCategories,\n skipDatapoints,\n skipSubDatapoints,\n logger,\n })\n : [],\n // Fetch enrichers\n resources.includes(TranscendPullResource.Enrichers)\n ? fetchAllEnrichers(client, { logger })\n : [],\n // Fetch data flows\n resources.includes(TranscendPullResource.DataFlows)\n ? [\n ...(trackerStatuses.includes(ConsentTrackerStatus.Live)\n ? await fetchAllDataFlows(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.Live },\n })\n : []),\n ...(trackerStatuses.includes(ConsentTrackerStatus.NeedsReview)\n ? await fetchAllDataFlows(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.NeedsReview },\n })\n : []),\n ]\n : [],\n // Fetch data flows\n resources.includes(TranscendPullResource.Cookies)\n ? [\n ...(trackerStatuses.includes(ConsentTrackerStatus.Live)\n ? await fetchAllCookies(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.Live },\n })\n : []),\n ...(trackerStatuses.includes(ConsentTrackerStatus.NeedsReview)\n ? await fetchAllCookies(client, {\n logger,\n filterBy: { status: ConsentTrackerStatus.NeedsReview },\n })\n : []),\n ]\n : [],\n // Fetch attributes\n resources.includes(TranscendPullResource.Attributes)\n ? fetchAllAttributes(client, { logger })\n : [],\n // Fetch email templates\n resources.includes(TranscendPullResource.Templates)\n ? fetchAllTemplates(client, { logger })\n : [],\n // Fetch identifiers\n resources.includes(TranscendPullResource.Identifiers)\n ? fetchAllIdentifiers(client, { logger })\n : [],\n // Fetch actions\n resources.includes(TranscendPullResource.Actions) ? fetchAllActions(client, { logger }) : [],\n // Fetch business entities\n resources.includes(TranscendPullResource.BusinessEntities)\n ? fetchAllBusinessEntities(client, { logger })\n : [],\n // Fetch processing activities\n resources.includes(TranscendPullResource.ProcessingActivities)\n ? fetchAllProcessingActivities(client, { logger })\n : [],\n // Fetch consent manager\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentManager(client, { logger })\n : undefined,\n // Fetch consent manager experiences\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentManagerExperiences(client, { logger })\n : [],\n // Fetch consent manager consent variants\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentVariants(client, { logger })\n : [],\n // Fetch consent manager consent themes\n resources.includes(TranscendPullResource.ConsentManager)\n ? fetchConsentThemes(client, { logger })\n : [],\n // Fetch prompts\n resources.includes(TranscendPullResource.Prompts) ? fetchAllPrompts(client, { logger }) : [],\n // Fetch promptPartials\n resources.includes(TranscendPullResource.PromptPartials)\n ? fetchAllPromptPartials(client, { logger })\n : [],\n // Fetch promptGroups\n resources.includes(TranscendPullResource.PromptGroups)\n ? fetchAllPromptGroups(client, { logger })\n : [],\n // Fetch agents\n resources.includes(TranscendPullResource.Agents) ? fetchAllAgents(client, { logger }) : [],\n // Fetch agentFunctions\n resources.includes(TranscendPullResource.AgentFunctions)\n ? fetchAllAgentFunctions(client, { logger })\n : [],\n // Fetch agentFiles\n resources.includes(TranscendPullResource.AgentFiles)\n ? fetchAllAgentFiles(client, { logger })\n : [],\n // Fetch vendors\n resources.includes(TranscendPullResource.Vendors) ? fetchAllVendors(client, { logger }) : [],\n // Fetch dataCategories\n resources.includes(TranscendPullResource.DataCategories)\n ? fetchAllDataCategories(client, { logger })\n : [],\n // Fetch dataCategories\n resources.includes(TranscendPullResource.ProcessingPurposes)\n ? fetchAllProcessingPurposes(client, { logger })\n : [],\n // Fetch actionItems\n resources.includes(TranscendPullResource.ActionItems)\n ? fetchAllActionItems(client, {\n logger,\n filterBy: { type: [ActionItemCode.Onboarding] },\n })\n : [],\n // Fetch actionItemCollections\n resources.includes(TranscendPullResource.ActionItemCollections)\n ? fetchAllActionItemCollections(client, { logger })\n : [],\n // Fetch teams\n resources.includes(TranscendPullResource.Teams) ? fetchAllTeams(client, { logger }) : [],\n // Fetch policies\n resources.includes(TranscendPullResource.Policies) ? fetchAllPolicies(client, { logger }) : [],\n // Fetch privacy centers\n resources.includes(TranscendPullResource.PrivacyCenters)\n ? fetchAllPrivacyCenters(client, { logger })\n : [],\n // Fetch messages\n resources.includes(TranscendPullResource.Messages) ? fetchAllMessages(client, { logger }) : [],\n // Fetch partitions\n resources.includes(TranscendPullResource.Partitions) ? fetchPartitions(client, { logger }) : [],\n // Fetch assessments\n resources.includes(TranscendPullResource.Assessments)\n ? fetchAllAssessments(client, { logger })\n : [],\n // Fetch assessmentTemplates\n resources.includes(TranscendPullResource.AssessmentTemplates)\n ? fetchAllAssessmentTemplates(client)\n : [],\n // Fetch purpose and preferences\n resources.includes(TranscendPullResource.Purposes)\n ? fetchAllPurposesAndPreferences(client, { logger })\n : [],\n resources.includes(TranscendPullResource.WorkflowConfigs)\n ? fetchAllWorkflowConfigs(client, {\n logger,\n workflowConfigType: WorkflowConfigType.DSR,\n })\n : [],\n resources.includes(TranscendPullResource.PreferenceOptions)\n ? fetchAllPreferenceOptionValues(client, { logger })\n : [],\n // Fetch silo discovery results\n resources.includes(TranscendPullResource.SystemDiscovery)\n ? fetchAllSiloDiscoveryResults(client, { logger })\n : [],\n ]);\n\n const consentManagerTheme =\n resources.includes(TranscendPullResource.ConsentManager) && consentManager\n ? await fetchConsentManagerTheme(client, {\n logger,\n filterBy: { airgapBundleId: consentManager.id },\n })\n : undefined;\n\n const result: TranscendInput = {};\n\n // Save API keys\n const apiKeyTitles = flatten(dataSilos.map(([{ apiKeys }]) => apiKeys.map(({ title }) => title)));\n const relevantApiKeys = Object.values(apiKeyTitleMap).filter(({ title }) =>\n resources.includes(TranscendPullResource.ApiKeys) ? true : apiKeyTitles.includes(title),\n );\n if (relevantApiKeys.length > 0 && resources.includes(TranscendPullResource.ApiKeys)) {\n result['api-keys'] = relevantApiKeys.map(\n ({ title }): ApiKeyInput => ({\n title,\n }),\n );\n }\n\n // Save Partitions\n if (partitions.length > 0 && resources.includes(TranscendPullResource.Partitions)) {\n result.partitions = partitions.map(({ name, partition }) => ({\n name,\n partition,\n }));\n }\n\n // Save Consent Manager\n if (consentManager && resources.includes(TranscendPullResource.ConsentManager)) {\n result['consent-manager'] = {\n bundleUrls: {\n TEST: consentManager.testBundleURL,\n PRODUCTION: consentManager.bundleURL,\n },\n domains: consentManager.configuration.domains || undefined,\n partition: consentManager.configuration.partition || undefined,\n consentPrecedence: consentManager.configuration.consentPrecedence || undefined,\n unknownRequestPolicy: consentManager.configuration.unknownRequestPolicy || undefined,\n unknownCookiePolicy: consentManager.configuration.unknownCookiePolicy || undefined,\n syncEndpoint: consentManager.configuration.syncEndpoint || undefined,\n telemetryPartitioning: consentManager.configuration.telemetryPartitioning || undefined,\n signedIabAgreement: consentManager.configuration.signedIabAgreement || undefined,\n // TODO: https://transcend.height.app/T-23919 - reconsider simpler yml shape\n syncGroups: consentManager.configuration.syncGroups || undefined,\n theme: !consentManagerTheme\n ? undefined\n : {\n primaryColor: consentManagerTheme.primaryColor || undefined,\n fontColor: consentManagerTheme.fontColor || undefined,\n privacyPolicy: consentManagerTheme.privacyPolicy || undefined,\n prompt: consentManagerTheme.prompt,\n },\n experiences: consentManagerExperiences.map((experience) => ({\n name: experience.name,\n displayName: experience.displayName || undefined,\n regions: experience.regions.map((region) => ({\n countrySubDivision: region.countrySubDivision || undefined,\n country: region.country || undefined,\n })),\n onConsentExpiry: experience.onConsentExpiry,\n consentExpiry: experience.consentExpiry,\n operator: experience.operator,\n displayPriority: experience.displayPriority,\n viewState: experience.viewState,\n purposes: experience.purposes.map((purpose) => ({\n trackingType: purpose.trackingType,\n })),\n optedOutPurposes: experience.optedOutPurposes.map((purpose) => ({\n trackingType: purpose.trackingType,\n })),\n browserLanguages: experience.browserLanguages,\n browserTimeZones: experience.browserTimeZones,\n consentUiVariantSlug: experience.consentUiVariant?.slug,\n })),\n consentVariants: consentVariants.map(\n (variant): ConsentVariantInput => ({\n id: variant.id,\n name: variant.name,\n slug: variant.slug,\n description: variant.description,\n configuration: JSON.stringify(variant.configuration),\n locales: variant.locales as LocaleValue[],\n status: variant.status,\n userFlow: variant.userFlow,\n themeSlug: variant.theme?.slug,\n }),\n ),\n consentThemes: consentThemes.map(\n (theme): ConsentThemeInput => ({\n id: theme.id,\n name: theme.name,\n slug: theme.slug,\n configuration: JSON.stringify(theme.configuration),\n }),\n ),\n };\n }\n\n // Save assessments\n if (assessments.length > 0 && resources.includes(TranscendPullResource.Assessments)) {\n result.assessments = assessments.map(\n ({\n title,\n assessmentGroup,\n sections,\n creator,\n description,\n status,\n assignees,\n externalAssignees,\n reviewers,\n isLocked,\n isArchived,\n isExternallyCreated,\n dueDate,\n createdAt,\n assignedAt,\n submittedAt,\n approvedAt,\n rejectedAt,\n titleIsInternal,\n retentionSchedule,\n attributeValues,\n resources,\n syncedRows,\n }): AssessmentInput => ({\n title,\n group: assessmentGroup.title,\n sections: sections.map(\n ({\n title,\n status,\n questions,\n assignees,\n isReviewed,\n externalAssignees,\n }): AssessmentSectionInput => ({\n title,\n status,\n questions: questions.map(\n ({\n title,\n type,\n subType,\n placeholder,\n description,\n isRequired,\n referenceId,\n displayLogic,\n riskLogic,\n riskCategories,\n riskFramework,\n answerOptions,\n selectedAnswers,\n allowedMimeTypes,\n allowSelectOther,\n syncModel,\n syncColumn,\n attributeKey,\n requireRiskEvaluation,\n requireRiskMatrixEvaluation,\n }): AssessmentSectionQuestionInput => {\n const displayLogicParsed = displayLogic\n ? parseAssessmentDisplayLogic(displayLogic)\n : undefined;\n return {\n title,\n type,\n 'sub-type': subType,\n placeholder,\n description,\n 'is-required': isRequired,\n 'reference-id': referenceId,\n 'display-logic':\n displayLogicParsed && Object.keys(displayLogicParsed).length > 0\n ? {\n action: displayLogicParsed.action!,\n rule: displayLogicParsed.rule\n ? {\n 'depends-on-question-reference-id':\n displayLogicParsed.rule.dependsOnQuestionReferenceId,\n 'comparison-operator': displayLogicParsed.rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property with a check\n 'comparisonOperands' in displayLogicParsed.rule\n ? displayLogicParsed.rule.comparisonOperands\n : undefined,\n }\n : undefined,\n 'nested-rule': displayLogicParsed.nestedRule\n ? {\n 'logic-operator': displayLogicParsed.nestedRule.logicOperator,\n rules: (displayLogicParsed.nestedRule.rules || []).map(\n (rule: AssessmentRule) => ({\n 'depends-on-question-reference-id':\n rule.dependsOnQuestionReferenceId,\n 'comparison-operator': rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property on the nested rule\n 'comparisonOperands' in rule\n ? rule.comparisonOperands\n : undefined,\n }),\n ),\n }\n : undefined,\n }\n : undefined,\n 'risk-logic': riskLogic.map((logic): RiskLogicInput => {\n const parsed = parseAssessmentRiskLogic(logic);\n return {\n 'risk-level': parsed.riskAssignment?.riskLevelId,\n 'comparison-operands': parsed.comparisonOperands,\n 'comparison-operator': parsed.comparisonOperator,\n };\n }),\n 'risk-categories': riskCategories.map(({ title }) => title),\n 'risk-framework': riskFramework?.title,\n 'answer-options': answerOptions.map(({ value }) => ({\n value,\n })),\n 'selected-answers': selectedAnswers.map(({ value }) => value),\n 'allowed-mime-types': allowedMimeTypes,\n 'allow-select-other': allowSelectOther,\n 'sync-model': syncModel || undefined,\n 'sync-column': syncColumn || undefined,\n 'attribute-key': attributeKey?.name,\n 'require-risk-evaluation': requireRiskEvaluation,\n 'require-risk-matrix-evaluation': requireRiskMatrixEvaluation,\n };\n },\n ),\n assignees: assignees.map(({ email }) => email),\n 'external-assignees': externalAssignees.map(({ email }) => email),\n 'is-reviewed': isReviewed,\n }),\n ),\n creator: creator?.email,\n description,\n status,\n assignees: assignees.map(({ email }) => email),\n 'external-assignees': externalAssignees.map(({ email }) => email),\n reviewers: reviewers.map(({ email }) => email),\n locked: isLocked,\n archived: isArchived,\n external: isExternallyCreated,\n 'title-is-internal': titleIsInternal,\n 'due-date': dueDate || undefined,\n 'created-at': createdAt || undefined,\n 'assigned-at': assignedAt || undefined,\n 'submitted-at': submittedAt || undefined,\n 'approved-at': approvedAt || undefined,\n 'rejected-at': rejectedAt || undefined,\n 'retention-schedule': retentionSchedule\n ? {\n type: retentionSchedule.type,\n 'duration-days': retentionSchedule.durationDays,\n operand: retentionSchedule.operation,\n }\n : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n resources: resources.map(({ resourceType, title, name, category, type, purpose }) => ({\n type: resourceType,\n title: category\n ? `${category} - ${name}`\n : purpose\n ? `${purpose} - ${name}`\n : title || name || type || '',\n })),\n rows: syncedRows.map(({ resourceType, title, name, category, type, purpose }) => ({\n type: resourceType,\n title: category\n ? `${category} - ${name}`\n : purpose\n ? `${purpose} - ${name}`\n : title || name || type || '',\n })),\n }),\n );\n }\n\n // Save assessmentTemplates\n if (\n assessmentTemplates.length > 0 &&\n resources.includes(TranscendPullResource.AssessmentTemplates)\n ) {\n result['assessment-templates'] = assessmentTemplates.map(\n ({\n title,\n description,\n sections,\n status,\n source,\n creator,\n isLocked,\n isArchived,\n createdAt,\n retentionSchedule,\n }): AssessmentTemplateInput => ({\n title,\n description,\n sections: sections.map(\n ({ title, questions }): AssessmentSectionInput => ({\n title,\n questions: questions.map(\n ({\n title,\n type,\n subType,\n placeholder,\n description,\n isRequired,\n referenceId,\n displayLogic,\n riskLogic,\n riskCategories,\n riskFramework,\n answerOptions,\n allowedMimeTypes,\n allowSelectOther,\n syncModel,\n syncColumn,\n attributeKey,\n requireRiskEvaluation,\n requireRiskMatrixEvaluation,\n }): AssessmentSectionQuestionInput => {\n const displayLogicParsed = displayLogic\n ? parseAssessmentDisplayLogic(displayLogic)\n : undefined;\n return {\n title,\n type,\n 'sub-type': subType,\n placeholder,\n description,\n 'is-required': isRequired,\n 'reference-id': referenceId,\n 'display-logic':\n displayLogicParsed && Object.keys(displayLogicParsed).length > 0\n ? {\n action: displayLogicParsed.action!,\n rule: displayLogicParsed.rule\n ? {\n 'depends-on-question-reference-id':\n displayLogicParsed.rule.dependsOnQuestionReferenceId,\n 'comparison-operator': displayLogicParsed.rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property with a check\n 'comparisonOperands' in displayLogicParsed.rule\n ? displayLogicParsed.rule.comparisonOperands\n : undefined,\n }\n : undefined,\n 'nested-rule': displayLogicParsed.nestedRule\n ? {\n 'logic-operator': displayLogicParsed.nestedRule.logicOperator,\n rules: (displayLogicParsed.nestedRule.rules || []).map(\n (rule: AssessmentRule) => ({\n 'depends-on-question-reference-id':\n rule.dependsOnQuestionReferenceId,\n 'comparison-operator': rule.comparisonOperator,\n 'comparison-operands':\n // Safely access property on the nested rule\n 'comparisonOperands' in rule\n ? rule.comparisonOperands\n : undefined,\n }),\n ),\n }\n : undefined,\n }\n : undefined,\n 'risk-logic': riskLogic.map((logic): RiskLogicInput => {\n const parsed = parseAssessmentRiskLogic(logic);\n return {\n 'risk-level': parsed.riskAssignment?.riskLevelId,\n 'risk-matrix-row': parsed.riskAssignment?.riskMatrixRowId,\n 'risk-matrix-column': parsed.riskAssignment?.riskMatrixColumnId,\n 'comparison-operands': parsed.comparisonOperands,\n 'comparison-operator': parsed.comparisonOperator,\n };\n }),\n 'risk-categories': riskCategories.map(({ title }) => title),\n 'risk-framework': riskFramework?.title,\n 'answer-options': answerOptions.map(({ value }) => ({\n value,\n })),\n 'allowed-mime-types': allowedMimeTypes,\n 'allow-select-other': allowSelectOther,\n 'sync-model': syncModel || undefined,\n 'sync-column': syncColumn || undefined,\n 'attribute-key': attributeKey?.name,\n 'require-risk-evaluation': requireRiskEvaluation,\n 'require-risk-matrix-evaluation': requireRiskMatrixEvaluation,\n };\n },\n ),\n }),\n ),\n status,\n source,\n creator: creator?.email,\n locked: isLocked,\n archived: isArchived,\n 'created-at': createdAt || undefined,\n 'retention-schedule': retentionSchedule\n ? {\n type: retentionSchedule.type,\n 'duration-days': retentionSchedule.durationDays,\n operand: retentionSchedule.operation,\n }\n : undefined,\n }),\n );\n }\n\n // Save Silo Discovery Results\n if (\n siloDiscoveryResults.length > 0 &&\n resources.includes(TranscendPullResource.SystemDiscovery)\n ) {\n result['system-discovery'] = siloDiscoveryResults.map(\n ({\n title,\n resourceId,\n suggestedCatalog: { title: suggestedCatalogTitle },\n plugin: {\n dataSilo: { title: dataSiloTitle },\n },\n country,\n countrySubDivision,\n plaintextContext,\n containsSensitiveData,\n status,\n }): SiloDiscoveryResultInput => ({\n title,\n resourceId,\n suggestedCatalog: suggestedCatalogTitle,\n plugin: dataSiloTitle,\n country: country || undefined,\n countrySubDivision: countrySubDivision || undefined,\n plaintextContext,\n containsSensitiveData,\n status,\n }),\n );\n }\n\n // Save prompts\n if (prompts.length > 0 && resources.includes(TranscendPullResource.Prompts)) {\n result.prompts = prompts.map(\n ({ title, content }): PromptInput => ({\n title,\n content,\n }),\n );\n }\n\n // Save promptPartials\n if (promptPartials.length > 0 && resources.includes(TranscendPullResource.PromptPartials)) {\n result['prompt-partials'] = promptPartials.map(\n ({ title, content }): PromptPartialInput => ({\n title,\n content,\n }),\n );\n }\n\n // Save promptGroups\n if (promptGroups.length > 0 && resources.includes(TranscendPullResource.PromptGroups)) {\n result['prompt-groups'] = promptGroups.map(\n ({ title, description, prompts }): PromptGroupInput => ({\n title,\n description,\n prompts: prompts.map(({ title }) => title),\n }),\n );\n }\n\n // Save teams\n if (teams.length > 0 && resources.includes(TranscendPullResource.Teams)) {\n result.teams = teams.map(\n ({\n name,\n description,\n ssoDepartment,\n ssoGroup,\n ssoTitle,\n users,\n scopes,\n parentTeam,\n }): TeamInput => ({\n name,\n description,\n 'sso-department': ssoDepartment || undefined,\n 'sso-group': ssoGroup || undefined,\n 'sso-title': ssoTitle || undefined,\n 'parent-team-name': parentTeam?.name,\n users: users.map(({ email }) => email),\n scopes: scopes.map(({ name }) => name),\n }),\n );\n }\n\n // Save Data Subjects\n if (dataSubjects.length > 0 && resources.includes(TranscendPullResource.DataSubjects)) {\n result['data-subjects'] = dataSubjects.map(\n ({ type, title, active, adminDashboardDefaultSilentMode, actions }): DataSubjectInput => ({\n type,\n title: title?.defaultMessage,\n active,\n adminDashboardDefaultSilentMode,\n actions: actions.map(({ type }) => type),\n }),\n );\n }\n\n // Save privacy policies\n if (policies.length > 0) {\n result.policies = policies.map(\n ({ title, versions, disabledLocales }): PolicyInput => ({\n title: title?.defaultMessage,\n content: versions?.[0]?.content?.defaultMessage,\n disabledLocales,\n }),\n );\n }\n\n // Save messages\n if (messages.length > 0) {\n result.messages = messages.map(\n ({ id, defaultMessage, targetReactIntlId, description, translations }): IntlMessageInput => ({\n id,\n defaultMessage,\n description,\n targetReactIntlId: targetReactIntlId || undefined,\n translations: translations.reduce(\n (acc, { locale, value }) => Object.assign(acc, { [locale]: value }),\n {} as Record<LocaleValue, string>,\n ),\n }),\n );\n }\n\n // Save privacy center\n if (privacyCenters.length > 0) {\n const privacyCenter = privacyCenters[0];\n result['privacy-center'] = {\n isDisabled: privacyCenter.isDisabled,\n showPrivacyRequestButton: privacyCenter.showPrivacyRequestButton,\n showPolicies: privacyCenter.showPolicies,\n showTrackingTechnologies: privacyCenter.showTrackingTechnologies,\n showCookies: privacyCenter.showCookies,\n showDataFlows: privacyCenter.showDataFlows,\n showConsentManager: privacyCenter.showConsentManager,\n showManageYourPrivacy: privacyCenter.showManageYourPrivacy,\n showMarketingPreferences: privacyCenter.showMarketingPreferences,\n locales: privacyCenter.locales,\n defaultLocale: privacyCenter.defaultLocale,\n preferBrowserDefaultLocale: privacyCenter.preferBrowserDefaultLocale,\n supportEmail: privacyCenter.supportEmail || undefined,\n replyToEmail: privacyCenter.replyToEmail || undefined,\n useNoReplyEmailAddress: privacyCenter.useNoReplyEmailAddress,\n useCustomEmailDomain: privacyCenter.useCustomEmailDomain,\n transformAccessReportJsonToCsv: privacyCenter.transformAccessReportJsonToCsv,\n home: privacyCenter.home || undefined,\n expandSideMenuByDefault: privacyCenter.expandSideMenuByDefault,\n workflowsCustomFieldsRequired: privacyCenter.workflowsCustomFieldsRequired,\n footerLayout: privacyCenter.footerLayout,\n ...(privacyCenter.childOrganizations.length > 0\n ? {\n displayedChildOrganizationUris: privacyCenter.childOrganizations.map(\n (child) => child.uri,\n ),\n }\n : {}),\n ...(privacyCenter.footerLinks.length > 0\n ? {\n footerLinks: [...privacyCenter.footerLinks]\n .sort((a, b) => a.displayOrder - b.displayOrder)\n .map((link) => ({\n title: link.title.defaultMessage,\n ...(link.url ? { url: link.url } : {}),\n ...(link.iconOnly ? { iconOnly: link.iconOnly } : {}),\n })),\n }\n : {}),\n theme: privacyCenter.theme,\n };\n }\n\n // Save business entities\n if (businessEntities.length > 0 && resources.includes(TranscendPullResource.BusinessEntities)) {\n result['business-entities'] = businessEntities.map(\n ({\n title,\n description,\n address,\n headquarterCountry,\n headquarterSubDivision,\n dataProtectionOfficerName,\n dataProtectionOfficerEmail,\n attributeValues,\n }): BusinessEntityInput => ({\n title,\n description: description || undefined,\n address: address || undefined,\n headquarterCountry: headquarterCountry || undefined,\n headquarterSubDivision: headquarterSubDivision || undefined,\n dataProtectionOfficerName: dataProtectionOfficerName || undefined,\n dataProtectionOfficerEmail: dataProtectionOfficerEmail || undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save processing activities\n if (\n processingActivities.length > 0 &&\n resources.includes(TranscendPullResource.ProcessingActivities)\n ) {\n result['processing-activities'] = processingActivities.map(\n ({\n title,\n description,\n securityMeasureDetails,\n controllerships,\n storageRegions,\n transferRegions,\n retentionType,\n retentionPeriod,\n dataProtectionImpactAssessmentLink,\n dataProtectionImpactAssessmentStatus,\n attributeValues,\n dataSilos,\n dataSubjects,\n teams,\n owners,\n processingPurposeSubCategories,\n dataSubCategories,\n saaSCategories,\n }): ProcessingActivityInput => ({\n title,\n description,\n securityMeasureDetails: securityMeasureDetails ?? undefined,\n controllerships: controllerships.length > 0 ? controllerships : undefined,\n storageRegions: storageRegions.length > 0 ? formatRegions(storageRegions) : undefined,\n transferRegions: transferRegions.length > 0 ? formatRegions(transferRegions) : undefined,\n retentionType,\n retentionPeriod: retentionType === RetentionType.StatedPeriod ? retentionPeriod : undefined,\n dataProtectionImpactAssessmentLink: dataProtectionImpactAssessmentLink ?? undefined,\n dataProtectionImpactAssessmentStatus,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n dataSiloTitles: dataSilos.length > 0 ? dataSilos.map(({ title }) => title) : undefined,\n dataSubjectTypes:\n dataSubjects.length > 0 ? dataSubjects.map(({ type }) => type) : undefined,\n teamNames: teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n ownerEmails: owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n processingSubPurposes:\n processingPurposeSubCategories.length > 0\n ? processingPurposeSubCategories.map(({ name, purpose }) => ({\n purpose,\n ...(name ? { name } : {}),\n }))\n : undefined,\n dataSubCategories:\n dataSubCategories.length > 0\n ? dataSubCategories.map(({ name, category }) => ({\n category,\n ...(name ? { name } : {}),\n }))\n : undefined,\n saaSCategories:\n saaSCategories.length > 0 ? saaSCategories.map(({ title }) => title) : undefined,\n }),\n );\n }\n\n // Save Actions\n if (actions.length > 0 && resources.includes(TranscendPullResource.Actions)) {\n result.actions = actions.map(\n ({\n type,\n skipSecondaryIfNoFiles,\n skipDownloadableStep,\n requiresReview,\n regionList,\n regionDetectionMethod,\n waitingPeriod,\n }): ActionInput => ({\n type,\n ...(type === RequestAction.Erasure\n ? {\n skipSecondaryIfNoFiles,\n skipDownloadableStep,\n }\n : {}),\n requiresReview,\n waitingPeriod,\n regionDetectionMethod,\n regionList: regionList.length > 0 ? regionList : undefined,\n }),\n );\n }\n\n // Save identifiers\n if (identifiers.length > 0 && resources.includes(TranscendPullResource.Identifiers)) {\n result.identifiers = identifiers.map(\n ({\n name,\n type,\n regex,\n selectOptions,\n privacyCenterVisibility,\n isRequiredInForm,\n placeholder,\n displayTitle,\n dataSubjects,\n displayDescription,\n displayOrder,\n isUniqueOnPreferenceStore,\n }): IdentifierInput => ({\n name,\n type,\n regex,\n selectOptions: selectOptions.length > 0 ? selectOptions : undefined,\n privacyCenterVisibility:\n privacyCenterVisibility.length > 0 ? privacyCenterVisibility : undefined,\n isRequiredInForm,\n placeholder: placeholder || undefined,\n dataSubjects: dataSubjects.length > 0 ? dataSubjects.map(({ type }) => type) : undefined,\n displayTitle: displayTitle?.defaultMessage,\n displayDescription: displayDescription?.defaultMessage,\n displayOrder,\n isUniqueOnPreferenceStore,\n }),\n );\n }\n\n // Save agents\n if (agents.length > 0 && resources.includes(TranscendPullResource.Agents)) {\n result.agents = agents.map(\n ({\n name,\n agentId,\n description,\n instructions,\n codeInterpreterEnabled,\n retrievalEnabled,\n prompt,\n largeLanguageModel,\n teams,\n owners,\n agentFunctions,\n agentFiles,\n }): AgentInput => ({\n name,\n agentId,\n description: description || undefined,\n instructions,\n codeInterpreterEnabled,\n retrievalEnabled,\n prompt: prompt?.title,\n 'large-language-model': {\n name: largeLanguageModel.name,\n client: largeLanguageModel.client,\n },\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n 'agent-functions':\n agentFunctions && agentFunctions.length > 0\n ? agentFunctions.map(({ name }) => name)\n : undefined,\n 'agent-files':\n agentFiles && agentFiles.length > 0 ? agentFiles.map(({ name }) => name) : undefined,\n }),\n );\n }\n\n // Save action items\n if (actionItems.length > 0 && resources.includes(TranscendPullResource.ActionItems)) {\n result['action-items'] = actionItems.map(\n ({\n teams,\n users,\n customerExperienceActionItemIds: [customerExperienceActionItemId],\n dueDate,\n priority,\n resolved,\n collections,\n notes,\n link,\n title,\n type,\n attributeValues,\n }): ActionItemInput => ({\n teams: teams.map(({ name }) => name),\n users: users.map(({ email }) => email),\n dueDate: dueDate || undefined,\n title,\n notes,\n customerExperienceActionItemId,\n collections: collections.map(({ title }) => title),\n link,\n priority: priority || undefined,\n resolved,\n type,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save action item collections\n if (\n actionItemCollections.length > 0 &&\n resources.includes(TranscendPullResource.ActionItemCollections)\n ) {\n result['action-item-collections'] = actionItemCollections.map(\n ({ title, description, hidden, productLine }): ActionItemCollectionInput => ({\n title,\n description: description || undefined,\n hidden,\n productLine,\n }),\n );\n }\n\n // Save agent functions\n if (agentFunctions.length > 0 && resources.includes(TranscendPullResource.AgentFunctions)) {\n result['agent-functions'] = agentFunctions.map(\n ({ name, description, parameters }): AgentFunctionInput => ({\n name,\n description,\n parameters: JSON.stringify(parameters),\n }),\n );\n }\n\n // Save agent files\n if (agentFiles.length > 0 && resources.includes(TranscendPullResource.AgentFiles)) {\n result['agent-files'] = agentFiles.map(\n ({ name, description, fileId, size, purpose }): AgentFileInput => ({\n name,\n description,\n fileId,\n size,\n purpose,\n }),\n );\n }\n\n // Save vendors\n if (vendors.length > 0 && resources.includes(TranscendPullResource.Vendors)) {\n result.vendors = vendors.map(\n ({\n title,\n description,\n dataProcessingAgreementLink,\n contactName,\n contactPhone,\n address,\n headquarterCountry,\n headquarterSubDivision,\n websiteUrl,\n businessEntity,\n teams,\n owners,\n attributeValues,\n }): VendorInput => ({\n title,\n description: description || undefined,\n dataProcessingAgreementLink: dataProcessingAgreementLink || undefined,\n contactName: contactName || undefined,\n contactPhone: contactPhone || undefined,\n address: address || undefined,\n headquarterCountry: headquarterCountry || undefined,\n headquarterSubDivision: headquarterSubDivision || undefined,\n websiteUrl: websiteUrl || undefined,\n businessEntity: businessEntity?.title,\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save data categories\n if (dataCategories.length > 0 && resources.includes(TranscendPullResource.DataCategories)) {\n result['data-categories'] = dataCategories.map(\n ({\n name,\n category,\n description,\n regex,\n owners,\n teams,\n attributeValues,\n }): DataCategoryInput => ({\n name,\n category,\n description: description || undefined,\n regex: regex || undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save processing purposes\n if (\n processingPurposes.length > 0 &&\n resources.includes(TranscendPullResource.ProcessingPurposes)\n ) {\n result['processing-purposes'] = processingPurposes.map(\n ({ name, purpose, description, owners, teams, attributeValues }): ProcessingPurposeInput => ({\n name,\n purpose,\n description: description || undefined,\n owners: owners && owners.length > 0 ? owners.map(({ email }) => email) : undefined,\n teams: teams && teams.length > 0 ? teams.map(({ name }) => name) : undefined,\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save data flows\n if (dataFlows.length > 0 && resources.includes(TranscendPullResource.DataFlows)) {\n result['data-flows'] = dataFlows.map(\n ({\n value,\n type,\n description,\n trackingType,\n service,\n status,\n owners,\n teams,\n attributeValues,\n }): DataFlowInput => ({\n value,\n type,\n description: description || undefined,\n trackingPurposes: trackingType,\n status,\n service: service?.integrationName,\n owners: owners.map(({ email }) => email),\n teams: teams.map(({ name }) => name),\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save cookies\n if (cookies.length > 0 && resources.includes(TranscendPullResource.Cookies)) {\n result.cookies = cookies.map(\n ({\n name,\n isRegex,\n description,\n trackingPurposes,\n service,\n status,\n owners,\n teams,\n attributeValues,\n }): CookieInput => ({\n name,\n isRegex,\n description: description || undefined,\n trackingPurposes,\n status,\n service: service?.integrationName,\n owners: owners.map(({ email }) => email),\n teams: teams.map(({ name }) => name),\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n }),\n );\n }\n\n // Save attributes\n if (attributes.length > 0 && resources.includes(TranscendPullResource.Attributes)) {\n result.attributes = attributes.map(\n ({ description, name, type, values, enabledOn = [] }): AttributeInput => ({\n description: description || undefined,\n resources: enabledOn,\n name,\n type,\n values: values.map(({ name, color, description }) => ({\n name,\n color: color || undefined,\n description,\n })),\n }),\n );\n }\n\n // save purposes\n if (purposes.length > 0) {\n result.purposes = purposes.map(\n ({\n name,\n description,\n trackingType,\n defaultConsent,\n configurable,\n showInConsentManager,\n isActive,\n displayOrder,\n optOutSignals,\n authLevel,\n topics,\n showInPrivacyCenter,\n title,\n }): ConsentPurpose => ({\n name,\n title,\n description: description || undefined,\n trackingType,\n 'default-consent': defaultConsent,\n configurable,\n 'show-in-consent-manager': showInConsentManager,\n 'show-in-privacy-center': showInPrivacyCenter,\n 'is-active': isActive,\n 'display-order': displayOrder,\n 'opt-out-signals': optOutSignals.length > 0 ? optOutSignals : undefined,\n 'auth-level': authLevel || undefined,\n 'preference-topics': topics.map(\n ({\n slug,\n title,\n type,\n color,\n displayDescription,\n defaultConfiguration,\n showInPrivacyCenter,\n preferenceOptionValues,\n }): ConsentPreferenceTopic => ({\n slug,\n title: title.defaultMessage,\n type,\n color,\n description: displayDescription.defaultMessage,\n 'default-configuration': defaultConfiguration,\n 'show-in-privacy-center': showInPrivacyCenter,\n options:\n type === PreferenceTopicType.Boolean\n ? []\n : preferenceOptionValues.map(({ title, slug }) => ({\n title: title.defaultMessage,\n slug,\n })),\n }),\n ),\n }),\n );\n }\n\n if (workflowConfigs.length > 0 && resources.includes(TranscendPullResource.WorkflowConfigs)) {\n const pulledWorkflowConfigs = workflowConfigs.map(\n (config): WorkflowConfigInput => ({\n title: config.title.defaultMessage,\n 'action-type': config.action.type,\n ...(config.internalName ? { 'internal-name': config.internalName } : {}),\n ...(config.subtitle ? { subtitle: config.subtitle.defaultMessage } : {}),\n ...(config.description ? { description: config.description.defaultMessage } : {}),\n ...(config.subject ? { 'data-subject-type': config.subject.type } : {}),\n visibility: config.workflowConfigVisibility,\n type: config.workflowConfigType,\n ...(config.collectDataSubjectRegions\n ? {\n 'collect-data-subject-regions': config.collectDataSubjectRegions,\n }\n : {}),\n ...(config.regionList.length > 0 ? { 'region-list': config.regionList } : {}),\n ...(config.expiryTime && config.expiryTime.length > 0\n ? { 'expiry-time': config.expiryTime }\n : {}),\n ...(config.WorkflowConfigAttributeKeys && config.WorkflowConfigAttributeKeys.length > 0\n ? {\n 'attribute-keys': config.WorkflowConfigAttributeKeys.map(\n ({ attributeKey }) => attributeKey.name,\n ),\n }\n : {}),\n }),\n );\n // TODO: https://linear.app/transcend/issue/WAL-10312 - remove once internalName is unique in DB\n const configsByMatchKey = groupBy(workflowConfigs, workflowConfigMatchKey);\n for (const configs of Object.values(configsByMatchKey)) {\n if (configs.length > 1) {\n const sample = configs[0];\n logger.warn(\n `Found \"${configs.length}\" workflow configs with the same title, action-type, ` +\n `data-subject-type, and region-list for \"${sample.title.defaultMessage}\" ` +\n `(${sample.action.type}). Push will fail until they are disambiguated ` +\n '(for example with unique internal names).',\n );\n }\n }\n if (pulledWorkflowConfigs.length > 0) {\n result['workflow-configs'] = pulledWorkflowConfigs;\n }\n }\n\n if (\n preferenceOptionValues.length > 0 &&\n resources.includes(TranscendPullResource.PreferenceOptions)\n ) {\n result['preference-options'] = preferenceOptionValues.map(\n ({ slug, title }): ConsentPreferenceTopicOptionValue => ({\n slug,\n title: title.defaultMessage,\n }),\n );\n }\n\n // save email templates\n if (\n dataSiloIds.length === 0 &&\n templates.length > 0 &&\n resources.includes(TranscendPullResource.Templates)\n ) {\n result.templates = templates.map(({ title }) => ({ title }));\n }\n\n // Save enrichers\n if (enrichers.length > 0 && resources.includes(TranscendPullResource.Enrichers)) {\n result.enrichers = enrichers.map(\n ({\n title,\n url,\n type,\n inputIdentifier,\n identifiers,\n actions,\n testRegex,\n dataSubjects,\n expirationDuration,\n lookerQueryTitle,\n transitionRequestStatus,\n phoneNumbers,\n regionList,\n }): EnricherInput => ({\n title,\n url: url || undefined,\n type,\n 'input-identifier': inputIdentifier?.name,\n 'output-identifiers': identifiers.map(({ name }) => name),\n 'privacy-actions':\n Object.values(RequestAction).length === actions.length ? undefined : actions,\n testRegex: testRegex || undefined,\n lookerQueryTitle: lookerQueryTitle || undefined,\n expirationDuration: parseInt(expirationDuration, 10),\n transitionRequestStatus: transitionRequestStatus || undefined,\n phoneNumbers: phoneNumbers && phoneNumbers.length > 0 ? phoneNumbers : undefined,\n regionList: regionList && regionList.length > 0 ? regionList : undefined,\n 'data-subjects': dataSubjects.map(({ type }) => type),\n }),\n );\n }\n\n // Save data silos\n if (dataSilos.length > 0 && resources.includes(TranscendPullResource.DataSilos)) {\n const indexedDataSubjects = keyBy(dataSubjects, 'type');\n result['data-silos'] = dataSilos.map(\n ([\n {\n title,\n description,\n url,\n type,\n outerType,\n apiKeys,\n notifyEmailAddress,\n identifiers,\n dependentDataSilos,\n owners,\n country,\n countrySubDivision,\n teams,\n subjectBlocklist,\n isLive,\n promptAVendorEmailSendFrequency,\n promptAVendorEmailSendType,\n promptAVendorEmailIncludeIdentifiersAttachment,\n promptAVendorEmailCompletionLinkType,\n manualWorkRetryFrequency,\n catalog,\n attributeValues,\n discoveredBy,\n businessEntities,\n sombra,\n },\n dataPoints,\n ]): DataSiloInput => ({\n title,\n description,\n integrationName: type,\n 'outer-type': outerType || undefined,\n url: url || undefined,\n 'api-key-title': apiKeys[0]?.title,\n 'sombra-id': sombra?.id || undefined,\n 'identity-keys': identifiers\n .filter(({ isConnected }) => isConnected)\n .map(({ name }) => name),\n ...(dependentDataSilos.length > 0\n ? {\n 'deletion-dependencies': dependentDataSilos.map(({ title }) => title),\n }\n : {}),\n ...(owners.length > 0 ? { owners: owners.map(({ email }) => email) } : {}),\n ...(teams.length > 0 ? { teams: teams.map(({ name }) => name) } : {}),\n ...(discoveredBy.length > 0\n ? { discoveredBy: discoveredBy.map(({ title }) => title) }\n : {}),\n ...(businessEntities.length > 0\n ? {\n businessEntities: businessEntities.map(({ title }) => title),\n }\n : {}),\n country: country || undefined,\n countrySubDivision: countrySubDivision || undefined,\n disabled: !isLive,\n 'data-subjects':\n subjectBlocklist.length > 0\n ? convertToDataSubjectAllowlist(\n subjectBlocklist.map(({ type }) => type),\n indexedDataSubjects,\n )\n : undefined,\n ...(catalog.hasAvcFunctionality\n ? {\n 'email-settings': {\n 'notify-email-address': notifyEmailAddress || undefined,\n 'send-frequency': promptAVendorEmailSendFrequency,\n 'send-type': promptAVendorEmailSendType,\n 'include-identifiers-attachment': promptAVendorEmailIncludeIdentifiersAttachment,\n 'completion-link-type': promptAVendorEmailCompletionLinkType,\n 'manual-work-retry-frequency': manualWorkRetryFrequency,\n },\n }\n : {}),\n attributes:\n attributeValues !== undefined && attributeValues.length > 0\n ? formatAttributeValues(attributeValues)\n : undefined,\n\n datapoints: dataPoints\n .map(\n (dataPoint): DatapointInput => ({\n key: dataPoint.name,\n title: dataPoint.title?.defaultMessage,\n description: dataPoint.description?.defaultMessage,\n owners: dataPoint.owners.map(({ email }) => email),\n teams: dataPoint.teams.map(({ name }) => name),\n ...(dataPoint.path.length > 0 ? { path: dataPoint.path } : {}),\n ...(dataPoint.dataCollection?.title\n ? {\n 'data-collection-tag': dataPoint.dataCollection.title.defaultMessage,\n }\n : {}),\n ...(dataPoint.dbIntegrationQueries.length > 0\n ? {\n 'privacy-action-queries': mapValues(\n keyBy(dataPoint.dbIntegrationQueries, 'requestType'),\n (databaseIntegrationQuery) =>\n databaseIntegrationQuery.suggestedQuery ||\n databaseIntegrationQuery.query ||\n undefined,\n ),\n }\n : {}),\n ...(dataPoint.subDataPoints.length > 0\n ? {\n fields: dataPoint.subDataPoints\n .map(\n (field): FieldInput => ({\n key: field.name,\n description: field.description,\n purposes: field.purposes,\n categories: field.categories,\n ...(includeGuessedCategories && field.pendingCategoryGuesses\n ? {\n 'guessed-categories': field.pendingCategoryGuesses\n .filter((guess) => guess.status === 'PENDING')\n .map((guess) => ({\n category: {\n name: guess.category.name,\n category: guess.category.category,\n },\n status: guess.status,\n confidence: guess.confidence,\n classifierVersion: guess.classifierVersion || undefined,\n })),\n }\n : {}),\n 'access-request-visibility-enabled': field.accessRequestVisibilityEnabled,\n 'erasure-request-redaction-enabled': field.erasureRequestRedactionEnabled,\n attributes:\n field.attributeValues !== undefined && field.attributeValues.length > 0\n ? formatAttributeValues(field.attributeValues)\n : undefined,\n }),\n )\n .sort((a, b) => a.key.localeCompare(b.key)),\n }\n : {}),\n 'privacy-actions': dataPoint.actionSettings\n .filter(({ active }) => active)\n .map(({ type }) => type),\n }),\n )\n .sort((a, b) =>\n [...(a.path ?? []), a.key]\n .join('.')\n .localeCompare([...(b.path ?? []), b.key].join('.')),\n ),\n }),\n );\n }\n return result;\n}\n/* eslint-enable max-lines */\n"],"mappings":"4nDAUA,MAAa,EAAuB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmD3B,EAA0B;;;;;ECJtC,eAAsB,EACpB,EAC+B,CAC/B,IAAM,EAA4C,EAAE,CAChD,EAAS,EAET,EAAiB,GACrB,EAAG,CACD,GAAM,CACJ,wBAAyB,CAAE,UACzB,MAAM,EAMP,EAAQ,EAAsB,CAC/B,UAAW,CAAE,MAAO,GAAW,SAAQ,CACvC,SACD,CAAC,CACF,EAAoB,KAAK,GAAG,EAAM,CAClC,GAAU,GACV,EAAiB,EAAM,SAAW,SAC3B,GAET,OAAO,EAAoB,MAAM,EAAG,IAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC,CCyB3E,MAAa,EAAmC,+CAK/C,CA8BD,eAAsB,EACpB,EACA,CACE,cACA,mBACA,QACA,YAAY,EACZ,WACA,kBACA,2BACA,qBACA,kBAAkB,OAAO,OAA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cACf,IACE,IAAuB,CACtB,IAAK,EAAM,KACX,YAAa,EAAM,YACnB,SAAU,EAAM,SAChB,WAAY,EAAM,WAClB,GAAI,GAA4B,EAAM,uBAClC,CACE,qBAAsB,EAAM,uBACzB,OAAQ,GAAU,EAAM,SAAW,UAAU,CAC7C,IAAK,IAAW,CACf,SAAU,CACR,KAAM,EAAM,SAAS,KACrB,SAAU,EAAM,SAAS,SAC1B,CACD,OAAQ,EAAM,OACd,WAAY,EAAM,WAClB,kBAAmB,EAAM,mBAAqB,IAAA,GAC/C,EAAE,CACN,CACD,EAAE,CACN,oCAAqC,EAAM,+BAC3C,oCAAqC,EAAM,+BAC3C,WACE,EAAM,kBAAoB,IAAA,IAAa,EAAM,gBAAgB,OAAS,EAClE,EAAsB,EAAM,gBAAgB,CAC5C,IAAA,GACP,EACF,CACA,MAAM,EAAG,IAAM,EAAE,IAAI,cAAc,EAAE,IAAI,CAAC,CAC9C,CACD,EAAE,CACN,kBAAmB,EAAU,eAC1B,QAAQ,CAAE,YAAa,EAAO,CAC9B,KAAK,CAAE,UAAW,EAAK,CAC3B,EACF,CACA,MAAM,EAAG,IACR,CAAC,GAAI,EAAE,MAAQ,EAAE,CAAG,EAAE,IAAI,CACvB,KAAK,IAAI,CACT,cAAc,CAAC,GAAI,EAAE,MAAQ,EAAE,CAAG,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,CACvD,CACJ,EACF,CAEH,OAAO"}
|
package/dist/{pushCronIdentifiersFromCsv-7M24AbQL.mjs → pushCronIdentifiersFromCsv-BEPg03aD.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=pushCronIdentifiersFromCsv-
|
|
1
|
+
import{a as e}from"./constants-BesTSxZW.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./readCsv-D1e7WRTc.mjs";import{chunk as r}from"lodash-es";import i from"colors";import*as a from"io-ts";import{createSombraGotInstance as o}from"@transcend-io/sdk";import{map as s,mapSeries as c}from"@transcend-io/utils";import l from"cli-progress";const u=a.type({nonce:a.string,identifier:a.string});async function d(e,{nonce:t,identifier:n}){try{return await e.put(`v1/data-silo`,{headers:{"x-transcend-nonce":t},json:{profiles:[{profileId:n}]}}),!0}catch(e){if(e.response?.statusCode===409)return!1;throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function f({file:a,dataSiloId:f,auth:p,sombraAuth:m,concurrency:h=100,transcendUrl:g=e,sleepSeconds:_=10}){let v=await o(g,p,{logger:t,sombraApiKey:m,sombraUrl:process.env.SOMBRA_URL});t.info(i.magenta(`Reading "${a}" from disk`));let y=n(a,u);t.info(i.magenta(`Notifying Transcend for data silo "${f}" marking "${y.length}" identifiers as completed.`));let b=new Date().getTime(),x=new l.SingleBar({},l.Presets.shades_classic),S=0,C=0,w=0;x.start(y.length,0);let T=r(y,h),E=T.length;await c(T,async(e,n)=>{t.info(i.blue(`Processing chunk ${n+1}/${E} (${r.length} items)`)),await s(e,async e=>{try{await d(v,e)?S+=1:C+=1}catch(n){t.error(i.red(`Error notifying Transcend for identifier "${e.identifier}" - ${n?.message}`)),w+=1}x.update(S+C)}),_>0&&n<E-1&&(t.info(i.yellow(`Sleeping for ${_}s before next chunk...`)),await new Promise(e=>{setTimeout(e,_*1e3)}))}),x.stop();let D=new Date().getTime()-b;if(t.info(i.green(`Successfully notified Transcend for ${S} identifiers in "${D/1e3}" seconds!`)),C&&t.info(i.magenta(`There were ${C} identifiers that were not in a state to be updated.They likely have already been resolved.`)),w)throw t.error(i.red(`There were ${w} identifiers that failed to be updated. Please review the logs for more information.`)),Error(`Failed to update all identifiers`);return y.length}export{u as n,d as r,f as t};
|
|
2
|
+
//# sourceMappingURL=pushCronIdentifiersFromCsv-BEPg03aD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pushCronIdentifiersFromCsv-
|
|
1
|
+
{"version":3,"file":"pushCronIdentifiersFromCsv-BEPg03aD.mjs","names":[],"sources":["../src/lib/cron/markCronIdentifierCompleted.ts","../src/lib/cron/pushCronIdentifiersFromCsv.ts"],"sourcesContent":["import type { Got } from 'got';\nimport * as t from 'io-ts';\n\n/**\n * Minimal set required to mark as completed\n */\nexport const CronIdentifierPush = t.type({\n nonce: t.string,\n identifier: t.string,\n});\n\n/** Type override */\nexport type CronIdentifierPush = t.TypeOf<typeof CronIdentifierPush>;\n\n/**\n * Mark an identifier output by the cron job as completed.\n *\n * @see https://docs.transcend.io/docs/api-reference/PUT/v1/data-silo\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request, false if not in a state to update\n */\nexport async function markCronIdentifierCompleted(\n sombra: Got,\n { nonce, identifier }: CronIdentifierPush,\n): Promise<boolean> {\n try {\n // Make the GraphQL request\n await sombra.put('v1/data-silo', {\n headers: {\n 'x-transcend-nonce': nonce,\n },\n json: {\n profiles: [\n {\n profileId: identifier,\n },\n ],\n },\n });\n return true;\n } catch (err) {\n // handle gracefully\n if (err.response?.statusCode === 409) {\n return false;\n }\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { createSombraGotInstance } from '@transcend-io/sdk';\nimport { map, mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { chunk } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { readCsv } from '../requests/index.js';\nimport { markCronIdentifierCompleted, CronIdentifierPush } from './markCronIdentifierCompleted.js';\n\n/**\n * Given a CSV of cron job outputs, mark all requests as completed in Transcend\n *\n * @param options - Options\n * @returns Number of items marked as completed\n */\nexport async function pushCronIdentifiersFromCsv({\n file,\n dataSiloId,\n auth,\n sombraAuth,\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n sleepSeconds = 10,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** Upload concurrency */\n concurrency?: number;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Sleep time in seconds between chunks of concurrent calls */\n sleepSeconds?: number;\n}): Promise<number> {\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n // Read from CSV\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const activeResults = readCsv(file, CronIdentifierPush);\n\n // Notify Transcend\n logger.info(\n colors.magenta(\n `Notifying Transcend for data silo \"${dataSiloId}\" marking \"${activeResults.length}\" identifiers as completed.`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n let successCount = 0;\n let failureCount = 0;\n let errorCount = 0;\n progressBar.start(activeResults.length, 0);\n\n // Process in chunks with sleep intervals\n const chunks = chunk(activeResults, concurrency);\n const totalChunks = chunks.length;\n const processChunk = async (items: CronIdentifierPush[], chunkIndex: number): Promise<void> => {\n logger.info(\n colors.blue(`Processing chunk ${chunkIndex + 1}/${totalChunks} (${chunk.length} items)`),\n );\n\n // Process the items of the chunk concurrently\n await map(items, async (identifier) => {\n try {\n const success = await markCronIdentifierCompleted(sombra, identifier);\n if (success) {\n successCount += 1;\n } else {\n failureCount += 1;\n }\n } catch (e) {\n logger.error(\n colors.red(\n `Error notifying Transcend for identifier \"${identifier.identifier}\" - ${e?.message}`,\n ),\n );\n errorCount += 1;\n }\n progressBar.update(successCount + failureCount);\n });\n\n // Sleep between chunks (except for the last chunk)\n if (sleepSeconds > 0 && chunkIndex < totalChunks - 1) {\n logger.info(colors.yellow(`Sleeping for ${sleepSeconds}s before next chunk...`));\n\n await new Promise((resolve) => {\n setTimeout(resolve, sleepSeconds * 1000);\n });\n }\n };\n\n // Process all chunks sequentially\n await mapSeries(chunks, processChunk);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully notified Transcend for ${successCount} identifiers in \"${\n totalTime / 1000\n }\" seconds!`,\n ),\n );\n if (failureCount) {\n logger.info(\n colors.magenta(\n `There were ${failureCount} identifiers that were not in a state to be updated.` +\n 'They likely have already been resolved.',\n ),\n );\n }\n if (errorCount) {\n logger.error(\n colors.red(\n `There were ${errorCount} identifiers that failed to be updated. Please review the logs for more information.`,\n ),\n );\n throw new Error('Failed to update all identifiers');\n }\n return activeResults.length;\n}\n"],"mappings":"8VAMA,MAAa,EAAqB,EAAE,KAAK,CACvC,MAAO,EAAE,OACT,WAAY,EAAE,OACf,CAAC,CAaF,eAAsB,EACpB,EACA,CAAE,QAAO,cACS,CAClB,GAAI,CAcF,OAZA,MAAM,EAAO,IAAI,eAAgB,CAC/B,QAAS,CACP,oBAAqB,EACtB,CACD,KAAM,CACJ,SAAU,CACR,CACE,UAAW,EACZ,CACF,CACF,CACF,CAAC,CACK,SACA,EAAK,CAEZ,GAAI,EAAI,UAAU,aAAe,IAC/B,MAAO,GAET,MAAU,MAAM,kCAAkC,GAAK,UAAU,MAAQ,GAAK,UAAU,EC7B5F,eAAsB,EAA2B,CAC/C,OACA,aACA,OACA,aACA,cAAc,IACd,eAAe,EACf,eAAe,IAgBG,CAElB,IAAM,EAAS,MAAM,EAAwB,EAAc,EAAM,CAC/D,SACA,aAAc,EACd,UAAW,QAAQ,IAAI,WACxB,CAAC,CAGF,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAC1D,IAAM,EAAgB,EAAQ,EAAM,EAAmB,CAGvD,EAAO,KACL,EAAO,QACL,sCAAsC,EAAW,aAAa,EAAc,OAAO,6BACpF,CACF,CAGD,IAAM,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAEjF,EAAe,EACf,EAAe,EACf,EAAa,EACjB,EAAY,MAAM,EAAc,OAAQ,EAAE,CAG1C,IAAM,EAAS,EAAM,EAAe,EAAY,CAC1C,EAAc,EAAO,OAqC3B,MAAM,EAAU,EAAQ,MApCI,EAA6B,IAAsC,CAC7F,EAAO,KACL,EAAO,KAAK,oBAAoB,EAAa,EAAE,GAAG,EAAY,IAAI,EAAM,OAAO,SAAS,CACzF,CAGD,MAAM,EAAI,EAAO,KAAO,IAAe,CACrC,GAAI,CAEE,MADkB,EAA4B,EAAQ,EAAW,CAEnE,GAAgB,EAEhB,GAAgB,QAEX,EAAG,CACV,EAAO,MACL,EAAO,IACL,6CAA6C,EAAW,WAAW,MAAM,GAAG,UAC7E,CACF,CACD,GAAc,EAEhB,EAAY,OAAO,EAAe,EAAa,EAC/C,CAGE,EAAe,GAAK,EAAa,EAAc,IACjD,EAAO,KAAK,EAAO,OAAO,gBAAgB,EAAa,wBAAwB,CAAC,CAEhF,MAAM,IAAI,QAAS,GAAY,CAC7B,WAAW,EAAS,EAAe,IAAK,EACxC,GAK+B,CAErC,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAiBvB,GAfA,EAAO,KACL,EAAO,MACL,uCAAuC,EAAa,mBAClD,EAAY,IACb,YACF,CACF,CACG,GACF,EAAO,KACL,EAAO,QACL,cAAc,EAAa,6FAE5B,CACF,CAEC,EAMF,MALA,EAAO,MACL,EAAO,IACL,cAAc,EAAW,sFAC1B,CACF,CACS,MAAM,mCAAmC,CAErD,OAAO,EAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=pushManualEnrichmentIdentifiersFromCsv-
|
|
1
|
+
import{a as e}from"./constants-BesTSxZW.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{t as n}from"./readCsv-D1e7WRTc.mjs";import{o as r}from"./request-C4gYxn1p.mjs";import{uniq as i}from"lodash-es";import a from"colors";import*as o from"io-ts";import{buildTranscendGraphQLClient as s,createSombraGotInstance as c,makeGraphQLRequest as l}from"@transcend-io/sdk";import{map as u,splitCsvToList as d}from"@transcend-io/utils";const f=`https://app.transcend.io/privacy-requests/incoming-requests/`,p=o.record(o.string,o.string);async function m(e,{id:n,...r},o,s){if(!n){let e=`Request ID must be provided to enricher request.${s?` Found error in row: ${s}`:``}`;throw t.error(a.red(e)),Error(e)}let c=n.toLowerCase(),l=Object.entries(r).reduce((e,[t,n])=>i(d(n)).length===0?e:Object.assign(e,{[t]:i(d(n)).map(e=>({value:t===`email`?e.toLowerCase():e}))}),{});try{return await e.post(`v1/enrich-identifiers`,{headers:{"x-transcend-request-id":c,"x-transcend-enricher-id":o},json:{enrichedIdentifiers:l}}).json(),t.error(a.green(`Successfully enriched request: ${f}${c}`)),!0}catch(e){if(typeof e.response.body==`string`&&e.response.body.includes(`Cannot update a resolved RequestEnricher`))return t.warn(a.magenta(`Skipped enrichment for request: ${f}${c}, request is no longer in the enriching phase.`)),!1;throw t.error(a.red(`Failed to enricher identifiers for request with id: ${f}${c} - ${e.message} - ${e.response.body}`)),e}}async function h({file:i,auth:o,sombraAuth:d,enricherId:f,markSilent:h,concurrency:g=100,transcendUrl:_=e}){let v=await c(_,o,{logger:t,sombraApiKey:d,sombraUrl:process.env.SOMBRA_URL}),y=s(_,o);t.info(a.magenta(`Reading "${i}" from disk`));let b=n(i,p);t.info(a.magenta(`Enriching "${b.length}" privacy requests.`));let x=0,S=0,C=0;if(await u(b,async(e,n)=>{try{h&&(await l(y,r,{variables:{input:{id:e.id,isSilent:!0}},logger:t}),t.info(a.magenta(`Mark request as silent mode - ${e.id}`))),await m(v,e,f,n)?x+=1:S+=1}catch{C+=1}},{concurrency:g}),t.info(a.green(`Successfully notified Transcend! \n Success count: ${x}.`)),S>0&&t.info(a.magenta(`Skipped count: ${S}.`)),C>0)throw t.info(a.red(`Error Count: ${C}.`)),Error(`Failed to enrich: ${C} requests.`);return b.length}export{p as n,m as r,h as t};
|
|
2
|
+
//# sourceMappingURL=pushManualEnrichmentIdentifiersFromCsv-B0jKrYOZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pushManualEnrichmentIdentifiersFromCsv-
|
|
1
|
+
{"version":3,"file":"pushManualEnrichmentIdentifiersFromCsv-B0jKrYOZ.mjs","names":[],"sources":["../src/lib/manual-enrichment/enrichPrivacyRequest.ts","../src/lib/manual-enrichment/pushManualEnrichmentIdentifiersFromCsv.ts"],"sourcesContent":["import { splitCsvToList } from '@transcend-io/utils';\nimport colors from 'colors';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\nimport { uniq } from 'lodash-es';\n\nimport { logger } from '../../logger.js';\n\nconst ADMIN_URL = 'https://app.transcend.io/privacy-requests/incoming-requests/';\n/**\n * Minimal set required to mark as completed\n */\nexport const EnrichPrivacyRequest = t.record(t.string, t.string);\n\n/** Type override */\nexport type EnrichPrivacyRequest = t.TypeOf<typeof EnrichPrivacyRequest>;\n\n/**\n * Upload identifiers to a privacy request or mark request as\n *\n * @param sombra - Sombra instance configured to make requests\n * @param request - Request to enricher\n * @param enricherId - The ID of the enricher being uploaded to\n * @param index - Index of request ID\n * @returns True if enriched successfully, false if skipped, throws error if failed\n */\nexport async function enrichPrivacyRequest(\n sombra: Got,\n { id: rawId, ...rest }: EnrichPrivacyRequest,\n enricherId: string,\n index?: number,\n): Promise<boolean> {\n if (!rawId) {\n // error\n const msg = `Request ID must be provided to enricher request.${\n index ? ` Found error in row: ${index}` : ''\n }`;\n logger.error(colors.red(msg));\n throw new Error(msg);\n }\n\n const id = rawId.toLowerCase();\n\n // Pull out the identifiers\n const enrichedIdentifiers = Object.entries(rest).reduce(\n (acc, [key, value]) => {\n const values = uniq(splitCsvToList(value));\n return values.length === 0\n ? acc\n : Object.assign(acc, {\n [key]: uniq(splitCsvToList(value)).map((val) => ({\n value: key === 'email' ? val.toLowerCase() : val,\n })),\n });\n },\n {} as Record<string, string[]>,\n );\n\n // Make the GraphQL request\n try {\n await sombra\n .post('v1/enrich-identifiers', {\n headers: {\n 'x-transcend-request-id': id,\n 'x-transcend-enricher-id': enricherId,\n },\n json: {\n enrichedIdentifiers,\n },\n })\n .json();\n\n logger.error(colors.green(`Successfully enriched request: ${ADMIN_URL}${id}`));\n return true;\n } catch (err) {\n // skip if already enriched\n if (\n typeof err.response.body === 'string' &&\n err.response.body.includes('Cannot update a resolved RequestEnricher')\n ) {\n logger.warn(\n colors.magenta(\n `Skipped enrichment for request: ${ADMIN_URL}${id}, request is no longer in the enriching phase.`,\n ),\n );\n return false;\n }\n\n // error\n logger.error(\n colors.red(\n `Failed to enricher identifiers for request with id: ${ADMIN_URL}${id} - ${err.message} - ${err.response.body}`,\n ),\n );\n throw err;\n }\n}\n","import {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n makeGraphQLRequest,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { UPDATE_PRIVACY_REQUEST } from '../graphql/index.js';\nimport { readCsv } from '../requests/index.js';\nimport { enrichPrivacyRequest, EnrichPrivacyRequest } from './enrichPrivacyRequest.js';\n\n/**\n * Push a CSV of enriched requests back into Transcend\n *\n * @param options - Options\n * @returns Number of items processed\n */\nexport async function pushManualEnrichmentIdentifiersFromCsv({\n file,\n auth,\n sombraAuth,\n enricherId,\n markSilent,\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** ID of enricher being uploaded to */\n enricherId: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Mark requests in silent mode before enriching */\n markSilent?: boolean;\n}): Promise<number> {\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const activeResults = readCsv(file, EnrichPrivacyRequest);\n\n // Notify Transcend\n logger.info(colors.magenta(`Enriching \"${activeResults.length}\" privacy requests.`));\n\n let successCount = 0;\n let skippedCount = 0;\n let errorCount = 0;\n\n await map(\n activeResults,\n async (request, index) => {\n try {\n // Mark requests in silent mode before a certain date\n if (markSilent) {\n await makeGraphQLRequest(client, UPDATE_PRIVACY_REQUEST, {\n variables: {\n input: {\n id: request.id,\n isSilent: true,\n },\n },\n logger,\n });\n\n logger.info(colors.magenta(`Mark request as silent mode - ${request.id}`));\n }\n\n const result = await enrichPrivacyRequest(sombra, request, enricherId, index);\n if (result) {\n successCount += 1;\n } else {\n skippedCount += 1;\n }\n } catch {\n errorCount += 1;\n }\n },\n { concurrency },\n );\n\n logger.info(colors.green(`Successfully notified Transcend! \\n Success count: ${successCount}.`));\n\n if (skippedCount > 0) {\n logger.info(colors.magenta(`Skipped count: ${skippedCount}.`));\n }\n\n if (errorCount > 0) {\n logger.info(colors.red(`Error Count: ${errorCount}.`));\n throw new Error(`Failed to enrich: ${errorCount} requests.`);\n }\n\n return activeResults.length;\n}\n"],"mappings":"0aAQA,MAAM,EAAY,+DAIL,EAAuB,EAAE,OAAO,EAAE,OAAQ,EAAE,OAAO,CAchE,eAAsB,EACpB,EACA,CAAE,GAAI,EAAO,GAAG,GAChB,EACA,EACkB,CAClB,GAAI,CAAC,EAAO,CAEV,IAAM,EAAM,mDACV,EAAQ,wBAAwB,IAAU,KAG5C,MADA,EAAO,MAAM,EAAO,IAAI,EAAI,CAAC,CACnB,MAAM,EAAI,CAGtB,IAAM,EAAK,EAAM,aAAa,CAGxB,EAAsB,OAAO,QAAQ,EAAK,CAAC,QAC9C,EAAK,CAAC,EAAK,KACK,EAA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GACX,CACF,CACD,SACD,CAAC,CAEF,EAAO,KAAK,EAAO,QAAQ,iCAAiC,EAAQ,KAAK,CAAC,EAIxE,MADiB,EAAqB,EAAQ,EAAS,EAAY,EAAM,CAE3E,GAAgB,EAEhB,GAAgB,OAEZ,CACN,GAAc,IAGlB,CAAE,cAAa,CAChB,CAED,EAAO,KAAK,EAAO,MAAM,sDAAsD,EAAa,GAAG,CAAC,CAE5F,EAAe,GACjB,EAAO,KAAK,EAAO,QAAQ,kBAAkB,EAAa,GAAG,CAAC,CAG5D,EAAa,EAEf,MADA,EAAO,KAAK,EAAO,IAAI,gBAAgB,EAAW,GAAG,CAAC,CAC5C,MAAM,qBAAqB,EAAW,YAAY,CAG9D,OAAO,EAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_t as e}from"./codecs-
|
|
1
|
+
import{_t as e}from"./codecs-CbOFsh1R.mjs";import{decodeCodec as t}from"@transcend-io/type-utils";import{readFileSync as n,writeFileSync as r}from"node:fs";import i from"js-yaml";const a=/<<parameters\.(.+?)>>/,o=`parameters`;function s(e,t,n=``){let r=e;if(Object.entries(t).forEach(([e,t])=>{r=r.split(`<<${o}.${e}>>`).join(t)}),a.test(r)){let[,e]=a.exec(r)||[];throw Error(`Found variable that was not set: ${e}.
|
|
2
2
|
Make sure you are passing all parameters through the --${o}=${e}:value-for-param flag.
|
|
3
3
|
${n}`)}return r}function c(r,a={}){let o=s(n(r,`utf-8`),a,`Also check that there are no extra variables defined in your yaml: ${r}`);return t(e,i.load(o))}function l(n,a){r(n,i.dump(t(e,a)))}export{l as a,s as i,a as n,c as r,o as t};
|
|
4
|
-
//# sourceMappingURL=readTranscendYaml-
|
|
4
|
+
//# sourceMappingURL=readTranscendYaml-D-k8P4v1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readTranscendYaml-
|
|
1
|
+
{"version":3,"file":"readTranscendYaml-D-k8P4v1.mjs","names":[],"sources":["../src/lib/readTranscendYaml.ts"],"sourcesContent":["import { readFileSync, writeFileSync } from 'node:fs';\n\nimport { decodeCodec, ObjByString } from '@transcend-io/type-utils';\nimport yaml from 'js-yaml';\n\nimport { TranscendInput } from '../codecs.js';\n\nexport const VARIABLE_PARAMETERS_REGEXP = /<<parameters\\.(.+?)>>/;\nexport const VARIABLE_PARAMETERS_NAME = 'parameters';\n\n/**\n * Function that replaces variables in a text file.\n * Throws error if there are variables that have not been replaced\n *\n * @param input - Input text\n * @param variables - Variables to replace\n * @param extraErrorMessage - Additional error message text\n * @returns Output text\n */\nexport function replaceVariablesInYaml(\n input: string,\n variables: ObjByString,\n extraErrorMessage = '',\n): string {\n let contents = input;\n // Replace variables\n Object.entries(variables).forEach(([name, value]) => {\n contents = contents.split(`<<${VARIABLE_PARAMETERS_NAME}.${name}>>`).join(value);\n });\n\n // Throw error if unfilled variables\n if (VARIABLE_PARAMETERS_REGEXP.test(contents)) {\n const [, name] = VARIABLE_PARAMETERS_REGEXP.exec(contents) || [];\n throw new Error(\n `Found variable that was not set: ${name}.\nMake sure you are passing all parameters through the --${VARIABLE_PARAMETERS_NAME}=${name}:value-for-param flag.\n${extraErrorMessage}`,\n );\n }\n\n return contents;\n}\n\n/**\n * Read in the contents of a yaml file and validate that the shape\n * of the yaml file matches the codec API\n *\n * @param filePath - Path to yaml file\n * @param variables - Variables to fill in\n * @returns The contents of the yaml file, type-checked\n */\nexport function readTranscendYaml(filePath: string, variables: ObjByString = {}): TranscendInput {\n // Read in contents\n const fileContents = readFileSync(filePath, 'utf-8');\n\n // Replace variables\n const replacedVariables = replaceVariablesInYaml(\n fileContents,\n variables,\n `Also check that there are no extra variables defined in your yaml: ${filePath}`,\n );\n\n // Validate shape\n return decodeCodec(TranscendInput, yaml.load(replacedVariables));\n}\n\n/**\n * Write a Transcend configuration to disk\n *\n * @param filePath - Path to yaml file\n * @param input - The input to write out\n */\nexport function writeTranscendYaml(filePath: string, input: TranscendInput): void {\n writeFileSync(filePath, yaml.dump(decodeCodec(TranscendInput, input)));\n}\n"],"mappings":"mLAOA,MAAa,EAA6B,wBAC7B,EAA2B,aAWxC,SAAgB,EACd,EACA,EACA,EAAoB,GACZ,CACR,IAAI,EAAW,EAOf,GALA,OAAO,QAAQ,EAAU,CAAC,SAAS,CAAC,EAAM,KAAW,CACnD,EAAW,EAAS,MAAM,KAAK,EAAyB,GAAG,EAAK,IAAI,CAAC,KAAK,EAAM,EAChF,CAGE,EAA2B,KAAK,EAAS,CAAE,CAC7C,GAAM,EAAG,GAAQ,EAA2B,KAAK,EAAS,EAAI,EAAE,CAChE,MAAU,MACR,oCAAoC,EAAK;yDACU,EAAyB,GAAG,EAAK;EACxF,IACG,CAGH,OAAO,EAWT,SAAgB,EAAkB,EAAkB,EAAyB,EAAE,CAAkB,CAK/F,IAAM,EAAoB,EAHL,EAAa,EAAU,QAI9B,CACZ,EACA,sEAAsE,IACvE,CAGD,OAAO,EAAY,EAAgB,EAAK,KAAK,EAAkB,CAAC,CASlE,SAAgB,EAAmB,EAAkB,EAA6B,CAChF,EAAc,EAAU,EAAK,KAAK,EAAY,EAAgB,EAAM,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=removeUnverifiedRequestIdentifiers-
|
|
1
|
+
import{a as e}from"./constants-BesTSxZW.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{r as n}from"./fetchAllRequests-BCHpCeFo.mjs";import{RequestStatus as r}from"@transcend-io/privacy-types";import i from"colors";import{REMOVE_REQUEST_IDENTIFIERS as a,buildTranscendGraphQLClient as o,fetchAllRequestIdentifierMetadata as s,makeGraphQLRequest as c}from"@transcend-io/sdk";import{map as l}from"@transcend-io/utils";import u from"cli-progress";async function d({requestActions:d,identifierNames:f,auth:p,concurrency:m=20,transcendUrl:h=e}){let g=o(h,p),_=new Date().getTime(),v=new u.SingleBar({},u.Presets.shades_classic),y=await n(g,{actions:d,statuses:[r.Enriching]});t.info(i.magenta(`Fetched requests in preflight/enriching state.`));let b=0,x=0;v.start(y.length,0),await l(y,async e=>{let n=(await s(g,{filterBy:{requestId:e.id},logger:t})).filter(({isVerifiedAtLeastOnce:e,name:t})=>e===!1&&f.includes(t)).map(({id:e})=>e);n.length>0&&(await c(g,a,{variables:{input:{requestId:e.id,requestIdentifierIds:n}},logger:t}),x+=n.length),b+=1,v.update(b)},{concurrency:m}),v.stop();let S=new Date().getTime()-_;return t.info(i.green(`Successfully cleared out unverified identifiers "${S/1e3}" seconds for ${b} requests, ${x} identifiers were cleared out!`)),y.length}export{d as t};
|
|
2
|
+
//# sourceMappingURL=removeUnverifiedRequestIdentifiers-BIchFbPB.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeUnverifiedRequestIdentifiers-
|
|
1
|
+
{"version":3,"file":"removeUnverifiedRequestIdentifiers-BIchFbPB.mjs","names":[],"sources":["../src/lib/requests/removeUnverifiedRequestIdentifiers.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n fetchAllRequestIdentifierMetadata,\n makeGraphQLRequest,\n REMOVE_REQUEST_IDENTIFIERS,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchAllRequests } from '../graphql/index.js';\n\n/**\n * Remove a set of unverified request identifier\n *\n * @param options - Options\n * @returns Number of items marked as completed\n */\nexport async function removeUnverifiedRequestIdentifiers({\n requestActions,\n identifierNames,\n auth,\n concurrency = 20,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The request actions that should be restarted */\n requestActions: RequestAction[];\n /** Transcend API key authentication */\n auth: string;\n /** The set of identifier names to remove */\n identifierNames: string[];\n /** Concurrency to upload requests in parallel */\n concurrency?: number;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<number> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n // Pull in the requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n });\n\n // Notify Transcend\n logger.info(colors.magenta('Fetched requests in preflight/enriching state.'));\n\n let total = 0;\n let processed = 0;\n progressBar.start(allRequests.length, 0);\n await map(\n allRequests,\n async (requestToRestart) => {\n const requestIdentifiers = await fetchAllRequestIdentifierMetadata(client, {\n filterBy: { requestId: requestToRestart.id },\n logger,\n });\n const clearOut = requestIdentifiers\n .filter(\n ({ isVerifiedAtLeastOnce, name }) =>\n isVerifiedAtLeastOnce === false && identifierNames.includes(name),\n )\n .map(({ id }) => id);\n\n if (clearOut.length > 0) {\n await makeGraphQLRequest<{\n /** Whether we successfully uploaded the results */\n success: boolean;\n }>(client, REMOVE_REQUEST_IDENTIFIERS, {\n variables: {\n input: {\n requestId: requestToRestart.id,\n requestIdentifierIds: clearOut,\n },\n },\n logger,\n });\n processed += clearOut.length;\n }\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully cleared out unverified identifiers \"${\n totalTime / 1000\n }\" seconds for ${total} requests, ${processed} identifiers were cleared out!`,\n ),\n );\n return allRequests.length;\n}\n"],"mappings":"6bAqBA,eAAsB,EAAmC,CACvD,iBACA,kBACA,OACA,cAAc,GACd,eAAe,GAYG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,SAAU,CAAC,EAAc,UAAU,CACpC,CAAC,CAGF,EAAO,KAAK,EAAO,QAAQ,iDAAiD,CAAC,CAE7E,IAAI,EAAQ,EACR,EAAY,EAChB,EAAY,MAAM,EAAY,OAAQ,EAAE,CACxC,MAAM,EACJ,EACA,KAAO,IAAqB,CAK1B,IAAM,GAAW,MAJgB,EAAkC,EAAQ,CACzE,SAAU,CAAE,UAAW,EAAiB,GAAI,CAC5C,SACD,CAAC,EAEC,QACE,CAAE,wBAAuB,UACxB,IAA0B,IAAS,EAAgB,SAAS,EAAK,CACpE,CACA,KAAK,CAAE,QAAS,EAAG,CAElB,EAAS,OAAS,IACpB,MAAM,EAGH,EAAQ,EAA4B,CACrC,UAAW,CACT,MAAO,CACL,UAAW,EAAiB,GAC5B,qBAAsB,EACvB,CACF,CACD,SACD,CAAC,CACF,GAAa,EAAS,QAGxB,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EASvB,OAPA,EAAO,KACL,EAAO,MACL,oDACE,EAAY,IACb,gBAAgB,EAAM,aAAa,EAAU,gCAC/C,CACF,CACM,EAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=retryRequestDataSilos-
|
|
1
|
+
import{a as e}from"./constants-BesTSxZW.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{r as n}from"./fetchAllRequests-BCHpCeFo.mjs";import{RequestStatus as r}from"@transcend-io/privacy-types";import i from"colors";import{RETRY_REQUEST_DATA_SILO as a,buildTranscendGraphQLClient as o,fetchRequestDataSilo as s,makeGraphQLRequest as c}from"@transcend-io/sdk";import{map as l}from"@transcend-io/utils";import u from"cli-progress";async function d({requestActions:d,dataSiloId:f,auth:p,concurrency:m=20,transcendUrl:h=e}){let g=o(h,p),_=new Date().getTime(),v=new u.SingleBar({},u.Presets.shades_classic),y=await n(g,{actions:d,statuses:[r.Compiling,r.Approving]});t.info(i.magenta(`Retrying requests for Data Silo: "${f}", restarting "${y.length}" requests.`));let b=0,x=0;v.start(y.length,0),await l(y,async e=>{try{await c(g,a,{variables:{requestDataSiloId:(await s(g,{logger:t,filterBy:{requestId:e.id,dataSiloId:f}})).id},logger:t})}catch(e){if(!e.message.includes(`Failed to find RequestDataSilo`))throw e;x+=1}b+=1,v.update(b)},{concurrency:m}),v.stop();let S=new Date().getTime()-_;return t.info(i.green(`Successfully notified Transcend in "${S/1e3}" seconds for ${b} requests, ${x} requests were skipped because data silo was not attached to the request!`)),y.length}export{d as t};
|
|
2
|
+
//# sourceMappingURL=retryRequestDataSilos-DUfHyF_U.mjs.map
|
package/dist/{retryRequestDataSilos-CBQVt1KQ.mjs.map → retryRequestDataSilos-DUfHyF_U.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retryRequestDataSilos-
|
|
1
|
+
{"version":3,"file":"retryRequestDataSilos-DUfHyF_U.mjs","names":[],"sources":["../src/lib/requests/retryRequestDataSilos.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n makeGraphQLRequest,\n RETRY_REQUEST_DATA_SILO,\n fetchRequestDataSilo,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchAllRequests } from '../graphql/index.js';\n\n/**\n * Retry a set of RequestDataSilos\n *\n * @param options - Options\n * @returns Number of items marked as completed\n */\nexport async function retryRequestDataSilos({\n requestActions,\n dataSiloId,\n auth,\n concurrency = 20,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The request actions that should be restarted */\n requestActions: RequestAction[];\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** Concurrency to upload requests in parallel */\n concurrency?: number;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<number> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n\n // Pull in the requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Compiling, RequestStatus.Approving],\n });\n\n // Notify Transcend\n logger.info(\n colors.magenta(\n `Retrying requests for Data Silo: \"${dataSiloId}\", restarting \"${allRequests.length}\" requests.`,\n ),\n );\n\n let total = 0;\n let skipped = 0;\n progressBar.start(allRequests.length, 0);\n await map(\n allRequests,\n async (requestToRestart) => {\n try {\n const requestDataSilo = await fetchRequestDataSilo(client, {\n logger,\n filterBy: { requestId: requestToRestart.id, dataSiloId },\n });\n\n await makeGraphQLRequest<{\n /** Whether we successfully uploaded the results */\n success: boolean;\n }>(client, RETRY_REQUEST_DATA_SILO, {\n variables: { requestDataSiloId: requestDataSilo.id },\n logger,\n });\n } catch (err) {\n // some requests may not have this data silo connected\n if (!err.message.includes('Failed to find RequestDataSilo')) {\n throw err;\n }\n skipped += 1;\n }\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully notified Transcend in \"${\n totalTime / 1000\n }\" seconds for ${total} requests, ${skipped} requests were skipped because data silo was not attached to the request!`,\n ),\n );\n return allRequests.length;\n}\n"],"mappings":"6aAqBA,eAAsB,EAAsB,CAC1C,iBACA,aACA,OACA,cAAc,GACd,eAAe,GAYG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,SAAU,CAAC,EAAc,UAAW,EAAc,UAAU,CAC7D,CAAC,CAGF,EAAO,KACL,EAAO,QACL,qCAAqC,EAAW,iBAAiB,EAAY,OAAO,aACrF,CACF,CAED,IAAI,EAAQ,EACR,EAAU,EACd,EAAY,MAAM,EAAY,OAAQ,EAAE,CACxC,MAAM,EACJ,EACA,KAAO,IAAqB,CAC1B,GAAI,CAMF,MAAM,EAGH,EAAQ,EAAyB,CAClC,UAAW,CAAE,mBAAmB,MATJ,EAAqB,EAAQ,CACzD,SACA,SAAU,CAAE,UAAW,EAAiB,GAAI,aAAY,CACzD,CAAC,EAMgD,GAAI,CACpD,SACD,CAAC,OACK,EAAK,CAEZ,GAAI,CAAC,EAAI,QAAQ,SAAS,iCAAiC,CACzD,MAAM,EAER,GAAW,EAGb,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EASvB,OAPA,EAAO,KACL,EAAO,MACL,uCACE,EAAY,IACb,gBAAgB,EAAM,aAAa,EAAQ,2EAC7C,CACF,CACM,EAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=skipPreflightJobs-
|
|
1
|
+
import{a as e}from"./constants-BesTSxZW.mjs";import{t}from"./logger-B-LXIf3U.mjs";import{r as n}from"./fetchAllRequests-BCHpCeFo.mjs";import{RequestEnricherStatus as r,RequestStatus as i}from"@transcend-io/privacy-types";import a from"colors";import{SKIP_REQUEST_ENRICHER as o,buildTranscendGraphQLClient as s,fetchAllRequestEnrichers as c,makeGraphQLRequest as l}from"@transcend-io/sdk";import{map as u,mapSeries as d}from"@transcend-io/utils";import f from"cli-progress";async function p({enricherIds:p,auth:m,concurrency:h=100,transcendUrl:g=e}){let _=s(g,m),v=new Date().getTime(),y=await n(_,{statuses:[i.Enriching]});t.info(a.magenta(`Processing enricher: "${p.join(`,`)}" fetched "${y.length}" in enriching status.`));let b=new f.SingleBar({},f.Presets.shades_classic),x=0;b.start(y.length,0);let S=0;await u(y,async e=>{let n=(await c(_,{filterBy:{requestId:e.id},logger:t})).filter(e=>p.includes(e.enricher.id)&&![r.Resolved,r.Skipped].includes(e.status));n.length>0&&await d(n,async e=>{try{await l(_,o,{variables:{requestEnricherId:e.id},logger:t}),S+=1}catch(e){if(!e.message.includes(`Client error: Cannot skip Request enricher because it has already completed`))throw e}}),x+=1,b.update(x)},{concurrency:h}),b.stop();let C=new Date().getTime()-v;return t.info(a.green(`Successfully skipped "${S}" for "${y.length}" requests in "${C/1e3}" seconds!`)),y.length}export{p as t};
|
|
2
|
+
//# sourceMappingURL=skipPreflightJobs-DaFjvih9.mjs.map
|