Skip to content

Commit

Permalink
refactor(oob)!: make label optional (#1680)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <timo@animo.id>
Co-authored-by: Ariel Gentile <gentilester@gmail.com>
  • Loading branch information
TimoGlastra and genaris committed Jan 29, 2024
1 parent 3d1903a commit c66b37e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/core/src/modules/oob/OutOfBandService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class OutOfBandService {
// initiating the flow
const outOfBandInvitation = new OutOfBandInvitation({
id: did,
label: '',
services: [did],
handshakeProtocols,
})
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/modules/oob/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ 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,
}
} 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,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/modules/oob/messages/OutOfBandInvitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { OutOfBandDidCommService } from '../domain/OutOfBandDidCommService'

export interface OutOfBandInvitationOptions {
id?: string
label: string
label?: string
goalCode?: string
goal?: string
accept?: string[]
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/utils/parseInvitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
})

Expand Down

0 comments on commit c66b37e

Please sign in to comment.