Frodo Library - v5.0.0-36
    Preparing search index...

    Type Alias Server

    type Server = {
        createServer(serverData: ServerSkeleton): Promise<ServerSkeleton>;
        createServerExportTemplate(): ServerExportInterface;
        exportServer(
            serverId: string,
            options: ServerExportOptions,
        ): Promise<ServerExportInterface>;
        exportServerByUrl(
            serverUrl: string,
            options: ServerExportOptions,
        ): Promise<ServerExportInterface>;
        exportServers(
            options: ServerExportOptions,
            resultCallback?: ResultCallback<ServerExportSkeleton>,
        ): Promise<ServerExportInterface>;
        importFirstServer(
            importData: ServerExportInterface,
            options: ServerImportOptions,
        ): Promise<ServerExportInterface>;
        importServers(
            importData: ServerExportInterface,
            options: ServerImportOptions,
            serverId?: string,
            serverUrl?: string,
            resultCallback?: ResultCallback<ServerExportSkeleton>,
        ): Promise<ServerExportInterface>;
        readServer(serverId: string): Promise<ServerSkeleton>;
        readServerByUrl(serverUrl: string): Promise<ServerSkeleton>;
        readServers(): Promise<ServerSkeleton[]>;
    }
    Index
    • Export all servers. The response can be saved to file as is. Every server is tried: a server that cannot be read does not stop the others.

      Parameters

      • options: ServerExportOptions

        Server export options

      • OptionalresultCallback: ResultCallback<ServerExportSkeleton>

        Optional callback to process individual results. When given, the outcome of every server is passed to it as it happens: a server that was exported as the server, a server that cannot be exported as an error that names its url and id and carries the cause (also the default properties, when they were asked for and cannot be read, as an error that names them). Such a server is left out of the export and does not stop the others, and the function does not throw for it. Without it, the failures are collected and thrown as one error after every server was tried. Failing to list the servers always throws.

      Returns Promise<ServerExportInterface>

      Promise resolving to a ServerExportInterface object.

      If the servers cannot be listed (always), or if any server cannot be exported and there is no result callback. The error carries one nested error per failed server, naming its id and url, and nothing is returned.

    • Imports servers along with their properties

      Parameters

      • importData: ServerExportInterface

        server import data

      • options: ServerImportOptions

        server import options

      • OptionalserverId: string

        Optional server id. If supplied, only the server (and its properties) of that id is imported. Takes priority over serverUrl if both are provided.

      • OptionalserverUrl: string

        Optional server url. If supplied, only the server of that url is imported.

      • OptionalresultCallback: ResultCallback<ServerExportSkeleton>

        Optional callback to process individual results. When given, the outcome of every server that is imported is passed to it once, as it happens: a server that was imported as the server with its properties, a server that cannot be imported as an error that names its url and id and carries the cause (also the default properties, when they were asked for and cannot be imported, as an error that names them). Such a server is not part of the result and does not stop the others, and the function does not throw for it. Without it, the failures are collected and thrown as one error after every server was tried.

      Returns Promise<ServerExportInterface>

      a promise that resolves to a server export object