@transcend-io/cli 10.26.0 → 10.27.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 -2
- package/dist/{app-CZX6ZV6X.mjs → app-yIN02N8n.mjs} +16 -16
- package/dist/{app-CZX6ZV6X.mjs.map → app-yIN02N8n.mjs.map} +1 -1
- package/dist/{approvePrivacyRequests-D1S2AYud.mjs → approvePrivacyRequests-CeIWBB3s.mjs} +2 -2
- package/dist/{approvePrivacyRequests-D1S2AYud.mjs.map → approvePrivacyRequests-CeIWBB3s.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-CnfZJ8MD.mjs → buildExamples-Bv-aYKDQ.mjs} +2 -2
- package/dist/{buildExamples-CnfZJ8MD.mjs.map → buildExamples-Bv-aYKDQ.mjs.map} +1 -1
- package/dist/{buildXdiSyncEndpoint-B4l998cU.mjs → buildXdiSyncEndpoint-Do_6DtLA.mjs} +2 -2
- package/dist/{buildXdiSyncEndpoint-B4l998cU.mjs.map → buildXdiSyncEndpoint-Do_6DtLA.mjs.map} +1 -1
- package/dist/{bulkRestartRequests-NAASQwvP.mjs → bulkRestartRequests-BOmqsdP0.mjs} +2 -2
- package/dist/{bulkRestartRequests-NAASQwvP.mjs.map → bulkRestartRequests-BOmqsdP0.mjs.map} +1 -1
- package/dist/{bulkRetryEnrichers-BEEVKtCH.mjs → bulkRetryEnrichers-DxAlkvdF.mjs} +2 -2
- package/dist/{bulkRetryEnrichers-BEEVKtCH.mjs.map → bulkRetryEnrichers-DxAlkvdF.mjs.map} +1 -1
- package/dist/{cancelPrivacyRequests-DM3Zamqd.mjs → cancelPrivacyRequests-CMIaonIz.mjs} +2 -2
- package/dist/{cancelPrivacyRequests-DM3Zamqd.mjs.map → cancelPrivacyRequests-CMIaonIz.mjs.map} +1 -1
- package/dist/{command-30CgpFvx.mjs → command-B5cyFEbQ.mjs} +2 -2
- package/dist/{command-30CgpFvx.mjs.map → command-B5cyFEbQ.mjs.map} +1 -1
- package/dist/{constants-CAOyAsNX.mjs → constants-Cdvbd9wA.mjs} +2 -2
- package/dist/{constants-CAOyAsNX.mjs.map → constants-Cdvbd9wA.mjs.map} +1 -1
- package/dist/{createExtraKeyHandler-DbWzaD4c.mjs → createExtraKeyHandler-DwvmPya4.mjs} +2 -2
- package/dist/{createExtraKeyHandler-DbWzaD4c.mjs.map → createExtraKeyHandler-DwvmPya4.mjs.map} +1 -1
- package/dist/{downloadPrivacyRequestFiles-DSOTFVU6.mjs → downloadPrivacyRequestFiles-DFJHFxhc.mjs} +2 -2
- package/dist/{downloadPrivacyRequestFiles-DSOTFVU6.mjs.map → downloadPrivacyRequestFiles-DFJHFxhc.mjs.map} +1 -1
- package/dist/{generateCrossAccountApiKeys-C3mCgp6X.mjs → generateCrossAccountApiKeys-D2v1Q25y.mjs} +2 -2
- package/dist/{generateCrossAccountApiKeys-C3mCgp6X.mjs.map → generateCrossAccountApiKeys-D2v1Q25y.mjs.map} +1 -1
- package/dist/{impl-B0fzc-Pd.mjs → impl-0Wi7NRgY.mjs} +2 -2
- package/dist/{impl-B0fzc-Pd.mjs.map → impl-0Wi7NRgY.mjs.map} +1 -1
- package/dist/{impl-GeXGMn5G.mjs → impl-0_NDQrqL.mjs} +2 -2
- package/dist/{impl-GeXGMn5G.mjs.map → impl-0_NDQrqL.mjs.map} +1 -1
- package/dist/{impl-yVmEK84l.mjs → impl-5AQ9WnQu.mjs} +2 -2
- package/dist/{impl-yVmEK84l.mjs.map → impl-5AQ9WnQu.mjs.map} +1 -1
- package/dist/{impl-C9KCLG7s2.mjs → impl-B4K4ATdt2.mjs} +2 -2
- package/dist/{impl-C9KCLG7s2.mjs.map → impl-B4K4ATdt2.mjs.map} +1 -1
- package/dist/{impl-8zmHCdih.mjs → impl-B5ohiMbB.mjs} +2 -2
- package/dist/{impl-8zmHCdih.mjs.map → impl-B5ohiMbB.mjs.map} +1 -1
- package/dist/{impl-z5TV6Spz2.mjs → impl-B9t6RaT_2.mjs} +2 -2
- package/dist/{impl-z5TV6Spz2.mjs.map → impl-B9t6RaT_2.mjs.map} +1 -1
- package/dist/{impl-C2DDZ1EB2.mjs → impl-BGjWdUXr2.mjs} +2 -2
- package/dist/{impl-C2DDZ1EB2.mjs.map → impl-BGjWdUXr2.mjs.map} +1 -1
- package/dist/{impl-CWqtBcmr.mjs → impl-BHwEfpwS.mjs} +2 -2
- package/dist/{impl-CWqtBcmr.mjs.map → impl-BHwEfpwS.mjs.map} +1 -1
- package/dist/{impl-CdOwXtLY2.mjs → impl-BLuzIING2.mjs} +2 -2
- package/dist/{impl-CdOwXtLY2.mjs.map → impl-BLuzIING2.mjs.map} +1 -1
- package/dist/{impl-CWVX0Xnv.mjs → impl-BPKmVsCu.mjs} +2 -2
- package/dist/{impl-CWVX0Xnv.mjs.map → impl-BPKmVsCu.mjs.map} +1 -1
- package/dist/{impl-DPC_ktM2.mjs → impl-B_z2cpM5.mjs} +2 -2
- package/dist/{impl-DPC_ktM2.mjs.map → impl-B_z2cpM5.mjs.map} +1 -1
- package/dist/{impl-DOQk-mfA.mjs → impl-BiPsqGy2.mjs} +2 -2
- package/dist/{impl-DOQk-mfA.mjs.map → impl-BiPsqGy2.mjs.map} +1 -1
- package/dist/{impl-DSCuy4GU2.mjs → impl-BiimBxqK2.mjs} +2 -2
- package/dist/{impl-DSCuy4GU2.mjs.map → impl-BiimBxqK2.mjs.map} +1 -1
- package/dist/{impl-Da1sv_hX2.mjs → impl-BnTQ0hb22.mjs} +2 -2
- package/dist/{impl-Da1sv_hX2.mjs.map → impl-BnTQ0hb22.mjs.map} +1 -1
- package/dist/{impl-1ueiw_XV2.mjs → impl-BuMucaCY2.mjs} +2 -2
- package/dist/{impl-1ueiw_XV2.mjs.map → impl-BuMucaCY2.mjs.map} +1 -1
- package/dist/{impl-D5fmpaDf2.mjs → impl-BwNYVPjm2.mjs} +2 -2
- package/dist/{impl-D5fmpaDf2.mjs.map → impl-BwNYVPjm2.mjs.map} +1 -1
- package/dist/{impl-DRjvMMeU2.mjs → impl-BwWmJnKY2.mjs} +2 -2
- package/dist/{impl-DRjvMMeU2.mjs.map → impl-BwWmJnKY2.mjs.map} +1 -1
- package/dist/{impl-BdG67mkj.mjs → impl-C2r4O1d_.mjs} +2 -2
- package/dist/{impl-BdG67mkj.mjs.map → impl-C2r4O1d_.mjs.map} +1 -1
- package/dist/{impl-DJHPOIQn2.mjs → impl-C788PUt-2.mjs} +2 -2
- package/dist/{impl-DJHPOIQn2.mjs.map → impl-C788PUt-2.mjs.map} +1 -1
- package/dist/{impl-y01BtY2r.mjs → impl-Cbgurxln.mjs} +2 -2
- package/dist/{impl-y01BtY2r.mjs.map → impl-Cbgurxln.mjs.map} +1 -1
- package/dist/{impl-D__B55Iu2.mjs → impl-CtZiiCk42.mjs} +2 -2
- package/dist/{impl-D__B55Iu2.mjs.map → impl-CtZiiCk42.mjs.map} +1 -1
- package/dist/{impl-DmbT1vXM2.mjs → impl-CykMHKZ_2.mjs} +2 -2
- package/dist/{impl-DmbT1vXM2.mjs.map → impl-CykMHKZ_2.mjs.map} +1 -1
- package/dist/{impl-_nJfGV8K2.mjs → impl-DQQ6zmPu2.mjs} +2 -2
- package/dist/{impl-_nJfGV8K2.mjs.map → impl-DQQ6zmPu2.mjs.map} +1 -1
- package/dist/{impl-BsPgb_kT.mjs → impl-DgVqSXyc.mjs} +2 -2
- package/dist/{impl-BsPgb_kT.mjs.map → impl-DgVqSXyc.mjs.map} +1 -1
- package/dist/{impl-B_1LPpGy.mjs → impl-DubeNRWl.mjs} +2 -2
- package/dist/{impl-B_1LPpGy.mjs.map → impl-DubeNRWl.mjs.map} +1 -1
- package/dist/{impl-_BPSoSwJ.mjs → impl-DvjEDoWg.mjs} +2 -2
- package/dist/{impl-_BPSoSwJ.mjs.map → impl-DvjEDoWg.mjs.map} +1 -1
- package/dist/{impl-YeYfan582.mjs → impl-DxHAM8YW2.mjs} +2 -2
- package/dist/{impl-YeYfan582.mjs.map → impl-DxHAM8YW2.mjs.map} +1 -1
- package/dist/{impl-DPmitBXR2.mjs → impl-KJXmA2AV2.mjs} +2 -2
- package/dist/{impl-DPmitBXR2.mjs.map → impl-KJXmA2AV2.mjs.map} +1 -1
- package/dist/{impl-BdTWl0Xm.mjs → impl-VAGhrv8_.mjs} +2 -2
- package/dist/{impl-BdTWl0Xm.mjs.map → impl-VAGhrv8_.mjs.map} +1 -1
- package/dist/{impl-Bbtnhcy02.mjs → impl-dVpI3HIZ2.mjs} +2 -2
- package/dist/{impl-Bbtnhcy02.mjs.map → impl-dVpI3HIZ2.mjs.map} +1 -1
- package/dist/{impl-B2yCuG6f2.mjs → impl-iRbmPAfz2.mjs} +2 -2
- package/dist/{impl-B2yCuG6f2.mjs.map → impl-iRbmPAfz2.mjs.map} +1 -1
- package/dist/{impl-DNtaoKI9.mjs → impl-sfa0ZIzo.mjs} +2 -2
- package/dist/{impl-DNtaoKI9.mjs.map → impl-sfa0ZIzo.mjs.map} +1 -1
- package/dist/{impl-DLypyDZV2.mjs → impl-sk7odDex2.mjs} +2 -2
- package/dist/{impl-DLypyDZV2.mjs.map → impl-sk7odDex2.mjs.map} +1 -1
- package/dist/{impl-B6_4iGM2.mjs → impl-vT81cEv-.mjs} +2 -2
- package/dist/{impl-B6_4iGM2.mjs.map → impl-vT81cEv-.mjs.map} +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{markRequestDataSiloIdsCompleted-CDV0Ppv2.mjs → markRequestDataSiloIdsCompleted-BQysGnE4.mjs} +2 -2
- package/dist/{markRequestDataSiloIdsCompleted-CDV0Ppv2.mjs.map → markRequestDataSiloIdsCompleted-BQysGnE4.mjs.map} +1 -1
- package/dist/{markSilentPrivacyRequests-DXLiS2jH.mjs → markSilentPrivacyRequests-B2IS5hoL.mjs} +2 -2
- package/dist/{markSilentPrivacyRequests-DXLiS2jH.mjs.map → markSilentPrivacyRequests-B2IS5hoL.mjs.map} +1 -1
- package/dist/{notifyPrivacyRequestsAdditionalTime-DPp0MyfT.mjs → notifyPrivacyRequestsAdditionalTime-DflTzDRg.mjs} +2 -2
- package/dist/{notifyPrivacyRequestsAdditionalTime-DPp0MyfT.mjs.map → notifyPrivacyRequestsAdditionalTime-DflTzDRg.mjs.map} +1 -1
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-rKefgKKC.mjs → pullChunkedCustomSiloOutstandingIdentifiers-BUi0WXb9.mjs} +2 -2
- package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-rKefgKKC.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-BUi0WXb9.mjs.map} +1 -1
- package/dist/{pullManualEnrichmentIdentifiersToCsv-Cbk-7ztw.mjs → pullManualEnrichmentIdentifiersToCsv-BwdUNMV5.mjs} +2 -2
- package/dist/{pullManualEnrichmentIdentifiersToCsv-Cbk-7ztw.mjs.map → pullManualEnrichmentIdentifiersToCsv-BwdUNMV5.mjs.map} +1 -1
- package/dist/pullTranscendConfiguration-DbRVLKq5.mjs +58 -0
- package/dist/pullTranscendConfiguration-DbRVLKq5.mjs.map +1 -0
- package/dist/{pushCronIdentifiersFromCsv-Dj-KEFpQ.mjs → pushCronIdentifiersFromCsv-BPLwrNmv.mjs} +2 -2
- package/dist/{pushCronIdentifiersFromCsv-Dj-KEFpQ.mjs.map → pushCronIdentifiersFromCsv-BPLwrNmv.mjs.map} +1 -1
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-CY4d1jQy.mjs → pushManualEnrichmentIdentifiersFromCsv-CLLs3z_J.mjs} +2 -2
- package/dist/{pushManualEnrichmentIdentifiersFromCsv-CY4d1jQy.mjs.map → pushManualEnrichmentIdentifiersFromCsv-CLLs3z_J.mjs.map} +1 -1
- package/dist/{removeUnverifiedRequestIdentifiers-BUJZoJD9.mjs → removeUnverifiedRequestIdentifiers-CDYC_eeP.mjs} +2 -2
- package/dist/{removeUnverifiedRequestIdentifiers-BUJZoJD9.mjs.map → removeUnverifiedRequestIdentifiers-CDYC_eeP.mjs.map} +1 -1
- package/dist/{retryRequestDataSilos-DATDTDin.mjs → retryRequestDataSilos-DF-T1Wnf.mjs} +2 -2
- package/dist/{retryRequestDataSilos-DATDTDin.mjs.map → retryRequestDataSilos-DF-T1Wnf.mjs.map} +1 -1
- package/dist/{skipPreflightJobs-C1go-m8K.mjs → skipPreflightJobs-GymxkAla.mjs} +2 -2
- package/dist/{skipPreflightJobs-C1go-m8K.mjs.map → skipPreflightJobs-GymxkAla.mjs.map} +1 -1
- package/dist/{skipRequestDataSilos-1ksexte3.mjs → skipRequestDataSilos-B6GoQLxk.mjs} +2 -2
- package/dist/{skipRequestDataSilos-1ksexte3.mjs.map → skipRequestDataSilos-B6GoQLxk.mjs.map} +1 -1
- package/dist/{streamPrivacyRequestsToCsv-7S52MmdS.mjs → streamPrivacyRequestsToCsv-CFZkTtYF.mjs} +2 -2
- package/dist/{streamPrivacyRequestsToCsv-7S52MmdS.mjs.map → streamPrivacyRequestsToCsv-CFZkTtYF.mjs.map} +1 -1
- package/dist/{updateConsentManagerVersionToLatest-CYGRh2Mf.mjs → updateConsentManagerVersionToLatest-Cf2rsNx6.mjs} +2 -2
- package/dist/{updateConsentManagerVersionToLatest-CYGRh2Mf.mjs.map → updateConsentManagerVersionToLatest-Cf2rsNx6.mjs.map} +1 -1
- package/dist/{uploadConsents-DxzUYFP_.mjs → uploadConsents-DIetBOK3.mjs} +2 -2
- package/dist/{uploadConsents-DxzUYFP_.mjs.map → uploadConsents-DIetBOK3.mjs.map} +1 -1
- package/dist/{uploadCookiesFromCsv-D33lINd-.mjs → uploadCookiesFromCsv-DbQePRJ3.mjs} +2 -2
- package/dist/{uploadCookiesFromCsv-D33lINd-.mjs.map → uploadCookiesFromCsv-DbQePRJ3.mjs.map} +1 -1
- package/dist/{uploadDataFlowsFromCsv-0oDEouPJ.mjs → uploadDataFlowsFromCsv-ChGxrbgU.mjs} +2 -2
- package/dist/{uploadDataFlowsFromCsv-0oDEouPJ.mjs.map → uploadDataFlowsFromCsv-ChGxrbgU.mjs.map} +1 -1
- package/dist/{uploadPrivacyRequestsFromCsv-CX7JRYjH.mjs → uploadPrivacyRequestsFromCsv-BgjyAtG5.mjs} +2 -2
- package/dist/{uploadPrivacyRequestsFromCsv-CX7JRYjH.mjs.map → uploadPrivacyRequestsFromCsv-BgjyAtG5.mjs.map} +1 -1
- package/package.json +8 -8
- package/dist/pullTranscendConfiguration-DFQkyoIo.mjs +0 -58
- package/dist/pullTranscendConfiguration-DFQkyoIo.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./enums-OiLcZ26O.mjs";import{a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./constants-
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./enums-OiLcZ26O.mjs";import{a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./constants-Cdvbd9wA.mjs";import{t as b}from"./logger-Ckep4QXn.mjs";import{$ as x,A as S,B as ee,C as te,D as ne,E as re,F as ie,G as ae,H as oe,I as se,J as ce,K as C,L as w,M as T,N as E,O as D,P as O,Q as k,R as A,S as j,T as M,U as N,V as P,W as F,X as I,Y as L,Z as R,_ as z,a as B,at as V,b as H,c as U,ct as W,d as G,dt as le,et as ue,f as de,ft as fe,g as pe,h as me,i as he,it as ge,j as _e,k as ve,l as ye,lt as be,m as xe,mt as Se,n as Ce,nt as we,o as Te,ot as Ee,p as De,pt as Oe,q as ke,r as Ae,rt as je,s as Me,st as Ne,t as Pe,tt as Fe,u as Ie,ut as Le,v as Re,w as ze,x as Be,y as Ve,z as He}from"./codecs-DJFlZLGT.mjs";import{a as Ue,i as We,n as Ge,r as Ke,t as qe}from"./readTranscendYaml-bL1qFPqv.mjs";import{i as Je,n as Ye,r as Xe,t as Ze}from"./mergeTranscendInputs-DjPe49yR.mjs";import{a as Qe,c as $e,i as et,l as tt,n as nt,o as rt,r as it,s as at,t as ot,u as st}from"./constants-C9xZJ9YW.mjs";import{n as ct,t as lt}from"./fuzzyMatchColumns-C1STZ_T1.mjs";import{a as ut,c as dt,d as ft,f as pt,i as mt,l as ht,n as gt,o as _t,r as vt,s as yt,t as bt,u as xt}from"./uploadPrivacyRequestsFromCsv-BgjyAtG5.mjs";import{n as St,t as Ct}from"./parseAttributesFromString-CYcxsS3n.mjs";import{t as wt}from"./readCsv--FfP8n-H.mjs";import{n as Tt,t as Et}from"./pullUnstructuredSubDataPointRecommendations-B9xIDPf2.mjs";import{a as Dt,i as Ot,n as kt,o as At,r as jt,t as Mt}from"./request-BIplTb3L.mjs";import{i as Nt,n as Pt,r as Ft,t as It}from"./pullTranscendConfiguration-DbRVLKq5.mjs";import{i as Lt,n as Rt,r as K,t as zt}from"./fetchAllRequests-DP24WqrP.mjs";import{a as Bt,i as Vt,n as Ht,r as Ut,t as Wt}from"./pullChunkedCustomSiloOutstandingIdentifiers-BUi0WXb9.mjs";import{n as Gt,r as Kt,t as qt}from"./syncCodePackages-Dhm5jI6B.mjs";import{t as Jt}from"./markSilentPrivacyRequests-B2IS5hoL.mjs";import{a as Yt,i as Xt,n as Zt,o as Qt,r as $t,t as en}from"./downloadPrivacyRequestFiles-DFJHFxhc.mjs";import{n as tn,r as nn,t as rn}from"./extractClientError-X9wJVqGq.mjs";import{t as an}from"./approvePrivacyRequests-CeIWBB3s.mjs";import{t as on}from"./notifyPrivacyRequestsAdditionalTime-DflTzDRg.mjs";import{t as sn}from"./cancelPrivacyRequests-CMIaonIz.mjs";import{n as cn,t as ln}from"./bulkRestartRequests-BOmqsdP0.mjs";import{t as un}from"./skipPreflightJobs-GymxkAla.mjs";import{t as dn}from"./bulkRetryEnrichers-DxAlkvdF.mjs";import{t as fn}from"./retryRequestDataSilos-DF-T1Wnf.mjs";import{n as q,r as J,t as pn}from"./streamPrivacyRequestsToCsv-CFZkTtYF.mjs";import{n as mn,r as hn,t as gn}from"./inquirer-B0OF_nRe.mjs";import{t as _n}from"./parseVariablesFromString-B4TUkJRF.mjs";import{t as vn}from"./collectParquetFilesOrExit-DVS9_OSv.mjs";import{t as yn}from"./collectCsvFilesOrExit-BPo8Mjy7.mjs";import{t as bn}from"./parquetToCsvOneFile-0O4iLz0t.mjs";import{a as xn,i as Sn,n as Cn,o as wn,r as Tn,s as En,t as Dn}from"./writeCsv-DMw5OmWp.mjs";import{t as On}from"./skipRequestDataSilos-B6GoQLxk.mjs";import{t as kn}from"./removeUnverifiedRequestIdentifiers-CDYC_eeP.mjs";import{t as An}from"./updateConsentManagerVersionToLatest-Cf2rsNx6.mjs";import{t as jn}from"./uploadDataFlowsFromCsv-ChGxrbgU.mjs";import{t as Mn}from"./uploadCookiesFromCsv-DbQePRJ3.mjs";import{t as Nn}from"./pullConsentManagerMetrics-C41UhU8u.mjs";import{n as Pn,r as Fn,t as In}from"./buildXdiSyncEndpoint-Do_6DtLA.mjs";import{t as Ln}from"./consentManagersToBusinessEntities-rf8_xu71.mjs";import{i as Rn,n as zn,r as Bn,t as Vn}from"./uploadConsents-DIetBOK3.mjs";import{n as Hn,r as Un,t as Wn}from"./pushCronIdentifiersFromCsv-BPLwrNmv.mjs";import{t as Gn}from"./markRequestDataSiloIdsCompleted-BQysGnE4.mjs";import{t as Kn}from"./generateCrossAccountApiKeys-D2v1Q25y.mjs";import{t as qn}from"./validateTranscendAuth-CAO5ktnu.mjs";import{t as Jn}from"./listFiles-C5kubvdN.mjs";import{t as Yn}from"./pullAllDatapoints-DJno8LkB.mjs";import{t as Xn}from"./pullManualEnrichmentIdentifiersToCsv-BwdUNMV5.mjs";import{n as Zn,r as Qn,t as $n}from"./pushManualEnrichmentIdentifiersFromCsv-CLLs3z_J.mjs";import{chunk as er,difference as tr}from"lodash-es";import{readFileSync as nr,readdirSync as rr,statSync as ir}from"node:fs";import{join as Y}from"node:path";import ar from"fast-glob";import X from"colors";import{UPDATE_OR_CREATE_COOKIES as or,buildTranscendGraphQLClient as sr,createSombraGotInstance as cr,fetchAllRequestIdentifiers as lr,fetchConsentManagerId as ur,makeGraphQLRequest as dr,validateSombraVersion as fr}from"@transcend-io/sdk";import{map as Z,mapSeries as pr}from"@transcend-io/utils";import{execSync as Q}from"child_process";async function $(e,t){let n=await ur(e,{logger:b});await pr(er(t,100),async t=>{await dr(e,or,{variables:{airgapBundleId:n,cookies:t.map(e=>({name:e.name,trackingPurposes:e.trackingPurposes&&e.trackingPurposes.length>0?e.trackingPurposes:void 0,description:e.description,service:e.service,status:e.status,attributes:e.attributes,isRegex:e.isRegex}))},logger:b})})}async function mr(e,t){let n=!1;b.info(X.magenta(`Syncing "${t.length}" cookies...`));let r=t.filter(e=>t.filter(t=>e.name===t.name&&e.isRegex===t.isRegex).length>1);if(r.length>0)throw Error(`Failed to upload cookies as there were non-unique entries found: ${r.map(({name:e})=>e).join(`,`)}`);try{b.info(X.magenta(`Upserting "${t.length}" new cookies...`)),await $(e,t),b.info(X.green(`Successfully synced ${t.length} cookies!`))}catch(e){n=!0,b.error(X.red(`Failed to create cookies! - ${e.message}`))}return!n}async function hr({auth:e,sombraAuth:t,actions:n=[],statuses:r=[],identifierSearch:a,pageLimit:o=100,concurrency:s=1,transcendUrl:c=i,createdAtBefore:l,skipRequestIdentifiers:u=!1,createdAtAfter:d,updatedAtBefore:f,updatedAtAfter:p,isTest:m}){let h=sr(c,e),g=await cr(c,e,{logger:b,sombraApiKey:t,sombraUrl:process.env.SOMBRA_URL}),_=``;l&&(_+=` before ${l.toISOString()}`),d&&(_+=`${_?`, and`:``} after ${d.toISOString()}`),b.info(X.magenta(`${n.length>0?`Pulling requests of type "${n.join(`" , "`)}"`:`Pulling all requests`}${_}`));let v=s>1&&d&&l,y=v?q(d,l,s):[{createdAtAfter:d,createdAtBefore:l}];v&&b.info(X.magenta(`Splitting date range into ${s} parallel chunks`));let x=(await Z(y,e=>K(h,{actions:n,text:a,statuses:r,createdAtBefore:e.createdAtBefore,createdAtAfter:e.createdAtAfter,updatedAtBefore:f,updatedAtAfter:p,isTest:m}),{concurrency:v?s:1})).flat();u||await fr(h,{logger:b});let S=u?x.map(e=>({...e,requestIdentifiers:[]})):await Z(x,async e=>{let t=await lr(h,g,{filterBy:{requestId:e.id},skipSombraCheck:!0,logger:b});return{...e,requestIdentifiers:t}},{concurrency:o});return b.info(X.magenta(`Pulled ${S.length} requests`)),{requestsWithRequestIdentifiers:S,requestsFormattedForCsv:S.map(J)}}function gr(e){try{return e?nr(e,`utf8`):``}catch{return``}}function _r(e){return rr(e).filter(t=>ir(Y(e,t)).isDirectory())}function vr(e){return e.replace(/(https?:\/\/[^\s]+)/g,`<link-omitted>`)}function yr(e){return Object.entries(e).reduce((e,[t,n])=>n!=null&&n!==``&&!(Array.isArray(n)&&n.length===0)&&!(typeof n==`object`&&Object.keys(n).length===0)?Object.assign(e,{[t]:n}):e,{})}function br({baseBranch:e,rootDirectory:t,githubRepo:n,excludedGlob:r=[],fileBlockList:i=[]}){Q(`git fetch origin ${e}`);let a=Q(`git ls-remote ${n} "refs/heads/${e}" | cut -f 1`,{encoding:`utf-8`}).split(`
|
|
2
2
|
`)[0],o=Q(`git rev-parse HEAD`,{encoding:`utf-8`}).split(`
|
|
3
3
|
`)[0];if(!a||!o)throw Error(`FAILED TO FIND COMMIT RANGE`);let s=tr(Q(`git fetch && git diff --name-only "${e||a}...${o}" -- ${t}`,{encoding:`utf-8`}).split(`
|
|
4
4
|
`).filter(e=>e),i),c=r.length>0?ar.sync(s,{ignore:r}):s,l={};return c.forEach(e=>{l[e]=Q(`git show ${o}:${e}`,{encoding:`utf-8`})}),{changedFiles:s,fileDiffs:l,repoName:n.split(`/`).pop().split(`.`)[0],commit:o}}export{v as ADMIN_DASH,p as ADMIN_DASH_DATAPOINTS,g as ADMIN_DASH_INTEGRATIONS,Mt as APPROVE_PRIVACY_REQUEST,Nt as ASSESSMENT_TEMPLATES,Pe as ActionInput,Ce as ActionItemCollectionInput,Ae as ActionItemInput,he as ApiKeyInput,B as AssessmentAnswerOptionInput,Te as AssessmentDisplayLogicInput,Me as AssessmentInput,U as AssessmentNestedRuleInput,ye as AssessmentResourceInput,Ie as AssessmentRetentionScheduleInput,G as AssessmentRuleInput,de as AssessmentSectionInput,De as AssessmentSectionQuestionInput,xe as AssessmentTemplateInput,mt as AttestedExtraIdentifiers,me as AttributeInput,pe as AttributePreview,z as AttributeValueInput,ot as BLANK,nt as BULK_APPLY,Re as BusinessEntityInput,kt as CANCEL_PRIVACY_REQUEST,it as CAN_APPLY_IN_BULK,et as CachedFileState,Qe as CachedRequestState,Ve as CodePackageInput,H as CodePackageSdk,rt as ColumnName,Be as ConsentManageExperienceInput,j as ConsentManagerInput,te as ConsentManagerServiceMetadata,ze as ConsentPreferenceTopic,M as ConsentPreferenceTopicOptionValue,re as ConsentPurpose,ne as CookieCsvInput,D as CookieInput,Ht as CronIdentifier,Hn as CronIdentifierPush,Ut as CronPartition,u as DEBUG,i as DEFAULT_TRANSCEND_API,m as DEFAULT_TRANSCEND_API_KEY,_ as DEFAULT_TRANSCEND_CONSENT_API,It as DEFAULT_TRANSCEND_PULL_RESOURCES,ve as DataCategoryGuessInput,S as DataCategoryInput,_e as DataCategoryPreviewInput,T as DataCategoryRecommendationInput,E as DataFlowCsvInput,O as DataFlowInput,ie as DataSiloInput,se as DataSubjectInput,w as DatapointInput,A as DeletionDependencies,He as DeletionDependency,ee as DeletionDependencyInput,P as DeletionDependencyReset,Tt as ENTRY_COUNT,Zn as EnrichPrivacyRequest,oe as EnricherInput,N as FieldInput,at as IDENTIFIER_BLOCK_LIST,In as IP_ADDRESS_REGEX,$e as IS_REQUIRED,F as IdentifierInput,ae as ImportOnetrustAssessmentsInput,$t as IntlMessage,C as IntlMessageInput,tt as NONE,jt as NOTIFY_ADDITIONAL_TIME,r as OneTrustFileFormat,t as OneTrustPullResource,n as OneTrustPullSource,Ct as ParsedAttributeInput,ke as PartitionInput,ce as PolicyInput,L as PreferenceWorkflowConfigInput,I as PreferenceWorkflowConfigPurposeInput,R as PrivacyCenterInput,zt as PrivacyRequest,ut as PrivacyRequestInput,tn as PrivacyRequestResponse,k as ProcessingActivityInput,x as ProcessingPurposeInput,ue as ProcessingPurposePreviewInput,Fe as PromptAVendorEmailSettings,Vn as PurposeMap,Ot as REQUESTS,Dt as REQUESTS_COUNT,a as RETRYABLE_BATCH_STATUSES,we as RegionInput,je as RepositoryInput,Xt as RequestFileMetadata,Yt as RequestFileMetadataResponse,Rt as RequestPurposeTrigger,ge as RiskAssignmentInput,V as RiskLogicInput,d as SCOPES_BY_TITLE,y as SCOPE_TITLES,Ee as SiloDiscoveryResultInput,Ne as SoftwareDevelopmentKitInput,W as StoredApiKey,st as SuccessfulRequest,o as TR_PULL_RESOURCE_SCOPE_MAP,s as TR_PUSH_RESOURCE_SCOPE_MAP,h as TR_YML_RESOURCE_TO_FIELD_NAME,be as TeamInput,Le as TemplateInput,le as TranscendInput,e as TranscendPullResource,At as UPDATE_PRIVACY_REQUEST,zn as USP_STRING_REGEX,qe as VARIABLE_PARAMETERS_NAME,Ge as VARIABLE_PARAMETERS_REGEXP,fe as VendorInput,Oe as WebhookHeader,Se as WorkflowConfigInput,Dn as appendCsvRowsOrdered,Cn as appendCsvSync,an as approvePrivacyRequests,Pn as buildXdiSyncEndpoint,ln as bulkRestartRequests,dn as bulkRetryEnrichers,sn as cancelPrivacyRequests,yn as collectCsvFilesOrExit,vn as collectParquetFilesOrExit,Ln as consentManagersToBusinessEntities,qt as createCodePackage,Rn as createConsentToken,l as description,Fn as domainToHost,en as downloadPrivacyRequestFiles,Qn as enrichPrivacyRequest,Je as ensureAllDataSubjectsExist,rn as extractClientError,Ft as fetchAllAssessmentTemplates,K as fetchAllRequests,Bt as fetchRequestDataSiloActiveCount,Lt as fetchRequestsTotalCount,yr as filterNullishValuesFromObject,xt as filterRows,J as formatRequestForCsv,lt as fuzzyMatchColumns,ct as fuzzySearch,Kn as generateCrossAccountApiKeys,Qt as getFileMetadataForPrivacyRequests,br as getGitFilesThatChanged,ft as getUniqueValuesForColumn,Tn as initCsvFile,gn as inquirerAutoComplete,mn as inquirerConfirmBoolean,hn as inquirerConfirmText,_r as listDirectories,Jn as listFiles,gt as mapColumnsToAttributes,vt as mapColumnsToIdentifiers,ht as mapCsvColumnsToApi,_t as mapCsvRowsToRequestInputs,pt as mapEnumValues,dt as mapRequestEnumValues,Un as markCronIdentifierCompleted,Gn as markRequestDataSiloIdsCompleted,Jt as markSilentPrivacyRequests,Ze as mergeTranscendInputs,f as name,yt as normalizeIdentifierValue,on as notifyPrivacyRequestsAdditionalTime,bn as parquetToCsvOneFile,St as parseAttributesFromString,Sn as parseFilePath,_n as parseVariablesFromString,Yn as pullAllDatapoints,Wt as pullChunkedCustomSiloOutstandingIdentifiers,Nn as pullConsentManagerMetrics,Vt as pullCronPageOfIdentifiers,Xn as pullManualEnrichmentIdentifiersToCsv,hr as pullPrivacyRequests,Pt as pullTranscendConfiguration,Et as pullUnstructuredSubDataPointRecommendations,Wn as pushCronIdentifiersFromCsv,$n as pushManualEnrichmentIdentifiersFromCsv,wt as readCsv,gr as readSafe,Ke as readTranscendYaml,vr as removeLinks,kn as removeUnverifiedRequestIdentifiers,We as replaceVariablesInYaml,cn as restartPrivacyRequest,fn as retryRequestDataSilos,un as skipPreflightJobs,On as skipRequestDataSilos,q as splitDateRange,Zt as streamPrivacyRequestFiles,pn as streamPrivacyRequestsToCsv,nn as submitPrivacyRequest,Gt as syncCodePackages,Ye as syncConfigurationToTranscend,mr as syncCookies,Xe as syncDataSilos,Kt as updateCodePackages,An as updateConsentManagerVersionToLatest,$ as updateOrCreateCookies,Bn as uploadConsents,Mn as uploadCookiesFromCsv,jn as uploadDataFlowsFromCsv,bt as uploadPrivacyRequestsFromCsv,qn as validateTranscendAuth,c as version,xn as writeCsv,wn as writeCsvSync,En as writeLargeCsv,Ue as writeTranscendYaml};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=markRequestDataSiloIdsCompleted-
|
|
1
|
+
import{a as e}from"./constants-Cdvbd9wA.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{RequestDataSiloStatus as n}from"@transcend-io/privacy-types";import r from"colors";import{CHANGE_REQUEST_DATA_SILO_STATUS as i,buildTranscendGraphQLClient as a,fetchRequestDataSilo as o,makeGraphQLRequest as s}from"@transcend-io/sdk";import{map as c}from"@transcend-io/utils";import l from"cli-progress";async function u({requestIds:u,dataSiloId:d,auth:f,concurrency:p=100,status:m=n.Resolved,transcendUrl:h=e}){let g=a(h,f),_=new Date().getTime(),v=new l.SingleBar({},l.Presets.shades_classic);t.info(r.magenta(`Notifying Transcend for data silo "${d}" marking "${u.length}" requests as completed.`));let y=0;v.start(u.length,0),await c(u,async e=>{let n=await o(g,{logger:t,filterBy:{requestId:e,dataSiloId:d}});try{await s(g,i,{variables:{requestDataSiloId:n.id,status:m},logger:t})}catch(e){if(!e.message.includes(`Client error: Request must be active:`)&&!e.message.includes(`Failed to find RequestDataSilo`))throw e}y+=1,v.update(y)},{concurrency:p}),v.stop();let b=new Date().getTime()-_;return t.info(r.green(`Successfully notified Transcend in "${b/1e3}" seconds!`)),u.length}export{u as t};
|
|
2
|
+
//# sourceMappingURL=markRequestDataSiloIdsCompleted-BQysGnE4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markRequestDataSiloIdsCompleted-
|
|
1
|
+
{"version":3,"file":"markRequestDataSiloIdsCompleted-BQysGnE4.mjs","names":[],"sources":["../src/lib/cron/markRequestDataSiloIdsCompleted.ts"],"sourcesContent":["import { RequestDataSiloStatus } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n makeGraphQLRequest,\n CHANGE_REQUEST_DATA_SILO_STATUS,\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';\n\n/**\n * Given a CSV of Request IDs, mark associated RequestDataSilos as completed\n *\n * @param options - Options\n * @returns Number of items marked as completed\n */\nexport async function markRequestDataSiloIdsCompleted({\n requestIds,\n dataSiloId,\n auth,\n concurrency = 100,\n status = RequestDataSiloStatus.Resolved,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The list of request ids to mark as completed */\n requestIds: string[];\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** Status to update requests to */\n status?: RequestDataSiloStatus;\n /** Upload concurrency */\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 // Notify Transcend\n logger.info(\n colors.magenta(\n `Notifying Transcend for data silo \"${dataSiloId}\" marking \"${requestIds.length}\" requests as completed.`,\n ),\n );\n\n let total = 0;\n progressBar.start(requestIds.length, 0);\n await map(\n requestIds,\n async (requestId) => {\n const requestDataSilo = await fetchRequestDataSilo(client, {\n logger,\n filterBy: { requestId, dataSiloId },\n });\n\n try {\n await makeGraphQLRequest<{\n /** Whether we successfully uploaded the results */\n success: boolean;\n }>(client, CHANGE_REQUEST_DATA_SILO_STATUS, {\n variables: {\n requestDataSiloId: requestDataSilo.id,\n status,\n },\n logger,\n });\n } catch (err) {\n if (\n !err.message.includes('Client error: Request must be active:') &&\n !err.message.includes('Failed to find RequestDataSilo')\n ) {\n throw err;\n }\n }\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(colors.green(`Successfully notified Transcend in \"${totalTime / 1000}\" seconds!`));\n return requestIds.length;\n}\n"],"mappings":"yYAoBA,eAAsB,EAAgC,CACpD,aACA,aACA,OACA,cAAc,IACd,SAAS,EAAsB,SAC/B,eAAe,GAcG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAGrF,EAAO,KACL,EAAO,QACL,sCAAsC,EAAW,aAAa,EAAW,OAAO,0BACjF,CACF,CAED,IAAI,EAAQ,EACZ,EAAY,MAAM,EAAW,OAAQ,EAAE,CACvC,MAAM,EACJ,EACA,KAAO,IAAc,CACnB,IAAM,EAAkB,MAAM,EAAqB,EAAQ,CACzD,SACA,SAAU,CAAE,YAAW,aAAY,CACpC,CAAC,CAEF,GAAI,CACF,MAAM,EAGH,EAAQ,EAAiC,CAC1C,UAAW,CACT,kBAAmB,EAAgB,GACnC,SACD,CACD,SACD,CAAC,OACK,EAAK,CACZ,GACE,CAAC,EAAI,QAAQ,SAAS,wCAAwC,EAC9D,CAAC,EAAI,QAAQ,SAAS,iCAAiC,CAEvD,MAAM,EAIV,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAGvB,OADA,EAAO,KAAK,EAAO,MAAM,uCAAuC,EAAY,IAAK,YAAY,CAAC,CACvF,EAAW"}
|
package/dist/{markSilentPrivacyRequests-DXLiS2jH.mjs → markSilentPrivacyRequests-B2IS5hoL.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=markSilentPrivacyRequests-
|
|
1
|
+
import{a as e}from"./constants-Cdvbd9wA.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{o as n}from"./request-BIplTb3L.mjs";import{r}from"./fetchAllRequests-DP24WqrP.mjs";import{RequestStatus as i}from"@transcend-io/privacy-types";import a from"colors";import{buildTranscendGraphQLClient as o,makeGraphQLRequest as s}from"@transcend-io/sdk";import{map as c}from"@transcend-io/utils";import l from"cli-progress";async function u({requestActions:u,auth:d,requestIds:f,statuses:p=[i.Compiling,i.RequestMade,i.Delayed,i.Approving,i.Secondary,i.Enriching,i.Waiting,i.SecondaryApproving],createdAtAfter:m,createdAtBefore:h,updatedAtBefore:g,updatedAtAfter:_,concurrency:v=100,transcendUrl:y=e}){let b=o(y,d),x=new Date().getTime(),S=new l.SingleBar({},l.Presets.shades_classic),C=await r(b,{actions:u,statuses:p,createdAtBefore:h,createdAtAfter:m,updatedAtBefore:g,updatedAtAfter:_,isSilent:!1,requestIds:f});t.info(a.magenta(`Marking "${C.length}" as silent mode.`));let w=0;S.start(C.length,0),await c(C,async e=>{await s(b,n,{variables:{input:{id:e.id,isSilent:!0}},logger:t}),w+=1,S.update(w)},{concurrency:v}),S.stop();let T=new Date().getTime()-x;return t.info(a.green(`Successfully marked ${w} requests as silent mode in "${T/1e3}" seconds!`)),C.length}export{u as t};
|
|
2
|
+
//# sourceMappingURL=markSilentPrivacyRequests-B2IS5hoL.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markSilentPrivacyRequests-
|
|
1
|
+
{"version":3,"file":"markSilentPrivacyRequests-B2IS5hoL.mjs","names":[],"sources":["../src/lib/requests/markSilentPrivacyRequests.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, makeGraphQLRequest } 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 { UPDATE_PRIVACY_REQUEST, fetchAllRequests } from '../graphql/index.js';\n\n/**\n * Mark a set of privacy requests to be in silent mode\n *\n * @param options - Options\n * @returns The number of requests marked silent\n */\nexport async function markSilentPrivacyRequests({\n requestActions,\n auth,\n requestIds,\n statuses = [\n RequestStatus.Compiling,\n RequestStatus.RequestMade,\n RequestStatus.Delayed,\n RequestStatus.Approving,\n RequestStatus.Secondary,\n RequestStatus.Enriching,\n RequestStatus.Waiting,\n RequestStatus.SecondaryApproving,\n ],\n createdAtAfter,\n createdAtBefore,\n updatedAtBefore,\n updatedAtAfter,\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The request actions that should be restarted */\n requestActions: RequestAction[];\n /** Transcend API key authentication */\n auth: string;\n /** Concurrency limit for approving */\n concurrency?: number;\n /** The request statuses to mark silent */\n statuses?: RequestStatus[];\n /** The set of privacy requests to mark silent */\n requestIds?: string[];\n /** Filter for requests created before this date */\n createdAtBefore?: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** 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,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isSilent: false,\n requestIds,\n });\n\n // Notify Transcend\n logger.info(colors.magenta(`Marking \"${allRequests.length}\" as silent mode.`));\n\n let total = 0;\n progressBar.start(allRequests.length, 0);\n await map(\n allRequests,\n async (requestToMarkSilent) => {\n await makeGraphQLRequest(client, UPDATE_PRIVACY_REQUEST, {\n variables: {\n input: {\n id: requestToMarkSilent.id,\n isSilent: true,\n },\n },\n logger,\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 marked ${total} requests as silent mode in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n return allRequests.length;\n}\n"],"mappings":"4ZAgBA,eAAsB,EAA0B,CAC9C,iBACA,OACA,aACA,WAAW,CACT,EAAc,UACd,EAAc,YACd,EAAc,QACd,EAAc,UACd,EAAc,UACd,EAAc,UACd,EAAc,QACd,EAAc,mBACf,CACD,iBACA,kBACA,kBACA,iBACA,cAAc,IACd,eAAe,GAsBG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAG/E,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,WACA,kBACA,iBACA,kBACA,iBACA,SAAU,GACV,aACD,CAAC,CAGF,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAY,OAAO,mBAAmB,CAAC,CAE9E,IAAI,EAAQ,EACZ,EAAY,MAAM,EAAY,OAAQ,EAAE,CACxC,MAAM,EACJ,EACA,KAAO,IAAwB,CAC7B,MAAM,EAAmB,EAAQ,EAAwB,CACvD,UAAW,CACT,MAAO,CACL,GAAI,EAAoB,GACxB,SAAU,GACX,CACF,CACD,SACD,CAAC,CAEF,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAOvB,OALA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAM,+BAA+B,EAAY,IAAK,YAC9E,CACF,CACM,EAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=notifyPrivacyRequestsAdditionalTime-
|
|
1
|
+
import{a as e}from"./constants-Cdvbd9wA.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{r as n}from"./request-BIplTb3L.mjs";import{r}from"./fetchAllRequests-DP24WqrP.mjs";import{RequestAction as i}from"@transcend-io/privacy-types";import a from"colors";import{buildTranscendGraphQLClient as o,fetchAllTemplates 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=Object.values(i),auth:f,requestIds:p,createdAtBefore:m,days:h=45,daysLeft:g=10,createdAtAfter:_,updatedAtBefore:v,updatedAtAfter:y,emailTemplate:b=`Additional Time Needed`,concurrency:x=100,transcendUrl:S=e}){let C=o(S,f),w=new Date().getTime(),T=new u.SingleBar({},u.Presets.shades_classic),E=(await s(C,{logger:t,filterBy:{title:b}})).find(e=>e.title===b);if(!E)throw Error(`Failed to find a template with title: "${b}"`);let D=await r(C,{actions:d,createdAtBefore:m,createdAtAfter:_,updatedAtBefore:v,updatedAtAfter:y,isSilent:!1,isClosed:!1,requestIds:p});D=D.filter(e=>typeof e.daysRemaining==`number`&&e.daysRemaining<g),t.info(a.magenta(`Notifying "${D.length}" that more time is needed.`));let O=0;T.start(D.length,0),await l(D,async e=>{await c(C,n,{variables:{input:{requestId:e.id,template:E.template.defaultMessage,subject:E.subject.defaultMessage,additionalTime:h}},logger:t}),O+=1,T.update(O)},{concurrency:x}),T.stop();let k=new Date().getTime()-w;return t.info(a.green(`Successfully marked ${O} requests as silent mode in "${k/1e3}" seconds!`)),D.length}export{d as t};
|
|
2
|
+
//# sourceMappingURL=notifyPrivacyRequestsAdditionalTime-DflTzDRg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyPrivacyRequestsAdditionalTime-
|
|
1
|
+
{"version":3,"file":"notifyPrivacyRequestsAdditionalTime-DflTzDRg.mjs","names":[],"sources":["../src/lib/requests/notifyPrivacyRequestsAdditionalTime.ts"],"sourcesContent":["import { RequestAction } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n fetchAllTemplates,\n makeGraphQLRequest,\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 { NOTIFY_ADDITIONAL_TIME, fetchAllRequests } from '../graphql/index.js';\n\n/**\n * Mark a set of privacy requests to be in silent mode.\n * Note requests in silent mode are ignored\n *\n * @param options - Options\n * @returns The number of requests marked silent\n */\nexport async function notifyPrivacyRequestsAdditionalTime({\n requestActions = Object.values(RequestAction),\n auth,\n requestIds,\n createdAtBefore,\n days = 45,\n daysLeft = 10,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n emailTemplate = 'Additional Time Needed',\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** The request actions that should be restarted */\n requestActions?: RequestAction[];\n /** Filter for requests created before this date */\n createdAtBefore: Date;\n /** Filter for requests created after this date */\n createdAtAfter?: Date;\n /** Filter for requests updated before this date */\n updatedAtBefore?: Date;\n /** Filter for requests updated after this date */\n updatedAtAfter?: Date;\n /** Email template */\n emailTemplate?: string;\n /** Transcend API key authentication */\n auth: string;\n /** Number of days to extend request by */\n days?: number;\n /**\n * Only notify requests that have less than this number of days until they are considered expired.\n * This allows for re-running the command without notifying the same users multiple times\n */\n daysLeft?: number;\n /** Concurrency limit for approving */\n concurrency?: number;\n /** The set of privacy requests to notify */\n requestIds?: string[];\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 // Grab the template with that title\n const matchingTemplates = await fetchAllTemplates(client, {\n logger,\n filterBy: { title: emailTemplate },\n });\n const exactTemplateMatch = matchingTemplates.find((template) => template.title === emailTemplate);\n if (!exactTemplateMatch) {\n throw new Error(`Failed to find a template with title: \"${emailTemplate}\"`);\n }\n\n // Pull in the requests\n let allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n isSilent: false,\n isClosed: false,\n requestIds,\n });\n\n // Filter requests by daysLeft\n allRequests = allRequests.filter(\n (request) => typeof request.daysRemaining === 'number' && request.daysRemaining < daysLeft,\n );\n\n // Notify Transcend\n logger.info(colors.magenta(`Notifying \"${allRequests.length}\" that more time is needed.`));\n\n let total = 0;\n progressBar.start(allRequests.length, 0);\n await map(\n allRequests,\n async (requestToNotify) => {\n await makeGraphQLRequest(client, NOTIFY_ADDITIONAL_TIME, {\n variables: {\n input: {\n requestId: requestToNotify.id,\n template: exactTemplateMatch.template.defaultMessage,\n subject: exactTemplateMatch.subject.defaultMessage,\n additionalTime: days,\n },\n },\n logger,\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 marked ${total} requests as silent mode in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n return allRequests.length;\n}\n"],"mappings":"mbAqBA,eAAsB,EAAoC,CACxD,iBAAiB,OAAO,OAAO,EAAc,CAC7C,OACA,aACA,kBACA,OAAO,GACP,WAAW,GACX,iBACA,kBACA,iBACA,gBAAgB,yBAChB,cAAc,IACd,eAAe,GA6BG,CAElB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAGxD,EAAK,IAAI,MAAM,CAAC,SAAS,CAEzB,EAAc,IAAI,EAAY,UAAU,EAAE,CAAE,EAAY,QAAQ,eAAe,CAO/E,GAAqB,MAJK,EAAkB,EAAQ,CACxD,SACA,SAAU,CAAE,MAAO,EAAe,CACnC,CAAC,EAC2C,KAAM,GAAa,EAAS,QAAU,EAAc,CACjG,GAAI,CAAC,EACH,MAAU,MAAM,0CAA0C,EAAc,GAAG,CAI7E,IAAI,EAAc,MAAM,EAAiB,EAAQ,CAC/C,QAAS,EACT,kBACA,iBACA,kBACA,iBACA,SAAU,GACV,SAAU,GACV,aACD,CAAC,CAGF,EAAc,EAAY,OACvB,GAAY,OAAO,EAAQ,eAAkB,UAAY,EAAQ,cAAgB,EACnF,CAGD,EAAO,KAAK,EAAO,QAAQ,cAAc,EAAY,OAAO,6BAA6B,CAAC,CAE1F,IAAI,EAAQ,EACZ,EAAY,MAAM,EAAY,OAAQ,EAAE,CACxC,MAAM,EACJ,EACA,KAAO,IAAoB,CACzB,MAAM,EAAmB,EAAQ,EAAwB,CACvD,UAAW,CACT,MAAO,CACL,UAAW,EAAgB,GAC3B,SAAU,EAAmB,SAAS,eACtC,QAAS,EAAmB,QAAQ,eACpC,eAAgB,EACjB,CACF,CACD,SACD,CAAC,CAEF,GAAS,EACT,EAAY,OAAO,EAAM,EAE3B,CAAE,cAAa,CAChB,CAED,EAAY,MAAM,CAElB,IAAM,EADK,IAAI,MAAM,CAAC,SACF,CAAG,EAOvB,OALA,EAAO,KACL,EAAO,MACL,uBAAuB,EAAM,+BAA+B,EAAY,IAAK,YAC9E,CACF,CACM,EAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=pullChunkedCustomSiloOutstandingIdentifiers-
|
|
1
|
+
import{a as e}from"./constants-Cdvbd9wA.mjs";import{t}from"./logger-Ckep4QXn.mjs";import n from"colors";import{decodeCodec as r}from"@transcend-io/type-utils";import*as i from"io-ts";import{REDUCED_REQUESTS_FOR_DATA_SILO_COUNT as a,buildTranscendGraphQLClient as o,createSombraGotInstance as s,makeGraphQLRequest as c,withTransientRetry as l}from"@transcend-io/sdk";import{mapSeries as u}from"@transcend-io/utils";import d from"cli-progress";async function f(e,{dataSiloId:n}){let{listReducedRequestsForDataSilo:{totalCount:r}}=await c(e,a,{variables:{input:{dataSiloId:n,isResolved:!1}},logger:t});return r}const p=i.type({id:i.string,name:i.string,partition:i.string}),m=i.intersection([i.type({identifier:i.string,type:i.string,coreIdentifier:i.string,dataSiloId:i.string,requestId:i.string,nonce:i.string,requestCreatedAt:i.string,daysUntilOverdue:i.number,attributes:i.array(i.type({key:i.string,values:i.array(i.string)}))}),i.partial({partition:i.union([p,i.null])})]);async function h(e,{dataSiloId:n,limit:a=100,offset:o=0,requestType:s}){try{let c=await l(`pullCronPageOfIdentifiers`,()=>e.get(`v1/data-silo/${n}/pending-requests/${s}`,{searchParams:{offset:o,limit:a}}).json(),{logger:t,maxAttempts:6,baseDelayMs:500}),{items:u}=r(i.type({items:i.array(m)}),c);return u}catch(e){throw Error(`Received an error from server: ${e?.response?.body||e?.message}`)}}async function g({dataSiloId:r,auth:i,sombraAuth:a,actions:c,apiPageSize:l=100,savePageSize:p=1e3,onSave:m,transcendUrl:g=e,skipRequestCount:_=!1}){if(p%l!==0)throw Error(`savePageSize must be a multiple of apiPageSize. savePageSize: ${p}, apiPageSize: ${l}`);let v=await s(g,i,{logger:t,sombraApiKey:a,sombraUrl:process.env.SOMBRA_URL}),y=o(g,i),b=0;_||(b=await f(y,{dataSiloId:r})),t.info(n.magenta(`Pulling ${_?`all`:b} outstanding request identifiers for data silo: "${r}" for requests of types "${c.join(`", "`)}"`));let x=new Date().getTime(),S=new d.SingleBar({},d.Presets.shades_classic),C=new Set,w=[],T=[];_||S.start(b,0),await u(c,async e=>{let i=0,a=!0;for(;a;){let o=await h(v,{dataSiloId:r,limit:l,offset:i,requestType:e}),s=o.map(t=>(C.add(t.requestId),{...t,action:e})),c=s.map(({attributes:e,partition:t,...n})=>({...n,...t?{partitionId:t.id,partitionName:t.name,partitionKey:t.partition}:{},...e.reduce((e,t)=>Object.assign(e,{[t.key]:t.values.join(`,`)}),{})}));w.push(...s),T.push(...c),T.length>=p&&(await m(T),T=[]),a=o.length===l,i+=l,_?t.info(n.magenta(`Pulled ${o.length} outstanding identifiers for ${C.size} requests`)):S.update(C.size)}}),T.length>0&&await m(T),_||S.stop();let E=new Date().getTime()-x;return t.info(n.green(`Successfully pulled ${w.length} outstanding identifiers from ${C.size} requests in "${E/1e3}" seconds!`)),{identifiers:w}}export{f as a,h as i,m as n,p as r,g as t};
|
|
2
|
+
//# sourceMappingURL=pullChunkedCustomSiloOutstandingIdentifiers-BUi0WXb9.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-rKefgKKC.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { makeGraphQLRequest, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * Get number of open requests for a data silo\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request identifiers\n */\nexport async function fetchRequestDataSiloActiveCount(\n client: GraphQLClient,\n {\n dataSiloId,\n }: {\n /** Data silo ID */\n dataSiloId: string;\n },\n): Promise<number> {\n const {\n listReducedRequestsForDataSilo: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n listReducedRequestsForDataSilo: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, {\n variables: {\n input: {\n dataSiloId,\n isResolved: false,\n },\n },\n logger,\n });\n\n return totalCount;\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { withTransientRetry } from '@transcend-io/sdk';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\n\n/** Consent partition metadata when a DSR is scoped to a partition */\nexport const CronPartition = t.type({\n /** ID of the partition */\n id: t.string,\n /** The human readable name of the partition */\n name: t.string,\n /** The unique identifying partition value */\n partition: t.string,\n});\n\n/** Type override */\nexport type CronPartition = t.TypeOf<typeof CronPartition>;\n\nexport const CronIdentifier = t.intersection([\n t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n }),\n t.partial({\n /** The consent partition that scopes this request, when applicable */\n partition: t.union([CronPartition, t.null]),\n }),\n]);\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // `GET pending-requests` is a read and therefore safe to retry on transient\n // gateway / network errors. Customers running `transcend cron\n // pull-identifiers` against large silos would otherwise see the command\n // abort on a single 502 from the Sombra reverse tunnel.\n const response = await withTransientRetry(\n 'pullCronPageOfIdentifiers',\n () =>\n sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json(),\n { logger, maxAttempts: 6, baseDelayMs: 500 },\n );\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, createSombraGotInstance } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchRequestDataSiloActiveCount } from '../graphql/index.js';\nimport { pullCronPageOfIdentifiers, CronIdentifier } from './pullCronPageOfIdentifiers.js';\n\n/**\n * A CSV formatted identifier\n */\nexport type CsvFormattedIdentifier = {\n [k in string]: string | null | boolean | number;\n};\n\nexport interface CronIdentifierWithAction extends CronIdentifier {\n /** The request action that the identifier relates to */\n action: RequestAction;\n}\n\n/**\n * Pull the set of identifiers outstanding for a cron or AVC integration\n *\n * This function is designed to be used in a loop, and will call the onSave callback\n * with a chunk of identifiers when the savePageSize is reached.\n *\n * @param options - Options\n * @returns The identifiers and identifiers formatted for CSV\n */\nexport async function pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize = 100,\n savePageSize = 1000,\n onSave,\n transcendUrl = DEFAULT_TRANSCEND_API,\n skipRequestCount = false,\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** The request actions to fetch */\n actions: RequestAction[];\n /** How many identifiers to pull in a single call to the backend */\n apiPageSize: number;\n /** How many identifiers to save at a time (usually to a CSV file, should be a multiple of apiPageSize) */\n savePageSize: number;\n /** Callback function called when a chunk of identifiers is ready to be saved */\n onSave: (chunk: CsvFormattedIdentifier[]) => Promise<void>;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Skip request count */\n skipRequestCount?: boolean;\n}): Promise<{\n /** Raw Identifiers */\n identifiers: CronIdentifierWithAction[];\n}> {\n // Validate savePageSize\n if (savePageSize % apiPageSize !== 0) {\n throw new Error(\n `savePageSize must be a multiple of apiPageSize. savePageSize: ${savePageSize}, apiPageSize: ${apiPageSize}`,\n );\n }\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n let totalRequestCount = 0;\n if (!skipRequestCount) {\n totalRequestCount = await fetchRequestDataSiloActiveCount(client, {\n dataSiloId,\n });\n }\n\n logger.info(\n colors.magenta(\n `Pulling ${skipRequestCount ? 'all' : totalRequestCount} outstanding request identifiers ` +\n `for data silo: \"${dataSiloId}\" for requests of types \"${actions.join('\", \"')}\"`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const foundRequestIds = new Set<string>();\n\n // identifiers found in total\n const identifiers: CronIdentifierWithAction[] = [];\n // current chunk of identifiers to be saved\n let currentChunk: CsvFormattedIdentifier[] = [];\n\n // map over each action\n if (!skipRequestCount) {\n progressBar.start(totalRequestCount, 0);\n }\n await mapSeries(actions, async (action) => {\n let offset = 0;\n let shouldContinue = true;\n\n // Fetch a page of identifiers\n while (shouldContinue) {\n const pageIdentifiers = await pullCronPageOfIdentifiers(sombra, {\n dataSiloId,\n limit: apiPageSize,\n offset,\n requestType: action,\n });\n\n const identifiersWithAction: CronIdentifierWithAction[] = pageIdentifiers.map(\n (identifier) => {\n foundRequestIds.add(identifier.requestId);\n return {\n ...identifier,\n action,\n };\n },\n );\n\n const csvFormattedIdentifiers = identifiersWithAction.map(\n ({ attributes, partition, ...identifier }) => ({\n ...identifier,\n ...(partition\n ? {\n partitionId: partition.id,\n partitionName: partition.name,\n partitionKey: partition.partition,\n }\n : {}),\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n\n return { identifiers };\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"pullChunkedCustomSiloOutstandingIdentifiers-BUi0WXb9.mjs","names":[],"sources":["../src/lib/graphql/fetchRequestDataSiloActiveCount.ts","../src/lib/cron/pullCronPageOfIdentifiers.ts","../src/lib/cron/pullChunkedCustomSiloOutstandingIdentifiers.ts"],"sourcesContent":["import { makeGraphQLRequest, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT } from '@transcend-io/sdk';\nimport { GraphQLClient } from 'graphql-request';\n\nimport { logger } from '../../logger.js';\n\n/**\n * Get number of open requests for a data silo\n *\n * @param client - GraphQL client\n * @param options - Filter options\n * @returns List of request identifiers\n */\nexport async function fetchRequestDataSiloActiveCount(\n client: GraphQLClient,\n {\n dataSiloId,\n }: {\n /** Data silo ID */\n dataSiloId: string;\n },\n): Promise<number> {\n const {\n listReducedRequestsForDataSilo: { totalCount },\n } = await makeGraphQLRequest<{\n /** Requests */\n listReducedRequestsForDataSilo: {\n /** Total count */\n totalCount: number;\n };\n }>(client, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, {\n variables: {\n input: {\n dataSiloId,\n isResolved: false,\n },\n },\n logger,\n });\n\n return totalCount;\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { withTransientRetry } from '@transcend-io/sdk';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../logger.js';\n\n/** Consent partition metadata when a DSR is scoped to a partition */\nexport const CronPartition = t.type({\n /** ID of the partition */\n id: t.string,\n /** The human readable name of the partition */\n name: t.string,\n /** The unique identifying partition value */\n partition: t.string,\n});\n\n/** Type override */\nexport type CronPartition = t.TypeOf<typeof CronPartition>;\n\nexport const CronIdentifier = t.intersection([\n t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n }),\n t.partial({\n /** The consent partition that scopes this request, when applicable */\n partition: t.union([CronPartition, t.null]),\n }),\n]);\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // `GET pending-requests` is a read and therefore safe to retry on transient\n // gateway / network errors. Customers running `transcend cron\n // pull-identifiers` against large silos would otherwise see the command\n // abort on a single 502 from the Sombra reverse tunnel.\n const response = await withTransientRetry(\n 'pullCronPageOfIdentifiers',\n () =>\n sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json(),\n { logger, maxAttempts: 6, baseDelayMs: 500 },\n );\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(`Received an error from server: ${err?.response?.body || err?.message}`);\n }\n}\n","import { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, createSombraGotInstance } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { fetchRequestDataSiloActiveCount } from '../graphql/index.js';\nimport { pullCronPageOfIdentifiers, CronIdentifier } from './pullCronPageOfIdentifiers.js';\n\n/**\n * A CSV formatted identifier\n */\nexport type CsvFormattedIdentifier = {\n [k in string]: string | null | boolean | number;\n};\n\nexport interface CronIdentifierWithAction extends CronIdentifier {\n /** The request action that the identifier relates to */\n action: RequestAction;\n}\n\n/**\n * Pull the set of identifiers outstanding for a cron or AVC integration\n *\n * This function is designed to be used in a loop, and will call the onSave callback\n * with a chunk of identifiers when the savePageSize is reached.\n *\n * @param options - Options\n * @returns The identifiers and identifiers formatted for CSV\n */\nexport async function pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize = 100,\n savePageSize = 1000,\n onSave,\n transcendUrl = DEFAULT_TRANSCEND_API,\n skipRequestCount = false,\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** Data Silo ID to pull down jobs for */\n dataSiloId: string;\n /** The request actions to fetch */\n actions: RequestAction[];\n /** How many identifiers to pull in a single call to the backend */\n apiPageSize: number;\n /** How many identifiers to save at a time (usually to a CSV file, should be a multiple of apiPageSize) */\n savePageSize: number;\n /** Callback function called when a chunk of identifiers is ready to be saved */\n onSave: (chunk: CsvFormattedIdentifier[]) => Promise<void>;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Skip request count */\n skipRequestCount?: boolean;\n}): Promise<{\n /** Raw Identifiers */\n identifiers: CronIdentifierWithAction[];\n}> {\n // Validate savePageSize\n if (savePageSize % apiPageSize !== 0) {\n throw new Error(\n `savePageSize must be a multiple of apiPageSize. savePageSize: ${savePageSize}, apiPageSize: ${apiPageSize}`,\n );\n }\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n let totalRequestCount = 0;\n if (!skipRequestCount) {\n totalRequestCount = await fetchRequestDataSiloActiveCount(client, {\n dataSiloId,\n });\n }\n\n logger.info(\n colors.magenta(\n `Pulling ${skipRequestCount ? 'all' : totalRequestCount} outstanding request identifiers ` +\n `for data silo: \"${dataSiloId}\" for requests of types \"${actions.join('\", \"')}\"`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n const foundRequestIds = new Set<string>();\n\n // identifiers found in total\n const identifiers: CronIdentifierWithAction[] = [];\n // current chunk of identifiers to be saved\n let currentChunk: CsvFormattedIdentifier[] = [];\n\n // map over each action\n if (!skipRequestCount) {\n progressBar.start(totalRequestCount, 0);\n }\n await mapSeries(actions, async (action) => {\n let offset = 0;\n let shouldContinue = true;\n\n // Fetch a page of identifiers\n while (shouldContinue) {\n const pageIdentifiers = await pullCronPageOfIdentifiers(sombra, {\n dataSiloId,\n limit: apiPageSize,\n offset,\n requestType: action,\n });\n\n const identifiersWithAction: CronIdentifierWithAction[] = pageIdentifiers.map(\n (identifier) => {\n foundRequestIds.add(identifier.requestId);\n return {\n ...identifier,\n action,\n };\n },\n );\n\n const csvFormattedIdentifiers = identifiersWithAction.map(\n ({ attributes, partition, ...identifier }) => ({\n ...identifier,\n ...(partition\n ? {\n partitionId: partition.id,\n partitionName: partition.name,\n partitionKey: partition.partition,\n }\n : {}),\n ...attributes.reduce(\n (acc, val) =>\n Object.assign(acc, {\n [val.key]: val.values.join(','),\n }),\n {},\n ),\n }),\n );\n\n identifiers.push(...identifiersWithAction);\n currentChunk.push(...csvFormattedIdentifiers);\n\n // Check if we've reached the savePageSize and call the onSave callback\n if (currentChunk.length >= savePageSize) {\n await onSave(currentChunk);\n currentChunk = [];\n }\n\n shouldContinue = pageIdentifiers.length === apiPageSize;\n offset += apiPageSize;\n if (!skipRequestCount) {\n progressBar.update(foundRequestIds.size);\n } else {\n logger.info(\n colors.magenta(\n `Pulled ${pageIdentifiers.length} outstanding identifiers for ${foundRequestIds.size} requests`,\n ),\n );\n }\n }\n });\n\n // Save any remaining identifiers in the current chunk\n if (currentChunk.length > 0) {\n await onSave(currentChunk);\n }\n\n if (!skipRequestCount) {\n progressBar.stop();\n }\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled ${identifiers.length} outstanding identifiers from ${\n foundRequestIds.size\n } requests in \"${totalTime / 1000}\" seconds!`,\n ),\n );\n\n return { identifiers };\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-
|
|
1
|
+
import{a as e}from"./constants-Cdvbd9wA.mjs";import{t}from"./logger-Ckep4QXn.mjs";import{r as n}from"./fetchAllRequests-DP24WqrP.mjs";import{a as r}from"./writeCsv-DMw5OmWp.mjs";import{RequestStatus as i}from"@transcend-io/privacy-types";import{groupBy as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c,createSombraGotInstance as l,fetchAllRequestEnrichers as u,fetchAllRequestIdentifiers as d,validateSombraVersion as f}from"@transcend-io/sdk";import{map as p}from"@transcend-io/utils";async function m({file:m,auth:h,sombraAuth:g,requestActions:_=[],concurrency:v=100,transcendUrl:y=e}){let b=c(y,h),x=await l(y,h,{logger:t,sombraApiKey:g,sombraUrl:process.env.SOMBRA_URL});t.info(s.magenta(`Pulling manual enrichment requests, filtered for actions: ${_.join(`,`)}`));let S=await n(b,{actions:_,statuses:[i.Enriching]});await f(b,{logger:t});let C=[];await p(S,async e=>{let n=await u(b,{filterBy:{requestId:e.id},logger:t});if(n.filter(({status:e})=>e===`ACTION_REQUIRED`)){let r=await d(b,x,{filterBy:{requestId:e.id},skipSombraCheck:!0,logger:t});C.push({...e,requestIdentifiers:r,requestEnrichers:n})}},{concurrency:v});let w=C.map(({attributeValues:e,requestIdentifiers:t,requestEnrichers:n,...r})=>({...r,...Object.entries(a(t,`name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({value:e})=>e).join(`,`)}),{}),...Object.entries(a(e,`attributeKey.name`)).reduce((e,[t,n])=>Object.assign(e,{[t]:n.map(({name:e})=>e).join(`,`)}),{})}));return await r(m,w,o(w.map(e=>Object.keys(e)).flat())),t.info(s.green(`Successfully wrote ${C.length} requests to file "${m}"`)),C}export{m as t};
|
|
2
|
+
//# sourceMappingURL=pullManualEnrichmentIdentifiersToCsv-BwdUNMV5.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-
|
|
1
|
+
{"version":3,"file":"pullManualEnrichmentIdentifiersToCsv-BwdUNMV5.mjs","names":[],"sources":["../src/lib/manual-enrichment/pullManualEnrichmentIdentifiersToCsv.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllRequestEnrichers,\n fetchAllRequestIdentifiers,\n validateSombraVersion,\n type RequestEnricher,\n type RequestIdentifier,\n} from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { groupBy, uniq } from 'lodash-es';\n\nimport { DEFAULT_TRANSCEND_API } from '../../constants.js';\nimport { logger } from '../../logger.js';\nimport { type PrivacyRequest, fetchAllRequests } from '../graphql/index.js';\nimport { writeCsv } from '../helpers/writeCsv.js';\n\nexport interface PrivacyRequestWithIdentifiers extends PrivacyRequest {\n /** Request Enrichers */\n requestEnrichers: RequestEnricher[];\n /** Request Identifiers */\n requestIdentifiers: RequestIdentifier[];\n}\n\n/**\n * Pull the set of manual enrichment jobs to CSV\n *\n * @param options - Options\n * @returns List of requests with identifiers\n */\nexport async function pullManualEnrichmentIdentifiersToCsv({\n file,\n auth,\n sombraAuth,\n requestActions = [],\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** The request actions to fetch */\n requestActions?: RequestAction[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<PrivacyRequestWithIdentifiers[]> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const sombra = await createSombraGotInstance(transcendUrl, auth, {\n logger,\n sombraApiKey: sombraAuth,\n sombraUrl: process.env.SOMBRA_URL,\n });\n\n logger.info(\n colors.magenta(\n `Pulling manual enrichment requests, filtered for actions: ${requestActions.join(',')}`,\n ),\n );\n\n // Pull all privacy requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n });\n\n await validateSombraVersion(client, { logger });\n\n // Requests to save\n const savedRequests: PrivacyRequestWithIdentifiers[] = [];\n\n // Filter down requests to what is needed\n await map(\n allRequests,\n async (request) => {\n // Fetch enrichers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n filterBy: { requestId: request.id },\n logger,\n });\n\n // Check if manual enrichment exists for that request\n const hasManualEnrichment = requestEnrichers.filter(\n ({ status }) => status === 'ACTION_REQUIRED',\n );\n\n // Save request to queue\n if (hasManualEnrichment) {\n const requestIdentifiers = await fetchAllRequestIdentifiers(client, sombra, {\n filterBy: { requestId: request.id },\n skipSombraCheck: true,\n logger,\n });\n savedRequests.push({\n ...request,\n requestIdentifiers,\n requestEnrichers,\n });\n }\n },\n {\n concurrency,\n },\n );\n\n const data = savedRequests.map(\n ({\n attributeValues,\n requestIdentifiers,\n requestEnrichers, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...request\n }) => ({\n ...request,\n // flatten identifiers\n ...Object.entries(groupBy(requestIdentifiers, 'name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ value }) => value).join(','),\n }),\n {},\n ),\n // flatten attributes\n ...Object.entries(groupBy(attributeValues, 'attributeKey.name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ name }) => name).join(','),\n }),\n {},\n ),\n }),\n );\n\n // Write out to CSV\n const headers = uniq(data.map((d) => Object.keys(d)).flat());\n await writeCsv(file, data, headers);\n\n logger.info(\n colors.green(`Successfully wrote ${savedRequests.length} requests to file \"${file}\"`),\n );\n\n return savedRequests;\n}\n"],"mappings":"khBAgCA,eAAsB,EAAqC,CACzD,OACA,OACA,aACA,iBAAiB,EAAE,CACnB,cAAc,IACd,eAAe,GAc4B,CAE3C,IAAM,EAAS,EAA4B,EAAc,EAAK,CACxD,EAAS,MAAM,EAAwB,EAAc,EAAM,CAC/D,SACA,aAAc,EACd,UAAW,QAAQ,IAAI,WACxB,CAAC,CAEF,EAAO,KACL,EAAO,QACL,6DAA6D,EAAe,KAAK,IAAI,GACtF,CACF,CAGD,IAAM,EAAc,MAAM,EAAiB,EAAQ,CACjD,QAAS,EACT,SAAU,CAAC,EAAc,UAAU,CACpC,CAAC,CAEF,MAAM,EAAsB,EAAQ,CAAE,SAAQ,CAAC,CAG/C,IAAM,EAAiD,EAAE,CAGzD,MAAM,EACJ,EACA,KAAO,IAAY,CAEjB,IAAM,EAAmB,MAAM,EAAyB,EAAQ,CAC9D,SAAU,CAAE,UAAW,EAAQ,GAAI,CACnC,SACD,CAAC,CAQF,GAL4B,EAAiB,QAC1C,CAAE,YAAa,IAAW,kBAIN,CAAE,CACvB,IAAM,EAAqB,MAAM,EAA2B,EAAQ,EAAQ,CAC1E,SAAU,CAAE,UAAW,EAAQ,GAAI,CACnC,gBAAiB,GACjB,SACD,CAAC,CACF,EAAc,KAAK,CACjB,GAAG,EACH,qBACA,mBACD,CAAC,GAGN,CACE,cACD,CACF,CAED,IAAM,EAAO,EAAc,KACxB,CACC,kBACA,qBACA,mBACA,GAAG,MACE,CACL,GAAG,EAEH,GAAG,OAAO,QAAQ,EAAQ,EAAoB,OAAO,CAAC,CAAC,QACpD,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,WAAY,EAAM,CAAC,KAAK,IAAI,CAClD,CAAC,CACJ,EAAE,CACH,CAED,GAAG,OAAO,QAAQ,EAAQ,EAAiB,oBAAoB,CAAC,CAAC,QAC9D,EAAK,CAAC,EAAK,KACV,OAAO,OAAO,EAAK,EAChB,GAAM,EAAO,KAAK,CAAE,UAAW,EAAK,CAAC,KAAK,IAAI,CAChD,CAAC,CACJ,EAAE,CACH,CACF,EACF,CAUD,OANA,MAAM,EAAS,EAAM,EADL,EAAK,EAAK,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CACzB,CAAC,CAEnC,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAc,OAAO,qBAAqB,EAAK,GAAG,CACtF,CAEM"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import"./enums-OiLcZ26O.mjs";import{t as e}from"./logger-Ckep4QXn.mjs";import{ActionItemCode as t,ConsentTrackerStatus as n,PreferenceTopicType as r,RequestAction as i,RetentionType as a,WorkflowConfigType as o}from"@transcend-io/privacy-types";import{flatten as s,groupBy as c,keyBy as l,mapValues as u}from"lodash-es";import d from"colors";import{ASSESSMENT_SECTION_FIELDS as f,convertToDataSubjectAllowlist as p,fetchAllActionItemCollections as m,fetchAllActionItems as h,fetchAllActions as g,fetchAllAssessments as _,fetchAllAttributes as v,fetchAllBusinessEntities as y,fetchAllConsentWorkflowTriggers as b,fetchAllCookies as x,fetchAllDataCategories as S,fetchAllDataFlows as C,fetchAllDataSubjects as w,fetchAllEnrichers as T,fetchAllIdentifiers as E,fetchAllMessages as D,fetchAllPolicies as O,fetchAllPreferenceOptionValues as k,fetchAllPrivacyCenters as A,fetchAllProcessingActivities as ee,fetchAllProcessingPurposes as te,fetchAllPurposesAndPreferences as ne,fetchAllSiloDiscoveryResults as re,fetchAllTeams as ie,fetchAllTemplates as ae,fetchAllVendors as oe,fetchAllWorkflowConfigs as se,fetchApiKeys as ce,fetchConsentManager as le,fetchConsentManagerExperiences as ue,fetchConsentManagerTheme as de,fetchConsentThemes as fe,fetchConsentVariants as pe,fetchEnrichedDataSilos as me,fetchPartitions as he,formatAttributeValues as j,formatRegions as M,makeGraphQLRequest as N,parseAssessmentDisplayLogic as P,parseAssessmentRiskLogic as F,parsePurposesFromTriggerCondition as ge,resolveWorkflowTitleFromId as _e,workflowConfigMatchKey as ve}from"@transcend-io/sdk";import{gql as I}from"graphql-request";const L=I`
|
|
2
|
+
query TranscendCliAssessmentTemplates(
|
|
3
|
+
$first: Int!
|
|
4
|
+
$offset: Int!
|
|
5
|
+
$filterBy: AssessmentFormTemplateFiltersInput
|
|
6
|
+
) {
|
|
7
|
+
assessmentFormTemplates(
|
|
8
|
+
first: $first
|
|
9
|
+
offset: $offset
|
|
10
|
+
filterBy: $filterBy
|
|
11
|
+
) {
|
|
12
|
+
nodes {
|
|
13
|
+
id
|
|
14
|
+
creator {
|
|
15
|
+
id
|
|
16
|
+
email
|
|
17
|
+
name
|
|
18
|
+
}
|
|
19
|
+
lastEditor {
|
|
20
|
+
id
|
|
21
|
+
email
|
|
22
|
+
name
|
|
23
|
+
}
|
|
24
|
+
title
|
|
25
|
+
description
|
|
26
|
+
status
|
|
27
|
+
source
|
|
28
|
+
parentId
|
|
29
|
+
isLocked
|
|
30
|
+
isArchived
|
|
31
|
+
createdAt
|
|
32
|
+
updatedAt
|
|
33
|
+
retentionSchedule {
|
|
34
|
+
id
|
|
35
|
+
type
|
|
36
|
+
durationDays
|
|
37
|
+
operation
|
|
38
|
+
createdAt
|
|
39
|
+
updatedAt
|
|
40
|
+
}
|
|
41
|
+
assessmentEmailSet {
|
|
42
|
+
id
|
|
43
|
+
title
|
|
44
|
+
description
|
|
45
|
+
isDefault
|
|
46
|
+
templates {
|
|
47
|
+
id
|
|
48
|
+
title
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
sections {
|
|
52
|
+
${f}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;async function R(t){let n=[],r=0,i=!1;do{let{assessmentFormTemplates:{nodes:a}}=await N(t,L,{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))}function ye(e){let{dependentDataSilos:t,dependedOnDataSilosPerWorkflow:n}=e,r=t.map(({title:e})=>e),i=n.map(({workflowInternalName:e,dependedOnDataSilos:t})=>({workflow:e,titles:t.map(({title:e})=>e)}));return r.length===0&&i.length===0?{}:i.length===0?{"deletion-dependencies":r}:{"deletion-dependencies":[...r.length>0?[{titles:r}]:[],...i]}}const z=[`dataSilos`,`enrichers`,`templates`,`apiKeys`];async function B(f,{dataSiloIds:N,integrationNames:I,debug:L,resources:B=z,pageSize:V,skipDatapoints:be,includeGuessedCategories:H,skipSubDatapoints:xe,trackerStatuses:U=Object.values(n)}){if(N.length>0&&I.length>0)throw Error(`Only 1 of integrationNames OR dataSiloIds can be provided`);e.info(d.magenta(`Fetching data with page size ${V}...`));let[W,Se,G,Ce,K,we,Te,Ee,De,Oe,ke,Ae,q,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,J,Be,Ve,He,Ue,We,Ge,Y,X,Ke,qe]=await Promise.all([B.includes(`dataSilos`)||B.includes(`dataSubjects`)?w(f,{logger:e}):[],B.includes(`apiKeys`)?ce(f,{fetchAll:!0,logger:e}):[],B.includes(`dataSilos`)?me(f,{ids:N,integrationNames:I,pageSize:V,debug:L,includeGuessedCategories:H,skipDatapoints:be,skipSubDatapoints:xe,logger:e}):[],B.includes(`enrichers`)?T(f,{logger:e}):[],B.includes(`dataFlows`)?[...U.includes(n.Live)?await C(f,{logger:e,filterBy:{status:n.Live}}):[],...U.includes(n.NeedsReview)?await C(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],B.includes(`cookies`)?[...U.includes(n.Live)?await x(f,{logger:e,filterBy:{status:n.Live}}):[],...U.includes(n.NeedsReview)?await x(f,{logger:e,filterBy:{status:n.NeedsReview}}):[]]:[],B.includes(`customFields`)?v(f,{logger:e}):[],B.includes(`templates`)?ae(f,{logger:e}):[],B.includes(`identifiers`)?E(f,{logger:e}):[],B.includes(`actions`)?g(f,{logger:e}):[],B.includes(`businessEntities`)?y(f,{logger:e}):[],B.includes(`processingActivities`)?ee(f,{logger:e}):[],B.includes(`consentManager`)?le(f,{logger:e}):void 0,B.includes(`consentManager`)?ue(f,{logger:e}):[],B.includes(`consentManager`)?pe(f,{logger:e}):[],B.includes(`consentManager`)?fe(f,{logger:e}):[],B.includes(`vendors`)?oe(f,{logger:e}):[],B.includes(`dataCategories`)?S(f,{logger:e}):[],B.includes(`processingPurposes`)?te(f,{logger:e}):[],B.includes(`actionItems`)?h(f,{logger:e,filterBy:{type:[t.Onboarding]}}):[],B.includes(`actionItemCollections`)?m(f,{logger:e}):[],B.includes(`teams`)?ie(f,{logger:e}):[],B.includes(`policies`)?O(f,{logger:e}):[],B.includes(`privacyCenters`)?A(f,{logger:e}):[],B.includes(`messages`)?D(f,{logger:e}):[],B.includes(`partitions`)?he(f,{logger:e}):[],B.includes(`assessments`)?_(f,{logger:e}):[],B.includes(`assessmentTemplates`)?R(f):[],B.includes(`purposes`)?ne(f,{logger:e}):[],B.includes(`preferenceWorkflowConfigs`)?b(f,{logger:e}):[],B.includes(`workflowConfigs`)?se(f,{logger:e,workflowConfigType:o.DSR}):[],B.includes(`preferenceOptions`)?k(f,{logger:e}):[],B.includes(`systemDiscovery`)?re(f,{logger:e}):[]]),Z=B.includes(`consentManager`)&&q?await de(f,{logger:e,filterBy:{airgapBundleId:q.id}}):void 0,Q={},Je=s(G.map(([{apiKeys:e}])=>e.map(({title:e})=>e))),$=Object.values(Se).filter(({title:e})=>B.includes(`apiKeys`)?!0:Je.includes(e));if($.length>0&&B.includes(`apiKeys`)&&(Q[`api-keys`]=$.map(({title:e})=>({title:e}))),He.length>0&&B.includes(`partitions`)&&(Q.partitions=He.map(({name:e,partition:t})=>({name:e,partition:t}))),q&&B.includes(`consentManager`)&&(Q[`consent-manager`]={bundleUrls:{TEST:q.testBundleURL,PRODUCTION:q.bundleURL},domains:q.configuration.domains||void 0,partition:q.configuration.partition||void 0,consentPrecedence:q.configuration.consentPrecedence||void 0,unknownRequestPolicy:q.configuration.unknownRequestPolicy||void 0,unknownCookiePolicy:q.configuration.unknownCookiePolicy||void 0,syncEndpoint:q.configuration.syncEndpoint||void 0,telemetryPartitioning:q.configuration.telemetryPartitioning||void 0,signedIabAgreement:q.configuration.signedIabAgreement||void 0,syncGroups:q.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||void 0,configuration:JSON.stringify(e.configuration),locales:e.locales,status:e.status,userFlow:e.userFlow||void 0,themeSlug:e.theme?.slug||void 0})),consentThemes:Ne.map(e=>({id:e.id,name:e.name,slug:e.slug,configuration:JSON.stringify(e.configuration)}))}),Ue.length>0&&B.includes(`assessments`)&&(Q.assessments=Ue.map(({title:e,assessmentGroup:t,sections:n,creator:r,description:i,status:a,assignees:o,externalAssignees:s,reviewers:c,isLocked:l,isArchived:u,isExternallyCreated:d,dueDate:f,createdAt:p,assignedAt:m,submittedAt:h,approvedAt:g,rejectedAt:_,titleIsInternal:v,retentionSchedule:y,attributeValues:b,resources:x,syncedRows:S})=>({title:e,group:t.title,sections:n.map(({title:e,status:t,questions:n,assignees:r,isReviewed:i,externalAssignees:a})=>({title:e,status:t,questions:n.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,selectedAnswers:f,allowedMimeTypes:p,allowSelectOther:m,syncModel:h,syncColumn:g,attributeKey:_,requireRiskEvaluation:v,requireRiskMatrixEvaluation:y})=>{let b=s?P(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=F(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?j(b):void 0,resources:x.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``})),rows:S.map(({resourceType:e,title:t,name:n,category:r,type:i,purpose:a})=>({type:e,title:r?`${r} - ${n}`:a?`${a} - ${n}`:t||n||i||``}))}))),We.length>0&&B.includes(`assessmentTemplates`)&&(Q[`assessment-templates`]=We.map(({title:e,description:t,sections:n,status:r,source:i,creator:a,isLocked:o,isArchived:s,createdAt:c,retentionSchedule:l})=>({title:e,description:t,sections:n.map(({title:e,questions:t})=>({title:e,questions:t.map(({title:e,type:t,subType:n,placeholder:r,description:i,isRequired:a,referenceId:o,displayLogic:s,riskLogic:c,riskCategories:l,riskFramework:u,answerOptions:d,allowedMimeTypes:f,allowSelectOther:p,syncModel:m,syncColumn:h,attributeKey:g,requireRiskEvaluation:_,requireRiskMatrixEvaluation:v})=>{let y=s?P(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=F(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}))),qe.length>0&&B.includes(`systemDiscovery`)&&(Q[`system-discovery`]=qe.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}))),ze.length>0&&B.includes(`teams`)&&(Q.teams=ze.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)}))),W.length>0&&B.includes(`dataSubjects`)&&(Q[`data-subjects`]=W.map(({type:e,title:t,active:n,adminDashboardDefaultSilentMode:r,supportsAuthorizedAgent:i,actions:a})=>({type:e,title:t?.defaultMessage,active:n,adminDashboardDefaultSilentMode:r,supportsAuthorizedAgent:i,actions:a.map(({type:e})=>e)}))),J.length>0&&(Q.policies=J.map(({title:e,type:t,versions:n,disabledLocales:r})=>({title:e?.defaultMessage,type:t,content:n?.[0]?.content?.defaultMessage,disabledLocales:r}))),Ve.length>0&&(Q.messages=Ve.map(({id:e,defaultMessage:t,targetReactIntlId:n,description:r,translations:i})=>({id:e,defaultMessage:t,description:r,targetReactIntlId:n||void 0,translations:i.reduce((e,{locale:t,value:n})=>Object.assign(e,{[t]:n}),{})}))),Be.length>0){let e=Be[0];Q[`privacy-center`]={isDisabled:e.isDisabled,showPrivacyRequestButton:e.showPrivacyRequestButton,showPolicies:e.showPolicies,showTrackingTechnologies:e.showTrackingTechnologies,showCookies:e.showCookies,showDataFlows:e.showDataFlows,showConsentManager:e.showConsentManager,showManageYourPrivacy:e.showManageYourPrivacy,showMarketingPreferences:e.showMarketingPreferences,locales:e.locales,defaultLocale:e.defaultLocale,preferBrowserDefaultLocale:e.preferBrowserDefaultLocale,supportEmail:e.supportEmail||void 0,replyToEmail:e.replyToEmail||void 0,useNoReplyEmailAddress:e.useNoReplyEmailAddress,useCustomEmailDomain:e.useCustomEmailDomain,transformAccessReportJsonToCsv:e.transformAccessReportJsonToCsv,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&&B.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?j(s):void 0}))),Ae.length>0&&B.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?M(i):void 0,transferRegions:o.length>0?M(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?j(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}))),Oe.length>0&&B.includes(`actions`)&&(Q.actions=Oe.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}))),De.length>0&&B.includes(`identifiers`)&&(Q.identifiers=De.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&&B.includes(`actionItems`)&&(Q[`action-items`]=Le.map(({teams:e,users:t,customerExperienceActionItemIds:[n],dueDate:r,priority:i,resolved:a,collections:o,notes:s,link:c,title:l,type:u,attributeValues:d})=>({teams:e.map(({name:e})=>e),users:t.map(({email:e})=>e),dueDate:r||void 0,title:l,notes:s,customerExperienceActionItemId:n,collections:o.map(({title:e})=>e),link:c,priority:i||void 0,resolved:a,type:u,attributes:d!==void 0&&d.length>0?j(d):void 0}))),Re.length>0&&B.includes(`actionItemCollections`)&&(Q[`action-item-collections`]=Re.map(({title:e,description:t,hidden:n,productLine:r})=>({title:e,description:t||void 0,hidden:n,productLine:r}))),Pe.length>0&&B.includes(`vendors`)&&(Q.vendors=Pe.map(({title:e,description:t,dataProcessingAgreementLink:n,contactName:r,contactPhone:i,address:a,headquarterCountry:o,headquarterSubDivision:s,websiteUrl:c,businessEntity:l,teams:u,owners:d,attributeValues:f})=>({title:e,description:t||void 0,dataProcessingAgreementLink:n||void 0,contactName:r||void 0,contactPhone:i||void 0,address:a||void 0,headquarterCountry:o||void 0,headquarterSubDivision:s||void 0,websiteUrl:c||void 0,businessEntity:l?.title,teams:u&&u.length>0?u.map(({name:e})=>e):void 0,owners:d&&d.length>0?d.map(({email:e})=>e):void 0,attributes:f!==void 0&&f.length>0?j(f):void 0}))),Fe.length>0&&B.includes(`dataCategories`)&&(Q[`data-categories`]=Fe.map(({name:e,category:t,description:n,regex:r,owners:i,teams:a,attributeValues:o})=>({name:e,category:t,description:n||void 0,regex:r||void 0,owners:i&&i.length>0?i.map(({email:e})=>e):void 0,teams:a&&a.length>0?a.map(({name:e})=>e):void 0,attributes:o!==void 0&&o.length>0?j(o):void 0}))),Ie.length>0&&B.includes(`processingPurposes`)&&(Q[`processing-purposes`]=Ie.map(({name:e,purpose:t,description:n,owners:r,teams:i,attributeValues:a})=>({name:e,purpose:t,description:n||void 0,owners:r&&r.length>0?r.map(({email:e})=>e):void 0,teams:i&&i.length>0?i.map(({name:e})=>e):void 0,attributes:a!==void 0&&a.length>0?j(a):void 0}))),K.length>0&&B.includes(`dataFlows`)&&(Q[`data-flows`]=K.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?j(c):void 0}))),we.length>0&&B.includes(`cookies`)&&(Q.cookies=we.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?j(c):void 0}))),Te.length>0&&B.includes(`customFields`)&&(Q.attributes=Te.map(({description:e,name:t,type:n,values:r,enabledOn:i=[]})=>({description:e||void 0,resources:i,name:t,type:n,values:r.map(({name:e,color:t,description:n})=>({name:e,color:t||void 0,description:n}))}))),Ge.length>0&&(Q.purposes=Ge.map(({name:e,description:t,trackingType:n,defaultConsent: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&&B.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,ve);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(Y.length>0&&B.includes(`preferenceWorkflowConfigs`)){let t=Y.some(e=>e.workflowConfigId)?await se(f,{logger:e,workflowConfigType:o.DSR}):[];Q[`preference-workflow-configs`]=Y.map(e=>{let n=ge(e.triggerCondition),r={name:e.name,"data-subject-type":e.subject.type,"is-silent":e.isSilent,"allow-unauthenticated":e.allowUnauthenticated,"is-active":e.isActive,purposes:n};if(e.workflowConfigId){let n=_e(t,e.workflowConfigId);if(n)return{...r,"workflow-title":n}}return{...r,"action-type":e.action.type,"data-silo-titles":e.dataSilos.length>0?e.dataSilos.map(e=>e.title):void 0}})}if(Ke.length>0&&B.includes(`preferenceOptions`)&&(Q[`preference-options`]=Ke.map(({slug:e,title:t})=>({slug:e,title:t.defaultMessage}))),N.length===0&&Ee.length>0&&B.includes(`templates`)&&(Q.templates=Ee.map(({title:e})=>({title:e}))),Ce.length>0&&B.includes(`enrichers`)&&(Q.enrichers=Ce.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)}))),G.length>0&&B.includes(`dataSilos`)){let e=l(W,`type`);Q[`data-silos`]=G.map(([{title:t,description:n,url:r,type:i,outerType:a,apiKeys:o,notifyEmailAddress:s,identifiers:c,dependentDataSilos:d,dependedOnDataSilosPerWorkflow:f,owners:m,country:h,countrySubDivision:g,teams:_,subjectBlocklist:v,isLive:y,promptAVendorEmailSendFrequency:b,promptAVendorEmailSendType:x,promptAVendorEmailIncludeIdentifiersAttachment:S,promptAVendorEmailCompletionLinkType:C,manualWorkRetryFrequency:w,catalog:T,attributeValues:E,discoveredBy:D,businessEntities:O,sombra:k},A])=>({title:t,description:n,integrationName:i,"outer-type":a||void 0,url:r||void 0,"api-key-title":o[0]?.title,"sombra-id":k?.id||void 0,"identity-keys":c.filter(({isConnected:e})=>e).map(({name:e})=>e),...ye({dependentDataSilos:d,dependedOnDataSilosPerWorkflow:f}),...m.length>0?{owners:m.map(({email:e})=>e)}:{},..._.length>0?{teams:_.map(({name:e})=>e)}:{},...D.length>0?{discoveredBy:D.map(({title:e})=>e)}:{},...O.length>0?{businessEntities:O.map(({title:e})=>e)}:{},country:h||void 0,countrySubDivision:g||void 0,disabled:!y,"data-subjects":v.length>0?p(v.map(({type:e})=>e),e):void 0,...T.hasAvcFunctionality?{"email-settings":{"notify-email-address":s||void 0,"send-frequency":b,"send-type":x,"include-identifiers-attachment":S,"completion-link-type":C,"manual-work-retry-frequency":w}}:{},attributes:E!==void 0&&E.length>0?j(E):void 0,datapoints:A.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,...H&&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?j(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{L as i,B as n,R as r,z as t};
|
|
58
|
+
//# sourceMappingURL=pullTranscendConfiguration-DbRVLKq5.mjs.map
|