@cstar.help/js 0.17.5 → 0.18.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/README.md +27 -25
- package/dist/auth/index.cjs +220 -21
- package/dist/auth/index.d.cts +83 -31
- package/dist/auth/index.d.ts +83 -31
- package/dist/auth/index.js +210 -21
- package/dist/chat/index.cjs +131 -20
- package/dist/chat/index.d.cts +32 -4
- package/dist/chat/index.d.ts +32 -4
- package/dist/chat/index.js +131 -20
- package/dist/index.cjs +89 -38
- package/dist/index.d.cts +443 -150
- package/dist/index.d.ts +443 -150
- package/dist/index.js +89 -38
- package/dist/proactive/index.cjs +46 -33
- package/dist/proactive/index.js +45 -34
- package/dist/webhook/index.d.cts +1 -1
- package/dist/webhook/index.d.ts +1 -1
- package/dist/webhook/node.d.cts +1 -1
- package/dist/webhook/node.d.ts +1 -1
- package/dist/{webhookEvents-1N2i2GcQ.d.cts → webhookEvents-Lqpsj935.d.cts} +0 -1
- package/dist/{webhookEvents-1N2i2GcQ.d.ts → webhookEvents-Lqpsj935.d.ts} +0 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WebhookEventType, a as WebhookEventDataMap } from './webhookEvents-
|
|
2
|
-
export { b as WEBHOOK_EVENT_CATALOG, c as WEBHOOK_EVENT_SAMPLES, d as WebhookEvent } from './webhookEvents-
|
|
1
|
+
import { W as WebhookEventType, a as WebhookEventDataMap } from './webhookEvents-Lqpsj935.js';
|
|
2
|
+
export { b as WEBHOOK_EVENT_CATALOG, c as WEBHOOK_EVENT_SAMPLES, d as WebhookEvent } from './webhookEvents-Lqpsj935.js';
|
|
3
3
|
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, h as CStarServerError, i as CStarValidationError, E as ErrorType } from './errors-bW8CwTn4.js';
|
|
4
4
|
|
|
5
5
|
/** Metadata: string key-value pairs. Max 50 keys, 40-char keys, 500-char values. */
|
|
@@ -210,6 +210,8 @@ declare class CStarRealtime {
|
|
|
210
210
|
private retryTimer;
|
|
211
211
|
private _connected;
|
|
212
212
|
private destroyed;
|
|
213
|
+
/** The server closed the stream because the API key was revoked or expired. */
|
|
214
|
+
private revoked;
|
|
213
215
|
private connecting;
|
|
214
216
|
/** Short-lived SSE token (exchanged from secret key). */
|
|
215
217
|
private sseToken;
|
|
@@ -259,6 +261,7 @@ declare class CStarRealtime {
|
|
|
259
261
|
private dispatch;
|
|
260
262
|
private scheduleReconnect;
|
|
261
263
|
private setConnected;
|
|
264
|
+
private handleRevoked;
|
|
262
265
|
private emitError;
|
|
263
266
|
/** Whether we hold a token that won't expire for at least 30 seconds. */
|
|
264
267
|
private hasFreshSseToken;
|
|
@@ -303,13 +306,34 @@ interface MessageCreateParams {
|
|
|
303
306
|
/** Pagination options for a ticket message history. */
|
|
304
307
|
type MessageListParams = PaginationParams;
|
|
305
308
|
|
|
309
|
+
/**
|
|
310
|
+
* One of the team's priority keys, highest first in GET /settings
|
|
311
|
+
* (`priorities[].key`), for example `critical`, `high`, `normal`, `low`.
|
|
312
|
+
* Teams can rename and add priorities, so this is not a fixed list. A key
|
|
313
|
+
* the team doesn't have fails with a 400 `parameter_invalid` that lists
|
|
314
|
+
* the allowed keys.
|
|
315
|
+
*/
|
|
316
|
+
type TicketPriorityKey = string;
|
|
317
|
+
/**
|
|
318
|
+
* One of the team's ticket status keys from GET /settings
|
|
319
|
+
* (`ticketStatuses[].key`), for example `new`, `open`, `pending`,
|
|
320
|
+
* `waiting_on_customer`, `resolved`, `closed`. `merged` is set only by
|
|
321
|
+
* merging tickets. Other values fail with a 400 `parameter_invalid`.
|
|
322
|
+
*/
|
|
323
|
+
type TicketStatusKey = string;
|
|
324
|
+
/**
|
|
325
|
+
* Ticket custom field values as sent: numbers and booleans are stored as
|
|
326
|
+
* strings, and null clears a value.
|
|
327
|
+
*/
|
|
328
|
+
type TicketCustomFieldValues = Record<string, string | number | boolean | null>;
|
|
306
329
|
/** A cStar support ticket. */
|
|
307
330
|
interface Ticket {
|
|
308
331
|
id: string;
|
|
309
332
|
object: 'ticket';
|
|
333
|
+
/** Ticket subject. New subjects are at most 255 characters; tickets created earlier may be longer. */
|
|
310
334
|
title: string;
|
|
311
|
-
priority:
|
|
312
|
-
status:
|
|
335
|
+
priority: TicketPriorityKey;
|
|
336
|
+
status: TicketStatusKey;
|
|
313
337
|
customerId: string | null;
|
|
314
338
|
customerName: string | null;
|
|
315
339
|
assignedTo: string | null;
|
|
@@ -323,6 +347,8 @@ interface Ticket {
|
|
|
323
347
|
resolutionTier: string | null;
|
|
324
348
|
slaPaused: boolean;
|
|
325
349
|
metadata: Metadata;
|
|
350
|
+
/** Custom field values keyed by field ID, stored as strings ('42', 'true', an option value). */
|
|
351
|
+
customFields: Record<string, string>;
|
|
326
352
|
createdAt: string;
|
|
327
353
|
closedAt: string | null;
|
|
328
354
|
updatedAt: string;
|
|
@@ -342,34 +368,62 @@ interface TicketCustomerSummary {
|
|
|
342
368
|
}
|
|
343
369
|
/** Parameters for listing tickets. */
|
|
344
370
|
interface TicketListParams extends PaginationParams {
|
|
345
|
-
status?:
|
|
346
|
-
priority?:
|
|
371
|
+
status?: TicketStatusKey;
|
|
372
|
+
priority?: TicketPriorityKey;
|
|
347
373
|
customerId?: string;
|
|
348
374
|
assignedTo?: string;
|
|
349
375
|
search?: string;
|
|
350
376
|
expand?: string[];
|
|
351
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* An opening message sent with a new ticket. Same rules as adding a message
|
|
380
|
+
* later: unknown fields, another sender, or `messageType` and `isInternal`
|
|
381
|
+
* that disagree fail with a 400 whose `param` names the item, e.g.
|
|
382
|
+
* `messages[1].sender`.
|
|
383
|
+
*/
|
|
384
|
+
interface TicketSeedMessage {
|
|
385
|
+
sender: 'customer' | 'agent' | 'system';
|
|
386
|
+
content: string;
|
|
387
|
+
/** `true` saves a private team note the customer never sees. */
|
|
388
|
+
isInternal?: boolean;
|
|
389
|
+
/** Defaults to `public`. */
|
|
390
|
+
messageType?: 'public' | 'internal';
|
|
391
|
+
}
|
|
352
392
|
/** Parameters for creating a ticket. */
|
|
353
393
|
interface TicketCreateParams {
|
|
394
|
+
/** Ticket subject, 1 to 255 characters. Longer values fail with a 400 whose `param` is `title`. */
|
|
354
395
|
title: string;
|
|
355
|
-
priority?:
|
|
356
|
-
status?:
|
|
396
|
+
priority?: TicketPriorityKey;
|
|
397
|
+
status?: TicketStatusKey;
|
|
357
398
|
customerId?: string;
|
|
399
|
+
/** Email of an existing customer on the team, used when `customerId` is not set. */
|
|
400
|
+
customerEmail?: string;
|
|
358
401
|
customerName?: string;
|
|
402
|
+
/** Opening messages, oldest first. */
|
|
403
|
+
messages?: TicketSeedMessage[];
|
|
359
404
|
tags?: string[];
|
|
360
405
|
notes?: string;
|
|
406
|
+
/** Values keyed by ticket custom field ID; each must fit its field's type (400 otherwise). */
|
|
407
|
+
customFields?: TicketCustomFieldValues;
|
|
361
408
|
metadata?: Metadata;
|
|
362
409
|
}
|
|
363
|
-
/**
|
|
410
|
+
/**
|
|
411
|
+
* Parameters for updating a ticket. The customer cannot be changed after
|
|
412
|
+
* creation; the API rejects unknown fields.
|
|
413
|
+
*/
|
|
364
414
|
interface TicketUpdateParams {
|
|
415
|
+
/**
|
|
416
|
+
* New subject, at most 255 characters (400 with `param: 'title'` otherwise).
|
|
417
|
+
* Re-sending an older ticket's unchanged, longer subject is accepted.
|
|
418
|
+
*/
|
|
365
419
|
title?: string;
|
|
366
|
-
priority?:
|
|
367
|
-
status?:
|
|
368
|
-
customerId?: string | null;
|
|
369
|
-
customerName?: string;
|
|
420
|
+
priority?: TicketPriorityKey;
|
|
421
|
+
status?: TicketStatusKey;
|
|
370
422
|
assignedTo?: string | null;
|
|
371
423
|
tags?: string[];
|
|
372
424
|
notes?: string;
|
|
425
|
+
/** Replaces all values, keyed by custom field ID. null or '' clears one. */
|
|
426
|
+
customFields?: TicketCustomFieldValues;
|
|
373
427
|
metadata?: Record<string, string | null>;
|
|
374
428
|
}
|
|
375
429
|
|
|
@@ -543,6 +597,11 @@ declare class CustomersResource extends BaseResource<Customer, CustomerListParam
|
|
|
543
597
|
constructor(client: HttpClient);
|
|
544
598
|
}
|
|
545
599
|
|
|
600
|
+
/**
|
|
601
|
+
* One of the team's article statuses (GET /settings `articleStatuses`).
|
|
602
|
+
* Every team has draft and published; a team may add its own (archived, ...).
|
|
603
|
+
*/
|
|
604
|
+
type ArticleStatus = 'draft' | 'published' | (string & {});
|
|
546
605
|
/** A cStar knowledge base article. */
|
|
547
606
|
interface Article {
|
|
548
607
|
id: string;
|
|
@@ -552,7 +611,7 @@ interface Article {
|
|
|
552
611
|
excerpt: string | null;
|
|
553
612
|
content: string | null;
|
|
554
613
|
categoryId: string | null;
|
|
555
|
-
status:
|
|
614
|
+
status: ArticleStatus;
|
|
556
615
|
tags: string[];
|
|
557
616
|
notes: string | null;
|
|
558
617
|
viewCount: number;
|
|
@@ -567,8 +626,9 @@ interface Article {
|
|
|
567
626
|
}
|
|
568
627
|
/** Parameters for listing articles. */
|
|
569
628
|
interface ArticleListParams extends PaginationParams {
|
|
629
|
+
/** Category UUID. The API rejects names and slugs. */
|
|
570
630
|
category?: string;
|
|
571
|
-
status?:
|
|
631
|
+
status?: ArticleStatus;
|
|
572
632
|
isPublic?: boolean;
|
|
573
633
|
search?: string;
|
|
574
634
|
tag?: string;
|
|
@@ -580,7 +640,7 @@ interface ArticleCreateParams {
|
|
|
580
640
|
content?: string;
|
|
581
641
|
excerpt?: string;
|
|
582
642
|
categoryId?: string;
|
|
583
|
-
status?:
|
|
643
|
+
status?: ArticleStatus;
|
|
584
644
|
tags?: string[];
|
|
585
645
|
notes?: string;
|
|
586
646
|
isPublic?: boolean;
|
|
@@ -593,8 +653,9 @@ interface ArticleUpdateParams {
|
|
|
593
653
|
title?: string;
|
|
594
654
|
content?: string;
|
|
595
655
|
excerpt?: string;
|
|
596
|
-
|
|
597
|
-
|
|
656
|
+
/** Category UUID, or null to clear it. */
|
|
657
|
+
categoryId?: string | null;
|
|
658
|
+
status?: ArticleStatus;
|
|
598
659
|
tags?: string[];
|
|
599
660
|
notes?: string;
|
|
600
661
|
isPublic?: boolean;
|
|
@@ -1236,27 +1297,26 @@ interface StatusUpdateParams {
|
|
|
1236
1297
|
/** A quick reply template. */
|
|
1237
1298
|
interface QuickReply {
|
|
1238
1299
|
id: string;
|
|
1239
|
-
object: 'quick_reply';
|
|
1240
1300
|
title: string;
|
|
1301
|
+
/** Reply text. Mirrors `text` for older rows. */
|
|
1241
1302
|
body: string;
|
|
1242
|
-
|
|
1243
|
-
position: number;
|
|
1244
|
-
createdAt: string;
|
|
1245
|
-
updatedAt: string;
|
|
1303
|
+
text: string;
|
|
1246
1304
|
}
|
|
1247
|
-
/** Parameters for creating a quick reply. */
|
|
1305
|
+
/** Parameters for creating a quick reply. The API rejects any other field. */
|
|
1248
1306
|
interface QuickReplyCreateParams {
|
|
1249
1307
|
title: string;
|
|
1250
1308
|
body: string;
|
|
1251
|
-
category?: string;
|
|
1252
1309
|
}
|
|
1253
|
-
/** Parameters for updating a quick reply. */
|
|
1310
|
+
/** Parameters for updating a quick reply. The API rejects any other field. */
|
|
1254
1311
|
interface QuickReplyUpdateParams {
|
|
1255
1312
|
title?: string;
|
|
1256
1313
|
body?: string;
|
|
1257
|
-
category?: string;
|
|
1258
1314
|
}
|
|
1259
|
-
/**
|
|
1315
|
+
/**
|
|
1316
|
+
* The chat widget's online hours. When `enabled`, the widget shows its
|
|
1317
|
+
* offline message outside them. Not the SLA working hours in the
|
|
1318
|
+
* dashboard's Settings > Business Hours, which SLA deadlines use.
|
|
1319
|
+
*/
|
|
1260
1320
|
interface BusinessHours {
|
|
1261
1321
|
object: 'business_hours';
|
|
1262
1322
|
enabled: boolean;
|
|
@@ -1267,7 +1327,7 @@ interface BusinessHours {
|
|
|
1267
1327
|
end: string;
|
|
1268
1328
|
}>;
|
|
1269
1329
|
}
|
|
1270
|
-
/** Parameters for updating
|
|
1330
|
+
/** Parameters for updating the chat widget's online hours. */
|
|
1271
1331
|
interface BusinessHoursUpdateParams {
|
|
1272
1332
|
enabled?: boolean;
|
|
1273
1333
|
timezone?: string;
|
|
@@ -1277,14 +1337,126 @@ interface BusinessHoursUpdateParams {
|
|
|
1277
1337
|
end: string;
|
|
1278
1338
|
}>;
|
|
1279
1339
|
}
|
|
1340
|
+
/** A chat widget entrance effect: a preset, `custom` (your own) or `none`. */
|
|
1341
|
+
type WidgetEntranceEffect = 'none' | 'puff' | 'confetti' | 'sparkle' | 'pop' | 'slide' | 'custom';
|
|
1342
|
+
/**
|
|
1343
|
+
* One frame of a custom entrance. Missing values are neutral; the element
|
|
1344
|
+
* always ends in its own styles.
|
|
1345
|
+
*/
|
|
1346
|
+
interface WidgetEntranceKeyframe {
|
|
1347
|
+
/** 0 to 1. */
|
|
1348
|
+
opacity?: number;
|
|
1349
|
+
/** 0 to 3. */
|
|
1350
|
+
scale?: number;
|
|
1351
|
+
/** -168 to 168 px. */
|
|
1352
|
+
translateX?: number;
|
|
1353
|
+
/** -168 to 168 px. */
|
|
1354
|
+
translateY?: number;
|
|
1355
|
+
/** -360 to 360 degrees. */
|
|
1356
|
+
rotate?: number;
|
|
1357
|
+
}
|
|
1358
|
+
/** Particles thrown from the launcher by a custom entrance. */
|
|
1359
|
+
interface WidgetEntranceParticles {
|
|
1360
|
+
/** 1 to 34. Default 13. */
|
|
1361
|
+
count?: number;
|
|
1362
|
+
shape?: 'circle' | 'square' | 'star';
|
|
1363
|
+
/** 1 to 5 hex colours. Default: a confetti mix plus your widget colour. */
|
|
1364
|
+
colors?: string[] | null;
|
|
1365
|
+
/** Degrees of the cone, 0 to 360. Default 360. */
|
|
1366
|
+
spread?: number;
|
|
1367
|
+
/** Degrees, 0 is straight up, -180 to 180. Default 0. */
|
|
1368
|
+
direction?: number;
|
|
1369
|
+
/** Pixels, 0 to 168. Default 84. */
|
|
1370
|
+
distance?: number;
|
|
1371
|
+
/** Pixels, 2 to 21. Default 8. */
|
|
1372
|
+
size?: number;
|
|
1373
|
+
/** A multiple of 42, up to 840. Default 630. */
|
|
1374
|
+
durationMs?: number;
|
|
1375
|
+
/** A multiple of 42; with durationMs at most 840. Default 0. */
|
|
1376
|
+
delayMs?: number;
|
|
1377
|
+
}
|
|
1378
|
+
/** Your own entrance, played by a moment set to `custom`. */
|
|
1379
|
+
interface WidgetEntranceCustom {
|
|
1380
|
+
/** 2 to 5 evenly spaced frames. */
|
|
1381
|
+
keyframes?: WidgetEntranceKeyframe[] | null;
|
|
1382
|
+
/** A multiple of 42, up to 840. Default 420. */
|
|
1383
|
+
durationMs?: number;
|
|
1384
|
+
/** A multiple of 42; with durationMs at most 840. Default 0. */
|
|
1385
|
+
delayMs?: number;
|
|
1386
|
+
easing?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'bounce';
|
|
1387
|
+
particles?: WidgetEntranceParticles | null;
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* Chat widget entrance effects: `launcher` plays when the chat button first
|
|
1391
|
+
* appears on a page, `open` when someone opens the chat. Visitors who ask
|
|
1392
|
+
* for reduced motion see none.
|
|
1393
|
+
*/
|
|
1394
|
+
interface WidgetEntrance {
|
|
1395
|
+
launcher?: WidgetEntranceEffect;
|
|
1396
|
+
open?: WidgetEntranceEffect;
|
|
1397
|
+
custom?: WidgetEntranceCustom | null;
|
|
1398
|
+
}
|
|
1280
1399
|
/** Widget configuration. */
|
|
1281
1400
|
interface WidgetSettings {
|
|
1282
|
-
object: '
|
|
1401
|
+
object: 'widget_config';
|
|
1402
|
+
/** Always complete in responses (`none` when unset). */
|
|
1403
|
+
entrance: Required<Pick<WidgetEntrance, 'launcher' | 'open'>> & {
|
|
1404
|
+
custom: WidgetEntranceCustom | null;
|
|
1405
|
+
};
|
|
1283
1406
|
[key: string]: unknown;
|
|
1284
1407
|
}
|
|
1285
|
-
/**
|
|
1408
|
+
/**
|
|
1409
|
+
* Parameters for updating widget settings. Only the fields you send change.
|
|
1410
|
+
* Text over its limit is rejected with a 413. Strings, primaryColor, the URLs,
|
|
1411
|
+
* theme, position, mode and entrance are checked (400); the booleans and
|
|
1412
|
+
* libraryBorderRadius are saved as sent.
|
|
1413
|
+
*/
|
|
1286
1414
|
interface WidgetSettingsUpdateParams {
|
|
1287
|
-
|
|
1415
|
+
/** Hex only: `#rgb` or `#rrggbb`. */
|
|
1416
|
+
primaryColor?: string;
|
|
1417
|
+
theme?: 'light' | 'dark';
|
|
1418
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
1419
|
+
/** Text on the chat button, up to 30 characters. */
|
|
1420
|
+
launcherText?: string;
|
|
1421
|
+
/** Up to 500 characters. */
|
|
1422
|
+
welcomeMessage?: string;
|
|
1423
|
+
/** Shown outside business hours, up to 500 characters. */
|
|
1424
|
+
offlineMessage?: string;
|
|
1425
|
+
/** Up to 200 characters. */
|
|
1426
|
+
companyName?: string;
|
|
1427
|
+
/** An http or https URL, up to 2,000 characters. An empty string clears it. */
|
|
1428
|
+
termsUrl?: string;
|
|
1429
|
+
/** An http or https URL, up to 2,000 characters. An empty string clears it. */
|
|
1430
|
+
privacyUrl?: string;
|
|
1431
|
+
/** `script` runs the embed snippet; `sdk` leaves it off for your own UI. */
|
|
1432
|
+
mode?: 'script' | 'sdk';
|
|
1433
|
+
isEnabled?: boolean;
|
|
1434
|
+
showOnLibraryPages?: boolean;
|
|
1435
|
+
/** Saved for older setups only: widget sign-ups always confirm their email. */
|
|
1436
|
+
requireCustomerEmailConfirmation?: boolean;
|
|
1437
|
+
businessHoursEnabled?: boolean;
|
|
1438
|
+
/** Help center colours: any CSS colour, up to 50 characters. */
|
|
1439
|
+
libraryBgColor?: string;
|
|
1440
|
+
libraryCardColor?: string;
|
|
1441
|
+
libraryTextColor?: string;
|
|
1442
|
+
libraryTextSecondaryColor?: string;
|
|
1443
|
+
libraryBorderColor?: string;
|
|
1444
|
+
libraryAccentColor?: string;
|
|
1445
|
+
/** Font names, up to 100 characters. */
|
|
1446
|
+
libraryFontHeading?: string;
|
|
1447
|
+
libraryFontBody?: string;
|
|
1448
|
+
/** A CSS length such as `12px`. */
|
|
1449
|
+
libraryBorderRadius?: string;
|
|
1450
|
+
/**
|
|
1451
|
+
* Entrance effects, merged per key over the saved ones: `launcher`,
|
|
1452
|
+
* `open` and `custom` change only when sent, and `null` resets that key
|
|
1453
|
+
* (`none`, or no custom effect). `entrance: null` turns them all off.
|
|
1454
|
+
*/
|
|
1455
|
+
entrance?: {
|
|
1456
|
+
launcher?: WidgetEntranceEffect | null;
|
|
1457
|
+
open?: WidgetEntranceEffect | null;
|
|
1458
|
+
custom?: WidgetEntranceCustom | null;
|
|
1459
|
+
} | null;
|
|
1288
1460
|
}
|
|
1289
1461
|
|
|
1290
1462
|
/** Manage ticket status configurations. */
|
|
@@ -1329,9 +1501,15 @@ declare class SettingsResource {
|
|
|
1329
1501
|
get(): Promise<ApiResponse<TeamSettings>>;
|
|
1330
1502
|
/** Update team settings (bulk). */
|
|
1331
1503
|
update(params: TeamSettingsUpdateParams): Promise<ApiResponse<TeamSettings>>;
|
|
1332
|
-
/**
|
|
1504
|
+
/**
|
|
1505
|
+
* Get the chat widget's online hours (outside them the widget shows its
|
|
1506
|
+
* offline message). Not the SLA working hours that SLA deadlines use.
|
|
1507
|
+
*/
|
|
1333
1508
|
getBusinessHours(): Promise<ApiResponse<BusinessHours>>;
|
|
1334
|
-
/**
|
|
1509
|
+
/**
|
|
1510
|
+
* Update the chat widget's online hours. SLA deadlines don't change:
|
|
1511
|
+
* they follow the SLA working hours in Settings > Business Hours.
|
|
1512
|
+
*/
|
|
1335
1513
|
updateBusinessHours(params: BusinessHoursUpdateParams): Promise<ApiResponse<BusinessHours>>;
|
|
1336
1514
|
/** Get widget settings. */
|
|
1337
1515
|
getWidget(): Promise<ApiResponse<WidgetSettings>>;
|
|
@@ -1339,29 +1517,38 @@ declare class SettingsResource {
|
|
|
1339
1517
|
updateWidget(params: WidgetSettingsUpdateParams): Promise<ApiResponse<WidgetSettings>>;
|
|
1340
1518
|
}
|
|
1341
1519
|
|
|
1342
|
-
/** A notification. */
|
|
1520
|
+
/** A notification (mirrors `mapNotificationToApi` on the server). */
|
|
1343
1521
|
interface Notification {
|
|
1344
1522
|
id: string;
|
|
1345
1523
|
object: 'notification';
|
|
1346
1524
|
type: string;
|
|
1347
1525
|
title: string;
|
|
1348
1526
|
body: string | null;
|
|
1349
|
-
|
|
1350
|
-
resourceId: string | null;
|
|
1527
|
+
ticketId: string | null;
|
|
1351
1528
|
actorId: string | null;
|
|
1352
1529
|
actorName: string | null;
|
|
1353
|
-
|
|
1530
|
+
priority: string;
|
|
1531
|
+
/** Whether the user in `userId` has read it. */
|
|
1532
|
+
isRead: boolean;
|
|
1354
1533
|
readAt: string | null;
|
|
1534
|
+
isAdminNotification: boolean;
|
|
1535
|
+
expiresAt: string | null;
|
|
1355
1536
|
createdAt: string;
|
|
1356
1537
|
}
|
|
1357
1538
|
/** Parameters for listing notifications. */
|
|
1358
1539
|
interface NotificationListParams extends PaginationParams {
|
|
1540
|
+
/** Filter by notification type (for example `assigned`). */
|
|
1541
|
+
type?: string;
|
|
1542
|
+
/** `false` for unread only, `true` for read only. */
|
|
1543
|
+
isRead?: boolean;
|
|
1544
|
+
/** @deprecated Use `isRead: false`. Sent as `isRead=false`. */
|
|
1359
1545
|
unreadOnly?: boolean;
|
|
1360
1546
|
}
|
|
1361
1547
|
/** Unread count response. */
|
|
1362
1548
|
interface UnreadCount {
|
|
1363
|
-
|
|
1364
|
-
count
|
|
1549
|
+
unreadCount: number;
|
|
1550
|
+
/** True when the count hit the server's scan cap and may be higher. */
|
|
1551
|
+
truncated: boolean;
|
|
1365
1552
|
}
|
|
1366
1553
|
|
|
1367
1554
|
/** Manage notifications. */
|
|
@@ -1429,80 +1616,115 @@ declare class MentionsResource {
|
|
|
1429
1616
|
}>>;
|
|
1430
1617
|
}
|
|
1431
1618
|
|
|
1432
|
-
/**
|
|
1619
|
+
/** Storage bucket a message file lives in. `attachments` holds chat widget uploads. */
|
|
1620
|
+
type AttachmentBucket = 'email-attachments' | 'ticket-attachments' | 'avatars' | 'attachments';
|
|
1621
|
+
/**
|
|
1622
|
+
* A message file from `attachments.list()`. Storage is private: `url` is a
|
|
1623
|
+
* signed link that works for `expiresIn` seconds (300). Do not store it; list
|
|
1624
|
+
* again or call `attachments.get(storagePath, { bucket })` for a fresh one.
|
|
1625
|
+
* `url`, `storagePath`, `bucket` and `expiresIn` are null when the file
|
|
1626
|
+
* cannot be signed.
|
|
1627
|
+
*/
|
|
1433
1628
|
interface Attachment {
|
|
1434
1629
|
id: string;
|
|
1435
1630
|
object: 'attachment';
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
uploadedBy: string | null;
|
|
1631
|
+
messageId: string;
|
|
1632
|
+
ticketId: string;
|
|
1633
|
+
filename: string | null;
|
|
1634
|
+
contentType: string | null;
|
|
1635
|
+
sizeBytes: number | null;
|
|
1442
1636
|
createdAt: string;
|
|
1637
|
+
url: string | null;
|
|
1638
|
+
storagePath: string | null;
|
|
1639
|
+
bucket: AttachmentBucket | null;
|
|
1640
|
+
expiresIn: number | null;
|
|
1443
1641
|
}
|
|
1444
1642
|
/** Parameters for listing attachments. */
|
|
1445
1643
|
interface AttachmentListParams extends PaginationParams {
|
|
1446
1644
|
ticketId?: string;
|
|
1447
1645
|
}
|
|
1646
|
+
/** Parameters for a signed download URL. */
|
|
1647
|
+
interface AttachmentGetParams {
|
|
1648
|
+
/** Defaults to `email-attachments` on the server. */
|
|
1649
|
+
bucket?: AttachmentBucket;
|
|
1650
|
+
}
|
|
1651
|
+
/** A signed download URL from `attachments.get()`. A bearer link until it expires. */
|
|
1652
|
+
interface AttachmentDownloadUrl {
|
|
1653
|
+
url: string;
|
|
1654
|
+
/** Seconds until `url` stops working (300). */
|
|
1655
|
+
expiresIn: number;
|
|
1656
|
+
}
|
|
1448
1657
|
|
|
1449
1658
|
/** Manage file attachments. */
|
|
1450
1659
|
declare class AttachmentsResource {
|
|
1451
1660
|
private readonly client;
|
|
1452
1661
|
constructor(client: HttpClient);
|
|
1453
|
-
/** List
|
|
1662
|
+
/** List message files, each with a short-lived signed `url`. */
|
|
1454
1663
|
list(params?: AttachmentListParams): Promise<ListResponse<Attachment>>;
|
|
1455
|
-
/**
|
|
1456
|
-
|
|
1664
|
+
/**
|
|
1665
|
+
* Get a signed download URL, valid for `expiresIn` seconds, for a stored
|
|
1666
|
+
* file. Pass `storagePath` and `bucket` from `list()`.
|
|
1667
|
+
*/
|
|
1668
|
+
get(storagePath: string, params?: AttachmentGetParams): Promise<AttachmentDownloadUrl>;
|
|
1457
1669
|
/** Delete an attachment. */
|
|
1458
1670
|
del(attachmentId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1459
1671
|
}
|
|
1460
1672
|
|
|
1461
|
-
/**
|
|
1673
|
+
/** Record type a custom field belongs to. */
|
|
1674
|
+
type CustomFieldContentType = 'ticket' | 'customer' | 'article';
|
|
1675
|
+
/** Input type of a custom field. */
|
|
1676
|
+
type CustomFieldType = 'text' | 'number' | 'date' | 'select' | 'checkbox';
|
|
1677
|
+
/** A custom field definition (mirrors `mapFieldToApi` on the server). */
|
|
1462
1678
|
interface CustomField {
|
|
1463
1679
|
id: string;
|
|
1464
1680
|
object: 'custom_field';
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
required: boolean;
|
|
1681
|
+
contentType: CustomFieldContentType;
|
|
1682
|
+
label: string;
|
|
1683
|
+
fieldType: CustomFieldType;
|
|
1684
|
+
defaultValue: string | null;
|
|
1685
|
+
/** Choices for `select` fields. */
|
|
1471
1686
|
options: string[] | null;
|
|
1472
|
-
|
|
1687
|
+
minValue: number | null;
|
|
1688
|
+
maxValue: number | null;
|
|
1689
|
+
required: boolean;
|
|
1690
|
+
sortOrder: number;
|
|
1473
1691
|
createdAt: string;
|
|
1474
|
-
updatedAt: string;
|
|
1475
1692
|
}
|
|
1476
1693
|
/** Parameters for listing custom fields. */
|
|
1477
|
-
interface CustomFieldListParams
|
|
1478
|
-
|
|
1694
|
+
interface CustomFieldListParams {
|
|
1695
|
+
/** Only fields for this record type. */
|
|
1696
|
+
entity?: CustomFieldContentType;
|
|
1479
1697
|
}
|
|
1480
1698
|
/** Parameters for creating a custom field. */
|
|
1481
1699
|
interface CustomFieldCreateParams {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
required?: boolean;
|
|
1700
|
+
contentType: CustomFieldContentType;
|
|
1701
|
+
label: string;
|
|
1702
|
+
/** Defaults to `text`. */
|
|
1703
|
+
fieldType?: CustomFieldType;
|
|
1704
|
+
defaultValue?: string;
|
|
1488
1705
|
options?: string[];
|
|
1706
|
+
minValue?: number;
|
|
1707
|
+
maxValue?: number;
|
|
1708
|
+
required?: boolean;
|
|
1489
1709
|
}
|
|
1490
|
-
/** Parameters for updating a custom field. */
|
|
1710
|
+
/** Parameters for updating a custom field. `contentType` cannot change. */
|
|
1491
1711
|
interface CustomFieldUpdateParams {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1712
|
+
label?: string;
|
|
1713
|
+
fieldType?: CustomFieldType;
|
|
1714
|
+
defaultValue?: string | null;
|
|
1495
1715
|
options?: string[];
|
|
1716
|
+
minValue?: number | null;
|
|
1717
|
+
maxValue?: number | null;
|
|
1718
|
+
required?: boolean;
|
|
1719
|
+
sortOrder?: number;
|
|
1496
1720
|
}
|
|
1497
1721
|
|
|
1498
1722
|
/** Manage custom field definitions. */
|
|
1499
1723
|
declare class CustomFieldsResource {
|
|
1500
1724
|
private readonly client;
|
|
1501
1725
|
constructor(client: HttpClient);
|
|
1502
|
-
/** List custom
|
|
1726
|
+
/** List custom field definitions, optionally for one record type. There is no single-field GET. */
|
|
1503
1727
|
list(params?: CustomFieldListParams): Promise<ListResponse<CustomField>>;
|
|
1504
|
-
/** Get a single custom field. */
|
|
1505
|
-
get(fieldId: string): Promise<ApiResponse<CustomField>>;
|
|
1506
1728
|
/** Create a custom field. */
|
|
1507
1729
|
create(params: CustomFieldCreateParams, options?: RequestOptions): Promise<ApiResponse<CustomField>>;
|
|
1508
1730
|
/** Update a custom field. */
|
|
@@ -1510,51 +1732,42 @@ declare class CustomFieldsResource {
|
|
|
1510
1732
|
/** Delete a custom field. */
|
|
1511
1733
|
del(fieldId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1512
1734
|
/** Reorder custom fields within a content type. */
|
|
1513
|
-
reorder(contentType:
|
|
1735
|
+
reorder(contentType: CustomFieldContentType, orderedIds: string[]): Promise<{
|
|
1514
1736
|
success: true;
|
|
1515
1737
|
reordered: number;
|
|
1516
1738
|
}>;
|
|
1517
1739
|
}
|
|
1518
1740
|
|
|
1519
|
-
/**
|
|
1741
|
+
/**
|
|
1742
|
+
* An SLA rule. Rules are stored in order on the team's SLA settings, so
|
|
1743
|
+
* there is no per-rule timestamp.
|
|
1744
|
+
*/
|
|
1520
1745
|
interface SlaRule {
|
|
1521
1746
|
id: string;
|
|
1522
|
-
object: 'sla_rule';
|
|
1523
1747
|
name: string;
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1748
|
+
/** Ticket priority key this rule applies to (for example `critical`). */
|
|
1749
|
+
priorityKey: string;
|
|
1750
|
+
/** First-response target in minutes. */
|
|
1751
|
+
responseTimeMinutes: number;
|
|
1752
|
+
/** Resolution target in minutes. */
|
|
1753
|
+
resolutionTimeMinutes: number;
|
|
1754
|
+
/** Count every hour instead of only business hours. */
|
|
1755
|
+
use24x7: boolean;
|
|
1529
1756
|
enabled: boolean;
|
|
1530
|
-
position: number;
|
|
1531
|
-
createdAt: string;
|
|
1532
|
-
updatedAt: string;
|
|
1533
|
-
}
|
|
1534
|
-
/** Parameters for listing SLA rules. */
|
|
1535
|
-
interface SlaRuleListParams extends PaginationParams {
|
|
1536
|
-
enabled?: boolean;
|
|
1537
1757
|
}
|
|
1538
1758
|
/** Parameters for creating an SLA rule. */
|
|
1539
1759
|
interface SlaRuleCreateParams {
|
|
1540
1760
|
name: string;
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1761
|
+
priorityKey: string;
|
|
1762
|
+
responseTimeMinutes: number;
|
|
1763
|
+
resolutionTimeMinutes: number;
|
|
1764
|
+
/** Defaults to false (business hours only). */
|
|
1765
|
+
use24x7?: boolean;
|
|
1766
|
+
/** Defaults to true. */
|
|
1546
1767
|
enabled?: boolean;
|
|
1547
1768
|
}
|
|
1548
1769
|
/** Parameters for updating an SLA rule. */
|
|
1549
|
-
|
|
1550
|
-
name?: string;
|
|
1551
|
-
description?: string;
|
|
1552
|
-
priority?: string;
|
|
1553
|
-
responseTarget?: number;
|
|
1554
|
-
resolutionTarget?: number;
|
|
1555
|
-
businessHoursOnly?: boolean;
|
|
1556
|
-
enabled?: boolean;
|
|
1557
|
-
}
|
|
1770
|
+
type SlaRuleUpdateParams = Partial<SlaRuleCreateParams>;
|
|
1558
1771
|
/** Parameters for SLA metrics query. */
|
|
1559
1772
|
interface SlaMetricsParams {
|
|
1560
1773
|
period?: 'day' | 'week' | 'month' | 'quarter';
|
|
@@ -1573,8 +1786,8 @@ interface SlaMetrics {
|
|
|
1573
1786
|
declare class SlaResource {
|
|
1574
1787
|
private readonly client;
|
|
1575
1788
|
constructor(client: HttpClient);
|
|
1576
|
-
/** List SLA rules. */
|
|
1577
|
-
list(
|
|
1789
|
+
/** List SLA rules in evaluation order. */
|
|
1790
|
+
list(): Promise<ListResponse<SlaRule>>;
|
|
1578
1791
|
/** Create an SLA rule. */
|
|
1579
1792
|
create(params: SlaRuleCreateParams, options?: RequestOptions): Promise<ApiResponse<SlaRule>>;
|
|
1580
1793
|
/** Update an SLA rule. */
|
|
@@ -1792,6 +2005,12 @@ interface ExportResult {
|
|
|
1792
2005
|
/** Included when the selected tickets have messages. */
|
|
1793
2006
|
messages?: Record<string, unknown>[];
|
|
1794
2007
|
summary: Partial<Record<ExportResourceType | 'messages', number>>;
|
|
2008
|
+
/**
|
|
2009
|
+
* Resources cut off at the limit: 10,000 rows per resource, 50,000
|
|
2010
|
+
* messages. Empty when the export is complete. Narrow with `filters`
|
|
2011
|
+
* (for example `createdAfter`) to export the rest.
|
|
2012
|
+
*/
|
|
2013
|
+
truncated: Array<ExportResourceType | 'messages'>;
|
|
1795
2014
|
}
|
|
1796
2015
|
|
|
1797
2016
|
/** Import request parameters. */
|
|
@@ -1833,12 +2052,15 @@ interface ImportResult {
|
|
|
1833
2052
|
updated: number;
|
|
1834
2053
|
skipped: number;
|
|
1835
2054
|
failed: number;
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2055
|
+
/** Rows that failed, as "Row N: ..." lines (a status or sentiment outside the team's keys lists the allowed ones). */
|
|
2056
|
+
errors?: string[];
|
|
2057
|
+
/** Rows saved with something missing (e.g. no customer link) or skipped as duplicates, as "Row N: ..." lines. */
|
|
2058
|
+
warnings?: string[];
|
|
2059
|
+
/** The rows created by this import: the 1-based row number and the prefixed id (tkt_, cus_, art_). */
|
|
2060
|
+
createdIds: Array<{
|
|
2061
|
+
rowIndex: number;
|
|
2062
|
+
id: string;
|
|
1839
2063
|
}>;
|
|
1840
|
-
/** IDs of the rows created by this import. */
|
|
1841
|
-
createdIds: string[];
|
|
1842
2064
|
}
|
|
1843
2065
|
/** Import log entry. */
|
|
1844
2066
|
interface ImportLog {
|
|
@@ -1946,27 +2168,65 @@ declare class SearchResource {
|
|
|
1946
2168
|
query(params: SearchParams): Promise<SearchResponse>;
|
|
1947
2169
|
}
|
|
1948
2170
|
|
|
1949
|
-
/**
|
|
2171
|
+
/** Entity types that carry tags. */
|
|
2172
|
+
type TagEntity = 'tickets' | 'customers' | 'articles';
|
|
2173
|
+
/** One tag on one entity type, with how many records carry it. */
|
|
1950
2174
|
interface Tag {
|
|
1951
|
-
|
|
1952
|
-
|
|
2175
|
+
tag: string;
|
|
2176
|
+
entity: TagEntity;
|
|
1953
2177
|
count: number;
|
|
1954
2178
|
}
|
|
1955
2179
|
/** Parameters for listing tags. */
|
|
1956
|
-
interface TagListParams
|
|
2180
|
+
interface TagListParams {
|
|
2181
|
+
/** Only tags on this entity type. Omit for all three. */
|
|
2182
|
+
entity?: TagEntity;
|
|
2183
|
+
/** Case-insensitive substring filter on the tag name. */
|
|
1957
2184
|
search?: string;
|
|
1958
2185
|
}
|
|
2186
|
+
/** Parameters for merging one tag into another. */
|
|
2187
|
+
interface TagMergeParams {
|
|
2188
|
+
/** Tag to replace. */
|
|
2189
|
+
fromTag: string;
|
|
2190
|
+
/** Tag that replaces it. */
|
|
2191
|
+
toTag: string;
|
|
2192
|
+
/** Only merge on this entity type. Omit for all three. */
|
|
2193
|
+
entity?: TagEntity;
|
|
2194
|
+
}
|
|
2195
|
+
/** Result of a tag merge. */
|
|
2196
|
+
interface TagMergeResult {
|
|
2197
|
+
/** Number of records whose tags changed. */
|
|
2198
|
+
merged: number;
|
|
2199
|
+
fromTag: string;
|
|
2200
|
+
toTag: string;
|
|
2201
|
+
}
|
|
2202
|
+
/** Result of removing a tag. */
|
|
2203
|
+
interface TagRemoveResult {
|
|
2204
|
+
deleted: true;
|
|
2205
|
+
tag: string;
|
|
2206
|
+
/** Number of records the tag was removed from. */
|
|
2207
|
+
removedFrom: number;
|
|
2208
|
+
}
|
|
1959
2209
|
|
|
1960
|
-
/**
|
|
2210
|
+
/**
|
|
2211
|
+
* Manage tags across tickets, customers and articles. Tags exist only on the
|
|
2212
|
+
* records that carry them, so there is no create call: add a tag by updating
|
|
2213
|
+
* a record's `tags`.
|
|
2214
|
+
*/
|
|
1961
2215
|
declare class TagsResource {
|
|
1962
2216
|
private readonly client;
|
|
1963
2217
|
constructor(client: HttpClient);
|
|
1964
|
-
/** List
|
|
2218
|
+
/** List tags with usage counts, one row per tag and entity type. */
|
|
1965
2219
|
list(params?: TagListParams): Promise<ListResponse<Tag>>;
|
|
1966
|
-
/**
|
|
1967
|
-
|
|
1968
|
-
/**
|
|
1969
|
-
|
|
2220
|
+
/** Replace `fromTag` with `toTag` on every record that carries it. */
|
|
2221
|
+
merge(params: TagMergeParams, options?: RequestOptions): Promise<TagMergeResult>;
|
|
2222
|
+
/** Remove a tag from every record that carries it. */
|
|
2223
|
+
remove(tag: string, params?: {
|
|
2224
|
+
entity?: TagEntity;
|
|
2225
|
+
}): Promise<TagRemoveResult>;
|
|
2226
|
+
/** @deprecated Use `remove()`. */
|
|
2227
|
+
del(tag: string, params?: {
|
|
2228
|
+
entity?: TagEntity;
|
|
2229
|
+
}): Promise<TagRemoveResult>;
|
|
1970
2230
|
}
|
|
1971
2231
|
|
|
1972
2232
|
/** An activity/timeline event. */
|
|
@@ -2150,16 +2410,21 @@ interface BossDefeat {
|
|
|
2150
2410
|
/** Parameters for listing boss defeats. */
|
|
2151
2411
|
interface BossDefeatListParams extends PaginationParams {
|
|
2152
2412
|
}
|
|
2153
|
-
/**
|
|
2413
|
+
/**
|
|
2414
|
+
* Parameters for summoning a boss. A boss comes from a rush of customer
|
|
2415
|
+
* tickets; the server counts them and picks the difficulty.
|
|
2416
|
+
*/
|
|
2154
2417
|
interface BossSpawnParams {
|
|
2418
|
+
/** @deprecated Ignored: difficulty follows the customer-ticket count. */
|
|
2155
2419
|
difficulty?: 'easy' | 'medium' | 'hard';
|
|
2156
2420
|
}
|
|
2157
2421
|
/** Parameters for dealing boss damage. */
|
|
2158
2422
|
interface BossDamageParams {
|
|
2423
|
+
/** A closed customer ticket (widget, email or API). Each ticket hits once. */
|
|
2424
|
+
ticketId: string;
|
|
2159
2425
|
/** Defaults to the API key's creator. */
|
|
2160
2426
|
userId?: string;
|
|
2161
2427
|
userName?: string;
|
|
2162
|
-
priority?: 'low' | 'normal' | 'high' | 'urgent';
|
|
2163
2428
|
}
|
|
2164
2429
|
/** Leaderboard entry. */
|
|
2165
2430
|
interface LeaderboardEntry {
|
|
@@ -2200,13 +2465,15 @@ interface AchievementListParams extends PaginationParams {
|
|
|
2200
2465
|
/** A daily quest. */
|
|
2201
2466
|
interface Quest {
|
|
2202
2467
|
questId: string;
|
|
2468
|
+
/** Display title, for example `Ticket Tackler`. */
|
|
2203
2469
|
name: string;
|
|
2204
2470
|
description: string | null;
|
|
2205
|
-
|
|
2471
|
+
/** `easy`, `medium` or `hard`; null for a quest cStar no longer offers. */
|
|
2472
|
+
difficulty: string | null;
|
|
2206
2473
|
progress: number;
|
|
2207
2474
|
target: number;
|
|
2208
2475
|
completed: boolean;
|
|
2209
|
-
|
|
2476
|
+
/** XP and gold that completing the quest pays. */
|
|
2210
2477
|
xpReward: number;
|
|
2211
2478
|
goldReward: number;
|
|
2212
2479
|
}
|
|
@@ -2217,20 +2484,15 @@ interface QuestList {
|
|
|
2217
2484
|
completedToday: number;
|
|
2218
2485
|
totalQuests: number;
|
|
2219
2486
|
allComplete: boolean;
|
|
2220
|
-
completionBonus: {
|
|
2221
|
-
xp: number;
|
|
2222
|
-
gold: number;
|
|
2223
|
-
} | null;
|
|
2224
2487
|
resetsAt: string;
|
|
2225
2488
|
}
|
|
2226
|
-
/** Completed quests grouped by day. */
|
|
2489
|
+
/** Completed quests grouped by game day (UTC), newest first. */
|
|
2227
2490
|
interface QuestHistory {
|
|
2228
2491
|
object: 'quest_history';
|
|
2229
2492
|
history: Array<{
|
|
2493
|
+
/** Game day the quests were completed, `YYYY-MM-DD` (UTC). */
|
|
2230
2494
|
date: string;
|
|
2231
|
-
quests: Array<Pick<Quest, 'questId' | 'name' | 'difficulty' | 'xpReward' | 'goldReward'
|
|
2232
|
-
completedAt: string;
|
|
2233
|
-
}>;
|
|
2495
|
+
quests: Array<Pick<Quest, 'questId' | 'name' | 'difficulty' | 'xpReward' | 'goldReward'>>;
|
|
2234
2496
|
completedCount: number;
|
|
2235
2497
|
}>;
|
|
2236
2498
|
totalCompleted: number;
|
|
@@ -2252,7 +2514,8 @@ interface Puzzle {
|
|
|
2252
2514
|
}
|
|
2253
2515
|
/** Puzzle completion parameters. */
|
|
2254
2516
|
interface PuzzleCompleteParams {
|
|
2255
|
-
|
|
2517
|
+
/** Defaults to the API key's user; if sent, it must be that user. */
|
|
2518
|
+
userId?: string;
|
|
2256
2519
|
puzzleId: string;
|
|
2257
2520
|
timeSeconds: number;
|
|
2258
2521
|
mistakes?: number;
|
|
@@ -2331,7 +2594,11 @@ interface OneUp {
|
|
|
2331
2594
|
wasFree: boolean;
|
|
2332
2595
|
createdAt: string;
|
|
2333
2596
|
}
|
|
2334
|
-
/**
|
|
2597
|
+
/**
|
|
2598
|
+
* Sending a one-up also returns the remaining allowance and rewards. The base
|
|
2599
|
+
* reward (10 XP and 5 gold) is paid once per sender and recipient each UTC
|
|
2600
|
+
* day, so repeat sends report 0 XP. Gifted gold is always paid.
|
|
2601
|
+
*/
|
|
2335
2602
|
interface OneUpSendResult extends OneUp {
|
|
2336
2603
|
freeRemaining: number;
|
|
2337
2604
|
recipientXpAwarded: number;
|
|
@@ -2342,21 +2609,28 @@ interface OneUpListParams {
|
|
|
2342
2609
|
userId?: string;
|
|
2343
2610
|
limit?: number;
|
|
2344
2611
|
}
|
|
2345
|
-
/** Parameters for sending a one-up. */
|
|
2612
|
+
/** Parameters for sending a one-up. The sender is always the API key's creator. */
|
|
2346
2613
|
interface OneUpCreateParams {
|
|
2347
|
-
/**
|
|
2614
|
+
/** @deprecated The sender is always the API key's creator. A different value is rejected. */
|
|
2348
2615
|
senderId?: string;
|
|
2616
|
+
/** @deprecated Ignored. The server reads names from the team. */
|
|
2349
2617
|
senderName?: string;
|
|
2618
|
+
/** A member of the same team. */
|
|
2350
2619
|
recipientId: string;
|
|
2620
|
+
/** @deprecated Ignored. The server reads names from the team. */
|
|
2351
2621
|
recipientName?: string;
|
|
2622
|
+
/** Up to 140 characters. Longer messages are cut. */
|
|
2352
2623
|
message?: string;
|
|
2624
|
+
/** Gold to gift, from 0 to 100, taken from the sender. Live keys only. */
|
|
2353
2625
|
goldAmount?: number;
|
|
2354
2626
|
}
|
|
2355
|
-
/** Remaining one-ups
|
|
2627
|
+
/** Remaining free one-ups today. The limit includes the Social Butterfly skill bonus. */
|
|
2356
2628
|
interface OneUpRemaining {
|
|
2357
2629
|
object: 'one_up_remaining';
|
|
2358
2630
|
remaining: number;
|
|
2359
2631
|
limit: number;
|
|
2632
|
+
sentToday: number;
|
|
2633
|
+
/** The next UTC midnight. */
|
|
2360
2634
|
resetsAt: string;
|
|
2361
2635
|
}
|
|
2362
2636
|
/** A high five (kudos between teams). */
|
|
@@ -2385,11 +2659,8 @@ interface HighFiveListParams {
|
|
|
2385
2659
|
/** Parameters for sending a high five. */
|
|
2386
2660
|
interface HighFiveCreateParams {
|
|
2387
2661
|
recipientTeamId: string;
|
|
2388
|
-
|
|
2389
|
-
/** Defaults to the API key's creator. */
|
|
2662
|
+
/** Defaults to the API key's user; if sent, it must be that user. Names come from cStar. */
|
|
2390
2663
|
senderUserId?: string;
|
|
2391
|
-
senderUserName?: string;
|
|
2392
|
-
senderTeamName?: string;
|
|
2393
2664
|
message?: string;
|
|
2394
2665
|
}
|
|
2395
2666
|
/** Can-send check result. */
|
|
@@ -2809,20 +3080,33 @@ interface ViewExecuteParams extends PaginationParams {
|
|
|
2809
3080
|
/** Manage saved views (saved filters). */
|
|
2810
3081
|
declare class ViewsResource extends BaseResource<SavedView, ViewListParams, ViewCreateParams, ViewUpdateParams> {
|
|
2811
3082
|
constructor(client: HttpClient);
|
|
2812
|
-
/** Execute a view
|
|
3083
|
+
/** Execute a view and return the filtered results. The server uses the view's entity_type to determine which table to query. */
|
|
2813
3084
|
execute(viewId: string, params?: ViewExecuteParams): Promise<ListResponse<unknown>>;
|
|
2814
3085
|
}
|
|
2815
3086
|
|
|
2816
3087
|
/** Subscription status. */
|
|
2817
3088
|
interface Subscription {
|
|
2818
3089
|
object: 'subscription';
|
|
3090
|
+
teamId: string;
|
|
3091
|
+
teamName: string;
|
|
3092
|
+
/** The team's subscription status, for example `trialing` or `active`; `inactive` when it has none. */
|
|
2819
3093
|
status: string;
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
3094
|
+
isTrialing: boolean;
|
|
3095
|
+
/** When the trial ends; null when there is none, including a team that never had one. */
|
|
3096
|
+
trialEndsAt: string | null;
|
|
3097
|
+
/** True while the team has no active subscription: reads work, writes return 402 `team_paused`. */
|
|
3098
|
+
paused: boolean;
|
|
3099
|
+
/** Why the team is paused; null when it isn't. */
|
|
3100
|
+
pausedReason: 'trial_ended' | 'no_trial' | 'payment_failed' | 'canceled' | 'payment_required' | null;
|
|
3101
|
+
/** When the team and its data are deleted (the whole named UTC day is safe), or null. */
|
|
3102
|
+
scheduledDeletionAt: string | null;
|
|
3103
|
+
/** Paid seats: every member, with up to 3 spectators free (minimum 1). */
|
|
3104
|
+
seatCount: number;
|
|
3105
|
+
/** Human members on the team (AI agents are free and not counted). */
|
|
2824
3106
|
memberCount: number;
|
|
2825
|
-
|
|
3107
|
+
hasStripeCustomer: boolean;
|
|
3108
|
+
hasActiveSubscription: boolean;
|
|
3109
|
+
createdAt: string;
|
|
2826
3110
|
}
|
|
2827
3111
|
/** Billing portal result. */
|
|
2828
3112
|
interface BillingPortal {
|
|
@@ -2930,7 +3214,11 @@ declare class OfflineQueue {
|
|
|
2930
3214
|
|
|
2931
3215
|
/** Configuration for the CStarClient. */
|
|
2932
3216
|
interface CStarClientConfig {
|
|
2933
|
-
/**
|
|
3217
|
+
/**
|
|
3218
|
+
* Your secret API key (sk_live_* or sk_test_*). Team endpoints refuse
|
|
3219
|
+
* publishable keys (pk_*) with 403: publishable_key_forbidden on reads,
|
|
3220
|
+
* publishable_key_write on writes.
|
|
3221
|
+
*/
|
|
2934
3222
|
apiKey: string;
|
|
2935
3223
|
/** Your team ID. */
|
|
2936
3224
|
teamId: string;
|
|
@@ -3065,7 +3353,12 @@ declare class CStarClient {
|
|
|
3065
3353
|
keyType: 'secret' | 'publishable';
|
|
3066
3354
|
environment: 'live' | 'test';
|
|
3067
3355
|
createdAt: string;
|
|
3068
|
-
|
|
3356
|
+
/** Secret keys only, like GET /billing/subscription. */
|
|
3357
|
+
subscriptionStatus?: string;
|
|
3358
|
+
/** Secret keys only: true while the team has no active subscription (writes return 402 `team_paused`). */
|
|
3359
|
+
paused?: boolean;
|
|
3360
|
+
/** Secret keys only: why the team is paused; null when it isn't. */
|
|
3361
|
+
pausedReason?: 'trial_ended' | 'no_trial' | 'payment_failed' | 'canceled' | 'payment_required' | null;
|
|
3069
3362
|
}>;
|
|
3070
3363
|
/**
|
|
3071
3364
|
* Side-channel metadata from the most recent HTTP response. Holds the
|
|
@@ -3081,4 +3374,4 @@ declare class CStarClient {
|
|
|
3081
3374
|
get lastMeta(): LastMeta;
|
|
3082
3375
|
}
|
|
3083
3376
|
|
|
3084
|
-
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, 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, CStarClient, type CStarClientConfig, CStarRealtime, 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 CosmeticListParams, type CosmeticPreferences, type CsatSettings, type CsatSettingsUpdateParams, type CsatStats, type CsatSurvey, type CsatSurveyCreateParams, type CsatSurveyListParams, type CurrentSeason, 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, type EventHandler, type ExportCreateParams, type ExportCsvParams, type ExportFilters, type ExportJsonParams, type ExportResourceType, 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 MessageListParams, type Metadata, type Notification, type NotificationListParams, OfflineQueue, type OfflineQueueOptions, type OneUp, type OneUpCreateParams, type OneUpListParams, type OneUpRemaining, type OneUpSendResult, type PaginationInfo, type PaginationParams, type Player, type Puzzle, type PuzzleCompleteParams, type PuzzleCompleteResult, type PuzzleLeaderboardParams, type PuzzleLeaderboardResult, type PuzzleStreak, type Quest, type QuestHistory, type QuestHistoryParams, type QuestList, type QueueItem, type QueueResult, type QuickReply, type QuickReplyCreateParams, type QuickReplyUpdateParams, type RealtimeEvent, type RealtimeOptions, type RequestOptions, type SavedView, type SearchParams, type SearchResponse, type SearchResult, type Season, type SeasonStats, type SkillAllocateParams, type SkillAllocateResult, type SkillTree, type SlaMetrics, type SlaMetricsParams, type SlaRule, type SlaRuleCreateParams, type
|
|
3377
|
+
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, type Attachment, type AttachmentBucket, type AttachmentDownloadUrl, type AttachmentGetParams, 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, CStarClient, type CStarClientConfig, CStarRealtime, 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 CosmeticListParams, type CosmeticPreferences, type CsatSettings, type CsatSettingsUpdateParams, type CsatStats, type CsatSurvey, type CsatSurveyCreateParams, type CsatSurveyListParams, type CurrentSeason, type CustomField, type CustomFieldContentType, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldType, 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, type EventHandler, type ExportCreateParams, type ExportCsvParams, type ExportFilters, type ExportJsonParams, type ExportResourceType, 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 MessageListParams, type Metadata, type Notification, type NotificationListParams, OfflineQueue, type OfflineQueueOptions, type OneUp, type OneUpCreateParams, type OneUpListParams, type OneUpRemaining, type OneUpSendResult, type PaginationInfo, type PaginationParams, type Player, type Puzzle, type PuzzleCompleteParams, type PuzzleCompleteResult, type PuzzleLeaderboardParams, type PuzzleLeaderboardResult, type PuzzleStreak, type Quest, type QuestHistory, type QuestHistoryParams, type QuestList, type QueueItem, type QueueResult, type QuickReply, type QuickReplyCreateParams, type QuickReplyUpdateParams, type RealtimeEvent, type RealtimeOptions, type RequestOptions, type SavedView, type SearchParams, type SearchResponse, type SearchResult, type Season, type SeasonStats, type SkillAllocateParams, type SkillAllocateResult, type SkillTree, type SlaMetrics, type SlaMetricsParams, type SlaRule, type SlaRuleCreateParams, type SlaRuleUpdateParams, type StatusCreateParams, type StatusUpdateParams, Subscription$1 as Subscription, type Tag, type TagEntity, type TagListParams, type TagMergeParams, type TagMergeResult, type TagRemoveResult, type TeamSettings, type TeamSettingsUpdateParams, type Ticket, type TicketCreateParams, type TicketCustomFieldValues, type TicketCustomerSummary, type TicketListParams, type TicketPriorityKey, type TicketSeedMessage, type TicketStatus, type TicketStatusKey, type TicketUpdateParams, type TopicCustomField, type UnreadCount, type ViewCreateParams, type ViewExecuteParams, type ViewListParams, type ViewUpdateParams, type Webhook, type WebhookCreateParams, type WebhookEventData, WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetEntrance, type WidgetEntranceCustom, type WidgetEntranceEffect, type WidgetEntranceKeyframe, type WidgetEntranceParticles, type WidgetSettings, type WidgetSettingsUpdateParams };
|