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