Skip to content

Messenger Prototype Module Messenger

Vaughn edited this page May 4, 2018 · 3 revisions

MessengerPrototype :: Module :: Messenger

Messenger.Overview

The Messenger module is a core module within this MessengerPrototype application. Currently, all messages and contacts are mocked. Automated mocked responses are sent back to the user after a successful message has been sent.

Messenger.Services

MessengerService

Methods

MessengerService.sendMessage$(contactId: String, message: String, ?attachment: Mixed) : Observable
// Observable and will return the generated Message
// object upon a successful message delivery.

MessengerService.createContact$(contact: Contact) : Observable
// Observable and will return the newly created contact
// information if the contact was saved successfully.

MessengerService.fetchContacts$() : Observable
// Observable and will return a collection of Contacts.

MessengerService.fetchContact$(contactId: String) : Observable
// Observable and will return a specific contact
// based on a passed contactId.
// Will return false if no contact matches.

MessengerService.fetchContactMessages$(contactId: String) : Observable
// Observable and will return messages for a specific
// contact based on a passed contactId.
// Will return false if no contact matches.

MessengerService.saveContact$(contact: Contact) : Observable
// Observable and will return the updated contact information
// if the passed Contact exists and was updated successfully.
// Will return false if no contact matches.

MessengerService.deleteContact$(contact: Contact) : Observable
// Observable and will return true if the passed Contact
// exists and was successfully deleted.
// Will return false if no contact matches.

Models

Contact = {
  (String) name: '', // The name for a contact
}

Message = {
  (String) contactId: '', // The unique ID of a contact the message was sent to
  (String) senderId: '', // The unique ID of the sender the message was sent from
  (String) body: '', // The body of the message
  (Object) attachment: {} // Optional. An attachment to append to the message
}
Clone this wiki locally