UNPKG

phonic

Version:

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPhonic-Co%2Fphonic-node) [![npm shield](htt

80 lines (79 loc) 3.19 kB
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs"; import * as core from "../../../../core/index.mjs"; import * as Phonic from "../../../index.mjs"; export declare namespace ApiKeysClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class ApiKeysClient { protected readonly _options: NormalizedClientOptionsWithAuth<ApiKeysClient.Options>; constructor(options?: ApiKeysClient.Options); /** * Creates a new API key in the workspace. * * @param {Phonic.CreateApiKeyRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Phonic.BadRequestError} * @throws {@link Phonic.UnauthorizedError} * @throws {@link Phonic.InternalServerError} * * @example * await client.apiKeys.create({ * name: "production-key" * }) */ create(request: Phonic.CreateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeyWithSecret>; private __create; /** * Deletes an API key. * * @param {string} id - The ID of the API key to delete. * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Phonic.UnauthorizedError} * @throws {@link Phonic.NotFoundError} * @throws {@link Phonic.InternalServerError} * * @example * await client.apiKeys.delete("id") */ delete(id: string, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeysDeleteResponse>; private __delete; /** * Updates an API key. * * @param {string} id - The ID of the API key to update. * @param {Phonic.UpdateApiKeyRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Phonic.BadRequestError} * @throws {@link Phonic.UnauthorizedError} * @throws {@link Phonic.NotFoundError} * @throws {@link Phonic.InternalServerError} * * @example * await client.apiKeys.update("id", { * name: "renamed-key" * }) */ update(id: string, request: Phonic.UpdateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeysUpdateResponse>; private __update; /** * Rotates an API key, generating a new secret and invalidating the old one. * * @param {string} id - The ID of the API key to rotate. * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Phonic.UnauthorizedError} * @throws {@link Phonic.NotFoundError} * @throws {@link Phonic.InternalServerError} * * @example * await client.apiKeys.rotate("id") */ rotate(id: string, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeyWithSecret>; private __rotate; }