diff --git a/packages/core/src/modules/oob/OutOfBandService.ts b/packages/core/src/modules/oob/OutOfBandService.ts index 1884cb694a..93fbb26c9e 100644 --- a/packages/core/src/modules/oob/OutOfBandService.ts +++ b/packages/core/src/modules/oob/OutOfBandService.ts @@ -67,7 +67,6 @@ export class OutOfBandService { // initiating the flow const outOfBandInvitation = new OutOfBandInvitation({ id: did, - label: '', services: [did], handshakeProtocols, }) diff --git a/packages/core/src/modules/oob/helpers.ts b/packages/core/src/modules/oob/helpers.ts index ccd35e7a31..be2fe3f0b4 100644 --- a/packages/core/src/modules/oob/helpers.ts +++ b/packages/core/src/modules/oob/helpers.ts @@ -45,7 +45,8 @@ export function convertToOldInvitation(newInvitation: OutOfBandInvitation) { if (typeof service === 'string') { options = { id: newInvitation.id, - label: newInvitation.label, + // label is optional + label: newInvitation.label ?? '', did: service, imageUrl: newInvitation.imageUrl, appendedAttachments: newInvitation.appendedAttachments, @@ -53,7 +54,8 @@ export function convertToOldInvitation(newInvitation: OutOfBandInvitation) { } else { options = { id: newInvitation.id, - label: newInvitation.label, + // label is optional + label: newInvitation.label ?? '', recipientKeys: service.recipientKeys.map(didKeyToVerkey), routingKeys: service.routingKeys?.map(didKeyToVerkey), serviceEndpoint: service.serviceEndpoint, diff --git a/packages/core/src/modules/oob/messages/OutOfBandInvitation.ts b/packages/core/src/modules/oob/messages/OutOfBandInvitation.ts index 80118119a0..d900284329 100644 --- a/packages/core/src/modules/oob/messages/OutOfBandInvitation.ts +++ b/packages/core/src/modules/oob/messages/OutOfBandInvitation.ts @@ -17,7 +17,7 @@ import { OutOfBandDidCommService } from '../domain/OutOfBandDidCommService' export interface OutOfBandInvitationOptions { id?: string - label: string + label?: string goalCode?: string goal?: string accept?: string[] @@ -124,7 +124,7 @@ export class OutOfBandInvitation extends AgentMessage { public readonly type = OutOfBandInvitation.type.messageTypeUri public static readonly type = parseMessageType('https://didcomm.org/out-of-band/1.1/invitation') - public readonly label!: string + public readonly label?: string @Expose({ name: 'goal_code' }) public readonly goalCode?: string diff --git a/packages/core/src/utils/parseInvitation.ts b/packages/core/src/utils/parseInvitation.ts index 1fb9d99b03..3dd3dcc8dc 100644 --- a/packages/core/src/utils/parseInvitation.ts +++ b/packages/core/src/utils/parseInvitation.ts @@ -140,9 +140,6 @@ export const parseInvitationShortUrl = async ( // transform into out of band invitation const invitation = new OutOfBandInvitation({ - // The label is currently required by the OutOfBandInvitation class, but not according to the specification. - // FIXME: In 0.5.0 we will make this optional: https://github.com/hyperledger/aries-framework-javascript/issues/1524 - label: '', services: [OutOfBandDidCommService.fromResolvedDidCommService(agentMessage.service.resolvedDidCommService)], })