import{AdapterFactory as s}from"../adapter-factory.js";import{CombineAdapter as p}from"../combine.js";const c=new s;function u(n,o,i){return async(e,d)=>{const t=e.get("auth");if(!t.isAuthenticated)return e.json({error:"Unauthorized"},401);const r=n.map(a=>c.getAdapter({config:a,catalogApiProducts:o,userClaims:t.claims,rbacConfig:i,idpAccessToken:t.idpAccessToken}));if(r.length===1)e.set("devOnboardingAdapter",r[0]);else{const a=new p(r);e.set("devOnboardingAdapter",a)}await d()}}export{u as integrationsMiddleware};
