@@ -31,10 +31,6 @@ export interface IEnvironmentInfoCollector {
3131export interface IErrorParser {
3232 parse ( context : EventPluginContext , exception : Error ) : IError ;
3333}
34- export interface IExitController {
35- isApplicationExiting : boolean ;
36- processExit ( config : Configuration ) : void ;
37- }
3834export interface IModuleCollector {
3935 getModules ( context : EventPluginContext ) : IModule [ ] ;
4036}
@@ -47,6 +43,9 @@ export interface IStorage<T> {
4743 getList ( searchPattern ?: string , limit ?: number ) : IStorageItem < T > [ ] ;
4844 remove ( path : string ) : void ;
4945}
46+ export interface ISubmissionAdapter {
47+ sendRequest ( request : SubmissionRequest , callback : SubmissionCallback ) : void ;
48+ }
5049export interface ISubmissionClient {
5150 postEvents ( events : IEvent [ ] , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
5251 postUserDescription ( referenceId : string , description : IUserDescription , config : Configuration , callback : ( response : SubmissionResponse ) => void ) : void ;
@@ -63,9 +62,9 @@ export interface IConfigurationSettings {
6362 requestInfoCollector ?: IRequestInfoCollector ;
6463 submissionBatchSize ?: number ;
6564 submissionClient ?: ISubmissionClient ;
65+ submissionAdapter ?: ISubmissionAdapter ;
6666 storage ?: IStorage < any > ;
6767 queue ?: IEventQueue ;
68- exitController ?: IExitController ;
6968}
7069export declare class SettingsManager {
7170 private static _configPath ;
@@ -138,10 +137,6 @@ export declare class DefaultEventQueue implements IEventQueue {
138137 private isQueueProcessingSuspended ( ) ;
139138 private areQueuedItemsDiscarded ( ) ;
140139}
141- export declare class DefaultExitController implements IExitController {
142- isApplicationExiting : boolean ;
143- processExit ( config : Configuration ) : void ;
144- }
145140export declare class InMemoryStorage < T > implements IStorage < T > {
146141 private _items ;
147142 private _maxItems ;
@@ -151,6 +146,14 @@ export declare class InMemoryStorage<T> implements IStorage<T> {
151146 getList ( searchPattern ?: string , limit ?: number ) : IStorageItem < T > [ ] ;
152147 remove ( path : string ) : void ;
153148}
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+ }
154157export declare class Utils {
155158 static addRange < T > ( target : T [ ] , ...values : T [ ] ) : T [ ] ;
156159 static getHashCode ( source : string ) : string ;
@@ -173,11 +176,11 @@ export declare class Configuration implements IConfigurationSettings {
173176 moduleCollector : IModuleCollector ;
174177 requestInfoCollector : IRequestInfoCollector ;
175178 submissionBatchSize : number ;
179+ submissionAdapter : ISubmissionAdapter ;
176180 submissionClient : ISubmissionClient ;
177181 settings : Object ;
178182 storage : IStorage < Object > ;
179183 queue : IEventQueue ;
180- exitController : IExitController ;
181184 constructor ( configSettings ?: IConfigurationSettings ) ;
182185 private _apiKey ;
183186 apiKey : string ;
@@ -392,6 +395,17 @@ export interface IStorageItem<T> {
392395 path : string ;
393396 value : T ;
394397}
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+ }
395409export declare class SettingsResponse {
396410 success : boolean ;
397411 settings : any ;
@@ -413,10 +427,6 @@ export declare class DefaultModuleCollector implements IModuleCollector {
413427export declare class DefaultRequestInfoCollector implements IRequestInfoCollector {
414428 getRequestInfo ( context : EventPluginContext ) : IRequestInfo ;
415429}
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 ;
422432}
0 commit comments