import type { CheckConsentOutput, CheckConsentQuery, GetSubjectOutput, GetSubjectQuery, InitOutput, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput, StatusOutput } from '@c15t/schema/types'; import type { C15TClientOptions, FetchOptions, ResponseContext } from './types'; /** * C15T Client for interacting with the consent management API * * @example * ```typescript * const client = new C15TClient({ * baseUrl: 'https://api.example.com', * token: 'your-auth-token', * }); * * // Check API status * const statusResponse = await client.status(); * * // Initialize consent manager * const initResponse = await client.init(); * * // Create a subject with consent * const subject = await client.createSubject({ * type: 'new', * subjectId: 'sub_123', * consents: { analytics: true }, * }); * ``` */ export declare class C15TClient { /** * Internal fetcher context */ private context; /** * Creates a new C15T client instance * * @param options - Client configuration options * @throws {TypeError} If baseUrl is invalid or not provided (and no env var) */ constructor(options?: C15TClientOptions); /** * Get API status * * @param options - Optional fetch options * @returns Status response with version and client info */ status(options?: FetchOptions): Promise>; /** * Initialize consent manager * * @param options - Optional fetch options * @returns Init response with jurisdiction, location, translations, branding */ init(options?: FetchOptions): Promise>; /** * Create a new subject with consent preferences * * @param input - Subject creation input * @param options - Optional fetch options * @returns Created subject response */ createSubject(input: PostSubjectInput, options?: FetchOptions): Promise>; /** * Get a subject by ID * * @param id - Subject ID * @param query - Optional query parameters * @param options - Optional fetch options * @returns Subject data response */ getSubject(id: string, query?: GetSubjectQuery, options?: FetchOptions): Promise>; /** * Update a subject (link external ID or update preferences) * * @param id - Subject ID * @param input - Patch input with externalId or other fields * @param options - Optional fetch options * @returns Updated subject response */ patchSubject(id: string, input: Omit, options?: FetchOptions>): Promise>; /** * List subjects with optional filtering * * @param query - Query parameters for filtering * @param options - Optional fetch options * @returns List of subjects */ listSubjects(query?: ListSubjectsQuery, options?: FetchOptions): Promise>; /** * Check consent status for an external ID * * @param query - Query parameters (externalId required) * @param options - Optional fetch options * @returns Consent check response */ checkConsent(query: CheckConsentQuery, options?: FetchOptions): Promise>; /** * Make a custom API request to any endpoint * * @param path - API endpoint path * @param options - Fetch options * @returns Response context */ $fetch(path: string, options?: FetchOptions): Promise>; /** * Namespaced access to consent endpoints */ consent: { /** * Check consent status for an external ID */ check: (query: CheckConsentQuery, options?: FetchOptions) => Promise>; }; /** * Namespaced access to subject endpoints */ subjects: { /** * Create a new subject */ create: (input: PostSubjectInput, options?: FetchOptions) => Promise>; /** * Get a subject by ID */ get: (id: string, query?: GetSubjectQuery, options?: FetchOptions) => Promise>; /** * Update a subject */ patch: (id: string, input: Omit, options?: FetchOptions>) => Promise>; /** * List subjects */ list: (query?: ListSubjectsQuery, options?: FetchOptions) => Promise>; }; /** * Namespaced access to meta endpoints */ meta: { /** * Get API status */ status: (options?: FetchOptions) => Promise>; /** * Initialize consent manager */ init: (options?: FetchOptions) => Promise>; }; }