@genesislcap/foundation-comms 14.187.1-alpha-3406925.0 → 14.187.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/dts/connect/connect.d.ts +6 -11
- package/dist/dts/connect/connect.d.ts.map +1 -1
- package/dist/dts/connect/http.connect.d.ts +2 -2
- package/dist/dts/connect/http.connect.d.ts.map +1 -1
- package/dist/dts/connect/message.d.ts +0 -11
- package/dist/dts/connect/message.d.ts.map +1 -1
- package/dist/dts/connect/socket.d.ts +2 -6
- package/dist/dts/connect/socket.d.ts.map +1 -1
- package/dist/dts/datasource/datasource.d.ts +19 -49
- package/dist/dts/datasource/datasource.d.ts.map +1 -1
- package/dist/dts/datasource/datasource.types.d.ts +22 -14
- package/dist/dts/datasource/datasource.types.d.ts.map +1 -1
- package/dist/dts/datasource/entityDatasource.d.ts +8 -5
- package/dist/dts/datasource/entityDatasource.d.ts.map +1 -1
- package/dist/dts/datasource/index.d.ts +0 -2
- package/dist/dts/datasource/index.d.ts.map +1 -1
- package/dist/dts/index.d.ts +0 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/testing/mocks/auth/auth.d.ts +0 -3
- package/dist/dts/testing/mocks/auth/auth.d.ts.map +1 -1
- package/dist/dts/testing/mocks/connect/connect.d.ts +2 -3
- package/dist/dts/testing/mocks/connect/connect.d.ts.map +1 -1
- package/dist/dts/testing/mocks/connect/socket.d.ts +0 -1
- package/dist/dts/testing/mocks/connect/socket.d.ts.map +1 -1
- package/dist/dts/testing/mocks/datasource/datasource.d.ts +4 -22
- package/dist/dts/testing/mocks/datasource/datasource.d.ts.map +1 -1
- package/dist/dts/testing/mocks/index.d.ts +0 -1
- package/dist/dts/testing/mocks/index.d.ts.map +1 -1
- package/dist/esm/connect/connect.js +15 -12
- package/dist/esm/connect/http.connect.js +3 -5
- package/dist/esm/connect/message.js +0 -2
- package/dist/esm/connect/socket.js +6 -19
- package/dist/esm/datasource/datasource.js +58 -133
- package/dist/esm/datasource/datasource.types.js +18 -2
- package/dist/esm/datasource/entityDatasource.js +0 -6
- package/dist/esm/datasource/index.js +0 -2
- package/dist/esm/index.js +0 -1
- package/dist/esm/testing/mocks/auth/auth.js +0 -10
- package/dist/esm/testing/mocks/connect/connect.js +2 -9
- package/dist/esm/testing/mocks/connect/socket.js +0 -2
- package/dist/esm/testing/mocks/datasource/datasource.js +0 -59
- package/dist/esm/testing/mocks/index.js +0 -1
- package/dist/foundation-comms.api.json +6042 -10797
- package/dist/foundation-comms.d.ts +37 -696
- package/docs/api/foundation-comms.connect.connect.md +2 -2
- package/docs/api/foundation-comms.connect.getavailableresources.md +2 -2
- package/docs/api/foundation-comms.connect.md +0 -1
- package/docs/api/{foundation-comms.datasource.status.md → foundation-comms.datasource.fieldmetadata.md} +4 -3
- package/docs/api/foundation-comms.datasource.init.md +2 -2
- package/docs/api/foundation-comms.datasource.md +2 -3
- package/docs/api/foundation-comms.datasourceconfig.md +1 -2
- package/docs/api/foundation-comms.defaultconnect.connect.md +2 -2
- package/docs/api/foundation-comms.defaultconnect.getavailableresources.md +2 -2
- package/docs/api/foundation-comms.defaultconnect.md +0 -1
- package/docs/api/foundation-comms.defaultdatasource._constructor_.md +2 -3
- package/docs/api/{foundation-comms.defaultdatasource.fetchmetadatarequired.md → foundation-comms.defaultdatasource._stream.md} +3 -4
- package/docs/api/foundation-comms.defaultdatasource.availableindexes.md +1 -2
- package/docs/api/foundation-comms.defaultdatasource.fieldmetadata.md +0 -1
- package/docs/api/foundation-comms.defaultdatasource.initialized.md +1 -3
- package/docs/api/foundation-comms.defaultdatasource.md +7 -10
- package/docs/api/foundation-comms.defaultdatasource.originalfielddef.md +1 -2
- package/docs/api/foundation-comms.defaultdatasource.requestfields.md +1 -2
- package/docs/api/foundation-comms.defaultdatasource.stream.md +1 -1
- package/docs/api/foundation-comms.defaultdatasource.validresourcename.md +0 -5
- package/docs/api/foundation-comms.defaultdatasourceconfig.md +1 -1
- package/docs/api/foundation-comms.defaulthttpconnect.getavailableresources.md +2 -2
- package/docs/api/foundation-comms.defaultsocket._constructor_.md +1 -2
- package/docs/api/foundation-comms.defaultsocket.connect.md +2 -2
- package/docs/api/foundation-comms.defaultsocket.md +1 -3
- package/docs/api/foundation-comms.eventmessagetype.md +0 -2
- package/docs/api/foundation-comms.md +2 -19
- package/docs/api/foundation-comms.socket.md +0 -6
- package/docs/api-report.md +25 -550
- package/package.json +12 -13
- package/dist/dts/datasource/datasource.config.d.ts +0 -44
- package/dist/dts/datasource/datasource.config.d.ts.map +0 -1
- package/dist/dts/datasource/datasource.mixins.d.ts +0 -367
- package/dist/dts/datasource/datasource.mixins.d.ts.map +0 -1
- package/dist/dts/resources/genesis/config.d.ts +0 -81
- package/dist/dts/resources/genesis/config.d.ts.map +0 -1
- package/dist/dts/resources/genesis/genesis.d.ts +0 -69
- package/dist/dts/resources/genesis/genesis.d.ts.map +0 -1
- package/dist/dts/resources/genesis/index.d.ts +0 -4
- package/dist/dts/resources/genesis/index.d.ts.map +0 -1
- package/dist/dts/resources/genesis/types.d.ts +0 -19
- package/dist/dts/resources/genesis/types.d.ts.map +0 -1
- package/dist/dts/resources/index.d.ts +0 -2
- package/dist/dts/resources/index.d.ts.map +0 -1
- package/dist/dts/testing/mocks/resources/genesis/genesis.d.ts +0 -16
- package/dist/dts/testing/mocks/resources/genesis/genesis.d.ts.map +0 -1
- package/dist/dts/testing/mocks/resources/genesis/index.d.ts +0 -2
- package/dist/dts/testing/mocks/resources/genesis/index.d.ts.map +0 -1
- package/dist/dts/testing/mocks/resources/index.d.ts +0 -2
- package/dist/dts/testing/mocks/resources/index.d.ts.map +0 -1
- package/dist/esm/datasource/datasource.config.js +0 -41
- package/dist/esm/datasource/datasource.mixins.js +0 -86
- package/dist/esm/resources/genesis/config.js +0 -51
- package/dist/esm/resources/genesis/genesis.js +0 -114
- package/dist/esm/resources/genesis/index.js +0 -3
- package/dist/esm/resources/genesis/types.js +0 -4
- package/dist/esm/resources/index.js +0 -1
- package/dist/esm/testing/mocks/resources/genesis/genesis.js +0 -25
- package/dist/esm/testing/mocks/resources/genesis/index.js +0 -1
- package/dist/esm/testing/mocks/resources/index.js +0 -1
- package/docs/api/foundation-comms.connect.host.md +0 -11
- package/docs/api/foundation-comms.datasourceconfig.eventemitter.md +0 -18
- package/docs/api/foundation-comms.datasourceeventhandler.md +0 -353
- package/docs/api/foundation-comms.datasourcemetadata.availableindexes.md +0 -11
- package/docs/api/foundation-comms.datasourcemetadata.fetchmetadatarequired.md +0 -11
- package/docs/api/foundation-comms.datasourcemetadata.fieldmetadata.md +0 -11
- package/docs/api/foundation-comms.datasourcemetadata.md +0 -24
- package/docs/api/foundation-comms.datasourcemetadata.originalfielddef.md +0 -11
- package/docs/api/foundation-comms.datasourcemetadata.requestfields.md +0 -11
- package/docs/api/foundation-comms.datasourcestatus.md +0 -21
- package/docs/api/foundation-comms.datasourcestatuschanged.md +0 -13
- package/docs/api/foundation-comms.datasourcestatuschangedevent.md +0 -15
- package/docs/api/foundation-comms.defaultconnect.host.md +0 -11
- package/docs/api/foundation-comms.defaultdatasource.fetchandapplymetadata.md +0 -22
- package/docs/api/foundation-comms.defaultdatasource.resources.md +0 -11
- package/docs/api/foundation-comms.defaultdatasource.status.md +0 -12
- package/docs/api/foundation-comms.defaultgenesisresources._constructor_.md +0 -21
- package/docs/api/foundation-comms.defaultgenesisresources.config.md +0 -11
- package/docs/api/foundation-comms.defaultgenesisresources.connect.md +0 -11
- package/docs/api/foundation-comms.defaultgenesisresources.destroy.md +0 -17
- package/docs/api/foundation-comms.defaultgenesisresources.getresources.md +0 -15
- package/docs/api/foundation-comms.defaultgenesisresources.getresourcetypefor.md +0 -24
- package/docs/api/foundation-comms.defaultgenesisresources.isvalidresource.md +0 -24
- package/docs/api/foundation-comms.defaultgenesisresources.md +0 -40
- package/docs/api/foundation-comms.defaultgenesisresources.postloadedmessage.md +0 -15
- package/docs/api/foundation-comms.defaultgenesisresources.resources.md +0 -11
- package/docs/api/foundation-comms.defaultgenesisresources.resourcespromise.md +0 -11
- package/docs/api/foundation-comms.defaultgenesisresourcesconfig.md +0 -13
- package/docs/api/foundation-comms.defaultsocket.config.md +0 -11
- package/docs/api/foundation-comms.defaultsocket.host.md +0 -11
- package/docs/api/foundation-comms.genesisresources.destroy.md +0 -13
- package/docs/api/foundation-comms.genesisresources.getresourcetypefor.md +0 -13
- package/docs/api/foundation-comms.genesisresources.isvalidresource.md +0 -13
- package/docs/api/foundation-comms.genesisresources.md +0 -26
- package/docs/api/foundation-comms.genesisresourceschannel.md +0 -33
- package/docs/api/foundation-comms.genesisresourceschannelid.md +0 -12
- package/docs/api/foundation-comms.genesisresourcesconfig.md +0 -21
- package/docs/api/foundation-comms.genesisresourcesconfig.throwwhenunavailable.md +0 -13
- package/docs/api/foundation-comms.genesisresourcesconfig.throwwhenunknown.md +0 -13
- package/docs/api/foundation-comms.genesisresourcesevents.md +0 -17
- package/docs/api/foundation-comms.genesisresourcesmock.destroy.md +0 -15
- package/docs/api/foundation-comms.genesisresourcesmock.getresourcetypefor.md +0 -24
- package/docs/api/foundation-comms.genesisresourcesmock.isvalidresource.md +0 -24
- package/docs/api/foundation-comms.genesisresourcesmock.md +0 -30
- package/docs/api/foundation-comms.genesisresourcesmock.nextisvalidresourceresponse.md +0 -11
- package/docs/api/foundation-comms.genesisresourcesmock.nextresourcetypeforresponse.md +0 -11
- package/docs/api/foundation-comms.genesisresourcesmock.resources.md +0 -11
- package/docs/api/foundation-comms.getgenesisresources.md +0 -30
- package/docs/api/foundation-comms.getgenesisresourceschannel.md +0 -39
- package/docs/api/foundation-comms.resourceitem.md +0 -15
- package/docs/api/foundation-comms.resourcesmessage.md +0 -18
- package/docs/api/foundation-comms.socket.host.md +0 -11
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../../../../src/testing/mocks/connect/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAQ,UAAU,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,qBAAa,UAAW,YAAW,MAAM;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,eAAe,CAAC,OAAO,CAAC,CAA6B;IACzE,cAAc,EAAE,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../../../../src/testing/mocks/connect/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAQ,UAAU,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,qBAAa,UAAW,YAAW,MAAM;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,eAAe,CAAC,OAAO,CAAC,CAA6B;IACzE,cAAc,EAAE,OAAO,CAAC;IAExB,WAAW,EAAE,OAAO,CAAC;IACrB,qBAAqB,8BAAgC;IAErD,OAAO,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,oBAAoB,EAC9B,gBAAgB,CAAC,EAAE,sBAAsB,GACxC,OAAO,CAAC,OAAO,CAAC;IAIZ,UAAU,IAAI,IAAI;IAElB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC;IAItD,aAAa,CAAC,CAAC,EACpB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,QAAQ,EACjB,UAAU,CAAC,EAAE,QAAQ,GACpB,UAAU,CAAC,OAAO,CAAC;IAItB,4BAA4B,CAAC,CAAC,EAC5B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,QAAQ,GAChB,UAAU,CAAC,OAAO,CAAC;IAIf,cAAc,IAAI,aAAa,CAAC,OAAO,CAAC;IAI/C,KAAK,IAAI,IAAI;CAGd"}
|
@@ -1,34 +1,16 @@
|
|
1
|
-
import {
|
2
|
-
import type { Datasource, DatasourceOptions,
|
3
|
-
import { FieldMetadata, FilteredDataServerResult,
|
1
|
+
import { SocketObservable } from '../../../connect';
|
2
|
+
import type { Datasource, DatasourceOptions, Dataview, ResourceType } from '../../../datasource';
|
3
|
+
import { FieldMetadata, FilteredDataServerResult, RequestServerResult } from '../../../metadata';
|
4
4
|
/**
|
5
5
|
* @internal
|
6
6
|
*/
|
7
7
|
export declare class DatasourceMock implements Datasource {
|
8
|
-
status: DatasourceStatus;
|
9
|
-
fetchMetadataRequired: boolean;
|
10
|
-
protected fetchingMetadata: boolean;
|
11
|
-
originalFieldDef: MetadataDetail[];
|
12
|
-
fieldMetadata: FieldMetadata[];
|
13
|
-
requestFields: MetadataDetail[];
|
14
|
-
availableIndexes: IndexDetail[];
|
15
8
|
initialized: boolean;
|
9
|
+
fieldMetadata: FieldMetadata[];
|
16
10
|
readOnly: boolean;
|
17
11
|
resourceType: ResourceType;
|
18
12
|
stream: SocketObservable<FilteredDataServerResult | RequestServerResult>;
|
19
13
|
init(options: DatasourceOptions, fetchMeta: boolean): Promise<boolean>;
|
20
|
-
/**
|
21
|
-
* Convenience method to avoid you having to prime connect etc.
|
22
|
-
* @param meta - The metadata to set.
|
23
|
-
*/
|
24
|
-
setMetadata(meta: Metadata): void;
|
25
|
-
unsetMedata(): void;
|
26
|
-
/**
|
27
|
-
* Convenience method to avoid you having to prime connect etc.
|
28
|
-
* @param message - The Message to stream.
|
29
|
-
*/
|
30
|
-
setStream(message: Message): void;
|
31
|
-
unsetStream(): void;
|
32
14
|
deinit(): void;
|
33
15
|
destroy(): void;
|
34
16
|
validResourceName(resourceName: string): boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../../../../src/testing/mocks/datasource/datasource.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../../../../src/testing/mocks/datasource/datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEjG;;GAEG;AACH,qBAAa,cAAe,YAAW,UAAU;IAC/C,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC,wBAAwB,GAAG,mBAAmB,CAAC,CAAC;IAEzE,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAItE,MAAM;IAEN,OAAO;IAEP,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAMhD,WAAW,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAI5D,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG;IAErB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM;IAE/B,UAAU,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAIhC,OAAO,CAAC,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAE9B,QAAQ,CAAC,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAE/B,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzC,UAAU,CAAC,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvC,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __awaiter, __decorate, __param } from "tslib";
|
2
|
-
import { FORCE_HTTP
|
3
|
-
import { observable } from '@microsoft/fast-element';
|
2
|
+
import { FORCE_HTTP } from '@genesislcap/foundation-utils';
|
3
|
+
import { observable, volatile } from '@microsoft/fast-element';
|
4
4
|
import { DI } from '@microsoft/fast-foundation';
|
5
5
|
import { scan } from 'rxjs';
|
6
6
|
import { MetaCache } from '../metadata';
|
@@ -8,7 +8,7 @@ import { logger } from '../utils';
|
|
8
8
|
import { ConnectEventsEmitter } from './connect.events';
|
9
9
|
import { ConnectConfig } from './connect.types';
|
10
10
|
import { HttpConnect } from './http.connect';
|
11
|
-
import { EventMessageType, MessageBuilder
|
11
|
+
import { EventMessageType, MessageBuilder } from './message';
|
12
12
|
import { Socket } from './socket';
|
13
13
|
import { updateState } from './updateState';
|
14
14
|
/**
|
@@ -26,9 +26,6 @@ let DefaultConnect = class DefaultConnect {
|
|
26
26
|
var _a;
|
27
27
|
return (_a = this.socket.isConnectedSubject) === null || _a === void 0 ? void 0 : _a.asObservable();
|
28
28
|
}
|
29
|
-
get host() {
|
30
|
-
return this.socket.host;
|
31
|
-
}
|
32
29
|
constructor(socket, messageBuilder, metaCache, events, config) {
|
33
30
|
this.socket = socket;
|
34
31
|
this.messageBuilder = messageBuilder;
|
@@ -49,9 +46,14 @@ let DefaultConnect = class DefaultConnect {
|
|
49
46
|
send(message, needsHandling) {
|
50
47
|
return this.socket.send(message, needsHandling);
|
51
48
|
}
|
52
|
-
connect(host
|
49
|
+
connect(host) {
|
53
50
|
return __awaiter(this, void 0, void 0, function* () {
|
54
51
|
this.socket.reset();
|
52
|
+
if (!this.config.isWebSocketExpression.test(host)) {
|
53
|
+
logger.error(`Specified host (${host}) is not valid WebSocket url. Connection will not proceed.`);
|
54
|
+
logger.warn(`Make sure the host url starts with wss:// or ws://`);
|
55
|
+
return;
|
56
|
+
}
|
55
57
|
return this.socket.connect(host, this.config.connect, this.config.reconnect);
|
56
58
|
});
|
57
59
|
}
|
@@ -184,11 +186,9 @@ let DefaultConnect = class DefaultConnect {
|
|
184
186
|
return this.socket.send(requestMessage);
|
185
187
|
}
|
186
188
|
getAvailableResources(params) {
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
return this.socket.send(requestMessage);
|
191
|
-
});
|
189
|
+
const requestMessage = this.messageBuilder.createResourcesMessage(params);
|
190
|
+
logger.debug(`${requestMessage.MESSAGE_TYPE} (resources) message created -> `, requestMessage);
|
191
|
+
return this.socket.send(requestMessage);
|
192
192
|
}
|
193
193
|
commitEvent(eventName, params) {
|
194
194
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -203,6 +203,9 @@ let DefaultConnect = class DefaultConnect {
|
|
203
203
|
__decorate([
|
204
204
|
observable
|
205
205
|
], DefaultConnect.prototype, "isWorking", void 0);
|
206
|
+
__decorate([
|
207
|
+
volatile
|
208
|
+
], DefaultConnect.prototype, "isConnected", null);
|
206
209
|
DefaultConnect = __decorate([
|
207
210
|
__param(0, Socket),
|
208
211
|
__param(1, MessageBuilder),
|
@@ -192,11 +192,9 @@ let DefaultHttpConnect = class DefaultHttpConnect {
|
|
192
192
|
return this.send(requestMessage);
|
193
193
|
}
|
194
194
|
getAvailableResources(params) {
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
return this.send(requestMessage);
|
199
|
-
});
|
195
|
+
const requestMessage = this.messageBuilder.createResourcesMessage(params);
|
196
|
+
logger.debug(`HTTP MODE! - ${requestMessage.MESSAGE_TYPE} (getResources) message created -> `, requestMessage);
|
197
|
+
return this.send(requestMessage);
|
200
198
|
}
|
201
199
|
commitEvent(eventName, params) {
|
202
200
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -39,8 +39,6 @@ export var EventMessageType;
|
|
39
39
|
EventMessageType["META_REQUEST"] = "META_REQUEST";
|
40
40
|
EventMessageType["JSON_SCHEMA_REQUEST"] = "JSON_SCHEMA_REQUEST";
|
41
41
|
EventMessageType["RESOURCES_REQUEST"] = "RESOURCES_REQUEST";
|
42
|
-
EventMessageType["RESOURCES_REQUEST_ACK"] = "RESOURCES_REQUEST_ACK";
|
43
|
-
EventMessageType["RESOURCES_REQUEST_NACK"] = "RESOURCES_REQUEST_NACK";
|
44
42
|
EventMessageType["EVENT_CHANGE_USER_PASSWORD"] = "EVENT_CHANGE_USER_PASSWORD";
|
45
43
|
EventMessageType["EVENT_SELF_SERVICE_PASSWORD_RESET"] = "EVENT_SELF_SERVICE_PASSWORD_RESET";
|
46
44
|
EventMessageType["EVENT_PASSWORD_RESET_ACTION"] = "EVENT_PASSWORD_RESET_ACTION";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __awaiter, __decorate, __param } from "tslib";
|
2
2
|
import { User } from '@genesislcap/foundation-user';
|
3
|
-
import {
|
3
|
+
import { JSONSerializer, UUID } from '@genesislcap/foundation-utils';
|
4
4
|
import { DOM, observable } from '@microsoft/fast-element';
|
5
5
|
import { DI } from '@microsoft/fast-foundation';
|
6
6
|
import { Observable, of, Subject, Subscription, takeUntil, throwError } from 'rxjs';
|
@@ -8,7 +8,6 @@ import { filter, mergeMap, switchMap, takeWhile } from 'rxjs/operators';
|
|
8
8
|
import { WebSocketSubject } from 'rxjs/webSocket';
|
9
9
|
import { Session } from '../session';
|
10
10
|
import { logger } from '../utils';
|
11
|
-
import { ConnectConfig } from './connect.types';
|
12
11
|
import { EventMessageType, MessageBuilder, MessageType, } from './message';
|
13
12
|
import { exponentialScheduler, linearScheduler, MAX_RECONNECT_ATTEMPTS, retryInterval, SocketReconnectStrategy, } from './reconnectStrategy';
|
14
13
|
import { SocketStatus } from './socket.status';
|
@@ -112,22 +111,17 @@ let DefaultSocket = class DefaultSocket {
|
|
112
111
|
set hasValidSession(value) {
|
113
112
|
logger.deprecated('set hasValidSession', 'Please refrain from calling this API as this state is managed internally.', '15.0.0');
|
114
113
|
}
|
115
|
-
get host() {
|
116
|
-
var _a;
|
117
|
-
return (_a = this.url) !== null && _a !== void 0 ? _a : GENESIS_SOCKET_URL;
|
118
|
-
}
|
119
114
|
constructor(messageBuilder, session, serializer, uuid, status,
|
120
115
|
/**
|
121
116
|
* Temp putting the user in place to bridge the hasValidSession logic.
|
122
117
|
*/
|
123
|
-
user
|
118
|
+
user) {
|
124
119
|
this.messageBuilder = messageBuilder;
|
125
120
|
this.session = session;
|
126
121
|
this.serializer = serializer;
|
127
122
|
this.uuid = uuid;
|
128
123
|
this.status = status;
|
129
124
|
this.user = user;
|
130
|
-
this.config = config;
|
131
125
|
this.defaultInterval = 10000;
|
132
126
|
this.secondsMultiplier = 1000;
|
133
127
|
this.heartbeatIsEnabled = true;
|
@@ -142,16 +136,10 @@ let DefaultSocket = class DefaultSocket {
|
|
142
136
|
var _a, _b;
|
143
137
|
return (_b = (_a = this.connectOptions) === null || _a === void 0 ? void 0 : _a.enableMessageLogging) !== null && _b !== void 0 ? _b : false;
|
144
138
|
}
|
145
|
-
connect(host
|
146
|
-
var _a;
|
139
|
+
connect(host, connectOptions, reconnectOptions) {
|
147
140
|
this.url = host;
|
148
|
-
this.connectOptions = connectOptions
|
149
|
-
this.reconnectOptions = reconnectOptions
|
150
|
-
if (!((_a = this.config.isWebSocketExpression) === null || _a === void 0 ? void 0 : _a.test(this.host))) {
|
151
|
-
logger.error(`Specified host (${this.host}) is not valid WebSocket url. Connection will not proceed.`);
|
152
|
-
logger.warn(`Make sure the host url starts with wss:// or ws://`);
|
153
|
-
return;
|
154
|
-
}
|
141
|
+
this.connectOptions = connectOptions;
|
142
|
+
this.reconnectOptions = reconnectOptions;
|
155
143
|
return new Promise((resolve) => {
|
156
144
|
var _a, _b, _c, _d;
|
157
145
|
logger.info(`${this.isReconnecting ? 'Reconnecting' : 'Connecting'} to ${this.url}`);
|
@@ -505,8 +493,7 @@ DefaultSocket = __decorate([
|
|
505
493
|
__param(2, JSONSerializer),
|
506
494
|
__param(3, UUID),
|
507
495
|
__param(4, SocketStatus),
|
508
|
-
__param(5, User)
|
509
|
-
__param(6, ConnectConfig)
|
496
|
+
__param(5, User)
|
510
497
|
], DefaultSocket);
|
511
498
|
export { DefaultSocket };
|
512
499
|
/**
|
@@ -1,47 +1,51 @@
|
|
1
1
|
import { __awaiter, __decorate, __param, __rest } from "tslib";
|
2
2
|
import { observable } from '@microsoft/fast-element';
|
3
|
-
import { DI } from '@microsoft/fast-foundation';
|
3
|
+
import { DI, optional } from '@microsoft/fast-foundation';
|
4
4
|
import { combineLatest, from, timer } from 'rxjs';
|
5
5
|
import { switchMap, takeWhile } from 'rxjs/operators';
|
6
6
|
import { Auth } from '../auth';
|
7
7
|
import { Connect } from '../connect';
|
8
8
|
import { extractFieldDefinitions, toFieldMetadata } from '../metadata/metadata.utils';
|
9
|
-
import { GenesisResources } from '../resources';
|
10
9
|
import { logger } from '../utils';
|
11
|
-
import {
|
12
|
-
import {
|
10
|
+
import { criteriaFiltersToFields } from './criteriaFiltersToFields';
|
11
|
+
import { dataServerResultFilter } from './dataServerResultFilter';
|
12
|
+
import { DatasourceConfig, DatasourceDefaults, ResourceType } from './datasource.types';
|
13
|
+
/**
|
14
|
+
* The default configuration for the Datasource service.
|
15
|
+
* @public
|
16
|
+
*/
|
17
|
+
export const defaultDatasourceConfig = {
|
18
|
+
options: {
|
19
|
+
criteria: '',
|
20
|
+
isSnapshot: false,
|
21
|
+
maxRows: DatasourceDefaults.MAX_ROWS_250,
|
22
|
+
maxView: DatasourceDefaults.MAX_VIEW_1000,
|
23
|
+
pollingInterval: DatasourceDefaults.REQ_REP_POLLING_INTERVAL_MS,
|
24
|
+
movingView: false,
|
25
|
+
orderBy: '',
|
26
|
+
resourceName: '',
|
27
|
+
reverse: false,
|
28
|
+
},
|
29
|
+
criteriaToFields: criteriaFiltersToFields,
|
30
|
+
dataServerResultFilter: dataServerResultFilter,
|
31
|
+
};
|
13
32
|
/**
|
14
33
|
* The default implementation for the Datasource interface.
|
15
34
|
* @public
|
16
35
|
*/
|
17
36
|
let DefaultDatasource = class DefaultDatasource {
|
18
|
-
|
19
|
-
get initialized() {
|
20
|
-
var _a;
|
21
|
-
return !!((_a = this.status) === null || _a === void 0 ? void 0 : _a.isInitialized);
|
22
|
-
}
|
23
|
-
constructor(connect, auth, resources, config) {
|
37
|
+
constructor(connect, auth, config = defaultDatasourceConfig) {
|
24
38
|
this.connect = connect;
|
25
39
|
this.auth = auth;
|
26
|
-
this.resources = resources;
|
27
40
|
this.config = config;
|
28
|
-
|
29
|
-
this.
|
30
|
-
/** {@inheritDoc DatasourceMetadata.originalFieldDef} */
|
41
|
+
this.initialized = false;
|
42
|
+
this.readOnly = true;
|
31
43
|
this.originalFieldDef = [];
|
32
|
-
/** {@inheritDoc DatasourceMetadata.fieldMetadata} */
|
33
|
-
this.fieldMetadata = [];
|
34
|
-
/** {@inheritDoc DatasourceMetadata.requestFields} */
|
35
44
|
this.requestFields = [];
|
36
|
-
|
45
|
+
this.fieldMetadata = [];
|
37
46
|
this.availableIndexes = [];
|
38
|
-
this.readOnly = true;
|
39
47
|
}
|
40
|
-
/**
|
41
|
-
* @deprecated - Please use {@link (GenesisResources:interface).isValidResource} instead.
|
42
|
-
*/
|
43
48
|
validResourceName(resourceName) {
|
44
|
-
logger.deprecated('Datasource.validResourceName', 'Use `GenesisResources.isValidResource` instead.');
|
45
49
|
if (!resourceName)
|
46
50
|
return false;
|
47
51
|
if (!resourceName.trim().length)
|
@@ -49,46 +53,41 @@ let DefaultDatasource = class DefaultDatasource {
|
|
49
53
|
// additional checks? regex? or maybe we can ask the server if it's a valid resource in the future
|
50
54
|
return true;
|
51
55
|
}
|
52
|
-
init(options, fetchMeta =
|
56
|
+
init(options, fetchMeta = true) {
|
57
|
+
var _a;
|
53
58
|
return __awaiter(this, void 0, void 0, function* () {
|
54
|
-
this.
|
55
|
-
this.options = Object.assign(Object.assign({}, this.config.options), options);
|
56
|
-
const resourceName = this.options.resourceName;
|
57
|
-
const connected = this.connect.isConnected || (yield this.connect.connect());
|
58
|
-
if (!connected) {
|
59
|
-
logger.error(`Unable to connect to ${this.connect.host} to get ${resourceName} datasource`);
|
60
|
-
this.reportStatus();
|
61
|
-
return false;
|
62
|
-
}
|
63
|
-
const isValidResource = yield this.resources.isValidResource(resourceName);
|
64
|
-
if (!isValidResource) {
|
65
|
-
logger.error(`${resourceName} datasource does not exist on ${this.connect.host}`);
|
66
|
-
this.reportStatus();
|
59
|
+
if (!this.validResourceName(options === null || options === void 0 ? void 0 : options.resourceName)) {
|
67
60
|
return false;
|
68
61
|
}
|
69
|
-
this.
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
62
|
+
this.options = Object.assign(Object.assign({}, this.config.options), options);
|
63
|
+
const resourceName = this.options.resourceName;
|
64
|
+
if (fetchMeta) {
|
65
|
+
logger.debug(`Initializing ${resourceName} Datasource`);
|
66
|
+
const meta = yield this.connect
|
67
|
+
.getMetadata(resourceName)
|
68
|
+
.catch((e) => logger.error(`Metadata Fetch failed for ${resourceName}:`, e));
|
69
|
+
if (!meta) {
|
70
|
+
this.deinit();
|
71
|
+
return false;
|
72
|
+
}
|
73
|
+
this.resourceType = meta.TYPE;
|
74
|
+
this.availableIndexes = (_a = meta.INDEXES) !== null && _a !== void 0 ? _a : [];
|
75
|
+
this.originalFieldDef = extractFieldDefinitions(meta);
|
76
|
+
this.fieldMetadata = toFieldMetadata(this.originalFieldDef);
|
77
|
+
this.requestFields = meta.REQUEST_FIELD || [];
|
78
|
+
logger.debug(`Datasource for ${resourceName} is ready`);
|
74
79
|
}
|
75
|
-
logger.debug(`Initializing ${resourceName} datasource from ${this.connect.host}`);
|
76
80
|
if (!this.options.isSnapshot) {
|
77
|
-
this.
|
78
|
-
}
|
79
|
-
if (this.fetchMetadataRequired) {
|
80
|
-
yield this.fetchAndApplyMetadata(this.options.resourceName);
|
81
|
+
this._stream = yield this.createStream();
|
81
82
|
}
|
82
|
-
|
83
|
-
this.reportStatus();
|
83
|
+
this.initialized = true;
|
84
84
|
return this.initialized;
|
85
85
|
});
|
86
86
|
}
|
87
87
|
deinit() {
|
88
88
|
var _a;
|
89
89
|
logger.debug('Datasource.deinit', (_a = this.options) === null || _a === void 0 ? void 0 : _a.resourceName);
|
90
|
-
this.
|
91
|
-
this.fetchMetadataRequired = undefined;
|
90
|
+
this.initialized = false;
|
92
91
|
this.options = {};
|
93
92
|
this.resourceType = undefined;
|
94
93
|
this.availableIndexes = [];
|
@@ -101,11 +100,12 @@ let DefaultDatasource = class DefaultDatasource {
|
|
101
100
|
var _a;
|
102
101
|
logger.debug('Datasource.destroy', (_a = this.options) === null || _a === void 0 ? void 0 : _a.resourceName);
|
103
102
|
this.deinit();
|
104
|
-
delete this.
|
105
|
-
|
103
|
+
delete this._stream;
|
104
|
+
}
|
105
|
+
get stream() {
|
106
|
+
return this._stream;
|
106
107
|
}
|
107
108
|
get params() {
|
108
|
-
var _a;
|
109
109
|
const params = {
|
110
110
|
CRITERIA_MATCH: this.options.criteria,
|
111
111
|
FIELDS: this.options.fields,
|
@@ -118,7 +118,7 @@ let DefaultDatasource = class DefaultDatasource {
|
|
118
118
|
REVERSE: this.options.reverse,
|
119
119
|
};
|
120
120
|
if (this.options.orderBy) {
|
121
|
-
if (
|
121
|
+
if (this.availableIndexes.findIndex((i) => i.NAME === this.options.orderBy) > -1) {
|
122
122
|
params.ORDER_BY = this.options.orderBy;
|
123
123
|
}
|
124
124
|
else {
|
@@ -192,95 +192,20 @@ let DefaultDatasource = class DefaultDatasource {
|
|
192
192
|
switchMap(() => from(this.snapshot())));
|
193
193
|
}));
|
194
194
|
}
|
195
|
-
fetchAndApplyMetadata(resourceName) {
|
196
|
-
var _a, _b;
|
197
|
-
return __awaiter(this, void 0, void 0, function* () {
|
198
|
-
try {
|
199
|
-
logger.debug(`Requesting metadata for ${this.options.resourceName} Datasource`);
|
200
|
-
const meta = yield this.connect.getMetadata(this.options.resourceName);
|
201
|
-
if (meta) {
|
202
|
-
this.availableIndexes = (_a = meta.INDEXES) !== null && _a !== void 0 ? _a : [];
|
203
|
-
this.originalFieldDef = extractFieldDefinitions(meta);
|
204
|
-
this.fieldMetadata = toFieldMetadata(this.originalFieldDef);
|
205
|
-
this.requestFields = meta.REQUEST_FIELD || [];
|
206
|
-
this.fetchMetadataRequired = false;
|
207
|
-
}
|
208
|
-
this.status = this.normaliseStatus({
|
209
|
-
isInitialized: true,
|
210
|
-
metadataRequired: true,
|
211
|
-
hasMetadata: ((_b = this.fieldMetadata) === null || _b === void 0 ? void 0 : _b.length) > 0,
|
212
|
-
});
|
213
|
-
}
|
214
|
-
catch (e) {
|
215
|
-
logger.error(`Metadata Fetch failed for ${resourceName}:`, e);
|
216
|
-
this.status = this.normaliseStatus({
|
217
|
-
isInitialized: false,
|
218
|
-
metadataRequired: true,
|
219
|
-
hasMetadata: false,
|
220
|
-
});
|
221
|
-
}
|
222
|
-
});
|
223
|
-
}
|
224
|
-
/**
|
225
|
-
* @internal
|
226
|
-
*/
|
227
|
-
reportStatus(detail = {}) {
|
228
|
-
var _a;
|
229
|
-
const eventEmitter = (_a = this.config.eventEmitter) !== null && _a !== void 0 ? _a : document;
|
230
|
-
this.status = this.normaliseStatus(detail);
|
231
|
-
logger.debug(`Dispatching '${DatasourceStatusChanged}'`, this.status);
|
232
|
-
eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.dispatchEvent(new CustomEvent(DatasourceStatusChanged, {
|
233
|
-
detail: this.status,
|
234
|
-
bubbles: eventEmitter !== document,
|
235
|
-
composed: true,
|
236
|
-
}));
|
237
|
-
}
|
238
|
-
/**
|
239
|
-
* @internal
|
240
|
-
*/
|
241
|
-
normaliseStatus(status) {
|
242
|
-
var _a, _b, _c, _d, _e;
|
243
|
-
const isInitialized = (_a = status.isInitialized) !== null && _a !== void 0 ? _a : this.initialized;
|
244
|
-
const metadataRequired = (_b = status.metadataRequired) !== null && _b !== void 0 ? _b : this.fetchMetadataRequired;
|
245
|
-
const hasMetadata = (_c = status.hasMetadata) !== null && _c !== void 0 ? _c : ((_d = this.fieldMetadata) === null || _d === void 0 ? void 0 : _d.length) > 0;
|
246
|
-
return {
|
247
|
-
name: (_e = this.options) === null || _e === void 0 ? void 0 : _e.resourceName,
|
248
|
-
type: this.resourceType,
|
249
|
-
isInitialized,
|
250
|
-
metadataRequired,
|
251
|
-
hasMetadata,
|
252
|
-
};
|
253
|
-
}
|
254
195
|
};
|
255
196
|
__decorate([
|
256
197
|
observable
|
257
|
-
], DefaultDatasource.prototype, "
|
258
|
-
__decorate([
|
259
|
-
observable
|
260
|
-
], DefaultDatasource.prototype, "fetchMetadataRequired", void 0);
|
261
|
-
__decorate([
|
262
|
-
observable
|
263
|
-
], DefaultDatasource.prototype, "originalFieldDef", void 0);
|
264
|
-
__decorate([
|
265
|
-
observable
|
266
|
-
], DefaultDatasource.prototype, "fieldMetadata", void 0);
|
267
|
-
__decorate([
|
268
|
-
observable
|
269
|
-
], DefaultDatasource.prototype, "requestFields", void 0);
|
270
|
-
__decorate([
|
271
|
-
observable
|
272
|
-
], DefaultDatasource.prototype, "availableIndexes", void 0);
|
198
|
+
], DefaultDatasource.prototype, "initialized", void 0);
|
273
199
|
__decorate([
|
274
200
|
observable
|
275
201
|
], DefaultDatasource.prototype, "readOnly", void 0);
|
276
202
|
__decorate([
|
277
203
|
observable
|
278
|
-
], DefaultDatasource.prototype, "
|
204
|
+
], DefaultDatasource.prototype, "_stream", void 0);
|
279
205
|
DefaultDatasource = __decorate([
|
280
206
|
__param(0, Connect),
|
281
207
|
__param(1, Auth),
|
282
|
-
__param(2,
|
283
|
-
__param(3, DatasourceConfig)
|
208
|
+
__param(2, optional(DatasourceConfig))
|
284
209
|
], DefaultDatasource);
|
285
210
|
export { DefaultDatasource };
|
286
211
|
/**
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { DI } from '@microsoft/fast-foundation';
|
1
2
|
/**
|
2
3
|
* Types of Genesis resources.
|
3
4
|
* @public
|
@@ -9,7 +10,22 @@ export var ResourceType;
|
|
9
10
|
ResourceType["REQUEST_SERVER"] = "REQUEST_SERVER";
|
10
11
|
})(ResourceType || (ResourceType = {}));
|
11
12
|
/**
|
12
|
-
*
|
13
|
+
* Default values for a DatasourceConfig
|
13
14
|
* @public
|
14
15
|
*/
|
15
|
-
export
|
16
|
+
export class DatasourceDefaults {
|
17
|
+
}
|
18
|
+
DatasourceDefaults.MAX_ROWS_250 = 250;
|
19
|
+
DatasourceDefaults.MAX_VIEW_1000 = 1000;
|
20
|
+
DatasourceDefaults.REQ_REP_POLLING_INTERVAL_MS = 10000;
|
21
|
+
DatasourceDefaults.DATASERVER_ROW_ID = 'ROW_REF';
|
22
|
+
DatasourceDefaults.REQUEST_SERVER_ROW_ID = 'RECORD_ID';
|
23
|
+
/**
|
24
|
+
* The DI token for the DatasourceConfig interface.
|
25
|
+
*
|
26
|
+
* @privateRemarks
|
27
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
28
|
+
*
|
29
|
+
* @internal
|
30
|
+
*/
|
31
|
+
export const DatasourceConfig = DI.createInterface();
|
@@ -42,12 +42,6 @@ export class DefaultEntityDatasource extends DefaultDatasource {
|
|
42
42
|
this.entityCache = [];
|
43
43
|
};
|
44
44
|
}
|
45
|
-
get initialized() {
|
46
|
-
return this._initialized;
|
47
|
-
}
|
48
|
-
set initialized(value) {
|
49
|
-
this._initialized = value;
|
50
|
-
}
|
51
45
|
/** {@inheritDoc EntityDatasource.cache} */
|
52
46
|
get cache() {
|
53
47
|
if (!this.initialized) {
|
@@ -1,7 +1,5 @@
|
|
1
1
|
export * from './criteriaFiltersToFields';
|
2
2
|
export * from './dataServerResultFilter';
|
3
|
-
export * from './datasource.config';
|
4
|
-
export * from './datasource.mixins';
|
5
3
|
export * from './datasource';
|
6
4
|
export * from './datasource.types';
|
7
5
|
export * from './entityDatasource';
|
package/dist/esm/index.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
2
|
-
import { DefaultUser } from '@genesislcap/foundation-user';
|
3
2
|
import { observable } from '@microsoft/fast-element';
|
4
3
|
/**
|
5
4
|
* @internal
|
@@ -26,15 +25,6 @@ export class AuthMock {
|
|
26
25
|
return Promise.resolve(this.nextReAuthResult);
|
27
26
|
});
|
28
27
|
}
|
29
|
-
setTestUser(properties = {}) {
|
30
|
-
this.currentUser = new DefaultUser();
|
31
|
-
this.currentUser.set(Object.assign({ userName: 'JaneDee', profile: ['USER'], permission: ['CreateRules'] }, properties));
|
32
|
-
this.isLoggedIn = true;
|
33
|
-
}
|
34
|
-
resetTestUser() {
|
35
|
-
this.currentUser = null;
|
36
|
-
this.isLoggedIn = false;
|
37
|
-
}
|
38
28
|
}
|
39
29
|
__decorate([
|
40
30
|
observable
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { __awaiter } from "tslib";
|
2
1
|
import { from } from 'rxjs';
|
3
2
|
/**
|
4
3
|
* @internal
|
@@ -8,9 +7,6 @@ export class ConnectMock {
|
|
8
7
|
this.isConnected = true;
|
9
8
|
this.isWorking = false;
|
10
9
|
}
|
11
|
-
get host() {
|
12
|
-
return this.socket.host;
|
13
|
-
}
|
14
10
|
get isConnectedSubject() {
|
15
11
|
return this.socket.isConnectedSubject;
|
16
12
|
}
|
@@ -31,7 +27,6 @@ export class ConnectMock {
|
|
31
27
|
return Promise.resolve(this.nextMessage);
|
32
28
|
}
|
33
29
|
connect(host) {
|
34
|
-
this.socket.host = host;
|
35
30
|
return Promise.resolve(this.isConnected);
|
36
31
|
}
|
37
32
|
disconnect() { }
|
@@ -43,10 +38,8 @@ export class ConnectMock {
|
|
43
38
|
return Promise.resolve(this.nextMessage);
|
44
39
|
}
|
45
40
|
getAvailableResources(params) {
|
46
|
-
|
47
|
-
|
48
|
-
return Promise.resolve(this.nextMessage);
|
49
|
-
});
|
41
|
+
this.requestParams = params;
|
42
|
+
return Promise.resolve(this.nextMessage);
|
50
43
|
}
|
51
44
|
snapshot(resourceName, params) {
|
52
45
|
return Promise.resolve(this.nextMessage);
|
@@ -6,11 +6,9 @@ import { SocketSubject } from '../../../connect/socket';
|
|
6
6
|
export class SocketMock {
|
7
7
|
constructor() {
|
8
8
|
this.isConnectedSubject = new BehaviorSubject(true);
|
9
|
-
this.host = 'mock-host';
|
10
9
|
this.socketMessagesSubject = new SocketSubject();
|
11
10
|
}
|
12
11
|
connect(host, options, reconnectOptions) {
|
13
|
-
this.host = host;
|
14
12
|
return Promise.resolve(true);
|
15
13
|
}
|
16
14
|
disconnect() { }
|