zdata-client
Version:
TypeScript client library for zdata backend API with authentication and full CRUD operations
53 lines • 2.01 kB
TypeScript
/**
* @fileoverview zdata-client - TypeScript client library for zdata backend API
*
* A modern, type-safe client library providing authentication and full CRUD operations
* for the zdata backend API with comprehensive error handling and developer experience.
*
* @version 1.0.0
* @author zdata-client
* @license MIT
*/
export { ZDataClient, ExternalApiClient, } from "./client.js";
export { BaseDataSourceClient, DataSourceClient } from "./base-client.js";
export type { ApiConfig, FindRecordsParams, LoginRequest, RegisterRequest, AuthResponse, User, PaginatedResponse, PaginationMeta, BaseEntity, CreateEntity, EntityWithBase, ApiError, ValidationErrorDetail, IApiClient, } from "./types.js";
export { ApiClientError, InvalidCredentialsError, ValidationError, isApiClientError, isInvalidCredentialsError, isValidationError, } from "./types.js";
import { ZDataClient } from "./client.js";
import type { ApiConfig } from "./types.js";
/**
* Factory function to create a new zdata API client instance
*
* This is a convenience function that provides an alternative way to instantiate
* the client without using the `new` keyword.
*
* @param config - Client configuration options
* @returns A new ZDataClient instance
* @throws {Error} When configuration is invalid
*
* @example
* ```typescript
* import { createClient } from 'zdata-client';
*
* const client = createClient({
* baseUrl: 'https://api.example.com',
* workspaceId: 'workspace-123'
* });
*
* await client.login({ email: 'user@example.com', password: 'password' });
* ```
*/
export declare function createClient(config: ApiConfig): ZDataClient;
/**
* Legacy factory function name for backward compatibility
* @deprecated Use createClient instead
*/
export declare const createApiClient: typeof createClient;
/**
* Current version of the zdata-client library
*/
export declare const VERSION = "1.0.0";
/**
* Default export - ZDataClient class
*/
export default ZDataClient;
//# sourceMappingURL=index.d.ts.map