npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-jivesbs-rest

v0.0.3

Published

REST API and Feed Wrapper for Jive SBS 4.5.

Downloads

5

Readme

node-jivesbs-rest

REST API and Feed Wrapper for Jive SBS 4.5. This module uses the require module, xml2js and basic auth to communicate with Jive SBS 4.5 and its REST service.

Before using this wrapper, you must enable feeds and the rest API itself in the admin console.

Using node-jivesbs-rest

$ npm install node-jivesbs-rest

With it now installed in your project:

settings =
    user      : "admin"
    pass      : "jive"
    url       : "https://jivesbs.company.com"
    strictSSL : true

JiveContainer = require 'node-jivesbs-rest'

jive = new JiveContainer(settings)

getGroups

is a prototype function of the JiveContainer class. It takes a callback (err, data), where data is the JSON results from Jive.

jive.getGroups (err, json)->
  if err
    console.log err
  else
    console.log json[id].name[0] for id of json

The data returned looks something like this. The "..." indicates a continuation:

[
  {
    ID: [ '1' ],
    objectType: [ '700' ],
    uuid: [ '' ],
    version: [ '1' ],
    contentTypesIDs: [ ... ],
    creationDate: [ '2011-05-23T09:46:20.687-05:00' ],
    description: [ 'This is a group' ],
    displayName: [ 'first-group' ],
    modificationDate: [ '2013-08-21T10:52:42.068-05:00' ],
    name: [ 'First Group' ],
    typeID: [ '0' ],
    userID: [ '2000' ]
  },
  {
    ID: [ '2' ],
    ...
  }
  ...
]

getCommunities

is a prototype function of the JiveContainer class. It takes a callback (err, json), where json is the RESTful results from Jive.

jive.getCommunities (err, json)->
  if err
    console.log err
  else
    console.log json[id].name[0] for id of json

The data returned looks something like this. The "..." indicates a continuation:

[
  {
    ID: [ '2175' ],
    objectType: [ '14' ],
    uuid: [ '' ],
    version: [ '1' ],
    availableContentTypes: [ ... ],
    contentTypes: [ ... ],
    creationDate: [ '2012-11-12T10:05:25.645-06:00' ],
    displayName: [ 'community_1' ],
    modificationDate: [ '2013-05-29T09:57:14.215-05:00' ],
    name: [ 'Community 1' ],
    communityCount: [ '0' ],
    communityDepth: [ '1' ],
    ...
  },
  {
    ID: ['10'],
    ...
  }
  ...
]

getCommunityDocuments

is a prototype function of the JiveContainer class. It takes a communityId string and a callback (err, json), where json is the RESTful results from Jive.

jive.getCommunityDocuments '1234', (err, json)->
  if err
    console.log err
  else
    console.log json[id].name[0] for id of json

The data returned looks something like this. The "..." indicates a continuation:

[
  {
    ID: [ '1207' ],
    objectType: [ '102' ],
    version: [ '1' ],
    body: [ '...' ],
    commentStatus: [ '2' ],
    containerID: [ '2222' ],
    containerType: [ '14' ],
    creationDate: [ '2010-12-06T06:08:38.401-06:00' ],
    documentID: [ 'DOC-1207' ],
    ...,
    language: [ 'en' ],
    modificationDate: [ '2010-12-06T06:13:12.523-06:00' ],
    subject: [ 'Document Subject Line' ],
    textBody: [ 'true' ],
    viewCount: [ '24' ]
  },
  {
    subject: ['Another community Document'],
    ...
  }
  ...
]

getAttachments

is a prototype function of the JiveContainer class. It takes a document ID string and a callback (err, json), where json is the RESTful results from Jive. json[x].data[0] will always contain the binary data for an existing attachment. json will be an empty set if there are no attachments for the given document Id.

jive.getAttachments '1234', (err, json)->
  if err
    console.log err
  else
    console.log json[id] for id of json

The data returned looks something like this. The "..." indicates a continuation:

[
  {
    ID: [ '4274' ],
    objectType: [ '13' ],
    uuid: [ '' ],
    version: [ '1' ],
    contentType: [ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ],
    data: [ [ 'BINARY' ] ],
    name: [ 'Attachment.docx' ]
  },
  {
    name: ['Another attachment.docx'],
    ...
  }
  ...
]

getBinaryDocuments

is a prototype function of the JiveContainer class. It takes a document ID string and a callback (err, json), where json is the RESTful results from Jive. json[x].data[0] will always contain the binary data for an existing attachment. json will be an empty set if there is no binary file for the given document Id.

jive.getBinaryDocument '1234', (err, json)->
  if err
    console.log err
  else
    console.log json.data[0]

The data returned looks something like this.

{
  ID: [ '11564' ],
  objectType: [ '110' ],
  uuid: [ '' ],
  version: [ '1' ],
  contentType: [ 'application/pdf' ],
  data: [ 'BINARY' ],
  downloadCount: [ '0' ],
  name: [ 'Document.pdf' ],
  size: [ '85315' ]
}

getGroupDocuments

is a prototype function of the JiveContainer class. It takes a groupId string and a callback (err, json), where json is the RESTful results from Jive.

jive.getGroupDocuments '1234', (err, json)->
  if err
    console.log err
  else
    console.log json[id].title[0] for id of json

The data returned looks something like this. The "..." indicates a continuation:

[
  {
    title: [ 'A Group Document' ],
    link: [ 'https://jive.server.com/docs/DOC-1624' ],
    description: [ '...' ],
    category: [ ... ],
    ...,
    pubDate: [ 'Wed, 22 Dec 2010 15:22:36 GMT' ],
    author: [ '[email protected]' ],
    guid: [ 'https://jive.server.com/docs/DOC-1624' ]
  },
  {
    title: ['Another Group Document'],
    ...
  }
  ...
]

getPersonalDocuments

is a prototype function of the JiveContainer class. It takes an account string and a callback (err, json), where json is the results from Jive's feed. Note: this uses RSS since there is no straight forward API for this. Because of the way 4.5's RSS feed works providing an invalid username will still provide results in some cases. Therefore, verify your username before running this, for consistency.

jive.getPersonalDocuments 'username', (err, json)->
  if err
    console.log err
  else
    console.log json[id].title[0] for id of json

The data returned looks something like this. The "..." indicates a continuation:

[
  {
    title: [ 'A Group Document' ],
    link: [ 'https://jive.server.com/docs/DOC-1624' ],
    description: [ '...' ],
    category: [ ... ],
    ...,
    pubDate: [ 'Wed, 22 Dec 2010 15:22:36 GMT' ],
    author: [ '[email protected]' ],
    guid: [ 'https://jive.server.com/docs/DOC-1624' ]
  },
  {
    title: ['Another Group Document'],
    ...
  }
  ...
]