1.2.0 • Published 5 years ago

onem-nodejs-api v1.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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

ParamTypeDescription
serviceNamestringname 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

ParamTypeDescription
templatestringreference to the pug template file
dataobjectform 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

ParamTypeDescription
templatestringreference to the pug template file
dataobjectmenu 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

ParamTypeDescription
indexnumberindex to the array of forms that this form instance references
templatestringfile reference of the pug template
dataobjectform 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

ParamTypeDescription
headerstringoptional 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

ParamTypeDescription
footerstringoptional 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

ParamTypeDescription
indexnumberindex to the array of menu items that this form instance references
templatestringfile reference of the pug template
dataobjectform 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

ParamTypeDescription
headerstringoptional 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

ParamTypeDescription
footerstringoptional 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

NameTypeDescription
type'form''Form'
headerstringheader value
bodyFormBodyform body object
footerstringfooter 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

ParamTypeDescription
headerstringoptional 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

ParamTypeDescription
footerstringoptional 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

NameTypeDescription
formItemsArray.FormItem
nextRoutestring
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

NameTypeDescription
descriptionstringdescription of the form item which will appear as a prompt to the user
namestringname 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

NameTypeDescription
type'menu''Menu'
headerstringheader value
bodyArray.MenuItemform body object
footerstringfooter 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

ParamTypeDescription
headerstringoptional 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

ParamTypeDescription
footerstringoptional 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

NameTypeDefaultDescription
type'option' | 'content'indicating menu option or plain content
descriptionstring
nextRoutestringFor 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'getFor menu options only. HTTP method that should be used when redirecting after successful menu option submission
1.2.0

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago