Snapchat wrapper for Snap-related API calls.

@class
@param {Object} opts
337983
function Snaps (client, opts) {
  var self = this
  if (!(self instanceof Snaps)) return new Snaps(client, opts)
  if (!opts) opts = {}

  self.client = client
}
708067
function(opts) {
      opts = opts || {};
      var path = opts.path || this.path,
          callback = opts.callback,
          method = opts.method || this.method,
          ws = getWebsocketPlugin(),
          transports = app.config.transports,
          self = this,
          i = 0,
          error,
          response;

      if (ws) {
        if (transports && transports.length > 0) {
          async.whilst(
            function () {
              return (i < transports.length);
            },
            function (done) {
              self.doConnect(transports[i], method, path, function (err, res) {
                error = err;
                response = res;
                if (!err && res) {
                  i = transports.length;
                } else {
                  i++;
                  if (i < transports.length) {
                    delete self.request;
                  }
                }
                done();
              });
            },
            function (err) {
              callback(err || error, response);
            }
          );
        } else {
          error = 'no transport available';
          log.error('%s %s', app.name, error);
          callback(error);
        }
      } else {
        this.doConnect('http', method, path, callback);
      }
      return this;
    }
988219
function getOptions(opts) {
	var obj = Object.create(_options);
	obj = util._extend(obj, opts);
	return obj;
}
487894
function (opts, callback) {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      if (this.readyState == 4 ) {
        if (this.status == 204){
          //success
          return callback(null);
        }else {
          return callback(this.statusText);
        }
      }
    };

    xhttp.open(opts.method, opts.host + '/' + opts.path, true);
    for (var header in opts.headers){
      var headerValue = opts.headers[header];
      xhttp.setRequestHeader(header, headerValue)
    }
    xhttp.send(opts.body);
  }
817336
function snap() {
            if (__snip < 0)
                throw(new Error("Illegal call to snap(): Not snipping"));
            var snipped = __out.splice(__snip, __out.length - __snip).join('');
            __snip = -1;
            return snipped;
        }
275248
function wrap(obj, opts) {
  var result = {};
  for (var key in obj) {
    if(obj.hasOwnProperty(key)) {
      var wrapped = wrap1(obj[key], opts, key);
      if (typeof wrapped !== 'undefined')
        result[key] = wrapped;
    }
  }
  return result;
}
968491
function (opts) {
    opts = opts || {};
    this.name = opts.name || 'unknown';
    this.userId = opts.userId;
    this.userRole = opts.userRole || 'anonymous';
    this.acl = opts.acl || {};
    this.permissions = opts.permissions || [];
}
589222
function (opts, id) {
        let uri = this.classUrl
        if (id) {
          uri += '/' + id
        }

        if (typeof opts.data === 'function') {
          opts.next = opts.data
          opts.data = {}
        }

        // Reset payment sources
        this.payment_sources = null

        return new Promise(function (resolve, reject) {
          new Requestor({ api_version: instance.api_version }).request({
            method: 'get',
            url: [Conekta.api_base, uri].join(''),
            data: opts.data || {},
            next: function (error, response) {
              if (!error) {
                response = this.listObjectsToArray(response)
                this._json = response
                if (id) {
                  this._id = response.id
                } else {
                  _.each(response.data, (item) => {
                    const index = _.extend(
                      {
                        _json: item,
                        _id: item._id
                      },
                      this
                    )
                    this._items.push(index)
                  })
                }
                this.build_children()
              }
              if (opts.next !== undefined) {
                opts.next(error, this)
              } else {
                if (error) {
                  reject(error) 
                } else {
                  resolve(this)
                }
              }
            }.bind(this)
          })
        }.bind(this))

      }
169654
function Client (opts) {
  var self = this

  typeforce({
    url: 'String',
    otrKey: 'DSA',
    // byRootHash: 'Function',
    instanceTag: '?String',
    autoconnect: '?Boolean' // defaults to true
  }, opts)

  EventEmitter.call(this)
  this.setMaxListeners(0)

  this._url = parseURL(opts.url)
  this._autoconnect = opts.autoconnect !== false
  this._onmessage = this._onmessage.bind(this)
  this._sessions = {}
  this._otrKey = opts.otrKey
  this._fingerprint = opts.otrKey.fingerprint()
  this._connected = false
  this._instanceTag = opts.instanceTag
  this._backoff = backoff.exponential({ initialDelay: 100 })
  if (this._autoconnect) this.connect()
}
147346
function IndexService(opts) {
  util.applyProperties(this, opts);
  if (this.project) {
    this.metadataHelper = new MetadataHelper({ sfdcClient : this.project.sfdcClient });
    this.sfdcClient = this.project.sfdcClient;
  } else if (this.sfdcClient) {
    this.metadataHelper = new MetadataHelper({ sfdcClient : this.sfdcClient });
  }
}
337875
function (opt) {
            return _.extend(
                /** @class OptionsTahta */
                {
                    arrTahta_id: null,
                    bGenel: true,
                    bKurumu: true,
                    bAnahtarlari: true,
                    bRolleri: true,
                    bUyeleri: true,
                    bAjanda: true,
                    optUye: {
                        bArrTahtaUyeRolId: true
                    }
                }, opt || {});
        }
644952
function Friends (client, opts) {
  var self = this
  if (!(self instanceof Friends)) return new Friends(client, opts)
  if (!opts) opts = {}

  self.client = client
}
494864
function FlipX (opts) {
    FlipX.superclass.constructor.call(this, opts)
    this.flipX = opts.flipX
}
1339611
function _wrapCalls(options){
            return function(){
                var api;

                options.func.apply(options.context, Array.prototype.slice.call(arguments, 0));

                for (var i = 0; i < externalAPIS.length; i++) {
                    api = externalAPIS[i];
                    if (api[options.triggerType]) {
                        try {
                            api[options.triggerType].apply(api.context,Array.prototype.slice.call(arguments, 0));
                        }
                        catch (exc) {}
                    }
                }
            };
        }
1235427
function retrieveSnappy() {
  var snappy = null;
  try {
    snappy = require_optional('snappy');
  } catch (error) {} // eslint-disable-line
  if (!snappy) {
    snappy = {
      compress: noSnappyWarning,
      uncompress: noSnappyWarning,
      compressSync: noSnappyWarning,
      uncompressSync: noSnappyWarning
    };
  }
  return snappy;
}
1345475
function(app, opts) {
  opts = opts || {};
  this.app = app;
  this.service = new SessionService(opts);

  let getFun = function(m) {
    return (function() {
          return function() {
            return self.service[m].apply(self.service, arguments);
          };
    })();
  };
  // proxy the service methods except the lifecycle interfaces of component
  let method, self = this;
  for(let m in this.service) {
    if(m !== 'start' && m !== 'stop') {
      method = this.service[m];
      if(typeof method === 'function') {
        this[m] = getFun(m);
      }
    }
  }
}
1165751
function MenuItem (opts) {
    MenuItem.superclass.constructor.call(this, opts)

    var callback = opts.callback

    this.anchorPoint = ccp(0.5, 0.5)
    this.callback = callback
}