UNPKG

1.44 kBJavaScriptView Raw
1/*
2 * Application Insights JavaScript SDK - Web, 3.2.2
3 * Copyright (c) Microsoft and contributors. All rights reserved.
4 */
5import { throwUnsupported } from "@nevware21/ts-utils";
6import { AppInsightsSku } from "./AISku";
7import { _DYN_UPDATE_SNIPPET_DEFIN2 } from "./__DynamicConstants";
8var ApplicationInsightsContainer = /** @class */ (function () {
9 function ApplicationInsightsContainer() {
10 }
11 ApplicationInsightsContainer.getAppInsights = function (snippet, version) {
12 var theSku = new AppInsightsSku(snippet);
13 // Two target scenarios:
14 // Removed: 1. Customer runs v1 snippet + runtime. If customer updates just cdn location to new SDK, it will run in compat mode so old apis work
15 // 2. Customer updates to new snippet (that uses cdn location to new SDK. This is same as a new customer onboarding
16 // and all api signatures are expected to map to new SDK. Note new snippet specifies version
17 if (version >= 2.0) {
18 theSku[_DYN_UPDATE_SNIPPET_DEFIN2 /* @min:%2eupdateSnippetDefinitions */](snippet);
19 theSku.loadAppInsights(false);
20 return theSku; // default behavior with new snippet
21 }
22 throwUnsupported("V1 API compatibility is no longer supported");
23 };
24 return ApplicationInsightsContainer;
25}());
26export { ApplicationInsightsContainer };
27//# sourceMappingURL=ApplicationInsightsContainer.js.map
\No newline at end of file