@cstar.help/js 0.12.1 → 0.14.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/auth/index.cjs +217 -3
- package/dist/auth/index.js +215 -3
- package/dist/chat/index.cjs +84 -29
- package/dist/chat/index.d.cts +72 -27
- package/dist/chat/index.d.ts +72 -27
- package/dist/chat/index.js +84 -29
- package/dist/community/index.cjs +233 -9
- package/dist/community/index.d.cts +11 -0
- package/dist/community/index.d.ts +11 -0
- package/dist/community/index.js +231 -9
- package/dist/index.cjs +309 -74
- package/dist/index.d.cts +3287 -0
- package/dist/index.d.ts +3287 -0
- package/dist/index.js +308 -74
- package/dist/library/index.cjs +254 -9
- package/dist/library/index.d.cts +26 -3
- package/dist/library/index.d.ts +26 -3
- package/dist/library/index.js +252 -9
- package/dist/quickhelp/index.cjs +220 -7
- package/dist/quickhelp/index.d.cts +37 -4
- package/dist/quickhelp/index.d.ts +37 -4
- package/dist/quickhelp/index.js +218 -7
- package/dist/webhook/index.cjs +0 -18
- package/dist/webhook/index.d.cts +440 -0
- package/dist/webhook/index.d.ts +440 -0
- package/dist/webhook/index.js +0 -23
- package/dist/webhook/node.cjs +57 -0
- package/dist/webhook/node.d.cts +440 -0
- package/dist/webhook/node.d.ts +440 -0
- package/dist/webhook/node.js +30 -0
- package/package.json +14 -2
|
@@ -0,0 +1,440 @@
|
|
|
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';
|
|
3
|
+
/** Payload for `article.created` events. */
|
|
4
|
+
interface ArticleCreatedPayload {
|
|
5
|
+
article: {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
is_public: boolean;
|
|
10
|
+
created_at: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Payload for `article.deleted` events. */
|
|
14
|
+
interface ArticleDeletedPayload {
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
/** Payload for `article.published` events. */
|
|
18
|
+
interface ArticlePublishedPayload {
|
|
19
|
+
article: {
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
is_public: boolean;
|
|
24
|
+
published_at: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Payload for `article.updated` events. */
|
|
28
|
+
interface ArticleUpdatedPayload {
|
|
29
|
+
article: {
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
32
|
+
slug: string;
|
|
33
|
+
is_public: boolean;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Payload for `boss.damaged` events. */
|
|
37
|
+
interface BossDamagedPayload {
|
|
38
|
+
boss: {
|
|
39
|
+
id: string;
|
|
40
|
+
current_hp: number;
|
|
41
|
+
};
|
|
42
|
+
damage: number;
|
|
43
|
+
by: {
|
|
44
|
+
agent_id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Payload for `boss.defeated` events. */
|
|
49
|
+
interface BossDefeatedPayload {
|
|
50
|
+
boss: {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
};
|
|
54
|
+
final_blow_by: {
|
|
55
|
+
agent_id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
};
|
|
58
|
+
team_xp_awarded: number;
|
|
59
|
+
}
|
|
60
|
+
/** Payload for `boss.spawned` events. */
|
|
61
|
+
interface BossSpawnedPayload {
|
|
62
|
+
boss: {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
level: number;
|
|
66
|
+
max_hp: number;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** Payload for `community_post.commented` events. */
|
|
70
|
+
interface CommunityPostCommentedPayload {
|
|
71
|
+
comment: {
|
|
72
|
+
id: string;
|
|
73
|
+
post_id: string;
|
|
74
|
+
content: string;
|
|
75
|
+
author_id: string;
|
|
76
|
+
created_at: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** Payload for `community_post.created` events. */
|
|
80
|
+
interface CommunityPostCreatedPayload {
|
|
81
|
+
post: {
|
|
82
|
+
id: string;
|
|
83
|
+
prefixed_id: string;
|
|
84
|
+
title: string;
|
|
85
|
+
status: string;
|
|
86
|
+
visibility: string;
|
|
87
|
+
topic: string;
|
|
88
|
+
created_at: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** Payload for `community_post.deleted` events. */
|
|
92
|
+
interface CommunityPostDeletedPayload {
|
|
93
|
+
post: {
|
|
94
|
+
id: string;
|
|
95
|
+
prefixed_id?: string;
|
|
96
|
+
title?: string;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** Payload for `community_post.status_changed` events. */
|
|
100
|
+
interface CommunityPostStatusChangedPayload {
|
|
101
|
+
post: {
|
|
102
|
+
id: string;
|
|
103
|
+
title: string;
|
|
104
|
+
status: string;
|
|
105
|
+
visibility: string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** Payload for `community_post.updated` events. */
|
|
109
|
+
interface CommunityPostUpdatedPayload {
|
|
110
|
+
post: {
|
|
111
|
+
id: string;
|
|
112
|
+
title: string;
|
|
113
|
+
status: string;
|
|
114
|
+
visibility: string;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/** Payload for `community_post.voted` events. */
|
|
118
|
+
interface CommunityPostVotedPayload {
|
|
119
|
+
post: {
|
|
120
|
+
id: string;
|
|
121
|
+
vote_count: number;
|
|
122
|
+
};
|
|
123
|
+
voter: {
|
|
124
|
+
id: string;
|
|
125
|
+
};
|
|
126
|
+
direction: string;
|
|
127
|
+
}
|
|
128
|
+
/** Payload for `customer.created` events. */
|
|
129
|
+
interface CustomerCreatedPayload {
|
|
130
|
+
customer: {
|
|
131
|
+
id: string;
|
|
132
|
+
name: string;
|
|
133
|
+
email: string;
|
|
134
|
+
status: string;
|
|
135
|
+
tags: Array<string>;
|
|
136
|
+
created_at: string;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** Payload for `customer.deleted` events. */
|
|
140
|
+
interface CustomerDeletedPayload {
|
|
141
|
+
id: string;
|
|
142
|
+
}
|
|
143
|
+
/** Payload for `customer.updated` events. */
|
|
144
|
+
interface CustomerUpdatedPayload {
|
|
145
|
+
customer: {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
email: string;
|
|
149
|
+
status: string;
|
|
150
|
+
tags: Array<string>;
|
|
151
|
+
};
|
|
152
|
+
changes: {
|
|
153
|
+
tags: {
|
|
154
|
+
from: Array<string>;
|
|
155
|
+
to: Array<string>;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/** Payload for `customer_group.created` events. */
|
|
160
|
+
interface CustomerGroupCreatedPayload {
|
|
161
|
+
group: {
|
|
162
|
+
id: string;
|
|
163
|
+
name: string;
|
|
164
|
+
color: string;
|
|
165
|
+
member_count: number;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/** Payload for `customer_group.deleted` events. */
|
|
169
|
+
interface CustomerGroupDeletedPayload {
|
|
170
|
+
customer_group: {
|
|
171
|
+
id: string;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/** Payload for `customer_group.updated` events. */
|
|
175
|
+
interface CustomerGroupUpdatedPayload {
|
|
176
|
+
group: {
|
|
177
|
+
id: string;
|
|
178
|
+
name: string;
|
|
179
|
+
color: string;
|
|
180
|
+
member_count: number;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/** Payload for `player.achievement_unlocked` events. */
|
|
184
|
+
interface PlayerAchievementUnlockedPayload {
|
|
185
|
+
player: {
|
|
186
|
+
agent_id: string;
|
|
187
|
+
name: string;
|
|
188
|
+
};
|
|
189
|
+
achievement: {
|
|
190
|
+
id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
xp: number;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/** Payload for `player.level_up` events. */
|
|
196
|
+
interface PlayerLevelUpPayload {
|
|
197
|
+
player: {
|
|
198
|
+
agent_id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
};
|
|
201
|
+
level: {
|
|
202
|
+
from: number;
|
|
203
|
+
to: number;
|
|
204
|
+
};
|
|
205
|
+
title_unlocked: string;
|
|
206
|
+
}
|
|
207
|
+
/** Payload for `player.quest_completed` events. */
|
|
208
|
+
interface PlayerQuestCompletedPayload {
|
|
209
|
+
player: {
|
|
210
|
+
agent_id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
};
|
|
213
|
+
quest: {
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
xp: number;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/** Payload for `player.streak_milestone` events. */
|
|
220
|
+
interface PlayerStreakMilestonePayload {
|
|
221
|
+
player: {
|
|
222
|
+
agent_id: string;
|
|
223
|
+
name: string;
|
|
224
|
+
};
|
|
225
|
+
streak_days: number;
|
|
226
|
+
milestone: number;
|
|
227
|
+
}
|
|
228
|
+
/** Payload for `player.xp_gained` events. */
|
|
229
|
+
interface PlayerXpGainedPayload {
|
|
230
|
+
player: {
|
|
231
|
+
agent_id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
};
|
|
234
|
+
amount: number;
|
|
235
|
+
reason: string;
|
|
236
|
+
ticket_id: string;
|
|
237
|
+
}
|
|
238
|
+
/** Payload for `social.high_five_sent` events. */
|
|
239
|
+
interface SocialHighFiveSentPayload {
|
|
240
|
+
from_team: {
|
|
241
|
+
id: string;
|
|
242
|
+
name: string;
|
|
243
|
+
};
|
|
244
|
+
to_team: {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
};
|
|
248
|
+
message: string;
|
|
249
|
+
}
|
|
250
|
+
/** Payload for `social.one_up_sent` events. */
|
|
251
|
+
interface SocialOneUpSentPayload {
|
|
252
|
+
from: {
|
|
253
|
+
agent_id: string;
|
|
254
|
+
name: string;
|
|
255
|
+
};
|
|
256
|
+
to: {
|
|
257
|
+
agent_id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
};
|
|
260
|
+
ticket_id: string;
|
|
261
|
+
message: string;
|
|
262
|
+
}
|
|
263
|
+
/** Payload for `survey.submitted` events. */
|
|
264
|
+
interface SurveySubmittedPayload {
|
|
265
|
+
survey: {
|
|
266
|
+
id: string;
|
|
267
|
+
ticket_id: string;
|
|
268
|
+
score: number;
|
|
269
|
+
comment: string;
|
|
270
|
+
submitted_at: string;
|
|
271
|
+
};
|
|
272
|
+
customer: {
|
|
273
|
+
id: string;
|
|
274
|
+
email: string;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
/** Payload for `ticket.assigned` events. */
|
|
278
|
+
interface TicketAssignedPayload {
|
|
279
|
+
ticket: {
|
|
280
|
+
id: string;
|
|
281
|
+
prefixed_id: string;
|
|
282
|
+
};
|
|
283
|
+
assignee: {
|
|
284
|
+
id: string;
|
|
285
|
+
name: string;
|
|
286
|
+
email: string;
|
|
287
|
+
};
|
|
288
|
+
previous_assignee: null;
|
|
289
|
+
}
|
|
290
|
+
/** Payload for `ticket.closed` events. */
|
|
291
|
+
interface TicketClosedPayload {
|
|
292
|
+
ticket: {
|
|
293
|
+
id: string;
|
|
294
|
+
prefixed_id: string;
|
|
295
|
+
title: string;
|
|
296
|
+
status: string;
|
|
297
|
+
priority: string;
|
|
298
|
+
channel: string;
|
|
299
|
+
resolved_at: string;
|
|
300
|
+
};
|
|
301
|
+
changes?: Record<string, {
|
|
302
|
+
from: string;
|
|
303
|
+
to: string;
|
|
304
|
+
}>;
|
|
305
|
+
}
|
|
306
|
+
/** Payload for `ticket.created` events. */
|
|
307
|
+
interface TicketCreatedPayload {
|
|
308
|
+
ticket: {
|
|
309
|
+
id: string;
|
|
310
|
+
prefixed_id: string;
|
|
311
|
+
title: string;
|
|
312
|
+
status: string;
|
|
313
|
+
priority: string;
|
|
314
|
+
channel: string;
|
|
315
|
+
customer_id: string;
|
|
316
|
+
created_at: string;
|
|
317
|
+
};
|
|
318
|
+
customer: {
|
|
319
|
+
id: string;
|
|
320
|
+
name: string;
|
|
321
|
+
email: string;
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
/** Payload for `ticket.deleted` events. */
|
|
325
|
+
interface TicketDeletedPayload {
|
|
326
|
+
id: string;
|
|
327
|
+
}
|
|
328
|
+
/** Payload for `ticket.message_added` events. */
|
|
329
|
+
interface TicketMessageAddedPayload {
|
|
330
|
+
ticket: {
|
|
331
|
+
id: string;
|
|
332
|
+
dashboard_url: string | null;
|
|
333
|
+
};
|
|
334
|
+
message: {
|
|
335
|
+
id: string;
|
|
336
|
+
sender: string;
|
|
337
|
+
sender_name: string | null;
|
|
338
|
+
content: string;
|
|
339
|
+
created_at: string;
|
|
340
|
+
};
|
|
341
|
+
customer?: {
|
|
342
|
+
id: string;
|
|
343
|
+
name: string | null;
|
|
344
|
+
email: string | null;
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
/** Payload for `ticket.updated` events. */
|
|
348
|
+
interface TicketUpdatedPayload {
|
|
349
|
+
ticket: {
|
|
350
|
+
id: string;
|
|
351
|
+
prefixed_id: string;
|
|
352
|
+
title: string;
|
|
353
|
+
status: string;
|
|
354
|
+
priority: string;
|
|
355
|
+
channel: string;
|
|
356
|
+
};
|
|
357
|
+
changes?: Record<string, {
|
|
358
|
+
from: string;
|
|
359
|
+
to: string;
|
|
360
|
+
} | {
|
|
361
|
+
from: Array<string>;
|
|
362
|
+
to: Array<string>;
|
|
363
|
+
}>;
|
|
364
|
+
}
|
|
365
|
+
/** Maps each event type to its payload interface — used internally for the discriminated union. */
|
|
366
|
+
interface WebhookEventDataMap {
|
|
367
|
+
'article.created': ArticleCreatedPayload;
|
|
368
|
+
'article.deleted': ArticleDeletedPayload;
|
|
369
|
+
'article.published': ArticlePublishedPayload;
|
|
370
|
+
'article.updated': ArticleUpdatedPayload;
|
|
371
|
+
'boss.damaged': BossDamagedPayload;
|
|
372
|
+
'boss.defeated': BossDefeatedPayload;
|
|
373
|
+
'boss.spawned': BossSpawnedPayload;
|
|
374
|
+
'community_post.commented': CommunityPostCommentedPayload;
|
|
375
|
+
'community_post.created': CommunityPostCreatedPayload;
|
|
376
|
+
'community_post.deleted': CommunityPostDeletedPayload;
|
|
377
|
+
'community_post.status_changed': CommunityPostStatusChangedPayload;
|
|
378
|
+
'community_post.updated': CommunityPostUpdatedPayload;
|
|
379
|
+
'community_post.voted': CommunityPostVotedPayload;
|
|
380
|
+
'customer.created': CustomerCreatedPayload;
|
|
381
|
+
'customer.deleted': CustomerDeletedPayload;
|
|
382
|
+
'customer.updated': CustomerUpdatedPayload;
|
|
383
|
+
'customer_group.created': CustomerGroupCreatedPayload;
|
|
384
|
+
'customer_group.deleted': CustomerGroupDeletedPayload;
|
|
385
|
+
'customer_group.updated': CustomerGroupUpdatedPayload;
|
|
386
|
+
'player.achievement_unlocked': PlayerAchievementUnlockedPayload;
|
|
387
|
+
'player.level_up': PlayerLevelUpPayload;
|
|
388
|
+
'player.quest_completed': PlayerQuestCompletedPayload;
|
|
389
|
+
'player.streak_milestone': PlayerStreakMilestonePayload;
|
|
390
|
+
'player.xp_gained': PlayerXpGainedPayload;
|
|
391
|
+
'social.high_five_sent': SocialHighFiveSentPayload;
|
|
392
|
+
'social.one_up_sent': SocialOneUpSentPayload;
|
|
393
|
+
'survey.submitted': SurveySubmittedPayload;
|
|
394
|
+
'ticket.assigned': TicketAssignedPayload;
|
|
395
|
+
'ticket.closed': TicketClosedPayload;
|
|
396
|
+
'ticket.created': TicketCreatedPayload;
|
|
397
|
+
'ticket.deleted': TicketDeletedPayload;
|
|
398
|
+
'ticket.message_added': TicketMessageAddedPayload;
|
|
399
|
+
'ticket.updated': TicketUpdatedPayload;
|
|
400
|
+
}
|
|
401
|
+
/** A webhook event delivered to your endpoint. */
|
|
402
|
+
interface WebhookEvent<T extends WebhookEventType = WebhookEventType> {
|
|
403
|
+
/** Unique event ID (idempotency key). */
|
|
404
|
+
id: string;
|
|
405
|
+
/** Event type. */
|
|
406
|
+
type: T;
|
|
407
|
+
/** When the event was created (ISO 8601). */
|
|
408
|
+
created_at: string;
|
|
409
|
+
/** Team that owns this event. */
|
|
410
|
+
team_id: string;
|
|
411
|
+
/** Event-specific payload. */
|
|
412
|
+
data: WebhookEventDataMap[T];
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** Thrown when webhook signature verification fails. */
|
|
416
|
+
declare class WebhookSignatureVerificationError extends Error {
|
|
417
|
+
constructor(message: string);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Verify a webhook signature and parse the event (synchronous, Node.js only).
|
|
422
|
+
*
|
|
423
|
+
* Uses Node's `node:crypto` for timing-safe HMAC comparison. For browser, Edge,
|
|
424
|
+
* Workers, or any non-Node runtime, use `constructEventAsync` from
|
|
425
|
+
* `@cstar.help/js/webhook` instead.
|
|
426
|
+
*
|
|
427
|
+
* @param rawBody - Raw request body as a string (NOT parsed JSON)
|
|
428
|
+
* @param signature - Value of the `X-Signature` header
|
|
429
|
+
* @param secret - Your webhook endpoint's secret (`whsec_*`)
|
|
430
|
+
* @returns Parsed and verified webhook event
|
|
431
|
+
* @throws {WebhookSignatureVerificationError} If verification fails
|
|
432
|
+
*/
|
|
433
|
+
declare function constructEvent(rawBody: string, signature: string, secret: string): WebhookEvent;
|
|
434
|
+
/**
|
|
435
|
+
* Verify an HMAC-SHA256 signature (synchronous, Node.js only).
|
|
436
|
+
* Uses timing-safe comparison to prevent timing attacks.
|
|
437
|
+
*/
|
|
438
|
+
declare function verifySignature(rawBody: string, signature: string, secret: string): boolean;
|
|
439
|
+
|
|
440
|
+
export { type WebhookEvent, WebhookSignatureVerificationError, constructEvent, verifySignature };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/webhook/node.ts
|
|
2
|
+
import { createHmac, timingSafeEqual } from "crypto";
|
|
3
|
+
|
|
4
|
+
// src/webhook/index.ts
|
|
5
|
+
var WebhookSignatureVerificationError = class extends Error {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "WebhookSignatureVerificationError";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/webhook/node.ts
|
|
13
|
+
function constructEvent(rawBody, signature, secret) {
|
|
14
|
+
if (!verifySignature(rawBody, signature, secret)) {
|
|
15
|
+
throw new WebhookSignatureVerificationError(
|
|
16
|
+
"Webhook signature verification failed. Ensure you are using the raw request body and the correct endpoint secret."
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return JSON.parse(rawBody);
|
|
20
|
+
}
|
|
21
|
+
function verifySignature(rawBody, signature, secret) {
|
|
22
|
+
const expected = "sha256=" + createHmac("sha256", secret).update(rawBody).digest("hex");
|
|
23
|
+
if (signature.length !== expected.length) return false;
|
|
24
|
+
return timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
WebhookSignatureVerificationError,
|
|
28
|
+
constructEvent,
|
|
29
|
+
verifySignature
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cstar.help/js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Official TypeScript SDK for the cStar customer support platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -47,6 +47,16 @@
|
|
|
47
47
|
"default": "./dist/webhook/index.cjs"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
+
"./webhook/node": {
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/webhook/node.d.ts",
|
|
53
|
+
"default": "./dist/webhook/node.js"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/webhook/node.d.cts",
|
|
57
|
+
"default": "./dist/webhook/node.cjs"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
50
60
|
"./community": {
|
|
51
61
|
"import": {
|
|
52
62
|
"types": "./dist/community/index.d.ts",
|
|
@@ -96,7 +106,9 @@
|
|
|
96
106
|
"dev": "tsup --watch",
|
|
97
107
|
"test": "vitest run",
|
|
98
108
|
"test:watch": "vitest",
|
|
99
|
-
"typecheck": "tsc --noEmit"
|
|
109
|
+
"typecheck": "tsc --noEmit",
|
|
110
|
+
"check:dts": "node scripts/check-dts.mjs",
|
|
111
|
+
"prepublishOnly": "yarn build && yarn check:dts"
|
|
100
112
|
},
|
|
101
113
|
"keywords": [
|
|
102
114
|
"cstar",
|