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

onem-nodejs-api

v1.2.0

Published

ONEm developer library for node

Downloads

3

Readme

onem-nodejs-api

Node.js SDK for ONEm API

onem-nodejs-api~Service

Kind: inner class of onem-nodejs-api

new Service(serviceName)

Instantiates a new Service with given name and optional verbs list

| Param | Type | Description | | --- | --- | --- | | serviceName | string | name of the service |

service.addForm(template, data) ⇒ object

Adds a new form to the service with given pug template and data object

Kind: instance method of Service
Returns: object - form object that was added

| Param | Type | Description | | --- | --- | --- | | template | string | reference to the pug template file | | data | object | form variables for injection |

service.addMenu(template, data) ⇒ object

Adds a new menu to the service with given pug template and data object

Kind: instance method of Service
Returns: object - menu object that was added

| Param | Type | Description | | --- | --- | --- | | template | string | reference to the pug template file | | data | object | menu variables for injection |

onem-nodejs-api~Form(index, template, data)

Instantiates a new Form with given name and optional verbs list

Kind: inner method of onem-nodejs-api

| Param | Type | Description | | --- | --- | --- | | index | number | index to the array of forms that this form instance references | | template | string | file reference of the pug template | | data | object | form variables for injection |

form.header([header]) ⇒ boolean | string

Getter/setter for a custom form header

Kind: instance method of Form
Returns: boolean | string - true indicating header was set or the current value of the header

| Param | Type | Description | | --- | --- | --- | | [header] | string | optional value of the header |

form.footer([footer]) ⇒ boolean | string

Getter/setter for a custom form footer

Kind: instance method of Form
Returns: boolean | string - true indicating footer was set or the current value of the footer

| Param | Type | Description | | --- | --- | --- | | [footer] | string | optional value of the footer |

form.render() ⇒ Form

Processes the pug template for this form using the Form's this.data object as input and returns a JSON object ready for sending on the ONEm connection

Kind: instance method of Form
Returns: Form - JSON object

onem-nodejs-api~Menu(index, template, data)

Instantiates a new Menu with given name and optional verbs list

Kind: inner method of onem-nodejs-api

| Param | Type | Description | | --- | --- | --- | | index | number | index to the array of menu items that this form instance references | | template | string | file reference of the pug template | | data | object | form variables for injection |

menu.header([header]) ⇒ boolean | string

Getter/setter for a custom menu header

Kind: instance method of Menu
Returns: boolean | string - true indicating header was set or the current value of the header

| Param | Type | Description | | --- | --- | --- | | [header] | string | optional value of the header |

menu.footer([footer]) ⇒ boolean | string

Getter/setter for a custom menu footer

Kind: instance method of Menu
Returns: boolean | string - true indicating footer was set or the current value of the footer

| Param | Type | Description | | --- | --- | --- | | [footer] | string | optional value of the footer |

menu.render() ⇒ Menu

Processes the pug template for this menu using the menu's this.data object as input and returns a JSON object ready for sending on the ONEm connection

Kind: instance method of Menu
Returns: Menu - JSON object

onem-nodejs-api~Form : object

Kind: inner typedef of onem-nodejs-api
Properties

| Name | Type | Description | | --- | --- | --- | | type | 'form' | 'Form' | | [header] | string | header value | | body | FormBody | form body object | | [footer] | string | footer value |

form.header([header]) ⇒ boolean | string

Getter/setter for a custom form header

Kind: instance method of Form
Returns: boolean | string - true indicating header was set or the current value of the header

| Param | Type | Description | | --- | --- | --- | | [header] | string | optional value of the header |

form.footer([footer]) ⇒ boolean | string

Getter/setter for a custom form footer

Kind: instance method of Form
Returns: boolean | string - true indicating footer was set or the current value of the footer

| Param | Type | Description | | --- | --- | --- | | [footer] | string | optional value of the footer |

form.render() ⇒ Form

Processes the pug template for this form using the Form's this.data object as input and returns a JSON object ready for sending on the ONEm connection

Kind: instance method of Form
Returns: Form - JSON object

onem-nodejs-api~FormBody : object

Kind: inner typedef of onem-nodejs-api
Properties

| Name | Type | Description | | --- | --- | --- | | formItems | Array.FormItem | | | nextRoute | string | | | method | 'get' | 'post' | 'put' | 'delete' | HTTP method that should be used when redirecting after successful form submission |

onem-nodejs-api~FormItem : object

Kind: inner typedef of onem-nodejs-api
Properties

| Name | Type | Description | | --- | --- | --- | | description | string | description of the form item which will appear as a prompt to the user | | name | string | name of the form property which will appear in the footer by default | | type | 'string' | 'number' | 'date' | used for field validation |

onem-nodejs-api~Menu : object

Kind: inner typedef of onem-nodejs-api
Properties

| Name | Type | Description | | --- | --- | --- | | type | 'menu' | 'Menu' | | [header] | string | header value | | body | Array.MenuItem | form body object | | [footer] | string | footer value |

menu.header([header]) ⇒ boolean | string

Getter/setter for a custom menu header

Kind: instance method of Menu
Returns: boolean | string - true indicating header was set or the current value of the header

| Param | Type | Description | | --- | --- | --- | | [header] | string | optional value of the header |

menu.footer([footer]) ⇒ boolean | string

Getter/setter for a custom menu footer

Kind: instance method of Menu
Returns: boolean | string - true indicating footer was set or the current value of the footer

| Param | Type | Description | | --- | --- | --- | | [footer] | string | optional value of the footer |

menu.render() ⇒ Menu

Processes the pug template for this menu using the menu's this.data object as input and returns a JSON object ready for sending on the ONEm connection

Kind: instance method of Menu
Returns: Menu - JSON object

onem-nodejs-api~MenuItem : object

Kind: inner typedef of onem-nodejs-api
Properties

| Name | Type | Default | Description | | --- | --- | --- | --- | | type | 'option' | 'content' | | indicating menu option or plain content | | description | string | | | | [nextRoute] | string | | For menu options only. Path to be used for HTTP callback (added to base path configured in app's settings in developer portal) | | [method] | 'get' | 'post' | 'put' | 'delete' | get | For menu options only. HTTP method that should be used when redirecting after successful menu option submission |