mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Fix lint errors.
This commit is contained in:
parent
e0f533b469
commit
df1c4fafd7
@ -41,7 +41,10 @@ export class Ocean extends Instantiable {
|
|||||||
instance.keeper = await Keeper.getInstance(instanceConfig)
|
instance.keeper = await Keeper.getInstance(instanceConfig)
|
||||||
|
|
||||||
instance.brizo = new Brizo(instanceConfig)
|
instance.brizo = new Brizo(instanceConfig)
|
||||||
instance.aquarius = new Aquarius(instanceConfig.config.aquariusUri, instanceConfig.logger)
|
instance.aquarius = new Aquarius(
|
||||||
|
instanceConfig.config.aquariusUri,
|
||||||
|
instanceConfig.logger
|
||||||
|
)
|
||||||
|
|
||||||
instance.accounts = await OceanAccounts.getInstance(instanceConfig)
|
instance.accounts = await OceanAccounts.getInstance(instanceConfig)
|
||||||
instance.auth = await OceanAuth.getInstance(instanceConfig)
|
instance.auth = await OceanAuth.getInstance(instanceConfig)
|
||||||
|
@ -16,7 +16,11 @@ export class OceanUtils extends Instantiable {
|
|||||||
const instance = new OceanUtils()
|
const instance = new OceanUtils()
|
||||||
instance.setInstanceConfig(config)
|
instance.setInstanceConfig(config)
|
||||||
|
|
||||||
instance.agreements = new ServiceAgreement(config.ocean, config.logger, config.web3)
|
instance.agreements = new ServiceAgreement(
|
||||||
|
config.ocean,
|
||||||
|
config.logger,
|
||||||
|
config.web3
|
||||||
|
)
|
||||||
instance.signature = new SignatureUtils(config.web3, config.logger)
|
instance.signature = new SignatureUtils(config.web3, config.logger)
|
||||||
instance.fetch = new WebServiceConnector(config.logger)
|
instance.fetch = new WebServiceConnector(config.logger)
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@ import { Logger } from '../../utils'
|
|||||||
|
|
||||||
export class SignatureUtils {
|
export class SignatureUtils {
|
||||||
private web3: Web3
|
private web3: Web3
|
||||||
private logger: Logger;
|
private logger: Logger
|
||||||
|
|
||||||
constructor(web3: Web3, logger: Logger) {
|
constructor(web3: Web3, logger: Logger) {
|
||||||
this.web3 = web3
|
this.web3 = web3
|
||||||
this.logger = logger;
|
this.logger = logger
|
||||||
}
|
}
|
||||||
|
|
||||||
public async signText(
|
public async signText(
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { BodyInit, RequestInit, Response } from 'node-fetch'
|
import { BodyInit, RequestInit, Response } from 'node-fetch'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
import { Logger } from '../../utils'
|
||||||
|
|
||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
import save = require('save-file')
|
import save = require('save-file')
|
||||||
import { Logger } from '../../utils'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a common interface to web services.
|
* Provides a common interface to web services.
|
||||||
*/
|
*/
|
||||||
export class WebServiceConnector {
|
export class WebServiceConnector {
|
||||||
public logger: Logger;
|
public logger: Logger
|
||||||
constructor(logger: Logger) {
|
constructor(logger: Logger) {
|
||||||
this.logger = logger;
|
this.logger = logger
|
||||||
}
|
}
|
||||||
|
|
||||||
public post(url: string, payload: BodyInit): Promise<Response> {
|
public post(url: string, payload: BodyInit): Promise<Response> {
|
||||||
|
13
src/squid.ts
13
src/squid.ts
@ -25,4 +25,15 @@ export {
|
|||||||
export { AgreementTemplate } from './keeper/contracts/templates'
|
export { AgreementTemplate } from './keeper/contracts/templates'
|
||||||
export { Condition, ConditionState } from './keeper/contracts/conditions'
|
export { Condition, ConditionState } from './keeper/contracts/conditions'
|
||||||
|
|
||||||
export { Ocean, Account, Config, DID, Logger, Keeper, Aquarius, conditions, templates, utils }
|
export {
|
||||||
|
Ocean,
|
||||||
|
Account,
|
||||||
|
Config,
|
||||||
|
DID,
|
||||||
|
Logger,
|
||||||
|
Keeper,
|
||||||
|
Aquarius,
|
||||||
|
conditions,
|
||||||
|
templates,
|
||||||
|
utils
|
||||||
|
}
|
||||||
|
@ -101,7 +101,7 @@ describe('Aquarius', () => {
|
|||||||
it('should query metadata by text with a new instance', async () => {
|
it('should query metadata by text with a new instance', async () => {
|
||||||
const aquariusNew = new Aquarius(config.aquariusUri, new Logger())
|
const aquariusNew = new Aquarius(config.aquariusUri, new Logger())
|
||||||
spy.on(aquariusNew.fetch, 'get', () => reponsify(getResults([new DDO()])))
|
spy.on(aquariusNew.fetch, 'get', () => reponsify(getResults([new DDO()])))
|
||||||
|
|
||||||
const result = await aquariusNew.queryMetadataByText(query)
|
const result = await aquariusNew.queryMetadataByText(query)
|
||||||
assert.typeOf(result.results, 'array')
|
assert.typeOf(result.results, 'array')
|
||||||
assert.lengthOf(result.results, 1)
|
assert.lengthOf(result.results, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user