Merge pull request #117 from lbryio/lbryweb

Lbryweb support
This commit is contained in:
Sean Yesmunt 2019-03-05 01:32:28 +09:00 committed by GitHub
commit d4e4e71ab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 1031 additions and 9855 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/node_modules /node_modules
yarn-error.log yarn-error.log
package-lock.json

26
dist/bundle.js vendored
View file

@ -2467,6 +2467,10 @@ Lbry.account_encrypt = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return daemonCallWithResult('account_encrypt', params); return daemonCallWithResult('account_encrypt', params);
}; };
Lbry.account_list = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return daemonCallWithResult('account_list', params);
};
Lbry.address_is_mine = function () { Lbry.address_is_mine = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return daemonCallWithResult('address_is_mine', params); return daemonCallWithResult('address_is_mine', params);
@ -2592,6 +2596,28 @@ Lbry.resolve = function () {
}); });
}; };
Lbry.publish = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return new Promise(function (resolve, reject) {
if (Lbry.overrides.publish) {
Lbry.overrides.publish(params).then(resolve, reject);
} else {
apiCall('publish', params, resolve, reject);
}
});
};
// Allow overriding Lbry methods
Lbry.overrides = {};
Lbry.setOverride = function (methodName, newMethod) {
Lbry.overrides[methodName] = newMethod;
};
// Allow overriding daemon connection string (e.g. to `/api/proxy` for lbryweb)
Lbry.setDaemonConnectionString = function (value) {
Lbry.daemonConnectionString = value;
};
var lbryProxy = new Proxy(Lbry, { var lbryProxy = new Proxy(Lbry, {
get: function get(target, name) { get: function get(target, name) {
if (name in target) { if (name in target) {

9849
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,9 +2,7 @@
"name": "lbry-redux", "name": "lbry-redux",
"version": "0.0.1", "version": "0.0.1",
"description": "Common shared components for desktop and mobile.", "description": "Common shared components for desktop and mobile.",
"keywords": [ "keywords": ["lbry"],
"lbry"
],
"license": "MIT", "license": "MIT",
"homepage": "https://lbry.io/", "homepage": "https://lbry.io/",
"bugs": { "bugs": {

View file

@ -79,6 +79,7 @@ Lbry.claim_list_by_channel = (params = {}) => daemonCallWithResult('claim_list_b
Lbry.account_balance = (params = {}) => daemonCallWithResult('account_balance', params); Lbry.account_balance = (params = {}) => daemonCallWithResult('account_balance', params);
Lbry.account_decrypt = () => daemonCallWithResult('account_decrypt', {}); Lbry.account_decrypt = () => daemonCallWithResult('account_decrypt', {});
Lbry.account_encrypt = (params = {}) => daemonCallWithResult('account_encrypt', params); Lbry.account_encrypt = (params = {}) => daemonCallWithResult('account_encrypt', params);
Lbry.account_list = (params = {}) => daemonCallWithResult('account_list', params);
Lbry.address_is_mine = (params = {}) => daemonCallWithResult('address_is_mine', params); Lbry.address_is_mine = (params = {}) => daemonCallWithResult('address_is_mine', params);
Lbry.wallet_lock = () => daemonCallWithResult('wallet_lock', {}); Lbry.wallet_lock = () => daemonCallWithResult('wallet_lock', {});
Lbry.address_unused = (params = {}) => daemonCallWithResult('address_unused', params); Lbry.address_unused = (params = {}) => daemonCallWithResult('address_unused', params);
@ -197,6 +198,26 @@ Lbry.resolve = (params = {}) =>
); );
}); });
Lbry.publish = (params = {}) =>
new Promise((resolve, reject) => {
if (Lbry.overrides.publish) {
Lbry.overrides.publish(params).then(resolve, reject);
} else {
apiCall('publish', params, resolve, reject);
}
});
// Allow overriding Lbry methods
Lbry.overrides = {};
Lbry.setOverride = (methodName, newMethod) => {
Lbry.overrides[methodName] = newMethod;
};
// Allow overriding daemon connection string (e.g. to `/api/proxy` for lbryweb)
Lbry.setDaemonConnectionString = value => {
Lbry.daemonConnectionString = value;
};
const lbryProxy = new Proxy(Lbry, { const lbryProxy = new Proxy(Lbry, {
get(target, name) { get(target, name) {
if (name in target) { if (name in target) {

View file

@ -1,6 +1,6 @@
/* eslint-disable import/no-commonjs */ /* eslint-disable import/no-commonjs */
const path = require('path'); const path = require('path');
const FlowWebpackPlugin = require('flow-webpack-plugin') const FlowWebpackPlugin = require('flow-webpack-plugin');
module.exports = { module.exports = {
mode: 'none', mode: 'none',
@ -9,7 +9,7 @@ module.exports = {
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)` globalObject: `(typeof self !== 'undefined' ? self : this)`,
}, },
module: { module: {
rules: [ rules: [

979
yarn.lock

File diff suppressed because it is too large Load diff