@crnk/angular-ngrx
Version:
Angular helper library for ngrx-json-api and crnk:
124 lines • 5.32 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { BeanPath, BooleanPath, StringPath } from '../expression/';
import { QTypedManyResourceRelationship, QTypedOneResourceRelationship } from '../stub/';
import { MetaElement, QMetaElement } from './meta.element';
import { MetaType, QMetaType } from './meta.type';
import { ManyQueryResult, OneQueryResult, ResourceRelationship, TypedOneResourceRelationship } from 'ngrx-json-api';
var QMetaAttribute = /** @class */ (function (_super) {
__extends(QMetaAttribute, _super);
function QMetaAttribute() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.metaId = 'resources.meta.attribute';
_this.id = _this.createString('id');
_this.type = _this.createString('type');
_this.relationships = new QMetaAttribute.QRelationships(_this, 'relationships');
_this.attributes = new QMetaAttribute.QAttributes(_this, 'attributes');
return _this;
}
return QMetaAttribute;
}(BeanPath));
export { QMetaAttribute };
(function (QMetaAttribute) {
var QRelationships = /** @class */ (function (_super) {
__extends(QRelationships, _super);
function QRelationships() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(QRelationships.prototype, "type", {
get: function () {
if (!this._type) {
this._type =
new QTypedOneResourceRelationship(this, 'type', QMetaType);
}
return this._type;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "oppositeAttribute", {
get: function () {
if (!this._oppositeAttribute) {
this._oppositeAttribute =
new QTypedOneResourceRelationship(this, 'oppositeAttribute', QMetaAttribute);
}
return this._oppositeAttribute;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "parent", {
get: function () {
if (!this._parent) {
this._parent =
new QTypedOneResourceRelationship(this, 'parent', QMetaElement);
}
return this._parent;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "children", {
get: function () {
if (!this._children) {
this._children =
new QTypedManyResourceRelationship(this, 'children', QMetaElement);
}
return this._children;
},
enumerable: true,
configurable: true
});
;
return QRelationships;
}(BeanPath));
QMetaAttribute.QRelationships = QRelationships;
var QAttributes = /** @class */ (function (_super) {
__extends(QAttributes, _super);
function QAttributes() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.association = _this.createBoolean('association');
_this.derived = _this.createBoolean('derived');
_this.lazy = _this.createBoolean('lazy');
_this.version = _this.createBoolean('version');
_this.primaryKeyAttribute = _this.createBoolean('primaryKeyAttribute');
_this.sortable = _this.createBoolean('sortable');
_this.filterable = _this.createBoolean('filterable');
_this.insertable = _this.createBoolean('insertable');
_this.updatable = _this.createBoolean('updatable');
_this.lob = _this.createBoolean('lob');
_this.nullable = _this.createBoolean('nullable');
_this.cascaded = _this.createBoolean('cascaded');
_this.readable = _this.createBoolean('readable');
_this.name = _this.createString('name');
return _this;
}
return QAttributes;
}(BeanPath));
QMetaAttribute.QAttributes = QAttributes;
})(QMetaAttribute || (QMetaAttribute = {}));
export var createEmptyMetaAttribute = function (id) {
return {
id: id,
type: 'meta/attribute',
attributes: {},
relationships: {
type: { data: null },
oppositeAttribute: { data: null },
parent: { data: null },
children: { data: [] },
},
};
};
//# sourceMappingURL=meta.attribute.js.map