Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
8830b825ac | |||
123324bf43 | |||
4761ff31cf | |||
430c3ea13a |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartuniverse",
|
"name": "@pushrocks/smartuniverse",
|
||||||
"version": "1.0.31",
|
"version": "1.0.33",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartuniverse",
|
"name": "@pushrocks/smartuniverse",
|
||||||
"version": "1.0.31",
|
"version": "1.0.33",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "messaging service for your micro services",
|
"description": "messaging service for your micro services",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -20,6 +20,10 @@ messaging service for micro services
|
|||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
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.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
@ -32,17 +32,18 @@ export class ClientUniverse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async sendMessage(messageArg, payloadArg) {
|
public async sendMessage(messageArg, payloadArg) {
|
||||||
const requestBody = {
|
const requestBody: interfaces.IUniverseMessage = {
|
||||||
message: messageArg,
|
message: messageArg,
|
||||||
payload: payloadArg
|
payload: payloadArg
|
||||||
};
|
};
|
||||||
|
const requestBodyString = JSON.stringify(requestBody);
|
||||||
// TODO: User websocket connection if available
|
// TODO: User websocket connection if available
|
||||||
await plugins.smartrequest.postJson(this.options.serverAddress, {
|
const response = await plugins.smartrequest.postJson(`${this.options.serverAddress}/sendmessage` , {
|
||||||
requestBody
|
requestBody: requestBodyString
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getChannel(channelName: string): Promise<ClientUniverseChannel> {
|
public async getChannel(channelName: string, passphrase): Promise<ClientUniverseChannel> {
|
||||||
await this.checkConnection();
|
await this.checkConnection();
|
||||||
const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel(
|
const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel(
|
||||||
this,
|
this,
|
||||||
|
Reference in New Issue
Block a user