@rapidrest/core 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/StringUtils.js +3 -3
- package/dist/types/StringUtils.d.ts +3 -3
- package/package.json +2 -7
- package/docs/Makefile +0 -20
- package/docs/conf.py +0 -58
- package/docs/index.rst +0 -17
- package/docs/make.bat +0 -35
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/README.md +0 -21
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +0 -33
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +0 -33
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +0 -33
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +0 -25
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +0 -31
- package/docs/reference/README.md +0 -35
- package/docs/reference/classes/AlertUtils.md +0 -158
- package/docs/reference/classes/ApiError.md +0 -251
- package/docs/reference/classes/ClassLoader.md +0 -224
- package/docs/reference/classes/Event.md +0 -109
- package/docs/reference/classes/EventUtils.md +0 -123
- package/docs/reference/classes/FileUtils.md +0 -193
- package/docs/reference/classes/JWTUtils.md +0 -139
- package/docs/reference/classes/MessagingUtils.md +0 -167
- package/docs/reference/classes/OASUtils.md +0 -227
- package/docs/reference/classes/ObjectFactory.md +0 -276
- package/docs/reference/classes/ObjectUtils.md +0 -60
- package/docs/reference/classes/StringUtils.md +0 -169
- package/docs/reference/classes/ThreadPool.md +0 -249
- package/docs/reference/classes/ThreadWorker.md +0 -91
- package/docs/reference/classes/UserUtils.md +0 -185
- package/docs/reference/classes/ValidationUtils.md +0 -294
- package/docs/reference/enumerations/AlertPriority.md +0 -61
- package/docs/reference/enumerations/JWTUtilsCompressionMethods.md +0 -21
- package/docs/reference/enumerations/WorkerMessageType.md +0 -43
- package/docs/reference/functions/sleep.md +0 -25
- package/docs/reference/globals.md +0 -73
- package/docs/reference/interfaces/Alert.md +0 -101
- package/docs/reference/interfaces/AlertAttachment.md +0 -51
- package/docs/reference/interfaces/AlertClose.md +0 -31
- package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +0 -42
- package/docs/reference/interfaces/AlertUtilsOptions.md +0 -41
- package/docs/reference/interfaces/InstanceOptions.md +0 -41
- package/docs/reference/interfaces/JWTPayload.md +0 -143
- package/docs/reference/interfaces/JWTUser.md +0 -55
- package/docs/reference/interfaces/JWTUtilsConfig.md +0 -45
- package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +0 -68
- package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +0 -40
- package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +0 -78
- package/docs/reference/interfaces/NewEvent.md +0 -25
- package/docs/reference/interfaces/OriginSettings.md +0 -25
- package/docs/reference/interfaces/SlackConfig.md +0 -33
- package/docs/reference/interfaces/SmtpAuth.md +0 -25
- package/docs/reference/interfaces/SmtpConfig.md +0 -41
- package/docs/reference/interfaces/Template.md +0 -105
- package/docs/reference/interfaces/TemplateMapBase.md +0 -13
- package/docs/reference/interfaces/TwilioConfig.md +0 -33
- package/docs/reference/interfaces/WorkerMessage.md +0 -31
- package/docs/reference/interfaces/WorkerOptions.md +0 -61
- package/docs/reference/type-aliases/BooleanFunc.md +0 -23
- package/docs/reference/type-aliases/TemplateMap.md +0 -17
- package/docs/reference/type-aliases/WorkerCallback.md +0 -31
- package/docs/reference/variables/Logger.md +0 -25
package/dist/lib/StringUtils.js
CHANGED
|
@@ -67,11 +67,11 @@ export class StringUtils {
|
|
|
67
67
|
* Replaces all instances of the match regex pattern with the contents of the inner regular expression pattern for
|
|
68
68
|
* the given string.
|
|
69
69
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
72
|
* let result = replaceAll('/my/path/{id}', new RegExp('\\{([^\\}]+)\\}'), ':');
|
|
73
73
|
* console.log(result); // -> /my/path/:id
|
|
74
|
-
*
|
|
74
|
+
* ```
|
|
75
75
|
* @param {string} str The string to perform replacement on.
|
|
76
76
|
* @param {RegExp} match The regular expression pattern to match containing an outer and inner pattern.
|
|
77
77
|
* @param {string} prefix The prefix to prepend the replacement text with.
|
|
@@ -24,11 +24,11 @@ export declare class StringUtils {
|
|
|
24
24
|
* Replaces all instances of the match regex pattern with the contents of the inner regular expression pattern for
|
|
25
25
|
* the given string.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
29
|
* let result = replaceAll('/my/path/{id}', new RegExp('\\{([^\\}]+)\\}'), ':');
|
|
30
30
|
* console.log(result); // -> /my/path/:id
|
|
31
|
-
*
|
|
31
|
+
* ```
|
|
32
32
|
* @param {string} str The string to perform replacement on.
|
|
33
33
|
* @param {RegExp} match The regular expression pattern to match containing an outer and inner pattern.
|
|
34
34
|
* @param {string} prefix The prefix to prepend the replacement text with.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rapidrest/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "A collection of common utilities and core functionality for rapidly building RESTful applications.",
|
|
5
5
|
"repository": "https://github.com/rapidrest/core.git",
|
|
6
6
|
"author": "RapidREST <rapidrests@gmail.com>",
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "yarn lint && rimraf dist && tsc",
|
|
15
|
-
"deploy-docs": "ts-node tools/gh-pages-publish",
|
|
16
|
-
"docs": "typedoc --plugin typedoc-plugin-markdown --out docs/reference src",
|
|
17
15
|
"lint": "eslint ./src ./test",
|
|
18
16
|
"local-audit": "yarn install && yarn npm audit -A -R \"$@\"",
|
|
19
17
|
"checkup": "yarn dlx @yarnpkg/doctor \"$@\"",
|
|
@@ -69,8 +67,6 @@
|
|
|
69
67
|
"rimraf": "^6.1.3",
|
|
70
68
|
"ts-node": "^10.9.2",
|
|
71
69
|
"twilio": "^6.0.2",
|
|
72
|
-
"typedoc": "^0.28.19",
|
|
73
|
-
"typedoc-plugin-markdown": "^4.12.0",
|
|
74
70
|
"typescript": "^6.0.3",
|
|
75
71
|
"vitest": "^4.1.8",
|
|
76
72
|
"winston": "^3.19.0",
|
|
@@ -90,7 +86,6 @@
|
|
|
90
86
|
"type": "module",
|
|
91
87
|
"typings": "dist/types/index.d.ts",
|
|
92
88
|
"files": [
|
|
93
|
-
"dist"
|
|
94
|
-
"docs"
|
|
89
|
+
"dist"
|
|
95
90
|
]
|
|
96
91
|
}
|
package/docs/Makefile
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Minimal makefile for Sphinx documentation
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
# You can set these variables from the command line, and also
|
|
5
|
-
# from the environment for the first two.
|
|
6
|
-
SPHINXOPTS ?=
|
|
7
|
-
SPHINXBUILD ?= sphinx-build
|
|
8
|
-
SOURCEDIR = .
|
|
9
|
-
BUILDDIR = _build
|
|
10
|
-
|
|
11
|
-
# Put it first so that "make" without argument is like "make help".
|
|
12
|
-
help:
|
|
13
|
-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
-
|
|
15
|
-
.PHONY: help Makefile
|
|
16
|
-
|
|
17
|
-
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
-
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
-
%: Makefile
|
|
20
|
-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
package/docs/conf.py
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Configuration file for the Sphinx documentation builder.
|
|
2
|
-
#
|
|
3
|
-
# This file only contains a selection of the most common options. For a full
|
|
4
|
-
# list see the documentation:
|
|
5
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
6
|
-
|
|
7
|
-
# -- Path setup --------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
# If extensions (or modules to document with autodoc) are in another directory,
|
|
10
|
-
# add these directories to sys.path here. If the directory is relative to the
|
|
11
|
-
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
12
|
-
#
|
|
13
|
-
# import os
|
|
14
|
-
# import sys
|
|
15
|
-
# sys.path.insert(0, os.path.abspath('.'))
|
|
16
|
-
import recommonmark
|
|
17
|
-
from recommonmark.transform import AutoStructify
|
|
18
|
-
|
|
19
|
-
source_suffix = ['.rst', '.md']
|
|
20
|
-
|
|
21
|
-
# -- Project information -----------------------------------------------------
|
|
22
|
-
|
|
23
|
-
project = 'RapidREST: Core Library'
|
|
24
|
-
copyright = 'Jean-Philippe Steinmetz. All rights reserved.'
|
|
25
|
-
author = 'RapidREST <rapidrests@gmail.com>'
|
|
26
|
-
|
|
27
|
-
# -- General configuration ---------------------------------------------------
|
|
28
|
-
|
|
29
|
-
# Add any Sphinx extension module names here, as strings. They can be
|
|
30
|
-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
31
|
-
# ones.
|
|
32
|
-
extensions = [
|
|
33
|
-
'recommonmark',
|
|
34
|
-
'sphinx.ext.autodoc',
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
# List of patterns, relative to source directory, that match files and
|
|
38
|
-
# directories to ignore when looking for source files.
|
|
39
|
-
# This pattern also affects html_static_path and html_extra_path.
|
|
40
|
-
exclude_patterns = []
|
|
41
|
-
|
|
42
|
-
master_doc = 'index'
|
|
43
|
-
|
|
44
|
-
# Add any paths that contain custom static files (such as style sheets) here,
|
|
45
|
-
# relative to this directory. They are copied after the builtin static files,
|
|
46
|
-
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
47
|
-
html_static_path = ['_static']
|
|
48
|
-
|
|
49
|
-
# app setup hook
|
|
50
|
-
def setup(app):
|
|
51
|
-
app.add_config_value('recommonmark_config', {
|
|
52
|
-
'auto_toc_tree_section': 'Contents',
|
|
53
|
-
'enable_math': False,
|
|
54
|
-
'enable_inline_math': False,
|
|
55
|
-
'enable_eval_rst': True,
|
|
56
|
-
'enable_auto_doc_ref': True,
|
|
57
|
-
}, True)
|
|
58
|
-
app.add_transform(AutoStructify)
|
package/docs/index.rst
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
===============================================================================
|
|
2
|
-
RapidREST: Core Library
|
|
3
|
-
===============================================================================
|
|
4
|
-
|
|
5
|
-
Repository: ``git@github.com:rapidrest/core.git``
|
|
6
|
-
|
|
7
|
-
A collection of common utilities and core functionality for rapidly building RESTful applications.
|
|
8
|
-
|
|
9
|
-
.. toctree::
|
|
10
|
-
:caption: Project Info
|
|
11
|
-
|
|
12
|
-
../README
|
|
13
|
-
|
|
14
|
-
.. toctree::
|
|
15
|
-
:caption: API Reference
|
|
16
|
-
|
|
17
|
-
reference/globals
|
package/docs/make.bat
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
@ECHO OFF
|
|
2
|
-
|
|
3
|
-
pushd %~dp0
|
|
4
|
-
|
|
5
|
-
REM Command file for Sphinx documentation
|
|
6
|
-
|
|
7
|
-
if "%SPHINXBUILD%" == "" (
|
|
8
|
-
set SPHINXBUILD=sphinx-build
|
|
9
|
-
)
|
|
10
|
-
set SOURCEDIR=.
|
|
11
|
-
set BUILDDIR=_build
|
|
12
|
-
|
|
13
|
-
if "%1" == "" goto help
|
|
14
|
-
|
|
15
|
-
%SPHINXBUILD% >NUL 2>NUL
|
|
16
|
-
if errorlevel 9009 (
|
|
17
|
-
echo.
|
|
18
|
-
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
19
|
-
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
20
|
-
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
21
|
-
echo.may add the Sphinx directory to PATH.
|
|
22
|
-
echo.
|
|
23
|
-
echo.If you don't have Sphinx installed, grab it from
|
|
24
|
-
echo.http://sphinx-doc.org/
|
|
25
|
-
exit /b 1
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
-
goto end
|
|
30
|
-
|
|
31
|
-
:help
|
|
32
|
-
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
-
|
|
34
|
-
:end
|
|
35
|
-
popd
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../globals.md) / ObjectDecorators
|
|
6
|
-
|
|
7
|
-
# ObjectDecorators
|
|
8
|
-
|
|
9
|
-
## Type Aliases
|
|
10
|
-
|
|
11
|
-
- [ValidatorFunction](type-aliases/ValidatorFunction.md)
|
|
12
|
-
|
|
13
|
-
## Functions
|
|
14
|
-
|
|
15
|
-
- [Config](functions/Config.md)
|
|
16
|
-
- [Destroy](functions/Destroy.md)
|
|
17
|
-
- [Init](functions/Init.md)
|
|
18
|
-
- [Inject](functions/Inject.md)
|
|
19
|
-
- [Logger](functions/Logger.md)
|
|
20
|
-
- [Nullable](functions/Nullable.md)
|
|
21
|
-
- [Validator](functions/Validator.md)
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / Config
|
|
6
|
-
|
|
7
|
-
# Function: Config()
|
|
8
|
-
|
|
9
|
-
> **Config**(`path?`, `defaultValue?`): (`target`, `propertyKey`) => `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:61](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L61)
|
|
12
|
-
|
|
13
|
-
Apply this to a property to have a configuration variable be injected at instantiation. If no path is given, the
|
|
14
|
-
global configuration object is injected.
|
|
15
|
-
|
|
16
|
-
## Parameters
|
|
17
|
-
|
|
18
|
-
### path?
|
|
19
|
-
|
|
20
|
-
`string`
|
|
21
|
-
|
|
22
|
-
The path to the configuration variable to inject.
|
|
23
|
-
|
|
24
|
-
### defaultValue?
|
|
25
|
-
|
|
26
|
-
`any` = `undefined`
|
|
27
|
-
|
|
28
|
-
Set to the desired default value. If `undefined` is specified then an error is thrown if
|
|
29
|
-
no config variable is found at the given path.
|
|
30
|
-
|
|
31
|
-
## Returns
|
|
32
|
-
|
|
33
|
-
(`target`, `propertyKey`) => `void`
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / Destroy
|
|
6
|
-
|
|
7
|
-
# Function: Destroy()
|
|
8
|
-
|
|
9
|
-
> **Destroy**(`target`, `propertyKey`): `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:10](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L10)
|
|
12
|
-
|
|
13
|
-
Apply this to a class function to mark it as a destructor to be called by the `ObjectFactory` during cleanup.
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
### target
|
|
18
|
-
|
|
19
|
-
`any`
|
|
20
|
-
|
|
21
|
-
### propertyKey
|
|
22
|
-
|
|
23
|
-
`string`
|
|
24
|
-
|
|
25
|
-
## Returns
|
|
26
|
-
|
|
27
|
-
`void`
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / Init
|
|
6
|
-
|
|
7
|
-
# Function: Init()
|
|
8
|
-
|
|
9
|
-
> **Init**(`target`, `propertyKey`, `descriptor`): `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:49](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L49)
|
|
12
|
-
|
|
13
|
-
Apply this to a function to be executed once a new object instance has been created and all dependencies injected.
|
|
14
|
-
Note: If the decorated function returns a Promise it is not gauranteed to finish execution before the object is
|
|
15
|
-
returned during the instantiation process.
|
|
16
|
-
|
|
17
|
-
## Parameters
|
|
18
|
-
|
|
19
|
-
### target
|
|
20
|
-
|
|
21
|
-
`any`
|
|
22
|
-
|
|
23
|
-
### propertyKey
|
|
24
|
-
|
|
25
|
-
`string`
|
|
26
|
-
|
|
27
|
-
### descriptor
|
|
28
|
-
|
|
29
|
-
`PropertyDescriptor`
|
|
30
|
-
|
|
31
|
-
## Returns
|
|
32
|
-
|
|
33
|
-
`void`
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / Inject
|
|
6
|
-
|
|
7
|
-
# Function: Inject()
|
|
8
|
-
|
|
9
|
-
> **Inject**(`type`, `options?`): (`target`, `propertyKey`) => `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:21](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L21)
|
|
12
|
-
|
|
13
|
-
Injects an object instance to the decorated property of the given name and type using the provided arguments
|
|
14
|
-
if no object has been created yet.
|
|
15
|
-
|
|
16
|
-
## Parameters
|
|
17
|
-
|
|
18
|
-
### type
|
|
19
|
-
|
|
20
|
-
`any`
|
|
21
|
-
|
|
22
|
-
The fully qualified name or type of the class to instantiate. If a type is given it's class name will be inferred
|
|
23
|
-
via the constructor name.
|
|
24
|
-
|
|
25
|
-
### options?
|
|
26
|
-
|
|
27
|
-
[`InstanceOptions`](../../../../interfaces/InstanceOptions.md)
|
|
28
|
-
|
|
29
|
-
The set of options to use when creating new instances of the injected class type.
|
|
30
|
-
|
|
31
|
-
## Returns
|
|
32
|
-
|
|
33
|
-
(`target`, `propertyKey`) => `void`
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / Logger
|
|
6
|
-
|
|
7
|
-
# Function: Logger()
|
|
8
|
-
|
|
9
|
-
> **Logger**(`target`, `propertyKey`): `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:77](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L77)
|
|
12
|
-
|
|
13
|
-
Apply this to a property to have the logger utility injected at instantiation.
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
### target
|
|
18
|
-
|
|
19
|
-
`any`
|
|
20
|
-
|
|
21
|
-
### propertyKey
|
|
22
|
-
|
|
23
|
-
`string` \| `symbol`
|
|
24
|
-
|
|
25
|
-
## Returns
|
|
26
|
-
|
|
27
|
-
`void`
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / Nullable
|
|
6
|
-
|
|
7
|
-
# Function: Nullable()
|
|
8
|
-
|
|
9
|
-
> **Nullable**(`target`, `propertyKey`): `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:90](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L90)
|
|
12
|
-
|
|
13
|
-
Apply this to a property to indicate that the value can be `null` or `undefined.`
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
### target
|
|
18
|
-
|
|
19
|
-
`any`
|
|
20
|
-
|
|
21
|
-
### propertyKey
|
|
22
|
-
|
|
23
|
-
`string` \| `symbol`
|
|
24
|
-
|
|
25
|
-
## Returns
|
|
26
|
-
|
|
27
|
-
`void`
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / Validator
|
|
6
|
-
|
|
7
|
-
# Function: Validator()
|
|
8
|
-
|
|
9
|
-
> **Validator**(`func`): (`target`, `propertyKey`) => `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:108](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L108)
|
|
12
|
-
|
|
13
|
-
Apply this to a property to specify the function that will be used to perform validation of the value.
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
### func
|
|
18
|
-
|
|
19
|
-
[`ValidatorFunction`](../type-aliases/ValidatorFunction.md)
|
|
20
|
-
|
|
21
|
-
The validation function to use for the given property.
|
|
22
|
-
|
|
23
|
-
## Returns
|
|
24
|
-
|
|
25
|
-
(`target`, `propertyKey`) => `void`
|
package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / ValidatorFunction
|
|
6
|
-
|
|
7
|
-
# Type Alias: ValidatorFunction
|
|
8
|
-
|
|
9
|
-
> **ValidatorFunction** = (`value`) => `any`
|
|
10
|
-
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:101](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L101)
|
|
12
|
-
|
|
13
|
-
A function used to validate a property value.
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
### value
|
|
18
|
-
|
|
19
|
-
`any`
|
|
20
|
-
|
|
21
|
-
The value to validate.
|
|
22
|
-
|
|
23
|
-
## Returns
|
|
24
|
-
|
|
25
|
-
`any`
|
|
26
|
-
|
|
27
|
-
The validated value to assign to the property.
|
|
28
|
-
|
|
29
|
-
## Throws
|
|
30
|
-
|
|
31
|
-
An exception if the value cannot be validated.
|
package/docs/reference/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
**@rapidrest/core**
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# RapidREST: Core Library
|
|
6
|
-
|
|
7
|
-
A set of common utilities shared amongst all RapidREST based applications and servers.
|
|
8
|
-
|
|
9
|
-
## Features
|
|
10
|
-
|
|
11
|
-
* Alert & Notification System
|
|
12
|
-
* Class Loader
|
|
13
|
-
* File management utilities
|
|
14
|
-
* JSON Web Token utilities
|
|
15
|
-
* Object Factory
|
|
16
|
-
* OpenAPI utilities
|
|
17
|
-
* String utilities
|
|
18
|
-
* Telemetry utilities
|
|
19
|
-
* Thread-pool Manager
|
|
20
|
-
* User authentication utilities
|
|
21
|
-
* Validation utilities
|
|
22
|
-
|
|
23
|
-
## Getting Started
|
|
24
|
-
|
|
25
|
-
### Yarn
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
yarn add @rapidrest/core
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### NPM
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
npm i @rapidrest/core
|
|
35
|
-
```
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/core**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/core](../globals.md) / AlertUtils
|
|
6
|
-
|
|
7
|
-
# Class: AlertUtils
|
|
8
|
-
|
|
9
|
-
Defined in: [src/AlertUtils.ts:116](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L116)
|
|
10
|
-
|
|
11
|
-
The `AlertUtils` class is used to send alerts about important system events that have occurred
|
|
12
|
-
and require further monitoring or intervention.
|
|
13
|
-
|
|
14
|
-
## Constructors
|
|
15
|
-
|
|
16
|
-
### Constructor
|
|
17
|
-
|
|
18
|
-
> **new AlertUtils**(`options`): `AlertUtils`
|
|
19
|
-
|
|
20
|
-
Defined in: [src/AlertUtils.ts:128](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L128)
|
|
21
|
-
|
|
22
|
-
Creates a new instance of `AuthUtils` with the provided defaults.
|
|
23
|
-
|
|
24
|
-
#### Parameters
|
|
25
|
-
|
|
26
|
-
##### options
|
|
27
|
-
|
|
28
|
-
[`AlertUtilsOptions`](../interfaces/AlertUtilsOptions.md)
|
|
29
|
-
|
|
30
|
-
The configuration options to use.
|
|
31
|
-
|
|
32
|
-
#### Returns
|
|
33
|
-
|
|
34
|
-
`AlertUtils`
|
|
35
|
-
|
|
36
|
-
## Methods
|
|
37
|
-
|
|
38
|
-
### addAttachment()
|
|
39
|
-
|
|
40
|
-
> **addAttachment**(`id`, `attachment`, `indexFile?`): `Promise`\<`boolean`\>
|
|
41
|
-
|
|
42
|
-
Defined in: [src/AlertUtils.ts:298](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L298)
|
|
43
|
-
|
|
44
|
-
Uploads a single attachment to the alert with the given unique identifier.
|
|
45
|
-
|
|
46
|
-
#### Parameters
|
|
47
|
-
|
|
48
|
-
##### id
|
|
49
|
-
|
|
50
|
-
`string`
|
|
51
|
-
|
|
52
|
-
The unique identifier of the alert to add an attachment for.
|
|
53
|
-
|
|
54
|
-
##### attachment
|
|
55
|
-
|
|
56
|
-
[`AlertAttachment`](../interfaces/AlertAttachment.md)
|
|
57
|
-
|
|
58
|
-
The file to upload as an attachment.
|
|
59
|
-
|
|
60
|
-
##### indexFile?
|
|
61
|
-
|
|
62
|
-
`string`
|
|
63
|
-
|
|
64
|
-
Sets the indexFile parameter of the request.
|
|
65
|
-
|
|
66
|
-
#### Returns
|
|
67
|
-
|
|
68
|
-
`Promise`\<`boolean`\>
|
|
69
|
-
|
|
70
|
-
True if the operation was successful, otherwise false.
|
|
71
|
-
|
|
72
|
-
***
|
|
73
|
-
|
|
74
|
-
### close()
|
|
75
|
-
|
|
76
|
-
> **close**(`id`, `data?`): `Promise`\<`boolean`\>
|
|
77
|
-
|
|
78
|
-
Defined in: [src/AlertUtils.ts:139](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L139)
|
|
79
|
-
|
|
80
|
-
Attempts to close the existing alert with the given identifier.
|
|
81
|
-
|
|
82
|
-
#### Parameters
|
|
83
|
-
|
|
84
|
-
##### id
|
|
85
|
-
|
|
86
|
-
`string`
|
|
87
|
-
|
|
88
|
-
The unique identifier of the alert to close.
|
|
89
|
-
|
|
90
|
-
##### data?
|
|
91
|
-
|
|
92
|
-
[`AlertClose`](../interfaces/AlertClose.md) = `{}`
|
|
93
|
-
|
|
94
|
-
#### Returns
|
|
95
|
-
|
|
96
|
-
`Promise`\<`boolean`\>
|
|
97
|
-
|
|
98
|
-
True if the operation was successful, otherwise false.
|
|
99
|
-
|
|
100
|
-
***
|
|
101
|
-
|
|
102
|
-
### get()
|
|
103
|
-
|
|
104
|
-
> **get**(`id`): `Promise`\<[`Alert`](../interfaces/Alert.md) \| `null`\>
|
|
105
|
-
|
|
106
|
-
Defined in: [src/AlertUtils.ts:167](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L167)
|
|
107
|
-
|
|
108
|
-
Attempts to retrieve the existing alert with the given identifier.
|
|
109
|
-
|
|
110
|
-
#### Parameters
|
|
111
|
-
|
|
112
|
-
##### id
|
|
113
|
-
|
|
114
|
-
`string`
|
|
115
|
-
|
|
116
|
-
The unique identifier of the alert to retrieve.
|
|
117
|
-
|
|
118
|
-
#### Returns
|
|
119
|
-
|
|
120
|
-
`Promise`\<[`Alert`](../interfaces/Alert.md) \| `null`\>
|
|
121
|
-
|
|
122
|
-
The retrieved alert if successful, otherwise `null`.
|
|
123
|
-
|
|
124
|
-
***
|
|
125
|
-
|
|
126
|
-
### send()
|
|
127
|
-
|
|
128
|
-
> **send**(`alert`, `vars?`, `attachments?`): `Promise`\<`string` \| `null`\>
|
|
129
|
-
|
|
130
|
-
Defined in: [src/AlertUtils.ts:191](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L191)
|
|
131
|
-
|
|
132
|
-
Sends the provided alert to the configured monitoring service.
|
|
133
|
-
|
|
134
|
-
#### Parameters
|
|
135
|
-
|
|
136
|
-
##### alert
|
|
137
|
-
|
|
138
|
-
[`Alert`](../interfaces/Alert.md)
|
|
139
|
-
|
|
140
|
-
The alert to send.
|
|
141
|
-
|
|
142
|
-
##### vars?
|
|
143
|
-
|
|
144
|
-
`any` = `{}`
|
|
145
|
-
|
|
146
|
-
A map of vars to perform replacement on for the alert's various properties.
|
|
147
|
-
|
|
148
|
-
##### attachments?
|
|
149
|
-
|
|
150
|
-
[`AlertUtilsAttachmentOptions`](../interfaces/AlertUtilsAttachmentOptions.md)
|
|
151
|
-
|
|
152
|
-
The attachments to upload along with the alert.
|
|
153
|
-
|
|
154
|
-
#### Returns
|
|
155
|
-
|
|
156
|
-
`Promise`\<`string` \| `null`\>
|
|
157
|
-
|
|
158
|
-
The unique identifier of the created alert if the operation was successful, otherwise `null`.
|