@superdurable/connector-freshdesk 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +12 -2
- package/dex-connector.json +191 -0
- package/dist/chunk-CLK5W7ZY.js +316 -0
- package/dist/connection-BRfKrSCD.d.ts +482 -0
- package/dist/index.d.ts +333 -0
- package/dist/index.js +861 -0
- package/dist/mock.d.ts +145 -0
- package/dist/mock.js +350 -0
- package/package.json +60 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { A as AddNoteInput, a as AddNoteOutput, C as Connection, b as CreateTicketInput, c as CreateTicketOutput, G as GetTicketInput, T as TicketDetails, S as SearchTicketsInput, d as SearchTicketsOutput, U as UpdateTicketInput, e as UpdateTicketOutput, O as Operations, f as Credentials, g as Config } from './connection-BRfKrSCD.js';
|
|
2
|
+
export { h as AddNoteInputSchema, i as AddNoteOutputSchema, j as ConfigSchema, k as CreateTicketInputSchema, l as CreateTicketOutputSchema, m as CredentialSource, n as GetTicketInputSchema, o as SearchTicketsInputSchema, p as SearchTicketsOutputSchema, q as Ticket, r as TicketConversation, s as TicketConversationSchema, t as TicketDetailsSchema, u as TicketRequester, v as TicketRequesterInput, w as TicketRequesterInputSchema, x as TicketRequesterSchema, y as TicketSchema, z as UpdateTicketInputSchema, B as UpdateTicketOutputSchema, D as newConnection, E as newConnectionWithOperations } from './connection-BRfKrSCD.js';
|
|
3
|
+
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
4
|
+
import { MutationDefinition, QueryDefinition, MutationStepConfig, Mutation, MutationResult, QueryStepConfig, Query, QueryResult, MutationStep, QueryStep, Call, QueryAttempt, MutationAttempt, CredentialProvider, Failure, ReceiptDraft } from '@superdurable/connectors-sdk';
|
|
5
|
+
import { StepTarget } from '@superdurable/dex';
|
|
6
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
7
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
/** Stable connector identity. */
|
|
11
|
+
declare const ConnectorID = "freshdesk";
|
|
12
|
+
/** Provider identity for named connections. */
|
|
13
|
+
declare const ProviderID = "freshdesk";
|
|
14
|
+
/** Branch IDs for searchTickets. */
|
|
15
|
+
declare const SearchTicketsBranch: {
|
|
16
|
+
readonly Searched: "searched";
|
|
17
|
+
readonly ProviderRejected: "providerRejected";
|
|
18
|
+
readonly InvalidResponse: "invalidResponse";
|
|
19
|
+
readonly Defect: "defect";
|
|
20
|
+
};
|
|
21
|
+
/** One page of matching tickets was returned; it may be empty. */
|
|
22
|
+
declare const SearchTicketsBranchSearched: "searched";
|
|
23
|
+
/** Freshdesk conclusively rejected the search, such as invalid credentials, a missing permission, or an unknown status. */
|
|
24
|
+
declare const SearchTicketsBranchProviderRejected: "providerRejected";
|
|
25
|
+
/** Freshdesk returned an invalid or oversized contact list or search page. */
|
|
26
|
+
declare const SearchTicketsBranchInvalidResponse: "invalidResponse";
|
|
27
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
28
|
+
declare const SearchTicketsBranchDefect: "defect";
|
|
29
|
+
/** Manifest definition for searchTickets. */
|
|
30
|
+
declare const SearchTicketsDefinition: QueryDefinition;
|
|
31
|
+
/** Manifest metadata for searchTickets. */
|
|
32
|
+
declare const SearchTicketsMetadata: {
|
|
33
|
+
readonly kind: "query";
|
|
34
|
+
readonly idempotency: "none";
|
|
35
|
+
readonly authorization: "required";
|
|
36
|
+
};
|
|
37
|
+
/** Branch IDs for getTicket. */
|
|
38
|
+
declare const GetTicketBranch: {
|
|
39
|
+
readonly Found: "found";
|
|
40
|
+
readonly NotFound: "notFound";
|
|
41
|
+
readonly ProviderRejected: "providerRejected";
|
|
42
|
+
readonly InvalidResponse: "invalidResponse";
|
|
43
|
+
readonly Defect: "defect";
|
|
44
|
+
};
|
|
45
|
+
/** The ticket and its first conversations were read. */
|
|
46
|
+
declare const GetTicketBranchFound: "found";
|
|
47
|
+
/** The ticket does not exist or is not visible to the connection's agent. */
|
|
48
|
+
declare const GetTicketBranchNotFound: "notFound";
|
|
49
|
+
/** Freshdesk conclusively rejected the ticket read. */
|
|
50
|
+
declare const GetTicketBranchProviderRejected: "providerRejected";
|
|
51
|
+
/** Freshdesk returned an invalid or oversized ticket or conversation page. */
|
|
52
|
+
declare const GetTicketBranchInvalidResponse: "invalidResponse";
|
|
53
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
54
|
+
declare const GetTicketBranchDefect: "defect";
|
|
55
|
+
/** Manifest definition for getTicket. */
|
|
56
|
+
declare const GetTicketDefinition: QueryDefinition;
|
|
57
|
+
/** Manifest metadata for getTicket. */
|
|
58
|
+
declare const GetTicketMetadata: {
|
|
59
|
+
readonly kind: "query";
|
|
60
|
+
readonly idempotency: "none";
|
|
61
|
+
readonly authorization: "required";
|
|
62
|
+
};
|
|
63
|
+
/** Branch IDs for createTicket. */
|
|
64
|
+
declare const CreateTicketBranch: {
|
|
65
|
+
readonly Created: "created";
|
|
66
|
+
readonly ProviderRejected: "providerRejected";
|
|
67
|
+
readonly Uncertain: "uncertain";
|
|
68
|
+
readonly Defect: "defect";
|
|
69
|
+
};
|
|
70
|
+
/** Freshdesk created the ticket and returned it. */
|
|
71
|
+
declare const CreateTicketBranchCreated: "created";
|
|
72
|
+
/** Freshdesk conclusively rejected the ticket, such as an unknown status, group, or agent; no ticket was created. */
|
|
73
|
+
declare const CreateTicketBranchProviderRejected: "providerRejected";
|
|
74
|
+
/** The request was sent but its outcome cannot be confirmed, so the ticket may exist; the connector never resends it. */
|
|
75
|
+
declare const CreateTicketBranchUncertain: "uncertain";
|
|
76
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
77
|
+
declare const CreateTicketBranchDefect: "defect";
|
|
78
|
+
/** Manifest definition for createTicket. */
|
|
79
|
+
declare const CreateTicketDefinition: MutationDefinition;
|
|
80
|
+
/** Manifest metadata for createTicket. */
|
|
81
|
+
declare const CreateTicketMetadata: {
|
|
82
|
+
readonly kind: "mutation";
|
|
83
|
+
readonly idempotency: "required";
|
|
84
|
+
readonly authorization: "required";
|
|
85
|
+
};
|
|
86
|
+
/** Branch IDs for updateTicket. */
|
|
87
|
+
declare const UpdateTicketBranch: {
|
|
88
|
+
readonly Updated: "updated";
|
|
89
|
+
readonly NotFound: "notFound";
|
|
90
|
+
readonly ProviderRejected: "providerRejected";
|
|
91
|
+
readonly InvalidResponse: "invalidResponse";
|
|
92
|
+
readonly Defect: "defect";
|
|
93
|
+
};
|
|
94
|
+
/** The ticket holds the requested values, written now or by an earlier attempt. */
|
|
95
|
+
declare const UpdateTicketBranchUpdated: "updated";
|
|
96
|
+
/** The ticket does not exist or is not visible to the connection's agent. */
|
|
97
|
+
declare const UpdateTicketBranchNotFound: "notFound";
|
|
98
|
+
/** Freshdesk conclusively rejected the change, such as an unknown status, a missing required field, or a spam or deleted ticket. */
|
|
99
|
+
declare const UpdateTicketBranchProviderRejected: "providerRejected";
|
|
100
|
+
/** Freshdesk returned an invalid or oversized ticket, so the change may have been applied. */
|
|
101
|
+
declare const UpdateTicketBranchInvalidResponse: "invalidResponse";
|
|
102
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
103
|
+
declare const UpdateTicketBranchDefect: "defect";
|
|
104
|
+
/** Manifest definition for updateTicket. */
|
|
105
|
+
declare const UpdateTicketDefinition: MutationDefinition;
|
|
106
|
+
/** Manifest metadata for updateTicket. */
|
|
107
|
+
declare const UpdateTicketMetadata: {
|
|
108
|
+
readonly kind: "mutation";
|
|
109
|
+
readonly idempotency: "required";
|
|
110
|
+
readonly authorization: "required";
|
|
111
|
+
};
|
|
112
|
+
/** Branch IDs for addNote. */
|
|
113
|
+
declare const AddNoteBranch: {
|
|
114
|
+
readonly Added: "added";
|
|
115
|
+
readonly NotFound: "notFound";
|
|
116
|
+
readonly ProviderRejected: "providerRejected";
|
|
117
|
+
readonly Uncertain: "uncertain";
|
|
118
|
+
readonly Defect: "defect";
|
|
119
|
+
};
|
|
120
|
+
/** Freshdesk added the note or reply and returned it. */
|
|
121
|
+
declare const AddNoteBranchAdded: "added";
|
|
122
|
+
/** The ticket does not exist or is not visible to the connection's agent; nothing was added. */
|
|
123
|
+
declare const AddNoteBranchNotFound: "notFound";
|
|
124
|
+
/** Freshdesk conclusively rejected the note or reply; nothing was added. */
|
|
125
|
+
declare const AddNoteBranchProviderRejected: "providerRejected";
|
|
126
|
+
/** The request was sent but its outcome cannot be confirmed, so the note or reply may exist; the connector never resends it. */
|
|
127
|
+
declare const AddNoteBranchUncertain: "uncertain";
|
|
128
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
129
|
+
declare const AddNoteBranchDefect: "defect";
|
|
130
|
+
/** Manifest definition for addNote. */
|
|
131
|
+
declare const AddNoteDefinition: MutationDefinition;
|
|
132
|
+
/** Manifest metadata for addNote. */
|
|
133
|
+
declare const AddNoteMetadata: {
|
|
134
|
+
readonly kind: "mutation";
|
|
135
|
+
readonly idempotency: "required";
|
|
136
|
+
readonly authorization: "required";
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/** Configuration for the searchTickets connector Step. */
|
|
140
|
+
interface SearchTicketsStepConfig<StepInput, OperationInput = SearchTicketsInput, OperationOutput = SearchTicketsOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
141
|
+
/** Named connection supplying this operation. */
|
|
142
|
+
connection: Connection<{
|
|
143
|
+
searchTickets(): Query<OperationInput, OperationOutput>;
|
|
144
|
+
}>;
|
|
145
|
+
/** Name matching the bound connection. */
|
|
146
|
+
connectionName: string;
|
|
147
|
+
/** One page of matching tickets was returned; it may be empty. */
|
|
148
|
+
searched: StepTarget<QueryResult<OperationOutput>>;
|
|
149
|
+
/** Freshdesk conclusively rejected the search, such as invalid credentials, a missing permission, or an unknown status. */
|
|
150
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
151
|
+
/** Freshdesk returned an invalid or oversized contact list or search page. */
|
|
152
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
153
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
154
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
155
|
+
}
|
|
156
|
+
/** Build the searchTickets Step from a named connection. */
|
|
157
|
+
declare function newSearchTicketsStep<StepInput, OperationInput = SearchTicketsInput, OperationOutput = SearchTicketsOutput>(configuration: SearchTicketsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
158
|
+
/** Configuration for the getTicket connector Step. */
|
|
159
|
+
interface GetTicketStepConfig<StepInput, OperationInput = GetTicketInput, OperationOutput = TicketDetails> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
160
|
+
/** Named connection supplying this operation. */
|
|
161
|
+
connection: Connection<{
|
|
162
|
+
getTicket(): Query<OperationInput, OperationOutput>;
|
|
163
|
+
}>;
|
|
164
|
+
/** Name matching the bound connection. */
|
|
165
|
+
connectionName: string;
|
|
166
|
+
/** The ticket and its first conversations were read. */
|
|
167
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
168
|
+
/** The ticket does not exist or is not visible to the connection's agent. */
|
|
169
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
170
|
+
/** Freshdesk conclusively rejected the ticket read. */
|
|
171
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
172
|
+
/** Freshdesk returned an invalid or oversized ticket or conversation page. */
|
|
173
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
174
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
175
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
176
|
+
}
|
|
177
|
+
/** Build the getTicket Step from a named connection. */
|
|
178
|
+
declare function newGetTicketStep<StepInput, OperationInput = GetTicketInput, OperationOutput = TicketDetails>(configuration: GetTicketStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
179
|
+
/** Configuration for the createTicket connector Step. */
|
|
180
|
+
interface CreateTicketStepConfig<StepInput, OperationInput = CreateTicketInput, OperationOutput = CreateTicketOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
181
|
+
/** Named connection supplying this operation. */
|
|
182
|
+
connection: Connection<{
|
|
183
|
+
createTicket(): Mutation<OperationInput, OperationOutput>;
|
|
184
|
+
}>;
|
|
185
|
+
/** Name matching the bound connection. */
|
|
186
|
+
connectionName: string;
|
|
187
|
+
/** Freshdesk created the ticket and returned it. */
|
|
188
|
+
created: StepTarget<MutationResult<OperationOutput>>;
|
|
189
|
+
/** Freshdesk conclusively rejected the ticket, such as an unknown status, group, or agent; no ticket was created. */
|
|
190
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
191
|
+
/** The request was sent but its outcome cannot be confirmed, so the ticket may exist; the connector never resends it. */
|
|
192
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
193
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
194
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
195
|
+
}
|
|
196
|
+
/** Build the createTicket Step from a named connection. */
|
|
197
|
+
declare function newCreateTicketStep<StepInput, OperationInput = CreateTicketInput, OperationOutput = CreateTicketOutput>(configuration: CreateTicketStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
198
|
+
/** Configuration for the updateTicket connector Step. */
|
|
199
|
+
interface UpdateTicketStepConfig<StepInput, OperationInput = UpdateTicketInput, OperationOutput = UpdateTicketOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
200
|
+
/** Named connection supplying this operation. */
|
|
201
|
+
connection: Connection<{
|
|
202
|
+
updateTicket(): Mutation<OperationInput, OperationOutput>;
|
|
203
|
+
}>;
|
|
204
|
+
/** Name matching the bound connection. */
|
|
205
|
+
connectionName: string;
|
|
206
|
+
/** The ticket holds the requested values, written now or by an earlier attempt. */
|
|
207
|
+
updated: StepTarget<MutationResult<OperationOutput>>;
|
|
208
|
+
/** The ticket does not exist or is not visible to the connection's agent. */
|
|
209
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
210
|
+
/** Freshdesk conclusively rejected the change, such as an unknown status, a missing required field, or a spam or deleted ticket. */
|
|
211
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
212
|
+
/** Freshdesk returned an invalid or oversized ticket, so the change may have been applied. */
|
|
213
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
214
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
215
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
216
|
+
}
|
|
217
|
+
/** Build the updateTicket Step from a named connection. */
|
|
218
|
+
declare function newUpdateTicketStep<StepInput, OperationInput = UpdateTicketInput, OperationOutput = UpdateTicketOutput>(configuration: UpdateTicketStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
219
|
+
/** Configuration for the addNote connector Step. */
|
|
220
|
+
interface AddNoteStepConfig<StepInput, OperationInput = AddNoteInput, OperationOutput = AddNoteOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
221
|
+
/** Named connection supplying this operation. */
|
|
222
|
+
connection: Connection<{
|
|
223
|
+
addNote(): Mutation<OperationInput, OperationOutput>;
|
|
224
|
+
}>;
|
|
225
|
+
/** Name matching the bound connection. */
|
|
226
|
+
connectionName: string;
|
|
227
|
+
/** Freshdesk added the note or reply and returned it. */
|
|
228
|
+
added: StepTarget<MutationResult<OperationOutput>>;
|
|
229
|
+
/** The ticket does not exist or is not visible to the connection's agent; nothing was added. */
|
|
230
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
231
|
+
/** Freshdesk conclusively rejected the note or reply; nothing was added. */
|
|
232
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
233
|
+
/** The request was sent but its outcome cannot be confirmed, so the note or reply may exist; the connector never resends it. */
|
|
234
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
235
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
236
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
237
|
+
}
|
|
238
|
+
/** Build the addNote Step from a named connection. */
|
|
239
|
+
declare function newAddNoteStep<StepInput, OperationInput = AddNoteInput, OperationOutput = AddNoteOutput>(configuration: AddNoteStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
240
|
+
|
|
241
|
+
/** Open a configured static Freshdesk connection from a loaded Dex project. */
|
|
242
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
243
|
+
|
|
244
|
+
/** Search one Freshdesk filter page, optionally using a contact lookup. */
|
|
245
|
+
declare class SearchTicketsOperation implements Query<SearchTicketsInput, SearchTicketsOutput> {
|
|
246
|
+
private readonly client;
|
|
247
|
+
/** Bind the API client. */ constructor(client: FreshdeskClient);
|
|
248
|
+
/** Return stable manifest metadata. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
249
|
+
/** Validate filters, then perform at most two reads. */
|
|
250
|
+
invoke(call: Call, input: SearchTicketsInput): Promise<QueryAttempt<SearchTicketsOutput>>;
|
|
251
|
+
}
|
|
252
|
+
/** Read one ticket, requester, and bounded conversation page. */
|
|
253
|
+
declare class GetTicketOperation implements Query<GetTicketInput, TicketDetails> {
|
|
254
|
+
private readonly client;
|
|
255
|
+
/** Bind the API client. */ constructor(client: FreshdeskClient);
|
|
256
|
+
/** Return stable manifest metadata. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
257
|
+
/** Perform the ticket and conversation reads. */
|
|
258
|
+
invoke(call: Call, input: GetTicketInput): Promise<QueryAttempt<TicketDetails>>;
|
|
259
|
+
}
|
|
260
|
+
/** Create one ticket with a checkpoint before the unkeyed POST. */
|
|
261
|
+
declare class CreateTicketOperation implements Mutation<CreateTicketInput, CreateTicketOutput> {
|
|
262
|
+
private readonly client;
|
|
263
|
+
/** Bind the API client. */ constructor(client: FreshdeskClient);
|
|
264
|
+
/** Return stable manifest metadata. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
265
|
+
/** Correlate the mutation by Call ID; Freshdesk does not receive this key. */ idempotencyKey(callID: string): string;
|
|
266
|
+
/** Validate, checkpoint, and send at most once per safe attempt. */
|
|
267
|
+
invoke(call: Call, input: CreateTicketInput): Promise<MutationAttempt<CreateTicketOutput>>;
|
|
268
|
+
}
|
|
269
|
+
/** Replace changed ticket fields after reading current values. */
|
|
270
|
+
declare class UpdateTicketOperation implements Mutation<UpdateTicketInput, UpdateTicketOutput> {
|
|
271
|
+
private readonly client;
|
|
272
|
+
/** Bind the API client. */ constructor(client: FreshdeskClient);
|
|
273
|
+
/** Return stable manifest metadata. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
274
|
+
/** Correlate the absolute replacement by Call ID. */ idempotencyKey(callID: string): string;
|
|
275
|
+
/** Read, diff, and write only when a field differs. */
|
|
276
|
+
invoke(call: Call, input: UpdateTicketInput): Promise<MutationAttempt<UpdateTicketOutput>>;
|
|
277
|
+
}
|
|
278
|
+
/** Add one private note or public reply with a checkpoint before POST. */
|
|
279
|
+
declare class AddNoteOperation implements Mutation<AddNoteInput, AddNoteOutput> {
|
|
280
|
+
private readonly client;
|
|
281
|
+
/** Bind the API client. */ constructor(client: FreshdeskClient);
|
|
282
|
+
/** Return stable manifest metadata. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
283
|
+
/** Correlate the mutation by Call ID; Freshdesk does not receive this key. */ idempotencyKey(callID: string): string;
|
|
284
|
+
/** Validate, checkpoint, and send one note or reply. */
|
|
285
|
+
invoke(call: Call, input: AddNoteInput): Promise<MutationAttempt<AddNoteOutput>>;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** Injected transport and clock for deterministic provider replay. */
|
|
289
|
+
interface FreshdeskClientOptions {
|
|
290
|
+
/** Local Freshdesk-compatible endpoint; production derives it from domain. */ apiBaseURL?: string;
|
|
291
|
+
/** Bounded request sender; production uses the SDK transport. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
292
|
+
/** Receipt and Retry-After clock. */ now?: () => Date;
|
|
293
|
+
}
|
|
294
|
+
/** Classified result of one Freshdesk HTTP exchange. */
|
|
295
|
+
type Exchange = {
|
|
296
|
+
outcome: 'succeeded';
|
|
297
|
+
response: ProviderResponse;
|
|
298
|
+
} | {
|
|
299
|
+
outcome: 'rateLimited' | 'notSent' | 'serviceUnavailable' | 'unavailable' | 'notFound' | 'invalid' | 'defect' | 'rejected';
|
|
300
|
+
failure: Failure;
|
|
301
|
+
response?: ProviderResponse;
|
|
302
|
+
retryAfterMs: number;
|
|
303
|
+
};
|
|
304
|
+
/** Validated, concurrent Freshdesk API client. */
|
|
305
|
+
declare class FreshdeskClient {
|
|
306
|
+
readonly credentials: CredentialProvider<Credentials>;
|
|
307
|
+
private readonly apiBaseURL;
|
|
308
|
+
private readonly maxResponseBytes;
|
|
309
|
+
private readonly send;
|
|
310
|
+
private readonly now;
|
|
311
|
+
/** Bind immutable configuration and a live credential source. */
|
|
312
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: FreshdeskClientOptions);
|
|
313
|
+
/** Bind the search query. */ searchTickets(): SearchTicketsOperation;
|
|
314
|
+
/** Bind the ticket read query. */ getTicket(): GetTicketOperation;
|
|
315
|
+
/** Bind the ticket creation mutation. */ createTicket(): CreateTicketOperation;
|
|
316
|
+
/** Bind the ticket update mutation. */ updateTicket(): UpdateTicketOperation;
|
|
317
|
+
/** Bind the note mutation. */ addNote(): AddNoteOperation;
|
|
318
|
+
/** Resolve the current API key, classifying terminal credential states. */
|
|
319
|
+
resolveCredential(call: Call, operation: string): Promise<{
|
|
320
|
+
key: string;
|
|
321
|
+
} | {
|
|
322
|
+
failure: Failure;
|
|
323
|
+
transient: boolean;
|
|
324
|
+
}>;
|
|
325
|
+
/** Send one bounded request and classify its observable outcome. */
|
|
326
|
+
exchange(call: Call, operation: string, key: string, method: string, path: string, query?: URLSearchParams, payload?: unknown, signal?: AbortSignal): Promise<Exchange>;
|
|
327
|
+
private classifyStatus;
|
|
328
|
+
/** Build secret-free failure metadata. */ failure(operation: string, kind: Failure['kind'], message: string): Failure;
|
|
329
|
+
/** Build a stable receipt after provider observation. */
|
|
330
|
+
receipt(call: Call, response?: ProviderResponse, objectID?: number): ReceiptDraft;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export { AddNoteBranch, AddNoteBranchAdded, AddNoteBranchDefect, AddNoteBranchNotFound, AddNoteBranchProviderRejected, AddNoteBranchUncertain, AddNoteDefinition, AddNoteInput, AddNoteMetadata, AddNoteOperation, AddNoteOutput, type AddNoteStepConfig, Config, Connection, ConnectorID, CreateTicketBranch, CreateTicketBranchCreated, CreateTicketBranchDefect, CreateTicketBranchProviderRejected, CreateTicketBranchUncertain, CreateTicketDefinition, CreateTicketInput, CreateTicketMetadata, CreateTicketOperation, CreateTicketOutput, type CreateTicketStepConfig, Credentials, FreshdeskClient, type FreshdeskClientOptions, GetTicketBranch, GetTicketBranchDefect, GetTicketBranchFound, GetTicketBranchInvalidResponse, GetTicketBranchNotFound, GetTicketBranchProviderRejected, GetTicketDefinition, GetTicketInput, GetTicketMetadata, GetTicketOperation, type GetTicketStepConfig, ProviderID, SearchTicketsBranch, SearchTicketsBranchDefect, SearchTicketsBranchInvalidResponse, SearchTicketsBranchProviderRejected, SearchTicketsBranchSearched, SearchTicketsDefinition, SearchTicketsInput, SearchTicketsMetadata, SearchTicketsOperation, SearchTicketsOutput, type SearchTicketsStepConfig, TicketDetails, UpdateTicketBranch, UpdateTicketBranchDefect, UpdateTicketBranchInvalidResponse, UpdateTicketBranchNotFound, UpdateTicketBranchProviderRejected, UpdateTicketBranchUpdated, UpdateTicketDefinition, UpdateTicketInput, UpdateTicketMetadata, UpdateTicketOperation, UpdateTicketOutput, type UpdateTicketStepConfig, newAddNoteStep, newCreateTicketStep, newGetTicketStep, newProjectConnection, newSearchTicketsStep, newUpdateTicketStep };
|