@dyalio/gateway-contracts 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/dist/index.d.ts +337 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +214 -0
- package/dist/index.js.map +1 -0
- package/package.json +21 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const GATEWAY_CONTRACT_VERSION = 1;
|
|
3
|
+
export declare const gatewayChannelSchema: z.ZodEnum<{
|
|
4
|
+
facebook_page: "facebook_page";
|
|
5
|
+
instagram: "instagram";
|
|
6
|
+
telegram_bot: "telegram_bot";
|
|
7
|
+
x: "x";
|
|
8
|
+
bluesky: "bluesky";
|
|
9
|
+
reddit: "reddit";
|
|
10
|
+
}>;
|
|
11
|
+
export type GatewayChannel = z.infer<typeof gatewayChannelSchema>;
|
|
12
|
+
export declare const attachmentKindSchema: z.ZodEnum<{
|
|
13
|
+
image: "image";
|
|
14
|
+
document: "document";
|
|
15
|
+
audio: "audio";
|
|
16
|
+
video: "video";
|
|
17
|
+
}>;
|
|
18
|
+
export type AttachmentKind = z.infer<typeof attachmentKindSchema>;
|
|
19
|
+
export declare const gatewayAttachmentSchema: z.ZodObject<{
|
|
20
|
+
kind: z.ZodEnum<{
|
|
21
|
+
image: "image";
|
|
22
|
+
document: "document";
|
|
23
|
+
audio: "audio";
|
|
24
|
+
video: "video";
|
|
25
|
+
}>;
|
|
26
|
+
externalMediaId: z.ZodString;
|
|
27
|
+
mediaObjectId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
mimeType: z.ZodString;
|
|
29
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
30
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
retrievalUrl: z.ZodOptional<z.ZodString>;
|
|
33
|
+
retrievalExpiresAt: z.ZodOptional<z.ZodString>;
|
|
34
|
+
checksumSha256: z.ZodOptional<z.ZodString>;
|
|
35
|
+
transferState: z.ZodDefault<z.ZodEnum<{
|
|
36
|
+
pending: "pending";
|
|
37
|
+
ready: "ready";
|
|
38
|
+
failed: "failed";
|
|
39
|
+
unsupported: "unsupported";
|
|
40
|
+
}>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type GatewayAttachment = z.infer<typeof gatewayAttachmentSchema>;
|
|
43
|
+
export declare const gatewayInboundEventSchema: z.ZodObject<{
|
|
44
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
45
|
+
eventId: z.ZodString;
|
|
46
|
+
idempotencyKey: z.ZodString;
|
|
47
|
+
channel: z.ZodEnum<{
|
|
48
|
+
facebook_page: "facebook_page";
|
|
49
|
+
instagram: "instagram";
|
|
50
|
+
telegram_bot: "telegram_bot";
|
|
51
|
+
x: "x";
|
|
52
|
+
bluesky: "bluesky";
|
|
53
|
+
reddit: "reddit";
|
|
54
|
+
}>;
|
|
55
|
+
connectionId: z.ZodString;
|
|
56
|
+
externalTenantId: z.ZodString;
|
|
57
|
+
externalUserId: z.ZodString;
|
|
58
|
+
platformAccountId: z.ZodString;
|
|
59
|
+
externalConversationId: z.ZodString;
|
|
60
|
+
conversationId: z.ZodString;
|
|
61
|
+
externalMessageId: z.ZodString;
|
|
62
|
+
sender: z.ZodDefault<z.ZodObject<{
|
|
63
|
+
externalUserId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
65
|
+
username: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
text: z.ZodDefault<z.ZodString>;
|
|
68
|
+
attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
69
|
+
kind: z.ZodEnum<{
|
|
70
|
+
image: "image";
|
|
71
|
+
document: "document";
|
|
72
|
+
audio: "audio";
|
|
73
|
+
video: "video";
|
|
74
|
+
}>;
|
|
75
|
+
externalMediaId: z.ZodString;
|
|
76
|
+
mediaObjectId: z.ZodOptional<z.ZodString>;
|
|
77
|
+
mimeType: z.ZodString;
|
|
78
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
79
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
retrievalUrl: z.ZodOptional<z.ZodString>;
|
|
82
|
+
retrievalExpiresAt: z.ZodOptional<z.ZodString>;
|
|
83
|
+
checksumSha256: z.ZodOptional<z.ZodString>;
|
|
84
|
+
transferState: z.ZodDefault<z.ZodEnum<{
|
|
85
|
+
pending: "pending";
|
|
86
|
+
ready: "ready";
|
|
87
|
+
failed: "failed";
|
|
88
|
+
unsupported: "unsupported";
|
|
89
|
+
}>>;
|
|
90
|
+
}, z.core.$strip>>>;
|
|
91
|
+
replyTo: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
externalMessageId: z.ZodString;
|
|
93
|
+
textPreview: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
rawProvider: z.ZodString;
|
|
96
|
+
occurredAt: z.ZodString;
|
|
97
|
+
receivedAt: z.ZodString;
|
|
98
|
+
correlationId: z.ZodString;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type GatewayInboundEvent = z.infer<typeof gatewayInboundEventSchema>;
|
|
101
|
+
export declare const outboundAttachmentSchema: z.ZodObject<{
|
|
102
|
+
kind: z.ZodEnum<{
|
|
103
|
+
image: "image";
|
|
104
|
+
document: "document";
|
|
105
|
+
audio: "audio";
|
|
106
|
+
video: "video";
|
|
107
|
+
}>;
|
|
108
|
+
url: z.ZodString;
|
|
109
|
+
mimeType: z.ZodString;
|
|
110
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
111
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export type OutboundAttachment = z.infer<typeof outboundAttachmentSchema>;
|
|
114
|
+
export declare const gatewayOutboundRequestSchema: z.ZodObject<{
|
|
115
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
116
|
+
idempotencyKey: z.ZodString;
|
|
117
|
+
channel: z.ZodEnum<{
|
|
118
|
+
facebook_page: "facebook_page";
|
|
119
|
+
instagram: "instagram";
|
|
120
|
+
telegram_bot: "telegram_bot";
|
|
121
|
+
x: "x";
|
|
122
|
+
bluesky: "bluesky";
|
|
123
|
+
reddit: "reddit";
|
|
124
|
+
}>;
|
|
125
|
+
connectionId: z.ZodString;
|
|
126
|
+
conversationId: z.ZodString;
|
|
127
|
+
externalTenantId: z.ZodString;
|
|
128
|
+
externalUserId: z.ZodString;
|
|
129
|
+
text: z.ZodDefault<z.ZodString>;
|
|
130
|
+
attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
131
|
+
kind: z.ZodEnum<{
|
|
132
|
+
image: "image";
|
|
133
|
+
document: "document";
|
|
134
|
+
audio: "audio";
|
|
135
|
+
video: "video";
|
|
136
|
+
}>;
|
|
137
|
+
url: z.ZodString;
|
|
138
|
+
mimeType: z.ZodString;
|
|
139
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
140
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, z.core.$strip>>>;
|
|
142
|
+
replyToExternalMessageId: z.ZodOptional<z.ZodString>;
|
|
143
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
export type GatewayOutboundRequest = z.infer<typeof gatewayOutboundRequestSchema>;
|
|
146
|
+
export declare const connectionStateSchema: z.ZodEnum<{
|
|
147
|
+
failed: "failed";
|
|
148
|
+
awaiting_user_action: "awaiting_user_action";
|
|
149
|
+
authorizing: "authorizing";
|
|
150
|
+
connected: "connected";
|
|
151
|
+
degraded: "degraded";
|
|
152
|
+
reauthorization_required: "reauthorization_required";
|
|
153
|
+
disconnected: "disconnected";
|
|
154
|
+
}>;
|
|
155
|
+
export type ConnectionStatus = z.infer<typeof connectionStateSchema>;
|
|
156
|
+
export declare const channelCapabilitiesSchema: z.ZodObject<{
|
|
157
|
+
channel: z.ZodEnum<{
|
|
158
|
+
facebook_page: "facebook_page";
|
|
159
|
+
instagram: "instagram";
|
|
160
|
+
telegram_bot: "telegram_bot";
|
|
161
|
+
x: "x";
|
|
162
|
+
bluesky: "bluesky";
|
|
163
|
+
reddit: "reddit";
|
|
164
|
+
}>;
|
|
165
|
+
enabled: z.ZodBoolean;
|
|
166
|
+
inboundModes: z.ZodArray<z.ZodEnum<{
|
|
167
|
+
webhook: "webhook";
|
|
168
|
+
polling: "polling";
|
|
169
|
+
}>>;
|
|
170
|
+
maxTextChars: z.ZodNumber;
|
|
171
|
+
autoSplitText: z.ZodBoolean;
|
|
172
|
+
supportedAttachmentKinds: z.ZodArray<z.ZodEnum<{
|
|
173
|
+
image: "image";
|
|
174
|
+
document: "document";
|
|
175
|
+
audio: "audio";
|
|
176
|
+
video: "video";
|
|
177
|
+
}>>;
|
|
178
|
+
supportsVoiceNote: z.ZodBoolean;
|
|
179
|
+
supportsReply: z.ZodBoolean;
|
|
180
|
+
supportsTyping: z.ZodBoolean;
|
|
181
|
+
supportsEdit: z.ZodBoolean;
|
|
182
|
+
supportsDelete: z.ZodBoolean;
|
|
183
|
+
messagingWindowHours: z.ZodNullable<z.ZodNumber>;
|
|
184
|
+
limitations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
export type ChannelCapabilities = z.infer<typeof channelCapabilitiesSchema>;
|
|
187
|
+
export declare const connectionFieldSchema: z.ZodObject<{
|
|
188
|
+
name: z.ZodString;
|
|
189
|
+
label: z.ZodString;
|
|
190
|
+
description: z.ZodOptional<z.ZodString>;
|
|
191
|
+
type: z.ZodEnum<{
|
|
192
|
+
text: "text";
|
|
193
|
+
secret: "secret";
|
|
194
|
+
}>;
|
|
195
|
+
required: z.ZodBoolean;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
export type ConnectionField = z.infer<typeof connectionFieldSchema>;
|
|
198
|
+
export declare const connectionIntentDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
199
|
+
mode: z.ZodLiteral<"credentials">;
|
|
200
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
201
|
+
name: z.ZodString;
|
|
202
|
+
label: z.ZodString;
|
|
203
|
+
description: z.ZodOptional<z.ZodString>;
|
|
204
|
+
type: z.ZodEnum<{
|
|
205
|
+
text: "text";
|
|
206
|
+
secret: "secret";
|
|
207
|
+
}>;
|
|
208
|
+
required: z.ZodBoolean;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
211
|
+
mode: z.ZodLiteral<"redirect">;
|
|
212
|
+
authorizationEndpoint: z.ZodString;
|
|
213
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
214
|
+
mode: z.ZodLiteral<"external">;
|
|
215
|
+
instructions: z.ZodString;
|
|
216
|
+
}, z.core.$strip>], "mode">;
|
|
217
|
+
export type ConnectionIntentDescriptor = z.infer<typeof connectionIntentDescriptorSchema>;
|
|
218
|
+
export declare const connectionSelectionOptionSchema: z.ZodObject<{
|
|
219
|
+
id: z.ZodString;
|
|
220
|
+
label: z.ZodString;
|
|
221
|
+
description: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
export type ConnectionSelectionOption = z.infer<typeof connectionSelectionOptionSchema>;
|
|
224
|
+
export declare const connectionIntentSchema: z.ZodObject<{
|
|
225
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
226
|
+
stateId: z.ZodString;
|
|
227
|
+
channel: z.ZodEnum<{
|
|
228
|
+
facebook_page: "facebook_page";
|
|
229
|
+
instagram: "instagram";
|
|
230
|
+
telegram_bot: "telegram_bot";
|
|
231
|
+
x: "x";
|
|
232
|
+
bluesky: "bluesky";
|
|
233
|
+
reddit: "reddit";
|
|
234
|
+
}>;
|
|
235
|
+
mode: z.ZodEnum<{
|
|
236
|
+
credentials: "credentials";
|
|
237
|
+
redirect: "redirect";
|
|
238
|
+
external: "external";
|
|
239
|
+
}>;
|
|
240
|
+
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
label: z.ZodString;
|
|
243
|
+
description: z.ZodOptional<z.ZodString>;
|
|
244
|
+
type: z.ZodEnum<{
|
|
245
|
+
text: "text";
|
|
246
|
+
secret: "secret";
|
|
247
|
+
}>;
|
|
248
|
+
required: z.ZodBoolean;
|
|
249
|
+
}, z.core.$strip>>>;
|
|
250
|
+
redirectUrl: z.ZodOptional<z.ZodString>;
|
|
251
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
252
|
+
expiresAt: z.ZodString;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
export type ConnectionIntent = z.infer<typeof connectionIntentSchema>;
|
|
255
|
+
export declare const gatewayConversationSchema: z.ZodObject<{
|
|
256
|
+
conversationId: z.ZodString;
|
|
257
|
+
connectionId: z.ZodString;
|
|
258
|
+
channel: z.ZodEnum<{
|
|
259
|
+
facebook_page: "facebook_page";
|
|
260
|
+
instagram: "instagram";
|
|
261
|
+
telegram_bot: "telegram_bot";
|
|
262
|
+
x: "x";
|
|
263
|
+
bluesky: "bluesky";
|
|
264
|
+
reddit: "reddit";
|
|
265
|
+
}>;
|
|
266
|
+
status: z.ZodString;
|
|
267
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
268
|
+
platformAccountId: z.ZodNullable<z.ZodString>;
|
|
269
|
+
externalConversationId: z.ZodString;
|
|
270
|
+
participantId: z.ZodNullable<z.ZodString>;
|
|
271
|
+
lastInboundAt: z.ZodNullable<z.ZodString>;
|
|
272
|
+
lastOutboundAt: z.ZodNullable<z.ZodString>;
|
|
273
|
+
createdAt: z.ZodString;
|
|
274
|
+
updatedAt: z.ZodString;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
export type GatewayConversation = z.infer<typeof gatewayConversationSchema>;
|
|
277
|
+
export declare const gatewayMessageSchema: z.ZodObject<{
|
|
278
|
+
id: z.ZodString;
|
|
279
|
+
direction: z.ZodEnum<{
|
|
280
|
+
inbound: "inbound";
|
|
281
|
+
outbound: "outbound";
|
|
282
|
+
}>;
|
|
283
|
+
conversationId: z.ZodString;
|
|
284
|
+
connectionId: z.ZodString;
|
|
285
|
+
channel: z.ZodEnum<{
|
|
286
|
+
facebook_page: "facebook_page";
|
|
287
|
+
instagram: "instagram";
|
|
288
|
+
telegram_bot: "telegram_bot";
|
|
289
|
+
x: "x";
|
|
290
|
+
bluesky: "bluesky";
|
|
291
|
+
reddit: "reddit";
|
|
292
|
+
}>;
|
|
293
|
+
externalMessageId: z.ZodString;
|
|
294
|
+
text: z.ZodString;
|
|
295
|
+
attachments: z.ZodDefault<z.ZodArray<z.ZodUnknown>>;
|
|
296
|
+
sender: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
297
|
+
occurredAt: z.ZodString;
|
|
298
|
+
status: z.ZodString;
|
|
299
|
+
deliveryError: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
300
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
301
|
+
}, z.core.$strip>;
|
|
302
|
+
export type GatewayMessage = z.infer<typeof gatewayMessageSchema>;
|
|
303
|
+
export declare const normalizedGatewayErrorSchema: z.ZodObject<{
|
|
304
|
+
code: z.ZodEnum<{
|
|
305
|
+
invalid_request: "invalid_request";
|
|
306
|
+
unauthorized: "unauthorized";
|
|
307
|
+
forbidden: "forbidden";
|
|
308
|
+
not_found: "not_found";
|
|
309
|
+
conflict: "conflict";
|
|
310
|
+
unsupported_capability: "unsupported_capability";
|
|
311
|
+
rate_limited: "rate_limited";
|
|
312
|
+
authorization_expired: "authorization_expired";
|
|
313
|
+
policy_rejected: "policy_rejected";
|
|
314
|
+
provider_error: "provider_error";
|
|
315
|
+
retryable_error: "retryable_error";
|
|
316
|
+
unknown_outcome: "unknown_outcome";
|
|
317
|
+
}>;
|
|
318
|
+
message: z.ZodString;
|
|
319
|
+
retryable: z.ZodBoolean;
|
|
320
|
+
retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
|
|
321
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
322
|
+
}, z.core.$strip>;
|
|
323
|
+
export type NormalizedGatewayError = z.infer<typeof normalizedGatewayErrorSchema>;
|
|
324
|
+
export declare class GatewayError extends Error {
|
|
325
|
+
readonly code: NormalizedGatewayError["code"];
|
|
326
|
+
readonly retryable: boolean;
|
|
327
|
+
readonly retryAfterSeconds?: number;
|
|
328
|
+
readonly details?: Record<string, unknown>;
|
|
329
|
+
constructor(code: NormalizedGatewayError["code"], message: string, options?: {
|
|
330
|
+
retryable?: boolean;
|
|
331
|
+
retryAfterSeconds?: number;
|
|
332
|
+
details?: Record<string, unknown>;
|
|
333
|
+
cause?: unknown;
|
|
334
|
+
});
|
|
335
|
+
toJSON(): NormalizedGatewayError;
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,eAAO,MAAM,oBAAoB;;;;;;;EAO/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,oBAAoB;;;;;EAAkD,CAAC;AACpF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,uBAAuB;;;;;;;;;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package/dist/index.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const GATEWAY_CONTRACT_VERSION = 1;
|
|
3
|
+
export const gatewayChannelSchema = z.enum([
|
|
4
|
+
"facebook_page",
|
|
5
|
+
"instagram",
|
|
6
|
+
"telegram_bot",
|
|
7
|
+
"x",
|
|
8
|
+
"bluesky",
|
|
9
|
+
"reddit",
|
|
10
|
+
]);
|
|
11
|
+
export const attachmentKindSchema = z.enum(["image", "document", "audio", "video"]);
|
|
12
|
+
export const gatewayAttachmentSchema = z.object({
|
|
13
|
+
kind: attachmentKindSchema,
|
|
14
|
+
externalMediaId: z.string().min(1).max(500),
|
|
15
|
+
mediaObjectId: z.string().uuid().optional(),
|
|
16
|
+
mimeType: z.string().min(3).max(255),
|
|
17
|
+
filename: z.string().max(500).optional(),
|
|
18
|
+
sizeBytes: z.number().int().nonnegative().optional(),
|
|
19
|
+
durationSeconds: z.number().nonnegative().optional(),
|
|
20
|
+
retrievalUrl: z.string().url().max(4096).optional(),
|
|
21
|
+
retrievalExpiresAt: z.string().datetime({ offset: true }).optional(),
|
|
22
|
+
checksumSha256: z.string().length(64).optional(),
|
|
23
|
+
transferState: z.enum(["pending", "ready", "failed", "unsupported"]).default("pending"),
|
|
24
|
+
});
|
|
25
|
+
export const gatewayInboundEventSchema = z.object({
|
|
26
|
+
schemaVersion: z.literal(GATEWAY_CONTRACT_VERSION),
|
|
27
|
+
eventId: z.string().min(1).max(200),
|
|
28
|
+
idempotencyKey: z.string().min(1).max(240),
|
|
29
|
+
channel: gatewayChannelSchema,
|
|
30
|
+
connectionId: z.string().min(1).max(200),
|
|
31
|
+
externalTenantId: z.string().min(1).max(200),
|
|
32
|
+
externalUserId: z.string().min(1).max(200),
|
|
33
|
+
platformAccountId: z.string().min(1).max(500),
|
|
34
|
+
externalConversationId: z.string().min(1).max(500),
|
|
35
|
+
conversationId: z.string().uuid(),
|
|
36
|
+
externalMessageId: z.string().min(1).max(500),
|
|
37
|
+
sender: z
|
|
38
|
+
.object({
|
|
39
|
+
externalUserId: z.string().max(500).optional(),
|
|
40
|
+
displayName: z.string().max(500).optional(),
|
|
41
|
+
username: z.string().max(500).optional(),
|
|
42
|
+
})
|
|
43
|
+
.default({}),
|
|
44
|
+
text: z.string().max(50_000).default(""),
|
|
45
|
+
attachments: z.array(gatewayAttachmentSchema).max(20).default([]),
|
|
46
|
+
replyTo: z
|
|
47
|
+
.object({
|
|
48
|
+
externalMessageId: z.string().max(500),
|
|
49
|
+
textPreview: z.string().max(500).optional(),
|
|
50
|
+
})
|
|
51
|
+
.optional(),
|
|
52
|
+
rawProvider: z.string().min(1).max(100),
|
|
53
|
+
occurredAt: z.string().datetime({ offset: true }),
|
|
54
|
+
receivedAt: z.string().datetime({ offset: true }),
|
|
55
|
+
correlationId: z.string().min(1).max(200),
|
|
56
|
+
});
|
|
57
|
+
export const outboundAttachmentSchema = z.object({
|
|
58
|
+
kind: attachmentKindSchema,
|
|
59
|
+
url: z.string().url().max(4096),
|
|
60
|
+
mimeType: z.string().min(3).max(255),
|
|
61
|
+
filename: z.string().max(500).optional(),
|
|
62
|
+
caption: z.string().max(2_000).optional(),
|
|
63
|
+
});
|
|
64
|
+
export const gatewayOutboundRequestSchema = z.object({
|
|
65
|
+
schemaVersion: z.literal(GATEWAY_CONTRACT_VERSION),
|
|
66
|
+
idempotencyKey: z.string().min(1).max(240),
|
|
67
|
+
channel: gatewayChannelSchema,
|
|
68
|
+
connectionId: z.string().min(1).max(200),
|
|
69
|
+
conversationId: z.string().min(1).max(200),
|
|
70
|
+
externalTenantId: z.string().min(1).max(200),
|
|
71
|
+
externalUserId: z.string().min(1).max(200),
|
|
72
|
+
text: z.string().max(50_000).default(""),
|
|
73
|
+
attachments: z.array(outboundAttachmentSchema).max(10).default([]),
|
|
74
|
+
replyToExternalMessageId: z.string().max(500).optional(),
|
|
75
|
+
correlationId: z.string().max(200).optional(),
|
|
76
|
+
});
|
|
77
|
+
export const connectionStateSchema = z.enum([
|
|
78
|
+
"awaiting_user_action",
|
|
79
|
+
"authorizing",
|
|
80
|
+
"connected",
|
|
81
|
+
"degraded",
|
|
82
|
+
"reauthorization_required",
|
|
83
|
+
"disconnected",
|
|
84
|
+
"failed",
|
|
85
|
+
]);
|
|
86
|
+
export const channelCapabilitiesSchema = z.object({
|
|
87
|
+
channel: gatewayChannelSchema,
|
|
88
|
+
enabled: z.boolean(),
|
|
89
|
+
inboundModes: z.array(z.enum(["webhook", "polling"])),
|
|
90
|
+
maxTextChars: z.number().int().positive(),
|
|
91
|
+
autoSplitText: z.boolean(),
|
|
92
|
+
supportedAttachmentKinds: z.array(attachmentKindSchema),
|
|
93
|
+
supportsVoiceNote: z.boolean(),
|
|
94
|
+
supportsReply: z.boolean(),
|
|
95
|
+
supportsTyping: z.boolean(),
|
|
96
|
+
supportsEdit: z.boolean(),
|
|
97
|
+
supportsDelete: z.boolean(),
|
|
98
|
+
messagingWindowHours: z.number().nullable(),
|
|
99
|
+
limitations: z.array(z.string()).default([]),
|
|
100
|
+
});
|
|
101
|
+
export const connectionFieldSchema = z.object({
|
|
102
|
+
name: z.string().min(1).max(100),
|
|
103
|
+
label: z.string().min(1).max(200),
|
|
104
|
+
description: z.string().max(1_000).optional(),
|
|
105
|
+
type: z.enum(["text", "secret"]),
|
|
106
|
+
required: z.boolean(),
|
|
107
|
+
});
|
|
108
|
+
export const connectionIntentDescriptorSchema = z.discriminatedUnion("mode", [
|
|
109
|
+
z.object({
|
|
110
|
+
mode: z.literal("credentials"),
|
|
111
|
+
fields: z.array(connectionFieldSchema).min(1).max(20),
|
|
112
|
+
}),
|
|
113
|
+
z.object({
|
|
114
|
+
mode: z.literal("redirect"),
|
|
115
|
+
authorizationEndpoint: z.string().url().max(2_048),
|
|
116
|
+
}),
|
|
117
|
+
z.object({
|
|
118
|
+
mode: z.literal("external"),
|
|
119
|
+
instructions: z.string().min(1).max(2_000),
|
|
120
|
+
}),
|
|
121
|
+
]);
|
|
122
|
+
export const connectionSelectionOptionSchema = z.object({
|
|
123
|
+
id: z.string().min(1).max(500),
|
|
124
|
+
label: z.string().min(1).max(500),
|
|
125
|
+
description: z.string().max(1_000).optional(),
|
|
126
|
+
});
|
|
127
|
+
export const connectionIntentSchema = z.object({
|
|
128
|
+
schemaVersion: z.literal(GATEWAY_CONTRACT_VERSION),
|
|
129
|
+
stateId: z.string().min(1).max(200),
|
|
130
|
+
channel: gatewayChannelSchema,
|
|
131
|
+
mode: z.enum(["credentials", "redirect", "external"]),
|
|
132
|
+
fields: z.array(connectionFieldSchema).default([]),
|
|
133
|
+
redirectUrl: z.string().url().max(4_096).optional(),
|
|
134
|
+
instructions: z.string().max(2_000).optional(),
|
|
135
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
136
|
+
});
|
|
137
|
+
export const gatewayConversationSchema = z.object({
|
|
138
|
+
conversationId: z.string().uuid(),
|
|
139
|
+
connectionId: z.string().uuid(),
|
|
140
|
+
channel: gatewayChannelSchema,
|
|
141
|
+
status: z.string(),
|
|
142
|
+
displayName: z.string().nullable(),
|
|
143
|
+
platformAccountId: z.string().nullable(),
|
|
144
|
+
externalConversationId: z.string(),
|
|
145
|
+
participantId: z.string().nullable(),
|
|
146
|
+
lastInboundAt: z.string().datetime({ offset: true }).nullable(),
|
|
147
|
+
lastOutboundAt: z.string().datetime({ offset: true }).nullable(),
|
|
148
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
149
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
150
|
+
});
|
|
151
|
+
export const gatewayMessageSchema = z.object({
|
|
152
|
+
id: z.string().uuid(),
|
|
153
|
+
direction: z.enum(["inbound", "outbound"]),
|
|
154
|
+
conversationId: z.string().uuid(),
|
|
155
|
+
connectionId: z.string().uuid(),
|
|
156
|
+
channel: gatewayChannelSchema,
|
|
157
|
+
externalMessageId: z.string(),
|
|
158
|
+
text: z.string(),
|
|
159
|
+
attachments: z.array(z.unknown()).default([]),
|
|
160
|
+
sender: z.record(z.string(), z.unknown()).default({}),
|
|
161
|
+
occurredAt: z.string().datetime({ offset: true }),
|
|
162
|
+
status: z.string(),
|
|
163
|
+
deliveryError: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
164
|
+
metadata: z.record(z.string(), z.unknown()).default({}),
|
|
165
|
+
});
|
|
166
|
+
export const normalizedGatewayErrorSchema = z.object({
|
|
167
|
+
code: z.enum([
|
|
168
|
+
"invalid_request",
|
|
169
|
+
"unauthorized",
|
|
170
|
+
"forbidden",
|
|
171
|
+
"not_found",
|
|
172
|
+
"conflict",
|
|
173
|
+
"unsupported_capability",
|
|
174
|
+
"rate_limited",
|
|
175
|
+
"authorization_expired",
|
|
176
|
+
"policy_rejected",
|
|
177
|
+
"provider_error",
|
|
178
|
+
"retryable_error",
|
|
179
|
+
"unknown_outcome",
|
|
180
|
+
]),
|
|
181
|
+
message: z.string(),
|
|
182
|
+
retryable: z.boolean(),
|
|
183
|
+
retryAfterSeconds: z.number().int().positive().optional(),
|
|
184
|
+
details: z.record(z.string(), z.unknown()).optional(),
|
|
185
|
+
});
|
|
186
|
+
export class GatewayError extends Error {
|
|
187
|
+
code;
|
|
188
|
+
retryable;
|
|
189
|
+
retryAfterSeconds;
|
|
190
|
+
details;
|
|
191
|
+
constructor(code, message, options = {}) {
|
|
192
|
+
super(message, { cause: options.cause });
|
|
193
|
+
this.name = "GatewayError";
|
|
194
|
+
this.code = code;
|
|
195
|
+
this.retryable = options.retryable ?? (code === "retryable_error" || code === "rate_limited");
|
|
196
|
+
if (options.retryAfterSeconds !== undefined)
|
|
197
|
+
this.retryAfterSeconds = options.retryAfterSeconds;
|
|
198
|
+
if (options.details !== undefined)
|
|
199
|
+
this.details = options.details;
|
|
200
|
+
}
|
|
201
|
+
toJSON() {
|
|
202
|
+
const result = {
|
|
203
|
+
code: this.code,
|
|
204
|
+
message: this.message,
|
|
205
|
+
retryable: this.retryable,
|
|
206
|
+
};
|
|
207
|
+
if (this.retryAfterSeconds !== undefined)
|
|
208
|
+
result.retryAfterSeconds = this.retryAfterSeconds;
|
|
209
|
+
if (this.details !== undefined)
|
|
210
|
+
result.details = this.details;
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,eAAe;IACf,WAAW;IACX,cAAc;IACd,GAAG;IACH,SAAS;IACT,QAAQ;CACT,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAGpF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,oBAAoB;IAC1B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC3C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACpD,eAAe,EAAE,CAAC,CAA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AAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;QACF,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS;YAAE,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAC5F,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC9D,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dyalio/gateway-contracts",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"zod": "4.1.13"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.build.json"
|
|
20
|
+
}
|
|
21
|
+
}
|