@factset/frontgate-js-sdk 6.11.1 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -40
- package/dist/lib/esnext/FrontgateClient.js +0 -3
- package/dist/lib/esnext/authentication/index.js +3 -4
- package/dist/lib/esnext/common/errors.js +0 -35
- package/dist/lib/esnext/common/functions.js +0 -84
- package/dist/lib/esnext/common/interfaces/index.js +0 -1
- package/dist/lib/esnext/compat/index.js +0 -3
- package/dist/lib/esnext/connection/index.js +19 -6
- package/dist/lib/esnext/connection/util/functions.js +0 -56
- package/dist/lib/esnext/index.js +0 -1
- package/dist/lib/esnext/message/index.js +1 -1
- package/dist/lib/esnext/message/interfaces/index.js +0 -1
- package/dist/lib/esnext/message/request/TransportLayerClientRequestHeader.js +1 -1
- package/dist/lib/esnext/message/request/raw/example/CreateNotationSearchRequest.js +1 -1
- package/dist/lib/esnext/message/request/raw/index.js +0 -1
- package/dist/lib/esnext/message/response/index.js +0 -5
- package/dist/lib/esnext/message/update/index.js +0 -1
- package/dist/lib/esnext/mixins/EndpointRequestMixin.js +1 -1
- package/dist/lib/esnext/mixins/RemoteLoggerMixin.js +29 -0
- package/dist/lib/esnext/mixins/auth/AppAuthMixin.js +79 -11
- package/dist/lib/esnext/mixins/auth/SessionAuthMixin.js +76 -36
- package/dist/lib/esnext/mixins/auth/UserCredentialAuthMixin.js +82 -12
- package/dist/lib/esnext/mixins/auth/UserPasswordAuthMixin.js +80 -13
- package/dist/lib/esnext/mixins/auth/index.js +0 -31
- package/dist/lib/esnext/mixins/index.js +1 -0
- package/dist/lib/esnext/mixins/subscription/EndpointSubscriptionMixin.js +149 -122
- package/dist/lib/esnext/version.js +1 -1
- package/dist/lib/node/FrontgateClient.js +0 -3
- package/dist/lib/node/authentication/index.js +4 -4
- package/dist/lib/node/common/errors.js +1 -41
- package/dist/lib/node/common/functions.js +0 -92
- package/dist/lib/node/common/interfaces/index.js +0 -1
- package/dist/lib/node/compat/index.js +0 -3
- package/dist/lib/node/connection/index.js +20 -6
- package/dist/lib/node/connection/util/functions.js +0 -63
- package/dist/lib/node/index.js +1 -3
- package/dist/lib/node/message/index.js +2 -1
- package/dist/lib/node/message/interfaces/index.js +0 -1
- package/dist/lib/node/message/request/TransportLayerClientRequestHeader.js +3 -3
- package/dist/lib/node/message/request/raw/example/CreateNotationSearchRequest.js +3 -3
- package/dist/lib/node/message/request/raw/index.js +0 -1
- package/dist/lib/node/message/response/index.js +0 -5
- package/dist/lib/node/message/update/index.js +0 -1
- package/dist/lib/node/mixins/EndpointRequestMixin.js +2 -2
- package/dist/lib/node/mixins/RemoteLoggerMixin.js +33 -0
- package/dist/lib/node/mixins/auth/AppAuthMixin.js +78 -10
- package/dist/lib/node/mixins/auth/SessionAuthMixin.js +75 -35
- package/dist/lib/node/mixins/auth/UserCredentialAuthMixin.js +80 -10
- package/dist/lib/node/mixins/auth/UserPasswordAuthMixin.js +78 -11
- package/dist/lib/node/mixins/auth/index.js +0 -33
- package/dist/lib/node/mixins/index.js +1 -0
- package/dist/lib/node/mixins/subscription/EndpointSubscriptionMixin.js +149 -122
- package/dist/lib/node/version.js +1 -1
- package/dist/lib/types/FrontgateClient.d.ts +0 -1
- package/dist/lib/types/authentication/index.d.ts +3 -4
- package/dist/lib/types/authentication/util/ChallengeResolver.d.ts +2 -1
- package/dist/lib/types/common/errors.d.ts +0 -21
- package/dist/lib/types/common/functions.d.ts +0 -8
- package/dist/lib/types/common/interfaces/index.d.ts +0 -1
- package/dist/lib/types/compat/index.d.ts +0 -3
- package/dist/lib/types/connection/index.d.ts +16 -6
- package/dist/lib/types/connection/util/functions.d.ts +0 -18
- package/dist/lib/types/index.d.ts +0 -1
- package/dist/lib/types/message/index.d.ts +1 -1
- package/dist/lib/types/message/interfaces/index.d.ts +0 -1
- package/dist/lib/types/message/request/TransportLayerClientRequestHeader.d.ts +1 -0
- package/dist/lib/types/message/request/raw/index.d.ts +0 -1
- package/dist/lib/types/message/response/index.d.ts +0 -5
- package/dist/lib/types/message/update/index.d.ts +0 -1
- package/dist/lib/types/mixins/AuthTokenRequestMixin.d.ts +1 -2
- package/dist/lib/types/mixins/EndpointRequestMixin.d.ts +1 -2
- package/dist/lib/types/mixins/HTTPProxyRequestMixin.d.ts +1 -4
- package/dist/lib/types/mixins/LoggerMixin.d.ts +1 -2
- package/dist/lib/types/mixins/MessageCompressorMixin.d.ts +1 -2
- package/dist/lib/types/mixins/OpenTelemetryMixin.d.ts +1 -2
- package/dist/lib/types/mixins/PingMixin.d.ts +1 -2
- package/dist/lib/types/mixins/ReconnectMixin.d.ts +1 -2
- package/dist/lib/types/mixins/RemoteLoggerMixin.d.ts +16 -0
- package/dist/lib/types/mixins/RequestMixin.d.ts +1 -2
- package/dist/lib/types/mixins/auth/AppAuthMixin.d.ts +15 -8
- package/dist/lib/types/mixins/auth/CookieTokenAuthMixin.d.ts +1 -2
- package/dist/lib/types/mixins/auth/FetchAuthenticationMixin.d.ts +1 -2
- package/dist/lib/types/mixins/auth/SessionAuthMixin.d.ts +10 -5
- package/dist/lib/types/mixins/auth/TokenAuthMixin.d.ts +1 -2
- package/dist/lib/types/mixins/auth/UserCredentialAuthMixin.d.ts +15 -8
- package/dist/lib/types/mixins/auth/UserPasswordAuthMixin.d.ts +15 -8
- package/dist/lib/types/mixins/auth/index.d.ts +0 -8
- package/dist/lib/types/mixins/connection/FrontgateWSMixin.d.ts +1 -2
- package/dist/lib/types/mixins/index.d.ts +2 -1
- package/dist/lib/types/mixins/subscription/EndpointSubscriptionMixin.d.ts +4 -6
- package/dist/lib/types/mixins/subscription/RawSubscriptionMixin.d.ts +1 -2
- package/dist/lib/umd/mdg2.client.min.umd.js +1 -12
- package/dist/lib/umd/mdg2.client.umd.js +4061 -8138
- package/package.json +25 -28
- package/dist/lib/esnext/Mdg2Client.js +0 -185
- package/dist/lib/esnext/authentication/AbstractAuthentication.js +0 -49
- package/dist/lib/esnext/authentication/AppAuthentication.js +0 -70
- package/dist/lib/esnext/authentication/AuthenticationInterface.js +0 -1
- package/dist/lib/esnext/authentication/CookieTokenAuthentication.js +0 -18
- package/dist/lib/esnext/authentication/TokenAuthentication.js +0 -42
- package/dist/lib/esnext/authentication/UserCredentialAuthentication.js +0 -73
- package/dist/lib/esnext/authentication/UserPasswordAuthentication.js +0 -71
- package/dist/lib/esnext/common/Mdg2ClientOptions.js +0 -1
- package/dist/lib/esnext/common/constants.js +0 -10
- package/dist/lib/esnext/common/interfaces/observe/ObserveOptions.js +0 -1
- package/dist/lib/esnext/connection/AbstractFrontgateConnection.js +0 -324
- package/dist/lib/esnext/connection/ConnectionInterface.js +0 -1
- package/dist/lib/esnext/connection/FrontgateWSConnection.js +0 -281
- package/dist/lib/esnext/connection/JobPromise.js +0 -2
- package/dist/lib/esnext/connection/LatencyHandler.js +0 -1
- package/dist/lib/esnext/connection/LatencyTracker.js +0 -47
- package/dist/lib/esnext/connection/MessageProcessor.js +0 -1
- package/dist/lib/esnext/connection/util/Encoding.js +0 -14
- package/dist/lib/esnext/core/RequestModule.js +0 -349
- package/dist/lib/esnext/core/SubscriptionModule.js +0 -104
- package/dist/lib/esnext/core/subscription/EndpointHandler.js +0 -121
- package/dist/lib/esnext/core/subscription/SubjectManager.js +0 -39
- package/dist/lib/esnext/message/MessageFactory.js +0 -36
- package/dist/lib/esnext/message/guards.js +0 -21
- package/dist/lib/esnext/message/interfaces/JobObservable.js +0 -1
- package/dist/lib/esnext/message/request/raw/RawRequestFactory.js +0 -18
- package/dist/lib/esnext/message/response/AuthenticationByTokenResponse.js +0 -1
- package/dist/lib/esnext/message/response/CancelSubscriptionResponse.js +0 -3
- package/dist/lib/esnext/message/response/LoadNotificationMessage.js +0 -1
- package/dist/lib/esnext/message/response/PermissionDeniedResponse.js +0 -6
- package/dist/lib/esnext/message/response/RejectResponse.js +0 -9
- package/dist/lib/esnext/message/update/SubscriptionLossMessage.js +0 -10
- package/dist/lib/esnext/util/TimeOutWrapper.js +0 -51
- package/dist/lib/node/Mdg2Client.js +0 -189
- package/dist/lib/node/authentication/AbstractAuthentication.js +0 -53
- package/dist/lib/node/authentication/AppAuthentication.js +0 -74
- package/dist/lib/node/authentication/AuthenticationInterface.js +0 -2
- package/dist/lib/node/authentication/CookieTokenAuthentication.js +0 -22
- package/dist/lib/node/authentication/TokenAuthentication.js +0 -46
- package/dist/lib/node/authentication/UserCredentialAuthentication.js +0 -77
- package/dist/lib/node/authentication/UserPasswordAuthentication.js +0 -75
- package/dist/lib/node/common/Mdg2ClientOptions.js +0 -2
- package/dist/lib/node/common/constants.js +0 -13
- package/dist/lib/node/common/interfaces/observe/ObserveOptions.js +0 -2
- package/dist/lib/node/connection/AbstractFrontgateConnection.js +0 -328
- package/dist/lib/node/connection/ConnectionInterface.js +0 -2
- package/dist/lib/node/connection/FrontgateWSConnection.js +0 -288
- package/dist/lib/node/connection/JobPromise.js +0 -6
- package/dist/lib/node/connection/LatencyHandler.js +0 -2
- package/dist/lib/node/connection/LatencyTracker.js +0 -51
- package/dist/lib/node/connection/MessageProcessor.js +0 -2
- package/dist/lib/node/connection/util/Encoding.js +0 -18
- package/dist/lib/node/core/RequestModule.js +0 -353
- package/dist/lib/node/core/SubscriptionModule.js +0 -108
- package/dist/lib/node/core/subscription/EndpointHandler.js +0 -125
- package/dist/lib/node/core/subscription/SubjectManager.js +0 -43
- package/dist/lib/node/message/MessageFactory.js +0 -73
- package/dist/lib/node/message/guards.js +0 -30
- package/dist/lib/node/message/interfaces/JobObservable.js +0 -2
- package/dist/lib/node/message/request/raw/RawRequestFactory.js +0 -22
- package/dist/lib/node/message/response/AuthenticationByTokenResponse.js +0 -2
- package/dist/lib/node/message/response/CancelSubscriptionResponse.js +0 -7
- package/dist/lib/node/message/response/LoadNotificationMessage.js +0 -2
- package/dist/lib/node/message/response/PermissionDeniedResponse.js +0 -10
- package/dist/lib/node/message/response/RejectResponse.js +0 -13
- package/dist/lib/node/message/update/SubscriptionLossMessage.js +0 -14
- package/dist/lib/node/util/TimeOutWrapper.js +0 -55
- package/dist/lib/types/Mdg2Client.d.ts +0 -52
- package/dist/lib/types/authentication/AbstractAuthentication.d.ts +0 -17
- package/dist/lib/types/authentication/AppAuthentication.d.ts +0 -12
- package/dist/lib/types/authentication/AuthenticationInterface.d.ts +0 -9
- package/dist/lib/types/authentication/CookieTokenAuthentication.d.ts +0 -6
- package/dist/lib/types/authentication/TokenAuthentication.d.ts +0 -14
- package/dist/lib/types/authentication/UserCredentialAuthentication.d.ts +0 -13
- package/dist/lib/types/authentication/UserPasswordAuthentication.d.ts +0 -14
- package/dist/lib/types/common/Mdg2ClientOptions.d.ts +0 -12
- package/dist/lib/types/common/constants.d.ts +0 -11
- package/dist/lib/types/common/interfaces/observe/ObserveOptions.d.ts +0 -5
- package/dist/lib/types/connection/AbstractFrontgateConnection.d.ts +0 -116
- package/dist/lib/types/connection/ConnectionInterface.d.ts +0 -53
- package/dist/lib/types/connection/FrontgateWSConnection.d.ts +0 -23
- package/dist/lib/types/connection/JobPromise.d.ts +0 -3
- package/dist/lib/types/connection/LatencyHandler.d.ts +0 -1
- package/dist/lib/types/connection/LatencyTracker.d.ts +0 -13
- package/dist/lib/types/connection/MessageProcessor.d.ts +0 -2
- package/dist/lib/types/connection/util/Encoding.d.ts +0 -9
- package/dist/lib/types/core/RequestModule.d.ts +0 -78
- package/dist/lib/types/core/SubscriptionModule.d.ts +0 -24
- package/dist/lib/types/core/subscription/EndpointHandler.d.ts +0 -37
- package/dist/lib/types/core/subscription/SubjectManager.d.ts +0 -21
- package/dist/lib/types/message/MessageFactory.d.ts +0 -29
- package/dist/lib/types/message/guards.d.ts +0 -11
- package/dist/lib/types/message/interfaces/JobObservable.d.ts +0 -4
- package/dist/lib/types/message/request/raw/RawRequestFactory.d.ts +0 -4
- package/dist/lib/types/message/response/AuthenticationByTokenResponse.d.ts +0 -20
- package/dist/lib/types/message/response/CancelSubscriptionResponse.d.ts +0 -3
- package/dist/lib/types/message/response/LoadNotificationMessage.d.ts +0 -8
- package/dist/lib/types/message/response/PermissionDeniedResponse.d.ts +0 -4
- package/dist/lib/types/message/response/RejectResponse.d.ts +0 -5
- package/dist/lib/types/message/update/SubscriptionLossMessage.d.ts +0 -17
- package/dist/lib/types/util/TimeOutWrapper.d.ts +0 -12
|
@@ -13,29 +13,96 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.userPasswordAuth = void 0;
|
|
15
15
|
const _1 = require("../.");
|
|
16
|
-
const
|
|
16
|
+
const connection_1 = require("../../connection");
|
|
17
17
|
const authentication_1 = require("../../authentication");
|
|
18
|
+
const compat_1 = require("../../compat");
|
|
19
|
+
const logger_1 = require("../../logger");
|
|
20
|
+
const crypto_1 = require("crypto");
|
|
18
21
|
const userPasswordAuth = (idApplication, username, password, deploymentStage) => {
|
|
19
22
|
const mixinUserPasswordAuth = (Base) => {
|
|
20
|
-
var
|
|
23
|
+
var _instances, _sharedSecret, _clientSecret, _createAuthenticationRequest, _createConfigurationRequest, _createTransportLayerRequestHeaderConfigurationRequest, _submit, _a;
|
|
21
24
|
return _a = class extends Base {
|
|
22
25
|
constructor(...args) {
|
|
23
26
|
super(...args);
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
_instances.add(this);
|
|
28
|
+
_sharedSecret.set(this, void 0);
|
|
29
|
+
_clientSecret.set(this, void 0);
|
|
30
|
+
const plainSharedSecret = compat_1.SecretGenerator.generateSharedSecret(username, password);
|
|
31
|
+
const plainClientSecret = compat_1.SecretGenerator.generateClientSecret(username, password);
|
|
32
|
+
if (plainSharedSecret && plainClientSecret) {
|
|
33
|
+
__classPrivateFieldSet(this, _sharedSecret, Buffer.from(plainSharedSecret), "f");
|
|
34
|
+
__classPrivateFieldSet(this, _clientSecret, Buffer.from(plainClientSecret), "f");
|
|
35
|
+
}
|
|
26
36
|
this.hooks.hook('frontgateConnection:connected', async (conf) => {
|
|
27
37
|
void this.hooks.callHook('frontgateConnection:setIdApp', idApplication);
|
|
28
|
-
void this.hooks.callHook('frontgateConnection:setIdUser', authentication_1.
|
|
29
|
-
await __classPrivateFieldGet(this,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
maximum_idle_interval: conf.maximumIdleInterval,
|
|
33
|
-
}, this));
|
|
38
|
+
void this.hooks.callHook('frontgateConnection:setIdUser', authentication_1.ID_USER_AUTHENTICATED);
|
|
39
|
+
const authResponse = await __classPrivateFieldGet(this, _instances, "m", _submit).call(this, __classPrivateFieldGet(this, _instances, "m", _createAuthenticationRequest).call(this).toJson());
|
|
40
|
+
await __classPrivateFieldGet(this, _instances, "m", _submit).call(this, __classPrivateFieldGet(this, _instances, "m", _createConfigurationRequest).call(this, authResponse, conf).toJson());
|
|
41
|
+
await __classPrivateFieldGet(this, _instances, "m", _submit).call(this, __classPrivateFieldGet(this, _instances, "m", _createTransportLayerRequestHeaderConfigurationRequest).call(this));
|
|
34
42
|
await this.hooks.callHook('frontgateConnection:authenticated');
|
|
35
43
|
});
|
|
36
44
|
}
|
|
37
45
|
},
|
|
38
|
-
|
|
46
|
+
_sharedSecret = new WeakMap(),
|
|
47
|
+
_clientSecret = new WeakMap(),
|
|
48
|
+
_instances = new WeakSet(),
|
|
49
|
+
_createAuthenticationRequest = function _createAuthenticationRequest() {
|
|
50
|
+
const salt = (0, crypto_1.randomBytes)(16);
|
|
51
|
+
const options = {
|
|
52
|
+
idApplication,
|
|
53
|
+
username,
|
|
54
|
+
salt: (0, connection_1.getBytesFromBuffer)(salt),
|
|
55
|
+
challenge: (0, connection_1.getBytesFromBuffer)((0, crypto_1.randomBytes)(16)),
|
|
56
|
+
encryptedSecrets: [{ encrypted_secret: compat_1.SecretGenerator.createEncryptedSecret(salt, __classPrivateFieldGet(this, _sharedSecret, "f"), __classPrivateFieldGet(this, _clientSecret, "f")) }],
|
|
57
|
+
};
|
|
58
|
+
return new compat_1.AuthenticationRequest(options);
|
|
59
|
+
},
|
|
60
|
+
_createConfigurationRequest = function _createConfigurationRequest(msg, conf) {
|
|
61
|
+
const expectedMessage = 'Foundation::AuthenticationResponse';
|
|
62
|
+
if (msg.Message !== expectedMessage) {
|
|
63
|
+
throw new Error(`Expected message "${expectedMessage}" but received "${msg.Message}"`);
|
|
64
|
+
}
|
|
65
|
+
if (msg.id_user === authentication_1.ID_USER_AUTHENTICATED) {
|
|
66
|
+
void this.hooks.callHook('frontgateConnection:setIdApp', authentication_1.ID_APP_AUTHENTICATED);
|
|
67
|
+
void this.hooks.callHook('frontgateConnection:setIdUser', authentication_1.ID_USER_AUTHENTICATED);
|
|
68
|
+
}
|
|
69
|
+
const { challenge } = msg.challenge;
|
|
70
|
+
const options = {
|
|
71
|
+
shared_secret: __classPrivateFieldGet(this, _sharedSecret, "f"),
|
|
72
|
+
payload_content: conf.payloadContent,
|
|
73
|
+
deployment_stage: deploymentStage,
|
|
74
|
+
maximum_idle_interval: conf.maximumIdleInterval,
|
|
75
|
+
};
|
|
76
|
+
return new compat_1.ConfigurationRequest(challenge, options);
|
|
77
|
+
},
|
|
78
|
+
_createTransportLayerRequestHeaderConfigurationRequest = function _createTransportLayerRequestHeaderConfigurationRequest() {
|
|
79
|
+
return {
|
|
80
|
+
Message: 'TransportLayerClientConfigurationRequest',
|
|
81
|
+
Version: 1,
|
|
82
|
+
flags: 0,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
_submit = async function _submit(message) {
|
|
86
|
+
this.log(logger_1.LogLevel.INFO, 'Sending message', message);
|
|
87
|
+
const msg = {
|
|
88
|
+
message,
|
|
89
|
+
callbackType: 'response',
|
|
90
|
+
callbackId: message.Message.replace('Request', 'Response'),
|
|
91
|
+
};
|
|
92
|
+
await this.hooks.callHook('frontgateConnection:sendMessage', msg);
|
|
93
|
+
let timeout;
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
95
|
+
const unsubMessage = this.hooks.hookOnce(`frontgateConnection:response:${msg.callbackId}`, (response) => {
|
|
96
|
+
clearTimeout(timeout);
|
|
97
|
+
this.log(logger_1.LogLevel.INFO, 'Received response', response);
|
|
98
|
+
resolve(response);
|
|
99
|
+
});
|
|
100
|
+
timeout = setTimeout(() => {
|
|
101
|
+
unsubMessage();
|
|
102
|
+
reject(new Error('Authentication message timeout'));
|
|
103
|
+
}, 3000);
|
|
104
|
+
});
|
|
105
|
+
},
|
|
39
106
|
_a;
|
|
40
107
|
};
|
|
41
108
|
return (0, _1.createExtendedMixinFactory)(mixinUserPasswordAuth, {
|
|
@@ -14,39 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createConnectionInterface = void 0;
|
|
18
|
-
const logger_1 = require("../../logger");
|
|
19
17
|
__exportStar(require("./CookieTokenAuthMixin"), exports);
|
|
20
18
|
__exportStar(require("./TokenAuthMixin"), exports);
|
|
21
19
|
__exportStar(require("./FetchAuthenticationMixin"), exports);
|
|
22
|
-
const createConnectionInterface = (options, base) => {
|
|
23
|
-
return {
|
|
24
|
-
options,
|
|
25
|
-
submit: async (message) => {
|
|
26
|
-
base.log(logger_1.LogLevel.INFO, 'Sending message', message);
|
|
27
|
-
const msg = {
|
|
28
|
-
message,
|
|
29
|
-
callbackType: 'response',
|
|
30
|
-
callbackId: message.Message.replace('Request', 'Response'),
|
|
31
|
-
};
|
|
32
|
-
await base.hooks.callHook('frontgateConnection:sendMessage', msg);
|
|
33
|
-
let timeout;
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
const unsubMessage = base.hooks.hookOnce(`frontgateConnection:response:${msg.callbackId}`, (response) => {
|
|
36
|
-
clearTimeout(timeout);
|
|
37
|
-
base.log(logger_1.LogLevel.INFO, 'Received response', response);
|
|
38
|
-
resolve(response);
|
|
39
|
-
});
|
|
40
|
-
timeout = setTimeout(() => {
|
|
41
|
-
unsubMessage();
|
|
42
|
-
reject(new Error('Authentication message timeout'));
|
|
43
|
-
}, 3000);
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
setPeerInfo: (peerInfo) => {
|
|
47
|
-
base.log(logger_1.LogLevel.INFO, 'Peer info:', peerInfo);
|
|
48
|
-
},
|
|
49
|
-
auth: {},
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
exports.createConnectionInterface = createConnectionInterface;
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./ReconnectMixin"), exports);
|
|
|
27
27
|
__exportStar(require("./OpenTelemetryMixin"), exports);
|
|
28
28
|
__exportStar(require("./HTTPProxyRequestMixin"), exports);
|
|
29
29
|
__exportStar(require("./PingMixin"), exports);
|
|
30
|
+
__exportStar(require("./RemoteLoggerMixin"), exports);
|
|
30
31
|
const createExtendedMixinFactory = (mixinFactory, options) => {
|
|
31
32
|
const extendedMixinFactory = mixinFactory;
|
|
32
33
|
extendedMixinFactory.featureName = options.featureName;
|
|
@@ -12,23 +12,33 @@ const message_1 = require("../../message");
|
|
|
12
12
|
const functions_1 = require("../../util/functions");
|
|
13
13
|
const endpointSubscriptions = (originalConfig) => {
|
|
14
14
|
const mixinEndpointSubscribable = (Base) => {
|
|
15
|
-
var _subscriptions, _a;
|
|
15
|
+
var _subscriptions, _subscriptionCounts, _inFlights, _a;
|
|
16
16
|
const config = { ...originalConfig };
|
|
17
17
|
return _a = class extends Base {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
_subscriptions.set(this, new Map());
|
|
21
|
+
_subscriptionCounts.set(this, new Map());
|
|
22
|
+
_inFlights.set(this, new Map());
|
|
21
23
|
}
|
|
22
24
|
async observeEndpoint(method, path, data, requestOptions) {
|
|
23
25
|
const key = `${method}:${path}:${JSON.stringify(data)}:${JSON.stringify(requestOptions ?? {})}`;
|
|
26
|
+
if (__classPrivateFieldGet(this, _inFlights, "f").has(key)) {
|
|
27
|
+
const inFlightPromise = __classPrivateFieldGet(this, _inFlights, "f").get(key);
|
|
28
|
+
this.log(logger_1.LogLevel.INFO, `Catching inflight subscription for ${key}`);
|
|
29
|
+
const subscriptionCount = __classPrivateFieldGet(this, _subscriptionCounts, "f").get(key) ?? 0;
|
|
30
|
+
__classPrivateFieldGet(this, _subscriptionCounts, "f").set(key, subscriptionCount + 1);
|
|
31
|
+
return inFlightPromise;
|
|
32
|
+
}
|
|
24
33
|
const timeOutInMs = config.timeout ?? this.defaultTimeoutInMs;
|
|
25
34
|
const resubscribeTimeout = config.subscriptionResubscribeTimeout ?? 1000;
|
|
26
35
|
if (__classPrivateFieldGet(this, _subscriptions, "f").has(key)) {
|
|
27
36
|
const subscription = __classPrivateFieldGet(this, _subscriptions, "f").get(key);
|
|
37
|
+
const subscriptionCount = __classPrivateFieldGet(this, _subscriptionCounts, "f").get(key) ?? 0;
|
|
28
38
|
if (subscription) {
|
|
29
|
-
|
|
39
|
+
__classPrivateFieldGet(this, _subscriptionCounts, "f").set(key, subscriptionCount + 1);
|
|
30
40
|
this.log(logger_1.LogLevel.INFO, `Reusing existing subscription for ${key}`);
|
|
31
|
-
return subscription
|
|
41
|
+
return subscription;
|
|
32
42
|
}
|
|
33
43
|
}
|
|
34
44
|
this.log(logger_1.LogLevel.INFO, `Creating new subscription for ${key}`);
|
|
@@ -39,153 +49,170 @@ const endpointSubscriptions = (originalConfig) => {
|
|
|
39
49
|
callbackType: 'job',
|
|
40
50
|
callbackId: '',
|
|
41
51
|
};
|
|
42
|
-
await this.hooks.callHook('frontgateConnection:sendMessage', subscriptionMsg);
|
|
43
52
|
const promise = new Promise((resolve, reject) => {
|
|
44
|
-
this.hooks
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
let hlResponseData;
|
|
51
|
-
try {
|
|
52
|
-
hlResponseData = JSON.parse(response.body.value);
|
|
53
|
-
}
|
|
54
|
-
catch (e) {
|
|
55
|
-
this.log(logger_1.LogLevel.ERROR, `Failed to parse response: ${response.body.value}`);
|
|
56
|
-
this.log(logger_1.LogLevel.ERROR, e);
|
|
57
|
-
reject(e);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const observer = new __1.FrontgateClientEndpointDataObserver(response.header.id_job, hlResponseData);
|
|
61
|
-
let removeMessageUpdateHook = this.hooks.hook(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (update) => {
|
|
62
|
-
if (!update.Message.includes('HighLevelUpdate')) {
|
|
63
|
-
if (update.Message.includes('SubscriptionLoss')) {
|
|
64
|
-
this.log(logger_1.LogLevel.DEBUG, `Received: ${update.Message}`);
|
|
65
|
-
setTimeout(() => {
|
|
66
|
-
void resubscribe();
|
|
67
|
-
}, (0, functions_1.addRandomnessToTime)(resubscribeTimeout));
|
|
68
|
-
removeMessageUpdateHook();
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
53
|
+
this.hooks
|
|
54
|
+
.callHook('frontgateConnection:sendMessage', subscriptionMsg)
|
|
55
|
+
.then(() => {
|
|
56
|
+
this.hooks.hookOnce(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (response) => {
|
|
57
|
+
if (!response.Message.includes('HighLevelResponse')) {
|
|
71
58
|
this.log(logger_1.LogLevel.ERROR, `Unexpected response: ${response.Message}`);
|
|
72
|
-
|
|
73
|
-
removeMessageUpdateHook();
|
|
59
|
+
reject(new message_1.ErrorResponse(JSON.stringify(response)));
|
|
74
60
|
return;
|
|
75
61
|
}
|
|
76
|
-
let
|
|
62
|
+
let hlResponseData;
|
|
77
63
|
try {
|
|
78
|
-
|
|
64
|
+
hlResponseData = JSON.parse(response.body.value);
|
|
79
65
|
}
|
|
80
66
|
catch (e) {
|
|
81
|
-
this.log(logger_1.LogLevel.ERROR, `Failed to parse response: ${
|
|
82
|
-
|
|
67
|
+
this.log(logger_1.LogLevel.ERROR, `Failed to parse response: ${response.body.value}`);
|
|
68
|
+
this.log(logger_1.LogLevel.ERROR, e);
|
|
69
|
+
reject(e);
|
|
83
70
|
return;
|
|
84
71
|
}
|
|
85
|
-
observer.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (!response.Message.includes('HighLevelResponse')) {
|
|
94
|
-
const err = new message_1.ErrorResponse(resp);
|
|
95
|
-
this.log(logger_1.LogLevel.ERROR, `Unexpected response: ${resp.Message}`);
|
|
72
|
+
const observer = new __1.FrontgateClientEndpointDataObserver(response.header.id_job, hlResponseData);
|
|
73
|
+
let removeMessageUpdateHook = this.hooks.hook(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (update) => {
|
|
74
|
+
if (!update.Message.includes('HighLevelUpdate')) {
|
|
75
|
+
if (update.Message.includes('SubscriptionLoss')) {
|
|
76
|
+
this.log(logger_1.LogLevel.DEBUG, `Received: ${update.Message}`);
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
void resubscribe();
|
|
79
|
+
}, (0, functions_1.addRandomnessToTime)(resubscribeTimeout));
|
|
96
80
|
removeMessageUpdateHook();
|
|
97
|
-
rej(err);
|
|
98
81
|
return;
|
|
99
82
|
}
|
|
100
|
-
this.log(logger_1.LogLevel.
|
|
101
|
-
observer.
|
|
102
|
-
removeMessageUpdateHook
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
83
|
+
this.log(logger_1.LogLevel.ERROR, `Unexpected response: ${response.Message}`);
|
|
84
|
+
observer.pushError(new message_1.ErrorResponse(JSON.stringify(update)));
|
|
85
|
+
removeMessageUpdateHook();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
let hlUpdate;
|
|
89
|
+
try {
|
|
90
|
+
hlUpdate = new message_1.HighLevelUpdate(update);
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
this.log(logger_1.LogLevel.ERROR, `Failed to parse response: ${update.body.value}`);
|
|
94
|
+
observer.pushError(e);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
observer.pushPatchData(hlUpdate.data);
|
|
98
|
+
});
|
|
99
|
+
const resubscribe = async () => {
|
|
100
|
+
removeMessageUpdateHook();
|
|
101
|
+
this.log(logger_1.LogLevel.INFO, `Resubscribing to ${key} due to reconnect`);
|
|
102
|
+
await this.hooks.callHook('frontgateConnection:sendMessage', subscriptionMsg);
|
|
103
|
+
const resubscribePromise = new Promise((res, rej) => {
|
|
104
|
+
this.hooks.hookOnce(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (resp) => {
|
|
105
|
+
if (!response.Message.includes('HighLevelResponse')) {
|
|
106
|
+
const err = new message_1.ErrorResponse(resp);
|
|
107
|
+
this.log(logger_1.LogLevel.ERROR, `Unexpected response: ${resp.Message}`);
|
|
108
|
+
removeMessageUpdateHook();
|
|
109
|
+
rej(err);
|
|
123
110
|
return;
|
|
124
111
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
this.log(logger_1.LogLevel.
|
|
112
|
+
this.log(logger_1.LogLevel.INFO, `Resubscribed to ${key} with ${resp.header.id_job}`);
|
|
113
|
+
observer.idJob = resp.header.id_job;
|
|
114
|
+
removeMessageUpdateHook = this.hooks.hook(`frontgateConnection:response:${resp.header.id_job}`, (update) => {
|
|
115
|
+
if (!update.Message.includes('HighLevelUpdate')) {
|
|
116
|
+
if (update.Message.includes('SubscriptionLoss')) {
|
|
117
|
+
this.log(logger_1.LogLevel.DEBUG, `Received: ${update.Message}`);
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
void resubscribe();
|
|
120
|
+
}, (0, functions_1.addRandomnessToTime)(resubscribeTimeout));
|
|
131
121
|
return;
|
|
132
122
|
}
|
|
133
|
-
|
|
123
|
+
this.log(logger_1.LogLevel.ERROR, `Unexpected response: ${update.Message}`);
|
|
124
|
+
const err = new message_1.ErrorResponse(update);
|
|
125
|
+
observer.pushError(err);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
let hlUpdate;
|
|
129
|
+
try {
|
|
130
|
+
hlUpdate = new message_1.HighLevelUpdate(update);
|
|
134
131
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
132
|
+
catch (e) {
|
|
133
|
+
this.log(logger_1.LogLevel.ERROR, `Failed to parse response: ${update.body.value}`);
|
|
134
|
+
observer.pushError(e);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
observer.unsubscribe = () => {
|
|
138
|
+
const subscription = __classPrivateFieldGet(this, _subscriptions, "f").get(key);
|
|
139
|
+
if (subscription) {
|
|
140
|
+
const subcounts = __classPrivateFieldGet(this, _subscriptionCounts, "f").get(key) ?? 0;
|
|
141
|
+
__classPrivateFieldGet(this, _subscriptionCounts, "f").set(key, subcounts - 1);
|
|
142
|
+
if (subcounts - 1 > 0) {
|
|
143
|
+
this.log(logger_1.LogLevel.INFO, `Not unsubscribing from ${key} as there are still ${subcounts} subscribers`);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
__classPrivateFieldGet(this, _subscriptions, "f").delete(key);
|
|
147
|
+
__classPrivateFieldGet(this, _subscriptionCounts, "f").delete(key);
|
|
148
|
+
}
|
|
149
|
+
this.log(logger_1.LogLevel.INFO, `Unsubscribing from ${key}`);
|
|
150
|
+
const cancelationRequest = new message_1.CancelSubscriptionRequest(observer.idJob);
|
|
151
|
+
const unsubscribeMsg = {
|
|
152
|
+
message: cancelationRequest.getPtlMessage(),
|
|
153
|
+
callbackType: 'job',
|
|
154
|
+
callbackId: '',
|
|
155
|
+
};
|
|
156
|
+
void this.hooks.callHook('frontgateConnection:sendMessage', unsubscribeMsg);
|
|
157
|
+
removeMessageUpdateHook();
|
|
158
|
+
removeReconnectHook();
|
|
141
159
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
};
|
|
146
|
-
observer.pushPatchData(hlUpdate.data);
|
|
160
|
+
observer.pushPatchData(hlUpdate.data);
|
|
161
|
+
});
|
|
162
|
+
res();
|
|
147
163
|
});
|
|
148
|
-
res();
|
|
149
164
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
await (0, functions_1.useTimeout)(timeOutInMs, 'Request timeout reached', resubscribePromise);
|
|
153
|
-
}
|
|
154
|
-
catch (e) {
|
|
155
|
-
observer.pushError(new message_1.ErrorResponse({ Message: 'Reconnect failed', Error: e }));
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
const removeReconnectHook = this.hooks.hook('reconnect:success', resubscribe);
|
|
159
|
-
observer.unsubscribe = () => {
|
|
160
|
-
const subscription = __classPrivateFieldGet(this, _subscriptions, "f").get(key);
|
|
161
|
-
if (subscription) {
|
|
162
|
-
subscription.count--;
|
|
163
|
-
if (subscription.count > 0) {
|
|
164
|
-
this.log(logger_1.LogLevel.INFO, `Not unsubscribing from ${key} as there are still ${subscription.count} subscribers`);
|
|
165
|
-
return;
|
|
165
|
+
try {
|
|
166
|
+
await (0, functions_1.useTimeout)(timeOutInMs, 'Request timeout reached', resubscribePromise);
|
|
166
167
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
catch (e) {
|
|
169
|
+
observer.pushError(new message_1.ErrorResponse({ Message: 'Reconnect failed', Error: e }));
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const removeReconnectHook = this.hooks.hook('reconnect:success', resubscribe);
|
|
173
|
+
observer.unsubscribe = () => {
|
|
174
|
+
const subscription = __classPrivateFieldGet(this, _subscriptions, "f").get(key);
|
|
175
|
+
if (subscription) {
|
|
176
|
+
const subcounts = __classPrivateFieldGet(this, _subscriptionCounts, "f").get(key) ?? 0;
|
|
177
|
+
__classPrivateFieldGet(this, _subscriptionCounts, "f").set(key, subcounts - 1);
|
|
178
|
+
if (subcounts - 1 > 0) {
|
|
179
|
+
this.log(logger_1.LogLevel.INFO, `Not unsubscribing from ${key} as there are still ${subcounts} subscribers`);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
__classPrivateFieldGet(this, _subscriptions, "f").delete(key);
|
|
183
|
+
__classPrivateFieldGet(this, _subscriptionCounts, "f").delete(key);
|
|
184
|
+
}
|
|
185
|
+
this.log(logger_1.LogLevel.INFO, `Unsubscribing from ${key}`);
|
|
186
|
+
const cancelationRequest = new message_1.CancelSubscriptionRequest(observer.idJob);
|
|
187
|
+
const unsubscribeMsg = {
|
|
188
|
+
message: cancelationRequest.getPtlMessage(),
|
|
189
|
+
callbackType: 'job',
|
|
190
|
+
callbackId: '',
|
|
191
|
+
};
|
|
192
|
+
void this.hooks.callHook('frontgateConnection:sendMessage', unsubscribeMsg);
|
|
193
|
+
removeMessageUpdateHook();
|
|
194
|
+
removeReconnectHook();
|
|
175
195
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
196
|
+
__classPrivateFieldGet(this, _subscriptions, "f").set(key, observer);
|
|
197
|
+
const currentSubscounts = __classPrivateFieldGet(this, _subscriptionCounts, "f").get(key) ?? 0;
|
|
198
|
+
__classPrivateFieldGet(this, _subscriptionCounts, "f").set(key, currentSubscounts + 1);
|
|
199
|
+
__classPrivateFieldGet(this, _inFlights, "f").delete(key);
|
|
200
|
+
resolve(observer);
|
|
201
|
+
});
|
|
202
|
+
})
|
|
203
|
+
.catch((e) => {
|
|
204
|
+
reject(e);
|
|
182
205
|
});
|
|
183
206
|
});
|
|
184
207
|
const rejectReason = `Request timeout reached (${timeOutInMs} ms) for ${subscriptionMsg.message.Message}`;
|
|
185
|
-
|
|
208
|
+
const wrappedTimeoutPromise = (0, functions_1.useTimeout)(timeOutInMs, rejectReason, promise);
|
|
209
|
+
__classPrivateFieldGet(this, _inFlights, "f").set(key, wrappedTimeoutPromise);
|
|
210
|
+
return wrappedTimeoutPromise;
|
|
186
211
|
}
|
|
187
212
|
},
|
|
188
213
|
_subscriptions = new WeakMap(),
|
|
214
|
+
_subscriptionCounts = new WeakMap(),
|
|
215
|
+
_inFlights = new WeakMap(),
|
|
189
216
|
_a;
|
|
190
217
|
};
|
|
191
218
|
return (0, __1.createExtendedMixinFactory)(mixinEndpointSubscribable, {
|
package/dist/lib/node/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PACKAGE_JSON = void 0;
|
|
4
|
-
exports.PACKAGE_JSON = { version: '
|
|
4
|
+
exports.PACKAGE_JSON = { version: '7.0.1', package: '@factset/frontgate-js-sdk' };
|
|
@@ -19,7 +19,6 @@ export declare class FrontgateClient<hookable extends DefaultFrontgateClientHook
|
|
|
19
19
|
logger: LoggerInterface | undefined;
|
|
20
20
|
hooks: Hookable<hookable>;
|
|
21
21
|
get defaultTimeoutInMs(): number;
|
|
22
|
-
set defaultTimeoutInMs(value: number);
|
|
23
22
|
constructor(conf?: Partial<FrontgateClientConfig>);
|
|
24
23
|
log(level: LogLevel, ...args: unknown[]): void;
|
|
25
24
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from './AbstractAuthentication';
|
|
2
|
-
export * from './AuthenticationInterface';
|
|
3
|
-
export * from './CookieTokenAuthentication';
|
|
4
1
|
export * from './CookieTokenAuthenticationFactors';
|
|
5
|
-
export
|
|
2
|
+
export declare const ID_APP_AUTHENTICATED = -2;
|
|
3
|
+
export declare const ID_USER_AUTHENTICATED = -2;
|
|
4
|
+
export declare const ID_USER_NONE = -1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import bigInt from 'big-integer';
|
|
2
|
-
|
|
2
|
+
interface SaltedHash {
|
|
3
3
|
salt: number[];
|
|
4
4
|
hash1: bigInt.BigInteger;
|
|
5
5
|
hash2: bigInt.BigInteger;
|
|
@@ -13,3 +13,4 @@ export declare class ChallengeResolver {
|
|
|
13
13
|
private static createSaltedHash;
|
|
14
14
|
private static hexToInt64LE;
|
|
15
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,30 +1,9 @@
|
|
|
1
|
-
import type { ErrorResponse } from '../message';
|
|
2
1
|
export interface CustomError {
|
|
3
2
|
message: string;
|
|
4
3
|
name: string;
|
|
5
4
|
code: number;
|
|
6
5
|
}
|
|
7
|
-
export declare class ServiceUnavailableError extends Error implements CustomError {
|
|
8
|
-
code: number;
|
|
9
|
-
constructor(message?: string, error?: Error);
|
|
10
|
-
}
|
|
11
|
-
export declare class InternalServerError extends Error implements CustomError {
|
|
12
|
-
code: number;
|
|
13
|
-
constructor(message?: string, error?: Error);
|
|
14
|
-
}
|
|
15
6
|
export declare class TimeoutError extends Error implements CustomError {
|
|
16
7
|
code: number;
|
|
17
8
|
constructor(message?: string, error?: Error);
|
|
18
9
|
}
|
|
19
|
-
export declare class UnauthorizedError extends Error implements CustomError {
|
|
20
|
-
code: number;
|
|
21
|
-
constructor(message?: string, error?: Error);
|
|
22
|
-
}
|
|
23
|
-
export declare class BadRequestError extends Error implements CustomError {
|
|
24
|
-
code: number;
|
|
25
|
-
constructor(message?: string, error?: Error);
|
|
26
|
-
}
|
|
27
|
-
export declare class ResponseError extends Error {
|
|
28
|
-
response: ErrorResponse;
|
|
29
|
-
constructor(message: string, response: ErrorResponse);
|
|
30
|
-
}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import type { ErrorResponse, PermissionDeniedResponse } from '../message';
|
|
2
1
|
export declare function isObject(obj: unknown): obj is object;
|
|
3
2
|
export declare function deepmerge(...args: unknown[]): object;
|
|
4
|
-
export declare function provideAsArray<T>(subject: T | T[]): T[];
|
|
5
|
-
export declare function unsignedArrayToBase64(data: number[] | Uint8Array): string;
|
|
6
3
|
export declare function toUrlBase64(strInBase64: string): string;
|
|
7
|
-
export declare function isBase64Url(tokenStr: string): boolean;
|
|
8
|
-
export declare function base64UrlToBase64(base64Url: string): string;
|
|
9
|
-
export declare const errorHandler: (response: ErrorResponse | PermissionDeniedResponse) => Error;
|
|
10
|
-
export declare const delay: (delayInMs: number) => Promise<unknown>;
|
|
11
|
-
export declare const isNodeEnvironment: () => boolean;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export * from '../authentication/util';
|
|
2
|
-
export * from '../authentication/AppAuthentication';
|
|
3
|
-
export * from '../authentication/UserCredentialAuthentication';
|
|
4
|
-
export * from '../authentication/UserPasswordAuthentication';
|
|
5
2
|
export * from '../message/request/AuthenticationRequest';
|
|
6
3
|
export * from '../message/request/ConfigurationRequest';
|
|
7
4
|
export * from '../mixins/auth/AppAuthMixin';
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
export * from './ConnectionInterface';
|
|
2
|
-
export * from './AbstractFrontgateConnection';
|
|
3
|
-
export * from './FrontgateWSConnection';
|
|
4
|
-
export * from './util/Encoding';
|
|
5
1
|
export * from './util/functions';
|
|
6
|
-
export
|
|
7
|
-
|
|
2
|
+
export declare enum ConnectionState {
|
|
3
|
+
DISCONNECTED = 0,
|
|
4
|
+
CONNECTING = 1,
|
|
5
|
+
AUTHENTICATED = 2,
|
|
6
|
+
RECONNECTING = 3
|
|
7
|
+
}
|
|
8
|
+
export declare enum DeploymentStage {
|
|
9
|
+
production = 40,
|
|
10
|
+
preproduction = 35,
|
|
11
|
+
show = 30,
|
|
12
|
+
testing = 20
|
|
13
|
+
}
|
|
14
|
+
export declare enum DefaultHosts {
|
|
15
|
+
production = "frontgate-eu.factsetdigitalsolutions.com",
|
|
16
|
+
show = "frontgate-eu.show.factsetdigitalsolutions.com"
|
|
17
|
+
}
|