@tipe/databox-loader
Advanced tools
Comparing version 0.3.12 to 0.3.13
{ | ||
"name": "@tipe/databox-loader", | ||
"version": "0.3.12", | ||
"version": "0.3.13", | ||
"description": "Tipe Databox Loader for talking with Databox", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -6,3 +6,3 @@ const fetch = require('node-fetch') | ||
function databoxFetch(url, model, action, body, methods = []) { | ||
function databoxFetch(url, key, model, action, body, methods = []) { | ||
if (action === 'create') { | ||
@@ -14,2 +14,3 @@ console.warn('Please use createMany or createOne') | ||
headers: { | ||
'X-TIPE-AUTH': key, | ||
'Content-Type': 'application/json' | ||
@@ -24,3 +25,3 @@ }, | ||
} | ||
module.exports = function createDatabox(url, _models, _actions) { | ||
module.exports = function createDatabox(url, key, _models, _actions) { | ||
_models = _models || models | ||
@@ -35,3 +36,3 @@ _actions = _actions || actions | ||
if (orm[model][action] === undefined) { | ||
orm[model][action] = databoxFetch.bind(null, url, model, action) | ||
orm[model][action] = databoxFetch.bind(null, url, key, model, action) | ||
} | ||
@@ -38,0 +39,0 @@ }) |
@@ -6,3 +6,3 @@ const createDatabox = require('./create'); | ||
beforeEach(() => { | ||
databox = createDatabox('http://url.com', [ | ||
databox = createDatabox('http://url.com', 'key', [ | ||
'testing', | ||
@@ -9,0 +9,0 @@ 'testing1', |
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
104312
219