@equinor/echo-framework 0.9.13 → 0.9.14
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/components/appLinks/applinkUtils.d.ts +2 -0
- package/dist/components/appLinks/applinkUtils.test.d.ts +1 -0
- package/dist/components/containers/layouts.d.ts +5 -3
- package/dist/components/panel/corePanelLeft.d.ts +1 -4
- package/dist/components/panel/corePanelRight.d.ts +1 -4
- package/dist/components/router/echoRoute.d.ts +2 -2
- package/dist/components/router/index.d.ts +1 -0
- package/dist/components/router/useLayout.d.ts +3 -0
- package/dist/coreApplication/index.d.ts +0 -2
- package/dist/hooks/index.d.ts +0 -2
- package/dist/index.d.ts +0 -8
- package/dist/index.js +3 -0
- package/dist/types/hookLibrary.d.ts +0 -1
- package/package.json +42 -39
- package/dist/_virtual/_tslib.js +0 -67
- package/dist/_virtual/index.js +0 -9
- package/dist/coreApplication/EchoBarComponent.d.ts +0 -9
- package/dist/coreApplication/EchoUserInterfaceContextProvider.d.ts +0 -11
- package/dist/hooks/useIsCompactLayout.d.ts +0 -5
- package/dist/hooks/useScreenOrientation.d.ts +0 -5
- package/dist/hooks/useScreenValues.d.ts +0 -13
- package/dist/hooks/useWindowSize.d.ts +0 -9
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -25
- package/dist/node_modules/@equinor/eds-icons/dist/icons.esm.js +0 -5285
- package/dist/node_modules/@microsoft/signalr/dist/esm/AbortController.js +0 -54
- package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +0 -96
- package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +0 -47
- package/dist/node_modules/@microsoft/signalr/dist/esm/Errors.js +0 -287
- package/dist/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +0 -283
- package/dist/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +0 -86
- package/dist/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +0 -20
- package/dist/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +0 -82
- package/dist/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +0 -1169
- package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +0 -1346
- package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +0 -165
- package/dist/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +0 -33
- package/dist/node_modules/@microsoft/signalr/dist/esm/ILogger.js +0 -37
- package/dist/node_modules/@microsoft/signalr/dist/esm/ITransport.js +0 -37
- package/dist/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +0 -179
- package/dist/node_modules/@microsoft/signalr/dist/esm/Loggers.js +0 -35
- package/dist/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +0 -448
- package/dist/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +0 -238
- package/dist/node_modules/@microsoft/signalr/dist/esm/Subject.js +0 -99
- package/dist/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +0 -45
- package/dist/node_modules/@microsoft/signalr/dist/esm/Utils.js +0 -435
- package/dist/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +0 -264
- package/dist/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +0 -133
- package/dist/node_modules/classnames/index.js +0 -67
- package/dist/node_modules/history/esm/history.js +0 -498
- package/dist/node_modules/resolve-pathname/esm/resolve-pathname.js +0 -73
- package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -36
- package/dist/node_modules/tiny-invariant/dist/tiny-invariant.esm.js +0 -23
- package/dist/node_modules/tiny-warning/dist/tiny-warning.esm.js +0 -26
- package/dist/src/components/appLinks/AppLinks.js +0 -38
- package/dist/src/components/appLinks/AppLinks.module.css.js +0 -14
- package/dist/src/components/appLinks/linkButton/linkButton.js +0 -45
- package/dist/src/components/containers/layout.module.css.js +0 -29
- package/dist/src/components/containers/layouts.js +0 -101
- package/dist/src/components/contextualAppLinks/contextualAppLinks.context.js +0 -20
- package/dist/src/components/contextualAppLinks/contextualAppLinks.js +0 -47
- package/dist/src/components/contextualAppLinks/externalAppsMenu.js +0 -157
- package/dist/src/components/contextualAppLinks/externalAppsMenu.module.css.js +0 -16
- package/dist/src/components/contextualAppLinks/externalLinkButtons/allExternalLinks.js +0 -127
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.js +0 -169
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.js +0 -95
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.js +0 -95
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.js +0 -84
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSafeX.js +0 -38
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.js +0 -110
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.js +0 -59
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToStid.js +0 -40
- package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.js +0 -114
- package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.js +0 -44
- package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.module.css.js +0 -15
- package/dist/src/components/contextualAppLinks/hooks/useContextualAppLinks.js +0 -52
- package/dist/src/components/contextualAppLinks/hooks/useContextualAppLinksContext.js +0 -36
- package/dist/src/components/contextualAppLinks/index.js +0 -22
- package/dist/src/components/contextualAppLinks/internalAppLinks.js +0 -115
- package/dist/src/components/contextualAppLinks/linkButton.js +0 -57
- package/dist/src/components/echoLogo/echoLogo.js +0 -30
- package/dist/src/components/echoLogo/echoLogo.module.css.js +0 -15
- package/dist/src/components/errorBoundary/components/chunkLoadErrorMessage.js +0 -64
- package/dist/src/components/errorBoundary/components/chunkLoadErrorMessage.module.css.js +0 -17
- package/dist/src/components/errorBoundary/components/errorBoundaryBaseMessage.js +0 -85
- package/dist/src/components/errorBoundary/components/errorBoundaryBaseMessage.module.css.js +0 -19
- package/dist/src/components/errorBoundary/components/notificationCardWithLogo.js +0 -55
- package/dist/src/components/errorBoundary/components/notificationCardWithLogo.module.css.js +0 -19
- package/dist/src/components/errorBoundary/errorBoundary.js +0 -100
- package/dist/src/components/externalLinkButton/externalLinkButton.js +0 -310
- package/dist/src/components/externalLinkButton/externalLinkButton.module.css.js +0 -23
- package/dist/src/components/footer/footer.js +0 -42
- package/dist/src/components/footer/footer.module.css.js +0 -17
- package/dist/src/components/lazyLoading/appLoadingIndicator.js +0 -34
- package/dist/src/components/lazyLoading/appLoadingIndicator.module.css.js +0 -15
- package/dist/src/components/lazyLoading/lazyLoadedAppWrapper.js +0 -40
- package/dist/src/components/mediator/mediator.js +0 -32
- package/dist/src/components/pageMenu/Navigation/applicationList.js +0 -35
- package/dist/src/components/pageMenu/Navigation/applicationList.module.css.js +0 -17
- package/dist/src/components/pageMenu/accordionItem.module.css.js +0 -16
- package/dist/src/components/pageMenu/defaultAccordionItem.js +0 -61
- package/dist/src/components/pageMenu/pageMenu.js +0 -141
- package/dist/src/components/pageMenu/pageMenu.module.css.js +0 -17
- package/dist/src/components/pageMenu/pageMenuDrawerItem.js +0 -77
- package/dist/src/components/pageMenu/pageMenuDrawerItem.module.css.js +0 -20
- package/dist/src/components/pageMenu/settings/asset.js +0 -40
- package/dist/src/components/pageMenu/settings/profile.js +0 -62
- package/dist/src/components/pageMenu/settings/settings.js +0 -41
- package/dist/src/components/pageMenu/settings/settings.module.css.js +0 -25
- package/dist/src/components/pageMenu/version/version.js +0 -88
- package/dist/src/components/pageMenu/version/version.module.css.js +0 -14
- package/dist/src/components/panel/corePanelIcon.js +0 -31
- package/dist/src/components/panel/corePanelLeft.js +0 -94
- package/dist/src/components/panel/corePanelLeft.module.css.js +0 -21
- package/dist/src/components/panel/corePanelRight.js +0 -98
- package/dist/src/components/panel/corePanelRight.module.css.js +0 -18
- package/dist/src/components/panelButton/panelButton.js +0 -124
- package/dist/src/components/panelButton/panelButton.module.css.js +0 -25
- package/dist/src/components/plantSelector/plantSelector.js +0 -137
- package/dist/src/components/projectSelector/ProcosysProjectSelector.js +0 -115
- package/dist/src/components/projectSelector/ProcosysProjectSelector.module.css.js +0 -14
- package/dist/src/components/realTimeData/RealTimePopoverButton.js +0 -168
- package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.js +0 -83
- package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.module.css.js +0 -15
- package/dist/src/components/realTimeData/components/connectorForIMSTag/IMSConnector.module.css.js +0 -17
- package/dist/src/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.js +0 -149
- package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.js +0 -75
- package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.module.css.js +0 -15
- package/dist/src/components/realTimeData/components/contextPopover/Popover.js +0 -37
- package/dist/src/components/realTimeData/components/contextPopover/Popover.module.css.js +0 -15
- package/dist/src/components/realTimeData/hooks/useRealTimeHub.js +0 -124
- package/dist/src/components/realTimeData/hooks/useSignalR.js +0 -175
- package/dist/src/components/realTimeData/hooks/useSignalRListener.js +0 -22
- package/dist/src/components/router/echoRoute.js +0 -51
- package/dist/src/components/router/echoRouter.js +0 -30
- package/dist/src/components/router/echoWrapper.js +0 -33
- package/dist/src/components/router/routes.js +0 -43
- package/dist/src/components/searchMenu/searchMenu.js +0 -46
- package/dist/src/components/searchMenu/searchMenu.module.css.js +0 -16
- package/dist/src/components/tagNumber/tagNo.module.css.js +0 -14
- package/dist/src/components/tagNumber/tagNumber.js +0 -38
- package/dist/src/components/toaster/toaster.js +0 -44
- package/dist/src/components/toaster/toaster.module.css.js +0 -16
- package/dist/src/components/toaster/toasters.js +0 -101
- package/dist/src/coreApplication/EchoBarComponent.js +0 -164
- package/dist/src/coreApplication/EchoContent.js +0 -52
- package/dist/src/coreApplication/EchoContent.module.css.js +0 -17
- package/dist/src/coreApplication/EchoContentPanels.js +0 -40
- package/dist/src/coreApplication/EchoEventHandler.js +0 -79
- package/dist/src/coreApplication/EchoEventHandler.module.css.js +0 -14
- package/dist/src/coreApplication/EchoUserInterfaceContextProvider.js +0 -66
- package/dist/src/globalStyles.css.js +0 -6
- package/dist/src/hooks/hookLibrary.js +0 -86
- package/dist/src/hooks/index.js +0 -18
- package/dist/src/hooks/useEchoHistory.js +0 -38
- package/dist/src/hooks/useIsCompactLayout.js +0 -50
- package/dist/src/hooks/useLongPress.js +0 -37
- package/dist/src/hooks/useScreenOrientation.js +0 -62
- package/dist/src/hooks/useScreenValues.js +0 -35
- package/dist/src/hooks/useSemi.js +0 -100
- package/dist/src/hooks/useTagDetails.js +0 -153
- package/dist/src/hooks/useWindowSize.js +0 -62
- package/dist/src/icons/common/CommissionApp-icon.png.js +0 -7
- package/dist/src/icons/common/Evision.svg.js +0 -68
- package/dist/src/icons/common/Fusion.svg.js +0 -111
- package/dist/src/icons/common/McApp.svg.js +0 -70
- package/dist/src/icons/common/Notification.svg.js +0 -81
- package/dist/src/icons/common/ProCoSysIcon.svg.js +0 -68
- package/dist/src/icons/common/Robim.svg.js +0 -66
- package/dist/src/icons/common/SX-logo.png.js +0 -7
- package/dist/src/icons/common/SapLogo.svg.js +0 -95
- package/dist/src/icons/common/SemiIcon.svg.js +0 -82
- package/dist/src/icons/common/Stid.svg.js +0 -65
- package/dist/src/icons/common/TR2000.svg.js +0 -73
- package/dist/src/icons/common/WorkOrder.svg.js +0 -71
- package/dist/src/icons/common/Yammer.svg.js +0 -65
- package/dist/src/icons/common/satos-logo.png.js +0 -7
- package/dist/src/icons/edsIons.js +0 -15
- package/dist/src/icons/equinor-logo.js +0 -62
- package/dist/src/icons/logo_ee.js +0 -37
- package/dist/src/icons/search.js +0 -35
- package/dist/src/index.js +0 -218
- package/dist/src/index2.js +0 -205
- package/dist/src/services/api/api-manager.js +0 -190
- package/dist/src/services/api/api-plantinfo.js +0 -196
- package/dist/src/services/api/api-plants.js +0 -75
- package/dist/src/services/api/api-realtimedata.js +0 -55
- package/dist/src/services/api/api-tag-details.js +0 -69
- package/dist/src/services/api/api-tags.js +0 -88
- package/dist/src/services/api/api-version.js +0 -124
- package/dist/src/services/componentRegistry/componentRegistry.js +0 -69
- package/dist/src/services/echopediaAnalyticsModule/echopediaAnalyticsModule.js +0 -10
- package/dist/src/services/eventCallbacks/plantChanged.js +0 -42
- package/dist/src/services/eventHubActions/toastActions.js +0 -18
- package/dist/src/theme/themeConst.js +0 -75
- package/dist/src/types/extensions.js +0 -10
- package/dist/src/types/legend.js +0 -58
- package/dist/src/types/pingableSources.js +0 -11
- package/dist/src/utils/copyText.js +0 -67
- package/dist/src/utils/eventHandlerUtils.js +0 -11
- package/dist/src/utils/legendUtils.js +0 -168
- package/dist/src/utils/navigationUtils.js +0 -28
- package/dist/src/utils/plantInfo.js +0 -535
- package/dist/src/utils/plantsDataUtils.js +0 -35
- package/dist/src/utils/projectSelectorUtils.js +0 -19
- package/dist/src/utils/startup.js +0 -89
- package/dist/src/utils/taskCache.js +0 -89
|
@@ -1,283 +0,0 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
6
|
-
|
|
7
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
-
|
|
9
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
|
|
11
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
|
|
13
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14
|
-
|
|
15
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
16
|
-
|
|
17
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
-
|
|
19
|
-
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); } }
|
|
20
|
-
|
|
21
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
22
|
-
|
|
23
|
-
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); }
|
|
24
|
-
|
|
25
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
|
-
|
|
27
|
-
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); }; }
|
|
28
|
-
|
|
29
|
-
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); }
|
|
30
|
-
|
|
31
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
-
|
|
33
|
-
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; } }
|
|
34
|
-
|
|
35
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
36
|
-
|
|
37
|
-
Object.defineProperty(exports, '__esModule', {
|
|
38
|
-
value: true
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
var Errors = require('./Errors.js');
|
|
42
|
-
|
|
43
|
-
var HttpClient = require('./HttpClient.js');
|
|
44
|
-
|
|
45
|
-
var ILogger = require('./ILogger.js');
|
|
46
|
-
|
|
47
|
-
var Utils = require('./Utils.js'); // Licensed to the .NET Foundation under one or more agreements.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var FetchHttpClient = /*#__PURE__*/function (_HttpClient$HttpClien) {
|
|
51
|
-
_inherits(FetchHttpClient, _HttpClient$HttpClien);
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(FetchHttpClient);
|
|
54
|
-
|
|
55
|
-
function FetchHttpClient(logger) {
|
|
56
|
-
var _this;
|
|
57
|
-
|
|
58
|
-
_classCallCheck(this, FetchHttpClient);
|
|
59
|
-
|
|
60
|
-
_this = _super.call(this);
|
|
61
|
-
_this._logger = logger;
|
|
62
|
-
|
|
63
|
-
if (typeof fetch === "undefined") {
|
|
64
|
-
// In order to ignore the dynamic require in webpack builds we need to do this magic
|
|
65
|
-
// @ts-ignore: TS doesn't know about these names
|
|
66
|
-
var requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require; // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests
|
|
67
|
-
|
|
68
|
-
_this._jar = new (requireFunc("tough-cookie").CookieJar)();
|
|
69
|
-
_this._fetchType = requireFunc("node-fetch"); // node-fetch doesn't have a nice API for getting and setting cookies
|
|
70
|
-
// fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one
|
|
71
|
-
|
|
72
|
-
_this._fetchType = requireFunc("fetch-cookie")(_this._fetchType, _this._jar);
|
|
73
|
-
} else {
|
|
74
|
-
_this._fetchType = fetch.bind(Utils.getGlobalThis());
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (typeof AbortController === "undefined") {
|
|
78
|
-
// In order to ignore the dynamic require in webpack builds we need to do this magic
|
|
79
|
-
// @ts-ignore: TS doesn't know about these names
|
|
80
|
-
var _requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require; // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_this._abortControllerType = _requireFunc("abort-controller");
|
|
84
|
-
} else {
|
|
85
|
-
_this._abortControllerType = AbortController;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return _this;
|
|
89
|
-
}
|
|
90
|
-
/** @inheritDoc */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
_createClass(FetchHttpClient, [{
|
|
94
|
-
key: "send",
|
|
95
|
-
value: function () {
|
|
96
|
-
var _send = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
|
97
|
-
var _this2 = this;
|
|
98
|
-
|
|
99
|
-
var abortController, error, timeoutId, msTimeout, response, errorMessage, content, payload;
|
|
100
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
101
|
-
while (1) {
|
|
102
|
-
switch (_context.prev = _context.next) {
|
|
103
|
-
case 0:
|
|
104
|
-
if (!(request.abortSignal && request.abortSignal.aborted)) {
|
|
105
|
-
_context.next = 2;
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
throw new Errors.AbortError();
|
|
110
|
-
|
|
111
|
-
case 2:
|
|
112
|
-
if (request.method) {
|
|
113
|
-
_context.next = 4;
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
throw new Error("No method defined.");
|
|
118
|
-
|
|
119
|
-
case 4:
|
|
120
|
-
if (request.url) {
|
|
121
|
-
_context.next = 6;
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
throw new Error("No url defined.");
|
|
126
|
-
|
|
127
|
-
case 6:
|
|
128
|
-
abortController = new this._abortControllerType();
|
|
129
|
-
|
|
130
|
-
// Hook our abortSignal into the abort controller
|
|
131
|
-
if (request.abortSignal) {
|
|
132
|
-
request.abortSignal.onabort = function () {
|
|
133
|
-
abortController.abort();
|
|
134
|
-
error = new Errors.AbortError();
|
|
135
|
-
};
|
|
136
|
-
} // If a timeout has been passed in, setup a timeout to call abort
|
|
137
|
-
// Type needs to be any to fit window.setTimeout and NodeJS.setTimeout
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
timeoutId = null;
|
|
141
|
-
|
|
142
|
-
if (request.timeout) {
|
|
143
|
-
msTimeout = request.timeout;
|
|
144
|
-
timeoutId = setTimeout(function () {
|
|
145
|
-
abortController.abort();
|
|
146
|
-
|
|
147
|
-
_this2._logger.log(ILogger.LogLevel.Warning, "Timeout from HTTP request.");
|
|
148
|
-
|
|
149
|
-
error = new Errors.TimeoutError();
|
|
150
|
-
}, msTimeout);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
_context.prev = 10;
|
|
154
|
-
_context.next = 13;
|
|
155
|
-
return this._fetchType(request.url, {
|
|
156
|
-
body: request.content,
|
|
157
|
-
cache: "no-cache",
|
|
158
|
-
credentials: request.withCredentials === true ? "include" : "same-origin",
|
|
159
|
-
headers: _objectSpread({
|
|
160
|
-
"Content-Type": "text/plain;charset=UTF-8",
|
|
161
|
-
"X-Requested-With": "XMLHttpRequest"
|
|
162
|
-
}, request.headers),
|
|
163
|
-
method: request.method,
|
|
164
|
-
mode: "cors",
|
|
165
|
-
redirect: "follow",
|
|
166
|
-
signal: abortController.signal
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
case 13:
|
|
170
|
-
response = _context.sent;
|
|
171
|
-
_context.next = 22;
|
|
172
|
-
break;
|
|
173
|
-
|
|
174
|
-
case 16:
|
|
175
|
-
_context.prev = 16;
|
|
176
|
-
_context.t0 = _context["catch"](10);
|
|
177
|
-
|
|
178
|
-
if (!error) {
|
|
179
|
-
_context.next = 20;
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
throw error;
|
|
184
|
-
|
|
185
|
-
case 20:
|
|
186
|
-
this._logger.log(ILogger.LogLevel.Warning, "Error from HTTP request. ".concat(_context.t0, "."));
|
|
187
|
-
|
|
188
|
-
throw _context.t0;
|
|
189
|
-
|
|
190
|
-
case 22:
|
|
191
|
-
_context.prev = 22;
|
|
192
|
-
|
|
193
|
-
if (timeoutId) {
|
|
194
|
-
clearTimeout(timeoutId);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (request.abortSignal) {
|
|
198
|
-
request.abortSignal.onabort = null;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return _context.finish(22);
|
|
202
|
-
|
|
203
|
-
case 26:
|
|
204
|
-
if (response.ok) {
|
|
205
|
-
_context.next = 31;
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
_context.next = 29;
|
|
210
|
-
return deserializeContent(response, "text");
|
|
211
|
-
|
|
212
|
-
case 29:
|
|
213
|
-
errorMessage = _context.sent;
|
|
214
|
-
throw new Errors.HttpError(errorMessage || response.statusText, response.status);
|
|
215
|
-
|
|
216
|
-
case 31:
|
|
217
|
-
content = deserializeContent(response, request.responseType);
|
|
218
|
-
_context.next = 34;
|
|
219
|
-
return content;
|
|
220
|
-
|
|
221
|
-
case 34:
|
|
222
|
-
payload = _context.sent;
|
|
223
|
-
return _context.abrupt("return", new HttpClient.HttpResponse(response.status, response.statusText, payload));
|
|
224
|
-
|
|
225
|
-
case 36:
|
|
226
|
-
case "end":
|
|
227
|
-
return _context.stop();
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}, _callee, this, [[10, 16, 22, 26]]);
|
|
231
|
-
}));
|
|
232
|
-
|
|
233
|
-
function send(_x) {
|
|
234
|
-
return _send.apply(this, arguments);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return send;
|
|
238
|
-
}()
|
|
239
|
-
}, {
|
|
240
|
-
key: "getCookieString",
|
|
241
|
-
value: function getCookieString(url) {
|
|
242
|
-
var cookies = "";
|
|
243
|
-
|
|
244
|
-
if (Utils.Platform.isNode && this._jar) {
|
|
245
|
-
// @ts-ignore: unused variable
|
|
246
|
-
this._jar.getCookies(url, function (e, c) {
|
|
247
|
-
return cookies = c.join("; ");
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
return cookies;
|
|
252
|
-
}
|
|
253
|
-
}]);
|
|
254
|
-
|
|
255
|
-
return FetchHttpClient;
|
|
256
|
-
}(HttpClient.HttpClient);
|
|
257
|
-
|
|
258
|
-
function deserializeContent(response, responseType) {
|
|
259
|
-
var content;
|
|
260
|
-
|
|
261
|
-
switch (responseType) {
|
|
262
|
-
case "arraybuffer":
|
|
263
|
-
content = response.arrayBuffer();
|
|
264
|
-
break;
|
|
265
|
-
|
|
266
|
-
case "text":
|
|
267
|
-
content = response.text();
|
|
268
|
-
break;
|
|
269
|
-
|
|
270
|
-
case "blob":
|
|
271
|
-
case "document":
|
|
272
|
-
case "json":
|
|
273
|
-
throw new Error("".concat(responseType, " is not supported."));
|
|
274
|
-
|
|
275
|
-
default:
|
|
276
|
-
content = response.text();
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return content;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
exports.FetchHttpClient = FetchHttpClient;
|
|
@@ -1,86 +0,0 @@
|
|
|
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
|
-
});
|
|
12
|
-
|
|
13
|
-
var TextMessageFormat = require('./TextMessageFormat.js');
|
|
14
|
-
|
|
15
|
-
var Utils = require('./Utils.js'); // Licensed to the .NET Foundation under one or more agreements.
|
|
16
|
-
|
|
17
|
-
/** @private */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var HandshakeProtocol = /*#__PURE__*/function () {
|
|
21
|
-
function HandshakeProtocol() {
|
|
22
|
-
_classCallCheck(this, HandshakeProtocol);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
_createClass(HandshakeProtocol, [{
|
|
26
|
-
key: "writeHandshakeRequest",
|
|
27
|
-
value: // Handshake request is always JSON
|
|
28
|
-
function writeHandshakeRequest(handshakeRequest) {
|
|
29
|
-
return TextMessageFormat.TextMessageFormat.write(JSON.stringify(handshakeRequest));
|
|
30
|
-
}
|
|
31
|
-
}, {
|
|
32
|
-
key: "parseHandshakeResponse",
|
|
33
|
-
value: function parseHandshakeResponse(data) {
|
|
34
|
-
var messageData;
|
|
35
|
-
var remainingData;
|
|
36
|
-
|
|
37
|
-
if (Utils.isArrayBuffer(data)) {
|
|
38
|
-
// Format is binary but still need to read JSON text from handshake response
|
|
39
|
-
var binaryData = new Uint8Array(data);
|
|
40
|
-
var separatorIndex = binaryData.indexOf(TextMessageFormat.TextMessageFormat.RecordSeparatorCode);
|
|
41
|
-
|
|
42
|
-
if (separatorIndex === -1) {
|
|
43
|
-
throw new Error("Message is incomplete.");
|
|
44
|
-
} // content before separator is handshake response
|
|
45
|
-
// optional content after is additional messages
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var responseLength = separatorIndex + 1;
|
|
49
|
-
messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));
|
|
50
|
-
remainingData = binaryData.byteLength > responseLength ? binaryData.slice(responseLength).buffer : null;
|
|
51
|
-
} else {
|
|
52
|
-
var textData = data;
|
|
53
|
-
|
|
54
|
-
var _separatorIndex = textData.indexOf(TextMessageFormat.TextMessageFormat.RecordSeparator);
|
|
55
|
-
|
|
56
|
-
if (_separatorIndex === -1) {
|
|
57
|
-
throw new Error("Message is incomplete.");
|
|
58
|
-
} // content before separator is handshake response
|
|
59
|
-
// optional content after is additional messages
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var _responseLength = _separatorIndex + 1;
|
|
63
|
-
|
|
64
|
-
messageData = textData.substring(0, _responseLength);
|
|
65
|
-
remainingData = textData.length > _responseLength ? textData.substring(_responseLength) : null;
|
|
66
|
-
} // At this point we should have just the single handshake message
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var messages = TextMessageFormat.TextMessageFormat.parse(messageData);
|
|
70
|
-
var response = JSON.parse(messages[0]);
|
|
71
|
-
|
|
72
|
-
if (response.type) {
|
|
73
|
-
throw new Error("Expected a handshake response from the server.");
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
var responseMessage = response; // multiple messages could have arrived with handshake
|
|
77
|
-
// return additional data to be parsed as usual, or null if all parsed
|
|
78
|
-
|
|
79
|
-
return [remainingData, responseMessage];
|
|
80
|
-
}
|
|
81
|
-
}]);
|
|
82
|
-
|
|
83
|
-
return HandshakeProtocol;
|
|
84
|
-
}();
|
|
85
|
-
|
|
86
|
-
exports.HandshakeProtocol = HandshakeProtocol;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
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); } }
|
|
4
|
-
|
|
5
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
|
|
7
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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
|
-
|
|
14
|
-
var HeaderNames = /*#__PURE__*/_createClass(function HeaderNames() {
|
|
15
|
-
_classCallCheck(this, HeaderNames);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
HeaderNames.Authorization = "Authorization";
|
|
19
|
-
HeaderNames.Cookie = "Cookie";
|
|
20
|
-
exports.HeaderNames = HeaderNames;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
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); } }
|
|
10
|
-
|
|
11
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
13
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, '__esModule', {
|
|
16
|
-
value: true
|
|
17
|
-
}); // Licensed to the .NET Foundation under one or more agreements.
|
|
18
|
-
// The .NET Foundation licenses this file to you under the MIT license.
|
|
19
|
-
|
|
20
|
-
/** Represents an HTTP response. */
|
|
21
|
-
|
|
22
|
-
var HttpResponse = /*#__PURE__*/_createClass(function HttpResponse(statusCode, statusText, content) {
|
|
23
|
-
_classCallCheck(this, HttpResponse);
|
|
24
|
-
|
|
25
|
-
this.statusCode = statusCode;
|
|
26
|
-
this.statusText = statusText;
|
|
27
|
-
this.content = content;
|
|
28
|
-
});
|
|
29
|
-
/** Abstraction over an HTTP client.
|
|
30
|
-
*
|
|
31
|
-
* This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var HttpClient = /*#__PURE__*/function () {
|
|
36
|
-
function HttpClient() {
|
|
37
|
-
_classCallCheck(this, HttpClient);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
_createClass(HttpClient, [{
|
|
41
|
-
key: "get",
|
|
42
|
-
value: function get(url, options) {
|
|
43
|
-
return this.send(_objectSpread(_objectSpread({}, options), {}, {
|
|
44
|
-
method: "GET",
|
|
45
|
-
url: url
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "post",
|
|
50
|
-
value: function post(url, options) {
|
|
51
|
-
return this.send(_objectSpread(_objectSpread({}, options), {}, {
|
|
52
|
-
method: "POST",
|
|
53
|
-
url: url
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
key: "delete",
|
|
58
|
-
value: function _delete(url, options) {
|
|
59
|
-
return this.send(_objectSpread(_objectSpread({}, options), {}, {
|
|
60
|
-
method: "DELETE",
|
|
61
|
-
url: url
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
/** Gets all cookies that apply to the specified URL.
|
|
65
|
-
*
|
|
66
|
-
* @param url The URL that the cookies are valid for.
|
|
67
|
-
* @returns {string} A string containing all the key-value cookie pairs for the specified URL.
|
|
68
|
-
*/
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
|
|
71
|
-
}, {
|
|
72
|
-
key: "getCookieString",
|
|
73
|
-
value: function getCookieString(url) {
|
|
74
|
-
return "";
|
|
75
|
-
}
|
|
76
|
-
}]);
|
|
77
|
-
|
|
78
|
-
return HttpClient;
|
|
79
|
-
}();
|
|
80
|
-
|
|
81
|
-
exports.HttpClient = HttpClient;
|
|
82
|
-
exports.HttpResponse = HttpResponse;
|