@p2pmodels/connect-round-robin
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
import RoundRobin from './models/RoundRobin'; | ||
declare type Config = { | ||
subgraphUrl?: string; | ||
pollInterval?: number; | ||
subgraphUrl?: string; | ||
}; | ||
@@ -6,0 +6,0 @@ declare const _default: (app: import("@aragon/connect-core").App | Promise<import("@aragon/connect-core").App>, connector?: string | [string, Config | undefined] | undefined) => Promise<import("@aragon/connect-core").App & RoundRobin>; |
@@ -29,12 +29,13 @@ "use strict"; | ||
const connector_1 = __importStar(require("./thegraph/connector")); | ||
exports.default = connect_core_1.createAppConnector(({ app, config, connector, network, orgConnector, verbose }) => { | ||
exports.default = connect_core_1.createAppConnector(({ app, config }) => { | ||
var _a, _b, _c, _d, _e; | ||
if (connector !== 'thegraph') { | ||
throw new errors_1.ErrorInvalidConnector(`Connector unsupported: ${connector}. Please use thegraph.`); | ||
const { name, address, organization: { connection: { network, orgConnector, verbose }, }, } = app; | ||
if (orgConnector.name !== 'thegraph') { | ||
throw new errors_1.ErrorInvalidConnector(`Connector unsupported: ${orgConnector.name}. Please use thegraph.`); | ||
} | ||
if (app.name !== 'ta-round-robin.open.aragonpm.eth') { | ||
throw new errors_1.ErrorInvalidApp(`This app (${app.name}) is not compatible with connect-roundrobin. ` + | ||
if (name !== 'ta-round-robin') { | ||
throw new errors_1.ErrorInvalidApp(`This app (${name}) is not compatible with this round robin connector. ` + | ||
`Please use an app instance of the ta-round-robin.open.aragonpm.eth repo.`); | ||
} | ||
const subgraphUrl = (_b = (_a = config.subgraphUrl) !== null && _a !== void 0 ? _a : connector_1.subgraphUrlFromChainId(network.chainId)) !== null && _b !== void 0 ? _b : undefined; | ||
const subgraphUrl = (_b = (_a = config === null || config === void 0 ? void 0 : config.subgraphUrl) !== null && _a !== void 0 ? _a : connector_1.subgraphUrlFromChainId(network.chainId)) !== null && _b !== void 0 ? _b : undefined; | ||
if (!subgraphUrl) { | ||
@@ -53,4 +54,4 @@ throw new errors_1.ErrorInvalidNetwork('No subgraph could be found for this network. ' + | ||
}); | ||
return new RoundRobin_1.default(connectorTheGraph, app.address); | ||
return new RoundRobin_1.default(connectorTheGraph, address); | ||
}); | ||
//# sourceMappingURL=connect.js.map |
import RoundRobin from './models/RoundRobin'; | ||
declare type Config = { | ||
subgraphUrl?: string; | ||
pollInterval?: number; | ||
subgraphUrl?: string; | ||
}; | ||
@@ -6,0 +6,0 @@ declare const _default: (app: import("@aragon/connect-core").App | Promise<import("@aragon/connect-core").App>, connector?: string | [string, Config | undefined] | undefined) => Promise<import("@aragon/connect-core").App & RoundRobin>; |
@@ -29,12 +29,13 @@ "use strict"; | ||
const connector_1 = __importStar(require("./thegraph/connector")); | ||
exports.default = connect_core_1.createAppConnector(({ app, config, connector, network, orgConnector, verbose }) => { | ||
exports.default = connect_core_1.createAppConnector(({ app, config }) => { | ||
var _a, _b, _c, _d, _e; | ||
if (connector !== 'thegraph') { | ||
throw new errors_1.ErrorInvalidConnector(`Connector unsupported: ${connector}. Please use thegraph.`); | ||
const { name, address, organization: { connection: { network, orgConnector, verbose }, }, } = app; | ||
if (orgConnector.name !== 'thegraph') { | ||
throw new errors_1.ErrorInvalidConnector(`Connector unsupported: ${orgConnector.name}. Please use thegraph.`); | ||
} | ||
if (app.name !== 'ta-round-robin.open.aragonpm.eth') { | ||
throw new errors_1.ErrorInvalidApp(`This app (${app.name}) is not compatible with connect-roundrobin. ` + | ||
if (name !== 'ta-round-robin') { | ||
throw new errors_1.ErrorInvalidApp(`This app (${name}) is not compatible with this round robin connector. ` + | ||
`Please use an app instance of the ta-round-robin.open.aragonpm.eth repo.`); | ||
} | ||
const subgraphUrl = (_b = (_a = config.subgraphUrl) !== null && _a !== void 0 ? _a : connector_1.subgraphUrlFromChainId(network.chainId)) !== null && _b !== void 0 ? _b : undefined; | ||
const subgraphUrl = (_b = (_a = config === null || config === void 0 ? void 0 : config.subgraphUrl) !== null && _a !== void 0 ? _a : connector_1.subgraphUrlFromChainId(network.chainId)) !== null && _b !== void 0 ? _b : undefined; | ||
if (!subgraphUrl) { | ||
@@ -53,4 +54,4 @@ throw new errors_1.ErrorInvalidNetwork('No subgraph could be found for this network. ' + | ||
}); | ||
return new RoundRobin_1.default(connectorTheGraph, app.address); | ||
return new RoundRobin_1.default(connectorTheGraph, address); | ||
}); | ||
//# sourceMappingURL=connect.js.map |
{ | ||
"name": "@p2pmodels/connect-round-robin", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"license": "LGPL-3.0-or-later", | ||
@@ -5,0 +5,0 @@ "description": "Aragon connector to access and interact with Round Robin task allocation app", |
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
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
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
631960
1420