"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getHref=exports.getOperationsItems=void 0;const utils_1=require("../../utils");function getOperationsItems(e,t,r){if(0===t.operations.length)return[];const o=[],s=[];for(const i of t.operations){const t=(0,utils_1.getOperationId)(i,e),p={id:t,type:"operation",parent:e,operationDefinition:i,depth:r,name:(0,utils_1.getOperationName)(i),httpVerb:i.httpVerb,path:i.pathName,items:[],isWebhook:i.isWebhook,operationId:i.operationId,badges:i["x-badges"]||[],href:getHref({id:t}),deprecated:!!i.deprecated};i.isWebhook?s.push(p):o.push(p)}return[...o.sort(((e,t)=>Number(e.deprecated)-Number(t.deprecated))),...s.sort(((e,t)=>Number(e.deprecated)-Number(t.deprecated)))]}function getHref({id:e}){return(0,utils_1.encodeBackSlashes)(`/${e}`.toLowerCase())}exports.getOperationsItems=getOperationsItems,exports.getHref=getHref;
//# sourceMappingURL=operation.js.map