sipgate-mcp 0.3.0 → 0.5.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/CHANGELOG.md +137 -0
- package/README.md +161 -13
- package/SKILL.md +58 -8
- package/dist/backend/access-controlled-backend.d.ts +152 -1
- package/dist/backend/access-controlled-backend.d.ts.map +1 -1
- package/dist/backend/access-controlled-backend.js +1213 -25
- package/dist/backend/access-controlled-backend.js.map +1 -1
- package/dist/backend/sipgate-backend.d.ts +149 -1
- package/dist/backend/sipgate-backend.d.ts.map +1 -1
- package/dist/backend/sipgate-backend.js +1299 -12
- package/dist/backend/sipgate-backend.js.map +1 -1
- package/dist/backend/sipgate-client.d.ts +3 -0
- package/dist/backend/sipgate-client.d.ts.map +1 -1
- package/dist/backend/sipgate-client.js +22 -12
- package/dist/backend/sipgate-client.js.map +1 -1
- package/dist/backend/telephony-backend.d.ts +301 -0
- package/dist/backend/telephony-backend.d.ts.map +1 -1
- package/dist/credentials.d.ts +1 -1
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +11 -5
- package/dist/credentials.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +3 -2
- package/dist/server.js.map +1 -1
- package/dist/setup.d.ts +13 -2
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +72 -17
- package/dist/setup.js.map +1 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +1455 -60
- package/dist/tools/definitions.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -18,8 +18,81 @@ const actionAnnotations = {
|
|
|
18
18
|
openWorldHint: true,
|
|
19
19
|
};
|
|
20
20
|
const id = z.string().trim().min(1).max(128);
|
|
21
|
+
const int32Id = z.int().min(-2_147_483_648).max(2_147_483_647);
|
|
22
|
+
const swaggerString = z.string();
|
|
21
23
|
const e164 = z.string().regex(/^\+[1-9]\d{6,14}$/, "Use an E.164 phone number such as +4915799912345");
|
|
24
|
+
/** sipgate documents these as plain strings and accepts national formats. */
|
|
25
|
+
const dialString = z.string().trim().min(3).regex(/^[+0-9][0-9 ()\/.-]*$/, "Use a phone number, for example +4915799912345 or 0211 1234567");
|
|
22
26
|
const isoDateTime = z.string().refine((value) => !Number.isNaN(Date.parse(value)), "Use an ISO 8601 date-time");
|
|
27
|
+
const contactScope = z.enum(["PRIVATE", "SHARED", "INTERNAL"]);
|
|
28
|
+
const contactWriteScope = z.enum(["PRIVATE", "SHARED", "INTERNAL", "PRIVATE,SHARED"]);
|
|
29
|
+
const contactAddress = z.object({
|
|
30
|
+
country: swaggerString.optional(),
|
|
31
|
+
extendedAddress: swaggerString.optional(),
|
|
32
|
+
locality: swaggerString.optional(),
|
|
33
|
+
poBox: swaggerString.optional(),
|
|
34
|
+
postalCode: swaggerString.optional(),
|
|
35
|
+
region: swaggerString.optional(),
|
|
36
|
+
streetAddress: swaggerString.optional(),
|
|
37
|
+
type: z.array(swaggerString).optional(),
|
|
38
|
+
});
|
|
39
|
+
const contactEmail = z.object({
|
|
40
|
+
email: swaggerString.optional(),
|
|
41
|
+
type: z.array(swaggerString).optional(),
|
|
42
|
+
});
|
|
43
|
+
const contactNumber = z.object({
|
|
44
|
+
number: swaggerString.optional(),
|
|
45
|
+
type: z.array(swaggerString).optional(),
|
|
46
|
+
});
|
|
47
|
+
const contactWebsite = z.object({
|
|
48
|
+
type: z.array(swaggerString).optional(),
|
|
49
|
+
url: swaggerString.optional(),
|
|
50
|
+
});
|
|
51
|
+
const contactInput = z.object({
|
|
52
|
+
addresses: z.array(contactAddress).optional(),
|
|
53
|
+
emails: z.array(contactEmail).optional(),
|
|
54
|
+
family: swaggerString.optional(),
|
|
55
|
+
given: swaggerString.optional(),
|
|
56
|
+
name: swaggerString.optional(),
|
|
57
|
+
note: swaggerString.optional(),
|
|
58
|
+
numbers: z.array(contactNumber).optional(),
|
|
59
|
+
organization: z.array(z.array(swaggerString)).optional(),
|
|
60
|
+
picture: swaggerString.optional(),
|
|
61
|
+
scope: contactWriteScope.optional(),
|
|
62
|
+
websites: z.array(contactWebsite).optional(),
|
|
63
|
+
});
|
|
64
|
+
const contactUpdateInput = contactInput.extend({ id: swaggerString.optional() });
|
|
65
|
+
const structuredVCardItem = z.object({
|
|
66
|
+
city: swaggerString.optional(),
|
|
67
|
+
country: swaggerString.optional(),
|
|
68
|
+
extended: swaggerString.optional(),
|
|
69
|
+
family: swaggerString.optional(),
|
|
70
|
+
given: swaggerString.optional(),
|
|
71
|
+
group: swaggerString.optional(),
|
|
72
|
+
lat: swaggerString.optional(),
|
|
73
|
+
long: swaggerString.optional(),
|
|
74
|
+
middle: swaggerString.optional(),
|
|
75
|
+
name: swaggerString.optional(),
|
|
76
|
+
po_box: swaggerString.optional(),
|
|
77
|
+
post_code: swaggerString.optional(),
|
|
78
|
+
prefixes: swaggerString.optional(),
|
|
79
|
+
region: swaggerString.optional(),
|
|
80
|
+
street: swaggerString.optional(),
|
|
81
|
+
suffixes: swaggerString.optional(),
|
|
82
|
+
types: z.array(swaggerString).optional(),
|
|
83
|
+
unit: z.array(swaggerString).optional(),
|
|
84
|
+
value: swaggerString.optional(),
|
|
85
|
+
"x-local-number": swaggerString.optional(),
|
|
86
|
+
xlocalNumber: swaggerString.optional(),
|
|
87
|
+
});
|
|
88
|
+
const structuredVCardUpsert = z.object({
|
|
89
|
+
contactId: swaggerString.optional(),
|
|
90
|
+
item: z.record(z.string(), z.array(structuredVCardItem)).optional(),
|
|
91
|
+
});
|
|
92
|
+
const historyTypes = z.array(z.enum(["CALL", "VOICEMAIL", "SMS", "FAX"])).min(1).optional();
|
|
93
|
+
const historyDirections = z.array(z.enum(["INCOMING", "OUTGOING", "MISSED_INCOMING", "MISSED_OUTGOING"])).min(1).optional();
|
|
94
|
+
const historyStarred = z.array(z.enum(["STARRED", "UNSTARRED"])).min(1).optional();
|
|
95
|
+
const callRestriction = id.describe("Call restriction name, for example roaming");
|
|
23
96
|
function define(options) {
|
|
24
97
|
return {
|
|
25
98
|
name: options.name,
|
|
@@ -31,6 +104,13 @@ function define(options) {
|
|
|
31
104
|
}
|
|
32
105
|
export function createToolDefinitions(backend, readonly = false, accessScope = "user") {
|
|
33
106
|
const userScoped = accessScope === "user";
|
|
107
|
+
const changeWarning = userScoped
|
|
108
|
+
? "CHANGES THE AUTHENTICATED USER'S SIPGATE ACCOUNT AND MAY INCUR CHARGES:"
|
|
109
|
+
: "CHANGES THE SIPGATE ACCOUNT AND MAY INCUR CHARGES:";
|
|
110
|
+
const accountWideConfirmation = userScoped
|
|
111
|
+
? z.literal(true).describe("Required acknowledgement that this write affects the whole sipgate account")
|
|
112
|
+
: z.boolean().optional().describe("Optional acknowledgement that this write affects the whole sipgate account");
|
|
113
|
+
const accountWideWriteWarning = `${changeWarning} this operation changes an account-wide sipgate resource shared by all users.`;
|
|
34
114
|
const readTools = [
|
|
35
115
|
define({
|
|
36
116
|
name: "account_info",
|
|
@@ -53,7 +133,7 @@ export function createToolDefinitions(backend, readonly = false, accessScope = "
|
|
|
53
133
|
define({
|
|
54
134
|
name: "list_numbers",
|
|
55
135
|
description: userScoped
|
|
56
|
-
? "List phone numbers assigned to the authenticated user
|
|
136
|
+
? "List phone numbers assigned to the authenticated user and their endpoint assignments, including device-based accounts without phonelines."
|
|
57
137
|
: "List all sipgate phone numbers and their current endpoint assignments.",
|
|
58
138
|
schema: z.object({
|
|
59
139
|
offset: z.int().min(0).default(0).describe("Zero-based pagination offset"),
|
|
@@ -77,6 +157,94 @@ export function createToolDefinitions(backend, readonly = false, accessScope = "
|
|
|
77
157
|
annotations: readAnnotations,
|
|
78
158
|
execute: async ({ user_id, types }) => backend.listDevices(user_id, types),
|
|
79
159
|
}),
|
|
160
|
+
define({
|
|
161
|
+
name: "get_device",
|
|
162
|
+
description: "Get one sipgate device and its current settings after verifying user-scope ownership.",
|
|
163
|
+
schema: z.object({ device_id: id.describe("Device ID returned by list_devices") }),
|
|
164
|
+
annotations: readAnnotations,
|
|
165
|
+
execute: async ({ device_id }) => backend.getDevice(device_id),
|
|
166
|
+
}),
|
|
167
|
+
define({
|
|
168
|
+
name: "get_device_caller_id",
|
|
169
|
+
description: "Get the outgoing caller ID configured for one owned sipgate device.",
|
|
170
|
+
schema: z.object({ device_id: id.describe("Device ID returned by list_devices") }),
|
|
171
|
+
annotations: readAnnotations,
|
|
172
|
+
execute: async ({ device_id }) => backend.getDeviceCallerId(device_id),
|
|
173
|
+
}),
|
|
174
|
+
define({
|
|
175
|
+
name: "get_device_local_prefix",
|
|
176
|
+
description: "Get the automatic local-area-code prefix setting for one owned sipgate device.",
|
|
177
|
+
schema: z.object({ device_id: id.describe("Device ID returned by list_devices") }),
|
|
178
|
+
annotations: readAnnotations,
|
|
179
|
+
execute: async ({ device_id }) => backend.getDeviceLocalPrefix(device_id),
|
|
180
|
+
}),
|
|
181
|
+
define({
|
|
182
|
+
name: "get_device_tariff_announcement",
|
|
183
|
+
description: "Get the tariff-announcement setting for one owned sipgate device.",
|
|
184
|
+
schema: z.object({ device_id: id.describe("Device ID returned by list_devices") }),
|
|
185
|
+
annotations: readAnnotations,
|
|
186
|
+
execute: async ({ device_id }) => backend.getDeviceTariffAnnouncement(device_id),
|
|
187
|
+
}),
|
|
188
|
+
define({
|
|
189
|
+
name: "get_device_single_row_display",
|
|
190
|
+
description: "Get the single-row display setting for one owned sipgate device.",
|
|
191
|
+
schema: z.object({ device_id: id.describe("Device ID returned by list_devices") }),
|
|
192
|
+
annotations: readAnnotations,
|
|
193
|
+
execute: async ({ device_id }) => backend.getDeviceSingleRowDisplay(device_id),
|
|
194
|
+
}),
|
|
195
|
+
define({
|
|
196
|
+
name: "get_device_contingents",
|
|
197
|
+
description: "List the booked and remaining contingents for one owned sipgate device.",
|
|
198
|
+
schema: z.object({
|
|
199
|
+
user_id: id.describe(userScoped
|
|
200
|
+
? "Authenticated sipgate user ID; another user's ID is rejected"
|
|
201
|
+
: "Owner user ID, for example w0"),
|
|
202
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
203
|
+
}),
|
|
204
|
+
annotations: readAnnotations,
|
|
205
|
+
execute: async ({ user_id, device_id }) => backend.getDeviceContingents(user_id, device_id),
|
|
206
|
+
}),
|
|
207
|
+
define({
|
|
208
|
+
name: "list_user_numbers",
|
|
209
|
+
description: "List phone numbers from sipgate's documented user-specific numbers endpoint without using phonelines.",
|
|
210
|
+
schema: z.object({
|
|
211
|
+
user_id: id.describe(userScoped
|
|
212
|
+
? "Authenticated sipgate user ID; another user's ID is rejected"
|
|
213
|
+
: "sipgate user ID, for example w0"),
|
|
214
|
+
}),
|
|
215
|
+
annotations: readAnnotations,
|
|
216
|
+
execute: async ({ user_id }) => backend.getUserNumbers(user_id),
|
|
217
|
+
}),
|
|
218
|
+
define({
|
|
219
|
+
name: "validate_quick_dial",
|
|
220
|
+
description: "Check whether a quick-dial number is already taken. The check covers the whole sipgate account, including quick dials of other users.",
|
|
221
|
+
schema: z.object({ quick_dial_number: swaggerString.describe("Quick-dial number, for example 42") }),
|
|
222
|
+
annotations: readAnnotations,
|
|
223
|
+
execute: async ({ quick_dial_number }) => backend.validateQuickDialNumber(quick_dial_number),
|
|
224
|
+
}),
|
|
225
|
+
define({
|
|
226
|
+
name: "list_addresses",
|
|
227
|
+
description: userScoped
|
|
228
|
+
? "List only emergency addresses associated with the authenticated user's devices or phone numbers."
|
|
229
|
+
: "List all sipgate account addresses.",
|
|
230
|
+
schema: z.object({}),
|
|
231
|
+
annotations: readAnnotations,
|
|
232
|
+
execute: async () => backend.listAddresses(),
|
|
233
|
+
}),
|
|
234
|
+
define({
|
|
235
|
+
name: "get_address",
|
|
236
|
+
description: "Get one emergency address after verifying user-scope ownership.",
|
|
237
|
+
schema: z.object({ address_id: int32Id.describe("Integer address ID returned by list_addresses") }),
|
|
238
|
+
annotations: readAnnotations,
|
|
239
|
+
execute: async ({ address_id }) => backend.getAddress(address_id),
|
|
240
|
+
}),
|
|
241
|
+
define({
|
|
242
|
+
name: "list_address_numbers",
|
|
243
|
+
description: "List phone numbers associated with one emergency address after verifying user-scope ownership.",
|
|
244
|
+
schema: z.object({ address_id: int32Id.describe("Integer address ID returned by list_addresses") }),
|
|
245
|
+
annotations: readAnnotations,
|
|
246
|
+
execute: async ({ address_id }) => backend.listAddressNumbers(address_id),
|
|
247
|
+
}),
|
|
80
248
|
define({
|
|
81
249
|
name: "get_routing",
|
|
82
250
|
description: userScoped
|
|
@@ -119,6 +287,150 @@ export function createToolDefinitions(backend, readonly = false, accessScope = "
|
|
|
119
287
|
...(connection_ids === undefined ? {} : { connectionIds: connection_ids }),
|
|
120
288
|
}),
|
|
121
289
|
}),
|
|
290
|
+
define({
|
|
291
|
+
name: "list_calls",
|
|
292
|
+
description: userScoped
|
|
293
|
+
? "List currently established calls whose participants match the authenticated user's owned devices or phone numbers. Ringing calls and voicemail recordings are not included by sipgate."
|
|
294
|
+
: "List all currently established account calls. Ringing calls and voicemail recordings are not included by sipgate.",
|
|
295
|
+
schema: z.object({}),
|
|
296
|
+
annotations: readAnnotations,
|
|
297
|
+
execute: async () => backend.listCalls(),
|
|
298
|
+
}),
|
|
299
|
+
define({
|
|
300
|
+
name: "list_notifications",
|
|
301
|
+
description: "List call, fax, SMS, and voicemail notifications for one sipgate user.",
|
|
302
|
+
schema: z.object({
|
|
303
|
+
user_id: id.describe(userScoped
|
|
304
|
+
? "Authenticated sipgate user ID; another user's ID is rejected"
|
|
305
|
+
: "sipgate user ID, for example w0"),
|
|
306
|
+
}),
|
|
307
|
+
annotations: readAnnotations,
|
|
308
|
+
execute: async ({ user_id }) => backend.listNotifications(user_id),
|
|
309
|
+
}),
|
|
310
|
+
define({
|
|
311
|
+
name: "list_faxlines",
|
|
312
|
+
description: "List faxlines belonging to one sipgate user, including send/receive capability.",
|
|
313
|
+
schema: z.object({
|
|
314
|
+
user_id: id.describe(userScoped
|
|
315
|
+
? "Authenticated sipgate user ID; another user's ID is rejected"
|
|
316
|
+
: "sipgate user ID, for example w0"),
|
|
317
|
+
}),
|
|
318
|
+
annotations: readAnnotations,
|
|
319
|
+
execute: async ({ user_id }) => backend.listFaxlines(user_id),
|
|
320
|
+
}),
|
|
321
|
+
define({
|
|
322
|
+
name: "list_faxline_numbers",
|
|
323
|
+
description: "List phone numbers routed to an owned faxline.",
|
|
324
|
+
schema: z.object({
|
|
325
|
+
user_id: id.describe(userScoped
|
|
326
|
+
? "Authenticated sipgate user ID; another user's ID is rejected"
|
|
327
|
+
: "Faxline owner user ID, for example w0"),
|
|
328
|
+
faxline_id: id.describe("Faxline ID returned by list_faxlines"),
|
|
329
|
+
}),
|
|
330
|
+
annotations: readAnnotations,
|
|
331
|
+
execute: async ({ user_id, faxline_id }) => backend.listFaxlineNumbers(user_id, faxline_id),
|
|
332
|
+
}),
|
|
333
|
+
define({
|
|
334
|
+
name: "get_phoneline",
|
|
335
|
+
description: "Get one owned phoneline. Accounts without a phoneline layer return a clean unavailable result.",
|
|
336
|
+
schema: z.object({
|
|
337
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
338
|
+
phoneline_id: id.describe("Phoneline ID returned by get_routing or get_settings"),
|
|
339
|
+
}),
|
|
340
|
+
annotations: readAnnotations,
|
|
341
|
+
execute: async ({ user_id, phoneline_id }) => backend.getPhoneline(user_id, phoneline_id),
|
|
342
|
+
}),
|
|
343
|
+
define({
|
|
344
|
+
name: "get_phoneline_block_anonymous",
|
|
345
|
+
description: "Get anonymous-caller blocking for one owned phoneline, or report that phonelines are unavailable.",
|
|
346
|
+
schema: z.object({
|
|
347
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
348
|
+
phoneline_id: id,
|
|
349
|
+
}),
|
|
350
|
+
annotations: readAnnotations,
|
|
351
|
+
execute: async ({ user_id, phoneline_id }) => backend.getPhonelineBlockAnonymous(user_id, phoneline_id),
|
|
352
|
+
}),
|
|
353
|
+
define({
|
|
354
|
+
name: "list_phoneline_devices",
|
|
355
|
+
description: "List owned devices attached to one owned phoneline, or report that phonelines are unavailable.",
|
|
356
|
+
schema: z.object({
|
|
357
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
358
|
+
phoneline_id: id,
|
|
359
|
+
}),
|
|
360
|
+
annotations: readAnnotations,
|
|
361
|
+
execute: async ({ user_id, phoneline_id }) => backend.listPhonelineDevices(user_id, phoneline_id),
|
|
362
|
+
}),
|
|
363
|
+
define({
|
|
364
|
+
name: "list_parallel_forwardings",
|
|
365
|
+
description: "List parallel forwardings of one owned phoneline, or report that the feature is unavailable.",
|
|
366
|
+
schema: z.object({
|
|
367
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
368
|
+
phoneline_id: id,
|
|
369
|
+
}),
|
|
370
|
+
annotations: readAnnotations,
|
|
371
|
+
execute: async ({ user_id, phoneline_id }) => backend.listParallelForwardings(user_id, phoneline_id),
|
|
372
|
+
}),
|
|
373
|
+
define({
|
|
374
|
+
name: "list_phoneline_voicemails",
|
|
375
|
+
description: "List voicemail extensions belonging to one owned phoneline, or report that the feature is unavailable.",
|
|
376
|
+
schema: z.object({
|
|
377
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
378
|
+
phoneline_id: id,
|
|
379
|
+
}),
|
|
380
|
+
annotations: readAnnotations,
|
|
381
|
+
execute: async ({ user_id, phoneline_id }) => backend.listPhonelineVoicemails(user_id, phoneline_id),
|
|
382
|
+
}),
|
|
383
|
+
define({
|
|
384
|
+
name: "list_voicemail_greetings",
|
|
385
|
+
description: "List greetings belonging to an owned voicemail on an owned phoneline.",
|
|
386
|
+
schema: z.object({
|
|
387
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
388
|
+
phoneline_id: id,
|
|
389
|
+
voicemail_id: id,
|
|
390
|
+
}),
|
|
391
|
+
annotations: readAnnotations,
|
|
392
|
+
execute: async ({ user_id, phoneline_id, voicemail_id }) => backend.listVoicemailGreetings(user_id, phoneline_id, voicemail_id),
|
|
393
|
+
}),
|
|
394
|
+
define({
|
|
395
|
+
name: "list_voicemails",
|
|
396
|
+
description: userScoped
|
|
397
|
+
? "List only voicemail extensions that belong to the authenticated user's phonelines."
|
|
398
|
+
: "List all voicemail extensions in the sipgate account.",
|
|
399
|
+
schema: z.object({}),
|
|
400
|
+
annotations: readAnnotations,
|
|
401
|
+
execute: async () => backend.listVoicemails(),
|
|
402
|
+
}),
|
|
403
|
+
define({
|
|
404
|
+
name: "get_voicemail",
|
|
405
|
+
description: "Get one voicemail extension after verifying that it belongs to an owned phoneline.",
|
|
406
|
+
schema: z.object({ voicemail_id: id }),
|
|
407
|
+
annotations: readAnnotations,
|
|
408
|
+
execute: async ({ voicemail_id }) => backend.getVoicemail(voicemail_id),
|
|
409
|
+
}),
|
|
410
|
+
define({
|
|
411
|
+
name: "list_autorecording_greetings",
|
|
412
|
+
description: "Get the account-wide automated call-recording announcement. This resource has no user ownership link and therefore requires administrator account scope. Call recording may incur charges; the caller is responsible for obtaining every participant's consent.",
|
|
413
|
+
schema: z.object({}),
|
|
414
|
+
annotations: readAnnotations,
|
|
415
|
+
execute: async () => backend.listAutorecordingGreetings(),
|
|
416
|
+
}),
|
|
417
|
+
define({
|
|
418
|
+
name: "get_autorecording_settings",
|
|
419
|
+
description: "Get automated call-recording settings for an owned phoneline or faxline extension. Call recording may incur charges; the caller is responsible for obtaining every participant's consent.",
|
|
420
|
+
schema: z.object({ extension: id.describe("Owned phoneline or faxline extension ID") }),
|
|
421
|
+
annotations: readAnnotations,
|
|
422
|
+
execute: async ({ extension }) => backend.getAutorecordingSettings(extension),
|
|
423
|
+
}),
|
|
424
|
+
define({
|
|
425
|
+
name: "get_faxline_caller_id",
|
|
426
|
+
description: "Get the caller ID configured for one owned faxline.",
|
|
427
|
+
schema: z.object({
|
|
428
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
429
|
+
faxline_id: id.describe("Faxline ID returned by list_faxlines"),
|
|
430
|
+
}),
|
|
431
|
+
annotations: readAnnotations,
|
|
432
|
+
execute: async ({ user_id, faxline_id }) => backend.getFaxlineCallerId(user_id, faxline_id),
|
|
433
|
+
}),
|
|
122
434
|
define({
|
|
123
435
|
name: "get_settings",
|
|
124
436
|
description: userScoped
|
|
@@ -132,93 +444,1176 @@ export function createToolDefinitions(backend, readonly = false, accessScope = "
|
|
|
132
444
|
annotations: readAnnotations,
|
|
133
445
|
execute: async ({ user_id }) => backend.getSettings(user_id),
|
|
134
446
|
}),
|
|
447
|
+
define({
|
|
448
|
+
name: "list_contacts",
|
|
449
|
+
description: "List contacts from the account-wide sipgate address book. User scope permits this account-wide read.",
|
|
450
|
+
schema: z.object({
|
|
451
|
+
phone_numbers: z.array(swaggerString).min(1).optional(),
|
|
452
|
+
limit: z.int().min(1).default(5000),
|
|
453
|
+
offset: z.int().min(0).optional().describe("Deprecated by sipgate; prefer last_id"),
|
|
454
|
+
last_id: id.optional().describe("Last contact ID from the previous page"),
|
|
455
|
+
scopes: z.array(contactScope).min(1).optional(),
|
|
456
|
+
}),
|
|
457
|
+
annotations: readAnnotations,
|
|
458
|
+
execute: async ({ phone_numbers, limit, offset, last_id, scopes }) => backend.listContacts({
|
|
459
|
+
limit,
|
|
460
|
+
...(phone_numbers === undefined ? {} : { phoneNumbers: phone_numbers }),
|
|
461
|
+
...(offset === undefined ? {} : { offset }),
|
|
462
|
+
...(last_id === undefined ? {} : { lastId: last_id }),
|
|
463
|
+
...(scopes === undefined ? {} : { scopes }),
|
|
464
|
+
}),
|
|
465
|
+
}),
|
|
466
|
+
define({
|
|
467
|
+
name: "get_contact",
|
|
468
|
+
description: "Get one contact from the account-wide sipgate address book. User scope permits this account-wide read.",
|
|
469
|
+
schema: z.object({ contact_id: id }),
|
|
470
|
+
annotations: readAnnotations,
|
|
471
|
+
execute: async ({ contact_id }) => backend.getContact(contact_id),
|
|
472
|
+
}),
|
|
473
|
+
define({
|
|
474
|
+
name: "list_internal_contacts",
|
|
475
|
+
description: "List account-wide internal sipgate contacts through the deprecated compatibility endpoint. Prefer list_contacts with scopes=[INTERNAL]. User scope permits this read.",
|
|
476
|
+
schema: z.object({}),
|
|
477
|
+
annotations: readAnnotations,
|
|
478
|
+
execute: async () => backend.listInternalContacts(),
|
|
479
|
+
}),
|
|
480
|
+
define({
|
|
481
|
+
name: "export_contacts_csv",
|
|
482
|
+
description: "Export account-wide contacts as CSV text for the requested scopes. User scope permits this account-wide read.",
|
|
483
|
+
schema: z.object({ scopes: z.array(contactScope).min(1) }),
|
|
484
|
+
annotations: readAnnotations,
|
|
485
|
+
execute: async ({ scopes }) => backend.exportContactsCsv(scopes),
|
|
486
|
+
}),
|
|
487
|
+
define({
|
|
488
|
+
name: "get_contacts_vcard",
|
|
489
|
+
description: "Get structured vCards from the account-wide sipgate address book. User scope permits this account-wide read.",
|
|
490
|
+
schema: z.object({
|
|
491
|
+
scopes: z.array(contactScope).min(1),
|
|
492
|
+
labels: z.array(swaggerString).min(1).optional(),
|
|
493
|
+
contact_ids: z.array(id).min(1).optional(),
|
|
494
|
+
wanted_fields: z.array(swaggerString).min(1).optional(),
|
|
495
|
+
filter: swaggerString.optional(),
|
|
496
|
+
limit: z.int().min(1).default(5000),
|
|
497
|
+
offset: z.int().min(0).optional().describe("Deprecated by sipgate; prefer last_id"),
|
|
498
|
+
last_id: id.optional(),
|
|
499
|
+
}),
|
|
500
|
+
annotations: readAnnotations,
|
|
501
|
+
execute: async ({ scopes, labels, contact_ids, wanted_fields, filter, limit, offset, last_id }) => backend.getContactsVcard({
|
|
502
|
+
scopes,
|
|
503
|
+
limit,
|
|
504
|
+
...(labels === undefined ? {} : { labels }),
|
|
505
|
+
...(contact_ids === undefined ? {} : { contactIds: contact_ids }),
|
|
506
|
+
...(wanted_fields === undefined ? {} : { wantedFields: wanted_fields }),
|
|
507
|
+
...(filter === undefined ? {} : { filter }),
|
|
508
|
+
...(offset === undefined ? {} : { offset }),
|
|
509
|
+
...(last_id === undefined ? {} : { lastId: last_id }),
|
|
510
|
+
}),
|
|
511
|
+
}),
|
|
512
|
+
define({
|
|
513
|
+
name: "list_incoming_blacklist",
|
|
514
|
+
description: "List the account-wide incoming-call blacklist. User scope permits this account-wide read.",
|
|
515
|
+
schema: z.object({}),
|
|
516
|
+
annotations: readAnnotations,
|
|
517
|
+
execute: async () => backend.listIncomingBlacklist(),
|
|
518
|
+
}),
|
|
519
|
+
define({
|
|
520
|
+
name: "list_call_restrictions",
|
|
521
|
+
description: userScoped
|
|
522
|
+
? "Get call restrictions for the authenticated sipgate user; another user's ID is rejected."
|
|
523
|
+
: "Get call restrictions for selected users or the whole account.",
|
|
524
|
+
schema: z.object({
|
|
525
|
+
user_ids: z.array(id).min(1).optional(),
|
|
526
|
+
}),
|
|
527
|
+
annotations: readAnnotations,
|
|
528
|
+
execute: async ({ user_ids }) => backend.getCallRestrictions(user_ids),
|
|
529
|
+
}),
|
|
530
|
+
define({
|
|
531
|
+
name: "list_restrictions",
|
|
532
|
+
description: "List product/action restrictions for one sipgate user. User scope only permits the authenticated user ID.",
|
|
533
|
+
schema: z.object({
|
|
534
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "sipgate user ID"),
|
|
535
|
+
restrictions: z.array(swaggerString).min(1).optional(),
|
|
536
|
+
}),
|
|
537
|
+
annotations: readAnnotations,
|
|
538
|
+
execute: async ({ user_id, restrictions }) => backend.getRestrictions(user_id, restrictions),
|
|
539
|
+
}),
|
|
540
|
+
define({
|
|
541
|
+
name: "export_history",
|
|
542
|
+
description: userScoped
|
|
543
|
+
? "Export only the authenticated user's history as CSV text, constrained to owned connection IDs."
|
|
544
|
+
: "Export account-wide history as CSV text with optional filters.",
|
|
545
|
+
schema: z.object({
|
|
546
|
+
connection_ids: z.array(id).min(1).optional(),
|
|
547
|
+
types: historyTypes,
|
|
548
|
+
directions: historyDirections,
|
|
549
|
+
offset: z.int().min(0).default(0),
|
|
550
|
+
limit: z.int().min(0).max(1000).default(1000),
|
|
551
|
+
archived: z.boolean().optional(),
|
|
552
|
+
starred: historyStarred,
|
|
553
|
+
from: isoDateTime.optional(),
|
|
554
|
+
to: isoDateTime.optional(),
|
|
555
|
+
}).refine((value) => !value.from || !value.to || Date.parse(value.from) <= Date.parse(value.to), {
|
|
556
|
+
message: "from must be before or equal to to",
|
|
557
|
+
path: ["from"],
|
|
558
|
+
}),
|
|
559
|
+
annotations: readAnnotations,
|
|
560
|
+
execute: async ({ connection_ids, types, directions, offset, limit, archived, starred, from, to }) => backend.exportHistory({
|
|
561
|
+
offset,
|
|
562
|
+
limit,
|
|
563
|
+
...(connection_ids === undefined ? {} : { connectionIds: connection_ids }),
|
|
564
|
+
...(types === undefined ? {} : { types }),
|
|
565
|
+
...(directions === undefined ? {} : { directions }),
|
|
566
|
+
...(archived === undefined ? {} : { archived }),
|
|
567
|
+
...(starred === undefined ? {} : { starred }),
|
|
568
|
+
...(from === undefined ? {} : { from }),
|
|
569
|
+
...(to === undefined ? {} : { to }),
|
|
570
|
+
}),
|
|
571
|
+
}),
|
|
572
|
+
define({
|
|
573
|
+
name: "get_balance",
|
|
574
|
+
description: "Get the account-wide sipgate balance. User scope permits this account-wide read; the amount is returned in ten-thousandths of the currency unit.",
|
|
575
|
+
schema: z.object({}),
|
|
576
|
+
annotations: readAnnotations,
|
|
577
|
+
execute: async () => backend.getBalance(),
|
|
578
|
+
}),
|
|
579
|
+
define({
|
|
580
|
+
name: "list_portings",
|
|
581
|
+
description: "List all account-wide phone-number portings. User scope permits this account-wide read.",
|
|
582
|
+
schema: z.object({}),
|
|
583
|
+
annotations: readAnnotations,
|
|
584
|
+
execute: async () => backend.listPortings(),
|
|
585
|
+
}),
|
|
586
|
+
define({
|
|
587
|
+
name: "get_porting",
|
|
588
|
+
description: "Get one account-wide phone-number porting. User scope permits this account-wide read.",
|
|
589
|
+
schema: z.object({ porting_id: int32Id }),
|
|
590
|
+
annotations: readAnnotations,
|
|
591
|
+
execute: async ({ porting_id }) => backend.getPorting(porting_id),
|
|
592
|
+
}),
|
|
593
|
+
define({
|
|
594
|
+
name: "get_sipgateio_settings",
|
|
595
|
+
description: "Get the account-wide sipgate.io webhook URLs and logging configuration. User scope permits this account-wide read; unavailable plans return a clear feature-absent result.",
|
|
596
|
+
schema: z.object({}),
|
|
597
|
+
annotations: readAnnotations,
|
|
598
|
+
execute: async () => backend.getSipgateIoSettings(),
|
|
599
|
+
}),
|
|
600
|
+
define({
|
|
601
|
+
name: "list_webhook_logs",
|
|
602
|
+
description: "List the account-wide sipgate.io webhook log. User scope permits this account-wide read; unavailable plans return a clear feature-absent result.",
|
|
603
|
+
schema: z.object({}),
|
|
604
|
+
annotations: readAnnotations,
|
|
605
|
+
execute: async () => backend.listWebhookLogs(),
|
|
606
|
+
}),
|
|
135
607
|
];
|
|
136
608
|
if (readonly)
|
|
137
609
|
return readTools;
|
|
138
610
|
const writeTools = [
|
|
139
611
|
define({
|
|
140
|
-
name: "
|
|
141
|
-
description:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
612
|
+
name: "create_contact",
|
|
613
|
+
description: `${accountWideWriteWarning} In user scope, confirm_account_wide=true is required. Creates one contact; before is null because the new contact did not exist and sipgate returns no created ID.`,
|
|
614
|
+
schema: contactInput.extend({ confirm_account_wide: accountWideConfirmation }),
|
|
615
|
+
annotations: actionAnnotations,
|
|
616
|
+
execute: async ({ confirm_account_wide, ...contact }) => backend.createContact(contact, confirm_account_wide),
|
|
617
|
+
}),
|
|
618
|
+
define({
|
|
619
|
+
name: "update_contact",
|
|
620
|
+
description: `${accountWideWriteWarning} In user scope, confirm_account_wide=true is required. Replaces one contact and returns before/after state.`,
|
|
621
|
+
schema: contactUpdateInput.extend({
|
|
622
|
+
contact_id: id,
|
|
623
|
+
confirm_account_wide: accountWideConfirmation,
|
|
624
|
+
}).refine((value) => value.id === undefined || value.id === value.contact_id, {
|
|
625
|
+
message: "id must match contact_id when supplied",
|
|
626
|
+
path: ["id"],
|
|
147
627
|
}),
|
|
148
628
|
annotations: writeAnnotations,
|
|
149
|
-
execute: async ({
|
|
629
|
+
execute: async ({ contact_id, confirm_account_wide, ...contact }) => backend.updateContact(contact_id, contact, confirm_account_wide),
|
|
150
630
|
}),
|
|
151
631
|
define({
|
|
152
|
-
name: "
|
|
153
|
-
description:
|
|
154
|
-
? "CHANGES THE AUTHENTICATED USER'S SIPGATE SETTINGS: replace all forwardings for one of that user's phonelines, including timeout routing. Pass [] to delete all forwardings. Returns before/after state."
|
|
155
|
-
: "CHANGES THE SIPGATE ACCOUNT: replace all forwardings for a phoneline, including timeout routing. Pass an empty forwardings array to delete all forwardings. Reads and returns before/after state.",
|
|
632
|
+
name: "delete_contact",
|
|
633
|
+
description: `${accountWideWriteWarning} PERMANENTLY deletes one contact. In user scope, confirm_account_wide=true is required. Returns the previous contact and a deletion marker.`,
|
|
156
634
|
schema: z.object({
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
phoneline_id: id.describe("Phoneline ID, for example p0"),
|
|
161
|
-
forwardings: z.array(z.object({
|
|
162
|
-
active: z.boolean().default(true),
|
|
163
|
-
destination: e164,
|
|
164
|
-
timeout: z.int().min(0).describe("Seconds before forwarding; use 0 for immediate forwarding"),
|
|
165
|
-
})).describe("Complete replacement list; [] removes every forwarding"),
|
|
635
|
+
contact_id: id,
|
|
636
|
+
scopes: z.array(contactScope).min(1).optional(),
|
|
637
|
+
confirm_account_wide: accountWideConfirmation,
|
|
166
638
|
}),
|
|
167
639
|
annotations: writeAnnotations,
|
|
168
|
-
execute: async ({
|
|
640
|
+
execute: async ({ contact_id, scopes, confirm_account_wide }) => backend.deleteContact(contact_id, scopes, confirm_account_wide),
|
|
169
641
|
}),
|
|
170
642
|
define({
|
|
171
|
-
name: "
|
|
172
|
-
description:
|
|
173
|
-
? "CHANGES THE AUTHENTICATED USER'S SIPGATE SETTINGS: enable or disable Do Not Disturb for one of that user's devices. Returns before/after state."
|
|
174
|
-
: "CHANGES THE SIPGATE ACCOUNT: enable or disable Do Not Disturb for one device. Reads and returns the device's before/after state.",
|
|
643
|
+
name: "delete_contacts",
|
|
644
|
+
description: `${accountWideWriteWarning} PERMANENTLY deletes all matching contacts, or all contacts when filters are omitted. In user scope, confirm_account_wide=true is required. Returns before state and a deletion marker.`,
|
|
175
645
|
schema: z.object({
|
|
176
|
-
|
|
177
|
-
|
|
646
|
+
contact_ids: z.array(id).min(1).optional(),
|
|
647
|
+
scopes: z.array(contactWriteScope).min(1).optional(),
|
|
648
|
+
source: swaggerString.optional(),
|
|
649
|
+
confirm_account_wide: accountWideConfirmation,
|
|
178
650
|
}),
|
|
179
651
|
annotations: writeAnnotations,
|
|
180
|
-
execute: async ({
|
|
652
|
+
execute: async ({ contact_ids, scopes, source, confirm_account_wide }) => backend.deleteContacts({
|
|
653
|
+
...(contact_ids === undefined ? {} : { contactIds: contact_ids }),
|
|
654
|
+
...(scopes === undefined ? {} : { scope: scopes }),
|
|
655
|
+
...(source === undefined ? {} : { source }),
|
|
656
|
+
}, confirm_account_wide),
|
|
181
657
|
}),
|
|
182
658
|
define({
|
|
183
|
-
name: "
|
|
184
|
-
description:
|
|
185
|
-
? "MAY INCUR CHARGES: send an SMS from the authenticated user's verified SMS-capable extension. Returns the relevant before/after history snapshot; history can update asynchronously."
|
|
186
|
-
: "CHANGES THE SIPGATE ACCOUNT AND MAY INCUR CHARGES: send an SMS after verifying an SMS-capable extension. Reads and returns the relevant before/after history snapshot; history can update asynchronously.",
|
|
659
|
+
name: "import_contacts_csv",
|
|
660
|
+
description: `${accountWideWriteWarning} DESTRUCTIVE: imports base64-encoded CSV into the account-wide address book and may overwrite or duplicate contact data. In user scope, confirm_account_wide=true is required. Returns before/after contact state.`,
|
|
187
661
|
schema: z.object({
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
: "Owner of the SMS extension"),
|
|
191
|
-
sms_id: id.optional().describe("SMS extension ID; the first available extension is used when omitted"),
|
|
192
|
-
recipient: e164,
|
|
193
|
-
message: z.string().min(1),
|
|
194
|
-
send_at: z.int().min(0).optional().describe("Optional Unix timestamp in seconds"),
|
|
662
|
+
base64_content: z.string().min(1),
|
|
663
|
+
confirm_account_wide: accountWideConfirmation,
|
|
195
664
|
}),
|
|
196
665
|
annotations: actionAnnotations,
|
|
197
|
-
execute: async ({
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
666
|
+
execute: async ({ base64_content, confirm_account_wide }) => backend.importContactsCsv(base64_content, confirm_account_wide),
|
|
667
|
+
}),
|
|
668
|
+
define({
|
|
669
|
+
name: "put_contacts_vcard",
|
|
670
|
+
description: `${accountWideWriteWarning} Adds or overwrites structured vCards; a supplied contactId overwrites that contact. In user scope, confirm_account_wide=true is required. Returns before/after state.`,
|
|
671
|
+
schema: z.object({
|
|
672
|
+
scope: contactScope,
|
|
673
|
+
data: z.array(structuredVCardUpsert).min(1),
|
|
674
|
+
confirm_account_wide: accountWideConfirmation,
|
|
203
675
|
}),
|
|
676
|
+
annotations: writeAnnotations,
|
|
677
|
+
execute: async ({ scope, data, confirm_account_wide }) => backend.putContactsVcard(scope, data, confirm_account_wide),
|
|
204
678
|
}),
|
|
205
679
|
define({
|
|
206
|
-
name: "
|
|
207
|
-
description:
|
|
208
|
-
? "MAY INCUR CHARGES: start a Click2Dial call from the authenticated user's verified device or phone number. Returns before/after call state and the new session."
|
|
209
|
-
: "CHANGES THE SIPGATE ACCOUNT AND MAY INCUR CHARGES: start a Click2Dial call. Reads established calls before and after and returns the new session; ringing calls may not appear immediately.",
|
|
680
|
+
name: "add_incoming_blacklist",
|
|
681
|
+
description: `${accountWideWriteWarning} Adds an incoming blacklist entry for the whole account. In user scope, confirm_account_wide=true is required. Returns before/after blacklist state.`,
|
|
210
682
|
schema: z.object({
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
device_id: id.optional().describe("Required by sipgate when caller is a phone number instead of a device ID"),
|
|
683
|
+
phone_number: z.string().regex(/^\+?[1-9]\d{1,14}$/, "Use E.164 digits with an optional leading +"),
|
|
684
|
+
is_block: z.boolean().optional().describe("Block numbers beginning with this value"),
|
|
685
|
+
confirm_account_wide: accountWideConfirmation,
|
|
215
686
|
}),
|
|
216
687
|
annotations: actionAnnotations,
|
|
217
|
-
execute: async ({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
688
|
+
execute: async ({ phone_number, is_block, confirm_account_wide }) => backend.addIncomingBlacklist(phone_number, is_block, confirm_account_wide),
|
|
689
|
+
}),
|
|
690
|
+
define({
|
|
691
|
+
name: "remove_incoming_blacklist",
|
|
692
|
+
description: `${accountWideWriteWarning} Removes an incoming blacklist entry for the whole account. In user scope, confirm_account_wide=true is required. Returns the previous entry and a deletion marker.`,
|
|
693
|
+
schema: z.object({
|
|
694
|
+
phone_number: z.string().regex(/^\+?[1-9]\d{1,14}$/, "Use E.164 digits with an optional leading +"),
|
|
695
|
+
confirm_account_wide: accountWideConfirmation,
|
|
696
|
+
}),
|
|
697
|
+
annotations: writeAnnotations,
|
|
698
|
+
execute: async ({ phone_number, confirm_account_wide }) => backend.removeIncomingBlacklist(phone_number, confirm_account_wide),
|
|
699
|
+
}),
|
|
700
|
+
define({
|
|
701
|
+
name: "set_call_restriction",
|
|
702
|
+
description: `${changeWarning} enable or disable one call restriction for the authenticated sipgate user. The user ID is derived from authentication and cannot target another user. Returns before/after state.`,
|
|
703
|
+
schema: z.object({
|
|
704
|
+
restriction: callRestriction,
|
|
705
|
+
enabled: z.boolean().optional(),
|
|
706
|
+
}),
|
|
707
|
+
annotations: writeAnnotations,
|
|
708
|
+
execute: async ({ restriction, enabled }) => backend.setCallRestriction(restriction, enabled),
|
|
709
|
+
}),
|
|
710
|
+
define({
|
|
711
|
+
name: "set_history_read",
|
|
712
|
+
description: `${changeWarning} mark one owned history entry read or unread. Returns before/after state.`,
|
|
713
|
+
schema: z.object({ entry_id: id, value: z.boolean().optional() }),
|
|
714
|
+
annotations: writeAnnotations,
|
|
715
|
+
execute: async ({ entry_id, value }) => backend.setHistoryRead(entry_id, value),
|
|
716
|
+
}),
|
|
717
|
+
define({
|
|
718
|
+
name: "set_history_note",
|
|
719
|
+
description: `${changeWarning} replace the note on one owned history entry. Returns before/after state.`,
|
|
720
|
+
schema: z.object({ entry_id: id, note: swaggerString }),
|
|
721
|
+
annotations: writeAnnotations,
|
|
722
|
+
execute: async ({ entry_id, note }) => backend.setHistoryNote(entry_id, note),
|
|
723
|
+
}),
|
|
724
|
+
define({
|
|
725
|
+
name: "set_history_archive",
|
|
726
|
+
description: `${changeWarning} archive or unarchive one owned history entry. Returns before/after state.`,
|
|
727
|
+
schema: z.object({ entry_id: id, value: z.boolean().optional() }),
|
|
728
|
+
annotations: writeAnnotations,
|
|
729
|
+
execute: async ({ entry_id, value }) => backend.setHistoryArchive(entry_id, value),
|
|
730
|
+
}),
|
|
731
|
+
define({
|
|
732
|
+
name: "update_history_entry",
|
|
733
|
+
description: `${changeWarning} update archived, note, read, and/or starred state on one owned history entry. Returns before/after state.`,
|
|
734
|
+
schema: z.object({
|
|
735
|
+
entry_id: id,
|
|
736
|
+
archived: z.boolean().optional(),
|
|
737
|
+
note: swaggerString.optional(),
|
|
738
|
+
read: z.boolean().optional(),
|
|
739
|
+
starred: z.boolean().optional(),
|
|
740
|
+
}),
|
|
741
|
+
annotations: writeAnnotations,
|
|
742
|
+
execute: async ({ entry_id, archived, note, read, starred }) => backend.updateHistoryEntry(entry_id, {
|
|
743
|
+
...(archived === undefined ? {} : { archived }),
|
|
744
|
+
...(note === undefined ? {} : { note }),
|
|
745
|
+
...(read === undefined ? {} : { read }),
|
|
746
|
+
...(starred === undefined ? {} : { starred }),
|
|
747
|
+
}),
|
|
748
|
+
}),
|
|
749
|
+
define({
|
|
750
|
+
name: "delete_history_entry",
|
|
751
|
+
description: `${changeWarning} PERMANENTLY delete one owned call, fax, SMS, or voicemail history entry. This is irreversible. Returns the previous entry and a deletion marker.`,
|
|
752
|
+
schema: z.object({ entry_id: id }),
|
|
753
|
+
annotations: writeAnnotations,
|
|
754
|
+
execute: async ({ entry_id }) => backend.deleteHistoryEntry(entry_id),
|
|
755
|
+
}),
|
|
756
|
+
define({
|
|
757
|
+
name: "update_history_entries",
|
|
758
|
+
description: `${changeWarning} update fewer than 150 owned history entries in one request. User scope verifies every entry ID. Returns before/after state.`,
|
|
759
|
+
schema: z.object({
|
|
760
|
+
entries: z.array(z.object({
|
|
761
|
+
id,
|
|
762
|
+
archived: z.boolean().optional(),
|
|
763
|
+
read: z.boolean().optional(),
|
|
764
|
+
starred: z.boolean().optional(),
|
|
765
|
+
})).min(1).max(149),
|
|
766
|
+
}),
|
|
767
|
+
annotations: writeAnnotations,
|
|
768
|
+
execute: async ({ entries }) => backend.updateHistoryEntries(entries),
|
|
769
|
+
}),
|
|
770
|
+
define({
|
|
771
|
+
name: "delete_history_entries",
|
|
772
|
+
description: `${changeWarning} PERMANENTLY delete selected history entries, or all accessible history when entry_ids is omitted. This is irreversible. In user scope, omission is expanded to owned entry IDs and never sends an unconstrained account-wide DELETE. Returns previous state and a deletion marker.`,
|
|
773
|
+
schema: z.object({ entry_ids: z.array(id).min(1).optional() }),
|
|
774
|
+
annotations: writeAnnotations,
|
|
775
|
+
execute: async ({ entry_ids }) => backend.deleteHistoryEntries(entry_ids),
|
|
776
|
+
}),
|
|
777
|
+
define({
|
|
778
|
+
name: "cancel_porting",
|
|
779
|
+
description: `${accountWideWriteWarning} IRREVERSIBLY cancels an account-wide phone-number porting. confirm_account_wide=true is always required. Returns the previous porting and the cancellation response.`,
|
|
780
|
+
schema: z.object({
|
|
781
|
+
porting_id: int32Id,
|
|
782
|
+
confirm_account_wide: z.literal(true),
|
|
783
|
+
}),
|
|
784
|
+
annotations: writeAnnotations,
|
|
785
|
+
execute: async ({ porting_id, confirm_account_wide }) => backend.cancelPorting(porting_id, confirm_account_wide),
|
|
786
|
+
}),
|
|
787
|
+
define({
|
|
788
|
+
name: "update_sipgateio_settings",
|
|
789
|
+
description: `${accountWideWriteWarning} Replaces global sipgate.io incoming/outgoing webhook URLs and related settings. In user scope, confirm_account_wide=true is required. Returns before/after state or a clear unavailable result.`,
|
|
790
|
+
schema: z.object({
|
|
791
|
+
incoming_url: swaggerString,
|
|
792
|
+
outgoing_url: swaggerString,
|
|
793
|
+
log: z.boolean().optional(),
|
|
794
|
+
push_api_version: int32Id.optional(),
|
|
795
|
+
whitelist: z.array(swaggerString).optional(),
|
|
796
|
+
confirm_account_wide: accountWideConfirmation,
|
|
797
|
+
}),
|
|
798
|
+
annotations: writeAnnotations,
|
|
799
|
+
execute: async ({ incoming_url, outgoing_url, log, push_api_version, whitelist, confirm_account_wide }) => backend.updateSipgateIoSettings({
|
|
800
|
+
incomingUrl: incoming_url,
|
|
801
|
+
outgoingUrl: outgoing_url,
|
|
802
|
+
...(log === undefined ? {} : { log }),
|
|
803
|
+
...(push_api_version === undefined ? {} : { pushApiVersion: push_api_version }),
|
|
804
|
+
...(whitelist === undefined ? {} : { whitelist }),
|
|
805
|
+
}, confirm_account_wide),
|
|
806
|
+
}),
|
|
807
|
+
define({
|
|
808
|
+
name: "set_number_routing",
|
|
809
|
+
description: `${changeWarning} route a phone number to a sipgate endpoint ID. Reads and returns before/after state.`,
|
|
810
|
+
schema: z.object({
|
|
811
|
+
number_id: id.describe("Phone-number ID returned by list_numbers"),
|
|
812
|
+
endpoint_id: id.describe("Destination endpoint ID accepted by sipgate, for example p0"),
|
|
813
|
+
}),
|
|
814
|
+
annotations: writeAnnotations,
|
|
815
|
+
execute: async ({ number_id, endpoint_id }) => backend.setNumberRouting(number_id, endpoint_id),
|
|
816
|
+
}),
|
|
817
|
+
define({
|
|
818
|
+
name: "set_forwarding",
|
|
819
|
+
description: `${changeWarning} replace all forwardings for a phoneline, including timeout routing. Pass [] to delete all forwardings. Returns before/after state.`,
|
|
820
|
+
schema: z.object({
|
|
821
|
+
user_id: id.describe(userScoped
|
|
822
|
+
? "Authenticated sipgate user ID; another user's ID is rejected"
|
|
823
|
+
: "Owner user ID, for example w0"),
|
|
824
|
+
phoneline_id: id.describe("Phoneline ID, for example p0"),
|
|
825
|
+
forwardings: z.array(z.object({
|
|
826
|
+
active: z.boolean().default(true),
|
|
827
|
+
destination: e164,
|
|
828
|
+
timeout: z.int().min(0).describe("Seconds before forwarding; use 0 for immediate forwarding"),
|
|
829
|
+
})).describe("Complete replacement list; [] removes every forwarding"),
|
|
830
|
+
}),
|
|
831
|
+
annotations: writeAnnotations,
|
|
832
|
+
execute: async ({ user_id, phoneline_id, forwardings }) => backend.setForwarding(user_id, phoneline_id, forwardings),
|
|
833
|
+
}),
|
|
834
|
+
define({
|
|
835
|
+
name: "create_phoneline",
|
|
836
|
+
description: `${changeWarning} create a phoneline for the authenticated user. Provisioning may affect billing; returns before: null and the initial state, or a clean unavailable result.`,
|
|
837
|
+
schema: z.object({
|
|
838
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
839
|
+
}),
|
|
840
|
+
annotations: actionAnnotations,
|
|
841
|
+
execute: async ({ user_id }) => backend.createPhoneline(user_id),
|
|
842
|
+
}),
|
|
843
|
+
define({
|
|
844
|
+
name: "update_phoneline_alias",
|
|
845
|
+
description: `${changeWarning} update an owned phoneline alias. Returns before/after state or a clean unavailable result.`,
|
|
846
|
+
schema: z.object({
|
|
847
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
848
|
+
phoneline_id: id,
|
|
849
|
+
alias: swaggerString.optional(),
|
|
850
|
+
}),
|
|
851
|
+
annotations: writeAnnotations,
|
|
852
|
+
execute: async ({ user_id, phoneline_id, alias }) => backend.updatePhonelineAlias(user_id, phoneline_id, alias),
|
|
853
|
+
}),
|
|
854
|
+
define({
|
|
855
|
+
name: "delete_phoneline",
|
|
856
|
+
description: `${changeWarning} permanently delete an owned phoneline. Returns its previous state and a deletion marker, or a clean unavailable result.`,
|
|
857
|
+
schema: z.object({
|
|
858
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
859
|
+
phoneline_id: id,
|
|
860
|
+
}),
|
|
861
|
+
annotations: writeAnnotations,
|
|
862
|
+
execute: async ({ user_id, phoneline_id }) => backend.deletePhoneline(user_id, phoneline_id),
|
|
863
|
+
}),
|
|
864
|
+
define({
|
|
865
|
+
name: "set_phoneline_block_anonymous",
|
|
866
|
+
description: `${changeWarning} configure anonymous-caller rejection or voicemail routing on an owned phoneline. Returns before/after state.`,
|
|
867
|
+
schema: z.object({
|
|
868
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
869
|
+
phoneline_id: id,
|
|
870
|
+
enabled: z.boolean().optional(),
|
|
871
|
+
target: z.enum(["REJECT", "VOICEMAIL"]).optional(),
|
|
872
|
+
}),
|
|
873
|
+
annotations: writeAnnotations,
|
|
874
|
+
execute: async ({ user_id, phoneline_id, enabled, target }) => backend.setPhonelineBlockAnonymous(user_id, phoneline_id, {
|
|
875
|
+
...(enabled === undefined ? {} : { enabled }),
|
|
876
|
+
...(target === undefined ? {} : { target }),
|
|
877
|
+
}),
|
|
878
|
+
}),
|
|
879
|
+
define({
|
|
880
|
+
name: "attach_device_to_phoneline",
|
|
881
|
+
description: `${changeWarning} attach an owned device to an owned phoneline. Returns the complete before/after device assignment.`,
|
|
882
|
+
schema: z.object({
|
|
883
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
884
|
+
phoneline_id: id,
|
|
885
|
+
device_id: id.describe("Owned device ID returned by list_devices"),
|
|
886
|
+
}),
|
|
887
|
+
annotations: actionAnnotations,
|
|
888
|
+
execute: async ({ user_id, phoneline_id, device_id }) => backend.attachDeviceToPhoneline(user_id, phoneline_id, device_id),
|
|
889
|
+
}),
|
|
890
|
+
define({
|
|
891
|
+
name: "detach_device_from_phoneline",
|
|
892
|
+
description: `${changeWarning} detach an owned device from an owned phoneline. Returns the complete before/after device assignment.`,
|
|
893
|
+
schema: z.object({
|
|
894
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
895
|
+
phoneline_id: id,
|
|
896
|
+
device_id: id.describe("Owned device ID returned by list_phoneline_devices"),
|
|
897
|
+
}),
|
|
898
|
+
annotations: writeAnnotations,
|
|
899
|
+
execute: async ({ user_id, phoneline_id, device_id }) => backend.detachDeviceFromPhoneline(user_id, phoneline_id, device_id),
|
|
900
|
+
}),
|
|
901
|
+
define({
|
|
902
|
+
name: "create_parallel_forwarding",
|
|
903
|
+
description: `${changeWarning} create a parallel forwarding on an owned phoneline. Returns the complete before/after forwarding list.`,
|
|
904
|
+
schema: z.object({
|
|
905
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
906
|
+
phoneline_id: id,
|
|
907
|
+
active: z.boolean().optional(),
|
|
908
|
+
alias: swaggerString.optional(),
|
|
909
|
+
destination: swaggerString.optional(),
|
|
910
|
+
}),
|
|
911
|
+
annotations: actionAnnotations,
|
|
912
|
+
execute: async ({ user_id, phoneline_id, active, alias, destination }) => backend.createParallelForwarding(user_id, phoneline_id, {
|
|
913
|
+
...(active === undefined ? {} : { active }),
|
|
914
|
+
...(alias === undefined ? {} : { alias }),
|
|
915
|
+
...(destination === undefined ? {} : { destination }),
|
|
916
|
+
}),
|
|
917
|
+
}),
|
|
918
|
+
define({
|
|
919
|
+
name: "update_parallel_forwarding",
|
|
920
|
+
description: `${changeWarning} update a parallel forwarding belonging to an owned phoneline. Returns the complete before/after forwarding list.`,
|
|
921
|
+
schema: z.object({
|
|
922
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
923
|
+
phoneline_id: id,
|
|
924
|
+
parallel_forwarding_id: id,
|
|
925
|
+
active: z.boolean().optional(),
|
|
926
|
+
alias: swaggerString.optional(),
|
|
927
|
+
destination: swaggerString.optional(),
|
|
928
|
+
}),
|
|
929
|
+
annotations: writeAnnotations,
|
|
930
|
+
execute: async ({ user_id, phoneline_id, parallel_forwarding_id, active, alias, destination, }) => backend.updateParallelForwarding(user_id, phoneline_id, parallel_forwarding_id, {
|
|
931
|
+
...(active === undefined ? {} : { active }),
|
|
932
|
+
...(alias === undefined ? {} : { alias }),
|
|
933
|
+
...(destination === undefined ? {} : { destination }),
|
|
934
|
+
}),
|
|
935
|
+
}),
|
|
936
|
+
define({
|
|
937
|
+
name: "delete_parallel_forwarding",
|
|
938
|
+
description: `${changeWarning} delete a parallel forwarding belonging to an owned phoneline. Returns the complete before/after forwarding list.`,
|
|
939
|
+
schema: z.object({
|
|
940
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
941
|
+
phoneline_id: id,
|
|
942
|
+
parallel_forwarding_id: id,
|
|
943
|
+
}),
|
|
944
|
+
annotations: writeAnnotations,
|
|
945
|
+
execute: async ({ user_id, phoneline_id, parallel_forwarding_id }) => backend.deleteParallelForwarding(user_id, phoneline_id, parallel_forwarding_id),
|
|
946
|
+
}),
|
|
947
|
+
define({
|
|
948
|
+
name: "update_voicemail",
|
|
949
|
+
description: `${changeWarning} update an owned phoneline voicemail's active, timeout, and transcription settings. Returns before/after voicemail lists.`,
|
|
950
|
+
schema: z.object({
|
|
951
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
952
|
+
phoneline_id: id,
|
|
953
|
+
voicemail_id: id,
|
|
954
|
+
active: z.boolean(),
|
|
955
|
+
transcription: z.boolean(),
|
|
956
|
+
timeout: z.int().min(0).max(2_147_483_647).optional(),
|
|
957
|
+
}),
|
|
958
|
+
annotations: writeAnnotations,
|
|
959
|
+
execute: async ({ user_id, phoneline_id, voicemail_id, active, transcription, timeout }) => backend.updateVoicemail(user_id, phoneline_id, voicemail_id, {
|
|
960
|
+
active,
|
|
961
|
+
transcription,
|
|
962
|
+
...(timeout === undefined ? {} : { timeout }),
|
|
963
|
+
}),
|
|
964
|
+
}),
|
|
965
|
+
define({
|
|
966
|
+
name: "create_voicemail_greeting",
|
|
967
|
+
description: `${changeWarning} upload a greeting for an owned phoneline voicemail. Returns the complete before/after greeting list.`,
|
|
968
|
+
schema: z.object({
|
|
969
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
970
|
+
phoneline_id: id,
|
|
971
|
+
voicemail_id: id,
|
|
972
|
+
base64_content: z.string().max(15_000_000).optional(),
|
|
973
|
+
filename: swaggerString.optional(),
|
|
974
|
+
}),
|
|
975
|
+
annotations: actionAnnotations,
|
|
976
|
+
execute: async ({ user_id, phoneline_id, voicemail_id, base64_content, filename }) => backend.createVoicemailGreeting(user_id, phoneline_id, voicemail_id, {
|
|
977
|
+
...(base64_content === undefined ? {} : { base64Content: base64_content }),
|
|
978
|
+
...(filename === undefined ? {} : { filename }),
|
|
979
|
+
}),
|
|
980
|
+
}),
|
|
981
|
+
define({
|
|
982
|
+
name: "update_voicemail_greeting",
|
|
983
|
+
description: `${changeWarning} activate or deactivate a greeting belonging to an owned phoneline voicemail. Returns the complete before/after greeting list.`,
|
|
984
|
+
schema: z.object({
|
|
985
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
986
|
+
phoneline_id: id,
|
|
987
|
+
voicemail_id: id,
|
|
988
|
+
greeting_id: id,
|
|
989
|
+
active: z.boolean().optional(),
|
|
990
|
+
}),
|
|
991
|
+
annotations: writeAnnotations,
|
|
992
|
+
execute: async ({ user_id, phoneline_id, voicemail_id, greeting_id, active }) => backend.updateVoicemailGreeting(user_id, phoneline_id, voicemail_id, greeting_id, active),
|
|
993
|
+
}),
|
|
994
|
+
define({
|
|
995
|
+
name: "delete_voicemail_greeting",
|
|
996
|
+
description: `${changeWarning} delete a greeting belonging to an owned phoneline voicemail. Returns the complete before/after greeting list.`,
|
|
997
|
+
schema: z.object({
|
|
998
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
999
|
+
phoneline_id: id,
|
|
1000
|
+
voicemail_id: id,
|
|
1001
|
+
greeting_id: id,
|
|
1002
|
+
}),
|
|
1003
|
+
annotations: writeAnnotations,
|
|
1004
|
+
execute: async ({ user_id, phoneline_id, voicemail_id, greeting_id }) => backend.deleteVoicemailGreeting(user_id, phoneline_id, voicemail_id, greeting_id),
|
|
1005
|
+
}),
|
|
1006
|
+
define({
|
|
1007
|
+
name: "set_voicemail_transcription",
|
|
1008
|
+
description: `${changeWarning} enable or disable transcription for an owned phoneline voicemail. Transcription availability and pricing depend on the account. Returns before/after voicemail lists.`,
|
|
1009
|
+
schema: z.object({
|
|
1010
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1011
|
+
phoneline_id: id,
|
|
1012
|
+
voicemail_id: id,
|
|
1013
|
+
active: z.boolean().optional(),
|
|
1014
|
+
}),
|
|
1015
|
+
annotations: writeAnnotations,
|
|
1016
|
+
execute: async ({ user_id, phoneline_id, voicemail_id, active }) => backend.setVoicemailTranscription(user_id, phoneline_id, voicemail_id, active),
|
|
1017
|
+
}),
|
|
1018
|
+
define({
|
|
1019
|
+
name: "play_voicemail",
|
|
1020
|
+
description: `${changeWarning} initiate a call to play an owned voicemail recording on an owned device. THE CALL MAY INCUR CHARGES. The caller is responsible for any consent required for recording playback. before is null because sipgate exposes no synchronous session read-back.`,
|
|
1021
|
+
schema: z.object({
|
|
1022
|
+
data_id: id.optional().describe("Voicemail data/history ID; required in user scope for ownership"),
|
|
1023
|
+
device_id: id.optional().describe("Playback device ID; required in user scope for ownership"),
|
|
1024
|
+
}),
|
|
1025
|
+
annotations: actionAnnotations,
|
|
1026
|
+
execute: async ({ data_id, device_id }) => backend.playVoicemail({
|
|
1027
|
+
...(data_id === undefined ? {} : { dataId: data_id }),
|
|
1028
|
+
...(device_id === undefined ? {} : { deviceId: device_id }),
|
|
1029
|
+
}),
|
|
1030
|
+
}),
|
|
1031
|
+
define({
|
|
1032
|
+
name: "record_voicemail_greeting",
|
|
1033
|
+
description: `${changeWarning} initiate a call on an owned device to record a greeting for an owned voicemail. THE CALL MAY INCUR CHARGES. The caller is responsible for consent where recording law requires it. before is null because sipgate exposes no synchronous session read-back.`,
|
|
1034
|
+
schema: z.object({
|
|
1035
|
+
device_id: id.optional().describe("Recording device ID; required in user scope for ownership"),
|
|
1036
|
+
endpoint: swaggerString.optional(),
|
|
1037
|
+
target_id: id.optional().describe("Target voicemail ID; required in user scope for ownership"),
|
|
1038
|
+
}),
|
|
1039
|
+
annotations: actionAnnotations,
|
|
1040
|
+
execute: async ({ device_id, endpoint, target_id }) => backend.recordVoicemailGreeting({
|
|
1041
|
+
...(device_id === undefined ? {} : { deviceId: device_id }),
|
|
1042
|
+
...(endpoint === undefined ? {} : { endpoint }),
|
|
1043
|
+
...(target_id === undefined ? {} : { targetId: target_id }),
|
|
1044
|
+
}),
|
|
1045
|
+
}),
|
|
1046
|
+
define({
|
|
1047
|
+
name: "create_autorecording_greeting",
|
|
1048
|
+
description: `${changeWarning} replace the account-wide automated call-recording announcement. This resource has no user ownership link and therefore requires administrator account scope. Call recording may incur charges; the caller is responsible for obtaining every participant's consent. Returns before/after greeting state.`,
|
|
1049
|
+
schema: z.object({
|
|
1050
|
+
base64_content: z.string().max(15_000_000).optional(),
|
|
1051
|
+
filename: swaggerString.optional(),
|
|
1052
|
+
}),
|
|
1053
|
+
annotations: actionAnnotations,
|
|
1054
|
+
execute: async ({ base64_content, filename }) => backend.createAutorecordingGreeting({
|
|
1055
|
+
...(base64_content === undefined ? {} : { base64Content: base64_content }),
|
|
1056
|
+
...(filename === undefined ? {} : { filename }),
|
|
1057
|
+
}),
|
|
1058
|
+
}),
|
|
1059
|
+
define({
|
|
1060
|
+
name: "delete_autorecording_greeting",
|
|
1061
|
+
description: `${changeWarning} delete the account-wide automated call-recording announcement. This resource has no user ownership link and therefore requires administrator account scope. Call recording may incur charges; the caller is responsible for obtaining every participant's consent. Returns previous state and a deletion marker.`,
|
|
1062
|
+
schema: z.object({ greeting_id: id }),
|
|
1063
|
+
annotations: writeAnnotations,
|
|
1064
|
+
execute: async ({ greeting_id }) => backend.deleteAutorecordingGreeting(greeting_id),
|
|
1065
|
+
}),
|
|
1066
|
+
define({
|
|
1067
|
+
name: "set_autorecording_settings",
|
|
1068
|
+
description: `${changeWarning} enable or disable automated call recording for an owned phoneline or faxline extension. Recording may incur charges; the caller is responsible for obtaining every participant's consent. Returns before/after state.`,
|
|
1069
|
+
schema: z.object({
|
|
1070
|
+
extension: id.describe("Owned phoneline or faxline extension ID"),
|
|
1071
|
+
active: z.boolean().optional(),
|
|
1072
|
+
}),
|
|
1073
|
+
annotations: writeAnnotations,
|
|
1074
|
+
execute: async ({ extension, active }) => backend.setAutorecordingSettings(extension, active),
|
|
1075
|
+
}),
|
|
1076
|
+
define({
|
|
1077
|
+
name: "create_faxline",
|
|
1078
|
+
description: `${changeWarning} create a faxline for the authenticated user. Provisioning may affect billing; returns before: null and the initial state.`,
|
|
1079
|
+
schema: z.object({
|
|
1080
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1081
|
+
}),
|
|
1082
|
+
annotations: actionAnnotations,
|
|
1083
|
+
execute: async ({ user_id }) => backend.createFaxline(user_id),
|
|
1084
|
+
}),
|
|
1085
|
+
define({
|
|
1086
|
+
name: "update_faxline_alias",
|
|
1087
|
+
description: `${changeWarning} update the alias of an owned faxline. Returns before/after faxline state.`,
|
|
1088
|
+
schema: z.object({
|
|
1089
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1090
|
+
faxline_id: id,
|
|
1091
|
+
alias: swaggerString.optional(),
|
|
1092
|
+
}),
|
|
1093
|
+
annotations: writeAnnotations,
|
|
1094
|
+
execute: async ({ user_id, faxline_id, alias }) => backend.updateFaxlineAlias(user_id, faxline_id, alias),
|
|
1095
|
+
}),
|
|
1096
|
+
define({
|
|
1097
|
+
name: "delete_faxline",
|
|
1098
|
+
description: `${changeWarning} permanently delete an owned faxline. Returns its previous state and a deletion marker.`,
|
|
1099
|
+
schema: z.object({
|
|
1100
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1101
|
+
faxline_id: id,
|
|
1102
|
+
}),
|
|
1103
|
+
annotations: writeAnnotations,
|
|
1104
|
+
execute: async ({ user_id, faxline_id }) => backend.deleteFaxline(user_id, faxline_id),
|
|
1105
|
+
}),
|
|
1106
|
+
define({
|
|
1107
|
+
name: "set_faxline_caller_id",
|
|
1108
|
+
description: `${changeWarning} set an owned faxline's caller ID to an owned phone number. Returns before/after caller-ID state.`,
|
|
1109
|
+
schema: z.object({
|
|
1110
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1111
|
+
faxline_id: id,
|
|
1112
|
+
value: swaggerString.optional(),
|
|
1113
|
+
}),
|
|
1114
|
+
annotations: writeAnnotations,
|
|
1115
|
+
execute: async ({ user_id, faxline_id, value }) => backend.setFaxlineCallerId(user_id, faxline_id, value),
|
|
1116
|
+
}),
|
|
1117
|
+
define({
|
|
1118
|
+
name: "set_faxline_tagline",
|
|
1119
|
+
description: `${changeWarning} update the tagline of an owned faxline. Returns before/after faxline state.`,
|
|
1120
|
+
schema: z.object({
|
|
1121
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1122
|
+
faxline_id: id,
|
|
1123
|
+
value: swaggerString.optional(),
|
|
1124
|
+
}),
|
|
1125
|
+
annotations: writeAnnotations,
|
|
1126
|
+
execute: async ({ user_id, faxline_id, value }) => backend.setFaxlineTagline(user_id, faxline_id, value),
|
|
1127
|
+
}),
|
|
1128
|
+
define({
|
|
1129
|
+
name: "set_dnd",
|
|
1130
|
+
description: `${changeWarning} enable or disable Do Not Disturb for one device. Returns before/after state.`,
|
|
1131
|
+
schema: z.object({
|
|
1132
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
1133
|
+
enabled: z.boolean(),
|
|
1134
|
+
}),
|
|
1135
|
+
annotations: writeAnnotations,
|
|
1136
|
+
execute: async ({ device_id, enabled }) => backend.setDnd(device_id, enabled),
|
|
1137
|
+
}),
|
|
1138
|
+
define({
|
|
1139
|
+
name: "update_device",
|
|
1140
|
+
description: `${changeWarning} update DND and/or the emergency address for an owned device. Returns before/after state.`,
|
|
1141
|
+
schema: z.object({
|
|
1142
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
1143
|
+
dnd: z.boolean().optional(),
|
|
1144
|
+
emergency_address_id: int32Id.optional().describe("Address ID returned by list_addresses"),
|
|
1145
|
+
}),
|
|
1146
|
+
annotations: writeAnnotations,
|
|
1147
|
+
execute: async ({ device_id, dnd, emergency_address_id }) => backend.updateDevice(device_id, {
|
|
1148
|
+
...(dnd === undefined ? {} : { dnd }),
|
|
1149
|
+
...(emergency_address_id === undefined ? {} : { emergencyAddressId: emergency_address_id }),
|
|
1150
|
+
}),
|
|
1151
|
+
}),
|
|
1152
|
+
define({
|
|
1153
|
+
name: "delete_device",
|
|
1154
|
+
description: `${changeWarning} permanently delete an owned device. Returns the previous device and an explicit deletion marker.`,
|
|
1155
|
+
schema: z.object({ device_id: id.describe("Device ID returned by list_devices") }),
|
|
1156
|
+
annotations: writeAnnotations,
|
|
1157
|
+
execute: async ({ device_id }) => backend.deleteDevice(device_id),
|
|
1158
|
+
}),
|
|
1159
|
+
define({
|
|
1160
|
+
name: "set_device_alias",
|
|
1161
|
+
description: `${changeWarning} update the alias of an owned device. Returns before/after device state.`,
|
|
1162
|
+
schema: z.object({
|
|
1163
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
1164
|
+
value: swaggerString.optional().describe("New device alias"),
|
|
1165
|
+
}),
|
|
1166
|
+
annotations: writeAnnotations,
|
|
1167
|
+
execute: async ({ device_id, value }) => backend.setDeviceAlias(device_id, value),
|
|
1168
|
+
}),
|
|
1169
|
+
define({
|
|
1170
|
+
name: "set_device_caller_id",
|
|
1171
|
+
description: `${changeWarning} update the caller ID of an owned device to one of the authenticated user's owned numbers. Returns before/after state.`,
|
|
1172
|
+
schema: z.object({
|
|
1173
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
1174
|
+
value: swaggerString.optional().describe("Caller ID value accepted by sipgate"),
|
|
1175
|
+
}),
|
|
1176
|
+
annotations: writeAnnotations,
|
|
1177
|
+
execute: async ({ device_id, value }) => backend.setDeviceCallerId(device_id, value),
|
|
1178
|
+
}),
|
|
1179
|
+
define({
|
|
1180
|
+
name: "set_device_local_prefix",
|
|
1181
|
+
description: `${changeWarning} update automatic local-area-code handling for an owned device. Returns before/after state.`,
|
|
1182
|
+
schema: z.object({
|
|
1183
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
1184
|
+
active: z.boolean().optional(),
|
|
1185
|
+
value: swaggerString.optional().describe("Local prefix, for example 030"),
|
|
1186
|
+
}),
|
|
1187
|
+
annotations: writeAnnotations,
|
|
1188
|
+
execute: async ({ device_id, active, value }) => backend.setDeviceLocalPrefix(device_id, {
|
|
1189
|
+
...(active === undefined ? {} : { active }),
|
|
1190
|
+
...(value === undefined ? {} : { value }),
|
|
1191
|
+
}),
|
|
1192
|
+
}),
|
|
1193
|
+
define({
|
|
1194
|
+
name: "set_device_tariff_announcement",
|
|
1195
|
+
description: `${changeWarning} update the tariff-announcement setting for an owned device. Returns before/after state.`,
|
|
1196
|
+
schema: z.object({
|
|
1197
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
1198
|
+
enabled: z.boolean().optional(),
|
|
1199
|
+
}),
|
|
1200
|
+
annotations: writeAnnotations,
|
|
1201
|
+
execute: async ({ device_id, enabled }) => backend.setDeviceTariffAnnouncement(device_id, enabled),
|
|
1202
|
+
}),
|
|
1203
|
+
define({
|
|
1204
|
+
name: "set_device_single_row_display",
|
|
1205
|
+
description: `${changeWarning} update the single-row display setting for an owned device. Returns before/after state.`,
|
|
1206
|
+
schema: z.object({
|
|
1207
|
+
device_id: id.describe("Device ID returned by list_devices"),
|
|
1208
|
+
enabled: z.boolean().optional(),
|
|
1209
|
+
}),
|
|
1210
|
+
annotations: writeAnnotations,
|
|
1211
|
+
execute: async ({ device_id, enabled }) => backend.setDeviceSingleRowDisplay(device_id, enabled),
|
|
1212
|
+
}),
|
|
1213
|
+
define({
|
|
1214
|
+
name: "set_external_device_target_number",
|
|
1215
|
+
description: `${changeWarning} update the target phone number of an owned external device. Returns before/after device state.`,
|
|
1216
|
+
schema: z.object({
|
|
1217
|
+
device_id: id.describe("External device ID returned by list_devices"),
|
|
1218
|
+
number: swaggerString.optional().describe("External target phone number"),
|
|
1219
|
+
}),
|
|
1220
|
+
annotations: writeAnnotations,
|
|
1221
|
+
execute: async ({ device_id, number }) => backend.setExternalDeviceTargetNumber(device_id, number),
|
|
1222
|
+
}),
|
|
1223
|
+
define({
|
|
1224
|
+
name: "set_external_device_incoming_call_display",
|
|
1225
|
+
description: `${changeWarning} choose whether an owned external device sees the called or caller number. Returns before/after device state.`,
|
|
1226
|
+
schema: z.object({
|
|
1227
|
+
device_id: id.describe("External device ID returned by list_devices"),
|
|
1228
|
+
incoming_call_display: z.enum(["CALLED_NUMBER", "CALLER_NUMBER"]),
|
|
1229
|
+
}),
|
|
1230
|
+
annotations: writeAnnotations,
|
|
1231
|
+
execute: async ({ device_id, incoming_call_display }) => backend.setExternalDeviceIncomingCallDisplay(device_id, incoming_call_display),
|
|
1232
|
+
}),
|
|
1233
|
+
define({
|
|
1234
|
+
name: "change_device_password",
|
|
1235
|
+
description: `${changeWarning} rotate an owned register device's SIP password. The returned credential is always redacted.`,
|
|
1236
|
+
schema: z.object({ device_id: id.describe("Register device ID returned by list_devices") }),
|
|
1237
|
+
annotations: actionAnnotations,
|
|
1238
|
+
execute: async ({ device_id }) => backend.changeDevicePassword(device_id),
|
|
1239
|
+
}),
|
|
1240
|
+
define({
|
|
1241
|
+
name: "create_register_device",
|
|
1242
|
+
description: `${changeWarning} create a SIP register device; device creation may affect billing. Returns the sanitized initial device state.`,
|
|
1243
|
+
schema: z.object({
|
|
1244
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1245
|
+
alias: swaggerString.optional(),
|
|
1246
|
+
}),
|
|
1247
|
+
annotations: actionAnnotations,
|
|
1248
|
+
execute: async ({ user_id, alias }) => backend.createRegisterDevice(user_id, alias),
|
|
1249
|
+
}),
|
|
1250
|
+
define({
|
|
1251
|
+
name: "create_mobile_device",
|
|
1252
|
+
description: `${changeWarning} create a mobile device; device or SIM provisioning may affect billing. Returns the sanitized initial device state.`,
|
|
1253
|
+
schema: z.object({
|
|
1254
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1255
|
+
alias: swaggerString.optional(),
|
|
1256
|
+
}),
|
|
1257
|
+
annotations: actionAnnotations,
|
|
1258
|
+
execute: async ({ user_id, alias }) => backend.createMobileDevice(user_id, alias),
|
|
1259
|
+
}),
|
|
1260
|
+
define({
|
|
1261
|
+
name: "create_external_device",
|
|
1262
|
+
description: `${changeWarning} create an external device; device provisioning or calls may affect billing. Returns the sanitized initial device state.`,
|
|
1263
|
+
schema: z.object({
|
|
1264
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1265
|
+
alias: swaggerString.optional(),
|
|
1266
|
+
number: swaggerString.optional().describe("External target phone number"),
|
|
1267
|
+
}),
|
|
1268
|
+
annotations: actionAnnotations,
|
|
1269
|
+
execute: async ({ user_id, alias, number }) => backend.createExternalDevice(user_id, alias, number),
|
|
1270
|
+
}),
|
|
1271
|
+
define({
|
|
1272
|
+
name: "create_quick_dial",
|
|
1273
|
+
description: `${changeWarning} create a quick-dial number for a sipgate user. The API has no documented read-back response.`,
|
|
1274
|
+
schema: z.object({
|
|
1275
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1276
|
+
number: swaggerString.optional().describe("Quick-dial number"),
|
|
1277
|
+
}),
|
|
1278
|
+
annotations: actionAnnotations,
|
|
1279
|
+
execute: async ({ user_id, number }) => backend.createQuickDial({
|
|
1280
|
+
userId: user_id,
|
|
1281
|
+
...(number === undefined ? {} : { number }),
|
|
1282
|
+
}),
|
|
1283
|
+
}),
|
|
1284
|
+
define({
|
|
1285
|
+
name: "update_quick_dial",
|
|
1286
|
+
description: `${changeWarning} update an owned quick-dial number and its assigned user. Returns before/after state.`,
|
|
1287
|
+
schema: z.object({
|
|
1288
|
+
quick_dial_id: id.describe("Quick-dial ID returned by list_user_numbers or list_numbers"),
|
|
1289
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1290
|
+
number: swaggerString.optional().describe("Quick-dial number"),
|
|
1291
|
+
}),
|
|
1292
|
+
annotations: writeAnnotations,
|
|
1293
|
+
execute: async ({ quick_dial_id, user_id, number }) => backend.updateQuickDial(quick_dial_id, {
|
|
1294
|
+
userId: user_id,
|
|
1295
|
+
...(number === undefined ? {} : { number }),
|
|
1296
|
+
}),
|
|
1297
|
+
}),
|
|
1298
|
+
define({
|
|
1299
|
+
name: "delete_quick_dial",
|
|
1300
|
+
description: `${changeWarning} permanently delete an owned quick-dial number. Returns its previous state and a deletion marker.`,
|
|
1301
|
+
schema: z.object({ number_id: id.describe("Quick-dial number ID") }),
|
|
1302
|
+
annotations: writeAnnotations,
|
|
1303
|
+
execute: async ({ number_id }) => backend.deleteQuickDial(number_id),
|
|
1304
|
+
}),
|
|
1305
|
+
define({
|
|
1306
|
+
name: "update_address",
|
|
1307
|
+
description: `${changeWarning} update an owned emergency address. Depending on the country, this may deactivate associated phone numbers. Returns before/after state.`,
|
|
1308
|
+
schema: z.object({
|
|
1309
|
+
address_id: int32Id.describe("Integer address ID returned by list_addresses"),
|
|
1310
|
+
city: swaggerString,
|
|
1311
|
+
countrycode: swaggerString,
|
|
1312
|
+
postcode: swaggerString,
|
|
1313
|
+
address1: swaggerString.optional(),
|
|
1314
|
+
address2: swaggerString.optional(),
|
|
1315
|
+
number: swaggerString.optional().describe("Street/house number, as named by sipgate's schema"),
|
|
1316
|
+
state: swaggerString.optional(),
|
|
1317
|
+
street: swaggerString.optional(),
|
|
1318
|
+
}),
|
|
1319
|
+
annotations: writeAnnotations,
|
|
1320
|
+
execute: async ({ address_id, city, countrycode, postcode, address1, address2, number, state, street, }) => backend.updateAddress(address_id, {
|
|
1321
|
+
city,
|
|
1322
|
+
countrycode,
|
|
1323
|
+
postcode,
|
|
1324
|
+
...(address1 === undefined ? {} : { address1 }),
|
|
1325
|
+
...(address2 === undefined ? {} : { address2 }),
|
|
1326
|
+
...(number === undefined ? {} : { number }),
|
|
1327
|
+
...(state === undefined ? {} : { state }),
|
|
1328
|
+
...(street === undefined ? {} : { street }),
|
|
1329
|
+
}),
|
|
1330
|
+
}),
|
|
1331
|
+
define({
|
|
1332
|
+
name: "send_sms",
|
|
1333
|
+
description: `${changeWarning} send an SMS after verifying an SMS-capable extension. Returns a before/after history snapshot; history can update asynchronously.`,
|
|
1334
|
+
schema: z.object({
|
|
1335
|
+
user_id: id.describe(userScoped
|
|
1336
|
+
? "Authenticated sipgate user ID; another user's ID is rejected"
|
|
1337
|
+
: "Owner of the SMS extension"),
|
|
1338
|
+
sms_id: id.optional().describe("SMS extension ID; the first available extension is used when omitted"),
|
|
1339
|
+
recipient: e164,
|
|
1340
|
+
message: z.string().min(1),
|
|
1341
|
+
send_at: z.int().min(0).optional().describe("Optional Unix timestamp in seconds"),
|
|
1342
|
+
}),
|
|
1343
|
+
annotations: actionAnnotations,
|
|
1344
|
+
execute: async ({ user_id, sms_id, recipient, message, send_at }) => backend.sendSms({
|
|
1345
|
+
userId: user_id,
|
|
1346
|
+
recipient,
|
|
1347
|
+
message,
|
|
1348
|
+
...(sms_id === undefined ? {} : { smsId: sms_id }),
|
|
1349
|
+
...(send_at === undefined ? {} : { sendAt: send_at }),
|
|
1350
|
+
}),
|
|
1351
|
+
}),
|
|
1352
|
+
define({
|
|
1353
|
+
name: "initiate_call",
|
|
1354
|
+
description: `${changeWarning} start a Click2Dial call from a verified device or phone number. Returns before/after call state and the new session.`,
|
|
1355
|
+
schema: z.object({
|
|
1356
|
+
caller: id.describe("sipgate device ID or caller phone number"),
|
|
1357
|
+
callee: e164,
|
|
1358
|
+
caller_id: e164.optional().describe("Optional number displayed to the callee"),
|
|
1359
|
+
device_id: id.optional().describe("Required by sipgate when caller is a phone number instead of a device ID"),
|
|
1360
|
+
}),
|
|
1361
|
+
annotations: actionAnnotations,
|
|
1362
|
+
execute: async ({ caller, callee, caller_id, device_id }) => backend.initiateCall({
|
|
1363
|
+
caller,
|
|
1364
|
+
callee,
|
|
1365
|
+
...(caller_id === undefined ? {} : { callerId: caller_id }),
|
|
1366
|
+
...(device_id === undefined ? {} : { deviceId: device_id }),
|
|
1367
|
+
}),
|
|
1368
|
+
}),
|
|
1369
|
+
define({
|
|
1370
|
+
name: "create_call_email_notification",
|
|
1371
|
+
description: `${changeWarning} create an email notification for calls on an owned endpoint. Returns the complete before/after notification state.`,
|
|
1372
|
+
schema: z.object({
|
|
1373
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1374
|
+
endpoint_id: id.describe("Owned device or phoneline ID"),
|
|
1375
|
+
cause: z.enum(["MISSED", "SUCCESSFUL"]),
|
|
1376
|
+
direction: z.enum(["INCOMING", "OUTGOING"]),
|
|
1377
|
+
email: swaggerString,
|
|
1378
|
+
}),
|
|
1379
|
+
annotations: actionAnnotations,
|
|
1380
|
+
execute: async ({ user_id, endpoint_id, cause, direction, email }) => backend.createCallEmailNotification({
|
|
1381
|
+
userId: user_id,
|
|
1382
|
+
endpointId: endpoint_id,
|
|
1383
|
+
cause,
|
|
1384
|
+
direction,
|
|
1385
|
+
email,
|
|
1386
|
+
}),
|
|
1387
|
+
}),
|
|
1388
|
+
define({
|
|
1389
|
+
name: "create_call_sms_notification",
|
|
1390
|
+
description: `${changeWarning} create an SMS notification for calls on an owned endpoint. Returns the complete before/after notification state.`,
|
|
1391
|
+
schema: z.object({
|
|
1392
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1393
|
+
endpoint_id: id.describe("Owned device or phoneline ID"),
|
|
1394
|
+
cause: z.enum(["MISSED", "SUCCESSFUL"]),
|
|
1395
|
+
direction: z.enum(["INCOMING", "OUTGOING"]),
|
|
1396
|
+
number: e164,
|
|
1397
|
+
}),
|
|
1398
|
+
annotations: actionAnnotations,
|
|
1399
|
+
execute: async ({ user_id, endpoint_id, cause, direction, number }) => backend.createCallSmsNotification({
|
|
1400
|
+
userId: user_id,
|
|
1401
|
+
endpointId: endpoint_id,
|
|
1402
|
+
cause,
|
|
1403
|
+
direction,
|
|
1404
|
+
number,
|
|
1405
|
+
}),
|
|
1406
|
+
}),
|
|
1407
|
+
define({
|
|
1408
|
+
name: "create_fax_email_notification",
|
|
1409
|
+
description: `${changeWarning} create an email notification for incoming or outgoing faxes on an owned faxline. Returns before/after notification state.`,
|
|
1410
|
+
schema: z.object({
|
|
1411
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1412
|
+
faxline_id: id.describe("Faxline ID returned by list_faxlines"),
|
|
1413
|
+
direction: z.enum(["INCOMING", "OUTGOING"]),
|
|
1414
|
+
email: swaggerString,
|
|
1415
|
+
}),
|
|
1416
|
+
annotations: actionAnnotations,
|
|
1417
|
+
execute: async ({ user_id, faxline_id, direction, email }) => backend.createFaxEmailNotification({
|
|
1418
|
+
userId: user_id,
|
|
1419
|
+
faxlineId: faxline_id,
|
|
1420
|
+
direction,
|
|
1421
|
+
email,
|
|
1422
|
+
}),
|
|
1423
|
+
}),
|
|
1424
|
+
define({
|
|
1425
|
+
name: "create_fax_sms_notification",
|
|
1426
|
+
description: `${changeWarning} create an SMS notification for incoming or outgoing faxes on an owned faxline. Returns before/after notification state.`,
|
|
1427
|
+
schema: z.object({
|
|
1428
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1429
|
+
faxline_id: id.describe("Faxline ID returned by list_faxlines"),
|
|
1430
|
+
direction: z.enum(["INCOMING", "OUTGOING"]),
|
|
1431
|
+
number: e164,
|
|
1432
|
+
}),
|
|
1433
|
+
annotations: actionAnnotations,
|
|
1434
|
+
execute: async ({ user_id, faxline_id, direction, number }) => backend.createFaxSmsNotification({
|
|
1435
|
+
userId: user_id,
|
|
1436
|
+
faxlineId: faxline_id,
|
|
1437
|
+
direction,
|
|
1438
|
+
number,
|
|
1439
|
+
}),
|
|
1440
|
+
}),
|
|
1441
|
+
define({
|
|
1442
|
+
name: "create_fax_report_notification",
|
|
1443
|
+
description: `${changeWarning} create an email delivery-report notification for an owned faxline. Returns before/after notification state.`,
|
|
1444
|
+
schema: z.object({
|
|
1445
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1446
|
+
faxline_id: id.describe("Faxline ID returned by list_faxlines"),
|
|
1447
|
+
email: swaggerString,
|
|
1448
|
+
}),
|
|
1449
|
+
annotations: actionAnnotations,
|
|
1450
|
+
execute: async ({ user_id, faxline_id, email }) => backend.createFaxReportNotification({
|
|
1451
|
+
userId: user_id,
|
|
1452
|
+
faxlineId: faxline_id,
|
|
1453
|
+
email,
|
|
1454
|
+
}),
|
|
1455
|
+
}),
|
|
1456
|
+
define({
|
|
1457
|
+
name: "create_sms_email_notification",
|
|
1458
|
+
description: `${changeWarning} create an email notification for incoming SMS on a user SMS endpoint. Returns before/after notification state.`,
|
|
1459
|
+
schema: z.object({
|
|
1460
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1461
|
+
endpoint_id: id.describe("SMS endpoint ID, for example y0"),
|
|
1462
|
+
email: swaggerString,
|
|
1463
|
+
}),
|
|
1464
|
+
annotations: actionAnnotations,
|
|
1465
|
+
execute: async ({ user_id, endpoint_id, email }) => backend.createSmsEmailNotification({
|
|
1466
|
+
userId: user_id,
|
|
1467
|
+
endpointId: endpoint_id,
|
|
1468
|
+
email,
|
|
1469
|
+
}),
|
|
1470
|
+
}),
|
|
1471
|
+
define({
|
|
1472
|
+
name: "create_voicemail_email_notification",
|
|
1473
|
+
description: `${changeWarning} create an email notification for a user voicemail. Returns before/after notification state.`,
|
|
1474
|
+
schema: z.object({
|
|
1475
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1476
|
+
voicemail_id: id.describe("Voicemail ID, for example v0"),
|
|
1477
|
+
email: swaggerString,
|
|
1478
|
+
}),
|
|
1479
|
+
annotations: actionAnnotations,
|
|
1480
|
+
execute: async ({ user_id, voicemail_id, email }) => backend.createVoicemailEmailNotification({
|
|
1481
|
+
userId: user_id,
|
|
1482
|
+
voicemailId: voicemail_id,
|
|
1483
|
+
email,
|
|
1484
|
+
}),
|
|
1485
|
+
}),
|
|
1486
|
+
define({
|
|
1487
|
+
name: "create_voicemail_sms_notification",
|
|
1488
|
+
description: `${changeWarning} create an SMS notification for a user voicemail. Returns before/after notification state.`,
|
|
1489
|
+
schema: z.object({
|
|
1490
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1491
|
+
voicemail_id: id.describe("Voicemail ID, for example v0"),
|
|
1492
|
+
number: e164,
|
|
1493
|
+
}),
|
|
1494
|
+
annotations: actionAnnotations,
|
|
1495
|
+
execute: async ({ user_id, voicemail_id, number }) => backend.createVoicemailSmsNotification({
|
|
1496
|
+
userId: user_id,
|
|
1497
|
+
voicemailId: voicemail_id,
|
|
1498
|
+
number,
|
|
1499
|
+
}),
|
|
1500
|
+
}),
|
|
1501
|
+
define({
|
|
1502
|
+
name: "delete_notification",
|
|
1503
|
+
description: `${changeWarning} delete a notification after verifying that its nested notification ID belongs to the selected user. Returns before/after notification state.`,
|
|
1504
|
+
schema: z.object({
|
|
1505
|
+
user_id: id.describe(userScoped ? "Authenticated sipgate user ID" : "Owner user ID"),
|
|
1506
|
+
notification_id: id.describe("Notification target ID returned by list_notifications"),
|
|
1507
|
+
}),
|
|
1508
|
+
annotations: writeAnnotations,
|
|
1509
|
+
execute: async ({ user_id, notification_id }) => backend.deleteNotification(user_id, notification_id),
|
|
1510
|
+
}),
|
|
1511
|
+
define({
|
|
1512
|
+
name: "hangup_call",
|
|
1513
|
+
description: `${changeWarning} hang up an established call after verifying participant ownership. Returns the call before the hangup and its post-operation state.`,
|
|
1514
|
+
schema: z.object({ call_id: id.describe("Call ID returned by list_calls") }),
|
|
1515
|
+
annotations: writeAnnotations,
|
|
1516
|
+
execute: async ({ call_id }) => backend.hangupCall(call_id),
|
|
1517
|
+
}),
|
|
1518
|
+
define({
|
|
1519
|
+
name: "set_call_hold",
|
|
1520
|
+
description: `${changeWarning} hold or resume all participants in an owned established call. Returns before/after call state.`,
|
|
1521
|
+
schema: z.object({
|
|
1522
|
+
call_id: id.describe("Call ID returned by list_calls"),
|
|
1523
|
+
value: z.boolean().describe("true to hold; false to resume"),
|
|
1524
|
+
}),
|
|
1525
|
+
annotations: writeAnnotations,
|
|
1526
|
+
execute: async ({ call_id, value }) => backend.setCallHold(call_id, value),
|
|
1527
|
+
}),
|
|
1528
|
+
define({
|
|
1529
|
+
name: "set_call_muted",
|
|
1530
|
+
description: `${changeWarning} mute or unmute yourself in an owned established call. sipgate does not support this for Neo PBX accounts. Returns before/after call state.`,
|
|
1531
|
+
schema: z.object({
|
|
1532
|
+
call_id: id.describe("Call ID returned by list_calls"),
|
|
1533
|
+
value: z.boolean().describe("true to mute; false to unmute"),
|
|
1534
|
+
}),
|
|
1535
|
+
annotations: writeAnnotations,
|
|
1536
|
+
execute: async ({ call_id, value }) => backend.setCallMuted(call_id, value),
|
|
1537
|
+
}),
|
|
1538
|
+
define({
|
|
1539
|
+
name: "set_call_recording",
|
|
1540
|
+
description: `${changeWarning} start or stop recording an owned call; recording may incur charges and is legally sensitive in Germany. The caller is responsible for obtaining every participant's consent. Returns before/after call state.`,
|
|
1541
|
+
schema: z.object({
|
|
1542
|
+
call_id: id.describe("Call ID returned by list_calls"),
|
|
1543
|
+
value: z.boolean().describe("true to start; false to stop recording"),
|
|
1544
|
+
announcement: z.boolean().optional()
|
|
1545
|
+
.describe("Whether sipgate announces recording start/stop; defaults to sipgate's true setting"),
|
|
1546
|
+
}),
|
|
1547
|
+
annotations: writeAnnotations,
|
|
1548
|
+
execute: async ({ call_id, value, announcement }) => backend.setCallRecording(call_id, value, announcement),
|
|
1549
|
+
}),
|
|
1550
|
+
define({
|
|
1551
|
+
name: "transfer_call",
|
|
1552
|
+
description: `${changeWarning} transfer an owned established call to another phone number. Returns before/after call state.`,
|
|
1553
|
+
schema: z.object({
|
|
1554
|
+
call_id: id.describe("Call ID returned by list_calls"),
|
|
1555
|
+
attended: z.boolean().describe("true for attended; false for blind transfer"),
|
|
1556
|
+
phone_number: dialString.describe("Transfer target phone number"),
|
|
1557
|
+
caller_id: e164.optional().describe("Optional owned caller ID for the transfer"),
|
|
1558
|
+
}),
|
|
1559
|
+
annotations: actionAnnotations,
|
|
1560
|
+
execute: async ({ call_id, attended, phone_number, caller_id }) => backend.transferCall(call_id, {
|
|
1561
|
+
attended,
|
|
1562
|
+
phoneNumber: phone_number,
|
|
1563
|
+
...(caller_id === undefined ? {} : { callerId: caller_id }),
|
|
1564
|
+
}),
|
|
1565
|
+
}),
|
|
1566
|
+
define({
|
|
1567
|
+
name: "send_call_dtmf",
|
|
1568
|
+
description: `${changeWarning} send a DTMF sequence to every participant in an owned established call. Returns before/after call state.`,
|
|
1569
|
+
schema: z.object({
|
|
1570
|
+
call_id: id.describe("Call ID returned by list_calls"),
|
|
1571
|
+
sequence: swaggerString.describe("DTMF sequence, for example 123456"),
|
|
1572
|
+
}),
|
|
1573
|
+
annotations: actionAnnotations,
|
|
1574
|
+
execute: async ({ call_id, sequence }) => backend.sendCallDtmf(call_id, sequence),
|
|
1575
|
+
}),
|
|
1576
|
+
define({
|
|
1577
|
+
name: "start_call_announcement",
|
|
1578
|
+
description: `${changeWarning} play a mono 16-bit PCM WAV announcement at 8 kHz to all participants in an owned call. sipgate does not support this for Neo PBX accounts. Returns before/after call state.`,
|
|
1579
|
+
schema: z.object({
|
|
1580
|
+
call_id: id.describe("Call ID returned by list_calls"),
|
|
1581
|
+
url: swaggerString.describe("Public URL of the announcement WAV file"),
|
|
1582
|
+
}),
|
|
1583
|
+
annotations: actionAnnotations,
|
|
1584
|
+
execute: async ({ call_id, url }) => backend.startCallAnnouncement(call_id, url),
|
|
1585
|
+
}),
|
|
1586
|
+
define({
|
|
1587
|
+
name: "send_fax",
|
|
1588
|
+
description: `${changeWarning} send a PDF fax from an owned faxline. SENDING A FAX INCURS CHARGES. The API has no synchronous fax-state read-back, so before is null and after includes the session response and an explicit note.`,
|
|
1589
|
+
schema: z.object({
|
|
1590
|
+
faxline_id: id.describe("Faxline ID returned by list_faxlines"),
|
|
1591
|
+
recipient: dialString,
|
|
1592
|
+
filename: swaggerString.describe("Fax document filename, for example fax.pdf"),
|
|
1593
|
+
base64_content: z.string().max(28_330_000)
|
|
1594
|
+
.describe("Base64-encoded PDF content; sipgate's maximum is 28,330,000 characters"),
|
|
1595
|
+
}),
|
|
1596
|
+
annotations: actionAnnotations,
|
|
1597
|
+
execute: async ({ faxline_id, recipient, filename, base64_content }) => backend.sendFax({
|
|
1598
|
+
faxlineId: faxline_id,
|
|
1599
|
+
recipient,
|
|
1600
|
+
filename,
|
|
1601
|
+
base64Content: base64_content,
|
|
1602
|
+
}),
|
|
1603
|
+
}),
|
|
1604
|
+
define({
|
|
1605
|
+
name: "resend_fax",
|
|
1606
|
+
description: `${changeWarning} resend an existing fax. RESENDING A FAX INCURS CHARGES. User scope requires an owned faxline ID so ownership can be established; before is null because sipgate exposes no fax-session read-back here.`,
|
|
1607
|
+
schema: z.object({
|
|
1608
|
+
fax_id: id.describe("Fax ID to resend"),
|
|
1609
|
+
faxline_id: (userScoped ? id : id.optional()).describe(userScoped
|
|
1610
|
+
? "Required owned faxline ID returned by list_faxlines"
|
|
1611
|
+
: "Optional faxline ID; sipgate otherwise reuses the original faxline"),
|
|
1612
|
+
}),
|
|
1613
|
+
annotations: actionAnnotations,
|
|
1614
|
+
execute: async ({ fax_id, faxline_id }) => backend.resendFax({
|
|
1615
|
+
faxId: fax_id,
|
|
1616
|
+
...(faxline_id === undefined ? {} : { faxlineId: faxline_id }),
|
|
222
1617
|
}),
|
|
223
1618
|
}),
|
|
224
1619
|
];
|