Skip to content

Commit 7780f76

Browse files
committed
Merge pull request #48 from exceptionless/feature/heartbeats
Updated the javascript client to call the new heartbeats api
2 parents 18a36d0 + 569f575 commit 7780f76

32 files changed

+444
-546
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.3.{build}
1+
version: 1.4.{build}
22

33
install:
44
- ps: Install-Product node 5

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "exceptionless",
3-
"version": "1.3.2",
3+
"version": "1.4.0",
44
"description": "JavaScript client for Exceptionless",
55
"license": "Apache-2.0",
66
"main": "dist/exceptionless.js",

dist/exceptionless.d.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ export interface IStorageProvider {
4141
settings: IStorage;
4242
}
4343
export interface ISubmissionAdapter {
44-
sendRequest(request: SubmissionRequest, callback: SubmissionCallback, isAppExiting?: boolean): void;
44+
sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;
4545
}
4646
export interface ISubmissionClient {
4747
postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;
4848
postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;
4949
getSettings(config: Configuration, callback: (response: SettingsResponse) => void): void;
50+
sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void;
5051
}
5152
export interface IConfigurationSettings {
5253
apiKey?: string;
5354
serverUrl?: string;
55+
heartbeatServerUrl?: string;
5456
environmentInfoCollector?: IEnvironmentInfoCollector;
5557
errorParser?: IErrorParser;
5658
lastReferenceIdManager?: ILastReferenceIdManager;
@@ -114,8 +116,9 @@ export declare class EventPluginManager {
114116
export declare class HeartbeatPlugin implements IEventPlugin {
115117
priority: number;
116118
name: string;
119+
private _heartbeatInterval;
117120
private _heartbeatIntervalId;
118-
private _lastUser;
121+
constructor(heartbeatInterval?: number);
119122
run(context: EventPluginContext, next?: () => void): void;
120123
}
121124
export declare class ReferenceIdPlugin implements IEventPlugin {
@@ -150,7 +153,8 @@ export declare class DefaultSubmissionClient implements ISubmissionClient {
150153
postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;
151154
postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;
152155
getSettings(config: Configuration, callback: (response: SettingsResponse) => void): void;
153-
private createRequest(config, method, path, data?);
156+
sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void;
157+
private createRequest(config, method, url, data?);
154158
private createSubmissionCallback(config, callback);
155159
}
156160
export declare class Utils {
@@ -190,6 +194,8 @@ export declare class Configuration implements IConfigurationSettings {
190194
isValid: boolean;
191195
private _serverUrl;
192196
serverUrl: string;
197+
private _heartbeatServerUrl;
198+
heartbeatServerUrl: string;
193199
private _dataExclusions;
194200
private _userAgentBotPatterns;
195201
dataExclusions: string[];
@@ -206,7 +212,7 @@ export declare class Configuration implements IConfigurationSettings {
206212
setUserIdentity(identity: string): void;
207213
setUserIdentity(identity: string, name: string): void;
208214
userAgent: string;
209-
useSessions(sendHeartbeats?: boolean): void;
215+
useSessions(sendHeartbeats?: boolean, heartbeatInterval?: number): void;
210216
useReferenceIds(): void;
211217
useLocalStorage(): void;
212218
useDebugLogger(): void;
@@ -286,10 +292,8 @@ export declare class ExceptionlessClient {
286292
submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void;
287293
createSessionStart(): EventBuilder;
288294
submitSessionStart(callback?: (context: EventPluginContext) => void): void;
289-
createSessionEnd(): EventBuilder;
290-
submitSessionEnd(callback?: (context: EventPluginContext) => void): void;
291-
createSessionHeartbeat(): EventBuilder;
292-
submitSessionHeartbeat(callback?: (context: EventPluginContext) => void): void;
295+
submitSessionEnd(sessionIdOrUserId: string): void;
296+
submitSessionHeartbeat(sessionIdOrUserId: string): void;
293297
createEvent(pluginContextData?: ContextData): EventBuilder;
294298
submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void;
295299
updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void): void;
@@ -427,11 +431,10 @@ export interface SubmissionCallback {
427431
(status: number, message: string, data?: string, headers?: Object): void;
428432
}
429433
export interface SubmissionRequest {
430-
serverUrl: string;
431434
apiKey: string;
432435
userAgent: string;
433436
method: string;
434-
path: string;
437+
url: string;
435438
data: string;
436439
}
437440
export declare class SettingsResponse {
@@ -496,7 +499,7 @@ export declare class DefaultRequestInfoCollector implements IRequestInfoCollecto
496499
getRequestInfo(context: EventPluginContext): IRequestInfo;
497500
}
498501
export declare class DefaultSubmissionAdapter implements ISubmissionAdapter {
499-
sendRequest(request: SubmissionRequest, callback: SubmissionCallback, isAppExiting?: boolean): void;
502+
sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;
500503
}
501504
export declare class BrowserStorageProvider implements IStorageProvider {
502505
queue: IStorage;

0 commit comments

Comments
 (0)