maint: support 0.31 SDK (#113)
* maint: support 0.31 SDK resolve param changed from uri/uris, to urls. * feat: stop daemon sdk call * fix: ffffffffff webpack bug https://github.com/nulogy/design-system/pull/132
This commit is contained in:
parent
e94de32487
commit
ec1d5bd41a
4 changed files with 184 additions and 186 deletions
39
dist/bundle.js
vendored
39
dist/bundle.js
vendored
|
@ -7,7 +7,7 @@
|
||||||
var a = factory();
|
var a = factory();
|
||||||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
||||||
}
|
}
|
||||||
})(window, function() {
|
})((typeof self !== 'undefined' ? self : this), function() {
|
||||||
return /******/ (function(modules) { // webpackBootstrap
|
return /******/ (function(modules) { // webpackBootstrap
|
||||||
/******/ // The module cache
|
/******/ // The module cache
|
||||||
/******/ var installedModules = {};
|
/******/ var installedModules = {};
|
||||||
|
@ -1956,9 +1956,11 @@ module.exports = v4;
|
||||||
// and inconsistent support for the `crypto` API. We do the best we can via
|
// and inconsistent support for the `crypto` API. We do the best we can via
|
||||||
// feature-detection
|
// feature-detection
|
||||||
|
|
||||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
// getRandomValues needs to be invoked in a context where "this" is a Crypto
|
||||||
var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||
|
// implementation. Also, find the complete implementation of crypto on IE11.
|
||||||
(typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));
|
var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
|
||||||
|
(typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
|
||||||
|
|
||||||
if (getRandomValues) {
|
if (getRandomValues) {
|
||||||
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
||||||
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
||||||
|
@ -2001,14 +2003,15 @@ for (var i = 0; i < 256; ++i) {
|
||||||
function bytesToUuid(buf, offset) {
|
function bytesToUuid(buf, offset) {
|
||||||
var i = offset || 0;
|
var i = offset || 0;
|
||||||
var bth = byteToHex;
|
var bth = byteToHex;
|
||||||
return bth[buf[i++]] + bth[buf[i++]] +
|
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
||||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
return ([bth[buf[i++]], bth[buf[i++]],
|
||||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
bth[buf[i++]] + bth[buf[i++]] +
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
bth[buf[i++]] + bth[buf[i++]] +
|
bth[buf[i++]], bth[buf[i++]],
|
||||||
bth[buf[i++]] + bth[buf[i++]];
|
bth[buf[i++]], bth[buf[i++]],
|
||||||
|
bth[buf[i++]], bth[buf[i++]]]).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = bytesToUuid;
|
module.exports = bytesToUuid;
|
||||||
|
@ -2091,7 +2094,7 @@ function doResolveUris(uris) {
|
||||||
});
|
});
|
||||||
|
|
||||||
var resolveInfo = {};
|
var resolveInfo = {};
|
||||||
_lbry2.default.resolve({ uris: urisToResolve }).then(function (result) {
|
_lbry2.default.resolve({ urls: urisToResolve }).then(function (result) {
|
||||||
Object.entries(result).forEach(function (_ref) {
|
Object.entries(result).forEach(function (_ref) {
|
||||||
var _ref2 = _slicedToArray(_ref, 2),
|
var _ref2 = _slicedToArray(_ref, 2),
|
||||||
uri = _ref2[0],
|
uri = _ref2[0],
|
||||||
|
@ -2412,6 +2415,9 @@ Lbry.file_set_status = function () {
|
||||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||||
return daemonCallWithResult('file_set_status', params);
|
return daemonCallWithResult('file_set_status', params);
|
||||||
};
|
};
|
||||||
|
Lbry.stop = function () {
|
||||||
|
return daemonCallWithResult('stop', {});
|
||||||
|
};
|
||||||
|
|
||||||
// claims
|
// claims
|
||||||
Lbry.claim_list_by_channel = function () {
|
Lbry.claim_list_by_channel = function () {
|
||||||
|
@ -2547,12 +2553,7 @@ Lbry.resolve = function () {
|
||||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
apiCall('resolve', params, function (data) {
|
apiCall('resolve', params, function (data) {
|
||||||
if ('uri' in params) {
|
resolve(data || {});
|
||||||
// If only a single URI was requested, don't nest the results in an object
|
|
||||||
resolve(data && data[params.uri] ? data[params.uri] : {});
|
|
||||||
} else {
|
|
||||||
resolve(data || {});
|
|
||||||
}
|
|
||||||
}, reject);
|
}, reject);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -70,6 +70,7 @@ Lbry.status = (params = {}) => daemonCallWithResult('status', params);
|
||||||
Lbry.version = () => daemonCallWithResult('version', {});
|
Lbry.version = () => daemonCallWithResult('version', {});
|
||||||
Lbry.file_delete = (params = {}) => daemonCallWithResult('file_delete', params);
|
Lbry.file_delete = (params = {}) => daemonCallWithResult('file_delete', params);
|
||||||
Lbry.file_set_status = (params = {}) => daemonCallWithResult('file_set_status', params);
|
Lbry.file_set_status = (params = {}) => daemonCallWithResult('file_set_status', params);
|
||||||
|
Lbry.stop = () => daemonCallWithResult('stop', {});
|
||||||
|
|
||||||
// claims
|
// claims
|
||||||
Lbry.claim_list_by_channel = (params = {}) => daemonCallWithResult('claim_list_by_channel', params);
|
Lbry.claim_list_by_channel = (params = {}) => daemonCallWithResult('claim_list_by_channel', params);
|
||||||
|
@ -189,12 +190,7 @@ Lbry.resolve = (params = {}) =>
|
||||||
'resolve',
|
'resolve',
|
||||||
params,
|
params,
|
||||||
data => {
|
data => {
|
||||||
if ('uri' in params) {
|
resolve(data || {});
|
||||||
// If only a single URI was requested, don't nest the results in an object
|
|
||||||
resolve(data && data[params.uri] ? data[params.uri] : {});
|
|
||||||
} else {
|
|
||||||
resolve(data || {});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
reject
|
reject
|
||||||
);
|
);
|
||||||
|
|
|
@ -32,7 +32,7 @@ export function doResolveUris(uris, returnCachedClaims = false) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const resolveInfo = {};
|
const resolveInfo = {};
|
||||||
Lbry.resolve({ uris: urisToResolve }).then(result => {
|
Lbry.resolve({ urls: urisToResolve }).then(result => {
|
||||||
Object.entries(result).forEach(([uri, uriResolveInfo]) => {
|
Object.entries(result).forEach(([uri, uriResolveInfo]) => {
|
||||||
const fallbackResolveInfo = {
|
const fallbackResolveInfo = {
|
||||||
claim: null,
|
claim: null,
|
||||||
|
|
|
@ -8,7 +8,8 @@ module.exports = {
|
||||||
output: {
|
output: {
|
||||||
filename: 'bundle.js',
|
filename: 'bundle.js',
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
libraryTarget: 'umd'
|
libraryTarget: 'umd',
|
||||||
|
globalObject: `(typeof self !== 'undefined' ? self : this)`
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
|
|
Loading…
Add table
Reference in a new issue