Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fh-wfm-message

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fh-wfm-message

An message module for WFM

  • 0.0.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
3
Weekly downloads
 
Created
Source

FeedHenry WFM message Build Status

This module contains a message model representation and its related services :

  • Backend services
  • Frontend services
  • Frontend UI templates

Client-side usage

Client-side usage (via broswerify)

Setup

This module is packaged in a CommonJS format, exporting the name of the Angular namespace. The module can be included in an angular.js as follows:

angular.module('app', [
, require('fh-wfm-message')
...
])
Integration
Angular controller

A sync manager must first be initialized using the messageSync.createManager(). This can be placed, for instance, in the resolve config of a ui-router controlled application.

resolve: {
  messageManager: function(messageSync) {
    return messageSync.createManager();
  }
}

For a more complete example, please check the demo portal app.

messageSync API

These messageSync API methods all return Promises:

messageSync methodDescription
messageSync.manager.listlist all messages
messageSync.manager.create(message)create a message
messageSync.manager.read(messageId)read a message
messageSync.manager.update(message)update a message
message directives
NameAttributes
message-listlist, selectedModel
message-formvalue, workers
message-detailmessage

Usage in an express backend

Setup

The server-side component of this WFM module exports a function that takes express and mediator instances as parameters, as in:

var express = require('express')
  , app = express()
  , mbaasExpress = mbaasApi.mbaasExpress()
  , mediator = require('fh-wfm-mediator/lib/mediator')
  ;

// configure the express app
...

// setup the wfm message sync server
require('fh-wfm-message/server')(mediator, app, mbaasExpress);

Server side events

the module broadcasts, and listens for the following events

Listens forResponds with
wfm:message:listdone:wfm:message:list
wfm:message:readdone:wfm:message:read
wfm:message:updatedone:wfm:message:update
wfm:message:createdone:wfm:message:create

Integration

Check this demo cloud application

message data structure example


  {
    id: 1276001,
    receiverId: "156340",
    status: "unread",
    sender: {
      avatar:"https://s3.amazonaws.com/uifaces/faces/twitter/kolage/128.jpg",
      name:"Trever Smith"
    },
    subject: 'Adress change w41',
    content: 'hallo hallo'
  }

Keywords

FAQs

Package last updated on 15 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc