import type { CredentialValidators, ProviderExecutors } from "../../core/types.ts";

import { defineApiKeyProviderExecutors } from "../provider-runtime.ts";
import { validateYuandianCredential, yuandianActionHandlers } from "./runtime.ts";

const service = "yuandian";

export const executors: ProviderExecutors = defineApiKeyProviderExecutors(service, yuandianActionHandlers);

export const credentialValidators: CredentialValidators = {
  apiKey(input, { fetcher, signal }) {
    return validateYuandianCredential(input.apiKey, fetcher, signal);
  },
};
