"use strict";
// // COMMENTED OUT BC: Superceded by codiac-messaging repo.
// export class MessagingDefaults {
//   /** Default message action to specify when not provided by sender. */
//   public static readonly ACTION = "none";
//   /** Default subject (aka: topic/queue) to specify when not provided by sender. */
//   public static readonly SUBJECT = "default";
// }
// /** Information about a message being sent. */
// export interface IMessageSendMeta {
//   /** The purpose of the message being sent (aka: the operation type).
//    * (akin to a type of message, but not dependent on the details of the class implementation of the message). */
//   action: string;
//   /** (format: guid) Unique identifier for the composite of one or more transactions in a hierarchical sequence. */
//   correlationId: string;
//   /** The string of tokens ("." separated) constituting the concrete topic/queue
//    * to which the message is being sent
//    * (ie: no wildcards "*" or wire taps ">" included).  */
//   subject: string;
//   // Commented out bc not in use - YET.
//   // /** (optional) Additional custom metadata sent with the message by the server or publisher. */
//   // headers?: { [name: string]: string };
//   /** (Optional) The concrete topic/queue (dot-separated tokens) on which the recipient of a message can send back a direct response to the sender. */
//   replyOn?: string;
//   // custom?: { [key: string]: string };
// }
// /** Generic information related to the message and channel on which it was sent. */
// export interface IMessageReceivedMeta extends IMessageSendMeta {
//   /** The subscription ID to which the message was dispatched. */
//   sid: number;
//   // Commented out bc not in use - YET.
//   // /** The unique identifier for the channel established between the sender and the messaging service. */
//   // senderConnectionId: string;
//   // Commented out bc not in use - YET.
//   // /** (optional) Additional metadata sent with the message by the server or publisher. */
//   // headers?: { [name: string]: string };
// }
// /** Declares an Enumerable Object (requiring serialization)
//  * to differentiate the entity from a string that is already serialized. */
// export type MessagePayload = { [name: string]: string | string[] | any; };
// /* TODO: Consider for IStreamMessage:
//  *
//  * from caller:
//  *  * correlationId
//  *  * topic (aka: subject)
//  *  * action (aka: messageType)
//  *
//  * from connection context:
//  *  * connectionId from which it was sent
//  *  * user
//  *  * tenant
//  *  ...so the msg client in the relay has to reconnect
//  *     whenever it changes the user or tenant?
//  *     A: In websockets yes.  Nats, no.
//  *
//  * From Messaging System:
//  *  * messageId ?
//  *
//  * CONCEPT:
//  *   nats and websockets (and rabbit or other) get and store these datapoints
//  *   from and in different places (message, headers, connection, etc).
//  *
//  * */
// export interface ITransportMessage {
//   payload: MessagePayload;
//   meta: IMessageSendMeta;
// }
// export type MessageHandlerOf<TMsg extends MessagePayload> = (err: Error | null, msg: TMsg, meta: IMessageReceivedMeta, raw?: any) => Promise<void>;
// export type MessageHandler = MessageHandlerOf<MessagePayload>;
// // /** Abstraction enforcing selected patterns for basic communications functionality. */
// // export interface IMessagingClient {
// //   /** Returns the unique identifier for the connection. */
// //   connect(connectionId?: string): Promise<string>;
// //   isConnected(): boolean;
// //   get connectionId(): string | undefined;
// //   disconnect(): Promise<void>;
// //   /** Throws on errors subscribing.
// //    * Returns the unique id for the subscription. */
// //   subscribe<TMsg extends MessagePayload>(topics: string, handler: MessageHandlerOf<TMsg>, options?: SubscribeOptions): string;
// //   /** Throws on errors unsubscribing. */
// //   unsubscribe(topics: string, options?: { force?: boolean, subscriptionId?: string }): Promise<boolean>;
// //   publish(msg: MessagePayload, meta?: Partial<IMessageSendMeta>): Promise<void>;
// //   /** Invoke and wait for a direct response (Request-response pattern). */
// //   request<TMsg extends MessagePayload, TRes extends Result>(msg: TMsg, meta?: Partial<IMessageSendMeta>, timeoutInSecs?: number): Promise<TRes>;
// // }
//# sourceMappingURL=i-messaging-client.js.map