UNPKG

@awhere/api

Version:

The awesome aWhere API for JavaScript.

69 lines 2.55 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var interfaces_1 = require("@awhere/interfaces"); var PrototypeBase_1 = __importDefault(require("../../PrototypeBase")); var AccessibleUser = /** @class */ (function (_super) { __extends(AccessibleUser, _super); function AccessibleUser(props) { if (props === void 0) { props = {}; } var _this = _super.call(this, props) || this; _this._role = interfaces_1.AccessRole.reader; if (props.user !== undefined) { _this.user = props.user; } if (props.role !== undefined) { _this.role = props.role; } return _this; } Object.defineProperty(AccessibleUser.prototype, "user", { get: function () { return this._user; }, set: function (value) { if (typeof value === 'string') { this._id = value; this._user = value; } else if (typeof value === 'object') { if (value._id) { this._id = value._id; } this._user = value; } }, enumerable: false, configurable: true }); Object.defineProperty(AccessibleUser.prototype, "role", { get: function () { return this._role; }, set: function (value) { this._role = value; }, enumerable: false, configurable: true }); return AccessibleUser; }(PrototypeBase_1.default)); exports.default = AccessibleUser; //# sourceMappingURL=AccessibleUser.js.map