UNPKG

typesense

Version:
38 lines 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var Collections_1 = tslib_1.__importDefault(require("./Collections")); var RESOURCEPATH = "/overrides"; var Overrides = /** @class */ (function () { function Overrides(collectionName, apiCall) { this.collectionName = collectionName; this.apiCall = apiCall; } Overrides.prototype.upsert = function (overrideId, params) { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { return [2 /*return*/, this.apiCall.put(this.endpointPath(overrideId), params)]; }); }); }; Overrides.prototype.retrieve = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { return [2 /*return*/, this.apiCall.get(this.endpointPath())]; }); }); }; Overrides.prototype.endpointPath = function (operation) { return "".concat(Collections_1.default.RESOURCEPATH, "/").concat(this.collectionName).concat(Overrides.RESOURCEPATH).concat(operation === undefined ? "" : "/" + encodeURIComponent(operation)); }; Object.defineProperty(Overrides, "RESOURCEPATH", { get: function () { return RESOURCEPATH; }, enumerable: false, configurable: true }); return Overrides; }()); exports.default = Overrides; //# sourceMappingURL=Overrides.js.map