UNPKG

@proofkit/fmdapi

Version:
27 lines (26 loc) 957 B
import { BaseFetchAdapter } from './fetch-base.js'; import { BaseFetchAdapterOptions } from './fetch-base-types.js'; export type Otto3APIKey = `KEY_${string}`; export type OttoFMSAPIKey = `dk_${string}`; export type OttoAPIKey = Otto3APIKey | OttoFMSAPIKey; export declare function isOtto3APIKey(key: string): key is Otto3APIKey; export declare function isOttoFMSAPIKey(key: string): key is OttoFMSAPIKey; export declare function isOttoAPIKey(key: string): key is OttoAPIKey; export declare function isOttoAuth(auth: unknown): auth is OttoAuth; type OttoAuth = { apiKey: Otto3APIKey; ottoPort?: number; } | { apiKey: OttoFMSAPIKey; ottoPort?: never; }; export type OttoAdapterOptions = BaseFetchAdapterOptions & { auth: OttoAuth; }; export declare class OttoAdapter extends BaseFetchAdapter { private apiKey; private port; constructor(options: OttoAdapterOptions); protected getToken: () => Promise<string>; } export {};