|
1 | 1 | import { ExceptionlessClient } from './ExceptionlessClient'; |
2 | 2 | import { IEvent } from './models/IEvent'; |
3 | 3 | import { IUserInfo } from './models/IUserInfo'; |
| 4 | +import { IManualStackingInfo } from './models/IManualStackingInfo'; |
4 | 5 | import { ContextData } from './plugins/ContextData'; |
5 | 6 | import { EventPluginContext } from './plugins/EventPluginContext'; |
6 | 7 | import { Utils } from './Utils'; |
@@ -111,14 +112,39 @@ export class EventBuilder { |
111 | 112 | return this; |
112 | 113 | } |
113 | 114 |
|
| 115 | + /** |
| 116 | + * Changes default stacking behavior by setting manual |
| 117 | + * stacking information. |
| 118 | + * @param signatureData A dictionary of strings to use for stacking. |
| 119 | + * @param title An optional title for the stacking information. |
| 120 | + * @returns {EventBuilder} |
| 121 | + */ |
| 122 | + public setManualStackingInfo(signatureData: any, title?: string) { |
| 123 | + if (signatureData) { |
| 124 | + let stack = <IManualStackingInfo>{ |
| 125 | + signature_data: signatureData |
| 126 | + }; |
| 127 | + if (title) { |
| 128 | + stack.title = title; |
| 129 | + } |
| 130 | + this.setProperty('@stack', stack); |
| 131 | + } |
| 132 | + |
| 133 | + return this; |
| 134 | + } |
| 135 | + |
114 | 136 | /** |
115 | 137 | * Changes default stacking behavior by setting the stacking key. |
116 | 138 | * @param manualStackingKey The manual stacking key. |
| 139 | + * @param title An optional title for the stacking information. |
117 | 140 | * @returns {EventBuilder} |
118 | 141 | */ |
119 | | - public setManualStackingKey(manualStackingKey: string): EventBuilder { |
| 142 | + public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder { |
120 | 143 | if (manualStackingKey) { |
121 | | - this.setProperty('@stack', manualStackingKey); |
| 144 | + let data = { |
| 145 | + 'ManualStackingKey': manualStackingKey |
| 146 | + }; |
| 147 | + this.setManualStackingInfo(data, title); |
122 | 148 | } |
123 | 149 |
|
124 | 150 | return this; |
|
0 commit comments