@rapidrest/core 1.1.0 → 1.2.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.
- package/dist/lib/AlertUtils.js +0 -6
- package/dist/lib/AlertUtils.js.map +1 -1
- package/dist/lib/ApiError.js +0 -4
- package/dist/lib/ApiError.js.map +1 -1
- package/dist/lib/ClassLoader.js +9 -9
- package/dist/lib/ClassLoader.js.map +1 -1
- package/dist/lib/JWTUtils.js +11 -8
- package/dist/lib/JWTUtils.js.map +1 -1
- package/dist/lib/MessagingUtils.js +6 -7
- package/dist/lib/MessagingUtils.js.map +1 -1
- package/dist/lib/NotificationsUtils.js +0 -2
- package/dist/lib/NotificationsUtils.js.map +1 -1
- package/dist/lib/ObjectFactory.js +40 -16
- package/dist/lib/ObjectFactory.js.map +1 -1
- package/dist/lib/TelemetryUtils.js +6 -30
- package/dist/lib/TelemetryUtils.js.map +1 -1
- package/dist/lib/UserUtils.js +0 -32
- package/dist/lib/UserUtils.js.map +1 -1
- package/dist/lib/decorators/ObjectDecorators.js +1 -5
- package/dist/lib/decorators/ObjectDecorators.js.map +1 -1
- package/dist/lib/threads/ThreadPool.js +6 -14
- package/dist/lib/threads/ThreadPool.js.map +1 -1
- package/dist/lib/threads/ThreadWorker.js +0 -1
- package/dist/lib/threads/ThreadWorker.js.map +1 -1
- package/dist/types/ObjectFactory.d.ts +5 -4
- package/dist/types/UserUtils.d.ts +0 -12
- package/dist/types/decorators/ObjectDecorators.d.ts +1 -5
- package/dist/types/threads/ThreadPool.d.ts +0 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +4 -18
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +3 -3
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +6 -18
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +2 -2
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +2 -2
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +2 -16
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +2 -2
- package/docs/reference/classes/AlertUtils.md +10 -10
- package/docs/reference/classes/ApiError.md +10 -22
- package/docs/reference/classes/ClassLoader.md +17 -17
- package/docs/reference/classes/Event.md +8 -8
- package/docs/reference/classes/EventUtils.md +4 -4
- package/docs/reference/classes/FileUtils.md +17 -17
- package/docs/reference/classes/JWTUtils.md +5 -5
- package/docs/reference/classes/MessagingUtils.md +12 -12
- package/docs/reference/classes/OASUtils.md +8 -8
- package/docs/reference/classes/ObjectFactory.md +25 -23
- package/docs/reference/classes/ObjectUtils.md +2 -2
- package/docs/reference/classes/StringUtils.md +8 -8
- package/docs/reference/classes/ThreadPool.md +25 -25
- package/docs/reference/classes/ThreadWorker.md +6 -6
- package/docs/reference/classes/UserUtils.md +10 -64
- package/docs/reference/classes/ValidationUtils.md +14 -14
- package/docs/reference/enumerations/AlertPriority.md +6 -6
- package/docs/reference/enumerations/JWTUtilsCompressionMethods.md +2 -2
- package/docs/reference/enumerations/WorkerMessageType.md +5 -5
- package/docs/reference/functions/sleep.md +3 -3
- package/docs/reference/interfaces/Alert.md +14 -14
- package/docs/reference/interfaces/AlertAttachment.md +6 -6
- package/docs/reference/interfaces/AlertClose.md +5 -5
- package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +6 -6
- package/docs/reference/interfaces/AlertUtilsOptions.md +5 -5
- package/docs/reference/interfaces/InstanceOptions.md +13 -7
- package/docs/reference/interfaces/JWTPayload.md +15 -15
- package/docs/reference/interfaces/JWTUser.md +6 -6
- package/docs/reference/interfaces/JWTUtilsConfig.md +6 -6
- package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +8 -8
- package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +5 -5
- package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +9 -9
- package/docs/reference/interfaces/NewEvent.md +2 -2
- package/docs/reference/interfaces/OriginSettings.md +3 -3
- package/docs/reference/interfaces/SlackConfig.md +4 -4
- package/docs/reference/interfaces/SmtpAuth.md +3 -3
- package/docs/reference/interfaces/SmtpConfig.md +6 -6
- package/docs/reference/interfaces/Template.md +24 -24
- package/docs/reference/interfaces/TemplateMapBase.md +2 -2
- package/docs/reference/interfaces/TwilioConfig.md +5 -5
- package/docs/reference/interfaces/WorkerMessage.md +4 -4
- package/docs/reference/interfaces/WorkerOptions.md +11 -11
- package/docs/reference/type-aliases/BooleanFunc.md +2 -2
- package/docs/reference/type-aliases/TemplateMap.md +1 -1
- package/docs/reference/type-aliases/WorkerCallback.md +2 -2
- package/docs/reference/variables/Logger.md +5 -1
- package/package.json +96 -96
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadPool.js","sourceRoot":"","sources":["../../../src/threads/ThreadPool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAiB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AA0B5E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,UAAU;
|
|
1
|
+
{"version":3,"file":"ThreadPool.js","sourceRoot":"","sources":["../../../src/threads/ThreadPool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,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,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,2CAAsB,CAAA;IACtB,uCAAkB,CAAA;IAClB,6CAAwB,CAAA;IACxB,yCAAoB,CAAA;AACxB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAYD;;;;GAIG;AACH,MAAM,OAAgB,YAAY;
|
|
1
|
+
{"version":3,"file":"ThreadWorker.js","sourceRoot":"","sources":["../../../src/threads/ThreadWorker.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E;;GAEG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,2CAAsB,CAAA;IACtB,uCAAkB,CAAA;IAClB,6CAAwB,CAAA;IACxB,yCAAoB,CAAA;AACxB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAYD;;;;GAIG;AACH,MAAM,OAAgB,YAAY;IAG9B,YAAY,MAAW;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CAkBJ"}
|
|
@@ -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
|
/**
|
|
@@ -40,7 +43,7 @@ export declare class ObjectFactory {
|
|
|
40
43
|
* Scans the given object for any properties with the `@Inject` decorator and assigns the correct values.
|
|
41
44
|
* @param obj The object to initialize with injected defaults
|
|
42
45
|
*/
|
|
43
|
-
initialize<T>(obj: any): Promise<T>;
|
|
46
|
+
initialize<T>(obj: any): T | Promise<T>;
|
|
44
47
|
/**
|
|
45
48
|
* Searches an object for one or more functions that implement a `@Init` decorator.
|
|
46
49
|
*
|
|
@@ -63,9 +66,7 @@ export declare class ObjectFactory {
|
|
|
63
66
|
*
|
|
64
67
|
* @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
68
|
* via the constructor name.
|
|
66
|
-
* @param
|
|
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
|
|
69
|
+
* @param options The options to use when instantiating the new class object.
|
|
69
70
|
*/
|
|
70
71
|
newInstance<T>(type: any, options?: InstanceOptions): T | Promise<T>;
|
|
71
72
|
/**
|
|
@@ -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
|
|
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:
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:61](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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
|
-
|
|
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/
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:10](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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:
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:49](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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:
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:21](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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
|
-
|
|
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
|
-
|
|
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:
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:77](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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`
|
|
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:
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:90](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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`
|
|
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:
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:108](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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
|
-
|
|
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`
|
package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md
CHANGED
|
@@ -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:
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:101](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
9
|
+
Defined in: [src/AlertUtils.ts:116](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
20
|
+
Defined in: [src/AlertUtils.ts:128](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
42
|
+
Defined in: [src/AlertUtils.ts:298](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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
|
|
76
|
+
> **close**(`id`, `data?`): `Promise`\<`boolean`\>
|
|
77
77
|
|
|
78
|
-
Defined in: [src/AlertUtils.ts:139](https://github.com/rapidrest/core/blob/
|
|
78
|
+
Defined in: [src/AlertUtils.ts:139](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
106
|
+
Defined in: [src/AlertUtils.ts:167](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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
|
|
128
|
+
> **send**(`alert`, `vars?`, `attachments?`): `Promise`\<`string` \| `null`\>
|
|
129
129
|
|
|
130
|
-
Defined in: [src/AlertUtils.ts:191](https://github.com/rapidrest/core/blob/
|
|
130
|
+
Defined in: [src/AlertUtils.ts:191](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
9
|
+
Defined in: [src/ApiError.ts:8](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
25
|
+
Defined in: [src/ApiError.ts:24](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
59
|
+
Defined in: [src/ApiError.ts:10](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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:
|
|
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:
|
|
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
|
|
91
|
+
> `optional` **stack?**: `string`
|
|
104
92
|
|
|
105
|
-
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:
|
|
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/
|
|
105
|
+
Defined in: [src/ApiError.ts:12](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/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/
|
|
137
|
+
Defined in: [src/ApiError.ts:14](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ApiError.ts#L14)
|
|
150
138
|
|
|
151
139
|
#### Parameters
|
|
152
140
|
|
|
153
141
|
##### message
|
|
154
142
|
|
|
155
|
-
`string`
|
|
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/
|
|
9
|
+
Defined in: [src/ClassLoader.ts:48](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L48)
|
|
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
|
|
58
|
+
> **new ClassLoader**(`rootDir`, `includeJavaScript?`, `includeTypeScript?`, `ignore?`): `ClassLoader`
|
|
59
59
|
|
|
60
|
-
Defined in: [src/ClassLoader.ts:67](https://github.com/rapidrest/core/blob/
|
|
60
|
+
Defined in: [src/ClassLoader.ts:67](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L67)
|
|
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/
|
|
99
|
+
Defined in: [src/ClassLoader.ts:50](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L50)
|
|
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/
|
|
109
|
+
Defined in: [src/ClassLoader.ts:51](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L51)
|
|
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/
|
|
117
|
+
Defined in: [src/ClassLoader.ts:55](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L55)
|
|
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/
|
|
127
|
+
Defined in: [src/ClassLoader.ts:53](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L53)
|
|
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/
|
|
137
|
+
Defined in: [src/ClassLoader.ts:57](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L57)
|
|
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/
|
|
147
|
+
Defined in: [src/ClassLoader.ts:80](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L80)
|
|
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/
|
|
171
|
+
Defined in: [src/ClassLoader.ts:87](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L87)
|
|
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/
|
|
185
|
+
Defined in: [src/ClassLoader.ts:97](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L97)
|
|
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
|
|
207
|
+
> **load**(`dir?`): `Promise`\<`void`\>
|
|
208
208
|
|
|
209
|
-
Defined in: [src/ClassLoader.ts:107](https://github.com/rapidrest/core/blob/
|
|
209
|
+
Defined in: [src/ClassLoader.ts:107](https://github.com/rapidrest/core/blob/0eb0ed1163d4555240daccc189ac59a2ba35179a/src/ClassLoader.ts#L107)
|
|
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
|
|