Compare commits

..

4 Commits

Author SHA1 Message Date
8830b825ac 1.0.33 2019-04-11 18:32:36 +02:00
123324bf43 fix(core): update 2019-04-11 18:32:36 +02:00
4761ff31cf 1.0.32 2019-04-11 18:31:21 +02:00
430c3ea13a fix(core): update 2019-04-11 18:31:21 +02:00
4 changed files with 11 additions and 6 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartuniverse",
"version": "1.0.31",
"version": "1.0.33",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartuniverse",
"version": "1.0.31",
"version": "1.0.33",
"private": false,
"description": "messaging service for your micro services",
"main": "dist/index.js",

View File

@ -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)

View File

@ -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<ClientUniverseChannel> {
public async getChannel(channelName: string, passphrase): Promise<ClientUniverseChannel> {
await this.checkConnection();
const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel(
this,