import { Pagination } from "./rest/get-query-params.js"; import { GraphQLServerError } from "./graphql/types.js"; /** * Configuration for making API requests to an ERP system. * apiUrl: The base URL of the ERP API. * getAuthToken: Function to get the authentication token. * For auth requests (like getting a new token), set this to empty string or null. * (Note that if the token is falsy (empty string, null, etc.), no Authorization header will be set.) * For all other requests, this should return a valid token. * The returned value will be used to construct the Authorization header as `Bearer ${token}`. */ export interface ERPApiConfig { apiUrl: string; getAuthToken: () => Promise; /** * Optional per-ERP-client retry attempts. * SDK defaults apply: see `CoreConfiguration.erpApiRetryAttempts` (or `ERP_API_RETRY_ATTEMPTS` env var). */ retryAttempts?: number; /** * Optional per-ERP-client timeout in seconds. * SDK defaults apply: see `CoreConfiguration.erpApiTimeoutSeconds` (or `ERP_API_TIMEOUT_SEC` env var). */ timeoutSeconds?: number; } /** * Base response type for all API responses */ export interface APIResponse { data: T; metadata?: { pagination?: Pagination; errors?: GraphQLServerError[]; extensions?: Record; }; }