"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTicketTrackerClient = createTicketTrackerClient;
exports.checkTicketTrackerWorkflowSchema = checkTicketTrackerWorkflowSchema;
exports.syncTicketTrackerWorkflowSchema = syncTicketTrackerWorkflowSchema;
const provider_resolution_1 = require("../provider-resolution");
async function createTicketTrackerClient(config, authProvider) {
    const { provider, projectRef } = (0, provider_resolution_1.resolveTicketTrackerProjectRef)(config.ticketTracker, config.i18n.defaultLanguage);
    return provider.createClient({
        ...config.ticketTracker,
        projectRef,
    }, authProvider, config.i18n.defaultLanguage);
}
async function checkTicketTrackerWorkflowSchema(config, authProvider) {
    const client = await createTicketTrackerClient(config, authProvider);
    return client.checkWorkflowSchema();
}
async function syncTicketTrackerWorkflowSchema(config, authProvider) {
    const client = await createTicketTrackerClient(config, authProvider);
    return client.ensureWorkflowSchema();
}
