@crnk/angular-ngrx
Version:
Angular helper library for ngrx-json-api and crnk:
197 lines • 8.01 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 { MetaAttribute, QMetaAttribute } from './meta.attribute';
import { MetaElement, QMetaElement } from './meta.element';
import { MetaInterface, QMetaInterface } from './meta.interface';
import { MetaKey, QMetaKey } from './meta.key';
import { MetaPrimaryKey, QMetaPrimaryKey } from './meta.primary.key';
import { MetaType, QMetaType } from './meta.type';
import { ManyQueryResult, OneQueryResult, ResourceRelationship, TypedManyResourceRelationship, TypedOneResourceRelationship } from 'ngrx-json-api';
var QMetaDataObject = /** @class */ (function (_super) {
__extends(QMetaDataObject, _super);
function QMetaDataObject() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.metaId = 'resources.meta.dataObject';
_this.id = _this.createString('id');
_this.type = _this.createString('type');
_this.relationships = new QMetaDataObject.QRelationships(_this, 'relationships');
_this.attributes = new QMetaDataObject.QAttributes(_this, 'attributes');
return _this;
}
return QMetaDataObject;
}(BeanPath));
export { QMetaDataObject };
(function (QMetaDataObject) {
var QRelationships = /** @class */ (function (_super) {
__extends(QRelationships, _super);
function QRelationships() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(QRelationships.prototype, "subTypes", {
get: function () {
if (!this._subTypes) {
this._subTypes =
new QTypedManyResourceRelationship(this, 'subTypes', QMetaDataObject);
}
return this._subTypes;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "superType", {
get: function () {
if (!this._superType) {
this._superType =
new QTypedOneResourceRelationship(this, 'superType', QMetaDataObject);
}
return this._superType;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "attributes", {
get: function () {
if (!this._attributes) {
this._attributes =
new QTypedManyResourceRelationship(this, 'attributes', QMetaAttribute);
}
return this._attributes;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "declaredAttributes", {
get: function () {
if (!this._declaredAttributes) {
this._declaredAttributes =
new QTypedManyResourceRelationship(this, 'declaredAttributes', QMetaAttribute);
}
return this._declaredAttributes;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "primaryKey", {
get: function () {
if (!this._primaryKey) {
this._primaryKey =
new QTypedOneResourceRelationship(this, 'primaryKey', QMetaPrimaryKey);
}
return this._primaryKey;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "declaredKeys", {
get: function () {
if (!this._declaredKeys) {
this._declaredKeys =
new QTypedManyResourceRelationship(this, 'declaredKeys', QMetaKey);
}
return this._declaredKeys;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "interfaces", {
get: function () {
if (!this._interfaces) {
this._interfaces =
new QTypedManyResourceRelationship(this, 'interfaces', QMetaInterface);
}
return this._interfaces;
},
enumerable: true,
configurable: true
});
;
Object.defineProperty(QRelationships.prototype, "elementType", {
get: function () {
if (!this._elementType) {
this._elementType =
new QTypedOneResourceRelationship(this, 'elementType', QMetaType);
}
return this._elementType;
},
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));
QMetaDataObject.QRelationships = QRelationships;
var QAttributes = /** @class */ (function (_super) {
__extends(QAttributes, _super);
function QAttributes() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.insertable = _this.createBoolean('insertable');
_this.updatable = _this.createBoolean('updatable');
_this.deletable = _this.createBoolean('deletable');
_this.readable = _this.createBoolean('readable');
_this.name = _this.createString('name');
return _this;
}
return QAttributes;
}(BeanPath));
QMetaDataObject.QAttributes = QAttributes;
})(QMetaDataObject || (QMetaDataObject = {}));
export var createEmptyMetaDataObject = function (id) {
return {
id: id,
type: 'meta/dataObject',
attributes: {},
relationships: {
subTypes: { data: [] },
superType: { data: null },
attributes: { data: [] },
declaredAttributes: { data: [] },
primaryKey: { data: null },
declaredKeys: { data: [] },
interfaces: { data: [] },
elementType: { data: null },
parent: { data: null },
children: { data: [] },
},
};
};
//# sourceMappingURL=meta.data.object.js.map