How to use the loopback-datasource-juggler/lib/jutil.mixin function in loopback-datasource-juggler

To help you get started, we’ve selected a few loopback-datasource-juggler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EdgeVerve / oe-cloud / lib / load.js View on Github external
// 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';
github strongloop / loopback-connector-remote / lib / remote-connector.js View on Github external
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);
};
github strongloop / loopback-connector-remote / lib / remote-connector.js View on Github external
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);
};