@altostra/core
Version:
Core library for shared types and logic
1 lines • 901 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.getApiUtils=void 0;const TransformError_1=require("../../../../../aws/Transformer/Errors/TransformError"),ApiEndpoint_1=require("../../../Validations/Resources/ApiEndpoint"),common_1=require("../common");function getApiUtils(r,n){return Object.assign({},(0,common_1.getWebApiResourceUtils)({blueprint:r,api:n,endpointTypes:["resource.api.endpoint","resource.api.proxy-endpoint"],endpointsValidation:(r,n,i)=>{!function(){const r=[...(0,ApiEndpoint_1.getDuplicateEndpoints)(i())];if(r.length>0)throw new TransformError_1.TransformError("Api has duplicated endpoint",{duplicates:r})}(),function(){const r=[...(0,ApiEndpoint_1.getConflictingPathParams)(i())];if(r.length>0)throw new TransformError_1.TransformError("Api has endpoints with conflicting path parameter names.",{conflicts:r})}()}}))}exports.getApiUtils=getApiUtils;