@@ -28,17 +28,57 @@ export interface IEventQueue {
2828 process ( ) : any ;
2929 suspendProcessing ( durationInMinutes ?: number , discardFutureQueuedItems ?: boolean , clearQueue ?: boolean ) : any ;
3030}
31+ export interface IEnvironmentInfo {
32+ processor_count ?: number ;
33+ total_physical_memory ?: number ;
34+ available_physical_memory ?: number ;
35+ command_line ?: string ;
36+ process_name ?: string ;
37+ process_id ?: string ;
38+ process_memory_size ?: number ;
39+ thread_id ?: string ;
40+ architecture ?: string ;
41+ o_s_name ?: string ;
42+ o_s_version ?: string ;
43+ ip_address ?: string ;
44+ machine_name ?: string ;
45+ install_id ?: string ;
46+ runtime_version ?: string ;
47+ data ?: any ;
48+ }
49+ export declare class ContextData {
50+ setException ( exception : Error ) : void ;
51+ hasException : boolean ;
52+ getException ( ) : Error ;
53+ markAsUnhandledError ( ) : void ;
54+ isUnhandledError : boolean ;
55+ setSubmissionMethod ( method : string ) : void ;
56+ getSubmissionMethod ( ) : string ;
57+ }
58+ export interface IEnvironmentInfoCollector {
59+ getEnvironmentInfo ( context : EventPluginContext ) : IEnvironmentInfo ;
60+ }
61+ export interface IRequestInfoCollector {
62+ getRequestInfo ( context : EventPluginContext ) : IRequestInfo ;
63+ }
3164export interface IStorage < T > {
3265 save < T > ( path : string , value : T ) : boolean ;
3366 get ( searchPattern ?: string , limit ?: number ) : T [ ] ;
3467 clear ( searchPattern ?: string ) : any ;
3568 count ( searchPattern ?: string ) : number ;
3669}
70+ export interface ISubmissionClient {
71+ submit ( events : IEvent [ ] , config : Configuration ) : Promise < SubmissionResponse > ;
72+ submitDescription ( referenceId : string , description : IUserDescription , config : Configuration ) : Promise < SubmissionResponse > ;
73+ getSettings ( config : Configuration ) : Promise < SettingsResponse > ;
74+ }
3775export interface IConfigurationSettings {
3876 apiKey ?: string ;
3977 serverUrl ?: string ;
78+ environmentInfoCollector ?: IEnvironmentInfoCollector ;
4079 lastReferenceIdManager ?: ILastReferenceIdManager ;
4180 log ?: ILog ;
81+ requestInfoCollector ?: IRequestInfoCollector ;
4282 submissionBatchSize ?: number ;
4383 submissionClient ?: ISubmissionClient ;
4484 storage ?: IStorage < any > ;
@@ -107,11 +147,6 @@ export declare class InMemoryStorage<T> implements IStorage<T> {
107147 clear ( searchPattern ?: string ) : void ;
108148 count ( searchPattern ?: string ) : number ;
109149}
110- export interface ISubmissionClient {
111- submit ( events : IEvent [ ] , config : Configuration ) : Promise < SubmissionResponse > ;
112- submitDescription ( referenceId : string , description : IUserDescription , config : Configuration ) : Promise < SubmissionResponse > ;
113- getSettings ( config : Configuration ) : Promise < SettingsResponse > ;
114- }
115150export declare class Utils {
116151 static getHashCode ( source : string ) : string ;
117152 static guid ( ) : string ;
@@ -126,8 +161,10 @@ export declare class Configuration implements IConfigurationSettings {
126161 private _enabled ;
127162 private _serverUrl ;
128163 private _plugins ;
164+ environmentInfoCollector : IEnvironmentInfoCollector ;
129165 lastReferenceIdManager : ILastReferenceIdManager ;
130166 log : ILog ;
167+ requestInfoCollector : IRequestInfoCollector ;
131168 submissionBatchSize : any ;
132169 submissionClient : ISubmissionClient ;
133170 storage : IStorage < any > ;
@@ -149,40 +186,6 @@ export declare class Configuration implements IConfigurationSettings {
149186 private static _defaultSettings ;
150187 static defaults : IConfigurationSettings ;
151188}
152- export interface IUserDescription {
153- email_address ?: string ;
154- description ?: string ;
155- data ?: any ;
156- }
157- export declare class SettingsResponse {
158- success : boolean ;
159- settings : any ;
160- settingsVersion : number ;
161- message : string ;
162- exception : any ;
163- constructor ( success : boolean , settings : any , settingsVersion ?: number , exception ?: any , message ?: string ) ;
164- }
165- export declare class SubmissionResponse {
166- success : boolean ;
167- badRequest : boolean ;
168- serviceUnavailable : boolean ;
169- paymentRequired : boolean ;
170- unableToAuthenticate : boolean ;
171- notFound : boolean ;
172- requestEntityTooLarge : boolean ;
173- statusCode : number ;
174- message : string ;
175- constructor ( statusCode : number , message ?: string ) ;
176- }
177- export declare class ContextData {
178- setException ( exception : Error ) : void ;
179- hasException : boolean ;
180- getException ( ) : Error ;
181- markAsUnhandledError ( ) : void ;
182- isUnhandledError : boolean ;
183- setSubmissionMethod ( method : string ) : void ;
184- getSubmissionMethod ( ) : string ;
185- }
186189export declare class EventBuilder {
187190 target : IEvent ;
188191 client : ExceptionlessClient ;
@@ -315,25 +318,65 @@ export declare class RequestInfoPlugin implements IEventPlugin {
315318 priority : number ;
316319 name : string ;
317320 run ( context : EventPluginContext ) : Promise < any > ;
318- private getCookies ( ) ;
321+ }
322+ export declare class EnvironmentInfoPlugin implements IEventPlugin {
323+ priority : number ;
324+ name : string ;
325+ run ( context : EventPluginContext ) : Promise < any > ;
319326}
320327export declare class SubmissionMethodPlugin implements IEventPlugin {
321328 priority : number ;
322329 name : string ;
323330 run ( context : EventPluginContext ) : Promise < any > ;
324331}
332+ export interface IUserDescription {
333+ email_address ?: string ;
334+ description ?: string ;
335+ data ?: any ;
336+ }
337+ export declare class SettingsResponse {
338+ success : boolean ;
339+ settings : any ;
340+ settingsVersion : number ;
341+ message : string ;
342+ exception : any ;
343+ constructor ( success : boolean , settings : any , settingsVersion ?: number , exception ?: any , message ?: string ) ;
344+ }
345+ export declare class SubmissionResponse {
346+ success : boolean ;
347+ badRequest : boolean ;
348+ serviceUnavailable : boolean ;
349+ paymentRequired : boolean ;
350+ unableToAuthenticate : boolean ;
351+ notFound : boolean ;
352+ requestEntityTooLarge : boolean ;
353+ statusCode : number ;
354+ message : string ;
355+ constructor ( statusCode : number , message ?: string ) ;
356+ }
357+ export declare class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector {
358+ getEnvironmentInfo ( context : EventPluginContext ) : IEnvironmentInfo ;
359+ private getIpAddresses ( ) ;
360+ }
361+ export declare class NodeRequestInfoCollector implements IRequestInfoCollector {
362+ getRequestInfo ( context : EventPluginContext ) : IRequestInfo ;
363+ }
325364export declare class NodeSubmissionClient implements ISubmissionClient {
326365 submit ( events : IEvent [ ] , config : Configuration ) : Promise < SubmissionResponse > ;
327366 submitDescription ( referenceId : string , description : IUserDescription , config : Configuration ) : Promise < SubmissionResponse > ;
328367 getSettings ( config : Configuration ) : Promise < SettingsResponse > ;
329368 private getResponseMessage ( msg ) ;
330- private sendRequest ( method , host , path , data ?) ;
369+ private sendRequest ( method , host , path , apiKey , data ?) ;
331370}
332371export declare class NodeBootstrapper implements IBootstrapper {
333372 register ( ) : void ;
334373 private getExitCodeReason ( code ) ;
335374 private isNode ( ) ;
336375}
376+ export declare class WebRequestInfoCollector implements IRequestInfoCollector {
377+ getRequestInfo ( context : EventPluginContext ) : IRequestInfo ;
378+ private getCookies ( ) ;
379+ }
337380export declare class DefaultSubmissionClient implements ISubmissionClient {
338381 submit ( events : IEvent [ ] , config : Configuration ) : Promise < SubmissionResponse > ;
339382 submitDescription ( referenceId : string , description : IUserDescription , config : Configuration ) : Promise < SubmissionResponse > ;
@@ -347,28 +390,3 @@ export declare class WindowBootstrapper implements IBootstrapper {
347390 private getDefaultsSettingsFromScriptTag ( ) ;
348391 private handleWindowOnError ( ) ;
349392}
350- export interface IEnvironmentInfo {
351- processor_count ?: number ;
352- total_physical_memory ?: number ;
353- available_physical_memory ?: number ;
354- command_line ?: string ;
355- process_name ?: string ;
356- process_id ?: string ;
357- process_memory_size ?: number ;
358- thread_id ?: string ;
359- architecture ?: string ;
360- o_s_name ?: string ;
361- o_s_version ?: string ;
362- ip_address ?: string ;
363- machine_name ?: string ;
364- install_id ?: string ;
365- runtime_version ?: string ;
366- data ?: any ;
367- }
368- export interface IEnvironmentInfoCollector {
369- GetEnvironmentInfo ( ) : IEnvironmentInfo ;
370- }
371- export declare class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector {
372- GetEnvironmentInfo ( ) : IEnvironmentInfo ;
373- private getIpAddresses ( ) ;
374- }
0 commit comments