@factset/frontgate-js-sdk 7.0.1 → 7.0.2
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 +40 -11
- package/dist/lib/esnext/mixins/HTTPProxyRequestMixin.js +4 -4
- package/dist/lib/esnext/mixins/LoggerMixin.js +3 -3
- package/dist/lib/esnext/mixins/auth/SessionAuthMixin.js +2 -2
- package/dist/lib/esnext/mixins/auth/TokenAuthMixin.js +2 -2
- package/dist/lib/esnext/mixins/connection/FrontgateWSMixin.js +9 -9
- package/dist/lib/esnext/mixins/subscription/RawSubscriptionMixin.js +11 -11
- package/dist/lib/esnext/util/functions.js +4 -5
- package/dist/lib/esnext/version.js +1 -1
- package/dist/lib/node/mixins/HTTPProxyRequestMixin.js +4 -4
- package/dist/lib/node/mixins/LoggerMixin.js +3 -3
- package/dist/lib/node/mixins/auth/SessionAuthMixin.js +2 -2
- package/dist/lib/node/mixins/auth/TokenAuthMixin.js +2 -2
- package/dist/lib/node/mixins/connection/FrontgateWSMixin.js +9 -9
- package/dist/lib/node/mixins/subscription/RawSubscriptionMixin.js +11 -11
- package/dist/lib/node/util/functions.js +4 -5
- package/dist/lib/node/version.js +1 -1
- package/dist/lib/types/mixins/AuthTokenRequestMixin.d.ts +1 -1
- package/dist/lib/types/mixins/EndpointRequestMixin.d.ts +2 -2
- package/dist/lib/types/mixins/HTTPProxyRequestMixin.d.ts +1 -1
- package/dist/lib/types/mixins/LoggerMixin.d.ts +2 -2
- package/dist/lib/types/mixins/MessageCompressorMixin.d.ts +2 -2
- package/dist/lib/types/mixins/OpenTelemetryMixin.d.ts +2 -2
- package/dist/lib/types/mixins/PingMixin.d.ts +1 -1
- package/dist/lib/types/mixins/ReconnectMixin.d.ts +4 -4
- package/dist/lib/types/mixins/RemoteLoggerMixin.d.ts +1 -1
- package/dist/lib/types/mixins/RequestMixin.d.ts +1 -1
- package/dist/lib/types/mixins/auth/AppAuthMixin.d.ts +7 -7
- package/dist/lib/types/mixins/auth/CookieTokenAuthMixin.d.ts +1 -1
- package/dist/lib/types/mixins/auth/FetchAuthenticationMixin.d.ts +25 -25
- package/dist/lib/types/mixins/auth/SessionAuthMixin.d.ts +31 -31
- package/dist/lib/types/mixins/auth/TokenAuthMixin.d.ts +3 -3
- package/dist/lib/types/mixins/auth/UserCredentialAuthMixin.d.ts +7 -7
- package/dist/lib/types/mixins/auth/UserPasswordAuthMixin.d.ts +7 -7
- package/dist/lib/types/mixins/connection/FrontgateWSMixin.d.ts +20 -20
- package/dist/lib/types/mixins/subscription/EndpointSubscriptionMixin.d.ts +4 -4
- package/dist/lib/types/mixins/subscription/RawSubscriptionMixin.d.ts +3 -3
- package/dist/lib/types/util/functions.d.ts +1 -2
- package/dist/lib/umd/mdg2.client.min.umd.js +1 -1
- package/dist/lib/umd/mdg2.client.umd.js +33 -34
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
|
+
## <small>7.0.2 (2025-10-09)</small>
|
|
2
|
+
|
|
3
|
+
* feat(functions): remove depracted usage of navigator props [3d6a16f]
|
|
4
|
+
* chore(deps): lock file maintenance [e8dd0a6]
|
|
5
|
+
* chore(deps): lock file maintenance [2f82edc]
|
|
6
|
+
* chore(deps): lock file maintenance [da9e5e2]
|
|
7
|
+
* chore(deps): lock file maintenance [6e51dfc]
|
|
8
|
+
* chore(deps): remove deprecated @types/bcryptjs [280a123]
|
|
9
|
+
* chore(deps): remove obsolete package [1810338]
|
|
10
|
+
* chore(deps): update actions/setup-python action to v6 [6469271]
|
|
11
|
+
* chore(deps): update dependency @fds/lint-standards to v28 [3bfd5f9]
|
|
12
|
+
* chore(deps): update dependency @fds/lint-standards to v29 [90367f8]
|
|
13
|
+
* chore(deps): update dependency happy-dom to v19 [32960ea]
|
|
14
|
+
* chore(deps): update dependency vite to ^7.1.5 [security] [8879b32]
|
|
15
|
+
* chore(deps): update softprops/action-gh-release action to v2.3.3 [00f18bb]
|
|
16
|
+
* chore(deps): update softprops/action-gh-release action to v2.3.4 [1bf3bad]
|
|
17
|
+
* chore(deps): update softprops/action-gh-release action to v2.4.0 [6fa1a5e]
|
|
18
|
+
* chore(deps): update sonarsource/sonarqube-scan-action action to v6 [6efaefa]
|
|
19
|
+
* chore(deps): update yarn to v4.10.0 [b47a139]
|
|
20
|
+
* chore(deps): update yarn to v4.10.3 [7759d0a]
|
|
21
|
+
* chore(epr): inform users about the npm release [8849286]
|
|
22
|
+
* fix(deps): update dependency lerna to v9 [976a3ba]
|
|
23
|
+
* fix(functions): dont rely on navigator beeing populated [10b56b4]
|
|
24
|
+
* refactor(variables): rename to prevent shadowing [e8caa54]
|
|
25
|
+
* docs(release): document process to force correct latest version [8b4f115]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
1
29
|
## <small>7.0.1 (2025-09-03)</small>
|
|
2
30
|
|
|
3
|
-
* fix(build): remove sourcemaps [7cae368]
|
|
4
|
-
* fix(client): generate changelog correctly [0c798ae]
|
|
5
|
-
* fix(demo): use newer endpoints [5f8e758]
|
|
6
|
-
* fix(fetch-authentication-mixin): log correct object [2f3adbb]
|
|
7
|
-
* fix(fetch-authentication-mixin): remove wrong inheritance [68d8fc6]
|
|
8
|
-
* fix(ga): prevent shell injection [723d5c3]
|
|
9
|
-
* fix(release): add changelog to release [49089a0]
|
|
10
|
-
* fix(release): change release action [bfb0d9b]
|
|
11
|
-
* fix(release): ommit lerna tags to not destroy changelog [9e8faf6]
|
|
12
|
-
* fix(release): use fixes from v6 release [c395dc9]
|
|
13
|
-
* fix(subscriptions): catch inflight requests [d40394a]
|
|
14
31
|
* chore(changelog): refresh changelog [a0a3d56]
|
|
15
32
|
* chore(deps): lock file maintenance [c2a734e]
|
|
16
33
|
* chore(deps): replace dependency npm-run-all with npm-run-all2 ^5.0.0 [59bf6a4]
|
|
@@ -26,7 +43,19 @@
|
|
|
26
43
|
* chore(deps): update yarn to v4.9.4 [9f5af73]
|
|
27
44
|
* chore(docs): add release documentation [ee22da6]
|
|
28
45
|
* chore(package): align parallelization to drop dependency [3d5e19f]
|
|
46
|
+
* chore(release): update changelog for v7.0.1 [3b03eda]
|
|
29
47
|
* chore(repo): update deps [bf03d29]
|
|
48
|
+
* fix(build): remove sourcemaps [7cae368]
|
|
49
|
+
* fix(client): generate changelog correctly [0c798ae]
|
|
50
|
+
* fix(demo): use newer endpoints [5f8e758]
|
|
51
|
+
* fix(fetch-authentication-mixin): log correct object [2f3adbb]
|
|
52
|
+
* fix(fetch-authentication-mixin): remove wrong inheritance [68d8fc6]
|
|
53
|
+
* fix(ga): prevent shell injection [723d5c3]
|
|
54
|
+
* fix(release): add changelog to release [49089a0]
|
|
55
|
+
* fix(release): change release action [bfb0d9b]
|
|
56
|
+
* fix(release): ommit lerna tags to not destroy changelog [9e8faf6]
|
|
57
|
+
* fix(release): use fixes from v6 release [c395dc9]
|
|
58
|
+
* fix(subscriptions): catch inflight requests [d40394a]
|
|
30
59
|
|
|
31
60
|
|
|
32
61
|
|
|
@@ -5,13 +5,13 @@ export const httpProxyRequest = () => {
|
|
|
5
5
|
const mixinHTTPProxyRequestable = (Base) => {
|
|
6
6
|
return class extends Base {
|
|
7
7
|
async requestProxyEndpoint(method, path, body, options, timeOutInMs = this.defaultTimeoutInMs) {
|
|
8
|
-
const
|
|
8
|
+
const request = new HTTPProxyRequest(method, path, options);
|
|
9
9
|
if (body) {
|
|
10
|
-
|
|
10
|
+
request.setBody(body);
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
request.header.setTimeout(timeOutInMs);
|
|
13
13
|
const msg = {
|
|
14
|
-
message:
|
|
14
|
+
message: request.getPtlMessage(),
|
|
15
15
|
callbackType: 'job',
|
|
16
16
|
callbackId: '',
|
|
17
17
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createExtendedMixinFactory } from '.';
|
|
2
|
-
export const logger = (
|
|
2
|
+
export const logger = (loggerInstance, logLevel) => {
|
|
3
3
|
if (logLevel) {
|
|
4
|
-
|
|
4
|
+
loggerInstance.setLevel(logLevel);
|
|
5
5
|
}
|
|
6
6
|
const mixinLogger = (Base) => {
|
|
7
7
|
return class extends Base {
|
|
8
8
|
constructor(...args) {
|
|
9
9
|
super(...args);
|
|
10
|
-
this.logger =
|
|
10
|
+
this.logger = loggerInstance;
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
};
|
|
@@ -126,8 +126,8 @@ export const sessionAuth = (config, idApplication, username, password, deploymen
|
|
|
126
126
|
_sharedSecret = new WeakMap(),
|
|
127
127
|
_clientSecret = new WeakMap(),
|
|
128
128
|
_instances = new WeakSet(),
|
|
129
|
-
_requestOtpAuthenticationTokenForSessionHandling = async function _requestOtpAuthenticationTokenForSessionHandling(lifetimeSeconds = AuthenticationTokenRequest.LIFETIME_SECONDS_MAXIMUM, idUser = ID_USER_AUTHENTICATED,
|
|
130
|
-
const request = new AuthenticationTokenRequest(lifetimeSeconds, idUser,
|
|
129
|
+
_requestOtpAuthenticationTokenForSessionHandling = async function _requestOtpAuthenticationTokenForSessionHandling(lifetimeSeconds = AuthenticationTokenRequest.LIFETIME_SECONDS_MAXIMUM, idUser = ID_USER_AUTHENTICATED, idApplicationOtp = ID_APP_AUTHENTICATED, timeOutInMs = this.defaultTimeoutInMs) {
|
|
130
|
+
const request = new AuthenticationTokenRequest(lifetimeSeconds, idUser, idApplicationOtp, timeOutInMs, true);
|
|
131
131
|
const msg = {
|
|
132
132
|
message: request.getPtlMessage(),
|
|
133
133
|
callbackType: 'job',
|
|
@@ -44,8 +44,8 @@ export const tokenAuth = (token) => {
|
|
|
44
44
|
};
|
|
45
45
|
this.hooks.hook('frontgateConnection:connected', authFn);
|
|
46
46
|
}
|
|
47
|
-
set token(
|
|
48
|
-
__classPrivateFieldSet(this, _token,
|
|
47
|
+
set token(newToken) {
|
|
48
|
+
__classPrivateFieldSet(this, _token, newToken, "f");
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
_token = new WeakMap(),
|
|
@@ -19,8 +19,8 @@ export const wsConnection = (conf) => {
|
|
|
19
19
|
const mixinConnectableWS = (Base) => {
|
|
20
20
|
var _instances, _ws, _wsConf, _wsStateInternal, _keepAliveTimer, _jobId, _idApplication, _idUser, _wsState_get, _message_buffer_size, _msgBuffer, _getDisconnectMessage, _getKeepAliveMessage, _sendMessage, _respondToMessage, _addJobIdToMessage, _prepareMessage, _createErrorMessage, _applyDefaultsToConfig, _a;
|
|
21
21
|
return _a = class extends Base {
|
|
22
|
-
set conf(
|
|
23
|
-
const internalConf = __classPrivateFieldGet(this, _instances, "m", _applyDefaultsToConfig).call(this,
|
|
22
|
+
set conf(newConf) {
|
|
23
|
+
const internalConf = __classPrivateFieldGet(this, _instances, "m", _applyDefaultsToConfig).call(this, newConf);
|
|
24
24
|
__classPrivateFieldSet(this, _message_buffer_size, internalConf.messageBufferSize, "f");
|
|
25
25
|
__classPrivateFieldSet(this, _wsConf, internalConf, "f");
|
|
26
26
|
}
|
|
@@ -312,16 +312,16 @@ export const wsConnection = (conf) => {
|
|
|
312
312
|
details: error,
|
|
313
313
|
});
|
|
314
314
|
},
|
|
315
|
-
_applyDefaultsToConfig = function _applyDefaultsToConfig(
|
|
316
|
-
const maxIdleIntervalInS =
|
|
317
|
-
const maxIdleInterval =
|
|
315
|
+
_applyDefaultsToConfig = function _applyDefaultsToConfig(oldConf) {
|
|
316
|
+
const maxIdleIntervalInS = oldConf.maximumIdleIntervalInS ?? 60;
|
|
317
|
+
const maxIdleInterval = oldConf.maximumIdleInterval ?? maxIdleIntervalInS * 1000000;
|
|
318
318
|
return {
|
|
319
|
-
...
|
|
320
|
-
payloadContent:
|
|
319
|
+
...oldConf,
|
|
320
|
+
payloadContent: oldConf.payloadContent ?? 'foundation',
|
|
321
321
|
maximumIdleIntervalInS: maxIdleIntervalInS,
|
|
322
322
|
maximumIdleInterval: maxIdleInterval,
|
|
323
|
-
tls:
|
|
324
|
-
messageBufferSize:
|
|
323
|
+
tls: oldConf.tls ?? true,
|
|
324
|
+
messageBufferSize: oldConf.messageBufferSize ?? 512,
|
|
325
325
|
};
|
|
326
326
|
},
|
|
327
327
|
_a;
|
|
@@ -68,19 +68,19 @@ export const rawSubscriptions = () => {
|
|
|
68
68
|
this.log(LogLevel.INFO, `Resubscribing to ${key} due to reconnect`);
|
|
69
69
|
await this.hooks.callHook('frontgateConnection:sendMessage', subscriptionMsg);
|
|
70
70
|
const resubscribePromise = new Promise((res, rej) => {
|
|
71
|
-
this.hooks.hookOnce(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (
|
|
72
|
-
if (
|
|
73
|
-
const err = new ErrorResponse(
|
|
74
|
-
this.log(LogLevel.ERROR, `Unexpected resp: ${
|
|
71
|
+
this.hooks.hookOnce(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (resubscribeResponse) => {
|
|
72
|
+
if (resubscribeResponse.Message.includes('Error') || resubscribeResponse.Message.includes('PermissionDenied')) {
|
|
73
|
+
const err = new ErrorResponse(resubscribeResponse);
|
|
74
|
+
this.log(LogLevel.ERROR, `Unexpected resp: ${resubscribeResponse.Message}`);
|
|
75
75
|
rej(err);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
? new CancelSubscriptionRequest(
|
|
81
|
-
: new CancelationRequestConstructor(
|
|
82
|
-
observer.idJob =
|
|
83
|
-
removeMessageUpdateHook = this.hooks.hook(`frontgateConnection:response:${
|
|
78
|
+
const resubscriptionKey = subscriptionType === 'connection' ? `${resubscribeResponse.header.id_service}-${request.getPtlMessage().id_notation}` : resubscribeResponse.header.id_job;
|
|
79
|
+
const resubscriptionCancelationRequest = typeof CancelationRequestConstructor === 'undefined'
|
|
80
|
+
? new CancelSubscriptionRequest(resubscribeResponse.header.id_job)
|
|
81
|
+
: new CancelationRequestConstructor(resubscribeResponse.header.id_service, request.getPtlMessage().id_notation);
|
|
82
|
+
observer.idJob = resubscribeResponse.header.id_job;
|
|
83
|
+
removeMessageUpdateHook = this.hooks.hook(`frontgateConnection:response:${resubscriptionKey}`, (update) => {
|
|
84
84
|
if (update.Message.includes('Error') || update.Message.includes('PermissionDenied')) {
|
|
85
85
|
this.log(LogLevel.ERROR, `Unexpected response: ${update.Message}`);
|
|
86
86
|
const err = new ErrorResponse(update);
|
|
@@ -99,7 +99,7 @@ export const rawSubscriptions = () => {
|
|
|
99
99
|
}
|
|
100
100
|
this.log(LogLevel.INFO, `Unsubscribing from ${key}`);
|
|
101
101
|
const unsubscribeMsg = {
|
|
102
|
-
message:
|
|
102
|
+
message: resubscriptionCancelationRequest.getPtlMessage(),
|
|
103
103
|
callbackType: 'job',
|
|
104
104
|
callbackId: '',
|
|
105
105
|
};
|
|
@@ -11,11 +11,11 @@ export function getUuid2() {
|
|
|
11
11
|
export function getClientInformation() {
|
|
12
12
|
const navigator = getNavigator();
|
|
13
13
|
return {
|
|
14
|
-
userAgent: navigator.userAgent,
|
|
15
|
-
platform:
|
|
14
|
+
userAgent: navigator.userAgent ?? 'unknown',
|
|
15
|
+
platform: 'frontgate-js-sdk',
|
|
16
16
|
version: PACKAGE_JSON.version,
|
|
17
17
|
package: PACKAGE_JSON.package,
|
|
18
|
-
mobile: /Mobi/i.test(navigator.userAgent),
|
|
18
|
+
mobile: /Mobi/i.test(navigator.userAgent ?? 'unknown'),
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
export function getNavigator() {
|
|
@@ -25,10 +25,9 @@ export function getNavigator() {
|
|
|
25
25
|
if (typeof process !== 'undefined') {
|
|
26
26
|
return {
|
|
27
27
|
userAgent: `node.js/io.js, ${process.version}`,
|
|
28
|
-
platform: `${process.platform}_${process.arch}`,
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
|
-
return { userAgent: 'unknown'
|
|
30
|
+
return { userAgent: 'unknown' };
|
|
32
31
|
}
|
|
33
32
|
export const encodeSpanContext = (spanContext) => {
|
|
34
33
|
const buffer = [18, 20, 9];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_JSON = { version: '7.0.
|
|
1
|
+
export const PACKAGE_JSON = { version: '7.0.2', package: '@factset/frontgate-js-sdk' };
|
|
@@ -8,13 +8,13 @@ const httpProxyRequest = () => {
|
|
|
8
8
|
const mixinHTTPProxyRequestable = (Base) => {
|
|
9
9
|
return class extends Base {
|
|
10
10
|
async requestProxyEndpoint(method, path, body, options, timeOutInMs = this.defaultTimeoutInMs) {
|
|
11
|
-
const
|
|
11
|
+
const request = new message_1.HTTPProxyRequest(method, path, options);
|
|
12
12
|
if (body) {
|
|
13
|
-
|
|
13
|
+
request.setBody(body);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
request.header.setTimeout(timeOutInMs);
|
|
16
16
|
const msg = {
|
|
17
|
-
message:
|
|
17
|
+
message: request.getPtlMessage(),
|
|
18
18
|
callbackType: 'job',
|
|
19
19
|
callbackId: '',
|
|
20
20
|
};
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.logger = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
|
-
const logger = (
|
|
5
|
+
const logger = (loggerInstance, logLevel) => {
|
|
6
6
|
if (logLevel) {
|
|
7
|
-
|
|
7
|
+
loggerInstance.setLevel(logLevel);
|
|
8
8
|
}
|
|
9
9
|
const mixinLogger = (Base) => {
|
|
10
10
|
return class extends Base {
|
|
11
11
|
constructor(...args) {
|
|
12
12
|
super(...args);
|
|
13
|
-
this.logger =
|
|
13
|
+
this.logger = loggerInstance;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -129,8 +129,8 @@ const sessionAuth = (config, idApplication, username, password, deploymentStage)
|
|
|
129
129
|
_sharedSecret = new WeakMap(),
|
|
130
130
|
_clientSecret = new WeakMap(),
|
|
131
131
|
_instances = new WeakSet(),
|
|
132
|
-
_requestOtpAuthenticationTokenForSessionHandling = async function _requestOtpAuthenticationTokenForSessionHandling(lifetimeSeconds = message_1.AuthenticationTokenRequest.LIFETIME_SECONDS_MAXIMUM, idUser = authentication_1.ID_USER_AUTHENTICATED,
|
|
133
|
-
const request = new message_1.AuthenticationTokenRequest(lifetimeSeconds, idUser,
|
|
132
|
+
_requestOtpAuthenticationTokenForSessionHandling = async function _requestOtpAuthenticationTokenForSessionHandling(lifetimeSeconds = message_1.AuthenticationTokenRequest.LIFETIME_SECONDS_MAXIMUM, idUser = authentication_1.ID_USER_AUTHENTICATED, idApplicationOtp = authentication_1.ID_APP_AUTHENTICATED, timeOutInMs = this.defaultTimeoutInMs) {
|
|
133
|
+
const request = new message_1.AuthenticationTokenRequest(lifetimeSeconds, idUser, idApplicationOtp, timeOutInMs, true);
|
|
134
134
|
const msg = {
|
|
135
135
|
message: request.getPtlMessage(),
|
|
136
136
|
callbackType: 'job',
|
|
@@ -47,8 +47,8 @@ const tokenAuth = (token) => {
|
|
|
47
47
|
};
|
|
48
48
|
this.hooks.hook('frontgateConnection:connected', authFn);
|
|
49
49
|
}
|
|
50
|
-
set token(
|
|
51
|
-
__classPrivateFieldSet(this, _token,
|
|
50
|
+
set token(newToken) {
|
|
51
|
+
__classPrivateFieldSet(this, _token, newToken, "f");
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
_token = new WeakMap(),
|
|
@@ -25,8 +25,8 @@ const wsConnection = (conf) => {
|
|
|
25
25
|
const mixinConnectableWS = (Base) => {
|
|
26
26
|
var _instances, _ws, _wsConf, _wsStateInternal, _keepAliveTimer, _jobId, _idApplication, _idUser, _wsState_get, _message_buffer_size, _msgBuffer, _getDisconnectMessage, _getKeepAliveMessage, _sendMessage, _respondToMessage, _addJobIdToMessage, _prepareMessage, _createErrorMessage, _applyDefaultsToConfig, _a;
|
|
27
27
|
return _a = class extends Base {
|
|
28
|
-
set conf(
|
|
29
|
-
const internalConf = __classPrivateFieldGet(this, _instances, "m", _applyDefaultsToConfig).call(this,
|
|
28
|
+
set conf(newConf) {
|
|
29
|
+
const internalConf = __classPrivateFieldGet(this, _instances, "m", _applyDefaultsToConfig).call(this, newConf);
|
|
30
30
|
__classPrivateFieldSet(this, _message_buffer_size, internalConf.messageBufferSize, "f");
|
|
31
31
|
__classPrivateFieldSet(this, _wsConf, internalConf, "f");
|
|
32
32
|
}
|
|
@@ -318,16 +318,16 @@ const wsConnection = (conf) => {
|
|
|
318
318
|
details: error,
|
|
319
319
|
});
|
|
320
320
|
},
|
|
321
|
-
_applyDefaultsToConfig = function _applyDefaultsToConfig(
|
|
322
|
-
const maxIdleIntervalInS =
|
|
323
|
-
const maxIdleInterval =
|
|
321
|
+
_applyDefaultsToConfig = function _applyDefaultsToConfig(oldConf) {
|
|
322
|
+
const maxIdleIntervalInS = oldConf.maximumIdleIntervalInS ?? 60;
|
|
323
|
+
const maxIdleInterval = oldConf.maximumIdleInterval ?? maxIdleIntervalInS * 1000000;
|
|
324
324
|
return {
|
|
325
|
-
...
|
|
326
|
-
payloadContent:
|
|
325
|
+
...oldConf,
|
|
326
|
+
payloadContent: oldConf.payloadContent ?? 'foundation',
|
|
327
327
|
maximumIdleIntervalInS: maxIdleIntervalInS,
|
|
328
328
|
maximumIdleInterval: maxIdleInterval,
|
|
329
|
-
tls:
|
|
330
|
-
messageBufferSize:
|
|
329
|
+
tls: oldConf.tls ?? true,
|
|
330
|
+
messageBufferSize: oldConf.messageBufferSize ?? 512,
|
|
331
331
|
};
|
|
332
332
|
},
|
|
333
333
|
_a;
|
|
@@ -71,19 +71,19 @@ const rawSubscriptions = () => {
|
|
|
71
71
|
this.log(logger_1.LogLevel.INFO, `Resubscribing to ${key} due to reconnect`);
|
|
72
72
|
await this.hooks.callHook('frontgateConnection:sendMessage', subscriptionMsg);
|
|
73
73
|
const resubscribePromise = new Promise((res, rej) => {
|
|
74
|
-
this.hooks.hookOnce(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (
|
|
75
|
-
if (
|
|
76
|
-
const err = new message_1.ErrorResponse(
|
|
77
|
-
this.log(logger_1.LogLevel.ERROR, `Unexpected resp: ${
|
|
74
|
+
this.hooks.hookOnce(`frontgateConnection:response:${subscriptionMsg.callbackId}`, (resubscribeResponse) => {
|
|
75
|
+
if (resubscribeResponse.Message.includes('Error') || resubscribeResponse.Message.includes('PermissionDenied')) {
|
|
76
|
+
const err = new message_1.ErrorResponse(resubscribeResponse);
|
|
77
|
+
this.log(logger_1.LogLevel.ERROR, `Unexpected resp: ${resubscribeResponse.Message}`);
|
|
78
78
|
rej(err);
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
? new message_1.CancelSubscriptionRequest(
|
|
84
|
-
: new CancelationRequestConstructor(
|
|
85
|
-
observer.idJob =
|
|
86
|
-
removeMessageUpdateHook = this.hooks.hook(`frontgateConnection:response:${
|
|
81
|
+
const resubscriptionKey = subscriptionType === 'connection' ? `${resubscribeResponse.header.id_service}-${request.getPtlMessage().id_notation}` : resubscribeResponse.header.id_job;
|
|
82
|
+
const resubscriptionCancelationRequest = typeof CancelationRequestConstructor === 'undefined'
|
|
83
|
+
? new message_1.CancelSubscriptionRequest(resubscribeResponse.header.id_job)
|
|
84
|
+
: new CancelationRequestConstructor(resubscribeResponse.header.id_service, request.getPtlMessage().id_notation);
|
|
85
|
+
observer.idJob = resubscribeResponse.header.id_job;
|
|
86
|
+
removeMessageUpdateHook = this.hooks.hook(`frontgateConnection:response:${resubscriptionKey}`, (update) => {
|
|
87
87
|
if (update.Message.includes('Error') || update.Message.includes('PermissionDenied')) {
|
|
88
88
|
this.log(logger_1.LogLevel.ERROR, `Unexpected response: ${update.Message}`);
|
|
89
89
|
const err = new message_1.ErrorResponse(update);
|
|
@@ -102,7 +102,7 @@ const rawSubscriptions = () => {
|
|
|
102
102
|
}
|
|
103
103
|
this.log(logger_1.LogLevel.INFO, `Unsubscribing from ${key}`);
|
|
104
104
|
const unsubscribeMsg = {
|
|
105
|
-
message:
|
|
105
|
+
message: resubscriptionCancelationRequest.getPtlMessage(),
|
|
106
106
|
callbackType: 'job',
|
|
107
107
|
callbackId: '',
|
|
108
108
|
};
|
|
@@ -18,11 +18,11 @@ function getUuid2() {
|
|
|
18
18
|
function getClientInformation() {
|
|
19
19
|
const navigator = getNavigator();
|
|
20
20
|
return {
|
|
21
|
-
userAgent: navigator.userAgent,
|
|
22
|
-
platform:
|
|
21
|
+
userAgent: navigator.userAgent ?? 'unknown',
|
|
22
|
+
platform: 'frontgate-js-sdk',
|
|
23
23
|
version: version_1.PACKAGE_JSON.version,
|
|
24
24
|
package: version_1.PACKAGE_JSON.package,
|
|
25
|
-
mobile: /Mobi/i.test(navigator.userAgent),
|
|
25
|
+
mobile: /Mobi/i.test(navigator.userAgent ?? 'unknown'),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
function getNavigator() {
|
|
@@ -32,10 +32,9 @@ function getNavigator() {
|
|
|
32
32
|
if (typeof process !== 'undefined') {
|
|
33
33
|
return {
|
|
34
34
|
userAgent: `node.js/io.js, ${process.version}`,
|
|
35
|
-
platform: `${process.platform}_${process.arch}`,
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
|
-
return { userAgent: 'unknown'
|
|
37
|
+
return { userAgent: 'unknown' };
|
|
39
38
|
}
|
|
40
39
|
const encodeSpanContext = (spanContext) => {
|
|
41
40
|
const buffer = [18, 20, 9];
|
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: '7.0.
|
|
4
|
+
exports.PACKAGE_JSON = { version: '7.0.2', package: '@factset/frontgate-js-sdk' };
|
|
@@ -18,7 +18,7 @@ export declare const authTokenRequest: () => (<T extends AConstructorTypeOf<Fron
|
|
|
18
18
|
requestAuthenticationTokenForCookieTokenAuthentication(lifetimeSeconds?: number, idUser?: number, idApplication?: number, timeOutInMs?: number): Promise<CookieTokenAuthenticationFactors>;
|
|
19
19
|
logger: import("..").LoggerInterface | undefined;
|
|
20
20
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
21
|
-
readonly #defaultTimeoutInMs: number;
|
|
21
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
22
22
|
get defaultTimeoutInMs(): number;
|
|
23
23
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
24
24
|
};
|
|
@@ -13,10 +13,10 @@ export interface EndpointRequestMixinOptions {
|
|
|
13
13
|
export declare const endpointRequest: (config?: EndpointRequestMixinOptions) => (<T extends AConstructorTypeOf<FrontgateClient<usedHooksByEndpointRequest & DefaultFrontgateClientHooks>>>(Base: T) => {
|
|
14
14
|
new (...args: any[]): {
|
|
15
15
|
requestEndpoint<ResponseData = any>(method: HighLevelRequestMethod, path: string, data?: Record<string, unknown>, options?: HighLevelRequestOptions, timeOutInMs?: number): Promise<HighLevelRequestResult<ResponseData>>;
|
|
16
|
-
#hasNextChunk(msg: PtlMessage): boolean;
|
|
16
|
+
"__#private@#hasNextChunk"(msg: PtlMessage): boolean;
|
|
17
17
|
logger: import("..").LoggerInterface | undefined;
|
|
18
18
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
19
|
-
readonly #defaultTimeoutInMs: number;
|
|
19
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
20
20
|
get defaultTimeoutInMs(): number;
|
|
21
21
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
22
22
|
};
|
|
@@ -12,7 +12,7 @@ export declare const httpProxyRequest: () => (<T extends AConstructorTypeOf<Fron
|
|
|
12
12
|
requestProxyEndpoint(method: HTTPMethod, path: string, body?: HTTPProxyRequestBody, options?: HTTPProxyRequestOptions, timeOutInMs?: number): Promise<HTTPProxyRequestResult>;
|
|
13
13
|
logger: import("..").LoggerInterface | undefined;
|
|
14
14
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
15
|
-
readonly #defaultTimeoutInMs: number;
|
|
15
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
16
16
|
get defaultTimeoutInMs(): number;
|
|
17
17
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
18
18
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type AConstructorTypeOf } from '.';
|
|
2
2
|
import type { FrontgateClient } from '../FrontgateClient';
|
|
3
3
|
import type { LogLevel, LoggerInterface } from '../logger';
|
|
4
|
-
export declare const logger: (
|
|
4
|
+
export declare const logger: (loggerInstance: LoggerInterface, logLevel?: LogLevel) => (<T extends AConstructorTypeOf<FrontgateClient>>(Base: T) => {
|
|
5
5
|
new (...args: any[]): {
|
|
6
6
|
logger: LoggerInterface | undefined;
|
|
7
7
|
hooks: import("hookable").Hookable<import("../FrontgateClient").CalledHooksByBase, "base:log">;
|
|
8
|
-
readonly #defaultTimeoutInMs: number;
|
|
8
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
9
9
|
get defaultTimeoutInMs(): number;
|
|
10
10
|
log(level: LogLevel, ...args: unknown[]): void;
|
|
11
11
|
};
|
|
@@ -4,10 +4,10 @@ import { Compressor } from '../connection/util/Compressor';
|
|
|
4
4
|
export type usedHooksByMessageCompressor = CalledHooksByConnection;
|
|
5
5
|
export declare const messageCompressor: () => (<T extends AConstructorTypeOf<FrontgateClient<usedHooksByMessageCompressor & DefaultFrontgateClientHooks>>>(Base: T) => {
|
|
6
6
|
new (...args: any[]): {
|
|
7
|
-
readonly #compressor: Compressor;
|
|
7
|
+
readonly "__#private@#compressor": Compressor;
|
|
8
8
|
logger: import("..").LoggerInterface | undefined;
|
|
9
9
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
10
|
-
readonly #defaultTimeoutInMs: number;
|
|
10
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
11
11
|
get defaultTimeoutInMs(): number;
|
|
12
12
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
13
13
|
};
|
|
@@ -3,7 +3,7 @@ import { type AConstructorTypeOf, type CalledHooksByConnection } from '.';
|
|
|
3
3
|
import type { DefaultFrontgateClientHooks, FrontgateClient } from '../FrontgateClient';
|
|
4
4
|
export declare const openTelemetry: () => (<T extends AConstructorTypeOf<FrontgateClient<CalledHooksByConnection & DefaultFrontgateClientHooks>>>(Base: T) => {
|
|
5
5
|
new (...args: any[]): {
|
|
6
|
-
#createSpanHeader(tracing: SpanContext): {
|
|
6
|
+
"__#private@#createSpanHeader"(tracing: SpanContext): {
|
|
7
7
|
tracing: {
|
|
8
8
|
value: {
|
|
9
9
|
value: number[];
|
|
@@ -12,7 +12,7 @@ export declare const openTelemetry: () => (<T extends AConstructorTypeOf<Frontga
|
|
|
12
12
|
} | undefined;
|
|
13
13
|
logger: import("..").LoggerInterface | undefined;
|
|
14
14
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
15
|
-
readonly #defaultTimeoutInMs: number;
|
|
15
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
16
16
|
get defaultTimeoutInMs(): number;
|
|
17
17
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
18
18
|
};
|
|
@@ -10,7 +10,7 @@ export declare const pingRequests: () => (<T extends AConstructorTypeOf<Frontgat
|
|
|
10
10
|
ping(timeOutInMs?: number): Promise<PingResponse>;
|
|
11
11
|
logger: import("..").LoggerInterface | undefined;
|
|
12
12
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
13
|
-
readonly #defaultTimeoutInMs: number;
|
|
13
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
14
14
|
get defaultTimeoutInMs(): number;
|
|
15
15
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
16
16
|
};
|
|
@@ -10,12 +10,12 @@ export interface CalledHooksByReconnect {
|
|
|
10
10
|
}
|
|
11
11
|
export declare const reconnect: (reconnectDelaysInMs?: number[]) => (<T extends AConstructorTypeOf<FrontgateClient<usedHooksByReconnect & CalledHooksByReconnect & DefaultFrontgateClientHooks>>>(Base: T) => {
|
|
12
12
|
new (...args: any[]): {
|
|
13
|
-
#reconnectAttempts: number;
|
|
14
|
-
readonly #reconnectDelays: number[];
|
|
15
|
-
#reconnectTimer: NodeJS.Timeout | undefined;
|
|
13
|
+
"__#private@#reconnectAttempts": number;
|
|
14
|
+
readonly "__#private@#reconnectDelays": number[];
|
|
15
|
+
"__#private@#reconnectTimer": NodeJS.Timeout | undefined;
|
|
16
16
|
logger: import("../logger").LoggerInterface | undefined;
|
|
17
17
|
hooks: import("hookable").Hookable<CalledHooksByConnection & CalledHooksByReconnect & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & CalledHooksByReconnect & import("../FrontgateClient").CalledHooksByBase>>;
|
|
18
|
-
readonly #defaultTimeoutInMs: number;
|
|
18
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
19
19
|
get defaultTimeoutInMs(): number;
|
|
20
20
|
log(level: LogLevel, ...args: unknown[]): void;
|
|
21
21
|
};
|
|
@@ -9,7 +9,7 @@ export declare const remotelogger: (identifier?: number) => (<T extends AConstru
|
|
|
9
9
|
logRemotely(message: string): Promise<any>;
|
|
10
10
|
logger: import("..").LoggerInterface | undefined;
|
|
11
11
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
12
|
-
readonly #defaultTimeoutInMs: number;
|
|
12
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
13
13
|
get defaultTimeoutInMs(): number;
|
|
14
14
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
15
15
|
};
|
|
@@ -10,7 +10,7 @@ export declare const requests: () => (<T extends AConstructorTypeOf<FrontgateCli
|
|
|
10
10
|
request(request: AbstractMdg2Request, timeOutInMs?: number): Promise<Mdg2Response>;
|
|
11
11
|
logger: import("..").LoggerInterface | undefined;
|
|
12
12
|
hooks: import("hookable").Hookable<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & import("../FrontgateClient").CalledHooksByBase>>;
|
|
13
|
-
readonly #defaultTimeoutInMs: number;
|
|
13
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
14
14
|
get defaultTimeoutInMs(): number;
|
|
15
15
|
log(level: import("..").LogLevel, ...args: unknown[]): void;
|
|
16
16
|
};
|
|
@@ -8,15 +8,15 @@ import type { AuthenticationResponse } from '../../message/response/Authenticati
|
|
|
8
8
|
export type usedHooksByAppAuth = CalledHooksByConnection;
|
|
9
9
|
export declare const appAuth: (idApplication: number, idUser: number, clientCredentials: string, deploymentStage: DeploymentStage) => (<T extends AConstructorTypeOf<FrontgateClient<usedHooksByAppAuth & CalledHooksByAuth & DefaultFrontgateClientHooks>>>(Base: T) => {
|
|
10
10
|
new (...args: any[]): {
|
|
11
|
-
readonly #sharedSecret: Buffer;
|
|
12
|
-
readonly #clientSecret: Buffer;
|
|
13
|
-
#createAuthenticationRequest(): AuthenticationRequest;
|
|
14
|
-
#createConfigurationRequest(msg: AuthenticationResponse, conf: FrontgateClientWSConnectionConfig): ConfigurationRequest;
|
|
15
|
-
#createTransportLayerRequestHeaderConfigurationRequest(): PtlMessage;
|
|
16
|
-
#submit<M extends PtlMessage>(message: PtlMessage): Promise<M>;
|
|
11
|
+
readonly "__#private@#sharedSecret": Buffer;
|
|
12
|
+
readonly "__#private@#clientSecret": Buffer;
|
|
13
|
+
"__#private@#createAuthenticationRequest"(): AuthenticationRequest;
|
|
14
|
+
"__#private@#createConfigurationRequest"(msg: AuthenticationResponse, conf: FrontgateClientWSConnectionConfig): ConfigurationRequest;
|
|
15
|
+
"__#private@#createTransportLayerRequestHeaderConfigurationRequest"(): PtlMessage;
|
|
16
|
+
"__#private@#submit"<M extends PtlMessage>(message: PtlMessage): Promise<M>;
|
|
17
17
|
logger: import("../../logger").LoggerInterface | undefined;
|
|
18
18
|
hooks: import("hookable").Hookable<CalledHooksByConnection & CalledHooksByAuth & import("../../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & CalledHooksByAuth & import("../../FrontgateClient").CalledHooksByBase>>;
|
|
19
|
-
readonly #defaultTimeoutInMs: number;
|
|
19
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
20
20
|
get defaultTimeoutInMs(): number;
|
|
21
21
|
log(level: LogLevel, ...args: unknown[]): void;
|
|
22
22
|
};
|
|
@@ -6,7 +6,7 @@ export declare const cookieTokenAuth: (secondFactor: string) => (<T extends ACon
|
|
|
6
6
|
new (...args: any[]): {
|
|
7
7
|
logger: import("../../logger").LoggerInterface | undefined;
|
|
8
8
|
hooks: import("hookable").Hookable<CalledHooksByConnection & CalledHooksByAuth & import("../../FrontgateClient").CalledHooksByBase, import("hookable").HookKeys<CalledHooksByConnection & CalledHooksByAuth & import("../../FrontgateClient").CalledHooksByBase>>;
|
|
9
|
-
readonly #defaultTimeoutInMs: number;
|
|
9
|
+
readonly "__#private@#defaultTimeoutInMs": number;
|
|
10
10
|
get defaultTimeoutInMs(): number;
|
|
11
11
|
log(level: LogLevel, ...args: unknown[]): void;
|
|
12
12
|
};
|