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
-
.header([header]) ⇒
-
~Menu(index, template, data)
-
.header([header]) ⇒
boolean
|string
-
.footer([footer]) ⇒
boolean
|string
-
.render() ⇒
Menu
-
.header([header]) ⇒
-
~Form :
object
-
.header([header]) ⇒
boolean
|string
-
.footer([footer]) ⇒
boolean
|string
-
.render() ⇒
Form
-
.header([header]) ⇒
-
~FormBody :
object
-
~FormItem :
object
-
~Menu :
object
-
.header([header]) ⇒
boolean
|string
-
.footer([footer]) ⇒
boolean
|string
-
.render() ⇒
Menu
-
.header([header]) ⇒
-
~MenuItem :
object
-
~Service
Kind: inner class of onem-nodejs-api
-
~Service
- new Service(serviceName)
-
.addForm(template, data) ⇒
object
-
.addMenu(template, data) ⇒
object
Instantiates a new Service with given name and optional verbs list
Param | Type | Description |
---|---|---|
serviceName | string |
name of the service |
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 |
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 |
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
-
.header([header]) ⇒
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 |
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 |
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
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
-
.header([header]) ⇒
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 |
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 |
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
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
-
.header([header]) ⇒
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 |
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 |
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
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 |
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 |
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
-
.header([header]) ⇒
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 |
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 |
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
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 |