@ifings/api-client
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -9,34 +9,34 @@ "use strict"; | ||
var axios = require("axios"); | ||
var axios = require('axios'); | ||
var qs = require("qs"); | ||
var qs = require('qs'); | ||
var actuators = require("./routes/actuators"); | ||
var actuators = require('./routes/actuators'); | ||
var observedProperties = require("./routes/observed-properties"); | ||
var observedProperties = require('./routes/observed-properties'); | ||
var sensors = require("./routes/sensors"); | ||
var sensors = require('./routes/sensors'); | ||
var stacks = require("./routes/stacks"); | ||
var stacks = require('./routes/stacks'); | ||
var uom = require("./routes/uom"); | ||
var uom = require('./routes/uom'); | ||
var gtins = require("./routes/gtins"); | ||
var gtins = require('./routes/gtins'); | ||
var modules = require("./routes/modules"); | ||
var modules = require('./routes/modules'); | ||
var clients = require("./routes/clients"); | ||
var clients = require('./routes/clients'); | ||
var _accounts = require("./routes/accounts"); | ||
var _accounts = require('./routes/accounts'); | ||
var _sites = require("./routes/sites"); | ||
var _sites = require('./routes/sites'); | ||
var contacts = require("./routes/contacts"); | ||
var contacts = require('./routes/contacts'); | ||
var getRawData = require("./utils/get-raw-data"); | ||
var getRawData = require('./utils/get-raw-data'); | ||
var etagCache = require("./utils/axios-if-match-cache-intercept"); | ||
var etagCache = require('./utils/axios-if-match-cache-intercept'); | ||
var parameterSerialiserConfig = { | ||
arrayFormat: "repeat", | ||
arrayFormat: 'repeat', | ||
indices: false | ||
@@ -48,3 +48,3 @@ }; | ||
headers: { | ||
"Content-Type": "application/json" | ||
'Content-Type': 'application/json' | ||
}, | ||
@@ -51,0 +51,0 @@ paramsSerializer: function paramsSerializer(parameters) { |
"use strict"; | ||
var methods = require("../utils/methods"); | ||
var methods = require('../utils/methods'); | ||
module.exports = function (instance) { | ||
return methods(instance, "/v3/hardware/gtins"); | ||
return methods(instance, '/v3/hardware/gtins'); | ||
}; |
"use strict"; | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -10,3 +14,3 @@ | ||
/* eslint-disable promise/prefer-await-to-then */ | ||
var getData = require('../utils/get-raw-data'); | ||
var getData = require("../utils/get-raw-data"); | ||
@@ -58,3 +62,3 @@ function methods(instance, baseRoute) { | ||
headers: { | ||
'Content-Type': 'application/merge-patch+json' | ||
"Content-Type": "application/merge-patch+json" | ||
} | ||
@@ -73,7 +77,10 @@ }, configParameter); | ||
return instance.put("".concat(baseRoute).concat(id === '' ? '' : "/".concat(id)), body, config).then(getData(config)); | ||
return instance.put("".concat(baseRoute).concat(id === "" ? "" : "/".concat(id)), body, config).then(getData(config)); | ||
}, | ||
delete: function _delete(ids) { | ||
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var body = options.body, | ||
config = _objectWithoutProperties(options, ["body"]); | ||
if (Array.isArray(ids)) { | ||
@@ -85,6 +92,10 @@ return Promise.all(ids.map(function (id) { | ||
if (body) { | ||
return instance.delete("".concat(baseRoute), body, config); | ||
} | ||
return instance.delete("".concat(baseRoute, "/").concat(ids), config); | ||
}, | ||
export: function _export(exportAs, parameters, type) { | ||
var exportType = type ? "?type=".concat(type) : ''; | ||
var exportType = type ? "?type=".concat(type) : ""; | ||
return instance.post("".concat(baseRoute, "/export/").concat(exportAs).concat(exportType), parameters); | ||
@@ -91,0 +102,0 @@ } |
{ | ||
"name": "@ifings/api-client", | ||
"description": "iFings API client", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42851
330