@microsoft/applicationinsights-dependencies-js 2.8.4-nightly.2205-09 → 2.8.5-nightly.2206-02

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.24.0",
4
+ "toolVersion": "7.24.2",
5
5
  "schemaVersion": 1005,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -228,6 +228,54 @@
228
228
  "overloadIndex": 1,
229
229
  "parameters": []
230
230
  },
231
+ {
232
+ "kind": "Method",
233
+ "canonicalReference": "@microsoft/applicationinsights-dependencies-js!AjaxPlugin#addDependencyListener:member(1)",
234
+ "docComment": "/**\n * Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you to access the headers and modify the values used to generate the distributed tracing correlation headers.\n *\n * @param dependencyListener - The Telemetry Initializer function\n *\n * @returns - A IDependencyListenerHandler to enable the initializer to be removed\n */\n",
235
+ "excerptTokens": [
236
+ {
237
+ "kind": "Content",
238
+ "text": "addDependencyListener(dependencyListener: "
239
+ },
240
+ {
241
+ "kind": "Reference",
242
+ "text": "DependencyListenerFunction",
243
+ "canonicalReference": "@microsoft/applicationinsights-dependencies-js!DependencyListenerFunction:type"
244
+ },
245
+ {
246
+ "kind": "Content",
247
+ "text": "): "
248
+ },
249
+ {
250
+ "kind": "Reference",
251
+ "text": "IDependencyListenerHandler",
252
+ "canonicalReference": "@microsoft/applicationinsights-dependencies-js!IDependencyListenerHandler:interface"
253
+ },
254
+ {
255
+ "kind": "Content",
256
+ "text": ";"
257
+ }
258
+ ],
259
+ "isOptional": false,
260
+ "isStatic": false,
261
+ "returnTypeTokenRange": {
262
+ "startIndex": 3,
263
+ "endIndex": 4
264
+ },
265
+ "releaseTag": "Public",
266
+ "overloadIndex": 1,
267
+ "parameters": [
268
+ {
269
+ "parameterName": "dependencyListener",
270
+ "parameterTypeTokenRange": {
271
+ "startIndex": 1,
272
+ "endIndex": 2
273
+ },
274
+ "isOptional": false
275
+ }
276
+ ],
277
+ "name": "addDependencyListener"
278
+ },
231
279
  {
232
280
  "kind": "Method",
233
281
  "canonicalReference": "@microsoft/applicationinsights-dependencies-js!AjaxPlugin.getDefaultConfig:member(1)",
@@ -1673,6 +1721,33 @@
1673
1721
  },
1674
1722
  "isStatic": false
1675
1723
  },
1724
+ {
1725
+ "kind": "Property",
1726
+ "canonicalReference": "@microsoft/applicationinsights-dependencies-js!ajaxRecord#traceFlags:member",
1727
+ "docComment": "",
1728
+ "excerptTokens": [
1729
+ {
1730
+ "kind": "Content",
1731
+ "text": "traceFlags?: "
1732
+ },
1733
+ {
1734
+ "kind": "Content",
1735
+ "text": "number"
1736
+ },
1737
+ {
1738
+ "kind": "Content",
1739
+ "text": ";"
1740
+ }
1741
+ ],
1742
+ "isOptional": true,
1743
+ "releaseTag": "Public",
1744
+ "name": "traceFlags",
1745
+ "propertyTypeTokenRange": {
1746
+ "startIndex": 1,
1747
+ "endIndex": 2
1748
+ },
1749
+ "isStatic": false
1750
+ },
1676
1751
  {
1677
1752
  "kind": "Property",
1678
1753
  "canonicalReference": "@microsoft/applicationinsights-dependencies-js!ajaxRecord#traceID:member",
@@ -1738,7 +1813,16 @@
1738
1813
  "excerptTokens": [
1739
1814
  {
1740
1815
  "kind": "Content",
1741
- "text": "export interface IDependenciesPlugin "
1816
+ "text": "export interface IDependenciesPlugin extends "
1817
+ },
1818
+ {
1819
+ "kind": "Reference",
1820
+ "text": "IDependencyListenerContainer",
1821
+ "canonicalReference": "@microsoft/applicationinsights-dependencies-js!IDependencyListenerContainer:interface"
1822
+ },
1823
+ {
1824
+ "kind": "Content",
1825
+ "text": " "
1742
1826
  }
1743
1827
  ],
1744
1828
  "releaseTag": "Public",
@@ -1791,7 +1875,12 @@
1791
1875
  "name": "trackDependencyData"
1792
1876
  }
1793
1877
  ],
1794
- "extendsTokenRanges": []
1878
+ "extendsTokenRanges": [
1879
+ {
1880
+ "startIndex": 1,
1881
+ "endIndex": 2
1882
+ }
1883
+ ]
1795
1884
  },
1796
1885
  {
1797
1886
  "kind": "Interface",
@@ -19,6 +19,9 @@ import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
19
19
  // @public (undocumented)
20
20
  export class AjaxPlugin extends BaseTelemetryPlugin implements IDependenciesPlugin, IInstrumentationRequirements {
21
21
  constructor();
22
+ // Warning: (ae-forgotten-export) The symbol "DependencyListenerFunction" needs to be exported by the entry point applicationinsights-dependencies-js.d.ts
23
+ // Warning: (ae-forgotten-export) The symbol "IDependencyListenerHandler" needs to be exported by the entry point applicationinsights-dependencies-js.d.ts
24
+ addDependencyListener(dependencyListener: DependencyListenerFunction): IDependencyListenerHandler;
22
25
  // (undocumented)
23
26
  static getDefaultConfig(): ICorrelationConfig;
24
27
  // (undocumented)
@@ -105,6 +108,8 @@ export class ajaxRecord {
105
108
  // (undocumented)
106
109
  status: string | number;
107
110
  // (undocumented)
111
+ traceFlags?: number;
112
+ // (undocumented)
108
113
  traceID: string;
109
114
  // Warning: (ae-forgotten-export) The symbol "XHRMonitoringState" needs to be exported by the entry point applicationinsights-dependencies-js.d.ts
110
115
  //
@@ -112,8 +117,10 @@ export class ajaxRecord {
112
117
  xhrMonitoringState: XHRMonitoringState;
113
118
  }
114
119
 
120
+ // Warning: (ae-forgotten-export) The symbol "IDependencyListenerContainer" needs to be exported by the entry point applicationinsights-dependencies-js.d.ts
121
+ //
115
122
  // @public (undocumented)
116
- export interface IDependenciesPlugin {
123
+ export interface IDependenciesPlugin extends IDependencyListenerContainer {
117
124
  trackDependencyData(dependency: IDependencyTelemetry): void;
118
125
  }
119
126
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights XHR dependencies plugin, 2.8.4-nightly.2205-09
2
+ * Microsoft Application Insights XHR dependencies plugin, 2.8.5-nightly.2206-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -36,6 +36,13 @@ declare namespace ApplicationInsights {
36
36
  [key: string]: any;
37
37
  }): void;
38
38
  includeCorrelationHeaders(ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented): any;
39
+ /**
40
+ * Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you
41
+ * to access the headers and modify the values used to generate the distributed tracing correlation headers.
42
+ * @param dependencyListener - The Telemetry Initializer function
43
+ * @returns - A IDependencyListenerHandler to enable the initializer to be removed
44
+ */
45
+ addDependencyListener(dependencyListener: DependencyListenerFunction): IDependencyListenerHandler;
39
46
  /**
40
47
  * Protected function to allow sub classes the chance to add additional properties to the dependency event
41
48
  * before it's sent. This function calls track, so sub-classes must call this function after they have
@@ -76,12 +83,15 @@ declare namespace ApplicationInsights {
76
83
  clientFailure: number;
77
84
  traceID: string;
78
85
  spanID: string;
86
+ traceFlags?: number;
79
87
  constructor(traceID: string, spanID: string, logger: IDiagnosticLogger);
80
88
  getAbsoluteUrl(): string;
81
89
  getPathName(): string;
82
90
  CreateTrackItem(ajaxType: string, enableRequestHeaderTracking: boolean, getResponse: () => IAjaxRecordResponse): IDependencyTelemetry;
83
91
  }
84
92
 
93
+ type DependencyListenerFunction = (dependencyDetails: IDependencyListenerDetails) => void;
94
+
85
95
  interface IAjaxRecordResponse {
86
96
  statusText: string;
87
97
  headerMap: Object;
@@ -91,7 +101,7 @@ declare namespace ApplicationInsights {
91
101
  response?: Object;
92
102
  }
93
103
 
94
- interface IDependenciesPlugin {
104
+ interface IDependenciesPlugin extends IDependencyListenerContainer {
95
105
  /**
96
106
  * Logs dependency call
97
107
  * @param dependencyData dependency data object
@@ -99,6 +109,59 @@ declare namespace ApplicationInsights {
99
109
  trackDependencyData(dependency: IDependencyTelemetry): void;
100
110
  }
101
111
 
112
+ interface IDependencyListenerContainer {
113
+ /**
114
+ * Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you
115
+ * to access the headers and modify the values used to generate the distributed tracing correlation headers. (added in v2.8.4)
116
+ * @param dependencyListener - The Telemetry Initializer function
117
+ * @returns - A IDependencyListenerHandler to enable the initializer to be removed
118
+ */
119
+ addDependencyListener(dependencyListener: DependencyListenerFunction): IDependencyListenerHandler;
120
+ }
121
+
122
+ interface IDependencyListenerDetails {
123
+ /**
124
+ * The current core instance
125
+ */
126
+ core: IAppInsightsCore;
127
+ /**
128
+ * Provided only if the dependency request is an XHR call
129
+ */
130
+ xhr?: XMLHttpRequest;
131
+ /**
132
+ * Provided only if the dependency request is a fetch call, this is the input argument being used,
133
+ * re-assigning this value has not affect on the value used for the request, however, when this is a Request
134
+ * object changing the value of the Request will be used for the outbound request.
135
+ */
136
+ input?: Request | string;
137
+ /**
138
+ * Provided only if the dependency request is a fetch call, this is the init argument being used,
139
+ * re-assigning this value does not change the value used for the request, however, changing properties
140
+ * of this object will be used.
141
+ */
142
+ init?: RequestInit;
143
+ /**
144
+ * Returns the unique identifier for a trace. All requests / spans from the same trace share the same traceId.
145
+ * Must be read from incoming headers or generated according to the W3C TraceContext specification,
146
+ * in a hex representation of 16-byte array. A.k.a. trace-id, TraceID or Distributed TraceID
147
+ */
148
+ traceId?: string;
149
+ /**
150
+ * Self-generated 8-bytes identifier of the incoming request. Must be a hex representation of 8-byte array.
151
+ * Also know as the parentId, used to link requests together
152
+ */
153
+ spanId?: string;
154
+ /**
155
+ * An integer representation of the W3C TraceContext trace-flags.
156
+ * https://www.w3.org/TR/trace-context/#trace-flags
157
+ */
158
+ traceFlags?: number;
159
+ }
160
+
161
+ interface IDependencyListenerHandler {
162
+ remove(): void;
163
+ }
164
+
102
165
  interface IInstrumentationRequirements extends IDependenciesPlugin {
103
166
  includeCorrelationHeaders: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
104
167
  }