fix(core): update
This commit is contained in:
parent
f401d78c4b
commit
be7ca29e4b
@ -49,4 +49,4 @@
|
|||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ export interface ISocketRequest_SubscribeChannel {
|
|||||||
passphrase: string;
|
passphrase: string;
|
||||||
};
|
};
|
||||||
response: {
|
response: {
|
||||||
subscriptionStatus: 'subscribed' | 'unsubscribed'
|
subscriptionStatus: 'subscribed' | 'unsubscribed';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15,6 +15,6 @@ export interface ISocketRequest_ProcessMessage {
|
|||||||
method: 'processMessage';
|
method: 'processMessage';
|
||||||
request: interfaces.IUniverseMessage;
|
request: interfaces.IUniverseMessage;
|
||||||
response: {
|
response: {
|
||||||
messageStatus: 'ok' | 'channel not found'
|
messageStatus: 'ok' | 'channel not found';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ export type IServerCallActions =
|
|||||||
| 'channelUnsubscribe'
|
| 'channelUnsubscribe'
|
||||||
| 'terminateConnection';
|
| 'terminateConnection';
|
||||||
|
|
||||||
|
|
||||||
export interface IServerUnsubscribeActionPayload {
|
export interface IServerUnsubscribeActionPayload {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
@ -56,20 +56,18 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
|||||||
public async subscribe(observerArg?: plugins.smartrx.rxjs.Observer<any>) {
|
public async subscribe(observerArg?: plugins.smartrx.rxjs.Observer<any>) {
|
||||||
// lets make sure the channel is connected
|
// lets make sure the channel is connected
|
||||||
if (this.status === 'unsubscribed') {
|
if (this.status === 'unsubscribed') {
|
||||||
const response = await this.clientUniverseRef.smartsocketClient.serverCall<interfaces.ISocketRequest_SubscribeChannel>(
|
const response = await this.clientUniverseRef.smartsocketClient.serverCall<
|
||||||
'subscribeChannel',
|
interfaces.ISocketRequest_SubscribeChannel
|
||||||
{
|
>('subscribeChannel', {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
passphrase: this.passphrase
|
passphrase: this.passphrase
|
||||||
}
|
});
|
||||||
);
|
|
||||||
this.status = response.subscriptionStatus;
|
this.status = response.subscriptionStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (observerArg) {
|
if (observerArg) {
|
||||||
return this.subject.subscribe(observerArg);
|
return this.subject.subscribe(observerArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async emitMessageLocally(messageArg: ClientUniverseMessage) {
|
public async emitMessageLocally(messageArg: ClientUniverseMessage) {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import * as plugins from './smartuniverse.plugins';
|
import * as plugins from './smartuniverse.plugins';
|
||||||
|
|
||||||
export class ReactionRequest {
|
export class ReactionRequest {}
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
import * as plugins from './smartuniverse.plugins';
|
import * as plugins from './smartuniverse.plugins';
|
||||||
|
|
||||||
export class ReactionResponse {}
|
export class ReactionResponse {}
|
||||||
|
@ -105,13 +105,12 @@ export class Universe {
|
|||||||
// add the role to smartsocket
|
// add the role to smartsocket
|
||||||
this.smartsocket.addSocketRoles([ClientRole]);
|
this.smartsocket.addSocketRoles([ClientRole]);
|
||||||
|
|
||||||
const socketFunctionSubscription = new plugins.smartsocket.SocketFunction<interfaces.ISocketRequest_SubscribeChannel>({
|
const socketFunctionSubscription = new plugins.smartsocket.SocketFunction<
|
||||||
|
interfaces.ISocketRequest_SubscribeChannel
|
||||||
|
>({
|
||||||
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
||||||
funcName: 'subscribeChannel',
|
funcName: 'subscribeChannel',
|
||||||
funcDef: async (
|
funcDef: async (dataArg, socketConnectionArg) => {
|
||||||
dataArg,
|
|
||||||
socketConnectionArg
|
|
||||||
) => {
|
|
||||||
const universeConnection = new UniverseConnection({
|
const universeConnection = new UniverseConnection({
|
||||||
socketConnection: socketConnectionArg,
|
socketConnection: socketConnectionArg,
|
||||||
authenticationRequests: [dataArg]
|
authenticationRequests: [dataArg]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user