UNPKG

@zcatalyst/filestore

Version:

ZOHO CATALYST SDK for JavaScript Filestore for Node.js and Browser.

73 lines (72 loc) 2.5 kB
import { Handler } from '@zcatalyst/transport'; import { Folder, FolderAdmin, ICatalystFolderDetails } from './folder'; export declare class Filestore { requester: Handler; constructor(app?: unknown); /** * Retrieves the name of the component. * @returns The name of the component. */ getComponentName(): string; /** * Retrieves all folders in the file store. * @returns An array of Folder instances representing the folders. * @example * ```ts * const folders = await fileStore.getAllFolders(); * console.log(folders); * ``` */ getAllFolders(): Promise<Array<Folder>>; /** * Retrieves details of a specific folder. * @param id - The ID of the folder to retrieve. * @returns The details of the specified folder. * @throws {CatalystFileStoreError} If the folder ID is invalid. * @example * ```ts * const folderDetails = await fileStore.getFolderDetails(12345); * console.log(folderDetails); * ``` */ getFolderDetails(id: string): Promise<ICatalystFolderDetails>; /** * Returns an instance of the Folder class representing the specified folder. * @param id - The ID of the folder. * @returns A Folder instance representing the specified folder. * @throws {CatalystFileStoreError} If the folder ID is invalid. * @example * ```ts * const folder = fileStore.folder(12345); * console.log(folder); * ``` */ folder(id: string): Folder; } export declare class FilestoreAdmin extends Filestore { constructor(app?: unknown); /** * Creates a new folder in the file store. * @param name - The name of the folder to create. * @returns The details of the newly created folder. * @throws {CatalystFileStoreError} If the folder name is invalid. * @example * ```ts * const newFolder = await fileStore.createFolder('MyNewFolder'); * console.log(newFolder); * ``` */ createFolder(name: string): Promise<ICatalystFolderDetails>; /** * Returns an instance of the Folder class representing the specified folder. * @param id - The ID of the folder. * @returns A Folder instance representing the specified folder. * @throws {CatalystFileStoreError} If the folder ID is invalid. * @example * ```ts * const folder = fileStore.folder(12345); * console.log(folder); * ``` */ folder(id: string): FolderAdmin; }