vairified 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +399 -0
- package/dist/index.cjs +1042 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1015 -0
- package/dist/index.d.ts +1015 -0
- package/dist/index.js +994 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/models.ts","../src/oauth.ts","../src/client.ts"],"sourcesContent":["/**\n * Vairified JavaScript SDK\n *\n * Official TypeScript/JavaScript SDK for the Vairified Partner API.\n *\n * Features:\n * - Opaque external IDs (vair_mem_xxx format) for privacy\n * - OAuth-based player consent for data access\n * - Tiered access: public search vs connected member data\n *\n * @packageDocumentation\n * @module vairified\n */\n\nexport { Vairified, type VairifiedEnvironment } from './client.js';\nexport {\n AuthenticationError,\n NotFoundError,\n OAuthError,\n RateLimitError,\n VairifiedError,\n ValidationError,\n} from './errors.js';\nexport {\n Match,\n MatchResult,\n Member,\n Player,\n RatingSplit,\n RatingSplits,\n RatingUpdate,\n SearchResults,\n} from './models.js';\nexport {\n type AuthorizationResponse,\n DEFAULT_SCOPES,\n describeScope,\n describeScopes,\n generateState,\n getAuthorizationUrl,\n type OAuthConfig,\n type OAuthScope,\n SCOPES,\n type TokenResponse,\n validateScope,\n} from './oauth.js';\nexport type {\n MatchApiData,\n MatchInput,\n MatchResultData,\n MemberData,\n PlayerSearchData,\n RatingSplitData,\n RatingSplitsData,\n RatingUpdateData,\n SearchFilters,\n SearchResultsData,\n VairifiedOptions,\n} from './types.js';\n","/**\n * Vairified SDK Errors\n *\n * @module\n */\n\n/**\n * Base error class for Vairified SDK errors.\n *\n * @category Errors\n */\nexport class VairifiedError extends Error {\n /** HTTP status code */\n statusCode?: number;\n /** Response body */\n response?: unknown;\n\n constructor(message: string, statusCode?: number, response?: unknown) {\n super(message);\n this.name = 'VairifiedError';\n this.statusCode = statusCode;\n this.response = response;\n }\n}\n\n/**\n * Error thrown when API rate limit is exceeded.\n *\n * @category Errors\n */\nexport class RateLimitError extends VairifiedError {\n /** Seconds to wait before retrying */\n retryAfter?: number;\n\n constructor(message = 'Rate limit exceeded', retryAfter?: number, response?: unknown) {\n super(message, 429, response);\n this.name = 'RateLimitError';\n this.retryAfter = retryAfter;\n }\n}\n\n/**\n * Error thrown when API key is invalid or missing.\n *\n * @category Errors\n */\nexport class AuthenticationError extends VairifiedError {\n constructor(message = 'Invalid API key', response?: unknown) {\n super(message, 401, response);\n this.name = 'AuthenticationError';\n }\n}\n\n/**\n * Error thrown when a requested resource is not found.\n *\n * @category Errors\n */\nexport class NotFoundError extends VairifiedError {\n constructor(message = 'Resource not found', response?: unknown) {\n super(message, 404, response);\n this.name = 'NotFoundError';\n }\n}\n\n/**\n * Error thrown when request validation fails.\n *\n * @category Errors\n */\nexport class ValidationError extends VairifiedError {\n constructor(message = 'Validation error', response?: unknown) {\n super(message, 400, response);\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Error thrown when an OAuth operation fails.\n *\n * This can occur during authorization, token exchange, refresh, or revocation.\n *\n * @category Errors\n */\nexport class OAuthError extends VairifiedError {\n /** OAuth error code (e.g., 'invalid_grant', 'expired_token') */\n errorCode?: string;\n\n constructor(message = 'OAuth error', errorCode?: string, response?: unknown) {\n super(message, undefined, response);\n this.name = 'OAuthError';\n this.errorCode = errorCode;\n }\n}\n","/**\n * Vairified SDK Models\n *\n * Rich model classes with methods for easy API interaction.\n *\n * @module\n */\n\nimport type { Vairified } from './client.js';\nimport type {\n MatchApiData,\n MatchInput,\n MatchResultData,\n MemberData,\n PlayerSearchData,\n RatingSplitData,\n RatingSplitsData,\n RatingUpdateData,\n SearchFilters,\n SearchResultsData,\n} from './types.js';\n\n/** Union type for player data from different endpoints */\ntype PlayerData = MemberData | PlayerSearchData;\n\n/**\n * A single rating split with metadata.\n *\n * @category Models\n */\nexport class RatingSplit {\n /** The rating value */\n readonly rating: number;\n /** Abbreviation (e.g., \"VG\", \"50+\") */\n readonly abbr: string;\n /** Date of last match in this category */\n readonly datePlayed?: string;\n\n constructor(data: RatingSplitData | number) {\n if (typeof data === 'number') {\n this.rating = data;\n this.abbr = '';\n } else {\n const ratingVal = data.rating;\n this.rating = typeof ratingVal === 'string' ? Number.parseFloat(ratingVal) || 0 : ratingVal;\n this.abbr = data.abbr;\n this.datePlayed = data.date_played;\n }\n }\n}\n\n/**\n * Rating breakdown by category.\n *\n * Access ratings by category name or use convenience properties.\n *\n * @category Models\n */\nexport class RatingSplits {\n /** Map of category names to rating splits */\n readonly splits: Map<string, RatingSplit>;\n\n constructor(data?: RatingSplitsData) {\n this.splits = new Map();\n if (data) {\n for (const [key, value] of Object.entries(data)) {\n this.splits.set(key, new RatingSplit(value));\n }\n }\n }\n\n /** Get rating for a category */\n get(category: string): number | undefined {\n return this.splits.get(category)?.rating;\n }\n\n /** Open division rating */\n get open(): number | undefined {\n return this.get('open') ?? this.get('VO');\n }\n\n /** Gender-specific rating (same gender doubles) */\n get gender(): number | undefined {\n return this.get('gender') ?? this.get('VG');\n }\n\n /** Mixed doubles rating */\n get mixed(): number | undefined {\n return this.get('mixed') ?? this.get('VM');\n }\n\n /** Recreational rating */\n get recreational(): number | undefined {\n return this.get('recreational') ?? this.get('R');\n }\n\n /** Singles rating */\n get singles(): number | undefined {\n return this.get('singles') ?? this.get('S');\n }\n\n /** Best available verified rating */\n get best(): number | undefined {\n const ratings = Array.from(this.splits.values())\n .map((s) => s.rating)\n .filter((r) => r > 0);\n return ratings.length > 0 ? Math.max(...ratings) : undefined;\n }\n\n /** Convert to plain object */\n toJSON(): Record<string, { rating: number; abbr: string }> {\n const result: Record<string, { rating: number; abbr: string }> = {};\n for (const [key, split] of this.splits) {\n result[key] = { rating: split.rating, abbr: split.abbr };\n }\n return result;\n }\n}\n\n/**\n * Check if data is from search endpoint (has displayName)\n */\nfunction isSearchData(data: PlayerData): data is PlayerSearchData {\n return 'displayName' in data;\n}\n\n/**\n * A player in the Vairified system.\n *\n * From public search, only limited data is available (display name, location, rating).\n * For full profile data, use getMember() with OAuth consent.\n *\n * @category Models\n */\nexport class Player {\n /** External player ID (vair_mem_xxx format) */\n readonly id: string;\n /** Display name (First Name + Last Initial from search) */\n readonly displayName?: string;\n /** First name (only from connected member) */\n readonly firstName?: string;\n /** Last name (only from connected member) */\n readonly lastName?: string;\n /** Primary/overall rating (2.0-8.0) */\n readonly rating: number;\n /** Whether player is verified */\n readonly isVairified: boolean;\n /** Whether player has connected to your app */\n readonly isConnected: boolean;\n /** Ratings by category (only from connected member) */\n readonly ratingSplits: RatingSplits;\n /** City */\n readonly city?: string;\n /** State code */\n readonly state?: string;\n /** Country code */\n readonly country?: string;\n\n protected _client?: Vairified;\n\n constructor(data: PlayerData, client?: Vairified) {\n if (isSearchData(data)) {\n // Search format (limited data)\n this.id = data.id;\n this.displayName = data.displayName;\n this.rating = data.rating ?? 0;\n this.isVairified = data.isVairified ?? false;\n this.isConnected = data.isConnected ?? false;\n this.ratingSplits = new RatingSplits();\n } else {\n // Member format (full data)\n this.id = data.id;\n this.firstName = data.firstName ?? '';\n this.lastName = data.lastName ?? '';\n this.rating = data.rating ?? 0;\n this.isVairified = data.isVairified ?? false;\n this.isConnected = true; // If we have member data, they're connected\n this.ratingSplits = new RatingSplits(data.ratingSplits);\n }\n\n this.city = data.city;\n this.state = data.state;\n this.country = data.country;\n this._client = client;\n }\n\n /** Full name (or display name if full name not available) */\n get name(): string {\n if (this.firstName && this.lastName) {\n return `${this.firstName} ${this.lastName}`.trim();\n }\n return this.displayName ?? '';\n }\n\n /** Best verified rating */\n get verifiedRating(): number | undefined {\n return this.ratingSplits.best;\n }\n\n toString(): string {\n const verified = this.isVairified ? ' ✓' : '';\n return `${this.name} (${this.rating.toFixed(2)})${verified}`;\n }\n}\n\n/**\n * A member with full profile access (requires OAuth connection).\n *\n * Only accessible for players who have connected their account via OAuth.\n *\n * @category Models\n */\nexport class Member extends Player {\n /** Email address (only if profile:email scope granted) */\n readonly email?: string;\n /** Scopes the player granted to your app */\n readonly grantedScopes: string[];\n\n constructor(data: MemberData, client?: Vairified) {\n super(data, client);\n this.email = data.email;\n this.grantedScopes = data.grantedScopes ?? [];\n }\n\n /** Check if the player has granted a specific scope */\n hasScope(scope: string): boolean {\n return this.grantedScopes.includes(scope);\n }\n\n /** Refresh member data from API */\n async refresh(): Promise<Member> {\n if (!this._client) {\n throw new Error('Member not connected to client');\n }\n const updated = await this._client.getMember(this.id);\n Object.assign(this, updated);\n return this;\n }\n}\n\n/**\n * Generate a unique identifier for matches.\n */\nfunction generateId(): string {\n return `SDK-${Math.random().toString(36).substring(2, 14)}`;\n}\n\n/**\n * A match to submit to the Vairified Partner API.\n *\n * @category Models\n *\n * @example\n * ```ts\n * // Doubles match: 11-9, 11-7\n * const match = new Match({\n * event: 'Weekly League',\n * bracket: '4.0 Doubles',\n * date: new Date(),\n * team1: ['player1_id', 'player2_id'],\n * team2: ['player3_id', 'player4_id'],\n * scores: [[11, 9], [11, 7]],\n * });\n *\n * // Singles match: 11-8, 9-11, 11-6\n * const match = new Match({\n * event: 'Club Singles',\n * bracket: 'Open Singles',\n * date: new Date(),\n * team1: ['player1_id'],\n * team2: ['player2_id'],\n * scores: [[11, 8], [9, 11], [11, 6]],\n * });\n * ```\n */\nexport class Match {\n /** Event/tournament name */\n readonly event: string;\n /** Bracket/division name */\n readonly bracket: string;\n /** Match date */\n readonly date: Date;\n /** Team 1 player IDs */\n readonly team1: readonly string[];\n /** Team 2 player IDs */\n readonly team2: readonly string[];\n /** Game scores */\n readonly scores: readonly [number, number][];\n /** Match type */\n readonly matchType: string;\n /** Match source */\n readonly source: string;\n /** Location */\n readonly location?: string;\n /** Unique identifier */\n readonly identifier: string;\n /** Match ID (set after submission) */\n id?: string;\n\n constructor(data: MatchInput) {\n this.event = data.event;\n this.bracket = data.bracket;\n this.date = data.date instanceof Date ? data.date : new Date(data.date);\n this.team1 = data.team1;\n this.team2 = data.team2;\n this.scores = data.scores;\n this.matchType = data.matchType ?? 'SIDEOUT';\n this.source = data.source ?? 'PARTNER';\n this.location = data.location;\n this.identifier = data.identifier ?? generateId();\n }\n\n /** Match format: SINGLES or DOUBLES */\n get format(): 'SINGLES' | 'DOUBLES' {\n return this.team1.length === 1 ? 'SINGLES' : 'DOUBLES';\n }\n\n /** Team that won (1 or 2). Returns 0 if tie. */\n get winner(): 0 | 1 | 2 {\n let t1Wins = 0;\n let t2Wins = 0;\n for (const [s1, s2] of this.scores) {\n if (s1 > s2) t1Wins++;\n else if (s2 > s1) t2Wins++;\n }\n if (t1Wins > t2Wins) return 1;\n if (t2Wins > t1Wins) return 2;\n return 0;\n }\n\n /** Score summary like \"11-9, 11-7\" */\n get scoreSummary(): string {\n return this.scores.map(([s1, s2]) => `${s1}-${s2}`).join(', ');\n }\n\n /** Convert to API request format */\n toJSON(): MatchApiData {\n const player1A = this.team1[0];\n const player1B = this.team2[0];\n if (!player1A || !player1B) {\n throw new Error('Match must have at least one player per team');\n }\n\n const teamA: MatchApiData['teamA'] = { player1: player1A };\n const teamB: MatchApiData['teamB'] = { player1: player1B };\n\n if (this.team1[1]) teamA.player2 = this.team1[1];\n if (this.team2[1]) teamB.player2 = this.team2[1];\n\n // Add game scores to teams\n const gameKeys = ['game1', 'game2', 'game3', 'game4', 'game5'] as const;\n for (let i = 0; i < Math.min(this.scores.length, 5); i++) {\n const score = this.scores[i];\n const key = gameKeys[i];\n if (score && key) {\n teamA[key] = score[0];\n teamB[key] = score[1];\n }\n }\n\n return {\n identifier: this.identifier,\n bracket: this.bracket,\n event: this.event,\n format: this.format,\n matchDate: this.date.toISOString(),\n matchSource: this.source,\n matchType: this.matchType,\n location: this.location,\n teamA,\n teamB,\n };\n }\n}\n\n/**\n * Result of a match submission.\n *\n * @category Models\n */\nexport class MatchResult {\n /** Whether submission succeeded */\n readonly success: boolean;\n /** Number of matches processed */\n readonly numMatches: number;\n /** Number of games recorded */\n readonly numGames: number;\n /** Whether this was a dry-run (validation only) */\n readonly dryRun: boolean;\n /** Human-readable result message */\n readonly message?: string;\n /** List of validation/processing errors */\n readonly errors: string[];\n\n constructor(data: MatchResultData) {\n this.success = data.success;\n this.numMatches = data.numMatches;\n this.numGames = data.numGames;\n this.dryRun = data.dryRun ?? false;\n this.message = data.message;\n this.errors = data.errors ?? [];\n }\n\n /** Alias for dryRun */\n get isDryRun(): boolean {\n return this.dryRun;\n }\n\n /** Returns true if submission succeeded without errors */\n get ok(): boolean {\n return this.success && this.errors.length === 0;\n }\n}\n\n/**\n * A rating change notification.\n *\n * @category Models\n */\nexport class RatingUpdate {\n /** External player ID (vair_mem_xxx format) */\n readonly id: string;\n /** Member name */\n readonly memberName?: string;\n /** Previous rating */\n readonly previousRating: number;\n /** New rating */\n readonly newRating: number;\n /** When the change occurred */\n readonly changedAt: Date;\n /** Updated rating splits */\n readonly ratingSplits: RatingSplits;\n\n private _client?: Vairified;\n\n constructor(data: RatingUpdateData, client?: Vairified) {\n this.id = data.id;\n this.memberName = data.memberName;\n this.previousRating = data.previousRating ?? 0;\n this.newRating = data.newRating ?? 0;\n this.changedAt = data.changedAt ? new Date(data.changedAt) : new Date();\n this.ratingSplits = new RatingSplits(data.ratingSplits);\n this._client = client;\n }\n\n /** Amount of rating change */\n get change(): number {\n return this.newRating - this.previousRating;\n }\n\n /** Whether rating improved */\n get improved(): boolean {\n return this.change > 0;\n }\n\n /** Fetch the member associated with this update */\n async getMember(): Promise<Member> {\n if (!this._client) {\n throw new Error('Update not connected to client');\n }\n return this._client.getMember(this.id);\n }\n\n toString(): string {\n const direction = this.improved ? '↑' : '↓';\n const name = this.memberName ? ` (${this.memberName})` : '';\n return `${this.id}${name}: ${this.previousRating.toFixed(2)} ${direction} ${this.newRating.toFixed(2)}`;\n }\n}\n\n/**\n * Paginated search results.\n *\n * @category Models\n */\nexport class SearchResults implements Iterable<Player> {\n /** List of players */\n readonly players: Player[];\n /** Total matching players */\n readonly total: number;\n /** Current page */\n readonly page: number;\n /** Results per page */\n readonly limit: number;\n\n private _client?: Vairified;\n private _filters: SearchFilters;\n\n constructor(data: SearchResultsData, client?: Vairified, filters: SearchFilters = {}) {\n this.players = data.players.map((p) => new Player(p, client));\n this.total = data.total;\n this.page = data.page;\n this.limit = data.limit;\n this._client = client;\n this._filters = filters;\n }\n\n /** Whether more results are available */\n get hasMore(): boolean {\n return this.page * this.limit < this.total;\n }\n\n /** Total number of pages */\n get pages(): number {\n return this.limit > 0 ? Math.ceil(this.total / this.limit) : 0;\n }\n\n /** Number of players in current page */\n get length(): number {\n return this.players.length;\n }\n\n /** Get player by index */\n at(index: number): Player | undefined {\n return this.players[index];\n }\n\n /** Iterate over players */\n [Symbol.iterator](): Iterator<Player> {\n return this.players[Symbol.iterator]();\n }\n\n /** Fetch next page of results */\n async nextPage(): Promise<SearchResults> {\n if (!this._client) {\n throw new Error('Results not connected to client');\n }\n if (!this.hasMore) {\n throw new Error('No more pages');\n }\n\n return this._client.search({\n ...this._filters,\n page: this.page + 1,\n });\n }\n}\n","/**\n * Vairified OAuth Helpers\n *\n * Utilities for implementing the \"Connect with Vairified\" OAuth flow.\n *\n * @module\n */\n\n/**\n * Available OAuth scopes with descriptions.\n *\n * @category OAuth\n */\nexport const SCOPES = {\n 'profile:read': 'Access your name, location, and verification status',\n 'profile:email': 'Access your email address',\n 'rating:read': 'View your current rating and rating splits',\n 'rating:history': 'View your complete rating history',\n 'match:submit': 'Submit match results on your behalf',\n 'webhook:subscribe': 'Receive notifications when your rating changes',\n} as const;\n\n/**\n * Available OAuth scope keys.\n *\n * @category OAuth\n */\nexport type OAuthScope = keyof typeof SCOPES;\n\n/**\n * Default scopes requested for new connections.\n *\n * @category OAuth\n */\nexport const DEFAULT_SCOPES: OAuthScope[] = ['profile:read', 'rating:read'];\n\n/**\n * OAuth configuration for a partner application.\n *\n * @category OAuth\n */\nexport interface OAuthConfig {\n /** Partner API key */\n apiKey: string;\n /** Your application's callback URL */\n redirectUri: string;\n /** Vairified API base URL */\n baseUrl?: string;\n}\n\n/**\n * Response from starting an OAuth authorization.\n *\n * @category OAuth\n */\nexport interface AuthorizationResponse {\n /** Full URL to redirect the user to */\n authorizationUrl: string;\n /** Authorization code (for internal tracking) */\n code: string;\n /** CSRF state parameter */\n state?: string;\n}\n\n/**\n * Response from exchanging an authorization code for tokens.\n *\n * @category OAuth\n */\nexport interface TokenResponse {\n /** Access token for API requests */\n accessToken: string;\n /** Refresh token for obtaining new access tokens */\n refreshToken?: string;\n /** Token expiration in seconds */\n expiresIn: number;\n /** Granted scopes */\n scope: string[];\n /** Connected player's external ID */\n playerId: string;\n}\n\n/**\n * Build the URL to redirect users to for OAuth authorization.\n *\n * This is a helper for building the URL manually. In most cases,\n * you should use the Vairified client's OAuth methods instead.\n *\n * @param config - OAuth configuration\n * @param scopes - Permission scopes to request\n * @param state - CSRF protection state parameter\n * @returns URL to redirect the user to\n *\n * @example\n * ```ts\n * const url = getAuthorizationUrl(\n * {\n * apiKey: 'vair_pk_xxx',\n * redirectUri: 'https://myapp.com/oauth/callback',\n * },\n * ['profile:read', 'rating:read'],\n * );\n * // Redirect user to this URL\n * window.location.href = url;\n * ```\n *\n * @category OAuth\n */\nexport function getAuthorizationUrl(\n config: OAuthConfig,\n scopes: OAuthScope[] = DEFAULT_SCOPES,\n state?: string,\n): string {\n const baseUrl = config.baseUrl || 'https://api-next.vairified.com/api/v1';\n\n // Ensure profile:read is always included\n const scopeSet = new Set(scopes);\n scopeSet.add('profile:read');\n const scopeList = Array.from(scopeSet);\n\n const params = new URLSearchParams({\n redirect_uri: config.redirectUri,\n scope: scopeList.join(','),\n response_type: 'code',\n });\n\n if (state) {\n params.set('state', state);\n }\n\n // The actual authorization is done via API call, this builds the frontend URL\n // Partners should POST to /partner/oauth/authorize to get the actual auth URL\n return `${baseUrl}/partner/oauth/authorize?${params.toString()}`;\n}\n\n/**\n * Check if a scope is valid.\n *\n * @param scope - Scope string to validate\n * @returns True if scope is valid\n *\n * @category OAuth\n */\nexport function validateScope(scope: string): scope is OAuthScope {\n return scope in SCOPES;\n}\n\n/**\n * Get a human-readable description of a scope.\n *\n * @param scope - Scope string\n * @returns Description of what the scope grants access to\n *\n * @category OAuth\n */\nexport function describeScope(scope: OAuthScope): string {\n return SCOPES[scope] ?? `Unknown scope: ${scope}`;\n}\n\n/**\n * Get descriptions for multiple scopes.\n *\n * @param scopes - List of scope strings\n * @returns Array of objects with scope and description\n *\n * @category OAuth\n */\nexport function describeScopes(\n scopes: OAuthScope[],\n): Array<{ scope: OAuthScope; description: string }> {\n return scopes.map((scope) => ({\n scope,\n description: describeScope(scope),\n }));\n}\n\n/**\n * Generate a random state parameter for CSRF protection.\n *\n * @returns Random 32-character hexadecimal string\n *\n * @category OAuth\n */\nexport function generateState(): string {\n const array = new Uint8Array(16);\n if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n crypto.getRandomValues(array);\n } else {\n // Fallback for environments without crypto\n for (let i = 0; i < array.length; i++) {\n array[i] = Math.floor(Math.random() * 256);\n }\n }\n return Array.from(array)\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('');\n}\n","/**\n * Vairified SDK Client\n *\n * Main client for the Vairified Partner API.\n *\n * @module\n */\n\nimport {\n AuthenticationError,\n NotFoundError,\n OAuthError,\n RateLimitError,\n VairifiedError,\n ValidationError,\n} from './errors.js';\nimport {\n type Match,\n MatchResult,\n Member,\n type Player,\n RatingUpdate,\n SearchResults,\n} from './models.js';\nimport type { AuthorizationResponse, OAuthScope, TokenResponse } from './oauth.js';\nimport { DEFAULT_SCOPES, SCOPES } from './oauth.js';\nimport type {\n ApiErrorResponse,\n MatchResultData,\n MemberData,\n PlayerSearchData,\n RatingUpdateData,\n SearchFilters,\n SearchResultsData,\n VairifiedOptions,\n} from './types.js';\n\n// Environment URLs\n// Note: \"production\" points to current active API\nconst ENVIRONMENTS = {\n production: 'https://api-next.vairified.com/api/v1',\n staging: 'https://api-staging.vairified.com/api/v1',\n local: 'http://localhost:3001/api/v1',\n} as const;\n\n/**\n * Available environment presets for the Vairified client.\n *\n * @category Client\n */\nexport type VairifiedEnvironment = keyof typeof ENVIRONMENTS;\n\nconst DEFAULT_BASE_URL = ENVIRONMENTS.production;\nconst DEFAULT_TIMEOUT = 30000;\n\n/**\n * Client for the Vairified Partner API.\n *\n * @category Client\n *\n * @example\n * ```ts\n * const client = new Vairified({ apiKey: 'vair_pk_xxx' });\n *\n * // Get a member\n * const member = await client.getMember('user_123');\n * console.log(member.name, member.rating);\n *\n * // Search for players\n * const results = await client.search({ city: 'Austin', ratingMin: 4.0 });\n * for (const player of results) {\n * console.log(player.name, player.rating);\n * }\n *\n * // Submit a match (doubles: 11-9, 11-7)\n * const match = new Match({\n * event: 'Weekly League',\n * bracket: '4.0 Doubles',\n * date: new Date(),\n * team1: ['p1', 'p2'],\n * team2: ['p3', 'p4'],\n * scores: [[11, 9], [11, 7]],\n * });\n * const result = await client.submitMatch(match);\n * if (result.ok) {\n * console.log(`Submitted ${result.numGames} games`);\n * }\n * ```\n *\n * @remarks\n * If your API key has the \"dry-run\" scope, match submissions will be\n * validated but not persisted. This is useful for testing integrations.\n */\nexport class Vairified {\n /** API key */\n readonly apiKey: string;\n /** Base URL */\n readonly baseUrl: string;\n /** Environment name */\n readonly env: VairifiedEnvironment;\n /** Request timeout in ms */\n readonly timeout: number;\n\n constructor(options: VairifiedOptions = {}) {\n this.apiKey = options.apiKey || this.getEnvApiKey();\n if (!this.apiKey) {\n throw new Error('API key required. Pass apiKey option or set VAIRIFIED_API_KEY env var.');\n }\n\n // Resolve base URL from env or explicit baseUrl\n if (options.baseUrl) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '');\n this.env = 'production';\n } else if (options.env) {\n this.baseUrl = ENVIRONMENTS[options.env];\n this.env = options.env;\n } else {\n // Default to VAIRIFIED_ENV or 'production'\n const envVar = this.getEnvVar('VAIRIFIED_ENV') as VairifiedEnvironment | undefined;\n const defaultEnv: VairifiedEnvironment =\n envVar && envVar in ENVIRONMENTS ? envVar : 'production';\n this.baseUrl = ENVIRONMENTS[defaultEnv] || DEFAULT_BASE_URL;\n this.env = defaultEnv;\n }\n\n this.timeout = options.timeout || DEFAULT_TIMEOUT;\n }\n\n private getEnvVar(name: string): string {\n if (typeof process !== 'undefined' && process.env?.[name]) {\n return process.env[name] as string;\n }\n return '';\n }\n\n private getEnvApiKey(): string {\n return this.getEnvVar('VAIRIFIED_API_KEY');\n }\n\n private getHeaders(): Record<string, string> {\n return {\n 'X-API-Key': this.apiKey,\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n };\n }\n\n private async handleError(response: Response): Promise<never> {\n let body: ApiErrorResponse | undefined;\n let message: string;\n\n try {\n body = (await response.json()) as ApiErrorResponse;\n message = body.message || response.statusText;\n } catch {\n message = response.statusText;\n }\n\n const status = response.status;\n\n if (status === 401) throw new AuthenticationError(message, body);\n if (status === 404) throw new NotFoundError(message, body);\n if (status === 429) {\n const retryAfter = response.headers.get('Retry-After');\n throw new RateLimitError(\n message,\n retryAfter ? Number.parseInt(retryAfter, 10) : undefined,\n body,\n );\n }\n if (status === 400) throw new ValidationError(message, body);\n\n throw new VairifiedError(message, status, body);\n }\n\n private async request<T>(\n method: string,\n path: string,\n options?: { params?: Record<string, string | number | boolean>; body?: unknown },\n ): Promise<T> {\n let url = `${this.baseUrl}${path}`;\n\n if (options?.params) {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(options.params)) {\n if (value !== undefined && value !== null) {\n searchParams.append(key, String(value));\n }\n }\n const queryString = searchParams.toString();\n if (queryString) url += `?${queryString}`;\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const response = await fetch(url, {\n method,\n headers: this.getHeaders(),\n body: options?.body ? JSON.stringify(options.body) : undefined,\n signal: controller.signal,\n });\n\n if (!response.ok) await this.handleError(response);\n\n return (await response.json()) as T;\n } finally {\n clearTimeout(timeoutId);\n }\n }\n\n // ---------------------------------------------------------------------------\n // Member Operations\n // ---------------------------------------------------------------------------\n\n /**\n * Get a connected member by their external ID.\n *\n * **Requires OAuth Connection**: The player must have connected their\n * account to your application via OAuth before you can access their data.\n *\n * @param playerId - External player ID (vair_mem_xxx format)\n * @returns Member object with profile and rating data\n * @throws NotFoundError if member is not found or invalid ID format\n * @throws ForbiddenError if player has not connected to your app\n *\n * @example\n * ```ts\n * const member = await client.getMember('vair_mem_0ABC123def456GHI789jk');\n * console.log(member.name, member.rating);\n * console.log(member.ratingSplits.open); // Open division rating\n * console.log(member.grantedScopes); // ['profile:read', 'rating:read']\n * ```\n */\n async getMember(playerId: string): Promise<Member> {\n const data = await this.request<MemberData>('GET', '/partner/member', {\n params: { id: playerId },\n });\n return new Member(data, this);\n }\n\n // ---------------------------------------------------------------------------\n // Search Operations\n // ---------------------------------------------------------------------------\n\n /**\n * Search for players.\n *\n * @param filters - Search filters\n * @returns SearchResults with players and pagination\n *\n * @example\n * ```ts\n * const results = await client.search({\n * city: 'Austin',\n * ratingMin: 4.0,\n * vairifiedOnly: true,\n * });\n *\n * for (const player of results) {\n * console.log(player.name, player.rating);\n * }\n *\n * // Pagination\n * if (results.hasMore) {\n * const nextPage = await results.nextPage();\n * }\n * ```\n */\n async search(filters: SearchFilters = {}): Promise<SearchResults> {\n const params: Record<string, string | number | boolean> = {\n limit: filters.limit ?? 20,\n };\n\n if (filters.name) params.member = filters.name;\n if (filters.city) params.city = filters.city;\n if (filters.state) params.state = filters.state;\n if (filters.country) params.country = filters.country;\n if (filters.zipCode) params.zip = filters.zipCode;\n if (filters.ratingMin !== undefined) params.rating1 = filters.ratingMin;\n if (filters.ratingMax !== undefined) params.rating2 = filters.ratingMax;\n if (filters.gender) params.gender = filters.gender;\n if (filters.vairifiedOnly) params.vairified = true;\n if (filters.sortBy) {\n params.sortField = filters.sortBy;\n params.sortDirection = filters.sortOrder ?? 'desc';\n }\n\n // Age handling\n if (filters.age !== undefined) {\n params.ageFilterType = 'exact';\n params.age1 = filters.age;\n } else if (filters.ageMin !== undefined && filters.ageMax !== undefined) {\n params.ageFilterType = 'range';\n params.age1 = filters.ageMin;\n params.age2 = filters.ageMax;\n } else if (filters.ageMin !== undefined) {\n params.ageFilterType = 'above';\n params.age1 = filters.ageMin;\n } else if (filters.ageMax !== undefined) {\n params.ageFilterType = 'below';\n params.age1 = filters.ageMax;\n }\n\n // Pagination\n const page = filters.page ?? 1;\n if (page > 1) {\n params.offset = (page - 1) * (filters.limit ?? 20);\n }\n\n const data = await this.request<SearchResultsData | PlayerSearchData[]>(\n 'GET',\n '/partner/search',\n {\n params,\n },\n );\n\n // Handle both array and object responses\n const normalized: SearchResultsData = Array.isArray(data)\n ? { players: data, total: data.length, page, limit: filters.limit ?? 20 }\n : data;\n\n return new SearchResults(normalized, this, filters);\n }\n\n /**\n * Find a single player by name.\n *\n * @param name - Player name to search for\n * @returns Player if found, undefined otherwise\n *\n * @example\n * ```ts\n * const player = await client.findPlayer('John Smith');\n * if (player) {\n * console.log(player.rating);\n * }\n * ```\n */\n async findPlayer(name: string): Promise<Player | undefined> {\n const results = await this.search({ name, limit: 1 });\n return results.at(0);\n }\n\n // ---------------------------------------------------------------------------\n // Match Operations\n // ---------------------------------------------------------------------------\n\n /**\n * Submit a single match.\n *\n * @param match - Match object with teams and scores\n * @returns MatchResult with submission status\n *\n * @example\n * ```ts\n * const match = new Match({\n * event: 'Weekly League',\n * bracket: '4.0 Doubles',\n * date: new Date(),\n * team1: ['p1', 'p2'],\n * team2: ['p3', 'p4'],\n * scores: [[11, 9], [11, 7]],\n * });\n *\n * const result = await client.submitMatch(match);\n * if (result.ok) {\n * console.log(`Submitted ${result.numGames} games`);\n * }\n * ```\n */\n async submitMatch(match: Match): Promise<MatchResult> {\n return this.submitMatches([match]);\n }\n\n /**\n * Submit multiple matches in a batch.\n *\n * @param matches - List of Match objects\n * @returns MatchResult with submission status\n *\n * @example\n * ```ts\n * const result = await client.submitMatches([match1, match2, match3]);\n * console.log(`Submitted ${result.numGames} games from ${result.numMatches} matches`);\n *\n * if (result.dryRun) {\n * console.log('This was a dry run - no data persisted');\n * }\n * ```\n */\n async submitMatches(matches: Match[]): Promise<MatchResult> {\n const data = await this.request<MatchResultData>('POST', '/partner/matches', {\n body: { matches: matches.map((m) => m.toJSON()) },\n });\n return new MatchResult(data);\n }\n\n // ---------------------------------------------------------------------------\n // Rating Updates\n // ---------------------------------------------------------------------------\n\n /**\n * Get rating updates for subscribed members.\n *\n * Members are subscribed when you call getMember().\n *\n * @returns List of RatingUpdate objects\n *\n * @example\n * ```ts\n * const updates = await client.getRatingUpdates();\n * for (const update of updates) {\n * console.log(`${update.memberId}: ${update.previousRating} → ${update.newRating}`);\n * if (update.improved) {\n * const member = await update.getMember();\n * console.log(`${member.name} improved!`);\n * }\n * }\n * ```\n */\n async getRatingUpdates(): Promise<RatingUpdate[]> {\n const data = await this.request<{ updates: RatingUpdateData[] }>(\n 'GET',\n '/partner/rating-updates',\n );\n return (data.updates ?? []).map((u) => new RatingUpdate(u, this));\n }\n\n /**\n * Test webhook endpoint.\n *\n * @param webhookUrl - URL to send test webhook to\n * @returns Test result\n */\n async testWebhook(webhookUrl: string): Promise<Record<string, unknown>> {\n return this.request<Record<string, unknown>>('POST', '/partner/webhook-test', {\n body: { webhookUrl },\n });\n }\n\n // ---------------------------------------------------------------------------\n // OAuth Operations\n // ---------------------------------------------------------------------------\n\n /**\n * Start an OAuth authorization flow.\n *\n * This creates a pending authorization and returns the URL where\n * users should be redirected to approve access.\n *\n * @param redirectUri - Your application's callback URL\n * @param scopes - Permission scopes to request (defaults to profile:read, rating:read)\n * @param state - CSRF protection state parameter (recommended)\n * @returns AuthorizationResponse with the URL to redirect users to\n * @throws OAuthError if the authorization fails to start\n *\n * @example\n * ```ts\n * const auth = await client.startOAuth(\n * 'https://myapp.com/callback',\n * ['profile:read', 'rating:read', 'match:submit'],\n * 'random_csrf_token',\n * );\n * // Redirect user to auth.authorizationUrl\n * window.location.href = auth.authorizationUrl;\n * ```\n *\n * @category OAuth\n */\n async startOAuth(\n redirectUri: string,\n scopes: OAuthScope[] = [...DEFAULT_SCOPES],\n state?: string,\n ): Promise<AuthorizationResponse> {\n // Ensure profile:read is always included\n const scopeSet = new Set(scopes);\n scopeSet.add('profile:read');\n const scopeList = Array.from(scopeSet);\n\n // Validate scopes\n for (const scope of scopeList) {\n if (!(scope in SCOPES)) {\n throw new OAuthError(`Invalid scope: ${scope}`, 'invalid_scope');\n }\n }\n\n const data = await this.request<{\n authorizationUrl: string;\n code: string;\n }>('POST', '/partner/oauth/authorize', {\n body: {\n redirectUri,\n scope: scopeList.join(','),\n state,\n },\n });\n\n return {\n authorizationUrl: data.authorizationUrl,\n code: data.code,\n state,\n };\n }\n\n /**\n * Exchange an authorization code for access and refresh tokens.\n *\n * Call this after the user approves access and is redirected back\n * to your application with a code parameter.\n *\n * @param code - Authorization code from the callback URL\n * @param redirectUri - Must match the redirectUri used in startOAuth\n * @returns TokenResponse with access_token, refresh_token, and player_id\n * @throws OAuthError if the code is invalid or expired\n *\n * @example\n * ```ts\n * // After user is redirected to: https://myapp.com/callback?code=xxx\n * const tokens = await client.exchangeToken(\n * new URL(window.location.href).searchParams.get('code')!,\n * 'https://myapp.com/callback',\n * );\n * // Store tokens.accessToken and tokens.refreshToken securely\n * // Use tokens.playerId to identify the connected player\n * ```\n *\n * @category OAuth\n */\n async exchangeToken(code: string, redirectUri: string): Promise<TokenResponse> {\n const data = await this.request<{\n accessToken: string;\n refreshToken?: string;\n expiresIn: number;\n scope: string;\n playerId: string;\n }>('POST', '/partner/oauth/token', {\n body: { code, redirectUri },\n });\n\n return {\n accessToken: data.accessToken,\n refreshToken: data.refreshToken,\n expiresIn: data.expiresIn,\n scope: data.scope ? data.scope.split(',') : [],\n playerId: data.playerId,\n };\n }\n\n /**\n * Refresh an expired access token.\n *\n * Use this when an access token expires to obtain a new one\n * without requiring the user to re-authorize.\n *\n * @param refreshToken - The refresh token from a previous token exchange\n * @returns TokenResponse with new access_token and optionally a new refresh_token\n * @throws OAuthError if the refresh token is invalid or revoked\n *\n * @example\n * ```ts\n * try {\n * const newTokens = await client.refreshAccessToken(storedRefreshToken);\n * // Update stored tokens\n * } catch (e) {\n * if (e instanceof OAuthError && e.errorCode === 'invalid_grant') {\n * // Refresh token revoked, user needs to re-authorize\n * }\n * }\n * ```\n *\n * @category OAuth\n */\n async refreshAccessToken(refreshToken: string): Promise<TokenResponse> {\n const data = await this.request<{\n accessToken: string;\n refreshToken?: string;\n expiresIn: number;\n scope: string;\n playerId: string;\n }>('POST', '/partner/oauth/refresh', {\n body: { refreshToken },\n });\n\n return {\n accessToken: data.accessToken,\n refreshToken: data.refreshToken,\n expiresIn: data.expiresIn,\n scope: data.scope ? data.scope.split(',') : [],\n playerId: data.playerId,\n };\n }\n\n /**\n * Revoke a player's OAuth connection.\n *\n * This disconnects the player from your application. You will no\n * longer be able to access their data or submit matches on their behalf.\n *\n * @param playerId - The player's external ID (vair_mem_xxx format)\n * @throws OAuthError if the revocation fails\n *\n * @example\n * ```ts\n * await client.revokeConnection('vair_mem_0ABC123def456GHI789jk');\n * // Player is now disconnected\n * ```\n *\n * @category OAuth\n */\n async revokeConnection(playerId: string): Promise<void> {\n await this.request<{ success: boolean }>('POST', '/partner/oauth/revoke', {\n body: { playerId },\n });\n }\n\n /**\n * Get a list of available OAuth scopes.\n *\n * @returns List of scope objects with id, name, and description\n *\n * @example\n * ```ts\n * const scopes = await client.getAvailableScopes();\n * for (const scope of scopes) {\n * console.log(`${scope.id}: ${scope.description}`);\n * }\n * ```\n *\n * @category OAuth\n */\n async getAvailableScopes(): Promise<Array<{ id: string; name: string; description: string }>> {\n const data = await this.request<{\n scopes: Array<{ id: string; name: string; description: string }>;\n }>('GET', '/partner/oauth/scopes');\n return data.scopes ?? [];\n }\n\n /**\n * Get API usage statistics for your partner account.\n *\n * @returns Usage statistics (requests, limits, etc.)\n *\n * @example\n * ```ts\n * const usage = await client.getUsage();\n * console.log(`Requests today: ${usage.requestsToday}`);\n * console.log(`Rate limit: ${usage.rateLimit}/hour`);\n * ```\n *\n * @category Client\n */\n async getUsage(): Promise<Record<string, unknown>> {\n return this.request<Record<string, unknown>>('GET', '/partner/usage');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,iBAAN,cAA6B,MAAM;AAAA;AAAA,EAExC;AAAA;AAAA,EAEA;AAAA,EAEA,YAAY,SAAiB,YAAqB,UAAoB;AACpE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AACF;AAOO,IAAM,iBAAN,cAA6B,eAAe;AAAA;AAAA,EAEjD;AAAA,EAEA,YAAY,UAAU,uBAAuB,YAAqB,UAAoB;AACpF,UAAM,SAAS,KAAK,QAAQ;AAC5B,SAAK,OAAO;AACZ,SAAK,aAAa;AAAA,EACpB;AACF;AAOO,IAAM,sBAAN,cAAkC,eAAe;AAAA,EACtD,YAAY,UAAU,mBAAmB,UAAoB;AAC3D,UAAM,SAAS,KAAK,QAAQ;AAC5B,SAAK,OAAO;AAAA,EACd;AACF;AAOO,IAAM,gBAAN,cAA4B,eAAe;AAAA,EAChD,YAAY,UAAU,sBAAsB,UAAoB;AAC9D,UAAM,SAAS,KAAK,QAAQ;AAC5B,SAAK,OAAO;AAAA,EACd;AACF;AAOO,IAAM,kBAAN,cAA8B,eAAe;AAAA,EAClD,YAAY,UAAU,oBAAoB,UAAoB;AAC5D,UAAM,SAAS,KAAK,QAAQ;AAC5B,SAAK,OAAO;AAAA,EACd;AACF;AASO,IAAM,aAAN,cAAyB,eAAe;AAAA;AAAA,EAE7C;AAAA,EAEA,YAAY,UAAU,eAAe,WAAoB,UAAoB;AA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