import * as dntShim from "../../_dnt.shims.js";
const getEnv = (key) => {
    return dntShim.Deno.env.get(key);
};
const baseUrl = getEnv("BASE_INTERNAL_URL") ?? getEnv("BASE_URL") ?? "http://localhost:8000";
const baseUrlApi = (baseUrl ?? '') + "/api";
export class Interceptors {
    constructor() {
        Object.defineProperty(this, "_fns", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: void 0
        });
        this._fns = [];
    }
    eject(fn) {
        const index = this._fns.indexOf(fn);
        if (index !== -1) {
            this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
        }
    }
    use(fn) {
        this._fns = [...this._fns, fn];
    }
}
export const OpenAPI = {
    BASE: baseUrlApi,
    CREDENTIALS: 'include',
    ENCODE_PATH: undefined,
    HEADERS: undefined,
    PASSWORD: undefined,
    TOKEN: getEnv("WM_TOKEN"),
    USERNAME: undefined,
    VERSION: '1.612.0',
    WITH_CREDENTIALS: true,
    interceptors: {
        request: new Interceptors(),
        response: new Interceptors(),
    },
};
