2 * @file Strapp Protocol Manager
3 * @author Jordan Lavatai and Ken Grimes
11 /* KLMID == Key Location Method msgID Data */
12 /* Convert from KLMID to HTTP */
13 /* Convert from HTTP to KLMID */
14 /* Parse KLMID -> Execute method based on location */
15 /* Convert Object with KLMID keys to a string */
17 /** @func Parse the strapp protocol string
18 * @desc KLMID stands for Location Key Method ID Data
19 * [Optional] Key is the clientKey that is used to authorize the method
20 * If not specified, this message will not have any authorizations
21 * [Optional] Location is the location of the target file that the method will execute upon
22 * If not specified, target file is the current file
23 * [Required] Method is one of the file commands available
24 * [Required] ID is the message ID, used when multiple messages are being sent and received
25 * [Optional] Data is a parameter for the method e.g. PUT will replace the target files data property
27 * An unincluded message part needs to be indicated by a whitespace, i.e. ' ' i.e. /u{0020}.
28 * This function is mainly called by a SPCs receive event that processes every message that a SPC
30 * @arg {String} msg - String conforming to the strapp protocol
31 * @return {Object} - Parsed object with keys corresponding to segments of strapp Protocol
33 function parseSPM(msg
) {
34 /* if no location, then call the method in LMKID on the local file, i.e. "." */