export * from "./service.js";
export * from "./types.js";
import { ScheduleService, } from "./service.js";
import { getServiceUrls } from '@agentuity/config';
import { createServiceAdapter, isLogger, resolveApiKey, resolveRegion, resolveServiceUrl, } from '@agentuity/client';
import { z } from 'zod';
export const ScheduleClientOptionsSchema = z.object({
    apiKey: z.string().optional().describe('API key for authentication'),
    url: z.string().optional().describe('Base URL for the Schedule API'),
    orgId: z.string().optional().describe('Organization ID for multi-tenant operations'),
    logger: z.custom(isLogger).optional().describe('Custom logger instance'),
});
export class ScheduleClient {
    #service;
    constructor(options = {}) {
        const validatedOptions = ScheduleClientOptionsSchema.parse(options);
        const serviceUrls = getServiceUrls(resolveRegion());
        const url = resolveServiceUrl({
            url: validatedOptions.url,
            envKey: 'AGENTUITY_SCHEDULE_URL',
            fallback: serviceUrls.catalyst,
        });
        const { adapter } = createServiceAdapter({
            apiKey: resolveApiKey(validatedOptions.apiKey),
            orgId: validatedOptions.orgId,
            logger: validatedOptions.logger,
        });
        this.#service = new ScheduleService(url, adapter);
    }
    async create(params) {
        return this.#service.create(params);
    }
    async list(params) {
        return this.#service.list(params);
    }
    async get(scheduleId) {
        return this.#service.get(scheduleId);
    }
    async update(scheduleId, params) {
        return this.#service.update(scheduleId, params);
    }
    async delete(scheduleId) {
        return this.#service.delete(scheduleId);
    }
    async createDestination(scheduleId, params) {
        return this.#service.createDestination(scheduleId, params);
    }
    async deleteDestination(destinationId) {
        return this.#service.deleteDestination(destinationId);
    }
    async listDeliveries(scheduleId, params) {
        return this.#service.listDeliveries(scheduleId, params);
    }
}
//# sourceMappingURL=index.js.map