{"version":3,"file":null,"sources":["../src/deprecated.js","../src/makeQueryString.js","../node_modules/httpplease/plugins/jsonrequest.js","../node_modules/httpplease/plugins/jsonresponse.js","../node_modules/httpplease/plugins/json.js","../node_modules/httpplease/plugins/cleanurl.js","../node_modules/httpplease/lib/xhr-browser.js","../node_modules/httpplease/lib/utils/delay.js","../node_modules/httpplease/lib/request.js","../node_modules/xtend/index.js","../node_modules/httpplease/lib/utils/extractResponseProps.js","../node_modules/httpplease/lib/response.js","../node_modules/httpplease/lib/error.js","../node_modules/httpplease/lib/utils/once.js","../node_modules/httpplease/lib/index.js","../src/request.js","../src/findSegments.js","../src/getBranches.js","../src/segmentify.js","../src/createMap.js","../src/getSegment.js","../src/getMapIds.js","../src/getLink.js","../src/getMap.js","../src/getAgent.js","../src/fromSegment.js","../src/config.js","../src/getApplication.js","../src/loadLink.js"],"sourcesContent":["export default function deprecated(oldFunc, newFunc) {\n if (!newFunc) {\n console.warn(`WARNING: ${oldFunc} is deprecated.`);\n } else {\n console.warn(`WARNING: ${oldFunc} is deprecated. Please use ${newFunc} instead.`);\n }\n}\n","/**\n * Makes a query string.\n * @param {object} obj - an object of keys\n * @returns {string} a query string\n */\nexport default function makeQueryString(obj) {\n const parts = Object.keys(obj).reduce((curr, key) => {\n const val = Array.isArray(obj[key]) ? obj[key].join('+') : obj[key];\n curr.push(`${encodeURIComponent(key)}=${encodeURIComponent(val)}`);\n return curr;\n }, []);\n\n if (parts.length) {\n return `?${parts.join('&')}`;\n }\n\n return '';\n}\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n var\n contentType = req.header('Content-Type'),\n hasJsonContentType = contentType &&\n contentType.indexOf('application/json') !== -1;\n\n if (contentType != null && !hasJsonContentType) {\n return;\n }\n\n if (req.body) {\n if (!contentType) {\n req.header('Content-Type', 'application/json');\n }\n\n req.body = JSON.stringify(req.body);\n }\n }\n};\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n var accept = req.header('Accept');\n if (accept == null) {\n req.header('Accept', 'application/json');\n }\n },\n processResponse: function(res) {\n // Check to see if the contentype is \"something/json\" or\n // \"something/somethingelse+json\"\n if (res.contentType && /^.*\\/(?:.*\\+)?json(;|$)/i.test(res.contentType)) {\n var raw = typeof res.body === 'string' ? res.body : res.text;\n if (raw) {\n res.body = JSON.parse(raw);\n }\n }\n }\n};\n","'use strict';\n\nvar jsonrequest = require('./jsonrequest'),\n jsonresponse = require('./jsonresponse');\n\nmodule.exports = {\n processRequest: function(req) {\n jsonrequest.processRequest.call(this, req);\n jsonresponse.processRequest.call(this, req);\n },\n processResponse: function(res) {\n jsonresponse.processResponse.call(this, res);\n }\n};\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n req.url = req.url.replace(/[^%]+/g, function(s) {\n return encodeURI(s);\n });\n }\n};\n","module.exports = window.XMLHttpRequest;\n","'use strict';\n\n// Wrap a function in a `setTimeout` call. This is used to guarantee async\n// behavior, which can avoid unexpected errors.\n\nmodule.exports = function(fn) {\n return function() {\n var\n args = Array.prototype.slice.call(arguments, 0),\n newFunc = function() {\n return fn.apply(null, args);\n };\n setTimeout(newFunc, 0);\n };\n};\n","'use strict';\n\nfunction Request(optsOrUrl) {\n var opts = typeof optsOrUrl === 'string' ? {url: optsOrUrl} : optsOrUrl || {};\n this.method = opts.method ? opts.method.toUpperCase() : 'GET';\n this.url = opts.url;\n this.headers = opts.headers || {};\n this.body = opts.body;\n this.timeout = opts.timeout || 0;\n this.errorOn404 = opts.errorOn404 != null ? opts.errorOn404 : true;\n this.onload = opts.onload;\n this.onerror = opts.onerror;\n}\n\nRequest.prototype.abort = function() {\n if (this.aborted) return;\n this.aborted = true;\n this.xhr.abort();\n return this;\n};\n\nRequest.prototype.header = function(name, value) {\n var k;\n for (k in this.headers) {\n if (this.headers.hasOwnProperty(k)) {\n if (name.toLowerCase() === k.toLowerCase()) {\n if (arguments.length === 1) {\n return this.headers[k];\n }\n\n delete this.headers[k];\n break;\n }\n }\n }\n if (value != null) {\n this.headers[name] = value;\n return value;\n }\n};\n\n\nmodule.exports = Request;\n","module.exports = extend\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","'use strict';\n\nvar extend = require('xtend');\n\nmodule.exports = function(req) {\n var xhr = req.xhr;\n var props = {request: req, xhr: xhr};\n\n // Try to create the response from the request. If the request was aborted,\n // accesssing properties of the XHR may throw an error, so we wrap in a\n // try/catch.\n try {\n var lines, i, m, headers = {};\n if (xhr.getAllResponseHeaders) {\n lines = xhr.getAllResponseHeaders().split('\\n');\n for (i = 0; i < lines.length; i++) {\n if ((m = lines[i].match(/\\s*([^\\s]+):\\s+([^\\s]+)/))) {\n headers[m[1]] = m[2];\n }\n }\n }\n\n props = extend(props, {\n status: xhr.status,\n contentType: xhr.contentType || (xhr.getResponseHeader && xhr.getResponseHeader('Content-Type')),\n headers: headers,\n text: xhr.responseText,\n body: xhr.response || xhr.responseText\n });\n } catch (err) {}\n\n return props;\n};\n","'use strict';\n\nvar Request = require('./request');\nvar extractResponseProps = require('./utils/extractResponseProps');\n\nfunction Response(props) {\n this.request = props.request;\n this.xhr = props.xhr;\n this.headers = props.headers || {};\n this.status = props.status || 0;\n this.text = props.text;\n this.body = props.body;\n this.contentType = props.contentType;\n this.isHttpError = props.status >= 400;\n}\n\nResponse.prototype.header = Request.prototype.header;\n\nResponse.fromRequest = function(req) {\n return new Response(extractResponseProps(req));\n};\n\n\nmodule.exports = Response;\n","'use strict';\n\nvar Response = require('./response');\nvar extractResponseProps = require('./utils/extractResponseProps');\nvar extend = require('xtend');\n\nfunction RequestError(message, props) {\n var err = new Error(message);\n err.name = 'RequestError';\n this.name = err.name;\n this.message = err.message;\n if (err.stack) {\n this.stack = err.stack;\n }\n\n this.toString = function() {\n return this.message;\n };\n\n for (var k in props) {\n if (props.hasOwnProperty(k)) {\n this[k] = props[k];\n }\n }\n}\n\nRequestError.prototype = extend(Error.prototype);\nRequestError.prototype.constructor = RequestError;\n\nRequestError.create = function(message, req, props) {\n var err = new RequestError(message, props);\n Response.call(err, extractResponseProps(req));\n return err;\n};\n\nmodule.exports = RequestError;\n","'use strict';\n\n// A \"once\" utility.\nmodule.exports = function(fn) {\n var result, called = false;\n return function() {\n if (!called) {\n called = true;\n result = fn.apply(this, arguments);\n }\n return result;\n };\n};\n","'use strict';\n\nvar\n cleanURL = require('../plugins/cleanurl'),\n XHR = require('./xhr'),\n delay = require('./utils/delay'),\n RequestError = require('./error'),\n Response = require('./response'),\n Request = require('./request'),\n extend = require('xtend'),\n once = require('./utils/once');\n\nvar i,\n createError = RequestError.create;\n\nfunction factory(defaults, plugins) {\n defaults = defaults || {};\n plugins = plugins || [];\n\n function http(req, cb) {\n var xhr, plugin, done, k, timeoutId, supportsLoadAndErrorEvents;\n\n req = new Request(extend(defaults, req));\n\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.processRequest) {\n plugin.processRequest(req);\n }\n }\n\n // Give the plugins a chance to create the XHR object\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.createXHR) {\n xhr = plugin.createXHR(req);\n break; // First come, first serve\n }\n }\n xhr = xhr || new XHR();\n\n req.xhr = xhr;\n\n // Use a single completion callback. This can be called with or without\n // an error. If no error is passed, the request will be examined to see\n // if it was successful.\n done = once(delay(function(rawError) {\n clearTimeout(timeoutId);\n xhr.onload = xhr.onerror = xhr.onabort = xhr.onreadystatechange = xhr.ontimeout = xhr.onprogress = null;\n\n var err = getError(req, rawError);\n\n var res = err || Response.fromRequest(req);\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.processResponse) {\n plugin.processResponse(res);\n }\n }\n\n // Invoke callbacks\n if (err && req.onerror) req.onerror(err);\n if (!err && req.onload) req.onload(res);\n if (cb) cb(err, err ? undefined : res);\n\n }));\n\n supportsLoadAndErrorEvents = ('onload' in xhr) && ('onerror' in xhr);\n xhr.onload = function() { done(); };\n xhr.onerror = done;\n xhr.onabort = function() { done(); };\n\n // We'd rather use `onload`, `onerror`, and `onabort` since they're the\n // only way to reliably detect successes and failures but, if they\n // aren't available, we fall back to using `onreadystatechange`.\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== 4) return;\n\n if (req.aborted) return done();\n\n if (!supportsLoadAndErrorEvents) {\n // Assume a status of 0 is an error. This could be a false\n // positive, but there's no way to tell when using\n // `onreadystatechange` ):\n // See matthewwithanm/react-inlinesvg#10.\n\n // Some browsers don't like you reading XHR properties when the\n // XHR has been aborted. In case we've gotten here as a result\n // of that (either our calling `about()` in the timeout handler\n // or the user calling it directly even though they shouldn't),\n // be careful about accessing it.\n var status;\n try {\n status = xhr.status;\n } catch (err) {}\n var err = status === 0 ? new Error('Internal XHR Error') : null;\n return done(err);\n }\n };\n\n // IE sometimes fails if you don't specify every handler.\n // See http://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment\n xhr.ontimeout = function() { /* noop */ };\n xhr.onprogress = function() { /* noop */ };\n\n xhr.open(req.method, req.url);\n\n if (req.timeout) {\n // If we use the normal XHR timeout mechanism (`xhr.timeout` and\n // `xhr.ontimeout`), `onreadystatechange` will be triggered before\n // `ontimeout`. There's no way to recognize that it was triggered by\n // a timeout, and we'd be unable to dispatch the right error.\n timeoutId = setTimeout(function() {\n req.timedOut = true;\n done();\n try {\n xhr.abort();\n } catch (err) {}\n }, req.timeout);\n }\n\n for (k in req.headers) {\n if (req.headers.hasOwnProperty(k)) {\n xhr.setRequestHeader(k, req.headers[k]);\n }\n }\n\n xhr.send(req.body);\n\n return req;\n }\n\n var method,\n methods = ['get', 'post', 'put', 'head', 'patch', 'delete'],\n verb = function(method) {\n return function(req, cb) {\n req = new Request(req);\n req.method = method;\n return http(req, cb);\n };\n };\n for (i = 0; i < methods.length; i++) {\n method = methods[i];\n http[method] = verb(method);\n }\n\n http.plugins = function() {\n return plugins;\n };\n\n http.defaults = function(newValues) {\n if (newValues) {\n return factory(extend(defaults, newValues), plugins);\n }\n return defaults;\n };\n\n http.use = function() {\n var newPlugins = Array.prototype.slice.call(arguments, 0);\n return factory(defaults, plugins.concat(newPlugins));\n };\n\n http.bare = function() {\n return factory();\n };\n\n http.Request = Request;\n http.Response = Response;\n http.RequestError = RequestError;\n\n return http;\n}\n\nmodule.exports = factory({}, [cleanURL]);\n\n/**\n * Analyze the request to see if it represents an error. If so, return it! An\n * original error object can be passed as a hint.\n */\nfunction getError(req, err) {\n if (req.aborted) return createError('Request aborted', req, {name: 'Abort'});\n\n if (req.timedOut) return createError('Request timeout', req, {name: 'Timeout'});\n\n var xhr = req.xhr;\n var type = Math.floor(xhr.status / 100);\n\n var kind;\n switch (type) {\n case 0:\n case 2:\n // These don't represent errors unless the function was passed an\n // error object explicitly.\n if (!err) return;\n return createError(err.message, req);\n case 4:\n // Sometimes 4XX statuses aren't errors.\n if (xhr.status === 404 && !req.errorOn404) return;\n kind = 'Client';\n break;\n case 5:\n kind = 'Server';\n break;\n default:\n kind = 'HTTP';\n }\n var msg = kind + ' Error: ' +\n 'The server returned a status of ' + xhr.status +\n ' for the request \"' +\n req.method.toUpperCase() + ' ' + req.url + '\"';\n return createError(msg, req);\n}\n","import json from 'httpplease/plugins/json';\nimport httpplease from 'httpplease';\n\nconst request = httpplease.use(json);\n\nfunction send(method, url, args) {\n return new Promise((resolve, reject) => {\n request({ method, url, body: args }, (err, res) => {\n if (err) {\n const error = (err && err.body && err.body.meta && err.body.meta.errorMessage)\n ? new Error(err.body.meta.errorMessage)\n : err;\n error.status = err.status;\n reject(error);\n } else {\n resolve(res);\n }\n });\n });\n}\n\nexport function get(url) {\n return send('GET', url);\n}\n\nexport function post(url, args) {\n return send('POST', url, args);\n}\n","import segmentify from './segmentify';\nimport makeQueryString from './makeQueryString';\nimport { get } from './request';\n\nexport default function findSegments(agent, opts = {}) {\n return get(`${agent.url}/segments${makeQueryString(opts)}`)\n .then(res => res.body.map(obj => segmentify(agent, obj)));\n}\n","import findSegments from './findSegments';\nimport deprecated from './deprecated';\n\nexport default function getBranches(agent, prevLinkHash, tags = []) {\n deprecated(\n 'Agent#getBranches(agent, prevLinkHash, tags = [])',\n 'Agent#findSegments(agent, filter)'\n );\n\n return findSegments(agent, { prevLinkHash, tags });\n}\n","import deprecated from './deprecated';\nimport getBranches from './getBranches';\nimport { post } from './request';\n\nexport default function segmentify(agent, obj) {\n Object\n .keys(agent.agentInfo.actions)\n .filter(key => ['init'].indexOf(key) < 0)\n .forEach(key => {\n /*eslint-disable*/\n obj[key] = (...args) =>\n post(`${agent.url}/segments/${obj.meta.linkHash}/${key}`, args)\n .then(res => segmentify(agent, res.body))\n });\n\n /*eslint-disable*/\n obj.getPrev = () => {\n /*eslint-enable*/\n if (obj.link.meta.prevLinkHash) {\n return agent.getSegment(obj.link.meta.prevLinkHash);\n }\n\n return Promise.resolve(null);\n };\n\n // Deprecated.\n /*eslint-disable*/\n obj.load = () => {\n /*eslint-enable*/\n deprecated('segment#load()');\n return Promise.resolve(segmentify(agent, {\n link: JSON.parse(JSON.stringify(obj.link)),\n meta: JSON.parse(JSON.stringify(obj.meta))\n }));\n };\n\n // Deprecated.\n /*eslint-disable*/\n obj.getBranches = (...args) => {\n /*eslint-enable*/\n return getBranches(agent, obj.meta.linkHash, ...args);\n };\n\n return obj;\n}\n","import segmentify from './segmentify';\nimport { post } from './request';\n\nexport default function createMap(agent, ...args) {\n return post(`${agent.url}/segments`, args)\n .then(res => segmentify(agent, res.body));\n}\n","import segmentify from './segmentify';\nimport { get } from './request';\n\nexport default function getSegment(agent, linkHash) {\n return get(`${agent.url}/segments/${linkHash}`)\n .then(res => segmentify(agent, res.body));\n}\n","import makeQueryString from './makeQueryString';\nimport { get } from './request';\n\nexport default function getMapIds(agent, opts = {}) {\n return get(`${agent.url}/maps${makeQueryString(opts)}`)\n .then(res => res.body);\n}\n","import getSegment from './getSegment';\nimport deprecated from './deprecated';\n\nexport default function getLink(agent, hash) {\n deprecated('Agent#getLink(agent, hash)', 'Agent#getSegment(agent, hash)');\n\n return getSegment(agent, hash);\n}\n","import findSegments from './findSegments';\nimport deprecated from './deprecated';\n\nexport default function getMap(agent, mapId, tags = []) {\n deprecated('getMap(agent, mapId, tags = [])', 'findSegments(agent, filter)');\n\n return findSegments(agent, { mapId, tags });\n}\n","import createMap from './createMap';\nimport getSegment from './getSegment';\nimport findSegments from './findSegments';\nimport getMapIds from './getMapIds';\nimport { get } from './request';\n\n// Deprecated.\nimport getBranches from './getBranches';\nimport getLink from './getLink';\nimport getMap from './getMap';\n\nexport default function getAgent(url) {\n return get(url)\n .then(res => {\n const agent = res.body;\n\n agent.url = url;\n agent.createMap = createMap.bind(null, agent);\n agent.getSegment = getSegment.bind(null, agent);\n agent.findSegments = findSegments.bind(null, agent);\n agent.getMapIds = getMapIds.bind(null, agent);\n\n // Deprecated.\n agent.getBranches = getBranches.bind(null, agent);\n agent.getLink = getLink.bind(null, agent);\n agent.getMap = getMap.bind(null, agent);\n\n return agent;\n });\n}\n","import getAgent from './getAgent';\nimport segmentify from './segmentify';\n\nexport default function fromSegment(obj) {\n return getAgent(obj.meta.agentUrl || obj.meta.applicationLocation)\n .then(agent => {\n const segment = segmentify(agent, obj);\n return { agent, segment };\n });\n}\n","// Deprecated.\nexport default {\n applicationUrl: 'https://%s.stratumn.rocks'\n};\n","import getAgent from './getAgent';\nimport deprecated from './deprecated';\nimport config from './config';\n\nexport default function getApplication(name, url) {\n deprecated('getApplication(name, url)', 'getAgent(url)');\n\n return getAgent(url || config.applicationUrl.replace('%s', name));\n}\n","import fromSegment from './fromSegment';\nimport deprecated from './deprecated';\n\nexport default function loadLink(obj) {\n deprecated('loadLink(obj)', 'fromSegment(obj)');\n\n return fromSegment(obj)\n .then(({ segment }) => segment);\n}\n"],"names":["deprecated","oldFunc","newFunc","warn","makeQueryString","obj","parts","Object","keys","reduce","curr","key","val","Array","isArray","join","push","encodeURIComponent","length","commonjsHelpers.interopDefault","request","httpplease","use","json","send","method","url","args","Promise","resolve","reject","body","err","res","error","meta","errorMessage","Error","status","get","post","findSegments","agent","opts","then","map","segmentify","getBranches","prevLinkHash","tags","agentInfo","actions","filter","indexOf","forEach","linkHash","getPrev","link","getSegment","load","JSON","parse","stringify","createMap","getMapIds","getLink","hash","getMap","mapId","getAgent","bind","fromSegment","agentUrl","applicationLocation","segment","getApplication","name","config","applicationUrl","replace","loadLink"],"mappings":";;;;;;AAAe,SAASA,UAAT,CAAoBC,OAApB,EAA6BC,OAA7B,EAAsC;MAC/C,CAACA,OAAL,EAAc;YACJC,IAAR,eAAyBF,OAAzB;GADF,MAEO;YACGE,IAAR,eAAyBF,OAAzB,mCAA8DC,OAA9D;;;;ACJJ;;;;;AAKA,AAAe,SAASE,eAAT,CAAyBC,GAAzB,EAA8B;MACrCC,QAAQC,OAAOC,IAAP,CAAYH,GAAZ,EAAiBI,MAAjB,CAAwB,UAACC,IAAD,EAAOC,GAAP,EAAe;QAC7CC,MAAMC,MAAMC,OAAN,CAAcT,IAAIM,GAAJ,CAAd,IAA0BN,IAAIM,GAAJ,EAASI,IAAT,CAAc,GAAd,CAA1B,GAA+CV,IAAIM,GAAJ,CAA3D;SACKK,IAAL,CAAaC,mBAAmBN,GAAnB,CAAb,SAAwCM,mBAAmBL,GAAnB,CAAxC;WACOF,IAAP;GAHY,EAIX,EAJW,CAAd;;MAMIJ,MAAMY,MAAV,EAAkB;iBACLZ,MAAMS,IAAN,CAAW,GAAX,CAAX;;;SAGK,EAAP;;;;;;;;;;;;AChBF,YAAY,CAAC;;AAEb,MAAM,CAAC,OAAO,GAAG;EACf,cAAc,EAAE,SAAS,GAAG,EAAE;IAC5B;MACE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC;MACxC,kBAAkB,GAAG,WAAW;2BACX,WAAW,CAAC,OAAO,CAA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