@cstar.help/js 0.18.2 → 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.
- package/README.md +9 -3
- package/dist/auth/index.cjs +16 -13
- package/dist/auth/index.d.cts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +16 -13
- package/dist/chat/index.d.cts +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/community/index.cjs +16 -13
- package/dist/community/index.d.cts +1 -1
- package/dist/community/index.d.ts +1 -1
- package/dist/community/index.js +16 -13
- package/dist/{errors-bW8CwTn4.d.cts → errors-BnUUTVlT.d.cts} +2 -1
- package/dist/{errors-bW8CwTn4.d.ts → errors-BnUUTVlT.d.ts} +2 -1
- package/dist/index.cjs +266 -117
- package/dist/index.d.cts +161 -60
- package/dist/index.d.ts +161 -60
- package/dist/index.js +266 -117
- package/dist/library/index.cjs +16 -13
- package/dist/library/index.d.cts +1 -1
- package/dist/library/index.d.ts +1 -1
- package/dist/library/index.js +16 -13
- package/dist/quickhelp/index.cjs +20 -15
- package/dist/quickhelp/index.d.cts +26 -2
- package/dist/quickhelp/index.d.ts +26 -2
- package/dist/quickhelp/index.js +20 -15
- 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-Lqpsj935.d.cts → webhookEvents-YQer37My.d.cts} +208 -83
- package/dist/{webhookEvents-Lqpsj935.d.ts → webhookEvents-YQer37My.d.ts} +208 -83
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var ErrorType = {
|
|
|
10
10
|
API_ERROR: "api_error",
|
|
11
11
|
SERVER_ERROR: "server_error"
|
|
12
12
|
};
|
|
13
|
-
var DEFAULT_DOC_URL = "https://cstar.help/developers/
|
|
13
|
+
var DEFAULT_DOC_URL = "https://www.cstar.help/developers/errors";
|
|
14
14
|
function normalizeArgs(messageOrStatus, maybeBody, defaults) {
|
|
15
15
|
if (typeof messageOrStatus === "string") {
|
|
16
16
|
return {
|
|
@@ -53,7 +53,7 @@ var CStarAuthenticationErrorImpl = class extends CStarErrorImpl {
|
|
|
53
53
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
54
54
|
type: ErrorType.AUTHENTICATION_ERROR,
|
|
55
55
|
code: "authentication_failed",
|
|
56
|
-
doc_url: `${DEFAULT_DOC_URL}#authentication-
|
|
56
|
+
doc_url: `${DEFAULT_DOC_URL}#authentication-errors`
|
|
57
57
|
});
|
|
58
58
|
super(statusCode, resolved);
|
|
59
59
|
this.name = "CStarAuthenticationError";
|
|
@@ -64,11 +64,11 @@ var CStarRateLimitErrorImpl = class extends CStarErrorImpl {
|
|
|
64
64
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
65
65
|
type: ErrorType.RATE_LIMIT_ERROR,
|
|
66
66
|
code: "rate_limit_exceeded",
|
|
67
|
-
doc_url: `${DEFAULT_DOC_URL}#
|
|
67
|
+
doc_url: `${DEFAULT_DOC_URL}#rate_limit_exceeded`
|
|
68
68
|
});
|
|
69
69
|
super(statusCode === 0 ? 429 : statusCode, resolved);
|
|
70
70
|
this.name = "CStarRateLimitError";
|
|
71
|
-
this.retryAfter = retryAfter
|
|
71
|
+
this.retryAfter = retryAfter;
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
var CStarNotFoundErrorImpl = class extends CStarErrorImpl {
|
|
@@ -76,7 +76,7 @@ var CStarNotFoundErrorImpl = class extends CStarErrorImpl {
|
|
|
76
76
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
77
77
|
type: ErrorType.NOT_FOUND_ERROR,
|
|
78
78
|
code: "resource_not_found",
|
|
79
|
-
doc_url: `${DEFAULT_DOC_URL}#
|
|
79
|
+
doc_url: `${DEFAULT_DOC_URL}#resource_not_found`
|
|
80
80
|
});
|
|
81
81
|
super(statusCode, resolved);
|
|
82
82
|
this.name = "CStarNotFoundError";
|
|
@@ -87,7 +87,7 @@ var CStarValidationErrorImpl = class extends CStarErrorImpl {
|
|
|
87
87
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
88
88
|
type: ErrorType.INVALID_REQUEST_ERROR,
|
|
89
89
|
code: "validation_error",
|
|
90
|
-
doc_url: `${DEFAULT_DOC_URL}#
|
|
90
|
+
doc_url: `${DEFAULT_DOC_URL}#invalid-request-errors`
|
|
91
91
|
});
|
|
92
92
|
super(statusCode, resolved);
|
|
93
93
|
this.name = "CStarValidationError";
|
|
@@ -98,7 +98,7 @@ var CStarPermissionErrorImpl = class extends CStarErrorImpl {
|
|
|
98
98
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
99
99
|
type: ErrorType.PERMISSION_ERROR,
|
|
100
100
|
code: "permission_denied",
|
|
101
|
-
doc_url: `${DEFAULT_DOC_URL}#
|
|
101
|
+
doc_url: `${DEFAULT_DOC_URL}#insufficient_permissions`
|
|
102
102
|
});
|
|
103
103
|
super(statusCode, resolved);
|
|
104
104
|
this.name = "CStarPermissionError";
|
|
@@ -109,7 +109,7 @@ var CStarConflictErrorImpl = class extends CStarErrorImpl {
|
|
|
109
109
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
110
110
|
type: ErrorType.CONFLICT_ERROR,
|
|
111
111
|
code: "conflict",
|
|
112
|
-
doc_url: `${DEFAULT_DOC_URL}#
|
|
112
|
+
doc_url: `${DEFAULT_DOC_URL}#resource_conflict`
|
|
113
113
|
});
|
|
114
114
|
super(statusCode, resolved);
|
|
115
115
|
this.name = "CStarConflictError";
|
|
@@ -120,7 +120,7 @@ var CStarServerErrorImpl = class extends CStarErrorImpl {
|
|
|
120
120
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
121
121
|
type: ErrorType.SERVER_ERROR,
|
|
122
122
|
code: "server_error",
|
|
123
|
-
doc_url: `${DEFAULT_DOC_URL}#server-
|
|
123
|
+
doc_url: `${DEFAULT_DOC_URL}#server-errors`
|
|
124
124
|
});
|
|
125
125
|
super(statusCode, resolved);
|
|
126
126
|
this.name = "CStarServerError";
|
|
@@ -131,7 +131,7 @@ var CStarFeatureDisabledErrorImpl = class extends CStarErrorImpl {
|
|
|
131
131
|
const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
|
|
132
132
|
type: ErrorType.FEATURE_NOT_CONFIGURED,
|
|
133
133
|
code: "feature_not_configured",
|
|
134
|
-
doc_url: `${DEFAULT_DOC_URL}#
|
|
134
|
+
doc_url: `${DEFAULT_DOC_URL}#feature_disabled`
|
|
135
135
|
});
|
|
136
136
|
super(statusCode, resolved);
|
|
137
137
|
this.name = "CStarFeatureDisabledError";
|
|
@@ -141,12 +141,12 @@ var CStarFeatureDisabledErrorImpl = class extends CStarErrorImpl {
|
|
|
141
141
|
};
|
|
142
142
|
var CStarRealtimeUnavailableErrorImpl = class extends CStarErrorImpl {
|
|
143
143
|
constructor(message) {
|
|
144
|
-
const resolved = message ?? "EventSource is not available in this environment. Real-time subscriptions only work in the browser. Move the call to a client-only path (`useEffect` / `onMount`), or pass an `eventSource` polyfill via the realtime options. See https://cstar.help/developers/sdk/realtime#ssr";
|
|
144
|
+
const resolved = message ?? "EventSource is not available in this environment. Real-time subscriptions only work in the browser. Move the call to a client-only path (`useEffect` / `onMount`), or pass an `eventSource` polyfill via the realtime options. See https://www.cstar.help/developers/sdk/js/realtime#ssr";
|
|
145
145
|
super(0, {
|
|
146
146
|
type: ErrorType.API_ERROR,
|
|
147
147
|
code: "realtime_unavailable",
|
|
148
148
|
message: resolved,
|
|
149
|
-
doc_url: "https://cstar.help/developers/sdk/realtime#ssr"
|
|
149
|
+
doc_url: "https://www.cstar.help/developers/sdk/js/realtime#ssr"
|
|
150
150
|
});
|
|
151
151
|
this.name = "CStarRealtimeUnavailableError";
|
|
152
152
|
}
|
|
@@ -222,7 +222,10 @@ function parseError(statusCode, body, retryAfter) {
|
|
|
222
222
|
doc_url: DEFAULT_DOC_URL
|
|
223
223
|
};
|
|
224
224
|
if (statusCode === 429) {
|
|
225
|
-
return new CStarRateLimitError(statusCode, errorBody, retryAfter
|
|
225
|
+
return new CStarRateLimitError(statusCode, errorBody, retryAfter);
|
|
226
|
+
}
|
|
227
|
+
if (errorBody.code === "feature_disabled") {
|
|
228
|
+
return new CStarFeatureDisabledError(statusCode, errorBody);
|
|
226
229
|
}
|
|
227
230
|
const StatusCls = STATUS_TO_CLASS[statusCode];
|
|
228
231
|
if (StatusCls) {
|
|
@@ -237,7 +240,7 @@ function parseError(statusCode, body, retryAfter) {
|
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
// src/client.ts
|
|
240
|
-
var SDK_VERSION = "0.18.
|
|
243
|
+
var SDK_VERSION = "0.18.4";
|
|
241
244
|
var DEFAULT_BASE_URL = "https://www.cstar.help";
|
|
242
245
|
var DEFAULT_API_VERSION = "2026-03-01";
|
|
243
246
|
var DEFAULT_MAX_RETRIES = 3;
|
|
@@ -257,7 +260,7 @@ var HttpClient = class {
|
|
|
257
260
|
this.lastMeta = { requestId: null, timestamp: null, pagination: null };
|
|
258
261
|
if (!config || typeof config.apiKey !== "string" || config.apiKey.length === 0) {
|
|
259
262
|
throw new Error(
|
|
260
|
-
"[cStar] CStarClient: apiKey is required. Pass a secret key (sk_live_... / sk_test_...). Publishable keys (pk_...) cannot read team endpoints; use them with LibraryClient or CommunityClient. See https://cstar.help/developers/quickstart"
|
|
263
|
+
"[cStar] CStarClient: apiKey is required. Pass a secret key (sk_live_... / sk_test_...). Publishable keys (pk_...) cannot read team endpoints; use them with LibraryClient or CommunityClient. See https://www.cstar.help/developers/quickstart"
|
|
261
264
|
);
|
|
262
265
|
}
|
|
263
266
|
if (typeof config.teamId !== "string" || config.teamId.length === 0) {
|
|
@@ -320,7 +323,7 @@ var HttpClient = class {
|
|
|
320
323
|
let inProgressWaitMs = null;
|
|
321
324
|
for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
|
|
322
325
|
if (attempt > 0 && lastError) {
|
|
323
|
-
const delay = inProgressWaitMs ?? (lastError instanceof CStarRateLimitError ? Math.min(lastError.retryAfter * 1e3, RATE_LIMIT_RETRY_CAP_MS) : this.getBackoffDelay(attempt));
|
|
326
|
+
const delay = inProgressWaitMs ?? (lastError instanceof CStarRateLimitError ? Math.min((lastError.retryAfter ?? 1) * 1e3, RATE_LIMIT_RETRY_CAP_MS) : this.getBackoffDelay(attempt));
|
|
324
327
|
inProgressWaitMs = null;
|
|
325
328
|
await this.sleep(delay);
|
|
326
329
|
}
|
|
@@ -338,7 +341,7 @@ var HttpClient = class {
|
|
|
338
341
|
type: "connection_error",
|
|
339
342
|
code: "network_error",
|
|
340
343
|
message: `Network request failed: ${networkErr.message}`,
|
|
341
|
-
doc_url: "https://www.cstar.help/developers/errors#
|
|
344
|
+
doc_url: "https://www.cstar.help/developers/errors#network_error"
|
|
342
345
|
});
|
|
343
346
|
if (canRetryAmbiguousFailure && attempt < this.config.maxRetries) continue;
|
|
344
347
|
throw lastError;
|
|
@@ -374,7 +377,8 @@ var HttpClient = class {
|
|
|
374
377
|
}
|
|
375
378
|
if (response.status === 429) {
|
|
376
379
|
lastError = parseError(429, errorBody, retryAfter);
|
|
377
|
-
|
|
380
|
+
const worthWaiting = retryAfter !== void 0 && retryAfter * 1e3 <= RATE_LIMIT_RETRY_CAP_MS;
|
|
381
|
+
if (worthWaiting && attempt < this.config.maxRetries) continue;
|
|
378
382
|
throw lastError;
|
|
379
383
|
}
|
|
380
384
|
lastError = parseError(response.status, errorBody);
|
|
@@ -1671,11 +1675,15 @@ var AttachmentsResource = class {
|
|
|
1671
1675
|
params?.bucket ? { query: { bucket: params.bucket } } : void 0
|
|
1672
1676
|
);
|
|
1673
1677
|
}
|
|
1674
|
-
/**
|
|
1675
|
-
|
|
1678
|
+
/**
|
|
1679
|
+
* Delete a stored file. Pass `storagePath` and `bucket` from `list()`, as
|
|
1680
|
+
* for `get()`. A path with no file in that bucket is a 404.
|
|
1681
|
+
*/
|
|
1682
|
+
async del(storagePath, params) {
|
|
1676
1683
|
return this.client.request(
|
|
1677
1684
|
"DELETE",
|
|
1678
|
-
`/attachments/${
|
|
1685
|
+
`/attachments/${storagePath}`,
|
|
1686
|
+
params?.bucket ? { query: { bucket: params.bucket } } : void 0
|
|
1679
1687
|
);
|
|
1680
1688
|
}
|
|
1681
1689
|
};
|
|
@@ -2067,7 +2075,10 @@ var GameActivityResource = class {
|
|
|
2067
2075
|
query: params ? { ...params } : void 0
|
|
2068
2076
|
});
|
|
2069
2077
|
}
|
|
2070
|
-
/**
|
|
2078
|
+
/**
|
|
2079
|
+
* Get activity for a specific member. `memberId` is the player's user id:
|
|
2080
|
+
* the `memberId` game responses return, and `userId` on `members.list()`.
|
|
2081
|
+
*/
|
|
2071
2082
|
async forMember(memberId, params) {
|
|
2072
2083
|
return this.client.request("GET", `/game/activity/member/${memberId}`, {
|
|
2073
2084
|
query: params ? { ...params } : void 0
|
|
@@ -2256,7 +2267,10 @@ var GameResource = class {
|
|
|
2256
2267
|
query: params ? { ...params } : void 0
|
|
2257
2268
|
});
|
|
2258
2269
|
}
|
|
2259
|
-
/**
|
|
2270
|
+
/**
|
|
2271
|
+
* Get a specific player's stats. `memberId` is the player's user id: the
|
|
2272
|
+
* `memberId` game responses return, and `userId` on `members.list()`.
|
|
2273
|
+
*/
|
|
2260
2274
|
async getPlayer(memberId) {
|
|
2261
2275
|
return this.client.request("GET", `/game/player/${memberId}`);
|
|
2262
2276
|
}
|
|
@@ -2545,9 +2559,9 @@ var OfflineQueue = class {
|
|
|
2545
2559
|
// src/types/generated/webhookEvents.ts
|
|
2546
2560
|
var WEBHOOK_EVENT_SAMPLES = {
|
|
2547
2561
|
"agent.preferences_updated": {
|
|
2548
|
-
"team_id": "
|
|
2549
|
-
"member_id": "
|
|
2550
|
-
"agent_id": "
|
|
2562
|
+
"team_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
2563
|
+
"member_id": "550e8400-e29b-41d4-a716-446655440010",
|
|
2564
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2551
2565
|
"changed": [
|
|
2552
2566
|
"boringMode"
|
|
2553
2567
|
],
|
|
@@ -2557,143 +2571,197 @@ var WEBHOOK_EVENT_SAMPLES = {
|
|
|
2557
2571
|
},
|
|
2558
2572
|
"article.created": {
|
|
2559
2573
|
"article": {
|
|
2560
|
-
"id": "
|
|
2574
|
+
"id": "art_Yb3kQ9mT2pLx",
|
|
2561
2575
|
"title": "How to reset your password",
|
|
2562
2576
|
"slug": "how-to-reset-your-password",
|
|
2577
|
+
"status": "draft",
|
|
2563
2578
|
"is_public": false,
|
|
2564
|
-
"
|
|
2579
|
+
"published_at": "2026-04-27T19:00:00.000Z",
|
|
2580
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2581
|
+
"updated_at": "2026-04-27T19:00:00.000Z"
|
|
2565
2582
|
}
|
|
2566
2583
|
},
|
|
2567
2584
|
"article.deleted": {
|
|
2568
|
-
"id": "
|
|
2585
|
+
"id": "art_Yb3kQ9mT2pLx"
|
|
2569
2586
|
},
|
|
2570
2587
|
"article.published": {
|
|
2571
2588
|
"article": {
|
|
2572
|
-
"id": "
|
|
2589
|
+
"id": "art_Yb3kQ9mT2pLx",
|
|
2573
2590
|
"title": "How to reset your password",
|
|
2574
2591
|
"slug": "how-to-reset-your-password",
|
|
2592
|
+
"status": "published",
|
|
2575
2593
|
"is_public": true,
|
|
2576
|
-
"published_at": "2026-04-27T19:00:00.000Z"
|
|
2594
|
+
"published_at": "2026-04-27T19:00:00.000Z",
|
|
2595
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2596
|
+
"updated_at": "2026-04-27T19:00:00.000Z"
|
|
2577
2597
|
}
|
|
2578
2598
|
},
|
|
2579
2599
|
"article.updated": {
|
|
2580
2600
|
"article": {
|
|
2581
|
-
"id": "
|
|
2601
|
+
"id": "art_Yb3kQ9mT2pLx",
|
|
2582
2602
|
"title": "How to reset your password (updated)",
|
|
2583
2603
|
"slug": "how-to-reset-your-password",
|
|
2584
|
-
"
|
|
2604
|
+
"status": "published",
|
|
2605
|
+
"is_public": true,
|
|
2606
|
+
"published_at": "2026-04-27T19:00:00.000Z",
|
|
2607
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2608
|
+
"updated_at": "2026-04-27T19:00:00.000Z"
|
|
2609
|
+
},
|
|
2610
|
+
"changes": {
|
|
2611
|
+
"title": {
|
|
2612
|
+
"from": "How to reset your password",
|
|
2613
|
+
"to": "How to reset your password (updated)"
|
|
2614
|
+
},
|
|
2615
|
+
"slug": {
|
|
2616
|
+
"from": "reset-password",
|
|
2617
|
+
"to": "how-to-reset-your-password"
|
|
2618
|
+
},
|
|
2619
|
+
"status": {
|
|
2620
|
+
"from": "draft",
|
|
2621
|
+
"to": "published"
|
|
2622
|
+
},
|
|
2623
|
+
"is_public": {
|
|
2624
|
+
"from": false,
|
|
2625
|
+
"to": true
|
|
2626
|
+
}
|
|
2585
2627
|
}
|
|
2586
2628
|
},
|
|
2587
2629
|
"boss.damaged": {
|
|
2588
2630
|
"boss": {
|
|
2589
|
-
"
|
|
2631
|
+
"name": "The Thunder Drake",
|
|
2590
2632
|
"current_hp": 740
|
|
2591
2633
|
},
|
|
2592
2634
|
"damage": 120,
|
|
2635
|
+
"defeated": false,
|
|
2593
2636
|
"by": {
|
|
2594
|
-
"agent_id": "
|
|
2595
|
-
"name": "Riley"
|
|
2637
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001"
|
|
2596
2638
|
}
|
|
2597
2639
|
},
|
|
2598
2640
|
"boss.defeated": {
|
|
2599
2641
|
"boss": {
|
|
2600
|
-
"
|
|
2601
|
-
"
|
|
2642
|
+
"name": "The Thunder Drake",
|
|
2643
|
+
"level": 4
|
|
2602
2644
|
},
|
|
2603
2645
|
"final_blow_by": {
|
|
2604
|
-
"agent_id": "
|
|
2646
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2605
2647
|
"name": "Riley"
|
|
2606
|
-
}
|
|
2607
|
-
"team_xp_awarded": 1500
|
|
2648
|
+
}
|
|
2608
2649
|
},
|
|
2609
2650
|
"boss.spawned": {
|
|
2610
2651
|
"boss": {
|
|
2611
2652
|
"id": "boss_thunder_drake",
|
|
2612
2653
|
"name": "The Thunder Drake",
|
|
2613
2654
|
"level": 4,
|
|
2655
|
+
"type": "dragon",
|
|
2656
|
+
"difficulty": "hard",
|
|
2614
2657
|
"max_hp": 1200
|
|
2615
2658
|
}
|
|
2616
2659
|
},
|
|
2617
2660
|
"community_post.commented": {
|
|
2661
|
+
"post": {
|
|
2662
|
+
"id": "550e8400-e29b-41d4-a716-446655440040"
|
|
2663
|
+
},
|
|
2618
2664
|
"comment": {
|
|
2619
|
-
"id": "
|
|
2620
|
-
"post_id": "
|
|
2621
|
-
"
|
|
2622
|
-
"
|
|
2665
|
+
"id": "550e8400-e29b-41d4-a716-446655440041",
|
|
2666
|
+
"post_id": "550e8400-e29b-41d4-a716-446655440040",
|
|
2667
|
+
"body": "I would love this. Bumping for visibility.",
|
|
2668
|
+
"is_official": false,
|
|
2669
|
+
"author_name": "Casey Patel",
|
|
2623
2670
|
"created_at": "2026-04-27T18:55:02.000Z"
|
|
2624
2671
|
}
|
|
2625
2672
|
},
|
|
2626
2673
|
"community_post.created": {
|
|
2627
2674
|
"post": {
|
|
2628
|
-
"id": "
|
|
2629
|
-
"prefixed_id": "IDEA-42",
|
|
2675
|
+
"id": "550e8400-e29b-41d4-a716-446655440040",
|
|
2630
2676
|
"title": "Add Slack-style threading to tickets",
|
|
2631
2677
|
"status": "open",
|
|
2632
2678
|
"visibility": "public",
|
|
2633
|
-
"topic": "feature-requests",
|
|
2634
2679
|
"created_at": "2026-04-27T18:42:11.000Z"
|
|
2635
2680
|
}
|
|
2636
2681
|
},
|
|
2637
2682
|
"community_post.deleted": {
|
|
2638
2683
|
"post": {
|
|
2639
|
-
"id": "
|
|
2640
|
-
"prefixed_id": "IDEA-42",
|
|
2684
|
+
"id": "550e8400-e29b-41d4-a716-446655440040",
|
|
2641
2685
|
"title": "Add Slack-style threading to tickets"
|
|
2642
2686
|
}
|
|
2643
2687
|
},
|
|
2644
2688
|
"community_post.status_changed": {
|
|
2645
2689
|
"post": {
|
|
2646
|
-
"id": "
|
|
2690
|
+
"id": "550e8400-e29b-41d4-a716-446655440040",
|
|
2647
2691
|
"title": "Add Slack-style threading to tickets",
|
|
2648
2692
|
"status": "planned",
|
|
2649
|
-
"visibility": "public"
|
|
2650
|
-
|
|
2693
|
+
"visibility": "public",
|
|
2694
|
+
"created_at": "2026-04-27T18:42:11.000Z"
|
|
2695
|
+
},
|
|
2696
|
+
"previous_status": "open"
|
|
2651
2697
|
},
|
|
2652
2698
|
"community_post.updated": {
|
|
2653
2699
|
"post": {
|
|
2654
|
-
"id": "
|
|
2700
|
+
"id": "550e8400-e29b-41d4-a716-446655440040",
|
|
2655
2701
|
"title": "Add Slack-style threading to tickets (revised)",
|
|
2656
2702
|
"status": "open",
|
|
2657
|
-
"visibility": "public"
|
|
2703
|
+
"visibility": "public",
|
|
2704
|
+
"created_at": "2026-04-27T18:42:11.000Z"
|
|
2658
2705
|
}
|
|
2659
2706
|
},
|
|
2660
2707
|
"community_post.voted": {
|
|
2661
2708
|
"post": {
|
|
2662
|
-
"id": "
|
|
2709
|
+
"id": "550e8400-e29b-41d4-a716-446655440040",
|
|
2663
2710
|
"vote_count": 13
|
|
2664
2711
|
},
|
|
2665
2712
|
"voter": {
|
|
2666
|
-
"id": "
|
|
2713
|
+
"id": "cus_no9EfYa0dg5O"
|
|
2667
2714
|
},
|
|
2668
2715
|
"direction": "up"
|
|
2669
2716
|
},
|
|
2670
2717
|
"customer.created": {
|
|
2671
2718
|
"customer": {
|
|
2672
|
-
"id": "
|
|
2719
|
+
"id": "cus_no9EfYa0dg5O",
|
|
2673
2720
|
"name": "Casey Patel",
|
|
2674
2721
|
"email": "casey@example.com",
|
|
2675
2722
|
"status": "active",
|
|
2723
|
+
"sentiment": "neutral",
|
|
2676
2724
|
"tags": [
|
|
2677
2725
|
"trial"
|
|
2678
2726
|
],
|
|
2679
|
-
"created_at": "2026-04-27T18:42:11.000Z"
|
|
2727
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2728
|
+
"updated_at": "2026-04-27T18:42:11.000Z"
|
|
2680
2729
|
}
|
|
2681
2730
|
},
|
|
2682
2731
|
"customer.deleted": {
|
|
2683
|
-
"id": "
|
|
2732
|
+
"id": "cus_no9EfYa0dg5O"
|
|
2684
2733
|
},
|
|
2685
2734
|
"customer.updated": {
|
|
2686
2735
|
"customer": {
|
|
2687
|
-
"id": "
|
|
2736
|
+
"id": "cus_no9EfYa0dg5O",
|
|
2688
2737
|
"name": "Casey Patel",
|
|
2689
2738
|
"email": "casey@example.com",
|
|
2690
2739
|
"status": "active",
|
|
2740
|
+
"sentiment": "neutral",
|
|
2691
2741
|
"tags": [
|
|
2692
2742
|
"trial",
|
|
2693
2743
|
"paying"
|
|
2694
|
-
]
|
|
2744
|
+
],
|
|
2745
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2746
|
+
"updated_at": "2026-04-27T18:42:11.000Z"
|
|
2695
2747
|
},
|
|
2696
2748
|
"changes": {
|
|
2749
|
+
"name": {
|
|
2750
|
+
"from": "Casey",
|
|
2751
|
+
"to": "Casey Patel"
|
|
2752
|
+
},
|
|
2753
|
+
"email": {
|
|
2754
|
+
"from": "casey@old.example.com",
|
|
2755
|
+
"to": "casey@example.com"
|
|
2756
|
+
},
|
|
2757
|
+
"status": {
|
|
2758
|
+
"from": "active",
|
|
2759
|
+
"to": "inactive"
|
|
2760
|
+
},
|
|
2761
|
+
"sentiment": {
|
|
2762
|
+
"from": "neutral",
|
|
2763
|
+
"to": "happy"
|
|
2764
|
+
},
|
|
2697
2765
|
"tags": {
|
|
2698
2766
|
"from": [
|
|
2699
2767
|
"trial"
|
|
@@ -2706,51 +2774,59 @@ var WEBHOOK_EVENT_SAMPLES = {
|
|
|
2706
2774
|
}
|
|
2707
2775
|
},
|
|
2708
2776
|
"customer_group.created": {
|
|
2709
|
-
"
|
|
2710
|
-
"id": "
|
|
2777
|
+
"customer_group": {
|
|
2778
|
+
"id": "550e8400-e29b-41d4-a716-446655440030",
|
|
2711
2779
|
"name": "Pro Plan",
|
|
2712
|
-
"
|
|
2713
|
-
"
|
|
2780
|
+
"slug": "pro-plan",
|
|
2781
|
+
"description": "Customers on the Pro plan",
|
|
2782
|
+
"customer_count": 0,
|
|
2783
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2784
|
+
"updated_at": "2026-04-27T18:42:11.000Z"
|
|
2714
2785
|
}
|
|
2715
2786
|
},
|
|
2716
2787
|
"customer_group.deleted": {
|
|
2717
2788
|
"customer_group": {
|
|
2718
|
-
"id": "
|
|
2789
|
+
"id": "550e8400-e29b-41d4-a716-446655440030"
|
|
2719
2790
|
}
|
|
2720
2791
|
},
|
|
2721
2792
|
"customer_group.updated": {
|
|
2722
|
-
"
|
|
2723
|
-
"id": "
|
|
2793
|
+
"customer_group": {
|
|
2794
|
+
"id": "550e8400-e29b-41d4-a716-446655440030",
|
|
2724
2795
|
"name": "Pro Plan (Annual)",
|
|
2725
|
-
"
|
|
2726
|
-
"
|
|
2796
|
+
"slug": "pro-plan",
|
|
2797
|
+
"description": "Customers on the Pro plan",
|
|
2798
|
+
"customer_count": 38,
|
|
2799
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2800
|
+
"updated_at": "2026-04-27T18:42:11.000Z"
|
|
2727
2801
|
}
|
|
2728
2802
|
},
|
|
2729
2803
|
"player.achievement_unlocked": {
|
|
2730
2804
|
"player": {
|
|
2731
|
-
"agent_id": "
|
|
2805
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2732
2806
|
"name": "Riley"
|
|
2733
2807
|
},
|
|
2734
2808
|
"achievement": {
|
|
2735
2809
|
"id": "first_resolve",
|
|
2736
2810
|
"name": "First Resolve",
|
|
2811
|
+
"description": "Resolve your first ticket",
|
|
2812
|
+
"rarity": "common",
|
|
2737
2813
|
"xp": 50
|
|
2738
2814
|
}
|
|
2739
2815
|
},
|
|
2740
2816
|
"player.level_up": {
|
|
2741
2817
|
"player": {
|
|
2742
|
-
"agent_id": "
|
|
2818
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2743
2819
|
"name": "Riley"
|
|
2744
2820
|
},
|
|
2745
2821
|
"level": {
|
|
2746
2822
|
"from": 7,
|
|
2747
2823
|
"to": 8
|
|
2748
2824
|
},
|
|
2749
|
-
"
|
|
2825
|
+
"total_xp": 4200
|
|
2750
2826
|
},
|
|
2751
2827
|
"player.quest_completed": {
|
|
2752
2828
|
"player": {
|
|
2753
|
-
"agent_id": "
|
|
2829
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2754
2830
|
"name": "Riley"
|
|
2755
2831
|
},
|
|
2756
2832
|
"quest": {
|
|
@@ -2761,7 +2837,7 @@ var WEBHOOK_EVENT_SAMPLES = {
|
|
|
2761
2837
|
},
|
|
2762
2838
|
"player.streak_milestone": {
|
|
2763
2839
|
"player": {
|
|
2764
|
-
"agent_id": "
|
|
2840
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2765
2841
|
"name": "Riley"
|
|
2766
2842
|
},
|
|
2767
2843
|
"streak_days": 5,
|
|
@@ -2769,51 +2845,56 @@ var WEBHOOK_EVENT_SAMPLES = {
|
|
|
2769
2845
|
},
|
|
2770
2846
|
"player.xp_gained": {
|
|
2771
2847
|
"player": {
|
|
2772
|
-
"agent_id": "
|
|
2848
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2773
2849
|
"name": "Riley"
|
|
2774
2850
|
},
|
|
2775
2851
|
"amount": 75,
|
|
2776
2852
|
"reason": "ticket.resolved",
|
|
2777
|
-
"ticket_id": "
|
|
2853
|
+
"ticket_id": "tkt_UR8A3OR3Vshq"
|
|
2778
2854
|
},
|
|
2779
2855
|
"social.high_five_sent": {
|
|
2856
|
+
"id": "550e8400-e29b-41d4-a716-446655440051",
|
|
2780
2857
|
"from_team": {
|
|
2781
|
-
"id": "
|
|
2858
|
+
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
2782
2859
|
"name": "Acme Support"
|
|
2783
2860
|
},
|
|
2784
2861
|
"to_team": {
|
|
2785
|
-
"id": "
|
|
2862
|
+
"id": "550e8400-e29b-41d4-a716-446655440003",
|
|
2786
2863
|
"name": "Globex Support"
|
|
2787
2864
|
},
|
|
2788
|
-
"
|
|
2865
|
+
"sent_by": {
|
|
2866
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2867
|
+
"name": "Riley"
|
|
2868
|
+
},
|
|
2869
|
+
"message": "Thanks for the assist!",
|
|
2870
|
+
"created_at": "2026-04-27T18:55:02.000Z"
|
|
2789
2871
|
},
|
|
2790
2872
|
"social.one_up_sent": {
|
|
2873
|
+
"id": "550e8400-e29b-41d4-a716-446655440050",
|
|
2791
2874
|
"from": {
|
|
2792
|
-
"agent_id": "
|
|
2875
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2793
2876
|
"name": "Riley"
|
|
2794
2877
|
},
|
|
2795
2878
|
"to": {
|
|
2796
|
-
"agent_id": "
|
|
2879
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440002",
|
|
2797
2880
|
"name": "Sam"
|
|
2798
2881
|
},
|
|
2799
|
-
"
|
|
2800
|
-
"
|
|
2882
|
+
"message": "Great empathy on this one",
|
|
2883
|
+
"gold_amount": 0,
|
|
2884
|
+
"created_at": "2026-04-27T18:55:02.000Z"
|
|
2801
2885
|
},
|
|
2802
2886
|
"survey.submitted": {
|
|
2803
2887
|
"survey": {
|
|
2804
|
-
"id": "
|
|
2805
|
-
"ticket_id": "
|
|
2806
|
-
"
|
|
2888
|
+
"id": "550e8400-e29b-41d4-a716-446655440060",
|
|
2889
|
+
"ticket_id": "tkt_UR8A3OR3Vshq",
|
|
2890
|
+
"rating": 5,
|
|
2807
2891
|
"comment": "Resolved fast, thank you!",
|
|
2892
|
+
"agent_id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2808
2893
|
"submitted_at": "2026-04-27T19:30:00.000Z"
|
|
2809
|
-
},
|
|
2810
|
-
"customer": {
|
|
2811
|
-
"id": "cus_01H8X9YZ7E0J3K4M5N6Q",
|
|
2812
|
-
"email": "casey@example.com"
|
|
2813
2894
|
}
|
|
2814
2895
|
},
|
|
2815
2896
|
"team.preferences_updated": {
|
|
2816
|
-
"team_id": "
|
|
2897
|
+
"team_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
2817
2898
|
"changed": [
|
|
2818
2899
|
"bossBattlesEnabled"
|
|
2819
2900
|
],
|
|
@@ -2823,91 +2904,159 @@ var WEBHOOK_EVENT_SAMPLES = {
|
|
|
2823
2904
|
},
|
|
2824
2905
|
"ticket.assigned": {
|
|
2825
2906
|
"ticket": {
|
|
2826
|
-
"id": "
|
|
2827
|
-
"
|
|
2907
|
+
"id": "tkt_UR8A3OR3Vshq",
|
|
2908
|
+
"title": "Cannot reset password",
|
|
2909
|
+
"status": "open",
|
|
2910
|
+
"priority": "normal",
|
|
2911
|
+
"channel": "widget",
|
|
2912
|
+
"tags": [
|
|
2913
|
+
"billing"
|
|
2914
|
+
],
|
|
2915
|
+
"customer_id": "cus_no9EfYa0dg5O",
|
|
2916
|
+
"assigned_to": "550e8400-e29b-41d4-a716-446655440001",
|
|
2917
|
+
"dashboard_url": "https://www.cstar.help/team/acme/tickets?selected=3d3c850d-b6ff-4117-9dea-87e8dc4ba108",
|
|
2918
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2919
|
+
"updated_at": "2026-04-27T18:50:02.000Z"
|
|
2828
2920
|
},
|
|
2829
2921
|
"assignee": {
|
|
2830
|
-
"id": "
|
|
2922
|
+
"id": "550e8400-e29b-41d4-a716-446655440001",
|
|
2831
2923
|
"name": "Riley",
|
|
2832
2924
|
"email": "riley@acme.test"
|
|
2833
2925
|
},
|
|
2834
|
-
"previous_assignee":
|
|
2926
|
+
"previous_assignee": {
|
|
2927
|
+
"id": "550e8400-e29b-41d4-a716-446655440002",
|
|
2928
|
+
"name": "Sam",
|
|
2929
|
+
"email": "sam@acme.test"
|
|
2930
|
+
}
|
|
2835
2931
|
},
|
|
2836
2932
|
"ticket.closed": {
|
|
2837
2933
|
"ticket": {
|
|
2838
|
-
"id": "
|
|
2839
|
-
"prefixed_id": "CST-1024",
|
|
2934
|
+
"id": "tkt_UR8A3OR3Vshq",
|
|
2840
2935
|
"title": "Cannot reset password",
|
|
2841
2936
|
"status": "closed",
|
|
2842
2937
|
"priority": "normal",
|
|
2843
|
-
"channel": "widget"
|
|
2938
|
+
"channel": "widget",
|
|
2939
|
+
"tags": [
|
|
2940
|
+
"billing"
|
|
2941
|
+
],
|
|
2942
|
+
"customer_id": "cus_no9EfYa0dg5O",
|
|
2943
|
+
"assigned_to": "550e8400-e29b-41d4-a716-446655440001",
|
|
2944
|
+
"dashboard_url": "https://www.cstar.help/team/acme/tickets?selected=3d3c850d-b6ff-4117-9dea-87e8dc4ba108",
|
|
2945
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2946
|
+
"updated_at": "2026-04-27T18:50:02.000Z"
|
|
2844
2947
|
},
|
|
2845
2948
|
"changes": {
|
|
2949
|
+
"title": {
|
|
2950
|
+
"from": "Cannot reset password",
|
|
2951
|
+
"to": "Password reset link expired"
|
|
2952
|
+
},
|
|
2846
2953
|
"status": {
|
|
2847
2954
|
"from": "open",
|
|
2848
2955
|
"to": "closed"
|
|
2956
|
+
},
|
|
2957
|
+
"priority": {
|
|
2958
|
+
"from": "normal",
|
|
2959
|
+
"to": "high"
|
|
2960
|
+
},
|
|
2961
|
+
"assigned_to": {
|
|
2962
|
+
"from": "550e8400-e29b-41d4-a716-446655440002",
|
|
2963
|
+
"to": "550e8400-e29b-41d4-a716-446655440001"
|
|
2964
|
+
},
|
|
2965
|
+
"tags": {
|
|
2966
|
+
"from": [
|
|
2967
|
+
"billing"
|
|
2968
|
+
],
|
|
2969
|
+
"to": [
|
|
2970
|
+
"billing",
|
|
2971
|
+
"urgent"
|
|
2972
|
+
]
|
|
2849
2973
|
}
|
|
2850
2974
|
}
|
|
2851
2975
|
},
|
|
2852
2976
|
"ticket.created": {
|
|
2853
2977
|
"ticket": {
|
|
2854
|
-
"id": "
|
|
2855
|
-
"prefixed_id": "CST-1024",
|
|
2978
|
+
"id": "tkt_UR8A3OR3Vshq",
|
|
2856
2979
|
"title": "Cannot reset password",
|
|
2857
2980
|
"status": "new",
|
|
2858
2981
|
"priority": "normal",
|
|
2859
2982
|
"channel": "widget",
|
|
2860
|
-
"
|
|
2861
|
-
|
|
2983
|
+
"tags": [
|
|
2984
|
+
"billing"
|
|
2985
|
+
],
|
|
2986
|
+
"customer_id": "cus_no9EfYa0dg5O",
|
|
2987
|
+
"assigned_to": "550e8400-e29b-41d4-a716-446655440001",
|
|
2988
|
+
"dashboard_url": "https://www.cstar.help/team/acme/tickets?selected=3d3c850d-b6ff-4117-9dea-87e8dc4ba108",
|
|
2989
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
2990
|
+
"updated_at": "2026-04-27T18:50:02.000Z"
|
|
2862
2991
|
},
|
|
2863
2992
|
"customer": {
|
|
2864
|
-
"id": "
|
|
2993
|
+
"id": "cus_no9EfYa0dg5O",
|
|
2865
2994
|
"name": "Casey Patel",
|
|
2866
2995
|
"email": "casey@example.com"
|
|
2867
2996
|
}
|
|
2868
2997
|
},
|
|
2869
2998
|
"ticket.deleted": {
|
|
2870
|
-
"id": "
|
|
2999
|
+
"id": "tkt_UR8A3OR3Vshq"
|
|
2871
3000
|
},
|
|
2872
3001
|
"ticket.message_added": {
|
|
2873
3002
|
"ticket": {
|
|
2874
|
-
"id": "
|
|
2875
|
-
"dashboard_url": "https://www.cstar.help/team/acme/tickets?selected=
|
|
3003
|
+
"id": "tkt_UR8A3OR3Vshq",
|
|
3004
|
+
"dashboard_url": "https://www.cstar.help/team/acme/tickets?selected=3d3c850d-b6ff-4117-9dea-87e8dc4ba108"
|
|
2876
3005
|
},
|
|
2877
3006
|
"message": {
|
|
2878
|
-
"id": "
|
|
3007
|
+
"id": "msg_Hq2Lm8Xc4RtZ",
|
|
2879
3008
|
"sender": "agent",
|
|
2880
3009
|
"sender_name": "Riley",
|
|
3010
|
+
"message_type": "public",
|
|
2881
3011
|
"content": "I just sent a reset link to your inbox. Let me know if it lands.",
|
|
2882
3012
|
"created_at": "2026-04-27T18:55:02.000Z"
|
|
2883
3013
|
},
|
|
2884
3014
|
"customer": {
|
|
2885
|
-
"id": "
|
|
3015
|
+
"id": "cus_no9EfYa0dg5O",
|
|
2886
3016
|
"name": "Casey Patel",
|
|
2887
3017
|
"email": "casey@example.com"
|
|
2888
3018
|
}
|
|
2889
3019
|
},
|
|
2890
3020
|
"ticket.updated": {
|
|
2891
3021
|
"ticket": {
|
|
2892
|
-
"id": "
|
|
2893
|
-
"prefixed_id": "CST-1024",
|
|
3022
|
+
"id": "tkt_UR8A3OR3Vshq",
|
|
2894
3023
|
"title": "Cannot reset password",
|
|
2895
3024
|
"status": "open",
|
|
2896
3025
|
"priority": "high",
|
|
2897
|
-
"channel": "widget"
|
|
3026
|
+
"channel": "widget",
|
|
3027
|
+
"tags": [
|
|
3028
|
+
"billing"
|
|
3029
|
+
],
|
|
3030
|
+
"customer_id": "cus_no9EfYa0dg5O",
|
|
3031
|
+
"assigned_to": "550e8400-e29b-41d4-a716-446655440001",
|
|
3032
|
+
"dashboard_url": "https://www.cstar.help/team/acme/tickets?selected=3d3c850d-b6ff-4117-9dea-87e8dc4ba108",
|
|
3033
|
+
"created_at": "2026-04-27T18:42:11.000Z",
|
|
3034
|
+
"updated_at": "2026-04-27T18:50:02.000Z"
|
|
2898
3035
|
},
|
|
2899
3036
|
"changes": {
|
|
3037
|
+
"title": {
|
|
3038
|
+
"from": "Cannot reset password",
|
|
3039
|
+
"to": "Password reset link expired"
|
|
3040
|
+
},
|
|
3041
|
+
"status": {
|
|
3042
|
+
"from": "open",
|
|
3043
|
+
"to": "pending"
|
|
3044
|
+
},
|
|
2900
3045
|
"priority": {
|
|
2901
3046
|
"from": "normal",
|
|
2902
3047
|
"to": "high"
|
|
2903
3048
|
},
|
|
3049
|
+
"assigned_to": {
|
|
3050
|
+
"from": "550e8400-e29b-41d4-a716-446655440002",
|
|
3051
|
+
"to": "550e8400-e29b-41d4-a716-446655440001"
|
|
3052
|
+
},
|
|
2904
3053
|
"tags": {
|
|
2905
3054
|
"from": [
|
|
2906
|
-
"
|
|
3055
|
+
"billing"
|
|
2907
3056
|
],
|
|
2908
3057
|
"to": [
|
|
2909
|
-
"
|
|
2910
|
-
"
|
|
3058
|
+
"billing",
|
|
3059
|
+
"urgent"
|
|
2911
3060
|
]
|
|
2912
3061
|
}
|
|
2913
3062
|
}
|
|
@@ -2986,7 +3135,7 @@ var CStarClient = class {
|
|
|
2986
3135
|
this.ai = new AiResource(this._httpClient);
|
|
2987
3136
|
this.views = new ViewsResource(this._httpClient);
|
|
2988
3137
|
this.billing = new BillingResource(this._httpClient);
|
|
2989
|
-
this.realtime = new CStarRealtime(this._httpClient);
|
|
3138
|
+
this.realtime = new CStarRealtime(this._httpClient, config.realtime);
|
|
2990
3139
|
if (config.offline) {
|
|
2991
3140
|
const queueOpts = typeof config.offline === "object" ? config.offline : void 0;
|
|
2992
3141
|
this.offlineQueue = new OfflineQueue(this._httpClient, queueOpts);
|