/** * 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 Environments { 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 Environments { protected readonly _options: Environments.Options; constructor(_options?: Environments.Options); /** * Get all environments * * @param {Flatfile.ListEnvironmentsRequest} request * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.environments.list() */ list(request?: Flatfile.ListEnvironmentsRequest, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __list; /** * Create a new environment * * @param {Flatfile.EnvironmentConfigCreate} request * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.environments.create({ * name: "dev", * isProd: false, * guestAuthentication: ["magic_link"], * metadata: { * "key": "value" * }, * namespaces: ["default"] * }) */ create(request: Flatfile.EnvironmentConfigCreate, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __create; /** * Get a token which can be used to subscribe to events for this environment * * @param {Flatfile.GetEnvironmentEventTokenRequest} request * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.getEnvironmentEventToken({ * environmentId: "us_env_YOUR_ID" * }) */ getEnvironmentEventToken(request: Flatfile.GetEnvironmentEventTokenRequest, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __getEnvironmentEventToken; /** * Returns a single environment * * @param {string} environmentId - ID of the environment to return. To fetch the current environment, pass `current` * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.get("us_env_YOUR_ID") */ get(environmentId: string, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __get; /** * Updates a single environment, to change the name for example * * @param {string} environmentId - ID of the environment to update * @param {Flatfile.EnvironmentConfigUpdate} request * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.environments.update("us_env_YOUR_ID", { * name: "dev", * isProd: false, * guestAuthentication: ["magic_link"], * metadata: { * "key": "value" * }, * namespaces: ["default"] * }) */ update(environmentId: string, request: Flatfile.EnvironmentConfigUpdate, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __update; /** * Deletes a single environment * * @param {string} environmentId - ID of the environment to delete * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.delete("us_env_YOUR_ID") */ delete(environmentId: string, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __delete; /** * Returns guides in an account * * @param {Flatfile.EnvironmentId} environmentId - ID of the environment * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.listGuides("us_env_YOUR_ID") */ listGuides(environmentId: Flatfile.EnvironmentId, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __listGuides; /** * Returns a guide * * @param {Flatfile.EnvironmentId} environmentId - ID of the environment * @param {Flatfile.GuideId} guideId - ID of guide * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.getGuide("us_env_YOUR_ID", "us_gu_YOUR_ID") */ getGuide(environmentId: Flatfile.EnvironmentId, guideId: Flatfile.GuideId, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __getGuide; /** * Updates a guide * * @param {Flatfile.EnvironmentId} environmentId - ID of the environment * @param {Flatfile.GuideId} guideId - ID of guide * @param {Flatfile.GuideUpdateRequest} request * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.updateGuide("us_env_YOUR_ID", "us_gu_YOUR_ID", { * description: "Updated getting started guide", * title: "Data import made easy", * slug: "getting-started", * environmentId: "commons.EnvironmentId", * metadata: { * "category": "onboarding" * } * }) */ updateGuide(environmentId: Flatfile.EnvironmentId, guideId: Flatfile.GuideId, request: Flatfile.GuideUpdateRequest, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __updateGuide; /** * Creates a guide * * @param {Flatfile.EnvironmentId} environmentId - ID of the environment * @param {Flatfile.GuideCreateRequest} request * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.createGuide("us_env_YOUR_ID", { * description: "Getting started guide", * title: "Data import made easy", * slug: "getting-started", * environmentId: "commons.EnvironmentId", * blocks: [], * metadata: { * "category": "onboarding" * } * }) */ createGuide(environmentId: Flatfile.EnvironmentId, request: Flatfile.GuideCreateRequest, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __createGuide; /** * Deletes a guide * * @param {Flatfile.EnvironmentId} environmentId - ID of the environment * @param {Flatfile.GuideId} guideId - ID of guide to delete * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.deleteGuide("us_env_YOUR_ID", "us_gu_YOUR_ID") */ deleteGuide(environmentId: Flatfile.EnvironmentId, guideId: Flatfile.GuideId, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __deleteGuide; /** * Returns a specified version of a specific guide * * @param {Flatfile.EnvironmentId} environmentId - ID of the environment * @param {Flatfile.GuideId} guideId - ID of the guide * @param {number} version - Version of the guide * @param {Environments.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.environments.getGuideVersion("us_env_YOUR_ID", "us_gu_YOUR_ID", 1) */ getGuideVersion(environmentId: Flatfile.EnvironmentId, guideId: Flatfile.GuideId, version: number, requestOptions?: Environments.RequestOptions): core.HttpResponsePromise; private __getGuideVersion; protected _getAuthorizationHeader(): Promise; }