@rapidrest/core 1.2.0 → 1.3.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.
Files changed (81) hide show
  1. package/dist/lib/ClassLoader.js +6 -4
  2. package/dist/lib/ClassLoader.js.map +1 -1
  3. package/dist/lib/JWTUtils.js +102 -5
  4. package/dist/lib/JWTUtils.js.map +1 -1
  5. package/dist/lib/Logger.js +9 -2
  6. package/dist/lib/Logger.js.map +1 -1
  7. package/dist/lib/MessagingUtils.js +27 -22
  8. package/dist/lib/MessagingUtils.js.map +1 -1
  9. package/dist/lib/NotificationsUtils.js +4 -2
  10. package/dist/lib/NotificationsUtils.js.map +1 -1
  11. package/dist/lib/OASUtils.js +17 -3
  12. package/dist/lib/OASUtils.js.map +1 -1
  13. package/dist/lib/ObjectFactory.js +95 -77
  14. package/dist/lib/ObjectFactory.js.map +1 -1
  15. package/dist/lib/StringUtils.js +16 -12
  16. package/dist/lib/StringUtils.js.map +1 -1
  17. package/dist/lib/TelemetryUtils.js +2 -2
  18. package/dist/lib/TelemetryUtils.js.map +1 -1
  19. package/dist/lib/threads/ThreadPool.js +17 -8
  20. package/dist/lib/threads/ThreadPool.js.map +1 -1
  21. package/dist/types/JWTUtils.d.ts +22 -3
  22. package/dist/types/Logger.d.ts +1 -1
  23. package/dist/types/MessagingUtils.d.ts +4 -0
  24. package/dist/types/OASUtils.d.ts +2 -0
  25. package/dist/types/ObjectFactory.d.ts +6 -0
  26. package/dist/types/TelemetryUtils.d.ts +1 -1
  27. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +1 -1
  28. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +1 -1
  29. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +1 -1
  30. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +1 -1
  31. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +1 -1
  32. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +1 -1
  33. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +1 -1
  34. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +1 -1
  35. package/docs/reference/classes/AlertUtils.md +6 -6
  36. package/docs/reference/classes/ApiError.md +5 -5
  37. package/docs/reference/classes/ClassLoader.md +34 -34
  38. package/docs/reference/classes/Event.md +8 -8
  39. package/docs/reference/classes/EventUtils.md +6 -6
  40. package/docs/reference/classes/FileUtils.md +5 -5
  41. package/docs/reference/classes/JWTUtils.md +61 -13
  42. package/docs/reference/classes/MessagingUtils.md +8 -8
  43. package/docs/reference/classes/OASUtils.md +22 -8
  44. package/docs/reference/classes/ObjectFactory.md +14 -14
  45. package/docs/reference/classes/ObjectUtils.md +2 -2
  46. package/docs/reference/classes/StringUtils.md +6 -6
  47. package/docs/reference/classes/ThreadPool.md +11 -11
  48. package/docs/reference/classes/ThreadWorker.md +6 -6
  49. package/docs/reference/classes/UserUtils.md +6 -6
  50. package/docs/reference/classes/ValidationUtils.md +14 -14
  51. package/docs/reference/enumerations/AlertPriority.md +6 -6
  52. package/docs/reference/enumerations/JWTUtilsCompressionMethods.md +2 -2
  53. package/docs/reference/enumerations/WorkerMessageType.md +5 -5
  54. package/docs/reference/functions/sleep.md +1 -1
  55. package/docs/reference/interfaces/Alert.md +10 -10
  56. package/docs/reference/interfaces/AlertAttachment.md +5 -5
  57. package/docs/reference/interfaces/AlertClose.md +3 -3
  58. package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +4 -4
  59. package/docs/reference/interfaces/AlertUtilsOptions.md +4 -4
  60. package/docs/reference/interfaces/InstanceOptions.md +4 -4
  61. package/docs/reference/interfaces/JWTPayload.md +5 -5
  62. package/docs/reference/interfaces/JWTUser.md +5 -5
  63. package/docs/reference/interfaces/JWTUtilsConfig.md +4 -4
  64. package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +5 -5
  65. package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +3 -3
  66. package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +6 -6
  67. package/docs/reference/interfaces/NewEvent.md +2 -2
  68. package/docs/reference/interfaces/OriginSettings.md +3 -3
  69. package/docs/reference/interfaces/SlackConfig.md +4 -4
  70. package/docs/reference/interfaces/SmtpAuth.md +3 -3
  71. package/docs/reference/interfaces/SmtpConfig.md +5 -5
  72. package/docs/reference/interfaces/Template.md +13 -13
  73. package/docs/reference/interfaces/TemplateMapBase.md +1 -1
  74. package/docs/reference/interfaces/TwilioConfig.md +4 -4
  75. package/docs/reference/interfaces/WorkerMessage.md +3 -3
  76. package/docs/reference/interfaces/WorkerOptions.md +6 -6
  77. package/docs/reference/type-aliases/BooleanFunc.md +1 -1
  78. package/docs/reference/type-aliases/TemplateMap.md +1 -1
  79. package/docs/reference/type-aliases/WorkerCallback.md +1 -1
  80. package/docs/reference/variables/Logger.md +2 -2
  81. package/package.json +2 -2
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **Validator**(`func`): (`target`, `propertyKey`) => `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:108](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/decorators/ObjectDecorators.ts#L108)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:108](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L108)
12
12
 
13
13
  Apply this to a property to specify the function that will be used to perform validation of the value.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **ValidatorFunction** = (`value`) => `any`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:101](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/decorators/ObjectDecorators.ts#L101)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:101](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L101)
12
12
 
13
13
  A function used to validate a property value.
14
14
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: AlertUtils
8
8
 
9
- Defined in: [src/AlertUtils.ts:116](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/AlertUtils.ts#L116)
9
+ Defined in: [src/AlertUtils.ts:116](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L116)
10
10
 
11
11
  The `AlertUtils` class is used to send alerts about important system events that have occurred
12
12
  and require further monitoring or intervention.
@@ -17,7 +17,7 @@ and require further monitoring or intervention.
17
17
 
18
18
  > **new AlertUtils**(`options`): `AlertUtils`
19
19
 
20
- Defined in: [src/AlertUtils.ts:128](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/AlertUtils.ts#L128)
20
+ Defined in: [src/AlertUtils.ts:128](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L128)
21
21
 
22
22
  Creates a new instance of `AuthUtils` with the provided defaults.
23
23
 
@@ -39,7 +39,7 @@ The configuration options to use.
39
39
 
40
40
  > **addAttachment**(`id`, `attachment`, `indexFile?`): `Promise`\<`boolean`\>
41
41
 
42
- Defined in: [src/AlertUtils.ts:298](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/AlertUtils.ts#L298)
42
+ Defined in: [src/AlertUtils.ts:298](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L298)
43
43
 
44
44
  Uploads a single attachment to the alert with the given unique identifier.
45
45
 
@@ -75,7 +75,7 @@ True if the operation was successful, otherwise false.
75
75
 
76
76
  > **close**(`id`, `data?`): `Promise`\<`boolean`\>
77
77
 
78
- Defined in: [src/AlertUtils.ts:139](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/AlertUtils.ts#L139)
78
+ Defined in: [src/AlertUtils.ts:139](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L139)
79
79
 
80
80
  Attempts to close the existing alert with the given identifier.
81
81
 
@@ -103,7 +103,7 @@ True if the operation was successful, otherwise false.
103
103
 
104
104
  > **get**(`id`): `Promise`\<[`Alert`](../interfaces/Alert.md) \| `null`\>
105
105
 
106
- Defined in: [src/AlertUtils.ts:167](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/AlertUtils.ts#L167)
106
+ Defined in: [src/AlertUtils.ts:167](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L167)
107
107
 
108
108
  Attempts to retrieve the existing alert with the given identifier.
109
109
 
@@ -127,7 +127,7 @@ The retrieved alert if successful, otherwise `null`.
127
127
 
128
128
  > **send**(`alert`, `vars?`, `attachments?`): `Promise`\<`string` \| `null`\>
129
129
 
130
- Defined in: [src/AlertUtils.ts:191](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/AlertUtils.ts#L191)
130
+ Defined in: [src/AlertUtils.ts:191](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/AlertUtils.ts#L191)
131
131
 
132
132
  Sends the provided alert to the configured monitoring service.
133
133
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: ApiError
8
8
 
9
- Defined in: [src/ApiError.ts:8](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ApiError.ts#L8)
9
+ Defined in: [src/ApiError.ts:8](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ApiError.ts#L8)
10
10
 
11
11
  Describes an error that originates from a API service. This class extends the standard `Error` class to include
12
12
  a unique code that can be used to trace an error to source code as well as the HTTP response status returned with
@@ -22,7 +22,7 @@ the error.
22
22
 
23
23
  > **new ApiError**(`code`, `status`, `message?`, `templateVariables?`): `ApiError`
24
24
 
25
- Defined in: [src/ApiError.ts:24](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ApiError.ts#L24)
25
+ Defined in: [src/ApiError.ts:24](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ApiError.ts#L24)
26
26
 
27
27
  #### Parameters
28
28
 
@@ -56,7 +56,7 @@ Defined in: [src/ApiError.ts:24](https://github.com/rapidrest/core/blob/0eb0ed11
56
56
 
57
57
  > **code**: `string`
58
58
 
59
- Defined in: [src/ApiError.ts:10](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ApiError.ts#L10)
59
+ Defined in: [src/ApiError.ts:10](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ApiError.ts#L10)
60
60
 
61
61
  The unique code of the error.
62
62
 
@@ -102,7 +102,7 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
102
102
 
103
103
  > **status**: `number`
104
104
 
105
- Defined in: [src/ApiError.ts:12](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ApiError.ts#L12)
105
+ Defined in: [src/ApiError.ts:12](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ApiError.ts#L12)
106
106
 
107
107
  The HTTP status associated with the error.
108
108
 
@@ -134,7 +134,7 @@ not capture any frames.
134
134
 
135
135
  > **ApiMessageTemplate**(`message`, `templateVariables?`): `string`
136
136
 
137
- Defined in: [src/ApiError.ts:14](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ApiError.ts#L14)
137
+ Defined in: [src/ApiError.ts:14](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ApiError.ts#L14)
138
138
 
139
139
  #### Parameters
140
140
 
@@ -6,45 +6,45 @@
6
6
 
7
7
  # Class: ClassLoader
8
8
 
9
- Defined in: [src/ClassLoader.ts:48](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L48)
9
+ Defined in: [src/ClassLoader.ts:51](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L51)
10
10
 
11
- The *ClassLoader* provides a container for dynamically loading classes at runtime using C#/Java style namespaces.
11
+ The *ClassLoader* provides a container for dynamically loading classes at runtime using C#/Java style namespaces.
12
12
  Namespaces are determined from the folder structure relative to the root.
13
13
 
14
- Class names are derived either directly from the modules export name or inferred from the module's file path when
14
+ Class names are derived either directly from the modules export name or inferred from the module's file path when
15
15
  the `default` export is used.
16
16
 
17
- For example, given the following example TypeScript module at relative path `com/company/MyClass.ts` would register
17
+ For example, given the following example TypeScript module at relative path `com/company/MyClass.ts` would register
18
18
  a class with fully qualified name `com.company.MyClass`.
19
19
 
20
- ```javascript
21
- export default class MyClass {
22
- // ...
23
- }
20
+ ```javascript
21
+ export default class MyClass {
22
+ // ...
23
+ }
24
24
  ```
25
25
 
26
- In the event that multiple exports are defined, the fully qualified name will take on the export name instead of the
27
- module name. Thus, the following example module at relative path `com/company/MyClasses.ts` would register the following
28
- classes.
29
- - `com.company.MyClass`
26
+ In the event that multiple exports are defined, the fully qualified name will take on the export name instead of the
27
+ module name. Thus, the following example module at relative path `com/company/MyClasses.ts` would register the following
28
+ classes.
29
+ - `com.company.MyClass`
30
30
  - `com.company.MyEnum`
31
31
 
32
- ```javascript
33
- export class MyClass {
34
- // ...
32
+ ```javascript
33
+ export class MyClass {
34
+ // ...
35
35
  }
36
36
 
37
- export enum MyEnum {
38
- // ...
39
- }
37
+ export enum MyEnum {
38
+ // ...
39
+ }
40
40
  ```
41
41
 
42
- **IMPORTANT**: If you use *ClassLoader* to dynamically load TypeScript files (.ts, .cts, .mts, etc.) at runtime using
43
- an ESM-only project you must use the `ts-node/esm` module loader. This can be specified by passing the `--loader` to
42
+ **IMPORTANT**: If you use *ClassLoader* to dynamically load TypeScript files (.ts, .cts, .mts, etc.) at runtime using
43
+ an ESM-only project you must use the `ts-node/esm` module loader. This can be specified by passing the `--loader` to
44
44
  node at runtime.
45
45
 
46
- ```
47
- node --loader ts-node/esm <module>
46
+ ```
47
+ node --loader ts-node/esm <module>
48
48
  ```
49
49
 
50
50
  ## Author
@@ -57,7 +57,7 @@ Jean-Philippe Steinmetz
57
57
 
58
58
  > **new ClassLoader**(`rootDir`, `includeJavaScript?`, `includeTypeScript?`, `ignore?`): `ClassLoader`
59
59
 
60
- Defined in: [src/ClassLoader.ts:67](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L67)
60
+ Defined in: [src/ClassLoader.ts:70](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L70)
61
61
 
62
62
  Creates a new instance of `ClassLoader` with the specified defaults.
63
63
 
@@ -73,7 +73,7 @@ The root directory to load all classes from.
73
73
 
74
74
  `boolean` = `true`
75
75
 
76
- Set to `true` to load all TypeScript classes from the given `rootDir`, otherwise set to `false.
76
+ Set to `true` to load all TypeScript classes from the given `rootDir`, otherwise set to `false.
77
77
  @param includeTypeScript Set to `true` to load all JavaScript classes from the given `rootDir`, otherwise set to `false.
78
78
 
79
79
  ##### includeTypeScript?
@@ -96,7 +96,7 @@ A list of regex pattern of file paths to ignore.
96
96
 
97
97
  > `protected` **classes**: `Map`\<`string`, `any`\>
98
98
 
99
- Defined in: [src/ClassLoader.ts:50](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L50)
99
+ Defined in: [src/ClassLoader.ts:53](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L53)
100
100
 
101
101
  The map containnig all loaded classes.
102
102
 
@@ -106,7 +106,7 @@ The map containnig all loaded classes.
106
106
 
107
107
  > `protected` **ignore**: (`string` \| `RegExp`)[] = `[]`
108
108
 
109
- Defined in: [src/ClassLoader.ts:51](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L51)
109
+ Defined in: [src/ClassLoader.ts:54](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L54)
110
110
 
111
111
  ***
112
112
 
@@ -114,7 +114,7 @@ Defined in: [src/ClassLoader.ts:51](https://github.com/rapidrest/core/blob/0eb0e
114
114
 
115
115
  > `protected` **includeJavaScript**: `boolean` = `true`
116
116
 
117
- Defined in: [src/ClassLoader.ts:55](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L55)
117
+ Defined in: [src/ClassLoader.ts:58](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L58)
118
118
 
119
119
  Indicates if JavaScript classes should be loaded.
120
120
 
@@ -124,7 +124,7 @@ Indicates if JavaScript classes should be loaded.
124
124
 
125
125
  > `protected` **includeTypeScript**: `boolean` = `true`
126
126
 
127
- Defined in: [src/ClassLoader.ts:53](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L53)
127
+ Defined in: [src/ClassLoader.ts:56](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L56)
128
128
 
129
129
  Indicates if TypeScript classes should be loaded.
130
130
 
@@ -134,7 +134,7 @@ Indicates if TypeScript classes should be loaded.
134
134
 
135
135
  > `protected` **rootDir**: `string` = `"."`
136
136
 
137
- Defined in: [src/ClassLoader.ts:57](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L57)
137
+ Defined in: [src/ClassLoader.ts:60](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L60)
138
138
 
139
139
  The path to the root directory containing all classes on disk.
140
140
 
@@ -144,7 +144,7 @@ The path to the root directory containing all classes on disk.
144
144
 
145
145
  > **getClass**(`fqn`): `any`
146
146
 
147
- Defined in: [src/ClassLoader.ts:80](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L80)
147
+ Defined in: [src/ClassLoader.ts:83](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L83)
148
148
 
149
149
  Returns the class with the specified fully qualified name.
150
150
 
@@ -168,7 +168,7 @@ The class definition for the given fully qualified name if found, otherwise `und
168
168
 
169
169
  > **getClasses**(): `Map`\<`string`, `any`\>
170
170
 
171
- Defined in: [src/ClassLoader.ts:87](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L87)
171
+ Defined in: [src/ClassLoader.ts:90](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L90)
172
172
 
173
173
  Returns the map containing all classes that have been loaded.
174
174
 
@@ -182,7 +182,7 @@ Returns the map containing all classes that have been loaded.
182
182
 
183
183
  > **hasClass**(`fqn`): `any`
184
184
 
185
- Defined in: [src/ClassLoader.ts:97](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L97)
185
+ Defined in: [src/ClassLoader.ts:100](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L100)
186
186
 
187
187
  Returns `true` if a class exists with the specified fully qualified name.
188
188
 
@@ -206,9 +206,9 @@ The fully qualified name of the class to search.
206
206
 
207
207
  > **load**(`dir?`): `Promise`\<`void`\>
208
208
 
209
- Defined in: [src/ClassLoader.ts:107](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L107)
209
+ Defined in: [src/ClassLoader.ts:110](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/ClassLoader.ts#L110)
210
210
 
211
- Loads all modules exports contained in the directory specified. The folder must be a child
211
+ Loads all modules exports contained in the directory specified. The folder must be a child
212
212
  directory to the `rootDir` parameter passed in to the constructor.
213
213
 
214
214
  #### Parameters
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: Event
8
8
 
9
- Defined in: [src/TelemetryUtils.ts:23](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L23)
9
+ Defined in: [src/TelemetryUtils.ts:23](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L23)
10
10
 
11
11
  Describes a single telemetry event. A telemetry event is when something occurs in the system.
12
12
 
@@ -24,7 +24,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
24
24
 
25
25
  > **new Event**(`config`, `userId`, `data`): `Event`
26
26
 
27
- Defined in: [src/TelemetryUtils.ts:54](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L54)
27
+ Defined in: [src/TelemetryUtils.ts:54](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L54)
28
28
 
29
29
  #### Parameters
30
30
 
@@ -50,7 +50,7 @@ Defined in: [src/TelemetryUtils.ts:54](https://github.com/rapidrest/core/blob/0e
50
50
 
51
51
  > `readonly` **environment**: `string`
52
52
 
53
- Defined in: [src/TelemetryUtils.ts:32](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L32)
53
+ Defined in: [src/TelemetryUtils.ts:32](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L32)
54
54
 
55
55
  The name of the environment that the event originated from. This is typically `dev` or `prod`.
56
56
 
@@ -60,7 +60,7 @@ The name of the environment that the event originated from. This is typically `d
60
60
 
61
61
  > `readonly` **origin**: `string`
62
62
 
63
- Defined in: [src/TelemetryUtils.ts:37](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L37)
63
+ Defined in: [src/TelemetryUtils.ts:37](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L37)
64
64
 
65
65
  The unique name of the service or client that the event originated from.
66
66
 
@@ -70,7 +70,7 @@ The unique name of the service or client that the event originated from.
70
70
 
71
71
  > `readonly` **timestamp**: `Date`
72
72
 
73
- Defined in: [src/TelemetryUtils.ts:42](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L42)
73
+ Defined in: [src/TelemetryUtils.ts:42](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L42)
74
74
 
75
75
  The date and time that the event occured.
76
76
 
@@ -80,7 +80,7 @@ The date and time that the event occured.
80
80
 
81
81
  > `readonly` **type**: `string`
82
82
 
83
- Defined in: [src/TelemetryUtils.ts:47](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L47)
83
+ Defined in: [src/TelemetryUtils.ts:47](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L47)
84
84
 
85
85
  The type of event being recorded.
86
86
 
@@ -94,7 +94,7 @@ The type of event being recorded.
94
94
 
95
95
  > `readonly` **uid**: `string`
96
96
 
97
- Defined in: [src/TelemetryUtils.ts:27](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L27)
97
+ Defined in: [src/TelemetryUtils.ts:27](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L27)
98
98
 
99
99
  The universally unique identifier of the event.
100
100
 
@@ -104,6 +104,6 @@ The universally unique identifier of the event.
104
104
 
105
105
  > `readonly` **userId**: `string`
106
106
 
107
- Defined in: [src/TelemetryUtils.ts:52](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L52)
107
+ Defined in: [src/TelemetryUtils.ts:52](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L52)
108
108
 
109
109
  The universally unique identifer of the user that sent the event.
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: EventUtils
8
8
 
9
- Defined in: [src/TelemetryUtils.ts:84](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L84)
9
+ Defined in: [src/TelemetryUtils.ts:84](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L84)
10
10
 
11
11
  Provides a common set of static functions for recording and working with telemetry `Event` instances.
12
12
 
@@ -35,9 +35,9 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
35
35
 
36
36
  ### init()
37
37
 
38
- > `static` **init**(`config`, `logger`, `jwtToken`): `void`
38
+ > `static` **init**(`config`, `logger`, `jwtToken`): `Promise`\<`void`\>
39
39
 
40
- Defined in: [src/TelemetryUtils.ts:99](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L99)
40
+ Defined in: [src/TelemetryUtils.ts:99](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L99)
41
41
 
42
42
  Initializes `EventUtils` with the provided defaults.
43
43
 
@@ -63,7 +63,7 @@ The user's JWT token to send telemetry events on behalf of.
63
63
 
64
64
  #### Returns
65
65
 
66
- `void`
66
+ `Promise`\<`void`\>
67
67
 
68
68
  ***
69
69
 
@@ -71,7 +71,7 @@ The user's JWT token to send telemetry events on behalf of.
71
71
 
72
72
  > `static` **on**(`type`, `callback`): `void`
73
73
 
74
- Defined in: [src/TelemetryUtils.ts:173](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L173)
74
+ Defined in: [src/TelemetryUtils.ts:173](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L173)
75
75
 
76
76
  Registers a `callback` function to receive notifications of recorded events of the given `type`. Note that only
77
77
  events originating from the same application or service will be notified.
@@ -100,7 +100,7 @@ The function to call when an event is recorded.
100
100
 
101
101
  > `static` **record**(`evt`, `type?`): `Promise`\<`void`\>
102
102
 
103
- Defined in: [src/TelemetryUtils.ts:118](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/TelemetryUtils.ts#L118)
103
+ Defined in: [src/TelemetryUtils.ts:118](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/TelemetryUtils.ts#L118)
104
104
 
105
105
  Sends the given event to the telemetry service for permanent recording.
106
106
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: FileUtils
8
8
 
9
- Defined in: [src/FileUtils.ts:17](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/FileUtils.ts#L17)
9
+ Defined in: [src/FileUtils.ts:17](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/FileUtils.ts#L17)
10
10
 
11
11
  Utility functions for working with files.
12
12
 
@@ -30,7 +30,7 @@ Jean-Philippe Steinmetz
30
30
 
31
31
  > `static` **copyBinaryFile**(`srcPath`, `outPath`, `variables?`): `Promise`\<`void`\>
32
32
 
33
- Defined in: [src/FileUtils.ts:159](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/FileUtils.ts#L159)
33
+ Defined in: [src/FileUtils.ts:159](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/FileUtils.ts#L159)
34
34
 
35
35
  Generates a copy of the source file at the desired output destination using binary copy mode.
36
36
 
@@ -64,7 +64,7 @@ The map of variable names to values to swap. Applies to outPath only.
64
64
 
65
65
  > `static` **copyDirectory**(`srcPath`, `outPath`, `vars?`, `excludeFilters?`, `binaryFilters?`, `force?`): `Promise`\<`void`\>
66
66
 
67
- Defined in: [src/FileUtils.ts:187](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/FileUtils.ts#L187)
67
+ Defined in: [src/FileUtils.ts:187](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/FileUtils.ts#L187)
68
68
 
69
69
  Performs a deep copy of a directory tree at the given srcPath to the specified output directory. Performs
70
70
  template replacement for all variables given and skips any files in the specified filter.
@@ -117,7 +117,7 @@ Set to `true` to force writing over any existing files.
117
117
 
118
118
  > `static` **copyFile**(`srcPath`, `outPath`, `variables?`, `overwrite?`): `Promise`\<`void`\>
119
119
 
120
- Defined in: [src/FileUtils.ts:123](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/FileUtils.ts#L123)
120
+ Defined in: [src/FileUtils.ts:123](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/FileUtils.ts#L123)
121
121
 
122
122
  Generates a copy of the source file at the desired output destination and performs a swap of all values of the
123
123
  variables specified.
@@ -156,7 +156,7 @@ The map of variable names to values to swap.
156
156
 
157
157
  > `static` **writeFile**(`srcPath`, `outPath`, `contents`, `overwrite?`): `Promise`\<`void`\>
158
158
 
159
- Defined in: [src/FileUtils.ts:28](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/FileUtils.ts#L28)
159
+ Defined in: [src/FileUtils.ts:28](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/FileUtils.ts#L28)
160
160
 
161
161
  Attempts to write the provided contents to the file path given. If a file already exists the user is prompted to
162
162
  allow the file to be overwritten or merged. In the case of a merge, srcPath is used as a baseline in order to
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: JWTUtils
8
8
 
9
- Defined in: [src/JWTUtils.ts:145](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/JWTUtils.ts#L145)
9
+ Defined in: [src/JWTUtils.ts:145](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/JWTUtils.ts#L145)
10
10
 
11
11
  Utility class for working with Json Web Token (JWT) authentication tokens.
12
12
 
@@ -28,12 +28,9 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
28
28
 
29
29
  ### createToken()
30
30
 
31
- > `static` **createToken**(`config`, `user`, `data?`): `string`
31
+ > `static` **createToken**(`config`, `user`, `data?`): `Promise`\<`string`\>
32
32
 
33
- Defined in: [src/JWTUtils.ts:154](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/JWTUtils.ts#L154)
34
-
35
- Generates a new JWT token for the given config and user object. The user object must be a valid RapidREST
36
- user.
33
+ Defined in: [src/JWTUtils.ts:172](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/JWTUtils.ts#L172)
37
34
 
38
35
  #### Parameters
39
36
 
@@ -41,19 +38,39 @@ user.
41
38
 
42
39
  [`JWTUtilsConfig`](../interfaces/JWTUtilsConfig.md)
43
40
 
44
- The JWT configuration to use when generating the token.
45
-
46
41
  ##### user
47
42
 
48
43
  [`JWTUser`](../interfaces/JWTUser.md)
49
44
 
50
- The user to encode into the token's payload.
51
-
52
45
  ##### data?
53
46
 
54
47
  `any`
55
48
 
56
- Additional data to include the token's payload.
49
+ #### Returns
50
+
51
+ `Promise`\<`string`\>
52
+
53
+ ***
54
+
55
+ ### createTokenSync()
56
+
57
+ > `static` **createTokenSync**(`config`, `user`, `data?`): `string`
58
+
59
+ Defined in: [src/JWTUtils.ts:218](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/JWTUtils.ts#L218)
60
+
61
+ #### Parameters
62
+
63
+ ##### config
64
+
65
+ [`JWTUtilsConfig`](../interfaces/JWTUtilsConfig.md)
66
+
67
+ ##### user
68
+
69
+ [`JWTUser`](../interfaces/JWTUser.md)
70
+
71
+ ##### data?
72
+
73
+ `any`
57
74
 
58
75
  #### Returns
59
76
 
@@ -63,9 +80,40 @@ Additional data to include the token's payload.
63
80
 
64
81
  ### decodeToken()
65
82
 
66
- > `static` **decodeToken**(`config`, `token`): [`JWTPayload`](../interfaces/JWTPayload.md)
83
+ > `static` **decodeToken**(`config`, `token`): `Promise`\<[`JWTPayload`](../interfaces/JWTPayload.md)\>
84
+
85
+ Defined in: [src/JWTUtils.ts:272](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/JWTUtils.ts#L272)
86
+
87
+ Decodes the given JWT authentication token using the provided configuration. If the token is not valid an
88
+ error is thrown with the reason. Returns the encoded user object payload upon success.
89
+
90
+ #### Parameters
91
+
92
+ ##### config
93
+
94
+ [`JWTUtilsConfig`](../interfaces/JWTUtilsConfig.md)
95
+
96
+ The JWT configuration to use when validating the token.
97
+
98
+ ##### token
99
+
100
+ `string`
101
+
102
+ The JWT token to validate.
103
+
104
+ #### Returns
105
+
106
+ `Promise`\<[`JWTPayload`](../interfaces/JWTPayload.md)\>
107
+
108
+ The data encoded in the token's payload.
109
+
110
+ ***
111
+
112
+ ### decodeTokenSync()
113
+
114
+ > `static` **decodeTokenSync**(`config`, `token`): [`JWTPayload`](../interfaces/JWTPayload.md)
67
115
 
68
- Defined in: [src/JWTUtils.ts:208](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/JWTUtils.ts#L208)
116
+ Defined in: [src/JWTUtils.ts:322](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/JWTUtils.ts#L322)
69
117
 
70
118
  Decodes the given JWT authentication token using the provided configuration. If the token is not valid an
71
119
  error is thrown with the reason. Returns the encoded user object payload upon success.
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: MessagingUtils
8
8
 
9
- Defined in: [src/MessagingUtils.ts:75](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L75)
9
+ Defined in: [src/MessagingUtils.ts:75](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L75)
10
10
 
11
11
  Simple utility class for sending templated messages via e-mail, SMS and more.
12
12
 
@@ -26,7 +26,7 @@ Simple utility class for sending templated messages via e-mail, SMS and more.
26
26
 
27
27
  > `protected` **slackApps**: `any`[] = `[]`
28
28
 
29
- Defined in: [src/MessagingUtils.ts:76](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L76)
29
+ Defined in: [src/MessagingUtils.ts:76](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L76)
30
30
 
31
31
  ***
32
32
 
@@ -34,7 +34,7 @@ Defined in: [src/MessagingUtils.ts:76](https://github.com/rapidrest/core/blob/0e
34
34
 
35
35
  > `protected` **slackConfigs**: `any`[] = `[]`
36
36
 
37
- Defined in: [src/MessagingUtils.ts:78](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L78)
37
+ Defined in: [src/MessagingUtils.ts:78](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L78)
38
38
 
39
39
  ## Methods
40
40
 
@@ -42,7 +42,7 @@ Defined in: [src/MessagingUtils.ts:78](https://github.com/rapidrest/core/blob/0e
42
42
 
43
43
  > **init**(): `Promise`\<`void`\>
44
44
 
45
- Defined in: [src/MessagingUtils.ts:90](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L90)
45
+ Defined in: [src/MessagingUtils.ts:96](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L96)
46
46
 
47
47
  #### Returns
48
48
 
@@ -54,7 +54,7 @@ Defined in: [src/MessagingUtils.ts:90](https://github.com/rapidrest/core/blob/0e
54
54
 
55
55
  > **loadTemplate**(`name`): [`Template`](../interfaces/Template.md)
56
56
 
57
- Defined in: [src/MessagingUtils.ts:152](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L152)
57
+ Defined in: [src/MessagingUtils.ts:160](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L160)
58
58
 
59
59
  Loads the template with the given name and returns its contents as a string.
60
60
 
@@ -76,7 +76,7 @@ The name of the template to load.
76
76
 
77
77
  > **sendEmail**(`templateName`, `templateVars`, `options?`): `Promise`\<`any`\>
78
78
 
79
- Defined in: [src/MessagingUtils.ts:184](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L184)
79
+ Defined in: [src/MessagingUtils.ts:199](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L199)
80
80
 
81
81
  Sends an email using the given template name and variables.
82
82
 
@@ -110,7 +110,7 @@ The map of additional options to pass into the sendMail function.
110
110
 
111
111
  > **sendSlack**(`templateName`, `templateVars`): `Promise`\<`any`[] \| `undefined`\>
112
112
 
113
- Defined in: [src/MessagingUtils.ts:236](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L236)
113
+ Defined in: [src/MessagingUtils.ts:243](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L243)
114
114
 
115
115
  Sends an Slack message using the given template name and variables.
116
116
 
@@ -138,7 +138,7 @@ The map of variables to inject into the template.
138
138
 
139
139
  > **sendSMS**(`templateName`, `templateVars`, `options?`): `Promise`\<`any`\>
140
140
 
141
- Defined in: [src/MessagingUtils.ts:270](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/MessagingUtils.ts#L270)
141
+ Defined in: [src/MessagingUtils.ts:276](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/MessagingUtils.ts#L276)
142
142
 
143
143
  Sends an SMS using the given template name and variables.
144
144