UNPKG

@jd-data-limited/easy-fm

Version:

easy-fm is a Node.js module that allows you to interact with a [FileMaker database stored](https://www.claris.com/filemaker/) on a [FileMaker server](https://www.claris.com/filemaker/server/). This module interacts with your server using the [FileMaker

39 lines (38 loc) 1.93 kB
import { Database } from './database.js'; import { type HostBase } from './HostBase.js'; import { type databaseOptionsWithExternalSources, type FMHostMetadata, type loginOptionsClaris, type loginOptionsFileMaker, type loginOptionsOAuth } from '../types.js'; import { type DatabaseStructure } from '../databaseStructure.js'; import { type Moment } from 'moment'; /** * Represents a FileMaker host. * @implements {HostBase} */ export default class FMHost implements HostBase { readonly hostname: string; readonly timezoneOffsetFunc: (moment: Moment) => number; readonly verify: boolean; readonly protocol: 'http:' | 'https:'; _metadata: FMHostMetadata | null; constructor(_hostname: string, timezoneOffset?: (moment: Moment) => number, verify?: boolean); get metadata(): FMHostMetadata; get dateFormat(): string; get timeFormat(): string; get timeStampFormat(): string; /** * Retrieves a list of databases from the FileMaker Server. * * @param {loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris} [credentials] - Optional credentials required for authentication. * @throws {FMError} If the request to the FileMaker Server fails or if the response contains an error. * @returns {Promise<any[]>} A promise that resolves to an array of database objects if successful. */ listDatabases(credentials?: loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris): Promise<any>; /** * Creates a new database connection with the specified options. * * @template T - The type of the database structure. * @param {databaseOptionsWithExternalSources} data - The options for the database, including external sources. * @return {Database<T>} A new Database instance. */ database<T extends DatabaseStructure>(data: databaseOptionsWithExternalSources): Database<T>; getMetadata(): Promise<FMHostMetadata>; }