Skip to content

Commit

Permalink
Improved docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kugelschieber committed Jun 25, 2021
1 parent f76117c commit 8735217
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class Client {
*
* @param hit all required data for the request.
* @param retry retry the request in case a 401 (unauthenticated) error is returned. Don't modify this.
* @returns an empty promise or an APIError, in case something went wrong
* @returns APIError or an empty promise, in case something went wrong
*/
async hit(hit: Hit, retry: boolean = true): Promise<APIError | null> {
try {
Expand Down Expand Up @@ -146,7 +146,7 @@ export class Client {
* hitFromRequest returns the required data to send a hit to Pirsch for a Node request object.
*
* @param req the Node request object from the http package.
* @returns a Hit object containing all necessary fields.
* @returns Hit object containing all necessary fields.
*/
hitFromRequest(req: IncomingMessage): Hit {
const url = new URL(req.url || "", `${this.protocol}://${this.hostname}`);
Expand All @@ -167,7 +167,8 @@ export class Client {
/**
* domain returns the domain for this client.
*
* @returns the Domain object for this client.
* @param retry retry the request in case a 401 (unauthenticated) error is returned. Don't modify this.
* @returns Domain object for this client.
*/
async domain(retry: boolean = true): Promise<Domain | APIError> {
try {
Expand Down Expand Up @@ -201,6 +202,8 @@ export class Client {

/**
* sessionDuration returns the session duration grouped by day.
*
* @param filter used to filter the result set.
*/
async sessionDuration(filter: Filter): Promise<TimeSpentStats[] | APIError> {
return await this.performGet<TimeSpentStats[]>(sessionDurationEndpoint, filter);
Expand Down

0 comments on commit 8735217

Please sign in to comment.