import stampit from 'stampit'; import { NotImplementedError } from '@swagger-api/apidom-error'; import Resolver from "./Resolver.mjs"; import * as url from "../../util/url.mjs"; const HttpResolver = stampit(Resolver, { props: { timeout: 5000, redirects: 5, withCredentials: false }, init({ timeout = this.timeout, redirects = this.redirects, withCredentials = this.withCredentials } = {}) { this.timeout = timeout; this.redirects = redirects; this.withCredentials = withCredentials; }, methods: { canRead(file) { return url.isHttpUrl(file.uri); }, async read() { throw new NotImplementedError('read method in HttpResolver stamp is not yet implemented.'); }, getHttpClient() { throw new NotImplementedError('getHttpClient method in HttpResolver stamp is not yet implemented.'); } } }); export default HttpResolver;