UNPKG

typesense

Version:
32 lines 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var Collections_1 = tslib_1.__importDefault(require("./Collections")); var Synonyms_1 = tslib_1.__importDefault(require("./Synonyms")); var Synonym = /** @class */ (function () { function Synonym(collectionName, synonymId, apiCall) { this.collectionName = collectionName; this.synonymId = synonymId; this.apiCall = apiCall; } Synonym.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())]; }); }); }; Synonym.prototype.delete = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { return [2 /*return*/, this.apiCall.delete(this.endpointPath())]; }); }); }; Synonym.prototype.endpointPath = function () { return "".concat(Collections_1.default.RESOURCEPATH, "/").concat(encodeURIComponent(this.collectionName)).concat(Synonyms_1.default.RESOURCEPATH, "/").concat(encodeURIComponent(this.synonymId)); }; return Synonym; }()); exports.default = Synonym; //# sourceMappingURL=Synonym.js.map