/** * 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"; import * as stream from "stream"; export declare namespace Sheets { 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 Sheets { protected readonly _options: Sheets.Options; constructor(_options?: Sheets.Options); /** * Returns sheets in a workbook * * @param {Flatfile.ListSheetsRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.sheets.list({ * workbookId: "us_wb_YOUR_ID" * }) */ list(request: Flatfile.ListSheetsRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __list; /** * Returns a sheet in a workbook * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.sheets.get("us_sh_YOUR_ID") */ get(sheetId: Flatfile.SheetId, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __get; /** * Deletes a specific sheet from a workbook * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.delete("us_sh_YOUR_ID") */ delete(sheetId: Flatfile.SheetId, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __delete; /** * Creates a copy of a sheet including all its data within the same workbook * * @param {Flatfile.SheetId} sheetId - ID of sheet to duplicate * @param {Flatfile.DuplicateSheetRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.duplicateSheet("us_sh_YOUR_ID", { * name: "Copy of Contacts", * slug: "contacts-copy" * }) */ duplicateSheet(sheetId: Flatfile.SheetId, request?: Flatfile.DuplicateSheetRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __duplicateSheet; /** * Trigger data hooks and validation to run on a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.validate("us_sh_YOUR_ID") */ validate(sheetId: Flatfile.SheetId, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __validate; /** * Returns records from a sheet in a workbook as a csv file */ getRecordsAsCsv(sheetId: Flatfile.SheetId, request?: Flatfile.GetRecordsCsvRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __getRecordsAsCsv; /** * Returns counts of records from a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Flatfile.GetRecordCountsRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.sheets.getRecordCounts("us_sh_YOUR_ID", { * versionId: "us_vr_YOUR_ID" * }) */ getRecordCounts(sheetId: Flatfile.SheetId, request?: Flatfile.GetRecordCountsRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __getRecordCounts; /** * Returns all calculations for a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Flatfile.GetCalculationsRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.getCalculations("sheetId") */ getCalculations(sheetId: Flatfile.SheetId, request?: Flatfile.GetCalculationsRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __getCalculations; /** * Adds a new field to a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Flatfile.CreateFieldRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.addField("sheetId", { * body: { * type: "string", * key: "key" * } * }) */ addField(sheetId: Flatfile.SheetId, request: Flatfile.CreateFieldRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __addField; /** * Removes field from a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {string} fieldKey - Unique field key * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.removeField("sheetId", "fieldKey") */ removeField(sheetId: Flatfile.SheetId, fieldKey: string, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __removeField; /** * Returns the commit versions for a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Flatfile.ListSheetCommitsRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.sheets.getSheetCommits("us_sh_YOUR_ID") */ getSheetCommits(sheetId: Flatfile.SheetId, request?: Flatfile.ListSheetCommitsRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __getSheetCommits; /** * Locks a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.lockSheet("us_sh_YOUR_ID") */ lockSheet(sheetId: Flatfile.SheetId, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __lockSheet; /** * Removes a lock from a sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.unlockSheet("us_sh_YOUR_ID") */ unlockSheet(sheetId: Flatfile.SheetId, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __unlockSheet; /** * Returns record cell values grouped by all fields in the sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Flatfile.GetFieldValuesRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.sheets.getCellValues("us_sh_YOUR_ID", { * distinct: true, * fieldKey: "firstName", * sortField: "firstName", * sortDirection: "asc", * filter: "valid" * }) */ getCellValues(sheetId: Flatfile.SheetId, request: Flatfile.GetFieldValuesRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __getCellValues; /** * Updates Sheet * * @param {Flatfile.SheetId} sheetId - ID of sheet * @param {Flatfile.SheetUpdateRequest} request * @param {Sheets.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.sheets.updateSheet("us_sh_YOUR_ID", { * name: "New Sheet Name", * metadata: { * "rowHeaders": [ * 6 * ] * } * }) */ updateSheet(sheetId: Flatfile.SheetId, request: Flatfile.SheetUpdateRequest, requestOptions?: Sheets.RequestOptions): core.HttpResponsePromise; private __updateSheet; protected _getAuthorizationHeader(): Promise; }