Server : nginx/1.18.0 System : Linux localhost 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64 User : www-data ( 33) PHP Version : 8.0.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/ecommerce/node_modules/pusher-js/src/core/utils/ |
import AssistantToTheTransportManager from '../transports/assistant_to_the_transport_manager';
import PingDelayOptions from '../transports/ping_delay_options';
import Transport from '../transports/transport';
import TransportManager from '../transports/transport_manager';
import Handshake from '../connection/handshake';
import TransportConnection from '../transports/transport_connection';
import SocketHooks from '../http/socket_hooks';
import HTTPSocket from '../http/http_socket';
import { AuthorizerOptions, Authorizer } from '../auth/options';
import PusherAuthorizer from '../auth/pusher_authorizer';
import Timeline from '../timeline/timeline';
import {
default as TimelineSender,
TimelineSenderOptions
} from '../timeline/timeline_sender';
import PresenceChannel from '../channels/presence_channel';
import PrivateChannel from '../channels/private_channel';
import EncryptedChannel from '../channels/encrypted_channel';
import Channel from '../channels/channel';
import ConnectionManager from '../connection/connection_manager';
import ConnectionManagerOptions from '../connection/connection_manager_options';
import Ajax from '../http/ajax';
import Channels from '../channels/channels';
import Pusher from '../pusher';
import { Config } from '../config';
import * as nacl from 'tweetnacl';
var Factory = {
createChannels(): Channels {
return new Channels();
},
createConnectionManager(
key: string,
options: ConnectionManagerOptions
): ConnectionManager {
return new ConnectionManager(key, options);
},
createChannel(name: string, pusher: Pusher): Channel {
return new Channel(name, pusher);
},
createPrivateChannel(name: string, pusher: Pusher): PrivateChannel {
return new PrivateChannel(name, pusher);
},
createPresenceChannel(name: string, pusher: Pusher): PresenceChannel {
return new PresenceChannel(name, pusher);
},
createEncryptedChannel(
name: string,
pusher: Pusher,
nacl: nacl
): EncryptedChannel {
return new EncryptedChannel(name, pusher, nacl);
},
createTimelineSender(timeline: Timeline, options: TimelineSenderOptions) {
return new TimelineSender(timeline, options);
},
createAuthorizer(channel: Channel, options: AuthorizerOptions): Authorizer {
if (options.authorizer) {
return options.authorizer(channel, options);
}
return new PusherAuthorizer(channel, options);
},
createHandshake(
transport: TransportConnection,
callback: (HandshakePayload) => void
): Handshake {
return new Handshake(transport, callback);
},
createAssistantToTheTransportManager(
manager: TransportManager,
transport: Transport,
options: PingDelayOptions
): AssistantToTheTransportManager {
return new AssistantToTheTransportManager(manager, transport, options);
}
};
export default Factory;