@superdurable/connector-front 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +16 -2
- package/dex-connector.json +388 -0
- package/dist/chunk-V55LK3PU.js +413 -0
- package/dist/connection-Cn_WglIz.d.ts +629 -0
- package/dist/index.d.ts +370 -0
- package/dist/index.js +1026 -0
- package/dist/mock.d.ts +163 -0
- package/dist/mock.js +391 -0
- package/package.json +61 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
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-Cn_WglIz.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 CredentialMaterialError, t as CredentialSource, u as FindContactByEmailInputSchema, v as FindContactByEmailOutputSchema, w as GetConversationInputSchema, M as Message, x as MessageSchema, y as Recipient, z as RecipientSchema, A as ReplyToConversationInputSchema, B as SearchConversationsInputSchema, D as SearchConversationsOutputSchema, T as Tag, E as TagSchema, H as Teammate, I as TeammateSchema, J as UpdateConversationInputSchema, K as UpdateConversationOutputSchema, L as decodeCredentials, N as isCredentialMaterialError, P as newConnection, Q as newConnectionWithOperations } from './connection-Cn_WglIz.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 or is not visible to the API token (HTTP 404); nothing was sent. A merged conversation's 301 is an unknown outcome instead. */
|
|
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: the send cap is reached after answers that were lost, late, 409, a 3xx such as a merged conversation's 301, an unlisted status, an ambiguous server error, or a refusal with an unreadable body; Front accepted it with a 2xx that carries no usable provider ID; a refusal or a reconnection requirement follows a possible earlier send; or an accepted write could not be read back, such as after a terminal credential failure or a deleted comment. Without a provider ID, an unknown outcome is resent while the cap allows; a 2xx is never resent. */
|
|
81
|
+
declare const ReplyToConversationBranchUncertain: "uncertain";
|
|
82
|
+
/** Local input, connection credentials that require reauthorization or are unusable before a first send, 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
|
+
/** Declared for compatibility and no longer selected: an earlier attempt's change may have applied, so a malformed or oversized conversation on any read is retried. */
|
|
107
|
+
declare const UpdateConversationBranchInvalidResponse: "invalidResponse";
|
|
108
|
+
/** Local input, connection configuration, or connector definition is invalid, or the connection needs reconnection on the first attempt; a transient credential failure, or one after an earlier attempt, Retries. */
|
|
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 or is not visible to the API token (HTTP 404); nothing was sent. A merged conversation's 301 is an unknown outcome instead. */
|
|
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: the send cap is reached after answers that were lost, late, 409, a 3xx such as a merged conversation's 301, an unlisted status, an ambiguous server error, or a refusal with an unreadable body; Front accepted it with a 2xx that carries no usable provider ID; a refusal or a reconnection requirement follows a possible earlier send; or an accepted write could not be read back, such as after a terminal credential failure or a deleted comment. Without a provider ID, an unknown outcome is resent while the cap allows; a 2xx is never resent. */
|
|
202
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
203
|
+
/** Local input, connection credentials that require reauthorization or are unusable before a first send, 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
|
+
/** Declared for compatibility and no longer selected: an earlier attempt's change may have applied, so a malformed or oversized conversation on any read is retried. */
|
|
223
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
224
|
+
/** Local input, connection configuration, or connector definition is invalid, or the connection needs reconnection on the first attempt; a transient credential failure, or one after an earlier attempt, Retries. */
|
|
225
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
226
|
+
/** Accepted for compatibility; ignored because the operation is safe to repeat. */
|
|
227
|
+
maxSends?: number;
|
|
228
|
+
}
|
|
229
|
+
/** Build the updateConversation Step from a named connection. */
|
|
230
|
+
declare function newUpdateConversationStep<StepInput, OperationInput = UpdateConversationInput, OperationOutput = UpdateConversationOutput>(configuration: UpdateConversationStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
231
|
+
/** Configuration for the findContactByEmail connector Step. */
|
|
232
|
+
interface FindContactByEmailStepConfig<StepInput, OperationInput = FindContactByEmailInput, OperationOutput = FindContactByEmailOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
233
|
+
/** Named connection supplying this operation. */
|
|
234
|
+
connection: Connection<{
|
|
235
|
+
findContactByEmail(): Query<OperationInput, OperationOutput>;
|
|
236
|
+
}>;
|
|
237
|
+
/** Name matching the bound connection. */
|
|
238
|
+
connectionName: string;
|
|
239
|
+
/** A Front contact has the email handle. */
|
|
240
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
241
|
+
/** No Front contact has the email handle. */
|
|
242
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
243
|
+
/** Front conclusively rejected the lookup, such as an invalid token or a token without contact read access. */
|
|
244
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
245
|
+
/** Front returned a malformed or oversized contact. */
|
|
246
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
247
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
248
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
249
|
+
}
|
|
250
|
+
/** Build the findContactByEmail Step from a named connection. */
|
|
251
|
+
declare function newFindContactByEmailStep<StepInput, OperationInput = FindContactByEmailInput, OperationOutput = FindContactByEmailOutput>(configuration: FindContactByEmailStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
252
|
+
|
|
253
|
+
/** Open one static Front connection declared in a Dex project. */
|
|
254
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
255
|
+
|
|
256
|
+
/** Search one bounded page of Front conversations. */
|
|
257
|
+
declare class SearchConversationsOperation implements Query<SearchConversationsInput, SearchConversationsOutput> {
|
|
258
|
+
private readonly client;
|
|
259
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
260
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
261
|
+
/** Validate filters, search, and classify one page. */
|
|
262
|
+
invoke(call: Call, input: SearchConversationsInput): Promise<QueryAttempt<SearchConversationsOutput>>;
|
|
263
|
+
}
|
|
264
|
+
/** Read one conversation and its newest message and comment pages. */
|
|
265
|
+
declare class GetConversationOperation implements Query<GetConversationInput, ConversationDetails> {
|
|
266
|
+
private readonly client;
|
|
267
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
268
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
269
|
+
/** Read and classify the three provider resources. */
|
|
270
|
+
invoke(call: Call, input: GetConversationInput): Promise<QueryAttempt<ConversationDetails>>;
|
|
271
|
+
}
|
|
272
|
+
/** Find a Front contact by one bare email address. */
|
|
273
|
+
declare class FindContactByEmailOperation implements Query<FindContactByEmailInput, FindContactByEmailOutput> {
|
|
274
|
+
private readonly client;
|
|
275
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
276
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
277
|
+
/** Read the contact alias and verify its email handle. */
|
|
278
|
+
invoke(call: Call, input: FindContactByEmailInput): Promise<QueryAttempt<FindContactByEmailOutput>>;
|
|
279
|
+
}
|
|
280
|
+
/** Repeat-safe status, assignment, and tag update. */
|
|
281
|
+
declare class UpdateConversationOperation implements Mutation<UpdateConversationInput, UpdateConversationOutput> {
|
|
282
|
+
private readonly client;
|
|
283
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
284
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
285
|
+
/** Stable call identity; writes set absolute values. */ idempotencyKey(callId: string): string;
|
|
286
|
+
/** Read, plan writes, and confirm the result. */
|
|
287
|
+
invoke(call: Call, input: UpdateConversationInput): Promise<MutationAttempt<UpdateConversationOutput>>;
|
|
288
|
+
}
|
|
289
|
+
/** Fenced mutation for one reply or internal comment. */
|
|
290
|
+
declare class ReplyToConversationOperation implements Mutation<ReplyToConversationInput, ConversationReply> {
|
|
291
|
+
private readonly client;
|
|
292
|
+
/** Bind one client. */ constructor(client: FrontClient);
|
|
293
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
294
|
+
/** Stable call identity, recorded in the receipt. */ idempotencyKey(callId: string): string;
|
|
295
|
+
/** Send once with a durable claim, or read back an accepted provider ID. */
|
|
296
|
+
invoke(call: Call, input: ReplyToConversationInput): Promise<MutationAttempt<ConversationReply>>;
|
|
297
|
+
private readBack;
|
|
298
|
+
/** Only a definite refusal selects a refusal branch; any other outcome resends while the send cap allows. */
|
|
299
|
+
private classifySend;
|
|
300
|
+
/** Retry an unknown outcome while the send cap allows another send, else select uncertain. */
|
|
301
|
+
private resendOrUncertain;
|
|
302
|
+
/** Select a refusal branch only when no earlier send of this call may have applied. */
|
|
303
|
+
private reject;
|
|
304
|
+
private uncertain;
|
|
305
|
+
}
|
|
306
|
+
/** Build the ordered search filters Front expects. */
|
|
307
|
+
declare function buildConversationSearchQuery(input: SearchConversationsInput): string;
|
|
308
|
+
/** Turn plain text into escaped Front reply paragraphs. */
|
|
309
|
+
declare function buildReplyHTML(value: string): string;
|
|
310
|
+
|
|
311
|
+
/** One Front request, with an already escaped path. */
|
|
312
|
+
interface FrontRequest {
|
|
313
|
+
/** HTTP method sent to the provider. */ method: string;
|
|
314
|
+
/** Escaped path below the configured Front API host. */ path: string;
|
|
315
|
+
/** Optional query parameters. */ query?: URLSearchParams;
|
|
316
|
+
/** Optional JSON request body. */ payload?: unknown;
|
|
317
|
+
/** Cancellation for a fenced write. */ signal?: AbortSignal;
|
|
318
|
+
}
|
|
319
|
+
/** Classified Front response. */
|
|
320
|
+
interface FrontExchange {
|
|
321
|
+
/** Provider outcome before operation-specific branch mapping. */ outcome: 'succeeded' | 'merged' | 'notFound' | 'notSent' | 'rateLimited' | 'unconfirmed' | 'rejected' | 'invalid' | 'defect';
|
|
322
|
+
/** Bounded HTTP response, when one arrived. */ response?: ProviderResponse;
|
|
323
|
+
/** Secret-safe failure for unsuccessful exchanges. */ failure?: Failure;
|
|
324
|
+
/** Provider-directed delay for a safe retry, in milliseconds. */ retryAfterMs: number;
|
|
325
|
+
/** A non-2xx body was oversized, failed to read, or reflected the token, so a write cannot rule out acceptance. */ isErrorBodyUnreadable?: boolean;
|
|
326
|
+
}
|
|
327
|
+
/** Transport replacement for deterministic provider tests. */
|
|
328
|
+
type FrontRequestSender = (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
329
|
+
/** Client dependencies for tests. */
|
|
330
|
+
interface FrontClientOptions {
|
|
331
|
+
/** Sender; production uses the SDK's bounded, no-redirect transport. */ send?: FrontRequestSender;
|
|
332
|
+
/** Clock used for receipts and rate-limit calculations. */ now?: () => Date;
|
|
333
|
+
/** Front-compatible URL for local provider tests; production leaves it unset. */ apiBaseURL?: string;
|
|
334
|
+
}
|
|
335
|
+
/** Front Core API client for one named connection. */
|
|
336
|
+
declare class FrontClient {
|
|
337
|
+
/** Validated Front API base URL. */ readonly endpoint: string;
|
|
338
|
+
private readonly maxResponseBytes;
|
|
339
|
+
private readonly credentials;
|
|
340
|
+
private readonly send;
|
|
341
|
+
private readonly now;
|
|
342
|
+
/** Construct a bounded client without contacting Front. */
|
|
343
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: FrontClientOptions);
|
|
344
|
+
/** Bind the search query. */ searchConversations(): SearchConversationsOperation;
|
|
345
|
+
/** Bind the conversation query. */ getConversation(): GetConversationOperation;
|
|
346
|
+
/** Bind the fenced reply mutation. */ replyToConversation(): ReplyToConversationOperation;
|
|
347
|
+
/** Bind the repeat-safe update mutation. */ updateConversation(): UpdateConversationOperation;
|
|
348
|
+
/** Bind the contact query. */ findContactByEmail(): FindContactByEmailOperation;
|
|
349
|
+
/** Resolve the current token before each logical operation. */
|
|
350
|
+
resolveToken(call: Call): Promise<{
|
|
351
|
+
token: string;
|
|
352
|
+
} | {
|
|
353
|
+
failure: Failure;
|
|
354
|
+
terminal: boolean;
|
|
355
|
+
}>;
|
|
356
|
+
/** Ask a refresh-capable credential source for a replacement after HTTP 401. */
|
|
357
|
+
replacementAfterRejection(call: Call, rejectedToken: string): Promise<'replacement' | 'reconnect' | 'temporarilyUnavailable'>;
|
|
358
|
+
/** Send and classify one provider request. */
|
|
359
|
+
exchange(call: Call, token: string, operation: string, request: FrontRequest): Promise<FrontExchange>;
|
|
360
|
+
private classifyFailureStatus;
|
|
361
|
+
/** Return only public correlation fields. */
|
|
362
|
+
receipt(call: Call, providerObjectId?: string): ReceiptDraft;
|
|
363
|
+
/** Construct a secret-safe failure. */
|
|
364
|
+
failure(kind: Failure['kind'], operation: string, message: string): Failure;
|
|
365
|
+
/** Return the page token from a validated next link. */
|
|
366
|
+
nextPageToken(next: unknown, pathPrefix: string): string;
|
|
367
|
+
private rateLimitDelay;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
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 };
|