@cstar.help/js 0.18.1 → 0.18.4

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.
@@ -1,4 +1,4 @@
1
- /** Attachment metadata for community posts and comments (images only, max 5MB each). */
1
+ /** Attachment metadata for community posts and comments (images only, max 4 MB each). */
2
2
  interface CommunityAttachment {
3
3
  filename: string;
4
4
  content_type: string;
@@ -30,7 +30,7 @@ interface CommunityCreatePostParams {
30
30
  topicId: string;
31
31
  /** Custom field values keyed by field definition ID. */
32
32
  customFields?: Record<string, string>;
33
- /** Image attachments (max 10, images only, 5MB each). */
33
+ /** Image attachments (max 10, images only, 4 MB each). */
34
34
  attachments?: CommunityAttachment[];
35
35
  }
36
36
  /** Parameters for updating a post as the original author. */
@@ -53,7 +53,7 @@ interface CommunityCreateCommentParams {
53
53
  body: string;
54
54
  /** Parent comment ID for replies (optional, 1-level nesting). */
55
55
  parentCommentId?: string | null;
56
- /** Image attachments (max 5, images only, 5MB each). */
56
+ /** Image attachments (max 5, images only, 4 MB each). */
57
57
  attachments?: CommunityAttachment[];
58
58
  }
59
59
  /** Response from creating a post. */
@@ -1,4 +1,4 @@
1
- import { d as WebhookEvent } from '../webhookEvents-Lqpsj935.cjs';
1
+ import { d as WebhookEvent } from '../webhookEvents-YQer37My.cjs';
2
2
 
3
3
  /** Default replay window for Stripe-style signatures: 5 minutes (300s). */
4
4
  declare const DEFAULT_TOLERANCE_SECONDS = 300;
@@ -1,4 +1,4 @@
1
- import { d as WebhookEvent } from '../webhookEvents-Lqpsj935.js';
1
+ import { d as WebhookEvent } from '../webhookEvents-YQer37My.js';
2
2
 
3
3
  /** Default replay window for Stripe-style signatures: 5 minutes (300s). */
4
4
  declare const DEFAULT_TOLERANCE_SECONDS = 300;
@@ -1,4 +1,4 @@
1
- import { d as WebhookEvent } from '../webhookEvents-Lqpsj935.cjs';
1
+ import { d as WebhookEvent } from '../webhookEvents-YQer37My.cjs';
2
2
  import { VerifyOptions } from './index.cjs';
3
3
  export { DEFAULT_TOLERANCE_SECONDS, WebhookSignatureVerificationError } from './index.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { d as WebhookEvent } from '../webhookEvents-Lqpsj935.js';
1
+ import { d as WebhookEvent } from '../webhookEvents-YQer37My.js';
2
2
  import { VerifyOptions } from './index.js';
3
3
  export { DEFAULT_TOLERANCE_SECONDS, WebhookSignatureVerificationError } from './index.js';
4
4
 
@@ -6,18 +6,19 @@ interface AgentPreferencesUpdatedPayload {
6
6
  member_id: string;
7
7
  agent_id: string;
8
8
  changed: Array<string>;
9
- preferences: {
10
- boringMode: boolean;
11
- };
9
+ preferences: Record<string, boolean>;
12
10
  }
13
11
  /** Payload for `article.created` events. */
14
12
  interface ArticleCreatedPayload {
15
13
  article: {
16
14
  id: string;
17
15
  title: string;
18
- slug: string;
16
+ slug: string | null;
17
+ status: string;
19
18
  is_public: boolean;
19
+ published_at: string | null;
20
20
  created_at: string;
21
+ updated_at: string | null;
21
22
  };
22
23
  }
23
24
  /** Payload for `article.deleted` events. */
@@ -29,9 +30,12 @@ interface ArticlePublishedPayload {
29
30
  article: {
30
31
  id: string;
31
32
  title: string;
32
- slug: string;
33
+ slug: string | null;
34
+ status: string;
33
35
  is_public: boolean;
34
- published_at: string;
36
+ published_at: string | null;
37
+ created_at: string;
38
+ updated_at: string | null;
35
39
  };
36
40
  }
37
41
  /** Payload for `article.updated` events. */
@@ -39,71 +43,95 @@ interface ArticleUpdatedPayload {
39
43
  article: {
40
44
  id: string;
41
45
  title: string;
42
- slug: string;
46
+ slug: string | null;
47
+ status: string;
43
48
  is_public: boolean;
49
+ published_at: string | null;
50
+ created_at: string;
51
+ updated_at: string | null;
52
+ };
53
+ changes?: {
54
+ title?: {
55
+ from: string;
56
+ to: string;
57
+ };
58
+ slug?: {
59
+ from: string | null;
60
+ to: string | null;
61
+ };
62
+ status?: {
63
+ from: string;
64
+ to: string;
65
+ };
66
+ is_public?: {
67
+ from: boolean;
68
+ to: boolean;
69
+ };
44
70
  };
45
71
  }
46
72
  /** Payload for `boss.damaged` events. */
47
73
  interface BossDamagedPayload {
48
74
  boss: {
49
- id: string;
75
+ name: string;
50
76
  current_hp: number;
51
77
  };
52
78
  damage: number;
79
+ defeated: boolean;
53
80
  by: {
54
81
  agent_id: string;
55
- name: string;
56
82
  };
57
83
  }
58
84
  /** Payload for `boss.defeated` events. */
59
85
  interface BossDefeatedPayload {
60
86
  boss: {
61
- id: string;
62
87
  name: string;
88
+ level: number;
63
89
  };
64
90
  final_blow_by: {
65
91
  agent_id: string;
66
- name: string;
67
- };
68
- team_xp_awarded: number;
92
+ name: string | null;
93
+ } | null;
69
94
  }
70
95
  /** Payload for `boss.spawned` events. */
71
96
  interface BossSpawnedPayload {
72
97
  boss: {
73
- id: string;
98
+ id: string | null;
74
99
  name: string;
75
100
  level: number;
101
+ type: string | null;
102
+ difficulty: string | null;
76
103
  max_hp: number;
77
104
  };
78
105
  }
79
106
  /** Payload for `community_post.commented` events. */
80
107
  interface CommunityPostCommentedPayload {
108
+ post: {
109
+ id: string;
110
+ };
81
111
  comment: {
82
112
  id: string;
83
113
  post_id: string;
84
- content: string;
85
- author_id: string;
86
- created_at: string;
114
+ body: string;
115
+ is_official: boolean;
116
+ author_name: string | null;
117
+ created_at: string | null;
87
118
  };
88
119
  }
89
120
  /** Payload for `community_post.created` events. */
90
121
  interface CommunityPostCreatedPayload {
91
122
  post: {
92
123
  id: string;
93
- prefixed_id: string;
94
124
  title: string;
95
125
  status: string;
96
- visibility: string;
97
- topic: string;
98
- created_at: string;
126
+ visibility: string | null;
127
+ created_at: string | null;
99
128
  };
100
129
  }
101
130
  /** Payload for `community_post.deleted` events. */
102
131
  interface CommunityPostDeletedPayload {
103
132
  post: {
104
133
  id: string;
105
- prefixed_id?: string;
106
- title?: string;
134
+ title: string | null;
107
135
  };
108
136
  }
109
137
  /** Payload for `community_post.status_changed` events. */
@@ -112,8 +140,10 @@ interface CommunityPostStatusChangedPayload {
112
140
  id: string;
113
141
  title: string;
114
142
  status: string;
115
- visibility: string;
143
+ visibility: string | null;
144
+ created_at: string | null;
116
145
  };
146
+ previous_status: string | null;
117
147
  }
118
148
  /** Payload for `community_post.updated` events. */
119
149
  interface CommunityPostUpdatedPayload {
@@ -121,7 +151,8 @@ interface CommunityPostUpdatedPayload {
121
151
  id: string;
122
152
  title: string;
123
153
  status: string;
124
- visibility: string;
154
+ visibility: string | null;
155
+ created_at: string | null;
125
156
  };
126
157
  }
127
158
  /** Payload for `community_post.voted` events. */
@@ -139,11 +170,13 @@ interface CommunityPostVotedPayload {
139
170
  interface CustomerCreatedPayload {
140
171
  customer: {
141
172
  id: string;
142
- name: string;
143
- email: string;
173
+ name: string | null;
174
+ email: string | null;
144
175
  status: string;
176
+ sentiment: string;
145
177
  tags: Array<string>;
146
178
  created_at: string;
179
+ updated_at: string | null;
147
180
  };
148
181
  }
149
182
  /** Payload for `customer.deleted` events. */
@@ -154,13 +187,32 @@ interface CustomerDeletedPayload {
154
187
  interface CustomerUpdatedPayload {
155
188
  customer: {
156
189
  id: string;
157
- name: string;
158
- email: string;
190
+ name: string | null;
191
+ email: string | null;
159
192
  status: string;
193
+ sentiment: string;
160
194
  tags: Array<string>;
195
+ created_at: string;
196
+ updated_at: string | null;
161
197
  };
162
- changes: {
163
- tags: {
198
+ changes?: {
199
+ name?: {
200
+ from: string | null;
201
+ to: string | null;
202
+ };
203
+ email?: {
204
+ from: string | null;
205
+ to: string | null;
206
+ };
207
+ status?: {
208
+ from: string;
209
+ to: string;
210
+ };
211
+ sentiment?: {
212
+ from: string;
213
+ to: string;
214
+ };
215
+ tags?: {
164
216
  from: Array<string>;
165
217
  to: Array<string>;
166
218
  };
@@ -168,11 +220,14 @@ interface CustomerUpdatedPayload {
168
220
  }
169
221
  /** Payload for `customer_group.created` events. */
170
222
  interface CustomerGroupCreatedPayload {
171
- group: {
223
+ customer_group: {
172
224
  id: string;
173
225
  name: string;
174
- color: string;
175
- member_count: number;
226
+ slug: string | null;
227
+ description: string | null;
228
+ customer_count: number;
229
+ created_at: string;
230
+ updated_at: string | null;
176
231
  };
177
232
  }
178
233
  /** Payload for `customer_group.deleted` events. */
@@ -183,22 +238,27 @@ interface CustomerGroupDeletedPayload {
183
238
  }
184
239
  /** Payload for `customer_group.updated` events. */
185
240
  interface CustomerGroupUpdatedPayload {
186
- group: {
241
+ customer_group: {
187
242
  id: string;
188
243
  name: string;
189
- color: string;
190
- member_count: number;
244
+ slug: string | null;
245
+ description: string | null;
246
+ customer_count: number;
247
+ created_at: string;
248
+ updated_at: string | null;
191
249
  };
192
250
  }
193
251
  /** Payload for `player.achievement_unlocked` events. */
194
252
  interface PlayerAchievementUnlockedPayload {
195
253
  player: {
196
254
  agent_id: string;
197
- name: string;
255
+ name: string | null;
198
256
  };
199
257
  achievement: {
200
258
  id: string;
201
259
  name: string;
260
+ description: string;
261
+ rarity: string;
202
262
  xp: number;
203
263
  };
204
264
  }
@@ -206,13 +266,13 @@ interface PlayerAchievementUnlockedPayload {
206
266
  interface PlayerLevelUpPayload {
207
267
  player: {
208
268
  agent_id: string;
209
- name: string;
269
+ name: string | null;
210
270
  };
211
271
  level: {
212
272
  from: number;
213
273
  to: number;
214
274
  };
215
- title_unlocked: string;
275
+ total_xp: number;
216
276
  }
217
277
  /** Payload for `player.quest_completed` events. */
218
278
  interface PlayerQuestCompletedPayload {
@@ -247,95 +307,137 @@ interface PlayerXpGainedPayload {
247
307
  }
248
308
  /** Payload for `social.high_five_sent` events. */
249
309
  interface SocialHighFiveSentPayload {
310
+ id: string;
250
311
  from_team: {
251
312
  id: string;
252
- name: string;
313
+ name: string | null;
253
314
  };
254
315
  to_team: {
255
316
  id: string;
256
- name: string;
317
+ name: string | null;
318
+ };
319
+ sent_by: {
320
+ agent_id: string;
321
+ name: string | null;
257
322
  };
258
- message: string;
323
+ message: string | null;
324
+ created_at: string;
259
325
  }
260
326
  /** Payload for `social.one_up_sent` events. */
261
327
  interface SocialOneUpSentPayload {
328
+ id: string;
262
329
  from: {
263
330
  agent_id: string;
264
- name: string;
331
+ name: string | null;
265
332
  };
266
333
  to: {
267
334
  agent_id: string;
268
- name: string;
335
+ name: string | null;
269
336
  };
270
- ticket_id: string;
271
- message: string;
337
+ message: string | null;
338
+ gold_amount: number;
339
+ created_at: string;
272
340
  }
273
341
  /** Payload for `survey.submitted` events. */
274
342
  interface SurveySubmittedPayload {
275
343
  survey: {
276
344
  id: string;
277
- ticket_id: string;
278
- score: number;
279
- comment: string;
345
+ ticket_id: string | null;
346
+ rating: number;
347
+ comment: string | null;
348
+ agent_id: string | null;
280
349
  submitted_at: string;
281
350
  };
282
- customer: {
283
- id: string;
284
- email: string;
285
- };
286
351
  }
287
352
  /** Payload for `team.preferences_updated` events. */
288
353
  interface TeamPreferencesUpdatedPayload {
289
354
  team_id: string;
290
355
  changed: Array<string>;
291
- preferences: {
292
- bossBattlesEnabled: boolean;
293
- };
356
+ preferences: Record<string, boolean>;
294
357
  }
295
358
  /** Payload for `ticket.assigned` events. */
296
359
  interface TicketAssignedPayload {
297
360
  ticket: {
298
361
  id: string;
299
- prefixed_id: string;
362
+ title: string;
363
+ status: string;
364
+ priority: string;
365
+ channel: string | null;
366
+ tags: Array<string>;
367
+ customer_id: string | null;
368
+ assigned_to: string | null;
369
+ dashboard_url: string | null;
370
+ created_at: string;
371
+ updated_at: string | null;
300
372
  };
301
373
  assignee: {
302
374
  id: string;
303
- name: string;
304
- email: string;
305
- };
306
- previous_assignee: null;
375
+ name: string | null;
376
+ email: string | null;
377
+ } | null;
378
+ previous_assignee: {
379
+ id: string;
380
+ name: string | null;
381
+ email: string | null;
382
+ } | null;
307
383
  }
308
384
  /** Payload for `ticket.closed` events. */
309
385
  interface TicketClosedPayload {
310
386
  ticket: {
311
387
  id: string;
312
- prefixed_id: string;
313
388
  title: string;
314
389
  status: string;
315
390
  priority: string;
316
- channel: string;
391
+ channel: string | null;
392
+ tags: Array<string>;
393
+ customer_id: string | null;
394
+ assigned_to: string | null;
395
+ dashboard_url: string | null;
396
+ created_at: string;
397
+ updated_at: string | null;
398
+ };
399
+ changes?: {
400
+ title?: {
401
+ from: string;
402
+ to: string;
403
+ };
404
+ status?: {
405
+ from: string;
406
+ to: string;
407
+ };
408
+ priority?: {
409
+ from: string;
410
+ to: string;
411
+ };
412
+ assigned_to?: {
413
+ from: string | null;
414
+ to: string | null;
415
+ };
416
+ tags?: {
417
+ from: Array<string>;
418
+ to: Array<string>;
419
+ };
317
420
  };
318
- changes?: Record<string, {
319
- from: string;
320
- to: string;
321
- }>;
322
421
  }
323
422
  /** Payload for `ticket.created` events. */
324
423
  interface TicketCreatedPayload {
325
424
  ticket: {
326
425
  id: string;
327
- prefixed_id: string;
328
426
  title: string;
329
427
  status: string;
330
428
  priority: string;
331
- channel: string;
332
- customer_id: string;
429
+ channel: string | null;
430
+ tags: Array<string>;
431
+ customer_id: string | null;
432
+ assigned_to: string | null;
433
+ dashboard_url: string | null;
333
434
  created_at: string;
435
+ updated_at: string | null;
334
436
  };
335
- customer: {
437
+ customer?: {
336
438
  id: string;
337
- name: string;
338
- email: string;
439
+ name: string | null;
440
+ email: string | null;
339
441
  };
340
442
  }
341
443
  /** Payload for `ticket.deleted` events. */
@@ -352,6 +454,7 @@ interface TicketMessageAddedPayload {
352
454
  id: string;
353
455
  sender: string;
354
456
  sender_name: string | null;
457
+ message_type: string;
355
458
  content: string;
356
459
  created_at: string;
357
460
  };
@@ -365,19 +468,39 @@ interface TicketMessageAddedPayload {
365
468
  interface TicketUpdatedPayload {
366
469
  ticket: {
367
470
  id: string;
368
- prefixed_id: string;
369
471
  title: string;
370
472
  status: string;
371
473
  priority: string;
372
- channel: string;
474
+ channel: string | null;
475
+ tags: Array<string>;
476
+ customer_id: string | null;
477
+ assigned_to: string | null;
478
+ dashboard_url: string | null;
479
+ created_at: string;
480
+ updated_at: string | null;
481
+ };
482
+ changes?: {
483
+ title?: {
484
+ from: string;
485
+ to: string;
486
+ };
487
+ status?: {
488
+ from: string;
489
+ to: string;
490
+ };
491
+ priority?: {
492
+ from: string;
493
+ to: string;
494
+ };
495
+ assigned_to?: {
496
+ from: string | null;
497
+ to: string | null;
498
+ };
499
+ tags?: {
500
+ from: Array<string>;
501
+ to: Array<string>;
502
+ };
373
503
  };
374
- changes?: Record<string, {
375
- from: string;
376
- to: string;
377
- } | {
378
- from: Array<string>;
379
- to: Array<string>;
380
- }>;
381
504
  }
382
505
  /** Maps each event type to its payload interface — used internally for the discriminated union. */
383
506
  interface WebhookEventDataMap {
@@ -429,6 +552,8 @@ interface WebhookEvent<T extends WebhookEventType = WebhookEventType> {
429
552
  team_id: string;
430
553
  /** Event-specific payload. */
431
554
  data: WebhookEventDataMap[T];
555
+ /** Present (true) only on a test delivery: `data` is the documented sample, not a real record. */
556
+ test?: true;
432
557
  }
433
558
  /**
434
559
  * Stable representative payloads for each event type. Useful for testing