Skip to content

Commit

Permalink
Merge pull request #722 from nevermined-io/fix/agent_endpoints
Browse files Browse the repository at this point in the history
Loading just public endpoints
  • Loading branch information
aaitor authored Oct 8, 2024
2 parents 5883226 + 39870a0 commit b2529ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/sdk",
"version": "3.0.38",
"version": "3.0.39",
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
"main": "./dist/node/sdk.js",
"typings": "./dist/node/sdk.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/ddo/DDO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,12 +789,14 @@ export class DDO {
const serviceHostUrl = new URL(webService.serviceHost)
const serviceHost = serviceHostUrl.origin

const _queryProtocolEndpoints: { [verb: string]: string }[] = []
NeverminedQueryProtocolEndpoints.map((endpoint) => {
Object.entries(endpoint).flatMap(([key, value]) => {
const endpointUrl = `${serviceHost}${value}`.replace('{DID}', did)
webService.endpoints?.push({ [key]: endpointUrl })
_queryProtocolEndpoints.push({ [key]: endpointUrl })
})
})
webService.endpoints = _queryProtocolEndpoints

if (webService?.isNeverminedHosted) {
const openApiEndpoint = `${serviceHost}/api/v1/rest/docs-json`
Expand Down
6 changes: 0 additions & 6 deletions src/types/DDOTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ export interface MetaDataExternalResource {
}

export const NeverminedQueryProtocolEndpoints: { [verb: string]: string }[] = [
{ GET: '/api/v1/agents' },
{ POST: '/api/v1/agents/search' },
{ GET: '/api/v1/agents/steps' },
{ GET: '/api/v1/agents/{DID}/tasks/(.*)/steps' },
{ POST: '/api/v1/agents/{DID}/tasks/(.*)/steps' },
{ PUT: '/api/v1/agents/{DID}/tasks/(.*)/step/(.*)' },
{ POST: '/api/v1/agents/{DID}/tasks' },
{ GET: '/api/v1/agents/{DID}/tasks/(.*)' },
]
Expand Down

0 comments on commit b2529ee

Please sign in to comment.