@api-buddy/types
Version:
Shared types for API Buddy
39 lines • 1.35 kB
TypeScript
import type { BaseAdapter } from './base.js';
import type { z } from 'zod';
/**
* Supported adapter types
*/
export declare enum AdapterType {
/** Authentication adapter (handles users, sessions, etc.) */
AUTH = "auth",
/** Database adapter (CRUD operations) */
DATABASE = "database",
/** Storage adapter (file storage) */
STORAGE = "storage",
/** Payment processing adapter */
PAYMENT = "payment"
}
/**
* Configuration for initializing an adapter
* @template T - Type of the configuration object
*/
export interface AdapterConfig<T = unknown> {
/** Type of adapter to create */
type: AdapterType;
/** Unique identifier for the adapter instance */
id: string;
/** Provider-specific configuration */
config: T;
}
/**
* Registry of all adapters by type
*/
export interface AdapterRegistry {
[AdapterType.AUTH]?: Map<string, BaseAdapter<unknown, z.ZodType, AdapterType.AUTH>>;
[AdapterType.DATABASE]?: Map<string, BaseAdapter<unknown, z.ZodType, AdapterType.DATABASE>>;
[AdapterType.STORAGE]?: Map<string, BaseAdapter<unknown, z.ZodType, AdapterType.STORAGE>>;
[AdapterType.PAYMENT]?: Map<string, BaseAdapter<unknown, z.ZodType, AdapterType.PAYMENT>>;
[key: string]: Map<string, BaseAdapter> | undefined;
}
export * from './base.js';
//# sourceMappingURL=types.d.ts.map