Interface to perform BASIS Rest API operations.

interface DominoBasisRestSession {
    bulkCreateDocuments: (
        dataSource: string,
        docs: DocumentJSON[],
        richTextAs?: string,
    ) => Promise<DominoDocument[]>;
    bulkDeleteDocuments: (
        dataSource: string,
        docs: DominoDocument[],
        mode?: string,
    ) => Promise<DocumentStatusResponse[]>;
    bulkDeleteDocumentsByUNID: (
        dataSource: string,
        unids: string[],
        mode?: string,
    ) => Promise<DocumentStatusResponse[]>;
    bulkGetDocuments: (
        dataSource: string,
        unids: string[],
        options?: BulkGetDocumentsOptions,
    ) => Promise<(DominoDocument | BulkGetErrorResponse)[]>;
    bulkUpdateDocumentsByQuery: (
        dataSource: string,
        request: BulkUpdateDocumentsByQueryRequest,
        richTextAs?: string,
    ) => Promise<DominoDocument[] | DocumentStatusResponse[]>;
    createDocument: (
        dataSource: string,
        doc: DocumentJSON,
        options?: CreateDocumentOptions,
    ) => Promise<DominoDocument>;
    deleteDocument: (
        dataSource: string,
        doc: DominoRestDocument,
        mode?: string,
    ) => Promise<DocumentStatusResponse>;
    deleteDocumentByUNID: (
        dataSource: string,
        unid: string,
        mode?: string,
    ) => Promise<DocumentStatusResponse>;
    dominoAccess: DominoRestAccess;
    dominoConnector: DominoRestConnector;
    getDocument: (
        dataSource: string,
        unid: string,
        options?: GetDocumentOptions,
    ) => Promise<DominoDocument>;
    getDocumentsByQuery: (
        dataSource: string,
        request: GetDocumentsByQueryRequest,
        action: QueryActions,
        options?: GetDocumentsByQueryOptions,
    ) => Promise<
        | DominoDocument[]
        | QueryDocumentExplainResponse[]
        | QueryDocumentParseResponse[],
    >;
    getListViewEntry: (
        dataSource: string,
        listViewName: string,
        options?: GetListViewEntryOptions,
    ) => Promise<void | DominoDocument[] | ListViewEntryJSON[]>;
    getListViewPivotEntry: (
        dataSource: string,
        listViewName: string,
        pivotColumn: string,
        options?: GetListPivotViewEntryOptions,
    ) => Promise<PivotListViewResponse>;
    getListViews: (
        dataSource: string,
        options?: GetListViewOptions,
    ) => Promise<GetListViewJSON[]>;
    getRichtext: (
        dataSource: string,
        unid: string,
        richTextAs: string,
        options?: GetRichtextOptions,
    ) => Promise<string>;
    patchDocument: (
        dataSource: string,
        unid: string,
        docJsonPatch: DocumentBody,
        options?: UpdateDocumentOptions,
    ) => Promise<DominoDocument>;
    updateDocument: (
        dataSource: string,
        doc: DominoRestDocument,
        options?: UpdateDocumentOptions,
    ) => Promise<DominoDocument>;
}

Implemented by

Properties

bulkCreateDocuments: (
    dataSource: string,
    docs: DocumentJSON[],
    richTextAs?: string,
) => Promise<DominoDocument[]>

Create documents with the provided document JSONs. Richtext return format can be specified (defaults to mime if not given).

Type declaration

    • (
          dataSource: string,
          docs: DocumentJSON[],
          richTextAs?: string,
      ): Promise<DominoDocument[]>
    • Parameters

      • dataSource: string

        the scope name

      • docs: DocumentJSON[]

        an array of JSON containing document data to be saved

      • OptionalrichTextAs: string

        the format which richtext fields will be returned as (defaults to mime if not given)

      Returns Promise<DominoDocument[]>

      a promise that resolves to an array of created documents.

an error if given array of document JSON is empty.

bulkDeleteDocuments: (
    dataSource: string,
    docs: DominoDocument[],
    mode?: string,
) => Promise<DocumentStatusResponse[]>

Delete all given DominoDocument in the given array. A mode can be provided if the operation needs to be done on other modes (default mode is default).

Type declaration

an error if given documents array is empty.

an error if one of given documents has empty UNID.

an error if one of given documents has invalid UNID.

bulkDeleteDocumentsByUNID: (
    dataSource: string,
    unids: string[],
    mode?: string,
) => Promise<DocumentStatusResponse[]>

Delete all documents pointed by the given UNIDs. A mode can be provided if the operation needs to be done on other modes (default mode is default).

Type declaration

    • (
          dataSource: string,
          unids: string[],
          mode?: string,
      ): Promise<DocumentStatusResponse[]>
    • Parameters

      • dataSource: string

        the scope name

      • unids: string[]

        an array of UNIDs of the documents to be deleted.

      • Optionalmode: string

        the mode to perform the document access in. Defaults to default if missing

      Returns Promise<DocumentStatusResponse[]>

      a promise that resolves to an array of document status response.

an error if given UNIDs array is empty.

an error if one of given UNIDs is empty.

an error if one of given UNIDs is invalid.

bulkGetDocuments: (
    dataSource: string,
    unids: string[],
    options?: BulkGetDocumentsOptions,
) => Promise<(DominoDocument | BulkGetErrorResponse)[]>

Get all documents pointed by the given UNIDs. Additional request options can be given.

Type declaration

an error if given UNIDs array is empty.

an error if one of given UNIDs is empty.

an error if one of given UNIDs is invalid.

bulkUpdateDocumentsByQuery: (
    dataSource: string,
    request: BulkUpdateDocumentsByQueryRequest,
    richTextAs?: string,
) => Promise<DominoDocument[] | DocumentStatusResponse[]>

Bulk update documents via specified request. Richtext return format can be specified (defaults to mime if not given).

Type declaration

an error if query in request is empty.

an error if replaceItems in request has no items.

createDocument: (
    dataSource: string,
    doc: DocumentJSON,
    options?: CreateDocumentOptions,
) => Promise<DominoDocument>

Create a document with the provided document JSON. Additional request options can be provided.

Type declaration

deleteDocument: (
    dataSource: string,
    doc: DominoRestDocument,
    mode?: string,
) => Promise<DocumentStatusResponse>

Delete the given DominoDocument. A mode can be provided if the operation needs to be done on other modes (default mode is default).

Type declaration

an error if given document has empty UNID.

an error if given document has invalid UNID.

deleteDocumentByUNID: (
    dataSource: string,
    unid: string,
    mode?: string,
) => Promise<DocumentStatusResponse>

Delete a document pointed by its UNID. A mode can be provided if the operation needs to be done on other modes (default mode is default).

Type declaration

    • (
          dataSource: string,
          unid: string,
          mode?: string,
      ): Promise<DocumentStatusResponse>
    • Parameters

      • dataSource: string

        the scope name

      • unid: string

        the UNID of the document to be deleted

      • Optionalmode: string

        the mode to perform the document access in. Defaults to default if not given

      Returns Promise<DocumentStatusResponse>

      a promise that resolves to a document status response.

an error if given UNID is empty.

an error if given UNID is invalid.

dominoAccess: DominoRestAccess

Provides access to Domino REST API server.

dominoConnector: DominoRestConnector

Provides accessible operations and its required parameters.

getDocument: (
    dataSource: string,
    unid: string,
    options?: GetDocumentOptions,
) => Promise<DominoDocument>

Get a document via its UNID. Additional request options can be provided.

Type declaration

    • (
          dataSource: string,
          unid: string,
          options?: GetDocumentOptions,
      ): Promise<DominoDocument>
    • Parameters

      • dataSource: string

        the scope name

      • unid: string

        the UNID of the document to get

      • Optionaloptions: GetDocumentOptions

        options for get document operation

      Returns Promise<DominoDocument>

      a promise that resolves to the document fetched.

an error if given UNID is empty.

an error if given UNID is invalid.

getDocumentsByQuery: (
    dataSource: string,
    request: GetDocumentsByQueryRequest,
    action: QueryActions,
    options?: GetDocumentsByQueryOptions,
) => Promise<
    | DominoDocument[]
    | QueryDocumentExplainResponse[]
    | QueryDocumentParseResponse[],
>

get documents via specified request based on the action provided.

Type declaration

an error if query in request is empty.

an error if action in request is empty.

getListViewEntry: (
    dataSource: string,
    listViewName: string,
    options?: GetListViewEntryOptions,
) => Promise<void | DominoDocument[] | ListViewEntryJSON[]>

Pulls in view data. Will return view entries unless options.documents is true, which will return DominoDocument instead. options.subscriber can also be provided, if instead of a response, you want the subscriber function to be called for each array item in the response.

Type declaration

an error if given scope name is empty.

an error if given list name is empty.

getListViewPivotEntry: (
    dataSource: string,
    listViewName: string,
    pivotColumn: string,
    options?: GetListPivotViewEntryOptions,
) => Promise<PivotListViewResponse>

Processes view data as pivot.

Type declaration

an error if given scope name is empty.

an error if given list name is empty.

an error if pivot column is empty.

getListViews: (
    dataSource: string,
    options?: GetListViewOptions,
) => Promise<GetListViewJSON[]>

Provide information on available views/folders.

Type declaration

an error if given scope name is empty.

getRichtext: (
    dataSource: string,
    unid: string,
    richTextAs: string,
    options?: GetRichtextOptions,
) => Promise<string>

Return a plain unformatted text from a Rich Text field.

Type declaration

    • (
          dataSource: string,
          unid: string,
          richTextAs: string,
          options?: GetRichtextOptions,
      ): Promise<string>
    • Parameters

      • dataSource: string

        the scope name

      • unid: string

        the UNID of the document to be deleted

      • richTextAs: string

        the format to return richtext field value

      • Optionaloptions: GetRichtextOptions

        optional parameters for GET /richtext/{richTextAs}/{unid} endpoint

      Returns Promise<string>

      A promise that resolves to a string of the richtext field value.

patchDocument: (
    dataSource: string,
    unid: string,
    docJsonPatch: DocumentBody,
    options?: UpdateDocumentOptions,
) => Promise<DominoDocument>

Update a document pointed by its UNID. Performs a PATCH on the document using the given document body JSON. Additional request options can be provided.

Type declaration

    • (
          dataSource: string,
          unid: string,
          docJsonPatch: DocumentBody,
          options?: UpdateDocumentOptions,
      ): Promise<DominoDocument>
    • Parameters

      • dataSource: string

        the scope name

      • unid: string

        the document's UNID where the patch will be made

      • docJsonPatch: DocumentBody

        JSON that contains what to patch on a document

      • Optionaloptions: UpdateDocumentOptions

        options for update document operation

      Returns Promise<DominoDocument>

      a promise that resolves to the updated document.

an error if given UNID is empty.

an error if given UNID is invalid.

updateDocument: (
    dataSource: string,
    doc: DominoRestDocument,
    options?: UpdateDocumentOptions,
) => Promise<DominoDocument>

Update the given DominoDocument (performs a PUT operation). Additional request options can be provided.

Type declaration

an error if given document has empty UNID.

an error if given document has invalid UNID.