@rapidrest/core 1.3.0 → 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/ClassLoader.js +3 -2
- package/dist/lib/ClassLoader.js.map +1 -1
- package/dist/lib/JWTUtils.js +1 -0
- package/dist/lib/JWTUtils.js.map +1 -1
- package/dist/lib/StringUtils.js +3 -3
- package/dist/types/JWTUtils.d.ts +1 -0
- 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/ClassLoader.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
///////////////////////////////////////////////////////////////////////////////
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import path from "path";
|
|
6
|
+
import { pathToFileURL } from "url";
|
|
6
7
|
const sepRegex = new RegExp("\\" + path.sep, "g");
|
|
7
8
|
/**
|
|
8
9
|
* The *ClassLoader* provides a container for dynamically loading classes at runtime using C#/Java style namespaces.
|
|
@@ -127,7 +128,7 @@ export class ClassLoader {
|
|
|
127
128
|
await this.load(subdir);
|
|
128
129
|
}
|
|
129
130
|
else if (this.includeJavaScript && extension.match(/^\.(js|cjs|mjs)$/)) {
|
|
130
|
-
const mod = await import(fullpath);
|
|
131
|
+
const mod = await import(pathToFileURL(fullpath).href);
|
|
131
132
|
if (mod) {
|
|
132
133
|
for (let name in mod) {
|
|
133
134
|
let clazz = mod[name];
|
|
@@ -141,7 +142,7 @@ export class ClassLoader {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
else if (this.includeTypeScript && extension.match(/^\.(ts|cts|mts|tsx)$/)) {
|
|
144
|
-
const mod = await import(fullpath);
|
|
145
|
+
const mod = await import(pathToFileURL(fullpath).href);
|
|
145
146
|
if (mod) {
|
|
146
147
|
for (let name in mod) {
|
|
147
148
|
let clazz = mod[name];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassLoader.js","sourceRoot":"","sources":["../../src/ClassLoader.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ClassLoader.js","sourceRoot":"","sources":["../../src/ClassLoader.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,MAAM,IAAI,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wBAC3B,IAAI,GAAG,GAAW,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;wBAC7G,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;wBAChB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;oBACjC,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACJ,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,QAAQ,CAAC,CAAC;gBAC/D,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
package/dist/lib/JWTUtils.js
CHANGED
package/dist/lib/JWTUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JWTUtils.js","sourceRoot":"","sources":["../../src/JWTUtils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,MAAM,CAAC;AA8CxB;;GAEG;AACH,MAAM,CAAN,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IAClC,wCAAwC;IACxC,2CAAa,CAAA;AACjB,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,QAGrC;AAkFD;;;;GAIG;AACH,MAAM,OAAO,QAAQ;
|
|
1
|
+
{"version":3,"file":"JWTUtils.js","sourceRoot":"","sources":["../../src/JWTUtils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,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GAAW,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;gBACpE,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;gBAEtE,IAAI,SAAS,GAAW,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;gBACnE,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;YAChC,CAAC;QACL,CAAC;QAED,qCAAqC;QACrC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9C,OAAO,OAAO,CAAC;IACnB,CAAC;;AAxNc,wBAAe,GAAG,IAAI,GAAG,EAAE,CAAC"}
|
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.
|
package/dist/types/JWTUtils.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ export interface JWTUtilsConfig {
|
|
|
118
118
|
* @author Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
119
119
|
*/
|
|
120
120
|
export declare class JWTUtils {
|
|
121
|
+
private static _parsedKeyCache;
|
|
121
122
|
/**
|
|
122
123
|
* Generates a new JWT token for the given config and user object. The user object must be a valid RapidREST
|
|
123
124
|
* user.
|
|
@@ -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/df82e91f4c858ef61526c7f35789a4199b84d999/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/df82e91f4c858ef61526c7f35789a4199b84d999/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/df82e91f4c858ef61526c7f35789a4199b84d999/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/df82e91f4c858ef61526c7f35789a4199b84d999/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/df82e91f4c858ef61526c7f35789a4199b84d999/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/df82e91f4c858ef61526c7f35789a4199b84d999/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/df82e91f4c858ef61526c7f35789a4199b84d999/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/df82e91f4c858ef61526c7f35789a4199b84d999/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
|
-
```
|