@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.cjs +457 -3
- package/dist/index.d.cts +98 -2
- package/dist/index.d.ts +98 -2
- package/dist/index.js +454 -2
- package/dist/webhook/index.d.cts +21 -1
- package/dist/webhook/index.d.ts +21 -1
- package/dist/webhook/node.d.cts +21 -1
- package/dist/webhook/node.d.ts +21 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -582,7 +582,17 @@ declare class ArticlesResource extends BaseResource<Article, ArticleListParams,
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
/** Every webhook event type cStar can dispatch. */
|
|
585
|
-
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';
|
|
585
|
+
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';
|
|
586
|
+
/** Payload for `agent.preferences_updated` events. */
|
|
587
|
+
interface AgentPreferencesUpdatedPayload {
|
|
588
|
+
team_id: string;
|
|
589
|
+
member_id: string;
|
|
590
|
+
agent_id: string;
|
|
591
|
+
changed: Array<string>;
|
|
592
|
+
preferences: {
|
|
593
|
+
boringMode: boolean;
|
|
594
|
+
};
|
|
595
|
+
}
|
|
586
596
|
/** Payload for `article.created` events. */
|
|
587
597
|
interface ArticleCreatedPayload {
|
|
588
598
|
article: {
|
|
@@ -857,6 +867,14 @@ interface SurveySubmittedPayload {
|
|
|
857
867
|
email: string;
|
|
858
868
|
};
|
|
859
869
|
}
|
|
870
|
+
/** Payload for `team.preferences_updated` events. */
|
|
871
|
+
interface TeamPreferencesUpdatedPayload {
|
|
872
|
+
team_id: string;
|
|
873
|
+
changed: Array<string>;
|
|
874
|
+
preferences: {
|
|
875
|
+
bossBattlesEnabled: boolean;
|
|
876
|
+
};
|
|
877
|
+
}
|
|
860
878
|
/** Payload for `ticket.assigned` events. */
|
|
861
879
|
interface TicketAssignedPayload {
|
|
862
880
|
ticket: {
|
|
@@ -947,6 +965,7 @@ interface TicketUpdatedPayload {
|
|
|
947
965
|
}
|
|
948
966
|
/** Maps each event type to its payload interface — used internally for the discriminated union. */
|
|
949
967
|
interface WebhookEventDataMap {
|
|
968
|
+
'agent.preferences_updated': AgentPreferencesUpdatedPayload;
|
|
950
969
|
'article.created': ArticleCreatedPayload;
|
|
951
970
|
'article.deleted': ArticleDeletedPayload;
|
|
952
971
|
'article.published': ArticlePublishedPayload;
|
|
@@ -974,6 +993,7 @@ interface WebhookEventDataMap {
|
|
|
974
993
|
'social.high_five_sent': SocialHighFiveSentPayload;
|
|
975
994
|
'social.one_up_sent': SocialOneUpSentPayload;
|
|
976
995
|
'survey.submitted': SurveySubmittedPayload;
|
|
996
|
+
'team.preferences_updated': TeamPreferencesUpdatedPayload;
|
|
977
997
|
'ticket.assigned': TicketAssignedPayload;
|
|
978
998
|
'ticket.closed': TicketClosedPayload;
|
|
979
999
|
'ticket.created': TicketCreatedPayload;
|
|
@@ -994,6 +1014,20 @@ interface WebhookEvent<T extends WebhookEventType = WebhookEventType> {
|
|
|
994
1014
|
/** Event-specific payload. */
|
|
995
1015
|
data: WebhookEventDataMap[T];
|
|
996
1016
|
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Stable representative payloads for each event type. Useful for testing
|
|
1019
|
+
* your endpoint against realistic shapes without having to trigger a real
|
|
1020
|
+
* event. Mirrors the dashboard's event catalog.
|
|
1021
|
+
*/
|
|
1022
|
+
declare const WEBHOOK_EVENT_SAMPLES: {
|
|
1023
|
+
[K in WebhookEventType]: WebhookEventDataMap[K];
|
|
1024
|
+
};
|
|
1025
|
+
/** Static metadata about every event — labels, descriptions, categories. */
|
|
1026
|
+
declare const WEBHOOK_EVENT_CATALOG: Record<WebhookEventType, {
|
|
1027
|
+
label: string;
|
|
1028
|
+
description: string;
|
|
1029
|
+
category: string;
|
|
1030
|
+
}>;
|
|
997
1031
|
|
|
998
1032
|
type WebhookEventData<T extends WebhookEventType> = WebhookEventDataMap[T];
|
|
999
1033
|
|
|
@@ -1516,6 +1550,40 @@ interface InviteCreateParams {
|
|
|
1516
1550
|
role?: string;
|
|
1517
1551
|
}
|
|
1518
1552
|
|
|
1553
|
+
/**
|
|
1554
|
+
* Team and member preferences — UX toggles exposed via the bearer-token API.
|
|
1555
|
+
*
|
|
1556
|
+
* Backed by:
|
|
1557
|
+
* - `/api/v1/teams/{teamId}/preferences` (TeamPreferences)
|
|
1558
|
+
* - `/api/v1/teams/{teamId}/members/{memberId}/preferences` (MemberPreferences)
|
|
1559
|
+
*
|
|
1560
|
+
* Kept narrow on purpose: only the toggles a headless dashboard needs to
|
|
1561
|
+
* flip from a server. Add new fields here when the matching column lands
|
|
1562
|
+
* on the handler's ALLOWED map.
|
|
1563
|
+
*/
|
|
1564
|
+
/** Team-wide UX preferences. */
|
|
1565
|
+
interface TeamPreferences {
|
|
1566
|
+
/** When false, hides the team boss feature for every agent. */
|
|
1567
|
+
bossBattlesEnabled: boolean | null;
|
|
1568
|
+
}
|
|
1569
|
+
/** Patch shape for team preferences. */
|
|
1570
|
+
interface TeamPreferencesUpdateParams {
|
|
1571
|
+
bossBattlesEnabled?: boolean;
|
|
1572
|
+
}
|
|
1573
|
+
/** Per-agent UX preferences. */
|
|
1574
|
+
interface MemberPreferences {
|
|
1575
|
+
/**
|
|
1576
|
+
* When true, hides every gamification element for this agent. XP keeps
|
|
1577
|
+
* accumulating in the background — flipping back to false restores the
|
|
1578
|
+
* full game UI without losing progress.
|
|
1579
|
+
*/
|
|
1580
|
+
boringMode: boolean | null;
|
|
1581
|
+
}
|
|
1582
|
+
/** Patch shape for member preferences. */
|
|
1583
|
+
interface MemberPreferencesUpdateParams {
|
|
1584
|
+
boringMode?: boolean;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1519
1587
|
/** Manage team invites as a sub-resource. */
|
|
1520
1588
|
declare class InvitesResource {
|
|
1521
1589
|
private readonly client;
|
|
@@ -1527,11 +1595,22 @@ declare class InvitesResource {
|
|
|
1527
1595
|
/** Revoke a pending invite. */
|
|
1528
1596
|
del(inviteId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1529
1597
|
}
|
|
1598
|
+
/** Manage per-agent UX preferences as a sub-resource of members. */
|
|
1599
|
+
declare class MemberPreferencesResource {
|
|
1600
|
+
private readonly client;
|
|
1601
|
+
constructor(client: HttpClient);
|
|
1602
|
+
/** Get an agent's UX preferences (boring mode, etc.). */
|
|
1603
|
+
get(memberId: string): Promise<ApiResponse<MemberPreferences>>;
|
|
1604
|
+
/** Update an agent's UX preferences. Only provided fields are written. */
|
|
1605
|
+
update(memberId: string, params: MemberPreferencesUpdateParams): Promise<ApiResponse<MemberPreferences>>;
|
|
1606
|
+
}
|
|
1530
1607
|
/** Manage team members. */
|
|
1531
1608
|
declare class MembersResource {
|
|
1532
1609
|
private readonly client;
|
|
1533
1610
|
/** Sub-resource for team invites. */
|
|
1534
1611
|
readonly invites: InvitesResource;
|
|
1612
|
+
/** Sub-resource for per-agent UX preferences. */
|
|
1613
|
+
readonly preferences: MemberPreferencesResource;
|
|
1535
1614
|
constructor(client: HttpClient);
|
|
1536
1615
|
/** List all team members. */
|
|
1537
1616
|
list(params?: MemberListParams): Promise<ListResponse<Member>>;
|
|
@@ -2996,6 +3075,21 @@ declare class BillingResource {
|
|
|
2996
3075
|
portal(params?: BillingPortalParams): Promise<ApiResponse<BillingPortal>>;
|
|
2997
3076
|
}
|
|
2998
3077
|
|
|
3078
|
+
/**
|
|
3079
|
+
* Team-wide preferences. Wraps `/api/v1/teams/{teamId}/preferences`.
|
|
3080
|
+
*
|
|
3081
|
+
* Currently exposes the team-level boss-battles toggle. Read requires
|
|
3082
|
+
* `manage_settings`; write requires the same plus a secret key.
|
|
3083
|
+
*/
|
|
3084
|
+
declare class PreferencesResource {
|
|
3085
|
+
private readonly client;
|
|
3086
|
+
constructor(client: HttpClient);
|
|
3087
|
+
/** Get team preferences. */
|
|
3088
|
+
get(): Promise<ApiResponse<TeamPreferences>>;
|
|
3089
|
+
/** Update team preferences. Only provided fields are written. */
|
|
3090
|
+
update(params: TeamPreferencesUpdateParams): Promise<ApiResponse<TeamPreferences>>;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
2999
3093
|
interface QueueItem {
|
|
3000
3094
|
/** Unique queue item ID. */
|
|
3001
3095
|
id: string;
|
|
@@ -3476,6 +3570,8 @@ declare class CStarClient {
|
|
|
3476
3570
|
readonly members: MembersResource;
|
|
3477
3571
|
/** Manage team settings, statuses, quick replies, business hours, and widget. */
|
|
3478
3572
|
readonly settings: SettingsResource;
|
|
3573
|
+
/** Team-wide UX preferences (boss-battles toggle, etc.). */
|
|
3574
|
+
readonly preferences: PreferencesResource;
|
|
3479
3575
|
/** Manage notifications. */
|
|
3480
3576
|
readonly notifications: NotificationsResource;
|
|
3481
3577
|
/** Manage @mentions. */
|
|
@@ -3565,4 +3661,4 @@ declare class CStarClient {
|
|
|
3565
3661
|
get lastMeta(): LastMeta;
|
|
3566
3662
|
}
|
|
3567
3663
|
|
|
3568
|
-
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiErrorBody, 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, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarConflictError, CStarError, CStarFeatureDisabledError, CStarNotFoundError, CStarPermissionError, CStarRateLimitError, CStarRealtime, CStarServerError, CStarValidationError, 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, ErrorType, 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 WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetSettings, type WidgetSettingsUpdateParams };
|
|
3664
|
+
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiErrorBody, 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, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarConflictError, CStarError, CStarFeatureDisabledError, CStarNotFoundError, CStarPermissionError, CStarRateLimitError, CStarRealtime, CStarServerError, CStarValidationError, 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, ErrorType, 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, WEBHOOK_EVENT_CATALOG, WEBHOOK_EVENT_SAMPLES, type Webhook, type WebhookCreateParams, type WebhookEvent, type WebhookEventData, type 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.d.ts
CHANGED
|
@@ -582,7 +582,17 @@ declare class ArticlesResource extends BaseResource<Article, ArticleListParams,
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
/** Every webhook event type cStar can dispatch. */
|
|
585
|
-
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';
|
|
585
|
+
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';
|
|
586
|
+
/** Payload for `agent.preferences_updated` events. */
|
|
587
|
+
interface AgentPreferencesUpdatedPayload {
|
|
588
|
+
team_id: string;
|
|
589
|
+
member_id: string;
|
|
590
|
+
agent_id: string;
|
|
591
|
+
changed: Array<string>;
|
|
592
|
+
preferences: {
|
|
593
|
+
boringMode: boolean;
|
|
594
|
+
};
|
|
595
|
+
}
|
|
586
596
|
/** Payload for `article.created` events. */
|
|
587
597
|
interface ArticleCreatedPayload {
|
|
588
598
|
article: {
|
|
@@ -857,6 +867,14 @@ interface SurveySubmittedPayload {
|
|
|
857
867
|
email: string;
|
|
858
868
|
};
|
|
859
869
|
}
|
|
870
|
+
/** Payload for `team.preferences_updated` events. */
|
|
871
|
+
interface TeamPreferencesUpdatedPayload {
|
|
872
|
+
team_id: string;
|
|
873
|
+
changed: Array<string>;
|
|
874
|
+
preferences: {
|
|
875
|
+
bossBattlesEnabled: boolean;
|
|
876
|
+
};
|
|
877
|
+
}
|
|
860
878
|
/** Payload for `ticket.assigned` events. */
|
|
861
879
|
interface TicketAssignedPayload {
|
|
862
880
|
ticket: {
|
|
@@ -947,6 +965,7 @@ interface TicketUpdatedPayload {
|
|
|
947
965
|
}
|
|
948
966
|
/** Maps each event type to its payload interface — used internally for the discriminated union. */
|
|
949
967
|
interface WebhookEventDataMap {
|
|
968
|
+
'agent.preferences_updated': AgentPreferencesUpdatedPayload;
|
|
950
969
|
'article.created': ArticleCreatedPayload;
|
|
951
970
|
'article.deleted': ArticleDeletedPayload;
|
|
952
971
|
'article.published': ArticlePublishedPayload;
|
|
@@ -974,6 +993,7 @@ interface WebhookEventDataMap {
|
|
|
974
993
|
'social.high_five_sent': SocialHighFiveSentPayload;
|
|
975
994
|
'social.one_up_sent': SocialOneUpSentPayload;
|
|
976
995
|
'survey.submitted': SurveySubmittedPayload;
|
|
996
|
+
'team.preferences_updated': TeamPreferencesUpdatedPayload;
|
|
977
997
|
'ticket.assigned': TicketAssignedPayload;
|
|
978
998
|
'ticket.closed': TicketClosedPayload;
|
|
979
999
|
'ticket.created': TicketCreatedPayload;
|
|
@@ -994,6 +1014,20 @@ interface WebhookEvent<T extends WebhookEventType = WebhookEventType> {
|
|
|
994
1014
|
/** Event-specific payload. */
|
|
995
1015
|
data: WebhookEventDataMap[T];
|
|
996
1016
|
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Stable representative payloads for each event type. Useful for testing
|
|
1019
|
+
* your endpoint against realistic shapes without having to trigger a real
|
|
1020
|
+
* event. Mirrors the dashboard's event catalog.
|
|
1021
|
+
*/
|
|
1022
|
+
declare const WEBHOOK_EVENT_SAMPLES: {
|
|
1023
|
+
[K in WebhookEventType]: WebhookEventDataMap[K];
|
|
1024
|
+
};
|
|
1025
|
+
/** Static metadata about every event — labels, descriptions, categories. */
|
|
1026
|
+
declare const WEBHOOK_EVENT_CATALOG: Record<WebhookEventType, {
|
|
1027
|
+
label: string;
|
|
1028
|
+
description: string;
|
|
1029
|
+
category: string;
|
|
1030
|
+
}>;
|
|
997
1031
|
|
|
998
1032
|
type WebhookEventData<T extends WebhookEventType> = WebhookEventDataMap[T];
|
|
999
1033
|
|
|
@@ -1516,6 +1550,40 @@ interface InviteCreateParams {
|
|
|
1516
1550
|
role?: string;
|
|
1517
1551
|
}
|
|
1518
1552
|
|
|
1553
|
+
/**
|
|
1554
|
+
* Team and member preferences — UX toggles exposed via the bearer-token API.
|
|
1555
|
+
*
|
|
1556
|
+
* Backed by:
|
|
1557
|
+
* - `/api/v1/teams/{teamId}/preferences` (TeamPreferences)
|
|
1558
|
+
* - `/api/v1/teams/{teamId}/members/{memberId}/preferences` (MemberPreferences)
|
|
1559
|
+
*
|
|
1560
|
+
* Kept narrow on purpose: only the toggles a headless dashboard needs to
|
|
1561
|
+
* flip from a server. Add new fields here when the matching column lands
|
|
1562
|
+
* on the handler's ALLOWED map.
|
|
1563
|
+
*/
|
|
1564
|
+
/** Team-wide UX preferences. */
|
|
1565
|
+
interface TeamPreferences {
|
|
1566
|
+
/** When false, hides the team boss feature for every agent. */
|
|
1567
|
+
bossBattlesEnabled: boolean | null;
|
|
1568
|
+
}
|
|
1569
|
+
/** Patch shape for team preferences. */
|
|
1570
|
+
interface TeamPreferencesUpdateParams {
|
|
1571
|
+
bossBattlesEnabled?: boolean;
|
|
1572
|
+
}
|
|
1573
|
+
/** Per-agent UX preferences. */
|
|
1574
|
+
interface MemberPreferences {
|
|
1575
|
+
/**
|
|
1576
|
+
* When true, hides every gamification element for this agent. XP keeps
|
|
1577
|
+
* accumulating in the background — flipping back to false restores the
|
|
1578
|
+
* full game UI without losing progress.
|
|
1579
|
+
*/
|
|
1580
|
+
boringMode: boolean | null;
|
|
1581
|
+
}
|
|
1582
|
+
/** Patch shape for member preferences. */
|
|
1583
|
+
interface MemberPreferencesUpdateParams {
|
|
1584
|
+
boringMode?: boolean;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1519
1587
|
/** Manage team invites as a sub-resource. */
|
|
1520
1588
|
declare class InvitesResource {
|
|
1521
1589
|
private readonly client;
|
|
@@ -1527,11 +1595,22 @@ declare class InvitesResource {
|
|
|
1527
1595
|
/** Revoke a pending invite. */
|
|
1528
1596
|
del(inviteId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1529
1597
|
}
|
|
1598
|
+
/** Manage per-agent UX preferences as a sub-resource of members. */
|
|
1599
|
+
declare class MemberPreferencesResource {
|
|
1600
|
+
private readonly client;
|
|
1601
|
+
constructor(client: HttpClient);
|
|
1602
|
+
/** Get an agent's UX preferences (boring mode, etc.). */
|
|
1603
|
+
get(memberId: string): Promise<ApiResponse<MemberPreferences>>;
|
|
1604
|
+
/** Update an agent's UX preferences. Only provided fields are written. */
|
|
1605
|
+
update(memberId: string, params: MemberPreferencesUpdateParams): Promise<ApiResponse<MemberPreferences>>;
|
|
1606
|
+
}
|
|
1530
1607
|
/** Manage team members. */
|
|
1531
1608
|
declare class MembersResource {
|
|
1532
1609
|
private readonly client;
|
|
1533
1610
|
/** Sub-resource for team invites. */
|
|
1534
1611
|
readonly invites: InvitesResource;
|
|
1612
|
+
/** Sub-resource for per-agent UX preferences. */
|
|
1613
|
+
readonly preferences: MemberPreferencesResource;
|
|
1535
1614
|
constructor(client: HttpClient);
|
|
1536
1615
|
/** List all team members. */
|
|
1537
1616
|
list(params?: MemberListParams): Promise<ListResponse<Member>>;
|
|
@@ -2996,6 +3075,21 @@ declare class BillingResource {
|
|
|
2996
3075
|
portal(params?: BillingPortalParams): Promise<ApiResponse<BillingPortal>>;
|
|
2997
3076
|
}
|
|
2998
3077
|
|
|
3078
|
+
/**
|
|
3079
|
+
* Team-wide preferences. Wraps `/api/v1/teams/{teamId}/preferences`.
|
|
3080
|
+
*
|
|
3081
|
+
* Currently exposes the team-level boss-battles toggle. Read requires
|
|
3082
|
+
* `manage_settings`; write requires the same plus a secret key.
|
|
3083
|
+
*/
|
|
3084
|
+
declare class PreferencesResource {
|
|
3085
|
+
private readonly client;
|
|
3086
|
+
constructor(client: HttpClient);
|
|
3087
|
+
/** Get team preferences. */
|
|
3088
|
+
get(): Promise<ApiResponse<TeamPreferences>>;
|
|
3089
|
+
/** Update team preferences. Only provided fields are written. */
|
|
3090
|
+
update(params: TeamPreferencesUpdateParams): Promise<ApiResponse<TeamPreferences>>;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
2999
3093
|
interface QueueItem {
|
|
3000
3094
|
/** Unique queue item ID. */
|
|
3001
3095
|
id: string;
|
|
@@ -3476,6 +3570,8 @@ declare class CStarClient {
|
|
|
3476
3570
|
readonly members: MembersResource;
|
|
3477
3571
|
/** Manage team settings, statuses, quick replies, business hours, and widget. */
|
|
3478
3572
|
readonly settings: SettingsResource;
|
|
3573
|
+
/** Team-wide UX preferences (boss-battles toggle, etc.). */
|
|
3574
|
+
readonly preferences: PreferencesResource;
|
|
3479
3575
|
/** Manage notifications. */
|
|
3480
3576
|
readonly notifications: NotificationsResource;
|
|
3481
3577
|
/** Manage @mentions. */
|
|
@@ -3565,4 +3661,4 @@ declare class CStarClient {
|
|
|
3565
3661
|
get lastMeta(): LastMeta;
|
|
3566
3662
|
}
|
|
3567
3663
|
|
|
3568
|
-
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiErrorBody, 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, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarConflictError, CStarError, CStarFeatureDisabledError, CStarNotFoundError, CStarPermissionError, CStarRateLimitError, CStarRealtime, CStarServerError, CStarValidationError, 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, ErrorType, 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 WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetSettings, type WidgetSettingsUpdateParams };
|
|
3664
|
+
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiErrorBody, 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, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarConflictError, CStarError, CStarFeatureDisabledError, CStarNotFoundError, CStarPermissionError, CStarRateLimitError, CStarRealtime, CStarServerError, CStarValidationError, 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, ErrorType, 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, WEBHOOK_EVENT_CATALOG, WEBHOOK_EVENT_SAMPLES, type Webhook, type WebhookCreateParams, type WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetSettings, type WidgetSettingsUpdateParams };
|