All files / src types.ts

100% Statements 7/7
100% Branches 4/4
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100    9x 9x 9x 9x     9x 9x 9x                                                                                                                                                                                  
import { components, paths } from './generatedApiTypes'
 
export enum Region {
  EU = 'EU',
  AP = 'AP',
  Global = 'Global',
}
 
export enum AuthenticationMode {
  AuthHeader = 'AuthHeader',
  QueryParameter = 'QueryParameter',
}
 
/**
 * Options for FingerprintJS server API client
 */
export interface Options {
  /**
   * Secret API key
   */
  apiKey: string
  /**
   * Region of the FingerprintJS service server
   */
  region?: Region
  /**
   * Authentication mode
   * Optional, default value is AuthHeader
   */
  authenticationMode?: AuthenticationMode
 
  /**
   * Optional fetch implementation
   * */
  fetch?: typeof fetch
}
 
/**
 * More info: https://dev.fingerprintjs.com/docs/server-api#query-parameters
 */
export type VisitorHistoryFilter = paths['/visitors/{visitor_id}']['get']['parameters']['query']
 
export type TooManyRequestsError = {
  status: 429
  /**
   * How many seconds to wait before retrying
   */
  retryAfter: number
}
 
/**
 * More info: https://dev.fingerprintjs.com/docs/server-api#response
 */
export type VisitorsResponse = paths['/visitors/{visitor_id}']['get']['responses']['200']['content']['application/json']
export type VisitorsResponse403 =
  paths['/visitors/{visitor_id}']['get']['responses']['403']['content']['application/json'] & {
    status: 403
  }
export type VisitorsResponse429 =
  paths['/visitors/{visitor_id}']['get']['responses']['429']['content']['application/json']
 
export type DeleteVisit404Response =
  paths['/visitors/{visitor_id}']['delete']['responses']['404']['content']['application/json']
 
export type DeleteVisit403Response =
  paths['/visitors/{visitor_id}']['delete']['responses']['403']['content']['application/json']
 
export type DeleteVisit400Response =
  paths['/visitors/{visitor_id}']['delete']['responses']['400']['content']['application/json'] & {
    status: 400
  }
 
export type CommonResponse429 = components['schemas']['ErrorCommon429Response']
 
export type VisitorsError = WithResponse<VisitorsResponse403 | VisitorsResponse429>
 
export type EventResponse = paths['/events/{request_id}']['get']['responses']['200']['content']['application/json']
export type EventResponse403 = paths['/events/{request_id}']['get']['responses']['403']['content']['application/json']
export type EventResponse404 = paths['/events/{request_id}']['get']['responses']['404']['content']['application/json']
 
export type UpdateEventResponse400 =
  paths['/events/{request_id}']['put']['responses']['400']['content']['application/json']
export type UpdateEventResponse403 =
  paths['/events/{request_id}']['put']['responses']['403']['content']['application/json']
export type UpdateEventResponse404 =
  paths['/events/{request_id}']['put']['responses']['404']['content']['application/json']
export type UpdateEventResponse409 =
  paths['/events/{request_id}']['put']['responses']['409']['content']['application/json']
 
type WithResponse<T> = T & {
  response: Response
}
 
/**
 * More info: https://dev.fingerprintjs.com/docs/webhooks#identification-webhook-object-format
 */
export type VisitWebhook = components['schemas']['WebhookVisit']
 
export type EventUpdateRequest = components['schemas']['EventUpdateRequest']