@myronsi/messenger-api 2.1.0-alpha.37 → 2.1.0-alpha.38.next.135

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,13 @@
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.38
6
+
7
+ - Review by a person: `POST /me/account-status/review` (`AccountReviewRequest`: `text`, 1 to 500 characters) stores a
8
+ request for the moderation team while the status is not `good`; one open request at a time (`409`), at most 3 in
9
+ 30 days (`429`). `AccountStatus` gains `review_requested_at` and `can_request_review`, also in the
10
+ WebSocket event `account_status`.
11
+
5
12
  ## 2.1.0-alpha.37
6
13
 
7
14
  - `AccountStatus` gains the optional `decided_by` (`AccountStatusDecidedBy`: `automatic`, `staff`), `reason_code`
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.37. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.37";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.38. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.38";
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.37";
1
+ export const API_VERSION = "2.1.0-alpha.38";
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.37
4
+ version: 2.1.0-alpha.38
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
@@ -1216,6 +1216,37 @@ paths:
1216
1216
  description: Marked as read
1217
1217
  "401": { $ref: "#/components/responses/Unauthorized" }
1218
1218
  "404": { $ref: "#/components/responses/NotFound" }
1219
+ /me/account-status/review:
1220
+ parameters:
1221
+ - $ref: "#/components/parameters/ClientVersion"
1222
+ - $ref: "#/components/parameters/ClientApiVersion"
1223
+ post:
1224
+ tags: [me]
1225
+ operationId: requestAccountReview
1226
+ summary: Ask for a review of the account status by a person
1227
+ description: |
1228
+ Stores the request with the user's text and the current status for the moderation team, who review the
1229
+ account and decide; the decision arrives as an account status with `decided_by: staff` and the reason. Allowed while the
1230
+ status is not `good` and no request is open (`can_request_review`), otherwise `409`; at most 3 requests in
1231
+ 30 days, otherwise `429`. A request closes when a person decides or when the status returns to `good`. The
1232
+ answer and the WebSocket event `account_status` carry `review_requested_at`.
1233
+ requestBody:
1234
+ required: true
1235
+ content:
1236
+ application/json:
1237
+ schema: { $ref: "#/components/schemas/AccountReviewRequest" }
1238
+ responses:
1239
+ "426": { $ref: "#/components/responses/ClientOutdated" }
1240
+ "400": { $ref: "#/components/responses/BadRequest" }
1241
+ "200":
1242
+ description: The account status with the open request
1243
+ content:
1244
+ application/json:
1245
+ schema: { $ref: "#/components/schemas/AccountStatus" }
1246
+ "401": { $ref: "#/components/responses/Unauthorized" }
1247
+ "409": { $ref: "#/components/responses/Conflict" }
1248
+ "422": { $ref: "#/components/responses/ValidationFailed" }
1249
+ "429": { $ref: "#/components/responses/TooManyRequests" }
1219
1250
  /users/{user_id}/avatar:
1220
1251
  parameters:
1221
1252
  - $ref: "#/components/parameters/ClientVersion"
@@ -6193,7 +6224,7 @@ components:
6193
6224
  enum: [start_direct, invite_to_group, call, create_group, upload, forward, edit_profile, publish_pack, search, send, manage_group]
6194
6225
  AccountStatus:
6195
6226
  type: object
6196
- required: [status, since, restrictions, can_appeal, probation_until]
6227
+ required: [status, since, restrictions, can_appeal, probation_until, review_requested_at, can_request_review]
6197
6228
  properties:
6198
6229
  status: { $ref: "#/components/schemas/AccountStatusLevel" }
6199
6230
  since:
@@ -6223,6 +6254,25 @@ components:
6223
6254
  description: |
6224
6255
  The explanation written for the user by the moderation team; `null` for automatic statuses. Show it as
6225
6256
  written by "Messenger moderation", never by a person's name.
6257
+ review_requested_at:
6258
+ description: |
6259
+ When the open request for a review by a person (`POST /me/account-status/review`) was made; `null` when
6260
+ none is open.
6261
+ oneOf:
6262
+ - $ref: "#/components/schemas/Timestamp"
6263
+ - type: "null"
6264
+ can_request_review:
6265
+ type: boolean
6266
+ description: Whether `POST /me/account-status/review` is allowed now.
6267
+ AccountReviewRequest:
6268
+ type: object
6269
+ required: [text]
6270
+ properties:
6271
+ text:
6272
+ type: string
6273
+ minLength: 1
6274
+ maxLength: 500
6275
+ description: What the user wants the reviewer to know. Trimmed; must not be empty.
6226
6276
  AccountStatusDecidedBy:
6227
6277
  type: string
6228
6278
  description: |
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.37. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.38. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -1087,6 +1087,35 @@ export interface paths {
1087
1087
  patch?: never;
1088
1088
  trace?: never;
1089
1089
  };
1090
+ "/me/account-status/review": {
1091
+ parameters: {
1092
+ query?: never;
1093
+ header?: {
1094
+ /** @description Version of the client app, for logs and the per-client metric. */
1095
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
1096
+ /** @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`). */
1097
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
1098
+ };
1099
+ path?: never;
1100
+ cookie?: never;
1101
+ };
1102
+ get?: never;
1103
+ put?: never;
1104
+ /**
1105
+ * Ask for a review of the account status by a person
1106
+ * @description Stores the request with the user's text and the current status for the moderation team, who review the
1107
+ * account and decide; the decision arrives as an account status with `decided_by: staff` and the reason. Allowed while the
1108
+ * status is not `good` and no request is open (`can_request_review`), otherwise `409`; at most 3 requests in
1109
+ * 30 days, otherwise `429`. A request closes when a person decides or when the status returns to `good`. The
1110
+ * answer and the WebSocket event `account_status` carry `review_requested_at`.
1111
+ */
1112
+ post: operations["requestAccountReview"];
1113
+ delete?: never;
1114
+ options?: never;
1115
+ head?: never;
1116
+ patch?: never;
1117
+ trace?: never;
1118
+ };
1090
1119
  "/users/{user_id}/avatar": {
1091
1120
  parameters: {
1092
1121
  query?: never;
@@ -4398,6 +4427,17 @@ export interface components {
4398
4427
  * written by "Messenger moderation", never by a person's name.
4399
4428
  */
4400
4429
  reason_text?: string | null;
4430
+ /**
4431
+ * @description When the open request for a review by a person (`POST /me/account-status/review`) was made; `null` when
4432
+ * none is open.
4433
+ */
4434
+ review_requested_at: components["schemas"]["Timestamp"] | null;
4435
+ /** @description Whether `POST /me/account-status/review` is allowed now. */
4436
+ can_request_review: boolean;
4437
+ };
4438
+ AccountReviewRequest: {
4439
+ /** @description What the user wants the reviewer to know. Trimmed; must not be empty. */
4440
+ text: string;
4401
4441
  };
4402
4442
  /**
4403
4443
  * @description Who set the current status: `automatic` (reports, decay, appeal) or `staff` (reviewed by a person on the
@@ -7211,6 +7251,41 @@ export interface operations {
7211
7251
  426: components["responses"]["ClientOutdated"];
7212
7252
  };
7213
7253
  };
7254
+ requestAccountReview: {
7255
+ parameters: {
7256
+ query?: never;
7257
+ header?: {
7258
+ /** @description Version of the client app, for logs and the per-client metric. */
7259
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
7260
+ /** @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`). */
7261
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
7262
+ };
7263
+ path?: never;
7264
+ cookie?: never;
7265
+ };
7266
+ requestBody: {
7267
+ content: {
7268
+ "application/json": components["schemas"]["AccountReviewRequest"];
7269
+ };
7270
+ };
7271
+ responses: {
7272
+ /** @description The account status with the open request */
7273
+ 200: {
7274
+ headers: {
7275
+ [name: string]: unknown;
7276
+ };
7277
+ content: {
7278
+ "application/json": components["schemas"]["AccountStatus"];
7279
+ };
7280
+ };
7281
+ 400: components["responses"]["BadRequest"];
7282
+ 401: components["responses"]["Unauthorized"];
7283
+ 409: components["responses"]["Conflict"];
7284
+ 422: components["responses"]["ValidationFailed"];
7285
+ 426: components["responses"]["ClientOutdated"];
7286
+ 429: components["responses"]["TooManyRequests"];
7287
+ };
7288
+ };
7214
7289
  getUserAvatar: {
7215
7290
  parameters: {
7216
7291
  query?: {
package/dist/ws-docs.json CHANGED
@@ -92,7 +92,9 @@
92
92
  "probation_until": null,
93
93
  "decided_by": "staff",
94
94
  "reason_code": "spam",
95
- "reason_text": "Your account sent the same advertising link to many people who did not know you."
95
+ "reason_text": "Your account sent the same advertising link to many people who did not know you.",
96
+ "review_requested_at": null,
97
+ "can_request_review": true
96
98
  }
97
99
  },
98
100
  "server/ack.json": {
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.37. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.38. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -336,6 +336,16 @@ export interface AccountStatus {
336
336
  *
337
337
  */
338
338
  reason_text?: string | null;
339
+ /**
340
+ * When the open request for a review by a person (`POST /me/account-status/review`) was made; `null` when
341
+ * none is open.
342
+ *
343
+ */
344
+ review_requested_at: Timestamp | null;
345
+ /**
346
+ * Whether `POST /me/account-status/review` is allowed now.
347
+ */
348
+ can_request_review: boolean;
339
349
  }
340
350
  /**
341
351
  * The server accepted the client event with this `client_temp_id`.
@@ -1456,7 +1456,9 @@
1456
1456
  "since",
1457
1457
  "restrictions",
1458
1458
  "can_appeal",
1459
- "probation_until"
1459
+ "probation_until",
1460
+ "review_requested_at",
1461
+ "can_request_review"
1460
1462
  ],
1461
1463
  "properties": {
1462
1464
  "status": {
@@ -1514,6 +1516,35 @@
1514
1516
  ],
1515
1517
  "maxLength": 1000,
1516
1518
  "description": "The explanation written for the user by the moderation team; `null` for automatic statuses. Show it as\nwritten by \"Messenger moderation\", never by a person's name.\n"
1519
+ },
1520
+ "review_requested_at": {
1521
+ "description": "When the open request for a review by a person (`POST /me/account-status/review`) was made; `null` when\nnone is open.\n",
1522
+ "oneOf": [
1523
+ {
1524
+ "$ref": "#/$defs/Timestamp"
1525
+ },
1526
+ {
1527
+ "type": "null"
1528
+ }
1529
+ ]
1530
+ },
1531
+ "can_request_review": {
1532
+ "type": "boolean",
1533
+ "description": "Whether `POST /me/account-status/review` is allowed now."
1534
+ }
1535
+ }
1536
+ },
1537
+ "AccountReviewRequest": {
1538
+ "type": "object",
1539
+ "required": [
1540
+ "text"
1541
+ ],
1542
+ "properties": {
1543
+ "text": {
1544
+ "type": "string",
1545
+ "minLength": 1,
1546
+ "maxLength": 500,
1547
+ "description": "What the user wants the reviewer to know. Trimmed; must not be empty."
1517
1548
  }
1518
1549
  }
1519
1550
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.1.0-alpha.37",
3
+ "version": "2.1.0-alpha.38.next.135",
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": {