@transcend-io/cli 7.0.0-alpha.8 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -6
- package/dist/bin/bash-complete.cjs +4 -0
- package/dist/bin/bash-complete.cjs.map +1 -0
- package/dist/bin/bash-complete.d.cts +1 -0
- package/dist/bin/cli.cjs +3 -0
- package/dist/bin/cli.cjs.map +1 -0
- package/dist/bin/cli.d.cts +1 -0
- package/dist/bin/deprecated-command.cjs +7 -0
- package/dist/bin/deprecated-command.cjs.map +1 -0
- package/dist/bin/deprecated-command.d.cts +1 -0
- package/dist/chunk-ANCIGXE5.cjs +4 -0
- package/dist/chunk-ANCIGXE5.cjs.map +1 -0
- package/dist/chunk-AW6I4V4F.cjs +3 -0
- package/dist/chunk-AW6I4V4F.cjs.map +1 -0
- package/dist/chunk-BY7W4UQF.cjs +2 -0
- package/dist/chunk-BY7W4UQF.cjs.map +1 -0
- package/dist/chunk-CHTWXNEA.cjs +2 -0
- package/dist/chunk-CHTWXNEA.cjs.map +1 -0
- package/dist/chunk-DS6VH676.cjs +2 -0
- package/dist/chunk-DS6VH676.cjs.map +1 -0
- package/dist/chunk-EG4L6YAJ.cjs +2 -0
- package/dist/chunk-EG4L6YAJ.cjs.map +1 -0
- package/dist/chunk-ETNRSKUM.cjs +2 -0
- package/dist/chunk-ETNRSKUM.cjs.map +1 -0
- package/dist/chunk-GM2EDRKN.cjs +12 -0
- package/dist/chunk-GM2EDRKN.cjs.map +1 -0
- package/dist/chunk-IBTP5OXE.cjs +2 -0
- package/dist/chunk-IBTP5OXE.cjs.map +1 -0
- package/dist/chunk-KOV2SQO2.cjs +4 -0
- package/dist/chunk-KOV2SQO2.cjs.map +1 -0
- package/dist/chunk-LBDIZJ23.cjs +2844 -0
- package/dist/chunk-LBDIZJ23.cjs.map +1 -0
- package/dist/chunk-LZYEIVWM.cjs +94 -0
- package/dist/chunk-LZYEIVWM.cjs.map +1 -0
- package/dist/chunk-MPJABCSW.cjs +75 -0
- package/dist/chunk-MPJABCSW.cjs.map +1 -0
- package/dist/chunk-R5N2S5UU.cjs +2 -0
- package/dist/chunk-R5N2S5UU.cjs.map +1 -0
- package/dist/chunk-RW5GSSAA.cjs +2 -0
- package/dist/chunk-RW5GSSAA.cjs.map +1 -0
- package/dist/chunk-RZWMOCW3.cjs +2 -0
- package/dist/chunk-RZWMOCW3.cjs.map +1 -0
- package/dist/chunk-SAEKBZGF.cjs +2 -0
- package/dist/chunk-SAEKBZGF.cjs.map +1 -0
- package/dist/chunk-T462ONFX.cjs +2 -0
- package/dist/chunk-T462ONFX.cjs.map +1 -0
- package/dist/chunk-TD7ADMVO.cjs +2 -0
- package/dist/chunk-TD7ADMVO.cjs.map +1 -0
- package/dist/chunk-UBUNHRCG.cjs +2 -0
- package/dist/chunk-UBUNHRCG.cjs.map +1 -0
- package/dist/chunk-UEGX6GZ2.cjs +2 -0
- package/dist/chunk-UEGX6GZ2.cjs.map +1 -0
- package/dist/chunk-VCWGXJ2H.cjs +9 -0
- package/dist/chunk-VCWGXJ2H.cjs.map +1 -0
- package/dist/chunk-ZUNVPK23.cjs +2 -0
- package/dist/chunk-ZUNVPK23.cjs.map +1 -0
- package/dist/chunk-ZVK4HIDF.cjs +6 -0
- package/dist/chunk-ZVK4HIDF.cjs.map +1 -0
- package/dist/impl-2GU6CYMY.cjs +2 -0
- package/dist/impl-2GU6CYMY.cjs.map +1 -0
- package/dist/impl-2OEHQTIR.cjs +2 -0
- package/dist/impl-2OEHQTIR.cjs.map +1 -0
- package/dist/impl-2QXJ3WST.cjs +9 -0
- package/dist/impl-2QXJ3WST.cjs.map +1 -0
- package/dist/impl-442H4ODN.cjs +7 -0
- package/dist/impl-442H4ODN.cjs.map +1 -0
- package/dist/impl-44QRPPUX.cjs +6 -0
- package/dist/impl-44QRPPUX.cjs.map +1 -0
- package/dist/impl-4DOGSDPC.cjs +2 -0
- package/dist/impl-4DOGSDPC.cjs.map +1 -0
- package/dist/impl-5J3MG42D.cjs +2 -0
- package/dist/impl-5J3MG42D.cjs.map +1 -0
- package/dist/impl-5YMSNFJU.cjs +2 -0
- package/dist/impl-5YMSNFJU.cjs.map +1 -0
- package/dist/impl-6TBKGA4Y.cjs +2 -0
- package/dist/impl-6TBKGA4Y.cjs.map +1 -0
- package/dist/impl-7VYQSZVO.cjs +2 -0
- package/dist/impl-7VYQSZVO.cjs.map +1 -0
- package/dist/impl-BB24LU3N.cjs +2 -0
- package/dist/impl-BB24LU3N.cjs.map +1 -0
- package/dist/impl-CWZ26FTN.cjs +2 -0
- package/dist/impl-CWZ26FTN.cjs.map +1 -0
- package/dist/impl-EFTKRWUA.cjs +2 -0
- package/dist/impl-EFTKRWUA.cjs.map +1 -0
- package/dist/impl-EJT3AX73.cjs +2 -0
- package/dist/impl-EJT3AX73.cjs.map +1 -0
- package/dist/impl-EKQ6ZNN3.cjs +2 -0
- package/dist/impl-EKQ6ZNN3.cjs.map +1 -0
- package/dist/impl-EV6T5UOK.cjs +6 -0
- package/dist/impl-EV6T5UOK.cjs.map +1 -0
- package/dist/impl-FPFUAY4Q.cjs +2 -0
- package/dist/impl-FPFUAY4Q.cjs.map +1 -0
- package/dist/impl-GDKUHX2J.cjs +2 -0
- package/dist/impl-GDKUHX2J.cjs.map +1 -0
- package/dist/impl-GXDABG5X.cjs +2 -0
- package/dist/impl-GXDABG5X.cjs.map +1 -0
- package/dist/impl-IG7QEF6D.cjs +2 -0
- package/dist/impl-IG7QEF6D.cjs.map +1 -0
- package/dist/impl-JQLYJA5L.cjs +2 -0
- package/dist/impl-JQLYJA5L.cjs.map +1 -0
- package/dist/impl-LPI3M7L3.cjs +6 -0
- package/dist/impl-LPI3M7L3.cjs.map +1 -0
- package/dist/impl-M7WMSIK4.cjs +4 -0
- package/dist/impl-M7WMSIK4.cjs.map +1 -0
- package/dist/impl-MRGZ5OLO.cjs +2 -0
- package/dist/impl-MRGZ5OLO.cjs.map +1 -0
- package/dist/impl-OI4UWRAU.cjs +12 -0
- package/dist/impl-OI4UWRAU.cjs.map +1 -0
- package/dist/impl-OX24YDRR.cjs +2 -0
- package/dist/impl-OX24YDRR.cjs.map +1 -0
- package/dist/impl-PFQKPCUL.cjs +2 -0
- package/dist/impl-PFQKPCUL.cjs.map +1 -0
- package/dist/impl-PXJZK6BV.cjs +2 -0
- package/dist/impl-PXJZK6BV.cjs.map +1 -0
- package/dist/impl-QOGUUIE6.cjs +2 -0
- package/dist/impl-QOGUUIE6.cjs.map +1 -0
- package/dist/impl-QR3LLBZL.cjs +2 -0
- package/dist/impl-QR3LLBZL.cjs.map +1 -0
- package/dist/impl-RODUB22E.cjs +2 -0
- package/dist/impl-RODUB22E.cjs.map +1 -0
- package/dist/impl-S56PHXGG.cjs +2 -0
- package/dist/impl-S56PHXGG.cjs.map +1 -0
- package/dist/impl-SDGCTSWN.cjs +2 -0
- package/dist/impl-SDGCTSWN.cjs.map +1 -0
- package/dist/impl-VEMQEG27.cjs +2 -0
- package/dist/impl-VEMQEG27.cjs.map +1 -0
- package/dist/impl-VFWBSWT5.cjs +2 -0
- package/dist/impl-VFWBSWT5.cjs.map +1 -0
- package/dist/impl-XRRNIJUK.cjs +2 -0
- package/dist/impl-XRRNIJUK.cjs.map +1 -0
- package/dist/impl-YA7HWMYB.cjs +2 -0
- package/dist/impl-YA7HWMYB.cjs.map +1 -0
- package/dist/impl-YOWRUVYG.cjs +2 -0
- package/dist/impl-YOWRUVYG.cjs.map +1 -0
- package/dist/impl-ZHZOMOST.cjs +2 -0
- package/dist/impl-ZHZOMOST.cjs.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +117658 -0
- package/package.json +67 -62
- package/dist/bin/bash-complete.js +0 -3
- package/dist/bin/cli.js +0 -2
- package/dist/bin/deprecated-command.js +0 -6
- package/dist/chunk-3KYYR6WM.js +0 -74
- package/dist/chunk-4W2NF2OS.js +0 -1
- package/dist/chunk-5SI3ACV3.js +0 -8
- package/dist/chunk-64RBCV3H.js +0 -93
- package/dist/chunk-AHYJJKNA.js +0 -1
- package/dist/chunk-APA5PR4U.js +0 -1
- package/dist/chunk-EZCJGIOS.js +0 -1
- package/dist/chunk-FXYTXR6R.js +0 -2
- package/dist/chunk-HMF46LB7.js +0 -1
- package/dist/chunk-HXMONGHM.js +0 -1
- package/dist/chunk-HXYCZ5UY.js +0 -3
- package/dist/chunk-MBAKYLJ3.js +0 -2830
- package/dist/chunk-OERYFLN2.js +0 -1
- package/dist/chunk-QQRMUEM7.js +0 -3
- package/dist/chunk-RBOBI6B6.js +0 -5
- package/dist/chunk-SVDDU4R6.js +0 -1
- package/dist/chunk-T2PLXAEM.js +0 -1
- package/dist/chunk-TD5AG6IF.js +0 -1
- package/dist/chunk-UPHD5UAO.js +0 -1
- package/dist/chunk-UVJSNZM5.js +0 -1
- package/dist/chunk-W6GUOMVP.js +0 -1
- package/dist/chunk-XMGVDVM2.js +0 -1
- package/dist/chunk-XQTNSPJ3.js +0 -11
- package/dist/chunk-ZB5DNAF3.js +0 -1
- package/dist/impl-2AQG2DEN.js +0 -1
- package/dist/impl-2CT4WQB5.js +0 -1
- package/dist/impl-4KGHP2BC.js +0 -1
- package/dist/impl-75Y3OM5Z.js +0 -1
- package/dist/impl-AKN4Q3ON.js +0 -1
- package/dist/impl-B45RAXAK.js +0 -1
- package/dist/impl-C4HUZZJO.js +0 -5
- package/dist/impl-DHTPY5AB.js +0 -1
- package/dist/impl-FCRKJBOS.js +0 -11
- package/dist/impl-GUEUJOOC.js +0 -1
- package/dist/impl-H57BW5MO.js +0 -1
- package/dist/impl-HCNN3NZK.js +0 -1
- package/dist/impl-IME3ONWF.js +0 -1
- package/dist/impl-L3UJQJZ6.js +0 -1
- package/dist/impl-LC3UNIDE.js +0 -1
- package/dist/impl-LEZFRF7Y.js +0 -1
- package/dist/impl-LJLXQ3QL.js +0 -1
- package/dist/impl-MZ6D4BQ3.js +0 -1
- package/dist/impl-NKKIQKJ6.js +0 -1
- package/dist/impl-NYB4YSNU.js +0 -1
- package/dist/impl-OQFT2DYM.js +0 -1
- package/dist/impl-OQUKAZLQ.js +0 -6
- package/dist/impl-P63ATAHR.js +0 -1
- package/dist/impl-PATZGQVZ.js +0 -1
- package/dist/impl-PWZF46AT.js +0 -8
- package/dist/impl-QD62F5PJ.js +0 -1
- package/dist/impl-S5PLONJN.js +0 -1
- package/dist/impl-SBN3KA7O.js +0 -5
- package/dist/impl-T4ODLBML.js +0 -1
- package/dist/impl-TG65PIBJ.js +0 -3
- package/dist/impl-UQR3O4M3.js +0 -1
- package/dist/impl-V5KJW35Z.js +0 -1
- package/dist/impl-WLQF5X2U.js +0 -5
- package/dist/impl-X6FJHMP5.js +0 -1
- package/dist/impl-XRYV4FW7.js +0 -1
- package/dist/impl-YFDEKBXT.js +0 -1
- package/dist/impl-YQW4KNXL.js +0 -1
- package/dist/impl-YWNLYZI4.js +0 -1
- package/dist/impl-ZBLHGXKD.js +0 -1
- package/dist/index.js +0 -4
package/dist/chunk-HXMONGHM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as F}from"./chunk-SVDDU4R6.js";import{De as O,_b as G,a as _,b as S,pe as A,qe as P,ve as N,wa as k}from"./chunk-MBAKYLJ3.js";import{a as r}from"./chunk-OERYFLN2.js";import{e as I}from"./chunk-APA5PR4U.js";import*as e from"io-ts";import{decodeCodec as V}from"@transcend-io/type-utils";var X=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 U(t,{dataSiloId:n,limit:m=100,offset:o=0,requestType:s}){try{let i=await t.get(`v1/data-silo/${n}/pending-requests/${s}`,{searchParams:{offset:o,limit:m}}).json(),{items:c}=V(e.type({items:e.array(X)}),i);return c}catch(i){throw new Error(`Received an error from server: ${i?.response?.body||i?.message}`)}}import*as T from"io-ts";var L=T.type({nonce:T.string,identifier:T.string});async function B(t,{nonce:n,identifier:m}){try{return await t.put("v1/data-silo",{headers:{"x-transcend-nonce":n},json:{profiles:[{profileId:m}]}}),!0}catch(o){if(o.response?.statusCode===409)return!1;throw new Error(`Received an error from server: ${o?.response?.body||o?.message}`)}}import w from"colors";import j from"cli-progress";async function de({file:t,dataSiloId:n,auth:m,sombraAuth:o,concurrency:s=100,transcendUrl:i=I}){let c=await P(i,m,o);r.info(w.magenta(`Reading "${t}" from disk`));let d=F(t,L);r.info(w.magenta(`Notifying Transcend for data silo "${n}" marking "${d.length}" identifiers as completed.`));let a=new Date().getTime(),p=new j.SingleBar({},j.Presets.shades_classic),h=0,f=0,g=0;p.start(d.length,0),await S(d,async C=>{try{await B(c,C)?h+=1:f+=1}catch(u){r.error(w.red(`Error notifying Transcend for identifier "${C.identifier}" - ${u.message}`)),g+=1}p.update(h+f)},{concurrency:s}),p.stop();let l=new Date().getTime()-a;if(r.info(w.green(`Successfully notified Transcend for ${h} identifiers in "${l/1e3}" seconds!`)),f&&r.info(w.magenta(`There were ${f} identifiers that were not in a state to be updated.They likely have already been resolved.`)),g)throw r.error(w.red(`There were ${g} identifiers that failed to be updated. Please review the logs for more information.`)),new Error("Failed to update all identifiers");return d.length}import W from"colors";import Q from"cli-progress";import{RequestDataSiloStatus as Y}from"@transcend-io/privacy-types";async function we({requestIds:t,dataSiloId:n,auth:m,concurrency:o=100,status:s=Y.Resolved,transcendUrl:i=I}){let c=A(i,m),d=new Date().getTime(),a=new Q.SingleBar({},Q.Presets.shades_classic);r.info(W.magenta(`Notifying Transcend for data silo "${n}" marking "${t.length}" requests as completed.`));let p=0;a.start(t.length,0),await S(t,async g=>{let y=await O(c,{requestId:g,dataSiloId:n});try{await G(c,k,{requestDataSiloId:y.id,status:s})}catch(l){if(!l.message.includes("Client error: Request must be active:"))throw l}p+=1,a.update(p)},{concurrency:o}),a.stop();let f=new Date().getTime()-d;return r.info(W.green(`Successfully notified Transcend in "${f/1e3}" seconds!`)),t.length}import v from"colors";import z from"cli-progress";async function Re({dataSiloId:t,auth:n,sombraAuth:m,actions:o,apiPageSize:s=100,savePageSize:i=1e3,onSave:c,transcendUrl:d=I,skipRequestCount:a=!1}){if(i%s!==0)throw new Error(`savePageSize must be a multiple of apiPageSize. savePageSize: ${i}, apiPageSize: ${s}`);let p=await P(d,n,m),h=A(d,n),f=0;a||(f=await N(h,{dataSiloId:t})),r.info(v.magenta(`Pulling ${a?"all":f} outstanding request identifiers for data silo: "${t}" for requests of types "${o.join('", "')}"`));let g=new Date().getTime(),y=new z.SingleBar({},z.Presets.shades_classic),l=new Set,C=[],u=[];a||y.start(f,0),await _(o,async q=>{let D=0,R=!0;for(;R;){let $=await U(p,{dataSiloId:t,limit:s,offset:D,requestType:q}),x=$.map(b=>(l.add(b.requestId),{...b,action:q})),J=x.map(({attributes:b,...K})=>({...K,...b.reduce((M,E)=>Object.assign(M,{[E.key]:E.values.join(",")}),{})}));C.push(...x),u.push(...J),u.length>=i&&(await c(u),u=[]),R=$.length===s,D+=s,a?r.info(v.magenta(`Pulled ${$.length} outstanding identifiers for ${l.size} requests`)):y.update(l.size)}}),u.length>0&&await c(u),a||y.stop();let H=new Date().getTime()-g;return r.info(v.green(`Successfully pulled ${C.length} outstanding identifiers from ${l.size} requests in "${H/1e3}" seconds!`)),{identifiers:C}}export{X as a,U as b,L as c,B as d,de as e,we as f,Re as g};
|
package/dist/chunk-HXYCZ5UY.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as u}from"./chunk-TD5AG6IF.js";import{a as E}from"./chunk-OERYFLN2.js";import{readFileSync as b}from"fs";import{findAllWithRegex as F}from"@transcend-io/type-utils";import{CodePackageType as w}from"@transcend-io/privacy-types";var N=/target ('|")(.*?)('|")/,O=/pod ('|")(.*?)('|")(, ('|")~> (.+?)('|")|)/,y={supportedFiles:["Podfile"],ignoreDirs:["Pods"],scanFunction:e=>{let n=b(e,"utf-8"),o=F({value:new RegExp(N,"g"),matches:["quote1","name","quote2"]},n),c=F({value:new RegExp(O,"g"),matches:["quote1","name","quote2","extra","quote3","version","quote4"]},n);return o.map((t,p)=>({name:t.name,type:w.CocoaPods,softwareDevelopmentKits:c.filter(r=>r.matchIndex>t.matchIndex&&(!o[p+1]||r.matchIndex<o[p+1].matchIndex)).map(r=>({name:r.name,version:r.version}))}))}};import{readFileSync as T}from"fs";import{findAllWithRegex as l}from"@transcend-io/type-utils";import{dirname as h}from"path";var K=/implementation( *)('|")(.+?):(.+?):(.+?|)('|")/,M=/apply plugin: *('|")(.+?)(:(.+?)|)('|")/,j=/implementation group:( *)('|")(.+?)('|"),( *)name:( *)('|")(.+?)('|"),( *)version:( *)('|")(.+?)('|")/,L=/applicationId( *)"(.+?)"/,S={supportedFiles:["build.gradle**"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:e=>{let n=T(e,"utf-8"),o=h(e),c=l({value:new RegExp(K,"g"),matches:["space","quote1","name","path","version","quote2"]},n),a=l({value:new RegExp(M,"g"),matches:["quote1","name","group","version","quote2"]},n),t=l({value:new RegExp(j,"g"),matches:["space1","quote1","group","quote2","space2","space3","quote3","name","quote4","space4","space5","quote5","version","quote6"]},n),p=l({value:new RegExp(L,"g"),matches:["space","name"]},n);if(p.length>1)throw new Error(`Expected only one applicationId per file: ${e}`);return[{name:p[0]?.name||o.split("/").pop(),softwareDevelopmentKits:[...c,...t,...a].map(r=>({name:r.name,version:r.version||void 0}))}]}};import{readFileSync as $}from"fs";import{dirname as J}from"path";var x={supportedFiles:["package.json"],ignoreDirs:["node_modules","serverless-build","lambda-build"],scanFunction:e=>{let n=$(e,"utf-8"),o=J(e),c=JSON.parse(n),{name:a,description:t,dependencies:p={},devDependencies:r={},optionalDependencies:i={}}=c;return[{name:a||o.split("/").pop(),description:t,softwareDevelopmentKits:[...Object.entries(p).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0})),...Object.entries(r).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0,isDevDependency:!0})),...Object.entries(i).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0}))]}]}};import{readFileSync as R}from"fs";import{findAllWithRegex as X}from"@transcend-io/type-utils";import{dirname as U,join as W}from"path";import{CodePackageType as Y}from"@transcend-io/privacy-types";var V=/(.+?)(=+)(.+)/,H=/name *= *('|")(.+?)('|")/,Q=/description *= *('|")(.+?)('|")/,P={supportedFiles:["requirements.txt"],ignoreDirs:["build","lib","lib64"],scanFunction:e=>{let n=R(e,"utf-8"),o=U(e),a=u(o).find(s=>s==="setup.py"),t=a?R(W(o,a),"utf-8"):void 0,p=t?(H.exec(t)||[])[2]:void 0,r=t?(Q.exec(t)||[])[2]:void 0,i=X({value:new RegExp(V,"g"),matches:["name","equals","version"]},n);return[{name:p||o.split("/").pop(),description:r||void 0,type:Y.RequirementsTxt,softwareDevelopmentKits:i.map(s=>({name:s.name,version:s.version}))}]}};import{readFileSync as G}from"fs";import{findAllWithRegex as z}from"@transcend-io/type-utils";import{dirname as B}from"path";import{CodePackageType as Z}from"@transcend-io/privacy-types";var ee=/gem *('|")(.+?)('|")(, *('|")(.+?)('|")|)/,ne=/spec\.name *= *('|")(.+?)('|")/,oe=/spec\.description *= *('|")(.+?)('|")/,te=/spec\.summary *= *('|")(.+?)('|")/,k={supportedFiles:["Gemfile"],ignoreDirs:["bin"],scanFunction:e=>{let n=G(e,"utf-8"),o=B(e),a=u(o).find(s=>s===".gemspec"),t=a?G(a,"utf-8"):void 0,p=t?(ne.exec(t)||[])[2]:void 0,r=t?(oe.exec(t)||te.exec(t)||[])[1]:void 0,i=z({value:new RegExp(ee,"g"),matches:["quote1","name","quote2","hasVersion","quote3","version","quote4"]},n);return[{name:p||o.split("/").pop(),description:r||void 0,type:Z.RequirementsTxt,softwareDevelopmentKits:i.map(s=>({name:s.name,version:s.version}))}]}};import{readFileSync as re}from"fs";import{CodePackageType as ie}from"@transcend-io/privacy-types";import se from"js-yaml";import{dirname as ae}from"path";function pe(e){return e.split(`
|
|
2
|
-
`).map(n=>{let o=n.indexOf("#");return o>-1&&!n.substring(0,o).includes('"')&&!n.substring(0,o).includes("'")?n.substring(0,o).trim():n}).filter(n=>n.length>0).join(`
|
|
3
|
-
`)}var v={supportedFiles:["pubspec.yml"],ignoreDirs:["build"],scanFunction:e=>{let n=ae(e),o=re(e,"utf-8"),{name:c,description:a,dev_dependencies:t={},dependencies:p={}}=se.load(pe(o));return[{name:c||n.split("/").pop(),description:a,type:ie.RequirementsTxt,softwareDevelopmentKits:[...Object.entries(p).map(([r,i])=>({name:r,version:typeof i=="string"?i:typeof i=="number"?i.toString():i?.sdk})),...Object.entries(t).map(([r,i])=>({name:r,version:typeof i=="string"?i:typeof i=="number"?i.toString():i?.sdk,isDevDependency:!0}))]}]}};import{readFileSync as ce}from"fs";import{dirname as me}from"path";var I={supportedFiles:["composer.json"],ignoreDirs:["vendor","node_modules","cache","build","dist"],scanFunction:e=>{let n=ce(e,"utf-8"),o=me(e),c=JSON.parse(n),{name:a,description:t,require:p={},"require-dev":r={}}=c;return[{name:a||o.split("/").pop(),description:t,softwareDevelopmentKits:[...Object.entries(p).map(([i,s])=>({name:i,version:typeof s=="string"?s:void 0})),...Object.entries(r).map(([i,s])=>({name:i,version:typeof s=="string"?s:void 0,isDevDependency:!0}))]}]}};import{readFileSync as de}from"fs";import{CodePackageType as ge}from"@transcend-io/privacy-types";import{decodeCodec as fe}from"@transcend-io/type-utils";import*as d from"io-ts";import{dirname as ue}from"path";var le=d.type({pins:d.array(d.type({identity:d.string,kind:d.string,location:d.string,state:d.type({revision:d.string,version:d.string})})),version:d.number}),D={supportedFiles:["Package.resolved"],ignoreDirs:[],scanFunction:e=>{let n=de(e,"utf-8"),o=fe(le,n);return[{name:ue(e).split("/").pop()||"",type:ge.CocoaPods,softwareDevelopmentKits:o.pins.map(c=>({name:c.identity,version:c.state.version}))}]}};import{CodePackageType as f}from"@transcend-io/privacy-types";var gn={cocoaPods:y,gradle:S,javascriptPackageJson:x,pythonRequirementsTxt:P,gemfile:k,pubspec:v,swift:D},_={[f.CocoaPods]:y,[f.Gradle]:S,[f.PackageJson]:x,[f.RequirementsTxt]:P,[f.Gemfile]:k,[f.Pubspec]:v,[f.ComposerJson]:I,[f.Swift]:D};import Ce from"fast-glob";import A from"colors";import{getEntries as Ee}from"@transcend-io/type-utils";async function Sn({scanPath:e,ignoreDirs:n=[],repositoryName:o}){return(await Promise.all(Ee(_).map(async([a,t])=>{let{ignoreDirs:p,supportedFiles:r,scanFunction:i}=t,s=[...n,...p].filter(m=>m.length>0);try{let m=await Ce(`${e}/**/${r.join("|")}`,{ignore:s.map(g=>`${e}/**/${g}`),unique:!0,onlyFiles:!0});E.info(A.magenta(`Scanning: ${m.length} files of type ${a}`));let C=m.map(g=>i(g).map(q=>({...q,relativePath:g.replace(`${e}/`,"")}))).flat();return E.info(A.green(`Found: ${C.length} packages and ${C.map(({softwareDevelopmentKits:g=[]})=>g).flat().length} sdks`)),C.map(g=>({...g,type:a,repositoryName:o}))}catch(m){throw new Error(`Error scanning globs ${r} with error: ${m}`)}}))).flat()}export{gn as a,Sn as b};
|