MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: machen (1008)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //opt/lck-backend/node_modules/@supabase/realtime-js/src/lib/constants.ts
import { version } from './version'
import type {
  SocketState,
  ChannelState,
  ChannelEvent as PhoenixChannelEvent,
  Transport,
  Vsn,
} from '../phoenix/types'

export type { SocketState, ChannelState, Transport }

export const DEFAULT_VERSION = `realtime-js/${version}`

export const VSN_1_0_0: Vsn = '1.0.0'
export const VSN_2_0_0: Vsn = '2.0.0'
export const DEFAULT_VSN: Vsn = VSN_2_0_0

export const VERSION = version

export const DEFAULT_TIMEOUT = 10000

export const WS_CLOSE_NORMAL = 1000
export const MAX_PUSH_BUFFER_SIZE = 100

export const SOCKET_STATES = {
  connecting: 0,
  open: 1,
  closing: 2,
  closed: 3,
} as const

export const CHANNEL_STATES = {
  closed: 'closed',
  errored: 'errored',
  joined: 'joined',
  joining: 'joining',
  leaving: 'leaving',
} as const

export type ChannelEvent = PhoenixChannelEvent | 'access_token'

export const CHANNEL_EVENTS = {
  close: 'phx_close',
  error: 'phx_error',
  join: 'phx_join',
  reply: 'phx_reply',
  leave: 'phx_leave',
  access_token: 'access_token',
} as const

export const TRANSPORTS = {
  websocket: 'websocket',
} as const

export type ConnectionState = 'connecting' | 'open' | 'closing' | 'closed' | (string & {})

export const CONNECTION_STATE = {
  connecting: 'connecting',
  open: 'open',
  closing: 'closing',
  closed: 'closed',
} as const