UNPKG

api-core

Version:

Model-based dynamic multi-level APIs for any provider, plus multiple consumption channels

18 lines 765 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OneToOneRelation = void 0; const ApiEdgeRelation_1 = require("./ApiEdgeRelation"); const Api_1 = require("../Api"); class OneToOneRelation extends ApiEdgeRelation_1.ApiEdgeRelation { constructor(from, to, options = {}) { super(from, to); this.hasPair = false; this.name = options.name || to.name; this.relatedId = options.relatedId || from.idField; this.relationId = options.relationId || to.name + Api_1.Api.defaultIdPostfix; } getType() { return 'one-to-one'; } } exports.OneToOneRelation = OneToOneRelation; ApiEdgeRelation_1.ApiEdgeRelationTypes['one-to-one'] = OneToOneRelation; //# sourceMappingURL=OneToOneRelation.js.map