import DataLoader from 'dataloader'; import JSONAPIData from '../util/json-api/JSONAPIData'; interface EnvoyWebDataLoaderKey extends JSONAPIData { include?: string; } /** * Options for configuring EnvoyAPI client */ export interface EnvoyAPIOptions { /** Access token for authentication */ accessToken: string; /** * Custom application identifier appended to User-Agent header. * Format: "AppName/Version" * Example: "MyCompanyApp/1.0.0" * * This identifier helps track API usage by application and aids in debugging. */ userAgent?: string; } /** * Make typed API calls to Envoy. * Uses a data loader to leverage JSONAPI's "include" functionality. * This allows us to save everything that was included in the initial response * to be used later without re-fetching from the API. * * @category Base */ export default class EnvoyAPI { /** * HTTP Client with Envoy's defaults. * User-Agent headers are set in the constructor after client instantiation. */ readonly axios: import("axios").AxiosInstance; /** * A dataloader: https://github.com/graphql/dataloader * Will fetch individual resources from the API, * unless they exist in cache (which they usually will). */ protected readonly dataLoader: DataLoader; /** * Create an EnvoyAPI client instance * * @param options - Either an access token string or an EnvoyAPIOptions object * with accessToken and optional userAgent * * @example * // Simple usage with access token only * const client = new EnvoyAPI('access-token-here'); * * @example * // Usage with custom User-Agent for tracking and debugging * const client = new EnvoyAPI({ * accessToken: 'access-token-here', * userAgent: 'MyApp/1.0.0' * }); */ constructor(options: EnvoyAPIOptions | string); } export {}; //# sourceMappingURL=EnvoyAPI.d.ts.map