@genesislcap/foundation-comms 14.237.1 → 14.237.2-alpha-78ebbc0.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/datasource/datasource.mixins.d.ts +45 -29
- package/dist/dts/datasource/datasource.mixins.d.ts.map +1 -1
- package/dist/dts/testing/mocks/auth/auth.d.ts +1 -1
- package/dist/dts/testing/mocks/auth/auth.d.ts.map +1 -1
- package/dist/dts/testing/mocks/connect/socket.d.ts +1 -1
- package/dist/dts/testing/mocks/connect/socket.d.ts.map +1 -1
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/esm/auth/auth.js +2 -2
- package/dist/esm/connect/connect.js +8 -8
- package/dist/esm/connect/http.connect.js +8 -7
- package/dist/esm/connect/socket.js +1 -5
- package/dist/esm/credentialManager/credentialManager.js +2 -2
- package/dist/esm/datasource/datasource.js +7 -7
- package/dist/esm/networkMonitor/config.js +1 -2
- package/dist/esm/resources/genesis/genesis.js +1 -1
- package/dist/esm/storage/kv/kv.service.js +3 -3
- package/dist/foundation-comms.api.json +4898 -2404
- package/dist/foundation-comms.d.ts +47 -31
- package/docs/api/foundation-comms.connect.md +1 -0
- package/docs/api/foundation-comms.connect.streamwithoutautoteardown.md +37 -0
- package/docs/api/foundation-comms.datasourceeventhandler.md +56 -30
- package/docs/api/foundation-comms.defaultentitydatasource._initialized.md +15 -0
- package/docs/api/foundation-comms.defaultentitydatasource.cache.md +19 -0
- package/docs/api/foundation-comms.defaultentitydatasource.disconnect.md +19 -0
- package/docs/api/foundation-comms.defaultentitydatasource.entitycache.md +14 -0
- package/docs/api/foundation-comms.defaultentitydatasource.entitymap.md +14 -0
- package/docs/api/foundation-comms.defaultentitydatasource.initialize.md +19 -0
- package/docs/api/foundation-comms.defaultentitydatasource.initialized.md +16 -0
- package/docs/api/foundation-comms.defaultentitydatasource.isempty.md +19 -0
- package/docs/api/foundation-comms.defaultentitydatasource.mapper.md +14 -0
- package/docs/api/foundation-comms.defaultentitydatasource.md +38 -0
- package/docs/api/foundation-comms.defaultentitydatasource.rowid.md +14 -0
- package/docs/api/foundation-comms.defaultentitydatasource.sourceref.md +14 -0
- package/docs/api/foundation-comms.defaultentitydatasource.subscription.md +14 -0
- package/docs/api/foundation-comms.defaultentitydatasource.subscriptionloggedoff.md +14 -0
- package/docs/api/foundation-comms.defaultkvstorage._constructor_.md +25 -0
- package/docs/api/foundation-comms.defaultkvstorage.md +30 -0
- package/docs/api/foundation-comms.defaultkvstorage.user.md +14 -0
- package/docs/api/foundation-comms.defaultkvstorageconfig.md +16 -0
- package/docs/api/foundation-comms.entitydatasource.cache.md +19 -0
- package/docs/api/foundation-comms.entitydatasource.disconnect.md +22 -0
- package/docs/api/foundation-comms.entitydatasource.initialize.md +29 -0
- package/docs/api/foundation-comms.entitydatasource.isempty.md +19 -0
- package/docs/api/foundation-comms.entitydatasource.md +81 -0
- package/docs/api/foundation-comms.entitydatasourceinit.fetchmeta.md +14 -0
- package/docs/api/foundation-comms.entitydatasourceinit.mapper.md +14 -0
- package/docs/api/foundation-comms.entitydatasourceinit.md +25 -0
- package/docs/api/foundation-comms.entitydatasourceinit.options.md +14 -0
- package/docs/api/foundation-comms.extractfielddefinitions.md +14 -1
- package/docs/api/foundation-comms.getkvstorage.md +1 -1
- package/docs/api/foundation-comms.keyvalue.base64.md +16 -0
- package/docs/api/foundation-comms.keyvalue.expiration.md +16 -0
- package/docs/api/foundation-comms.keyvalue.key.md +16 -0
- package/docs/api/foundation-comms.keyvalue.md +27 -0
- package/docs/api/foundation-comms.keyvalue.metadata.md +18 -0
- package/docs/api/foundation-comms.keyvalue.value.md +16 -0
- package/docs/api/foundation-comms.keyvaluetransfer.deserialize.md +25 -0
- package/docs/api/foundation-comms.keyvaluetransfer.kv.md +14 -0
- package/docs/api/foundation-comms.keyvaluetransfer.md +30 -0
- package/docs/api/foundation-comms.keyvaluetransfer.serialize.md +25 -0
- package/docs/api/foundation-comms.kveventfailureresponse.md +21 -0
- package/docs/api/foundation-comms.kveventmessagetype.md +24 -0
- package/docs/api/foundation-comms.kvmessagetype.md +24 -0
- package/docs/api/foundation-comms.kvstorage.delete.md +25 -0
- package/docs/api/foundation-comms.kvstorage.get.md +18 -0
- package/docs/api/foundation-comms.kvstorage.get_1.md +25 -0
- package/docs/api/foundation-comms.kvstorage.list.md +18 -0
- package/docs/api/foundation-comms.kvstorage.md +31 -0
- package/docs/api/foundation-comms.kvstorage.put.md +25 -0
- package/docs/api/foundation-comms.kvstorageconfig.account.md +16 -0
- package/docs/api/foundation-comms.kvstorageconfig.authemail.md +21 -0
- package/docs/api/foundation-comms.kvstorageconfig.authkey.md +16 -0
- package/docs/api/foundation-comms.kvstorageconfig.md +26 -0
- package/docs/api/foundation-comms.kvstorageconfig.namespace.md +16 -0
- package/docs/api/foundation-comms.kvvalue.md +16 -0
- package/docs/api/foundation-comms.md +19 -6
- package/docs/api/foundation-comms.messagehaserrorcode.md +13 -1
- package/docs/api/foundation-comms.messageorthrow.md +14 -1
- package/docs/api/foundation-comms.retryinterval.md +15 -1
- package/docs/api/foundation-comms.socket.md +1 -0
- package/docs/api/foundation-comms.socket.sendforstreamwithoutteardown.md +31 -0
- package/docs/api/foundation-comms.tofieldmetadata.md +14 -1
- package/docs/{api-report.md → api-report.md.api.md} +47 -31
- package/package.json +14 -14
@@ -0,0 +1,38 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultEntityDatasource](./foundation-comms.defaultentitydatasource.md)
|
4
|
+
|
5
|
+
## DefaultEntityDatasource class
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
Default EntityDatasource DI implementation.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
export declare class DefaultEntityDatasource<TDTO, TEntity> extends DefaultDatasource implements EntityDatasource<TDTO, TEntity>
|
16
|
+
```
|
17
|
+
**Extends:** [DefaultDatasource](./foundation-comms.defaultdatasource.md)
|
18
|
+
|
19
|
+
**Implements:** [EntityDatasource](./foundation-comms.entitydatasource.md)<!-- --><TDTO, TEntity>
|
20
|
+
|
21
|
+
## Properties
|
22
|
+
|
23
|
+
| Property | Modifiers | Type | Description |
|
24
|
+
| --- | --- | --- | --- |
|
25
|
+
| [\_initialized](./foundation-comms.defaultentitydatasource._initialized.md) | <code>protected</code> | boolean | **_(ALPHA)_** |
|
26
|
+
| [cache](./foundation-comms.defaultentitydatasource.cache.md) | <code>readonly</code> | TEntity\[\] | **_(ALPHA)_** |
|
27
|
+
| [disconnect](./foundation-comms.defaultentitydatasource.disconnect.md) | | () => void | **_(ALPHA)_** |
|
28
|
+
| [entityCache](./foundation-comms.defaultentitydatasource.entitycache.md) | <code>protected</code> | TEntity\[\] | **_(ALPHA)_** |
|
29
|
+
| [entityMap](./foundation-comms.defaultentitydatasource.entitymap.md) | <code>protected</code> | Map<string, TEntity> | **_(ALPHA)_** |
|
30
|
+
| [initialize](./foundation-comms.defaultentitydatasource.initialize.md) | | (init: [EntityDatasourceInit](./foundation-comms.entitydatasourceinit.md)<!-- --><TDTO, TEntity>) => Promise<boolean> | **_(ALPHA)_** |
|
31
|
+
| [initialized](./foundation-comms.defaultentitydatasource.initialized.md) | | boolean | **_(ALPHA)_** |
|
32
|
+
| [isEmpty](./foundation-comms.defaultentitydatasource.isempty.md) | <code>readonly</code> | boolean | **_(ALPHA)_** |
|
33
|
+
| [mapper](./foundation-comms.defaultentitydatasource.mapper.md) | <code>protected</code> | DTOMapper<TDTO, TEntity> | **_(ALPHA)_** |
|
34
|
+
| [rowId](./foundation-comms.defaultentitydatasource.rowid.md) | <code>protected</code> | string | **_(ALPHA)_** |
|
35
|
+
| [sourceRef](./foundation-comms.defaultentitydatasource.sourceref.md) | <code>protected</code> | string | **_(ALPHA)_** |
|
36
|
+
| [subscription](./foundation-comms.defaultentitydatasource.subscription.md) | <code>protected</code> | SocketSubscription | **_(ALPHA)_** |
|
37
|
+
| [subscriptionLoggedOff](./foundation-comms.defaultentitydatasource.subscriptionloggedoff.md) | <code>protected</code> | boolean | **_(ALPHA)_** |
|
38
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultEntityDatasource](./foundation-comms.defaultentitydatasource.md) > [rowId](./foundation-comms.defaultentitydatasource.rowid.md)
|
4
|
+
|
5
|
+
## DefaultEntityDatasource.rowId property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
protected rowId: string;
|
14
|
+
```
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultEntityDatasource](./foundation-comms.defaultentitydatasource.md) > [sourceRef](./foundation-comms.defaultentitydatasource.sourceref.md)
|
4
|
+
|
5
|
+
## DefaultEntityDatasource.sourceRef property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
protected sourceRef: string;
|
14
|
+
```
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultEntityDatasource](./foundation-comms.defaultentitydatasource.md) > [subscription](./foundation-comms.defaultentitydatasource.subscription.md)
|
4
|
+
|
5
|
+
## DefaultEntityDatasource.subscription property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
protected subscription: SocketSubscription;
|
14
|
+
```
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultEntityDatasource](./foundation-comms.defaultentitydatasource.md) > [subscriptionLoggedOff](./foundation-comms.defaultentitydatasource.subscriptionloggedoff.md)
|
4
|
+
|
5
|
+
## DefaultEntityDatasource.subscriptionLoggedOff property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
protected subscriptionLoggedOff: boolean;
|
14
|
+
```
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultKVStorage](./foundation-comms.defaultkvstorage.md) > [(constructor)](./foundation-comms.defaultkvstorage._constructor_.md)
|
4
|
+
|
5
|
+
## DefaultKVStorage.(constructor)
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
Constructs a new instance of the `DefaultKVStorage` class
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
constructor(connect: Connect, user: User, kvStorageConfig?: KVStorageConfig);
|
16
|
+
```
|
17
|
+
|
18
|
+
## Parameters
|
19
|
+
|
20
|
+
| Parameter | Type | Description |
|
21
|
+
| --- | --- | --- |
|
22
|
+
| connect | [Connect](./foundation-comms.connect.md) | |
|
23
|
+
| user | User | |
|
24
|
+
| kvStorageConfig | [KVStorageConfig](./foundation-comms.kvstorageconfig.md) | _(Optional)_ |
|
25
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultKVStorage](./foundation-comms.defaultkvstorage.md)
|
4
|
+
|
5
|
+
## DefaultKVStorage class
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
The default implementation for the KVStorage interface.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
export declare class DefaultKVStorage implements KVStorage
|
16
|
+
```
|
17
|
+
**Implements:** [KVStorage](./foundation-comms.kvstorage.md)
|
18
|
+
|
19
|
+
## Constructors
|
20
|
+
|
21
|
+
| Constructor | Modifiers | Description |
|
22
|
+
| --- | --- | --- |
|
23
|
+
| [(constructor)(connect, user, kvStorageConfig)](./foundation-comms.defaultkvstorage._constructor_.md) | | **_(ALPHA)_** Constructs a new instance of the <code>DefaultKVStorage</code> class |
|
24
|
+
|
25
|
+
## Properties
|
26
|
+
|
27
|
+
| Property | Modifiers | Type | Description |
|
28
|
+
| --- | --- | --- | --- |
|
29
|
+
| [user](./foundation-comms.defaultkvstorage.user.md) | <code>protected</code> | User | **_(ALPHA)_** |
|
30
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [DefaultKVStorage](./foundation-comms.defaultkvstorage.md) > [user](./foundation-comms.defaultkvstorage.user.md)
|
4
|
+
|
5
|
+
## DefaultKVStorage.user property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
protected user: User;
|
14
|
+
```
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [defaultKVStorageConfig](./foundation-comms.defaultkvstorageconfig.md)
|
4
|
+
|
5
|
+
## defaultKVStorageConfig variable
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
The default configuration for the KVStorage service.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
defaultKVStorageConfig: KVStorageConfig
|
16
|
+
```
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasource](./foundation-comms.entitydatasource.md) > [cache](./foundation-comms.entitydatasource.cache.md)
|
4
|
+
|
5
|
+
## EntityDatasource.cache property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
readonly cache: TEntity[];
|
14
|
+
```
|
15
|
+
|
16
|
+
## Remarks
|
17
|
+
|
18
|
+
In-memory entity cache.
|
19
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasource](./foundation-comms.entitydatasource.md) > [disconnect](./foundation-comms.entitydatasource.disconnect.md)
|
4
|
+
|
5
|
+
## EntityDatasource.disconnect() method
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
disconnect(): void;
|
14
|
+
```
|
15
|
+
**Returns:**
|
16
|
+
|
17
|
+
void
|
18
|
+
|
19
|
+
## Remarks
|
20
|
+
|
21
|
+
Disconnect and reset cache.
|
22
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasource](./foundation-comms.entitydatasource.md) > [initialize](./foundation-comms.entitydatasource.initialize.md)
|
4
|
+
|
5
|
+
## EntityDatasource.initialize() method
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
initialize(init: EntityDatasourceInit<TDTO, TEntity>): Promise<boolean>;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| init | [EntityDatasourceInit](./foundation-comms.entitydatasourceinit.md)<!-- --><TDTO, TEntity> | |
|
21
|
+
|
22
|
+
**Returns:**
|
23
|
+
|
24
|
+
Promise<boolean>
|
25
|
+
|
26
|
+
## Remarks
|
27
|
+
|
28
|
+
Initialize datasource.
|
29
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasource](./foundation-comms.entitydatasource.md) > [isEmpty](./foundation-comms.entitydatasource.isempty.md)
|
4
|
+
|
5
|
+
## EntityDatasource.isEmpty property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
readonly isEmpty: boolean;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Remarks
|
17
|
+
|
18
|
+
Cache is empty / awaiting first result.
|
19
|
+
|
@@ -0,0 +1,81 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasource](./foundation-comms.entitydatasource.md)
|
4
|
+
|
5
|
+
## EntityDatasource interface
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
EntityDatasource DI interface.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
export interface EntityDatasource<TDTO, TEntity> extends Datasource
|
16
|
+
```
|
17
|
+
**Extends:** [Datasource](./foundation-comms.datasource.md)
|
18
|
+
|
19
|
+
## Remarks
|
20
|
+
|
21
|
+
A simple streaming datasource cache used mainly by services that employ DTO mappers.
|
22
|
+
|
23
|
+
## Example
|
24
|
+
|
25
|
+
An example service using an underlying EntityDatasource:
|
26
|
+
|
27
|
+
```ts
|
28
|
+
export class DefaultDomainService implements DomainService {
|
29
|
+
constructor(
|
30
|
+
@EntityDatasource protected datasource: EntityDatasource<DomainDTO, DomainEntity>,
|
31
|
+
@DomainDTOMapper protected mapper: DomainDTOMapper,
|
32
|
+
@optional(DomainServiceConfig) private config = defaultConfig
|
33
|
+
) {}
|
34
|
+
|
35
|
+
get initialized = () {
|
36
|
+
return this.datasource.initialized;
|
37
|
+
}
|
38
|
+
|
39
|
+
initialize = async (init) => {
|
40
|
+
await this.datasource.initialize({
|
41
|
+
mapper: this.mapper,
|
42
|
+
options: {
|
43
|
+
resourceName: this.config.resourceName,
|
44
|
+
...init,
|
45
|
+
},
|
46
|
+
});
|
47
|
+
return this.initialized;
|
48
|
+
};
|
49
|
+
|
50
|
+
list = () => this.datasource.cache;
|
51
|
+
|
52
|
+
get = async (id: string) => this.datasource.cache.find((entity) => entity.id === id);
|
53
|
+
|
54
|
+
action = async (id: string, message?: string): Promise<Message> => {
|
55
|
+
return this.commitEvent('EVENT_DOMAIN_ACTION', { id, message });
|
56
|
+
};
|
57
|
+
|
58
|
+
private async commitEvent(event: string, entity: Partial<DomainEntity>) {
|
59
|
+
const msg = await this.connect.commitEvent(event, {
|
60
|
+
DETAILS: this.mapper.toDTO(entity),
|
61
|
+
IGNORE_WARNINGS: true,
|
62
|
+
VALIDATE: false,
|
63
|
+
});
|
64
|
+
return messageOrThrow(msg);
|
65
|
+
}
|
66
|
+
```
|
67
|
+
|
68
|
+
## Properties
|
69
|
+
|
70
|
+
| Property | Modifiers | Type | Description |
|
71
|
+
| --- | --- | --- | --- |
|
72
|
+
| [cache](./foundation-comms.entitydatasource.cache.md) | <code>readonly</code> | TEntity\[\] | **_(ALPHA)_** |
|
73
|
+
| [isEmpty](./foundation-comms.entitydatasource.isempty.md) | <code>readonly</code> | boolean | **_(ALPHA)_** |
|
74
|
+
|
75
|
+
## Methods
|
76
|
+
|
77
|
+
| Method | Description |
|
78
|
+
| --- | --- |
|
79
|
+
| [disconnect()](./foundation-comms.entitydatasource.disconnect.md) | **_(ALPHA)_** |
|
80
|
+
| [initialize(init)](./foundation-comms.entitydatasource.initialize.md) | **_(ALPHA)_** |
|
81
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasourceInit](./foundation-comms.entitydatasourceinit.md) > [fetchMeta](./foundation-comms.entitydatasourceinit.fetchmeta.md)
|
4
|
+
|
5
|
+
## EntityDatasourceInit.fetchMeta property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
fetchMeta?: boolean;
|
14
|
+
```
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasourceInit](./foundation-comms.entitydatasourceinit.md) > [mapper](./foundation-comms.entitydatasourceinit.mapper.md)
|
4
|
+
|
5
|
+
## EntityDatasourceInit.mapper property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
mapper: DTOMapper<TDTO, TEntity>;
|
14
|
+
```
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasourceInit](./foundation-comms.entitydatasourceinit.md)
|
4
|
+
|
5
|
+
## EntityDatasourceInit interface
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
EntityDatasourceInit interface.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
export interface EntityDatasourceInit<TDTO, TEntity>
|
16
|
+
```
|
17
|
+
|
18
|
+
## Properties
|
19
|
+
|
20
|
+
| Property | Modifiers | Type | Description |
|
21
|
+
| --- | --- | --- | --- |
|
22
|
+
| [fetchMeta?](./foundation-comms.entitydatasourceinit.fetchmeta.md) | | boolean | **_(ALPHA)_** _(Optional)_ |
|
23
|
+
| [mapper](./foundation-comms.entitydatasourceinit.mapper.md) | | DTOMapper<TDTO, TEntity> | **_(ALPHA)_** |
|
24
|
+
| [options](./foundation-comms.entitydatasourceinit.options.md) | | Omit<[DatasourceOptions](./foundation-comms.datasourceoptions.md)<!-- -->, 'isSnapshot'> | **_(ALPHA)_** |
|
25
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [EntityDatasourceInit](./foundation-comms.entitydatasourceinit.md) > [options](./foundation-comms.entitydatasourceinit.options.md)
|
4
|
+
|
5
|
+
## EntityDatasourceInit.options property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
options: Omit<DatasourceOptions, 'isSnapshot'>;
|
14
|
+
```
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [extractFieldDefinitions](./foundation-comms.extractfielddefinitions.md)
|
4
4
|
|
5
|
-
## extractFieldDefinitions
|
5
|
+
## extractFieldDefinitions() function
|
6
6
|
|
7
7
|
Extracts the field definitions from the metadata.
|
8
8
|
|
@@ -11,3 +11,16 @@ Extracts the field definitions from the metadata.
|
|
11
11
|
```typescript
|
12
12
|
extractFieldDefinitions: (metadata: Metadata) => MetadataDetail[]
|
13
13
|
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| metadata | [Metadata](./foundation-comms.metadata.md) | The metadata object. |
|
20
|
+
|
21
|
+
**Returns:**
|
22
|
+
|
23
|
+
[MetadataDetail](./foundation-comms.metadatadetail.md)<!-- -->\[\]
|
24
|
+
|
25
|
+
An array of metadata detail.
|
26
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValue](./foundation-comms.keyvalue.md) > [base64](./foundation-comms.keyvalue.base64.md)
|
4
|
+
|
5
|
+
## KeyValue.base64 property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
Value should be encoded.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
base64?: boolean;
|
16
|
+
```
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValue](./foundation-comms.keyvalue.md) > [expiration](./foundation-comms.keyvalue.expiration.md)
|
4
|
+
|
5
|
+
## KeyValue.expiration property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
Time key expires.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
expiration?: number;
|
16
|
+
```
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValue](./foundation-comms.keyvalue.md) > [key](./foundation-comms.keyvalue.key.md)
|
4
|
+
|
5
|
+
## KeyValue.key property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
Key
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
key: string;
|
16
|
+
```
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValue](./foundation-comms.keyvalue.md)
|
4
|
+
|
5
|
+
## KeyValue interface
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
KeyValue interface.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
export interface KeyValue<T = KVValue>
|
16
|
+
```
|
17
|
+
|
18
|
+
## Properties
|
19
|
+
|
20
|
+
| Property | Modifiers | Type | Description |
|
21
|
+
| --- | --- | --- | --- |
|
22
|
+
| [base64?](./foundation-comms.keyvalue.base64.md) | | boolean | **_(ALPHA)_** _(Optional)_ Value should be encoded. |
|
23
|
+
| [expiration?](./foundation-comms.keyvalue.expiration.md) | | number | **_(ALPHA)_** _(Optional)_ Time key expires. |
|
24
|
+
| [key](./foundation-comms.keyvalue.key.md) | | string | **_(ALPHA)_** Key |
|
25
|
+
| [metadata?](./foundation-comms.keyvalue.metadata.md) | | { \[key: string\]: unknown; } | **_(ALPHA)_** _(Optional)_ Additional metadata. |
|
26
|
+
| [value?](./foundation-comms.keyvalue.value.md) | | T | **_(ALPHA)_** _(Optional)_ Value |
|
27
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValue](./foundation-comms.keyvalue.md) > [metadata](./foundation-comms.keyvalue.metadata.md)
|
4
|
+
|
5
|
+
## KeyValue.metadata property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
Additional metadata.
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
metadata?: {
|
16
|
+
[key: string]: unknown;
|
17
|
+
};
|
18
|
+
```
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValue](./foundation-comms.keyvalue.md) > [value](./foundation-comms.keyvalue.value.md)
|
4
|
+
|
5
|
+
## KeyValue.value property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
Value
|
11
|
+
|
12
|
+
**Signature:**
|
13
|
+
|
14
|
+
```typescript
|
15
|
+
value?: T;
|
16
|
+
```
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValueTransfer](./foundation-comms.keyvaluetransfer.md) > [deserialize](./foundation-comms.keyvaluetransfer.deserialize.md)
|
4
|
+
|
5
|
+
## KeyValueTransfer.deserialize() method
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
deserialize?(value: unknown): Promise<T>;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| value | unknown | |
|
21
|
+
|
22
|
+
**Returns:**
|
23
|
+
|
24
|
+
Promise<T>
|
25
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-comms](./foundation-comms.md) > [KeyValueTransfer](./foundation-comms.keyvaluetransfer.md) > [kv](./foundation-comms.keyvaluetransfer.kv.md)
|
4
|
+
|
5
|
+
## KeyValueTransfer.kv property
|
6
|
+
|
7
|
+
> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
8
|
+
>
|
9
|
+
|
10
|
+
**Signature:**
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
kv: KeyValue<T>;
|
14
|
+
```
|