import{REDOCLY_TEAMS_RBAC as r}from"@redocly/config";import{getTemplatePath as l}from"./get-template-path.js";import{getDevOnboardingRbacConfig as o}from"./utils.js";const u="apigee-";async function m({contentDir:c}){return{id:"Developer Onboarding",requiredEntitlements:["devOnboarding"],async processContent(e,{getConfig:t}){const a=await t();if(!a.developerOnboarding)return;const n=e.createTemplate(u,l("./template/index.js"));e.addRoute({duplicateInAllLocales:!0,excludeFromSidebar:!0,slug:"/apps/",fsPath:"",templateId:n,hasClientRoutes:!0,[r]:a?.rbac&&o(a?.rbac),getNavText:()=>Promise.resolve("My Apps"),getStaticData:async()=>({props:{proxyUrl:"https://api.enterprise.apigee.com/v1/organizations/ORGNAME/apis",seo:{title:"My Apps"}}})})},async afterRoutesCreated(e){const t=e.getConfig();if(!t.developerOnboarding)return;const n=e.getGlobalData().userMenu||{},s={type:"link",link:"/apps/",label:"My Apps",[r]:t?.rbac&&o(t?.rbac),labelTranslationKey:"userMenu.devOnboardingLabel"},i=n?.menu||[],p={...n,menu:[...i,s]};e.setGlobalData({userMenu:p})}}}export{m as apiKeyMgmtPlugin};
