v1.d.ts (24751B)
1 /** 2 * This file was auto-generated by openapi-typescript. 3 * Do not make direct changes to the file. 4 */ 5 6 export interface paths { 7 "/1/appservice/get/{bot_id}": { 8 parameters: { 9 query?: never; 10 header?: never; 11 path?: never; 12 cookie?: never; 13 }; 14 /** Get information about the bot */ 15 get: operations["getBotInfo"]; 16 put?: never; 17 post?: never; 18 delete?: never; 19 options?: never; 20 head?: never; 21 patch?: never; 22 trace?: never; 23 }; 24 "/1/appservice/list": { 25 parameters: { 26 query?: never; 27 header?: never; 28 path?: never; 29 cookie?: never; 30 }; 31 /** Get Bots for the requesting user */ 32 get: operations["listBots"]; 33 put?: never; 34 post?: never; 35 delete?: never; 36 options?: never; 37 head?: never; 38 patch?: never; 39 trace?: never; 40 }; 41 "/1/appservice/provision": { 42 parameters: { 43 query?: never; 44 header?: never; 45 path?: never; 46 cookie?: never; 47 }; 48 get?: never; 49 put?: never; 50 /** Provision a bot */ 51 post: operations["provisionBot"]; 52 delete?: never; 53 options?: never; 54 head?: never; 55 patch?: never; 56 trace?: never; 57 }; 58 "/1/report/{room_id}/{event_id}": { 59 parameters: { 60 query?: never; 61 header?: never; 62 path?: never; 63 cookie?: never; 64 }; 65 get?: never; 66 put?: never; 67 /** Send a report to draupnir */ 68 post: operations["messageReports"]; 69 delete?: never; 70 options?: never; 71 head?: never; 72 patch?: never; 73 trace?: never; 74 }; 75 "/1/spam_check/user_may_invite": { 76 parameters: { 77 query?: never; 78 header?: never; 79 path?: never; 80 cookie?: never; 81 }; 82 get?: never; 83 put?: never; 84 /** Check if a user is allowed to invite */ 85 post: operations["usersMayInvite"]; 86 delete?: never; 87 options?: never; 88 head?: never; 89 patch?: never; 90 trace?: never; 91 }; 92 "/1/spam_check/user_may_join_room": { 93 parameters: { 94 query?: never; 95 header?: never; 96 path?: never; 97 cookie?: never; 98 }; 99 get?: never; 100 put?: never; 101 /** Check if a user is allowed to join a room */ 102 post: operations["userMayJoinRoom"]; 103 delete?: never; 104 options?: never; 105 head?: never; 106 patch?: never; 107 trace?: never; 108 }; 109 "/1/spam_check/check_event_for_spam": { 110 parameters: { 111 query?: never; 112 header?: never; 113 path?: never; 114 cookie?: never; 115 }; 116 get?: never; 117 put?: never; 118 /** Check if an event is spam */ 119 post: operations["CheckEventForSpam"]; 120 delete?: never; 121 options?: never; 122 head?: never; 123 patch?: never; 124 trace?: never; 125 }; 126 } 127 export type webhooks = Record<string, never>; 128 export interface components { 129 schemas: { 130 /** 131 * @example Missing access token 132 * @enum {string} 133 */ 134 BotUnauthenticatedError: "Missing access token"; 135 }; 136 responses: never; 137 parameters: { 138 /** 139 * @description The user ID of the openID user. This must match the matrix id of the user that created the openid token. 140 * @example @example:example.com 141 */ 142 DraupnirUserID: string; 143 }; 144 requestBodies: never; 145 headers: never; 146 pathItems: never; 147 } 148 export type $defs = Record<string, never>; 149 export interface operations { 150 getBotInfo: { 151 parameters: { 152 query?: never; 153 header: { 154 /** 155 * @description The user ID of the openID user. This must match the matrix id of the user that created the openid token. 156 * @example @example:example.com 157 */ 158 "X-Draupnir-UserID": components["parameters"]["DraupnirUserID"]; 159 }; 160 path: { 161 /** 162 * @description The ID of the bot to get information about 163 * @example @example:example.com 164 */ 165 bot_id: string; 166 }; 167 cookie?: never; 168 }; 169 requestBody?: never; 170 responses: { 171 /** @description The request was successful, and the server has returned the requested resource in the response body. */ 172 200: { 173 headers: { 174 [name: string]: unknown; 175 }; 176 content: { 177 "application/json": { 178 /** @example !example:example.com */ 179 managementRoom: string; 180 /** @example @example:example.com */ 181 ownerId: string; 182 /** @example Example Bot */ 183 displayName: string; 184 }; 185 }; 186 }; 187 /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ 188 400: { 189 headers: { 190 [name: string]: unknown; 191 }; 192 content: { 193 "application/json": { 194 /** @enum {string} */ 195 errcode: "M_MISSING_PARAM" | "M_INVALID_PARAM"; 196 /** 197 * @example Invalid user ID 198 * @enum {string} 199 */ 200 error: "Invalid user ID" | "Missing X-Draupnir-UserID header" | "Missing bot ID" | "Invalid bot ID"; 201 }; 202 }; 203 }; 204 /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ 205 401: { 206 headers: { 207 [name: string]: unknown; 208 }; 209 content: { 210 "application/json": { 211 /** @enum {string} */ 212 errcode: "M_MISSING_TOKEN"; 213 /** 214 * @example Missing access token 215 * @enum {string} 216 */ 217 error: "Missing access token" | "Missing or invalid openid token" | "User ID does not match the one in the header"; 218 }; 219 }; 220 }; 221 /** @description The requested bot was not found on the server. The client should check the bot ID and try again. */ 222 404: { 223 headers: { 224 [name: string]: unknown; 225 }; 226 content: { 227 "application/json": { 228 /** @enum {string} */ 229 errcode: "M_NOT_FOUND"; 230 /** 231 * @example Bot not found 232 * @enum {string} 233 */ 234 error: "Bot not found"; 235 }; 236 }; 237 }; 238 /** @description The server is unable to handle the request. Possibly due to a misconfiguration. Are you sure this is an appservice draupnir? */ 239 503: { 240 headers: { 241 [name: string]: unknown; 242 }; 243 content: { 244 "application/json": { 245 /** @enum {string} */ 246 errcode: "M_NOT_CONFIGURED"; 247 /** 248 * @example Appservice manager not configured 249 * @enum {string} 250 */ 251 error: "Appservice manager not configured"; 252 }; 253 }; 254 }; 255 }; 256 }; 257 listBots: { 258 parameters: { 259 query?: { 260 /** @description Whether to only return bots owned by the user */ 261 onlyOwner?: boolean; 262 }; 263 header: { 264 /** 265 * @description The user ID of the openID user. This must match the matrix id of the user that created the openid token. 266 * @example @example:example.com 267 */ 268 "X-Draupnir-UserID": components["parameters"]["DraupnirUserID"]; 269 }; 270 path?: never; 271 cookie?: never; 272 }; 273 requestBody?: never; 274 responses: { 275 /** @description The request was successful, and the server has returned the requested resource in the response body. */ 276 200: { 277 headers: { 278 [name: string]: unknown; 279 }; 280 content: { 281 "application/json": { 282 bots: { 283 /** @example @example:example.com */ 284 id: string; 285 /** @example !example:example.com */ 286 managementRoom: string; 287 /** @example @example:example.com */ 288 ownerID: string; 289 /** @example Example Bot */ 290 displayName: string; 291 protectedRooms: { 292 /** @example !example:example.com */ 293 room: string; 294 /** @example Example Room */ 295 displayName?: string; 296 }[]; 297 subscribedLists: string[]; 298 }[]; 299 }; 300 }; 301 }; 302 /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ 303 400: { 304 headers: { 305 [name: string]: unknown; 306 }; 307 content: { 308 "application/json": { 309 /** @enum {string} */ 310 errcode: "M_INVALID_PARAM"; 311 /** 312 * @example Invalid user ID 313 * @enum {string} 314 */ 315 error: "Invalid user ID" | "Missing X-Draupnir-UserID header"; 316 }; 317 }; 318 }; 319 /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ 320 401: { 321 headers: { 322 [name: string]: unknown; 323 }; 324 content: { 325 "application/json": { 326 /** @enum {string} */ 327 errcode: "M_MISSING_TOKEN"; 328 /** 329 * @example Missing access token 330 * @enum {string} 331 */ 332 error: "Missing access token" | "Missing or invalid openid token" | "User ID does not match the one in the header"; 333 }; 334 }; 335 }; 336 /** @description The server is unable to handle the request. Possibly due to a misconfiguration. Are you sure this is an appservice draupnir? */ 337 503: { 338 headers: { 339 [name: string]: unknown; 340 }; 341 content: { 342 "application/json": { 343 /** @enum {string} */ 344 errcode: "M_NOT_CONFIGURED"; 345 /** 346 * @example Appservice manager not configured 347 * @enum {string} 348 */ 349 error: "Appservice manager not configured"; 350 }; 351 }; 352 }; 353 }; 354 }; 355 provisionBot: { 356 parameters: { 357 query?: never; 358 header: { 359 /** 360 * @description The user ID of the openID user. This must match the matrix id of the user that created the openid token. 361 * @example @example:example.com 362 */ 363 "X-Draupnir-UserID": components["parameters"]["DraupnirUserID"]; 364 }; 365 path?: never; 366 cookie?: never; 367 }; 368 requestBody?: { 369 content: { 370 "application/json": { 371 protectedRooms?: string[]; 372 }; 373 }; 374 }; 375 responses: { 376 /** @description The request was successful, and the server has returned the requested resource in the response body. */ 377 200: { 378 headers: { 379 [name: string]: unknown; 380 }; 381 content: { 382 "application/json": { 383 /** @example !example:example.com */ 384 managementRoom: string; 385 /** @example @example:example.com */ 386 botID?: string; 387 /** @example @example:example.com */ 388 ownerID: string; 389 }; 390 }; 391 }; 392 /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ 393 400: { 394 headers: { 395 [name: string]: unknown; 396 }; 397 content: { 398 "application/json": { 399 /** @enum {string} */ 400 errcode: "M_INVALID_PARAM"; 401 /** 402 * @example Invalid user ID 403 * @enum {string} 404 */ 405 error: "Invalid user ID" | "Missing X-Draupnir-UserID header"; 406 /** @description Invalid room IDs */ 407 invalidIDs?: string[]; 408 /** @description Rooms which draupnir failed to join or protect */ 409 failedIDs?: string[]; 410 }; 411 }; 412 }; 413 /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ 414 401: { 415 headers: { 416 [name: string]: unknown; 417 }; 418 content: { 419 "application/json": { 420 /** @enum {string} */ 421 errcode: "M_MISSING_TOKEN"; 422 /** 423 * @example Missing access token 424 * @enum {string} 425 */ 426 error: "Missing access token" | "Missing or invalid openid token" | "User ID does not match the one in the header"; 427 }; 428 }; 429 }; 430 /** @description The server is unable to handle the request. Possibly due to a misconfiguration. Are you sure this is an appservice draupnir? */ 431 503: { 432 headers: { 433 [name: string]: unknown; 434 }; 435 content: { 436 "application/json": { 437 /** @enum {string} */ 438 errcode: "M_NOT_CONFIGURED" | "M_INTERNAL_SERVER_ERROR" | "M_UNKNOWN"; 439 /** 440 * @example Appservice manager not configured 441 * @enum {string} 442 */ 443 error: "Appservice manager not configured" | "Failed to provision bot" | "Failed to protect rooms because draupnir is not running. Unable to continue."; 444 }; 445 }; 446 }; 447 }; 448 }; 449 messageReports: { 450 parameters: { 451 query?: never; 452 header?: never; 453 path: { 454 /** @description The room ID in which the reported event occurred */ 455 room_id: string; 456 /** @description The event ID of the event to report */ 457 event_id: string; 458 }; 459 cookie?: never; 460 }; 461 requestBody?: never; 462 responses: { 463 /** @description The request was successful, and the server has returned the requested resource in the response body. */ 464 200: { 465 headers: { 466 [name: string]: unknown; 467 }; 468 content: { 469 "application/json": Record<string, never>; 470 }; 471 }; 472 /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ 473 400: { 474 headers: { 475 [name: string]: unknown; 476 }; 477 content: { 478 "application/json": { 479 /** @example M_BAD_REQUEST */ 480 errcode?: string; 481 /** 482 * @example Invalid room ID 483 * @enum {string} 484 */ 485 error?: "Invalid room ID" | "Invalid event ID"; 486 }; 487 }; 488 }; 489 /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ 490 401: { 491 headers: { 492 [name: string]: unknown; 493 }; 494 content: { 495 "text/plain": components["schemas"]["BotUnauthenticatedError"]; 496 }; 497 }; 498 /** @description The server is currently unable to handle the request due to a temporary overload or maintenance of the server. */ 499 503: { 500 headers: { 501 [name: string]: unknown; 502 }; 503 content?: never; 504 }; 505 }; 506 }; 507 usersMayInvite: { 508 parameters: { 509 query?: never; 510 header?: never; 511 path?: never; 512 cookie?: never; 513 }; 514 requestBody?: { 515 content: { 516 "application/json": { 517 /** @description The user ID of the inviter */ 518 inviter: string; 519 /** @description The user ID of the invitee */ 520 invitee: string; 521 /** @description The room ID of the room */ 522 room_id: string; 523 }; 524 }; 525 }; 526 responses: { 527 /** @description The request was successful, and the server has returned the requested resource in the response body. */ 528 200: { 529 headers: { 530 [name: string]: unknown; 531 }; 532 content: { 533 "application/json": Record<string, never>; 534 }; 535 }; 536 /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ 537 400: { 538 headers: { 539 [name: string]: unknown; 540 }; 541 content: { 542 "application/json": { 543 /** @example M_INVALID_PARAM */ 544 errcode?: string; 545 /** 546 * @example Invalid room ID 547 * @enum {string} 548 */ 549 error?: "Error handling inviter, invitee, and room_id"; 550 }; 551 }; 552 }; 553 /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ 554 401: { 555 headers: { 556 [name: string]: unknown; 557 }; 558 content: { 559 "text/plain": components["schemas"]["BotUnauthenticatedError"]; 560 }; 561 }; 562 }; 563 }; 564 userMayJoinRoom: { 565 parameters: { 566 query?: never; 567 header?: never; 568 path?: never; 569 cookie?: never; 570 }; 571 requestBody?: { 572 content: { 573 "application/json": { 574 /** @description The user ID of the user joining the room */ 575 user: string; 576 /** @description The room ID of the room to join */ 577 room: string; 578 /** @description Whether the user is invited to the room */ 579 is_invited: boolean; 580 }; 581 }; 582 }; 583 responses: { 584 /** @description The request was successful, and the server has returned the requested resource in the response body. */ 585 200: { 586 headers: { 587 [name: string]: unknown; 588 }; 589 content: { 590 "application/json": Record<string, never>; 591 }; 592 }; 593 /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ 594 400: { 595 headers: { 596 [name: string]: unknown; 597 }; 598 content: { 599 "application/json": { 600 /** @example M_INVALID_PARAM */ 601 errcode?: string; 602 /** 603 * @example Invalid room ID 604 * @enum {string} 605 */ 606 error?: "Error handling user, room, and is_invited"; 607 }; 608 }; 609 }; 610 /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ 611 401: { 612 headers: { 613 [name: string]: unknown; 614 }; 615 content: { 616 "text/plain": components["schemas"]["BotUnauthenticatedError"]; 617 }; 618 }; 619 }; 620 }; 621 CheckEventForSpam: { 622 parameters: { 623 query?: never; 624 header?: never; 625 path?: never; 626 cookie?: never; 627 }; 628 requestBody?: { 629 content: { 630 "application/json": { 631 /** @description The event to check for spam */ 632 event: Record<string, never>; 633 }; 634 }; 635 }; 636 responses: { 637 /** @description The request was successful, and the server has returned the requested resource in the response body. */ 638 200: { 639 headers: { 640 [name: string]: unknown; 641 }; 642 content: { 643 "application/json": Record<string, never>; 644 }; 645 }; 646 /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ 647 400: { 648 headers: { 649 [name: string]: unknown; 650 }; 651 content: { 652 "application/json": { 653 /** @example M_INVALID_PARAM */ 654 errcode?: string; 655 /** 656 * @example Invalid room ID 657 * @enum {string} 658 */ 659 error?: "Error handling event"; 660 }; 661 }; 662 }; 663 /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ 664 401: { 665 headers: { 666 [name: string]: unknown; 667 }; 668 content: { 669 "text/plain": components["schemas"]["BotUnauthenticatedError"]; 670 }; 671 }; 672 }; 673 }; 674 }