rmapi-js
    Preparing search index...

    Class Batch

    files read through one client, of any items, to push or pull together

    add and extend refuse a file read through another client and a second copy of a file, when it is added. push writes every file's edits in one root write, all or none, and pull merges every file's edits onto the account's copy from one read of the root. A batch is pushed or pulled once. A client's pushAll and pullAll are shorthand for a batch of a list of files.

    const content = await client.content(document);
    const page = content.addPage("end");
    using blank = client.blankPage(document, page, "RM110");
    await client.batch().add(content).add(blank).push("merge");
    Index
    • add every file of files to the batch

      Parameters

      Returns this

      as add does, for the first file refused; the batch is then as it was before the call

    • read the account's copy of every file from one read of the root, and merge each file's edits onto it, to hold with its item's reference as the account lists it now; it writes nothing

      Returns Promise<void>

      NotFoundError if the account no longer lists an item, and a merge error as push does; a failed pull leaves every file and its reference as it was

    • write the edits of every file in one root write, all or none

      Each file must still be the one the account lists for its item. Each item written has its .metadata dated now, unless an edit of it in the batch set its date. A page, its layer names and its highlights may be of a page a .content in the batch adds. Once written, each file holds its item's new reference and what was written. A file with no edits writes nothing and is not checked: if the account's copy of it changed, it stays as it was. When the account's copy of a file with edits changed, onConflict says whether to fail, or to merge the edits onto the newer copy of each such file and write them all again.

      Parameters

      Returns Promise<void>

      NotFoundError if the account no longer lists an item, HashChangedError with the first such item if a file changed and onConflict is "fail" or the merges ran out, PageNotFoundError if a document does not list a page whose file was to be written, and ContentMergeError or MergeError if a merge failed; a failed push writes nothing and leaves every file and its reference as it was. Until this settles, an edit, a push or a pull of any file throws a PutRunningError.