import { AuthService } from "../auth/api/auth"; import { NewsletterService } from "../newsletter/api/newsletters"; import { OAuthService } from "../oauth/api/oauth"; import { ProfileService } from "../profile/api/profile"; import { ServicesService } from "../services/api/services"; import { SubscriptionsService } from "../ticketable/api/subscriptions"; import { TicketTransfersService } from "../ticketable/api/ticket-transfers"; import { TicketsService } from "../ticketable/api/tickets"; import { TransactionsService } from "../transaction/api/transactions"; import { BaseApiClient } from "./base-client"; import type { ServiceDependencies } from "./base-service"; /** * Standalone API client and services for use outside of Stencil components. * This module can be used in Node.js or any other JavaScript environment. * * @example * ```typescript * import { * StandaloneApiClient, * AuthService, * NewsletterService, * } from '@unidy.io/sdk/standalone'; * * // Create the API client * const client = new StandaloneApiClient({ * baseUrl: 'https://api.unidy.io', * apiKey: 'your-api-key', * }); * * // Create services with optional custom logger/error reporter * const auth = new AuthService(client, { * logger: console, * errorReporter: { captureException: (e) => myErrorTracker.capture(e) }, * }); * * // Use the services * const result = await auth.createSignIn({ payload: { email: 'user@example.com' } }); * ``` */ export type * from "../auth/api/auth"; export { AuthService } from "../auth/api/auth"; export type * from "../newsletter/api/newsletters"; export { NewsletterService } from "../newsletter/api/newsletters"; export type * from "../oauth/api/oauth"; export { OAuthService } from "../oauth/api/oauth"; export type * from "../profile/api/profile"; export { ProfileService } from "../profile/api/profile"; export type * from "../services/api/services"; export { ServicesService } from "../services/api/services"; export type * from "../ticketable/api/subscriptions"; export { SubscriptionsService } from "../ticketable/api/subscriptions"; export type * from "../ticketable/api/ticket-transfers"; export { TicketTransfersService } from "../ticketable/api/ticket-transfers"; export type * from "../ticketable/api/tickets"; export { TicketsService } from "../ticketable/api/tickets"; export type * from "../transaction/api/transactions"; export { TransactionsService } from "../transaction/api/transactions"; export type { ApiClientConfig, ApiResponse, QueryParams } from "./base-client"; export type { ApiClientInterface, CommonErrors, ErrorReporter, Logger, ServiceDependencies, ServiceResult, } from "./base-service"; export type { PaginationMeta, PaginationParams, SchemaValidationError } from "./shared"; /** * Standalone API client without browser-specific dependencies. * * This client provides the same interface as the browser ApiClient but without * dependencies on Sentry, i18n, localStorage, or other browser APIs. * * @example * ```typescript * import { StandaloneApiClient, AuthService } from '@unidy.io/sdk/standalone'; * * const client = new StandaloneApiClient({ * baseUrl: 'https://api.unidy.io', * apiKey: 'your-api-key', * }); * * const auth = new AuthService(client); * const result = await auth.createSignIn({ payload: { email: 'user@example.com' } }); * ``` */ export declare class StandaloneApiClient extends BaseApiClient { protected getRequestOptions(): RequestInit; protected handleConnectionError(_error: unknown, _endpoint: string, _method: string): void; } import type { ApiClientConfig } from "./base-client"; /** * Creates a standalone Unidy client with all services for use outside of Stencil. * * @example * ```typescript * import { createStandaloneClient } from '@unidy.io/sdk/standalone'; * * const client = createStandaloneClient({ * baseUrl: 'https://api.unidy.io', * apiKey: 'your-api-key', * // Optional: inject custom dependencies * deps: { * logger: myLogger, * errorReporter: { captureException: (e) => Sentry.captureException(e) }, * }, * }); * * const signIn = await client.auth.createSignIn({ payload: { email: 'user@example.com' } }); * ``` */ export interface StandaloneUnidyClientConfig extends ApiClientConfig { /** Optional dependencies to inject into all services */ deps?: ServiceDependencies; } export declare class StandaloneUnidyClient { auth: AuthService; newsletters: NewsletterService; oauth: OAuthService; profile: ProfileService; services: ServicesService; tickets: TicketsService; ticketTransfers: TicketTransfersService; subscriptions: SubscriptionsService; transactions: TransactionsService; constructor(config: StandaloneUnidyClientConfig); } export declare function createStandaloneClient(config: StandaloneUnidyClientConfig): StandaloneUnidyClient;