@dendotdev/grunt 1.0.2 → 1.0.4

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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/cache/cache-manager.ts","../src/core/http/retry-policy.ts","../src/models/common/api-content-type.ts","../src/utils/constants.ts","../src/clients/base/client-base.ts","../src/endpoints/halo-core-endpoints.ts","../src/modules/base/module-base.ts","../src/modules/halo-infinite/academy.module.ts","../src/modules/halo-infinite/ban-processor.module.ts","../src/modules/halo-infinite/configuration.module.ts","../src/modules/halo-infinite/economy.module.ts","../src/modules/halo-infinite/game-cms.module.ts","../src/modules/halo-infinite/lobby.module.ts","../src/modules/halo-infinite/settings.module.ts","../src/modules/halo-infinite/skill.module.ts","../src/modules/halo-infinite/stats.module.ts","../src/modules/halo-infinite/text-moderation.module.ts","../src/modules/halo-infinite/ugc.module.ts","../src/modules/halo-infinite/ugc-discovery.module.ts","../src/clients/halo-infinite-client.ts","../src/modules/base/waypoint-module-base.ts","../src/modules/waypoint/profile.module.ts","../src/modules/waypoint/redemption.module.ts","../src/modules/waypoint/content.module.ts","../src/modules/waypoint/comms.module.ts","../src/clients/waypoint-client.ts","../src/auth/halo-auth-client.ts","../src/models/common/api-result.ts","../src/models/halo-infinite/enums/match-type.ts","../src/models/halo-infinite/enums/lifecycle-mode.ts","../src/models/halo-infinite/enums/asset-kind.ts","../src/models/halo-infinite/enums/player-type.ts","../src/models/halo-infinite/enums/outcome.ts","../src/models/halo-infinite/enums/result-order.ts","../src/errors/halo-api-error.ts"],"names":["LRUCache"],"mappings":";;;;;AAMA,IAAM,cAAA,GAAiB,KAAK,EAAA,GAAK,GAAA;AAKjC,IAAM,gBAAA,GAAmB,GAAA;AA6BlB,IAAM,eAAN,MAAmB;AAAA,EACP,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjB,WAAA,CACE,KAAA,GAAgB,cAA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GAAA;AAAA,EAC7B;AACF","file":"index.js","sourcesContent":["import { LRUCache } from 'lru-cache';\nimport type { CachedResponse } from './cached-response';\n\n/**\n * Default cache TTL: 60 minutes.\n */\nconst DEFAULT_TTL_MS = 60 * 60 * 1000;\n\n/**\n * Maximum number of cached entries.\n */\nconst DEFAULT_MAX_SIZE = 1000;\n\n/**\n * ETag-based cache manager with TTL expiration.\n *\n * Implements the same caching strategy as the C# ClientBase:\n * - Stores responses with their ETag values\n * - Enables 304 Not Modified responses\n * - Automatically expires entries after TTL\n *\n * Uses LRU (Least Recently Used) eviction when the cache is full.\n *\n * @example\n * ```typescript\n * const cache = new CacheManager(60 * 60 * 1000); // 1 hour TTL\n *\n * // Store a response\n * cache.set('endpoint-key', {\n * etag: '\"abc123\"',\n * content: new TextEncoder().encode('{\"data\": \"value\"}'),\n * });\n *\n * // Retrieve later\n * const cached = cache.get('endpoint-key');\n * if (cached?.etag) {\n * // Use etag for If-None-Match header\n * }\n * ```\n */\nexport class CacheManager {\n private readonly cache: LRUCache<string, CachedResponse>;\n\n /**\n * Creates a new cache manager.\n *\n * @param ttlMs - Time-to-live for cached entries in milliseconds\n * @param maxSize - Maximum number of entries to cache\n */\n constructor(\n ttlMs: number = DEFAULT_TTL_MS,\n maxSize: number = DEFAULT_MAX_SIZE\n ) {\n this.cache = new LRUCache<string, CachedResponse>({\n max: maxSize,\n ttl: ttlMs,\n // Calculate size based on content length for memory management\n sizeCalculation: (value) => {\n return value.content.length + (value.etag?.length ?? 0);\n },\n // 50MB max memory for cache\n maxSize: 50 * 1024 * 1024,\n });\n }\n\n /**\n * Get a cached response if it exists and hasn't expired.\n *\n * @param key - Cache key (typically the request URL)\n * @returns Cached response or null if not found/expired\n */\n get(key: string): CachedResponse | null {\n return this.cache.get(key) ?? null;\n }\n\n /**\n * Store a response in the cache.\n *\n * @param key - Cache key (typically the request URL)\n * @param response - Response to cache\n */\n set(key: string, response: CachedResponse): void {\n this.cache.set(key, response);\n }\n\n /**\n * Check if a key exists in the cache without updating its recency.\n *\n * @param key - Cache key to check\n * @returns true if the key exists and hasn't expired\n */\n has(key: string): boolean {\n return this.cache.has(key);\n }\n\n /**\n * Remove a specific entry from the cache.\n *\n * @param key - Cache key to remove\n * @returns true if an entry was removed\n */\n delete(key: string): boolean {\n return this.cache.delete(key);\n }\n\n /**\n * Clear all cached entries.\n */\n clear(): void {\n this.cache.clear();\n }\n\n /**\n * Get the current number of cached entries.\n */\n get size(): number {\n return this.cache.size;\n }\n\n /**\n * Manually trigger cleanup of expired entries.\n * This is called automatically by the LRU cache, but can be\n * invoked manually if needed.\n */\n prune(): void {\n this.cache.purgeStale();\n }\n}\n","/**\n * Configuration options for the retry policy.\n */\nexport interface RetryOptions {\n /**\n * Maximum number of retry attempts after the initial request.\n *\n * @default 3\n */\n maxRetries: number;\n\n /**\n * Delay between retries in milliseconds.\n * Array index corresponds to retry attempt (0-indexed).\n *\n * @default [200, 500, 1000]\n */\n retryDelays: number[];\n}\n\n/**\n * Default retry configuration matching the C# implementation.\n */\nconst DEFAULT_RETRY_OPTIONS: RetryOptions = {\n maxRetries: 3,\n retryDelays: [200, 500, 1000],\n};\n\n/**\n * HTTP status codes that indicate transient errors worth retrying.\n */\nconst TRANSIENT_STATUS_CODES = new Set([\n 408, // Request Timeout\n 429, // Too Many Requests\n 500, // Internal Server Error\n 502, // Bad Gateway\n 503, // Service Unavailable\n 504, // Gateway Timeout\n]);\n\n/**\n * Retry policy with exponential backoff for transient failures.\n *\n * Implements the same retry strategy as the C# ClientBase:\n * - Retries on transient HTTP errors (5xx, 408, 429)\n * - Retries on network failures (fetch TypeError)\n * - Uses configurable delays between attempts\n *\n * @example\n * ```typescript\n * const policy = new RetryPolicy({ maxRetries: 3 });\n *\n * const response = await policy.execute(async () => {\n * return fetch('https://api.example.com/data');\n * });\n * ```\n */\nexport class RetryPolicy {\n private readonly options: RetryOptions;\n\n /**\n * Creates a new retry policy.\n *\n * @param options - Configuration options\n */\n constructor(options: Partial<RetryOptions> = {}) {\n this.options = {\n maxRetries: options.maxRetries ?? DEFAULT_RETRY_OPTIONS.maxRetries,\n retryDelays: options.retryDelays ?? DEFAULT_RETRY_OPTIONS.retryDelays,\n };\n }\n\n /**\n * Execute a function with retry logic.\n *\n * The function is called immediately. If it fails with a retryable error,\n * it will be retried up to maxRetries times with delays between attempts.\n *\n * @param fn - Async function that returns a Response\n * @returns The successful Response\n * @throws The last error if all retries are exhausted\n */\n async execute(fn: () => Promise<Response>): Promise<Response> {\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) {\n try {\n const response = await fn();\n\n // Check if response indicates a transient error\n if (this.isTransientError(response)) {\n lastError = new Error(\n `HTTP ${response.status}: ${response.statusText}`\n );\n\n if (attempt < this.options.maxRetries) {\n await this.delay(attempt);\n continue;\n }\n }\n\n return response;\n } catch (error) {\n // Network errors are retryable\n lastError = error instanceof Error ? error : new Error(String(error));\n\n if (!this.isRetryableError(error) || attempt >= this.options.maxRetries) {\n throw lastError;\n }\n\n await this.delay(attempt);\n }\n }\n\n throw lastError ?? new Error('Retry exhausted');\n }\n\n /**\n * Check if a response indicates a transient server error.\n */\n private isTransientError(response: Response): boolean {\n return TRANSIENT_STATUS_CODES.has(response.status);\n }\n\n /**\n * Check if an error is worth retrying.\n * Network errors (TypeError from fetch) are retryable.\n */\n private isRetryableError(error: unknown): boolean {\n // Fetch throws TypeError for network failures\n if (error instanceof TypeError) {\n return true;\n }\n return false;\n }\n\n /**\n * Wait for the appropriate delay before the next retry.\n */\n private delay(attempt: number): Promise<void> {\n const delays = this.options.retryDelays;\n const delayMs = delays[attempt] ?? delays[delays.length - 1] ?? 1000;\n return new Promise((resolve) => setTimeout(resolve, delayMs));\n }\n}\n","/**\n * API content types supported by the Halo API.\n *\n * Most endpoints use JSON, but some UGC-related endpoints\n * use Bond Compact Binary for binary asset data.\n */\nexport const ApiContentType = {\n /** Standard JSON content type */\n Json: 'json',\n /** Bond compact binary format for binary data */\n BondCompactBinary: 'bond',\n} as const;\n\n/**\n * Type representing valid API content types.\n */\nexport type ApiContentType = (typeof ApiContentType)[keyof typeof ApiContentType];\n\n/**\n * Get the HTTP Content-Type header value for a content type.\n *\n * @param contentType - The content type enum value\n * @returns The corresponding Content-Type header value\n */\nexport function getContentTypeHeader(contentType: ApiContentType): string {\n switch (contentType) {\n case ApiContentType.Json:\n return 'application/json';\n case ApiContentType.BondCompactBinary:\n return 'application/x-bond-compact-binary';\n default:\n return 'application/json';\n }\n}\n","/**\n * Global constants and default values used throughout the library.\n */\n\n/**\n * Default User-Agent strings for different contexts.\n * Matching the C# implementation's global constants.\n */\nexport const USER_AGENTS = {\n /**\n * User-Agent for Halo PC client requests.\n */\n HALO_PC:\n 'SHIVA-2043073184/6.10025.12948.0 (release; PC)',\n\n /**\n * User-Agent for Halo Waypoint app requests.\n */\n HALO_WAYPOINT:\n 'HaloWaypoint/2021112313511900 CFNetwork/1327.0.4 Darwin/21.2.0',\n\n /**\n * Standard web browser User-Agent.\n */\n WEB: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',\n} as const;\n\n/**\n * Default authentication scopes for Xbox Live.\n */\nexport const DEFAULT_AUTH_SCOPES = [\n 'Xboxlive.signin',\n 'Xboxlive.offline_access',\n] as const;\n\n/**\n * HTTP header names used in API requests.\n */\nexport const HEADERS = {\n /** Spartan token authentication header */\n SPARTAN_AUTH: 'x-343-authorization-spartan',\n\n /** Clearance/flight token header */\n CLEARANCE: '343-clearance',\n\n /** Standard Content-Type header */\n CONTENT_TYPE: 'Content-Type',\n\n /** Standard Accept header */\n ACCEPT: 'Accept',\n\n /** Standard User-Agent header */\n USER_AGENT: 'User-Agent',\n\n /** ETag header for caching */\n ETAG: 'ETag',\n\n /** If-None-Match header for conditional requests */\n IF_NONE_MATCH: 'If-None-Match',\n} as const;\n\n/**\n * Default timeout for HTTP requests in milliseconds.\n */\nexport const DEFAULT_TIMEOUT_MS = 30_000;\n\n/**\n * Default cache TTL in milliseconds (60 minutes).\n */\nexport const DEFAULT_CACHE_TTL_MS = 60 * 60 * 1000;\n\n/**\n * Default maximum retry attempts.\n */\nexport const DEFAULT_MAX_RETRIES = 3;\n","import { CacheManager } from '../../core/cache';\nimport { RetryPolicy } from '../../core/http';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport {\n ApiContentType,\n getContentTypeHeader,\n} from '../../models/common/api-content-type';\nimport type { RequestOptions } from '../../models/common/client-options';\nimport {\n HEADERS,\n DEFAULT_CACHE_TTL_MS,\n DEFAULT_MAX_RETRIES,\n} from '../../utils/constants';\n\n/**\n * Abstract base class for all API clients.\n *\n * Provides shared functionality for HTTP execution, ETag-based caching,\n * and retry logic. Both HaloInfiniteClient and WaypointClient extend this.\n *\n * Mirrors the C# ClientBase implementation with:\n * - Shared HttpClient-equivalent fetch function\n * - ETag-based caching with TTL expiration\n * - Automatic retry for transient failures\n * - Support for multiple content types\n * - Comprehensive error handling with raw response capture\n */\nexport abstract class ClientBase {\n /**\n * Fetch function used for HTTP requests.\n * Can be overridden for testing or custom environments.\n */\n protected readonly fetchFn: typeof fetch;\n\n /**\n * Cache manager for ETag-based response caching.\n */\n protected readonly cache: CacheManager;\n\n /**\n * Retry policy for handling transient failures.\n */\n protected readonly retryPolicy: RetryPolicy;\n\n /**\n * Spartan token for API authentication.\n * Obtained through Xbox Live XSTS token exchange.\n */\n spartanToken: string = '';\n\n /**\n * Xbox User ID in numeric format.\n * Used for player-specific API requests.\n */\n xuid: string = '';\n\n /**\n * Clearance/flight token for accessing flighted content.\n */\n clearanceToken: string = '';\n\n /**\n * Whether to include raw request/response data in results.\n * Useful for debugging but adds overhead.\n */\n includeRawResponses: boolean = false;\n\n /**\n * Custom User-Agent header value.\n */\n userAgent: string = '';\n\n /**\n * Creates a new ClientBase instance.\n *\n * @param options - Configuration options\n */\n constructor(options?: {\n fetchFn?: typeof fetch;\n cacheTtlMs?: number;\n maxRetries?: number;\n }) {\n this.fetchFn = options?.fetchFn ?? globalThis.fetch.bind(globalThis);\n this.cache = new CacheManager(options?.cacheTtlMs ?? DEFAULT_CACHE_TTL_MS);\n this.retryPolicy = new RetryPolicy({\n maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,\n });\n }\n\n /**\n * Execute an API request with caching, retry, and response handling.\n *\n * This is the core method that all module methods call. It handles:\n * - Building the request with appropriate headers\n * - ETag-based caching and 304 Not Modified responses\n * - Retry logic for transient failures\n * - Response deserialization\n * - Raw response capture (when enabled)\n *\n * @template T - Expected response data type\n * @param endpoint - Full URL for the request\n * @param method - HTTP method to use\n * @param options - Request configuration options\n * @returns Promise resolving to the API result\n */\n async executeRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n options: RequestOptions = {}\n ): Promise<HaloApiResult<T>> {\n const result: HaloApiResult<T> = {\n result: null,\n response: { code: 0 },\n };\n\n // Build the request\n const headers = this.buildHeaders(options);\n const requestInit: RequestInit = {\n method,\n headers,\n };\n\n // Add body for POST/PUT/PATCH\n if (options.body) {\n requestInit.body = options.body;\n }\n\n // Capture request details if enabled\n if (this.includeRawResponses) {\n result.response.requestUrl = endpoint;\n result.response.requestMethod = method;\n result.response.requestHeaders = Object.fromEntries(headers.entries());\n if (typeof options.body === 'string') {\n result.response.requestBody = options.body;\n }\n }\n\n try {\n // Check cache for GET requests\n const cacheKey = method === 'GET' ? endpoint : null;\n const cached = cacheKey ? this.cache.get(cacheKey) : null;\n\n // Add ETag header if we have a cached response\n if (cached?.etag) {\n headers.set(HEADERS.IF_NONE_MATCH, cached.etag);\n }\n\n // Execute request with retry\n const response = await this.retryPolicy.execute(async () => {\n return this.fetchFn(endpoint, requestInit);\n });\n\n result.response.code = response.status;\n\n // Capture response headers if enabled\n if (this.includeRawResponses) {\n result.response.responseHeaders = Object.fromEntries(\n response.headers.entries()\n );\n }\n\n // Handle 304 Not Modified - use cached content\n if (response.status === 304 && cached) {\n result.result = this.deserializeResponse<T>(cached.content);\n result.response.message = '304 Not Modified - using cached response';\n return result;\n }\n\n // Read response body\n const bodyBuffer = await response.arrayBuffer();\n const bodyBytes = new Uint8Array(bodyBuffer);\n\n // Cache successful GET responses\n if (cacheKey && response.ok) {\n const etag = response.headers.get(HEADERS.ETAG) ?? undefined;\n this.cache.set(cacheKey, { etag, content: bodyBytes });\n }\n\n // Capture raw response message\n const bodyText = new TextDecoder().decode(bodyBytes);\n result.response.message = bodyText;\n\n // Deserialize response\n if (response.ok || options.enforceSuccess !== false) {\n result.result = this.deserializeResponse<T>(bodyBytes);\n }\n } catch (error) {\n result.response.code = 0;\n result.response.message =\n error instanceof Error ? error.message : String(error);\n }\n\n return result;\n }\n\n /**\n * Build request headers based on options.\n */\n private buildHeaders(options: RequestOptions): Headers {\n const headers = new Headers();\n\n // Set default Accept header\n headers.set(HEADERS.ACCEPT, 'application/json');\n\n // Set Content-Type for requests with body\n if (options.body !== undefined) {\n const contentType = getContentTypeHeader(\n options.contentType ?? ApiContentType.Json\n );\n headers.set(HEADERS.CONTENT_TYPE, contentType);\n }\n\n // Add Spartan token if requested\n if (options.useSpartanToken !== false && this.spartanToken) {\n headers.set(HEADERS.SPARTAN_AUTH, this.spartanToken);\n }\n\n // Add clearance token if requested\n if (options.useClearance && this.clearanceToken) {\n headers.set(HEADERS.CLEARANCE, this.clearanceToken);\n }\n\n // Add User-Agent if set\n if (this.userAgent) {\n headers.set(HEADERS.USER_AGENT, this.userAgent);\n }\n\n // Add any custom headers\n if (options.customHeaders) {\n for (const [key, value] of Object.entries(options.customHeaders)) {\n headers.set(key, value);\n }\n }\n\n return headers;\n }\n\n /**\n * Deserialize response bytes to the expected type.\n */\n private deserializeResponse<T>(data: Uint8Array): T | null {\n if (data.length === 0) {\n return null;\n }\n\n const text = new TextDecoder().decode(data);\n\n // Handle boolean responses\n if (text === 'true') {\n return true as unknown as T;\n }\n if (text === 'false') {\n return false as unknown as T;\n }\n\n // Try to parse as JSON\n try {\n return JSON.parse(text) as T;\n } catch {\n // If not valid JSON, return as string\n return text as unknown as T;\n }\n }\n\n /**\n * Clear the response cache.\n * Useful when you know data has changed.\n */\n clearCache(): void {\n this.cache.clear();\n }\n}\n","/**\n * Halo API endpoint configuration constants.\n *\n * These define the service origins for different API modules.\n * The Halo Infinite API is distributed across multiple services,\n * each handling a specific domain of functionality.\n */\nexport const HALO_CORE_ENDPOINTS = {\n /**\n * Base service domain for all Halo Waypoint services.\n */\n SERVICE_DOMAIN: 'svc.halowaypoint.com',\n\n // ─────────────────────────────────────────────────────────────────\n // Service Origins (prepended to SERVICE_DOMAIN)\n // ─────────────────────────────────────────────────────────────────\n\n /** Game CMS for static content (challenges, items, etc.) */\n GAME_CMS_ORIGIN: 'gamecms-hacs',\n\n /** Economy service for stores, inventory, customization */\n ECONOMY_ORIGIN: 'economy',\n\n /** UGC authoring service for creating/editing user content */\n AUTHORING_ORIGIN: 'authoring-infiniteugc',\n\n /** UGC discovery service for searching user content */\n DISCOVERY_ORIGIN: 'discovery-infiniteugc',\n\n /** Lobby service for multiplayer lobbies and presence */\n LOBBY_ORIGIN: 'lobby-hi',\n\n /** Settings and configuration service */\n SETTINGS_ORIGIN: 'settings',\n\n /** Skill and CSR rating service */\n SKILL_ORIGIN: 'skill',\n\n /** Ban processor service */\n BAN_PROCESSOR_ORIGIN: 'banprocessor',\n\n /** Stats service for match history and service records */\n STATS_ORIGIN: 'halostats',\n\n /** Text moderation service */\n TEXT_ORIGIN: 'text',\n\n /** Content service for articles and news */\n CONTENT_ORIGIN: 'content-hacs',\n\n // ─────────────────────────────────────────────────────────────────\n // Authentication Endpoints\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Endpoint for obtaining a Spartan token from an XSTS token.\n */\n SPARTAN_TOKEN_ENDPOINT: 'https://settings.svc.halowaypoint.com/spartan-token',\n\n /**\n * Endpoint for discovering available Halo Infinite API endpoints.\n * Returns configuration for all available services.\n */\n HALO_INFINITE_SETTINGS:\n 'https://settings.svc.halowaypoint.com/settings/hipc/e2a0a7c6-6efe-42af-9283-c2ab73250c48',\n\n // ─────────────────────────────────────────────────────────────────\n // Xbox Live / XSTS Configuration\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Relying party URL for XSTS token exchange.\n * Use this when requesting an XSTS token for Halo Waypoint.\n */\n HALO_WAYPOINT_XSTS_RELYING_PARTY: 'https://prod.xsts.halowaypoint.com/',\n\n // ─────────────────────────────────────────────────────────────────\n // Blob Storage\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Base URL for UGC blob storage (maps, game variants, etc.)\n */\n BLOBS_ORIGIN: 'blobs-infiniteugc',\n} as const;\n\n/**\n * Waypoint-specific endpoints for non-game services.\n */\nexport const WAYPOINT_ENDPOINTS = {\n /**\n * Base domain for Halo Waypoint web services.\n */\n WEB_DOMAIN: 'www.halowaypoint.com',\n\n /**\n * API subdomain for Waypoint services.\n */\n API_DOMAIN: 'api.halowaypoint.com',\n\n /**\n * Profile API origin.\n */\n PROFILE_ORIGIN: 'profile',\n\n /**\n * Redemption API origin for code redemption.\n */\n REDEMPTION_ORIGIN: 'redemption',\n} as const;\n\n/**\n * Build a full URL from an origin and path.\n *\n * @param origin - The service origin (e.g., 'halostats')\n * @param path - The API path (e.g., '/hi/players/xuid(...)/matches')\n * @returns Full HTTPS URL\n *\n * @example\n * ```typescript\n * const url = buildServiceUrl(HALO_CORE_ENDPOINTS.STATS_ORIGIN, '/hi/players/xuid(123)/matches');\n * // Returns: 'https://halostats.svc.halowaypoint.com/hi/players/xuid(123)/matches'\n * ```\n */\nexport function buildServiceUrl(origin: string, path: string): string {\n return `https://${origin}.${HALO_CORE_ENDPOINTS.SERVICE_DOMAIN}${path}`;\n}\n","import type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { ApiContentType } from '../../models/common/api-content-type';\nimport { buildServiceUrl } from '../../endpoints/halo-core-endpoints';\n\n/**\n * Abstract base class for all Halo Infinite API modules.\n *\n * Provides shared functionality for building URLs and making HTTP requests.\n * Each module (Stats, Economy, GameCms, etc.) extends this class and uses\n * the helper methods to interact with its specific API endpoints.\n *\n * @example\n * ```typescript\n * class StatsModule extends ModuleBase {\n * constructor(client: ClientBase) {\n * super(client, HALO_CORE_ENDPOINTS.STATS_ORIGIN);\n * }\n *\n * async getMatchStats(matchId: string) {\n * return this.get<MatchStats>(`/hi/matches/${matchId}/stats`);\n * }\n * }\n * ```\n */\nexport abstract class ModuleBase {\n /**\n * Reference to the parent client for making HTTP requests.\n */\n protected readonly client: ClientBase;\n\n /**\n * Service origin for this module (e.g., 'halostats', 'economy').\n */\n protected readonly origin: string;\n\n /**\n * Creates a new module instance.\n *\n * @param client - Parent client instance\n * @param origin - Service origin for URL building\n */\n constructor(client: ClientBase, origin: string) {\n this.client = client;\n this.origin = origin;\n }\n\n /**\n * Build a full URL from a relative path using this module's origin.\n *\n * @param path - API path starting with /\n * @returns Full HTTPS URL\n */\n protected buildUrl(path: string): string {\n return buildServiceUrl(this.origin, path);\n }\n\n /**\n * Execute a GET request to this module's service.\n *\n * @template T - Expected response type\n * @param path - API path (e.g., '/hi/players/xuid(...)/matches')\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected get<T>(\n path: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'GET', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a GET request to an absolute URL.\n *\n * Used when the URL doesn't follow the standard origin pattern\n * (e.g., blob storage URLs).\n *\n * @template T - Expected response type\n * @param fullUrl - Complete URL to request\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected getFullUrl<T>(\n fullUrl: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n enforceSuccess?: boolean;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(fullUrl, 'GET', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n customHeaders: options.customHeaders,\n enforceSuccess: options.enforceSuccess ?? true,\n });\n }\n\n /**\n * Execute a POST request to this module's service.\n *\n * @template T - Expected response type\n * @param path - API path\n * @param body - Optional request body as string\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected post<T>(\n path: string,\n body?: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a POST request with a JSON body.\n *\n * @template T - Expected response type\n * @template TBody - Request body type\n * @param path - API path\n * @param body - Request body (will be serialized to JSON)\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected postJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n contentType?: ApiContentType;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body: JSON.stringify(body),\n contentType: options.contentType ?? ApiContentType.Json,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a PUT request with a JSON body.\n *\n * @template T - Expected response type\n * @template TBody - Request body type\n * @param path - API path\n * @param body - Request body (will be serialized to JSON)\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected putJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'PUT', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a PATCH request with a JSON body.\n *\n * @template T - Expected response type\n * @template TBody - Request body type\n * @param path - API path\n * @param body - Request body (will be serialized to JSON)\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected patchJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'PATCH', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a DELETE request.\n *\n * @template T - Expected response type\n * @param path - API path\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected delete<T>(\n path: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'DELETE', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Validate that a parameter is not null or undefined.\n *\n * @param value - Value to check\n * @param paramName - Parameter name for error message\n * @throws Error if value is null or undefined\n */\n protected assertNotNull<T>(\n value: T | null | undefined,\n paramName: string\n ): asserts value is T {\n if (value == null) {\n throw new Error(`${paramName} cannot be null or undefined`);\n }\n }\n\n /**\n * Validate that a number is within a range.\n *\n * @param value - Value to check\n * @param min - Minimum allowed value (inclusive)\n * @param max - Maximum allowed value (inclusive)\n * @param paramName - Parameter name for error message\n * @throws RangeError if value is out of range\n */\n protected assertRange(\n value: number,\n min: number,\n max: number,\n paramName: string\n ): void {\n if (value < min || value > max) {\n throw new RangeError(`${paramName} must be between ${min} and ${max}`);\n }\n }\n\n /**\n * Validate that a string is not empty.\n *\n * @param value - Value to check\n * @param paramName - Parameter name for error message\n * @throws Error if value is empty\n */\n protected assertNotEmpty(value: string, paramName: string): void {\n if (!value || value.trim().length === 0) {\n throw new Error(`${paramName} cannot be empty`);\n }\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type {\n AcademyClientManifest,\n AcademyStarDefinitions,\n BotCustomizationData,\n TestAcademyClientManifest,\n} from '../../models/halo-infinite/misc';\n\n/**\n * Academy module for bot customization and drill-related APIs.\n *\n * Provides access to:\n * - Academy content manifest\n * - Bot customization options\n * - Star/scoring definitions for drills\n *\n * @example\n * ```typescript\n * // Get academy content\n * const content = await client.academy.getContent();\n *\n * // Get bot customization options\n * const bots = await client.academy.getBotCustomization('flight-id');\n * ```\n */\nexport class AcademyModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.GAME_CMS_ORIGIN);\n }\n\n /**\n * Get bot customization data.\n *\n * @param flightId - Flight/clearance ID\n * @returns Bot customization options\n */\n getBotCustomization(flightId?: string): Promise<HaloApiResult<BotCustomizationData>> {\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<BotCustomizationData>(`/hi/academy/botcustomization${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get academy content manifest.\n *\n * @returns Academy client manifest\n */\n getContent(): Promise<HaloApiResult<AcademyClientManifest>> {\n return this.get<AcademyClientManifest>('/hi/academy/content');\n }\n\n /**\n * Get test academy content (for flighted builds).\n *\n * @param clearanceId - Clearance identifier\n * @returns Test academy manifest\n */\n getContentTest(clearanceId: string): Promise<HaloApiResult<TestAcademyClientManifest>> {\n this.assertNotEmpty(clearanceId, 'clearanceId');\n return this.get<TestAcademyClientManifest>(`/hi/academy/content/test?clearanceId=${clearanceId}`, {\n useClearance: true,\n });\n }\n\n /**\n * Get star/scoring definitions for academy drills.\n *\n * @returns Star definitions\n */\n getStarDefinitions(): Promise<HaloApiResult<AcademyStarDefinitions>> {\n return this.get<AcademyStarDefinitions>('/hi/Progression/file/academy/stars');\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { BansSummaryQueryResult } from '../../models/halo-infinite/misc';\n\n/**\n * Ban Processor module for querying ban information.\n *\n * @example\n * ```typescript\n * // Check if players are banned\n * const bans = await client.banProcessor.banSummary(['xuid1', 'xuid2']);\n * ```\n */\nexport class BanProcessorModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.BAN_PROCESSOR_ORIGIN);\n }\n\n /**\n * Get ban summary for a list of players.\n *\n * @param targetList - List of player XUIDs to check\n * @returns Ban summary results\n */\n banSummary(targetList: string[]): Promise<HaloApiResult<BansSummaryQueryResult>> {\n if (!targetList.length) {\n throw new Error('targetList cannot be empty');\n }\n\n const playersQuery = targetList.map((id) => `targetXuids=${id}`).join('&');\n return this.get<BansSummaryQueryResult>(`/hi/bans/summary?${playersQuery}`);\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { Configuration } from '../../models/halo-infinite/misc';\n\n/**\n * Configuration module for discovering API endpoints.\n *\n * @example\n * ```typescript\n * // Get API configuration\n * const config = await client.configuration.getApiSettingsContainer();\n * console.log(config.result?.endpoints);\n * ```\n */\nexport class ConfigurationModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.SETTINGS_ORIGIN);\n }\n\n /**\n * Get the API settings/configuration container.\n *\n * Returns the list of all available API endpoints and their configurations.\n *\n * @returns API configuration\n */\n getApiSettingsContainer(): Promise<HaloApiResult<Configuration>> {\n return this.getFullUrl<Configuration>(HALO_CORE_ENDPOINTS.HALO_INFINITE_SETTINGS, {\n useSpartanToken: false,\n });\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type {\n PlayerInventory,\n CurrencySnapshot,\n StoreItem,\n ActiveBoostsContainer,\n RewardSnapshot,\n TransactionSnapshot,\n} from '../../models/halo-infinite/economy';\nimport type {\n CustomizationData,\n ArmorCore,\n WeaponCore,\n VehicleCore,\n AiCore,\n ArmorCoreCollection,\n WeaponCoreCollection,\n VehicleCoreCollection,\n AiCoreContainer,\n SpartanBody,\n AppearanceCustomization,\n} from '../../models/halo-infinite/customization';\nimport type { RewardTrack, OperationRewardTrackSnapshot } from '../../models/halo-infinite/progression';\nimport type { PlayerGiveaways } from '../../models/halo-infinite/misc';\nimport type { RewardTrackResultContainer } from '../../models/halo-infinite/progression/career';\n\n/**\n * Economy module for player customization, inventory, and store access.\n *\n * Provides access to:\n * - Player inventory and currency balances\n * - Customization data (armor, weapons, vehicles, AI)\n * - In-game stores and offerings\n * - Active boosts and rewards\n * - Operation/battle pass progress\n *\n * @example\n * ```typescript\n * // Get player inventory\n * const inventory = await client.economy.getInventoryItems('xuid');\n *\n * // Get armor customization\n * const armor = await client.economy.armorCoresCustomization('xuid');\n *\n * // Get currency balances\n * const currencies = await client.economy.getVirtualCurrencyBalances('xuid');\n * ```\n */\nexport class EconomyModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.ECONOMY_ORIGIN);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Inventory & Currency\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get all inventory items for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Player inventory\n */\n getInventoryItems(player: string): Promise<HaloApiResult<PlayerInventory>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerInventory>(`/hi/players/xuid(${player})/inventory`);\n }\n\n /**\n * Get virtual currency balances for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Currency balances\n */\n getVirtualCurrencyBalances(player: string): Promise<HaloApiResult<CurrencySnapshot>> {\n this.assertNotEmpty(player, 'player');\n return this.get<CurrencySnapshot>(`/hi/players/xuid(${player})/currencies`);\n }\n\n /**\n * Post a currency transaction.\n *\n * @param player - Player's numeric XUID\n * @param currencyId - Currency identifier\n * @returns Transaction result\n */\n postCurrencyTransaction(\n player: string,\n currencyId: string\n ): Promise<HaloApiResult<TransactionSnapshot>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(currencyId, 'currencyId');\n return this.post<TransactionSnapshot>(\n `/hi/players/xuid(${player})/currencies/${currencyId}/transactions`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Customization\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get full player customization data.\n *\n * @param player - Player's numeric XUID\n * @param viewType - View type (e.g., 'public', 'private')\n * @returns Complete customization data\n */\n getPlayerCustomization(\n player: string,\n viewType: string = 'public'\n ): Promise<HaloApiResult<CustomizationData>> {\n this.assertNotEmpty(player, 'player');\n return this.get<CustomizationData>(\n `/hi/players/xuid(${player})/customization?view=${viewType}`\n );\n }\n\n /**\n * Get all armor cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Armor core collection\n */\n armorCoresCustomization(player: string): Promise<HaloApiResult<ArmorCoreCollection>> {\n this.assertNotEmpty(player, 'player');\n return this.get<ArmorCoreCollection>(`/hi/players/xuid(${player})/customization/armors`);\n }\n\n /**\n * Get a specific armor core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns Armor core details\n */\n armorCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<ArmorCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<ArmorCore>(`/hi/players/xuid(${player})/customization/armors/${coreId}`);\n }\n\n /**\n * Get all weapon cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Weapon core collection\n */\n weaponCoresCustomization(player: string): Promise<HaloApiResult<WeaponCoreCollection>> {\n this.assertNotEmpty(player, 'player');\n return this.get<WeaponCoreCollection>(`/hi/players/xuid(${player})/customization/weapons`);\n }\n\n /**\n * Get a specific weapon core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns Weapon core details\n */\n weaponCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<WeaponCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<WeaponCore>(`/hi/players/xuid(${player})/customization/weapons/${coreId}`);\n }\n\n /**\n * Get all vehicle cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Vehicle core collection\n */\n vehicleCoresCustomization(player: string): Promise<HaloApiResult<VehicleCoreCollection>> {\n this.assertNotEmpty(player, 'player');\n return this.get<VehicleCoreCollection>(`/hi/players/xuid(${player})/customization/vehicles`);\n }\n\n /**\n * Get a specific vehicle core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns Vehicle core details\n */\n vehicleCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<VehicleCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<VehicleCore>(`/hi/players/xuid(${player})/customization/vehicles/${coreId}`);\n }\n\n /**\n * Get all AI cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns AI core container\n */\n aiCoresCustomization(player: string): Promise<HaloApiResult<AiCoreContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AiCoreContainer>(`/hi/players/xuid(${player})/customization/ais`);\n }\n\n /**\n * Get a specific AI core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns AI core details\n */\n aiCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<AiCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<AiCore>(`/hi/players/xuid(${player})/customization/ais/${coreId}`);\n }\n\n /**\n * Get Spartan body customization for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Spartan body configuration\n */\n spartanBodyCustomization(player: string): Promise<HaloApiResult<SpartanBody>> {\n this.assertNotEmpty(player, 'player');\n return this.get<SpartanBody>(`/hi/players/xuid(${player})/customization/spartanbody`);\n }\n\n /**\n * Get appearance customization for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Appearance configuration\n */\n playerAppearanceCustomization(\n player: string\n ): Promise<HaloApiResult<AppearanceCustomization>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AppearanceCustomization>(\n `/hi/players/xuid(${player})/customization/appearance`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Stores\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get the main store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getMainStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/main`);\n }\n\n /**\n * Get the HCS (esports) store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getHcsStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/hcs`);\n }\n\n /**\n * Get the boosts store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getBoostsStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/boosts`);\n }\n\n /**\n * Get the soft currency (Spartan Points) store.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getSoftCurrencyStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/softcurrency`);\n }\n\n /**\n * Get the customization store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getCustomizationStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/customization`);\n }\n\n /**\n * Get the operations store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getOperationsStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/operations`);\n }\n\n /**\n * Get scheduled storefront offerings.\n *\n * @param player - Player's numeric XUID\n * @param storeId - Store identifier\n * @returns Scheduled store items\n */\n getScheduledStorefrontOfferings(\n player: string,\n storeId: string\n ): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(storeId, 'storeId');\n return this.get<StoreItem>(\n `/hi/players/xuid(${player})/stores/${storeId}/scheduled`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Boosts & Rewards\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get active boosts for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Active boosts container\n */\n getActiveBoosts(player: string): Promise<HaloApiResult<ActiveBoostsContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<ActiveBoostsContainer>(`/hi/players/xuid(${player})/boosts`);\n }\n\n /**\n * Get awarded rewards for a player.\n *\n * @param player - Player's numeric XUID\n * @param rewardId - Reward identifier\n * @returns Reward snapshot\n */\n getAwardedRewards(\n player: string,\n rewardId: string\n ): Promise<HaloApiResult<RewardSnapshot>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(rewardId, 'rewardId');\n return this.get<RewardSnapshot>(\n `/hi/players/xuid(${player})/rewards/${rewardId}`\n );\n }\n\n /**\n * Get giveaway rewards for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Available giveaways\n */\n getGiveawayRewards(player: string): Promise<HaloApiResult<PlayerGiveaways>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerGiveaways>(`/hi/players/xuid(${player})/giveaways`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Reward Tracks / Operations\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get reward track progress for a player.\n *\n * @param player - Player's numeric XUID\n * @param rewardTrackType - Type of reward track\n * @param trackId - Track identifier\n * @returns Reward track details\n */\n getRewardTrack(\n player: string,\n rewardTrackType: string,\n trackId: string\n ): Promise<HaloApiResult<RewardTrack>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(rewardTrackType, 'rewardTrackType');\n this.assertNotEmpty(trackId, 'trackId');\n return this.get<RewardTrack>(\n `/hi/players/xuid(${player})/rewardtracks/${rewardTrackType}/${trackId}`\n );\n }\n\n /**\n * Get operation progress for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Operation reward track snapshot\n */\n getPlayerOperations(\n player: string\n ): Promise<HaloApiResult<OperationRewardTrackSnapshot>> {\n this.assertNotEmpty(player, 'player');\n return this.get<OperationRewardTrackSnapshot>(\n `/hi/players/xuid(${player})/operations`,\n { useClearance: true }\n );\n }\n\n /**\n * Get career rank for players.\n *\n * @param playerIds - List of player XUIDs\n * @param careerPathId - Career path identifier\n * @returns Career rank results\n */\n getPlayerCareerRank(\n playerIds: string[],\n careerPathId: string\n ): Promise<HaloApiResult<RewardTrackResultContainer>> {\n if (!playerIds.length) {\n throw new Error('playerIds cannot be empty');\n }\n this.assertNotEmpty(careerPathId, 'careerPathId');\n\n const playersQuery = playerIds.map((id) => `players=xuid(${id})`).join('&');\n return this.get<RewardTrackResultContainer>(\n `/hi/careerranks/${careerPathId}?${playersQuery}`\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { DisplayString, CurrencyDefinition, StoreOffering } from '../../models/halo-infinite/economy';\nimport type { Challenge, ChallengeDeckDefinition, RewardTrackMetadata, CareerTrackContainer } from '../../models/halo-infinite/progression';\nimport type { MedalMetadata, News, SeasonCalendar, AcademyStarDefinitions } from '../../models/halo-infinite/misc';\n\n/**\n * In-game item definition from CMS.\n */\nexport interface InGameItem {\n /** Tag identifier */\n tagId?: number;\n /** Common item data */\n commonData?: CommonItemData;\n /** Image path */\n imagePath?: string;\n /** Is kit */\n isKit?: boolean;\n /** Quality */\n quality?: string;\n}\n\n/**\n * Common data for in-game items.\n */\nexport interface CommonItemData {\n /** Item identifier */\n id?: string;\n /** Title */\n title?: DisplayString;\n /** Description */\n description?: DisplayString;\n /** Quality tier */\n quality?: string;\n /** Manufacturing season */\n manufacturingSeason?: string;\n}\n\n/**\n * Inventory definition from CMS.\n */\nexport interface InventoryDefinition {\n /** Item definitions */\n items?: Record<string, InGameItem>;\n}\n\n/**\n * Metadata container.\n */\nexport interface Metadata {\n /** Season info */\n season?: SeasonInfo;\n /** Active playlists */\n playlists?: PlaylistInfo[];\n}\n\n/**\n * Season info from metadata.\n */\nexport interface SeasonInfo {\n /** Season identifier */\n seasonId?: string;\n /** Season number */\n seasonNumber?: number;\n}\n\n/**\n * Playlist info.\n */\nexport interface PlaylistInfo {\n /** Playlist ID */\n playlistId?: string;\n /** Playlist name */\n name?: DisplayString;\n /** Description */\n description?: DisplayString;\n}\n\n/**\n * Game CMS module for static content and definitions.\n *\n * Provides access to:\n * - Item definitions\n * - Challenge definitions\n * - Season and career metadata\n * - Medal information\n * - News and guides\n *\n * @example\n * ```typescript\n * // Get medal metadata\n * const medals = await client.gameCms.getMedalMetadata();\n *\n * // Get career ranks\n * const careerRanks = await client.gameCms.getCareerRanks('career-path-id');\n *\n * // Get item definition\n * const item = await client.gameCms.getItem('item/path/here', 'flight-id');\n * ```\n */\nexport class GameCmsModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.GAME_CMS_ORIGIN);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Items & Inventory\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get an item definition by path.\n *\n * @param itemPath - Path to the item\n * @param flightId - Flight ID for clearance\n * @returns Item definition\n */\n getItem(itemPath: string, flightId?: string): Promise<HaloApiResult<InGameItem>> {\n this.assertNotEmpty(itemPath, 'itemPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<InGameItem>(`/hi/Progression/file/${itemPath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get the customization catalog/inventory definitions.\n *\n * @param flightId - Optional flight ID for flighted content\n * @returns Inventory definition\n */\n getCustomizationCatalog(flightId?: string): Promise<HaloApiResult<InventoryDefinition>> {\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<InventoryDefinition>(`/hi/Progression/file/inventory/catalog${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get a store offering definition.\n *\n * @param offeringPath - Path to the offering\n * @returns Store offering\n */\n getStoreOffering(offeringPath: string): Promise<HaloApiResult<StoreOffering>> {\n this.assertNotEmpty(offeringPath, 'offeringPath');\n return this.get<StoreOffering>(`/hi/Progression/file/${offeringPath}`);\n }\n\n /**\n * Get a currency definition.\n *\n * @param currencyPath - Path to the currency\n * @param flightId - Optional flight ID\n * @returns Currency definition\n */\n getCurrency(\n currencyPath: string,\n flightId?: string\n ): Promise<HaloApiResult<CurrencyDefinition>> {\n this.assertNotEmpty(currencyPath, 'currencyPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<CurrencyDefinition>(`/hi/Progression/file/${currencyPath}${flightParam}`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Challenges & Events\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get a challenge definition.\n *\n * @param challengePath - Path to the challenge\n * @param flightId - Optional flight ID\n * @returns Challenge definition\n */\n getChallenge(\n challengePath: string,\n flightId?: string\n ): Promise<HaloApiResult<Challenge>> {\n this.assertNotEmpty(challengePath, 'challengePath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<Challenge>(`/hi/Progression/file/${challengePath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get a challenge deck definition.\n *\n * @param challengeDeckPath - Path to the challenge deck\n * @param flightId - Optional flight ID\n * @returns Challenge deck definition\n */\n getChallengeDeck(\n challengeDeckPath: string,\n flightId?: string\n ): Promise<HaloApiResult<ChallengeDeckDefinition>> {\n this.assertNotEmpty(challengeDeckPath, 'challengeDeckPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<ChallengeDeckDefinition>(\n `/hi/Progression/file/${challengeDeckPath}${flightParam}`,\n { useClearance: !!flightId }\n );\n }\n\n /**\n * Get an event/reward track definition.\n *\n * @param eventPath - Path to the event\n * @param flightId - Optional flight ID\n * @returns Reward track metadata\n */\n getEvent(\n eventPath: string,\n flightId?: string\n ): Promise<HaloApiResult<RewardTrackMetadata>> {\n this.assertNotEmpty(eventPath, 'eventPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<RewardTrackMetadata>(`/hi/Progression/file/${eventPath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Career & Seasons\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get career rank definitions.\n *\n * @param careerPathId - Career path identifier\n * @returns Career track container\n */\n getCareerRanks(careerPathId: string): Promise<HaloApiResult<CareerTrackContainer>> {\n this.assertNotEmpty(careerPathId, 'careerPathId');\n return this.get<CareerTrackContainer>(`/hi/Progression/file/careerranks/${careerPathId}`);\n }\n\n /**\n * Get the season calendar.\n *\n * @returns Season calendar\n */\n getSeasonCalendar(): Promise<HaloApiResult<SeasonCalendar>> {\n return this.get<SeasonCalendar>('/hi/Progression/file/calendars/seasons');\n }\n\n /**\n * Get the CSR/ranked season calendar.\n *\n * @returns CSR season calendar\n */\n getCsrCalendar(): Promise<HaloApiResult<SeasonCalendar>> {\n return this.get<SeasonCalendar>('/hi/Progression/file/calendars/csrseasons');\n }\n\n /**\n * Get a season reward track definition.\n *\n * @param seasonPath - Path to the season\n * @param flightId - Optional flight ID\n * @returns Season reward track\n */\n getSeasonRewardTrack(\n seasonPath: string,\n flightId?: string\n ): Promise<HaloApiResult<RewardTrackMetadata>> {\n this.assertNotEmpty(seasonPath, 'seasonPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<RewardTrackMetadata>(`/hi/Progression/file/${seasonPath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Medals & Metadata\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get medal metadata and definitions.\n *\n * @returns Medal metadata\n */\n getMedalMetadata(): Promise<HaloApiResult<MedalMetadata>> {\n return this.get<MedalMetadata>('/hi/Progression/file/medals/metadata');\n }\n\n /**\n * Get general game metadata.\n *\n * @param flightId - Optional flight ID\n * @returns Metadata\n */\n getMetadata(flightId?: string): Promise<HaloApiResult<Metadata>> {\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<Metadata>(`/hi/Progression/file/metadata${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n // ─────────────────────────────────────────────────────────────────\n // News & Guides\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get news articles.\n *\n * @param filePath - Path to news file\n * @returns News collection\n */\n getNews(filePath: string): Promise<HaloApiResult<News>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<News>(`/hi/news/${filePath}`);\n }\n\n /**\n * Get academy star definitions.\n *\n * @returns Star definitions\n */\n getAcademyStarDefinitions(): Promise<HaloApiResult<AcademyStarDefinitions>> {\n return this.get<AcademyStarDefinitions>('/hi/Progression/file/academy/stars');\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Raw Files & Images\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get an image file from the CMS.\n *\n * @param filePath - Path to the image\n * @returns Image data as bytes\n */\n getImage(filePath: string): Promise<HaloApiResult<Uint8Array>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<Uint8Array>(`/hi/images/file/${filePath}`);\n }\n\n /**\n * Get a generic file from the CMS.\n *\n * @param filePath - Path to the file\n * @returns File data as bytes\n */\n getGenericFile(filePath: string): Promise<HaloApiResult<Uint8Array>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<Uint8Array>(`/hi/Progression/file/${filePath}`);\n }\n\n /**\n * Get a raw progression file with custom type.\n *\n * @template T - Expected return type\n * @param filePath - Path to the file\n * @returns Typed file contents\n */\n getProgressionFile<T>(filePath: string): Promise<HaloApiResult<T>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<T>(`/hi/Progression/file/${filePath}`);\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type {\n Server,\n LobbyPresenceRequestContainer,\n LobbyPresenceContainer,\n LobbyJoinHandle,\n JoinLobbyResponse,\n} from '../../models/halo-infinite/misc';\n\n/**\n * Lobby module for multiplayer lobby and presence APIs.\n *\n * @example\n * ```typescript\n * // Get QoS servers\n * const servers = await client.lobby.getQosServers();\n *\n * // Check player presence\n * const presence = await client.lobby.presence({\n * requests: [{ playerId: 'xuid', sessionId: 'session-id' }]\n * });\n * ```\n */\nexport class LobbyModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.LOBBY_ORIGIN);\n }\n\n /**\n * Get available QoS (Quality of Service) servers.\n *\n * @returns List of servers\n */\n getQosServers(): Promise<HaloApiResult<Server[]>> {\n return this.get<Server[]>('/hi/qosservers');\n }\n\n /**\n * Check presence for players in lobbies.\n *\n * @param presenceRequest - Presence request container\n * @returns Presence results\n */\n presence(\n presenceRequest: LobbyPresenceRequestContainer\n ): Promise<HaloApiResult<LobbyPresenceContainer>> {\n return this.postJson<LobbyPresenceContainer, LobbyPresenceRequestContainer>(\n '/hi/presence',\n presenceRequest\n );\n }\n\n /**\n * Get a third-party join handle for a lobby.\n *\n * @param lobbyId - Lobby identifier\n * @param player - Player XUID\n * @param handleAudience - Handle audience\n * @param handlePlatform - Handle platform\n * @returns Join handle\n */\n getThirdPartyJoinHandle(\n lobbyId: string,\n player: string,\n handleAudience: string,\n handlePlatform: string\n ): Promise<HaloApiResult<LobbyJoinHandle>> {\n this.assertNotEmpty(lobbyId, 'lobbyId');\n this.assertNotEmpty(player, 'player');\n return this.get<LobbyJoinHandle>(\n `/hi/lobbies/${lobbyId}/players/xuid(${player})/joinhandle?handleAudience=${handleAudience}&handlePlatform=${handlePlatform}`\n );\n }\n\n /**\n * Join a lobby.\n *\n * @param lobbyId - Lobby identifier\n * @param player - Player XUID\n * @param auth - Auth string\n * @param lobbyBootstrapPayload - Bootstrap payload\n * @returns Join response\n */\n joinLobby(\n lobbyId: string,\n player: string,\n auth: string,\n lobbyBootstrapPayload: Uint8Array\n ): Promise<HaloApiResult<JoinLobbyResponse>> {\n this.assertNotEmpty(lobbyId, 'lobbyId');\n this.assertNotEmpty(player, 'player');\n\n return this.client.executeRequest<JoinLobbyResponse>(\n this.buildUrl(`/hi/lobbies/${lobbyId}/players/xuid(${player})?auth=${auth}`),\n 'POST',\n {\n body: lobbyBootstrapPayload,\n contentType: 'bond' as any,\n }\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { FlightedFeatureFlags } from '../../models/halo-infinite/misc';\n\n/**\n * Settings module for clearance and flight configuration.\n *\n * @example\n * ```typescript\n * // Get clearance level\n * const clearance = await client.settings.getClearanceLevel();\n * ```\n */\nexport class SettingsModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.SETTINGS_ORIGIN);\n }\n\n /**\n * Get the clearance level for the current player.\n *\n * Returns feature flags and flight IDs the player has access to.\n *\n * @returns Flighted feature flags\n */\n getClearanceLevel(): Promise<HaloApiResult<FlightedFeatureFlags>> {\n return this.get<FlightedFeatureFlags>('/hi/clearance', {\n useSpartanToken: true,\n });\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { MatchSkillInfo, PlaylistCsrResultContainer } from '../../models/halo-infinite/skill';\n\n/**\n * Skill module for CSR (Competitive Skill Rank) queries.\n *\n * Provides access to:\n * - Match skill results (CSR changes after a match)\n * - Playlist CSR for players\n *\n * @example\n * ```typescript\n * // Get CSR for a player in a playlist\n * const csr = await client.skill.getPlaylistCsr('playlist-id', ['xuid1', 'xuid2']);\n *\n * // Get skill results for a match\n * const matchSkill = await client.skill.getMatchPlayerResult('match-id', ['xuid1']);\n * ```\n */\nexport class SkillModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.SKILL_ORIGIN);\n }\n\n /**\n * Get skill/CSR changes for players in a specific match.\n *\n * @param matchId - Match ID in GUID format\n * @param playerIds - List of player XUIDs to query\n * @returns Skill info for each player\n */\n getMatchPlayerResult(\n matchId: string,\n playerIds: string[]\n ): Promise<HaloApiResult<MatchSkillInfo>> {\n this.assertNotEmpty(matchId, 'matchId');\n if (!playerIds.length) {\n throw new Error('playerIds cannot be empty');\n }\n\n const playersQuery = playerIds.map((id) => `players=xuid(${id})`).join('&');\n return this.get<MatchSkillInfo>(\n `/hi/matches/${matchId}/skill?${playersQuery}`\n );\n }\n\n /**\n * Get current CSR for players in a specific playlist.\n *\n * @param playlistId - Playlist ID in GUID format\n * @param playerIds - List of player XUIDs to query\n * @param seasonId - Optional season ID for season-specific CSR\n * @returns CSR results for each player\n */\n getPlaylistCsr(\n playlistId: string,\n playerIds: string[],\n seasonId?: string\n ): Promise<HaloApiResult<PlaylistCsrResultContainer>> {\n this.assertNotEmpty(playlistId, 'playlistId');\n if (!playerIds.length) {\n throw new Error('playerIds cannot be empty');\n }\n\n const playersQuery = playerIds.map((id) => `players=xuid(${id})`).join('&');\n const seasonParam = seasonId ? `&seasonId=${seasonId}` : '';\n return this.get<PlaylistCsrResultContainer>(\n `/hi/playlist/${playlistId}/csrs?${playersQuery}${seasonParam}`\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { MatchType } from '../../models/halo-infinite/enums/match-type';\nimport type { LifecycleMode } from '../../models/halo-infinite/enums/lifecycle-mode';\nimport type {\n MatchStats,\n MatchHistoryResponse,\n PlayerMatchCount,\n PlayerServiceRecord,\n} from '../../models/halo-infinite/match';\nimport type { ChallengeDecksResponse, MatchProgression } from '../../models/halo-infinite/progression';\nimport type { MatchesPrivacy, PlayerDailyCustomExperience } from '../../models/halo-infinite/misc';\n\n/**\n * Stats module for match history and service records.\n *\n * Provides access to:\n * - Match history for players\n * - Individual match statistics\n * - Player service records (career stats)\n * - Challenge decks and progression\n *\n * @example\n * ```typescript\n * // Get match history\n * const history = await client.stats.getMatchHistory('xuid', 0, 25, MatchType.All);\n *\n * // Get specific match details\n * const match = await client.stats.getMatchStats('match-guid-here');\n *\n * // Get player service record\n * const record = await client.stats.getPlayerServiceRecordByXuid('xuid', LifecycleMode.Matchmade);\n * ```\n */\nexport class StatsModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.STATS_ORIGIN);\n }\n\n /**\n * Get challenge decks available for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Challenge decks response\n */\n getChallengeDecks(player: string): Promise<HaloApiResult<ChallengeDecksResponse>> {\n this.assertNotEmpty(player, 'player');\n return this.get<ChallengeDecksResponse>(`/hi/players/xuid(${player})/decks`);\n }\n\n /**\n * Get match count summary for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Match count breakdown by type\n */\n getMatchCount(player: string): Promise<HaloApiResult<PlayerMatchCount>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerMatchCount>(`/hi/players/xuid(${player})/matches/count`);\n }\n\n /**\n * Get match history for a player.\n *\n * @param player - Player's numeric XUID\n * @param start - Starting index for pagination (0-based)\n * @param count - Number of matches to return (max 25)\n * @param type - Type of matches to query\n * @returns Paginated match history\n */\n getMatchHistory(\n player: string,\n start: number,\n count: number,\n type: MatchType\n ): Promise<HaloApiResult<MatchHistoryResponse>> {\n this.assertNotEmpty(player, 'player');\n this.assertRange(count, 1, 25, 'count');\n this.assertRange(start, 0, Number.MAX_SAFE_INTEGER, 'start');\n\n return this.get<MatchHistoryResponse>(\n `/hi/players/xuid(${player})/matches?start=${start}&count=${count}&type=${type}`\n );\n }\n\n /**\n * Get detailed statistics for a specific match.\n *\n * @param matchId - Match ID in GUID format\n * @returns Complete match statistics\n */\n getMatchStats(matchId: string): Promise<HaloApiResult<MatchStats>> {\n this.assertNotEmpty(matchId, 'matchId');\n return this.get<MatchStats>(`/hi/matches/${matchId}/stats`);\n }\n\n /**\n * Get challenge progression for a player in a specific match.\n *\n * @param player - Player's numeric XUID\n * @param matchId - Match ID in GUID format\n * @returns Match progression details\n */\n getPlayerMatchProgression(\n player: string,\n matchId: string\n ): Promise<HaloApiResult<MatchProgression>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(matchId, 'matchId');\n\n return this.get<MatchProgression>(\n `/hi/players/xuid(${player})/matches/${matchId}/progression`\n );\n }\n\n /**\n * Get match privacy settings for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Privacy settings\n */\n getMatchPrivacy(player: string): Promise<HaloApiResult<MatchesPrivacy>> {\n this.assertNotEmpty(player, 'player');\n return this.get<MatchesPrivacy>(`/hi/players/xuid(${player})/matches-privacy`);\n }\n\n /**\n * Get service record for a player by XUID.\n *\n * The service record contains aggregate career statistics.\n *\n * @param xuid - Player's numeric XUID\n * @param mode - Lifecycle mode (matchmade, custom, local)\n * @param seasonId - Optional season ID for season-specific stats\n * @returns Player service record\n */\n getPlayerServiceRecordByXuid(\n xuid: string,\n mode: LifecycleMode,\n seasonId?: string\n ): Promise<HaloApiResult<PlayerServiceRecord>> {\n this.assertNotEmpty(xuid, 'xuid');\n\n const seasonParam = seasonId ? `?seasonId=${seasonId}` : '';\n return this.get<PlayerServiceRecord>(\n `/hi/players/xuid(${xuid})/${mode}/servicerecord${seasonParam}`\n );\n }\n\n /**\n * Get service record for a player by gamertag.\n *\n * @param gamertag - Player's gamertag\n * @param mode - Lifecycle mode (matchmade, custom, local)\n * @param seasonId - Optional season ID for season-specific stats\n * @returns Player service record\n */\n getPlayerServiceRecordByGamertag(\n gamertag: string,\n mode: LifecycleMode,\n seasonId?: string\n ): Promise<HaloApiResult<PlayerServiceRecord>> {\n this.assertNotEmpty(gamertag, 'gamertag');\n\n const encodedGamertag = encodeURIComponent(gamertag);\n const seasonParam = seasonId ? `?seasonId=${seasonId}` : '';\n return this.get<PlayerServiceRecord>(\n `/hi/players/${encodedGamertag}/${mode}/servicerecord${seasonParam}`\n );\n }\n\n /**\n * Get daily custom game XP for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Daily custom experience info\n */\n getPlayerDailyCustomExperience(\n player: string\n ): Promise<HaloApiResult<PlayerDailyCustomExperience>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerDailyCustomExperience>(\n `/hi/players/xuid(${player})/customexperience`\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\n\n/**\n * Text moderation key response.\n */\nexport interface ModerationKey {\n /** The moderation key */\n key?: string;\n /** Expiration time (ISO 8601) */\n expiresAt?: string;\n}\n\n/**\n * Text Moderation module for moderation-related APIs.\n *\n * @example\n * ```typescript\n * // Get moderation key\n * const key = await client.textModeration.getModerationKey();\n * ```\n */\nexport class TextModerationModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.TEXT_ORIGIN);\n }\n\n /**\n * Get a moderation key for text validation.\n *\n * @returns Moderation key\n */\n getModerationKey(): Promise<HaloApiResult<ModerationKey>> {\n return this.get<ModerationKey>('/hi/moderation/key');\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { AssetKind } from '../../models/halo-infinite/enums/asset-kind';\nimport type {\n AuthoringAsset,\n AuthoringAssetVersion,\n AuthoringAssetContainer,\n AuthoringAssetVersionContainer,\n AuthoringAssetRating,\n AuthoringFavoritesContainer,\n FavoriteAsset,\n Permission,\n AssetReport,\n AssetAuthoringSession,\n AuthoringSessionSourceStarter,\n} from '../../models/halo-infinite/ugc';\n\n/**\n * UGC (User Generated Content) module for authoring operations.\n *\n * Provides access to:\n * - Creating, editing, and deleting user content\n * - Managing asset permissions\n * - Rating and favoriting assets\n * - Publishing and unpublishing assets\n *\n * @example\n * ```typescript\n * // Get an asset\n * const asset = await client.ugc.getAsset('hi', 'Map', 'asset-guid');\n *\n * // Favorite an asset\n * await client.ugc.favoriteAnAsset('xuid', 'Map', 'asset-guid');\n *\n * // List player's assets\n * const assets = await client.ugc.listPlayerAssets('hi', 'xuid', 'Map', 0, 25);\n * ```\n */\nexport class UgcModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.AUTHORING_ORIGIN);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Asset Retrieval\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get an asset by ID.\n *\n * @param title - Game title (e.g., 'hi' for Halo Infinite)\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Asset details\n */\n getAsset(\n title: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAsset>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAsset>(`/${title}/${assetType}/${assetId}`);\n }\n\n /**\n * Get the latest version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Latest asset version\n */\n getLatestAssetVersion(\n title: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetVersion>(`/${title}/${assetType}/${assetId}/versions/latest`);\n }\n\n /**\n * Get a specific version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @returns Asset version\n */\n getSpecificAssetVersion(\n title: string,\n assetType: AssetKind,\n assetId: string,\n versionId: string\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.get<AuthoringAssetVersion>(\n `/${title}/${assetType}/${assetId}/versions/${versionId}`\n );\n }\n\n /**\n * Get the published version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Published asset version\n */\n getPublishedVersion(\n title: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetVersion>(`/${title}/${assetType}/${assetId}/versions/published`);\n }\n\n /**\n * List all versions of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns All asset versions\n */\n listAllVersions(\n title: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetVersionContainer>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetVersionContainer>(`/${title}/${assetType}/${assetId}/versions`);\n }\n\n /**\n * List assets created by a player.\n *\n * @param title - Game title\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Player's assets\n */\n listPlayerAssets(\n title: string,\n player: string,\n assetType: AssetKind,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<AuthoringAssetContainer>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(player, 'player');\n return this.get<AuthoringAssetContainer>(\n `/${title}/players/xuid(${player})/${assetType}?start=${start}&count=${count}`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Favorites\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Favorite an asset.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Favorite result\n */\n favoriteAnAsset(\n player: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<FavoriteAsset>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.postJson<FavoriteAsset, { assetId: string; assetKind: AssetKind }>(\n `/hi/players/xuid(${player})/favorites`,\n { assetId, assetKind: assetType }\n );\n }\n\n /**\n * Check if a player has bookmarked an asset.\n *\n * @param title - Game title\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Favorite status\n */\n checkAssetPlayerBookmark(\n title: string,\n player: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<FavoriteAsset>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<FavoriteAsset>(\n `/${title}/players/xuid(${player})/favorites/${assetType}/${assetId}`\n );\n }\n\n /**\n * List player's favorite assets of a specific type.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @returns Favorites container\n */\n listPlayerFavorites(\n player: string,\n assetType: AssetKind\n ): Promise<HaloApiResult<AuthoringFavoritesContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AuthoringFavoritesContainer>(\n `/hi/players/xuid(${player})/favorites/${assetType}`\n );\n }\n\n /**\n * List all of a player's favorite assets.\n *\n * @param player - Player XUID\n * @returns All favorites\n */\n listPlayerFavoritesAgnostic(\n player: string\n ): Promise<HaloApiResult<AuthoringFavoritesContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AuthoringFavoritesContainer>(`/hi/players/xuid(${player})/favorites`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Ratings & Reports\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get a player's rating for an asset.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Rating info\n */\n getAssetRatings(\n player: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetRating>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetRating>(\n `/hi/players/xuid(${player})/ratings/${assetType}/${assetId}`\n );\n }\n\n /**\n * Rate an asset.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param rating - Rating to submit\n * @returns Updated rating\n */\n rateAnAsset(\n player: string,\n assetType: AssetKind,\n assetId: string,\n rating: AuthoringAssetRating\n ): Promise<HaloApiResult<AuthoringAssetRating>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.putJson<AuthoringAssetRating, AuthoringAssetRating>(\n `/hi/players/xuid(${player})/ratings/${assetType}/${assetId}`,\n rating\n );\n }\n\n /**\n * Report an asset for moderation.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param report - Report details\n * @returns Report result\n */\n reportAnAsset(\n player: string,\n assetType: AssetKind,\n assetId: string,\n report: AssetReport\n ): Promise<HaloApiResult<AssetReport>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.postJson<AssetReport, AssetReport>(\n `/hi/players/xuid(${player})/reports/${assetType}/${assetId}`,\n report\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Asset Management\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Delete an asset and all its versions.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Success status\n */\n deleteAllVersions(\n title: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.delete<boolean>(`/${title}/${assetType}/${assetId}`);\n }\n\n /**\n * Delete a specific version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @returns Success status\n */\n deleteVersion(\n title: string,\n assetType: AssetKind,\n assetId: string,\n versionId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.delete<boolean>(`/${title}/${assetType}/${assetId}/versions/${versionId}`);\n }\n\n /**\n * Publish an asset version.\n *\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @param clearanceId - Clearance ID\n * @returns Success status\n */\n publishAssetVersion(\n assetType: AssetKind,\n assetId: string,\n versionId: string,\n clearanceId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.post<boolean>(\n `/hi/${assetType}/${assetId}/versions/${versionId}/publish?clearanceId=${clearanceId}`\n );\n }\n\n /**\n * Unpublish an asset.\n *\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Success status\n */\n unpublishAsset(\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(assetId, 'assetId');\n return this.post<boolean>(`/hi/${assetType}/${assetId}/unpublish`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Permissions\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Grant or revoke permissions for an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param player - Player XUID to grant/revoke\n * @param permission - Permission details\n * @returns Updated permission\n */\n grantOrRevokePermissions(\n title: string,\n assetType: AssetKind,\n assetId: string,\n player: string,\n permission: Permission\n ): Promise<HaloApiResult<Permission>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(player, 'player');\n return this.putJson<Permission, Permission>(\n `/${title}/${assetType}/${assetId}/permissions/xuid(${player})`,\n permission\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Sessions\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Start an authoring session for an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param includeContainerSas - Include container SAS URL\n * @returns Session details\n */\n startSession(\n title: string,\n assetType: AssetKind,\n assetId: string,\n includeContainerSas: boolean = false\n ): Promise<HaloApiResult<AssetAuthoringSession>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.post<AssetAuthoringSession>(\n `/${title}/${assetType}/${assetId}/sessions?includeContainerSas=${includeContainerSas}`\n );\n }\n\n /**\n * Extend an authoring session.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param includeContainerSas - Include container SAS URL\n * @returns Extended session\n */\n extendSession(\n title: string,\n assetType: AssetKind,\n assetId: string,\n includeContainerSas: boolean = false\n ): Promise<HaloApiResult<AssetAuthoringSession>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.putJson<AssetAuthoringSession, Record<string, never>>(\n `/${title}/${assetType}/${assetId}/sessions?includeContainerSas=${includeContainerSas}`,\n {}\n );\n }\n\n /**\n * End an authoring session.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Success status\n */\n endSession(\n title: string,\n assetType: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.delete<boolean>(`/${title}/${assetType}/${assetId}/sessions`);\n }\n\n /**\n * Create a new asset version.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param starter - Source asset to clone from\n * @returns New asset version\n */\n createAssetVersion(\n title: string,\n assetType: AssetKind,\n assetId: string,\n starter: AuthoringSessionSourceStarter\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.postJson<AuthoringAssetVersion, AuthoringSessionSourceStarter>(\n `/${title}/${assetType}/${assetId}/versions`,\n starter\n );\n }\n\n /**\n * Patch an asset version.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @param patchedAsset - Updated asset data\n * @returns Updated asset version\n */\n patchAssetVersion(\n title: string,\n assetType: AssetKind,\n assetId: string,\n versionId: string,\n patchedAsset: Partial<AuthoringAssetVersion>\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.patchJson<AuthoringAssetVersion, Partial<AuthoringAssetVersion>>(\n `/${title}/${assetType}/${assetId}/versions/${versionId}`,\n patchedAsset\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Blob Storage\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get a blob from UGC storage.\n *\n * @param blobPath - Path to the blob\n * @returns Blob data as bytes\n */\n getBlob(blobPath: string): Promise<HaloApiResult<Uint8Array>> {\n this.assertNotEmpty(blobPath, 'blobPath');\n const blobUrl = `https://${HALO_CORE_ENDPOINTS.BLOBS_ORIGIN}.${HALO_CORE_ENDPOINTS.SERVICE_DOMAIN}${blobPath}`;\n return this.getFullUrl<Uint8Array>(blobUrl, { useSpartanToken: false });\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { AssetKind } from '../../models/halo-infinite/enums/asset-kind';\nimport type { ResultOrder } from '../../models/halo-infinite/enums/result-order';\nimport type { UgcSearchResult, AuthoringAsset } from '../../models/halo-infinite/ugc';\n\n/**\n * UGC Discovery module for searching and browsing user content.\n *\n * Provides access to:\n * - Searching for maps, game variants, and other content\n * - Browsing featured and popular content\n * - Getting recommended content\n *\n * @example\n * ```typescript\n * // Search for maps\n * const maps = await client.ugcDiscovery.search({\n * assetKinds: [AssetKind.Map],\n * term: 'blood gulch',\n * count: 10,\n * });\n *\n * // Get featured maps\n * const featured = await client.ugcDiscovery.getFeatured('Map');\n * ```\n */\nexport class UgcDiscoveryModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.DISCOVERY_ORIGIN);\n }\n\n /**\n * Search for user-generated content.\n *\n * @param params - Search parameters\n * @returns Search results\n */\n search(params: {\n /** Search term */\n term?: string;\n /** Asset kinds to include */\n assetKinds?: AssetKind[];\n /** Tags to filter by */\n tags?: string[];\n /** Author XUID */\n author?: string;\n /** Sort field */\n sort?: string;\n /** Sort order */\n order?: ResultOrder;\n /** Number of results */\n count?: number;\n /** Starting offset */\n start?: number;\n }): Promise<HaloApiResult<UgcSearchResult>> {\n const queryParts: string[] = [];\n\n if (params.term) {\n queryParts.push(`term=${encodeURIComponent(params.term)}`);\n }\n if (params.assetKinds?.length) {\n params.assetKinds.forEach((kind) => {\n queryParts.push(`assetKind=${kind}`);\n });\n }\n if (params.tags?.length) {\n params.tags.forEach((tag) => {\n queryParts.push(`tags=${encodeURIComponent(tag)}`);\n });\n }\n if (params.author) {\n queryParts.push(`author=xuid(${params.author})`);\n }\n if (params.sort) {\n queryParts.push(`sort=${params.sort}`);\n }\n if (params.order) {\n queryParts.push(`order=${params.order}`);\n }\n if (params.count !== undefined) {\n queryParts.push(`count=${params.count}`);\n }\n if (params.start !== undefined) {\n queryParts.push(`start=${params.start}`);\n }\n\n const queryString = queryParts.length > 0 ? `?${queryParts.join('&')}` : '';\n return this.get<UgcSearchResult>(`/hi/search${queryString}`);\n }\n\n /**\n * Get featured content of a specific type.\n *\n * @param assetKind - Type of asset\n * @returns Featured assets\n */\n getFeatured(assetKind: AssetKind): Promise<HaloApiResult<UgcSearchResult>> {\n return this.get<UgcSearchResult>(`/hi/featured/${assetKind}`);\n }\n\n /**\n * Get popular content of a specific type.\n *\n * @param assetKind - Type of asset\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Popular assets\n */\n getPopular(\n assetKind: AssetKind,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<UgcSearchResult>> {\n return this.get<UgcSearchResult>(\n `/hi/popular/${assetKind}?start=${start}&count=${count}`\n );\n }\n\n /**\n * Get recent content of a specific type.\n *\n * @param assetKind - Type of asset\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Recent assets\n */\n getRecent(\n assetKind: AssetKind,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<UgcSearchResult>> {\n return this.get<UgcSearchResult>(\n `/hi/recent/${assetKind}?start=${start}&count=${count}`\n );\n }\n\n /**\n * Get recommended content for a player.\n *\n * @param player - Player XUID\n * @param assetKind - Type of asset\n * @param count - Number of results\n * @returns Recommended assets\n */\n getRecommended(\n player: string,\n assetKind: AssetKind,\n count: number = 10\n ): Promise<HaloApiResult<UgcSearchResult>> {\n this.assertNotEmpty(player, 'player');\n return this.get<UgcSearchResult>(\n `/hi/players/xuid(${player})/recommendations/${assetKind}?count=${count}`\n );\n }\n\n /**\n * Browse content by tag.\n *\n * @param assetKind - Type of asset\n * @param tag - Tag to filter by\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Tagged assets\n */\n browseByTag(\n assetKind: AssetKind,\n tag: string,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<UgcSearchResult>> {\n this.assertNotEmpty(tag, 'tag');\n return this.get<UgcSearchResult>(\n `/hi/tags/${encodeURIComponent(tag)}/${assetKind}?start=${start}&count=${count}`\n );\n }\n\n /**\n * Get asset details for discovery purposes.\n *\n * @param assetKind - Type of asset\n * @param assetId - Asset GUID\n * @returns Asset details\n */\n getAssetDetails(\n assetKind: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAsset>> {\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAsset>(`/hi/${assetKind}/${assetId}`);\n }\n\n /**\n * Get film asset for a match.\n *\n * @param matchId - Match GUID\n * @returns Film asset if available\n */\n getFilmByMatchId(matchId: string): Promise<HaloApiResult<AuthoringAsset>> {\n this.assertNotEmpty(matchId, 'matchId');\n return this.get<AuthoringAsset>(`/hi/films/matches/${matchId}/spectate`);\n }\n}\n","import { ClientBase } from './base/client-base';\nimport type { HaloInfiniteClientOptions } from '../models/common/client-options';\n\n// Module imports\nimport { AcademyModule } from '../modules/halo-infinite/academy.module';\nimport { BanProcessorModule } from '../modules/halo-infinite/ban-processor.module';\nimport { ConfigurationModule } from '../modules/halo-infinite/configuration.module';\nimport { EconomyModule } from '../modules/halo-infinite/economy.module';\nimport { GameCmsModule } from '../modules/halo-infinite/game-cms.module';\nimport { LobbyModule } from '../modules/halo-infinite/lobby.module';\nimport { SettingsModule } from '../modules/halo-infinite/settings.module';\nimport { SkillModule } from '../modules/halo-infinite/skill.module';\nimport { StatsModule } from '../modules/halo-infinite/stats.module';\nimport { TextModerationModule } from '../modules/halo-infinite/text-moderation.module';\nimport { UgcModule } from '../modules/halo-infinite/ugc.module';\nimport { UgcDiscoveryModule } from '../modules/halo-infinite/ugc-discovery.module';\n\n/**\n * Main client for interacting with Halo Infinite APIs.\n *\n * Provides access to all API functionality through domain-specific modules.\n * Modules are lazily initialized on first access to minimize memory usage.\n *\n * @example\n * ```typescript\n * import { HaloInfiniteClient, MatchType, LifecycleMode, isSuccess } from '@dendev/grunt';\n *\n * // Create client with authentication\n * const client = new HaloInfiniteClient({\n * spartanToken: 'your-spartan-token',\n * xuid: 'xuid',\n * clearanceToken: 'flight-clearance-id',\n * });\n *\n * // Get match history\n * const history = await client.stats.getMatchHistory('xuid', 0, 25, MatchType.All);\n * if (isSuccess(history)) {\n * console.log(`Found ${history.result.resultCount} matches`);\n * }\n *\n * // Get player inventory\n * const inventory = await client.economy.getInventoryItems('xuid');\n *\n * // Get CSR for a playlist\n * const csr = await client.skill.getPlaylistCsr('playlist-id', ['xuid']);\n *\n * // Search for UGC maps\n * const maps = await client.ugcDiscovery.search({\n * assetKinds: [AssetKind.Map],\n * term: 'blood gulch',\n * });\n * ```\n */\nexport class HaloInfiniteClient extends ClientBase {\n // Lazy-loaded module instances\n private _academy?: AcademyModule;\n private _banProcessor?: BanProcessorModule;\n private _configuration?: ConfigurationModule;\n private _economy?: EconomyModule;\n private _gameCms?: GameCmsModule;\n private _lobby?: LobbyModule;\n private _settings?: SettingsModule;\n private _skill?: SkillModule;\n private _stats?: StatsModule;\n private _textModeration?: TextModerationModule;\n private _ugc?: UgcModule;\n private _ugcDiscovery?: UgcDiscoveryModule;\n\n /**\n * Creates a new HaloInfiniteClient instance.\n *\n * @param options - Client configuration options\n *\n * @example\n * ```typescript\n * const client = new HaloInfiniteClient({\n * spartanToken: 'your-spartan-token',\n * xuid: 'xuid',\n * includeRawResponses: true, // Enable for debugging\n * });\n * ```\n */\n constructor(options: HaloInfiniteClientOptions) {\n super({\n fetchFn: options.fetchFn,\n cacheTtlMs: options.cacheTtlMs,\n maxRetries: options.maxRetries,\n });\n\n this.spartanToken = options.spartanToken;\n this.xuid = options.xuid ?? '';\n this.clearanceToken = options.clearanceToken ?? '';\n this.includeRawResponses = options.includeRawResponses ?? false;\n this.userAgent = options.userAgent ?? '';\n }\n\n /**\n * Academy module for bot customization and drill-related APIs.\n *\n * Provides access to:\n * - Bot customization options\n * - Academy content manifest\n * - Star/scoring definitions for drills\n */\n get academy(): AcademyModule {\n return (this._academy ??= new AcademyModule(this));\n }\n\n /**\n * Ban Processor module for ban-related APIs.\n *\n * Provides access to:\n * - Ban summary queries for players\n */\n get banProcessor(): BanProcessorModule {\n return (this._banProcessor ??= new BanProcessorModule(this));\n }\n\n /**\n * Configuration module for endpoint discovery APIs.\n *\n * Provides access to:\n * - API settings and endpoint configuration\n */\n get configuration(): ConfigurationModule {\n return (this._configuration ??= new ConfigurationModule(this));\n }\n\n /**\n * Economy module for player customization, stores, and inventory APIs.\n *\n * Provides access to:\n * - Player inventory and currency balances\n * - Customization (armor, weapons, vehicles, AI)\n * - In-game stores and offerings\n * - Active boosts and rewards\n * - Operation/battle pass progress\n */\n get economy(): EconomyModule {\n return (this._economy ??= new EconomyModule(this));\n }\n\n /**\n * Game CMS module for static content and definitions.\n *\n * Provides access to:\n * - Item definitions\n * - Challenge definitions\n * - Season and career metadata\n * - Medal information\n * - News and guides\n */\n get gameCms(): GameCmsModule {\n return (this._gameCms ??= new GameCmsModule(this));\n }\n\n /**\n * Lobby module for multiplayer lobby and presence APIs.\n *\n * Provides access to:\n * - QoS servers\n * - Player presence in lobbies\n * - Join handles and lobby joining\n */\n get lobby(): LobbyModule {\n return (this._lobby ??= new LobbyModule(this));\n }\n\n /**\n * Settings module for clearance and flight configuration APIs.\n *\n * Provides access to:\n * - Clearance levels and feature flags\n */\n get settings(): SettingsModule {\n return (this._settings ??= new SettingsModule(this));\n }\n\n /**\n * Skill module for CSR (Competitive Skill Rank) APIs.\n *\n * Provides access to:\n * - Match skill results (CSR changes after a match)\n * - Playlist CSR for players\n */\n get skill(): SkillModule {\n return (this._skill ??= new SkillModule(this));\n }\n\n /**\n * Stats module for match history and service record APIs.\n *\n * Provides access to:\n * - Match history for players\n * - Individual match statistics\n * - Player service records (career stats)\n * - Challenge decks and progression\n */\n get stats(): StatsModule {\n return (this._stats ??= new StatsModule(this));\n }\n\n /**\n * Text Moderation module for moderation-related APIs.\n *\n * Provides access to:\n * - Moderation keys for text validation\n */\n get textModeration(): TextModerationModule {\n return (this._textModeration ??= new TextModerationModule(this));\n }\n\n /**\n * UGC (User Generated Content) module for authoring operations.\n *\n * Provides access to:\n * - Creating, editing, and deleting user content\n * - Managing asset permissions\n * - Rating and favoriting assets\n * - Publishing and unpublishing assets\n */\n get ugc(): UgcModule {\n return (this._ugc ??= new UgcModule(this));\n }\n\n /**\n * UGC Discovery module for searching and browsing user content.\n *\n * Provides access to:\n * - Searching for maps, game variants, and other content\n * - Browsing featured and popular content\n * - Getting recommended content\n */\n get ugcDiscovery(): UgcDiscoveryModule {\n return (this._ugcDiscovery ??= new UgcDiscoveryModule(this));\n }\n}\n","import type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { WAYPOINT_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\n\n/**\n * Abstract base class for Waypoint API modules.\n *\n * Similar to ModuleBase but uses Waypoint-specific endpoints\n * instead of the Halo Infinite service domain.\n */\nexport abstract class WaypointModuleBase {\n /**\n * Reference to the parent client for making HTTP requests.\n */\n protected readonly client: ClientBase;\n\n /**\n * Creates a new Waypoint module instance.\n *\n * @param client - Parent client instance\n */\n constructor(client: ClientBase) {\n this.client = client;\n }\n\n /**\n * Build a Waypoint API URL.\n *\n * @param path - API path starting with /\n * @returns Full HTTPS URL\n */\n protected buildUrl(path: string): string {\n return `https://${WAYPOINT_ENDPOINTS.API_DOMAIN}${path}`;\n }\n\n /**\n * Build a Waypoint web URL.\n *\n * @param path - Path starting with /\n * @returns Full HTTPS URL\n */\n protected buildWebUrl(path: string): string {\n return `https://${WAYPOINT_ENDPOINTS.WEB_DOMAIN}${path}`;\n }\n\n /**\n * Execute a GET request to the Waypoint API.\n */\n protected get<T>(\n path: string,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'GET', {\n useSpartanToken: options.useSpartanToken ?? true,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a POST request to the Waypoint API.\n */\n protected post<T>(\n path: string,\n body?: string,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n body,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a POST request with a JSON body.\n */\n protected postJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a PUT request with a JSON body.\n */\n protected putJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'PUT', {\n useSpartanToken: options.useSpartanToken ?? true,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Validate that a parameter is not null or undefined.\n */\n protected assertNotNull<T>(\n value: T | null | undefined,\n paramName: string\n ): asserts value is T {\n if (value == null) {\n throw new Error(`${paramName} cannot be null or undefined`);\n }\n }\n\n /**\n * Validate that a string is not empty.\n */\n protected assertNotEmpty(value: string, paramName: string): void {\n if (!value || value.trim().length === 0) {\n throw new Error(`${paramName} cannot be empty`);\n }\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type {\n UserProfile,\n UserSettings,\n ServiceAwardSnapshot,\n} from '../../models/waypoint';\n\n/**\n * Profile module for user profile and settings APIs.\n *\n * @example\n * ```typescript\n * // Get my profile\n * const profile = await client.profile.getMyProfile();\n *\n * // Get another user's profile\n * const otherProfile = await client.profile.getUserProfile('xuid', true);\n * ```\n */\nexport class ProfileModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Get the current user's settings.\n *\n * @returns User settings\n */\n getUserSettings(): Promise<HaloApiResult<UserSettings>> {\n return this.get<UserSettings>('/hi/users/me/settings');\n }\n\n /**\n * Get the current user's profile.\n *\n * @returns User profile\n */\n getMyProfile(): Promise<HaloApiResult<UserProfile>> {\n return this.get<UserProfile>('/hi/users/me');\n }\n\n /**\n * Get a user's profile by XUID or gamertag.\n *\n * @param userId - XUID or gamertag\n * @param isXuid - Whether userId is an XUID (true) or gamertag (false)\n * @returns User profile\n */\n getUserProfile(\n userId: string,\n isXuid: boolean = false\n ): Promise<HaloApiResult<UserProfile>> {\n this.assertNotEmpty(userId, 'userId');\n\n const identifier = isXuid ? `xuid(${userId})` : encodeURIComponent(userId);\n return this.get<UserProfile>(`/hi/users/${identifier}`);\n }\n\n /**\n * Get service awards for the current user.\n *\n * @returns Service award snapshot\n */\n getServiceAwards(): Promise<HaloApiResult<ServiceAwardSnapshot>> {\n return this.get<ServiceAwardSnapshot>('/hi/users/me/serviceawards');\n }\n\n /**\n * Update featured service awards for the current user.\n *\n * @param awards - Awards to feature\n * @returns Updated awards\n */\n putFeaturedServiceAwards(\n awards: ServiceAwardSnapshot\n ): Promise<HaloApiResult<ServiceAwardSnapshot>> {\n return this.putJson<ServiceAwardSnapshot, ServiceAwardSnapshot>(\n '/hi/users/me/serviceawards/featured',\n awards\n );\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type { CodeRedemptionResult } from '../../models/waypoint';\n\n/**\n * Redemption module for code redemption APIs.\n *\n * @example\n * ```typescript\n * // Redeem a code\n * const result = await client.redemption.redeemCode('XXXX-XXXX-XXXX');\n * ```\n */\nexport class RedemptionModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Redeem a promotional code.\n *\n * @param code - The code to redeem\n * @returns Redemption result\n */\n redeemCode(code: string): Promise<HaloApiResult<CodeRedemptionResult>> {\n this.assertNotEmpty(code, 'code');\n\n return this.postJson<CodeRedemptionResult, { code: string }>(\n '/hi/redemption/code',\n { code }\n );\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type { Article, ArticleCategory } from '../../models/waypoint';\n\n/**\n * Articles response container.\n */\nexport interface ArticlesResponse {\n /** List of articles */\n articles?: Article[];\n /** Total count */\n total?: number;\n /** Page number */\n page?: number;\n /** Per page count */\n perPage?: number;\n}\n\n/**\n * Content module for articles and news APIs.\n *\n * @example\n * ```typescript\n * // Get articles\n * const articles = await client.content.getArticles(1, 10);\n *\n * // Get article categories\n * const categories = await client.content.getCategories();\n * ```\n */\nexport class ContentModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Get articles from Halo Waypoint.\n *\n * @param page - Page number (1-based)\n * @param perPage - Articles per page\n * @param category - Optional category filter\n * @returns Articles response\n */\n getArticles(\n page: number = 1,\n perPage: number = 10,\n category?: number\n ): Promise<HaloApiResult<ArticlesResponse>> {\n const categoryParam = category !== undefined ? `&category=${category}` : '';\n return this.get<ArticlesResponse>(\n `/hi/articles?page=${page}&per_page=${perPage}${categoryParam}`,\n { useSpartanToken: false }\n );\n }\n\n /**\n * Get a specific article by slug.\n *\n * @param slug - Article URL slug\n * @returns Article details\n */\n getArticle(slug: string): Promise<HaloApiResult<Article>> {\n this.assertNotEmpty(slug, 'slug');\n return this.get<Article>(`/hi/articles/${encodeURIComponent(slug)}`, {\n useSpartanToken: false,\n });\n }\n\n /**\n * Get article categories.\n *\n * @returns List of categories\n */\n getCategories(): Promise<HaloApiResult<ArticleCategory[]>> {\n return this.get<ArticleCategory[]>('/hi/articles/categories', {\n useSpartanToken: false,\n });\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type { Notification } from '../../models/waypoint';\n\n/**\n * Notifications response container.\n */\nexport interface NotificationsResponse {\n /** List of notifications */\n notifications?: Notification[];\n /** Unread count */\n unreadCount?: number;\n}\n\n/**\n * Read notifications result.\n */\nexport interface ReadNotificationsResult {\n /** Whether the operation succeeded */\n success?: boolean;\n /** Number of notifications marked as read */\n count?: number;\n}\n\n/**\n * Comms module for notifications and communications APIs.\n *\n * @example\n * ```typescript\n * // Get notifications\n * const notifications = await client.comms.getNotifications();\n *\n * // Mark notifications as read\n * await client.comms.markNotificationsAsRead(['notification-id-1', 'notification-id-2']);\n * ```\n */\nexport class CommsModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Get notifications for the current user.\n *\n * @returns Notifications response\n */\n getNotifications(): Promise<HaloApiResult<NotificationsResponse>> {\n return this.get<NotificationsResponse>('/hi/users/me/notifications');\n }\n\n /**\n * Mark notifications as read.\n *\n * @param notificationIds - IDs of notifications to mark as read\n * @returns Result of the operation\n */\n markNotificationsAsRead(\n notificationIds: string[]\n ): Promise<HaloApiResult<ReadNotificationsResult>> {\n if (!notificationIds.length) {\n throw new Error('notificationIds cannot be empty');\n }\n\n return this.postJson<ReadNotificationsResult, { notificationIds: string[] }>(\n '/hi/users/me/notifications/read',\n { notificationIds }\n );\n }\n\n /**\n * Delete a notification.\n *\n * @param notificationId - ID of notification to delete\n * @returns Success status\n */\n deleteNotification(notificationId: string): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(notificationId, 'notificationId');\n return this.client.executeRequest<boolean>(\n this.buildUrl(`/hi/users/me/notifications/${notificationId}`),\n 'DELETE',\n { useSpartanToken: true }\n );\n }\n}\n","import { ClientBase } from './base/client-base';\nimport type { WaypointClientOptions } from '../models/common/client-options';\n\n// Module imports\nimport { ProfileModule } from '../modules/waypoint/profile.module';\nimport { RedemptionModule } from '../modules/waypoint/redemption.module';\nimport { ContentModule } from '../modules/waypoint/content.module';\nimport { CommsModule } from '../modules/waypoint/comms.module';\n\n/**\n * Client for interacting with Halo Waypoint APIs.\n *\n * Provides access to user profiles, code redemption, news content,\n * and notifications through domain-specific modules.\n *\n * @example\n * ```typescript\n * import { WaypointClient, isSuccess } from '@dendev/grunt';\n *\n * // Create client with authentication\n * const client = new WaypointClient({\n * spartanToken: 'your-spartan-token',\n * xuid: 'xuid',\n * });\n *\n * // Get my profile\n * const profile = await client.profile.getMyProfile();\n * if (isSuccess(profile)) {\n * console.log(`Hello, ${profile.result.gamertag}!`);\n * }\n *\n * // Get news articles (no auth required)\n * const unauthClient = new WaypointClient();\n * const articles = await unauthClient.content.getArticles(1, 10);\n *\n * // Redeem a code\n * const result = await client.redemption.redeemCode('XXXX-XXXX-XXXX');\n * ```\n */\nexport class WaypointClient extends ClientBase {\n // Lazy-loaded module instances\n private _profile?: ProfileModule;\n private _redemption?: RedemptionModule;\n private _content?: ContentModule;\n private _comms?: CommsModule;\n\n /**\n * Creates a new WaypointClient instance.\n *\n * Some endpoints (like news articles) don't require authentication,\n * so spartanToken is optional.\n *\n * @param options - Client configuration options (optional)\n *\n * @example\n * ```typescript\n * // With authentication\n * const authClient = new WaypointClient({\n * spartanToken: 'your-spartan-token',\n * });\n *\n * // Without authentication (for public endpoints)\n * const publicClient = new WaypointClient();\n * ```\n */\n constructor(options: WaypointClientOptions = {}) {\n super({\n fetchFn: options.fetchFn,\n cacheTtlMs: options.cacheTtlMs,\n maxRetries: options.maxRetries,\n });\n\n this.spartanToken = options.spartanToken ?? '';\n this.xuid = options.xuid ?? '';\n this.clearanceToken = options.clearanceToken ?? '';\n this.userAgent = options.userAgent ?? '';\n }\n\n /**\n * Profile module for user profile and settings APIs.\n *\n * Provides access to:\n * - User profiles (self and others)\n * - User settings\n * - Service awards\n */\n get profile(): ProfileModule {\n return (this._profile ??= new ProfileModule(this));\n }\n\n /**\n * Redemption module for code redemption APIs.\n *\n * Provides access to:\n * - Promotional code redemption\n */\n get redemption(): RedemptionModule {\n return (this._redemption ??= new RedemptionModule(this));\n }\n\n /**\n * Content module for articles and news APIs.\n *\n * Provides access to:\n * - News articles\n * - Article categories\n *\n * Note: Most content endpoints don't require authentication.\n */\n get content(): ContentModule {\n return (this._content ??= new ContentModule(this));\n }\n\n /**\n * Comms module for notifications and communications APIs.\n *\n * Provides access to:\n * - User notifications\n * - Marking notifications as read\n */\n get comms(): CommsModule {\n return (this._comms ??= new CommsModule(this));\n }\n}\n","import type { SpartanToken, SpartanTokenRequest, SpartanTokenProof } from './models';\nimport { HALO_CORE_ENDPOINTS } from '../endpoints/halo-core-endpoints';\nimport { HEADERS } from '../utils/constants';\n\n/**\n * Client for Halo authentication operations.\n *\n * Handles the exchange of Xbox Live XSTS tokens for Halo Spartan tokens,\n * which are required for authenticated API calls.\n *\n * @example\n * ```typescript\n * import { HaloAuthenticationClient, HaloInfiniteClient } from '@dendev/grunt';\n *\n * // Create auth client\n * const authClient = new HaloAuthenticationClient();\n *\n * // Exchange XSTS token for Spartan token\n * // (You need to obtain the XSTS token through Xbox Live authentication first)\n * const spartanToken = await authClient.getSpartanToken(xstsToken);\n *\n * if (spartanToken) {\n * // Use the Spartan token with HaloInfiniteClient\n * const client = new HaloInfiniteClient({\n * spartanToken: spartanToken.token!,\n * });\n * }\n * ```\n */\nexport class HaloAuthenticationClient {\n private readonly fetchFn: typeof fetch;\n\n /**\n * Creates a new HaloAuthenticationClient instance.\n *\n * @param fetchFn - Custom fetch implementation (optional)\n */\n constructor(fetchFn?: typeof fetch) {\n this.fetchFn = fetchFn ?? globalThis.fetch.bind(globalThis);\n }\n\n /**\n * Exchange an XSTS token for a Halo Spartan token.\n *\n * The XSTS token must be obtained through Xbox Live authentication\n * using the Halo Waypoint relying party.\n *\n * @param xstsToken - Xbox Live XSTS token\n * @param version - Spartan token version (4 for Halo Infinite, 3 for Halo 5)\n * @returns Spartan token or null if exchange failed\n *\n * @example\n * ```typescript\n * // Version 4 is for Halo Infinite (default)\n * const spartanToken = await authClient.getSpartanToken(xstsToken);\n *\n * // Version 3 is for Halo 5\n * const halo5Token = await authClient.getSpartanToken(xstsToken, 3);\n * ```\n */\n async getSpartanToken(\n xstsToken: string,\n version: number = 4\n ): Promise<SpartanToken | null> {\n if (!xstsToken) {\n throw new Error('xstsToken is required');\n }\n\n const tokenProof: SpartanTokenProof = {\n token: xstsToken,\n tokenType: 'Xbox_XSTSv3',\n };\n\n const requestBody: SpartanTokenRequest = {\n audience: 'urn:343:s3:services',\n minVersion: version.toString(),\n proof: [tokenProof],\n };\n\n try {\n const response = await this.fetchFn(HALO_CORE_ENDPOINTS.SPARTAN_TOKEN_ENDPOINT, {\n method: 'POST',\n headers: {\n [HEADERS.CONTENT_TYPE]: 'application/json',\n [HEADERS.ACCEPT]: 'application/json',\n },\n body: JSON.stringify(requestBody),\n });\n\n if (!response.ok) {\n console.error(\n `Failed to get Spartan token: ${response.status} ${response.statusText}`\n );\n return null;\n }\n\n const data = (await response.json()) as Record<string, unknown>;\n\n // The API returns the token with a capitalized property name\n return {\n token: (data.SpartanToken ?? data.spartanToken ?? data.token) as string | undefined,\n expiresUtc: (data.ExpiresUtc ?? data.expiresUtc) as string | undefined,\n tokenDuration: (data.TokenDuration ?? data.tokenDuration) as string | undefined,\n };\n } catch (error) {\n console.error('Error getting Spartan token:', error);\n return null;\n }\n }\n\n /**\n * Check if a Spartan token is expired or about to expire.\n *\n * @param token - The Spartan token to check\n * @param bufferMinutes - Minutes before expiration to consider \"about to expire\"\n * @returns true if the token is expired or will expire within the buffer time\n */\n isTokenExpired(token: SpartanToken, bufferMinutes: number = 5): boolean {\n if (!token.expiresUtc) {\n return true;\n }\n\n const expiresAt = new Date(token.expiresUtc);\n const now = new Date();\n const bufferMs = bufferMinutes * 60 * 1000;\n\n return now.getTime() + bufferMs >= expiresAt.getTime();\n }\n\n /**\n * Get the Halo Waypoint XSTS relying party URL.\n *\n * Use this when requesting an XSTS token from Xbox Live.\n *\n * @returns The relying party URL\n */\n static getRelyingParty(): string {\n return HALO_CORE_ENDPOINTS.HALO_WAYPOINT_XSTS_RELYING_PARTY;\n }\n}\n","/**\n * Generic result container for all Halo API responses.\n * Mirrors C# HaloApiResultContainer<T, TRawResponseContainer>.\n *\n * All API methods return this type, providing both the deserialized\n * result data and raw response information for debugging.\n *\n * @template T - The type of the expected response data\n *\n * @example\n * ```typescript\n * const result = await client.stats.getMatchStats('match-id');\n * if (isSuccess(result)) {\n * console.log(result.result.matchInfo);\n * } else {\n * console.error(`Error ${result.response.code}: ${result.response.message}`);\n * }\n * ```\n */\nexport interface HaloApiResult<T> {\n /** The deserialized response data, or null if request failed */\n result: T | null;\n /** Raw response information including headers, status, and body */\n response: RawResponse;\n}\n\n/**\n * Raw response container with request/response diagnostics.\n * Equivalent to C# RawResponseContainer.\n *\n * Contains HTTP-level details useful for debugging API issues.\n * Request details are only populated when `includeRawResponses` is enabled.\n */\nexport interface RawResponse {\n /** HTTP status code (e.g., 200, 404, 500) */\n code: number;\n /** Response body text or error message */\n message?: string;\n /** Full request URL including query parameters */\n requestUrl?: string;\n /** HTTP method used (GET, POST, PUT, DELETE, PATCH) */\n requestMethod?: string;\n /** Request headers that were sent */\n requestHeaders?: Record<string, string>;\n /** Request body that was sent */\n requestBody?: string;\n /** Response headers received from the server */\n responseHeaders?: Record<string, string>;\n}\n\n/**\n * Type guard to check if an API result was successful.\n * A successful result has a non-null result and a 2xx status code.\n *\n * @param result - The API result to check\n * @returns true if the result was successful with valid data\n *\n * @example\n * ```typescript\n * const result = await client.stats.getMatchStats('match-id');\n * if (isSuccess(result)) {\n * // TypeScript now knows result.result is non-null\n * console.log(result.result.matchId);\n * }\n * ```\n */\nexport function isSuccess<T>(\n result: HaloApiResult<T>\n): result is HaloApiResult<T> & { result: T } {\n return (\n result.result !== null &&\n result.response.code >= 200 &&\n result.response.code < 300\n );\n}\n\n/**\n * Type guard to check if an API result represents a \"not modified\" response.\n * This occurs when using ETag-based caching and the server returns 304.\n *\n * @param result - The API result to check\n * @returns true if the response was a 304 Not Modified\n */\nexport function isNotModified<T>(result: HaloApiResult<T>): boolean {\n return result.response.code === 304;\n}\n\n/**\n * Type guard to check if an API result represents a client error (4xx).\n *\n * @param result - The API result to check\n * @returns true if the response was a 4xx client error\n */\nexport function isClientError<T>(result: HaloApiResult<T>): boolean {\n return result.response.code >= 400 && result.response.code < 500;\n}\n\n/**\n * Type guard to check if an API result represents a server error (5xx).\n *\n * @param result - The API result to check\n * @returns true if the response was a 5xx server error\n */\nexport function isServerError<T>(result: HaloApiResult<T>): boolean {\n return result.response.code >= 500;\n}\n","/**\n * Match types for querying match history.\n *\n * Used with StatsModule.getMatchHistory() to filter matches.\n */\nexport const MatchType = {\n /** Return all match types */\n All: 'all',\n /** Return only matchmaking matches */\n Matchmaking: 'matchmaking',\n /** Return only custom games */\n Custom: 'custom',\n /** Return only local/offline matches */\n Local: 'local',\n} as const;\n\n/**\n * Type representing valid match type values.\n */\nexport type MatchType = (typeof MatchType)[keyof typeof MatchType];\n","/**\n * Lifecycle modes for service records and stats.\n *\n * Determines which game mode's statistics to retrieve.\n */\nexport const LifecycleMode = {\n /** Matchmade multiplayer games */\n Matchmade: 'matchmade',\n /** Custom games */\n Custom: 'custom',\n /** Local/offline games */\n Local: 'local',\n} as const;\n\n/**\n * Type representing valid lifecycle mode values.\n */\nexport type LifecycleMode = (typeof LifecycleMode)[keyof typeof LifecycleMode];\n","/**\n * Types of user-generated content assets.\n *\n * Used with UGC modules to specify the type of asset.\n */\nexport const AssetKind = {\n /** Film/theater recording */\n Film: 'Film',\n /** Custom map/forge creation */\n Map: 'Map',\n /** Prefabricated object collection */\n Prefab: 'Prefab',\n /** User-created game variant */\n UgcGameVariant: 'UgcGameVariant',\n /** Map-mode pairing */\n MapModePair: 'MapModePair',\n /** Playlist definition */\n Playlist: 'Playlist',\n /** Engine game variant */\n EngineGameVariant: 'EngineGameVariant',\n /** Project (forge project) */\n Project: 'Project',\n} as const;\n\n/**\n * Type representing valid asset kind values.\n */\nexport type AssetKind = (typeof AssetKind)[keyof typeof AssetKind];\n","/**\n * Type of player in a match.\n */\nexport const PlayerType = {\n /** Human player */\n Human: 'Human',\n /** Bot/AI player */\n Bot: 'Bot',\n} as const;\n\n/**\n * Type representing valid player type values.\n */\nexport type PlayerType = (typeof PlayerType)[keyof typeof PlayerType];\n","/**\n * Match outcome for a player or team.\n */\nexport const Outcome = {\n /** Won the match */\n Win: 'Win',\n /** Lost the match */\n Loss: 'Loss',\n /** Match ended in a tie */\n Tie: 'Tie',\n /** Did not finish the match */\n DidNotFinish: 'DidNotFinish',\n} as const;\n\n/**\n * Type representing valid outcome values.\n */\nexport type Outcome = (typeof Outcome)[keyof typeof Outcome];\n","/**\n * Sort order for search results.\n */\nexport const ResultOrder = {\n /** Sort in ascending order */\n Ascending: 'asc',\n /** Sort in descending order */\n Descending: 'desc',\n} as const;\n\n/**\n * Type representing valid result order values.\n */\nexport type ResultOrder = (typeof ResultOrder)[keyof typeof ResultOrder];\n","import type { RawResponse } from '../models/common/api-result';\n\n/**\n * Custom error class for Halo API errors.\n *\n * Thrown when an API request fails and provides access to\n * the full response details for debugging.\n *\n * @example\n * ```typescript\n * try {\n * const result = await client.stats.getMatchStats('invalid-id');\n * if (!isSuccess(result)) {\n * throw HaloApiError.fromResponse(result.response);\n * }\n * } catch (error) {\n * if (error instanceof HaloApiError) {\n * console.error(`API Error ${error.statusCode}: ${error.message}`);\n * }\n * }\n * ```\n */\nexport class HaloApiError extends Error {\n /**\n * HTTP status code from the response.\n */\n readonly statusCode: number;\n\n /**\n * Full raw response details.\n */\n readonly response: RawResponse;\n\n /**\n * Creates a new HaloApiError.\n *\n * @param message - Error message\n * @param statusCode - HTTP status code\n * @param response - Full raw response\n */\n constructor(message: string, statusCode: number, response: RawResponse) {\n super(message);\n this.name = 'HaloApiError';\n this.statusCode = statusCode;\n this.response = response;\n\n // Maintains proper stack trace in V8 environments\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HaloApiError);\n }\n }\n\n /**\n * Creates a HaloApiError from a raw response.\n *\n * @param response - The raw response to convert to an error\n * @returns A new HaloApiError instance\n */\n static fromResponse(response: RawResponse): HaloApiError {\n const message =\n response.message ?? `HTTP Error ${response.code}`;\n return new HaloApiError(message, response.code, response);\n }\n\n /**\n * Check if this is a client error (4xx).\n */\n get isClientError(): boolean {\n return this.statusCode >= 400 && this.statusCode < 500;\n }\n\n /**\n * Check if this is a server error (5xx).\n */\n get isServerError(): boolean {\n return this.statusCode >= 500;\n }\n\n /**\n * Check if this is a \"not found\" error (404).\n */\n get isNotFound(): boolean {\n return this.statusCode === 404;\n }\n\n /**\n * Check if this is an \"unauthorized\" error (401).\n */\n get isUnauthorized(): boolean {\n return this.statusCode === 401;\n }\n\n /**\n * Check if this is a \"forbidden\" error (403).\n */\n get isForbidden(): boolean {\n return this.statusCode === 403;\n }\n\n /**\n * Check if this is a \"rate limited\" error (429).\n */\n get isRateLimited(): boolean {\n return this.statusCode === 429;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/cache/cache-manager.ts","../src/core/http/retry-policy.ts","../src/models/common/api-content-type.ts","../src/utils/constants.ts","../src/clients/base/client-base.ts","../src/endpoints/halo-core-endpoints.ts","../src/modules/base/module-base.ts","../src/modules/halo-infinite/academy.module.ts","../src/modules/halo-infinite/ban-processor.module.ts","../src/modules/halo-infinite/configuration.module.ts","../src/modules/halo-infinite/economy.module.ts","../src/modules/halo-infinite/game-cms.module.ts","../src/modules/halo-infinite/lobby.module.ts","../src/modules/halo-infinite/settings.module.ts","../src/modules/halo-infinite/skill.module.ts","../src/modules/halo-infinite/stats.module.ts","../src/modules/halo-infinite/text-moderation.module.ts","../src/modules/halo-infinite/ugc.module.ts","../src/modules/halo-infinite/ugc-discovery.module.ts","../src/clients/halo-infinite-client.ts","../src/modules/base/waypoint-module-base.ts","../src/modules/waypoint/profile.module.ts","../src/modules/waypoint/redemption.module.ts","../src/modules/waypoint/content.module.ts","../src/modules/waypoint/comms.module.ts","../src/clients/waypoint-client.ts","../src/auth/halo-auth-client.ts","../src/models/common/api-result.ts","../src/models/halo-infinite/enums/match-type.ts","../src/models/halo-infinite/enums/lifecycle-mode.ts","../src/models/halo-infinite/enums/asset-kind.ts","../src/models/halo-infinite/enums/player-type.ts","../src/models/halo-infinite/enums/outcome.ts","../src/models/halo-infinite/enums/result-order.ts","../src/errors/halo-api-error.ts"],"names":["LRUCache"],"mappings":";;;;;AAMA,IAAM,cAAA,GAAiB,KAAK,EAAA,GAAK,GAAA;AAKjC,IAAM,gBAAA,GAAmB,GAAA;AA6BlB,IAAM,eAAN,MAAmB;AAAA,EACP,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjB,WAAA,CACE,KAAA,GAAgB,cAAA,EAChB,OAAA,GAAkB,gBAAA,EAClB;AACA,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAIA,iBAAA,CAAiC;AAAA,MAChD,GAAA,EAAK,OAAA;AAAA,MACL,GAAA,EAAK,KAAA;AAAA;AAAA,MAEL,eAAA,EAAiB,CAAC,KAAA,KAAU;AAC1B,QAAA,OAAO,KAAA,CAAM,OAAA,CAAQ,MAAA,IAAU,KAAA,CA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AC7B;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,cAAA,GAA0B;AAC5B,IAAA,OAAO,KAAK,UAAA,KAAe,GAAA;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,WAAA,GAAuB;AACzB,IAAA,OAAO,KAAK,UAAA,KAAe,GAAA;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,aAAA,GAAyB;AAC3B,IAAA,OAAO,KAAK,UAAA,KAAe,GAAA;AAAA,EAC7B;AACF","file":"index.js","sourcesContent":["import { LRUCache } from 'lru-cache';\nimport type { CachedResponse } from './cached-response';\n\n/**\n * Default cache TTL: 60 minutes.\n */\nconst DEFAULT_TTL_MS = 60 * 60 * 1000;\n\n/**\n * Maximum number of cached entries.\n */\nconst DEFAULT_MAX_SIZE = 1000;\n\n/**\n * ETag-based cache manager with TTL expiration.\n *\n * Implements the same caching strategy as the C# ClientBase:\n * - Stores responses with their ETag values\n * - Enables 304 Not Modified responses\n * - Automatically expires entries after TTL\n *\n * Uses LRU (Least Recently Used) eviction when the cache is full.\n *\n * @example\n * ```typescript\n * const cache = new CacheManager(60 * 60 * 1000); // 1 hour TTL\n *\n * // Store a response\n * cache.set('endpoint-key', {\n * etag: '\"abc123\"',\n * content: new TextEncoder().encode('{\"data\": \"value\"}'),\n * });\n *\n * // Retrieve later\n * const cached = cache.get('endpoint-key');\n * if (cached?.etag) {\n * // Use etag for If-None-Match header\n * }\n * ```\n */\nexport class CacheManager {\n private readonly cache: LRUCache<string, CachedResponse>;\n\n /**\n * Creates a new cache manager.\n *\n * @param ttlMs - Time-to-live for cached entries in milliseconds\n * @param maxSize - Maximum number of entries to cache\n */\n constructor(\n ttlMs: number = DEFAULT_TTL_MS,\n maxSize: number = DEFAULT_MAX_SIZE\n ) {\n this.cache = new LRUCache<string, CachedResponse>({\n max: maxSize,\n ttl: ttlMs,\n // Calculate size based on content length for memory management\n sizeCalculation: (value) => {\n return value.content.length + (value.etag?.length ?? 0);\n },\n // 50MB max memory for cache\n maxSize: 50 * 1024 * 1024,\n });\n }\n\n /**\n * Get a cached response if it exists and hasn't expired.\n *\n * @param key - Cache key (typically the request URL)\n * @returns Cached response or null if not found/expired\n */\n get(key: string): CachedResponse | null {\n return this.cache.get(key) ?? null;\n }\n\n /**\n * Store a response in the cache.\n *\n * @param key - Cache key (typically the request URL)\n * @param response - Response to cache\n */\n set(key: string, response: CachedResponse): void {\n this.cache.set(key, response);\n }\n\n /**\n * Check if a key exists in the cache without updating its recency.\n *\n * @param key - Cache key to check\n * @returns true if the key exists and hasn't expired\n */\n has(key: string): boolean {\n return this.cache.has(key);\n }\n\n /**\n * Remove a specific entry from the cache.\n *\n * @param key - Cache key to remove\n * @returns true if an entry was removed\n */\n delete(key: string): boolean {\n return this.cache.delete(key);\n }\n\n /**\n * Clear all cached entries.\n */\n clear(): void {\n this.cache.clear();\n }\n\n /**\n * Get the current number of cached entries.\n */\n get size(): number {\n return this.cache.size;\n }\n\n /**\n * Manually trigger cleanup of expired entries.\n * This is called automatically by the LRU cache, but can be\n * invoked manually if needed.\n */\n prune(): void {\n this.cache.purgeStale();\n }\n}\n","/**\n * Configuration options for the retry policy.\n */\nexport interface RetryOptions {\n /**\n * Maximum number of retry attempts after the initial request.\n *\n * @default 3\n */\n maxRetries: number;\n\n /**\n * Delay between retries in milliseconds.\n * Array index corresponds to retry attempt (0-indexed).\n *\n * @default [200, 500, 1000]\n */\n retryDelays: number[];\n}\n\n/**\n * Default retry configuration matching the C# implementation.\n */\nconst DEFAULT_RETRY_OPTIONS: RetryOptions = {\n maxRetries: 3,\n retryDelays: [200, 500, 1000],\n};\n\n/**\n * HTTP status codes that indicate transient errors worth retrying.\n */\nconst TRANSIENT_STATUS_CODES = new Set([\n 408, // Request Timeout\n 429, // Too Many Requests\n 500, // Internal Server Error\n 502, // Bad Gateway\n 503, // Service Unavailable\n 504, // Gateway Timeout\n]);\n\n/**\n * Retry policy with exponential backoff for transient failures.\n *\n * Implements the same retry strategy as the C# ClientBase:\n * - Retries on transient HTTP errors (5xx, 408, 429)\n * - Retries on network failures (fetch TypeError)\n * - Uses configurable delays between attempts\n *\n * @example\n * ```typescript\n * const policy = new RetryPolicy({ maxRetries: 3 });\n *\n * const response = await policy.execute(async () => {\n * return fetch('https://api.example.com/data');\n * });\n * ```\n */\nexport class RetryPolicy {\n private readonly options: RetryOptions;\n\n /**\n * Creates a new retry policy.\n *\n * @param options - Configuration options\n */\n constructor(options: Partial<RetryOptions> = {}) {\n this.options = {\n maxRetries: options.maxRetries ?? DEFAULT_RETRY_OPTIONS.maxRetries,\n retryDelays: options.retryDelays ?? DEFAULT_RETRY_OPTIONS.retryDelays,\n };\n }\n\n /**\n * Execute a function with retry logic.\n *\n * The function is called immediately. If it fails with a retryable error,\n * it will be retried up to maxRetries times with delays between attempts.\n *\n * @param fn - Async function that returns a Response\n * @returns The successful Response\n * @throws The last error if all retries are exhausted\n */\n async execute(fn: () => Promise<Response>): Promise<Response> {\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) {\n try {\n const response = await fn();\n\n // Check if response indicates a transient error\n if (this.isTransientError(response)) {\n lastError = new Error(\n `HTTP ${response.status}: ${response.statusText}`\n );\n\n if (attempt < this.options.maxRetries) {\n await this.delay(attempt);\n continue;\n }\n }\n\n return response;\n } catch (error) {\n // Network errors are retryable\n lastError = error instanceof Error ? error : new Error(String(error));\n\n if (!this.isRetryableError(error) || attempt >= this.options.maxRetries) {\n throw lastError;\n }\n\n await this.delay(attempt);\n }\n }\n\n throw lastError ?? new Error('Retry exhausted');\n }\n\n /**\n * Check if a response indicates a transient server error.\n */\n private isTransientError(response: Response): boolean {\n return TRANSIENT_STATUS_CODES.has(response.status);\n }\n\n /**\n * Check if an error is worth retrying.\n * Network errors (TypeError from fetch) are retryable.\n */\n private isRetryableError(error: unknown): boolean {\n // Fetch throws TypeError for network failures\n if (error instanceof TypeError) {\n return true;\n }\n return false;\n }\n\n /**\n * Wait for the appropriate delay before the next retry.\n */\n private delay(attempt: number): Promise<void> {\n const delays = this.options.retryDelays;\n const delayMs = delays[attempt] ?? delays[delays.length - 1] ?? 1000;\n return new Promise((resolve) => setTimeout(resolve, delayMs));\n }\n}\n","/**\n * API content types supported by the Halo API.\n *\n * Most endpoints use JSON, but some UGC-related endpoints\n * use Bond Compact Binary for binary asset data.\n */\nexport const ApiContentType = {\n /** Standard JSON content type */\n Json: 'json',\n /** Bond compact binary format for binary data */\n BondCompactBinary: 'bond',\n} as const;\n\n/**\n * Type representing valid API content types.\n */\nexport type ApiContentType = (typeof ApiContentType)[keyof typeof ApiContentType];\n\n/**\n * Get the HTTP Content-Type header value for a content type.\n *\n * @param contentType - The content type enum value\n * @returns The corresponding Content-Type header value\n */\nexport function getContentTypeHeader(contentType: ApiContentType): string {\n switch (contentType) {\n case ApiContentType.Json:\n return 'application/json';\n case ApiContentType.BondCompactBinary:\n return 'application/x-bond-compact-binary';\n default:\n return 'application/json';\n }\n}\n","/**\n * Global constants and default values used throughout the library.\n */\n\n/**\n * Default User-Agent strings for different contexts.\n * Matching the C# implementation's global constants.\n */\nexport const USER_AGENTS = {\n /**\n * User-Agent for Halo PC client requests.\n */\n HALO_PC:\n 'SHIVA-2043073184/6.10025.12948.0 (release; PC)',\n\n /**\n * User-Agent for Halo Waypoint app requests.\n */\n HALO_WAYPOINT:\n 'HaloWaypoint/2021112313511900 CFNetwork/1327.0.4 Darwin/21.2.0',\n\n /**\n * Standard web browser User-Agent.\n */\n WEB: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',\n} as const;\n\n/**\n * Default authentication scopes for Xbox Live.\n */\nexport const DEFAULT_AUTH_SCOPES = [\n 'Xboxlive.signin',\n 'Xboxlive.offline_access',\n] as const;\n\n/**\n * HTTP header names used in API requests.\n */\nexport const HEADERS = {\n /** Spartan token authentication header */\n SPARTAN_AUTH: 'x-343-authorization-spartan',\n\n /** Clearance/flight token header */\n CLEARANCE: '343-clearance',\n\n /** Standard Content-Type header */\n CONTENT_TYPE: 'Content-Type',\n\n /** Standard Accept header */\n ACCEPT: 'Accept',\n\n /** Standard User-Agent header */\n USER_AGENT: 'User-Agent',\n\n /** ETag header for caching */\n ETAG: 'ETag',\n\n /** If-None-Match header for conditional requests */\n IF_NONE_MATCH: 'If-None-Match',\n} as const;\n\n/**\n * Default timeout for HTTP requests in milliseconds.\n */\nexport const DEFAULT_TIMEOUT_MS = 30_000;\n\n/**\n * Default cache TTL in milliseconds (60 minutes).\n */\nexport const DEFAULT_CACHE_TTL_MS = 60 * 60 * 1000;\n\n/**\n * Default maximum retry attempts.\n */\nexport const DEFAULT_MAX_RETRIES = 3;\n","import { CacheManager } from '../../core/cache';\nimport { RetryPolicy } from '../../core/http';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport {\n ApiContentType,\n getContentTypeHeader,\n} from '../../models/common/api-content-type';\nimport type { RequestOptions } from '../../models/common/client-options';\nimport {\n HEADERS,\n DEFAULT_CACHE_TTL_MS,\n DEFAULT_MAX_RETRIES,\n} from '../../utils/constants';\n\n/**\n * Abstract base class for all API clients.\n *\n * Provides shared functionality for HTTP execution, ETag-based caching,\n * and retry logic. Both HaloInfiniteClient and WaypointClient extend this.\n *\n * Mirrors the C# ClientBase implementation with:\n * - Shared HttpClient-equivalent fetch function\n * - ETag-based caching with TTL expiration\n * - Automatic retry for transient failures\n * - Support for multiple content types\n * - Comprehensive error handling with raw response capture\n */\nexport abstract class ClientBase {\n /**\n * Fetch function used for HTTP requests.\n * Can be overridden for testing or custom environments.\n */\n protected readonly fetchFn: typeof fetch;\n\n /**\n * Cache manager for ETag-based response caching.\n */\n protected readonly cache: CacheManager;\n\n /**\n * Retry policy for handling transient failures.\n */\n protected readonly retryPolicy: RetryPolicy;\n\n /**\n * Spartan token for API authentication.\n * Obtained through Xbox Live XSTS token exchange.\n */\n spartanToken: string = '';\n\n /**\n * Xbox User ID in numeric format.\n * Used for player-specific API requests.\n */\n xuid: string = '';\n\n /**\n * Clearance/flight token for accessing flighted content.\n */\n clearanceToken: string = '';\n\n /**\n * Whether to include raw request/response data in results.\n * Useful for debugging but adds overhead.\n */\n includeRawResponses: boolean = false;\n\n /**\n * Custom User-Agent header value.\n */\n userAgent: string = '';\n\n /**\n * Creates a new ClientBase instance.\n *\n * @param options - Configuration options\n */\n constructor(options?: {\n fetchFn?: typeof fetch;\n cacheTtlMs?: number;\n maxRetries?: number;\n }) {\n this.fetchFn = options?.fetchFn ?? globalThis.fetch.bind(globalThis);\n this.cache = new CacheManager(options?.cacheTtlMs ?? DEFAULT_CACHE_TTL_MS);\n this.retryPolicy = new RetryPolicy({\n maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,\n });\n }\n\n /**\n * Execute an API request with caching, retry, and response handling.\n *\n * This is the core method that all module methods call. It handles:\n * - Building the request with appropriate headers\n * - ETag-based caching and 304 Not Modified responses\n * - Retry logic for transient failures\n * - Response deserialization\n * - Raw response capture (when enabled)\n *\n * @template T - Expected response data type\n * @param endpoint - Full URL for the request\n * @param method - HTTP method to use\n * @param options - Request configuration options\n * @returns Promise resolving to the API result\n */\n async executeRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n options: RequestOptions = {}\n ): Promise<HaloApiResult<T>> {\n const result: HaloApiResult<T> = {\n result: null,\n response: { code: 0 },\n };\n\n // Build the request\n const headers = this.buildHeaders(options);\n const requestInit: RequestInit = {\n method,\n headers,\n };\n\n // Add body for POST/PUT/PATCH\n if (options.body) {\n requestInit.body = options.body;\n }\n\n // Capture request details if enabled\n if (this.includeRawResponses) {\n result.response.requestUrl = endpoint;\n result.response.requestMethod = method;\n result.response.requestHeaders = Object.fromEntries(headers.entries());\n if (typeof options.body === 'string') {\n result.response.requestBody = options.body;\n }\n }\n\n try {\n // Check cache for GET requests\n const cacheKey = method === 'GET' ? endpoint : null;\n const cached = cacheKey ? this.cache.get(cacheKey) : null;\n\n // Add ETag header if we have a cached response\n if (cached?.etag) {\n headers.set(HEADERS.IF_NONE_MATCH, cached.etag);\n }\n\n // Execute request with retry\n const response = await this.retryPolicy.execute(async () => {\n return this.fetchFn(endpoint, requestInit);\n });\n\n result.response.code = response.status;\n\n // Capture response headers if enabled\n if (this.includeRawResponses) {\n result.response.responseHeaders = Object.fromEntries(\n response.headers.entries()\n );\n }\n\n // Handle 304 Not Modified - use cached content\n if (response.status === 304 && cached) {\n if (options.returnRaw) {\n result.result = cached.content as unknown as T;\n result.response.message = `304 Not Modified - cached binary: ${cached.content.length} bytes`;\n } else {\n result.result = this.deserializeResponse<T>(cached.content);\n result.response.message = '304 Not Modified - using cached response';\n }\n return result;\n }\n\n // Read response body\n const bodyBuffer = await response.arrayBuffer();\n const bodyBytes = new Uint8Array(bodyBuffer);\n\n // Cache successful GET responses\n if (cacheKey && response.ok) {\n const etag = response.headers.get(HEADERS.ETAG) ?? undefined;\n this.cache.set(cacheKey, { etag, content: bodyBytes });\n }\n\n // For raw binary responses, skip text decoding and deserialization\n if (options.returnRaw) {\n result.result = bodyBytes as unknown as T;\n result.response.message = `Binary response: ${bodyBytes.length} bytes`;\n } else {\n // Capture raw response message\n const bodyText = new TextDecoder().decode(bodyBytes);\n result.response.message = bodyText;\n\n // Deserialize response\n if (response.ok || options.enforceSuccess !== false) {\n result.result = this.deserializeResponse<T>(bodyBytes);\n }\n }\n } catch (error) {\n result.response.code = 0;\n result.response.message =\n error instanceof Error ? error.message : String(error);\n }\n\n return result;\n }\n\n /**\n * Build request headers based on options.\n */\n private buildHeaders(options: RequestOptions): Headers {\n const headers = new Headers();\n\n // Set default Accept header\n headers.set(HEADERS.ACCEPT, 'application/json');\n\n // Set Content-Type for requests with body\n if (options.body !== undefined) {\n const contentType = getContentTypeHeader(\n options.contentType ?? ApiContentType.Json\n );\n headers.set(HEADERS.CONTENT_TYPE, contentType);\n }\n\n // Add Spartan token if requested\n if (options.useSpartanToken !== false && this.spartanToken) {\n headers.set(HEADERS.SPARTAN_AUTH, this.spartanToken);\n }\n\n // Add clearance token if requested\n if (options.useClearance && this.clearanceToken) {\n headers.set(HEADERS.CLEARANCE, this.clearanceToken);\n }\n\n // Add User-Agent if set\n if (this.userAgent) {\n headers.set(HEADERS.USER_AGENT, this.userAgent);\n }\n\n // Add any custom headers\n if (options.customHeaders) {\n for (const [key, value] of Object.entries(options.customHeaders)) {\n headers.set(key, value);\n }\n }\n\n return headers;\n }\n\n /**\n * Deserialize response bytes to the expected type.\n */\n private deserializeResponse<T>(data: Uint8Array): T | null {\n if (data.length === 0) {\n return null;\n }\n\n const text = new TextDecoder().decode(data);\n\n // Handle boolean responses\n if (text === 'true') {\n return true as unknown as T;\n }\n if (text === 'false') {\n return false as unknown as T;\n }\n\n // Try to parse as JSON\n try {\n return JSON.parse(text) as T;\n } catch {\n // If not valid JSON, return as string\n return text as unknown as T;\n }\n }\n\n /**\n * Clear the response cache.\n * Useful when you know data has changed.\n */\n clearCache(): void {\n this.cache.clear();\n }\n}\n","/**\n * Halo API endpoint configuration constants.\n *\n * These define the service origins for different API modules.\n * The Halo Infinite API is distributed across multiple services,\n * each handling a specific domain of functionality.\n */\nexport const HALO_CORE_ENDPOINTS = {\n /**\n * Base service domain for all Halo Waypoint services.\n */\n SERVICE_DOMAIN: 'svc.halowaypoint.com',\n\n // ─────────────────────────────────────────────────────────────────\n // Service Origins (prepended to SERVICE_DOMAIN)\n // ─────────────────────────────────────────────────────────────────\n\n /** Game CMS for static content (challenges, items, etc.) */\n GAME_CMS_ORIGIN: 'gamecms-hacs',\n\n /** Economy service for stores, inventory, customization */\n ECONOMY_ORIGIN: 'economy',\n\n /** UGC authoring service for creating/editing user content */\n AUTHORING_ORIGIN: 'authoring-infiniteugc',\n\n /** UGC discovery service for searching user content */\n DISCOVERY_ORIGIN: 'discovery-infiniteugc',\n\n /** Lobby service for multiplayer lobbies and presence */\n LOBBY_ORIGIN: 'lobby-hi',\n\n /** Settings and configuration service */\n SETTINGS_ORIGIN: 'settings',\n\n /** Skill and CSR rating service */\n SKILL_ORIGIN: 'skill',\n\n /** Ban processor service */\n BAN_PROCESSOR_ORIGIN: 'banprocessor',\n\n /** Stats service for match history and service records */\n STATS_ORIGIN: 'halostats',\n\n /** Text moderation service */\n TEXT_ORIGIN: 'text',\n\n /** Content service for articles and news */\n CONTENT_ORIGIN: 'content-hacs',\n\n // ─────────────────────────────────────────────────────────────────\n // Authentication Endpoints\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Endpoint for obtaining a Spartan token from an XSTS token.\n */\n SPARTAN_TOKEN_ENDPOINT: 'https://settings.svc.halowaypoint.com/spartan-token',\n\n /**\n * Endpoint for discovering available Halo Infinite API endpoints.\n * Returns configuration for all available services.\n */\n HALO_INFINITE_SETTINGS:\n 'https://settings.svc.halowaypoint.com/settings/hipc/e2a0a7c6-6efe-42af-9283-c2ab73250c48',\n\n // ─────────────────────────────────────────────────────────────────\n // Xbox Live / XSTS Configuration\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Relying party URL for XSTS token exchange.\n * Use this when requesting an XSTS token for Halo Waypoint.\n */\n HALO_WAYPOINT_XSTS_RELYING_PARTY: 'https://prod.xsts.halowaypoint.com/',\n\n // ─────────────────────────────────────────────────────────────────\n // Blob Storage\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Base URL for UGC blob storage (maps, game variants, etc.)\n */\n BLOBS_ORIGIN: 'blobs-infiniteugc',\n} as const;\n\n/**\n * Waypoint-specific endpoints for non-game services.\n */\nexport const WAYPOINT_ENDPOINTS = {\n /**\n * Base domain for Halo Waypoint web services.\n */\n WEB_DOMAIN: 'www.halowaypoint.com',\n\n /**\n * API subdomain for Waypoint services.\n */\n API_DOMAIN: 'api.halowaypoint.com',\n\n /**\n * Profile API origin.\n */\n PROFILE_ORIGIN: 'profile',\n\n /**\n * Redemption API origin for code redemption.\n */\n REDEMPTION_ORIGIN: 'redemption',\n} as const;\n\n/**\n * Build a full URL from an origin and path.\n *\n * @param origin - The service origin (e.g., 'halostats')\n * @param path - The API path (e.g., '/hi/players/xuid(...)/matches')\n * @returns Full HTTPS URL\n *\n * @example\n * ```typescript\n * const url = buildServiceUrl(HALO_CORE_ENDPOINTS.STATS_ORIGIN, '/hi/players/xuid(123)/matches');\n * // Returns: 'https://halostats.svc.halowaypoint.com/hi/players/xuid(123)/matches'\n * ```\n */\nexport function buildServiceUrl(origin: string, path: string): string {\n return `https://${origin}.${HALO_CORE_ENDPOINTS.SERVICE_DOMAIN}${path}`;\n}\n","import type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { ApiContentType } from '../../models/common/api-content-type';\nimport { buildServiceUrl } from '../../endpoints/halo-core-endpoints';\n\n/**\n * Abstract base class for all Halo Infinite API modules.\n *\n * Provides shared functionality for building URLs and making HTTP requests.\n * Each module (Stats, Economy, GameCms, etc.) extends this class and uses\n * the helper methods to interact with its specific API endpoints.\n *\n * @example\n * ```typescript\n * class StatsModule extends ModuleBase {\n * constructor(client: ClientBase) {\n * super(client, HALO_CORE_ENDPOINTS.STATS_ORIGIN);\n * }\n *\n * async getMatchStats(matchId: string) {\n * return this.get<MatchStats>(`/hi/matches/${matchId}/stats`);\n * }\n * }\n * ```\n */\nexport abstract class ModuleBase {\n /**\n * Reference to the parent client for making HTTP requests.\n */\n protected readonly client: ClientBase;\n\n /**\n * Service origin for this module (e.g., 'halostats', 'economy').\n */\n protected readonly origin: string;\n\n /**\n * Creates a new module instance.\n *\n * @param client - Parent client instance\n * @param origin - Service origin for URL building\n */\n constructor(client: ClientBase, origin: string) {\n this.client = client;\n this.origin = origin;\n }\n\n /**\n * Build a full URL from a relative path using this module's origin.\n *\n * @param path - API path starting with /\n * @returns Full HTTPS URL\n */\n protected buildUrl(path: string): string {\n return buildServiceUrl(this.origin, path);\n }\n\n /**\n * Execute a GET request to this module's service.\n *\n * @template T - Expected response type\n * @param path - API path (e.g., '/hi/players/xuid(...)/matches')\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected get<T>(\n path: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n returnRaw?: boolean;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'GET', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n customHeaders: options.customHeaders,\n returnRaw: options.returnRaw,\n });\n }\n\n /**\n * Execute a GET request to an absolute URL.\n *\n * Used when the URL doesn't follow the standard origin pattern\n * (e.g., blob storage URLs).\n *\n * @template T - Expected response type\n * @param fullUrl - Complete URL to request\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected getFullUrl<T>(\n fullUrl: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n enforceSuccess?: boolean;\n returnRaw?: boolean;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(fullUrl, 'GET', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n customHeaders: options.customHeaders,\n enforceSuccess: options.enforceSuccess ?? true,\n returnRaw: options.returnRaw,\n });\n }\n\n /**\n * Execute a POST request to this module's service.\n *\n * @template T - Expected response type\n * @param path - API path\n * @param body - Optional request body as string\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected post<T>(\n path: string,\n body?: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a POST request with a JSON body.\n *\n * @template T - Expected response type\n * @template TBody - Request body type\n * @param path - API path\n * @param body - Request body (will be serialized to JSON)\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected postJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n contentType?: ApiContentType;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body: JSON.stringify(body),\n contentType: options.contentType ?? ApiContentType.Json,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a PUT request with a JSON body.\n *\n * @template T - Expected response type\n * @template TBody - Request body type\n * @param path - API path\n * @param body - Request body (will be serialized to JSON)\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected putJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'PUT', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a PATCH request with a JSON body.\n *\n * @template T - Expected response type\n * @template TBody - Request body type\n * @param path - API path\n * @param body - Request body (will be serialized to JSON)\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected patchJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'PATCH', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a DELETE request.\n *\n * @template T - Expected response type\n * @param path - API path\n * @param options - Request options\n * @returns Promise with the API result\n */\n protected delete<T>(\n path: string,\n options: {\n useClearance?: boolean;\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'DELETE', {\n useSpartanToken: options.useSpartanToken ?? true,\n useClearance: options.useClearance ?? false,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Validate that a parameter is not null or undefined.\n *\n * @param value - Value to check\n * @param paramName - Parameter name for error message\n * @throws Error if value is null or undefined\n */\n protected assertNotNull<T>(\n value: T | null | undefined,\n paramName: string\n ): asserts value is T {\n if (value == null) {\n throw new Error(`${paramName} cannot be null or undefined`);\n }\n }\n\n /**\n * Validate that a number is within a range.\n *\n * @param value - Value to check\n * @param min - Minimum allowed value (inclusive)\n * @param max - Maximum allowed value (inclusive)\n * @param paramName - Parameter name for error message\n * @throws RangeError if value is out of range\n */\n protected assertRange(\n value: number,\n min: number,\n max: number,\n paramName: string\n ): void {\n if (value < min || value > max) {\n throw new RangeError(`${paramName} must be between ${min} and ${max}`);\n }\n }\n\n /**\n * Validate that a string is not empty.\n *\n * @param value - Value to check\n * @param paramName - Parameter name for error message\n * @throws Error if value is empty\n */\n protected assertNotEmpty(value: string, paramName: string): void {\n if (!value || value.trim().length === 0) {\n throw new Error(`${paramName} cannot be empty`);\n }\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type {\n AcademyClientManifest,\n AcademyStarDefinitions,\n BotCustomizationData,\n TestAcademyClientManifest,\n} from '../../models/halo-infinite/misc';\n\n/**\n * Academy module for bot customization and drill-related APIs.\n *\n * Provides access to:\n * - Academy content manifest\n * - Bot customization options\n * - Star/scoring definitions for drills\n *\n * @example\n * ```typescript\n * // Get academy content\n * const content = await client.academy.getContent();\n *\n * // Get bot customization options\n * const bots = await client.academy.getBotCustomization('flight-id');\n * ```\n */\nexport class AcademyModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.GAME_CMS_ORIGIN);\n }\n\n /**\n * Get bot customization data.\n *\n * @param flightId - Flight/clearance ID\n * @returns Bot customization options\n */\n getBotCustomization(flightId?: string): Promise<HaloApiResult<BotCustomizationData>> {\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<BotCustomizationData>(`/hi/academy/botcustomization${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get academy content manifest.\n *\n * @returns Academy client manifest\n */\n getContent(): Promise<HaloApiResult<AcademyClientManifest>> {\n return this.get<AcademyClientManifest>('/hi/academy/content');\n }\n\n /**\n * Get test academy content (for flighted builds).\n *\n * @param clearanceId - Clearance identifier\n * @returns Test academy manifest\n */\n getContentTest(clearanceId: string): Promise<HaloApiResult<TestAcademyClientManifest>> {\n this.assertNotEmpty(clearanceId, 'clearanceId');\n return this.get<TestAcademyClientManifest>(`/hi/academy/content/test?clearanceId=${clearanceId}`, {\n useClearance: true,\n });\n }\n\n /**\n * Get star/scoring definitions for academy drills.\n *\n * @returns Star definitions\n */\n getStarDefinitions(): Promise<HaloApiResult<AcademyStarDefinitions>> {\n return this.get<AcademyStarDefinitions>('/hi/Progression/file/academy/stars');\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { BansSummaryQueryResult } from '../../models/halo-infinite/misc';\n\n/**\n * Ban Processor module for querying ban information.\n *\n * @example\n * ```typescript\n * // Check if players are banned\n * const bans = await client.banProcessor.banSummary(['xuid1', 'xuid2']);\n * ```\n */\nexport class BanProcessorModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.BAN_PROCESSOR_ORIGIN);\n }\n\n /**\n * Get ban summary for a list of players.\n *\n * @param targetList - List of player XUIDs to check\n * @returns Ban summary results\n */\n banSummary(targetList: string[]): Promise<HaloApiResult<BansSummaryQueryResult>> {\n if (!targetList.length) {\n throw new Error('targetList cannot be empty');\n }\n\n const playersQuery = targetList.map((id) => `targetXuids=${id}`).join('&');\n return this.get<BansSummaryQueryResult>(`/hi/bans/summary?${playersQuery}`);\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { Configuration } from '../../models/halo-infinite/misc';\n\n/**\n * Configuration module for discovering API endpoints.\n *\n * @example\n * ```typescript\n * // Get API configuration\n * const config = await client.configuration.getApiSettingsContainer();\n * console.log(config.result?.endpoints);\n * ```\n */\nexport class ConfigurationModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.SETTINGS_ORIGIN);\n }\n\n /**\n * Get the API settings/configuration container.\n *\n * Returns the list of all available API endpoints and their configurations.\n *\n * @returns API configuration\n */\n getApiSettingsContainer(): Promise<HaloApiResult<Configuration>> {\n return this.getFullUrl<Configuration>(HALO_CORE_ENDPOINTS.HALO_INFINITE_SETTINGS, {\n useSpartanToken: false,\n });\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type {\n PlayerInventory,\n CurrencySnapshot,\n StoreItem,\n ActiveBoostsContainer,\n RewardSnapshot,\n TransactionSnapshot,\n} from '../../models/halo-infinite/economy';\nimport type {\n CustomizationData,\n ArmorCore,\n WeaponCore,\n VehicleCore,\n AiCore,\n ArmorCoreCollection,\n WeaponCoreCollection,\n VehicleCoreCollection,\n AiCoreContainer,\n SpartanBody,\n AppearanceCustomization,\n} from '../../models/halo-infinite/customization';\nimport type { RewardTrack, OperationRewardTrackSnapshot } from '../../models/halo-infinite/progression';\nimport type { PlayerGiveaways } from '../../models/halo-infinite/misc';\nimport type { RewardTrackResultContainer } from '../../models/halo-infinite/progression/career';\n\n/**\n * Economy module for player customization, inventory, and store access.\n *\n * Provides access to:\n * - Player inventory and currency balances\n * - Customization data (armor, weapons, vehicles, AI)\n * - In-game stores and offerings\n * - Active boosts and rewards\n * - Operation/battle pass progress\n *\n * @example\n * ```typescript\n * // Get player inventory\n * const inventory = await client.economy.getInventoryItems('xuid');\n *\n * // Get armor customization\n * const armor = await client.economy.armorCoresCustomization('xuid');\n *\n * // Get currency balances\n * const currencies = await client.economy.getVirtualCurrencyBalances('xuid');\n * ```\n */\nexport class EconomyModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.ECONOMY_ORIGIN);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Inventory & Currency\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get all inventory items for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Player inventory\n */\n getInventoryItems(player: string): Promise<HaloApiResult<PlayerInventory>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerInventory>(`/hi/players/xuid(${player})/inventory`);\n }\n\n /**\n * Get virtual currency balances for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Currency balances\n */\n getVirtualCurrencyBalances(player: string): Promise<HaloApiResult<CurrencySnapshot>> {\n this.assertNotEmpty(player, 'player');\n return this.get<CurrencySnapshot>(`/hi/players/xuid(${player})/currencies`);\n }\n\n /**\n * Post a currency transaction.\n *\n * @param player - Player's numeric XUID\n * @param currencyId - Currency identifier\n * @returns Transaction result\n */\n postCurrencyTransaction(\n player: string,\n currencyId: string\n ): Promise<HaloApiResult<TransactionSnapshot>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(currencyId, 'currencyId');\n return this.post<TransactionSnapshot>(\n `/hi/players/xuid(${player})/currencies/${currencyId}/transactions`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Customization\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get full player customization data.\n *\n * @param player - Player's numeric XUID\n * @param viewType - View type (e.g., 'public', 'private')\n * @returns Complete customization data\n */\n getPlayerCustomization(\n player: string,\n viewType: string = 'public'\n ): Promise<HaloApiResult<CustomizationData>> {\n this.assertNotEmpty(player, 'player');\n return this.get<CustomizationData>(\n `/hi/players/xuid(${player})/customization?view=${viewType}`\n );\n }\n\n /**\n * Get all armor cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Armor core collection\n */\n armorCoresCustomization(player: string): Promise<HaloApiResult<ArmorCoreCollection>> {\n this.assertNotEmpty(player, 'player');\n return this.get<ArmorCoreCollection>(`/hi/players/xuid(${player})/customization/armors`);\n }\n\n /**\n * Get a specific armor core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns Armor core details\n */\n armorCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<ArmorCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<ArmorCore>(`/hi/players/xuid(${player})/customization/armors/${coreId}`);\n }\n\n /**\n * Get all weapon cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Weapon core collection\n */\n weaponCoresCustomization(player: string): Promise<HaloApiResult<WeaponCoreCollection>> {\n this.assertNotEmpty(player, 'player');\n return this.get<WeaponCoreCollection>(`/hi/players/xuid(${player})/customization/weapons`);\n }\n\n /**\n * Get a specific weapon core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns Weapon core details\n */\n weaponCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<WeaponCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<WeaponCore>(`/hi/players/xuid(${player})/customization/weapons/${coreId}`);\n }\n\n /**\n * Get all vehicle cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Vehicle core collection\n */\n vehicleCoresCustomization(player: string): Promise<HaloApiResult<VehicleCoreCollection>> {\n this.assertNotEmpty(player, 'player');\n return this.get<VehicleCoreCollection>(`/hi/players/xuid(${player})/customization/vehicles`);\n }\n\n /**\n * Get a specific vehicle core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns Vehicle core details\n */\n vehicleCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<VehicleCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<VehicleCore>(`/hi/players/xuid(${player})/customization/vehicles/${coreId}`);\n }\n\n /**\n * Get all AI cores for a player.\n *\n * @param player - Player's numeric XUID\n * @returns AI core container\n */\n aiCoresCustomization(player: string): Promise<HaloApiResult<AiCoreContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AiCoreContainer>(`/hi/players/xuid(${player})/customization/ais`);\n }\n\n /**\n * Get a specific AI core for a player.\n *\n * @param player - Player's numeric XUID\n * @param coreId - Core identifier\n * @returns AI core details\n */\n aiCoreCustomization(\n player: string,\n coreId: string\n ): Promise<HaloApiResult<AiCore>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(coreId, 'coreId');\n return this.get<AiCore>(`/hi/players/xuid(${player})/customization/ais/${coreId}`);\n }\n\n /**\n * Get Spartan body customization for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Spartan body configuration\n */\n spartanBodyCustomization(player: string): Promise<HaloApiResult<SpartanBody>> {\n this.assertNotEmpty(player, 'player');\n return this.get<SpartanBody>(`/hi/players/xuid(${player})/customization/spartanbody`);\n }\n\n /**\n * Get appearance customization for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Appearance configuration\n */\n playerAppearanceCustomization(\n player: string\n ): Promise<HaloApiResult<AppearanceCustomization>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AppearanceCustomization>(\n `/hi/players/xuid(${player})/customization/appearance`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Stores\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get the main store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getMainStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/main`);\n }\n\n /**\n * Get the HCS (esports) store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getHcsStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/hcs`);\n }\n\n /**\n * Get the boosts store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getBoostsStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/boosts`);\n }\n\n /**\n * Get the soft currency (Spartan Points) store.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getSoftCurrencyStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/softcurrency`);\n }\n\n /**\n * Get the customization store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getCustomizationStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/customization`);\n }\n\n /**\n * Get the operations store offerings.\n *\n * @param player - Player's numeric XUID\n * @returns Store items\n */\n getOperationsStore(player: string): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n return this.get<StoreItem>(`/hi/players/xuid(${player})/stores/operations`);\n }\n\n /**\n * Get scheduled storefront offerings.\n *\n * @param player - Player's numeric XUID\n * @param storeId - Store identifier\n * @returns Scheduled store items\n */\n getScheduledStorefrontOfferings(\n player: string,\n storeId: string\n ): Promise<HaloApiResult<StoreItem>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(storeId, 'storeId');\n return this.get<StoreItem>(\n `/hi/players/xuid(${player})/stores/${storeId}/scheduled`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Boosts & Rewards\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get active boosts for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Active boosts container\n */\n getActiveBoosts(player: string): Promise<HaloApiResult<ActiveBoostsContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<ActiveBoostsContainer>(`/hi/players/xuid(${player})/boosts`);\n }\n\n /**\n * Get awarded rewards for a player.\n *\n * @param player - Player's numeric XUID\n * @param rewardId - Reward identifier\n * @returns Reward snapshot\n */\n getAwardedRewards(\n player: string,\n rewardId: string\n ): Promise<HaloApiResult<RewardSnapshot>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(rewardId, 'rewardId');\n return this.get<RewardSnapshot>(\n `/hi/players/xuid(${player})/rewards/${rewardId}`\n );\n }\n\n /**\n * Get giveaway rewards for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Available giveaways\n */\n getGiveawayRewards(player: string): Promise<HaloApiResult<PlayerGiveaways>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerGiveaways>(`/hi/players/xuid(${player})/giveaways`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Reward Tracks / Operations\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get reward track progress for a player.\n *\n * @param player - Player's numeric XUID\n * @param rewardTrackType - Type of reward track\n * @param trackId - Track identifier\n * @returns Reward track details\n */\n getRewardTrack(\n player: string,\n rewardTrackType: string,\n trackId: string\n ): Promise<HaloApiResult<RewardTrack>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(rewardTrackType, 'rewardTrackType');\n this.assertNotEmpty(trackId, 'trackId');\n return this.get<RewardTrack>(\n `/hi/players/xuid(${player})/rewardtracks/${rewardTrackType}/${trackId}`\n );\n }\n\n /**\n * Get operation progress for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Operation reward track snapshot\n */\n getPlayerOperations(\n player: string\n ): Promise<HaloApiResult<OperationRewardTrackSnapshot>> {\n this.assertNotEmpty(player, 'player');\n return this.get<OperationRewardTrackSnapshot>(\n `/hi/players/xuid(${player})/operations`,\n { useClearance: true }\n );\n }\n\n /**\n * Get career rank for players.\n *\n * @param playerIds - List of player XUIDs\n * @param careerPathId - Career path identifier\n * @returns Career rank results\n */\n getPlayerCareerRank(\n playerIds: string[],\n careerPathId: string\n ): Promise<HaloApiResult<RewardTrackResultContainer>> {\n if (!playerIds.length) {\n throw new Error('playerIds cannot be empty');\n }\n this.assertNotEmpty(careerPathId, 'careerPathId');\n\n const playersQuery = playerIds.map((id) => `players=xuid(${id})`).join('&');\n return this.get<RewardTrackResultContainer>(\n `/hi/careerranks/${careerPathId}?${playersQuery}`\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { DisplayString, CurrencyDefinition, StoreOffering } from '../../models/halo-infinite/economy';\nimport type { Challenge, ChallengeDeckDefinition, RewardTrackMetadata, CareerTrackContainer } from '../../models/halo-infinite/progression';\nimport type { MedalMetadata, News, SeasonCalendar, AcademyStarDefinitions } from '../../models/halo-infinite/misc';\n\n/**\n * In-game item definition from CMS.\n */\nexport interface InGameItem {\n /** Tag identifier */\n tagId?: number;\n /** Common item data */\n commonData?: CommonItemData;\n /** Image path */\n imagePath?: string;\n /** Is kit */\n isKit?: boolean;\n /** Quality */\n quality?: string;\n}\n\n/**\n * Common data for in-game items.\n */\nexport interface CommonItemData {\n /** Item identifier */\n id?: string;\n /** Title */\n title?: DisplayString;\n /** Description */\n description?: DisplayString;\n /** Quality tier */\n quality?: string;\n /** Manufacturing season */\n manufacturingSeason?: string;\n}\n\n/**\n * Inventory definition from CMS.\n */\nexport interface InventoryDefinition {\n /** Item definitions */\n items?: Record<string, InGameItem>;\n}\n\n/**\n * Metadata container.\n */\nexport interface Metadata {\n /** Season info */\n season?: SeasonInfo;\n /** Active playlists */\n playlists?: PlaylistInfo[];\n}\n\n/**\n * Season info from metadata.\n */\nexport interface SeasonInfo {\n /** Season identifier */\n seasonId?: string;\n /** Season number */\n seasonNumber?: number;\n}\n\n/**\n * Playlist info.\n */\nexport interface PlaylistInfo {\n /** Playlist ID */\n playlistId?: string;\n /** Playlist name */\n name?: DisplayString;\n /** Description */\n description?: DisplayString;\n}\n\n/**\n * Game CMS module for static content and definitions.\n *\n * Provides access to:\n * - Item definitions\n * - Challenge definitions\n * - Season and career metadata\n * - Medal information\n * - News and guides\n *\n * @example\n * ```typescript\n * // Get medal metadata\n * const medals = await client.gameCms.getMedalMetadata();\n *\n * // Get career ranks\n * const careerRanks = await client.gameCms.getCareerRanks('career-path-id');\n *\n * // Get item definition\n * const item = await client.gameCms.getItem('item/path/here', 'flight-id');\n * ```\n */\nexport class GameCmsModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.GAME_CMS_ORIGIN);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Items & Inventory\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get an item definition by path.\n *\n * @param itemPath - Path to the item\n * @param flightId - Flight ID for clearance\n * @returns Item definition\n */\n getItem(itemPath: string, flightId?: string): Promise<HaloApiResult<InGameItem>> {\n this.assertNotEmpty(itemPath, 'itemPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<InGameItem>(`/hi/Progression/file/${itemPath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get the customization catalog/inventory definitions.\n *\n * @param flightId - Optional flight ID for flighted content\n * @returns Inventory definition\n */\n getCustomizationCatalog(flightId?: string): Promise<HaloApiResult<InventoryDefinition>> {\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<InventoryDefinition>(`/hi/Progression/file/inventory/catalog${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get a store offering definition.\n *\n * @param offeringPath - Path to the offering\n * @returns Store offering\n */\n getStoreOffering(offeringPath: string): Promise<HaloApiResult<StoreOffering>> {\n this.assertNotEmpty(offeringPath, 'offeringPath');\n return this.get<StoreOffering>(`/hi/Progression/file/${offeringPath}`);\n }\n\n /**\n * Get a currency definition.\n *\n * @param currencyPath - Path to the currency\n * @param flightId - Optional flight ID\n * @returns Currency definition\n */\n getCurrency(\n currencyPath: string,\n flightId?: string\n ): Promise<HaloApiResult<CurrencyDefinition>> {\n this.assertNotEmpty(currencyPath, 'currencyPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<CurrencyDefinition>(`/hi/Progression/file/${currencyPath}${flightParam}`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Challenges & Events\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get a challenge definition.\n *\n * @param challengePath - Path to the challenge\n * @param flightId - Optional flight ID\n * @returns Challenge definition\n */\n getChallenge(\n challengePath: string,\n flightId?: string\n ): Promise<HaloApiResult<Challenge>> {\n this.assertNotEmpty(challengePath, 'challengePath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<Challenge>(`/hi/Progression/file/${challengePath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n /**\n * Get a challenge deck definition.\n *\n * @param challengeDeckPath - Path to the challenge deck\n * @param flightId - Optional flight ID\n * @returns Challenge deck definition\n */\n getChallengeDeck(\n challengeDeckPath: string,\n flightId?: string\n ): Promise<HaloApiResult<ChallengeDeckDefinition>> {\n this.assertNotEmpty(challengeDeckPath, 'challengeDeckPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<ChallengeDeckDefinition>(\n `/hi/Progression/file/${challengeDeckPath}${flightParam}`,\n { useClearance: !!flightId }\n );\n }\n\n /**\n * Get an event/reward track definition.\n *\n * @param eventPath - Path to the event\n * @param flightId - Optional flight ID\n * @returns Reward track metadata\n */\n getEvent(\n eventPath: string,\n flightId?: string\n ): Promise<HaloApiResult<RewardTrackMetadata>> {\n this.assertNotEmpty(eventPath, 'eventPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<RewardTrackMetadata>(`/hi/Progression/file/${eventPath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Career & Seasons\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get career rank definitions.\n *\n * @param careerPathId - Career path identifier\n * @returns Career track container\n */\n getCareerRanks(careerPathId: string): Promise<HaloApiResult<CareerTrackContainer>> {\n this.assertNotEmpty(careerPathId, 'careerPathId');\n return this.get<CareerTrackContainer>(`/hi/Progression/file/careerranks/${careerPathId}`);\n }\n\n /**\n * Get the season calendar.\n *\n * @returns Season calendar\n */\n getSeasonCalendar(): Promise<HaloApiResult<SeasonCalendar>> {\n return this.get<SeasonCalendar>('/hi/Progression/file/calendars/seasons');\n }\n\n /**\n * Get the CSR/ranked season calendar.\n *\n * @returns CSR season calendar\n */\n getCsrCalendar(): Promise<HaloApiResult<SeasonCalendar>> {\n return this.get<SeasonCalendar>('/hi/Progression/file/calendars/csrseasons');\n }\n\n /**\n * Get a season reward track definition.\n *\n * @param seasonPath - Path to the season\n * @param flightId - Optional flight ID\n * @returns Season reward track\n */\n getSeasonRewardTrack(\n seasonPath: string,\n flightId?: string\n ): Promise<HaloApiResult<RewardTrackMetadata>> {\n this.assertNotEmpty(seasonPath, 'seasonPath');\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<RewardTrackMetadata>(`/hi/Progression/file/${seasonPath}${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Medals & Metadata\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get medal metadata and definitions.\n *\n * @returns Medal metadata\n */\n getMedalMetadata(): Promise<HaloApiResult<MedalMetadata>> {\n return this.get<MedalMetadata>('/hi/Progression/file/medals/metadata');\n }\n\n /**\n * Get general game metadata.\n *\n * @param flightId - Optional flight ID\n * @returns Metadata\n */\n getMetadata(flightId?: string): Promise<HaloApiResult<Metadata>> {\n const flightParam = flightId ? `?flight=${flightId}` : '';\n return this.get<Metadata>(`/hi/Progression/file/metadata${flightParam}`, {\n useClearance: !!flightId,\n });\n }\n\n // ─────────────────────────────────────────────────────────────────\n // News & Guides\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get news articles.\n *\n * @param filePath - Path to news file\n * @returns News collection\n */\n getNews(filePath: string): Promise<HaloApiResult<News>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<News>(`/hi/news/${filePath}`);\n }\n\n /**\n * Get academy star definitions.\n *\n * @returns Star definitions\n */\n getAcademyStarDefinitions(): Promise<HaloApiResult<AcademyStarDefinitions>> {\n return this.get<AcademyStarDefinitions>('/hi/Progression/file/academy/stars');\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Raw Files & Images\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get an image file from the CMS.\n *\n * @param filePath - Path to the image\n * @returns Image data as bytes\n */\n getImage(filePath: string): Promise<HaloApiResult<Uint8Array>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<Uint8Array>(`/hi/images/file/${filePath}`, { returnRaw: true });\n }\n\n /**\n * Get a generic file from the CMS.\n *\n * @param filePath - Path to the file\n * @returns File data as bytes\n */\n getGenericFile(filePath: string): Promise<HaloApiResult<Uint8Array>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<Uint8Array>(`/hi/Progression/file/${filePath}`, { returnRaw: true });\n }\n\n /**\n * Get a raw progression file with custom type.\n *\n * @template T - Expected return type\n * @param filePath - Path to the file\n * @returns Typed file contents\n */\n getProgressionFile<T>(filePath: string): Promise<HaloApiResult<T>> {\n this.assertNotEmpty(filePath, 'filePath');\n return this.get<T>(`/hi/Progression/file/${filePath}`);\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type {\n Server,\n LobbyPresenceRequestContainer,\n LobbyPresenceContainer,\n LobbyJoinHandle,\n JoinLobbyResponse,\n} from '../../models/halo-infinite/misc';\n\n/**\n * Lobby module for multiplayer lobby and presence APIs.\n *\n * @example\n * ```typescript\n * // Get QoS servers\n * const servers = await client.lobby.getQosServers();\n *\n * // Check player presence\n * const presence = await client.lobby.presence({\n * requests: [{ playerId: 'xuid', sessionId: 'session-id' }]\n * });\n * ```\n */\nexport class LobbyModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.LOBBY_ORIGIN);\n }\n\n /**\n * Get available QoS (Quality of Service) servers.\n *\n * @returns List of servers\n */\n getQosServers(): Promise<HaloApiResult<Server[]>> {\n return this.get<Server[]>('/hi/qosservers');\n }\n\n /**\n * Check presence for players in lobbies.\n *\n * @param presenceRequest - Presence request container\n * @returns Presence results\n */\n presence(\n presenceRequest: LobbyPresenceRequestContainer\n ): Promise<HaloApiResult<LobbyPresenceContainer>> {\n return this.postJson<LobbyPresenceContainer, LobbyPresenceRequestContainer>(\n '/hi/presence',\n presenceRequest\n );\n }\n\n /**\n * Get a third-party join handle for a lobby.\n *\n * @param lobbyId - Lobby identifier\n * @param player - Player XUID\n * @param handleAudience - Handle audience\n * @param handlePlatform - Handle platform\n * @returns Join handle\n */\n getThirdPartyJoinHandle(\n lobbyId: string,\n player: string,\n handleAudience: string,\n handlePlatform: string\n ): Promise<HaloApiResult<LobbyJoinHandle>> {\n this.assertNotEmpty(lobbyId, 'lobbyId');\n this.assertNotEmpty(player, 'player');\n return this.get<LobbyJoinHandle>(\n `/hi/lobbies/${lobbyId}/players/xuid(${player})/joinhandle?handleAudience=${handleAudience}&handlePlatform=${handlePlatform}`\n );\n }\n\n /**\n * Join a lobby.\n *\n * @param lobbyId - Lobby identifier\n * @param player - Player XUID\n * @param auth - Auth string\n * @param lobbyBootstrapPayload - Bootstrap payload\n * @returns Join response\n */\n joinLobby(\n lobbyId: string,\n player: string,\n auth: string,\n lobbyBootstrapPayload: Uint8Array\n ): Promise<HaloApiResult<JoinLobbyResponse>> {\n this.assertNotEmpty(lobbyId, 'lobbyId');\n this.assertNotEmpty(player, 'player');\n\n return this.client.executeRequest<JoinLobbyResponse>(\n this.buildUrl(`/hi/lobbies/${lobbyId}/players/xuid(${player})?auth=${auth}`),\n 'POST',\n {\n body: lobbyBootstrapPayload,\n contentType: 'bond' as any,\n }\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { FlightedFeatureFlags } from '../../models/halo-infinite/misc';\n\n/**\n * Settings module for clearance and flight configuration.\n *\n * @example\n * ```typescript\n * // Get clearance level\n * const clearance = await client.settings.getClearanceLevel();\n * ```\n */\nexport class SettingsModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.SETTINGS_ORIGIN);\n }\n\n /**\n * Get the clearance level for the current player.\n *\n * Returns feature flags and flight IDs the player has access to.\n *\n * @returns Flighted feature flags\n */\n getClearanceLevel(): Promise<HaloApiResult<FlightedFeatureFlags>> {\n return this.get<FlightedFeatureFlags>('/hi/clearance', {\n useSpartanToken: true,\n });\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { MatchSkillInfo, PlaylistCsrResultContainer } from '../../models/halo-infinite/skill';\n\n/**\n * Skill module for CSR (Competitive Skill Rank) queries.\n *\n * Provides access to:\n * - Match skill results (CSR changes after a match)\n * - Playlist CSR for players\n *\n * @example\n * ```typescript\n * // Get CSR for a player in a playlist\n * const csr = await client.skill.getPlaylistCsr('playlist-id', ['xuid1', 'xuid2']);\n *\n * // Get skill results for a match\n * const matchSkill = await client.skill.getMatchPlayerResult('match-id', ['xuid1']);\n * ```\n */\nexport class SkillModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.SKILL_ORIGIN);\n }\n\n /**\n * Get skill/CSR changes for players in a specific match.\n *\n * @param matchId - Match ID in GUID format\n * @param playerIds - List of player XUIDs to query\n * @returns Skill info for each player\n */\n getMatchPlayerResult(\n matchId: string,\n playerIds: string[]\n ): Promise<HaloApiResult<MatchSkillInfo>> {\n this.assertNotEmpty(matchId, 'matchId');\n if (!playerIds.length) {\n throw new Error('playerIds cannot be empty');\n }\n\n const playersQuery = playerIds.map((id) => `players=xuid(${id})`).join('&');\n return this.get<MatchSkillInfo>(\n `/hi/matches/${matchId}/skill?${playersQuery}`\n );\n }\n\n /**\n * Get current CSR for players in a specific playlist.\n *\n * @param playlistId - Playlist ID in GUID format\n * @param playerIds - List of player XUIDs to query\n * @param seasonId - Optional season ID for season-specific CSR\n * @returns CSR results for each player\n */\n getPlaylistCsr(\n playlistId: string,\n playerIds: string[],\n seasonId?: string\n ): Promise<HaloApiResult<PlaylistCsrResultContainer>> {\n this.assertNotEmpty(playlistId, 'playlistId');\n if (!playerIds.length) {\n throw new Error('playerIds cannot be empty');\n }\n\n const playersQuery = playerIds.map((id) => `players=xuid(${id})`).join('&');\n const seasonParam = seasonId ? `&seasonId=${seasonId}` : '';\n return this.get<PlaylistCsrResultContainer>(\n `/hi/playlist/${playlistId}/csrs?${playersQuery}${seasonParam}`\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { MatchType } from '../../models/halo-infinite/enums/match-type';\nimport type { LifecycleMode } from '../../models/halo-infinite/enums/lifecycle-mode';\nimport type {\n MatchStats,\n MatchHistoryResponse,\n PlayerMatchCount,\n PlayerServiceRecord,\n} from '../../models/halo-infinite/match';\nimport type { ChallengeDecksResponse, MatchProgression } from '../../models/halo-infinite/progression';\nimport type { MatchesPrivacy, PlayerDailyCustomExperience } from '../../models/halo-infinite/misc';\n\n/**\n * Stats module for match history and service records.\n *\n * Provides access to:\n * - Match history for players\n * - Individual match statistics\n * - Player service records (career stats)\n * - Challenge decks and progression\n *\n * @example\n * ```typescript\n * // Get match history\n * const history = await client.stats.getMatchHistory('xuid', 0, 25, MatchType.All);\n *\n * // Get specific match details\n * const match = await client.stats.getMatchStats('match-guid-here');\n *\n * // Get player service record\n * const record = await client.stats.getPlayerServiceRecordByXuid('xuid', LifecycleMode.Matchmade);\n * ```\n */\nexport class StatsModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.STATS_ORIGIN);\n }\n\n /**\n * Get challenge decks available for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Challenge decks response\n */\n getChallengeDecks(player: string): Promise<HaloApiResult<ChallengeDecksResponse>> {\n this.assertNotEmpty(player, 'player');\n return this.get<ChallengeDecksResponse>(`/hi/players/xuid(${player})/decks`);\n }\n\n /**\n * Get match count summary for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Match count breakdown by type\n */\n getMatchCount(player: string): Promise<HaloApiResult<PlayerMatchCount>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerMatchCount>(`/hi/players/xuid(${player})/matches/count`);\n }\n\n /**\n * Get match history for a player.\n *\n * @param player - Player's numeric XUID\n * @param start - Starting index for pagination (0-based)\n * @param count - Number of matches to return (max 25)\n * @param type - Type of matches to query\n * @returns Paginated match history\n */\n getMatchHistory(\n player: string,\n start: number,\n count: number,\n type: MatchType\n ): Promise<HaloApiResult<MatchHistoryResponse>> {\n this.assertNotEmpty(player, 'player');\n this.assertRange(count, 1, 25, 'count');\n this.assertRange(start, 0, Number.MAX_SAFE_INTEGER, 'start');\n\n return this.get<MatchHistoryResponse>(\n `/hi/players/xuid(${player})/matches?start=${start}&count=${count}&type=${type}`\n );\n }\n\n /**\n * Get detailed statistics for a specific match.\n *\n * @param matchId - Match ID in GUID format\n * @returns Complete match statistics\n */\n getMatchStats(matchId: string): Promise<HaloApiResult<MatchStats>> {\n this.assertNotEmpty(matchId, 'matchId');\n return this.get<MatchStats>(`/hi/matches/${matchId}/stats`);\n }\n\n /**\n * Get challenge progression for a player in a specific match.\n *\n * @param player - Player's numeric XUID\n * @param matchId - Match ID in GUID format\n * @returns Match progression details\n */\n getPlayerMatchProgression(\n player: string,\n matchId: string\n ): Promise<HaloApiResult<MatchProgression>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(matchId, 'matchId');\n\n return this.get<MatchProgression>(\n `/hi/players/xuid(${player})/matches/${matchId}/progression`\n );\n }\n\n /**\n * Get match privacy settings for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Privacy settings\n */\n getMatchPrivacy(player: string): Promise<HaloApiResult<MatchesPrivacy>> {\n this.assertNotEmpty(player, 'player');\n return this.get<MatchesPrivacy>(`/hi/players/xuid(${player})/matches-privacy`);\n }\n\n /**\n * Get service record for a player by XUID.\n *\n * The service record contains aggregate career statistics.\n *\n * @param xuid - Player's numeric XUID\n * @param mode - Lifecycle mode (matchmade, custom, local)\n * @param seasonId - Optional season ID for season-specific stats\n * @returns Player service record\n */\n getPlayerServiceRecordByXuid(\n xuid: string,\n mode: LifecycleMode,\n seasonId?: string\n ): Promise<HaloApiResult<PlayerServiceRecord>> {\n this.assertNotEmpty(xuid, 'xuid');\n\n const seasonParam = seasonId ? `?seasonId=${seasonId}` : '';\n return this.get<PlayerServiceRecord>(\n `/hi/players/xuid(${xuid})/${mode}/servicerecord${seasonParam}`\n );\n }\n\n /**\n * Get service record for a player by gamertag.\n *\n * @param gamertag - Player's gamertag\n * @param mode - Lifecycle mode (matchmade, custom, local)\n * @param seasonId - Optional season ID for season-specific stats\n * @returns Player service record\n */\n getPlayerServiceRecordByGamertag(\n gamertag: string,\n mode: LifecycleMode,\n seasonId?: string\n ): Promise<HaloApiResult<PlayerServiceRecord>> {\n this.assertNotEmpty(gamertag, 'gamertag');\n\n const encodedGamertag = encodeURIComponent(gamertag);\n const seasonParam = seasonId ? `?seasonId=${seasonId}` : '';\n return this.get<PlayerServiceRecord>(\n `/hi/players/${encodedGamertag}/${mode}/servicerecord${seasonParam}`\n );\n }\n\n /**\n * Get daily custom game XP for a player.\n *\n * @param player - Player's numeric XUID\n * @returns Daily custom experience info\n */\n getPlayerDailyCustomExperience(\n player: string\n ): Promise<HaloApiResult<PlayerDailyCustomExperience>> {\n this.assertNotEmpty(player, 'player');\n return this.get<PlayerDailyCustomExperience>(\n `/hi/players/xuid(${player})/customexperience`\n );\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\n\n/**\n * Text moderation key response.\n */\nexport interface ModerationKey {\n /** The moderation key */\n key?: string;\n /** Expiration time (ISO 8601) */\n expiresAt?: string;\n}\n\n/**\n * Text Moderation module for moderation-related APIs.\n *\n * @example\n * ```typescript\n * // Get moderation key\n * const key = await client.textModeration.getModerationKey();\n * ```\n */\nexport class TextModerationModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.TEXT_ORIGIN);\n }\n\n /**\n * Get a moderation key for text validation.\n *\n * @returns Moderation key\n */\n getModerationKey(): Promise<HaloApiResult<ModerationKey>> {\n return this.get<ModerationKey>('/hi/moderation/key');\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type {\n AuthoringAsset,\n AuthoringAssetVersion,\n AuthoringAssetContainer,\n AuthoringAssetVersionContainer,\n AuthoringAssetRating,\n AuthoringFavoritesContainer,\n FavoriteAsset,\n Permission,\n AssetReport,\n AssetAuthoringSession,\n AuthoringSessionSourceStarter,\n} from '../../models/halo-infinite/ugc';\n\n/**\n * UGC (User Generated Content) module for authoring operations.\n *\n * Provides access to:\n * - Creating, editing, and deleting user content\n * - Managing asset permissions\n * - Rating and favoriting assets\n * - Publishing and unpublishing assets\n *\n * @example\n * ```typescript\n * // Get an asset\n * const asset = await client.ugc.getAsset('hi', 'Map', 'asset-guid');\n *\n * // Favorite an asset\n * await client.ugc.favoriteAnAsset('xuid', 'Map', 'asset-guid');\n *\n * // List player's assets\n * const assets = await client.ugc.listPlayerAssets('hi', 'xuid', 'Map', 0, 25);\n * ```\n */\nexport class UgcModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.AUTHORING_ORIGIN);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Asset Retrieval\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get an asset by ID.\n *\n * @param title - Game title (e.g., 'hi' for Halo Infinite)\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Asset details\n */\n getAsset(\n title: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAsset>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAsset>(`/${title}/${assetType}/${assetId}`);\n }\n\n /**\n * Get the latest version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Latest asset version\n */\n getLatestAssetVersion(\n title: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetVersion>(`/${title}/${assetType}/${assetId}/versions/latest`);\n }\n\n /**\n * Get a specific version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @returns Asset version\n */\n getSpecificAssetVersion(\n title: string,\n assetType: string,\n assetId: string,\n versionId: string\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.get<AuthoringAssetVersion>(\n `/${title}/${assetType}/${assetId}/versions/${versionId}`\n );\n }\n\n /**\n * Get the published version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Published asset version\n */\n getPublishedVersion(\n title: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetVersion>(`/${title}/${assetType}/${assetId}/versions/published`);\n }\n\n /**\n * List all versions of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns All asset versions\n */\n listAllVersions(\n title: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetVersionContainer>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetVersionContainer>(`/${title}/${assetType}/${assetId}/versions`);\n }\n\n /**\n * List assets created by a player.\n *\n * @param title - Game title\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Player's assets\n */\n listPlayerAssets(\n title: string,\n player: string,\n assetType: string,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<AuthoringAssetContainer>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(player, 'player');\n return this.get<AuthoringAssetContainer>(\n `/${title}/players/xuid(${player})/${assetType}?start=${start}&count=${count}`\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Favorites\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Favorite an asset.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Favorite result\n */\n favoriteAnAsset(\n player: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<FavoriteAsset>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.postJson<FavoriteAsset, { assetId: string; assetKind: string }>(\n `/hi/players/xuid(${player})/favorites`,\n { assetId, assetKind: assetType }\n );\n }\n\n /**\n * Check if a player has bookmarked an asset.\n *\n * @param title - Game title\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Favorite status\n */\n checkAssetPlayerBookmark(\n title: string,\n player: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<FavoriteAsset>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<FavoriteAsset>(\n `/${title}/players/xuid(${player})/favorites/${assetType}/${assetId}`\n );\n }\n\n /**\n * List player's favorite assets of a specific type.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @returns Favorites container\n */\n listPlayerFavorites(\n player: string,\n assetType: string\n ): Promise<HaloApiResult<AuthoringFavoritesContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AuthoringFavoritesContainer>(\n `/hi/players/xuid(${player})/favorites/${assetType}`\n );\n }\n\n /**\n * List all of a player's favorite assets.\n *\n * @param player - Player XUID\n * @returns All favorites\n */\n listPlayerFavoritesAgnostic(\n player: string\n ): Promise<HaloApiResult<AuthoringFavoritesContainer>> {\n this.assertNotEmpty(player, 'player');\n return this.get<AuthoringFavoritesContainer>(`/hi/players/xuid(${player})/favorites`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Ratings & Reports\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get a player's rating for an asset.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Rating info\n */\n getAssetRatings(\n player: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAssetRating>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAssetRating>(\n `/hi/players/xuid(${player})/ratings/${assetType}/${assetId}`\n );\n }\n\n /**\n * Rate an asset.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param rating - Rating to submit\n * @returns Updated rating\n */\n rateAnAsset(\n player: string,\n assetType: string,\n assetId: string,\n rating: AuthoringAssetRating\n ): Promise<HaloApiResult<AuthoringAssetRating>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.putJson<AuthoringAssetRating, AuthoringAssetRating>(\n `/hi/players/xuid(${player})/ratings/${assetType}/${assetId}`,\n rating\n );\n }\n\n /**\n * Report an asset for moderation.\n *\n * @param player - Player XUID\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param report - Report details\n * @returns Report result\n */\n reportAnAsset(\n player: string,\n assetType: string,\n assetId: string,\n report: AssetReport\n ): Promise<HaloApiResult<AssetReport>> {\n this.assertNotEmpty(player, 'player');\n this.assertNotEmpty(assetId, 'assetId');\n return this.postJson<AssetReport, AssetReport>(\n `/hi/players/xuid(${player})/reports/${assetType}/${assetId}`,\n report\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Asset Management\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Delete an asset and all its versions.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Success status\n */\n deleteAllVersions(\n title: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.delete<boolean>(`/${title}/${assetType}/${assetId}`);\n }\n\n /**\n * Delete a specific version of an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @returns Success status\n */\n deleteVersion(\n title: string,\n assetType: string,\n assetId: string,\n versionId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.delete<boolean>(`/${title}/${assetType}/${assetId}/versions/${versionId}`);\n }\n\n /**\n * Publish an asset version.\n *\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @param clearanceId - Clearance ID\n * @returns Success status\n */\n publishAssetVersion(\n assetType: string,\n assetId: string,\n versionId: string,\n clearanceId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.post<boolean>(\n `/hi/${assetType}/${assetId}/versions/${versionId}/publish?clearanceId=${clearanceId}`\n );\n }\n\n /**\n * Unpublish an asset.\n *\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Success status\n */\n unpublishAsset(\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(assetId, 'assetId');\n return this.post<boolean>(`/hi/${assetType}/${assetId}/unpublish`);\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Permissions\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Grant or revoke permissions for an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param player - Player XUID to grant/revoke\n * @param permission - Permission details\n * @returns Updated permission\n */\n grantOrRevokePermissions(\n title: string,\n assetType: string,\n assetId: string,\n player: string,\n permission: Permission\n ): Promise<HaloApiResult<Permission>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(player, 'player');\n return this.putJson<Permission, Permission>(\n `/${title}/${assetType}/${assetId}/permissions/xuid(${player})`,\n permission\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Sessions\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Start an authoring session for an asset.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param includeContainerSas - Include container SAS URL\n * @returns Session details\n */\n startSession(\n title: string,\n assetType: string,\n assetId: string,\n includeContainerSas: boolean = false\n ): Promise<HaloApiResult<AssetAuthoringSession>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.post<AssetAuthoringSession>(\n `/${title}/${assetType}/${assetId}/sessions?includeContainerSas=${includeContainerSas}`\n );\n }\n\n /**\n * Extend an authoring session.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param includeContainerSas - Include container SAS URL\n * @returns Extended session\n */\n extendSession(\n title: string,\n assetType: string,\n assetId: string,\n includeContainerSas: boolean = false\n ): Promise<HaloApiResult<AssetAuthoringSession>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.putJson<AssetAuthoringSession, Record<string, never>>(\n `/${title}/${assetType}/${assetId}/sessions?includeContainerSas=${includeContainerSas}`,\n {}\n );\n }\n\n /**\n * End an authoring session.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @returns Success status\n */\n endSession(\n title: string,\n assetType: string,\n assetId: string\n ): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.delete<boolean>(`/${title}/${assetType}/${assetId}/sessions`);\n }\n\n /**\n * Create a new asset version.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param starter - Source asset to clone from\n * @returns New asset version\n */\n createAssetVersion(\n title: string,\n assetType: string,\n assetId: string,\n starter: AuthoringSessionSourceStarter\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n return this.postJson<AuthoringAssetVersion, AuthoringSessionSourceStarter>(\n `/${title}/${assetType}/${assetId}/versions`,\n starter\n );\n }\n\n /**\n * Patch an asset version.\n *\n * @param title - Game title\n * @param assetType - Type of asset\n * @param assetId - Asset GUID\n * @param versionId - Version GUID\n * @param patchedAsset - Updated asset data\n * @returns Updated asset version\n */\n patchAssetVersion(\n title: string,\n assetType: string,\n assetId: string,\n versionId: string,\n patchedAsset: Partial<AuthoringAssetVersion>\n ): Promise<HaloApiResult<AuthoringAssetVersion>> {\n this.assertNotEmpty(title, 'title');\n this.assertNotEmpty(assetId, 'assetId');\n this.assertNotEmpty(versionId, 'versionId');\n return this.patchJson<AuthoringAssetVersion, Partial<AuthoringAssetVersion>>(\n `/${title}/${assetType}/${assetId}/versions/${versionId}`,\n patchedAsset\n );\n }\n\n // ─────────────────────────────────────────────────────────────────\n // Blob Storage\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Get a blob from UGC storage.\n *\n * @param blobPath - Path to the blob\n * @returns Blob data as bytes\n */\n getBlob(blobPath: string): Promise<HaloApiResult<Uint8Array>> {\n this.assertNotEmpty(blobPath, 'blobPath');\n const blobUrl = `https://${HALO_CORE_ENDPOINTS.BLOBS_ORIGIN}.${HALO_CORE_ENDPOINTS.SERVICE_DOMAIN}${blobPath}`;\n return this.getFullUrl<Uint8Array>(blobUrl, { useSpartanToken: false, returnRaw: true });\n }\n}\n","import { ModuleBase } from '../base/module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { HALO_CORE_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\nimport type { AssetKind } from '../../models/halo-infinite/enums/asset-kind';\nimport type { ResultOrder } from '../../models/halo-infinite/enums/result-order';\nimport type { UgcSearchResult, AuthoringAsset } from '../../models/halo-infinite/ugc';\n\n/**\n * UGC Discovery module for searching and browsing user content.\n *\n * Provides access to:\n * - Searching for maps, game variants, and other content\n * - Browsing featured and popular content\n * - Getting recommended content\n *\n * @example\n * ```typescript\n * // Search for maps\n * const maps = await client.ugcDiscovery.search({\n * assetKinds: [AssetKind.Map],\n * term: 'blood gulch',\n * count: 10,\n * });\n *\n * // Get featured maps\n * const featured = await client.ugcDiscovery.getFeatured('Map');\n * ```\n */\nexport class UgcDiscoveryModule extends ModuleBase {\n constructor(client: ClientBase) {\n super(client, HALO_CORE_ENDPOINTS.DISCOVERY_ORIGIN);\n }\n\n /**\n * Search for user-generated content.\n *\n * @param params - Search parameters\n * @returns Search results\n */\n search(params: {\n /** Search term */\n term?: string;\n /** Asset kinds to include */\n assetKinds?: AssetKind[];\n /** Tags to filter by */\n tags?: string[];\n /** Author XUID */\n author?: string;\n /** Sort field */\n sort?: string;\n /** Sort order */\n order?: ResultOrder;\n /** Number of results */\n count?: number;\n /** Starting offset */\n start?: number;\n }): Promise<HaloApiResult<UgcSearchResult>> {\n const queryParts: string[] = [];\n\n if (params.term) {\n queryParts.push(`term=${encodeURIComponent(params.term)}`);\n }\n if (params.assetKinds?.length) {\n params.assetKinds.forEach((kind) => {\n queryParts.push(`assetKind=${kind}`);\n });\n }\n if (params.tags?.length) {\n params.tags.forEach((tag) => {\n queryParts.push(`tags=${encodeURIComponent(tag)}`);\n });\n }\n if (params.author) {\n queryParts.push(`author=xuid(${params.author})`);\n }\n if (params.sort) {\n queryParts.push(`sort=${params.sort}`);\n }\n if (params.order) {\n queryParts.push(`order=${params.order}`);\n }\n if (params.count !== undefined) {\n queryParts.push(`count=${params.count}`);\n }\n if (params.start !== undefined) {\n queryParts.push(`start=${params.start}`);\n }\n\n const queryString = queryParts.length > 0 ? `?${queryParts.join('&')}` : '';\n return this.get<UgcSearchResult>(`/hi/search${queryString}`);\n }\n\n /**\n * Get featured content of a specific type.\n *\n * @param assetKind - Type of asset\n * @returns Featured assets\n */\n getFeatured(assetKind: AssetKind): Promise<HaloApiResult<UgcSearchResult>> {\n return this.get<UgcSearchResult>(`/hi/featured/${assetKind}`);\n }\n\n /**\n * Get popular content of a specific type.\n *\n * @param assetKind - Type of asset\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Popular assets\n */\n getPopular(\n assetKind: AssetKind,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<UgcSearchResult>> {\n return this.get<UgcSearchResult>(\n `/hi/popular/${assetKind}?start=${start}&count=${count}`\n );\n }\n\n /**\n * Get recent content of a specific type.\n *\n * @param assetKind - Type of asset\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Recent assets\n */\n getRecent(\n assetKind: AssetKind,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<UgcSearchResult>> {\n return this.get<UgcSearchResult>(\n `/hi/recent/${assetKind}?start=${start}&count=${count}`\n );\n }\n\n /**\n * Get recommended content for a player.\n *\n * @param player - Player XUID\n * @param assetKind - Type of asset\n * @param count - Number of results\n * @returns Recommended assets\n */\n getRecommended(\n player: string,\n assetKind: AssetKind,\n count: number = 10\n ): Promise<HaloApiResult<UgcSearchResult>> {\n this.assertNotEmpty(player, 'player');\n return this.get<UgcSearchResult>(\n `/hi/players/xuid(${player})/recommendations/${assetKind}?count=${count}`\n );\n }\n\n /**\n * Browse content by tag.\n *\n * @param assetKind - Type of asset\n * @param tag - Tag to filter by\n * @param start - Starting offset\n * @param count - Number of results\n * @returns Tagged assets\n */\n browseByTag(\n assetKind: AssetKind,\n tag: string,\n start: number = 0,\n count: number = 25\n ): Promise<HaloApiResult<UgcSearchResult>> {\n this.assertNotEmpty(tag, 'tag');\n return this.get<UgcSearchResult>(\n `/hi/tags/${encodeURIComponent(tag)}/${assetKind}?start=${start}&count=${count}`\n );\n }\n\n /**\n * Get asset details for discovery purposes.\n *\n * @param assetKind - Type of asset\n * @param assetId - Asset GUID\n * @returns Asset details\n */\n getAssetDetails(\n assetKind: AssetKind,\n assetId: string\n ): Promise<HaloApiResult<AuthoringAsset>> {\n this.assertNotEmpty(assetId, 'assetId');\n return this.get<AuthoringAsset>(`/hi/${assetKind}/${assetId}`);\n }\n\n /**\n * Get film asset for a match.\n *\n * @param matchId - Match GUID\n * @returns Film asset if available\n */\n getFilmByMatchId(matchId: string): Promise<HaloApiResult<AuthoringAsset>> {\n this.assertNotEmpty(matchId, 'matchId');\n return this.get<AuthoringAsset>(`/hi/films/matches/${matchId}/spectate`);\n }\n}\n","import { ClientBase } from './base/client-base';\nimport type { HaloInfiniteClientOptions } from '../models/common/client-options';\n\n// Module imports\nimport { AcademyModule } from '../modules/halo-infinite/academy.module';\nimport { BanProcessorModule } from '../modules/halo-infinite/ban-processor.module';\nimport { ConfigurationModule } from '../modules/halo-infinite/configuration.module';\nimport { EconomyModule } from '../modules/halo-infinite/economy.module';\nimport { GameCmsModule } from '../modules/halo-infinite/game-cms.module';\nimport { LobbyModule } from '../modules/halo-infinite/lobby.module';\nimport { SettingsModule } from '../modules/halo-infinite/settings.module';\nimport { SkillModule } from '../modules/halo-infinite/skill.module';\nimport { StatsModule } from '../modules/halo-infinite/stats.module';\nimport { TextModerationModule } from '../modules/halo-infinite/text-moderation.module';\nimport { UgcModule } from '../modules/halo-infinite/ugc.module';\nimport { UgcDiscoveryModule } from '../modules/halo-infinite/ugc-discovery.module';\n\n/**\n * Main client for interacting with Halo Infinite APIs.\n *\n * Provides access to all API functionality through domain-specific modules.\n * Modules are lazily initialized on first access to minimize memory usage.\n *\n * @example\n * ```typescript\n * import { HaloInfiniteClient, MatchType, LifecycleMode, isSuccess } from '@dendev/grunt';\n *\n * // Create client with authentication\n * const client = new HaloInfiniteClient({\n * spartanToken: 'your-spartan-token',\n * xuid: 'xuid',\n * clearanceToken: 'flight-clearance-id',\n * });\n *\n * // Get match history\n * const history = await client.stats.getMatchHistory('xuid', 0, 25, MatchType.All);\n * if (isSuccess(history)) {\n * console.log(`Found ${history.result.resultCount} matches`);\n * }\n *\n * // Get player inventory\n * const inventory = await client.economy.getInventoryItems('xuid');\n *\n * // Get CSR for a playlist\n * const csr = await client.skill.getPlaylistCsr('playlist-id', ['xuid']);\n *\n * // Search for UGC maps\n * const maps = await client.ugcDiscovery.search({\n * assetKinds: [AssetKind.Map],\n * term: 'blood gulch',\n * });\n * ```\n */\nexport class HaloInfiniteClient extends ClientBase {\n // Lazy-loaded module instances\n private _academy?: AcademyModule;\n private _banProcessor?: BanProcessorModule;\n private _configuration?: ConfigurationModule;\n private _economy?: EconomyModule;\n private _gameCms?: GameCmsModule;\n private _lobby?: LobbyModule;\n private _settings?: SettingsModule;\n private _skill?: SkillModule;\n private _stats?: StatsModule;\n private _textModeration?: TextModerationModule;\n private _ugc?: UgcModule;\n private _ugcDiscovery?: UgcDiscoveryModule;\n\n /**\n * Creates a new HaloInfiniteClient instance.\n *\n * @param options - Client configuration options\n *\n * @example\n * ```typescript\n * const client = new HaloInfiniteClient({\n * spartanToken: 'your-spartan-token',\n * xuid: 'xuid',\n * includeRawResponses: true, // Enable for debugging\n * });\n * ```\n */\n constructor(options: HaloInfiniteClientOptions) {\n super({\n fetchFn: options.fetchFn,\n cacheTtlMs: options.cacheTtlMs,\n maxRetries: options.maxRetries,\n });\n\n this.spartanToken = options.spartanToken;\n this.xuid = options.xuid ?? '';\n this.clearanceToken = options.clearanceToken ?? '';\n this.includeRawResponses = options.includeRawResponses ?? false;\n this.userAgent = options.userAgent ?? '';\n }\n\n /**\n * Academy module for bot customization and drill-related APIs.\n *\n * Provides access to:\n * - Bot customization options\n * - Academy content manifest\n * - Star/scoring definitions for drills\n */\n get academy(): AcademyModule {\n return (this._academy ??= new AcademyModule(this));\n }\n\n /**\n * Ban Processor module for ban-related APIs.\n *\n * Provides access to:\n * - Ban summary queries for players\n */\n get banProcessor(): BanProcessorModule {\n return (this._banProcessor ??= new BanProcessorModule(this));\n }\n\n /**\n * Configuration module for endpoint discovery APIs.\n *\n * Provides access to:\n * - API settings and endpoint configuration\n */\n get configuration(): ConfigurationModule {\n return (this._configuration ??= new ConfigurationModule(this));\n }\n\n /**\n * Economy module for player customization, stores, and inventory APIs.\n *\n * Provides access to:\n * - Player inventory and currency balances\n * - Customization (armor, weapons, vehicles, AI)\n * - In-game stores and offerings\n * - Active boosts and rewards\n * - Operation/battle pass progress\n */\n get economy(): EconomyModule {\n return (this._economy ??= new EconomyModule(this));\n }\n\n /**\n * Game CMS module for static content and definitions.\n *\n * Provides access to:\n * - Item definitions\n * - Challenge definitions\n * - Season and career metadata\n * - Medal information\n * - News and guides\n */\n get gameCms(): GameCmsModule {\n return (this._gameCms ??= new GameCmsModule(this));\n }\n\n /**\n * Lobby module for multiplayer lobby and presence APIs.\n *\n * Provides access to:\n * - QoS servers\n * - Player presence in lobbies\n * - Join handles and lobby joining\n */\n get lobby(): LobbyModule {\n return (this._lobby ??= new LobbyModule(this));\n }\n\n /**\n * Settings module for clearance and flight configuration APIs.\n *\n * Provides access to:\n * - Clearance levels and feature flags\n */\n get settings(): SettingsModule {\n return (this._settings ??= new SettingsModule(this));\n }\n\n /**\n * Skill module for CSR (Competitive Skill Rank) APIs.\n *\n * Provides access to:\n * - Match skill results (CSR changes after a match)\n * - Playlist CSR for players\n */\n get skill(): SkillModule {\n return (this._skill ??= new SkillModule(this));\n }\n\n /**\n * Stats module for match history and service record APIs.\n *\n * Provides access to:\n * - Match history for players\n * - Individual match statistics\n * - Player service records (career stats)\n * - Challenge decks and progression\n */\n get stats(): StatsModule {\n return (this._stats ??= new StatsModule(this));\n }\n\n /**\n * Text Moderation module for moderation-related APIs.\n *\n * Provides access to:\n * - Moderation keys for text validation\n */\n get textModeration(): TextModerationModule {\n return (this._textModeration ??= new TextModerationModule(this));\n }\n\n /**\n * UGC (User Generated Content) module for authoring operations.\n *\n * Provides access to:\n * - Creating, editing, and deleting user content\n * - Managing asset permissions\n * - Rating and favoriting assets\n * - Publishing and unpublishing assets\n */\n get ugc(): UgcModule {\n return (this._ugc ??= new UgcModule(this));\n }\n\n /**\n * UGC Discovery module for searching and browsing user content.\n *\n * Provides access to:\n * - Searching for maps, game variants, and other content\n * - Browsing featured and popular content\n * - Getting recommended content\n */\n get ugcDiscovery(): UgcDiscoveryModule {\n return (this._ugcDiscovery ??= new UgcDiscoveryModule(this));\n }\n}\n","import type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport { WAYPOINT_ENDPOINTS } from '../../endpoints/halo-core-endpoints';\n\n/**\n * Abstract base class for Waypoint API modules.\n *\n * Similar to ModuleBase but uses Waypoint-specific endpoints\n * instead of the Halo Infinite service domain.\n */\nexport abstract class WaypointModuleBase {\n /**\n * Reference to the parent client for making HTTP requests.\n */\n protected readonly client: ClientBase;\n\n /**\n * Creates a new Waypoint module instance.\n *\n * @param client - Parent client instance\n */\n constructor(client: ClientBase) {\n this.client = client;\n }\n\n /**\n * Build a Waypoint API URL.\n *\n * @param path - API path starting with /\n * @returns Full HTTPS URL\n */\n protected buildUrl(path: string): string {\n return `https://${WAYPOINT_ENDPOINTS.API_DOMAIN}${path}`;\n }\n\n /**\n * Build a Waypoint web URL.\n *\n * @param path - Path starting with /\n * @returns Full HTTPS URL\n */\n protected buildWebUrl(path: string): string {\n return `https://${WAYPOINT_ENDPOINTS.WEB_DOMAIN}${path}`;\n }\n\n /**\n * Execute a GET request to the Waypoint API.\n */\n protected get<T>(\n path: string,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'GET', {\n useSpartanToken: options.useSpartanToken ?? true,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a POST request to the Waypoint API.\n */\n protected post<T>(\n path: string,\n body?: string,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n body,\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a POST request with a JSON body.\n */\n protected postJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'POST', {\n useSpartanToken: options.useSpartanToken ?? true,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Execute a PUT request with a JSON body.\n */\n protected putJson<T, TBody>(\n path: string,\n body: TBody,\n options: {\n useSpartanToken?: boolean;\n customHeaders?: Record<string, string>;\n } = {}\n ): Promise<HaloApiResult<T>> {\n return this.client.executeRequest<T>(this.buildUrl(path), 'PUT', {\n useSpartanToken: options.useSpartanToken ?? true,\n body: JSON.stringify(body),\n customHeaders: options.customHeaders,\n });\n }\n\n /**\n * Validate that a parameter is not null or undefined.\n */\n protected assertNotNull<T>(\n value: T | null | undefined,\n paramName: string\n ): asserts value is T {\n if (value == null) {\n throw new Error(`${paramName} cannot be null or undefined`);\n }\n }\n\n /**\n * Validate that a string is not empty.\n */\n protected assertNotEmpty(value: string, paramName: string): void {\n if (!value || value.trim().length === 0) {\n throw new Error(`${paramName} cannot be empty`);\n }\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type {\n UserProfile,\n UserSettings,\n ServiceAwardSnapshot,\n} from '../../models/waypoint';\n\n/**\n * Profile module for user profile and settings APIs.\n *\n * @example\n * ```typescript\n * // Get my profile\n * const profile = await client.profile.getMyProfile();\n *\n * // Get another user's profile\n * const otherProfile = await client.profile.getUserProfile('xuid', true);\n * ```\n */\nexport class ProfileModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Get the current user's settings.\n *\n * @returns User settings\n */\n getUserSettings(): Promise<HaloApiResult<UserSettings>> {\n return this.get<UserSettings>('/hi/users/me/settings');\n }\n\n /**\n * Get the current user's profile.\n *\n * @returns User profile\n */\n getMyProfile(): Promise<HaloApiResult<UserProfile>> {\n return this.get<UserProfile>('/hi/users/me');\n }\n\n /**\n * Get a user's profile by XUID or gamertag.\n *\n * @param userId - XUID or gamertag\n * @param isXuid - Whether userId is an XUID (true) or gamertag (false)\n * @returns User profile\n */\n getUserProfile(\n userId: string,\n isXuid: boolean = false\n ): Promise<HaloApiResult<UserProfile>> {\n this.assertNotEmpty(userId, 'userId');\n\n const identifier = isXuid ? `xuid(${userId})` : encodeURIComponent(userId);\n return this.get<UserProfile>(`/hi/users/${identifier}`);\n }\n\n /**\n * Get service awards for the current user.\n *\n * @returns Service award snapshot\n */\n getServiceAwards(): Promise<HaloApiResult<ServiceAwardSnapshot>> {\n return this.get<ServiceAwardSnapshot>('/hi/users/me/serviceawards');\n }\n\n /**\n * Update featured service awards for the current user.\n *\n * @param awards - Awards to feature\n * @returns Updated awards\n */\n putFeaturedServiceAwards(\n awards: ServiceAwardSnapshot\n ): Promise<HaloApiResult<ServiceAwardSnapshot>> {\n return this.putJson<ServiceAwardSnapshot, ServiceAwardSnapshot>(\n '/hi/users/me/serviceawards/featured',\n awards\n );\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type { CodeRedemptionResult } from '../../models/waypoint';\n\n/**\n * Redemption module for code redemption APIs.\n *\n * @example\n * ```typescript\n * // Redeem a code\n * const result = await client.redemption.redeemCode('XXXX-XXXX-XXXX');\n * ```\n */\nexport class RedemptionModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Redeem a promotional code.\n *\n * @param code - The code to redeem\n * @returns Redemption result\n */\n redeemCode(code: string): Promise<HaloApiResult<CodeRedemptionResult>> {\n this.assertNotEmpty(code, 'code');\n\n return this.postJson<CodeRedemptionResult, { code: string }>(\n '/hi/redemption/code',\n { code }\n );\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type { Article, ArticleCategory } from '../../models/waypoint';\n\n/**\n * Articles response container.\n */\nexport interface ArticlesResponse {\n /** List of articles */\n articles?: Article[];\n /** Total count */\n total?: number;\n /** Page number */\n page?: number;\n /** Per page count */\n perPage?: number;\n}\n\n/**\n * Content module for articles and news APIs.\n *\n * @example\n * ```typescript\n * // Get articles\n * const articles = await client.content.getArticles(1, 10);\n *\n * // Get article categories\n * const categories = await client.content.getCategories();\n * ```\n */\nexport class ContentModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Get articles from Halo Waypoint.\n *\n * @param page - Page number (1-based)\n * @param perPage - Articles per page\n * @param category - Optional category filter\n * @returns Articles response\n */\n getArticles(\n page: number = 1,\n perPage: number = 10,\n category?: number\n ): Promise<HaloApiResult<ArticlesResponse>> {\n const categoryParam = category !== undefined ? `&category=${category}` : '';\n return this.get<ArticlesResponse>(\n `/hi/articles?page=${page}&per_page=${perPage}${categoryParam}`,\n { useSpartanToken: false }\n );\n }\n\n /**\n * Get a specific article by slug.\n *\n * @param slug - Article URL slug\n * @returns Article details\n */\n getArticle(slug: string): Promise<HaloApiResult<Article>> {\n this.assertNotEmpty(slug, 'slug');\n return this.get<Article>(`/hi/articles/${encodeURIComponent(slug)}`, {\n useSpartanToken: false,\n });\n }\n\n /**\n * Get article categories.\n *\n * @returns List of categories\n */\n getCategories(): Promise<HaloApiResult<ArticleCategory[]>> {\n return this.get<ArticleCategory[]>('/hi/articles/categories', {\n useSpartanToken: false,\n });\n }\n}\n","import { WaypointModuleBase } from '../base/waypoint-module-base';\nimport type { ClientBase } from '../../clients/base/client-base';\nimport type { HaloApiResult } from '../../models/common/api-result';\nimport type { Notification } from '../../models/waypoint';\n\n/**\n * Notifications response container.\n */\nexport interface NotificationsResponse {\n /** List of notifications */\n notifications?: Notification[];\n /** Unread count */\n unreadCount?: number;\n}\n\n/**\n * Read notifications result.\n */\nexport interface ReadNotificationsResult {\n /** Whether the operation succeeded */\n success?: boolean;\n /** Number of notifications marked as read */\n count?: number;\n}\n\n/**\n * Comms module for notifications and communications APIs.\n *\n * @example\n * ```typescript\n * // Get notifications\n * const notifications = await client.comms.getNotifications();\n *\n * // Mark notifications as read\n * await client.comms.markNotificationsAsRead(['notification-id-1', 'notification-id-2']);\n * ```\n */\nexport class CommsModule extends WaypointModuleBase {\n constructor(client: ClientBase) {\n super(client);\n }\n\n /**\n * Get notifications for the current user.\n *\n * @returns Notifications response\n */\n getNotifications(): Promise<HaloApiResult<NotificationsResponse>> {\n return this.get<NotificationsResponse>('/hi/users/me/notifications');\n }\n\n /**\n * Mark notifications as read.\n *\n * @param notificationIds - IDs of notifications to mark as read\n * @returns Result of the operation\n */\n markNotificationsAsRead(\n notificationIds: string[]\n ): Promise<HaloApiResult<ReadNotificationsResult>> {\n if (!notificationIds.length) {\n throw new Error('notificationIds cannot be empty');\n }\n\n return this.postJson<ReadNotificationsResult, { notificationIds: string[] }>(\n '/hi/users/me/notifications/read',\n { notificationIds }\n );\n }\n\n /**\n * Delete a notification.\n *\n * @param notificationId - ID of notification to delete\n * @returns Success status\n */\n deleteNotification(notificationId: string): Promise<HaloApiResult<boolean>> {\n this.assertNotEmpty(notificationId, 'notificationId');\n return this.client.executeRequest<boolean>(\n this.buildUrl(`/hi/users/me/notifications/${notificationId}`),\n 'DELETE',\n { useSpartanToken: true }\n );\n }\n}\n","import { ClientBase } from './base/client-base';\nimport type { WaypointClientOptions } from '../models/common/client-options';\n\n// Module imports\nimport { ProfileModule } from '../modules/waypoint/profile.module';\nimport { RedemptionModule } from '../modules/waypoint/redemption.module';\nimport { ContentModule } from '../modules/waypoint/content.module';\nimport { CommsModule } from '../modules/waypoint/comms.module';\n\n/**\n * Client for interacting with Halo Waypoint APIs.\n *\n * Provides access to user profiles, code redemption, news content,\n * and notifications through domain-specific modules.\n *\n * @example\n * ```typescript\n * import { WaypointClient, isSuccess } from '@dendev/grunt';\n *\n * // Create client with authentication\n * const client = new WaypointClient({\n * spartanToken: 'your-spartan-token',\n * xuid: 'xuid',\n * });\n *\n * // Get my profile\n * const profile = await client.profile.getMyProfile();\n * if (isSuccess(profile)) {\n * console.log(`Hello, ${profile.result.gamertag}!`);\n * }\n *\n * // Get news articles (no auth required)\n * const unauthClient = new WaypointClient();\n * const articles = await unauthClient.content.getArticles(1, 10);\n *\n * // Redeem a code\n * const result = await client.redemption.redeemCode('XXXX-XXXX-XXXX');\n * ```\n */\nexport class WaypointClient extends ClientBase {\n // Lazy-loaded module instances\n private _profile?: ProfileModule;\n private _redemption?: RedemptionModule;\n private _content?: ContentModule;\n private _comms?: CommsModule;\n\n /**\n * Creates a new WaypointClient instance.\n *\n * Some endpoints (like news articles) don't require authentication,\n * so spartanToken is optional.\n *\n * @param options - Client configuration options (optional)\n *\n * @example\n * ```typescript\n * // With authentication\n * const authClient = new WaypointClient({\n * spartanToken: 'your-spartan-token',\n * });\n *\n * // Without authentication (for public endpoints)\n * const publicClient = new WaypointClient();\n * ```\n */\n constructor(options: WaypointClientOptions = {}) {\n super({\n fetchFn: options.fetchFn,\n cacheTtlMs: options.cacheTtlMs,\n maxRetries: options.maxRetries,\n });\n\n this.spartanToken = options.spartanToken ?? '';\n this.xuid = options.xuid ?? '';\n this.clearanceToken = options.clearanceToken ?? '';\n this.userAgent = options.userAgent ?? '';\n }\n\n /**\n * Profile module for user profile and settings APIs.\n *\n * Provides access to:\n * - User profiles (self and others)\n * - User settings\n * - Service awards\n */\n get profile(): ProfileModule {\n return (this._profile ??= new ProfileModule(this));\n }\n\n /**\n * Redemption module for code redemption APIs.\n *\n * Provides access to:\n * - Promotional code redemption\n */\n get redemption(): RedemptionModule {\n return (this._redemption ??= new RedemptionModule(this));\n }\n\n /**\n * Content module for articles and news APIs.\n *\n * Provides access to:\n * - News articles\n * - Article categories\n *\n * Note: Most content endpoints don't require authentication.\n */\n get content(): ContentModule {\n return (this._content ??= new ContentModule(this));\n }\n\n /**\n * Comms module for notifications and communications APIs.\n *\n * Provides access to:\n * - User notifications\n * - Marking notifications as read\n */\n get comms(): CommsModule {\n return (this._comms ??= new CommsModule(this));\n }\n}\n","import type { SpartanToken, SpartanTokenRequest, SpartanTokenProof } from './models';\nimport { HALO_CORE_ENDPOINTS } from '../endpoints/halo-core-endpoints';\nimport { HEADERS } from '../utils/constants';\n\n/**\n * Client for Halo authentication operations.\n *\n * Handles the exchange of Xbox Live XSTS tokens for Halo Spartan tokens,\n * which are required for authenticated API calls.\n *\n * @example\n * ```typescript\n * import { HaloAuthenticationClient, HaloInfiniteClient } from '@dendev/grunt';\n *\n * // Create auth client\n * const authClient = new HaloAuthenticationClient();\n *\n * // Exchange XSTS token for Spartan token\n * // (You need to obtain the XSTS token through Xbox Live authentication first)\n * const spartanToken = await authClient.getSpartanToken(xstsToken);\n *\n * if (spartanToken) {\n * // Use the Spartan token with HaloInfiniteClient\n * const client = new HaloInfiniteClient({\n * spartanToken: spartanToken.token!,\n * });\n * }\n * ```\n */\nexport class HaloAuthenticationClient {\n private readonly fetchFn: typeof fetch;\n\n /**\n * Creates a new HaloAuthenticationClient instance.\n *\n * @param fetchFn - Custom fetch implementation (optional)\n */\n constructor(fetchFn?: typeof fetch) {\n this.fetchFn = fetchFn ?? globalThis.fetch.bind(globalThis);\n }\n\n /**\n * Exchange an XSTS token for a Halo Spartan token.\n *\n * The XSTS token must be obtained through Xbox Live authentication\n * using the Halo Waypoint relying party.\n *\n * @param xstsToken - Xbox Live XSTS token\n * @param version - Spartan token version (4 for Halo Infinite, 3 for Halo 5)\n * @returns Spartan token or null if exchange failed\n *\n * @example\n * ```typescript\n * // Version 4 is for Halo Infinite (default)\n * const spartanToken = await authClient.getSpartanToken(xstsToken);\n *\n * // Version 3 is for Halo 5\n * const halo5Token = await authClient.getSpartanToken(xstsToken, 3);\n * ```\n */\n async getSpartanToken(\n xstsToken: string,\n version: number = 4\n ): Promise<SpartanToken | null> {\n if (!xstsToken) {\n throw new Error('xstsToken is required');\n }\n\n const tokenProof: SpartanTokenProof = {\n token: xstsToken,\n tokenType: 'Xbox_XSTSv3',\n };\n\n const requestBody: SpartanTokenRequest = {\n audience: 'urn:343:s3:services',\n minVersion: version.toString(),\n proof: [tokenProof],\n };\n\n try {\n const response = await this.fetchFn(HALO_CORE_ENDPOINTS.SPARTAN_TOKEN_ENDPOINT, {\n method: 'POST',\n headers: {\n [HEADERS.CONTENT_TYPE]: 'application/json',\n [HEADERS.ACCEPT]: 'application/json',\n },\n body: JSON.stringify(requestBody),\n });\n\n if (!response.ok) {\n console.error(\n `Failed to get Spartan token: ${response.status} ${response.statusText}`\n );\n return null;\n }\n\n const data = (await response.json()) as Record<string, unknown>;\n\n // The API returns the token with a capitalized property name\n return {\n token: (data.SpartanToken ?? data.spartanToken ?? data.token) as string | undefined,\n expiresUtc: (data.ExpiresUtc ?? data.expiresUtc) as string | undefined,\n tokenDuration: (data.TokenDuration ?? data.tokenDuration) as string | undefined,\n };\n } catch (error) {\n console.error('Error getting Spartan token:', error);\n return null;\n }\n }\n\n /**\n * Check if a Spartan token is expired or about to expire.\n *\n * @param token - The Spartan token to check\n * @param bufferMinutes - Minutes before expiration to consider \"about to expire\"\n * @returns true if the token is expired or will expire within the buffer time\n */\n isTokenExpired(token: SpartanToken, bufferMinutes: number = 5): boolean {\n if (!token.expiresUtc) {\n return true;\n }\n\n const expiresAt = new Date(token.expiresUtc);\n const now = new Date();\n const bufferMs = bufferMinutes * 60 * 1000;\n\n return now.getTime() + bufferMs >= expiresAt.getTime();\n }\n\n /**\n * Get the Halo Waypoint XSTS relying party URL.\n *\n * Use this when requesting an XSTS token from Xbox Live.\n *\n * @returns The relying party URL\n */\n static getRelyingParty(): string {\n return HALO_CORE_ENDPOINTS.HALO_WAYPOINT_XSTS_RELYING_PARTY;\n }\n}\n","/**\n * Generic result container for all Halo API responses.\n * Mirrors C# HaloApiResultContainer<T, TRawResponseContainer>.\n *\n * All API methods return this type, providing both the deserialized\n * result data and raw response information for debugging.\n *\n * @template T - The type of the expected response data\n *\n * @example\n * ```typescript\n * const result = await client.stats.getMatchStats('match-id');\n * if (isSuccess(result)) {\n * console.log(result.result.matchInfo);\n * } else {\n * console.error(`Error ${result.response.code}: ${result.response.message}`);\n * }\n * ```\n */\nexport interface HaloApiResult<T> {\n /** The deserialized response data, or null if request failed */\n result: T | null;\n /** Raw response information including headers, status, and body */\n response: RawResponse;\n}\n\n/**\n * Raw response container with request/response diagnostics.\n * Equivalent to C# RawResponseContainer.\n *\n * Contains HTTP-level details useful for debugging API issues.\n * Request details are only populated when `includeRawResponses` is enabled.\n */\nexport interface RawResponse {\n /** HTTP status code (e.g., 200, 404, 500) */\n code: number;\n /** Response body text or error message */\n message?: string;\n /** Full request URL including query parameters */\n requestUrl?: string;\n /** HTTP method used (GET, POST, PUT, DELETE, PATCH) */\n requestMethod?: string;\n /** Request headers that were sent */\n requestHeaders?: Record<string, string>;\n /** Request body that was sent */\n requestBody?: string;\n /** Response headers received from the server */\n responseHeaders?: Record<string, string>;\n}\n\n/**\n * Type guard to check if an API result was successful.\n * A successful result has a non-null result and a 2xx status code.\n *\n * @param result - The API result to check\n * @returns true if the result was successful with valid data\n *\n * @example\n * ```typescript\n * const result = await client.stats.getMatchStats('match-id');\n * if (isSuccess(result)) {\n * // TypeScript now knows result.result is non-null\n * console.log(result.result.matchId);\n * }\n * ```\n */\nexport function isSuccess<T>(\n result: HaloApiResult<T>\n): result is HaloApiResult<T> & { result: T } {\n return (\n result.result !== null &&\n result.response.code >= 200 &&\n result.response.code < 300\n );\n}\n\n/**\n * Type guard to check if an API result represents a \"not modified\" response.\n * This occurs when using ETag-based caching and the server returns 304.\n *\n * @param result - The API result to check\n * @returns true if the response was a 304 Not Modified\n */\nexport function isNotModified<T>(result: HaloApiResult<T>): boolean {\n return result.response.code === 304;\n}\n\n/**\n * Type guard to check if an API result represents a client error (4xx).\n *\n * @param result - The API result to check\n * @returns true if the response was a 4xx client error\n */\nexport function isClientError<T>(result: HaloApiResult<T>): boolean {\n return result.response.code >= 400 && result.response.code < 500;\n}\n\n/**\n * Type guard to check if an API result represents a server error (5xx).\n *\n * @param result - The API result to check\n * @returns true if the response was a 5xx server error\n */\nexport function isServerError<T>(result: HaloApiResult<T>): boolean {\n return result.response.code >= 500;\n}\n","/**\n * Match types for querying match history.\n *\n * Used with StatsModule.getMatchHistory() to filter matches.\n */\nexport const MatchType = {\n /** Return all match types */\n All: 'all',\n /** Return only matchmaking matches */\n Matchmaking: 'matchmaking',\n /** Return only custom games */\n Custom: 'custom',\n /** Return only local/offline matches */\n Local: 'local',\n} as const;\n\n/**\n * Type representing valid match type values.\n */\nexport type MatchType = (typeof MatchType)[keyof typeof MatchType];\n","/**\n * Lifecycle modes for service records and stats.\n *\n * Determines which game mode's statistics to retrieve.\n */\nexport const LifecycleMode = {\n /** Matchmade multiplayer games */\n Matchmade: 'matchmade',\n /** Custom games */\n Custom: 'custom',\n /** Local/offline games */\n Local: 'local',\n} as const;\n\n/**\n * Type representing valid lifecycle mode values.\n */\nexport type LifecycleMode = (typeof LifecycleMode)[keyof typeof LifecycleMode];\n","/**\n * Types of user-generated content assets.\n *\n * Used with UGC modules to specify the type of asset.\n */\nexport const AssetKind = {\n /** Film/theater recording */\n Film: 'Film',\n /** Custom map/forge creation */\n Map: 'Map',\n /** Prefabricated object collection */\n Prefab: 'Prefab',\n /** User-created game variant */\n UgcGameVariant: 'UgcGameVariant',\n /** Map-mode pairing */\n MapModePair: 'MapModePair',\n /** Playlist definition */\n Playlist: 'Playlist',\n /** Engine game variant */\n EngineGameVariant: 'EngineGameVariant',\n /** Project (forge project) */\n Project: 'Project',\n} as const;\n\n/**\n * Type representing valid asset kind values.\n */\nexport type AssetKind = (typeof AssetKind)[keyof typeof AssetKind];\n","/**\n * Type of player in a match.\n */\nexport const PlayerType = {\n /** Human player */\n Human: 'Human',\n /** Bot/AI player */\n Bot: 'Bot',\n} as const;\n\n/**\n * Type representing valid player type values.\n */\nexport type PlayerType = (typeof PlayerType)[keyof typeof PlayerType];\n","/**\n * Match outcome for a player or team.\n */\nexport const Outcome = {\n /** Won the match */\n Win: 'Win',\n /** Lost the match */\n Loss: 'Loss',\n /** Match ended in a tie */\n Tie: 'Tie',\n /** Did not finish the match */\n DidNotFinish: 'DidNotFinish',\n} as const;\n\n/**\n * Type representing valid outcome values.\n */\nexport type Outcome = (typeof Outcome)[keyof typeof Outcome];\n","/**\n * Sort order for search results.\n */\nexport const ResultOrder = {\n /** Sort in ascending order */\n Ascending: 'asc',\n /** Sort in descending order */\n Descending: 'desc',\n} as const;\n\n/**\n * Type representing valid result order values.\n */\nexport type ResultOrder = (typeof ResultOrder)[keyof typeof ResultOrder];\n","import type { RawResponse } from '../models/common/api-result';\n\n/**\n * Custom error class for Halo API errors.\n *\n * Thrown when an API request fails and provides access to\n * the full response details for debugging.\n *\n * @example\n * ```typescript\n * try {\n * const result = await client.stats.getMatchStats('invalid-id');\n * if (!isSuccess(result)) {\n * throw HaloApiError.fromResponse(result.response);\n * }\n * } catch (error) {\n * if (error instanceof HaloApiError) {\n * console.error(`API Error ${error.statusCode}: ${error.message}`);\n * }\n * }\n * ```\n */\nexport class HaloApiError extends Error {\n /**\n * HTTP status code from the response.\n */\n readonly statusCode: number;\n\n /**\n * Full raw response details.\n */\n readonly response: RawResponse;\n\n /**\n * Creates a new HaloApiError.\n *\n * @param message - Error message\n * @param statusCode - HTTP status code\n * @param response - Full raw response\n */\n constructor(message: string, statusCode: number, response: RawResponse) {\n super(message);\n this.name = 'HaloApiError';\n this.statusCode = statusCode;\n this.response = response;\n\n // Maintains proper stack trace in V8 environments\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HaloApiError);\n }\n }\n\n /**\n * Creates a HaloApiError from a raw response.\n *\n * @param response - The raw response to convert to an error\n * @returns A new HaloApiError instance\n */\n static fromResponse(response: RawResponse): HaloApiError {\n const message =\n response.message ?? `HTTP Error ${response.code}`;\n return new HaloApiError(message, response.code, response);\n }\n\n /**\n * Check if this is a client error (4xx).\n */\n get isClientError(): boolean {\n return this.statusCode >= 400 && this.statusCode < 500;\n }\n\n /**\n * Check if this is a server error (5xx).\n */\n get isServerError(): boolean {\n return this.statusCode >= 500;\n }\n\n /**\n * Check if this is a \"not found\" error (404).\n */\n get isNotFound(): boolean {\n return this.statusCode === 404;\n }\n\n /**\n * Check if this is an \"unauthorized\" error (401).\n */\n get isUnauthorized(): boolean {\n return this.statusCode === 401;\n }\n\n /**\n * Check if this is a \"forbidden\" error (403).\n */\n get isForbidden(): boolean {\n return this.statusCode === 403;\n }\n\n /**\n * Check if this is a \"rate limited\" error (429).\n */\n get isRateLimited(): boolean {\n return this.statusCode === 429;\n }\n}\n"]}