Control Plane

Enables participants to publish connection offers, allowing other participants to connect and communicate with them securely. It is an interface that integrates with the Affinidi Meeting Place API service.

Install Dependency

Package: meeting_place_control_plane

dart pub add meeting_place_control_plane

You can check the latest version of this module on the pub.dev or view the source code at the GitHub repository.

Classes and Methods

ControlPlaneSDK

The ControlPlaneSDK provides the libraries to enable the discovery of other participants to establish a connection and communicate securely. It enables participants to publish a connection offer to allow other participants to communicate directly or through group chat. Through discovery, organisations and AI agents can publish their connection offers to allow users to connect and start using their services.

To create an instance of ControlPlaneSDK, you can use its generative constructor.

// create instance final controlPlaneSDK = ControlPlaneSDK( didManager: didManager, controlPlaneDid: '<YOUR-CONTROL-PLANE-DID>', mediatorDid: '<YOUR-MEDIATOR-DID>', didResolver: didResolver, controlPlaneSDKConfig: ControlPlaneSDKOptions( maxRetries: 5, maxRetriesDelay: Duration(seconds: 2), connectTimeout: Duration(seconds: 10), receiveTimeout: Duration(seconds: 10), ), );

execute

Executes a command by dispatching it to the appropriate handler based on the provided DiscoveryCommand, and returns the result as a generic type corresponding to the command.

Parameters

command [DiscoveryCommand<T>]

A generic command object that encapsulates the data and parameters required for a specific operation. Each DiscoveryCommand is dispatched to its corresponding handler, which processes the command and returns a result of the expected type. See the list of available Discovery Commands below for more details.

Example
import 'package:meeting_place_control_plane/meeting_place_control_plane.dart';
// create an instance of DiscoverySDK final ControlPlaneSDK controlPlaneSDK = ControlPlaneSDK( ... ); // execute AcceptOfferCommand final result = await controlPlaneSDK.execute( AcceptOfferCommand( mnemonic: mnemonic, device: device, offerLink: offerLink, vCard: vCard, acceptOfferDid: acceptOfferDid) );

List of Discovery Commands

AcceptOfferCommand

The command for accepting a connection offer from another participant. This command initiates the acceptance process, which establishes a secure communication channel between the accepting user and the offer publisher. Upon successful execution, both parties can begin secure messaging and data exchange.

Parameters

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();.

device [object] - An object which defines the deviceToken [string] and platformType [object].

offerLink [string] - The id of an offer.

vCard [object] - An object that represents the profile of a user or group.

acceptOfferDid [string] - The DID of the accepted offer.


AcceptOfferGroupCommand

The command for accepting a group offer from another participant. This command initiates the process of joining an existing group chat, establishing a secure connection with the group and enabling the user to participate in group messaging and communication.

Parameters

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();

device [object] - An object which defines the deviceToken [string] and platformType [object].

offerLink [string] - The id of an offer.

vCard [object] - An object that represents the profile of a user or group.

acceptOfferDid [string] - The DID of the accepted offer.


AuthenticateCommand

The command to authenticate with the Meeting Place service. This command validates the control plane DID and establishes the necessary credentials to perform operations such as registering offers, accepting connections, and managing group communications.

Parameters

controlPlaneDid [string] - The control plane DID.


CreateOobCommand

The command to create an Out-Of-Band invitation. This command generates an OOB invitation message that can be shared with other participants through external channels (email, QR codes, etc.) to initiate secure connection establishment.

Parameters

oobInvitationMessage [object] - An object that represents an Out-Of-Band invitation message.

mediatorDid [string] - [OPTIONAL] The mediator DID.


DeletePendingNotificationsCommand

The command to delete pending notifications. This command removes notifications that are no longer needed or have been processed, helping to keep the notification queue clean and manageable.

Parameters

device [object] - An object which defines the deviceToken [string] and platformType [object].

notificationIds [List<String>] - The list of notification Ids to be deleted.


DeregisterNotificationCommand

The command to deregister notifications. This command is used to remove a notification token from the system.

Parameters

notificationToken [string] - The notification token to be deregistered for notification.


DeregisterOfferCommand

The command to deregister an offer. This command is used to remove a previously registered offer from the system.

Parameters

offerLink [string] - The id of an offer.

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();


FinaliseAcceptanceCommand

The command to finalise the acceptance of an offer. This command is used to complete the process of accepting an offer and establishing a connection.

Parameters

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();

offerLink [string] - The id of an offer.

offerPublishedDid [string] - The published offer’s DID.

otherPartyAcceptOfferDid [string] - The DID of the other party when they have accepted the offer.

otherPartyPermanentChannelDid [string] - The Channel DID of the other party that gets established upon completion of the offer to connect.

device [object] - An object which defines the deviceToken [string] and platformType [object].

vCard [object] - [OPTIONAL] An object that represents the profile of a user or group.


GetOobCommand

The command to fetch the Out-Of-Band invitation information. This command is used to retrieve the details of an OOB invitation using its unique identifier.

Parameters

oobId - The Out-Of-Band ID used to query the OOB invitation.


GetPendingNotificationsCommand

The command to fetch pending notifications. This command is used to retrieve notifications that are awaiting processing.

Parameters

device [object] - An object which defines the deviceToken [string] and platformType [object].

onChatActivityCallback [function] - [OPTIONAL] A callback function that gets invoked whene receiving a notification event.


GroupAddMemberCommand

The command to add a member to a group. This command is used to include a new participant in an existing group chat.

Parameters

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();

groupId [string] - The id of the group where the member will be added.

memberDid [string] - The DID of the member.

acceptOfferDid [string] - The DID of the accepted offer.

offerLink [string] - The id of an offer.

publicKey [string] - The member’s public key.

reencryptionKey [string] - The re-encrytion key.

vCard [object] - [OPTIONAL] An object that represents the profile of a user or group.


GroupDeleteCommand

The command to delete a group. This command is used to remove an existing group chat.

Parameters

groupId [string] - The id of the group chat.


GroupDeregisterMemberCommand

The command to remove a member in a group. This command is used to remove a participant from an existing group chat.

Parameters

groupId [string] - The id of the group chat.

memberId [string] - The id of the group member.

message [object] - The Plain Text Message.


GroupSendMessageCommand

The command to send a message to a group. This command is used to send a message to all members of a group chat.

Parameters

offerLink [string] - The id of an offer.

fromDid [string] -The DID ofthe sender of the group message.

groupDid [string] - The DID of the group.

message [object] - An object that represents a DIDComm v2 Plant Text Message.

increaseSequenceNumber [bool] - A flag that indicates whether to increase the sequence number when sending a message. This is used to track the message sequence in a group chat setting.

notify [bool] - A flag that indicates whether to notify the group of new messages.

ephemeral [bool] - A flag that indicates whether the message is supposed to be short-lived.

forwardExpiryInSeconds [int] - [OPTIONAL] The forward expiry notification of the message in seconds.


NotifyAcceptanceCommand

The command to notify that the offer has been accepted. This command is used to inform the offer publisher that their offer has been accepted by another participant.

Parameters

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();

acceptOfferDid [string] - The DID of the accepted offer.

offerLink [string] - The id of an offer.


NotifyAcceptanceGroupCommand

The command to notify that the offer to join a group has been accepted. This command is used to inform the group offer publisher that their offer has been accepted by another participant.

Parameters

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();

acceptOfferDid [string] - The DID of the accepted offer.

offerLink [string] - The id of an offer.


NotifyChannelCommand

The command to notify a channel. This command is used to send a notification to a specific communication channel, typically to alert participants about events, messages, or status changes within the Meeting Place system.

Parameters

notificationToken [string] - The notification token of a channel to be notified.

did [string] - The DID of the recipient of the notification.

type [string] - The type of channel to be notified.


QueryOfferCommand

The command to query an offer. This command is used to retrieve information about a specific offer.

Parameters

mnemonic [string] - A unique identifier. This can be generated using Uuid().v4();


RegisterDeviceCommand

The command to register a device. This command is used to register a user’s device for receiving notifications.

Parameters

deviceToken [string] - A unique string the represents a user’s device.

platformType [object] - Represents the Operating System of the user’s device. (Android - FCM, iOS - APNS, Web - Web Push).


RegisterNotificationCommand

The command to register notification. This command is used to register a notification token to enable notifications between two specific participants in a communication channel.

Parameters

myDid [string] - Represents the current user’s DID.

theirDid [string] - Represents a DID of another party.

device [object] - An object which defines the deviceToken [string] and platformType [object].


RegisterOfferCommand

The command to register an offer. This command is used to create and publish a connection offer that other participants can claim to establish a secure connection.

Parameters

offerName [string] - The name of the offer displayed to other users when claiming an offer.

vCard [object] - An object that represents the your profile in the offer.

device [object] - An object which defines the deviceToken [string] and platformType [object].

oobInvitationMessage [object] - An object that represents an Out-Of-Band invitation message.

offerDescription [string] - [OPTIONAL] A string providing additional descriptive information about the offer.

validUntil [DateTime] - [OPTIONAL] The date and time until which the offer remains valid.

maximumUsage [int] - [OPTIONAL] The maximum number an offer can be claimed by other users.

customPhrase [string] - [OPTIONAL] A string representing the phrase that will be published with the offer.

mediatorDid [string] - [OPTIONAL] The mediator DID.


RegisterOfferGroupCommand

The command to register a group offer. This command is used to create and publish a connection offer for joining a group chat that other participants can claim to establish a secure connection.

Parameters

offerName [string] - The name of the offer displayed to other users when claiming a group offer.

vCard [object] - An object that represents the profile of a group.

device [object] - An object which defines the deviceToken [string] and platformType [object].

oobInvitationMessage [object] - An object that represents an Out-Of-Band invitation message.

offerDescription [string] - [OPTIONAL] A string providing additional descriptive information about the group offer.

validUntil [DateTime] - [OPTIONAL] The date and time until which the offer remains valid.

maximumUsage [int] - [OPTIONAL] The maximum number an offer can be claimed by other users.

customPhrase [string] - [OPTIONAL] A string representing the phrase that will be published with the offer.

mediatorDid [string] - [OPTIONAL] The mediator DID.

mediatorEndpoint [string] - [OPTIONAL] The mediator’s endpoint used in the group offer to be registered.

mediatorWSSEndpoint [string] - [OPTIONAL] The mediator’s websocket endpoint used in the group offer to be registered.

metadata [string] - [OPTIONAL] Optional additional information or data associated with the group offer.

adminDid [string] - [OPTIONAL] The group admin’s DID.

adminPublicKey [string] - [OPTIONAL] The group admin’s public key.

adminReencryptionKey [string] - [OPTIONAL] The group admin’s re-encryption key.


ValidateOfferPhraseCommand

The command to validate the offer phrase. This command is used to check if a given phrase is valid for an offer.

Parameters

phrase [string] - A string representing the phrase to be validated.