UNPKG

weaviate-client

Version:
37 lines (36 loc) • 2.06 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const aggregate_js_1 = require("../proto/v1/aggregate.js"); const errors_js_1 = require("../errors.js"); const base_js_1 = __importDefault(require("./base.js")); const retry_js_1 = require("./retry.js"); class Aggregator extends base_js_1.default { static use(connection, collection, metadata, timeout, consistencyLevel, tenant) { return new Aggregator(connection, collection, metadata, timeout, consistencyLevel, tenant); } withFetch = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withHybrid = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearAudio = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearDepth = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearImage = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearIMU = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearObject = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearText = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearThermal = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearVector = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); withNearVideo = (args) => this.call(aggregate_js_1.AggregateRequest.fromPartial(args)); call = (message) => this.sendWithTimeout((signal) => this.connection.aggregate({ ...message, collection: this.collection, tenant: this.tenant, objectsCount: true, }, { metadata: this.metadata, signal, ...retry_js_1.retryOptions, }), (err) => new errors_js_1.WeaviateQueryError(err.message, 'gRPC')); } exports.default = Aggregator;