@genesislcap/foundation-utils 14.65.2 → 14.66.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/dts/error/errorMap.d.ts +97 -0
- package/dist/dts/error/errorMap.d.ts.map +1 -0
- package/dist/dts/error/index.d.ts +2 -0
- package/dist/dts/error/index.d.ts.map +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/serializers/json/index.d.ts +2 -0
- package/dist/dts/serializers/json/index.d.ts.map +1 -1
- package/dist/dts/serializers/json/jsonReplacer.d.ts +9 -0
- package/dist/dts/serializers/json/jsonReplacer.d.ts.map +1 -0
- package/dist/dts/serializers/json/jsonReviver.d.ts +9 -0
- package/dist/dts/serializers/json/jsonReviver.d.ts.map +1 -0
- package/dist/dts/serializers/json/types.d.ts +26 -0
- package/dist/dts/serializers/json/types.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/esm/error/errorMap.js +101 -0
- package/dist/esm/error/index.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/serializers/json/index.js +2 -0
- package/dist/esm/serializers/json/jsonReplacer.js +26 -0
- package/dist/esm/serializers/json/jsonReviver.js +32 -0
- package/dist/esm/serializers/json/types.js +40 -0
- package/dist/foundation-utils.api.json +11993 -0
- package/dist/foundation-utils.d.ts +1599 -0
- package/docs/.gitattributes +2 -0
- package/docs/api/foundation-utils.createerrormap.md +13 -0
- package/docs/api/foundation-utils.defaulterrormap._constructor_.md +20 -0
- package/docs/api/foundation-utils.defaulterrormap.clear.md +17 -0
- package/docs/api/foundation-utils.defaulterrormap.delete.md +26 -0
- package/docs/api/foundation-utils.defaulterrormap.get.md +26 -0
- package/docs/api/foundation-utils.defaulterrormap.has.md +26 -0
- package/docs/api/foundation-utils.defaulterrormap.lasterror.md +13 -0
- package/docs/api/foundation-utils.defaulterrormap.md +38 -0
- package/docs/api/foundation-utils.defaulterrormap.messages.md +13 -0
- package/docs/api/foundation-utils.defaulterrormap.set.md +25 -0
- package/docs/api/foundation-utils.defaulterrormap.size.md +13 -0
- package/docs/api/foundation-utils.errordetailmap.md +12 -0
- package/docs/api/foundation-utils.errormap.lasterror.md +13 -0
- package/docs/api/foundation-utils.errormap.md +27 -0
- package/docs/api/foundation-utils.errormap.messages.md +13 -0
- package/docs/api/foundation-utils.errormap.set.md +25 -0
- package/docs/api/foundation-utils.errormaplogger.md +12 -0
- package/docs/api/foundation-utils.jsonreplacer.md +27 -0
- package/docs/api/foundation-utils.jsonreviver.md +27 -0
- package/docs/api/foundation-utils.md +7 -0
- package/docs/api-report.md +35 -0
- package/package.json +7 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [createErrorMap](./foundation-utils.createerrormap.md)
|
|
4
|
+
|
|
5
|
+
## createErrorMap variable
|
|
6
|
+
|
|
7
|
+
A factory to create the error map.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
createErrorMap: <TErrorDetailMap extends ErrorDetailMap>(logger: ErrorMapLogger) => ErrorMap<TErrorDetailMap>
|
|
13
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [(constructor)](./foundation-utils.defaulterrormap._constructor_.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.(constructor)
|
|
6
|
+
|
|
7
|
+
Constructs a new instance of the `DefaultErrorMap` class
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
constructor(logger: ErrorMapLogger);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| logger | [ErrorMapLogger](./foundation-utils.errormaplogger.md) | A logger error method reference. |
|
|
20
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [clear](./foundation-utils.defaulterrormap.clear.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.clear() method
|
|
6
|
+
|
|
7
|
+
Clear errors.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
clear(): void;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
void
|
|
17
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [delete](./foundation-utils.defaulterrormap.delete.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.delete() method
|
|
6
|
+
|
|
7
|
+
Delete an error.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
delete(key: keyof TErrorDetailMap): boolean;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| key | keyof TErrorDetailMap | The key. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
boolean
|
|
24
|
+
|
|
25
|
+
True if successful, otherwise false.
|
|
26
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [get](./foundation-utils.defaulterrormap.get.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.get() method
|
|
6
|
+
|
|
7
|
+
Get an error by key.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
get(key: keyof TErrorDetailMap): Error | undefined;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| key | keyof TErrorDetailMap | The key. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
Error \| undefined
|
|
24
|
+
|
|
25
|
+
The error if it exists, otherwise undefined.
|
|
26
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [has](./foundation-utils.defaulterrormap.has.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.has() method
|
|
6
|
+
|
|
7
|
+
Has an error for key.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
has(key: keyof TErrorDetailMap): boolean;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| key | keyof TErrorDetailMap | The key. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
boolean
|
|
24
|
+
|
|
25
|
+
True if it exists, otherwise false.
|
|
26
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [lastError](./foundation-utils.defaulterrormap.lasterror.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.lastError property
|
|
6
|
+
|
|
7
|
+
The last set error if any.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
lastError: Error;
|
|
13
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap class
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
**Signature:**
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
export declare class DefaultErrorMap<TErrorDetailMap extends ErrorDetailMap> implements ErrorMap<TErrorDetailMap>
|
|
12
|
+
```
|
|
13
|
+
**Implements:** [ErrorMap](./foundation-utils.errormap.md)<!-- --><TErrorDetailMap>
|
|
14
|
+
|
|
15
|
+
## Constructors
|
|
16
|
+
|
|
17
|
+
| Constructor | Modifiers | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| [(constructor)(logger)](./foundation-utils.defaulterrormap._constructor_.md) | | Constructs a new instance of the <code>DefaultErrorMap</code> class |
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Property | Modifiers | Type | Description |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| [lastError](./foundation-utils.defaulterrormap.lasterror.md) | | Error | The last set error if any. |
|
|
26
|
+
| [messages](./foundation-utils.defaulterrormap.messages.md) | <code>readonly</code> | string | Error map as messages. |
|
|
27
|
+
| [size](./foundation-utils.defaulterrormap.size.md) | <code>readonly</code> | number | The size of the error map. |
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
| Method | Modifiers | Description |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| [clear()](./foundation-utils.defaulterrormap.clear.md) | | Clear errors. |
|
|
34
|
+
| [delete(key)](./foundation-utils.defaulterrormap.delete.md) | | Delete an error. |
|
|
35
|
+
| [get(key)](./foundation-utils.defaulterrormap.get.md) | | Get an error by key. |
|
|
36
|
+
| [has(key)](./foundation-utils.defaulterrormap.has.md) | | Has an error for key. |
|
|
37
|
+
| [set(key, error)](./foundation-utils.defaulterrormap.set.md) | | Set an error by key. |
|
|
38
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [messages](./foundation-utils.defaulterrormap.messages.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.messages property
|
|
6
|
+
|
|
7
|
+
Error map as messages.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
get messages(): string;
|
|
13
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [set](./foundation-utils.defaulterrormap.set.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.set() method
|
|
6
|
+
|
|
7
|
+
Set an error by key.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
set(key: keyof TErrorDetailMap, error: Error): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| key | keyof TErrorDetailMap | The key. |
|
|
20
|
+
| error | Error | The error. |
|
|
21
|
+
|
|
22
|
+
**Returns:**
|
|
23
|
+
|
|
24
|
+
void
|
|
25
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [DefaultErrorMap](./foundation-utils.defaulterrormap.md) > [size](./foundation-utils.defaulterrormap.size.md)
|
|
4
|
+
|
|
5
|
+
## DefaultErrorMap.size property
|
|
6
|
+
|
|
7
|
+
The size of the error map.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
get size(): number;
|
|
13
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [ErrorDetailMap](./foundation-utils.errordetailmap.md)
|
|
4
|
+
|
|
5
|
+
## ErrorDetailMap type
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
**Signature:**
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
export type ErrorDetailMap = Record<string, unknown>;
|
|
12
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [ErrorMap](./foundation-utils.errormap.md) > [lastError](./foundation-utils.errormap.lasterror.md)
|
|
4
|
+
|
|
5
|
+
## ErrorMap.lastError property
|
|
6
|
+
|
|
7
|
+
The last set error if any.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly lastError: Error;
|
|
13
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [ErrorMap](./foundation-utils.errormap.md)
|
|
4
|
+
|
|
5
|
+
## ErrorMap interface
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
**Signature:**
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
export interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'>
|
|
12
|
+
```
|
|
13
|
+
**Extends:** Pick<Map<keyof TErrorDetailMap, Error>, 'get' \| 'has' \| 'delete' \| 'clear' \| 'size'>
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Modifiers | Type | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| [lastError](./foundation-utils.errormap.lasterror.md) | <code>readonly</code> | Error | The last set error if any. |
|
|
20
|
+
| [messages](./foundation-utils.errormap.messages.md) | <code>readonly</code> | string | Error map as messages. |
|
|
21
|
+
|
|
22
|
+
## Methods
|
|
23
|
+
|
|
24
|
+
| Method | Description |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| [set(key, error)](./foundation-utils.errormap.set.md) | Set an error by key. |
|
|
27
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [ErrorMap](./foundation-utils.errormap.md) > [messages](./foundation-utils.errormap.messages.md)
|
|
4
|
+
|
|
5
|
+
## ErrorMap.messages property
|
|
6
|
+
|
|
7
|
+
Error map as messages.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly messages: string;
|
|
13
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [ErrorMap](./foundation-utils.errormap.md) > [set](./foundation-utils.errormap.set.md)
|
|
4
|
+
|
|
5
|
+
## ErrorMap.set() method
|
|
6
|
+
|
|
7
|
+
Set an error by key.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
set(key: keyof TErrorDetailMap, error: Error): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| key | keyof TErrorDetailMap | The key. |
|
|
20
|
+
| error | Error | The error. |
|
|
21
|
+
|
|
22
|
+
**Returns:**
|
|
23
|
+
|
|
24
|
+
void
|
|
25
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [ErrorMapLogger](./foundation-utils.errormaplogger.md)
|
|
4
|
+
|
|
5
|
+
## ErrorMapLogger type
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
**Signature:**
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
export type ErrorMapLogger = (...args: any[]) => void;
|
|
12
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [JSONReplacer](./foundation-utils.jsonreplacer.md)
|
|
4
|
+
|
|
5
|
+
## JSONReplacer() function
|
|
6
|
+
|
|
7
|
+
JSON replacer function.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function JSONReplacer(key: string, value: any): any;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| key | string | The object key. |
|
|
20
|
+
| value | any | The key value. |
|
|
21
|
+
|
|
22
|
+
**Returns:**
|
|
23
|
+
|
|
24
|
+
any
|
|
25
|
+
|
|
26
|
+
The resulting value.
|
|
27
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [JSONReviver](./foundation-utils.jsonreviver.md)
|
|
4
|
+
|
|
5
|
+
## JSONReviver() function
|
|
6
|
+
|
|
7
|
+
JSON reviver function.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function JSONReviver(key: string, value: any): any;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| key | string | The object key. |
|
|
20
|
+
| value | any | The key value. |
|
|
21
|
+
|
|
22
|
+
**Returns:**
|
|
23
|
+
|
|
24
|
+
any
|
|
25
|
+
|
|
26
|
+
The resulting value.
|
|
27
|
+
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| Class | Description |
|
|
10
10
|
| --- | --- |
|
|
11
|
+
| [DefaultErrorMap](./foundation-utils.defaulterrormap.md) | |
|
|
11
12
|
| [DefaultServerRowDTOMapper](./foundation-utils.defaultserverrowdtomapper.md) | The default <code>ServerRowDTOMapper</code>. |
|
|
12
13
|
| [InMemoryDatabase](./foundation-utils.inmemorydatabase.md) | An in memory database of specific DatabaseRecord types. |
|
|
13
14
|
| [NumberParser](./foundation-utils.numberparser.md) | |
|
|
@@ -30,6 +31,8 @@
|
|
|
30
31
|
| [formatDateTimestamp(timestamp)](./foundation-utils.formatdatetimestamp.md) | Formats \[DATE\] UNIX Timestamps (without time) to readable strings |
|
|
31
32
|
| [formatDateTimeTimestamp(timestamp)](./foundation-utils.formatdatetimetimestamp.md) | Formats \[DATETIME\] UNIX Timestamps (with time) to readable strings |
|
|
32
33
|
| [formatTimestamp(timestamp, withTime)](./foundation-utils.formattimestamp.md) | Formats \[DATE\|DATETIME\] Unix Timestamps to readable strings |
|
|
34
|
+
| [JSONReplacer(key, value)](./foundation-utils.jsonreplacer.md) | JSON replacer function. |
|
|
35
|
+
| [JSONReviver(key, value)](./foundation-utils.jsonreviver.md) | JSON reviver function. |
|
|
33
36
|
| [renderOnChange(target, name)](./foundation-utils.renderonchange.md) | Defines a property changed handler that calls a render() method on the target as an internal observation enhancement. |
|
|
34
37
|
| [sync(binding, conversionType, eventName, keyAttr)](./foundation-utils.sync.md) | Creates a synchronization directive that binds a data source to an HTML element, |
|
|
35
38
|
| [whenElse(binding, trueTemplateOrTemplateBinding, falseTemplateOrTemplateBinding)](./foundation-utils.whenelse.md) | Directive that allows supplying an "else" template to the traditional [https://www.fast.design/docs/api/fast-element.when/\#when-function](https://www.fast.design/docs/api/fast-element.when/#when-function) directive |
|
|
@@ -42,6 +45,7 @@
|
|
|
42
45
|
| [DatabaseRecord](./foundation-utils.databaserecord.md) | Represents a database record. |
|
|
43
46
|
| [DesignSystemModule](./foundation-utils.designsystemmodule.md) | |
|
|
44
47
|
| [DTOMapper](./foundation-utils.dtomapper.md) | |
|
|
48
|
+
| [ErrorMap](./foundation-utils.errormap.md) | |
|
|
45
49
|
| [JSONSerializer](./foundation-utils.jsonserializer.md) | An interface representing a JSON serializer. |
|
|
46
50
|
| [Logger](./foundation-utils.logger.md) | A logger that extends the <code>Consola</code> logger. |
|
|
47
51
|
| [LoggerOptions](./foundation-utils.loggeroptions.md) | Options for creating a logger. |
|
|
@@ -63,6 +67,7 @@
|
|
|
63
67
|
| --- | --- |
|
|
64
68
|
| [activeColorScheme](./foundation-utils.activecolorscheme.md) | A design token that represents the active color scheme (light or dark). |
|
|
65
69
|
| [API\_HOST](./foundation-utils.api_host.md) | The Genesis Server (host0 to establish a connection (WebSocket or HTTP)). Example: wss://localhost:9064 |
|
|
70
|
+
| [createErrorMap](./foundation-utils.createerrormap.md) | A factory to create the error map. |
|
|
66
71
|
| [createObserver](./foundation-utils.createobserver.md) | Creates a new event observer instance. |
|
|
67
72
|
| [DEFAULT\_ORGANISATION](./foundation-utils.default_organisation.md) | The default Organisation value, used in auth/login flow \[<code>genesislcap-foundation-login</code>\](https://link-to-docs). |
|
|
68
73
|
| [DEFAULT\_PASSWORD](./foundation-utils.default_password.md) | The default Password value, used in auth/login flow \[<code>genesislcap-foundation-login</code>\](https://link-to-docs). |
|
|
@@ -100,6 +105,8 @@
|
|
|
100
105
|
| [ConstructablePendingState](./foundation-utils.constructablependingstate.md) | A mixin that provides functionality for raising <code>pending-state</code> events. |
|
|
101
106
|
| [ConversionType](./foundation-utils.conversiontype.md) | Represents the possible types of value conversion for data synchronization. |
|
|
102
107
|
| [DesignSystemResource](./foundation-utils.designsystemresource.md) | |
|
|
108
|
+
| [ErrorDetailMap](./foundation-utils.errordetailmap.md) | |
|
|
109
|
+
| [ErrorMapLogger](./foundation-utils.errormaplogger.md) | |
|
|
103
110
|
| [EventName](./foundation-utils.eventname.md) | Represents the possible event names for data synchronization. |
|
|
104
111
|
| [Listener](./foundation-utils.listener.md) | Creates an observer that facilitates the subscription and publication of events. |
|
|
105
112
|
| [PendingStateErrorEvent](./foundation-utils.pendingstateerrorevent.md) | A custom event that represents a <code>pending-state-error</code> event. |
|
package/docs/api-report.md
CHANGED
|
@@ -36,6 +36,9 @@ export type ConstructablePendingState = Constructable<FASTElement & HTMLElement>
|
|
|
36
36
|
// @public
|
|
37
37
|
export type ConversionType = 'string' | 'number' | 'time' | 'boolean';
|
|
38
38
|
|
|
39
|
+
// @public
|
|
40
|
+
export const createErrorMap: <TErrorDetailMap extends ErrorDetailMap>(logger: ErrorMapLogger) => ErrorMap<TErrorDetailMap>;
|
|
41
|
+
|
|
39
42
|
// @public
|
|
40
43
|
export function createLogger(name: string, options?: LoggerOptions): Logger;
|
|
41
44
|
|
|
@@ -121,6 +124,19 @@ export let DEFAULT_PASSWORD: string;
|
|
|
121
124
|
// @public
|
|
122
125
|
export let DEFAULT_USER: string;
|
|
123
126
|
|
|
127
|
+
// @public (undocumented)
|
|
128
|
+
export class DefaultErrorMap<TErrorDetailMap extends ErrorDetailMap> implements ErrorMap<TErrorDetailMap> {
|
|
129
|
+
constructor(logger: ErrorMapLogger);
|
|
130
|
+
clear(): void;
|
|
131
|
+
delete(key: keyof TErrorDetailMap): boolean;
|
|
132
|
+
get(key: keyof TErrorDetailMap): Error | undefined;
|
|
133
|
+
has(key: keyof TErrorDetailMap): boolean;
|
|
134
|
+
lastError: Error;
|
|
135
|
+
get messages(): string;
|
|
136
|
+
set(key: keyof TErrorDetailMap, error: Error): void;
|
|
137
|
+
get size(): number;
|
|
138
|
+
}
|
|
139
|
+
|
|
124
140
|
// @public
|
|
125
141
|
export const defaultEventMap: Map<string, EventName>;
|
|
126
142
|
|
|
@@ -161,6 +177,19 @@ export interface DTOMapper<TDTO, TEntity> {
|
|
|
161
177
|
toDTO: (entity: Partial<TEntity>) => TDTO;
|
|
162
178
|
}
|
|
163
179
|
|
|
180
|
+
// @public (undocumented)
|
|
181
|
+
export type ErrorDetailMap = Record<string, unknown>;
|
|
182
|
+
|
|
183
|
+
// @public (undocumented)
|
|
184
|
+
export interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'> {
|
|
185
|
+
readonly lastError: Error;
|
|
186
|
+
readonly messages: string;
|
|
187
|
+
set(key: keyof TErrorDetailMap, error: Error): void;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// @public (undocumented)
|
|
191
|
+
export type ErrorMapLogger = (...args: any[]) => void;
|
|
192
|
+
|
|
164
193
|
// @public
|
|
165
194
|
export type EventName = 'input' | 'change' | 'default';
|
|
166
195
|
|
|
@@ -251,6 +280,12 @@ export const inSymphonyDesktop: () => boolean;
|
|
|
251
280
|
// @public
|
|
252
281
|
export const isDev: () => boolean;
|
|
253
282
|
|
|
283
|
+
// @public
|
|
284
|
+
export function JSONReplacer(key: string, value: any): any;
|
|
285
|
+
|
|
286
|
+
// @public
|
|
287
|
+
export function JSONReviver(key: string, value: any): any;
|
|
288
|
+
|
|
254
289
|
// @public
|
|
255
290
|
export interface JSONSerializer {
|
|
256
291
|
deserialize<T = any>(response: Response): Promise<T>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
|
3
3
|
"description": "Genesis Foundation Utils",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.66.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -10,11 +10,15 @@
|
|
|
10
10
|
"PORT": 3040
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"
|
|
13
|
+
"api:extract": "api-extractor run --local",
|
|
14
|
+
"api:document": "api-documenter markdown -i dist -o docs/api",
|
|
15
|
+
"build": "npm run clean && tsc -b ./tsconfig.json && npm run api:extract && npm run api:document",
|
|
14
16
|
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
15
17
|
"dev": "tsc -b ./tsconfig.json -w"
|
|
16
18
|
},
|
|
17
19
|
"devDependencies": {
|
|
20
|
+
"@microsoft/api-documenter": "^7.19.13",
|
|
21
|
+
"@microsoft/api-extractor": "7.34.9",
|
|
18
22
|
"rimraf": "^3.0.2",
|
|
19
23
|
"typescript": "^4.5.5"
|
|
20
24
|
},
|
|
@@ -35,5 +39,5 @@
|
|
|
35
39
|
"access": "public"
|
|
36
40
|
},
|
|
37
41
|
"customElements": "dist/custom-elements.json",
|
|
38
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "5db6eb3195619a1d3e2cc2fcdb201748c778c62f"
|
|
39
43
|
}
|