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

import { defineApiKeyProviderExecutors } from "../provider-runtime.ts";
import { retentlyActionHandlers, validateRetentlyCredential } from "./runtime.ts";

const service = "retently";

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

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