/** * 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 Spaces { 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 Spaces { protected readonly _options: Spaces.Options; constructor(_options?: Spaces.Options); /** * Returns all spaces for an account or environment * * @param {Flatfile.ListSpacesRequest} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * * @example * await client.spaces.list({ * environmentId: "us_env_YOUR_ID" * }) */ list(request?: Flatfile.ListSpacesRequest, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __list; /** * Creates a new space based on an existing Space Config * * @param {Flatfile.SpaceConfig} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.create({ * name: "My First Workbook", * displayOrder: 1, * environmentId: "us_env_YOUR_ID", * primaryWorkbookId: "us_wb_YOUR_ID" * }) */ create(request: Flatfile.SpaceConfig, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __create; /** * Returns a single space * * @param {Flatfile.SpaceId} spaceId - ID of space to return * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.get("us_sp_YOUR_ID") */ get(spaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __get; /** * Delete a space * * @param {Flatfile.SpaceId} spaceId - ID of space to delete * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.delete("us_sp_YOUR_ID") */ delete(spaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __delete; /** * Delete multiple spaces by id * * @param {Flatfile.DeleteSpacesRequest} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.bulkDelete({ * spaceIds: "us_sp_YOUR_ID" * }) */ bulkDelete(request: Flatfile.DeleteSpacesRequest, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __bulkDelete; /** * Update a space, to change the name for example * * @param {Flatfile.SpaceId} spaceId - ID of space to update * @param {Flatfile.SpaceConfig} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.update("us_sp_YOUR_ID", { * name: "My Updated Worbook" * }) */ update(spaceId: Flatfile.SpaceId, request: Flatfile.SpaceConfig, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __update; /** * Sets archivedAt timestamp on a space * * @param {Flatfile.SpaceId} spaceId - ID of space to archive * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.archiveSpace("us_sp_YOUR_ID") */ archiveSpace(spaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __archiveSpace; /** * Sets archivedAt timestamp on a space to null * * @param {Flatfile.SpaceId} spaceId - ID of space to unarchive * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.unarchiveSpace("us_sp_YOUR_ID") */ unarchiveSpace(spaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __unarchiveSpace; /** * @param {Flatfile.SpaceId} spaceId - ID of space to update * @param {Flatfile.UpgradeSpaceConfig} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.upgrade("spaceId", { * id: "id" * }) */ upgrade(spaceId: Flatfile.SpaceId, request: Flatfile.UpgradeSpaceConfig, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __upgrade; /** * Creates a new guidance * * @param {Flatfile.SpaceId} spaceId - ID of the space * @param {Flatfile.GuidanceApiCreateData} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.ForbiddenError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.createGuidance("us_sp_YOUR_ID", { * guideSlug: "getting-started", * options: { * target: "getting-started", * trigger: "first", * type: "sidebar", * role: "admin" * } * }) */ createGuidance(spaceId: Flatfile.SpaceId, request: Flatfile.GuidanceApiCreateData, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __createGuidance; /** * Lists guidances * * @param {Flatfile.SpaceId} spaceId - ID of the space * @param {Flatfile.ListGuidanceRequest} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.ForbiddenError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.listGuidance("us_sp_YOUR_ID", { * includeGuide: true * }) */ listGuidance(spaceId: Flatfile.SpaceId, request?: Flatfile.ListGuidanceRequest, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __listGuidance; /** * Retrieves a guidance by its id * * @param {Flatfile.SpaceId} spaceId - ID of the space * @param {Flatfile.GuidanceId} guidanceId - ID of the guidance * @param {Flatfile.GetGuidanceRequest} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.ForbiddenError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.getGuidance("us_sp_YOUR_ID", "us_gd_YOUR_ID", { * includeGuide: true * }) */ getGuidance(spaceId: Flatfile.SpaceId, guidanceId: Flatfile.GuidanceId, request?: Flatfile.GetGuidanceRequest, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __getGuidance; /** * Updates a guidance with the given id * * @param {Flatfile.SpaceId} spaceId - ID of the space * @param {Flatfile.GuidanceId} guidanceId - ID of the guidance * @param {Flatfile.GuidanceApiUpdateData} request * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.ForbiddenError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.updateGuidance("us_sp_YOUR_ID", "us_gd_YOUR_ID", { * options: { * target: "getting-started", * trigger: "first", * type: "sidebar", * role: "admin" * } * }) */ updateGuidance(spaceId: Flatfile.SpaceId, guidanceId: Flatfile.GuidanceId, request: Flatfile.GuidanceApiUpdateData, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __updateGuidance; /** * Deletes a guidance by its id * * @param {Flatfile.SpaceId} spaceId - ID of the space * @param {Flatfile.GuidanceId} guidanceId - ID of the guidance * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.ForbiddenError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.deleteGuidance("us_sp_YOUR_ID", "us_gd_YOUR_ID") */ deleteGuidance(spaceId: Flatfile.SpaceId, guidanceId: Flatfile.GuidanceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __deleteGuidance; /** * Creates a draft of a space * * @param {Flatfile.SpaceId} spaceId - ID of space to create draft of * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.createDraft("spaceId") */ createDraft(spaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __createDraft; /** * Lists drafts for a space * * @param {Flatfile.SpaceId} spaceId - ID of space to list drafts for * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.listSpaceDrafts("spaceId") */ listSpaceDrafts(spaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __listSpaceDrafts; /** * Gets a draft by the space id and draft space id * * @param {Flatfile.SpaceId} spaceId - ID of space to get draft for * @param {Flatfile.SpaceId} draftSpaceId - ID of draft space to get * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.getSpaceDraft("spaceId", "draftSpaceId") */ getSpaceDraft(spaceId: Flatfile.SpaceId, draftSpaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __getSpaceDraft; /** * Merges a draft into a space * * @param {Flatfile.SpaceId} spaceId - ID of space to merge draft into * @param {Flatfile.SpaceId} draftSpaceId - ID of draft space to merge * @param {Spaces.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.spaces.mergeDraft("spaceId", "draftSpaceId") */ mergeDraft(spaceId: Flatfile.SpaceId, draftSpaceId: Flatfile.SpaceId, requestOptions?: Spaces.RequestOptions): core.HttpResponsePromise; private __mergeDraft; protected _getAuthorizationHeader(): Promise; }