@cstar.help/js 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.cjs +227 -13
- package/dist/auth/index.d.cts +4 -4
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/index.js +225 -13
- package/dist/chat/index.cjs +46 -26
- package/dist/chat/index.d.cts +28 -24
- package/dist/chat/index.d.ts +28 -24
- package/dist/chat/index.js +46 -26
- package/dist/community/index.cjs +233 -9
- package/dist/community/index.d.cts +11 -0
- package/dist/community/index.d.ts +11 -0
- package/dist/community/index.js +231 -9
- package/dist/index.cjs +268 -73
- package/dist/index.d.cts +216 -73
- package/dist/index.d.ts +216 -73
- package/dist/index.js +267 -73
- package/dist/library/index.cjs +254 -9
- package/dist/library/index.d.cts +26 -3
- package/dist/library/index.d.ts +26 -3
- package/dist/library/index.js +252 -9
- package/dist/quickhelp/index.cjs +176 -2
- package/dist/quickhelp/index.d.cts +11 -0
- package/dist/quickhelp/index.d.ts +11 -0
- package/dist/quickhelp/index.js +174 -2
- package/dist/webhook/index.cjs +0 -18
- package/dist/webhook/index.d.cts +18 -29
- package/dist/webhook/index.d.ts +18 -29
- package/dist/webhook/index.js +0 -23
- package/dist/webhook/node.cjs +57 -0
- package/dist/webhook/node.d.cts +440 -0
- package/dist/webhook/node.d.ts +440 -0
- package/dist/webhook/node.js +30 -0
- package/package.json +14 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,65 @@
|
|
|
1
|
+
/** Metadata: string key-value pairs. Max 50 keys, 40-char keys, 500-char values. */
|
|
2
|
+
type Metadata = Record<string, string>;
|
|
3
|
+
/** Standard pagination parameters accepted by list endpoints. */
|
|
4
|
+
interface PaginationParams {
|
|
5
|
+
page?: number;
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
}
|
|
8
|
+
/** Pagination info returned in list responses. */
|
|
9
|
+
interface PaginationInfo {
|
|
10
|
+
total: number;
|
|
11
|
+
page: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
hasMore: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resource response — unwrapped bare object.
|
|
17
|
+
*
|
|
18
|
+
* Closes F-016. The historical envelope (`{success, data, meta}`) is now
|
|
19
|
+
* unwrapped at the HTTP-client boundary so callers can `const t = await
|
|
20
|
+
* cstar.tickets.create(...); console.log(t.id)` instead of `t.data.id`.
|
|
21
|
+
*
|
|
22
|
+
* Side-channel access: read `client.lastMeta` immediately after a call to
|
|
23
|
+
* grab the server `requestId` for support escalations.
|
|
24
|
+
*
|
|
25
|
+
* Kept as a type alias rather than removed so existing user code that
|
|
26
|
+
* imports the name keeps compiling.
|
|
27
|
+
*/
|
|
28
|
+
type ApiResponse<T> = T;
|
|
29
|
+
/**
|
|
30
|
+
* List response — unwrapped to `{data, pagination, hasMore}` (matches
|
|
31
|
+
* Stripe-style auto-pagination cursors but keeps server `pagination` info
|
|
32
|
+
* for callers who want totals).
|
|
33
|
+
*/
|
|
34
|
+
interface ListResponse<T> {
|
|
35
|
+
data: T[];
|
|
36
|
+
pagination: PaginationInfo;
|
|
37
|
+
/** Convenience: same as `pagination.hasMore`. */
|
|
38
|
+
hasMore: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Side-channel metadata from the most recent response. Mutable per-call,
|
|
42
|
+
* so read it immediately after the awaited call. Documented on every
|
|
43
|
+
* resource page as the way to grab `requestId` for support tickets.
|
|
44
|
+
*/
|
|
45
|
+
interface LastMeta {
|
|
46
|
+
requestId: string | null;
|
|
47
|
+
timestamp: string | null;
|
|
48
|
+
pagination: PaginationInfo | null;
|
|
49
|
+
}
|
|
50
|
+
/** Delete response body. */
|
|
51
|
+
interface DeleteResponse {
|
|
52
|
+
deleted: true;
|
|
53
|
+
id: string;
|
|
54
|
+
}
|
|
55
|
+
/** Per-request options passed to resource methods. */
|
|
56
|
+
interface RequestOptions {
|
|
57
|
+
/** Idempotency key for safe retries on POST/PATCH. */
|
|
58
|
+
idempotencyKey?: string;
|
|
59
|
+
/** Related resources to expand inline. */
|
|
60
|
+
expand?: string[];
|
|
61
|
+
}
|
|
62
|
+
|
|
1
63
|
/** Configuration for the HTTP client. */
|
|
2
64
|
interface ClientConfig {
|
|
3
65
|
apiKey: string;
|
|
@@ -21,12 +83,46 @@ declare class HttpClient {
|
|
|
21
83
|
private readonly config;
|
|
22
84
|
/** Whether this client uses test mode keys. */
|
|
23
85
|
readonly environment: 'live' | 'test';
|
|
86
|
+
/**
|
|
87
|
+
* Side-channel metadata from the most recent response. Holds the server
|
|
88
|
+
* `requestId`, `timestamp`, and (for list endpoints) `pagination`. Mutable
|
|
89
|
+
* per-call — read it immediately after awaiting the call.
|
|
90
|
+
*
|
|
91
|
+
* ```ts
|
|
92
|
+
* const ticket = await cstar.tickets.create({...});
|
|
93
|
+
* console.error('Created ticket', ticket.id, 'request:', cstar.lastMeta.requestId);
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
lastMeta: LastMeta;
|
|
24
97
|
constructor(config: ClientConfig);
|
|
25
98
|
/**
|
|
26
99
|
* Make an authenticated request to the cStar API.
|
|
27
100
|
* Automatically retries on 5xx errors and rate limits.
|
|
28
101
|
*/
|
|
29
102
|
request<T>(method: string, path: string, options?: FetchOptions): Promise<T>;
|
|
103
|
+
/**
|
|
104
|
+
* Like `request()` but skips the `/api/v1/teams/{teamId}` prefix. Used for
|
|
105
|
+
* the small set of non-team-scoped endpoints (`/auth/whoami`, etc).
|
|
106
|
+
*
|
|
107
|
+
* @internal — exposed to CStarClient for `whoami()` and similar; not part
|
|
108
|
+
* of the documented public surface.
|
|
109
|
+
*/
|
|
110
|
+
requestUnscoped<T>(method: string, path: string, options?: FetchOptions): Promise<T>;
|
|
111
|
+
private appendQuery;
|
|
112
|
+
private _sendRequest;
|
|
113
|
+
/**
|
|
114
|
+
* Capture `meta`, `requestId`, and `pagination` from the raw response
|
|
115
|
+
* into `this.lastMeta` before unwrapping the envelope.
|
|
116
|
+
*/
|
|
117
|
+
private captureMeta;
|
|
118
|
+
/**
|
|
119
|
+
* Unwrap the legacy `{success, data, meta, pagination?}` envelope.
|
|
120
|
+
* - `{success:true, data: array, pagination}` → `{data, pagination, hasMore}`
|
|
121
|
+
* - `{success:true, data: object}` → `data` (bare resource)
|
|
122
|
+
* - other shapes pass through unchanged so subpath SDKs (chat, library) keep
|
|
123
|
+
* their bespoke shapes for now.
|
|
124
|
+
*/
|
|
125
|
+
private unwrapEnvelope;
|
|
30
126
|
private buildUrl;
|
|
31
127
|
private buildHeaders;
|
|
32
128
|
/** Get the base URL for building SSE or other endpoints. */
|
|
@@ -140,52 +236,6 @@ declare class CStarRealtime {
|
|
|
140
236
|
private scheduleTokenRefresh;
|
|
141
237
|
}
|
|
142
238
|
|
|
143
|
-
/** Metadata: string key-value pairs. Max 50 keys, 40-char keys, 500-char values. */
|
|
144
|
-
type Metadata = Record<string, string>;
|
|
145
|
-
/** Standard pagination parameters accepted by list endpoints. */
|
|
146
|
-
interface PaginationParams {
|
|
147
|
-
page?: number;
|
|
148
|
-
pageSize?: number;
|
|
149
|
-
}
|
|
150
|
-
/** Pagination info returned in list responses. */
|
|
151
|
-
interface PaginationInfo {
|
|
152
|
-
total: number;
|
|
153
|
-
page: number;
|
|
154
|
-
pageSize: number;
|
|
155
|
-
hasMore: boolean;
|
|
156
|
-
}
|
|
157
|
-
/** API response envelope for single objects. */
|
|
158
|
-
interface ApiResponse<T> {
|
|
159
|
-
success: true;
|
|
160
|
-
data: T;
|
|
161
|
-
meta: {
|
|
162
|
-
requestId: string;
|
|
163
|
-
timestamp: string;
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
/** API response envelope for lists with pagination. */
|
|
167
|
-
interface ListResponse<T> {
|
|
168
|
-
success: true;
|
|
169
|
-
data: T[];
|
|
170
|
-
pagination: PaginationInfo;
|
|
171
|
-
meta: {
|
|
172
|
-
requestId: string;
|
|
173
|
-
timestamp: string;
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
/** Delete response body. */
|
|
177
|
-
interface DeleteResponse {
|
|
178
|
-
deleted: true;
|
|
179
|
-
id: string;
|
|
180
|
-
}
|
|
181
|
-
/** Per-request options passed to resource methods. */
|
|
182
|
-
interface RequestOptions {
|
|
183
|
-
/** Idempotency key for safe retries on POST/PATCH. */
|
|
184
|
-
idempotencyKey?: string;
|
|
185
|
-
/** Related resources to expand inline. */
|
|
186
|
-
expand?: string[];
|
|
187
|
-
}
|
|
188
|
-
|
|
189
239
|
/** A message on a ticket. */
|
|
190
240
|
interface Message {
|
|
191
241
|
id: string;
|
|
@@ -324,6 +374,10 @@ declare class Subscription$1<T = unknown> {
|
|
|
324
374
|
/**
|
|
325
375
|
* Base resource class implementing standard CRUD operations.
|
|
326
376
|
* Resource-specific classes extend this with their own type parameters.
|
|
377
|
+
*
|
|
378
|
+
* As of 0.13.0 every method returns the unwrapped resource (or unwrapped
|
|
379
|
+
* `{data, pagination, hasMore}` for list endpoints). Closes F-016. Read
|
|
380
|
+
* `client.lastMeta.requestId` for the server request ID.
|
|
327
381
|
*/
|
|
328
382
|
declare abstract class BaseResource<TEntity, TListParams extends PaginationParams, TCreateParams, TUpdateParams> {
|
|
329
383
|
protected readonly client: HttpClient;
|
|
@@ -332,13 +386,13 @@ declare abstract class BaseResource<TEntity, TListParams extends PaginationParam
|
|
|
332
386
|
/** List resources with optional filtering and pagination. */
|
|
333
387
|
list(params?: TListParams & RequestOptions): Promise<ListResponse<TEntity>>;
|
|
334
388
|
/** Get a single resource by ID. */
|
|
335
|
-
get(id: string, options?: RequestOptions): Promise<
|
|
389
|
+
get(id: string, options?: RequestOptions): Promise<TEntity>;
|
|
336
390
|
/** Create a new resource. */
|
|
337
|
-
create(params: TCreateParams, options?: RequestOptions): Promise<
|
|
391
|
+
create(params: TCreateParams, options?: RequestOptions): Promise<TEntity>;
|
|
338
392
|
/** Update an existing resource. */
|
|
339
|
-
update(id: string, params: TUpdateParams, options?: RequestOptions): Promise<
|
|
393
|
+
update(id: string, params: TUpdateParams, options?: RequestOptions): Promise<TEntity>;
|
|
340
394
|
/** Delete a resource by ID. */
|
|
341
|
-
del(id: string): Promise<
|
|
395
|
+
del(id: string): Promise<DeleteResponse>;
|
|
342
396
|
/**
|
|
343
397
|
* Auto-paginating async iterator that yields every item across all pages.
|
|
344
398
|
*
|
|
@@ -371,9 +425,9 @@ declare class TicketMessagesResource {
|
|
|
371
425
|
private readonly client;
|
|
372
426
|
constructor(client: HttpClient);
|
|
373
427
|
/** List all messages on a ticket. */
|
|
374
|
-
list(ticketId: string): Promise<
|
|
428
|
+
list(ticketId: string): Promise<ListResponse<Message>>;
|
|
375
429
|
/** Add a message to a ticket. */
|
|
376
|
-
create(ticketId: string, params: MessageCreateParams, options?: RequestOptions): Promise<
|
|
430
|
+
create(ticketId: string, params: MessageCreateParams, options?: RequestOptions): Promise<Message>;
|
|
377
431
|
}
|
|
378
432
|
/** Manage support tickets. */
|
|
379
433
|
declare class TicketsResource extends BaseResource<Ticket, TicketListParams, TicketCreateParams, TicketUpdateParams> {
|
|
@@ -799,6 +853,10 @@ interface TicketClosedPayload {
|
|
|
799
853
|
channel: string;
|
|
800
854
|
resolved_at: string;
|
|
801
855
|
};
|
|
856
|
+
changes?: Record<string, {
|
|
857
|
+
from: string;
|
|
858
|
+
to: string;
|
|
859
|
+
}>;
|
|
802
860
|
}
|
|
803
861
|
/** Payload for `ticket.created` events. */
|
|
804
862
|
interface TicketCreatedPayload {
|
|
@@ -851,12 +909,13 @@ interface TicketUpdatedPayload {
|
|
|
851
909
|
priority: string;
|
|
852
910
|
channel: string;
|
|
853
911
|
};
|
|
854
|
-
changes
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
912
|
+
changes?: Record<string, {
|
|
913
|
+
from: string;
|
|
914
|
+
to: string;
|
|
915
|
+
} | {
|
|
916
|
+
from: Array<string>;
|
|
917
|
+
to: Array<string>;
|
|
918
|
+
}>;
|
|
860
919
|
}
|
|
861
920
|
/** Maps each event type to its payload interface — used internally for the discriminated union. */
|
|
862
921
|
interface WebhookEventDataMap {
|
|
@@ -1255,6 +1314,19 @@ interface CommunityTopic {
|
|
|
1255
1314
|
postCount: number;
|
|
1256
1315
|
createdAt: string;
|
|
1257
1316
|
}
|
|
1317
|
+
/** Parameters for creating a community topic via the admin SDK. */
|
|
1318
|
+
interface CommunityTopicCreateParams {
|
|
1319
|
+
name: string;
|
|
1320
|
+
slug?: string;
|
|
1321
|
+
description?: string;
|
|
1322
|
+
icon?: string;
|
|
1323
|
+
sortOrder?: number;
|
|
1324
|
+
visibility?: 'public' | 'members_only';
|
|
1325
|
+
requireApproval?: boolean;
|
|
1326
|
+
postGuide?: string;
|
|
1327
|
+
}
|
|
1328
|
+
/** Parameters for updating a community topic. All fields optional. */
|
|
1329
|
+
type CommunityTopicUpdateParams = Partial<CommunityTopicCreateParams>;
|
|
1258
1330
|
/** A community discussion post. */
|
|
1259
1331
|
interface CommunityPost {
|
|
1260
1332
|
id: string;
|
|
@@ -1347,8 +1419,19 @@ declare class CommunityPostsResource extends BaseResource<CommunityPost, Communi
|
|
|
1347
1419
|
createComment(postId: string, params: CommunityCommentCreateParams): Promise<ApiResponse<CommunityComment>>;
|
|
1348
1420
|
}
|
|
1349
1421
|
|
|
1350
|
-
/**
|
|
1351
|
-
|
|
1422
|
+
/**
|
|
1423
|
+
* Manage community discussion topics.
|
|
1424
|
+
*
|
|
1425
|
+
* As of 0.13.0 the resource exposes the full CRUD admin surface (closes
|
|
1426
|
+
* F-035): `create`, `update`, `delete` were previously dashboard-only.
|
|
1427
|
+
*
|
|
1428
|
+
* ```ts
|
|
1429
|
+
* const topic = await cstar.community.topics.create({ name: 'General' });
|
|
1430
|
+
* await cstar.community.topics.update(topic.id, { description: '...' });
|
|
1431
|
+
* await cstar.community.topics.del(topic.id);
|
|
1432
|
+
* ```
|
|
1433
|
+
*/
|
|
1434
|
+
declare class CommunityTopicsResource extends BaseResource<CommunityTopic, Record<string, never>, CommunityTopicCreateParams, CommunityTopicUpdateParams> {
|
|
1352
1435
|
constructor(client: HttpClient);
|
|
1353
1436
|
}
|
|
1354
1437
|
|
|
@@ -2725,8 +2808,17 @@ declare class GameResource {
|
|
|
2725
2808
|
}): Promise<ApiResponse<Player>>;
|
|
2726
2809
|
/** Get a specific player's stats by membership ID. */
|
|
2727
2810
|
getPlayer(memberId: string): Promise<ApiResponse<Player>>;
|
|
2728
|
-
/**
|
|
2729
|
-
|
|
2811
|
+
/**
|
|
2812
|
+
* Get the team leaderboard. Returns the unwrapped envelope from the
|
|
2813
|
+
* `/game/leaderboard` endpoint (`{entries, totalParticipants, period, ...}`)
|
|
2814
|
+
* — wider than a flat array because the server includes the period and
|
|
2815
|
+
* a participant count alongside the entries.
|
|
2816
|
+
*/
|
|
2817
|
+
leaderboard(params?: LeaderboardParams): Promise<{
|
|
2818
|
+
entries: LeaderboardEntry[];
|
|
2819
|
+
totalParticipants?: number;
|
|
2820
|
+
period?: string;
|
|
2821
|
+
}>;
|
|
2730
2822
|
/** Get the current user's leaderboard position. */
|
|
2731
2823
|
myRank(params?: {
|
|
2732
2824
|
userId?: string;
|
|
@@ -2944,6 +3036,7 @@ declare const ErrorType: {
|
|
|
2944
3036
|
readonly NOT_FOUND_ERROR: "not_found_error";
|
|
2945
3037
|
readonly CONFLICT_ERROR: "conflict_error";
|
|
2946
3038
|
readonly RATE_LIMIT_ERROR: "rate_limit_error";
|
|
3039
|
+
readonly FEATURE_NOT_CONFIGURED: "feature_not_configured";
|
|
2947
3040
|
readonly API_ERROR: "api_error";
|
|
2948
3041
|
readonly SERVER_ERROR: "server_error";
|
|
2949
3042
|
};
|
|
@@ -2955,6 +3048,8 @@ interface ApiErrorBody {
|
|
|
2955
3048
|
param?: string;
|
|
2956
3049
|
doc_url: string;
|
|
2957
3050
|
request_id?: string;
|
|
3051
|
+
feature?: string;
|
|
3052
|
+
enable_url?: string;
|
|
2958
3053
|
}
|
|
2959
3054
|
/** Base error class for all cStar API errors. */
|
|
2960
3055
|
declare class CStarError extends Error {
|
|
@@ -2964,36 +3059,50 @@ declare class CStarError extends Error {
|
|
|
2964
3059
|
readonly docUrl: string;
|
|
2965
3060
|
readonly requestId?: string;
|
|
2966
3061
|
readonly statusCode: number;
|
|
2967
|
-
constructor(
|
|
3062
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
2968
3063
|
}
|
|
2969
|
-
/** Thrown when authentication fails (401
|
|
3064
|
+
/** Thrown when authentication fails (401). */
|
|
2970
3065
|
declare class CStarAuthenticationError extends CStarError {
|
|
2971
|
-
constructor(
|
|
3066
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
2972
3067
|
}
|
|
2973
3068
|
/** Thrown when rate limited (429). Includes retry timing. */
|
|
2974
3069
|
declare class CStarRateLimitError extends CStarError {
|
|
2975
3070
|
readonly retryAfter: number;
|
|
2976
|
-
constructor(
|
|
3071
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody, retryAfter?: number);
|
|
2977
3072
|
}
|
|
2978
3073
|
/** Thrown when a resource is not found (404). */
|
|
2979
3074
|
declare class CStarNotFoundError extends CStarError {
|
|
2980
|
-
constructor(
|
|
3075
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
2981
3076
|
}
|
|
2982
|
-
/** Thrown on invalid request parameters (400). */
|
|
3077
|
+
/** Thrown on invalid request parameters (400/422). */
|
|
2983
3078
|
declare class CStarValidationError extends CStarError {
|
|
2984
|
-
constructor(
|
|
3079
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
2985
3080
|
}
|
|
2986
3081
|
/** Thrown when authenticated but lacking permission (403). */
|
|
2987
3082
|
declare class CStarPermissionError extends CStarError {
|
|
2988
|
-
constructor(
|
|
3083
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
2989
3084
|
}
|
|
2990
3085
|
/** Thrown on resource conflicts (409). */
|
|
2991
3086
|
declare class CStarConflictError extends CStarError {
|
|
2992
|
-
constructor(
|
|
3087
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
2993
3088
|
}
|
|
2994
3089
|
/** Thrown on internal server errors (500+). */
|
|
2995
3090
|
declare class CStarServerError extends CStarError {
|
|
2996
|
-
constructor(
|
|
3091
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
3092
|
+
}
|
|
3093
|
+
/**
|
|
3094
|
+
* Thrown when the call landed on a feature that the team has not enabled
|
|
3095
|
+
* or configured (e.g. Quick Help on a team without an AI agent). Carries
|
|
3096
|
+
* `feature` and `enableUrl` so the caller can route the user to the
|
|
3097
|
+
* dashboard setting that fixes it.
|
|
3098
|
+
*
|
|
3099
|
+
* Closes F-031 — anonymous QuickHelp `.ask()` previously surfaced as an
|
|
3100
|
+
* unactionable 503.
|
|
3101
|
+
*/
|
|
3102
|
+
declare class CStarFeatureDisabledError extends CStarError {
|
|
3103
|
+
readonly feature: string;
|
|
3104
|
+
readonly enableUrl: string;
|
|
3105
|
+
constructor(messageOrStatus: string | number, body?: ApiErrorBody);
|
|
2997
3106
|
}
|
|
2998
3107
|
|
|
2999
3108
|
/** Configuration for the CStarClient. */
|
|
@@ -3111,6 +3220,40 @@ declare class CStarClient {
|
|
|
3111
3220
|
destroy(): void;
|
|
3112
3221
|
/** Whether this client is using test mode keys (sk_test_* or pk_test_*). */
|
|
3113
3222
|
get isTestMode(): boolean;
|
|
3223
|
+
/**
|
|
3224
|
+
* Validate the configured API key and return the team + key metadata it
|
|
3225
|
+
* resolves to. Useful for confirming the key is wired up correctly during
|
|
3226
|
+
* onboarding (and for AI assistants that want a one-call sanity check).
|
|
3227
|
+
*
|
|
3228
|
+
* Closes F-018.
|
|
3229
|
+
*
|
|
3230
|
+
* ```ts
|
|
3231
|
+
* const me = await cstar.whoami();
|
|
3232
|
+
* console.log(me.teamSlug, me.environment); // 'acme', 'test'
|
|
3233
|
+
* ```
|
|
3234
|
+
*/
|
|
3235
|
+
whoami(): Promise<{
|
|
3236
|
+
teamId: string;
|
|
3237
|
+
teamName: string;
|
|
3238
|
+
teamSlug: string;
|
|
3239
|
+
keyId: string;
|
|
3240
|
+
keyType: 'secret' | 'publishable';
|
|
3241
|
+
environment: 'live' | 'test';
|
|
3242
|
+
createdAt: string;
|
|
3243
|
+
subscriptionStatus: string;
|
|
3244
|
+
}>;
|
|
3245
|
+
/**
|
|
3246
|
+
* Side-channel metadata from the most recent HTTP response. Holds the
|
|
3247
|
+
* server `requestId` (for support escalations), `timestamp`, and the
|
|
3248
|
+
* `pagination` info from list endpoints. Reset on every call — read it
|
|
3249
|
+
* immediately after awaiting the call you care about.
|
|
3250
|
+
*
|
|
3251
|
+
* ```ts
|
|
3252
|
+
* const ticket = await cstar.tickets.create({...});
|
|
3253
|
+
* console.error('Created', ticket.id, 'request:', cstar.lastMeta.requestId);
|
|
3254
|
+
* ```
|
|
3255
|
+
*/
|
|
3256
|
+
get lastMeta(): LastMeta;
|
|
3114
3257
|
}
|
|
3115
3258
|
|
|
3116
|
-
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiErrorBody, 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, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarConflictError, CStarError, CStarNotFoundError, CStarPermissionError, CStarRateLimitError, CStarRealtime, CStarServerError, CStarValidationError, 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, ErrorType, 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 WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetSettings, type WidgetSettingsUpdateParams };
|
|
3259
|
+
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiErrorBody, 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, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarConflictError, CStarError, CStarFeatureDisabledError, CStarNotFoundError, CStarPermissionError, CStarRateLimitError, CStarRealtime, CStarServerError, CStarValidationError, 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, ErrorType, 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 WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookListener, type WebhookListenerParams, type WebhookSubscribeParams, type WebhookSubscription, type WebhookTestResult, type WebhookTriggerTestParams, type WebhookTriggerTestResult, type WebhookUpdateParams, type WidgetSettings, type WidgetSettingsUpdateParams };
|