diff --git a/docs/api/Items.md b/docs/api/Items.md index 1eea0ec..381581f 100644 --- a/docs/api/Items.md +++ b/docs/api/Items.md @@ -1 +1,421 @@ # Items + +An item is a chronological representation of an interaction with a user. + +## Properties + +### `Item.lastUpdated` +Type | Description +- | - +`String` | An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem. + +!!! example + ```js + console.log(Item.lastUpdated) + // Expected Output + "2021-04-03T00:48:38+00:00" + ``` + + +### `Item.headers` +Type | Description +- | - +`Array` | An array of objects containing parsed item headers in `type`/`value` pairs. + +!!! example + ```js + console.log(Item.headers[0]) + // Expexted Output + { type: "From", content: "\"Campbell, Justin Tyler\" \n"} + ``` + +### `Item.content` +Type | Description +- | - +`Array` | A chronological array of objects representing 1 of 9 possible actions taken on an item. + +**Possible Actions** +??? example "Directory Information" + Information about the user info collected from ECNDB including but not limited to alias, phone number and office location. + + ??? info "Properties" + | Key | Value | + | - | - | + |`type`|`directory_information`| + | `Name` | The real name of the sender. | + | `Login` | The career account alias of the sender. | + | `Computer` | The computer the item is related to. Formatting may vary. | + | `Location` | Where the computer is located. | + | `Email` | The email address of the sender. | + | `Phone` | The phone number of the sender. | + | `Office` | The office location of the sender. | + | `UNIX Dir` | The home directory for the user on non-Windows systems | + | `Zero Dir` | The home directory for the user via Active Directory | + | `User ECNDB` | Link to the sender's username report in ECNDB | + | `Host ECNDB` | Link to the computer report in ECNDB | + | `Subject` | The subject of the email sent to the queue | + + ??? quote "Parsed Example" + ```js + { + "type": "directory_information", + "Name": "Nestor Fabian Rodriguez Buitrago", + "Login": "rodri563", + "Computer": "ce-205-38 (128.46.205.67)", + "Location": "HAMP G230", + "Email": "rodri563@purdue.edu", + "Phone": "7654766893", + "Office": "HAMP G230", + "UNIX Dir": "/home/bridge/b/rodri563", + "Zero Dir": "U=\\\\bridge.ecn.purdue.edu\\rodri563", + "User ECNDB": "http://eng.purdue.edu/jump/2e8399a", + "Host ECNDB": "http://eng.purdue.edu/jump/2e83999", + "Subject": "Autocad installation" + } + ``` +??? example "Initial Message" + The body of the email the item originated from. + + ??? info "Properties" + | Key | Value | + | - | - | + | `type` | `initial_message` | + | `datetime` | RFC 8061 formatted datetime string. | + | `from_name` | The sender's real name. Formatting may vary. This can be empty. | + | `from_email` | The sender's email address. | + | `to` | A list of names(s) and email(s) of people this message was sent to. | + | `cc` | A list of name(s) and email(s) of people who were CC'd. This can be empty. | + | `subject` | The subject of the initial message. | + | `content` | The content of the message as an list of strings. | + + ??? quote "Parsed Example" + ```js + { + "type": "initial_message", + "datetime": "2020-09-11T01:26:45+00:00", + "from_name": "Justin Campbell", + "from_email": "campb303@purdue.edu", + "to": [ + { "name": "John Doe", "email": "johndoe@example.com" }, + ], + "cc": [ + { "name": "", "email": "janesmith@example.com" } + ], + "subject": Maps to item.subject, + "content": [ + "I need some help with something.\n" + ] + } + ``` +??? example "Edit" + Information added by someone at ECN, usually for internal use and/or communication. + + ??? info "Properties" + | Key | Value | + | - | - | + | `type` | `edit` | + | `datetime` | RFC 8061 formatted datetime string. | + | `by` | The career account alias of the person who added the edit. | + | `content` | The content of the edit as a list of strings. | + + ??? quote "Parsed Example" + ```js + { + "type": "edit", + "datetime": "2020-04-22T16:39:51", + "by": "knewell", + "content": [ + "This is related to another item. I need to do X next.\n" + ] + } + ``` +??? example "Status" + A short message about the progress of the item. + + ??? info "Properties" + | Key | Value | + | - | - | + | `type` | `status` | + | `datetime` | RFC 8061 formatted datetime string. | + | `by` | The career account alias of the person who updated the status. | + | `content` | The content of the status as a list of strings. | + + ??? quote "Parsed Example" + ```js + { + "type": "status", + "datetime": "2020-04-23T10:35:47", + "by": "knewell", + "content": [ + "Doing X thing." + ] + } + ``` +??? example "Assignment" + Assigning the item to someone. + + ??? info "Properties" + | Key | Value | + | - | - | + | `type` | `assignment` | + | `datetime` | RFC 8061 formatted datetime string. | + | `by` | The career account alias of the person who changed the |assignment. | + | `to` | The career account alias of the person who the item was assigned to. | + + ??? quote "Parsed Example" + ```js + { + "type": "assignment", + "datetime": "2020-06-23T13:27:00", + "by": "harley", + "to": "campb303", + } + ``` +??? example "Reply To User" + A message from ECN to the user and/or related parties. + + ??? info "Properties" + | Key | Value | + | - | - | + | `type` | `reply_to_user` | + | `datetime` | RFC 8061 formatted datetime string. | + | `by` | The sender's real name. Formatting may vary. This can be empty. | + | `content` | The content of the message as an list of strings | + + ??? quote "Parsed Example" + ```js + { + "type": "reply_to_user", + "datetime": "2020-05-08T09:21:43", + "by": "ewhile", + "content": [ + "Sascha,\n", + "\n", + "Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\n", + "\n", + "Ethan White\n", + "ECN" + ] + } + ``` +??? example "Reply To User" + A message from ECN to the user and/or related parties. + + ??? info "Properties" + | Key | Value | + | - | - | + | `type` | `reply_to_user` | + | `datetime` | RFC 8061 formatted datetime string. | + | `by` | The sender's real name. Formatting may vary. This can be empty. | + | `content` | The content of the message as an list of strings | + + ??? quote "Parsed Example" + ```js + { + "type": "reply_to_user", + "datetime": "2020-05-08T09:21:43", + "by": "ewhile", + "content": [ + "Sascha,\n", + "\n", + "Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\n", + "\n", + "Ethan White\n", + "ECN" + ] + } + ``` +??? example "Reply From User" + A message from the user and/or related parties. + + ??? info "Properties" + | Key | Value | + | - | - | + | `type` | `reply_from_user` | + | `datetime` | RFC 8061 formatted datetime string. | + | `from_name` | The sender's real name. Formatting may vary. This can be empty. | + | `from_email` | The sender's email address. | + | `cc` | A list of name(s) and email(s) of people who were CC'd. This can be empty. | + | `headers` | A dictionary of headers from the reply. | + | `subject` | The subject of the reply. | + | `content` | The content of the message as an list of strings | + + ??? quote "Parsed Example" + ```js + { + "type": "reply_from_user", + "datetime": "2020-05-08T13:57:18+00:00", + "from_name": "Reckowsky, Michael J.", + "from_email": "mreckowsky@purdue.edu", + "cc": [ + { "name": "John Doe", "email": "johndoe@example.com" }, + { "name": "", "email": "janesmith@example.com" } + ], + "headers" : [ + { + "type": "Subject", + "content": "RE: New Computer Deploy" + }, + { + "type": "From", + "content": "\"Reckowsky, Michael J.\" " + }, + { + "type": "Date", + "content": "Fri, 8 May 2020 13:57:17 +0000" + }, + ], + "subject": "RE: New Computer Deploy", + "content": [ + "Ethan,\n", + "\n", + "Biltong beef ribs doner chuck, pork chop jowl salami cow filet mignon pork.\n", + "\n", + "Mike\n", + ] + } + ``` +??? example "Parse Error" + An error caused by a malformed delimiter or nested delimiters. + + ??? info "Properties" + | Key | Value | + | - | - | + |`type`|`parse_error`| + | `datetime` | RFC 8061 formatted datetime string. | + | `file_path` | Full path of the item with the error. | + | `expected` | Description of what the parser was expecting. | + | `got` | Line that cause the parse error. | + | `line_num` | The line number in the item that caused the parse error. | + + ??? quote "Parsed Example" + ```js + { + 'type': 'parse_error', + 'datetime': '2020-10-16T10:44:45', + 'file_path': '/home/pier/e/benne238/webqueue2/q-snapshot/aae/2', + 'expected': 'Did not encounter a reply-from-user ending delimiter', + 'got': 'Kris', + 'line_num': 468 + } + ``` + +### `Item.isLocked` +Type | Description +- | - +`Boolean` | A boolean showing whether or not a lockfile for the item is present. + +!!! example + ```js + console.log(Item.isLocked) + // Expexted Output + true + ``` + +### `Item.userEmail` +Type | Description +- | - +`String` | The email address of the person who this item is from. + +!!! example + ```js + console.log(Item.userEmail) + // Expexted Output + "campb303@purdue.edu" + ``` + +### `Item.userName` +Type | Description +- | - +`String` | The real name of the person who this item is from. + +!!! example + ```js + console.log(Item.userName) + // Expexted Output + "Justin Campbell" + ``` + +### `Item.userAlias`: +Type | Description +- | - +`String` | The Purdue career account alias of the person this item is from. + +!!! example + ```js + console.log(Item.userAlias) + // Expexted Output + "campb303" + ``` + +### `Item.assignedTo`: +Type | Description +- | - +`String` | The Purdue career account alias of the person this item is assigned to. + +!!! example + ```js + console.log(Item.assignedTo) + // Expexted Output + "sundeep" + ``` + +### `Item.subject:` +Type | Description +- | - +`String` | The subject of the original message for this item. + +!!! example + ```js + console.log(Item.subject) + // Expexted Output + "Can't Access Outlook" + ``` + +### `Item.status` +Type | Description +- | - +`String` | The most recent status update for the item. + +!!! example + ```js + console.log(Item.status) + // Expexted Output + "Waiting for Reply" + ``` + +### `Item.priority:` +Type | Description +- | - +`String` | The most recent priority for this item. + +!!! example + ```js + console.log(Item.priority) + // Expexted Output + "COVID" + ``` + +### `Item.department` +Type | Description +- | - +`String` | The most recent department for this item. + +!!! example + ```js + console.log(Item.department) + // Expexted Output + "Bussiness Office" + ``` + +### `Item.dateReceived` +Type | Description +- | - +`String` | An ISO 8601 formatted time string showing the date this item was created. + +!!! example + ```js + console.log(Item.dateReceived) + // Expexted Output + "2021-04-03T00:48:38+00:00" + ``` \ No newline at end of file