UNPKG

@crnk/angular-ngrx

Version:

Angular helper library for ngrx-json-api and crnk:

114 lines 4.78 kB
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 { QTypedManyResourceRelationship, QTypedOneResourceRelationship } from '../stub/'; import { MetaDataObject, QMetaDataObject } from './meta.data.object'; import { MetaElement, QMetaElement } from './meta.element'; import { MetaResource, QMetaResource } from './meta.resource'; import { ManyQueryResult, OneQueryResult, ResourceRelationship, TypedOneResourceRelationship } from 'ngrx-json-api'; var QMetaResourceRepository = /** @class */ (function (_super) { __extends(QMetaResourceRepository, _super); function QMetaResourceRepository() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.metaId = 'resources.meta.resourceRepository'; _this.id = _this.createString('id'); _this.type = _this.createString('type'); _this.relationships = new QMetaResourceRepository.QRelationships(_this, 'relationships'); _this.attributes = new QMetaElement.QAttributes(_this, 'attributes'); return _this; } return QMetaResourceRepository; }(BeanPath)); export { QMetaResourceRepository }; (function (QMetaResourceRepository) { var QRelationships = /** @class */ (function (_super) { __extends(QRelationships, _super); function QRelationships() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(QRelationships.prototype, "resourceType", { get: function () { if (!this._resourceType) { this._resourceType = new QTypedOneResourceRelationship(this, 'resourceType', QMetaResource); } return this._resourceType; }, enumerable: true, configurable: true }); ; Object.defineProperty(QRelationships.prototype, "listMetaType", { get: function () { if (!this._listMetaType) { this._listMetaType = new QTypedOneResourceRelationship(this, 'listMetaType', QMetaDataObject); } return this._listMetaType; }, enumerable: true, configurable: true }); ; Object.defineProperty(QRelationships.prototype, "listLinksType", { get: function () { if (!this._listLinksType) { this._listLinksType = new QTypedOneResourceRelationship(this, 'listLinksType', QMetaDataObject); } return this._listLinksType; }, 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)); QMetaResourceRepository.QRelationships = QRelationships; })(QMetaResourceRepository || (QMetaResourceRepository = {})); export var createEmptyMetaResourceRepository = function (id) { return { id: id, type: 'meta/resourceRepository', relationships: { resourceType: { data: null }, listMetaType: { data: null }, listLinksType: { data: null }, parent: { data: null }, children: { data: [] }, }, }; }; //# sourceMappingURL=meta.resource.repository.js.map