@cstar.help/js 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -316,7 +316,8 @@ var HttpClient = class {
316
316
  let lastError = null;
317
317
  for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
318
318
  if (attempt > 0 && lastError) {
319
- const delay = lastError instanceof CStarRateLimitError ? lastError.retryAfter * 1e3 : this.getBackoffDelay(attempt);
319
+ const RATE_LIMIT_RETRY_CAP_MS = 6e4;
320
+ const delay = lastError instanceof CStarRateLimitError ? Math.min(lastError.retryAfter * 1e3, RATE_LIMIT_RETRY_CAP_MS) : this.getBackoffDelay(attempt);
320
321
  await this.sleep(delay);
321
322
  }
322
323
  let response;
@@ -1300,10 +1301,31 @@ var InvitesResource = class {
1300
1301
  return this.client.request("DELETE", `/invites/${inviteId}`);
1301
1302
  }
1302
1303
  };
1304
+ var MemberPreferencesResource = class {
1305
+ constructor(client) {
1306
+ this.client = client;
1307
+ }
1308
+ /** Get an agent's UX preferences (boring mode, etc.). */
1309
+ async get(memberId) {
1310
+ return this.client.request(
1311
+ "GET",
1312
+ `/members/${memberId}/preferences`
1313
+ );
1314
+ }
1315
+ /** Update an agent's UX preferences. Only provided fields are written. */
1316
+ async update(memberId, params) {
1317
+ return this.client.request(
1318
+ "PATCH",
1319
+ `/members/${memberId}/preferences`,
1320
+ { body: params }
1321
+ );
1322
+ }
1323
+ };
1303
1324
  var MembersResource = class {
1304
1325
  constructor(client) {
1305
1326
  this.client = client;
1306
1327
  this.invites = new InvitesResource(client);
1328
+ this.preferences = new MemberPreferencesResource(client);
1307
1329
  }
1308
1330
  /** List all team members. */
1309
1331
  async list(params) {
@@ -2266,6 +2288,23 @@ var BillingResource = class {
2266
2288
  }
2267
2289
  };
2268
2290
 
2291
+ // src/resources/preferences.ts
2292
+ var PreferencesResource = class {
2293
+ constructor(client) {
2294
+ this.client = client;
2295
+ }
2296
+ /** Get team preferences. */
2297
+ async get() {
2298
+ return this.client.request("GET", "/preferences");
2299
+ }
2300
+ /** Update team preferences. Only provided fields are written. */
2301
+ async update(params) {
2302
+ return this.client.request("PATCH", "/preferences", {
2303
+ body: params
2304
+ });
2305
+ }
2306
+ };
2307
+
2269
2308
  // src/offline.ts
2270
2309
  var STORAGE_KEY = "cstar_offline_queue";
2271
2310
  var OfflineQueue = class {
@@ -2383,6 +2422,416 @@ var OfflineQueue = class {
2383
2422
  }
2384
2423
  };
2385
2424
 
2425
+ // src/types/generated/webhookEvents.ts
2426
+ var WEBHOOK_EVENT_SAMPLES = {
2427
+ "agent.preferences_updated": {
2428
+ "team_id": "team_01H8X9YZ7E0J3K4M5N6U",
2429
+ "member_id": "mem_01H8X9YZ7E0J3K4M5N6U",
2430
+ "agent_id": "agt_01H8X9YZ7E0J3K4M5N6U",
2431
+ "changed": [
2432
+ "boringMode"
2433
+ ],
2434
+ "preferences": {
2435
+ "boringMode": true
2436
+ }
2437
+ },
2438
+ "article.created": {
2439
+ "article": {
2440
+ "id": "art_01H8X9YZ7E0J3K4M5N6U",
2441
+ "title": "How to reset your password",
2442
+ "slug": "how-to-reset-your-password",
2443
+ "is_public": false,
2444
+ "created_at": "2026-04-27T18:42:11.000Z"
2445
+ }
2446
+ },
2447
+ "article.deleted": {
2448
+ "id": "art_01H8X9YZ7E0J3K4M5N6U"
2449
+ },
2450
+ "article.published": {
2451
+ "article": {
2452
+ "id": "art_01H8X9YZ7E0J3K4M5N6U",
2453
+ "title": "How to reset your password",
2454
+ "slug": "how-to-reset-your-password",
2455
+ "is_public": true,
2456
+ "published_at": "2026-04-27T19:00:00.000Z"
2457
+ }
2458
+ },
2459
+ "article.updated": {
2460
+ "article": {
2461
+ "id": "art_01H8X9YZ7E0J3K4M5N6U",
2462
+ "title": "How to reset your password (updated)",
2463
+ "slug": "how-to-reset-your-password",
2464
+ "is_public": true
2465
+ }
2466
+ },
2467
+ "boss.damaged": {
2468
+ "boss": {
2469
+ "id": "boss_thunder_drake",
2470
+ "current_hp": 740
2471
+ },
2472
+ "damage": 120,
2473
+ "by": {
2474
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2475
+ "name": "Riley"
2476
+ }
2477
+ },
2478
+ "boss.defeated": {
2479
+ "boss": {
2480
+ "id": "boss_thunder_drake",
2481
+ "name": "The Thunder Drake"
2482
+ },
2483
+ "final_blow_by": {
2484
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2485
+ "name": "Riley"
2486
+ },
2487
+ "team_xp_awarded": 1500
2488
+ },
2489
+ "boss.spawned": {
2490
+ "boss": {
2491
+ "id": "boss_thunder_drake",
2492
+ "name": "The Thunder Drake",
2493
+ "level": 4,
2494
+ "max_hp": 1200
2495
+ }
2496
+ },
2497
+ "community_post.commented": {
2498
+ "comment": {
2499
+ "id": "cmt_01H8X9YZ7E0J3K4M5N6X",
2500
+ "post_id": "post_01H8X9YZ7E0J3K4M5N6W",
2501
+ "content": "I would love this \u2014 bumping for visibility.",
2502
+ "author_id": "cus_01H8X9YZ7E0J3K4M5N6Q",
2503
+ "created_at": "2026-04-27T18:55:02.000Z"
2504
+ }
2505
+ },
2506
+ "community_post.created": {
2507
+ "post": {
2508
+ "id": "post_01H8X9YZ7E0J3K4M5N6W",
2509
+ "prefixed_id": "IDEA-42",
2510
+ "title": "Add Slack-style threading to tickets",
2511
+ "status": "open",
2512
+ "visibility": "public",
2513
+ "topic": "feature-requests",
2514
+ "created_at": "2026-04-27T18:42:11.000Z"
2515
+ }
2516
+ },
2517
+ "community_post.deleted": {
2518
+ "post": {
2519
+ "id": "post_01H8X9YZ7E0J3K4M5N6W",
2520
+ "prefixed_id": "IDEA-42",
2521
+ "title": "Add Slack-style threading to tickets"
2522
+ }
2523
+ },
2524
+ "community_post.status_changed": {
2525
+ "post": {
2526
+ "id": "post_01H8X9YZ7E0J3K4M5N6W",
2527
+ "title": "Add Slack-style threading to tickets",
2528
+ "status": "planned",
2529
+ "visibility": "public"
2530
+ }
2531
+ },
2532
+ "community_post.updated": {
2533
+ "post": {
2534
+ "id": "post_01H8X9YZ7E0J3K4M5N6W",
2535
+ "title": "Add Slack-style threading to tickets (revised)",
2536
+ "status": "open",
2537
+ "visibility": "public"
2538
+ }
2539
+ },
2540
+ "community_post.voted": {
2541
+ "post": {
2542
+ "id": "post_01H8X9YZ7E0J3K4M5N6W",
2543
+ "vote_count": 13
2544
+ },
2545
+ "voter": {
2546
+ "id": "cus_01H8X9YZ7E0J3K4M5N6Q"
2547
+ },
2548
+ "direction": "up"
2549
+ },
2550
+ "customer.created": {
2551
+ "customer": {
2552
+ "id": "cus_01H8X9YZ7E0J3K4M5N6Q",
2553
+ "name": "Casey Patel",
2554
+ "email": "casey@example.com",
2555
+ "status": "active",
2556
+ "tags": [
2557
+ "trial"
2558
+ ],
2559
+ "created_at": "2026-04-27T18:42:11.000Z"
2560
+ }
2561
+ },
2562
+ "customer.deleted": {
2563
+ "id": "cus_01H8X9YZ7E0J3K4M5N6Q"
2564
+ },
2565
+ "customer.updated": {
2566
+ "customer": {
2567
+ "id": "cus_01H8X9YZ7E0J3K4M5N6Q",
2568
+ "name": "Casey Patel",
2569
+ "email": "casey@example.com",
2570
+ "status": "active",
2571
+ "tags": [
2572
+ "trial",
2573
+ "paying"
2574
+ ]
2575
+ },
2576
+ "changes": {
2577
+ "tags": {
2578
+ "from": [
2579
+ "trial"
2580
+ ],
2581
+ "to": [
2582
+ "trial",
2583
+ "paying"
2584
+ ]
2585
+ }
2586
+ }
2587
+ },
2588
+ "customer_group.created": {
2589
+ "group": {
2590
+ "id": "grp_01H8X9YZ7E0J3K4M5N6T",
2591
+ "name": "Pro Plan",
2592
+ "color": "indigo",
2593
+ "member_count": 0
2594
+ }
2595
+ },
2596
+ "customer_group.deleted": {
2597
+ "customer_group": {
2598
+ "id": "grp_01H8X9YZ7E0J3K4M5N6T"
2599
+ }
2600
+ },
2601
+ "customer_group.updated": {
2602
+ "group": {
2603
+ "id": "grp_01H8X9YZ7E0J3K4M5N6T",
2604
+ "name": "Pro Plan (Annual)",
2605
+ "color": "indigo",
2606
+ "member_count": 38
2607
+ }
2608
+ },
2609
+ "player.achievement_unlocked": {
2610
+ "player": {
2611
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2612
+ "name": "Riley"
2613
+ },
2614
+ "achievement": {
2615
+ "id": "first_resolve",
2616
+ "name": "First Resolve",
2617
+ "xp": 50
2618
+ }
2619
+ },
2620
+ "player.level_up": {
2621
+ "player": {
2622
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2623
+ "name": "Riley"
2624
+ },
2625
+ "level": {
2626
+ "from": 7,
2627
+ "to": 8
2628
+ },
2629
+ "title_unlocked": "Apprentice Healer"
2630
+ },
2631
+ "player.quest_completed": {
2632
+ "player": {
2633
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2634
+ "name": "Riley"
2635
+ },
2636
+ "quest": {
2637
+ "id": "resolve_5_tickets",
2638
+ "name": "Resolve 5 tickets today",
2639
+ "xp": 100
2640
+ }
2641
+ },
2642
+ "player.streak_milestone": {
2643
+ "player": {
2644
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2645
+ "name": "Riley"
2646
+ },
2647
+ "streak_days": 5,
2648
+ "milestone": 5
2649
+ },
2650
+ "player.xp_gained": {
2651
+ "player": {
2652
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2653
+ "name": "Riley"
2654
+ },
2655
+ "amount": 75,
2656
+ "reason": "ticket.resolved",
2657
+ "ticket_id": "tkt_01H8X9YZ7E0J3K4M5N6P"
2658
+ },
2659
+ "social.high_five_sent": {
2660
+ "from_team": {
2661
+ "id": "team_acme",
2662
+ "name": "Acme Support"
2663
+ },
2664
+ "to_team": {
2665
+ "id": "team_globex",
2666
+ "name": "Globex Support"
2667
+ },
2668
+ "message": "Thanks for the assist!"
2669
+ },
2670
+ "social.one_up_sent": {
2671
+ "from": {
2672
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6S",
2673
+ "name": "Riley"
2674
+ },
2675
+ "to": {
2676
+ "agent_id": "usr_01H8X9YZ7E0J3K4M5N6V",
2677
+ "name": "Sam"
2678
+ },
2679
+ "ticket_id": "tkt_01H8X9YZ7E0J3K4M5N6P",
2680
+ "message": "Great empathy on this one"
2681
+ },
2682
+ "survey.submitted": {
2683
+ "survey": {
2684
+ "id": "svy_01H8X9YZ7E0J3K4M5N6Y",
2685
+ "ticket_id": "tkt_01H8X9YZ7E0J3K4M5N6P",
2686
+ "score": 5,
2687
+ "comment": "Resolved fast, thank you!",
2688
+ "submitted_at": "2026-04-27T19:30:00.000Z"
2689
+ },
2690
+ "customer": {
2691
+ "id": "cus_01H8X9YZ7E0J3K4M5N6Q",
2692
+ "email": "casey@example.com"
2693
+ }
2694
+ },
2695
+ "team.preferences_updated": {
2696
+ "team_id": "team_01H8X9YZ7E0J3K4M5N6U",
2697
+ "changed": [
2698
+ "bossBattlesEnabled"
2699
+ ],
2700
+ "preferences": {
2701
+ "bossBattlesEnabled": false
2702
+ }
2703
+ },
2704
+ "ticket.assigned": {
2705
+ "ticket": {
2706
+ "id": "tkt_01H8X9YZ7E0J3K4M5N6P",
2707
+ "prefixed_id": "CST-1024"
2708
+ },
2709
+ "assignee": {
2710
+ "id": "usr_01H8X9YZ7E0J3K4M5N6S",
2711
+ "name": "Riley",
2712
+ "email": "riley@acme.test"
2713
+ },
2714
+ "previous_assignee": null
2715
+ },
2716
+ "ticket.closed": {
2717
+ "ticket": {
2718
+ "id": "tkt_01H8X9YZ7E0J3K4M5N6P",
2719
+ "prefixed_id": "CST-1024",
2720
+ "title": "Cannot reset password",
2721
+ "status": "resolved",
2722
+ "priority": "normal",
2723
+ "channel": "widget",
2724
+ "resolved_at": "2026-04-27T19:08:43.000Z"
2725
+ },
2726
+ "changes": {
2727
+ "status": {
2728
+ "from": "open",
2729
+ "to": "resolved"
2730
+ }
2731
+ }
2732
+ },
2733
+ "ticket.created": {
2734
+ "ticket": {
2735
+ "id": "tkt_01H8X9YZ7E0J3K4M5N6P",
2736
+ "prefixed_id": "CST-1024",
2737
+ "title": "Cannot reset password",
2738
+ "status": "new",
2739
+ "priority": "normal",
2740
+ "channel": "widget",
2741
+ "customer_id": "cus_01H8X9YZ7E0J3K4M5N6Q",
2742
+ "created_at": "2026-04-27T18:42:11.000Z"
2743
+ },
2744
+ "customer": {
2745
+ "id": "cus_01H8X9YZ7E0J3K4M5N6Q",
2746
+ "name": "Casey Patel",
2747
+ "email": "casey@example.com"
2748
+ }
2749
+ },
2750
+ "ticket.deleted": {
2751
+ "id": "CST-1024"
2752
+ },
2753
+ "ticket.message_added": {
2754
+ "ticket": {
2755
+ "id": "tkt_01H8X9YZ7E0J3K4M5N6P",
2756
+ "dashboard_url": "https://www.cstar.help/team/acme/tickets?selected=tkt_01H8X9YZ7E0J3K4M5N6P"
2757
+ },
2758
+ "message": {
2759
+ "id": "msg_01H8X9YZ7E0J3K4M5N6R",
2760
+ "sender": "agent",
2761
+ "sender_name": "Riley",
2762
+ "content": "I just sent a reset link to your inbox \u2014 let me know if it lands.",
2763
+ "created_at": "2026-04-27T18:55:02.000Z"
2764
+ },
2765
+ "customer": {
2766
+ "id": "cus_01H8X9YZ7E0J3K4M5N6Q",
2767
+ "name": "Casey Patel",
2768
+ "email": "casey@example.com"
2769
+ }
2770
+ },
2771
+ "ticket.updated": {
2772
+ "ticket": {
2773
+ "id": "tkt_01H8X9YZ7E0J3K4M5N6P",
2774
+ "prefixed_id": "CST-1024",
2775
+ "title": "Cannot reset password",
2776
+ "status": "open",
2777
+ "priority": "high",
2778
+ "channel": "widget"
2779
+ },
2780
+ "changes": {
2781
+ "priority": {
2782
+ "from": "normal",
2783
+ "to": "high"
2784
+ },
2785
+ "tags": {
2786
+ "from": [
2787
+ "bug"
2788
+ ],
2789
+ "to": [
2790
+ "bug",
2791
+ "feature-request"
2792
+ ]
2793
+ }
2794
+ }
2795
+ }
2796
+ };
2797
+ var WEBHOOK_EVENT_CATALOG = {
2798
+ "agent.preferences_updated": { label: "Agent Preferences Updated", description: "Fired when an agent's per-user UX preferences change (e.g., boringMode toggled)", category: "team" },
2799
+ "article.created": { label: "New Article Created", description: "Fired when a new Library article is created", category: "articles" },
2800
+ "article.deleted": { label: "Article Deleted", description: "Fired when an article is deleted via app or API", category: "articles" },
2801
+ "article.published": { label: "Article Published", description: "Fired when an article is published to the Public Library", category: "articles" },
2802
+ "article.updated": { label: "Article Updated", description: "Fired when an article content or metadata is modified", category: "articles" },
2803
+ "boss.damaged": { label: "Boss Damaged", description: "Fired when a boss takes damage from a ticket close", category: "gamification" },
2804
+ "boss.defeated": { label: "Boss Defeated", description: "Fired when a boss is defeated by the team", category: "gamification" },
2805
+ "boss.spawned": { label: "Boss Battle Started", description: "Fired when a boss appears for the team", category: "gamification" },
2806
+ "community_post.commented": { label: "New Comment on Post", description: "Fired when a new comment is added to a community post", category: "community" },
2807
+ "community_post.created": { label: "New Community Post", description: "Fired when a new community post is created", category: "community" },
2808
+ "community_post.deleted": { label: "Community Post Deleted", description: "Fired when a community post is deleted", category: "community" },
2809
+ "community_post.status_changed": { label: "Post Status Changed", description: "Fired when a community post status is changed (e.g., Planned, Completed)", category: "community" },
2810
+ "community_post.updated": { label: "Community Post Updated", description: "Fired when a community post is updated", category: "community" },
2811
+ "community_post.voted": { label: "Post Voted On", description: "Fired when a community post receives a vote", category: "community" },
2812
+ "customer.created": { label: "New Customer Added", description: "Fired when a new customer is created", category: "customers" },
2813
+ "customer.deleted": { label: "Customer Deleted", description: "Fired when a customer is deleted via app or API", category: "customers" },
2814
+ "customer.updated": { label: "Customer Updated", description: "Fired when customer details are modified", category: "customers" },
2815
+ "customer_group.created": { label: "New Customer Group", description: "Fired when a customer group is created", category: "customers" },
2816
+ "customer_group.deleted": { label: "Customer Group Deleted", description: "Fired when a customer group is deleted", category: "customers" },
2817
+ "customer_group.updated": { label: "Customer Group Updated", description: "Fired when a customer group is modified", category: "customers" },
2818
+ "player.achievement_unlocked": { label: "Achievement Unlocked", description: "Fired when a player unlocks an achievement", category: "gamification" },
2819
+ "player.level_up": { label: "Player Leveled Up", description: "Fired when a player reaches a new level", category: "gamification" },
2820
+ "player.quest_completed": { label: "Quest Completed", description: "Fired when a player completes a daily quest", category: "gamification" },
2821
+ "player.streak_milestone": { label: "Streak Milestone", description: "Fired when a player hits a streak milestone (3, 5, 10, or 25 days)", category: "gamification" },
2822
+ "player.xp_gained": { label: "XP Gained", description: "Fired when a player earns XP from closing a ticket or quest", category: "gamification" },
2823
+ "social.high_five_sent": { label: "High Five Sent", description: "Fired when a team sends a high five to another team", category: "gamification" },
2824
+ "social.one_up_sent": { label: "One-Up Sent", description: "Fired when a teammate sends a one-up recognition", category: "gamification" },
2825
+ "survey.submitted": { label: "Customer Feedback Received", description: "Fired when a customer submits a CSAT survey response", category: "csat" },
2826
+ "team.preferences_updated": { label: "Team Preferences Updated", description: "Fired when team-wide UX preferences change (e.g., bossBattlesEnabled toggled)", category: "team" },
2827
+ "ticket.assigned": { label: "Ticket Assigned", description: "Fired when a ticket is assigned to an agent", category: "tickets" },
2828
+ "ticket.closed": { label: "Ticket Closed/Resolved", description: "Fired when a ticket is resolved or closed", category: "tickets" },
2829
+ "ticket.created": { label: "New Ticket Created", description: "Fired when a new ticket is created via app, widget, API, or email", category: "tickets" },
2830
+ "ticket.deleted": { label: "Ticket Deleted", description: "Fired when a ticket is deleted via app or API", category: "tickets" },
2831
+ "ticket.message_added": { label: "New Message on Ticket", description: "Fired when a new message is added to a ticket", category: "tickets" },
2832
+ "ticket.updated": { label: "Ticket Updated", description: "Fired when a ticket status, priority, or assignment changes", category: "tickets" }
2833
+ };
2834
+
2386
2835
  // src/index.ts
2387
2836
  var CStarClient = class {
2388
2837
  constructor(config) {
@@ -2399,6 +2848,7 @@ var CStarClient = class {
2399
2848
  };
2400
2849
  this.members = new MembersResource(this._httpClient);
2401
2850
  this.settings = new SettingsResource(this._httpClient);
2851
+ this.preferences = new PreferencesResource(this._httpClient);
2402
2852
  this.notifications = new NotificationsResource(this._httpClient);
2403
2853
  this.mentions = new MentionsResource(this._httpClient);
2404
2854
  this.attachments = new AttachmentsResource(this._httpClient);
@@ -2481,5 +2931,7 @@ export {
2481
2931
  CStarValidationError,
2482
2932
  ErrorType,
2483
2933
  OfflineQueue,
2484
- Subscription
2934
+ Subscription,
2935
+ WEBHOOK_EVENT_CATALOG,
2936
+ WEBHOOK_EVENT_SAMPLES
2485
2937
  };
@@ -1,5 +1,15 @@
1
1
  /** Every webhook event type cStar can dispatch. */
2
- type WebhookEventType = 'article.created' | 'article.deleted' | 'article.published' | 'article.updated' | 'boss.damaged' | 'boss.defeated' | 'boss.spawned' | 'community_post.commented' | 'community_post.created' | 'community_post.deleted' | 'community_post.status_changed' | 'community_post.updated' | 'community_post.voted' | 'customer.created' | 'customer.deleted' | 'customer.updated' | 'customer_group.created' | 'customer_group.deleted' | 'customer_group.updated' | 'player.achievement_unlocked' | 'player.level_up' | 'player.quest_completed' | 'player.streak_milestone' | 'player.xp_gained' | 'social.high_five_sent' | 'social.one_up_sent' | 'survey.submitted' | 'ticket.assigned' | 'ticket.closed' | 'ticket.created' | 'ticket.deleted' | 'ticket.message_added' | 'ticket.updated';
2
+ type WebhookEventType = 'agent.preferences_updated' | 'article.created' | 'article.deleted' | 'article.published' | 'article.updated' | 'boss.damaged' | 'boss.defeated' | 'boss.spawned' | 'community_post.commented' | 'community_post.created' | 'community_post.deleted' | 'community_post.status_changed' | 'community_post.updated' | 'community_post.voted' | 'customer.created' | 'customer.deleted' | 'customer.updated' | 'customer_group.created' | 'customer_group.deleted' | 'customer_group.updated' | 'player.achievement_unlocked' | 'player.level_up' | 'player.quest_completed' | 'player.streak_milestone' | 'player.xp_gained' | 'social.high_five_sent' | 'social.one_up_sent' | 'survey.submitted' | 'team.preferences_updated' | 'ticket.assigned' | 'ticket.closed' | 'ticket.created' | 'ticket.deleted' | 'ticket.message_added' | 'ticket.updated';
3
+ /** Payload for `agent.preferences_updated` events. */
4
+ interface AgentPreferencesUpdatedPayload {
5
+ team_id: string;
6
+ member_id: string;
7
+ agent_id: string;
8
+ changed: Array<string>;
9
+ preferences: {
10
+ boringMode: boolean;
11
+ };
12
+ }
3
13
  /** Payload for `article.created` events. */
4
14
  interface ArticleCreatedPayload {
5
15
  article: {
@@ -274,6 +284,14 @@ interface SurveySubmittedPayload {
274
284
  email: string;
275
285
  };
276
286
  }
287
+ /** Payload for `team.preferences_updated` events. */
288
+ interface TeamPreferencesUpdatedPayload {
289
+ team_id: string;
290
+ changed: Array<string>;
291
+ preferences: {
292
+ bossBattlesEnabled: boolean;
293
+ };
294
+ }
277
295
  /** Payload for `ticket.assigned` events. */
278
296
  interface TicketAssignedPayload {
279
297
  ticket: {
@@ -364,6 +382,7 @@ interface TicketUpdatedPayload {
364
382
  }
365
383
  /** Maps each event type to its payload interface — used internally for the discriminated union. */
366
384
  interface WebhookEventDataMap {
385
+ 'agent.preferences_updated': AgentPreferencesUpdatedPayload;
367
386
  'article.created': ArticleCreatedPayload;
368
387
  'article.deleted': ArticleDeletedPayload;
369
388
  'article.published': ArticlePublishedPayload;
@@ -391,6 +410,7 @@ interface WebhookEventDataMap {
391
410
  'social.high_five_sent': SocialHighFiveSentPayload;
392
411
  'social.one_up_sent': SocialOneUpSentPayload;
393
412
  'survey.submitted': SurveySubmittedPayload;
413
+ 'team.preferences_updated': TeamPreferencesUpdatedPayload;
394
414
  'ticket.assigned': TicketAssignedPayload;
395
415
  'ticket.closed': TicketClosedPayload;
396
416
  'ticket.created': TicketCreatedPayload;
@@ -1,5 +1,15 @@
1
1
  /** Every webhook event type cStar can dispatch. */
2
- type WebhookEventType = 'article.created' | 'article.deleted' | 'article.published' | 'article.updated' | 'boss.damaged' | 'boss.defeated' | 'boss.spawned' | 'community_post.commented' | 'community_post.created' | 'community_post.deleted' | 'community_post.status_changed' | 'community_post.updated' | 'community_post.voted' | 'customer.created' | 'customer.deleted' | 'customer.updated' | 'customer_group.created' | 'customer_group.deleted' | 'customer_group.updated' | 'player.achievement_unlocked' | 'player.level_up' | 'player.quest_completed' | 'player.streak_milestone' | 'player.xp_gained' | 'social.high_five_sent' | 'social.one_up_sent' | 'survey.submitted' | 'ticket.assigned' | 'ticket.closed' | 'ticket.created' | 'ticket.deleted' | 'ticket.message_added' | 'ticket.updated';
2
+ type WebhookEventType = 'agent.preferences_updated' | 'article.created' | 'article.deleted' | 'article.published' | 'article.updated' | 'boss.damaged' | 'boss.defeated' | 'boss.spawned' | 'community_post.commented' | 'community_post.created' | 'community_post.deleted' | 'community_post.status_changed' | 'community_post.updated' | 'community_post.voted' | 'customer.created' | 'customer.deleted' | 'customer.updated' | 'customer_group.created' | 'customer_group.deleted' | 'customer_group.updated' | 'player.achievement_unlocked' | 'player.level_up' | 'player.quest_completed' | 'player.streak_milestone' | 'player.xp_gained' | 'social.high_five_sent' | 'social.one_up_sent' | 'survey.submitted' | 'team.preferences_updated' | 'ticket.assigned' | 'ticket.closed' | 'ticket.created' | 'ticket.deleted' | 'ticket.message_added' | 'ticket.updated';
3
+ /** Payload for `agent.preferences_updated` events. */
4
+ interface AgentPreferencesUpdatedPayload {
5
+ team_id: string;
6
+ member_id: string;
7
+ agent_id: string;
8
+ changed: Array<string>;
9
+ preferences: {
10
+ boringMode: boolean;
11
+ };
12
+ }
3
13
  /** Payload for `article.created` events. */
4
14
  interface ArticleCreatedPayload {
5
15
  article: {
@@ -274,6 +284,14 @@ interface SurveySubmittedPayload {
274
284
  email: string;
275
285
  };
276
286
  }
287
+ /** Payload for `team.preferences_updated` events. */
288
+ interface TeamPreferencesUpdatedPayload {
289
+ team_id: string;
290
+ changed: Array<string>;
291
+ preferences: {
292
+ bossBattlesEnabled: boolean;
293
+ };
294
+ }
277
295
  /** Payload for `ticket.assigned` events. */
278
296
  interface TicketAssignedPayload {
279
297
  ticket: {
@@ -364,6 +382,7 @@ interface TicketUpdatedPayload {
364
382
  }
365
383
  /** Maps each event type to its payload interface — used internally for the discriminated union. */
366
384
  interface WebhookEventDataMap {
385
+ 'agent.preferences_updated': AgentPreferencesUpdatedPayload;
367
386
  'article.created': ArticleCreatedPayload;
368
387
  'article.deleted': ArticleDeletedPayload;
369
388
  'article.published': ArticlePublishedPayload;
@@ -391,6 +410,7 @@ interface WebhookEventDataMap {
391
410
  'social.high_five_sent': SocialHighFiveSentPayload;
392
411
  'social.one_up_sent': SocialOneUpSentPayload;
393
412
  'survey.submitted': SurveySubmittedPayload;
413
+ 'team.preferences_updated': TeamPreferencesUpdatedPayload;
394
414
  'ticket.assigned': TicketAssignedPayload;
395
415
  'ticket.closed': TicketClosedPayload;
396
416
  'ticket.created': TicketCreatedPayload;
@@ -1,5 +1,15 @@
1
1
  /** Every webhook event type cStar can dispatch. */
2
- type WebhookEventType = 'article.created' | 'article.deleted' | 'article.published' | 'article.updated' | 'boss.damaged' | 'boss.defeated' | 'boss.spawned' | 'community_post.commented' | 'community_post.created' | 'community_post.deleted' | 'community_post.status_changed' | 'community_post.updated' | 'community_post.voted' | 'customer.created' | 'customer.deleted' | 'customer.updated' | 'customer_group.created' | 'customer_group.deleted' | 'customer_group.updated' | 'player.achievement_unlocked' | 'player.level_up' | 'player.quest_completed' | 'player.streak_milestone' | 'player.xp_gained' | 'social.high_five_sent' | 'social.one_up_sent' | 'survey.submitted' | 'ticket.assigned' | 'ticket.closed' | 'ticket.created' | 'ticket.deleted' | 'ticket.message_added' | 'ticket.updated';
2
+ type WebhookEventType = 'agent.preferences_updated' | 'article.created' | 'article.deleted' | 'article.published' | 'article.updated' | 'boss.damaged' | 'boss.defeated' | 'boss.spawned' | 'community_post.commented' | 'community_post.created' | 'community_post.deleted' | 'community_post.status_changed' | 'community_post.updated' | 'community_post.voted' | 'customer.created' | 'customer.deleted' | 'customer.updated' | 'customer_group.created' | 'customer_group.deleted' | 'customer_group.updated' | 'player.achievement_unlocked' | 'player.level_up' | 'player.quest_completed' | 'player.streak_milestone' | 'player.xp_gained' | 'social.high_five_sent' | 'social.one_up_sent' | 'survey.submitted' | 'team.preferences_updated' | 'ticket.assigned' | 'ticket.closed' | 'ticket.created' | 'ticket.deleted' | 'ticket.message_added' | 'ticket.updated';
3
+ /** Payload for `agent.preferences_updated` events. */
4
+ interface AgentPreferencesUpdatedPayload {
5
+ team_id: string;
6
+ member_id: string;
7
+ agent_id: string;
8
+ changed: Array<string>;
9
+ preferences: {
10
+ boringMode: boolean;
11
+ };
12
+ }
3
13
  /** Payload for `article.created` events. */
4
14
  interface ArticleCreatedPayload {
5
15
  article: {
@@ -274,6 +284,14 @@ interface SurveySubmittedPayload {
274
284
  email: string;
275
285
  };
276
286
  }
287
+ /** Payload for `team.preferences_updated` events. */
288
+ interface TeamPreferencesUpdatedPayload {
289
+ team_id: string;
290
+ changed: Array<string>;
291
+ preferences: {
292
+ bossBattlesEnabled: boolean;
293
+ };
294
+ }
277
295
  /** Payload for `ticket.assigned` events. */
278
296
  interface TicketAssignedPayload {
279
297
  ticket: {
@@ -364,6 +382,7 @@ interface TicketUpdatedPayload {
364
382
  }
365
383
  /** Maps each event type to its payload interface — used internally for the discriminated union. */
366
384
  interface WebhookEventDataMap {
385
+ 'agent.preferences_updated': AgentPreferencesUpdatedPayload;
367
386
  'article.created': ArticleCreatedPayload;
368
387
  'article.deleted': ArticleDeletedPayload;
369
388
  'article.published': ArticlePublishedPayload;
@@ -391,6 +410,7 @@ interface WebhookEventDataMap {
391
410
  'social.high_five_sent': SocialHighFiveSentPayload;
392
411
  'social.one_up_sent': SocialOneUpSentPayload;
393
412
  'survey.submitted': SurveySubmittedPayload;
413
+ 'team.preferences_updated': TeamPreferencesUpdatedPayload;
394
414
  'ticket.assigned': TicketAssignedPayload;
395
415
  'ticket.closed': TicketClosedPayload;
396
416
  'ticket.created': TicketCreatedPayload;