@automate.ax/integration-contracts 0.151.0 → 0.152.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/close/events.d.ts +2 -2
- package/dist/close/schemas.d.ts +2 -2
- package/dist/elevenlabs/api.d.ts +58 -0
- package/dist/elevenlabs/api.js +237 -0
- package/dist/elevenlabs/events.d.ts +264 -0
- package/dist/elevenlabs/events.js +47 -0
- package/dist/elevenlabs/index.d.ts +3 -0
- package/dist/elevenlabs/index.js +3 -0
- package/dist/elevenlabs/schemas.d.ts +458 -0
- package/dist/elevenlabs/schemas.js +229 -0
- package/dist/krisp/schemas.d.ts +1 -1
- package/dist/triggers.d.ts +2 -1
- package/package.json +8 -2
- package/src/elevenlabs/api.ts +341 -0
- package/src/elevenlabs/events.ts +58 -0
- package/src/elevenlabs/index.ts +3 -0
- package/src/elevenlabs/schemas.ts +253 -0
- package/src/triggers.ts +2 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
|
|
3
|
+
export const ELEVENLABS_OUTPUT_FORMAT_SCHEMA = z.enum([
|
|
4
|
+
"alaw_8000",
|
|
5
|
+
"mp3_22050_32",
|
|
6
|
+
"mp3_24000_48",
|
|
7
|
+
"mp3_44100_32",
|
|
8
|
+
"mp3_44100_64",
|
|
9
|
+
"mp3_44100_96",
|
|
10
|
+
"mp3_44100_128",
|
|
11
|
+
"mp3_44100_192",
|
|
12
|
+
"opus_48000_32",
|
|
13
|
+
"opus_48000_64",
|
|
14
|
+
"opus_48000_96",
|
|
15
|
+
"opus_48000_128",
|
|
16
|
+
"opus_48000_192",
|
|
17
|
+
"pcm_8000",
|
|
18
|
+
"pcm_16000",
|
|
19
|
+
"pcm_22050",
|
|
20
|
+
"pcm_24000",
|
|
21
|
+
"pcm_32000",
|
|
22
|
+
"pcm_44100",
|
|
23
|
+
"pcm_48000",
|
|
24
|
+
"ulaw_8000",
|
|
25
|
+
"wav_8000",
|
|
26
|
+
"wav_16000",
|
|
27
|
+
"wav_22050",
|
|
28
|
+
"wav_24000",
|
|
29
|
+
"wav_32000",
|
|
30
|
+
"wav_44100",
|
|
31
|
+
"wav_48000",
|
|
32
|
+
])
|
|
33
|
+
|
|
34
|
+
export const ELEVENLABS_USER_SCHEMA = z.object({
|
|
35
|
+
createdAt: z.number().int().nonnegative(),
|
|
36
|
+
firstName: z.string().nullable().optional(),
|
|
37
|
+
isOnboardingCompleted: z.boolean(),
|
|
38
|
+
seatType: z.string(),
|
|
39
|
+
subscription: z.object({
|
|
40
|
+
characterCount: z.number().int().nonnegative(),
|
|
41
|
+
characterLimit: z.number().int().nonnegative(),
|
|
42
|
+
status: z.string(),
|
|
43
|
+
tier: z.string(),
|
|
44
|
+
}),
|
|
45
|
+
userId: z.string().min(1),
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
export const ELEVENLABS_MODEL_SCHEMA = z.object({
|
|
49
|
+
canDoTextToSpeech: z.boolean(),
|
|
50
|
+
canDoVoiceConversion: z.boolean(),
|
|
51
|
+
canUseSpeakerBoost: z.boolean(),
|
|
52
|
+
canUseStyle: z.boolean(),
|
|
53
|
+
description: z.string(),
|
|
54
|
+
languages: z.object({ languageId: z.string(), name: z.string() }).array(),
|
|
55
|
+
maximumTextLengthPerRequest: z.number().int().positive(),
|
|
56
|
+
modelId: z.string().min(1),
|
|
57
|
+
name: z.string(),
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
export const ELEVENLABS_VOICE_SCHEMA = z.object({
|
|
61
|
+
availableForTiers: z.string().array().nullable().optional(),
|
|
62
|
+
category: z.string(),
|
|
63
|
+
description: z.string().nullable().optional(),
|
|
64
|
+
labels: z.record(z.string(), z.string()),
|
|
65
|
+
name: z.string(),
|
|
66
|
+
previewUrl: z.url().nullable().optional(),
|
|
67
|
+
voiceId: z.string().min(1),
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
export const ELEVENLABS_VOICES_PAGE_SCHEMA = z.object({
|
|
71
|
+
hasMore: z.boolean(),
|
|
72
|
+
nextPageToken: z.string().nullable().optional(),
|
|
73
|
+
totalCount: z.number().int().nonnegative(),
|
|
74
|
+
voices: ELEVENLABS_VOICE_SCHEMA.array(),
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
export const ELEVENLABS_ALIGNMENT_SCHEMA = z.object({
|
|
78
|
+
characterEndTimesSeconds: z.number().nonnegative().array(),
|
|
79
|
+
characterStartTimesSeconds: z.number().nonnegative().array(),
|
|
80
|
+
characters: z.string().array(),
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
export const ELEVENLABS_TIMESTAMPED_AUDIO_SCHEMA = z.object({
|
|
84
|
+
alignment: ELEVENLABS_ALIGNMENT_SCHEMA.nullable(),
|
|
85
|
+
audioBase64: z.base64(),
|
|
86
|
+
normalizedAlignment: ELEVENLABS_ALIGNMENT_SCHEMA.nullable(),
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
export const ELEVENLABS_TRANSCRIPT_WORD_SCHEMA = z.object({
|
|
90
|
+
channelIndex: z.number().int().nonnegative().nullable().optional(),
|
|
91
|
+
end: z.number().nonnegative().nullable().optional(),
|
|
92
|
+
logprob: z.number().optional(),
|
|
93
|
+
speakerId: z.string().nullable().optional(),
|
|
94
|
+
start: z.number().nonnegative().nullable().optional(),
|
|
95
|
+
text: z.string(),
|
|
96
|
+
type: z.enum(["audio_event", "spacing", "word"]),
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
export const ELEVENLABS_TRANSCRIPT_SCHEMA = z.object({
|
|
100
|
+
languageCode: z.string(),
|
|
101
|
+
languageProbability: z.number().min(0).max(1),
|
|
102
|
+
text: z.string(),
|
|
103
|
+
words: ELEVENLABS_TRANSCRIPT_WORD_SCHEMA.array(),
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
export const ELEVENLABS_TRANSCRIPTION_RESULT_SCHEMA = z.union([
|
|
107
|
+
ELEVENLABS_TRANSCRIPT_SCHEMA,
|
|
108
|
+
z.object({ transcripts: ELEVENLABS_TRANSCRIPT_SCHEMA.array() }),
|
|
109
|
+
])
|
|
110
|
+
|
|
111
|
+
export const ELEVENLABS_FORCED_ALIGNMENT_SCHEMA = z.object({
|
|
112
|
+
characters: z
|
|
113
|
+
.object({ end: z.number(), start: z.number(), text: z.string() })
|
|
114
|
+
.array(),
|
|
115
|
+
loss: z.number(),
|
|
116
|
+
words: z
|
|
117
|
+
.object({ end: z.number(), start: z.number(), text: z.string() })
|
|
118
|
+
.array(),
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
export const ELEVENLABS_DUBBING_CREATED_SCHEMA = z.object({
|
|
122
|
+
dubbingId: z.string().min(1),
|
|
123
|
+
expectedDurationSec: z.number().nonnegative(),
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
export const ELEVENLABS_DUBBING_SCHEMA = z.object({
|
|
127
|
+
dubbingId: z.string().min(1),
|
|
128
|
+
error: z.string().nullable().optional(),
|
|
129
|
+
name: z.string(),
|
|
130
|
+
sourceLanguage: z.string().nullable(),
|
|
131
|
+
status: z.enum([
|
|
132
|
+
"cloning",
|
|
133
|
+
"dubbed",
|
|
134
|
+
"dubbing",
|
|
135
|
+
"failed",
|
|
136
|
+
"preparing",
|
|
137
|
+
"queued",
|
|
138
|
+
]),
|
|
139
|
+
targetLanguages: z.string().array(),
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
export const ELEVENLABS_AGENT_SUMMARY_SCHEMA = z.object({
|
|
143
|
+
agentId: z.string().min(1),
|
|
144
|
+
name: z.string(),
|
|
145
|
+
tags: z.string().array().optional(),
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
export const ELEVENLABS_AGENTS_PAGE_SCHEMA = z.object({
|
|
149
|
+
agents: ELEVENLABS_AGENT_SUMMARY_SCHEMA.array(),
|
|
150
|
+
hasMore: z.boolean(),
|
|
151
|
+
nextCursor: z.string().nullable().optional(),
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
export const ELEVENLABS_CONVERSATION_SUMMARY_SCHEMA = z.object({
|
|
155
|
+
agentId: z.string().min(1),
|
|
156
|
+
agentName: z.string().nullable().optional(),
|
|
157
|
+
callDurationSecs: z.number().int().nonnegative(),
|
|
158
|
+
callSuccessful: z.enum(["error", "failure", "success", "unknown"]),
|
|
159
|
+
conversationId: z.string().min(1),
|
|
160
|
+
direction: z.enum(["inbound", "outbound"]).nullable().optional(),
|
|
161
|
+
mainLanguage: z.string().nullable().optional(),
|
|
162
|
+
messageCount: z.number().int().nonnegative(),
|
|
163
|
+
startTimeUnixSecs: z.number().int().nonnegative(),
|
|
164
|
+
status: z.enum(["done", "failed", "in-progress", "initiated", "processing"]),
|
|
165
|
+
transcriptSummary: z.string().nullable().optional(),
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
export const ELEVENLABS_CONVERSATIONS_PAGE_SCHEMA = z.object({
|
|
169
|
+
conversations: ELEVENLABS_CONVERSATION_SUMMARY_SCHEMA.array(),
|
|
170
|
+
hasMore: z.boolean(),
|
|
171
|
+
nextCursor: z.string().nullable().optional(),
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
export const ELEVENLABS_CONVERSATION_SCHEMA = z.object({
|
|
175
|
+
agentId: z.string().min(1),
|
|
176
|
+
conversationId: z.string().min(1),
|
|
177
|
+
hasAudio: z.boolean(),
|
|
178
|
+
status: z.enum(["done", "failed", "in-progress", "initiated", "processing"]),
|
|
179
|
+
transcript: z
|
|
180
|
+
.object({
|
|
181
|
+
agentMetadata: z.record(z.string(), z.json()).nullable().optional(),
|
|
182
|
+
message: z.string().nullable().optional(),
|
|
183
|
+
role: z.enum(["agent", "user"]),
|
|
184
|
+
timeInCallSecs: z.number().nonnegative(),
|
|
185
|
+
})
|
|
186
|
+
.array(),
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
export const ELEVENLABS_OUTBOUND_CALL_SCHEMA = z.object({
|
|
190
|
+
callSid: z.string().nullable(),
|
|
191
|
+
conversationId: z.string().nullable(),
|
|
192
|
+
message: z.string(),
|
|
193
|
+
success: z.boolean(),
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
export const ELEVENLABS_VOICE_REMOVAL_EVENT_SCHEMA = z.object({
|
|
197
|
+
data: z.object({
|
|
198
|
+
noticePeriodDays: z.number().int().nonnegative().optional(),
|
|
199
|
+
voiceId: z.string().min(1),
|
|
200
|
+
voiceName: z.string().optional(),
|
|
201
|
+
}),
|
|
202
|
+
eventTimestamp: z.number().int().nonnegative(),
|
|
203
|
+
type: z.enum([
|
|
204
|
+
"voice_removal_notice",
|
|
205
|
+
"voice_removal_notice_withdrawn",
|
|
206
|
+
"voice_removed",
|
|
207
|
+
]),
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
export const ELEVENLABS_TRANSCRIPTION_EVENT_SCHEMA = z.object({
|
|
211
|
+
data: z.object({
|
|
212
|
+
requestId: z.string().min(1),
|
|
213
|
+
transcription: ELEVENLABS_TRANSCRIPTION_RESULT_SCHEMA,
|
|
214
|
+
webhookMetadata: z.record(z.string(), z.json()).nullable().optional(),
|
|
215
|
+
}),
|
|
216
|
+
eventTimestamp: z.number().int().nonnegative().optional(),
|
|
217
|
+
type: z.literal("speech_to_text_transcription"),
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
const ELEVENLABS_FLOW_GENERATION_DATA_SCHEMA = z.discriminatedUnion("status", [
|
|
221
|
+
z.object({
|
|
222
|
+
contentMimeType: z.string().min(1),
|
|
223
|
+
contentUrl: z.url(),
|
|
224
|
+
id: z.string().min(1),
|
|
225
|
+
status: z.literal("completed"),
|
|
226
|
+
}),
|
|
227
|
+
z.object({
|
|
228
|
+
errorMessage: z.string(),
|
|
229
|
+
failureReason: z.enum([
|
|
230
|
+
"charging_failed",
|
|
231
|
+
"dependency_failed",
|
|
232
|
+
"internal_error",
|
|
233
|
+
"invalid_parameters",
|
|
234
|
+
"model_error",
|
|
235
|
+
"moderated",
|
|
236
|
+
"timeout",
|
|
237
|
+
]),
|
|
238
|
+
id: z.string().min(1),
|
|
239
|
+
status: z.literal("failed"),
|
|
240
|
+
}),
|
|
241
|
+
])
|
|
242
|
+
|
|
243
|
+
export const ELEVENLABS_FLOW_GENERATION_EVENT_SCHEMA = z.object({
|
|
244
|
+
data: ELEVENLABS_FLOW_GENERATION_DATA_SCHEMA,
|
|
245
|
+
eventTimestamp: z.number().int().nonnegative(),
|
|
246
|
+
type: z.literal("flows_generation"),
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
export const ELEVENLABS_WEBHOOK_EVENT_SCHEMA = z.union([
|
|
250
|
+
ELEVENLABS_VOICE_REMOVAL_EVENT_SCHEMA,
|
|
251
|
+
ELEVENLABS_TRANSCRIPTION_EVENT_SCHEMA,
|
|
252
|
+
ELEVENLABS_FLOW_GENERATION_EVENT_SCHEMA,
|
|
253
|
+
])
|
package/src/triggers.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { brevoTriggerContracts } from "./brevo"
|
|
|
8
8
|
import type { calcomTriggerContracts } from "./calcom"
|
|
9
9
|
import type { convexTriggerContracts } from "./convex"
|
|
10
10
|
import type { discordTriggerContracts } from "./discord"
|
|
11
|
+
import type { elevenLabsTriggerContracts } from "./elevenlabs"
|
|
11
12
|
import type { closeTriggerContracts } from "./close"
|
|
12
13
|
import type { cloudflareTriggerContracts } from "./cloudflare"
|
|
13
14
|
import type { clickUpTriggerContracts } from "./clickup"
|
|
@@ -50,6 +51,7 @@ export type TriggerContractMap = typeof airtableTriggerContracts &
|
|
|
50
51
|
typeof calcomTriggerContracts &
|
|
51
52
|
typeof convexTriggerContracts &
|
|
52
53
|
typeof discordTriggerContracts &
|
|
54
|
+
typeof elevenLabsTriggerContracts &
|
|
53
55
|
typeof closeTriggerContracts &
|
|
54
56
|
typeof clickUpTriggerContracts &
|
|
55
57
|
typeof calendlyTriggerContracts &
|