Manual Reference Source

Function

Static Public Summary
public
public

GenericException(name: *, error: *, status: *, path: *)

public

async access(ctx: Object)

public

async access(ctx: Object)

public

async add_single(ctx: *)

public

async add_styles(Cite: *, mystyles: *): *

public

api_middlewares(type: string, access_type: string, opts: Object): Array<Function>

Generate API middlewares

public

Generate App middlewares

public

async apply_transducer(transducer: Object, object: Object, info: Object, final: Object): *

public

async authenticate(ctx: Object)

public

async authenticate(ctx: Object)

public

async cas_auth(ticket: string, url: string): Promise<Object>

public

async complete(object: Object, completers: Array<any>, info: Object): Promise<Object>

Given an object and an array of completers as well as extra information that may be interesting, complete the object iff the object does not exists (null or undefined)

public
public

create()

public

del(type: string): Function

public
public

denormalization(from_entity: string, from_path: string, entity_path: string, flatten: boolean, translatable: boolean, search_value: string): Function

public
public

async download(ctx: *)

public

escape_from_bibtex(str: *): *

public

escape_to_bibtex(str: *): *

public

async filter_empty_or_null_objects(result: Array<any>): Promise<Array<any>>

public
public

find_object_with_path(object: Object, path: Array<string>): any

public

* find_popvalue_with_path(object: Object, path: Array<string>, return_object: boolean, keep_null: boolean): any

public

async find_through_ldap(uid: string, config: Object): PromiseObject>

public

async find_user(info: string, field: string): PromiseObject>

public

find_value_with_path(object: Object, path: Array<string>): any

public

async flatten(path: string, info: Object): Promise<Object>

public

forge_ok_response(model: *, name: *, method: *): *

Forge a standard response when returning HTTP 200 for any request

public
public

async format(object: *, formatters: *): *

Formatting field of an object using a array of formatters

public
public

generate_del_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>)

public

generate_entity_routes(router: KoaRouter, type: string, emiddlewares: Array<Function>)

public

generate_get_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>)

public

generate_gets_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>)

public
public

generate_post_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>, action: Function, action_options: Object)

public

generate_put_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>, action: Function, action_options: Object)

public

async generate_rss_feed(ctx: Object): Promise<existentialtypeparam>

public
public
public
public

get(type: string, exists: boolean): Function

public

async get_author_info(author: Object, publication: Object): Promise<string>

public

async get_cas_info(global_config: Object): PromiseObject>

public

async get_config(env: *): *

public

async get_edition_stmt(publication: Object): Promise<string>

public

get_in_list(where: string, is: string, default_strategy: string): Function

public

async get_language_values(key: *, config: *): *

public

get_language_values_from_langs(key: *, langs: *): *

public

async get_language_values_from_langs_and_keys(keys: *, langs: *): *

public
public

async get_monogr(publication: Object): Promise<string>

public

async get_notes_stmt(publication: Object): Promise<string>

public

async get_profile_desc(publication: Object): Promise<string>

public

async get_publication_stmt(publication: Object): Promise<string>

public

async get_series_stmt(publication: Object): Promise<string>

public

async get_smtp_transport(): *

public

get_sort(sorts: *): *

public

async get_source_desc(publication: Object): Promise<string>

public

async get_title_stmt(publication: Object, tag: string): Promise<string>

public

gets(type: string): Function

public
public
public

if_exists(path: string, type: string, error_in_parent: boolean, error: Object): Function

public

initial(name_path: string, use_dash_split: boolean): *

public

async initialize_routes(): *

public

isNil(path: string, object: Object): boolean

public

is_conditioned_on(in_path: string, check: Function, out_path: string, is: Function, error: Object): Function

public

is_unique(path: string, type: string, filters: Array<Object>, error: Object): Function

public
public

is_valid_stream(stream: *): boolean

public

async key_complete(object: Object, path: string, info: Object): *

public

Generate default Koa middlewares

public

async login_auth(email: string, password: string): Promise<Object>

public
public

async map_ldap_to_pos(ldap_user: Object, config: Object): PromiseObject>

public

merge_with_concat(object: Object, sources: ...*): *

public

merge_with_replacement(object: Object, sources: ...*): Object

public

merge_with_superposition(object: Object, sources: ...*): *

public

async multi_download(ctx: *)

public

async oarray_to_array(info: any): Promise<any>

public

post(type: string): Function

public

post_middlewares(type: string, emid: Array<Function>, model: Object): *

public

post_with_action(type: string, action: Function, options: Object): Function

public

put(type: string): Function

public

put_middlewares(type: string, emid: Array<Function>, model: Object): *

public

put_with_action(type: string, action: Function, options: Object): Function

public

retrieve_single_quantity(values: *): *

public

routes(router: KoaRouter)

public

routes(router: KoaRouter)

public
public

async secret_complete(object: Object, path: string, info: Object): *

public

async send_email(publication: Object, options: Object)

public

send_email(options: *, transport: *): *

public

async send_email_through_smtp(options: *): *

public

send_email_with(from: *, to: *, subject: *, msg: *, options: *, transport: *): *

public
public

strip_xhtml_tags(str: *): *

public
public

to_array(stream: *): *

public

to_buffer(stream: *): *

public

to_object(text: *): *

public

async transform(object: Object, transformers: Array<Object>, info: Object): Promise<Object>

public
public

transform_to_aggregation(body: *, mapping: *): *

public

transform_to_search(body: *, mapping: *): *

public

transform_to_sort(body: *, mapping: *): *

public

async traverse_and_execute(object: Object, path: Array<string>, f: Function): any

public

async traverse_recreate_and_execute(object: Object, path: Array<string>, f: Function, keep_last: boolean): any

public

update()

public

upload_middlewares(type: string, dest: string, emid: Array<Function>, model: Object): *

public

async validate(ctx: Object): Promise<existentialtypeparam>

Static Private Summary
private

_return_inner_object(object: Object, copy: boolean): any

private

_test_inner_object(object: Object, key: string | number): Array<any>

private

async formatting(object: *, func: *, key: *): *

Format a given object using func.

Static Public

public FilterSchema(ref: string): Object source

Params:

NameTypeAttributeDescription
ref string

Return:

Object

public GenericException(name: *, error: *, status: *, path: *) source

import GenericException from 'PolarisOS/app/modules/exceptions/generic.js'

Params:

NameTypeAttributeDescription
name *
error *
status *
path *

public async access(ctx: Object) source

Params:

NameTypeAttributeDescription
ctx Object

public async access(ctx: Object) source

Params:

NameTypeAttributeDescription
ctx Object

public async add_single(ctx: *) source

import {add_single} from 'PolarisOS/app/modules/utils/uploads.js'

Params:

NameTypeAttributeDescription
ctx *

public async add_styles(Cite: *, mystyles: *): * source

import {add_styles} from 'PolarisOS/app/csl_styles/register.js'

Params:

NameTypeAttributeDescription
Cite *
mystyles *

Return:

*

public api_middlewares(type: string, access_type: string, opts: Object): Array<Function> source

import {api_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Generate API middlewares

Params:

NameTypeAttributeDescription
type string

type of entity

access_type string

one of c, r, u, d (for create, read, update, delete)

opts Object

extra options (notably with flag pass, to deactivate API authorization checks

Return:

Array<Function>

Array of middlewares

public app_middlewares(type: string, opts: Object): Array<Function> source

import {app_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Generate App middlewares

Params:

NameTypeAttributeDescription
type string

type of entity

opts Object

extra options:

  • extra_middlewares: array of extra middlewares to be injected before validation

Return:

Array<Function>

Array of middlewares

public async apply_transducer(transducer: Object, object: Object, info: Object, final: Object): * source

Params:

NameTypeAttributeDescription
transducer Object
object Object
info Object
final Object
  • optional
  • default: {}

Return:

*

public async authenticate(ctx: Object) source

Params:

NameTypeAttributeDescription
ctx Object

public async authenticate(ctx: Object) source

Params:

NameTypeAttributeDescription
ctx Object

public async cas_auth(ticket: string, url: string): Promise<Object> source

import {cas_auth} from 'PolarisOS/app/modules/utils/auth.js'

Params:

NameTypeAttributeDescription
ticket string
url string

Return:

Promise<Object>

public async complete(object: Object, completers: Array<any>, info: Object): Promise<Object> source

Given an object and an array of completers as well as extra information that may be interesting, complete the object iff the object does not exists (null or undefined)

Params:

NameTypeAttributeDescription
object Object

Object to complete

completers Array<any>

Array of completers

info Object
  • optional
  • default: {}

Extra information

Return:

Promise<Object>

public count(type: string): Function source

Params:

NameTypeAttributeDescription
type string

Return:

Function

public create() source

import {create} from 'PolarisOS/app/create_indices.js'

public del(type: string): Function source

Params:

NameTypeAttributeDescription
type string

Return:

Function

public del_middlewares(type: string): * source

import {del_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
type string

Return:

*

public denormalization(from_entity: string, from_path: string, entity_path: string, flatten: boolean, translatable: boolean, search_value: string): Function source

Params:

NameTypeAttributeDescription
from_entity string
from_path string
entity_path string
flatten boolean
translatable boolean
search_value string
  • optional
  • default: undefined

Return:

Function

public do_standard_checks(user: Object): boolean source

Params:

NameTypeAttributeDescription
user Object

Return:

boolean

public async download(ctx: *) source

Params:

NameTypeAttributeDescription
ctx *

public escape_from_bibtex(str: *): * source

import {escape_from_bibtex} from 'PolarisOS/app/modules/utils/bibtex.js'

Params:

NameTypeAttributeDescription
str *

Return:

*

public escape_to_bibtex(str: *): * source

import {escape_to_bibtex} from 'PolarisOS/app/modules/utils/bibtex.js'

Params:

NameTypeAttributeDescription
str *

Return:

*

public async filter_empty_or_null_objects(result: Array<any>): Promise<Array<any>> source

import {filter_empty_or_null_objects} from 'PolarisOS/app/modules/pipeline/formatter/formatfunctions/index.js'

Params:

NameTypeAttributeDescription
result Array<any>

Return:

Promise<Array<any>>

public filter_empty_or_null_objects(array: Array<any>): Array<any> source

import {filter_empty_or_null_objects} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
array Array<any>

Return:

Array<any>

public find_object_with_path(object: Object, path: Array<string>): any source

import {find_object_with_path} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
  • nullable: true
path Array<string>

Return:

any

public * find_popvalue_with_path(object: Object, path: Array<string>, return_object: boolean, keep_null: boolean): any source

import {find_popvalue_with_path} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
  • nullable: true
path Array<string>
return_object boolean
  • optional
  • default: undefined
keep_null boolean
  • optional
  • default: undefined

Return:

any

public async find_through_ldap(uid: string, config: Object): PromiseObject> source

Params:

NameTypeAttributeDescription
uid string
config Object

Return:

PromiseObject>

public async find_user(info: string, field: string): PromiseObject> source

Params:

NameTypeAttributeDescription
info string
field string
  • optional
  • default: emails.email

Return:

PromiseObject>

public find_value_with_path(object: Object, path: Array<string>): any source

import {find_value_with_path} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
  • nullable: true
path Array<string>

Return:

any

public async flatten(path: string, info: Object): Promise<Object> source

Params:

NameTypeAttributeDescription
path string
info Object

Return:

Promise<Object>

public forge_ok_response(model: *, name: *, method: *): * source

import {forge_ok_response} from 'PolarisOS/app/modules/utils/web.js'

Forge a standard response when returning HTTP 200 for any request

Params:

NameTypeAttributeDescription
model *

Model of an entity with access to CRUD messages

name *

Name of the entity

method *

HTTP method (POST, PUT, GET, DELETE)

Return:

*

JSON

public forge_whitelist_blacklist_query(lists: Object): Object source

import {forge_whitelist_blacklist_query} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
lists Object

Return:

Object

public async format(object: *, formatters: *): * source

Formatting field of an object using a array of formatters

Params:

NameTypeAttributeDescription
object *

Object to format

formatters *

: Array of formatters

Return:

*

formatted object

public format_string(format: String): Function source

Params:

NameTypeAttributeDescription
format String

Return:

Function

public generate_del_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>) source

import {generate_del_routes} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
router KoaRouter
prefix string
type string
emiddlewares Array<Function>

public generate_entity_routes(router: KoaRouter, type: string, emiddlewares: Array<Function>) source

import {generate_entity_routes} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
router KoaRouter
type string
emiddlewares Array<Function>

public generate_get_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>) source

import {generate_get_routes} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
router KoaRouter
prefix string
type string
emiddlewares Array<Function>

public generate_gets_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>) source

import {generate_gets_routes} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
router KoaRouter
prefix string
type string
emiddlewares Array<Function>

public generate_key(login: string): string source

import {generate_key} from 'PolarisOS/app/modules/utils/crypto.js'

Params:

NameTypeAttributeDescription
login string
  • optional
  • default: undefined

Return:

string

public generate_post_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>, action: Function, action_options: Object) source

import {generate_post_routes} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
router KoaRouter
prefix string
type string
emiddlewares Array<Function>
action Function
  • optional
  • default: undefined
action_options Object
  • optional
  • default: {}

public generate_put_routes(router: KoaRouter, prefix: string, type: string, emiddlewares: Array<Function>, action: Function, action_options: Object) source

import {generate_put_routes} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
router KoaRouter
prefix string
type string
emiddlewares Array<Function>
action Function
  • optional
  • default: undefined
action_options Object
  • optional
  • default: {}

public async generate_rss_feed(ctx: Object): Promise<existentialtypeparam> source

import {generate_rss_feed} from 'PolarisOS/app/modules/3rdparty/rss/controllers.js'

Params:

NameTypeAttributeDescription
ctx Object

Return:

Promise<existentialtypeparam>

public generate_secret(): string source

import {generate_secret} from 'PolarisOS/app/modules/utils/crypto.js'

Return:

string

public generic_complete(template: string): Function source

Params:

NameTypeAttributeDescription
template string

Return:

Function

public generic_formatter(template: string): Function source

Params:

NameTypeAttributeDescription
template string

Return:

Function

public get(type: string, exists: boolean): Function source

Params:

NameTypeAttributeDescription
type string
exists boolean
  • optional
  • default: undefined

Return:

Function

public async get_author_info(author: Object, publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
author Object
publication Object

Return:

Promise<string>

public async get_cas_info(global_config: Object): PromiseObject> source

import {get_cas_info} from 'PolarisOS/app/modules/utils/auth.js'

Params:

NameTypeAttributeDescription
global_config Object

Return:

PromiseObject>

public async get_config(env: *): * source

import {get_config} from 'PolarisOS/app/modules/utils/lang.js'

Params:

NameTypeAttributeDescription
env *

Return:

*

public async get_edition_stmt(publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public get_in_list(where: string, is: string, default_strategy: string): Function source

Params:

NameTypeAttributeDescription
where string
is string
default_strategy string
  • optional
  • default: first

Return:

Function

public async get_language_values(key: *, config: *): * source

import {get_language_values} from 'PolarisOS/app/modules/utils/lang.js'

Params:

NameTypeAttributeDescription
key *
config *

Return:

*

public get_language_values_from_langs(key: *, langs: *): * source

import {get_language_values_from_langs} from 'PolarisOS/app/modules/utils/lang.js'

Params:

NameTypeAttributeDescription
key *
langs *

Return:

*

public async get_language_values_from_langs_and_keys(keys: *, langs: *): * source

import {get_language_values_from_langs_and_keys} from 'PolarisOS/app/modules/utils/lang.js'

Params:

NameTypeAttributeDescription
keys *
langs *

Return:

*

public get_middlewares(type: string): * source

import {get_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
type string

Return:

*

public async get_monogr(publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public async get_notes_stmt(publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public async get_profile_desc(publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public async get_publication_stmt(publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public async get_series_stmt(publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public async get_smtp_transport(): * source

import {get_smtp_transport} from 'PolarisOS/app/modules/utils/mailer.js'

Return:

*

public get_sort(sorts: *): * source

Params:

NameTypeAttributeDescription
sorts *

Return:

*

public async get_source_desc(publication: Object): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public async get_title_stmt(publication: Object, tag: string): Promise<string> source

Params:

NameTypeAttributeDescription
publication Object
tag string
  • optional
  • default: titleStmt

Return:

Promise<string>

public gets(type: string): Function source

Params:

NameTypeAttributeDescription
type string

Return:

Function

public hasProperty(obj: Object, key: string | number): boolean source

import {hasProperty} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
obj Object
key string | number

Return:

boolean

public identity(flatten: boolean): Function source

Params:

NameTypeAttributeDescription
flatten boolean
  • optional
  • default: undefined

Return:

Function

public if_exists(path: string, type: string, error_in_parent: boolean, error: Object): Function source

Params:

NameTypeAttributeDescription
path string
type string
error_in_parent boolean
  • optional
  • default: undefined
error Object
  • nullable: true

Return:

Function

public initial(name_path: string, use_dash_split: boolean): * source

Params:

NameTypeAttributeDescription
name_path string
use_dash_split boolean
  • optional
  • default: true

Return:

*

public async initialize_routes(): * source

import initialize_routes from 'PolarisOS/app/initializations/routes.js'

Return:

*

public isNil(path: string, object: Object): boolean source

Params:

NameTypeAttributeDescription
path string
object Object
  • nullable: true

Return:

boolean

public is_conditioned_on(in_path: string, check: Function, out_path: string, is: Function, error: Object): Function source

Params:

NameTypeAttributeDescription
in_path string
check Function
out_path string
is Function
error Object
  • nullable: true

Return:

Function

public is_unique(path: string, type: string, filters: Array<Object>, error: Object): Function source

Params:

NameTypeAttributeDescription
path string
type string
filters Array<Object>
  • optional
  • default: undefined
error Object
  • nullable: true

Return:

Function

public is_valid_json(path: string, error: Object): Function source

Params:

NameTypeAttributeDescription
path string
error Object
  • nullable: true

Return:

Function

public is_valid_stream(stream: *): boolean source

import {is_valid_stream} from 'PolarisOS/app/modules/utils/streams.js'

Params:

NameTypeAttributeDescription
stream *

Return:

boolean

public async key_complete(object: Object, path: string, info: Object): * source

Params:

NameTypeAttributeDescription
object Object
path string
info Object
  • optional
  • default: {}

Return:

*

public koa_middlewares(opts: Object): Array<Function> source

import {koa_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Generate default Koa middlewares

Params:

NameTypeAttributeDescription
opts Object

Extra options:

  • koa_body: object to pass to KoaBody middleware

Return:

Array<Function>

Array of middlewares

public async login_auth(email: string, password: string): Promise<Object> source

import {login_auth} from 'PolarisOS/app/modules/utils/auth.js'

Params:

NameTypeAttributeDescription
email string
password string

Return:

Promise<Object>

public make_nested_object_from_path(path: Array<string>, value: any, obj: Object): Object source

import {make_nested_object_from_path} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
path Array<string>
value any
obj Object
  • optional
  • default: {}

Return:

Object

public async map_ldap_to_pos(ldap_user: Object, config: Object): PromiseObject> source

Params:

NameTypeAttributeDescription
ldap_user Object
config Object

Return:

PromiseObject>

public merge_with_concat(object: Object, sources: ...*): * source

import {merge_with_concat} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
sources ...*

Return:

*

public merge_with_replacement(object: Object, sources: ...*): Object source

import {merge_with_replacement} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
sources ...*

Return:

Object

public merge_with_superposition(object: Object, sources: ...*): * source

import {merge_with_superposition} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
sources ...*

Return:

*

public async multi_download(ctx: *) source

import {multi_download} from 'PolarisOS/app/modules/utils/uploads.js'

Params:

NameTypeAttributeDescription
ctx *

public async oarray_to_array(info: any): Promise<any> source

Params:

NameTypeAttributeDescription
info any

Return:

Promise<any>

public post(type: string): Function source

Params:

NameTypeAttributeDescription
type string

Return:

Function

public post_middlewares(type: string, emid: Array<Function>, model: Object): * source

import {post_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
type string
emid Array<Function>
model Object
  • nullable: true

Return:

*

public post_with_action(type: string, action: Function, options: Object): Function source

Params:

NameTypeAttributeDescription
type string
action Function
options Object

Return:

Function

public put(type: string): Function source

Params:

NameTypeAttributeDescription
type string

Return:

Function

public put_middlewares(type: string, emid: Array<Function>, model: Object): * source

import {put_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
type string
emid Array<Function>
model Object
  • nullable: true

Return:

*

public put_with_action(type: string, action: Function, options: Object): Function source

Params:

NameTypeAttributeDescription
type string
action Function
options Object

Return:

Function

public retrieve_single_quantity(values: *): * source

Params:

NameTypeAttributeDescription
values *

Return:

*

public routes(router: KoaRouter) source

Params:

NameTypeAttributeDescription
router KoaRouter

public routes(router: KoaRouter) source

Params:

NameTypeAttributeDescription
router KoaRouter

Params:

NameTypeAttributeDescription
type string

Return:

Function

public async secret_complete(object: Object, path: string, info: Object): * source

Params:

NameTypeAttributeDescription
object Object
path string
info Object
  • optional
  • default: {}

Return:

*

public async send_email(publication: Object, options: Object) source

Params:

NameTypeAttributeDescription
publication Object
options Object

public send_email(options: *, transport: *): * source

import {send_email} from 'PolarisOS/app/modules/utils/mailer.js'

Params:

NameTypeAttributeDescription
options *
transport *
  • optional
  • default: smtp

Return:

*

public async send_email_through_smtp(options: *): * source

Params:

NameTypeAttributeDescription
options *

Return:

*

public send_email_with(from: *, to: *, subject: *, msg: *, options: *, transport: *): * source

import {send_email_with} from 'PolarisOS/app/modules/utils/mailer.js'

Params:

NameTypeAttributeDescription
from *
to *
subject *
msg *
options *
  • optional
  • default: {}
transport *
  • optional
  • default: smtp

Return:

*

public set_default_lang_for_array(flang: string, iflang: string): Function source

Params:

NameTypeAttributeDescription
flang string
iflang string

Return:

Function

public strip_xhtml_tags(str: *): * source

import {strip_xhtml_tags} from 'PolarisOS/app/modules/utils/xml.js'

Params:

NameTypeAttributeDescription
str *

Return:

*

public template_identity(tpl: string, flatten: boolean): Function source

Params:

NameTypeAttributeDescription
tpl string
flatten boolean
  • optional
  • default: undefined

Return:

Function

public to_array(stream: *): * source

Params:

NameTypeAttributeDescription
stream *

Return:

*

public to_buffer(stream: *): * source

import {to_buffer} from 'PolarisOS/app/modules/utils/streams.js'

Params:

NameTypeAttributeDescription
stream *

Return:

*

public to_object(text: *): * source

import {to_object} from 'PolarisOS/app/modules/utils/xml.js'

Params:

NameTypeAttributeDescription
text *

Return:

*

public async transform(object: Object, transformers: Array<Object>, info: Object): Promise<Object> source

Params:

NameTypeAttributeDescription
object Object
transformers Array<Object>
info Object
  • optional
  • default: {}

Return:

Promise<Object>

public async transform_publication_to_hal(publication: Object): Promise<string> source

import {transform_publication_to_hal} from 'PolarisOS/app/modules/entities/exporter/controllers/hal.js'

Params:

NameTypeAttributeDescription
publication Object

Return:

Promise<string>

public transform_to_aggregation(body: *, mapping: *): * source

import {transform_to_aggregation} from 'PolarisOS/app/modules/entities/crud/mapper.js'

Params:

NameTypeAttributeDescription
body *
mapping *

Return:

*
import {transform_to_search} from 'PolarisOS/app/modules/entities/crud/mapper.js'

Params:

NameTypeAttributeDescription
body *
mapping *

Return:

*

public transform_to_sort(body: *, mapping: *): * source

import {transform_to_sort} from 'PolarisOS/app/modules/entities/crud/mapper.js'

Params:

NameTypeAttributeDescription
body *
mapping *

Return:

*

public async traverse_and_execute(object: Object, path: Array<string>, f: Function): any source

import {traverse_and_execute} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
path Array<string>
f Function

Return:

any

public async traverse_recreate_and_execute(object: Object, path: Array<string>, f: Function, keep_last: boolean): any source

import {traverse_recreate_and_execute} from 'PolarisOS/app/modules/utils/utils.js'

Params:

NameTypeAttributeDescription
object Object
path Array<string>
f Function
keep_last boolean
  • optional
  • default: true

Return:

any

public update() source

import {update} from 'PolarisOS/app/create_indices.js'

public upload_middlewares(type: string, dest: string, emid: Array<Function>, model: Object): * source

import {upload_middlewares} from 'PolarisOS/app/modules/utils/router.js'

Params:

NameTypeAttributeDescription
type string
dest string
emid Array<Function>
model Object
  • nullable: true

Return:

*

public async validate(ctx: Object): Promise<existentialtypeparam> source

Params:

NameTypeAttributeDescription
ctx Object

Return:

Promise<existentialtypeparam>

Static Private

private _return_inner_object(object: Object, copy: boolean): any source

Params:

NameTypeAttributeDescription
object Object
  • nullable: true
copy boolean
  • optional
  • default: true

Return:

any

private _test_inner_object(object: Object, key: string | number): Array<any> source

Params:

NameTypeAttributeDescription
object Object
  • nullable: true
key string | number

Return:

Array<any>

private async formatting(object: *, func: *, key: *): * source

Format a given object using func.

Params:

NameTypeAttributeDescription
object *

Object to format

func *

Formatting function

key *

Path to access the field in object

Return:

*