Other
ActionName
AppEvents
AppEvents: "starting" | "started" | "stopping" | "stopped"
AssignAttachmentsResult
AttachmentParams
Button
Button: { href: string; text: string }
Type declaration
-
href: string
-
text: string
CallbackParams
Callback
Params: { app: App; base_url: string; dontClearDatabaseOnStop: () => void; mail_api: { getMessageById: (id: number) => Promise<string>; getMessages: () => Promise<{ id: number; recipients: string[]; sender: string; subject: string }[]> }; rest_api: MockRestApi; smtp_api_url: string }
Type declaration
-
-
base_url: string
-
dontClearDatabaseOnStop: () => void
-
mail_api: { getMessageById: (id: number) => Promise<string>; getMessages: () => Promise<{ id: number; recipients: string[]; sender: string; subject: string }[]> }
-
getMessageById: (id: number) => Promise<string>
-
- (id: number): Promise<string>
-
Parameters
Returns Promise<string>
-
getMessages: () => Promise<{ id: number; recipients: string[]; sender: string; subject: string }[]>
-
- (): Promise<{ id: number; recipients: string[]; sender: string; subject: string }[]>
-
Returns Promise<{ id: number; recipients: string[]; sender: string; subject: string }[]>
-
-
smtp_api_url: string
CollectionDefinition
Collection
Definition: { calculated_fields?: undefined | {}; display_hints?: undefined | {}; fields: FieldDefinition<any>[]; human_readable_name?: undefined | string; name: string; named_filters?: undefined | {}; policy?: Partial<{}>; summary?: undefined | string }
Type declaration
-
Optional calculated_fields?: undefined | {}
-
Optional display_hints?: undefined | {}
-
-
Optional human_readable_name?: undefined | string
-
name: string
-
Optional named_filters?: undefined | {}
-
Optional policy?: Partial<{}>
-
Optional summary?: undefined | string
ComparatorObject
ComparatorObject<T>: {}
Type parameters
Config
Config
: { accout_creation_success_path
: false | string; app
: { version
: string }; core
: { environment
: Environment }; datastore_mongo
: { db_name
: string; host
: string; password
: string; port
: number }; email
: { from_address
: string; from_name
: string }; image_formats
: {}; logger
: { level
: "info" | "error" | "debug" | "emerg" }; password_hash
: { iterations
: number; key_length
: number; salt_length
: number }; roles
: string[]; smtp
: { host
: string; password
: string; port
: number; user
: string }; upload_path
: string; www-server
: { anonymous-cookie-name
: string; api-base
: string; max-payload-bytes
: number; port
: number; session-cookie-name
: string } }
Type declaration
-
accout_creation_success_path: false | string
-
app: { version: string }
-
core: { environment: Environment }
-
datastore_mongo: { db_name: string; host: string; password: string; port: number }
-
db_name: string
-
host: string
-
password: string
-
port: number
-
email: { from_address: string; from_name: string }
-
from_address: string
-
from_name: string
-
image_formats: {}
-
logger: { level: "info" | "error" | "debug" | "emerg" }
-
level: "info" | "error" | "debug" | "emerg"
-
password_hash: { iterations: number; key_length: number; salt_length: number }
-
iterations: number
-
key_length: number
-
salt_length: number
-
roles: string[]
-
smtp: { host: string; password: string; port: number; user: string }
-
host: string
-
password: string
-
port: number
-
user: string
-
upload_path: string
-
www-server: { anonymous-cookie-name: string; api-base: string; max-payload-bytes: number; port: number; session-cookie-name: string }
-
anonymous-cookie-name: string
-
api-base: string
-
max-payload-bytes: number
-
port: number
-
session-cookie-name: string
ConfigObject
ConfigObject: {}
CreateActionName
CreateActionName: "create"
DBComparator
DBComparator: "$gt" | "$gte" | "$lt" | "$lte" | "$eq"
DeleteActionName
DeleteActionName: "delete"
Depromisify
Depromisify<T>: T extends Promise<infer V> ? V : T
Type parameters
DerivingFn
Type parameters
Document
Document: { id: string }
Type declaration
-
[key: string]: any
-
id: string
EditActionName
EditActionName: "edit"
Environment
Environment: "dev" | "production"
ErrorParams
ErrorParams: { data: any; is_developer_fault: boolean; is_user_fault: boolean; type: string }
Type declaration
-
data: any
-
is_developer_fault: boolean
-
is_user_fault: boolean
-
type: string
EventDescriptionProps
Event
DescriptionProps: { action: ActionName; metadata: { context: Context; params: any }; subject_path?: undefined | string; when: When }
Type declaration
-
-
metadata: { context: Context; params: any }
-
Optional subject_path?: undefined | string
-
ExtractFormatParams
ExtractFormatParams<F>: F extends Field<any, infer T> ? T : never
Type parameters
ExtractInput
ExtractInput<F>: Parameters<F["encode"]>[1]
Type parameters
ExtractOutput
Type parameters
ExtractParams
ExtractParams<F>: Parameters<F["setParams"]>[0]
Type parameters
ExtractStorage
Type parameters
FieldClass
FieldClass<T>: {}
Type parameters
FieldDefinition
Field
Definition<ParamsType>: { display_hints?: any; name: string; params?: ParamsType; required?: undefined | false | true; type: FieldClass }
Type parameters
Type declaration
-
Optional display_hints?: any
-
name: string
-
-
Optional required?: undefined | false | true
-
FileDBEntry
FileDBEntry: { filename: string; id: string }
Type declaration
-
filename: string
-
id: string
FileFormat
FileFormat: "internal" | "url"
FileOutput
File
Output: string | File
FileStorageFormat
FormatObject
FormatObject: { size: number[] }
GetValue
Get
Value<T>: (context: Context, resource_id: string) => Promise<Parameters<T["encode"]>[1]>
Type parameters
Type declaration
-
- (context: Context, resource_id: string): Promise<Parameters<T["encode"]>[1]>
-
Parameters
Returns Promise<Parameters<T["encode"]>[1]>
Getter
Getter<ReturnType>
: (contect
: Context, item
: Item, db_document
: any) => Promise<ReturnType>
Type parameters
Type declaration
-
- (contect: Context, item: Item, db_document: any): Promise<ReturnType>
-
Parameters
Returns Promise<ReturnType>
HookProps
Hook
Props: { callback: Function; event_matcher: EventMatcher; is_blocking: boolean }
Type declaration
-
callback: Function
-
-
is_blocking: boolean
HttpMethod
HttpMethod: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"
HumanComparator
HumanComparator: ">" | "from" | "gt" | "gte" | ">=" | "=>" | "<" | "to" | "lt" | "lte" | "<=" | "=<" | "="
HybridFieldParams
Type parameters
ImageOutput
InputType
InputType: boolean | "false" | "true" | "1" | "0" | 1 | 0
IntStorageParams
IntStorageParams: { max?: undefined | number; min?: undefined | number }
Type declaration
-
Optional max?: undefined | number
-
Optional min?: undefined | number
LookupBody
LookupBody: { as?: undefined | string; foreignField: string; from: string; localField: string; unwind?: undefined | false | true }
Type declaration
-
Optional as?: undefined | string
-
foreignField: string
-
from: string
-
localField: string
-
Optional unwind?: undefined | false | true
LooseObject
LooseObject: {}
MapReduceParams
Type parameters
-
ReturnType
-
IntermediateValue
Type declaration
-
map: (items: Item[]) => IntermediateValue[]
-
- (items: Item[]): IntermediateValue[]
-
Parameters
Returns IntermediateValue[]
-
reduce: [(intermediate: IntermediateValue[]) => ReturnType, any]
-
MatcherParams
MessageData
MessageData: { attachments: any[]; html: string; subject: string; text: string; to: string }
Type declaration
-
attachments: any[]
-
html: string
-
subject: string
-
text: string
-
to: string
MockRestApi
Mock
RestApi: { delete: Function; get: Function; getSealiousResponse: (url: string, body?: undefined | {}) => Promise<SealiousResponse>; login: Function; patch: Function; post: Function }
Type declaration
-
delete: Function
-
get: Function
-
getSealiousResponse: (url: string, body?: undefined | {}) => Promise<SealiousResponse>
-
-
Parameters
-
url: string
-
Optional body: undefined | {}
-
login: Function
-
patch: Function
-
post: Function
NextNodeCandidate
NextNodeCandidate: { index: number | null; mean_priority_of_succcessors: number; priority: number }
Type declaration
-
index: number | null
-
mean_priority_of_succcessors: number
-
priority: number
Node
Node
: { id
: NodeID; priority
: number }
NodeID
NodeID: string | number
OutputOptions
OutputOptions: { amount?: undefined | number; skip?: undefined | number; sort?: any }
Type declaration
-
Optional amount?: undefined | number
-
Optional skip?: undefined | number
-
Optional sort?: any
ParamGetter
Param
Getter<T>: (context: Context, item: Item) => Promise<T> | T
Type parameters
Type declaration
-
-
Parameters
Returns Promise<T> | T
ParamOrGetter
Type parameters
Params
Params<T>
: { target_policies
: {}; value_when_not_allowed
: ExtractOutput<T> }
Type parameters
PartialConfig
PolicyClass
PolicyClass: { constructor: any; type_name: string }
Type declaration
-
constructor: function
- new __type(params: any): Policy
-
Parameters
-
type_name: string
PolicyDecision
PolicyDecision: { allowed: boolean; reason: string } | null
PolicyDefinition
Props
Props<S>: { values: S[] | (() => S[]) }
Type parameters
Type declaration
-
values: S[] | (() => S[])
QueryStage
Query
Stage: Partial<{ $and: QueryStage[]; $group: { _id: string }; $lookup: any; $match: any; $nor: any; $not: QueryStage; $or: QueryStage[]; $search: any; $unwind: any }>
RecursivePartial
RecursivePartial<T>: {}
Type parameters
ReferenceToCollectionConstructorParams
Reference
ToCollectionConstructorParams: { attachments_query: object; collection_name: string; documents: Array<Document> }
Type declaration
-
attachments_query: object
-
collection_name: string
-
documents: Array<Document>
RefreshCondition
Type declaration
-
-
resource_id_getter: (emitted_event: EventDescription, response: any) => Promise<string>
-
-
Parameters
Returns Promise<string>
ReplaceActionName
ReplaceActionName: "replace"
ShowActionName
ShowActionName: "show"
SimpleTemplateData
Simple
TemplateData: { buttons?: Button[]; subject: string; text: string; to: string }
Type declaration
-
Optional buttons?: Button[]
-
subject: string
-
text: string
-
to: string
StagesGetter
Stages
Getter: (context: Context, item: Item, db_document: any) => Queries.QueryStage[]
Type declaration
-
- (context: Context, item: Item, db_document: any): Queries.QueryStage[]
-
Parameters
Returns Queries.QueryStage[]
SubjectPathEquiv
TestCallback
Type declaration
-
-
Parameters
Returns Promise<any>
TextFormatParam
TextParams
TextParams: Partial<{ full_text_search: boolean; max_length: number; min_length: number }>
TextStorageFormat
TextStorageFormat: { original: string; safe: string }
Type declaration
-
original: string
-
safe: string
TimeUnit
TimeUnit: "h" | "m" | "s" | "ms"
TryToLoginParams
TryToLoginParams: { password: string; username: string }
Type declaration
-
password: string
-
username: string
ValidationResult
ValidationResult: { reason?: undefined | string; valid: boolean }
Type declaration
-
Optional reason?: undefined | string
-
valid: boolean
When
When: "before" | "after"
values
values<T>: {}
Type parameters
Const ActionResultCache
ActionResultCache: WeakMap<object, any> = new WeakMap()
Const COLLECTION_NAME
COLLECTION_NAME: "_metadata" = "_metadata"
Const DAY
DAY: number = 1000 * 60 * 60 * 24
Const ID_INDEX
ID_INDEX: 2 = 2
Const MIN_LENGTH
MIN_LENGTH: 8 = 8
Const ONE_DAY
ONE_DAY: number = 24 * 60 * 60 * 1000
Const QUALITY
QUALITY: 80 = 80
Const algorithm
algorithm: "sha512" = "sha512"
Const child_subjects_generators
Let css
css: string
Const dateFormats
dateFormats: string[] = Object.keys(dateFormatters)
Const default_config
default_config: any = locreq("default_config.json")
Const email
email: RegExp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
Const locreq
locreq: any = require("locreq")(__dirname)
Const pbkdf2
pbkdf2: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult> = promisify(crypto.pbkdf2)
Type declaration
-
- (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): Promise<TResult>
-
Parameters
-
arg1: T1
-
arg2: T2
-
arg3: T3
-
arg4: T4
-
arg5: T5
Returns Promise<TResult>
Const prop_regex
prop_regex: RegExp = /^[a-z0-9_]/
Const readFile
readFile: __promisify__ = promisify(fs.readFile)
Const timeFormats
timeFormats: string[] = Object.keys(timeFormatters)
Const uuid
uuid: any = require("node-uuid").v4
AssignAttachments
-
Parameters
PasswordResetTemplate
- PasswordResetTemplate(app: App, __namedParameters: { email_address: string; token: string }): Promise<Message>
-
Parameters
-
-
__namedParameters: { email_address: string; token: string }
-
email_address: string
-
token: string
Returns Promise<Message>
RegistrationIntentTemplate
- RegistrationIntentTemplate(app: App, __namedParameters: { email_address: string; token: string }): Promise<Message>
-
Parameters
-
-
__namedParameters: { email_address: string; token: string }
-
email_address: string
-
token: string
Returns Promise<Message>
SimpleTemplate
-
Parameters
Returns Promise<Message>
add_parent_prefix
- add_parent_prefix(group: QueryStage, parent_property: string): {}
-
Parameters
Returns {}
add_parent_prefix_to_pipeline
- add_parent_prefix_to_pipeline(pipeline: QueryStage[], parent_property: string): void
-
Parameters
Returns void
assertThrowsAsync
- assertThrowsAsync(fn: () => Promise<any>, error_handler: (e: any) => Promise<any> | any): Promise<void>
-
Parameters
-
fn: () => Promise<any>
-
error_handler: (e: any) => Promise<any> | any
-
- (e: any): Promise<any> | any
-
Parameters
Returns Promise<any> | any
Returns Promise<void>
buttons_to_text
- buttons_to_text(buttons: Button[]): string
-
Parameters
Returns string
create_anonymous_session
- create_anonymous_session(app: App): Promise<any>
-
Parameters
Returns Promise<any>
dateStrToDayInt
- dateStrToDayInt(date_str: string): number
-
Parameters
Returns number
default
- default(app: App, context: Context, h: any): (Anonymous function)
-
Parameters
Returns (Anonymous function)
error_to_boom
-
Parameters
Returns Boom<any>
extract_context
- extract_context(app: App, request: any): Promise<Context>
-
Parameters
Returns Promise<Context>
flatten
- flatten(prefix: string, obj: {}): {}
-
Parameters
Returns {}
flattenObjectToDotNotation
- flattenObjectToDotNotation(context: string | null, obj: {}): {}
-
Parameters
-
context: string | null
-
obj: {}
Returns {}
formatFilename
- formatFilename(original_filename: string, format_name: string): string
-
Parameters
-
original_filename: string
-
format_name: string
Returns string
formatHash
-
Parameters
Returns string
getAllKeys
- getAllKeys(obj: any): string[]
-
Parameters
Returns string[]
getDateTime
- getDateTime(date: Date, format_string?: string): string
-
Parameters
-
date: Date
-
Default value format_string: string = "yyyy-mm-dd hh:mm:ss"
Returns string
getNow
-
Returns string
Const getOutputOptions
- getOutputOptions(params: { amount?: undefined | number; count?: undefined | number; pagination?: any; skip?: undefined | number; sort?: undefined | {} }): {}
-
Parameters
-
params: { amount?: undefined | number; count?: undefined | number; pagination?: any; skip?: undefined | number; sort?: undefined | {} }
-
[x: string]: any
-
Optional amount?: undefined | number
-
Optional count?: undefined | number
-
Optional pagination?: any
-
Optional skip?: undefined | number
-
Optional sort?: undefined | {}
Returns {}
getQueryWithProperOperator
- getQueryWithProperOperator(filter: any): { $in: any[] } | { $eq: any }
-
Parameters
Returns { $in: any[] } | { $eq: any }
getRequestBody
- getRequestBody(app: App, _: Context, request: any): Promise<{}>
-
Parameters
Returns Promise<{}>
getTimeDifference
- getTimeDifference(begin: number, end: number): string
-
Parameters
-
begin: number
-
end: number
Returns string
getTimeOfNow
-
Returns string
get_anonymous_session
- get_anonymous_session(app: App, anon_session_id: string): Promise<any>
-
Parameters
Returns Promise<any>
Let get_css
- get_css(): Promise<string>
- get_css(): Promise<string>
-
Returns Promise<string>
-
Returns Promise<string>
get_html
-
Parameters
Returns string
handle_request
- handle_request(app: App, request: any, h: any): Promise<any>
-
Parameters
Returns Promise<any>
humanComparatorToQuery
-
Parameters
make
- make(attachments: {}, fieldsWithAttachments: {}, id: string | any, field_name: string): ReferenceField
-
Parameters
-
attachments: {}
-
fieldsWithAttachments: {}
-
id: string | any
-
field_name: string
negate_stage
-
Parameters
Returns {}
parsePathElements
- parsePathElements(request: any): any
-
Parameters
Returns any
process_query
- process_query(query: any): {}
-
Parameters
Returns {}
Let render_form
- render_form(app: App, token: string, email: string): Promise<string>
- render_form(app: App, __namedParameters: { email: string; token: string }): Promise<string>
-
Parameters
-
-
token: string
-
email: string
Returns Promise<string>
-
Parameters
-
-
__namedParameters: { email: string; token: string }
-
email: string
-
token: string
Returns Promise<string>
runActionCurry
- runActionCurry(app: App): runAction
-
Parameters
Returns runAction
time_units
-
Parameters
Returns string
transformObject
- transformObject(obj: LooseObject, prop_tranformer: (prop: string) => string, value_transformer: (prop: string, obj: Object) => any): {}
-
Parameters
-
-
prop_tranformer: (prop: string) => string
-
-
Parameters
Returns string
-
value_transformer: (prop: string, obj: Object) => any
-
- (prop: string, obj: Object): any
Returns {}
tryToLogin
- tryToLogin(app: App, context: Context, __namedParameters: { password: string; username: string }): Promise<NewSession>
-
Parameters
-
-
-
__namedParameters: { password: string; username: string }
-
password: string
-
username: string
validateAuthData
- validateAuthData(app: App, username: string, password: string): Promise<any>
-
Parameters
-
-
username: string
-
password: string
Returns Promise<any>
withRunningApp
-
Parameters
Returns Promise<any>
withRunningAppProd
-
Parameters
Returns Promise<any>
withStoppedApp
-
Parameters
Returns Promise<any>
withStoppedAppProd
-
Parameters
Returns Promise<void>
withTestApp
-
Parameters
-
auto_start: boolean
-
-
fn: (params: CallbackParams) => Promise<any>
-
-
Parameters
Returns Promise<any>
Returns Promise<void>
Const Collections
Collections: object
AnonymousSessions
AnonymousSessions: (Anonymous function)
FormattedImages
FormattedImages: (Anonymous function)
PasswordResetIntents
PasswordResetIntents: (Anonymous function)
RegistrationIntents
RegistrationIntents: (Anonymous function)
Sessions
Sessions: (Anonymous function)
UserRoles
UserRoles: (Anonymous function)
Users
Users: (Anonymous function)
Const SecureHasher
SecureHasher: object
generateRandomSalt
- generateRandomSalt(salt_length: number): string
-
Parameters
Returns string
hash
- hash(value_to_hash: crypto.BinaryLike, salt: crypto.BinaryLike, __namedParameters: { iterations: any; key_length: any }): Promise<string>
-
Parameters
-
value_to_hash: crypto.BinaryLike
-
salt: crypto.BinaryLike
-
__namedParameters: { iterations: any; key_length: any }
-
iterations: any
-
key_length: any
Returns Promise<string>
matches
- matches(value: crypto.BinaryLike, hash_with_params: string): Promise<boolean>
-
Parameters
-
value: crypto.BinaryLike
-
hash_with_params: string
Returns Promise<boolean>
Const dateFormatters
dateFormatters: object
yyyy-mm-dd
- yyyy-mm-dd(date: Date): string
-
Parameters
Returns string
Const environment_to_mailer
environment_to_mailer: object
dev
production
Const error_code_map
error_code_map: object
bad_subject
bad_subject: number = 404
bad_subject_action
bad_subject_action: number = 405
field_does_not_support_attachments
field_does_not_support_attachments: number = 405
invalid_credentials
invalid_credentials: number = 401
not_found
not_found: number = 404
permission
permission: number = 401
validation
validation: number = 403
value_exists
value_exists: number = 409
Const formats
formats: object
h
h: number = 3600000
m
m: number = 60000
ms
ms: number = 1
s
s: number = 1000
Const human_comparators_to_query
human_comparators_to_query: object
<
<: "$lt" = "$lt"
<=
<=: "$lte" = "$lte"
=
=: "$eq" = "$eq"
=<
=<: "$lte" = "$lte"
=>
=>: "$gte" = "$gte"
>
>: "$gt" = "$gt"
>=
>=: "$gte" = "$gte"
from
from: "$gte" = "$gte"
gt
gt: "$gt" = "$gt"
gte
gte: "$gte" = "$gte"
lt
lt: "$lt" = "$lt"
lte
lte: "$lte" = "$lte"
to
to: "$lte" = "$lte"
Const languages
languages: object
en
en: any = require("./en")
pl
pl: any = require("./pl")
Const method_map
method_map: object
DELETE
DELETE: "delete" = "delete"
GET
GET: "show" = "show"
PATCH
PATCH: "edit" = "edit"
POST
POST: "create" = "create"
PUT
PUT: "replace" = "replace"
Const sealious_to_mongo_sort_param
sealious_to_mongo_sort_param: object
asc
asc: number = 1
ascending
ascending: number = 1
desc
desc: number = -1
descending
descending: number = -1
Const squares
squares: object
set
- set(obj: any, key: string, value: any): void
-
Parameters
-
obj: any
-
key: string
-
value: any
Returns void
Const timeFormatters
timeFormatters: object
hh:mm:ss
- hh:mm:ss(parsed_time: string): string
-
Parameters
Returns string
hh:mm:ss.mmm
- hh:mm:ss.mmm(parsed_time: string): string
-
Parameters
Returns string
A function that helps to define a field for a collection. Performs type-checking to ensure that the parameters match the expected format.
This is the recommended way to define a field