@awhere/api
Version:
The awesome aWhere API for JavaScript.
77 lines • 3.9 kB
JavaScript
;
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 __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
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 StructuredCollection_1 = __importDefault(require("../_BaseClass/StructuredCollection"));
var Table = /** @class */ (function (_super) {
__extends(Table, _super);
function Table(props) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
var _this = _super.call(this, props) || this;
_this.props = _this.props || {};
if ((_a = props === null || props === void 0 ? void 0 : props.props) === null || _a === void 0 ? void 0 : _a.schemaDefinition) {
_this.props.schemaDefinition = (_b = props === null || props === void 0 ? void 0 : props.props) === null || _b === void 0 ? void 0 : _b.schemaDefinition;
}
else {
_this.props.schemaDefinition = __assign({}, StructuredCollection_1.default.systemSchema);
}
if (!((_c = _this.props.schemaDefinition) === null || _c === void 0 ? void 0 : _c._id)) {
_this.props.schemaDefinition = __assign(__assign({}, StructuredCollection_1.default.systemSchema), _this.props.schemaDefinition);
}
if ((_d = props === null || props === void 0 ? void 0 : props.props) === null || _d === void 0 ? void 0 : _d.queryDefinition) {
_this.props.queryDefinition = (_e = props === null || props === void 0 ? void 0 : props.props) === null || _e === void 0 ? void 0 : _e.queryDefinition;
}
if ((_f = props === null || props === void 0 ? void 0 : props.props) === null || _f === void 0 ? void 0 : _f.attachment) {
_this.props.attachment = (_g = props === null || props === void 0 ? void 0 : props.props) === null || _g === void 0 ? void 0 : _g.attachment;
}
if ((_h = props === null || props === void 0 ? void 0 : props.props) === null || _h === void 0 ? void 0 : _h.relations) {
_this.props.relations = (_j = props === null || props === void 0 ? void 0 : props.props) === null || _j === void 0 ? void 0 : _j.relations;
}
return _this;
}
Object.defineProperty(Table.prototype, "type", {
get: function () {
return interfaces_1.ItemType.databaseItem;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Table.prototype, "subtype", {
get: function () {
return interfaces_1.DatabaseItemType.table;
},
enumerable: false,
configurable: true
});
return Table;
}(StructuredCollection_1.default));
exports.default = Table;
//# sourceMappingURL=Table.js.map