Global

Members

(constant) bool

Boolean Type
Source:

(constant) calcfldViewConfig

Source:

(constant) calcfldViewOptions

Source:

(constant) check_email_mask

Check email mask
Source:

(constant) color

Color Type
Source:

(constant) configFileDir :string

Path to Config directory
Type:
Source:

(constant) configFilePath :string

Path to config file .saltcorn
Type:
Source:

(constant) configTypes

Config variables types
Source:

(constant) createTenant

Create Tenant and switch to It: - normalize domain name - create db schema - reset db schema (create required ) - change current base_url
Source:

(constant) date

Date type
Source:

(constant) db

Config Variables
Source:

(constant) db

DB Tables discovery to Saltcorn tables.
Source:

(constant) db

Field Data Access Layer
Source:

(constant) db

Source:

(constant) db

Page Data Access Layer
Source:

(constant) db

Table Database Access Layer
Source:

(constant) db

Tenant Management Data Layer Access
Source:

(constant) db

Trigger Data Access Layer
Source:

(constant) db

View Data Access Layer
Source:

(constant) defaultDataPath :string

Default data path?
Type:
Source:

(constant) deleteConfig

Delete config variable
Source:

(constant) deleteTenant

Delete Tenant Note! This is deleting all tenant data in database!
Source:

(constant) domain_sanitize

Sanitize Domain (Normalize domain name). - force to lower case - remove . in name
Source:

(constant) express

Saltcorn App
Source:

(constant) fetch

Action description
Source:

(constant) field_picker_fields

Source:

(constant) float

Float type
Source:

(constant) fs :module:fs

DB structure migration functionality
Type:
  • module:fs
Source:

(constant) get_child_views

get_child_views Contract
Source:
Source:

(constant) get_parent_views

get_parent_views Contract
Source:

(constant) getAllConfig

Get all config variables list
Source:

(constant) getAllConfigOrDefaults

Get all config variables list If variable is not defined that default value is used
Source:

(constant) getAllTenants

List all Tenants
Source:

(constant) getConfig

Get Config variable value by key (contract)
Source:

(constant) initial_config_all_fields

initial_config_all_fields Contract
Source:

(constant) int

Integer type
Source:

(constant) moment

Embedded Types definition. More types can be added by plugin store mechanism https://store.saltcorn.com/
Source:

(constant) path :path.PlatformPath|path

Controls Saltcorn configuration
Type:
  • path.PlatformPath | path
Source:

(constant) picked_fields_to_query

picked_fields_to_query Contract
Source:

(constant) remove_from_menu

Remove from menu
Source:

(constant) Router :module:express-promise-router

Auth / Admin
Type:
  • module:express-promise-router
Source:

(constant) Router

Actions (Triggers) Handler
Source:

(constant) Router :module:express-promise-router

API handler
Type:
  • module:express-promise-router
Source:

(constant) Router

Field Router
Source:

(constant) Router

List Data from Table (Router) Used in Admin ${base_url}/list Look to server/public/gridedit.js for main logic of grid editor
Source:

(constant) Router

View Edit Router
Source:

(constant) runScheduler

Serve is Saltcorn server starter
Source:

(constant) set_multitenancy_cfg

Set multitenancy cfg flag
Source:

(constant) setConfig

Set config variable value by key
Source:

(constant) sqlsanitize

Transform value to correct sql name. Note! Dont use other symbols than ^A-Za-z_0-9
Source:

(constant) sqlsanitizeAllowDots

Transform value to correct sql name. Instead of sqlsanitize also allows . For e.g. table name Note! Dont use other symbols than ^A-Za-z_0-9.
Source:

(constant) stateFieldsToQuery

Source:

(constant) stateFieldsToWhere

Source:

(constant) string

String type
Source:

(constant) table :module:express-promise-router

Index is Main Router of App
Type:
  • module:express-promise-router
Source:

(constant) View

Plugin-helper
Source:

Methods

(async) add_unique_constraint(table_name, field_names) → {Promise.<void>}

Add unique constraint
Parameters:
Name Type Description
table_name table name
field_names list of columns (members of constraint)
Source:
Returns:
no result
Type
Promise.<void>

(async) add_unique_constraint(table_name, field_names) → {Promise.<void>}

Add unique constraint
Parameters:
Name Type Description
table_name table name
field_names list of columns (members of constraint)
Source:
Returns:
no result
Type
Promise.<void>

addOrCreateList(container, key, x)

Parameters:
Name Type Description
container
key
x
Source:

(async) changeConnection(connObj) → {Promise.<void>}

Change connection (close connection and open new connection from connObj)
Parameters:
Name Type Description
connObj connection object
Source:
Returns:
Type
Promise.<void>

(async) changeConnection(connObj) → {Promise.<void>}

Change connection (close connection and open new connection from connObj)
Parameters:
Name Type Description
connObj connection object
Source:
Returns:
Type
Promise.<void>

(async) close() → {Promise.<void>}

Close database connection
Source:
Returns:
Type
Promise.<void>

(async) close() → {Promise.<void>}

Close database connection
Source:
Returns:
Type
Promise.<void>

constraintForm(table_id, fields) → {Form}

Constraint Fields Edition Form Choosing fields for adding to contrain
Parameters:
Name Type Description
table_id
fields
Source:
Returns:
Type
Form

(async) copyFrom(fileStream, tableName, fieldNames, client) → {Promise.<void>}

Copy data from CSV to table? Only for PG
Parameters:
Name Type Description
fileStream file stream
tableName table name
fieldNames list of columns
client db connection
Source:
Returns:
no results
Type
Promise.<void>

copyFrom1(fileStream, tableName, fieldNames, client) → {Promise.<unknown>}

Copy data from CSV to table? Only for PG
Parameters:
Name Type Description
fileStream file stream
tableName table name
fieldNames list of columns
client db connection
Source:
Returns:
new Promise
Type
Promise.<unknown>

(async) count(tbl, whereObj) → {Promise.<number>}

Get count of rows in table
Parameters:
Name Type Description
tbl table name
whereObj where object
Source:
Returns:
count of tables
Type
Promise.<number>

(async) count(tbl, whereObj) → {Promise.<number>}

Get count of rows in table
Parameters:
Name Type Description
tbl table name
whereObj where object
Source:
Returns:
count of tables
Type
Promise.<number>

(async) create_blank_migration() → {Promise.<void>}

Create blank migration
Source:
Returns:
Type
Promise.<void>

(async) create_tenant(t, plugin_loader, newurl) → {Promise.<void>}

Create tenant
Parameters:
Name Type Description
t
plugin_loader
newurl
Source:
Returns:
Type
Promise.<void>

create_tenant_allowed(req) → {boolean}

Check that user has role that allowed to create tenants By default Admin role (id is 10) has rights to create tenants. You can specify config variable "role_to_create_tenant" to overwrite this. Note that only one role currently can have such rights simultaneously.
Parameters:
Name Type Description
req Request
Source:
Returns:
true if role has righs to create tenant
Type
boolean

(async) deleteWhere(tbl, whereObj) → {Promise.<*>}

Delete rows in table
Parameters:
Name Type Description
tbl table name
whereObj where object
Source:
Returns:
result of delete execution
Type
Promise.<*>

(async) deleteWhere(tbl, whereObj) → {Promise.<*>}

Delete rows in table
Parameters:
Name Type Description
tbl table name
whereObj where object
Source:
Returns:
result of delete execution
Type
Promise.<*>

(async) discover_tables(tableNames, schema0)

Discover tables definitions
Parameters:
Name Type Description
tableNames list of table names
schema0 db schema
Source:
Returns:

(async) discoverable_tables(schema0) → {Promise.<*>}

List of discoverable tables. Returns all tables that can be imported to Saltcorn from current tenant database schema. The tables with name started with "_sc_" and tables imported to Saltcorn are ignored.
Parameters:
Name Type Description
schema0 current tenant db schema
Source:
Returns:
all tables that can be imported to Saltcorn from current tenant database schema
Type
Promise.<*>

discoverForm(tables, req) → {Form}

Discover Database Tables Form
Parameters:
Name Type Description
tables list of tables
req HTTP Request
Source:
Returns:
Type
Form

(async) drop_reset_schema(schema) → {Promise.<void>}

Reset DB Schema using drop schema and recreate it Atterntion! You will lost data after call this function!
Parameters:
Name Type Description
schema db schema name
Source:
Returns:
no result
Type
Promise.<void>

(async) drop_reset_schema(schema) → {Promise.<void>}

Reset DB Schema using drop schema and recreate it Atterntion! You will lost data after call this function!
Parameters:
Name Type Description
schema db schema name
Source:
Returns:
no result
Type
Promise.<void>

(async) drop_unique_constraint(table_name, field_names) → {Promise.<void>}

Drop unique constraint
Parameters:
Name Type Description
table_name table name
field_names list of columns (members of constraint)
Source:
Returns:
no results
Type
Promise.<void>

(async) drop_unique_constraint(table_name, field_names) → {Promise.<void>}

Drop unique constraint
Parameters:
Name Type Description
table_name table name
field_names list of columns (members of constraint)
Source:
Returns:
no results
Type
Promise.<void>

(async) eachTenant(f) → {Promise.<void>}

Call fuction f for each Tenant
Parameters:
Name Type Description
f called function
Source:
Returns:
no result
Type
Promise.<void>

(async) email_form(req) → {Promise.<Form>}

Email settings form definition
Parameters:
Name Type Description
req request
Source:
Returns:
form
Type
Promise.<Form>

ensure_final_slash(s) → {*|string}

Ensure that string is finished with /
Parameters:
Name Type Description
s
Source:
Returns:
Type
* | string

findType(sql_name) → {string|*}

Mapping SQL Type to Saltcorn type
Parameters:
Name Type Description
sql_name SQL type name
Source:
Returns:
return Saltcorn type
Type
string | *

get_base_url(req) → {string}

Get base url
Parameters:
Name Type Description
req
Source:
Returns:
Type
string

get_db_filepath() → {*}

Get sqlite path
Source:
Returns:
Type
*

get_domain(url) → {*}

Remove protocol (http:// or https://) from domain url
Parameters:
Name Type Description
url
Source:
Returns:
Type
*

(async) get_existing_views(schema0) → {Promise.<*>}

List all views in current tenant db schema
Parameters:
Name Type Description
schema0 current tenant db schema
Source:
Returns:
Return list of views
Type
Promise.<*>

(async) get_latest_npm_version(pkg) → {Promise.<(*|string|*)>}

Get latest npm version
Parameters:
Name Type Description
pkg
Source:
Returns:
Type
Promise.<(*|string|*)>

get_other_domain_tenant(hostname)

Get other domain tenant
Parameters:
Name Type Description
hostname
Source:

get_process_init_time() → {Date}

Get Process Init Time - moment when Saltcorn process was initiated
Source:
Returns:
Type
Date

get_sql_logging() → {boolean}

Get sql logging state
Source:
Returns:
if true then sql logging eabled
Type
boolean

get_sql_logging() → {boolean}

Get sql logging state
Source:
Returns:
if true then sql logging eabled
Type
boolean

(async) get_tenant_info(subdomain) → {Promise.<*>}

Get Tenant info
Parameters:
Name Type Description
subdomain
Source:
Returns:
Type
Promise.<*>

(async) getActionConfigFields(action, table)

Get Action configuration fields
Parameters:
Name Type Description
action
table
Source:
Returns:

(async) getClient() → {Promise.<*>}

Open db connection Only for PG.
Source:
Returns:
db connection object
Type
Promise.<*>

getConfigFile() → {boolean|any}

Reads Saltcorn configuration file
Source:
Returns:
- Returns JSON presentation of Saltcorn confuration file. Returns false in case of Exception.
Type
boolean | any

getConnectObject(connSpec) → {Object|Object|boolean}

Prepare Saltcorn connection object that controls main Saltcorn instance settings like: - PostgreSQL or SQLite - Connection to DB settings - Multitenant mode - Web Session secret - File store path - Saltcorn confuration inheritance and fixed configuration For all parameters and priority see the code of function.
Parameters:
Name Type Description
connSpec
Source:
Returns:
Type
Object | Object | boolean

getGitRevision() → {null}

Get Git revision of Saltcorn source. Required to work: - Git client installed, - Local git with repo Saltcorn sources.
Source:
Returns:
- Return current Git commit
Type
null

getNewURL(req, subdomain) → {string}

Return URL of new Tenant
Parameters:
Name Type Description
req Request
subdomain Tenant Subdomain name string
Source:
Returns:
Type
string

getRootPageForm(pages, roles, req) → {Form}

Root pages configuration Form Allows to configure root page for each role
Parameters:
Name Type Description
pages list of pages
roles list of roles
req request
Source:
Returns:
return Form
Type
Form

getTenant(ten)

Get tenant
Parameters:
Name Type Description
ten
Source:

(async) getVersion(short) → {Promise.<*>}

Get version of PostgreSQL
Parameters:
Name Type Description
short if true return short version info else full version info
Source:
Returns:
returns version
Type
Promise.<*>

(async) getVersion(short) → {Promise.<*>}

Get version of PostgreSQL
Parameters:
Name Type Description
short if true return short version info else full version info
Source:
Returns:
returns version
Type
Promise.<*>

(async) implement_discovery(pack) → {Promise.<void>}

Add discovered tables to Saltcorn
Parameters:
Name Type Description
pack table definition
Source:
Returns:
Type
Promise.<void>

(async) init_multi_tenant(plugin_loader, disableMigrate) → {Promise.<void>}

Switch to multi_tenant
Parameters:
Name Type Description
plugin_loader
disableMigrate if true then dont migrate db
Source:
Returns:
Type
Promise.<void>

(async) insert(tbl, obj, opts) → {Promise.<*>}

Insert rows into table
Parameters:
Name Type Description
tbl table name
obj columns names and data
opts columns attributes
Source:
Returns:
returns primary key column or Id column value. If primary key column is not defined then return value of Id column.
Type
Promise.<*>

(async) insert(tbl, obj, opts) → {Promise.<*>}

Insert rows into table
Parameters:
Name Type Description
tbl table name
obj columns names and data
opts columns attributes
Source:
Returns:
returns id.
Type
Promise.<*>

is_ip_address(hostname)

Check that String is IPv4 address
Parameters:
Name Type Description
hostname
Source:
Returns:

is_sqlite(connObj) → {boolean}

Check that Saltcorn configured to use SQLite as database
Parameters:
Name Type Description
connObj connectin object
Source:
Returns:
- Returns true if Saltcorn configured to use SQLite as database
Type
boolean

isDate(date) → {boolean}

Is Valid Date of format moment.ISO_8601, example 2010-01-01T05:06:07
Parameters:
Name Type Description
date
Source:
Returns:
Type
boolean

isFixedConfig(key) → {boolean|*}

Returns true if key is defined in fixed_configration for tenant
Parameters:
Name Type Description
key
Source:
Returns:
Type
boolean | *

jsgrid_controller(table_name, vc, keyfields) → {Object}

jsgrid_controller
Parameters:
Name Type Description
table_name -
vc -
keyfields -
Source:
Returns:
Type
Object

json_list_to_external_table(get_json_list, fields0)

Parameters:
Name Type Description
get_json_list
fields0
Source:
Returns:
Parameters:
Name Type Description
url
label
popup
link_style
link_size
link_icon
textStyle
Source:
Returns:
Type
string

(async) migrate(schema0) → {Promise.<void>}

Migrate
Parameters:
Name Type Description
schema0 schema name
Source:
Returns:
Type
Promise.<void>

normalise_error_message(msg) → {*}

Normalise specific error message according db specific
Parameters:
Name Type Description
msg
Source:
Returns:
Type
*

post_delete_btn(href, req, what) → {string}

UI Form for Delete Item confirmation
Parameters:
Name Type Description
href href
req Request
what Item
Source:
Returns:
return html form
Type
string

readState(state, fields) → {*}

Parameters:
Name Type Description
state
fields
Source:
Returns:
Type
*

readStateStrict(state, fields) → {boolean|*}

Parameters:
Name Type Description
state
fields
Source:
Returns:
Type
boolean | *

(async) recalculate_for_stored(table) → {Promise.<void>}

Recalculate calculated columns that are stored in db
Parameters:
Name Type Description
table table object
Source:
Returns:
Type
Promise.<void>

renameForm(table_id, req) → {Form}

Rename Table Form Allows to set up new table name
Parameters:
Name Type Description
table_id
req
Source:
Returns:
Type
Form

reprAsJson(v) → {boolean}

Parameters:
Name Type Description
v
Source:
Returns:
Type
boolean

(async) reset_sequence(tblname) → {Promise.<void>}

Reset sequence Only for PG
Parameters:
Name Type Description
tblname table name
Source:
Returns:
no result
Type
Promise.<void>

(async) restart_tenant(plugin_loader) → {Promise.<void>}

Restart tenant
Parameters:
Name Type Description
plugin_loader
Source:
Returns:
Type
Promise.<void>

(async) run_action_column(col, req, rest) → {Promise.<*>}

Parameters:
Name Type Description
col
req
rest
Source:
Returns:
Type
Promise.<*>

(async) select(tbl, whereObj, selectopts) → {Promise.<*>}

Execute Select statement
Parameters:
Name Type Description
tbl table name
whereObj where object
selectopts select options
Source:
Returns:
return rows
Type
Promise.<*>

(async) select(tbl, whereObj, selectopts) → {Promise.<*>}

Execute Select statement
Parameters:
Name Type Description
tbl table name
whereObj where object
selectopts select options
Source:
Returns:
return rows
Type
Promise.<*>

(async) selectMaybeOne(tbl, where) → {Promise.<(null|*)>}

Select one record or null if no records
Parameters:
Name Type Description
tbl table name
where where object
Source:
Returns:
- null if no record or first record data
Type
Promise.<(null|*)>

(async) selectMaybeOne(tbl, where) → {Promise.<(null|*)>}

Select one record or null if no records
Parameters:
Name Type Description
tbl table name
where where object
Source:
Returns:
- null if no record or first record data
Type
Promise.<(null|*)>

(async) selectOne(tbl, where) → {Promise.<*>}

Select one record
Parameters:
Name Type Description
tbl table name
where where object
Source:
Returns:
return first record from sql result
Type
Promise.<*>

(async) selectOne(tbl, where) → {Promise.<*>}

Select one record
Parameters:
Name Type Description
tbl table name
where where object
Source:
Returns:
return first record from sql result
Type
Promise.<*>

set_sql_logging(val)

Control Logging sql statements to console
Parameters:
Name Type Default Description
val true if true then log sql statements to console
Source:

set_sql_logging(val)

Control Logging sql statements to console
Parameters:
Name Type Default Description
val true if true then log sql statements to console
Source:

set_tenant_base_url(tenant_subdomain, value)

Set tenant base url??? From my point of view it just add tenant to list of otherdomaintenant
Parameters:
Name Type Description
tenant_subdomain
value new
Source:

setEmailForm(req) → {Form}

Define set email form for user
Parameters:
Name Type Description
req
Source:
Returns:
Type
Form

sql_log(sql, vs)

Log SQL statement to console
Parameters:
Name Type Description
sql SQL statement
vs any additional parameter
Source:

sql_log(sql, vs)

Log SQL statement to console
Parameters:
Name Type Description
sql SQL statement
vs any additional parameter
Source:

strictParseInt(x) → {number|undefined}

Parameters:
Name Type Description
x
Source:
Returns:
Type
number | undefined

tableBadges(t, req) → {string}

Table badges to show in System Table list views Currently supports: - Owned - if ownership_field_id? What is it? - History - if table has versioning - External - if this is external table
Parameters:
Name Type Description
t table object
req http request
Source:
Returns:
- html string with list of badges
Type
string

(async) tableForm(table, req) → {Promise.<Form>}

Show Table Form
Parameters:
Name Type Description
table
req
Source:
Returns:
Type
Promise.<Form>

tenant_form(req) → {Form}

Declare Form to create Tenant
Parameters:
Name Type Description
req Request
Source:
Returns:
- Saltcorn Form Declaration
Type
Form

transposeObjects(objs) → {Object}

Transponce Objects TODO more detailed explanation TODO refactor - move to object util module?
Parameters:
Name Type Description
objs
Source:
Returns:
Type
Object

(async) triggerForm(req, trigger) → {Promise.<Form>}

Trigger Edit Form
Parameters:
Name Type Description
req
trigger
Source:
Returns:
Type
Promise.<Form>

typeToJsGridType(t, field) → {Object}

Saltcorn Type to JSGrid Type
Parameters:
Name Type Description
t
field
Source:
Returns:
Type
Object

(async) update(tbl, obj, id, opts) → {Promise.<void>}

Update table records
Parameters:
Name Type Description
tbl table name
obj columns names and data
id id of record (primary key column value)
opts columns attributes
Source:
Returns:
no result
Type
Promise.<void>

(async) update(table_name, field_names) → {Promise.<void>}

Drop unique constraint
Parameters:
Name Type Description
table_name table name
field_names list of columns (members of constraint)
Source:
Returns:
no results
Type
Promise.<void>

user_dropdown(user, req, can_reset) → {string}

Dropdown for User Info in left menu
Parameters:
Name Type Description
user
req
can_reset
Source:
Returns:
Type
string

versionsField()

Version Field
Source:

whereFTS(v, i, is_sqlite)

Parameters:
Name Type Description
v
i
is_sqlite
Source:
Returns: