Skip to content

Commit

Permalink
Issues #9 #15
Browse files Browse the repository at this point in the history
  • Loading branch information
wmakeev committed Jun 1, 2015
1 parent 7deb3b8 commit 4880669
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/moysklad-client/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@
* Vitaliy V. Makeev ([email protected])
*/

var _ = require('lodash')
, stampit = require('stampit')
, Query = require('./../rest-clients/ms-xml/query')
, operators = require('./../rest-clients/ms-xml/query/operators')
, authProviderBehavior = require('./../../authProviderBehavior')
, providerAccessorBehavior = require('./../../providerAccessorBehavior');
var _ = require('lodash'),
stampit = require('stampit'),
Query = require('./../rest-clients/ms-xml/query'),
operators = require('./../rest-clients/ms-xml/query/operators'),
authProviderBehavior = require('project/behaviors/authProviderBehavior'),
providerAccessorBehavior = require('project/behaviors/providerAccessorBehavior'),
modelBuilder = require('./model-builder');

/**
* @lends Client.prototype
*/
var clientMethods = {
// Ms
from: require('./methods/from'),
load: require('./methods/load'),
chain: require('./methods/chain'),
first: require('./methods/first'),
total: require('./methods/total'),
save: require('./methods/save'),
from : require('./methods/from'),
load : require('./methods/load'),
chain : require('./methods/chain'),
first : require('./methods/first'),
total : require('./methods/total'),
save : require('./methods/save'),

// Query
createQuery: Query.createQuery,

// LazyLoader
createLazyLoader: require('./lazy-loader')
createLazyLoader: require('./lazy-loader'),

loadMetadata: require('./methods/loadMetadata')
};

var jsonServiceMethods = require('./methods/json-service');
Expand All @@ -41,8 +44,9 @@ var Client = stampit()
.state({
options: {
filterLimit: 50,
allowNotFilterOperators: false,
flowControl: 'sync'
flowControl: 'sync',
baseUrl: 'https://online.moysklad.ru/exchange',
allowNotFilterOperators: false
},

sortMode: {
Expand All @@ -57,8 +61,10 @@ var Client = stampit()
// Providers accessor
.enclose(providerAccessorBehavior)

// Providers accessor
.enclose(modelBuilder)

// Methods
//
.methods(clientMethods)
.methods(jsonServiceMethods)
.methods(operators);
Expand Down

0 comments on commit 4880669

Please sign in to comment.