import { client } from '../backend-api/index.js'; /** * Export the pre-configured client for use in the backoffice. This client will be used by generated SDK functions that include `security` metadata, and can also be used directly for custom API calls. * Note: This client is configured for cookie-based authentication and should only be used in the backoffice context where such authentication is applicable. For other contexts (e.g., public website), a different client configuration may be necessary. * Note: To use the 'auth' option to send a Bearer token, the call must specify a security scheme in the OpenAPI spec, and the generated SDK function must include `security` metadata, or you must specify a security scheme manually. Otherwise, the 'auth' option will not be applied to the request. * @example * ```js * umbHttpClient.get({ * url: '/some/protected/endpoint', * security: [{ type: 'http', scheme: 'bearer' }] // This tells the client to apply the 'auth' option * }).then(response => { * // handle response * }); * ``` */ export { client as umbHttpClient }; /** * Structural type representing any `@hey-api/openapi-ts` generated client. * * Each call to the generator produces a fully-bound `Client` * tied to that document's specific operation/options shapes, so the backoffice's * own `umbHttpClient` and the client in an extension package's `Client/src/api/` * are structurally identical but not assignable to each other under TypeScript's * variance rules. Use `UmbApiClient` on APIs (such as `UmbAuthContext.configureClient`) * that need to accept either. * * The shape only covers what those APIs touch — `setConfig`, `request`, and the * three interceptor middlewares — so callers retain meaningful autocomplete on the * concrete client they pass in, while we keep the public surface flexible. */ export type UmbApiClient = { setConfig: (config: any) => any; request: (options: any) => any; interceptors: { request: { use: (fn: any) => unknown; eject: (fn: any) => unknown; }; response: { use: (fn: any) => unknown; eject: (fn: any) => unknown; }; error: { use: (fn: any) => unknown; eject: (fn: any) => unknown; }; }; };