@microsoft/applicationinsights-dependencies-js 3.0.0-beta.2208-16 → 3.0.0-beta.2209-01

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.
Files changed (37) hide show
  1. package/browser/applicationinsights-dependencies-js.integrity.json +9 -9
  2. package/browser/applicationinsights-dependencies-js.js +149 -102
  3. package/browser/applicationinsights-dependencies-js.js.map +1 -1
  4. package/browser/applicationinsights-dependencies-js.min.js +2 -2
  5. package/browser/applicationinsights-dependencies-js.min.js.map +1 -1
  6. package/dist/applicationinsights-dependencies-js.api.json +667 -30
  7. package/dist/applicationinsights-dependencies-js.api.md +63 -9
  8. package/dist/applicationinsights-dependencies-js.d.ts +73 -8
  9. package/dist/applicationinsights-dependencies-js.js +149 -102
  10. package/dist/applicationinsights-dependencies-js.js.map +1 -1
  11. package/dist/applicationinsights-dependencies-js.min.js +2 -2
  12. package/dist/applicationinsights-dependencies-js.min.js.map +1 -1
  13. package/dist/applicationinsights-dependencies-js.rollup.d.ts +75 -10
  14. package/dist-esm/DependencyInitializer.js +6 -0
  15. package/dist-esm/DependencyInitializer.js.map +1 -0
  16. package/dist-esm/DependencyListener.js +1 -1
  17. package/dist-esm/InternalConstants.js +1 -1
  18. package/dist-esm/__DynamicConstants.js +6 -6
  19. package/dist-esm/__DynamicConstants.js.map +1 -1
  20. package/dist-esm/ajax.js +153 -98
  21. package/dist-esm/ajax.js.map +1 -1
  22. package/dist-esm/ajaxRecord.js +1 -1
  23. package/dist-esm/ajaxUtils.js +1 -1
  24. package/dist-esm/applicationinsights-dependencies-js.js +1 -1
  25. package/package.json +3 -3
  26. package/src/DependencyInitializer.ts +44 -0
  27. package/src/DependencyListener.ts +13 -3
  28. package/src/__DynamicConstants.ts +5 -5
  29. package/src/ajax.ts +183 -106
  30. package/src/ajaxRecord.ts +5 -0
  31. package/src/applicationinsights-dependencies-js.ts +5 -1
  32. package/types/DependencyInitializer.d.ts +41 -0
  33. package/types/DependencyListener.d.ts +14 -3
  34. package/types/__DynamicConstants.d.ts +4 -4
  35. package/types/ajax.d.ts +18 -5
  36. package/types/ajaxRecord.d.ts +6 -0
  37. package/types/applicationinsights-dependencies-js.d.ts +2 -0
package/types/ajax.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { IConfig, ICorrelationConfig, IDependencyTelemetry } from "@microsoft/applicationinsights-common";
2
2
  import { BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain } from "@microsoft/applicationinsights-core-js";
3
+ import { DependencyInitializerFunction, IDependencyInitializerHandler } from "./DependencyInitializer";
3
4
  import { DependencyListenerFunction, IDependencyListenerContainer, IDependencyListenerHandler } from "./DependencyListener";
4
- import { _DYN_INCLUDE_CORRELATION_3 } from "./__DynamicConstants";
5
+ import { _DYN_INCLUDE_CORRELATION_2 } from "./__DynamicConstants";
5
6
  import { ajaxRecord } from "./ajaxRecord";
6
7
  export interface XMLHttpRequestInstrumented extends XMLHttpRequest {
7
8
  ajaxData: ajaxRecord;
@@ -15,12 +16,14 @@ export interface IDependenciesPlugin extends IDependencyListenerContainer {
15
16
  trackDependencyData(dependency: IDependencyTelemetry): void;
16
17
  }
17
18
  export interface IInstrumentationRequirements extends IDependenciesPlugin {
18
- [_DYN_INCLUDE_CORRELATION_3]: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
19
+ [_DYN_INCLUDE_CORRELATION_2]: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
19
20
  }
20
- export declare class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlugin, IInstrumentationRequirements {
21
+ declare function _getDefaultConfig(): ICorrelationConfig;
22
+ declare function _getEmptyConfig(): ICorrelationConfig;
23
+ export declare class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlugin, IInstrumentationRequirements, IDependencyListenerContainer {
21
24
  static identifier: string;
22
- static getDefaultConfig(): ICorrelationConfig;
23
- static getEmptyConfig(): ICorrelationConfig;
25
+ static getDefaultConfig: typeof _getDefaultConfig;
26
+ static getEmptyConfig: typeof _getEmptyConfig;
24
27
  identifier: string;
25
28
  priority: number;
26
29
  constructor();
@@ -41,6 +44,15 @@ export declare class AjaxMonitor extends BaseTelemetryPlugin implements IDepende
41
44
  * @returns - A IDependencyListenerHandler to enable the initializer to be removed
42
45
  */
43
46
  addDependencyListener(dependencyListener: DependencyListenerFunction): IDependencyListenerHandler;
47
+ /**
48
+ * Add an dependency telemetry initializer callback function to allow populating additional properties or drop the request.
49
+ * It is called after the dependency call has completed and any available performance details are available. A dependency
50
+ * initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency
51
+ * request so that it doesn't count against the `maxAjaxCallsPerView`.
52
+ * @param dependencyInitializer - The Dependency Telemetry Initializer function
53
+ * @returns - A IDependencyInitializerHandler to enable the initializer to be removed
54
+ */
55
+ addDependencyInitializer(dependencyInitializer: DependencyInitializerFunction): IDependencyInitializerHandler;
44
56
  /**
45
57
  * Protected function to allow sub classes the chance to add additional properties to the dependency event
46
58
  * before it's sent. This function calls track, so sub-classes must call this function after they have
@@ -53,3 +65,4 @@ export declare class AjaxMonitor extends BaseTelemetryPlugin implements IDepende
53
65
  [key: string]: any;
54
66
  }): void;
55
67
  }
68
+ export {};
@@ -63,6 +63,12 @@ export declare class ajaxRecord {
63
63
  * The trace context to use for reporting the remote dependency call
64
64
  */
65
65
  eventTraceCtx: ITraceCtx;
66
+ /**
67
+ * The listener assigned context values that will be passed to any dependency initializer
68
+ */
69
+ context?: {
70
+ [key: string]: any;
71
+ };
66
72
  constructor(traceId: string, spanId: string, logger: IDiagnosticLogger, traceCtx?: IDistributedTraceContext);
67
73
  getAbsoluteUrl(): string;
68
74
  getPathName(): string;
@@ -1,2 +1,4 @@
1
1
  export { AjaxMonitor as AjaxPlugin, IDependenciesPlugin, XMLHttpRequestInstrumented, IInstrumentationRequirements, DfltAjaxCorrelationHeaderExDomains } from "./ajax";
2
2
  export { ajaxRecord } from "./ajaxRecord";
3
+ export { IDependencyHandler, IDependencyListenerHandler, IDependencyListenerDetails, DependencyListenerFunction } from "./DependencyListener";
4
+ export { IDependencyInitializerHandler, IDependencyInitializerDetails, DependencyInitializerFunction } from "./DependencyInitializer";