From 430c3ea13adffae0a9b941b8c14fa9e5909eb1ed Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Thu, 11 Apr 2019 18:31:21 +0200 Subject: [PATCH] fix(core): update --- readme.md | 4 ++++ ts/smartuniverse.classes.clientuniverse.ts | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 454887e..2a76387 100644 --- a/readme.md +++ b/readme.md @@ -20,6 +20,10 @@ messaging service for micro services Use TypeScript for best in class instellisense. +### What does smartuniverse all about? + +Think WhatsApp, but for your microservices architecture. It allows your services to securely talk to each other in private, shielded channels without having to expose anything to the outside world. This allows the use of reactive programming across your entire stack. + For further information read the linked docs at the top of this readme. > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) diff --git a/ts/smartuniverse.classes.clientuniverse.ts b/ts/smartuniverse.classes.clientuniverse.ts index ea0d1f4..a30b04d 100644 --- a/ts/smartuniverse.classes.clientuniverse.ts +++ b/ts/smartuniverse.classes.clientuniverse.ts @@ -32,17 +32,18 @@ export class ClientUniverse { } public async sendMessage(messageArg, payloadArg) { - const requestBody = { + const requestBody: interfaces.IUniverseMessage = { message: messageArg, payload: payloadArg }; + const requestBodyString = JSON.stringify(requestBody); // TODO: User websocket connection if available - await plugins.smartrequest.postJson(this.options.serverAddress, { - requestBody + const response = await plugins.smartrequest.postJson(`${this.options.serverAddress}/sendmessage` , { + requestBody: requestBodyString }); } - public async getChannel(channelName: string): Promise { + public async getChannel(channelName: string, passphrase): Promise { await this.checkConnection(); const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel( this,