@rapidrest/core 1.3.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.
- package/dist/lib/ClassLoader.js +3 -2
- package/dist/lib/ClassLoader.js.map +1 -1
- package/dist/lib/JWTUtils.js +1 -0
- package/dist/lib/JWTUtils.js.map +1 -1
- package/dist/types/JWTUtils.d.ts +1 -0
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Config.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Destroy.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Init.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Inject.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Logger.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Nullable.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/functions/Validator.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md +1 -1
- package/docs/reference/classes/AlertUtils.md +6 -6
- package/docs/reference/classes/ApiError.md +5 -5
- package/docs/reference/classes/ClassLoader.md +34 -34
- package/docs/reference/classes/Event.md +8 -8
- package/docs/reference/classes/EventUtils.md +4 -4
- package/docs/reference/classes/FileUtils.md +5 -5
- package/docs/reference/classes/JWTUtils.md +5 -5
- package/docs/reference/classes/MessagingUtils.md +8 -8
- package/docs/reference/classes/OASUtils.md +9 -9
- package/docs/reference/classes/ObjectFactory.md +14 -14
- package/docs/reference/classes/ObjectUtils.md +2 -2
- package/docs/reference/classes/StringUtils.md +6 -6
- package/docs/reference/classes/ThreadPool.md +11 -11
- package/docs/reference/classes/ThreadWorker.md +6 -6
- package/docs/reference/classes/UserUtils.md +6 -6
- 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 +1 -1
- package/docs/reference/interfaces/Alert.md +10 -10
- package/docs/reference/interfaces/AlertAttachment.md +5 -5
- package/docs/reference/interfaces/AlertClose.md +3 -3
- package/docs/reference/interfaces/AlertUtilsAttachmentOptions.md +4 -4
- package/docs/reference/interfaces/AlertUtilsOptions.md +4 -4
- package/docs/reference/interfaces/InstanceOptions.md +4 -4
- package/docs/reference/interfaces/JWTPayload.md +5 -5
- package/docs/reference/interfaces/JWTUser.md +5 -5
- package/docs/reference/interfaces/JWTUtilsConfig.md +4 -4
- package/docs/reference/interfaces/JWTUtilsPayloadKeyOptions.md +5 -5
- package/docs/reference/interfaces/JWTUtilsPayloadOptions.md +3 -3
- package/docs/reference/interfaces/JWTUtilsPayloadPasswordOptions.md +6 -6
- 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 +5 -5
- package/docs/reference/interfaces/Template.md +13 -13
- package/docs/reference/interfaces/TemplateMapBase.md +1 -1
- package/docs/reference/interfaces/TwilioConfig.md +4 -4
- package/docs/reference/interfaces/WorkerMessage.md +3 -3
- package/docs/reference/interfaces/WorkerOptions.md +6 -6
- package/docs/reference/type-aliases/BooleanFunc.md +1 -1
- package/docs/reference/type-aliases/TemplateMap.md +1 -1
- package/docs/reference/type-aliases/WorkerCallback.md +1 -1
- package/docs/reference/variables/Logger.md +1 -1
- package/package.json +1 -1
package/dist/lib/ClassLoader.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
///////////////////////////////////////////////////////////////////////////////
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import path from "path";
|
|
6
|
+
import { pathToFileURL } from "url";
|
|
6
7
|
const sepRegex = new RegExp("\\" + path.sep, "g");
|
|
7
8
|
/**
|
|
8
9
|
* The *ClassLoader* provides a container for dynamically loading classes at runtime using C#/Java style namespaces.
|
|
@@ -127,7 +128,7 @@ export class ClassLoader {
|
|
|
127
128
|
await this.load(subdir);
|
|
128
129
|
}
|
|
129
130
|
else if (this.includeJavaScript && extension.match(/^\.(js|cjs|mjs)$/)) {
|
|
130
|
-
const mod = await import(fullpath);
|
|
131
|
+
const mod = await import(pathToFileURL(fullpath).href);
|
|
131
132
|
if (mod) {
|
|
132
133
|
for (let name in mod) {
|
|
133
134
|
let clazz = mod[name];
|
|
@@ -141,7 +142,7 @@ export class ClassLoader {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
else if (this.includeTypeScript && extension.match(/^\.(ts|cts|mts|tsx)$/)) {
|
|
144
|
-
const mod = await import(fullpath);
|
|
145
|
+
const mod = await import(pathToFileURL(fullpath).href);
|
|
145
146
|
if (mod) {
|
|
146
147
|
for (let name in mod) {
|
|
147
148
|
let clazz = mod[name];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassLoader.js","sourceRoot":"","sources":["../../src/ClassLoader.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ClassLoader.js","sourceRoot":"","sources":["../../src/ClassLoader.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAClD;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;wBAC7G,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;wBAChB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;oBACjC,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACJ,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,QAAQ,CAAC,CAAC;gBAC/D,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
package/dist/lib/JWTUtils.js
CHANGED
package/dist/lib/JWTUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JWTUtils.js","sourceRoot":"","sources":["../../src/JWTUtils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,MAAM,CAAC;AA8CxB;;GAEG;AACH,MAAM,CAAN,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IAClC,wCAAwC;IACxC,2CAAa,CAAA;AACjB,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,QAGrC;AAkFD;;;;GAIG;AACH,MAAM,OAAO,QAAQ;
|
|
1
|
+
{"version":3,"file":"JWTUtils.js","sourceRoot":"","sources":["../../src/JWTUtils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,MAAM,CAAC;AA8CxB;;GAEG;AACH,MAAM,CAAN,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IAClC,wCAAwC;IACxC,2CAAa,CAAA;AACjB,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,QAGrC;AAkFD;;;;GA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MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;gBACnE,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;YAChC,CAAC;QACL,CAAC;QAED,qCAAqC;QACrC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9C,OAAO,OAAO,CAAC;IACnB,CAAC;;AAxNc,wBAAe,GAAG,IAAI,GAAG,EAAE,CAAC"}
|
package/dist/types/JWTUtils.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ export interface JWTUtilsConfig {
|
|
|
118
118
|
* @author Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
119
119
|
*/
|
|
120
120
|
export declare class JWTUtils {
|
|
121
|
+
private static _parsedKeyCache;
|
|
121
122
|
/**
|
|
122
123
|
* Generates a new JWT token for the given config and user object. The user object must be a valid RapidREST
|
|
123
124
|
* user.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Config**(`path?`, `defaultValue?`): (`target`, `propertyKey`) => `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:61](https://github.com/rapidrest/core/blob/
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:61](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L61)
|
|
12
12
|
|
|
13
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.
|
|
@@ -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/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/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,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Init**(`target`, `propertyKey`, `descriptor`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:49](https://github.com/rapidrest/core/blob/
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:49](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L49)
|
|
12
12
|
|
|
13
13
|
Apply this to a function to be executed once a new object instance has been created and all dependencies injected.
|
|
14
14
|
Note: If the decorated function returns a Promise it is not gauranteed to finish execution before the object is
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Inject**(`type`, `options?`): (`target`, `propertyKey`) => `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:21](https://github.com/rapidrest/core/blob/
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:21](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L21)
|
|
12
12
|
|
|
13
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.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Logger**(`target`, `propertyKey`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:77](https://github.com/rapidrest/core/blob/
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:77](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/src/decorators/ObjectDecorators.ts#L77)
|
|
12
12
|
|
|
13
13
|
Apply this to a property to have the logger utility injected at instantiation.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Nullable**(`target`, `propertyKey`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/decorators/ObjectDecorators.ts:90](https://github.com/rapidrest/core/blob/
|
|
11
|
+
Defined in: [src/decorators/ObjectDecorators.ts:90](https://github.com/rapidrest/core/blob/a4c031c9927a28230ae2f4bc0d881f4d5a54cdeb/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
|
|
|
@@ -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/
|
|
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
|
|
package/docs/reference/@rapidrest/namespaces/ObjectDecorators/type-aliases/ValidatorFunction.md
CHANGED
|
@@ -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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/df82e91f
|
|
|
56
56
|
|
|
57
57
|
> **code**: `string`
|
|
58
58
|
|
|
59
|
-
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/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/
|
|
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/
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:53](https://github.com/rapidrest/core/blob/df82e
|
|
|
114
114
|
|
|
115
115
|
> `protected` **includeJavaScript**: `boolean` = `true`
|
|
116
116
|
|
|
117
|
-
Defined in: [src/ClassLoader.ts:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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/
|
|
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/
|
|
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/df
|
|
|
50
50
|
|
|
51
51
|
> `readonly` **environment**: `string`
|
|
52
52
|
|
|
53
|
-
Defined in: [src/TelemetryUtils.ts:32](https://github.com/rapidrest/core/blob/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
|
|
@@ -37,7 +37,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
37
37
|
|
|
38
38
|
> `static` **init**(`config`, `logger`, `jwtToken`): `Promise`\<`void`\>
|
|
39
39
|
|
|
40
|
-
Defined in: [src/TelemetryUtils.ts:99](https://github.com/rapidrest/core/blob/
|
|
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
|
|
|
@@ -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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|