autopilot-sdk
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -8,2 +8,6 @@ 'use strict'; | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _utils = require('./utils'); | ||
@@ -15,8 +19,6 @@ | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var save = function save(_ref) { | ||
var email = _ref.email, | ||
id = _ref.id, | ||
data = _objectWithoutProperties(_ref, ['email', 'id']); | ||
data = (0, _objectWithoutProperties3.default)(_ref, ['email', 'id']); | ||
@@ -23,0 +25,0 @@ if (!email && !id) { |
@@ -8,4 +8,26 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _isInteger = require('babel-runtime/core-js/number/is-integer'); | ||
var _isInteger2 = _interopRequireDefault(_isInteger); | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
var _regenerator = require('babel-runtime/regenerator'); | ||
var _regenerator2 = _interopRequireDefault(_regenerator); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); | ||
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); | ||
var _axios = require('axios'); | ||
@@ -17,6 +39,2 @@ | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | ||
var VERSION = 'v1'; | ||
@@ -39,8 +57,7 @@ var ENDPOINT = 'https://api2.autopilothq.com/' + VERSION; | ||
var request = function () { | ||
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(method, path, _ref) { | ||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(method, path, _ref) { | ||
var token = _ref.token, | ||
options = _objectWithoutProperties(_ref, ['token']); | ||
options = (0, _objectWithoutProperties3.default)(_ref, ['token']); | ||
var http, res; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
return _regenerator2.default.wrap(function _callee$(_context) { | ||
while (1) { | ||
@@ -78,3 +95,3 @@ switch (_context.prev = _context.next) { | ||
var parse = exports.parse = function parse(obj) { | ||
var keys = Object.keys(obj); | ||
var keys = (0, _keys2.default)(obj); | ||
var newObj = {}; | ||
@@ -85,3 +102,3 @@ | ||
var value = obj[key]; | ||
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { | ||
if ((typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object') { | ||
throw new Error('Invalid value type: expected values are string, integer, date, boolean, float'); | ||
@@ -93,3 +110,3 @@ } | ||
var isString = typeof value === 'string'; | ||
var isInteger = Number.isInteger(value); | ||
var isInteger = (0, _isInteger2.default)(value); | ||
var isFloatPoint = isFloat(value); | ||
@@ -96,0 +113,0 @@ var isBoolean = typeof value === 'boolean'; |
{ | ||
"name": "autopilot-sdk", | ||
"description": "Node SDK for Autopilot", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Samuel Amoah <sa.am@programmer.net>", | ||
@@ -15,2 +15,3 @@ "keywords": [ | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
@@ -17,0 +18,0 @@ "babel-runtime": "^6.20.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
234
16081
14