0.0.12 • Published 9 years ago

jet-sdk v0.0.12

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

jet-sdk

Originally forked from vedmalex/mws-sdk.

What is done:

  • It is uses request. it is more flexible and there is no eventEmitter syntax.

  • Promises to provide generic async support.

Use it. Contriburte it.

it can be seamlesly used in ES2015/2016 way using babel.js. with new javascript code features like yield or async wait to put some sugar on your code.

Examples

Initialize

var Jet = require('jet-sdk'),
    client = new Jet.Client('user', 'pass', {});

you also can use test/jet-emulator.(for run use command)

  node test/jet-emulator/app.js

and after then can send commands to localhost(for getting available params see source code jet-emulator):

var Jet = require('jet-sdk'),
    client = new Jet.Client('user', 'pass', {host:'localhost:3021'});

Getting PRODUCTS information

PRODUCTSUsing for getting products by SKU

function GetProductBySKU(user, pass, SKU) {
  var client = new Jet.Client(user, pass, {});
  var req = Jet.Products.requests.GetProductBySKU();
  req.set('SKU', SKU);
  return client.auth().then(client=>client.invoke(req));
}

PRODUCTSUsing for getting products SKU list

function GetProductSKU(user, pass, offset, limit) {
  var client = new Jet.Client(user, pass, {});
  var req = Jet.Products.requests.GetProductSKU();
  req.set('offset', offset);
  req.set('limit', limit);
  return client.auth().then(client=>client.invoke(req));
}

PRODUCTSUsing for getting product price by SKU

function GetProductPrice(user, pass, SKU) {
  var client = new Jet.Client(user, pass, {});
  var req = Jet.Products.requests.GetProductPrice();
  req.set('SKU', SKU);
  return client.auth().then(client=>client.invoke(req));
}

PRODUCTSUsing for getting product inventory

function GetProductInventory(user, pass, SKU) {
  var client = new Jet.Client(user, pass, {});
  var req = Jet.Products.requests.GetProductInventory();
  req.set('SKU', SKU);
  return client.auth().then(client=>client.invoke(req));
}

PRODUCTSUsing for getting product shipping exception

function GetProductShippingException(user, pass, SKU) {
  var client = new Jet.Client(user, pass, {});
  var req = Jet.Products.requests.GetProductShippingException();
  req.set('SKU', SKU);
  return client.auth().then(client=>client.invoke(req));
}

Getting ORDERS information

ORDERSUsing for getting order list by stat

function GetOrderList(user, pass, status) {
  var client = new Jet.Client(user, pass, {});
  var req = Jet.Orders.requests.GetOrders();
  req.set('status', status);
  return client.auth().then(client=>client.invoke(req));
}

ORDERSUsing for getting order details

function GetOrder(user, pass, orderId) {
  var client = new Jet.Client(user, pass, {});
  var req = Jet.Orders.requests.GetOrderDetails();
  req.set('orderId', orderId);
  return client.auth().then(client=>client.invoke(req));
}
0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago