@prettyfluid/zentinel
Version:
Integration helper for Zentinel
21 lines (20 loc) • 973 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZentinelDataMapper = void 0;
var message_types_1 = require("./message-types");
var ZentinelDataMapper = /** @class */ (function () {
function ZentinelDataMapper(zentinel, category) {
this.zentinel = zentinel;
this.category = category;
}
ZentinelDataMapper.prototype.saveData = function (data, corporation) {
return this.zentinel.sendMessage(message_types_1.ZentinelMessageTypes.saveData, { data: data, category: this.category }, corporation
? { corporationName: corporation, shareData: true }
: { shareData: false });
};
ZentinelDataMapper.prototype.loadData = function (zentinelId) {
return this.zentinel.sendMessage(message_types_1.ZentinelMessageTypes.loadData, { zentinelId: zentinelId, category: this.category });
};
return ZentinelDataMapper;
}());
exports.ZentinelDataMapper = ZentinelDataMapper;