@cstar.help/js 0.17.0 → 0.17.3

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.d.ts CHANGED
@@ -2078,10 +2078,16 @@ interface Boss {
2078
2078
  interface BossDamageResult {
2079
2079
  object: 'boss_damage';
2080
2080
  damage: number;
2081
- bossHealth: number;
2082
- bossMaxHealth: number;
2083
- defeated: boolean;
2084
- [key: string]: unknown;
2081
+ currentHealth: number;
2082
+ /** Health fractions use the 0 to 1 range. */
2083
+ healthPercent: number;
2084
+ previousHealthPercent: number;
2085
+ isDefeated: boolean;
2086
+ isKillingBlow: boolean;
2087
+ shieldBlocked: boolean;
2088
+ shieldBroken: boolean;
2089
+ enrageTriggered: boolean;
2090
+ activeAbilities: string[];
2085
2091
  }
2086
2092
  /** Boss defeat record. */
2087
2093
  interface BossDefeat {
@@ -2106,8 +2112,10 @@ interface BossSpawnParams {
2106
2112
  }
2107
2113
  /** Parameters for dealing boss damage. */
2108
2114
  interface BossDamageParams {
2109
- userId: string;
2110
- ticketId: string;
2115
+ /** Defaults to the API key's creator. */
2116
+ userId?: string;
2117
+ userName?: string;
2118
+ priority?: 'low' | 'normal' | 'high' | 'urgent';
2111
2119
  }
2112
2120
  /** Leaderboard entry. */
2113
2121
  interface LeaderboardEntry {
@@ -2141,22 +2149,52 @@ interface Achievement {
2141
2149
  }
2142
2150
  /** Parameters for listing achievements. */
2143
2151
  interface AchievementListParams extends PaginationParams {
2144
- /** Whose achievement progress to load. Required — the endpoint 400s without it. */
2152
+ /** Whose achievement progress to load. Required; the endpoint 400s without it. */
2145
2153
  userId: string;
2146
2154
  category?: string;
2147
2155
  }
2148
2156
  /** A daily quest. */
2149
2157
  interface Quest {
2150
- id: string;
2151
- object: 'quest';
2152
- title: string;
2158
+ questId: string;
2159
+ name: string;
2153
2160
  description: string | null;
2154
- type: string;
2161
+ difficulty: string;
2162
+ progress: number;
2155
2163
  target: number;
2156
- current: number;
2157
2164
  completed: boolean;
2158
- xpReward: number;
2159
2165
  completedAt: string | null;
2166
+ xpReward: number;
2167
+ goldReward: number;
2168
+ }
2169
+ /** Today's quests and daily completion metadata. */
2170
+ interface QuestList {
2171
+ object: 'quest_list';
2172
+ quests: Quest[];
2173
+ completedToday: number;
2174
+ totalQuests: number;
2175
+ allComplete: boolean;
2176
+ completionBonus: {
2177
+ xp: number;
2178
+ gold: number;
2179
+ } | null;
2180
+ resetsAt: string;
2181
+ }
2182
+ /** Completed quests grouped by day. */
2183
+ interface QuestHistory {
2184
+ object: 'quest_history';
2185
+ history: Array<{
2186
+ date: string;
2187
+ quests: Array<Pick<Quest, 'questId' | 'name' | 'difficulty' | 'xpReward' | 'goldReward'> & {
2188
+ completedAt: string;
2189
+ }>;
2190
+ completedCount: number;
2191
+ }>;
2192
+ totalCompleted: number;
2193
+ }
2194
+ interface QuestHistoryParams {
2195
+ userId?: string;
2196
+ /** Number of completed quests to load, maximum 90. */
2197
+ limit?: number;
2160
2198
  }
2161
2199
  /** A daily puzzle. */
2162
2200
  interface Puzzle {
@@ -2171,15 +2209,59 @@ interface Puzzle {
2171
2209
  /** Puzzle completion parameters. */
2172
2210
  interface PuzzleCompleteParams {
2173
2211
  userId: string;
2174
- answer: string;
2212
+ puzzleId: string;
2213
+ timeSeconds: number;
2214
+ mistakes?: number;
2215
+ isWon?: boolean;
2175
2216
  }
2176
2217
  /** Puzzle completion result. */
2177
2218
  interface PuzzleCompleteResult {
2178
- object: 'puzzle_result';
2179
- correct: boolean;
2180
- xpAwarded: number;
2181
- streak: number;
2219
+ object: 'puzzle_completion';
2220
+ id: string;
2221
+ puzzleId: string;
2222
+ timeSeconds: number;
2223
+ mistakes: number;
2224
+ score: number;
2225
+ xpEarned: number;
2226
+ isWon: boolean;
2227
+ streak: {
2228
+ current: number;
2229
+ longest: number;
2230
+ totalCompleted: number;
2231
+ };
2182
2232
  }
2233
+ /** Scoreboards need a puzzle ID; streak boards are team-wide. */
2234
+ type PuzzleLeaderboardParams = {
2235
+ type?: 'scores';
2236
+ puzzleId: string;
2237
+ limit?: number;
2238
+ } | {
2239
+ type: 'streaks';
2240
+ limit?: number;
2241
+ };
2242
+ type PuzzleLeaderboardResult = {
2243
+ object: 'puzzle_leaderboard';
2244
+ type: 'scores';
2245
+ puzzleId: string;
2246
+ entries: Array<{
2247
+ rank: number;
2248
+ userId: string;
2249
+ timeSeconds: number;
2250
+ mistakes: number;
2251
+ score: number;
2252
+ xpEarned: number;
2253
+ }>;
2254
+ } | {
2255
+ object: 'puzzle_leaderboard';
2256
+ type: 'streaks';
2257
+ entries: Array<{
2258
+ rank: number;
2259
+ userId: string;
2260
+ currentStreak: number;
2261
+ longestStreak: number;
2262
+ totalCompleted: number;
2263
+ }>;
2264
+ };
2183
2265
  /** Puzzle streak info. */
2184
2266
  interface PuzzleStreak {
2185
2267
  object: 'puzzle_streak';
@@ -2192,22 +2274,39 @@ interface PuzzleStreak {
2192
2274
  interface OneUp {
2193
2275
  id: string;
2194
2276
  object: 'one_up';
2195
- senderId: string;
2196
- senderName: string | null;
2197
- recipientId: string;
2198
- recipientName: string | null;
2277
+ sender: {
2278
+ id: string;
2279
+ name: string | null;
2280
+ };
2281
+ recipient: {
2282
+ id: string;
2283
+ name: string | null;
2284
+ };
2199
2285
  message: string | null;
2286
+ goldAmount: number;
2287
+ wasFree: boolean;
2200
2288
  createdAt: string;
2201
2289
  }
2290
+ /** Sending a one-up also returns the remaining allowance and rewards. */
2291
+ interface OneUpSendResult extends OneUp {
2292
+ freeRemaining: number;
2293
+ recipientXpAwarded: number;
2294
+ recipientGoldAwarded: number;
2295
+ }
2202
2296
  /** Parameters for listing one-ups. */
2203
- interface OneUpListParams extends PaginationParams {
2297
+ interface OneUpListParams {
2204
2298
  userId?: string;
2299
+ limit?: number;
2205
2300
  }
2206
2301
  /** Parameters for sending a one-up. */
2207
2302
  interface OneUpCreateParams {
2303
+ /** Defaults to the API key's creator. */
2304
+ senderId?: string;
2305
+ senderName?: string;
2208
2306
  recipientId: string;
2307
+ recipientName?: string;
2209
2308
  message?: string;
2210
- userId: string;
2309
+ goldAmount?: number;
2211
2310
  }
2212
2311
  /** Remaining one-ups info. */
2213
2312
  interface OneUpRemaining {
@@ -2220,23 +2319,34 @@ interface OneUpRemaining {
2220
2319
  interface HighFive {
2221
2320
  id: string;
2222
2321
  object: 'high_five';
2223
- senderTeamId: string;
2224
- senderTeamName: string | null;
2225
- recipientTeamId: string;
2226
- recipientTeamName: string | null;
2227
- senderId: string;
2228
- senderName: string | null;
2322
+ senderTeam: {
2323
+ id: string;
2324
+ name: string | null;
2325
+ };
2326
+ senderUser: {
2327
+ id: string;
2328
+ name: string | null;
2329
+ };
2330
+ recipientTeam: {
2331
+ id: string;
2332
+ name: string | null;
2333
+ };
2229
2334
  message: string | null;
2230
2335
  createdAt: string;
2231
2336
  }
2232
2337
  /** Parameters for listing high fives. */
2233
- interface HighFiveListParams extends PaginationParams {
2338
+ interface HighFiveListParams {
2339
+ limit?: number;
2234
2340
  }
2235
2341
  /** Parameters for sending a high five. */
2236
2342
  interface HighFiveCreateParams {
2237
2343
  recipientTeamId: string;
2344
+ recipientTeamName?: string;
2345
+ /** Defaults to the API key's creator. */
2346
+ senderUserId?: string;
2347
+ senderUserName?: string;
2348
+ senderTeamName?: string;
2238
2349
  message?: string;
2239
- userId: string;
2240
2350
  }
2241
2351
  /** Can-send check result. */
2242
2352
  interface HighFiveCanSend {
@@ -2249,10 +2359,13 @@ interface Cosmetic {
2249
2359
  id: string;
2250
2360
  object: 'cosmetic';
2251
2361
  type: string;
2252
- name: string;
2253
- rarity: string | null;
2362
+ seasonId: string | null;
2254
2363
  unlockedAt: string;
2255
2364
  }
2365
+ interface CosmeticListParams {
2366
+ userId: string;
2367
+ type?: string;
2368
+ }
2256
2369
  /** Cosmetic preferences. */
2257
2370
  interface CosmeticPreferences {
2258
2371
  object: 'cosmetic_preferences';
@@ -2262,13 +2375,28 @@ interface CosmeticPreferences {
2262
2375
  interface Season {
2263
2376
  id: string;
2264
2377
  object: 'season';
2265
- name: string;
2266
- number: number;
2267
- startDate: string;
2268
- endDate: string;
2269
- active: boolean;
2270
- daysRemaining: number | null;
2378
+ isActive: boolean;
2379
+ startsAt: string;
2380
+ endsAt: string;
2381
+ daysRemaining: number;
2382
+ createdAt: string;
2271
2383
  }
2384
+ /** The current-season endpoint includes team details or a no-season state. */
2385
+ type CurrentSeason = {
2386
+ object: 'season';
2387
+ active: false;
2388
+ season: null;
2389
+ } | (Season & {
2390
+ isActive: true;
2391
+ name: string | null;
2392
+ number: number | null;
2393
+ badges: Array<{
2394
+ level: number;
2395
+ name: string;
2396
+ color: string;
2397
+ }>;
2398
+ teamParticipants: number;
2399
+ });
2272
2400
  /** Season stats for a user. */
2273
2401
  interface SeasonStats {
2274
2402
  object: 'season_stats';
@@ -2400,13 +2528,9 @@ declare class QuestsResource {
2400
2528
  /** Get today's quests. */
2401
2529
  today(params?: {
2402
2530
  userId?: string;
2403
- }): Promise<ApiResponse<Quest[]>>;
2531
+ }): Promise<ApiResponse<QuestList>>;
2404
2532
  /** Get quest history. */
2405
- history(params?: {
2406
- userId?: string;
2407
- page?: number;
2408
- pageSize?: number;
2409
- }): Promise<ApiResponse<unknown>>;
2533
+ history(params?: QuestHistoryParams): Promise<ApiResponse<QuestHistory>>;
2410
2534
  }
2411
2535
  declare class PuzzlesResource {
2412
2536
  private readonly client;
@@ -2415,25 +2539,25 @@ declare class PuzzlesResource {
2415
2539
  today(params?: {
2416
2540
  userId?: string;
2417
2541
  }): Promise<ApiResponse<Puzzle>>;
2418
- /** Submit a puzzle answer. */
2542
+ /** Record a completed puzzle, its timing and result. */
2419
2543
  complete(params: PuzzleCompleteParams, options?: RequestOptions): Promise<ApiResponse<PuzzleCompleteResult>>;
2420
2544
  /** Get puzzle streak for a user. */
2421
2545
  streak(params: {
2422
2546
  userId: string;
2423
2547
  }): Promise<ApiResponse<PuzzleStreak>>;
2424
2548
  /** Get puzzle leaderboard. */
2425
- leaderboard(params?: {
2426
- type?: 'scores' | 'streaks';
2427
- limit?: number;
2428
- }): Promise<ApiResponse<unknown>>;
2549
+ leaderboard(params: PuzzleLeaderboardParams): Promise<ApiResponse<PuzzleLeaderboardResult>>;
2429
2550
  }
2430
2551
  declare class OneUpsResource {
2431
2552
  private readonly client;
2432
2553
  constructor(client: HttpClient);
2433
2554
  /** List one-ups. */
2434
- list(params?: OneUpListParams): Promise<ListResponse<OneUp>>;
2555
+ list(params?: OneUpListParams): Promise<ApiResponse<{
2556
+ object: 'list';
2557
+ data: OneUp[];
2558
+ }>>;
2435
2559
  /** Send a one-up. */
2436
- send(params: OneUpCreateParams, options?: RequestOptions): Promise<ApiResponse<OneUp>>;
2560
+ send(params: OneUpCreateParams, options?: RequestOptions): Promise<ApiResponse<OneUpSendResult>>;
2437
2561
  /** Check remaining free one-ups today. */
2438
2562
  remaining(params: {
2439
2563
  userId: string;
@@ -2443,7 +2567,10 @@ declare class HighFivesResource {
2443
2567
  private readonly client;
2444
2568
  constructor(client: HttpClient);
2445
2569
  /** List high fives. */
2446
- list(params?: HighFiveListParams): Promise<ListResponse<HighFive>>;
2570
+ list(params?: HighFiveListParams): Promise<ApiResponse<{
2571
+ object: 'list';
2572
+ data: HighFive[];
2573
+ }>>;
2447
2574
  /** Send a high five. */
2448
2575
  send(params: HighFiveCreateParams, options?: RequestOptions): Promise<ApiResponse<HighFive>>;
2449
2576
  /** Check if you can send a high five to a team. */
@@ -2455,9 +2582,7 @@ declare class CosmeticsResource {
2455
2582
  private readonly client;
2456
2583
  constructor(client: HttpClient);
2457
2584
  /** List unlocked cosmetics. */
2458
- list(params?: {
2459
- userId?: string;
2460
- }): Promise<ApiResponse<Cosmetic[]>>;
2585
+ list(params: CosmeticListParams): Promise<ListResponse<Cosmetic>>;
2461
2586
  /** Get cosmetic preferences. */
2462
2587
  getPreferences(params: {
2463
2588
  userId: string;
@@ -2469,9 +2594,11 @@ declare class SeasonsResource {
2469
2594
  private readonly client;
2470
2595
  constructor(client: HttpClient);
2471
2596
  /** List all seasons. */
2472
- list(): Promise<ApiResponse<Season[]>>;
2597
+ list(params?: {
2598
+ limit?: number;
2599
+ }): Promise<ListResponse<Season>>;
2473
2600
  /** Get the current active season. */
2474
- current(): Promise<ApiResponse<Season>>;
2601
+ current(): Promise<ApiResponse<CurrentSeason>>;
2475
2602
  /** Get user stats for a season. */
2476
2603
  stats(seasonId: string, params: {
2477
2604
  userId: string;
@@ -2910,4 +3037,4 @@ declare class CStarClient {
2910
3037
  get lastMeta(): LastMeta;
2911
3038
  }
2912
3039
 
2913
- export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, type Attachment, type AttachmentListParams, type AuditLogEntry, type AuditLogListParams, type AutomationAction, type AutomationCondition, type AutomationConditions, type AutomationCreateParams, type AutomationExecution, type AutomationExecutionListParams, type AutomationListParams, type AutomationRule, type AutomationTestResult, type AutomationUpdateParams, type BillingPortal, type BillingPortalParams, type Boss, type BossDamageParams, type BossDamageResult, type BossDefeat, type BossDefeatListParams, type BossSpawnParams, type BulkDeleteParams, type BulkResult, type BulkUpdateParams, type BusinessHours, type BusinessHoursUpdateParams, CStarClient, type CStarClientConfig, CStarRealtime, type Category, type CategoryCreateParams, type CategoryListParams, type CategoryUpdateParams, type CommunityComment, type CommunityCommentCreateParams, type CommunityPost, type CommunityPostCreateParams, type CommunityPostListParams, type CommunityPostUpdateParams, type CommunityTopic, type ConnectionHandler, type Cosmetic, type CosmeticPreferences, type CsatSettings, type CsatSettingsUpdateParams, type CsatStats, type CsatSurvey, type CsatSurveyCreateParams, type CsatSurveyListParams, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerGroup, type CustomerGroupAddMembersParams, type CustomerGroupAddResult, type CustomerGroupCreateParams, type CustomerGroupListParams, type CustomerGroupMemberListParams, type CustomerGroupMembersResult, type CustomerGroupRemoveResult, type CustomerGroupUpdateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, type ErrorHandler, type EventHandler, type ExportCreateParams, type ExportResult, type GameConfig, type HighFive, type HighFiveCanSend, type HighFiveCreateParams, type HighFiveListParams, type ImportCreateParams, type ImportLog, type ImportLogListParams, type ImportResult, type Invite, type InviteCreateParams, type InviteListParams, type LeaderboardEntry, type LeaderboardParams, type ListResponse, type Member, type MemberListParams, type MemberUpdateParams, type Mention, type MentionListParams, type MentionUnreadCount, type Message, type MessageCreateParams, type Metadata, type Notification, type NotificationListParams, OfflineQueue, type OfflineQueueOptions, type OneUp, type OneUpCreateParams, type OneUpListParams, type OneUpRemaining, type PaginationInfo, type PaginationParams, type Player, type Puzzle, type PuzzleCompleteParams, type PuzzleCompleteResult, type PuzzleStreak, type Quest, type QueueItem, type QueueResult, type QuickReply, type QuickReplyCreateParams, type QuickReplyUpdateParams, type RealtimeEvent, type RealtimeOptions, type RequestOptions, type SavedView, type SearchParams, type SearchResult, type Season, type SeasonStats, type SkillAllocateParams, type SkillAllocateResult, type SkillTree, type SlaMetrics, type SlaMetricsParams, type SlaRule, type SlaRuleCreateParams, type SlaRuleListParams, type SlaRuleUpdateParams, type StatusCreateParams, type StatusUpdateParams, Subscription$1 as Subscription, type Tag, type TagListParams, type TeamSettings, type TeamSettingsUpdateParams, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketStatus, type TicketUpdateParams, type TopicCustomField, type UnreadCount, type ViewCreateParams, type ViewExecuteParams, type ViewListParams, type ViewUpdateParams, type Webhook, type WebhookCreateParams, type WebhookEventData, WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetSettings, type WidgetSettingsUpdateParams };
3040
+ export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, type Attachment, type AttachmentListParams, type AuditLogEntry, type AuditLogListParams, type AutomationAction, type AutomationCondition, type AutomationConditions, type AutomationCreateParams, type AutomationExecution, type AutomationExecutionListParams, type AutomationListParams, type AutomationRule, type AutomationTestResult, type AutomationUpdateParams, type BillingPortal, type BillingPortalParams, type Boss, type BossDamageParams, type BossDamageResult, type BossDefeat, type BossDefeatListParams, type BossSpawnParams, type BulkDeleteParams, type BulkResult, type BulkUpdateParams, type BusinessHours, type BusinessHoursUpdateParams, CStarClient, type CStarClientConfig, CStarRealtime, type Category, type CategoryCreateParams, type CategoryListParams, type CategoryUpdateParams, type CommunityComment, type CommunityCommentCreateParams, type CommunityPost, type CommunityPostCreateParams, type CommunityPostListParams, type CommunityPostUpdateParams, type CommunityTopic, type ConnectionHandler, type Cosmetic, type CosmeticListParams, type CosmeticPreferences, type CsatSettings, type CsatSettingsUpdateParams, type CsatStats, type CsatSurvey, type CsatSurveyCreateParams, type CsatSurveyListParams, type CurrentSeason, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerGroup, type CustomerGroupAddMembersParams, type CustomerGroupAddResult, type CustomerGroupCreateParams, type CustomerGroupListParams, type CustomerGroupMemberListParams, type CustomerGroupMembersResult, type CustomerGroupRemoveResult, type CustomerGroupUpdateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, type ErrorHandler, type EventHandler, type ExportCreateParams, type ExportResult, type GameConfig, type HighFive, type HighFiveCanSend, type HighFiveCreateParams, type HighFiveListParams, type ImportCreateParams, type ImportLog, type ImportLogListParams, type ImportResult, type Invite, type InviteCreateParams, type InviteListParams, type LeaderboardEntry, type LeaderboardParams, type ListResponse, type Member, type MemberListParams, type MemberUpdateParams, type Mention, type MentionListParams, type MentionUnreadCount, type Message, type MessageCreateParams, type Metadata, type Notification, type NotificationListParams, OfflineQueue, type OfflineQueueOptions, type OneUp, type OneUpCreateParams, type OneUpListParams, type OneUpRemaining, type OneUpSendResult, type PaginationInfo, type PaginationParams, type Player, type Puzzle, type PuzzleCompleteParams, type PuzzleCompleteResult, type PuzzleLeaderboardParams, type PuzzleLeaderboardResult, type PuzzleStreak, type Quest, type QuestHistory, type QuestHistoryParams, type QuestList, type QueueItem, type QueueResult, type QuickReply, type QuickReplyCreateParams, type QuickReplyUpdateParams, type RealtimeEvent, type RealtimeOptions, type RequestOptions, type SavedView, type SearchParams, type SearchResult, type Season, type SeasonStats, type SkillAllocateParams, type SkillAllocateResult, type SkillTree, type SlaMetrics, type SlaMetricsParams, type SlaRule, type SlaRuleCreateParams, type SlaRuleListParams, type SlaRuleUpdateParams, type StatusCreateParams, type StatusUpdateParams, Subscription$1 as Subscription, type Tag, type TagListParams, type TeamSettings, type TeamSettingsUpdateParams, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketStatus, type TicketUpdateParams, type TopicCustomField, type UnreadCount, type ViewCreateParams, type ViewExecuteParams, type ViewListParams, type ViewUpdateParams, type Webhook, type WebhookCreateParams, type WebhookEventData, WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetSettings, type WidgetSettingsUpdateParams };
package/dist/index.js CHANGED
@@ -237,7 +237,7 @@ function parseError(statusCode, body, retryAfter) {
237
237
  }
238
238
 
239
239
  // src/client.ts
240
- var SDK_VERSION = "0.15.1";
240
+ var SDK_VERSION = "0.17.3";
241
241
  var DEFAULT_BASE_URL = "https://www.cstar.help";
242
242
  var DEFAULT_API_VERSION = "2026-03-01";
243
243
  var DEFAULT_MAX_RETRIES = 3;
@@ -1938,7 +1938,7 @@ var BossResource = class {
1938
1938
  /** List boss defeat history. */
1939
1939
  async defeats(params) {
1940
1940
  return this.client.request("GET", "/game/boss/defeats", {
1941
- query: params
1941
+ query: params ? { ...params } : void 0
1942
1942
  });
1943
1943
  }
1944
1944
  /** Get a single defeat record. */
@@ -1953,25 +1953,25 @@ var AchievementsResource = class {
1953
1953
  /** List all achievements with progress. `params.userId` is required. */
1954
1954
  async list(params) {
1955
1955
  return this.client.request("GET", "/game/achievements", {
1956
- query: params
1956
+ query: params ? { ...params } : void 0
1957
1957
  });
1958
1958
  }
1959
1959
  /** List unlocked achievements only. */
1960
1960
  async unlocked(params) {
1961
1961
  return this.client.request("GET", "/game/achievements/unlocked", {
1962
- query: params
1962
+ query: params ? { ...params } : void 0
1963
1963
  });
1964
1964
  }
1965
1965
  /** Get a single achievement. */
1966
1966
  async get(achievementId, params) {
1967
1967
  return this.client.request("GET", `/game/achievements/${achievementId}`, {
1968
- query: params
1968
+ query: params ? { ...params } : void 0
1969
1969
  });
1970
1970
  }
1971
1971
  /** Get recently unlocked achievements across the team. */
1972
1972
  async recent(params) {
1973
1973
  return this.client.request("GET", "/game/achievements/recent", {
1974
- query: params
1974
+ query: params ? { ...params } : void 0
1975
1975
  });
1976
1976
  }
1977
1977
  };
@@ -1982,13 +1982,13 @@ var GameActivityResource = class {
1982
1982
  /** Get the team activity feed. */
1983
1983
  async list(params) {
1984
1984
  return this.client.request("GET", "/game/activity", {
1985
- query: params
1985
+ query: params ? { ...params } : void 0
1986
1986
  });
1987
1987
  }
1988
1988
  /** Get activity for a specific member. */
1989
1989
  async forMember(memberId, params) {
1990
1990
  return this.client.request("GET", `/game/activity/member/${memberId}`, {
1991
- query: params
1991
+ query: params ? { ...params } : void 0
1992
1992
  });
1993
1993
  }
1994
1994
  };
@@ -1999,13 +1999,13 @@ var QuestsResource = class {
1999
1999
  /** Get today's quests. */
2000
2000
  async today(params) {
2001
2001
  return this.client.request("GET", "/game/quests/today", {
2002
- query: params
2002
+ query: params ? { ...params } : void 0
2003
2003
  });
2004
2004
  }
2005
2005
  /** Get quest history. */
2006
2006
  async history(params) {
2007
2007
  return this.client.request("GET", "/game/quests/history", {
2008
- query: params
2008
+ query: params ? { ...params } : void 0
2009
2009
  });
2010
2010
  }
2011
2011
  };
@@ -2016,10 +2016,10 @@ var PuzzlesResource = class {
2016
2016
  /** Get today's puzzle. */
2017
2017
  async today(params) {
2018
2018
  return this.client.request("GET", "/game/puzzles/today", {
2019
- query: params
2019
+ query: params ? { ...params } : void 0
2020
2020
  });
2021
2021
  }
2022
- /** Submit a puzzle answer. */
2022
+ /** Record a completed puzzle, its timing and result. */
2023
2023
  async complete(params, options) {
2024
2024
  return this.client.request("POST", "/game/puzzles/complete", {
2025
2025
  body: params,
@@ -2029,13 +2029,13 @@ var PuzzlesResource = class {
2029
2029
  /** Get puzzle streak for a user. */
2030
2030
  async streak(params) {
2031
2031
  return this.client.request("GET", "/game/puzzles/streak", {
2032
- query: params
2032
+ query: params ? { ...params } : void 0
2033
2033
  });
2034
2034
  }
2035
2035
  /** Get puzzle leaderboard. */
2036
2036
  async leaderboard(params) {
2037
2037
  return this.client.request("GET", "/game/puzzles/leaderboard", {
2038
- query: params
2038
+ query: params ? { ...params } : void 0
2039
2039
  });
2040
2040
  }
2041
2041
  };
@@ -2046,7 +2046,7 @@ var OneUpsResource = class {
2046
2046
  /** List one-ups. */
2047
2047
  async list(params) {
2048
2048
  return this.client.request("GET", "/game/one-ups", {
2049
- query: params
2049
+ query: params ? { ...params } : void 0
2050
2050
  });
2051
2051
  }
2052
2052
  /** Send a one-up. */
@@ -2059,7 +2059,7 @@ var OneUpsResource = class {
2059
2059
  /** Check remaining free one-ups today. */
2060
2060
  async remaining(params) {
2061
2061
  return this.client.request("GET", "/game/one-ups/remaining", {
2062
- query: params
2062
+ query: params ? { ...params } : void 0
2063
2063
  });
2064
2064
  }
2065
2065
  };
@@ -2070,7 +2070,7 @@ var HighFivesResource = class {
2070
2070
  /** List high fives. */
2071
2071
  async list(params) {
2072
2072
  return this.client.request("GET", "/game/high-fives", {
2073
- query: params
2073
+ query: params ? { ...params } : void 0
2074
2074
  });
2075
2075
  }
2076
2076
  /** Send a high five. */
@@ -2083,7 +2083,7 @@ var HighFivesResource = class {
2083
2083
  /** Check if you can send a high five to a team. */
2084
2084
  async canSend(recipientTeamId, params) {
2085
2085
  return this.client.request("GET", `/game/high-fives/can-send/${recipientTeamId}`, {
2086
- query: params
2086
+ query: params ? { ...params } : void 0
2087
2087
  });
2088
2088
  }
2089
2089
  };
@@ -2094,13 +2094,13 @@ var CosmeticsResource = class {
2094
2094
  /** List unlocked cosmetics. */
2095
2095
  async list(params) {
2096
2096
  return this.client.request("GET", "/game/cosmetics", {
2097
- query: params
2097
+ query: params ? { ...params } : void 0
2098
2098
  });
2099
2099
  }
2100
2100
  /** Get cosmetic preferences. */
2101
2101
  async getPreferences(params) {
2102
2102
  return this.client.request("GET", "/game/cosmetics/preferences", {
2103
- query: params
2103
+ query: params ? { ...params } : void 0
2104
2104
  });
2105
2105
  }
2106
2106
  /** Update cosmetic preferences. */
@@ -2113,8 +2113,10 @@ var SeasonsResource = class {
2113
2113
  this.client = client;
2114
2114
  }
2115
2115
  /** List all seasons. */
2116
- async list() {
2117
- return this.client.request("GET", "/game/seasons");
2116
+ async list(params) {
2117
+ return this.client.request("GET", "/game/seasons", {
2118
+ query: params ? { ...params } : void 0
2119
+ });
2118
2120
  }
2119
2121
  /** Get the current active season. */
2120
2122
  async current() {
@@ -2123,7 +2125,7 @@ var SeasonsResource = class {
2123
2125
  /** Get user stats for a season. */
2124
2126
  async stats(seasonId, params) {
2125
2127
  return this.client.request("GET", `/game/seasons/${seasonId}/stats`, {
2126
- query: params
2128
+ query: params ? { ...params } : void 0
2127
2129
  });
2128
2130
  }
2129
2131
  };
@@ -2134,7 +2136,7 @@ var SkillsResource = class {
2134
2136
  /** Get the skill tree with current allocations. */
2135
2137
  async get(params) {
2136
2138
  return this.client.request("GET", "/game/skills", {
2137
- query: params
2139
+ query: params ? { ...params } : void 0
2138
2140
  });
2139
2141
  }
2140
2142
  /** Allocate a skill point. */
@@ -2169,7 +2171,7 @@ var GameResource = class {
2169
2171
  /** Get current player stats. */
2170
2172
  async player(params) {
2171
2173
  return this.client.request("GET", "/game/player", {
2172
- query: params
2174
+ query: params ? { ...params } : void 0
2173
2175
  });
2174
2176
  }
2175
2177
  /** Get a specific player's stats by membership ID. */
@@ -2184,13 +2186,13 @@ var GameResource = class {
2184
2186
  */
2185
2187
  async leaderboard(params) {
2186
2188
  return this.client.request("GET", "/game/leaderboard", {
2187
- query: params
2189
+ query: params ? { ...params } : void 0
2188
2190
  });
2189
2191
  }
2190
2192
  /** Get the current user's leaderboard position. */
2191
2193
  async myRank(params) {
2192
2194
  return this.client.request("GET", "/game/leaderboard/me", {
2193
- query: params
2195
+ query: params ? { ...params } : void 0
2194
2196
  });
2195
2197
  }
2196
2198
  /** Get game balance configuration (read-only constants). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cstar.help/js",
3
- "version": "0.17.0",
3
+ "version": "0.17.3",
4
4
  "description": "Official TypeScript SDK for the cStar customer support platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",