npm.io
2.0.0 • Published 4 years ago

@verixyz/message-handler

Licence
Apache-2.0
Version
2.0.0
Deps
1
Size
34 kB
Vulns
0
Weekly
0

verixyz Message Handler

This is a verixyz plugin that coordinates several AbstractMessageHandler implementations to provide a handleMessage method to a verixyz agent.

Classes

AbstractMessageHandler

An abstract class for creating MessageHandler plugins

Properties

  • nextMessageHandler: AbstractMessageHandler

Methods

  • handle(message, context)
  • setNext(messageHandler)
Message

Constructors

  • (constructor)(data)
    Constructs a new instance of the Message class

Properties

  • createdAt: string
  • credentials: VerifiableCredential []
  • data: any
  • expiresAt: string
  • from: string
  • id: string
  • metaData: IMetaData []
  • presentations: VerifiablePresentation []
  • raw: string
  • replyTo: string[]
  • replyUrl: string
  • threadId: string
  • to: string
  • type: string

Methods

  • addMetaData(meta)
  • getLastMetaData()
  • isValid()
MessageHandler

Agent plugin that provides IMessageHandler methods

Constructors

  • (constructor)(options)
    Constructs a new instance of the MessageHandler class

Properties

  • methods: IMessageHandler
    Plugin methods

  • schema: any

Methods

  • handleMessage(args, context)
    Parses and - optionally saves a message