UNPKG

@hpcc-js/comms

Version:
56 lines 2.21 kB
import { __extends } from "tslib"; import { Service } from "../espConnection"; var StoreService = /** @class */ (function (_super) { __extends(StoreService, _super); function StoreService(optsConnection) { return _super.call(this, optsConnection, "WsStore", "1") || this; } StoreService.prototype.CreateStore = function (request) { return this._connection.send("Fetch", request); }; StoreService.prototype.Delete = function (request) { return this._connection.send("Delete", request).catch(function (e) { if (e.isESPExceptions && e.Exception.some(function (e) { return e.Code === -1; })) { // "Delete" item does not exist --- return { Exceptions: undefined, Success: true }; } throw e; }); }; StoreService.prototype.DeleteNamespace = function (request) { return this._connection.send("DeleteNamespace", request); }; StoreService.prototype.Fetch = function (request) { return this._connection.send("Fetch", request).catch(function (e) { if (e.isESPExceptions && e.Exception.some(function (e) { return e.Code === -1; })) { // "Fetch" item does not exist --- return { Exceptions: undefined, Value: undefined }; } throw e; }); }; StoreService.prototype.FetchAll = function (request) { return this._connection.send("FetchAll", request); }; StoreService.prototype.FetchKeyMD = function (request) { return this._connection.send("FetchKeyMD", request); }; StoreService.prototype.ListKeys = function (request) { return this._connection.send("ListKeys", request); }; StoreService.prototype.ListNamespaces = function (request) { return this._connection.send("ListNamespaces", request); }; StoreService.prototype.Set = function (request) { return this._connection.send("Set", request); }; return StoreService; }(Service)); export { StoreService }; //# sourceMappingURL=wsStore.js.map