<commit_before>import {Document} from "../model/document";
import {Query} from "./query";

/**
 * The interface providing read access methods 
 * for datastores supporting the idai-components-2 document model.
 * For full access see <code>Datastore</code>
 *
 * Implementations guarantee that any of methods declared here
 * have no effect on any of the documents within the datastore.
 * 
 * @author <NAME>
 * @author <NAME>
 */
export abstract class ReadDatastore  {

    /**
     * @param resourceId the desired document's resource id
     * @returns {Promise<Document>} a document (rejects with msgWithParams in case of error)
     *  Rejects with
     *     [DOCUMENT_NOT_FOUND] - in case document is missing
     */ 
    abstract get(resourceId: string): Promise<Document>;

    /**
     * Perform a fulltext query
     
     * @param query the query object
     * @returns {Promise<Document[]>} an array of documents
     *   Rejects with
     *     [GENERIC_ERROR] - in case of error
     */<commit_msg>Update read-datastore.ts<commit_after>import {Document} from "../model/document";
import {Query} from "./query";

/**
 * The interface providing read access methods 
 * for datastores supporting the idai-components-2 document model.
 * For full access see <code>Datastore</code>
 *
 * Implementations guarantee that any of methods declared here
 * have no effect on any of the documents within the datastore.
 * 
 * @author <NAME>
 * @author <NAME>
 */
export abstract class ReadDatastore  {

    /**
     * @param resourceId the desired document's resource id
     * @returns {Promise<Document>} a document (rejects with msgWithParams in case of error)
     *  Rejects with
     *     [DOCUMENT_NOT_FOUND] - in case document is missing
     */ 
    abstract get(resourceId: string): Promise<Document>;

    /**
     * Perform a fulltext query
     
     * @param query the query object
     * @returns {Promise<Document[]>} an array of documents
     *   Rejects with
     *     [GENERIC_ERROR (, cause: any)] - in case of error, including cause, if possible
     */
{'fraction_non_alphanumeric': 0.09817131857555342, 'fraction_numerical': 0.0009624639076034649, 'mean_word_length': 3.0526315789473686, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1063182', 'n_tokens_mistral': 587, 'n_tokens_neox': 573, 'n_words': 217}