@@ -6,35 +6,35 @@ import { EventPluginContext } from './plugins/EventPluginContext';
66import { Utils } from './Utils' ;
77
88export class EventBuilder {
9- public target :IEvent ;
10- public client :ExceptionlessClient ;
11- public pluginContextData :ContextData ;
9+ public target : IEvent ;
10+ public client : ExceptionlessClient ;
11+ public pluginContextData : ContextData ;
1212
13- private _validIdentifierErrorMessage :string = 'must contain between 8 and 100 alphanumeric or \'-\' characters.' ; // optimization for minifier.
13+ private _validIdentifierErrorMessage : string = 'must contain between 8 and 100 alphanumeric or \'-\' characters.' ; // optimization for minifier.
1414
15- constructor ( event :IEvent , client :ExceptionlessClient , pluginContextData ?:ContextData ) {
15+ constructor ( event : IEvent , client : ExceptionlessClient , pluginContextData ?: ContextData ) {
1616 this . target = event ;
1717 this . client = client ;
1818 this . pluginContextData = pluginContextData || new ContextData ( ) ;
1919 }
2020
21- public setType ( type :string ) : EventBuilder {
21+ public setType ( type : string ) : EventBuilder {
2222 if ( ! ! type ) {
2323 this . target . type = type ;
2424 }
2525
2626 return this ;
2727 }
2828
29- public setSource ( source :string ) : EventBuilder {
29+ public setSource ( source : string ) : EventBuilder {
3030 if ( ! ! source ) {
3131 this . target . source = source ;
3232 }
3333
3434 return this ;
3535 }
3636
37- public setSessionId ( sessionId :string ) : EventBuilder {
37+ public setSessionId ( sessionId : string ) : EventBuilder {
3838 if ( ! this . isValidIdentifier ( sessionId ) ) {
3939 throw new Error ( `SessionId ${ this . _validIdentifierErrorMessage } ` ) ;
4040 }
@@ -43,7 +43,7 @@ export class EventBuilder {
4343 return this ;
4444 }
4545
46- public setReferenceId ( referenceId :string ) : EventBuilder {
46+ public setReferenceId ( referenceId : string ) : EventBuilder {
4747 if ( ! this . isValidIdentifier ( referenceId ) ) {
4848 throw new Error ( `ReferenceId ${ this . _validIdentifierErrorMessage } ` ) ;
4949 }
@@ -52,7 +52,7 @@ export class EventBuilder {
5252 return this ;
5353 }
5454
55- public setMessage ( message :string ) : EventBuilder {
55+ public setMessage ( message : string ) : EventBuilder {
5656 if ( ! ! message ) {
5757 this . target . message = message ;
5858 }
@@ -73,10 +73,10 @@ export class EventBuilder {
7373 return this ;
7474 }
7575
76- public setUserIdentity ( userInfo :IUserInfo ) : EventBuilder ;
77- public setUserIdentity ( identity :string ) : EventBuilder ;
78- public setUserIdentity ( identity :string , name :string ) : EventBuilder ;
79- public setUserIdentity ( userInfoOrIdentity :IUserInfo | string , name ?:string ) : EventBuilder {
76+ public setUserIdentity ( userInfo : IUserInfo ) : EventBuilder ;
77+ public setUserIdentity ( identity : string ) : EventBuilder ;
78+ public setUserIdentity ( identity : string , name : string ) : EventBuilder ;
79+ public setUserIdentity ( userInfoOrIdentity : IUserInfo | string , name ?: string ) : EventBuilder {
8080 let userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity : userInfoOrIdentity , name : name } ;
8181 if ( ! userInfo || ( ! userInfo . identity && ! userInfo . name ) ) {
8282 return this ;
@@ -86,15 +86,15 @@ export class EventBuilder {
8686 return this ;
8787 }
8888
89- public setValue ( value :number ) : EventBuilder {
89+ public setValue ( value : number ) : EventBuilder {
9090 if ( ! ! value ) {
9191 this . target . value = value ;
9292 }
9393
9494 return this ;
9595 }
9696
97- public addTags ( ...tags :string [ ] ) : EventBuilder {
97+ public addTags ( ...tags : string [ ] ) : EventBuilder {
9898 this . target . tags = Utils . addRange < string > ( this . target . tags , ...tags ) ;
9999 return this ;
100100 }
@@ -107,7 +107,7 @@ export class EventBuilder {
107107 * @param maxDepth The max depth of the object to include.
108108 * @param excludedPropertyNames Any property names that should be excluded.
109109 */
110- public setProperty ( name :string , value :any , maxDepth ?:number , excludedPropertyNames ?:string [ ] ) : EventBuilder {
110+ public setProperty ( name : string , value : any , maxDepth ?: number , excludedPropertyNames ?: string [ ] ) : EventBuilder {
111111 if ( ! name || ( value === undefined || value == null ) ) {
112112 return this ;
113113 }
@@ -124,27 +124,27 @@ export class EventBuilder {
124124 return this ;
125125 }
126126
127- public markAsCritical ( critical :boolean ) : EventBuilder {
127+ public markAsCritical ( critical : boolean ) : EventBuilder {
128128 if ( critical ) {
129129 this . addTags ( 'Critical' ) ;
130130 }
131131
132132 return this ;
133133 }
134134
135- public addRequestInfo ( request :Object ) : EventBuilder {
135+ public addRequestInfo ( request : Object ) : EventBuilder {
136136 if ( ! ! request ) {
137137 this . pluginContextData [ '@request' ] = request ;
138138 }
139139
140140 return this ;
141141 }
142142
143- public submit ( callback ?:( context :EventPluginContext ) => void ) : void {
143+ public submit ( callback ?: ( context : EventPluginContext ) => void ) : void {
144144 this . client . submitEvent ( this . target , this . pluginContextData , callback ) ;
145145 }
146146
147- private isValidIdentifier ( value :string ) : boolean {
147+ private isValidIdentifier ( value : string ) : boolean {
148148 if ( ! value ) {
149149 return true ;
150150 }
0 commit comments