Node.js framework
Fixes:
News:
$.successful(function(response) {})
options.reconnectserver {Boolean}
to WEBSOCKETCLIENT
req.snapshot(callback(err, request_body))
CMD('reload_preferences')
UID
sql
extension to U.getContentType()
F.stats.performance.usage
which contains percentual usage of the threadUpdates:
SchemaOptions
method $.response([index/operation_name])
, e.g. $.response('workflow.NAME')
startscript.js.json
contains tabs instead of spacesDatabaseBuilder.rule(rule, [param])
, supports string declaration of filter functionURL
validationFixes:
String.parseCSV()
, now supports multiline stringsDatabaseBuilder.search()
methodError
in CLONE()
methodschema.inherit()
by adding schema.middleware()
and schema.verify()
News:
HASH(value, [type])
for creating hash like in jComponentSchemaOptions.repo
as alias to SchemaInstance.model.$$repository
CONVERT syntax
to schema.define()
(more in docs)SchemaEntity.verify(name, function($), [cache])
for async verification of valuesTEMP
variable as a new global variable (it's cleaned every 7 minutes)CONF.allow_persistent_images: true
which allows to reuse resized images in temp directoryreq.filecache(callback)
as alias for F.exists()
RESTBuilderInstance.convert('name:String,age:Number')
methodRESTBuilder.upgrade(fn(restbuilder))
for upgrading of RESTBuilder
RESTBuilder
parses Total.js Errors in responses as ErrorString.prototype.env()
replaces all values in the form [key]
for CONF.key
buffer
Number.fixed(decimals)
Updates:
websocket.send2(message, comparer, replacer, [params])
by adding params
argument for comparer functionWebsocket.encodedecode
can enable/disable easily encoding of messages-bk.bundle
in filenameUPDATE()
method by adding noarchive
argumentTEST()
method supports [subdomain]
keyword and METHOD url
in URL addressMODIFY([filename], fn)
by adding filename
argumentU.download()
by adding param
argumentU.request()
by adding param
argumentschema.cl(name, [value])
method by adding value
argument for replacing of existing code-listv4.0.0
Improvements:
filename
in modificators (now filenames contain relative paths)U.request()
(around +10%)U.download()
(around +10%)RESTBuilder
#000000
to #000
Fixes:
totaljs
executable scriptDOWNLOAD()
Number.VAT()
by Tomas Novakallow_compile_html
in static filesROUTE()
method, there was a problem with spaces GET /*
ACTION()
with json output$ACTION()
with used get
and query
actionsPATCH
method in $ACTION()
schema.allow()
in PATCH
methodNews:
SchemaOptions.parent
returns a parent modelString.makeid()
for creating of unique identifier from stringmessage.ua
to FLOWSTREAM()
Updates:
HttpFile.fs()
by adding id
argument for updating of existing fileallow_ssc_validation
to true
Fixes:
String.parseDate(format)
with defined formatMailMessage.attachments()
F.snapshotstats
in cache recyclecontroller.success()
F.backup()
Improvements:
Date.format()
News:
date.setTimeZone(timezone)
(generate)
subtype into the config
filesString.isBase64()
Base64
schema.addWorkflowExtension(name, fn($, [data]))
schema.addTransformExtension(name, fn($, [data]))
schema.addOperationExtension(name, fn($, [data]))
schema.addHookExtension(name, fn($, [data]))
schema.setSaveExtension(fn($, [data]))
schema.setReadExtension(fn($, [data]))
schema.setQueryExtension(fn($, [data]))
schema.setRemoveExtension(fn($, [data]))
schema.setInsertExtension(fn($, [data]))
schema.setUpdateExtension(fn($, [data]))
schema.setPatchExtension(fn($, [data]))
$.extend([data])
for evaluating of all extensions for the current operationWebSocket.keys
property (it contains all keys with connections)threads
directory for server-less functionalityTHREAD
with a name of current threadrequire('total.js').http(..., { thread: 'thread_name' })
evaluates only specified threadrequire('total.js').cluster.http(..., { thread: 'thread_name' })
evaluates only specified thread in clusteryour_init_script_name.js.json
allow_stats_snapshot
@{import()}
supports auto-merging JS or CSS files: @{import('default.js + ui.js')}
exports.options
delegate to component in FLOWSTREAM
DatabaseBuilder.autofill()
from DBMSHttpFile.extension
propertyHttpFile.size
property alias to HttpFile.length
allow_sessions_unused
config key for cleaning of unused sessionsPATH.schemas
, PATH.operations
and PATH.tasks
PATH.updates
UPDATE(versions, [callback], [pause_server_message])
.reset([type], [id], [date], [callback])
method-session.listlive(callback)
returns all live items in sessioncontroller.ua
returns parsed User-Agent$.ua
returns parsed User-Agent in Schemas, Operations, TaskBuilder, MIDDLEWARE()
and AUTH()
.mjs
extensionsallow_reqlimit : Number
(max. concurent requests by IP just-in-time)String.encryptUID()
as alias for U.encryptUID()
String.decryptUID()
as alias for U.decryptUID()
Updates:
WEBSOCKET()
supports +
, -
and 🔒
as authorization flagsLOAD()
supports service
typerestart
or restart_NAME_of_THREAD
files for restarting of existing threadsauto
modedebug
mode*.filefs()
, *.filenosql()
, *.imagefs()
, *.imagenosql()
by adding checkmeta
argument$.done([user_instance])
method in AUTH()
, added a new argument called user_instance
(optional).env
parser supports parsing of .env-debug
or .env-release
files according to the modeString.parseUA()
Fixes:
ON('error404')
when the route doens't existfilter
in Schema workflows
, transformations
and operations
NOSQL()
joins with absolute pathsTABLE()
joins with absolute paths(random)
subtype in config
files(response)
phrase in ROUTE()
for multiple OPERATIONS
ROUTE()
with mulitple operations if the result contained some errordebug
watcher for themes
generators
in schemas with a new declarationstartup
directory in bundlesschema.inherit()
didn't copy required
fields.SUCCESS()
serialization with SUCCESS()
argumentUID()
generatorImprovements:
LOGMAIL()
mail formatcontroller.success()
and controller.done()
Fixes:
utc
is default time zone)News:
RESTBuilder.callback()
which performs .exec()
automaticallyFLOWSTREAM()
Fixes:
AUDIT()
methodcontroller.invalid()
req.authorize()
opacity
with !important
CONVERT()
a problem with arraysNEWTASK(name, declaration)
for creating preddefined TaskBuilder
TASK(name, taskname, callback, [controller/SchemaOptions/OperationOptions/ErrorBuilder])
for executing preddefined TaskBuilder
directory_tasks
for TaskBuilder
MODIFY()
for F.modify()
VIEWCOMPILE()
for F.view_compile()
mail.type = 'html'
can be html
(default) or plain
$.headers
into the SchemaOptions
, OperationOptions
and TaskBuilder
String.parseCSV([delimiter])
returns Object Array
String.parseUA([structured])
a simple user-agent parserreq.useragent([structured])
returns parsed User-Agentdefault_crypto
it can rewrite Total.js crypto mechanism (default: undefined
)default_crypto_iv
it's an initialization vector (default: generated from secret
) or it can contain a custom hex
valueallow_workers_silent
can enable/disable silent workers (default: false
)random
, example: secret_key (random) : 10
and 10
means a length of valueclear_dnscache
for clearing DNS cacheINSTALL('command', 'command_name', function)
for registering commands and CMD(name, [a], [b], [c], [d])
for executing commandsENCRYPTREQ(req, val, [key], [strict])
to encrypt value according to the request meta dataDECRYPTREQ(req, val, [key])
to decrypt value according to the request meta datacontroller.nocache()
controller.nocontent()
REPO
as a global variableFUNC
as a global variableMAIN
as a global variableDEF
as a global variable for defining of behaviour for some operations (alternative to F
)PREF.set(name, [value])
(read+write) or PREF.propname
(only read) for reading/writing a persistent preferencesF.onPrefSave = function(obj)
to write preferencesF.onPrefLoad = function(next(obj))
to read preferencesRESTBuilder.url(url)
which returns a new instance of RESTBuilder
for chainingrestbuilder.keepalive()
enables a keepalive for RESTBuilder
instanceSESSION()
management, more in docscontroller.sessionid
with ID of SESSION()
AUTH()
supports a new auth declaration with $
as AuthOptions
like SchemaOptions
or OperationOptions
AuthOptions
to prototypesErrorBuilder.length
property (alias for `instance.items.length)prepare
supports req
argumentDEF.currencies.eur = function(val) {}
registers a currency formatterDEF.helpers
registers a new view engine helper (F.helpers
is alias for for this object)DEF.validators
is alias for for F.validators
Number.currency(currency)
Number2
with default value is null
, not zero 0
@{json2(model, elementID, key1, key2, key3)}
can serialize data with keys defined into the <script type="application/json">
PATCH
and .setPatch()
, only specified field are processedSchemaOptions
supports $.keys
for PATCH
methodschema.cl(name)
("cl" means codelist) returns {Array}
a list of values from defined enum/keyvalueschema.props()
returns {Object}
meta info about all defined propertiesSchemaOptions
, OperationOptions
and TaskOptions
supports $.req
and $.res
propertiesAUDIT(name, $, [type], message)
a method for audit logsU.diffarr(prop, arr_A, arr_B)
for comparing of two arraysDIFFARR(prop, arr_A, arr_B)
is a global alias for U.diffarr()
global.REQUIRE()
for local modules within app directoryglobal.isWORKER
variable which contains true
(when the process is executed as a worker) or false
ACTION(url, [data], callback)
can evaluate a route without request creationROUTE('🔒 METHOD URL')
, it means that 🔒 adds authorized
flagROUTE('+METHOD URL')
, it means that ++
or +
adds authorized
flagROUTE('-METHOD URL')
, it means that --
or -
adds authorized
flagSchemaOptions
, OperationOptions
, TaskOptions
supports filtered query arguments via $.filter
controller.done([value])
SITEMAP()
as alias to F.sitemap()
allow_localize
enables a localization for all HTML
filescontroller.breadcrumb
returns all sitemap itemsPAUSESERVER(name, pause)
pauses web server (alias for F.wait()
)PROXY(endpoint, hostname, [copypath], [before_fn(uri,req,res)], [after_fn(res)])
makes a direct proxy from webserverschema.middleware(function($, next))
for creating simple middlewares for Schema operationsFILE404(fn(req, res))
performs a simple fallback for non-existing files$PATCH(schema, model, [options], callback, [controller])
method.env
parser to process.env
String.parseENV()
for parsing .env
syntax$.noop()
for custom responses$ACTION(schemaroute, [model], callback, [controller])
evaluates schemaprocess.send('total:restart')
performs a restart of app when the app is in debug modeNOSQLREADER(filename)
for reading different files of NoSQL embedded databasesTABLEREADER(filename)
for reading different files of Table embedded databasesMail.use()
an alias for F.useSMTP()
F.onAudit(name, data)
delegate for handling audit logsParts
, more in docs$.invalid()
without arguments can return a function function(err)
unsubscribe
appends new header which enables unsubscribe
in e.g. iOSMODIFY
, handler contains a new argument controller
headers
argument in controller.proxy
supports flags: []
for REQEUST method.filefs()
and .filenosql()
supports download
with true
or with (name, type) => 'new_name'
(filename
will be read from NoSQL binary file)$.done(arg)
argument @arg
can be boolean
(response will be as a value) or object/primitive value (arg
will be as a value)String.arg(obj, [encode], [def])
added encode
(true
, json
, html
) and def
argumentsAUTH(req, res, flags, next)
and next
function can handle callback(err, user)
REQUEST()
supports keepalive
flagbundles
mechanism supports merging files --filename
between bundles
filesString.hash(true)
returns unsigned intCONF:default_image_converter
supports magick
for new version of ImageMagickCONF.default_image_consumption
can contain ZERO value which means disabled optimialization of CPU/memory consumptionCONF.default_image_consumption
has changed a default value to 0
U.parseXML(str, [replace])
and String.parseXML([replace])
contains a new argument called replace
LOAD()
added a callback functionencoding="utf8"
attribute for <file
tag (default: base64
)EventEmitter2
supports a new argument obj
, example: U.EventEmitter2(obj)
or supports .extend
method: U.EventEmitter2.extend(proto)
UID()
generates new types of UID
with 100% backward compatibilityFILESTORAGE()
now it works in cluster mode!important
clausecontroller.proxy()
with Gzip/Deflate compression204
in REQUEST()
cookies
in WEBSOCKETCLIENT
REQUEST()
with json
flag and with null
and ''
valuelayout
default.resource
res.image()
res.filefs()
Boolean
parserF.stats.request.path
to F.stats.request.patch
F.backup()
F.backup()
U.getExtension()
by @moldares.filefs()
method for nonexistent files*.routeScript
to *.public_js
*.routeStyle
to *.public_css
*.routeFont
to *.public_font
*.routeVideo
to *.public_video
*.routeImage
to *.public_image
*.routeDownload
to *.public_download
*.routeStatic
to *.public
controller.viewCompile()
to controller.view_compile()
cache-set
to cache_set
:controller-render-meta
to controller_render_meta
request-end
to request_end
websocket-begin
to websocket_begin
websocket-end
to websocket_end
request-begin
to request_begin
upload-begin
to upload_begin
upload-end
to upload_end
cache-expire
to cache_expired
F.hash()
, alternative String.prototype.hash()
controller.hash()
, alternative String.prototype.hash()
News:
WORKER()
alias to F.worker()
WORKER2()
alias to F.worker2()
F.cluster.https()
TaskBuilder.done2([send_value])
returns function
with wrapped .done()
TaskBuilder.success2([send_value])
returns function
with wrapped .success()
TaskBuilder.next2(name)
returns function
with wrapped .next()
RESTBuilder
aliases .DELETE()
, .PUT()
, .POST()
, .PATCH() and
.GET()`schema.before(key, (value, model, index) => value)
is a simple and new alternative to schema.setPrepare()
SchemaInstance.$parent
returns a parent schema (if the schema is nested schema)SchemaOptions.redirect(url)
can perform a redirect from the schemaOperationOptions.redirect(url)
can perform a redirect from the operation.ics
extension as acceptable file for the web serverUpdates:
F.worker2()
returns entire stdout
buffer in the callback(err, buffer)
$options()
by adding disabled
keyString.ROOT()
by adding a support for jComponent AJAX()
callsRESTBuilder.method(method, [data])
added data
argumentString.parseDate([format])
added format
argumentheloid
as heloidentifier
(manually can be defined HELO
or EHLO
command)Fixes:
U.request()
with GET
method by @khaledkhalil94 (it doesn't send JSON data if data
is null/undefined)F.wait()
in WebSocketString.capitalize(true)
REQUEST()
uploading of additional multipart/form-data (removed encoding)<script>
U.download()
@{'%config_key'}
a problem with rendering a value with '
NEWS:
border-radius: $radius || 10px
.find(beg, end, [threads])
+ .count(beg, end, [threads])
+ '.scalar(beg, end, type, field, [threads])' with multiple thread supportU.reader()
bundles
supports merging files between bundle and project, project file must start with e.g. --name.js
.bundlesignore
support with similiar functionality like .gitignore
SameSite
cookie attributeRUN()
for executing multiple Total.js operationsCONF
(it's a reference to config) for F.config
FUNC
(it's a reference to functions) for F.functions
DatabaseBuilder.arg(key, value)
for adding an dynamic argument!field
as boolean toggle$age: 'js_code'
with some JS code'js_code'
with some JS codedefault-restbuilder-timeout : 10000
default-cors : https://www.totaljs.com, https://www.componentator.com
which allows originators for CORS()
methoddefault-request-maxkeys : 33
for restricting query max. keyslogger : false
which enables logging for Middleware, Schemas and Operationsbundling : shallow
which enables shallow bundling (if bundle.json
exists then the bundles won't be extracted)SchemaOptions
and OperationOptions
supports $.cancel()
methodCACHE(name, [value], [expire], [persistent])
alias for F.cache.get2()
and F.cache.set()
or F.cache.set2()
F.refresh()
for refreshing of internal cacheDatabaseBuilder.each(fn)
for browsing of evaluated recordsONCE()
alias to F.once()
image.define(value)
performs convert -define 'value'
.
(dot) or ended with -bk
won't be processedTaskBuilder
for creating custom tasks in Schemas or OperationsWebSocket.send2(message, [comparer(client, message)], [replacer])
a new method for better sending framesPATH
as a global alias for F.path
UPDATES:
debug
mode creates a start_name_script.pid
instead of debug.pid
NEWOPERATION()
supports repeat
, stop
and binderror
arguments (more in docs)ROUTE('.. * --> @save_operation @load_operation (response)')
ROUTE()
supports multiple HTTP method declaration ROUTE('GET,POST,PUT /something/', action)
ROUTE()
supports dynamic schemasREQUEST()
can return binary data if the content-type is not text/*
or application/*
ROUTING(id:|search, [flags])
methodF.path.mkdir(path, [cache])
can cache a current satte (default: false)controller.all()
can return Array
of all WebSocketClientLOCALIZE()
now url
arg can be a function which replaces F.onLocale
FIXES:
httpfile.fs()
or httpfile.nosql()
nosql.update()
and nosql.modify()
methods if the first argument is a functionF.wait()
in the test modeLOCALIZE()
for nested directoriesunauthorized
)versions
and auto
feature with enabled F.wait()
versions
and auto
feature with direct link to fileLOAD('release')
a release modeSchemaInstance.$clean()
for nested schemasbundles
(added /flow/
and /dashboard/
)localhost
$MAKE()
with callback
String.slug()
for UTF - Chinese/Japan/Arabic/etc. charscomponents
200
\t
tabscontroller.autoclear()
controller.proxy()
repeat
mode in SCHEDULE()
--inspect
argument for Workers by Tema Smirnovjavascript
filescontroller.invalid()
a problem with ErrorBuilder as a argumentREMOVED:
F.config.debug
controller.isDebug
IMPROVEMENTS:
UID()
-> now it changes a random hash each minute