mapexplorer-core
Advanced tools
Comparing version 0.0.18 to 0.1.0
@@ -15,3 +15,3 @@ var path = require('path'); | ||
// frameworks to use | ||
frameworks: ['mocha', 'should'], | ||
frameworks: ['mocha', 'should', 'sinon'], | ||
@@ -18,0 +18,0 @@ |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-hierarchy'), require('d3-transition'), require('d3-ease'), require('d3-selection'), require('d3-zoom'), require('d3-array'), require('deepmerge'), require('stratumn-sdk'), require('canonical-json'), require('js-sha256'), require('superagent')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-hierarchy', 'd3-transition', 'd3-ease', 'd3-selection', 'd3-zoom', 'd3-array', 'deepmerge', 'stratumn-sdk', 'canonical-json', 'js-sha256', 'superagent'], factory) : | ||
(factory((global.mapexplorerCore = global.mapexplorerCore || {}),global.d3,global.d3,global.d3,global.d3,global.d3,global.d3,global.merge,global.StratumnSDK,global.stringify,global.sha256,global.request)); | ||
}(this, (function (exports,d3Hierarchy,d3Transition,d3Ease,d3Selection,d3Zoom,d3Array,merge,StratumnSDK,stringify,sha256,request) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-hierarchy'), require('d3-transition'), require('d3-ease'), require('d3-selection'), require('d3-zoom'), require('d3-array'), require('deepmerge'), require('stratumn-sdk'), require('canonical-json'), require('js-sha256'), require('httpplease')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-hierarchy', 'd3-transition', 'd3-ease', 'd3-selection', 'd3-zoom', 'd3-array', 'deepmerge', 'stratumn-sdk', 'canonical-json', 'js-sha256', 'httpplease'], factory) : | ||
(factory((global.mapexplorerCore = global.mapexplorerCore || {}),global.d3,global.d3,global.d3,global.d3,global.d3,global.d3,global.merge,global.stratumnSdk,global.stringify,global.sha256,global.httpplease)); | ||
}(this, (function (exports,d3Hierarchy,d3Transition,d3Ease,d3Selection,d3Zoom,d3Array,merge,stratumnSdk,stringify,sha256,httpplease) { 'use strict'; | ||
merge = 'default' in merge ? merge['default'] : merge; | ||
var StratumnSDK__default = 'default' in StratumnSDK ? StratumnSDK['default'] : StratumnSDK; | ||
stringify = 'default' in stringify ? stringify['default'] : stringify; | ||
sha256 = 'default' in sha256 ? sha256['default'] : sha256; | ||
request = 'default' in request ? request['default'] : request; | ||
httpplease = 'default' in httpplease ? httpplease['default'] : httpplease; | ||
@@ -250,3 +249,3 @@ function makeLink(source, target) { | ||
if (!segment.link.state) { | ||
return StratumnSDK.loadLink(segment).then(function (res) { | ||
return stratumnSdk.loadLink(segment).then(function (res) { | ||
return merge(res, segment); | ||
@@ -343,3 +342,3 @@ }); | ||
value: function _load(map) { | ||
return StratumnSDK__default.getApplication(map.application).then(function (app) { | ||
return stratumnSdk.getApplication(map.application).then(function (app) { | ||
return app.getMap(map.id); | ||
@@ -465,3 +464,4 @@ }).then(function (res) { | ||
return this._getFossil(txId).then(function (res) { | ||
if (!res.body.outputs.find(function (output) { | ||
var body = JSON.parse(res.xhr.response); | ||
if (!body.outputs.find(function (output) { | ||
return output.data_hex === _this2.segment.meta.evidence.merkleRoot; | ||
@@ -482,3 +482,3 @@ })) { | ||
var p = new Promise(function (resolve, reject) { | ||
return request('https://api.blockcypher.com/v1/btc/main/txs/' + txId).end(function (err, res) { | ||
return httpplease.get('https://api.blockcypher.com/v1/btc/main/txs/' + txId, function (err, res) { | ||
return err ? reject(err) : resolve(res); | ||
@@ -485,0 +485,0 @@ }); |
{ | ||
"name": "mapexplorer-core", | ||
"version": "0.0.18", | ||
"version": "0.1.0", | ||
"description": "Core library for building Map Explorer components", | ||
@@ -55,2 +55,3 @@ "main": "lib/mapexplorer-core.js", | ||
"karma-should": "^1.0.0", | ||
"karma-sinon": "^1.0.5", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
@@ -61,2 +62,3 @@ "mocha": "^2.4.5", | ||
"rollup-plugin-babel": "^2.6.1", | ||
"rollup-plugin-coffee-script": "^1.1.0", | ||
"rollup-plugin-commonjs": "^3.3.1", | ||
@@ -69,3 +71,4 @@ "rollup-plugin-json": "^2.0.1", | ||
"should": "^8.2.2", | ||
"superagent-nock": "^0.1.1" | ||
"sinon": "^1.17.5", | ||
"zock": "^0.2.6" | ||
}, | ||
@@ -81,6 +84,6 @@ "dependencies": { | ||
"deepmerge": "^0.2.10", | ||
"httpplease": "^0.16.4", | ||
"js-sha256": "^0.3.0", | ||
"stratumn-sdk": "^0.5.0", | ||
"superagent": "1.7.1" | ||
"stratumn-sdk": "^0.6.0" | ||
} | ||
} |
@@ -7,3 +7,3 @@ import ChainTree from './ChainTree'; | ||
import tagsSet from './tagsSet'; | ||
import StratumnSDK from 'stratumn-sdk'; | ||
import { getApplication } from 'stratumn-sdk'; | ||
@@ -56,3 +56,3 @@ export const defaultOptions = { | ||
_load(map) { | ||
return StratumnSDK.getApplication(map.application) | ||
return getApplication(map.application) | ||
.then(app => app.getMap(map.id)) | ||
@@ -59,0 +59,0 @@ .then(res => Promise.all(res.map(link => link.load()))) |
import hashJson from './hashJson'; | ||
import request from 'superagent'; | ||
import httpplease from 'httpplease'; | ||
@@ -82,3 +82,4 @@ import computeMerkleParent from './computeMerkleParent'; | ||
.then(res => { | ||
if (!res.body.outputs.find( | ||
const body = JSON.parse(res.xhr.response); | ||
if (!body.outputs.find( | ||
output => output.data_hex === this.segment.meta.evidence.merkleRoot)) { | ||
@@ -97,3 +98,3 @@ return 'Merkle root not found in transaction data'; | ||
const p = new Promise((resolve, reject) => | ||
request(`https://api.blockcypher.com/v1/btc/main/txs/${txId}`).end((err, res) => | ||
httpplease.get(`https://api.blockcypher.com/v1/btc/main/txs/${txId}`, (err, res) => | ||
(err ? reject(err) : resolve(res))) | ||
@@ -100,0 +101,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
Sorry, the diff of this file is not supported yet
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
Network access
Supply chain riskThis module accesses the network.
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
134965
1775
33
3
+ Addedhttpplease@^0.16.4
+ Addedhttpplease@0.16.4(transitive)
+ Addedstratumn-sdk@0.6.0(transitive)
+ Addedurllite@0.5.0(transitive)
+ Addedxmlhttprequest@1.7.01.8.0(transitive)
+ Addedxtend@3.0.04.0.2(transitive)
- Removedsuperagent@1.7.1
- Removedasync@0.9.21.5.2(transitive)
- Removedcombined-stream@0.0.71.0.8(transitive)
- Removedcomponent-emitter@1.2.1(transitive)
- Removedcookiejar@2.0.6(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddelayed-stream@0.0.51.0.0(transitive)
- Removedextend@1.2.13.0.0(transitive)
- Removedform-data@0.2.01.0.0-rc3(transitive)
- Removedformidable@1.0.17(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@0.0.1(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@1.3.4(transitive)
- Removedmime-db@1.12.01.52.0(transitive)
- Removedmime-types@2.0.142.1.35(transitive)
- Removedms@2.0.0(transitive)
- Removedqs@2.3.3(transitive)
- Removedreadable-stream@1.0.27-1(transitive)
- Removedreduce-component@1.0.1(transitive)
- Removedstratumn-sdk@0.5.0(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedsuperagent@1.7.11.8.5(transitive)
Updatedstratumn-sdk@^0.6.0