Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Author : Atul
var loopback = require('loopback');
var boot = require('loopback-boot');
var wrapper = require('./loopback-datasource-juggler-wrapper');
var path = require('path');
var mergeUtil = require('./merge-util');
var debug = require('debug')('oe-cloud:oe-cloud');
var async = require('async');
var jutil = require('loopback-datasource-juggler/lib/jutil');
var observerMixin = require('loopback-datasource-juggler/lib/observer');
wrapper.initWrapper();
var app = loopback();
jutil.mixin(app, observerMixin);
var mixinUtil = require('./mixin-util')(app);
function getRootFolder() {
var rootFolder;
try {
rootFolder = path.dirname(module.parent.parent.filename);
} catch (e) {
console.error('**** ERROR : Not able to get root folder from parent module. ****', e);
}
if (!rootFolder || process.env.FIXEDSERVER) {
try {
rootFolder = process.cwd() + '/server';
RemoteConnector.prototype.define = function(definition) {
const Model = definition.model;
const remotes = this.remotes;
assert(Model.sharedClass,
'cannot attach ' +
Model.modelName +
' to a remote connector without a Model.sharedClass');
jutil.mixin(Model, RelationMixin);
jutil.mixin(Model, InclusionMixin);
remotes.addClass(Model.sharedClass);
this.resolve(Model);
this.setupRemotingTypeFor(Model);
};
RemoteConnector.prototype.define = function(definition) {
const Model = definition.model;
const remotes = this.remotes;
assert(Model.sharedClass,
'cannot attach ' +
Model.modelName +
' to a remote connector without a Model.sharedClass');
jutil.mixin(Model, RelationMixin);
jutil.mixin(Model, InclusionMixin);
remotes.addClass(Model.sharedClass);
this.resolve(Model);
this.setupRemotingTypeFor(Model);
};