@factset/frontgate-js-sdk 6.9.3 → 6.10.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 +18 -0
- package/dist/lib/esnext/FrontgateClient.js +16 -14
- package/dist/lib/esnext/FrontgateClient.js.map +1 -1
- package/dist/lib/esnext/mixins/AuthTokenRequestMixin.js +5 -0
- package/dist/lib/esnext/mixins/AuthTokenRequestMixin.js.map +1 -1
- package/dist/lib/esnext/mixins/PingMixin.js +31 -0
- package/dist/lib/esnext/mixins/PingMixin.js.map +1 -0
- package/dist/lib/esnext/mixins/index.js +1 -0
- package/dist/lib/esnext/mixins/index.js.map +1 -1
- package/dist/lib/esnext/mixins/subscription/EndpointSubscriptionMixin.js +2 -2
- package/dist/lib/esnext/mixins/subscription/EndpointSubscriptionMixin.js.map +1 -1
- package/dist/lib/esnext/version.js +1 -1
- package/dist/lib/esnext/version.js.map +1 -1
- package/dist/lib/node/FrontgateClient.js +16 -14
- package/dist/lib/node/FrontgateClient.js.map +1 -1
- package/dist/lib/node/mixins/AuthTokenRequestMixin.js +5 -0
- package/dist/lib/node/mixins/AuthTokenRequestMixin.js.map +1 -1
- package/dist/lib/node/mixins/PingMixin.js +35 -0
- package/dist/lib/node/mixins/PingMixin.js.map +1 -0
- package/dist/lib/node/mixins/index.js +1 -0
- package/dist/lib/node/mixins/index.js.map +1 -1
- package/dist/lib/node/mixins/subscription/EndpointSubscriptionMixin.js +2 -2
- package/dist/lib/node/mixins/subscription/EndpointSubscriptionMixin.js.map +1 -1
- package/dist/lib/node/version.js +1 -1
- package/dist/lib/node/version.js.map +1 -1
- package/dist/lib/types/mixins/AuthTokenRequestMixin.d.ts +3 -0
- package/dist/lib/types/mixins/PingMixin.d.ts +17 -0
- package/dist/lib/types/mixins/index.d.ts +2 -1
- package/dist/lib/umd/mdg2.client.min.umd.js +5 -5
- package/dist/lib/umd/mdg2.client.umd.js +51 -17
- package/package.json +1 -1
|
@@ -2298,7 +2298,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
2298
2298
|
function isSubscriptionLossMessage(response) {
|
|
2299
2299
|
return response.name === "Foundation::SubscriptionLossMessage";
|
|
2300
2300
|
}
|
|
2301
|
-
const PACKAGE_JSON = { version: "6.
|
|
2301
|
+
const PACKAGE_JSON = { version: "6.10.1", package: "@factset/frontgate-js-sdk" };
|
|
2302
2302
|
function getClientInformation() {
|
|
2303
2303
|
const navigator2 = getNavigator();
|
|
2304
2304
|
return {
|
|
@@ -3092,6 +3092,10 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
3092
3092
|
const rejectReason = `Request timeout reached (${timeOutInMs} ms) for ${msg.message.Message}`;
|
|
3093
3093
|
return useTimeout(timeOutInMs, rejectReason, promise);
|
|
3094
3094
|
}
|
|
3095
|
+
async requestAuthenticationTokenForCookieTokenAuthentication(lifetimeSeconds = 30, idUser = 0, idApplication = 0, timeOutInMs = this.defaultTimeoutInMs) {
|
|
3096
|
+
const token = await this.requestAuthenticationToken(lifetimeSeconds, idUser, idApplication, timeOutInMs);
|
|
3097
|
+
return new CookieTokenAuthenticationFactors(token.token);
|
|
3098
|
+
}
|
|
3095
3099
|
};
|
|
3096
3100
|
};
|
|
3097
3101
|
return createExtendedMixinFactory(mixinAuthTokenRequestable, {
|
|
@@ -3693,7 +3697,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
3693
3697
|
__privateGet(this, _subscriptions).delete(key);
|
|
3694
3698
|
}
|
|
3695
3699
|
this.log(LogLevel.INFO, `Unsubscribing from ${key}`);
|
|
3696
|
-
const cancelationRequest = new CancelSubscriptionRequest(
|
|
3700
|
+
const cancelationRequest = new CancelSubscriptionRequest(observer.idJob);
|
|
3697
3701
|
const unsubscribeMsg = {
|
|
3698
3702
|
message: cancelationRequest.getPtlMessage(),
|
|
3699
3703
|
callbackType: "job",
|
|
@@ -3726,7 +3730,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
3726
3730
|
__privateGet(this, _subscriptions).delete(key);
|
|
3727
3731
|
}
|
|
3728
3732
|
this.log(LogLevel.INFO, `Unsubscribing from ${key}`);
|
|
3729
|
-
const cancelationRequest = new CancelSubscriptionRequest(
|
|
3733
|
+
const cancelationRequest = new CancelSubscriptionRequest(observer.idJob);
|
|
3730
3734
|
const unsubscribeMsg = {
|
|
3731
3735
|
message: cancelationRequest.getPtlMessage(),
|
|
3732
3736
|
callbackType: "job",
|
|
@@ -5450,6 +5454,33 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
5450
5454
|
featureGroups: ["Misc"]
|
|
5451
5455
|
});
|
|
5452
5456
|
};
|
|
5457
|
+
const pingRequests = () => {
|
|
5458
|
+
const mixinPingable = (Base) => {
|
|
5459
|
+
return class extends Base {
|
|
5460
|
+
async ping(timeOutInMs = this.defaultTimeoutInMs) {
|
|
5461
|
+
const request = new PingRequest();
|
|
5462
|
+
const msg = {
|
|
5463
|
+
message: request.getPtlMessage(),
|
|
5464
|
+
callbackType: "response",
|
|
5465
|
+
callbackId: "PingResponse"
|
|
5466
|
+
};
|
|
5467
|
+
await this.hooks.callHook("frontgateConnection:sendMessage", msg);
|
|
5468
|
+
const promise = new Promise((resolve) => {
|
|
5469
|
+
this.hooks.hookOnce(`frontgateConnection:response:${msg.callbackId}`, (response) => {
|
|
5470
|
+
const pong = new PingResponse(response);
|
|
5471
|
+
resolve(pong);
|
|
5472
|
+
});
|
|
5473
|
+
});
|
|
5474
|
+
const rejectReason = `Request timeout reached (${timeOutInMs} ms) for ${msg.message.Message}`;
|
|
5475
|
+
return useTimeout(timeOutInMs, rejectReason, promise);
|
|
5476
|
+
}
|
|
5477
|
+
};
|
|
5478
|
+
};
|
|
5479
|
+
return createExtendedMixinFactory(mixinPingable, {
|
|
5480
|
+
featureName: "Pingable",
|
|
5481
|
+
featureGroups: ["Misc"]
|
|
5482
|
+
});
|
|
5483
|
+
};
|
|
5453
5484
|
const createExtendedMixinFactory = (mixinFactory, options) => {
|
|
5454
5485
|
const extendedMixinFactory = mixinFactory;
|
|
5455
5486
|
extendedMixinFactory.featureName = options.featureName;
|
|
@@ -8704,22 +8735,24 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
8704
8735
|
if (!featureName) {
|
|
8705
8736
|
throw new Error("Feature name is missing");
|
|
8706
8737
|
}
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8738
|
+
if (featureName !== "Custom") {
|
|
8739
|
+
__privateMethod(this, _FrontgateClientBuilder_instances, assertFeatureNotUsed_fn).call(this, featureName);
|
|
8740
|
+
__privateMethod(this, _FrontgateClientBuilder_instances, assertFeatureNotDisabled_fn).call(this, featureName);
|
|
8741
|
+
__privateGet(this, _alreadyUsedMethods).push(featureName);
|
|
8742
|
+
if (featureGroups && featureGroups.length > 0) {
|
|
8743
|
+
for (const featureGroup of featureGroups) {
|
|
8744
|
+
__privateMethod(this, _FrontgateClientBuilder_instances, assertGroupNotDisabled_fn).call(this, featureGroup);
|
|
8745
|
+
}
|
|
8713
8746
|
}
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8747
|
+
if (disabledFeatures && disabledFeatures.length > 0) {
|
|
8748
|
+
for (const disabledFeature of disabledFeatures) {
|
|
8749
|
+
__privateMethod(this, _FrontgateClientBuilder_instances, addDisabledFeature_fn).call(this, featureName, disabledFeature);
|
|
8750
|
+
}
|
|
8718
8751
|
}
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8752
|
+
if (disabledFeatureGroups && disabledFeatureGroups.length > 0) {
|
|
8753
|
+
for (const disabledFeatureGroup of disabledFeatureGroups) {
|
|
8754
|
+
__privateMethod(this, _FrontgateClientBuilder_instances, addDisabledGroup_fn).call(this, featureName, disabledFeatureGroup);
|
|
8755
|
+
}
|
|
8723
8756
|
}
|
|
8724
8757
|
}
|
|
8725
8758
|
const MixedConstructor = mixinFactory(__privateGet(this, _clientConstructor));
|
|
@@ -8854,6 +8887,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
8854
8887
|
exports2.objectFromFetchHeaders = objectFromFetchHeaders;
|
|
8855
8888
|
exports2.openTelemetry = openTelemetry;
|
|
8856
8889
|
exports2.parseConnectionConfiguration = parseConnectionConfiguration;
|
|
8890
|
+
exports2.pingRequests = pingRequests;
|
|
8857
8891
|
exports2.rawSubscriptions = rawSubscriptions;
|
|
8858
8892
|
exports2.reconnect = reconnect;
|
|
8859
8893
|
exports2.requests = requests;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factset/frontgate-js-sdk",
|
|
3
3
|
"author": "Factset GmbH",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.10.1",
|
|
5
5
|
"description": "Typescript based client to request and subscribe values from mdg2 (frontgate)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "./dist/lib/node/index.js",
|