Constructors

Methods

  • Delete an entry from the address map

    Parameters

    Returns void

  • Get the Socket.IO id from the OpenC2 id

    Parameters

    • openC2Id: string

      OpenC2 id to be mapped

    Returns undefined | string

    Socket.IO id

    if no valid OpenC2 id is provided

    const mapper = new AddressMapper();
    mapper.update('CmFw2HksBDH5Q6VMAAAC', 'myId');
    mapper.update('mK8mSuq2R0QxLDdHAAAF', 'myOtherId');
    mapper.getByOpenC2Id('otherId'); // undefined
    mapper.getByOpenC2Id('CmFw2HksBDH5Q6VMAAAC'); // 'myId'
    mapper.getByOpenC2Id('mK8mSuq2R0QxLDdHAAAF'); // 'myOtherId'
  • Get the OpenC2 id that match with the provided Socket.IO id

    Parameters

    • socketId: string

      socket identification to be mapped

    Returns undefined | string

    OpenC2 id

    if no valid URL is provided URL

    const mapper = new AddressMapper();
    mapper.update('CmFw2HksBDH5Q6VMAAAC', 'myId');
    mapper.update('mK8mSuq2R0QxLDdHAAAF', 'myOtherId');
    mapper.getBySocketId('otherId'); // undefined
    mapper.getBySocketId('CmFw2HksBDH5Q6VMAAAC'); // 'myId'
    mapper.getBySocketId('mK8mSuq2R0QxLDdHAAAF'); // 'myOtherId'
  • Update or create a new address entry in the map

    Parameters

    • socketId: string

      Socket.IO to be mapped

    • openC2Id: string

      OpenC2 identification to be mapped

    Returns void