@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.
Files changed (69) hide show
  1. package/dist/lib/ClassLoader.js +3 -2
  2. package/dist/lib/ClassLoader.js.map +1 -1
  3. package/dist/lib/JWTUtils.js +1 -0
  4. package/dist/lib/JWTUtils.js.map +1 -1
  5. package/dist/lib/StringUtils.js +3 -3
  6. package/dist/types/JWTUtils.d.ts +1 -0
  7. package/dist/types/StringUtils.d.ts +3 -3
  8. package/package.json +2 -7
  9. package/docs/Makefile +0 -20
  10. package/docs/conf.py +0 -58
  11. package/docs/index.rst +0 -17
  12. package/docs/make.bat +0 -35
  13. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/README.md +0 -21
  14. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +0 -33
  15. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +0 -27
  16. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +0 -33
  17. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +0 -33
  18. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +0 -27
  19. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +0 -27
  20. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +0 -25
  21. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +0 -31
  22. package/docs/reference/README.md +0 -35
  23. package/docs/reference/classes/AlertUtils.md +0 -158
  24. package/docs/reference/classes/ApiError.md +0 -251
  25. package/docs/reference/classes/ClassLoader.md +0 -224
  26. package/docs/reference/classes/Event.md +0 -109
  27. package/docs/reference/classes/EventUtils.md +0 -123
  28. package/docs/reference/classes/FileUtils.md +0 -193
  29. package/docs/reference/classes/JWTUtils.md +0 -139
  30. package/docs/reference/classes/MessagingUtils.md +0 -167
  31. package/docs/reference/classes/OASUtils.md +0 -227
  32. package/docs/reference/classes/ObjectFactory.md +0 -276
  33. package/docs/reference/classes/ObjectUtils.md +0 -60
  34. package/docs/reference/classes/StringUtils.md +0 -169
  35. package/docs/reference/classes/ThreadPool.md +0 -249
  36. package/docs/reference/classes/ThreadWorker.md +0 -91
  37. package/docs/reference/classes/UserUtils.md +0 -185
  38. package/docs/reference/classes/ValidationUtils.md +0 -294
  39. package/docs/reference/enumerations/AlertPriority.md +0 -61
  40. package/docs/reference/enumerations/JWTUtilsCompressionMethods.md +0 -21
  41. package/docs/reference/enumerations/WorkerMessageType.md +0 -43
  42. package/docs/reference/functions/sleep.md +0 -25
  43. package/docs/reference/globals.md +0 -73
  44. package/docs/reference/interfaces/Alert.md +0 -101
  45. package/docs/reference/interfaces/AlertAttachment.md +0 -51
  46. package/docs/reference/interfaces/AlertClose.md +0 -31
  47. package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +0 -42
  48. package/docs/reference/interfaces/AlertUtilsOptions.md +0 -41
  49. package/docs/reference/interfaces/InstanceOptions.md +0 -41
  50. package/docs/reference/interfaces/JWTPayload.md +0 -143
  51. package/docs/reference/interfaces/JWTUser.md +0 -55
  52. package/docs/reference/interfaces/JWTUtilsConfig.md +0 -45
  53. package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +0 -68
  54. package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +0 -40
  55. package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +0 -78
  56. package/docs/reference/interfaces/NewEvent.md +0 -25
  57. package/docs/reference/interfaces/OriginSettings.md +0 -25
  58. package/docs/reference/interfaces/SlackConfig.md +0 -33
  59. package/docs/reference/interfaces/SmtpAuth.md +0 -25
  60. package/docs/reference/interfaces/SmtpConfig.md +0 -41
  61. package/docs/reference/interfaces/Template.md +0 -105
  62. package/docs/reference/interfaces/TemplateMapBase.md +0 -13
  63. package/docs/reference/interfaces/TwilioConfig.md +0 -33
  64. package/docs/reference/interfaces/WorkerMessage.md +0 -31
  65. package/docs/reference/interfaces/WorkerOptions.md +0 -61
  66. package/docs/reference/type-aliases/BooleanFunc.md +0 -23
  67. package/docs/reference/type-aliases/TemplateMap.md +0 -17
  68. package/docs/reference/type-aliases/WorkerCallback.md +0 -31
  69. package/docs/reference/variables/Logger.md +0 -25
@@ -1,169 +0,0 @@
1
- [**@rapidrest/core**](../README.md)
2
-
3
- ***
4
-
5
- [@rapidrest/core](../globals.md) / StringUtils
6
-
7
- # Class: StringUtils
8
-
9
- Defined in: [src/StringUtils.ts:10](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/StringUtils.ts#L10)
10
-
11
- Utility functions for working with strings.
12
-
13
- ## Author
14
-
15
- Jean-Philippe Steinmetz
16
-
17
- ## Constructors
18
-
19
- ### Constructor
20
-
21
- > **new StringUtils**(): `StringUtils`
22
-
23
- #### Returns
24
-
25
- `StringUtils`
26
-
27
- ## Methods
28
-
29
- ### findAndReplace()
30
-
31
- > `static` **findAndReplace**(`contents`, `variables`): `string`
32
-
33
- Defined in: [src/StringUtils.ts:46](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/StringUtils.ts#L46)
34
-
35
- Performs a search and replace on the provided contents with the map of variable replacements. The contents
36
- must use Mustache formatted tokens such as `{{toreplace}}`.
37
-
38
- #### Parameters
39
-
40
- ##### contents
41
-
42
- `string`
43
-
44
- The stringt to perform the find and replace on.
45
-
46
- ##### variables
47
-
48
- `any`
49
-
50
- A map of key=>value pairs to search for and replace.
51
-
52
- #### Returns
53
-
54
- `string`
55
-
56
- ***
57
-
58
- ### getParameters()
59
-
60
- > `static` **getParameters**(`str`): `string`[]
61
-
62
- Defined in: [src/StringUtils.ts:18](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/StringUtils.ts#L18)
63
-
64
- Returns a list of all parameters contained within the string. A parameter is a bracket delimited substring
65
- (e.g. /my/{key}/with/{id}).
66
-
67
- #### Parameters
68
-
69
- ##### str
70
-
71
- `string`
72
-
73
- The string to search for parameters.
74
-
75
- #### Returns
76
-
77
- `string`[]
78
-
79
- A list of parameters contained in the provided string.
80
-
81
- ***
82
-
83
- ### replaceAll()
84
-
85
- > `static` **replaceAll**(`str`, `match`, `prefix`): `string`
86
-
87
- Defined in: [src/StringUtils.ts:87](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/StringUtils.ts#L87)
88
-
89
- Replaces all instances of the match regex pattern with the contents of the inner regular expression pattern for
90
- the given string.
91
-
92
- e.g.
93
-
94
- let result = replaceAll('/my/path/{id}', new RegExp('\{([^\}]+)\}'), ':');
95
- console.log(result); // -> /my/path/:id
96
-
97
- #### Parameters
98
-
99
- ##### str
100
-
101
- `string`
102
-
103
- The string to perform replacement on.
104
-
105
- ##### match
106
-
107
- `string` \| `RegExp`
108
-
109
- The regular expression pattern to match containing an outer and inner pattern.
110
-
111
- ##### prefix
112
-
113
- `string`
114
-
115
- The prefix to prepend the replacement text with.
116
-
117
- #### Returns
118
-
119
- `string`
120
-
121
- The fully replaced contents of the string.
122
-
123
- ***
124
-
125
- ### toCamelCase()
126
-
127
- > `static` **toCamelCase**(`str`): `string`
128
-
129
- Defined in: [src/StringUtils.ts:104](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/StringUtils.ts#L104)
130
-
131
- Converts the first character in the given string to be lowercase (e.g. myVariable).
132
-
133
- #### Parameters
134
-
135
- ##### str
136
-
137
- `string`
138
-
139
- The string to convert to camelCase.
140
-
141
- #### Returns
142
-
143
- `string`
144
-
145
- The string converted to camelCase.
146
-
147
- ***
148
-
149
- ### toPascalCase()
150
-
151
- > `static` **toPascalCase**(`str`): `string`
152
-
153
- Defined in: [src/StringUtils.ts:114](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/StringUtils.ts#L114)
154
-
155
- Converts the first character in the given string to be uppercase (e.g. MyVariable).
156
-
157
- #### Parameters
158
-
159
- ##### str
160
-
161
- `string`
162
-
163
- The string to convert to PascalCase.
164
-
165
- #### Returns
166
-
167
- `string`
168
-
169
- The string converted to PascalCase.
@@ -1,249 +0,0 @@
1
- [**@rapidrest/core**](../README.md)
2
-
3
- ***
4
-
5
- [@rapidrest/core](../globals.md) / ThreadPool
6
-
7
- # Class: ThreadPool
8
-
9
- Defined in: [src/threads/ThreadPool.ts:65](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L65)
10
-
11
- The `ThreadPool` class provides an interface for managing a pool of execution threads that can be used for parallel
12
- code execution. `ThreadPool` is a wrapper to the `worker_threads` API to add support for multiple `Worker` instances.
13
- By default, the pool will create *n* workers corresponding to the number of CPUs (physical + virtual) on the system.
14
-
15
- There are two ways to start worker threads with the pool.
16
-
17
- The first way is to set the `entry` option when calling the `start()` function. This will create a instance of the
18
- `worker_threads` APIs `Worker` class with the specified file as the entry point. Note that this file must be of
19
- type JavaScript (`.js` extension) as the underlying system does not support loading TypeScript. If the `args` option
20
- is set, the value will be passed in as the `workerData` to the entry file.
21
-
22
- The second way to start a worker thread is by setting the `worker` argument when calling the `start()` function. The
23
- specified `worker` file must contain a `default` export. The `default` export must be a class definition which
24
- extends the `ThreadWorker` abstract class interface. The file can be either JavaScript or TypeScript. When using
25
- this method the `start()` function will return only when all worker instances in each thread of the pool has
26
- successfully returned from its `start()` function. When the `args` option is set, the value(s) will be passed in to
27
- the constructor on instantiation by the thread executor.
28
-
29
- When the `restartOnExit` option is specified, the pool will automatically recreate and start a worker thread on
30
- the `exit event`.
31
-
32
- This class exposes worker messages via the `on()` callback handler function. Registering a callback handler via
33
- `on()` will propogate all messages from all underlying threads in the pool.
34
-
35
- ## Author
36
-
37
- Jean-Philippe Steinmetz
38
-
39
- ## Constructors
40
-
41
- ### Constructor
42
-
43
- > **new ThreadPool**(`max?`, `logger?`): `ThreadPool`
44
-
45
- Defined in: [src/threads/ThreadPool.ts:101](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L101)
46
-
47
- Creates a new `ThreadPool` instance with the specified defaults.
48
-
49
- #### Parameters
50
-
51
- ##### max?
52
-
53
- `number` = `0`
54
-
55
- The maximum number of threads to create. Default is `os.cpus().length`.
56
-
57
- ##### logger?
58
-
59
- `any`
60
-
61
- The Winston logger instance to forward all worker thread logs to.
62
-
63
- #### Returns
64
-
65
- `ThreadPool`
66
-
67
- ## Properties
68
-
69
- ### workers
70
-
71
- > `readonly` **workers**: `Worker`[]
72
-
73
- Defined in: [src/threads/ThreadPool.ts:77](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L77)
74
-
75
- The list of active worker threads.
76
-
77
- ## Accessors
78
-
79
- ### max
80
-
81
- #### Get Signature
82
-
83
- > **get** **max**(): `number`
84
-
85
- Defined in: [src/threads/ThreadPool.ts:84](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L84)
86
-
87
- The maximum number of threads that can be created by the pool.
88
-
89
- ##### Returns
90
-
91
- `number`
92
-
93
- ***
94
-
95
- ### size
96
-
97
- #### Get Signature
98
-
99
- > **get** **size**(): `number`
100
-
101
- Defined in: [src/threads/ThreadPool.ts:91](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L91)
102
-
103
- The number of active threads in the pool.
104
-
105
- ##### Returns
106
-
107
- `number`
108
-
109
- ## Methods
110
-
111
- ### on()
112
-
113
- > **on**(`type`, `func`): `void`
114
-
115
- Defined in: [src/threads/ThreadPool.ts:255](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L255)
116
-
117
- Registers a new callback function to be notified when the given event type is fired.
118
-
119
- #### Parameters
120
-
121
- ##### type
122
-
123
- `string`
124
-
125
- The event type to be notified of. Possible values are: `error`, `exit` and `message`.
126
-
127
- ##### func
128
-
129
- [`WorkerCallback`](../type-aliases/WorkerCallback.md)
130
-
131
- The callback function to register.
132
-
133
- #### Returns
134
-
135
- `void`
136
-
137
- ***
138
-
139
- ### send()
140
-
141
- > **send**(`msg`): `void`
142
-
143
- Defined in: [src/threads/ThreadPool.ts:268](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L268)
144
-
145
- Sends the provided message to the next available worker thread. Messages are sent in a round-robin order.
146
-
147
- #### Parameters
148
-
149
- ##### msg
150
-
151
- `any`
152
-
153
- The message to send the next available worker thread.
154
-
155
- #### Returns
156
-
157
- `void`
158
-
159
- ***
160
-
161
- ### sendAll()
162
-
163
- > **sendAll**(`msg`): `void`
164
-
165
- Defined in: [src/threads/ThreadPool.ts:289](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L289)
166
-
167
- Sends the provided message to all worker threads in the pool.
168
-
169
- #### Parameters
170
-
171
- ##### msg
172
-
173
- `any`
174
-
175
- The message to send to all workers.
176
-
177
- #### Returns
178
-
179
- `void`
180
-
181
- ***
182
-
183
- ### sendTo()
184
-
185
- > **sendTo**(`id`, `msg`): `void`
186
-
187
- Defined in: [src/threads/ThreadPool.ts:300](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L300)
188
-
189
- Sends the provided message to the worker thread with the specified id.
190
-
191
- #### Parameters
192
-
193
- ##### id
194
-
195
- `number`
196
-
197
- The id of the thread to send the message to.
198
-
199
- ##### msg
200
-
201
- `any`
202
-
203
- The message to send the next available worker thread.
204
-
205
- #### Returns
206
-
207
- `void`
208
-
209
- ***
210
-
211
- ### start()
212
-
213
- > **start**(`options?`, `num?`): `Promise`\<`void`\>
214
-
215
- Defined in: [src/threads/ThreadPool.ts:181](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L181)
216
-
217
- Initializes the thread pool with the initial worker threads and begins execution.
218
-
219
- #### Parameters
220
-
221
- ##### options?
222
-
223
- [`WorkerOptions`](../interfaces/WorkerOptions.md)
224
-
225
- The options to use when creating the worker thread.
226
-
227
- ##### num?
228
-
229
- `number` = `...`
230
-
231
- The number of initial threads to create, cannot be greater than max. Default is `max`.
232
-
233
- #### Returns
234
-
235
- `Promise`\<`void`\>
236
-
237
- ***
238
-
239
- ### stop()
240
-
241
- > **stop**(): `Promise`\<`void`\>
242
-
243
- Defined in: [src/threads/ThreadPool.ts:228](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadPool.ts#L228)
244
-
245
- Stops all running thread executions.
246
-
247
- #### Returns
248
-
249
- `Promise`\<`void`\>
@@ -1,91 +0,0 @@
1
- [**@rapidrest/core**](../README.md)
2
-
3
- ***
4
-
5
- [@rapidrest/core](../globals.md) / ThreadWorker
6
-
7
- # Abstract Class: ThreadWorker
8
-
9
- Defined in: [src/threads/ThreadWorker.ts:29](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadWorker.ts#L29)
10
-
11
- Provides a simple abstract interface for creating thread workers when using the `ThreadPool` system.
12
-
13
- ## Author
14
-
15
- Jean-Philippe Steinmetz
16
-
17
- ## Constructors
18
-
19
- ### Constructor
20
-
21
- > **new ThreadWorker**(`logger`): `ThreadWorker`
22
-
23
- Defined in: [src/threads/ThreadWorker.ts:32](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadWorker.ts#L32)
24
-
25
- #### Parameters
26
-
27
- ##### logger
28
-
29
- `any`
30
-
31
- #### Returns
32
-
33
- `ThreadWorker`
34
-
35
- ## Properties
36
-
37
- ### logger
38
-
39
- > `protected` **logger**: `any`
40
-
41
- Defined in: [src/threads/ThreadWorker.ts:30](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadWorker.ts#L30)
42
-
43
- ## Methods
44
-
45
- ### onMessage()
46
-
47
- > `abstract` **onMessage**(`msg`): `void` \| `Promise`\<`void`\>
48
-
49
- Defined in: [src/threads/ThreadWorker.ts:41](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadWorker.ts#L41)
50
-
51
- Callback function when a message is received from the thread pool manager.
52
-
53
- #### Parameters
54
-
55
- ##### msg
56
-
57
- [`WorkerMessage`](../interfaces/WorkerMessage.md)
58
-
59
- The message that was received.
60
-
61
- #### Returns
62
-
63
- `void` \| `Promise`\<`void`\>
64
-
65
- ***
66
-
67
- ### start()
68
-
69
- > `abstract` **start**(): `void` \| `Promise`\<`void`\>
70
-
71
- Defined in: [src/threads/ThreadWorker.ts:46](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadWorker.ts#L46)
72
-
73
- Starts execution of the thread worker.
74
-
75
- #### Returns
76
-
77
- `void` \| `Promise`\<`void`\>
78
-
79
- ***
80
-
81
- ### stop()
82
-
83
- > `abstract` **stop**(): `void` \| `Promise`\<`void`\>
84
-
85
- Defined in: [src/threads/ThreadWorker.ts:51](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/threads/ThreadWorker.ts#L51)
86
-
87
- Stops execution of all work and shuts down the thread worker.
88
-
89
- #### Returns
90
-
91
- `void` \| `Promise`\<`void`\>
@@ -1,185 +0,0 @@
1
- [**@rapidrest/core**](../README.md)
2
-
3
- ***
4
-
5
- [@rapidrest/core](../globals.md) / UserUtils
6
-
7
- # Class: UserUtils
8
-
9
- Defined in: [src/UserUtils.ts:16](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/UserUtils.ts#L16)
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:60](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/UserUtils.ts#L60)
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](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/UserUtils.ts#L22)
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](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/UserUtils.ts#L39)
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
- ### hasRole()
122
-
123
- > `static` **hasRole**(`user`, `role?`, `orgUid?`): `boolean`
124
-
125
- Defined in: [src/UserUtils.ts:82](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/UserUtils.ts#L82)
126
-
127
- Returns `true` if the given user object has a role with the specified name, otherwise returns `false`.
128
-
129
- #### Parameters
130
-
131
- ##### user
132
-
133
- `any`
134
-
135
- The user object to inspect.
136
-
137
- ##### role?
138
-
139
- `string`
140
-
141
- The unique name of the role to search for.
142
-
143
- ##### orgUid?
144
-
145
- `string`
146
-
147
- The unique identifier of an organization whose role will be verified.
148
-
149
- #### Returns
150
-
151
- `boolean`
152
-
153
- ***
154
-
155
- ### hasRoles()
156
-
157
- > `static` **hasRoles**(`user`, `roles?`, `orgUid?`): `boolean`
158
-
159
- Defined in: [src/UserUtils.ts:107](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/UserUtils.ts#L107)
160
-
161
- Returns `true` if the given user object has at least one role from the specified list of names, otherwise returns `false`.
162
-
163
- #### Parameters
164
-
165
- ##### user
166
-
167
- `any`
168
-
169
- The user object to inspect.
170
-
171
- ##### roles?
172
-
173
- `string`[]
174
-
175
- A list of unique names of the roles to search for.
176
-
177
- ##### orgUid?
178
-
179
- `string`
180
-
181
- The unique identifier of an organization whose role will be verified.
182
-
183
- #### Returns
184
-
185
- `boolean`