diff --git a/javascript/ql/src/semmle/javascript/dependencies/FrameworkLibraries.qll b/javascript/ql/src/semmle/javascript/dependencies/FrameworkLibraries.qll index e9245ac2383..d874aa1fce2 100644 --- a/javascript/ql/src/semmle/javascript/dependencies/FrameworkLibraries.qll +++ b/javascript/ql/src/semmle/javascript/dependencies/FrameworkLibraries.qll @@ -816,6 +816,33 @@ private class RequireJS extends FrameworkLibraryWithGenericURL, FrameworkLibrary } } +/** + * A copy of the Microsoft ApplicationInsights framework. + */ +private class ApplicationInsightsInstance extends FrameworkLibraryInstance { + string version; + + ApplicationInsightsInstance() { + version = this.(TopLevel).getFile().getAbsolutePath().regexpCapture(any(ApplicationInsights t).getAURLRegex(), 1) + } + + override predicate info(FrameworkLibrary fl, string v) { + fl instanceof ApplicationInsights and + version = v + } +} + +/** + * The Microsoft ApplicationInsights framework. + */ +private class ApplicationInsights extends FrameworkLibraryWithURLRegex { + ApplicationInsights() { this = "ApplicationInsights" } + + override string getAURLRegex() { + result = ".*(?:^|/)ai\\.(" + semverRegex() + ")-build\\d+\\.js" + } +} + /** * A `FrameworkLibraryReference` that refers to a recognised `FrameworkLibraryInstance`, * that is, a `