@myronsi/messenger-api 2.1.0-alpha.42.next.149 → 2.1.0-alpha.43.next.151

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 CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  Contract changes only. The backend changelog is `CHANGELOG.md` in the repository root. Rules: `docs/api-compatibility.md`.
4
4
 
5
+ ## 2.1.0-alpha.43
6
+
7
+ - Device-bound sessions: optional header parameter `DeviceProof` (`Device-Proof`, a DPoP-style ES256 proof) on
8
+ `POST /auth/register`, `/auth/login`, `/auth/login/2fa`, `/auth/refresh`, `/auth/recover/key`,
9
+ `/auth/recovery-requests/{requestId}/complete`, `/auth/qr-login/{requestId}/poll` and
10
+ `/auth/passkeys/login/verify`. A refresh of a bound session without a proof of its key answers `401` and ends the
11
+ session.
12
+ - `ErrorCode` gains `device_proof_stale`.
13
+ - `Date` is exposed to cross-origin clients.
14
+
5
15
  ## 2.1.0-alpha.42
6
16
 
7
17
  - Pinned messages: `PUT /chats/{chat_id}/messages/{message_id}/pin` (`PinMessageRequest` with `PinScope` `me` or
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.42. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.42";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.43. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.43";
3
3
  export type { paths, components, operations } from "./schema.js";
4
4
  export * from "./ws-events.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export const API_VERSION = "2.1.0-alpha.42";
1
+ export const API_VERSION = "2.1.0-alpha.43";
package/dist/openapi.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: Messenger API
4
- version: 2.1.0-alpha.42
4
+ version: 2.1.0-alpha.43
5
5
  summary: REST contract of the Messenger backend (v2).
6
6
  description: |
7
7
  Contract for the Go backend. The WebSocket protocol is described in `websocket/` and
@@ -92,6 +92,7 @@ paths:
92
92
  parameters:
93
93
  - $ref: "#/components/parameters/ClientVersion"
94
94
  - $ref: "#/components/parameters/ClientApiVersion"
95
+ - $ref: "#/components/parameters/DeviceProof"
95
96
  post:
96
97
  tags: [auth]
97
98
  operationId: register
@@ -119,6 +120,7 @@ paths:
119
120
  parameters:
120
121
  - $ref: "#/components/parameters/ClientVersion"
121
122
  - $ref: "#/components/parameters/ClientApiVersion"
123
+ - $ref: "#/components/parameters/DeviceProof"
122
124
  post:
123
125
  tags: [auth]
124
126
  operationId: login
@@ -146,6 +148,7 @@ paths:
146
148
  parameters:
147
149
  - $ref: "#/components/parameters/ClientVersion"
148
150
  - $ref: "#/components/parameters/ClientApiVersion"
151
+ - $ref: "#/components/parameters/DeviceProof"
149
152
  post:
150
153
  tags: [auth]
151
154
  operationId: loginTwoFactor
@@ -172,6 +175,7 @@ paths:
172
175
  parameters:
173
176
  - $ref: "#/components/parameters/ClientVersion"
174
177
  - $ref: "#/components/parameters/ClientApiVersion"
178
+ - $ref: "#/components/parameters/DeviceProof"
175
179
  post:
176
180
  tags: [auth]
177
181
  operationId: refreshToken
@@ -214,6 +218,7 @@ paths:
214
218
  parameters:
215
219
  - $ref: "#/components/parameters/ClientVersion"
216
220
  - $ref: "#/components/parameters/ClientApiVersion"
221
+ - $ref: "#/components/parameters/DeviceProof"
217
222
  post:
218
223
  tags: [auth]
219
224
  operationId: recoverWithKey
@@ -4485,6 +4490,7 @@ paths:
4485
4490
  - *a1
4486
4491
  - *a2
4487
4492
  - *a3
4493
+ - $ref: "#/components/parameters/DeviceProof"
4488
4494
  post:
4489
4495
  tags:
4490
4496
  - auth
@@ -4605,6 +4611,7 @@ paths:
4605
4611
  - $ref: "#/components/parameters/ClientVersion"
4606
4612
  - $ref: "#/components/parameters/ClientApiVersion"
4607
4613
  - $ref: "#/components/parameters/QrLoginRequestId"
4614
+ - $ref: "#/components/parameters/DeviceProof"
4608
4615
  post:
4609
4616
  tags: [auth]
4610
4617
  operationId: pollQrLogin
@@ -5125,7 +5132,10 @@ paths:
5125
5132
  schema:
5126
5133
  $ref: "#/components/schemas/Problem"
5127
5134
  /auth/passkeys/login/verify:
5128
- parameters: *a1
5135
+ parameters:
5136
+ - $ref: "#/components/parameters/ClientVersion"
5137
+ - $ref: "#/components/parameters/ClientApiVersion"
5138
+ - $ref: "#/components/parameters/DeviceProof"
5129
5139
  post:
5130
5140
  tags:
5131
5141
  - auth
@@ -6084,6 +6094,20 @@ components:
6084
6094
  required: false
6085
6095
  description: Version of the client app, for logs and the per-client metric.
6086
6096
  schema: { type: string }
6097
+ DeviceProof:
6098
+ name: Device-Proof
6099
+ in: header
6100
+ required: false
6101
+ description: |
6102
+ Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
6103
+ `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
6104
+ (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
6105
+ A session created with a proof is bound to its key; an unbound session is bound at its first refresh
6106
+ with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
6107
+ proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
6108
+ (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
6109
+ `Date` response header.
6110
+ schema: { type: string, maxLength: 2048 }
6087
6111
  ClientApiVersion:
6088
6112
  name: X-Client-Api-Version
6089
6113
  in: header
@@ -6328,6 +6352,7 @@ components:
6328
6352
  - unsupported_media_type
6329
6353
  - rate_limited
6330
6354
  - client_outdated
6355
+ - device_proof_stale
6331
6356
  - invalid_client_version
6332
6357
  - blocked_by_user
6333
6358
  - approval_required
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.42. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.43. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -28,6 +28,17 @@ export interface paths {
28
28
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
29
29
  /** @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`). */
30
30
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
31
+ /**
32
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
33
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
34
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
35
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
36
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
37
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
38
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
39
+ * `Date` response header.
40
+ */
41
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
31
42
  };
32
43
  path?: never;
33
44
  cookie?: never;
@@ -50,6 +61,17 @@ export interface paths {
50
61
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
51
62
  /** @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`). */
52
63
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
64
+ /**
65
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
66
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
67
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
68
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
69
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
70
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
71
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
72
+ * `Date` response header.
73
+ */
74
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
53
75
  };
54
76
  path?: never;
55
77
  cookie?: never;
@@ -75,6 +97,17 @@ export interface paths {
75
97
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
76
98
  /** @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`). */
77
99
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
100
+ /**
101
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
102
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
103
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
104
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
105
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
106
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
107
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
108
+ * `Date` response header.
109
+ */
110
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
78
111
  };
79
112
  path?: never;
80
113
  cookie?: never;
@@ -97,6 +130,17 @@ export interface paths {
97
130
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
98
131
  /** @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`). */
99
132
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
133
+ /**
134
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
135
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
136
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
137
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
138
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
139
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
140
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
141
+ * `Date` response header.
142
+ */
143
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
100
144
  };
101
145
  path?: never;
102
146
  cookie?: never;
@@ -144,6 +188,17 @@ export interface paths {
144
188
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
145
189
  /** @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`). */
146
190
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
191
+ /**
192
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
193
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
194
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
195
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
196
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
197
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
198
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
199
+ * `Date` response header.
200
+ */
201
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
147
202
  };
148
203
  path?: never;
149
204
  cookie?: never;
@@ -3832,6 +3887,17 @@ export interface paths {
3832
3887
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
3833
3888
  /** @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`). */
3834
3889
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
3890
+ /**
3891
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
3892
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
3893
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
3894
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
3895
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
3896
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
3897
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
3898
+ * `Date` response header.
3899
+ */
3900
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
3835
3901
  };
3836
3902
  path: {
3837
3903
  /** @description Secret one-time recovery request capability. Never log or persist it in browser storage. */
@@ -3943,6 +4009,17 @@ export interface paths {
3943
4009
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
3944
4010
  /** @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`). */
3945
4011
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
4012
+ /**
4013
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
4014
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
4015
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
4016
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
4017
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
4018
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
4019
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
4020
+ * `Date` response header.
4021
+ */
4022
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
3946
4023
  };
3947
4024
  path: {
3948
4025
  /** @description ID of a QR sign-in request, from the QR code link `/qr/<request_id>`. */
@@ -4148,6 +4225,17 @@ export interface paths {
4148
4225
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
4149
4226
  /** @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`). */
4150
4227
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
4228
+ /**
4229
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
4230
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
4231
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
4232
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
4233
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
4234
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
4235
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
4236
+ * `Date` response header.
4237
+ */
4238
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
4151
4239
  };
4152
4240
  path?: never;
4153
4241
  cookie?: never;
@@ -4663,7 +4751,7 @@ export interface components {
4663
4751
  * codes must be treated like `internal_error`.
4664
4752
  * @enum {string}
4665
4753
  */
4666
- 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" | "user_verification_required" | "session_too_new" | "calls_unavailable" | "calls_not_allowed" | "call_identity_required" | "call_full" | "call_ended" | "already_in_call" | "stale_epoch" | "limit_reached" | "account_restricted" | "internal_error";
4754
+ 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" | "device_proof_stale" | "invalid_client_version" | "blocked_by_user" | "approval_required" | "user_verification_required" | "session_too_new" | "calls_unavailable" | "calls_not_allowed" | "call_identity_required" | "call_full" | "call_ended" | "already_in_call" | "stale_epoch" | "limit_reached" | "account_restricted" | "internal_error";
4667
4755
  /** @description RFC 9457 problem details. `426 Upgrade Required` (`client_outdated`) uses the same format. */
4668
4756
  Problem: {
4669
4757
  /**
@@ -6415,6 +6503,17 @@ export interface components {
6415
6503
  CallId: components["schemas"]["Id"];
6416
6504
  /** @description Version of the client app, for logs and the per-client metric. */
6417
6505
  ClientVersion: string;
6506
+ /**
6507
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
6508
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
6509
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
6510
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
6511
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
6512
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
6513
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
6514
+ * `Date` response header.
6515
+ */
6516
+ DeviceProof: string;
6418
6517
  /** @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`). */
6419
6518
  ClientApiVersion: string;
6420
6519
  };
@@ -6458,6 +6557,17 @@ export interface operations {
6458
6557
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
6459
6558
  /** @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`). */
6460
6559
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
6560
+ /**
6561
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
6562
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
6563
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
6564
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
6565
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
6566
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
6567
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
6568
+ * `Date` response header.
6569
+ */
6570
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
6461
6571
  };
6462
6572
  path?: never;
6463
6573
  cookie?: never;
@@ -6493,6 +6603,17 @@ export interface operations {
6493
6603
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
6494
6604
  /** @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`). */
6495
6605
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
6606
+ /**
6607
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
6608
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
6609
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
6610
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
6611
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
6612
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
6613
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
6614
+ * `Date` response header.
6615
+ */
6616
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
6496
6617
  };
6497
6618
  path?: never;
6498
6619
  cookie?: never;
@@ -6527,6 +6648,17 @@ export interface operations {
6527
6648
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
6528
6649
  /** @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`). */
6529
6650
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
6651
+ /**
6652
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
6653
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
6654
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
6655
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
6656
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
6657
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
6658
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
6659
+ * `Date` response header.
6660
+ */
6661
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
6530
6662
  };
6531
6663
  path?: never;
6532
6664
  cookie?: never;
@@ -6561,6 +6693,17 @@ export interface operations {
6561
6693
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
6562
6694
  /** @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`). */
6563
6695
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
6696
+ /**
6697
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
6698
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
6699
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
6700
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
6701
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
6702
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
6703
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
6704
+ * `Date` response header.
6705
+ */
6706
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
6564
6707
  };
6565
6708
  path?: never;
6566
6709
  cookie?: never;
@@ -6618,6 +6761,17 @@ export interface operations {
6618
6761
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
6619
6762
  /** @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`). */
6620
6763
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
6764
+ /**
6765
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
6766
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
6767
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
6768
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
6769
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
6770
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
6771
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
6772
+ * `Date` response header.
6773
+ */
6774
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
6621
6775
  };
6622
6776
  path?: never;
6623
6777
  cookie?: never;
@@ -12515,6 +12669,17 @@ export interface operations {
12515
12669
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
12516
12670
  /** @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`). */
12517
12671
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
12672
+ /**
12673
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
12674
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
12675
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
12676
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
12677
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
12678
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
12679
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
12680
+ * `Date` response header.
12681
+ */
12682
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
12518
12683
  };
12519
12684
  path: {
12520
12685
  /** @description Secret one-time recovery request capability. Never log or persist it in browser storage. */
@@ -12666,6 +12831,17 @@ export interface operations {
12666
12831
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
12667
12832
  /** @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`). */
12668
12833
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
12834
+ /**
12835
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
12836
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
12837
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
12838
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
12839
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
12840
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
12841
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
12842
+ * `Date` response header.
12843
+ */
12844
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
12669
12845
  };
12670
12846
  path: {
12671
12847
  /** @description ID of a QR sign-in request, from the QR code link `/qr/<request_id>`. */
@@ -13422,6 +13598,17 @@ export interface operations {
13422
13598
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
13423
13599
  /** @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`). */
13424
13600
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
13601
+ /**
13602
+ * @description Proof that the request comes from the device the session is bound to: a compact JWS (`typ` `dpop+jwt`,
13603
+ * `alg` `ES256`, the public P-256 key as `jwk` in the protected header) over `htm` (HTTP method), `htu`
13604
+ * (absolute request URL without query and fragment), `iat` (Unix seconds) and `jti` (unique per proof).
13605
+ * A session created with a proof is bound to its key; an unbound session is bound at its first refresh
13606
+ * with a proof. Refreshing a bound session without a proof of its key ends the session (`401`). Bad
13607
+ * proofs are answered `400` (`invalid_request`), an `iat` more than 5 minutes off with `401`
13608
+ * (`device_proof_stale`); the session survives, and the client may retry with its clock corrected by the
13609
+ * `Date` response header.
13610
+ */
13611
+ "Device-Proof"?: components["parameters"]["DeviceProof"];
13425
13612
  };
13426
13613
  path?: never;
13427
13614
  cookie?: never;
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.42. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.43. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -171,6 +171,7 @@ export type ErrorCode =
171
171
  | "unsupported_media_type"
172
172
  | "rate_limited"
173
173
  | "client_outdated"
174
+ | "device_proof_stale"
174
175
  | "invalid_client_version"
175
176
  | "blocked_by_user"
176
177
  | "approval_required"
@@ -207,6 +207,7 @@
207
207
  "unsupported_media_type",
208
208
  "rate_limited",
209
209
  "client_outdated",
210
+ "device_proof_stale",
210
211
  "invalid_client_version",
211
212
  "blocked_by_user",
212
213
  "approval_required",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.1.0-alpha.42.next.149",
3
+ "version": "2.1.0-alpha.43.next.151",
4
4
  "description": "API contract of the Messenger backend: OpenAPI document, WebSocket event schemas and generated TypeScript types",
5
5
  "license": "MIT",
6
6
  "repository": {