Members
config
Properties| Type | Description |
|---|---|
| TConfig | Configuration object |
configDev
Properties| Type | Description |
|---|---|
| TConfigDev | Development configuration object |
configProd
Properties| Type | Description |
|---|---|
| TConfigProd | Production configuration object |
htmlTags :Array.<string>
All supported HTML tags
- Array.<string>
iconsetMappings :Object
Iconset mappings
- Object
Methods
(async) _addRoutes(options) → {Promise.<void>}
Add routes to the application.
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The options for adding routes Properties
|
- Type:
- Promise.<void>
(async) _applyFormat(options) → {Promise.<string>}
Apply formatting to the given text based on the options.
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The options for formatting Properties
|
- The formatted text
- Type:
- Promise.<string>
(async) _buildRoute(options) → {Promise.<void>}
Build routes based on the provided options.
| Name | Type | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The options for building routes Properties
|
- Type:
- Promise.<void>
(async) _buildRoutes(prefix) → {Promise.<void>}
Build routes for the application.
| Name | Type | Description |
|---|---|---|
prefix | string | The route prefix |
- Type:
- Promise.<void>
_decorate()
Decorate the request and reply objects with additional properties and methods.
(async) _handleError(err, req, reply) → {Promise.<string>}
Handle general errors.
| Name | Type | Description |
|---|---|---|
err | Error | The error object |
req | Object | The request object |
reply | Object | The reply object |
- The rendered view
- Type:
- Promise.<string>
(async) _handleNotFound(err, req, reply) → {Promise.<string>}
Handle not found errors.
| Name | Type | Description |
|---|---|---|
err | Error | The error object |
req | Object | The request object |
reply | Object | The reply object |
- The rendered view
- Type:
- Promise.<string>
(async) _handleSession() → {Promise.<void>}
Handle session setup.
- Type:
- Promise.<void>
(async) _handleSubApp() → {Promise.<void>}
Handle sub-applications.
- Type:
- Promise.<void>
(async) _loadResource(mod, item) → {Promise.<Array>}
Load resources for the given module and item.
| Name | Type | Description |
|---|---|---|
mod | Object | The module object |
item | string | The item key to load resources for |
- The loaded resources
- Type:
- Promise.<Array>
(async) _trashOldSession() → {Promise.<void>}
Trash old sessions.
- Type:
- Promise.<void>
buildUrl(optionsopt) → {string}
Build a URL based on the provided options.
| Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | <optional> | {} | Options for building the URL Properties
|
- The constructed URL
- Type:
- string
getAppTitle(req) → {string}
Get the title of the application.
| Name | Type | Description |
|---|---|---|
req | Object | The request object |
- The title of the application
- Type:
- string
getIconset(name, nameOnlyopt) → {Object|string|undefined}
Get an iconset by name.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | The name of the iconset | ||
nameOnly | boolean | <optional> | false | Whether to return only the name |
- The iconset object, name, or undefined if not found
- Type:
- Object |
string | undefined
getMenuPages(menu, pathopt, subPathopt) → {Array}
Get the pages from a menu based on the path and subPath.
| Name | Type | Attributes | Description |
|---|---|---|---|
menu | Object | The menu object | |
path | string | <optional> | The path to filter the pages |
subPath | string | | <optional> | The subPath to filter the pages or a function to handle the filtering |
- The filtered pages
- Type:
- Array
getPluginTitle(name, req) → {string}
Get the title of a plugin.
| Name | Type | Description |
|---|---|---|
name | string | The name of the plugin |
req | Object | The request object |
- The title of the plugin
- Type:
- string
getResource(name) → {Object}
Get the resource information for a given name.
| Name | Type | Description |
|---|---|---|
name | string | The name of the resource |
- The resource information
- Type:
- Object
getSessionId(rawCookie, secure) → {string}
Get the session ID from the raw cookie.
| Name | Type | Description |
|---|---|---|
rawCookie | string | The raw cookie string |
secure | boolean | Whether the cookie is secure |
- The session ID
- Type:
- string
getTheme(name, nameOnlyopt) → {Object|string|undefined}
Get a theme by name.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | The name of the theme | ||
nameOnly | boolean | <optional> | false | Whether to return only the name |
- The theme object, name, or undefined if not found
- Type:
- Object |
string | undefined
getViewEngine(ext) → {Object}
Get the view engine for a given file extension.
| Name | Type | Description |
|---|---|---|
ext | string | The file extension |
- The view engine
- Type:
- Object
groupAttrs(attribsopt, keysopt, removeEmptyopt) → {Object}
Group attributes by keys.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
attribs | Object | <optional> | {} | The attributes to group |
keys | Array | | <optional> | [] | The keys to group by |
removeEmpty | boolean | <optional> | true | Whether to remove empty groups |
- The grouped attributes
- Type:
- Object
(async) init()
Initialize the plugin
jsonStringify(obj, replaceropt, spaceopt) → {string}
Custom JSON stringify function.
| Name | Type | Attributes | Description |
|---|---|---|---|
obj | any | The object to stringify | |
replacer | boolean | | <optional> | The replacer function or true for custom handling |
space | number | | <optional> | The space argument for JSON.stringify |
- The JSON string
- Type:
- string
minify(text) → {string}
Minify HTML text.
| Name | Type | Description |
|---|---|---|
text | string | The HTML text to minify |
- The minified HTML
- Type:
- string
paginationLayout(totalItems, itemsPerPageopt, currentPageopt) → {Array}
Generate pagination layout.
| Name | Type | Attributes | Description |
|---|---|---|---|
totalItems | number | | The total number of items or an object containing pagination info | |
itemsPerPage | number | <optional> | The number of items per page |
currentPage | number | <optional> | The current page number |
- The pagination layout
- Type:
- Array
parseAttribs(text, optionsopt) → {Object}
Parse attributes from a string or object.
| Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text | string | | The text or object to parse | |||||||||||||||||||||||||||
options | Object | <optional> | {} | The options for parsing Properties
|
- The parsed attributes
- Type:
- Object
(async) render(tpl, localsopt, optsopt) → {Promise.<string>}
Render a template using the appropriate view engine.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
tpl | string | The template file path | ||
locals | Object | <optional> | {} | The local variables for the template |
opts | Object | <optional> | {} | The options for rendering |
- The rendered template
- Type:
- Promise.<string>
(async) renderString(text, localsopt, optsopt) → {Promise.<string>}
Render a string using the appropriate view engine.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text | string | The string to render | ||
locals | Object | <optional> | {} | The local variables for the template |
opts | Object | <optional> | {} | The options for rendering |
- The rendered string
- Type:
- Promise.<string>
(async) renderView(options) → {Promise.<string>}
Render a view with the given options.
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The options for rendering the view Properties
|
- The rendered view
- Type:
- Promise.<string>
stringifyAttribs(obj, kebabCasedKeyopt) → {string}
Stringify attributes from an object.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
obj | Object | The object to stringify | ||
kebabCasedKey | boolean | <optional> | true | Whether to kebab-case the keys |
- The stringified attributes
- Type:
- string
stripHtmlTags(html, optionsopt) → {string}
Strip HTML tags from a string.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
html | string | The HTML string to strip | ||
options | Object | <optional> | {} | The options for stripping |
- The stripped string
- Type:
- string
urlToBreadcrumb(url, optionsopt) → {Array}
Convert a URL to a breadcrumb array.
| Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url | string | The URL to convert | |||||||||||||||||||||||||||||||||||||
options | Object | <optional> | {} | The options for conversion Properties
|
- The breadcrumb array
- Type:
- Array