@rapidrest/core 1.0.1
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/LICENSE +23 -0
- package/README.rst +37 -0
- package/dist/lib/AlertUtils.js +239 -0
- package/dist/lib/AlertUtils.js.map +1 -0
- package/dist/lib/ApiError.js +34 -0
- package/dist/lib/ApiError.js.map +1 -0
- package/dist/lib/ClassLoader.js +159 -0
- package/dist/lib/ClassLoader.js.map +1 -0
- package/dist/lib/FileUtils.js +190 -0
- package/dist/lib/FileUtils.js.map +1 -0
- package/dist/lib/JWTUtils.js +111 -0
- package/dist/lib/JWTUtils.js.map +1 -0
- package/dist/lib/Logger.js +28 -0
- package/dist/lib/Logger.js.map +1 -0
- package/dist/lib/MessagingUtils.js +218 -0
- package/dist/lib/MessagingUtils.js.map +1 -0
- package/dist/lib/NotificationsUtils.js +52 -0
- package/dist/lib/NotificationsUtils.js.map +1 -0
- package/dist/lib/OASUtils.js +207 -0
- package/dist/lib/OASUtils.js.map +1 -0
- package/dist/lib/ObjectFactory.js +302 -0
- package/dist/lib/ObjectFactory.js.map +1 -0
- package/dist/lib/ObjectUtils.js +49 -0
- package/dist/lib/ObjectUtils.js.map +1 -0
- package/dist/lib/StringUtils.js +104 -0
- package/dist/lib/StringUtils.js.map +1 -0
- package/dist/lib/TelemetryUtils.js +159 -0
- package/dist/lib/TelemetryUtils.js.map +1 -0
- package/dist/lib/UserUtils.js +138 -0
- package/dist/lib/UserUtils.js.map +1 -0
- package/dist/lib/ValidationUtils.js +130 -0
- package/dist/lib/ValidationUtils.js.map +1 -0
- package/dist/lib/decorators/ObjectDecorators.js +95 -0
- package/dist/lib/decorators/ObjectDecorators.js.map +1 -0
- package/dist/lib/decorators/index.js +2 -0
- package/dist/lib/decorators/index.js.map +1 -0
- package/dist/lib/index.js +18 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/sleep.js +15 -0
- package/dist/lib/sleep.js.map +1 -0
- package/dist/lib/threads/ThreadLogger.js +43 -0
- package/dist/lib/threads/ThreadLogger.js.map +1 -0
- package/dist/lib/threads/ThreadPool.js +270 -0
- package/dist/lib/threads/ThreadPool.js.map +1 -0
- package/dist/lib/threads/ThreadWorker.js +25 -0
- package/dist/lib/threads/ThreadWorker.js.map +1 -0
- package/dist/lib/threads/ThreadWorkerEntry.js +77 -0
- package/dist/lib/threads/ThreadWorkerEntry.js.map +1 -0
- package/dist/lib/threads/index.js +3 -0
- package/dist/lib/threads/index.js.map +1 -0
- package/dist/types/AlertUtils.d.ts +132 -0
- package/dist/types/ApiError.d.ts +13 -0
- package/dist/types/ClassLoader.d.ts +87 -0
- package/dist/types/FileUtils.d.ts +46 -0
- package/dist/types/JWTUtils.d.ts +139 -0
- package/dist/types/Logger.d.ts +7 -0
- package/dist/types/MessagingUtils.d.ts +77 -0
- package/dist/types/NotificationsUtils.d.ts +32 -0
- package/dist/types/OASUtils.d.ts +54 -0
- package/dist/types/ObjectFactory.d.ts +77 -0
- package/dist/types/ObjectUtils.d.ts +17 -0
- package/dist/types/StringUtils.d.ts +52 -0
- package/dist/types/TelemetryUtils.d.ts +84 -0
- package/dist/types/UserUtils.d.ts +61 -0
- package/dist/types/ValidationUtils.d.ts +66 -0
- package/dist/types/decorators/ObjectDecorators.d.ts +55 -0
- package/dist/types/decorators/index.d.ts +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/sleep.d.ts +5 -0
- package/dist/types/threads/ThreadLogger.d.ts +15 -0
- package/dist/types/threads/ThreadPool.d.ts +115 -0
- package/dist/types/threads/ThreadWorker.d.ts +41 -0
- package/dist/types/threads/ThreadWorkerEntry.d.ts +1 -0
- package/dist/types/threads/index.d.ts +2 -0
- package/docs/Makefile +20 -0
- package/docs/conf.py +58 -0
- package/docs/index.rst +17 -0
- package/docs/make.bat +35 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/README.md +21 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +47 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +27 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +33 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +45 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +27 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +27 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +39 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +31 -0
- package/docs/reference/README.md +73 -0
- package/docs/reference/classes/AlertUtils.md +158 -0
- package/docs/reference/classes/ApiError.md +263 -0
- package/docs/reference/classes/ClassLoader.md +224 -0
- package/docs/reference/classes/Event.md +109 -0
- package/docs/reference/classes/EventUtils.md +123 -0
- package/docs/reference/classes/FileUtils.md +193 -0
- package/docs/reference/classes/JWTUtils.md +91 -0
- package/docs/reference/classes/MessagingUtils.md +145 -0
- package/docs/reference/classes/OASUtils.md +213 -0
- package/docs/reference/classes/ObjectFactory.md +274 -0
- package/docs/reference/classes/ObjectUtils.md +60 -0
- package/docs/reference/classes/StringUtils.md +169 -0
- package/docs/reference/classes/ThreadPool.md +249 -0
- package/docs/reference/classes/ThreadWorker.md +91 -0
- package/docs/reference/classes/UserUtils.md +239 -0
- package/docs/reference/classes/ValidationUtils.md +294 -0
- package/docs/reference/enumerations/AlertPriority.md +61 -0
- package/docs/reference/enumerations/JWTUtilsCompressionMethods.md +21 -0
- package/docs/reference/enumerations/WorkerMessageType.md +43 -0
- package/docs/reference/functions/sleep.md +25 -0
- package/docs/reference/interfaces/Alert.md +101 -0
- package/docs/reference/interfaces/AlertAttachment.md +51 -0
- package/docs/reference/interfaces/AlertClose.md +31 -0
- package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +42 -0
- package/docs/reference/interfaces/AlertUtilsOptions.md +41 -0
- package/docs/reference/interfaces/InstanceOptions.md +35 -0
- package/docs/reference/interfaces/JWTPayload.md +143 -0
- package/docs/reference/interfaces/JWTUser.md +55 -0
- package/docs/reference/interfaces/JWTUtilsConfig.md +45 -0
- package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +68 -0
- package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +40 -0
- package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +78 -0
- package/docs/reference/interfaces/NewEvent.md +25 -0
- package/docs/reference/interfaces/OriginSettings.md +25 -0
- package/docs/reference/interfaces/SlackConfig.md +33 -0
- package/docs/reference/interfaces/SmtpAuth.md +25 -0
- package/docs/reference/interfaces/SmtpConfig.md +41 -0
- package/docs/reference/interfaces/Template.md +81 -0
- package/docs/reference/interfaces/TemplateMapBase.md +13 -0
- package/docs/reference/interfaces/TwilioConfig.md +33 -0
- package/docs/reference/interfaces/WorkerMessage.md +31 -0
- package/docs/reference/interfaces/WorkerOptions.md +61 -0
- package/docs/reference/type-aliases/BooleanFunc.md +23 -0
- package/docs/reference/type-aliases/TemplateMap.md +17 -0
- package/docs/reference/type-aliases/WorkerCallback.md +31 -0
- package/docs/reference/variables/Logger.md +21 -0
- package/package.json +96 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
[**@rapidrest/core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/core](../README.md) / UserUtils
|
|
6
|
+
|
|
7
|
+
# Class: UserUtils
|
|
8
|
+
|
|
9
|
+
Defined in: src/UserUtils.ts:16
|
|
10
|
+
|
|
11
|
+
Utilities for working with authenticated user objects. An user object is expected to have the following
|
|
12
|
+
properties.
|
|
13
|
+
|
|
14
|
+
* `uid` - Universally unique identifier for the user
|
|
15
|
+
* `email` - Unique e-mail address for the user
|
|
16
|
+
* `roles` - A list of unique names indicating the permissions of the user.
|
|
17
|
+
* `verified` - Indicates if the user's e-mail address has been verified.
|
|
18
|
+
|
|
19
|
+
## Author
|
|
20
|
+
|
|
21
|
+
Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
22
|
+
|
|
23
|
+
## Constructors
|
|
24
|
+
|
|
25
|
+
### Constructor
|
|
26
|
+
|
|
27
|
+
> **new UserUtils**(): `UserUtils`
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`UserUtils`
|
|
32
|
+
|
|
33
|
+
## Methods
|
|
34
|
+
|
|
35
|
+
### getExternalId()
|
|
36
|
+
|
|
37
|
+
> `static` **getExternalId**(`user`, `type`): `string` \| `undefined`
|
|
38
|
+
|
|
39
|
+
Defined in: src/UserUtils.ts:96
|
|
40
|
+
|
|
41
|
+
Returns the unique identifier of the specified type associated with the given user.
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
##### user
|
|
46
|
+
|
|
47
|
+
`any`
|
|
48
|
+
|
|
49
|
+
The user to retrieve the external id from.
|
|
50
|
+
|
|
51
|
+
##### type
|
|
52
|
+
|
|
53
|
+
`string`
|
|
54
|
+
|
|
55
|
+
The type of external provider to retrieve.
|
|
56
|
+
|
|
57
|
+
#### Returns
|
|
58
|
+
|
|
59
|
+
`string` \| `undefined`
|
|
60
|
+
|
|
61
|
+
The unique id of the external provider for the given type if found, otherwise `undefined`.
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### hasOrganization()
|
|
66
|
+
|
|
67
|
+
> `static` **hasOrganization**(`user`, `organizationUid`): `boolean`
|
|
68
|
+
|
|
69
|
+
Defined in: src/UserUtils.ts:22
|
|
70
|
+
|
|
71
|
+
Returns `true` if the given user object is a member of the organization with the specified uid, otherwise returns `false`.
|
|
72
|
+
|
|
73
|
+
#### Parameters
|
|
74
|
+
|
|
75
|
+
##### user
|
|
76
|
+
|
|
77
|
+
`any`
|
|
78
|
+
|
|
79
|
+
The user object to inspect.
|
|
80
|
+
|
|
81
|
+
##### organizationUid
|
|
82
|
+
|
|
83
|
+
`string`
|
|
84
|
+
|
|
85
|
+
The universally unique identifier of the persona to search for.
|
|
86
|
+
|
|
87
|
+
#### Returns
|
|
88
|
+
|
|
89
|
+
`boolean`
|
|
90
|
+
|
|
91
|
+
***
|
|
92
|
+
|
|
93
|
+
### hasOrganizations()
|
|
94
|
+
|
|
95
|
+
> `static` **hasOrganizations**(`user`, `organizationUids?`): `boolean`
|
|
96
|
+
|
|
97
|
+
Defined in: src/UserUtils.ts:39
|
|
98
|
+
|
|
99
|
+
Returns `true` if the given user object contains is a member of an organization matching one of the uids in the specified list, otherwise returns `false`.
|
|
100
|
+
|
|
101
|
+
#### Parameters
|
|
102
|
+
|
|
103
|
+
##### user
|
|
104
|
+
|
|
105
|
+
`any`
|
|
106
|
+
|
|
107
|
+
The user object to inspect.
|
|
108
|
+
|
|
109
|
+
##### organizationUids?
|
|
110
|
+
|
|
111
|
+
`string`[]
|
|
112
|
+
|
|
113
|
+
The list of universally unique identifiers to search for.
|
|
114
|
+
|
|
115
|
+
#### Returns
|
|
116
|
+
|
|
117
|
+
`boolean`
|
|
118
|
+
|
|
119
|
+
***
|
|
120
|
+
|
|
121
|
+
### hasPersona()
|
|
122
|
+
|
|
123
|
+
> `static` **hasPersona**(`user`, `personaUid?`): `boolean`
|
|
124
|
+
|
|
125
|
+
Defined in: src/UserUtils.ts:58
|
|
126
|
+
|
|
127
|
+
Returns `true` if the given user object contains a `Persona` object with the specified uid, otherwise returns `false`.
|
|
128
|
+
|
|
129
|
+
#### Parameters
|
|
130
|
+
|
|
131
|
+
##### user
|
|
132
|
+
|
|
133
|
+
`any`
|
|
134
|
+
|
|
135
|
+
The user object to inspect.
|
|
136
|
+
|
|
137
|
+
##### personaUid?
|
|
138
|
+
|
|
139
|
+
`string`
|
|
140
|
+
|
|
141
|
+
The universally unique identifier of the persona to search for.
|
|
142
|
+
|
|
143
|
+
#### Returns
|
|
144
|
+
|
|
145
|
+
`boolean`
|
|
146
|
+
|
|
147
|
+
***
|
|
148
|
+
|
|
149
|
+
### hasPersonas()
|
|
150
|
+
|
|
151
|
+
> `static` **hasPersonas**(`user`, `personaUids?`): `boolean`
|
|
152
|
+
|
|
153
|
+
Defined in: src/UserUtils.ts:75
|
|
154
|
+
|
|
155
|
+
Returns `true` if the given user object contains a `Persona` object matching one of the uids in the specified list, otherwise returns `false`.
|
|
156
|
+
|
|
157
|
+
#### Parameters
|
|
158
|
+
|
|
159
|
+
##### user
|
|
160
|
+
|
|
161
|
+
`any`
|
|
162
|
+
|
|
163
|
+
The user object to inspect.
|
|
164
|
+
|
|
165
|
+
##### personaUids?
|
|
166
|
+
|
|
167
|
+
`string`[]
|
|
168
|
+
|
|
169
|
+
#### Returns
|
|
170
|
+
|
|
171
|
+
`boolean`
|
|
172
|
+
|
|
173
|
+
***
|
|
174
|
+
|
|
175
|
+
### hasRole()
|
|
176
|
+
|
|
177
|
+
> `static` **hasRole**(`user`, `role?`, `orgUid?`): `boolean`
|
|
178
|
+
|
|
179
|
+
Defined in: src/UserUtils.ts:118
|
|
180
|
+
|
|
181
|
+
Returns `true` if the given user object has a role with the specified name, otherwise returns `false`.
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
##### user
|
|
186
|
+
|
|
187
|
+
`any`
|
|
188
|
+
|
|
189
|
+
The user object to inspect.
|
|
190
|
+
|
|
191
|
+
##### role?
|
|
192
|
+
|
|
193
|
+
`string`
|
|
194
|
+
|
|
195
|
+
The unique name of the role to search for.
|
|
196
|
+
|
|
197
|
+
##### orgUid?
|
|
198
|
+
|
|
199
|
+
`string`
|
|
200
|
+
|
|
201
|
+
The unique identifier of an organization whose role will be verified.
|
|
202
|
+
|
|
203
|
+
#### Returns
|
|
204
|
+
|
|
205
|
+
`boolean`
|
|
206
|
+
|
|
207
|
+
***
|
|
208
|
+
|
|
209
|
+
### hasRoles()
|
|
210
|
+
|
|
211
|
+
> `static` **hasRoles**(`user`, `roles?`, `orgUid?`): `boolean`
|
|
212
|
+
|
|
213
|
+
Defined in: src/UserUtils.ts:143
|
|
214
|
+
|
|
215
|
+
Returns `true` if the given user object has at least one role from the specified list of names, otherwise returns `false`.
|
|
216
|
+
|
|
217
|
+
#### Parameters
|
|
218
|
+
|
|
219
|
+
##### user
|
|
220
|
+
|
|
221
|
+
`any`
|
|
222
|
+
|
|
223
|
+
The user object to inspect.
|
|
224
|
+
|
|
225
|
+
##### roles?
|
|
226
|
+
|
|
227
|
+
`string`[]
|
|
228
|
+
|
|
229
|
+
A list of unique names of the roles to search for.
|
|
230
|
+
|
|
231
|
+
##### orgUid?
|
|
232
|
+
|
|
233
|
+
`string`
|
|
234
|
+
|
|
235
|
+
The unique identifier of an organization whose role will be verified.
|
|
236
|
+
|
|
237
|
+
#### Returns
|
|
238
|
+
|
|
239
|
+
`boolean`
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
[**@rapidrest/core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/core](../README.md) / ValidationUtils
|
|
6
|
+
|
|
7
|
+
# Class: ValidationUtils
|
|
8
|
+
|
|
9
|
+
Defined in: src/ValidationUtils.ts:14
|
|
10
|
+
|
|
11
|
+
A collection of validation functions to use with the `@Validator()` decorator.
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new ValidationUtils**(): `ValidationUtils`
|
|
18
|
+
|
|
19
|
+
#### Returns
|
|
20
|
+
|
|
21
|
+
`ValidationUtils`
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### check()
|
|
26
|
+
|
|
27
|
+
> `static` **check**(`val`, `func`): `any`
|
|
28
|
+
|
|
29
|
+
Defined in: src/ValidationUtils.ts:23
|
|
30
|
+
|
|
31
|
+
A simple wrapper that calls the specified boolean validation function with the given value and returns the
|
|
32
|
+
value as a result if the validation function passes. Otherwise throws an error.
|
|
33
|
+
|
|
34
|
+
#### Parameters
|
|
35
|
+
|
|
36
|
+
##### val
|
|
37
|
+
|
|
38
|
+
`any`
|
|
39
|
+
|
|
40
|
+
The value to validate.
|
|
41
|
+
|
|
42
|
+
##### func
|
|
43
|
+
|
|
44
|
+
[`BooleanFunc`](../type-aliases/BooleanFunc.md)
|
|
45
|
+
|
|
46
|
+
The boolean validation function to check the value.
|
|
47
|
+
|
|
48
|
+
#### Returns
|
|
49
|
+
|
|
50
|
+
`any`
|
|
51
|
+
|
|
52
|
+
#### Throws
|
|
53
|
+
|
|
54
|
+
Throws an error if the value fails the boolean validation test.
|
|
55
|
+
|
|
56
|
+
***
|
|
57
|
+
|
|
58
|
+
### checkDate()
|
|
59
|
+
|
|
60
|
+
> `static` **checkDate**(`val`): `string`
|
|
61
|
+
|
|
62
|
+
Defined in: src/ValidationUtils.ts:33
|
|
63
|
+
|
|
64
|
+
Validates that the provided string represents a ISO, RFC or UTC date or timestamp.
|
|
65
|
+
|
|
66
|
+
#### Parameters
|
|
67
|
+
|
|
68
|
+
##### val
|
|
69
|
+
|
|
70
|
+
`string`
|
|
71
|
+
|
|
72
|
+
#### Returns
|
|
73
|
+
|
|
74
|
+
`string`
|
|
75
|
+
|
|
76
|
+
***
|
|
77
|
+
|
|
78
|
+
### checkEmail()
|
|
79
|
+
|
|
80
|
+
> `static` **checkEmail**(`val`): `string`
|
|
81
|
+
|
|
82
|
+
Defined in: src/ValidationUtils.ts:43
|
|
83
|
+
|
|
84
|
+
Validates that the provided string represents a valid e-mail address.
|
|
85
|
+
|
|
86
|
+
#### Parameters
|
|
87
|
+
|
|
88
|
+
##### val
|
|
89
|
+
|
|
90
|
+
`string`
|
|
91
|
+
|
|
92
|
+
#### Returns
|
|
93
|
+
|
|
94
|
+
`string`
|
|
95
|
+
|
|
96
|
+
***
|
|
97
|
+
|
|
98
|
+
### checkEmpty()
|
|
99
|
+
|
|
100
|
+
> `static` **checkEmpty**(`val`): `any`[]
|
|
101
|
+
|
|
102
|
+
Defined in: src/ValidationUtils.ts:53
|
|
103
|
+
|
|
104
|
+
Validates that the provided array is not empty.
|
|
105
|
+
|
|
106
|
+
#### Parameters
|
|
107
|
+
|
|
108
|
+
##### val
|
|
109
|
+
|
|
110
|
+
`any`[]
|
|
111
|
+
|
|
112
|
+
#### Returns
|
|
113
|
+
|
|
114
|
+
`any`[]
|
|
115
|
+
|
|
116
|
+
***
|
|
117
|
+
|
|
118
|
+
### checkIP()
|
|
119
|
+
|
|
120
|
+
> `static` **checkIP**(`val`): `string`
|
|
121
|
+
|
|
122
|
+
Defined in: src/ValidationUtils.ts:63
|
|
123
|
+
|
|
124
|
+
Validates that the provided string is a valid IP address.
|
|
125
|
+
|
|
126
|
+
#### Parameters
|
|
127
|
+
|
|
128
|
+
##### val
|
|
129
|
+
|
|
130
|
+
`string`
|
|
131
|
+
|
|
132
|
+
#### Returns
|
|
133
|
+
|
|
134
|
+
`string`
|
|
135
|
+
|
|
136
|
+
***
|
|
137
|
+
|
|
138
|
+
### checkJSON()
|
|
139
|
+
|
|
140
|
+
> `static` **checkJSON**(`val`): `string`
|
|
141
|
+
|
|
142
|
+
Defined in: src/ValidationUtils.ts:73
|
|
143
|
+
|
|
144
|
+
Validates that the provided string is valid JSON (note: uses `JSON.parse`).
|
|
145
|
+
|
|
146
|
+
#### Parameters
|
|
147
|
+
|
|
148
|
+
##### val
|
|
149
|
+
|
|
150
|
+
`string`
|
|
151
|
+
|
|
152
|
+
#### Returns
|
|
153
|
+
|
|
154
|
+
`string`
|
|
155
|
+
|
|
156
|
+
***
|
|
157
|
+
|
|
158
|
+
### checkName()
|
|
159
|
+
|
|
160
|
+
> `static` **checkName**(`val`): `string`
|
|
161
|
+
|
|
162
|
+
Defined in: src/ValidationUtils.ts:83
|
|
163
|
+
|
|
164
|
+
Validates that the provided string matches the regexp pattern /[a-zA-Z0-9_\-\.@:\+]+/.
|
|
165
|
+
|
|
166
|
+
#### Parameters
|
|
167
|
+
|
|
168
|
+
##### val
|
|
169
|
+
|
|
170
|
+
`string`
|
|
171
|
+
|
|
172
|
+
#### Returns
|
|
173
|
+
|
|
174
|
+
`string`
|
|
175
|
+
|
|
176
|
+
***
|
|
177
|
+
|
|
178
|
+
### checkNull()
|
|
179
|
+
|
|
180
|
+
> `static` **checkNull**(`val`): `any`
|
|
181
|
+
|
|
182
|
+
Defined in: src/ValidationUtils.ts:93
|
|
183
|
+
|
|
184
|
+
Validates that the provided object is not null or empty.
|
|
185
|
+
|
|
186
|
+
#### Parameters
|
|
187
|
+
|
|
188
|
+
##### val
|
|
189
|
+
|
|
190
|
+
`any`
|
|
191
|
+
|
|
192
|
+
#### Returns
|
|
193
|
+
|
|
194
|
+
`any`
|
|
195
|
+
|
|
196
|
+
***
|
|
197
|
+
|
|
198
|
+
### checkPhone()
|
|
199
|
+
|
|
200
|
+
> `static` **checkPhone**(`val`): `string`
|
|
201
|
+
|
|
202
|
+
Defined in: src/ValidationUtils.ts:103
|
|
203
|
+
|
|
204
|
+
Validates that the provided string represents a valid phone number.
|
|
205
|
+
|
|
206
|
+
#### Parameters
|
|
207
|
+
|
|
208
|
+
##### val
|
|
209
|
+
|
|
210
|
+
`string`
|
|
211
|
+
|
|
212
|
+
#### Returns
|
|
213
|
+
|
|
214
|
+
`string`
|
|
215
|
+
|
|
216
|
+
***
|
|
217
|
+
|
|
218
|
+
### checkSemVer()
|
|
219
|
+
|
|
220
|
+
> `static` **checkSemVer**(`val`): `string`
|
|
221
|
+
|
|
222
|
+
Defined in: src/ValidationUtils.ts:113
|
|
223
|
+
|
|
224
|
+
Validates that the provided string represents a semantic version.
|
|
225
|
+
|
|
226
|
+
#### Parameters
|
|
227
|
+
|
|
228
|
+
##### val
|
|
229
|
+
|
|
230
|
+
`string`
|
|
231
|
+
|
|
232
|
+
#### Returns
|
|
233
|
+
|
|
234
|
+
`string`
|
|
235
|
+
|
|
236
|
+
***
|
|
237
|
+
|
|
238
|
+
### checkURL()
|
|
239
|
+
|
|
240
|
+
> `static` **checkURL**(`val`): `string`
|
|
241
|
+
|
|
242
|
+
Defined in: src/ValidationUtils.ts:123
|
|
243
|
+
|
|
244
|
+
Validates that the provided string is a valid URL.
|
|
245
|
+
|
|
246
|
+
#### Parameters
|
|
247
|
+
|
|
248
|
+
##### val
|
|
249
|
+
|
|
250
|
+
`string`
|
|
251
|
+
|
|
252
|
+
#### Returns
|
|
253
|
+
|
|
254
|
+
`string`
|
|
255
|
+
|
|
256
|
+
***
|
|
257
|
+
|
|
258
|
+
### checkUUID()
|
|
259
|
+
|
|
260
|
+
> `static` **checkUUID**(`val`): `string`
|
|
261
|
+
|
|
262
|
+
Defined in: src/ValidationUtils.ts:133
|
|
263
|
+
|
|
264
|
+
Validates that the provided string is a valid UUID.
|
|
265
|
+
|
|
266
|
+
#### Parameters
|
|
267
|
+
|
|
268
|
+
##### val
|
|
269
|
+
|
|
270
|
+
`string`
|
|
271
|
+
|
|
272
|
+
#### Returns
|
|
273
|
+
|
|
274
|
+
`string`
|
|
275
|
+
|
|
276
|
+
***
|
|
277
|
+
|
|
278
|
+
### checkVersion()
|
|
279
|
+
|
|
280
|
+
> `static` **checkVersion**(`val`): `number`
|
|
281
|
+
|
|
282
|
+
Defined in: src/ValidationUtils.ts:143
|
|
283
|
+
|
|
284
|
+
Validates that the provided value is an entity `version` number (e.g. `value > 0`).
|
|
285
|
+
|
|
286
|
+
#### Parameters
|
|
287
|
+
|
|
288
|
+
##### val
|
|
289
|
+
|
|
290
|
+
`any`
|
|
291
|
+
|
|
292
|
+
#### Returns
|
|
293
|
+
|
|
294
|
+
`number`
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[**@rapidrest/core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/core](../README.md) / AlertPriority
|
|
6
|
+
|
|
7
|
+
# Enumeration: AlertPriority
|
|
8
|
+
|
|
9
|
+
Defined in: src/AlertUtils.ts:24
|
|
10
|
+
|
|
11
|
+
Describes the level of priority for a given alert and an importance for triaging the problem.
|
|
12
|
+
|
|
13
|
+
## Enumeration Members
|
|
14
|
+
|
|
15
|
+
### Critical
|
|
16
|
+
|
|
17
|
+
> **Critical**: `"P1"`
|
|
18
|
+
|
|
19
|
+
Defined in: src/AlertUtils.ts:26
|
|
20
|
+
|
|
21
|
+
Describes an alert that affects critical operating functionality or infrastructure.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### Important
|
|
26
|
+
|
|
27
|
+
> **Important**: `"P3"`
|
|
28
|
+
|
|
29
|
+
Defined in: src/AlertUtils.ts:30
|
|
30
|
+
|
|
31
|
+
Describes an alert that affects basic systems that may create a poor end-user experience.
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### Notice
|
|
36
|
+
|
|
37
|
+
> **Notice**: `"P5"`
|
|
38
|
+
|
|
39
|
+
Defined in: src/AlertUtils.ts:34
|
|
40
|
+
|
|
41
|
+
Describes an alert that has no material affect on end-user experience and no potential for escalation.
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
### Severe
|
|
46
|
+
|
|
47
|
+
> **Severe**: `"P2"`
|
|
48
|
+
|
|
49
|
+
Defined in: src/AlertUtils.ts:28
|
|
50
|
+
|
|
51
|
+
Describes an alert that affects key systems that have great impact on end-user experiences.
|
|
52
|
+
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### Warning
|
|
56
|
+
|
|
57
|
+
> **Warning**: `"P4"`
|
|
58
|
+
|
|
59
|
+
Defined in: src/AlertUtils.ts:32
|
|
60
|
+
|
|
61
|
+
Describes an alert that has no material affect on the end-user experience but with potential to escalate.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[**@rapidrest/core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/core](../README.md) / JWTUtilsCompressionMethods
|
|
6
|
+
|
|
7
|
+
# Enumeration: JWTUtilsCompressionMethods
|
|
8
|
+
|
|
9
|
+
Defined in: src/JWTUtils.ts:55
|
|
10
|
+
|
|
11
|
+
Describes the different types of support compression methods for JWT payloads.
|
|
12
|
+
|
|
13
|
+
## Enumeration Members
|
|
14
|
+
|
|
15
|
+
### ZLIB
|
|
16
|
+
|
|
17
|
+
> **ZLIB**: `"zlib"`
|
|
18
|
+
|
|
19
|
+
Defined in: src/JWTUtils.ts:57
|
|
20
|
+
|
|
21
|
+
Uses the zlib compression method.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[**@rapidrest/core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/core](../README.md) / WorkerMessageType
|
|
6
|
+
|
|
7
|
+
# Enumeration: WorkerMessageType
|
|
8
|
+
|
|
9
|
+
Defined in: src/threads/ThreadWorker.ts:7
|
|
10
|
+
|
|
11
|
+
Describes the types of messages passed between the parent thread pool manager and a worker thread.
|
|
12
|
+
|
|
13
|
+
## Enumeration Members
|
|
14
|
+
|
|
15
|
+
### ERROR
|
|
16
|
+
|
|
17
|
+
> **ERROR**: `"_WorkerError"`
|
|
18
|
+
|
|
19
|
+
Defined in: src/threads/ThreadWorker.ts:8
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### LOG
|
|
24
|
+
|
|
25
|
+
> **LOG**: `"_WorkerLog"`
|
|
26
|
+
|
|
27
|
+
Defined in: src/threads/ThreadWorker.ts:9
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### ONLINE
|
|
32
|
+
|
|
33
|
+
> **ONLINE**: `"_WorkerOnline"`
|
|
34
|
+
|
|
35
|
+
Defined in: src/threads/ThreadWorker.ts:10
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### STOP
|
|
40
|
+
|
|
41
|
+
> **STOP**: `"_StopWorker"`
|
|
42
|
+
|
|
43
|
+
Defined in: src/threads/ThreadWorker.ts:11
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/core](../README.md) / sleep
|
|
6
|
+
|
|
7
|
+
# Function: sleep()
|
|
8
|
+
|
|
9
|
+
> **sleep**(`ms`): `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: src/sleep.ts:8
|
|
12
|
+
|
|
13
|
+
Starts a timer to suspend execution for a given number of milliseconds.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### ms
|
|
18
|
+
|
|
19
|
+
`number` = `1`
|
|
20
|
+
|
|
21
|
+
The number of milliseconds to suspend. Default is `1`.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`void`\>
|