@cstar.help/js 0.17.3 → 0.17.5
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 +37 -13
- package/dist/auth/index.d.cts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/community/index.d.cts +1 -1
- package/dist/community/index.d.ts +1 -1
- package/dist/errors-bW8CwTn4.d.cts +121 -0
- package/dist/errors-bW8CwTn4.d.ts +121 -0
- package/dist/index.cjs +24 -15
- package/dist/index.d.cts +74 -30
- package/dist/index.d.ts +74 -30
- package/dist/index.js +24 -15
- package/dist/library/index.d.cts +1 -1
- package/dist/library/index.d.ts +1 -1
- package/dist/quickhelp/index.d.cts +1 -1
- package/dist/quickhelp/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/errors-b5A4wfAg.d.cts +0 -398
- package/dist/errors-b5A4wfAg.d.ts +0 -398
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { W as WebhookEventType, a as WebhookEventDataMap } from './webhookEvents-1N2i2GcQ.cjs';
|
|
2
2
|
export { b as WEBHOOK_EVENT_CATALOG, c as WEBHOOK_EVENT_SAMPLES, d as WebhookEvent } from './webhookEvents-1N2i2GcQ.cjs';
|
|
3
|
-
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, h as CStarServerError, i as CStarValidationError, E as ErrorType } from './errors-
|
|
3
|
+
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, h as CStarServerError, i as CStarValidationError, E as ErrorType } from './errors-bW8CwTn4.cjs';
|
|
4
4
|
|
|
5
5
|
/** Metadata: string key-value pairs. Max 50 keys, 40-char keys, 500-char values. */
|
|
6
6
|
type Metadata = Record<string, string>;
|
|
@@ -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.
|
|
@@ -277,6 +279,9 @@ declare class CStarRealtime {
|
|
|
277
279
|
interface Message {
|
|
278
280
|
id: string;
|
|
279
281
|
object: 'message';
|
|
282
|
+
ticketId: string;
|
|
283
|
+
/** True for a note visible only to the support team. */
|
|
284
|
+
isInternal: boolean;
|
|
280
285
|
sender: 'customer' | 'agent' | 'system';
|
|
281
286
|
content: string;
|
|
282
287
|
senderId: string | null;
|
|
@@ -291,7 +296,12 @@ interface MessageCreateParams {
|
|
|
291
296
|
sender?: 'customer' | 'agent' | 'system';
|
|
292
297
|
senderId?: string;
|
|
293
298
|
senderName?: string;
|
|
299
|
+
messageType?: 'public' | 'internal';
|
|
300
|
+
/** Boolean alias for messageType. If both are supplied, they must agree. */
|
|
301
|
+
isInternal?: boolean;
|
|
294
302
|
}
|
|
303
|
+
/** Pagination options for a ticket message history. */
|
|
304
|
+
type MessageListParams = PaginationParams;
|
|
295
305
|
|
|
296
306
|
/** A cStar support ticket. */
|
|
297
307
|
interface Ticket {
|
|
@@ -469,8 +479,8 @@ declare abstract class BaseResource<TEntity, TListParams extends PaginationParam
|
|
|
469
479
|
declare class TicketMessagesResource {
|
|
470
480
|
private readonly client;
|
|
471
481
|
constructor(client: HttpClient);
|
|
472
|
-
/** List
|
|
473
|
-
list(ticketId: string): Promise<ListResponse<Message>>;
|
|
482
|
+
/** List one page of a ticket history. Use pagination.hasMore to request the next page. */
|
|
483
|
+
list(ticketId: string, params?: MessageListParams): Promise<ListResponse<Message>>;
|
|
474
484
|
/** Add a message to a ticket. */
|
|
475
485
|
create(ticketId: string, params: MessageCreateParams, options?: RequestOptions): Promise<Message>;
|
|
476
486
|
}
|
|
@@ -708,7 +718,7 @@ declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams,
|
|
|
708
718
|
/** Fire a test webhook event to all active webhooks and CLI listeners. */
|
|
709
719
|
triggerTest(params: WebhookTriggerTestParams, options?: RequestOptions): Promise<ApiResponse<WebhookTriggerTestResult>>;
|
|
710
720
|
/** Get a sample webhook payload for an event type (used by Zapier). */
|
|
711
|
-
sample(event: string): Promise<
|
|
721
|
+
sample(event: string): Promise<ListResponse<unknown>>;
|
|
712
722
|
/** Subscribe to an event (REST Hooks / Zapier protocol). */
|
|
713
723
|
restSubscribe(params: WebhookSubscribeParams, options?: RequestOptions): Promise<ApiResponse<WebhookSubscription>>;
|
|
714
724
|
/** Unsubscribe from an event (REST Hooks / Zapier protocol). Returns void (204 No Content). */
|
|
@@ -847,7 +857,7 @@ declare class AutomationsResource extends BaseResource<AutomationRule, Automatio
|
|
|
847
857
|
/** Toggle a rule's enabled state. */
|
|
848
858
|
toggle(ruleId: string, enabled?: boolean): Promise<ApiResponse<AutomationRule>>;
|
|
849
859
|
/** Reorder rules by providing an ordered array of IDs. */
|
|
850
|
-
reorder(orderedIds: string[]): Promise<
|
|
860
|
+
reorder(orderedIds: string[]): Promise<ListResponse<AutomationRule>>;
|
|
851
861
|
/** Dry-run a rule against a specific resource (no actions executed). */
|
|
852
862
|
test(ruleId: string, params: {
|
|
853
863
|
resourceType: string;
|
|
@@ -1053,7 +1063,7 @@ declare class CommunityPostsResource extends BaseResource<CommunityPost, Communi
|
|
|
1053
1063
|
following: boolean;
|
|
1054
1064
|
}>>;
|
|
1055
1065
|
/** List all comments on a post. */
|
|
1056
|
-
listComments(postId: string): Promise<
|
|
1066
|
+
listComments(postId: string): Promise<ListResponse<CommunityComment>>;
|
|
1057
1067
|
/** Add a comment to a post. */
|
|
1058
1068
|
createComment(postId: string, params: CommunityCommentCreateParams): Promise<ApiResponse<CommunityComment>>;
|
|
1059
1069
|
}
|
|
@@ -1282,7 +1292,7 @@ declare class StatusesResource {
|
|
|
1282
1292
|
private readonly client;
|
|
1283
1293
|
constructor(client: HttpClient);
|
|
1284
1294
|
/** List all statuses. */
|
|
1285
|
-
list(): Promise<
|
|
1295
|
+
list(): Promise<ListResponse<TicketStatus>>;
|
|
1286
1296
|
/** Create a new status. */
|
|
1287
1297
|
create(params: StatusCreateParams, options?: RequestOptions): Promise<ApiResponse<TicketStatus>>;
|
|
1288
1298
|
/** Update a status. */
|
|
@@ -1290,14 +1300,14 @@ declare class StatusesResource {
|
|
|
1290
1300
|
/** Delete a status. */
|
|
1291
1301
|
del(statusKey: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1292
1302
|
/** Reorder statuses. */
|
|
1293
|
-
reorder(orderedKeys: string[]): Promise<
|
|
1303
|
+
reorder(orderedKeys: string[]): Promise<ListResponse<TicketStatus>>;
|
|
1294
1304
|
}
|
|
1295
1305
|
/** Manage quick reply templates. */
|
|
1296
1306
|
declare class QuickRepliesResource {
|
|
1297
1307
|
private readonly client;
|
|
1298
1308
|
constructor(client: HttpClient);
|
|
1299
1309
|
/** List all quick replies. */
|
|
1300
|
-
list(): Promise<
|
|
1310
|
+
list(): Promise<ListResponse<QuickReply>>;
|
|
1301
1311
|
/** Create a new quick reply. */
|
|
1302
1312
|
create(params: QuickReplyCreateParams, options?: RequestOptions): Promise<ApiResponse<QuickReply>>;
|
|
1303
1313
|
/** Update a quick reply. */
|
|
@@ -1305,7 +1315,7 @@ declare class QuickRepliesResource {
|
|
|
1305
1315
|
/** Delete a quick reply. */
|
|
1306
1316
|
del(replyId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1307
1317
|
/** Reorder quick replies. */
|
|
1308
|
-
reorder(orderedIds: string[]): Promise<
|
|
1318
|
+
reorder(orderedIds: string[]): Promise<ListResponse<QuickReply>>;
|
|
1309
1319
|
}
|
|
1310
1320
|
/** Manage team settings. */
|
|
1311
1321
|
declare class SettingsResource {
|
|
@@ -1500,7 +1510,10 @@ declare class CustomFieldsResource {
|
|
|
1500
1510
|
/** Delete a custom field. */
|
|
1501
1511
|
del(fieldId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1502
1512
|
/** Reorder custom fields within a content type. */
|
|
1503
|
-
reorder(contentType: 'ticket' | 'customer' | 'article', orderedIds: string[]): Promise<
|
|
1513
|
+
reorder(contentType: 'ticket' | 'customer' | 'article', orderedIds: string[]): Promise<{
|
|
1514
|
+
success: true;
|
|
1515
|
+
reordered: number;
|
|
1516
|
+
}>;
|
|
1504
1517
|
}
|
|
1505
1518
|
|
|
1506
1519
|
/** An SLA rule. */
|
|
@@ -1569,7 +1582,7 @@ declare class SlaResource {
|
|
|
1569
1582
|
/** Delete an SLA rule. */
|
|
1570
1583
|
del(ruleId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1571
1584
|
/** Reorder SLA rules by providing an ordered array of IDs. */
|
|
1572
|
-
reorder(orderedIds: string[]): Promise<
|
|
1585
|
+
reorder(orderedIds: string[]): Promise<ListResponse<SlaRule>>;
|
|
1573
1586
|
/** Get SLA compliance metrics. */
|
|
1574
1587
|
metrics(params?: SlaMetricsParams): Promise<ApiResponse<SlaMetrics>>;
|
|
1575
1588
|
}
|
|
@@ -1744,20 +1757,41 @@ declare class BulkResource {
|
|
|
1744
1757
|
del(params: BulkDeleteParams, options?: RequestOptions): Promise<ApiResponse<BulkResult>>;
|
|
1745
1758
|
}
|
|
1746
1759
|
|
|
1747
|
-
/**
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1760
|
+
/** Resource tables supported by the export endpoint. */
|
|
1761
|
+
type ExportResourceType = 'tickets' | 'customers' | 'articles';
|
|
1762
|
+
/** Filters shared by all selected resources. */
|
|
1763
|
+
interface ExportFilters {
|
|
1764
|
+
status?: string;
|
|
1765
|
+
priority?: string;
|
|
1766
|
+
createdAfter?: string;
|
|
1767
|
+
createdBefore?: string;
|
|
1768
|
+
}
|
|
1769
|
+
/** JSON may export multiple resources or default to all three. */
|
|
1770
|
+
interface ExportJsonParams {
|
|
1771
|
+
resources?: readonly [ExportResourceType, ...ExportResourceType[]];
|
|
1772
|
+
format?: 'json';
|
|
1773
|
+
filters?: ExportFilters;
|
|
1774
|
+
}
|
|
1775
|
+
/** CSV must select exactly one resource, including when passed through a helper. */
|
|
1776
|
+
interface ExportCsvParams {
|
|
1777
|
+
resources: readonly [ExportResourceType];
|
|
1778
|
+
format: 'csv';
|
|
1779
|
+
filters?: ExportFilters;
|
|
1780
|
+
}
|
|
1781
|
+
/** Export parameters preserve the relationship between format and resources. */
|
|
1782
|
+
type ExportCreateParams = ExportJsonParams | ExportCsvParams;
|
|
1783
|
+
/** JSON export with raw database rows, unlike the mapped API resource objects. */
|
|
1756
1784
|
interface ExportResult {
|
|
1757
1785
|
object: 'export';
|
|
1758
|
-
format:
|
|
1759
|
-
|
|
1760
|
-
|
|
1786
|
+
format: 'json';
|
|
1787
|
+
exportedAt: string;
|
|
1788
|
+
teamId: string;
|
|
1789
|
+
tickets?: Record<string, unknown>[];
|
|
1790
|
+
customers?: Record<string, unknown>[];
|
|
1791
|
+
articles?: Record<string, unknown>[];
|
|
1792
|
+
/** Included when the selected tickets have messages. */
|
|
1793
|
+
messages?: Record<string, unknown>[];
|
|
1794
|
+
summary: Partial<Record<ExportResourceType | 'messages', number>>;
|
|
1761
1795
|
}
|
|
1762
1796
|
|
|
1763
1797
|
/** Import request parameters. */
|
|
@@ -1828,8 +1862,12 @@ interface ImportLogListParams extends PaginationParams {
|
|
|
1828
1862
|
declare class ExportResource {
|
|
1829
1863
|
private readonly client;
|
|
1830
1864
|
constructor(client: HttpClient);
|
|
1831
|
-
/** Create
|
|
1832
|
-
create(params:
|
|
1865
|
+
/** Create a CSV export. The API returns text for a single resource. */
|
|
1866
|
+
create(params: ExportCsvParams, options?: RequestOptions): Promise<string>;
|
|
1867
|
+
/** Create a JSON export with raw rows and per-resource counts. */
|
|
1868
|
+
create(params: ExportJsonParams, options?: RequestOptions): Promise<ExportResult>;
|
|
1869
|
+
/** A runtime-selected format returns JSON or CSV text accordingly. */
|
|
1870
|
+
create(params: ExportCreateParams, options?: RequestOptions): Promise<ExportResult | string>;
|
|
1833
1871
|
}
|
|
1834
1872
|
/** Import data into your team. */
|
|
1835
1873
|
declare class ImportResource {
|
|
@@ -1893,13 +1931,19 @@ interface SearchParams {
|
|
|
1893
1931
|
types?: Array<'tickets' | 'customers' | 'articles'>;
|
|
1894
1932
|
limit?: number;
|
|
1895
1933
|
}
|
|
1934
|
+
/** Cross-resource search results with the original query and returned count. */
|
|
1935
|
+
interface SearchResponse {
|
|
1936
|
+
results: SearchResult[];
|
|
1937
|
+
total: number;
|
|
1938
|
+
query: string;
|
|
1939
|
+
}
|
|
1896
1940
|
|
|
1897
1941
|
/** Search across tickets, customers, and articles. */
|
|
1898
1942
|
declare class SearchResource {
|
|
1899
1943
|
private readonly client;
|
|
1900
1944
|
constructor(client: HttpClient);
|
|
1901
1945
|
/** Perform a cross-resource search. */
|
|
1902
|
-
query(params: SearchParams): Promise<
|
|
1946
|
+
query(params: SearchParams): Promise<SearchResponse>;
|
|
1903
1947
|
}
|
|
1904
1948
|
|
|
1905
1949
|
/** A tag with usage count. */
|
|
@@ -2489,7 +2533,7 @@ declare class AchievementsResource {
|
|
|
2489
2533
|
/** List unlocked achievements only. */
|
|
2490
2534
|
unlocked(params?: {
|
|
2491
2535
|
userId: string;
|
|
2492
|
-
}): Promise<
|
|
2536
|
+
}): Promise<ListResponse<Achievement>>;
|
|
2493
2537
|
/** Get a single achievement. */
|
|
2494
2538
|
get(achievementId: string, params?: {
|
|
2495
2539
|
userId?: string;
|
|
@@ -2909,7 +2953,7 @@ interface CStarClientConfig {
|
|
|
2909
2953
|
* viewing your site.
|
|
2910
2954
|
*
|
|
2911
2955
|
* For client-side integrations, use:
|
|
2912
|
-
* - `@cstar.help/js/chat` — Customer chat widget (
|
|
2956
|
+
* - `@cstar.help/js/chat` — Customer chat widget (HMAC or customer session)
|
|
2913
2957
|
* - `@cstar.help/js/library` — Public knowledge base (no auth)
|
|
2914
2958
|
* - `@cstar.help/js/community` — Public community forum (no auth)
|
|
2915
2959
|
*
|
|
@@ -3037,4 +3081,4 @@ declare class CStarClient {
|
|
|
3037
3081
|
get lastMeta(): LastMeta;
|
|
3038
3082
|
}
|
|
3039
3083
|
|
|
3040
|
-
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 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 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 };
|
|
3084
|
+
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, type Attachment, type AttachmentListParams, type AuditLogEntry, type AuditLogListParams, type AutomationAction, type AutomationCondition, type AutomationConditions, type AutomationCreateParams, type AutomationExecution, type AutomationExecutionListParams, type AutomationListParams, type AutomationRule, type AutomationTestResult, type AutomationUpdateParams, type BillingPortal, type BillingPortalParams, type Boss, type BossDamageParams, type BossDamageResult, type BossDefeat, type BossDefeatListParams, type BossSpawnParams, type BulkDeleteParams, type BulkResult, type BulkUpdateParams, type BusinessHours, type BusinessHoursUpdateParams, CStarClient, type CStarClientConfig, CStarRealtime, type Category, type CategoryCreateParams, type CategoryListParams, type CategoryUpdateParams, type CommunityComment, type CommunityCommentCreateParams, type CommunityPost, type CommunityPostCreateParams, type CommunityPostListParams, type CommunityPostUpdateParams, type CommunityTopic, type ConnectionHandler, type Cosmetic, type CosmeticListParams, type CosmeticPreferences, type CsatSettings, type CsatSettingsUpdateParams, type CsatStats, type CsatSurvey, type CsatSurveyCreateParams, type CsatSurveyListParams, type CurrentSeason, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerGroup, type CustomerGroupAddMembersParams, type CustomerGroupAddResult, type CustomerGroupCreateParams, type CustomerGroupListParams, type CustomerGroupMemberListParams, type CustomerGroupMembersResult, type CustomerGroupRemoveResult, type CustomerGroupUpdateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, type ErrorHandler, type EventHandler, type ExportCreateParams, type ExportCsvParams, type ExportFilters, type ExportJsonParams, type ExportResourceType, type ExportResult, type GameConfig, type HighFive, type HighFiveCanSend, type HighFiveCreateParams, type HighFiveListParams, type ImportCreateParams, type ImportLog, type ImportLogListParams, type ImportResult, type Invite, type InviteCreateParams, type InviteListParams, type LeaderboardEntry, type LeaderboardParams, type ListResponse, type Member, type MemberListParams, type MemberUpdateParams, type Mention, type MentionListParams, type MentionUnreadCount, type Message, type MessageCreateParams, type MessageListParams, type Metadata, type Notification, type NotificationListParams, OfflineQueue, type OfflineQueueOptions, type OneUp, type OneUpCreateParams, type OneUpListParams, type OneUpRemaining, type OneUpSendResult, type PaginationInfo, type PaginationParams, type Player, type Puzzle, type PuzzleCompleteParams, type PuzzleCompleteResult, type PuzzleLeaderboardParams, type PuzzleLeaderboardResult, type PuzzleStreak, type Quest, type QuestHistory, type QuestHistoryParams, type QuestList, type QueueItem, type QueueResult, type QuickReply, type QuickReplyCreateParams, type QuickReplyUpdateParams, type RealtimeEvent, type RealtimeOptions, type RequestOptions, type SavedView, type SearchParams, type SearchResponse, type SearchResult, type Season, type SeasonStats, type SkillAllocateParams, type SkillAllocateResult, type SkillTree, type SlaMetrics, type SlaMetricsParams, type SlaRule, type SlaRuleCreateParams, type 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { W as WebhookEventType, a as WebhookEventDataMap } from './webhookEvents-1N2i2GcQ.js';
|
|
2
2
|
export { b as WEBHOOK_EVENT_CATALOG, c as WEBHOOK_EVENT_SAMPLES, d as WebhookEvent } from './webhookEvents-1N2i2GcQ.js';
|
|
3
|
-
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, h as CStarServerError, i as CStarValidationError, E as ErrorType } from './errors-
|
|
3
|
+
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, h as CStarServerError, i as CStarValidationError, E as ErrorType } from './errors-bW8CwTn4.js';
|
|
4
4
|
|
|
5
5
|
/** Metadata: string key-value pairs. Max 50 keys, 40-char keys, 500-char values. */
|
|
6
6
|
type Metadata = Record<string, string>;
|
|
@@ -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.
|
|
@@ -277,6 +279,9 @@ declare class CStarRealtime {
|
|
|
277
279
|
interface Message {
|
|
278
280
|
id: string;
|
|
279
281
|
object: 'message';
|
|
282
|
+
ticketId: string;
|
|
283
|
+
/** True for a note visible only to the support team. */
|
|
284
|
+
isInternal: boolean;
|
|
280
285
|
sender: 'customer' | 'agent' | 'system';
|
|
281
286
|
content: string;
|
|
282
287
|
senderId: string | null;
|
|
@@ -291,7 +296,12 @@ interface MessageCreateParams {
|
|
|
291
296
|
sender?: 'customer' | 'agent' | 'system';
|
|
292
297
|
senderId?: string;
|
|
293
298
|
senderName?: string;
|
|
299
|
+
messageType?: 'public' | 'internal';
|
|
300
|
+
/** Boolean alias for messageType. If both are supplied, they must agree. */
|
|
301
|
+
isInternal?: boolean;
|
|
294
302
|
}
|
|
303
|
+
/** Pagination options for a ticket message history. */
|
|
304
|
+
type MessageListParams = PaginationParams;
|
|
295
305
|
|
|
296
306
|
/** A cStar support ticket. */
|
|
297
307
|
interface Ticket {
|
|
@@ -469,8 +479,8 @@ declare abstract class BaseResource<TEntity, TListParams extends PaginationParam
|
|
|
469
479
|
declare class TicketMessagesResource {
|
|
470
480
|
private readonly client;
|
|
471
481
|
constructor(client: HttpClient);
|
|
472
|
-
/** List
|
|
473
|
-
list(ticketId: string): Promise<ListResponse<Message>>;
|
|
482
|
+
/** List one page of a ticket history. Use pagination.hasMore to request the next page. */
|
|
483
|
+
list(ticketId: string, params?: MessageListParams): Promise<ListResponse<Message>>;
|
|
474
484
|
/** Add a message to a ticket. */
|
|
475
485
|
create(ticketId: string, params: MessageCreateParams, options?: RequestOptions): Promise<Message>;
|
|
476
486
|
}
|
|
@@ -708,7 +718,7 @@ declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams,
|
|
|
708
718
|
/** Fire a test webhook event to all active webhooks and CLI listeners. */
|
|
709
719
|
triggerTest(params: WebhookTriggerTestParams, options?: RequestOptions): Promise<ApiResponse<WebhookTriggerTestResult>>;
|
|
710
720
|
/** Get a sample webhook payload for an event type (used by Zapier). */
|
|
711
|
-
sample(event: string): Promise<
|
|
721
|
+
sample(event: string): Promise<ListResponse<unknown>>;
|
|
712
722
|
/** Subscribe to an event (REST Hooks / Zapier protocol). */
|
|
713
723
|
restSubscribe(params: WebhookSubscribeParams, options?: RequestOptions): Promise<ApiResponse<WebhookSubscription>>;
|
|
714
724
|
/** Unsubscribe from an event (REST Hooks / Zapier protocol). Returns void (204 No Content). */
|
|
@@ -847,7 +857,7 @@ declare class AutomationsResource extends BaseResource<AutomationRule, Automatio
|
|
|
847
857
|
/** Toggle a rule's enabled state. */
|
|
848
858
|
toggle(ruleId: string, enabled?: boolean): Promise<ApiResponse<AutomationRule>>;
|
|
849
859
|
/** Reorder rules by providing an ordered array of IDs. */
|
|
850
|
-
reorder(orderedIds: string[]): Promise<
|
|
860
|
+
reorder(orderedIds: string[]): Promise<ListResponse<AutomationRule>>;
|
|
851
861
|
/** Dry-run a rule against a specific resource (no actions executed). */
|
|
852
862
|
test(ruleId: string, params: {
|
|
853
863
|
resourceType: string;
|
|
@@ -1053,7 +1063,7 @@ declare class CommunityPostsResource extends BaseResource<CommunityPost, Communi
|
|
|
1053
1063
|
following: boolean;
|
|
1054
1064
|
}>>;
|
|
1055
1065
|
/** List all comments on a post. */
|
|
1056
|
-
listComments(postId: string): Promise<
|
|
1066
|
+
listComments(postId: string): Promise<ListResponse<CommunityComment>>;
|
|
1057
1067
|
/** Add a comment to a post. */
|
|
1058
1068
|
createComment(postId: string, params: CommunityCommentCreateParams): Promise<ApiResponse<CommunityComment>>;
|
|
1059
1069
|
}
|
|
@@ -1282,7 +1292,7 @@ declare class StatusesResource {
|
|
|
1282
1292
|
private readonly client;
|
|
1283
1293
|
constructor(client: HttpClient);
|
|
1284
1294
|
/** List all statuses. */
|
|
1285
|
-
list(): Promise<
|
|
1295
|
+
list(): Promise<ListResponse<TicketStatus>>;
|
|
1286
1296
|
/** Create a new status. */
|
|
1287
1297
|
create(params: StatusCreateParams, options?: RequestOptions): Promise<ApiResponse<TicketStatus>>;
|
|
1288
1298
|
/** Update a status. */
|
|
@@ -1290,14 +1300,14 @@ declare class StatusesResource {
|
|
|
1290
1300
|
/** Delete a status. */
|
|
1291
1301
|
del(statusKey: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1292
1302
|
/** Reorder statuses. */
|
|
1293
|
-
reorder(orderedKeys: string[]): Promise<
|
|
1303
|
+
reorder(orderedKeys: string[]): Promise<ListResponse<TicketStatus>>;
|
|
1294
1304
|
}
|
|
1295
1305
|
/** Manage quick reply templates. */
|
|
1296
1306
|
declare class QuickRepliesResource {
|
|
1297
1307
|
private readonly client;
|
|
1298
1308
|
constructor(client: HttpClient);
|
|
1299
1309
|
/** List all quick replies. */
|
|
1300
|
-
list(): Promise<
|
|
1310
|
+
list(): Promise<ListResponse<QuickReply>>;
|
|
1301
1311
|
/** Create a new quick reply. */
|
|
1302
1312
|
create(params: QuickReplyCreateParams, options?: RequestOptions): Promise<ApiResponse<QuickReply>>;
|
|
1303
1313
|
/** Update a quick reply. */
|
|
@@ -1305,7 +1315,7 @@ declare class QuickRepliesResource {
|
|
|
1305
1315
|
/** Delete a quick reply. */
|
|
1306
1316
|
del(replyId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1307
1317
|
/** Reorder quick replies. */
|
|
1308
|
-
reorder(orderedIds: string[]): Promise<
|
|
1318
|
+
reorder(orderedIds: string[]): Promise<ListResponse<QuickReply>>;
|
|
1309
1319
|
}
|
|
1310
1320
|
/** Manage team settings. */
|
|
1311
1321
|
declare class SettingsResource {
|
|
@@ -1500,7 +1510,10 @@ declare class CustomFieldsResource {
|
|
|
1500
1510
|
/** Delete a custom field. */
|
|
1501
1511
|
del(fieldId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1502
1512
|
/** Reorder custom fields within a content type. */
|
|
1503
|
-
reorder(contentType: 'ticket' | 'customer' | 'article', orderedIds: string[]): Promise<
|
|
1513
|
+
reorder(contentType: 'ticket' | 'customer' | 'article', orderedIds: string[]): Promise<{
|
|
1514
|
+
success: true;
|
|
1515
|
+
reordered: number;
|
|
1516
|
+
}>;
|
|
1504
1517
|
}
|
|
1505
1518
|
|
|
1506
1519
|
/** An SLA rule. */
|
|
@@ -1569,7 +1582,7 @@ declare class SlaResource {
|
|
|
1569
1582
|
/** Delete an SLA rule. */
|
|
1570
1583
|
del(ruleId: string): Promise<ApiResponse<DeleteResponse>>;
|
|
1571
1584
|
/** Reorder SLA rules by providing an ordered array of IDs. */
|
|
1572
|
-
reorder(orderedIds: string[]): Promise<
|
|
1585
|
+
reorder(orderedIds: string[]): Promise<ListResponse<SlaRule>>;
|
|
1573
1586
|
/** Get SLA compliance metrics. */
|
|
1574
1587
|
metrics(params?: SlaMetricsParams): Promise<ApiResponse<SlaMetrics>>;
|
|
1575
1588
|
}
|
|
@@ -1744,20 +1757,41 @@ declare class BulkResource {
|
|
|
1744
1757
|
del(params: BulkDeleteParams, options?: RequestOptions): Promise<ApiResponse<BulkResult>>;
|
|
1745
1758
|
}
|
|
1746
1759
|
|
|
1747
|
-
/**
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1760
|
+
/** Resource tables supported by the export endpoint. */
|
|
1761
|
+
type ExportResourceType = 'tickets' | 'customers' | 'articles';
|
|
1762
|
+
/** Filters shared by all selected resources. */
|
|
1763
|
+
interface ExportFilters {
|
|
1764
|
+
status?: string;
|
|
1765
|
+
priority?: string;
|
|
1766
|
+
createdAfter?: string;
|
|
1767
|
+
createdBefore?: string;
|
|
1768
|
+
}
|
|
1769
|
+
/** JSON may export multiple resources or default to all three. */
|
|
1770
|
+
interface ExportJsonParams {
|
|
1771
|
+
resources?: readonly [ExportResourceType, ...ExportResourceType[]];
|
|
1772
|
+
format?: 'json';
|
|
1773
|
+
filters?: ExportFilters;
|
|
1774
|
+
}
|
|
1775
|
+
/** CSV must select exactly one resource, including when passed through a helper. */
|
|
1776
|
+
interface ExportCsvParams {
|
|
1777
|
+
resources: readonly [ExportResourceType];
|
|
1778
|
+
format: 'csv';
|
|
1779
|
+
filters?: ExportFilters;
|
|
1780
|
+
}
|
|
1781
|
+
/** Export parameters preserve the relationship between format and resources. */
|
|
1782
|
+
type ExportCreateParams = ExportJsonParams | ExportCsvParams;
|
|
1783
|
+
/** JSON export with raw database rows, unlike the mapped API resource objects. */
|
|
1756
1784
|
interface ExportResult {
|
|
1757
1785
|
object: 'export';
|
|
1758
|
-
format:
|
|
1759
|
-
|
|
1760
|
-
|
|
1786
|
+
format: 'json';
|
|
1787
|
+
exportedAt: string;
|
|
1788
|
+
teamId: string;
|
|
1789
|
+
tickets?: Record<string, unknown>[];
|
|
1790
|
+
customers?: Record<string, unknown>[];
|
|
1791
|
+
articles?: Record<string, unknown>[];
|
|
1792
|
+
/** Included when the selected tickets have messages. */
|
|
1793
|
+
messages?: Record<string, unknown>[];
|
|
1794
|
+
summary: Partial<Record<ExportResourceType | 'messages', number>>;
|
|
1761
1795
|
}
|
|
1762
1796
|
|
|
1763
1797
|
/** Import request parameters. */
|
|
@@ -1828,8 +1862,12 @@ interface ImportLogListParams extends PaginationParams {
|
|
|
1828
1862
|
declare class ExportResource {
|
|
1829
1863
|
private readonly client;
|
|
1830
1864
|
constructor(client: HttpClient);
|
|
1831
|
-
/** Create
|
|
1832
|
-
create(params:
|
|
1865
|
+
/** Create a CSV export. The API returns text for a single resource. */
|
|
1866
|
+
create(params: ExportCsvParams, options?: RequestOptions): Promise<string>;
|
|
1867
|
+
/** Create a JSON export with raw rows and per-resource counts. */
|
|
1868
|
+
create(params: ExportJsonParams, options?: RequestOptions): Promise<ExportResult>;
|
|
1869
|
+
/** A runtime-selected format returns JSON or CSV text accordingly. */
|
|
1870
|
+
create(params: ExportCreateParams, options?: RequestOptions): Promise<ExportResult | string>;
|
|
1833
1871
|
}
|
|
1834
1872
|
/** Import data into your team. */
|
|
1835
1873
|
declare class ImportResource {
|
|
@@ -1893,13 +1931,19 @@ interface SearchParams {
|
|
|
1893
1931
|
types?: Array<'tickets' | 'customers' | 'articles'>;
|
|
1894
1932
|
limit?: number;
|
|
1895
1933
|
}
|
|
1934
|
+
/** Cross-resource search results with the original query and returned count. */
|
|
1935
|
+
interface SearchResponse {
|
|
1936
|
+
results: SearchResult[];
|
|
1937
|
+
total: number;
|
|
1938
|
+
query: string;
|
|
1939
|
+
}
|
|
1896
1940
|
|
|
1897
1941
|
/** Search across tickets, customers, and articles. */
|
|
1898
1942
|
declare class SearchResource {
|
|
1899
1943
|
private readonly client;
|
|
1900
1944
|
constructor(client: HttpClient);
|
|
1901
1945
|
/** Perform a cross-resource search. */
|
|
1902
|
-
query(params: SearchParams): Promise<
|
|
1946
|
+
query(params: SearchParams): Promise<SearchResponse>;
|
|
1903
1947
|
}
|
|
1904
1948
|
|
|
1905
1949
|
/** A tag with usage count. */
|
|
@@ -2489,7 +2533,7 @@ declare class AchievementsResource {
|
|
|
2489
2533
|
/** List unlocked achievements only. */
|
|
2490
2534
|
unlocked(params?: {
|
|
2491
2535
|
userId: string;
|
|
2492
|
-
}): Promise<
|
|
2536
|
+
}): Promise<ListResponse<Achievement>>;
|
|
2493
2537
|
/** Get a single achievement. */
|
|
2494
2538
|
get(achievementId: string, params?: {
|
|
2495
2539
|
userId?: string;
|
|
@@ -2909,7 +2953,7 @@ interface CStarClientConfig {
|
|
|
2909
2953
|
* viewing your site.
|
|
2910
2954
|
*
|
|
2911
2955
|
* For client-side integrations, use:
|
|
2912
|
-
* - `@cstar.help/js/chat` — Customer chat widget (
|
|
2956
|
+
* - `@cstar.help/js/chat` — Customer chat widget (HMAC or customer session)
|
|
2913
2957
|
* - `@cstar.help/js/library` — Public knowledge base (no auth)
|
|
2914
2958
|
* - `@cstar.help/js/community` — Public community forum (no auth)
|
|
2915
2959
|
*
|
|
@@ -3037,4 +3081,4 @@ declare class CStarClient {
|
|
|
3037
3081
|
get lastMeta(): LastMeta;
|
|
3038
3082
|
}
|
|
3039
3083
|
|
|
3040
|
-
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 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 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 };
|
|
3084
|
+
export { type Achievement, type AchievementListParams, type ActivityEvent, type ActivityListParams, type AiAction, type AiActionParams, type AiActionResult, type AnalyticsOverview, type AnalyticsParams, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, type Attachment, type AttachmentListParams, type AuditLogEntry, type AuditLogListParams, type AutomationAction, type AutomationCondition, type AutomationConditions, type AutomationCreateParams, type AutomationExecution, type AutomationExecutionListParams, type AutomationListParams, type AutomationRule, type AutomationTestResult, type AutomationUpdateParams, type BillingPortal, type BillingPortalParams, type Boss, type BossDamageParams, type BossDamageResult, type BossDefeat, type BossDefeatListParams, type BossSpawnParams, type BulkDeleteParams, type BulkResult, type BulkUpdateParams, type BusinessHours, type BusinessHoursUpdateParams, CStarClient, type CStarClientConfig, CStarRealtime, type Category, type CategoryCreateParams, type CategoryListParams, type CategoryUpdateParams, type CommunityComment, type CommunityCommentCreateParams, type CommunityPost, type CommunityPostCreateParams, type CommunityPostListParams, type CommunityPostUpdateParams, type CommunityTopic, type ConnectionHandler, type Cosmetic, type CosmeticListParams, type CosmeticPreferences, type CsatSettings, type CsatSettingsUpdateParams, type CsatStats, type CsatSurvey, type CsatSurveyCreateParams, type CsatSurveyListParams, type CurrentSeason, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerGroup, type CustomerGroupAddMembersParams, type CustomerGroupAddResult, type CustomerGroupCreateParams, type CustomerGroupListParams, type CustomerGroupMemberListParams, type CustomerGroupMembersResult, type CustomerGroupRemoveResult, type CustomerGroupUpdateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, type ErrorHandler, type EventHandler, type ExportCreateParams, type ExportCsvParams, type ExportFilters, type ExportJsonParams, type ExportResourceType, type ExportResult, type GameConfig, type HighFive, type HighFiveCanSend, type HighFiveCreateParams, type HighFiveListParams, type ImportCreateParams, type ImportLog, type ImportLogListParams, type ImportResult, type Invite, type InviteCreateParams, type InviteListParams, type LeaderboardEntry, type LeaderboardParams, type ListResponse, type Member, type MemberListParams, type MemberUpdateParams, type Mention, type MentionListParams, type MentionUnreadCount, type Message, type MessageCreateParams, type MessageListParams, type Metadata, type Notification, type NotificationListParams, OfflineQueue, type OfflineQueueOptions, type OneUp, type OneUpCreateParams, type OneUpListParams, type OneUpRemaining, type OneUpSendResult, type PaginationInfo, type PaginationParams, type Player, type Puzzle, type PuzzleCompleteParams, type PuzzleCompleteResult, type PuzzleLeaderboardParams, type PuzzleLeaderboardResult, type PuzzleStreak, type Quest, type QuestHistory, type QuestHistoryParams, type QuestList, type QueueItem, type QueueResult, type QuickReply, type QuickReplyCreateParams, type QuickReplyUpdateParams, type RealtimeEvent, type RealtimeOptions, type RequestOptions, type SavedView, type SearchParams, type SearchResponse, type SearchResult, type Season, type SeasonStats, type SkillAllocateParams, type SkillAllocateResult, type SkillTree, type SlaMetrics, type SlaMetricsParams, type SlaRule, type SlaRuleCreateParams, type 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 };
|
package/dist/index.js
CHANGED
|
@@ -237,7 +237,7 @@ function parseError(statusCode, body, retryAfter) {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
// src/client.ts
|
|
240
|
-
var SDK_VERSION = "0.17.
|
|
240
|
+
var SDK_VERSION = "0.17.5";
|
|
241
241
|
var DEFAULT_BASE_URL = "https://www.cstar.help";
|
|
242
242
|
var DEFAULT_API_VERSION = "2026-03-01";
|
|
243
243
|
var DEFAULT_MAX_RETRIES = 3;
|
|
@@ -343,8 +343,13 @@ var HttpClient = class {
|
|
|
343
343
|
}
|
|
344
344
|
if (response.ok) {
|
|
345
345
|
if (response.status === 204) return void 0;
|
|
346
|
-
const json = await response.json();
|
|
347
346
|
const headerRequestId = response.headers.get("x-request-id") ?? response.headers.get("x-cstar-request-id");
|
|
347
|
+
if (options?.responseType === "text") {
|
|
348
|
+
const text = await response.text();
|
|
349
|
+
this.captureMeta(null, headerRequestId);
|
|
350
|
+
return text;
|
|
351
|
+
}
|
|
352
|
+
const json = await response.json();
|
|
348
353
|
this.captureMeta(json, headerRequestId);
|
|
349
354
|
return this.unwrapEnvelope(json);
|
|
350
355
|
}
|
|
@@ -1116,9 +1121,11 @@ var TicketMessagesResource = class {
|
|
|
1116
1121
|
constructor(client) {
|
|
1117
1122
|
this.client = client;
|
|
1118
1123
|
}
|
|
1119
|
-
/** List
|
|
1120
|
-
async list(ticketId) {
|
|
1121
|
-
return this.client.request("GET", `/tickets/${ticketId}/messages
|
|
1124
|
+
/** List one page of a ticket history. Use pagination.hasMore to request the next page. */
|
|
1125
|
+
async list(ticketId, params) {
|
|
1126
|
+
return this.client.request("GET", `/tickets/${ticketId}/messages`, {
|
|
1127
|
+
query: params ? { ...params } : void 0
|
|
1128
|
+
});
|
|
1122
1129
|
}
|
|
1123
1130
|
/** Add a message to a ticket. */
|
|
1124
1131
|
async create(ticketId, params, options) {
|
|
@@ -1454,11 +1461,9 @@ var QuickRepliesResource = class {
|
|
|
1454
1461
|
}
|
|
1455
1462
|
/** Reorder quick replies. */
|
|
1456
1463
|
async reorder(orderedIds) {
|
|
1457
|
-
return this.client.request(
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
{ body: { orderedIds } }
|
|
1461
|
-
);
|
|
1464
|
+
return this.client.request("PUT", "/settings/quick-replies/reorder", {
|
|
1465
|
+
body: { orderedIds }
|
|
1466
|
+
});
|
|
1462
1467
|
}
|
|
1463
1468
|
};
|
|
1464
1469
|
var SettingsResource = class {
|
|
@@ -1632,9 +1637,13 @@ var CustomFieldsResource = class {
|
|
|
1632
1637
|
}
|
|
1633
1638
|
/** Reorder custom fields within a content type. */
|
|
1634
1639
|
async reorder(contentType, orderedIds) {
|
|
1635
|
-
return this.client.request(
|
|
1636
|
-
|
|
1637
|
-
|
|
1640
|
+
return this.client.request(
|
|
1641
|
+
"PUT",
|
|
1642
|
+
"/custom-fields/reorder",
|
|
1643
|
+
{
|
|
1644
|
+
body: { contentType, orderedIds }
|
|
1645
|
+
}
|
|
1646
|
+
);
|
|
1638
1647
|
}
|
|
1639
1648
|
};
|
|
1640
1649
|
|
|
@@ -1769,11 +1778,11 @@ var ExportResource = class {
|
|
|
1769
1778
|
constructor(client) {
|
|
1770
1779
|
this.client = client;
|
|
1771
1780
|
}
|
|
1772
|
-
/** Create an export. Returns exported data synchronously. */
|
|
1773
1781
|
async create(params, options) {
|
|
1774
1782
|
return this.client.request("POST", "/export", {
|
|
1775
1783
|
body: params,
|
|
1776
|
-
idempotencyKey: options?.idempotencyKey
|
|
1784
|
+
idempotencyKey: options?.idempotencyKey,
|
|
1785
|
+
responseType: params.format === "csv" ? "text" : "json"
|
|
1777
1786
|
});
|
|
1778
1787
|
}
|
|
1779
1788
|
};
|
package/dist/library/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-
|
|
1
|
+
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-bW8CwTn4.cjs';
|
|
2
2
|
|
|
3
3
|
/** Configuration for the LibraryClient. */
|
|
4
4
|
interface LibraryConfig {
|
package/dist/library/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-
|
|
1
|
+
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-bW8CwTn4.js';
|
|
2
2
|
|
|
3
3
|
/** Configuration for the LibraryClient. */
|
|
4
4
|
interface LibraryConfig {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-
|
|
1
|
+
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-bW8CwTn4.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Options for the QuickHelpClient. No auth — Quick Help is anonymous by
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-
|
|
1
|
+
export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-bW8CwTn4.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Options for the QuickHelpClient. No auth — Quick Help is anonymous by
|