/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Flatfile from "../../../index"; export declare namespace Auth { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; token?: core.Supplier; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; /** Additional headers to include in the request. */ headers?: Record; } } export declare class Auth { protected readonly _options: Auth.Options; constructor(_options?: Auth.Options); /** * Exchange credentials for an access token. Credentials can be a Client ID and Secret or an Email and Password * * @param {Flatfile.Credentials} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.createAccessToken({ * type: "userCredentials", * email: "yourEmail@example.com", * password: "yourSuper$ecurePassw0rd" * }) */ createAccessToken(request: Flatfile.Credentials, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __createAccessToken; /** * @param {Flatfile.GetApiKeysRequest} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.getApiKeys({ * environmentId: "us_env_YOUR_ID" * }) */ getApiKeys(request: Flatfile.GetApiKeysRequest, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __getApiKeys; /** * @param {Flatfile.GetPublishableKeyRequest} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.getPublishableKey({ * environmentId: "us_env_YOUR_ID" * }) */ getPublishableKey(request: Flatfile.GetPublishableKeyRequest, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __getPublishableKey; /** * @param {Flatfile.CreateNewApiKeyRequest} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.createNewApiKey({ * environmentId: "us_env_YOUR_ID", * type: "PUBLISHABLE" * }) */ createNewApiKey(request: Flatfile.CreateNewApiKeyRequest, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __createNewApiKey; /** * @param {Flatfile.DeleteApiKeyRequest} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.deleteApiKey({ * environmentId: "us_env_YOUR_ID", * key: "us_key_YOUR_ID" * }) */ deleteApiKey(request: Flatfile.DeleteApiKeyRequest, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __deleteApiKey; /** * @param {string} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.refreshToken("string") */ refreshToken(request: string, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __refreshToken; /** * @param {Flatfile.GetSftpCredentialsRequest} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.getSftpCredentials({ * spaceId: "spaceId" * }) */ getSftpCredentials(request: Flatfile.GetSftpCredentialsRequest, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __getSftpCredentials; /** * List all personal access tokens for the authenticated user * * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.listPersonalAccessTokens() */ listPersonalAccessTokens(requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __listPersonalAccessTokens; /** * Create a new personal access token for the authenticated user * * @param {Flatfile.CreatePersonalAccessTokenRequest} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * * @example * await client.auth.createPersonalAccessToken({ * name: "name" * }) */ createPersonalAccessToken(request: Flatfile.CreatePersonalAccessTokenRequest, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __createPersonalAccessToken; /** * Delete a specific personal access token by ID * * @param {Flatfile.PersonalAccessTokenId} accessTokenId - ID of the personal access token to delete * @param {Flatfile.DeletePersonalAccessTokenRequest} request * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.auth.deletePersonalAccessToken("accessTokenId") */ deletePersonalAccessToken(accessTokenId: Flatfile.PersonalAccessTokenId, request?: Flatfile.DeletePersonalAccessTokenRequest, requestOptions?: Auth.RequestOptions): core.HttpResponsePromise; private __deletePersonalAccessToken; protected _getAuthorizationHeader(): Promise; }