forked from DAVFoundation/dav-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Message.js.map
1 lines (1 loc) · 1.66 KB
/
Message.js.map
1
{"version":3,"sources":["../src/Message.ts"],"names":[],"mappings":";;AAGA,mCAA4B;AAC5B;;GAEG;AACH;IAKE,YAAmB,MAAU,EAAU,OAAU,EAAU,MAAe;QAAvD,WAAM,GAAN,MAAM,CAAI;QAAU,YAAO,GAAP,OAAO,CAAG;QAAU,WAAM,GAAN,MAAM,CAAS;QACxE,KAAK;IACP,CAAC;IAND,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAKD;;;OAGG;IACI,OAAO,CAAC,MAAqB;QAClC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;QAC9B,OAAO,eAAK,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACtE,CAAC;IACD;;OAEG;IACI,cAAc;QACnB,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACjD,OAAO,GAAG,eAAe,CAAC,QAAQ,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;IAC/D,CAAC;CACF;AAvBD,0BAuBC","file":"Message.js","sourcesContent":["import IConfig from './IConfig';\nimport { ID } from './common-types';\nimport MessageParams from './MessageParams';\nimport Kafka from './Kafka';\n/**\n * @class The Message Class represent a single message between consumer and service provider.\n */\nexport default class Message<T extends MessageParams> {\n public get params(): T {\n return this._params;\n }\n\n constructor(public selfId: ID, private _params: T, private config: IConfig) {\n /* */\n }\n /**\n * @method respond Used to reply for the current message.\n * @param params the message parameters.\n */\n public respond(params: MessageParams): Promise<void> {\n params.senderId = this.selfId;\n return Kafka.sendParams(this._params.senderId, params, this.config);\n }\n /**\n * @method getMessageType Used to check the message type and protocol.\n */\n public getMessageType(): string {\n const formattedParams = this._params.serialize();\n return `${formattedParams.protocol}:${formattedParams.type}`;\n }\n}\n"]}