@microsoft/applicationinsights-web-basic 2.7.5-nightly.2203-01 → 2.7.5-nightly.2204-03

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.
@@ -9,17 +9,11 @@
9
9
  // @public (undocumented)
10
10
  export class AppInsightsCore extends BaseCore implements IAppInsightsCore {
11
11
  constructor();
12
- // Warning: (ae-forgotten-export) The symbol "INotificationListener" needs to be exported by the entry point index.d.ts
13
- addNotificationListener(listener: INotificationListener): void;
14
- // Warning: (ae-forgotten-export) The symbol "IPlugin" needs to be exported by the entry point index.d.ts
15
12
  // Warning: (ae-forgotten-export) The symbol "IDiagnosticLogger" needs to be exported by the entry point index.d.ts
16
13
  // Warning: (ae-forgotten-export) The symbol "INotificationManager" needs to be exported by the entry point index.d.ts
17
14
  //
18
15
  // (undocumented)
19
16
  initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
20
- pollInternalLogs(eventName?: string): number;
21
- removeNotificationListener(listener: INotificationListener): void;
22
- stopPollingInternalLogs(): void;
23
17
  // (undocumented)
24
18
  track(telemetryItem: ITelemetryItem): void;
25
19
  }
@@ -27,32 +21,222 @@ export class AppInsightsCore extends BaseCore implements IAppInsightsCore {
27
21
  // @public
28
22
  export class ApplicationInsights {
29
23
  constructor(config: IConfiguration & IConfig);
24
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
25
+ // Warning: (ae-forgotten-export) The symbol "UnloadHandler" needs to be exported by the entry point index.d.ts
26
+ addUnloadCb(handler: UnloadHandler): void;
30
27
  // Warning: (ae-forgotten-export) The symbol "IConfig" needs to be exported by the entry point index.d.ts
31
28
  //
32
29
  // (undocumented)
33
30
  config: IConfiguration & IConfig;
31
+ evtNamespace(): string;
34
32
  flush(async?: boolean): void;
33
+ getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
34
+ // (undocumented)
35
+ getSKUDefaults(): void;
35
36
  initialize(): void;
36
37
  // (undocumented)
38
+ pollInternalLogs(): void;
39
+ // (undocumented)
37
40
  stopPollingInternalLogs(): void;
38
41
  track(item: ITelemetryItem): void;
42
+ unload(isAsync?: boolean, unloadComplete?: () => void): void;
39
43
  }
40
44
 
45
+ // @public
46
+ export function arrForEach<T = any>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => undefined | void | number, thisArg?: any): void;
47
+
41
48
  // Warning: (ae-forgotten-export) The symbol "ICoreUtils" needs to be exported by the entry point index.d.ts
42
49
  //
43
50
  // @public @deprecated
44
51
  export const CoreUtils: ICoreUtils;
45
52
 
53
+ // @public (undocumented)
54
+ export const enum _eInternalMessageId {
55
+ // (undocumented)
56
+ BrowserCannotReadLocalStorage = 1,
57
+ // (undocumented)
58
+ BrowserCannotReadSessionStorage = 2,
59
+ // (undocumented)
60
+ BrowserCannotWriteLocalStorage = 3,
61
+ // (undocumented)
62
+ BrowserCannotWriteSessionStorage = 4,
63
+ // (undocumented)
64
+ BrowserDoesNotSupportLocalStorage = 0,
65
+ // (undocumented)
66
+ BrowserFailedRemovalFromLocalStorage = 5,
67
+ // (undocumented)
68
+ BrowserFailedRemovalFromSessionStorage = 6,
69
+ // (undocumented)
70
+ CannotAccessCookie = 68,
71
+ // (undocumented)
72
+ CannotParseAiBlobValue = 101,
73
+ // (undocumented)
74
+ CannotSendEmptyTelemetry = 7,
75
+ // (undocumented)
76
+ CannotSerializeObject = 48,
77
+ // (undocumented)
78
+ CannotSerializeObjectNonSerializable = 49,
79
+ // (undocumented)
80
+ CircularReferenceDetected = 50,
81
+ // (undocumented)
82
+ ClearAuthContextFailed = 51,
83
+ // (undocumented)
84
+ ClientPerformanceMathError = 8,
85
+ // (undocumented)
86
+ CreateEnvelopeError = 47,
87
+ // (undocumented)
88
+ ErrorParsingAISessionCookie = 9,
89
+ // (undocumented)
90
+ ErrorPVCalc = 10,
91
+ // (undocumented)
92
+ ExceptionTruncated = 52,
93
+ // (undocumented)
94
+ ExceptionWhileLoggingError = 11,
95
+ // (undocumented)
96
+ FailedAddingCustomDefinedRequestContext = 104,
97
+ // (undocumented)
98
+ FailedAddingTelemetryToBuffer = 12,
99
+ // (undocumented)
100
+ FailedMonitorAjaxAbort = 13,
101
+ // (undocumented)
102
+ FailedMonitorAjaxDur = 14,
103
+ // (undocumented)
104
+ FailedMonitorAjaxGetCorrelationHeader = 18,
105
+ // (undocumented)
106
+ FailedMonitorAjaxOpen = 15,
107
+ // (undocumented)
108
+ FailedMonitorAjaxRSC = 16,
109
+ // (undocumented)
110
+ FailedMonitorAjaxSend = 17,
111
+ // (undocumented)
112
+ FailedMonitorAjaxSetRequestHeader = 71,
113
+ // (undocumented)
114
+ FailedToAddHandlerForOnBeforeUnload = 19,
115
+ // (undocumented)
116
+ FailedToFixDepricatedValues = 44,
117
+ // (undocumented)
118
+ FailedToReportDataLoss = 21,
119
+ // (undocumented)
120
+ FailedToRestoreStorageBuffer = 42,
121
+ // (undocumented)
122
+ FailedToSendQueuedTelemetry = 20,
123
+ // (undocumented)
124
+ FailedToSetStorageBuffer = 41,
125
+ // (undocumented)
126
+ FlushFailed = 22,
127
+ // (undocumented)
128
+ IdTooLong = 69,
129
+ // (undocumented)
130
+ IllegalCharsInName = 53,
131
+ // (undocumented)
132
+ InMemoryStorageBufferFull = 105,
133
+ // (undocumented)
134
+ InvalidBackendResponse = 43,
135
+ // (undocumented)
136
+ InvalidContentBlob = 102,
137
+ // (undocumented)
138
+ InvalidDurationValue = 45,
139
+ // (undocumented)
140
+ InvalidEvent = 70,
141
+ // (undocumented)
142
+ InvalidInstrumentationKey = 100,
143
+ // (undocumented)
144
+ ItemNotInArray = 54,
145
+ // (undocumented)
146
+ MaxAjaxPerPVExceeded = 55,
147
+ // (undocumented)
148
+ MessageLimitPerPVExceeded = 23,
149
+ // (undocumented)
150
+ MessageTruncated = 56,
151
+ // (undocumented)
152
+ MissingRequiredFieldSpecification = 24,
153
+ // (undocumented)
154
+ NameTooLong = 57,
155
+ // (undocumented)
156
+ NavigationTimingNotSupported = 25,
157
+ // (undocumented)
158
+ NotificationException = 74,
159
+ // (undocumented)
160
+ OnError = 26,
161
+ // (undocumented)
162
+ PluginException = 73,
163
+ // (undocumented)
164
+ SampleRateOutOfRange = 58,
165
+ // (undocumented)
166
+ SendBrowserInfoOnUserInit = 72,
167
+ // (undocumented)
168
+ SenderNotInitialized = 28,
169
+ // (undocumented)
170
+ SessionRenewalDateIsZero = 27,
171
+ // (undocumented)
172
+ SessionStorageBufferFull = 67,
173
+ // (undocumented)
174
+ SetAuthContextFailed = 59,
175
+ // (undocumented)
176
+ SetAuthContextFailedAccountName = 60,
177
+ // (undocumented)
178
+ SnippetScriptLoadFailure = 99,
179
+ // (undocumented)
180
+ StartCalledMoreThanOnce = 62,
181
+ // (undocumented)
182
+ StartTrackEventFailed = 29,
183
+ // (undocumented)
184
+ StartTrackFailed = 31,
185
+ // (undocumented)
186
+ StopCalledWithoutStart = 63,
187
+ // (undocumented)
188
+ StopTrackEventFailed = 30,
189
+ // (undocumented)
190
+ StopTrackFailed = 32,
191
+ // (undocumented)
192
+ StringValueTooLong = 61,
193
+ // (undocumented)
194
+ TelemetryEnvelopeInvalid = 46,
195
+ // (undocumented)
196
+ TelemetryInitializerFailed = 64,
197
+ // (undocumented)
198
+ TelemetrySampledAndNotSent = 33,
199
+ // (undocumented)
200
+ TrackArgumentsNotSpecified = 65,
201
+ // (undocumented)
202
+ TrackEventFailed = 34,
203
+ // (undocumented)
204
+ TrackExceptionFailed = 35,
205
+ // (undocumented)
206
+ TrackMetricFailed = 36,
207
+ // (undocumented)
208
+ TrackPageActionEventFailed = 103,
209
+ // (undocumented)
210
+ TrackPVFailed = 37,
211
+ // (undocumented)
212
+ TrackPVFailedCalc = 38,
213
+ // (undocumented)
214
+ TrackTraceFailed = 39,
215
+ // (undocumented)
216
+ TransmissionFailed = 40,
217
+ // (undocumented)
218
+ UrlTooLong = 66
219
+ }
220
+
46
221
  // Warning: (ae-forgotten-export) The symbol "IPerfManagerProvider" needs to be exported by the entry point index.d.ts
47
222
  //
48
223
  // @public (undocumented)
49
224
  export interface IAppInsightsCore extends IPerfManagerProvider {
225
+ // Warning: (ae-forgotten-export) The symbol "INotificationListener" needs to be exported by the entry point index.d.ts
50
226
  addNotificationListener?(listener: INotificationListener): void;
227
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
228
+ // Warning: (ae-forgotten-export) The symbol "TelemetryInitializerFunction" needs to be exported by the entry point index.d.ts
229
+ // Warning: (ae-forgotten-export) The symbol "ITelemetryInitializerHandler" needs to be exported by the entry point index.d.ts
230
+ addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
231
+ addUnloadCb(handler: UnloadHandler): void;
51
232
  // (undocumented)
52
233
  config: IConfiguration;
234
+ evtNamespace(): string;
235
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
53
236
  // Warning: (ae-forgotten-export) The symbol "ICookieMgr" needs to be exported by the entry point index.d.ts
54
237
  getCookieMgr(): ICookieMgr;
55
238
  getNotifyMgr(): INotificationManager;
239
+ getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
56
240
  // Warning: (ae-forgotten-export) The symbol "IProcessTelemetryContext" needs to be exported by the entry point index.d.ts
57
241
  getProcessTelContext(): IProcessTelemetryContext;
58
242
  // Warning: (ae-forgotten-export) The symbol "IChannelControls" needs to be exported by the entry point index.d.ts
@@ -72,6 +256,8 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
72
256
  stopPollingInternalLogs?(): void;
73
257
  // (undocumented)
74
258
  track(telemetryItem: ITelemetryItem): void;
259
+ // Warning: (ae-forgotten-export) The symbol "ITelemetryUnloadState" needs to be exported by the entry point index.d.ts
260
+ unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
75
261
  }
76
262
 
77
263
  // @public
@@ -110,7 +296,6 @@ export interface IConfiguration {
110
296
  extensionConfig?: {
111
297
  [key: string]: any;
112
298
  };
113
- // Warning: (ae-forgotten-export) The symbol "ITelemetryPlugin" needs to be exported by the entry point index.d.ts
114
299
  extensions?: ITelemetryPlugin[];
115
300
  idLength?: number;
116
301
  instrumentationKey?: string;
@@ -154,6 +339,16 @@ export interface IEventTelemetry extends IPartC {
154
339
  name: string;
155
340
  }
156
341
 
342
+ // @public (undocumented)
343
+ export interface ILoadedPlugin<T extends IPlugin> {
344
+ isEnabled: () => boolean;
345
+ // (undocumented)
346
+ plugin: T;
347
+ // (undocumented)
348
+ remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void;
349
+ setEnabled: (isEnabled: boolean) => void;
350
+ }
351
+
157
352
  // @public (undocumented)
158
353
  export interface IMetricTelemetry extends IPartC {
159
354
  average: number;
@@ -165,6 +360,95 @@ export interface IMetricTelemetry extends IPartC {
165
360
  stdDev?: number;
166
361
  }
167
362
 
363
+ // @public
364
+ export const _InternalMessageId: {
365
+ BrowserDoesNotSupportLocalStorage: number;
366
+ BrowserCannotReadLocalStorage: number;
367
+ BrowserCannotReadSessionStorage: number;
368
+ BrowserCannotWriteLocalStorage: number;
369
+ BrowserCannotWriteSessionStorage: number;
370
+ BrowserFailedRemovalFromLocalStorage: number;
371
+ BrowserFailedRemovalFromSessionStorage: number;
372
+ CannotSendEmptyTelemetry: number;
373
+ ClientPerformanceMathError: number;
374
+ ErrorParsingAISessionCookie: number;
375
+ ErrorPVCalc: number;
376
+ ExceptionWhileLoggingError: number;
377
+ FailedAddingTelemetryToBuffer: number;
378
+ FailedMonitorAjaxAbort: number;
379
+ FailedMonitorAjaxDur: number;
380
+ FailedMonitorAjaxOpen: number;
381
+ FailedMonitorAjaxRSC: number;
382
+ FailedMonitorAjaxSend: number;
383
+ FailedMonitorAjaxGetCorrelationHeader: number;
384
+ FailedToAddHandlerForOnBeforeUnload: number;
385
+ FailedToSendQueuedTelemetry: number;
386
+ FailedToReportDataLoss: number;
387
+ FlushFailed: number;
388
+ MessageLimitPerPVExceeded: number;
389
+ MissingRequiredFieldSpecification: number;
390
+ NavigationTimingNotSupported: number;
391
+ OnError: number;
392
+ SessionRenewalDateIsZero: number;
393
+ SenderNotInitialized: number;
394
+ StartTrackEventFailed: number;
395
+ StopTrackEventFailed: number;
396
+ StartTrackFailed: number;
397
+ StopTrackFailed: number;
398
+ TelemetrySampledAndNotSent: number;
399
+ TrackEventFailed: number;
400
+ TrackExceptionFailed: number;
401
+ TrackMetricFailed: number;
402
+ TrackPVFailed: number;
403
+ TrackPVFailedCalc: number;
404
+ TrackTraceFailed: number;
405
+ TransmissionFailed: number;
406
+ FailedToSetStorageBuffer: number;
407
+ FailedToRestoreStorageBuffer: number;
408
+ InvalidBackendResponse: number;
409
+ FailedToFixDepricatedValues: number;
410
+ InvalidDurationValue: number;
411
+ TelemetryEnvelopeInvalid: number;
412
+ CreateEnvelopeError: number;
413
+ CannotSerializeObject: number;
414
+ CannotSerializeObjectNonSerializable: number;
415
+ CircularReferenceDetected: number;
416
+ ClearAuthContextFailed: number;
417
+ ExceptionTruncated: number;
418
+ IllegalCharsInName: number;
419
+ ItemNotInArray: number;
420
+ MaxAjaxPerPVExceeded: number;
421
+ MessageTruncated: number;
422
+ NameTooLong: number;
423
+ SampleRateOutOfRange: number;
424
+ SetAuthContextFailed: number;
425
+ SetAuthContextFailedAccountName: number;
426
+ StringValueTooLong: number;
427
+ StartCalledMoreThanOnce: number;
428
+ StopCalledWithoutStart: number;
429
+ TelemetryInitializerFailed: number;
430
+ TrackArgumentsNotSpecified: number;
431
+ UrlTooLong: number;
432
+ SessionStorageBufferFull: number;
433
+ CannotAccessCookie: number;
434
+ IdTooLong: number;
435
+ InvalidEvent: number;
436
+ FailedMonitorAjaxSetRequestHeader: number;
437
+ SendBrowserInfoOnUserInit: number;
438
+ PluginException: number;
439
+ NotificationException: number;
440
+ SnippetScriptLoadFailure: number;
441
+ InvalidInstrumentationKey: number;
442
+ CannotParseAiBlobValue: number;
443
+ InvalidContentBlob: number;
444
+ TrackPageActionEventFailed: number;
445
+ FailedAddingCustomDefinedRequestContext: number;
446
+ InMemoryStorageBufferFull: number;
447
+ };
448
+
449
+ // @public (undocumented)
450
+ export type _InternalMessageId = number | _eInternalMessageId;
451
+
168
452
  // @public (undocumented)
169
453
  export interface IPageViewPerformanceTelemetry extends IPartC {
170
454
  domProcessing?: string;
@@ -191,6 +475,20 @@ export interface IPageViewTelemetry extends IPartC {
191
475
  uri?: string;
192
476
  }
193
477
 
478
+ // @public (undocumented)
479
+ export interface IPlugin {
480
+ readonly identifier: string;
481
+ // Warning: (ae-forgotten-export) The symbol "ITelemetryPluginChain" needs to be exported by the entry point index.d.ts
482
+ initialize: (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) => void;
483
+ isInitialized?: () => boolean;
484
+ // Warning: (ae-forgotten-export) The symbol "IProcessTelemetryUnloadContext" needs to be exported by the entry point index.d.ts
485
+ teardown?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
486
+ readonly version?: string;
487
+ }
488
+
489
+ // @public (undocumented)
490
+ export function isNullOrUndefined(value: any): value is null | undefined;
491
+
194
492
  // @public
195
493
  export interface ITelemetryItem {
196
494
  baseData?: {
@@ -210,6 +508,14 @@ export interface ITelemetryItem {
210
508
  ver?: string;
211
509
  }
212
510
 
511
+ // Warning: (ae-forgotten-export) The symbol "ITelemetryProcessor" needs to be exported by the entry point index.d.ts
512
+ //
513
+ // @public
514
+ export interface ITelemetryPlugin extends ITelemetryProcessor, IPlugin {
515
+ readonly priority: number;
516
+ setNextPlugin?: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
517
+ }
518
+
213
519
  // @public (undocumented)
214
520
  export interface ITraceTelemetry extends IPartC {
215
521
  iKey?: string;
@@ -217,6 +523,9 @@ export interface ITraceTelemetry extends IPartC {
217
523
  severityLevel?: SeverityLevel;
218
524
  }
219
525
 
526
+ // @public
527
+ export function proxyFunctions<T, S>(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget?: boolean): T;
528
+
220
529
  // Warning: (ae-forgotten-export) The symbol "BaseTelemetryPlugin" needs to be exported by the entry point index.d.ts
221
530
  // Warning: (ae-forgotten-export) The symbol "IChannelControlsAI" needs to be exported by the entry point index.d.ts
222
531
  //
@@ -234,8 +543,6 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
234
543
  flush(): void;
235
544
  // (undocumented)
236
545
  readonly identifier: string;
237
- // Warning: (ae-forgotten-export) The symbol "ITelemetryPluginChain" needs to be exported by the entry point index.d.ts
238
- //
239
546
  // (undocumented)
240
547
  initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
241
548
  _onError(payload: string[], message: string, event?: ErrorEvent): void;
@@ -257,15 +564,26 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
257
564
  _sender: SenderFunction;
258
565
  // Warning: (ae-forgotten-export) The symbol "ISenderConfig" needs to be exported by the entry point index.d.ts
259
566
  readonly _senderConfig: ISenderConfig;
260
- // (undocumented)
261
- teardown(): void;
262
- // Warning: (ae-forgotten-export) The symbol "SendRequestReason" needs to be exported by the entry point index.d.ts
263
567
  triggerSend(async?: boolean, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void;
264
568
  // Warning: (ae-forgotten-export) The symbol "XDomainRequest" needs to be exported by the entry point index.d.ts
265
569
  _xdrOnLoad(xdr: XDomainRequest, payload: string[]): void;
266
570
  _xhrReadyStateChange(xhr: XMLHttpRequest, payload: string[], countOfItemsInPayload: number): void;
267
571
  }
268
572
 
573
+ // @public
574
+ export const enum SendRequestReason {
575
+ ManualFlush = 1,
576
+ MaxBatchSize = 10,
577
+ MaxQueuedEvents = 20,
578
+ NormalSchedule = 1,
579
+ Resumed = 4,
580
+ Retry = 5,
581
+ SdkUnload = 6,
582
+ SyncEvent = 3,
583
+ Undefined = 0,
584
+ Unload = 2
585
+ }
586
+
269
587
  // @public
270
588
  export enum SeverityLevel {
271
589
  // (undocumented)
@@ -280,6 +598,9 @@ export enum SeverityLevel {
280
598
  Warning = 2
281
599
  }
282
600
 
601
+ // @public (undocumented)
602
+ export function throwError(message: string): never;
603
+
283
604
  // (No @packageDocumentation comment for this package)
284
605
 
285
606
  ```