@superdurable/connector-front 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 +16 -2
- package/dex-connector.json +201 -0
- package/dist/chunk-7HCGNRLW.js +358 -0
- package/dist/connection-BKHmrBii.d.ts +621 -0
- package/dist/index.d.ts +362 -0
- package/dist/index.js +975 -0
- package/dist/mock.d.ts +163 -0
- package/dist/mock.js +391 -0
- package/package.json +60 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { F as FindContactByEmailInput, a as FindContactByEmailOutput, C as Connection, G as GetConversationInput, b as ConversationDetails, R as ReplyToConversationInput, c as ConversationReply, S as SearchConversationsInput, d as SearchConversationsOutput, U as UpdateConversationInput, e as UpdateConversationOutput, O as Operations, f as Config, g as Credentials } from './connection-BKHmrBii.js';
|
|
2
|
+
export { h as Comment, i as CommentSchema, j as ConfigSchema, k as Contact, l as ContactHandle, m as ContactHandleSchema, n as ContactSchema, o as Conversation, p as ConversationDetailsSchema, q as ConversationReplySchema, r as ConversationSchema, s as CredentialSource, t as FindContactByEmailInputSchema, u as FindContactByEmailOutputSchema, v as GetConversationInputSchema, M as Message, w as MessageSchema, x as Recipient, y as RecipientSchema, z as ReplyToConversationInputSchema, A as SearchConversationsInputSchema, B as SearchConversationsOutputSchema, T as Tag, D as TagSchema, E as Teammate, H as TeammateSchema, I as UpdateConversationInputSchema, J as UpdateConversationOutputSchema, K as newConnection, L as newConnectionWithOperations } from './connection-BKHmrBii.js';
|
|
3
|
+
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
4
|
+
import { QueryDefinition, MutationDefinition, QueryStepConfig, Query, QueryResult, MutationStepConfig, Mutation, MutationResult, QueryStep, MutationStep, 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 = "front";
|
|
12
|
+
/** Provider identity for named connections. */
|
|
13
|
+
declare const ProviderID = "front";
|
|
14
|
+
/** Branch IDs for searchConversations. */
|
|
15
|
+
declare const SearchConversationsBranch: {
|
|
16
|
+
readonly Searched: "searched";
|
|
17
|
+
readonly ProviderRejected: "providerRejected";
|
|
18
|
+
readonly InvalidResponse: "invalidResponse";
|
|
19
|
+
readonly Defect: "defect";
|
|
20
|
+
};
|
|
21
|
+
/** Front returned one page of matching conversations; it may be empty. */
|
|
22
|
+
declare const SearchConversationsBranchSearched: "searched";
|
|
23
|
+
/** Front conclusively rejected the search, such as an invalid token, a token without conversation read access, or an expired page token. */
|
|
24
|
+
declare const SearchConversationsBranchProviderRejected: "providerRejected";
|
|
25
|
+
/** Front returned a malformed or oversized page, or a next-page link outside Front's API hosts. */
|
|
26
|
+
declare const SearchConversationsBranchInvalidResponse: "invalidResponse";
|
|
27
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
28
|
+
declare const SearchConversationsBranchDefect: "defect";
|
|
29
|
+
/** Manifest definition for searchConversations. */
|
|
30
|
+
declare const SearchConversationsDefinition: QueryDefinition;
|
|
31
|
+
/** Manifest metadata for searchConversations. */
|
|
32
|
+
declare const SearchConversationsMetadata: {
|
|
33
|
+
readonly kind: "query";
|
|
34
|
+
readonly idempotency: "none";
|
|
35
|
+
readonly authorization: "required";
|
|
36
|
+
};
|
|
37
|
+
/** Branch IDs for getConversation. */
|
|
38
|
+
declare const GetConversationBranch: {
|
|
39
|
+
readonly Found: "found";
|
|
40
|
+
readonly Merged: "merged";
|
|
41
|
+
readonly NotFound: "notFound";
|
|
42
|
+
readonly ProviderRejected: "providerRejected";
|
|
43
|
+
readonly InvalidResponse: "invalidResponse";
|
|
44
|
+
readonly Defect: "defect";
|
|
45
|
+
};
|
|
46
|
+
/** Front returned the conversation with its newest messages and comments. */
|
|
47
|
+
declare const GetConversationBranchFound: "found";
|
|
48
|
+
/** The conversation was merged into another; mergedIntoConversationId names the conversation to read instead. */
|
|
49
|
+
declare const GetConversationBranchMerged: "merged";
|
|
50
|
+
/** The conversation does not exist or is not visible to the API token. */
|
|
51
|
+
declare const GetConversationBranchNotFound: "notFound";
|
|
52
|
+
/** Front conclusively rejected the read, such as an invalid token or a token without message or comment read access. */
|
|
53
|
+
declare const GetConversationBranchProviderRejected: "providerRejected";
|
|
54
|
+
/** Front returned a malformed or oversized conversation, message page, or comment list. */
|
|
55
|
+
declare const GetConversationBranchInvalidResponse: "invalidResponse";
|
|
56
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
57
|
+
declare const GetConversationBranchDefect: "defect";
|
|
58
|
+
/** Manifest definition for getConversation. */
|
|
59
|
+
declare const GetConversationDefinition: QueryDefinition;
|
|
60
|
+
/** Manifest metadata for getConversation. */
|
|
61
|
+
declare const GetConversationMetadata: {
|
|
62
|
+
readonly kind: "query";
|
|
63
|
+
readonly idempotency: "none";
|
|
64
|
+
readonly authorization: "required";
|
|
65
|
+
};
|
|
66
|
+
/** Branch IDs for replyToConversation. */
|
|
67
|
+
declare const ReplyToConversationBranch: {
|
|
68
|
+
readonly Replied: "replied";
|
|
69
|
+
readonly NotFound: "notFound";
|
|
70
|
+
readonly ProviderRejected: "providerRejected";
|
|
71
|
+
readonly Uncertain: "uncertain";
|
|
72
|
+
readonly Defect: "defect";
|
|
73
|
+
};
|
|
74
|
+
/** Front accepted the reply for delivery or created the comment. */
|
|
75
|
+
declare const ReplyToConversationBranchReplied: "replied";
|
|
76
|
+
/** The conversation does not exist, was merged, or is not visible to the API token; nothing was sent. */
|
|
77
|
+
declare const ReplyToConversationBranchNotFound: "notFound";
|
|
78
|
+
/** Front conclusively rejected the reply or comment, such as a token without send permission or an unknown author; nothing was sent. */
|
|
79
|
+
declare const ReplyToConversationBranchProviderRejected: "providerRejected";
|
|
80
|
+
/** The reply or comment may exist after a lost answer, ambiguous server error, late answer, 409 conflict, or terminal credential failure during accepted-write read-back; an accepted comment may have been deleted before read-back. The connector never resends without proof of non-application. */
|
|
81
|
+
declare const ReplyToConversationBranchUncertain: "uncertain";
|
|
82
|
+
/** Local input, connection credentials that require reauthorization or are unusable before sending, or the connector definition is invalid; transient credential failures Retry. */
|
|
83
|
+
declare const ReplyToConversationBranchDefect: "defect";
|
|
84
|
+
/** Manifest definition for replyToConversation. */
|
|
85
|
+
declare const ReplyToConversationDefinition: MutationDefinition;
|
|
86
|
+
/** Manifest metadata for replyToConversation. */
|
|
87
|
+
declare const ReplyToConversationMetadata: {
|
|
88
|
+
readonly kind: "mutation";
|
|
89
|
+
readonly idempotency: "required";
|
|
90
|
+
readonly authorization: "required";
|
|
91
|
+
};
|
|
92
|
+
/** Branch IDs for updateConversation. */
|
|
93
|
+
declare const UpdateConversationBranch: {
|
|
94
|
+
readonly Updated: "updated";
|
|
95
|
+
readonly NotFound: "notFound";
|
|
96
|
+
readonly ProviderRejected: "providerRejected";
|
|
97
|
+
readonly InvalidResponse: "invalidResponse";
|
|
98
|
+
readonly Defect: "defect";
|
|
99
|
+
};
|
|
100
|
+
/** The conversation holds the requested status, assignee, and tags, written now or by an earlier attempt. */
|
|
101
|
+
declare const UpdateConversationBranchUpdated: "updated";
|
|
102
|
+
/** The conversation does not exist, was merged, or is not visible to the API token. */
|
|
103
|
+
declare const UpdateConversationBranchNotFound: "notFound";
|
|
104
|
+
/** Front conclusively rejected a change, such as an unknown teammate, tag, or ticket status; changes sent before it stay applied. */
|
|
105
|
+
declare const UpdateConversationBranchProviderRejected: "providerRejected";
|
|
106
|
+
/** Front returned a malformed or oversized conversation, so the change may have been applied. */
|
|
107
|
+
declare const UpdateConversationBranchInvalidResponse: "invalidResponse";
|
|
108
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
109
|
+
declare const UpdateConversationBranchDefect: "defect";
|
|
110
|
+
/** Manifest definition for updateConversation. */
|
|
111
|
+
declare const UpdateConversationDefinition: MutationDefinition;
|
|
112
|
+
/** Manifest metadata for updateConversation. */
|
|
113
|
+
declare const UpdateConversationMetadata: {
|
|
114
|
+
readonly kind: "mutation";
|
|
115
|
+
readonly idempotency: "required";
|
|
116
|
+
readonly authorization: "required";
|
|
117
|
+
};
|
|
118
|
+
/** Branch IDs for findContactByEmail. */
|
|
119
|
+
declare const FindContactByEmailBranch: {
|
|
120
|
+
readonly Found: "found";
|
|
121
|
+
readonly NotFound: "notFound";
|
|
122
|
+
readonly ProviderRejected: "providerRejected";
|
|
123
|
+
readonly InvalidResponse: "invalidResponse";
|
|
124
|
+
readonly Defect: "defect";
|
|
125
|
+
};
|
|
126
|
+
/** A Front contact has the email handle. */
|
|
127
|
+
declare const FindContactByEmailBranchFound: "found";
|
|
128
|
+
/** No Front contact has the email handle. */
|
|
129
|
+
declare const FindContactByEmailBranchNotFound: "notFound";
|
|
130
|
+
/** Front conclusively rejected the lookup, such as an invalid token or a token without contact read access. */
|
|
131
|
+
declare const FindContactByEmailBranchProviderRejected: "providerRejected";
|
|
132
|
+
/** Front returned a malformed or oversized contact. */
|
|
133
|
+
declare const FindContactByEmailBranchInvalidResponse: "invalidResponse";
|
|
134
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
135
|
+
declare const FindContactByEmailBranchDefect: "defect";
|
|
136
|
+
/** Manifest definition for findContactByEmail. */
|
|
137
|
+
declare const FindContactByEmailDefinition: QueryDefinition;
|
|
138
|
+
/** Manifest metadata for findContactByEmail. */
|
|
139
|
+
declare const FindContactByEmailMetadata: {
|
|
140
|
+
readonly kind: "query";
|
|
141
|
+
readonly idempotency: "none";
|
|
142
|
+
readonly authorization: "required";
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/** Configuration for the searchConversations connector Step. */
|
|
146
|
+
interface SearchConversationsStepConfig<StepInput, OperationInput = SearchConversationsInput, OperationOutput = SearchConversationsOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
147
|
+
/** Named connection supplying this operation. */
|
|
148
|
+
connection: Connection<{
|
|
149
|
+
searchConversations(): Query<OperationInput, OperationOutput>;
|
|
150
|
+
}>;
|
|
151
|
+
/** Name matching the bound connection. */
|
|
152
|
+
connectionName: string;
|
|
153
|
+
/** Front returned one page of matching conversations; it may be empty. */
|
|
154
|
+
searched: StepTarget<QueryResult<OperationOutput>>;
|
|
155
|
+
/** Front conclusively rejected the search, such as an invalid token, a token without conversation read access, or an expired page token. */
|
|
156
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
157
|
+
/** Front returned a malformed or oversized page, or a next-page link outside Front's API hosts. */
|
|
158
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
159
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
160
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
161
|
+
}
|
|
162
|
+
/** Build the searchConversations Step from a named connection. */
|
|
163
|
+
declare function newSearchConversationsStep<StepInput, OperationInput = SearchConversationsInput, OperationOutput = SearchConversationsOutput>(configuration: SearchConversationsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
164
|
+
/** Configuration for the getConversation connector Step. */
|
|
165
|
+
interface GetConversationStepConfig<StepInput, OperationInput = GetConversationInput, OperationOutput = ConversationDetails> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
166
|
+
/** Named connection supplying this operation. */
|
|
167
|
+
connection: Connection<{
|
|
168
|
+
getConversation(): Query<OperationInput, OperationOutput>;
|
|
169
|
+
}>;
|
|
170
|
+
/** Name matching the bound connection. */
|
|
171
|
+
connectionName: string;
|
|
172
|
+
/** Front returned the conversation with its newest messages and comments. */
|
|
173
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
174
|
+
/** The conversation was merged into another; mergedIntoConversationId names the conversation to read instead. */
|
|
175
|
+
merged?: StepTarget<QueryResult<OperationOutput>>;
|
|
176
|
+
/** The conversation does not exist or is not visible to the API token. */
|
|
177
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
178
|
+
/** Front conclusively rejected the read, such as an invalid token or a token without message or comment read access. */
|
|
179
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
180
|
+
/** Front returned a malformed or oversized conversation, message page, or comment list. */
|
|
181
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
182
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
183
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
184
|
+
}
|
|
185
|
+
/** Build the getConversation Step from a named connection. */
|
|
186
|
+
declare function newGetConversationStep<StepInput, OperationInput = GetConversationInput, OperationOutput = ConversationDetails>(configuration: GetConversationStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
187
|
+
/** Configuration for the replyToConversation connector Step. */
|
|
188
|
+
interface ReplyToConversationStepConfig<StepInput, OperationInput = ReplyToConversationInput, OperationOutput = ConversationReply> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
189
|
+
/** Named connection supplying this operation. */
|
|
190
|
+
connection: Connection<{
|
|
191
|
+
replyToConversation(): Mutation<OperationInput, OperationOutput>;
|
|
192
|
+
}>;
|
|
193
|
+
/** Name matching the bound connection. */
|
|
194
|
+
connectionName: string;
|
|
195
|
+
/** Front accepted the reply for delivery or created the comment. */
|
|
196
|
+
replied: StepTarget<MutationResult<OperationOutput>>;
|
|
197
|
+
/** The conversation does not exist, was merged, or is not visible to the API token; nothing was sent. */
|
|
198
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
199
|
+
/** Front conclusively rejected the reply or comment, such as a token without send permission or an unknown author; nothing was sent. */
|
|
200
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
201
|
+
/** The reply or comment may exist after a lost answer, ambiguous server error, late answer, 409 conflict, or terminal credential failure during accepted-write read-back; an accepted comment may have been deleted before read-back. The connector never resends without proof of non-application. */
|
|
202
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
203
|
+
/** Local input, connection credentials that require reauthorization or are unusable before sending, or the connector definition is invalid; transient credential failures Retry. */
|
|
204
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
205
|
+
}
|
|
206
|
+
/** Build the replyToConversation Step from a named connection. */
|
|
207
|
+
declare function newReplyToConversationStep<StepInput, OperationInput = ReplyToConversationInput, OperationOutput = ConversationReply>(configuration: ReplyToConversationStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
208
|
+
/** Configuration for the updateConversation connector Step. */
|
|
209
|
+
interface UpdateConversationStepConfig<StepInput, OperationInput = UpdateConversationInput, OperationOutput = UpdateConversationOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
210
|
+
/** Named connection supplying this operation. */
|
|
211
|
+
connection: Connection<{
|
|
212
|
+
updateConversation(): Mutation<OperationInput, OperationOutput>;
|
|
213
|
+
}>;
|
|
214
|
+
/** Name matching the bound connection. */
|
|
215
|
+
connectionName: string;
|
|
216
|
+
/** The conversation holds the requested status, assignee, and tags, written now or by an earlier attempt. */
|
|
217
|
+
updated: StepTarget<MutationResult<OperationOutput>>;
|
|
218
|
+
/** The conversation does not exist, was merged, or is not visible to the API token. */
|
|
219
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
220
|
+
/** Front conclusively rejected a change, such as an unknown teammate, tag, or ticket status; changes sent before it stay applied. */
|
|
221
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
222
|
+
/** Front returned a malformed or oversized conversation, so the change may have been applied. */
|
|
223
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
224
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
225
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
226
|
+
}
|
|
227
|
+
/** Build the updateConversation Step from a named connection. */
|
|
228
|
+
declare function newUpdateConversationStep<StepInput, OperationInput = UpdateConversationInput, OperationOutput = UpdateConversationOutput>(configuration: UpdateConversationStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
229
|
+
/** Configuration for the findContactByEmail connector Step. */
|
|
230
|
+
interface FindContactByEmailStepConfig<StepInput, OperationInput = FindContactByEmailInput, OperationOutput = FindContactByEmailOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
231
|
+
/** Named connection supplying this operation. */
|
|
232
|
+
connection: Connection<{
|
|
233
|
+
findContactByEmail(): Query<OperationInput, OperationOutput>;
|
|
234
|
+
}>;
|
|
235
|
+
/** Name matching the bound connection. */
|
|
236
|
+
connectionName: string;
|
|
237
|
+
/** A Front contact has the email handle. */
|
|
238
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
239
|
+
/** No Front contact has the email handle. */
|
|
240
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
241
|
+
/** Front conclusively rejected the lookup, such as an invalid token or a token without contact read access. */
|
|
242
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
243
|
+
/** Front returned a malformed or oversized contact. */
|
|
244
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
245
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
246
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
247
|
+
}
|
|
248
|
+
/** Build the findContactByEmail Step from a named connection. */
|
|
249
|
+
declare function newFindContactByEmailStep<StepInput, OperationInput = FindContactByEmailInput, OperationOutput = FindContactByEmailOutput>(configuration: FindContactByEmailStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
250
|
+
|
|
251
|
+
/** Open one static Front connection declared in a Dex project. */
|
|
252
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
253
|
+
|
|
254
|
+
/** Search one bounded page of Front conversations. */
|
|
255
|
+
declare class SearchConversationsOperation implements Query<SearchConversationsInput, SearchConversationsOutput> {
|
|
256
|
+
private readonly client;
|
|
257
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
258
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
259
|
+
/** Validate filters, search, and classify one page. */
|
|
260
|
+
invoke(call: Call, input: SearchConversationsInput): Promise<QueryAttempt<SearchConversationsOutput>>;
|
|
261
|
+
}
|
|
262
|
+
/** Read one conversation and its newest message and comment pages. */
|
|
263
|
+
declare class GetConversationOperation implements Query<GetConversationInput, ConversationDetails> {
|
|
264
|
+
private readonly client;
|
|
265
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
266
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
267
|
+
/** Read and classify the three provider resources. */
|
|
268
|
+
invoke(call: Call, input: GetConversationInput): Promise<QueryAttempt<ConversationDetails>>;
|
|
269
|
+
}
|
|
270
|
+
/** Find a Front contact by one bare email address. */
|
|
271
|
+
declare class FindContactByEmailOperation implements Query<FindContactByEmailInput, FindContactByEmailOutput> {
|
|
272
|
+
private readonly client;
|
|
273
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
274
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
275
|
+
/** Read the contact alias and verify its email handle. */
|
|
276
|
+
invoke(call: Call, input: FindContactByEmailInput): Promise<QueryAttempt<FindContactByEmailOutput>>;
|
|
277
|
+
}
|
|
278
|
+
/** Repeat-safe status, assignment, and tag update. */
|
|
279
|
+
declare class UpdateConversationOperation implements Mutation<UpdateConversationInput, UpdateConversationOutput> {
|
|
280
|
+
private readonly client;
|
|
281
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
282
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
283
|
+
/** Stable call identity; writes set absolute values. */ idempotencyKey(callId: string): string;
|
|
284
|
+
/** Read, plan writes, and confirm the result. */
|
|
285
|
+
invoke(call: Call, input: UpdateConversationInput): Promise<MutationAttempt<UpdateConversationOutput>>;
|
|
286
|
+
}
|
|
287
|
+
/** Fenced mutation for one reply or internal comment. */
|
|
288
|
+
declare class ReplyToConversationOperation implements Mutation<ReplyToConversationInput, ConversationReply> {
|
|
289
|
+
private readonly client;
|
|
290
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
291
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
292
|
+
/** Stable call identity, recorded in the receipt. */ idempotencyKey(callId: string): string;
|
|
293
|
+
/** Send once with a durable claim, or read back an accepted provider ID. */
|
|
294
|
+
invoke(call: Call, input: ReplyToConversationInput): Promise<MutationAttempt<ConversationReply>>;
|
|
295
|
+
private readBack;
|
|
296
|
+
private classifySend;
|
|
297
|
+
private uncertain;
|
|
298
|
+
}
|
|
299
|
+
/** Build the ordered search filters Front expects. */
|
|
300
|
+
declare function buildConversationSearchQuery(input: SearchConversationsInput): string;
|
|
301
|
+
/** Turn plain text into escaped Front reply paragraphs. */
|
|
302
|
+
declare function buildReplyHTML(value: string): string;
|
|
303
|
+
|
|
304
|
+
/** One Front request, with an already escaped path. */
|
|
305
|
+
interface FrontRequest {
|
|
306
|
+
/** HTTP method sent to the provider. */ method: string;
|
|
307
|
+
/** Escaped path below the configured Front API host. */ path: string;
|
|
308
|
+
/** Optional query parameters. */ query?: URLSearchParams;
|
|
309
|
+
/** Optional JSON request body. */ payload?: unknown;
|
|
310
|
+
/** Cancellation for a fenced write. */ signal?: AbortSignal;
|
|
311
|
+
}
|
|
312
|
+
/** Classified Front response. */
|
|
313
|
+
interface FrontExchange {
|
|
314
|
+
/** Provider outcome before operation-specific branch mapping. */ outcome: 'succeeded' | 'merged' | 'notFound' | 'notSent' | 'rateLimited' | 'unconfirmed' | 'rejected' | 'invalid' | 'defect';
|
|
315
|
+
/** Bounded HTTP response, when one arrived. */ response?: ProviderResponse;
|
|
316
|
+
/** Secret-safe failure for unsuccessful exchanges. */ failure?: Failure;
|
|
317
|
+
/** Provider-directed delay for a safe retry, in milliseconds. */ retryAfterMs: number;
|
|
318
|
+
}
|
|
319
|
+
/** Transport replacement for deterministic provider tests. */
|
|
320
|
+
type FrontRequestSender = (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
321
|
+
/** Client dependencies for tests. */
|
|
322
|
+
interface FrontClientOptions {
|
|
323
|
+
/** Sender; production uses the SDK's bounded, no-redirect transport. */ send?: FrontRequestSender;
|
|
324
|
+
/** Clock used for receipts and rate-limit calculations. */ now?: () => Date;
|
|
325
|
+
/** Front-compatible URL for local provider tests; production leaves it unset. */ apiBaseURL?: string;
|
|
326
|
+
}
|
|
327
|
+
/** Front Core API client for one named connection. */
|
|
328
|
+
declare class FrontClient {
|
|
329
|
+
/** Validated Front API base URL. */ readonly endpoint: string;
|
|
330
|
+
private readonly maxResponseBytes;
|
|
331
|
+
private readonly credentials;
|
|
332
|
+
private readonly send;
|
|
333
|
+
private readonly now;
|
|
334
|
+
/** Construct a bounded client without contacting Front. */
|
|
335
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: FrontClientOptions);
|
|
336
|
+
/** Bind the search query. */ searchConversations(): SearchConversationsOperation;
|
|
337
|
+
/** Bind the conversation query. */ getConversation(): GetConversationOperation;
|
|
338
|
+
/** Bind the fenced reply mutation. */ replyToConversation(): ReplyToConversationOperation;
|
|
339
|
+
/** Bind the repeat-safe update mutation. */ updateConversation(): UpdateConversationOperation;
|
|
340
|
+
/** Bind the contact query. */ findContactByEmail(): FindContactByEmailOperation;
|
|
341
|
+
/** Resolve the current token before each logical operation. */
|
|
342
|
+
resolveToken(call: Call): Promise<{
|
|
343
|
+
token: string;
|
|
344
|
+
} | {
|
|
345
|
+
failure: Failure;
|
|
346
|
+
terminal: boolean;
|
|
347
|
+
}>;
|
|
348
|
+
/** Ask a refresh-capable credential source for a replacement after HTTP 401. */
|
|
349
|
+
replacementAfterRejection(call: Call, rejectedToken: string): Promise<'replacement' | 'reconnect' | 'temporarilyUnavailable'>;
|
|
350
|
+
/** Send and classify one provider request. */
|
|
351
|
+
exchange(call: Call, token: string, operation: string, request: FrontRequest): Promise<FrontExchange>;
|
|
352
|
+
private classifyFailureStatus;
|
|
353
|
+
/** Return only public correlation fields. */
|
|
354
|
+
receipt(call: Call, providerObjectId?: string): ReceiptDraft;
|
|
355
|
+
/** Construct a secret-safe failure. */
|
|
356
|
+
failure(kind: Failure['kind'], operation: string, message: string): Failure;
|
|
357
|
+
/** Return the page token from a validated next link. */
|
|
358
|
+
nextPageToken(next: unknown, pathPrefix: string): string;
|
|
359
|
+
private rateLimitDelay;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export { Config, Connection, ConnectorID, ConversationDetails, ConversationReply, Credentials, FindContactByEmailBranch, FindContactByEmailBranchDefect, FindContactByEmailBranchFound, FindContactByEmailBranchInvalidResponse, FindContactByEmailBranchNotFound, FindContactByEmailBranchProviderRejected, FindContactByEmailDefinition, FindContactByEmailInput, FindContactByEmailMetadata, FindContactByEmailOperation, FindContactByEmailOutput, type FindContactByEmailStepConfig, FrontClient, type FrontClientOptions, type FrontRequestSender, GetConversationBranch, GetConversationBranchDefect, GetConversationBranchFound, GetConversationBranchInvalidResponse, GetConversationBranchMerged, GetConversationBranchNotFound, GetConversationBranchProviderRejected, GetConversationDefinition, GetConversationInput, GetConversationMetadata, GetConversationOperation, type GetConversationStepConfig, ProviderID, ReplyToConversationBranch, ReplyToConversationBranchDefect, ReplyToConversationBranchNotFound, ReplyToConversationBranchProviderRejected, ReplyToConversationBranchReplied, ReplyToConversationBranchUncertain, ReplyToConversationDefinition, ReplyToConversationInput, ReplyToConversationMetadata, ReplyToConversationOperation, type ReplyToConversationStepConfig, SearchConversationsBranch, SearchConversationsBranchDefect, SearchConversationsBranchInvalidResponse, SearchConversationsBranchProviderRejected, SearchConversationsBranchSearched, SearchConversationsDefinition, SearchConversationsInput, SearchConversationsMetadata, SearchConversationsOperation, SearchConversationsOutput, type SearchConversationsStepConfig, UpdateConversationBranch, UpdateConversationBranchDefect, UpdateConversationBranchInvalidResponse, UpdateConversationBranchNotFound, UpdateConversationBranchProviderRejected, UpdateConversationBranchUpdated, UpdateConversationDefinition, UpdateConversationInput, UpdateConversationMetadata, UpdateConversationOperation, UpdateConversationOutput, type UpdateConversationStepConfig, buildConversationSearchQuery, buildReplyHTML, newFindContactByEmailStep, newGetConversationStep, newProjectConnection, newReplyToConversationStep, newSearchConversationsStep, newUpdateConversationStep };
|