@fonoster/common 0.26.0 → 0.30.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.
Files changed (176) hide show
  1. package/dist/assistants/index.d.ts +2 -6
  2. package/dist/assistants/index.js +2 -6
  3. package/dist/assistants/sessionAssistantSchema.d.ts +741 -0
  4. package/dist/assistants/sessionAssistantSchema.js +112 -0
  5. package/dist/assistants/testCasesSchema.d.ts +4 -4
  6. package/dist/{voice/Dial.d.ts → calls/index.d.ts} +16 -13
  7. package/dist/calls/index.js +44 -0
  8. package/dist/cellsecrets/index.d.ts +91 -0
  9. package/dist/cellsecrets/index.js +299 -0
  10. package/dist/config/cli/check.d.ts +6 -0
  11. package/dist/config/cli/check.js +202 -0
  12. package/dist/config/cli/envFile.d.ts +23 -0
  13. package/dist/config/cli/envFile.js +81 -0
  14. package/dist/config/cli/exposure.d.ts +10 -0
  15. package/dist/config/cli/exposure.js +93 -0
  16. package/dist/config/cli/index.d.ts +2 -0
  17. package/dist/{identity/tokenHasAccessKeyId.js → config/cli/index.js} +7 -8
  18. package/dist/config/cli/info.d.ts +6 -0
  19. package/dist/config/cli/info.js +62 -0
  20. package/dist/config/cli/init.d.ts +9 -0
  21. package/dist/config/cli/init.js +152 -0
  22. package/dist/config/cli/main.d.ts +11 -0
  23. package/dist/config/cli/main.js +155 -0
  24. package/dist/config/cli/render.d.ts +44 -0
  25. package/dist/config/cli/render.js +129 -0
  26. package/dist/config/cli/secrets.d.ts +21 -0
  27. package/dist/config/cli/secrets.js +117 -0
  28. package/dist/{utils/findIntegrationsCredentials.d.ts → config/cli/types.d.ts} +6 -5
  29. package/dist/config/cli/types.js +7 -0
  30. package/dist/config/configHints.d.ts +39 -0
  31. package/dist/config/configHints.js +61 -0
  32. package/dist/{voice → config}/index.d.ts +12 -13
  33. package/dist/config/index.js +46 -0
  34. package/dist/config/integrationsSchema.d.ts +32 -0
  35. package/dist/config/integrationsSchema.js +56 -0
  36. package/dist/config/interpolateEnv.d.ts +34 -0
  37. package/dist/config/interpolateEnv.js +70 -0
  38. package/dist/config/loadServiceConfig.d.ts +33 -0
  39. package/dist/config/loadServiceConfig.js +121 -0
  40. package/dist/config/logsSchema.d.ts +76 -0
  41. package/dist/config/logsSchema.js +49 -0
  42. package/dist/config/natsConnection.d.ts +53 -0
  43. package/dist/config/natsConnection.js +58 -0
  44. package/dist/config/parseConfigFile.d.ts +7 -0
  45. package/dist/config/parseConfigFile.js +60 -0
  46. package/dist/config/resolveConfigFile.d.ts +17 -0
  47. package/dist/config/resolveConfigFile.js +54 -0
  48. package/dist/config/resolveSecretRefs.d.ts +35 -0
  49. package/dist/config/resolveSecretRefs.js +129 -0
  50. package/dist/{assistants/audioFiltersSchema.d.ts → config/strictDeep.d.ts} +9 -12
  51. package/dist/config/strictDeep.js +58 -0
  52. package/dist/config/telemetrySchema.d.ts +39 -0
  53. package/dist/config/telemetrySchema.js +44 -0
  54. package/dist/config/toJsonSchema.d.ts +30 -0
  55. package/dist/config/toJsonSchema.js +161 -0
  56. package/dist/constants.d.ts +1 -4
  57. package/dist/constants.js +4 -5
  58. package/dist/envs.d.ts +2 -1
  59. package/dist/envs.js +13 -11
  60. package/dist/identity/createAuthInterceptor.d.ts +9 -2
  61. package/dist/identity/createAuthInterceptor.js +36 -30
  62. package/dist/identity/hasAccess.d.ts +9 -3
  63. package/dist/identity/hasAccess.js +32 -8
  64. package/dist/identity/index.d.ts +1 -0
  65. package/dist/identity/index.js +1 -0
  66. package/dist/identity/isValidToken.d.ts +12 -2
  67. package/dist/identity/isValidToken.js +25 -9
  68. package/dist/identity/roles.js +22 -6
  69. package/dist/identity/types.d.ts +6 -1
  70. package/dist/identity/types.js +1 -0
  71. package/dist/{assistants/LanguageModelProvider.js → identity/verifyAccessToken.d.ts} +10 -11
  72. package/dist/identity/verifyAccessToken.js +44 -0
  73. package/dist/index.d.ts +11 -1
  74. package/dist/index.js +14 -2
  75. package/dist/net/assertPublicDestination.d.ts +52 -0
  76. package/dist/net/assertPublicDestination.js +342 -0
  77. package/dist/{voice/PlayDtmf.d.ts → net/index.d.ts} +1 -5
  78. package/dist/{voice → net}/index.js +1 -13
  79. package/dist/notifications/createSendEmail.js +3 -1
  80. package/dist/protos/applications.proto +124 -3
  81. package/dist/protos/authz.proto +23 -4
  82. package/dist/protos/capabilities.proto +94 -0
  83. package/dist/protos/identity.proto +26 -1
  84. package/dist/protos/providers.proto +135 -0
  85. package/dist/protos/webhooks.proto +140 -0
  86. package/dist/{voice/StopSay.d.ts → regions/hub/index.d.ts} +1 -6
  87. package/dist/regions/hub/index.js +35 -0
  88. package/dist/regions/hub/natsJwt.d.ts +63 -0
  89. package/dist/regions/hub/natsJwt.js +195 -0
  90. package/dist/registry/Registry.d.ts +79 -0
  91. package/dist/registry/Registry.js +418 -0
  92. package/dist/registry/cli.d.ts +20 -0
  93. package/dist/registry/cli.js +424 -0
  94. package/dist/{assistants/audioFiltersSchema.js → registry/features.d.ts} +13 -14
  95. package/dist/registry/features.js +36 -0
  96. package/dist/{assistants/LanguageModelProvider.d.ts → registry/index.d.ts} +6 -8
  97. package/dist/registry/index.js +40 -0
  98. package/dist/registry/prisma.d.ts +67 -0
  99. package/dist/registry/prisma.js +391 -0
  100. package/dist/registry/stores.d.ts +21 -0
  101. package/dist/{assistants/eventsHookSchema.js → registry/stores.js} +55 -18
  102. package/dist/registry/types.d.ts +98 -0
  103. package/dist/{voice/Say.d.ts → registry/types.js} +4 -10
  104. package/dist/registry/workspaceKeys.d.ts +41 -0
  105. package/dist/registry/workspaceKeys.js +64 -0
  106. package/dist/session/index.d.ts +19 -0
  107. package/dist/session/index.js +35 -0
  108. package/dist/session/schema.d.ts +1951 -0
  109. package/dist/session/schema.js +397 -0
  110. package/dist/sessions/index.d.ts +93 -0
  111. package/dist/sessions/index.js +194 -0
  112. package/dist/telemetry.d.ts +76 -0
  113. package/dist/telemetry.js +360 -0
  114. package/dist/types.d.ts +3 -5
  115. package/dist/utils/{findIntegrationsCredentials.js → WriteBehind.d.ts} +13 -10
  116. package/dist/utils/WriteBehind.js +64 -0
  117. package/dist/utils/index.d.ts +1 -1
  118. package/dist/utils/index.js +1 -1
  119. package/dist/{voice/Play.d.ts → utils/logUnhandledRejections.d.ts} +8 -12
  120. package/dist/utils/logUnhandledRejections.js +37 -0
  121. package/dist/validators/calls.d.ts +2 -2
  122. package/dist/validators/calls.js +5 -2
  123. package/dist/validators/identity.d.ts +37 -8
  124. package/dist/validators/identity.js +22 -3
  125. package/dist/validators/index.d.ts +1 -0
  126. package/dist/validators/index.js +1 -0
  127. package/dist/validators/sip.d.ts +40 -0
  128. package/dist/validators/sip.js +99 -0
  129. package/dist/validators/sipnet/credentials.d.ts +2 -2
  130. package/dist/validators/sipnet/domains.js +7 -7
  131. package/dist/validators/sipnet/trunks.d.ts +14 -14
  132. package/dist/validators/sipnet/trunks.js +4 -2
  133. package/dist/webhooks/Dispatcher.d.ts +87 -0
  134. package/dist/webhooks/Dispatcher.js +225 -0
  135. package/dist/webhooks/bus.d.ts +49 -0
  136. package/dist/webhooks/bus.js +170 -0
  137. package/dist/webhooks/events.d.ts +66 -0
  138. package/dist/webhooks/events.js +62 -0
  139. package/dist/webhooks/index.d.ts +23 -0
  140. package/dist/webhooks/index.js +39 -0
  141. package/dist/webhooks/prisma.d.ts +55 -0
  142. package/dist/webhooks/prisma.js +242 -0
  143. package/dist/webhooks/signing.d.ts +8 -0
  144. package/dist/webhooks/signing.js +53 -0
  145. package/package.json +25 -12
  146. package/schema/session.v1.json +791 -0
  147. package/dist/assistants/assistantSchema.d.ts +0 -739
  148. package/dist/assistants/assistantSchema.js +0 -37
  149. package/dist/assistants/conversationSettingsSchema.d.ts +0 -122
  150. package/dist/assistants/conversationSettingsSchema.js +0 -133
  151. package/dist/assistants/eventsHookSchema.d.ts +0 -38
  152. package/dist/assistants/languageModelConfigSchema.d.ts +0 -206
  153. package/dist/assistants/languageModelConfigSchema.js +0 -91
  154. package/dist/identity/tokenHasAccessKeyId.d.ts +0 -2
  155. package/dist/protos/voice.proto +0 -557
  156. package/dist/voice/Dial.js +0 -20
  157. package/dist/voice/Gather.d.ts +0 -37
  158. package/dist/voice/Gather.js +0 -9
  159. package/dist/voice/Mute.d.ts +0 -31
  160. package/dist/voice/Mute.js +0 -9
  161. package/dist/voice/Play.js +0 -2
  162. package/dist/voice/PlayDtmf.js +0 -2
  163. package/dist/voice/PlaybackControl.d.ts +0 -31
  164. package/dist/voice/PlaybackControl.js +0 -11
  165. package/dist/voice/Record.d.ts +0 -36
  166. package/dist/voice/Record.js +0 -7
  167. package/dist/voice/Say.js +0 -2
  168. package/dist/voice/StopSay.js +0 -2
  169. package/dist/voice/Stream.d.ts +0 -53
  170. package/dist/voice/Stream.js +0 -19
  171. package/dist/voice/StreamGather.d.ts +0 -34
  172. package/dist/voice/StreamGather.js +0 -9
  173. package/dist/voice/Verb.d.ts +0 -27
  174. package/dist/voice/Verb.js +0 -2
  175. package/dist/voice/voice.d.ts +0 -171
  176. package/dist/voice/voice.js +0 -65
@@ -0,0 +1,791 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://fonoster.com/schemas/session/v1.json",
4
+ "title": "fonoster.session.v1",
5
+ "description": "Messages of the Fonoster session protocol (a stream with protocol fonoster). Unknown types and fields must be ignored.",
6
+ "protocol": "fonoster.session.v1",
7
+ "gatewayToApp": {
8
+ "session.start": {
9
+ "type": "object",
10
+ "required": [
11
+ "type",
12
+ "protocol",
13
+ "sessionRef",
14
+ "callRef",
15
+ "appRef",
16
+ "direction",
17
+ "from",
18
+ "to",
19
+ "metadata",
20
+ "handoff",
21
+ "audio",
22
+ "tracks",
23
+ "speech"
24
+ ],
25
+ "properties": {
26
+ "type": {
27
+ "const": "session.start"
28
+ },
29
+ "protocol": {
30
+ "const": "fonoster.session.v1"
31
+ },
32
+ "sessionRef": {
33
+ "type": "string"
34
+ },
35
+ "callRef": {
36
+ "type": "string"
37
+ },
38
+ "appRef": {
39
+ "type": "string"
40
+ },
41
+ "direction": {
42
+ "enum": [
43
+ "inbound",
44
+ "outbound"
45
+ ]
46
+ },
47
+ "from": {
48
+ "type": "string"
49
+ },
50
+ "to": {
51
+ "type": "string"
52
+ },
53
+ "metadata": {
54
+ "type": "object"
55
+ },
56
+ "handoff": {
57
+ "oneOf": [
58
+ {
59
+ "type": "null"
60
+ },
61
+ {
62
+ "type": "object"
63
+ }
64
+ ]
65
+ },
66
+ "audio": {
67
+ "type": "object",
68
+ "required": [
69
+ "codec",
70
+ "rate"
71
+ ],
72
+ "properties": {
73
+ "codec": {
74
+ "enum": [
75
+ "pcm16",
76
+ "pcmu"
77
+ ]
78
+ },
79
+ "rate": {
80
+ "enum": [
81
+ 8000,
82
+ 16000,
83
+ 24000
84
+ ]
85
+ }
86
+ }
87
+ },
88
+ "tracks": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "object",
92
+ "required": [
93
+ "id",
94
+ "side",
95
+ "kind",
96
+ "codec"
97
+ ],
98
+ "properties": {
99
+ "id": {
100
+ "type": "integer",
101
+ "minimum": 0,
102
+ "maximum": 255
103
+ },
104
+ "side": {
105
+ "enum": [
106
+ "inbound",
107
+ "outbound"
108
+ ]
109
+ },
110
+ "kind": {
111
+ "enum": [
112
+ "audio"
113
+ ]
114
+ },
115
+ "codec": {
116
+ "type": "string"
117
+ }
118
+ }
119
+ }
120
+ },
121
+ "speech": {
122
+ "type": "object",
123
+ "required": [
124
+ "voice",
125
+ "language"
126
+ ],
127
+ "properties": {
128
+ "voice": {
129
+ "type": "string"
130
+ },
131
+ "language": {
132
+ "type": "string"
133
+ }
134
+ }
135
+ }
136
+ }
137
+ },
138
+ "session.end": {
139
+ "type": "object",
140
+ "required": [
141
+ "type",
142
+ "reason"
143
+ ],
144
+ "properties": {
145
+ "type": {
146
+ "const": "session.end"
147
+ },
148
+ "reason": {
149
+ "enum": [
150
+ "caller_hangup",
151
+ "app_hangup",
152
+ "transfer",
153
+ "handoff",
154
+ "error",
155
+ "timeout"
156
+ ]
157
+ }
158
+ }
159
+ },
160
+ "error": {
161
+ "type": "object",
162
+ "required": [
163
+ "type",
164
+ "code",
165
+ "message",
166
+ "fatal"
167
+ ],
168
+ "properties": {
169
+ "type": {
170
+ "const": "error"
171
+ },
172
+ "code": {
173
+ "type": "string"
174
+ },
175
+ "message": {
176
+ "type": "string"
177
+ },
178
+ "fatal": {
179
+ "type": "boolean"
180
+ },
181
+ "relatesTo": {
182
+ "type": "string",
183
+ "minLength": 1,
184
+ "maxLength": 128
185
+ }
186
+ }
187
+ },
188
+ "turn.user_started": {
189
+ "type": "object",
190
+ "required": [
191
+ "type"
192
+ ],
193
+ "properties": {
194
+ "type": {
195
+ "const": "turn.user_started"
196
+ }
197
+ }
198
+ },
199
+ "turn.likely_ended": {
200
+ "type": "object",
201
+ "required": [
202
+ "type",
203
+ "text"
204
+ ],
205
+ "properties": {
206
+ "type": {
207
+ "const": "turn.likely_ended"
208
+ },
209
+ "text": {
210
+ "type": "string"
211
+ }
212
+ }
213
+ },
214
+ "turn.ended": {
215
+ "type": "object",
216
+ "required": [
217
+ "type",
218
+ "text",
219
+ "language",
220
+ "confidence",
221
+ "durationMs"
222
+ ],
223
+ "properties": {
224
+ "type": {
225
+ "const": "turn.ended"
226
+ },
227
+ "text": {
228
+ "type": "string"
229
+ },
230
+ "language": {
231
+ "type": "string"
232
+ },
233
+ "confidence": {
234
+ "type": "number",
235
+ "minimum": 0,
236
+ "maximum": 1
237
+ },
238
+ "durationMs": {
239
+ "type": "number",
240
+ "minimum": 0
241
+ },
242
+ "abandoned": {
243
+ "type": "boolean"
244
+ }
245
+ }
246
+ },
247
+ "turn.resumed": {
248
+ "type": "object",
249
+ "required": [
250
+ "type"
251
+ ],
252
+ "properties": {
253
+ "type": {
254
+ "const": "turn.resumed"
255
+ }
256
+ }
257
+ },
258
+ "turn.backchannel": {
259
+ "type": "object",
260
+ "required": [
261
+ "type",
262
+ "text"
263
+ ],
264
+ "properties": {
265
+ "type": {
266
+ "const": "turn.backchannel"
267
+ },
268
+ "text": {
269
+ "type": "string"
270
+ }
271
+ }
272
+ },
273
+ "turn.estimate": {
274
+ "type": "object",
275
+ "required": [
276
+ "type",
277
+ "eot",
278
+ "speaking",
279
+ "kind"
280
+ ],
281
+ "properties": {
282
+ "type": {
283
+ "const": "turn.estimate"
284
+ },
285
+ "eot": {
286
+ "type": "number",
287
+ "minimum": 0,
288
+ "maximum": 1
289
+ },
290
+ "speaking": {
291
+ "type": "boolean"
292
+ },
293
+ "kind": {
294
+ "enum": [
295
+ "speech",
296
+ "backchannel",
297
+ "interruption",
298
+ "none"
299
+ ]
300
+ }
301
+ }
302
+ },
303
+ "transcript.partial": {
304
+ "type": "object",
305
+ "required": [
306
+ "type",
307
+ "text"
308
+ ],
309
+ "properties": {
310
+ "type": {
311
+ "const": "transcript.partial"
312
+ },
313
+ "text": {
314
+ "type": "string"
315
+ },
316
+ "language": {
317
+ "type": "string"
318
+ }
319
+ }
320
+ },
321
+ "output.started": {
322
+ "type": "object",
323
+ "required": [
324
+ "type",
325
+ "id"
326
+ ],
327
+ "properties": {
328
+ "type": {
329
+ "const": "output.started"
330
+ },
331
+ "id": {
332
+ "type": "string",
333
+ "minLength": 1,
334
+ "maxLength": 128
335
+ }
336
+ }
337
+ },
338
+ "output.done": {
339
+ "type": "object",
340
+ "required": [
341
+ "type",
342
+ "id"
343
+ ],
344
+ "properties": {
345
+ "type": {
346
+ "const": "output.done"
347
+ },
348
+ "id": {
349
+ "type": "string",
350
+ "minLength": 1,
351
+ "maxLength": 128
352
+ },
353
+ "heardMs": {
354
+ "type": "number",
355
+ "minimum": 0
356
+ }
357
+ }
358
+ },
359
+ "output.interrupted": {
360
+ "type": "object",
361
+ "required": [
362
+ "type",
363
+ "id",
364
+ "heardText",
365
+ "heardMs"
366
+ ],
367
+ "properties": {
368
+ "type": {
369
+ "const": "output.interrupted"
370
+ },
371
+ "id": {
372
+ "type": "string",
373
+ "minLength": 1,
374
+ "maxLength": 128
375
+ },
376
+ "heardText": {
377
+ "type": "string"
378
+ },
379
+ "heardMs": {
380
+ "type": "number",
381
+ "minimum": 0
382
+ }
383
+ }
384
+ },
385
+ "mark": {
386
+ "type": "object",
387
+ "required": [
388
+ "type",
389
+ "name",
390
+ "cleared"
391
+ ],
392
+ "properties": {
393
+ "type": {
394
+ "const": "mark"
395
+ },
396
+ "name": {
397
+ "type": "string"
398
+ },
399
+ "cleared": {
400
+ "type": "boolean"
401
+ }
402
+ }
403
+ },
404
+ "dtmf": {
405
+ "type": "object",
406
+ "required": [
407
+ "type",
408
+ "digit"
409
+ ],
410
+ "properties": {
411
+ "type": {
412
+ "const": "dtmf"
413
+ },
414
+ "digit": {
415
+ "type": "string",
416
+ "pattern": "^[0-9A-D*#]$"
417
+ }
418
+ }
419
+ },
420
+ "amd.result": {
421
+ "type": "object",
422
+ "required": [
423
+ "type",
424
+ "status",
425
+ "confidence",
426
+ "detector",
427
+ "audioMs"
428
+ ],
429
+ "properties": {
430
+ "type": {
431
+ "const": "amd.result"
432
+ },
433
+ "status": {
434
+ "enum": [
435
+ "human",
436
+ "voicemail",
437
+ "ivr",
438
+ "machine",
439
+ "unknown"
440
+ ]
441
+ },
442
+ "confidence": {
443
+ "type": "number",
444
+ "minimum": 0,
445
+ "maximum": 1
446
+ },
447
+ "detector": {
448
+ "type": "string"
449
+ },
450
+ "audioMs": {
451
+ "type": "number",
452
+ "minimum": 0
453
+ },
454
+ "speechOnsetMs": {
455
+ "type": "number",
456
+ "minimum": 0
457
+ },
458
+ "reason": {
459
+ "type": "string"
460
+ }
461
+ }
462
+ }
463
+ },
464
+ "appToGateway": {
465
+ "speak": {
466
+ "type": "object",
467
+ "required": [
468
+ "type",
469
+ "text"
470
+ ],
471
+ "properties": {
472
+ "type": {
473
+ "const": "speak"
474
+ },
475
+ "id": {
476
+ "type": "string",
477
+ "minLength": 1,
478
+ "maxLength": 128
479
+ },
480
+ "text": {
481
+ "type": "string"
482
+ },
483
+ "last": {
484
+ "type": "boolean"
485
+ },
486
+ "voice": {
487
+ "type": "string",
488
+ "minLength": 1
489
+ },
490
+ "language": {
491
+ "type": "string",
492
+ "minLength": 1
493
+ },
494
+ "interruptible": {
495
+ "type": "boolean"
496
+ },
497
+ "preempt": {
498
+ "type": "boolean"
499
+ }
500
+ }
501
+ },
502
+ "play": {
503
+ "type": "object",
504
+ "required": [
505
+ "type",
506
+ "url"
507
+ ],
508
+ "properties": {
509
+ "type": {
510
+ "const": "play"
511
+ },
512
+ "id": {
513
+ "type": "string",
514
+ "minLength": 1,
515
+ "maxLength": 128
516
+ },
517
+ "url": {
518
+ "type": "string",
519
+ "pattern": "^https?://"
520
+ },
521
+ "loop": {
522
+ "type": "boolean"
523
+ },
524
+ "interruptible": {
525
+ "type": "boolean"
526
+ },
527
+ "preempt": {
528
+ "type": "boolean"
529
+ }
530
+ }
531
+ },
532
+ "listen.update": {
533
+ "type": "object",
534
+ "required": [
535
+ "type"
536
+ ],
537
+ "properties": {
538
+ "type": {
539
+ "const": "listen.update"
540
+ },
541
+ "id": {
542
+ "type": "string",
543
+ "minLength": 1,
544
+ "maxLength": 128
545
+ },
546
+ "language": {
547
+ "type": "string",
548
+ "minLength": 1
549
+ },
550
+ "hints": {
551
+ "type": "array",
552
+ "items": {
553
+ "type": "string"
554
+ }
555
+ },
556
+ "patience": {
557
+ "enum": [
558
+ "low",
559
+ "normal",
560
+ "high"
561
+ ]
562
+ }
563
+ }
564
+ },
565
+ "subscribe": {
566
+ "type": "object",
567
+ "required": [
568
+ "type",
569
+ "events"
570
+ ],
571
+ "properties": {
572
+ "type": {
573
+ "const": "subscribe"
574
+ },
575
+ "id": {
576
+ "type": "string",
577
+ "minLength": 1,
578
+ "maxLength": 128
579
+ },
580
+ "events": {
581
+ "type": "array",
582
+ "items": {
583
+ "type": "string"
584
+ }
585
+ }
586
+ }
587
+ },
588
+ "mark": {
589
+ "type": "object",
590
+ "required": [
591
+ "type",
592
+ "name"
593
+ ],
594
+ "properties": {
595
+ "type": {
596
+ "const": "mark"
597
+ },
598
+ "name": {
599
+ "type": "string",
600
+ "minLength": 1
601
+ }
602
+ }
603
+ },
604
+ "clear": {
605
+ "type": "object",
606
+ "required": [
607
+ "type"
608
+ ],
609
+ "properties": {
610
+ "type": {
611
+ "const": "clear"
612
+ },
613
+ "id": {
614
+ "type": "string",
615
+ "minLength": 1,
616
+ "maxLength": 128
617
+ }
618
+ }
619
+ },
620
+ "hangup": {
621
+ "type": "object",
622
+ "required": [
623
+ "type"
624
+ ],
625
+ "properties": {
626
+ "type": {
627
+ "const": "hangup"
628
+ },
629
+ "id": {
630
+ "type": "string",
631
+ "minLength": 1,
632
+ "maxLength": 128
633
+ }
634
+ }
635
+ },
636
+ "dtmf.send": {
637
+ "type": "object",
638
+ "required": [
639
+ "type",
640
+ "digits"
641
+ ],
642
+ "properties": {
643
+ "type": {
644
+ "const": "dtmf.send"
645
+ },
646
+ "id": {
647
+ "type": "string",
648
+ "minLength": 1,
649
+ "maxLength": 128
650
+ },
651
+ "digits": {
652
+ "type": "string",
653
+ "pattern": "^[0-9A-D*#w]+$"
654
+ }
655
+ }
656
+ },
657
+ "transfer": {
658
+ "type": "object",
659
+ "required": [
660
+ "type",
661
+ "to"
662
+ ],
663
+ "properties": {
664
+ "type": {
665
+ "const": "transfer"
666
+ },
667
+ "id": {
668
+ "type": "string",
669
+ "minLength": 1,
670
+ "maxLength": 128
671
+ },
672
+ "to": {
673
+ "type": "string",
674
+ "minLength": 1
675
+ },
676
+ "headers": {
677
+ "type": "object",
678
+ "additionalProperties": {
679
+ "type": "string"
680
+ }
681
+ },
682
+ "mode": {
683
+ "enum": [
684
+ "cold",
685
+ "warm",
686
+ "refer"
687
+ ]
688
+ },
689
+ "music": {
690
+ "type": "string"
691
+ }
692
+ }
693
+ },
694
+ "transfer.complete": {
695
+ "type": "object",
696
+ "required": [
697
+ "type",
698
+ "id"
699
+ ],
700
+ "properties": {
701
+ "type": {
702
+ "const": "transfer.complete"
703
+ },
704
+ "id": {
705
+ "type": "string",
706
+ "minLength": 1,
707
+ "maxLength": 128
708
+ }
709
+ }
710
+ },
711
+ "hold": {
712
+ "type": "object",
713
+ "required": [
714
+ "type"
715
+ ],
716
+ "properties": {
717
+ "type": {
718
+ "const": "hold"
719
+ },
720
+ "id": {
721
+ "type": "string",
722
+ "minLength": 1,
723
+ "maxLength": 128
724
+ },
725
+ "music": {
726
+ "type": "string"
727
+ }
728
+ }
729
+ },
730
+ "resume": {
731
+ "type": "object",
732
+ "required": [
733
+ "type"
734
+ ],
735
+ "properties": {
736
+ "type": {
737
+ "const": "resume"
738
+ },
739
+ "id": {
740
+ "type": "string",
741
+ "minLength": 1,
742
+ "maxLength": 128
743
+ }
744
+ }
745
+ },
746
+ "handoff": {
747
+ "type": "object",
748
+ "required": [
749
+ "type",
750
+ "app"
751
+ ],
752
+ "properties": {
753
+ "type": {
754
+ "const": "handoff"
755
+ },
756
+ "id": {
757
+ "type": "string",
758
+ "minLength": 1,
759
+ "maxLength": 128
760
+ },
761
+ "app": {
762
+ "type": "string",
763
+ "minLength": 1
764
+ },
765
+ "payload": {
766
+ "type": "object"
767
+ }
768
+ }
769
+ },
770
+ "record.note": {
771
+ "type": "object",
772
+ "required": [
773
+ "type",
774
+ "data"
775
+ ],
776
+ "properties": {
777
+ "type": {
778
+ "const": "record.note"
779
+ },
780
+ "id": {
781
+ "type": "string",
782
+ "minLength": 1,
783
+ "maxLength": 128
784
+ },
785
+ "data": {
786
+ "type": "object"
787
+ }
788
+ }
789
+ }
790
+ }
791
+ }