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
- new Service(serviceName)
- .addForm(template, data) ⇒ object
- .addMenu(template, data) ⇒ object
- ~Form(index, template, data)
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Form
- ~Menu(index, template, data)
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Menu
- ~Form : object
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Form
- ~FormBody : object
- ~FormItem : object
- ~Menu : object
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Menu
- ~MenuItem : object
- ~Service
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(index, template, data)
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Form
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(index, template, data)
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Menu
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 : object
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Form
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 : object
- .header([header]) ⇒ boolean | string
- .footer([footer]) ⇒ boolean | string
- .render() ⇒ Menu
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 |