@equinor/echo-framework 0.7.3 → 0.7.6
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/dist/__tests__/realTimeDataHooks.test.d.ts +1 -0
- package/dist/__tests__/realTimeDataUtils.test.d.ts +1 -0
- package/dist/_virtual/_tslib.js +14 -0
- package/dist/components/errorBoundary/errorBoundary.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/panel/corePanelLeft.d.ts +4 -1
- package/dist/components/panel/corePanelRight.d.ts +4 -1
- package/dist/components/realTimeData/RealTimePopoverButton.d.ts +18 -0
- package/dist/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.d.ts +7 -0
- package/dist/components/realTimeData/components/IMSDropdown/index.d.ts +1 -0
- package/dist/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.d.ts +6 -0
- package/dist/components/realTimeData/components/connectorForIMSTag/index.d.ts +1 -0
- package/dist/components/realTimeData/components/contextButton/RealTimeContextButton.d.ts +6 -0
- package/dist/components/realTimeData/components/contextButton/index.d.ts +1 -0
- package/dist/components/realTimeData/components/contextPopover/Popover.d.ts +6 -0
- package/dist/components/realTimeData/components/contextPopover/index.d.ts +1 -0
- package/dist/components/realTimeData/components/index.d.ts +4 -0
- package/dist/components/realTimeData/hooks/index.d.ts +3 -0
- package/dist/components/realTimeData/hooks/useRealTimeHub.d.ts +13 -0
- package/dist/components/realTimeData/hooks/useSignalR.d.ts +9 -0
- package/dist/components/realTimeData/hooks/useSignalRListener.d.ts +4 -0
- package/dist/components/realTimeData/index.d.ts +1 -0
- package/dist/coreApplication/EchoBarComponent.d.ts +6 -0
- package/dist/coreApplication/EchoContent.d.ts +1 -0
- package/dist/coreApplication/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useIsLandscape.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/node_modules/@microsoft/signalr/dist/esm/AbortController.js +54 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +96 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +47 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/Errors.js +287 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +281 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +86 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +20 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +82 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +1167 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +1342 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +165 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +33 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/ILogger.js +37 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/ITransport.js +37 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +179 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/Loggers.js +35 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +444 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +235 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/Subject.js +99 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +45 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/Utils.js +433 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +263 -0
- package/dist/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +133 -0
- package/dist/services/api/api-realtimedata.d.ts +2 -0
- package/dist/src/components/containers/layout.module.css.js +4 -1
- package/dist/src/components/containers/layouts.js +38 -8
- package/dist/src/components/panel/corePanelLeft.js +5 -2
- package/dist/src/components/panel/corePanelLeft.module.css.js +1 -1
- package/dist/src/components/panel/corePanelRight.js +4 -2
- package/dist/src/components/panel/corePanelRight.module.css.js +1 -1
- package/dist/src/components/projectSelector/ProcosysProjectSelector.js +1 -1
- package/dist/src/components/realTimeData/RealTimePopoverButton.js +136 -0
- package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.js +81 -0
- package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.module.css.js +15 -0
- package/dist/src/components/realTimeData/components/connectorForIMSTag/IMSConnector.module.css.js +16 -0
- package/dist/src/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.js +110 -0
- package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.js +75 -0
- package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.module.css.js +15 -0
- package/dist/src/components/realTimeData/components/contextPopover/Popover.js +37 -0
- package/dist/src/components/realTimeData/components/contextPopover/Popover.module.css.js +15 -0
- package/dist/src/components/realTimeData/hooks/useRealTimeHub.js +122 -0
- package/dist/src/components/realTimeData/hooks/useSignalR.js +159 -0
- package/dist/src/components/realTimeData/hooks/useSignalRListener.js +22 -0
- package/dist/src/coreApplication/EchoBarComponent.js +113 -0
- package/dist/src/coreApplication/EchoContent.js +7 -2
- package/dist/src/hooks/useIsLandscape.js +52 -0
- package/dist/src/index.js +9 -0
- package/dist/src/services/api/api-realtimedata.js +42 -0
- package/dist/types/realtimedata.d.ts +18 -0
- package/package.json +30 -27
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/_virtual/_tslib.js
CHANGED
|
@@ -18,6 +18,19 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
18
18
|
PERFORMANCE OF THIS SOFTWARE.
|
|
19
19
|
***************************************************************************** */
|
|
20
20
|
|
|
21
|
+
function __rest(s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
|
|
24
|
+
for (var p in s) {
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
29
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
|
|
21
34
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
22
35
|
function adopt(value) {
|
|
23
36
|
return value instanceof P ? value : new P(function (resolve) {
|
|
@@ -51,3 +64,4 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
51
64
|
}
|
|
52
65
|
|
|
53
66
|
exports.__awaiter = __awaiter;
|
|
67
|
+
exports.__rest = __rest;
|
|
@@ -5,6 +5,7 @@ interface ErrorBoundaryState {
|
|
|
5
5
|
}
|
|
6
6
|
export interface ErrorBoundaryProps {
|
|
7
7
|
onComponentDidCatch?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
8
|
+
children?: React.ReactNode;
|
|
8
9
|
}
|
|
9
10
|
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
10
11
|
constructor(props: Readonly<ErrorBoundaryProps>);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RTDProps {
|
|
3
|
+
tagNo: string;
|
|
4
|
+
/**
|
|
5
|
+
* Callback for whenever RTD popover is to be opened. Could be used to handle closing of other popovers.
|
|
6
|
+
*/
|
|
7
|
+
onOpen?: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ContextMenu button for displaying Real-Time-Data from connected sensors.
|
|
11
|
+
* @param {RTDProps} {
|
|
12
|
+
* tagNo: The tagNo to check for connected IMS tags.
|
|
13
|
+
* onOpen: Optional callback for whenever RTD popover is being opened
|
|
14
|
+
* }
|
|
15
|
+
* @return {*}
|
|
16
|
+
*/
|
|
17
|
+
declare function RealTimePopoverButton({ tagNo, onOpen }: RTDProps): JSX.Element | null;
|
|
18
|
+
export { RealTimePopoverButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RealTimeIMSDropdown';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RealTimeConnectorForIMSTag';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RealTimeContextButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Popover';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SignalRState } from './useSignalR';
|
|
2
|
+
import { IMSByName } from '../../../types/realtimedata';
|
|
3
|
+
interface RealTimeData extends SignalRState {
|
|
4
|
+
metadata?: IMSByName;
|
|
5
|
+
present?: SignalRData;
|
|
6
|
+
}
|
|
7
|
+
declare type SignalRData = {
|
|
8
|
+
time: Date;
|
|
9
|
+
value: number;
|
|
10
|
+
status: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function useRealTimeHub(id: string, instCode?: string | null): RealTimeData;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RealTimePopoverButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useIsLandscape';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsLandscape(): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import './theme/theme.css';
|
|
|
6
6
|
import { getLegendStatusColor } from './utils/legendUtils';
|
|
7
7
|
export * from './components';
|
|
8
8
|
export * from './coreApplication';
|
|
9
|
+
export * from './hooks';
|
|
10
|
+
export { RegisteredHookName } from './hooks/hookLibrary';
|
|
9
11
|
export { RegisteredComponentName } from './services/componentRegistry/componentRegistry';
|
|
10
12
|
export * from './services/eventHubActions';
|
|
11
13
|
export * from './theme/themeConst';
|
|
@@ -17,7 +19,6 @@ export type { ModelPermissions } from './types/modelPermissions';
|
|
|
17
19
|
export * from './utils';
|
|
18
20
|
export { getLegendStatusColor, legendTypeToLegendStatus } from './utils/legendUtils';
|
|
19
21
|
export * from './utils/startup';
|
|
20
|
-
export { RegisteredHookName } from './hooks/hookLibrary';
|
|
21
22
|
export declare const registerEchopediaComponent: ({ name, component }: {
|
|
22
23
|
name: import("./services/componentRegistry/componentRegistry").RegisteredComponentName;
|
|
23
24
|
component: import("react").FunctionComponent<any>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
+
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, '__esModule', {
|
|
10
|
+
value: true
|
|
11
|
+
}); // Licensed to the .NET Foundation under one or more agreements.
|
|
12
|
+
// The .NET Foundation licenses this file to you under the MIT license.
|
|
13
|
+
// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController
|
|
14
|
+
// We don't actually ever use the API being polyfilled, we always use the polyfill because
|
|
15
|
+
// it's a very new API right now.
|
|
16
|
+
// Not exported from index.
|
|
17
|
+
|
|
18
|
+
/** @private */
|
|
19
|
+
|
|
20
|
+
var AbortController = /*#__PURE__*/function () {
|
|
21
|
+
function AbortController() {
|
|
22
|
+
_classCallCheck(this, AbortController);
|
|
23
|
+
|
|
24
|
+
this._isAborted = false;
|
|
25
|
+
this.onabort = null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_createClass(AbortController, [{
|
|
29
|
+
key: "abort",
|
|
30
|
+
value: function abort() {
|
|
31
|
+
if (!this._isAborted) {
|
|
32
|
+
this._isAborted = true;
|
|
33
|
+
|
|
34
|
+
if (this.onabort) {
|
|
35
|
+
this.onabort();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
key: "signal",
|
|
41
|
+
get: function get() {
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
key: "aborted",
|
|
46
|
+
get: function get() {
|
|
47
|
+
return this._isAborted;
|
|
48
|
+
}
|
|
49
|
+
}]);
|
|
50
|
+
|
|
51
|
+
return AbortController;
|
|
52
|
+
}();
|
|
53
|
+
|
|
54
|
+
exports.AbortController = AbortController;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
|
|
7
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
8
|
+
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
|
|
11
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
12
|
+
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
|
|
15
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
+
|
|
17
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
18
|
+
|
|
19
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
+
|
|
21
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
+
|
|
23
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, '__esModule', {
|
|
26
|
+
value: true
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
var Errors = require('./Errors.js');
|
|
30
|
+
|
|
31
|
+
var FetchHttpClient = require('./FetchHttpClient.js');
|
|
32
|
+
|
|
33
|
+
var HttpClient = require('./HttpClient.js');
|
|
34
|
+
|
|
35
|
+
var Utils = require('./Utils.js');
|
|
36
|
+
|
|
37
|
+
var XhrHttpClient = require('./XhrHttpClient.js'); // Licensed to the .NET Foundation under one or more agreements.
|
|
38
|
+
|
|
39
|
+
/** Default implementation of {@link @microsoft/signalr.HttpClient}. */
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var DefaultHttpClient = /*#__PURE__*/function (_HttpClient$HttpClien) {
|
|
43
|
+
_inherits(DefaultHttpClient, _HttpClient$HttpClien);
|
|
44
|
+
|
|
45
|
+
var _super = _createSuper(DefaultHttpClient);
|
|
46
|
+
|
|
47
|
+
/** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */
|
|
48
|
+
function DefaultHttpClient(logger) {
|
|
49
|
+
var _this;
|
|
50
|
+
|
|
51
|
+
_classCallCheck(this, DefaultHttpClient);
|
|
52
|
+
|
|
53
|
+
_this = _super.call(this);
|
|
54
|
+
|
|
55
|
+
if (typeof fetch !== "undefined" || Utils.Platform.isNode) {
|
|
56
|
+
_this._httpClient = new FetchHttpClient.FetchHttpClient(logger);
|
|
57
|
+
} else if (typeof XMLHttpRequest !== "undefined") {
|
|
58
|
+
_this._httpClient = new XhrHttpClient.XhrHttpClient(logger);
|
|
59
|
+
} else {
|
|
60
|
+
throw new Error("No usable HttpClient found.");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
/** @inheritDoc */
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
_createClass(DefaultHttpClient, [{
|
|
69
|
+
key: "send",
|
|
70
|
+
value: function send(request) {
|
|
71
|
+
// Check that abort was not signaled before calling send
|
|
72
|
+
if (request.abortSignal && request.abortSignal.aborted) {
|
|
73
|
+
return Promise.reject(new Errors.AbortError());
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!request.method) {
|
|
77
|
+
return Promise.reject(new Error("No method defined."));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (!request.url) {
|
|
81
|
+
return Promise.reject(new Error("No url defined."));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return this._httpClient.send(request);
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "getCookieString",
|
|
88
|
+
value: function getCookieString(url) {
|
|
89
|
+
return this._httpClient.getCookieString(url);
|
|
90
|
+
}
|
|
91
|
+
}]);
|
|
92
|
+
|
|
93
|
+
return DefaultHttpClient;
|
|
94
|
+
}(HttpClient.HttpClient);
|
|
95
|
+
|
|
96
|
+
exports.DefaultHttpClient = DefaultHttpClient;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
+
|
|
15
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
+
|
|
17
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
18
|
+
|
|
19
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
+
|
|
21
|
+
Object.defineProperty(exports, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
}); // Licensed to the .NET Foundation under one or more agreements.
|
|
24
|
+
// The .NET Foundation licenses this file to you under the MIT license.
|
|
25
|
+
// 0, 2, 10, 30 second delays before reconnect attempts.
|
|
26
|
+
|
|
27
|
+
var DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];
|
|
28
|
+
/** @private */
|
|
29
|
+
|
|
30
|
+
var DefaultReconnectPolicy = /*#__PURE__*/function () {
|
|
31
|
+
function DefaultReconnectPolicy(retryDelays) {
|
|
32
|
+
_classCallCheck(this, DefaultReconnectPolicy);
|
|
33
|
+
|
|
34
|
+
this._retryDelays = retryDelays !== undefined ? [].concat(_toConsumableArray(retryDelays), [null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_createClass(DefaultReconnectPolicy, [{
|
|
38
|
+
key: "nextRetryDelayInMilliseconds",
|
|
39
|
+
value: function nextRetryDelayInMilliseconds(retryContext) {
|
|
40
|
+
return this._retryDelays[retryContext.previousRetryCount];
|
|
41
|
+
}
|
|
42
|
+
}]);
|
|
43
|
+
|
|
44
|
+
return DefaultReconnectPolicy;
|
|
45
|
+
}();
|
|
46
|
+
|
|
47
|
+
exports.DefaultReconnectPolicy = DefaultReconnectPolicy;
|