Skip to content

Commit f27dfe6

Browse files
committed
Merge pull request #39 from exceptionless/feature/sessions
Added support for sessions
2 parents b0ad802 + ea4285b commit f27dfe6

25 files changed

+306
-99
lines changed

.vscode/launch.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
"sourceMaps": true,
1616
"outDir": "dist"
1717
},
18+
{
19+
"name": "Express",
20+
"request": "launch",
21+
"type": "node",
22+
"program": "example/express/app.js",
23+
"runtimeArgs": [
24+
"--nolazy"
25+
],
26+
"sourceMaps": true,
27+
"outDir": "dist"
28+
},
1829
{
1930
"name": "Attach",
2031
"request": "attach",
@@ -24,4 +35,4 @@
2435
"outDir": "dist"
2536
}
2637
]
27-
}
38+
}

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Exceptionless.JavaScript
2-
[![Build status](https://img.shields.io/appveyor/ci/Exceptionless/exceptionless-javascript.svg)](https://ci.appveyor.com/project/Exceptionless/exceptionless-javascript) [![Gitter](https://img.shields.io/badge/gitter-join_chat-brightgreen.svg)](https://gitter.im/exceptionless/Discuss)
2+
[![Build status](https://img.shields.io/appveyor/ci/Exceptionless/exceptionless-javascript.svg)](https://ci.appveyor.com/project/Exceptionless/exceptionless-javascript) [![Gitter](https://img.shields.io/badge/gitter-join_chat-brightgreen.svg)](https://gitter.im/exceptionless/Discuss)
33
[![NPM version](https://img.shields.io/npm/v/exceptionless.svg)](https://www.npmjs.org/package/exceptionless)
44
[![Bower version](https://img.shields.io/bower/v/exceptionless.svg)](http://bower.io/search/?q=exceptionless)
5-
[![Donate](https://img.shields.io/badge/donorbox-donate-blue.svg)](https://donorbox.org/exceptionless)
5+
[![Donate](https://img.shields.io/badge/donorbox-donate-blue.svg)](https://donorbox.org/exceptionless)
66

77
The definition of the word exceptionless is: to be without exception. Exceptionless.js provides real-time error reporting for your JavaScript applications in the browser or in Node.js. It organizes the gathered information into simple actionable data that will help your app become exceptionless!
88

99
## Show me the code! ##
1010

1111
```html
12-
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.2.0/dist/exceptionless.min.js"></script>
12+
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.3.0/dist/exceptionless.min.js"></script>
1313
<script>
1414
var client = exceptionless.ExceptionlessClient.default;
1515
client.config.apiKey = 'API_KEY_HERE';
@@ -48,7 +48,7 @@ Use one of the following methods to install Exceptionless.js into your browser a
4848
Add the following script to your page:
4949

5050
```html
51-
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.2.0/dist/exceptionless.min.js"></script>
51+
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.3.0/dist/exceptionless.min.js"></script>
5252
```
5353

5454
- **Bower:**

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.2.{build}
1+
version: 1.3.{build}
22

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

bower.json

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

dist/exceptionless.d.ts

+16-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export interface IEvent {
88
value?: number;
99
data?: any;
1010
reference_id?: string;
11-
session_id?: string;
1211
}
1312
export interface ILastReferenceIdManager {
1413
getLast(): string;
@@ -54,6 +53,7 @@ export interface ISubmissionClient {
5453
export interface IConfigurationSettings {
5554
apiKey?: string;
5655
serverUrl?: string;
56+
enableSessions?: boolean;
5757
environmentInfoCollector?: IEnvironmentInfoCollector;
5858
errorParser?: IErrorParser;
5959
lastReferenceIdManager?: ILastReferenceIdManager;
@@ -115,6 +115,13 @@ export declare class EventPluginManager {
115115
static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void;
116116
static addDefaultPlugins(config: Configuration): void;
117117
}
118+
export declare class HeartbeatPlugin implements IEventPlugin {
119+
priority: number;
120+
name: string;
121+
private _heartbeatIntervalId;
122+
private _lastUser;
123+
run(context: EventPluginContext, next?: () => void): void;
124+
}
118125
export declare class ReferenceIdPlugin implements IEventPlugin {
119126
priority: number;
120127
name: string;
@@ -204,6 +211,7 @@ export declare class Configuration implements IConfigurationSettings {
204211
setUserIdentity(identity: string): void;
205212
setUserIdentity(identity: string, name: string): void;
206213
userAgent: string;
214+
useSessions(sendHeartbeats?: boolean): void;
207215
useReferenceIds(): void;
208216
useDebugLogger(): void;
209217
static defaults: IConfigurationSettings;
@@ -216,8 +224,8 @@ export declare class EventBuilder {
216224
constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData);
217225
setType(type: string): EventBuilder;
218226
setSource(source: string): EventBuilder;
219-
setSessionId(sessionId: string): EventBuilder;
220227
setReferenceId(referenceId: string): EventBuilder;
228+
setEventReference(name: string, id: string): EventBuilder;
221229
setMessage(message: string): EventBuilder;
222230
setGeo(latitude: number, longitude: number): EventBuilder;
223231
setUserIdentity(userInfo: IUserInfo): EventBuilder;
@@ -277,10 +285,12 @@ export declare class ExceptionlessClient {
277285
submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void;
278286
createNotFound(resource: string): EventBuilder;
279287
submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void;
280-
createSessionStart(sessionId: string): EventBuilder;
281-
submitSessionStart(sessionId: string, callback?: (context: EventPluginContext) => void): void;
282-
createSessionEnd(sessionId: string): EventBuilder;
283-
submitSessionEnd(sessionId: string, callback?: (context: EventPluginContext) => void): void;
288+
createSessionStart(): EventBuilder;
289+
submitSessionStart(callback?: (context: EventPluginContext) => void): void;
290+
createSessionEnd(): EventBuilder;
291+
submitSessionEnd(callback?: (context: EventPluginContext) => void): void;
292+
createSessionHeartbeat(): EventBuilder;
293+
submitSessionHeartbeat(callback?: (context: EventPluginContext) => void): void;
284294
createEvent(pluginContextData?: ContextData): EventBuilder;
285295
submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void;
286296
updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void): void;

dist/exceptionless.js

+72-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)