mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
changed some methods names and marking as deprectated #65
This commit is contained in:
parent
99887cc5e1
commit
21b38402ca
2648
package-lock.json
generated
2648
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -57,6 +57,7 @@
|
|||||||
"@oceanprotocol/secret-store-client": "~0.0.14",
|
"@oceanprotocol/secret-store-client": "~0.0.14",
|
||||||
"@types/node-fetch": "^2.1.4",
|
"@types/node-fetch": "^2.1.4",
|
||||||
"bignumber.js": "^8.0.1",
|
"bignumber.js": "^8.0.1",
|
||||||
|
"deprecated-decorator": "^0.1.6",
|
||||||
"ethereumjs-util": "^6.0.0",
|
"ethereumjs-util": "^6.0.0",
|
||||||
"node-fetch": "^2.3.0",
|
"node-fetch": "^2.3.0",
|
||||||
"uuid": "^3.3.2",
|
"uuid": "^3.3.2",
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import deprecated from 'deprecated-decorator';
|
||||||
|
|
||||||
import AquariusProvider from "../aquarius/AquariusProvider"
|
import AquariusProvider from "../aquarius/AquariusProvider"
|
||||||
import SearchQuery from "../aquarius/query/SearchQuery"
|
import SearchQuery from "../aquarius/query/SearchQuery"
|
||||||
import BrizoProvider from "../brizo/BrizoProvider"
|
import BrizoProvider from "../brizo/BrizoProvider"
|
||||||
@ -76,10 +78,21 @@ export default class Ocean {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a DDO by DID.
|
* Returns a DDO by DID.
|
||||||
|
* @deprecated Replace by {@link #resolveAssetDID}
|
||||||
* @param {string} did Decentralized ID.
|
* @param {string} did Decentralized ID.
|
||||||
* @return {Promise<DDO>}
|
* @return {Promise<DDO>}
|
||||||
*/
|
*/
|
||||||
|
@deprecated('resolveAssetDID')
|
||||||
public async resolveDID(did: string): Promise<DDO> {
|
public async resolveDID(did: string): Promise<DDO> {
|
||||||
|
return await this.resolveAssetDID(did);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a DDO by DID.
|
||||||
|
* @param {string} did Decentralized ID.
|
||||||
|
* @return {Promise<DDO>}
|
||||||
|
*/
|
||||||
|
public async resolveAssetDID(did: string): Promise<DDO> {
|
||||||
const d: DID = DID.parse(did)
|
const d: DID = DID.parse(did)
|
||||||
return AquariusProvider.getAquarius().retrieveDDO(d)
|
return AquariusProvider.getAquarius().retrieveDDO(d)
|
||||||
}
|
}
|
||||||
@ -91,7 +104,6 @@ export default class Ocean {
|
|||||||
* @return {Promise<DDO>}
|
* @return {Promise<DDO>}
|
||||||
*/
|
*/
|
||||||
public async registerAsset(metadata: MetaData, publisher: Account): Promise<DDO> {
|
public async registerAsset(metadata: MetaData, publisher: Account): Promise<DDO> {
|
||||||
|
|
||||||
const {didRegistry} = this.keeper
|
const {didRegistry} = this.keeper
|
||||||
const aquarius = AquariusProvider.getAquarius()
|
const aquarius = AquariusProvider.getAquarius()
|
||||||
const brizo = BrizoProvider.getBrizo()
|
const brizo = BrizoProvider.getBrizo()
|
||||||
@ -182,6 +194,24 @@ export default class Ocean {
|
|||||||
return storedDdo
|
return storedDdo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signs a service agreement by DID.
|
||||||
|
* @deprecated Replace by {@link #purchaseAssetService}
|
||||||
|
* @param {string} did Decentralized ID.
|
||||||
|
* @param {string} serviceDefinitionId Service definition ID.
|
||||||
|
* @param {Account} consumer Consumer account.
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@deprecated('purchaseAssetService')
|
||||||
|
public async signServiceAgreement(
|
||||||
|
did: string,
|
||||||
|
serviceDefinitionId: string,
|
||||||
|
consumer: Account,
|
||||||
|
): Promise<any> {
|
||||||
|
return await this.purchaseAssetService(did, serviceDefinitionId, consumer);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signs a service agreement by DID.
|
* Signs a service agreement by DID.
|
||||||
* @param {string} did Decentralized ID.
|
* @param {string} did Decentralized ID.
|
||||||
@ -189,9 +219,11 @@ export default class Ocean {
|
|||||||
* @param {Account} consumer Consumer account.
|
* @param {Account} consumer Consumer account.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
public async signServiceAgreement(did: string,
|
public async purchaseAssetService(
|
||||||
serviceDefinitionId: string,
|
did: string,
|
||||||
consumer: Account): Promise<any> {
|
serviceDefinitionId: string,
|
||||||
|
consumer: Account,
|
||||||
|
): Promise<any> {
|
||||||
|
|
||||||
const d: DID = DID.parse(did as string)
|
const d: DID = DID.parse(did as string)
|
||||||
const ddo = await AquariusProvider.getAquarius().retrieveDDO(d)
|
const ddo = await AquariusProvider.getAquarius().retrieveDDO(d)
|
||||||
@ -239,6 +271,7 @@ export default class Ocean {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new service agreement.
|
* Creates a new service agreement.
|
||||||
|
* @private
|
||||||
* @param {string} did Decentralized ID.
|
* @param {string} did Decentralized ID.
|
||||||
* @param {string} serviceDefinitionId Service definition ID.
|
* @param {string} serviceDefinitionId Service definition ID.
|
||||||
* @param {string} serviceAgreementId Service agreement ID.
|
* @param {string} serviceAgreementId Service agreement ID.
|
||||||
@ -246,13 +279,14 @@ export default class Ocean {
|
|||||||
* @param {Function} cb Callback executen when the access is granted.
|
* @param {Function} cb Callback executen when the access is granted.
|
||||||
* @param {Account} consumer Consumer account.
|
* @param {Account} consumer Consumer account.
|
||||||
*/
|
*/
|
||||||
public async initializeServiceAgreement(did: string,
|
public async initializeServiceAgreement(
|
||||||
serviceDefinitionId: string,
|
did: string,
|
||||||
serviceAgreementId: string,
|
serviceDefinitionId: string,
|
||||||
serviceAgreementSignature: string,
|
serviceAgreementId: string,
|
||||||
cb,
|
serviceAgreementSignature: string,
|
||||||
consumer: Account) {
|
cb: (files: string[]) => void,
|
||||||
|
consumer: Account,
|
||||||
|
) {
|
||||||
const d: DID = DID.parse(did)
|
const d: DID = DID.parse(did)
|
||||||
const ddo = await AquariusProvider.getAquarius().retrieveDDO(d)
|
const ddo = await AquariusProvider.getAquarius().retrieveDDO(d)
|
||||||
|
|
||||||
@ -302,13 +336,14 @@ export default class Ocean {
|
|||||||
* @param {Account} publisher Publisher account.
|
* @param {Account} publisher Publisher account.
|
||||||
* @return {Promise<ServiceAgreement>}
|
* @return {Promise<ServiceAgreement>}
|
||||||
*/
|
*/
|
||||||
public async executeServiceAgreement(did: string,
|
public async executeServiceAgreement(
|
||||||
serviceDefinitionId: string,
|
did: string,
|
||||||
serviceAgreementId: string,
|
serviceDefinitionId: string,
|
||||||
serviceAgreementSignature: string,
|
serviceAgreementId: string,
|
||||||
consumer: Account,
|
serviceAgreementSignature: string,
|
||||||
publisher: Account): Promise<ServiceAgreement> {
|
consumer: Account,
|
||||||
|
publisher: Account,
|
||||||
|
): Promise<ServiceAgreement> {
|
||||||
const d: DID = DID.parse(did)
|
const d: DID = DID.parse(did)
|
||||||
const ddo = await AquariusProvider.getAquarius().retrieveDDO(d)
|
const ddo = await AquariusProvider.getAquarius().retrieveDDO(d)
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"outDir": "./dist/node/",
|
"outDir": "./dist/node/",
|
||||||
"rootDir": "./src/",
|
"rootDir": "./src/",
|
||||||
|
Loading…
Reference in New Issue
Block a user