@@ -31,10 +31,6 @@ export interface IEnvironmentInfoCollector {
31
31
export interface IErrorParser {
32
32
parse ( context : EventPluginContext , exception : Error ) : IError ;
33
33
}
34
- export interface IExitController {
35
- isApplicationExiting : boolean ;
36
- processExit ( config : Configuration ) : void ;
37
- }
38
34
export interface IModuleCollector {
39
35
getModules ( context : EventPluginContext ) : IModule [ ] ;
40
36
}
@@ -47,6 +43,9 @@ export interface IStorage<T> {
47
43
getList ( searchPattern ?: string , limit ?: number ) : IStorageItem < T > [ ] ;
48
44
remove ( path : string ) : void ;
49
45
}
46
+ export interface ISubmissionAdapter {
47
+ sendRequest ( request : SubmissionRequest , callback : SubmissionCallback ) : void ;
48
+ }
50
49
export interface ISubmissionClient {
51
50
postEvents ( events : IEvent [ ] , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
52
51
postUserDescription ( referenceId : string , description : IUserDescription , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
@@ -63,9 +62,9 @@ export interface IConfigurationSettings {
63
62
requestInfoCollector ?: IRequestInfoCollector ;
64
63
submissionBatchSize ?: number ;
65
64
submissionClient ?: ISubmissionClient ;
65
+ submissionAdapter ?: ISubmissionAdapter ;
66
66
storage ?: IStorage < any > ;
67
67
queue ?: IEventQueue ;
68
- exitController ?: IExitController ;
69
68
}
70
69
export declare class SettingsManager {
71
70
private static _configPath ;
@@ -138,10 +137,6 @@ export declare class DefaultEventQueue implements IEventQueue {
138
137
private isQueueProcessingSuspended ( ) ;
139
138
private areQueuedItemsDiscarded ( ) ;
140
139
}
141
- export declare class DefaultExitController implements IExitController {
142
- isApplicationExiting : boolean ;
143
- processExit ( config : Configuration ) : void ;
144
- }
145
140
export declare class InMemoryStorage < T > implements IStorage < T > {
146
141
private _items ;
147
142
private _maxItems ;
@@ -151,6 +146,14 @@ export declare class InMemoryStorage<T> implements IStorage<T> {
151
146
getList ( searchPattern ?: string , limit ?: number ) : IStorageItem < T > [ ] ;
152
147
remove ( path : string ) : void ;
153
148
}
149
+ export declare class DefaultSubmissionClient implements ISubmissionClient {
150
+ configurationVersionHeader : string ;
151
+ postEvents ( events : IEvent [ ] , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
152
+ postUserDescription ( referenceId : string , description : IUserDescription , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
153
+ getSettings ( config : Configuration , callback : ( response : SettingsResponse ) => void ) : void ;
154
+ private createRequest ( config , method , path , data ?) ;
155
+ private createSubmissionCallback ( config , callback ) ;
156
+ }
154
157
export declare class Utils {
155
158
static addRange < T > ( target : T [ ] , ...values : T [ ] ) : T [ ] ;
156
159
static getHashCode ( source : string ) : string ;
@@ -173,11 +176,11 @@ export declare class Configuration implements IConfigurationSettings {
173
176
moduleCollector : IModuleCollector ;
174
177
requestInfoCollector : IRequestInfoCollector ;
175
178
submissionBatchSize : number ;
179
+ submissionAdapter : ISubmissionAdapter ;
176
180
submissionClient : ISubmissionClient ;
177
181
settings : Object ;
178
182
storage : IStorage < Object > ;
179
183
queue : IEventQueue ;
180
- exitController : IExitController ;
181
184
constructor ( configSettings ?: IConfigurationSettings ) ;
182
185
private _apiKey ;
183
186
apiKey : string ;
@@ -392,6 +395,17 @@ export interface IStorageItem<T> {
392
395
path : string ;
393
396
value : T ;
394
397
}
398
+ export interface SubmissionCallback {
399
+ ( status : number , message : string , data ?: string , headers ?: Object ) : void ;
400
+ }
401
+ export interface SubmissionRequest {
402
+ serverUrl : string ;
403
+ apiKey : string ;
404
+ userAgent : string ;
405
+ method : string ;
406
+ path : string ;
407
+ data : string ;
408
+ }
395
409
export declare class SettingsResponse {
396
410
success : boolean ;
397
411
settings : any ;
@@ -413,10 +427,6 @@ export declare class DefaultModuleCollector implements IModuleCollector {
413
427
export declare class DefaultRequestInfoCollector implements IRequestInfoCollector {
414
428
getRequestInfo ( context : EventPluginContext ) : IRequestInfo ;
415
429
}
416
- export declare class DefaultSubmissionClient implements ISubmissionClient {
417
- configurationVersionHeader : string ;
418
- postEvents ( events : IEvent [ ] , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
419
- postUserDescription ( referenceId : string , description : IUserDescription , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
420
- getSettings ( config : Configuration , callback : ( response : SettingsResponse ) => void ) : void ;
421
- sendRequest ( config : Configuration , method : string , path : string , data : string , callback : ( status : number , message : string , data ?: string , headers ?: Object ) => void ) : void ;
430
+ export declare class DefaultSubmissionAdapter implements ISubmissionAdapter {
431
+ sendRequest ( request : SubmissionRequest , callback : SubmissionCallback ) : void ;
422
432
}
0 commit comments