@transcend-io/cli 7.0.0-alpha.1 → 7.0.0-alpha.3
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/dist/bin/bash-complete.js +3 -0
- package/dist/bin/cli.js +2 -0
- package/dist/bin/deprecated-command.js +6 -0
- package/dist/chunk-3GMPEWZU.js +1 -0
- package/dist/chunk-4AH7KIGL.js +5 -0
- package/dist/chunk-4ZW3XBZV.js +11 -0
- package/dist/chunk-7NWTOLV6.js +1 -0
- package/dist/chunk-AHYJJKNA.js +1 -0
- package/dist/chunk-APA5PR4U.js +1 -0
- package/dist/chunk-CMG5ZYLE.js +1 -0
- package/dist/chunk-FV7557JH.js +74 -0
- package/dist/chunk-GCT6ASWD.js +48 -0
- package/dist/chunk-HMF46LB7.js +1 -0
- package/dist/chunk-LVQ3VJ2W.js +2 -0
- package/dist/chunk-LYA6JDF3.js +2830 -0
- package/dist/chunk-NMRI6QFR.js +1 -0
- package/dist/chunk-OERYFLN2.js +1 -0
- package/dist/chunk-QQRMUEM7.js +3 -0
- package/dist/chunk-T2PLXAEM.js +1 -0
- package/dist/chunk-VOSDKHIQ.js +1 -0
- package/dist/chunk-W6GUOMVP.js +1 -0
- package/dist/chunk-WUZVHBZ6.js +3 -0
- package/dist/chunk-YAW3NWII.js +1 -0
- package/dist/chunk-ZB5DNAF3.js +1 -0
- package/dist/chunk-ZSQRC7CE.js +3 -0
- package/dist/impl-2FMVZQC3.js +1 -0
- package/dist/impl-34GPMXPL.js +1 -0
- package/dist/impl-4PM5ANUA.js +11 -0
- package/dist/impl-52WERFAD.js +1 -0
- package/dist/impl-5BJNBSJM.js +5 -0
- package/dist/impl-6YBT2TVS.js +1 -0
- package/dist/impl-7MUJH6P5.js +1 -0
- package/dist/impl-A2USYIKE.js +1 -0
- package/dist/impl-AQRJP63X.js +1 -0
- package/dist/impl-D5B5PHQ3.js +1 -0
- package/dist/impl-D7BMJMXZ.js +1 -0
- package/dist/impl-DPXDEQNI.js +8 -0
- package/dist/impl-E47RFIQN.js +1 -0
- package/dist/impl-EB7RIOVE.js +1 -0
- package/dist/impl-FLM53BCK.js +1 -0
- package/dist/impl-GBFIC5HA.js +6 -0
- package/dist/impl-GCOOAYPD.js +1 -0
- package/dist/impl-JMTECOZS.js +1 -0
- package/dist/impl-LDFZSLYD.js +1 -0
- package/dist/impl-MYQ2JZZW.js +5 -0
- package/dist/impl-NZAJVL4T.js +1 -0
- package/dist/impl-OFNYLVXQ.js +1 -0
- package/dist/impl-OUM2TMCA.js +1 -0
- package/dist/impl-PC6DNGTZ.js +1 -0
- package/dist/impl-PY6QMFDF.js +5 -0
- package/dist/impl-QEJPFCJI.js +1 -0
- package/dist/impl-SJQV2OMC.js +1 -0
- package/dist/impl-U5UP4IPY.js +1 -0
- package/dist/impl-V6VQDET2.js +1 -0
- package/dist/impl-VJE75UCF.js +1 -0
- package/dist/impl-W3HV7NRK.js +1 -0
- package/dist/impl-WNH7YI6Z.js +1 -0
- package/dist/impl-WW7Y6LSR.js +1 -0
- package/dist/impl-XGATOXTC.js +1 -0
- package/dist/impl-YDRXS46V.js +3 -0
- package/dist/impl-ZEOQDQGJ.js +1 -0
- package/dist/impl-ZNK4HGCU.js +1 -0
- package/dist/impl-ZW2R7XBD.js +1 -0
- package/dist/index.js +4 -0
- package/package.json +51 -53
- package/dist/bin/bash-complete.mjs +0 -3
- package/dist/bin/cli.mjs +0 -2
- package/dist/bin/deprecated-command.mjs +0 -6
- package/dist/chunk-BWXKSYTY.mjs +0 -1
- package/dist/chunk-N4KHG2LT.mjs +0 -3
- package/dist/chunk-RTBRALWU.mjs +0 -48
- package/dist/chunk-WVOQBBD4.mjs +0 -1
- package/dist/impl-2SXC6DB5.mjs +0 -1
- package/dist/impl-3WS4KAXC.mjs +0 -1
- package/dist/impl-573JHF5Q.mjs +0 -1
- package/dist/impl-5G2VT3GE.mjs +0 -1
- package/dist/impl-5M2JICLA.mjs +0 -1
- package/dist/impl-6HCHXNYK.mjs +0 -1
- package/dist/impl-6HYSKLJA.mjs +0 -1
- package/dist/impl-6ZEB6Z2K.mjs +0 -1
- package/dist/impl-7R553APD.mjs +0 -1
- package/dist/impl-7YBBGEJS.mjs +0 -1
- package/dist/impl-AE4WVFKM.mjs +0 -1
- package/dist/impl-BUP5GVYQ.mjs +0 -1
- package/dist/impl-DDSJFH7O.mjs +0 -1
- package/dist/impl-EAWZEQHP.mjs +0 -1
- package/dist/impl-EBN6UN6B.mjs +0 -1
- package/dist/impl-F3GN5QBQ.mjs +0 -1
- package/dist/impl-F7EIWKOK.mjs +0 -1
- package/dist/impl-GOITDIYO.mjs +0 -1
- package/dist/impl-GWDASXMF.mjs +0 -1
- package/dist/impl-I2HNOFXK.mjs +0 -1
- package/dist/impl-J6TM5I2T.mjs +0 -1
- package/dist/impl-JKKLZIWW.mjs +0 -1
- package/dist/impl-L32NAFWG.mjs +0 -1
- package/dist/impl-LTXXHRJN.mjs +0 -1
- package/dist/impl-NFGCPTZ6.mjs +0 -1
- package/dist/impl-NFKMASFN.mjs +0 -1
- package/dist/impl-OCKVP3CG.mjs +0 -1
- package/dist/impl-ORZO5DKU.mjs +0 -1
- package/dist/impl-TMYFQHHJ.mjs +0 -1
- package/dist/impl-TN3TNFJ3.mjs +0 -1
- package/dist/impl-TY543E6H.mjs +0 -1
- package/dist/impl-U5YMWF3E.mjs +0 -1
- package/dist/impl-V26VW5PW.mjs +0 -1
- package/dist/impl-V75HSG53.mjs +0 -1
- package/dist/impl-VTEL3Q42.mjs +0 -1
- package/dist/impl-WJX6QJZG.mjs +0 -1
- package/dist/impl-YF6RKW6X.mjs +0 -1
- package/dist/impl-ZHAW5DO6.mjs +0 -1
- package/dist/index.mjs +0 -2923
- /package/dist/{chunk-BGXZA4EM.mjs → chunk-EZCJGIOS.js} +0 -0
- /package/dist/{chunk-CG4A43HM.mjs → chunk-XMGVDVM2.js} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as s}from"../chunk-XMGVDVM2.js";import{a as o}from"../chunk-GCT6ASWD.js";import"../chunk-ZSQRC7CE.js";import"../chunk-APA5PR4U.js";import"../chunk-NMRI6QFR.js";import"../chunk-EZCJGIOS.js";import{proposeCompletions as r}from"@stricli/core";var t=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&t.push("");await r(o,t,s(process));try{for(let{completion:p}of await r(o,t,s(process)))process.stdout.write(`${p}
|
|
3
|
+
`)}catch{}
|
package/dist/bin/cli.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as o}from"../chunk-XMGVDVM2.js";import{a as r}from"../chunk-GCT6ASWD.js";import"../chunk-ZSQRC7CE.js";import"../chunk-APA5PR4U.js";import"../chunk-NMRI6QFR.js";import"../chunk-EZCJGIOS.js";import{run as i}from"@stricli/core";await i(r,process.argv.slice(2),o(process));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as r}from"../chunk-GCT6ASWD.js";import"../chunk-ZSQRC7CE.js";import"../chunk-APA5PR4U.js";import"../chunk-NMRI6QFR.js";import"../chunk-EZCJGIOS.js";import{generateHelpTextForAllCommands as d}from"@stricli/core";var s={"tr-build-xdi-sync-endpoint":["consent","build-xdi-sync-endpoint"],"tr-consent-manager-service-json-to-yml":["consent","consent-manager-service-json-to-yml"],"tr-consent-managers-to-business-entities":["consent","consent-managers-to-business-entities"],"tr-cron-mark-identifiers-completed":["request","cron","mark-identifiers-completed"],"tr-cron-pull-identifiers":["request","cron","pull-identifiers"],"tr-derive-data-silos-from-data-flows":["inventory","derive-data-silos-from-data-flows"],"tr-derive-data-silos-from-data-flows-cross-instance":["inventory","derive-data-silos-from-data-flows-cross-instance"],"tr-discover-silos":["inventory","discover-silos"],"tr-generate-api-keys":["admin","generate-api-keys"],"tr-manual-enrichment-pull-identifiers":["request","preflight","pull-identifiers"],"tr-manual-enrichment-push-identifiers":["request","preflight","push-identifiers"],"tr-mark-request-data-silos-completed":["request","system","mark-request-data-silos-completed"],"tr-pull":["inventory","pull"],"tr-pull-consent-metrics":["consent","pull-consent-metrics"],"tr-pull-consent-preferences":["consent","pull-consent-preferences"],"tr-pull-datapoints":["inventory","pull-datapoints"],"tr-pull-pull-unstructured-discovery-files":["inventory","pull-unstructured-discovery-files"],"tr-push":["inventory","push"],"tr-request-approve":["request","approve"],"tr-request-cancel":["request","cancel"],"tr-request-download-files":["request","download-files"],"tr-request-enricher-restart":["request","enricher-restart"],"tr-request-export":["request","export"],"tr-request-mark-silent":["request","mark-silent"],"tr-request-notify-additional-time":["request","notify-additional-time"],"tr-request-reject-unverified-identifiers":["request","reject-unverified-identifiers"],"tr-request-restart":["request","restart"],"tr-request-upload":["request","upload"],"tr-retry-request-data-silos":["request","system","retry-request-data-silos"],"tr-scan-packages":["inventory","scan-packages"],"tr-skip-preflight-jobs":["request","skip-preflight-jobs"],"tr-skip-request-data-silos":["request","system","skip-request-data-silos"],"tr-sync-ot":["migration","sync-ot"],"tr-update-consent-manager":["consent","update-consent-manager"],"tr-upload-consent-preferences":["consent","upload-consent-preferences"],"tr-upload-cookies-from-csv":["consent","upload-cookies-from-csv"],"tr-upload-data-flows-from-csv":["consent","upload-data-flows-from-csv"],"tr-upload-preferences":["consent","upload-preferences"]};function c(t){return d(r).find(n=>n[0]===`${r.config.name} ${t.join(" ")}`)?.[1]}function o(t){console.log("[DEPRECATION NOTICE]");let e=s[t];if(!e){let i=Object.entries(s).map(([a,l])=>`\`${a}\` -> \`${r.config.name} ${l.join(" ")}\``).join(`
|
|
3
|
+
`);console.log(`This command is deprecated as of v7.0.0. Here is a list of new commands, mapped to their legacy command names:
|
|
4
|
+
${i}`);return}console.log(`\`${t}\` is deprecated as of v7.0.0.
|
|
5
|
+
Use \`${r.config.name} ${e.join(" ")}\` instead.
|
|
6
|
+
`);let n=c(e);if(!n)throw new Error(`Failed to get help text for command: \`${e.join(" ")}\``);console.log(n)}function m(){let e=process.argv.at(-1)?.split("/").pop()?.trim();if(e)o(e);else throw new Error("Deprecated command");process.exit(1)}m();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as G}from"./chunk-7NWTOLV6.js";import{De as N,_b as _,a as x,b as $,pe as q,qe as D,ve as F,wa as E}from"./chunk-LYA6JDF3.js";import{e as y}from"./chunk-APA5PR4U.js";import{a as r}from"./chunk-OERYFLN2.js";import*as e from"io-ts";import{decodeCodec as z}from"@transcend-io/type-utils";var W=e.type({identifier:e.string,type:e.string,coreIdentifier:e.string,dataSiloId:e.string,requestId:e.string,nonce:e.string,requestCreatedAt:e.string,daysUntilOverdue:e.number,attributes:e.array(e.type({key:e.string,values:e.array(e.string)}))});async function k(t,{dataSiloId:i,limit:c=100,offset:o=0,requestType:d}){try{let s=await t.get(`v1/data-silo/${i}/pending-requests/${d}`,{searchParams:{offset:o,limit:c}}).json(),{items:n}=z(e.type({items:e.array(W)}),s);return n}catch(s){throw new Error(`Received an error from server: ${s?.response?.body||s?.message}`)}}import R from"colors";import O from"cli-progress";async function oe({dataSiloId:t,auth:i,sombraAuth:c,actions:o,pageLimit:d=100,transcendUrl:s=y,skipRequestCount:n=!1}){let l=await D(s,i,c),u=q(s,i),a=0;n||(a=await F(u,{dataSiloId:t})),r.info(R.magenta(`Pulling ${n?"all":a} outstanding request identifiers for data silo: "${t}" for requests of types "${o.join('", "')}"`));let g=new Date().getTime(),f=new O.SingleBar({},O.Presets.shades_classic),m=new Set,p=[];n||f.start(a,0),await x(o,async S=>{let A=0,P=!0;for(;P;){let h=await k(l,{dataSiloId:t,limit:d,offset:A,requestType:S});p.push(...h.map(v=>(m.add(v.requestId),{...v,action:S}))),P=h.length===d,A+=d,n?r.info(R.magenta(`Pulled ${h.length} outstanding identifiers for ${m.size} requests`)):f.update(m.size)}}),n||f.stop();let T=new Date().getTime()-g;r.info(R.green(`Successfully pulled ${p.length} outstanding identifiers from ${m.size} requests in "${T/1e3}" seconds!`));let b=p.map(({attributes:S,...A})=>({...A,...S.reduce((P,h)=>Object.assign(P,{[h.key]:h.values.join(",")}),{})}));return{identifiers:p,identifiersFormattedForCsv:b}}import*as I from"io-ts";var U=I.type({nonce:I.string,identifier:I.string});async function B(t,{nonce:i,identifier:c}){try{return await t.put("v1/data-silo",{headers:{"x-transcend-nonce":i},json:{profiles:[{profileId:c}]}}),!0}catch(o){if(o.response?.statusCode===409)return!1;throw new Error(`Received an error from server: ${o?.response?.body||o?.message}`)}}import C from"colors";import L from"cli-progress";async function pe({file:t,dataSiloId:i,auth:c,sombraAuth:o,concurrency:d=100,transcendUrl:s=y}){let n=await D(s,c,o);r.info(C.magenta(`Reading "${t}" from disk`));let l=G(t,U);r.info(C.magenta(`Notifying Transcend for data silo "${i}" marking "${l.length}" identifiers as completed.`));let u=new Date().getTime(),a=new L.SingleBar({},L.Presets.shades_classic),g=0,f=0,m=0;a.start(l.length,0),await $(l,async T=>{try{await B(n,T)?g+=1:f+=1}catch(b){r.error(C.red(`Error notifying Transcend for identifier "${T.identifier}" - ${b.message}`)),m+=1}a.update(g+f)},{concurrency:d}),a.stop();let w=new Date().getTime()-u;if(r.info(C.green(`Successfully notified Transcend for ${g} identifiers in "${w/1e3}" seconds!`)),f&&r.info(C.magenta(`There were ${f} identifiers that were not in a state to be updated.They likely have already been resolved.`)),m)throw r.error(C.red(`There were ${m} identifiers that failed to be updated. Please review the logs for more information.`)),new Error("Failed to update all identifiers");return l.length}import j from"colors";import Q from"cli-progress";import{RequestDataSiloStatus as H}from"@transcend-io/privacy-types";async function Se({requestIds:t,dataSiloId:i,auth:c,concurrency:o=100,status:d=H.Resolved,transcendUrl:s=y}){let n=q(s,c),l=new Date().getTime(),u=new Q.SingleBar({},Q.Presets.shades_classic);r.info(j.magenta(`Notifying Transcend for data silo "${i}" marking "${t.length}" requests as completed.`));let a=0;u.start(t.length,0),await $(t,async m=>{let p=await N(n,{requestId:m,dataSiloId:i});try{await _(n,E,{requestDataSiloId:p.id,status:d})}catch(w){if(!w.message.includes("Client error: Request must be active:"))throw w}a+=1,u.update(a)},{concurrency:o}),u.stop();let f=new Date().getTime()-l;return r.info(j.green(`Successfully notified Transcend in "${f/1e3}" seconds!`)),t.length}export{W as a,k as b,oe as c,U as d,B as e,pe as f,Se as g};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import*as u from"fast-csv";import{createWriteStream as f,writeFileSync as j,appendFileSync as S}from"fs";function m(n){return n.includes('"')||n.includes(",")||n.includes(`
|
|
2
|
+
`)?`"${n.replace(/"/g,'""')}"`:n}function C(n,s,i){let t=[];t.push(i),t.push(...s.map(o=>Object.values(o)));let r=t.map(o=>o.map(m).join(",")).join(`
|
|
3
|
+
`);j(n,r)}function O(n,s){let t=s.map(r=>Object.values(r)).map(r=>r.map(m).join(",")).join(`
|
|
4
|
+
`);S(n,`
|
|
5
|
+
${t}`)}async function a(n,s,i=!0){let t=f(n);await new Promise((r,o)=>{try{u.write(s,{headers:i}).pipe(t).on("error",o).on("end",()=>r(!0))}catch(e){o(e)}})}async function x(n,s,i=!0,t=1e5){if(s.length<=t)return await a(n,s,i),[n];let r=[],o=Math.ceil(s.length/t),e=n.lastIndexOf("."),l=e!==-1?n.substring(0,e):n,w=e!==-1?n.substring(e):".csv";for(let c=0;c<o;c+=1){let g=c*t,b=Math.min(g+t,s.length),y=s.slice(g,b),v=String(c+1).padStart(String(o).length,"0"),p=`${l}_part${v}_of_${o}${w}`;await a(p,y,i),r.push(p)}return r}export{C as a,O as b,a as c,x as d};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as x}from"./chunk-YAW3NWII.js";import{n as u,q as D}from"./chunk-7NWTOLV6.js";import{Le as O,Me as U,a as R,b as P,bd as b,pc as L,pe as S,qc as M,tc as N,wc as k}from"./chunk-LYA6JDF3.js";import{e as C}from"./chunk-APA5PR4U.js";import{ga as w,ha as _}from"./chunk-HMF46LB7.js";import{a as c}from"./chunk-OERYFLN2.js";import{ConsentBundleType as H}from"@transcend-io/privacy-types";import A from"colors";async function at({auth:e,deploy:i=!1,transcendUrl:o=C,bundleTypes:t=Object.values(H)}){let r=S(o,e),n=await M(r);await R(t,async a=>{c.info(A.magenta(`Update Consent Manager bundle with ID "${n}" and type "${a}" to latest version...`)),await U(r,{id:n,bundleType:a}),c.info(A.green(`Updated Consent Manager bundle with ID "${n}" and type "${a}" to latest version!`))}),i&&await R(t,async a=>{c.info(A.magenta(`Deploying Consent Manager bundle with ID "${n}" and type "${a}"...`)),await O(r,{id:n,bundleType:a}),c.info(A.green(`Deployed Consent Manager bundle with ID "${n}" and type "${a}"!`))})}import G from"colors";var K=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function Ct({auth:e,trackerStatus:i,file:o,classifyService:t=!1,transcendUrl:r=C}){let n=S(r,e);c.info(G.magenta(`Reading "${o}" from disk`));let l=D(o,w).map(({Type:d,Notes:m,Service:f,Purpose:E,Status:g,Owners:I,Teams:T,"Connections Made To":v,...y})=>({value:v,type:d,description:m,trackingPurposes:u(E),status:g||i,owners:I?u(I):void 0,teams:T?u(T):void 0,attributes:Object.entries(y).filter(([h])=>!K.includes(h)).map(([h,B])=>({key:h,values:u(B)}))}));await b(n,l,t)||(c.error(G.red("Encountered error(s) syncing data flows from CSV, see logs above for more info. ")),process.exit(1))}import F from"colors";var j=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function vt({auth:e,trackerStatus:i,file:o,transcendUrl:t=C}){let r=S(t,e);c.info(F.magenta(`Reading "${o}" from disk`));let a=D(o,_).map(({"Is Regex?":s,Notes:d,Service:m,Purpose:f,Status:E,Owners:g,Teams:I,Name:T,...v})=>({...typeof s=="string"?{isRegex:s.toLowerCase()==="true"}:{},name:T,description:d,trackingPurposes:u(f),status:E||i,owners:g?u(g):void 0,teams:I?u(I):void 0,attributes:Object.entries(v).filter(([y])=>!j.includes(y)).map(([y,h])=>({key:y,values:u(h)}))}));await k(r,a)||(c.error(F.red("Encountered error(s) syncing cookies from CSV, see logs above for more info. ")),process.exit(1))}var Y=1e3,Q=60*Y,V=60*Q,X=24*V,z=7*X;async function Lt(e,{bin:i,start:o,end:t=new Date}){let r=await M(e),n=Math.floor(o.getTime()/1e3),a=Math.floor(t.getTime()/1e3);if(n>a)throw new Error('Received "end" date that happened before "start" date');if(i==="1h"&&t.getTime()-o.getTime()>z*2)throw new Error("When using bin=1h, start and end time can be no more than 2 weeks apart");let l=o.toISOString(),s=t.toISOString(),[d,m,f]=await Promise.all([N(e,{dataSource:"PRIVACY_SIGNAL_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),N(e,{dataSource:"CONSENT_CHANGES_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),N(e,{dataSource:"CONSENT_SESSIONS_BY_REGIME",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1})]);return{PRIVACY_SIGNAL_TIMESERIES:d,CONSENT_CHANGES_TIMESERIES:m,CONSENT_SESSIONS_BY_REGIME:f}}var $=e=>new URL(`https://${e}`).hostname.split(".").slice(-2).join(".");import W from"colors";import{difference as q}from"lodash-es";var J=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;async function Ht(e,{xdiLocation:i,transcendUrl:o=C,removeIpAddresses:t=!0,domainBlockList:r=["localhost"],xdiAllowedCommands:n="ConsentManager:Sync"}){let a=Array.isArray(e)?e:[{apiKey:e,organizationId:"",organizationName:""}],l=await P(a,async m=>{c.info(W.magenta(`Pulling consent metadata for organization - ${m.organizationName}`));let f=S(o,m.apiKey);return await L(f)},{concurrency:5}),s={};return l.forEach(m=>{let f=m.partition?.partition||m.bundleURL.split("/").reverse()[1];s[f]||(s[f]=[]);let E=q(m.configuration.domains.filter(g=>!t||!J.test(g)).map(g=>$(g)),r);s[f]=[...new Set([...s[f]||[],...E])]}),{html:`
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<script
|
|
4
|
+
src="${i}"
|
|
5
|
+
data-sync-groups='${JSON.stringify(s,null,2)}'
|
|
6
|
+
data-xdi-commands="${n}"
|
|
7
|
+
></script>
|
|
8
|
+
`,syncGroups:s}}function Yt(e){let i=e.map(({name:o,input:t})=>({title:o.replace(".yml",""),attributes:[...t?.domains?[{key:"Transcend Domain List",values:[...new Set(t.domains)]}]:[],...t?.bundleUrls?[{key:"Airgap Production URL",values:[t.bundleUrls.PRODUCTION]},{key:"Airgap Test URL",values:[t.bundleUrls.TEST]},{key:"Airgap XDI URL",values:[t.bundleUrls.PRODUCTION.replace("airgap.js","xdi.js")]}]:[],...t?.partition?[{key:"Consent Partition Key",values:[t.partition]}]:[]]}));return c.info(`
|
|
9
|
+
|
|
10
|
+
~~~~~~~~~~~
|
|
11
|
+
Airgap scripts to host:`),i.forEach(({attributes:o,title:t},r)=>{o?.find(n=>n.key==="Airgap Production URL")?.values?.forEach(n=>{c.info(`${r}) ${t} - ${n}`)})}),i}import*as p from"io-ts";import{decodeCodec as Z}from"@transcend-io/type-utils";var tt=p.intersection([p.type({nodes:p.array(x)}),p.partial({lastKey:p.partial({userId:p.string,partition:p.string,timestamp:p.string})})]);async function zt(e,{partition:i,filterBy:o={},limit:t=50}){let r,n=[],a=!0;for(;a;){let l=await e.post("v1/consent-preferences",{json:{partition:i,...o,startKey:r||void 0,limit:t}}).json(),{nodes:s,lastKey:d}=Z(tt,l);if(!s||s.length===0)break;n.push(...s),r=d,a=!!d&&Object.keys(d).length>0}return n}export{at as a,Ct as b,vt as c,Lt as d,$ as e,J as f,Ht as g,Yt as h,tt as i,zt as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as Ve,Ae as ye,Be as qe,Ca as Qe,Ce as Ye,De as We,Y as de,Z as ke,_ as oe,_b as P,a as je,b,dd as ge,ea as Me,pe as w,q as Fe,qe as W,se as Ge,ue as Ke,wa as Be,we as ze,xa as Ue,y as _e,ye as E}from"./chunk-LYA6JDF3.js";import{e as C}from"./chunk-APA5PR4U.js";import{a as u}from"./chunk-OERYFLN2.js";import{applyEnum as Jt,valuesOf as le}from"@transcend-io/type-utils";import{LanguageKey as Zt}from"@transcend-io/internationalization";import{CompletedRequestStatus as Ht,RequestAction as Xt,IsoCountryCode as er,IsoCountrySubdivisionCode as tr}from"@transcend-io/privacy-types";import*as R from"io-ts";var A="[NONE]",ce="[APPLY VALUE TO ALL ROWS]",Ce="<blank>",Re=["email","coreIdentifier"],ie=(c=>(c.Email="email",c.CoreIdentifier="coreIdentifier",c.RequestType="requestType",c.SubjectType="subjectType",c.Locale="locale",c.Country="country",c.CountrySubDivision="countrySubDivision",c.RequestStatus="requestStatus",c.CreatedAt="createdAt",c.DataSiloIds="dataSiloIds",c))(ie||{}),Je={email:!1,coreIdentifier:!0,requestType:!0,subjectType:!0,requestStatus:!1,createdAt:!1,dataSiloIds:!1,locale:!1,country:!1,countrySubDivision:!1},Ze={requestType:!0,subjectType:!0},He=R.type({columnNames:R.partial(Jt(ie,()=>R.string)),identifierNames:R.record(R.string,R.string),attributeNames:R.record(R.string,R.string),requestTypeToRequestAction:R.record(R.string,le(Xt)),subjectTypeToSubjectName:R.record(R.string,R.string),languageToLocale:R.record(R.string,le(Zt)),regionToCountry:R.record(R.string,le({...er,[A]:A})),regionToCountrySubDivision:R.record(R.string,le({...tr,[A]:A})),statusToRequestStatus:R.record(R.string,le({...Ht,[A]:A}))}),he=R.type({id:R.string,link:R.string,rowIndex:R.number,coreIdentifier:R.string,attemptedAt:R.string}),Xe=R.type({failingRequests:R.array(R.record(R.string,R.any)),successfulRequests:R.array(he),duplicateRequests:R.array(R.type({rowIndex:R.number,coreIdentifier:R.string,attemptedAt:R.string}))});import rr from"inquirer";import et from"fuzzysearch";function Se(n,e){return et(n.toLowerCase(),e.toLowerCase())||et(e.toLowerCase(),n.toLowerCase())}function ne(n,e,s,l){let a=n.filter(o=>Se(e.toLowerCase(),o.toLowerCase()));return[...a,new rr.Separator,...s?[]:[A],...l?[ce]:[],...n.filter(o=>!a.includes(o))]}import tt from"inquirer";import sr from"inquirer-autocomplete-prompt";import{apply as or}from"@transcend-io/type-utils";async function ee(n,e,s){tt.registerPrompt("autocomplete",sr);let l=n.map(o=>o||"<blank>").filter(o=>!s[o]);if(l.length===0)return s;let a=await tt.prompt(l.map(o=>({name:o,message:`Map value of: ${o}`,type:"autocomplete",default:e.find(i=>Se(o,i)),source:(i,r)=>r?e.filter(t=>typeof t=="string"&&Se(r,t)):e})));return{...s,...or(a,o=>typeof o=="string"?o:Object.values(o)[0])}}function Ie(n){return n.split(",").map(e=>e.trim()).filter(e=>e)}import rt from"colors";import*as te from"io-ts";var st=te.type({key:te.string,values:te.array(te.string)});function ot(n){let e=n.map(s=>{let[l,a]=s.trim().split(":");if(!a)throw new Error("Expected attributes in key:value1;value2,key2:value3;value4");let o=a.split(";");return{key:l,values:o}});return u.info(rt.magenta("Attributes to apply to all requests:")),u.info(rt.magenta(JSON.stringify(e,null,2))),e}import ir from"csv-parse/lib/sync";import{readFileSync as nr}from"fs";import*as it from"io-ts";import{decodeCodec as ar}from"@transcend-io/type-utils";function nt(n,e,s={columns:!0}){let l=ir(nr(n,"utf-8"),s);return ar(it.array(e),l).map(i=>Object.entries(i).reduce((r,[t,y])=>Object.assign(r,{[t.replace(/[^a-z_.+\-A-Z -~]/g,"")]:y}),{}))}import{uniq as ur}from"lodash-es";function G(n,e){return ur(n.map(s=>s[e]||"").flat())}import at from"inquirer";import lr from"colors";import{uniq as cr}from"lodash-es";async function ut(n){let e=cr(n.map(a=>Object.keys(a)).flat()),s=n,l=!0;for(;l;){let{filterColumnName:a}=await at.prompt([{name:"filterColumnName",message:`If you need to filter the list of requests to import, choose the column to filter on. Currently ${s.length} rows.`,type:"list",default:e,choices:[A,...e]}]);if(l=A!==a,l){let o=G(s,a),{valuesToKeep:i}=await at.prompt([{name:"valuesToKeep",message:"Keep rows matching this value",type:"checkbox",default:e,choices:o}]);s=s.filter(r=>i.includes(r[a]))}}return u.info(lr.magenta(`Importing ${s.length} requests`)),s}import lt from"colors";import{RequestStatus as J}from"@transcend-io/privacy-types";import ct from"cli-progress";async function Ys({requestActions:n,auth:e,requestIds:s,statuses:l=[J.Compiling,J.RequestMade,J.Delayed,J.Approving,J.Secondary,J.Enriching,J.Waiting,J.SecondaryApproving],createdAtAfter:a,createdAtBefore:o,concurrency:i=100,transcendUrl:r=C}){let t=w(r,e),y=new Date().getTime(),c=new ct.SingleBar({},ct.Presets.shades_classic),g=await E(t,{actions:n,statuses:l,createdAtBefore:o,createdAtAfter:a,isSilent:!1,requestIds:s});u.info(lt.magenta(`Marking "${g.length}" as silent mode.`));let m=0;c.start(g.length,0),await b(g,async f=>{await P(t,oe,{input:{id:f.id,isSilent:!0}}),m+=1,c.update(m)},{concurrency:i}),c.stop();let p=new Date().getTime()-y;return u.info(lt.green(`Successfully marked ${m} requests as silent mode in "${p/1e3}" seconds!`)),g.length}import{getValues as mr,getEntries as pr}from"@transcend-io/type-utils";import fr from"inquirer";import{startCase as dr}from"lodash-es";async function mt(n,e){let s=mr(ie).filter(a=>!e.getValue("columnNames",a)),l=s.length===0?{}:await fr.prompt(s.map(a=>{let o=dr(a.replace("ColumnName","")),i=ne(n,o,Je[a],!!Ze[a]);return{name:a,message:`Choose the column that will be used to map in the field: ${o}`,type:"list",default:i[0],choices:i}}));return await Promise.all(pr(l).map(([a,o])=>e.setValue(o,"columnNames",a))),l}import re from"colors";import{CompletedRequestStatus as gr,RequestAction as yr,IsoCountryCode as qr,IsoCountrySubdivisionCode as Rr}from"@transcend-io/privacy-types";import{LanguageKey as hr}from"@transcend-io/internationalization";async function pt(n,e,{state:s,columnNameMap:l}){let a=f=>s.getValue("columnNames",f)||l[f],{internalSubjects:o}=await P(n,_e);u.info(re.magenta("Determining mapping of columns for request action"));let i=await ee(G(e,a("requestType")),Object.values(yr),s.getValue("requestTypeToRequestAction"));await s.setValue(i,"requestTypeToRequestAction"),u.info(re.magenta("Determining mapping of columns for subject"));let r=await ee(G(e,a("subjectType")),o.map(({type:f})=>f),s.getValue("subjectTypeToSubjectName"));await s.setValue(r,"subjectTypeToSubjectName"),u.info(re.magenta("Determining mapping of columns for locale"));let t=await ee(G(e,a("locale")),Object.values(hr),s.getValue("languageToLocale"));await s.setValue(t,"languageToLocale"),u.info(re.magenta("Determining mapping of columns for request status")),u.info(re.magenta("Determining mapping of columns for request status"));let y=a("requestStatus"),c=y===A?{}:await ee(G(e,y),[...Object.values(gr),A],s.getValue("statusToRequestStatus"));await s.setValue(c,"statusToRequestStatus"),u.info(re.magenta("Determining mapping of columns for country"));let g=a("country"),m=g===A?{}:await ee(G(e,g),[...Object.values(qr),A],s.getValue("regionToCountry"));await s.setValue(m,"regionToCountry"),u.info(re.magenta("Determining mapping of columns for country sub division"));let d=a("countrySubDivision"),p=d===A?{}:await ee(G(e,d),[...Object.values(Rr),A],s.getValue("regionToCountrySubDivision"));await s.setValue(p,"regionToCountrySubDivision")}import{LanguageKey as Sr}from"@transcend-io/internationalization";import{DateFromISOString as br}from"io-ts-types/lib/DateFromISOString";import*as D from"io-ts";import{NORMALIZE_PHONE_NUMBER as Tr,CompletedRequestStatus as Ar,RequestAction as wr,IdentifierType as be,IsoCountryCode as Cr,IsoCountrySubdivisionCode as Ir}from"@transcend-io/privacy-types";import{valuesOf as me}from"@transcend-io/type-utils";var Pr=D.record(D.string,D.array(D.intersection([D.type({value:D.string}),D.partial({name:D.string})]))),wo=D.intersection([D.type({email:D.string,attestedExtraIdentifiers:Pr,coreIdentifier:D.string,requestType:me(wr),subjectType:D.string}),D.partial({country:me(Cr),countrySubDivision:me(Ir),attributes:D.array(st),status:me(Ar),createdAt:br,dataSiloIds:D.array(D.string),locale:me(Sr)})]);function Dr(n,e,s){if(e===be.Email)return n.toLowerCase();if(e===be.Phone){let l=n.replace(Tr,"").replace(/[()]/g,"").replace(/[–]/g,"").replace(/[:]/g,"").replace(/[]/g,"").replace(/[A-Za-z]/g,"");return l?l.startsWith("+")?l:`+${s}${l}`:""}return n}function ft(n,e,{columnNameMap:s,identifierNameMap:l,attributeNameMap:a,requestAttributeKeys:o,defaultPhoneCountryCode:i="1"}){let r=t=>e.getValue("columnNames",t)||s[t];return n.map(t=>{let y={};Object.entries(l).filter(([,d])=>d!==A).forEach(([d,p])=>{let f=Object.values(be).includes(d)?d:be.Custom,h=t[p];if(h){let S=Dr(h,f,i);S&&(y[f]||(y[f]=[]),y[f].push({value:S,name:d}))}});let c=[];Object.entries(a).filter(([,d])=>d!==A).forEach(([d,p])=>{let f=t[p];if(f){let h=o.find(S=>S.name===d)?.type==="MULTI_SELECT";c.push({values:h?Ie(f):f,key:d})}});let g=r("requestType"),m=r("subjectType");return[t,{email:t[r("email")],attestedExtraIdentifiers:y,attributes:c,coreIdentifier:t[r("coreIdentifier")],requestType:g===ce?e.getValue("requestTypeToRequestAction",Ce):e.getValue("requestTypeToRequestAction",t[g]),subjectType:m===ce?e.getValue("subjectTypeToSubjectName",Ce):e.getValue("subjectTypeToSubjectName",t[m]),...r("locale")!==A&&t[r("locale")]?{locale:e.getValue("languageToLocale",t[r("locale")])}:{},...r("country")!==A&&t[r("country")]?{country:e.getValue("regionToCountry",t[r("country")])}:{},...r("countrySubDivision")!==A&&t[r("countrySubDivision")]?{countrySubDivision:e.getValue("regionToCountrySubDivision",t[r("countrySubDivision")])}:{},...r("requestStatus")!==A&&e.getValue("statusToRequestStatus",t[r("requestStatus")])!==A&&t[r("requestStatus")]?{status:e.getValue("statusToRequestStatus",t[r("requestStatus")])}:{},...r("createdAt")!==A&&t[r("createdAt")]?{createdAt:new Date(t[r("createdAt")])}:{},...r("dataSiloIds")!==A&&t[r("dataSiloIds")]?{dataSiloIds:Ie(t[r("dataSiloIds")])}:{}}]})}import dt from"colors";import gt from"cli-progress";import*as q from"io-ts";import{decodeCodec as Er,valuesOf as vr}from"@transcend-io/type-utils";import{TableEncryptionType as Nr}from"@transcend-io/privacy-types";var yt=q.type({defaultMessage:q.string,id:q.string}),xr=q.type({downloadKey:q.string,error:q.union([q.null,q.string]),mimetype:q.string,size:q.string,fileName:q.string,dataPoint:q.type({id:q.string,title:q.union([yt,q.null]),description:q.union([yt,q.null]),name:q.string,slug:q.string,encryption:q.union([vr(Nr),q.null]),dataSilo:q.type({id:q.string,title:q.string,description:q.string,type:q.string,outerType:q.union([q.string,q.null])}),path:q.array(q.string)})}),Lr=q.type({nodes:q.array(xr),totalCount:q.number,_links:q.partial({next:q.union([q.string,q.null]),previous:q.union([q.string,q.null])})});async function qt(n,{sombra:e,concurrency:s=5,limit:l=100}){u.info(dt.magenta(`Pulling file metadata for ${n.length} requests`));let a=new Date().getTime(),o=new gt.SingleBar({},gt.Presets.shades_classic),i=0;o.start(n.length,0);let r=await b(n,async c=>{let g=[],m=!0,d=0;for(;m;){let p;try{let f=await e.get(`v1/data-subject-request/${c.id}/download-keys`,{searchParams:{limit:l,offset:d}}).json();p=Er(Lr,f),g.push(...p.nodes),d+=l,m=!!p._links.next&&p.nodes.length===l}catch(f){throw new Error(`Received an error from server: ${f?.response?.body||f?.message}`)}}return i+=1,o.update(i),[c,g]},{concurrency:s});o.stop();let y=new Date().getTime()-a;return u.info(dt.green(`Successfully downloaded file metadata ${n.length} requests in "${y/1e3}" seconds!`)),r}import $r from"colors";async function Rt(n,{requestId:e,sombra:s,onFileDownloaded:l,concurrency:a=20}){await b(n,async o=>{try{await s.get("v1/files",{searchParams:{downloadKey:o.downloadKey}}).buffer().then(i=>l(o,i))}catch(i){if(i?.response?.body?.includes("fileMetadata#verify")){u.error($r.red(`Failed to pull file for: ${o.fileName} (request:${e}) - JWT expired. This likely means that the file is no longer available. Try restarting the request from scratch in Transcend Admin Dashboard. Skipping the download of this file.`));return}throw new Error(`Received an error from server: ${i?.response?.body||i?.message}`)}},{concurrency:a})}import{existsSync as Pe,mkdirSync as De,writeFileSync as Or}from"fs";import{dirname as jr,join as ht}from"path";import St from"colors";import{RequestAction as Fr,RequestStatus as Ee}from"@transcend-io/privacy-types";import bt from"cli-progress";async function Yo({auth:n,folderPath:e,requestIds:s,createdAtBefore:l,sombraAuth:a,createdAtAfter:o,statuses:i=[Ee.Approving,Ee.Downloadable],concurrency:r=5,transcendUrl:t=C,approveAfterDownload:y=!1}){let c=w(t,n),g=await W(t,n,a);Pe(e)||De(e);let m=await E(c,{actions:[Fr.Access],createdAtBefore:l,createdAtAfter:o,statuses:i,requestIds:s}),d=await qt(m,{sombra:g,concurrency:r}),p=new Date().getTime(),f=new bt.SingleBar({},bt.Presets.shades_classic),h=0,S=0;f.start(m.length,0),await b(d,async([v,x])=>{let K=ht(e,v.id);Pe(K)||De(K),await Rt(x,{sombra:g,requestId:v.id,onFileDownloaded:($,_)=>{let z=ht(K,$.fileName),j=jr(z);Pe(j)||De(j,{recursive:!0}),Or(z,_)}}),y&&v.status===Ee.Approving&&(await P(c,de,{input:{requestId:v.id}}),S+=1),h+=1,f.update(h)},{concurrency:r}),f.stop();let T=new Date().getTime()-p;return u.info(St.green(`Successfully downloaded ${h} requests in "${T/1e3}" seconds!`)),S>0&&u.info(St.green(`Approved ${S} requests in Transcend.`)),m.length}import*as I from"io-ts";import{uniq as _r}from"lodash-es";import{valuesOf as Te,decodeCodec as kr}from"@transcend-io/type-utils";import{IsoCountryCode as Vr,IsoCountrySubdivisionCode as Mr,RequestAction as Br,RequestStatus as Ur}from"@transcend-io/privacy-types";var ve=I.type({id:I.string,link:I.string,status:Te(Ur),type:Te(Br),subjectType:I.string,email:I.union([I.null,I.string]),coreIdentifier:I.string,isSilent:I.boolean,isTest:I.boolean,country:I.union([I.null,Te(Vr)]),countrySubDivision:I.union([I.null,Te(Mr)]),attributeValues:I.array(I.type({attributeKey:I.type({name:I.string}),name:I.string}))});async function Tt(n,e,{details:s="",isTest:l=!1,emailIsVerified:a=!0,skipSendingReceipt:o=!1,isSilent:i=!0,additionalAttributes:r=[]}={}){let t=[...r];(e.attributes||[]).forEach(g=>{let m=t.find(d=>d.key===g.key);m?(m.values.push(...g.values),m.values=_r(m.values)):t.push(g)});let y;try{y=await n.post("v1/data-subject-request",{json:{type:e.requestType,subject:{coreIdentifier:e.coreIdentifier,email:e.email,emailIsVerified:a,attestedExtraIdentifiers:e.attestedExtraIdentifiers},subjectType:e.subjectType,isSilent:i,isTest:l,skipSendingReceipt:o,...e.locale?{locale:e.locale}:{},details:s,attributes:t,...e.country||e.countrySubDivision?{region:{...e.country?{country:e.country}:e.countrySubDivision?{country:e.countrySubDivision.split("-")[0]}:{},...e.countrySubDivision?{countrySubDivision:e.countrySubDivision}:{}}}:{},...e.createdAt?{createdAt:e.createdAt}:{},...e.dataSiloIds?{dataSiloIds:e.dataSiloIds}:{},...e.status?{completedRequestStatus:e.status}:{}}}).json()}catch(g){throw new Error(`Received an error from server: ${g?.response?.body||g?.message}`)}let{request:c}=kr(I.type({request:ve}),y);return c}import Ne from"colors";import{RequestStatus as Qr}from"@transcend-io/privacy-types";import At from"cli-progress";async function li({requestActions:n,requestOrigins:e,auth:s,silentModeBefore:l,createdAtAfter:a,createdAtBefore:o,concurrency:i=50,transcendUrl:r=C}){let t=w(r,s),y=new Date().getTime(),c=new At.SingleBar({},At.Presets.shades_classic),g=await E(t,{actions:n,statuses:[Qr.Approving],createdAtAfter:a,origins:e,createdAtBefore:o});u.info(Ne.magenta(`Approving "${g.length}" requests.`));let m=0,d=0;c.start(g.length,0),await b(g,async h=>{l&&new Date(l)>new Date(h.createdAt)&&await P(t,oe,{input:{id:h.id,isSilent:!0}});try{await P(t,de,{input:{requestId:h.id}})}catch(S){S.message.includes("Request must be in an approving state,")&&(d+=1)}m+=1,c.update(m)},{concurrency:i}),c.stop();let f=new Date().getTime()-y;return d>0&&u.info(Ne.yellow(`${d} requests were skipped.`)),u.info(Ne.green(`Successfully approved ${m} requests in "${f/1e3}" seconds!`)),g.length}import wt from"colors";import{RequestAction as Gr}from"@transcend-io/privacy-types";import Ct from"cli-progress";async function Ri({requestActions:n=Object.values(Gr),auth:e,requestIds:s,createdAtBefore:l,days:a=45,daysLeft:o=10,createdAtAfter:i,emailTemplate:r="Additional Time Needed",concurrency:t=100,transcendUrl:y=C}){let c=w(y,e),g=new Date().getTime(),m=new Ct.SingleBar({},Ct.Presets.shades_classic),p=(await ge(c,r)).find(T=>T.title===r);if(!p)throw new Error(`Failed to find a template with title: "${r}"`);let f=await E(c,{actions:n,createdAtBefore:l,createdAtAfter:i,isSilent:!1,isClosed:!1,requestIds:s});f=f.filter(T=>typeof T.daysRemaining=="number"&&T.daysRemaining<o),u.info(wt.magenta(`Notifying "${f.length}" that more time is needed.`));let h=0;m.start(f.length,0),await b(f,async T=>{await P(c,Ve,{input:{requestId:T.id,template:p.template.defaultMessage,subject:p.subject.defaultMessage,additionalTime:a}}),h+=1,m.update(h)},{concurrency:t}),m.stop();let N=new Date().getTime()-g;return u.info(wt.green(`Successfully marked ${h} requests as silent mode in "${N/1e3}" seconds!`)),f.length}import Kr from"inquirer";async function It(n,e,s){let{initializer:l}=await P(n,Fe),a=l.identifiers.filter(({name:i})=>!s.getValue("identifierNames",i)&&!Re.includes(i)),o=a.length===0?{}:await Kr.prompt(a.map(({name:i})=>{let r=ne(e,i,!1);return{name:i,message:`Choose the column that will be used to map in the identifier: ${i}`,type:"list",default:r[0],choices:r}}));return await Promise.all(Object.entries(o).map(([i,r])=>s.setValue(r,"identifierNames",i))),{...s.getValue("identifierNames"),...o}}import Pt from"colors";import{RequestStatus as Z}from"@transcend-io/privacy-types";import Dt from"cli-progress";async function ji({requestActions:n,cancellationTitle:e,auth:s,requestIds:l,silentModeBefore:a,createdAtBefore:o,createdAtAfter:i,statuses:r=[Z.Compiling,Z.RequestMade,Z.Delayed,Z.Approving,Z.Secondary,Z.Enriching,Z.Waiting,Z.SecondaryApproving],concurrency:t=50,transcendUrl:y=C}){let c=w(y,s),g=new Date().getTime(),m=new Dt.SingleBar({},Dt.Presets.shades_classic),d;if(e){let T=(await ge(c,e)).find(v=>v.title===e);if(!T)throw new Error(`Failed to find a template with title: "${e}"`);d=T}let p=await E(c,{actions:n,createdAtBefore:o,createdAtAfter:i,statuses:r,requestIds:l});u.info(Pt.magenta(`Canceling "${p.length}" requests${d?` Using template: ${d.title}`:""}.`));let f=0;m.start(p.length,0),await b(p,async N=>{a&&new Date(a)>new Date(N.createdAt)&&await P(c,oe,{input:{id:N.id,isSilent:!0}}),await P(c,ke,{input:{requestId:N.id,...d?{subject:`Re: ${d.subject.defaultMessage}`,template:d.template.defaultMessage}:{}}}),f+=1,m.update(f)},{concurrency:t}),m.stop();let S=new Date().getTime()-g;return u.info(Pt.green(`Successfully canceled ${f} requests in "${S/1e3}" seconds!`)),p.length}import zr from"inquirer";async function Et(n,e,s,l){let a=l.filter(({name:i})=>!s.getValue("attributeNames",i)),o=a.length===0?{}:await zr.prompt(a.map(({name:i})=>{let r=ne(e,i,!1);return{name:i,message:`Choose the column that will be used to map in the attribute: ${i}`,type:"list",default:r[0],choices:r}}));return await Promise.all(Object.entries(o).map(([i,r])=>s.setValue(r,"attributeNames",i))),{...s.getValue("attributeNames"),...o}}var vt=/{\\"message\\":\\"(.+?)\\",/;function Ae(n){return vt.test(n)?vt.exec(n)[1]:null}import F from"colors";import*as pe from"io-ts";import{uniq as Yr}from"lodash-es";import Nt from"cli-progress";import{join as Wr}from"path";import{PersistedState as xt}from"@transcend-io/persisted-state";async function ln({cacheFilepath:n,requestReceiptFolder:e,file:s,auth:l,sombraAuth:a,concurrency:o=100,defaultPhoneCountryCode:i="1",transcendUrl:r=C,attributes:t=[],emailIsVerified:y=!0,skipFilterStep:c=!1,skipSendingReceipt:g=!0,isTest:m=!1,isSilent:d=!0,debug:p=!1,dryRun:f=!1}){let h=new Date().getTime(),S=new Nt.SingleBar({},Nt.Presets.shades_classic),N=ot(t),T=new xt(n,He,{columnNames:{},requestTypeToRequestAction:{},subjectTypeToSubjectName:{},languageToLocale:{},statusToRequestStatus:{},identifierNames:{},attributeNames:{},regionToCountrySubDivision:{},regionToCountry:{}}),v=Wr(e,`tr-request-upload-${new Date().toISOString()}-${s.split("/").pop()}`.replace(".csv",".json")),x=new xt(v,Xe,{successfulRequests:[],duplicateRequests:[],failingRequests:[]}),K=await W(r,l,a),$=nt(s,pe.record(pe.string,pe.string)),_=Yr($.map(U=>Object.keys(U)).flat());if($.length===0)throw new Error("No Requests found in list! Ensure the first row of the CSV is a header and the rest are requests.");if(p){let U=$[0];u.info(F.magenta(`First request: ${JSON.stringify(U,null,2)}`))}let z=c?$:await ut($),j=w(r,l),L=await ze(j),B=await mt(_,T),Y=await It(j,_,T),k=await Et(j,_,T,L);await pt(j,z,{state:T,columnNameMap:B});let O=ft(z,T,{defaultPhoneCountryCode:i,columnNameMap:B,identifierNameMap:Y,attributeNameMap:k,requestAttributeKeys:L});p||S.start(O.length,0);let H=0;await b(O,async([U,V],Q)=>{let Oe=p?`email:${V.email} | coreIdentifier:${V.coreIdentifier}`:`row:${Q.toString()}`;if(p&&u.info(F.magenta(`[${Q+1}/${O.length}] Importing: ${JSON.stringify(V,null,2)}`)),f){u.info(F.magenta("Bailing out on dry run because dryRun is set"));return}try{let X=await Tt(K,V,{details:`Uploaded by Transcend Cli: "tr-request-upload" : ${JSON.stringify(U,null,2)}`,isTest:m,emailIsVerified:y,skipSendingReceipt:g,isSilent:d,additionalAttributes:N});p&&(u.info(F.green(`[${Q+1}/${O.length}] Successfully submitted the test data subject request: "${Oe}"`)),u.info(F.green(`[${Q+1}/${O.length}] View it at: "${X.link}"`)));let se=x.getValue("successfulRequests");se.push({id:X.id,link:X.link,rowIndex:Q,coreIdentifier:X.coreIdentifier,attemptedAt:new Date().toISOString()}),await x.setValue(se,"successfulRequests")}catch(X){let se=`${X.message} - ${JSON.stringify(X.response?.body,null,2)}`,we=Ae(se);if(we==="Client error: You have already made this request."){p&&u.info(F.yellow(`[${Q+1}/${O.length}] Skipping request as it is a duplicate`));let ue=x.getValue("duplicateRequests");ue.push({coreIdentifier:V.coreIdentifier,rowIndex:Q,attemptedAt:new Date().toISOString()}),await x.setValue(ue,"duplicateRequests")}else{let ue=x.getValue("failingRequests");ue.push({...V,rowIndex:Q,error:we||se,attemptedAt:new Date().toISOString()}),await x.setValue(ue,"failingRequests"),p&&(u.error(F.red(we||se)),u.error(F.red(`[${Q+1}/${O.length}] Failed to submit request for: "${Oe}"`)))}}H+=1,p||S.update(H)},{concurrency:o}),S.stop();let ae=new Date().getTime()-h;u.info(F.green(`Completed upload in "${ae/1e3}" seconds.`)),x.getValue("duplicateRequests").length>0&&u.info(F.yellow(`Encountered "${x.getValue("duplicateRequests").length}" duplicate requests. See "${v}" to review the core identifiers for these requests.`)),x.getValue("failingRequests").length>0&&(u.error(F.red(`Encountered "${x.getValue("failingRequests").length}" errors. See "${v}" to review the error messages and inputs.`)),process.exit(1))}import*as Lt from"io-ts";import{groupBy as Jr}from"lodash-es";import{apply as Zr,decodeCodec as Hr}from"@transcend-io/type-utils";import{IdentifierType as xe}from"@transcend-io/privacy-types";async function $t(n,e,{sendEmailReceipt:s=!1,skipWaitingPeriod:l=!1,emailIsVerified:a=!0,requestIdentifiers:o=[]}={}){let i=await n.post("v1/data-subject-request",{json:{type:e.type,subject:{coreIdentifier:e.coreIdentifier,email:e.email,emailIsVerified:a,...o.length>0?{attestedExtraIdentifiers:Zr(Jr(o.filter(t=>!(t.name==="email"&&t.value===e.email)&&!Re.includes(t.name)).map(t=>({...t,type:Object.values(xe).includes(t.name)?t.name:xe.Custom})),"type"),(t,y)=>t.map(({name:c,value:g})=>({...y===xe.Custom?{name:c}:{},value:g})))}:{}},requestId:e.id,subjectType:e.subjectType,isSilent:e.isSilent,isTest:e.isTest,locale:e.locale,skipWaitingPeriod:l,createdAt:e.createdAt,details:`Restarted by Transcend cli: "tr-request-restart" - ${e.details}`,skipSendingReceipt:!s}}).json(),{request:r}=Hr(Lt.type({request:ve}),i);return r}import{PersistedState as Xr}from"@transcend-io/persisted-state";import Ot from"cli-progress";import Le from"colors";import*as M from"io-ts";import{difference as es}from"lodash-es";import{join as ts}from"path";var rs=M.intersection([he,M.type({error:M.string})]),ss=M.type({restartedRequests:M.array(he),failingRequests:M.array(rs)});async function En({requestReceiptFolder:n,auth:e,sombraAuth:s,requestActions:l,requestStatuses:a,createdAtBefore:o,createdAtAfter:i,transcendUrl:r=C,requestIds:t=[],createdAt:y=new Date,silentModeBefore:c,sendEmailReceipt:g=!1,emailIsVerified:m=!0,copyIdentifiers:d=!1,skipWaitingPeriod:p=!1,concurrency:f=20}){let h=new Date().getTime(),S=new Ot.SingleBar({},Ot.Presets.shades_classic),N=ts(n,`tr-request-restart-${new Date().toISOString()}`),T=new Xr(N,ss,{restartedRequests:[],failingRequests:[]}),v=await W(r,e,s),x=w(r,e),$=(await E(x,{actions:l,statuses:a,createdAtBefore:o,createdAtAfter:i})).filter(L=>new Date(L.createdAt)<y);if(u.info(`Found ${$.length} requests to process`),d&&u.info("copyIdentifiers detected - All Identifiers will be copied."),g&&u.info("sendEmailReceipt detected - Email receipts will be sent."),p&&u.info("skipWaitingPeriod detected - Waiting period will be skipped."),t.length>0&&t.length!==$.length){let L=es(t,$.map(({id:B})=>B));L.length>0&&(u.error(Le.red(`Failed to find the following requests by ID: ${L.join(",")}.`)),process.exit(1))}let _=0;S.start($.length,0),await b($,async(L,B)=>{try{let Y=d?await ye(x,v,{requestId:L.id}):[],k=await $t(v,{...L,isSilent:c&&new Date(L.createdAt)<c?!0:L.isSilent},{requestIdentifiers:Y,skipWaitingPeriod:p,sendEmailReceipt:g,emailIsVerified:m}),O=T.getValue("restartedRequests");O.push({id:k.id,link:k.link,rowIndex:B,coreIdentifier:k.coreIdentifier,attemptedAt:new Date().toISOString()}),await T.setValue(O,"restartedRequests")}catch(Y){let k=`${Y.message} - ${JSON.stringify(Y.response?.body,null,2)}`,O=Ae(k),H=T.getValue("failingRequests");H.push({id:L.id,link:L.link,rowIndex:B,coreIdentifier:L.coreIdentifier,attemptedAt:new Date().toISOString(),error:O||k}),await T.setValue(H,"failingRequests")}_+=1,S.update(_)},{concurrency:f}),S.stop();let j=new Date().getTime()-h;u.info(Le.green(`Completed restarting of requests in "${j/1e3}" seconds.`)),T.getValue("failingRequests").length>0&&(u.error(Le.red(`Encountered "${T.getValue("failingRequests").length}" errors. See "${N}" to review the error messages and inputs.`)),process.exit(1))}import jt from"colors";import Ft from"cli-progress";import{RequestEnricherStatus as _t,RequestStatus as os}from"@transcend-io/privacy-types";async function _n({enricherIds:n,auth:e,concurrency:s=100,transcendUrl:l=C}){let a=w(l,e),o=new Date().getTime(),i=await E(a,{statuses:[os.Enriching]});u.info(jt.magenta(`Processing enricher: "${n.join(",")}" fetched "${i.length}" in enriching status.`));let r=new Ft.SingleBar({},Ft.Presets.shades_classic),t=0;r.start(i.length,0);let y=0;await b(i,async m=>{let p=(await qe(a,{requestId:m.id})).filter(f=>n.includes(f.enricher.id)&&![_t.Resolved,_t.Skipped].includes(f.status));p.length>0&&await je(p,async f=>{try{await P(a,Me,{requestEnricherId:f.id}),y+=1}catch(h){if(!h.message.includes("Client error: Cannot skip Request enricher because it has already completed"))throw h}}),t+=1,r.update(t)},{concurrency:s}),r.stop();let g=new Date().getTime()-o;return u.info(jt.green(`Successfully skipped "${y}" for "${i.length}" requests in "${g/1e3}" seconds!`)),i.length}import{RequestEnricherStatus as is,RequestStatus as ns}from"@transcend-io/privacy-types";import kt from"cli-progress";import $e from"colors";import{difference as as}from"lodash-es";async function Wn({auth:n,requestActions:e=[],createdAtBefore:s,createdAtAfter:l,transcendUrl:a=C,requestEnricherStatuses:o=Object.values(is),requestIds:i=[],enricherId:r,concurrency:t=20}){let y=new Date().getTime(),c=new kt.SingleBar({},kt.Presets.shades_classic),g=w(a,n);u.info($e.magenta("Fetching requests to restart..."));let m=await E(g,{actions:e,statuses:[ns.Enriching],createdAtBefore:s,createdAtAfter:l,requestIds:i}),d=0;if(i.length>0&&i.length!==m.length){let S=as(i,m.map(({id:N})=>N));S.length>0&&(u.error($e.red(`Failed to find the following requests by ID: ${S.join(",")}.`)),process.exit(1))}let p=0;c.start(m.length,0),await b(m,async S=>{let T=(await qe(g,{requestId:S.id})).filter(v=>v.enricher.id===r&&o.includes(v.status));await b(T,async v=>{await Ge(g,v.id),d+=1}),p+=1,c.update(p)},{concurrency:t}),c.stop();let h=new Date().getTime()-y;u.info($e.green(`Completed restarting of ${m.length} requests and ${d} enrichers in "${h/1e3}" seconds.`))}import Vt from"colors";import{RequestStatus as Mt}from"@transcend-io/privacy-types";import Bt from"cli-progress";async function ia({requestActions:n,dataSiloId:e,auth:s,concurrency:l=20,transcendUrl:a=C}){let o=w(a,s),i=new Date().getTime(),r=new Bt.SingleBar({},Bt.Presets.shades_classic),t=await E(o,{actions:n,statuses:[Mt.Compiling,Mt.Approving]});u.info(Vt.magenta(`Retrying requests for Data Silo: "${e}", restarting "${t.length}" requests.`));let y=0,c=0;r.start(t.length,0),await b(t,async d=>{try{let p=await We(o,{requestId:d.id,dataSiloId:e});await P(o,Ue,{requestDataSiloId:p.id})}catch(p){if(!p.message.includes("Failed to find RequestDataSilo"))throw p;c+=1}y+=1,r.update(y)},{concurrency:l}),r.stop();let m=new Date().getTime()-i;return u.info(Vt.green(`Successfully notified Transcend in "${m/1e3}" seconds for ${y} requests, ${c} requests were skipped because data silo was not attached to the request!`)),t.length}import Ut from"colors";import{groupBy as Qt}from"lodash-es";async function ga({auth:n,sombraAuth:e,actions:s=[],statuses:l=[],identifierSearch:a,pageLimit:o=100,transcendUrl:i=C,createdAtBefore:r,createdAtAfter:t,isTest:y}){let c=w(i,n),g=await W(i,n,e),m="";r&&(m+=` before ${r.toISOString()}`),t&&(m+=`${m?", and":""} after ${t.toISOString()}`),u.info(Ut.magenta(`${s.length>0?`Pulling requests of type "${s.join('" , "')}"`:"Pulling all requests"}${m}`));let d=await E(c,{actions:s,text:a,statuses:l,createdAtBefore:r,createdAtAfter:t,isTest:y}),p=await b(d,async h=>{let S=await ye(c,g,{requestId:h.id});return{...h,requestIdentifiers:S}},{concurrency:o});u.info(Ut.magenta(`Pulled ${p.length} requests`));let f=p.map(({attributeValues:h,requestIdentifiers:S,id:N,email:T,type:v,status:x,subjectType:K,details:$,createdAt:_,country:z,locale:j,origin:L,countrySubDivision:B,isSilent:Y,isTest:k,coreIdentifier:O,...H})=>({"Request ID":N,"Created At":_,Email:T,"Core Identifier":O,"Request Type":v,"Data Subject Type":K,Status:x,Country:z,"Country Sub Division":B,Details:$,Origin:L,"Silent Mode":Y,"Is Test Request":k,Language:j,...H,...Object.entries(Qt(h,"attributeKey.name")).reduce((fe,[ae,U])=>Object.assign(fe,{[ae]:U.map(({name:V})=>V).join(",")}),{}),...Object.entries(Qt(S,"name")).reduce((fe,[ae,U])=>Object.assign(fe,{[ae]:U.map(({value:V})=>V).join(",")}),{})}));return{requestsWithRequestIdentifiers:p,requestsFormattedForCsv:f}}import Gt from"colors";import Kt from"cli-progress";import{RequestStatus as zt}from"@transcend-io/privacy-types";async function wa({dataSiloId:n,auth:e,concurrency:s=100,status:l="SKIPPED",transcendUrl:a=C,requestStatuses:o=[zt.Compiling,zt.Secondary]}){let i=w(a,e),r=new Date().getTime(),t=await Ye(i,{dataSiloId:n,requestStatuses:o});u.info(Gt.magenta(`Processing data silo: "${n}" marking "${t.length}" requests as skipped.`));let y=new Kt.SingleBar({},Kt.Presets.shades_classic),c=0;y.start(t.length,0),await b(t,async d=>{try{await P(i,Be,{requestDataSiloId:d.id,status:l})}catch(p){if(!p.message.includes("Client error: Request must be active:"))throw p}c+=1,y.update(c)},{concurrency:s}),y.stop();let m=new Date().getTime()-r;return u.info(Gt.green(`Successfully skipped "${t.length}" requests in "${m/1e3}" seconds!`)),t.length}import Yt from"colors";import{RequestStatus as us}from"@transcend-io/privacy-types";import Wt from"cli-progress";async function $a({requestActions:n,identifierNames:e,auth:s,concurrency:l=20,transcendUrl:a=C}){let o=w(a,s),i=new Date().getTime(),r=new Wt.SingleBar({},Wt.Presets.shades_classic),t=await E(o,{actions:n,statuses:[us.Enriching]});u.info(Yt.magenta("Fetched requests in preflight/enriching state."));let y=0,c=0;r.start(t.length,0),await b(t,async d=>{let f=(await Ke(o,{requestId:d.id})).filter(({isVerifiedAtLeastOnce:h,name:S})=>h===!1&&e.includes(S)).map(({id:h})=>h);f.length>0&&(await P(o,Qe,{input:{requestId:d.id,requestIdentifierIds:f}}),c+=f.length),y+=1,r.update(y)},{concurrency:l}),r.stop();let m=new Date().getTime()-i;return u.info(Yt.green(`Successfully cleared out unverified identifiers "${m/1e3}" seconds for ${y} requests, ${c} identifiers were cleared out!`)),t.length}export{A as a,ce as b,Ce as c,Re as d,ie as e,Je as f,Ze as g,He as h,he as i,Xe as j,Se as k,ne as l,ee as m,Ie as n,st as o,ot as p,nt as q,G as r,ut as s,Ys as t,mt as u,pt as v,Pr as w,wo as x,Dr as y,ft as z,yt as A,xr as B,Lr as C,qt as D,Rt as E,Yo as F,ve as G,Tt as H,li as I,Ri as J,It as K,ji as L,Et as M,Ae as N,ln as O,$t as P,En as Q,_n as R,Wn as S,ia as T,ga as U,wa as V,$a as W};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getEntries as c}from"@transcend-io/type-utils";function o(s,...e){let n=JSON.parse(JSON.stringify(s));return e.forEach(a=>{c(a).forEach(([r,t])=>{n[r]===void 0?n[r]=t:Array.isArray(t)?n[r]=[...n[r],...t]:n[r]=t})}),n}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ScopeName as e}from"@transcend-io/privacy-types";var r="transcend",s="https://app.transcend.io",c=`${s}/infrastructure/integrations`,p=`${s}/data-map/data-inventory/data-points`,g=process.env.TRANSCEND_API_URL||"https://api.transcend.io",l=process.env.TRANSCEND_CONSENT_API_URL||"https://consent.transcend.io",m={apiKeys:[e.ViewApiKeys],templates:[e.ManageEmailTemplates],dataSilos:[e.ManageDataMap,e.ConnectDataSilos],enrichers:[e.ManageRequestIdentities],businessEntities:[e.ManageDataInventory],identifiers:[e.ManageRequestIdentities],customFields:[e.ManageGlobalAttributes],dataFlows:[e.ManageDataFlow],cookies:[e.ManageDataFlow],consentManager:[e.ManageConsentManagerDeveloperSettings],partitions:[e.ManageConsentManagerDeveloperSettings],actions:[e.ManageDataSubjectRequestSettings],dataSubjects:[e.ManageDataSubjectRequestSettings],prompts:[e.ManagePrompts],promptPartials:[e.ManagePrompts],promptGroups:[e.ManagePrompts],agents:[e.ManagePathfinder],agentFunctions:[e.ManagePathfinder],agentFiles:[e.ManagePathfinder],vendors:[e.ManageDataInventory],dataCategories:[e.ManageDataInventory],processingPurposes:[e.ManageDataInventory],actionItems:[e.ManageAllActionItems,e.ViewGlobalAttributes],actionItemCollections:[e.ManageActionItemCollections],teams:[e.ManageAccessControl],messages:[e.ManageIntlMessages],privacyCenters:[e.ManagePrivacyCenter],policies:[e.ManagePolicies],assessments:[e.ManageAssessments],assessmentTemplates:[e.ManageAssessments],purposes:[e.ManageConsentManager,e.ManagePreferenceStoreSettings]},A={apiKeys:[e.ViewApiKeys],templates:[e.ViewEmailTemplates],dataSilos:[e.ViewDataMap,e.ViewDataSubjectRequestSettings],enrichers:[e.ViewRequestIdentitySettings],businessEntities:[e.ViewDataInventory],identifiers:[e.ViewRequestIdentitySettings],customFields:[e.ViewGlobalAttributes],dataFlows:[e.ViewDataFlow],cookies:[e.ViewDataFlow],consentManager:[e.ViewConsentManager],partitions:[e.ViewConsentManager],actions:[e.ViewDataSubjectRequestSettings],dataSubjects:[e.ViewDataSubjectRequestSettings],prompts:[e.ViewPrompts],promptPartials:[e.ViewPrompts],promptGroups:[e.ViewPrompts],agents:[e.ViewPathfinder],agentFunctions:[e.ViewPathfinder],agentFiles:[e.ViewPathfinder],vendors:[e.ViewDataInventory],dataCategories:[e.ViewDataInventory],processingPurposes:[e.ViewDataInventory],actionItemCollections:[e.ViewAllActionItems],actionItems:[e.ViewAllActionItems],teams:[e.ViewScopes],messages:[e.ViewIntlMessages],privacyCenters:[e.ViewPrivacyCenter],policies:[e.ViewPolicies],assessments:[e.ViewAssessments],assessmentTemplates:[e.ViewAssessments],purposes:[e.ViewConsentManager,e.ViewPreferenceStoreSettings]},P={apiKeys:"api-keys",customFields:"attributes",dataFlows:"data-flows",cookies:"cookies",consentManager:"consent-manager",partitions:"partitions",actions:"actions",dataSubjects:"data-subjects",businessEntities:"business-entities",identifiers:"identifiers",enrichers:"enrichers",dataSilos:"data-silos",templates:"templates",prompts:"prompts",promptPartials:"prompt-partials",promptGroups:"prompt-groups",agents:"agents",agentFunctions:"agent-functions",agentFiles:"agent-files",vendors:"vendors",dataCategories:"data-categories",processingPurposes:"processing-purposes",actionItems:"action-items",actionItemCollections:"action-item-collections",teams:"teams",messages:"messages",privacyCenters:"privacy-center",policies:"policies",assessments:"assessments",assessmentTemplates:"assessment-templates",purposes:"purposes"};export{r as a,s as b,c,p as d,g as e,l as f,m as g,A as h,P as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as i}from"./chunk-7NWTOLV6.js";import o from"inquirer";import m from"inquirer-autocomplete-prompt";async function c({message:e}){let{response:r}=await o.prompt([{name:"response",message:e,type:"confirm"}]);return r}async function l({message:e}){let{response:r}=await o.prompt([{name:"response",message:e,type:"text",validate:t=>t.trim().length>0}]);return r}async function y({defaultValue:e,values:r,message:t}){o.registerPrompt("autocomplete",m);let{response:p}=await o.prompt([{name:"response",message:t,type:"autocomplete",default:e,source:(a,n)=>n?r.filter(s=>typeof s=="string"&&i(n,s)):r}]);return p}export{c as a,l as b,y as c};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import{_b as S,a as w,f as $,i as B,j as T,l as R}from"./chunk-LYA6JDF3.js";import{a as i}from"./chunk-OERYFLN2.js";import{keyBy as O,uniq as A,chunk as U,sortBy as G}from"lodash-es";import{SubDataPointDataSubCategoryGuessStatus as _}from"@transcend-io/privacy-types";import h from"cli-progress";import{gql as L}from"graphql-request";import f from"colors";async function q(u,{dataSiloIds:e=[],includeGuessedCategories:l,includeAttributes:a,parentCategories:c=[],subCategories:t=[],pageSize:p=1e3}={}){let n=[],m=new Date().getTime(),d=new h.SingleBar({},h.Presets.shades_classic),s={...c.length>0?{category:c}:{},...t.length>0?{subCategoryIds:t}:{},...c.length+t.length>0&&!l?{status:_.Approved}:{},...e.length>0?{dataSilos:e}:{}},{subDataPoints:{totalCount:o}}=await S(u,$,{filterBy:s});i.info(f.magenta("[Step 1/3] Pulling in all subdatapoints")),d.start(o,0);let y=0,D=!1,r,b=0;do try{let{subDataPoints:{nodes:P}}=await S(u,L`
|
|
2
|
+
query TranscendCliSubDataPointCsvExport(
|
|
3
|
+
$filterBy: SubDataPointFiltersInput
|
|
4
|
+
$first: Int!
|
|
5
|
+
$offset: Int!
|
|
6
|
+
) {
|
|
7
|
+
subDataPoints(
|
|
8
|
+
filterBy: $filterBy
|
|
9
|
+
first: $first
|
|
10
|
+
offset: $offset
|
|
11
|
+
useMaster: false
|
|
12
|
+
) {
|
|
13
|
+
nodes {
|
|
14
|
+
id
|
|
15
|
+
name
|
|
16
|
+
description
|
|
17
|
+
dataPointId
|
|
18
|
+
dataSiloId
|
|
19
|
+
purposes {
|
|
20
|
+
name
|
|
21
|
+
purpose
|
|
22
|
+
}
|
|
23
|
+
categories {
|
|
24
|
+
name
|
|
25
|
+
category
|
|
26
|
+
}
|
|
27
|
+
${l?`pendingCategoryGuesses {
|
|
28
|
+
category {
|
|
29
|
+
name
|
|
30
|
+
category
|
|
31
|
+
}
|
|
32
|
+
status
|
|
33
|
+
classifierVersion
|
|
34
|
+
}`:""}
|
|
35
|
+
${a?`attributeValues {
|
|
36
|
+
attributeKey {
|
|
37
|
+
name
|
|
38
|
+
}
|
|
39
|
+
name
|
|
40
|
+
}`:""}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`,{first:p,offset:b,filterBy:{...s}});r=P[P.length-1]?.id,n.push(...P),D=P.length===p,y+=P.length,b+=P.length,d.update(y)}catch(P){throw i.error(f.red(`An error fetching subdatapoints for cursor ${r} and offset ${b}`)),P}while(D);d.stop();let C=new Date().getTime()-m,g=G(n,"name");return i.info(f.green(`Successfully pulled in ${g.length} subdatapoints in ${C/1e3} seconds!`)),g}async function F(u,{dataPointIds:e=[],pageSize:l=100}){let a=[],c=new Date().getTime(),t=new h.SingleBar({},h.Presets.shades_classic);i.info(f.magenta(`[Step 2/3] Fetching metadata for ${e.length} datapoints`));let p=U(e,l);t.start(e.length,0);let n=0;await w(p,async s=>{try{let{dataPoints:{nodes:o}}=await S(u,B,{first:l,filterBy:{ids:s}});a.push(...o),n+=s.length,t.update(n)}catch(o){throw i.error(f.red(`An error fetching subdatapoints for IDs ${s.join(", ")}`)),o}}),t.stop();let d=new Date().getTime()-c;return i.info(f.green(`Successfully pulled in ${a.length} dataPoints in ${d/1e3} seconds!`)),a}async function Q(u,{dataSiloIds:e=[],pageSize:l=100}){let a=[],c=new Date().getTime(),t=new h.SingleBar({},h.Presets.shades_classic);i.info(f.magenta(`[Step 3/3] Fetching metadata for ${e.length} data silos`));let p=U(e,l);t.start(e.length,0);let n=0;await w(p,async s=>{try{let{dataSilos:{nodes:o}}=await S(u,R,{first:l,filterBy:{ids:s}});a.push(...o),n+=s.length,t.update(n)}catch(o){throw i.error(f.red(`An error fetching data silos for IDs ${s.join(", ")}`)),o}}),t.stop();let d=new Date().getTime()-c;return i.info(f.green(`Successfully pulled in ${a.length} data silos in ${d/1e3} seconds!`)),a}async function H(u,{dataSiloIds:e=[],includeGuessedCategories:l,includeAttributes:a,parentCategories:c=[],subCategories:t=[],pageSize:p=1e3}={}){let n=await q(u,{dataSiloIds:e,includeGuessedCategories:l,includeAttributes:a,parentCategories:c,subCategories:t,pageSize:p}),m=A(n.map(r=>r.dataPointId)),d=await F(u,{dataPointIds:m}),s=O(d,"id"),o=A(n.map(r=>r.dataSiloId)),y=await Q(u,{dataSiloIds:o}),D=O(y,"id");return n.map(r=>({...r,dataPoint:s[r.dataPointId],dataSilo:D[r.dataSiloId]}))}import x from"cli-progress";import v from"colors";import{gql as E}from"graphql-request";import{sortBy as V}from"lodash-es";async function st(u,{dataSiloIds:e=[],status:l,subCategories:a=[],includeEncryptedSnippets:c,pageSize:t=100}={}){let p=[],n=new Date().getTime(),m=new x.SingleBar({},x.Presets.shades_classic),d={...a.length>0?{subCategoryIds:a}:{},...l?{status:l}:{},...e.length>0?{dataSilos:e}:{}},{unstructuredSubDataPointRecommendations:{totalCount:s}}=await S(u,T,{filterBy:d});i.info(v.magenta("[Step 1/3] Pulling in all subdatapoints")),m.start(s,0);let o=0,y=!1,D,r=0;do try{let{unstructuredSubDataPointRecommendations:{nodes:g}}=await S(u,E`
|
|
45
|
+
query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(
|
|
46
|
+
$filterBy: UnstructuredSubDataPointRecommendationsFilterInput
|
|
47
|
+
$first: Int!
|
|
48
|
+
$offset: Int!
|
|
49
|
+
) {
|
|
50
|
+
unstructuredSubDataPointRecommendations(
|
|
51
|
+
filterBy: $filterBy
|
|
52
|
+
first: $first
|
|
53
|
+
offset: $offset
|
|
54
|
+
useMaster: false
|
|
55
|
+
) {
|
|
56
|
+
nodes {
|
|
57
|
+
id
|
|
58
|
+
dataSiloId
|
|
59
|
+
scannedObjectPathId
|
|
60
|
+
scannedObjectId
|
|
61
|
+
${c?"name":""}
|
|
62
|
+
${c?"contextSnippet":""}
|
|
63
|
+
dataSubCategory {
|
|
64
|
+
name
|
|
65
|
+
category
|
|
66
|
+
}
|
|
67
|
+
status
|
|
68
|
+
confidence
|
|
69
|
+
classificationMethod
|
|
70
|
+
classifierVersion
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`,{first:t,offset:r,filterBy:{...d}});D=g[g.length-1]?.id,p.push(...g),y=g.length===t,o+=g.length,r+=g.length,m.update(o)}catch(g){throw i.error(v.red(`An error fetching subdatapoints for cursor ${D} and offset ${r}`)),g}while(y);m.stop();let I=new Date().getTime()-n,C=V(p,"name");return i.info(v.green(`Successfully pulled in ${C.length} subdatapoints in ${I/1e3} seconds!`)),C}export{H as a,st as b};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{a as o,b as n,c as g,d as a,e as t,f as r,g as s,j as k}from"./chunk-ZSQRC7CE.js";import{a as i}from"./chunk-APA5PR4U.js";import{a as h,b}from"./chunk-NMRI6QFR.js";import{b as m,c as f}from"./chunk-EZCJGIOS.js";import{buildInstallCommand as ur,buildUninstallCommand as cr}from"@stricli/auto-complete";import{buildApplication as pr,buildRouteMap as mr}from"@stricli/core";import{buildRouteMap as ye}from"@stricli/core";import{buildCommand as ke}from"@stricli/core";var y=ke({loader:async()=>{let{generateApiKeys:e}=await import("./impl-PY6QMFDF.js");return e},parameters:{flags:{email:{kind:"parsed",parse:String,brief:"The email address that you use to log into Transcend"},password:{kind:"parsed",parse:String,brief:"The password for your account login"},apiKeyTitle:{kind:"parsed",parse:String,brief:"The title of the API key being generated or destroyed"},file:{kind:"parsed",parse:String,brief:"The file where API keys should be written to"},scopes:{kind:"parsed",parse:String,variadic:",",brief:"The list of scopes that should be given to the API key"},deleteExistingApiKey:{kind:"boolean",brief:"When true, if an API key exists with the specified apiKeyTitle, the existing API key is deleted",default:!0},createNewApiKey:{kind:"boolean",brief:"When true, new API keys will be created. Set to false if you simply want to delete all API keys with a title",default:!0},parentOrganizationId:{kind:"parsed",parse:o,brief:"Filter for only a specific organization by ID, returning all child accounts associated with that organization",optional:!0},transcendUrl:r()}},docs:{brief:"Generate API keys",fullDescription:`This command allows for creating API keys across multiple Transcend instances. This is useful for customers that are managing many Transcend instances and need to regularly create, cycle or delete API keys across all of their instances.
|
|
2
|
+
|
|
3
|
+
Unlike the other commands that rely on API key authentication, this command relies upon username/password authentication. This command will spit out the API keys into a JSON file, and that JSON file can be used in subsequent cli commands.
|
|
4
|
+
|
|
5
|
+
Authentication requires your email and password for the Transcend account. This command will only generate API keys for Transcend instances where you have the permission to "Manage API Keys".`}});var S=ye({routes:{"generate-api-keys":y},docs:{brief:"Admin commands"}});import{buildRouteMap as Le}from"@stricli/core";import{buildCommand as Se}from"@stricli/core";import{ScopeName as we}from"@transcend-io/privacy-types";var w=Se({loader:async()=>{let{buildXdiSyncEndpoint:e}=await import("./impl-JMTECOZS.js");return e},parameters:{flags:{auth:t({scopes:[we.ViewConsentManager]}),xdiLocation:{kind:"parsed",parse:String,brief:"The location of the XDI that will be loaded by the generated sync endpoint"},file:{kind:"parsed",parse:String,brief:"The HTML file path where the sync endpoint should be written",default:"./sync-endpoint.html"},removeIpAddresses:{kind:"boolean",brief:"When true, remove IP addresses from the domain list",default:!0},domainBlockList:{kind:"parsed",parse:g,brief:"The set of domains that should be excluded from the sync endpoint. Comma-separated list.",default:"localhost"},xdiAllowedCommands:{kind:"parsed",parse:String,brief:"The allowed set of XDI commands",default:"ConsentManager:Sync"},transcendUrl:r()}},docs:{brief:"Build XDI sync endpoint",fullDescription:"This command allows for building of the XDI Sync Endpoint across a set of Transcend accounts."}});import{buildCommand as ve}from"@stricli/core";var v=ve({loader:async()=>{let{consentManagerServiceJsonToYml:e}=await import("./impl-AQRJP63X.js");return e},parameters:{flags:{file:{kind:"parsed",parse:String,brief:"Path to the services.json file, output of await airgap.getMetadata()",default:"./services.json"},output:{kind:"parsed",parse:String,brief:"Path to the output transcend.yml to write to",default:"./transcend.yml"}}},docs:{brief:"Convert consent manager service JSON to YML",fullDescription:"Import the services from an airgap.js file into a Transcend instance."}});import{buildCommand as Ce}from"@stricli/core";var C=Ce({loader:async()=>{let{consentManagersToBusinessEntities:e}=await import("./impl-WNH7YI6Z.js");return e},parameters:{flags:{consentManagerYmlFolder:{kind:"parsed",parse:String,brief:"Path to the folder of Consent Manager transcend.yml files to combine"},output:{kind:"parsed",parse:String,brief:"Path to the output transcend.yml with business entity configuration",default:"./combined-business-entities.yml"}}},docs:{brief:"Convert consent managers to business entities",fullDescription:"This command allows for converting a folder or Consent Manager transcend.yml files into a single transcend.yml file where each consent manager configuration is a Business Entity in the data inventory."}});import{buildCommand as Te}from"@stricli/core";import{ScopeName as qe}from"@transcend-io/privacy-types";var T=Te({loader:async()=>{let{pullConsentMetrics:e}=await import("./impl-DPXDEQNI.js");return e},parameters:{flags:{auth:t({scopes:[qe.ViewConsentManager]}),start:{kind:"parsed",parse:a,brief:"The start date to pull metrics from"},end:{kind:"parsed",parse:a,brief:"The end date to pull metrics until",optional:!0},folder:{kind:"parsed",parse:String,brief:"The folder to save metrics to",default:"./consent-metrics/"},bin:{kind:"parsed",parse:String,brief:"The bin metric when pulling data (1h or 1d)",default:"1d"},transcendUrl:r()}},docs:{brief:"Pull consent metrics",fullDescription:"This command allows for pulling consent manager metrics for a Transcend account, or a set of Transcend accounts."}});import{buildCommand as Pe,numberParser as Ae}from"@stricli/core";import{ScopeName as De}from"@transcend-io/privacy-types";var q=Pe({loader:async()=>{let{pullConsentPreferences:e}=await import("./impl-FLM53BCK.js");return e},parameters:{flags:{auth:t({scopes:[De.ViewManagedConsentDatabaseAdminApi]}),partition:{kind:"parsed",parse:String,brief:"The partition key to download consent preferences to"},sombraAuth:s(),file:{kind:"parsed",parse:String,brief:"Path to the CSV file to save preferences to",default:"./preferences.csv"},transcendUrl:r(),timestampBefore:{kind:"parsed",parse:a,brief:"Filter for consents updated this time",optional:!0},timestampAfter:{kind:"parsed",parse:a,brief:"Filter for consents updated after this time",optional:!0},identifiers:{kind:"parsed",parse:String,variadic:",",brief:"Filter for specific identifiers",optional:!0},concurrency:{kind:"parsed",parse:Ae,brief:"The concurrency to use when downloading consents in parallel",default:"100"}}},docs:{brief:"Pull consent preferences",fullDescription:"This command allows for pull of consent preferences from the Managed Consent Database."}});import{buildCommand as Re}from"@stricli/core";import{ConsentBundleType as Ie,ScopeName as Ue}from"@transcend-io/privacy-types";var P=Re({loader:async()=>{let{updateConsentManager:e}=await import("./impl-ZEOQDQGJ.js");return e},parameters:{flags:{auth:t({scopes:[Ue.ManageConsentManagerDeveloperSettings]}),bundleTypes:{kind:"enum",values:Object.values(Ie),brief:"The bundle types to deploy. Defaults to PRODUCTION,TEST.",variadic:","},deploy:{kind:"boolean",brief:"When true, deploy the Consent Manager after updating the version",default:!1},transcendUrl:r()}},docs:{brief:"Update consent manager",fullDescription:"This command allows for updating Consent Manager to latest version. The consent manager bundle can also be deployed using this command."}});import{buildCommand as xe,numberParser as Me}from"@stricli/core";var A=xe({loader:async()=>{let{uploadConsentPreferences:e}=await import("./impl-PC6DNGTZ.js");return e},parameters:{flags:{base64EncryptionKey:{kind:"parsed",parse:String,brief:"The encryption key used to encrypt the userId"},base64SigningKey:{kind:"parsed",parse:String,brief:"The signing key used to prove authentication of consent request"},partition:{kind:"parsed",parse:String,brief:"The partition key to download consent preferences to"},file:{kind:"parsed",parse:String,brief:"The file to pull consent preferences from",default:"./preferences.csv"},consentUrl:{kind:"parsed",parse:n,brief:"URL of the Transcend Consent backend. Use https://consent.us.transcend.io for US hosting",default:"https://consent.transcend.io"},concurrency:{kind:"parsed",parse:Me,brief:"The concurrency to use when uploading requests in parallel",default:"100"}}},docs:{brief:"Upload consent preferences",fullDescription:"This command allows for updating of consent preferences to the Managed Consent Database."}});import{buildCommand as Oe}from"@stricli/core";import{ConsentTrackerStatus as Ve,ScopeName as Fe}from"@transcend-io/privacy-types";var D=Oe({loader:async()=>{let{uploadCookiesFromCsv:e}=await import("./impl-XGATOXTC.js");return e},parameters:{flags:{auth:t({scopes:[Fe.ManageDataFlow]}),trackerStatus:{kind:"enum",values:Object.values(Ve),brief:"The status of the cookies you will upload."},file:{kind:"parsed",parse:String,brief:"Path to the CSV file to upload",default:"./cookies.csv"},transcendUrl:r()}},docs:{brief:"Upload cookies from CSV",fullDescription:"This command allows for uploading cookies from CSV."}});import{buildCommand as Ne}from"@stricli/core";import{ConsentTrackerStatus as je,ScopeName as Ee}from"@transcend-io/privacy-types";var R=Ne({loader:async()=>{let{uploadDataFlowsFromCsv:e}=await import("./impl-QEJPFCJI.js");return e},parameters:{flags:{auth:t({scopes:[Ee.ManageDataFlow]}),trackerStatus:{kind:"enum",values:Object.values(je),brief:"The status of the data flows you will upload."},file:{kind:"parsed",parse:String,brief:"Path to the CSV file to upload",default:"./data-flows.csv"},classifyService:{kind:"boolean",brief:"When true, automatically assign the service for a data flow based on the domain that is specified",default:!1},transcendUrl:r()}},docs:{brief:"Upload data flows from CSV",fullDescription:"This command allows for uploading of data flows from CSV."}});import{buildCommand as Be,numberParser as We}from"@stricli/core";import{ScopeName as d}from"@transcend-io/privacy-types";var I=Be({loader:async()=>{let{uploadPreferences:e}=await import("./impl-4PM5ANUA.js");return e},parameters:{flags:{auth:t({scopes:[d.ManageStoredPreferences,d.ViewManagedConsentDatabaseAdminApi,d.ViewPreferenceStoreSettings]}),partition:{kind:"parsed",parse:String,brief:"The partition key to download consent preferences to"},sombraAuth:s(),consentUrl:{kind:"parsed",parse:n,brief:"URL of the Transcend backend. Use https://consent.us.transcend.io for US hosting",default:"https://consent.transcend.io"},file:{kind:"parsed",parse:String,brief:"Path to the CSV file to load preferences from",optional:!0},directory:{kind:"parsed",parse:String,brief:"Path to the directory of CSV files to load preferences from",optional:!0},dryRun:{kind:"boolean",brief:"Whether to do a dry run only - will write results to receiptFilepath without updating Transcend",default:!1},skipExistingRecordCheck:{kind:"boolean",brief:"Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD",default:!1},receiptFileDir:{kind:"parsed",parse:String,brief:"Directory path where the response receipts should be saved",default:"./receipts"},skipWorkflowTriggers:{kind:"boolean",brief:"Whether to skip workflow triggers when uploading to preference store",default:!1},forceTriggerWorkflows:{kind:"boolean",brief:"Whether to force trigger workflows for existing consent records",default:!1},skipConflictUpdates:{kind:"boolean",brief:"Whether to skip uploading of any records where the preference store and file have a hard conflict",default:!1},isSilent:{kind:"boolean",brief:"Whether to skip sending emails in workflows",default:!0},attributes:{kind:"parsed",parse:String,brief:"Attributes to add to any DSR request if created. Comma-separated list of key:value pairs.",default:"Tags:transcend-cli,Source:transcend-cli"},receiptFilepath:{kind:"parsed",parse:String,brief:"Store resulting, continuing where left off",default:"./preference-management-upload-receipts.json"},concurrency:{kind:"parsed",parse:We,brief:"The concurrency to use when uploading in parallel",default:"10"}}},docs:{brief:"Upload preferences",fullDescription:"This command allows for updating of preference management data to your Transcend Preference Store."}});var U=Le({routes:{"build-xdi-sync-endpoint":w,"pull-consent-metrics":T,"pull-consent-preferences":q,"update-consent-manager":P,"upload-consent-preferences":A,"upload-cookies-from-csv":D,"upload-data-flows-from-csv":R,"upload-preferences":I,"consent-manager-service-json-to-yml":v,"consent-managers-to-business-entities":C},docs:{brief:"Consent commands"}});import{buildRouteMap as at}from"@stricli/core";import{buildCommand as Ye}from"@stricli/core";var x=Ye({loader:async()=>{let{deriveDataSilosFromDataFlowsCrossInstance:e}=await import("./impl-7MUJH6P5.js");return e},parameters:{flags:{auth:t({scopes:[]}),dataFlowsYmlFolder:{kind:"parsed",parse:String,brief:"The folder that contains data flow yml files"},output:{kind:"parsed",parse:String,brief:"The output transcend.yml file containing the data silo configurations",default:"./transcend.yml"},ignoreYmls:{kind:"parsed",parse:String,variadic:",",brief:"The set of yml files that should be skipped when uploading",optional:!0},transcendUrl:r()}},docs:{brief:"Derive data silos from data flows cross instance",fullDescription:"Given a folder of data flow transcend.yml configurations, convert those configurations to a single transcend.yml configurations of all related data silos."}});import{buildCommand as Ge}from"@stricli/core";var M=Ge({loader:async()=>{let{deriveDataSilosFromDataFlows:e}=await import("./impl-WW7Y6LSR.js");return e},parameters:{flags:{auth:t({scopes:[]}),dataFlowsYmlFolder:{kind:"parsed",parse:String,brief:"The folder that contains data flow yml files"},dataSilosYmlFolder:{kind:"parsed",parse:String,brief:"The folder that contains data silo yml files"},ignoreYmls:{kind:"parsed",parse:String,variadic:",",brief:"The set of yml files that should be skipped when uploading",optional:!0},transcendUrl:r()}},docs:{brief:"Derive data silos from data flows",fullDescription:"Given a folder of data flow transcend.yml configurations, convert those configurations to set of data silo transcend.yml configurations."}});import{buildCommand as Ke}from"@stricli/core";import{ScopeName as Je}from"@transcend-io/privacy-types";var O=Ke({loader:async()=>{let{discoverSilos:e}=await import("./impl-YDRXS46V.js");return e},parameters:{flags:{scanPath:{kind:"parsed",parse:String,brief:"File path in the project to scan"},dataSiloId:{kind:"parsed",parse:o,brief:"The UUID of the corresponding data silo"},auth:t({scopes:[Je.ManageAssignedDataInventory],requiresSiloScope:!0}),fileGlobs:{kind:"parsed",parse:String,brief:"You can pass a glob syntax pattern(s) to specify additional file paths to scan. Comma-separated list of globs.",default:""},ignoreDirs:{kind:"parsed",parse:String,brief:"Comma-separated list of directories to ignore.",default:""},transcendUrl:r()}},docs:{brief:"Discover silos",fullDescription:"Transcend can help scan dependency management files to help detect new data silos where you may be storing user personal data."}});import{buildCommand as _e}from"@stricli/core";import{DataCategoryType as ze,ScopeName as $e}from"@transcend-io/privacy-types";var V=_e({loader:async()=>{let{pullDatapoints:e}=await import("./impl-A2USYIKE.js");return e},parameters:{flags:{auth:t({scopes:[$e.ViewDataInventory]}),file:{kind:"parsed",parse:String,brief:"The file to save datapoints to",default:"./datapoints.csv"},transcendUrl:r(),dataSiloIds:{kind:"parsed",parse:String,variadic:",",brief:"List of data silo IDs to filter by",optional:!0},includeAttributes:{kind:"boolean",brief:"Whether to include attributes in the output",default:!1},includeGuessedCategories:{kind:"boolean",brief:"Whether to include guessed categories in the output",default:!1},parentCategories:{kind:"enum",values:Object.values(ze),brief:"List of parent categories to filter by",variadic:",",optional:!0},subCategories:{kind:"parsed",parse:String,brief:"List of subcategories to filter by",variadic:",",optional:!0}}},docs:{brief:"Pull datapoints",fullDescription:"This command allows for pulling your Data Inventory -> Datapoints into a CSV."}});import{buildCommand as Xe}from"@stricli/core";import{ScopeName as He,UnstructuredSubDataPointRecommendationStatus as Qe}from"@transcend-io/privacy-types";var F=Xe({loader:async()=>{let{pullUnstructuredDiscoveryFiles:e}=await import("./impl-2FMVZQC3.js");return e},parameters:{flags:{auth:t({scopes:[He.ViewDataInventory]}),file:{kind:"parsed",parse:String,brief:"The file to save datapoints to",default:"./unstructured-discovery-files.csv"},transcendUrl:r(),dataSiloIds:{kind:"parsed",parse:String,brief:"List of data silo IDs to filter by",variadic:",",optional:!0},subCategories:{kind:"parsed",parse:String,brief:"List of data categories to filter by",variadic:",",optional:!0},status:{kind:"enum",values:Object.values(Qe),brief:"List of classification statuses to filter by",variadic:",",optional:!0},includeEncryptedSnippets:{kind:"boolean",brief:"Whether to include encrypted snippets of the entries classified",default:!1}}},docs:{brief:"Pull unstructured discovery files",fullDescription:"This command allows for pulling Unstructured Discovery into a CSV."}});import{buildCommand as Ze,numberParser as et}from"@stricli/core";var N=Ze({loader:async()=>{let{push:e}=await import("./impl-MYQ2JZZW.js");return e},parameters:{flags:{auth:t({scopes:"Varies"}),file:{kind:"parsed",parse:String,brief:"Path to the YAML file to push from",default:"./transcend.yml"},transcendUrl:r(),pageSize:{kind:"parsed",parse:et,brief:"The page size to use when paginating over the API",default:"50"},variables:{kind:"parsed",parse:String,brief:"The variables to template into the YAML file when pushing configuration. Comma-separated list of key:value pairs.",default:""},publishToPrivacyCenter:{kind:"boolean",brief:"When true, publish the configuration to the Privacy Center",default:!1},classifyService:{kind:"boolean",brief:"When true, automatically assign the service for a data flow based on the domain that is specified",default:!1},deleteExtraAttributeValues:{kind:"boolean",brief:"When true and syncing attributes, delete any extra attributes instead of just upserting",default:!1}}},docs:{brief:"Push configuration to Transcend",fullDescription:"Given a transcend.yml file, sync the contents up to your connected services view."}});import{buildCommand as tt}from"@stricli/core";import{ScopeName as rt}from"@transcend-io/privacy-types";var j=tt({loader:async()=>{let{scanPackages:e}=await import("./impl-D5B5PHQ3.js");return e},parameters:{flags:{auth:t({scopes:[rt.ManageCodeScanning]}),scanPath:{kind:"parsed",parse:String,brief:"File path in the project to scan",default:"./"},ignoreDirs:{kind:"parsed",parse:String,variadic:",",brief:"List of directories to ignore in scan",optional:!0},repositoryName:{kind:"parsed",parse:String,brief:"Name of the git repository that the package should be tied to",optional:!0},transcendUrl:r()}},docs:{brief:"Scan packages",fullDescription:"Transcend can scan your codebase to inventory your code packages and dependencies."}});var E=at({routes:{pull:k,push:N,"scan-packages":j,"discover-silos":O,"pull-datapoints":V,"pull-unstructured-discovery-files":F,"derive-data-silos-from-data-flows":M,"derive-data-silos-from-data-flows-cross-instance":x},docs:{brief:"Inventory commands"}});import{buildRouteMap as it}from"@stricli/core";import{buildCommand as st}from"@stricli/core";import{ScopeName as ot}from"@transcend-io/privacy-types";var B=st({loader:async()=>{let{syncOt:e}=await import("./impl-GBFIC5HA.js");return e},parameters:{flags:{hostname:{kind:"parsed",parse:String,brief:"The domain of the OneTrust environment from which to pull the resource",optional:!0},oneTrustAuth:{kind:"parsed",parse:String,brief:"The OAuth access token with the scopes necessary to access the OneTrust Public APIs",optional:!0},source:{kind:"enum",values:Object.values(f),brief:"Whether to read the assessments from OneTrust or from a file",default:"oneTrust"},transcendAuth:{...t({scopes:[ot.ManageAssessments]}),optional:!0},transcendUrl:r(),file:{kind:"parsed",parse:String,brief:"Path to the file to pull the resource into. Must be a json file!",optional:!0},resource:{kind:"enum",values:Object.values(m),brief:"The resource to pull from OneTrust. For now, only assessments is supported",default:"assessments"},dryRun:{kind:"boolean",brief:"Whether to export the resource to a file rather than sync to Transcend",default:!1},debug:{kind:"boolean",brief:"Whether to print detailed logs in case of error",default:!1}}},docs:{brief:"Sync OneTrust data",fullDescription:`Pulls resources from a OneTrust and syncs them to a Transcend instance. For now, it only supports retrieving OneTrust Assessments.
|
|
6
|
+
|
|
7
|
+
This command can be helpful if you are looking to:
|
|
8
|
+
- Pull resources from your OneTrust account.
|
|
9
|
+
- Migrate your resources from your OneTrust account to Transcend.
|
|
10
|
+
|
|
11
|
+
OneTrust authentication requires an OAuth Token with scope for accessing the assessment endpoints.
|
|
12
|
+
If syncing the resources to Transcend, you will also need to generate an API key on the Transcend Admin Dashboard.`}});var W=it({routes:{"sync-ot":B},docs:{brief:"Migration commands"}});import{buildRouteMap as lr}from"@stricli/core";import{buildCommand as nt,numberParser as dt}from"@stricli/core";import{RequestAction as lt,RequestOrigin as ut,ScopeName as l}from"@transcend-io/privacy-types";var L=nt({loader:async()=>{let{approve:e}=await import("./impl-34GPMXPL.js");return e},parameters:{flags:{auth:t({scopes:[l.RequestApproval,l.ViewRequests,l.ManageRequestCompilation]}),actions:{kind:"enum",values:Object.values(lt),variadic:",",brief:"The request actions to approve"},origins:{kind:"enum",values:Object.values(ut),variadic:",",brief:"The request origins to approve",optional:!0},silentModeBefore:{kind:"parsed",parse:a,brief:"Any requests made before this date should be marked as silent mode",optional:!0},createdAtBefore:{kind:"parsed",parse:a,brief:"Approve requests that were submitted before this time",optional:!0},createdAtAfter:{kind:"parsed",parse:a,brief:"Approve requests that were submitted after this time",optional:!0},transcendUrl:r(),concurrency:{kind:"parsed",parse:dt,brief:"The concurrency to use when uploading requests in parallel",default:"50"}}},docs:{brief:"Bulk approve a set of privacy requests",fullDescription:"Bulk approve a set of privacy requests from the DSR Automation -> Incoming Requests tab."}});import{buildCommand as ct,numberParser as pt}from"@stricli/core";import{RequestAction as mt,RequestStatus as ft,ScopeName as Y}from"@transcend-io/privacy-types";var G=ct({loader:async()=>{let{cancel:e}=await import("./impl-U5UP4IPY.js");return e},parameters:{flags:{auth:t({scopes:[Y.ViewRequests,Y.RequestApproval]}),actions:{kind:"enum",values:Object.values(mt),variadic:",",brief:"The request actions to cancel"},statuses:{kind:"enum",values:Object.values(ft),variadic:",",brief:"The request statuses to cancel. Comma-separated list.",optional:!0},requestIds:{kind:"parsed",parse:String,variadic:",",brief:"Specify the specific request IDs to cancel",optional:!0},silentModeBefore:{kind:"parsed",parse:a,brief:"Any requests made before this date should be marked as silent mode for canceling to skip email sending",optional:!0},createdAtBefore:{kind:"parsed",parse:a,brief:"Cancel requests that were submitted before this time",optional:!0},createdAtAfter:{kind:"parsed",parse:a,brief:"Cancel requests that were submitted after this time",optional:!0},cancellationTitle:{kind:"parsed",parse:String,brief:"The title of the email template that should be sent to the requests upon cancelation",default:"Request Canceled"},transcendUrl:r(),concurrency:{kind:"parsed",parse:pt,brief:"The concurrency to use when uploading requests in parallel",default:"50"}}},docs:{brief:"Bulk cancel a set of privacy requests",fullDescription:"Bulk cancel a set of privacy requests from the DSR Automation -> Incoming Requests tab."}});import{buildRouteMap as kt}from"@stricli/core";import{buildCommand as ht}from"@stricli/core";var K=ht({loader:async()=>{let{markIdentifiersCompleted:e}=await import("./impl-V6VQDET2.js");return e},parameters:{flags:{auth:t({scopes:[],requiresSiloScope:!0}),dataSiloId:{kind:"parsed",parse:o,brief:"The ID of the data silo to pull in"},file:{kind:"parsed",parse:String,brief:"Path to the CSV file where identifiers will be written to",default:"./cron-identifiers.csv"},transcendUrl:r(),sombraAuth:s()}},docs:{brief:"Mark identifiers as completed after processing.",fullDescription:`This command takes the output of tr-cron-pull-identifiers and notifies Transcend that all of the requests in the CSV have been processed.
|
|
13
|
+
This is used in the workflow like:
|
|
14
|
+
|
|
15
|
+
1. Pull identifiers to CSV:
|
|
16
|
+
${i} request cron pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --actions=ERASURE --file=./outstanding-requests.csv
|
|
17
|
+
2. Run your process to operate on that CSV of requests.
|
|
18
|
+
3. Notify Transcend of completion
|
|
19
|
+
${i} request cron mark-identifiers-completed --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --file=./outstanding-requests.csv
|
|
20
|
+
|
|
21
|
+
Read more at https://docs.transcend.io/docs/integrations/cron-job-integration.`}});import{buildCommand as bt,numberParser as J}from"@stricli/core";import{RequestAction as gt}from"@transcend-io/privacy-types";var _=bt({loader:async()=>{let{pullIdentifiers:e}=await import("./impl-OUM2TMCA.js");return e},parameters:{flags:{auth:t({scopes:[],requiresSiloScope:!0}),dataSiloId:{kind:"parsed",parse:o,brief:"The ID of the data silo to pull in"},actions:{kind:"enum",values:Object.values(gt),variadic:",",brief:"The request actions to restart"},file:{kind:"parsed",parse:String,brief:"Path to the CSV file where identifiers will be written to",default:"./cron-identifiers.csv"},transcendUrl:r(),sombraAuth:s(),pageLimit:{kind:"parsed",parse:J,brief:"The page limit to use when pulling in pages of identifiers",default:"100"},skipRequestCount:{kind:"boolean",brief:"Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers",default:!1},chunkSize:{kind:"parsed",parse:J,brief:"Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows",default:"100000"}}},docs:{brief:"Pull identifiers of outstanding requests for a data silo to a CSV.",fullDescription:`If you are using the cron job integration, you can run this command to pull the outstanding identifiers for the data silo to a CSV.
|
|
22
|
+
|
|
23
|
+
For large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits. Use the --chunkSize parameter to control the maximum number of rows per file.
|
|
24
|
+
|
|
25
|
+
Read more at https://docs.transcend.io/docs/integrations/cron-job-integration.`}});var z=kt({routes:{"pull-identifiers":_,"mark-identifiers-completed":K},docs:{brief:"Cron commands"}});import{buildCommand as yt,numberParser as St}from"@stricli/core";import{RequestStatus as wt,ScopeName as u}from"@transcend-io/privacy-types";var $=yt({loader:async()=>{let{downloadFiles:e}=await import("./impl-52WERFAD.js");return e},parameters:{flags:{auth:t({scopes:[u.ViewRequestCompilation,u.ViewRequests,u.RequestApproval]}),sombraAuth:s(),concurrency:{kind:"parsed",parse:St,brief:"The concurrency to use when downloading requests in parallel",default:"10"},requestIds:{kind:"parsed",parse:String,variadic:",",brief:"Specify the specific request IDs to download",optional:!0},statuses:{kind:"enum",values:Object.values(wt),variadic:",",brief:"The request statuses to download. Comma-separated list. Defaults to APPROVING,DOWNLOADABLE.",optional:!0},folderPath:{kind:"parsed",parse:String,brief:"The folder to download files to",default:"./dsr-files"},createdAtBefore:{kind:"parsed",parse:a,brief:"Download requests that were submitted before this time",optional:!0},createdAtAfter:{kind:"parsed",parse:a,brief:"Download requests that were submitted after this time",optional:!0},approveAfterDownload:{kind:"boolean",brief:"If the request is in status=APPROVING, approve the request after its downloaded",default:!1},transcendUrl:r()}},docs:{brief:"Download the files associated with a Data Subject Access Request (DSAR)",fullDescription:"Download the files associated with a Data Subject Access Request (DSAR) from DSR Automation -> Incoming Requests tab."}});import{buildCommand as vt,numberParser as Ct}from"@stricli/core";import{RequestAction as Tt,RequestEnricherStatus as qt,ScopeName as Pt}from"@transcend-io/privacy-types";var X=vt({loader:async()=>{let{enricherRestart:e}=await import("./impl-EB7RIOVE.js");return e},parameters:{flags:{auth:t({scopes:[Pt.ManageRequestCompilation]}),enricherId:{kind:"parsed",parse:String,brief:"The ID of the enricher to restart"},actions:{kind:"enum",values:Object.values(Tt),variadic:",",brief:"The request action to restart",optional:!0},requestEnricherStatuses:{kind:"enum",values:Object.values(qt),variadic:",",brief:"The request enricher statuses to restart",optional:!0},transcendUrl:r(),concurrency:{kind:"parsed",parse:Ct,brief:"The concurrency to use when uploading requests in parallel",default:"15"},requestIds:{kind:"parsed",parse:String,variadic:",",brief:"Specify the specific request IDs to restart",optional:!0},createdAtBefore:{kind:"parsed",parse:a,brief:"Restart requests that were submitted before this time",optional:!0},createdAtAfter:{kind:"parsed",parse:a,brief:"Restart requests that were submitted after this time",optional:!0}}},docs:{brief:"Bulk restart a particular enricher across a series of DSRs",fullDescription:`Bulk restart a particular enricher across a series of DSRs.
|
|
26
|
+
|
|
27
|
+
The API key needs the following scopes:
|
|
28
|
+
- Manage Request Compilation`}});import{buildCommand as At,numberParser as H}from"@stricli/core";import{RequestAction as Dt,RequestStatus as Rt,ScopeName as Q}from"@transcend-io/privacy-types";var Z=At({loader:async()=>{let{_export:e}=await import("./impl-VJE75UCF.js");return e},parameters:{flags:{auth:t({scopes:[Q.ViewRequests,Q.ViewRequestCompilation]}),sombraAuth:s(),actions:{kind:"enum",values:Object.values(Dt),variadic:",",brief:"The request actions to export",optional:!0},statuses:{kind:"enum",values:Object.values(Rt),variadic:",",brief:"The request statuses to export",optional:!0},transcendUrl:r(),file:{kind:"parsed",parse:String,brief:"Path to the CSV file where identifiers will be written to",default:"./transcend-request-export.csv"},concurrency:{kind:"parsed",parse:H,brief:"The concurrency to use when uploading requests in parallel",default:"100"},createdAtBefore:{kind:"parsed",parse:a,brief:"Pull requests that were submitted before this time",optional:!0},createdAtAfter:{kind:"parsed",parse:a,brief:"Pull requests that were submitted after this time",optional:!0},showTests:{kind:"boolean",brief:"Filter for test requests or production requests - when not provided, pulls both",optional:!0},pageLimit:{kind:"parsed",parse:H,brief:"The page limit to use when pulling in pages of requests",default:"100"}}},docs:{brief:"Export privacy requests and request identifiers to a CSV file",fullDescription:"Export privacy requests and request identifiers to a CSV file."}});import{buildCommand as It,numberParser as Ut}from"@stricli/core";import{RequestAction as xt,RequestStatus as Mt,ScopeName as Ot}from"@transcend-io/privacy-types";var ee=It({loader:async()=>{let{markSilent:e}=await import("./impl-W3HV7NRK.js");return e},parameters:{flags:{auth:t({scopes:[Ot.ManageRequestCompilation]}),actions:{kind:"enum",values:Object.values(xt),variadic:",",brief:"The request actions to mark silent"},statuses:{kind:"enum",values:Object.values(Mt),variadic:",",brief:"The request statuses to mark silent. Comma-separated list. Defaults to REQUEST_MADE,WAITING,ENRICHING,COMPILING,DELAYED,APPROVING,SECONDARY,SECONDARY_APPROVING.",optional:!0},requestIds:{kind:"parsed",parse:String,variadic:",",brief:"Specify the specific request IDs to mark silent",optional:!0},createdAtBefore:{kind:"parsed",parse:a,brief:"Mark silent requests that were submitted before this time",optional:!0},createdAtAfter:{kind:"parsed",parse:a,brief:"Mark silent requests that were submitted after this time",optional:!0},transcendUrl:r(),concurrency:{kind:"parsed",parse:Ut,brief:"The concurrency to use when uploading requests in parallel",default:"50"}}},docs:{brief:"Bulk update a set of privacy requests to be in silent mode",fullDescription:"Bulk update a set of privacy requests from the DSR Automation -> Incoming Requests tab to be in silent mode."}});import{buildCommand as Vt,numberParser as c}from"@stricli/core";import{RequestAction as Ft,ScopeName as te}from"@transcend-io/privacy-types";var re=Vt({loader:async()=>{let{notifyAdditionalTime:e}=await import("./impl-E47RFIQN.js");return e},parameters:{flags:{auth:t({scopes:[te.ViewRequests,te.RequestApproval]}),createdAtBefore:{kind:"parsed",parse:a,brief:"Notify requests that are open but submitted before this time"},createdAtAfter:{kind:"parsed",parse:a,brief:"Notify requests that are open but submitted after this time",optional:!0},actions:{kind:"enum",values:Object.values(Ft),variadic:",",brief:"The request actions to notify",optional:!0},daysLeft:{kind:"parsed",parse:c,brief:"Only notify requests that have less than this number of days until they are considered expired",default:"10"},days:{kind:"parsed",parse:c,brief:"The number of days to adjust the expiration of the request to",default:"45"},requestIds:{kind:"parsed",parse:String,variadic:",",brief:"Specify the specific request IDs to notify",optional:!0},emailTemplate:{kind:"parsed",parse:String,brief:"The title of the email template that should be sent to the requests",default:"Additional Time Needed"},transcendUrl:r(),concurrency:{kind:"parsed",parse:c,brief:"The concurrency to use when uploading requests in parallel",default:"50"}}},docs:{brief:"Bulk notify a set of privacy requests that more time is needed",fullDescription:"Bulk notify a set of privacy requests from the DSR Automation -> Incoming Requests tab that more time is needed to complete the request. Note any request in silent mode will not be emailed."}});import{buildRouteMap as Lt}from"@stricli/core";import{buildCommand as Nt,numberParser as jt}from"@stricli/core";import{RequestAction as Et,ScopeName as ae}from"@transcend-io/privacy-types";var se=Nt({loader:async()=>{let{pullIdentifiers:e}=await import("./impl-D7BMJMXZ.js");return e},parameters:{flags:{auth:t({scopes:[ae.ViewRequests,ae.ViewRequestCompilation]}),sombraAuth:s(),transcendUrl:r(),file:{kind:"parsed",parse:String,brief:"Path to the CSV file where requests will be written to",default:"./manual-enrichment-identifiers.csv"},actions:{kind:"enum",values:Object.values(Et),variadic:",",brief:"The request actions to pull for",optional:!0},concurrency:{kind:"parsed",parse:jt,brief:"The concurrency to use when uploading requests in parallel",default:"100"}}},docs:{brief:"Pull identifiers for manual enrichment",fullDescription:`This command pulls down the set of privacy requests that are currently pending manual enrichment.
|
|
29
|
+
|
|
30
|
+
This is useful for the following workflow:
|
|
31
|
+
|
|
32
|
+
1. Pull identifiers to CSV:
|
|
33
|
+
${i} request preflight pull-identifiers --file=./enrichment-requests.csv
|
|
34
|
+
2. Fill out the CSV with additional identifiers
|
|
35
|
+
3. Push updated back to Transcend
|
|
36
|
+
${i} request preflight push-identifiers --file=./enrichment-requests.csv`}});import{buildCommand as Bt,numberParser as Wt}from"@stricli/core";import{ScopeName as oe}from"@transcend-io/privacy-types";var ie=Bt({loader:async()=>{let{pushIdentifiers:e}=await import("./impl-OFNYLVXQ.js");return e},parameters:{flags:{auth:t({scopes:[oe.ManageRequestIdentities,oe.ManageRequestCompilation]}),enricherId:{kind:"parsed",parse:o,brief:"The ID of the Request Enricher to upload to"},sombraAuth:s(),transcendUrl:r(),file:{kind:"parsed",parse:String,brief:"Path to the CSV file where requests will be written to",default:"./manual-enrichment-identifiers.csv"},markSilent:{kind:"boolean",brief:"When true, set requests into silent mode before enriching",default:!1},concurrency:{kind:"parsed",parse:Wt,brief:"The concurrency to use when uploading requests in parallel",default:"100"}}},docs:{brief:"Push identifiers for manual enrichment",fullDescription:`This command push up a set of identifiers for a set of requests pending manual enrichment.
|
|
37
|
+
|
|
38
|
+
This is useful for the following workflow:
|
|
39
|
+
|
|
40
|
+
1. Pull identifiers to CSV:
|
|
41
|
+
${i} request preflight pull-identifiers --file=./enrichment-requests.csv
|
|
42
|
+
2. Fill out the CSV with additional identifiers
|
|
43
|
+
3. Push updated back to Transcend
|
|
44
|
+
${i} request preflight push-identifiers --file=./enrichment-requests.csv`}});var ne=Lt({routes:{"pull-identifiers":se,"push-identifiers":ie},docs:{brief:"Preflight commands"}});import{buildCommand as Yt}from"@stricli/core";import{RequestAction as Gt,ScopeName as Kt}from"@transcend-io/privacy-types";var de=Yt({loader:async()=>{let{rejectUnverifiedIdentifiers:e}=await import("./impl-GCOOAYPD.js");return e},parameters:{flags:{auth:t({scopes:[Kt.ManageRequestCompilation]}),identifierNames:{kind:"parsed",parse:String,variadic:",",brief:"The names of identifiers to clear out"},actions:{kind:"enum",values:Object.values(Gt),variadic:",",brief:"The request action to restart",optional:!0},transcendUrl:r()}},docs:{brief:"Bulk clear out any request identifiers that are unverified",fullDescription:"Bulk clear out any request identifiers that are unverified."}});import{buildCommand as Jt,numberParser as _t}from"@stricli/core";import{RequestAction as zt,RequestStatus as $t,ScopeName as le}from"@transcend-io/privacy-types";var ue=Jt({loader:async()=>{let{restart:e}=await import("./impl-6YBT2TVS.js");return e},parameters:{flags:{auth:t({scopes:[le.MakeDataSubjectRequest,le.ViewRequestCompilation]}),actions:{kind:"enum",values:Object.values(zt),variadic:",",brief:"The request actions to restart"},statuses:{kind:"enum",values:Object.values($t),variadic:",",brief:"The request statuses to restart"},transcendUrl:r(),requestReceiptFolder:{kind:"parsed",parse:String,brief:"The path to the folder where receipts of each upload are stored",default:"./privacy-request-upload-receipts"},sombraAuth:s(),concurrency:{kind:"parsed",parse:_t,brief:"The concurrency to use when uploading requests in parallel",default:"15"},requestIds:{kind:"parsed",parse:String,variadic:",",brief:"Specify the specific request IDs to restart",optional:!0},emailIsVerified:{kind:"boolean",brief:"Indicate whether the primary email address is verified. Set to false to send a verification email",default:!0},createdAt:{kind:"parsed",parse:a,brief:"Restart requests that were submitted before a specific date",optional:!0},silentModeBefore:{kind:"parsed",parse:a,brief:"Requests older than this date should be marked as silent mode",optional:!0},createdAtBefore:{kind:"parsed",parse:a,brief:"Restart requests that were submitted before this time",optional:!0},createdAtAfter:{kind:"parsed",parse:a,brief:"Restart requests that were submitted after this time",optional:!0},sendEmailReceipt:{kind:"boolean",brief:"Send email receipts to the restarted requests",default:!1},copyIdentifiers:{kind:"boolean",brief:"Copy over all enriched identifiers from the initial request",default:!1},skipWaitingPeriod:{kind:"boolean",brief:"Skip queued state of request and go straight to compiling",default:!1}}},docs:{brief:"Bulk update a set of privacy requests based on a set of request filters",fullDescription:"Bulk update a set of privacy requests based on a set of request filters."}});import{buildCommand as Xt}from"@stricli/core";import{ScopeName as Ht}from"@transcend-io/privacy-types";var ce=Xt({loader:async()=>{let{skipPreflightJobs:e}=await import("./impl-SJQV2OMC.js");return e},parameters:{flags:{auth:t({scopes:[Ht.ManageRequestCompilation]}),enricherIds:{kind:"parsed",parse:String,variadic:",",brief:"The ID of the enrichers to skip privacy request jobs for"},transcendUrl:r()}},docs:{brief:"Skip preflight jobs",fullDescription:"This command allows for bulk skipping preflight checks."}});import{buildRouteMap as ir}from"@stricli/core";import{buildCommand as Qt}from"@stricli/core";import{ScopeName as Zt}from"@transcend-io/privacy-types";var pe=Qt({loader:async()=>{let{markRequestDataSilosCompleted:e}=await import("./impl-NZAJVL4T.js");return e},parameters:{flags:{auth:t({scopes:[Zt.ManageRequestCompilation]}),dataSiloId:{kind:"parsed",parse:o,brief:"The ID of the data silo to pull in"},file:{kind:"parsed",parse:String,brief:"Path to the CSV file where identifiers will be written to",default:"./request-identifiers.csv"},transcendUrl:r()}},docs:{brief:"Mark request data silos as completed",fullDescription:`This command takes in a CSV of Request IDs as well as a Data Silo ID and marks all associated privacy request jobs as completed.
|
|
45
|
+
This command is useful with the "Bulk Response" UI. The CSV is expected to have 1 column named "Request Id".`}});import{buildCommand as er}from"@stricli/core";import{RequestAction as tr,ScopeName as rr}from"@transcend-io/privacy-types";var me=er({loader:async()=>{let{retryRequestDataSilos:e}=await import("./impl-LDFZSLYD.js");return e},parameters:{flags:{auth:t({scopes:[rr.ManageRequestCompilation]}),dataSiloId:{kind:"parsed",parse:o,brief:"The ID of the data silo to pull in"},actions:{kind:"enum",values:Object.values(tr),variadic:",",brief:"The request actions to restart"},transcendUrl:r()}},docs:{brief:"Retry request data silos",fullDescription:'This command allows for bulk restarting a set of data silos jobs for open privacy requests. This is equivalent to clicking the "Wipe and Retry" button for a particular data silo across a set of privacy requests.'}});import{buildCommand as ar}from"@stricli/core";import{RequestStatus as sr,ScopeName as or}from"@transcend-io/privacy-types";var fe=ar({loader:async()=>{let{skipRequestDataSilos:e}=await import("./impl-ZW2R7XBD.js");return e},parameters:{flags:{auth:t({scopes:[or.ManageRequestCompilation]}),dataSiloId:{kind:"parsed",parse:o,brief:"The ID of the data silo to skip privacy request jobs for"},transcendUrl:r(),statuses:{kind:"enum",values:Object.values(sr),variadic:",",brief:"The request statuses to skip"},status:{kind:"enum",values:["SKIPPED","RESOLVED"],brief:"The status to set the request data silo job to",default:"SKIPPED"}}},docs:{brief:"Skip request data silos",fullDescription:"This command allows for bulk skipping all open privacy request jobs for a particular data silo. This command is useful if you want to disable a data silo and then clear out any active privacy requests that are still queued up for that data silo."}});var he=ir({routes:{"mark-request-data-silos-completed":pe,"retry-request-data-silos":me,"skip-request-data-silos":fe},docs:{brief:"System commands"}});import{buildCommand as nr,numberParser as dr}from"@stricli/core";import{ScopeName as p}from"@transcend-io/privacy-types";var be=nr({loader:async()=>{let{upload:e}=await import("./impl-ZNK4HGCU.js");return e},parameters:{flags:{auth:t({scopes:[p.MakeDataSubjectRequest,p.ViewRequestIdentitySettings,p.ViewGlobalAttributes]}),file:{kind:"parsed",parse:String,brief:"Path to the CSV file of requests to upload",default:"./requests.csv"},transcendUrl:r(),cacheFilepath:{kind:"parsed",parse:String,brief:"The path to the JSON file encoding the metadata used to map the CSV shape to Transcend API",default:"./transcend-privacy-requests-cache.json"},requestReceiptFolder:{kind:"parsed",parse:String,brief:"The path to the folder where receipts of each upload are stored",default:"./privacy-request-upload-receipts"},sombraAuth:s(),concurrency:{kind:"parsed",parse:dr,brief:"The concurrency to use when uploading requests in parallel",default:"50"},attributes:{kind:"parsed",parse:String,brief:"Tag all of the requests with the following attributes. Format: key1:value1;value2,key2:value3;value4",default:"Tags:transcend-cli"},isTest:{kind:"boolean",brief:"Flag whether the requests being uploaded are test requests or regular requests",default:!1},isSilent:{kind:"boolean",brief:"Flag whether the requests being uploaded should be submitted in silent mode",default:!0},skipSendingReceipt:{kind:"boolean",brief:"Flag whether to skip sending of the receipt email",default:!1},emailIsVerified:{kind:"boolean",brief:"Indicate whether the email address being uploaded is pre-verified. Set to false to send a verification email",default:!0},skipFilterStep:{kind:"boolean",brief:"When true, skip the interactive step to filter down the CSV",default:!1},dryRun:{kind:"boolean",brief:"When true, perform a dry run of the upload instead of calling the API to submit the requests",default:!1},debug:{kind:"boolean",brief:"Debug logging",default:!1},defaultPhoneCountryCode:{kind:"parsed",parse:String,brief:"When uploading phone numbers, if the phone number is missing a country code, assume this country code",default:"1"}}},docs:{brief:"Upload a set of requests from a CSV",fullDescription:`If you need to upload a set of requests from a CSV, you can run this command.
|
|
46
|
+
This command uses inquirer to prompt the user to map the shape of the CSV to the shape of the Transcend API. There is no requirement for the shape of the incoming CSV, as the script will handle the mapping process.
|
|
47
|
+
|
|
48
|
+
The script will also produce a JSON cache file, that allows for the mappings to be preserved between runs.`}});var ge=lr({routes:{approve:L,upload:be,"download-files":$,cancel:G,restart:ue,"notify-additional-time":re,"mark-silent":ee,"enricher-restart":X,"reject-unverified-identifiers":de,export:Z,"skip-preflight-jobs":ce,system:he,preflight:ne,cron:z},docs:{brief:"All commands related to DSR requests"}});var fr=mr({routes:{request:ge,consent:U,inventory:E,admin:S,migration:W,install:ur("@transcend-io/transcend",{bash:"__@transcend-io/cli_bash_complete"}),uninstall:cr("@transcend-io/transcend",{bash:!0})},docs:{brief:h,hideRoute:{install:!0,uninstall:!0}}}),Ai=pr(fr,{name:i,versionInfo:{currentVersion:b}});export{Ai as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l,b as m}from"./chunk-W6GUOMVP.js";import{e as g,f as p}from"./chunk-EZCJGIOS.js";import*as t from"io-ts";import{applyEnum as y,valuesOf as e}from"@transcend-io/type-utils";import{DataCategoryType as x,ConsentBundleType as R,EnricherType as S,ProcessingPurpose as b,RequestAction as i,ComparisonOperator as T,RequestActionObjectResolver as d,AssessmentSyncColumn as h,RetentionScheduleType as D,AssessmentQuestionType as E,UspapiOption as N,DataFlowScope as u,PromptAVendorEmailSendType as M,RetentionScheduleOperation as L,AssessmentsDisplayLogicAction as F,DefaultConsentOption as q,LogicOperator as V,ConsentPrecedenceOption as K,AssessmentSyncModel as j,AssessmentQuestionSubType as B,IsoCountryCode as n,BrowserTimeZone as G,IsoCountrySubdivisionCode as s,ConsentTrackerStatus as a,AttributeKeyType as U,PromptAVendorEmailCompletionLinkType as Q,RegionsOperator as z,UnknownRequestPolicy as I,TelemetryPartitionStrategy as H,SignedIabAgreementOption as W,RegionDetectionMethod as Z,PreflightRequestStatus as J,AttributeSupportedResourceType as P,SubDataPointDataSubCategoryGuessStatus as Y,LargeLanguageModelClient as X,PromptFilePurpose as _,CodePackageType as A,ActionItemPriorityOverride as $,ActionItemCode as tt,ScopeName as et,TranscendProduct as rt,PrivacyCenterComponentStyles as nt,PrivacyCenterTextStyles as st,PreferenceStoreAuthLevel as ot,ConfigurableColorPaletteColor as it,AssessmentFormTemplateStatus as at,AssessmentFormStatus as pt,AssessmentFormTemplateSource as yt,UnstructuredSubDataPointRecommendationStatus as ut,PreferenceTopicType as ct}from"@transcend-io/privacy-types";import{InitialViewState as gt,BrowserLanguage as lt,UserPrivacySignalEnum as mt,OnConsentExpiry as dt}from"@transcend-io/airgap.js-types";import{LanguageKey as o}from"@transcend-io/internationalization";var It=t.type({title:t.string}),O=t.intersection([t.type({name:t.string,value:t.string}),t.partial({isSecret:t.boolean})]),ft=t.type({title:t.string}),xt=t.intersection([t.type({name:t.string,description:t.string}),t.partial({"sso-department":t.string,"sso-group":t.string,"sso-title":t.string,users:t.array(t.string),scopes:t.array(e(et))})]),bt=t.intersection([t.type({title:t.string,"output-identifiers":t.array(t.string)}),t.partial({description:t.string,url:t.string,type:e(S),"input-identifier":t.string,testRegex:t.string,lookerQueryTitle:t.string,expirationDuration:t.number,transitionRequestStatus:e(J),phoneNumbers:t.array(t.string),regionList:t.array(e({...n,...s})),"data-subjects":t.array(t.string),headers:t.array(O),"privacy-actions":t.array(e(i))})]),Tt=t.type({purpose:e(b),name:t.string}),c=t.intersection([t.type({category:e(x)}),t.partial({name:t.string})]),Pt=t.intersection([t.type({category:c,status:e(Y),confidence:t.number}),t.partial({classifierVersion:t.number})]),Te=t.intersection([t.type({category:c,status:e(ut),confidence:t.number}),t.partial({classifierVersion:t.number})]),At=t.intersection([t.type({name:t.string}),t.partial({description:t.string,color:t.string})]),Ot=t.intersection([t.type({name:t.string,type:e(U)}),t.partial({description:t.string,resources:t.array(e(P)),values:t.array(At)})]),r=t.type({key:t.string,values:t.array(t.string)}),Ct=t.intersection([t.type({name:t.string,instructions:t.string,agentId:t.string,codeInterpreterEnabled:t.boolean,retrievalEnabled:t.boolean,"large-language-model":t.type({name:t.string,client:e(X)})}),t.partial({description:t.string,prompt:t.string,owners:t.array(t.string),teams:t.array(t.string),"agent-functions":t.array(t.string),"agent-files":t.array(t.string)})]),vt=t.type({name:t.string,description:t.string,parameters:t.string}),kt=t.intersection([t.type({name:t.string,fileId:t.string,size:t.number,purpose:e(_)}),t.partial({description:t.string})]),wt=t.intersection([t.type({title:t.string}),t.partial({description:t.string,dataProcessingAgreementLink:t.string,contactName:t.string,contactPhone:t.string,address:t.string,headquarterCountry:e(n),headquarterSubDivision:e(s),websiteUrl:t.string,businessEntity:t.string,owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),Rt=t.intersection([t.type({name:t.string,category:e(x)}),t.partial({description:t.string,regex:t.string,owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),St=t.intersection([t.type({name:t.string,purpose:e(b)}),t.partial({description:t.string,owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),ht=t.type({title:t.string,content:t.string}),Dt=t.type({title:t.string,content:t.string}),Et=t.type({title:t.string,description:t.string,prompts:t.array(t.string)}),Nt=t.intersection([t.type({key:t.string}),t.partial({title:t.string,description:t.union([t.string,t.null]),purposes:t.array(Tt),categories:t.array(c),"guessed-categories":t.array(Pt),"access-request-visibility-enabled":t.boolean,"erasure-request-redaction-enabled":t.boolean,attributes:t.array(r)})]),Mt=t.intersection([t.type({key:t.string}),t.partial({path:t.array(t.string),title:t.string,description:t.string,"data-collection-tag":t.string,"privacy-action-queries":t.partial(y(d,()=>t.string)),"privacy-actions":t.array(e(d)),fields:t.array(Nt),owners:t.array(t.string),teams:t.array(t.string)})]),Lt=t.partial({"notify-email-address":t.string,"send-frequency":t.number,"send-type":e(M),"include-identifiers-attachment":t.boolean,"completion-link-type":e(Q),"manual-work-retry-frequency":t.string}),Ft=t.intersection([t.type({title:t.string}),t.partial({description:t.string,address:t.string,headquarterCountry:e(n),headquarterSubDivision:e(s),dataProtectionOfficerName:t.string,dataProtectionOfficerEmail:t.string,attributes:t.array(r),owners:t.array(t.string),teams:t.array(t.string)})]),Pe=t.intersection([t.type({name:t.string,codePackageType:e(A)}),t.partial({description:t.string,repositoryUrl:t.string,catalogIntegrationName:t.string,documentationLinks:t.array(t.string),ownerEmails:t.array(t.string),teamNames:t.array(t.string)})]),qt=t.intersection([t.type({name:t.string}),t.partial({version:t.string,isDevDependency:t.boolean})]),Ae=t.intersection([t.type({name:t.string,type:e(A),relativePath:t.string,repositoryName:t.string}),t.partial({description:t.string,softwareDevelopmentKits:t.array(qt),teamNames:t.array(t.string),ownerEmails:t.array(t.string)})]),Oe=t.intersection([t.type({name:t.string,url:t.string}),t.partial({description:t.string,teamNames:t.array(t.string),ownerEmails:t.array(t.string)})]),Vt=t.intersection([t.type({type:t.string}),t.partial({active:t.boolean,title:t.string,adminDashboardDefaultSilentMode:t.boolean,actions:t.array(e(i))})]),Kt=t.intersection([t.type({type:e(i)}),t.partial({skipSecondaryIfNoFiles:t.boolean,skipDownloadableStep:t.boolean,requiresReview:t.boolean,waitingPeriod:t.number,regionDetectionMethod:e(Z),regionList:t.array(e({...n,...s})),regionBlockList:t.array(e({...n,...s}))})]),jt=t.intersection([t.type({name:t.string,type:t.string}),t.partial({regex:t.string,selectOptions:t.array(t.string),privacyCenterVisibility:t.array(e(i)),dataSubjects:t.array(t.string),isRequiredInForm:t.boolean,placeholder:t.string,displayTitle:t.string,displayDescription:t.string,displayOrder:t.number})]),Bt=t.intersection([t.type({value:t.string,type:e(u)}),t.partial({description:t.string,trackingPurposes:t.array(t.string),service:t.string,status:e(a),owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),Gt=t.intersection([t.type({name:t.string}),t.partial({isRegex:t.boolean,description:t.string,trackingPurposes:t.array(t.string),service:t.string,status:e(a),owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),Ut=t.intersection([t.type({name:t.string}),t.partial({displayName:t.string,regions:t.array(t.partial({countrySubDivision:e(s),country:e(n)})),onConsentExpiry:e(dt),consentExpiry:t.number,operator:e(z),displayPriority:t.number,viewState:e(gt),purposes:t.array(t.type({trackingType:t.string})),optedOutPurposes:t.array(t.type({trackingType:t.string})),browserLanguages:t.array(e(lt)),browserTimeZones:t.array(e(G))})]),Qt=t.intersection([t.type({name:t.string}),t.partial({partition:t.string})]),zt=t.partial({version:t.string,bundleUrls:t.record(e(R),t.string),domains:t.array(t.string),partition:t.string,consentPrecedence:e(K),unknownRequestPolicy:e(I),unknownCookiePolicy:e(I),syncEndpoint:t.string,telemetryPartitioning:e(H),signedIabAgreement:e(W),uspapi:e(N),experiences:t.array(Ut),theme:t.partial({primaryColor:t.string,fontColor:t.string,privacyPolicy:t.string,prompt:t.number}),syncGroups:t.string}),Ht=t.partial({isDisabled:t.boolean,showPrivacyRequestButton:t.boolean,showDataPractices:t.boolean,showPolicies:t.boolean,showTrackingTechnologies:t.boolean,showCookies:t.boolean,showDataFlows:t.boolean,showConsentManager:t.boolean,showManageYourPrivacy:t.boolean,showMarketingPreferences:t.boolean,locales:t.array(e(o)),defaultLocale:e(o),preferBrowserDefaultLocale:t.boolean,supportEmail:t.string,replyToEmail:t.string,useNoReplyEmailAddress:t.boolean,useCustomEmailDomain:t.boolean,transformAccessReportJsonToCsv:t.boolean,theme:t.partial({colors:t.partial(y(it,()=>t.string)),componentStyles:nt,textStyles:st})}),Wt=t.intersection([t.type({title:t.string}),t.partial({effectiveOn:t.string,disableEffectiveOn:t.boolean,content:t.string,disabledLocales:t.array(e(o))})]),Zt=t.intersection([t.type({id:t.string}),t.partial({targetReactIntlId:t.string,defaultMessage:t.string,translations:t.partial(y(o,()=>t.string))})]),Jt=t.intersection([t.type({title:t.string,integrationName:t.string}),t.partial({"outer-type":t.string,description:t.string,url:t.string,"api-key-title":t.string,headers:t.array(O),"data-subjects":t.array(t.string),"identity-keys":t.array(t.string),"deletion-dependencies":t.array(t.string),owners:t.array(t.string),teams:t.array(t.string),disabled:t.boolean,datapoints:t.array(Mt),"email-settings":Lt,country:e(n),countrySubDivision:e(s),attributes:t.array(r),businessEntityTitles:t.array(t.string)})]),Yt=t.intersection([t.type({title:t.string,productLine:e(rt)}),t.partial({description:t.string,hidden:t.boolean})]),Xt=t.intersection([t.type({title:t.string,type:e(tt),collections:t.array(t.string)}),t.partial({priority:e($),customerExperienceActionItemId:t.string,dueDate:t.string,resolved:t.boolean,notes:t.string,link:t.string,users:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),C=t.intersection([t.type({"depends-on-question-reference-id":t.string,"comparison-operator":e(T)}),t.partial({"comparison-operands":t.array(t.string)})]),_t=t.recursion("AssessmentNestedRuleInput",w=>t.intersection([t.type({"logic-operator":e(V)}),t.partial({rules:t.array(C),"nested-rules":t.array(w)})])),$t=t.intersection([t.type({action:e(F)}),t.partial({rule:C,"nested-rule":_t})]),Ce=t.partial({"risk-level":t.string,"risk-matrix-column":t.string,"risk-matrix-row":t.string}),te=t.intersection([t.type({"comparison-operands":t.array(t.string),"comparison-operator":e(T)}),t.partial({"risk-level":t.string,"risk-matrix-column":t.string,"risk-matrix-row":t.string})]),ee=t.type({value:t.string}),re=t.intersection([t.type({title:t.string,type:e(E)}),t.partial({"sub-type":e(B),placeholder:t.string,description:t.string,"is-required":t.boolean,"reference-id":t.string,"display-logic":$t,"risk-logic":t.array(te),"risk-categories":t.array(t.string),"risk-framework":t.string,"answer-options":t.array(ee),"selected-answers":t.array(t.string),"allowed-mime-types":t.array(t.string),"allow-select-other":t.boolean,"sync-model":e(j),"sync-column":e(h),"attribute-key":t.string,"require-risk-evaluation":t.boolean,"require-risk-matrix-evaluation":t.boolean})]),v=t.intersection([t.type({title:t.string,questions:t.array(re)}),t.partial({assignees:t.array(t.string),"external-assignees":t.array(t.string),status:t.string,"is-reviewed":t.boolean})]),k=t.type({type:e(D),"duration-days":t.number,operand:e(L)}),ne=t.intersection([t.type({title:t.string}),t.partial({sections:t.array(v),description:t.string,status:e(at),source:e(yt),creator:t.string,locked:t.boolean,"parent-id":t.string,archived:t.boolean,"created-at":t.string,"attribute-keys":t.array(t.string),"retention-schedule":k,templates:t.array(t.string)})]),f=t.type({title:t.string,type:e(P)}),se=t.intersection([t.type({title:t.string,group:t.string}),t.partial({sections:t.array(v),creator:t.string,description:t.string,status:e(pt),assignees:t.array(t.string),"external-assignees":t.array(t.string),reviewers:t.array(t.string),locked:t.boolean,archived:t.boolean,external:t.boolean,"title-is-internal":t.boolean,"due-date":t.string,"created-at":t.string,"assigned-at":t.string,"submitted-at":t.string,"approved-at":t.string,"rejected-at":t.string,resources:t.array(f),rows:t.array(f),"retention-schedule":k,attributes:t.array(r)})]),oe=t.type({title:t.string,slug:t.string}),ie=t.intersection([t.type({type:e(ct),title:t.string,description:t.string}),t.partial({"default-configuration":t.string,"show-in-privacy-center":t.boolean,options:t.array(oe)})]),ae=t.intersection([t.type({trackingType:t.string,title:t.string,name:t.string}),t.partial({description:t.string,"is-active":t.boolean,configurable:t.boolean,"display-order":t.number,"show-in-privacy-center":t.boolean,"show-in-consent-manager":t.boolean,"preference-topics":t.array(ie),"auth-level":e(ot),"opt-out-signals":t.array(e(mt)),"default-consent":e(q)})]),ve=t.partial({"action-items":t.array(Xt),"action-item-collections":t.array(Yt),"api-keys":t.array(ft),teams:t.array(xt),templates:t.array(It),enrichers:t.array(bt),attributes:t.array(Ot),"business-entities":t.array(Ft),vendors:t.array(wt),"data-categories":t.array(Rt),"processing-purposes":t.array(St),"data-subjects":t.array(Vt),actions:t.array(Kt),identifiers:t.array(jt),"data-silos":t.array(Jt),"data-flows":t.array(Bt),cookies:t.array(Gt),"consent-manager":zt,prompts:t.array(ht),"prompt-partials":t.array(Dt),"prompt-groups":t.array(Et),agents:t.array(Ct),"agent-functions":t.array(vt),"agent-files":t.array(kt),"privacy-center":Ht,policies:t.array(Wt),messages:t.array(Zt),partitions:t.array(Qt),"assessment-templates":t.array(ne),assessments:t.array(se),purposes:t.array(ae)}),ke=t.type({organizationName:t.string,apiKey:t.string,organizationId:t.string}),we=t.intersection([t.type({"Connections Made To":t.string,Type:e(u),Purpose:t.string}),t.partial({Service:t.string,Notes:t.string,Owners:t.string,Teams:t.string,Status:e(a)}),t.record(t.string,t.string)]),Re=t.intersection([t.type({Name:t.string,Purpose:t.string}),t.partial({Service:t.string,Notes:t.string,Owners:t.string,Teams:t.string,Status:e(a)}),t.record(t.string,t.string)]),Se=t.type({title:t.string,description:t.string,cookies:t.array(t.type({name:t.string,trackingPurposes:t.array(t.string)})),dataFlows:t.array(t.type({value:t.string,type:e(u),trackingPurposes:t.array(t.string)}))}),he=e(g),pe=l({TRouteName:e(p)}),De=e(p),ye=t.array(pe),ue=m({TEnabledRoutes:ye}),Ee=t.partial({enabledIntegrations:t.partial({openAI:ue})}),Ne=t.partial({promptRunName:t.string,promptId:t.string,promptTitle:t.string,promptGroupId:t.string,promptGroupTitle:t.string,runByEmployeeEmail:t.string,applicationId:t.string,applicationName:t.string,codePackageName:t.string,repositoryName:t.string,applicationUserCoreIdentifier:t.string,applicationUserName:t.string,slackMessageTs:t.string,slackTeamId:t.string,slackChannelId:t.string,slackChannelName:t.string}),ce=t.intersection([t.type({title:t.string}),t.partial({value:t.string})]),ge=t.type({columns:t.array(ce)}),Me=t.partial({rows:t.array(ge),json:t.string});export{It as a,O as b,ft as c,xt as d,bt as e,Tt as f,c as g,Pt as h,Te as i,At as j,Ot as k,r as l,Ct as m,vt as n,kt as o,wt as p,Rt as q,St as r,ht as s,Dt as t,Et as u,Nt as v,Mt as w,Lt as x,Ft as y,Pe as z,qt as A,Ae as B,Oe as C,Vt as D,Kt as E,jt as F,Bt as G,Gt as H,Ut as I,Qt as J,zt as K,Ht as L,Wt as M,Zt as N,Jt as O,Yt as P,Xt as Q,C as R,_t as S,$t as T,Ce as U,te as V,ee as W,re as X,v as Y,k as Z,ne as _,f as $,se as aa,oe as ba,ie as ca,ae as da,ve as ea,ke as fa,we as ga,Re as ha,Se as ia,he as ja,pe as ka,ye as la,ue as ma,Ee as na,Ne as oa,Me as pa};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as _}from"./chunk-4AH7KIGL.js";import{n as A,q as x}from"./chunk-7NWTOLV6.js";import{Ae as O,Be as D,_ as T,_b as j,b as R,pe as y,qe as E,ye as L}from"./chunk-LYA6JDF3.js";import{e as b}from"./chunk-APA5PR4U.js";import{a as r}from"./chunk-OERYFLN2.js";import{RequestStatus as U}from"@transcend-io/privacy-types";import k from"colors";import{groupBy as G,uniq as Q}from"lodash-es";async function te({file:u,auth:s,sombraAuth:g,requestActions:f=[],concurrency:p=100,transcendUrl:n=b}){let o=y(n,s),e=await E(n,s,g);r.info(k.magenta(`Pulling manual enrichment requests, filtered for actions: ${f.join(",")}`));let d=await L(o,{actions:f,statuses:[U.Enriching]}),i=[];await R(d,async t=>{let c=await D(o,{requestId:t.id});if(c.filter(({status:m})=>m==="ACTION_REQUIRED")){let m=await O(o,e,{requestId:t.id});i.push({...t,requestIdentifiers:m,requestEnrichers:c})}},{concurrency:p});let l=i.map(({attributeValues:t,requestIdentifiers:c,requestEnrichers:I,...m})=>({...m,...Object.entries(G(c,"name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({value:C})=>C).join(",")}),{}),...Object.entries(G(t,"attributeKey.name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({name:C})=>C).join(",")}),{})})),a=Q(l.map(t=>Object.keys(t)).flat());return _(u,l,a),r.info(k.green(`Successfully wrote ${i.length} requests to file "${u}"`)),i}import*as q from"io-ts";import{uniq as F}from"lodash-es";import v from"colors";var S="https://app.transcend.io/privacy-requests/incoming-requests/",M=q.record(q.string,q.string);async function N(u,{id:s,...g},f,p){if(!s){let e=`Request ID must be provided to enricher request.${p?` Found error in row: ${p}`:""}`;throw r.error(v.red(e)),new Error(e)}let n=s.toLowerCase(),o=Object.entries(g).reduce((e,[d,i])=>F(A(i)).length===0?e:Object.assign(e,{[d]:F(A(i)).map(a=>({value:d==="email"?a.toLowerCase():a}))}),{});try{return await u.post("v1/enrich-identifiers",{headers:{"x-transcend-request-id":n,"x-transcend-enricher-id":f},json:{enrichedIdentifiers:o}}).json(),r.error(v.green(`Successfully enriched request: ${S}${n}`)),!0}catch(e){if(typeof e.response.body=="string"&&e.response.body.includes("Cannot update a resolved RequestEnricher"))return r.warn(v.magenta(`Skipped enrichment for request: ${S}${n}, request is no longer in the enriching phase.`)),!1;throw r.error(v.red(`Failed to enricher identifiers for request with id: ${S}${n} - ${e.message} - ${e.response.body}`)),e}}import h from"colors";async function ge({file:u,auth:s,sombraAuth:g,enricherId:f,markSilent:p,concurrency:n=100,transcendUrl:o=b}){let e=await E(o,s,g),d=y(o,s);r.info(h.magenta(`Reading "${u}" from disk`));let i=x(u,M);r.info(h.magenta(`Enriching "${i.length}" privacy requests.`));let l=0,a=0,t=0;if(await R(i,async(c,I)=>{try{p&&(await j(d,T,{input:{id:c.id,isSilent:!0}}),r.info(h.magenta(`Mark request as silent mode - ${c.id}`))),await N(e,c,f,I)?l+=1:a+=1}catch{t+=1}},{concurrency:n}),r.info(h.green(`Successfully notified Transcend!
|
|
2
|
+
Success count: ${l}.`)),a>0&&r.info(h.magenta(`Skipped count: ${a}.`)),t>0)throw r.info(h.red(`Error Count: ${t}.`)),new Error(`Failed to enrich: ${t} requests.`);return i.length}export{te as a,M as b,N as c,ge as d};
|