"use strict";

var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
_Object$defineProperty(exports, "__esModule", {
  value: true
});
exports.SOCKET_READY_STATE = exports.MOBIUS_SOCKET_4001_EVENT = exports.MESSAGE_TYPES = void 0;
var _freeze = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/freeze"));
/**
 * WebSocket connection ready states.
 * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState
 */
var SOCKET_READY_STATE = exports.SOCKET_READY_STATE = (0, _freeze.default)({
  /** Connection is being established */
  CONNECTING: 0,
  /** Connection is open and ready to communicate */
  OPEN: 1,
  /** Connection is in the process of closing */
  CLOSING: 2,
  /** Connection is closed */
  CLOSED: 3
});

/**
 * Message type identifiers for socket communications.
 */
var MESSAGE_TYPES = exports.MESSAGE_TYPES = (0, _freeze.default)({
  /** Authentication message type */
  AUTH: 'auth',
  /** Event acknowledgment message type */
  EVENT_ACK: 'event_ack'
});

/**
 * Event payload for a 4001 event from Mobius.
 * This is defined this way as mobius requires 4001 code to be handled the same way as a registration.down event.
 */
var MOBIUS_SOCKET_4001_EVENT = exports.MOBIUS_SOCKET_4001_EVENT = {
  type: 'async_event',
  trackingId: '4001-event',
  eventId: '4001-event-id',
  data: {
    eventType: 'registration.down',
    deviceInfo: {
      userId: '4001-user-id',
      device: {
        deviceId: '4001-device-id',
        uri: '4001-device-uri',
        status: 'inactive'
      }
    }
  }
};
//# sourceMappingURL=constants.js.map
