@gpt-platform/client 0.10.5 → 0.11.1
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/_internal/client/client.gen.d.ts +3 -0
- package/dist/_internal/client/client.gen.d.ts.map +1 -0
- package/dist/_internal/client/index.d.ts +9 -0
- package/dist/_internal/client/index.d.ts.map +1 -0
- package/dist/_internal/client/types.gen.d.ts +118 -0
- package/dist/_internal/client/types.gen.d.ts.map +1 -0
- package/dist/_internal/client/utils.gen.d.ts +34 -0
- package/dist/_internal/client/utils.gen.d.ts.map +1 -0
- package/dist/_internal/client.gen.d.ts +13 -0
- package/dist/_internal/client.gen.d.ts.map +1 -0
- package/dist/_internal/core/auth.gen.d.ts +19 -0
- package/dist/_internal/core/auth.gen.d.ts.map +1 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts +26 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/params.gen.d.ts +44 -0
- package/dist/_internal/core/params.gen.d.ts.map +1 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts +34 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/_internal/core/types.gen.d.ts +79 -0
- package/dist/_internal/core/types.gen.d.ts.map +1 -0
- package/dist/_internal/core/utils.gen.d.ts +20 -0
- package/dist/_internal/core/utils.gen.d.ts.map +1 -0
- package/dist/_internal/index.d.ts +3 -0
- package/dist/_internal/index.d.ts.map +1 -0
- package/dist/_internal/sdk.gen.d.ts +7053 -0
- package/dist/_internal/sdk.gen.d.ts.map +1 -0
- package/dist/_internal/types.gen.d.ts +146633 -0
- package/dist/_internal/types.gen.d.ts.map +1 -0
- package/dist/base-client.d.ts +199 -0
- package/dist/base-client.d.ts.map +1 -0
- package/dist/errors/index.d.ts +128 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/events.d.ts +69 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/execution-events.d.ts +95 -0
- package/dist/execution-events.d.ts.map +1 -0
- package/dist/gpt-client.d.ts +2175 -0
- package/dist/gpt-client.d.ts.map +1 -0
- package/dist/index.d.ts +51 -30734
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +318 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +318 -9
- package/dist/index.mjs.map +1 -1
- package/dist/json-api.d.ts +26 -0
- package/dist/json-api.d.ts.map +1 -0
- package/dist/logging.d.ts +22 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/namespace-types.d.ts +79 -0
- package/dist/namespace-types.d.ts.map +1 -0
- package/dist/namespaces/access-grants.d.ts +71 -0
- package/dist/namespaces/access-grants.d.ts.map +1 -0
- package/dist/namespaces/agents.d.ts +1406 -0
- package/dist/namespaces/agents.d.ts.map +1 -0
- package/dist/namespaces/ai.d.ts +407 -0
- package/dist/namespaces/ai.d.ts.map +1 -0
- package/dist/namespaces/audit.d.ts +83 -0
- package/dist/namespaces/audit.d.ts.map +1 -0
- package/dist/namespaces/billing.d.ts +854 -0
- package/dist/namespaces/billing.d.ts.map +1 -0
- package/dist/namespaces/campaigns.d.ts +973 -0
- package/dist/namespaces/campaigns.d.ts.map +1 -0
- package/dist/namespaces/catalog.d.ts +964 -0
- package/dist/namespaces/catalog.d.ts.map +1 -0
- package/dist/namespaces/channels.d.ts +162 -0
- package/dist/namespaces/channels.d.ts.map +1 -0
- package/dist/namespaces/clinical.d.ts +2443 -0
- package/dist/namespaces/clinical.d.ts.map +1 -0
- package/dist/namespaces/communication.d.ts +439 -0
- package/dist/namespaces/communication.d.ts.map +1 -0
- package/dist/namespaces/compliance.d.ts +2310 -0
- package/dist/namespaces/compliance.d.ts.map +1 -0
- package/dist/namespaces/connectors.d.ts +1368 -0
- package/dist/namespaces/connectors.d.ts.map +1 -0
- package/dist/namespaces/content.d.ts +188 -0
- package/dist/namespaces/content.d.ts.map +1 -0
- package/dist/namespaces/crawler.d.ts +408 -0
- package/dist/namespaces/crawler.d.ts.map +1 -0
- package/dist/namespaces/crm-clusters.d.ts +31 -0
- package/dist/namespaces/crm-clusters.d.ts.map +1 -0
- package/dist/namespaces/crm.d.ts +1539 -0
- package/dist/namespaces/crm.d.ts.map +1 -0
- package/dist/namespaces/documents.d.ts +136 -0
- package/dist/namespaces/documents.d.ts.map +1 -0
- package/dist/namespaces/email.d.ts +550 -0
- package/dist/namespaces/email.d.ts.map +1 -0
- package/dist/namespaces/extraction.d.ts +1249 -0
- package/dist/namespaces/extraction.d.ts.map +1 -0
- package/dist/namespaces/identity.d.ts +411 -0
- package/dist/namespaces/identity.d.ts.map +1 -0
- package/dist/namespaces/imports.d.ts +177 -0
- package/dist/namespaces/imports.d.ts.map +1 -0
- package/dist/namespaces/index.d.ts +119 -0
- package/dist/namespaces/index.d.ts.map +1 -0
- package/dist/namespaces/memory.d.ts +105 -0
- package/dist/namespaces/memory.d.ts.map +1 -0
- package/dist/namespaces/models.d.ts +75 -0
- package/dist/namespaces/models.d.ts.map +1 -0
- package/dist/namespaces/permissions.d.ts +75 -0
- package/dist/namespaces/permissions.d.ts.map +1 -0
- package/dist/namespaces/pipeline-executions.d.ts +130 -0
- package/dist/namespaces/pipeline-executions.d.ts.map +1 -0
- package/dist/namespaces/pipelines.d.ts +120 -0
- package/dist/namespaces/pipelines.d.ts.map +1 -0
- package/dist/namespaces/platform.d.ts +1430 -0
- package/dist/namespaces/platform.d.ts.map +1 -0
- package/dist/namespaces/portal.d.ts +198 -0
- package/dist/namespaces/portal.d.ts.map +1 -0
- package/dist/namespaces/projects.d.ts +553 -0
- package/dist/namespaces/projects.d.ts.map +1 -0
- package/dist/namespaces/roles.d.ts +65 -0
- package/dist/namespaces/roles.d.ts.map +1 -0
- package/dist/namespaces/scheduling.d.ts +944 -0
- package/dist/namespaces/scheduling.d.ts.map +1 -0
- package/dist/namespaces/search.d.ts +224 -0
- package/dist/namespaces/search.d.ts.map +1 -0
- package/dist/namespaces/session-notes.d.ts +67 -0
- package/dist/namespaces/session-notes.d.ts.map +1 -0
- package/dist/namespaces/social.d.ts +330 -0
- package/dist/namespaces/social.d.ts.map +1 -0
- package/dist/namespaces/storage.d.ts +378 -0
- package/dist/namespaces/storage.d.ts.map +1 -0
- package/dist/namespaces/support.d.ts +427 -0
- package/dist/namespaces/support.d.ts.map +1 -0
- package/dist/namespaces/threads.d.ts +596 -0
- package/dist/namespaces/threads.d.ts.map +1 -0
- package/dist/namespaces/training.d.ts +358 -0
- package/dist/namespaces/training.d.ts.map +1 -0
- package/dist/namespaces/voice.d.ts +752 -0
- package/dist/namespaces/voice.d.ts.map +1 -0
- package/dist/namespaces/watcher.d.ts +425 -0
- package/dist/namespaces/watcher.d.ts.map +1 -0
- package/dist/namespaces/webhooks-ns.d.ts +3 -0
- package/dist/namespaces/webhooks-ns.d.ts.map +1 -0
- package/dist/pagination.d.ts +57 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/request-builder.d.ts +95 -0
- package/dist/request-builder.d.ts.map +1 -0
- package/dist/security.d.ts +32 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/streaming.d.ts +135 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +63 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/webhook-signature.d.ts +109 -0
- package/dist/webhook-signature.d.ts.map +1 -0
- package/llms.txt +7 -1
- package/package.json +286 -36
- package/dist/index.d.mts +0 -30734
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import type { SupportTicket, SupportTicketMessage, SupportTag, SupportTicketRating } from "../_internal/types.gen";
|
|
2
|
+
/** Attributes accepted when creating a new support ticket. */
|
|
3
|
+
export type CreateSupportTicketAttributes = {
|
|
4
|
+
workspace_id: string;
|
|
5
|
+
subject: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
priority?: "low" | "normal" | "high" | "urgent";
|
|
8
|
+
contact_id?: string;
|
|
9
|
+
assignee_id?: string;
|
|
10
|
+
tags?: string[];
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
/** Attributes accepted when updating an existing support ticket (PATCH semantics). */
|
|
14
|
+
export type UpdateSupportTicketAttributes = {
|
|
15
|
+
subject?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
status?: string;
|
|
18
|
+
priority?: "low" | "normal" | "high" | "urgent";
|
|
19
|
+
assignee_id?: string;
|
|
20
|
+
resolution_note?: string;
|
|
21
|
+
tags?: string[];
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
/** Attributes accepted when adding a message to a ticket. */
|
|
25
|
+
export type CreateTicketMessageAttributes = {
|
|
26
|
+
body?: string;
|
|
27
|
+
body_html?: string;
|
|
28
|
+
author_type: "agent" | "customer";
|
|
29
|
+
author_id?: string;
|
|
30
|
+
attachments?: unknown[];
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
/** Attributes accepted when rating a resolved ticket. */
|
|
34
|
+
export type CreateTicketRatingAttributes = {
|
|
35
|
+
ticket_id: string;
|
|
36
|
+
rating: number;
|
|
37
|
+
comment?: string;
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
};
|
|
40
|
+
/** Attributes accepted when creating a support tag. */
|
|
41
|
+
export type CreateSupportTagAttributes = {
|
|
42
|
+
workspace_id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
import type { RequestOptions } from "../base-client";
|
|
47
|
+
import { RequestBuilder } from "../request-builder";
|
|
48
|
+
/**
|
|
49
|
+
* Support namespace for ticket management, queues, and SLA tracking.
|
|
50
|
+
*
|
|
51
|
+
* Provides sub-namespaces for the full support workflow: tickets (the core
|
|
52
|
+
* support interaction record with threaded messages and CSAT ratings) and
|
|
53
|
+
* tags (workspace-scoped labels used to categorise and filter tickets).
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
58
|
+
*
|
|
59
|
+
* // Open a ticket and add an initial message
|
|
60
|
+
* const ticket = await client.support.tickets.create({
|
|
61
|
+
* workspace_id: 'ws_abc123',
|
|
62
|
+
* subject: 'Cannot log in to my account',
|
|
63
|
+
* description: 'I get a 401 error every time I try to sign in.',
|
|
64
|
+
* priority: 'high',
|
|
65
|
+
* });
|
|
66
|
+
*
|
|
67
|
+
* await client.support.tickets.addMessage(ticket.id, {
|
|
68
|
+
* body: 'Could you please provide your account email?',
|
|
69
|
+
* author_type: 'agent',
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function createSupportNamespace(rb: RequestBuilder): {
|
|
74
|
+
/**
|
|
75
|
+
* Tickets — customer support ticket management.
|
|
76
|
+
*
|
|
77
|
+
* A ticket represents a single support interaction thread between a
|
|
78
|
+
* customer and a support agent (human or AI). Tickets have a subject,
|
|
79
|
+
* priority, status (open / pending / resolved / closed), and an ordered
|
|
80
|
+
* list of messages. End users can submit a 1–5 CSAT rating after their
|
|
81
|
+
* ticket is resolved via the {@link rate} method.
|
|
82
|
+
*/
|
|
83
|
+
tickets: {
|
|
84
|
+
/**
|
|
85
|
+
* List open and active tickets for a workspace with optional pagination.
|
|
86
|
+
*
|
|
87
|
+
* Returns tickets ordered by creation time descending. To filter by
|
|
88
|
+
* status, priority, or tag, use the standard query parameters available
|
|
89
|
+
* on the underlying API endpoint.
|
|
90
|
+
*
|
|
91
|
+
* @param workspaceId - The ID of the workspace whose tickets to list.
|
|
92
|
+
* @param options - Optional pagination controls (`page`, `pageSize`) and
|
|
93
|
+
* request-level overrides.
|
|
94
|
+
* @returns A promise that resolves to an array of {@link SupportTicket} records.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
99
|
+
*
|
|
100
|
+
* const tickets = await client.support.tickets.list('ws_abc123', {
|
|
101
|
+
* pageSize: 25,
|
|
102
|
+
* });
|
|
103
|
+
* const open = tickets.filter((t) => t.attributes.status === 'open');
|
|
104
|
+
* console.log(`${open.length} open tickets`);
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
list: (workspaceId: string, options?: {
|
|
108
|
+
page?: number;
|
|
109
|
+
pageSize?: number;
|
|
110
|
+
} & RequestOptions) => Promise<SupportTicket[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Fetch a single support ticket by its unique ID.
|
|
113
|
+
*
|
|
114
|
+
* @param id - The unique identifier of the ticket to retrieve.
|
|
115
|
+
* @param options - Optional request-level overrides.
|
|
116
|
+
* @returns A promise that resolves to the matching {@link SupportTicket}.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
121
|
+
*
|
|
122
|
+
* const ticket = await client.support.tickets.get('tkt_abc123');
|
|
123
|
+
* console.log(ticket.attributes.subject, ticket.attributes.status);
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
get: (id: string, options?: RequestOptions) => Promise<SupportTicket>;
|
|
127
|
+
/**
|
|
128
|
+
* Create a new support ticket.
|
|
129
|
+
*
|
|
130
|
+
* Tickets start with `status: 'open'` by default. Supply a `subject`
|
|
131
|
+
* and `description` to give agents enough context. Set `priority` to
|
|
132
|
+
* one of `"low"`, `"normal"`, `"high"`, or `"urgent"` based on
|
|
133
|
+
* customer impact.
|
|
134
|
+
*
|
|
135
|
+
* @param attributes - Key/value map of ticket attributes. Must include
|
|
136
|
+
* `workspace_id` and `subject`. Common fields: `description`,
|
|
137
|
+
* `priority`, `contact_id`, `tags`, `assignee_id`.
|
|
138
|
+
* @param options - Optional request-level overrides.
|
|
139
|
+
* @returns A promise that resolves to the newly created {@link SupportTicket}.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
144
|
+
*
|
|
145
|
+
* const ticket = await client.support.tickets.create({
|
|
146
|
+
* workspace_id: 'ws_abc123',
|
|
147
|
+
* subject: 'Billing charge appears incorrect',
|
|
148
|
+
* description: 'I was charged twice for the same subscription period.',
|
|
149
|
+
* priority: 'high',
|
|
150
|
+
* contact_id: 'con_jane',
|
|
151
|
+
* tags: ['billing', 'duplicate-charge'],
|
|
152
|
+
* });
|
|
153
|
+
* console.log(ticket.id); // 'tkt_...'
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
create: (attributes: CreateSupportTicketAttributes, options?: RequestOptions) => Promise<SupportTicket>;
|
|
157
|
+
/**
|
|
158
|
+
* Update an existing support ticket's attributes.
|
|
159
|
+
*
|
|
160
|
+
* Commonly used to change `status` (e.g. resolve or close a ticket),
|
|
161
|
+
* update `priority`, reassign the ticket via `assignee_id`, or add/remove
|
|
162
|
+
* `tags`. Only fields present in `attributes` are changed (PATCH semantics).
|
|
163
|
+
*
|
|
164
|
+
* @param id - The unique identifier of the ticket to update.
|
|
165
|
+
* @param attributes - Key/value map of attributes to change.
|
|
166
|
+
* @param options - Optional request-level overrides.
|
|
167
|
+
* @returns A promise that resolves to the updated {@link SupportTicket}.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```typescript
|
|
171
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
172
|
+
*
|
|
173
|
+
* // Resolve a ticket after the issue is fixed
|
|
174
|
+
* const ticket = await client.support.tickets.update('tkt_abc123', {
|
|
175
|
+
* status: 'resolved',
|
|
176
|
+
* resolution_note: 'Refund processed. Credit visible within 3–5 days.',
|
|
177
|
+
* });
|
|
178
|
+
* console.log(ticket.attributes.status); // 'resolved'
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
update: (id: string, attributes: UpdateSupportTicketAttributes, options?: RequestOptions) => Promise<SupportTicket>;
|
|
182
|
+
/**
|
|
183
|
+
* Permanently delete a support ticket and all its messages.
|
|
184
|
+
*
|
|
185
|
+
* @param id - The unique identifier of the ticket to delete.
|
|
186
|
+
* @param options - Optional request-level overrides.
|
|
187
|
+
* @returns A promise that resolves to `true` on successful deletion.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
192
|
+
*
|
|
193
|
+
* await client.support.tickets.delete('tkt_abc123');
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
197
|
+
/**
|
|
198
|
+
* Assign a ticket to a specific agent or queue.
|
|
199
|
+
*
|
|
200
|
+
* @param id - The unique identifier of the ticket to assign.
|
|
201
|
+
* @param attributes - Assignment attributes. Typically includes
|
|
202
|
+
* `assigned_agent_id` and/or `queue_id`.
|
|
203
|
+
* @param options - Optional request-level overrides.
|
|
204
|
+
* @returns A promise that resolves to the updated {@link SupportTicket}.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const ticket = await client.support.tickets.assign('tkt_abc123', {
|
|
209
|
+
* assigned_agent_id: 'user_agent_001',
|
|
210
|
+
* });
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
assign: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SupportTicket>;
|
|
214
|
+
/**
|
|
215
|
+
* Resolve a ticket, marking the issue as addressed.
|
|
216
|
+
*
|
|
217
|
+
* @param id - The unique identifier of the ticket to resolve.
|
|
218
|
+
* @param attributes - Resolution attributes. Commonly includes
|
|
219
|
+
* `resolution_note` describing how the issue was resolved.
|
|
220
|
+
* @param options - Optional request-level overrides.
|
|
221
|
+
* @returns A promise that resolves to the updated {@link SupportTicket}.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```typescript
|
|
225
|
+
* const ticket = await client.support.tickets.resolve('tkt_abc123', {
|
|
226
|
+
* resolution_note: 'Refund processed successfully.',
|
|
227
|
+
* });
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
resolve: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SupportTicket>;
|
|
231
|
+
/**
|
|
232
|
+
* Close a resolved ticket. Only resolved tickets can be closed.
|
|
233
|
+
*
|
|
234
|
+
* @param id - The unique identifier of the ticket to close.
|
|
235
|
+
* @param attributes - Optional close attributes.
|
|
236
|
+
* @param options - Optional request-level overrides.
|
|
237
|
+
* @returns A promise that resolves to the updated {@link SupportTicket}.
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```typescript
|
|
241
|
+
* const ticket = await client.support.tickets.close('tkt_abc123', {});
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
close: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SupportTicket>;
|
|
245
|
+
/**
|
|
246
|
+
* Reopen a closed or resolved ticket.
|
|
247
|
+
*
|
|
248
|
+
* @param id - The unique identifier of the ticket to reopen.
|
|
249
|
+
* @param attributes - Optional reopen attributes.
|
|
250
|
+
* @param options - Optional request-level overrides.
|
|
251
|
+
* @returns A promise that resolves to the updated {@link SupportTicket}.
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```typescript
|
|
255
|
+
* const ticket = await client.support.tickets.reopen('tkt_abc123', {});
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
reopen: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SupportTicket>;
|
|
259
|
+
/**
|
|
260
|
+
* Merge a ticket into another ticket.
|
|
261
|
+
*
|
|
262
|
+
* The merged ticket is closed and its messages are transferred to the
|
|
263
|
+
* primary ticket. Use `merge_into_ticket_id` to specify the target.
|
|
264
|
+
*
|
|
265
|
+
* @param id - The unique identifier of the ticket to merge (source).
|
|
266
|
+
* @param attributes - Merge attributes. Must include `merge_into_ticket_id`.
|
|
267
|
+
* @param options - Optional request-level overrides.
|
|
268
|
+
* @returns A promise that resolves to the updated {@link SupportTicket}.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* const ticket = await client.support.tickets.merge('tkt_dup456', {
|
|
273
|
+
* merge_into_ticket_id: 'tkt_primary123',
|
|
274
|
+
* });
|
|
275
|
+
* ```
|
|
276
|
+
*/
|
|
277
|
+
merge: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<SupportTicket>;
|
|
278
|
+
/**
|
|
279
|
+
* Add a new message to the thread of a support ticket.
|
|
280
|
+
*
|
|
281
|
+
* Messages build the conversation history on a ticket. Set
|
|
282
|
+
* `author_type` to `"agent"` for support team replies or `"customer"`
|
|
283
|
+
* for inbound customer messages. Rich-text HTML is supported via
|
|
284
|
+
* `body_html`; plain-text via `body`.
|
|
285
|
+
*
|
|
286
|
+
* @param ticketId - The ID of the ticket to add the message to.
|
|
287
|
+
* @param attributes - Key/value map of message attributes. Must include
|
|
288
|
+
* `body` or `body_html` and `author_type` (`"agent"` | `"customer"`).
|
|
289
|
+
* Optionally include `author_id` and `attachments`.
|
|
290
|
+
* @param options - Optional request-level overrides.
|
|
291
|
+
* @returns A promise that resolves to the newly created {@link SupportTicketMessage}.
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```typescript
|
|
295
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
296
|
+
*
|
|
297
|
+
* const message = await client.support.tickets.addMessage('tkt_abc123', {
|
|
298
|
+
* body: 'Thanks for reaching out! We are looking into this now.',
|
|
299
|
+
* author_type: 'agent',
|
|
300
|
+
* author_id: 'user_agent_001',
|
|
301
|
+
* });
|
|
302
|
+
* console.log(message.id); // 'msg_...'
|
|
303
|
+
* ```
|
|
304
|
+
*/
|
|
305
|
+
addMessage: (ticketId: string, attributes: CreateTicketMessageAttributes, options?: RequestOptions) => Promise<SupportTicketMessage>;
|
|
306
|
+
/**
|
|
307
|
+
* List all messages in the thread of a support ticket, ordered
|
|
308
|
+
* chronologically (oldest first).
|
|
309
|
+
*
|
|
310
|
+
* @param ticketId - The ID of the ticket whose messages to list.
|
|
311
|
+
* @param options - Optional request-level overrides.
|
|
312
|
+
* @returns A promise that resolves to an array of {@link SupportTicketMessage}
|
|
313
|
+
* records ordered by creation time ascending.
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* ```typescript
|
|
317
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
318
|
+
*
|
|
319
|
+
* const messages = await client.support.tickets.listMessages('tkt_abc123');
|
|
320
|
+
* for (const msg of messages) {
|
|
321
|
+
* console.log(`[${msg.attributes.author_type}] ${msg.attributes.body}`);
|
|
322
|
+
* }
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
listMessages: (ticketId: string, options?: RequestOptions) => Promise<SupportTicketMessage[]>;
|
|
326
|
+
/**
|
|
327
|
+
* Submit a CSAT (Customer Satisfaction) rating for a resolved ticket.
|
|
328
|
+
*
|
|
329
|
+
* The rating is submitted by the end user after their issue has been
|
|
330
|
+
* resolved. Ratings use a 1–5 integer scale where 1 is "very
|
|
331
|
+
* dissatisfied" and 5 is "very satisfied". An optional `comment`
|
|
332
|
+
* field allows the customer to provide qualitative feedback.
|
|
333
|
+
*
|
|
334
|
+
* @param attributes - Key/value map of rating attributes. Must include
|
|
335
|
+
* `ticket_id` and `rating` (integer 1–5). Optionally include
|
|
336
|
+
* `comment` (free-text feedback from the customer).
|
|
337
|
+
* @param options - Optional request-level overrides.
|
|
338
|
+
* @returns A promise that resolves to the created rating resource.
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
343
|
+
*
|
|
344
|
+
* // Customer submits a 5-star rating with a comment
|
|
345
|
+
* const rating = await client.support.tickets.rate({
|
|
346
|
+
* ticket_id: 'tkt_abc123',
|
|
347
|
+
* rating: 5,
|
|
348
|
+
* comment: 'The agent resolved my issue within minutes. Excellent service!',
|
|
349
|
+
* });
|
|
350
|
+
* console.log(rating);
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
rate: (attributes: CreateTicketRatingAttributes, options?: RequestOptions) => Promise<SupportTicketRating>;
|
|
354
|
+
};
|
|
355
|
+
/**
|
|
356
|
+
* Tags — workspace-scoped labels for ticket categorisation.
|
|
357
|
+
*
|
|
358
|
+
* Tags are simple string labels that can be attached to tickets to
|
|
359
|
+
* facilitate filtering, routing, and reporting. For example, a workspace
|
|
360
|
+
* might define tags such as `"billing"`, `"technical"`, `"onboarding"`,
|
|
361
|
+
* or `"urgent"`. Tags are created at the workspace level and can be
|
|
362
|
+
* applied to any ticket in that workspace.
|
|
363
|
+
*/
|
|
364
|
+
tags: {
|
|
365
|
+
/**
|
|
366
|
+
* List all tags defined for a workspace.
|
|
367
|
+
*
|
|
368
|
+
* @param workspaceId - The ID of the workspace whose tags to list.
|
|
369
|
+
* @param options - Optional request-level overrides.
|
|
370
|
+
* @returns A promise that resolves to an array of {@link SupportTag} records.
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```typescript
|
|
374
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
375
|
+
*
|
|
376
|
+
* const tags = await client.support.tags.list('ws_abc123');
|
|
377
|
+
* console.log(tags.map((t) => t.attributes.name));
|
|
378
|
+
* // ['billing', 'technical', 'onboarding']
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
list: (workspaceId: string, options?: RequestOptions) => Promise<SupportTag[]>;
|
|
382
|
+
/**
|
|
383
|
+
* Create a new tag in a workspace.
|
|
384
|
+
*
|
|
385
|
+
* Tag names should be concise and consistent with your team's
|
|
386
|
+
* categorisation conventions. Once created, a tag can be referenced by
|
|
387
|
+
* name when creating or updating tickets.
|
|
388
|
+
*
|
|
389
|
+
* @param attributes - Key/value map of tag attributes. Must include
|
|
390
|
+
* `workspace_id` and `name`.
|
|
391
|
+
* @param options - Optional request-level overrides.
|
|
392
|
+
* @returns A promise that resolves to the newly created {@link SupportTag}.
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* ```typescript
|
|
396
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
397
|
+
*
|
|
398
|
+
* const tag = await client.support.tags.create({
|
|
399
|
+
* workspace_id: 'ws_abc123',
|
|
400
|
+
* name: 'enterprise-account',
|
|
401
|
+
* });
|
|
402
|
+
* console.log(tag.id); // 'tag_...'
|
|
403
|
+
* ```
|
|
404
|
+
*/
|
|
405
|
+
create: (attributes: CreateSupportTagAttributes, options?: RequestOptions) => Promise<SupportTag>;
|
|
406
|
+
/**
|
|
407
|
+
* Permanently delete a tag from a workspace.
|
|
408
|
+
*
|
|
409
|
+
* Deleting a tag does not automatically remove it from tickets that are
|
|
410
|
+
* already tagged with it. Clean up ticket associations before deleting a
|
|
411
|
+
* tag if consistent reporting is required.
|
|
412
|
+
*
|
|
413
|
+
* @param id - The unique identifier of the tag to delete.
|
|
414
|
+
* @param options - Optional request-level overrides.
|
|
415
|
+
* @returns A promise that resolves to `true` on successful deletion.
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```typescript
|
|
419
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
420
|
+
*
|
|
421
|
+
* await client.support.tags.delete('tag_abc123');
|
|
422
|
+
* ```
|
|
423
|
+
*/
|
|
424
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
//# sourceMappingURL=support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.d.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