UNPKG

@flatfile/safe-api

Version:

Flatfile Safe API client with streaming capabilities

36 lines (35 loc) 1.74 kB
import { FlatfileClient, Flatfile } from '@flatfile/api'; import { BulkCreateWorkbookConfig, BulkUpdateLockStatus } from '../streaming/workbooks'; import { Simplified } from '@flatfile/util-common'; import { RetryOptions } from '../utils/requests/safe.request'; interface LockOptions { sheetId?: string; spaceId?: string; } export type EnhancedWorkbooks = FlatfileClient['workbooks'] & { get(workbookId: string, options?: RetryOptions): Promise<Flatfile.Workbook>; list(opts?: Flatfile.ListWorkbooksRequest, options?: RetryOptions): Promise<{ data: Flatfile.Workbook[]; }>; update(workbookId: string, data: Flatfile.WorkbookUpdate, options?: RetryOptions): Promise<Flatfile.Workbook>; create(config: Flatfile.CreateWorkbookConfig, options?: RetryOptions): Promise<Flatfile.Workbook>; bulk: { create(config: BulkCreateWorkbookConfig, options?: RetryOptions): Promise<Array<{ success: true; workbookId: string; } | { success: false; error: string; }>>; setLockStatus(config: BulkUpdateLockStatus): Promise<any>; lock(workbookIds: string[], options?: LockOptions): Promise<any>; unlock(workbookIds: string[], options?: LockOptions): Promise<any>; }; sheets(workbook: Flatfile.Workbook): Flatfile.Sheet[]; sheet(workbook: Flatfile.Workbook, nameOrSlug: string): Flatfile.Sheet; records(sheetId: string): ReturnType<typeof Simplified.getAllRecordsSeries>; lock(workbookId: string, options?: LockOptions): Promise<any>; unlock(workbookId: string, options?: LockOptions): Promise<any>; }; export declare function getWorkbooksExtension(client: FlatfileClient): EnhancedWorkbooks; export {};