@crnk/angular-ngrx
Version:
Angular helper library for ngrx-json-api and crnk:
83 lines • 3.4 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, StringPath } from '../expression/';
import { CrnkStoreResource, QTypedManyResourceRelationship, QTypedOneResourceRelationship } from '../stub/';
import { ManyQueryResult, OneQueryResult, ResourceRelationship, TypedManyResourceRelationship, TypedOneResourceRelationship } from 'ngrx-json-api';
var QMetaElement = /** @class */ (function (_super) {
__extends(QMetaElement, _super);
function QMetaElement() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.metaId = 'resources.meta.element';
_this.id = _this.createString('id');
_this.type = _this.createString('type');
_this.relationships = new QMetaElement.QRelationships(_this, 'relationships');
_this.attributes = new QMetaElement.QAttributes(_this, 'attributes');
return _this;
}
return QMetaElement;
}(BeanPath));
export { QMetaElement };
(function (QMetaElement) {
var QRelationships = /** @class */ (function (_super) {
__extends(QRelationships, _super);
function QRelationships() {
return _super !== null && _super.apply(this, arguments) || this;
}
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));
QMetaElement.QRelationships = QRelationships;
var QAttributes = /** @class */ (function (_super) {
__extends(QAttributes, _super);
function QAttributes() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = _this.createString('name');
return _this;
}
return QAttributes;
}(BeanPath));
QMetaElement.QAttributes = QAttributes;
})(QMetaElement || (QMetaElement = {}));
export var createEmptyMetaElement = function (id) {
return {
id: id,
type: 'meta/element',
attributes: {},
relationships: {
parent: { data: null },
children: { data: [] },
},
};
};
//# sourceMappingURL=meta.element.js.map