From b3f56a6543f49cdd1c4aa2d097f7c6c9eaa52023 Mon Sep 17 00:00:00 2001 From: enrique Date: Fri, 22 Nov 2024 13:19:42 +0100 Subject: [PATCH 1/2] fix: allow update agents and assistants --- package.json | 2 +- src/nevermined/api/RegistryBaseApi.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e57b7a7ba..579e6a7c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "3.0.43", + "version": "3.0.44", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 498ed66e8..2a0dc1f86 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -1,4 +1,5 @@ // @ts-nocheck +import { formatUnits } from 'viem' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' import { generateId } from '../../common/helpers' import { DEFAULT_ENCRYPTION_METHOD, ZeroAddress } from '../../constants/AssetConstants' @@ -26,7 +27,6 @@ import { } from '../../types/MetadataTypes' import { zeroX } from '../../utils/ConversionTypeHelpers' import { SubscribablePromise } from '../../utils/SubscribablePromise' -import { formatUnits } from 'viem' import { AccessService, NFTAccessService, NFTSalesService } from '../AccessService' import { DID } from '../DID' import { CreateProgressStep, OrderProgressStep, UpdateProgressStep } from '../ProgressSteps' @@ -430,7 +430,9 @@ export abstract class RegistryBaseApi extends Instantiable { metadataService.attributes.encryptedFiles = JSON.parse(encryptedFilesResponse)['hash'] if ( - metadataService.attributes.main.type === 'service' && + (metadataService.attributes.main.type === 'service' || + assetAttributes.metadata.main.type === 'assistant' || + assetAttributes.metadata.main.type === 'agent') && metadataService.attributes.main.webService.internalAttributes ) { const encryptedServiceAttributesResponse = await this.nevermined.services.node.encrypt( From e0f85d1d5c611c0964286099436776accc231ff9 Mon Sep 17 00:00:00 2001 From: enrique Date: Fri, 22 Nov 2024 13:34:03 +0100 Subject: [PATCH 2/2] fix: wrong pick --- src/nevermined/api/RegistryBaseApi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nevermined/api/RegistryBaseApi.ts b/src/nevermined/api/RegistryBaseApi.ts index 2a0dc1f86..83853f0c7 100644 --- a/src/nevermined/api/RegistryBaseApi.ts +++ b/src/nevermined/api/RegistryBaseApi.ts @@ -431,8 +431,8 @@ export abstract class RegistryBaseApi extends Instantiable { if ( (metadataService.attributes.main.type === 'service' || - assetAttributes.metadata.main.type === 'assistant' || - assetAttributes.metadata.main.type === 'agent') && + metadataService.attributes.main.type === 'assistant' || + metadataService.attributes.main.type === 'agent') && metadataService.attributes.main.webService.internalAttributes ) { const encryptedServiceAttributesResponse = await this.nevermined.services.node.encrypt(