@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
package/CHANGELOG.md
CHANGED
|
@@ -1,43 +1,100 @@
|
|
|
1
|
-
## <small>
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* fix(
|
|
7
|
-
* fix(
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* chore(
|
|
15
|
-
* chore(
|
|
16
|
-
* chore(
|
|
17
|
-
* chore(
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
* Publish [
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
1
|
+
## <small>7.0.1 (2025-09-03)</small>
|
|
2
|
+
|
|
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
|
+
* chore(changelog): refresh changelog [a0a3d56]
|
|
15
|
+
* chore(deps): lock file maintenance [c2a734e]
|
|
16
|
+
* chore(deps): replace dependency npm-run-all with npm-run-all2 ^5.0.0 [59bf6a4]
|
|
17
|
+
* chore(deps): update [a31270f]
|
|
18
|
+
* chore(deps): update actions/checkout action to v4.3.0 [be83320]
|
|
19
|
+
* chore(deps): update all deps [7853d65]
|
|
20
|
+
* chore(deps): update dependency @fds/lint-standards to v27 [53276b4]
|
|
21
|
+
* chore(deps): update dependency cross-env to v10 [4a6872f]
|
|
22
|
+
* chore(deps): update dependency node to v22 [caa604a]
|
|
23
|
+
* chore(deps): update sonarsource/sonarqube-scan-action action to v5.3.0 [a87948c]
|
|
24
|
+
* chore(deps): update sonarsource/sonarqube-scan-action action to v5.3.1 [7e7e3fe]
|
|
25
|
+
* chore(deps): update yarn to v4.9.3 [95abd4a]
|
|
26
|
+
* chore(deps): update yarn to v4.9.4 [9f5af73]
|
|
27
|
+
* chore(docs): add release documentation [ee22da6]
|
|
28
|
+
* chore(package): align parallelization to drop dependency [3d5e19f]
|
|
29
|
+
* chore(repo): update deps [bf03d29]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## 7.0.0 (2025-07-07)
|
|
34
|
+
|
|
35
|
+
* Publish [2880845]
|
|
36
|
+
* chore(client): remove dead code [1fcd88f]
|
|
37
|
+
* chore(client): remove dead code [11de6ee]
|
|
38
|
+
* chore(client): remove dead code [c77b349]
|
|
39
|
+
* chore(client): remove deprecated [9353856]
|
|
40
|
+
* chore(client): remove even more dead code [8425910]
|
|
41
|
+
* chore(deps): remove manual dependency on polyfills [62d86a8]
|
|
42
|
+
* chore(deps): remove unused rxjs [caadba8]
|
|
43
|
+
* chore(deps): remove unused vite-node and vite-plugin-node [8860d4b]
|
|
44
|
+
* chore(deps): update dependency vite-plugin-node-polyfills to ^0.24.0 [2189e1e]
|
|
45
|
+
* chore(tests): remove dead code [de2ae9a]
|
|
46
|
+
* fix(build): use mts vite config [ce1dc6e]
|
|
47
|
+
* fix(reconnect): fix max delay [78aaca3]
|
|
48
|
+
* fix(release): checkout branch directly [0ac64e8]
|
|
49
|
+
* fix(websocket): use correct state after error [50ba15f]
|
|
50
|
+
* feat(release): rebase to GH for branches [c811483]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## <small>6.10.2 (2025-07-01)</small>
|
|
55
|
+
|
|
56
|
+
* fix(client): update ptl documentation url [801bcd4]
|
|
57
|
+
* fix(connection): only trigger disconenct after beeing authenticated [f3c06d6]
|
|
58
|
+
* fix(deps): update dependency @fds/winston-clp to v9 [73f8009]
|
|
59
|
+
* fix(deps): update dependency express to v5 [717ef31]
|
|
60
|
+
* fix(deps): update dependency helmet to v8 [1fa90ef]
|
|
61
|
+
* fix(release): use correct branch [a405cb2]
|
|
62
|
+
* fix(renovate): use factset default config [c1343b9]
|
|
63
|
+
* chore(deps): lock file maintenance [dcdae24]
|
|
64
|
+
* chore(deps): lock file maintenance [f73f3f1]
|
|
65
|
+
* chore(deps): pin dependencies [237b449]
|
|
66
|
+
* chore(deps): update actions/checkout action to v3.6.0 [0eb1cd8]
|
|
67
|
+
* chore(deps): update actions/checkout action to v4.2.2 [c0fc4c6]
|
|
68
|
+
* chore(deps): update actions/setup-node action to v3.9.1 [174fd1a]
|
|
69
|
+
* chore(deps): update actions/setup-node action to v4.4.0 [9648a11]
|
|
70
|
+
* chore(deps): update actions/setup-python action to v5.6.0 [277d619]
|
|
71
|
+
* chore(deps): update dependency @fds/lint-standards to v26 [144ef01]
|
|
72
|
+
* chore(deps): update dependency conventional-changelog-cli to v5 [2856084]
|
|
73
|
+
* chore(deps): update dependency cross-spawn to v7 [12dd214]
|
|
74
|
+
* chore(deps): update dependency dotenv to v17 [d30ad55]
|
|
75
|
+
* chore(deps): update dependency happy-dom to v18 [eeca17a]
|
|
76
|
+
* chore(deps): update dependency nx to v21 [bd94d71]
|
|
77
|
+
* chore(deps): update dependency rimraf to v6 [b8c7b9e]
|
|
78
|
+
* chore(deps): update dependency typedoc to ^0.28.0 [fc60263]
|
|
79
|
+
* chore(deps): update dependency vite to v7 [ff16a47]
|
|
80
|
+
* chore(deps): update dependency vite-tsconfig-paths to v5 [307fd61]
|
|
81
|
+
* chore(deps): update factset/waffle-actions action to v2.5.2 [617d450]
|
|
82
|
+
* chore(deps): update peaceiris/actions-gh-pages action to v3.9.3 [2070e37]
|
|
83
|
+
* chore(deps): update peaceiris/actions-gh-pages action to v4 [6569746]
|
|
84
|
+
* chore(deps): update softprops/action-gh-release action to v2 [cba8093]
|
|
85
|
+
* chore(deps): update sonarsource/sonarqube-scan-action action to v5 [5876377]
|
|
86
|
+
* chore(deps): update yarn to v4.9.2 [750d175]
|
|
87
|
+
* feat(auth): remove depracted auth interfaces [01da6bd]
|
|
88
|
+
* feat(auth): update tests [df784fa]
|
|
89
|
+
* feat(client): remove CookieTokenAuthentication and TokenAuthentication in favour of the mixins [f006093]
|
|
90
|
+
* feat(client): remove Mdg2Client and all all dependant modules [1b62053]
|
|
91
|
+
* feat(client): remove unused functions [ace84d9]
|
|
92
|
+
* feat(connection): remove unused connection [0bf43c9]
|
|
93
|
+
* feat(demo-node): move node demo to builder client [de02782]
|
|
94
|
+
* feat(demo): remove "old" demo [5963477]
|
|
95
|
+
* feat(release): add multi version support [3596ec0]
|
|
96
|
+
* feat(remote-logger): add remote logger plugin [62a3cb6]
|
|
97
|
+
* refactor(vitest): extract configuration into mts file [1a89563]
|
|
41
98
|
|
|
42
99
|
|
|
43
100
|
|
|
@@ -16,9 +16,6 @@ export class FrontgateClient {
|
|
|
16
16
|
get defaultTimeoutInMs() {
|
|
17
17
|
return __classPrivateFieldGet(this, _FrontgateClient_defaultTimeoutInMs, "f");
|
|
18
18
|
}
|
|
19
|
-
set defaultTimeoutInMs(value) {
|
|
20
|
-
__classPrivateFieldSet(this, _FrontgateClient_defaultTimeoutInMs, value, "f");
|
|
21
|
-
}
|
|
22
19
|
constructor(conf) {
|
|
23
20
|
this.hooks = createHooks();
|
|
24
21
|
_FrontgateClient_defaultTimeoutInMs.set(this, 10000);
|
|
@@ -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 const ID_APP_AUTHENTICATED = -2;
|
|
3
|
+
export const ID_USER_AUTHENTICATED = -2;
|
|
4
|
+
export const ID_USER_NONE = -1;
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
export class ServiceUnavailableError extends Error {
|
|
2
|
-
constructor(message = 'Service Unavailable', error) {
|
|
3
|
-
super(message, { cause: error });
|
|
4
|
-
this.name = 'ServiceUnavailableError';
|
|
5
|
-
this.code = 503;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export class InternalServerError extends Error {
|
|
9
|
-
constructor(message = 'Internal Server Error', error) {
|
|
10
|
-
super(message, { cause: error });
|
|
11
|
-
this.name = 'InternalServerError';
|
|
12
|
-
this.code = 500;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
1
|
export class TimeoutError extends Error {
|
|
16
2
|
constructor(message = 'Timeout', error) {
|
|
17
3
|
super(message, { cause: error });
|
|
@@ -19,24 +5,3 @@ export class TimeoutError extends Error {
|
|
|
19
5
|
this.code = 408;
|
|
20
6
|
}
|
|
21
7
|
}
|
|
22
|
-
export class UnauthorizedError extends Error {
|
|
23
|
-
constructor(message = 'Unauthorized', error) {
|
|
24
|
-
super(message, { cause: error });
|
|
25
|
-
this.name = 'UnauthorizedError';
|
|
26
|
-
this.code = 401;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export class BadRequestError extends Error {
|
|
30
|
-
constructor(message = 'Bad Request', error) {
|
|
31
|
-
super(message, { cause: error });
|
|
32
|
-
this.name = 'BadRequestError';
|
|
33
|
-
this.code = 400;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export class ResponseError extends Error {
|
|
37
|
-
constructor(message, response) {
|
|
38
|
-
super(message, { cause: response });
|
|
39
|
-
this.name = 'ResponseError';
|
|
40
|
-
this.response = response;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import merge from 'deepmerge';
|
|
2
|
-
import { ResponseError } from './errors';
|
|
3
2
|
export function isObject(obj) {
|
|
4
3
|
return !!obj && typeof obj === 'object';
|
|
5
4
|
}
|
|
@@ -9,89 +8,6 @@ export function deepmerge(...args) {
|
|
|
9
8
|
arrayMerge: (destinationArray, sourceArray) => sourceArray,
|
|
10
9
|
});
|
|
11
10
|
}
|
|
12
|
-
export function provideAsArray(subject) {
|
|
13
|
-
return subject instanceof Array ? subject : [subject];
|
|
14
|
-
}
|
|
15
|
-
export function unsignedArrayToBase64(data) {
|
|
16
|
-
const b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
17
|
-
const res = [];
|
|
18
|
-
let o1;
|
|
19
|
-
let o2;
|
|
20
|
-
let o3;
|
|
21
|
-
let h1;
|
|
22
|
-
let h2;
|
|
23
|
-
let h3;
|
|
24
|
-
let h4;
|
|
25
|
-
let bits;
|
|
26
|
-
let i = 0;
|
|
27
|
-
do {
|
|
28
|
-
o1 = data[i];
|
|
29
|
-
i++;
|
|
30
|
-
o2 = data[i];
|
|
31
|
-
i++;
|
|
32
|
-
o3 = data[i];
|
|
33
|
-
i++;
|
|
34
|
-
bits = (o1 << 16) | (o2 << 8) | o3;
|
|
35
|
-
h1 = (bits >> 18) & 0x3f;
|
|
36
|
-
h2 = (bits >> 12) & 0x3f;
|
|
37
|
-
h3 = (bits >> 6) & 0x3f;
|
|
38
|
-
h4 = bits & 0x3f;
|
|
39
|
-
res.push(b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4));
|
|
40
|
-
} while (i < data.length);
|
|
41
|
-
const enc = res.join('');
|
|
42
|
-
const r = data.length % 3;
|
|
43
|
-
return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
|
|
44
|
-
}
|
|
45
11
|
export function toUrlBase64(strInBase64) {
|
|
46
12
|
return strInBase64.replace(/[=]/g, '').replace(/\//g, '_').replace(/\+/g, '-');
|
|
47
13
|
}
|
|
48
|
-
export function isBase64Url(tokenStr) {
|
|
49
|
-
const base64UrlRegex = /^[A-Za-z0-9_-]*$/;
|
|
50
|
-
return base64UrlRegex.test(tokenStr);
|
|
51
|
-
}
|
|
52
|
-
export function base64UrlToBase64(base64Url) {
|
|
53
|
-
let base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
54
|
-
while (base64.length % 4 !== 0) {
|
|
55
|
-
base64 += '=';
|
|
56
|
-
}
|
|
57
|
-
switch (base64.length % 4) {
|
|
58
|
-
case 0:
|
|
59
|
-
break;
|
|
60
|
-
case 1:
|
|
61
|
-
base64 += '===';
|
|
62
|
-
break;
|
|
63
|
-
case 2:
|
|
64
|
-
base64 += '==';
|
|
65
|
-
break;
|
|
66
|
-
case 3:
|
|
67
|
-
base64 += '=';
|
|
68
|
-
break;
|
|
69
|
-
default:
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
return base64;
|
|
73
|
-
}
|
|
74
|
-
export const errorHandler = (response) => {
|
|
75
|
-
let message = 'Unknown';
|
|
76
|
-
let code = 500;
|
|
77
|
-
if (response.name === 'Foundation::PermissionDeniedResponse') {
|
|
78
|
-
code = 403;
|
|
79
|
-
message = `Permission Denied. Job ID: ${response.jobId} failed with status code ${code} `;
|
|
80
|
-
}
|
|
81
|
-
else if (response.name === 'Foundation::ErrorResponse' && response.reason) {
|
|
82
|
-
const isJson = response.reason.startsWith('{');
|
|
83
|
-
const reason = isJson ? JSON.parse(response.reason) || {} : response.reason;
|
|
84
|
-
if (isJson && reason.errors?.[0].details) {
|
|
85
|
-
message = reason.errors[0].details;
|
|
86
|
-
}
|
|
87
|
-
else if (typeof reason === 'string') {
|
|
88
|
-
message = reason;
|
|
89
|
-
}
|
|
90
|
-
code = parseInt(reason?.meta?.status?.code ?? response.msg.reason?.value ?? 500, 10);
|
|
91
|
-
}
|
|
92
|
-
return new ResponseError(`${message} (${code})`, response);
|
|
93
|
-
};
|
|
94
|
-
export const delay = async (delayInMs) => new Promise((resolve) => {
|
|
95
|
-
setTimeout(resolve, delayInMs);
|
|
96
|
-
});
|
|
97
|
-
export const isNodeEnvironment = () => typeof window === 'undefined';
|
|
@@ -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,20 @@
|
|
|
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 var ConnectionState;
|
|
3
|
+
(function (ConnectionState) {
|
|
4
|
+
ConnectionState[ConnectionState["DISCONNECTED"] = 0] = "DISCONNECTED";
|
|
5
|
+
ConnectionState[ConnectionState["CONNECTING"] = 1] = "CONNECTING";
|
|
6
|
+
ConnectionState[ConnectionState["AUTHENTICATED"] = 2] = "AUTHENTICATED";
|
|
7
|
+
ConnectionState[ConnectionState["RECONNECTING"] = 3] = "RECONNECTING";
|
|
8
|
+
})(ConnectionState || (ConnectionState = {}));
|
|
9
|
+
export var DeploymentStage;
|
|
10
|
+
(function (DeploymentStage) {
|
|
11
|
+
DeploymentStage[DeploymentStage["production"] = 40] = "production";
|
|
12
|
+
DeploymentStage[DeploymentStage["preproduction"] = 35] = "preproduction";
|
|
13
|
+
DeploymentStage[DeploymentStage["show"] = 30] = "show";
|
|
14
|
+
DeploymentStage[DeploymentStage["testing"] = 20] = "testing";
|
|
15
|
+
})(DeploymentStage || (DeploymentStage = {}));
|
|
16
|
+
export var DefaultHosts;
|
|
17
|
+
(function (DefaultHosts) {
|
|
18
|
+
DefaultHosts["production"] = "frontgate-eu.factsetdigitalsolutions.com";
|
|
19
|
+
DefaultHosts["show"] = "frontgate-eu.show.factsetdigitalsolutions.com";
|
|
20
|
+
})(DefaultHosts || (DefaultHosts = {}));
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { CookieTokenAuthentication, TokenAuthentication } from '../../authentication';
|
|
2
|
-
import { FrontgateWSConnection } from '../FrontgateWSConnection';
|
|
3
|
-
export var FetchConnectionConfigurationResponseHeaders;
|
|
4
|
-
(function (FetchConnectionConfigurationResponseHeaders) {
|
|
5
|
-
FetchConnectionConfigurationResponseHeaders["FRONTGATE_HOST"] = "frontgate-host";
|
|
6
|
-
FetchConnectionConfigurationResponseHeaders["FRONTGATE_PATH_PREFIX"] = "frontgate-path-prefix";
|
|
7
|
-
FetchConnectionConfigurationResponseHeaders["FRONTGATE_SPLIT_AUTHENTICATION_TOKEN_SECOND_FACTOR"] = "frontgate-split-authentication-token-second-factor";
|
|
8
|
-
FetchConnectionConfigurationResponseHeaders["FRONTGATE_AUTHENTICATION_TYPE"] = "frontgate-authentication-type";
|
|
9
|
-
FetchConnectionConfigurationResponseHeaders["FRONTGATE_AUTHENTICATION_TOKEN"] = "frontgate-authentication-token";
|
|
10
|
-
FetchConnectionConfigurationResponseHeaders["FRONTGATE_WEBSOCKET_PROTOCOL"] = "frontgate-websocket-protocol";
|
|
11
|
-
})(FetchConnectionConfigurationResponseHeaders || (FetchConnectionConfigurationResponseHeaders = {}));
|
|
12
1
|
export function getBytesFromBuffer(buf) {
|
|
13
2
|
const res = [];
|
|
14
3
|
if (buf) {
|
|
@@ -18,48 +7,3 @@ export function getBytesFromBuffer(buf) {
|
|
|
18
7
|
}
|
|
19
8
|
return res;
|
|
20
9
|
}
|
|
21
|
-
export function parseConnectionConfiguration(headers) {
|
|
22
|
-
const config = {};
|
|
23
|
-
const providedHeaders = Object.keys(headers);
|
|
24
|
-
[
|
|
25
|
-
FetchConnectionConfigurationResponseHeaders.FRONTGATE_HOST,
|
|
26
|
-
FetchConnectionConfigurationResponseHeaders.FRONTGATE_PATH_PREFIX,
|
|
27
|
-
FetchConnectionConfigurationResponseHeaders.FRONTGATE_SPLIT_AUTHENTICATION_TOKEN_SECOND_FACTOR,
|
|
28
|
-
FetchConnectionConfigurationResponseHeaders.FRONTGATE_AUTHENTICATION_TYPE,
|
|
29
|
-
FetchConnectionConfigurationResponseHeaders.FRONTGATE_AUTHENTICATION_TOKEN,
|
|
30
|
-
FetchConnectionConfigurationResponseHeaders.FRONTGATE_WEBSOCKET_PROTOCOL,
|
|
31
|
-
].forEach((key) => {
|
|
32
|
-
if (providedHeaders.includes(key)) {
|
|
33
|
-
config[key.replace(/-([a-z])/g, (g) => g[1].toUpperCase())] = headers[key];
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return config;
|
|
37
|
-
}
|
|
38
|
-
export function objectFromFetchHeaders(providedHeaders) {
|
|
39
|
-
const obj = {};
|
|
40
|
-
providedHeaders.forEach((value, key) => {
|
|
41
|
-
obj[key] = value;
|
|
42
|
-
});
|
|
43
|
-
return obj;
|
|
44
|
-
}
|
|
45
|
-
export async function fetchConnectionConfiguration(input, init) {
|
|
46
|
-
const response = await fetch(input, init);
|
|
47
|
-
const headersAsObject = objectFromFetchHeaders(response.headers);
|
|
48
|
-
const config = parseConnectionConfiguration(headersAsObject);
|
|
49
|
-
return { config, response };
|
|
50
|
-
}
|
|
51
|
-
export function createConnection(options = {}, input, init) {
|
|
52
|
-
const auth = options.frontgateAuthenticationType === 'token' ? new TokenAuthentication(options.frontgateAuthenticationToken) : new CookieTokenAuthentication();
|
|
53
|
-
auth.setFetchConfiguration(input, init);
|
|
54
|
-
return new FrontgateWSConnection(auth, options);
|
|
55
|
-
}
|
|
56
|
-
export function setConnectionConfiguration({ frontgateHost, frontgateWebsocketProtocol }) {
|
|
57
|
-
localStorage.setItem('mdg2config', JSON.stringify({ frontgateHost, frontgateWebsocketProtocol }));
|
|
58
|
-
}
|
|
59
|
-
export function getConnectionConfiguration() {
|
|
60
|
-
const item = localStorage.getItem('mdg2config');
|
|
61
|
-
if (!item) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
return JSON.parse(item);
|
|
65
|
-
}
|
package/dist/lib/esnext/index.js
CHANGED
|
@@ -5,6 +5,5 @@ export * from './common/interfaces';
|
|
|
5
5
|
export * from './common/types';
|
|
6
6
|
export * from './logger';
|
|
7
7
|
export * from './mixins';
|
|
8
|
-
export { Mdg2Client } from './Mdg2Client';
|
|
9
8
|
export { FrontgateClientBuilder, FrontgateClient } from './FrontgateClient';
|
|
10
9
|
export { useTimeout } from './util/functions';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ID_APP_AUTHENTICATED, ID_USER_AUTHENTICATED } from '../../../../authentication
|
|
1
|
+
import { ID_APP_AUTHENTICATED, ID_USER_AUTHENTICATED } from '../../../../authentication';
|
|
2
2
|
export const createNotationSearchRequest = () => ({
|
|
3
3
|
Message: 'NotationSearchRequest',
|
|
4
4
|
Version: 13,
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
export * from './AuthenticationTokenResponse';
|
|
2
|
-
export * from './AuthenticationByTokenResponse';
|
|
3
|
-
export * from './CancelSubscriptionResponse';
|
|
4
2
|
export * from './ConfigurationResponse';
|
|
5
3
|
export * from './DisconnectionMessage';
|
|
6
4
|
export * from './ErrorResponse';
|
|
7
5
|
export * from './HighLevelResponse';
|
|
8
6
|
export * from './HTTPProxyResponse';
|
|
9
|
-
export * from './LoadNotificationMessage';
|
|
10
7
|
export * from './Mdg2Response';
|
|
11
|
-
export * from './PermissionDeniedResponse';
|
|
12
8
|
export * from './PingResponse';
|
|
13
|
-
export * from './RejectResponse';
|
|
@@ -5,7 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
import { createExtendedMixinFactory } from '.';
|
|
7
7
|
import { HighLevelRequest, HighLevelResponse } from '../message';
|
|
8
|
-
import { FLAG_HAS_NEXT_CHUNK } from '../message
|
|
8
|
+
import { FLAG_HAS_NEXT_CHUNK } from '../message';
|
|
9
9
|
import { useTimeout } from '../util/functions';
|
|
10
10
|
export const endpointRequest = (config) => {
|
|
11
11
|
const mixinEndpointRequestable = (Base) => {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createExtendedMixinFactory } from '.';
|
|
2
|
+
import { RawRequest } from '../message';
|
|
3
|
+
export const remotelogger = (identifier) => {
|
|
4
|
+
const mixinRemoteLogger = (Base) => {
|
|
5
|
+
return class extends Base {
|
|
6
|
+
async logRemotely(message) {
|
|
7
|
+
const request = new RawRequest({
|
|
8
|
+
Message: 'LogMessage',
|
|
9
|
+
timestamp: { microseconds: Date.now() * 1000 },
|
|
10
|
+
uuid: { id_1: identifier ?? 0, id_2: 0 },
|
|
11
|
+
level: { value: 4 },
|
|
12
|
+
area: 61,
|
|
13
|
+
Version: 1,
|
|
14
|
+
message,
|
|
15
|
+
});
|
|
16
|
+
const msg = {
|
|
17
|
+
message: request.getPtlMessage(),
|
|
18
|
+
callbackType: 'job',
|
|
19
|
+
callbackId: '',
|
|
20
|
+
};
|
|
21
|
+
return this.hooks.callHook('frontgateConnection:sendMessage', msg);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
return createExtendedMixinFactory(mixinRemoteLogger, {
|
|
26
|
+
featureName: 'RemoteLogger',
|
|
27
|
+
featureGroups: ['Misc'],
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -9,29 +9,97 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
import { createExtendedMixinFactory
|
|
13
|
-
import {
|
|
12
|
+
import { createExtendedMixinFactory } from '../.';
|
|
13
|
+
import { SecretGenerator, AuthenticationRequest, ConfigurationRequest } from '../../compat';
|
|
14
|
+
import { getBytesFromBuffer } from '../../connection';
|
|
15
|
+
import { LogLevel } from '../../logger';
|
|
16
|
+
import { randomBytes } from 'crypto';
|
|
14
17
|
export const appAuth = (idApplication, idUser, clientCredentials, deploymentStage) => {
|
|
15
18
|
const mixinAppAuth = (Base) => {
|
|
16
|
-
var
|
|
19
|
+
var _instances, _sharedSecret, _clientSecret, _createAuthenticationRequest, _createConfigurationRequest, _createTransportLayerRequestHeaderConfigurationRequest, _submit, _a;
|
|
17
20
|
return _a = class extends Base {
|
|
18
21
|
constructor(...args) {
|
|
19
22
|
super(...args);
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
_instances.add(this);
|
|
24
|
+
_sharedSecret.set(this, void 0);
|
|
25
|
+
_clientSecret.set(this, void 0);
|
|
26
|
+
if (typeof clientCredentials !== 'string') {
|
|
27
|
+
throw new Error('clientCredentials not provided or not a string. Client credentials must have the form "{server_secret}-{shared_secret}-{client_secret}".');
|
|
28
|
+
}
|
|
29
|
+
const secrets = clientCredentials.split('-');
|
|
30
|
+
if (secrets.length !== 3) {
|
|
31
|
+
throw new Error('Invalid clientCredentials. Client credentials must have the form "{server_secret}-{shared_secret}-{client_secret}".');
|
|
32
|
+
}
|
|
33
|
+
if (secrets[0] === '*') {
|
|
34
|
+
throw new Error('Invalid clientCredentials. Client credentials first part must be a hashed server secret.');
|
|
35
|
+
}
|
|
36
|
+
__classPrivateFieldSet(this, _sharedSecret, Buffer.from(secrets[1], 'base64'), "f");
|
|
37
|
+
__classPrivateFieldSet(this, _clientSecret, Buffer.from(secrets[2], 'base64'), "f");
|
|
22
38
|
this.hooks.hook('frontgateConnection:connected', async (conf) => {
|
|
23
39
|
void this.hooks.callHook('frontgateConnection:setIdApp', idApplication);
|
|
24
40
|
void this.hooks.callHook('frontgateConnection:setIdUser', idUser);
|
|
25
|
-
await __classPrivateFieldGet(this,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
maximum_idle_interval: conf.maximumIdleInterval,
|
|
29
|
-
}, this));
|
|
41
|
+
const authResponse = await __classPrivateFieldGet(this, _instances, "m", _submit).call(this, __classPrivateFieldGet(this, _instances, "m", _createAuthenticationRequest).call(this).toJson());
|
|
42
|
+
await __classPrivateFieldGet(this, _instances, "m", _submit).call(this, __classPrivateFieldGet(this, _instances, "m", _createConfigurationRequest).call(this, authResponse, conf).toJson());
|
|
43
|
+
await __classPrivateFieldGet(this, _instances, "m", _submit).call(this, __classPrivateFieldGet(this, _instances, "m", _createTransportLayerRequestHeaderConfigurationRequest).call(this));
|
|
30
44
|
await this.hooks.callHook('frontgateConnection:authenticated');
|
|
31
45
|
});
|
|
32
46
|
}
|
|
33
47
|
},
|
|
34
|
-
|
|
48
|
+
_sharedSecret = new WeakMap(),
|
|
49
|
+
_clientSecret = new WeakMap(),
|
|
50
|
+
_instances = new WeakSet(),
|
|
51
|
+
_createAuthenticationRequest = function _createAuthenticationRequest() {
|
|
52
|
+
const salt = randomBytes(16);
|
|
53
|
+
const options = {
|
|
54
|
+
idApplication,
|
|
55
|
+
salt: getBytesFromBuffer(salt),
|
|
56
|
+
challenge: getBytesFromBuffer(randomBytes(16)),
|
|
57
|
+
encryptedSecrets: [{ encrypted_secret: SecretGenerator.createEncryptedSecret(salt, __classPrivateFieldGet(this, _sharedSecret, "f"), __classPrivateFieldGet(this, _clientSecret, "f")) }],
|
|
58
|
+
};
|
|
59
|
+
return new AuthenticationRequest(options);
|
|
60
|
+
},
|
|
61
|
+
_createConfigurationRequest = function _createConfigurationRequest(msg, conf) {
|
|
62
|
+
const expectedMessage = 'Foundation::AuthenticationResponse';
|
|
63
|
+
if (msg.Message !== expectedMessage) {
|
|
64
|
+
throw new Error(`Expected message "${expectedMessage}" but received "${msg.Message}"`);
|
|
65
|
+
}
|
|
66
|
+
const { challenge } = msg.challenge;
|
|
67
|
+
const options = {
|
|
68
|
+
shared_secret: __classPrivateFieldGet(this, _sharedSecret, "f"),
|
|
69
|
+
payload_content: conf.payloadContent,
|
|
70
|
+
deployment_stage: deploymentStage,
|
|
71
|
+
maximum_idle_interval: conf.maximumIdleInterval,
|
|
72
|
+
};
|
|
73
|
+
return new ConfigurationRequest(challenge, options);
|
|
74
|
+
},
|
|
75
|
+
_createTransportLayerRequestHeaderConfigurationRequest = function _createTransportLayerRequestHeaderConfigurationRequest() {
|
|
76
|
+
return {
|
|
77
|
+
Message: 'TransportLayerClientConfigurationRequest',
|
|
78
|
+
Version: 1,
|
|
79
|
+
flags: 0,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
_submit = async function _submit(message) {
|
|
83
|
+
this.log(LogLevel.INFO, 'Sending message', message);
|
|
84
|
+
const msg = {
|
|
85
|
+
message,
|
|
86
|
+
callbackType: 'response',
|
|
87
|
+
callbackId: message.Message.replace('Request', 'Response'),
|
|
88
|
+
};
|
|
89
|
+
await this.hooks.callHook('frontgateConnection:sendMessage', msg);
|
|
90
|
+
let timeout;
|
|
91
|
+
return new Promise((resolve, reject) => {
|
|
92
|
+
const unsubMessage = this.hooks.hookOnce(`frontgateConnection:response:${msg.callbackId}`, (response) => {
|
|
93
|
+
clearTimeout(timeout);
|
|
94
|
+
this.log(LogLevel.INFO, 'Received response', response);
|
|
95
|
+
resolve(response);
|
|
96
|
+
});
|
|
97
|
+
timeout = setTimeout(() => {
|
|
98
|
+
unsubMessage();
|
|
99
|
+
reject(new Error('Authentication message timeout'));
|
|
100
|
+
}, 3000);
|
|
101
|
+
});
|
|
102
|
+
},
|
|
35
103
|
_a;
|
|
36
104
|
};
|
|
37
105
|
return createExtendedMixinFactory(mixinAppAuth, {
|