@myronsi/messenger-api 2.1.0-alpha.14 → 2.1.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.14. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.15. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -2170,6 +2170,321 @@ export interface paths {
2170
2170
  patch?: never;
2171
2171
  trace?: never;
2172
2172
  };
2173
+ "/calls/config": {
2174
+ parameters: {
2175
+ query?: never;
2176
+ header?: {
2177
+ /** @description Version of the client app, for logs and the per-client metric. */
2178
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2179
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2180
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2181
+ };
2182
+ path?: never;
2183
+ cookie?: never;
2184
+ };
2185
+ /**
2186
+ * Whether audio calls are available and their limits
2187
+ * @description `enabled` is `false` when the server has no media service configured or calls are switched off; clients then
2188
+ * hide every call control. Clients must also check that the browser supports call encryption before offering
2189
+ * calls.
2190
+ */
2191
+ get: operations["getCallConfig"];
2192
+ put?: never;
2193
+ post?: never;
2194
+ delete?: never;
2195
+ options?: never;
2196
+ head?: never;
2197
+ patch?: never;
2198
+ trace?: never;
2199
+ };
2200
+ "/me/call-identity": {
2201
+ parameters: {
2202
+ query?: never;
2203
+ header?: {
2204
+ /** @description Version of the client app, for logs and the per-client metric. */
2205
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2206
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2207
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2208
+ };
2209
+ path?: never;
2210
+ cookie?: never;
2211
+ };
2212
+ get?: never;
2213
+ /**
2214
+ * Register this session's call identity public key
2215
+ * @description One key per session (see `docs/calls-e2ee.md`). Registering a different key replaces the old one; if the
2216
+ * session is in a call, the call's epoch increases. The private key never leaves the client.
2217
+ */
2218
+ put: operations["setCallIdentity"];
2219
+ post?: never;
2220
+ delete?: never;
2221
+ options?: never;
2222
+ head?: never;
2223
+ patch?: never;
2224
+ trace?: never;
2225
+ };
2226
+ "/calls": {
2227
+ parameters: {
2228
+ query?: never;
2229
+ header?: {
2230
+ /** @description Version of the client app, for logs and the per-client metric. */
2231
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2232
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2233
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2234
+ };
2235
+ path?: never;
2236
+ cookie?: never;
2237
+ };
2238
+ /**
2239
+ * Calls that are not over and involve the current user
2240
+ * @description Calls ringing the user and calls the user has joined, newest first. Clients load this after every
2241
+ * (re)connect, because realtime events are best effort.
2242
+ */
2243
+ get: operations["listMyCalls"];
2244
+ put?: never;
2245
+ post?: never;
2246
+ delete?: never;
2247
+ options?: never;
2248
+ head?: never;
2249
+ patch?: never;
2250
+ trace?: never;
2251
+ };
2252
+ "/chats/{chat_id}/call": {
2253
+ parameters: {
2254
+ query?: never;
2255
+ header?: {
2256
+ /** @description Version of the client app, for logs and the per-client metric. */
2257
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2258
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2259
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2260
+ };
2261
+ path: {
2262
+ chat_id: components["parameters"]["ChatId"];
2263
+ };
2264
+ cookie?: never;
2265
+ };
2266
+ /** The chat's call that is not over */
2267
+ get: operations["getChatCall"];
2268
+ put?: never;
2269
+ /**
2270
+ * Start a call in the chat, or get the one already running
2271
+ * @description Starts ringing the other members. A chat has at most one call that is not over: when one exists it is
2272
+ * returned with `200` and the client joins it instead. `client_request_id` makes retries idempotent for
2273
+ * 24 hours. Starting does not join: the caller then calls `POST /calls/{call_id}/join`.
2274
+ *
2275
+ * Refused with `403` (`calls_not_allowed`) when the peer of a direct chat has calls turned off or one user
2276
+ * blocked the other, `503` (`calls_unavailable`) when calls are off on the server.
2277
+ */
2278
+ post: operations["startChatCall"];
2279
+ delete?: never;
2280
+ options?: never;
2281
+ head?: never;
2282
+ patch?: never;
2283
+ trace?: never;
2284
+ };
2285
+ "/calls/{call_id}": {
2286
+ parameters: {
2287
+ query?: never;
2288
+ header?: {
2289
+ /** @description Version of the client app, for logs and the per-client metric. */
2290
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2291
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2292
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2293
+ };
2294
+ path: {
2295
+ call_id: components["parameters"]["CallId"];
2296
+ };
2297
+ cookie?: never;
2298
+ };
2299
+ /**
2300
+ * A call of one of the user's chats
2301
+ * @description Ended calls stay readable for 90 days.
2302
+ */
2303
+ get: operations["getCall"];
2304
+ put?: never;
2305
+ post?: never;
2306
+ delete?: never;
2307
+ options?: never;
2308
+ head?: never;
2309
+ patch?: never;
2310
+ trace?: never;
2311
+ };
2312
+ "/calls/{call_id}/join": {
2313
+ parameters: {
2314
+ query?: never;
2315
+ header?: {
2316
+ /** @description Version of the client app, for logs and the per-client metric. */
2317
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2318
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2319
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2320
+ };
2321
+ path: {
2322
+ call_id: components["parameters"]["CallId"];
2323
+ };
2324
+ cookie?: never;
2325
+ };
2326
+ get?: never;
2327
+ put?: never;
2328
+ /**
2329
+ * Answer or join a call with this session
2330
+ * @description Answers a ringing call or joins a running group call, and returns a short-lived media grant for this
2331
+ * session. The session must have a call identity (`422`, `call_identity_required`). A user is in at most one
2332
+ * call with one session: `409` (`already_in_call`) unless `takeover` is `true`, which moves the user's
2333
+ * participation to this session (the other session is removed from the media room). Other `409` codes:
2334
+ * `call_ended`, `call_full`. The epoch of the call increases. The body is optional: no body, an empty body
2335
+ * and `{}` all join without takeover.
2336
+ */
2337
+ post: operations["joinCall"];
2338
+ delete?: never;
2339
+ options?: never;
2340
+ head?: never;
2341
+ patch?: never;
2342
+ trace?: never;
2343
+ };
2344
+ "/calls/{call_id}/grant": {
2345
+ parameters: {
2346
+ query?: never;
2347
+ header?: {
2348
+ /** @description Version of the client app, for logs and the per-client metric. */
2349
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2350
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2351
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2352
+ };
2353
+ path: {
2354
+ call_id: components["parameters"]["CallId"];
2355
+ };
2356
+ cookie?: never;
2357
+ };
2358
+ get?: never;
2359
+ put?: never;
2360
+ /**
2361
+ * A fresh media grant for the session that joined
2362
+ * @description For reconnecting to the media server. Only the session that joined gets one (`409` otherwise).
2363
+ */
2364
+ post: operations["renewCallGrant"];
2365
+ delete?: never;
2366
+ options?: never;
2367
+ head?: never;
2368
+ patch?: never;
2369
+ trace?: never;
2370
+ };
2371
+ "/calls/{call_id}/decline": {
2372
+ parameters: {
2373
+ query?: never;
2374
+ header?: {
2375
+ /** @description Version of the client app, for logs and the per-client metric. */
2376
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2377
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2378
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2379
+ };
2380
+ path: {
2381
+ call_id: components["parameters"]["CallId"];
2382
+ };
2383
+ cookie?: never;
2384
+ };
2385
+ get?: never;
2386
+ put?: never;
2387
+ /**
2388
+ * Decline a ringing call
2389
+ * @description Stops the ringing on all of the user's devices. In a direct call this ends the call (`declined`); in a group
2390
+ * call only this user's invitation ends. Declining a call that no longer rings changes nothing.
2391
+ */
2392
+ post: operations["declineCall"];
2393
+ delete?: never;
2394
+ options?: never;
2395
+ head?: never;
2396
+ patch?: never;
2397
+ trace?: never;
2398
+ };
2399
+ "/calls/{call_id}/leave": {
2400
+ parameters: {
2401
+ query?: never;
2402
+ header?: {
2403
+ /** @description Version of the client app, for logs and the per-client metric. */
2404
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2405
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2406
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2407
+ };
2408
+ path: {
2409
+ call_id: components["parameters"]["CallId"];
2410
+ };
2411
+ cookie?: never;
2412
+ };
2413
+ get?: never;
2414
+ put?: never;
2415
+ /**
2416
+ * Leave the call
2417
+ * @description A direct call ends when either side leaves. A group call ends when the last participant has left and the
2418
+ * short reconnect grace has passed. The caller leaving a call nobody answered cancels it (`cancelled`).
2419
+ */
2420
+ post: operations["leaveCall"];
2421
+ delete?: never;
2422
+ options?: never;
2423
+ head?: never;
2424
+ patch?: never;
2425
+ trace?: never;
2426
+ };
2427
+ "/calls/{call_id}/end": {
2428
+ parameters: {
2429
+ query?: never;
2430
+ header?: {
2431
+ /** @description Version of the client app, for logs and the per-client metric. */
2432
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2433
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2434
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2435
+ };
2436
+ path: {
2437
+ call_id: components["parameters"]["CallId"];
2438
+ };
2439
+ cookie?: never;
2440
+ };
2441
+ get?: never;
2442
+ put?: never;
2443
+ /**
2444
+ * End the call for everyone
2445
+ * @description Allowed for the initiator, for both members of a direct call, and for the owner, admins and moderators of a
2446
+ * group (`403` otherwise). Everyone is removed from the media room.
2447
+ */
2448
+ post: operations["endCall"];
2449
+ delete?: never;
2450
+ options?: never;
2451
+ head?: never;
2452
+ patch?: never;
2453
+ trace?: never;
2454
+ };
2455
+ "/calls/{call_id}/keys": {
2456
+ parameters: {
2457
+ query?: never;
2458
+ header?: {
2459
+ /** @description Version of the client app, for logs and the per-client metric. */
2460
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2461
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2462
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2463
+ };
2464
+ path: {
2465
+ call_id: components["parameters"]["CallId"];
2466
+ };
2467
+ cookie?: never;
2468
+ };
2469
+ /**
2470
+ * Key envelopes addressed to this session in the current epoch
2471
+ * @description For catching up after a reconnect; the same envelopes also arrive as `call_keys` events.
2472
+ */
2473
+ get: operations["getCallKeys"];
2474
+ put?: never;
2475
+ /**
2476
+ * Send this session's sealed sender key to the other participants
2477
+ * @description Relays opaque HPKE envelopes (see `docs/calls-e2ee.md`). Only the session that joined may send, only for the
2478
+ * current epoch (`409`, `stale_epoch`), and only to sessions on the roster of that epoch (`422`). The server
2479
+ * never sees a plaintext key.
2480
+ */
2481
+ post: operations["sendCallKeys"];
2482
+ delete?: never;
2483
+ options?: never;
2484
+ head?: never;
2485
+ patch?: never;
2486
+ trace?: never;
2487
+ };
2173
2488
  }
2174
2489
  export type webhooks = Record<string, never>;
2175
2490
  export interface components {
@@ -2234,7 +2549,7 @@ export interface components {
2234
2549
  * codes must be treated like `internal_error`.
2235
2550
  * @enum {string}
2236
2551
  */
2237
- ErrorCode: "invalid_request" | "validation_failed" | "unauthenticated" | "invalid_credentials" | "two_factor_required" | "invalid_two_factor_code" | "token_expired" | "forbidden" | "not_found" | "conflict" | "already_exists" | "payload_too_large" | "unsupported_media_type" | "rate_limited" | "client_outdated" | "invalid_client_version" | "blocked_by_user" | "approval_required" | "internal_error";
2552
+ ErrorCode: "invalid_request" | "validation_failed" | "unauthenticated" | "invalid_credentials" | "two_factor_required" | "invalid_two_factor_code" | "token_expired" | "forbidden" | "not_found" | "conflict" | "already_exists" | "payload_too_large" | "unsupported_media_type" | "rate_limited" | "client_outdated" | "invalid_client_version" | "blocked_by_user" | "approval_required" | "calls_unavailable" | "calls_not_allowed" | "call_identity_required" | "call_full" | "call_ended" | "already_in_call" | "stale_epoch" | "internal_error";
2238
2553
  /** @description RFC 9457 problem details. `426 Upgrade Required` (`client_outdated`) uses the same format. */
2239
2554
  Problem: {
2240
2555
  /**
@@ -2428,6 +2743,8 @@ export interface components {
2428
2743
  direct_messages: components["schemas"]["DirectMessagePolicy"];
2429
2744
  group_invites: components["schemas"]["GroupInvitePolicy"];
2430
2745
  search_visibility: components["schemas"]["SearchVisibility"];
2746
+ /** @description Whether others may ring this user. Calls are only possible from an existing direct chat or a shared group. */
2747
+ calls_enabled: boolean;
2431
2748
  exceptions: components["schemas"]["PrivacyExceptions"];
2432
2749
  };
2433
2750
  UpdatePrivacySettingsRequest: {
@@ -2438,6 +2755,7 @@ export interface components {
2438
2755
  direct_messages?: components["schemas"]["DirectMessagePolicy"];
2439
2756
  group_invites?: components["schemas"]["GroupInvitePolicy"];
2440
2757
  search_visibility?: components["schemas"]["SearchVisibility"];
2758
+ calls_enabled?: boolean;
2441
2759
  };
2442
2760
  PrivacyExceptionsRequest: {
2443
2761
  user_ids: components["schemas"]["Id"][];
@@ -2570,11 +2888,12 @@ export interface components {
2570
2888
  height: number | null;
2571
2889
  };
2572
2890
  /** @enum {string} */
2573
- SystemEventKind: "group_created" | "member_added" | "member_joined" | "member_removed" | "member_left";
2891
+ SystemEventKind: "group_created" | "member_added" | "member_joined" | "member_removed" | "member_left" | "call";
2574
2892
  /**
2575
2893
  * @description What a `system` message records; set on system messages only, whose `content` is then `null`. The names
2576
2894
  * are the display names at the time of the event. `target` fields are set for `member_added` and
2577
- * `member_removed`.
2895
+ * `member_removed`. `call` is set for `call` messages: one per call, posted when the call ends, `actor` is the
2896
+ * initiator.
2578
2897
  */
2579
2898
  SystemEvent: {
2580
2899
  kind: components["schemas"]["SystemEventKind"];
@@ -2582,6 +2901,7 @@ export interface components {
2582
2901
  actor_name: string;
2583
2902
  target_id?: components["schemas"]["Id"];
2584
2903
  target_name?: string;
2904
+ call?: components["schemas"]["CallSummary"];
2585
2905
  };
2586
2906
  MessagePage: {
2587
2907
  /** @description Oldest to newest */
@@ -2862,22 +3182,150 @@ export interface components {
2862
3182
  EmailResetAccepted: {
2863
3183
  message: string;
2864
3184
  };
2865
- };
2866
- responses: {
2867
- /** @description The `X-Client-Api-Version` header has another MAJOR version than the server or is below `min_client_api_version` (`client_outdated`). Not returned by `/meta`, which clients use to find out the current versions. */
2868
- ClientOutdated: {
2869
- headers: {
2870
- [name: string]: unknown;
2871
- };
2872
- content: {
2873
- "application/problem+json": components["schemas"]["Problem"];
2874
- };
3185
+ CallConfig: {
3186
+ enabled: boolean;
3187
+ /** @description Most sessions joined to one call at the same time. */
3188
+ max_participants: number;
3189
+ /** @description How long an invitation rings before it counts as missed. */
3190
+ ring_timeout_seconds: number;
2875
3191
  };
2876
- /** @description Malformed request, or a malformed `X-Client-Api-Version` header (`invalid_client_version`) */
2877
- BadRequest: {
2878
- headers: {
2879
- [name: string]: unknown;
2880
- };
3192
+ CallIdentityRequest: {
3193
+ public_key: components["schemas"]["CallIdentityKey"];
3194
+ };
3195
+ /** @description P-256 public key as an uncompressed point (65 bytes, first byte `0x04`), base64url without padding. */
3196
+ CallIdentityKey: string;
3197
+ /**
3198
+ * @description `ringing` until someone answers, `active` while people are in it, `ended` afterwards.
3199
+ * @enum {string}
3200
+ */
3201
+ CallState: "ringing" | "active" | "ended";
3202
+ /**
3203
+ * @description Why the call ended: `completed` (people talked), `missed` (nobody answered in time), `declined` (the peer of a
3204
+ * direct call declined), `cancelled` (the caller hung up before an answer), `failed` (the media service lost
3205
+ * the call).
3206
+ * @enum {string}
3207
+ */
3208
+ CallEndReason: "completed" | "missed" | "declined" | "cancelled" | "failed";
3209
+ /**
3210
+ * @description `left` and `declined` can become `joined` again in a group call.
3211
+ * @enum {string}
3212
+ */
3213
+ CallParticipantState: "ringing" | "joined" | "declined" | "missed" | "left";
3214
+ CallParticipant: {
3215
+ user_id: components["schemas"]["Id"];
3216
+ state: components["schemas"]["CallParticipantState"];
3217
+ /** @description The session that joined; `null` unless `state` is `joined`. */
3218
+ session_id: string | null;
3219
+ /** @description Call identity of the joined session; `null` unless `state` is `joined`. */
3220
+ identity_key: components["schemas"]["CallIdentityKey"] | null;
3221
+ /** @description When the participant last joined; `null` if never. */
3222
+ joined_at: components["schemas"]["Timestamp"] | null;
3223
+ };
3224
+ Call: {
3225
+ id: components["schemas"]["Id"];
3226
+ chat_id: components["schemas"]["Id"];
3227
+ /** @enum {string} */
3228
+ kind: "direct" | "group";
3229
+ state: components["schemas"]["CallState"];
3230
+ end_reason: components["schemas"]["CallEndReason"] | null;
3231
+ initiator_id: components["schemas"]["Id"];
3232
+ created_at: components["schemas"]["Timestamp"];
3233
+ /** @description First answer; `null` while nobody answered. */
3234
+ started_at: components["schemas"]["Timestamp"] | null;
3235
+ ended_at: components["schemas"]["Timestamp"] | null;
3236
+ /** @description When ringing invitations of this call turn into `missed`. */
3237
+ ring_expires_at: components["schemas"]["Timestamp"];
3238
+ /** @description Key epoch; increases whenever the set of joined sessions or their identity keys change. */
3239
+ epoch: number;
3240
+ /** @description Increases with every change of the call; ignore events with a lower version than one already seen. */
3241
+ version: number;
3242
+ max_participants: number;
3243
+ /** @description Everyone invited or joined, the initiator first. */
3244
+ participants: components["schemas"]["CallParticipant"][];
3245
+ };
3246
+ CallList: {
3247
+ items: components["schemas"]["Call"][];
3248
+ };
3249
+ StartCallRequest: {
3250
+ /**
3251
+ * Format: uuid
3252
+ * @description Idempotency key chosen by the client.
3253
+ */
3254
+ client_request_id: string;
3255
+ };
3256
+ JoinCallRequest: {
3257
+ /**
3258
+ * @description Move the user's participation from another session to this one.
3259
+ * @default false
3260
+ */
3261
+ takeover: boolean;
3262
+ };
3263
+ CallGrant: {
3264
+ /** @description WebSocket URL of the media server (`wss://`). */
3265
+ url: string;
3266
+ /** @description Media access token for this call and session only; microphone audio only. */
3267
+ token: string;
3268
+ /** @description The participant identity inside the media room (`<user_id>:<session_id>`). */
3269
+ identity: string;
3270
+ expires_at: components["schemas"]["Timestamp"];
3271
+ };
3272
+ CallJoin: {
3273
+ call: components["schemas"]["Call"];
3274
+ grant: components["schemas"]["CallGrant"];
3275
+ };
3276
+ /** @description An HPKE Auth-mode envelope carrying one sender key (see `docs/calls-e2ee.md`). */
3277
+ CallKeyEnvelope: {
3278
+ epoch: number;
3279
+ sender_user_id: components["schemas"]["Id"];
3280
+ /** Format: uuid */
3281
+ sender_session_id: string;
3282
+ /** Format: uuid */
3283
+ recipient_session_id: string;
3284
+ /** @description HPKE encapsulated key, base64url without padding. */
3285
+ enc: string;
3286
+ /** @description Sealed sender key, base64url without padding. */
3287
+ ciphertext: string;
3288
+ };
3289
+ CallKeyEnvelopeList: {
3290
+ call_id: components["schemas"]["Id"];
3291
+ epoch: number;
3292
+ items: components["schemas"]["CallKeyEnvelope"][];
3293
+ };
3294
+ SendCallKeysRequest: {
3295
+ epoch: number;
3296
+ envelopes: components["schemas"]["OutgoingCallKeyEnvelope"][];
3297
+ };
3298
+ OutgoingCallKeyEnvelope: {
3299
+ /** Format: uuid */
3300
+ recipient_session_id: string;
3301
+ enc: string;
3302
+ ciphertext: string;
3303
+ };
3304
+ /** @description The call a `call` system message records. */
3305
+ CallSummary: {
3306
+ call_id: components["schemas"]["Id"];
3307
+ /** @enum {string} */
3308
+ kind: "direct" | "group";
3309
+ outcome: components["schemas"]["CallEndReason"];
3310
+ /** @description From the first answer to the end; `null` if nobody answered. */
3311
+ duration_seconds: number | null;
3312
+ };
3313
+ };
3314
+ responses: {
3315
+ /** @description The `X-Client-Api-Version` header has another MAJOR version than the server or is below `min_client_api_version` (`client_outdated`). Not returned by `/meta`, which clients use to find out the current versions. */
3316
+ ClientOutdated: {
3317
+ headers: {
3318
+ [name: string]: unknown;
3319
+ };
3320
+ content: {
3321
+ "application/problem+json": components["schemas"]["Problem"];
3322
+ };
3323
+ };
3324
+ /** @description Malformed request, or a malformed `X-Client-Api-Version` header (`invalid_client_version`) */
3325
+ BadRequest: {
3326
+ headers: {
3327
+ [name: string]: unknown;
3328
+ };
2881
3329
  content: {
2882
3330
  "application/problem+json": components["schemas"]["Problem"];
2883
3331
  };
@@ -2972,6 +3420,21 @@ export interface components {
2972
3420
  "application/problem+json": components["schemas"]["Problem"];
2973
3421
  };
2974
3422
  };
3423
+ /**
3424
+ * @description Calls are switched off on the server, or the server is at its call capacity (both `calls_unavailable`), or
3425
+ * the media service or a store is away for a moment (`internal_error`). Retry after `Retry-After` when it is
3426
+ * present; without it calls stay off until `GET /calls/config` reports them enabled.
3427
+ */
3428
+ CallsUnavailable: {
3429
+ headers: {
3430
+ /** @description Seconds until a retry may succeed */
3431
+ "Retry-After"?: number;
3432
+ [name: string]: unknown;
3433
+ };
3434
+ content: {
3435
+ "application/problem+json": components["schemas"]["Problem"];
3436
+ };
3437
+ };
2975
3438
  };
2976
3439
  parameters: {
2977
3440
  /** @description ID of a QR sign-in request, from the QR code link `/qr/<request_id>`. */
@@ -2986,6 +3449,7 @@ export interface components {
2986
3449
  RequestId: components["schemas"]["Id"];
2987
3450
  AttachmentId: components["schemas"]["AttachmentRef"];
2988
3451
  SessionId: string;
3452
+ CallId: components["schemas"]["Id"];
2989
3453
  /** @description Version of the client app, for logs and the per-client metric. */
2990
3454
  ClientVersion: string;
2991
3455
  /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
@@ -7624,4 +8088,441 @@ export interface operations {
7624
8088
  };
7625
8089
  };
7626
8090
  };
8091
+ getCallConfig: {
8092
+ parameters: {
8093
+ query?: never;
8094
+ header?: {
8095
+ /** @description Version of the client app, for logs and the per-client metric. */
8096
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8097
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8098
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8099
+ };
8100
+ path?: never;
8101
+ cookie?: never;
8102
+ };
8103
+ requestBody?: never;
8104
+ responses: {
8105
+ /** @description Call availability */
8106
+ 200: {
8107
+ headers: {
8108
+ [name: string]: unknown;
8109
+ };
8110
+ content: {
8111
+ "application/json": components["schemas"]["CallConfig"];
8112
+ };
8113
+ };
8114
+ 400: components["responses"]["BadRequest"];
8115
+ 401: components["responses"]["Unauthorized"];
8116
+ 426: components["responses"]["ClientOutdated"];
8117
+ };
8118
+ };
8119
+ setCallIdentity: {
8120
+ parameters: {
8121
+ query?: never;
8122
+ header?: {
8123
+ /** @description Version of the client app, for logs and the per-client metric. */
8124
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8125
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8126
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8127
+ };
8128
+ path?: never;
8129
+ cookie?: never;
8130
+ };
8131
+ requestBody: {
8132
+ content: {
8133
+ "application/json": components["schemas"]["CallIdentityRequest"];
8134
+ };
8135
+ };
8136
+ responses: {
8137
+ /** @description Stored */
8138
+ 204: {
8139
+ headers: {
8140
+ [name: string]: unknown;
8141
+ };
8142
+ content?: never;
8143
+ };
8144
+ 400: components["responses"]["BadRequest"];
8145
+ 401: components["responses"]["Unauthorized"];
8146
+ 422: components["responses"]["ValidationFailed"];
8147
+ 426: components["responses"]["ClientOutdated"];
8148
+ 429: components["responses"]["TooManyRequests"];
8149
+ 503: components["responses"]["CallsUnavailable"];
8150
+ };
8151
+ };
8152
+ listMyCalls: {
8153
+ parameters: {
8154
+ query?: never;
8155
+ header?: {
8156
+ /** @description Version of the client app, for logs and the per-client metric. */
8157
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8158
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8159
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8160
+ };
8161
+ path?: never;
8162
+ cookie?: never;
8163
+ };
8164
+ requestBody?: never;
8165
+ responses: {
8166
+ /** @description Current calls */
8167
+ 200: {
8168
+ headers: {
8169
+ [name: string]: unknown;
8170
+ };
8171
+ content: {
8172
+ "application/json": components["schemas"]["CallList"];
8173
+ };
8174
+ };
8175
+ 400: components["responses"]["BadRequest"];
8176
+ 401: components["responses"]["Unauthorized"];
8177
+ 426: components["responses"]["ClientOutdated"];
8178
+ 503: components["responses"]["CallsUnavailable"];
8179
+ };
8180
+ };
8181
+ getChatCall: {
8182
+ parameters: {
8183
+ query?: never;
8184
+ header?: {
8185
+ /** @description Version of the client app, for logs and the per-client metric. */
8186
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8187
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8188
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8189
+ };
8190
+ path: {
8191
+ chat_id: components["parameters"]["ChatId"];
8192
+ };
8193
+ cookie?: never;
8194
+ };
8195
+ requestBody?: never;
8196
+ responses: {
8197
+ /** @description The current call of the chat */
8198
+ 200: {
8199
+ headers: {
8200
+ [name: string]: unknown;
8201
+ };
8202
+ content: {
8203
+ "application/json": components["schemas"]["Call"];
8204
+ };
8205
+ };
8206
+ 400: components["responses"]["BadRequest"];
8207
+ 401: components["responses"]["Unauthorized"];
8208
+ 404: components["responses"]["NotFound"];
8209
+ 426: components["responses"]["ClientOutdated"];
8210
+ 503: components["responses"]["CallsUnavailable"];
8211
+ };
8212
+ };
8213
+ startChatCall: {
8214
+ parameters: {
8215
+ query?: never;
8216
+ header?: {
8217
+ /** @description Version of the client app, for logs and the per-client metric. */
8218
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8219
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8220
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8221
+ };
8222
+ path: {
8223
+ chat_id: components["parameters"]["ChatId"];
8224
+ };
8225
+ cookie?: never;
8226
+ };
8227
+ requestBody: {
8228
+ content: {
8229
+ "application/json": components["schemas"]["StartCallRequest"];
8230
+ };
8231
+ };
8232
+ responses: {
8233
+ /** @description A call was already running in the chat */
8234
+ 200: {
8235
+ headers: {
8236
+ [name: string]: unknown;
8237
+ };
8238
+ content: {
8239
+ "application/json": components["schemas"]["Call"];
8240
+ };
8241
+ };
8242
+ /** @description The new call, ringing */
8243
+ 201: {
8244
+ headers: {
8245
+ [name: string]: unknown;
8246
+ };
8247
+ content: {
8248
+ "application/json": components["schemas"]["Call"];
8249
+ };
8250
+ };
8251
+ 400: components["responses"]["BadRequest"];
8252
+ 401: components["responses"]["Unauthorized"];
8253
+ 403: components["responses"]["Forbidden"];
8254
+ 404: components["responses"]["NotFound"];
8255
+ 422: components["responses"]["ValidationFailed"];
8256
+ 426: components["responses"]["ClientOutdated"];
8257
+ 429: components["responses"]["TooManyRequests"];
8258
+ 503: components["responses"]["CallsUnavailable"];
8259
+ };
8260
+ };
8261
+ getCall: {
8262
+ parameters: {
8263
+ query?: never;
8264
+ header?: {
8265
+ /** @description Version of the client app, for logs and the per-client metric. */
8266
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8267
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8268
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8269
+ };
8270
+ path: {
8271
+ call_id: components["parameters"]["CallId"];
8272
+ };
8273
+ cookie?: never;
8274
+ };
8275
+ requestBody?: never;
8276
+ responses: {
8277
+ /** @description The call */
8278
+ 200: {
8279
+ headers: {
8280
+ [name: string]: unknown;
8281
+ };
8282
+ content: {
8283
+ "application/json": components["schemas"]["Call"];
8284
+ };
8285
+ };
8286
+ 400: components["responses"]["BadRequest"];
8287
+ 401: components["responses"]["Unauthorized"];
8288
+ 404: components["responses"]["NotFound"];
8289
+ 426: components["responses"]["ClientOutdated"];
8290
+ 503: components["responses"]["CallsUnavailable"];
8291
+ };
8292
+ };
8293
+ joinCall: {
8294
+ parameters: {
8295
+ query?: never;
8296
+ header?: {
8297
+ /** @description Version of the client app, for logs and the per-client metric. */
8298
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8299
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8300
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8301
+ };
8302
+ path: {
8303
+ call_id: components["parameters"]["CallId"];
8304
+ };
8305
+ cookie?: never;
8306
+ };
8307
+ requestBody?: {
8308
+ content: {
8309
+ "application/json": components["schemas"]["JoinCallRequest"];
8310
+ };
8311
+ };
8312
+ responses: {
8313
+ /** @description Joined */
8314
+ 200: {
8315
+ headers: {
8316
+ [name: string]: unknown;
8317
+ };
8318
+ content: {
8319
+ "application/json": components["schemas"]["CallJoin"];
8320
+ };
8321
+ };
8322
+ 400: components["responses"]["BadRequest"];
8323
+ 401: components["responses"]["Unauthorized"];
8324
+ 403: components["responses"]["Forbidden"];
8325
+ 404: components["responses"]["NotFound"];
8326
+ 409: components["responses"]["Conflict"];
8327
+ 422: components["responses"]["ValidationFailed"];
8328
+ 426: components["responses"]["ClientOutdated"];
8329
+ 429: components["responses"]["TooManyRequests"];
8330
+ 503: components["responses"]["CallsUnavailable"];
8331
+ };
8332
+ };
8333
+ renewCallGrant: {
8334
+ parameters: {
8335
+ query?: never;
8336
+ header?: {
8337
+ /** @description Version of the client app, for logs and the per-client metric. */
8338
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8339
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8340
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8341
+ };
8342
+ path: {
8343
+ call_id: components["parameters"]["CallId"];
8344
+ };
8345
+ cookie?: never;
8346
+ };
8347
+ requestBody?: never;
8348
+ responses: {
8349
+ /** @description The grant */
8350
+ 200: {
8351
+ headers: {
8352
+ [name: string]: unknown;
8353
+ };
8354
+ content: {
8355
+ "application/json": components["schemas"]["CallGrant"];
8356
+ };
8357
+ };
8358
+ 400: components["responses"]["BadRequest"];
8359
+ 401: components["responses"]["Unauthorized"];
8360
+ 404: components["responses"]["NotFound"];
8361
+ 409: components["responses"]["Conflict"];
8362
+ 426: components["responses"]["ClientOutdated"];
8363
+ 429: components["responses"]["TooManyRequests"];
8364
+ 503: components["responses"]["CallsUnavailable"];
8365
+ };
8366
+ };
8367
+ declineCall: {
8368
+ parameters: {
8369
+ query?: never;
8370
+ header?: {
8371
+ /** @description Version of the client app, for logs and the per-client metric. */
8372
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8373
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8374
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8375
+ };
8376
+ path: {
8377
+ call_id: components["parameters"]["CallId"];
8378
+ };
8379
+ cookie?: never;
8380
+ };
8381
+ requestBody?: never;
8382
+ responses: {
8383
+ /** @description Declined */
8384
+ 204: {
8385
+ headers: {
8386
+ [name: string]: unknown;
8387
+ };
8388
+ content?: never;
8389
+ };
8390
+ 400: components["responses"]["BadRequest"];
8391
+ 401: components["responses"]["Unauthorized"];
8392
+ 404: components["responses"]["NotFound"];
8393
+ 426: components["responses"]["ClientOutdated"];
8394
+ 503: components["responses"]["CallsUnavailable"];
8395
+ };
8396
+ };
8397
+ leaveCall: {
8398
+ parameters: {
8399
+ query?: never;
8400
+ header?: {
8401
+ /** @description Version of the client app, for logs and the per-client metric. */
8402
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8403
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8404
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8405
+ };
8406
+ path: {
8407
+ call_id: components["parameters"]["CallId"];
8408
+ };
8409
+ cookie?: never;
8410
+ };
8411
+ requestBody?: never;
8412
+ responses: {
8413
+ /** @description Left */
8414
+ 204: {
8415
+ headers: {
8416
+ [name: string]: unknown;
8417
+ };
8418
+ content?: never;
8419
+ };
8420
+ 400: components["responses"]["BadRequest"];
8421
+ 401: components["responses"]["Unauthorized"];
8422
+ 404: components["responses"]["NotFound"];
8423
+ 426: components["responses"]["ClientOutdated"];
8424
+ 503: components["responses"]["CallsUnavailable"];
8425
+ };
8426
+ };
8427
+ endCall: {
8428
+ parameters: {
8429
+ query?: never;
8430
+ header?: {
8431
+ /** @description Version of the client app, for logs and the per-client metric. */
8432
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8433
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8434
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8435
+ };
8436
+ path: {
8437
+ call_id: components["parameters"]["CallId"];
8438
+ };
8439
+ cookie?: never;
8440
+ };
8441
+ requestBody?: never;
8442
+ responses: {
8443
+ /** @description Ended */
8444
+ 204: {
8445
+ headers: {
8446
+ [name: string]: unknown;
8447
+ };
8448
+ content?: never;
8449
+ };
8450
+ 400: components["responses"]["BadRequest"];
8451
+ 401: components["responses"]["Unauthorized"];
8452
+ 403: components["responses"]["Forbidden"];
8453
+ 404: components["responses"]["NotFound"];
8454
+ 426: components["responses"]["ClientOutdated"];
8455
+ 503: components["responses"]["CallsUnavailable"];
8456
+ };
8457
+ };
8458
+ getCallKeys: {
8459
+ parameters: {
8460
+ query?: never;
8461
+ header?: {
8462
+ /** @description Version of the client app, for logs and the per-client metric. */
8463
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8464
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8465
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8466
+ };
8467
+ path: {
8468
+ call_id: components["parameters"]["CallId"];
8469
+ };
8470
+ cookie?: never;
8471
+ };
8472
+ requestBody?: never;
8473
+ responses: {
8474
+ /** @description The envelopes */
8475
+ 200: {
8476
+ headers: {
8477
+ [name: string]: unknown;
8478
+ };
8479
+ content: {
8480
+ "application/json": components["schemas"]["CallKeyEnvelopeList"];
8481
+ };
8482
+ };
8483
+ 400: components["responses"]["BadRequest"];
8484
+ 401: components["responses"]["Unauthorized"];
8485
+ 404: components["responses"]["NotFound"];
8486
+ 409: components["responses"]["Conflict"];
8487
+ 426: components["responses"]["ClientOutdated"];
8488
+ 503: components["responses"]["CallsUnavailable"];
8489
+ };
8490
+ };
8491
+ sendCallKeys: {
8492
+ parameters: {
8493
+ query?: never;
8494
+ header?: {
8495
+ /** @description Version of the client app, for logs and the per-client metric. */
8496
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
8497
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
8498
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
8499
+ };
8500
+ path: {
8501
+ call_id: components["parameters"]["CallId"];
8502
+ };
8503
+ cookie?: never;
8504
+ };
8505
+ requestBody: {
8506
+ content: {
8507
+ "application/json": components["schemas"]["SendCallKeysRequest"];
8508
+ };
8509
+ };
8510
+ responses: {
8511
+ /** @description Relayed */
8512
+ 204: {
8513
+ headers: {
8514
+ [name: string]: unknown;
8515
+ };
8516
+ content?: never;
8517
+ };
8518
+ 400: components["responses"]["BadRequest"];
8519
+ 401: components["responses"]["Unauthorized"];
8520
+ 404: components["responses"]["NotFound"];
8521
+ 409: components["responses"]["Conflict"];
8522
+ 422: components["responses"]["ValidationFailed"];
8523
+ 426: components["responses"]["ClientOutdated"];
8524
+ 429: components["responses"]["TooManyRequests"];
8525
+ 503: components["responses"]["CallsUnavailable"];
8526
+ };
8527
+ };
7627
8528
  }