@cstar.help/js 0.17.2 → 0.17.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 +35 -23
- package/dist/index.cjs +47 -38
- package/dist/index.d.cts +249 -86
- package/dist/index.d.ts +249 -86
- package/dist/index.js +47 -38
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -79,6 +79,8 @@ interface FetchOptions {
|
|
|
79
79
|
body?: unknown;
|
|
80
80
|
query?: Record<string, string | string[] | number | boolean | undefined>;
|
|
81
81
|
idempotencyKey?: string;
|
|
82
|
+
/** Decode successful downloads as text; error responses still use JSON. */
|
|
83
|
+
responseType?: 'json' | 'text';
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* Low-level HTTP client for the cStar API.
|
|
@@ -708,7 +710,7 @@ declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams,
|
|
|
708
710
|
/** Fire a test webhook event to all active webhooks and CLI listeners. */
|
|
709
711
|
triggerTest(params: WebhookTriggerTestParams, options?: RequestOptions): Promise<ApiResponse<WebhookTriggerTestResult>>;
|
|
710
712
|
/** Get a sample webhook payload for an event type (used by Zapier). */
|
|
711
|
-
sample(event: string): Promise<
|
|
713
|
+
sample(event: string): Promise<ListResponse<unknown>>;
|
|
712
714
|
/** Subscribe to an event (REST Hooks / Zapier protocol). */
|
|
713
715
|
restSubscribe(params: WebhookSubscribeParams, options?: RequestOptions): Promise<ApiResponse<WebhookSubscription>>;
|
|
714
716
|
/** Unsubscribe from an event (REST Hooks / Zapier protocol). Returns void (204 No Content). */
|
|
@@ -847,7 +849,7 @@ declare class AutomationsResource extends BaseResource<AutomationRule, Automatio
|
|
|
847
849
|
/** Toggle a rule's enabled state. */
|
|
848
850
|
toggle(ruleId: string, enabled?: boolean): Promise<ApiResponse<AutomationRule>>;
|
|
849
851
|
/** Reorder rules by providing an ordered array of IDs. */
|
|
850
|
-
reorder(orderedIds: string[]): Promise<
|
|
852
|
+
reorder(orderedIds: string[]): Promise<ListResponse<AutomationRule>>;
|
|
851
853
|
/** Dry-run a rule against a specific resource (no actions executed). */
|
|
852
854
|
test(ruleId: string, params: {
|
|
853
855
|
resourceType: string;
|
|
@@ -1053,7 +1055,7 @@ declare class CommunityPostsResource extends BaseResource<CommunityPost, Communi
|
|
|
1053
1055
|
following: boolean;
|
|
1054
1056
|
}>>;
|
|
1055
1057
|
/** List all comments on a post. */
|
|
1056
|
-
listComments(postId: string): Promise<
|
|
1058
|
+
listComments(postId: string): Promise<ListResponse<CommunityComment>>;
|
|
1057
1059
|
/** Add a comment to a post. */
|
|
1058
1060
|
createComment(postId: string, params: CommunityCommentCreateParams): Promise<ApiResponse<CommunityComment>>;
|
|
1059
1061
|
}
|
|
@@ -1282,7 +1284,7 @@ declare class StatusesResource {
|
|
|
1282
1284
|
private readonly client;
|
|
1283
1285
|
constructor(client: HttpClient);
|
|
1284
1286
|
/** List all statuses. */
|
|
1285
|
-
list(): Promise<
|
|
1287
|
+
list(): Promise<ListResponse<TicketStatus>>;
|
|
1286
1288
|
/** Create a new status. */
|
|
1287
1289
|
create(params: StatusCreateParams, options?: RequestOptions): Promise<ApiResponse<TicketStatus>>;
|
|
1288
1290
|
/** Update a status. */
|
|
@@ -1290,14 +1292,14 @@ declare class StatusesResource {
|
|
|
1290
1292
|
/** Delete a status. */
|
|
1291
1293
|
del(statusKey: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1292
1294
|
/** Reorder statuses. */
|
|
1293
|
-
reorder(orderedKeys: string[]): Promise<
|
|
1295
|
+
reorder(orderedKeys: string[]): Promise<ListResponse<TicketStatus>>;
|
|
1294
1296
|
}
|
|
1295
1297
|
/** Manage quick reply templates. */
|
|
1296
1298
|
declare class QuickRepliesResource {
|
|
1297
1299
|
private readonly client;
|
|
1298
1300
|
constructor(client: HttpClient);
|
|
1299
1301
|
/** List all quick replies. */
|
|
1300
|
-
list(): Promise<
|
|
1302
|
+
list(): Promise<ListResponse<QuickReply>>;
|
|
1301
1303
|
/** Create a new quick reply. */
|
|
1302
1304
|
create(params: QuickReplyCreateParams, options?: RequestOptions): Promise<ApiResponse<QuickReply>>;
|
|
1303
1305
|
/** Update a quick reply. */
|
|
@@ -1305,7 +1307,7 @@ declare class QuickRepliesResource {
|
|
|
1305
1307
|
/** Delete a quick reply. */
|
|
1306
1308
|
del(replyId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1307
1309
|
/** Reorder quick replies. */
|
|
1308
|
-
reorder(orderedIds: string[]): Promise<
|
|
1310
|
+
reorder(orderedIds: string[]): Promise<ListResponse<QuickReply>>;
|
|
1309
1311
|
}
|
|
1310
1312
|
/** Manage team settings. */
|
|
1311
1313
|
declare class SettingsResource {
|
|
@@ -1500,7 +1502,10 @@ declare class CustomFieldsResource {
|
|
|
1500
1502
|
/** Delete a custom field. */
|
|
1501
1503
|
del(fieldId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1502
1504
|
/** Reorder custom fields within a content type. */
|
|
1503
|
-
reorder(contentType: 'ticket' | 'customer' | 'article', orderedIds: string[]): Promise<
|
|
1505
|
+
reorder(contentType: 'ticket' | 'customer' | 'article', orderedIds: string[]): Promise<{
|
|
1506
|
+
success: true;
|
|
1507
|
+
reordered: number;
|
|
1508
|
+
}>;
|
|
1504
1509
|
}
|
|
1505
1510
|
|
|
1506
1511
|
/** An SLA rule. */
|
|
@@ -1569,7 +1574,7 @@ declare class SlaResource {
|
|
|
1569
1574
|
/** Delete an SLA rule. */
|
|
1570
1575
|
del(ruleId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1571
1576
|
/** Reorder SLA rules by providing an ordered array of IDs. */
|
|
1572
|
-
reorder(orderedIds: string[]): Promise<
|
|
1577
|
+
reorder(orderedIds: string[]): Promise<ListResponse<SlaRule>>;
|
|
1573
1578
|
/** Get SLA compliance metrics. */
|
|
1574
1579
|
metrics(params?: SlaMetricsParams): Promise<ApiResponse<SlaMetrics>>;
|
|
1575
1580
|
}
|
|
@@ -1744,20 +1749,41 @@ declare class BulkResource {
|
|
|
1744
1749
|
del(params: BulkDeleteParams, options?: RequestOptions): Promise<ApiResponse<BulkResult>>;
|
|
1745
1750
|
}
|
|
1746
1751
|
|
|
1747
|
-
/**
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1752
|
+
/** Resource tables supported by the export endpoint. */
|
|
1753
|
+
type ExportResourceType = 'tickets' | 'customers' | 'articles';
|
|
1754
|
+
/** Filters shared by all selected resources. */
|
|
1755
|
+
interface ExportFilters {
|
|
1756
|
+
status?: string;
|
|
1757
|
+
priority?: string;
|
|
1758
|
+
createdAfter?: string;
|
|
1759
|
+
createdBefore?: string;
|
|
1760
|
+
}
|
|
1761
|
+
/** JSON may export multiple resources or default to all three. */
|
|
1762
|
+
interface ExportJsonParams {
|
|
1763
|
+
resources?: readonly [ExportResourceType, ...ExportResourceType[]];
|
|
1764
|
+
format?: 'json';
|
|
1765
|
+
filters?: ExportFilters;
|
|
1766
|
+
}
|
|
1767
|
+
/** CSV must select exactly one resource, including when passed through a helper. */
|
|
1768
|
+
interface ExportCsvParams {
|
|
1769
|
+
resources: readonly [ExportResourceType];
|
|
1770
|
+
format: 'csv';
|
|
1771
|
+
filters?: ExportFilters;
|
|
1772
|
+
}
|
|
1773
|
+
/** Export parameters preserve the relationship between format and resources. */
|
|
1774
|
+
type ExportCreateParams = ExportJsonParams | ExportCsvParams;
|
|
1775
|
+
/** JSON export with raw database rows, unlike the mapped API resource objects. */
|
|
1756
1776
|
interface ExportResult {
|
|
1757
1777
|
object: 'export';
|
|
1758
|
-
format:
|
|
1759
|
-
|
|
1760
|
-
|
|
1778
|
+
format: 'json';
|
|
1779
|
+
exportedAt: string;
|
|
1780
|
+
teamId: string;
|
|
1781
|
+
tickets?: Record<string, unknown>[];
|
|
1782
|
+
customers?: Record<string, unknown>[];
|
|
1783
|
+
articles?: Record<string, unknown>[];
|
|
1784
|
+
/** Included when the selected tickets have messages. */
|
|
1785
|
+
messages?: Record<string, unknown>[];
|
|
1786
|
+
summary: Partial<Record<ExportResourceType | 'messages', number>>;
|
|
1761
1787
|
}
|
|
1762
1788
|
|
|
1763
1789
|
/** Import request parameters. */
|
|
@@ -1828,8 +1854,12 @@ interface ImportLogListParams extends PaginationParams {
|
|
|
1828
1854
|
declare class ExportResource {
|
|
1829
1855
|
private readonly client;
|
|
1830
1856
|
constructor(client: HttpClient);
|
|
1831
|
-
/** Create
|
|
1832
|
-
create(params:
|
|
1857
|
+
/** Create a CSV export. The API returns text for a single resource. */
|
|
1858
|
+
create(params: ExportCsvParams, options?: RequestOptions): Promise<string>;
|
|
1859
|
+
/** Create a JSON export with raw rows and per-resource counts. */
|
|
1860
|
+
create(params: ExportJsonParams, options?: RequestOptions): Promise<ExportResult>;
|
|
1861
|
+
/** A runtime-selected format returns JSON or CSV text accordingly. */
|
|
1862
|
+
create(params: ExportCreateParams, options?: RequestOptions): Promise<ExportResult | string>;
|
|
1833
1863
|
}
|
|
1834
1864
|
/** Import data into your team. */
|
|
1835
1865
|
declare class ImportResource {
|
|
@@ -1893,13 +1923,19 @@ interface SearchParams {
|
|
|
1893
1923
|
types?: Array<'tickets' | 'customers' | 'articles'>;
|
|
1894
1924
|
limit?: number;
|
|
1895
1925
|
}
|
|
1926
|
+
/** Cross-resource search results with the original query and returned count. */
|
|
1927
|
+
interface SearchResponse {
|
|
1928
|
+
results: SearchResult[];
|
|
1929
|
+
total: number;
|
|
1930
|
+
query: string;
|
|
1931
|
+
}
|
|
1896
1932
|
|
|
1897
1933
|
/** Search across tickets, customers, and articles. */
|
|
1898
1934
|
declare class SearchResource {
|
|
1899
1935
|
private readonly client;
|
|
1900
1936
|
constructor(client: HttpClient);
|
|
1901
1937
|
/** Perform a cross-resource search. */
|
|
1902
|
-
query(params: SearchParams): Promise<
|
|
1938
|
+
query(params: SearchParams): Promise<SearchResponse>;
|
|
1903
1939
|
}
|
|
1904
1940
|
|
|
1905
1941
|
/** A tag with usage count. */
|
|
@@ -2078,10 +2114,16 @@ interface Boss {
|
|
|
2078
2114
|
interface BossDamageResult {
|
|
2079
2115
|
object: 'boss_damage';
|
|
2080
2116
|
damage: number;
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2117
|
+
currentHealth: number;
|
|
2118
|
+
/** Health fractions use the 0 to 1 range. */
|
|
2119
|
+
healthPercent: number;
|
|
2120
|
+
previousHealthPercent: number;
|
|
2121
|
+
isDefeated: boolean;
|
|
2122
|
+
isKillingBlow: boolean;
|
|
2123
|
+
shieldBlocked: boolean;
|
|
2124
|
+
shieldBroken: boolean;
|
|
2125
|
+
enrageTriggered: boolean;
|
|
2126
|
+
activeAbilities: string[];
|
|
2085
2127
|
}
|
|
2086
2128
|
/** Boss defeat record. */
|
|
2087
2129
|
interface BossDefeat {
|
|
@@ -2106,8 +2148,10 @@ interface BossSpawnParams {
|
|
|
2106
2148
|
}
|
|
2107
2149
|
/** Parameters for dealing boss damage. */
|
|
2108
2150
|
interface BossDamageParams {
|
|
2109
|
-
|
|
2110
|
-
|
|
2151
|
+
/** Defaults to the API key's creator. */
|
|
2152
|
+
userId?: string;
|
|
2153
|
+
userName?: string;
|
|
2154
|
+
priority?: 'low' | 'normal' | 'high' | 'urgent';
|
|
2111
2155
|
}
|
|
2112
2156
|
/** Leaderboard entry. */
|
|
2113
2157
|
interface LeaderboardEntry {
|
|
@@ -2141,22 +2185,52 @@ interface Achievement {
|
|
|
2141
2185
|
}
|
|
2142
2186
|
/** Parameters for listing achievements. */
|
|
2143
2187
|
interface AchievementListParams extends PaginationParams {
|
|
2144
|
-
/** Whose achievement progress to load. Required
|
|
2188
|
+
/** Whose achievement progress to load. Required; the endpoint 400s without it. */
|
|
2145
2189
|
userId: string;
|
|
2146
2190
|
category?: string;
|
|
2147
2191
|
}
|
|
2148
2192
|
/** A daily quest. */
|
|
2149
2193
|
interface Quest {
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
title: string;
|
|
2194
|
+
questId: string;
|
|
2195
|
+
name: string;
|
|
2153
2196
|
description: string | null;
|
|
2154
|
-
|
|
2197
|
+
difficulty: string;
|
|
2198
|
+
progress: number;
|
|
2155
2199
|
target: number;
|
|
2156
|
-
current: number;
|
|
2157
2200
|
completed: boolean;
|
|
2158
|
-
xpReward: number;
|
|
2159
2201
|
completedAt: string | null;
|
|
2202
|
+
xpReward: number;
|
|
2203
|
+
goldReward: number;
|
|
2204
|
+
}
|
|
2205
|
+
/** Today's quests and daily completion metadata. */
|
|
2206
|
+
interface QuestList {
|
|
2207
|
+
object: 'quest_list';
|
|
2208
|
+
quests: Quest[];
|
|
2209
|
+
completedToday: number;
|
|
2210
|
+
totalQuests: number;
|
|
2211
|
+
allComplete: boolean;
|
|
2212
|
+
completionBonus: {
|
|
2213
|
+
xp: number;
|
|
2214
|
+
gold: number;
|
|
2215
|
+
} | null;
|
|
2216
|
+
resetsAt: string;
|
|
2217
|
+
}
|
|
2218
|
+
/** Completed quests grouped by day. */
|
|
2219
|
+
interface QuestHistory {
|
|
2220
|
+
object: 'quest_history';
|
|
2221
|
+
history: Array<{
|
|
2222
|
+
date: string;
|
|
2223
|
+
quests: Array<Pick<Quest, 'questId' | 'name' | 'difficulty' | 'xpReward' | 'goldReward'> & {
|
|
2224
|
+
completedAt: string;
|
|
2225
|
+
}>;
|
|
2226
|
+
completedCount: number;
|
|
2227
|
+
}>;
|
|
2228
|
+
totalCompleted: number;
|
|
2229
|
+
}
|
|
2230
|
+
interface QuestHistoryParams {
|
|
2231
|
+
userId?: string;
|
|
2232
|
+
/** Number of completed quests to load, maximum 90. */
|
|
2233
|
+
limit?: number;
|
|
2160
2234
|
}
|
|
2161
2235
|
/** A daily puzzle. */
|
|
2162
2236
|
interface Puzzle {
|
|
@@ -2171,15 +2245,59 @@ interface Puzzle {
|
|
|
2171
2245
|
/** Puzzle completion parameters. */
|
|
2172
2246
|
interface PuzzleCompleteParams {
|
|
2173
2247
|
userId: string;
|
|
2174
|
-
|
|
2248
|
+
puzzleId: string;
|
|
2249
|
+
timeSeconds: number;
|
|
2250
|
+
mistakes?: number;
|
|
2251
|
+
isWon?: boolean;
|
|
2175
2252
|
}
|
|
2176
2253
|
/** Puzzle completion result. */
|
|
2177
2254
|
interface PuzzleCompleteResult {
|
|
2178
|
-
object: '
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2255
|
+
object: 'puzzle_completion';
|
|
2256
|
+
id: string;
|
|
2257
|
+
puzzleId: string;
|
|
2258
|
+
timeSeconds: number;
|
|
2259
|
+
mistakes: number;
|
|
2260
|
+
score: number;
|
|
2261
|
+
xpEarned: number;
|
|
2262
|
+
isWon: boolean;
|
|
2263
|
+
streak: {
|
|
2264
|
+
current: number;
|
|
2265
|
+
longest: number;
|
|
2266
|
+
totalCompleted: number;
|
|
2267
|
+
};
|
|
2182
2268
|
}
|
|
2269
|
+
/** Scoreboards need a puzzle ID; streak boards are team-wide. */
|
|
2270
|
+
type PuzzleLeaderboardParams = {
|
|
2271
|
+
type?: 'scores';
|
|
2272
|
+
puzzleId: string;
|
|
2273
|
+
limit?: number;
|
|
2274
|
+
} | {
|
|
2275
|
+
type: 'streaks';
|
|
2276
|
+
limit?: number;
|
|
2277
|
+
};
|
|
2278
|
+
type PuzzleLeaderboardResult = {
|
|
2279
|
+
object: 'puzzle_leaderboard';
|
|
2280
|
+
type: 'scores';
|
|
2281
|
+
puzzleId: string;
|
|
2282
|
+
entries: Array<{
|
|
2283
|
+
rank: number;
|
|
2284
|
+
userId: string;
|
|
2285
|
+
timeSeconds: number;
|
|
2286
|
+
mistakes: number;
|
|
2287
|
+
score: number;
|
|
2288
|
+
xpEarned: number;
|
|
2289
|
+
}>;
|
|
2290
|
+
} | {
|
|
2291
|
+
object: 'puzzle_leaderboard';
|
|
2292
|
+
type: 'streaks';
|
|
2293
|
+
entries: Array<{
|
|
2294
|
+
rank: number;
|
|
2295
|
+
userId: string;
|
|
2296
|
+
currentStreak: number;
|
|
2297
|
+
longestStreak: number;
|
|
2298
|
+
totalCompleted: number;
|
|
2299
|
+
}>;
|
|
2300
|
+
};
|
|
2183
2301
|
/** Puzzle streak info. */
|
|
2184
2302
|
interface PuzzleStreak {
|
|
2185
2303
|
object: 'puzzle_streak';
|
|
@@ -2192,22 +2310,39 @@ interface PuzzleStreak {
|
|
|
2192
2310
|
interface OneUp {
|
|
2193
2311
|
id: string;
|
|
2194
2312
|
object: 'one_up';
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2313
|
+
sender: {
|
|
2314
|
+
id: string;
|
|
2315
|
+
name: string | null;
|
|
2316
|
+
};
|
|
2317
|
+
recipient: {
|
|
2318
|
+
id: string;
|
|
2319
|
+
name: string | null;
|
|
2320
|
+
};
|
|
2199
2321
|
message: string | null;
|
|
2322
|
+
goldAmount: number;
|
|
2323
|
+
wasFree: boolean;
|
|
2200
2324
|
createdAt: string;
|
|
2201
2325
|
}
|
|
2326
|
+
/** Sending a one-up also returns the remaining allowance and rewards. */
|
|
2327
|
+
interface OneUpSendResult extends OneUp {
|
|
2328
|
+
freeRemaining: number;
|
|
2329
|
+
recipientXpAwarded: number;
|
|
2330
|
+
recipientGoldAwarded: number;
|
|
2331
|
+
}
|
|
2202
2332
|
/** Parameters for listing one-ups. */
|
|
2203
|
-
interface OneUpListParams
|
|
2333
|
+
interface OneUpListParams {
|
|
2204
2334
|
userId?: string;
|
|
2335
|
+
limit?: number;
|
|
2205
2336
|
}
|
|
2206
2337
|
/** Parameters for sending a one-up. */
|
|
2207
2338
|
interface OneUpCreateParams {
|
|
2339
|
+
/** Defaults to the API key's creator. */
|
|
2340
|
+
senderId?: string;
|
|
2341
|
+
senderName?: string;
|
|
2208
2342
|
recipientId: string;
|
|
2343
|
+
recipientName?: string;
|
|
2209
2344
|
message?: string;
|
|
2210
|
-
|
|
2345
|
+
goldAmount?: number;
|
|
2211
2346
|
}
|
|
2212
2347
|
/** Remaining one-ups info. */
|
|
2213
2348
|
interface OneUpRemaining {
|
|
@@ -2220,23 +2355,34 @@ interface OneUpRemaining {
|
|
|
2220
2355
|
interface HighFive {
|
|
2221
2356
|
id: string;
|
|
2222
2357
|
object: 'high_five';
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2358
|
+
senderTeam: {
|
|
2359
|
+
id: string;
|
|
2360
|
+
name: string | null;
|
|
2361
|
+
};
|
|
2362
|
+
senderUser: {
|
|
2363
|
+
id: string;
|
|
2364
|
+
name: string | null;
|
|
2365
|
+
};
|
|
2366
|
+
recipientTeam: {
|
|
2367
|
+
id: string;
|
|
2368
|
+
name: string | null;
|
|
2369
|
+
};
|
|
2229
2370
|
message: string | null;
|
|
2230
2371
|
createdAt: string;
|
|
2231
2372
|
}
|
|
2232
2373
|
/** Parameters for listing high fives. */
|
|
2233
|
-
interface HighFiveListParams
|
|
2374
|
+
interface HighFiveListParams {
|
|
2375
|
+
limit?: number;
|
|
2234
2376
|
}
|
|
2235
2377
|
/** Parameters for sending a high five. */
|
|
2236
2378
|
interface HighFiveCreateParams {
|
|
2237
2379
|
recipientTeamId: string;
|
|
2380
|
+
recipientTeamName?: string;
|
|
2381
|
+
/** Defaults to the API key's creator. */
|
|
2382
|
+
senderUserId?: string;
|
|
2383
|
+
senderUserName?: string;
|
|
2384
|
+
senderTeamName?: string;
|
|
2238
2385
|
message?: string;
|
|
2239
|
-
userId: string;
|
|
2240
2386
|
}
|
|
2241
2387
|
/** Can-send check result. */
|
|
2242
2388
|
interface HighFiveCanSend {
|
|
@@ -2249,10 +2395,13 @@ interface Cosmetic {
|
|
|
2249
2395
|
id: string;
|
|
2250
2396
|
object: 'cosmetic';
|
|
2251
2397
|
type: string;
|
|
2252
|
-
|
|
2253
|
-
rarity: string | null;
|
|
2398
|
+
seasonId: string | null;
|
|
2254
2399
|
unlockedAt: string;
|
|
2255
2400
|
}
|
|
2401
|
+
interface CosmeticListParams {
|
|
2402
|
+
userId: string;
|
|
2403
|
+
type?: string;
|
|
2404
|
+
}
|
|
2256
2405
|
/** Cosmetic preferences. */
|
|
2257
2406
|
interface CosmeticPreferences {
|
|
2258
2407
|
object: 'cosmetic_preferences';
|
|
@@ -2262,13 +2411,28 @@ interface CosmeticPreferences {
|
|
|
2262
2411
|
interface Season {
|
|
2263
2412
|
id: string;
|
|
2264
2413
|
object: 'season';
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
daysRemaining: number | null;
|
|
2414
|
+
isActive: boolean;
|
|
2415
|
+
startsAt: string;
|
|
2416
|
+
endsAt: string;
|
|
2417
|
+
daysRemaining: number;
|
|
2418
|
+
createdAt: string;
|
|
2271
2419
|
}
|
|
2420
|
+
/** The current-season endpoint includes team details or a no-season state. */
|
|
2421
|
+
type CurrentSeason = {
|
|
2422
|
+
object: 'season';
|
|
2423
|
+
active: false;
|
|
2424
|
+
season: null;
|
|
2425
|
+
} | (Season & {
|
|
2426
|
+
isActive: true;
|
|
2427
|
+
name: string | null;
|
|
2428
|
+
number: number | null;
|
|
2429
|
+
badges: Array<{
|
|
2430
|
+
level: number;
|
|
2431
|
+
name: string;
|
|
2432
|
+
color: string;
|
|
2433
|
+
}>;
|
|
2434
|
+
teamParticipants: number;
|
|
2435
|
+
});
|
|
2272
2436
|
/** Season stats for a user. */
|
|
2273
2437
|
interface SeasonStats {
|
|
2274
2438
|
object: 'season_stats';
|
|
@@ -2361,7 +2525,7 @@ declare class AchievementsResource {
|
|
|
2361
2525
|
/** List unlocked achievements only. */
|
|
2362
2526
|
unlocked(params?: {
|
|
2363
2527
|
userId: string;
|
|
2364
|
-
}): Promise<
|
|
2528
|
+
}): Promise<ListResponse<Achievement>>;
|
|
2365
2529
|
/** Get a single achievement. */
|
|
2366
2530
|
get(achievementId: string, params?: {
|
|
2367
2531
|
userId?: string;
|
|
@@ -2400,13 +2564,9 @@ declare class QuestsResource {
|
|
|
2400
2564
|
/** Get today's quests. */
|
|
2401
2565
|
today(params?: {
|
|
2402
2566
|
userId?: string;
|
|
2403
|
-
}): Promise<ApiResponse<
|
|
2567
|
+
}): Promise<ApiResponse<QuestList>>;
|
|
2404
2568
|
/** Get quest history. */
|
|
2405
|
-
history(params?:
|
|
2406
|
-
userId?: string;
|
|
2407
|
-
page?: number;
|
|
2408
|
-
pageSize?: number;
|
|
2409
|
-
}): Promise<ApiResponse<unknown>>;
|
|
2569
|
+
history(params?: QuestHistoryParams): Promise<ApiResponse<QuestHistory>>;
|
|
2410
2570
|
}
|
|
2411
2571
|
declare class PuzzlesResource {
|
|
2412
2572
|
private readonly client;
|
|
@@ -2415,25 +2575,25 @@ declare class PuzzlesResource {
|
|
|
2415
2575
|
today(params?: {
|
|
2416
2576
|
userId?: string;
|
|
2417
2577
|
}): Promise<ApiResponse<Puzzle>>;
|
|
2418
|
-
/**
|
|
2578
|
+
/** Record a completed puzzle, its timing and result. */
|
|
2419
2579
|
complete(params: PuzzleCompleteParams, options?: RequestOptions): Promise<ApiResponse<PuzzleCompleteResult>>;
|
|
2420
2580
|
/** Get puzzle streak for a user. */
|
|
2421
2581
|
streak(params: {
|
|
2422
2582
|
userId: string;
|
|
2423
2583
|
}): Promise<ApiResponse<PuzzleStreak>>;
|
|
2424
2584
|
/** Get puzzle leaderboard. */
|
|
2425
|
-
leaderboard(params
|
|
2426
|
-
type?: 'scores' | 'streaks';
|
|
2427
|
-
limit?: number;
|
|
2428
|
-
}): Promise<ApiResponse<unknown>>;
|
|
2585
|
+
leaderboard(params: PuzzleLeaderboardParams): Promise<ApiResponse<PuzzleLeaderboardResult>>;
|
|
2429
2586
|
}
|
|
2430
2587
|
declare class OneUpsResource {
|
|
2431
2588
|
private readonly client;
|
|
2432
2589
|
constructor(client: HttpClient);
|
|
2433
2590
|
/** List one-ups. */
|
|
2434
|
-
list(params?: OneUpListParams): Promise<
|
|
2591
|
+
list(params?: OneUpListParams): Promise<ApiResponse<{
|
|
2592
|
+
object: 'list';
|
|
2593
|
+
data: OneUp[];
|
|
2594
|
+
}>>;
|
|
2435
2595
|
/** Send a one-up. */
|
|
2436
|
-
send(params: OneUpCreateParams, options?: RequestOptions): Promise<ApiResponse<
|
|
2596
|
+
send(params: OneUpCreateParams, options?: RequestOptions): Promise<ApiResponse<OneUpSendResult>>;
|
|
2437
2597
|
/** Check remaining free one-ups today. */
|
|
2438
2598
|
remaining(params: {
|
|
2439
2599
|
userId: string;
|
|
@@ -2443,7 +2603,10 @@ declare class HighFivesResource {
|
|
|
2443
2603
|
private readonly client;
|
|
2444
2604
|
constructor(client: HttpClient);
|
|
2445
2605
|
/** List high fives. */
|
|
2446
|
-
list(params?: HighFiveListParams): Promise<
|
|
2606
|
+
list(params?: HighFiveListParams): Promise<ApiResponse<{
|
|
2607
|
+
object: 'list';
|
|
2608
|
+
data: HighFive[];
|
|
2609
|
+
}>>;
|
|
2447
2610
|
/** Send a high five. */
|
|
2448
2611
|
send(params: HighFiveCreateParams, options?: RequestOptions): Promise<ApiResponse<HighFive>>;
|
|
2449
2612
|
/** Check if you can send a high five to a team. */
|
|
@@ -2455,9 +2618,7 @@ declare class CosmeticsResource {
|
|
|
2455
2618
|
private readonly client;
|
|
2456
2619
|
constructor(client: HttpClient);
|
|
2457
2620
|
/** List unlocked cosmetics. */
|
|
2458
|
-
list(params
|
|
2459
|
-
userId?: string;
|
|
2460
|
-
}): Promise<ApiResponse<Cosmetic[]>>;
|
|
2621
|
+
list(params: CosmeticListParams): Promise<ListResponse<Cosmetic>>;
|
|
2461
2622
|
/** Get cosmetic preferences. */
|
|
2462
2623
|
getPreferences(params: {
|
|
2463
2624
|
userId: string;
|
|
@@ -2469,9 +2630,11 @@ declare class SeasonsResource {
|
|
|
2469
2630
|
private readonly client;
|
|
2470
2631
|
constructor(client: HttpClient);
|
|
2471
2632
|
/** List all seasons. */
|
|
2472
|
-
list(
|
|
2633
|
+
list(params?: {
|
|
2634
|
+
limit?: number;
|
|
2635
|
+
}): Promise<ListResponse<Season>>;
|
|
2473
2636
|
/** Get the current active season. */
|
|
2474
|
-
current(): Promise<ApiResponse<
|
|
2637
|
+
current(): Promise<ApiResponse<CurrentSeason>>;
|
|
2475
2638
|
/** Get user stats for a season. */
|
|
2476
2639
|
stats(seasonId: string, params: {
|
|
2477
2640
|
userId: string;
|
|
@@ -2782,7 +2945,7 @@ interface CStarClientConfig {
|
|
|
2782
2945
|
* viewing your site.
|
|
2783
2946
|
*
|
|
2784
2947
|
* For client-side integrations, use:
|
|
2785
|
-
* - `@cstar.help/js/chat` — Customer chat widget (
|
|
2948
|
+
* - `@cstar.help/js/chat` — Customer chat widget (HMAC or customer session)
|
|
2786
2949
|
* - `@cstar.help/js/library` — Public knowledge base (no auth)
|
|
2787
2950
|
* - `@cstar.help/js/community` — Public community forum (no auth)
|
|
2788
2951
|
*
|
|
@@ -2910,4 +3073,4 @@ declare class CStarClient {
|
|
|
2910
3073
|
get lastMeta(): LastMeta;
|
|
2911
3074
|
}
|
|
2912
3075
|
|
|
2913
|
-
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 CosmeticPreferences, type CsatSettings, type CsatSettingsUpdateParams, type CsatStats, type CsatSurvey, type CsatSurveyCreateParams, type CsatSurveyListParams, 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 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 Metadata, type Notification, type NotificationListParams, OfflineQueue, type OfflineQueueOptions, type OneUp, type OneUpCreateParams, type OneUpListParams, type OneUpRemaining, type PaginationInfo, type PaginationParams, type Player, type Puzzle, type PuzzleCompleteParams, type PuzzleCompleteResult, type PuzzleStreak, type Quest, type QueueItem, type QueueResult, type QuickReply, type QuickReplyCreateParams, type QuickReplyUpdateParams, type RealtimeEvent, type RealtimeOptions, type RequestOptions, type SavedView, type SearchParams, type SearchResult, type Season, type SeasonStats, type SkillAllocateParams, type SkillAllocateResult, type SkillTree, type SlaMetrics, type SlaMetricsParams, type SlaRule, type SlaRuleCreateParams, type SlaRuleListParams, type SlaRuleUpdateParams, type StatusCreateParams, type StatusUpdateParams, Subscription$1 as Subscription, type Tag, type TagListParams, type TeamSettings, type TeamSettingsUpdateParams, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketStatus, 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 WidgetSettings, type WidgetSettingsUpdateParams };
|
|
3076
|
+
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 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 SlaRuleListParams, type SlaRuleUpdateParams, type StatusCreateParams, type StatusUpdateParams, Subscription$1 as Subscription, type Tag, type TagListParams, type TeamSettings, type TeamSettingsUpdateParams, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketStatus, 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 WidgetSettings, type WidgetSettingsUpdateParams };
|