From d17ac76d8256b00eb253138a554c7d3d51139b9e Mon Sep 17 00:00:00 2001 From: jordan Date: Sun, 16 Jul 2017 00:51:20 -0700 Subject: [PATCH] skeletal structure for bootstrap.js --- bootstrap.js | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 bootstrap.js diff --git a/bootstrap.js b/bootstrap.js new file mode 100644 index 0000000..a90539e --- /dev/null +++ b/bootstrap.js @@ -0,0 +1,107 @@ +/** + * @file Shared API + * @author Jordan Lavatai and Ken Grimes + * @version 0.0.1 + * @license APGL-3.0 + * @copyright Strapp.io + */ + +const dlog = (msg) => console.log(msg) + +/***********************/ +/** Helper functions **/ +/***********************/ + +/* SDP Interop helper functions to be used by beginRTCOffer and beginRTCAnswer */ + +/** @func Determines the multimedia signaling protocol for the given session description + * @desc Does some basic duck typing to determine the type of Session Description + * @arg {Object} Session Description Object + * @return {String} Returns 'planB' if Session Description is planB, 'Unified' if + * Session Description is Unified + */ +function determineSessionDescription(sessionDescription) { +} + +/** @func Converts a planB session description to Unified session description + * @arg {Object} Session Description Object + * @return {Object} PlanB Session Description + */ +function toUnified(sessionDescription) { +} + +/** @func Converts a Unified session description to planB session description + * @arg {Object} Session Description Object + * @return {Object} PlanB Session Description + */ +function toPlanB(sessionDescription) { +} + +/* WebSocket wielder helper functions */ + +/* Function for setting up webSocket wielders message handler */ +/* TBD */ +/* TBD */ + +/* SDP Negotiation helper functions */ + +/* addRemoteIceCandidate() */ +/* addIceCandidateCreationHandler(callback for sending?) */ +/* handleIceRequest() - WebSpocketless entity specific */ + + +/***********************/ +/** Exposed functions **/ +/***********************/ + +/** @func Attempts to create a websocket + * @desc If user agent supports web sockets, attempt to create a websocket + * with given domain + * @arg {String} domain - ip address or domain name of other end of websocket + * @return {Boolean} returns true if successful, false if unsucessful + */ +export function createWebSocket(domain) { + +} + +/** @func Returns public key for the user + * @desc Attempts to find a stored key. If unsucessful, ask user for key. If user + * doesn't have a key, generates a key + * @dependencies keyManager, fileSystem + * @options specif + * @return {Object} cryptoKey object + */ +export function resolveKey() { + +} + +/** @func Begins the SDP handshake process as the offerer + * @desc + * + * + */ +export function beginRTCOffer() { +} + +/** @func Begins the SDP handshake process as the answerer + * @desc + * + * + */ +export function beginRTCAnswer() { +} + + +/** @func Generic way to message host from client + * @desc tbd + * @arg {Object} data object to be sent + */ +export function sendHostData(data) { +} + +/** @func Generic way to message client from host + * @desc tbd + * @arg {Object} data object to be sent + */ +export function sendClientData(data){ +} -- 2.18.0