Export RelationClasses
Without this being exported, it was impossible to define custom relation types. However, there are still limitations - not all helper methods are public to really handle this scenario.
This commit is contained in:
parent
07dbbd4224
commit
41e0efb2b0
|
@ -11,9 +11,6 @@ var applyFilter = require('./connectors/memory').applyFilter;
|
|||
var ValidationError = require('./validations.js').ValidationError;
|
||||
var debug = require('debug')('loopback:relations');
|
||||
|
||||
exports.Relation = Relation;
|
||||
exports.RelationDefinition = RelationDefinition;
|
||||
|
||||
var RelationTypes = {
|
||||
belongsTo: 'belongsTo',
|
||||
hasMany: 'hasMany',
|
||||
|
@ -24,16 +21,6 @@ var RelationTypes = {
|
|||
embedsMany: 'embedsMany'
|
||||
};
|
||||
|
||||
exports.RelationTypes = RelationTypes;
|
||||
exports.HasMany = HasMany;
|
||||
exports.HasManyThrough = HasManyThrough;
|
||||
exports.HasOne = HasOne;
|
||||
exports.HasAndBelongsToMany = HasAndBelongsToMany;
|
||||
exports.BelongsTo = BelongsTo;
|
||||
exports.ReferencesMany = ReferencesMany;
|
||||
exports.EmbedsOne = EmbedsOne;
|
||||
exports.EmbedsMany = EmbedsMany;
|
||||
|
||||
var RelationClasses = {
|
||||
belongsTo: BelongsTo,
|
||||
hasMany: HasMany,
|
||||
|
@ -45,6 +32,21 @@ var RelationClasses = {
|
|||
embedsMany: EmbedsMany
|
||||
};
|
||||
|
||||
exports.Relation = Relation;
|
||||
exports.RelationDefinition = RelationDefinition;
|
||||
|
||||
exports.RelationTypes = RelationTypes;
|
||||
exports.RelationClasses = RelationClasses;
|
||||
|
||||
exports.HasMany = HasMany;
|
||||
exports.HasManyThrough = HasManyThrough;
|
||||
exports.HasOne = HasOne;
|
||||
exports.HasAndBelongsToMany = HasAndBelongsToMany;
|
||||
exports.BelongsTo = BelongsTo;
|
||||
exports.ReferencesMany = ReferencesMany;
|
||||
exports.EmbedsOne = EmbedsOne;
|
||||
exports.EmbedsMany = EmbedsMany;
|
||||
|
||||
function normalizeType(type) {
|
||||
if (!type) {
|
||||
return type;
|
||||
|
|
Loading…
Reference in New Issue