journeyapps
Advanced tools
Comparing version 0.2.26 to 0.2.27
@@ -77,3 +77,4 @@ require('isomorphic-fetch'); | ||
// } | ||
function JourneyAPIAdapter(credentials, schema) { | ||
function JourneyAPIAdapter(credentials, schema, options) { | ||
options = options || {}; | ||
BaseAdapter.call(this, {}); | ||
@@ -86,3 +87,5 @@ this.name = 'api'; | ||
function apiGet(url) { | ||
return fetch(url, { | ||
return fetch(url, Object.assign({}, | ||
options.fetch, | ||
{ | ||
method: 'GET', | ||
@@ -92,3 +95,3 @@ headers: Object.assign({ | ||
}, credentials.apiAuthHeaders()) | ||
}).then(function(response) { | ||
})).then(function(response) { | ||
if(response.ok) { | ||
@@ -103,3 +106,5 @@ return response.json(); | ||
function apiPost(url, data) { | ||
return fetch(url, { | ||
return fetch(url, Object.assign({}, | ||
options.fetch, | ||
{ | ||
method: 'POST', | ||
@@ -111,3 +116,3 @@ headers: Object.assign({ | ||
body: JSON.stringify(data) | ||
}).then(function(response) { | ||
})).then(function(response) { | ||
if(response.ok) { | ||
@@ -114,0 +119,0 @@ return response.json(); |
@@ -8,2 +8,3 @@ var JourneyAPIAdapter = require('./JourneyAPIAdapter'); | ||
function OnlineDB(options) { | ||
options = options || {}; | ||
var fs = require('fs'); | ||
@@ -17,3 +18,3 @@ | ||
var adapter = new JourneyAPIAdapter(credentials, schema); | ||
var adapter = new JourneyAPIAdapter(credentials, schema, options.adapter); | ||
return new Database(schema, adapter); | ||
@@ -20,0 +21,0 @@ } |
{ | ||
"name": "journeyapps", | ||
"version": "0.2.26", | ||
"version": "0.2.27", | ||
"description": "Journey JS library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
622463
14664