@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/dist/mock.d.ts ADDED
@@ -0,0 +1,163 @@
1
+ import { MockQuery, MockMutation, Case } from '@superdurable/connectors-sdk/connectormock';
2
+ import { Failure } from '@superdurable/connectors-sdk';
3
+ import { O as Operations, C as Connection, S as SearchConversationsInput, d as SearchConversationsOutput, G as GetConversationInput, b as ConversationDetails, R as ReplyToConversationInput, c as ConversationReply, U as UpdateConversationInput, e as UpdateConversationOutput, F as FindContactByEmailInput, a as FindContactByEmailOutput, h as Comment, k as Contact, l as ContactHandle, o as Conversation, M as Message, y as Recipient, T as Tag, H as Teammate } from './connection-Cn_WglIz.js';
4
+ import 'zod';
5
+
6
+ /** Go zero value for SearchConversationsInput in scripted cases. */
7
+ declare const emptySearchConversationsInput: SearchConversationsInput;
8
+ /** Go zero value for Teammate in scripted cases. */
9
+ declare const emptyTeammate: Teammate;
10
+ /** Go zero value for Recipient in scripted cases. */
11
+ declare const emptyRecipient: Recipient;
12
+ /** Go zero value for Tag in scripted cases. */
13
+ declare const emptyTag: Tag;
14
+ /** Go zero value for Conversation in scripted cases. */
15
+ declare const emptyConversation: Conversation;
16
+ /** Go zero value for SearchConversationsOutput in scripted cases. */
17
+ declare const emptySearchConversationsOutput: SearchConversationsOutput;
18
+ /** Go zero value for GetConversationInput in scripted cases. */
19
+ declare const emptyGetConversationInput: GetConversationInput;
20
+ /** Go zero value for Message in scripted cases. */
21
+ declare const emptyMessage: Message;
22
+ /** Go zero value for Comment in scripted cases. */
23
+ declare const emptyComment: Comment;
24
+ /** Go zero value for ConversationDetails in scripted cases. */
25
+ declare const emptyConversationDetails: ConversationDetails;
26
+ /** Go zero value for ReplyToConversationInput in scripted cases. */
27
+ declare const emptyReplyToConversationInput: ReplyToConversationInput;
28
+ /** Go zero value for ConversationReply in scripted cases. */
29
+ declare const emptyConversationReply: ConversationReply;
30
+ /** Go zero value for UpdateConversationInput in scripted cases. */
31
+ declare const emptyUpdateConversationInput: UpdateConversationInput;
32
+ /** Go zero value for UpdateConversationOutput in scripted cases. */
33
+ declare const emptyUpdateConversationOutput: UpdateConversationOutput;
34
+ /** Go zero value for FindContactByEmailInput in scripted cases. */
35
+ declare const emptyFindContactByEmailInput: FindContactByEmailInput;
36
+ /** Go zero value for ContactHandle in scripted cases. */
37
+ declare const emptyContactHandle: ContactHandle;
38
+ /** Go zero value for Contact in scripted cases. */
39
+ declare const emptyContact: Contact;
40
+ /** Go zero value for FindContactByEmailOutput in scripted cases. */
41
+ declare const emptyFindContactByEmailOutput: FindContactByEmailOutput;
42
+ /** Script the searched branch. */
43
+ declare function searchConversationsSearched(value: SearchConversationsOutput, failure?: Failure): Case<SearchConversationsOutput>;
44
+ /** Script the providerRejected branch. */
45
+ declare function searchConversationsProviderRejected(value: SearchConversationsOutput, failure?: Failure): Case<SearchConversationsOutput>;
46
+ /** Script the invalidResponse branch. */
47
+ declare function searchConversationsInvalidResponse(value: SearchConversationsOutput, failure?: Failure): Case<SearchConversationsOutput>;
48
+ /** Script the defect branch. */
49
+ declare function searchConversationsDefect(value: SearchConversationsOutput, failure?: Failure): Case<SearchConversationsOutput>;
50
+ /** Script a safe retry of searchConversations. */
51
+ declare function searchConversationsRetry(failure: Failure, retryAfterMs?: number): Case<SearchConversationsOutput>;
52
+ /** Manifest scenario matchingConversations for searchConversations. */
53
+ declare function searchConversationsMatchingConversations(): Case<SearchConversationsOutput>;
54
+ /** Default searchConversations scenario. */
55
+ declare function searchConversationsDefault(): Case<SearchConversationsOutput>;
56
+ /** Manifest scenario invalidToken for searchConversations. */
57
+ declare function searchConversationsInvalidToken(): Case<SearchConversationsOutput>;
58
+ /** Manifest scenario oversizedPage for searchConversations. */
59
+ declare function searchConversationsOversizedPage(): Case<SearchConversationsOutput>;
60
+ /** Script the found branch. */
61
+ declare function getConversationFound(value: ConversationDetails, failure?: Failure): Case<ConversationDetails>;
62
+ /** Script the merged branch. */
63
+ declare function getConversationMerged(value: ConversationDetails, failure?: Failure): Case<ConversationDetails>;
64
+ /** Script the notFound branch. */
65
+ declare function getConversationNotFound(value: ConversationDetails, failure?: Failure): Case<ConversationDetails>;
66
+ /** Script the providerRejected branch. */
67
+ declare function getConversationProviderRejected(value: ConversationDetails, failure?: Failure): Case<ConversationDetails>;
68
+ /** Script the invalidResponse branch. */
69
+ declare function getConversationInvalidResponse(value: ConversationDetails, failure?: Failure): Case<ConversationDetails>;
70
+ /** Script the defect branch. */
71
+ declare function getConversationDefect(value: ConversationDetails, failure?: Failure): Case<ConversationDetails>;
72
+ /** Script a safe retry of getConversation. */
73
+ declare function getConversationRetry(failure: Failure, retryAfterMs?: number): Case<ConversationDetails>;
74
+ /** Manifest scenario triageConversation for getConversation. */
75
+ declare function getConversationTriageConversation(): Case<ConversationDetails>;
76
+ /** Default getConversation scenario. */
77
+ declare function getConversationDefault(): Case<ConversationDetails>;
78
+ /** Manifest scenario mergedConversation for getConversation. */
79
+ declare function getConversationMergedConversation(): Case<ConversationDetails>;
80
+ /** Manifest scenario missingConversation for getConversation. */
81
+ declare function getConversationMissingConversation(): Case<ConversationDetails>;
82
+ /** Manifest scenario deniedConversationRead for getConversation. */
83
+ declare function getConversationDeniedConversationRead(): Case<ConversationDetails>;
84
+ /** Manifest scenario oversizedConversation for getConversation. */
85
+ declare function getConversationOversizedConversation(): Case<ConversationDetails>;
86
+ /** Script the replied branch. */
87
+ declare function replyToConversationReplied(value: ConversationReply, failure?: Failure): Case<ConversationReply>;
88
+ /** Script the notFound branch. */
89
+ declare function replyToConversationNotFound(value: ConversationReply, failure?: Failure): Case<ConversationReply>;
90
+ /** Script the providerRejected branch. */
91
+ declare function replyToConversationProviderRejected(value: ConversationReply, failure?: Failure): Case<ConversationReply>;
92
+ /** Script the defect branch. */
93
+ declare function replyToConversationDefect(value: ConversationReply, failure?: Failure): Case<ConversationReply>;
94
+ /** Script a safe retry of replyToConversation. */
95
+ declare function replyToConversationRetry(failure: Failure, retryAfterMs?: number): Case<ConversationReply>;
96
+ /** Script an uncertain replyToConversation attempt. */
97
+ declare function replyToConversationUncertain(value: ConversationReply, failure: Failure): Case<ConversationReply>;
98
+ /** Manifest scenario triageComment for replyToConversation. */
99
+ declare function replyToConversationTriageComment(): Case<ConversationReply>;
100
+ /** Default replyToConversation scenario. */
101
+ declare function replyToConversationDefault(): Case<ConversationReply>;
102
+ /** Manifest scenario missingConversation for replyToConversation. */
103
+ declare function replyToConversationMissingConversation(): Case<ConversationReply>;
104
+ /** Manifest scenario deniedCommentWrite for replyToConversation. */
105
+ declare function replyToConversationDeniedCommentWrite(): Case<ConversationReply>;
106
+ /** Script the updated branch. */
107
+ declare function updateConversationUpdated(value: UpdateConversationOutput, failure?: Failure): Case<UpdateConversationOutput>;
108
+ /** Script the notFound branch. */
109
+ declare function updateConversationNotFound(value: UpdateConversationOutput, failure?: Failure): Case<UpdateConversationOutput>;
110
+ /** Script the providerRejected branch. */
111
+ declare function updateConversationProviderRejected(value: UpdateConversationOutput, failure?: Failure): Case<UpdateConversationOutput>;
112
+ /** Script the invalidResponse branch. */
113
+ declare function updateConversationInvalidResponse(value: UpdateConversationOutput, failure?: Failure): Case<UpdateConversationOutput>;
114
+ /** Script the defect branch. */
115
+ declare function updateConversationDefect(value: UpdateConversationOutput, failure?: Failure): Case<UpdateConversationOutput>;
116
+ /** Script a safe retry of updateConversation. */
117
+ declare function updateConversationRetry(failure: Failure, retryAfterMs?: number): Case<UpdateConversationOutput>;
118
+ /** Manifest scenario routedConversation for updateConversation. */
119
+ declare function updateConversationRoutedConversation(): Case<UpdateConversationOutput>;
120
+ /** Default updateConversation scenario. */
121
+ declare function updateConversationDefault(): Case<UpdateConversationOutput>;
122
+ /** Manifest scenario missingConversation for updateConversation. */
123
+ declare function updateConversationMissingConversation(): Case<UpdateConversationOutput>;
124
+ /** Manifest scenario invalidTag for updateConversation. */
125
+ declare function updateConversationInvalidTag(): Case<UpdateConversationOutput>;
126
+ /** Manifest scenario oversizedReadBack for updateConversation. */
127
+ declare function updateConversationOversizedReadBack(): Case<UpdateConversationOutput>;
128
+ /** Script the found branch. */
129
+ declare function findContactByEmailFound(value: FindContactByEmailOutput, failure?: Failure): Case<FindContactByEmailOutput>;
130
+ /** Script the notFound branch. */
131
+ declare function findContactByEmailNotFound(value: FindContactByEmailOutput, failure?: Failure): Case<FindContactByEmailOutput>;
132
+ /** Script the providerRejected branch. */
133
+ declare function findContactByEmailProviderRejected(value: FindContactByEmailOutput, failure?: Failure): Case<FindContactByEmailOutput>;
134
+ /** Script the invalidResponse branch. */
135
+ declare function findContactByEmailInvalidResponse(value: FindContactByEmailOutput, failure?: Failure): Case<FindContactByEmailOutput>;
136
+ /** Script the defect branch. */
137
+ declare function findContactByEmailDefect(value: FindContactByEmailOutput, failure?: Failure): Case<FindContactByEmailOutput>;
138
+ /** Script a safe retry of findContactByEmail. */
139
+ declare function findContactByEmailRetry(failure: Failure, retryAfterMs?: number): Case<FindContactByEmailOutput>;
140
+ /** Manifest scenario requesterContact for findContactByEmail. */
141
+ declare function findContactByEmailRequesterContact(): Case<FindContactByEmailOutput>;
142
+ /** Default findContactByEmail scenario. */
143
+ declare function findContactByEmailDefault(): Case<FindContactByEmailOutput>;
144
+ /** Manifest scenario missingContact for findContactByEmail. */
145
+ declare function findContactByEmailMissingContact(): Case<FindContactByEmailOutput>;
146
+ /** Manifest scenario deniedContactRead for findContactByEmail. */
147
+ declare function findContactByEmailDeniedContactRead(): Case<FindContactByEmailOutput>;
148
+ /** Manifest scenario oversizedContact for findContactByEmail. */
149
+ declare function findContactByEmailOversizedContact(): Case<FindContactByEmailOutput>;
150
+ /** Scripted operations and manifest defaults for this connector. */
151
+ declare class GeneratedMock implements Operations {
152
+ #private;
153
+ constructor(connectionName: string);
154
+ connection(): Connection;
155
+ searchConversations(): MockQuery<SearchConversationsInput, SearchConversationsOutput>;
156
+ getConversation(): MockQuery<GetConversationInput, ConversationDetails>;
157
+ replyToConversation(): MockMutation<ReplyToConversationInput, ConversationReply>;
158
+ updateConversation(): MockMutation<UpdateConversationInput, UpdateConversationOutput>;
159
+ findContactByEmail(): MockQuery<FindContactByEmailInput, FindContactByEmailOutput>;
160
+ assertNoFailures(): void;
161
+ }
162
+
163
+ export { GeneratedMock, emptyComment, emptyContact, emptyContactHandle, emptyConversation, emptyConversationDetails, emptyConversationReply, emptyFindContactByEmailInput, emptyFindContactByEmailOutput, emptyGetConversationInput, emptyMessage, emptyRecipient, emptyReplyToConversationInput, emptySearchConversationsInput, emptySearchConversationsOutput, emptyTag, emptyTeammate, emptyUpdateConversationInput, emptyUpdateConversationOutput, findContactByEmailDefault, findContactByEmailDefect, findContactByEmailDeniedContactRead, findContactByEmailFound, findContactByEmailInvalidResponse, findContactByEmailMissingContact, findContactByEmailNotFound, findContactByEmailOversizedContact, findContactByEmailProviderRejected, findContactByEmailRequesterContact, findContactByEmailRetry, getConversationDefault, getConversationDefect, getConversationDeniedConversationRead, getConversationFound, getConversationInvalidResponse, getConversationMerged, getConversationMergedConversation, getConversationMissingConversation, getConversationNotFound, getConversationOversizedConversation, getConversationProviderRejected, getConversationRetry, getConversationTriageConversation, replyToConversationDefault, replyToConversationDefect, replyToConversationDeniedCommentWrite, replyToConversationMissingConversation, replyToConversationNotFound, replyToConversationProviderRejected, replyToConversationReplied, replyToConversationRetry, replyToConversationTriageComment, replyToConversationUncertain, searchConversationsDefault, searchConversationsDefect, searchConversationsInvalidResponse, searchConversationsInvalidToken, searchConversationsMatchingConversations, searchConversationsOversizedPage, searchConversationsProviderRejected, searchConversationsRetry, searchConversationsSearched, updateConversationDefault, updateConversationDefect, updateConversationInvalidResponse, updateConversationInvalidTag, updateConversationMissingConversation, updateConversationNotFound, updateConversationOversizedReadBack, updateConversationProviderRejected, updateConversationRetry, updateConversationRoutedConversation, updateConversationUpdated };
package/dist/mock.js ADDED
@@ -0,0 +1,391 @@
1
+ import {
2
+ CommentSchema,
3
+ ConnectorID,
4
+ ContactHandleSchema,
5
+ ContactSchema,
6
+ ConversationDetailsSchema,
7
+ ConversationReplySchema,
8
+ ConversationSchema,
9
+ FindContactByEmailDefinition,
10
+ FindContactByEmailInputSchema,
11
+ FindContactByEmailOutputSchema,
12
+ GetConversationDefinition,
13
+ GetConversationInputSchema,
14
+ MessageSchema,
15
+ ProviderID,
16
+ RecipientSchema,
17
+ ReplyToConversationDefinition,
18
+ ReplyToConversationInputSchema,
19
+ SearchConversationsDefinition,
20
+ SearchConversationsInputSchema,
21
+ SearchConversationsOutputSchema,
22
+ TagSchema,
23
+ TeammateSchema,
24
+ UpdateConversationDefinition,
25
+ UpdateConversationInputSchema,
26
+ UpdateConversationOutputSchema,
27
+ newConnectionWithOperations
28
+ } from "./chunk-V55LK3PU.js";
29
+
30
+ // src/generated/mock.ts
31
+ import { branchCase, retryCase, uncertainCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
32
+ var emptySearchConversationsInput = SearchConversationsInputSchema.parse({});
33
+ var emptyTeammate = TeammateSchema.parse({
34
+ "id": ""
35
+ });
36
+ var emptyRecipient = RecipientSchema.parse({
37
+ "handle": ""
38
+ });
39
+ var emptyTag = TagSchema.parse({
40
+ "id": ""
41
+ });
42
+ var emptyConversation = ConversationSchema.parse({
43
+ "id": "",
44
+ "status": "",
45
+ "createdAt": "0001-01-01T00:00:00Z"
46
+ });
47
+ var emptySearchConversationsOutput = SearchConversationsOutputSchema.parse({
48
+ "conversations": [],
49
+ "totalCount": 0,
50
+ "query": ""
51
+ });
52
+ var emptyGetConversationInput = GetConversationInputSchema.parse({
53
+ "conversationId": ""
54
+ });
55
+ var emptyMessage = MessageSchema.parse({
56
+ "id": "",
57
+ "isInbound": false,
58
+ "createdAt": "0001-01-01T00:00:00Z"
59
+ });
60
+ var emptyComment = CommentSchema.parse({
61
+ "id": "",
62
+ "postedAt": "0001-01-01T00:00:00Z"
63
+ });
64
+ var emptyConversationDetails = ConversationDetailsSchema.parse({
65
+ "conversation": emptyConversation,
66
+ "messages": [],
67
+ "comments": []
68
+ });
69
+ var emptyReplyToConversationInput = ReplyToConversationInputSchema.parse({
70
+ "conversationId": "",
71
+ "text": ""
72
+ });
73
+ var emptyConversationReply = ConversationReplySchema.parse({
74
+ "conversationId": ""
75
+ });
76
+ var emptyUpdateConversationInput = UpdateConversationInputSchema.parse({
77
+ "conversationId": ""
78
+ });
79
+ var emptyUpdateConversationOutput = UpdateConversationOutputSchema.parse({
80
+ "conversation": emptyConversation
81
+ });
82
+ var emptyFindContactByEmailInput = FindContactByEmailInputSchema.parse({
83
+ "email": ""
84
+ });
85
+ var emptyContactHandle = ContactHandleSchema.parse({
86
+ "handle": "",
87
+ "source": ""
88
+ });
89
+ var emptyContact = ContactSchema.parse({
90
+ "id": ""
91
+ });
92
+ var emptyFindContactByEmailOutput = FindContactByEmailOutputSchema.parse({
93
+ "contacts": []
94
+ });
95
+ function searchConversationsSearched(value, failure) {
96
+ return branchCase("searched", value, failure);
97
+ }
98
+ function searchConversationsProviderRejected(value, failure) {
99
+ return branchCase("providerRejected", value, failure);
100
+ }
101
+ function searchConversationsInvalidResponse(value, failure) {
102
+ return branchCase("invalidResponse", value, failure);
103
+ }
104
+ function searchConversationsDefect(value, failure) {
105
+ return branchCase("defect", value, failure);
106
+ }
107
+ function searchConversationsRetry(failure, retryAfterMs = 0) {
108
+ return retryCase(failure, retryAfterMs);
109
+ }
110
+ function searchConversationsMatchingConversations() {
111
+ const value = SearchConversationsOutputSchema.parse({ "conversations": [{ "createdAt": "2026-01-02T03:04:05Z", "id": "cnv_100", "status": "unassigned", "subject": "Order 88213", "type": "conversation" }, { "createdAt": "2026-01-01T03:04:05Z", "id": "cnv_200", "status": "unassigned", "subject": "Earlier order question", "type": "conversation" }], "query": "inbox:inb_support is:open recipient:jane@acme.example.com", "totalCount": 2 });
112
+ return branchCase("searched", value);
113
+ }
114
+ function searchConversationsDefault() {
115
+ return searchConversationsMatchingConversations();
116
+ }
117
+ function searchConversationsInvalidToken() {
118
+ const value = emptySearchConversationsOutput;
119
+ return branchCase("providerRejected", value, { kind: "AUTHENTICATION", provider: ConnectorID, operation: "searchConversations", message: "Front rejected the API token (HTTP 401)." });
120
+ }
121
+ function searchConversationsOversizedPage() {
122
+ const value = emptySearchConversationsOutput;
123
+ return branchCase("invalidResponse", value, { kind: "RESPONSE_TOO_LARGE", provider: ConnectorID, operation: "searchConversations", message: "The Front response exceeds maxResponseBytes." });
124
+ }
125
+ function getConversationFound(value, failure) {
126
+ return branchCase("found", value, failure);
127
+ }
128
+ function getConversationMerged(value, failure) {
129
+ return branchCase("merged", value, failure);
130
+ }
131
+ function getConversationNotFound(value, failure) {
132
+ return branchCase("notFound", value, failure);
133
+ }
134
+ function getConversationProviderRejected(value, failure) {
135
+ return branchCase("providerRejected", value, failure);
136
+ }
137
+ function getConversationInvalidResponse(value, failure) {
138
+ return branchCase("invalidResponse", value, failure);
139
+ }
140
+ function getConversationDefect(value, failure) {
141
+ return branchCase("defect", value, failure);
142
+ }
143
+ function getConversationRetry(failure, retryAfterMs = 0) {
144
+ return retryCase(failure, retryAfterMs);
145
+ }
146
+ function getConversationTriageConversation() {
147
+ const value = ConversationDetailsSchema.parse({ "comments": [], "conversation": { "createdAt": "2026-01-02T03:04:05Z", "id": "cnv_100", "status": "unassigned", "subject": "Order 88213", "type": "conversation" }, "messages": [{ "body": "Any update on my refund?", "createdAt": "2026-01-02T03:04:05Z", "id": "msg_100", "isInbound": true, "recipients": [{ "handle": "jane@acme.example.com", "role": "from" }], "type": "email" }] });
148
+ return branchCase("found", value);
149
+ }
150
+ function getConversationDefault() {
151
+ return getConversationTriageConversation();
152
+ }
153
+ function getConversationMergedConversation() {
154
+ const value = ConversationDetailsSchema.parse({ "comments": null, "conversation": { "createdAt": "0001-01-01T00:00:00Z", "id": "", "status": "" }, "mergedIntoConversationId": "cnv_200", "messages": null });
155
+ return branchCase("merged", value, { kind: "NOT_FOUND", provider: ConnectorID, operation: "getConversation", message: "The conversation was merged into cnv_200." });
156
+ }
157
+ function getConversationMissingConversation() {
158
+ const value = emptyConversationDetails;
159
+ return branchCase("notFound", value, { kind: "NOT_FOUND", provider: ConnectorID, operation: "getConversation", message: "Front found no such conversation (HTTP 404)." });
160
+ }
161
+ function getConversationDeniedConversationRead() {
162
+ const value = emptyConversationDetails;
163
+ return branchCase("providerRejected", value, { kind: "AUTHORIZATION", provider: ConnectorID, operation: "getConversation", message: "Front denied message read access (HTTP 403)." });
164
+ }
165
+ function getConversationOversizedConversation() {
166
+ const value = emptyConversationDetails;
167
+ return branchCase("invalidResponse", value, { kind: "RESPONSE_TOO_LARGE", provider: ConnectorID, operation: "getConversation", message: "The Front response exceeds maxResponseBytes." });
168
+ }
169
+ function replyToConversationReplied(value, failure) {
170
+ return branchCase("replied", value, failure);
171
+ }
172
+ function replyToConversationNotFound(value, failure) {
173
+ return branchCase("notFound", value, failure);
174
+ }
175
+ function replyToConversationProviderRejected(value, failure) {
176
+ return branchCase("providerRejected", value, failure);
177
+ }
178
+ function replyToConversationDefect(value, failure) {
179
+ return branchCase("defect", value, failure);
180
+ }
181
+ function replyToConversationRetry(failure, retryAfterMs = 0) {
182
+ return retryCase(failure, retryAfterMs);
183
+ }
184
+ function replyToConversationUncertain(value, failure) {
185
+ return uncertainCase(value, failure);
186
+ }
187
+ function replyToConversationTriageComment() {
188
+ const value = ConversationReplySchema.parse({ "commentId": "com_100", "conversationId": "cnv_100", "isInternalNote": true });
189
+ return branchCase("replied", value);
190
+ }
191
+ function replyToConversationDefault() {
192
+ return replyToConversationTriageComment();
193
+ }
194
+ function replyToConversationMissingConversation() {
195
+ const value = emptyConversationReply;
196
+ return branchCase("notFound", value, { kind: "NOT_FOUND", provider: ConnectorID, operation: "replyToConversation", message: "Front found no such conversation (HTTP 404)." });
197
+ }
198
+ function replyToConversationDeniedCommentWrite() {
199
+ const value = emptyConversationReply;
200
+ return branchCase("providerRejected", value, { kind: "AUTHORIZATION", provider: ConnectorID, operation: "replyToConversation", message: "Front denied comment write access (HTTP 403)." });
201
+ }
202
+ function updateConversationUpdated(value, failure) {
203
+ return branchCase("updated", value, failure);
204
+ }
205
+ function updateConversationNotFound(value, failure) {
206
+ return branchCase("notFound", value, failure);
207
+ }
208
+ function updateConversationProviderRejected(value, failure) {
209
+ return branchCase("providerRejected", value, failure);
210
+ }
211
+ function updateConversationInvalidResponse(value, failure) {
212
+ return branchCase("invalidResponse", value, failure);
213
+ }
214
+ function updateConversationDefect(value, failure) {
215
+ return branchCase("defect", value, failure);
216
+ }
217
+ function updateConversationRetry(failure, retryAfterMs = 0) {
218
+ return retryCase(failure, retryAfterMs);
219
+ }
220
+ function updateConversationRoutedConversation() {
221
+ const value = UpdateConversationOutputSchema.parse({ "conversation": { "assignee": { "id": "tea_leela" }, "createdAt": "2026-01-02T03:04:05Z", "id": "cnv_100", "status": "assigned", "subject": "Order 88213", "tags": [{ "id": "tag_triaged", "name": "triaged" }], "type": "conversation" } });
222
+ return branchCase("updated", value);
223
+ }
224
+ function updateConversationDefault() {
225
+ return updateConversationRoutedConversation();
226
+ }
227
+ function updateConversationMissingConversation() {
228
+ const value = emptyUpdateConversationOutput;
229
+ return branchCase("notFound", value, { kind: "NOT_FOUND", provider: ConnectorID, operation: "updateConversation", message: "Front found no such conversation (HTTP 404)." });
230
+ }
231
+ function updateConversationInvalidTag() {
232
+ const value = emptyUpdateConversationOutput;
233
+ return branchCase("providerRejected", value, { kind: "VALIDATION", provider: ConnectorID, operation: "updateConversation", message: "Front rejected the tag ID (HTTP 400)." });
234
+ }
235
+ function updateConversationOversizedReadBack() {
236
+ const value = emptyUpdateConversationOutput;
237
+ return branchCase("invalidResponse", value, { kind: "RESPONSE_TOO_LARGE", provider: ConnectorID, operation: "updateConversation", message: "The Front response exceeds maxResponseBytes." });
238
+ }
239
+ function findContactByEmailFound(value, failure) {
240
+ return branchCase("found", value, failure);
241
+ }
242
+ function findContactByEmailNotFound(value, failure) {
243
+ return branchCase("notFound", value, failure);
244
+ }
245
+ function findContactByEmailProviderRejected(value, failure) {
246
+ return branchCase("providerRejected", value, failure);
247
+ }
248
+ function findContactByEmailInvalidResponse(value, failure) {
249
+ return branchCase("invalidResponse", value, failure);
250
+ }
251
+ function findContactByEmailDefect(value, failure) {
252
+ return branchCase("defect", value, failure);
253
+ }
254
+ function findContactByEmailRetry(failure, retryAfterMs = 0) {
255
+ return retryCase(failure, retryAfterMs);
256
+ }
257
+ function findContactByEmailRequesterContact() {
258
+ const value = FindContactByEmailOutputSchema.parse({ "contacts": [{ "handles": [{ "handle": "jane@acme.example.com", "source": "email" }], "id": "crd_100", "name": "Jane Smith" }] });
259
+ return branchCase("found", value);
260
+ }
261
+ function findContactByEmailDefault() {
262
+ return findContactByEmailRequesterContact();
263
+ }
264
+ function findContactByEmailMissingContact() {
265
+ const value = emptyFindContactByEmailOutput;
266
+ return branchCase("notFound", value, { kind: "NOT_FOUND", provider: ConnectorID, operation: "findContactByEmail", message: "Front found no contact for this email (HTTP 404)." });
267
+ }
268
+ function findContactByEmailDeniedContactRead() {
269
+ const value = emptyFindContactByEmailOutput;
270
+ return branchCase("providerRejected", value, { kind: "AUTHORIZATION", provider: ConnectorID, operation: "findContactByEmail", message: "Front denied contact read access (HTTP 403)." });
271
+ }
272
+ function findContactByEmailOversizedContact() {
273
+ const value = emptyFindContactByEmailOutput;
274
+ return branchCase("invalidResponse", value, { kind: "RESPONSE_TOO_LARGE", provider: ConnectorID, operation: "findContactByEmail", message: "The Front response exceeds maxResponseBytes." });
275
+ }
276
+ var GeneratedMock = class {
277
+ #searchConversations;
278
+ #getConversation;
279
+ #replyToConversation;
280
+ #updateConversation;
281
+ #findContactByEmail;
282
+ #connection;
283
+ constructor(connectionName) {
284
+ this.#searchConversations = newQuery(SearchConversationsDefinition).default(searchConversationsDefault());
285
+ this.#getConversation = newQuery(GetConversationDefinition).default(getConversationDefault());
286
+ this.#replyToConversation = newMutation(ReplyToConversationDefinition).default(replyToConversationDefault());
287
+ this.#updateConversation = newMutation(UpdateConversationDefinition).default(updateConversationDefault());
288
+ this.#findContactByEmail = newQuery(FindContactByEmailDefinition).default(findContactByEmailDefault());
289
+ this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
290
+ }
291
+ connection() {
292
+ return this.#connection;
293
+ }
294
+ searchConversations() {
295
+ return this.#searchConversations;
296
+ }
297
+ getConversation() {
298
+ return this.#getConversation;
299
+ }
300
+ replyToConversation() {
301
+ return this.#replyToConversation;
302
+ }
303
+ updateConversation() {
304
+ return this.#updateConversation;
305
+ }
306
+ findContactByEmail() {
307
+ return this.#findContactByEmail;
308
+ }
309
+ assertNoFailures() {
310
+ this.#searchConversations.assertNoFailures();
311
+ this.#getConversation.assertNoFailures();
312
+ this.#replyToConversation.assertNoFailures();
313
+ this.#updateConversation.assertNoFailures();
314
+ this.#findContactByEmail.assertNoFailures();
315
+ }
316
+ };
317
+ export {
318
+ GeneratedMock,
319
+ emptyComment,
320
+ emptyContact,
321
+ emptyContactHandle,
322
+ emptyConversation,
323
+ emptyConversationDetails,
324
+ emptyConversationReply,
325
+ emptyFindContactByEmailInput,
326
+ emptyFindContactByEmailOutput,
327
+ emptyGetConversationInput,
328
+ emptyMessage,
329
+ emptyRecipient,
330
+ emptyReplyToConversationInput,
331
+ emptySearchConversationsInput,
332
+ emptySearchConversationsOutput,
333
+ emptyTag,
334
+ emptyTeammate,
335
+ emptyUpdateConversationInput,
336
+ emptyUpdateConversationOutput,
337
+ findContactByEmailDefault,
338
+ findContactByEmailDefect,
339
+ findContactByEmailDeniedContactRead,
340
+ findContactByEmailFound,
341
+ findContactByEmailInvalidResponse,
342
+ findContactByEmailMissingContact,
343
+ findContactByEmailNotFound,
344
+ findContactByEmailOversizedContact,
345
+ findContactByEmailProviderRejected,
346
+ findContactByEmailRequesterContact,
347
+ findContactByEmailRetry,
348
+ getConversationDefault,
349
+ getConversationDefect,
350
+ getConversationDeniedConversationRead,
351
+ getConversationFound,
352
+ getConversationInvalidResponse,
353
+ getConversationMerged,
354
+ getConversationMergedConversation,
355
+ getConversationMissingConversation,
356
+ getConversationNotFound,
357
+ getConversationOversizedConversation,
358
+ getConversationProviderRejected,
359
+ getConversationRetry,
360
+ getConversationTriageConversation,
361
+ replyToConversationDefault,
362
+ replyToConversationDefect,
363
+ replyToConversationDeniedCommentWrite,
364
+ replyToConversationMissingConversation,
365
+ replyToConversationNotFound,
366
+ replyToConversationProviderRejected,
367
+ replyToConversationReplied,
368
+ replyToConversationRetry,
369
+ replyToConversationTriageComment,
370
+ replyToConversationUncertain,
371
+ searchConversationsDefault,
372
+ searchConversationsDefect,
373
+ searchConversationsInvalidResponse,
374
+ searchConversationsInvalidToken,
375
+ searchConversationsMatchingConversations,
376
+ searchConversationsOversizedPage,
377
+ searchConversationsProviderRejected,
378
+ searchConversationsRetry,
379
+ searchConversationsSearched,
380
+ updateConversationDefault,
381
+ updateConversationDefect,
382
+ updateConversationInvalidResponse,
383
+ updateConversationInvalidTag,
384
+ updateConversationMissingConversation,
385
+ updateConversationNotFound,
386
+ updateConversationOversizedReadBack,
387
+ updateConversationProviderRejected,
388
+ updateConversationRetry,
389
+ updateConversationRoutedConversation,
390
+ updateConversationUpdated
391
+ };
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@superdurable/connector-front",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "license": "MIT",
5
+ "description": "Front conversation and contact operations for Dex Flows",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/superdurable/dex-connectors-library.git",
9
+ "directory": "connectors/front/typescript"
10
+ },
11
+ "type": "module",
12
+ "publishConfig": {
13
+ "access": "public",
14
+ "registry": "https://registry.npmjs.org"
15
+ },
16
+ "engines": {
17
+ "node": "^22.0.0 || ^24.0.0"
18
+ },
19
+ "module": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ },
26
+ "./mock": {
27
+ "types": "./dist/mock.d.ts",
28
+ "import": "./dist/mock.js"
29
+ },
30
+ "./dex-connector.json": "./dex-connector.json"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "dex-connector.json",
35
+ "README.md"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsup src/index.ts src/mock.ts --format esm --dts --clean",
39
+ "typecheck": "tsc --noEmit",
40
+ "lint": "eslint src test examples",
41
+ "test": "npm run build && vitest run --exclude 'test/integration/**'",
42
+ "test:integration": "npm run build && vitest run test/integration/*.integration.test.ts",
43
+ "check": "npm test && npm run typecheck && npm run lint",
44
+ "example:contact": "npm run build && tsx examples/find-contact/main.ts",
45
+ "example:contact:start": "npm run build && tsx examples/find-contact/start.ts"
46
+ },
47
+ "dependencies": {
48
+ "@superdurable/connectors-sdk": "0.12.0",
49
+ "@superdurable/dex": ">=1.28.0",
50
+ "zod": "^4.1.0"
51
+ },
52
+ "devDependencies": {
53
+ "@eslint/js": "^9.0.0",
54
+ "@types/node": "^22.0.0",
55
+ "eslint": "^9.0.0",
56
+ "tsup": "^8.0.0",
57
+ "tsx": "^4.23.15",
58
+ "typescript": "^5.9.0",
59
+ "typescript-eslint": "^8.0.0",
60
+ "vitest": "^3.0.0",
61
+ "yaml": "^2.9.1"
62
+ }
63
+ }