Skip to content

Commit a892c93

Browse files
committed
feat: update name and add test
1 parent bcb3e63 commit a892c93

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
22312231

22322232
> 2 May 2022
22332233
2234-
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
2234+
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
22352235
- Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931)
22362236

22372237
#### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21)
@@ -2494,7 +2494,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
24942494

24952495
> 18 January 2022
24962496
2497-
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
2497+
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
24982498
- [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183)
24992499
- Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177)
25002500
- Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c)
@@ -3000,7 +3000,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
30003000
- Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268)
30013001
- Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266)
30023002
- integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264)
3003-
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
3003+
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
30043004
- Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244)
30053005
- replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243)
30063006
- fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246)
@@ -3039,7 +3039,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
30393039
- Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191)
30403040
- Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189)
30413041
- Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187)
3042-
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
3042+
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
30433043
- [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183)
30443044
- Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177)
30453045
- Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184)

integration/nevermined/SearchAsset.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,10 @@ describe('Search Asset', () => {
105105
nevermined.search.byDID(ddo.id).then((ddo) => assert.instanceOf(ddo, DDO))
106106
})
107107
})
108+
109+
it('should be able to get assets by type', async () => {
110+
const { results: ddos } = await neverminedOffline.search.byType('dataset')
111+
112+
assert.equal(ddos.length, 4)
113+
})
108114
})

src/nevermined/api/SearchApi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ export class SearchApi extends Instantiable {
788788
)
789789
}
790790

791-
public async queryByType(assetType: MetaDataMain['type'] = 'agent', offset = 100, page = 1) {
791+
public async byType(assetType: MetaDataMain['type'] = 'agent', offset = 100, page = 1) {
792792
const mustArray: unknown[] = []
793793
mustArray.push(assetTypeFilter(assetType))
794794
return this.query({

0 commit comments

Comments
 (0)