@eleven-am/pondsocket-nest 0.0.136 → 0.0.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -541
- package/dist/context/context.d.ts +41 -0
- package/dist/context/context.js +238 -0
- package/{decorators → dist/decorators}/onConnectionRequest.js +2 -2
- package/{decorators → dist/decorators}/onEvent.js +2 -2
- package/{decorators → dist/decorators}/onJoinRequest.js +2 -2
- package/{decorators → dist/decorators}/onLeave.js +3 -4
- package/{decorators → dist/decorators}/onOutgoingEvent.js +10 -2
- package/{helpers → dist/helpers}/createParamDecorator.js +4 -3
- package/{helpers → dist/helpers}/misc.d.ts +1 -1
- package/dist/helpers/misc.js +27 -0
- package/dist/index.d.ts +6 -0
- package/{index.js → dist/index.js} +1 -0
- package/dist/managers/outgoingEvent.d.ts +5 -0
- package/{modules → dist/modules}/pondSocket.js +4 -5
- package/dist/performers/action.d.ts +8 -0
- package/dist/performers/action.js +121 -0
- package/dist/performers/errors.d.ts +4 -0
- package/dist/performers/errors.js +43 -0
- package/dist/performers/response.d.ts +5 -0
- package/dist/performers/response.js +65 -0
- package/{services → dist/services}/pondSocket.d.ts +12 -4
- package/dist/services/pondSocket.js +288 -0
- package/dist/types.d.ts +113 -0
- package/package.json +57 -46
- package/context/context.d.ts +0 -27
- package/context/context.js +0 -103
- package/helpers/misc.js +0 -13
- package/index.d.ts +0 -5
- package/managers/outgoingEvent.d.ts +0 -5
- package/performers/action.d.ts +0 -5
- package/performers/action.js +0 -89
- package/performers/errors.d.ts +0 -2
- package/performers/errors.js +0 -37
- package/performers/narrow.d.ts +0 -7
- package/performers/narrow.js +0 -21
- package/performers/response.d.ts +0 -3
- package/performers/response.js +0 -62
- package/services/pondSocket.js +0 -190
- package/types.d.ts +0 -64
- /package/{constants.d.ts → dist/constants.d.ts} +0 -0
- /package/{constants.js → dist/constants.js} +0 -0
- /package/{decorators → dist/decorators}/channel.d.ts +0 -0
- /package/{decorators → dist/decorators}/channel.js +0 -0
- /package/{decorators → dist/decorators}/channelInstance.d.ts +0 -0
- /package/{decorators → dist/decorators}/channelInstance.js +0 -0
- /package/{decorators → dist/decorators}/endpoint.d.ts +0 -0
- /package/{decorators → dist/decorators}/endpoint.js +0 -0
- /package/{decorators → dist/decorators}/endpointInstance.d.ts +0 -0
- /package/{decorators → dist/decorators}/endpointInstance.js +0 -0
- /package/{decorators → dist/decorators}/getChannel.d.ts +0 -0
- /package/{decorators → dist/decorators}/getChannel.js +0 -0
- /package/{decorators → dist/decorators}/getConnectionContext.d.ts +0 -0
- /package/{decorators → dist/decorators}/getConnectionContext.js +0 -0
- /package/{decorators → dist/decorators}/getConnectionHeaders.d.ts +0 -0
- /package/{decorators → dist/decorators}/getConnectionHeaders.js +0 -0
- /package/{decorators → dist/decorators}/getContext.d.ts +0 -0
- /package/{decorators → dist/decorators}/getContext.js +0 -0
- /package/{decorators → dist/decorators}/getEventContext.d.ts +0 -0
- /package/{decorators → dist/decorators}/getEventContext.js +0 -0
- /package/{decorators → dist/decorators}/getEventParams.d.ts +0 -0
- /package/{decorators → dist/decorators}/getEventParams.js +0 -0
- /package/{decorators → dist/decorators}/getEventPayload.d.ts +0 -0
- /package/{decorators → dist/decorators}/getEventPayload.js +0 -0
- /package/{decorators → dist/decorators}/getEventQuery.d.ts +0 -0
- /package/{decorators → dist/decorators}/getEventQuery.js +0 -0
- /package/{decorators → dist/decorators}/getJoinContext.d.ts +0 -0
- /package/{decorators → dist/decorators}/getJoinContext.js +0 -0
- /package/{decorators → dist/decorators}/getJoinParams.d.ts +0 -0
- /package/{decorators → dist/decorators}/getJoinParams.js +0 -0
- /package/{decorators → dist/decorators}/getLeaveEvent.d.ts +0 -0
- /package/{decorators → dist/decorators}/getLeaveEvent.js +0 -0
- /package/{decorators → dist/decorators}/getUserAssigns.d.ts +0 -0
- /package/{decorators → dist/decorators}/getUserAssigns.js +0 -0
- /package/{decorators → dist/decorators}/getUserData.d.ts +0 -0
- /package/{decorators → dist/decorators}/getUserData.js +0 -0
- /package/{decorators → dist/decorators}/getUserPresence.d.ts +0 -0
- /package/{decorators → dist/decorators}/getUserPresence.js +0 -0
- /package/{decorators → dist/decorators}/index.d.ts +0 -0
- /package/{decorators → dist/decorators}/index.js +0 -0
- /package/{decorators → dist/decorators}/onConnectionRequest.d.ts +0 -0
- /package/{decorators → dist/decorators}/onEvent.d.ts +0 -0
- /package/{decorators → dist/decorators}/onJoinRequest.d.ts +0 -0
- /package/{decorators → dist/decorators}/onLeave.d.ts +0 -0
- /package/{decorators → dist/decorators}/onOutgoingEvent.d.ts +0 -0
- /package/{decorators → dist/decorators}/useGuards.d.ts +0 -0
- /package/{decorators → dist/decorators}/useGuards.js +0 -0
- /package/{decorators → dist/decorators}/usePipes.d.ts +0 -0
- /package/{decorators → dist/decorators}/usePipes.js +0 -0
- /package/{helpers → dist/helpers}/createContextParamDecorator.d.ts +0 -0
- /package/{helpers → dist/helpers}/createContextParamDecorator.js +0 -0
- /package/{helpers → dist/helpers}/createParamDecorator.d.ts +0 -0
- /package/{managers → dist/managers}/channel.d.ts +0 -0
- /package/{managers → dist/managers}/channel.js +0 -0
- /package/{managers → dist/managers}/channelInstance.d.ts +0 -0
- /package/{managers → dist/managers}/channelInstance.js +0 -0
- /package/{managers → dist/managers}/class.d.ts +0 -0
- /package/{managers → dist/managers}/class.js +0 -0
- /package/{managers → dist/managers}/connection.d.ts +0 -0
- /package/{managers → dist/managers}/connection.js +0 -0
- /package/{managers → dist/managers}/createMetadataManager.d.ts +0 -0
- /package/{managers → dist/managers}/createMetadataManager.js +0 -0
- /package/{managers → dist/managers}/endpoint.d.ts +0 -0
- /package/{managers → dist/managers}/endpoint.js +0 -0
- /package/{managers → dist/managers}/endpointInstance.d.ts +0 -0
- /package/{managers → dist/managers}/endpointInstance.js +0 -0
- /package/{managers → dist/managers}/event.d.ts +0 -0
- /package/{managers → dist/managers}/event.js +0 -0
- /package/{managers → dist/managers}/guards.d.ts +0 -0
- /package/{managers → dist/managers}/guards.js +0 -0
- /package/{managers → dist/managers}/handlers.d.ts +0 -0
- /package/{managers → dist/managers}/handlers.js +0 -0
- /package/{managers → dist/managers}/join.d.ts +0 -0
- /package/{managers → dist/managers}/join.js +0 -0
- /package/{managers → dist/managers}/leave.d.ts +0 -0
- /package/{managers → dist/managers}/leave.js +0 -0
- /package/{managers → dist/managers}/method.d.ts +0 -0
- /package/{managers → dist/managers}/method.js +0 -0
- /package/{managers → dist/managers}/outgoingEvent.js +0 -0
- /package/{managers → dist/managers}/parametres.d.ts +0 -0
- /package/{managers → dist/managers}/parametres.js +0 -0
- /package/{managers → dist/managers}/pipes.d.ts +0 -0
- /package/{managers → dist/managers}/pipes.js +0 -0
- /package/{managers → dist/managers}/property.d.ts +0 -0
- /package/{managers → dist/managers}/property.js +0 -0
- /package/{modules → dist/modules}/pondSocket.d.ts +0 -0
- /package/{types.js → dist/types.js} +0 -0
package/services/pondSocket.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PondSocketService = void 0;
|
|
13
|
-
const pondsocket_1 = require("@eleven-am/pondsocket");
|
|
14
|
-
const common_1 = require("@nestjs/common");
|
|
15
|
-
const constants_1 = require("../constants");
|
|
16
|
-
const channel_1 = require("../managers/channel");
|
|
17
|
-
const channelInstance_1 = require("../managers/channelInstance");
|
|
18
|
-
const connection_1 = require("../managers/connection");
|
|
19
|
-
const endpoint_1 = require("../managers/endpoint");
|
|
20
|
-
const endpointInstance_1 = require("../managers/endpointInstance");
|
|
21
|
-
const event_1 = require("../managers/event");
|
|
22
|
-
const join_1 = require("../managers/join");
|
|
23
|
-
const leave_1 = require("../managers/leave");
|
|
24
|
-
const outgoingEvent_1 = require("../managers/outgoingEvent");
|
|
25
|
-
class PondSocketService {
|
|
26
|
-
constructor(moduleRef, discovery, adapterHost, globalGuards, globalPipes, isExclusiveSocketServer, distributedBackend, maxMessageSize, heartbeatInterval) {
|
|
27
|
-
this.moduleRef = moduleRef;
|
|
28
|
-
this.discovery = discovery;
|
|
29
|
-
this.adapterHost = adapterHost;
|
|
30
|
-
this.globalGuards = globalGuards;
|
|
31
|
-
this.globalPipes = globalPipes;
|
|
32
|
-
this.isExclusiveSocketServer = isExclusiveSocketServer;
|
|
33
|
-
this.distributedBackend = distributedBackend;
|
|
34
|
-
this.maxMessageSize = maxMessageSize;
|
|
35
|
-
this.heartbeatInterval = heartbeatInterval;
|
|
36
|
-
this.logger = new common_1.Logger(PondSocketService.name);
|
|
37
|
-
this.socket = null;
|
|
38
|
-
}
|
|
39
|
-
onModuleInit() {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const instances = yield this.getGroupedInstances();
|
|
42
|
-
this.socket = new pondsocket_1.PondSocket({
|
|
43
|
-
server: this.adapterHost.httpAdapter.getHttpServer(),
|
|
44
|
-
exclusiveServer: this.isExclusiveSocketServer,
|
|
45
|
-
distributedBackend: this.distributedBackend,
|
|
46
|
-
maxMessageSize: this.maxMessageSize,
|
|
47
|
-
heartbeatInterval: this.heartbeatInterval,
|
|
48
|
-
});
|
|
49
|
-
instances.forEach((instance) => this.manageEndpoint(this.socket, instance));
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
onModuleDestroy() {
|
|
53
|
-
var _a;
|
|
54
|
-
(_a = this.socket) === null || _a === void 0 ? void 0 : _a.close();
|
|
55
|
-
this.socket = null;
|
|
56
|
-
}
|
|
57
|
-
manageEndpoint(socket, groupedInstance) {
|
|
58
|
-
const instance = groupedInstance.endpoint.instance;
|
|
59
|
-
const constructor = instance.constructor;
|
|
60
|
-
const metadata = (0, endpoint_1.manageEndpoint)(constructor).get();
|
|
61
|
-
const { set: setEndpoint } = (0, endpointInstance_1.manageEndpointInstance)(instance);
|
|
62
|
-
if (!metadata) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const { get } = (0, connection_1.manageConnection)(instance);
|
|
66
|
-
const channels = [...new Set([...groupedInstance.channels.map((channel) => channel)])];
|
|
67
|
-
const [handler] = get();
|
|
68
|
-
const endpoint = socket.createEndpoint(metadata, (context) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
if (handler) {
|
|
70
|
-
yield handler.value(instance, this.moduleRef, this.globalGuards, this.globalPipes, context);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
context.accept();
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
76
|
-
this.logger.log(`${groupedInstance.endpoint.name} {${metadata}}`);
|
|
77
|
-
if (handler) {
|
|
78
|
-
this.logger.log(`Mapped {${metadata}, CONNECTION}`);
|
|
79
|
-
}
|
|
80
|
-
setEndpoint(endpoint);
|
|
81
|
-
channels.forEach((channel) => this.manageChannel(channel, endpoint, metadata));
|
|
82
|
-
}
|
|
83
|
-
manageChannel(channel, endpoint, endpointPath) {
|
|
84
|
-
const instance = channel.instance;
|
|
85
|
-
const constructor = instance.constructor;
|
|
86
|
-
const path = (0, channel_1.manageChannel)(constructor).get();
|
|
87
|
-
if (!path) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const { set: setChannel } = (0, channelInstance_1.manageChannelInstance)(instance);
|
|
91
|
-
const { get } = (0, join_1.manageJoin)(instance);
|
|
92
|
-
const [handler] = get();
|
|
93
|
-
const channelInstance = endpoint.createChannel(path, (context) => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
if (handler) {
|
|
95
|
-
yield handler.value(instance, this.moduleRef, this.globalGuards, this.globalPipes, context);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
context.accept();
|
|
99
|
-
}
|
|
100
|
-
}));
|
|
101
|
-
const newPath = `${endpointPath}/${path}`.replace(/\/+/g, '/');
|
|
102
|
-
this.logger.log(`${channel.name} {${newPath}}`);
|
|
103
|
-
if (handler) {
|
|
104
|
-
this.logger.log(`Mapped {${newPath}, JOIN}`);
|
|
105
|
-
}
|
|
106
|
-
setChannel(channelInstance);
|
|
107
|
-
const { get: getEventHandlers } = (0, event_1.manageEvent)(instance);
|
|
108
|
-
const { get: getLeaveHandlers } = (0, leave_1.manageLeave)(instance);
|
|
109
|
-
getEventHandlers().forEach((handler) => {
|
|
110
|
-
channelInstance.onEvent(handler.path, (context) => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
yield handler.value(instance, this.moduleRef, this.globalGuards, this.globalPipes, context);
|
|
112
|
-
}));
|
|
113
|
-
const newEventPath = `${newPath}/${handler.path}`.replace(/\/+/g, '/');
|
|
114
|
-
this.logger.log(`Mapped {${newEventPath}, EVENT}`);
|
|
115
|
-
});
|
|
116
|
-
const { get: getOutgoingHandlers } = (0, outgoingEvent_1.manageOutgoingEvent)(instance);
|
|
117
|
-
getOutgoingHandlers().forEach((handler) => {
|
|
118
|
-
channelInstance.handleOutgoingEvent(handler.path, (context) => __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
yield handler.value(instance, this.moduleRef, this.globalGuards, this.globalPipes, context);
|
|
120
|
-
}));
|
|
121
|
-
const newOutgoingPath = `${newPath}/${handler.path}`.replace(/\/+/g, '/');
|
|
122
|
-
this.logger.log(`Mapped {${newOutgoingPath}, OUTGOING}`);
|
|
123
|
-
});
|
|
124
|
-
const [leaveHandler] = getLeaveHandlers();
|
|
125
|
-
if (leaveHandler) {
|
|
126
|
-
channelInstance.onLeave((event) => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
yield leaveHandler.value(instance, this.moduleRef, this.globalGuards, this.globalPipes, event);
|
|
128
|
-
}));
|
|
129
|
-
this.logger.log(`Mapped {${newPath}, LEAVE}`);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
getGroupedInstances() {
|
|
133
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
-
var _a;
|
|
135
|
-
const endpoints = yield this.discovery.providersWithMetaAtKey(constants_1.endpointKey);
|
|
136
|
-
const channels = yield this.discovery.providersWithMetaAtKey(constants_1.channelKey);
|
|
137
|
-
const modules = new Map();
|
|
138
|
-
endpoints.forEach((endpoint) => {
|
|
139
|
-
const module = endpoint.discoveredClass.parentModule.injectType;
|
|
140
|
-
if (!modules.has(module)) {
|
|
141
|
-
modules.set(module, {
|
|
142
|
-
endpoints: [],
|
|
143
|
-
channels: [],
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
modules.get(module).endpoints.push(endpoint.discoveredClass);
|
|
147
|
-
});
|
|
148
|
-
channels.forEach((channel) => {
|
|
149
|
-
const module = channel.discoveredClass.parentModule.injectType;
|
|
150
|
-
if (!modules.has(module)) {
|
|
151
|
-
modules.set(module, {
|
|
152
|
-
endpoints: [],
|
|
153
|
-
channels: [],
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
modules.get(module).channels.push(channel.discoveredClass);
|
|
157
|
-
});
|
|
158
|
-
const instances = [...modules.values()];
|
|
159
|
-
const channelsWithNoEndpoints = instances.filter((instance) => instance.channels.length > 0 && instance.endpoints.length === 0);
|
|
160
|
-
const channelsWithEndpoints = instances.filter((instance) => instance.channels.length > 0 && instance.endpoints.length > 0);
|
|
161
|
-
const groupedInstances = channelsWithEndpoints.map((instance) => instance.endpoints.map((endpoint) => ({
|
|
162
|
-
endpoint,
|
|
163
|
-
channels: instance.channels,
|
|
164
|
-
}))).flat();
|
|
165
|
-
const baseEndpoint = endpoints.length === 1 ?
|
|
166
|
-
endpoints[0].discoveredClass :
|
|
167
|
-
(_a = endpoints
|
|
168
|
-
.find((endpoint) => endpoint.discoveredClass.parentModule.name === 'AppModule')) === null || _a === void 0 ? void 0 : _a.discoveredClass;
|
|
169
|
-
const groupedInstanceWithBaseEndpoint = groupedInstances.find((groupedInstance) => groupedInstance.endpoint.instance === (baseEndpoint === null || baseEndpoint === void 0 ? void 0 : baseEndpoint.instance));
|
|
170
|
-
if (channelsWithNoEndpoints.length > 0) {
|
|
171
|
-
if (groupedInstanceWithBaseEndpoint) {
|
|
172
|
-
const channels = channelsWithNoEndpoints.map((instance) => instance.channels).flat();
|
|
173
|
-
groupedInstanceWithBaseEndpoint.channels = [...new Set([...groupedInstanceWithBaseEndpoint.channels, ...channels])];
|
|
174
|
-
}
|
|
175
|
-
else if (baseEndpoint) {
|
|
176
|
-
const channels = channelsWithNoEndpoints.map((instance) => instance.channels).flat();
|
|
177
|
-
groupedInstances.push({
|
|
178
|
-
endpoint: baseEndpoint,
|
|
179
|
-
channels,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
throw new Error('No base endpoint found');
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return groupedInstances;
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
exports.PondSocketService = PondSocketService;
|
package/types.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { ConnectionContext, EventContext, IDistributedBackend, JoinContext, LeaveEvent, PondAssigns, PondMessage, PondPresence } from '@eleven-am/pondsocket/types';
|
|
2
|
-
import type { DiscoveredClass } from '@golevelup/nestjs-discovery/lib/discovery.interfaces';
|
|
3
|
-
import type { ModuleMetadata, PipeTransform } from '@nestjs/common';
|
|
4
|
-
import type { ModuleRef } from '@nestjs/core';
|
|
5
|
-
import type { Context } from './context/context';
|
|
6
|
-
export interface NestContext {
|
|
7
|
-
connection?: ConnectionContext<string>;
|
|
8
|
-
join?: JoinContext<string>;
|
|
9
|
-
event?: EventContext<string>;
|
|
10
|
-
leave?: LeaveEvent;
|
|
11
|
-
}
|
|
12
|
-
export type ParamDecoratorCallback<Input> = (data: Input, context: Context, type: unknown) => unknown | Promise<unknown>;
|
|
13
|
-
export interface ParamDecoratorMetadata {
|
|
14
|
-
index: number;
|
|
15
|
-
callback: (context: Context, globalPipes: Constructor<PipeTransform>[], moduleRef: ModuleRef) => Promise<unknown>;
|
|
16
|
-
}
|
|
17
|
-
export type HandlerFunction<Context> = (instance: unknown, moduleRef: ModuleRef, globalGuards: Constructor<CanActivate>[], globalPipes: Constructor<PipeTransform>[], ctx: Context) => Promise<void>;
|
|
18
|
-
export type HandlerData<Context> = {
|
|
19
|
-
path: string;
|
|
20
|
-
value: HandlerFunction<Context>;
|
|
21
|
-
};
|
|
22
|
-
export type Constructor<T, Parameters extends any[] = any[]> = new (...args: Parameters) => T;
|
|
23
|
-
export interface CanActivate {
|
|
24
|
-
/**
|
|
25
|
-
* @desc Whether the client can continue with the request
|
|
26
|
-
* @param context - The context of the request
|
|
27
|
-
*/
|
|
28
|
-
canActivate(context: Context): boolean | Promise<boolean>;
|
|
29
|
-
}
|
|
30
|
-
export type GroupedInstances = {
|
|
31
|
-
endpoint: DiscoveredClass;
|
|
32
|
-
channels: DiscoveredClass[];
|
|
33
|
-
};
|
|
34
|
-
export interface Metadata extends Omit<ModuleMetadata, 'controllers'> {
|
|
35
|
-
guards?: Constructor<CanActivate>[];
|
|
36
|
-
pipes?: Constructor<PipeTransform>[];
|
|
37
|
-
isExclusiveSocketServer?: boolean;
|
|
38
|
-
backend?: IDistributedBackend;
|
|
39
|
-
maxMessageSize?: number;
|
|
40
|
-
heartbeatInterval?: number;
|
|
41
|
-
isGlobal?: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface AsyncFactoryResult {
|
|
44
|
-
backend?: IDistributedBackend;
|
|
45
|
-
maxMessageSize?: number;
|
|
46
|
-
heartbeatInterval?: number;
|
|
47
|
-
}
|
|
48
|
-
export interface AsyncMetadata extends Omit<Metadata, 'backend' | 'maxMessageSize' | 'heartbeatInterval'> {
|
|
49
|
-
isGlobal?: boolean;
|
|
50
|
-
inject?: any[];
|
|
51
|
-
imports?: any[];
|
|
52
|
-
useFactory: (...args: any[]) => Promise<AsyncFactoryResult> | AsyncFactoryResult;
|
|
53
|
-
}
|
|
54
|
-
export type PondResponse<Event extends string = string, Payload extends PondMessage = PondMessage, Presence extends PondPresence = PondPresence, Assigns extends PondAssigns = PondAssigns> = {
|
|
55
|
-
event?: Event;
|
|
56
|
-
broadcast?: Event;
|
|
57
|
-
broadcastFrom?: Event;
|
|
58
|
-
assigns?: Partial<Assigns>;
|
|
59
|
-
presence?: Partial<Presence>;
|
|
60
|
-
broadcastTo?: {
|
|
61
|
-
event: Event;
|
|
62
|
-
users: string[];
|
|
63
|
-
};
|
|
64
|
-
} & Payload;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|