@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
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubjectManager = void 0;
|
|
4
|
-
class SubjectManager {
|
|
5
|
-
constructor(logger) {
|
|
6
|
-
this.job = new Map();
|
|
7
|
-
this.logger = logger;
|
|
8
|
-
}
|
|
9
|
-
hasJobSubject(idJob) {
|
|
10
|
-
return this.job.has(String(idJob));
|
|
11
|
-
}
|
|
12
|
-
registerJobSubject(idJob, subject) {
|
|
13
|
-
const key = String(idJob);
|
|
14
|
-
this.job.set(key, subject);
|
|
15
|
-
}
|
|
16
|
-
findJobSubject(identifier) {
|
|
17
|
-
const id = String(identifier);
|
|
18
|
-
if (!this.job.has(id)) {
|
|
19
|
-
throw new Error(`could not find job subject for id=${identifier}`);
|
|
20
|
-
}
|
|
21
|
-
return this.job.get(id);
|
|
22
|
-
}
|
|
23
|
-
removeJobSubject(idJob) {
|
|
24
|
-
const id = String(idJob);
|
|
25
|
-
if (!this.job.has(id)) {
|
|
26
|
-
this.logger.warn(`No subject found for idJob ${id}`);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
this.job.delete(id);
|
|
30
|
-
}
|
|
31
|
-
getJobSubject(idJob) {
|
|
32
|
-
const id = String(idJob);
|
|
33
|
-
if (!this.job.has(id)) {
|
|
34
|
-
this.logger.warn(`No subject found for idJob ${id}`);
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
return this.job.get(id);
|
|
38
|
-
}
|
|
39
|
-
get jobs() {
|
|
40
|
-
return this.job;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.SubjectManager = SubjectManager;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.MessageFactory = exports.FLAG_HAS_NEXT_CHUNK = void 0;
|
|
37
|
-
const responses = __importStar(require("./response"));
|
|
38
|
-
const updates = __importStar(require("./update"));
|
|
39
|
-
exports.FLAG_HAS_NEXT_CHUNK = 8;
|
|
40
|
-
const message = { ...responses, ...updates };
|
|
41
|
-
class MessageFactory {
|
|
42
|
-
static createMessage(msg) {
|
|
43
|
-
if (!msg) {
|
|
44
|
-
throw new Error(`Could not create message because msg is "${msg}"`);
|
|
45
|
-
}
|
|
46
|
-
if (!msg.Message || typeof msg.Message !== 'string') {
|
|
47
|
-
throw new Error(`Could not create message because msg.Message is "${msg.Message}"`);
|
|
48
|
-
}
|
|
49
|
-
const separatorIdx = msg.Message.indexOf(MessageFactory.msgNameSeparator);
|
|
50
|
-
if (separatorIdx === -1) {
|
|
51
|
-
throw new Error(`Could not create message for invalid msg.Message "${msg.Message}"`);
|
|
52
|
-
}
|
|
53
|
-
if (!msg?.header) {
|
|
54
|
-
throw new Error(`Could not create message because the header is missing in the msg`);
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
const className = msg.Message.substring(separatorIdx + MessageFactory.msgNameSeparatorLength);
|
|
58
|
-
if (message[className]) {
|
|
59
|
-
return new message[className](msg);
|
|
60
|
-
}
|
|
61
|
-
return new responses.Mdg2Response(msg);
|
|
62
|
-
}
|
|
63
|
-
catch (e) {
|
|
64
|
-
throw new Error(`Could not create message "${msg.Message}": ${e.message}`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
static hasNextChunk(msg) {
|
|
68
|
-
return ((msg.header?.flags ?? 0) & exports.FLAG_HAS_NEXT_CHUNK) === exports.FLAG_HAS_NEXT_CHUNK;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.MessageFactory = MessageFactory;
|
|
72
|
-
MessageFactory.msgNameSeparator = '::';
|
|
73
|
-
MessageFactory.msgNameSeparatorLength = 2;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isErrorResponse = isErrorResponse;
|
|
4
|
-
exports.isPermissionDeniedResponse = isPermissionDeniedResponse;
|
|
5
|
-
exports.isHighLevelResponse = isHighLevelResponse;
|
|
6
|
-
exports.isHighLevelResponseMessage = isHighLevelResponseMessage;
|
|
7
|
-
exports.isRejectResponse = isRejectResponse;
|
|
8
|
-
exports.isHighLevelUpdate = isHighLevelUpdate;
|
|
9
|
-
exports.isSubscriptionLossMessage = isSubscriptionLossMessage;
|
|
10
|
-
function isErrorResponse(response) {
|
|
11
|
-
return response.name === 'Foundation::ErrorResponse';
|
|
12
|
-
}
|
|
13
|
-
function isPermissionDeniedResponse(response) {
|
|
14
|
-
return response.name === 'Foundation::PermissionDeniedResponse';
|
|
15
|
-
}
|
|
16
|
-
function isHighLevelResponse(response) {
|
|
17
|
-
return response.name === 'Foundation::HighLevelResponse';
|
|
18
|
-
}
|
|
19
|
-
function isHighLevelResponseMessage(response) {
|
|
20
|
-
return response.Message === 'Foundation::HighLevelResponse';
|
|
21
|
-
}
|
|
22
|
-
function isRejectResponse(response) {
|
|
23
|
-
return response.name === 'Foundation::RejectResponse';
|
|
24
|
-
}
|
|
25
|
-
function isHighLevelUpdate(response) {
|
|
26
|
-
return response.name === 'Foundation::HighLevelUpdate';
|
|
27
|
-
}
|
|
28
|
-
function isSubscriptionLossMessage(response) {
|
|
29
|
-
return response.name === 'Foundation::SubscriptionLossMessage';
|
|
30
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RawRequestFactory = void 0;
|
|
4
|
-
const RawRequest_1 = require("./RawRequest");
|
|
5
|
-
class RawRequestFactory {
|
|
6
|
-
static createFromString(json) {
|
|
7
|
-
return RawRequestFactory.createFromObject(JSON.parse(json));
|
|
8
|
-
}
|
|
9
|
-
static createFromObject(json) {
|
|
10
|
-
const { header } = json;
|
|
11
|
-
if (header) {
|
|
12
|
-
if (header.id_job) {
|
|
13
|
-
delete header.id_job;
|
|
14
|
-
}
|
|
15
|
-
if (header.resend_counter) {
|
|
16
|
-
delete header.resend_counter;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return new RawRequest_1.RawRequest(json);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.RawRequestFactory = RawRequestFactory;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CancelSubscriptionResponse = void 0;
|
|
4
|
-
const Mdg2Response_1 = require("./Mdg2Response");
|
|
5
|
-
class CancelSubscriptionResponse extends Mdg2Response_1.Mdg2Response {
|
|
6
|
-
}
|
|
7
|
-
exports.CancelSubscriptionResponse = CancelSubscriptionResponse;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PermissionDeniedResponse = void 0;
|
|
4
|
-
const Mdg2Response_1 = require("./Mdg2Response");
|
|
5
|
-
class PermissionDeniedResponse extends Mdg2Response_1.Mdg2Response {
|
|
6
|
-
get reason() {
|
|
7
|
-
return this.raw.details;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.PermissionDeniedResponse = PermissionDeniedResponse;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RejectResponse = void 0;
|
|
4
|
-
const Mdg2Response_1 = require("./Mdg2Response");
|
|
5
|
-
class RejectResponse extends Mdg2Response_1.Mdg2Response {
|
|
6
|
-
get reason() {
|
|
7
|
-
return this.raw.details;
|
|
8
|
-
}
|
|
9
|
-
get jobId() {
|
|
10
|
-
return this.raw.id_job;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.RejectResponse = RejectResponse;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionLossMessage = void 0;
|
|
4
|
-
const response_1 = require("../response");
|
|
5
|
-
class SubscriptionLossMessage extends response_1.Mdg2Response {
|
|
6
|
-
constructor(raw) {
|
|
7
|
-
super(raw);
|
|
8
|
-
this.reason = raw.reason;
|
|
9
|
-
}
|
|
10
|
-
get reasonValue() {
|
|
11
|
-
return this.reason.value;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.SubscriptionLossMessage = SubscriptionLossMessage;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimeoutWrapper = void 0;
|
|
4
|
-
const errors_1 = require("../common/errors");
|
|
5
|
-
class TimeoutWrapper {
|
|
6
|
-
static async wrap(promise, delay, rejectReason = '') {
|
|
7
|
-
return new TimeoutWrapper().wrap(promise, delay, rejectReason);
|
|
8
|
-
}
|
|
9
|
-
constructor() {
|
|
10
|
-
this.promiseFinally = async (promise, fn) => {
|
|
11
|
-
const success = (result) => {
|
|
12
|
-
fn();
|
|
13
|
-
return result;
|
|
14
|
-
};
|
|
15
|
-
const error = async (e) => {
|
|
16
|
-
fn();
|
|
17
|
-
return Promise.reject(e);
|
|
18
|
-
};
|
|
19
|
-
return Promise.resolve(promise).then(success, error);
|
|
20
|
-
};
|
|
21
|
-
this._id = null;
|
|
22
|
-
this._delay = null;
|
|
23
|
-
}
|
|
24
|
-
get id() {
|
|
25
|
-
return this._id;
|
|
26
|
-
}
|
|
27
|
-
get delay() {
|
|
28
|
-
return this._delay;
|
|
29
|
-
}
|
|
30
|
-
async set(delay, rejectReason = '') {
|
|
31
|
-
return new Promise((resolve, reject) => {
|
|
32
|
-
this.clear();
|
|
33
|
-
const fn = rejectReason
|
|
34
|
-
? () => {
|
|
35
|
-
reject(new errors_1.TimeoutError(rejectReason));
|
|
36
|
-
}
|
|
37
|
-
: resolve;
|
|
38
|
-
this._id = setTimeout(fn, delay);
|
|
39
|
-
this._delay = delay;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
async wrap(promise, delay, rejectReason = '') {
|
|
43
|
-
const wrappedPromise = this.promiseFinally(promise, () => {
|
|
44
|
-
this.clear();
|
|
45
|
-
});
|
|
46
|
-
const timer = this.set(delay, rejectReason);
|
|
47
|
-
return Promise.race([wrappedPromise, timer]);
|
|
48
|
-
}
|
|
49
|
-
clear() {
|
|
50
|
-
if (this._id) {
|
|
51
|
-
clearTimeout(this._id);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.TimeoutWrapper = TimeoutWrapper;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { HighLevelRequestResult, ObserveOptions, RequestResult } from './common/interfaces';
|
|
2
|
-
import type { RequestQuality } from './common/types';
|
|
3
|
-
import type { ConnectionInterface, ServerInfo } from './connection';
|
|
4
|
-
import type { LoggerInterface } from './logger';
|
|
5
|
-
import type { CookieTokenAuthenticationFactors } from './authentication';
|
|
6
|
-
import type { Mdg2ClientOptions } from './common/Mdg2ClientOptions';
|
|
7
|
-
import type { HTTPProxyRequestResult } from './common/interfaces/result/HTTPProxyRequestResult';
|
|
8
|
-
import type { AbstractMdg2Request, HighLevelRequestMethod, HighLevelRequestOptions, JobObservable, Mdg2Response, HTTPMethod, HTTPProxyRequestOptions } from './message';
|
|
9
|
-
export declare class Mdg2Client {
|
|
10
|
-
options: Mdg2ClientOptions;
|
|
11
|
-
private connection?;
|
|
12
|
-
private logger;
|
|
13
|
-
private readonly subscriptionModule;
|
|
14
|
-
private readonly requestModule;
|
|
15
|
-
flagPermissionDenied: boolean;
|
|
16
|
-
shouldRestartSubscriptions: boolean;
|
|
17
|
-
defaultTimeoutInMs: number;
|
|
18
|
-
defaultTimeoutTokenInMs: number;
|
|
19
|
-
maxTimeoutsBeforeReconnect: number;
|
|
20
|
-
enableSessionHandling: boolean;
|
|
21
|
-
private readonly replaySubjectBufferSize;
|
|
22
|
-
onConnectCallback: () => null;
|
|
23
|
-
private sessionConnect;
|
|
24
|
-
constructor(connection?: ConnectionInterface, options?: Mdg2ClientOptions);
|
|
25
|
-
connect(): Promise<void>;
|
|
26
|
-
connectSession(shouldThrow?: boolean): Promise<boolean>;
|
|
27
|
-
disconnect(logout?: boolean): Promise<void>;
|
|
28
|
-
request(msg: AbstractMdg2Request, timeOutInMs?: number): Promise<Mdg2Response>;
|
|
29
|
-
restartSubscriptions(): void;
|
|
30
|
-
requestWithQuality(msg: AbstractMdg2Request, quality?: RequestQuality, timeOutInMs?: number): Promise<Mdg2Response>;
|
|
31
|
-
requestEndpoint(method: HighLevelRequestMethod, path: string, data?: Record<string, unknown>, options?: HighLevelRequestOptions, timeOutInMs?: number): Promise<HighLevelRequestResult>;
|
|
32
|
-
requestProxyEndpoint(method: HTTPMethod, path: string, body?: Record<string, unknown>, options?: HTTPProxyRequestOptions, timeOutInMs?: number): Promise<HTTPProxyRequestResult>;
|
|
33
|
-
requestAuthenticationToken(lifetimeSeconds?: number, idUser?: number, idApplication?: number, timeOutInMs?: number): Promise<string>;
|
|
34
|
-
requestAuthenticationTokenExpiry(lifetimeSeconds?: number, idUser?: number, idApplication?: number, timeOutInMs?: number, otp?: boolean): Promise<{
|
|
35
|
-
token: string;
|
|
36
|
-
expiry: number;
|
|
37
|
-
}>;
|
|
38
|
-
requestOtpAuthenticationTokenForSessionHandling(lifetimeSeconds?: number, idUser?: number, idApplication?: number, timeOutInMs?: number): Promise<void>;
|
|
39
|
-
requestAuthenticationTokenForCookieTokenAuthentication(lifetimeSeconds?: number, idUser?: number, idApplication?: number, timeOutInMs?: number): Promise<CookieTokenAuthenticationFactors>;
|
|
40
|
-
observeEndpoint(method: HighLevelRequestMethod, path: string, data: Record<string, unknown>, options?: ObserveOptions, requestOptions?: HighLevelRequestOptions): JobObservable<RequestResult>;
|
|
41
|
-
unobserveEndpoint(idJob: number): Promise<void>;
|
|
42
|
-
setConnection(connection: ConnectionInterface): void;
|
|
43
|
-
getConnection(): ConnectionInterface | undefined;
|
|
44
|
-
setConnectionFromFetchConfiguration(input: RequestInfo, init?: RequestInit, shouldReconnectOnConnectionLoss?: boolean): Promise<void | Response>;
|
|
45
|
-
static createConnection(config: any, input?: RequestInfo, init?: RequestInit): ConnectionInterface;
|
|
46
|
-
setLogger(logger: LoggerInterface): void;
|
|
47
|
-
getLogger(): LoggerInterface;
|
|
48
|
-
get isConnected(): boolean;
|
|
49
|
-
get isConnecting(): boolean;
|
|
50
|
-
getServerInfo(): ServerInfo | undefined;
|
|
51
|
-
setConnectionFromSavedConfig(): boolean;
|
|
52
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ConnectionInterface, PeerInfo, ServerInfo } from '../connection';
|
|
2
|
-
import type { AuthenticationInterface } from './AuthenticationInterface';
|
|
3
|
-
import type { DisconnectionMessage, ConfigurationResponse, AuthenticationByTokenResponse } from '../message';
|
|
4
|
-
export declare const ID_APP_AUTHENTICATED = -2;
|
|
5
|
-
export declare const ID_USER_AUTHENTICATED = -2;
|
|
6
|
-
export declare const ID_USER_NONE = -1;
|
|
7
|
-
export declare abstract class AbstractAuthentication implements AuthenticationInterface {
|
|
8
|
-
readonly idApplication: number;
|
|
9
|
-
readonly idUser: number;
|
|
10
|
-
protected connection: ConnectionInterface;
|
|
11
|
-
private serverInfo;
|
|
12
|
-
protected constructor(idApplication: number, idUser?: number);
|
|
13
|
-
abstract authenticate(connection: ConnectionInterface): Promise<void>;
|
|
14
|
-
protected peerInfoFromMessage(msg: AuthenticationByTokenResponse | ConfigurationResponse | DisconnectionMessage): PeerInfo;
|
|
15
|
-
private parseServerInfo;
|
|
16
|
-
getServerInfo(): ServerInfo;
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ConnectionInterface } from '../connection';
|
|
2
|
-
import { AbstractAuthentication } from './AbstractAuthentication';
|
|
3
|
-
export declare class AppAuthentication extends AbstractAuthentication {
|
|
4
|
-
readonly sharedSecret: Buffer;
|
|
5
|
-
readonly clientSecret: Buffer;
|
|
6
|
-
readonly reconnectable = true;
|
|
7
|
-
constructor(idApplication: number, idUser: number, clientCredentials: string);
|
|
8
|
-
authenticate(connection: ConnectionInterface): Promise<void>;
|
|
9
|
-
private sendAuthenticationRequest;
|
|
10
|
-
private sendConfigurationRequest;
|
|
11
|
-
private sendTransportLayerRequestHeaderConfigurationRequest;
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ConnectionInterface, ServerInfo } from '../connection';
|
|
2
|
-
export interface AuthenticationInterface {
|
|
3
|
-
idApplication: number;
|
|
4
|
-
idUser: number;
|
|
5
|
-
authenticate: (connection: ConnectionInterface) => Promise<void>;
|
|
6
|
-
getServerInfo: () => ServerInfo;
|
|
7
|
-
reconnectable?: boolean;
|
|
8
|
-
onReconnect?: () => Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ConnectionInterface } from '../connection';
|
|
2
|
-
import { AbstractAuthentication } from './AbstractAuthentication';
|
|
3
|
-
export declare class TokenAuthentication extends AbstractAuthentication {
|
|
4
|
-
token: string;
|
|
5
|
-
protected fetchConfigurationInput: RequestInfo | undefined;
|
|
6
|
-
protected fetchConfigurationConfig: RequestInit | undefined;
|
|
7
|
-
constructor(token: string, validate?: boolean);
|
|
8
|
-
private setToken;
|
|
9
|
-
setFetchConfiguration(input: RequestInfo | undefined, config: RequestInit | undefined): void;
|
|
10
|
-
authenticate(connection: ConnectionInterface): Promise<void>;
|
|
11
|
-
private sendAuthenticationByTokenRequest;
|
|
12
|
-
get reconnectable(): boolean;
|
|
13
|
-
onReconnect(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ConnectionInterface } from '../connection';
|
|
2
|
-
import { AbstractAuthentication } from './AbstractAuthentication';
|
|
3
|
-
export declare class UserCredentialAuthentication extends AbstractAuthentication {
|
|
4
|
-
readonly username: string;
|
|
5
|
-
readonly sharedSecret: Buffer;
|
|
6
|
-
readonly clientSecret: Buffer;
|
|
7
|
-
readonly reconnectable = true;
|
|
8
|
-
constructor(idApplication: number, username: string, credentials: string);
|
|
9
|
-
authenticate(connection: ConnectionInterface): Promise<void>;
|
|
10
|
-
private sendAuthenticationRequest;
|
|
11
|
-
private sendConfigurationRequest;
|
|
12
|
-
private sendTransportLayerRequestHeaderConfigurationRequest;
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ConnectionInterface } from '../connection';
|
|
2
|
-
import { AbstractAuthentication } from './AbstractAuthentication';
|
|
3
|
-
export declare class UserPasswordAuthentication extends AbstractAuthentication {
|
|
4
|
-
readonly password: string;
|
|
5
|
-
readonly username: string;
|
|
6
|
-
readonly sharedSecret: Buffer;
|
|
7
|
-
readonly clientSecret: Buffer;
|
|
8
|
-
readonly reconnectable = true;
|
|
9
|
-
constructor(idApplication: number, username: string, password: string);
|
|
10
|
-
authenticate(connection: ConnectionInterface): Promise<void>;
|
|
11
|
-
private sendAuthenticationRequest;
|
|
12
|
-
private sendConfigurationRequest;
|
|
13
|
-
private sendTransportLayerRequestHeaderConfigurationRequest;
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface Mdg2ClientOptions {
|
|
2
|
-
flagPermissionDenied?: boolean;
|
|
3
|
-
shouldRestartSubscriptions?: boolean;
|
|
4
|
-
defaultTimeoutInMs?: number;
|
|
5
|
-
defaultTimeoutTokenInMs?: number;
|
|
6
|
-
maxTimeoutsBeforeReconnect?: number;
|
|
7
|
-
onConnectCallback?: () => null;
|
|
8
|
-
otpToken?: string;
|
|
9
|
-
otpTokenExpiry?: number;
|
|
10
|
-
enableSessionHandling?: boolean;
|
|
11
|
-
replaySubjectBufferSize?: number;
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RequestQuality } from './types';
|
|
2
|
-
export declare const LOGGER_NAME = "Mdg2Client";
|
|
3
|
-
export declare const DEFAULT_QUALITY: RequestQuality;
|
|
4
|
-
export declare const DEFAULT_TIMEOUT_IN_MS = 6000;
|
|
5
|
-
export declare const DEFAULT_TIMEOUT_TOKEN_IN_MS = 3000;
|
|
6
|
-
export declare const DEFAULT_TIMEOUT_CONNECTION_IN_MS = 9000;
|
|
7
|
-
export declare const DEFAULT_MAX_TIMEOUTS_BEFORE_RECONNECT = 3;
|
|
8
|
-
export declare const DEFAULT_ENABLE_SESSION_HANDLING = false;
|
|
9
|
-
export declare const DEFAULT_RESUBSCRIBE_WAIT_TIME_IN_MS = 9000;
|
|
10
|
-
export declare const DEFAULT_FLAG_PERMISSION_DENIED = false;
|
|
11
|
-
export declare const DEFAULT_REPLAY_SUBJECT_BUFFER_SIZE = 512;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { LoggerInterface } from '../logger';
|
|
2
|
-
import { LogLevel } from '../logger';
|
|
3
|
-
import type { AuthenticationInterface } from '../authentication';
|
|
4
|
-
import type { PtlMessage } from '../common/interfaces';
|
|
5
|
-
import type { ConnectionInterface, MaybeVoidFunctionType, PeerInfo } from './ConnectionInterface';
|
|
6
|
-
import type { JobPromise } from './JobPromise';
|
|
7
|
-
import { Compressor } from './util/Compressor';
|
|
8
|
-
import type { SupportedEncoding } from './util/Encoding';
|
|
9
|
-
import type { MessageProcessor } from './MessageProcessor';
|
|
10
|
-
import type { ClientOptions } from 'ws';
|
|
11
|
-
import type { DisconnectionMessage, LoadNotificationMessage } from '../message';
|
|
12
|
-
import type { Mdg2ClientOptions } from '../common/Mdg2ClientOptions';
|
|
13
|
-
export declare enum ConnectionState {
|
|
14
|
-
DISCONNECTED = 0,
|
|
15
|
-
CONNECTING = 1,
|
|
16
|
-
AUTHENTICATED = 2,
|
|
17
|
-
RECONNECTING = 3
|
|
18
|
-
}
|
|
19
|
-
export declare enum DeploymentStage {
|
|
20
|
-
production = 40,
|
|
21
|
-
preproduction = 35,
|
|
22
|
-
show = 30,
|
|
23
|
-
testing = 20
|
|
24
|
-
}
|
|
25
|
-
export declare enum DefaultHosts {
|
|
26
|
-
production = "frontgate-eu.factsetdigitalsolutions.com",
|
|
27
|
-
show = "frontgate-eu.show.factsetdigitalsolutions.com"
|
|
28
|
-
}
|
|
29
|
-
export interface FrontgateConnectionOptions {
|
|
30
|
-
payloadContent?: string;
|
|
31
|
-
payload_content: string;
|
|
32
|
-
deploymentStage?: DeploymentStage;
|
|
33
|
-
deployment_stage: DeploymentStage;
|
|
34
|
-
logger?: LoggerInterface;
|
|
35
|
-
loglevel?: LogLevel;
|
|
36
|
-
maximumIdleInterval?: number;
|
|
37
|
-
maximum_idle_interval: number;
|
|
38
|
-
frontgateAuthenticationToken?: string;
|
|
39
|
-
frontgateSplitAuthenticationTokenSecondFactor?: string | null;
|
|
40
|
-
splitAuthenticationTokenSecondFactor?: string;
|
|
41
|
-
split_authentication_token_second_factor?: string;
|
|
42
|
-
frontgateHost?: string;
|
|
43
|
-
host: string;
|
|
44
|
-
port: number;
|
|
45
|
-
tls: boolean;
|
|
46
|
-
frontgatePathPrefix?: string;
|
|
47
|
-
pathPrefix?: string;
|
|
48
|
-
path_prefix: string;
|
|
49
|
-
frontgateWebsocketProtocol?: SupportedEncoding;
|
|
50
|
-
encoding: SupportedEncoding;
|
|
51
|
-
webSocketClientOptions?: ClientOptions;
|
|
52
|
-
shouldReconnectOnConnectionLoss: boolean;
|
|
53
|
-
connectionTimeoutInMs: number;
|
|
54
|
-
enablePingPongKeepalive?: boolean;
|
|
55
|
-
sessionHandling: boolean;
|
|
56
|
-
}
|
|
57
|
-
export declare abstract class AbstractFrontgateConnection implements ConnectionInterface {
|
|
58
|
-
readonly options: FrontgateConnectionOptions;
|
|
59
|
-
readonly clientOptions: Mdg2ClientOptions;
|
|
60
|
-
readonly auth: AuthenticationInterface;
|
|
61
|
-
protected logger: LoggerInterface;
|
|
62
|
-
protected state: ConnectionState;
|
|
63
|
-
protected compressor: Compressor;
|
|
64
|
-
protected timestampOfLastMessageSent: number;
|
|
65
|
-
protected reconnectDelays: number[];
|
|
66
|
-
protected reconnectCounter: number;
|
|
67
|
-
protected connectionCounter: number;
|
|
68
|
-
protected messageReceiveTimeout: ReturnType<typeof setTimeout> | undefined | null;
|
|
69
|
-
protected pendingConnection: Promise<void> | null;
|
|
70
|
-
protected hasActiveSession: boolean;
|
|
71
|
-
static readonly DEFAULT_OPTIONS: FrontgateConnectionOptions;
|
|
72
|
-
private jobId;
|
|
73
|
-
private peerInfo;
|
|
74
|
-
private keepAliveIntervalHandle;
|
|
75
|
-
private readonly messageProcessors;
|
|
76
|
-
shouldRestartSubscriptions: boolean;
|
|
77
|
-
setMessageProcessor(messageName: string, messageProcessor: MessageProcessor): void;
|
|
78
|
-
removeMessageProcessor(messageName: string): void;
|
|
79
|
-
protected constructor(auth: AuthenticationInterface, options: Partial<FrontgateConnectionOptions>);
|
|
80
|
-
abstract open(delayInMs?: number): Promise<void>;
|
|
81
|
-
abstract send(msg: PtlMessage): JobPromise<PtlMessage>;
|
|
82
|
-
abstract submit(msg: PtlMessage): Promise<PtlMessage>;
|
|
83
|
-
close(): Promise<void>;
|
|
84
|
-
setPeerInfo(peerInfo: PeerInfo): void;
|
|
85
|
-
isAuthenticated(): boolean;
|
|
86
|
-
isConnecting(): boolean;
|
|
87
|
-
onConnect: MaybeVoidFunctionType;
|
|
88
|
-
onMessage: ((msg: PtlMessage) => void) | null;
|
|
89
|
-
onClose: ((reason: string | CloseEvent) => void) | null;
|
|
90
|
-
onError: ((error: Error) => void) | null;
|
|
91
|
-
onAuthentication: MaybeVoidFunctionType;
|
|
92
|
-
onCleanupRequests: MaybeVoidFunctionType;
|
|
93
|
-
onCleanupSubscriptions: MaybeVoidFunctionType;
|
|
94
|
-
onClearPendingSubscription: ((jobId: number) => void) | null;
|
|
95
|
-
onReceiveTimeout: MaybeVoidFunctionType;
|
|
96
|
-
restartSubscriptions: MaybeVoidFunctionType;
|
|
97
|
-
protected clearPendingConnection(): void;
|
|
98
|
-
protected isPendingConnection(): boolean;
|
|
99
|
-
protected handleLoadNotificationMessage(msg: LoadNotificationMessage): boolean;
|
|
100
|
-
protected handleKeepAliveMessage(): boolean;
|
|
101
|
-
protected handlePingResponseMessage(msg: any): boolean;
|
|
102
|
-
protected handleDisconnectionMessage(msg: DisconnectionMessage): Promise<void>;
|
|
103
|
-
protected handleAuthentication(): void;
|
|
104
|
-
protected handleReceiveTimeout(): void;
|
|
105
|
-
protected resetReceiveTimeout(): void;
|
|
106
|
-
protected handleStandardMessage(msg: PtlMessage): boolean;
|
|
107
|
-
protected handleMessage(msg: PtlMessage): PtlMessage | undefined;
|
|
108
|
-
protected handleClose(info: CloseEvent | string): Promise<void>;
|
|
109
|
-
private reconnect;
|
|
110
|
-
protected handleWsError(handleWsError: Error): void;
|
|
111
|
-
protected preSubmit(msg: PtlMessage): number | undefined | null;
|
|
112
|
-
private sendKeepAliveMessage;
|
|
113
|
-
private sendDisconnectionMessage;
|
|
114
|
-
private returnAndAssignJobIdToMessage;
|
|
115
|
-
setLogger(logger: LoggerInterface): void;
|
|
116
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { AuthenticationInterface } from '../authentication';
|
|
2
|
-
import type { PtlMessage } from '../common/interfaces';
|
|
3
|
-
import type { FrontgateConnectionOptions } from './AbstractFrontgateConnection';
|
|
4
|
-
import type { JobPromise } from './JobPromise';
|
|
5
|
-
import type { Mdg2ClientOptions } from '../common/Mdg2ClientOptions';
|
|
6
|
-
import type { LoggerInterface } from '../logger';
|
|
7
|
-
export type MaybeVoidFunctionType = (() => void) | null;
|
|
8
|
-
export interface PeerInfo {
|
|
9
|
-
uuid: {
|
|
10
|
-
id_1: string;
|
|
11
|
-
id_2: string;
|
|
12
|
-
};
|
|
13
|
-
description: string;
|
|
14
|
-
software: string;
|
|
15
|
-
os: string;
|
|
16
|
-
maximumIdleInterval: number;
|
|
17
|
-
maximumReceivableMessageSize: number;
|
|
18
|
-
loadStatus?: {
|
|
19
|
-
capacity: number;
|
|
20
|
-
idle: number;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface ServerInfo {
|
|
24
|
-
description: string;
|
|
25
|
-
software: string;
|
|
26
|
-
os: string;
|
|
27
|
-
time: Date;
|
|
28
|
-
offsetInMs: number;
|
|
29
|
-
}
|
|
30
|
-
export interface ConnectionInterface {
|
|
31
|
-
options: FrontgateConnectionOptions;
|
|
32
|
-
clientOptions: Mdg2ClientOptions;
|
|
33
|
-
auth: AuthenticationInterface;
|
|
34
|
-
shouldRestartSubscriptions: boolean;
|
|
35
|
-
isConnecting: () => boolean;
|
|
36
|
-
isAuthenticated: () => boolean;
|
|
37
|
-
open: (delayInMs?: number) => Promise<void>;
|
|
38
|
-
close: (reconnect?: boolean, logout?: boolean) => Promise<void>;
|
|
39
|
-
send: (msg: PtlMessage) => JobPromise<PtlMessage>;
|
|
40
|
-
submit: (msg: PtlMessage) => Promise<PtlMessage>;
|
|
41
|
-
onConnect: MaybeVoidFunctionType;
|
|
42
|
-
onMessage: ((msg: PtlMessage) => void) | null;
|
|
43
|
-
onAuthentication: MaybeVoidFunctionType;
|
|
44
|
-
onError: ((err: Error) => void) | null;
|
|
45
|
-
onClose: ((reason: string | CloseEvent) => void) | null;
|
|
46
|
-
onCleanupRequests: MaybeVoidFunctionType;
|
|
47
|
-
restartSubscriptions: MaybeVoidFunctionType;
|
|
48
|
-
onCleanupSubscriptions: MaybeVoidFunctionType;
|
|
49
|
-
setPeerInfo: (info: PeerInfo) => void;
|
|
50
|
-
onClearPendingSubscription: ((jobId: number) => void) | null;
|
|
51
|
-
onReceiveTimeout: MaybeVoidFunctionType;
|
|
52
|
-
setLogger: (logger: LoggerInterface) => void;
|
|
53
|
-
}
|