@rapidrest/core 1.1.4 → 1.3.0

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 (88) 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 +110 -11
  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 +96 -78
  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/UserUtils.js +0 -32
  20. package/dist/lib/UserUtils.js.map +1 -1
  21. package/dist/lib/decorators/ObjectDecorators.js +1 -5
  22. package/dist/lib/decorators/ObjectDecorators.js.map +1 -1
  23. package/dist/lib/threads/ThreadPool.js +17 -9
  24. package/dist/lib/threads/ThreadPool.js.map +1 -1
  25. package/dist/types/JWTUtils.d.ts +21 -3
  26. package/dist/types/Logger.d.ts +1 -1
  27. package/dist/types/MessagingUtils.d.ts +4 -0
  28. package/dist/types/OASUtils.d.ts +2 -0
  29. package/dist/types/ObjectFactory.d.ts +10 -3
  30. package/dist/types/TelemetryUtils.d.ts +1 -1
  31. package/dist/types/UserUtils.d.ts +0 -12
  32. package/dist/types/decorators/ObjectDecorators.d.ts +1 -5
  33. package/dist/types/threads/ThreadPool.d.ts +0 -1
  34. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +4 -18
  35. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +1 -1
  36. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +3 -3
  37. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +6 -18
  38. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +2 -2
  39. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +2 -2
  40. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +2 -16
  41. package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +2 -2
  42. package/docs/reference/classes/AlertUtils.md +10 -10
  43. package/docs/reference/classes/ApiError.md +10 -22
  44. package/docs/reference/classes/ClassLoader.md +17 -17
  45. package/docs/reference/classes/Event.md +8 -8
  46. package/docs/reference/classes/EventUtils.md +6 -6
  47. package/docs/reference/classes/FileUtils.md +17 -17
  48. package/docs/reference/classes/JWTUtils.md +62 -14
  49. package/docs/reference/classes/MessagingUtils.md +12 -12
  50. package/docs/reference/classes/OASUtils.md +22 -8
  51. package/docs/reference/classes/ObjectFactory.md +25 -23
  52. package/docs/reference/classes/ObjectUtils.md +2 -2
  53. package/docs/reference/classes/StringUtils.md +8 -8
  54. package/docs/reference/classes/ThreadPool.md +25 -25
  55. package/docs/reference/classes/ThreadWorker.md +6 -6
  56. package/docs/reference/classes/UserUtils.md +10 -64
  57. package/docs/reference/classes/ValidationUtils.md +14 -14
  58. package/docs/reference/enumerations/AlertPriority.md +6 -6
  59. package/docs/reference/enumerations/JWTUtilsCompressionMethods.md +2 -2
  60. package/docs/reference/enumerations/WorkerMessageType.md +5 -5
  61. package/docs/reference/functions/sleep.md +3 -3
  62. package/docs/reference/interfaces/Alert.md +14 -14
  63. package/docs/reference/interfaces/AlertAttachment.md +6 -6
  64. package/docs/reference/interfaces/AlertClose.md +5 -5
  65. package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +6 -6
  66. package/docs/reference/interfaces/AlertUtilsOptions.md +5 -5
  67. package/docs/reference/interfaces/InstanceOptions.md +13 -7
  68. package/docs/reference/interfaces/JWTPayload.md +15 -15
  69. package/docs/reference/interfaces/JWTUser.md +6 -6
  70. package/docs/reference/interfaces/JWTUtilsConfig.md +6 -6
  71. package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +8 -8
  72. package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +5 -5
  73. package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +9 -9
  74. package/docs/reference/interfaces/NewEvent.md +2 -2
  75. package/docs/reference/interfaces/OriginSettings.md +3 -3
  76. package/docs/reference/interfaces/SlackConfig.md +4 -4
  77. package/docs/reference/interfaces/SmtpAuth.md +3 -3
  78. package/docs/reference/interfaces/SmtpConfig.md +6 -6
  79. package/docs/reference/interfaces/Template.md +24 -24
  80. package/docs/reference/interfaces/TemplateMapBase.md +2 -2
  81. package/docs/reference/interfaces/TwilioConfig.md +5 -5
  82. package/docs/reference/interfaces/WorkerMessage.md +4 -4
  83. package/docs/reference/interfaces/WorkerOptions.md +11 -11
  84. package/docs/reference/type-aliases/BooleanFunc.md +2 -2
  85. package/docs/reference/type-aliases/TemplateMap.md +1 -1
  86. package/docs/reference/type-aliases/WorkerCallback.md +2 -2
  87. package/docs/reference/variables/Logger.md +6 -2
  88. package/package.json +96 -96
@@ -51,4 +51,6 @@ export declare class OASUtils {
51
51
  * @returns {Promise<any>} A promise whose result will be the loaded OpenAPI Specification as an object.
52
52
  */
53
53
  static loadSpec(file: string): Promise<any>;
54
+ /** Clears the spec parse cache. Useful in tests to force re-loading of specs. */
55
+ static clearSpecCache(): void;
54
56
  }
@@ -3,8 +3,11 @@ import "reflect-metadata";
3
3
  * The set of options to use when creating new instances of objects.
4
4
  */
5
5
  export interface InstanceOptions {
6
+ /** The list of arguments to pass to the class constructor. */
6
7
  args?: any[];
8
+ /** The unique name of the object instance. */
7
9
  name?: string;
10
+ /** Set to `true` to perform initialization of the object after creation, otherwise set to `false`. Default is `true`. */
8
11
  initialize?: boolean;
9
12
  }
10
13
  /**
@@ -23,7 +26,13 @@ export declare class ObjectFactory {
23
26
  readonly instances: Map<string, any>;
24
27
  /** The application logging utility. */
25
28
  protected logger: any;
29
+ /** Cache of prototype-chain metadata keyed by constructor function. WeakMap allows GC of dropped classes. */
30
+ private readonly _metadataCache;
31
+ /** Secondary index: className → first registered instance key, for O(1) getInstance() fallback. */
32
+ private readonly _firstByClass;
26
33
  constructor(config?: any, logger?: any);
34
+ /** Walks the prototype chain once for `obj` and caches the discovered decorator metadata on the constructor. */
35
+ private _getOrBuildMetadata;
27
36
  /**
28
37
  * Destroys the specified objects. If `undefined` is passed in, all objects managed by the factory are destroyed.
29
38
  */
@@ -63,9 +72,7 @@ export declare class ObjectFactory {
63
72
  *
64
73
  * @param type The fully qualified name or type of the class to instantiate. If a type is given it's class name will be inferred
65
74
  * via the constructor name.
66
- * @param name The unique name to give the class instance. Set to `undefined` if you wish to force a new object is created.
67
- * @param initialize Set to `true` to initialize the object after creation, otherwise set to `false`. Default is `true`.
68
- * @param args The set of constructor arguments to use during construction
75
+ * @param options The options to use when instantiating the new class object.
69
76
  */
70
77
  newInstance<T>(type: any, options?: InstanceOptions): T | Promise<T>;
71
78
  /**
@@ -65,7 +65,7 @@ export declare class EventUtils {
65
65
  * @param logger The logging utility to use.
66
66
  * @param jwtToken The user's JWT token to send telemetry events on behalf of.
67
67
  */
68
- static init(config: any, logger: any, jwtToken: string): void;
68
+ static init(config: any, logger: any, jwtToken: string): Promise<void>;
69
69
  /**
70
70
  * Sends the given event to the telemetry service for permanent recording.
71
71
  *
@@ -22,18 +22,6 @@ export declare class UserUtils {
22
22
  * @param organizationUids The list of universally unique identifiers to search for.
23
23
  */
24
24
  static hasOrganizations(user: any, organizationUids?: string[]): boolean;
25
- /**
26
- * Returns `true` if the given user object contains a `Persona` object with the specified uid, otherwise returns `false`.
27
- * @param user The user object to inspect.
28
- * @param personaUid The universally unique identifier of the persona to search for.
29
- */
30
- static hasPersona(user: any, personaUid?: string): boolean;
31
- /**
32
- * Returns `true` if the given user object contains a `Persona` object matching one of the uids in the specified list, otherwise returns `false`.
33
- * @param user The user object to inspect.
34
- * @param personaUid The list of universally unique identifiers to search for.
35
- */
36
- static hasPersonas(user: any, personaUids?: string[]): boolean;
37
25
  /**
38
26
  * Returns the unique identifier of the specified type associated with the given user.
39
27
  *
@@ -9,9 +9,7 @@ export declare function Destroy(target: any, propertyKey: string): void;
9
9
  * if no object has been created yet.
10
10
  * @param type The fully qualified name or type of the class to instantiate. If a type is given it's class name will be inferred
11
11
  * via the constructor name.
12
- * @param name The unique name to give the class instance. Set to `undefined` if you wish to force a new object is created.
13
- * @param initialize Set to `true` to initialize the object after creation, otherwise set to `false`. Default is `true`.
14
- * @param args The set of constructor arguments to use during construction
12
+ * @param options The set of options to use when creating new instances of the injected class type.
15
13
  */
16
14
  export declare function Inject(type: any, options?: InstanceOptions): (target: any, propertyKey: string | symbol) => void;
17
15
  /**
@@ -35,8 +33,6 @@ export declare function Config(path?: string, defaultValue?: any): (target: any,
35
33
  export declare function Logger(target: any, propertyKey: string | symbol): void;
36
34
  /**
37
35
  * Apply this to a property to indicate that the value can be `null` or `undefined.`
38
- *
39
- * @param nullable Set to `true` to indicate that the property value can be `null`, otherwise set to `false`. Default is `false`.
40
36
  */
41
37
  export declare function Nullable(target: any, propertyKey: string | symbol): void;
42
38
  /**
@@ -80,7 +80,6 @@ export declare class ThreadPool {
80
80
  /**
81
81
  * Initializes the thread pool with the initial worker threads and begins execution.
82
82
  *
83
- * @param entry The path of the entry create a worker thread from. Default is `ThreadWorkerEntry.js`.
84
83
  * @param options The options to use when creating the worker thread.
85
84
  * @param num The number of initial threads to create, cannot be greater than max. Default is `max`.
86
85
  */
@@ -8,9 +8,9 @@
8
8
 
9
9
  > **Config**(`path?`, `defaultValue?`): (`target`, `propertyKey`) => `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:63](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L63)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:61](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/decorators/ObjectDecorators.ts#L61)
12
12
 
13
- Apply this to a property to have a configuration variable be injected at instantiation. If no path is given, the
13
+ Apply this to a property to have a configuration variable be injected at instantiation. If no path is given, the
14
14
  global configuration object is injected.
15
15
 
16
16
  ## Parameters
@@ -25,23 +25,9 @@ The path to the configuration variable to inject.
25
25
 
26
26
  `any` = `undefined`
27
27
 
28
- Set to the desired default value. If `undefined` is specified then an error is thrown if
28
+ Set to the desired default value. If `undefined` is specified then an error is thrown if
29
29
  no config variable is found at the given path.
30
30
 
31
31
  ## Returns
32
32
 
33
- > (`target`, `propertyKey`): `void`
34
-
35
- ### Parameters
36
-
37
- #### target
38
-
39
- `any`
40
-
41
- #### propertyKey
42
-
43
- `string` | `symbol`
44
-
45
- ### Returns
46
-
47
- `void`
33
+ (`target`, `propertyKey`) => `void`
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **Destroy**(`target`, `propertyKey`): `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:10](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L10)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:10](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/decorators/ObjectDecorators.ts#L10)
12
12
 
13
13
  Apply this to a class function to mark it as a destructor to be called by the `ObjectFactory` during cleanup.
14
14
 
@@ -8,10 +8,10 @@
8
8
 
9
9
  > **Init**(`target`, `propertyKey`, `descriptor`): `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:51](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L51)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:49](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/decorators/ObjectDecorators.ts#L49)
12
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
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
15
  returned during the instantiation process.
16
16
 
17
17
  ## Parameters
@@ -8,9 +8,9 @@
8
8
 
9
9
  > **Inject**(`type`, `options?`): (`target`, `propertyKey`) => `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:23](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L23)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:21](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/decorators/ObjectDecorators.ts#L21)
12
12
 
13
- Injects an object instance to the decorated property of the given name and type using the provided arguments
13
+ Injects an object instance to the decorated property of the given name and type using the provided arguments
14
14
  if no object has been created yet.
15
15
 
16
16
  ## Parameters
@@ -19,27 +19,15 @@ if no object has been created yet.
19
19
 
20
20
  `any`
21
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
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
23
  via the constructor name.
24
24
 
25
25
  ### options?
26
26
 
27
27
  [`InstanceOptions`](../../../../interfaces/InstanceOptions.md)
28
28
 
29
- ## Returns
30
-
31
- > (`target`, `propertyKey`): `void`
32
-
33
- ### Parameters
29
+ The set of options to use when creating new instances of the injected class type.
34
30
 
35
- #### target
36
-
37
- `any`
38
-
39
- #### propertyKey
40
-
41
- `string` | `symbol`
42
-
43
- ### Returns
31
+ ## Returns
44
32
 
45
- `void`
33
+ (`target`, `propertyKey`) => `void`
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **Logger**(`target`, `propertyKey`): `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:79](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L79)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:77](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/decorators/ObjectDecorators.ts#L77)
12
12
 
13
13
  Apply this to a property to have the logger utility injected at instantiation.
14
14
 
@@ -20,7 +20,7 @@ Apply this to a property to have the logger utility injected at instantiation.
20
20
 
21
21
  ### propertyKey
22
22
 
23
- `string` | `symbol`
23
+ `string` \| `symbol`
24
24
 
25
25
  ## Returns
26
26
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **Nullable**(`target`, `propertyKey`): `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:94](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L94)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:90](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/decorators/ObjectDecorators.ts#L90)
12
12
 
13
13
  Apply this to a property to indicate that the value can be `null` or `undefined.`
14
14
 
@@ -20,7 +20,7 @@ Apply this to a property to indicate that the value can be `null` or `undefined.
20
20
 
21
21
  ### propertyKey
22
22
 
23
- `string` | `symbol`
23
+ `string` \| `symbol`
24
24
 
25
25
  ## Returns
26
26
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **Validator**(`func`): (`target`, `propertyKey`) => `void`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:112](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L112)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:108](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/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
 
@@ -22,18 +22,4 @@ The validation function to use for the given property.
22
22
 
23
23
  ## Returns
24
24
 
25
- > (`target`, `propertyKey`): `void`
26
-
27
- ### Parameters
28
-
29
- #### target
30
-
31
- `any`
32
-
33
- #### propertyKey
34
-
35
- `string` | `symbol`
36
-
37
- ### Returns
38
-
39
- `void`
25
+ (`target`, `propertyKey`) => `void`
@@ -4,11 +4,11 @@
4
4
 
5
5
  [@rapidrest/core](../../../../globals.md) / [ObjectDecorators](../README.md) / ValidatorFunction
6
6
 
7
- # Type Alias: ValidatorFunction()
7
+ # Type Alias: ValidatorFunction
8
8
 
9
9
  > **ValidatorFunction** = (`value`) => `any`
10
10
 
11
- Defined in: [src/decorators/ObjectDecorators.ts:105](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/decorators/ObjectDecorators.ts#L105)
11
+ Defined in: [src/decorators/ObjectDecorators.ts:101](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/AlertUtils.ts#L116)
9
+ Defined in: [src/AlertUtils.ts:116](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/AlertUtils.ts#L128)
20
+ Defined in: [src/AlertUtils.ts:128](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/AlertUtils.ts#L298)
42
+ Defined in: [src/AlertUtils.ts:298](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/AlertUtils.ts#L298)
43
43
 
44
44
  Uploads a single attachment to the alert with the given unique identifier.
45
45
 
@@ -73,9 +73,9 @@ True if the operation was successful, otherwise false.
73
73
 
74
74
  ### close()
75
75
 
76
- > **close**(`id`, `data`): `Promise`\<`boolean`\>
76
+ > **close**(`id`, `data?`): `Promise`\<`boolean`\>
77
77
 
78
- Defined in: [src/AlertUtils.ts:139](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/AlertUtils.ts#L139)
78
+ Defined in: [src/AlertUtils.ts:139](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/AlertUtils.ts#L139)
79
79
 
80
80
  Attempts to close the existing alert with the given identifier.
81
81
 
@@ -87,7 +87,7 @@ Attempts to close the existing alert with the given identifier.
87
87
 
88
88
  The unique identifier of the alert to close.
89
89
 
90
- ##### data
90
+ ##### data?
91
91
 
92
92
  [`AlertClose`](../interfaces/AlertClose.md) = `{}`
93
93
 
@@ -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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/AlertUtils.ts#L167)
106
+ Defined in: [src/AlertUtils.ts:167](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/AlertUtils.ts#L167)
107
107
 
108
108
  Attempts to retrieve the existing alert with the given identifier.
109
109
 
@@ -125,9 +125,9 @@ The retrieved alert if successful, otherwise `null`.
125
125
 
126
126
  ### send()
127
127
 
128
- > **send**(`alert`, `vars`, `attachments?`): `Promise`\<`string` \| `null`\>
128
+ > **send**(`alert`, `vars?`, `attachments?`): `Promise`\<`string` \| `null`\>
129
129
 
130
- Defined in: [src/AlertUtils.ts:191](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/AlertUtils.ts#L191)
130
+ Defined in: [src/AlertUtils.ts:191](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/AlertUtils.ts#L191)
131
131
 
132
132
  Sends the provided alert to the configured monitoring service.
133
133
 
@@ -139,7 +139,7 @@ Sends the provided alert to the configured monitoring service.
139
139
 
140
140
  The alert to send.
141
141
 
142
- ##### vars
142
+ ##### vars?
143
143
 
144
144
  `any` = `{}`
145
145
 
@@ -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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ApiError.ts#L8)
9
+ Defined in: [src/ApiError.ts:8](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ApiError.ts#L24)
25
+ Defined in: [src/ApiError.ts:24](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ApiError.ts#L24)
26
26
 
27
27
  #### Parameters
28
28
 
@@ -52,23 +52,11 @@ Defined in: [src/ApiError.ts:24](https://github.com/rapidrest/core/blob/23a4f312
52
52
 
53
53
  ## Properties
54
54
 
55
- ### cause?
56
-
57
- > `optional` **cause**: `unknown`
58
-
59
- Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:26
60
-
61
- #### Inherited from
62
-
63
- `Error.cause`
64
-
65
- ***
66
-
67
55
  ### code
68
56
 
69
57
  > **code**: `string`
70
58
 
71
- Defined in: [src/ApiError.ts:10](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ApiError.ts#L10)
59
+ Defined in: [src/ApiError.ts:10](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ApiError.ts#L10)
72
60
 
73
61
  The unique code of the error.
74
62
 
@@ -78,7 +66,7 @@ The unique code of the error.
78
66
 
79
67
  > **message**: `string`
80
68
 
81
- Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077
69
+ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1075
82
70
 
83
71
  #### Inherited from
84
72
 
@@ -90,7 +78,7 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077
90
78
 
91
79
  > **name**: `string`
92
80
 
93
- Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
81
+ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1074
94
82
 
95
83
  #### Inherited from
96
84
 
@@ -100,9 +88,9 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
100
88
 
101
89
  ### stack?
102
90
 
103
- > `optional` **stack**: `string`
91
+ > `optional` **stack?**: `string`
104
92
 
105
- Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078
93
+ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
106
94
 
107
95
  #### Inherited from
108
96
 
@@ -114,7 +102,7 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078
114
102
 
115
103
  > **status**: `number`
116
104
 
117
- Defined in: [src/ApiError.ts:12](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ApiError.ts#L12)
105
+ Defined in: [src/ApiError.ts:12](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ApiError.ts#L12)
118
106
 
119
107
  The HTTP status associated with the error.
120
108
 
@@ -146,13 +134,13 @@ not capture any frames.
146
134
 
147
135
  > **ApiMessageTemplate**(`message`, `templateVariables?`): `string`
148
136
 
149
- Defined in: [src/ApiError.ts:14](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ApiError.ts#L14)
137
+ Defined in: [src/ApiError.ts:14](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ApiError.ts#L14)
150
138
 
151
139
  #### Parameters
152
140
 
153
141
  ##### message
154
142
 
155
- `string` | `undefined`
143
+ `string` \| `undefined`
156
144
 
157
145
  ##### templateVariables?
158
146
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: ClassLoader
8
8
 
9
- Defined in: [src/ClassLoader.ts:48](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L48)
9
+ Defined in: [src/ClassLoader.ts:50](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L50)
10
10
 
11
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.
@@ -55,9 +55,9 @@ Jean-Philippe Steinmetz
55
55
 
56
56
  ### Constructor
57
57
 
58
- > **new ClassLoader**(`rootDir`, `includeJavaScript`, `includeTypeScript`, `ignore`): `ClassLoader`
58
+ > **new ClassLoader**(`rootDir`, `includeJavaScript?`, `includeTypeScript?`, `ignore?`): `ClassLoader`
59
59
 
60
- Defined in: [src/ClassLoader.ts:67](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L67)
60
+ Defined in: [src/ClassLoader.ts:69](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L69)
61
61
 
62
62
  Creates a new instance of `ClassLoader` with the specified defaults.
63
63
 
@@ -69,18 +69,18 @@ Creates a new instance of `ClassLoader` with the specified defaults.
69
69
 
70
70
  The root directory to load all classes from.
71
71
 
72
- ##### includeJavaScript
72
+ ##### includeJavaScript?
73
73
 
74
74
  `boolean` = `true`
75
75
 
76
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
- ##### includeTypeScript
79
+ ##### includeTypeScript?
80
80
 
81
81
  `boolean` = `true`
82
82
 
83
- ##### ignore
83
+ ##### ignore?
84
84
 
85
85
  (`string` \| `RegExp`)[] = `[]`
86
86
 
@@ -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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L50)
99
+ Defined in: [src/ClassLoader.ts:52](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L52)
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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L51)
109
+ Defined in: [src/ClassLoader.ts:53](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L53)
110
110
 
111
111
  ***
112
112
 
@@ -114,7 +114,7 @@ Defined in: [src/ClassLoader.ts:51](https://github.com/rapidrest/core/blob/23a4f
114
114
 
115
115
  > `protected` **includeJavaScript**: `boolean` = `true`
116
116
 
117
- Defined in: [src/ClassLoader.ts:55](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L55)
117
+ Defined in: [src/ClassLoader.ts:57](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L57)
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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L53)
127
+ Defined in: [src/ClassLoader.ts:55](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L55)
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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L57)
137
+ Defined in: [src/ClassLoader.ts:59](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L59)
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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L80)
147
+ Defined in: [src/ClassLoader.ts:82](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L82)
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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L87)
171
+ Defined in: [src/ClassLoader.ts:89](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L89)
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/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L97)
185
+ Defined in: [src/ClassLoader.ts:99](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L99)
186
186
 
187
187
  Returns `true` if a class exists with the specified fully qualified name.
188
188
 
@@ -204,16 +204,16 @@ The fully qualified name of the class to search.
204
204
 
205
205
  ### load()
206
206
 
207
- > **load**(`dir`): `Promise`\<`void`\>
207
+ > **load**(`dir?`): `Promise`\<`void`\>
208
208
 
209
- Defined in: [src/ClassLoader.ts:107](https://github.com/rapidrest/core/blob/23a4f312bccd7ea3a0598e320bd5d984466027e5/src/ClassLoader.ts#L107)
209
+ Defined in: [src/ClassLoader.ts:109](https://github.com/rapidrest/core/blob/df82e91f4c858ef61526c7f35789a4199b84d999/src/ClassLoader.ts#L109)
210
210
 
211
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
215
215
 
216
- ##### dir
216
+ ##### dir?
217
217
 
218
218
  `string` = `""`
219
219