@cstar.help/js 0.16.1 → 0.17.2
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/README.md +100 -60
- package/dist/auth/index.d.cts +3 -398
- package/dist/auth/index.d.ts +3 -398
- package/dist/chat/index.cjs +427 -101
- package/dist/chat/index.d.cts +44 -92
- package/dist/chat/index.d.ts +44 -92
- package/dist/chat/index.js +427 -101
- package/dist/community/index.d.cts +4 -586
- package/dist/community/index.d.ts +4 -586
- package/dist/errors-b5A4wfAg.d.cts +398 -0
- package/dist/errors-b5A4wfAg.d.ts +398 -0
- package/dist/index.cjs +42 -23
- package/dist/index.d.cts +24 -802
- package/dist/index.d.ts +24 -802
- package/dist/index.js +42 -23
- package/dist/library/index.d.cts +3 -398
- package/dist/library/index.d.ts +3 -398
- package/dist/quickhelp/index.d.cts +3 -398
- package/dist/quickhelp/index.d.ts +3 -398
- package/dist/types-DF7GprCV.d.cts +190 -0
- package/dist/types-DF7GprCV.d.ts +190 -0
- package/dist/webhook/index.d.cts +2 -434
- package/dist/webhook/index.d.ts +2 -434
- package/dist/webhook/node.d.cts +4 -450
- package/dist/webhook/node.d.ts +4 -450
- package/dist/webhookEvents-1N2i2GcQ.d.cts +449 -0
- package/dist/webhookEvents-1N2i2GcQ.d.ts +449 -0
- package/package.json +4 -4
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/** Attachment metadata for community posts and comments (images only, max 5MB each). */
|
|
2
|
+
interface CommunityAttachment {
|
|
3
|
+
filename: string;
|
|
4
|
+
content_type: string;
|
|
5
|
+
size_bytes: number;
|
|
6
|
+
storage_path: string;
|
|
7
|
+
}
|
|
8
|
+
/** Configuration for the CommunityClient. */
|
|
9
|
+
interface CommunityConfig {
|
|
10
|
+
/** Team slug (e.g., 'acme'). Identifies the community to query. */
|
|
11
|
+
teamSlug: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional publishable key (`pk_test_*` or `pk_live_*`). When provided,
|
|
14
|
+
* the client switches data scope to match the key's mode (test vs live).
|
|
15
|
+
* Without a key, defaults to live — backwards-compatible with existing
|
|
16
|
+
* widget integrations. See `LibraryConfig.publishableKey` for the full
|
|
17
|
+
* test/live story.
|
|
18
|
+
*/
|
|
19
|
+
publishableKey?: string;
|
|
20
|
+
/** Override the base URL (defaults to https://www.cstar.help). */
|
|
21
|
+
baseUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Parameters for creating a post as an identified customer. */
|
|
24
|
+
interface CommunityCreatePostParams {
|
|
25
|
+
/** Post title. */
|
|
26
|
+
title: string;
|
|
27
|
+
/** Post body/content (optional). */
|
|
28
|
+
body?: string;
|
|
29
|
+
/** Topic UUID to post in. */
|
|
30
|
+
topicId: string;
|
|
31
|
+
/** Custom field values keyed by field definition ID. */
|
|
32
|
+
customFields?: Record<string, string>;
|
|
33
|
+
/** Image attachments (max 10, images only, 5MB each). */
|
|
34
|
+
attachments?: CommunityAttachment[];
|
|
35
|
+
}
|
|
36
|
+
/** Parameters for updating a post as the original author. */
|
|
37
|
+
interface CommunityUpdatePostParams {
|
|
38
|
+
/** Updated post title. */
|
|
39
|
+
title?: string;
|
|
40
|
+
/** Updated post body/content. */
|
|
41
|
+
body?: string;
|
|
42
|
+
/** Updated custom field values keyed by field definition ID. */
|
|
43
|
+
customFields?: Record<string, string>;
|
|
44
|
+
}
|
|
45
|
+
/** Parameters for updating a comment as the original author. */
|
|
46
|
+
interface CommunityUpdateCommentParams {
|
|
47
|
+
/** Updated comment body text. */
|
|
48
|
+
body: string;
|
|
49
|
+
}
|
|
50
|
+
/** Parameters for creating a comment as an identified customer. */
|
|
51
|
+
interface CommunityCreateCommentParams {
|
|
52
|
+
/** Comment body text. */
|
|
53
|
+
body: string;
|
|
54
|
+
/** Parent comment ID for replies (optional, 1-level nesting). */
|
|
55
|
+
parentCommentId?: string | null;
|
|
56
|
+
/** Image attachments (max 5, images only, 5MB each). */
|
|
57
|
+
attachments?: CommunityAttachment[];
|
|
58
|
+
}
|
|
59
|
+
/** Response from creating a post. */
|
|
60
|
+
interface CommunityCreatedPost {
|
|
61
|
+
id: string;
|
|
62
|
+
title: string;
|
|
63
|
+
slug: string;
|
|
64
|
+
body: string;
|
|
65
|
+
status: string;
|
|
66
|
+
visibility: string;
|
|
67
|
+
voteCount: number;
|
|
68
|
+
commentCount: number;
|
|
69
|
+
customFields: Record<string, string>;
|
|
70
|
+
topicName: string;
|
|
71
|
+
topicSlug: string;
|
|
72
|
+
authorName: string;
|
|
73
|
+
authorAvatar: string;
|
|
74
|
+
isTeamMember: boolean;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
}
|
|
77
|
+
/** Response from creating a comment. */
|
|
78
|
+
interface CommunityCreatedComment {
|
|
79
|
+
id: string;
|
|
80
|
+
body: string;
|
|
81
|
+
isOfficial: boolean;
|
|
82
|
+
voteScore: number;
|
|
83
|
+
parentCommentId: string | null;
|
|
84
|
+
authorName: string;
|
|
85
|
+
authorAvatar: string;
|
|
86
|
+
isTeamMember: boolean;
|
|
87
|
+
createdAt: string;
|
|
88
|
+
}
|
|
89
|
+
/** Response from toggling a vote. */
|
|
90
|
+
interface CommunityVoteResult {
|
|
91
|
+
voted: boolean;
|
|
92
|
+
voteCount: number;
|
|
93
|
+
}
|
|
94
|
+
/** Response from toggling a follow. */
|
|
95
|
+
interface CommunityFollowResult {
|
|
96
|
+
following: boolean;
|
|
97
|
+
}
|
|
98
|
+
/** Resolved custom field definition for a topic. */
|
|
99
|
+
interface TopicCustomField {
|
|
100
|
+
id: string;
|
|
101
|
+
label: string;
|
|
102
|
+
type: 'text' | 'number' | 'date' | 'select' | 'checkbox' | 'url';
|
|
103
|
+
required: boolean;
|
|
104
|
+
options?: Array<{
|
|
105
|
+
value: string;
|
|
106
|
+
label: string;
|
|
107
|
+
}>;
|
|
108
|
+
defaultValue?: string;
|
|
109
|
+
}
|
|
110
|
+
/** A discussion topic/category in the community. */
|
|
111
|
+
interface CommunityTopic {
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
slug: string;
|
|
115
|
+
description: string | null;
|
|
116
|
+
icon: string;
|
|
117
|
+
visibility: 'public' | 'members_only';
|
|
118
|
+
sort_order: number;
|
|
119
|
+
postCount: number;
|
|
120
|
+
customFields: TopicCustomField[];
|
|
121
|
+
}
|
|
122
|
+
/** A public community post. */
|
|
123
|
+
interface CommunityPost {
|
|
124
|
+
id: string;
|
|
125
|
+
title: string;
|
|
126
|
+
slug: string;
|
|
127
|
+
body: string;
|
|
128
|
+
status: 'open' | 'answered' | 'officially_answered' | 'planned' | 'not_planned' | 'completed' | 'under_review';
|
|
129
|
+
visibility: 'public' | 'members_only';
|
|
130
|
+
voteCount: number;
|
|
131
|
+
commentCount: number;
|
|
132
|
+
isPinned: boolean;
|
|
133
|
+
isFeatured: boolean;
|
|
134
|
+
isLocked: boolean;
|
|
135
|
+
commentsEnabled: boolean;
|
|
136
|
+
customFields: Record<string, string>;
|
|
137
|
+
topicName: string;
|
|
138
|
+
topicSlug: string;
|
|
139
|
+
authorName: string;
|
|
140
|
+
authorAvatar: string;
|
|
141
|
+
authorBio: string;
|
|
142
|
+
authorPostCount: number;
|
|
143
|
+
authorCommentCount: number;
|
|
144
|
+
attachments: CommunityAttachment[];
|
|
145
|
+
isTeamMember: boolean;
|
|
146
|
+
lastActivityAt: string;
|
|
147
|
+
createdAt: string;
|
|
148
|
+
}
|
|
149
|
+
/** A comment on a community post. */
|
|
150
|
+
interface CommunityComment {
|
|
151
|
+
id: string;
|
|
152
|
+
body: string;
|
|
153
|
+
isOfficial: boolean;
|
|
154
|
+
voteScore: number;
|
|
155
|
+
parentCommentId: string | null;
|
|
156
|
+
attachments: CommunityAttachment[];
|
|
157
|
+
authorName: string;
|
|
158
|
+
authorAvatar: string;
|
|
159
|
+
authorBio: string;
|
|
160
|
+
authorPostCount: number;
|
|
161
|
+
authorCommentCount: number;
|
|
162
|
+
isTeamMember: boolean;
|
|
163
|
+
createdAt: string;
|
|
164
|
+
}
|
|
165
|
+
/** Parameters for listing posts. */
|
|
166
|
+
interface CommunityPostListParams {
|
|
167
|
+
/** Filter by topic slug. */
|
|
168
|
+
topicSlug?: string;
|
|
169
|
+
/** Filter by status. */
|
|
170
|
+
status?: string;
|
|
171
|
+
/** Sort order (default: 'recent'). */
|
|
172
|
+
sort?: 'recent' | 'votes' | 'comments';
|
|
173
|
+
/** Max results per page. */
|
|
174
|
+
limit?: number;
|
|
175
|
+
/** Pagination offset. */
|
|
176
|
+
offset?: number;
|
|
177
|
+
}
|
|
178
|
+
/** Search results. */
|
|
179
|
+
interface CommunitySearchResult {
|
|
180
|
+
data: CommunityPost[];
|
|
181
|
+
count: number;
|
|
182
|
+
query: string;
|
|
183
|
+
}
|
|
184
|
+
/** A single post with its comments. */
|
|
185
|
+
interface CommunityPostDetail {
|
|
186
|
+
post: CommunityPost;
|
|
187
|
+
comments: CommunityComment[];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type { CommunityCreatePostParams as C, CommunityCreatedPost as a, CommunityUpdatePostParams as b, CommunityUpdateCommentParams as c, CommunityCreatedComment as d, CommunityVoteResult as e, CommunityCreateCommentParams as f, CommunityFollowResult as g, CommunityConfig as h, CommunityTopic as i, CommunityPostListParams as j, CommunityPost as k, CommunityPostDetail as l, CommunitySearchResult as m, CommunityComment as n };
|
package/dist/webhook/index.d.cts
CHANGED
|
@@ -1,436 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
13
|
-
/** Payload for `article.created` events. */
|
|
14
|
-
interface ArticleCreatedPayload {
|
|
15
|
-
article: {
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
slug: string;
|
|
19
|
-
is_public: boolean;
|
|
20
|
-
created_at: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/** Payload for `article.deleted` events. */
|
|
24
|
-
interface ArticleDeletedPayload {
|
|
25
|
-
id: string;
|
|
26
|
-
}
|
|
27
|
-
/** Payload for `article.published` events. */
|
|
28
|
-
interface ArticlePublishedPayload {
|
|
29
|
-
article: {
|
|
30
|
-
id: string;
|
|
31
|
-
title: string;
|
|
32
|
-
slug: string;
|
|
33
|
-
is_public: boolean;
|
|
34
|
-
published_at: string;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/** Payload for `article.updated` events. */
|
|
38
|
-
interface ArticleUpdatedPayload {
|
|
39
|
-
article: {
|
|
40
|
-
id: string;
|
|
41
|
-
title: string;
|
|
42
|
-
slug: string;
|
|
43
|
-
is_public: boolean;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/** Payload for `boss.damaged` events. */
|
|
47
|
-
interface BossDamagedPayload {
|
|
48
|
-
boss: {
|
|
49
|
-
id: string;
|
|
50
|
-
current_hp: number;
|
|
51
|
-
};
|
|
52
|
-
damage: number;
|
|
53
|
-
by: {
|
|
54
|
-
agent_id: string;
|
|
55
|
-
name: string;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/** Payload for `boss.defeated` events. */
|
|
59
|
-
interface BossDefeatedPayload {
|
|
60
|
-
boss: {
|
|
61
|
-
id: string;
|
|
62
|
-
name: string;
|
|
63
|
-
};
|
|
64
|
-
final_blow_by: {
|
|
65
|
-
agent_id: string;
|
|
66
|
-
name: string;
|
|
67
|
-
};
|
|
68
|
-
team_xp_awarded: number;
|
|
69
|
-
}
|
|
70
|
-
/** Payload for `boss.spawned` events. */
|
|
71
|
-
interface BossSpawnedPayload {
|
|
72
|
-
boss: {
|
|
73
|
-
id: string;
|
|
74
|
-
name: string;
|
|
75
|
-
level: number;
|
|
76
|
-
max_hp: number;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/** Payload for `community_post.commented` events. */
|
|
80
|
-
interface CommunityPostCommentedPayload {
|
|
81
|
-
comment: {
|
|
82
|
-
id: string;
|
|
83
|
-
post_id: string;
|
|
84
|
-
content: string;
|
|
85
|
-
author_id: string;
|
|
86
|
-
created_at: string;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
/** Payload for `community_post.created` events. */
|
|
90
|
-
interface CommunityPostCreatedPayload {
|
|
91
|
-
post: {
|
|
92
|
-
id: string;
|
|
93
|
-
prefixed_id: string;
|
|
94
|
-
title: string;
|
|
95
|
-
status: string;
|
|
96
|
-
visibility: string;
|
|
97
|
-
topic: string;
|
|
98
|
-
created_at: string;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/** Payload for `community_post.deleted` events. */
|
|
102
|
-
interface CommunityPostDeletedPayload {
|
|
103
|
-
post: {
|
|
104
|
-
id: string;
|
|
105
|
-
prefixed_id?: string;
|
|
106
|
-
title?: string;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
/** Payload for `community_post.status_changed` events. */
|
|
110
|
-
interface CommunityPostStatusChangedPayload {
|
|
111
|
-
post: {
|
|
112
|
-
id: string;
|
|
113
|
-
title: string;
|
|
114
|
-
status: string;
|
|
115
|
-
visibility: string;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/** Payload for `community_post.updated` events. */
|
|
119
|
-
interface CommunityPostUpdatedPayload {
|
|
120
|
-
post: {
|
|
121
|
-
id: string;
|
|
122
|
-
title: string;
|
|
123
|
-
status: string;
|
|
124
|
-
visibility: string;
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
/** Payload for `community_post.voted` events. */
|
|
128
|
-
interface CommunityPostVotedPayload {
|
|
129
|
-
post: {
|
|
130
|
-
id: string;
|
|
131
|
-
vote_count: number;
|
|
132
|
-
};
|
|
133
|
-
voter: {
|
|
134
|
-
id: string;
|
|
135
|
-
};
|
|
136
|
-
direction: string;
|
|
137
|
-
}
|
|
138
|
-
/** Payload for `customer.created` events. */
|
|
139
|
-
interface CustomerCreatedPayload {
|
|
140
|
-
customer: {
|
|
141
|
-
id: string;
|
|
142
|
-
name: string;
|
|
143
|
-
email: string;
|
|
144
|
-
status: string;
|
|
145
|
-
tags: Array<string>;
|
|
146
|
-
created_at: string;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
/** Payload for `customer.deleted` events. */
|
|
150
|
-
interface CustomerDeletedPayload {
|
|
151
|
-
id: string;
|
|
152
|
-
}
|
|
153
|
-
/** Payload for `customer.updated` events. */
|
|
154
|
-
interface CustomerUpdatedPayload {
|
|
155
|
-
customer: {
|
|
156
|
-
id: string;
|
|
157
|
-
name: string;
|
|
158
|
-
email: string;
|
|
159
|
-
status: string;
|
|
160
|
-
tags: Array<string>;
|
|
161
|
-
};
|
|
162
|
-
changes: {
|
|
163
|
-
tags: {
|
|
164
|
-
from: Array<string>;
|
|
165
|
-
to: Array<string>;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
/** Payload for `customer_group.created` events. */
|
|
170
|
-
interface CustomerGroupCreatedPayload {
|
|
171
|
-
group: {
|
|
172
|
-
id: string;
|
|
173
|
-
name: string;
|
|
174
|
-
color: string;
|
|
175
|
-
member_count: number;
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
/** Payload for `customer_group.deleted` events. */
|
|
179
|
-
interface CustomerGroupDeletedPayload {
|
|
180
|
-
customer_group: {
|
|
181
|
-
id: string;
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
/** Payload for `customer_group.updated` events. */
|
|
185
|
-
interface CustomerGroupUpdatedPayload {
|
|
186
|
-
group: {
|
|
187
|
-
id: string;
|
|
188
|
-
name: string;
|
|
189
|
-
color: string;
|
|
190
|
-
member_count: number;
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
/** Payload for `player.achievement_unlocked` events. */
|
|
194
|
-
interface PlayerAchievementUnlockedPayload {
|
|
195
|
-
player: {
|
|
196
|
-
agent_id: string;
|
|
197
|
-
name: string;
|
|
198
|
-
};
|
|
199
|
-
achievement: {
|
|
200
|
-
id: string;
|
|
201
|
-
name: string;
|
|
202
|
-
xp: number;
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
/** Payload for `player.level_up` events. */
|
|
206
|
-
interface PlayerLevelUpPayload {
|
|
207
|
-
player: {
|
|
208
|
-
agent_id: string;
|
|
209
|
-
name: string;
|
|
210
|
-
};
|
|
211
|
-
level: {
|
|
212
|
-
from: number;
|
|
213
|
-
to: number;
|
|
214
|
-
};
|
|
215
|
-
title_unlocked: string;
|
|
216
|
-
}
|
|
217
|
-
/** Payload for `player.quest_completed` events. */
|
|
218
|
-
interface PlayerQuestCompletedPayload {
|
|
219
|
-
player: {
|
|
220
|
-
agent_id: string;
|
|
221
|
-
name: string;
|
|
222
|
-
};
|
|
223
|
-
quest: {
|
|
224
|
-
id: string;
|
|
225
|
-
name: string;
|
|
226
|
-
xp: number;
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
/** Payload for `player.streak_milestone` events. */
|
|
230
|
-
interface PlayerStreakMilestonePayload {
|
|
231
|
-
player: {
|
|
232
|
-
agent_id: string;
|
|
233
|
-
name: string;
|
|
234
|
-
};
|
|
235
|
-
streak_days: number;
|
|
236
|
-
milestone: number;
|
|
237
|
-
}
|
|
238
|
-
/** Payload for `player.xp_gained` events. */
|
|
239
|
-
interface PlayerXpGainedPayload {
|
|
240
|
-
player: {
|
|
241
|
-
agent_id: string;
|
|
242
|
-
name: string;
|
|
243
|
-
};
|
|
244
|
-
amount: number;
|
|
245
|
-
reason: string;
|
|
246
|
-
ticket_id: string;
|
|
247
|
-
}
|
|
248
|
-
/** Payload for `social.high_five_sent` events. */
|
|
249
|
-
interface SocialHighFiveSentPayload {
|
|
250
|
-
from_team: {
|
|
251
|
-
id: string;
|
|
252
|
-
name: string;
|
|
253
|
-
};
|
|
254
|
-
to_team: {
|
|
255
|
-
id: string;
|
|
256
|
-
name: string;
|
|
257
|
-
};
|
|
258
|
-
message: string;
|
|
259
|
-
}
|
|
260
|
-
/** Payload for `social.one_up_sent` events. */
|
|
261
|
-
interface SocialOneUpSentPayload {
|
|
262
|
-
from: {
|
|
263
|
-
agent_id: string;
|
|
264
|
-
name: string;
|
|
265
|
-
};
|
|
266
|
-
to: {
|
|
267
|
-
agent_id: string;
|
|
268
|
-
name: string;
|
|
269
|
-
};
|
|
270
|
-
ticket_id: string;
|
|
271
|
-
message: string;
|
|
272
|
-
}
|
|
273
|
-
/** Payload for `survey.submitted` events. */
|
|
274
|
-
interface SurveySubmittedPayload {
|
|
275
|
-
survey: {
|
|
276
|
-
id: string;
|
|
277
|
-
ticket_id: string;
|
|
278
|
-
score: number;
|
|
279
|
-
comment: string;
|
|
280
|
-
submitted_at: string;
|
|
281
|
-
};
|
|
282
|
-
customer: {
|
|
283
|
-
id: string;
|
|
284
|
-
email: string;
|
|
285
|
-
};
|
|
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
|
-
}
|
|
295
|
-
/** Payload for `ticket.assigned` events. */
|
|
296
|
-
interface TicketAssignedPayload {
|
|
297
|
-
ticket: {
|
|
298
|
-
id: string;
|
|
299
|
-
prefixed_id: string;
|
|
300
|
-
};
|
|
301
|
-
assignee: {
|
|
302
|
-
id: string;
|
|
303
|
-
name: string;
|
|
304
|
-
email: string;
|
|
305
|
-
};
|
|
306
|
-
previous_assignee: null;
|
|
307
|
-
}
|
|
308
|
-
/** Payload for `ticket.closed` events. */
|
|
309
|
-
interface TicketClosedPayload {
|
|
310
|
-
ticket: {
|
|
311
|
-
id: string;
|
|
312
|
-
prefixed_id: string;
|
|
313
|
-
title: string;
|
|
314
|
-
status: string;
|
|
315
|
-
priority: string;
|
|
316
|
-
channel: string;
|
|
317
|
-
resolved_at: string;
|
|
318
|
-
};
|
|
319
|
-
changes?: Record<string, {
|
|
320
|
-
from: string;
|
|
321
|
-
to: string;
|
|
322
|
-
}>;
|
|
323
|
-
}
|
|
324
|
-
/** Payload for `ticket.created` events. */
|
|
325
|
-
interface TicketCreatedPayload {
|
|
326
|
-
ticket: {
|
|
327
|
-
id: string;
|
|
328
|
-
prefixed_id: string;
|
|
329
|
-
title: string;
|
|
330
|
-
status: string;
|
|
331
|
-
priority: string;
|
|
332
|
-
channel: string;
|
|
333
|
-
customer_id: string;
|
|
334
|
-
created_at: string;
|
|
335
|
-
};
|
|
336
|
-
customer: {
|
|
337
|
-
id: string;
|
|
338
|
-
name: string;
|
|
339
|
-
email: string;
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
/** Payload for `ticket.deleted` events. */
|
|
343
|
-
interface TicketDeletedPayload {
|
|
344
|
-
id: string;
|
|
345
|
-
}
|
|
346
|
-
/** Payload for `ticket.message_added` events. */
|
|
347
|
-
interface TicketMessageAddedPayload {
|
|
348
|
-
ticket: {
|
|
349
|
-
id: string;
|
|
350
|
-
dashboard_url: string | null;
|
|
351
|
-
};
|
|
352
|
-
message: {
|
|
353
|
-
id: string;
|
|
354
|
-
sender: string;
|
|
355
|
-
sender_name: string | null;
|
|
356
|
-
content: string;
|
|
357
|
-
created_at: string;
|
|
358
|
-
};
|
|
359
|
-
customer?: {
|
|
360
|
-
id: string;
|
|
361
|
-
name: string | null;
|
|
362
|
-
email: string | null;
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
/** Payload for `ticket.updated` events. */
|
|
366
|
-
interface TicketUpdatedPayload {
|
|
367
|
-
ticket: {
|
|
368
|
-
id: string;
|
|
369
|
-
prefixed_id: string;
|
|
370
|
-
title: string;
|
|
371
|
-
status: string;
|
|
372
|
-
priority: string;
|
|
373
|
-
channel: string;
|
|
374
|
-
};
|
|
375
|
-
changes?: Record<string, {
|
|
376
|
-
from: string;
|
|
377
|
-
to: string;
|
|
378
|
-
} | {
|
|
379
|
-
from: Array<string>;
|
|
380
|
-
to: Array<string>;
|
|
381
|
-
}>;
|
|
382
|
-
}
|
|
383
|
-
/** Maps each event type to its payload interface — used internally for the discriminated union. */
|
|
384
|
-
interface WebhookEventDataMap {
|
|
385
|
-
'agent.preferences_updated': AgentPreferencesUpdatedPayload;
|
|
386
|
-
'article.created': ArticleCreatedPayload;
|
|
387
|
-
'article.deleted': ArticleDeletedPayload;
|
|
388
|
-
'article.published': ArticlePublishedPayload;
|
|
389
|
-
'article.updated': ArticleUpdatedPayload;
|
|
390
|
-
'boss.damaged': BossDamagedPayload;
|
|
391
|
-
'boss.defeated': BossDefeatedPayload;
|
|
392
|
-
'boss.spawned': BossSpawnedPayload;
|
|
393
|
-
'community_post.commented': CommunityPostCommentedPayload;
|
|
394
|
-
'community_post.created': CommunityPostCreatedPayload;
|
|
395
|
-
'community_post.deleted': CommunityPostDeletedPayload;
|
|
396
|
-
'community_post.status_changed': CommunityPostStatusChangedPayload;
|
|
397
|
-
'community_post.updated': CommunityPostUpdatedPayload;
|
|
398
|
-
'community_post.voted': CommunityPostVotedPayload;
|
|
399
|
-
'customer.created': CustomerCreatedPayload;
|
|
400
|
-
'customer.deleted': CustomerDeletedPayload;
|
|
401
|
-
'customer.updated': CustomerUpdatedPayload;
|
|
402
|
-
'customer_group.created': CustomerGroupCreatedPayload;
|
|
403
|
-
'customer_group.deleted': CustomerGroupDeletedPayload;
|
|
404
|
-
'customer_group.updated': CustomerGroupUpdatedPayload;
|
|
405
|
-
'player.achievement_unlocked': PlayerAchievementUnlockedPayload;
|
|
406
|
-
'player.level_up': PlayerLevelUpPayload;
|
|
407
|
-
'player.quest_completed': PlayerQuestCompletedPayload;
|
|
408
|
-
'player.streak_milestone': PlayerStreakMilestonePayload;
|
|
409
|
-
'player.xp_gained': PlayerXpGainedPayload;
|
|
410
|
-
'social.high_five_sent': SocialHighFiveSentPayload;
|
|
411
|
-
'social.one_up_sent': SocialOneUpSentPayload;
|
|
412
|
-
'survey.submitted': SurveySubmittedPayload;
|
|
413
|
-
'team.preferences_updated': TeamPreferencesUpdatedPayload;
|
|
414
|
-
'ticket.assigned': TicketAssignedPayload;
|
|
415
|
-
'ticket.closed': TicketClosedPayload;
|
|
416
|
-
'ticket.created': TicketCreatedPayload;
|
|
417
|
-
'ticket.deleted': TicketDeletedPayload;
|
|
418
|
-
'ticket.message_added': TicketMessageAddedPayload;
|
|
419
|
-
'ticket.updated': TicketUpdatedPayload;
|
|
420
|
-
}
|
|
421
|
-
/** A webhook event delivered to your endpoint. */
|
|
422
|
-
interface WebhookEvent<T extends WebhookEventType = WebhookEventType> {
|
|
423
|
-
/** Unique event ID (idempotency key). */
|
|
424
|
-
id: string;
|
|
425
|
-
/** Event type. */
|
|
426
|
-
type: T;
|
|
427
|
-
/** When the event was created (ISO 8601). */
|
|
428
|
-
created_at: string;
|
|
429
|
-
/** Team that owns this event. */
|
|
430
|
-
team_id: string;
|
|
431
|
-
/** Event-specific payload. */
|
|
432
|
-
data: WebhookEventDataMap[T];
|
|
433
|
-
}
|
|
1
|
+
import { d as WebhookEvent } from '../webhookEvents-1N2i2GcQ.cjs';
|
|
434
2
|
|
|
435
3
|
/** Default replay window for Stripe-style signatures: 5 minutes (300s). */
|
|
436
4
|
declare const DEFAULT_TOLERANCE_SECONDS = 300;
|
|
@@ -481,4 +49,4 @@ declare function constructEventAsync(rawBody: string, signature: string, secret:
|
|
|
481
49
|
*/
|
|
482
50
|
declare function verifySignatureAsync(rawBody: string, signature: string, secret: string, options?: VerifyOptions): Promise<boolean>;
|
|
483
51
|
|
|
484
|
-
export { DEFAULT_TOLERANCE_SECONDS, type VerifyOptions,
|
|
52
|
+
export { DEFAULT_TOLERANCE_SECONDS, type VerifyOptions, WebhookEvent, WebhookSignatureVerificationError, constructEventAsync, signPayloadStripeAsync, verifySignatureAsync };
|