@erebos/api-bzz-base
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -88,3 +88,3 @@ "use strict"; | ||
}); | ||
var signature = sig.r.toArray().concat(sig.s.toArray(), [sig.recoveryParam]); | ||
var signature = sig.r.toArray('be', 32).concat(sig.s.toArray('be', 32), [sig.recoveryParam]); | ||
return toHexValue(signature); | ||
@@ -91,0 +91,0 @@ }; |
@@ -302,3 +302,3 @@ "use strict"; | ||
_proto.createFeedManifest = function createFeedManifest(user, options) { | ||
_proto.createFeedManifest = function createFeedManifest(user, options, headers) { | ||
if (options === void 0) { | ||
@@ -308,2 +308,6 @@ options = {}; | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var manifest = { | ||
@@ -319,6 +323,6 @@ entries: [{ | ||
}; | ||
return this.uploadFile(JSON.stringify(manifest)).then(_hex.hexValueType); | ||
return this.uploadFile(JSON.stringify(manifest), {}, headers).then(_hex.hexValueType); | ||
}; | ||
_proto.getFeedMetadata = function getFeedMetadata(user, options) { | ||
_proto.getFeedMetadata = function getFeedMetadata(user, options, headers) { | ||
if (options === void 0) { | ||
@@ -328,6 +332,13 @@ options = {}; | ||
return this._fetch(this.getFeedURL(user, options, 'meta')).then(resJSON); | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var url = this.getFeedURL(user, options, 'meta'); | ||
return this._fetch(url, { | ||
headers: headers | ||
}).then(resJSON); | ||
}; | ||
_proto.getFeedValue = function getFeedValue(user, options) { | ||
_proto.getFeedValue = function getFeedValue(user, options, headers) { | ||
if (options === void 0) { | ||
@@ -337,6 +348,13 @@ options = {}; | ||
return this._fetch(this.getFeedURL(user, options)).then(resOrError); | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var url = this.getFeedURL(user, options); | ||
return this._fetch(url, { | ||
headers: headers | ||
}).then(resOrError); | ||
}; | ||
_proto.postFeedValue = function postFeedValue(keyPair, data, options) { | ||
_proto.postFeedValue = function postFeedValue(keyPair, data, options, headers) { | ||
var _this2 = this; | ||
@@ -348,4 +366,8 @@ | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var user = (0, _feed.pubKeyToAddress)(keyPair.getPublic()); | ||
return this.getFeedMetadata(user, options).then(function (meta) { | ||
return this.getFeedMetadata(user, options, headers).then(function (meta) { | ||
var body = (0, _hex.default)(data).toBuffer(); | ||
@@ -359,3 +381,4 @@ | ||
method: 'POST', | ||
body: body | ||
body: body, | ||
headers: headers | ||
}); | ||
@@ -362,0 +385,0 @@ }).then(resOrError); |
@@ -63,3 +63,3 @@ import createHex, { hexValueType } from '@erebos/hex'; | ||
}); | ||
var signature = sig.r.toArray().concat(sig.s.toArray(), [sig.recoveryParam]); | ||
var signature = sig.r.toArray('be', 32).concat(sig.s.toArray('be', 32), [sig.recoveryParam]); | ||
return toHexValue(signature); | ||
@@ -66,0 +66,0 @@ }; |
@@ -255,3 +255,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
_proto.createFeedManifest = function createFeedManifest(user, options) { | ||
_proto.createFeedManifest = function createFeedManifest(user, options, headers) { | ||
if (options === void 0) { | ||
@@ -261,2 +261,6 @@ options = {}; | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var manifest = { | ||
@@ -272,6 +276,6 @@ entries: [{ | ||
}; | ||
return this.uploadFile(JSON.stringify(manifest)).then(hexValueType); | ||
return this.uploadFile(JSON.stringify(manifest), {}, headers).then(hexValueType); | ||
}; | ||
_proto.getFeedMetadata = function getFeedMetadata(user, options) { | ||
_proto.getFeedMetadata = function getFeedMetadata(user, options, headers) { | ||
if (options === void 0) { | ||
@@ -281,6 +285,13 @@ options = {}; | ||
return this._fetch(this.getFeedURL(user, options, 'meta')).then(resJSON); | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var url = this.getFeedURL(user, options, 'meta'); | ||
return this._fetch(url, { | ||
headers: headers | ||
}).then(resJSON); | ||
}; | ||
_proto.getFeedValue = function getFeedValue(user, options) { | ||
_proto.getFeedValue = function getFeedValue(user, options, headers) { | ||
if (options === void 0) { | ||
@@ -290,6 +301,13 @@ options = {}; | ||
return this._fetch(this.getFeedURL(user, options)).then(resOrError); | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var url = this.getFeedURL(user, options); | ||
return this._fetch(url, { | ||
headers: headers | ||
}).then(resOrError); | ||
}; | ||
_proto.postFeedValue = function postFeedValue(keyPair, data, options) { | ||
_proto.postFeedValue = function postFeedValue(keyPair, data, options, headers) { | ||
var _this2 = this; | ||
@@ -301,4 +319,8 @@ | ||
if (headers === void 0) { | ||
headers = {}; | ||
} | ||
var user = pubKeyToAddress(keyPair.getPublic()); | ||
return this.getFeedMetadata(user, options).then(function (meta) { | ||
return this.getFeedMetadata(user, options, headers).then(function (meta) { | ||
var body = createHex(data).toBuffer(); | ||
@@ -312,3 +334,4 @@ | ||
method: 'POST', | ||
body: body | ||
body: body, | ||
headers: headers | ||
}); | ||
@@ -315,0 +338,0 @@ }).then(resOrError); |
{ | ||
"name": "@erebos/api-bzz-base", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Base Bzz API", | ||
@@ -30,4 +30,4 @@ "repository": "git@github.com:MainframeHQ/erebos.git", | ||
"devDependencies": { | ||
"flow-bin": "^0.86.0" | ||
"flow-bin": "^0.87.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
45721
691